PluginProbe
Elementor Website Builder – more than just a page builder / 3.13.1
Elementor Website Builder – more than just a page builder v3.13.1
4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 All 453 releases
elementor / assets / js / ai.js

ai.js in Elementor Website Builder – more than just a page builder 3.13.1, at assets/js/ai.js

29,298 lines 1,011.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*! elementor - v3.13.1 - 09-05-2023 */
2 /******/ (() => { // webpackBootstrap
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "../modules/ai/assets/js/editor/actions-data.js":
6 /*!******************************************************!*\
7 !*** ../modules/ai/assets/js/editor/actions-data.js ***!
8 \******************************************************/
9 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10
11 "use strict";
12 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
13
14
15 Object.defineProperty(exports, "__esModule", ({
16 value: true
17 }));
18 exports.vocalTones = exports.translateLanguages = exports.textareaAutocomplete = exports.textAutocomplete = exports.codeHtmlAutocomplete = exports.codeCssAutocomplete = void 0;
19 var textAutocomplete = [__('Craft a catchy slogan for', 'elementor'), __('Write a strong section header for', 'elementor'), __('Create a blog title for', 'elementor'), __('Suggest a 4 word headline for', 'elementor'), __('Write an attention grabbing title for', 'elementor')];
20 exports.textAutocomplete = textAutocomplete;
21 var textareaAutocomplete = [__('Write a product description for', 'elementor'), __('Create a blog post for', 'elementor'), __('Craft an about us section for', 'elementor'), __('Offer a few sentences to invite visitors to', 'elementor'), __('Write microcopy for a submission form that includes', 'elementor')];
22 exports.textareaAutocomplete = textareaAutocomplete;
23 var codeHtmlAutocomplete = [__('GA event fired on every button element click (assume GA was loaded)', 'elementor'), __('Iframe code to embed a Spotify widget on my web page. My ID is 1234567890', 'elementor'), __('Write an embed code of Google Analytics', 'elementor'), __('Write an embed code of Facebook Pixel', 'elementor'), __('HTML code that embeds the following PDF into a webpage: link to PDF', 'elementor')];
24 exports.codeHtmlAutocomplete = codeHtmlAutocomplete;
25 var codeCssAutocomplete = [__('On hover, animate 20% bigger, rotate 10 deg CCW', 'elementor'), __('Add a circle-shaped clip mask, semi transparent on hover', 'elementor'), __('Rainbow colored animated text gradient', 'elementor'), __('Add a 3D shadow to the text', 'elementor')];
26 exports.codeCssAutocomplete = codeCssAutocomplete;
27 var vocalTones = [{
28 label: __('Casual', 'elementor')
29 }, {
30 label: __('Confidence', 'elementor')
31 }, {
32 label: __('Formal', 'elementor')
33 }, {
34 label: __('Friendly', 'elementor')
35 }, {
36 label: __('Inspirational', 'elementor')
37 }, {
38 label: __('Motivational', 'elementor')
39 }, {
40 label: __('Nostalgic', 'elementor')
41 }, {
42 label: __('Playful', 'elementor')
43 }, {
44 label: __('Professional', 'elementor')
45 }, {
46 label: __('Scientific', 'elementor')
47 }, {
48 label: __('Straightforward', 'elementor')
49 }, {
50 label: __('Witty', 'elementor')
51 }];
52 exports.vocalTones = vocalTones;
53 var translateLanguages = [{
54 label: __('Arabic', 'elementor'),
55 value: 'ar-SA'
56 }, {
57 label: __('Chinese', 'elementor'),
58 value: 'zh-CN'
59 }, {
60 label: __('Czech', 'elementor'),
61 value: 'cs-CZ'
62 }, {
63 label: __('Danish', 'elementor'),
64 value: 'da-DK'
65 }, {
66 label: __('Dutch', 'elementor'),
67 value: 'nl-NL'
68 }, {
69 label: __('English', 'elementor'),
70 value: 'en-US'
71 }, {
72 label: __('Finnish', 'elementor'),
73 value: 'fi-FI'
74 }, {
75 label: __('French', 'elementor'),
76 value: 'fr-FR'
77 }, {
78 label: __('German', 'elementor'),
79 value: 'de-DE'
80 }, {
81 label: __('Greek', 'elementor'),
82 value: 'el-GR'
83 }, {
84 label: __('Hebrew', 'elementor'),
85 value: 'he-IL'
86 }, {
87 label: __('Hungarian', 'elementor'),
88 value: 'hu-HU'
89 }, {
90 label: __('Indonesian', 'elementor'),
91 value: 'id-ID'
92 }, {
93 label: __('Italian', 'elementor'),
94 value: 'it-IT'
95 }, {
96 label: __('Japanese', 'elementor'),
97 value: 'ja-JP'
98 }, {
99 label: __('Korean', 'elementor'),
100 value: 'ko-KR'
101 }, {
102 label: __('Persian', 'elementor'),
103 value: 'fa-IR'
104 }, {
105 label: __('Polish', 'elementor'),
106 value: 'pl-PL'
107 }, {
108 label: __('Portuguese', 'elementor'),
109 value: 'pt-PT'
110 }, {
111 label: __('Russian', 'elementor'),
112 value: 'ru-RU'
113 }, {
114 label: __('Spanish', 'elementor'),
115 value: 'es-ES'
116 }, {
117 label: __('Swedish', 'elementor'),
118 value: 'sv-SE'
119 }, {
120 label: __('Thai', 'elementor'),
121 value: 'th-TH'
122 }, {
123 label: __('Turkish', 'elementor'),
124 value: 'tr-TR'
125 }, {
126 label: __('Vietnamese', 'elementor'),
127 value: 'vi-VN'
128 }];
129 exports.translateLanguages = translateLanguages;
130
131 /***/ }),
132
133 /***/ "../modules/ai/assets/js/editor/ai-behavior.js":
134 /*!*****************************************************!*\
135 !*** ../modules/ai/assets/js/editor/ai-behavior.js ***!
136 \*****************************************************/
137 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
138
139 "use strict";
140 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
141 /* provided dependency */ var ReactDOM = __webpack_require__(/*! react-dom */ "react-dom");
142
143
144 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
145 Object.defineProperty(exports, "__esModule", ({
146 value: true
147 }));
148 exports["default"] = void 0;
149 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
150 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
151 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
152 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
153 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
154 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
155 var _app = _interopRequireDefault(__webpack_require__(/*! ./app */ "../modules/ai/assets/js/editor/app.js"));
156 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
157 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
158 var AiBehavior = /*#__PURE__*/function (_Marionette$Behavior) {
159 (0, _inherits2.default)(AiBehavior, _Marionette$Behavior);
160 var _super = _createSuper(AiBehavior);
161 function AiBehavior() {
162 (0, _classCallCheck2.default)(this, AiBehavior);
163 return _super.apply(this, arguments);
164 }
165 (0, _createClass2.default)(AiBehavior, [{
166 key: "initialize",
167 value: function initialize() {
168 this.type = 'text';
169 this.controlType = 'text';
170 this.buttonLabel = __('Write with AI', 'elementor');
171 this.isLabelBlock = false;
172 this.additionalOptions = {};
173 this.config = window.ElementorAiConfig;
174 }
175 }, {
176 key: "ui",
177 value: function ui() {
178 return {
179 aiButton: '.e-ai-button'
180 };
181 }
182 }, {
183 key: "events",
184 value: function events() {
185 return {
186 'click @ui.aiButton': 'onAiButtonClick'
187 };
188 }
189 }, {
190 key: "onAiButtonClick",
191 value: function onAiButtonClick(event) {
192 var _elementor, _elementor$getPrefere;
193 event.stopPropagation();
194 var colorScheme = ((_elementor = elementor) === null || _elementor === void 0 ? void 0 : (_elementor$getPrefere = _elementor.getPreferences) === null || _elementor$getPrefere === void 0 ? void 0 : _elementor$getPrefere.call(_elementor, 'ui_theme')) || 'auto';
195 var isRTL = elementorCommon.config.isRTL;
196 var rootElement = document.createElement('div');
197 document.body.append(rootElement);
198 ReactDOM.render( /*#__PURE__*/_react.default.createElement(_app.default, {
199 type: this.getOption('type'),
200 controlType: this.getOption('controlType'),
201 getControlValue: this.getOption('getControlValue'),
202 setControlValue: this.getOption('setControlValue'),
203 additionalOptions: this.getOption('additionalOptions'),
204 onClose: function onClose() {
205 ReactDOM.unmountComponentAtNode(rootElement);
206 rootElement.remove();
207 },
208 colorScheme: colorScheme,
209 isRTL: isRTL
210 }), rootElement);
211 }
212 }, {
213 key: "onRender",
214 value: function onRender() {
215 var isPromotion = !this.config.is_get_started;
216 var buttonLabel = this.getOption('buttonLabel');
217 var $button = jQuery('<button>', {
218 class: 'e-ai-button'
219 });
220 if (!isPromotion) {
221 $button.addClass('e-active');
222 }
223 $button.html('<i class="eicon-ai"></i>');
224 if (this.getOption('isLabelBlock') && isPromotion) {
225 $button.append(' ' + buttonLabel);
226 } else {
227 $button.tipsy({
228 gravity: 's',
229 title: function title() {
230 return buttonLabel;
231 }
232 });
233 }
234 this.$el.find('.elementor-control-title').after($button);
235 }
236 }]);
237 return AiBehavior;
238 }(Marionette.Behavior);
239 exports["default"] = AiBehavior;
240
241 /***/ }),
242
243 /***/ "../modules/ai/assets/js/editor/ai-promotion-behavior.js":
244 /*!***************************************************************!*\
245 !*** ../modules/ai/assets/js/editor/ai-promotion-behavior.js ***!
246 \***************************************************************/
247 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
248
249 "use strict";
250 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
251
252
253 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
254 Object.defineProperty(exports, "__esModule", ({
255 value: true
256 }));
257 exports["default"] = void 0;
258 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
259 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
260 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
261 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
262 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
263 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
264 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
265 var AiPromotionBehavior = /*#__PURE__*/function (_Marionette$Behavior) {
266 (0, _inherits2.default)(AiPromotionBehavior, _Marionette$Behavior);
267 var _super = _createSuper(AiPromotionBehavior);
268 function AiPromotionBehavior() {
269 (0, _classCallCheck2.default)(this, AiPromotionBehavior);
270 return _super.apply(this, arguments);
271 }
272 (0, _createClass2.default)(AiPromotionBehavior, [{
273 key: "initialize",
274 value: function initialize() {
275 this.promotionLabel = __('Coming soon', 'elementor');
276 }
277 }, {
278 key: "onRender",
279 value: function onRender() {
280 var promotionLabel = this.getOption('promotionLabel');
281 var $button = jQuery('<button>', {
282 class: 'e-ai-button'
283 });
284 $button.html('<i class="eicon-ai"></i>');
285 $button.tipsy({
286 gravity: 's',
287 title: function title() {
288 return promotionLabel;
289 }
290 });
291 this.$el.find('.elementor-control-title:eq(0)').after($button);
292 }
293 }]);
294 return AiPromotionBehavior;
295 }(Marionette.Behavior);
296 exports["default"] = AiPromotionBehavior;
297
298 /***/ }),
299
300 /***/ "../modules/ai/assets/js/editor/api/index.js":
301 /*!***************************************************!*\
302 !*** ../modules/ai/assets/js/editor/api/index.js ***!
303 \***************************************************/
304 /***/ ((__unused_webpack_module, exports) => {
305
306 "use strict";
307
308
309 Object.defineProperty(exports, "__esModule", ({
310 value: true
311 }));
312 exports.setStatusFeedback = exports.setGetStarted = exports.getUserInformation = exports.getEditText = exports.getCustomCode = exports.getCustomCSS = exports.getCompletionText = void 0;
313 var request = function request(endpoint) {
314 var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
315 return new Promise(function (resolve, reject) {
316 return elementorCommon.ajax.addRequest(endpoint, {
317 success: resolve,
318 error: reject,
319 data: data
320 });
321 });
322 };
323 var getUserInformation = function getUserInformation() {
324 return request('ai_get_user_information');
325 };
326 exports.getUserInformation = getUserInformation;
327 var getCompletionText = function getCompletionText(prompt) {
328 return request('ai_get_completion_text', {
329 prompt: prompt
330 });
331 };
332 exports.getCompletionText = getCompletionText;
333 var getEditText = function getEditText(input, instruction) {
334 return request('ai_get_edit_text', {
335 input: input,
336 instruction: instruction
337 });
338 };
339 exports.getEditText = getEditText;
340 var getCustomCode = function getCustomCode(prompt, language) {
341 return request('ai_get_custom_code', {
342 prompt: prompt,
343 language: language
344 });
345 };
346 exports.getCustomCode = getCustomCode;
347 var getCustomCSS = function getCustomCSS(prompt, htmlMarkup, elementId) {
348 return request('ai_get_custom_css', {
349 prompt: prompt,
350 html_markup: htmlMarkup,
351 element_id: elementId
352 });
353 };
354 exports.getCustomCSS = getCustomCSS;
355 var setGetStarted = function setGetStarted() {
356 return request('ai_set_get_started');
357 };
358 exports.setGetStarted = setGetStarted;
359 var setStatusFeedback = function setStatusFeedback(responseId) {
360 return request('ai_set_status_feedback', {
361 response_id: responseId
362 });
363 };
364 exports.setStatusFeedback = setStatusFeedback;
365
366 /***/ }),
367
368 /***/ "../modules/ai/assets/js/editor/app.js":
369 /*!*********************************************!*\
370 !*** ../modules/ai/assets/js/editor/app.js ***!
371 \*********************************************/
372 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
373
374 "use strict";
375 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
376
377
378 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
379 Object.defineProperty(exports, "__esModule", ({
380 value: true
381 }));
382 exports["default"] = void 0;
383 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
384 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
385 var _pageContent = _interopRequireDefault(__webpack_require__(/*! ./page-content */ "../modules/ai/assets/js/editor/page-content.js"));
386 var _helpers = __webpack_require__(/*! ./helpers */ "../modules/ai/assets/js/editor/helpers.js");
387 var App = function App(props) {
388 return /*#__PURE__*/_react.default.createElement(_ui.DirectionProvider, {
389 rtl: props.isRTL
390 }, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, {
391 colorScheme: props.colorScheme
392 }, /*#__PURE__*/_react.default.createElement(_pageContent.default, {
393 type: props.type,
394 controlType: props.controlType,
395 onClose: props.onClose,
396 onConnect: _helpers.onConnect,
397 getControlValue: props.getControlValue,
398 setControlValue: props.setControlValue,
399 additionalOptions: props.additionalOptions
400 })));
401 };
402 App.propTypes = {
403 colorScheme: PropTypes.oneOf(['auto', 'light', 'dark']),
404 type: PropTypes.string,
405 controlType: PropTypes.string,
406 onClose: PropTypes.func,
407 getControlValue: PropTypes.func,
408 setControlValue: PropTypes.func,
409 additionalOptions: PropTypes.object,
410 isRTL: PropTypes.bool
411 };
412 var _default = App;
413 exports["default"] = _default;
414
415 /***/ }),
416
417 /***/ "../modules/ai/assets/js/editor/components/dialog-header.js":
418 /*!******************************************************************!*\
419 !*** ../modules/ai/assets/js/editor/components/dialog-header.js ***!
420 \******************************************************************/
421 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
422
423 "use strict";
424 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
425 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
426
427
428 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
429 Object.defineProperty(exports, "__esModule", ({
430 value: true
431 }));
432 exports["default"] = void 0;
433 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
434 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
435 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
436 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
437 var _styledChip = _interopRequireDefault(__webpack_require__(/*! ./ui/styled-chip */ "../modules/ai/assets/js/editor/components/ui/styled-chip.js"));
438 var ElementorLogo = function ElementorLogo(props) {
439 return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({
440 viewBox: "0 0 32 32"
441 }, props), /*#__PURE__*/_react.default.createElement("path", {
442 fillRule: "evenodd",
443 clipRule: "evenodd",
444 d: "M2.69648 24.8891C0.938383 22.2579 0 19.1645 0 16C0 11.7566 1.68571 7.68687 4.68629 4.68629C7.68687 1.68571 11.7566 0 16 0C19.1645 0 22.2579 0.938383 24.8891 2.69648C27.5203 4.45459 29.5711 6.95344 30.7821 9.87706C31.9931 12.8007 32.3099 16.0177 31.6926 19.1214C31.0752 22.2251 29.5514 25.0761 27.3137 27.3137C25.0761 29.5514 22.2251 31.0752 19.1214 31.6926C16.0177 32.3099 12.8007 31.9931 9.87706 30.7821C6.95344 29.5711 4.45459 27.5203 2.69648 24.8891ZM12.0006 9.33281H9.33437V22.6665H12.0006V9.33281ZM22.6657 9.33281H14.6669V11.9991H22.6657V9.33281ZM22.6657 14.6654H14.6669V17.3316H22.6657V14.6654ZM22.6657 20.0003H14.6669V22.6665H22.6657V20.0003Z"
445 }));
446 };
447 var StyledElementorLogo = (0, _ui.styled)(ElementorLogo)(function (_ref) {
448 var theme = _ref.theme;
449 return {
450 width: theme.sizing['400'],
451 height: theme.sizing['400'],
452 '& path': {
453 fill: theme.palette.text.primary
454 }
455 };
456 });
457 var DialogHeader = function DialogHeader(props) {
458 return /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, {
459 component: "div",
460 sx: {
461 fontWeight: 'normal'
462 }
463 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
464 direction: "row",
465 justifyContent: "space-between",
466 alignItems: "center"
467 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
468 direction: "row",
469 spacing: 3,
470 alignItems: "center"
471 }, /*#__PURE__*/_react.default.createElement(StyledElementorLogo, null), /*#__PURE__*/_react.default.createElement(_ui.Typography, {
472 variant: "h6",
473 sx: {
474 color: 'text.primary'
475 }
476 }, __('AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_styledChip.default, {
477 label: __('Beta', 'elementor'),
478 color: "default"
479 })), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
480 direction: "row",
481 spacing: 3,
482 alignItems: "center"
483 }, props.children, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
484 "aria-label": "close",
485 onClick: props.onClose,
486 sx: {
487 '&.MuiButtonBase-root': {
488 mr: -4
489 }
490 }
491 }, /*#__PURE__*/_react.default.createElement(_icons.XIcon, null)))));
492 };
493 DialogHeader.propTypes = {
494 onClose: PropTypes.func.isRequired,
495 children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
496 };
497 var _default = DialogHeader;
498 exports["default"] = _default;
499
500 /***/ }),
501
502 /***/ "../modules/ai/assets/js/editor/components/generate-button.js":
503 /*!********************************************************************!*\
504 !*** ../modules/ai/assets/js/editor/components/generate-button.js ***!
505 \********************************************************************/
506 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
507
508 "use strict";
509 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
510
511
512 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
513 Object.defineProperty(exports, "__esModule", ({
514 value: true
515 }));
516 exports["default"] = void 0;
517 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
518 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
519 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
520 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
521 var GenerateButton = function GenerateButton(props) {
522 return /*#__PURE__*/_react.default.createElement(_ui.Button, (0, _extends2.default)({
523 variant: "contained",
524 endIcon: /*#__PURE__*/_react.default.createElement(_icons.AIIcon, null),
525 disabled: !prompt,
526 "aria-label": __('search', 'elementor'),
527 type: "submit",
528 size: "small",
529 sx: {
530 '& .MuiButton-endIcon': {
531 width: 18
532 }
533 }
534 }, props));
535 };
536 var _default = GenerateButton;
537 exports["default"] = _default;
538
539 /***/ }),
540
541 /***/ "../modules/ai/assets/js/editor/components/loader.js":
542 /*!***********************************************************!*\
543 !*** ../modules/ai/assets/js/editor/components/loader.js ***!
544 \***********************************************************/
545 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
546
547 "use strict";
548
549
550 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
551 Object.defineProperty(exports, "__esModule", ({
552 value: true
553 }));
554 exports["default"] = void 0;
555 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
556 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
557 var Loader = function Loader() {
558 return /*#__PURE__*/_react.default.createElement(_ui.Box, {
559 sx: {
560 px: 4,
561 py: 6
562 }
563 }, /*#__PURE__*/_react.default.createElement(_ui.LinearProgress, {
564 color: "secondary"
565 }));
566 };
567 var _default = Loader;
568 exports["default"] = _default;
569
570 /***/ }),
571
572 /***/ "../modules/ai/assets/js/editor/components/prompt-action-selection.js":
573 /*!****************************************************************************!*\
574 !*** ../modules/ai/assets/js/editor/components/prompt-action-selection.js ***!
575 \****************************************************************************/
576 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
577
578 "use strict";
579 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
580
581
582 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
583 Object.defineProperty(exports, "__esModule", ({
584 value: true
585 }));
586 exports["default"] = void 0;
587 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
588 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
589 var labelToDashCash = function labelToDashCash(str) {
590 return str.toLowerCase().replace(/ /g, '-');
591 };
592 var PromptActionSelection = function PromptActionSelection(props) {
593 var actionId = labelToDashCash(props.label);
594 return /*#__PURE__*/_react.default.createElement(_ui.FormControl, {
595 sx: {
596 width: 138
597 }
598 }, /*#__PURE__*/_react.default.createElement(_ui.InputLabel, {
599 id: actionId
600 }, props.label), /*#__PURE__*/_react.default.createElement(_ui.Select, {
601 labelId: actionId,
602 id: actionId,
603 value: "",
604 color: "secondary",
605 onChange: props.onChange,
606 size: "small",
607 label: props.label,
608 MenuProps: {
609 PaperProps: {
610 sx: {
611 width: 138
612 }
613 }
614 }
615 }, props.options.map(function (option) {
616 return /*#__PURE__*/_react.default.createElement(_ui.MenuItem, {
617 dense: true,
618 key: option.label,
619 value: option.label
620 }, option.label);
621 })));
622 };
623 PromptActionSelection.propTypes = {
624 label: PropTypes.string.isRequired,
625 options: PropTypes.arrayOf(PropTypes.shape({
626 label: PropTypes.string.isRequired
627 })).isRequired,
628 onChange: PropTypes.func.isRequired
629 };
630 var _default = PromptActionSelection;
631 exports["default"] = _default;
632
633 /***/ }),
634
635 /***/ "../modules/ai/assets/js/editor/components/prompt-action.js":
636 /*!******************************************************************!*\
637 !*** ../modules/ai/assets/js/editor/components/prompt-action.js ***!
638 \******************************************************************/
639 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
640
641 "use strict";
642
643
644 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
645 Object.defineProperty(exports, "__esModule", ({
646 value: true
647 }));
648 exports["default"] = void 0;
649 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
650 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
651 var _styledChip = _interopRequireDefault(__webpack_require__(/*! ./ui/styled-chip */ "../modules/ai/assets/js/editor/components/ui/styled-chip.js"));
652 var PromptAction = function PromptAction(props) {
653 return /*#__PURE__*/_react.default.createElement(_styledChip.default, (0, _extends2.default)({
654 size: "large",
655 color: "secondary",
656 variant: "outlined"
657 }, props));
658 };
659 var _default = PromptAction;
660 exports["default"] = _default;
661
662 /***/ }),
663
664 /***/ "../modules/ai/assets/js/editor/components/prompt-credits.js":
665 /*!*******************************************************************!*\
666 !*** ../modules/ai/assets/js/editor/components/prompt-credits.js ***!
667 \*******************************************************************/
668 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
669
670 "use strict";
671 /* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
672 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
673 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
674
675
676 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
677 Object.defineProperty(exports, "__esModule", ({
678 value: true
679 }));
680 exports["default"] = void 0;
681 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
682 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
683 var PromptCredits = function PromptCredits(props) {
684 if (props.usagePercentage < 80) {
685 return null;
686 }
687 return /*#__PURE__*/_react.default.createElement(_ui.Typography, {
688 variant: "caption",
689 color: "text.tertiary"
690 }, /* Translators: %s: AI prompt remained credits. */
691 sprintf(__('You\'ve used %s of the free trial.', 'elementor'), props.usagePercentage + '%'), ' ', /*#__PURE__*/_react.default.createElement("a", {
692 href: "https://go.elementor.com/ai-popup-purchase-limit-reached-80-percent/",
693 target: "_blank",
694 rel: "noreferrer"
695 }, __('Upgrade for unlimited access', 'elementor')), ".");
696 };
697 PromptCredits.propTypes = {
698 usagePercentage: PropTypes.number.isRequired
699 };
700 var _default = PromptCredits;
701 exports["default"] = _default;
702
703 /***/ }),
704
705 /***/ "../modules/ai/assets/js/editor/components/prompt-dialog.js":
706 /*!******************************************************************!*\
707 !*** ../modules/ai/assets/js/editor/components/prompt-dialog.js ***!
708 \******************************************************************/
709 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
710
711 "use strict";
712 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
713
714
715 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
716 Object.defineProperty(exports, "__esModule", ({
717 value: true
718 }));
719 exports["default"] = void 0;
720 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
721 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
722 var _reactDraggable = _interopRequireDefault(__webpack_require__(/*! react-draggable */ "../node_modules/react-draggable/build/cjs/cjs.js"));
723 var _dialogHeader = _interopRequireDefault(__webpack_require__(/*! ./dialog-header */ "../modules/ai/assets/js/editor/components/dialog-header.js"));
724 var PromptDialog = function PromptDialog(props) {
725 return /*#__PURE__*/_react.default.createElement(_reactDraggable.default, {
726 handle: ".MuiDialogTitle-root",
727 cancel: '[class*="MuiDialogContent-root"]'
728 }, /*#__PURE__*/_react.default.createElement(_ui.Dialog, {
729 open: true,
730 onClose: props.onClose,
731 fullWidth: true,
732 hideBackdrop: true,
733 maxWidth: "sm",
734 sx: {
735 '& .MuiDialog-container': {
736 alignItems: 'flex-start',
737 mt: '17vh'
738 }
739 },
740 PaperProps: {
741 sx: {
742 maxHeight: '72vh'
743 }
744 }
745 }, /*#__PURE__*/_react.default.createElement(_dialogHeader.default, {
746 onClose: props.onClose
747 }, props.headerAction), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, null, props.children)));
748 };
749 PromptDialog.propTypes = {
750 headerAction: PropTypes.node,
751 onClose: PropTypes.func.isRequired,
752 children: PropTypes.node.isRequired
753 };
754 var _default = PromptDialog;
755 exports["default"] = _default;
756
757 /***/ }),
758
759 /***/ "../modules/ai/assets/js/editor/components/prompt-error-message.js":
760 /*!*************************************************************************!*\
761 !*** ../modules/ai/assets/js/editor/components/prompt-error-message.js ***!
762 \*************************************************************************/
763 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
764
765 "use strict";
766 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
767 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
768
769
770 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
771 Object.defineProperty(exports, "__esModule", ({
772 value: true
773 }));
774 exports["default"] = void 0;
775 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
776 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
777 var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js"));
778 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
779 var _excluded = ["error", "onRetry"];
780 var PromptErrorMessage = function PromptErrorMessage(_ref) {
781 var error = _ref.error,
782 _ref$onRetry = _ref.onRetry,
783 onRetry = _ref$onRetry === void 0 ? function () {} : _ref$onRetry,
784 props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
785 var messages = {
786 default: {
787 text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Unknown error. Please try again later.', 'elementor')),
788 description: __('Error code:', 'elementor') + ' ' + error,
789 buttonText: __('Try Again', 'elementor'),
790 buttonAction: onRetry
791 },
792 service_outage_internal: {
793 text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Elementor AI is temporarily unavailable', 'elementor')),
794 description: __('Seems like we are experiencing technical difficulty. We should be up and running shortly.', 'elementor'),
795 buttonText: __('Try Again', 'elementor'),
796 buttonAction: onRetry
797 },
798 invalid_connect_data: {
799 text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Reconnect your account', 'elementor')),
800 description: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, __('We couldn\'t connect to your account due to technical difficulties on our end. Reconnect your account to continue.', 'elementor'), ' ', /*#__PURE__*/_react.default.createElement("a", {
801 href: "https://elementor.com/help/disconnecting-reconnecting-your-elementor-account/",
802 target: "_blank",
803 rel: "noreferrer"
804 }, __('Show me how', 'elementor')))
805 },
806 not_connected: {
807 text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('You aren\'t connected to Elementor AI.', 'elementor')),
808 description: __('Elementor AI is just a few clicks away. Connect your account to instantly create texts and custom code.', 'elementor')
809 },
810 quota_reached_trail: {
811 severity: 'info',
812 text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('It\'s time to upgrade.', 'elementor')),
813 description: __('Enjoy the free trial? Upgrade now for unlimited access to built-in text and custom code generators.', 'elementor'),
814 buttonText: __('Upgrade', 'elementor'),
815 buttonAction: function buttonAction() {
816 return window.open('https://go.elementor.com/ai-popup-purchase-limit-reached/', '_blank');
817 }
818 },
819 quota_reached_subscription: {
820 severity: 'info',
821 text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('It\'s time to upgrade.', 'elementor')),
822 description: __('Love Elementor AI? Upgrade to continue creating with built-in text and custom code generators.', 'elementor'),
823 buttonText: __('Upgrade', 'elementor'),
824 buttonAction: function buttonAction() {
825 return window.open('https://go.elementor.com/ai-popup-purchase-limit-reached/', '_blank');
826 }
827 },
828 rate_limit_network: {
829 text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Whoa! Slow down there.', 'elementor')),
830 description: __('We can’t process that many requests so fast. Try again in 15 minutes.', 'elementor')
831 }
832 };
833 var message = messages[error] || messages.default;
834 return /*#__PURE__*/_react.default.createElement(_ui.Alert, (0, _extends2.default)({
835 severity: message.severity || 'error',
836 action: (message === null || message === void 0 ? void 0 : message.buttonText) && /*#__PURE__*/_react.default.createElement(_ui.Button, {
837 color: "inherit",
838 size: "small",
839 variant: "outlined",
840 onClick: message.buttonAction,
841 sx: {
842 height: 'auto',
843 // TODO: Fix in UI library.
844 minHeight: '32px'
845 }
846 }, message.buttonText)
847 }, props), message.text, message.description);
848 };
849 PromptErrorMessage.propTypes = {
850 error: PropTypes.string,
851 onRetry: PropTypes.func
852 };
853 var _default = PromptErrorMessage;
854 exports["default"] = _default;
855
856 /***/ }),
857
858 /***/ "../modules/ai/assets/js/editor/components/prompt-search.js":
859 /*!******************************************************************!*\
860 !*** ../modules/ai/assets/js/editor/components/prompt-search.js ***!
861 \******************************************************************/
862 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
863
864 "use strict";
865 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
866
867
868 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
869 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
870 Object.defineProperty(exports, "__esModule", ({
871 value: true
872 }));
873 exports["default"] = void 0;
874 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
875 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
876 var _searchField = _interopRequireDefault(__webpack_require__(/*! ./ui/search-field */ "../modules/ai/assets/js/editor/components/ui/search-field.js"));
877 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
878 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
879 var PromptSearch = (0, _react.forwardRef)(function (props, ref) {
880 return /*#__PURE__*/_react.default.createElement(_searchField.default, (0, _extends2.default)({
881 name: "prompt",
882 placeholder: __('Describe the text and tone you want to use', 'elementor') + '...'
883 }, props, {
884 ref: ref
885 }));
886 });
887 var _default = PromptSearch;
888 exports["default"] = _default;
889
890 /***/ }),
891
892 /***/ "../modules/ai/assets/js/editor/components/prompt-suggestions.js":
893 /*!***********************************************************************!*\
894 !*** ../modules/ai/assets/js/editor/components/prompt-suggestions.js ***!
895 \***********************************************************************/
896 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
897
898 "use strict";
899 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
900 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
901
902
903 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
904 Object.defineProperty(exports, "__esModule", ({
905 value: true
906 }));
907 exports["default"] = void 0;
908 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
909 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
910 var _styledChip = _interopRequireDefault(__webpack_require__(/*! ./ui/styled-chip */ "../modules/ai/assets/js/editor/components/ui/styled-chip.js"));
911 var PromptSuggestions = function PromptSuggestions(props) {
912 var _props$suggestions;
913 return /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_ui.Typography, {
914 variant: "subtitle1",
915 color: "text.secondary"
916 }, __('Suggested prompts', 'elementor') + ':'), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
917 direction: "column",
918 alignItems: "flex-start",
919 gap: 3,
920 sx: {
921 my: 3
922 }
923 }, (_props$suggestions = props.suggestions) === null || _props$suggestions === void 0 ? void 0 : _props$suggestions.map(function (option, index) {
924 var _props$suggestionFilt;
925 return /*#__PURE__*/_react.default.createElement(_styledChip.default, {
926 key: index,
927 variant: "outlined",
928 size: "large",
929 color: "secondary",
930 label: ((_props$suggestionFilt = props.suggestionFilter) === null || _props$suggestionFilt === void 0 ? void 0 : _props$suggestionFilt.call(props, option)) || option,
931 onClick: function onClick() {
932 return props.onSelect(option);
933 }
934 });
935 })));
936 };
937 PromptSuggestions.propTypes = {
938 suggestions: PropTypes.arrayOf(PropTypes.string),
939 onSelect: PropTypes.func.isRequired,
940 suggestionFilter: PropTypes.func
941 };
942 var _default = PromptSuggestions;
943 exports["default"] = _default;
944
945 /***/ }),
946
947 /***/ "../modules/ai/assets/js/editor/components/text-area.js":
948 /*!**************************************************************!*\
949 !*** ../modules/ai/assets/js/editor/components/text-area.js ***!
950 \**************************************************************/
951 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
952
953 "use strict";
954 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
955
956
957 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
958 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
959 Object.defineProperty(exports, "__esModule", ({
960 value: true
961 }));
962 exports["default"] = void 0;
963 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
964 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
965 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
966 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
967 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
968 var TextArea = (0, _react.forwardRef)(function (props, ref) {
969 return /*#__PURE__*/_react.default.createElement(_ui.TextField, (0, _extends2.default)({
970 ref: ref,
971 multiline: true,
972 fullWidth: true,
973 minRows: 4,
974 maxRows: 20,
975 value: props.value,
976 onChange: props.onChange,
977 helperText: props.helperText
978 }, props));
979 });
980 TextArea.propTypes = {
981 value: PropTypes.string,
982 onChange: PropTypes.func,
983 helperText: PropTypes.string
984 };
985 var _default = TextArea;
986 exports["default"] = _default;
987
988 /***/ }),
989
990 /***/ "../modules/ai/assets/js/editor/components/ui/search-field.js":
991 /*!********************************************************************!*\
992 !*** ../modules/ai/assets/js/editor/components/ui/search-field.js ***!
993 \********************************************************************/
994 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
995
996 "use strict";
997 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
998
999
1000 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1001 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1002 Object.defineProperty(exports, "__esModule", ({
1003 value: true
1004 }));
1005 exports["default"] = void 0;
1006 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
1007 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
1008 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1009 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
1010 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
1011 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1012 var StyledTextField = (0, _ui.styled)(_ui.TextField)(function (_ref) {
1013 var theme = _ref.theme;
1014 return {
1015 // Overwriting the admin global CSS.
1016 '& .MuiInputBase-input, & .MuiInputBase-input:focus': {
1017 backgroundColor: theme.palette.background.default,
1018 border: 'none',
1019 boxShadow: 'none',
1020 color: theme.palette.text.primary,
1021 padding: theme.spacing(0, 3),
1022 outline: 'none'
1023 },
1024 '& .MuiInputAdornment-root': {
1025 color: theme.palette.text.tertiary
1026 }
1027 };
1028 });
1029 var SearchField = (0, _react.forwardRef)(function (props, ref) {
1030 return /*#__PURE__*/_react.default.createElement(StyledTextField
1031 // eslint-disable-next-line jsx-a11y/no-autofocus
1032 , (0, _extends2.default)({
1033 autoFocus: true,
1034 fullWidth: true,
1035 required: true,
1036 color: "secondary",
1037 InputProps: {
1038 autoComplete: 'off',
1039 startAdornment: /*#__PURE__*/_react.default.createElement(_ui.InputAdornment, {
1040 position: "start"
1041 }, /*#__PURE__*/_react.default.createElement(_icons.SearchIcon, null))
1042 },
1043 placeholder: props.placeholder,
1044 name: props.name,
1045 value: props.value,
1046 onChange: props.onChange
1047 }, props, {
1048 ref: ref
1049 }));
1050 });
1051 SearchField.propTypes = {
1052 placeholder: PropTypes.string,
1053 name: PropTypes.string,
1054 value: PropTypes.string,
1055 onChange: PropTypes.func
1056 };
1057 var _default = SearchField;
1058 exports["default"] = _default;
1059
1060 /***/ }),
1061
1062 /***/ "../modules/ai/assets/js/editor/components/ui/styled-chip.js":
1063 /*!*******************************************************************!*\
1064 !*** ../modules/ai/assets/js/editor/components/ui/styled-chip.js ***!
1065 \*******************************************************************/
1066 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1067
1068 "use strict";
1069
1070
1071 Object.defineProperty(exports, "__esModule", ({
1072 value: true
1073 }));
1074 exports["default"] = void 0;
1075 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1076 var StyledChip = (0, _ui.styled)(_ui.Chip)(function () {
1077 return {
1078 '& .MuiChip-label': {
1079 lineHeight: 1.5
1080 },
1081 '& .MuiSvgIcon-root.MuiChip-icon': {
1082 fontSize: '1.25rem'
1083 }
1084 };
1085 });
1086 var _default = StyledChip;
1087 exports["default"] = _default;
1088
1089 /***/ }),
1090
1091 /***/ "../modules/ai/assets/js/editor/components/upgrade-chip.js":
1092 /*!*****************************************************************!*\
1093 !*** ../modules/ai/assets/js/editor/components/upgrade-chip.js ***!
1094 \*****************************************************************/
1095 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1096
1097 "use strict";
1098 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1099
1100
1101 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1102 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1103 Object.defineProperty(exports, "__esModule", ({
1104 value: true
1105 }));
1106 exports["default"] = void 0;
1107 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
1108 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1109 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1110 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
1111 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
1112 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1113 var popoverId = 'e-ai-upgrade-popover';
1114 var StyledContent = (0, _ui.styled)(_ui.Box)(function (_ref) {
1115 var theme = _ref.theme;
1116 return {
1117 position: 'relative',
1118 marginTop: theme.spacing(7),
1119 padding: theme.spacing(7),
1120 backgroundColor: theme.palette.background.paper,
1121 boxShadow: theme.shadows[4],
1122 borderRadius: theme.border.radius.sm,
1123 zIndex: '9999'
1124 };
1125 });
1126 var StyledArrow = (0, _ui.styled)(_ui.Box)(function (_ref2) {
1127 var theme = _ref2.theme;
1128 return {
1129 width: theme.sizing[500],
1130 height: theme.sizing[200],
1131 position: 'absolute',
1132 top: "calc(".concat(theme.sizing[200], " * -1)"),
1133 left: '50%',
1134 transform: 'translateX(-50%) rotate(180deg)',
1135 overflow: 'hidden',
1136 '&::after': {
1137 backgroundColor: theme.palette.background.paper,
1138 content: '""',
1139 display: 'block',
1140 position: 'absolute',
1141 width: theme.sizing[200],
1142 height: theme.sizing[200],
1143 top: 0,
1144 left: '50%',
1145 transform: 'translateX(-50%) translateY(-50%) rotate(45deg)',
1146 boxShadow: '1px 1px 5px 0px rgba(0, 0, 0, 0.2)'
1147 }
1148 };
1149 });
1150 var upgradeBullets = [__('Generate professional texts about any topic, in any tone.', 'elementor'), __('Translate your content into twenty-five different languages.', 'elementor'), __('Unleash infinite possibilities with the custom code generator.', 'elementor')];
1151 var Chip = (0, _ui.styled)(_ui.Chip)(function () {
1152 return {
1153 '& .MuiChip-label': {
1154 lineHeight: 1.5
1155 },
1156 '& .MuiSvgIcon-root.MuiChip-icon': {
1157 fontSize: '1.25rem'
1158 }
1159 };
1160 });
1161 var UpgradeChip = function UpgradeChip() {
1162 var _useState = (0, _react.useState)(false),
1163 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
1164 isPopoverOpen = _useState2[0],
1165 setIsPopoverOpen = _useState2[1];
1166 var anchorEl = (0, _react.useRef)(null);
1167 var showPopover = function showPopover() {
1168 return setIsPopoverOpen(true);
1169 };
1170 var hidePopover = function hidePopover() {
1171 return setIsPopoverOpen(false);
1172 };
1173 return /*#__PURE__*/_react.default.createElement(_ui.Box, {
1174 component: "span",
1175 "aria-owns": isPopoverOpen ? popoverId : undefined,
1176 "aria-haspopup": "true",
1177 onMouseEnter: showPopover,
1178 onMouseLeave: hidePopover,
1179 ref: anchorEl
1180 }, /*#__PURE__*/_react.default.createElement(Chip, {
1181 color: "accent",
1182 label: __('Upgrade', 'elementor'),
1183 icon: /*#__PURE__*/_react.default.createElement(_icons.UpgradeIcon, null)
1184 }), /*#__PURE__*/_react.default.createElement(_ui.Popper, {
1185 open: isPopoverOpen,
1186 anchorEl: anchorEl.current,
1187 sx: {
1188 zIndex: '9999',
1189 maxWidth: 300
1190 }
1191 }, /*#__PURE__*/_react.default.createElement(StyledContent, null, /*#__PURE__*/_react.default.createElement(StyledArrow, null), /*#__PURE__*/_react.default.createElement(_ui.Typography, {
1192 variant: "h5",
1193 color: "text.primary"
1194 }, __('Unlimited access to Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.List, {
1195 sx: {
1196 mb: 7
1197 }
1198 }, upgradeBullets.map(function (bullet, index) {
1199 return /*#__PURE__*/_react.default.createElement(_ui.ListItem, {
1200 key: index,
1201 disableGutters: true,
1202 sx: {
1203 alignItems: 'flex-start',
1204 my: 4
1205 }
1206 }, /*#__PURE__*/_react.default.createElement(_ui.ListItemIcon, {
1207 sx: {
1208 mr: 3
1209 }
1210 }, /*#__PURE__*/_react.default.createElement(_icons.CheckedCircleIcon, null)), /*#__PURE__*/_react.default.createElement(_ui.ListItemText, {
1211 sx: {
1212 m: 0
1213 }
1214 }, /*#__PURE__*/_react.default.createElement(_ui.Typography, {
1215 variant: "body2"
1216 }, bullet)));
1217 })), /*#__PURE__*/_react.default.createElement(_ui.Button, {
1218 variant: "contained",
1219 color: "accent",
1220 size: "small",
1221 href: "https://go.elementor.com/ai-popup-purchase-dropdown/",
1222 target: "_blank",
1223 startIcon: /*#__PURE__*/_react.default.createElement(_icons.UpgradeIcon, null),
1224 sx: {
1225 '&:hover': {
1226 color: 'accent.contrastText'
1227 }
1228 }
1229 }, __('Get Elementor AI', 'elementor')))));
1230 };
1231 var _default = UpgradeChip;
1232 exports["default"] = _default;
1233
1234 /***/ }),
1235
1236 /***/ "../modules/ai/assets/js/editor/components/wizard-dialog.js":
1237 /*!******************************************************************!*\
1238 !*** ../modules/ai/assets/js/editor/components/wizard-dialog.js ***!
1239 \******************************************************************/
1240 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1241
1242 "use strict";
1243 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
1244
1245
1246 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1247 Object.defineProperty(exports, "__esModule", ({
1248 value: true
1249 }));
1250 exports["default"] = void 0;
1251 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
1252 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1253 var _dialogHeader = _interopRequireDefault(__webpack_require__(/*! ./dialog-header */ "../modules/ai/assets/js/editor/components/dialog-header.js"));
1254 var WizardDialog = function WizardDialog(props) {
1255 return /*#__PURE__*/_react.default.createElement(_ui.Dialog, {
1256 open: true,
1257 onClose: props.onClose,
1258 fullWidth: true,
1259 hideBackdrop: true,
1260 maxWidth: "lg",
1261 PaperProps: {
1262 sx: {
1263 height: '88vh'
1264 }
1265 },
1266 sx: {
1267 zIndex: 9999
1268 }
1269 }, /*#__PURE__*/_react.default.createElement(_dialogHeader.default, {
1270 onClose: props.onClose
1271 }, props.headerAction), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, {
1272 sx: {
1273 display: 'flex',
1274 flexDirection: 'column',
1275 justifyContent: 'center'
1276 }
1277 }, props.children));
1278 };
1279 WizardDialog.propTypes = {
1280 headerAction: PropTypes.node,
1281 onClose: PropTypes.func.isRequired,
1282 children: PropTypes.node.isRequired
1283 };
1284 var _default = WizardDialog;
1285 exports["default"] = _default;
1286
1287 /***/ }),
1288
1289 /***/ "../modules/ai/assets/js/editor/helpers.js":
1290 /*!*************************************************!*\
1291 !*** ../modules/ai/assets/js/editor/helpers.js ***!
1292 \*************************************************/
1293 /***/ ((__unused_webpack_module, exports) => {
1294
1295 "use strict";
1296
1297
1298 Object.defineProperty(exports, "__esModule", ({
1299 value: true
1300 }));
1301 exports.onConnect = void 0;
1302 var onConnect = function onConnect(data) {
1303 elementorCommon.config.library_connect.is_connected = true;
1304 elementorCommon.config.library_connect.current_access_level = data.accessLevel;
1305 };
1306 exports.onConnect = onConnect;
1307
1308 /***/ }),
1309
1310 /***/ "../modules/ai/assets/js/editor/hooks/use-code-prompt.js":
1311 /*!***************************************************************!*\
1312 !*** ../modules/ai/assets/js/editor/hooks/use-code-prompt.js ***!
1313 \***************************************************************/
1314 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1315
1316 "use strict";
1317
1318
1319 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1320 Object.defineProperty(exports, "__esModule", ({
1321 value: true
1322 }));
1323 exports["default"] = void 0;
1324 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1325 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1326 var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js");
1327 var _usePrompt = _interopRequireDefault(__webpack_require__(/*! ./use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js"));
1328 var getCodeResult = /*#__PURE__*/function () {
1329 var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(prompt, _ref) {
1330 var codeLanguage, htmlMarkup, elementId;
1331 return _regenerator.default.wrap(function _callee$(_context) {
1332 while (1) switch (_context.prev = _context.next) {
1333 case 0:
1334 codeLanguage = _ref.codeLanguage, htmlMarkup = _ref.htmlMarkup, elementId = _ref.elementId;
1335 if (!('css' === codeLanguage)) {
1336 _context.next = 3;
1337 break;
1338 }
1339 return _context.abrupt("return", (0, _api.getCustomCSS)(prompt, htmlMarkup, elementId));
1340 case 3:
1341 return _context.abrupt("return", (0, _api.getCustomCode)(prompt, codeLanguage));
1342 case 4:
1343 case "end":
1344 return _context.stop();
1345 }
1346 }, _callee);
1347 }));
1348 return function getCodeResult(_x, _x2) {
1349 return _ref2.apply(this, arguments);
1350 };
1351 }();
1352 var useCodePrompt = function useCodePrompt(_ref3) {
1353 var codeLanguage = _ref3.codeLanguage,
1354 htmlMarkup = _ref3.htmlMarkup,
1355 elementId = _ref3.elementId,
1356 credits = _ref3.initialCredits;
1357 var promptData = (0, _usePrompt.default)(function (promptValue) {
1358 return getCodeResult(promptValue, {
1359 codeLanguage: codeLanguage,
1360 htmlMarkup: htmlMarkup,
1361 elementId: elementId
1362 });
1363 }, {
1364 credits: credits
1365 });
1366 return promptData;
1367 };
1368 var _default = useCodePrompt;
1369 exports["default"] = _default;
1370
1371 /***/ }),
1372
1373 /***/ "../modules/ai/assets/js/editor/hooks/use-prompt.js":
1374 /*!**********************************************************!*\
1375 !*** ../modules/ai/assets/js/editor/hooks/use-prompt.js ***!
1376 \**********************************************************/
1377 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1378
1379 "use strict";
1380
1381
1382 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1383 Object.defineProperty(exports, "__esModule", ({
1384 value: true
1385 }));
1386 exports["default"] = void 0;
1387 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1388 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1389 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1390 var _react = __webpack_require__(/*! react */ "react");
1391 var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js");
1392 var normalizeResponse = function normalizeResponse(_ref) {
1393 var text = _ref.text,
1394 responseId = _ref.response_id,
1395 usage = _ref.usage;
1396 var creditsData = usage ? usage.quota - usage.usedQuota : 0;
1397 var credits = Math.max(creditsData, 0);
1398 return {
1399 result: text,
1400 responseId: responseId,
1401 credits: credits
1402 };
1403 };
1404 var usePrompt = function usePrompt(fetchData, initialState) {
1405 var _useState = (0, _react.useState)(false),
1406 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
1407 isLoading = _useState2[0],
1408 setIsLoading = _useState2[1];
1409 var _useState3 = (0, _react.useState)(''),
1410 _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
1411 error = _useState4[0],
1412 setError = _useState4[1];
1413 var _useState5 = (0, _react.useState)(initialState),
1414 _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
1415 data = _useState6[0],
1416 setData = _useState6[1];
1417 var send = /*#__PURE__*/function () {
1418 var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
1419 var _args = arguments;
1420 return _regenerator.default.wrap(function _callee$(_context) {
1421 while (1) switch (_context.prev = _context.next) {
1422 case 0:
1423 setError('');
1424 setIsLoading(true);
1425 fetchData.apply(void 0, _args).then(function (result) {
1426 return setData(normalizeResponse(result));
1427 }).catch(function (err) {
1428 return setError((err === null || err === void 0 ? void 0 : err.responseText) || err);
1429 }).finally(function () {
1430 return setIsLoading(false);
1431 });
1432 case 3:
1433 case "end":
1434 return _context.stop();
1435 }
1436 }, _callee);
1437 }));
1438 return function send() {
1439 return _ref2.apply(this, arguments);
1440 };
1441 }();
1442 var sendUsageData = function sendUsageData() {
1443 return data.responseId && (0, _api.setStatusFeedback)(data.responseId);
1444 };
1445 var reset = function reset() {
1446 setData(function (_ref3) {
1447 var credits = _ref3.credits;
1448 return {
1449 credits: credits,
1450 result: '',
1451 responseId: ''
1452 };
1453 });
1454 setError('');
1455 setIsLoading(false);
1456 };
1457 return {
1458 isLoading: isLoading,
1459 error: error,
1460 data: data,
1461 reset: reset,
1462 send: send,
1463 sendUsageData: sendUsageData
1464 };
1465 };
1466 var _default = usePrompt;
1467 exports["default"] = _default;
1468
1469 /***/ }),
1470
1471 /***/ "../modules/ai/assets/js/editor/hooks/use-text-prompt.js":
1472 /*!***************************************************************!*\
1473 !*** ../modules/ai/assets/js/editor/hooks/use-text-prompt.js ***!
1474 \***************************************************************/
1475 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1476
1477 "use strict";
1478
1479
1480 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1481 Object.defineProperty(exports, "__esModule", ({
1482 value: true
1483 }));
1484 exports["default"] = void 0;
1485 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1486 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1487 var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js");
1488 var _usePrompt = _interopRequireDefault(__webpack_require__(/*! ./use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js"));
1489 var getTextResult = /*#__PURE__*/function () {
1490 var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(prompt, instruction) {
1491 return _regenerator.default.wrap(function _callee$(_context) {
1492 while (1) switch (_context.prev = _context.next) {
1493 case 0:
1494 if (!instruction) {
1495 _context.next = 2;
1496 break;
1497 }
1498 return _context.abrupt("return", (0, _api.getEditText)(prompt, instruction));
1499 case 2:
1500 return _context.abrupt("return", (0, _api.getCompletionText)(prompt));
1501 case 3:
1502 case "end":
1503 return _context.stop();
1504 }
1505 }, _callee);
1506 }));
1507 return function getTextResult(_x, _x2) {
1508 return _ref.apply(this, arguments);
1509 };
1510 }();
1511 var useTextPrompt = function useTextPrompt(initialValue) {
1512 var promptData = (0, _usePrompt.default)(getTextResult, initialValue);
1513 return promptData;
1514 };
1515 var _default = useTextPrompt;
1516 exports["default"] = _default;
1517
1518 /***/ }),
1519
1520 /***/ "../modules/ai/assets/js/editor/hooks/use-user-info.js":
1521 /*!*************************************************************!*\
1522 !*** ../modules/ai/assets/js/editor/hooks/use-user-info.js ***!
1523 \*************************************************************/
1524 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1525
1526 "use strict";
1527
1528
1529 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1530 Object.defineProperty(exports, "__esModule", ({
1531 value: true
1532 }));
1533 exports["default"] = void 0;
1534 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1535 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1536 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1537 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1538 var _react = __webpack_require__(/*! react */ "react");
1539 var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js");
1540 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1541 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1542 var useUserInfo = function useUserInfo() {
1543 var _useState = (0, _react.useState)(false),
1544 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
1545 isLoading = _useState2[0],
1546 setIsLoading = _useState2[1];
1547 var _useState3 = (0, _react.useState)({
1548 is_connected: false,
1549 is_get_started: false,
1550 connect_url: '',
1551 usage: {
1552 hasAiSubscription: false,
1553 quota: 0,
1554 usedQuota: 0
1555 }
1556 }),
1557 _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
1558 userInfo = _useState4[0],
1559 setUserInfo = _useState4[1];
1560 var credits = userInfo.usage.quota - userInfo.usage.usedQuota;
1561 var usagePercentage = userInfo.usage.usedQuota / userInfo.usage.quota * 100;
1562 var fetchData = /*#__PURE__*/function () {
1563 var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
1564 var userInfoResult;
1565 return _regenerator.default.wrap(function _callee$(_context) {
1566 while (1) switch (_context.prev = _context.next) {
1567 case 0:
1568 setIsLoading(true);
1569 _context.next = 3;
1570 return (0, _api.getUserInformation)();
1571 case 3:
1572 userInfoResult = _context.sent;
1573 setUserInfo(function (prevState) {
1574 return _objectSpread(_objectSpread({}, prevState), userInfoResult);
1575 });
1576 setIsLoading(false);
1577 case 6:
1578 case "end":
1579 return _context.stop();
1580 }
1581 }, _callee);
1582 }));
1583 return function fetchData() {
1584 return _ref.apply(this, arguments);
1585 };
1586 }();
1587 (0, _react.useEffect)(function () {
1588 fetchData();
1589 }, []);
1590 return {
1591 isLoading: isLoading,
1592 isConnected: userInfo.is_connected,
1593 isGetStarted: userInfo.is_get_started,
1594 connectUrl: userInfo.connect_url,
1595 hasSubscription: userInfo.usage.hasAiSubscription,
1596 credits: credits < 0 ? 0 : credits,
1597 usagePercentage: Math.round(usagePercentage),
1598 fetchData: fetchData
1599 };
1600 };
1601 var _default = useUserInfo;
1602 exports["default"] = _default;
1603
1604 /***/ }),
1605
1606 /***/ "../modules/ai/assets/js/editor/module.js":
1607 /*!************************************************!*\
1608 !*** ../modules/ai/assets/js/editor/module.js ***!
1609 \************************************************/
1610 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1611
1612 "use strict";
1613 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1614
1615
1616 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1617 Object.defineProperty(exports, "__esModule", ({
1618 value: true
1619 }));
1620 exports["default"] = void 0;
1621 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1622 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1623 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1624 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1625 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1626 var _aiBehavior = _interopRequireDefault(__webpack_require__(/*! ./ai-behavior */ "../modules/ai/assets/js/editor/ai-behavior.js"));
1627 var _aiPromotionBehavior = _interopRequireDefault(__webpack_require__(/*! ./ai-promotion-behavior */ "../modules/ai/assets/js/editor/ai-promotion-behavior.js"));
1628 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
1629 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1630 var Module = /*#__PURE__*/function (_elementorModules$edi) {
1631 (0, _inherits2.default)(Module, _elementorModules$edi);
1632 var _super = _createSuper(Module);
1633 function Module() {
1634 (0, _classCallCheck2.default)(this, Module);
1635 return _super.apply(this, arguments);
1636 }
1637 (0, _createClass2.default)(Module, [{
1638 key: "onElementorInit",
1639 value: function onElementorInit() {
1640 elementor.hooks.addFilter('controls/base/behaviors', this.registerControlBehavior);
1641 }
1642 }, {
1643 key: "registerControlBehavior",
1644 value: function registerControlBehavior(behaviors, view) {
1645 var aiOptions = view.options.model.get('ai');
1646 if (!(aiOptions !== null && aiOptions !== void 0 && aiOptions.active)) {
1647 return behaviors;
1648 }
1649 var controlType = view.options.model.get('type');
1650 var textControls = ['text', 'textarea'];
1651 if (textControls.includes(aiOptions.type)) {
1652 behaviors.ai = {
1653 behaviorClass: _aiBehavior.default,
1654 controlType: controlType,
1655 type: aiOptions.type,
1656 getControlValue: view.getControlValue.bind(view),
1657 setControlValue: function setControlValue(value) {
1658 if ('wysiwyg' === controlType) {
1659 value = value.replaceAll('\n', '<br>');
1660 }
1661 view.setSettingsModel(value);
1662 view.applySavedValue();
1663 },
1664 isLabelBlock: view.options.model.get('label_block'),
1665 additionalOptions: {
1666 defaultValue: view.options.model.get('default')
1667 }
1668 };
1669 }
1670 var codeControls = ['code'];
1671 if (codeControls.includes(aiOptions.type)) {
1672 var _view$options, _view$options$contain, _view$options$contain2;
1673 var htmlMarkup = (_view$options = view.options) !== null && _view$options !== void 0 && (_view$options$contain = _view$options.container) !== null && _view$options$contain !== void 0 && (_view$options$contain2 = _view$options$contain.view) !== null && _view$options$contain2 !== void 0 && _view$options$contain2.$el ? view.options.container.view.$el[0].outerHTML : '';
1674 behaviors.ai = {
1675 behaviorClass: _aiBehavior.default,
1676 type: aiOptions.type,
1677 additionalOptions: {
1678 codeLanguage: (aiOptions === null || aiOptions === void 0 ? void 0 : aiOptions.language) || view.options.model.get('language'),
1679 htmlMarkup: htmlMarkup,
1680 elementId: view.options.container.id
1681 },
1682 buttonLabel: __('Code with AI', 'elementor'),
1683 isLabelBlock: view.options.model.get('label_block'),
1684 getControlValue: view.getControlValue.bind(view),
1685 setControlValue: function setControlValue(value) {
1686 return view.editor.setValue(value, -1);
1687 }
1688 };
1689 }
1690 var mediaControl = ['media'];
1691 if (mediaControl.includes(aiOptions.type)) {
1692 behaviors.ai = {
1693 behaviorClass: _aiPromotionBehavior.default
1694 };
1695 }
1696 return behaviors;
1697 }
1698 }]);
1699 return Module;
1700 }(elementorModules.editor.utils.Module);
1701 exports["default"] = Module;
1702
1703 /***/ }),
1704
1705 /***/ "../modules/ai/assets/js/editor/page-content.js":
1706 /*!******************************************************!*\
1707 !*** ../modules/ai/assets/js/editor/page-content.js ***!
1708 \******************************************************/
1709 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1710
1711 "use strict";
1712 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
1713
1714
1715 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1716 Object.defineProperty(exports, "__esModule", ({
1717 value: true
1718 }));
1719 exports["default"] = void 0;
1720 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
1721 var _formText = _interopRequireDefault(__webpack_require__(/*! ./pages/form-text */ "../modules/ai/assets/js/editor/pages/form-text/index.js"));
1722 var _connect = _interopRequireDefault(__webpack_require__(/*! ./pages/connect */ "../modules/ai/assets/js/editor/pages/connect/index.js"));
1723 var _formCode = _interopRequireDefault(__webpack_require__(/*! ./pages/form-code */ "../modules/ai/assets/js/editor/pages/form-code/index.js"));
1724 var _getStarted = _interopRequireDefault(__webpack_require__(/*! ./pages/get-started */ "../modules/ai/assets/js/editor/pages/get-started/index.js"));
1725 var _loader = _interopRequireDefault(__webpack_require__(/*! ./components/loader */ "../modules/ai/assets/js/editor/components/loader.js"));
1726 var _useUserInfo2 = _interopRequireDefault(__webpack_require__(/*! ./hooks/use-user-info */ "../modules/ai/assets/js/editor/hooks/use-user-info.js"));
1727 var _wizardDialog = _interopRequireDefault(__webpack_require__(/*! ./components/wizard-dialog */ "../modules/ai/assets/js/editor/components/wizard-dialog.js"));
1728 var _promptDialog = _interopRequireDefault(__webpack_require__(/*! ./components/prompt-dialog */ "../modules/ai/assets/js/editor/components/prompt-dialog.js"));
1729 var _upgradeChip = _interopRequireDefault(__webpack_require__(/*! ./components/upgrade-chip */ "../modules/ai/assets/js/editor/components/upgrade-chip.js"));
1730 var PageContent = function PageContent(_ref) {
1731 var type = _ref.type,
1732 controlType = _ref.controlType,
1733 onClose = _ref.onClose,
1734 onConnect = _ref.onConnect,
1735 getControlValue = _ref.getControlValue,
1736 setControlValue = _ref.setControlValue,
1737 additionalOptions = _ref.additionalOptions;
1738 var _useUserInfo = (0, _useUserInfo2.default)(),
1739 isLoading = _useUserInfo.isLoading,
1740 isConnected = _useUserInfo.isConnected,
1741 isGetStarted = _useUserInfo.isGetStarted,
1742 connectUrl = _useUserInfo.connectUrl,
1743 fetchData = _useUserInfo.fetchData,
1744 hasSubscription = _useUserInfo.hasSubscription,
1745 credits = _useUserInfo.credits,
1746 usagePercentage = _useUserInfo.usagePercentage;
1747 if (isLoading) {
1748 return /*#__PURE__*/_react.default.createElement(_promptDialog.default, {
1749 onClose: onClose
1750 }, /*#__PURE__*/_react.default.createElement(_loader.default, null));
1751 }
1752 if (!isConnected) {
1753 return /*#__PURE__*/_react.default.createElement(_wizardDialog.default, {
1754 onClose: onClose
1755 }, /*#__PURE__*/_react.default.createElement(_connect.default, {
1756 connectUrl: connectUrl,
1757 onSuccess: function onSuccess(data) {
1758 onConnect(data);
1759 fetchData();
1760 }
1761 }));
1762 }
1763 if (!isGetStarted) {
1764 return /*#__PURE__*/_react.default.createElement(_wizardDialog.default, {
1765 onClose: onClose
1766 }, /*#__PURE__*/_react.default.createElement(_getStarted.default, {
1767 onSuccess: fetchData
1768 }));
1769 }
1770 if ('code' === type) {
1771 return /*#__PURE__*/_react.default.createElement(_promptDialog.default, {
1772 onClose: onClose,
1773 headerAction: !hasSubscription && /*#__PURE__*/_react.default.createElement(_upgradeChip.default, null)
1774 }, /*#__PURE__*/_react.default.createElement(_formCode.default, {
1775 onClose: onClose,
1776 getControlValue: getControlValue,
1777 setControlValue: setControlValue,
1778 additionalOptions: additionalOptions,
1779 credits: credits,
1780 usagePercentage: usagePercentage
1781 }));
1782 }
1783 return /*#__PURE__*/_react.default.createElement(_promptDialog.default, {
1784 onClose: onClose,
1785 headerAction: !hasSubscription && /*#__PURE__*/_react.default.createElement(_upgradeChip.default, null)
1786 }, /*#__PURE__*/_react.default.createElement(_formText.default, {
1787 type: type,
1788 controlType: controlType,
1789 onClose: onClose,
1790 getControlValue: getControlValue,
1791 setControlValue: setControlValue,
1792 additionalOptions: additionalOptions,
1793 credits: credits,
1794 usagePercentage: usagePercentage
1795 }));
1796 };
1797 PageContent.propTypes = {
1798 type: PropTypes.string,
1799 controlType: PropTypes.string,
1800 onClose: PropTypes.func.isRequired,
1801 onConnect: PropTypes.func.isRequired,
1802 getControlValue: PropTypes.func.isRequired,
1803 setControlValue: PropTypes.func.isRequired,
1804 additionalOptions: PropTypes.object
1805 };
1806 var _default = PageContent;
1807 exports["default"] = _default;
1808
1809 /***/ }),
1810
1811 /***/ "../modules/ai/assets/js/editor/pages/connect/index.js":
1812 /*!*************************************************************!*\
1813 !*** ../modules/ai/assets/js/editor/pages/connect/index.js ***!
1814 \*************************************************************/
1815 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1816
1817 "use strict";
1818 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1819 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
1820
1821
1822 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1823 Object.defineProperty(exports, "__esModule", ({
1824 value: true
1825 }));
1826 exports["default"] = void 0;
1827 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
1828 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1829 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
1830 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
1831 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1832 var Connect = function Connect(_ref) {
1833 var connectUrl = _ref.connectUrl,
1834 onSuccess = _ref.onSuccess;
1835 var approveButtonRef = (0, _react.useRef)();
1836 (0, _react.useEffect)(function () {
1837 jQuery(approveButtonRef.current).elementorConnect({
1838 success: function success(_, data) {
1839 return onSuccess(data);
1840 },
1841 error: function error() {
1842 throw new Error('Elementor AI: Failed to connect.');
1843 }
1844 });
1845 }, []);
1846 return /*#__PURE__*/_react.default.createElement(_ui.Stack, {
1847 alignItems: "center",
1848 gap: 5
1849 }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, {
1850 sx: {
1851 color: 'text.primary',
1852 fontSize: '60px',
1853 mb: 3
1854 }
1855 }), /*#__PURE__*/_react.default.createElement(_ui.Typography, {
1856 variant: "h4",
1857 sx: {
1858 color: 'text.primary'
1859 }
1860 }, __('Step into the future with Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, {
1861 variant: "body2"
1862 }, __('Create smarter with AI text and code generators built right into the editor.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, {
1863 variant: "caption",
1864 sx: {
1865 maxWidth: 520,
1866 textAlign: 'center'
1867 }
1868 }, __('By clicking "Connect", I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, {
1869 href: "https://go.elementor.com/ai-terms/",
1870 target: "_blank",
1871 color: "info.main"
1872 }, __('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, {
1873 href: "https://go.elementor.com/ai-privacy-policy/",
1874 target: "_blank",
1875 color: "info.main"
1876 }, __('Privacy Policy', 'elementor')), __(' of the Elementor AI service.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, {
1877 ref: approveButtonRef,
1878 href: connectUrl,
1879 variant: "contained",
1880 sx: {
1881 mt: 3,
1882 '&:hover': {
1883 color: 'primary.contrastText'
1884 }
1885 }
1886 }, __('Connect', 'elementor')));
1887 };
1888 Connect.propTypes = {
1889 connectUrl: PropTypes.string.isRequired,
1890 onSuccess: PropTypes.func.isRequired
1891 };
1892 var _default = Connect;
1893 exports["default"] = _default;
1894
1895 /***/ }),
1896
1897 /***/ "../modules/ai/assets/js/editor/pages/form-code/code-block.js":
1898 /*!********************************************************************!*\
1899 !*** ../modules/ai/assets/js/editor/pages/form-code/code-block.js ***!
1900 \********************************************************************/
1901 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1902
1903 "use strict";
1904 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1905 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
1906
1907
1908 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1909 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1910 Object.defineProperty(exports, "__esModule", ({
1911 value: true
1912 }));
1913 exports["default"] = void 0;
1914 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
1915 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
1916 var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js"));
1917 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1918 var _textArea = _interopRequireDefault(__webpack_require__(/*! ../../components/text-area */ "../modules/ai/assets/js/editor/components/text-area.js"));
1919 var _excluded = ["node", "inline", "children", "defaultValue", "onInsert"];
1920 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
1921 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1922 var CodeBlock = function CodeBlock(_ref) {
1923 var node = _ref.node,
1924 inline = _ref.inline,
1925 children = _ref.children,
1926 defaultValue = _ref.defaultValue,
1927 onInsert = _ref.onInsert,
1928 props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
1929 var codeBlockInput = (0, _react.useRef)(null);
1930 if (inline) {
1931 return /*#__PURE__*/_react.default.createElement("code", props);
1932 }
1933 return /*#__PURE__*/_react.default.createElement(_ui.Box, {
1934 sx: {
1935 position: 'relative'
1936 }
1937 }, /*#__PURE__*/_react.default.createElement(_textArea.default, (0, _extends2.default)({
1938 ref: codeBlockInput,
1939 defaultValue: children[0],
1940 sx: {
1941 mb: 3
1942 },
1943 helperText: __('Code generated by AI may be inaccurate.', 'elementor')
1944 }, props)), /*#__PURE__*/_react.default.createElement(_ui.Button, {
1945 size: "small",
1946 variant: "contained",
1947 onClick: function onClick() {
1948 return onInsert(defaultValue + '\n' + codeBlockInput.current.value);
1949 },
1950 sx: {
1951 position: 'absolute',
1952 right: '11px',
1953 bottom: '44px'
1954 }
1955 }, __('Insert', 'elementor')));
1956 };
1957 CodeBlock.propTypes = {
1958 node: PropTypes.object,
1959 inline: PropTypes.bool,
1960 children: PropTypes.arrayOf(PropTypes.node).isRequired,
1961 defaultValue: PropTypes.string,
1962 onInsert: PropTypes.func.isRequired
1963 };
1964 var _default = CodeBlock;
1965 exports["default"] = _default;
1966
1967 /***/ }),
1968
1969 /***/ "../modules/ai/assets/js/editor/pages/form-code/index.js":
1970 /*!***************************************************************!*\
1971 !*** ../modules/ai/assets/js/editor/pages/form-code/index.js ***!
1972 \***************************************************************/
1973 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1974
1975 "use strict";
1976 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1977 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
1978
1979
1980 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1981 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1982 Object.defineProperty(exports, "__esModule", ({
1983 value: true
1984 }));
1985 exports["default"] = void 0;
1986 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
1987 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1988 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
1989 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1990 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1991 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1992 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1993 var _reactMarkdown = _interopRequireDefault(__webpack_require__(/*! react-markdown */ "../node_modules/react-markdown/index.js"));
1994 var _actionsData = __webpack_require__(/*! ../../actions-data */ "../modules/ai/assets/js/editor/actions-data.js");
1995 var _loader = _interopRequireDefault(__webpack_require__(/*! ../../components/loader */ "../modules/ai/assets/js/editor/components/loader.js"));
1996 var _promptSearch = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-search */ "../modules/ai/assets/js/editor/components/prompt-search.js"));
1997 var _promptSuggestions = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-suggestions */ "../modules/ai/assets/js/editor/components/prompt-suggestions.js"));
1998 var _generateButton = _interopRequireDefault(__webpack_require__(/*! ../../components/generate-button */ "../modules/ai/assets/js/editor/components/generate-button.js"));
1999 var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js"));
2000 var _codeBlock = _interopRequireDefault(__webpack_require__(/*! ./code-block */ "../modules/ai/assets/js/editor/pages/form-code/code-block.js"));
2001 var _useCodePrompt2 = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-code-prompt */ "../modules/ai/assets/js/editor/hooks/use-code-prompt.js"));
2002 var _promptCredits = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-credits */ "../modules/ai/assets/js/editor/components/prompt-credits.js"));
2003 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2004 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2005 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2006 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2007 var CodeDisplayWrapper = (0, _ui.styled)(_ui.Box)(function () {
2008 return {
2009 '& p': {
2010 mb: '10px',
2011 fontSize: '13px',
2012 lineHeight: '1.5'
2013 },
2014 '& pre': {
2015 position: 'relative'
2016 },
2017 '& textarea': {
2018 fontSize: '13px',
2019 lineHeight: '1.7'
2020 }
2021 };
2022 });
2023 var FormCode = function FormCode(_ref) {
2024 var onClose = _ref.onClose,
2025 getControlValue = _ref.getControlValue,
2026 setControlValue = _ref.setControlValue,
2027 additionalOptions = _ref.additionalOptions,
2028 credits = _ref.credits,
2029 usagePercentage = _ref.usagePercentage;
2030 var _useCodePrompt = (0, _useCodePrompt2.default)(_objectSpread(_objectSpread({}, additionalOptions), {}, {
2031 credits: credits
2032 })),
2033 data = _useCodePrompt.data,
2034 isLoading = _useCodePrompt.isLoading,
2035 error = _useCodePrompt.error,
2036 reset = _useCodePrompt.reset,
2037 send = _useCodePrompt.send,
2038 sendUsageData = _useCodePrompt.sendUsageData;
2039 var _useState = (0, _react.useState)(''),
2040 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
2041 prompt = _useState2[0],
2042 setPrompt = _useState2[1];
2043 var lastRun = (0, _react.useRef)(function () {});
2044 var autocompleteItems = 'css' === (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.codeLanguage) ? _actionsData.codeCssAutocomplete : _actionsData.codeHtmlAutocomplete;
2045 var showSuggestions = !prompt;
2046 var handleSubmit = /*#__PURE__*/function () {
2047 var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(event) {
2048 return _regenerator.default.wrap(function _callee$(_context) {
2049 while (1) switch (_context.prev = _context.next) {
2050 case 0:
2051 event.preventDefault();
2052 lastRun.current = function () {
2053 return send(prompt);
2054 };
2055 lastRun.current();
2056 case 3:
2057 case "end":
2058 return _context.stop();
2059 }
2060 }, _callee);
2061 }));
2062 return function handleSubmit(_x) {
2063 return _ref2.apply(this, arguments);
2064 };
2065 }();
2066 var applyPrompt = function applyPrompt(inputText) {
2067 sendUsageData();
2068 setControlValue(inputText);
2069 onClose();
2070 };
2071 if (isLoading) {
2072 return /*#__PURE__*/_react.default.createElement(_loader.default, null);
2073 }
2074 return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, {
2075 error: error,
2076 onRetry: lastRun.current,
2077 sx: {
2078 mb: 6
2079 }
2080 }), !data.result && /*#__PURE__*/_react.default.createElement(_ui.Box, {
2081 component: "form",
2082 onSubmit: handleSubmit
2083 }, /*#__PURE__*/_react.default.createElement(_ui.Box, {
2084 sx: {
2085 pb: 4
2086 }
2087 }, /*#__PURE__*/_react.default.createElement(_promptSearch.default, {
2088 placeholder: __('Describe the code you want to use...', 'elementor'),
2089 name: "prompt",
2090 value: prompt,
2091 color: "secondary",
2092 onChange: function onChange(event) {
2093 return setPrompt(event.target.value);
2094 }
2095 })), showSuggestions && /*#__PURE__*/_react.default.createElement(_promptSuggestions.default, {
2096 suggestions: autocompleteItems,
2097 onSelect: setPrompt
2098 }), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2099 direction: "row",
2100 alignItems: "center",
2101 sx: {
2102 py: 4,
2103 mt: 8
2104 }
2105 }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, {
2106 usagePercentage: usagePercentage
2107 }), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2108 direction: "row",
2109 justifyContent: "flex-end",
2110 flexGrow: 1
2111 }, /*#__PURE__*/_react.default.createElement(_generateButton.default, null, __('Generate code', 'elementor'))))), data.result && /*#__PURE__*/_react.default.createElement(CodeDisplayWrapper, null, /*#__PURE__*/_react.default.createElement(_reactMarkdown.default, {
2112 components: {
2113 code: function code(props) {
2114 return /*#__PURE__*/_react.default.createElement(_codeBlock.default, (0, _extends2.default)({}, props, {
2115 defaultValue: getControlValue(),
2116 onInsert: applyPrompt
2117 }));
2118 }
2119 }
2120 }, data.result), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2121 direction: "row",
2122 alignItems: "center",
2123 sx: {
2124 mt: 8
2125 }
2126 }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, {
2127 usagePercentage: usagePercentage
2128 }), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2129 direction: "row",
2130 gap: 3,
2131 justifyContent: "flex-end",
2132 flexGrow: 1
2133 }, /*#__PURE__*/_react.default.createElement(_ui.Button, {
2134 size: "small",
2135 color: "secondary",
2136 variant: "text",
2137 onClick: reset
2138 }, __('New prompt', 'elementor'))))));
2139 };
2140 FormCode.propTypes = {
2141 onClose: PropTypes.func.isRequired,
2142 getControlValue: PropTypes.func.isRequired,
2143 setControlValue: PropTypes.func.isRequired,
2144 additionalOptions: PropTypes.shape({
2145 codeLanguage: PropTypes.string,
2146 htmlMarkup: PropTypes.string,
2147 elementId: PropTypes.string,
2148 initialCredits: PropTypes.number
2149 }),
2150 credits: PropTypes.number,
2151 usagePercentage: PropTypes.number
2152 };
2153 var _default = FormCode;
2154 exports["default"] = _default;
2155
2156 /***/ }),
2157
2158 /***/ "../modules/ai/assets/js/editor/pages/form-text/index.js":
2159 /*!***************************************************************!*\
2160 !*** ../modules/ai/assets/js/editor/pages/form-text/index.js ***!
2161 \***************************************************************/
2162 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2163
2164 "use strict";
2165 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
2166 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
2167
2168
2169 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2170 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2171 Object.defineProperty(exports, "__esModule", ({
2172 value: true
2173 }));
2174 exports["default"] = void 0;
2175 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
2176 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
2177 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
2178 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
2179 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
2180 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
2181 var _loader = _interopRequireDefault(__webpack_require__(/*! ../../components/loader */ "../modules/ai/assets/js/editor/components/loader.js"));
2182 var _promptSearch = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-search */ "../modules/ai/assets/js/editor/components/prompt-search.js"));
2183 var _textArea = _interopRequireDefault(__webpack_require__(/*! ../../components/text-area */ "../modules/ai/assets/js/editor/components/text-area.js"));
2184 var _promptSuggestions = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-suggestions */ "../modules/ai/assets/js/editor/components/prompt-suggestions.js"));
2185 var _promptActionSelection = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-action-selection */ "../modules/ai/assets/js/editor/components/prompt-action-selection.js"));
2186 var _generateButton = _interopRequireDefault(__webpack_require__(/*! ../../components/generate-button */ "../modules/ai/assets/js/editor/components/generate-button.js"));
2187 var _promptAction = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-action */ "../modules/ai/assets/js/editor/components/prompt-action.js"));
2188 var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js"));
2189 var _useTextPrompt2 = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-text-prompt */ "../modules/ai/assets/js/editor/hooks/use-text-prompt.js"));
2190 var _actionsData = __webpack_require__(/*! ../../actions-data */ "../modules/ai/assets/js/editor/actions-data.js");
2191 var _promptCredits = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-credits */ "../modules/ai/assets/js/editor/components/prompt-credits.js"));
2192 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2193 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2194 var promptActions = [{
2195 label: __('Simplify language', 'elementor'),
2196 icon: /*#__PURE__*/_react.default.createElement(_icons.MessageIcon, null),
2197 value: 'Simplify the language of the following message'
2198 }, {
2199 label: __('Make it longer', 'elementor'),
2200 icon: /*#__PURE__*/_react.default.createElement(_icons.ExpandIcon, null),
2201 value: 'Make the following message longer'
2202 }, {
2203 label: __('Make it shorter', 'elementor'),
2204 icon: /*#__PURE__*/_react.default.createElement(_icons.ShrinkIcon, null),
2205 value: 'Make the following message shorter'
2206 }, {
2207 label: __('Fix spelling & grammar', 'elementor'),
2208 icon: /*#__PURE__*/_react.default.createElement(_icons.AIIcon, null),
2209 value: 'Fix the spelling and grammar of the following message'
2210 }];
2211 var promptInstructions = [{
2212 label: __('Change tone', 'elementor'),
2213 options: _actionsData.vocalTones,
2214 getInstruction: function getInstruction(value) {
2215 return "Change the tone of the following message to ".concat(value);
2216 }
2217 }, {
2218 label: __('Translate to', 'elementor'),
2219 options: _actionsData.translateLanguages,
2220 getInstruction: function getInstruction(value) {
2221 return "Translate the following message to ".concat(value);
2222 }
2223 }];
2224 var FormText = function FormText(_ref) {
2225 var type = _ref.type,
2226 onClose = _ref.onClose,
2227 getControlValue = _ref.getControlValue,
2228 setControlValue = _ref.setControlValue,
2229 additionalOptions = _ref.additionalOptions,
2230 credits = _ref.credits,
2231 usagePercentage = _ref.usagePercentage;
2232 var initialValue = getControlValue() === (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.defaultValue) ? '' : getControlValue();
2233 var _useTextPrompt = (0, _useTextPrompt2.default)({
2234 result: initialValue,
2235 credits: credits
2236 }),
2237 data = _useTextPrompt.data,
2238 isLoading = _useTextPrompt.isLoading,
2239 error = _useTextPrompt.error,
2240 reset = _useTextPrompt.reset,
2241 send = _useTextPrompt.send,
2242 sendUsageData = _useTextPrompt.sendUsageData;
2243 var _useState = (0, _react.useState)(''),
2244 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
2245 prompt = _useState2[0],
2246 setPrompt = _useState2[1];
2247 var searchField = (0, _react.useRef)(null);
2248 var resultField = (0, _react.useRef)(null);
2249 var lastRun = (0, _react.useRef)(function () {});
2250 var autocompleteItems = 'textarea' === type ? _actionsData.textareaAutocomplete : _actionsData.textAutocomplete;
2251 var showSuggestions = !prompt;
2252 var handleSubmit = function handleSubmit(event) {
2253 event.preventDefault();
2254 lastRun.current = function () {
2255 return send(prompt);
2256 };
2257 lastRun.current();
2258 };
2259 var handleCustomInstruction = /*#__PURE__*/function () {
2260 var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(instruction) {
2261 return _regenerator.default.wrap(function _callee$(_context) {
2262 while (1) switch (_context.prev = _context.next) {
2263 case 0:
2264 lastRun.current = function () {
2265 return send(resultField.current.value, instruction);
2266 };
2267 lastRun.current();
2268 case 2:
2269 case "end":
2270 return _context.stop();
2271 }
2272 }, _callee);
2273 }));
2274 return function handleCustomInstruction(_x) {
2275 return _ref2.apply(this, arguments);
2276 };
2277 }();
2278 var handleSuggestion = function handleSuggestion(suggestion) {
2279 setPrompt(suggestion + ' ');
2280 searchField.current.focus();
2281 };
2282 var applyPrompt = function applyPrompt() {
2283 sendUsageData();
2284 setControlValue(resultField.current.value);
2285 onClose();
2286 };
2287 if (isLoading) {
2288 return /*#__PURE__*/_react.default.createElement(_loader.default, null);
2289 }
2290 return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, {
2291 error: error,
2292 onRetry: lastRun.current,
2293 sx: {
2294 mb: 6
2295 }
2296 }), !data.result && /*#__PURE__*/_react.default.createElement(_ui.Box, {
2297 component: "form",
2298 onSubmit: handleSubmit
2299 }, /*#__PURE__*/_react.default.createElement(_ui.Box, {
2300 sx: {
2301 mb: 6
2302 }
2303 }, /*#__PURE__*/_react.default.createElement(_promptSearch.default, {
2304 ref: searchField,
2305 placeholder: __('Describe the text and tone you want to use...', 'elementor'),
2306 name: "prompt",
2307 value: prompt,
2308 onChange: function onChange(event) {
2309 return setPrompt(event.target.value);
2310 }
2311 })), showSuggestions && /*#__PURE__*/_react.default.createElement(_promptSuggestions.default, {
2312 suggestions: autocompleteItems,
2313 onSelect: handleSuggestion,
2314 suggestionFilter: function suggestionFilter(suggestion) {
2315 return suggestion + '...';
2316 }
2317 }), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2318 direction: "row",
2319 alignItems: "center",
2320 sx: {
2321 py: 4,
2322 mt: 8
2323 }
2324 }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, {
2325 usagePercentage: usagePercentage
2326 }), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2327 direction: "row",
2328 justifyContent: "flex-end",
2329 flexGrow: 1
2330 }, /*#__PURE__*/_react.default.createElement(_generateButton.default, null, __('Generate text', 'elementor'))))), data.result && /*#__PURE__*/_react.default.createElement(_ui.Box, {
2331 sx: {
2332 mt: 3
2333 }
2334 }, /*#__PURE__*/_react.default.createElement(_textArea.default, {
2335 ref: resultField,
2336 defaultValue: data.result,
2337 helperText: __('Text generated by AI may be inaccurate or offensive.', 'elementor')
2338 }), /*#__PURE__*/_react.default.createElement(_ui.Grid, {
2339 container: true,
2340 spacing: 3,
2341 sx: {
2342 mt: 6
2343 }
2344 }, promptActions.map(function (_ref3) {
2345 var label = _ref3.label,
2346 icon = _ref3.icon,
2347 value = _ref3.value;
2348 return /*#__PURE__*/_react.default.createElement(_ui.Grid, {
2349 item: true,
2350 key: label
2351 }, /*#__PURE__*/_react.default.createElement(_promptAction.default, {
2352 label: label,
2353 icon: icon,
2354 onClick: function onClick() {
2355 return handleCustomInstruction(value);
2356 }
2357 }));
2358 })), /*#__PURE__*/_react.default.createElement(_ui.Grid, {
2359 container: true,
2360 spacing: 3,
2361 sx: {
2362 mt: 6
2363 }
2364 }, promptInstructions.map(function (_ref4) {
2365 var label = _ref4.label,
2366 options = _ref4.options,
2367 getInstruction = _ref4.getInstruction;
2368 return /*#__PURE__*/_react.default.createElement(_ui.Grid, {
2369 item: true,
2370 key: label
2371 }, /*#__PURE__*/_react.default.createElement(_promptActionSelection.default, {
2372 label: label,
2373 options: options,
2374 onChange: function onChange(event) {
2375 return handleCustomInstruction(getInstruction(event.target.value));
2376 }
2377 }));
2378 })), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2379 direction: "row",
2380 alignItems: "center",
2381 sx: {
2382 my: 8
2383 }
2384 }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, {
2385 usagePercentage: usagePercentage
2386 }), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2387 direction: "row",
2388 gap: 3,
2389 justifyContent: "flex-end",
2390 flexGrow: 1
2391 }, /*#__PURE__*/_react.default.createElement(_ui.Button, {
2392 size: "small",
2393 color: "secondary",
2394 variant: "text",
2395 onClick: reset
2396 }, __('New prompt', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, {
2397 size: "small",
2398 variant: "contained",
2399 color: "primary",
2400 onClick: applyPrompt
2401 }, __('Use text', 'elementor'))))));
2402 };
2403 FormText.propTypes = {
2404 type: PropTypes.string.isRequired,
2405 controlType: PropTypes.string,
2406 onClose: PropTypes.func.isRequired,
2407 getControlValue: PropTypes.func.isRequired,
2408 setControlValue: PropTypes.func.isRequired,
2409 additionalOptions: PropTypes.object,
2410 credits: PropTypes.number,
2411 usagePercentage: PropTypes.number
2412 };
2413 var _default = FormText;
2414 exports["default"] = _default;
2415
2416 /***/ }),
2417
2418 /***/ "../modules/ai/assets/js/editor/pages/get-started/index.js":
2419 /*!*****************************************************************!*\
2420 !*** ../modules/ai/assets/js/editor/pages/get-started/index.js ***!
2421 \*****************************************************************/
2422 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2423
2424 "use strict";
2425 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
2426 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
2427
2428
2429 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2430 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2431 Object.defineProperty(exports, "__esModule", ({
2432 value: true
2433 }));
2434 exports["default"] = void 0;
2435 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
2436 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
2437 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
2438 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
2439 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
2440 var _api = __webpack_require__(/*! ../../api */ "../modules/ai/assets/js/editor/api/index.js");
2441 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
2442 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2443 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2444 var GetStarted = function GetStarted(_ref) {
2445 var onSuccess = _ref.onSuccess;
2446 var _useState = (0, _react.useState)(false),
2447 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
2448 isTermsChecked = _useState2[0],
2449 setIsTermsChecked = _useState2[1];
2450 var onGetStartedClick = /*#__PURE__*/function () {
2451 var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
2452 return _regenerator.default.wrap(function _callee$(_context) {
2453 while (1) switch (_context.prev = _context.next) {
2454 case 0:
2455 _context.next = 2;
2456 return (0, _api.setGetStarted)();
2457 case 2:
2458 onSuccess();
2459 case 3:
2460 case "end":
2461 return _context.stop();
2462 }
2463 }, _callee);
2464 }));
2465 return function onGetStartedClick() {
2466 return _ref2.apply(this, arguments);
2467 };
2468 }();
2469 return /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2470 alignItems: "center",
2471 gap: 4
2472 }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, {
2473 sx: {
2474 color: 'text.primary',
2475 fontSize: '60px',
2476 mb: 3
2477 }
2478 }), /*#__PURE__*/_react.default.createElement(_ui.Typography, {
2479 variant: "h4",
2480 sx: {
2481 color: 'text.primary'
2482 }
2483 }, __('Step into the future with Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, {
2484 variant: "body2"
2485 }, __('Create smarter with AI text and code generators built right into the editor.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
2486 direction: "row",
2487 gap: 4,
2488 alignItems: "flex-start"
2489 }, /*#__PURE__*/_react.default.createElement(_ui.Checkbox, {
2490 id: "e-ai-terms-approval",
2491 color: "secondary",
2492 sx: {
2493 p: 0
2494 },
2495 onChange: function onChange() {
2496 return setIsTermsChecked(function (prevState) {
2497 return !prevState;
2498 });
2499 }
2500 }), /*#__PURE__*/_react.default.createElement(_ui.Stack, null, /*#__PURE__*/_react.default.createElement(_ui.Typography, {
2501 variant: "caption",
2502 sx: {
2503 maxWidth: 520
2504 },
2505 component: "label",
2506 htmlFor: "e-ai-terms-approval"
2507 }, __('I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, {
2508 href: "https://go.elementor.com/ai-terms/",
2509 target: "_blank",
2510 color: "info.main"
2511 }, __('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, {
2512 href: "https://go.elementor.com/ai-privacy-policy/",
2513 target: "_blank",
2514 color: "info.main"
2515 }, __('Privacy Policy', 'elementor')), __(' of the Elementor AI service.', 'elementor'), /*#__PURE__*/_react.default.createElement("br", null), __('This includes consenting to the collection and use of data to improve user experience.', 'elementor')))), /*#__PURE__*/_react.default.createElement(_ui.Button, {
2516 disabled: !isTermsChecked,
2517 variant: "contained",
2518 onClick: onGetStartedClick,
2519 sx: {
2520 mt: 3,
2521 '&:hover': {
2522 color: 'primary.contrastText'
2523 }
2524 }
2525 }, __('Get Started', 'elementor')));
2526 };
2527 GetStarted.propTypes = {
2528 onSuccess: PropTypes.func.isRequired
2529 };
2530 var _default = GetStarted;
2531 exports["default"] = _default;
2532
2533 /***/ }),
2534
2535 /***/ "../node_modules/clsx/dist/clsx.m.js":
2536 /*!*******************************************!*\
2537 !*** ../node_modules/clsx/dist/clsx.m.js ***!
2538 \*******************************************/
2539 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2540
2541 "use strict";
2542 __webpack_require__.r(__webpack_exports__);
2543 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2544 /* harmony export */ "clsx": () => (/* binding */ clsx),
2545 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2546 /* harmony export */ });
2547 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clsx);
2548
2549 /***/ }),
2550
2551 /***/ "../node_modules/debug/src/browser.js":
2552 /*!********************************************!*\
2553 !*** ../node_modules/debug/src/browser.js ***!
2554 \********************************************/
2555 /***/ ((module, exports, __webpack_require__) => {
2556
2557 /* eslint-env browser */
2558
2559 /**
2560 * This is the web browser implementation of `debug()`.
2561 */
2562
2563 exports.formatArgs = formatArgs;
2564 exports.save = save;
2565 exports.load = load;
2566 exports.useColors = useColors;
2567 exports.storage = localstorage();
2568 exports.destroy = (() => {
2569 let warned = false;
2570
2571 return () => {
2572 if (!warned) {
2573 warned = true;
2574 console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
2575 }
2576 };
2577 })();
2578
2579 /**
2580 * Colors.
2581 */
2582
2583 exports.colors = [
2584 '#0000CC',
2585 '#0000FF',
2586 '#0033CC',
2587 '#0033FF',
2588 '#0066CC',
2589 '#0066FF',
2590 '#0099CC',
2591 '#0099FF',
2592 '#00CC00',
2593 '#00CC33',
2594 '#00CC66',
2595 '#00CC99',
2596 '#00CCCC',
2597 '#00CCFF',
2598 '#3300CC',
2599 '#3300FF',
2600 '#3333CC',
2601 '#3333FF',
2602 '#3366CC',
2603 '#3366FF',
2604 '#3399CC',
2605 '#3399FF',
2606 '#33CC00',
2607 '#33CC33',
2608 '#33CC66',
2609 '#33CC99',
2610 '#33CCCC',
2611 '#33CCFF',
2612 '#6600CC',
2613 '#6600FF',
2614 '#6633CC',
2615 '#6633FF',
2616 '#66CC00',
2617 '#66CC33',
2618 '#9900CC',
2619 '#9900FF',
2620 '#9933CC',
2621 '#9933FF',
2622 '#99CC00',
2623 '#99CC33',
2624 '#CC0000',
2625 '#CC0033',
2626 '#CC0066',
2627 '#CC0099',
2628 '#CC00CC',
2629 '#CC00FF',
2630 '#CC3300',
2631 '#CC3333',
2632 '#CC3366',
2633 '#CC3399',
2634 '#CC33CC',
2635 '#CC33FF',
2636 '#CC6600',
2637 '#CC6633',
2638 '#CC9900',
2639 '#CC9933',
2640 '#CCCC00',
2641 '#CCCC33',
2642 '#FF0000',
2643 '#FF0033',
2644 '#FF0066',
2645 '#FF0099',
2646 '#FF00CC',
2647 '#FF00FF',
2648 '#FF3300',
2649 '#FF3333',
2650 '#FF3366',
2651 '#FF3399',
2652 '#FF33CC',
2653 '#FF33FF',
2654 '#FF6600',
2655 '#FF6633',
2656 '#FF9900',
2657 '#FF9933',
2658 '#FFCC00',
2659 '#FFCC33'
2660 ];
2661
2662 /**
2663 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
2664 * and the Firebug extension (any Firefox version) are known
2665 * to support "%c" CSS customizations.
2666 *
2667 * TODO: add a `localStorage` variable to explicitly enable/disable colors
2668 */
2669
2670 // eslint-disable-next-line complexity
2671 function useColors() {
2672 // NB: In an Electron preload script, document will be defined but not fully
2673 // initialized. Since we know we're in Chrome, we'll just detect this case
2674 // explicitly
2675 if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
2676 return true;
2677 }
2678
2679 // Internet Explorer and Edge do not support colors.
2680 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
2681 return false;
2682 }
2683
2684 // Is webkit? http://stackoverflow.com/a/16459606/376773
2685 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
2686 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
2687 // Is firebug? http://stackoverflow.com/a/398120/376773
2688 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
2689 // Is firefox >= v31?
2690 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
2691 (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
2692 // Double check webkit in userAgent just in case we are in a worker
2693 (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
2694 }
2695
2696 /**
2697 * Colorize log arguments if enabled.
2698 *
2699 * @api public
2700 */
2701
2702 function formatArgs(args) {
2703 args[0] = (this.useColors ? '%c' : '') +
2704 this.namespace +
2705 (this.useColors ? ' %c' : ' ') +
2706 args[0] +
2707 (this.useColors ? '%c ' : ' ') +
2708 '+' + module.exports.humanize(this.diff);
2709
2710 if (!this.useColors) {
2711 return;
2712 }
2713
2714 const c = 'color: ' + this.color;
2715 args.splice(1, 0, c, 'color: inherit');
2716
2717 // The final "%c" is somewhat tricky, because there could be other
2718 // arguments passed either before or after the %c, so we need to
2719 // figure out the correct index to insert the CSS into
2720 let index = 0;
2721 let lastC = 0;
2722 args[0].replace(/%[a-zA-Z%]/g, match => {
2723 if (match === '%%') {
2724 return;
2725 }
2726 index++;
2727 if (match === '%c') {
2728 // We only are interested in the *last* %c
2729 // (the user may have provided their own)
2730 lastC = index;
2731 }
2732 });
2733
2734 args.splice(lastC, 0, c);
2735 }
2736
2737 /**
2738 * Invokes `console.debug()` when available.
2739 * No-op when `console.debug` is not a "function".
2740 * If `console.debug` is not available, falls back
2741 * to `console.log`.
2742 *
2743 * @api public
2744 */
2745 exports.log = console.debug || console.log || (() => {});
2746
2747 /**
2748 * Save `namespaces`.
2749 *
2750 * @param {String} namespaces
2751 * @api private
2752 */
2753 function save(namespaces) {
2754 try {
2755 if (namespaces) {
2756 exports.storage.setItem('debug', namespaces);
2757 } else {
2758 exports.storage.removeItem('debug');
2759 }
2760 } catch (error) {
2761 // Swallow
2762 // XXX (@Qix-) should we be logging these?
2763 }
2764 }
2765
2766 /**
2767 * Load `namespaces`.
2768 *
2769 * @return {String} returns the previously persisted debug modes
2770 * @api private
2771 */
2772 function load() {
2773 let r;
2774 try {
2775 r = exports.storage.getItem('debug');
2776 } catch (error) {
2777 // Swallow
2778 // XXX (@Qix-) should we be logging these?
2779 }
2780
2781 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
2782 if (!r && typeof process !== 'undefined' && 'env' in process) {
2783 r = process.env.DEBUG;
2784 }
2785
2786 return r;
2787 }
2788
2789 /**
2790 * Localstorage attempts to return the localstorage.
2791 *
2792 * This is necessary because safari throws
2793 * when a user disables cookies/localstorage
2794 * and you attempt to access it.
2795 *
2796 * @return {LocalStorage}
2797 * @api private
2798 */
2799
2800 function localstorage() {
2801 try {
2802 // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
2803 // The Browser also has localStorage in the global context.
2804 return localStorage;
2805 } catch (error) {
2806 // Swallow
2807 // XXX (@Qix-) should we be logging these?
2808 }
2809 }
2810
2811 module.exports = __webpack_require__(/*! ./common */ "../node_modules/debug/src/common.js")(exports);
2812
2813 const {formatters} = module.exports;
2814
2815 /**
2816 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
2817 */
2818
2819 formatters.j = function (v) {
2820 try {
2821 return JSON.stringify(v);
2822 } catch (error) {
2823 return '[UnexpectedJSONParseError]: ' + error.message;
2824 }
2825 };
2826
2827
2828 /***/ }),
2829
2830 /***/ "../node_modules/debug/src/common.js":
2831 /*!*******************************************!*\
2832 !*** ../node_modules/debug/src/common.js ***!
2833 \*******************************************/
2834 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2835
2836
2837 /**
2838 * This is the common logic for both the Node.js and web browser
2839 * implementations of `debug()`.
2840 */
2841
2842 function setup(env) {
2843 createDebug.debug = createDebug;
2844 createDebug.default = createDebug;
2845 createDebug.coerce = coerce;
2846 createDebug.disable = disable;
2847 createDebug.enable = enable;
2848 createDebug.enabled = enabled;
2849 createDebug.humanize = __webpack_require__(/*! ms */ "../node_modules/ms/index.js");
2850 createDebug.destroy = destroy;
2851
2852 Object.keys(env).forEach(key => {
2853 createDebug[key] = env[key];
2854 });
2855
2856 /**
2857 * The currently active debug mode names, and names to skip.
2858 */
2859
2860 createDebug.names = [];
2861 createDebug.skips = [];
2862
2863 /**
2864 * Map of special "%n" handling functions, for the debug "format" argument.
2865 *
2866 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
2867 */
2868 createDebug.formatters = {};
2869
2870 /**
2871 * Selects a color for a debug namespace
2872 * @param {String} namespace The namespace string for the debug instance to be colored
2873 * @return {Number|String} An ANSI color code for the given namespace
2874 * @api private
2875 */
2876 function selectColor(namespace) {
2877 let hash = 0;
2878
2879 for (let i = 0; i < namespace.length; i++) {
2880 hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
2881 hash |= 0; // Convert to 32bit integer
2882 }
2883
2884 return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
2885 }
2886 createDebug.selectColor = selectColor;
2887
2888 /**
2889 * Create a debugger with the given `namespace`.
2890 *
2891 * @param {String} namespace
2892 * @return {Function}
2893 * @api public
2894 */
2895 function createDebug(namespace) {
2896 let prevTime;
2897 let enableOverride = null;
2898 let namespacesCache;
2899 let enabledCache;
2900
2901 function debug(...args) {
2902 // Disabled?
2903 if (!debug.enabled) {
2904 return;
2905 }
2906
2907 const self = debug;
2908
2909 // Set `diff` timestamp
2910 const curr = Number(new Date());
2911 const ms = curr - (prevTime || curr);
2912 self.diff = ms;
2913 self.prev = prevTime;
2914 self.curr = curr;
2915 prevTime = curr;
2916
2917 args[0] = createDebug.coerce(args[0]);
2918
2919 if (typeof args[0] !== 'string') {
2920 // Anything else let's inspect with %O
2921 args.unshift('%O');
2922 }
2923
2924 // Apply any `formatters` transformations
2925 let index = 0;
2926 args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
2927 // If we encounter an escaped % then don't increase the array index
2928 if (match === '%%') {
2929 return '%';
2930 }
2931 index++;
2932 const formatter = createDebug.formatters[format];
2933 if (typeof formatter === 'function') {
2934 const val = args[index];
2935 match = formatter.call(self, val);
2936
2937 // Now we need to remove `args[index]` since it's inlined in the `format`
2938 args.splice(index, 1);
2939 index--;
2940 }
2941 return match;
2942 });
2943
2944 // Apply env-specific formatting (colors, etc.)
2945 createDebug.formatArgs.call(self, args);
2946
2947 const logFn = self.log || createDebug.log;
2948 logFn.apply(self, args);
2949 }
2950
2951 debug.namespace = namespace;
2952 debug.useColors = createDebug.useColors();
2953 debug.color = createDebug.selectColor(namespace);
2954 debug.extend = extend;
2955 debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
2956
2957 Object.defineProperty(debug, 'enabled', {
2958 enumerable: true,
2959 configurable: false,
2960 get: () => {
2961 if (enableOverride !== null) {
2962 return enableOverride;
2963 }
2964 if (namespacesCache !== createDebug.namespaces) {
2965 namespacesCache = createDebug.namespaces;
2966 enabledCache = createDebug.enabled(namespace);
2967 }
2968
2969 return enabledCache;
2970 },
2971 set: v => {
2972 enableOverride = v;
2973 }
2974 });
2975
2976 // Env-specific initialization logic for debug instances
2977 if (typeof createDebug.init === 'function') {
2978 createDebug.init(debug);
2979 }
2980
2981 return debug;
2982 }
2983
2984 function extend(namespace, delimiter) {
2985 const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
2986 newDebug.log = this.log;
2987 return newDebug;
2988 }
2989
2990 /**
2991 * Enables a debug mode by namespaces. This can include modes
2992 * separated by a colon and wildcards.
2993 *
2994 * @param {String} namespaces
2995 * @api public
2996 */
2997 function enable(namespaces) {
2998 createDebug.save(namespaces);
2999 createDebug.namespaces = namespaces;
3000
3001 createDebug.names = [];
3002 createDebug.skips = [];
3003
3004 let i;
3005 const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
3006 const len = split.length;
3007
3008 for (i = 0; i < len; i++) {
3009 if (!split[i]) {
3010 // ignore empty strings
3011 continue;
3012 }
3013
3014 namespaces = split[i].replace(/\*/g, '.*?');
3015
3016 if (namespaces[0] === '-') {
3017 createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
3018 } else {
3019 createDebug.names.push(new RegExp('^' + namespaces + '$'));
3020 }
3021 }
3022 }
3023
3024 /**
3025 * Disable debug output.
3026 *
3027 * @return {String} namespaces
3028 * @api public
3029 */
3030 function disable() {
3031 const namespaces = [
3032 ...createDebug.names.map(toNamespace),
3033 ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
3034 ].join(',');
3035 createDebug.enable('');
3036 return namespaces;
3037 }
3038
3039 /**
3040 * Returns true if the given mode name is enabled, false otherwise.
3041 *
3042 * @param {String} name
3043 * @return {Boolean}
3044 * @api public
3045 */
3046 function enabled(name) {
3047 if (name[name.length - 1] === '*') {
3048 return true;
3049 }
3050
3051 let i;
3052 let len;
3053
3054 for (i = 0, len = createDebug.skips.length; i < len; i++) {
3055 if (createDebug.skips[i].test(name)) {
3056 return false;
3057 }
3058 }
3059
3060 for (i = 0, len = createDebug.names.length; i < len; i++) {
3061 if (createDebug.names[i].test(name)) {
3062 return true;
3063 }
3064 }
3065
3066 return false;
3067 }
3068
3069 /**
3070 * Convert regexp to namespace
3071 *
3072 * @param {RegExp} regxep
3073 * @return {String} namespace
3074 * @api private
3075 */
3076 function toNamespace(regexp) {
3077 return regexp.toString()
3078 .substring(2, regexp.toString().length - 2)
3079 .replace(/\.\*\?$/, '*');
3080 }
3081
3082 /**
3083 * Coerce `val`.
3084 *
3085 * @param {Mixed} val
3086 * @return {Mixed}
3087 * @api private
3088 */
3089 function coerce(val) {
3090 if (val instanceof Error) {
3091 return val.stack || val.message;
3092 }
3093 return val;
3094 }
3095
3096 /**
3097 * XXX DO NOT USE. This is a temporary stub function.
3098 * XXX It WILL be removed in the next major release.
3099 */
3100 function destroy() {
3101 console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
3102 }
3103
3104 createDebug.enable(createDebug.load());
3105
3106 return createDebug;
3107 }
3108
3109 module.exports = setup;
3110
3111
3112 /***/ }),
3113
3114 /***/ "../node_modules/extend/index.js":
3115 /*!***************************************!*\
3116 !*** ../node_modules/extend/index.js ***!
3117 \***************************************/
3118 /***/ ((module) => {
3119
3120 "use strict";
3121
3122
3123 var hasOwn = Object.prototype.hasOwnProperty;
3124 var toStr = Object.prototype.toString;
3125 var defineProperty = Object.defineProperty;
3126 var gOPD = Object.getOwnPropertyDescriptor;
3127
3128 var isArray = function isArray(arr) {
3129 if (typeof Array.isArray === 'function') {
3130 return Array.isArray(arr);
3131 }
3132
3133 return toStr.call(arr) === '[object Array]';
3134 };
3135
3136 var isPlainObject = function isPlainObject(obj) {
3137 if (!obj || toStr.call(obj) !== '[object Object]') {
3138 return false;
3139 }
3140
3141 var hasOwnConstructor = hasOwn.call(obj, 'constructor');
3142 var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
3143 // Not own constructor property must be Object
3144 if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
3145 return false;
3146 }
3147
3148 // Own properties are enumerated firstly, so to speed up,
3149 // if last one is own, then all properties are own.
3150 var key;
3151 for (key in obj) { /**/ }
3152
3153 return typeof key === 'undefined' || hasOwn.call(obj, key);
3154 };
3155
3156 // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
3157 var setProperty = function setProperty(target, options) {
3158 if (defineProperty && options.name === '__proto__') {
3159 defineProperty(target, options.name, {
3160 enumerable: true,
3161 configurable: true,
3162 value: options.newValue,
3163 writable: true
3164 });
3165 } else {
3166 target[options.name] = options.newValue;
3167 }
3168 };
3169
3170 // Return undefined instead of __proto__ if '__proto__' is not an own property
3171 var getProperty = function getProperty(obj, name) {
3172 if (name === '__proto__') {
3173 if (!hasOwn.call(obj, name)) {
3174 return void 0;
3175 } else if (gOPD) {
3176 // In early versions of node, obj['__proto__'] is buggy when obj has
3177 // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
3178 return gOPD(obj, name).value;
3179 }
3180 }
3181
3182 return obj[name];
3183 };
3184
3185 module.exports = function extend() {
3186 var options, name, src, copy, copyIsArray, clone;
3187 var target = arguments[0];
3188 var i = 1;
3189 var length = arguments.length;
3190 var deep = false;
3191
3192 // Handle a deep copy situation
3193 if (typeof target === 'boolean') {
3194 deep = target;
3195 target = arguments[1] || {};
3196 // skip the boolean and the target
3197 i = 2;
3198 }
3199 if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
3200 target = {};
3201 }
3202
3203 for (; i < length; ++i) {
3204 options = arguments[i];
3205 // Only deal with non-null/undefined values
3206 if (options != null) {
3207 // Extend the base object
3208 for (name in options) {
3209 src = getProperty(target, name);
3210 copy = getProperty(options, name);
3211
3212 // Prevent never-ending loop
3213 if (target !== copy) {
3214 // Recurse if we're merging plain objects or arrays
3215 if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
3216 if (copyIsArray) {
3217 copyIsArray = false;
3218 clone = src && isArray(src) ? src : [];
3219 } else {
3220 clone = src && isPlainObject(src) ? src : {};
3221 }
3222
3223 // Never move original objects, clone them
3224 setProperty(target, { name: name, newValue: extend(deep, clone, copy) });
3225
3226 // Don't bring in undefined values
3227 } else if (typeof copy !== 'undefined') {
3228 setProperty(target, { name: name, newValue: copy });
3229 }
3230 }
3231 }
3232 }
3233 }
3234
3235 // Return the modified object
3236 return target;
3237 };
3238
3239
3240 /***/ }),
3241
3242 /***/ "../node_modules/inline-style-parser/index.js":
3243 /*!****************************************************!*\
3244 !*** ../node_modules/inline-style-parser/index.js ***!
3245 \****************************************************/
3246 /***/ ((module) => {
3247
3248 // http://www.w3.org/TR/CSS21/grammar.html
3249 // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
3250 var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
3251
3252 var NEWLINE_REGEX = /\n/g;
3253 var WHITESPACE_REGEX = /^\s*/;
3254
3255 // declaration
3256 var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
3257 var COLON_REGEX = /^:\s*/;
3258 var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
3259 var SEMICOLON_REGEX = /^[;\s]*/;
3260
3261 // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
3262 var TRIM_REGEX = /^\s+|\s+$/g;
3263
3264 // strings
3265 var NEWLINE = '\n';
3266 var FORWARD_SLASH = '/';
3267 var ASTERISK = '*';
3268 var EMPTY_STRING = '';
3269
3270 // types
3271 var TYPE_COMMENT = 'comment';
3272 var TYPE_DECLARATION = 'declaration';
3273
3274 /**
3275 * @param {String} style
3276 * @param {Object} [options]
3277 * @return {Object[]}
3278 * @throws {TypeError}
3279 * @throws {Error}
3280 */
3281 module.exports = function(style, options) {
3282 if (typeof style !== 'string') {
3283 throw new TypeError('First argument must be a string');
3284 }
3285
3286 if (!style) return [];
3287
3288 options = options || {};
3289
3290 /**
3291 * Positional.
3292 */
3293 var lineno = 1;
3294 var column = 1;
3295
3296 /**
3297 * Update lineno and column based on `str`.
3298 *
3299 * @param {String} str
3300 */
3301 function updatePosition(str) {
3302 var lines = str.match(NEWLINE_REGEX);
3303 if (lines) lineno += lines.length;
3304 var i = str.lastIndexOf(NEWLINE);
3305 column = ~i ? str.length - i : column + str.length;
3306 }
3307
3308 /**
3309 * Mark position and patch `node.position`.
3310 *
3311 * @return {Function}
3312 */
3313 function position() {
3314 var start = { line: lineno, column: column };
3315 return function(node) {
3316 node.position = new Position(start);
3317 whitespace();
3318 return node;
3319 };
3320 }
3321
3322 /**
3323 * Store position information for a node.
3324 *
3325 * @constructor
3326 * @property {Object} start
3327 * @property {Object} end
3328 * @property {undefined|String} source
3329 */
3330 function Position(start) {
3331 this.start = start;
3332 this.end = { line: lineno, column: column };
3333 this.source = options.source;
3334 }
3335
3336 /**
3337 * Non-enumerable source string.
3338 */
3339 Position.prototype.content = style;
3340
3341 var errorsList = [];
3342
3343 /**
3344 * Error `msg`.
3345 *
3346 * @param {String} msg
3347 * @throws {Error}
3348 */
3349 function error(msg) {
3350 var err = new Error(
3351 options.source + ':' + lineno + ':' + column + ': ' + msg
3352 );
3353 err.reason = msg;
3354 err.filename = options.source;
3355 err.line = lineno;
3356 err.column = column;
3357 err.source = style;
3358
3359 if (options.silent) {
3360 errorsList.push(err);
3361 } else {
3362 throw err;
3363 }
3364 }
3365
3366 /**
3367 * Match `re` and return captures.
3368 *
3369 * @param {RegExp} re
3370 * @return {undefined|Array}
3371 */
3372 function match(re) {
3373 var m = re.exec(style);
3374 if (!m) return;
3375 var str = m[0];
3376 updatePosition(str);
3377 style = style.slice(str.length);
3378 return m;
3379 }
3380
3381 /**
3382 * Parse whitespace.
3383 */
3384 function whitespace() {
3385 match(WHITESPACE_REGEX);
3386 }
3387
3388 /**
3389 * Parse comments.
3390 *
3391 * @param {Object[]} [rules]
3392 * @return {Object[]}
3393 */
3394 function comments(rules) {
3395 var c;
3396 rules = rules || [];
3397 while ((c = comment())) {
3398 if (c !== false) {
3399 rules.push(c);
3400 }
3401 }
3402 return rules;
3403 }
3404
3405 /**
3406 * Parse comment.
3407 *
3408 * @return {Object}
3409 * @throws {Error}
3410 */
3411 function comment() {
3412 var pos = position();
3413 if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
3414
3415 var i = 2;
3416 while (
3417 EMPTY_STRING != style.charAt(i) &&
3418 (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))
3419 ) {
3420 ++i;
3421 }
3422 i += 2;
3423
3424 if (EMPTY_STRING === style.charAt(i - 1)) {
3425 return error('End of comment missing');
3426 }
3427
3428 var str = style.slice(2, i - 2);
3429 column += 2;
3430 updatePosition(str);
3431 style = style.slice(i);
3432 column += 2;
3433
3434 return pos({
3435 type: TYPE_COMMENT,
3436 comment: str
3437 });
3438 }
3439
3440 /**
3441 * Parse declaration.
3442 *
3443 * @return {Object}
3444 * @throws {Error}
3445 */
3446 function declaration() {
3447 var pos = position();
3448
3449 // prop
3450 var prop = match(PROPERTY_REGEX);
3451 if (!prop) return;
3452 comment();
3453
3454 // :
3455 if (!match(COLON_REGEX)) return error("property missing ':'");
3456
3457 // val
3458 var val = match(VALUE_REGEX);
3459
3460 var ret = pos({
3461 type: TYPE_DECLARATION,
3462 property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
3463 value: val
3464 ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))
3465 : EMPTY_STRING
3466 });
3467
3468 // ;
3469 match(SEMICOLON_REGEX);
3470
3471 return ret;
3472 }
3473
3474 /**
3475 * Parse declarations.
3476 *
3477 * @return {Object[]}
3478 */
3479 function declarations() {
3480 var decls = [];
3481
3482 comments(decls);
3483
3484 // declarations
3485 var decl;
3486 while ((decl = declaration())) {
3487 if (decl !== false) {
3488 decls.push(decl);
3489 comments(decls);
3490 }
3491 }
3492
3493 return decls;
3494 }
3495
3496 whitespace();
3497 return declarations();
3498 };
3499
3500 /**
3501 * Trim `str`.
3502 *
3503 * @param {String} str
3504 * @return {String}
3505 */
3506 function trim(str) {
3507 return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
3508 }
3509
3510
3511 /***/ }),
3512
3513 /***/ "../node_modules/is-buffer/index.js":
3514 /*!******************************************!*\
3515 !*** ../node_modules/is-buffer/index.js ***!
3516 \******************************************/
3517 /***/ ((module) => {
3518
3519 /*!
3520 * Determine if an object is a Buffer
3521 *
3522 * @author Feross Aboukhadijeh <https://feross.org>
3523 * @license MIT
3524 */
3525
3526 module.exports = function isBuffer (obj) {
3527 return obj != null && obj.constructor != null &&
3528 typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
3529 }
3530
3531
3532 /***/ }),
3533
3534 /***/ "../node_modules/ms/index.js":
3535 /*!***********************************!*\
3536 !*** ../node_modules/ms/index.js ***!
3537 \***********************************/
3538 /***/ ((module) => {
3539
3540 /**
3541 * Helpers.
3542 */
3543
3544 var s = 1000;
3545 var m = s * 60;
3546 var h = m * 60;
3547 var d = h * 24;
3548 var w = d * 7;
3549 var y = d * 365.25;
3550
3551 /**
3552 * Parse or format the given `val`.
3553 *
3554 * Options:
3555 *
3556 * - `long` verbose formatting [false]
3557 *
3558 * @param {String|Number} val
3559 * @param {Object} [options]
3560 * @throws {Error} throw an error if val is not a non-empty string or a number
3561 * @return {String|Number}
3562 * @api public
3563 */
3564
3565 module.exports = function(val, options) {
3566 options = options || {};
3567 var type = typeof val;
3568 if (type === 'string' && val.length > 0) {
3569 return parse(val);
3570 } else if (type === 'number' && isFinite(val)) {
3571 return options.long ? fmtLong(val) : fmtShort(val);
3572 }
3573 throw new Error(
3574 'val is not a non-empty string or a valid number. val=' +
3575 JSON.stringify(val)
3576 );
3577 };
3578
3579 /**
3580 * Parse the given `str` and return milliseconds.
3581 *
3582 * @param {String} str
3583 * @return {Number}
3584 * @api private
3585 */
3586
3587 function parse(str) {
3588 str = String(str);
3589 if (str.length > 100) {
3590 return;
3591 }
3592 var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
3593 str
3594 );
3595 if (!match) {
3596 return;
3597 }
3598 var n = parseFloat(match[1]);
3599 var type = (match[2] || 'ms').toLowerCase();
3600 switch (type) {
3601 case 'years':
3602 case 'year':
3603 case 'yrs':
3604 case 'yr':
3605 case 'y':
3606 return n * y;
3607 case 'weeks':
3608 case 'week':
3609 case 'w':
3610 return n * w;
3611 case 'days':
3612 case 'day':
3613 case 'd':
3614 return n * d;
3615 case 'hours':
3616 case 'hour':
3617 case 'hrs':
3618 case 'hr':
3619 case 'h':
3620 return n * h;
3621 case 'minutes':
3622 case 'minute':
3623 case 'mins':
3624 case 'min':
3625 case 'm':
3626 return n * m;
3627 case 'seconds':
3628 case 'second':
3629 case 'secs':
3630 case 'sec':
3631 case 's':
3632 return n * s;
3633 case 'milliseconds':
3634 case 'millisecond':
3635 case 'msecs':
3636 case 'msec':
3637 case 'ms':
3638 return n;
3639 default:
3640 return undefined;
3641 }
3642 }
3643
3644 /**
3645 * Short format for `ms`.
3646 *
3647 * @param {Number} ms
3648 * @return {String}
3649 * @api private
3650 */
3651
3652 function fmtShort(ms) {
3653 var msAbs = Math.abs(ms);
3654 if (msAbs >= d) {
3655 return Math.round(ms / d) + 'd';
3656 }
3657 if (msAbs >= h) {
3658 return Math.round(ms / h) + 'h';
3659 }
3660 if (msAbs >= m) {
3661 return Math.round(ms / m) + 'm';
3662 }
3663 if (msAbs >= s) {
3664 return Math.round(ms / s) + 's';
3665 }
3666 return ms + 'ms';
3667 }
3668
3669 /**
3670 * Long format for `ms`.
3671 *
3672 * @param {Number} ms
3673 * @return {String}
3674 * @api private
3675 */
3676
3677 function fmtLong(ms) {
3678 var msAbs = Math.abs(ms);
3679 if (msAbs >= d) {
3680 return plural(ms, msAbs, d, 'day');
3681 }
3682 if (msAbs >= h) {
3683 return plural(ms, msAbs, h, 'hour');
3684 }
3685 if (msAbs >= m) {
3686 return plural(ms, msAbs, m, 'minute');
3687 }
3688 if (msAbs >= s) {
3689 return plural(ms, msAbs, s, 'second');
3690 }
3691 return ms + ' ms';
3692 }
3693
3694 /**
3695 * Pluralization helper.
3696 */
3697
3698 function plural(ms, msAbs, n, name) {
3699 var isPlural = msAbs >= n * 1.5;
3700 return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
3701 }
3702
3703
3704 /***/ }),
3705
3706 /***/ "../node_modules/object-assign/index.js":
3707 /*!**********************************************!*\
3708 !*** ../node_modules/object-assign/index.js ***!
3709 \**********************************************/
3710 /***/ ((module) => {
3711
3712 "use strict";
3713 /*
3714 object-assign
3715 (c) Sindre Sorhus
3716 @license MIT
3717 */
3718
3719
3720 /* eslint-disable no-unused-vars */
3721 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
3722 var hasOwnProperty = Object.prototype.hasOwnProperty;
3723 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
3724
3725 function toObject(val) {
3726 if (val === null || val === undefined) {
3727 throw new TypeError('Object.assign cannot be called with null or undefined');
3728 }
3729
3730 return Object(val);
3731 }
3732
3733 function shouldUseNative() {
3734 try {
3735 if (!Object.assign) {
3736 return false;
3737 }
3738
3739 // Detect buggy property enumeration order in older V8 versions.
3740
3741 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
3742 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
3743 test1[5] = 'de';
3744 if (Object.getOwnPropertyNames(test1)[0] === '5') {
3745 return false;
3746 }
3747
3748 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3749 var test2 = {};
3750 for (var i = 0; i < 10; i++) {
3751 test2['_' + String.fromCharCode(i)] = i;
3752 }
3753 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
3754 return test2[n];
3755 });
3756 if (order2.join('') !== '0123456789') {
3757 return false;
3758 }
3759
3760 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3761 var test3 = {};
3762 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
3763 test3[letter] = letter;
3764 });
3765 if (Object.keys(Object.assign({}, test3)).join('') !==
3766 'abcdefghijklmnopqrst') {
3767 return false;
3768 }
3769
3770 return true;
3771 } catch (err) {
3772 // We don't expect any of the above to throw, but better to be safe.
3773 return false;
3774 }
3775 }
3776
3777 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
3778 var from;
3779 var to = toObject(target);
3780 var symbols;
3781
3782 for (var s = 1; s < arguments.length; s++) {
3783 from = Object(arguments[s]);
3784
3785 for (var key in from) {
3786 if (hasOwnProperty.call(from, key)) {
3787 to[key] = from[key];
3788 }
3789 }
3790
3791 if (getOwnPropertySymbols) {
3792 symbols = getOwnPropertySymbols(from);
3793 for (var i = 0; i < symbols.length; i++) {
3794 if (propIsEnumerable.call(from, symbols[i])) {
3795 to[symbols[i]] = from[symbols[i]];
3796 }
3797 }
3798 }
3799 }
3800
3801 return to;
3802 };
3803
3804
3805 /***/ }),
3806
3807 /***/ "../node_modules/prop-types/checkPropTypes.js":
3808 /*!****************************************************!*\
3809 !*** ../node_modules/prop-types/checkPropTypes.js ***!
3810 \****************************************************/
3811 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3812
3813 "use strict";
3814 /**
3815 * Copyright (c) 2013-present, Facebook, Inc.
3816 *
3817 * This source code is licensed under the MIT license found in the
3818 * LICENSE file in the root directory of this source tree.
3819 */
3820
3821
3822
3823 var printWarning = function() {};
3824
3825 if (true) {
3826 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js");
3827 var loggedTypeFailures = {};
3828 var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js");
3829
3830 printWarning = function(text) {
3831 var message = 'Warning: ' + text;
3832 if (typeof console !== 'undefined') {
3833 console.error(message);
3834 }
3835 try {
3836 // --- Welcome to debugging React ---
3837 // This error was thrown as a convenience so that you can use this stack
3838 // to find the callsite that caused this warning to fire.
3839 throw new Error(message);
3840 } catch (x) { /**/ }
3841 };
3842 }
3843
3844 /**
3845 * Assert that the values match with the type specs.
3846 * Error messages are memorized and will only be shown once.
3847 *
3848 * @param {object} typeSpecs Map of name to a ReactPropType
3849 * @param {object} values Runtime values that need to be type-checked
3850 * @param {string} location e.g. "prop", "context", "child context"
3851 * @param {string} componentName Name of the component for error messages.
3852 * @param {?Function} getStack Returns the component stack.
3853 * @private
3854 */
3855 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
3856 if (true) {
3857 for (var typeSpecName in typeSpecs) {
3858 if (has(typeSpecs, typeSpecName)) {
3859 var error;
3860 // Prop type validation may throw. In case they do, we don't want to
3861 // fail the render phase where it didn't fail before. So we log it.
3862 // After these have been cleaned up, we'll let them throw.
3863 try {
3864 // This is intentionally an invariant that gets caught. It's the same
3865 // behavior as without this statement except with a better message.
3866 if (typeof typeSpecs[typeSpecName] !== 'function') {
3867 var err = Error(
3868 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
3869 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
3870 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
3871 );
3872 err.name = 'Invariant Violation';
3873 throw err;
3874 }
3875 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
3876 } catch (ex) {
3877 error = ex;
3878 }
3879 if (error && !(error instanceof Error)) {
3880 printWarning(
3881 (componentName || 'React class') + ': type specification of ' +
3882 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
3883 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
3884 'You may have forgotten to pass an argument to the type checker ' +
3885 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
3886 'shape all require an argument).'
3887 );
3888 }
3889 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3890 // Only monitor this failure once because there tends to be a lot of the
3891 // same error.
3892 loggedTypeFailures[error.message] = true;
3893
3894 var stack = getStack ? getStack() : '';
3895
3896 printWarning(
3897 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
3898 );
3899 }
3900 }
3901 }
3902 }
3903 }
3904
3905 /**
3906 * Resets warning cache when testing.
3907 *
3908 * @private
3909 */
3910 checkPropTypes.resetWarningCache = function() {
3911 if (true) {
3912 loggedTypeFailures = {};
3913 }
3914 }
3915
3916 module.exports = checkPropTypes;
3917
3918
3919 /***/ }),
3920
3921 /***/ "../node_modules/prop-types/factoryWithTypeCheckers.js":
3922 /*!*************************************************************!*\
3923 !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***!
3924 \*************************************************************/
3925 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3926
3927 "use strict";
3928 /**
3929 * Copyright (c) 2013-present, Facebook, Inc.
3930 *
3931 * This source code is licensed under the MIT license found in the
3932 * LICENSE file in the root directory of this source tree.
3933 */
3934
3935
3936
3937 var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js");
3938 var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js");
3939
3940 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js");
3941 var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js");
3942 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js");
3943
3944 var printWarning = function() {};
3945
3946 if (true) {
3947 printWarning = function(text) {
3948 var message = 'Warning: ' + text;
3949 if (typeof console !== 'undefined') {
3950 console.error(message);
3951 }
3952 try {
3953 // --- Welcome to debugging React ---
3954 // This error was thrown as a convenience so that you can use this stack
3955 // to find the callsite that caused this warning to fire.
3956 throw new Error(message);
3957 } catch (x) {}
3958 };
3959 }
3960
3961 function emptyFunctionThatReturnsNull() {
3962 return null;
3963 }
3964
3965 module.exports = function(isValidElement, throwOnDirectAccess) {
3966 /* global Symbol */
3967 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
3968 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
3969
3970 /**
3971 * Returns the iterator method function contained on the iterable object.
3972 *
3973 * Be sure to invoke the function with the iterable as context:
3974 *
3975 * var iteratorFn = getIteratorFn(myIterable);
3976 * if (iteratorFn) {
3977 * var iterator = iteratorFn.call(myIterable);
3978 * ...
3979 * }
3980 *
3981 * @param {?object} maybeIterable
3982 * @return {?function}
3983 */
3984 function getIteratorFn(maybeIterable) {
3985 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
3986 if (typeof iteratorFn === 'function') {
3987 return iteratorFn;
3988 }
3989 }
3990
3991 /**
3992 * Collection of methods that allow declaration and validation of props that are
3993 * supplied to React components. Example usage:
3994 *
3995 * var Props = require('ReactPropTypes');
3996 * var MyArticle = React.createClass({
3997 * propTypes: {
3998 * // An optional string prop named "description".
3999 * description: Props.string,
4000 *
4001 * // A required enum prop named "category".
4002 * category: Props.oneOf(['News','Photos']).isRequired,
4003 *
4004 * // A prop named "dialog" that requires an instance of Dialog.
4005 * dialog: Props.instanceOf(Dialog).isRequired
4006 * },
4007 * render: function() { ... }
4008 * });
4009 *
4010 * A more formal specification of how these methods are used:
4011 *
4012 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
4013 * decl := ReactPropTypes.{type}(.isRequired)?
4014 *
4015 * Each and every declaration produces a function with the same signature. This
4016 * allows the creation of custom validation functions. For example:
4017 *
4018 * var MyLink = React.createClass({
4019 * propTypes: {
4020 * // An optional string or URI prop named "href".
4021 * href: function(props, propName, componentName) {
4022 * var propValue = props[propName];
4023 * if (propValue != null && typeof propValue !== 'string' &&
4024 * !(propValue instanceof URI)) {
4025 * return new Error(
4026 * 'Expected a string or an URI for ' + propName + ' in ' +
4027 * componentName
4028 * );
4029 * }
4030 * }
4031 * },
4032 * render: function() {...}
4033 * });
4034 *
4035 * @internal
4036 */
4037
4038 var ANONYMOUS = '<<anonymous>>';
4039
4040 // Important!
4041 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
4042 var ReactPropTypes = {
4043 array: createPrimitiveTypeChecker('array'),
4044 bigint: createPrimitiveTypeChecker('bigint'),
4045 bool: createPrimitiveTypeChecker('boolean'),
4046 func: createPrimitiveTypeChecker('function'),
4047 number: createPrimitiveTypeChecker('number'),
4048 object: createPrimitiveTypeChecker('object'),
4049 string: createPrimitiveTypeChecker('string'),
4050 symbol: createPrimitiveTypeChecker('symbol'),
4051
4052 any: createAnyTypeChecker(),
4053 arrayOf: createArrayOfTypeChecker,
4054 element: createElementTypeChecker(),
4055 elementType: createElementTypeTypeChecker(),
4056 instanceOf: createInstanceTypeChecker,
4057 node: createNodeChecker(),
4058 objectOf: createObjectOfTypeChecker,
4059 oneOf: createEnumTypeChecker,
4060 oneOfType: createUnionTypeChecker,
4061 shape: createShapeTypeChecker,
4062 exact: createStrictShapeTypeChecker,
4063 };
4064
4065 /**
4066 * inlined Object.is polyfill to avoid requiring consumers ship their own
4067 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
4068 */
4069 /*eslint-disable no-self-compare*/
4070 function is(x, y) {
4071 // SameValue algorithm
4072 if (x === y) {
4073 // Steps 1-5, 7-10
4074 // Steps 6.b-6.e: +0 != -0
4075 return x !== 0 || 1 / x === 1 / y;
4076 } else {
4077 // Step 6.a: NaN == NaN
4078 return x !== x && y !== y;
4079 }
4080 }
4081 /*eslint-enable no-self-compare*/
4082
4083 /**
4084 * We use an Error-like object for backward compatibility as people may call
4085 * PropTypes directly and inspect their output. However, we don't use real
4086 * Errors anymore. We don't inspect their stack anyway, and creating them
4087 * is prohibitively expensive if they are created too often, such as what
4088 * happens in oneOfType() for any type before the one that matched.
4089 */
4090 function PropTypeError(message, data) {
4091 this.message = message;
4092 this.data = data && typeof data === 'object' ? data: {};
4093 this.stack = '';
4094 }
4095 // Make `instanceof Error` still work for returned errors.
4096 PropTypeError.prototype = Error.prototype;
4097
4098 function createChainableTypeChecker(validate) {
4099 if (true) {
4100 var manualPropTypeCallCache = {};
4101 var manualPropTypeWarningCount = 0;
4102 }
4103 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
4104 componentName = componentName || ANONYMOUS;
4105 propFullName = propFullName || propName;
4106
4107 if (secret !== ReactPropTypesSecret) {
4108 if (throwOnDirectAccess) {
4109 // New behavior only for users of `prop-types` package
4110 var err = new Error(
4111 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
4112 'Use `PropTypes.checkPropTypes()` to call them. ' +
4113 'Read more at http://fb.me/use-check-prop-types'
4114 );
4115 err.name = 'Invariant Violation';
4116 throw err;
4117 } else if ( true && typeof console !== 'undefined') {
4118 // Old behavior for people using React.PropTypes
4119 var cacheKey = componentName + ':' + propName;
4120 if (
4121 !manualPropTypeCallCache[cacheKey] &&
4122 // Avoid spamming the console because they are often not actionable except for lib authors
4123 manualPropTypeWarningCount < 3
4124 ) {
4125 printWarning(
4126 'You are manually calling a React.PropTypes validation ' +
4127 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
4128 'and will throw in the standalone `prop-types` package. ' +
4129 'You may be seeing this warning due to a third-party PropTypes ' +
4130 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
4131 );
4132 manualPropTypeCallCache[cacheKey] = true;
4133 manualPropTypeWarningCount++;
4134 }
4135 }
4136 }
4137 if (props[propName] == null) {
4138 if (isRequired) {
4139 if (props[propName] === null) {
4140 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
4141 }
4142 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
4143 }
4144 return null;
4145 } else {
4146 return validate(props, propName, componentName, location, propFullName);
4147 }
4148 }
4149
4150 var chainedCheckType = checkType.bind(null, false);
4151 chainedCheckType.isRequired = checkType.bind(null, true);
4152
4153 return chainedCheckType;
4154 }
4155
4156 function createPrimitiveTypeChecker(expectedType) {
4157 function validate(props, propName, componentName, location, propFullName, secret) {
4158 var propValue = props[propName];
4159 var propType = getPropType(propValue);
4160 if (propType !== expectedType) {
4161 // `propValue` being instance of, say, date/regexp, pass the 'object'
4162 // check, but we can offer a more precise error message here rather than
4163 // 'of type `object`'.
4164 var preciseType = getPreciseType(propValue);
4165
4166 return new PropTypeError(
4167 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
4168 {expectedType: expectedType}
4169 );
4170 }
4171 return null;
4172 }
4173 return createChainableTypeChecker(validate);
4174 }
4175
4176 function createAnyTypeChecker() {
4177 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
4178 }
4179
4180 function createArrayOfTypeChecker(typeChecker) {
4181 function validate(props, propName, componentName, location, propFullName) {
4182 if (typeof typeChecker !== 'function') {
4183 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
4184 }
4185 var propValue = props[propName];
4186 if (!Array.isArray(propValue)) {
4187 var propType = getPropType(propValue);
4188 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
4189 }
4190 for (var i = 0; i < propValue.length; i++) {
4191 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
4192 if (error instanceof Error) {
4193 return error;
4194 }
4195 }
4196 return null;
4197 }
4198 return createChainableTypeChecker(validate);
4199 }
4200
4201 function createElementTypeChecker() {
4202 function validate(props, propName, componentName, location, propFullName) {
4203 var propValue = props[propName];
4204 if (!isValidElement(propValue)) {
4205 var propType = getPropType(propValue);
4206 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
4207 }
4208 return null;
4209 }
4210 return createChainableTypeChecker(validate);
4211 }
4212
4213 function createElementTypeTypeChecker() {
4214 function validate(props, propName, componentName, location, propFullName) {
4215 var propValue = props[propName];
4216 if (!ReactIs.isValidElementType(propValue)) {
4217 var propType = getPropType(propValue);
4218 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
4219 }
4220 return null;
4221 }
4222 return createChainableTypeChecker(validate);
4223 }
4224
4225 function createInstanceTypeChecker(expectedClass) {
4226 function validate(props, propName, componentName, location, propFullName) {
4227 if (!(props[propName] instanceof expectedClass)) {
4228 var expectedClassName = expectedClass.name || ANONYMOUS;
4229 var actualClassName = getClassName(props[propName]);
4230 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
4231 }
4232 return null;
4233 }
4234 return createChainableTypeChecker(validate);
4235 }
4236
4237 function createEnumTypeChecker(expectedValues) {
4238 if (!Array.isArray(expectedValues)) {
4239 if (true) {
4240 if (arguments.length > 1) {
4241 printWarning(
4242 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
4243 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
4244 );
4245 } else {
4246 printWarning('Invalid argument supplied to oneOf, expected an array.');
4247 }
4248 }
4249 return emptyFunctionThatReturnsNull;
4250 }
4251
4252 function validate(props, propName, componentName, location, propFullName) {
4253 var propValue = props[propName];
4254 for (var i = 0; i < expectedValues.length; i++) {
4255 if (is(propValue, expectedValues[i])) {
4256 return null;
4257 }
4258 }
4259
4260 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
4261 var type = getPreciseType(value);
4262 if (type === 'symbol') {
4263 return String(value);
4264 }
4265 return value;
4266 });
4267 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
4268 }
4269 return createChainableTypeChecker(validate);
4270 }
4271
4272 function createObjectOfTypeChecker(typeChecker) {
4273 function validate(props, propName, componentName, location, propFullName) {
4274 if (typeof typeChecker !== 'function') {
4275 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
4276 }
4277 var propValue = props[propName];
4278 var propType = getPropType(propValue);
4279 if (propType !== 'object') {
4280 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
4281 }
4282 for (var key in propValue) {
4283 if (has(propValue, key)) {
4284 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4285 if (error instanceof Error) {
4286 return error;
4287 }
4288 }
4289 }
4290 return null;
4291 }
4292 return createChainableTypeChecker(validate);
4293 }
4294
4295 function createUnionTypeChecker(arrayOfTypeCheckers) {
4296 if (!Array.isArray(arrayOfTypeCheckers)) {
4297 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
4298 return emptyFunctionThatReturnsNull;
4299 }
4300
4301 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
4302 var checker = arrayOfTypeCheckers[i];
4303 if (typeof checker !== 'function') {
4304 printWarning(
4305 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
4306 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
4307 );
4308 return emptyFunctionThatReturnsNull;
4309 }
4310 }
4311
4312 function validate(props, propName, componentName, location, propFullName) {
4313 var expectedTypes = [];
4314 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
4315 var checker = arrayOfTypeCheckers[i];
4316 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
4317 if (checkerResult == null) {
4318 return null;
4319 }
4320 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
4321 expectedTypes.push(checkerResult.data.expectedType);
4322 }
4323 }
4324 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
4325 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
4326 }
4327 return createChainableTypeChecker(validate);
4328 }
4329
4330 function createNodeChecker() {
4331 function validate(props, propName, componentName, location, propFullName) {
4332 if (!isNode(props[propName])) {
4333 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
4334 }
4335 return null;
4336 }
4337 return createChainableTypeChecker(validate);
4338 }
4339
4340 function invalidValidatorError(componentName, location, propFullName, key, type) {
4341 return new PropTypeError(
4342 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
4343 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
4344 );
4345 }
4346
4347 function createShapeTypeChecker(shapeTypes) {
4348 function validate(props, propName, componentName, location, propFullName) {
4349 var propValue = props[propName];
4350 var propType = getPropType(propValue);
4351 if (propType !== 'object') {
4352 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
4353 }
4354 for (var key in shapeTypes) {
4355 var checker = shapeTypes[key];
4356 if (typeof checker !== 'function') {
4357 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
4358 }
4359 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4360 if (error) {
4361 return error;
4362 }
4363 }
4364 return null;
4365 }
4366 return createChainableTypeChecker(validate);
4367 }
4368
4369 function createStrictShapeTypeChecker(shapeTypes) {
4370 function validate(props, propName, componentName, location, propFullName) {
4371 var propValue = props[propName];
4372 var propType = getPropType(propValue);
4373 if (propType !== 'object') {
4374 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
4375 }
4376 // We need to check all keys in case some are required but missing from props.
4377 var allKeys = assign({}, props[propName], shapeTypes);
4378 for (var key in allKeys) {
4379 var checker = shapeTypes[key];
4380 if (has(shapeTypes, key) && typeof checker !== 'function') {
4381 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
4382 }
4383 if (!checker) {
4384 return new PropTypeError(
4385 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
4386 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
4387 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
4388 );
4389 }
4390 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4391 if (error) {
4392 return error;
4393 }
4394 }
4395 return null;
4396 }
4397
4398 return createChainableTypeChecker(validate);
4399 }
4400
4401 function isNode(propValue) {
4402 switch (typeof propValue) {
4403 case 'number':
4404 case 'string':
4405 case 'undefined':
4406 return true;
4407 case 'boolean':
4408 return !propValue;
4409 case 'object':
4410 if (Array.isArray(propValue)) {
4411 return propValue.every(isNode);
4412 }
4413 if (propValue === null || isValidElement(propValue)) {
4414 return true;
4415 }
4416
4417 var iteratorFn = getIteratorFn(propValue);
4418 if (iteratorFn) {
4419 var iterator = iteratorFn.call(propValue);
4420 var step;
4421 if (iteratorFn !== propValue.entries) {
4422 while (!(step = iterator.next()).done) {
4423 if (!isNode(step.value)) {
4424 return false;
4425 }
4426 }
4427 } else {
4428 // Iterator will provide entry [k,v] tuples rather than values.
4429 while (!(step = iterator.next()).done) {
4430 var entry = step.value;
4431 if (entry) {
4432 if (!isNode(entry[1])) {
4433 return false;
4434 }
4435 }
4436 }
4437 }
4438 } else {
4439 return false;
4440 }
4441
4442 return true;
4443 default:
4444 return false;
4445 }
4446 }
4447
4448 function isSymbol(propType, propValue) {
4449 // Native Symbol.
4450 if (propType === 'symbol') {
4451 return true;
4452 }
4453
4454 // falsy value can't be a Symbol
4455 if (!propValue) {
4456 return false;
4457 }
4458
4459 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
4460 if (propValue['@@toStringTag'] === 'Symbol') {
4461 return true;
4462 }
4463
4464 // Fallback for non-spec compliant Symbols which are polyfilled.
4465 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
4466 return true;
4467 }
4468
4469 return false;
4470 }
4471
4472 // Equivalent of `typeof` but with special handling for array and regexp.
4473 function getPropType(propValue) {
4474 var propType = typeof propValue;
4475 if (Array.isArray(propValue)) {
4476 return 'array';
4477 }
4478 if (propValue instanceof RegExp) {
4479 // Old webkits (at least until Android 4.0) return 'function' rather than
4480 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
4481 // passes PropTypes.object.
4482 return 'object';
4483 }
4484 if (isSymbol(propType, propValue)) {
4485 return 'symbol';
4486 }
4487 return propType;
4488 }
4489
4490 // This handles more types than `getPropType`. Only used for error messages.
4491 // See `createPrimitiveTypeChecker`.
4492 function getPreciseType(propValue) {
4493 if (typeof propValue === 'undefined' || propValue === null) {
4494 return '' + propValue;
4495 }
4496 var propType = getPropType(propValue);
4497 if (propType === 'object') {
4498 if (propValue instanceof Date) {
4499 return 'date';
4500 } else if (propValue instanceof RegExp) {
4501 return 'regexp';
4502 }
4503 }
4504 return propType;
4505 }
4506
4507 // Returns a string that is postfixed to a warning about an invalid type.
4508 // For example, "undefined" or "of type array"
4509 function getPostfixForTypeWarning(value) {
4510 var type = getPreciseType(value);
4511 switch (type) {
4512 case 'array':
4513 case 'object':
4514 return 'an ' + type;
4515 case 'boolean':
4516 case 'date':
4517 case 'regexp':
4518 return 'a ' + type;
4519 default:
4520 return type;
4521 }
4522 }
4523
4524 // Returns class name of the object, if any.
4525 function getClassName(propValue) {
4526 if (!propValue.constructor || !propValue.constructor.name) {
4527 return ANONYMOUS;
4528 }
4529 return propValue.constructor.name;
4530 }
4531
4532 ReactPropTypes.checkPropTypes = checkPropTypes;
4533 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
4534 ReactPropTypes.PropTypes = ReactPropTypes;
4535
4536 return ReactPropTypes;
4537 };
4538
4539
4540 /***/ }),
4541
4542 /***/ "../node_modules/prop-types/index.js":
4543 /*!*******************************************!*\
4544 !*** ../node_modules/prop-types/index.js ***!
4545 \*******************************************/
4546 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4547
4548 /**
4549 * Copyright (c) 2013-present, Facebook, Inc.
4550 *
4551 * This source code is licensed under the MIT license found in the
4552 * LICENSE file in the root directory of this source tree.
4553 */
4554
4555 if (true) {
4556 var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js");
4557
4558 // By explicitly using `prop-types` you are opting into new development behavior.
4559 // http://fb.me/prop-types-in-prod
4560 var throwOnDirectAccess = true;
4561 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
4562 } else {}
4563
4564
4565 /***/ }),
4566
4567 /***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js":
4568 /*!**************************************************************!*\
4569 !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
4570 \**************************************************************/
4571 /***/ ((module) => {
4572
4573 "use strict";
4574 /**
4575 * Copyright (c) 2013-present, Facebook, Inc.
4576 *
4577 * This source code is licensed under the MIT license found in the
4578 * LICENSE file in the root directory of this source tree.
4579 */
4580
4581
4582
4583 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
4584
4585 module.exports = ReactPropTypesSecret;
4586
4587
4588 /***/ }),
4589
4590 /***/ "../node_modules/prop-types/lib/has.js":
4591 /*!*********************************************!*\
4592 !*** ../node_modules/prop-types/lib/has.js ***!
4593 \*********************************************/
4594 /***/ ((module) => {
4595
4596 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
4597
4598
4599 /***/ }),
4600
4601 /***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js":
4602 /*!************************************************************************************!*\
4603 !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***!
4604 \************************************************************************************/
4605 /***/ ((__unused_webpack_module, exports) => {
4606
4607 "use strict";
4608 /** @license React v16.13.1
4609 * react-is.development.js
4610 *
4611 * Copyright (c) Facebook, Inc. and its affiliates.
4612 *
4613 * This source code is licensed under the MIT license found in the
4614 * LICENSE file in the root directory of this source tree.
4615 */
4616
4617
4618
4619
4620
4621 if (true) {
4622 (function() {
4623 'use strict';
4624
4625 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
4626 // nor polyfill, then a plain number is used for performance.
4627 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
4628 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
4629 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
4630 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
4631 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
4632 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
4633 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
4634 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
4635 // (unstable) APIs that have been removed. Can we remove the symbols?
4636
4637 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
4638 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
4639 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
4640 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
4641 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
4642 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
4643 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
4644 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
4645 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
4646 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
4647 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
4648
4649 function isValidElementType(type) {
4650 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
4651 type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
4652 }
4653
4654 function typeOf(object) {
4655 if (typeof object === 'object' && object !== null) {
4656 var $$typeof = object.$$typeof;
4657
4658 switch ($$typeof) {
4659 case REACT_ELEMENT_TYPE:
4660 var type = object.type;
4661
4662 switch (type) {
4663 case REACT_ASYNC_MODE_TYPE:
4664 case REACT_CONCURRENT_MODE_TYPE:
4665 case REACT_FRAGMENT_TYPE:
4666 case REACT_PROFILER_TYPE:
4667 case REACT_STRICT_MODE_TYPE:
4668 case REACT_SUSPENSE_TYPE:
4669 return type;
4670
4671 default:
4672 var $$typeofType = type && type.$$typeof;
4673
4674 switch ($$typeofType) {
4675 case REACT_CONTEXT_TYPE:
4676 case REACT_FORWARD_REF_TYPE:
4677 case REACT_LAZY_TYPE:
4678 case REACT_MEMO_TYPE:
4679 case REACT_PROVIDER_TYPE:
4680 return $$typeofType;
4681
4682 default:
4683 return $$typeof;
4684 }
4685
4686 }
4687
4688 case REACT_PORTAL_TYPE:
4689 return $$typeof;
4690 }
4691 }
4692
4693 return undefined;
4694 } // AsyncMode is deprecated along with isAsyncMode
4695
4696 var AsyncMode = REACT_ASYNC_MODE_TYPE;
4697 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
4698 var ContextConsumer = REACT_CONTEXT_TYPE;
4699 var ContextProvider = REACT_PROVIDER_TYPE;
4700 var Element = REACT_ELEMENT_TYPE;
4701 var ForwardRef = REACT_FORWARD_REF_TYPE;
4702 var Fragment = REACT_FRAGMENT_TYPE;
4703 var Lazy = REACT_LAZY_TYPE;
4704 var Memo = REACT_MEMO_TYPE;
4705 var Portal = REACT_PORTAL_TYPE;
4706 var Profiler = REACT_PROFILER_TYPE;
4707 var StrictMode = REACT_STRICT_MODE_TYPE;
4708 var Suspense = REACT_SUSPENSE_TYPE;
4709 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
4710
4711 function isAsyncMode(object) {
4712 {
4713 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
4714 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
4715
4716 console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
4717 }
4718 }
4719
4720 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
4721 }
4722 function isConcurrentMode(object) {
4723 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
4724 }
4725 function isContextConsumer(object) {
4726 return typeOf(object) === REACT_CONTEXT_TYPE;
4727 }
4728 function isContextProvider(object) {
4729 return typeOf(object) === REACT_PROVIDER_TYPE;
4730 }
4731 function isElement(object) {
4732 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
4733 }
4734 function isForwardRef(object) {
4735 return typeOf(object) === REACT_FORWARD_REF_TYPE;
4736 }
4737 function isFragment(object) {
4738 return typeOf(object) === REACT_FRAGMENT_TYPE;
4739 }
4740 function isLazy(object) {
4741 return typeOf(object) === REACT_LAZY_TYPE;
4742 }
4743 function isMemo(object) {
4744 return typeOf(object) === REACT_MEMO_TYPE;
4745 }
4746 function isPortal(object) {
4747 return typeOf(object) === REACT_PORTAL_TYPE;
4748 }
4749 function isProfiler(object) {
4750 return typeOf(object) === REACT_PROFILER_TYPE;
4751 }
4752 function isStrictMode(object) {
4753 return typeOf(object) === REACT_STRICT_MODE_TYPE;
4754 }
4755 function isSuspense(object) {
4756 return typeOf(object) === REACT_SUSPENSE_TYPE;
4757 }
4758
4759 exports.AsyncMode = AsyncMode;
4760 exports.ConcurrentMode = ConcurrentMode;
4761 exports.ContextConsumer = ContextConsumer;
4762 exports.ContextProvider = ContextProvider;
4763 exports.Element = Element;
4764 exports.ForwardRef = ForwardRef;
4765 exports.Fragment = Fragment;
4766 exports.Lazy = Lazy;
4767 exports.Memo = Memo;
4768 exports.Portal = Portal;
4769 exports.Profiler = Profiler;
4770 exports.StrictMode = StrictMode;
4771 exports.Suspense = Suspense;
4772 exports.isAsyncMode = isAsyncMode;
4773 exports.isConcurrentMode = isConcurrentMode;
4774 exports.isContextConsumer = isContextConsumer;
4775 exports.isContextProvider = isContextProvider;
4776 exports.isElement = isElement;
4777 exports.isForwardRef = isForwardRef;
4778 exports.isFragment = isFragment;
4779 exports.isLazy = isLazy;
4780 exports.isMemo = isMemo;
4781 exports.isPortal = isPortal;
4782 exports.isProfiler = isProfiler;
4783 exports.isStrictMode = isStrictMode;
4784 exports.isSuspense = isSuspense;
4785 exports.isValidElementType = isValidElementType;
4786 exports.typeOf = typeOf;
4787 })();
4788 }
4789
4790
4791 /***/ }),
4792
4793 /***/ "../node_modules/prop-types/node_modules/react-is/index.js":
4794 /*!*****************************************************************!*\
4795 !*** ../node_modules/prop-types/node_modules/react-is/index.js ***!
4796 \*****************************************************************/
4797 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4798
4799 "use strict";
4800
4801
4802 if (false) {} else {
4803 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js");
4804 }
4805
4806
4807 /***/ }),
4808
4809 /***/ "../node_modules/react-draggable/build/cjs/Draggable.js":
4810 /*!**************************************************************!*\
4811 !*** ../node_modules/react-draggable/build/cjs/Draggable.js ***!
4812 \**************************************************************/
4813 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4814
4815 "use strict";
4816
4817
4818 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4819
4820 Object.defineProperty(exports, "__esModule", ({
4821 value: true
4822 }));
4823 Object.defineProperty(exports, "DraggableCore", ({
4824 enumerable: true,
4825 get: function get() {
4826 return _DraggableCore.default;
4827 }
4828 }));
4829 exports["default"] = void 0;
4830
4831 var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
4832
4833 var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"));
4834
4835 var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "react-dom"));
4836
4837 var _clsx2 = _interopRequireDefault(__webpack_require__(/*! clsx */ "../node_modules/clsx/dist/clsx.m.js"));
4838
4839 var _domFns = __webpack_require__(/*! ./utils/domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js");
4840
4841 var _positionFns = __webpack_require__(/*! ./utils/positionFns */ "../node_modules/react-draggable/build/cjs/utils/positionFns.js");
4842
4843 var _shims = __webpack_require__(/*! ./utils/shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js");
4844
4845 var _DraggableCore = _interopRequireDefault(__webpack_require__(/*! ./DraggableCore */ "../node_modules/react-draggable/build/cjs/DraggableCore.js"));
4846
4847 var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ "../node_modules/react-draggable/build/cjs/utils/log.js"));
4848
4849 var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];
4850
4851 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4852
4853 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4854
4855 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4856
4857 function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4858
4859 function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4860
4861 function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4862
4863 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4864
4865 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4866
4867 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4868
4869 function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4870
4871 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4872
4873 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4874
4875 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
4876
4877 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4878
4879 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4880
4881 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4882
4883 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4884
4885 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
4886
4887 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4888
4889 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
4890
4891 function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
4892
4893 function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4894
4895 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4896
4897 function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4898
4899 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4900
4901 //
4902 // Define <Draggable>
4903 //
4904 var Draggable = /*#__PURE__*/function (_React$Component) {
4905 _inherits(Draggable, _React$Component);
4906
4907 var _super = _createSuper(Draggable);
4908
4909 function Draggable(props
4910 /*: DraggableProps*/
4911 ) {
4912 var _this;
4913
4914 _classCallCheck(this, Draggable);
4915
4916 _this = _super.call(this, props);
4917
4918 _defineProperty(_assertThisInitialized(_this), "onDragStart", function (e, coreData) {
4919 (0, _log.default)('Draggable: onDragStart: %j', coreData); // Short-circuit if user's callback killed it.
4920
4921 var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); // Kills start event on core as well, so move handlers are never bound.
4922
4923
4924 if (shouldStart === false) return false;
4925
4926 _this.setState({
4927 dragging: true,
4928 dragged: true
4929 });
4930 });
4931
4932 _defineProperty(_assertThisInitialized(_this), "onDrag", function (e, coreData) {
4933 if (!_this.state.dragging) return false;
4934 (0, _log.default)('Draggable: onDrag: %j', coreData);
4935 var uiData = (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData);
4936 var newState
4937 /*: $Shape<DraggableState>*/
4938 = {
4939 x: uiData.x,
4940 y: uiData.y
4941 }; // Keep within bounds.
4942
4943 if (_this.props.bounds) {
4944 // Save original x and y.
4945 var x = newState.x,
4946 y = newState.y; // Add slack to the values used to calculate bound position. This will ensure that if
4947 // we start removing slack, the element won't react to it right away until it's been
4948 // completely removed.
4949
4950 newState.x += _this.state.slackX;
4951 newState.y += _this.state.slackY; // Get bound position. This will ceil/floor the x and y within the boundaries.
4952
4953 var _getBoundPosition = (0, _positionFns.getBoundPosition)(_assertThisInitialized(_this), newState.x, newState.y),
4954 _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2),
4955 newStateX = _getBoundPosition2[0],
4956 newStateY = _getBoundPosition2[1];
4957
4958 newState.x = newStateX;
4959 newState.y = newStateY; // Recalculate slack by noting how much was shaved by the boundPosition handler.
4960
4961 newState.slackX = _this.state.slackX + (x - newState.x);
4962 newState.slackY = _this.state.slackY + (y - newState.y); // Update the event we fire to reflect what really happened after bounds took effect.
4963
4964 uiData.x = newState.x;
4965 uiData.y = newState.y;
4966 uiData.deltaX = newState.x - _this.state.x;
4967 uiData.deltaY = newState.y - _this.state.y;
4968 } // Short-circuit if user's callback killed it.
4969
4970
4971 var shouldUpdate = _this.props.onDrag(e, uiData);
4972
4973 if (shouldUpdate === false) return false;
4974
4975 _this.setState(newState);
4976 });
4977
4978 _defineProperty(_assertThisInitialized(_this), "onDragStop", function (e, coreData) {
4979 if (!_this.state.dragging) return false; // Short-circuit if user's callback killed it.
4980
4981 var shouldContinue = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData));
4982
4983 if (shouldContinue === false) return false;
4984 (0, _log.default)('Draggable: onDragStop: %j', coreData);
4985 var newState
4986 /*: $Shape<DraggableState>*/
4987 = {
4988 dragging: false,
4989 slackX: 0,
4990 slackY: 0
4991 }; // If this is a controlled component, the result of this operation will be to
4992 // revert back to the old position. We expect a handler on `onDragStop`, at the least.
4993
4994 var controlled = Boolean(_this.props.position);
4995
4996 if (controlled) {
4997 var _this$props$position = _this.props.position,
4998 x = _this$props$position.x,
4999 y = _this$props$position.y;
5000 newState.x = x;
5001 newState.y = y;
5002 }
5003
5004 _this.setState(newState);
5005 });
5006
5007 _this.state = {
5008 // Whether or not we are currently dragging.
5009 dragging: false,
5010 // Whether or not we have been dragged before.
5011 dragged: false,
5012 // Current transform x and y.
5013 x: props.position ? props.position.x : props.defaultPosition.x,
5014 y: props.position ? props.position.y : props.defaultPosition.y,
5015 prevPropsPosition: _objectSpread({}, props.position),
5016 // Used for compensating for out-of-bounds drags
5017 slackX: 0,
5018 slackY: 0,
5019 // Can only determine if SVG after mounting
5020 isElementSVG: false
5021 };
5022
5023 if (props.position && !(props.onDrag || props.onStop)) {
5024 // eslint-disable-next-line no-console
5025 console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');
5026 }
5027
5028 return _this;
5029 }
5030
5031 _createClass(Draggable, [{
5032 key: "componentDidMount",
5033 value: function componentDidMount() {
5034 // Check to see if the element passed is an instanceof SVGElement
5035 if (typeof window.SVGElement !== 'undefined' && this.findDOMNode() instanceof window.SVGElement) {
5036 this.setState({
5037 isElementSVG: true
5038 });
5039 }
5040 }
5041 }, {
5042 key: "componentWillUnmount",
5043 value: function componentWillUnmount() {
5044 this.setState({
5045 dragging: false
5046 }); // prevents invariant if unmounted while dragging
5047 } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
5048 // the underlying DOM node ourselves. See the README for more information.
5049
5050 }, {
5051 key: "findDOMNode",
5052 value: function findDOMNode()
5053 /*: ?HTMLElement*/
5054 {
5055 var _this$props$nodeRef$c, _this$props, _this$props$nodeRef;
5056
5057 return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
5058 }
5059 }, {
5060 key: "render",
5061 value: function render()
5062 /*: ReactElement<any>*/
5063 {
5064 var _clsx;
5065
5066 var _this$props2 = this.props,
5067 axis = _this$props2.axis,
5068 bounds = _this$props2.bounds,
5069 children = _this$props2.children,
5070 defaultPosition = _this$props2.defaultPosition,
5071 defaultClassName = _this$props2.defaultClassName,
5072 defaultClassNameDragging = _this$props2.defaultClassNameDragging,
5073 defaultClassNameDragged = _this$props2.defaultClassNameDragged,
5074 position = _this$props2.position,
5075 positionOffset = _this$props2.positionOffset,
5076 scale = _this$props2.scale,
5077 draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded);
5078
5079 var style = {};
5080 var svgTransform = null; // If this is controlled, we don't want to move it - unless it's dragging.
5081
5082 var controlled = Boolean(position);
5083 var draggable = !controlled || this.state.dragging;
5084 var validPosition = position || defaultPosition;
5085 var transformOpts = {
5086 // Set left if horizontal drag is enabled
5087 x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
5088 // Set top if vertical drag is enabled
5089 y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
5090 }; // If this element was SVG, we use the `transform` attribute.
5091
5092 if (this.state.isElementSVG) {
5093 svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
5094 } else {
5095 // Add a CSS transform to move the element around. This allows us to move the element around
5096 // without worrying about whether or not it is relatively or absolutely positioned.
5097 // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
5098 // has a clean slate.
5099 style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
5100 } // Mark with class while dragging
5101
5102
5103 var className = (0, _clsx2.default)(children.props.className || '', defaultClassName, (_clsx = {}, _defineProperty(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty(_clsx, defaultClassNameDragged, this.state.dragged), _clsx)); // Reuse the child provided
5104 // This makes it flexible to use whatever element is wanted (div, ul, etc)
5105
5106 return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
5107 onStart: this.onDragStart,
5108 onDrag: this.onDrag,
5109 onStop: this.onDragStop
5110 }), /*#__PURE__*/React.cloneElement(React.Children.only(children), {
5111 className: className,
5112 style: _objectSpread(_objectSpread({}, children.props.style), style),
5113 transform: svgTransform
5114 }));
5115 }
5116 }], [{
5117 key: "getDerivedStateFromProps",
5118 value: // React 16.3+
5119 // Arity (props, state)
5120 function getDerivedStateFromProps(_ref, _ref2)
5121 /*: ?$Shape<DraggableState>*/
5122 {
5123 var position = _ref.position;
5124 var prevPropsPosition = _ref2.prevPropsPosition;
5125
5126 // Set x/y if a new position is provided in props that is different than the previous.
5127 if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
5128 (0, _log.default)('Draggable: getDerivedStateFromProps %j', {
5129 position: position,
5130 prevPropsPosition: prevPropsPosition
5131 });
5132 return {
5133 x: position.x,
5134 y: position.y,
5135 prevPropsPosition: _objectSpread({}, position)
5136 };
5137 }
5138
5139 return null;
5140 }
5141 }]);
5142
5143 return Draggable;
5144 }(React.Component);
5145
5146 exports["default"] = Draggable;
5147
5148 _defineProperty(Draggable, "displayName", 'Draggable');
5149
5150 _defineProperty(Draggable, "propTypes", _objectSpread(_objectSpread({}, _DraggableCore.default.propTypes), {}, {
5151 /**
5152 * `axis` determines which axis the draggable can move.
5153 *
5154 * Note that all callbacks will still return data as normal. This only
5155 * controls flushing to the DOM.
5156 *
5157 * 'both' allows movement horizontally and vertically.
5158 * 'x' limits movement to horizontal axis.
5159 * 'y' limits movement to vertical axis.
5160 * 'none' limits all movement.
5161 *
5162 * Defaults to 'both'.
5163 */
5164 axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
5165
5166 /**
5167 * `bounds` determines the range of movement available to the element.
5168 * Available values are:
5169 *
5170 * 'parent' restricts movement within the Draggable's parent node.
5171 *
5172 * Alternatively, pass an object with the following properties, all of which are optional:
5173 *
5174 * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
5175 *
5176 * All values are in px.
5177 *
5178 * Example:
5179 *
5180 * ```jsx
5181 * let App = React.createClass({
5182 * render: function () {
5183 * return (
5184 * <Draggable bounds={{right: 300, bottom: 300}}>
5185 * <div>Content</div>
5186 * </Draggable>
5187 * );
5188 * }
5189 * });
5190 * ```
5191 */
5192 bounds: _propTypes.default.oneOfType([_propTypes.default.shape({
5193 left: _propTypes.default.number,
5194 right: _propTypes.default.number,
5195 top: _propTypes.default.number,
5196 bottom: _propTypes.default.number
5197 }), _propTypes.default.string, _propTypes.default.oneOf([false])]),
5198 defaultClassName: _propTypes.default.string,
5199 defaultClassNameDragging: _propTypes.default.string,
5200 defaultClassNameDragged: _propTypes.default.string,
5201
5202 /**
5203 * `defaultPosition` specifies the x and y that the dragged item should start at
5204 *
5205 * Example:
5206 *
5207 * ```jsx
5208 * let App = React.createClass({
5209 * render: function () {
5210 * return (
5211 * <Draggable defaultPosition={{x: 25, y: 25}}>
5212 * <div>I start with transformX: 25px and transformY: 25px;</div>
5213 * </Draggable>
5214 * );
5215 * }
5216 * });
5217 * ```
5218 */
5219 defaultPosition: _propTypes.default.shape({
5220 x: _propTypes.default.number,
5221 y: _propTypes.default.number
5222 }),
5223 positionOffset: _propTypes.default.shape({
5224 x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
5225 y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
5226 }),
5227
5228 /**
5229 * `position`, if present, defines the current position of the element.
5230 *
5231 * This is similar to how form elements in React work - if no `position` is supplied, the component
5232 * is uncontrolled.
5233 *
5234 * Example:
5235 *
5236 * ```jsx
5237 * let App = React.createClass({
5238 * render: function () {
5239 * return (
5240 * <Draggable position={{x: 25, y: 25}}>
5241 * <div>I start with transformX: 25px and transformY: 25px;</div>
5242 * </Draggable>
5243 * );
5244 * }
5245 * });
5246 * ```
5247 */
5248 position: _propTypes.default.shape({
5249 x: _propTypes.default.number,
5250 y: _propTypes.default.number
5251 }),
5252
5253 /**
5254 * These properties should be defined on the child, not here.
5255 */
5256 className: _shims.dontSetMe,
5257 style: _shims.dontSetMe,
5258 transform: _shims.dontSetMe
5259 }));
5260
5261 _defineProperty(Draggable, "defaultProps", _objectSpread(_objectSpread({}, _DraggableCore.default.defaultProps), {}, {
5262 axis: 'both',
5263 bounds: false,
5264 defaultClassName: 'react-draggable',
5265 defaultClassNameDragging: 'react-draggable-dragging',
5266 defaultClassNameDragged: 'react-draggable-dragged',
5267 defaultPosition: {
5268 x: 0,
5269 y: 0
5270 },
5271 scale: 1
5272 }));
5273
5274 /***/ }),
5275
5276 /***/ "../node_modules/react-draggable/build/cjs/DraggableCore.js":
5277 /*!******************************************************************!*\
5278 !*** ../node_modules/react-draggable/build/cjs/DraggableCore.js ***!
5279 \******************************************************************/
5280 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5281
5282 "use strict";
5283
5284
5285 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5286
5287 Object.defineProperty(exports, "__esModule", ({
5288 value: true
5289 }));
5290 exports["default"] = void 0;
5291
5292 var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
5293
5294 var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"));
5295
5296 var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "react-dom"));
5297
5298 var _domFns = __webpack_require__(/*! ./utils/domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js");
5299
5300 var _positionFns = __webpack_require__(/*! ./utils/positionFns */ "../node_modules/react-draggable/build/cjs/utils/positionFns.js");
5301
5302 var _shims = __webpack_require__(/*! ./utils/shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js");
5303
5304 var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ "../node_modules/react-draggable/build/cjs/utils/log.js"));
5305
5306 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5307
5308 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
5309
5310 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
5311
5312 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5313
5314 function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5315
5316 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5317
5318 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5319
5320 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
5321
5322 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
5323
5324 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5325
5326 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
5327
5328 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5329
5330 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
5331
5332 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
5333
5334 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
5335
5336 function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
5337
5338 function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
5339
5340 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5341
5342 function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
5343
5344 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5345
5346 // Simple abstraction for dragging events names.
5347 var eventsFor = {
5348 touch: {
5349 start: 'touchstart',
5350 move: 'touchmove',
5351 stop: 'touchend'
5352 },
5353 mouse: {
5354 start: 'mousedown',
5355 move: 'mousemove',
5356 stop: 'mouseup'
5357 }
5358 }; // Default to mouse events.
5359
5360 var dragEventFor = eventsFor.mouse;
5361 /*:: type DraggableCoreState = {
5362 dragging: boolean,
5363 lastX: number,
5364 lastY: number,
5365 touchIdentifier: ?number
5366 };*/
5367
5368 /*:: export type DraggableData = {
5369 node: HTMLElement,
5370 x: number, y: number,
5371 deltaX: number, deltaY: number,
5372 lastX: number, lastY: number,
5373 };*/
5374
5375 /*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false;*/
5376
5377 /*:: export type ControlPosition = {x: number, y: number};*/
5378
5379 /*:: export type PositionOffsetControlPosition = {x: number|string, y: number|string};*/
5380
5381 /*:: export type DraggableCoreDefaultProps = {
5382 allowAnyClick: boolean,
5383 disabled: boolean,
5384 enableUserSelectHack: boolean,
5385 onStart: DraggableEventHandler,
5386 onDrag: DraggableEventHandler,
5387 onStop: DraggableEventHandler,
5388 onMouseDown: (e: MouseEvent) => void,
5389 scale: number,
5390 };*/
5391
5392 /*:: export type DraggableCoreProps = {
5393 ...DraggableCoreDefaultProps,
5394 cancel: string,
5395 children: ReactElement<any>,
5396 offsetParent: HTMLElement,
5397 grid: [number, number],
5398 handle: string,
5399 nodeRef?: ?React.ElementRef<any>,
5400 };*/
5401
5402 //
5403 // Define <DraggableCore>.
5404 //
5405 // <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can
5406 // work well with libraries that require more control over the element.
5407 //
5408 var DraggableCore = /*#__PURE__*/function (_React$Component) {
5409 _inherits(DraggableCore, _React$Component);
5410
5411 var _super = _createSuper(DraggableCore);
5412
5413 function DraggableCore() {
5414 var _this;
5415
5416 _classCallCheck(this, DraggableCore);
5417
5418 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5419 args[_key] = arguments[_key];
5420 }
5421
5422 _this = _super.call.apply(_super, [this].concat(args));
5423
5424 _defineProperty(_assertThisInitialized(_this), "state", {
5425 dragging: false,
5426 // Used while dragging to determine deltas.
5427 lastX: NaN,
5428 lastY: NaN,
5429 touchIdentifier: null
5430 });
5431
5432 _defineProperty(_assertThisInitialized(_this), "mounted", false);
5433
5434 _defineProperty(_assertThisInitialized(_this), "handleDragStart", function (e) {
5435 // Make it possible to attach event handlers on top of this one.
5436 _this.props.onMouseDown(e); // Only accept left-clicks.
5437
5438
5439 if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false; // Get nodes. Be sure to grab relative document (could be iframed)
5440
5441 var thisNode = _this.findDOMNode();
5442
5443 if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
5444 throw new Error('<DraggableCore> not mounted on DragStart!');
5445 }
5446
5447 var ownerDocument = thisNode.ownerDocument; // Short circuit if handle or cancel prop was provided and selector doesn't match.
5448
5449 if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {
5450 return;
5451 } // Prevent scrolling on mobile devices, like ipad/iphone.
5452 // Important that this is after handle/cancel.
5453
5454
5455 if (e.type === 'touchstart') e.preventDefault(); // Set touch identifier in component state if this is a touch event. This allows us to
5456 // distinguish between individual touches on multitouch screens by identifying which
5457 // touchpoint was set to this element.
5458
5459 var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);
5460
5461 _this.setState({
5462 touchIdentifier: touchIdentifier
5463 }); // Get the current drag point from the event. This is used as the offset.
5464
5465
5466 var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _assertThisInitialized(_this));
5467 if (position == null) return; // not possible but satisfies flow
5468
5469 var x = position.x,
5470 y = position.y; // Create an event object with all the data parents need to make a decision here.
5471
5472 var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
5473 (0, _log.default)('DraggableCore: handleDragStart: %j', coreEvent); // Call event handler. If it returns explicit false, cancel.
5474
5475 (0, _log.default)('calling', _this.props.onStart);
5476
5477 var shouldUpdate = _this.props.onStart(e, coreEvent);
5478
5479 if (shouldUpdate === false || _this.mounted === false) return; // Add a style to the body to disable user-select. This prevents text from
5480 // being selected all over the page.
5481
5482 if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument); // Initiate dragging. Set the current x and y as offsets
5483 // so we know how much we've moved during the drag. This allows us
5484 // to drag elements around even if they have been moved, without issue.
5485
5486 _this.setState({
5487 dragging: true,
5488 lastX: x,
5489 lastY: y
5490 }); // Add events to the document directly so we catch when the user's mouse/touch moves outside of
5491 // this element. We use different events depending on whether or not we have detected that this
5492 // is a touch-capable device.
5493
5494
5495 (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);
5496 (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);
5497 });
5498
5499 _defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) {
5500 // Get the current drag point from the event. This is used as the offset.
5501 var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
5502 if (position == null) return;
5503 var x = position.x,
5504 y = position.y; // Snap to grid if prop has been provided
5505
5506 if (Array.isArray(_this.props.grid)) {
5507 var deltaX = x - _this.state.lastX,
5508 deltaY = y - _this.state.lastY;
5509
5510 var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
5511
5512 var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);
5513
5514 deltaX = _snapToGrid2[0];
5515 deltaY = _snapToGrid2[1];
5516 if (!deltaX && !deltaY) return; // skip useless drag
5517
5518 x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
5519 }
5520
5521 var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
5522 (0, _log.default)('DraggableCore: handleDrag: %j', coreEvent); // Call event handler. If it returns explicit false, trigger end.
5523
5524 var shouldUpdate = _this.props.onDrag(e, coreEvent);
5525
5526 if (shouldUpdate === false || _this.mounted === false) {
5527 try {
5528 // $FlowIgnore
5529 _this.handleDragStop(new MouseEvent('mouseup'));
5530 } catch (err) {
5531 // Old browsers
5532 var event = ((document.createEvent('MouseEvents')
5533 /*: any*/
5534 )
5535 /*: MouseTouchEvent*/
5536 ); // I see why this insanity was deprecated
5537 // $FlowIgnore
5538
5539 event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
5540
5541 _this.handleDragStop(event);
5542 }
5543
5544 return;
5545 }
5546
5547 _this.setState({
5548 lastX: x,
5549 lastY: y
5550 });
5551 });
5552
5553 _defineProperty(_assertThisInitialized(_this), "handleDragStop", function (e) {
5554 if (!_this.state.dragging) return;
5555 var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
5556 if (position == null) return;
5557 var x = position.x,
5558 y = position.y; // Snap to grid if prop has been provided
5559
5560 if (Array.isArray(_this.props.grid)) {
5561 var deltaX = x - _this.state.lastX || 0;
5562 var deltaY = y - _this.state.lastY || 0;
5563
5564 var _snapToGrid3 = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
5565
5566 var _snapToGrid4 = _slicedToArray(_snapToGrid3, 2);
5567
5568 deltaX = _snapToGrid4[0];
5569 deltaY = _snapToGrid4[1];
5570 x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
5571 }
5572
5573 var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); // Call event handler
5574
5575 var shouldContinue = _this.props.onStop(e, coreEvent);
5576
5577 if (shouldContinue === false || _this.mounted === false) return false;
5578
5579 var thisNode = _this.findDOMNode();
5580
5581 if (thisNode) {
5582 // Remove user-select hack
5583 if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
5584 }
5585
5586 (0, _log.default)('DraggableCore: handleDragStop: %j', coreEvent); // Reset the el.
5587
5588 _this.setState({
5589 dragging: false,
5590 lastX: NaN,
5591 lastY: NaN
5592 });
5593
5594 if (thisNode) {
5595 // Remove event handlers
5596 (0, _log.default)('DraggableCore: Removing handlers');
5597 (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);
5598 (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);
5599 }
5600 });
5601
5602 _defineProperty(_assertThisInitialized(_this), "onMouseDown", function (e) {
5603 dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse
5604
5605 return _this.handleDragStart(e);
5606 });
5607
5608 _defineProperty(_assertThisInitialized(_this), "onMouseUp", function (e) {
5609 dragEventFor = eventsFor.mouse;
5610 return _this.handleDragStop(e);
5611 });
5612
5613 _defineProperty(_assertThisInitialized(_this), "onTouchStart", function (e) {
5614 // We're on a touch device now, so change the event handlers
5615 dragEventFor = eventsFor.touch;
5616 return _this.handleDragStart(e);
5617 });
5618
5619 _defineProperty(_assertThisInitialized(_this), "onTouchEnd", function (e) {
5620 // We're on a touch device now, so change the event handlers
5621 dragEventFor = eventsFor.touch;
5622 return _this.handleDragStop(e);
5623 });
5624
5625 return _this;
5626 }
5627
5628 _createClass(DraggableCore, [{
5629 key: "componentDidMount",
5630 value: function componentDidMount() {
5631 this.mounted = true; // Touch handlers must be added with {passive: false} to be cancelable.
5632 // https://developers.google.com/web/updates/2017/01/scrolling-intervention
5633
5634 var thisNode = this.findDOMNode();
5635
5636 if (thisNode) {
5637 (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
5638 passive: false
5639 });
5640 }
5641 }
5642 }, {
5643 key: "componentWillUnmount",
5644 value: function componentWillUnmount() {
5645 this.mounted = false; // Remove any leftover event handlers. Remove both touch and mouse handlers in case
5646 // some browser quirk caused a touch event to fire during a mouse move, or vice versa.
5647
5648 var thisNode = this.findDOMNode();
5649
5650 if (thisNode) {
5651 var ownerDocument = thisNode.ownerDocument;
5652 (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
5653 (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
5654 (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
5655 (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
5656 (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
5657 passive: false
5658 });
5659 if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);
5660 }
5661 } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
5662 // the underlying DOM node ourselves. See the README for more information.
5663
5664 }, {
5665 key: "findDOMNode",
5666 value: function findDOMNode()
5667 /*: ?HTMLElement*/
5668 {
5669 var _this$props, _this$props2, _this$props2$nodeRef;
5670
5671 return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$nodeRef = _this$props2.nodeRef) === null || _this$props2$nodeRef === void 0 ? void 0 : _this$props2$nodeRef.current : _reactDom.default.findDOMNode(this);
5672 }
5673 }, {
5674 key: "render",
5675 value: function render()
5676 /*: React.Element<any>*/
5677 {
5678 // Reuse the child provided
5679 // This makes it flexible to use whatever element is wanted (div, ul, etc)
5680 return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), {
5681 // Note: mouseMove handler is attached to document so it will still function
5682 // when the user drags quickly and leaves the bounds of the element.
5683 onMouseDown: this.onMouseDown,
5684 onMouseUp: this.onMouseUp,
5685 // onTouchStart is added on `componentDidMount` so they can be added with
5686 // {passive: false}, which allows it to cancel. See
5687 // https://developers.google.com/web/updates/2017/01/scrolling-intervention
5688 onTouchEnd: this.onTouchEnd
5689 });
5690 }
5691 }]);
5692
5693 return DraggableCore;
5694 }(React.Component);
5695
5696 exports["default"] = DraggableCore;
5697
5698 _defineProperty(DraggableCore, "displayName", 'DraggableCore');
5699
5700 _defineProperty(DraggableCore, "propTypes", {
5701 /**
5702 * `allowAnyClick` allows dragging using any mouse button.
5703 * By default, we only accept the left button.
5704 *
5705 * Defaults to `false`.
5706 */
5707 allowAnyClick: _propTypes.default.bool,
5708
5709 /**
5710 * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
5711 * with the exception of `onMouseDown`, will not fire.
5712 */
5713 disabled: _propTypes.default.bool,
5714
5715 /**
5716 * By default, we add 'user-select:none' attributes to the document body
5717 * to prevent ugly text selection during drag. If this is causing problems
5718 * for your app, set this to `false`.
5719 */
5720 enableUserSelectHack: _propTypes.default.bool,
5721
5722 /**
5723 * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
5724 * instead of using the parent node.
5725 */
5726 offsetParent: function offsetParent(props
5727 /*: DraggableCoreProps*/
5728 , propName
5729 /*: $Keys<DraggableCoreProps>*/
5730 ) {
5731 if (props[propName] && props[propName].nodeType !== 1) {
5732 throw new Error('Draggable\'s offsetParent must be a DOM Node.');
5733 }
5734 },
5735
5736 /**
5737 * `grid` specifies the x and y that dragging should snap to.
5738 */
5739 grid: _propTypes.default.arrayOf(_propTypes.default.number),
5740
5741 /**
5742 * `handle` specifies a selector to be used as the handle that initiates drag.
5743 *
5744 * Example:
5745 *
5746 * ```jsx
5747 * let App = React.createClass({
5748 * render: function () {
5749 * return (
5750 * <Draggable handle=".handle">
5751 * <div>
5752 * <div className="handle">Click me to drag</div>
5753 * <div>This is some other content</div>
5754 * </div>
5755 * </Draggable>
5756 * );
5757 * }
5758 * });
5759 * ```
5760 */
5761 handle: _propTypes.default.string,
5762
5763 /**
5764 * `cancel` specifies a selector to be used to prevent drag initialization.
5765 *
5766 * Example:
5767 *
5768 * ```jsx
5769 * let App = React.createClass({
5770 * render: function () {
5771 * return(
5772 * <Draggable cancel=".cancel">
5773 * <div>
5774 * <div className="cancel">You can't drag from here</div>
5775 * <div>Dragging here works fine</div>
5776 * </div>
5777 * </Draggable>
5778 * );
5779 * }
5780 * });
5781 * ```
5782 */
5783 cancel: _propTypes.default.string,
5784
5785 /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
5786 * Unfortunately, in order for <Draggable> to work properly, we need raw access
5787 * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
5788 * as in this example:
5789 *
5790 * function MyComponent() {
5791 * const nodeRef = React.useRef(null);
5792 * return (
5793 * <Draggable nodeRef={nodeRef}>
5794 * <div ref={nodeRef}>Example Target</div>
5795 * </Draggable>
5796 * );
5797 * }
5798 *
5799 * This can be used for arbitrarily nested components, so long as the ref ends up
5800 * pointing to the actual child DOM node and not a custom component.
5801 */
5802 nodeRef: _propTypes.default.object,
5803
5804 /**
5805 * Called when dragging starts.
5806 * If this function returns the boolean false, dragging will be canceled.
5807 */
5808 onStart: _propTypes.default.func,
5809
5810 /**
5811 * Called while dragging.
5812 * If this function returns the boolean false, dragging will be canceled.
5813 */
5814 onDrag: _propTypes.default.func,
5815
5816 /**
5817 * Called when dragging stops.
5818 * If this function returns the boolean false, the drag will remain active.
5819 */
5820 onStop: _propTypes.default.func,
5821
5822 /**
5823 * A workaround option which can be passed if onMouseDown needs to be accessed,
5824 * since it'll always be blocked (as there is internal use of onMouseDown)
5825 */
5826 onMouseDown: _propTypes.default.func,
5827
5828 /**
5829 * `scale`, if set, applies scaling while dragging an element
5830 */
5831 scale: _propTypes.default.number,
5832
5833 /**
5834 * These properties should be defined on the child, not here.
5835 */
5836 className: _shims.dontSetMe,
5837 style: _shims.dontSetMe,
5838 transform: _shims.dontSetMe
5839 });
5840
5841 _defineProperty(DraggableCore, "defaultProps", {
5842 allowAnyClick: false,
5843 // by default only accept left click
5844 disabled: false,
5845 enableUserSelectHack: true,
5846 onStart: function onStart() {},
5847 onDrag: function onDrag() {},
5848 onStop: function onStop() {},
5849 onMouseDown: function onMouseDown() {},
5850 scale: 1
5851 });
5852
5853 /***/ }),
5854
5855 /***/ "../node_modules/react-draggable/build/cjs/cjs.js":
5856 /*!********************************************************!*\
5857 !*** ../node_modules/react-draggable/build/cjs/cjs.js ***!
5858 \********************************************************/
5859 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5860
5861 "use strict";
5862
5863
5864 var _require = __webpack_require__(/*! ./Draggable */ "../node_modules/react-draggable/build/cjs/Draggable.js"),
5865 Draggable = _require.default,
5866 DraggableCore = _require.DraggableCore; // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
5867 // See https://github.com/mzabriskie/react-draggable/pull/254
5868 // and https://github.com/mzabriskie/react-draggable/issues/266
5869
5870
5871 module.exports = Draggable;
5872 module.exports["default"] = Draggable;
5873 module.exports.DraggableCore = DraggableCore;
5874
5875 /***/ }),
5876
5877 /***/ "../node_modules/react-draggable/build/cjs/utils/domFns.js":
5878 /*!*****************************************************************!*\
5879 !*** ../node_modules/react-draggable/build/cjs/utils/domFns.js ***!
5880 \*****************************************************************/
5881 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5882
5883 "use strict";
5884
5885
5886 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5887
5888 Object.defineProperty(exports, "__esModule", ({
5889 value: true
5890 }));
5891 exports.addClassName = addClassName;
5892 exports.addEvent = addEvent;
5893 exports.addUserSelectStyles = addUserSelectStyles;
5894 exports.createCSSTransform = createCSSTransform;
5895 exports.createSVGTransform = createSVGTransform;
5896 exports.getTouch = getTouch;
5897 exports.getTouchIdentifier = getTouchIdentifier;
5898 exports.getTranslation = getTranslation;
5899 exports.innerHeight = innerHeight;
5900 exports.innerWidth = innerWidth;
5901 exports.matchesSelector = matchesSelector;
5902 exports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
5903 exports.offsetXYFromParent = offsetXYFromParent;
5904 exports.outerHeight = outerHeight;
5905 exports.outerWidth = outerWidth;
5906 exports.removeClassName = removeClassName;
5907 exports.removeEvent = removeEvent;
5908 exports.removeUserSelectStyles = removeUserSelectStyles;
5909
5910 var _shims = __webpack_require__(/*! ./shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js");
5911
5912 var _getPrefix = _interopRequireWildcard(__webpack_require__(/*! ./getPrefix */ "../node_modules/react-draggable/build/cjs/utils/getPrefix.js"));
5913
5914 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
5915
5916 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
5917
5918 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5919
5920 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5921
5922 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5923
5924 var matchesSelectorFunc = '';
5925
5926 function matchesSelector(el
5927 /*: Node*/
5928 , selector
5929 /*: string*/
5930 )
5931 /*: boolean*/
5932 {
5933 if (!matchesSelectorFunc) {
5934 matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {
5935 // $FlowIgnore: Doesn't think elements are indexable
5936 return (0, _shims.isFunction)(el[method]);
5937 });
5938 } // Might not be found entirely (not an Element?) - in that case, bail
5939 // $FlowIgnore: Doesn't think elements are indexable
5940
5941
5942 if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; // $FlowIgnore: Doesn't think elements are indexable
5943
5944 return el[matchesSelectorFunc](selector);
5945 } // Works up the tree to the draggable itself attempting to match selector.
5946
5947
5948 function matchesSelectorAndParentsTo(el
5949 /*: Node*/
5950 , selector
5951 /*: string*/
5952 , baseNode
5953 /*: Node*/
5954 )
5955 /*: boolean*/
5956 {
5957 var node = el;
5958
5959 do {
5960 if (matchesSelector(node, selector)) return true;
5961 if (node === baseNode) return false;
5962 node = node.parentNode;
5963 } while (node);
5964
5965 return false;
5966 }
5967
5968 function addEvent(el
5969 /*: ?Node*/
5970 , event
5971 /*: string*/
5972 , handler
5973 /*: Function*/
5974 , inputOptions
5975 /*: Object*/
5976 )
5977 /*: void*/
5978 {
5979 if (!el) return;
5980
5981 var options = _objectSpread({
5982 capture: true
5983 }, inputOptions); // $FlowIgnore[method-unbinding]
5984
5985
5986 if (el.addEventListener) {
5987 el.addEventListener(event, handler, options);
5988 } else if (el.attachEvent) {
5989 el.attachEvent('on' + event, handler);
5990 } else {
5991 // $FlowIgnore: Doesn't think elements are indexable
5992 el['on' + event] = handler;
5993 }
5994 }
5995
5996 function removeEvent(el
5997 /*: ?Node*/
5998 , event
5999 /*: string*/
6000 , handler
6001 /*: Function*/
6002 , inputOptions
6003 /*: Object*/
6004 )
6005 /*: void*/
6006 {
6007 if (!el) return;
6008
6009 var options = _objectSpread({
6010 capture: true
6011 }, inputOptions); // $FlowIgnore[method-unbinding]
6012
6013
6014 if (el.removeEventListener) {
6015 el.removeEventListener(event, handler, options);
6016 } else if (el.detachEvent) {
6017 el.detachEvent('on' + event, handler);
6018 } else {
6019 // $FlowIgnore: Doesn't think elements are indexable
6020 el['on' + event] = null;
6021 }
6022 }
6023
6024 function outerHeight(node
6025 /*: HTMLElement*/
6026 )
6027 /*: number*/
6028 {
6029 // This is deliberately excluding margin for our calculations, since we are using
6030 // offsetTop which is including margin. See getBoundPosition
6031 var height = node.clientHeight;
6032 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
6033 height += (0, _shims.int)(computedStyle.borderTopWidth);
6034 height += (0, _shims.int)(computedStyle.borderBottomWidth);
6035 return height;
6036 }
6037
6038 function outerWidth(node
6039 /*: HTMLElement*/
6040 )
6041 /*: number*/
6042 {
6043 // This is deliberately excluding margin for our calculations, since we are using
6044 // offsetLeft which is including margin. See getBoundPosition
6045 var width = node.clientWidth;
6046 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
6047 width += (0, _shims.int)(computedStyle.borderLeftWidth);
6048 width += (0, _shims.int)(computedStyle.borderRightWidth);
6049 return width;
6050 }
6051
6052 function innerHeight(node
6053 /*: HTMLElement*/
6054 )
6055 /*: number*/
6056 {
6057 var height = node.clientHeight;
6058 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
6059 height -= (0, _shims.int)(computedStyle.paddingTop);
6060 height -= (0, _shims.int)(computedStyle.paddingBottom);
6061 return height;
6062 }
6063
6064 function innerWidth(node
6065 /*: HTMLElement*/
6066 )
6067 /*: number*/
6068 {
6069 var width = node.clientWidth;
6070 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
6071 width -= (0, _shims.int)(computedStyle.paddingLeft);
6072 width -= (0, _shims.int)(computedStyle.paddingRight);
6073 return width;
6074 }
6075 /*:: interface EventWithOffset {
6076 clientX: number, clientY: number
6077 }*/
6078
6079
6080 // Get from offsetParent
6081 function offsetXYFromParent(evt
6082 /*: EventWithOffset*/
6083 , offsetParent
6084 /*: HTMLElement*/
6085 , scale
6086 /*: number*/
6087 )
6088 /*: ControlPosition*/
6089 {
6090 var isBody = offsetParent === offsetParent.ownerDocument.body;
6091 var offsetParentRect = isBody ? {
6092 left: 0,
6093 top: 0
6094 } : offsetParent.getBoundingClientRect();
6095 var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
6096 var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
6097 return {
6098 x: x,
6099 y: y
6100 };
6101 }
6102
6103 function createCSSTransform(controlPos
6104 /*: ControlPosition*/
6105 , positionOffset
6106 /*: PositionOffsetControlPosition*/
6107 )
6108 /*: Object*/
6109 {
6110 var translation = getTranslation(controlPos, positionOffset, 'px');
6111 return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation);
6112 }
6113
6114 function createSVGTransform(controlPos
6115 /*: ControlPosition*/
6116 , positionOffset
6117 /*: PositionOffsetControlPosition*/
6118 )
6119 /*: string*/
6120 {
6121 var translation = getTranslation(controlPos, positionOffset, '');
6122 return translation;
6123 }
6124
6125 function getTranslation(_ref2, positionOffset
6126 /*: PositionOffsetControlPosition*/
6127 , unitSuffix
6128 /*: string*/
6129 )
6130 /*: string*/
6131 {
6132 var x = _ref2.x,
6133 y = _ref2.y;
6134 var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
6135
6136 if (positionOffset) {
6137 var defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix);
6138 var defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix);
6139 translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
6140 }
6141
6142 return translation;
6143 }
6144
6145 function getTouch(e
6146 /*: MouseTouchEvent*/
6147 , identifier
6148 /*: number*/
6149 )
6150 /*: ?{clientX: number, clientY: number}*/
6151 {
6152 return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {
6153 return identifier === t.identifier;
6154 }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {
6155 return identifier === t.identifier;
6156 });
6157 }
6158
6159 function getTouchIdentifier(e
6160 /*: MouseTouchEvent*/
6161 )
6162 /*: ?number*/
6163 {
6164 if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
6165 if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
6166 } // User-select Hacks:
6167 //
6168 // Useful for preventing blue highlights all over everything when dragging.
6169 // Note we're passing `document` b/c we could be iframed
6170
6171
6172 function addUserSelectStyles(doc
6173 /*: ?Document*/
6174 ) {
6175 if (!doc) return;
6176 var styleEl = doc.getElementById('react-draggable-style-el');
6177
6178 if (!styleEl) {
6179 styleEl = doc.createElement('style');
6180 styleEl.type = 'text/css';
6181 styleEl.id = 'react-draggable-style-el';
6182 styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n';
6183 styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {all: inherit;}\n';
6184 doc.getElementsByTagName('head')[0].appendChild(styleEl);
6185 }
6186
6187 if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');
6188 }
6189
6190 function removeUserSelectStyles(doc
6191 /*: ?Document*/
6192 ) {
6193 if (!doc) return;
6194
6195 try {
6196 if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection'); // $FlowIgnore: IE
6197
6198 if (doc.selection) {
6199 // $FlowIgnore: IE
6200 doc.selection.empty();
6201 } else {
6202 // Remove selection caused by scroll, unless it's a focused input
6203 // (we use doc.defaultView in case we're in an iframe)
6204 var selection = (doc.defaultView || window).getSelection();
6205
6206 if (selection && selection.type !== 'Caret') {
6207 selection.removeAllRanges();
6208 }
6209 }
6210 } catch (e) {// probably IE
6211 }
6212 }
6213
6214 function addClassName(el
6215 /*: HTMLElement*/
6216 , className
6217 /*: string*/
6218 ) {
6219 if (el.classList) {
6220 el.classList.add(className);
6221 } else {
6222 if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
6223 el.className += " ".concat(className);
6224 }
6225 }
6226 }
6227
6228 function removeClassName(el
6229 /*: HTMLElement*/
6230 , className
6231 /*: string*/
6232 ) {
6233 if (el.classList) {
6234 el.classList.remove(className);
6235 } else {
6236 el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), 'g'), '');
6237 }
6238 }
6239
6240 /***/ }),
6241
6242 /***/ "../node_modules/react-draggable/build/cjs/utils/getPrefix.js":
6243 /*!********************************************************************!*\
6244 !*** ../node_modules/react-draggable/build/cjs/utils/getPrefix.js ***!
6245 \********************************************************************/
6246 /***/ ((__unused_webpack_module, exports) => {
6247
6248 "use strict";
6249
6250
6251 Object.defineProperty(exports, "__esModule", ({
6252 value: true
6253 }));
6254 exports.browserPrefixToKey = browserPrefixToKey;
6255 exports.browserPrefixToStyle = browserPrefixToStyle;
6256 exports["default"] = void 0;
6257 exports.getPrefix = getPrefix;
6258 var prefixes = ['Moz', 'Webkit', 'O', 'ms'];
6259
6260 function getPrefix()
6261 /*: string*/
6262 {
6263 var _window$document, _window$document$docu;
6264
6265 var prop
6266 /*: string*/
6267 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
6268 // Ensure we're running in an environment where there is actually a global
6269 // `window` obj
6270 if (typeof window === 'undefined') return ''; // If we're in a pseudo-browser server-side environment, this access
6271 // path may not exist, so bail out if it doesn't.
6272
6273 var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style;
6274 if (!style) return '';
6275 if (prop in style) return '';
6276
6277 for (var i = 0; i < prefixes.length; i++) {
6278 if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];
6279 }
6280
6281 return '';
6282 }
6283
6284 function browserPrefixToKey(prop
6285 /*: string*/
6286 , prefix
6287 /*: string*/
6288 )
6289 /*: string*/
6290 {
6291 return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
6292 }
6293
6294 function browserPrefixToStyle(prop
6295 /*: string*/
6296 , prefix
6297 /*: string*/
6298 )
6299 /*: string*/
6300 {
6301 return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
6302 }
6303
6304 function kebabToTitleCase(str
6305 /*: string*/
6306 )
6307 /*: string*/
6308 {
6309 var out = '';
6310 var shouldCapitalize = true;
6311
6312 for (var i = 0; i < str.length; i++) {
6313 if (shouldCapitalize) {
6314 out += str[i].toUpperCase();
6315 shouldCapitalize = false;
6316 } else if (str[i] === '-') {
6317 shouldCapitalize = true;
6318 } else {
6319 out += str[i];
6320 }
6321 }
6322
6323 return out;
6324 } // Default export is the prefix itself, like 'Moz', 'Webkit', etc
6325 // Note that you may have to re-test for certain things; for instance, Chrome 50
6326 // can handle unprefixed `transform`, but not unprefixed `user-select`
6327
6328
6329 var _default = (getPrefix()
6330 /*: string*/
6331 );
6332
6333 exports["default"] = _default;
6334
6335 /***/ }),
6336
6337 /***/ "../node_modules/react-draggable/build/cjs/utils/log.js":
6338 /*!**************************************************************!*\
6339 !*** ../node_modules/react-draggable/build/cjs/utils/log.js ***!
6340 \**************************************************************/
6341 /***/ ((__unused_webpack_module, exports) => {
6342
6343 "use strict";
6344
6345
6346 Object.defineProperty(exports, "__esModule", ({
6347 value: true
6348 }));
6349 exports["default"] = log;
6350
6351 /*eslint no-console:0*/
6352 function log() {
6353 var _console;
6354
6355 if (false) {}
6356 }
6357
6358 /***/ }),
6359
6360 /***/ "../node_modules/react-draggable/build/cjs/utils/positionFns.js":
6361 /*!**********************************************************************!*\
6362 !*** ../node_modules/react-draggable/build/cjs/utils/positionFns.js ***!
6363 \**********************************************************************/
6364 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6365
6366 "use strict";
6367
6368
6369 Object.defineProperty(exports, "__esModule", ({
6370 value: true
6371 }));
6372 exports.canDragX = canDragX;
6373 exports.canDragY = canDragY;
6374 exports.createCoreData = createCoreData;
6375 exports.createDraggableData = createDraggableData;
6376 exports.getBoundPosition = getBoundPosition;
6377 exports.getControlPosition = getControlPosition;
6378 exports.snapToGrid = snapToGrid;
6379
6380 var _shims = __webpack_require__(/*! ./shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js");
6381
6382 var _domFns = __webpack_require__(/*! ./domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js");
6383
6384 function getBoundPosition(draggable
6385 /*: Draggable*/
6386 , x
6387 /*: number*/
6388 , y
6389 /*: number*/
6390 )
6391 /*: [number, number]*/
6392 {
6393 // If no bounds, short-circuit and move on
6394 if (!draggable.props.bounds) return [x, y]; // Clone new bounds
6395
6396 var bounds = draggable.props.bounds;
6397 bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);
6398 var node = findDOMNode(draggable);
6399
6400 if (typeof bounds === 'string') {
6401 var ownerDocument = node.ownerDocument;
6402 var ownerWindow = ownerDocument.defaultView;
6403 var boundNode;
6404
6405 if (bounds === 'parent') {
6406 boundNode = node.parentNode;
6407 } else {
6408 boundNode = ownerDocument.querySelector(bounds);
6409 }
6410
6411 if (!(boundNode instanceof ownerWindow.HTMLElement)) {
6412 throw new Error('Bounds selector "' + bounds + '" could not find an element.');
6413 }
6414
6415 var boundNodeEl
6416 /*: HTMLElement*/
6417 = boundNode; // for Flow, can't seem to refine correctly
6418
6419 var nodeStyle = ownerWindow.getComputedStyle(node);
6420 var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl); // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.
6421
6422 bounds = {
6423 left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
6424 top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
6425 right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
6426 bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
6427 };
6428 } // Keep x and y below right and bottom limits...
6429
6430
6431 if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);
6432 if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom); // But above left and top limits.
6433
6434 if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);
6435 if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);
6436 return [x, y];
6437 }
6438
6439 function snapToGrid(grid
6440 /*: [number, number]*/
6441 , pendingX
6442 /*: number*/
6443 , pendingY
6444 /*: number*/
6445 )
6446 /*: [number, number]*/
6447 {
6448 var x = Math.round(pendingX / grid[0]) * grid[0];
6449 var y = Math.round(pendingY / grid[1]) * grid[1];
6450 return [x, y];
6451 }
6452
6453 function canDragX(draggable
6454 /*: Draggable*/
6455 )
6456 /*: boolean*/
6457 {
6458 return draggable.props.axis === 'both' || draggable.props.axis === 'x';
6459 }
6460
6461 function canDragY(draggable
6462 /*: Draggable*/
6463 )
6464 /*: boolean*/
6465 {
6466 return draggable.props.axis === 'both' || draggable.props.axis === 'y';
6467 } // Get {x, y} positions from event.
6468
6469
6470 function getControlPosition(e
6471 /*: MouseTouchEvent*/
6472 , touchIdentifier
6473 /*: ?number*/
6474 , draggableCore
6475 /*: DraggableCore*/
6476 )
6477 /*: ?ControlPosition*/
6478 {
6479 var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
6480 if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch
6481
6482 var node = findDOMNode(draggableCore); // User can provide an offsetParent if desired.
6483
6484 var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
6485 return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale);
6486 } // Create an data object exposed by <DraggableCore>'s events
6487
6488
6489 function createCoreData(draggable
6490 /*: DraggableCore*/
6491 , x
6492 /*: number*/
6493 , y
6494 /*: number*/
6495 )
6496 /*: DraggableData*/
6497 {
6498 var state = draggable.state;
6499 var isStart = !(0, _shims.isNum)(state.lastX);
6500 var node = findDOMNode(draggable);
6501
6502 if (isStart) {
6503 // If this is our first move, use the x and y as last coords.
6504 return {
6505 node: node,
6506 deltaX: 0,
6507 deltaY: 0,
6508 lastX: x,
6509 lastY: y,
6510 x: x,
6511 y: y
6512 };
6513 } else {
6514 // Otherwise calculate proper values.
6515 return {
6516 node: node,
6517 deltaX: x - state.lastX,
6518 deltaY: y - state.lastY,
6519 lastX: state.lastX,
6520 lastY: state.lastY,
6521 x: x,
6522 y: y
6523 };
6524 }
6525 } // Create an data exposed by <Draggable>'s events
6526
6527
6528 function createDraggableData(draggable
6529 /*: Draggable*/
6530 , coreData
6531 /*: DraggableData*/
6532 )
6533 /*: DraggableData*/
6534 {
6535 var scale = draggable.props.scale;
6536 return {
6537 node: coreData.node,
6538 x: draggable.state.x + coreData.deltaX / scale,
6539 y: draggable.state.y + coreData.deltaY / scale,
6540 deltaX: coreData.deltaX / scale,
6541 deltaY: coreData.deltaY / scale,
6542 lastX: draggable.state.x,
6543 lastY: draggable.state.y
6544 };
6545 } // A lot faster than stringify/parse
6546
6547
6548 function cloneBounds(bounds
6549 /*: Bounds*/
6550 )
6551 /*: Bounds*/
6552 {
6553 return {
6554 left: bounds.left,
6555 top: bounds.top,
6556 right: bounds.right,
6557 bottom: bounds.bottom
6558 };
6559 }
6560
6561 function findDOMNode(draggable
6562 /*: Draggable | DraggableCore*/
6563 )
6564 /*: HTMLElement*/
6565 {
6566 var node = draggable.findDOMNode();
6567
6568 if (!node) {
6569 throw new Error('<DraggableCore>: Unmounted during event!');
6570 } // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME
6571
6572
6573 return node;
6574 }
6575
6576 /***/ }),
6577
6578 /***/ "../node_modules/react-draggable/build/cjs/utils/shims.js":
6579 /*!****************************************************************!*\
6580 !*** ../node_modules/react-draggable/build/cjs/utils/shims.js ***!
6581 \****************************************************************/
6582 /***/ ((__unused_webpack_module, exports) => {
6583
6584 "use strict";
6585
6586
6587 Object.defineProperty(exports, "__esModule", ({
6588 value: true
6589 }));
6590 exports.dontSetMe = dontSetMe;
6591 exports.findInArray = findInArray;
6592 exports.int = int;
6593 exports.isFunction = isFunction;
6594 exports.isNum = isNum;
6595
6596 // @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
6597 function findInArray(array
6598 /*: Array<any> | TouchList*/
6599 , callback
6600 /*: Function*/
6601 )
6602 /*: any*/
6603 {
6604 for (var i = 0, length = array.length; i < length; i++) {
6605 if (callback.apply(callback, [array[i], i, array])) return array[i];
6606 }
6607 }
6608
6609 function isFunction(func
6610 /*: any*/
6611 )
6612 /*: boolean %checks*/
6613 {
6614 // $FlowIgnore[method-unbinding]
6615 return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';
6616 }
6617
6618 function isNum(num
6619 /*: any*/
6620 )
6621 /*: boolean %checks*/
6622 {
6623 return typeof num === 'number' && !isNaN(num);
6624 }
6625
6626 function int(a
6627 /*: string*/
6628 )
6629 /*: number*/
6630 {
6631 return parseInt(a, 10);
6632 }
6633
6634 function dontSetMe(props
6635 /*: Object*/
6636 , propName
6637 /*: string*/
6638 , componentName
6639 /*: string*/
6640 )
6641 /*: ?Error*/
6642 {
6643 if (props[propName]) {
6644 return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child."));
6645 }
6646 }
6647
6648 /***/ }),
6649
6650 /***/ "../node_modules/react-is/cjs/react-is.development.js":
6651 /*!************************************************************!*\
6652 !*** ../node_modules/react-is/cjs/react-is.development.js ***!
6653 \************************************************************/
6654 /***/ ((__unused_webpack_module, exports) => {
6655
6656 "use strict";
6657 /**
6658 * @license React
6659 * react-is.development.js
6660 *
6661 * Copyright (c) Facebook, Inc. and its affiliates.
6662 *
6663 * This source code is licensed under the MIT license found in the
6664 * LICENSE file in the root directory of this source tree.
6665 */
6666
6667
6668
6669 if (true) {
6670 (function() {
6671 'use strict';
6672
6673 // ATTENTION
6674 // When adding new symbols to this file,
6675 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
6676 // The Symbol used to tag the ReactElement-like types.
6677 var REACT_ELEMENT_TYPE = Symbol.for('react.element');
6678 var REACT_PORTAL_TYPE = Symbol.for('react.portal');
6679 var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
6680 var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
6681 var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
6682 var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
6683 var REACT_CONTEXT_TYPE = Symbol.for('react.context');
6684 var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
6685 var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
6686 var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
6687 var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
6688 var REACT_MEMO_TYPE = Symbol.for('react.memo');
6689 var REACT_LAZY_TYPE = Symbol.for('react.lazy');
6690 var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
6691
6692 // -----------------------------------------------------------------------------
6693
6694 var enableScopeAPI = false; // Experimental Create Event Handle API.
6695 var enableCacheElement = false;
6696 var enableTransitionTracing = false; // No known bugs, but needs performance testing
6697
6698 var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
6699 // stuff. Intended to enable React core members to more easily debug scheduling
6700 // issues in DEV builds.
6701
6702 var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
6703
6704 var REACT_MODULE_REFERENCE;
6705
6706 {
6707 REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
6708 }
6709
6710 function isValidElementType(type) {
6711 if (typeof type === 'string' || typeof type === 'function') {
6712 return true;
6713 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
6714
6715
6716 if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
6717 return true;
6718 }
6719
6720 if (typeof type === 'object' && type !== null) {
6721 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
6722 // types supported by any Flight configuration anywhere since
6723 // we don't know which Flight build this will end up being used
6724 // with.
6725 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
6726 return true;
6727 }
6728 }
6729
6730 return false;
6731 }
6732
6733 function typeOf(object) {
6734 if (typeof object === 'object' && object !== null) {
6735 var $$typeof = object.$$typeof;
6736
6737 switch ($$typeof) {
6738 case REACT_ELEMENT_TYPE:
6739 var type = object.type;
6740
6741 switch (type) {
6742 case REACT_FRAGMENT_TYPE:
6743 case REACT_PROFILER_TYPE:
6744 case REACT_STRICT_MODE_TYPE:
6745 case REACT_SUSPENSE_TYPE:
6746 case REACT_SUSPENSE_LIST_TYPE:
6747 return type;
6748
6749 default:
6750 var $$typeofType = type && type.$$typeof;
6751
6752 switch ($$typeofType) {
6753 case REACT_SERVER_CONTEXT_TYPE:
6754 case REACT_CONTEXT_TYPE:
6755 case REACT_FORWARD_REF_TYPE:
6756 case REACT_LAZY_TYPE:
6757 case REACT_MEMO_TYPE:
6758 case REACT_PROVIDER_TYPE:
6759 return $$typeofType;
6760
6761 default:
6762 return $$typeof;
6763 }
6764
6765 }
6766
6767 case REACT_PORTAL_TYPE:
6768 return $$typeof;
6769 }
6770 }
6771
6772 return undefined;
6773 }
6774 var ContextConsumer = REACT_CONTEXT_TYPE;
6775 var ContextProvider = REACT_PROVIDER_TYPE;
6776 var Element = REACT_ELEMENT_TYPE;
6777 var ForwardRef = REACT_FORWARD_REF_TYPE;
6778 var Fragment = REACT_FRAGMENT_TYPE;
6779 var Lazy = REACT_LAZY_TYPE;
6780 var Memo = REACT_MEMO_TYPE;
6781 var Portal = REACT_PORTAL_TYPE;
6782 var Profiler = REACT_PROFILER_TYPE;
6783 var StrictMode = REACT_STRICT_MODE_TYPE;
6784 var Suspense = REACT_SUSPENSE_TYPE;
6785 var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
6786 var hasWarnedAboutDeprecatedIsAsyncMode = false;
6787 var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
6788
6789 function isAsyncMode(object) {
6790 {
6791 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
6792 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
6793
6794 console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
6795 }
6796 }
6797
6798 return false;
6799 }
6800 function isConcurrentMode(object) {
6801 {
6802 if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
6803 hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
6804
6805 console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
6806 }
6807 }
6808
6809 return false;
6810 }
6811 function isContextConsumer(object) {
6812 return typeOf(object) === REACT_CONTEXT_TYPE;
6813 }
6814 function isContextProvider(object) {
6815 return typeOf(object) === REACT_PROVIDER_TYPE;
6816 }
6817 function isElement(object) {
6818 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
6819 }
6820 function isForwardRef(object) {
6821 return typeOf(object) === REACT_FORWARD_REF_TYPE;
6822 }
6823 function isFragment(object) {
6824 return typeOf(object) === REACT_FRAGMENT_TYPE;
6825 }
6826 function isLazy(object) {
6827 return typeOf(object) === REACT_LAZY_TYPE;
6828 }
6829 function isMemo(object) {
6830 return typeOf(object) === REACT_MEMO_TYPE;
6831 }
6832 function isPortal(object) {
6833 return typeOf(object) === REACT_PORTAL_TYPE;
6834 }
6835 function isProfiler(object) {
6836 return typeOf(object) === REACT_PROFILER_TYPE;
6837 }
6838 function isStrictMode(object) {
6839 return typeOf(object) === REACT_STRICT_MODE_TYPE;
6840 }
6841 function isSuspense(object) {
6842 return typeOf(object) === REACT_SUSPENSE_TYPE;
6843 }
6844 function isSuspenseList(object) {
6845 return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
6846 }
6847
6848 exports.ContextConsumer = ContextConsumer;
6849 exports.ContextProvider = ContextProvider;
6850 exports.Element = Element;
6851 exports.ForwardRef = ForwardRef;
6852 exports.Fragment = Fragment;
6853 exports.Lazy = Lazy;
6854 exports.Memo = Memo;
6855 exports.Portal = Portal;
6856 exports.Profiler = Profiler;
6857 exports.StrictMode = StrictMode;
6858 exports.Suspense = Suspense;
6859 exports.SuspenseList = SuspenseList;
6860 exports.isAsyncMode = isAsyncMode;
6861 exports.isConcurrentMode = isConcurrentMode;
6862 exports.isContextConsumer = isContextConsumer;
6863 exports.isContextProvider = isContextProvider;
6864 exports.isElement = isElement;
6865 exports.isForwardRef = isForwardRef;
6866 exports.isFragment = isFragment;
6867 exports.isLazy = isLazy;
6868 exports.isMemo = isMemo;
6869 exports.isPortal = isPortal;
6870 exports.isProfiler = isProfiler;
6871 exports.isStrictMode = isStrictMode;
6872 exports.isSuspense = isSuspense;
6873 exports.isSuspenseList = isSuspenseList;
6874 exports.isValidElementType = isValidElementType;
6875 exports.typeOf = typeOf;
6876 })();
6877 }
6878
6879
6880 /***/ }),
6881
6882 /***/ "../node_modules/react-is/index.js":
6883 /*!*****************************************!*\
6884 !*** ../node_modules/react-is/index.js ***!
6885 \*****************************************/
6886 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6887
6888 "use strict";
6889
6890
6891 if (false) {} else {
6892 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/react-is/cjs/react-is.development.js");
6893 }
6894
6895
6896 /***/ }),
6897
6898 /***/ "../node_modules/style-to-object/index.js":
6899 /*!************************************************!*\
6900 !*** ../node_modules/style-to-object/index.js ***!
6901 \************************************************/
6902 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6903
6904 var parse = __webpack_require__(/*! inline-style-parser */ "../node_modules/inline-style-parser/index.js");
6905
6906 /**
6907 * Parses inline style to object.
6908 *
6909 * @example
6910 * // returns { 'line-height': '42' }
6911 * StyleToObject('line-height: 42;');
6912 *
6913 * @param {String} style - The inline style.
6914 * @param {Function} [iterator] - The iterator function.
6915 * @return {null|Object}
6916 */
6917 function StyleToObject(style, iterator) {
6918 var output = null;
6919 if (!style || typeof style !== 'string') {
6920 return output;
6921 }
6922
6923 var declaration;
6924 var declarations = parse(style);
6925 var hasIterator = typeof iterator === 'function';
6926 var property;
6927 var value;
6928
6929 for (var i = 0, len = declarations.length; i < len; i++) {
6930 declaration = declarations[i];
6931 property = declaration.property;
6932 value = declaration.value;
6933
6934 if (hasIterator) {
6935 iterator(property, value, declaration);
6936 } else if (value) {
6937 output || (output = {});
6938 output[property] = value;
6939 }
6940 }
6941
6942 return output;
6943 }
6944
6945 module.exports = StyleToObject;
6946 module.exports["default"] = StyleToObject; // ESM support
6947
6948
6949 /***/ }),
6950
6951 /***/ "react":
6952 /*!************************!*\
6953 !*** external "React" ***!
6954 \************************/
6955 /***/ ((module) => {
6956
6957 "use strict";
6958 module.exports = React;
6959
6960 /***/ }),
6961
6962 /***/ "react-dom":
6963 /*!***************************!*\
6964 !*** external "ReactDOM" ***!
6965 \***************************/
6966 /***/ ((module) => {
6967
6968 "use strict";
6969 module.exports = ReactDOM;
6970
6971 /***/ }),
6972
6973 /***/ "@elementor/icons":
6974 /*!******************************************************!*\
6975 !*** external "__UNSTABLE__elementorPackages.icons" ***!
6976 \******************************************************/
6977 /***/ ((module) => {
6978
6979 "use strict";
6980 module.exports = __UNSTABLE__elementorPackages.icons;
6981
6982 /***/ }),
6983
6984 /***/ "@elementor/ui":
6985 /*!***************************************************!*\
6986 !*** external "__UNSTABLE__elementorPackages.ui" ***!
6987 \***************************************************/
6988 /***/ ((module) => {
6989
6990 "use strict";
6991 module.exports = __UNSTABLE__elementorPackages.ui;
6992
6993 /***/ }),
6994
6995 /***/ "@wordpress/i18n":
6996 /*!**************************!*\
6997 !*** external "wp.i18n" ***!
6998 \**************************/
6999 /***/ ((module) => {
7000
7001 "use strict";
7002 module.exports = wp.i18n;
7003
7004 /***/ }),
7005
7006 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
7007 /*!******************************************************************!*\
7008 !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
7009 \******************************************************************/
7010 /***/ ((module) => {
7011
7012 function _arrayLikeToArray(arr, len) {
7013 if (len == null || len > arr.length) len = arr.length;
7014 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
7015 return arr2;
7016 }
7017 module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
7018
7019 /***/ }),
7020
7021 /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
7022 /*!****************************************************************!*\
7023 !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
7024 \****************************************************************/
7025 /***/ ((module) => {
7026
7027 function _arrayWithHoles(arr) {
7028 if (Array.isArray(arr)) return arr;
7029 }
7030 module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
7031
7032 /***/ }),
7033
7034 /***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
7035 /*!***********************************************************************!*\
7036 !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
7037 \***********************************************************************/
7038 /***/ ((module) => {
7039
7040 function _assertThisInitialized(self) {
7041 if (self === void 0) {
7042 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7043 }
7044 return self;
7045 }
7046 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
7047
7048 /***/ }),
7049
7050 /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
7051 /*!******************************************************************!*\
7052 !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
7053 \******************************************************************/
7054 /***/ ((module) => {
7055
7056 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7057 try {
7058 var info = gen[key](arg);
7059 var value = info.value;
7060 } catch (error) {
7061 reject(error);
7062 return;
7063 }
7064 if (info.done) {
7065 resolve(value);
7066 } else {
7067 Promise.resolve(value).then(_next, _throw);
7068 }
7069 }
7070 function _asyncToGenerator(fn) {
7071 return function () {
7072 var self = this,
7073 args = arguments;
7074 return new Promise(function (resolve, reject) {
7075 var gen = fn.apply(self, args);
7076 function _next(value) {
7077 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
7078 }
7079 function _throw(err) {
7080 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
7081 }
7082 _next(undefined);
7083 });
7084 };
7085 }
7086 module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
7087
7088 /***/ }),
7089
7090 /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
7091 /*!****************************************************************!*\
7092 !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
7093 \****************************************************************/
7094 /***/ ((module) => {
7095
7096 function _classCallCheck(instance, Constructor) {
7097 if (!(instance instanceof Constructor)) {
7098 throw new TypeError("Cannot call a class as a function");
7099 }
7100 }
7101 module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
7102
7103 /***/ }),
7104
7105 /***/ "../node_modules/@babel/runtime/helpers/createClass.js":
7106 /*!*************************************************************!*\
7107 !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
7108 \*************************************************************/
7109 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7110
7111 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
7112 function _defineProperties(target, props) {
7113 for (var i = 0; i < props.length; i++) {
7114 var descriptor = props[i];
7115 descriptor.enumerable = descriptor.enumerable || false;
7116 descriptor.configurable = true;
7117 if ("value" in descriptor) descriptor.writable = true;
7118 Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
7119 }
7120 }
7121 function _createClass(Constructor, protoProps, staticProps) {
7122 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
7123 if (staticProps) _defineProperties(Constructor, staticProps);
7124 Object.defineProperty(Constructor, "prototype", {
7125 writable: false
7126 });
7127 return Constructor;
7128 }
7129 module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
7130
7131 /***/ }),
7132
7133 /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
7134 /*!****************************************************************!*\
7135 !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
7136 \****************************************************************/
7137 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7138
7139 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
7140 function _defineProperty(obj, key, value) {
7141 key = toPropertyKey(key);
7142 if (key in obj) {
7143 Object.defineProperty(obj, key, {
7144 value: value,
7145 enumerable: true,
7146 configurable: true,
7147 writable: true
7148 });
7149 } else {
7150 obj[key] = value;
7151 }
7152 return obj;
7153 }
7154 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
7155
7156 /***/ }),
7157
7158 /***/ "../node_modules/@babel/runtime/helpers/extends.js":
7159 /*!*********************************************************!*\
7160 !*** ../node_modules/@babel/runtime/helpers/extends.js ***!
7161 \*********************************************************/
7162 /***/ ((module) => {
7163
7164 function _extends() {
7165 module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
7166 for (var i = 1; i < arguments.length; i++) {
7167 var source = arguments[i];
7168 for (var key in source) {
7169 if (Object.prototype.hasOwnProperty.call(source, key)) {
7170 target[key] = source[key];
7171 }
7172 }
7173 }
7174 return target;
7175 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
7176 return _extends.apply(this, arguments);
7177 }
7178 module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
7179
7180 /***/ }),
7181
7182 /***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
7183 /*!****************************************************************!*\
7184 !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
7185 \****************************************************************/
7186 /***/ ((module) => {
7187
7188 function _getPrototypeOf(o) {
7189 module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
7190 return o.__proto__ || Object.getPrototypeOf(o);
7191 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
7192 return _getPrototypeOf(o);
7193 }
7194 module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
7195
7196 /***/ }),
7197
7198 /***/ "../node_modules/@babel/runtime/helpers/inherits.js":
7199 /*!**********************************************************!*\
7200 !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
7201 \**********************************************************/
7202 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7203
7204 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
7205 function _inherits(subClass, superClass) {
7206 if (typeof superClass !== "function" && superClass !== null) {
7207 throw new TypeError("Super expression must either be null or a function");
7208 }
7209 subClass.prototype = Object.create(superClass && superClass.prototype, {
7210 constructor: {
7211 value: subClass,
7212 writable: true,
7213 configurable: true
7214 }
7215 });
7216 Object.defineProperty(subClass, "prototype", {
7217 writable: false
7218 });
7219 if (superClass) setPrototypeOf(subClass, superClass);
7220 }
7221 module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
7222
7223 /***/ }),
7224
7225 /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
7226 /*!***********************************************************************!*\
7227 !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
7228 \***********************************************************************/
7229 /***/ ((module) => {
7230
7231 function _interopRequireDefault(obj) {
7232 return obj && obj.__esModule ? obj : {
7233 "default": obj
7234 };
7235 }
7236 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
7237
7238 /***/ }),
7239
7240 /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
7241 /*!**********************************************************************!*\
7242 !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
7243 \**********************************************************************/
7244 /***/ ((module) => {
7245
7246 function _iterableToArrayLimit(arr, i) {
7247 var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
7248 if (null != _i) {
7249 var _s,
7250 _e,
7251 _x,
7252 _r,
7253 _arr = [],
7254 _n = !0,
7255 _d = !1;
7256 try {
7257 if (_x = (_i = _i.call(arr)).next, 0 === i) {
7258 if (Object(_i) !== _i) return;
7259 _n = !1;
7260 } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
7261 } catch (err) {
7262 _d = !0, _e = err;
7263 } finally {
7264 try {
7265 if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
7266 } finally {
7267 if (_d) throw _e;
7268 }
7269 }
7270 return _arr;
7271 }
7272 }
7273 module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
7274
7275 /***/ }),
7276
7277 /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
7278 /*!*****************************************************************!*\
7279 !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
7280 \*****************************************************************/
7281 /***/ ((module) => {
7282
7283 function _nonIterableRest() {
7284 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7285 }
7286 module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
7287
7288 /***/ }),
7289
7290 /***/ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js":
7291 /*!*************************************************************************!*\
7292 !*** ../node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***!
7293 \*************************************************************************/
7294 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7295
7296 var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
7297 function _objectWithoutProperties(source, excluded) {
7298 if (source == null) return {};
7299 var target = objectWithoutPropertiesLoose(source, excluded);
7300 var key, i;
7301 if (Object.getOwnPropertySymbols) {
7302 var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
7303 for (i = 0; i < sourceSymbolKeys.length; i++) {
7304 key = sourceSymbolKeys[i];
7305 if (excluded.indexOf(key) >= 0) continue;
7306 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7307 target[key] = source[key];
7308 }
7309 }
7310 return target;
7311 }
7312 module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
7313
7314 /***/ }),
7315
7316 /***/ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
7317 /*!******************************************************************************!*\
7318 !*** ../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
7319 \******************************************************************************/
7320 /***/ ((module) => {
7321
7322 function _objectWithoutPropertiesLoose(source, excluded) {
7323 if (source == null) return {};
7324 var target = {};
7325 var sourceKeys = Object.keys(source);
7326 var key, i;
7327 for (i = 0; i < sourceKeys.length; i++) {
7328 key = sourceKeys[i];
7329 if (excluded.indexOf(key) >= 0) continue;
7330 target[key] = source[key];
7331 }
7332 return target;
7333 }
7334 module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
7335
7336 /***/ }),
7337
7338 /***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
7339 /*!***************************************************************************!*\
7340 !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
7341 \***************************************************************************/
7342 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7343
7344 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
7345 var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
7346 function _possibleConstructorReturn(self, call) {
7347 if (call && (_typeof(call) === "object" || typeof call === "function")) {
7348 return call;
7349 } else if (call !== void 0) {
7350 throw new TypeError("Derived constructors may only return object or undefined");
7351 }
7352 return assertThisInitialized(self);
7353 }
7354 module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
7355
7356 /***/ }),
7357
7358 /***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
7359 /*!********************************************************************!*\
7360 !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
7361 \********************************************************************/
7362 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7363
7364 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
7365 function _regeneratorRuntime() {
7366 "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
7367 module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
7368 return exports;
7369 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
7370 var exports = {},
7371 Op = Object.prototype,
7372 hasOwn = Op.hasOwnProperty,
7373 defineProperty = Object.defineProperty || function (obj, key, desc) {
7374 obj[key] = desc.value;
7375 },
7376 $Symbol = "function" == typeof Symbol ? Symbol : {},
7377 iteratorSymbol = $Symbol.iterator || "@@iterator",
7378 asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
7379 toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
7380 function define(obj, key, value) {
7381 return Object.defineProperty(obj, key, {
7382 value: value,
7383 enumerable: !0,
7384 configurable: !0,
7385 writable: !0
7386 }), obj[key];
7387 }
7388 try {
7389 define({}, "");
7390 } catch (err) {
7391 define = function define(obj, key, value) {
7392 return obj[key] = value;
7393 };
7394 }
7395 function wrap(innerFn, outerFn, self, tryLocsList) {
7396 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
7397 generator = Object.create(protoGenerator.prototype),
7398 context = new Context(tryLocsList || []);
7399 return defineProperty(generator, "_invoke", {
7400 value: makeInvokeMethod(innerFn, self, context)
7401 }), generator;
7402 }
7403 function tryCatch(fn, obj, arg) {
7404 try {
7405 return {
7406 type: "normal",
7407 arg: fn.call(obj, arg)
7408 };
7409 } catch (err) {
7410 return {
7411 type: "throw",
7412 arg: err
7413 };
7414 }
7415 }
7416 exports.wrap = wrap;
7417 var ContinueSentinel = {};
7418 function Generator() {}
7419 function GeneratorFunction() {}
7420 function GeneratorFunctionPrototype() {}
7421 var IteratorPrototype = {};
7422 define(IteratorPrototype, iteratorSymbol, function () {
7423 return this;
7424 });
7425 var getProto = Object.getPrototypeOf,
7426 NativeIteratorPrototype = getProto && getProto(getProto(values([])));
7427 NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
7428 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
7429 function defineIteratorMethods(prototype) {
7430 ["next", "throw", "return"].forEach(function (method) {
7431 define(prototype, method, function (arg) {
7432 return this._invoke(method, arg);
7433 });
7434 });
7435 }
7436 function AsyncIterator(generator, PromiseImpl) {
7437 function invoke(method, arg, resolve, reject) {
7438 var record = tryCatch(generator[method], generator, arg);
7439 if ("throw" !== record.type) {
7440 var result = record.arg,
7441 value = result.value;
7442 return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
7443 invoke("next", value, resolve, reject);
7444 }, function (err) {
7445 invoke("throw", err, resolve, reject);
7446 }) : PromiseImpl.resolve(value).then(function (unwrapped) {
7447 result.value = unwrapped, resolve(result);
7448 }, function (error) {
7449 return invoke("throw", error, resolve, reject);
7450 });
7451 }
7452 reject(record.arg);
7453 }
7454 var previousPromise;
7455 defineProperty(this, "_invoke", {
7456 value: function value(method, arg) {
7457 function callInvokeWithMethodAndArg() {
7458 return new PromiseImpl(function (resolve, reject) {
7459 invoke(method, arg, resolve, reject);
7460 });
7461 }
7462 return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
7463 }
7464 });
7465 }
7466 function makeInvokeMethod(innerFn, self, context) {
7467 var state = "suspendedStart";
7468 return function (method, arg) {
7469 if ("executing" === state) throw new Error("Generator is already running");
7470 if ("completed" === state) {
7471 if ("throw" === method) throw arg;
7472 return doneResult();
7473 }
7474 for (context.method = method, context.arg = arg;;) {
7475 var delegate = context.delegate;
7476 if (delegate) {
7477 var delegateResult = maybeInvokeDelegate(delegate, context);
7478 if (delegateResult) {
7479 if (delegateResult === ContinueSentinel) continue;
7480 return delegateResult;
7481 }
7482 }
7483 if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
7484 if ("suspendedStart" === state) throw state = "completed", context.arg;
7485 context.dispatchException(context.arg);
7486 } else "return" === context.method && context.abrupt("return", context.arg);
7487 state = "executing";
7488 var record = tryCatch(innerFn, self, context);
7489 if ("normal" === record.type) {
7490 if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
7491 return {
7492 value: record.arg,
7493 done: context.done
7494 };
7495 }
7496 "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
7497 }
7498 };
7499 }
7500 function maybeInvokeDelegate(delegate, context) {
7501 var methodName = context.method,
7502 method = delegate.iterator[methodName];
7503 if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
7504 var record = tryCatch(method, delegate.iterator, context.arg);
7505 if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
7506 var info = record.arg;
7507 return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
7508 }
7509 function pushTryEntry(locs) {
7510 var entry = {
7511 tryLoc: locs[0]
7512 };
7513 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
7514 }
7515 function resetTryEntry(entry) {
7516 var record = entry.completion || {};
7517 record.type = "normal", delete record.arg, entry.completion = record;
7518 }
7519 function Context(tryLocsList) {
7520 this.tryEntries = [{
7521 tryLoc: "root"
7522 }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
7523 }
7524 function values(iterable) {
7525 if (iterable) {
7526 var iteratorMethod = iterable[iteratorSymbol];
7527 if (iteratorMethod) return iteratorMethod.call(iterable);
7528 if ("function" == typeof iterable.next) return iterable;
7529 if (!isNaN(iterable.length)) {
7530 var i = -1,
7531 next = function next() {
7532 for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
7533 return next.value = undefined, next.done = !0, next;
7534 };
7535 return next.next = next;
7536 }
7537 }
7538 return {
7539 next: doneResult
7540 };
7541 }
7542 function doneResult() {
7543 return {
7544 value: undefined,
7545 done: !0
7546 };
7547 }
7548 return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
7549 value: GeneratorFunctionPrototype,
7550 configurable: !0
7551 }), defineProperty(GeneratorFunctionPrototype, "constructor", {
7552 value: GeneratorFunction,
7553 configurable: !0
7554 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
7555 var ctor = "function" == typeof genFun && genFun.constructor;
7556 return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
7557 }, exports.mark = function (genFun) {
7558 return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
7559 }, exports.awrap = function (arg) {
7560 return {
7561 __await: arg
7562 };
7563 }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
7564 return this;
7565 }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
7566 void 0 === PromiseImpl && (PromiseImpl = Promise);
7567 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
7568 return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
7569 return result.done ? result.value : iter.next();
7570 });
7571 }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
7572 return this;
7573 }), define(Gp, "toString", function () {
7574 return "[object Generator]";
7575 }), exports.keys = function (val) {
7576 var object = Object(val),
7577 keys = [];
7578 for (var key in object) keys.push(key);
7579 return keys.reverse(), function next() {
7580 for (; keys.length;) {
7581 var key = keys.pop();
7582 if (key in object) return next.value = key, next.done = !1, next;
7583 }
7584 return next.done = !0, next;
7585 };
7586 }, exports.values = values, Context.prototype = {
7587 constructor: Context,
7588 reset: function reset(skipTempReset) {
7589 if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
7590 },
7591 stop: function stop() {
7592 this.done = !0;
7593 var rootRecord = this.tryEntries[0].completion;
7594 if ("throw" === rootRecord.type) throw rootRecord.arg;
7595 return this.rval;
7596 },
7597 dispatchException: function dispatchException(exception) {
7598 if (this.done) throw exception;
7599 var context = this;
7600 function handle(loc, caught) {
7601 return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
7602 }
7603 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7604 var entry = this.tryEntries[i],
7605 record = entry.completion;
7606 if ("root" === entry.tryLoc) return handle("end");
7607 if (entry.tryLoc <= this.prev) {
7608 var hasCatch = hasOwn.call(entry, "catchLoc"),
7609 hasFinally = hasOwn.call(entry, "finallyLoc");
7610 if (hasCatch && hasFinally) {
7611 if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
7612 if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
7613 } else if (hasCatch) {
7614 if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
7615 } else {
7616 if (!hasFinally) throw new Error("try statement without catch or finally");
7617 if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
7618 }
7619 }
7620 }
7621 },
7622 abrupt: function abrupt(type, arg) {
7623 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7624 var entry = this.tryEntries[i];
7625 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
7626 var finallyEntry = entry;
7627 break;
7628 }
7629 }
7630 finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
7631 var record = finallyEntry ? finallyEntry.completion : {};
7632 return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
7633 },
7634 complete: function complete(record, afterLoc) {
7635 if ("throw" === record.type) throw record.arg;
7636 return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
7637 },
7638 finish: function finish(finallyLoc) {
7639 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7640 var entry = this.tryEntries[i];
7641 if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
7642 }
7643 },
7644 "catch": function _catch(tryLoc) {
7645 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7646 var entry = this.tryEntries[i];
7647 if (entry.tryLoc === tryLoc) {
7648 var record = entry.completion;
7649 if ("throw" === record.type) {
7650 var thrown = record.arg;
7651 resetTryEntry(entry);
7652 }
7653 return thrown;
7654 }
7655 }
7656 throw new Error("illegal catch attempt");
7657 },
7658 delegateYield: function delegateYield(iterable, resultName, nextLoc) {
7659 return this.delegate = {
7660 iterator: values(iterable),
7661 resultName: resultName,
7662 nextLoc: nextLoc
7663 }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
7664 }
7665 }, exports;
7666 }
7667 module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
7668
7669 /***/ }),
7670
7671 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
7672 /*!****************************************************************!*\
7673 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
7674 \****************************************************************/
7675 /***/ ((module) => {
7676
7677 function _setPrototypeOf(o, p) {
7678 module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
7679 o.__proto__ = p;
7680 return o;
7681 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
7682 return _setPrototypeOf(o, p);
7683 }
7684 module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
7685
7686 /***/ }),
7687
7688 /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
7689 /*!***************************************************************!*\
7690 !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
7691 \***************************************************************/
7692 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7693
7694 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
7695 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
7696 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
7697 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
7698 function _slicedToArray(arr, i) {
7699 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
7700 }
7701 module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
7702
7703 /***/ }),
7704
7705 /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
7706 /*!*************************************************************!*\
7707 !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
7708 \*************************************************************/
7709 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7710
7711 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
7712 function _toPrimitive(input, hint) {
7713 if (_typeof(input) !== "object" || input === null) return input;
7714 var prim = input[Symbol.toPrimitive];
7715 if (prim !== undefined) {
7716 var res = prim.call(input, hint || "default");
7717 if (_typeof(res) !== "object") return res;
7718 throw new TypeError("@@toPrimitive must return a primitive value.");
7719 }
7720 return (hint === "string" ? String : Number)(input);
7721 }
7722 module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
7723
7724 /***/ }),
7725
7726 /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
7727 /*!***************************************************************!*\
7728 !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
7729 \***************************************************************/
7730 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7731
7732 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
7733 var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
7734 function _toPropertyKey(arg) {
7735 var key = toPrimitive(arg, "string");
7736 return _typeof(key) === "symbol" ? key : String(key);
7737 }
7738 module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
7739
7740 /***/ }),
7741
7742 /***/ "../node_modules/@babel/runtime/helpers/typeof.js":
7743 /*!********************************************************!*\
7744 !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
7745 \********************************************************/
7746 /***/ ((module) => {
7747
7748 function _typeof(obj) {
7749 "@babel/helpers - typeof";
7750
7751 return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
7752 return typeof obj;
7753 } : function (obj) {
7754 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
7755 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
7756 }
7757 module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
7758
7759 /***/ }),
7760
7761 /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
7762 /*!****************************************************************************!*\
7763 !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
7764 \****************************************************************************/
7765 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7766
7767 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
7768 function _unsupportedIterableToArray(o, minLen) {
7769 if (!o) return;
7770 if (typeof o === "string") return arrayLikeToArray(o, minLen);
7771 var n = Object.prototype.toString.call(o).slice(8, -1);
7772 if (n === "Object" && o.constructor) n = o.constructor.name;
7773 if (n === "Map" || n === "Set") return Array.from(o);
7774 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
7775 }
7776 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
7777
7778 /***/ }),
7779
7780 /***/ "../node_modules/@babel/runtime/regenerator/index.js":
7781 /*!***********************************************************!*\
7782 !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
7783 \***********************************************************/
7784 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7785
7786 // TODO(Babel 8): Remove this file.
7787
7788 var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
7789 module.exports = runtime;
7790
7791 // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
7792 try {
7793 regeneratorRuntime = runtime;
7794 } catch (accidentalStrictMode) {
7795 if (typeof globalThis === "object") {
7796 globalThis.regeneratorRuntime = runtime;
7797 } else {
7798 Function("r", "regeneratorRuntime = r")(runtime);
7799 }
7800 }
7801
7802
7803 /***/ }),
7804
7805 /***/ "../node_modules/bail/index.js":
7806 /*!*************************************!*\
7807 !*** ../node_modules/bail/index.js ***!
7808 \*************************************/
7809 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7810
7811 "use strict";
7812 __webpack_require__.r(__webpack_exports__);
7813 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7814 /* harmony export */ "bail": () => (/* binding */ bail)
7815 /* harmony export */ });
7816 /**
7817 * Throw a given error.
7818 *
7819 * @param {Error|null|undefined} [error]
7820 * Maybe error.
7821 * @returns {asserts error is null|undefined}
7822 */
7823 function bail(error) {
7824 if (error) {
7825 throw error
7826 }
7827 }
7828
7829
7830 /***/ }),
7831
7832 /***/ "../node_modules/comma-separated-tokens/index.js":
7833 /*!*******************************************************!*\
7834 !*** ../node_modules/comma-separated-tokens/index.js ***!
7835 \*******************************************************/
7836 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7837
7838 "use strict";
7839 __webpack_require__.r(__webpack_exports__);
7840 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7841 /* harmony export */ "parse": () => (/* binding */ parse),
7842 /* harmony export */ "stringify": () => (/* binding */ stringify)
7843 /* harmony export */ });
7844 /**
7845 * @typedef Options
7846 * Configuration for `stringify`.
7847 * @property {boolean} [padLeft=true]
7848 * Whether to pad a space before a token.
7849 * @property {boolean} [padRight=false]
7850 * Whether to pad a space after a token.
7851 */
7852
7853 /**
7854 * @typedef {Options} StringifyOptions
7855 * Please use `StringifyOptions` instead.
7856 */
7857
7858 /**
7859 * Parse comma-separated tokens to an array.
7860 *
7861 * @param {string} value
7862 * Comma-separated tokens.
7863 * @returns {Array<string>}
7864 * List of tokens.
7865 */
7866 function parse(value) {
7867 /** @type {Array<string>} */
7868 const tokens = []
7869 const input = String(value || '')
7870 let index = input.indexOf(',')
7871 let start = 0
7872 /** @type {boolean} */
7873 let end = false
7874
7875 while (!end) {
7876 if (index === -1) {
7877 index = input.length
7878 end = true
7879 }
7880
7881 const token = input.slice(start, index).trim()
7882
7883 if (token || !end) {
7884 tokens.push(token)
7885 }
7886
7887 start = index + 1
7888 index = input.indexOf(',', start)
7889 }
7890
7891 return tokens
7892 }
7893
7894 /**
7895 * Serialize an array of strings or numbers to comma-separated tokens.
7896 *
7897 * @param {Array<string|number>} values
7898 * List of tokens.
7899 * @param {Options} [options]
7900 * Configuration for `stringify` (optional).
7901 * @returns {string}
7902 * Comma-separated tokens.
7903 */
7904 function stringify(values, options) {
7905 const settings = options || {}
7906
7907 // Ensure the last empty entry is seen.
7908 const input = values[values.length - 1] === '' ? [...values, ''] : values
7909
7910 return input
7911 .join(
7912 (settings.padRight ? ' ' : '') +
7913 ',' +
7914 (settings.padLeft === false ? '' : ' ')
7915 )
7916 .trim()
7917 }
7918
7919
7920 /***/ }),
7921
7922 /***/ "../node_modules/decode-named-character-reference/index.dom.js":
7923 /*!*********************************************************************!*\
7924 !*** ../node_modules/decode-named-character-reference/index.dom.js ***!
7925 \*********************************************************************/
7926 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7927
7928 "use strict";
7929 __webpack_require__.r(__webpack_exports__);
7930 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7931 /* harmony export */ "decodeNamedCharacterReference": () => (/* binding */ decodeNamedCharacterReference)
7932 /* harmony export */ });
7933 /// <reference lib="dom" />
7934
7935 /* eslint-env browser */
7936
7937 const element = document.createElement('i')
7938
7939 /**
7940 * @param {string} value
7941 * @returns {string|false}
7942 */
7943 function decodeNamedCharacterReference(value) {
7944 const characterReference = '&' + value + ';'
7945 element.innerHTML = characterReference
7946 const char = element.textContent
7947
7948 // Some named character references do not require the closing semicolon
7949 // (`&not`, for instance), which leads to situations where parsing the assumed
7950 // named reference of `&notit;` will result in the string `¬it;`.
7951 // When we encounter a trailing semicolon after parsing, and the character
7952 // reference to decode was not a semicolon (`&semi;`), we can assume that the
7953 // matching was not complete.
7954 // @ts-expect-error: TypeScript is wrong that `textContent` on elements can
7955 // yield `null`.
7956 if (char.charCodeAt(char.length - 1) === 59 /* `;` */ && value !== 'semi') {
7957 return false
7958 }
7959
7960 // If the decoded string is equal to the input, the character reference was
7961 // not valid.
7962 // @ts-expect-error: TypeScript is wrong that `textContent` on elements can
7963 // yield `null`.
7964 return char === characterReference ? false : char
7965 }
7966
7967
7968 /***/ }),
7969
7970 /***/ "../node_modules/dequal/dist/index.mjs":
7971 /*!*********************************************!*\
7972 !*** ../node_modules/dequal/dist/index.mjs ***!
7973 \*********************************************/
7974 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7975
7976 "use strict";
7977 __webpack_require__.r(__webpack_exports__);
7978 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7979 /* harmony export */ "dequal": () => (/* binding */ dequal)
7980 /* harmony export */ });
7981 var has = Object.prototype.hasOwnProperty;
7982
7983 function find(iter, tar, key) {
7984 for (key of iter.keys()) {
7985 if (dequal(key, tar)) return key;
7986 }
7987 }
7988
7989 function dequal(foo, bar) {
7990 var ctor, len, tmp;
7991 if (foo === bar) return true;
7992
7993 if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
7994 if (ctor === Date) return foo.getTime() === bar.getTime();
7995 if (ctor === RegExp) return foo.toString() === bar.toString();
7996
7997 if (ctor === Array) {
7998 if ((len=foo.length) === bar.length) {
7999 while (len-- && dequal(foo[len], bar[len]));
8000 }
8001 return len === -1;
8002 }
8003
8004 if (ctor === Set) {
8005 if (foo.size !== bar.size) {
8006 return false;
8007 }
8008 for (len of foo) {
8009 tmp = len;
8010 if (tmp && typeof tmp === 'object') {
8011 tmp = find(bar, tmp);
8012 if (!tmp) return false;
8013 }
8014 if (!bar.has(tmp)) return false;
8015 }
8016 return true;
8017 }
8018
8019 if (ctor === Map) {
8020 if (foo.size !== bar.size) {
8021 return false;
8022 }
8023 for (len of foo) {
8024 tmp = len[0];
8025 if (tmp && typeof tmp === 'object') {
8026 tmp = find(bar, tmp);
8027 if (!tmp) return false;
8028 }
8029 if (!dequal(len[1], bar.get(tmp))) {
8030 return false;
8031 }
8032 }
8033 return true;
8034 }
8035
8036 if (ctor === ArrayBuffer) {
8037 foo = new Uint8Array(foo);
8038 bar = new Uint8Array(bar);
8039 } else if (ctor === DataView) {
8040 if ((len=foo.byteLength) === bar.byteLength) {
8041 while (len-- && foo.getInt8(len) === bar.getInt8(len));
8042 }
8043 return len === -1;
8044 }
8045
8046 if (ArrayBuffer.isView(foo)) {
8047 if ((len=foo.byteLength) === bar.byteLength) {
8048 while (len-- && foo[len] === bar[len]);
8049 }
8050 return len === -1;
8051 }
8052
8053 if (!ctor || typeof foo === 'object') {
8054 len = 0;
8055 for (ctor in foo) {
8056 if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
8057 if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
8058 }
8059 return Object.keys(bar).length === len;
8060 }
8061 }
8062
8063 return foo !== foo && bar !== bar;
8064 }
8065
8066
8067 /***/ }),
8068
8069 /***/ "../node_modules/diff/lib/index.mjs":
8070 /*!******************************************!*\
8071 !*** ../node_modules/diff/lib/index.mjs ***!
8072 \******************************************/
8073 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8074
8075 "use strict";
8076 __webpack_require__.r(__webpack_exports__);
8077 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8078 /* harmony export */ "Diff": () => (/* binding */ Diff),
8079 /* harmony export */ "applyPatch": () => (/* binding */ applyPatch),
8080 /* harmony export */ "applyPatches": () => (/* binding */ applyPatches),
8081 /* harmony export */ "canonicalize": () => (/* binding */ canonicalize),
8082 /* harmony export */ "convertChangesToDMP": () => (/* binding */ convertChangesToDMP),
8083 /* harmony export */ "convertChangesToXML": () => (/* binding */ convertChangesToXML),
8084 /* harmony export */ "createPatch": () => (/* binding */ createPatch),
8085 /* harmony export */ "createTwoFilesPatch": () => (/* binding */ createTwoFilesPatch),
8086 /* harmony export */ "diffArrays": () => (/* binding */ diffArrays),
8087 /* harmony export */ "diffChars": () => (/* binding */ diffChars),
8088 /* harmony export */ "diffCss": () => (/* binding */ diffCss),
8089 /* harmony export */ "diffJson": () => (/* binding */ diffJson),
8090 /* harmony export */ "diffLines": () => (/* binding */ diffLines),
8091 /* harmony export */ "diffSentences": () => (/* binding */ diffSentences),
8092 /* harmony export */ "diffTrimmedLines": () => (/* binding */ diffTrimmedLines),
8093 /* harmony export */ "diffWords": () => (/* binding */ diffWords),
8094 /* harmony export */ "diffWordsWithSpace": () => (/* binding */ diffWordsWithSpace),
8095 /* harmony export */ "merge": () => (/* binding */ merge),
8096 /* harmony export */ "parsePatch": () => (/* binding */ parsePatch),
8097 /* harmony export */ "structuredPatch": () => (/* binding */ structuredPatch)
8098 /* harmony export */ });
8099 function Diff() {}
8100 Diff.prototype = {
8101 diff: function diff(oldString, newString) {
8102 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8103 var callback = options.callback;
8104
8105 if (typeof options === 'function') {
8106 callback = options;
8107 options = {};
8108 }
8109
8110 this.options = options;
8111 var self = this;
8112
8113 function done(value) {
8114 if (callback) {
8115 setTimeout(function () {
8116 callback(undefined, value);
8117 }, 0);
8118 return true;
8119 } else {
8120 return value;
8121 }
8122 } // Allow subclasses to massage the input prior to running
8123
8124
8125 oldString = this.castInput(oldString);
8126 newString = this.castInput(newString);
8127 oldString = this.removeEmpty(this.tokenize(oldString));
8128 newString = this.removeEmpty(this.tokenize(newString));
8129 var newLen = newString.length,
8130 oldLen = oldString.length;
8131 var editLength = 1;
8132 var maxEditLength = newLen + oldLen;
8133
8134 if (options.maxEditLength) {
8135 maxEditLength = Math.min(maxEditLength, options.maxEditLength);
8136 }
8137
8138 var bestPath = [{
8139 newPos: -1,
8140 components: []
8141 }]; // Seed editLength = 0, i.e. the content starts with the same values
8142
8143 var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
8144
8145 if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
8146 // Identity per the equality and tokenizer
8147 return done([{
8148 value: this.join(newString),
8149 count: newString.length
8150 }]);
8151 } // Main worker method. checks all permutations of a given edit length for acceptance.
8152
8153
8154 function execEditLength() {
8155 for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
8156 var basePath = void 0;
8157
8158 var addPath = bestPath[diagonalPath - 1],
8159 removePath = bestPath[diagonalPath + 1],
8160 _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
8161
8162 if (addPath) {
8163 // No one else is going to attempt to use this value, clear it
8164 bestPath[diagonalPath - 1] = undefined;
8165 }
8166
8167 var canAdd = addPath && addPath.newPos + 1 < newLen,
8168 canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
8169
8170 if (!canAdd && !canRemove) {
8171 // If this path is a terminal then prune
8172 bestPath[diagonalPath] = undefined;
8173 continue;
8174 } // Select the diagonal that we want to branch from. We select the prior
8175 // path whose position in the new string is the farthest from the origin
8176 // and does not pass the bounds of the diff graph
8177
8178
8179 if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
8180 basePath = clonePath(removePath);
8181 self.pushComponent(basePath.components, undefined, true);
8182 } else {
8183 basePath = addPath; // No need to clone, we've pulled it from the list
8184
8185 basePath.newPos++;
8186 self.pushComponent(basePath.components, true, undefined);
8187 }
8188
8189 _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
8190
8191 if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
8192 return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
8193 } else {
8194 // Otherwise track this path as a potential candidate and continue.
8195 bestPath[diagonalPath] = basePath;
8196 }
8197 }
8198
8199 editLength++;
8200 } // Performs the length of edit iteration. Is a bit fugly as this has to support the
8201 // sync and async mode which is never fun. Loops over execEditLength until a value
8202 // is produced, or until the edit length exceeds options.maxEditLength (if given),
8203 // in which case it will return undefined.
8204
8205
8206 if (callback) {
8207 (function exec() {
8208 setTimeout(function () {
8209 if (editLength > maxEditLength) {
8210 return callback();
8211 }
8212
8213 if (!execEditLength()) {
8214 exec();
8215 }
8216 }, 0);
8217 })();
8218 } else {
8219 while (editLength <= maxEditLength) {
8220 var ret = execEditLength();
8221
8222 if (ret) {
8223 return ret;
8224 }
8225 }
8226 }
8227 },
8228 pushComponent: function pushComponent(components, added, removed) {
8229 var last = components[components.length - 1];
8230
8231 if (last && last.added === added && last.removed === removed) {
8232 // We need to clone here as the component clone operation is just
8233 // as shallow array clone
8234 components[components.length - 1] = {
8235 count: last.count + 1,
8236 added: added,
8237 removed: removed
8238 };
8239 } else {
8240 components.push({
8241 count: 1,
8242 added: added,
8243 removed: removed
8244 });
8245 }
8246 },
8247 extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
8248 var newLen = newString.length,
8249 oldLen = oldString.length,
8250 newPos = basePath.newPos,
8251 oldPos = newPos - diagonalPath,
8252 commonCount = 0;
8253
8254 while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
8255 newPos++;
8256 oldPos++;
8257 commonCount++;
8258 }
8259
8260 if (commonCount) {
8261 basePath.components.push({
8262 count: commonCount
8263 });
8264 }
8265
8266 basePath.newPos = newPos;
8267 return oldPos;
8268 },
8269 equals: function equals(left, right) {
8270 if (this.options.comparator) {
8271 return this.options.comparator(left, right);
8272 } else {
8273 return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
8274 }
8275 },
8276 removeEmpty: function removeEmpty(array) {
8277 var ret = [];
8278
8279 for (var i = 0; i < array.length; i++) {
8280 if (array[i]) {
8281 ret.push(array[i]);
8282 }
8283 }
8284
8285 return ret;
8286 },
8287 castInput: function castInput(value) {
8288 return value;
8289 },
8290 tokenize: function tokenize(value) {
8291 return value.split('');
8292 },
8293 join: function join(chars) {
8294 return chars.join('');
8295 }
8296 };
8297
8298 function buildValues(diff, components, newString, oldString, useLongestToken) {
8299 var componentPos = 0,
8300 componentLen = components.length,
8301 newPos = 0,
8302 oldPos = 0;
8303
8304 for (; componentPos < componentLen; componentPos++) {
8305 var component = components[componentPos];
8306
8307 if (!component.removed) {
8308 if (!component.added && useLongestToken) {
8309 var value = newString.slice(newPos, newPos + component.count);
8310 value = value.map(function (value, i) {
8311 var oldValue = oldString[oldPos + i];
8312 return oldValue.length > value.length ? oldValue : value;
8313 });
8314 component.value = diff.join(value);
8315 } else {
8316 component.value = diff.join(newString.slice(newPos, newPos + component.count));
8317 }
8318
8319 newPos += component.count; // Common case
8320
8321 if (!component.added) {
8322 oldPos += component.count;
8323 }
8324 } else {
8325 component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
8326 oldPos += component.count; // Reverse add and remove so removes are output first to match common convention
8327 // The diffing algorithm is tied to add then remove output and this is the simplest
8328 // route to get the desired output with minimal overhead.
8329
8330 if (componentPos && components[componentPos - 1].added) {
8331 var tmp = components[componentPos - 1];
8332 components[componentPos - 1] = components[componentPos];
8333 components[componentPos] = tmp;
8334 }
8335 }
8336 } // Special case handle for when one terminal is ignored (i.e. whitespace).
8337 // For this case we merge the terminal into the prior string and drop the change.
8338 // This is only available for string mode.
8339
8340
8341 var lastComponent = components[componentLen - 1];
8342
8343 if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
8344 components[componentLen - 2].value += lastComponent.value;
8345 components.pop();
8346 }
8347
8348 return components;
8349 }
8350
8351 function clonePath(path) {
8352 return {
8353 newPos: path.newPos,
8354 components: path.components.slice(0)
8355 };
8356 }
8357
8358 var characterDiff = new Diff();
8359 function diffChars(oldStr, newStr, options) {
8360 return characterDiff.diff(oldStr, newStr, options);
8361 }
8362
8363 function generateOptions(options, defaults) {
8364 if (typeof options === 'function') {
8365 defaults.callback = options;
8366 } else if (options) {
8367 for (var name in options) {
8368 /* istanbul ignore else */
8369 if (options.hasOwnProperty(name)) {
8370 defaults[name] = options[name];
8371 }
8372 }
8373 }
8374
8375 return defaults;
8376 }
8377
8378 //
8379 // Ranges and exceptions:
8380 // Latin-1 Supplement, 0080–00FF
8381 // - U+00D7 × Multiplication sign
8382 // - U+00F7 ÷ Division sign
8383 // Latin Extended-A, 0100–017F
8384 // Latin Extended-B, 0180–024F
8385 // IPA Extensions, 0250–02AF
8386 // Spacing Modifier Letters, 02B0–02FF
8387 // - U+02C7 ˇ &#711; Caron
8388 // - U+02D8 ˘ &#728; Breve
8389 // - U+02D9 ˙ &#729; Dot Above
8390 // - U+02DA ˚ &#730; Ring Above
8391 // - U+02DB ˛ &#731; Ogonek
8392 // - U+02DC ˜ &#732; Small Tilde
8393 // - U+02DD ˝ &#733; Double Acute Accent
8394 // Latin Extended Additional, 1E00–1EFF
8395
8396 var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
8397 var reWhitespace = /\S/;
8398 var wordDiff = new Diff();
8399
8400 wordDiff.equals = function (left, right) {
8401 if (this.options.ignoreCase) {
8402 left = left.toLowerCase();
8403 right = right.toLowerCase();
8404 }
8405
8406 return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
8407 };
8408
8409 wordDiff.tokenize = function (value) {
8410 // All whitespace symbols except newline group into one token, each newline - in separate token
8411 var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
8412
8413 for (var i = 0; i < tokens.length - 1; i++) {
8414 // If we have an empty string in the next field and we have only word chars before and after, merge
8415 if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
8416 tokens[i] += tokens[i + 2];
8417 tokens.splice(i + 1, 2);
8418 i--;
8419 }
8420 }
8421
8422 return tokens;
8423 };
8424
8425 function diffWords(oldStr, newStr, options) {
8426 options = generateOptions(options, {
8427 ignoreWhitespace: true
8428 });
8429 return wordDiff.diff(oldStr, newStr, options);
8430 }
8431 function diffWordsWithSpace(oldStr, newStr, options) {
8432 return wordDiff.diff(oldStr, newStr, options);
8433 }
8434
8435 var lineDiff = new Diff();
8436
8437 lineDiff.tokenize = function (value) {
8438 var retLines = [],
8439 linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
8440
8441 if (!linesAndNewlines[linesAndNewlines.length - 1]) {
8442 linesAndNewlines.pop();
8443 } // Merge the content and line separators into single tokens
8444
8445
8446 for (var i = 0; i < linesAndNewlines.length; i++) {
8447 var line = linesAndNewlines[i];
8448
8449 if (i % 2 && !this.options.newlineIsToken) {
8450 retLines[retLines.length - 1] += line;
8451 } else {
8452 if (this.options.ignoreWhitespace) {
8453 line = line.trim();
8454 }
8455
8456 retLines.push(line);
8457 }
8458 }
8459
8460 return retLines;
8461 };
8462
8463 function diffLines(oldStr, newStr, callback) {
8464 return lineDiff.diff(oldStr, newStr, callback);
8465 }
8466 function diffTrimmedLines(oldStr, newStr, callback) {
8467 var options = generateOptions(callback, {
8468 ignoreWhitespace: true
8469 });
8470 return lineDiff.diff(oldStr, newStr, options);
8471 }
8472
8473 var sentenceDiff = new Diff();
8474
8475 sentenceDiff.tokenize = function (value) {
8476 return value.split(/(\S.+?[.!?])(?=\s+|$)/);
8477 };
8478
8479 function diffSentences(oldStr, newStr, callback) {
8480 return sentenceDiff.diff(oldStr, newStr, callback);
8481 }
8482
8483 var cssDiff = new Diff();
8484
8485 cssDiff.tokenize = function (value) {
8486 return value.split(/([{}:;,]|\s+)/);
8487 };
8488
8489 function diffCss(oldStr, newStr, callback) {
8490 return cssDiff.diff(oldStr, newStr, callback);
8491 }
8492
8493 function _typeof(obj) {
8494 "@babel/helpers - typeof";
8495
8496 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
8497 _typeof = function (obj) {
8498 return typeof obj;
8499 };
8500 } else {
8501 _typeof = function (obj) {
8502 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
8503 };
8504 }
8505
8506 return _typeof(obj);
8507 }
8508
8509 function _toConsumableArray(arr) {
8510 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
8511 }
8512
8513 function _arrayWithoutHoles(arr) {
8514 if (Array.isArray(arr)) return _arrayLikeToArray(arr);
8515 }
8516
8517 function _iterableToArray(iter) {
8518 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
8519 }
8520
8521 function _unsupportedIterableToArray(o, minLen) {
8522 if (!o) return;
8523 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
8524 var n = Object.prototype.toString.call(o).slice(8, -1);
8525 if (n === "Object" && o.constructor) n = o.constructor.name;
8526 if (n === "Map" || n === "Set") return Array.from(o);
8527 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
8528 }
8529
8530 function _arrayLikeToArray(arr, len) {
8531 if (len == null || len > arr.length) len = arr.length;
8532
8533 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
8534
8535 return arr2;
8536 }
8537
8538 function _nonIterableSpread() {
8539 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8540 }
8541
8542 var objectPrototypeToString = Object.prototype.toString;
8543 var jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
8544 // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
8545
8546 jsonDiff.useLongestToken = true;
8547 jsonDiff.tokenize = lineDiff.tokenize;
8548
8549 jsonDiff.castInput = function (value) {
8550 var _this$options = this.options,
8551 undefinedReplacement = _this$options.undefinedReplacement,
8552 _this$options$stringi = _this$options.stringifyReplacer,
8553 stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) {
8554 return typeof v === 'undefined' ? undefinedReplacement : v;
8555 } : _this$options$stringi;
8556 return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' ');
8557 };
8558
8559 jsonDiff.equals = function (left, right) {
8560 return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'));
8561 };
8562
8563 function diffJson(oldObj, newObj, options) {
8564 return jsonDiff.diff(oldObj, newObj, options);
8565 } // This function handles the presence of circular references by bailing out when encountering an
8566 // object that is already on the "stack" of items being processed. Accepts an optional replacer
8567
8568 function canonicalize(obj, stack, replacementStack, replacer, key) {
8569 stack = stack || [];
8570 replacementStack = replacementStack || [];
8571
8572 if (replacer) {
8573 obj = replacer(key, obj);
8574 }
8575
8576 var i;
8577
8578 for (i = 0; i < stack.length; i += 1) {
8579 if (stack[i] === obj) {
8580 return replacementStack[i];
8581 }
8582 }
8583
8584 var canonicalizedObj;
8585
8586 if ('[object Array]' === objectPrototypeToString.call(obj)) {
8587 stack.push(obj);
8588 canonicalizedObj = new Array(obj.length);
8589 replacementStack.push(canonicalizedObj);
8590
8591 for (i = 0; i < obj.length; i += 1) {
8592 canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
8593 }
8594
8595 stack.pop();
8596 replacementStack.pop();
8597 return canonicalizedObj;
8598 }
8599
8600 if (obj && obj.toJSON) {
8601 obj = obj.toJSON();
8602 }
8603
8604 if (_typeof(obj) === 'object' && obj !== null) {
8605 stack.push(obj);
8606 canonicalizedObj = {};
8607 replacementStack.push(canonicalizedObj);
8608
8609 var sortedKeys = [],
8610 _key;
8611
8612 for (_key in obj) {
8613 /* istanbul ignore else */
8614 if (obj.hasOwnProperty(_key)) {
8615 sortedKeys.push(_key);
8616 }
8617 }
8618
8619 sortedKeys.sort();
8620
8621 for (i = 0; i < sortedKeys.length; i += 1) {
8622 _key = sortedKeys[i];
8623 canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
8624 }
8625
8626 stack.pop();
8627 replacementStack.pop();
8628 } else {
8629 canonicalizedObj = obj;
8630 }
8631
8632 return canonicalizedObj;
8633 }
8634
8635 var arrayDiff = new Diff();
8636
8637 arrayDiff.tokenize = function (value) {
8638 return value.slice();
8639 };
8640
8641 arrayDiff.join = arrayDiff.removeEmpty = function (value) {
8642 return value;
8643 };
8644
8645 function diffArrays(oldArr, newArr, callback) {
8646 return arrayDiff.diff(oldArr, newArr, callback);
8647 }
8648
8649 function parsePatch(uniDiff) {
8650 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8651 var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
8652 delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
8653 list = [],
8654 i = 0;
8655
8656 function parseIndex() {
8657 var index = {};
8658 list.push(index); // Parse diff metadata
8659
8660 while (i < diffstr.length) {
8661 var line = diffstr[i]; // File header found, end parsing diff metadata
8662
8663 if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
8664 break;
8665 } // Diff index
8666
8667
8668 var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
8669
8670 if (header) {
8671 index.index = header[1];
8672 }
8673
8674 i++;
8675 } // Parse file headers if they are defined. Unified diff requires them, but
8676 // there's no technical issues to have an isolated hunk without file header
8677
8678
8679 parseFileHeader(index);
8680 parseFileHeader(index); // Parse hunks
8681
8682 index.hunks = [];
8683
8684 while (i < diffstr.length) {
8685 var _line = diffstr[i];
8686
8687 if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
8688 break;
8689 } else if (/^@@/.test(_line)) {
8690 index.hunks.push(parseHunk());
8691 } else if (_line && options.strict) {
8692 // Ignore unexpected content unless in strict mode
8693 throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
8694 } else {
8695 i++;
8696 }
8697 }
8698 } // Parses the --- and +++ headers, if none are found, no lines
8699 // are consumed.
8700
8701
8702 function parseFileHeader(index) {
8703 var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
8704
8705 if (fileHeader) {
8706 var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
8707 var data = fileHeader[2].split('\t', 2);
8708 var fileName = data[0].replace(/\\\\/g, '\\');
8709
8710 if (/^".*"$/.test(fileName)) {
8711 fileName = fileName.substr(1, fileName.length - 2);
8712 }
8713
8714 index[keyPrefix + 'FileName'] = fileName;
8715 index[keyPrefix + 'Header'] = (data[1] || '').trim();
8716 i++;
8717 }
8718 } // Parses a hunk
8719 // This assumes that we are at the start of a hunk.
8720
8721
8722 function parseHunk() {
8723 var chunkHeaderIndex = i,
8724 chunkHeaderLine = diffstr[i++],
8725 chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
8726 var hunk = {
8727 oldStart: +chunkHeader[1],
8728 oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
8729 newStart: +chunkHeader[3],
8730 newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
8731 lines: [],
8732 linedelimiters: []
8733 }; // Unified Diff Format quirk: If the chunk size is 0,
8734 // the first number is one lower than one would expect.
8735 // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
8736
8737 if (hunk.oldLines === 0) {
8738 hunk.oldStart += 1;
8739 }
8740
8741 if (hunk.newLines === 0) {
8742 hunk.newStart += 1;
8743 }
8744
8745 var addCount = 0,
8746 removeCount = 0;
8747
8748 for (; i < diffstr.length; i++) {
8749 // Lines starting with '---' could be mistaken for the "remove line" operation
8750 // But they could be the header for the next file. Therefore prune such cases out.
8751 if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
8752 break;
8753 }
8754
8755 var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
8756
8757 if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
8758 hunk.lines.push(diffstr[i]);
8759 hunk.linedelimiters.push(delimiters[i] || '\n');
8760
8761 if (operation === '+') {
8762 addCount++;
8763 } else if (operation === '-') {
8764 removeCount++;
8765 } else if (operation === ' ') {
8766 addCount++;
8767 removeCount++;
8768 }
8769 } else {
8770 break;
8771 }
8772 } // Handle the empty block count case
8773
8774
8775 if (!addCount && hunk.newLines === 1) {
8776 hunk.newLines = 0;
8777 }
8778
8779 if (!removeCount && hunk.oldLines === 1) {
8780 hunk.oldLines = 0;
8781 } // Perform optional sanity checking
8782
8783
8784 if (options.strict) {
8785 if (addCount !== hunk.newLines) {
8786 throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
8787 }
8788
8789 if (removeCount !== hunk.oldLines) {
8790 throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
8791 }
8792 }
8793
8794 return hunk;
8795 }
8796
8797 while (i < diffstr.length) {
8798 parseIndex();
8799 }
8800
8801 return list;
8802 }
8803
8804 // Iterator that traverses in the range of [min, max], stepping
8805 // by distance from a given start position. I.e. for [0, 4], with
8806 // start of 2, this will iterate 2, 3, 1, 4, 0.
8807 function distanceIterator (start, minLine, maxLine) {
8808 var wantForward = true,
8809 backwardExhausted = false,
8810 forwardExhausted = false,
8811 localOffset = 1;
8812 return function iterator() {
8813 if (wantForward && !forwardExhausted) {
8814 if (backwardExhausted) {
8815 localOffset++;
8816 } else {
8817 wantForward = false;
8818 } // Check if trying to fit beyond text length, and if not, check it fits
8819 // after offset location (or desired location on first iteration)
8820
8821
8822 if (start + localOffset <= maxLine) {
8823 return localOffset;
8824 }
8825
8826 forwardExhausted = true;
8827 }
8828
8829 if (!backwardExhausted) {
8830 if (!forwardExhausted) {
8831 wantForward = true;
8832 } // Check if trying to fit before text beginning, and if not, check it fits
8833 // before offset location
8834
8835
8836 if (minLine <= start - localOffset) {
8837 return -localOffset++;
8838 }
8839
8840 backwardExhausted = true;
8841 return iterator();
8842 } // We tried to fit hunk before text beginning and beyond text length, then
8843 // hunk can't fit on the text. Return undefined
8844
8845 };
8846 }
8847
8848 function applyPatch(source, uniDiff) {
8849 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8850
8851 if (typeof uniDiff === 'string') {
8852 uniDiff = parsePatch(uniDiff);
8853 }
8854
8855 if (Array.isArray(uniDiff)) {
8856 if (uniDiff.length > 1) {
8857 throw new Error('applyPatch only works with a single input.');
8858 }
8859
8860 uniDiff = uniDiff[0];
8861 } // Apply the diff to the input
8862
8863
8864 var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
8865 delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
8866 hunks = uniDiff.hunks,
8867 compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) {
8868 return line === patchContent;
8869 },
8870 errorCount = 0,
8871 fuzzFactor = options.fuzzFactor || 0,
8872 minLine = 0,
8873 offset = 0,
8874 removeEOFNL,
8875 addEOFNL;
8876 /**
8877 * Checks if the hunk exactly fits on the provided location
8878 */
8879
8880
8881 function hunkFits(hunk, toPos) {
8882 for (var j = 0; j < hunk.lines.length; j++) {
8883 var line = hunk.lines[j],
8884 operation = line.length > 0 ? line[0] : ' ',
8885 content = line.length > 0 ? line.substr(1) : line;
8886
8887 if (operation === ' ' || operation === '-') {
8888 // Context sanity check
8889 if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
8890 errorCount++;
8891
8892 if (errorCount > fuzzFactor) {
8893 return false;
8894 }
8895 }
8896
8897 toPos++;
8898 }
8899 }
8900
8901 return true;
8902 } // Search best fit offsets for each hunk based on the previous ones
8903
8904
8905 for (var i = 0; i < hunks.length; i++) {
8906 var hunk = hunks[i],
8907 maxLine = lines.length - hunk.oldLines,
8908 localOffset = 0,
8909 toPos = offset + hunk.oldStart - 1;
8910 var iterator = distanceIterator(toPos, minLine, maxLine);
8911
8912 for (; localOffset !== undefined; localOffset = iterator()) {
8913 if (hunkFits(hunk, toPos + localOffset)) {
8914 hunk.offset = offset += localOffset;
8915 break;
8916 }
8917 }
8918
8919 if (localOffset === undefined) {
8920 return false;
8921 } // Set lower text limit to end of the current hunk, so next ones don't try
8922 // to fit over already patched text
8923
8924
8925 minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
8926 } // Apply patch hunks
8927
8928
8929 var diffOffset = 0;
8930
8931 for (var _i = 0; _i < hunks.length; _i++) {
8932 var _hunk = hunks[_i],
8933 _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;
8934
8935 diffOffset += _hunk.newLines - _hunk.oldLines;
8936
8937 for (var j = 0; j < _hunk.lines.length; j++) {
8938 var line = _hunk.lines[j],
8939 operation = line.length > 0 ? line[0] : ' ',
8940 content = line.length > 0 ? line.substr(1) : line,
8941 delimiter = _hunk.linedelimiters[j];
8942
8943 if (operation === ' ') {
8944 _toPos++;
8945 } else if (operation === '-') {
8946 lines.splice(_toPos, 1);
8947 delimiters.splice(_toPos, 1);
8948 /* istanbul ignore else */
8949 } else if (operation === '+') {
8950 lines.splice(_toPos, 0, content);
8951 delimiters.splice(_toPos, 0, delimiter);
8952 _toPos++;
8953 } else if (operation === '\\') {
8954 var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
8955
8956 if (previousOperation === '+') {
8957 removeEOFNL = true;
8958 } else if (previousOperation === '-') {
8959 addEOFNL = true;
8960 }
8961 }
8962 }
8963 } // Handle EOFNL insertion/removal
8964
8965
8966 if (removeEOFNL) {
8967 while (!lines[lines.length - 1]) {
8968 lines.pop();
8969 delimiters.pop();
8970 }
8971 } else if (addEOFNL) {
8972 lines.push('');
8973 delimiters.push('\n');
8974 }
8975
8976 for (var _k = 0; _k < lines.length - 1; _k++) {
8977 lines[_k] = lines[_k] + delimiters[_k];
8978 }
8979
8980 return lines.join('');
8981 } // Wrapper that supports multiple file patches via callbacks.
8982
8983 function applyPatches(uniDiff, options) {
8984 if (typeof uniDiff === 'string') {
8985 uniDiff = parsePatch(uniDiff);
8986 }
8987
8988 var currentIndex = 0;
8989
8990 function processIndex() {
8991 var index = uniDiff[currentIndex++];
8992
8993 if (!index) {
8994 return options.complete();
8995 }
8996
8997 options.loadFile(index, function (err, data) {
8998 if (err) {
8999 return options.complete(err);
9000 }
9001
9002 var updatedContent = applyPatch(data, index, options);
9003 options.patched(index, updatedContent, function (err) {
9004 if (err) {
9005 return options.complete(err);
9006 }
9007
9008 processIndex();
9009 });
9010 });
9011 }
9012
9013 processIndex();
9014 }
9015
9016 function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
9017 if (!options) {
9018 options = {};
9019 }
9020
9021 if (typeof options.context === 'undefined') {
9022 options.context = 4;
9023 }
9024
9025 var diff = diffLines(oldStr, newStr, options);
9026
9027 if (!diff) {
9028 return;
9029 }
9030
9031 diff.push({
9032 value: '',
9033 lines: []
9034 }); // Append an empty value to make cleanup easier
9035
9036 function contextLines(lines) {
9037 return lines.map(function (entry) {
9038 return ' ' + entry;
9039 });
9040 }
9041
9042 var hunks = [];
9043 var oldRangeStart = 0,
9044 newRangeStart = 0,
9045 curRange = [],
9046 oldLine = 1,
9047 newLine = 1;
9048
9049 var _loop = function _loop(i) {
9050 var current = diff[i],
9051 lines = current.lines || current.value.replace(/\n$/, '').split('\n');
9052 current.lines = lines;
9053
9054 if (current.added || current.removed) {
9055 var _curRange;
9056
9057 // If we have previous context, start with that
9058 if (!oldRangeStart) {
9059 var prev = diff[i - 1];
9060 oldRangeStart = oldLine;
9061 newRangeStart = newLine;
9062
9063 if (prev) {
9064 curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
9065 oldRangeStart -= curRange.length;
9066 newRangeStart -= curRange.length;
9067 }
9068 } // Output our changes
9069
9070
9071 (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) {
9072 return (current.added ? '+' : '-') + entry;
9073 }))); // Track the updated file position
9074
9075
9076 if (current.added) {
9077 newLine += lines.length;
9078 } else {
9079 oldLine += lines.length;
9080 }
9081 } else {
9082 // Identical context lines. Track line changes
9083 if (oldRangeStart) {
9084 // Close out any changes that have been output (or join overlapping)
9085 if (lines.length <= options.context * 2 && i < diff.length - 2) {
9086 var _curRange2;
9087
9088 // Overlapping
9089 (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
9090 } else {
9091 var _curRange3;
9092
9093 // end the range and output
9094 var contextSize = Math.min(lines.length, options.context);
9095
9096 (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
9097
9098 var hunk = {
9099 oldStart: oldRangeStart,
9100 oldLines: oldLine - oldRangeStart + contextSize,
9101 newStart: newRangeStart,
9102 newLines: newLine - newRangeStart + contextSize,
9103 lines: curRange
9104 };
9105
9106 if (i >= diff.length - 2 && lines.length <= options.context) {
9107 // EOF is inside this hunk
9108 var oldEOFNewline = /\n$/.test(oldStr);
9109 var newEOFNewline = /\n$/.test(newStr);
9110 var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
9111
9112 if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
9113 // special case: old has no eol and no trailing context; no-nl can end up before adds
9114 // however, if the old file is empty, do not output the no-nl line
9115 curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file');
9116 }
9117
9118 if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
9119 curRange.push('\\ No newline at end of file');
9120 }
9121 }
9122
9123 hunks.push(hunk);
9124 oldRangeStart = 0;
9125 newRangeStart = 0;
9126 curRange = [];
9127 }
9128 }
9129
9130 oldLine += lines.length;
9131 newLine += lines.length;
9132 }
9133 };
9134
9135 for (var i = 0; i < diff.length; i++) {
9136 _loop(i);
9137 }
9138
9139 return {
9140 oldFileName: oldFileName,
9141 newFileName: newFileName,
9142 oldHeader: oldHeader,
9143 newHeader: newHeader,
9144 hunks: hunks
9145 };
9146 }
9147 function formatPatch(diff) {
9148 var ret = [];
9149
9150 if (diff.oldFileName == diff.newFileName) {
9151 ret.push('Index: ' + diff.oldFileName);
9152 }
9153
9154 ret.push('===================================================================');
9155 ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
9156 ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
9157
9158 for (var i = 0; i < diff.hunks.length; i++) {
9159 var hunk = diff.hunks[i]; // Unified Diff Format quirk: If the chunk size is 0,
9160 // the first number is one lower than one would expect.
9161 // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
9162
9163 if (hunk.oldLines === 0) {
9164 hunk.oldStart -= 1;
9165 }
9166
9167 if (hunk.newLines === 0) {
9168 hunk.newStart -= 1;
9169 }
9170
9171 ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
9172 ret.push.apply(ret, hunk.lines);
9173 }
9174
9175 return ret.join('\n') + '\n';
9176 }
9177 function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
9178 return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
9179 }
9180 function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
9181 return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
9182 }
9183
9184 function arrayEqual(a, b) {
9185 if (a.length !== b.length) {
9186 return false;
9187 }
9188
9189 return arrayStartsWith(a, b);
9190 }
9191 function arrayStartsWith(array, start) {
9192 if (start.length > array.length) {
9193 return false;
9194 }
9195
9196 for (var i = 0; i < start.length; i++) {
9197 if (start[i] !== array[i]) {
9198 return false;
9199 }
9200 }
9201
9202 return true;
9203 }
9204
9205 function calcLineCount(hunk) {
9206 var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines),
9207 oldLines = _calcOldNewLineCount.oldLines,
9208 newLines = _calcOldNewLineCount.newLines;
9209
9210 if (oldLines !== undefined) {
9211 hunk.oldLines = oldLines;
9212 } else {
9213 delete hunk.oldLines;
9214 }
9215
9216 if (newLines !== undefined) {
9217 hunk.newLines = newLines;
9218 } else {
9219 delete hunk.newLines;
9220 }
9221 }
9222 function merge(mine, theirs, base) {
9223 mine = loadPatch(mine, base);
9224 theirs = loadPatch(theirs, base);
9225 var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning.
9226 // Leaving sanity checks on this to the API consumer that may know more about the
9227 // meaning in their own context.
9228
9229 if (mine.index || theirs.index) {
9230 ret.index = mine.index || theirs.index;
9231 }
9232
9233 if (mine.newFileName || theirs.newFileName) {
9234 if (!fileNameChanged(mine)) {
9235 // No header or no change in ours, use theirs (and ours if theirs does not exist)
9236 ret.oldFileName = theirs.oldFileName || mine.oldFileName;
9237 ret.newFileName = theirs.newFileName || mine.newFileName;
9238 ret.oldHeader = theirs.oldHeader || mine.oldHeader;
9239 ret.newHeader = theirs.newHeader || mine.newHeader;
9240 } else if (!fileNameChanged(theirs)) {
9241 // No header or no change in theirs, use ours
9242 ret.oldFileName = mine.oldFileName;
9243 ret.newFileName = mine.newFileName;
9244 ret.oldHeader = mine.oldHeader;
9245 ret.newHeader = mine.newHeader;
9246 } else {
9247 // Both changed... figure it out
9248 ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
9249 ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
9250 ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
9251 ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
9252 }
9253 }
9254
9255 ret.hunks = [];
9256 var mineIndex = 0,
9257 theirsIndex = 0,
9258 mineOffset = 0,
9259 theirsOffset = 0;
9260
9261 while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
9262 var mineCurrent = mine.hunks[mineIndex] || {
9263 oldStart: Infinity
9264 },
9265 theirsCurrent = theirs.hunks[theirsIndex] || {
9266 oldStart: Infinity
9267 };
9268
9269 if (hunkBefore(mineCurrent, theirsCurrent)) {
9270 // This patch does not overlap with any of the others, yay.
9271 ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
9272 mineIndex++;
9273 theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
9274 } else if (hunkBefore(theirsCurrent, mineCurrent)) {
9275 // This patch does not overlap with any of the others, yay.
9276 ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
9277 theirsIndex++;
9278 mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
9279 } else {
9280 // Overlap, merge as best we can
9281 var mergedHunk = {
9282 oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
9283 oldLines: 0,
9284 newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
9285 newLines: 0,
9286 lines: []
9287 };
9288 mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
9289 theirsIndex++;
9290 mineIndex++;
9291 ret.hunks.push(mergedHunk);
9292 }
9293 }
9294
9295 return ret;
9296 }
9297
9298 function loadPatch(param, base) {
9299 if (typeof param === 'string') {
9300 if (/^@@/m.test(param) || /^Index:/m.test(param)) {
9301 return parsePatch(param)[0];
9302 }
9303
9304 if (!base) {
9305 throw new Error('Must provide a base reference or pass in a patch');
9306 }
9307
9308 return structuredPatch(undefined, undefined, base, param);
9309 }
9310
9311 return param;
9312 }
9313
9314 function fileNameChanged(patch) {
9315 return patch.newFileName && patch.newFileName !== patch.oldFileName;
9316 }
9317
9318 function selectField(index, mine, theirs) {
9319 if (mine === theirs) {
9320 return mine;
9321 } else {
9322 index.conflict = true;
9323 return {
9324 mine: mine,
9325 theirs: theirs
9326 };
9327 }
9328 }
9329
9330 function hunkBefore(test, check) {
9331 return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
9332 }
9333
9334 function cloneHunk(hunk, offset) {
9335 return {
9336 oldStart: hunk.oldStart,
9337 oldLines: hunk.oldLines,
9338 newStart: hunk.newStart + offset,
9339 newLines: hunk.newLines,
9340 lines: hunk.lines
9341 };
9342 }
9343
9344 function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
9345 // This will generally result in a conflicted hunk, but there are cases where the context
9346 // is the only overlap where we can successfully merge the content here.
9347 var mine = {
9348 offset: mineOffset,
9349 lines: mineLines,
9350 index: 0
9351 },
9352 their = {
9353 offset: theirOffset,
9354 lines: theirLines,
9355 index: 0
9356 }; // Handle any leading content
9357
9358 insertLeading(hunk, mine, their);
9359 insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each.
9360
9361 while (mine.index < mine.lines.length && their.index < their.lines.length) {
9362 var mineCurrent = mine.lines[mine.index],
9363 theirCurrent = their.lines[their.index];
9364
9365 if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
9366 // Both modified ...
9367 mutualChange(hunk, mine, their);
9368 } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
9369 var _hunk$lines;
9370
9371 // Mine inserted
9372 (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine)));
9373 } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
9374 var _hunk$lines2;
9375
9376 // Theirs inserted
9377 (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their)));
9378 } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
9379 // Mine removed or edited
9380 removal(hunk, mine, their);
9381 } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
9382 // Their removed or edited
9383 removal(hunk, their, mine, true);
9384 } else if (mineCurrent === theirCurrent) {
9385 // Context identity
9386 hunk.lines.push(mineCurrent);
9387 mine.index++;
9388 their.index++;
9389 } else {
9390 // Context mismatch
9391 conflict(hunk, collectChange(mine), collectChange(their));
9392 }
9393 } // Now push anything that may be remaining
9394
9395
9396 insertTrailing(hunk, mine);
9397 insertTrailing(hunk, their);
9398 calcLineCount(hunk);
9399 }
9400
9401 function mutualChange(hunk, mine, their) {
9402 var myChanges = collectChange(mine),
9403 theirChanges = collectChange(their);
9404
9405 if (allRemoves(myChanges) && allRemoves(theirChanges)) {
9406 // Special case for remove changes that are supersets of one another
9407 if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
9408 var _hunk$lines3;
9409
9410 (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges));
9411
9412 return;
9413 } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
9414 var _hunk$lines4;
9415
9416 (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges));
9417
9418 return;
9419 }
9420 } else if (arrayEqual(myChanges, theirChanges)) {
9421 var _hunk$lines5;
9422
9423 (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges));
9424
9425 return;
9426 }
9427
9428 conflict(hunk, myChanges, theirChanges);
9429 }
9430
9431 function removal(hunk, mine, their, swap) {
9432 var myChanges = collectChange(mine),
9433 theirChanges = collectContext(their, myChanges);
9434
9435 if (theirChanges.merged) {
9436 var _hunk$lines6;
9437
9438 (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged));
9439 } else {
9440 conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
9441 }
9442 }
9443
9444 function conflict(hunk, mine, their) {
9445 hunk.conflict = true;
9446 hunk.lines.push({
9447 conflict: true,
9448 mine: mine,
9449 theirs: their
9450 });
9451 }
9452
9453 function insertLeading(hunk, insert, their) {
9454 while (insert.offset < their.offset && insert.index < insert.lines.length) {
9455 var line = insert.lines[insert.index++];
9456 hunk.lines.push(line);
9457 insert.offset++;
9458 }
9459 }
9460
9461 function insertTrailing(hunk, insert) {
9462 while (insert.index < insert.lines.length) {
9463 var line = insert.lines[insert.index++];
9464 hunk.lines.push(line);
9465 }
9466 }
9467
9468 function collectChange(state) {
9469 var ret = [],
9470 operation = state.lines[state.index][0];
9471
9472 while (state.index < state.lines.length) {
9473 var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
9474
9475 if (operation === '-' && line[0] === '+') {
9476 operation = '+';
9477 }
9478
9479 if (operation === line[0]) {
9480 ret.push(line);
9481 state.index++;
9482 } else {
9483 break;
9484 }
9485 }
9486
9487 return ret;
9488 }
9489
9490 function collectContext(state, matchChanges) {
9491 var changes = [],
9492 merged = [],
9493 matchIndex = 0,
9494 contextChanges = false,
9495 conflicted = false;
9496
9497 while (matchIndex < matchChanges.length && state.index < state.lines.length) {
9498 var change = state.lines[state.index],
9499 match = matchChanges[matchIndex]; // Once we've hit our add, then we are done
9500
9501 if (match[0] === '+') {
9502 break;
9503 }
9504
9505 contextChanges = contextChanges || change[0] !== ' ';
9506 merged.push(match);
9507 matchIndex++; // Consume any additions in the other block as a conflict to attempt
9508 // to pull in the remaining context after this
9509
9510 if (change[0] === '+') {
9511 conflicted = true;
9512
9513 while (change[0] === '+') {
9514 changes.push(change);
9515 change = state.lines[++state.index];
9516 }
9517 }
9518
9519 if (match.substr(1) === change.substr(1)) {
9520 changes.push(change);
9521 state.index++;
9522 } else {
9523 conflicted = true;
9524 }
9525 }
9526
9527 if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
9528 conflicted = true;
9529 }
9530
9531 if (conflicted) {
9532 return changes;
9533 }
9534
9535 while (matchIndex < matchChanges.length) {
9536 merged.push(matchChanges[matchIndex++]);
9537 }
9538
9539 return {
9540 merged: merged,
9541 changes: changes
9542 };
9543 }
9544
9545 function allRemoves(changes) {
9546 return changes.reduce(function (prev, change) {
9547 return prev && change[0] === '-';
9548 }, true);
9549 }
9550
9551 function skipRemoveSuperset(state, removeChanges, delta) {
9552 for (var i = 0; i < delta; i++) {
9553 var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
9554
9555 if (state.lines[state.index + i] !== ' ' + changeContent) {
9556 return false;
9557 }
9558 }
9559
9560 state.index += delta;
9561 return true;
9562 }
9563
9564 function calcOldNewLineCount(lines) {
9565 var oldLines = 0;
9566 var newLines = 0;
9567 lines.forEach(function (line) {
9568 if (typeof line !== 'string') {
9569 var myCount = calcOldNewLineCount(line.mine);
9570 var theirCount = calcOldNewLineCount(line.theirs);
9571
9572 if (oldLines !== undefined) {
9573 if (myCount.oldLines === theirCount.oldLines) {
9574 oldLines += myCount.oldLines;
9575 } else {
9576 oldLines = undefined;
9577 }
9578 }
9579
9580 if (newLines !== undefined) {
9581 if (myCount.newLines === theirCount.newLines) {
9582 newLines += myCount.newLines;
9583 } else {
9584 newLines = undefined;
9585 }
9586 }
9587 } else {
9588 if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
9589 newLines++;
9590 }
9591
9592 if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
9593 oldLines++;
9594 }
9595 }
9596 });
9597 return {
9598 oldLines: oldLines,
9599 newLines: newLines
9600 };
9601 }
9602
9603 // See: http://code.google.com/p/google-diff-match-patch/wiki/API
9604 function convertChangesToDMP(changes) {
9605 var ret = [],
9606 change,
9607 operation;
9608
9609 for (var i = 0; i < changes.length; i++) {
9610 change = changes[i];
9611
9612 if (change.added) {
9613 operation = 1;
9614 } else if (change.removed) {
9615 operation = -1;
9616 } else {
9617 operation = 0;
9618 }
9619
9620 ret.push([operation, change.value]);
9621 }
9622
9623 return ret;
9624 }
9625
9626 function convertChangesToXML(changes) {
9627 var ret = [];
9628
9629 for (var i = 0; i < changes.length; i++) {
9630 var change = changes[i];
9631
9632 if (change.added) {
9633 ret.push('<ins>');
9634 } else if (change.removed) {
9635 ret.push('<del>');
9636 }
9637
9638 ret.push(escapeHTML(change.value));
9639
9640 if (change.added) {
9641 ret.push('</ins>');
9642 } else if (change.removed) {
9643 ret.push('</del>');
9644 }
9645 }
9646
9647 return ret.join('');
9648 }
9649
9650 function escapeHTML(s) {
9651 var n = s;
9652 n = n.replace(/&/g, '&amp;');
9653 n = n.replace(/</g, '&lt;');
9654 n = n.replace(/>/g, '&gt;');
9655 n = n.replace(/"/g, '&quot;');
9656 return n;
9657 }
9658
9659
9660
9661
9662 /***/ }),
9663
9664 /***/ "../node_modules/hast-util-whitespace/index.js":
9665 /*!*****************************************************!*\
9666 !*** ../node_modules/hast-util-whitespace/index.js ***!
9667 \*****************************************************/
9668 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
9669
9670 "use strict";
9671 __webpack_require__.r(__webpack_exports__);
9672 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9673 /* harmony export */ "whitespace": () => (/* binding */ whitespace)
9674 /* harmony export */ });
9675 /**
9676 * Check if the given value is *inter-element whitespace*.
9677 *
9678 * @param {unknown} thing
9679 * Thing to check (typically `Node` or `string`).
9680 * @returns {boolean}
9681 * Whether the `value` is inter-element whitespace (`boolean`): consisting of
9682 * zero or more of space, tab (`\t`), line feed (`\n`), carriage return
9683 * (`\r`), or form feed (`\f`).
9684 * If a node is passed it must be a `Text` node, whose `value` field is
9685 * checked.
9686 */
9687 function whitespace(thing) {
9688 /** @type {string} */
9689 const value =
9690 // @ts-expect-error looks like a node.
9691 thing && typeof thing === 'object' && thing.type === 'text'
9692 ? // @ts-expect-error looks like a text.
9693 thing.value || ''
9694 : thing
9695
9696 // HTML whitespace expression.
9697 // See <https://infra.spec.whatwg.org/#ascii-whitespace>.
9698 return typeof value === 'string' && value.replace(/[ \t\n\f\r]/g, '') === ''
9699 }
9700
9701
9702 /***/ }),
9703
9704 /***/ "../node_modules/is-plain-obj/index.js":
9705 /*!*********************************************!*\
9706 !*** ../node_modules/is-plain-obj/index.js ***!
9707 \*********************************************/
9708 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
9709
9710 "use strict";
9711 __webpack_require__.r(__webpack_exports__);
9712 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9713 /* harmony export */ "default": () => (/* binding */ isPlainObject)
9714 /* harmony export */ });
9715 function isPlainObject(value) {
9716 if (typeof value !== 'object' || value === null) {
9717 return false;
9718 }
9719
9720 const prototype = Object.getPrototypeOf(value);
9721 return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
9722 }
9723
9724
9725 /***/ }),
9726
9727 /***/ "../node_modules/mdast-util-definitions/lib/index.js":
9728 /*!***********************************************************!*\
9729 !*** ../node_modules/mdast-util-definitions/lib/index.js ***!
9730 \***********************************************************/
9731 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
9732
9733 "use strict";
9734 __webpack_require__.r(__webpack_exports__);
9735 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9736 /* harmony export */ "definitions": () => (/* binding */ definitions)
9737 /* harmony export */ });
9738 /* harmony import */ var unist_util_visit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-visit */ "../node_modules/unist-util-visit/lib/index.js");
9739 /**
9740 * @typedef {import('mdast').Root} Root
9741 * @typedef {import('mdast').Content} Content
9742 * @typedef {import('mdast').Definition} Definition
9743 */
9744
9745 /**
9746 * @typedef {Root | Content} Node
9747 *
9748 * @callback GetDefinition
9749 * Get a definition by identifier.
9750 * @param {string | null | undefined} [identifier]
9751 * Identifier of definition.
9752 * @returns {Definition | null}
9753 * Definition corresponding to `identifier` or `null`.
9754 */
9755
9756
9757
9758 const own = {}.hasOwnProperty
9759
9760 /**
9761 * Find definitions in `tree`.
9762 *
9763 * Uses CommonMark precedence, which means that earlier definitions are
9764 * preferred over duplicate later definitions.
9765 *
9766 * @param {Node} tree
9767 * Tree to check.
9768 * @returns {GetDefinition}
9769 * Getter.
9770 */
9771 function definitions(tree) {
9772 /** @type {Record<string, Definition>} */
9773 const cache = Object.create(null)
9774
9775 if (!tree || !tree.type) {
9776 throw new Error('mdast-util-definitions expected node')
9777 }
9778
9779 (0,unist_util_visit__WEBPACK_IMPORTED_MODULE_0__.visit)(tree, 'definition', (definition) => {
9780 const id = clean(definition.identifier)
9781 if (id && !own.call(cache, id)) {
9782 cache[id] = definition
9783 }
9784 })
9785
9786 return definition
9787
9788 /** @type {GetDefinition} */
9789 function definition(identifier) {
9790 const id = clean(identifier)
9791 // To do: next major: return `undefined` when not found.
9792 return id && own.call(cache, id) ? cache[id] : null
9793 }
9794 }
9795
9796 /**
9797 * @param {string | null | undefined} [value]
9798 * @returns {string}
9799 */
9800 function clean(value) {
9801 return String(value || '').toUpperCase()
9802 }
9803
9804
9805 /***/ }),
9806
9807 /***/ "../node_modules/mdast-util-from-markdown/dev/lib/index.js":
9808 /*!*****************************************************************!*\
9809 !*** ../node_modules/mdast-util-from-markdown/dev/lib/index.js ***!
9810 \*****************************************************************/
9811 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
9812
9813 "use strict";
9814 __webpack_require__.r(__webpack_exports__);
9815 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9816 /* harmony export */ "fromMarkdown": () => (/* binding */ fromMarkdown)
9817 /* harmony export */ });
9818 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
9819 /* harmony import */ var mdast_util_to_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! mdast-util-to-string */ "../node_modules/mdast-util-to-string/lib/index.js");
9820 /* harmony import */ var micromark_lib_parse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark/lib/parse.js */ "../node_modules/micromark/dev/lib/parse.js");
9821 /* harmony import */ var micromark_lib_preprocess_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark/lib/preprocess.js */ "../node_modules/micromark/dev/lib/preprocess.js");
9822 /* harmony import */ var micromark_lib_postprocess_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark/lib/postprocess.js */ "../node_modules/micromark/dev/lib/postprocess.js");
9823 /* harmony import */ var micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! micromark-util-decode-numeric-character-reference */ "../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js");
9824 /* harmony import */ var micromark_util_decode_string__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! micromark-util-decode-string */ "../node_modules/micromark-util-decode-string/dev/index.js");
9825 /* harmony import */ var micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-util-normalize-identifier */ "../node_modules/micromark-util-normalize-identifier/dev/index.js");
9826 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
9827 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
9828 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
9829 /* harmony import */ var decode_named_character_reference__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! decode-named-character-reference */ "../node_modules/decode-named-character-reference/index.dom.js");
9830 /* harmony import */ var unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! unist-util-stringify-position */ "../node_modules/unist-util-stringify-position/lib/index.js");
9831 /**
9832 * @typedef {import('micromark-util-types').Encoding} Encoding
9833 * @typedef {import('micromark-util-types').Event} Event
9834 * @typedef {import('micromark-util-types').ParseOptions} ParseOptions
9835 * @typedef {import('micromark-util-types').Token} Token
9836 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
9837 * @typedef {import('micromark-util-types').Value} Value
9838 *
9839 * @typedef {import('unist').Parent} UnistParent
9840 * @typedef {import('unist').Point} Point
9841 *
9842 * @typedef {import('mdast').PhrasingContent} PhrasingContent
9843 * @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent
9844 * @typedef {import('mdast').Content} Content
9845 * @typedef {import('mdast').Break} Break
9846 * @typedef {import('mdast').Blockquote} Blockquote
9847 * @typedef {import('mdast').Code} Code
9848 * @typedef {import('mdast').Definition} Definition
9849 * @typedef {import('mdast').Emphasis} Emphasis
9850 * @typedef {import('mdast').Heading} Heading
9851 * @typedef {import('mdast').HTML} HTML
9852 * @typedef {import('mdast').Image} Image
9853 * @typedef {import('mdast').ImageReference} ImageReference
9854 * @typedef {import('mdast').InlineCode} InlineCode
9855 * @typedef {import('mdast').Link} Link
9856 * @typedef {import('mdast').LinkReference} LinkReference
9857 * @typedef {import('mdast').List} List
9858 * @typedef {import('mdast').ListItem} ListItem
9859 * @typedef {import('mdast').Paragraph} Paragraph
9860 * @typedef {import('mdast').Root} Root
9861 * @typedef {import('mdast').Strong} Strong
9862 * @typedef {import('mdast').Text} Text
9863 * @typedef {import('mdast').ThematicBreak} ThematicBreak
9864 * @typedef {import('mdast').ReferenceType} ReferenceType
9865 * @typedef {import('../index.js').CompileData} CompileData
9866 */
9867
9868 /**
9869 * @typedef {Root | Content} Node
9870 * @typedef {Extract<Node, UnistParent>} Parent
9871 *
9872 * @typedef {Omit<UnistParent, 'type' | 'children'> & {type: 'fragment', children: Array<PhrasingContent>}} Fragment
9873 */
9874
9875 /**
9876 * @callback Transform
9877 * Extra transform, to change the AST afterwards.
9878 * @param {Root} tree
9879 * Tree to transform.
9880 * @returns {Root | undefined | null | void}
9881 * New tree or nothing (in which case the current tree is used).
9882 *
9883 * @callback Handle
9884 * Handle a token.
9885 * @param {CompileContext} this
9886 * Context.
9887 * @param {Token} token
9888 * Current token.
9889 * @returns {void}
9890 * Nothing.
9891 *
9892 * @typedef {Record<string, Handle>} Handles
9893 * Token types mapping to handles
9894 *
9895 * @callback OnEnterError
9896 * Handle the case where the `right` token is open, but it is closed (by the
9897 * `left` token) or because we reached the end of the document.
9898 * @param {Omit<CompileContext, 'sliceSerialize'>} this
9899 * Context.
9900 * @param {Token | undefined} left
9901 * Left token.
9902 * @param {Token} right
9903 * Right token.
9904 * @returns {void}
9905 * Nothing.
9906 *
9907 * @callback OnExitError
9908 * Handle the case where the `right` token is open but it is closed by
9909 * exiting the `left` token.
9910 * @param {Omit<CompileContext, 'sliceSerialize'>} this
9911 * Context.
9912 * @param {Token} left
9913 * Left token.
9914 * @param {Token} right
9915 * Right token.
9916 * @returns {void}
9917 * Nothing.
9918 *
9919 * @typedef {[Token, OnEnterError | undefined]} TokenTuple
9920 * Open token on the stack, with an optional error handler for when
9921 * that token isn’t closed properly.
9922 */
9923
9924 /**
9925 * @typedef Config
9926 * Configuration.
9927 *
9928 * We have our defaults, but extensions will add more.
9929 * @property {Array<string>} canContainEols
9930 * Token types where line endings are used.
9931 * @property {Handles} enter
9932 * Opening handles.
9933 * @property {Handles} exit
9934 * Closing handles.
9935 * @property {Array<Transform>} transforms
9936 * Tree transforms.
9937 *
9938 * @typedef {Partial<Config>} Extension
9939 * Change how markdown tokens from micromark are turned into mdast.
9940 *
9941 * @typedef CompileContext
9942 * mdast compiler context.
9943 * @property {Array<Node | Fragment>} stack
9944 * Stack of nodes.
9945 * @property {Array<TokenTuple>} tokenStack
9946 * Stack of tokens.
9947 * @property {<Key extends keyof CompileData>(key: Key) => CompileData[Key]} getData
9948 * Get data from the key/value store.
9949 * @property {<Key extends keyof CompileData>(key: Key, value?: CompileData[Key]) => void} setData
9950 * Set data into the key/value store.
9951 * @property {(this: CompileContext) => void} buffer
9952 * Capture some of the output data.
9953 * @property {(this: CompileContext) => string} resume
9954 * Stop capturing and access the output data.
9955 * @property {<Kind extends Node>(this: CompileContext, node: Kind, token: Token, onError?: OnEnterError) => Kind} enter
9956 * Enter a token.
9957 * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit
9958 * Exit a token.
9959 * @property {TokenizeContext['sliceSerialize']} sliceSerialize
9960 * Get the string value of a token.
9961 * @property {Config} config
9962 * Configuration.
9963 *
9964 * @typedef FromMarkdownOptions
9965 * Configuration for how to build mdast.
9966 * @property {Array<Extension | Array<Extension>> | null | undefined} [mdastExtensions]
9967 * Extensions for this utility to change how tokens are turned into a tree.
9968 *
9969 * @typedef {ParseOptions & FromMarkdownOptions} Options
9970 * Configuration.
9971 */
9972
9973 // To do: micromark: create a registry of tokens?
9974 // To do: next major: don’t return given `Node` from `enter`.
9975 // To do: next major: remove setter/getter.
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991 const own = {}.hasOwnProperty
9992
9993 /**
9994 * @param value
9995 * Markdown to parse.
9996 * @param encoding
9997 * Character encoding for when `value` is `Buffer`.
9998 * @param options
9999 * Configuration.
10000 * @returns
10001 * mdast tree.
10002 */
10003 const fromMarkdown =
10004 /**
10005 * @type {(
10006 * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
10007 * ((value: Value, options?: Options | null | undefined) => Root)
10008 * )}
10009 */
10010 (
10011 /**
10012 * @param {Value} value
10013 * @param {Encoding | Options | null | undefined} [encoding]
10014 * @param {Options | null | undefined} [options]
10015 * @returns {Root}
10016 */
10017 function (value, encoding, options) {
10018 if (typeof encoding !== 'string') {
10019 options = encoding
10020 encoding = undefined
10021 }
10022
10023 return compiler(options)(
10024 (0,micromark_lib_postprocess_js__WEBPACK_IMPORTED_MODULE_1__.postprocess)(
10025 // @ts-expect-error: micromark types need to accept `null`.
10026 (0,micromark_lib_parse_js__WEBPACK_IMPORTED_MODULE_2__.parse)(options).document().write((0,micromark_lib_preprocess_js__WEBPACK_IMPORTED_MODULE_3__.preprocess)()(value, encoding, true))
10027 )
10028 )
10029 }
10030 )
10031
10032 /**
10033 * Note this compiler only understand complete buffering, not streaming.
10034 *
10035 * @param {Options | null | undefined} [options]
10036 */
10037 function compiler(options) {
10038 /** @type {Config} */
10039 const config = {
10040 transforms: [],
10041 canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],
10042 enter: {
10043 autolink: opener(link),
10044 autolinkProtocol: onenterdata,
10045 autolinkEmail: onenterdata,
10046 atxHeading: opener(heading),
10047 blockQuote: opener(blockQuote),
10048 characterEscape: onenterdata,
10049 characterReference: onenterdata,
10050 codeFenced: opener(codeFlow),
10051 codeFencedFenceInfo: buffer,
10052 codeFencedFenceMeta: buffer,
10053 codeIndented: opener(codeFlow, buffer),
10054 codeText: opener(codeText, buffer),
10055 codeTextData: onenterdata,
10056 data: onenterdata,
10057 codeFlowValue: onenterdata,
10058 definition: opener(definition),
10059 definitionDestinationString: buffer,
10060 definitionLabelString: buffer,
10061 definitionTitleString: buffer,
10062 emphasis: opener(emphasis),
10063 hardBreakEscape: opener(hardBreak),
10064 hardBreakTrailing: opener(hardBreak),
10065 htmlFlow: opener(html, buffer),
10066 htmlFlowData: onenterdata,
10067 htmlText: opener(html, buffer),
10068 htmlTextData: onenterdata,
10069 image: opener(image),
10070 label: buffer,
10071 link: opener(link),
10072 listItem: opener(listItem),
10073 listItemValue: onenterlistitemvalue,
10074 listOrdered: opener(list, onenterlistordered),
10075 listUnordered: opener(list),
10076 paragraph: opener(paragraph),
10077 reference: onenterreference,
10078 referenceString: buffer,
10079 resourceDestinationString: buffer,
10080 resourceTitleString: buffer,
10081 setextHeading: opener(heading),
10082 strong: opener(strong),
10083 thematicBreak: opener(thematicBreak)
10084 },
10085 exit: {
10086 atxHeading: closer(),
10087 atxHeadingSequence: onexitatxheadingsequence,
10088 autolink: closer(),
10089 autolinkEmail: onexitautolinkemail,
10090 autolinkProtocol: onexitautolinkprotocol,
10091 blockQuote: closer(),
10092 characterEscapeValue: onexitdata,
10093 characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
10094 characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
10095 characterReferenceValue: onexitcharacterreferencevalue,
10096 codeFenced: closer(onexitcodefenced),
10097 codeFencedFence: onexitcodefencedfence,
10098 codeFencedFenceInfo: onexitcodefencedfenceinfo,
10099 codeFencedFenceMeta: onexitcodefencedfencemeta,
10100 codeFlowValue: onexitdata,
10101 codeIndented: closer(onexitcodeindented),
10102 codeText: closer(onexitcodetext),
10103 codeTextData: onexitdata,
10104 data: onexitdata,
10105 definition: closer(),
10106 definitionDestinationString: onexitdefinitiondestinationstring,
10107 definitionLabelString: onexitdefinitionlabelstring,
10108 definitionTitleString: onexitdefinitiontitlestring,
10109 emphasis: closer(),
10110 hardBreakEscape: closer(onexithardbreak),
10111 hardBreakTrailing: closer(onexithardbreak),
10112 htmlFlow: closer(onexithtmlflow),
10113 htmlFlowData: onexitdata,
10114 htmlText: closer(onexithtmltext),
10115 htmlTextData: onexitdata,
10116 image: closer(onexitimage),
10117 label: onexitlabel,
10118 labelText: onexitlabeltext,
10119 lineEnding: onexitlineending,
10120 link: closer(onexitlink),
10121 listItem: closer(),
10122 listOrdered: closer(),
10123 listUnordered: closer(),
10124 paragraph: closer(),
10125 referenceString: onexitreferencestring,
10126 resourceDestinationString: onexitresourcedestinationstring,
10127 resourceTitleString: onexitresourcetitlestring,
10128 resource: onexitresource,
10129 setextHeading: closer(onexitsetextheading),
10130 setextHeadingLineSequence: onexitsetextheadinglinesequence,
10131 setextHeadingText: onexitsetextheadingtext,
10132 strong: closer(),
10133 thematicBreak: closer()
10134 }
10135 }
10136
10137 configure(config, (options || {}).mdastExtensions || [])
10138
10139 /** @type {CompileData} */
10140 const data = {}
10141
10142 return compile
10143
10144 /**
10145 * Turn micromark events into an mdast tree.
10146 *
10147 * @param {Array<Event>} events
10148 * Events.
10149 * @returns {Root}
10150 * mdast tree.
10151 */
10152 function compile(events) {
10153 /** @type {Root} */
10154 let tree = {type: 'root', children: []}
10155 /** @type {Omit<CompileContext, 'sliceSerialize'>} */
10156 const context = {
10157 stack: [tree],
10158 tokenStack: [],
10159 config,
10160 enter,
10161 exit,
10162 buffer,
10163 resume,
10164 setData,
10165 getData
10166 }
10167 /** @type {Array<number>} */
10168 const listStack = []
10169 let index = -1
10170
10171 while (++index < events.length) {
10172 // We preprocess lists to add `listItem` tokens, and to infer whether
10173 // items the list itself are spread out.
10174 if (
10175 events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listOrdered ||
10176 events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listUnordered
10177 ) {
10178 if (events[index][0] === 'enter') {
10179 listStack.push(index)
10180 } else {
10181 const tail = listStack.pop()
10182 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof tail === 'number', 'expected list ot be open')
10183 index = prepareList(events, tail, index)
10184 }
10185 }
10186 }
10187
10188 index = -1
10189
10190 while (++index < events.length) {
10191 const handler = config[events[index][0]]
10192
10193 if (own.call(handler, events[index][1].type)) {
10194 handler[events[index][1].type].call(
10195 Object.assign(
10196 {sliceSerialize: events[index][2].sliceSerialize},
10197 context
10198 ),
10199 events[index][1]
10200 )
10201 }
10202 }
10203
10204 // Handle tokens still being open.
10205 if (context.tokenStack.length > 0) {
10206 const tail = context.tokenStack[context.tokenStack.length - 1]
10207 const handler = tail[1] || defaultOnError
10208 handler.call(context, undefined, tail[0])
10209 }
10210
10211 // Figure out `root` position.
10212 tree.position = {
10213 start: point(
10214 events.length > 0 ? events[0][1].start : {line: 1, column: 1, offset: 0}
10215 ),
10216 end: point(
10217 events.length > 0
10218 ? events[events.length - 2][1].end
10219 : {line: 1, column: 1, offset: 0}
10220 )
10221 }
10222
10223 // Call transforms.
10224 index = -1
10225 while (++index < config.transforms.length) {
10226 tree = config.transforms[index](tree) || tree
10227 }
10228
10229 return tree
10230 }
10231
10232 /**
10233 * @param {Array<Event>} events
10234 * @param {number} start
10235 * @param {number} length
10236 * @returns {number}
10237 */
10238 function prepareList(events, start, length) {
10239 let index = start - 1
10240 let containerBalance = -1
10241 let listSpread = false
10242 /** @type {Token | undefined} */
10243 let listItem
10244 /** @type {number | undefined} */
10245 let lineIndex
10246 /** @type {number | undefined} */
10247 let firstBlankLineIndex
10248 /** @type {boolean | undefined} */
10249 let atMarker
10250
10251 while (++index <= length) {
10252 const event = events[index]
10253
10254 if (
10255 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listUnordered ||
10256 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listOrdered ||
10257 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuote
10258 ) {
10259 if (event[0] === 'enter') {
10260 containerBalance++
10261 } else {
10262 containerBalance--
10263 }
10264
10265 atMarker = undefined
10266 } else if (event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank) {
10267 if (event[0] === 'enter') {
10268 if (
10269 listItem &&
10270 !atMarker &&
10271 !containerBalance &&
10272 !firstBlankLineIndex
10273 ) {
10274 firstBlankLineIndex = index
10275 }
10276
10277 atMarker = undefined
10278 }
10279 } else if (
10280 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix ||
10281 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemValue ||
10282 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemMarker ||
10283 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefix ||
10284 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefixWhitespace
10285 ) {
10286 // Empty.
10287 } else {
10288 atMarker = undefined
10289 }
10290
10291 if (
10292 (!containerBalance &&
10293 event[0] === 'enter' &&
10294 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefix) ||
10295 (containerBalance === -1 &&
10296 event[0] === 'exit' &&
10297 (event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listUnordered ||
10298 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listOrdered))
10299 ) {
10300 if (listItem) {
10301 let tailIndex = index
10302 lineIndex = undefined
10303
10304 while (tailIndex--) {
10305 const tailEvent = events[tailIndex]
10306
10307 if (
10308 tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding ||
10309 tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank
10310 ) {
10311 if (tailEvent[0] === 'exit') continue
10312
10313 if (lineIndex) {
10314 events[lineIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank
10315 listSpread = true
10316 }
10317
10318 tailEvent[1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding
10319 lineIndex = tailIndex
10320 } else if (
10321 tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix ||
10322 tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuotePrefix ||
10323 tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuotePrefixWhitespace ||
10324 tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuoteMarker ||
10325 tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemIndent
10326 ) {
10327 // Empty
10328 } else {
10329 break
10330 }
10331 }
10332
10333 if (
10334 firstBlankLineIndex &&
10335 (!lineIndex || firstBlankLineIndex < lineIndex)
10336 ) {
10337 // @ts-expect-error Patched.
10338 listItem._spread = true
10339 }
10340
10341 // Fix position.
10342 listItem.end = Object.assign(
10343 {},
10344 lineIndex ? events[lineIndex][1].start : event[1].end
10345 )
10346
10347 events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])
10348 index++
10349 length++
10350 }
10351
10352 // Create a new list item.
10353 if (event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefix) {
10354 listItem = {
10355 type: 'listItem',
10356 // @ts-expect-error Patched
10357 _spread: false,
10358 start: Object.assign({}, event[1].start)
10359 }
10360 // @ts-expect-error: `listItem` is most definitely defined, TS...
10361 events.splice(index, 0, ['enter', listItem, event[2]])
10362 index++
10363 length++
10364 firstBlankLineIndex = undefined
10365 atMarker = true
10366 }
10367 }
10368 }
10369
10370 // @ts-expect-error Patched.
10371 events[start][1]._spread = listSpread
10372 return length
10373 }
10374
10375 /**
10376 * Set data.
10377 *
10378 * @template {keyof CompileData} Key
10379 * Field type.
10380 * @param {Key} key
10381 * Key of field.
10382 * @param {CompileData[Key]} [value]
10383 * New value.
10384 * @returns {void}
10385 * Nothing.
10386 */
10387 function setData(key, value) {
10388 data[key] = value
10389 }
10390
10391 /**
10392 * Get data.
10393 *
10394 * @template {keyof CompileData} Key
10395 * Field type.
10396 * @param {Key} key
10397 * Key of field.
10398 * @returns {CompileData[Key]}
10399 * Value.
10400 */
10401 function getData(key) {
10402 return data[key]
10403 }
10404
10405 /**
10406 * Create an opener handle.
10407 *
10408 * @param {(token: Token) => Node} create
10409 * Create a node.
10410 * @param {Handle} [and]
10411 * Optional function to also run.
10412 * @returns {Handle}
10413 * Handle.
10414 */
10415 function opener(create, and) {
10416 return open
10417
10418 /**
10419 * @this {CompileContext}
10420 * @param {Token} token
10421 * @returns {void}
10422 */
10423 function open(token) {
10424 enter.call(this, create(token), token)
10425 if (and) and.call(this, token)
10426 }
10427 }
10428
10429 /**
10430 * @this {CompileContext}
10431 * @returns {void}
10432 */
10433 function buffer() {
10434 this.stack.push({type: 'fragment', children: []})
10435 }
10436
10437 /**
10438 * @template {Node} Kind
10439 * Node type.
10440 * @this {CompileContext}
10441 * Context.
10442 * @param {Kind} node
10443 * Node to enter.
10444 * @param {Token} token
10445 * Corresponding token.
10446 * @param {OnEnterError | undefined} [errorHandler]
10447 * Handle the case where this token is open, but it is closed by something else.
10448 * @returns {Kind}
10449 * The given node.
10450 */
10451 function enter(node, token, errorHandler) {
10452 const parent = this.stack[this.stack.length - 1]
10453 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(parent, 'expected `parent`')
10454 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('children' in parent, 'expected `parent`')
10455 // @ts-expect-error: Assume `Node` can exist as a child of `parent`.
10456 parent.children.push(node)
10457 this.stack.push(node)
10458 this.tokenStack.push([token, errorHandler])
10459 // @ts-expect-error: `end` will be patched later.
10460 node.position = {start: point(token.start)}
10461 return node
10462 }
10463
10464 /**
10465 * Create a closer handle.
10466 *
10467 * @param {Handle} [and]
10468 * Optional function to also run.
10469 * @returns {Handle}
10470 * Handle.
10471 */
10472 function closer(and) {
10473 return close
10474
10475 /**
10476 * @this {CompileContext}
10477 * @param {Token} token
10478 * @returns {void}
10479 */
10480 function close(token) {
10481 if (and) and.call(this, token)
10482 exit.call(this, token)
10483 }
10484 }
10485
10486 /**
10487 * @this {CompileContext}
10488 * Context.
10489 * @param {Token} token
10490 * Corresponding token.
10491 * @param {OnExitError | undefined} [onExitError]
10492 * Handle the case where another token is open.
10493 * @returns {Node}
10494 * The closed node.
10495 */
10496 function exit(token, onExitError) {
10497 const node = this.stack.pop()
10498 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected `node`')
10499 const open = this.tokenStack.pop()
10500
10501 if (!open) {
10502 throw new Error(
10503 'Cannot close `' +
10504 token.type +
10505 '` (' +
10506 (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: token.start, end: token.end}) +
10507 '): it’s not open'
10508 )
10509 } else if (open[0].type !== token.type) {
10510 if (onExitError) {
10511 onExitError.call(this, token, open[0])
10512 } else {
10513 const handler = open[1] || defaultOnError
10514 handler.call(this, token, open[0])
10515 }
10516 }
10517
10518 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type !== 'fragment', 'unexpected fragment `exit`ed')
10519 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.position, 'expected `position` to be defined')
10520 node.position.end = point(token.end)
10521 return node
10522 }
10523
10524 /**
10525 * @this {CompileContext}
10526 * @returns {string}
10527 */
10528 function resume() {
10529 return (0,mdast_util_to_string__WEBPACK_IMPORTED_MODULE_6__.toString)(this.stack.pop())
10530 }
10531
10532 //
10533 // Handlers.
10534 //
10535
10536 /**
10537 * @this {CompileContext}
10538 * @type {Handle}
10539 */
10540 function onenterlistordered() {
10541 setData('expectingFirstListItemValue', true)
10542 }
10543
10544 /**
10545 * @this {CompileContext}
10546 * @type {Handle}
10547 */
10548 function onenterlistitemvalue(token) {
10549 if (getData('expectingFirstListItemValue')) {
10550 const ancestor = this.stack[this.stack.length - 2]
10551 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(ancestor, 'expected nodes on stack')
10552 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(ancestor.type === 'list', 'expected list on stack')
10553 ancestor.start = Number.parseInt(
10554 this.sliceSerialize(token),
10555 micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__.constants.numericBaseDecimal
10556 )
10557 setData('expectingFirstListItemValue')
10558 }
10559 }
10560
10561 /**
10562 * @this {CompileContext}
10563 * @type {Handle}
10564 */
10565 function onexitcodefencedfenceinfo() {
10566 const data = this.resume()
10567 const node = this.stack[this.stack.length - 1]
10568 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10569 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack')
10570 node.lang = data
10571 }
10572
10573 /**
10574 * @this {CompileContext}
10575 * @type {Handle}
10576 */
10577 function onexitcodefencedfencemeta() {
10578 const data = this.resume()
10579 const node = this.stack[this.stack.length - 1]
10580 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10581 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack')
10582 node.meta = data
10583 }
10584
10585 /**
10586 * @this {CompileContext}
10587 * @type {Handle}
10588 */
10589 function onexitcodefencedfence() {
10590 // Exit if this is the closing fence.
10591 if (getData('flowCodeInside')) return
10592 this.buffer()
10593 setData('flowCodeInside', true)
10594 }
10595
10596 /**
10597 * @this {CompileContext}
10598 * @type {Handle}
10599 */
10600 function onexitcodefenced() {
10601 const data = this.resume()
10602 const node = this.stack[this.stack.length - 1]
10603 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10604 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack')
10605
10606 node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '')
10607 setData('flowCodeInside')
10608 }
10609
10610 /**
10611 * @this {CompileContext}
10612 * @type {Handle}
10613 */
10614 function onexitcodeindented() {
10615 const data = this.resume()
10616 const node = this.stack[this.stack.length - 1]
10617 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10618 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack')
10619
10620 node.value = data.replace(/(\r?\n|\r)$/g, '')
10621 }
10622
10623 /**
10624 * @this {CompileContext}
10625 * @type {Handle}
10626 */
10627 function onexitdefinitionlabelstring(token) {
10628 const label = this.resume()
10629 const node = this.stack[this.stack.length - 1]
10630 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10631 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'definition', 'expected definition on stack')
10632
10633 node.label = label
10634 node.identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__.normalizeIdentifier)(
10635 this.sliceSerialize(token)
10636 ).toLowerCase()
10637 }
10638
10639 /**
10640 * @this {CompileContext}
10641 * @type {Handle}
10642 */
10643 function onexitdefinitiontitlestring() {
10644 const data = this.resume()
10645 const node = this.stack[this.stack.length - 1]
10646 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10647 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'definition', 'expected definition on stack')
10648
10649 node.title = data
10650 }
10651
10652 /**
10653 * @this {CompileContext}
10654 * @type {Handle}
10655 */
10656 function onexitdefinitiondestinationstring() {
10657 const data = this.resume()
10658 const node = this.stack[this.stack.length - 1]
10659 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10660 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'definition', 'expected definition on stack')
10661
10662 node.url = data
10663 }
10664
10665 /**
10666 * @this {CompileContext}
10667 * @type {Handle}
10668 */
10669 function onexitatxheadingsequence(token) {
10670 const node = this.stack[this.stack.length - 1]
10671 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10672 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'heading', 'expected heading on stack')
10673
10674 if (!node.depth) {
10675 const depth = this.sliceSerialize(token).length
10676
10677 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
10678 depth === 1 ||
10679 depth === 2 ||
10680 depth === 3 ||
10681 depth === 4 ||
10682 depth === 5 ||
10683 depth === 6,
10684 'expected `depth` between `1` and `6`'
10685 )
10686
10687 node.depth = depth
10688 }
10689 }
10690
10691 /**
10692 * @this {CompileContext}
10693 * @type {Handle}
10694 */
10695 function onexitsetextheadingtext() {
10696 setData('setextHeadingSlurpLineEnding', true)
10697 }
10698
10699 /**
10700 * @this {CompileContext}
10701 * @type {Handle}
10702 */
10703 function onexitsetextheadinglinesequence(token) {
10704 const node = this.stack[this.stack.length - 1]
10705 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10706 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'heading', 'expected heading on stack')
10707
10708 node.depth =
10709 this.sliceSerialize(token).charCodeAt(0) === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_9__.codes.equalsTo ? 1 : 2
10710 }
10711
10712 /**
10713 * @this {CompileContext}
10714 * @type {Handle}
10715 */
10716 function onexitsetextheading() {
10717 setData('setextHeadingSlurpLineEnding')
10718 }
10719
10720 /**
10721 * @this {CompileContext}
10722 * @type {Handle}
10723 */
10724
10725 function onenterdata(token) {
10726 const node = this.stack[this.stack.length - 1]
10727 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10728 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('children' in node, 'expected parent on stack')
10729
10730 let tail = node.children[node.children.length - 1]
10731
10732 if (!tail || tail.type !== 'text') {
10733 // Add a new text node.
10734 tail = text()
10735 // @ts-expect-error: we’ll add `end` later.
10736 tail.position = {start: point(token.start)}
10737 // @ts-expect-error: Assume `parent` accepts `text`.
10738 node.children.push(tail)
10739 }
10740
10741 this.stack.push(tail)
10742 }
10743
10744 /**
10745 * @this {CompileContext}
10746 * @type {Handle}
10747 */
10748
10749 function onexitdata(token) {
10750 const tail = this.stack.pop()
10751 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail, 'expected a `node` to be on the stack')
10752 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('value' in tail, 'expected a `literal` to be on the stack')
10753 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail.position, 'expected `node` to have an open position')
10754 tail.value += this.sliceSerialize(token)
10755 tail.position.end = point(token.end)
10756 }
10757
10758 /**
10759 * @this {CompileContext}
10760 * @type {Handle}
10761 */
10762
10763 function onexitlineending(token) {
10764 const context = this.stack[this.stack.length - 1]
10765 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(context, 'expected `node`')
10766
10767 // If we’re at a hard break, include the line ending in there.
10768 if (getData('atHardBreak')) {
10769 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('children' in context, 'expected `parent`')
10770 const tail = context.children[context.children.length - 1]
10771 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail.position, 'expected tail to have a starting position')
10772 tail.position.end = point(token.end)
10773 setData('atHardBreak')
10774 return
10775 }
10776
10777 if (
10778 !getData('setextHeadingSlurpLineEnding') &&
10779 config.canContainEols.includes(context.type)
10780 ) {
10781 onenterdata.call(this, token)
10782 onexitdata.call(this, token)
10783 }
10784 }
10785
10786 /**
10787 * @this {CompileContext}
10788 * @type {Handle}
10789 */
10790
10791 function onexithardbreak() {
10792 setData('atHardBreak', true)
10793 }
10794
10795 /**
10796 * @this {CompileContext}
10797 * @type {Handle}
10798 */
10799
10800 function onexithtmlflow() {
10801 const data = this.resume()
10802 const node = this.stack[this.stack.length - 1]
10803 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10804 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'html', 'expected html on stack')
10805
10806 node.value = data
10807 }
10808
10809 /**
10810 * @this {CompileContext}
10811 * @type {Handle}
10812 */
10813
10814 function onexithtmltext() {
10815 const data = this.resume()
10816 const node = this.stack[this.stack.length - 1]
10817 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10818 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'html', 'expected html on stack')
10819
10820 node.value = data
10821 }
10822
10823 /**
10824 * @this {CompileContext}
10825 * @type {Handle}
10826 */
10827
10828 function onexitcodetext() {
10829 const data = this.resume()
10830 const node = this.stack[this.stack.length - 1]
10831 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10832 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'inlineCode', 'expected inline code on stack')
10833
10834 node.value = data
10835 }
10836
10837 /**
10838 * @this {CompileContext}
10839 * @type {Handle}
10840 */
10841
10842 function onexitlink() {
10843 const node = this.stack[this.stack.length - 1]
10844 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10845 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'link', 'expected link on stack')
10846
10847 // Note: there are also `identifier` and `label` fields on this link node!
10848 // These are used / cleaned here.
10849
10850 // To do: clean.
10851 if (getData('inReference')) {
10852 /** @type {ReferenceType} */
10853 const referenceType = getData('referenceType') || 'shortcut'
10854
10855 node.type += 'Reference'
10856 // @ts-expect-error: mutate.
10857 node.referenceType = referenceType
10858 // @ts-expect-error: mutate.
10859 delete node.url
10860 delete node.title
10861 } else {
10862 // @ts-expect-error: mutate.
10863 delete node.identifier
10864 // @ts-expect-error: mutate.
10865 delete node.label
10866 }
10867
10868 setData('referenceType')
10869 }
10870
10871 /**
10872 * @this {CompileContext}
10873 * @type {Handle}
10874 */
10875
10876 function onexitimage() {
10877 const node = this.stack[this.stack.length - 1]
10878 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10879 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'image', 'expected image on stack')
10880
10881 // Note: there are also `identifier` and `label` fields on this link node!
10882 // These are used / cleaned here.
10883
10884 // To do: clean.
10885 if (getData('inReference')) {
10886 /** @type {ReferenceType} */
10887 const referenceType = getData('referenceType') || 'shortcut'
10888
10889 node.type += 'Reference'
10890 // @ts-expect-error: mutate.
10891 node.referenceType = referenceType
10892 // @ts-expect-error: mutate.
10893 delete node.url
10894 delete node.title
10895 } else {
10896 // @ts-expect-error: mutate.
10897 delete node.identifier
10898 // @ts-expect-error: mutate.
10899 delete node.label
10900 }
10901
10902 setData('referenceType')
10903 }
10904
10905 /**
10906 * @this {CompileContext}
10907 * @type {Handle}
10908 */
10909
10910 function onexitlabeltext(token) {
10911 const string = this.sliceSerialize(token)
10912 const ancestor = this.stack[this.stack.length - 2]
10913 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(ancestor, 'expected ancestor on stack')
10914 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
10915 ancestor.type === 'image' || ancestor.type === 'link',
10916 'expected image or link on stack'
10917 )
10918
10919 // @ts-expect-error: stash this on the node, as it might become a reference
10920 // later.
10921 ancestor.label = (0,micromark_util_decode_string__WEBPACK_IMPORTED_MODULE_10__.decodeString)(string)
10922 // @ts-expect-error: same as above.
10923 ancestor.identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__.normalizeIdentifier)(string).toLowerCase()
10924 }
10925
10926 /**
10927 * @this {CompileContext}
10928 * @type {Handle}
10929 */
10930
10931 function onexitlabel() {
10932 const fragment = this.stack[this.stack.length - 1]
10933 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(fragment, 'expected node on stack')
10934 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(fragment.type === 'fragment', 'expected fragment on stack')
10935 const value = this.resume()
10936 const node = this.stack[this.stack.length - 1]
10937 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10938 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
10939 node.type === 'image' || node.type === 'link',
10940 'expected image or link on stack'
10941 )
10942
10943 // Assume a reference.
10944 setData('inReference', true)
10945
10946 if (node.type === 'link') {
10947 /** @type {Array<StaticPhrasingContent>} */
10948 // @ts-expect-error: Assume static phrasing content.
10949 const children = fragment.children
10950
10951 node.children = children
10952 } else {
10953 node.alt = value
10954 }
10955 }
10956
10957 /**
10958 * @this {CompileContext}
10959 * @type {Handle}
10960 */
10961
10962 function onexitresourcedestinationstring() {
10963 const data = this.resume()
10964 const node = this.stack[this.stack.length - 1]
10965 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10966 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
10967 node.type === 'image' || node.type === 'link',
10968 'expected image or link on stack'
10969 )
10970 node.url = data
10971 }
10972
10973 /**
10974 * @this {CompileContext}
10975 * @type {Handle}
10976 */
10977
10978 function onexitresourcetitlestring() {
10979 const data = this.resume()
10980 const node = this.stack[this.stack.length - 1]
10981 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
10982 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
10983 node.type === 'image' || node.type === 'link',
10984 'expected image or link on stack'
10985 )
10986 node.title = data
10987 }
10988
10989 /**
10990 * @this {CompileContext}
10991 * @type {Handle}
10992 */
10993
10994 function onexitresource() {
10995 setData('inReference')
10996 }
10997
10998 /**
10999 * @this {CompileContext}
11000 * @type {Handle}
11001 */
11002
11003 function onenterreference() {
11004 setData('referenceType', 'collapsed')
11005 }
11006
11007 /**
11008 * @this {CompileContext}
11009 * @type {Handle}
11010 */
11011
11012 function onexitreferencestring(token) {
11013 const label = this.resume()
11014 const node = this.stack[this.stack.length - 1]
11015 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
11016 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
11017 node.type === 'image' || node.type === 'link',
11018 'expected image reference or link reference on stack'
11019 )
11020
11021 // @ts-expect-error: stash this on the node, as it might become a reference
11022 // later.
11023 node.label = label
11024 // @ts-expect-error: same as above.
11025 node.identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__.normalizeIdentifier)(
11026 this.sliceSerialize(token)
11027 ).toLowerCase()
11028 setData('referenceType', 'full')
11029 }
11030
11031 /**
11032 * @this {CompileContext}
11033 * @type {Handle}
11034 */
11035
11036 function onexitcharacterreferencemarker(token) {
11037 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
11038 token.type === 'characterReferenceMarkerNumeric' ||
11039 token.type === 'characterReferenceMarkerHexadecimal'
11040 )
11041 setData('characterReferenceType', token.type)
11042 }
11043
11044 /**
11045 * @this {CompileContext}
11046 * @type {Handle}
11047 */
11048 function onexitcharacterreferencevalue(token) {
11049 const data = this.sliceSerialize(token)
11050 const type = getData('characterReferenceType')
11051 /** @type {string} */
11052 let value
11053
11054 if (type) {
11055 value = (0,micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_11__.decodeNumericCharacterReference)(
11056 data,
11057 type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.characterReferenceMarkerNumeric
11058 ? micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__.constants.numericBaseDecimal
11059 : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__.constants.numericBaseHexadecimal
11060 )
11061 setData('characterReferenceType')
11062 } else {
11063 const result = (0,decode_named_character_reference__WEBPACK_IMPORTED_MODULE_12__.decodeNamedCharacterReference)(data)
11064 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(result !== false, 'expected reference to decode')
11065 value = result
11066 }
11067
11068 const tail = this.stack.pop()
11069 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail, 'expected `node`')
11070 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail.position, 'expected `node.position`')
11071 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('value' in tail, 'expected `node.value`')
11072 tail.value += value
11073 tail.position.end = point(token.end)
11074 }
11075
11076 /**
11077 * @this {CompileContext}
11078 * @type {Handle}
11079 */
11080 function onexitautolinkprotocol(token) {
11081 onexitdata.call(this, token)
11082 const node = this.stack[this.stack.length - 1]
11083 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
11084 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'link', 'expected link on stack')
11085
11086 node.url = this.sliceSerialize(token)
11087 }
11088
11089 /**
11090 * @this {CompileContext}
11091 * @type {Handle}
11092 */
11093 function onexitautolinkemail(token) {
11094 onexitdata.call(this, token)
11095 const node = this.stack[this.stack.length - 1]
11096 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack')
11097 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'link', 'expected link on stack')
11098
11099 node.url = 'mailto:' + this.sliceSerialize(token)
11100 }
11101
11102 //
11103 // Creaters.
11104 //
11105
11106 /** @returns {Blockquote} */
11107 function blockQuote() {
11108 return {type: 'blockquote', children: []}
11109 }
11110
11111 /** @returns {Code} */
11112 function codeFlow() {
11113 return {type: 'code', lang: null, meta: null, value: ''}
11114 }
11115
11116 /** @returns {InlineCode} */
11117 function codeText() {
11118 return {type: 'inlineCode', value: ''}
11119 }
11120
11121 /** @returns {Definition} */
11122 function definition() {
11123 return {
11124 type: 'definition',
11125 identifier: '',
11126 label: null,
11127 title: null,
11128 url: ''
11129 }
11130 }
11131
11132 /** @returns {Emphasis} */
11133 function emphasis() {
11134 return {type: 'emphasis', children: []}
11135 }
11136
11137 /** @returns {Heading} */
11138 function heading() {
11139 // @ts-expect-error `depth` will be set later.
11140 return {type: 'heading', depth: undefined, children: []}
11141 }
11142
11143 /** @returns {Break} */
11144 function hardBreak() {
11145 return {type: 'break'}
11146 }
11147
11148 /** @returns {HTML} */
11149 function html() {
11150 return {type: 'html', value: ''}
11151 }
11152
11153 /** @returns {Image} */
11154 function image() {
11155 return {type: 'image', title: null, url: '', alt: null}
11156 }
11157
11158 /** @returns {Link} */
11159 function link() {
11160 return {type: 'link', title: null, url: '', children: []}
11161 }
11162
11163 /**
11164 * @param {Token} token
11165 * @returns {List}
11166 */
11167 function list(token) {
11168 return {
11169 type: 'list',
11170 ordered: token.type === 'listOrdered',
11171 start: null,
11172 // @ts-expect-error Patched.
11173 spread: token._spread,
11174 children: []
11175 }
11176 }
11177
11178 /**
11179 * @param {Token} token
11180 * @returns {ListItem}
11181 */
11182 function listItem(token) {
11183 return {
11184 type: 'listItem',
11185 // @ts-expect-error Patched.
11186 spread: token._spread,
11187 checked: null,
11188 children: []
11189 }
11190 }
11191
11192 /** @returns {Paragraph} */
11193 function paragraph() {
11194 return {type: 'paragraph', children: []}
11195 }
11196
11197 /** @returns {Strong} */
11198 function strong() {
11199 return {type: 'strong', children: []}
11200 }
11201
11202 /** @returns {Text} */
11203 function text() {
11204 return {type: 'text', value: ''}
11205 }
11206
11207 /** @returns {ThematicBreak} */
11208 function thematicBreak() {
11209 return {type: 'thematicBreak'}
11210 }
11211 }
11212
11213 /**
11214 * Copy a point-like value.
11215 *
11216 * @param {Point} d
11217 * Point-like value.
11218 * @returns {Point}
11219 * unist point.
11220 */
11221 function point(d) {
11222 return {line: d.line, column: d.column, offset: d.offset}
11223 }
11224
11225 /**
11226 * @param {Config} combined
11227 * @param {Array<Extension | Array<Extension>>} extensions
11228 * @returns {void}
11229 */
11230 function configure(combined, extensions) {
11231 let index = -1
11232
11233 while (++index < extensions.length) {
11234 const value = extensions[index]
11235
11236 if (Array.isArray(value)) {
11237 configure(combined, value)
11238 } else {
11239 extension(combined, value)
11240 }
11241 }
11242 }
11243
11244 /**
11245 * @param {Config} combined
11246 * @param {Extension} extension
11247 * @returns {void}
11248 */
11249 function extension(combined, extension) {
11250 /** @type {keyof Extension} */
11251 let key
11252
11253 for (key in extension) {
11254 if (own.call(extension, key)) {
11255 if (key === 'canContainEols') {
11256 const right = extension[key]
11257 if (right) {
11258 combined[key].push(...right)
11259 }
11260 } else if (key === 'transforms') {
11261 const right = extension[key]
11262 if (right) {
11263 combined[key].push(...right)
11264 }
11265 } else if (key === 'enter' || key === 'exit') {
11266 const right = extension[key]
11267 if (right) {
11268 Object.assign(combined[key], right)
11269 }
11270 }
11271 }
11272 }
11273 }
11274
11275 /** @type {OnEnterError} */
11276 function defaultOnError(left, right) {
11277 if (left) {
11278 throw new Error(
11279 'Cannot close `' +
11280 left.type +
11281 '` (' +
11282 (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: left.start, end: left.end}) +
11283 '): a different token (`' +
11284 right.type +
11285 '`, ' +
11286 (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: right.start, end: right.end}) +
11287 ') is open'
11288 )
11289 } else {
11290 throw new Error(
11291 'Cannot close document, a token (`' +
11292 right.type +
11293 '`, ' +
11294 (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: right.start, end: right.end}) +
11295 ') is still open'
11296 )
11297 }
11298 }
11299
11300
11301 /***/ }),
11302
11303 /***/ "../node_modules/mdast-util-to-hast/lib/footer.js":
11304 /*!********************************************************!*\
11305 !*** ../node_modules/mdast-util-to-hast/lib/footer.js ***!
11306 \********************************************************/
11307 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11308
11309 "use strict";
11310 __webpack_require__.r(__webpack_exports__);
11311 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11312 /* harmony export */ "footer": () => (/* binding */ footer)
11313 /* harmony export */ });
11314 /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js");
11315 /**
11316 * @typedef {import('hast').Element} Element
11317 * @typedef {import('hast').ElementContent} ElementContent
11318 *
11319 * @typedef {import('./state.js').State} State
11320 */
11321
11322
11323
11324 /**
11325 * Generate a hast footer for called footnote definitions.
11326 *
11327 * @param {State} state
11328 * Info passed around.
11329 * @returns {Element | undefined}
11330 * `section` element or `undefined`.
11331 */
11332 function footer(state) {
11333 /** @type {Array<ElementContent>} */
11334 const listItems = []
11335 let index = -1
11336
11337 while (++index < state.footnoteOrder.length) {
11338 const def = state.footnoteById[state.footnoteOrder[index]]
11339
11340 if (!def) {
11341 continue
11342 }
11343
11344 const content = state.all(def)
11345 const id = String(def.identifier).toUpperCase()
11346 const safeId = (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(id.toLowerCase())
11347 let referenceIndex = 0
11348 /** @type {Array<ElementContent>} */
11349 const backReferences = []
11350
11351 while (++referenceIndex <= state.footnoteCounts[id]) {
11352 /** @type {Element} */
11353 const backReference = {
11354 type: 'element',
11355 tagName: 'a',
11356 properties: {
11357 href:
11358 '#' +
11359 state.clobberPrefix +
11360 'fnref-' +
11361 safeId +
11362 (referenceIndex > 1 ? '-' + referenceIndex : ''),
11363 dataFootnoteBackref: true,
11364 className: ['data-footnote-backref'],
11365 ariaLabel: state.footnoteBackLabel
11366 },
11367 children: [{type: 'text', value: '↩'}]
11368 }
11369
11370 if (referenceIndex > 1) {
11371 backReference.children.push({
11372 type: 'element',
11373 tagName: 'sup',
11374 children: [{type: 'text', value: String(referenceIndex)}]
11375 })
11376 }
11377
11378 if (backReferences.length > 0) {
11379 backReferences.push({type: 'text', value: ' '})
11380 }
11381
11382 backReferences.push(backReference)
11383 }
11384
11385 const tail = content[content.length - 1]
11386
11387 if (tail && tail.type === 'element' && tail.tagName === 'p') {
11388 const tailTail = tail.children[tail.children.length - 1]
11389 if (tailTail && tailTail.type === 'text') {
11390 tailTail.value += ' '
11391 } else {
11392 tail.children.push({type: 'text', value: ' '})
11393 }
11394
11395 tail.children.push(...backReferences)
11396 } else {
11397 content.push(...backReferences)
11398 }
11399
11400 /** @type {Element} */
11401 const listItem = {
11402 type: 'element',
11403 tagName: 'li',
11404 properties: {id: state.clobberPrefix + 'fn-' + safeId},
11405 children: state.wrap(content, true)
11406 }
11407
11408 state.patch(def, listItem)
11409
11410 listItems.push(listItem)
11411 }
11412
11413 if (listItems.length === 0) {
11414 return
11415 }
11416
11417 return {
11418 type: 'element',
11419 tagName: 'section',
11420 properties: {dataFootnotes: true, className: ['footnotes']},
11421 children: [
11422 {
11423 type: 'element',
11424 tagName: state.footnoteLabelTagName,
11425 properties: {
11426 // To do: use structured clone.
11427 ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)),
11428 id: 'footnote-label'
11429 },
11430 children: [{type: 'text', value: state.footnoteLabel}]
11431 },
11432 {type: 'text', value: '\n'},
11433 {
11434 type: 'element',
11435 tagName: 'ol',
11436 properties: {},
11437 children: state.wrap(listItems, true)
11438 },
11439 {type: 'text', value: '\n'}
11440 ]
11441 }
11442 }
11443
11444
11445 /***/ }),
11446
11447 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js":
11448 /*!*********************************************************************!*\
11449 !*** ../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js ***!
11450 \*********************************************************************/
11451 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11452
11453 "use strict";
11454 __webpack_require__.r(__webpack_exports__);
11455 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11456 /* harmony export */ "blockquote": () => (/* binding */ blockquote)
11457 /* harmony export */ });
11458 /**
11459 * @typedef {import('hast').Element} Element
11460 * @typedef {import('mdast').Blockquote} Blockquote
11461 * @typedef {import('../state.js').State} State
11462 */
11463
11464 /**
11465 * Turn an mdast `blockquote` node into hast.
11466 *
11467 * @param {State} state
11468 * Info passed around.
11469 * @param {Blockquote} node
11470 * mdast node.
11471 * @returns {Element}
11472 * hast node.
11473 */
11474 function blockquote(state, node) {
11475 /** @type {Element} */
11476 const result = {
11477 type: 'element',
11478 tagName: 'blockquote',
11479 properties: {},
11480 children: state.wrap(state.all(node), true)
11481 }
11482 state.patch(node, result)
11483 return state.applyData(node, result)
11484 }
11485
11486
11487 /***/ }),
11488
11489 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/break.js":
11490 /*!****************************************************************!*\
11491 !*** ../node_modules/mdast-util-to-hast/lib/handlers/break.js ***!
11492 \****************************************************************/
11493 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11494
11495 "use strict";
11496 __webpack_require__.r(__webpack_exports__);
11497 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11498 /* harmony export */ "hardBreak": () => (/* binding */ hardBreak)
11499 /* harmony export */ });
11500 /**
11501 * @typedef {import('hast').Element} Element
11502 * @typedef {import('hast').Text} Text
11503 * @typedef {import('mdast').Break} Break
11504 * @typedef {import('../state.js').State} State
11505 */
11506
11507 /**
11508 * Turn an mdast `break` node into hast.
11509 *
11510 * @param {State} state
11511 * Info passed around.
11512 * @param {Break} node
11513 * mdast node.
11514 * @returns {Array<Element | Text>}
11515 * hast element content.
11516 */
11517 function hardBreak(state, node) {
11518 /** @type {Element} */
11519 const result = {type: 'element', tagName: 'br', properties: {}, children: []}
11520 state.patch(node, result)
11521 return [state.applyData(node, result), {type: 'text', value: '\n'}]
11522 }
11523
11524
11525 /***/ }),
11526
11527 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/code.js":
11528 /*!***************************************************************!*\
11529 !*** ../node_modules/mdast-util-to-hast/lib/handlers/code.js ***!
11530 \***************************************************************/
11531 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11532
11533 "use strict";
11534 __webpack_require__.r(__webpack_exports__);
11535 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11536 /* harmony export */ "code": () => (/* binding */ code)
11537 /* harmony export */ });
11538 /**
11539 * @typedef {import('hast').Element} Element
11540 * @typedef {import('hast').Properties} Properties
11541 * @typedef {import('mdast').Code} Code
11542 * @typedef {import('../state.js').State} State
11543
11544 */
11545
11546 /**
11547 * Turn an mdast `code` node into hast.
11548 *
11549 * @param {State} state
11550 * Info passed around.
11551 * @param {Code} node
11552 * mdast node.
11553 * @returns {Element}
11554 * hast node.
11555 */
11556 function code(state, node) {
11557 const value = node.value ? node.value + '\n' : ''
11558 // To do: next major, use `node.lang` w/o regex, the splitting’s been going
11559 // on for years in remark now.
11560 const lang = node.lang ? node.lang.match(/^[^ \t]+(?=[ \t]|$)/) : null
11561 /** @type {Properties} */
11562 const properties = {}
11563
11564 if (lang) {
11565 properties.className = ['language-' + lang]
11566 }
11567
11568 // Create `<code>`.
11569 /** @type {Element} */
11570 let result = {
11571 type: 'element',
11572 tagName: 'code',
11573 properties,
11574 children: [{type: 'text', value}]
11575 }
11576
11577 if (node.meta) {
11578 result.data = {meta: node.meta}
11579 }
11580
11581 state.patch(node, result)
11582 result = state.applyData(node, result)
11583
11584 // Create `<pre>`.
11585 result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}
11586 state.patch(node, result)
11587 return result
11588 }
11589
11590
11591 /***/ }),
11592
11593 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/delete.js":
11594 /*!*****************************************************************!*\
11595 !*** ../node_modules/mdast-util-to-hast/lib/handlers/delete.js ***!
11596 \*****************************************************************/
11597 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11598
11599 "use strict";
11600 __webpack_require__.r(__webpack_exports__);
11601 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11602 /* harmony export */ "strikethrough": () => (/* binding */ strikethrough)
11603 /* harmony export */ });
11604 /**
11605 * @typedef {import('hast').Element} Element
11606 * @typedef {import('mdast').Delete} Delete
11607 * @typedef {import('../state.js').State} State
11608
11609 */
11610
11611 /**
11612 * Turn an mdast `delete` node into hast.
11613 *
11614 * @param {State} state
11615 * Info passed around.
11616 * @param {Delete} node
11617 * mdast node.
11618 * @returns {Element}
11619 * hast node.
11620 */
11621 function strikethrough(state, node) {
11622 /** @type {Element} */
11623 const result = {
11624 type: 'element',
11625 tagName: 'del',
11626 properties: {},
11627 children: state.all(node)
11628 }
11629 state.patch(node, result)
11630 return state.applyData(node, result)
11631 }
11632
11633
11634 /***/ }),
11635
11636 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js":
11637 /*!*******************************************************************!*\
11638 !*** ../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js ***!
11639 \*******************************************************************/
11640 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11641
11642 "use strict";
11643 __webpack_require__.r(__webpack_exports__);
11644 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11645 /* harmony export */ "emphasis": () => (/* binding */ emphasis)
11646 /* harmony export */ });
11647 /**
11648 * @typedef {import('hast').Element} Element
11649 * @typedef {import('mdast').Emphasis} Emphasis
11650 * @typedef {import('../state.js').State} State
11651 */
11652
11653 /**
11654 * Turn an mdast `emphasis` node into hast.
11655 *
11656 * @param {State} state
11657 * Info passed around.
11658 * @param {Emphasis} node
11659 * mdast node.
11660 * @returns {Element}
11661 * hast node.
11662 */
11663 function emphasis(state, node) {
11664 /** @type {Element} */
11665 const result = {
11666 type: 'element',
11667 tagName: 'em',
11668 properties: {},
11669 children: state.all(node)
11670 }
11671 state.patch(node, result)
11672 return state.applyData(node, result)
11673 }
11674
11675
11676 /***/ }),
11677
11678 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js":
11679 /*!*****************************************************************************!*\
11680 !*** ../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js ***!
11681 \*****************************************************************************/
11682 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11683
11684 "use strict";
11685 __webpack_require__.r(__webpack_exports__);
11686 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11687 /* harmony export */ "footnoteReference": () => (/* binding */ footnoteReference)
11688 /* harmony export */ });
11689 /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js");
11690 /**
11691 * @typedef {import('mdast').FootnoteReference} FootnoteReference
11692 * @typedef {import('hast').Element} Element
11693 * @typedef {import('../state.js').State} State
11694 */
11695
11696
11697
11698 /**
11699 * Turn an mdast `footnoteReference` node into hast.
11700 *
11701 * @param {State} state
11702 * Info passed around.
11703 * @param {FootnoteReference} node
11704 * mdast node.
11705 * @returns {Element}
11706 * hast node.
11707 */
11708 function footnoteReference(state, node) {
11709 const id = String(node.identifier).toUpperCase()
11710 const safeId = (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(id.toLowerCase())
11711 const index = state.footnoteOrder.indexOf(id)
11712 /** @type {number} */
11713 let counter
11714
11715 if (index === -1) {
11716 state.footnoteOrder.push(id)
11717 state.footnoteCounts[id] = 1
11718 counter = state.footnoteOrder.length
11719 } else {
11720 state.footnoteCounts[id]++
11721 counter = index + 1
11722 }
11723
11724 const reuseCounter = state.footnoteCounts[id]
11725
11726 /** @type {Element} */
11727 const link = {
11728 type: 'element',
11729 tagName: 'a',
11730 properties: {
11731 href: '#' + state.clobberPrefix + 'fn-' + safeId,
11732 id:
11733 state.clobberPrefix +
11734 'fnref-' +
11735 safeId +
11736 (reuseCounter > 1 ? '-' + reuseCounter : ''),
11737 dataFootnoteRef: true,
11738 ariaDescribedBy: ['footnote-label']
11739 },
11740 children: [{type: 'text', value: String(counter)}]
11741 }
11742 state.patch(node, link)
11743
11744 /** @type {Element} */
11745 const sup = {
11746 type: 'element',
11747 tagName: 'sup',
11748 properties: {},
11749 children: [link]
11750 }
11751 state.patch(node, sup)
11752 return state.applyData(node, sup)
11753 }
11754
11755
11756 /***/ }),
11757
11758 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/footnote.js":
11759 /*!*******************************************************************!*\
11760 !*** ../node_modules/mdast-util-to-hast/lib/handlers/footnote.js ***!
11761 \*******************************************************************/
11762 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11763
11764 "use strict";
11765 __webpack_require__.r(__webpack_exports__);
11766 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11767 /* harmony export */ "footnote": () => (/* binding */ footnote)
11768 /* harmony export */ });
11769 /* harmony import */ var _footnote_reference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./footnote-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js");
11770 /**
11771 * @typedef {import('hast').Element} Element
11772 * @typedef {import('mdast').Footnote} Footnote
11773 * @typedef {import('../state.js').State} State
11774 */
11775
11776
11777
11778 // To do: when both:
11779 // * <https://github.com/micromark/micromark-extension-footnote>
11780 // * <https://github.com/syntax-tree/mdast-util-footnote>
11781 // …are archived, remove this (also from mdast).
11782 // These inline notes are not used in GFM.
11783
11784 /**
11785 * Turn an mdast `footnote` node into hast.
11786 *
11787 * @param {State} state
11788 * Info passed around.
11789 * @param {Footnote} node
11790 * mdast node.
11791 * @returns {Element}
11792 * hast node.
11793 */
11794 function footnote(state, node) {
11795 const footnoteById = state.footnoteById
11796 let no = 1
11797
11798 while (no in footnoteById) no++
11799
11800 const identifier = String(no)
11801
11802 footnoteById[identifier] = {
11803 type: 'footnoteDefinition',
11804 identifier,
11805 children: [{type: 'paragraph', children: node.children}],
11806 position: node.position
11807 }
11808
11809 return (0,_footnote_reference_js__WEBPACK_IMPORTED_MODULE_0__.footnoteReference)(state, {
11810 type: 'footnoteReference',
11811 identifier,
11812 position: node.position
11813 })
11814 }
11815
11816
11817 /***/ }),
11818
11819 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/heading.js":
11820 /*!******************************************************************!*\
11821 !*** ../node_modules/mdast-util-to-hast/lib/handlers/heading.js ***!
11822 \******************************************************************/
11823 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11824
11825 "use strict";
11826 __webpack_require__.r(__webpack_exports__);
11827 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11828 /* harmony export */ "heading": () => (/* binding */ heading)
11829 /* harmony export */ });
11830 /**
11831 * @typedef {import('hast').Element} Element
11832 * @typedef {import('mdast').Heading} Heading
11833 * @typedef {import('../state.js').State} State
11834 */
11835
11836 /**
11837 * Turn an mdast `heading` node into hast.
11838 *
11839 * @param {State} state
11840 * Info passed around.
11841 * @param {Heading} node
11842 * mdast node.
11843 * @returns {Element}
11844 * hast node.
11845 */
11846 function heading(state, node) {
11847 /** @type {Element} */
11848 const result = {
11849 type: 'element',
11850 tagName: 'h' + node.depth,
11851 properties: {},
11852 children: state.all(node)
11853 }
11854 state.patch(node, result)
11855 return state.applyData(node, result)
11856 }
11857
11858
11859 /***/ }),
11860
11861 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/html.js":
11862 /*!***************************************************************!*\
11863 !*** ../node_modules/mdast-util-to-hast/lib/handlers/html.js ***!
11864 \***************************************************************/
11865 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11866
11867 "use strict";
11868 __webpack_require__.r(__webpack_exports__);
11869 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11870 /* harmony export */ "html": () => (/* binding */ html)
11871 /* harmony export */ });
11872 /**
11873 * @typedef {import('hast').Element} Element
11874 * @typedef {import('mdast').HTML} Html
11875 * @typedef {import('../state.js').State} State
11876 * @typedef {import('../../index.js').Raw} Raw
11877 */
11878
11879 /**
11880 * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise
11881 * nothing).
11882 *
11883 * @param {State} state
11884 * Info passed around.
11885 * @param {Html} node
11886 * mdast node.
11887 * @returns {Raw | Element | null}
11888 * hast node.
11889 */
11890 function html(state, node) {
11891 if (state.dangerous) {
11892 /** @type {Raw} */
11893 const result = {type: 'raw', value: node.value}
11894 state.patch(node, result)
11895 return state.applyData(node, result)
11896 }
11897
11898 // To do: next major: return `undefined`.
11899 return null
11900 }
11901
11902
11903 /***/ }),
11904
11905 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js":
11906 /*!**************************************************************************!*\
11907 !*** ../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js ***!
11908 \**************************************************************************/
11909 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11910
11911 "use strict";
11912 __webpack_require__.r(__webpack_exports__);
11913 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11914 /* harmony export */ "imageReference": () => (/* binding */ imageReference)
11915 /* harmony export */ });
11916 /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js");
11917 /* harmony import */ var _revert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../revert.js */ "../node_modules/mdast-util-to-hast/lib/revert.js");
11918 /**
11919 * @typedef {import('hast').ElementContent} ElementContent
11920 * @typedef {import('hast').Element} Element
11921 * @typedef {import('hast').Properties} Properties
11922 * @typedef {import('mdast').ImageReference} ImageReference
11923 * @typedef {import('../state.js').State} State
11924 */
11925
11926
11927
11928
11929 /**
11930 * Turn an mdast `imageReference` node into hast.
11931 *
11932 * @param {State} state
11933 * Info passed around.
11934 * @param {ImageReference} node
11935 * mdast node.
11936 * @returns {ElementContent | Array<ElementContent>}
11937 * hast node.
11938 */
11939 function imageReference(state, node) {
11940 const def = state.definition(node.identifier)
11941
11942 if (!def) {
11943 return (0,_revert_js__WEBPACK_IMPORTED_MODULE_0__.revert)(state, node)
11944 }
11945
11946 /** @type {Properties} */
11947 const properties = {src: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__.normalizeUri)(def.url || ''), alt: node.alt}
11948
11949 if (def.title !== null && def.title !== undefined) {
11950 properties.title = def.title
11951 }
11952
11953 /** @type {Element} */
11954 const result = {type: 'element', tagName: 'img', properties, children: []}
11955 state.patch(node, result)
11956 return state.applyData(node, result)
11957 }
11958
11959
11960 /***/ }),
11961
11962 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/image.js":
11963 /*!****************************************************************!*\
11964 !*** ../node_modules/mdast-util-to-hast/lib/handlers/image.js ***!
11965 \****************************************************************/
11966 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11967
11968 "use strict";
11969 __webpack_require__.r(__webpack_exports__);
11970 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11971 /* harmony export */ "image": () => (/* binding */ image)
11972 /* harmony export */ });
11973 /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js");
11974 /**
11975 * @typedef {import('hast').Element} Element
11976 * @typedef {import('hast').Properties} Properties
11977 * @typedef {import('mdast').Image} Image
11978 * @typedef {import('../state.js').State} State
11979 */
11980
11981
11982
11983 /**
11984 * Turn an mdast `image` node into hast.
11985 *
11986 * @param {State} state
11987 * Info passed around.
11988 * @param {Image} node
11989 * mdast node.
11990 * @returns {Element}
11991 * hast node.
11992 */
11993 function image(state, node) {
11994 /** @type {Properties} */
11995 const properties = {src: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(node.url)}
11996
11997 if (node.alt !== null && node.alt !== undefined) {
11998 properties.alt = node.alt
11999 }
12000
12001 if (node.title !== null && node.title !== undefined) {
12002 properties.title = node.title
12003 }
12004
12005 /** @type {Element} */
12006 const result = {type: 'element', tagName: 'img', properties, children: []}
12007 state.patch(node, result)
12008 return state.applyData(node, result)
12009 }
12010
12011
12012 /***/ }),
12013
12014 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/index.js":
12015 /*!****************************************************************!*\
12016 !*** ../node_modules/mdast-util-to-hast/lib/handlers/index.js ***!
12017 \****************************************************************/
12018 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12019
12020 "use strict";
12021 __webpack_require__.r(__webpack_exports__);
12022 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12023 /* harmony export */ "handlers": () => (/* binding */ handlers)
12024 /* harmony export */ });
12025 /* harmony import */ var _blockquote_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blockquote.js */ "../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js");
12026 /* harmony import */ var _break_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./break.js */ "../node_modules/mdast-util-to-hast/lib/handlers/break.js");
12027 /* harmony import */ var _code_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./code.js */ "../node_modules/mdast-util-to-hast/lib/handlers/code.js");
12028 /* harmony import */ var _delete_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./delete.js */ "../node_modules/mdast-util-to-hast/lib/handlers/delete.js");
12029 /* harmony import */ var _emphasis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emphasis.js */ "../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js");
12030 /* harmony import */ var _footnote_reference_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./footnote-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js");
12031 /* harmony import */ var _footnote_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./footnote.js */ "../node_modules/mdast-util-to-hast/lib/handlers/footnote.js");
12032 /* harmony import */ var _heading_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./heading.js */ "../node_modules/mdast-util-to-hast/lib/handlers/heading.js");
12033 /* harmony import */ var _html_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./html.js */ "../node_modules/mdast-util-to-hast/lib/handlers/html.js");
12034 /* harmony import */ var _image_reference_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./image-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js");
12035 /* harmony import */ var _image_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./image.js */ "../node_modules/mdast-util-to-hast/lib/handlers/image.js");
12036 /* harmony import */ var _inline_code_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./inline-code.js */ "../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js");
12037 /* harmony import */ var _link_reference_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./link-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js");
12038 /* harmony import */ var _link_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./link.js */ "../node_modules/mdast-util-to-hast/lib/handlers/link.js");
12039 /* harmony import */ var _list_item_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./list-item.js */ "../node_modules/mdast-util-to-hast/lib/handlers/list-item.js");
12040 /* harmony import */ var _list_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./list.js */ "../node_modules/mdast-util-to-hast/lib/handlers/list.js");
12041 /* harmony import */ var _paragraph_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./paragraph.js */ "../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js");
12042 /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./root.js */ "../node_modules/mdast-util-to-hast/lib/handlers/root.js");
12043 /* harmony import */ var _strong_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./strong.js */ "../node_modules/mdast-util-to-hast/lib/handlers/strong.js");
12044 /* harmony import */ var _table_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./table.js */ "../node_modules/mdast-util-to-hast/lib/handlers/table.js");
12045 /* harmony import */ var _table_row_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./table-row.js */ "../node_modules/mdast-util-to-hast/lib/handlers/table-row.js");
12046 /* harmony import */ var _table_cell_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./table-cell.js */ "../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js");
12047 /* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./text.js */ "../node_modules/mdast-util-to-hast/lib/handlers/text.js");
12048 /* harmony import */ var _thematic_break_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./thematic-break.js */ "../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js");
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074 /**
12075 * Default handlers for nodes.
12076 */
12077 const handlers = {
12078 blockquote: _blockquote_js__WEBPACK_IMPORTED_MODULE_0__.blockquote,
12079 break: _break_js__WEBPACK_IMPORTED_MODULE_1__.hardBreak,
12080 code: _code_js__WEBPACK_IMPORTED_MODULE_2__.code,
12081 delete: _delete_js__WEBPACK_IMPORTED_MODULE_3__.strikethrough,
12082 emphasis: _emphasis_js__WEBPACK_IMPORTED_MODULE_4__.emphasis,
12083 footnoteReference: _footnote_reference_js__WEBPACK_IMPORTED_MODULE_5__.footnoteReference,
12084 footnote: _footnote_js__WEBPACK_IMPORTED_MODULE_6__.footnote,
12085 heading: _heading_js__WEBPACK_IMPORTED_MODULE_7__.heading,
12086 html: _html_js__WEBPACK_IMPORTED_MODULE_8__.html,
12087 imageReference: _image_reference_js__WEBPACK_IMPORTED_MODULE_9__.imageReference,
12088 image: _image_js__WEBPACK_IMPORTED_MODULE_10__.image,
12089 inlineCode: _inline_code_js__WEBPACK_IMPORTED_MODULE_11__.inlineCode,
12090 linkReference: _link_reference_js__WEBPACK_IMPORTED_MODULE_12__.linkReference,
12091 link: _link_js__WEBPACK_IMPORTED_MODULE_13__.link,
12092 listItem: _list_item_js__WEBPACK_IMPORTED_MODULE_14__.listItem,
12093 list: _list_js__WEBPACK_IMPORTED_MODULE_15__.list,
12094 paragraph: _paragraph_js__WEBPACK_IMPORTED_MODULE_16__.paragraph,
12095 root: _root_js__WEBPACK_IMPORTED_MODULE_17__.root,
12096 strong: _strong_js__WEBPACK_IMPORTED_MODULE_18__.strong,
12097 table: _table_js__WEBPACK_IMPORTED_MODULE_19__.table,
12098 tableCell: _table_cell_js__WEBPACK_IMPORTED_MODULE_20__.tableCell,
12099 tableRow: _table_row_js__WEBPACK_IMPORTED_MODULE_21__.tableRow,
12100 text: _text_js__WEBPACK_IMPORTED_MODULE_22__.text,
12101 thematicBreak: _thematic_break_js__WEBPACK_IMPORTED_MODULE_23__.thematicBreak,
12102 toml: ignore,
12103 yaml: ignore,
12104 definition: ignore,
12105 footnoteDefinition: ignore
12106 }
12107
12108 // Return nothing for nodes that are ignored.
12109 function ignore() {
12110 // To do: next major: return `undefined`.
12111 return null
12112 }
12113
12114
12115 /***/ }),
12116
12117 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js":
12118 /*!**********************************************************************!*\
12119 !*** ../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js ***!
12120 \**********************************************************************/
12121 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12122
12123 "use strict";
12124 __webpack_require__.r(__webpack_exports__);
12125 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12126 /* harmony export */ "inlineCode": () => (/* binding */ inlineCode)
12127 /* harmony export */ });
12128 /**
12129 * @typedef {import('hast').Element} Element
12130 * @typedef {import('hast').Text} Text
12131 * @typedef {import('mdast').InlineCode} InlineCode
12132 * @typedef {import('../state.js').State} State
12133 */
12134
12135 /**
12136 * Turn an mdast `inlineCode` node into hast.
12137 *
12138 * @param {State} state
12139 * Info passed around.
12140 * @param {InlineCode} node
12141 * mdast node.
12142 * @returns {Element}
12143 * hast node.
12144 */
12145 function inlineCode(state, node) {
12146 /** @type {Text} */
12147 const text = {type: 'text', value: node.value.replace(/\r?\n|\r/g, ' ')}
12148 state.patch(node, text)
12149
12150 /** @type {Element} */
12151 const result = {
12152 type: 'element',
12153 tagName: 'code',
12154 properties: {},
12155 children: [text]
12156 }
12157 state.patch(node, result)
12158 return state.applyData(node, result)
12159 }
12160
12161
12162 /***/ }),
12163
12164 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js":
12165 /*!*************************************************************************!*\
12166 !*** ../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js ***!
12167 \*************************************************************************/
12168 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12169
12170 "use strict";
12171 __webpack_require__.r(__webpack_exports__);
12172 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12173 /* harmony export */ "linkReference": () => (/* binding */ linkReference)
12174 /* harmony export */ });
12175 /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js");
12176 /* harmony import */ var _revert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../revert.js */ "../node_modules/mdast-util-to-hast/lib/revert.js");
12177 /**
12178 * @typedef {import('hast').Element} Element
12179 * @typedef {import('hast').ElementContent} ElementContent
12180 * @typedef {import('hast').Properties} Properties
12181 * @typedef {import('mdast').LinkReference} LinkReference
12182 * @typedef {import('../state.js').State} State
12183 */
12184
12185
12186
12187
12188 /**
12189 * Turn an mdast `linkReference` node into hast.
12190 *
12191 * @param {State} state
12192 * Info passed around.
12193 * @param {LinkReference} node
12194 * mdast node.
12195 * @returns {ElementContent | Array<ElementContent>}
12196 * hast node.
12197 */
12198 function linkReference(state, node) {
12199 const def = state.definition(node.identifier)
12200
12201 if (!def) {
12202 return (0,_revert_js__WEBPACK_IMPORTED_MODULE_0__.revert)(state, node)
12203 }
12204
12205 /** @type {Properties} */
12206 const properties = {href: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__.normalizeUri)(def.url || '')}
12207
12208 if (def.title !== null && def.title !== undefined) {
12209 properties.title = def.title
12210 }
12211
12212 /** @type {Element} */
12213 const result = {
12214 type: 'element',
12215 tagName: 'a',
12216 properties,
12217 children: state.all(node)
12218 }
12219 state.patch(node, result)
12220 return state.applyData(node, result)
12221 }
12222
12223
12224 /***/ }),
12225
12226 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/link.js":
12227 /*!***************************************************************!*\
12228 !*** ../node_modules/mdast-util-to-hast/lib/handlers/link.js ***!
12229 \***************************************************************/
12230 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12231
12232 "use strict";
12233 __webpack_require__.r(__webpack_exports__);
12234 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12235 /* harmony export */ "link": () => (/* binding */ link)
12236 /* harmony export */ });
12237 /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js");
12238 /**
12239 * @typedef {import('hast').Element} Element
12240 * @typedef {import('hast').Properties} Properties
12241 * @typedef {import('mdast').Link} Link
12242 * @typedef {import('../state.js').State} State
12243 */
12244
12245
12246
12247 /**
12248 * Turn an mdast `link` node into hast.
12249 *
12250 * @param {State} state
12251 * Info passed around.
12252 * @param {Link} node
12253 * mdast node.
12254 * @returns {Element}
12255 * hast node.
12256 */
12257 function link(state, node) {
12258 /** @type {Properties} */
12259 const properties = {href: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(node.url)}
12260
12261 if (node.title !== null && node.title !== undefined) {
12262 properties.title = node.title
12263 }
12264
12265 /** @type {Element} */
12266 const result = {
12267 type: 'element',
12268 tagName: 'a',
12269 properties,
12270 children: state.all(node)
12271 }
12272 state.patch(node, result)
12273 return state.applyData(node, result)
12274 }
12275
12276
12277 /***/ }),
12278
12279 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/list-item.js":
12280 /*!********************************************************************!*\
12281 !*** ../node_modules/mdast-util-to-hast/lib/handlers/list-item.js ***!
12282 \********************************************************************/
12283 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12284
12285 "use strict";
12286 __webpack_require__.r(__webpack_exports__);
12287 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12288 /* harmony export */ "listItem": () => (/* binding */ listItem)
12289 /* harmony export */ });
12290 /**
12291 * @typedef {import('hast').Element} Element
12292 * @typedef {import('hast').ElementContent} ElementContent
12293 * @typedef {import('hast').Properties} Properties
12294 * @typedef {import('mdast').Content} Content
12295 * @typedef {import('mdast').ListItem} ListItem
12296 * @typedef {import('mdast').Parent} Parent
12297 * @typedef {import('mdast').Root} Root
12298 * @typedef {import('../state.js').State} State
12299 */
12300
12301 /**
12302 * @typedef {Root | Content} Nodes
12303 * @typedef {Extract<Nodes, Parent>} Parents
12304 */
12305
12306 /**
12307 * Turn an mdast `listItem` node into hast.
12308 *
12309 * @param {State} state
12310 * Info passed around.
12311 * @param {ListItem} node
12312 * mdast node.
12313 * @param {Parents | null | undefined} parent
12314 * Parent of `node`.
12315 * @returns {Element}
12316 * hast node.
12317 */
12318 function listItem(state, node, parent) {
12319 const results = state.all(node)
12320 const loose = parent ? listLoose(parent) : listItemLoose(node)
12321 /** @type {Properties} */
12322 const properties = {}
12323 /** @type {Array<ElementContent>} */
12324 const children = []
12325
12326 if (typeof node.checked === 'boolean') {
12327 const head = results[0]
12328 /** @type {Element} */
12329 let paragraph
12330
12331 if (head && head.type === 'element' && head.tagName === 'p') {
12332 paragraph = head
12333 } else {
12334 paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}
12335 results.unshift(paragraph)
12336 }
12337
12338 if (paragraph.children.length > 0) {
12339 paragraph.children.unshift({type: 'text', value: ' '})
12340 }
12341
12342 paragraph.children.unshift({
12343 type: 'element',
12344 tagName: 'input',
12345 properties: {type: 'checkbox', checked: node.checked, disabled: true},
12346 children: []
12347 })
12348
12349 // According to github-markdown-css, this class hides bullet.
12350 // See: <https://github.com/sindresorhus/github-markdown-css>.
12351 properties.className = ['task-list-item']
12352 }
12353
12354 let index = -1
12355
12356 while (++index < results.length) {
12357 const child = results[index]
12358
12359 // Add eols before nodes, except if this is a loose, first paragraph.
12360 if (
12361 loose ||
12362 index !== 0 ||
12363 child.type !== 'element' ||
12364 child.tagName !== 'p'
12365 ) {
12366 children.push({type: 'text', value: '\n'})
12367 }
12368
12369 if (child.type === 'element' && child.tagName === 'p' && !loose) {
12370 children.push(...child.children)
12371 } else {
12372 children.push(child)
12373 }
12374 }
12375
12376 const tail = results[results.length - 1]
12377
12378 // Add a final eol.
12379 if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {
12380 children.push({type: 'text', value: '\n'})
12381 }
12382
12383 /** @type {Element} */
12384 const result = {type: 'element', tagName: 'li', properties, children}
12385 state.patch(node, result)
12386 return state.applyData(node, result)
12387 }
12388
12389 /**
12390 * @param {Parents} node
12391 * @return {Boolean}
12392 */
12393 function listLoose(node) {
12394 let loose = false
12395 if (node.type === 'list') {
12396 loose = node.spread || false
12397 const children = node.children
12398 let index = -1
12399
12400 while (!loose && ++index < children.length) {
12401 loose = listItemLoose(children[index])
12402 }
12403 }
12404
12405 return loose
12406 }
12407
12408 /**
12409 * @param {ListItem} node
12410 * @return {Boolean}
12411 */
12412 function listItemLoose(node) {
12413 const spread = node.spread
12414
12415 return spread === undefined || spread === null
12416 ? node.children.length > 1
12417 : spread
12418 }
12419
12420
12421 /***/ }),
12422
12423 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/list.js":
12424 /*!***************************************************************!*\
12425 !*** ../node_modules/mdast-util-to-hast/lib/handlers/list.js ***!
12426 \***************************************************************/
12427 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12428
12429 "use strict";
12430 __webpack_require__.r(__webpack_exports__);
12431 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12432 /* harmony export */ "list": () => (/* binding */ list)
12433 /* harmony export */ });
12434 /**
12435 * @typedef {import('hast').Element} Element
12436 * @typedef {import('hast').Properties} Properties
12437 * @typedef {import('mdast').List} List
12438 * @typedef {import('../state.js').State} State
12439 */
12440
12441 /**
12442 * Turn an mdast `list` node into hast.
12443 *
12444 * @param {State} state
12445 * Info passed around.
12446 * @param {List} node
12447 * mdast node.
12448 * @returns {Element}
12449 * hast node.
12450 */
12451 function list(state, node) {
12452 /** @type {Properties} */
12453 const properties = {}
12454 const results = state.all(node)
12455 let index = -1
12456
12457 if (typeof node.start === 'number' && node.start !== 1) {
12458 properties.start = node.start
12459 }
12460
12461 // Like GitHub, add a class for custom styling.
12462 while (++index < results.length) {
12463 const child = results[index]
12464
12465 if (
12466 child.type === 'element' &&
12467 child.tagName === 'li' &&
12468 child.properties &&
12469 Array.isArray(child.properties.className) &&
12470 child.properties.className.includes('task-list-item')
12471 ) {
12472 properties.className = ['contains-task-list']
12473 break
12474 }
12475 }
12476
12477 /** @type {Element} */
12478 const result = {
12479 type: 'element',
12480 tagName: node.ordered ? 'ol' : 'ul',
12481 properties,
12482 children: state.wrap(results, true)
12483 }
12484 state.patch(node, result)
12485 return state.applyData(node, result)
12486 }
12487
12488
12489 /***/ }),
12490
12491 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js":
12492 /*!********************************************************************!*\
12493 !*** ../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js ***!
12494 \********************************************************************/
12495 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12496
12497 "use strict";
12498 __webpack_require__.r(__webpack_exports__);
12499 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12500 /* harmony export */ "paragraph": () => (/* binding */ paragraph)
12501 /* harmony export */ });
12502 /**
12503 * @typedef {import('hast').Element} Element
12504 * @typedef {import('mdast').Paragraph} Paragraph
12505 * @typedef {import('../state.js').State} State
12506 */
12507
12508 /**
12509 * Turn an mdast `paragraph` node into hast.
12510 *
12511 * @param {State} state
12512 * Info passed around.
12513 * @param {Paragraph} node
12514 * mdast node.
12515 * @returns {Element}
12516 * hast node.
12517 */
12518 function paragraph(state, node) {
12519 /** @type {Element} */
12520 const result = {
12521 type: 'element',
12522 tagName: 'p',
12523 properties: {},
12524 children: state.all(node)
12525 }
12526 state.patch(node, result)
12527 return state.applyData(node, result)
12528 }
12529
12530
12531 /***/ }),
12532
12533 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/root.js":
12534 /*!***************************************************************!*\
12535 !*** ../node_modules/mdast-util-to-hast/lib/handlers/root.js ***!
12536 \***************************************************************/
12537 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12538
12539 "use strict";
12540 __webpack_require__.r(__webpack_exports__);
12541 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12542 /* harmony export */ "root": () => (/* binding */ root)
12543 /* harmony export */ });
12544 /**
12545 * @typedef {import('hast').Root} HastRoot
12546 * @typedef {import('hast').Element} HastElement
12547 * @typedef {import('mdast').Root} MdastRoot
12548 * @typedef {import('../state.js').State} State
12549 */
12550
12551 /**
12552 * Turn an mdast `root` node into hast.
12553 *
12554 * @param {State} state
12555 * Info passed around.
12556 * @param {MdastRoot} node
12557 * mdast node.
12558 * @returns {HastRoot | HastElement}
12559 * hast node.
12560 */
12561 function root(state, node) {
12562 /** @type {HastRoot} */
12563 const result = {type: 'root', children: state.wrap(state.all(node))}
12564 state.patch(node, result)
12565 return state.applyData(node, result)
12566 }
12567
12568
12569 /***/ }),
12570
12571 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/strong.js":
12572 /*!*****************************************************************!*\
12573 !*** ../node_modules/mdast-util-to-hast/lib/handlers/strong.js ***!
12574 \*****************************************************************/
12575 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12576
12577 "use strict";
12578 __webpack_require__.r(__webpack_exports__);
12579 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12580 /* harmony export */ "strong": () => (/* binding */ strong)
12581 /* harmony export */ });
12582 /**
12583 * @typedef {import('hast').Element} Element
12584 * @typedef {import('mdast').Strong} Strong
12585 * @typedef {import('../state.js').State} State
12586 */
12587
12588 /**
12589 * Turn an mdast `strong` node into hast.
12590 *
12591 * @param {State} state
12592 * Info passed around.
12593 * @param {Strong} node
12594 * mdast node.
12595 * @returns {Element}
12596 * hast node.
12597 */
12598 function strong(state, node) {
12599 /** @type {Element} */
12600 const result = {
12601 type: 'element',
12602 tagName: 'strong',
12603 properties: {},
12604 children: state.all(node)
12605 }
12606 state.patch(node, result)
12607 return state.applyData(node, result)
12608 }
12609
12610
12611 /***/ }),
12612
12613 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js":
12614 /*!*********************************************************************!*\
12615 !*** ../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js ***!
12616 \*********************************************************************/
12617 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12618
12619 "use strict";
12620 __webpack_require__.r(__webpack_exports__);
12621 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12622 /* harmony export */ "tableCell": () => (/* binding */ tableCell)
12623 /* harmony export */ });
12624 /**
12625 * @typedef {import('hast').Element} Element
12626 * @typedef {import('mdast').TableCell} TableCell
12627 * @typedef {import('../state.js').State} State
12628 */
12629
12630 /**
12631 * Turn an mdast `tableCell` node into hast.
12632 *
12633 * @param {State} state
12634 * Info passed around.
12635 * @param {TableCell} node
12636 * mdast node.
12637 * @returns {Element}
12638 * hast node.
12639 */
12640 function tableCell(state, node) {
12641 // Note: this function is normally not called: see `table-row` for how rows
12642 // and their cells are compiled.
12643 /** @type {Element} */
12644 const result = {
12645 type: 'element',
12646 tagName: 'td', // Assume body cell.
12647 properties: {},
12648 children: state.all(node)
12649 }
12650 state.patch(node, result)
12651 return state.applyData(node, result)
12652 }
12653
12654
12655 /***/ }),
12656
12657 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/table-row.js":
12658 /*!********************************************************************!*\
12659 !*** ../node_modules/mdast-util-to-hast/lib/handlers/table-row.js ***!
12660 \********************************************************************/
12661 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12662
12663 "use strict";
12664 __webpack_require__.r(__webpack_exports__);
12665 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12666 /* harmony export */ "tableRow": () => (/* binding */ tableRow)
12667 /* harmony export */ });
12668 /**
12669 * @typedef {import('hast').Properties} Properties
12670 * @typedef {import('hast').Element} Element
12671 * @typedef {import('hast').ElementContent} ElementContent
12672 * @typedef {import('mdast').Content} Content
12673 * @typedef {import('mdast').Parent} Parent
12674 * @typedef {import('mdast').Root} Root
12675 * @typedef {import('mdast').TableRow} TableRow
12676 * @typedef {import('../state.js').State} State
12677 */
12678
12679 /**
12680 * @typedef {Root | Content} Nodes
12681 * @typedef {Extract<Nodes, Parent>} Parents
12682 */
12683
12684 /**
12685 * Turn an mdast `tableRow` node into hast.
12686 *
12687 * @param {State} state
12688 * Info passed around.
12689 * @param {TableRow} node
12690 * mdast node.
12691 * @param {Parents | null | undefined} parent
12692 * Parent of `node`.
12693 * @returns {Element}
12694 * hast node.
12695 */
12696 function tableRow(state, node, parent) {
12697 const siblings = parent ? parent.children : undefined
12698 // Generate a body row when without parent.
12699 const rowIndex = siblings ? siblings.indexOf(node) : 1
12700 const tagName = rowIndex === 0 ? 'th' : 'td'
12701 const align = parent && parent.type === 'table' ? parent.align : undefined
12702 const length = align ? align.length : node.children.length
12703 let cellIndex = -1
12704 /** @type {Array<ElementContent>} */
12705 const cells = []
12706
12707 while (++cellIndex < length) {
12708 // Note: can also be undefined.
12709 const cell = node.children[cellIndex]
12710 /** @type {Properties} */
12711 const properties = {}
12712 const alignValue = align ? align[cellIndex] : undefined
12713
12714 if (alignValue) {
12715 properties.align = alignValue
12716 }
12717
12718 /** @type {Element} */
12719 let result = {type: 'element', tagName, properties, children: []}
12720
12721 if (cell) {
12722 result.children = state.all(cell)
12723 state.patch(cell, result)
12724 result = state.applyData(node, result)
12725 }
12726
12727 cells.push(result)
12728 }
12729
12730 /** @type {Element} */
12731 const result = {
12732 type: 'element',
12733 tagName: 'tr',
12734 properties: {},
12735 children: state.wrap(cells, true)
12736 }
12737 state.patch(node, result)
12738 return state.applyData(node, result)
12739 }
12740
12741
12742 /***/ }),
12743
12744 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/table.js":
12745 /*!****************************************************************!*\
12746 !*** ../node_modules/mdast-util-to-hast/lib/handlers/table.js ***!
12747 \****************************************************************/
12748 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12749
12750 "use strict";
12751 __webpack_require__.r(__webpack_exports__);
12752 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12753 /* harmony export */ "table": () => (/* binding */ table)
12754 /* harmony export */ });
12755 /* harmony import */ var unist_util_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-position */ "../node_modules/unist-util-position/lib/index.js");
12756 /**
12757 * @typedef {import('hast').Element} Element
12758 * @typedef {import('mdast').Table} Table
12759 * @typedef {import('../state.js').State} State
12760 */
12761
12762
12763
12764 /**
12765 * Turn an mdast `table` node into hast.
12766 *
12767 * @param {State} state
12768 * Info passed around.
12769 * @param {Table} node
12770 * mdast node.
12771 * @returns {Element}
12772 * hast node.
12773 */
12774 function table(state, node) {
12775 const rows = state.all(node)
12776 const firstRow = rows.shift()
12777 /** @type {Array<Element>} */
12778 const tableContent = []
12779
12780 if (firstRow) {
12781 /** @type {Element} */
12782 const head = {
12783 type: 'element',
12784 tagName: 'thead',
12785 properties: {},
12786 children: state.wrap([firstRow], true)
12787 }
12788 state.patch(node.children[0], head)
12789 tableContent.push(head)
12790 }
12791
12792 if (rows.length > 0) {
12793 /** @type {Element} */
12794 const body = {
12795 type: 'element',
12796 tagName: 'tbody',
12797 properties: {},
12798 children: state.wrap(rows, true)
12799 }
12800
12801 const start = (0,unist_util_position__WEBPACK_IMPORTED_MODULE_0__.pointStart)(node.children[1])
12802 const end = (0,unist_util_position__WEBPACK_IMPORTED_MODULE_0__.pointEnd)(node.children[node.children.length - 1])
12803 if (start.line && end.line) body.position = {start, end}
12804 tableContent.push(body)
12805 }
12806
12807 /** @type {Element} */
12808 const result = {
12809 type: 'element',
12810 tagName: 'table',
12811 properties: {},
12812 children: state.wrap(tableContent, true)
12813 }
12814 state.patch(node, result)
12815 return state.applyData(node, result)
12816 }
12817
12818
12819 /***/ }),
12820
12821 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/text.js":
12822 /*!***************************************************************!*\
12823 !*** ../node_modules/mdast-util-to-hast/lib/handlers/text.js ***!
12824 \***************************************************************/
12825 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12826
12827 "use strict";
12828 __webpack_require__.r(__webpack_exports__);
12829 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12830 /* harmony export */ "text": () => (/* binding */ text)
12831 /* harmony export */ });
12832 /* harmony import */ var trim_lines__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! trim-lines */ "../node_modules/trim-lines/index.js");
12833 /**
12834 * @typedef {import('hast').Element} HastElement
12835 * @typedef {import('hast').Text} HastText
12836 * @typedef {import('mdast').Text} MdastText
12837 * @typedef {import('../state.js').State} State
12838 */
12839
12840
12841
12842 /**
12843 * Turn an mdast `text` node into hast.
12844 *
12845 * @param {State} state
12846 * Info passed around.
12847 * @param {MdastText} node
12848 * mdast node.
12849 * @returns {HastText | HastElement}
12850 * hast node.
12851 */
12852 function text(state, node) {
12853 /** @type {HastText} */
12854 const result = {type: 'text', value: (0,trim_lines__WEBPACK_IMPORTED_MODULE_0__.trimLines)(String(node.value))}
12855 state.patch(node, result)
12856 return state.applyData(node, result)
12857 }
12858
12859
12860 /***/ }),
12861
12862 /***/ "../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js":
12863 /*!*************************************************************************!*\
12864 !*** ../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js ***!
12865 \*************************************************************************/
12866 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12867
12868 "use strict";
12869 __webpack_require__.r(__webpack_exports__);
12870 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12871 /* harmony export */ "thematicBreak": () => (/* binding */ thematicBreak)
12872 /* harmony export */ });
12873 /**
12874 * @typedef {import('hast').Element} Element
12875 * @typedef {import('mdast').ThematicBreak} ThematicBreak
12876 * @typedef {import('../state.js').State} State
12877 */
12878
12879 /**
12880 * Turn an mdast `thematicBreak` node into hast.
12881 *
12882 * @param {State} state
12883 * Info passed around.
12884 * @param {ThematicBreak} node
12885 * mdast node.
12886 * @returns {Element}
12887 * hast node.
12888 */
12889 function thematicBreak(state, node) {
12890 /** @type {Element} */
12891 const result = {
12892 type: 'element',
12893 tagName: 'hr',
12894 properties: {},
12895 children: []
12896 }
12897 state.patch(node, result)
12898 return state.applyData(node, result)
12899 }
12900
12901
12902 /***/ }),
12903
12904 /***/ "../node_modules/mdast-util-to-hast/lib/index.js":
12905 /*!*******************************************************!*\
12906 !*** ../node_modules/mdast-util-to-hast/lib/index.js ***!
12907 \*******************************************************/
12908 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12909
12910 "use strict";
12911 __webpack_require__.r(__webpack_exports__);
12912 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12913 /* harmony export */ "toHast": () => (/* binding */ toHast)
12914 /* harmony export */ });
12915 /* harmony import */ var _footer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./footer.js */ "../node_modules/mdast-util-to-hast/lib/footer.js");
12916 /* harmony import */ var _state_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./state.js */ "../node_modules/mdast-util-to-hast/lib/state.js");
12917 /**
12918 * @typedef {import('hast').Content} HastContent
12919 * @typedef {import('hast').Root} HastRoot
12920 *
12921 * @typedef {import('mdast').Content} MdastContent
12922 * @typedef {import('mdast').Root} MdastRoot
12923 *
12924 * @typedef {import('./state.js').Options} Options
12925 */
12926
12927 /**
12928 * @typedef {HastRoot | HastContent} HastNodes
12929 * @typedef {MdastRoot | MdastContent} MdastNodes
12930 */
12931
12932
12933
12934
12935 /**
12936 * Transform mdast to hast.
12937 *
12938 * ##### Notes
12939 *
12940 * ###### HTML
12941 *
12942 * Raw HTML is available in mdast as `html` nodes and can be embedded in hast
12943 * as semistandard `raw` nodes.
12944 * Most utilities ignore `raw` nodes but two notable ones don’t:
12945 *
12946 * * `hast-util-to-html` also has an option `allowDangerousHtml` which will
12947 * output the raw HTML.
12948 * This is typically discouraged as noted by the option name but is useful
12949 * if you completely trust authors
12950 * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them
12951 * into standard hast nodes (`element`, `text`, etc).
12952 * This is a heavy task as it needs a full HTML parser, but it is the only
12953 * way to support untrusted content
12954 *
12955 * ###### Footnotes
12956 *
12957 * Many options supported here relate to footnotes.
12958 * Footnotes are not specified by CommonMark, which we follow by default.
12959 * They are supported by GitHub, so footnotes can be enabled in markdown with
12960 * `mdast-util-gfm`.
12961 *
12962 * The options `footnoteBackLabel` and `footnoteLabel` define natural language
12963 * that explains footnotes, which is hidden for sighted users but shown to
12964 * assistive technology.
12965 * When your page is not in English, you must define translated values.
12966 *
12967 * Back references use ARIA attributes, but the section label itself uses a
12968 * heading that is hidden with an `sr-only` class.
12969 * To show it to sighted users, define different attributes in
12970 * `footnoteLabelProperties`.
12971 *
12972 * ###### Clobbering
12973 *
12974 * Footnotes introduces a problem, as it links footnote calls to footnote
12975 * definitions on the page through `id` attributes generated from user content,
12976 * which results in DOM clobbering.
12977 *
12978 * DOM clobbering is this:
12979 *
12980 * ```html
12981 * <p id=x></p>
12982 * <script>alert(x) // `x` now refers to the DOM `p#x` element</script>
12983 * ```
12984 *
12985 * Elements by their ID are made available by browsers on the `window` object,
12986 * which is a security risk.
12987 * Using a prefix solves this problem.
12988 *
12989 * More information on how to handle clobbering and the prefix is explained in
12990 * Example: headings (DOM clobbering) in `rehype-sanitize`.
12991 *
12992 * ###### Unknown nodes
12993 *
12994 * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.
12995 * The default behavior for unknown nodes is:
12996 *
12997 * * when the node has a `value` (and doesn’t have `data.hName`,
12998 * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`
12999 * node
13000 * * otherwise, create a `<div>` element (which could be changed with
13001 * `data.hName`), with its children mapped from mdast to hast as well
13002 *
13003 * This behavior can be changed by passing an `unknownHandler`.
13004 *
13005 * @param {MdastNodes} tree
13006 * mdast tree.
13007 * @param {Options | null | undefined} [options]
13008 * Configuration.
13009 * @returns {HastNodes | null | undefined}
13010 * hast tree.
13011 */
13012 // To do: next major: always return a single `root`.
13013 function toHast(tree, options) {
13014 const state = (0,_state_js__WEBPACK_IMPORTED_MODULE_0__.createState)(tree, options)
13015 const node = state.one(tree, null)
13016 const foot = (0,_footer_js__WEBPACK_IMPORTED_MODULE_1__.footer)(state)
13017
13018 if (foot) {
13019 // @ts-expect-error If there’s a footer, there were definitions, meaning block
13020 // content.
13021 // So assume `node` is a parent node.
13022 node.children.push({type: 'text', value: '\n'}, foot)
13023 }
13024
13025 // To do: next major: always return root?
13026 return Array.isArray(node) ? {type: 'root', children: node} : node
13027 }
13028
13029
13030 /***/ }),
13031
13032 /***/ "../node_modules/mdast-util-to-hast/lib/revert.js":
13033 /*!********************************************************!*\
13034 !*** ../node_modules/mdast-util-to-hast/lib/revert.js ***!
13035 \********************************************************/
13036 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13037
13038 "use strict";
13039 __webpack_require__.r(__webpack_exports__);
13040 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13041 /* harmony export */ "revert": () => (/* binding */ revert)
13042 /* harmony export */ });
13043 /**
13044 * @typedef {import('hast').ElementContent} ElementContent
13045 *
13046 * @typedef {import('mdast').Content} Content
13047 * @typedef {import('mdast').Reference} Reference
13048 * @typedef {import('mdast').Root} Root
13049 *
13050 * @typedef {import('./state.js').State} State
13051 */
13052
13053 /**
13054 * @typedef {Root | Content} Nodes
13055 * @typedef {Extract<Nodes, Reference>} References
13056 */
13057
13058 // To do: next major: always return array.
13059
13060 /**
13061 * Return the content of a reference without definition as plain text.
13062 *
13063 * @param {State} state
13064 * Info passed around.
13065 * @param {References} node
13066 * Reference node (image, link).
13067 * @returns {ElementContent | Array<ElementContent>}
13068 * hast content.
13069 */
13070 function revert(state, node) {
13071 const subtype = node.referenceType
13072 let suffix = ']'
13073
13074 if (subtype === 'collapsed') {
13075 suffix += '[]'
13076 } else if (subtype === 'full') {
13077 suffix += '[' + (node.label || node.identifier) + ']'
13078 }
13079
13080 if (node.type === 'imageReference') {
13081 return {type: 'text', value: '![' + node.alt + suffix}
13082 }
13083
13084 const contents = state.all(node)
13085 const head = contents[0]
13086
13087 if (head && head.type === 'text') {
13088 head.value = '[' + head.value
13089 } else {
13090 contents.unshift({type: 'text', value: '['})
13091 }
13092
13093 const tail = contents[contents.length - 1]
13094
13095 if (tail && tail.type === 'text') {
13096 tail.value += suffix
13097 } else {
13098 contents.push({type: 'text', value: suffix})
13099 }
13100
13101 return contents
13102 }
13103
13104
13105 /***/ }),
13106
13107 /***/ "../node_modules/mdast-util-to-hast/lib/state.js":
13108 /*!*******************************************************!*\
13109 !*** ../node_modules/mdast-util-to-hast/lib/state.js ***!
13110 \*******************************************************/
13111 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13112
13113 "use strict";
13114 __webpack_require__.r(__webpack_exports__);
13115 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13116 /* harmony export */ "all": () => (/* binding */ all),
13117 /* harmony export */ "createState": () => (/* binding */ createState),
13118 /* harmony export */ "one": () => (/* binding */ one),
13119 /* harmony export */ "wrap": () => (/* binding */ wrap)
13120 /* harmony export */ });
13121 /* harmony import */ var unist_util_visit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! unist-util-visit */ "../node_modules/unist-util-visit/lib/index.js");
13122 /* harmony import */ var unist_util_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! unist-util-position */ "../node_modules/unist-util-position/lib/index.js");
13123 /* harmony import */ var unist_util_generated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! unist-util-generated */ "../node_modules/unist-util-generated/lib/index.js");
13124 /* harmony import */ var mdast_util_definitions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mdast-util-definitions */ "../node_modules/mdast-util-definitions/lib/index.js");
13125 /* harmony import */ var _handlers_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handlers/index.js */ "../node_modules/mdast-util-to-hast/lib/handlers/index.js");
13126 /**
13127 * @typedef {import('hast').Content} HastContent
13128 * @typedef {import('hast').Element} HastElement
13129 * @typedef {import('hast').ElementContent} HastElementContent
13130 * @typedef {import('hast').Properties} HastProperties
13131 * @typedef {import('hast').Root} HastRoot
13132 * @typedef {import('hast').Text} HastText
13133 *
13134 * @typedef {import('mdast').Content} MdastContent
13135 * @typedef {import('mdast').Definition} MdastDefinition
13136 * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition
13137 * @typedef {import('mdast').Parent} MdastParent
13138 * @typedef {import('mdast').Root} MdastRoot
13139 */
13140
13141 /**
13142 * @typedef {HastRoot | HastContent} HastNodes
13143 * @typedef {MdastRoot | MdastContent} MdastNodes
13144 * @typedef {Extract<MdastNodes, MdastParent>} MdastParents
13145 *
13146 * @typedef EmbeddedHastFields
13147 * hast fields.
13148 * @property {string | null | undefined} [hName]
13149 * Generate a specific element with this tag name instead.
13150 * @property {HastProperties | null | undefined} [hProperties]
13151 * Generate an element with these properties instead.
13152 * @property {Array<HastElementContent> | null | undefined} [hChildren]
13153 * Generate an element with this content instead.
13154 *
13155 * @typedef {Record<string, unknown> & EmbeddedHastFields} MdastData
13156 * mdast data with embedded hast fields.
13157 *
13158 * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData
13159 * mdast node with embedded hast data.
13160 *
13161 * @typedef PointLike
13162 * Point-like value.
13163 * @property {number | null | undefined} [line]
13164 * Line.
13165 * @property {number | null | undefined} [column]
13166 * Column.
13167 * @property {number | null | undefined} [offset]
13168 * Offset.
13169 *
13170 * @typedef PositionLike
13171 * Position-like value.
13172 * @property {PointLike | null | undefined} [start]
13173 * Point-like value.
13174 * @property {PointLike | null | undefined} [end]
13175 * Point-like value.
13176 *
13177 * @callback Handler
13178 * Handle a node.
13179 * @param {State} state
13180 * Info passed around.
13181 * @param {any} node
13182 * mdast node to handle.
13183 * @param {MdastParents | null | undefined} parent
13184 * Parent of `node`.
13185 * @returns {HastElementContent | Array<HastElementContent> | null | undefined}
13186 * hast node.
13187 *
13188 * @callback HFunctionProps
13189 * Signature of `state` for when props are passed.
13190 * @param {MdastNodes | PositionLike | null | undefined} node
13191 * mdast node or unist position.
13192 * @param {string} tagName
13193 * HTML tag name.
13194 * @param {HastProperties} props
13195 * Properties.
13196 * @param {Array<HastElementContent> | null | undefined} [children]
13197 * hast content.
13198 * @returns {HastElement}
13199 * Compiled element.
13200 *
13201 * @callback HFunctionNoProps
13202 * Signature of `state` for when no props are passed.
13203 * @param {MdastNodes | PositionLike | null | undefined} node
13204 * mdast node or unist position.
13205 * @param {string} tagName
13206 * HTML tag name.
13207 * @param {Array<HastElementContent> | null | undefined} [children]
13208 * hast content.
13209 * @returns {HastElement}
13210 * Compiled element.
13211 *
13212 * @typedef HFields
13213 * Info on `state`.
13214 * @property {boolean} dangerous
13215 * Whether HTML is allowed.
13216 * @property {string} clobberPrefix
13217 * Prefix to use to prevent DOM clobbering.
13218 * @property {string} footnoteLabel
13219 * Label to use to introduce the footnote section.
13220 * @property {string} footnoteLabelTagName
13221 * HTML used for the footnote label.
13222 * @property {HastProperties} footnoteLabelProperties
13223 * Properties on the HTML tag used for the footnote label.
13224 * @property {string} footnoteBackLabel
13225 * Label to use from backreferences back to their footnote call.
13226 * @property {(identifier: string) => MdastDefinition | null} definition
13227 * Definition cache.
13228 * @property {Record<string, MdastFootnoteDefinition>} footnoteById
13229 * Footnote definitions by their identifier.
13230 * @property {Array<string>} footnoteOrder
13231 * Identifiers of order when footnote calls first appear in tree order.
13232 * @property {Record<string, number>} footnoteCounts
13233 * Counts for how often the same footnote was called.
13234 * @property {Handlers} handlers
13235 * Applied handlers.
13236 * @property {Handler} unknownHandler
13237 * Handler for any none not in `passThrough` or otherwise handled.
13238 * @property {(from: MdastNodes, node: HastNodes) => void} patch
13239 * Copy a node’s positional info.
13240 * @property {<Type extends HastNodes>(from: MdastNodes, to: Type) => Type | HastElement} applyData
13241 * Honor the `data` of `from`, and generate an element instead of `node`.
13242 * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array<HastElementContent> | null | undefined} one
13243 * Transform an mdast node to hast.
13244 * @property {(node: MdastNodes) => Array<HastElementContent>} all
13245 * Transform the children of an mdast parent to hast.
13246 * @property {<Type extends HastContent>(nodes: Array<Type>, loose?: boolean | null | undefined) => Array<Type | HastText>} wrap
13247 * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.
13248 * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment
13249 * Like `state` but lower-level and usable on non-elements.
13250 * Deprecated: use `patch` and `applyData`.
13251 * @property {Array<string>} passThrough
13252 * List of node types to pass through untouched (except for their children).
13253 *
13254 * @typedef Options
13255 * Configuration (optional).
13256 * @property {boolean | null | undefined} [allowDangerousHtml=false]
13257 * Whether to persist raw HTML in markdown in the hast tree.
13258 * @property {string | null | undefined} [clobberPrefix='user-content-']
13259 * Prefix to use before the `id` attribute on footnotes to prevent it from
13260 * *clobbering*.
13261 * @property {string | null | undefined} [footnoteBackLabel='Back to content']
13262 * Label to use from backreferences back to their footnote call (affects
13263 * screen readers).
13264 * @property {string | null | undefined} [footnoteLabel='Footnotes']
13265 * Label to use for the footnotes section (affects screen readers).
13266 * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]
13267 * Properties to use on the footnote label (note that `id: 'footnote-label'`
13268 * is always added as footnote calls use it with `aria-describedby` to
13269 * provide an accessible label).
13270 * @property {string | null | undefined} [footnoteLabelTagName='h2']
13271 * Tag name to use for the footnote label.
13272 * @property {Handlers | null | undefined} [handlers]
13273 * Extra handlers for nodes.
13274 * @property {Array<string> | null | undefined} [passThrough]
13275 * List of custom mdast node types to pass through (keep) in hast (note that
13276 * the node itself is passed, but eventual children are transformed).
13277 * @property {Handler | null | undefined} [unknownHandler]
13278 * Handler for all unknown nodes.
13279 *
13280 * @typedef {Record<string, Handler>} Handlers
13281 * Handle nodes.
13282 *
13283 * @typedef {HFunctionProps & HFunctionNoProps & HFields} State
13284 * Info passed around.
13285 */
13286
13287
13288
13289
13290
13291
13292
13293 const own = {}.hasOwnProperty
13294
13295 /**
13296 * Create `state` from an mdast tree.
13297 *
13298 * @param {MdastNodes} tree
13299 * mdast node to transform.
13300 * @param {Options | null | undefined} [options]
13301 * Configuration.
13302 * @returns {State}
13303 * `state` function.
13304 */
13305 function createState(tree, options) {
13306 const settings = options || {}
13307 const dangerous = settings.allowDangerousHtml || false
13308 /** @type {Record<string, MdastFootnoteDefinition>} */
13309 const footnoteById = {}
13310
13311 // To do: next major: add `options` to state, remove:
13312 // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`,
13313 // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`,
13314 // `unknownHandler`.
13315
13316 // To do: next major: move to `state.options.allowDangerousHtml`.
13317 state.dangerous = dangerous
13318 // To do: next major: move to `state.options`.
13319 state.clobberPrefix =
13320 settings.clobberPrefix === undefined || settings.clobberPrefix === null
13321 ? 'user-content-'
13322 : settings.clobberPrefix
13323 // To do: next major: move to `state.options`.
13324 state.footnoteLabel = settings.footnoteLabel || 'Footnotes'
13325 // To do: next major: move to `state.options`.
13326 state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'
13327 // To do: next major: move to `state.options`.
13328 state.footnoteLabelProperties = settings.footnoteLabelProperties || {
13329 className: ['sr-only']
13330 }
13331 // To do: next major: move to `state.options`.
13332 state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'
13333 // To do: next major: move to `state.options`.
13334 state.unknownHandler = settings.unknownHandler
13335 // To do: next major: move to `state.options`.
13336 state.passThrough = settings.passThrough
13337
13338 state.handlers = {..._handlers_index_js__WEBPACK_IMPORTED_MODULE_0__.handlers, ...settings.handlers}
13339
13340 // To do: next major: replace utility with `definitionById` object, so we
13341 // only walk once (as we need footnotes too).
13342 state.definition = (0,mdast_util_definitions__WEBPACK_IMPORTED_MODULE_1__.definitions)(tree)
13343 state.footnoteById = footnoteById
13344 /** @type {Array<string>} */
13345 state.footnoteOrder = []
13346 /** @type {Record<string, number>} */
13347 state.footnoteCounts = {}
13348
13349 state.patch = patch
13350 state.applyData = applyData
13351 state.one = oneBound
13352 state.all = allBound
13353 state.wrap = wrap
13354 // To do: next major: remove `augment`.
13355 state.augment = augment
13356
13357 ;(0,unist_util_visit__WEBPACK_IMPORTED_MODULE_2__.visit)(tree, 'footnoteDefinition', (definition) => {
13358 const id = String(definition.identifier).toUpperCase()
13359
13360 // Mimick CM behavior of link definitions.
13361 // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>.
13362 if (!own.call(footnoteById, id)) {
13363 footnoteById[id] = definition
13364 }
13365 })
13366
13367 // @ts-expect-error Hush, it’s fine!
13368 return state
13369
13370 /**
13371 * Finalise the created `right`, a hast node, from `left`, an mdast node.
13372 *
13373 * @param {MdastNodeWithData | PositionLike | null | undefined} left
13374 * @param {HastElementContent} right
13375 * @returns {HastElementContent}
13376 */
13377 /* c8 ignore start */
13378 // To do: next major: remove.
13379 function augment(left, right) {
13380 // Handle `data.hName`, `data.hProperties, `data.hChildren`.
13381 if (left && 'data' in left && left.data) {
13382 /** @type {MdastData} */
13383 const data = left.data
13384
13385 if (data.hName) {
13386 if (right.type !== 'element') {
13387 right = {
13388 type: 'element',
13389 tagName: '',
13390 properties: {},
13391 children: []
13392 }
13393 }
13394
13395 right.tagName = data.hName
13396 }
13397
13398 if (right.type === 'element' && data.hProperties) {
13399 right.properties = {...right.properties, ...data.hProperties}
13400 }
13401
13402 if ('children' in right && right.children && data.hChildren) {
13403 right.children = data.hChildren
13404 }
13405 }
13406
13407 if (left) {
13408 const ctx = 'type' in left ? left : {position: left}
13409
13410 if (!(0,unist_util_generated__WEBPACK_IMPORTED_MODULE_3__.generated)(ctx)) {
13411 // @ts-expect-error: fine.
13412 right.position = {start: (0,unist_util_position__WEBPACK_IMPORTED_MODULE_4__.pointStart)(ctx), end: (0,unist_util_position__WEBPACK_IMPORTED_MODULE_4__.pointEnd)(ctx)}
13413 }
13414 }
13415
13416 return right
13417 }
13418 /* c8 ignore stop */
13419
13420 /**
13421 * Create an element for `node`.
13422 *
13423 * @type {HFunctionProps}
13424 */
13425 /* c8 ignore start */
13426 // To do: next major: remove.
13427 function state(node, tagName, props, children) {
13428 if (Array.isArray(props)) {
13429 children = props
13430 props = {}
13431 }
13432
13433 // @ts-expect-error augmenting an element yields an element.
13434 return augment(node, {
13435 type: 'element',
13436 tagName,
13437 properties: props || {},
13438 children: children || []
13439 })
13440 }
13441 /* c8 ignore stop */
13442
13443 /**
13444 * Transform an mdast node into a hast node.
13445 *
13446 * @param {MdastNodes} node
13447 * mdast node.
13448 * @param {MdastParents | null | undefined} [parent]
13449 * Parent of `node`.
13450 * @returns {HastElementContent | Array<HastElementContent> | null | undefined}
13451 * Resulting hast node.
13452 */
13453 function oneBound(node, parent) {
13454 // @ts-expect-error: that’s a state :)
13455 return one(state, node, parent)
13456 }
13457
13458 /**
13459 * Transform the children of an mdast node into hast nodes.
13460 *
13461 * @param {MdastNodes} parent
13462 * mdast node to compile
13463 * @returns {Array<HastElementContent>}
13464 * Resulting hast nodes.
13465 */
13466 function allBound(parent) {
13467 // @ts-expect-error: that’s a state :)
13468 return all(state, parent)
13469 }
13470 }
13471
13472 /**
13473 * Copy a node’s positional info.
13474 *
13475 * @param {MdastNodes} from
13476 * mdast node to copy from.
13477 * @param {HastNodes} to
13478 * hast node to copy into.
13479 * @returns {void}
13480 * Nothing.
13481 */
13482 function patch(from, to) {
13483 if (from.position) to.position = (0,unist_util_position__WEBPACK_IMPORTED_MODULE_4__.position)(from)
13484 }
13485
13486 /**
13487 * Honor the `data` of `from` and maybe generate an element instead of `to`.
13488 *
13489 * @template {HastNodes} Type
13490 * Node type.
13491 * @param {MdastNodes} from
13492 * mdast node to use data from.
13493 * @param {Type} to
13494 * hast node to change.
13495 * @returns {Type | HastElement}
13496 * Nothing.
13497 */
13498 function applyData(from, to) {
13499 /** @type {Type | HastElement} */
13500 let result = to
13501
13502 // Handle `data.hName`, `data.hProperties, `data.hChildren`.
13503 if (from && from.data) {
13504 const hName = from.data.hName
13505 const hChildren = from.data.hChildren
13506 const hProperties = from.data.hProperties
13507
13508 if (typeof hName === 'string') {
13509 // Transforming the node resulted in an element with a different name
13510 // than wanted:
13511 if (result.type === 'element') {
13512 result.tagName = hName
13513 }
13514 // Transforming the node resulted in a non-element, which happens for
13515 // raw, text, and root nodes (unless custom handlers are passed).
13516 // The intent is likely to keep the content around (otherwise: pass
13517 // `hChildren`).
13518 else {
13519 result = {
13520 type: 'element',
13521 tagName: hName,
13522 properties: {},
13523 children: []
13524 }
13525
13526 // To do: next major: take the children from the `root`, or inject the
13527 // raw/text/comment or so into the element?
13528 // if ('children' in node) {
13529 // // @ts-expect-error: assume `children` are allowed in elements.
13530 // result.children = node.children
13531 // } else {
13532 // // @ts-expect-error: assume `node` is allowed in elements.
13533 // result.children.push(node)
13534 // }
13535 }
13536 }
13537
13538 if (result.type === 'element' && hProperties) {
13539 result.properties = {...result.properties, ...hProperties}
13540 }
13541
13542 if (
13543 'children' in result &&
13544 result.children &&
13545 hChildren !== null &&
13546 hChildren !== undefined
13547 ) {
13548 // @ts-expect-error: assume valid children are defined.
13549 result.children = hChildren
13550 }
13551 }
13552
13553 return result
13554 }
13555
13556 /**
13557 * Transform an mdast node into a hast node.
13558 *
13559 * @param {State} state
13560 * Info passed around.
13561 * @param {MdastNodes} node
13562 * mdast node.
13563 * @param {MdastParents | null | undefined} [parent]
13564 * Parent of `node`.
13565 * @returns {HastElementContent | Array<HastElementContent> | null | undefined}
13566 * Resulting hast node.
13567 */
13568 // To do: next major: do not expose, keep bound.
13569 function one(state, node, parent) {
13570 const type = node && node.type
13571
13572 // Fail on non-nodes.
13573 if (!type) {
13574 throw new Error('Expected node, got `' + node + '`')
13575 }
13576
13577 if (own.call(state.handlers, type)) {
13578 return state.handlers[type](state, node, parent)
13579 }
13580
13581 if (state.passThrough && state.passThrough.includes(type)) {
13582 // To do: next major: deep clone.
13583 // @ts-expect-error: types of passed through nodes are expected to be added manually.
13584 return 'children' in node ? {...node, children: all(state, node)} : node
13585 }
13586
13587 if (state.unknownHandler) {
13588 return state.unknownHandler(state, node, parent)
13589 }
13590
13591 return defaultUnknownHandler(state, node)
13592 }
13593
13594 /**
13595 * Transform the children of an mdast node into hast nodes.
13596 *
13597 * @param {State} state
13598 * Info passed around.
13599 * @param {MdastNodes} parent
13600 * mdast node to compile
13601 * @returns {Array<HastElementContent>}
13602 * Resulting hast nodes.
13603 */
13604 // To do: next major: do not expose, keep bound.
13605 function all(state, parent) {
13606 /** @type {Array<HastElementContent>} */
13607 const values = []
13608
13609 if ('children' in parent) {
13610 const nodes = parent.children
13611 let index = -1
13612 while (++index < nodes.length) {
13613 const result = one(state, nodes[index], parent)
13614
13615 // To do: see if we van clean this? Can we merge texts?
13616 if (result) {
13617 if (index && nodes[index - 1].type === 'break') {
13618 if (!Array.isArray(result) && result.type === 'text') {
13619 result.value = result.value.replace(/^\s+/, '')
13620 }
13621
13622 if (!Array.isArray(result) && result.type === 'element') {
13623 const head = result.children[0]
13624
13625 if (head && head.type === 'text') {
13626 head.value = head.value.replace(/^\s+/, '')
13627 }
13628 }
13629 }
13630
13631 if (Array.isArray(result)) {
13632 values.push(...result)
13633 } else {
13634 values.push(result)
13635 }
13636 }
13637 }
13638 }
13639
13640 return values
13641 }
13642
13643 /**
13644 * Transform an unknown node.
13645 *
13646 * @param {State} state
13647 * Info passed around.
13648 * @param {MdastNodes} node
13649 * Unknown mdast node.
13650 * @returns {HastText | HastElement}
13651 * Resulting hast node.
13652 */
13653 function defaultUnknownHandler(state, node) {
13654 const data = node.data || {}
13655 /** @type {HastText | HastElement} */
13656 const result =
13657 'value' in node &&
13658 !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))
13659 ? {type: 'text', value: node.value}
13660 : {
13661 type: 'element',
13662 tagName: 'div',
13663 properties: {},
13664 children: all(state, node)
13665 }
13666
13667 state.patch(node, result)
13668 return state.applyData(node, result)
13669 }
13670
13671 /**
13672 * Wrap `nodes` with line endings between each node.
13673 *
13674 * @template {HastContent} Type
13675 * Node type.
13676 * @param {Array<Type>} nodes
13677 * List of nodes to wrap.
13678 * @param {boolean | null | undefined} [loose=false]
13679 * Whether to add line endings at start and end.
13680 * @returns {Array<Type | HastText>}
13681 * Wrapped nodes.
13682 */
13683 function wrap(nodes, loose) {
13684 /** @type {Array<Type | HastText>} */
13685 const result = []
13686 let index = -1
13687
13688 if (loose) {
13689 result.push({type: 'text', value: '\n'})
13690 }
13691
13692 while (++index < nodes.length) {
13693 if (index) result.push({type: 'text', value: '\n'})
13694 result.push(nodes[index])
13695 }
13696
13697 if (loose && nodes.length > 0) {
13698 result.push({type: 'text', value: '\n'})
13699 }
13700
13701 return result
13702 }
13703
13704
13705 /***/ }),
13706
13707 /***/ "../node_modules/mdast-util-to-string/lib/index.js":
13708 /*!*********************************************************!*\
13709 !*** ../node_modules/mdast-util-to-string/lib/index.js ***!
13710 \*********************************************************/
13711 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13712
13713 "use strict";
13714 __webpack_require__.r(__webpack_exports__);
13715 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13716 /* harmony export */ "toString": () => (/* binding */ toString)
13717 /* harmony export */ });
13718 /**
13719 * @typedef {import('mdast').Root|import('mdast').Content} Node
13720 *
13721 * @typedef Options
13722 * Configuration (optional).
13723 * @property {boolean | null | undefined} [includeImageAlt=true]
13724 * Whether to use `alt` for `image`s.
13725 * @property {boolean | null | undefined} [includeHtml=true]
13726 * Whether to use `value` of HTML.
13727 */
13728
13729 /** @type {Options} */
13730 const emptyOptions = {}
13731
13732 /**
13733 * Get the text content of a node or list of nodes.
13734 *
13735 * Prefers the node’s plain-text fields, otherwise serializes its children,
13736 * and if the given value is an array, serialize the nodes in it.
13737 *
13738 * @param {unknown} value
13739 * Thing to serialize, typically `Node`.
13740 * @param {Options | null | undefined} [options]
13741 * Configuration (optional).
13742 * @returns {string}
13743 * Serialized `value`.
13744 */
13745 function toString(value, options) {
13746 const settings = options || emptyOptions
13747 const includeImageAlt =
13748 typeof settings.includeImageAlt === 'boolean'
13749 ? settings.includeImageAlt
13750 : true
13751 const includeHtml =
13752 typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true
13753
13754 return one(value, includeImageAlt, includeHtml)
13755 }
13756
13757 /**
13758 * One node or several nodes.
13759 *
13760 * @param {unknown} value
13761 * Thing to serialize.
13762 * @param {boolean} includeImageAlt
13763 * Include image `alt`s.
13764 * @param {boolean} includeHtml
13765 * Include HTML.
13766 * @returns {string}
13767 * Serialized node.
13768 */
13769 function one(value, includeImageAlt, includeHtml) {
13770 if (node(value)) {
13771 if ('value' in value) {
13772 return value.type === 'html' && !includeHtml ? '' : value.value
13773 }
13774
13775 if (includeImageAlt && 'alt' in value && value.alt) {
13776 return value.alt
13777 }
13778
13779 if ('children' in value) {
13780 return all(value.children, includeImageAlt, includeHtml)
13781 }
13782 }
13783
13784 if (Array.isArray(value)) {
13785 return all(value, includeImageAlt, includeHtml)
13786 }
13787
13788 return ''
13789 }
13790
13791 /**
13792 * Serialize a list of nodes.
13793 *
13794 * @param {Array<unknown>} values
13795 * Thing to serialize.
13796 * @param {boolean} includeImageAlt
13797 * Include image `alt`s.
13798 * @param {boolean} includeHtml
13799 * Include HTML.
13800 * @returns {string}
13801 * Serialized nodes.
13802 */
13803 function all(values, includeImageAlt, includeHtml) {
13804 /** @type {Array<string>} */
13805 const result = []
13806 let index = -1
13807
13808 while (++index < values.length) {
13809 result[index] = one(values[index], includeImageAlt, includeHtml)
13810 }
13811
13812 return result.join('')
13813 }
13814
13815 /**
13816 * Check if `value` looks like a node.
13817 *
13818 * @param {unknown} value
13819 * Thing.
13820 * @returns {value is Node}
13821 * Whether `value` is a node.
13822 */
13823 function node(value) {
13824 return Boolean(value && typeof value === 'object')
13825 }
13826
13827
13828 /***/ }),
13829
13830 /***/ "../node_modules/micromark-core-commonmark/dev/lib/attention.js":
13831 /*!**********************************************************************!*\
13832 !*** ../node_modules/micromark-core-commonmark/dev/lib/attention.js ***!
13833 \**********************************************************************/
13834 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13835
13836 "use strict";
13837 __webpack_require__.r(__webpack_exports__);
13838 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13839 /* harmony export */ "attention": () => (/* binding */ attention)
13840 /* harmony export */ });
13841 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
13842 /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js");
13843 /* harmony import */ var micromark_util_classify_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-classify-character */ "../node_modules/micromark-util-classify-character/dev/index.js");
13844 /* harmony import */ var micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-resolve-all */ "../node_modules/micromark-util-resolve-all/index.js");
13845 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
13846 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
13847 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
13848 /**
13849 * @typedef {import('micromark-util-types').Construct} Construct
13850 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
13851 * @typedef {import('micromark-util-types').Resolver} Resolver
13852 * @typedef {import('micromark-util-types').State} State
13853 * @typedef {import('micromark-util-types').Token} Token
13854 * @typedef {import('micromark-util-types').Event} Event
13855 * @typedef {import('micromark-util-types').Code} Code
13856 * @typedef {import('micromark-util-types').Point} Point
13857 */
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867 /** @type {Construct} */
13868 const attention = {
13869 name: 'attention',
13870 tokenize: tokenizeAttention,
13871 resolveAll: resolveAllAttention
13872 }
13873
13874 /**
13875 * Take all events and resolve attention to emphasis or strong.
13876 *
13877 * @type {Resolver}
13878 */
13879 function resolveAllAttention(events, context) {
13880 let index = -1
13881 /** @type {number} */
13882 let open
13883 /** @type {Token} */
13884 let group
13885 /** @type {Token} */
13886 let text
13887 /** @type {Token} */
13888 let openingSequence
13889 /** @type {Token} */
13890 let closingSequence
13891 /** @type {number} */
13892 let use
13893 /** @type {Event[]} */
13894 let nextEvents
13895 /** @type {number} */
13896 let offset
13897
13898 // Walk through all events.
13899 //
13900 // Note: performance of this is fine on an mb of normal markdown, but it’s
13901 // a bottleneck for malicious stuff.
13902 while (++index < events.length) {
13903 // Find a token that can close.
13904 if (
13905 events[index][0] === 'enter' &&
13906 events[index][1].type === 'attentionSequence' &&
13907 events[index][1]._close
13908 ) {
13909 open = index
13910
13911 // Now walk back to find an opener.
13912 while (open--) {
13913 // Find a token that can open the closer.
13914 if (
13915 events[open][0] === 'exit' &&
13916 events[open][1].type === 'attentionSequence' &&
13917 events[open][1]._open &&
13918 // If the markers are the same:
13919 context.sliceSerialize(events[open][1]).charCodeAt(0) ===
13920 context.sliceSerialize(events[index][1]).charCodeAt(0)
13921 ) {
13922 // If the opening can close or the closing can open,
13923 // and the close size *is not* a multiple of three,
13924 // but the sum of the opening and closing size *is* multiple of three,
13925 // then don’t match.
13926 if (
13927 (events[open][1]._close || events[index][1]._open) &&
13928 (events[index][1].end.offset - events[index][1].start.offset) % 3 &&
13929 !(
13930 (events[open][1].end.offset -
13931 events[open][1].start.offset +
13932 events[index][1].end.offset -
13933 events[index][1].start.offset) %
13934 3
13935 )
13936 ) {
13937 continue
13938 }
13939
13940 // Number of markers to use from the sequence.
13941 use =
13942 events[open][1].end.offset - events[open][1].start.offset > 1 &&
13943 events[index][1].end.offset - events[index][1].start.offset > 1
13944 ? 2
13945 : 1
13946
13947 const start = Object.assign({}, events[open][1].end)
13948 const end = Object.assign({}, events[index][1].start)
13949 movePoint(start, -use)
13950 movePoint(end, use)
13951
13952 openingSequence = {
13953 type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strongSequence : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasisSequence,
13954 start,
13955 end: Object.assign({}, events[open][1].end)
13956 }
13957 closingSequence = {
13958 type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strongSequence : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasisSequence,
13959 start: Object.assign({}, events[index][1].start),
13960 end
13961 }
13962 text = {
13963 type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strongText : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasisText,
13964 start: Object.assign({}, events[open][1].end),
13965 end: Object.assign({}, events[index][1].start)
13966 }
13967 group = {
13968 type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strong : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasis,
13969 start: Object.assign({}, openingSequence.start),
13970 end: Object.assign({}, closingSequence.end)
13971 }
13972
13973 events[open][1].end = Object.assign({}, openingSequence.start)
13974 events[index][1].start = Object.assign({}, closingSequence.end)
13975
13976 nextEvents = []
13977
13978 // If there are more markers in the opening, add them before.
13979 if (events[open][1].end.offset - events[open][1].start.offset) {
13980 nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [
13981 ['enter', events[open][1], context],
13982 ['exit', events[open][1], context]
13983 ])
13984 }
13985
13986 // Opening.
13987 nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [
13988 ['enter', group, context],
13989 ['enter', openingSequence, context],
13990 ['exit', openingSequence, context],
13991 ['enter', text, context]
13992 ])
13993
13994 // Between.
13995 nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(
13996 nextEvents,
13997 (0,micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__.resolveAll)(
13998 context.parser.constructs.insideSpan.null,
13999 events.slice(open + 1, index),
14000 context
14001 )
14002 )
14003
14004 // Closing.
14005 nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [
14006 ['exit', text, context],
14007 ['enter', closingSequence, context],
14008 ['exit', closingSequence, context],
14009 ['exit', group, context]
14010 ])
14011
14012 // If there are more markers in the closing, add them after.
14013 if (events[index][1].end.offset - events[index][1].start.offset) {
14014 offset = 2
14015 nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [
14016 ['enter', events[index][1], context],
14017 ['exit', events[index][1], context]
14018 ])
14019 } else {
14020 offset = 0
14021 }
14022
14023 (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, open - 1, index - open + 3, nextEvents)
14024
14025 index = open + nextEvents.length - offset - 2
14026 break
14027 }
14028 }
14029 }
14030 }
14031
14032 // Remove remaining sequences.
14033 index = -1
14034
14035 while (++index < events.length) {
14036 if (events[index][1].type === 'attentionSequence') {
14037 events[index][1].type = 'data'
14038 }
14039 }
14040
14041 return events
14042 }
14043
14044 /** @type {Tokenizer} */
14045 function tokenizeAttention(effects, ok) {
14046 const attentionMarkers = this.parser.constructs.attentionMarkers.null
14047 const previous = this.previous
14048 const before = (0,micromark_util_classify_character__WEBPACK_IMPORTED_MODULE_4__.classifyCharacter)(previous)
14049
14050 /** @type {NonNullable<Code>} */
14051 let marker
14052
14053 return start
14054
14055 /** @type {State} */
14056 function start(code) {
14057 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
14058 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.asterisk || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.underscore,
14059 'expected asterisk or underscore'
14060 )
14061 effects.enter('attentionSequence')
14062 marker = code
14063 return sequence(code)
14064 }
14065
14066 /** @type {State} */
14067 function sequence(code) {
14068 if (code === marker) {
14069 effects.consume(code)
14070 return sequence
14071 }
14072
14073 const token = effects.exit('attentionSequence')
14074 const after = (0,micromark_util_classify_character__WEBPACK_IMPORTED_MODULE_4__.classifyCharacter)(code)
14075
14076 const open =
14077 !after ||
14078 (after === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_6__.constants.characterGroupPunctuation && before) ||
14079 attentionMarkers.includes(code)
14080 const close =
14081 !before ||
14082 (before === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_6__.constants.characterGroupPunctuation && after) ||
14083 attentionMarkers.includes(previous)
14084
14085 token._open = Boolean(
14086 marker === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.asterisk ? open : open && (before || !close)
14087 )
14088 token._close = Boolean(
14089 marker === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.asterisk ? close : close && (after || !open)
14090 )
14091 return ok(code)
14092 }
14093 }
14094
14095 /**
14096 * Move a point a bit.
14097 *
14098 * Note: `move` only works inside lines! It’s not possible to move past other
14099 * chunks (replacement characters, tabs, or line endings).
14100 *
14101 * @param {Point} point
14102 * @param {number} offset
14103 * @returns {void}
14104 */
14105 function movePoint(point, offset) {
14106 point.column += offset
14107 point.offset += offset
14108 point._bufferIndex += offset
14109 }
14110
14111
14112 /***/ }),
14113
14114 /***/ "../node_modules/micromark-core-commonmark/dev/lib/autolink.js":
14115 /*!*********************************************************************!*\
14116 !*** ../node_modules/micromark-core-commonmark/dev/lib/autolink.js ***!
14117 \*********************************************************************/
14118 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14119
14120 "use strict";
14121 __webpack_require__.r(__webpack_exports__);
14122 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14123 /* harmony export */ "autolink": () => (/* binding */ autolink)
14124 /* harmony export */ });
14125 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
14126 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
14127 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
14128 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
14129 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
14130 /**
14131 * @typedef {import('micromark-util-types').Construct} Construct
14132 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
14133 * @typedef {import('micromark-util-types').State} State
14134 */
14135
14136
14137
14138
14139
14140
14141
14142 /** @type {Construct} */
14143 const autolink = {name: 'autolink', tokenize: tokenizeAutolink}
14144
14145 /** @type {Tokenizer} */
14146 function tokenizeAutolink(effects, ok, nok) {
14147 let size = 1
14148
14149 return start
14150
14151 /** @type {State} */
14152 function start(code) {
14153 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan, 'expected `<`')
14154 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolink)
14155 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker)
14156 effects.consume(code)
14157 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker)
14158 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkProtocol)
14159 return open
14160 }
14161
14162 /** @type {State} */
14163 function open(code) {
14164 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) {
14165 effects.consume(code)
14166 return schemeOrEmailAtext
14167 }
14168
14169 return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAtext)(code) ? emailAtext(code) : nok(code)
14170 }
14171
14172 /** @type {State} */
14173 function schemeOrEmailAtext(code) {
14174 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.plusSign ||
14175 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash ||
14176 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot ||
14177 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)
14178 ? schemeInsideOrEmailAtext(code)
14179 : emailAtext(code)
14180 }
14181
14182 /** @type {State} */
14183 function schemeInsideOrEmailAtext(code) {
14184 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon) {
14185 effects.consume(code)
14186 return urlInside
14187 }
14188
14189 if (
14190 (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.plusSign ||
14191 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash ||
14192 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot ||
14193 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) &&
14194 size++ < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.autolinkSchemeSizeMax
14195 ) {
14196 effects.consume(code)
14197 return schemeInsideOrEmailAtext
14198 }
14199
14200 return emailAtext(code)
14201 }
14202
14203 /** @type {State} */
14204 function urlInside(code) {
14205 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
14206 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkProtocol)
14207 return end(code)
14208 }
14209
14210 if (
14211 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof ||
14212 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.space ||
14213 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan ||
14214 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiControl)(code)
14215 ) {
14216 return nok(code)
14217 }
14218
14219 effects.consume(code)
14220 return urlInside
14221 }
14222
14223 /** @type {State} */
14224 function emailAtext(code) {
14225 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.atSign) {
14226 effects.consume(code)
14227 size = 0
14228 return emailAtSignOrDot
14229 }
14230
14231 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAtext)(code)) {
14232 effects.consume(code)
14233 return emailAtext
14234 }
14235
14236 return nok(code)
14237 }
14238
14239 /** @type {State} */
14240 function emailAtSignOrDot(code) {
14241 return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code) ? emailLabel(code) : nok(code)
14242 }
14243
14244 /** @type {State} */
14245 function emailLabel(code) {
14246 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot) {
14247 effects.consume(code)
14248 size = 0
14249 return emailAtSignOrDot
14250 }
14251
14252 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
14253 // Exit, then change the type.
14254 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkProtocol).type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkEmail
14255 return end(code)
14256 }
14257
14258 return emailValue(code)
14259 }
14260
14261 /** @type {State} */
14262 function emailValue(code) {
14263 if (
14264 (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) &&
14265 size++ < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.autolinkDomainSizeMax
14266 ) {
14267 effects.consume(code)
14268 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash ? emailValue : emailLabel
14269 }
14270
14271 return nok(code)
14272 }
14273
14274 /** @type {State} */
14275 function end(code) {
14276 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan, 'expected `>`')
14277 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker)
14278 effects.consume(code)
14279 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker)
14280 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolink)
14281 return ok
14282 }
14283 }
14284
14285
14286 /***/ }),
14287
14288 /***/ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js":
14289 /*!***********************************************************************!*\
14290 !*** ../node_modules/micromark-core-commonmark/dev/lib/blank-line.js ***!
14291 \***********************************************************************/
14292 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14293
14294 "use strict";
14295 __webpack_require__.r(__webpack_exports__);
14296 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14297 /* harmony export */ "blankLine": () => (/* binding */ blankLine)
14298 /* harmony export */ });
14299 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
14300 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
14301 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
14302 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
14303 /**
14304 * @typedef {import('micromark-util-types').Construct} Construct
14305 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
14306 * @typedef {import('micromark-util-types').State} State
14307 */
14308
14309
14310
14311
14312
14313
14314 /** @type {Construct} */
14315 const blankLine = {tokenize: tokenizeBlankLine, partial: true}
14316
14317 /** @type {Tokenizer} */
14318 function tokenizeBlankLine(effects, ok, nok) {
14319 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_0__.factorySpace)(effects, afterWhitespace, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix)
14320
14321 /** @type {State} */
14322 function afterWhitespace(code) {
14323 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code) ? ok(code) : nok(code)
14324 }
14325 }
14326
14327
14328 /***/ }),
14329
14330 /***/ "../node_modules/micromark-core-commonmark/dev/lib/block-quote.js":
14331 /*!************************************************************************!*\
14332 !*** ../node_modules/micromark-core-commonmark/dev/lib/block-quote.js ***!
14333 \************************************************************************/
14334 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14335
14336 "use strict";
14337 __webpack_require__.r(__webpack_exports__);
14338 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14339 /* harmony export */ "blockQuote": () => (/* binding */ blockQuote)
14340 /* harmony export */ });
14341 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
14342 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
14343 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
14344 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
14345 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
14346 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
14347 /**
14348 * @typedef {import('micromark-util-types').Construct} Construct
14349 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
14350 * @typedef {import('micromark-util-types').Exiter} Exiter
14351 * @typedef {import('micromark-util-types').State} State
14352 */
14353
14354
14355
14356
14357
14358
14359
14360
14361 /** @type {Construct} */
14362 const blockQuote = {
14363 name: 'blockQuote',
14364 tokenize: tokenizeBlockQuoteStart,
14365 continuation: {tokenize: tokenizeBlockQuoteContinuation},
14366 exit
14367 }
14368
14369 /** @type {Tokenizer} */
14370 function tokenizeBlockQuoteStart(effects, ok, nok) {
14371 const self = this
14372
14373 return start
14374
14375 /** @type {State} */
14376 function start(code) {
14377 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
14378 const state = self.containerState
14379
14380 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(state, 'expected `containerState` to be defined in container')
14381
14382 if (!state.open) {
14383 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuote, {_container: true})
14384 state.open = true
14385 }
14386
14387 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefix)
14388 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuoteMarker)
14389 effects.consume(code)
14390 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuoteMarker)
14391 return after
14392 }
14393
14394 return nok(code)
14395 }
14396
14397 /** @type {State} */
14398 function after(code) {
14399 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
14400 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefixWhitespace)
14401 effects.consume(code)
14402 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefixWhitespace)
14403 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefix)
14404 return ok
14405 }
14406
14407 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefix)
14408 return ok(code)
14409 }
14410 }
14411
14412 /** @type {Tokenizer} */
14413 function tokenizeBlockQuoteContinuation(effects, ok, nok) {
14414 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(
14415 effects,
14416 effects.attempt(blockQuote, ok, nok),
14417 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.linePrefix,
14418 this.parser.constructs.disable.null.includes('codeIndented')
14419 ? undefined
14420 : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize
14421 )
14422 }
14423
14424 /** @type {Exiter} */
14425 function exit(effects) {
14426 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuote)
14427 }
14428
14429
14430 /***/ }),
14431
14432 /***/ "../node_modules/micromark-core-commonmark/dev/lib/character-escape.js":
14433 /*!*****************************************************************************!*\
14434 !*** ../node_modules/micromark-core-commonmark/dev/lib/character-escape.js ***!
14435 \*****************************************************************************/
14436 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14437
14438 "use strict";
14439 __webpack_require__.r(__webpack_exports__);
14440 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14441 /* harmony export */ "characterEscape": () => (/* binding */ characterEscape)
14442 /* harmony export */ });
14443 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
14444 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
14445 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
14446 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
14447 /**
14448 * @typedef {import('micromark-util-types').Construct} Construct
14449 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
14450 * @typedef {import('micromark-util-types').State} State
14451 */
14452
14453
14454
14455
14456
14457
14458 /** @type {Construct} */
14459 const characterEscape = {
14460 name: 'characterEscape',
14461 tokenize: tokenizeCharacterEscape
14462 }
14463
14464 /** @type {Tokenizer} */
14465 function tokenizeCharacterEscape(effects, ok, nok) {
14466 return start
14467
14468 /** @type {State} */
14469 function start(code) {
14470 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash, 'expected `\\`')
14471 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscape)
14472 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker)
14473 effects.consume(code)
14474 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker)
14475 return open
14476 }
14477
14478 /** @type {State} */
14479 function open(code) {
14480 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiPunctuation)(code)) {
14481 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscapeValue)
14482 effects.consume(code)
14483 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscapeValue)
14484 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscape)
14485 return ok
14486 }
14487
14488 return nok(code)
14489 }
14490 }
14491
14492
14493 /***/ }),
14494
14495 /***/ "../node_modules/micromark-core-commonmark/dev/lib/character-reference.js":
14496 /*!********************************************************************************!*\
14497 !*** ../node_modules/micromark-core-commonmark/dev/lib/character-reference.js ***!
14498 \********************************************************************************/
14499 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14500
14501 "use strict";
14502 __webpack_require__.r(__webpack_exports__);
14503 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14504 /* harmony export */ "characterReference": () => (/* binding */ characterReference)
14505 /* harmony export */ });
14506 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
14507 /* harmony import */ var decode_named_character_reference__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! decode-named-character-reference */ "../node_modules/decode-named-character-reference/index.dom.js");
14508 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
14509 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
14510 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
14511 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
14512 /**
14513 * @typedef {import('micromark-util-types').Construct} Construct
14514 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
14515 * @typedef {import('micromark-util-types').Token} Token
14516 * @typedef {import('micromark-util-types').State} State
14517 * @typedef {import('micromark-util-types').Code} Code
14518 */
14519
14520
14521
14522
14523
14524
14525
14526
14527 /** @type {Construct} */
14528 const characterReference = {
14529 name: 'characterReference',
14530 tokenize: tokenizeCharacterReference
14531 }
14532
14533 /** @type {Tokenizer} */
14534 function tokenizeCharacterReference(effects, ok, nok) {
14535 const self = this
14536 let size = 0
14537 /** @type {number} */
14538 let max
14539 /** @type {(code: Code) => code is number} */
14540 let test
14541
14542 return start
14543
14544 /** @type {State} */
14545 function start(code) {
14546 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.ampersand, 'expected `&`')
14547 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReference)
14548 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker)
14549 effects.consume(code)
14550 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker)
14551 return open
14552 }
14553
14554 /** @type {State} */
14555 function open(code) {
14556 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.numberSign) {
14557 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerNumeric)
14558 effects.consume(code)
14559 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerNumeric)
14560 return numeric
14561 }
14562
14563 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue)
14564 max = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.characterReferenceNamedSizeMax
14565 test = micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric
14566 return value(code)
14567 }
14568
14569 /** @type {State} */
14570 function numeric(code) {
14571 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.uppercaseX || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lowercaseX) {
14572 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerHexadecimal)
14573 effects.consume(code)
14574 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerHexadecimal)
14575 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue)
14576 max = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.characterReferenceHexadecimalSizeMax
14577 test = micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiHexDigit
14578 return value
14579 }
14580
14581 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue)
14582 max = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.characterReferenceDecimalSizeMax
14583 test = micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiDigit
14584 return value(code)
14585 }
14586
14587 /** @type {State} */
14588 function value(code) {
14589 /** @type {Token} */
14590 let token
14591
14592 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.semicolon && size) {
14593 token = effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue)
14594
14595 if (
14596 test === micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric &&
14597 !(0,decode_named_character_reference__WEBPACK_IMPORTED_MODULE_5__.decodeNamedCharacterReference)(self.sliceSerialize(token))
14598 ) {
14599 return nok(code)
14600 }
14601
14602 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker)
14603 effects.consume(code)
14604 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker)
14605 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReference)
14606 return ok
14607 }
14608
14609 if (test(code) && size++ < max) {
14610 effects.consume(code)
14611 return value
14612 }
14613
14614 return nok(code)
14615 }
14616 }
14617
14618
14619 /***/ }),
14620
14621 /***/ "../node_modules/micromark-core-commonmark/dev/lib/code-fenced.js":
14622 /*!************************************************************************!*\
14623 !*** ../node_modules/micromark-core-commonmark/dev/lib/code-fenced.js ***!
14624 \************************************************************************/
14625 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14626
14627 "use strict";
14628 __webpack_require__.r(__webpack_exports__);
14629 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14630 /* harmony export */ "codeFenced": () => (/* binding */ codeFenced)
14631 /* harmony export */ });
14632 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
14633 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
14634 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
14635 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
14636 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
14637 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
14638 /**
14639 * @typedef {import('micromark-util-types').Construct} Construct
14640 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
14641 * @typedef {import('micromark-util-types').State} State
14642 * @typedef {import('micromark-util-types').Code} Code
14643 */
14644
14645
14646
14647
14648
14649
14650
14651
14652 /** @type {Construct} */
14653 const codeFenced = {
14654 name: 'codeFenced',
14655 tokenize: tokenizeCodeFenced,
14656 concrete: true
14657 }
14658
14659 /** @type {Tokenizer} */
14660 function tokenizeCodeFenced(effects, ok, nok) {
14661 const self = this
14662 /** @type {Construct} */
14663 const closingFenceConstruct = {tokenize: tokenizeClosingFence, partial: true}
14664 /** @type {Construct} */
14665 const nonLazyLine = {tokenize: tokenizeNonLazyLine, partial: true}
14666 const tail = this.events[this.events.length - 1]
14667 const initialPrefix =
14668 tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix
14669 ? tail[2].sliceSerialize(tail[1], true).length
14670 : 0
14671 let sizeOpen = 0
14672 /** @type {NonNullable<Code>} */
14673 let marker
14674
14675 return start
14676
14677 /** @type {State} */
14678 function start(code) {
14679 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
14680 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.tilde,
14681 'expected `` ` `` or `~`'
14682 )
14683 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFenced)
14684 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence)
14685 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence)
14686 marker = code
14687 return sequenceOpen(code)
14688 }
14689
14690 /** @type {State} */
14691 function sequenceOpen(code) {
14692 if (code === marker) {
14693 effects.consume(code)
14694 sizeOpen++
14695 return sequenceOpen
14696 }
14697
14698 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence)
14699 return sizeOpen < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.codeFencedSequenceSizeMin
14700 ? nok(code)
14701 : (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, infoOpen, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code)
14702 }
14703
14704 /** @type {State} */
14705 function infoOpen(code) {
14706 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
14707 return openAfter(code)
14708 }
14709
14710 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceInfo)
14711 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString})
14712 return info(code)
14713 }
14714
14715 /** @type {State} */
14716 function info(code) {
14717 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEndingOrSpace)(code)) {
14718 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString)
14719 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceInfo)
14720 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, infoAfter, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code)
14721 }
14722
14723 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent && code === marker) return nok(code)
14724 effects.consume(code)
14725 return info
14726 }
14727
14728 /** @type {State} */
14729 function infoAfter(code) {
14730 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
14731 return openAfter(code)
14732 }
14733
14734 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceMeta)
14735 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString})
14736 return meta(code)
14737 }
14738
14739 /** @type {State} */
14740 function meta(code) {
14741 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
14742 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString)
14743 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceMeta)
14744 return openAfter(code)
14745 }
14746
14747 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent && code === marker) return nok(code)
14748 effects.consume(code)
14749 return meta
14750 }
14751
14752 /** @type {State} */
14753 function openAfter(code) {
14754 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence)
14755 return self.interrupt ? ok(code) : contentStart(code)
14756 }
14757
14758 /** @type {State} */
14759 function contentStart(code) {
14760 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) {
14761 return after(code)
14762 }
14763
14764 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
14765 return effects.attempt(
14766 nonLazyLine,
14767 effects.attempt(
14768 closingFenceConstruct,
14769 after,
14770 initialPrefix
14771 ? (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(
14772 effects,
14773 contentStart,
14774 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix,
14775 initialPrefix + 1
14776 )
14777 : contentStart
14778 ),
14779 after
14780 )(code)
14781 }
14782
14783 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFlowValue)
14784 return contentContinue(code)
14785 }
14786
14787 /** @type {State} */
14788 function contentContinue(code) {
14789 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
14790 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFlowValue)
14791 return contentStart(code)
14792 }
14793
14794 effects.consume(code)
14795 return contentContinue
14796 }
14797
14798 /** @type {State} */
14799 function after(code) {
14800 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFenced)
14801 return ok(code)
14802 }
14803
14804 /** @type {Tokenizer} */
14805 function tokenizeNonLazyLine(effects, ok, nok) {
14806 const self = this
14807
14808 return start
14809
14810 /** @type {State} */
14811 function start(code) {
14812 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code), 'expected eol')
14813 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
14814 effects.consume(code)
14815 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
14816 return lineStart
14817 }
14818
14819 /** @type {State} */
14820 function lineStart(code) {
14821 return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
14822 }
14823 }
14824
14825 /** @type {Tokenizer} */
14826 function tokenizeClosingFence(effects, ok, nok) {
14827 let size = 0
14828
14829 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(
14830 effects,
14831 closingSequenceStart,
14832 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix,
14833 this.parser.constructs.disable.null.includes('codeIndented')
14834 ? undefined
14835 : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.tabSize
14836 )
14837
14838 /** @type {State} */
14839 function closingSequenceStart(code) {
14840 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence)
14841 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence)
14842 return closingSequence(code)
14843 }
14844
14845 /** @type {State} */
14846 function closingSequence(code) {
14847 if (code === marker) {
14848 effects.consume(code)
14849 size++
14850 return closingSequence
14851 }
14852
14853 if (size < sizeOpen) return nok(code)
14854 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence)
14855 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, closingSequenceEnd, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code)
14856 }
14857
14858 /** @type {State} */
14859 function closingSequenceEnd(code) {
14860 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
14861 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence)
14862 return ok(code)
14863 }
14864
14865 return nok(code)
14866 }
14867 }
14868 }
14869
14870
14871 /***/ }),
14872
14873 /***/ "../node_modules/micromark-core-commonmark/dev/lib/code-indented.js":
14874 /*!**************************************************************************!*\
14875 !*** ../node_modules/micromark-core-commonmark/dev/lib/code-indented.js ***!
14876 \**************************************************************************/
14877 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14878
14879 "use strict";
14880 __webpack_require__.r(__webpack_exports__);
14881 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14882 /* harmony export */ "codeIndented": () => (/* binding */ codeIndented)
14883 /* harmony export */ });
14884 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
14885 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
14886 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
14887 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
14888 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
14889 /**
14890 * @typedef {import('micromark-util-types').Construct} Construct
14891 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
14892 * @typedef {import('micromark-util-types').Resolver} Resolver
14893 * @typedef {import('micromark-util-types').Token} Token
14894 * @typedef {import('micromark-util-types').State} State
14895 */
14896
14897
14898
14899
14900
14901
14902
14903 /** @type {Construct} */
14904 const codeIndented = {
14905 name: 'codeIndented',
14906 tokenize: tokenizeCodeIndented
14907 }
14908
14909 /** @type {Construct} */
14910 const indentedContent = {tokenize: tokenizeIndentedContent, partial: true}
14911
14912 /** @type {Tokenizer} */
14913 function tokenizeCodeIndented(effects, ok, nok) {
14914 const self = this
14915 return start
14916
14917 /** @type {State} */
14918 function start(code) {
14919 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeIndented)
14920 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_1__.factorySpace)(
14921 effects,
14922 afterStartPrefix,
14923 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix,
14924 micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize + 1
14925 )(code)
14926 }
14927
14928 /** @type {State} */
14929 function afterStartPrefix(code) {
14930 const tail = self.events[self.events.length - 1]
14931 return tail &&
14932 tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix &&
14933 tail[2].sliceSerialize(tail[1], true).length >= micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize
14934 ? afterPrefix(code)
14935 : nok(code)
14936 }
14937
14938 /** @type {State} */
14939 function afterPrefix(code) {
14940 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof) {
14941 return after(code)
14942 }
14943
14944 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
14945 return effects.attempt(indentedContent, afterPrefix, after)(code)
14946 }
14947
14948 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeFlowValue)
14949 return content(code)
14950 }
14951
14952 /** @type {State} */
14953 function content(code) {
14954 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
14955 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeFlowValue)
14956 return afterPrefix(code)
14957 }
14958
14959 effects.consume(code)
14960 return content
14961 }
14962
14963 /** @type {State} */
14964 function after(code) {
14965 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeIndented)
14966 return ok(code)
14967 }
14968 }
14969
14970 /** @type {Tokenizer} */
14971 function tokenizeIndentedContent(effects, ok, nok) {
14972 const self = this
14973
14974 return start
14975
14976 /** @type {State} */
14977 function start(code) {
14978 // If this is a lazy line, it can’t be code.
14979 if (self.parser.lazy[self.now().line]) {
14980 return nok(code)
14981 }
14982
14983 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
14984 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.lineEnding)
14985 effects.consume(code)
14986 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.lineEnding)
14987 return start
14988 }
14989
14990 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_1__.factorySpace)(
14991 effects,
14992 afterPrefix,
14993 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix,
14994 micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize + 1
14995 )(code)
14996 }
14997
14998 /** @type {State} */
14999 function afterPrefix(code) {
15000 const tail = self.events[self.events.length - 1]
15001 return tail &&
15002 tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix &&
15003 tail[2].sliceSerialize(tail[1], true).length >= micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize
15004 ? ok(code)
15005 : (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)
15006 ? start(code)
15007 : nok(code)
15008 }
15009 }
15010
15011
15012 /***/ }),
15013
15014 /***/ "../node_modules/micromark-core-commonmark/dev/lib/code-text.js":
15015 /*!**********************************************************************!*\
15016 !*** ../node_modules/micromark-core-commonmark/dev/lib/code-text.js ***!
15017 \**********************************************************************/
15018 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15019
15020 "use strict";
15021 __webpack_require__.r(__webpack_exports__);
15022 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15023 /* harmony export */ "codeText": () => (/* binding */ codeText)
15024 /* harmony export */ });
15025 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
15026 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
15027 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
15028 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
15029 /**
15030 * @typedef {import('micromark-util-types').Construct} Construct
15031 * @typedef {import('micromark-util-types').Resolver} Resolver
15032 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
15033 * @typedef {import('micromark-util-types').Previous} Previous
15034 * @typedef {import('micromark-util-types').Token} Token
15035 * @typedef {import('micromark-util-types').State} State
15036 */
15037
15038
15039
15040
15041
15042
15043 /** @type {Construct} */
15044 const codeText = {
15045 name: 'codeText',
15046 tokenize: tokenizeCodeText,
15047 resolve: resolveCodeText,
15048 previous
15049 }
15050
15051 /** @type {Resolver} */
15052 function resolveCodeText(events) {
15053 let tailExitIndex = events.length - 4
15054 let headEnterIndex = 3
15055 /** @type {number} */
15056 let index
15057 /** @type {number|undefined} */
15058 let enter
15059
15060 // If we start and end with an EOL or a space.
15061 if (
15062 (events[headEnterIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding ||
15063 events[headEnterIndex][1].type === 'space') &&
15064 (events[tailExitIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding ||
15065 events[tailExitIndex][1].type === 'space')
15066 ) {
15067 index = headEnterIndex
15068
15069 // And we have data.
15070 while (++index < tailExitIndex) {
15071 if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData) {
15072 // Then we have padding.
15073 events[headEnterIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextPadding
15074 events[tailExitIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextPadding
15075 headEnterIndex += 2
15076 tailExitIndex -= 2
15077 break
15078 }
15079 }
15080 }
15081
15082 // Merge adjacent spaces and data.
15083 index = headEnterIndex - 1
15084 tailExitIndex++
15085
15086 while (++index <= tailExitIndex) {
15087 if (enter === undefined) {
15088 if (
15089 index !== tailExitIndex &&
15090 events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding
15091 ) {
15092 enter = index
15093 }
15094 } else if (
15095 index === tailExitIndex ||
15096 events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding
15097 ) {
15098 events[enter][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData
15099
15100 if (index !== enter + 2) {
15101 events[enter][1].end = events[index - 1][1].end
15102 events.splice(enter + 2, index - enter - 2)
15103 tailExitIndex -= index - enter - 2
15104 index = enter + 2
15105 }
15106
15107 enter = undefined
15108 }
15109 }
15110
15111 return events
15112 }
15113
15114 /** @type {Previous} */
15115 function previous(code) {
15116 // If there is a previous code, there will always be a tail.
15117 return (
15118 code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent ||
15119 this.events[this.events.length - 1][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.characterEscape
15120 )
15121 }
15122
15123 /** @type {Tokenizer} */
15124 function tokenizeCodeText(effects, ok, nok) {
15125 const self = this
15126 let sizeOpen = 0
15127 /** @type {number} */
15128 let size
15129 /** @type {Token} */
15130 let token
15131
15132 return start
15133
15134 /** @type {State} */
15135 function start(code) {
15136 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent, 'expected `` ` ``')
15137 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(previous.call(self, self.previous), 'expected correct previous')
15138 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeText)
15139 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence)
15140 return openingSequence(code)
15141 }
15142
15143 /** @type {State} */
15144 function openingSequence(code) {
15145 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent) {
15146 effects.consume(code)
15147 sizeOpen++
15148 return openingSequence
15149 }
15150
15151 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence)
15152 return gap(code)
15153 }
15154
15155 /** @type {State} */
15156 function gap(code) {
15157 // EOF.
15158 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) {
15159 return nok(code)
15160 }
15161
15162 // Closing fence?
15163 // Could also be data.
15164 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent) {
15165 token = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence)
15166 size = 0
15167 return closingSequence(code)
15168 }
15169
15170 // Tabs don’t work, and virtual spaces don’t make sense.
15171 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.space) {
15172 effects.enter('space')
15173 effects.consume(code)
15174 effects.exit('space')
15175 return gap
15176 }
15177
15178 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
15179 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
15180 effects.consume(code)
15181 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
15182 return gap
15183 }
15184
15185 // Data.
15186 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData)
15187 return data(code)
15188 }
15189
15190 // In code.
15191 /** @type {State} */
15192 function data(code) {
15193 if (
15194 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof ||
15195 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.space ||
15196 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent ||
15197 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)
15198 ) {
15199 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData)
15200 return gap(code)
15201 }
15202
15203 effects.consume(code)
15204 return data
15205 }
15206
15207 // Closing fence.
15208 /** @type {State} */
15209 function closingSequence(code) {
15210 // More.
15211 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent) {
15212 effects.consume(code)
15213 size++
15214 return closingSequence
15215 }
15216
15217 // Done!
15218 if (size === sizeOpen) {
15219 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence)
15220 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeText)
15221 return ok(code)
15222 }
15223
15224 // More or less accents: mark as data.
15225 token.type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData
15226 return data(code)
15227 }
15228 }
15229
15230
15231 /***/ }),
15232
15233 /***/ "../node_modules/micromark-core-commonmark/dev/lib/content.js":
15234 /*!********************************************************************!*\
15235 !*** ../node_modules/micromark-core-commonmark/dev/lib/content.js ***!
15236 \********************************************************************/
15237 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15238
15239 "use strict";
15240 __webpack_require__.r(__webpack_exports__);
15241 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15242 /* harmony export */ "content": () => (/* binding */ content)
15243 /* harmony export */ });
15244 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
15245 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
15246 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
15247 /* harmony import */ var micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-subtokenize */ "../node_modules/micromark-util-subtokenize/dev/index.js");
15248 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
15249 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
15250 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
15251 /**
15252 * @typedef {import('micromark-util-types').Construct} Construct
15253 * @typedef {import('micromark-util-types').Resolver} Resolver
15254 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
15255 * @typedef {import('micromark-util-types').Token} Token
15256 * @typedef {import('micromark-util-types').State} State
15257 */
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267 /**
15268 * No name because it must not be turned off.
15269 * @type {Construct}
15270 */
15271 const content = {tokenize: tokenizeContent, resolve: resolveContent}
15272
15273 /** @type {Construct} */
15274 const continuationConstruct = {tokenize: tokenizeContinuation, partial: true}
15275
15276 /**
15277 * Content is transparent: it’s parsed right now. That way, definitions are also
15278 * parsed right now: before text in paragraphs (specifically, media) are parsed.
15279 *
15280 * @type {Resolver}
15281 */
15282 function resolveContent(events) {
15283 ;(0,micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_1__.subtokenize)(events)
15284 return events
15285 }
15286
15287 /** @type {Tokenizer} */
15288 function tokenizeContent(effects, ok) {
15289 /** @type {Token} */
15290 let previous
15291
15292 return start
15293
15294 /** @type {State} */
15295 function start(code) {
15296 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
15297 code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof && !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code),
15298 'expected no eof or eol'
15299 )
15300
15301 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.content)
15302 previous = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent, {
15303 contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeContent
15304 })
15305 return data(code)
15306 }
15307
15308 /** @type {State} */
15309 function data(code) {
15310 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) {
15311 return contentEnd(code)
15312 }
15313
15314 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
15315 return effects.check(
15316 continuationConstruct,
15317 contentContinue,
15318 contentEnd
15319 )(code)
15320 }
15321
15322 // Data.
15323 effects.consume(code)
15324 return data
15325 }
15326
15327 /** @type {State} */
15328 function contentEnd(code) {
15329 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent)
15330 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.content)
15331 return ok(code)
15332 }
15333
15334 /** @type {State} */
15335 function contentContinue(code) {
15336 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code), 'expected eol')
15337 effects.consume(code)
15338 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent)
15339 previous.next = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent, {
15340 contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeContent,
15341 previous
15342 })
15343 previous = previous.next
15344 return data
15345 }
15346 }
15347
15348 /** @type {Tokenizer} */
15349 function tokenizeContinuation(effects, ok, nok) {
15350 const self = this
15351
15352 return startLookahead
15353
15354 /** @type {State} */
15355 function startLookahead(code) {
15356 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code), 'expected a line ending')
15357 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent)
15358 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding)
15359 effects.consume(code)
15360 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding)
15361 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__.factorySpace)(effects, prefixed, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix)
15362 }
15363
15364 /** @type {State} */
15365 function prefixed(code) {
15366 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
15367 return nok(code)
15368 }
15369
15370 const tail = self.events[self.events.length - 1]
15371
15372 if (
15373 !self.parser.constructs.disable.null.includes('codeIndented') &&
15374 tail &&
15375 tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix &&
15376 tail[2].sliceSerialize(tail[1], true).length >= micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize
15377 ) {
15378 return ok(code)
15379 }
15380
15381 return effects.interrupt(self.parser.constructs.flow, nok, ok)(code)
15382 }
15383 }
15384
15385
15386 /***/ }),
15387
15388 /***/ "../node_modules/micromark-core-commonmark/dev/lib/definition.js":
15389 /*!***********************************************************************!*\
15390 !*** ../node_modules/micromark-core-commonmark/dev/lib/definition.js ***!
15391 \***********************************************************************/
15392 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15393
15394 "use strict";
15395 __webpack_require__.r(__webpack_exports__);
15396 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15397 /* harmony export */ "definition": () => (/* binding */ definition)
15398 /* harmony export */ });
15399 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
15400 /* harmony import */ var micromark_factory_destination__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-destination */ "../node_modules/micromark-factory-destination/dev/index.js");
15401 /* harmony import */ var micromark_factory_label__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-factory-label */ "../node_modules/micromark-factory-label/dev/index.js");
15402 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
15403 /* harmony import */ var micromark_factory_title__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-factory-title */ "../node_modules/micromark-factory-title/dev/index.js");
15404 /* harmony import */ var micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-factory-whitespace */ "../node_modules/micromark-factory-whitespace/dev/index.js");
15405 /* harmony import */ var micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-normalize-identifier */ "../node_modules/micromark-util-normalize-identifier/dev/index.js");
15406 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
15407 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
15408 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
15409 /**
15410 * @typedef {import('micromark-util-types').Construct} Construct
15411 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
15412 * @typedef {import('micromark-util-types').State} State
15413 */
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426 /** @type {Construct} */
15427 const definition = {name: 'definition', tokenize: tokenizeDefinition}
15428
15429 /** @type {Construct} */
15430 const titleConstruct = {tokenize: tokenizeTitle, partial: true}
15431
15432 /** @type {Tokenizer} */
15433 function tokenizeDefinition(effects, ok, nok) {
15434 const self = this
15435 /** @type {string} */
15436 let identifier
15437
15438 return start
15439
15440 /** @type {State} */
15441 function start(code) {
15442 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket, 'expected `[`')
15443 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definition)
15444 return micromark_factory_label__WEBPACK_IMPORTED_MODULE_3__.factoryLabel.call(
15445 self,
15446 effects,
15447 labelAfter,
15448 nok,
15449 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionLabel,
15450 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionLabelMarker,
15451 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionLabelString
15452 )(code)
15453 }
15454
15455 /** @type {State} */
15456 function labelAfter(code) {
15457 identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_4__.normalizeIdentifier)(
15458 self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)
15459 )
15460
15461 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon) {
15462 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionMarker)
15463 effects.consume(code)
15464 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionMarker)
15465
15466 // Note: blank lines can’t exist in content.
15467 return (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_5__.factoryWhitespace)(
15468 effects,
15469 (0,micromark_factory_destination__WEBPACK_IMPORTED_MODULE_6__.factoryDestination)(
15470 effects,
15471 effects.attempt(
15472 titleConstruct,
15473 (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(effects, after, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace),
15474 (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(effects, after, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace)
15475 ),
15476 nok,
15477 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestination,
15478 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationLiteral,
15479 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationLiteralMarker,
15480 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationRaw,
15481 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationString
15482 )
15483 )
15484 }
15485
15486 return nok(code)
15487 }
15488
15489 /** @type {State} */
15490 function after(code) {
15491 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_8__.markdownLineEnding)(code)) {
15492 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definition)
15493
15494 if (!self.parser.defined.includes(identifier)) {
15495 self.parser.defined.push(identifier)
15496 }
15497
15498 return ok(code)
15499 }
15500
15501 return nok(code)
15502 }
15503 }
15504
15505 /** @type {Tokenizer} */
15506 function tokenizeTitle(effects, ok, nok) {
15507 return start
15508
15509 /** @type {State} */
15510 function start(code) {
15511 return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_8__.markdownLineEndingOrSpace)(code)
15512 ? (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_5__.factoryWhitespace)(effects, before)(code)
15513 : nok(code)
15514 }
15515
15516 /** @type {State} */
15517 function before(code) {
15518 if (
15519 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark ||
15520 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe ||
15521 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftParenthesis
15522 ) {
15523 return (0,micromark_factory_title__WEBPACK_IMPORTED_MODULE_9__.factoryTitle)(
15524 effects,
15525 (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(effects, after, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace),
15526 nok,
15527 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionTitle,
15528 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionTitleMarker,
15529 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionTitleString
15530 )(code)
15531 }
15532
15533 return nok(code)
15534 }
15535
15536 /** @type {State} */
15537 function after(code) {
15538 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_8__.markdownLineEnding)(code) ? ok(code) : nok(code)
15539 }
15540 }
15541
15542
15543 /***/ }),
15544
15545 /***/ "../node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js":
15546 /*!******************************************************************************!*\
15547 !*** ../node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js ***!
15548 \******************************************************************************/
15549 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15550
15551 "use strict";
15552 __webpack_require__.r(__webpack_exports__);
15553 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15554 /* harmony export */ "hardBreakEscape": () => (/* binding */ hardBreakEscape)
15555 /* harmony export */ });
15556 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
15557 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
15558 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
15559 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
15560 /**
15561 * @typedef {import('micromark-util-types').Construct} Construct
15562 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
15563 * @typedef {import('micromark-util-types').State} State
15564 */
15565
15566
15567
15568
15569
15570
15571 /** @type {Construct} */
15572 const hardBreakEscape = {
15573 name: 'hardBreakEscape',
15574 tokenize: tokenizeHardBreakEscape
15575 }
15576
15577 /** @type {Tokenizer} */
15578 function tokenizeHardBreakEscape(effects, ok, nok) {
15579 return start
15580
15581 /** @type {State} */
15582 function start(code) {
15583 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash, 'expected `\\`')
15584 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.hardBreakEscape)
15585 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker)
15586 effects.consume(code)
15587 return open
15588 }
15589
15590 /** @type {State} */
15591 function open(code) {
15592 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
15593 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker)
15594 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.hardBreakEscape)
15595 return ok(code)
15596 }
15597
15598 return nok(code)
15599 }
15600 }
15601
15602
15603 /***/ }),
15604
15605 /***/ "../node_modules/micromark-core-commonmark/dev/lib/heading-atx.js":
15606 /*!************************************************************************!*\
15607 !*** ../node_modules/micromark-core-commonmark/dev/lib/heading-atx.js ***!
15608 \************************************************************************/
15609 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15610
15611 "use strict";
15612 __webpack_require__.r(__webpack_exports__);
15613 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15614 /* harmony export */ "headingAtx": () => (/* binding */ headingAtx)
15615 /* harmony export */ });
15616 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
15617 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
15618 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
15619 /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js");
15620 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
15621 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
15622 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
15623 /**
15624 * @typedef {import('micromark-util-types').Construct} Construct
15625 * @typedef {import('micromark-util-types').Resolver} Resolver
15626 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
15627 * @typedef {import('micromark-util-types').Token} Token
15628 * @typedef {import('micromark-util-types').State} State
15629 */
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639 /** @type {Construct} */
15640 const headingAtx = {
15641 name: 'headingAtx',
15642 tokenize: tokenizeHeadingAtx,
15643 resolve: resolveHeadingAtx
15644 }
15645
15646 /** @type {Resolver} */
15647 function resolveHeadingAtx(events, context) {
15648 let contentEnd = events.length - 2
15649 let contentStart = 3
15650 /** @type {Token} */
15651 let content
15652 /** @type {Token} */
15653 let text
15654
15655 // Prefix whitespace, part of the opening.
15656 if (events[contentStart][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace) {
15657 contentStart += 2
15658 }
15659
15660 // Suffix whitespace, part of the closing.
15661 if (
15662 contentEnd - 2 > contentStart &&
15663 events[contentEnd][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace
15664 ) {
15665 contentEnd -= 2
15666 }
15667
15668 if (
15669 events[contentEnd][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence &&
15670 (contentStart === contentEnd - 1 ||
15671 (contentEnd - 4 > contentStart &&
15672 events[contentEnd - 2][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace))
15673 ) {
15674 contentEnd -= contentStart + 1 === contentEnd ? 2 : 4
15675 }
15676
15677 if (contentEnd > contentStart) {
15678 content = {
15679 type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingText,
15680 start: events[contentStart][1].start,
15681 end: events[contentEnd][1].end
15682 }
15683 text = {
15684 type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkText,
15685 start: events[contentStart][1].start,
15686 end: events[contentEnd][1].end,
15687 // @ts-expect-error Constants are fine to assign.
15688 contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.contentTypeText
15689 }
15690
15691 ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__.splice)(events, contentStart, contentEnd - contentStart + 1, [
15692 ['enter', content, context],
15693 ['enter', text, context],
15694 ['exit', text, context],
15695 ['exit', content, context]
15696 ])
15697 }
15698
15699 return events
15700 }
15701
15702 /** @type {Tokenizer} */
15703 function tokenizeHeadingAtx(effects, ok, nok) {
15704 const self = this
15705 let size = 0
15706
15707 return start
15708
15709 /** @type {State} */
15710 function start(code) {
15711 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign, 'expected `#`')
15712 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeading)
15713 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence)
15714 return fenceOpenInside(code)
15715 }
15716
15717 /** @type {State} */
15718 function fenceOpenInside(code) {
15719 if (
15720 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign &&
15721 size++ < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.atxHeadingOpeningFenceSizeMax
15722 ) {
15723 effects.consume(code)
15724 return fenceOpenInside
15725 }
15726
15727 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEndingOrSpace)(code)) {
15728 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence)
15729 return self.interrupt ? ok(code) : headingBreak(code)
15730 }
15731
15732 return nok(code)
15733 }
15734
15735 /** @type {State} */
15736 function headingBreak(code) {
15737 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign) {
15738 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence)
15739 return sequence(code)
15740 }
15741
15742 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
15743 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeading)
15744 return ok(code)
15745 }
15746
15747 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownSpace)(code)) {
15748 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__.factorySpace)(effects, headingBreak, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code)
15749 }
15750
15751 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingText)
15752 return data(code)
15753 }
15754
15755 /** @type {State} */
15756 function sequence(code) {
15757 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign) {
15758 effects.consume(code)
15759 return sequence
15760 }
15761
15762 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence)
15763 return headingBreak(code)
15764 }
15765
15766 /** @type {State} */
15767 function data(code) {
15768 if (
15769 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.eof ||
15770 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign ||
15771 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEndingOrSpace)(code)
15772 ) {
15773 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingText)
15774 return headingBreak(code)
15775 }
15776
15777 effects.consume(code)
15778 return data
15779 }
15780 }
15781
15782
15783 /***/ }),
15784
15785 /***/ "../node_modules/micromark-core-commonmark/dev/lib/html-flow.js":
15786 /*!**********************************************************************!*\
15787 !*** ../node_modules/micromark-core-commonmark/dev/lib/html-flow.js ***!
15788 \**********************************************************************/
15789 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15790
15791 "use strict";
15792 __webpack_require__.r(__webpack_exports__);
15793 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15794 /* harmony export */ "htmlFlow": () => (/* binding */ htmlFlow)
15795 /* harmony export */ });
15796 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
15797 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
15798 /* harmony import */ var micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-html-tag-name */ "../node_modules/micromark-util-html-tag-name/index.js");
15799 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
15800 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
15801 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
15802 /* harmony import */ var _blank_line_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blank-line.js */ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js");
15803 /**
15804 * @typedef {import('micromark-util-types').Construct} Construct
15805 * @typedef {import('micromark-util-types').Resolver} Resolver
15806 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
15807 * @typedef {import('micromark-util-types').State} State
15808 * @typedef {import('micromark-util-types').Code} Code
15809 */
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819 /** @type {Construct} */
15820 const htmlFlow = {
15821 name: 'htmlFlow',
15822 tokenize: tokenizeHtmlFlow,
15823 resolveTo: resolveToHtmlFlow,
15824 concrete: true
15825 }
15826
15827 /** @type {Construct} */
15828 const nextBlankConstruct = {tokenize: tokenizeNextBlank, partial: true}
15829
15830 /** @type {Resolver} */
15831 function resolveToHtmlFlow(events) {
15832 let index = events.length
15833
15834 while (index--) {
15835 if (
15836 events[index][0] === 'enter' &&
15837 events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlow
15838 ) {
15839 break
15840 }
15841 }
15842
15843 if (index > 1 && events[index - 2][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix) {
15844 // Add the prefix start to the HTML token.
15845 events[index][1].start = events[index - 2][1].start
15846 // Add the prefix start to the HTML line token.
15847 events[index + 1][1].start = events[index - 2][1].start
15848 // Remove the line prefix.
15849 events.splice(index - 2, 2)
15850 }
15851
15852 return events
15853 }
15854
15855 /** @type {Tokenizer} */
15856 function tokenizeHtmlFlow(effects, ok, nok) {
15857 const self = this
15858 /** @type {number} */
15859 let kind
15860 /** @type {boolean} */
15861 let startTag
15862 /** @type {string} */
15863 let buffer
15864 /** @type {number} */
15865 let index
15866 /** @type {Code} */
15867 let marker
15868
15869 return start
15870
15871 /** @type {State} */
15872 function start(code) {
15873 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan, 'expected `<`')
15874 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlow)
15875 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData)
15876 effects.consume(code)
15877 return open
15878 }
15879
15880 /** @type {State} */
15881 function open(code) {
15882 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.exclamationMark) {
15883 effects.consume(code)
15884 return declarationStart
15885 }
15886
15887 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) {
15888 effects.consume(code)
15889 return tagCloseStart
15890 }
15891
15892 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.questionMark) {
15893 effects.consume(code)
15894 kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlInstruction
15895 // While we’re in an instruction instead of a declaration, we’re on a `?`
15896 // right now, so we do need to search for `>`, similar to declarations.
15897 return self.interrupt ? ok : continuationDeclarationInside
15898 }
15899
15900 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) {
15901 effects.consume(code)
15902 buffer = String.fromCharCode(code)
15903 startTag = true
15904 return tagName
15905 }
15906
15907 return nok(code)
15908 }
15909
15910 /** @type {State} */
15911 function declarationStart(code) {
15912 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash) {
15913 effects.consume(code)
15914 kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComment
15915 return commentOpenInside
15916 }
15917
15918 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.leftSquareBracket) {
15919 effects.consume(code)
15920 kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlCdata
15921 buffer = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.cdataOpeningString
15922 index = 0
15923 return cdataOpenInside
15924 }
15925
15926 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) {
15927 effects.consume(code)
15928 kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlDeclaration
15929 return self.interrupt ? ok : continuationDeclarationInside
15930 }
15931
15932 return nok(code)
15933 }
15934
15935 /** @type {State} */
15936 function commentOpenInside(code) {
15937 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash) {
15938 effects.consume(code)
15939 return self.interrupt ? ok : continuationDeclarationInside
15940 }
15941
15942 return nok(code)
15943 }
15944
15945 /** @type {State} */
15946 function cdataOpenInside(code) {
15947 if (code === buffer.charCodeAt(index++)) {
15948 effects.consume(code)
15949 return index === buffer.length
15950 ? self.interrupt
15951 ? ok
15952 : continuation
15953 : cdataOpenInside
15954 }
15955
15956 return nok(code)
15957 }
15958
15959 /** @type {State} */
15960 function tagCloseStart(code) {
15961 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) {
15962 effects.consume(code)
15963 buffer = String.fromCharCode(code)
15964 return tagName
15965 }
15966
15967 return nok(code)
15968 }
15969
15970 /** @type {State} */
15971 function tagName(code) {
15972 if (
15973 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof ||
15974 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash ||
15975 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan ||
15976 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEndingOrSpace)(code)
15977 ) {
15978 if (
15979 code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash &&
15980 startTag &&
15981 micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__.htmlRawNames.includes(buffer.toLowerCase())
15982 ) {
15983 kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlRaw
15984 return self.interrupt ? ok(code) : continuation(code)
15985 }
15986
15987 if (micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__.htmlBlockNames.includes(buffer.toLowerCase())) {
15988 kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlBasic
15989
15990 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) {
15991 effects.consume(code)
15992 return basicSelfClosing
15993 }
15994
15995 return self.interrupt ? ok(code) : continuation(code)
15996 }
15997
15998 kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComplete
15999 // Do not support complete HTML when interrupting
16000 return self.interrupt && !self.parser.lazy[self.now().line]
16001 ? nok(code)
16002 : startTag
16003 ? completeAttributeNameBefore(code)
16004 : completeClosingTagAfter(code)
16005 }
16006
16007 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric)(code)) {
16008 effects.consume(code)
16009 buffer += String.fromCharCode(code)
16010 return tagName
16011 }
16012
16013 return nok(code)
16014 }
16015
16016 /** @type {State} */
16017 function basicSelfClosing(code) {
16018 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan) {
16019 effects.consume(code)
16020 return self.interrupt ? ok : continuation
16021 }
16022
16023 return nok(code)
16024 }
16025
16026 /** @type {State} */
16027 function completeClosingTagAfter(code) {
16028 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) {
16029 effects.consume(code)
16030 return completeClosingTagAfter
16031 }
16032
16033 return completeEnd(code)
16034 }
16035
16036 /** @type {State} */
16037 function completeAttributeNameBefore(code) {
16038 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) {
16039 effects.consume(code)
16040 return completeEnd
16041 }
16042
16043 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.colon || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.underscore || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) {
16044 effects.consume(code)
16045 return completeAttributeName
16046 }
16047
16048 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) {
16049 effects.consume(code)
16050 return completeAttributeNameBefore
16051 }
16052
16053 return completeEnd(code)
16054 }
16055
16056 /** @type {State} */
16057 function completeAttributeName(code) {
16058 if (
16059 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash ||
16060 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dot ||
16061 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.colon ||
16062 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.underscore ||
16063 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric)(code)
16064 ) {
16065 effects.consume(code)
16066 return completeAttributeName
16067 }
16068
16069 return completeAttributeNameAfter(code)
16070 }
16071
16072 /** @type {State} */
16073 function completeAttributeNameAfter(code) {
16074 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo) {
16075 effects.consume(code)
16076 return completeAttributeValueBefore
16077 }
16078
16079 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) {
16080 effects.consume(code)
16081 return completeAttributeNameAfter
16082 }
16083
16084 return completeAttributeNameBefore(code)
16085 }
16086
16087 /** @type {State} */
16088 function completeAttributeValueBefore(code) {
16089 if (
16090 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof ||
16091 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan ||
16092 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo ||
16093 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan ||
16094 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent
16095 ) {
16096 return nok(code)
16097 }
16098
16099 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.apostrophe) {
16100 effects.consume(code)
16101 marker = code
16102 return completeAttributeValueQuoted
16103 }
16104
16105 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) {
16106 effects.consume(code)
16107 return completeAttributeValueBefore
16108 }
16109
16110 marker = null
16111 return completeAttributeValueUnquoted(code)
16112 }
16113
16114 /** @type {State} */
16115 function completeAttributeValueQuoted(code) {
16116 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
16117 return nok(code)
16118 }
16119
16120 if (code === marker) {
16121 effects.consume(code)
16122 return completeAttributeValueQuotedAfter
16123 }
16124
16125 effects.consume(code)
16126 return completeAttributeValueQuoted
16127 }
16128
16129 /** @type {State} */
16130 function completeAttributeValueUnquoted(code) {
16131 if (
16132 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof ||
16133 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.quotationMark ||
16134 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.apostrophe ||
16135 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan ||
16136 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo ||
16137 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan ||
16138 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent ||
16139 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEndingOrSpace)(code)
16140 ) {
16141 return completeAttributeNameAfter(code)
16142 }
16143
16144 effects.consume(code)
16145 return completeAttributeValueUnquoted
16146 }
16147
16148 /** @type {State} */
16149 function completeAttributeValueQuotedAfter(code) {
16150 if (
16151 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash ||
16152 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan ||
16153 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)
16154 ) {
16155 return completeAttributeNameBefore(code)
16156 }
16157
16158 return nok(code)
16159 }
16160
16161 /** @type {State} */
16162 function completeEnd(code) {
16163 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan) {
16164 effects.consume(code)
16165 return completeAfter
16166 }
16167
16168 return nok(code)
16169 }
16170
16171 /** @type {State} */
16172 function completeAfter(code) {
16173 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) {
16174 effects.consume(code)
16175 return completeAfter
16176 }
16177
16178 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)
16179 ? continuation(code)
16180 : nok(code)
16181 }
16182
16183 /** @type {State} */
16184 function continuation(code) {
16185 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComment) {
16186 effects.consume(code)
16187 return continuationCommentInside
16188 }
16189
16190 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlRaw) {
16191 effects.consume(code)
16192 return continuationRawTagOpen
16193 }
16194
16195 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlDeclaration) {
16196 effects.consume(code)
16197 return continuationClose
16198 }
16199
16200 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.questionMark && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlInstruction) {
16201 effects.consume(code)
16202 return continuationDeclarationInside
16203 }
16204
16205 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.rightSquareBracket && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlCdata) {
16206 effects.consume(code)
16207 return continuationCharacterDataInside
16208 }
16209
16210 if (
16211 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code) &&
16212 (kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlBasic || kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComplete)
16213 ) {
16214 return effects.check(
16215 nextBlankConstruct,
16216 continuationClose,
16217 continuationAtLineEnding
16218 )(code)
16219 }
16220
16221 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
16222 return continuationAtLineEnding(code)
16223 }
16224
16225 effects.consume(code)
16226 return continuation
16227 }
16228
16229 /** @type {State} */
16230 function continuationAtLineEnding(code) {
16231 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData)
16232 return htmlContinueStart(code)
16233 }
16234
16235 /** @type {State} */
16236 function htmlContinueStart(code) {
16237 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) {
16238 return done(code)
16239 }
16240
16241 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
16242 return effects.attempt(
16243 {tokenize: htmlLineEnd, partial: true},
16244 htmlContinueStart,
16245 done
16246 )(code)
16247 }
16248
16249 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData)
16250 return continuation(code)
16251 }
16252
16253 /** @type {Tokenizer} */
16254 function htmlLineEnd(effects, ok, nok) {
16255 return start
16256
16257 /** @type {State} */
16258 function start(code) {
16259 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code), 'expected eol')
16260 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
16261 effects.consume(code)
16262 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
16263 return lineStart
16264 }
16265
16266 /** @type {State} */
16267 function lineStart(code) {
16268 return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
16269 }
16270 }
16271
16272 /** @type {State} */
16273 function continuationCommentInside(code) {
16274 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash) {
16275 effects.consume(code)
16276 return continuationDeclarationInside
16277 }
16278
16279 return continuation(code)
16280 }
16281
16282 /** @type {State} */
16283 function continuationRawTagOpen(code) {
16284 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) {
16285 effects.consume(code)
16286 buffer = ''
16287 return continuationRawEndTag
16288 }
16289
16290 return continuation(code)
16291 }
16292
16293 /** @type {State} */
16294 function continuationRawEndTag(code) {
16295 if (
16296 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan &&
16297 micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__.htmlRawNames.includes(buffer.toLowerCase())
16298 ) {
16299 effects.consume(code)
16300 return continuationClose
16301 }
16302
16303 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code) && buffer.length < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlRawSizeMax) {
16304 effects.consume(code)
16305 buffer += String.fromCharCode(code)
16306 return continuationRawEndTag
16307 }
16308
16309 return continuation(code)
16310 }
16311
16312 /** @type {State} */
16313 function continuationCharacterDataInside(code) {
16314 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.rightSquareBracket) {
16315 effects.consume(code)
16316 return continuationDeclarationInside
16317 }
16318
16319 return continuation(code)
16320 }
16321
16322 /** @type {State} */
16323 function continuationDeclarationInside(code) {
16324 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan) {
16325 effects.consume(code)
16326 return continuationClose
16327 }
16328
16329 // More dashes.
16330 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComment) {
16331 effects.consume(code)
16332 return continuationDeclarationInside
16333 }
16334
16335 return continuation(code)
16336 }
16337
16338 /** @type {State} */
16339 function continuationClose(code) {
16340 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
16341 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData)
16342 return done(code)
16343 }
16344
16345 effects.consume(code)
16346 return continuationClose
16347 }
16348
16349 /** @type {State} */
16350 function done(code) {
16351 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlow)
16352 return ok(code)
16353 }
16354 }
16355
16356 /** @type {Tokenizer} */
16357 function tokenizeNextBlank(effects, ok, nok) {
16358 return start
16359
16360 /** @type {State} */
16361 function start(code) {
16362 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code), 'expected a line ending')
16363 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData)
16364 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank)
16365 effects.consume(code)
16366 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank)
16367 return effects.attempt(_blank_line_js__WEBPACK_IMPORTED_MODULE_6__.blankLine, ok, nok)
16368 }
16369 }
16370
16371
16372 /***/ }),
16373
16374 /***/ "../node_modules/micromark-core-commonmark/dev/lib/html-text.js":
16375 /*!**********************************************************************!*\
16376 !*** ../node_modules/micromark-core-commonmark/dev/lib/html-text.js ***!
16377 \**********************************************************************/
16378 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
16379
16380 "use strict";
16381 __webpack_require__.r(__webpack_exports__);
16382 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16383 /* harmony export */ "htmlText": () => (/* binding */ htmlText)
16384 /* harmony export */ });
16385 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
16386 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
16387 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
16388 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
16389 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
16390 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
16391 /**
16392 * @typedef {import('micromark-util-types').Construct} Construct
16393 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
16394 * @typedef {import('micromark-util-types').State} State
16395 * @typedef {import('micromark-util-types').Code} Code
16396 */
16397
16398
16399
16400
16401
16402
16403
16404
16405 /** @type {Construct} */
16406 const htmlText = {name: 'htmlText', tokenize: tokenizeHtmlText}
16407
16408 /** @type {Tokenizer} */
16409 function tokenizeHtmlText(effects, ok, nok) {
16410 const self = this
16411 /** @type {NonNullable<Code>|undefined} */
16412 let marker
16413 /** @type {string} */
16414 let buffer
16415 /** @type {number} */
16416 let index
16417 /** @type {State} */
16418 let returnState
16419
16420 return start
16421
16422 /** @type {State} */
16423 function start(code) {
16424 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan, 'expected `<`')
16425 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlText)
16426 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData)
16427 effects.consume(code)
16428 return open
16429 }
16430
16431 /** @type {State} */
16432 function open(code) {
16433 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.exclamationMark) {
16434 effects.consume(code)
16435 return declarationOpen
16436 }
16437
16438 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash) {
16439 effects.consume(code)
16440 return tagCloseStart
16441 }
16442
16443 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.questionMark) {
16444 effects.consume(code)
16445 return instruction
16446 }
16447
16448 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) {
16449 effects.consume(code)
16450 return tagOpen
16451 }
16452
16453 return nok(code)
16454 }
16455
16456 /** @type {State} */
16457 function declarationOpen(code) {
16458 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) {
16459 effects.consume(code)
16460 return commentOpen
16461 }
16462
16463 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket) {
16464 effects.consume(code)
16465 buffer = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.cdataOpeningString
16466 index = 0
16467 return cdataOpen
16468 }
16469
16470 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) {
16471 effects.consume(code)
16472 return declaration
16473 }
16474
16475 return nok(code)
16476 }
16477
16478 /** @type {State} */
16479 function commentOpen(code) {
16480 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) {
16481 effects.consume(code)
16482 return commentStart
16483 }
16484
16485 return nok(code)
16486 }
16487
16488 /** @type {State} */
16489 function commentStart(code) {
16490 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
16491 return nok(code)
16492 }
16493
16494 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) {
16495 effects.consume(code)
16496 return commentStartDash
16497 }
16498
16499 return comment(code)
16500 }
16501
16502 /** @type {State} */
16503 function commentStartDash(code) {
16504 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
16505 return nok(code)
16506 }
16507
16508 return comment(code)
16509 }
16510
16511 /** @type {State} */
16512 function comment(code) {
16513 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) {
16514 return nok(code)
16515 }
16516
16517 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) {
16518 effects.consume(code)
16519 return commentClose
16520 }
16521
16522 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16523 returnState = comment
16524 return atLineEnding(code)
16525 }
16526
16527 effects.consume(code)
16528 return comment
16529 }
16530
16531 /** @type {State} */
16532 function commentClose(code) {
16533 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) {
16534 effects.consume(code)
16535 return end
16536 }
16537
16538 return comment(code)
16539 }
16540
16541 /** @type {State} */
16542 function cdataOpen(code) {
16543 if (code === buffer.charCodeAt(index++)) {
16544 effects.consume(code)
16545 return index === buffer.length ? cdata : cdataOpen
16546 }
16547
16548 return nok(code)
16549 }
16550
16551 /** @type {State} */
16552 function cdata(code) {
16553 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) {
16554 return nok(code)
16555 }
16556
16557 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) {
16558 effects.consume(code)
16559 return cdataClose
16560 }
16561
16562 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16563 returnState = cdata
16564 return atLineEnding(code)
16565 }
16566
16567 effects.consume(code)
16568 return cdata
16569 }
16570
16571 /** @type {State} */
16572 function cdataClose(code) {
16573 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) {
16574 effects.consume(code)
16575 return cdataEnd
16576 }
16577
16578 return cdata(code)
16579 }
16580
16581 /** @type {State} */
16582 function cdataEnd(code) {
16583 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
16584 return end(code)
16585 }
16586
16587 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) {
16588 effects.consume(code)
16589 return cdataEnd
16590 }
16591
16592 return cdata(code)
16593 }
16594
16595 /** @type {State} */
16596 function declaration(code) {
16597 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
16598 return end(code)
16599 }
16600
16601 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16602 returnState = declaration
16603 return atLineEnding(code)
16604 }
16605
16606 effects.consume(code)
16607 return declaration
16608 }
16609
16610 /** @type {State} */
16611 function instruction(code) {
16612 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) {
16613 return nok(code)
16614 }
16615
16616 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.questionMark) {
16617 effects.consume(code)
16618 return instructionClose
16619 }
16620
16621 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16622 returnState = instruction
16623 return atLineEnding(code)
16624 }
16625
16626 effects.consume(code)
16627 return instruction
16628 }
16629
16630 /** @type {State} */
16631 function instructionClose(code) {
16632 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan ? end(code) : instruction(code)
16633 }
16634
16635 /** @type {State} */
16636 function tagCloseStart(code) {
16637 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) {
16638 effects.consume(code)
16639 return tagClose
16640 }
16641
16642 return nok(code)
16643 }
16644
16645 /** @type {State} */
16646 function tagClose(code) {
16647 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) {
16648 effects.consume(code)
16649 return tagClose
16650 }
16651
16652 return tagCloseBetween(code)
16653 }
16654
16655 /** @type {State} */
16656 function tagCloseBetween(code) {
16657 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16658 returnState = tagCloseBetween
16659 return atLineEnding(code)
16660 }
16661
16662 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
16663 effects.consume(code)
16664 return tagCloseBetween
16665 }
16666
16667 return end(code)
16668 }
16669
16670 /** @type {State} */
16671 function tagOpen(code) {
16672 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) {
16673 effects.consume(code)
16674 return tagOpen
16675 }
16676
16677 if (
16678 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash ||
16679 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan ||
16680 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEndingOrSpace)(code)
16681 ) {
16682 return tagOpenBetween(code)
16683 }
16684
16685 return nok(code)
16686 }
16687
16688 /** @type {State} */
16689 function tagOpenBetween(code) {
16690 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash) {
16691 effects.consume(code)
16692 return end
16693 }
16694
16695 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.underscore || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) {
16696 effects.consume(code)
16697 return tagOpenAttributeName
16698 }
16699
16700 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16701 returnState = tagOpenBetween
16702 return atLineEnding(code)
16703 }
16704
16705 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
16706 effects.consume(code)
16707 return tagOpenBetween
16708 }
16709
16710 return end(code)
16711 }
16712
16713 /** @type {State} */
16714 function tagOpenAttributeName(code) {
16715 if (
16716 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash ||
16717 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot ||
16718 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon ||
16719 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.underscore ||
16720 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)
16721 ) {
16722 effects.consume(code)
16723 return tagOpenAttributeName
16724 }
16725
16726 return tagOpenAttributeNameAfter(code)
16727 }
16728
16729 /** @type {State} */
16730 function tagOpenAttributeNameAfter(code) {
16731 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.equalsTo) {
16732 effects.consume(code)
16733 return tagOpenAttributeValueBefore
16734 }
16735
16736 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16737 returnState = tagOpenAttributeNameAfter
16738 return atLineEnding(code)
16739 }
16740
16741 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
16742 effects.consume(code)
16743 return tagOpenAttributeNameAfter
16744 }
16745
16746 return tagOpenBetween(code)
16747 }
16748
16749 /** @type {State} */
16750 function tagOpenAttributeValueBefore(code) {
16751 if (
16752 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof ||
16753 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan ||
16754 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.equalsTo ||
16755 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan ||
16756 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.graveAccent
16757 ) {
16758 return nok(code)
16759 }
16760
16761 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe) {
16762 effects.consume(code)
16763 marker = code
16764 return tagOpenAttributeValueQuoted
16765 }
16766
16767 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16768 returnState = tagOpenAttributeValueBefore
16769 return atLineEnding(code)
16770 }
16771
16772 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
16773 effects.consume(code)
16774 return tagOpenAttributeValueBefore
16775 }
16776
16777 effects.consume(code)
16778 marker = undefined
16779 return tagOpenAttributeValueUnquoted
16780 }
16781
16782 /** @type {State} */
16783 function tagOpenAttributeValueQuoted(code) {
16784 if (code === marker) {
16785 effects.consume(code)
16786 return tagOpenAttributeValueQuotedAfter
16787 }
16788
16789 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) {
16790 return nok(code)
16791 }
16792
16793 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
16794 returnState = tagOpenAttributeValueQuoted
16795 return atLineEnding(code)
16796 }
16797
16798 effects.consume(code)
16799 return tagOpenAttributeValueQuoted
16800 }
16801
16802 /** @type {State} */
16803 function tagOpenAttributeValueQuotedAfter(code) {
16804 if (
16805 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan ||
16806 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash ||
16807 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEndingOrSpace)(code)
16808 ) {
16809 return tagOpenBetween(code)
16810 }
16811
16812 return nok(code)
16813 }
16814
16815 /** @type {State} */
16816 function tagOpenAttributeValueUnquoted(code) {
16817 if (
16818 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof ||
16819 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark ||
16820 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe ||
16821 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan ||
16822 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.equalsTo ||
16823 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.graveAccent
16824 ) {
16825 return nok(code)
16826 }
16827
16828 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEndingOrSpace)(code)) {
16829 return tagOpenBetween(code)
16830 }
16831
16832 effects.consume(code)
16833 return tagOpenAttributeValueUnquoted
16834 }
16835
16836 // We can’t have blank lines in content, so no need to worry about empty
16837 // tokens.
16838 /** @type {State} */
16839 function atLineEnding(code) {
16840 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(returnState, 'expected return state')
16841 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code), 'expected eol')
16842 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData)
16843 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding)
16844 effects.consume(code)
16845 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding)
16846 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_5__.factorySpace)(
16847 effects,
16848 afterPrefix,
16849 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.linePrefix,
16850 self.parser.constructs.disable.null.includes('codeIndented')
16851 ? undefined
16852 : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.tabSize
16853 )
16854 }
16855
16856 /** @type {State} */
16857 function afterPrefix(code) {
16858 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData)
16859 return returnState(code)
16860 }
16861
16862 /** @type {State} */
16863 function end(code) {
16864 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) {
16865 effects.consume(code)
16866 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData)
16867 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlText)
16868 return ok
16869 }
16870
16871 return nok(code)
16872 }
16873 }
16874
16875
16876 /***/ }),
16877
16878 /***/ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js":
16879 /*!**********************************************************************!*\
16880 !*** ../node_modules/micromark-core-commonmark/dev/lib/label-end.js ***!
16881 \**********************************************************************/
16882 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
16883
16884 "use strict";
16885 __webpack_require__.r(__webpack_exports__);
16886 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16887 /* harmony export */ "labelEnd": () => (/* binding */ labelEnd)
16888 /* harmony export */ });
16889 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
16890 /* harmony import */ var micromark_factory_destination__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-factory-destination */ "../node_modules/micromark-factory-destination/dev/index.js");
16891 /* harmony import */ var micromark_factory_label__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! micromark-factory-label */ "../node_modules/micromark-factory-label/dev/index.js");
16892 /* harmony import */ var micromark_factory_title__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! micromark-factory-title */ "../node_modules/micromark-factory-title/dev/index.js");
16893 /* harmony import */ var micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-whitespace */ "../node_modules/micromark-factory-whitespace/dev/index.js");
16894 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
16895 /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js");
16896 /* harmony import */ var micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-normalize-identifier */ "../node_modules/micromark-util-normalize-identifier/dev/index.js");
16897 /* harmony import */ var micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-resolve-all */ "../node_modules/micromark-util-resolve-all/index.js");
16898 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
16899 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
16900 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
16901 /**
16902 * @typedef {import('micromark-util-types').Construct} Construct
16903 * @typedef {import('micromark-util-types').Resolver} Resolver
16904 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
16905 * @typedef {import('micromark-util-types').Event} Event
16906 * @typedef {import('micromark-util-types').Token} Token
16907 * @typedef {import('micromark-util-types').State} State
16908 * @typedef {import('micromark-util-types').Code} Code
16909 */
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924 /** @type {Construct} */
16925 const labelEnd = {
16926 name: 'labelEnd',
16927 tokenize: tokenizeLabelEnd,
16928 resolveTo: resolveToLabelEnd,
16929 resolveAll: resolveAllLabelEnd
16930 }
16931
16932 /** @type {Construct} */
16933 const resourceConstruct = {tokenize: tokenizeResource}
16934 /** @type {Construct} */
16935 const fullReferenceConstruct = {tokenize: tokenizeFullReference}
16936 /** @type {Construct} */
16937 const collapsedReferenceConstruct = {tokenize: tokenizeCollapsedReference}
16938
16939 /** @type {Resolver} */
16940 function resolveAllLabelEnd(events) {
16941 let index = -1
16942 /** @type {Token} */
16943 let token
16944
16945 while (++index < events.length) {
16946 token = events[index][1]
16947
16948 if (
16949 token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage ||
16950 token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink ||
16951 token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd
16952 ) {
16953 // Remove the marker.
16954 events.splice(index + 1, token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage ? 4 : 2)
16955 token.type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data
16956 index++
16957 }
16958 }
16959
16960 return events
16961 }
16962
16963 /** @type {Resolver} */
16964 function resolveToLabelEnd(events, context) {
16965 let index = events.length
16966 let offset = 0
16967 /** @type {Token} */
16968 let token
16969 /** @type {number|undefined} */
16970 let open
16971 /** @type {number|undefined} */
16972 let close
16973 /** @type {Event[]} */
16974 let media
16975
16976 // Find an opening.
16977 while (index--) {
16978 token = events[index][1]
16979
16980 if (open) {
16981 // If we see another link, or inactive link label, we’ve been here before.
16982 if (
16983 token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.link ||
16984 (token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink && token._inactive)
16985 ) {
16986 break
16987 }
16988
16989 // Mark other link openings as inactive, as we can’t have links in
16990 // links.
16991 if (events[index][0] === 'enter' && token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) {
16992 token._inactive = true
16993 }
16994 } else if (close) {
16995 if (
16996 events[index][0] === 'enter' &&
16997 (token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage || token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) &&
16998 !token._balanced
16999 ) {
17000 open = index
17001
17002 if (token.type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) {
17003 offset = 2
17004 break
17005 }
17006 }
17007 } else if (token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd) {
17008 close = index
17009 }
17010 }
17011
17012 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(open !== undefined, '`open` is supposed to be found')
17013 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(close !== undefined, '`close` is supposed to be found')
17014
17015 const group = {
17016 type: events[open][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.link : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.image,
17017 start: Object.assign({}, events[open][1].start),
17018 end: Object.assign({}, events[events.length - 1][1].end)
17019 }
17020
17021 const label = {
17022 type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.label,
17023 start: Object.assign({}, events[open][1].start),
17024 end: Object.assign({}, events[close][1].end)
17025 }
17026
17027 const text = {
17028 type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelText,
17029 start: Object.assign({}, events[open + offset + 2][1].end),
17030 end: Object.assign({}, events[close - 2][1].start)
17031 }
17032
17033 media = [
17034 ['enter', group, context],
17035 ['enter', label, context]
17036 ]
17037
17038 // Opening marker.
17039 media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, events.slice(open + 1, open + offset + 3))
17040
17041 // Text open.
17042 media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, [['enter', text, context]])
17043
17044 // Between.
17045 media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(
17046 media,
17047 (0,micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__.resolveAll)(
17048 context.parser.constructs.insideSpan.null,
17049 events.slice(open + offset + 4, close - 3),
17050 context
17051 )
17052 )
17053
17054 // Text close, marker close, label close.
17055 media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, [
17056 ['exit', text, context],
17057 events[close - 2],
17058 events[close - 1],
17059 ['exit', label, context]
17060 ])
17061
17062 // Reference, resource, or so.
17063 media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, events.slice(close + 1))
17064
17065 // Media close.
17066 media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, [['exit', group, context]])
17067
17068 ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, open, events.length, media)
17069
17070 return events
17071 }
17072
17073 /** @type {Tokenizer} */
17074 function tokenizeLabelEnd(effects, ok, nok) {
17075 const self = this
17076 let index = self.events.length
17077 /** @type {Token} */
17078 let labelStart
17079 /** @type {boolean} */
17080 let defined
17081
17082 // Find an opening.
17083 while (index--) {
17084 if (
17085 (self.events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage ||
17086 self.events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) &&
17087 !self.events[index][1]._balanced
17088 ) {
17089 labelStart = self.events[index][1]
17090 break
17091 }
17092 }
17093
17094 return start
17095
17096 /** @type {State} */
17097 function start(code) {
17098 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightSquareBracket, 'expected `]`')
17099
17100 if (!labelStart) {
17101 return nok(code)
17102 }
17103
17104 // It’s a balanced bracket, but contains a link.
17105 if (labelStart._inactive) return balanced(code)
17106 defined = self.parser.defined.includes(
17107 (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_5__.normalizeIdentifier)(
17108 self.sliceSerialize({start: labelStart.end, end: self.now()})
17109 )
17110 )
17111 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd)
17112 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelMarker)
17113 effects.consume(code)
17114 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelMarker)
17115 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd)
17116 return afterLabelEnd
17117 }
17118
17119 /** @type {State} */
17120 function afterLabelEnd(code) {
17121 // Resource: `[asd](fgh)`.
17122 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftParenthesis) {
17123 return effects.attempt(
17124 resourceConstruct,
17125 ok,
17126 defined ? ok : balanced
17127 )(code)
17128 }
17129
17130 // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference?
17131 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftSquareBracket) {
17132 return effects.attempt(
17133 fullReferenceConstruct,
17134 ok,
17135 defined
17136 ? effects.attempt(collapsedReferenceConstruct, ok, balanced)
17137 : balanced
17138 )(code)
17139 }
17140
17141 // Shortcut reference: `[asd]`?
17142 return defined ? ok(code) : balanced(code)
17143 }
17144
17145 /** @type {State} */
17146 function balanced(code) {
17147 labelStart._balanced = true
17148 return nok(code)
17149 }
17150 }
17151
17152 /** @type {Tokenizer} */
17153 function tokenizeResource(effects, ok, nok) {
17154 return start
17155
17156 /** @type {State} */
17157 function start(code) {
17158 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftParenthesis, 'expected left paren')
17159 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resource)
17160 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker)
17161 effects.consume(code)
17162 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker)
17163 return (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__.factoryWhitespace)(effects, open)
17164 }
17165
17166 /** @type {State} */
17167 function open(code) {
17168 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightParenthesis) {
17169 return end(code)
17170 }
17171
17172 return (0,micromark_factory_destination__WEBPACK_IMPORTED_MODULE_7__.factoryDestination)(
17173 effects,
17174 destinationAfter,
17175 nok,
17176 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestination,
17177 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationLiteral,
17178 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationLiteralMarker,
17179 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationRaw,
17180 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationString,
17181 micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_8__.constants.linkResourceDestinationBalanceMax
17182 )(code)
17183 }
17184
17185 /** @type {State} */
17186 function destinationAfter(code) {
17187 return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_9__.markdownLineEndingOrSpace)(code)
17188 ? (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__.factoryWhitespace)(effects, between)(code)
17189 : end(code)
17190 }
17191
17192 /** @type {State} */
17193 function between(code) {
17194 if (
17195 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.quotationMark ||
17196 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.apostrophe ||
17197 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftParenthesis
17198 ) {
17199 return (0,micromark_factory_title__WEBPACK_IMPORTED_MODULE_10__.factoryTitle)(
17200 effects,
17201 (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__.factoryWhitespace)(effects, end),
17202 nok,
17203 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceTitle,
17204 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceTitleMarker,
17205 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceTitleString
17206 )(code)
17207 }
17208
17209 return end(code)
17210 }
17211
17212 /** @type {State} */
17213 function end(code) {
17214 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightParenthesis) {
17215 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker)
17216 effects.consume(code)
17217 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker)
17218 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resource)
17219 return ok
17220 }
17221
17222 return nok(code)
17223 }
17224 }
17225
17226 /** @type {Tokenizer} */
17227 function tokenizeFullReference(effects, ok, nok) {
17228 const self = this
17229
17230 return start
17231
17232 /** @type {State} */
17233 function start(code) {
17234 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftSquareBracket, 'expected left bracket')
17235 return micromark_factory_label__WEBPACK_IMPORTED_MODULE_11__.factoryLabel.call(
17236 self,
17237 effects,
17238 afterLabel,
17239 nok,
17240 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.reference,
17241 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker,
17242 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceString
17243 )(code)
17244 }
17245
17246 /** @type {State} */
17247 function afterLabel(code) {
17248 return self.parser.defined.includes(
17249 (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_5__.normalizeIdentifier)(
17250 self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)
17251 )
17252 )
17253 ? ok(code)
17254 : nok(code)
17255 }
17256 }
17257
17258 /** @type {Tokenizer} */
17259 function tokenizeCollapsedReference(effects, ok, nok) {
17260 return start
17261
17262 /** @type {State} */
17263 function start(code) {
17264 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftSquareBracket, 'expected left bracket')
17265 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.reference)
17266 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker)
17267 effects.consume(code)
17268 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker)
17269 return open
17270 }
17271
17272 /** @type {State} */
17273 function open(code) {
17274 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightSquareBracket) {
17275 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker)
17276 effects.consume(code)
17277 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker)
17278 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.reference)
17279 return ok
17280 }
17281
17282 return nok(code)
17283 }
17284 }
17285
17286
17287 /***/ }),
17288
17289 /***/ "../node_modules/micromark-core-commonmark/dev/lib/label-start-image.js":
17290 /*!******************************************************************************!*\
17291 !*** ../node_modules/micromark-core-commonmark/dev/lib/label-start-image.js ***!
17292 \******************************************************************************/
17293 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17294
17295 "use strict";
17296 __webpack_require__.r(__webpack_exports__);
17297 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17298 /* harmony export */ "labelStartImage": () => (/* binding */ labelStartImage)
17299 /* harmony export */ });
17300 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
17301 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
17302 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
17303 /* harmony import */ var _label_end_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./label-end.js */ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js");
17304 /**
17305 * @typedef {import('micromark-util-types').Construct} Construct
17306 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
17307 * @typedef {import('micromark-util-types').State} State
17308 */
17309
17310
17311
17312
17313
17314
17315 /** @type {Construct} */
17316 const labelStartImage = {
17317 name: 'labelStartImage',
17318 tokenize: tokenizeLabelStartImage,
17319 resolveAll: _label_end_js__WEBPACK_IMPORTED_MODULE_1__.labelEnd.resolveAll
17320 }
17321
17322 /** @type {Tokenizer} */
17323 function tokenizeLabelStartImage(effects, ok, nok) {
17324 const self = this
17325
17326 return start
17327
17328 /** @type {State} */
17329 function start(code) {
17330 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.exclamationMark, 'expected `!`')
17331 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImage)
17332 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImageMarker)
17333 effects.consume(code)
17334 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImageMarker)
17335 return open
17336 }
17337
17338 /** @type {State} */
17339 function open(code) {
17340 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.leftSquareBracket) {
17341 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker)
17342 effects.consume(code)
17343 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker)
17344 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImage)
17345 return after
17346 }
17347
17348 return nok(code)
17349 }
17350
17351 /** @type {State} */
17352 function after(code) {
17353 /* To do: remove in the future once we’ve switched from
17354 * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
17355 * which doesn’t need this */
17356 /* Hidden footnotes hook */
17357 /* c8 ignore next 3 */
17358 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.caret &&
17359 '_hiddenFootnoteSupport' in self.parser.constructs
17360 ? nok(code)
17361 : ok(code)
17362 }
17363 }
17364
17365
17366 /***/ }),
17367
17368 /***/ "../node_modules/micromark-core-commonmark/dev/lib/label-start-link.js":
17369 /*!*****************************************************************************!*\
17370 !*** ../node_modules/micromark-core-commonmark/dev/lib/label-start-link.js ***!
17371 \*****************************************************************************/
17372 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17373
17374 "use strict";
17375 __webpack_require__.r(__webpack_exports__);
17376 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17377 /* harmony export */ "labelStartLink": () => (/* binding */ labelStartLink)
17378 /* harmony export */ });
17379 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
17380 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
17381 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
17382 /* harmony import */ var _label_end_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./label-end.js */ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js");
17383 /**
17384 * @typedef {import('micromark-util-types').Construct} Construct
17385 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
17386 * @typedef {import('micromark-util-types').State} State
17387 */
17388
17389
17390
17391
17392
17393
17394 /** @type {Construct} */
17395 const labelStartLink = {
17396 name: 'labelStartLink',
17397 tokenize: tokenizeLabelStartLink,
17398 resolveAll: _label_end_js__WEBPACK_IMPORTED_MODULE_1__.labelEnd.resolveAll
17399 }
17400
17401 /** @type {Tokenizer} */
17402 function tokenizeLabelStartLink(effects, ok, nok) {
17403 const self = this
17404
17405 return start
17406
17407 /** @type {State} */
17408 function start(code) {
17409 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.leftSquareBracket, 'expected `[`')
17410 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelLink)
17411 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker)
17412 effects.consume(code)
17413 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker)
17414 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelLink)
17415 return after
17416 }
17417
17418 /** @type {State} */
17419 function after(code) {
17420 /* To do: remove in the future once we’ve switched from
17421 * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
17422 * which doesn’t need this */
17423 /* Hidden footnotes hook. */
17424 /* c8 ignore next 3 */
17425 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.caret &&
17426 '_hiddenFootnoteSupport' in self.parser.constructs
17427 ? nok(code)
17428 : ok(code)
17429 }
17430 }
17431
17432
17433 /***/ }),
17434
17435 /***/ "../node_modules/micromark-core-commonmark/dev/lib/line-ending.js":
17436 /*!************************************************************************!*\
17437 !*** ../node_modules/micromark-core-commonmark/dev/lib/line-ending.js ***!
17438 \************************************************************************/
17439 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17440
17441 "use strict";
17442 __webpack_require__.r(__webpack_exports__);
17443 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17444 /* harmony export */ "lineEnding": () => (/* binding */ lineEnding)
17445 /* harmony export */ });
17446 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
17447 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
17448 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
17449 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
17450 /**
17451 * @typedef {import('micromark-util-types').Construct} Construct
17452 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
17453 * @typedef {import('micromark-util-types').State} State
17454 */
17455
17456
17457
17458
17459
17460
17461 /** @type {Construct} */
17462 const lineEnding = {name: 'lineEnding', tokenize: tokenizeLineEnding}
17463
17464 /** @type {Tokenizer} */
17465 function tokenizeLineEnding(effects, ok) {
17466 return start
17467
17468 /** @type {State} */
17469 function start(code) {
17470 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEnding)(code), 'expected eol')
17471 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding)
17472 effects.consume(code)
17473 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding)
17474 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__.factorySpace)(effects, ok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.linePrefix)
17475 }
17476 }
17477
17478
17479 /***/ }),
17480
17481 /***/ "../node_modules/micromark-core-commonmark/dev/lib/list.js":
17482 /*!*****************************************************************!*\
17483 !*** ../node_modules/micromark-core-commonmark/dev/lib/list.js ***!
17484 \*****************************************************************/
17485 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17486
17487 "use strict";
17488 __webpack_require__.r(__webpack_exports__);
17489 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17490 /* harmony export */ "list": () => (/* binding */ list)
17491 /* harmony export */ });
17492 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
17493 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
17494 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
17495 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
17496 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
17497 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
17498 /* harmony import */ var _blank_line_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blank-line.js */ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js");
17499 /* harmony import */ var _thematic_break_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./thematic-break.js */ "../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js");
17500 /**
17501 * @typedef {import('micromark-util-types').Construct} Construct
17502 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
17503 * @typedef {import('micromark-util-types').Exiter} Exiter
17504 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
17505 * @typedef {import('micromark-util-types').State} State
17506 * @typedef {import('micromark-util-types').Code} Code
17507 */
17508
17509 /**
17510 * @typedef {Record<string, unknown> & {marker: Code, type: string, size: number}} ListContainerState
17511 * @typedef {TokenizeContext & {containerState: ListContainerState}} TokenizeContextWithState
17512 */
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523 /** @type {Construct} */
17524 const list = {
17525 name: 'list',
17526 tokenize: tokenizeListStart,
17527 continuation: {tokenize: tokenizeListContinuation},
17528 exit: tokenizeListEnd
17529 }
17530
17531 /** @type {Construct} */
17532 const listItemPrefixWhitespaceConstruct = {
17533 tokenize: tokenizeListItemPrefixWhitespace,
17534 partial: true
17535 }
17536
17537 /** @type {Construct} */
17538 const indentConstruct = {tokenize: tokenizeIndent, partial: true}
17539
17540 /**
17541 * @type {Tokenizer}
17542 * @this {TokenizeContextWithState}
17543 */
17544 function tokenizeListStart(effects, ok, nok) {
17545 const self = this
17546 const tail = self.events[self.events.length - 1]
17547 let initialSize =
17548 tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix
17549 ? tail[2].sliceSerialize(tail[1], true).length
17550 : 0
17551 let size = 0
17552
17553 return start
17554
17555 /** @type {State} */
17556 function start(code) {
17557 const kind =
17558 self.containerState.type ||
17559 (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.asterisk || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.plusSign || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash
17560 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listUnordered
17561 : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listOrdered)
17562
17563 if (
17564 kind === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listUnordered
17565 ? !self.containerState.marker || code === self.containerState.marker
17566 : (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiDigit)(code)
17567 ) {
17568 if (!self.containerState.type) {
17569 self.containerState.type = kind
17570 effects.enter(kind, {_container: true})
17571 }
17572
17573 if (kind === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listUnordered) {
17574 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix)
17575 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.asterisk || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash
17576 ? effects.check(_thematic_break_js__WEBPACK_IMPORTED_MODULE_4__.thematicBreak, nok, atMarker)(code)
17577 : atMarker(code)
17578 }
17579
17580 if (!self.interrupt || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.digit1) {
17581 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix)
17582 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemValue)
17583 return inside(code)
17584 }
17585 }
17586
17587 return nok(code)
17588 }
17589
17590 /** @type {State} */
17591 function inside(code) {
17592 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiDigit)(code) && ++size < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.listItemValueSizeMax) {
17593 effects.consume(code)
17594 return inside
17595 }
17596
17597 if (
17598 (!self.interrupt || size < 2) &&
17599 (self.containerState.marker
17600 ? code === self.containerState.marker
17601 : code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.rightParenthesis || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dot)
17602 ) {
17603 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemValue)
17604 return atMarker(code)
17605 }
17606
17607 return nok(code)
17608 }
17609
17610 /**
17611 * @type {State}
17612 **/
17613 function atMarker(code) {
17614 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof, 'eof (`null`) is not a marker')
17615 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemMarker)
17616 effects.consume(code)
17617 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemMarker)
17618 self.containerState.marker = self.containerState.marker || code
17619 return effects.check(
17620 _blank_line_js__WEBPACK_IMPORTED_MODULE_6__.blankLine,
17621 // Can’t be empty when interrupting.
17622 self.interrupt ? nok : onBlank,
17623 effects.attempt(
17624 listItemPrefixWhitespaceConstruct,
17625 endOfPrefix,
17626 otherPrefix
17627 )
17628 )
17629 }
17630
17631 /** @type {State} */
17632 function onBlank(code) {
17633 self.containerState.initialBlankLine = true
17634 initialSize++
17635 return endOfPrefix(code)
17636 }
17637
17638 /** @type {State} */
17639 function otherPrefix(code) {
17640 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
17641 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace)
17642 effects.consume(code)
17643 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace)
17644 return endOfPrefix
17645 }
17646
17647 return nok(code)
17648 }
17649
17650 /** @type {State} */
17651 function endOfPrefix(code) {
17652 self.containerState.size =
17653 initialSize +
17654 self.sliceSerialize(effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix), true).length
17655 return ok(code)
17656 }
17657 }
17658
17659 /**
17660 * @type {Tokenizer}
17661 * @this {TokenizeContextWithState}
17662 */
17663 function tokenizeListContinuation(effects, ok, nok) {
17664 const self = this
17665
17666 self.containerState._closeFlow = undefined
17667
17668 return effects.check(_blank_line_js__WEBPACK_IMPORTED_MODULE_6__.blankLine, onBlank, notBlank)
17669
17670 /** @type {State} */
17671 function onBlank(code) {
17672 self.containerState.furtherBlankLines =
17673 self.containerState.furtherBlankLines ||
17674 self.containerState.initialBlankLine
17675
17676 // We have a blank line.
17677 // Still, try to consume at most the items size.
17678 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(
17679 effects,
17680 ok,
17681 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemIndent,
17682 self.containerState.size + 1
17683 )(code)
17684 }
17685
17686 /** @type {State} */
17687 function notBlank(code) {
17688 if (self.containerState.furtherBlankLines || !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
17689 self.containerState.furtherBlankLines = undefined
17690 self.containerState.initialBlankLine = undefined
17691 return notInCurrentItem(code)
17692 }
17693
17694 self.containerState.furtherBlankLines = undefined
17695 self.containerState.initialBlankLine = undefined
17696 return effects.attempt(indentConstruct, ok, notInCurrentItem)(code)
17697 }
17698
17699 /** @type {State} */
17700 function notInCurrentItem(code) {
17701 // While we do continue, we signal that the flow should be closed.
17702 self.containerState._closeFlow = true
17703 // As we’re closing flow, we’re no longer interrupting.
17704 self.interrupt = undefined
17705 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(
17706 effects,
17707 effects.attempt(list, ok, nok),
17708 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix,
17709 self.parser.constructs.disable.null.includes('codeIndented')
17710 ? undefined
17711 : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize
17712 )(code)
17713 }
17714 }
17715
17716 /**
17717 * @type {Tokenizer}
17718 * @this {TokenizeContextWithState}
17719 */
17720 function tokenizeIndent(effects, ok, nok) {
17721 const self = this
17722
17723 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(
17724 effects,
17725 afterPrefix,
17726 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemIndent,
17727 self.containerState.size + 1
17728 )
17729
17730 /** @type {State} */
17731 function afterPrefix(code) {
17732 const tail = self.events[self.events.length - 1]
17733 return tail &&
17734 tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemIndent &&
17735 tail[2].sliceSerialize(tail[1], true).length === self.containerState.size
17736 ? ok(code)
17737 : nok(code)
17738 }
17739 }
17740
17741 /**
17742 * @type {Exiter}
17743 * @this {TokenizeContextWithState}
17744 */
17745 function tokenizeListEnd(effects) {
17746 effects.exit(this.containerState.type)
17747 }
17748
17749 /**
17750 * @type {Tokenizer}
17751 * @this {TokenizeContextWithState}
17752 */
17753 function tokenizeListItemPrefixWhitespace(effects, ok, nok) {
17754 const self = this
17755
17756 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(
17757 effects,
17758 afterPrefix,
17759 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace,
17760 self.parser.constructs.disable.null.includes('codeIndented')
17761 ? undefined
17762 : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize + 1
17763 )
17764
17765 /** @type {State} */
17766 function afterPrefix(code) {
17767 const tail = self.events[self.events.length - 1]
17768
17769 return !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code) &&
17770 tail &&
17771 tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace
17772 ? ok(code)
17773 : nok(code)
17774 }
17775 }
17776
17777
17778 /***/ }),
17779
17780 /***/ "../node_modules/micromark-core-commonmark/dev/lib/setext-underline.js":
17781 /*!*****************************************************************************!*\
17782 !*** ../node_modules/micromark-core-commonmark/dev/lib/setext-underline.js ***!
17783 \*****************************************************************************/
17784 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17785
17786 "use strict";
17787 __webpack_require__.r(__webpack_exports__);
17788 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17789 /* harmony export */ "setextUnderline": () => (/* binding */ setextUnderline)
17790 /* harmony export */ });
17791 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
17792 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
17793 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
17794 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
17795 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
17796 /**
17797 * @typedef {import('micromark-util-types').Construct} Construct
17798 * @typedef {import('micromark-util-types').Resolver} Resolver
17799 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
17800 * @typedef {import('micromark-util-types').State} State
17801 * @typedef {import('micromark-util-types').Code} Code
17802 */
17803
17804
17805
17806
17807
17808
17809
17810 /** @type {Construct} */
17811 const setextUnderline = {
17812 name: 'setextUnderline',
17813 tokenize: tokenizeSetextUnderline,
17814 resolveTo: resolveToSetextUnderline
17815 }
17816
17817 /** @type {Resolver} */
17818 function resolveToSetextUnderline(events, context) {
17819 let index = events.length
17820 /** @type {number|undefined} */
17821 let content
17822 /** @type {number|undefined} */
17823 let text
17824 /** @type {number|undefined} */
17825 let definition
17826
17827 // Find the opening of the content.
17828 // It’ll always exist: we don’t tokenize if it isn’t there.
17829 while (index--) {
17830 if (events[index][0] === 'enter') {
17831 if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content) {
17832 content = index
17833 break
17834 }
17835
17836 if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.paragraph) {
17837 text = index
17838 }
17839 }
17840 // Exit
17841 else {
17842 if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content) {
17843 // Remove the content end (if needed we’ll add it later)
17844 events.splice(index, 1)
17845 }
17846
17847 if (!definition && events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.definition) {
17848 definition = index
17849 }
17850 }
17851 }
17852
17853 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(text !== undefined, 'expected a `text` index to be found')
17854 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(content !== undefined, 'expected a `text` index to be found')
17855
17856 const heading = {
17857 type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeading,
17858 start: Object.assign({}, events[text][1].start),
17859 end: Object.assign({}, events[events.length - 1][1].end)
17860 }
17861
17862 // Change the paragraph to setext heading text.
17863 events[text][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingText
17864
17865 // If we have definitions in the content, we’ll keep on having content,
17866 // but we need move it.
17867 if (definition) {
17868 events.splice(text, 0, ['enter', heading, context])
17869 events.splice(definition + 1, 0, ['exit', events[content][1], context])
17870 events[content][1].end = Object.assign({}, events[definition][1].end)
17871 } else {
17872 events[content][1] = heading
17873 }
17874
17875 // Add the heading exit at the end.
17876 events.push(['exit', heading, context])
17877
17878 return events
17879 }
17880
17881 /** @type {Tokenizer} */
17882 function tokenizeSetextUnderline(effects, ok, nok) {
17883 const self = this
17884 let index = self.events.length
17885 /** @type {NonNullable<Code>} */
17886 let marker
17887 /** @type {boolean} */
17888 let paragraph
17889
17890 // Find an opening.
17891 while (index--) {
17892 // Skip enter/exit of line ending, line prefix, and content.
17893 // We can now either have a definition or a paragraph.
17894 if (
17895 self.events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding &&
17896 self.events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix &&
17897 self.events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content
17898 ) {
17899 paragraph = self.events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.paragraph
17900 break
17901 }
17902 }
17903
17904 return start
17905
17906 /** @type {State} */
17907 function start(code) {
17908 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
17909 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo,
17910 'expected `=` or `-`'
17911 )
17912
17913 if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {
17914 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLine)
17915 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLineSequence)
17916 marker = code
17917 return closingSequence(code)
17918 }
17919
17920 return nok(code)
17921 }
17922
17923 /** @type {State} */
17924 function closingSequence(code) {
17925 if (code === marker) {
17926 effects.consume(code)
17927 return closingSequence
17928 }
17929
17930 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLineSequence)
17931 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__.factorySpace)(effects, closingSequenceEnd, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineSuffix)(code)
17932 }
17933
17934 /** @type {State} */
17935 function closingSequenceEnd(code) {
17936 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) {
17937 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLine)
17938 return ok(code)
17939 }
17940
17941 return nok(code)
17942 }
17943 }
17944
17945
17946 /***/ }),
17947
17948 /***/ "../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js":
17949 /*!***************************************************************************!*\
17950 !*** ../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js ***!
17951 \***************************************************************************/
17952 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17953
17954 "use strict";
17955 __webpack_require__.r(__webpack_exports__);
17956 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17957 /* harmony export */ "thematicBreak": () => (/* binding */ thematicBreak)
17958 /* harmony export */ });
17959 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
17960 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
17961 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
17962 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
17963 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
17964 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
17965 /**
17966 * @typedef {import('micromark-util-types').Construct} Construct
17967 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
17968 * @typedef {import('micromark-util-types').State} State
17969 * @typedef {import('micromark-util-types').Code} Code
17970 */
17971
17972
17973
17974
17975
17976
17977
17978
17979 /** @type {Construct} */
17980 const thematicBreak = {
17981 name: 'thematicBreak',
17982 tokenize: tokenizeThematicBreak
17983 }
17984
17985 /** @type {Tokenizer} */
17986 function tokenizeThematicBreak(effects, ok, nok) {
17987 let size = 0
17988 /** @type {NonNullable<Code>} */
17989 let marker
17990
17991 return start
17992
17993 /** @type {State} */
17994 function start(code) {
17995 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
17996 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.asterisk ||
17997 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash ||
17998 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.underscore,
17999 'expected `*`, `-`, or `_`'
18000 )
18001
18002 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreak)
18003 marker = code
18004 return atBreak(code)
18005 }
18006
18007 /** @type {State} */
18008 function atBreak(code) {
18009 if (code === marker) {
18010 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreakSequence)
18011 return sequence(code)
18012 }
18013
18014 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) {
18015 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, atBreak, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace)(code)
18016 }
18017
18018 if (
18019 size < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.thematicBreakMarkerCountMin ||
18020 (code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof && !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code))
18021 ) {
18022 return nok(code)
18023 }
18024
18025 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreak)
18026 return ok(code)
18027 }
18028
18029 /** @type {State} */
18030 function sequence(code) {
18031 if (code === marker) {
18032 effects.consume(code)
18033 size++
18034 return sequence
18035 }
18036
18037 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreakSequence)
18038 return atBreak(code)
18039 }
18040 }
18041
18042
18043 /***/ }),
18044
18045 /***/ "../node_modules/micromark-factory-destination/dev/index.js":
18046 /*!******************************************************************!*\
18047 !*** ../node_modules/micromark-factory-destination/dev/index.js ***!
18048 \******************************************************************/
18049 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18050
18051 "use strict";
18052 __webpack_require__.r(__webpack_exports__);
18053 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18054 /* harmony export */ "factoryDestination": () => (/* binding */ factoryDestination)
18055 /* harmony export */ });
18056 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
18057 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
18058 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
18059 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
18060 /**
18061 * @typedef {import('micromark-util-types').Effects} Effects
18062 * @typedef {import('micromark-util-types').State} State
18063 */
18064
18065
18066
18067
18068
18069
18070 /**
18071 * @param {Effects} effects
18072 * @param {State} ok
18073 * @param {State} nok
18074 * @param {string} type
18075 * @param {string} literalType
18076 * @param {string} literalMarkerType
18077 * @param {string} rawType
18078 * @param {string} stringType
18079 * @param {number} [max=Infinity]
18080 * @returns {State}
18081 */
18082 // eslint-disable-next-line max-params
18083 function factoryDestination(
18084 effects,
18085 ok,
18086 nok,
18087 type,
18088 literalType,
18089 literalMarkerType,
18090 rawType,
18091 stringType,
18092 max
18093 ) {
18094 const limit = max || Number.POSITIVE_INFINITY
18095 let balance = 0
18096
18097 return start
18098
18099 /** @type {State} */
18100 function start(code) {
18101 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan) {
18102 effects.enter(type)
18103 effects.enter(literalType)
18104 effects.enter(literalMarkerType)
18105 effects.consume(code)
18106 effects.exit(literalMarkerType)
18107 return destinationEnclosedBefore
18108 }
18109
18110 if (
18111 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof ||
18112 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightParenthesis ||
18113 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.asciiControl)(code)
18114 ) {
18115 return nok(code)
18116 }
18117
18118 effects.enter(type)
18119 effects.enter(rawType)
18120 effects.enter(stringType)
18121 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString})
18122 return destinationRaw(code)
18123 }
18124
18125 /** @type {State} */
18126 function destinationEnclosedBefore(code) {
18127 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan) {
18128 effects.enter(literalMarkerType)
18129 effects.consume(code)
18130 effects.exit(literalMarkerType)
18131 effects.exit(literalType)
18132 effects.exit(type)
18133 return ok
18134 }
18135
18136 effects.enter(stringType)
18137 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString})
18138 return destinationEnclosed(code)
18139 }
18140
18141 /** @type {State} */
18142 function destinationEnclosed(code) {
18143 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan) {
18144 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString)
18145 effects.exit(stringType)
18146 return destinationEnclosedBefore(code)
18147 }
18148
18149 if (
18150 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof ||
18151 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan ||
18152 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEnding)(code)
18153 ) {
18154 return nok(code)
18155 }
18156
18157 effects.consume(code)
18158 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash
18159 ? destinationEnclosedEscape
18160 : destinationEnclosed
18161 }
18162
18163 /** @type {State} */
18164 function destinationEnclosedEscape(code) {
18165 if (
18166 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan ||
18167 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan ||
18168 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash
18169 ) {
18170 effects.consume(code)
18171 return destinationEnclosed
18172 }
18173
18174 return destinationEnclosed(code)
18175 }
18176
18177 /** @type {State} */
18178 function destinationRaw(code) {
18179 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftParenthesis) {
18180 if (++balance > limit) return nok(code)
18181 effects.consume(code)
18182 return destinationRaw
18183 }
18184
18185 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightParenthesis) {
18186 if (!balance--) {
18187 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString)
18188 effects.exit(stringType)
18189 effects.exit(rawType)
18190 effects.exit(type)
18191 return ok(code)
18192 }
18193
18194 effects.consume(code)
18195 return destinationRaw
18196 }
18197
18198 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEndingOrSpace)(code)) {
18199 if (balance) return nok(code)
18200 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString)
18201 effects.exit(stringType)
18202 effects.exit(rawType)
18203 effects.exit(type)
18204 return ok(code)
18205 }
18206
18207 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.asciiControl)(code)) return nok(code)
18208 effects.consume(code)
18209 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash ? destinationRawEscape : destinationRaw
18210 }
18211
18212 /** @type {State} */
18213 function destinationRawEscape(code) {
18214 if (
18215 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftParenthesis ||
18216 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightParenthesis ||
18217 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash
18218 ) {
18219 effects.consume(code)
18220 return destinationRaw
18221 }
18222
18223 return destinationRaw(code)
18224 }
18225 }
18226
18227
18228 /***/ }),
18229
18230 /***/ "../node_modules/micromark-factory-label/dev/index.js":
18231 /*!************************************************************!*\
18232 !*** ../node_modules/micromark-factory-label/dev/index.js ***!
18233 \************************************************************/
18234 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18235
18236 "use strict";
18237 __webpack_require__.r(__webpack_exports__);
18238 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18239 /* harmony export */ "factoryLabel": () => (/* binding */ factoryLabel)
18240 /* harmony export */ });
18241 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
18242 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
18243 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
18244 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
18245 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
18246 /**
18247 * @typedef {import('micromark-util-types').Effects} Effects
18248 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
18249 * @typedef {import('micromark-util-types').State} State
18250 */
18251
18252
18253
18254
18255
18256
18257
18258 /**
18259 * @this {TokenizeContext}
18260 * @param {Effects} effects
18261 * @param {State} ok
18262 * @param {State} nok
18263 * @param {string} type
18264 * @param {string} markerType
18265 * @param {string} stringType
18266 * @returns {State}
18267 */
18268 // eslint-disable-next-line max-params
18269 function factoryLabel(effects, ok, nok, type, markerType, stringType) {
18270 const self = this
18271 let size = 0
18272 /** @type {boolean} */
18273 let data
18274
18275 return start
18276
18277 /** @type {State} */
18278 function start(code) {
18279 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket, 'expected `[`')
18280 effects.enter(type)
18281 effects.enter(markerType)
18282 effects.consume(code)
18283 effects.exit(markerType)
18284 effects.enter(stringType)
18285 return atBreak
18286 }
18287
18288 /** @type {State} */
18289 function atBreak(code) {
18290 if (
18291 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof ||
18292 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket ||
18293 (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket && !data) ||
18294 /* To do: remove in the future once we’ve switched from
18295 * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
18296 * which doesn’t need this */
18297 /* Hidden footnotes hook */
18298 /* c8 ignore next 3 */
18299 (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.caret &&
18300 !size &&
18301 '_hiddenFootnoteSupport' in self.parser.constructs) ||
18302 size > micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.linkReferenceSizeMax
18303 ) {
18304 return nok(code)
18305 }
18306
18307 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) {
18308 effects.exit(stringType)
18309 effects.enter(markerType)
18310 effects.consume(code)
18311 effects.exit(markerType)
18312 effects.exit(type)
18313 return ok
18314 }
18315
18316 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) {
18317 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding)
18318 effects.consume(code)
18319 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding)
18320 return atBreak
18321 }
18322
18323 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.contentTypeString})
18324 return label(code)
18325 }
18326
18327 /** @type {State} */
18328 function label(code) {
18329 if (
18330 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof ||
18331 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket ||
18332 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket ||
18333 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code) ||
18334 size++ > micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.linkReferenceSizeMax
18335 ) {
18336 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkString)
18337 return atBreak(code)
18338 }
18339
18340 effects.consume(code)
18341 data = data || !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)
18342 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash ? labelEscape : label
18343 }
18344
18345 /** @type {State} */
18346 function labelEscape(code) {
18347 if (
18348 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket ||
18349 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash ||
18350 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket
18351 ) {
18352 effects.consume(code)
18353 size++
18354 return label
18355 }
18356
18357 return label(code)
18358 }
18359 }
18360
18361
18362 /***/ }),
18363
18364 /***/ "../node_modules/micromark-factory-space/dev/index.js":
18365 /*!************************************************************!*\
18366 !*** ../node_modules/micromark-factory-space/dev/index.js ***!
18367 \************************************************************/
18368 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18369
18370 "use strict";
18371 __webpack_require__.r(__webpack_exports__);
18372 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18373 /* harmony export */ "factorySpace": () => (/* binding */ factorySpace)
18374 /* harmony export */ });
18375 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
18376 /**
18377 * @typedef {import('micromark-util-types').Effects} Effects
18378 * @typedef {import('micromark-util-types').State} State
18379 */
18380
18381
18382
18383 /**
18384 * @param {Effects} effects
18385 * @param {State} ok
18386 * @param {string} type
18387 * @param {number} [max=Infinity]
18388 * @returns {State}
18389 */
18390 function factorySpace(effects, ok, type, max) {
18391 const limit = max ? max - 1 : Number.POSITIVE_INFINITY
18392 let size = 0
18393
18394 return start
18395
18396 /** @type {State} */
18397 function start(code) {
18398 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownSpace)(code)) {
18399 effects.enter(type)
18400 return prefix(code)
18401 }
18402
18403 return ok(code)
18404 }
18405
18406 /** @type {State} */
18407 function prefix(code) {
18408 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownSpace)(code) && size++ < limit) {
18409 effects.consume(code)
18410 return prefix
18411 }
18412
18413 effects.exit(type)
18414 return ok(code)
18415 }
18416 }
18417
18418
18419 /***/ }),
18420
18421 /***/ "../node_modules/micromark-factory-title/dev/index.js":
18422 /*!************************************************************!*\
18423 !*** ../node_modules/micromark-factory-title/dev/index.js ***!
18424 \************************************************************/
18425 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18426
18427 "use strict";
18428 __webpack_require__.r(__webpack_exports__);
18429 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18430 /* harmony export */ "factoryTitle": () => (/* binding */ factoryTitle)
18431 /* harmony export */ });
18432 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
18433 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
18434 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
18435 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
18436 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
18437 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
18438 /**
18439 * @typedef {import('micromark-util-types').Effects} Effects
18440 * @typedef {import('micromark-util-types').State} State
18441 * @typedef {import('micromark-util-types').Code} Code
18442 */
18443
18444
18445
18446
18447
18448
18449
18450
18451 /**
18452 * @param {Effects} effects
18453 * @param {State} ok
18454 * @param {State} nok
18455 * @param {string} type
18456 * @param {string} markerType
18457 * @param {string} stringType
18458 * @returns {State}
18459 */
18460 // eslint-disable-next-line max-params
18461 function factoryTitle(effects, ok, nok, type, markerType, stringType) {
18462 /** @type {NonNullable<Code>} */
18463 let marker
18464
18465 return start
18466
18467 /** @type {State} */
18468 function start(code) {
18469 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
18470 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark ||
18471 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe ||
18472 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftParenthesis,
18473 'expected `"`, `\'`, or `(`'
18474 )
18475 effects.enter(type)
18476 effects.enter(markerType)
18477 effects.consume(code)
18478 effects.exit(markerType)
18479 marker = code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftParenthesis ? micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightParenthesis : code
18480 return atFirstTitleBreak
18481 }
18482
18483 /** @type {State} */
18484 function atFirstTitleBreak(code) {
18485 if (code === marker) {
18486 effects.enter(markerType)
18487 effects.consume(code)
18488 effects.exit(markerType)
18489 effects.exit(type)
18490 return ok
18491 }
18492
18493 effects.enter(stringType)
18494 return atTitleBreak(code)
18495 }
18496
18497 /** @type {State} */
18498 function atTitleBreak(code) {
18499 if (code === marker) {
18500 effects.exit(stringType)
18501 return atFirstTitleBreak(marker)
18502 }
18503
18504 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) {
18505 return nok(code)
18506 }
18507
18508 // Note: blank lines can’t exist in content.
18509 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code)) {
18510 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding)
18511 effects.consume(code)
18512 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding)
18513 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, atTitleBreak, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.linePrefix)
18514 }
18515
18516 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeString})
18517 return title(code)
18518 }
18519
18520 /** @type {State} */
18521 function title(code) {
18522 if (code === marker || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code)) {
18523 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkString)
18524 return atTitleBreak(code)
18525 }
18526
18527 effects.consume(code)
18528 return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash ? titleEscape : title
18529 }
18530
18531 /** @type {State} */
18532 function titleEscape(code) {
18533 if (code === marker || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash) {
18534 effects.consume(code)
18535 return title
18536 }
18537
18538 return title(code)
18539 }
18540 }
18541
18542
18543 /***/ }),
18544
18545 /***/ "../node_modules/micromark-factory-whitespace/dev/index.js":
18546 /*!*****************************************************************!*\
18547 !*** ../node_modules/micromark-factory-whitespace/dev/index.js ***!
18548 \*****************************************************************/
18549 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18550
18551 "use strict";
18552 __webpack_require__.r(__webpack_exports__);
18553 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18554 /* harmony export */ "factoryWhitespace": () => (/* binding */ factoryWhitespace)
18555 /* harmony export */ });
18556 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
18557 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
18558 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
18559 /**
18560 * @typedef {import('micromark-util-types').Effects} Effects
18561 * @typedef {import('micromark-util-types').State} State
18562 */
18563
18564
18565
18566
18567
18568 /**
18569 * @param {Effects} effects
18570 * @param {State} ok
18571 */
18572 function factoryWhitespace(effects, ok) {
18573 /** @type {boolean} */
18574 let seen
18575
18576 return start
18577
18578 /** @type {State} */
18579 function start(code) {
18580 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownLineEnding)(code)) {
18581 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
18582 effects.consume(code)
18583 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding)
18584 seen = true
18585 return start
18586 }
18587
18588 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownSpace)(code)) {
18589 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__.factorySpace)(
18590 effects,
18591 start,
18592 seen ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineSuffix
18593 )(code)
18594 }
18595
18596 return ok(code)
18597 }
18598 }
18599
18600
18601 /***/ }),
18602
18603 /***/ "../node_modules/micromark-util-character/dev/index.js":
18604 /*!*************************************************************!*\
18605 !*** ../node_modules/micromark-util-character/dev/index.js ***!
18606 \*************************************************************/
18607 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18608
18609 "use strict";
18610 __webpack_require__.r(__webpack_exports__);
18611 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18612 /* harmony export */ "asciiAlpha": () => (/* binding */ asciiAlpha),
18613 /* harmony export */ "asciiAlphanumeric": () => (/* binding */ asciiAlphanumeric),
18614 /* harmony export */ "asciiAtext": () => (/* binding */ asciiAtext),
18615 /* harmony export */ "asciiControl": () => (/* binding */ asciiControl),
18616 /* harmony export */ "asciiDigit": () => (/* binding */ asciiDigit),
18617 /* harmony export */ "asciiHexDigit": () => (/* binding */ asciiHexDigit),
18618 /* harmony export */ "asciiPunctuation": () => (/* binding */ asciiPunctuation),
18619 /* harmony export */ "markdownLineEnding": () => (/* binding */ markdownLineEnding),
18620 /* harmony export */ "markdownLineEndingOrSpace": () => (/* binding */ markdownLineEndingOrSpace),
18621 /* harmony export */ "markdownSpace": () => (/* binding */ markdownSpace),
18622 /* harmony export */ "unicodePunctuation": () => (/* binding */ unicodePunctuation),
18623 /* harmony export */ "unicodeWhitespace": () => (/* binding */ unicodeWhitespace)
18624 /* harmony export */ });
18625 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
18626 /* harmony import */ var _lib_unicode_punctuation_regex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/unicode-punctuation-regex.js */ "../node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js");
18627 /**
18628 * @typedef {import('micromark-util-types').Code} Code
18629 */
18630
18631
18632
18633
18634 /**
18635 * Check whether the character code represents an ASCII alpha (`a` through `z`,
18636 * case insensitive).
18637 *
18638 * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
18639 *
18640 * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
18641 * to U+005A (`Z`).
18642 *
18643 * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
18644 * to U+007A (`z`).
18645 */
18646 const asciiAlpha = regexCheck(/[A-Za-z]/)
18647
18648 /**
18649 * Check whether the character code represents an ASCII digit (`0` through `9`).
18650 *
18651 * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
18652 * U+0039 (`9`).
18653 */
18654 const asciiDigit = regexCheck(/\d/)
18655
18656 /**
18657 * Check whether the character code represents an ASCII hex digit (`a` through
18658 * `f`, case insensitive, or `0` through `9`).
18659 *
18660 * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
18661 * digit, or an ASCII lower hex digit.
18662 *
18663 * An **ASCII upper hex digit** is a character in the inclusive range U+0041
18664 * (`A`) to U+0046 (`F`).
18665 *
18666 * An **ASCII lower hex digit** is a character in the inclusive range U+0061
18667 * (`a`) to U+0066 (`f`).
18668 */
18669 const asciiHexDigit = regexCheck(/[\dA-Fa-f]/)
18670
18671 /**
18672 * Check whether the character code represents an ASCII alphanumeric (`a`
18673 * through `z`, case insensitive, or `0` through `9`).
18674 *
18675 * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
18676 * (see `asciiAlpha`).
18677 */
18678 const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/)
18679
18680 /**
18681 * Check whether the character code represents ASCII punctuation.
18682 *
18683 * An **ASCII punctuation** is a character in the inclusive ranges U+0021
18684 * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
18685 * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
18686 * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
18687 */
18688 const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)
18689
18690 /**
18691 * Check whether the character code represents an ASCII atext.
18692 *
18693 * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
18694 * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
18695 * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
18696 * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
18697 * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
18698 * (`{`) to U+007E TILDE (`~`).
18699 *
18700 * See:
18701 * **\[RFC5322]**:
18702 * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
18703 * P. Resnick.
18704 * IETF.
18705 */
18706 const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/)
18707
18708 /**
18709 * Check whether a character code is an ASCII control character.
18710 *
18711 * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
18712 * to U+001F (US), or U+007F (DEL).
18713 *
18714 * @param {Code} code
18715 * @returns {code is number}
18716 */
18717 function asciiControl(code) {
18718 return (
18719 // Special whitespace codes (which have negative values), C0 and Control
18720 // character DEL
18721 code !== null && (code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.del)
18722 )
18723 }
18724
18725 /**
18726 * Check whether a character code is a markdown line ending (see
18727 * `markdownLineEnding`) or markdown space (see `markdownSpace`).
18728 *
18729 * @param {Code} code
18730 * @returns {code is number}
18731 */
18732 function markdownLineEndingOrSpace(code) {
18733 return code !== null && (code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.nul || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space)
18734 }
18735
18736 /**
18737 * Check whether a character code is a markdown line ending.
18738 *
18739 * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
18740 * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
18741 *
18742 * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
18743 * RETURN (CR) are replaced by these virtual characters depending on whether
18744 * they occurred together.
18745 *
18746 * @param {Code} code
18747 * @returns {code is number}
18748 */
18749 function markdownLineEnding(code) {
18750 return code !== null && code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab
18751 }
18752
18753 /**
18754 * Check whether a character code is a markdown space.
18755 *
18756 * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
18757 * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
18758 *
18759 * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
18760 * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
18761 * SPACE (VS) characters, depending on the column at which the tab occurred.
18762 *
18763 * @param {Code} code
18764 * @returns {code is number}
18765 */
18766 function markdownSpace(code) {
18767 return (
18768 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab ||
18769 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace ||
18770 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space
18771 )
18772 }
18773
18774 /**
18775 * Check whether the character code represents Unicode whitespace.
18776 *
18777 * Note that this does handle micromark specific markdown whitespace characters.
18778 * See `markdownLineEndingOrSpace` to check that.
18779 *
18780 * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
18781 * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
18782 * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
18783 *
18784 * See:
18785 * **\[UNICODE]**:
18786 * [The Unicode Standard](https://www.unicode.org/versions/).
18787 * Unicode Consortium.
18788 */
18789 const unicodeWhitespace = regexCheck(/\s/)
18790
18791 /**
18792 * Check whether the character code represents Unicode punctuation.
18793 *
18794 * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
18795 * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
18796 * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
18797 * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
18798 * punctuation (see `asciiPunctuation`).
18799 *
18800 * See:
18801 * **\[UNICODE]**:
18802 * [The Unicode Standard](https://www.unicode.org/versions/).
18803 * Unicode Consortium.
18804 */
18805 // Size note: removing ASCII from the regex and using `asciiPunctuation` here
18806 // In fact adds to the bundle size.
18807 const unicodePunctuation = regexCheck(_lib_unicode_punctuation_regex_js__WEBPACK_IMPORTED_MODULE_1__.unicodePunctuationRegex)
18808
18809 /**
18810 * Create a code check from a regex.
18811 *
18812 * @param {RegExp} regex
18813 * @returns {(code: Code) => code is number}
18814 */
18815 function regexCheck(regex) {
18816 return check
18817
18818 /**
18819 * Check whether a code matches the bound regex.
18820 *
18821 * @param {Code} code Character code
18822 * @returns {code is number} Whether the character code matches the bound regex
18823 */
18824 function check(code) {
18825 return code !== null && regex.test(String.fromCharCode(code))
18826 }
18827 }
18828
18829
18830 /***/ }),
18831
18832 /***/ "../node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js":
18833 /*!*************************************************************************************!*\
18834 !*** ../node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js ***!
18835 \*************************************************************************************/
18836 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18837
18838 "use strict";
18839 __webpack_require__.r(__webpack_exports__);
18840 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18841 /* harmony export */ "unicodePunctuationRegex": () => (/* binding */ unicodePunctuationRegex)
18842 /* harmony export */ });
18843 // This module is generated by `script/`.
18844 //
18845 // CommonMark handles attention (emphasis, strong) markers based on what comes
18846 // before or after them.
18847 // One such difference is if those characters are Unicode punctuation.
18848 // This script is generated from the Unicode data.
18849 const unicodePunctuationRegex =
18850 /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/
18851
18852
18853 /***/ }),
18854
18855 /***/ "../node_modules/micromark-util-chunked/dev/index.js":
18856 /*!***********************************************************!*\
18857 !*** ../node_modules/micromark-util-chunked/dev/index.js ***!
18858 \***********************************************************/
18859 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18860
18861 "use strict";
18862 __webpack_require__.r(__webpack_exports__);
18863 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18864 /* harmony export */ "push": () => (/* binding */ push),
18865 /* harmony export */ "splice": () => (/* binding */ splice)
18866 /* harmony export */ });
18867 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
18868
18869
18870 /**
18871 * Like `Array#splice`, but smarter for giant arrays.
18872 *
18873 * `Array#splice` takes all items to be inserted as individual argument which
18874 * causes a stack overflow in V8 when trying to insert 100k items for instance.
18875 *
18876 * Otherwise, this does not return the removed items, and takes `items` as an
18877 * array instead of rest parameters.
18878 *
18879 * @template {unknown} T
18880 * @param {T[]} list
18881 * @param {number} start
18882 * @param {number} remove
18883 * @param {T[]} items
18884 * @returns {void}
18885 */
18886 function splice(list, start, remove, items) {
18887 const end = list.length
18888 let chunkStart = 0
18889 /** @type {unknown[]} */
18890 let parameters
18891
18892 // Make start between zero and `end` (included).
18893 if (start < 0) {
18894 start = -start > end ? 0 : end + start
18895 } else {
18896 start = start > end ? end : start
18897 }
18898
18899 remove = remove > 0 ? remove : 0
18900
18901 // No need to chunk the items if there’s only a couple (10k) items.
18902 if (items.length < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize) {
18903 parameters = Array.from(items)
18904 parameters.unshift(start, remove)
18905 // @ts-expect-error Hush, it’s fine.
18906 ;[].splice.apply(list, parameters)
18907 } else {
18908 // Delete `remove` items starting from `start`
18909 if (remove) [].splice.apply(list, [start, remove])
18910
18911 // Insert the items in chunks to not cause stack overflows.
18912 while (chunkStart < items.length) {
18913 parameters = items.slice(
18914 chunkStart,
18915 chunkStart + micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize
18916 )
18917 parameters.unshift(start, 0)
18918 // @ts-expect-error Hush, it’s fine.
18919 ;[].splice.apply(list, parameters)
18920
18921 chunkStart += micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize
18922 start += micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize
18923 }
18924 }
18925 }
18926
18927 /**
18928 * Append `items` (an array) at the end of `list` (another array).
18929 * When `list` was empty, returns `items` instead.
18930 *
18931 * This prevents a potentially expensive operation when `list` is empty,
18932 * and adds items in batches to prevent V8 from hanging.
18933 *
18934 * @template {unknown} T
18935 * @param {T[]} list
18936 * @param {T[]} items
18937 * @returns {T[]}
18938 */
18939 function push(list, items) {
18940 if (list.length > 0) {
18941 splice(list, list.length, 0, items)
18942 return list
18943 }
18944
18945 return items
18946 }
18947
18948
18949 /***/ }),
18950
18951 /***/ "../node_modules/micromark-util-classify-character/dev/index.js":
18952 /*!**********************************************************************!*\
18953 !*** ../node_modules/micromark-util-classify-character/dev/index.js ***!
18954 \**********************************************************************/
18955 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18956
18957 "use strict";
18958 __webpack_require__.r(__webpack_exports__);
18959 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18960 /* harmony export */ "classifyCharacter": () => (/* binding */ classifyCharacter)
18961 /* harmony export */ });
18962 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
18963 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
18964 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
18965 /**
18966 * @typedef {import('micromark-util-types').Code} Code
18967 */
18968
18969
18970
18971
18972
18973 /**
18974 * Classify whether a character code represents whitespace, punctuation, or
18975 * something else.
18976 *
18977 * Used for attention (emphasis, strong), whose sequences can open or close
18978 * based on the class of surrounding characters.
18979 *
18980 * Note that eof (`null`) is seen as whitespace.
18981 *
18982 * @param {Code} code
18983 * @returns {number|undefined}
18984 */
18985 function classifyCharacter(code) {
18986 if (
18987 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof ||
18988 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEndingOrSpace)(code) ||
18989 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.unicodeWhitespace)(code)
18990 ) {
18991 return micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.characterGroupWhitespace
18992 }
18993
18994 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.unicodePunctuation)(code)) {
18995 return micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.characterGroupPunctuation
18996 }
18997 }
18998
18999
19000 /***/ }),
19001
19002 /***/ "../node_modules/micromark-util-combine-extensions/index.js":
19003 /*!******************************************************************!*\
19004 !*** ../node_modules/micromark-util-combine-extensions/index.js ***!
19005 \******************************************************************/
19006 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19007
19008 "use strict";
19009 __webpack_require__.r(__webpack_exports__);
19010 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19011 /* harmony export */ "combineExtensions": () => (/* binding */ combineExtensions),
19012 /* harmony export */ "combineHtmlExtensions": () => (/* binding */ combineHtmlExtensions)
19013 /* harmony export */ });
19014 /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js");
19015 /**
19016 * @typedef {import('micromark-util-types').NormalizedExtension} NormalizedExtension
19017 * @typedef {import('micromark-util-types').Extension} Extension
19018 * @typedef {import('micromark-util-types').Construct} Construct
19019 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
19020 */
19021
19022
19023
19024 const hasOwnProperty = {}.hasOwnProperty
19025
19026 /**
19027 * Combine several syntax extensions into one.
19028 *
19029 * @param {Extension[]} extensions List of syntax extensions.
19030 * @returns {NormalizedExtension} A single combined extension.
19031 */
19032 function combineExtensions(extensions) {
19033 /** @type {NormalizedExtension} */
19034 const all = {}
19035 let index = -1
19036
19037 while (++index < extensions.length) {
19038 syntaxExtension(all, extensions[index])
19039 }
19040
19041 return all
19042 }
19043
19044 /**
19045 * Merge `extension` into `all`.
19046 *
19047 * @param {NormalizedExtension} all Extension to merge into.
19048 * @param {Extension} extension Extension to merge.
19049 * @returns {void}
19050 */
19051 function syntaxExtension(all, extension) {
19052 /** @type {string} */
19053 let hook
19054
19055 for (hook in extension) {
19056 const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined
19057 const left = maybe || (all[hook] = {})
19058 const right = extension[hook]
19059 /** @type {string} */
19060 let code
19061
19062 for (code in right) {
19063 if (!hasOwnProperty.call(left, code)) left[code] = []
19064 const value = right[code]
19065 constructs(
19066 // @ts-expect-error Looks like a list.
19067 left[code],
19068 Array.isArray(value) ? value : value ? [value] : []
19069 )
19070 }
19071 }
19072 }
19073
19074 /**
19075 * Merge `list` into `existing` (both lists of constructs).
19076 * Mutates `existing`.
19077 *
19078 * @param {unknown[]} existing
19079 * @param {unknown[]} list
19080 * @returns {void}
19081 */
19082 function constructs(existing, list) {
19083 let index = -1
19084 /** @type {unknown[]} */
19085 const before = []
19086
19087 while (++index < list.length) {
19088 // @ts-expect-error Looks like an object.
19089 ;(list[index].add === 'after' ? existing : before).push(list[index])
19090 }
19091
19092 (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_0__.splice)(existing, 0, 0, before)
19093 }
19094
19095 /**
19096 * Combine several HTML extensions into one.
19097 *
19098 * @param {HtmlExtension[]} htmlExtensions List of HTML extensions.
19099 * @returns {HtmlExtension} A single combined extension.
19100 */
19101 function combineHtmlExtensions(htmlExtensions) {
19102 /** @type {HtmlExtension} */
19103 const handlers = {}
19104 let index = -1
19105
19106 while (++index < htmlExtensions.length) {
19107 htmlExtension(handlers, htmlExtensions[index])
19108 }
19109
19110 return handlers
19111 }
19112
19113 /**
19114 * Merge `extension` into `all`.
19115 *
19116 * @param {HtmlExtension} all Extension to merge into.
19117 * @param {HtmlExtension} extension Extension to merge.
19118 * @returns {void}
19119 */
19120 function htmlExtension(all, extension) {
19121 /** @type {string} */
19122 let hook
19123
19124 for (hook in extension) {
19125 const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined
19126 const left = maybe || (all[hook] = {})
19127 const right = extension[hook]
19128 /** @type {string} */
19129 let type
19130
19131 if (right) {
19132 for (type in right) {
19133 left[type] = right[type]
19134 }
19135 }
19136 }
19137 }
19138
19139
19140 /***/ }),
19141
19142 /***/ "../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js":
19143 /*!**************************************************************************************!*\
19144 !*** ../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js ***!
19145 \**************************************************************************************/
19146 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19147
19148 "use strict";
19149 __webpack_require__.r(__webpack_exports__);
19150 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19151 /* harmony export */ "decodeNumericCharacterReference": () => (/* binding */ decodeNumericCharacterReference)
19152 /* harmony export */ });
19153 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
19154 /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js");
19155
19156
19157
19158 /**
19159 * Turn the number (in string form as either hexa- or plain decimal) coming from
19160 * a numeric character reference into a character.
19161 *
19162 * @param {string} value
19163 * Value to decode.
19164 * @param {number} base
19165 * Numeric base.
19166 * @returns {string}
19167 */
19168 function decodeNumericCharacterReference(value, base) {
19169 const code = Number.parseInt(value, base)
19170
19171 if (
19172 // C0 except for HT, LF, FF, CR, space
19173 code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ht ||
19174 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.vt ||
19175 (code > micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.cr && code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space) ||
19176 // Control character (DEL) of the basic block and C1 controls.
19177 (code > micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.tilde && code < 160) ||
19178 // Lone high surrogates and low surrogates.
19179 (code > 55295 && code < 57344) ||
19180 // Noncharacters.
19181 (code > 64975 && code < 65008) ||
19182 (code & 65535) === 65535 ||
19183 (code & 65535) === 65534 ||
19184 // Out of range
19185 code > 1114111
19186 ) {
19187 return micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_1__.values.replacementCharacter
19188 }
19189
19190 return String.fromCharCode(code)
19191 }
19192
19193
19194 /***/ }),
19195
19196 /***/ "../node_modules/micromark-util-decode-string/dev/index.js":
19197 /*!*****************************************************************!*\
19198 !*** ../node_modules/micromark-util-decode-string/dev/index.js ***!
19199 \*****************************************************************/
19200 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19201
19202 "use strict";
19203 __webpack_require__.r(__webpack_exports__);
19204 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19205 /* harmony export */ "decodeString": () => (/* binding */ decodeString)
19206 /* harmony export */ });
19207 /* harmony import */ var decode_named_character_reference__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! decode-named-character-reference */ "../node_modules/decode-named-character-reference/index.dom.js");
19208 /* harmony import */ var micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-decode-numeric-character-reference */ "../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js");
19209 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
19210 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
19211
19212
19213
19214
19215
19216 const characterEscapeOrReference =
19217 /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi
19218
19219 /**
19220 * Utility to decode markdown strings (which occur in places such as fenced
19221 * code info strings, destinations, labels, and titles).
19222 * The “string” content type allows character escapes and -references.
19223 * This decodes those.
19224 *
19225 * @param {string} value
19226 * @returns {string}
19227 */
19228 function decodeString(value) {
19229 return value.replace(characterEscapeOrReference, decode)
19230 }
19231
19232 /**
19233 * @param {string} $0
19234 * @param {string} $1
19235 * @param {string} $2
19236 * @returns {string}
19237 */
19238 function decode($0, $1, $2) {
19239 if ($1) {
19240 // Escape.
19241 return $1
19242 }
19243
19244 // Reference.
19245 const head = $2.charCodeAt(0)
19246
19247 if (head === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.numberSign) {
19248 const head = $2.charCodeAt(1)
19249 const hex = head === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lowercaseX || head === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.uppercaseX
19250 return (0,micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_1__.decodeNumericCharacterReference)(
19251 $2.slice(hex ? 2 : 1),
19252 hex ? micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.numericBaseHexadecimal : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.numericBaseDecimal
19253 )
19254 }
19255
19256 return (0,decode_named_character_reference__WEBPACK_IMPORTED_MODULE_3__.decodeNamedCharacterReference)($2) || $0
19257 }
19258
19259
19260 /***/ }),
19261
19262 /***/ "../node_modules/micromark-util-encode/index.js":
19263 /*!******************************************************!*\
19264 !*** ../node_modules/micromark-util-encode/index.js ***!
19265 \******************************************************/
19266 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19267
19268 "use strict";
19269 __webpack_require__.r(__webpack_exports__);
19270 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19271 /* harmony export */ "encode": () => (/* binding */ encode)
19272 /* harmony export */ });
19273 const characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'}
19274
19275 /**
19276 * Encode only the dangerous HTML characters.
19277 *
19278 * This ensures that certain characters which have special meaning in HTML are
19279 * dealt with.
19280 * Technically, we can skip `>` and `"` in many cases, but CM includes them.
19281 *
19282 * @param {string} value
19283 * @returns {string}
19284 */
19285 function encode(value) {
19286 return value.replace(/["&<>]/g, replace)
19287
19288 /**
19289 * @param {string} value
19290 * @returns {string}
19291 */
19292 function replace(value) {
19293 // @ts-expect-error Hush, it’s fine.
19294 return '&' + characterReferences[value] + ';'
19295 }
19296 }
19297
19298
19299 /***/ }),
19300
19301 /***/ "../node_modules/micromark-util-html-tag-name/index.js":
19302 /*!*************************************************************!*\
19303 !*** ../node_modules/micromark-util-html-tag-name/index.js ***!
19304 \*************************************************************/
19305 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19306
19307 "use strict";
19308 __webpack_require__.r(__webpack_exports__);
19309 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19310 /* harmony export */ "htmlBlockNames": () => (/* binding */ htmlBlockNames),
19311 /* harmony export */ "htmlRawNames": () => (/* binding */ htmlRawNames)
19312 /* harmony export */ });
19313 /**
19314 * List of lowercase HTML tag names which when parsing HTML (flow), result
19315 * in more relaxed rules (condition 6): because they are known blocks, the
19316 * HTML-like syntax doesn’t have to be strictly parsed.
19317 * For tag names not in this list, a more strict algorithm (condition 7) is used
19318 * to detect whether the HTML-like syntax is seen as HTML (flow) or not.
19319 *
19320 * This is copied from:
19321 * <https://spec.commonmark.org/0.30/#html-blocks>.
19322 */
19323 const htmlBlockNames = [
19324 'address',
19325 'article',
19326 'aside',
19327 'base',
19328 'basefont',
19329 'blockquote',
19330 'body',
19331 'caption',
19332 'center',
19333 'col',
19334 'colgroup',
19335 'dd',
19336 'details',
19337 'dialog',
19338 'dir',
19339 'div',
19340 'dl',
19341 'dt',
19342 'fieldset',
19343 'figcaption',
19344 'figure',
19345 'footer',
19346 'form',
19347 'frame',
19348 'frameset',
19349 'h1',
19350 'h2',
19351 'h3',
19352 'h4',
19353 'h5',
19354 'h6',
19355 'head',
19356 'header',
19357 'hr',
19358 'html',
19359 'iframe',
19360 'legend',
19361 'li',
19362 'link',
19363 'main',
19364 'menu',
19365 'menuitem',
19366 'nav',
19367 'noframes',
19368 'ol',
19369 'optgroup',
19370 'option',
19371 'p',
19372 'param',
19373 'section',
19374 'summary',
19375 'table',
19376 'tbody',
19377 'td',
19378 'tfoot',
19379 'th',
19380 'thead',
19381 'title',
19382 'tr',
19383 'track',
19384 'ul'
19385 ]
19386
19387 /**
19388 * List of lowercase HTML tag names which when parsing HTML (flow), result in
19389 * HTML that can include lines w/o exiting, until a closing tag also in this
19390 * list is found (condition 1).
19391 *
19392 * This module is copied from:
19393 * <https://spec.commonmark.org/0.30/#html-blocks>.
19394 *
19395 * Note that `textarea` was added in `CommonMark@0.30`.
19396 */
19397 const htmlRawNames = ['pre', 'script', 'style', 'textarea']
19398
19399
19400 /***/ }),
19401
19402 /***/ "../node_modules/micromark-util-normalize-identifier/dev/index.js":
19403 /*!************************************************************************!*\
19404 !*** ../node_modules/micromark-util-normalize-identifier/dev/index.js ***!
19405 \************************************************************************/
19406 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19407
19408 "use strict";
19409 __webpack_require__.r(__webpack_exports__);
19410 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19411 /* harmony export */ "normalizeIdentifier": () => (/* binding */ normalizeIdentifier)
19412 /* harmony export */ });
19413 /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js");
19414
19415
19416 /**
19417 * Normalize an identifier (such as used in definitions).
19418 *
19419 * @param {string} value
19420 * @returns {string}
19421 */
19422 function normalizeIdentifier(value) {
19423 return (
19424 value
19425 // Collapse Markdown whitespace.
19426 .replace(/[\t\n\r ]+/g, micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_0__.values.space)
19427 // Trim.
19428 .replace(/^ | $/g, '')
19429 // Some characters are considered “uppercase”, but if their lowercase
19430 // counterpart is uppercased will result in a different uppercase
19431 // character.
19432 // Hence, to get that form, we perform both lower- and uppercase.
19433 // Upper case makes sure keys will not interact with default prototypal
19434 // methods: no method is uppercase.
19435 .toLowerCase()
19436 .toUpperCase()
19437 )
19438 }
19439
19440
19441 /***/ }),
19442
19443 /***/ "../node_modules/micromark-util-resolve-all/index.js":
19444 /*!***********************************************************!*\
19445 !*** ../node_modules/micromark-util-resolve-all/index.js ***!
19446 \***********************************************************/
19447 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19448
19449 "use strict";
19450 __webpack_require__.r(__webpack_exports__);
19451 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19452 /* harmony export */ "resolveAll": () => (/* binding */ resolveAll)
19453 /* harmony export */ });
19454 /**
19455 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
19456 * @typedef {import('micromark-util-types').Event} Event
19457 * @typedef {import('micromark-util-types').Resolver} Resolver
19458 */
19459
19460 /**
19461 * Call all `resolveAll`s.
19462 *
19463 * @param {{resolveAll?: Resolver}[]} constructs
19464 * @param {Event[]} events
19465 * @param {TokenizeContext} context
19466 * @returns {Event[]}
19467 */
19468 function resolveAll(constructs, events, context) {
19469 /** @type {Resolver[]} */
19470 const called = []
19471 let index = -1
19472
19473 while (++index < constructs.length) {
19474 const resolve = constructs[index].resolveAll
19475
19476 if (resolve && !called.includes(resolve)) {
19477 events = resolve(events, context)
19478 called.push(resolve)
19479 }
19480 }
19481
19482 return events
19483 }
19484
19485
19486 /***/ }),
19487
19488 /***/ "../node_modules/micromark-util-sanitize-uri/dev/index.js":
19489 /*!****************************************************************!*\
19490 !*** ../node_modules/micromark-util-sanitize-uri/dev/index.js ***!
19491 \****************************************************************/
19492 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19493
19494 "use strict";
19495 __webpack_require__.r(__webpack_exports__);
19496 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19497 /* harmony export */ "normalizeUri": () => (/* binding */ normalizeUri),
19498 /* harmony export */ "sanitizeUri": () => (/* binding */ sanitizeUri)
19499 /* harmony export */ });
19500 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
19501 /* harmony import */ var micromark_util_encode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-encode */ "../node_modules/micromark-util-encode/index.js");
19502 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
19503 /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js");
19504
19505
19506
19507
19508
19509 /**
19510 * Make a value safe for injection as a URL.
19511 *
19512 * This encodes unsafe characters with percent-encoding and skips already
19513 * encoded sequences (see `normalizeUri` below).
19514 * Further unsafe characters are encoded as character references (see
19515 * `micromark-util-encode`).
19516 *
19517 * Then, a regex of allowed protocols can be given, in which case the URL is
19518 * sanitized.
19519 * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`,
19520 * or `/^https?$/i` for `img[src]`.
19521 * If the URL includes an unknown protocol (one not matched by `protocol`, such
19522 * as a dangerous example, `javascript:`), the value is ignored.
19523 *
19524 * @param {string|undefined} url
19525 * @param {RegExp} [protocol]
19526 * @returns {string}
19527 */
19528 function sanitizeUri(url, protocol) {
19529 const value = (0,micromark_util_encode__WEBPACK_IMPORTED_MODULE_0__.encode)(normalizeUri(url || ''))
19530
19531 if (!protocol) {
19532 return value
19533 }
19534
19535 const colon = value.indexOf(':')
19536 const questionMark = value.indexOf('?')
19537 const numberSign = value.indexOf('#')
19538 const slash = value.indexOf('/')
19539
19540 if (
19541 // If there is no protocol, it’s relative.
19542 colon < 0 ||
19543 // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
19544 (slash > -1 && colon > slash) ||
19545 (questionMark > -1 && colon > questionMark) ||
19546 (numberSign > -1 && colon > numberSign) ||
19547 // It is a protocol, it should be allowed.
19548 protocol.test(value.slice(0, colon))
19549 ) {
19550 return value
19551 }
19552
19553 return ''
19554 }
19555
19556 /**
19557 * Normalize a URL (such as used in definitions).
19558 *
19559 * Encode unsafe characters with percent-encoding, skipping already encoded
19560 * sequences.
19561 *
19562 * @param {string} value
19563 * @returns {string}
19564 */
19565 function normalizeUri(value) {
19566 /** @type {Array<string>} */
19567 const result = []
19568 let index = -1
19569 let start = 0
19570 let skip = 0
19571
19572 while (++index < value.length) {
19573 const code = value.charCodeAt(index)
19574 /** @type {string} */
19575 let replace = ''
19576
19577 // A correct percent encoded value.
19578 if (
19579 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.percentSign &&
19580 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.asciiAlphanumeric)(value.charCodeAt(index + 1)) &&
19581 (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.asciiAlphanumeric)(value.charCodeAt(index + 2))
19582 ) {
19583 skip = 2
19584 }
19585 // ASCII.
19586 else if (code < 128) {
19587 if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {
19588 replace = String.fromCharCode(code)
19589 }
19590 }
19591 // Astral.
19592 else if (code > 55295 && code < 57344) {
19593 const next = value.charCodeAt(index + 1)
19594
19595 // A correct surrogate pair.
19596 if (code < 56320 && next > 56319 && next < 57344) {
19597 replace = String.fromCharCode(code, next)
19598 skip = 1
19599 }
19600 // Lone surrogate.
19601 else {
19602 replace = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_3__.values.replacementCharacter
19603 }
19604 }
19605 // Unicode.
19606 else {
19607 replace = String.fromCharCode(code)
19608 }
19609
19610 if (replace) {
19611 result.push(value.slice(start, index), encodeURIComponent(replace))
19612 start = index + skip + 1
19613 replace = ''
19614 }
19615
19616 if (skip) {
19617 index += skip
19618 skip = 0
19619 }
19620 }
19621
19622 return result.join('') + value.slice(start)
19623 }
19624
19625
19626 /***/ }),
19627
19628 /***/ "../node_modules/micromark-util-subtokenize/dev/index.js":
19629 /*!***************************************************************!*\
19630 !*** ../node_modules/micromark-util-subtokenize/dev/index.js ***!
19631 \***************************************************************/
19632 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19633
19634 "use strict";
19635 __webpack_require__.r(__webpack_exports__);
19636 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19637 /* harmony export */ "subtokenize": () => (/* binding */ subtokenize)
19638 /* harmony export */ });
19639 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
19640 /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js");
19641 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
19642 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
19643 /**
19644 * @typedef {import('micromark-util-types').Token} Token
19645 * @typedef {import('micromark-util-types').Chunk} Chunk
19646 * @typedef {import('micromark-util-types').Event} Event
19647 */
19648
19649
19650
19651
19652
19653
19654 /**
19655 * Tokenize subcontent.
19656 *
19657 * @param {Event[]} events
19658 * @returns {boolean}
19659 */
19660 function subtokenize(events) {
19661 /** @type {Record<string, number>} */
19662 const jumps = {}
19663 let index = -1
19664 /** @type {Event} */
19665 let event
19666 /** @type {number|undefined} */
19667 let lineIndex
19668 /** @type {number} */
19669 let otherIndex
19670 /** @type {Event} */
19671 let otherEvent
19672 /** @type {Event[]} */
19673 let parameters
19674 /** @type {Event[]} */
19675 let subevents
19676 /** @type {boolean|undefined} */
19677 let more
19678
19679 while (++index < events.length) {
19680 while (index in jumps) {
19681 index = jumps[index]
19682 }
19683
19684 event = events[index]
19685
19686 // Add a hook for the GFM tasklist extension, which needs to know if text
19687 // is in the first content of a list item.
19688 if (
19689 index &&
19690 event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow &&
19691 events[index - 1][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix
19692 ) {
19693 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(event[1]._tokenizer, 'expected `_tokenizer` on subtokens')
19694 subevents = event[1]._tokenizer.events
19695 otherIndex = 0
19696
19697 if (
19698 otherIndex < subevents.length &&
19699 subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank
19700 ) {
19701 otherIndex += 2
19702 }
19703
19704 if (
19705 otherIndex < subevents.length &&
19706 subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content
19707 ) {
19708 while (++otherIndex < subevents.length) {
19709 if (subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content) {
19710 break
19711 }
19712
19713 if (subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkText) {
19714 subevents[otherIndex][1]._isInFirstContentOfListItem = true
19715 otherIndex++
19716 }
19717 }
19718 }
19719 }
19720
19721 // Enter.
19722 if (event[0] === 'enter') {
19723 if (event[1].contentType) {
19724 Object.assign(jumps, subcontent(events, index))
19725 index = jumps[index]
19726 more = true
19727 }
19728 }
19729 // Exit.
19730 else if (event[1]._container) {
19731 otherIndex = index
19732 lineIndex = undefined
19733
19734 while (otherIndex--) {
19735 otherEvent = events[otherIndex]
19736
19737 if (
19738 otherEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding ||
19739 otherEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank
19740 ) {
19741 if (otherEvent[0] === 'enter') {
19742 if (lineIndex) {
19743 events[lineIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank
19744 }
19745
19746 otherEvent[1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding
19747 lineIndex = otherIndex
19748 }
19749 } else {
19750 break
19751 }
19752 }
19753
19754 if (lineIndex) {
19755 // Fix position.
19756 event[1].end = Object.assign({}, events[lineIndex][1].start)
19757
19758 // Switch container exit w/ line endings.
19759 parameters = events.slice(lineIndex, index)
19760 parameters.unshift(event)
19761 ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, lineIndex, index - lineIndex + 1, parameters)
19762 }
19763 }
19764 }
19765
19766 return !more
19767 }
19768
19769 /**
19770 * Tokenize embedded tokens.
19771 *
19772 * @param {Event[]} events
19773 * @param {number} eventIndex
19774 * @returns {Record<string, number>}
19775 */
19776 function subcontent(events, eventIndex) {
19777 const token = events[eventIndex][1]
19778 const context = events[eventIndex][2]
19779 let startPosition = eventIndex - 1
19780 /** @type {number[]} */
19781 const startPositions = []
19782 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(token.contentType, 'expected `contentType` on subtokens')
19783 const tokenizer =
19784 token._tokenizer || context.parser[token.contentType](token.start)
19785 const childEvents = tokenizer.events
19786 /** @type {[number, number][]} */
19787 const jumps = []
19788 /** @type {Record<string, number>} */
19789 const gaps = {}
19790 /** @type {Chunk[]} */
19791 let stream
19792 /** @type {Token|undefined} */
19793 let previous
19794 let index = -1
19795 /** @type {Token|undefined} */
19796 let current = token
19797 let adjust = 0
19798 let start = 0
19799 const breaks = [start]
19800
19801 // Loop forward through the linked tokens to pass them in order to the
19802 // subtokenizer.
19803 while (current) {
19804 // Find the position of the event for this token.
19805 while (events[++startPosition][1] !== current) {
19806 // Empty.
19807 }
19808
19809 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
19810 !previous || current.previous === previous,
19811 'expected previous to match'
19812 )
19813 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(!previous || previous.next === current, 'expected next to match')
19814
19815 startPositions.push(startPosition)
19816
19817 if (!current._tokenizer) {
19818 stream = context.sliceStream(current)
19819
19820 if (!current.next) {
19821 stream.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof)
19822 }
19823
19824 if (previous) {
19825 tokenizer.defineSkip(current.start)
19826 }
19827
19828 if (current._isInFirstContentOfListItem) {
19829 tokenizer._gfmTasklistFirstContentOfListItem = true
19830 }
19831
19832 tokenizer.write(stream)
19833
19834 if (current._isInFirstContentOfListItem) {
19835 tokenizer._gfmTasklistFirstContentOfListItem = undefined
19836 }
19837 }
19838
19839 // Unravel the next token.
19840 previous = current
19841 current = current.next
19842 }
19843
19844 // Now, loop back through all events (and linked tokens), to figure out which
19845 // parts belong where.
19846 current = token
19847
19848 while (++index < childEvents.length) {
19849 if (
19850 // Find a void token that includes a break.
19851 childEvents[index][0] === 'exit' &&
19852 childEvents[index - 1][0] === 'enter' &&
19853 childEvents[index][1].type === childEvents[index - 1][1].type &&
19854 childEvents[index][1].start.line !== childEvents[index][1].end.line
19855 ) {
19856 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(current, 'expected a current token')
19857 start = index + 1
19858 breaks.push(start)
19859 // Help GC.
19860 current._tokenizer = undefined
19861 current.previous = undefined
19862 current = current.next
19863 }
19864 }
19865
19866 // Help GC.
19867 tokenizer.events = []
19868
19869 // If there’s one more token (which is the cases for lines that end in an
19870 // EOF), that’s perfect: the last point we found starts it.
19871 // If there isn’t then make sure any remaining content is added to it.
19872 if (current) {
19873 // Help GC.
19874 current._tokenizer = undefined
19875 current.previous = undefined
19876 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(!current.next, 'expected no next token')
19877 } else {
19878 breaks.pop()
19879 }
19880
19881 // Now splice the events from the subtokenizer into the current events,
19882 // moving back to front so that splice indices aren’t affected.
19883 index = breaks.length
19884
19885 while (index--) {
19886 const slice = childEvents.slice(breaks[index], breaks[index + 1])
19887 const start = startPositions.pop()
19888 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(start !== undefined, 'expected a start position when splicing')
19889 jumps.unshift([start, start + slice.length - 1])
19890 ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, start, 2, slice)
19891 }
19892
19893 index = -1
19894
19895 while (++index < jumps.length) {
19896 gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]
19897 adjust += jumps[index][1] - jumps[index][0] - 1
19898 }
19899
19900 return gaps
19901 }
19902
19903
19904 /***/ }),
19905
19906 /***/ "../node_modules/micromark-util-symbol/codes.js":
19907 /*!******************************************************!*\
19908 !*** ../node_modules/micromark-util-symbol/codes.js ***!
19909 \******************************************************/
19910 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19911
19912 "use strict";
19913 __webpack_require__.r(__webpack_exports__);
19914 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19915 /* harmony export */ "codes": () => (/* binding */ codes)
19916 /* harmony export */ });
19917 /**
19918 * Character codes.
19919 *
19920 * This module is compiled away!
19921 *
19922 * micromark works based on character codes.
19923 * This module contains constants for the ASCII block and the replacement
19924 * character.
19925 * A couple of them are handled in a special way, such as the line endings
19926 * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
19927 * tab) and its expansion based on what column it’s at (virtual space),
19928 * and the end-of-file (eof) character.
19929 * As values are preprocessed before handling them, the actual characters LF,
19930 * CR, HT, and NUL (which is present as the replacement character), are
19931 * guaranteed to not exist.
19932 *
19933 * Unicode basic latin block.
19934 */
19935 const codes = {
19936 carriageReturn: -5,
19937 lineFeed: -4,
19938 carriageReturnLineFeed: -3,
19939 horizontalTab: -2,
19940 virtualSpace: -1,
19941 eof: null,
19942 nul: 0,
19943 soh: 1,
19944 stx: 2,
19945 etx: 3,
19946 eot: 4,
19947 enq: 5,
19948 ack: 6,
19949 bel: 7,
19950 bs: 8,
19951 ht: 9, // `\t`
19952 lf: 10, // `\n`
19953 vt: 11, // `\v`
19954 ff: 12, // `\f`
19955 cr: 13, // `\r`
19956 so: 14,
19957 si: 15,
19958 dle: 16,
19959 dc1: 17,
19960 dc2: 18,
19961 dc3: 19,
19962 dc4: 20,
19963 nak: 21,
19964 syn: 22,
19965 etb: 23,
19966 can: 24,
19967 em: 25,
19968 sub: 26,
19969 esc: 27,
19970 fs: 28,
19971 gs: 29,
19972 rs: 30,
19973 us: 31,
19974 space: 32,
19975 exclamationMark: 33, // `!`
19976 quotationMark: 34, // `"`
19977 numberSign: 35, // `#`
19978 dollarSign: 36, // `$`
19979 percentSign: 37, // `%`
19980 ampersand: 38, // `&`
19981 apostrophe: 39, // `'`
19982 leftParenthesis: 40, // `(`
19983 rightParenthesis: 41, // `)`
19984 asterisk: 42, // `*`
19985 plusSign: 43, // `+`
19986 comma: 44, // `,`
19987 dash: 45, // `-`
19988 dot: 46, // `.`
19989 slash: 47, // `/`
19990 digit0: 48, // `0`
19991 digit1: 49, // `1`
19992 digit2: 50, // `2`
19993 digit3: 51, // `3`
19994 digit4: 52, // `4`
19995 digit5: 53, // `5`
19996 digit6: 54, // `6`
19997 digit7: 55, // `7`
19998 digit8: 56, // `8`
19999 digit9: 57, // `9`
20000 colon: 58, // `:`
20001 semicolon: 59, // `;`
20002 lessThan: 60, // `<`
20003 equalsTo: 61, // `=`
20004 greaterThan: 62, // `>`
20005 questionMark: 63, // `?`
20006 atSign: 64, // `@`
20007 uppercaseA: 65, // `A`
20008 uppercaseB: 66, // `B`
20009 uppercaseC: 67, // `C`
20010 uppercaseD: 68, // `D`
20011 uppercaseE: 69, // `E`
20012 uppercaseF: 70, // `F`
20013 uppercaseG: 71, // `G`
20014 uppercaseH: 72, // `H`
20015 uppercaseI: 73, // `I`
20016 uppercaseJ: 74, // `J`
20017 uppercaseK: 75, // `K`
20018 uppercaseL: 76, // `L`
20019 uppercaseM: 77, // `M`
20020 uppercaseN: 78, // `N`
20021 uppercaseO: 79, // `O`
20022 uppercaseP: 80, // `P`
20023 uppercaseQ: 81, // `Q`
20024 uppercaseR: 82, // `R`
20025 uppercaseS: 83, // `S`
20026 uppercaseT: 84, // `T`
20027 uppercaseU: 85, // `U`
20028 uppercaseV: 86, // `V`
20029 uppercaseW: 87, // `W`
20030 uppercaseX: 88, // `X`
20031 uppercaseY: 89, // `Y`
20032 uppercaseZ: 90, // `Z`
20033 leftSquareBracket: 91, // `[`
20034 backslash: 92, // `\`
20035 rightSquareBracket: 93, // `]`
20036 caret: 94, // `^`
20037 underscore: 95, // `_`
20038 graveAccent: 96, // `` ` ``
20039 lowercaseA: 97, // `a`
20040 lowercaseB: 98, // `b`
20041 lowercaseC: 99, // `c`
20042 lowercaseD: 100, // `d`
20043 lowercaseE: 101, // `e`
20044 lowercaseF: 102, // `f`
20045 lowercaseG: 103, // `g`
20046 lowercaseH: 104, // `h`
20047 lowercaseI: 105, // `i`
20048 lowercaseJ: 106, // `j`
20049 lowercaseK: 107, // `k`
20050 lowercaseL: 108, // `l`
20051 lowercaseM: 109, // `m`
20052 lowercaseN: 110, // `n`
20053 lowercaseO: 111, // `o`
20054 lowercaseP: 112, // `p`
20055 lowercaseQ: 113, // `q`
20056 lowercaseR: 114, // `r`
20057 lowercaseS: 115, // `s`
20058 lowercaseT: 116, // `t`
20059 lowercaseU: 117, // `u`
20060 lowercaseV: 118, // `v`
20061 lowercaseW: 119, // `w`
20062 lowercaseX: 120, // `x`
20063 lowercaseY: 121, // `y`
20064 lowercaseZ: 122, // `z`
20065 leftCurlyBrace: 123, // `{`
20066 verticalBar: 124, // `|`
20067 rightCurlyBrace: 125, // `}`
20068 tilde: 126, // `~`
20069 del: 127,
20070 // Unicode Specials block.
20071 byteOrderMarker: 65279,
20072 // Unicode Specials block.
20073 replacementCharacter: 65533 // ``
20074 }
20075
20076
20077 /***/ }),
20078
20079 /***/ "../node_modules/micromark-util-symbol/constants.js":
20080 /*!**********************************************************!*\
20081 !*** ../node_modules/micromark-util-symbol/constants.js ***!
20082 \**********************************************************/
20083 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
20084
20085 "use strict";
20086 __webpack_require__.r(__webpack_exports__);
20087 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20088 /* harmony export */ "constants": () => (/* binding */ constants)
20089 /* harmony export */ });
20090 /**
20091 * This module is compiled away!
20092 *
20093 * Parsing markdown comes with a couple of constants, such as minimum or maximum
20094 * sizes of certain sequences.
20095 * Additionally, there are a couple symbols used inside micromark.
20096 * These are all defined here, but compiled away by scripts.
20097 */
20098 const constants = {
20099 attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a`
20100 attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*`
20101 atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t.
20102 autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many.
20103 autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many.
20104 cdataOpeningString: 'CDATA[', // And preceded by `<![`.
20105 characterGroupWhitespace: 1, // Symbol used to indicate a character is whitespace
20106 characterGroupPunctuation: 2, // Symbol used to indicate a character is punctuation
20107 characterReferenceDecimalSizeMax: 7, // `&#9999999;`.
20108 characterReferenceHexadecimalSizeMax: 6, // `&#xff9999;`.
20109 characterReferenceNamedSizeMax: 31, // `&CounterClockwiseContourIntegral;`.
20110 codeFencedSequenceSizeMin: 3, // At least 3 ticks or tildes are needed.
20111 contentTypeDocument: 'document',
20112 contentTypeFlow: 'flow',
20113 contentTypeContent: 'content',
20114 contentTypeString: 'string',
20115 contentTypeText: 'text',
20116 hardBreakPrefixSizeMin: 2, // At least 2 trailing spaces are needed.
20117 htmlRaw: 1, // Symbol for `<script>`
20118 htmlComment: 2, // Symbol for `<!---->`
20119 htmlInstruction: 3, // Symbol for `<?php?>`
20120 htmlDeclaration: 4, // Symbol for `<!doctype>`
20121 htmlCdata: 5, // Symbol for `<![CDATA[]]>`
20122 htmlBasic: 6, // Symbol for `<div`
20123 htmlComplete: 7, // Symbol for `<x>`
20124 htmlRawSizeMax: 8, // Length of `textarea`.
20125 linkResourceDestinationBalanceMax: 32, // See: <https://spec.commonmark.org/0.30/#link-destination>, <https://github.com/remarkjs/react-markdown/issues/658#issuecomment-984345577>
20126 linkReferenceSizeMax: 999, // See: <https://spec.commonmark.org/0.30/#link-label>
20127 listItemValueSizeMax: 10, // See: <https://spec.commonmark.org/0.30/#ordered-list-marker>
20128 numericBaseDecimal: 10,
20129 numericBaseHexadecimal: 0x10,
20130 tabSize: 4, // Tabs have a hard-coded size of 4, per CommonMark.
20131 thematicBreakMarkerCountMin: 3, // At least 3 asterisks, dashes, or underscores are needed.
20132 v8MaxSafeChunkSize: 10000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks.
20133 }
20134
20135
20136 /***/ }),
20137
20138 /***/ "../node_modules/micromark-util-symbol/types.js":
20139 /*!******************************************************!*\
20140 !*** ../node_modules/micromark-util-symbol/types.js ***!
20141 \******************************************************/
20142 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
20143
20144 "use strict";
20145 __webpack_require__.r(__webpack_exports__);
20146 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20147 /* harmony export */ "types": () => (/* binding */ types)
20148 /* harmony export */ });
20149 /**
20150 * This module is compiled away!
20151 *
20152 * Here is the list of all types of tokens exposed by micromark, with a short
20153 * explanation of what they include and where they are found.
20154 * In picking names, generally, the rule is to be as explicit as possible
20155 * instead of reusing names.
20156 * For example, there is a `definitionDestination` and a `resourceDestination`,
20157 * instead of one shared name.
20158 */
20159
20160 const types = {
20161 // Generic type for data, such as in a title, a destination, etc.
20162 data: 'data',
20163
20164 // Generic type for syntactic whitespace (tabs, virtual spaces, spaces).
20165 // Such as, between a fenced code fence and an info string.
20166 whitespace: 'whitespace',
20167
20168 // Generic type for line endings (line feed, carriage return, carriage return +
20169 // line feed).
20170 lineEnding: 'lineEnding',
20171
20172 // A line ending, but ending a blank line.
20173 lineEndingBlank: 'lineEndingBlank',
20174
20175 // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a
20176 // line.
20177 linePrefix: 'linePrefix',
20178
20179 // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a
20180 // line.
20181 lineSuffix: 'lineSuffix',
20182
20183 // Whole ATX heading:
20184 //
20185 // ```markdown
20186 // #
20187 // ## Alpha
20188 // ### Bravo ###
20189 // ```
20190 //
20191 // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`.
20192 atxHeading: 'atxHeading',
20193
20194 // Sequence of number signs in an ATX heading (`###`).
20195 atxHeadingSequence: 'atxHeadingSequence',
20196
20197 // Content in an ATX heading (`alpha`).
20198 // Includes text.
20199 atxHeadingText: 'atxHeadingText',
20200
20201 // Whole autolink (`<https://example.com>` or `<admin@example.com>`)
20202 // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`.
20203 autolink: 'autolink',
20204
20205 // Email autolink w/o markers (`admin@example.com`)
20206 autolinkEmail: 'autolinkEmail',
20207
20208 // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`).
20209 autolinkMarker: 'autolinkMarker',
20210
20211 // Protocol autolink w/o markers (`https://example.com`)
20212 autolinkProtocol: 'autolinkProtocol',
20213
20214 // A whole character escape (`\-`).
20215 // Includes `escapeMarker` and `characterEscapeValue`.
20216 characterEscape: 'characterEscape',
20217
20218 // The escaped character (`-`).
20219 characterEscapeValue: 'characterEscapeValue',
20220
20221 // A whole character reference (`&amp;`, `&#8800;`, or `&#x1D306;`).
20222 // Includes `characterReferenceMarker`, an optional
20223 // `characterReferenceMarkerNumeric`, in which case an optional
20224 // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`.
20225 characterReference: 'characterReference',
20226
20227 // The start or end marker (`&` or `;`).
20228 characterReferenceMarker: 'characterReferenceMarker',
20229
20230 // Mark reference as numeric (`#`).
20231 characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric',
20232
20233 // Mark reference as numeric (`x` or `X`).
20234 characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal',
20235
20236 // Value of character reference w/o markers (`amp`, `8800`, or `1D306`).
20237 characterReferenceValue: 'characterReferenceValue',
20238
20239 // Whole fenced code:
20240 //
20241 // ````markdown
20242 // ```js
20243 // alert(1)
20244 // ```
20245 // ````
20246 codeFenced: 'codeFenced',
20247
20248 // A fenced code fence, including whitespace, sequence, info, and meta
20249 // (` ```js `).
20250 codeFencedFence: 'codeFencedFence',
20251
20252 // Sequence of grave accent or tilde characters (` ``` `) in a fence.
20253 codeFencedFenceSequence: 'codeFencedFenceSequence',
20254
20255 // Info word (`js`) in a fence.
20256 // Includes string.
20257 codeFencedFenceInfo: 'codeFencedFenceInfo',
20258
20259 // Meta words (`highlight="1"`) in a fence.
20260 // Includes string.
20261 codeFencedFenceMeta: 'codeFencedFenceMeta',
20262
20263 // A line of code.
20264 codeFlowValue: 'codeFlowValue',
20265
20266 // Whole indented code:
20267 //
20268 // ```markdown
20269 // alert(1)
20270 // ```
20271 //
20272 // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`.
20273 codeIndented: 'codeIndented',
20274
20275 // A text code (``` `alpha` ```).
20276 // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include
20277 // `codeTextPadding`.
20278 codeText: 'codeText',
20279
20280 codeTextData: 'codeTextData',
20281
20282 // A space or line ending right after or before a tick.
20283 codeTextPadding: 'codeTextPadding',
20284
20285 // A text code fence (` `` `).
20286 codeTextSequence: 'codeTextSequence',
20287
20288 // Whole content:
20289 //
20290 // ```markdown
20291 // [a]: b
20292 // c
20293 // =
20294 // d
20295 // ```
20296 //
20297 // Includes `paragraph` and `definition`.
20298 content: 'content',
20299 // Whole definition:
20300 //
20301 // ```markdown
20302 // [micromark]: https://github.com/micromark/micromark
20303 // ```
20304 //
20305 // Includes `definitionLabel`, `definitionMarker`, `whitespace`,
20306 // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`.
20307 definition: 'definition',
20308
20309 // Destination of a definition (`https://github.com/micromark/micromark` or
20310 // `<https://github.com/micromark/micromark>`).
20311 // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`.
20312 definitionDestination: 'definitionDestination',
20313
20314 // Enclosed destination of a definition
20315 // (`<https://github.com/micromark/micromark>`).
20316 // Includes `definitionDestinationLiteralMarker` and optionally
20317 // `definitionDestinationString`.
20318 definitionDestinationLiteral: 'definitionDestinationLiteral',
20319
20320 // Markers of an enclosed definition destination (`<` or `>`).
20321 definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker',
20322
20323 // Unenclosed destination of a definition
20324 // (`https://github.com/micromark/micromark`).
20325 // Includes `definitionDestinationString`.
20326 definitionDestinationRaw: 'definitionDestinationRaw',
20327
20328 // Text in an destination (`https://github.com/micromark/micromark`).
20329 // Includes string.
20330 definitionDestinationString: 'definitionDestinationString',
20331
20332 // Label of a definition (`[micromark]`).
20333 // Includes `definitionLabelMarker` and `definitionLabelString`.
20334 definitionLabel: 'definitionLabel',
20335
20336 // Markers of a definition label (`[` or `]`).
20337 definitionLabelMarker: 'definitionLabelMarker',
20338
20339 // Value of a definition label (`micromark`).
20340 // Includes string.
20341 definitionLabelString: 'definitionLabelString',
20342
20343 // Marker between a label and a destination (`:`).
20344 definitionMarker: 'definitionMarker',
20345
20346 // Title of a definition (`"x"`, `'y'`, or `(z)`).
20347 // Includes `definitionTitleMarker` and optionally `definitionTitleString`.
20348 definitionTitle: 'definitionTitle',
20349
20350 // Marker around a title of a definition (`"`, `'`, `(`, or `)`).
20351 definitionTitleMarker: 'definitionTitleMarker',
20352
20353 // Data without markers in a title (`z`).
20354 // Includes string.
20355 definitionTitleString: 'definitionTitleString',
20356
20357 // Emphasis (`*alpha*`).
20358 // Includes `emphasisSequence` and `emphasisText`.
20359 emphasis: 'emphasis',
20360
20361 // Sequence of emphasis markers (`*` or `_`).
20362 emphasisSequence: 'emphasisSequence',
20363
20364 // Emphasis text (`alpha`).
20365 // Includes text.
20366 emphasisText: 'emphasisText',
20367
20368 // The character escape marker (`\`).
20369 escapeMarker: 'escapeMarker',
20370
20371 // A hard break created with a backslash (`\\n`).
20372 // Includes `escapeMarker` (does not include the line ending)
20373 hardBreakEscape: 'hardBreakEscape',
20374
20375 // A hard break created with trailing spaces (` \n`).
20376 // Does not include the line ending.
20377 hardBreakTrailing: 'hardBreakTrailing',
20378
20379 // Flow HTML:
20380 //
20381 // ```markdown
20382 // <div
20383 // ```
20384 //
20385 // Inlcudes `lineEnding`, `htmlFlowData`.
20386 htmlFlow: 'htmlFlow',
20387
20388 htmlFlowData: 'htmlFlowData',
20389
20390 // HTML in text (the tag in `a <i> b`).
20391 // Includes `lineEnding`, `htmlTextData`.
20392 htmlText: 'htmlText',
20393
20394 htmlTextData: 'htmlTextData',
20395
20396 // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or
20397 // `![alpha]`).
20398 // Includes `label` and an optional `resource` or `reference`.
20399 image: 'image',
20400
20401 // Whole link label (`[*alpha*]`).
20402 // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`.
20403 label: 'label',
20404
20405 // Text in an label (`*alpha*`).
20406 // Includes text.
20407 labelText: 'labelText',
20408
20409 // Start a link label (`[`).
20410 // Includes a `labelMarker`.
20411 labelLink: 'labelLink',
20412
20413 // Start an image label (`![`).
20414 // Includes `labelImageMarker` and `labelMarker`.
20415 labelImage: 'labelImage',
20416
20417 // Marker of a label (`[` or `]`).
20418 labelMarker: 'labelMarker',
20419
20420 // Marker to start an image (`!`).
20421 labelImageMarker: 'labelImageMarker',
20422
20423 // End a label (`]`).
20424 // Includes `labelMarker`.
20425 labelEnd: 'labelEnd',
20426
20427 // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`).
20428 // Includes `label` and an optional `resource` or `reference`.
20429 link: 'link',
20430
20431 // Whole paragraph:
20432 //
20433 // ```markdown
20434 // alpha
20435 // bravo.
20436 // ```
20437 //
20438 // Includes text.
20439 paragraph: 'paragraph',
20440
20441 // A reference (`[alpha]` or `[]`).
20442 // Includes `referenceMarker` and an optional `referenceString`.
20443 reference: 'reference',
20444
20445 // A reference marker (`[` or `]`).
20446 referenceMarker: 'referenceMarker',
20447
20448 // Reference text (`alpha`).
20449 // Includes string.
20450 referenceString: 'referenceString',
20451
20452 // A resource (`(https://example.com "alpha")`).
20453 // Includes `resourceMarker`, an optional `resourceDestination` with an optional
20454 // `whitespace` and `resourceTitle`.
20455 resource: 'resource',
20456
20457 // A resource destination (`https://example.com`).
20458 // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`.
20459 resourceDestination: 'resourceDestination',
20460
20461 // A literal resource destination (`<https://example.com>`).
20462 // Includes `resourceDestinationLiteralMarker` and optionally
20463 // `resourceDestinationString`.
20464 resourceDestinationLiteral: 'resourceDestinationLiteral',
20465
20466 // A resource destination marker (`<` or `>`).
20467 resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker',
20468
20469 // A raw resource destination (`https://example.com`).
20470 // Includes `resourceDestinationString`.
20471 resourceDestinationRaw: 'resourceDestinationRaw',
20472
20473 // Resource destination text (`https://example.com`).
20474 // Includes string.
20475 resourceDestinationString: 'resourceDestinationString',
20476
20477 // A resource marker (`(` or `)`).
20478 resourceMarker: 'resourceMarker',
20479
20480 // A resource title (`"alpha"`, `'alpha'`, or `(alpha)`).
20481 // Includes `resourceTitleMarker` and optionally `resourceTitleString`.
20482 resourceTitle: 'resourceTitle',
20483
20484 // A resource title marker (`"`, `'`, `(`, or `)`).
20485 resourceTitleMarker: 'resourceTitleMarker',
20486
20487 // Resource destination title (`alpha`).
20488 // Includes string.
20489 resourceTitleString: 'resourceTitleString',
20490
20491 // Whole setext heading:
20492 //
20493 // ```markdown
20494 // alpha
20495 // bravo
20496 // =====
20497 // ```
20498 //
20499 // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and
20500 // `setextHeadingLine`.
20501 setextHeading: 'setextHeading',
20502
20503 // Content in a setext heading (`alpha\nbravo`).
20504 // Includes text.
20505 setextHeadingText: 'setextHeadingText',
20506
20507 // Underline in a setext heading, including whitespace suffix (`==`).
20508 // Includes `setextHeadingLineSequence`.
20509 setextHeadingLine: 'setextHeadingLine',
20510
20511 // Sequence of equals or dash characters in underline in a setext heading (`-`).
20512 setextHeadingLineSequence: 'setextHeadingLineSequence',
20513
20514 // Strong (`**alpha**`).
20515 // Includes `strongSequence` and `strongText`.
20516 strong: 'strong',
20517
20518 // Sequence of strong markers (`**` or `__`).
20519 strongSequence: 'strongSequence',
20520
20521 // Strong text (`alpha`).
20522 // Includes text.
20523 strongText: 'strongText',
20524
20525 // Whole thematic break:
20526 //
20527 // ```markdown
20528 // * * *
20529 // ```
20530 //
20531 // Includes `thematicBreakSequence` and `whitespace`.
20532 thematicBreak: 'thematicBreak',
20533
20534 // A sequence of one or more thematic break markers (`***`).
20535 thematicBreakSequence: 'thematicBreakSequence',
20536
20537 // Whole block quote:
20538 //
20539 // ```markdown
20540 // > a
20541 // >
20542 // > b
20543 // ```
20544 //
20545 // Includes `blockQuotePrefix` and flow.
20546 blockQuote: 'blockQuote',
20547 // The `>` or `> ` of a block quote.
20548 blockQuotePrefix: 'blockQuotePrefix',
20549 // The `>` of a block quote prefix.
20550 blockQuoteMarker: 'blockQuoteMarker',
20551 // The optional ` ` of a block quote prefix.
20552 blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace',
20553
20554 // Whole unordered list:
20555 //
20556 // ```markdown
20557 // - a
20558 // b
20559 // ```
20560 //
20561 // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further
20562 // lines.
20563 listOrdered: 'listOrdered',
20564
20565 // Whole ordered list:
20566 //
20567 // ```markdown
20568 // 1. a
20569 // b
20570 // ```
20571 //
20572 // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further
20573 // lines.
20574 listUnordered: 'listUnordered',
20575
20576 // The indent of further list item lines.
20577 listItemIndent: 'listItemIndent',
20578
20579 // A marker, as in, `*`, `+`, `-`, `.`, or `)`.
20580 listItemMarker: 'listItemMarker',
20581
20582 // The thing that starts a list item, such as `1. `.
20583 // Includes `listItemValue` if ordered, `listItemMarker`, and
20584 // `listItemPrefixWhitespace` (unless followed by a line ending).
20585 listItemPrefix: 'listItemPrefix',
20586
20587 // The whitespace after a marker.
20588 listItemPrefixWhitespace: 'listItemPrefixWhitespace',
20589
20590 // The numerical value of an ordered item.
20591 listItemValue: 'listItemValue',
20592
20593 // Internal types used for subtokenizers, compiled away
20594 chunkDocument: 'chunkDocument',
20595 chunkContent: 'chunkContent',
20596 chunkFlow: 'chunkFlow',
20597 chunkText: 'chunkText',
20598 chunkString: 'chunkString'
20599 }
20600
20601
20602 /***/ }),
20603
20604 /***/ "../node_modules/micromark-util-symbol/values.js":
20605 /*!*******************************************************!*\
20606 !*** ../node_modules/micromark-util-symbol/values.js ***!
20607 \*******************************************************/
20608 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
20609
20610 "use strict";
20611 __webpack_require__.r(__webpack_exports__);
20612 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20613 /* harmony export */ "values": () => (/* binding */ values)
20614 /* harmony export */ });
20615 // This module is compiled away!
20616 //
20617 // While micromark works based on character codes, this module includes the
20618 // string versions of ’em.
20619 // The C0 block, except for LF, CR, HT, and w/ the replacement character added,
20620 // are available here.
20621 const values = {
20622 ht: '\t',
20623 lf: '\n',
20624 cr: '\r',
20625 space: ' ',
20626 exclamationMark: '!',
20627 quotationMark: '"',
20628 numberSign: '#',
20629 dollarSign: '$',
20630 percentSign: '%',
20631 ampersand: '&',
20632 apostrophe: "'",
20633 leftParenthesis: '(',
20634 rightParenthesis: ')',
20635 asterisk: '*',
20636 plusSign: '+',
20637 comma: ',',
20638 dash: '-',
20639 dot: '.',
20640 slash: '/',
20641 digit0: '0',
20642 digit1: '1',
20643 digit2: '2',
20644 digit3: '3',
20645 digit4: '4',
20646 digit5: '5',
20647 digit6: '6',
20648 digit7: '7',
20649 digit8: '8',
20650 digit9: '9',
20651 colon: ':',
20652 semicolon: ';',
20653 lessThan: '<',
20654 equalsTo: '=',
20655 greaterThan: '>',
20656 questionMark: '?',
20657 atSign: '@',
20658 uppercaseA: 'A',
20659 uppercaseB: 'B',
20660 uppercaseC: 'C',
20661 uppercaseD: 'D',
20662 uppercaseE: 'E',
20663 uppercaseF: 'F',
20664 uppercaseG: 'G',
20665 uppercaseH: 'H',
20666 uppercaseI: 'I',
20667 uppercaseJ: 'J',
20668 uppercaseK: 'K',
20669 uppercaseL: 'L',
20670 uppercaseM: 'M',
20671 uppercaseN: 'N',
20672 uppercaseO: 'O',
20673 uppercaseP: 'P',
20674 uppercaseQ: 'Q',
20675 uppercaseR: 'R',
20676 uppercaseS: 'S',
20677 uppercaseT: 'T',
20678 uppercaseU: 'U',
20679 uppercaseV: 'V',
20680 uppercaseW: 'W',
20681 uppercaseX: 'X',
20682 uppercaseY: 'Y',
20683 uppercaseZ: 'Z',
20684 leftSquareBracket: '[',
20685 backslash: '\\',
20686 rightSquareBracket: ']',
20687 caret: '^',
20688 underscore: '_',
20689 graveAccent: '`',
20690 lowercaseA: 'a',
20691 lowercaseB: 'b',
20692 lowercaseC: 'c',
20693 lowercaseD: 'd',
20694 lowercaseE: 'e',
20695 lowercaseF: 'f',
20696 lowercaseG: 'g',
20697 lowercaseH: 'h',
20698 lowercaseI: 'i',
20699 lowercaseJ: 'j',
20700 lowercaseK: 'k',
20701 lowercaseL: 'l',
20702 lowercaseM: 'm',
20703 lowercaseN: 'n',
20704 lowercaseO: 'o',
20705 lowercaseP: 'p',
20706 lowercaseQ: 'q',
20707 lowercaseR: 'r',
20708 lowercaseS: 's',
20709 lowercaseT: 't',
20710 lowercaseU: 'u',
20711 lowercaseV: 'v',
20712 lowercaseW: 'w',
20713 lowercaseX: 'x',
20714 lowercaseY: 'y',
20715 lowercaseZ: 'z',
20716 leftCurlyBrace: '{',
20717 verticalBar: '|',
20718 rightCurlyBrace: '}',
20719 tilde: '~',
20720 replacementCharacter: ''
20721 }
20722
20723
20724 /***/ }),
20725
20726 /***/ "../node_modules/micromark/dev/lib/constructs.js":
20727 /*!*******************************************************!*\
20728 !*** ../node_modules/micromark/dev/lib/constructs.js ***!
20729 \*******************************************************/
20730 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
20731
20732 "use strict";
20733 __webpack_require__.r(__webpack_exports__);
20734 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20735 /* harmony export */ "attentionMarkers": () => (/* binding */ attentionMarkers),
20736 /* harmony export */ "contentInitial": () => (/* binding */ contentInitial),
20737 /* harmony export */ "disable": () => (/* binding */ disable),
20738 /* harmony export */ "document": () => (/* binding */ document),
20739 /* harmony export */ "flow": () => (/* binding */ flow),
20740 /* harmony export */ "flowInitial": () => (/* binding */ flowInitial),
20741 /* harmony export */ "insideSpan": () => (/* binding */ insideSpan),
20742 /* harmony export */ "string": () => (/* binding */ string),
20743 /* harmony export */ "text": () => (/* binding */ text)
20744 /* harmony export */ });
20745 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/list.js");
20746 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/block-quote.js");
20747 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/definition.js");
20748 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/code-indented.js");
20749 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/heading-atx.js");
20750 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js");
20751 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/setext-underline.js");
20752 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/html-flow.js");
20753 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/code-fenced.js");
20754 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/character-reference.js");
20755 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/character-escape.js");
20756 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/line-ending.js");
20757 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/label-start-image.js");
20758 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/attention.js");
20759 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/autolink.js");
20760 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/html-text.js");
20761 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/label-start-link.js");
20762 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js");
20763 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js");
20764 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/code-text.js");
20765 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
20766 /* harmony import */ var _initialize_text_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./initialize/text.js */ "../node_modules/micromark/dev/lib/initialize/text.js");
20767 /**
20768 * @typedef {import('micromark-util-types').Extension} Extension
20769 */
20770
20771
20772
20773
20774
20775 /** @type {Extension['document']} */
20776 const document = {
20777 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20778 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.plusSign]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20779 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.dash]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20780 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit0]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20781 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit1]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20782 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit2]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20783 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit3]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20784 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit4]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20785 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit5]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20786 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit6]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20787 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit7]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20788 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit8]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20789 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit9]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list,
20790 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_2__.blockQuote
20791 }
20792
20793 /** @type {Extension['contentInitial']} */
20794 const contentInitial = {
20795 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftSquareBracket]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__.definition
20796 }
20797
20798 /** @type {Extension['flowInitial']} */
20799 const flowInitial = {
20800 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__.codeIndented,
20801 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__.codeIndented,
20802 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__.codeIndented
20803 }
20804
20805 /** @type {Extension['flow']} */
20806 const flow = {
20807 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.numberSign]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_5__.headingAtx,
20808 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__.thematicBreak,
20809 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.dash]: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_7__.setextUnderline, micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__.thematicBreak],
20810 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_8__.htmlFlow,
20811 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.equalsTo]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_7__.setextUnderline,
20812 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.underscore]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__.thematicBreak,
20813 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.graveAccent]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_9__.codeFenced,
20814 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.tilde]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_9__.codeFenced
20815 }
20816
20817 /** @type {Extension['string']} */
20818 const string = {
20819 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ampersand]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_10__.characterReference,
20820 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_11__.characterEscape
20821 }
20822
20823 /** @type {Extension['text']} */
20824 const text = {
20825 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturn]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__.lineEnding,
20826 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lineFeed]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__.lineEnding,
20827 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturnLineFeed]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__.lineEnding,
20828 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.exclamationMark]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_13__.labelStartImage,
20829 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ampersand]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_10__.characterReference,
20830 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__.attention,
20831 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan]: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_15__.autolink, micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_16__.htmlText],
20832 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftSquareBracket]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_17__.labelStartLink,
20833 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash]: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_18__.hardBreakEscape, micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_11__.characterEscape],
20834 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightSquareBracket]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_19__.labelEnd,
20835 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.underscore]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__.attention,
20836 [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.graveAccent]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_20__.codeText
20837 }
20838
20839 /** @type {Extension['insideSpan']} */
20840 const insideSpan = {null: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__.attention, _initialize_text_js__WEBPACK_IMPORTED_MODULE_21__.resolver]}
20841
20842 /** @type {Extension['attentionMarkers']} */
20843 const attentionMarkers = {null: [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk, micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.underscore]}
20844
20845 /** @type {Extension['disable']} */
20846 const disable = {null: []}
20847
20848
20849 /***/ }),
20850
20851 /***/ "../node_modules/micromark/dev/lib/create-tokenizer.js":
20852 /*!*************************************************************!*\
20853 !*** ../node_modules/micromark/dev/lib/create-tokenizer.js ***!
20854 \*************************************************************/
20855 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
20856
20857 "use strict";
20858 __webpack_require__.r(__webpack_exports__);
20859 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20860 /* harmony export */ "createTokenizer": () => (/* binding */ createTokenizer)
20861 /* harmony export */ });
20862 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
20863 /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ "../node_modules/debug/src/browser.js");
20864 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
20865 /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js");
20866 /* harmony import */ var micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-resolve-all */ "../node_modules/micromark-util-resolve-all/index.js");
20867 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
20868 /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js");
20869 /**
20870 * @typedef {import('micromark-util-types').Code} Code
20871 * @typedef {import('micromark-util-types').Chunk} Chunk
20872 * @typedef {import('micromark-util-types').Point} Point
20873 * @typedef {import('micromark-util-types').Token} Token
20874 * @typedef {import('micromark-util-types').Effects} Effects
20875 * @typedef {import('micromark-util-types').State} State
20876 * @typedef {import('micromark-util-types').Construct} Construct
20877 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
20878 * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord
20879 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
20880 * @typedef {import('micromark-util-types').ParseContext} ParseContext
20881 */
20882
20883 /**
20884 * @typedef Info
20885 * @property {() => void} restore
20886 * @property {number} from
20887 *
20888 * @callback ReturnHandle
20889 * Handle a successful run.
20890 * @param {Construct} construct
20891 * @param {Info} info
20892 * @returns {void}
20893 */
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903 const debug = debug__WEBPACK_IMPORTED_MODULE_1__('micromark')
20904
20905 /**
20906 * Create a tokenizer.
20907 * Tokenizers deal with one type of data (e.g., containers, flow, text).
20908 * The parser is the object dealing with it all.
20909 * `initialize` works like other constructs, except that only its `tokenize`
20910 * function is used, in which case it doesn’t receive an `ok` or `nok`.
20911 * `from` can be given to set the point before the first character, although
20912 * when further lines are indented, they must be set with `defineSkip`.
20913 *
20914 * @param {ParseContext} parser
20915 * @param {InitialConstruct} initialize
20916 * @param {Omit<Point, '_index'|'_bufferIndex'>} [from]
20917 * @returns {TokenizeContext}
20918 */
20919 function createTokenizer(parser, initialize, from) {
20920 /** @type {Point} */
20921 let point = Object.assign(
20922 from ? Object.assign({}, from) : {line: 1, column: 1, offset: 0},
20923 {_index: 0, _bufferIndex: -1}
20924 )
20925 /** @type {Record<string, number>} */
20926 const columnStart = {}
20927 /** @type {Array<Construct>} */
20928 const resolveAllConstructs = []
20929 /** @type {Array<Chunk>} */
20930 let chunks = []
20931 /** @type {Array<Token>} */
20932 let stack = []
20933 /** @type {boolean|undefined} */
20934 let consumed = true
20935
20936 /**
20937 * Tools used for tokenizing.
20938 *
20939 * @type {Effects}
20940 */
20941 const effects = {
20942 consume,
20943 enter,
20944 exit,
20945 attempt: constructFactory(onsuccessfulconstruct),
20946 check: constructFactory(onsuccessfulcheck),
20947 interrupt: constructFactory(onsuccessfulcheck, {interrupt: true})
20948 }
20949
20950 /**
20951 * State and tools for resolving and serializing.
20952 *
20953 * @type {TokenizeContext}
20954 */
20955 const context = {
20956 previous: micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof,
20957 code: micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof,
20958 containerState: {},
20959 events: [],
20960 parser,
20961 sliceStream,
20962 sliceSerialize,
20963 now,
20964 defineSkip,
20965 write
20966 }
20967
20968 /**
20969 * The state function.
20970 *
20971 * @type {State|void}
20972 */
20973 let state = initialize.tokenize.call(context, effects)
20974
20975 /**
20976 * Track which character we expect to be consumed, to catch bugs.
20977 *
20978 * @type {Code}
20979 */
20980 let expectedCode
20981
20982 if (initialize.resolveAll) {
20983 resolveAllConstructs.push(initialize)
20984 }
20985
20986 return context
20987
20988 /** @type {TokenizeContext['write']} */
20989 function write(slice) {
20990 chunks = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__.push)(chunks, slice)
20991
20992 main()
20993
20994 // Exit if we’re not done, resolve might change stuff.
20995 if (chunks[chunks.length - 1] !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) {
20996 return []
20997 }
20998
20999 addResult(initialize, 0)
21000
21001 // Otherwise, resolve, and exit.
21002 context.events = (0,micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_4__.resolveAll)(resolveAllConstructs, context.events, context)
21003
21004 return context.events
21005 }
21006
21007 //
21008 // Tools.
21009 //
21010
21011 /** @type {TokenizeContext['sliceSerialize']} */
21012 function sliceSerialize(token, expandTabs) {
21013 return serializeChunks(sliceStream(token), expandTabs)
21014 }
21015
21016 /** @type {TokenizeContext['sliceStream']} */
21017 function sliceStream(token) {
21018 return sliceChunks(chunks, token)
21019 }
21020
21021 /** @type {TokenizeContext['now']} */
21022 function now() {
21023 return Object.assign({}, point)
21024 }
21025
21026 /** @type {TokenizeContext['defineSkip']} */
21027 function defineSkip(value) {
21028 columnStart[value.line] = value.column
21029 accountForPotentialSkip()
21030 debug('position: define skip: `%j`', point)
21031 }
21032
21033 //
21034 // State management.
21035 //
21036
21037 /**
21038 * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by
21039 * `consume`).
21040 * Here is where we walk through the chunks, which either include strings of
21041 * several characters, or numerical character codes.
21042 * The reason to do this in a loop instead of a call is so the stack can
21043 * drain.
21044 *
21045 * @returns {void}
21046 */
21047 function main() {
21048 /** @type {number} */
21049 let chunkIndex
21050
21051 while (point._index < chunks.length) {
21052 const chunk = chunks[point._index]
21053
21054 // If we’re in a buffer chunk, loop through it.
21055 if (typeof chunk === 'string') {
21056 chunkIndex = point._index
21057
21058 if (point._bufferIndex < 0) {
21059 point._bufferIndex = 0
21060 }
21061
21062 while (
21063 point._index === chunkIndex &&
21064 point._bufferIndex < chunk.length
21065 ) {
21066 go(chunk.charCodeAt(point._bufferIndex))
21067 }
21068 } else {
21069 go(chunk)
21070 }
21071 }
21072 }
21073
21074 /**
21075 * Deal with one code.
21076 *
21077 * @param {Code} code
21078 * @returns {void}
21079 */
21080 function go(code) {
21081 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(consumed === true, 'expected character to be consumed')
21082 consumed = undefined
21083 debug('main: passing `%s` to %s', code, state && state.name)
21084 expectedCode = code
21085 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof state === 'function', 'expected state')
21086 state = state(code)
21087 }
21088
21089 /** @type {Effects['consume']} */
21090 function consume(code) {
21091 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === expectedCode, 'expected given code to equal expected code')
21092
21093 debug('consume: `%s`', code)
21094
21095 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21096 consumed === undefined,
21097 'expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used'
21098 )
21099 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21100 code === null
21101 ? context.events.length === 0 ||
21102 context.events[context.events.length - 1][0] === 'exit'
21103 : context.events[context.events.length - 1][0] === 'enter',
21104 'expected last token to be open'
21105 )
21106
21107 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
21108 point.line++
21109 point.column = 1
21110 point.offset += code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.carriageReturnLineFeed ? 2 : 1
21111 accountForPotentialSkip()
21112 debug('position: after eol: `%j`', point)
21113 } else if (code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.virtualSpace) {
21114 point.column++
21115 point.offset++
21116 }
21117
21118 // Not in a string chunk.
21119 if (point._bufferIndex < 0) {
21120 point._index++
21121 } else {
21122 point._bufferIndex++
21123
21124 // At end of string chunk.
21125 // @ts-expect-error Points w/ non-negative `_bufferIndex` reference
21126 // strings.
21127 if (point._bufferIndex === chunks[point._index].length) {
21128 point._bufferIndex = -1
21129 point._index++
21130 }
21131 }
21132
21133 // Expose the previous character.
21134 context.previous = code
21135
21136 // Mark as consumed.
21137 consumed = true
21138 }
21139
21140 /** @type {Effects['enter']} */
21141 function enter(type, fields) {
21142 /** @type {Token} */
21143 // @ts-expect-error Patch instead of assign required fields to help GC.
21144 const token = fields || {}
21145 token.type = type
21146 token.start = now()
21147
21148 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof type === 'string', 'expected string type')
21149 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(type.length > 0, 'expected non-empty string')
21150 debug('enter: `%s`', type)
21151
21152 context.events.push(['enter', token, context])
21153
21154 stack.push(token)
21155
21156 return token
21157 }
21158
21159 /** @type {Effects['exit']} */
21160 function exit(type) {
21161 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof type === 'string', 'expected string type')
21162 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(type.length > 0, 'expected non-empty string')
21163
21164 const token = stack.pop()
21165 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(token, 'cannot close w/o open tokens')
21166 token.end = now()
21167
21168 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(type === token.type, 'expected exit token to match current token')
21169
21170 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21171 !(
21172 token.start._index === token.end._index &&
21173 token.start._bufferIndex === token.end._bufferIndex
21174 ),
21175 'expected non-empty token (`' + type + '`)'
21176 )
21177
21178 debug('exit: `%s`', token.type)
21179 context.events.push(['exit', token, context])
21180
21181 return token
21182 }
21183
21184 /**
21185 * Use results.
21186 *
21187 * @type {ReturnHandle}
21188 */
21189 function onsuccessfulconstruct(construct, info) {
21190 addResult(construct, info.from)
21191 }
21192
21193 /**
21194 * Discard results.
21195 *
21196 * @type {ReturnHandle}
21197 */
21198 function onsuccessfulcheck(_, info) {
21199 info.restore()
21200 }
21201
21202 /**
21203 * Factory to attempt/check/interrupt.
21204 *
21205 * @param {ReturnHandle} onreturn
21206 * @param {Record<string, unknown>} [fields]
21207 */
21208 function constructFactory(onreturn, fields) {
21209 return hook
21210
21211 /**
21212 * Handle either an object mapping codes to constructs, a list of
21213 * constructs, or a single construct.
21214 *
21215 * @param {Construct|Array<Construct>|ConstructRecord} constructs
21216 * @param {State} returnState
21217 * @param {State} [bogusState]
21218 * @returns {State}
21219 */
21220 function hook(constructs, returnState, bogusState) {
21221 /** @type {Array<Construct>} */
21222 let listOfConstructs
21223 /** @type {number} */
21224 let constructIndex
21225 /** @type {Construct} */
21226 let currentConstruct
21227 /** @type {Info} */
21228 let info
21229
21230 return Array.isArray(constructs)
21231 ? /* c8 ignore next 1 */
21232 handleListOfConstructs(constructs)
21233 : 'tokenize' in constructs
21234 ? // @ts-expect-error Looks like a construct.
21235 handleListOfConstructs([constructs])
21236 : handleMapOfConstructs(constructs)
21237
21238 /**
21239 * Handle a list of construct.
21240 *
21241 * @param {ConstructRecord} map
21242 * @returns {State}
21243 */
21244 function handleMapOfConstructs(map) {
21245 return start
21246
21247 /** @type {State} */
21248 function start(code) {
21249 const def = code !== null && map[code]
21250 const all = code !== null && map.null
21251 const list = [
21252 // To do: add more extension tests.
21253 /* c8 ignore next 2 */
21254 ...(Array.isArray(def) ? def : def ? [def] : []),
21255 ...(Array.isArray(all) ? all : all ? [all] : [])
21256 ]
21257
21258 return handleListOfConstructs(list)(code)
21259 }
21260 }
21261
21262 /**
21263 * Handle a list of construct.
21264 *
21265 * @param {Array<Construct>} list
21266 * @returns {State}
21267 */
21268 function handleListOfConstructs(list) {
21269 listOfConstructs = list
21270 constructIndex = 0
21271
21272 if (list.length === 0) {
21273 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(bogusState, 'expected `bogusState` to be given')
21274 return bogusState
21275 }
21276
21277 return handleConstruct(list[constructIndex])
21278 }
21279
21280 /**
21281 * Handle a single construct.
21282 *
21283 * @param {Construct} construct
21284 * @returns {State}
21285 */
21286 function handleConstruct(construct) {
21287 return start
21288
21289 /** @type {State} */
21290 function start(code) {
21291 // To do: not needed to store if there is no bogus state, probably?
21292 // Currently doesn’t work because `inspect` in document does a check
21293 // w/o a bogus, which doesn’t make sense. But it does seem to help perf
21294 // by not storing.
21295 info = store()
21296 currentConstruct = construct
21297
21298 if (!construct.partial) {
21299 context.currentConstruct = construct
21300 }
21301
21302 if (
21303 construct.name &&
21304 context.parser.constructs.disable.null.includes(construct.name)
21305 ) {
21306 return nok(code)
21307 }
21308
21309 return construct.tokenize.call(
21310 // If we do have fields, create an object w/ `context` as its
21311 // prototype.
21312 // This allows a “live binding”, which is needed for `interrupt`.
21313 fields ? Object.assign(Object.create(context), fields) : context,
21314 effects,
21315 ok,
21316 nok
21317 )(code)
21318 }
21319 }
21320
21321 /** @type {State} */
21322 function ok(code) {
21323 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === expectedCode, 'expected code')
21324 consumed = true
21325 onreturn(currentConstruct, info)
21326 return returnState
21327 }
21328
21329 /** @type {State} */
21330 function nok(code) {
21331 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === expectedCode, 'expected code')
21332 consumed = true
21333 info.restore()
21334
21335 if (++constructIndex < listOfConstructs.length) {
21336 return handleConstruct(listOfConstructs[constructIndex])
21337 }
21338
21339 return bogusState
21340 }
21341 }
21342 }
21343
21344 /**
21345 * @param {Construct} construct
21346 * @param {number} from
21347 * @returns {void}
21348 */
21349 function addResult(construct, from) {
21350 if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {
21351 resolveAllConstructs.push(construct)
21352 }
21353
21354 if (construct.resolve) {
21355 (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__.splice)(
21356 context.events,
21357 from,
21358 context.events.length - from,
21359 construct.resolve(context.events.slice(from), context)
21360 )
21361 }
21362
21363 if (construct.resolveTo) {
21364 context.events = construct.resolveTo(context.events, context)
21365 }
21366
21367 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21368 construct.partial ||
21369 context.events.length === 0 ||
21370 context.events[context.events.length - 1][0] === 'exit',
21371 'expected last token to end'
21372 )
21373 }
21374
21375 /**
21376 * Store state.
21377 *
21378 * @returns {Info}
21379 */
21380 function store() {
21381 const startPoint = now()
21382 const startPrevious = context.previous
21383 const startCurrentConstruct = context.currentConstruct
21384 const startEventsIndex = context.events.length
21385 const startStack = Array.from(stack)
21386
21387 return {restore, from: startEventsIndex}
21388
21389 /**
21390 * Restore state.
21391 *
21392 * @returns {void}
21393 */
21394 function restore() {
21395 point = startPoint
21396 context.previous = startPrevious
21397 context.currentConstruct = startCurrentConstruct
21398 context.events.length = startEventsIndex
21399 stack = startStack
21400 accountForPotentialSkip()
21401 debug('position: restore: `%j`', point)
21402 }
21403 }
21404
21405 /**
21406 * Move the current point a bit forward in the line when it’s on a column
21407 * skip.
21408 *
21409 * @returns {void}
21410 */
21411 function accountForPotentialSkip() {
21412 if (point.line in columnStart && point.column < 2) {
21413 point.column = columnStart[point.line]
21414 point.offset += columnStart[point.line] - 1
21415 }
21416 }
21417 }
21418
21419 /**
21420 * Get the chunks from a slice of chunks in the range of a token.
21421 *
21422 * @param {Array<Chunk>} chunks
21423 * @param {Pick<Token, 'start'|'end'>} token
21424 * @returns {Array<Chunk>}
21425 */
21426 function sliceChunks(chunks, token) {
21427 const startIndex = token.start._index
21428 const startBufferIndex = token.start._bufferIndex
21429 const endIndex = token.end._index
21430 const endBufferIndex = token.end._bufferIndex
21431 /** @type {Array<Chunk>} */
21432 let view
21433
21434 if (startIndex === endIndex) {
21435 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(endBufferIndex > -1, 'expected non-negative end buffer index')
21436 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(startBufferIndex > -1, 'expected non-negative start buffer index')
21437 // @ts-expect-error `_bufferIndex` is used on string chunks.
21438 view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]
21439 } else {
21440 view = chunks.slice(startIndex, endIndex)
21441
21442 if (startBufferIndex > -1) {
21443 // @ts-expect-error `_bufferIndex` is used on string chunks.
21444 view[0] = view[0].slice(startBufferIndex)
21445 }
21446
21447 if (endBufferIndex > 0) {
21448 // @ts-expect-error `_bufferIndex` is used on string chunks.
21449 view.push(chunks[endIndex].slice(0, endBufferIndex))
21450 }
21451 }
21452
21453 return view
21454 }
21455
21456 /**
21457 * Get the string value of a slice of chunks.
21458 *
21459 * @param {Array<Chunk>} chunks
21460 * @param {boolean} [expandTabs=false]
21461 * @returns {string}
21462 */
21463 function serializeChunks(chunks, expandTabs) {
21464 let index = -1
21465 /** @type {Array<string>} */
21466 const result = []
21467 /** @type {boolean|undefined} */
21468 let atTab
21469
21470 while (++index < chunks.length) {
21471 const chunk = chunks[index]
21472 /** @type {string} */
21473 let value
21474
21475 if (typeof chunk === 'string') {
21476 value = chunk
21477 } else
21478 switch (chunk) {
21479 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.carriageReturn: {
21480 value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.cr
21481
21482 break
21483 }
21484
21485 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lineFeed: {
21486 value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.lf
21487
21488 break
21489 }
21490
21491 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.carriageReturnLineFeed: {
21492 value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.cr + micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.lf
21493
21494 break
21495 }
21496
21497 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.horizontalTab: {
21498 value = expandTabs ? micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.space : micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.ht
21499
21500 break
21501 }
21502
21503 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.virtualSpace: {
21504 if (!expandTabs && atTab) continue
21505 value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.space
21506
21507 break
21508 }
21509
21510 default: {
21511 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof chunk === 'number', 'expected number')
21512 // Currently only replacement character.
21513 value = String.fromCharCode(chunk)
21514 }
21515 }
21516
21517 atTab = chunk === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.horizontalTab
21518 result.push(value)
21519 }
21520
21521 return result.join('')
21522 }
21523
21524
21525 /***/ }),
21526
21527 /***/ "../node_modules/micromark/dev/lib/initialize/content.js":
21528 /*!***************************************************************!*\
21529 !*** ../node_modules/micromark/dev/lib/initialize/content.js ***!
21530 \***************************************************************/
21531 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
21532
21533 "use strict";
21534 __webpack_require__.r(__webpack_exports__);
21535 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21536 /* harmony export */ "content": () => (/* binding */ content)
21537 /* harmony export */ });
21538 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
21539 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
21540 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
21541 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
21542 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
21543 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
21544 /**
21545 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
21546 * @typedef {import('micromark-util-types').Initializer} Initializer
21547 * @typedef {import('micromark-util-types').Token} Token
21548 * @typedef {import('micromark-util-types').State} State
21549 */
21550
21551
21552
21553
21554
21555
21556
21557
21558 /** @type {InitialConstruct} */
21559 const content = {tokenize: initializeContent}
21560
21561 /** @type {Initializer} */
21562 function initializeContent(effects) {
21563 const contentStart = effects.attempt(
21564 this.parser.constructs.contentInitial,
21565 afterContentStartConstruct,
21566 paragraphInitial
21567 )
21568 /** @type {Token} */
21569 let previous
21570
21571 return contentStart
21572
21573 /** @type {State} */
21574 function afterContentStartConstruct(code) {
21575 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21576 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code),
21577 'expected eol or eof'
21578 )
21579
21580 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) {
21581 effects.consume(code)
21582 return
21583 }
21584
21585 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding)
21586 effects.consume(code)
21587 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding)
21588 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, contentStart, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.linePrefix)
21589 }
21590
21591 /** @type {State} */
21592 function paragraphInitial(code) {
21593 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21594 code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof && !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code),
21595 'expected anything other than a line ending or EOF'
21596 )
21597 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.paragraph)
21598 return lineStart(code)
21599 }
21600
21601 /** @type {State} */
21602 function lineStart(code) {
21603 const token = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkText, {
21604 contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeText,
21605 previous
21606 })
21607
21608 if (previous) {
21609 previous.next = token
21610 }
21611
21612 previous = token
21613
21614 return data(code)
21615 }
21616
21617 /** @type {State} */
21618 function data(code) {
21619 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) {
21620 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkText)
21621 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.paragraph)
21622 effects.consume(code)
21623 return
21624 }
21625
21626 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code)) {
21627 effects.consume(code)
21628 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkText)
21629 return lineStart
21630 }
21631
21632 // Data.
21633 effects.consume(code)
21634 return data
21635 }
21636 }
21637
21638
21639 /***/ }),
21640
21641 /***/ "../node_modules/micromark/dev/lib/initialize/document.js":
21642 /*!****************************************************************!*\
21643 !*** ../node_modules/micromark/dev/lib/initialize/document.js ***!
21644 \****************************************************************/
21645 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
21646
21647 "use strict";
21648 __webpack_require__.r(__webpack_exports__);
21649 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21650 /* harmony export */ "document": () => (/* binding */ document)
21651 /* harmony export */ });
21652 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
21653 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
21654 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
21655 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
21656 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
21657 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
21658 /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js");
21659 /**
21660 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
21661 * @typedef {import('micromark-util-types').Initializer} Initializer
21662 * @typedef {import('micromark-util-types').Construct} Construct
21663 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
21664 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
21665 * @typedef {import('micromark-util-types').Token} Token
21666 * @typedef {import('micromark-util-types').State} State
21667 * @typedef {import('micromark-util-types').Point} Point
21668 */
21669
21670 /**
21671 * @typedef {Record<string, unknown>} StackState
21672 * @typedef {[Construct, StackState]} StackItem
21673 */
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683 /** @type {InitialConstruct} */
21684 const document = {tokenize: initializeDocument}
21685
21686 /** @type {Construct} */
21687 const containerConstruct = {tokenize: tokenizeContainer}
21688
21689 /** @type {Initializer} */
21690 function initializeDocument(effects) {
21691 const self = this
21692 /** @type {Array<StackItem>} */
21693 const stack = []
21694 let continued = 0
21695 /** @type {TokenizeContext|undefined} */
21696 let childFlow
21697 /** @type {Token|undefined} */
21698 let childToken
21699 /** @type {number} */
21700 let lineStartOffset
21701
21702 return start
21703
21704 /** @type {State} */
21705 function start(code) {
21706 // First we iterate through the open blocks, starting with the root
21707 // document, and descending through last children down to the last open
21708 // block.
21709 // Each block imposes a condition that the line must satisfy if the block is
21710 // to remain open.
21711 // For example, a block quote requires a `>` character.
21712 // A paragraph requires a non-blank line.
21713 // In this phase we may match all or just some of the open blocks.
21714 // But we cannot close unmatched blocks yet, because we may have a lazy
21715 // continuation line.
21716 if (continued < stack.length) {
21717 const item = stack[continued]
21718 self.containerState = item[1]
21719 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21720 item[0].continuation,
21721 'expected `continuation` to be defined on container construct'
21722 )
21723 return effects.attempt(
21724 item[0].continuation,
21725 documentContinue,
21726 checkNewContainers
21727 )(code)
21728 }
21729
21730 // Done.
21731 return checkNewContainers(code)
21732 }
21733
21734 /** @type {State} */
21735 function documentContinue(code) {
21736 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21737 self.containerState,
21738 'expected `containerState` to be defined after continuation'
21739 )
21740
21741 continued++
21742
21743 // Note: this field is called `_closeFlow` but it also closes containers.
21744 // Perhaps a good idea to rename it but it’s already used in the wild by
21745 // extensions.
21746 if (self.containerState._closeFlow) {
21747 self.containerState._closeFlow = undefined
21748
21749 if (childFlow) {
21750 closeFlow()
21751 }
21752
21753 // Note: this algorithm for moving events around is similar to the
21754 // algorithm when dealing with lazy lines in `writeToChild`.
21755 const indexBeforeExits = self.events.length
21756 let indexBeforeFlow = indexBeforeExits
21757 /** @type {Point|undefined} */
21758 let point
21759
21760 // Find the flow chunk.
21761 while (indexBeforeFlow--) {
21762 if (
21763 self.events[indexBeforeFlow][0] === 'exit' &&
21764 self.events[indexBeforeFlow][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow
21765 ) {
21766 point = self.events[indexBeforeFlow][1].end
21767 break
21768 }
21769 }
21770
21771 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(point, 'could not find previous flow chunk')
21772
21773 exitContainers(continued)
21774
21775 // Fix positions.
21776 let index = indexBeforeExits
21777
21778 while (index < self.events.length) {
21779 self.events[index][1].end = Object.assign({}, point)
21780 index++
21781 }
21782
21783 // Inject the exits earlier (they’re still also at the end).
21784 (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(
21785 self.events,
21786 indexBeforeFlow + 1,
21787 0,
21788 self.events.slice(indexBeforeExits)
21789 )
21790
21791 // Discard the duplicate exits.
21792 self.events.length = index
21793
21794 return checkNewContainers(code)
21795 }
21796
21797 return start(code)
21798 }
21799
21800 /** @type {State} */
21801 function checkNewContainers(code) {
21802 // Next, after consuming the continuation markers for existing blocks, we
21803 // look for new block starts (e.g. `>` for a block quote).
21804 // If we encounter a new block start, we close any blocks unmatched in
21805 // step 1 before creating the new block as a child of the last matched
21806 // block.
21807 if (continued === stack.length) {
21808 // No need to `check` whether there’s a container, of `exitContainers`
21809 // would be moot.
21810 // We can instead immediately `attempt` to parse one.
21811 if (!childFlow) {
21812 return documentContinued(code)
21813 }
21814
21815 // If we have concrete content, such as block HTML or fenced code,
21816 // we can’t have containers “pierce” into them, so we can immediately
21817 // start.
21818 if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {
21819 return flowStart(code)
21820 }
21821
21822 // If we do have flow, it could still be a blank line,
21823 // but we’d be interrupting it w/ a new container if there’s a current
21824 // construct.
21825 self.interrupt = Boolean(
21826 childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack
21827 )
21828 }
21829
21830 // Check if there is a new container.
21831 self.containerState = {}
21832 return effects.check(
21833 containerConstruct,
21834 thereIsANewContainer,
21835 thereIsNoNewContainer
21836 )(code)
21837 }
21838
21839 /** @type {State} */
21840 function thereIsANewContainer(code) {
21841 if (childFlow) closeFlow()
21842 exitContainers(continued)
21843 return documentContinued(code)
21844 }
21845
21846 /** @type {State} */
21847 function thereIsNoNewContainer(code) {
21848 self.parser.lazy[self.now().line] = continued !== stack.length
21849 lineStartOffset = self.now().offset
21850 return flowStart(code)
21851 }
21852
21853 /** @type {State} */
21854 function documentContinued(code) {
21855 // Try new containers.
21856 self.containerState = {}
21857 return effects.attempt(
21858 containerConstruct,
21859 containerContinue,
21860 flowStart
21861 )(code)
21862 }
21863
21864 /** @type {State} */
21865 function containerContinue(code) {
21866 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21867 self.currentConstruct,
21868 'expected `currentConstruct` to be defined on tokenizer'
21869 )
21870 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
21871 self.containerState,
21872 'expected `containerState` to be defined on tokenizer'
21873 )
21874 continued++
21875 stack.push([self.currentConstruct, self.containerState])
21876 // Try another.
21877 return documentContinued(code)
21878 }
21879
21880 /** @type {State} */
21881 function flowStart(code) {
21882 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof) {
21883 if (childFlow) closeFlow()
21884 exitContainers(0)
21885 effects.consume(code)
21886 return
21887 }
21888
21889 childFlow = childFlow || self.parser.flow(self.now())
21890 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow, {
21891 contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.contentTypeFlow,
21892 previous: childToken,
21893 _tokenizer: childFlow
21894 })
21895
21896 return flowContinue(code)
21897 }
21898
21899 /** @type {State} */
21900 function flowContinue(code) {
21901 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof) {
21902 writeToChild(effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow), true)
21903 exitContainers(0)
21904 effects.consume(code)
21905 return
21906 }
21907
21908 if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) {
21909 effects.consume(code)
21910 writeToChild(effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow))
21911 // Get ready for the next line.
21912 continued = 0
21913 self.interrupt = undefined
21914 return start
21915 }
21916
21917 effects.consume(code)
21918 return flowContinue
21919 }
21920
21921 /**
21922 * @param {Token} token
21923 * @param {boolean} [eof]
21924 * @returns {void}
21925 */
21926 function writeToChild(token, eof) {
21927 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(childFlow, 'expected `childFlow` to be defined when continuing')
21928 const stream = self.sliceStream(token)
21929 if (eof) stream.push(null)
21930 token.previous = childToken
21931 if (childToken) childToken.next = token
21932 childToken = token
21933 childFlow.defineSkip(token.start)
21934 childFlow.write(stream)
21935
21936 // Alright, so we just added a lazy line:
21937 //
21938 // ```markdown
21939 // > a
21940 // b.
21941 //
21942 // Or:
21943 //
21944 // > ~~~c
21945 // d
21946 //
21947 // Or:
21948 //
21949 // > | e |
21950 // f
21951 // ```
21952 //
21953 // The construct in the second example (fenced code) does not accept lazy
21954 // lines, so it marked itself as done at the end of its first line, and
21955 // then the content construct parses `d`.
21956 // Most constructs in markdown match on the first line: if the first line
21957 // forms a construct, a non-lazy line can’t “unmake” it.
21958 //
21959 // The construct in the third example is potentially a GFM table, and
21960 // those are *weird*.
21961 // It *could* be a table, from the first line, if the following line
21962 // matches a condition.
21963 // In this case, that second line is lazy, which “unmakes” the first line
21964 // and turns the whole into one content block.
21965 //
21966 // We’ve now parsed the non-lazy and the lazy line, and can figure out
21967 // whether the lazy line started a new flow block.
21968 // If it did, we exit the current containers between the two flow blocks.
21969 if (self.parser.lazy[token.start.line]) {
21970 let index = childFlow.events.length
21971
21972 while (index--) {
21973 if (
21974 // The token starts before the line ending…
21975 childFlow.events[index][1].start.offset < lineStartOffset &&
21976 // …and either is not ended yet…
21977 (!childFlow.events[index][1].end ||
21978 // …or ends after it.
21979 childFlow.events[index][1].end.offset > lineStartOffset)
21980 ) {
21981 // Exit: there’s still something open, which means it’s a lazy line
21982 // part of something.
21983 return
21984 }
21985 }
21986
21987 // Note: this algorithm for moving events around is similar to the
21988 // algorithm when closing flow in `documentContinue`.
21989 const indexBeforeExits = self.events.length
21990 let indexBeforeFlow = indexBeforeExits
21991 /** @type {boolean|undefined} */
21992 let seen
21993 /** @type {Point|undefined} */
21994 let point
21995
21996 // Find the previous chunk (the one before the lazy line).
21997 while (indexBeforeFlow--) {
21998 if (
21999 self.events[indexBeforeFlow][0] === 'exit' &&
22000 self.events[indexBeforeFlow][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow
22001 ) {
22002 if (seen) {
22003 point = self.events[indexBeforeFlow][1].end
22004 break
22005 }
22006
22007 seen = true
22008 }
22009 }
22010
22011 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(point, 'could not find previous flow chunk')
22012
22013 exitContainers(continued)
22014
22015 // Fix positions.
22016 index = indexBeforeExits
22017
22018 while (index < self.events.length) {
22019 self.events[index][1].end = Object.assign({}, point)
22020 index++
22021 }
22022
22023 // Inject the exits earlier (they’re still also at the end).
22024 (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(
22025 self.events,
22026 indexBeforeFlow + 1,
22027 0,
22028 self.events.slice(indexBeforeExits)
22029 )
22030
22031 // Discard the duplicate exits.
22032 self.events.length = index
22033 }
22034 }
22035
22036 /**
22037 * @param {number} size
22038 * @returns {void}
22039 */
22040 function exitContainers(size) {
22041 let index = stack.length
22042
22043 // Exit open containers.
22044 while (index-- > size) {
22045 const entry = stack[index]
22046 self.containerState = entry[1]
22047 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
22048 entry[0].exit,
22049 'expected `exit` to be defined on container construct'
22050 )
22051 entry[0].exit.call(self, effects)
22052 }
22053
22054 stack.length = size
22055 }
22056
22057 function closeFlow() {
22058 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
22059 self.containerState,
22060 'expected `containerState` to be defined when closing flow'
22061 )
22062 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(childFlow, 'expected `childFlow` to be defined when closing it')
22063 childFlow.write([micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof])
22064 childToken = undefined
22065 childFlow = undefined
22066 self.containerState._closeFlow = undefined
22067 }
22068 }
22069
22070 /** @type {Tokenizer} */
22071 function tokenizeContainer(effects, ok, nok) {
22072 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__.factorySpace)(
22073 effects,
22074 effects.attempt(this.parser.constructs.document, ok, nok),
22075 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix,
22076 this.parser.constructs.disable.null.includes('codeIndented')
22077 ? undefined
22078 : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.tabSize
22079 )
22080 }
22081
22082
22083 /***/ }),
22084
22085 /***/ "../node_modules/micromark/dev/lib/initialize/flow.js":
22086 /*!************************************************************!*\
22087 !*** ../node_modules/micromark/dev/lib/initialize/flow.js ***!
22088 \************************************************************/
22089 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22090
22091 "use strict";
22092 __webpack_require__.r(__webpack_exports__);
22093 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22094 /* harmony export */ "flow": () => (/* binding */ flow)
22095 /* harmony export */ });
22096 /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs");
22097 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js");
22098 /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/content.js");
22099 /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js");
22100 /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js");
22101 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
22102 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
22103 /**
22104 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
22105 * @typedef {import('micromark-util-types').Initializer} Initializer
22106 * @typedef {import('micromark-util-types').State} State
22107 */
22108
22109
22110
22111
22112
22113
22114
22115
22116 /** @type {InitialConstruct} */
22117 const flow = {tokenize: initializeFlow}
22118
22119 /** @type {Initializer} */
22120 function initializeFlow(effects) {
22121 const self = this
22122 const initial = effects.attempt(
22123 // Try to parse a blank line.
22124 micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.blankLine,
22125 atBlankEnding,
22126 // Try to parse initial flow (essentially, only code).
22127 effects.attempt(
22128 this.parser.constructs.flowInitial,
22129 afterConstruct,
22130 (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__.factorySpace)(
22131 effects,
22132 effects.attempt(
22133 this.parser.constructs.flow,
22134 afterConstruct,
22135 effects.attempt(micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__.content, afterConstruct)
22136 ),
22137 micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix
22138 )
22139 )
22140 )
22141
22142 return initial
22143
22144 /** @type {State} */
22145 function atBlankEnding(code) {
22146 ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
22147 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_6__.markdownLineEnding)(code),
22148 'expected eol or eof'
22149 )
22150
22151 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof) {
22152 effects.consume(code)
22153 return
22154 }
22155
22156 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank)
22157 effects.consume(code)
22158 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank)
22159 self.currentConstruct = undefined
22160 return initial
22161 }
22162
22163 /** @type {State} */
22164 function afterConstruct(code) {
22165 (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(
22166 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_6__.markdownLineEnding)(code),
22167 'expected eol or eof'
22168 )
22169
22170 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof) {
22171 effects.consume(code)
22172 return
22173 }
22174
22175 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding)
22176 effects.consume(code)
22177 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding)
22178 self.currentConstruct = undefined
22179 return initial
22180 }
22181 }
22182
22183
22184 /***/ }),
22185
22186 /***/ "../node_modules/micromark/dev/lib/initialize/text.js":
22187 /*!************************************************************!*\
22188 !*** ../node_modules/micromark/dev/lib/initialize/text.js ***!
22189 \************************************************************/
22190 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22191
22192 "use strict";
22193 __webpack_require__.r(__webpack_exports__);
22194 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22195 /* harmony export */ "resolver": () => (/* binding */ resolver),
22196 /* harmony export */ "string": () => (/* binding */ string),
22197 /* harmony export */ "text": () => (/* binding */ text)
22198 /* harmony export */ });
22199 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
22200 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
22201 /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js");
22202 /**
22203 * @typedef {import('micromark-util-types').Resolver} Resolver
22204 * @typedef {import('micromark-util-types').Initializer} Initializer
22205 * @typedef {import('micromark-util-types').Construct} Construct
22206 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
22207 * @typedef {import('micromark-util-types').State} State
22208 * @typedef {import('micromark-util-types').Code} Code
22209 */
22210
22211
22212
22213
22214
22215 const resolver = {resolveAll: createResolver()}
22216 const string = initializeFactory('string')
22217 const text = initializeFactory('text')
22218
22219 /**
22220 * @param {'string'|'text'} field
22221 * @returns {InitialConstruct}
22222 */
22223 function initializeFactory(field) {
22224 return {
22225 tokenize: initializeText,
22226 resolveAll: createResolver(
22227 field === 'text' ? resolveAllLineSuffixes : undefined
22228 )
22229 }
22230
22231 /** @type {Initializer} */
22232 function initializeText(effects) {
22233 const self = this
22234 const constructs = this.parser.constructs[field]
22235 const text = effects.attempt(constructs, start, notText)
22236
22237 return start
22238
22239 /** @type {State} */
22240 function start(code) {
22241 return atBreak(code) ? text(code) : notText(code)
22242 }
22243
22244 /** @type {State} */
22245 function notText(code) {
22246 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof) {
22247 effects.consume(code)
22248 return
22249 }
22250
22251 effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data)
22252 effects.consume(code)
22253 return data
22254 }
22255
22256 /** @type {State} */
22257 function data(code) {
22258 if (atBreak(code)) {
22259 effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data)
22260 return text(code)
22261 }
22262
22263 // Data.
22264 effects.consume(code)
22265 return data
22266 }
22267
22268 /**
22269 * @param {Code} code
22270 * @returns {boolean}
22271 */
22272 function atBreak(code) {
22273 if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof) {
22274 return true
22275 }
22276
22277 const list = constructs[code]
22278 let index = -1
22279
22280 if (list) {
22281 while (++index < list.length) {
22282 const item = list[index]
22283 if (!item.previous || item.previous.call(self, self.previous)) {
22284 return true
22285 }
22286 }
22287 }
22288
22289 return false
22290 }
22291 }
22292 }
22293
22294 /**
22295 * @param {Resolver} [extraResolver]
22296 * @returns {Resolver}
22297 */
22298 function createResolver(extraResolver) {
22299 return resolveAllText
22300
22301 /** @type {Resolver} */
22302 function resolveAllText(events, context) {
22303 let index = -1
22304 /** @type {number|undefined} */
22305 let enter
22306
22307 // A rather boring computation (to merge adjacent `data` events) which
22308 // improves mm performance by 29%.
22309 while (++index <= events.length) {
22310 if (enter === undefined) {
22311 if (events[index] && events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data) {
22312 enter = index
22313 index++
22314 }
22315 } else if (!events[index] || events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data) {
22316 // Don’t do anything if there is one data token.
22317 if (index !== enter + 2) {
22318 events[enter][1].end = events[index - 1][1].end
22319 events.splice(enter + 2, index - enter - 2)
22320 index = enter + 2
22321 }
22322
22323 enter = undefined
22324 }
22325 }
22326
22327 return extraResolver ? extraResolver(events, context) : events
22328 }
22329 }
22330
22331 /**
22332 * A rather ugly set of instructions which again looks at chunks in the input
22333 * stream.
22334 * The reason to do this here is that it is *much* faster to parse in reverse.
22335 * And that we can’t hook into `null` to split the line suffix before an EOF.
22336 * To do: figure out if we can make this into a clean utility, or even in core.
22337 * As it will be useful for GFMs literal autolink extension (and maybe even
22338 * tables?)
22339 *
22340 * @type {Resolver}
22341 */
22342 function resolveAllLineSuffixes(events, context) {
22343 let eventIndex = 0 // Skip first.
22344
22345 while (++eventIndex <= events.length) {
22346 if (
22347 (eventIndex === events.length ||
22348 events[eventIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) &&
22349 events[eventIndex - 1][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data
22350 ) {
22351 const data = events[eventIndex - 1][1]
22352 const chunks = context.sliceStream(data)
22353 let index = chunks.length
22354 let bufferIndex = -1
22355 let size = 0
22356 /** @type {boolean|undefined} */
22357 let tabs
22358
22359 while (index--) {
22360 const chunk = chunks[index]
22361
22362 if (typeof chunk === 'string') {
22363 bufferIndex = chunk.length
22364
22365 while (chunk.charCodeAt(bufferIndex - 1) === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space) {
22366 size++
22367 bufferIndex--
22368 }
22369
22370 if (bufferIndex) break
22371 bufferIndex = -1
22372 }
22373 // Number
22374 else if (chunk === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab) {
22375 tabs = true
22376 size++
22377 } else if (chunk === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace) {
22378 // Empty
22379 } else {
22380 // Replacement character, exit.
22381 index++
22382 break
22383 }
22384 }
22385
22386 if (size) {
22387 const token = {
22388 type:
22389 eventIndex === events.length ||
22390 tabs ||
22391 size < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.hardBreakPrefixSizeMin
22392 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineSuffix
22393 : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.hardBreakTrailing,
22394 start: {
22395 line: data.end.line,
22396 column: data.end.column - size,
22397 offset: data.end.offset - size,
22398 _index: data.start._index + index,
22399 _bufferIndex: index
22400 ? bufferIndex
22401 : data.start._bufferIndex + bufferIndex
22402 },
22403 end: Object.assign({}, data.end)
22404 }
22405
22406 data.end = Object.assign({}, token.start)
22407
22408 if (data.start.offset === data.end.offset) {
22409 Object.assign(data, token)
22410 } else {
22411 events.splice(
22412 eventIndex,
22413 0,
22414 ['enter', token, context],
22415 ['exit', token, context]
22416 )
22417 eventIndex += 2
22418 }
22419 }
22420
22421 eventIndex++
22422 }
22423 }
22424
22425 return events
22426 }
22427
22428
22429 /***/ }),
22430
22431 /***/ "../node_modules/micromark/dev/lib/parse.js":
22432 /*!**************************************************!*\
22433 !*** ../node_modules/micromark/dev/lib/parse.js ***!
22434 \**************************************************/
22435 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22436
22437 "use strict";
22438 __webpack_require__.r(__webpack_exports__);
22439 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22440 /* harmony export */ "parse": () => (/* binding */ parse)
22441 /* harmony export */ });
22442 /* harmony import */ var micromark_util_combine_extensions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-combine-extensions */ "../node_modules/micromark-util-combine-extensions/index.js");
22443 /* harmony import */ var _initialize_content_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./initialize/content.js */ "../node_modules/micromark/dev/lib/initialize/content.js");
22444 /* harmony import */ var _initialize_document_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./initialize/document.js */ "../node_modules/micromark/dev/lib/initialize/document.js");
22445 /* harmony import */ var _initialize_flow_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./initialize/flow.js */ "../node_modules/micromark/dev/lib/initialize/flow.js");
22446 /* harmony import */ var _initialize_text_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./initialize/text.js */ "../node_modules/micromark/dev/lib/initialize/text.js");
22447 /* harmony import */ var _create_tokenizer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./create-tokenizer.js */ "../node_modules/micromark/dev/lib/create-tokenizer.js");
22448 /* harmony import */ var _constructs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constructs.js */ "../node_modules/micromark/dev/lib/constructs.js");
22449 /**
22450 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
22451 * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension
22452 * @typedef {import('micromark-util-types').ParseOptions} ParseOptions
22453 * @typedef {import('micromark-util-types').ParseContext} ParseContext
22454 * @typedef {import('micromark-util-types').Create} Create
22455 */
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465 /**
22466 * @param {ParseOptions} [options]
22467 * @returns {ParseContext}
22468 */
22469 function parse(options = {}) {
22470 /** @type {FullNormalizedExtension} */
22471 // @ts-expect-error `defaultConstructs` is full, so the result will be too.
22472 const constructs = (0,micromark_util_combine_extensions__WEBPACK_IMPORTED_MODULE_0__.combineExtensions)(
22473 // @ts-expect-error Same as above.
22474 [_constructs_js__WEBPACK_IMPORTED_MODULE_1__].concat(options.extensions || [])
22475 )
22476 /** @type {ParseContext} */
22477 const parser = {
22478 defined: [],
22479 lazy: {},
22480 constructs,
22481 content: create(_initialize_content_js__WEBPACK_IMPORTED_MODULE_2__.content),
22482 document: create(_initialize_document_js__WEBPACK_IMPORTED_MODULE_3__.document),
22483 flow: create(_initialize_flow_js__WEBPACK_IMPORTED_MODULE_4__.flow),
22484 string: create(_initialize_text_js__WEBPACK_IMPORTED_MODULE_5__.string),
22485 text: create(_initialize_text_js__WEBPACK_IMPORTED_MODULE_5__.text)
22486 }
22487
22488 return parser
22489
22490 /**
22491 * @param {InitialConstruct} initial
22492 */
22493 function create(initial) {
22494 return creator
22495 /** @type {Create} */
22496 function creator(from) {
22497 return (0,_create_tokenizer_js__WEBPACK_IMPORTED_MODULE_6__.createTokenizer)(parser, initial, from)
22498 }
22499 }
22500 }
22501
22502
22503 /***/ }),
22504
22505 /***/ "../node_modules/micromark/dev/lib/postprocess.js":
22506 /*!********************************************************!*\
22507 !*** ../node_modules/micromark/dev/lib/postprocess.js ***!
22508 \********************************************************/
22509 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22510
22511 "use strict";
22512 __webpack_require__.r(__webpack_exports__);
22513 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22514 /* harmony export */ "postprocess": () => (/* binding */ postprocess)
22515 /* harmony export */ });
22516 /* harmony import */ var micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-subtokenize */ "../node_modules/micromark-util-subtokenize/dev/index.js");
22517 /**
22518 * @typedef {import('micromark-util-types').Event} Event
22519 */
22520
22521
22522
22523 /**
22524 * @param {Array<Event>} events
22525 * @returns {Array<Event>}
22526 */
22527 function postprocess(events) {
22528 while (!(0,micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_0__.subtokenize)(events)) {
22529 // Empty
22530 }
22531
22532 return events
22533 }
22534
22535
22536 /***/ }),
22537
22538 /***/ "../node_modules/micromark/dev/lib/preprocess.js":
22539 /*!*******************************************************!*\
22540 !*** ../node_modules/micromark/dev/lib/preprocess.js ***!
22541 \*******************************************************/
22542 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22543
22544 "use strict";
22545 __webpack_require__.r(__webpack_exports__);
22546 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22547 /* harmony export */ "preprocess": () => (/* binding */ preprocess)
22548 /* harmony export */ });
22549 /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js");
22550 /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js");
22551 /**
22552 * @typedef {import('micromark-util-types').Encoding} Encoding
22553 * @typedef {import('micromark-util-types').Value} Value
22554 * @typedef {import('micromark-util-types').Chunk} Chunk
22555 * @typedef {import('micromark-util-types').Code} Code
22556 */
22557
22558 /**
22559 * @callback Preprocessor
22560 * @param {Value} value
22561 * @param {Encoding} [encoding]
22562 * @param {boolean} [end=false]
22563 * @returns {Array<Chunk>}
22564 */
22565
22566
22567
22568
22569 const search = /[\0\t\n\r]/g
22570
22571 /**
22572 * @returns {Preprocessor}
22573 */
22574 function preprocess() {
22575 let column = 1
22576 let buffer = ''
22577 /** @type {boolean|undefined} */
22578 let start = true
22579 /** @type {boolean|undefined} */
22580 let atCarriageReturn
22581
22582 return preprocessor
22583
22584 /** @type {Preprocessor} */
22585 function preprocessor(value, encoding, end) {
22586 /** @type {Array<Chunk>} */
22587 const chunks = []
22588 /** @type {RegExpMatchArray|null} */
22589 let match
22590 /** @type {number} */
22591 let next
22592 /** @type {number} */
22593 let startPosition
22594 /** @type {number} */
22595 let endPosition
22596 /** @type {Code} */
22597 let code
22598
22599 // @ts-expect-error `Buffer` does allow an encoding.
22600 value = buffer + value.toString(encoding)
22601 startPosition = 0
22602 buffer = ''
22603
22604 if (start) {
22605 if (value.charCodeAt(0) === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.byteOrderMarker) {
22606 startPosition++
22607 }
22608
22609 start = undefined
22610 }
22611
22612 while (startPosition < value.length) {
22613 search.lastIndex = startPosition
22614 match = search.exec(value)
22615 endPosition =
22616 match && match.index !== undefined ? match.index : value.length
22617 code = value.charCodeAt(endPosition)
22618
22619 if (!match) {
22620 buffer = value.slice(startPosition)
22621 break
22622 }
22623
22624 if (
22625 code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lf &&
22626 startPosition === endPosition &&
22627 atCarriageReturn
22628 ) {
22629 chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturnLineFeed)
22630 atCarriageReturn = undefined
22631 } else {
22632 if (atCarriageReturn) {
22633 chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturn)
22634 atCarriageReturn = undefined
22635 }
22636
22637 if (startPosition < endPosition) {
22638 chunks.push(value.slice(startPosition, endPosition))
22639 column += endPosition - startPosition
22640 }
22641
22642 switch (code) {
22643 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.nul: {
22644 chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.replacementCharacter)
22645 column++
22646
22647 break
22648 }
22649
22650 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ht: {
22651 next = Math.ceil(column / micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_1__.constants.tabSize) * micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_1__.constants.tabSize
22652 chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab)
22653 while (column++ < next) chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace)
22654
22655 break
22656 }
22657
22658 case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lf: {
22659 chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lineFeed)
22660 column = 1
22661
22662 break
22663 }
22664
22665 default: {
22666 atCarriageReturn = true
22667 column = 1
22668 }
22669 }
22670 }
22671
22672 startPosition = endPosition + 1
22673 }
22674
22675 if (end) {
22676 if (atCarriageReturn) chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturn)
22677 if (buffer) chunks.push(buffer)
22678 chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof)
22679 }
22680
22681 return chunks
22682 }
22683 }
22684
22685
22686 /***/ }),
22687
22688 /***/ "../node_modules/property-information/index.js":
22689 /*!*****************************************************!*\
22690 !*** ../node_modules/property-information/index.js ***!
22691 \*****************************************************/
22692 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22693
22694 "use strict";
22695 __webpack_require__.r(__webpack_exports__);
22696 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22697 /* harmony export */ "find": () => (/* reexport safe */ _lib_find_js__WEBPACK_IMPORTED_MODULE_0__.find),
22698 /* harmony export */ "hastToReact": () => (/* reexport safe */ _lib_hast_to_react_js__WEBPACK_IMPORTED_MODULE_1__.hastToReact),
22699 /* harmony export */ "html": () => (/* binding */ html),
22700 /* harmony export */ "normalize": () => (/* reexport safe */ _lib_normalize_js__WEBPACK_IMPORTED_MODULE_2__.normalize),
22701 /* harmony export */ "svg": () => (/* binding */ svg)
22702 /* harmony export */ });
22703 /* harmony import */ var _lib_util_merge_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/util/merge.js */ "../node_modules/property-information/lib/util/merge.js");
22704 /* harmony import */ var _lib_xlink_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/xlink.js */ "../node_modules/property-information/lib/xlink.js");
22705 /* harmony import */ var _lib_xml_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/xml.js */ "../node_modules/property-information/lib/xml.js");
22706 /* harmony import */ var _lib_xmlns_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/xmlns.js */ "../node_modules/property-information/lib/xmlns.js");
22707 /* harmony import */ var _lib_aria_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/aria.js */ "../node_modules/property-information/lib/aria.js");
22708 /* harmony import */ var _lib_html_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/html.js */ "../node_modules/property-information/lib/html.js");
22709 /* harmony import */ var _lib_svg_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/svg.js */ "../node_modules/property-information/lib/svg.js");
22710 /* harmony import */ var _lib_find_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/find.js */ "../node_modules/property-information/lib/find.js");
22711 /* harmony import */ var _lib_hast_to_react_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/hast-to-react.js */ "../node_modules/property-information/lib/hast-to-react.js");
22712 /* harmony import */ var _lib_normalize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/normalize.js */ "../node_modules/property-information/lib/normalize.js");
22713 /**
22714 * @typedef {import('./lib/util/info.js').Info} Info
22715 * @typedef {import('./lib/util/schema.js').Schema} Schema
22716 */
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729 const html = (0,_lib_util_merge_js__WEBPACK_IMPORTED_MODULE_3__.merge)([_lib_xml_js__WEBPACK_IMPORTED_MODULE_4__.xml, _lib_xlink_js__WEBPACK_IMPORTED_MODULE_5__.xlink, _lib_xmlns_js__WEBPACK_IMPORTED_MODULE_6__.xmlns, _lib_aria_js__WEBPACK_IMPORTED_MODULE_7__.aria, _lib_html_js__WEBPACK_IMPORTED_MODULE_8__.html], 'html')
22730 const svg = (0,_lib_util_merge_js__WEBPACK_IMPORTED_MODULE_3__.merge)([_lib_xml_js__WEBPACK_IMPORTED_MODULE_4__.xml, _lib_xlink_js__WEBPACK_IMPORTED_MODULE_5__.xlink, _lib_xmlns_js__WEBPACK_IMPORTED_MODULE_6__.xmlns, _lib_aria_js__WEBPACK_IMPORTED_MODULE_7__.aria, _lib_svg_js__WEBPACK_IMPORTED_MODULE_9__.svg], 'svg')
22731
22732
22733 /***/ }),
22734
22735 /***/ "../node_modules/property-information/lib/aria.js":
22736 /*!********************************************************!*\
22737 !*** ../node_modules/property-information/lib/aria.js ***!
22738 \********************************************************/
22739 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22740
22741 "use strict";
22742 __webpack_require__.r(__webpack_exports__);
22743 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22744 /* harmony export */ "aria": () => (/* binding */ aria)
22745 /* harmony export */ });
22746 /* harmony import */ var _util_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/types.js */ "../node_modules/property-information/lib/util/types.js");
22747 /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js");
22748
22749
22750
22751 const aria = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({
22752 transform(_, prop) {
22753 return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()
22754 },
22755 properties: {
22756 ariaActiveDescendant: null,
22757 ariaAtomic: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22758 ariaAutoComplete: null,
22759 ariaBusy: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22760 ariaChecked: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22761 ariaColCount: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22762 ariaColIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22763 ariaColSpan: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22764 ariaControls: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated,
22765 ariaCurrent: null,
22766 ariaDescribedBy: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated,
22767 ariaDetails: null,
22768 ariaDisabled: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22769 ariaDropEffect: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated,
22770 ariaErrorMessage: null,
22771 ariaExpanded: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22772 ariaFlowTo: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated,
22773 ariaGrabbed: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22774 ariaHasPopup: null,
22775 ariaHidden: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22776 ariaInvalid: null,
22777 ariaKeyShortcuts: null,
22778 ariaLabel: null,
22779 ariaLabelledBy: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated,
22780 ariaLevel: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22781 ariaLive: null,
22782 ariaModal: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22783 ariaMultiLine: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22784 ariaMultiSelectable: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22785 ariaOrientation: null,
22786 ariaOwns: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated,
22787 ariaPlaceholder: null,
22788 ariaPosInSet: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22789 ariaPressed: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22790 ariaReadOnly: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22791 ariaRelevant: null,
22792 ariaRequired: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22793 ariaRoleDescription: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated,
22794 ariaRowCount: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22795 ariaRowIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22796 ariaRowSpan: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22797 ariaSelected: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish,
22798 ariaSetSize: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22799 ariaSort: null,
22800 ariaValueMax: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22801 ariaValueMin: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22802 ariaValueNow: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number,
22803 ariaValueText: null,
22804 role: null
22805 }
22806 })
22807
22808
22809 /***/ }),
22810
22811 /***/ "../node_modules/property-information/lib/find.js":
22812 /*!********************************************************!*\
22813 !*** ../node_modules/property-information/lib/find.js ***!
22814 \********************************************************/
22815 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22816
22817 "use strict";
22818 __webpack_require__.r(__webpack_exports__);
22819 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22820 /* harmony export */ "find": () => (/* binding */ find)
22821 /* harmony export */ });
22822 /* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./normalize.js */ "../node_modules/property-information/lib/normalize.js");
22823 /* harmony import */ var _util_defined_info_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/defined-info.js */ "../node_modules/property-information/lib/util/defined-info.js");
22824 /* harmony import */ var _util_info_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/info.js */ "../node_modules/property-information/lib/util/info.js");
22825 /**
22826 * @typedef {import('./util/schema.js').Schema} Schema
22827 */
22828
22829
22830
22831
22832
22833 const valid = /^data[-\w.:]+$/i
22834 const dash = /-[a-z]/g
22835 const cap = /[A-Z]/g
22836
22837 /**
22838 * @param {Schema} schema
22839 * @param {string} value
22840 * @returns {Info}
22841 */
22842 function find(schema, value) {
22843 const normal = (0,_normalize_js__WEBPACK_IMPORTED_MODULE_0__.normalize)(value)
22844 let prop = value
22845 let Type = _util_info_js__WEBPACK_IMPORTED_MODULE_1__.Info
22846
22847 if (normal in schema.normal) {
22848 return schema.property[schema.normal[normal]]
22849 }
22850
22851 if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {
22852 // Attribute or property.
22853 if (value.charAt(4) === '-') {
22854 // Turn it into a property.
22855 const rest = value.slice(5).replace(dash, camelcase)
22856 prop = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)
22857 } else {
22858 // Turn it into an attribute.
22859 const rest = value.slice(4)
22860
22861 if (!dash.test(rest)) {
22862 let dashes = rest.replace(cap, kebab)
22863
22864 if (dashes.charAt(0) !== '-') {
22865 dashes = '-' + dashes
22866 }
22867
22868 value = 'data' + dashes
22869 }
22870 }
22871
22872 Type = _util_defined_info_js__WEBPACK_IMPORTED_MODULE_2__.DefinedInfo
22873 }
22874
22875 return new Type(prop, value)
22876 }
22877
22878 /**
22879 * @param {string} $0
22880 * @returns {string}
22881 */
22882 function kebab($0) {
22883 return '-' + $0.toLowerCase()
22884 }
22885
22886 /**
22887 * @param {string} $0
22888 * @returns {string}
22889 */
22890 function camelcase($0) {
22891 return $0.charAt(1).toUpperCase()
22892 }
22893
22894
22895 /***/ }),
22896
22897 /***/ "../node_modules/property-information/lib/hast-to-react.js":
22898 /*!*****************************************************************!*\
22899 !*** ../node_modules/property-information/lib/hast-to-react.js ***!
22900 \*****************************************************************/
22901 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22902
22903 "use strict";
22904 __webpack_require__.r(__webpack_exports__);
22905 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22906 /* harmony export */ "hastToReact": () => (/* binding */ hastToReact)
22907 /* harmony export */ });
22908 /**
22909 * `hast` is close to `React`, but differs in a couple of cases.
22910 *
22911 * To get a React property from a hast property, check if it is in
22912 * `hastToReact`, if it is, then use the corresponding value,
22913 * otherwise, use the hast property.
22914 *
22915 * @type {Record<string, string>}
22916 */
22917 const hastToReact = {
22918 classId: 'classID',
22919 dataType: 'datatype',
22920 itemId: 'itemID',
22921 strokeDashArray: 'strokeDasharray',
22922 strokeDashOffset: 'strokeDashoffset',
22923 strokeLineCap: 'strokeLinecap',
22924 strokeLineJoin: 'strokeLinejoin',
22925 strokeMiterLimit: 'strokeMiterlimit',
22926 typeOf: 'typeof',
22927 xLinkActuate: 'xlinkActuate',
22928 xLinkArcRole: 'xlinkArcrole',
22929 xLinkHref: 'xlinkHref',
22930 xLinkRole: 'xlinkRole',
22931 xLinkShow: 'xlinkShow',
22932 xLinkTitle: 'xlinkTitle',
22933 xLinkType: 'xlinkType',
22934 xmlnsXLink: 'xmlnsXlink'
22935 }
22936
22937
22938 /***/ }),
22939
22940 /***/ "../node_modules/property-information/lib/html.js":
22941 /*!********************************************************!*\
22942 !*** ../node_modules/property-information/lib/html.js ***!
22943 \********************************************************/
22944 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
22945
22946 "use strict";
22947 __webpack_require__.r(__webpack_exports__);
22948 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22949 /* harmony export */ "html": () => (/* binding */ html)
22950 /* harmony export */ });
22951 /* harmony import */ var _util_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/types.js */ "../node_modules/property-information/lib/util/types.js");
22952 /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js");
22953 /* harmony import */ var _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/case-insensitive-transform.js */ "../node_modules/property-information/lib/util/case-insensitive-transform.js");
22954
22955
22956
22957
22958 const html = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({
22959 space: 'html',
22960 attributes: {
22961 acceptcharset: 'accept-charset',
22962 classname: 'class',
22963 htmlfor: 'for',
22964 httpequiv: 'http-equiv'
22965 },
22966 transform: _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__.caseInsensitiveTransform,
22967 mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],
22968 properties: {
22969 // Standard Properties.
22970 abbr: null,
22971 accept: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated,
22972 acceptCharset: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
22973 accessKey: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
22974 action: null,
22975 allow: null,
22976 allowFullScreen: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22977 allowPaymentRequest: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22978 allowUserMedia: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22979 alt: null,
22980 as: null,
22981 async: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22982 autoCapitalize: null,
22983 autoComplete: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
22984 autoFocus: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22985 autoPlay: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22986 capture: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22987 charSet: null,
22988 checked: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22989 cite: null,
22990 className: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
22991 cols: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
22992 colSpan: null,
22993 content: null,
22994 contentEditable: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish,
22995 controls: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
22996 controlsList: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
22997 coords: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number | _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated,
22998 crossOrigin: null,
22999 data: null,
23000 dateTime: null,
23001 decoding: null,
23002 default: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23003 defer: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23004 dir: null,
23005 dirName: null,
23006 disabled: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23007 download: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.overloadedBoolean,
23008 draggable: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish,
23009 encType: null,
23010 enterKeyHint: null,
23011 form: null,
23012 formAction: null,
23013 formEncType: null,
23014 formMethod: null,
23015 formNoValidate: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23016 formTarget: null,
23017 headers: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23018 height: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23019 hidden: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23020 high: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23021 href: null,
23022 hrefLang: null,
23023 htmlFor: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23024 httpEquiv: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23025 id: null,
23026 imageSizes: null,
23027 imageSrcSet: null,
23028 inputMode: null,
23029 integrity: null,
23030 is: null,
23031 isMap: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23032 itemId: null,
23033 itemProp: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23034 itemRef: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23035 itemScope: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23036 itemType: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23037 kind: null,
23038 label: null,
23039 lang: null,
23040 language: null,
23041 list: null,
23042 loading: null,
23043 loop: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23044 low: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23045 manifest: null,
23046 max: null,
23047 maxLength: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23048 media: null,
23049 method: null,
23050 min: null,
23051 minLength: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23052 multiple: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23053 muted: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23054 name: null,
23055 nonce: null,
23056 noModule: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23057 noValidate: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23058 onAbort: null,
23059 onAfterPrint: null,
23060 onAuxClick: null,
23061 onBeforeMatch: null,
23062 onBeforePrint: null,
23063 onBeforeUnload: null,
23064 onBlur: null,
23065 onCancel: null,
23066 onCanPlay: null,
23067 onCanPlayThrough: null,
23068 onChange: null,
23069 onClick: null,
23070 onClose: null,
23071 onContextLost: null,
23072 onContextMenu: null,
23073 onContextRestored: null,
23074 onCopy: null,
23075 onCueChange: null,
23076 onCut: null,
23077 onDblClick: null,
23078 onDrag: null,
23079 onDragEnd: null,
23080 onDragEnter: null,
23081 onDragExit: null,
23082 onDragLeave: null,
23083 onDragOver: null,
23084 onDragStart: null,
23085 onDrop: null,
23086 onDurationChange: null,
23087 onEmptied: null,
23088 onEnded: null,
23089 onError: null,
23090 onFocus: null,
23091 onFormData: null,
23092 onHashChange: null,
23093 onInput: null,
23094 onInvalid: null,
23095 onKeyDown: null,
23096 onKeyPress: null,
23097 onKeyUp: null,
23098 onLanguageChange: null,
23099 onLoad: null,
23100 onLoadedData: null,
23101 onLoadedMetadata: null,
23102 onLoadEnd: null,
23103 onLoadStart: null,
23104 onMessage: null,
23105 onMessageError: null,
23106 onMouseDown: null,
23107 onMouseEnter: null,
23108 onMouseLeave: null,
23109 onMouseMove: null,
23110 onMouseOut: null,
23111 onMouseOver: null,
23112 onMouseUp: null,
23113 onOffline: null,
23114 onOnline: null,
23115 onPageHide: null,
23116 onPageShow: null,
23117 onPaste: null,
23118 onPause: null,
23119 onPlay: null,
23120 onPlaying: null,
23121 onPopState: null,
23122 onProgress: null,
23123 onRateChange: null,
23124 onRejectionHandled: null,
23125 onReset: null,
23126 onResize: null,
23127 onScroll: null,
23128 onScrollEnd: null,
23129 onSecurityPolicyViolation: null,
23130 onSeeked: null,
23131 onSeeking: null,
23132 onSelect: null,
23133 onSlotChange: null,
23134 onStalled: null,
23135 onStorage: null,
23136 onSubmit: null,
23137 onSuspend: null,
23138 onTimeUpdate: null,
23139 onToggle: null,
23140 onUnhandledRejection: null,
23141 onUnload: null,
23142 onVolumeChange: null,
23143 onWaiting: null,
23144 onWheel: null,
23145 open: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23146 optimum: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23147 pattern: null,
23148 ping: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23149 placeholder: null,
23150 playsInline: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23151 poster: null,
23152 preload: null,
23153 readOnly: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23154 referrerPolicy: null,
23155 rel: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23156 required: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23157 reversed: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23158 rows: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23159 rowSpan: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23160 sandbox: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23161 scope: null,
23162 scoped: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23163 seamless: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23164 selected: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23165 shape: null,
23166 size: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23167 sizes: null,
23168 slot: null,
23169 span: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23170 spellCheck: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish,
23171 src: null,
23172 srcDoc: null,
23173 srcLang: null,
23174 srcSet: null,
23175 start: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23176 step: null,
23177 style: null,
23178 tabIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23179 target: null,
23180 title: null,
23181 translate: null,
23182 type: null,
23183 typeMustMatch: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23184 useMap: null,
23185 value: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish,
23186 width: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23187 wrap: null,
23188
23189 // Legacy.
23190 // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
23191 align: null, // Several. Use CSS `text-align` instead,
23192 aLink: null, // `<body>`. Use CSS `a:active {color}` instead
23193 archive: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, // `<object>`. List of URIs to archives
23194 axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`
23195 background: null, // `<body>`. Use CSS `background-image` instead
23196 bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead
23197 border: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<table>`. Use CSS `border-width` instead,
23198 borderColor: null, // `<table>`. Use CSS `border-color` instead,
23199 bottomMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>`
23200 cellPadding: null, // `<table>`
23201 cellSpacing: null, // `<table>`
23202 char: null, // Several table elements. When `align=char`, sets the character to align on
23203 charOff: null, // Several table elements. When `char`, offsets the alignment
23204 classId: null, // `<object>`
23205 clear: null, // `<br>`. Use CSS `clear` instead
23206 code: null, // `<object>`
23207 codeBase: null, // `<object>`
23208 codeType: null, // `<object>`
23209 color: null, // `<font>` and `<hr>`. Use CSS instead
23210 compact: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // Lists. Use CSS to reduce space between items instead
23211 declare: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<object>`
23212 event: null, // `<script>`
23213 face: null, // `<font>`. Use CSS instead
23214 frame: null, // `<table>`
23215 frameBorder: null, // `<iframe>`. Use CSS `border` instead
23216 hSpace: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<img>` and `<object>`
23217 leftMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>`
23218 link: null, // `<body>`. Use CSS `a:link {color: *}` instead
23219 longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
23220 lowSrc: null, // `<img>`. Use a `<picture>`
23221 marginHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>`
23222 marginWidth: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>`
23223 noResize: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<frame>`
23224 noHref: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<area>`. Use no href instead of an explicit `nohref`
23225 noShade: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<hr>`. Use background-color and height instead of borders
23226 noWrap: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<td>` and `<th>`
23227 object: null, // `<applet>`
23228 profile: null, // `<head>`
23229 prompt: null, // `<isindex>`
23230 rev: null, // `<link>`
23231 rightMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>`
23232 rules: null, // `<table>`
23233 scheme: null, // `<meta>`
23234 scrolling: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish, // `<frame>`. Use overflow in the child context
23235 standby: null, // `<object>`
23236 summary: null, // `<table>`
23237 text: null, // `<body>`. Use CSS `color` instead
23238 topMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>`
23239 valueType: null, // `<param>`
23240 version: null, // `<html>`. Use a doctype.
23241 vAlign: null, // Several. Use CSS `vertical-align` instead
23242 vLink: null, // `<body>`. Use CSS `a:visited {color}` instead
23243 vSpace: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<img>` and `<object>`
23244
23245 // Non-standard Properties.
23246 allowTransparency: null,
23247 autoCorrect: null,
23248 autoSave: null,
23249 disablePictureInPicture: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23250 disableRemotePlayback: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23251 prefix: null,
23252 property: null,
23253 results: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23254 security: null,
23255 unselectable: null
23256 }
23257 })
23258
23259
23260 /***/ }),
23261
23262 /***/ "../node_modules/property-information/lib/normalize.js":
23263 /*!*************************************************************!*\
23264 !*** ../node_modules/property-information/lib/normalize.js ***!
23265 \*************************************************************/
23266 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
23267
23268 "use strict";
23269 __webpack_require__.r(__webpack_exports__);
23270 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23271 /* harmony export */ "normalize": () => (/* binding */ normalize)
23272 /* harmony export */ });
23273 /**
23274 * @param {string} value
23275 * @returns {string}
23276 */
23277 function normalize(value) {
23278 return value.toLowerCase()
23279 }
23280
23281
23282 /***/ }),
23283
23284 /***/ "../node_modules/property-information/lib/svg.js":
23285 /*!*******************************************************!*\
23286 !*** ../node_modules/property-information/lib/svg.js ***!
23287 \*******************************************************/
23288 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
23289
23290 "use strict";
23291 __webpack_require__.r(__webpack_exports__);
23292 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23293 /* harmony export */ "svg": () => (/* binding */ svg)
23294 /* harmony export */ });
23295 /* harmony import */ var _util_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/types.js */ "../node_modules/property-information/lib/util/types.js");
23296 /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js");
23297 /* harmony import */ var _util_case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/case-sensitive-transform.js */ "../node_modules/property-information/lib/util/case-sensitive-transform.js");
23298
23299
23300
23301
23302 const svg = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({
23303 space: 'svg',
23304 attributes: {
23305 accentHeight: 'accent-height',
23306 alignmentBaseline: 'alignment-baseline',
23307 arabicForm: 'arabic-form',
23308 baselineShift: 'baseline-shift',
23309 capHeight: 'cap-height',
23310 className: 'class',
23311 clipPath: 'clip-path',
23312 clipRule: 'clip-rule',
23313 colorInterpolation: 'color-interpolation',
23314 colorInterpolationFilters: 'color-interpolation-filters',
23315 colorProfile: 'color-profile',
23316 colorRendering: 'color-rendering',
23317 crossOrigin: 'crossorigin',
23318 dataType: 'datatype',
23319 dominantBaseline: 'dominant-baseline',
23320 enableBackground: 'enable-background',
23321 fillOpacity: 'fill-opacity',
23322 fillRule: 'fill-rule',
23323 floodColor: 'flood-color',
23324 floodOpacity: 'flood-opacity',
23325 fontFamily: 'font-family',
23326 fontSize: 'font-size',
23327 fontSizeAdjust: 'font-size-adjust',
23328 fontStretch: 'font-stretch',
23329 fontStyle: 'font-style',
23330 fontVariant: 'font-variant',
23331 fontWeight: 'font-weight',
23332 glyphName: 'glyph-name',
23333 glyphOrientationHorizontal: 'glyph-orientation-horizontal',
23334 glyphOrientationVertical: 'glyph-orientation-vertical',
23335 hrefLang: 'hreflang',
23336 horizAdvX: 'horiz-adv-x',
23337 horizOriginX: 'horiz-origin-x',
23338 horizOriginY: 'horiz-origin-y',
23339 imageRendering: 'image-rendering',
23340 letterSpacing: 'letter-spacing',
23341 lightingColor: 'lighting-color',
23342 markerEnd: 'marker-end',
23343 markerMid: 'marker-mid',
23344 markerStart: 'marker-start',
23345 navDown: 'nav-down',
23346 navDownLeft: 'nav-down-left',
23347 navDownRight: 'nav-down-right',
23348 navLeft: 'nav-left',
23349 navNext: 'nav-next',
23350 navPrev: 'nav-prev',
23351 navRight: 'nav-right',
23352 navUp: 'nav-up',
23353 navUpLeft: 'nav-up-left',
23354 navUpRight: 'nav-up-right',
23355 onAbort: 'onabort',
23356 onActivate: 'onactivate',
23357 onAfterPrint: 'onafterprint',
23358 onBeforePrint: 'onbeforeprint',
23359 onBegin: 'onbegin',
23360 onCancel: 'oncancel',
23361 onCanPlay: 'oncanplay',
23362 onCanPlayThrough: 'oncanplaythrough',
23363 onChange: 'onchange',
23364 onClick: 'onclick',
23365 onClose: 'onclose',
23366 onCopy: 'oncopy',
23367 onCueChange: 'oncuechange',
23368 onCut: 'oncut',
23369 onDblClick: 'ondblclick',
23370 onDrag: 'ondrag',
23371 onDragEnd: 'ondragend',
23372 onDragEnter: 'ondragenter',
23373 onDragExit: 'ondragexit',
23374 onDragLeave: 'ondragleave',
23375 onDragOver: 'ondragover',
23376 onDragStart: 'ondragstart',
23377 onDrop: 'ondrop',
23378 onDurationChange: 'ondurationchange',
23379 onEmptied: 'onemptied',
23380 onEnd: 'onend',
23381 onEnded: 'onended',
23382 onError: 'onerror',
23383 onFocus: 'onfocus',
23384 onFocusIn: 'onfocusin',
23385 onFocusOut: 'onfocusout',
23386 onHashChange: 'onhashchange',
23387 onInput: 'oninput',
23388 onInvalid: 'oninvalid',
23389 onKeyDown: 'onkeydown',
23390 onKeyPress: 'onkeypress',
23391 onKeyUp: 'onkeyup',
23392 onLoad: 'onload',
23393 onLoadedData: 'onloadeddata',
23394 onLoadedMetadata: 'onloadedmetadata',
23395 onLoadStart: 'onloadstart',
23396 onMessage: 'onmessage',
23397 onMouseDown: 'onmousedown',
23398 onMouseEnter: 'onmouseenter',
23399 onMouseLeave: 'onmouseleave',
23400 onMouseMove: 'onmousemove',
23401 onMouseOut: 'onmouseout',
23402 onMouseOver: 'onmouseover',
23403 onMouseUp: 'onmouseup',
23404 onMouseWheel: 'onmousewheel',
23405 onOffline: 'onoffline',
23406 onOnline: 'ononline',
23407 onPageHide: 'onpagehide',
23408 onPageShow: 'onpageshow',
23409 onPaste: 'onpaste',
23410 onPause: 'onpause',
23411 onPlay: 'onplay',
23412 onPlaying: 'onplaying',
23413 onPopState: 'onpopstate',
23414 onProgress: 'onprogress',
23415 onRateChange: 'onratechange',
23416 onRepeat: 'onrepeat',
23417 onReset: 'onreset',
23418 onResize: 'onresize',
23419 onScroll: 'onscroll',
23420 onSeeked: 'onseeked',
23421 onSeeking: 'onseeking',
23422 onSelect: 'onselect',
23423 onShow: 'onshow',
23424 onStalled: 'onstalled',
23425 onStorage: 'onstorage',
23426 onSubmit: 'onsubmit',
23427 onSuspend: 'onsuspend',
23428 onTimeUpdate: 'ontimeupdate',
23429 onToggle: 'ontoggle',
23430 onUnload: 'onunload',
23431 onVolumeChange: 'onvolumechange',
23432 onWaiting: 'onwaiting',
23433 onZoom: 'onzoom',
23434 overlinePosition: 'overline-position',
23435 overlineThickness: 'overline-thickness',
23436 paintOrder: 'paint-order',
23437 panose1: 'panose-1',
23438 pointerEvents: 'pointer-events',
23439 referrerPolicy: 'referrerpolicy',
23440 renderingIntent: 'rendering-intent',
23441 shapeRendering: 'shape-rendering',
23442 stopColor: 'stop-color',
23443 stopOpacity: 'stop-opacity',
23444 strikethroughPosition: 'strikethrough-position',
23445 strikethroughThickness: 'strikethrough-thickness',
23446 strokeDashArray: 'stroke-dasharray',
23447 strokeDashOffset: 'stroke-dashoffset',
23448 strokeLineCap: 'stroke-linecap',
23449 strokeLineJoin: 'stroke-linejoin',
23450 strokeMiterLimit: 'stroke-miterlimit',
23451 strokeOpacity: 'stroke-opacity',
23452 strokeWidth: 'stroke-width',
23453 tabIndex: 'tabindex',
23454 textAnchor: 'text-anchor',
23455 textDecoration: 'text-decoration',
23456 textRendering: 'text-rendering',
23457 typeOf: 'typeof',
23458 underlinePosition: 'underline-position',
23459 underlineThickness: 'underline-thickness',
23460 unicodeBidi: 'unicode-bidi',
23461 unicodeRange: 'unicode-range',
23462 unitsPerEm: 'units-per-em',
23463 vAlphabetic: 'v-alphabetic',
23464 vHanging: 'v-hanging',
23465 vIdeographic: 'v-ideographic',
23466 vMathematical: 'v-mathematical',
23467 vectorEffect: 'vector-effect',
23468 vertAdvY: 'vert-adv-y',
23469 vertOriginX: 'vert-origin-x',
23470 vertOriginY: 'vert-origin-y',
23471 wordSpacing: 'word-spacing',
23472 writingMode: 'writing-mode',
23473 xHeight: 'x-height',
23474 // These were camelcased in Tiny. Now lowercased in SVG 2
23475 playbackOrder: 'playbackorder',
23476 timelineBegin: 'timelinebegin'
23477 },
23478 transform: _util_case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__.caseSensitiveTransform,
23479 properties: {
23480 about: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23481 accentHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23482 accumulate: null,
23483 additive: null,
23484 alignmentBaseline: null,
23485 alphabetic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23486 amplitude: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23487 arabicForm: null,
23488 ascent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23489 attributeName: null,
23490 attributeType: null,
23491 azimuth: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23492 bandwidth: null,
23493 baselineShift: null,
23494 baseFrequency: null,
23495 baseProfile: null,
23496 bbox: null,
23497 begin: null,
23498 bias: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23499 by: null,
23500 calcMode: null,
23501 capHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23502 className: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23503 clip: null,
23504 clipPath: null,
23505 clipPathUnits: null,
23506 clipRule: null,
23507 color: null,
23508 colorInterpolation: null,
23509 colorInterpolationFilters: null,
23510 colorProfile: null,
23511 colorRendering: null,
23512 content: null,
23513 contentScriptType: null,
23514 contentStyleType: null,
23515 crossOrigin: null,
23516 cursor: null,
23517 cx: null,
23518 cy: null,
23519 d: null,
23520 dataType: null,
23521 defaultAction: null,
23522 descent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23523 diffuseConstant: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23524 direction: null,
23525 display: null,
23526 dur: null,
23527 divisor: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23528 dominantBaseline: null,
23529 download: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean,
23530 dx: null,
23531 dy: null,
23532 edgeMode: null,
23533 editable: null,
23534 elevation: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23535 enableBackground: null,
23536 end: null,
23537 event: null,
23538 exponent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23539 externalResourcesRequired: null,
23540 fill: null,
23541 fillOpacity: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23542 fillRule: null,
23543 filter: null,
23544 filterRes: null,
23545 filterUnits: null,
23546 floodColor: null,
23547 floodOpacity: null,
23548 focusable: null,
23549 focusHighlight: null,
23550 fontFamily: null,
23551 fontSize: null,
23552 fontSizeAdjust: null,
23553 fontStretch: null,
23554 fontStyle: null,
23555 fontVariant: null,
23556 fontWeight: null,
23557 format: null,
23558 fr: null,
23559 from: null,
23560 fx: null,
23561 fy: null,
23562 g1: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated,
23563 g2: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated,
23564 glyphName: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated,
23565 glyphOrientationHorizontal: null,
23566 glyphOrientationVertical: null,
23567 glyphRef: null,
23568 gradientTransform: null,
23569 gradientUnits: null,
23570 handler: null,
23571 hanging: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23572 hatchContentUnits: null,
23573 hatchUnits: null,
23574 height: null,
23575 href: null,
23576 hrefLang: null,
23577 horizAdvX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23578 horizOriginX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23579 horizOriginY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23580 id: null,
23581 ideographic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23582 imageRendering: null,
23583 initialVisibility: null,
23584 in: null,
23585 in2: null,
23586 intercept: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23587 k: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23588 k1: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23589 k2: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23590 k3: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23591 k4: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23592 kernelMatrix: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23593 kernelUnitLength: null,
23594 keyPoints: null, // SEMI_COLON_SEPARATED
23595 keySplines: null, // SEMI_COLON_SEPARATED
23596 keyTimes: null, // SEMI_COLON_SEPARATED
23597 kerning: null,
23598 lang: null,
23599 lengthAdjust: null,
23600 letterSpacing: null,
23601 lightingColor: null,
23602 limitingConeAngle: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23603 local: null,
23604 markerEnd: null,
23605 markerMid: null,
23606 markerStart: null,
23607 markerHeight: null,
23608 markerUnits: null,
23609 markerWidth: null,
23610 mask: null,
23611 maskContentUnits: null,
23612 maskUnits: null,
23613 mathematical: null,
23614 max: null,
23615 media: null,
23616 mediaCharacterEncoding: null,
23617 mediaContentEncodings: null,
23618 mediaSize: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23619 mediaTime: null,
23620 method: null,
23621 min: null,
23622 mode: null,
23623 name: null,
23624 navDown: null,
23625 navDownLeft: null,
23626 navDownRight: null,
23627 navLeft: null,
23628 navNext: null,
23629 navPrev: null,
23630 navRight: null,
23631 navUp: null,
23632 navUpLeft: null,
23633 navUpRight: null,
23634 numOctaves: null,
23635 observer: null,
23636 offset: null,
23637 onAbort: null,
23638 onActivate: null,
23639 onAfterPrint: null,
23640 onBeforePrint: null,
23641 onBegin: null,
23642 onCancel: null,
23643 onCanPlay: null,
23644 onCanPlayThrough: null,
23645 onChange: null,
23646 onClick: null,
23647 onClose: null,
23648 onCopy: null,
23649 onCueChange: null,
23650 onCut: null,
23651 onDblClick: null,
23652 onDrag: null,
23653 onDragEnd: null,
23654 onDragEnter: null,
23655 onDragExit: null,
23656 onDragLeave: null,
23657 onDragOver: null,
23658 onDragStart: null,
23659 onDrop: null,
23660 onDurationChange: null,
23661 onEmptied: null,
23662 onEnd: null,
23663 onEnded: null,
23664 onError: null,
23665 onFocus: null,
23666 onFocusIn: null,
23667 onFocusOut: null,
23668 onHashChange: null,
23669 onInput: null,
23670 onInvalid: null,
23671 onKeyDown: null,
23672 onKeyPress: null,
23673 onKeyUp: null,
23674 onLoad: null,
23675 onLoadedData: null,
23676 onLoadedMetadata: null,
23677 onLoadStart: null,
23678 onMessage: null,
23679 onMouseDown: null,
23680 onMouseEnter: null,
23681 onMouseLeave: null,
23682 onMouseMove: null,
23683 onMouseOut: null,
23684 onMouseOver: null,
23685 onMouseUp: null,
23686 onMouseWheel: null,
23687 onOffline: null,
23688 onOnline: null,
23689 onPageHide: null,
23690 onPageShow: null,
23691 onPaste: null,
23692 onPause: null,
23693 onPlay: null,
23694 onPlaying: null,
23695 onPopState: null,
23696 onProgress: null,
23697 onRateChange: null,
23698 onRepeat: null,
23699 onReset: null,
23700 onResize: null,
23701 onScroll: null,
23702 onSeeked: null,
23703 onSeeking: null,
23704 onSelect: null,
23705 onShow: null,
23706 onStalled: null,
23707 onStorage: null,
23708 onSubmit: null,
23709 onSuspend: null,
23710 onTimeUpdate: null,
23711 onToggle: null,
23712 onUnload: null,
23713 onVolumeChange: null,
23714 onWaiting: null,
23715 onZoom: null,
23716 opacity: null,
23717 operator: null,
23718 order: null,
23719 orient: null,
23720 orientation: null,
23721 origin: null,
23722 overflow: null,
23723 overlay: null,
23724 overlinePosition: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23725 overlineThickness: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23726 paintOrder: null,
23727 panose1: null,
23728 path: null,
23729 pathLength: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23730 patternContentUnits: null,
23731 patternTransform: null,
23732 patternUnits: null,
23733 phase: null,
23734 ping: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated,
23735 pitch: null,
23736 playbackOrder: null,
23737 pointerEvents: null,
23738 points: null,
23739 pointsAtX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23740 pointsAtY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23741 pointsAtZ: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23742 preserveAlpha: null,
23743 preserveAspectRatio: null,
23744 primitiveUnits: null,
23745 propagate: null,
23746 property: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23747 r: null,
23748 radius: null,
23749 referrerPolicy: null,
23750 refX: null,
23751 refY: null,
23752 rel: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23753 rev: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23754 renderingIntent: null,
23755 repeatCount: null,
23756 repeatDur: null,
23757 requiredExtensions: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23758 requiredFeatures: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23759 requiredFonts: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23760 requiredFormats: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23761 resource: null,
23762 restart: null,
23763 result: null,
23764 rotate: null,
23765 rx: null,
23766 ry: null,
23767 scale: null,
23768 seed: null,
23769 shapeRendering: null,
23770 side: null,
23771 slope: null,
23772 snapshotTime: null,
23773 specularConstant: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23774 specularExponent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23775 spreadMethod: null,
23776 spacing: null,
23777 startOffset: null,
23778 stdDeviation: null,
23779 stemh: null,
23780 stemv: null,
23781 stitchTiles: null,
23782 stopColor: null,
23783 stopOpacity: null,
23784 strikethroughPosition: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23785 strikethroughThickness: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23786 string: null,
23787 stroke: null,
23788 strokeDashArray: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23789 strokeDashOffset: null,
23790 strokeLineCap: null,
23791 strokeLineJoin: null,
23792 strokeMiterLimit: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23793 strokeOpacity: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23794 strokeWidth: null,
23795 style: null,
23796 surfaceScale: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23797 syncBehavior: null,
23798 syncBehaviorDefault: null,
23799 syncMaster: null,
23800 syncTolerance: null,
23801 syncToleranceDefault: null,
23802 systemLanguage: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23803 tabIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23804 tableValues: null,
23805 target: null,
23806 targetX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23807 targetY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23808 textAnchor: null,
23809 textDecoration: null,
23810 textRendering: null,
23811 textLength: null,
23812 timelineBegin: null,
23813 title: null,
23814 transformBehavior: null,
23815 type: null,
23816 typeOf: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated,
23817 to: null,
23818 transform: null,
23819 u1: null,
23820 u2: null,
23821 underlinePosition: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23822 underlineThickness: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23823 unicode: null,
23824 unicodeBidi: null,
23825 unicodeRange: null,
23826 unitsPerEm: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23827 values: null,
23828 vAlphabetic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23829 vMathematical: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23830 vectorEffect: null,
23831 vHanging: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23832 vIdeographic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23833 version: null,
23834 vertAdvY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23835 vertOriginX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23836 vertOriginY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23837 viewBox: null,
23838 viewTarget: null,
23839 visibility: null,
23840 width: null,
23841 widths: null,
23842 wordSpacing: null,
23843 writingMode: null,
23844 x: null,
23845 x1: null,
23846 x2: null,
23847 xChannelSelector: null,
23848 xHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number,
23849 y: null,
23850 y1: null,
23851 y2: null,
23852 yChannelSelector: null,
23853 z: null,
23854 zoomAndPan: null
23855 }
23856 })
23857
23858
23859 /***/ }),
23860
23861 /***/ "../node_modules/property-information/lib/util/case-insensitive-transform.js":
23862 /*!***********************************************************************************!*\
23863 !*** ../node_modules/property-information/lib/util/case-insensitive-transform.js ***!
23864 \***********************************************************************************/
23865 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
23866
23867 "use strict";
23868 __webpack_require__.r(__webpack_exports__);
23869 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23870 /* harmony export */ "caseInsensitiveTransform": () => (/* binding */ caseInsensitiveTransform)
23871 /* harmony export */ });
23872 /* harmony import */ var _case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./case-sensitive-transform.js */ "../node_modules/property-information/lib/util/case-sensitive-transform.js");
23873
23874
23875 /**
23876 * @param {Record<string, string>} attributes
23877 * @param {string} property
23878 * @returns {string}
23879 */
23880 function caseInsensitiveTransform(attributes, property) {
23881 return (0,_case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_0__.caseSensitiveTransform)(attributes, property.toLowerCase())
23882 }
23883
23884
23885 /***/ }),
23886
23887 /***/ "../node_modules/property-information/lib/util/case-sensitive-transform.js":
23888 /*!*********************************************************************************!*\
23889 !*** ../node_modules/property-information/lib/util/case-sensitive-transform.js ***!
23890 \*********************************************************************************/
23891 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
23892
23893 "use strict";
23894 __webpack_require__.r(__webpack_exports__);
23895 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23896 /* harmony export */ "caseSensitiveTransform": () => (/* binding */ caseSensitiveTransform)
23897 /* harmony export */ });
23898 /**
23899 * @param {Record<string, string>} attributes
23900 * @param {string} attribute
23901 * @returns {string}
23902 */
23903 function caseSensitiveTransform(attributes, attribute) {
23904 return attribute in attributes ? attributes[attribute] : attribute
23905 }
23906
23907
23908 /***/ }),
23909
23910 /***/ "../node_modules/property-information/lib/util/create.js":
23911 /*!***************************************************************!*\
23912 !*** ../node_modules/property-information/lib/util/create.js ***!
23913 \***************************************************************/
23914 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
23915
23916 "use strict";
23917 __webpack_require__.r(__webpack_exports__);
23918 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23919 /* harmony export */ "create": () => (/* binding */ create)
23920 /* harmony export */ });
23921 /* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../normalize.js */ "../node_modules/property-information/lib/normalize.js");
23922 /* harmony import */ var _schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schema.js */ "../node_modules/property-information/lib/util/schema.js");
23923 /* harmony import */ var _defined_info_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defined-info.js */ "../node_modules/property-information/lib/util/defined-info.js");
23924 /**
23925 * @typedef {import('./schema.js').Properties} Properties
23926 * @typedef {import('./schema.js').Normal} Normal
23927 *
23928 * @typedef {Record<string, string>} Attributes
23929 *
23930 * @typedef {Object} Definition
23931 * @property {Record<string, number|null>} properties
23932 * @property {(attributes: Attributes, property: string) => string} transform
23933 * @property {string} [space]
23934 * @property {Attributes} [attributes]
23935 * @property {Array<string>} [mustUseProperty]
23936 */
23937
23938
23939
23940
23941
23942 const own = {}.hasOwnProperty
23943
23944 /**
23945 * @param {Definition} definition
23946 * @returns {Schema}
23947 */
23948 function create(definition) {
23949 /** @type {Properties} */
23950 const property = {}
23951 /** @type {Normal} */
23952 const normal = {}
23953 /** @type {string} */
23954 let prop
23955
23956 for (prop in definition.properties) {
23957 if (own.call(definition.properties, prop)) {
23958 const value = definition.properties[prop]
23959 const info = new _defined_info_js__WEBPACK_IMPORTED_MODULE_0__.DefinedInfo(
23960 prop,
23961 definition.transform(definition.attributes || {}, prop),
23962 value,
23963 definition.space
23964 )
23965
23966 if (
23967 definition.mustUseProperty &&
23968 definition.mustUseProperty.includes(prop)
23969 ) {
23970 info.mustUseProperty = true
23971 }
23972
23973 property[prop] = info
23974
23975 normal[(0,_normalize_js__WEBPACK_IMPORTED_MODULE_1__.normalize)(prop)] = prop
23976 normal[(0,_normalize_js__WEBPACK_IMPORTED_MODULE_1__.normalize)(info.attribute)] = prop
23977 }
23978 }
23979
23980 return new _schema_js__WEBPACK_IMPORTED_MODULE_2__.Schema(property, normal, definition.space)
23981 }
23982
23983
23984 /***/ }),
23985
23986 /***/ "../node_modules/property-information/lib/util/defined-info.js":
23987 /*!*********************************************************************!*\
23988 !*** ../node_modules/property-information/lib/util/defined-info.js ***!
23989 \*********************************************************************/
23990 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
23991
23992 "use strict";
23993 __webpack_require__.r(__webpack_exports__);
23994 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23995 /* harmony export */ "DefinedInfo": () => (/* binding */ DefinedInfo)
23996 /* harmony export */ });
23997 /* harmony import */ var _info_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./info.js */ "../node_modules/property-information/lib/util/info.js");
23998 /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ "../node_modules/property-information/lib/util/types.js");
23999
24000
24001
24002 /** @type {Array<keyof types>} */
24003 // @ts-expect-error: hush.
24004 const checks = Object.keys(_types_js__WEBPACK_IMPORTED_MODULE_0__)
24005
24006 class DefinedInfo extends _info_js__WEBPACK_IMPORTED_MODULE_1__.Info {
24007 /**
24008 * @constructor
24009 * @param {string} property
24010 * @param {string} attribute
24011 * @param {number|null} [mask]
24012 * @param {string} [space]
24013 */
24014 constructor(property, attribute, mask, space) {
24015 let index = -1
24016
24017 super(property, attribute)
24018
24019 mark(this, 'space', space)
24020
24021 if (typeof mask === 'number') {
24022 while (++index < checks.length) {
24023 const check = checks[index]
24024 mark(this, checks[index], (mask & _types_js__WEBPACK_IMPORTED_MODULE_0__[check]) === _types_js__WEBPACK_IMPORTED_MODULE_0__[check])
24025 }
24026 }
24027 }
24028 }
24029
24030 DefinedInfo.prototype.defined = true
24031
24032 /**
24033 * @param {DefinedInfo} values
24034 * @param {string} key
24035 * @param {unknown} value
24036 */
24037 function mark(values, key, value) {
24038 if (value) {
24039 // @ts-expect-error: assume `value` matches the expected value of `key`.
24040 values[key] = value
24041 }
24042 }
24043
24044
24045 /***/ }),
24046
24047 /***/ "../node_modules/property-information/lib/util/info.js":
24048 /*!*************************************************************!*\
24049 !*** ../node_modules/property-information/lib/util/info.js ***!
24050 \*************************************************************/
24051 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24052
24053 "use strict";
24054 __webpack_require__.r(__webpack_exports__);
24055 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24056 /* harmony export */ "Info": () => (/* binding */ Info)
24057 /* harmony export */ });
24058 class Info {
24059 /**
24060 * @constructor
24061 * @param {string} property
24062 * @param {string} attribute
24063 */
24064 constructor(property, attribute) {
24065 /** @type {string} */
24066 this.property = property
24067 /** @type {string} */
24068 this.attribute = attribute
24069 }
24070 }
24071
24072 /** @type {string|null} */
24073 Info.prototype.space = null
24074 Info.prototype.boolean = false
24075 Info.prototype.booleanish = false
24076 Info.prototype.overloadedBoolean = false
24077 Info.prototype.number = false
24078 Info.prototype.commaSeparated = false
24079 Info.prototype.spaceSeparated = false
24080 Info.prototype.commaOrSpaceSeparated = false
24081 Info.prototype.mustUseProperty = false
24082 Info.prototype.defined = false
24083
24084
24085 /***/ }),
24086
24087 /***/ "../node_modules/property-information/lib/util/merge.js":
24088 /*!**************************************************************!*\
24089 !*** ../node_modules/property-information/lib/util/merge.js ***!
24090 \**************************************************************/
24091 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24092
24093 "use strict";
24094 __webpack_require__.r(__webpack_exports__);
24095 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24096 /* harmony export */ "merge": () => (/* binding */ merge)
24097 /* harmony export */ });
24098 /* harmony import */ var _schema_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schema.js */ "../node_modules/property-information/lib/util/schema.js");
24099 /**
24100 * @typedef {import('./schema.js').Properties} Properties
24101 * @typedef {import('./schema.js').Normal} Normal
24102 */
24103
24104
24105
24106 /**
24107 * @param {Schema[]} definitions
24108 * @param {string} [space]
24109 * @returns {Schema}
24110 */
24111 function merge(definitions, space) {
24112 /** @type {Properties} */
24113 const property = {}
24114 /** @type {Normal} */
24115 const normal = {}
24116 let index = -1
24117
24118 while (++index < definitions.length) {
24119 Object.assign(property, definitions[index].property)
24120 Object.assign(normal, definitions[index].normal)
24121 }
24122
24123 return new _schema_js__WEBPACK_IMPORTED_MODULE_0__.Schema(property, normal, space)
24124 }
24125
24126
24127 /***/ }),
24128
24129 /***/ "../node_modules/property-information/lib/util/schema.js":
24130 /*!***************************************************************!*\
24131 !*** ../node_modules/property-information/lib/util/schema.js ***!
24132 \***************************************************************/
24133 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24134
24135 "use strict";
24136 __webpack_require__.r(__webpack_exports__);
24137 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24138 /* harmony export */ "Schema": () => (/* binding */ Schema)
24139 /* harmony export */ });
24140 /**
24141 * @typedef {import('./info.js').Info} Info
24142 * @typedef {Record<string, Info>} Properties
24143 * @typedef {Record<string, string>} Normal
24144 */
24145
24146 class Schema {
24147 /**
24148 * @constructor
24149 * @param {Properties} property
24150 * @param {Normal} normal
24151 * @param {string} [space]
24152 */
24153 constructor(property, normal, space) {
24154 this.property = property
24155 this.normal = normal
24156 if (space) {
24157 this.space = space
24158 }
24159 }
24160 }
24161
24162 /** @type {Properties} */
24163 Schema.prototype.property = {}
24164 /** @type {Normal} */
24165 Schema.prototype.normal = {}
24166 /** @type {string|null} */
24167 Schema.prototype.space = null
24168
24169
24170 /***/ }),
24171
24172 /***/ "../node_modules/property-information/lib/util/types.js":
24173 /*!**************************************************************!*\
24174 !*** ../node_modules/property-information/lib/util/types.js ***!
24175 \**************************************************************/
24176 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24177
24178 "use strict";
24179 __webpack_require__.r(__webpack_exports__);
24180 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24181 /* harmony export */ "boolean": () => (/* binding */ boolean),
24182 /* harmony export */ "booleanish": () => (/* binding */ booleanish),
24183 /* harmony export */ "commaOrSpaceSeparated": () => (/* binding */ commaOrSpaceSeparated),
24184 /* harmony export */ "commaSeparated": () => (/* binding */ commaSeparated),
24185 /* harmony export */ "number": () => (/* binding */ number),
24186 /* harmony export */ "overloadedBoolean": () => (/* binding */ overloadedBoolean),
24187 /* harmony export */ "spaceSeparated": () => (/* binding */ spaceSeparated)
24188 /* harmony export */ });
24189 let powers = 0
24190
24191 const boolean = increment()
24192 const booleanish = increment()
24193 const overloadedBoolean = increment()
24194 const number = increment()
24195 const spaceSeparated = increment()
24196 const commaSeparated = increment()
24197 const commaOrSpaceSeparated = increment()
24198
24199 function increment() {
24200 return 2 ** ++powers
24201 }
24202
24203
24204 /***/ }),
24205
24206 /***/ "../node_modules/property-information/lib/xlink.js":
24207 /*!*********************************************************!*\
24208 !*** ../node_modules/property-information/lib/xlink.js ***!
24209 \*********************************************************/
24210 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24211
24212 "use strict";
24213 __webpack_require__.r(__webpack_exports__);
24214 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24215 /* harmony export */ "xlink": () => (/* binding */ xlink)
24216 /* harmony export */ });
24217 /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js");
24218
24219
24220 const xlink = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({
24221 space: 'xlink',
24222 transform(_, prop) {
24223 return 'xlink:' + prop.slice(5).toLowerCase()
24224 },
24225 properties: {
24226 xLinkActuate: null,
24227 xLinkArcRole: null,
24228 xLinkHref: null,
24229 xLinkRole: null,
24230 xLinkShow: null,
24231 xLinkTitle: null,
24232 xLinkType: null
24233 }
24234 })
24235
24236
24237 /***/ }),
24238
24239 /***/ "../node_modules/property-information/lib/xml.js":
24240 /*!*******************************************************!*\
24241 !*** ../node_modules/property-information/lib/xml.js ***!
24242 \*******************************************************/
24243 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24244
24245 "use strict";
24246 __webpack_require__.r(__webpack_exports__);
24247 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24248 /* harmony export */ "xml": () => (/* binding */ xml)
24249 /* harmony export */ });
24250 /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js");
24251
24252
24253 const xml = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({
24254 space: 'xml',
24255 transform(_, prop) {
24256 return 'xml:' + prop.slice(3).toLowerCase()
24257 },
24258 properties: {xmlLang: null, xmlBase: null, xmlSpace: null}
24259 })
24260
24261
24262 /***/ }),
24263
24264 /***/ "../node_modules/property-information/lib/xmlns.js":
24265 /*!*********************************************************!*\
24266 !*** ../node_modules/property-information/lib/xmlns.js ***!
24267 \*********************************************************/
24268 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24269
24270 "use strict";
24271 __webpack_require__.r(__webpack_exports__);
24272 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24273 /* harmony export */ "xmlns": () => (/* binding */ xmlns)
24274 /* harmony export */ });
24275 /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js");
24276 /* harmony import */ var _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/case-insensitive-transform.js */ "../node_modules/property-information/lib/util/case-insensitive-transform.js");
24277
24278
24279
24280 const xmlns = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({
24281 space: 'xmlns',
24282 attributes: {xmlnsxlink: 'xmlns:xlink'},
24283 transform: _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__.caseInsensitiveTransform,
24284 properties: {xmlns: null, xmlnsXLink: null}
24285 })
24286
24287
24288 /***/ }),
24289
24290 /***/ "../node_modules/react-markdown/index.js":
24291 /*!***********************************************!*\
24292 !*** ../node_modules/react-markdown/index.js ***!
24293 \***********************************************/
24294 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24295
24296 "use strict";
24297 __webpack_require__.r(__webpack_exports__);
24298 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24299 /* harmony export */ "default": () => (/* reexport safe */ _lib_react_markdown_js__WEBPACK_IMPORTED_MODULE_1__.ReactMarkdown),
24300 /* harmony export */ "uriTransformer": () => (/* reexport safe */ _lib_uri_transformer_js__WEBPACK_IMPORTED_MODULE_0__.uriTransformer)
24301 /* harmony export */ });
24302 /* harmony import */ var _lib_uri_transformer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/uri-transformer.js */ "../node_modules/react-markdown/lib/uri-transformer.js");
24303 /* harmony import */ var _lib_react_markdown_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/react-markdown.js */ "../node_modules/react-markdown/lib/react-markdown.js");
24304 /**
24305 * @typedef {import('./lib/react-markdown.js').ReactMarkdownOptions} Options
24306 * @typedef {import('./lib/ast-to-react.js').Components} Components
24307 */
24308
24309
24310
24311
24312
24313
24314 /***/ }),
24315
24316 /***/ "../node_modules/react-markdown/lib/ast-to-react.js":
24317 /*!**********************************************************!*\
24318 !*** ../node_modules/react-markdown/lib/ast-to-react.js ***!
24319 \**********************************************************/
24320 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24321
24322 "use strict";
24323 __webpack_require__.r(__webpack_exports__);
24324 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24325 /* harmony export */ "childrenToReact": () => (/* binding */ childrenToReact)
24326 /* harmony export */ });
24327 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
24328 /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-is */ "../node_modules/react-is/index.js");
24329 /* harmony import */ var hast_util_whitespace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! hast-util-whitespace */ "../node_modules/hast-util-whitespace/index.js");
24330 /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/index.js");
24331 /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/lib/find.js");
24332 /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/lib/hast-to-react.js");
24333 /* harmony import */ var space_separated_tokens__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! space-separated-tokens */ "../node_modules/space-separated-tokens/index.js");
24334 /* harmony import */ var comma_separated_tokens__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! comma-separated-tokens */ "../node_modules/comma-separated-tokens/index.js");
24335 /* harmony import */ var style_to_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! style-to-object */ "../node_modules/style-to-object/index.mjs");
24336 /* harmony import */ var _uri_transformer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uri-transformer.js */ "../node_modules/react-markdown/lib/uri-transformer.js");
24337 /**
24338 * @template T
24339 * @typedef {import('react').ComponentType<T>} ComponentType<T>
24340 */
24341
24342 /**
24343 * @template {import('react').ElementType} T
24344 * @typedef {import('react').ComponentPropsWithoutRef<T>} ComponentPropsWithoutRef<T>
24345 */
24346
24347 /**
24348 * @typedef {import('react').ReactNode} ReactNode
24349 * @typedef {import('unist').Position} Position
24350 * @typedef {import('hast').Element} Element
24351 * @typedef {import('hast').ElementContent} ElementContent
24352 * @typedef {import('hast').Root} Root
24353 * @typedef {import('hast').Text} Text
24354 * @typedef {import('hast').Comment} Comment
24355 * @typedef {import('hast').DocType} Doctype
24356 * @typedef {import('property-information').Info} Info
24357 * @typedef {import('property-information').Schema} Schema
24358 * @typedef {import('./complex-types.js').ReactMarkdownProps} ReactMarkdownProps
24359 *
24360 * @typedef Raw
24361 * @property {'raw'} type
24362 * @property {string} value
24363 *
24364 * @typedef Context
24365 * @property {Options} options
24366 * @property {Schema} schema
24367 * @property {number} listDepth
24368 *
24369 * @callback TransformLink
24370 * @param {string} href
24371 * @param {Array<ElementContent>} children
24372 * @param {string?} title
24373 * @returns {string}
24374 *
24375 * @callback TransformImage
24376 * @param {string} src
24377 * @param {string} alt
24378 * @param {string?} title
24379 * @returns {string}
24380 *
24381 * @typedef {import('react').HTMLAttributeAnchorTarget} TransformLinkTargetType
24382 *
24383 * @callback TransformLinkTarget
24384 * @param {string} href
24385 * @param {Array<ElementContent>} children
24386 * @param {string?} title
24387 * @returns {TransformLinkTargetType|undefined}
24388 *
24389 * @typedef {keyof JSX.IntrinsicElements} ReactMarkdownNames
24390 *
24391 * To do: is `data-sourcepos` typeable?
24392 *
24393 * @typedef {ComponentPropsWithoutRef<'code'> & ReactMarkdownProps & {inline?: boolean}} CodeProps
24394 * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps
24395 * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps
24396 * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps
24397 * @typedef {ComponentPropsWithoutRef<'td'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: false}} TableDataCellProps
24398 * @typedef {ComponentPropsWithoutRef<'th'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: true}} TableHeaderCellProps
24399 * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps
24400 * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps
24401 *
24402 * @typedef {ComponentType<CodeProps>} CodeComponent
24403 * @typedef {ComponentType<HeadingProps>} HeadingComponent
24404 * @typedef {ComponentType<LiProps>} LiComponent
24405 * @typedef {ComponentType<OrderedListProps>} OrderedListComponent
24406 * @typedef {ComponentType<TableDataCellProps>} TableDataCellComponent
24407 * @typedef {ComponentType<TableHeaderCellProps>} TableHeaderCellComponent
24408 * @typedef {ComponentType<TableRowProps>} TableRowComponent
24409 * @typedef {ComponentType<UnorderedListProps>} UnorderedListComponent
24410 *
24411 * @typedef SpecialComponents
24412 * @property {CodeComponent|ReactMarkdownNames} code
24413 * @property {HeadingComponent|ReactMarkdownNames} h1
24414 * @property {HeadingComponent|ReactMarkdownNames} h2
24415 * @property {HeadingComponent|ReactMarkdownNames} h3
24416 * @property {HeadingComponent|ReactMarkdownNames} h4
24417 * @property {HeadingComponent|ReactMarkdownNames} h5
24418 * @property {HeadingComponent|ReactMarkdownNames} h6
24419 * @property {LiComponent|ReactMarkdownNames} li
24420 * @property {OrderedListComponent|ReactMarkdownNames} ol
24421 * @property {TableDataCellComponent|ReactMarkdownNames} td
24422 * @property {TableHeaderCellComponent|ReactMarkdownNames} th
24423 * @property {TableRowComponent|ReactMarkdownNames} tr
24424 * @property {UnorderedListComponent|ReactMarkdownNames} ul
24425 *
24426 * @typedef {Partial<Omit<import('./complex-types.js').NormalComponents, keyof SpecialComponents> & SpecialComponents>} Components
24427 *
24428 * @typedef Options
24429 * @property {boolean} [sourcePos=false]
24430 * @property {boolean} [rawSourcePos=false]
24431 * @property {boolean} [skipHtml=false]
24432 * @property {boolean} [includeElementIndex=false]
24433 * @property {null|false|TransformLink} [transformLinkUri]
24434 * @property {TransformImage} [transformImageUri]
24435 * @property {TransformLinkTargetType|TransformLinkTarget} [linkTarget]
24436 * @property {Components} [components]
24437 */
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448 const own = {}.hasOwnProperty
24449
24450 // The table-related elements that must not contain whitespace text according
24451 // to React.
24452 const tableElements = new Set(['table', 'thead', 'tbody', 'tfoot', 'tr'])
24453
24454 /**
24455 * @param {Context} context
24456 * @param {Element|Root} node
24457 */
24458 function childrenToReact(context, node) {
24459 /** @type {Array<ReactNode>} */
24460 const children = []
24461 let childIndex = -1
24462 /** @type {Comment|Doctype|Element|Raw|Text} */
24463 let child
24464
24465 while (++childIndex < node.children.length) {
24466 child = node.children[childIndex]
24467
24468 if (child.type === 'element') {
24469 children.push(toReact(context, child, childIndex, node))
24470 } else if (child.type === 'text') {
24471 // Currently, a warning is triggered by react for *any* white space in
24472 // tables.
24473 // So we drop it.
24474 // See: <https://github.com/facebook/react/pull/7081>.
24475 // See: <https://github.com/facebook/react/pull/7515>.
24476 // See: <https://github.com/remarkjs/remark-react/issues/64>.
24477 // See: <https://github.com/remarkjs/react-markdown/issues/576>.
24478 if (
24479 node.type !== 'element' ||
24480 !tableElements.has(node.tagName) ||
24481 !(0,hast_util_whitespace__WEBPACK_IMPORTED_MODULE_3__.whitespace)(child)
24482 ) {
24483 children.push(child.value)
24484 }
24485 } else if (child.type === 'raw' && !context.options.skipHtml) {
24486 // Default behavior is to show (encoded) HTML.
24487 children.push(child.value)
24488 }
24489 }
24490
24491 return children
24492 }
24493
24494 /**
24495 * @param {Context} context
24496 * @param {Element} node
24497 * @param {number} index
24498 * @param {Element|Root} parent
24499 */
24500 function toReact(context, node, index, parent) {
24501 const options = context.options
24502 const transform =
24503 options.transformLinkUri === undefined
24504 ? _uri_transformer_js__WEBPACK_IMPORTED_MODULE_4__.uriTransformer
24505 : options.transformLinkUri
24506 const parentSchema = context.schema
24507 /** @type {ReactMarkdownNames} */
24508 // @ts-expect-error assume a known HTML/SVG element.
24509 const name = node.tagName
24510 /** @type {Record<string, unknown>} */
24511 const properties = {}
24512 let schema = parentSchema
24513 /** @type {string} */
24514 let property
24515
24516 if (parentSchema.space === 'html' && name === 'svg') {
24517 schema = property_information__WEBPACK_IMPORTED_MODULE_5__.svg
24518 context.schema = schema
24519 }
24520
24521 if (node.properties) {
24522 for (property in node.properties) {
24523 if (own.call(node.properties, property)) {
24524 addProperty(properties, property, node.properties[property], context)
24525 }
24526 }
24527 }
24528
24529 if (name === 'ol' || name === 'ul') {
24530 context.listDepth++
24531 }
24532
24533 const children = childrenToReact(context, node)
24534
24535 if (name === 'ol' || name === 'ul') {
24536 context.listDepth--
24537 }
24538
24539 // Restore parent schema.
24540 context.schema = parentSchema
24541
24542 // Nodes created by plugins do not have positional info, in which case we use
24543 // an object that matches the position interface.
24544 const position = node.position || {
24545 start: {line: null, column: null, offset: null},
24546 end: {line: null, column: null, offset: null}
24547 }
24548 const component =
24549 options.components && own.call(options.components, name)
24550 ? options.components[name]
24551 : name
24552 const basic = typeof component === 'string' || component === react__WEBPACK_IMPORTED_MODULE_0__.Fragment
24553
24554 if (!react_is__WEBPACK_IMPORTED_MODULE_1__.isValidElementType(component)) {
24555 throw new TypeError(
24556 `Component for name \`${name}\` not defined or is not renderable`
24557 )
24558 }
24559
24560 properties.key = index
24561
24562 if (name === 'a' && options.linkTarget) {
24563 properties.target =
24564 typeof options.linkTarget === 'function'
24565 ? options.linkTarget(
24566 String(properties.href || ''),
24567 node.children,
24568 typeof properties.title === 'string' ? properties.title : null
24569 )
24570 : options.linkTarget
24571 }
24572
24573 if (name === 'a' && transform) {
24574 properties.href = transform(
24575 String(properties.href || ''),
24576 node.children,
24577 typeof properties.title === 'string' ? properties.title : null
24578 )
24579 }
24580
24581 if (
24582 !basic &&
24583 name === 'code' &&
24584 parent.type === 'element' &&
24585 parent.tagName !== 'pre'
24586 ) {
24587 properties.inline = true
24588 }
24589
24590 if (
24591 !basic &&
24592 (name === 'h1' ||
24593 name === 'h2' ||
24594 name === 'h3' ||
24595 name === 'h4' ||
24596 name === 'h5' ||
24597 name === 'h6')
24598 ) {
24599 properties.level = Number.parseInt(name.charAt(1), 10)
24600 }
24601
24602 if (name === 'img' && options.transformImageUri) {
24603 properties.src = options.transformImageUri(
24604 String(properties.src || ''),
24605 String(properties.alt || ''),
24606 typeof properties.title === 'string' ? properties.title : null
24607 )
24608 }
24609
24610 if (!basic && name === 'li' && parent.type === 'element') {
24611 const input = getInputElement(node)
24612 properties.checked =
24613 input && input.properties ? Boolean(input.properties.checked) : null
24614 properties.index = getElementsBeforeCount(parent, node)
24615 properties.ordered = parent.tagName === 'ol'
24616 }
24617
24618 if (!basic && (name === 'ol' || name === 'ul')) {
24619 properties.ordered = name === 'ol'
24620 properties.depth = context.listDepth
24621 }
24622
24623 if (name === 'td' || name === 'th') {
24624 if (properties.align) {
24625 if (!properties.style) properties.style = {}
24626 // @ts-expect-error assume `style` is an object
24627 properties.style.textAlign = properties.align
24628 delete properties.align
24629 }
24630
24631 if (!basic) {
24632 properties.isHeader = name === 'th'
24633 }
24634 }
24635
24636 if (!basic && name === 'tr' && parent.type === 'element') {
24637 properties.isHeader = Boolean(parent.tagName === 'thead')
24638 }
24639
24640 // If `sourcePos` is given, pass source information (line/column info from markdown source).
24641 if (options.sourcePos) {
24642 properties['data-sourcepos'] = flattenPosition(position)
24643 }
24644
24645 if (!basic && options.rawSourcePos) {
24646 properties.sourcePosition = node.position
24647 }
24648
24649 // If `includeElementIndex` is given, pass node index info to components.
24650 if (!basic && options.includeElementIndex) {
24651 properties.index = getElementsBeforeCount(parent, node)
24652 properties.siblingCount = getElementsBeforeCount(parent)
24653 }
24654
24655 if (!basic) {
24656 properties.node = node
24657 }
24658
24659 // Ensure no React warnings are emitted for void elements w/ children.
24660 return children.length > 0
24661 ? react__WEBPACK_IMPORTED_MODULE_0__.createElement(component, properties, children)
24662 : react__WEBPACK_IMPORTED_MODULE_0__.createElement(component, properties)
24663 }
24664
24665 /**
24666 * @param {Element|Root} node
24667 * @returns {Element?}
24668 */
24669 function getInputElement(node) {
24670 let index = -1
24671
24672 while (++index < node.children.length) {
24673 const child = node.children[index]
24674
24675 if (child.type === 'element' && child.tagName === 'input') {
24676 return child
24677 }
24678 }
24679
24680 return null
24681 }
24682
24683 /**
24684 * @param {Element|Root} parent
24685 * @param {Element} [node]
24686 * @returns {number}
24687 */
24688 function getElementsBeforeCount(parent, node) {
24689 let index = -1
24690 let count = 0
24691
24692 while (++index < parent.children.length) {
24693 if (parent.children[index] === node) break
24694 if (parent.children[index].type === 'element') count++
24695 }
24696
24697 return count
24698 }
24699
24700 /**
24701 * @param {Record<string, unknown>} props
24702 * @param {string} prop
24703 * @param {unknown} value
24704 * @param {Context} ctx
24705 */
24706 function addProperty(props, prop, value, ctx) {
24707 const info = (0,property_information__WEBPACK_IMPORTED_MODULE_6__.find)(ctx.schema, prop)
24708 let result = value
24709
24710 // Ignore nullish and `NaN` values.
24711 // eslint-disable-next-line no-self-compare
24712 if (result === null || result === undefined || result !== result) {
24713 return
24714 }
24715
24716 // Accept `array`.
24717 // Most props are space-separated.
24718 if (Array.isArray(result)) {
24719 result = info.commaSeparated ? (0,comma_separated_tokens__WEBPACK_IMPORTED_MODULE_7__.stringify)(result) : (0,space_separated_tokens__WEBPACK_IMPORTED_MODULE_8__.stringify)(result)
24720 }
24721
24722 if (info.property === 'style' && typeof result === 'string') {
24723 result = parseStyle(result)
24724 }
24725
24726 if (info.space && info.property) {
24727 props[
24728 own.call(property_information__WEBPACK_IMPORTED_MODULE_9__.hastToReact, info.property)
24729 ? property_information__WEBPACK_IMPORTED_MODULE_9__.hastToReact[info.property]
24730 : info.property
24731 ] = result
24732 } else if (info.attribute) {
24733 props[info.attribute] = result
24734 }
24735 }
24736
24737 /**
24738 * @param {string} value
24739 * @returns {Record<string, string>}
24740 */
24741 function parseStyle(value) {
24742 /** @type {Record<string, string>} */
24743 const result = {}
24744
24745 try {
24746 ;(0,style_to_object__WEBPACK_IMPORTED_MODULE_2__["default"])(value, iterator)
24747 } catch {
24748 // Silent.
24749 }
24750
24751 return result
24752
24753 /**
24754 * @param {string} name
24755 * @param {string} v
24756 */
24757 function iterator(name, v) {
24758 const k = name.slice(0, 4) === '-ms-' ? `ms-${name.slice(4)}` : name
24759 result[k.replace(/-([a-z])/g, styleReplacer)] = v
24760 }
24761 }
24762
24763 /**
24764 * @param {unknown} _
24765 * @param {string} $1
24766 */
24767 function styleReplacer(_, $1) {
24768 return $1.toUpperCase()
24769 }
24770
24771 /**
24772 * @param {Position|{start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null}}} pos
24773 * @returns {string}
24774 */
24775 function flattenPosition(pos) {
24776 return [
24777 pos.start.line,
24778 ':',
24779 pos.start.column,
24780 '-',
24781 pos.end.line,
24782 ':',
24783 pos.end.column
24784 ]
24785 .map(String)
24786 .join('')
24787 }
24788
24789
24790 /***/ }),
24791
24792 /***/ "../node_modules/react-markdown/lib/react-markdown.js":
24793 /*!************************************************************!*\
24794 !*** ../node_modules/react-markdown/lib/react-markdown.js ***!
24795 \************************************************************/
24796 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24797
24798 "use strict";
24799 __webpack_require__.r(__webpack_exports__);
24800 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24801 /* harmony export */ "ReactMarkdown": () => (/* binding */ ReactMarkdown)
24802 /* harmony export */ });
24803 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
24804 /* harmony import */ var vfile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vfile */ "../node_modules/vfile/lib/index.js");
24805 /* harmony import */ var unified__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! unified */ "../node_modules/unified/lib/index.js");
24806 /* harmony import */ var remark_parse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! remark-parse */ "../node_modules/remark-parse/index.js");
24807 /* harmony import */ var remark_rehype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! remark-rehype */ "../node_modules/remark-rehype/lib/index.js");
24808 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
24809 /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/index.js");
24810 /* harmony import */ var _rehype_filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rehype-filter.js */ "../node_modules/react-markdown/lib/rehype-filter.js");
24811 /* harmony import */ var _ast_to_react_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ast-to-react.js */ "../node_modules/react-markdown/lib/ast-to-react.js");
24812 /**
24813 * @typedef {import('react').ReactNode} ReactNode
24814 * @typedef {import('react').ReactElement<{}>} ReactElement
24815 * @typedef {import('unified').PluggableList} PluggableList
24816 * @typedef {import('hast').Root} Root
24817 * @typedef {import('./rehype-filter.js').Options} FilterOptions
24818 * @typedef {import('./ast-to-react.js').Options} TransformOptions
24819 *
24820 * @typedef CoreOptions
24821 * @property {string} children
24822 *
24823 * @typedef PluginOptions
24824 * @property {PluggableList} [remarkPlugins=[]]
24825 * @property {PluggableList} [rehypePlugins=[]]
24826 * @property {import('remark-rehype').Options | undefined} [remarkRehypeOptions={}]
24827 *
24828 * @typedef LayoutOptions
24829 * @property {string} [className]
24830 *
24831 * @typedef {CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions} ReactMarkdownOptions
24832 *
24833 * @typedef Deprecation
24834 * @property {string} id
24835 * @property {string} [to]
24836 */
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848 const own = {}.hasOwnProperty
24849 const changelog =
24850 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'
24851
24852 /** @type {Record<string, Deprecation>} */
24853 const deprecated = {
24854 plugins: {to: 'remarkPlugins', id: 'change-plugins-to-remarkplugins'},
24855 renderers: {to: 'components', id: 'change-renderers-to-components'},
24856 astPlugins: {id: 'remove-buggy-html-in-markdown-parser'},
24857 allowDangerousHtml: {id: 'remove-buggy-html-in-markdown-parser'},
24858 escapeHtml: {id: 'remove-buggy-html-in-markdown-parser'},
24859 source: {to: 'children', id: 'change-source-to-children'},
24860 allowNode: {
24861 to: 'allowElement',
24862 id: 'replace-allownode-allowedtypes-and-disallowedtypes'
24863 },
24864 allowedTypes: {
24865 to: 'allowedElements',
24866 id: 'replace-allownode-allowedtypes-and-disallowedtypes'
24867 },
24868 disallowedTypes: {
24869 to: 'disallowedElements',
24870 id: 'replace-allownode-allowedtypes-and-disallowedtypes'
24871 },
24872 includeNodeIndex: {
24873 to: 'includeElementIndex',
24874 id: 'change-includenodeindex-to-includeelementindex'
24875 }
24876 }
24877
24878 /**
24879 * React component to render markdown.
24880 *
24881 * @param {ReactMarkdownOptions} options
24882 * @returns {ReactElement}
24883 */
24884 function ReactMarkdown(options) {
24885 for (const key in deprecated) {
24886 if (own.call(deprecated, key) && own.call(options, key)) {
24887 const deprecation = deprecated[key]
24888 console.warn(
24889 `[react-markdown] Warning: please ${
24890 deprecation.to ? `use \`${deprecation.to}\` instead of` : 'remove'
24891 } \`${key}\` (see <${changelog}#${deprecation.id}> for more info)`
24892 )
24893 delete deprecated[key]
24894 }
24895 }
24896
24897 const processor = (0,unified__WEBPACK_IMPORTED_MODULE_1__.unified)()
24898 .use(remark_parse__WEBPACK_IMPORTED_MODULE_2__["default"])
24899 .use(options.remarkPlugins || [])
24900 .use(remark_rehype__WEBPACK_IMPORTED_MODULE_3__["default"], {
24901 ...options.remarkRehypeOptions,
24902 allowDangerousHtml: true
24903 })
24904 .use(options.rehypePlugins || [])
24905 .use(_rehype_filter_js__WEBPACK_IMPORTED_MODULE_4__["default"], options)
24906
24907 const file = new vfile__WEBPACK_IMPORTED_MODULE_5__.VFile()
24908
24909 if (typeof options.children === 'string') {
24910 file.value = options.children
24911 } else if (options.children !== undefined && options.children !== null) {
24912 console.warn(
24913 `[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)`
24914 )
24915 }
24916
24917 const hastNode = processor.runSync(processor.parse(file), file)
24918
24919 if (hastNode.type !== 'root') {
24920 throw new TypeError('Expected a `root` node')
24921 }
24922
24923 /** @type {ReactElement} */
24924 let result = react__WEBPACK_IMPORTED_MODULE_0__.createElement(
24925 react__WEBPACK_IMPORTED_MODULE_0__.Fragment,
24926 {},
24927 (0,_ast_to_react_js__WEBPACK_IMPORTED_MODULE_6__.childrenToReact)({options, schema: property_information__WEBPACK_IMPORTED_MODULE_7__.html, listDepth: 0}, hastNode)
24928 )
24929
24930 if (options.className) {
24931 result = react__WEBPACK_IMPORTED_MODULE_0__.createElement('div', {className: options.className}, result)
24932 }
24933
24934 return result
24935 }
24936
24937 ReactMarkdown.propTypes = {
24938 // Core options:
24939 children: prop_types__WEBPACK_IMPORTED_MODULE_8__.string,
24940 // Layout options:
24941 className: prop_types__WEBPACK_IMPORTED_MODULE_8__.string,
24942 // Filter options:
24943 allowElement: prop_types__WEBPACK_IMPORTED_MODULE_8__.func,
24944 allowedElements: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_8__.string),
24945 disallowedElements: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_8__.string),
24946 unwrapDisallowed: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool,
24947 // Plugin options:
24948 remarkPlugins: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(
24949 prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([
24950 prop_types__WEBPACK_IMPORTED_MODULE_8__.object,
24951 prop_types__WEBPACK_IMPORTED_MODULE_8__.func,
24952 prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(
24953 prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([
24954 prop_types__WEBPACK_IMPORTED_MODULE_8__.bool,
24955 prop_types__WEBPACK_IMPORTED_MODULE_8__.string,
24956 prop_types__WEBPACK_IMPORTED_MODULE_8__.object,
24957 prop_types__WEBPACK_IMPORTED_MODULE_8__.func,
24958 prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(
24959 // prettier-ignore
24960 // type-coverage:ignore-next-line
24961 prop_types__WEBPACK_IMPORTED_MODULE_8__.any
24962 )
24963 ])
24964 )
24965 ])
24966 ),
24967 rehypePlugins: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(
24968 prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([
24969 prop_types__WEBPACK_IMPORTED_MODULE_8__.object,
24970 prop_types__WEBPACK_IMPORTED_MODULE_8__.func,
24971 prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(
24972 prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([
24973 prop_types__WEBPACK_IMPORTED_MODULE_8__.bool,
24974 prop_types__WEBPACK_IMPORTED_MODULE_8__.string,
24975 prop_types__WEBPACK_IMPORTED_MODULE_8__.object,
24976 prop_types__WEBPACK_IMPORTED_MODULE_8__.func,
24977 prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(
24978 // prettier-ignore
24979 // type-coverage:ignore-next-line
24980 prop_types__WEBPACK_IMPORTED_MODULE_8__.any
24981 )
24982 ])
24983 )
24984 ])
24985 ),
24986 // Transform options:
24987 sourcePos: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool,
24988 rawSourcePos: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool,
24989 skipHtml: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool,
24990 includeElementIndex: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool,
24991 transformLinkUri: prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.bool]),
24992 linkTarget: prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.string]),
24993 transformImageUri: prop_types__WEBPACK_IMPORTED_MODULE_8__.func,
24994 components: prop_types__WEBPACK_IMPORTED_MODULE_8__.object
24995 }
24996
24997
24998 /***/ }),
24999
25000 /***/ "../node_modules/react-markdown/lib/rehype-filter.js":
25001 /*!***********************************************************!*\
25002 !*** ../node_modules/react-markdown/lib/rehype-filter.js ***!
25003 \***********************************************************/
25004 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25005
25006 "use strict";
25007 __webpack_require__.r(__webpack_exports__);
25008 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25009 /* harmony export */ "default": () => (/* binding */ rehypeFilter)
25010 /* harmony export */ });
25011 /* harmony import */ var unist_util_visit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-visit */ "../node_modules/unist-util-visit/lib/index.js");
25012
25013
25014 /**
25015 * @typedef {import('unist').Node} Node
25016 * @typedef {import('hast').Root} Root
25017 * @typedef {import('hast').Element} Element
25018 *
25019 * @callback AllowElement
25020 * @param {Element} element
25021 * @param {number} index
25022 * @param {Element|Root} parent
25023 * @returns {boolean|undefined}
25024 *
25025 * @typedef Options
25026 * @property {Array<string>} [allowedElements]
25027 * @property {Array<string>} [disallowedElements=[]]
25028 * @property {AllowElement} [allowElement]
25029 * @property {boolean} [unwrapDisallowed=false]
25030 */
25031
25032 /**
25033 * @type {import('unified').Plugin<[Options], Root>}
25034 */
25035 function rehypeFilter(options) {
25036 if (options.allowedElements && options.disallowedElements) {
25037 throw new TypeError(
25038 'Only one of `allowedElements` and `disallowedElements` should be defined'
25039 )
25040 }
25041
25042 if (
25043 options.allowedElements ||
25044 options.disallowedElements ||
25045 options.allowElement
25046 ) {
25047 return (tree) => {
25048 (0,unist_util_visit__WEBPACK_IMPORTED_MODULE_0__.visit)(tree, 'element', (node, index, parent_) => {
25049 const parent = /** @type {Element|Root} */ (parent_)
25050 /** @type {boolean|undefined} */
25051 let remove
25052
25053 if (options.allowedElements) {
25054 remove = !options.allowedElements.includes(node.tagName)
25055 } else if (options.disallowedElements) {
25056 remove = options.disallowedElements.includes(node.tagName)
25057 }
25058
25059 if (!remove && options.allowElement && typeof index === 'number') {
25060 remove = !options.allowElement(node, index, parent)
25061 }
25062
25063 if (remove && typeof index === 'number') {
25064 if (options.unwrapDisallowed && node.children) {
25065 parent.children.splice(index, 1, ...node.children)
25066 } else {
25067 parent.children.splice(index, 1)
25068 }
25069
25070 return index
25071 }
25072
25073 return undefined
25074 })
25075 }
25076 }
25077 }
25078
25079
25080 /***/ }),
25081
25082 /***/ "../node_modules/react-markdown/lib/uri-transformer.js":
25083 /*!*************************************************************!*\
25084 !*** ../node_modules/react-markdown/lib/uri-transformer.js ***!
25085 \*************************************************************/
25086 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25087
25088 "use strict";
25089 __webpack_require__.r(__webpack_exports__);
25090 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25091 /* harmony export */ "uriTransformer": () => (/* binding */ uriTransformer)
25092 /* harmony export */ });
25093 const protocols = ['http', 'https', 'mailto', 'tel']
25094
25095 /**
25096 * @param {string} uri
25097 * @returns {string}
25098 */
25099 function uriTransformer(uri) {
25100 const url = (uri || '').trim()
25101 const first = url.charAt(0)
25102
25103 if (first === '#' || first === '/') {
25104 return url
25105 }
25106
25107 const colon = url.indexOf(':')
25108 if (colon === -1) {
25109 return url
25110 }
25111
25112 let index = -1
25113
25114 while (++index < protocols.length) {
25115 const protocol = protocols[index]
25116
25117 if (
25118 colon === protocol.length &&
25119 url.slice(0, protocol.length).toLowerCase() === protocol
25120 ) {
25121 return url
25122 }
25123 }
25124
25125 index = url.indexOf('?')
25126 if (index !== -1 && colon > index) {
25127 return url
25128 }
25129
25130 index = url.indexOf('#')
25131 if (index !== -1 && colon > index) {
25132 return url
25133 }
25134
25135 // eslint-disable-next-line no-script-url
25136 return 'javascript:void(0)'
25137 }
25138
25139
25140 /***/ }),
25141
25142 /***/ "../node_modules/remark-parse/index.js":
25143 /*!*********************************************!*\
25144 !*** ../node_modules/remark-parse/index.js ***!
25145 \*********************************************/
25146 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25147
25148 "use strict";
25149 __webpack_require__.r(__webpack_exports__);
25150 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25151 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
25152 /* harmony export */ });
25153 /* harmony import */ var _lib_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/index.js */ "../node_modules/remark-parse/lib/index.js");
25154
25155
25156 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_lib_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
25157
25158
25159 /***/ }),
25160
25161 /***/ "../node_modules/remark-parse/lib/index.js":
25162 /*!*************************************************!*\
25163 !*** ../node_modules/remark-parse/lib/index.js ***!
25164 \*************************************************/
25165 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25166
25167 "use strict";
25168 __webpack_require__.r(__webpack_exports__);
25169 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25170 /* harmony export */ "default": () => (/* binding */ remarkParse)
25171 /* harmony export */ });
25172 /* harmony import */ var mdast_util_from_markdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mdast-util-from-markdown */ "../node_modules/mdast-util-from-markdown/dev/lib/index.js");
25173 /**
25174 * @typedef {import('mdast').Root} Root
25175 * @typedef {import('mdast-util-from-markdown').Options} Options
25176 */
25177
25178
25179
25180 /** @type {import('unified').Plugin<[Options?] | void[], string, Root>} */
25181 function remarkParse(options) {
25182 /** @type {import('unified').ParserFunction<Root>} */
25183 const parser = (doc) => {
25184 // Assume options.
25185 const settings = /** @type {Options} */ (this.data('settings'))
25186
25187 return (0,mdast_util_from_markdown__WEBPACK_IMPORTED_MODULE_0__.fromMarkdown)(
25188 doc,
25189 Object.assign({}, settings, options, {
25190 // Note: these options are not in the readme.
25191 // The goal is for them to be set by plugins on `data` instead of being
25192 // passed by users.
25193 extensions: this.data('micromarkExtensions') || [],
25194 mdastExtensions: this.data('fromMarkdownExtensions') || []
25195 })
25196 )
25197 }
25198
25199 Object.assign(this, {Parser: parser})
25200 }
25201
25202
25203 /***/ }),
25204
25205 /***/ "../node_modules/remark-rehype/lib/index.js":
25206 /*!**************************************************!*\
25207 !*** ../node_modules/remark-rehype/lib/index.js ***!
25208 \**************************************************/
25209 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25210
25211 "use strict";
25212 __webpack_require__.r(__webpack_exports__);
25213 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25214 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
25215 /* harmony export */ });
25216 /* harmony import */ var mdast_util_to_hast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mdast-util-to-hast */ "../node_modules/mdast-util-to-hast/lib/index.js");
25217 /**
25218 * @typedef {import('hast').Root} HastRoot
25219 * @typedef {import('mdast').Root} MdastRoot
25220 * @typedef {import('mdast-util-to-hast').Options} Options
25221 * @typedef {import('unified').Processor<any, any, any, any>} Processor
25222 *
25223 * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree
25224 */
25225
25226
25227
25228 // Note: the `<MdastRoot, HastRoot>` overload doesn’t seem to work :'(
25229
25230 /**
25231 * Plugin that turns markdown into HTML to support rehype.
25232 *
25233 * * If a destination processor is given, that processor runs with a new HTML
25234 * (hast) tree (bridge-mode).
25235 * As the given processor runs with a hast tree, and rehype plugins support
25236 * hast, that means rehype plugins can be used with the given processor.
25237 * The hast tree is discarded in the end.
25238 * It’s highly unlikely that you want to do this.
25239 * * The common case is to not pass a destination processor, in which case the
25240 * current processor continues running with a new HTML (hast) tree
25241 * (mutate-mode).
25242 * As the current processor continues with a hast tree, and rehype plugins
25243 * support hast, that means rehype plugins can be used after
25244 * `remark-rehype`.
25245 * It’s likely that this is what you want to do.
25246 *
25247 * @param destination
25248 * Optional unified processor.
25249 * @param options
25250 * Options passed to `mdast-util-to-hast`.
25251 */
25252 const remarkRehype =
25253 /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */
25254 (
25255 function (destination, options) {
25256 return destination && 'run' in destination
25257 ? bridge(destination, options)
25258 : mutate(destination || options)
25259 }
25260 )
25261
25262 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (remarkRehype);
25263
25264 /**
25265 * Bridge-mode.
25266 * Runs the destination with the new hast tree.
25267 *
25268 * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}
25269 */
25270 function bridge(destination, options) {
25271 return (node, file, next) => {
25272 destination.run((0,mdast_util_to_hast__WEBPACK_IMPORTED_MODULE_0__.toHast)(node, options), file, (error) => {
25273 next(error)
25274 })
25275 }
25276 }
25277
25278 /**
25279 * Mutate-mode.
25280 * Further plugins run on the hast tree.
25281 *
25282 * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}
25283 */
25284 function mutate(options) {
25285 // @ts-expect-error: assume a corresponding node is returned by `toHast`.
25286 return (node) => (0,mdast_util_to_hast__WEBPACK_IMPORTED_MODULE_0__.toHast)(node, options)
25287 }
25288
25289
25290 /***/ }),
25291
25292 /***/ "../node_modules/space-separated-tokens/index.js":
25293 /*!*******************************************************!*\
25294 !*** ../node_modules/space-separated-tokens/index.js ***!
25295 \*******************************************************/
25296 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25297
25298 "use strict";
25299 __webpack_require__.r(__webpack_exports__);
25300 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25301 /* harmony export */ "parse": () => (/* binding */ parse),
25302 /* harmony export */ "stringify": () => (/* binding */ stringify)
25303 /* harmony export */ });
25304 /**
25305 * Parse space-separated tokens to an array of strings.
25306 *
25307 * @param {string} value
25308 * Space-separated tokens.
25309 * @returns {Array<string>}
25310 * List of tokens.
25311 */
25312 function parse(value) {
25313 const input = String(value || '').trim()
25314 return input ? input.split(/[ \t\n\r\f]+/g) : []
25315 }
25316
25317 /**
25318 * Serialize an array of strings as space separated-tokens.
25319 *
25320 * @param {Array<string|number>} values
25321 * List of tokens.
25322 * @returns {string}
25323 * Space-separated tokens.
25324 */
25325 function stringify(values) {
25326 return values.join(' ').trim()
25327 }
25328
25329
25330 /***/ }),
25331
25332 /***/ "../node_modules/style-to-object/index.mjs":
25333 /*!*************************************************!*\
25334 !*** ../node_modules/style-to-object/index.mjs ***!
25335 \*************************************************/
25336 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25337
25338 "use strict";
25339 __webpack_require__.r(__webpack_exports__);
25340 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25341 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
25342 /* harmony export */ });
25343 /* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/style-to-object/index.js");
25344
25345
25346 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_index_js__WEBPACK_IMPORTED_MODULE_0__);
25347
25348
25349 /***/ }),
25350
25351 /***/ "../node_modules/trim-lines/index.js":
25352 /*!*******************************************!*\
25353 !*** ../node_modules/trim-lines/index.js ***!
25354 \*******************************************/
25355 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25356
25357 "use strict";
25358 __webpack_require__.r(__webpack_exports__);
25359 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25360 /* harmony export */ "trimLines": () => (/* binding */ trimLines)
25361 /* harmony export */ });
25362 const tab = 9 /* `\t` */
25363 const space = 32 /* ` ` */
25364
25365 /**
25366 * Remove initial and final spaces and tabs at the line breaks in `value`.
25367 * Does not trim initial and final spaces and tabs of the value itself.
25368 *
25369 * @param {string} value
25370 * Value to trim.
25371 * @returns {string}
25372 * Trimmed value.
25373 */
25374 function trimLines(value) {
25375 const source = String(value)
25376 const search = /\r?\n|\r/g
25377 let match = search.exec(source)
25378 let last = 0
25379 /** @type {Array<string>} */
25380 const lines = []
25381
25382 while (match) {
25383 lines.push(
25384 trimLine(source.slice(last, match.index), last > 0, true),
25385 match[0]
25386 )
25387
25388 last = match.index + match[0].length
25389 match = search.exec(source)
25390 }
25391
25392 lines.push(trimLine(source.slice(last), last > 0, false))
25393
25394 return lines.join('')
25395 }
25396
25397 /**
25398 * @param {string} value
25399 * Line to trim.
25400 * @param {boolean} start
25401 * Whether to trim the start of the line.
25402 * @param {boolean} end
25403 * Whether to trim the end of the line.
25404 * @returns {string}
25405 * Trimmed line.
25406 */
25407 function trimLine(value, start, end) {
25408 let startIndex = 0
25409 let endIndex = value.length
25410
25411 if (start) {
25412 let code = value.codePointAt(startIndex)
25413
25414 while (code === tab || code === space) {
25415 startIndex++
25416 code = value.codePointAt(startIndex)
25417 }
25418 }
25419
25420 if (end) {
25421 let code = value.codePointAt(endIndex - 1)
25422
25423 while (code === tab || code === space) {
25424 endIndex--
25425 code = value.codePointAt(endIndex - 1)
25426 }
25427 }
25428
25429 return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''
25430 }
25431
25432
25433 /***/ }),
25434
25435 /***/ "../node_modules/trough/index.js":
25436 /*!***************************************!*\
25437 !*** ../node_modules/trough/index.js ***!
25438 \***************************************/
25439 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25440
25441 "use strict";
25442 __webpack_require__.r(__webpack_exports__);
25443 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25444 /* harmony export */ "trough": () => (/* binding */ trough),
25445 /* harmony export */ "wrap": () => (/* binding */ wrap)
25446 /* harmony export */ });
25447 /**
25448 * @typedef {(error?: Error|null|undefined, ...output: Array<any>) => void} Callback
25449 * @typedef {(...input: Array<any>) => any} Middleware
25450 *
25451 * @typedef {(...input: Array<any>) => void} Run
25452 * Call all middleware.
25453 * @typedef {(fn: Middleware) => Pipeline} Use
25454 * Add `fn` (middleware) to the list.
25455 * @typedef {{run: Run, use: Use}} Pipeline
25456 * Middleware.
25457 */
25458
25459 /**
25460 * Create new middleware.
25461 *
25462 * @returns {Pipeline}
25463 */
25464 function trough() {
25465 /** @type {Array<Middleware>} */
25466 const fns = []
25467 /** @type {Pipeline} */
25468 const pipeline = {run, use}
25469
25470 return pipeline
25471
25472 /** @type {Run} */
25473 function run(...values) {
25474 let middlewareIndex = -1
25475 /** @type {Callback} */
25476 const callback = values.pop()
25477
25478 if (typeof callback !== 'function') {
25479 throw new TypeError('Expected function as last argument, not ' + callback)
25480 }
25481
25482 next(null, ...values)
25483
25484 /**
25485 * Run the next `fn`, or we’re done.
25486 *
25487 * @param {Error|null|undefined} error
25488 * @param {Array<any>} output
25489 */
25490 function next(error, ...output) {
25491 const fn = fns[++middlewareIndex]
25492 let index = -1
25493
25494 if (error) {
25495 callback(error)
25496 return
25497 }
25498
25499 // Copy non-nullish input into values.
25500 while (++index < values.length) {
25501 if (output[index] === null || output[index] === undefined) {
25502 output[index] = values[index]
25503 }
25504 }
25505
25506 // Save the newly created `output` for the next call.
25507 values = output
25508
25509 // Next or done.
25510 if (fn) {
25511 wrap(fn, next)(...output)
25512 } else {
25513 callback(null, ...output)
25514 }
25515 }
25516 }
25517
25518 /** @type {Use} */
25519 function use(middelware) {
25520 if (typeof middelware !== 'function') {
25521 throw new TypeError(
25522 'Expected `middelware` to be a function, not ' + middelware
25523 )
25524 }
25525
25526 fns.push(middelware)
25527 return pipeline
25528 }
25529 }
25530
25531 /**
25532 * Wrap `middleware`.
25533 * Can be sync or async; return a promise, receive a callback, or return new
25534 * values and errors.
25535 *
25536 * @param {Middleware} middleware
25537 * @param {Callback} callback
25538 */
25539 function wrap(middleware, callback) {
25540 /** @type {boolean} */
25541 let called
25542
25543 return wrapped
25544
25545 /**
25546 * Call `middleware`.
25547 * @this {any}
25548 * @param {Array<any>} parameters
25549 * @returns {void}
25550 */
25551 function wrapped(...parameters) {
25552 const fnExpectsCallback = middleware.length > parameters.length
25553 /** @type {any} */
25554 let result
25555
25556 if (fnExpectsCallback) {
25557 parameters.push(done)
25558 }
25559
25560 try {
25561 result = middleware.apply(this, parameters)
25562 } catch (error) {
25563 const exception = /** @type {Error} */ (error)
25564
25565 // Well, this is quite the pickle.
25566 // `middleware` received a callback and called it synchronously, but that
25567 // threw an error.
25568 // The only thing left to do is to throw the thing instead.
25569 if (fnExpectsCallback && called) {
25570 throw exception
25571 }
25572
25573 return done(exception)
25574 }
25575
25576 if (!fnExpectsCallback) {
25577 if (result instanceof Promise) {
25578 result.then(then, done)
25579 } else if (result instanceof Error) {
25580 done(result)
25581 } else {
25582 then(result)
25583 }
25584 }
25585 }
25586
25587 /**
25588 * Call `callback`, only once.
25589 * @type {Callback}
25590 */
25591 function done(error, ...output) {
25592 if (!called) {
25593 called = true
25594 callback(error, ...output)
25595 }
25596 }
25597
25598 /**
25599 * Call `done` with one value.
25600 *
25601 * @param {any} [value]
25602 */
25603 function then(value) {
25604 done(null, value)
25605 }
25606 }
25607
25608
25609 /***/ }),
25610
25611 /***/ "../node_modules/unified/lib/index.js":
25612 /*!********************************************!*\
25613 !*** ../node_modules/unified/lib/index.js ***!
25614 \********************************************/
25615 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25616
25617 "use strict";
25618 __webpack_require__.r(__webpack_exports__);
25619 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25620 /* harmony export */ "unified": () => (/* binding */ unified)
25621 /* harmony export */ });
25622 /* harmony import */ var bail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bail */ "../node_modules/bail/index.js");
25623 /* harmony import */ var is_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-buffer */ "../node_modules/is-buffer/index.js");
25624 /* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! extend */ "../node_modules/extend/index.js");
25625 /* harmony import */ var is_plain_obj__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! is-plain-obj */ "../node_modules/is-plain-obj/index.js");
25626 /* harmony import */ var trough__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! trough */ "../node_modules/trough/index.js");
25627 /* harmony import */ var vfile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vfile */ "../node_modules/vfile/lib/index.js");
25628 /**
25629 * @typedef {import('unist').Node} Node
25630 * @typedef {import('vfile').VFileCompatible} VFileCompatible
25631 * @typedef {import('vfile').VFileValue} VFileValue
25632 * @typedef {import('..').Processor} Processor
25633 * @typedef {import('..').Plugin} Plugin
25634 * @typedef {import('..').Preset} Preset
25635 * @typedef {import('..').Pluggable} Pluggable
25636 * @typedef {import('..').PluggableList} PluggableList
25637 * @typedef {import('..').Transformer} Transformer
25638 * @typedef {import('..').Parser} Parser
25639 * @typedef {import('..').Compiler} Compiler
25640 * @typedef {import('..').RunCallback} RunCallback
25641 * @typedef {import('..').ProcessCallback} ProcessCallback
25642 *
25643 * @typedef Context
25644 * @property {Node} tree
25645 * @property {VFile} file
25646 */
25647
25648
25649
25650
25651
25652
25653
25654
25655 // Expose a frozen processor.
25656 const unified = base().freeze()
25657
25658 const own = {}.hasOwnProperty
25659
25660 // Function to create the first processor.
25661 /**
25662 * @returns {Processor}
25663 */
25664 function base() {
25665 const transformers = (0,trough__WEBPACK_IMPORTED_MODULE_3__.trough)()
25666 /** @type {Processor['attachers']} */
25667 const attachers = []
25668 /** @type {Record<string, unknown>} */
25669 let namespace = {}
25670 /** @type {boolean|undefined} */
25671 let frozen
25672 let freezeIndex = -1
25673
25674 // Data management.
25675 // @ts-expect-error: overloads are handled.
25676 processor.data = data
25677 processor.Parser = undefined
25678 processor.Compiler = undefined
25679
25680 // Lock.
25681 processor.freeze = freeze
25682
25683 // Plugins.
25684 processor.attachers = attachers
25685 // @ts-expect-error: overloads are handled.
25686 processor.use = use
25687
25688 // API.
25689 processor.parse = parse
25690 processor.stringify = stringify
25691 // @ts-expect-error: overloads are handled.
25692 processor.run = run
25693 processor.runSync = runSync
25694 // @ts-expect-error: overloads are handled.
25695 processor.process = process
25696 processor.processSync = processSync
25697
25698 // Expose.
25699 return processor
25700
25701 // Create a new processor based on the processor in the current scope.
25702 /** @type {Processor} */
25703 function processor() {
25704 const destination = base()
25705 let index = -1
25706
25707 while (++index < attachers.length) {
25708 destination.use(...attachers[index])
25709 }
25710
25711 destination.data(extend__WEBPACK_IMPORTED_MODULE_1__(true, {}, namespace))
25712
25713 return destination
25714 }
25715
25716 /**
25717 * @param {string|Record<string, unknown>} [key]
25718 * @param {unknown} [value]
25719 * @returns {unknown}
25720 */
25721 function data(key, value) {
25722 if (typeof key === 'string') {
25723 // Set `key`.
25724 if (arguments.length === 2) {
25725 assertUnfrozen('data', frozen)
25726 namespace[key] = value
25727 return processor
25728 }
25729
25730 // Get `key`.
25731 return (own.call(namespace, key) && namespace[key]) || null
25732 }
25733
25734 // Set space.
25735 if (key) {
25736 assertUnfrozen('data', frozen)
25737 namespace = key
25738 return processor
25739 }
25740
25741 // Get space.
25742 return namespace
25743 }
25744
25745 /** @type {Processor['freeze']} */
25746 function freeze() {
25747 if (frozen) {
25748 return processor
25749 }
25750
25751 while (++freezeIndex < attachers.length) {
25752 const [attacher, ...options] = attachers[freezeIndex]
25753
25754 if (options[0] === false) {
25755 continue
25756 }
25757
25758 if (options[0] === true) {
25759 options[0] = undefined
25760 }
25761
25762 /** @type {Transformer|void} */
25763 const transformer = attacher.call(processor, ...options)
25764
25765 if (typeof transformer === 'function') {
25766 transformers.use(transformer)
25767 }
25768 }
25769
25770 frozen = true
25771 freezeIndex = Number.POSITIVE_INFINITY
25772
25773 return processor
25774 }
25775
25776 /**
25777 * @param {Pluggable|null|undefined} [value]
25778 * @param {...unknown} options
25779 * @returns {Processor}
25780 */
25781 function use(value, ...options) {
25782 /** @type {Record<string, unknown>|undefined} */
25783 let settings
25784
25785 assertUnfrozen('use', frozen)
25786
25787 if (value === null || value === undefined) {
25788 // Empty.
25789 } else if (typeof value === 'function') {
25790 addPlugin(value, ...options)
25791 } else if (typeof value === 'object') {
25792 if (Array.isArray(value)) {
25793 addList(value)
25794 } else {
25795 addPreset(value)
25796 }
25797 } else {
25798 throw new TypeError('Expected usable value, not `' + value + '`')
25799 }
25800
25801 if (settings) {
25802 namespace.settings = Object.assign(namespace.settings || {}, settings)
25803 }
25804
25805 return processor
25806
25807 /**
25808 * @param {import('..').Pluggable<unknown[]>} value
25809 * @returns {void}
25810 */
25811 function add(value) {
25812 if (typeof value === 'function') {
25813 addPlugin(value)
25814 } else if (typeof value === 'object') {
25815 if (Array.isArray(value)) {
25816 const [plugin, ...options] = value
25817 addPlugin(plugin, ...options)
25818 } else {
25819 addPreset(value)
25820 }
25821 } else {
25822 throw new TypeError('Expected usable value, not `' + value + '`')
25823 }
25824 }
25825
25826 /**
25827 * @param {Preset} result
25828 * @returns {void}
25829 */
25830 function addPreset(result) {
25831 addList(result.plugins)
25832
25833 if (result.settings) {
25834 settings = Object.assign(settings || {}, result.settings)
25835 }
25836 }
25837
25838 /**
25839 * @param {PluggableList|null|undefined} [plugins]
25840 * @returns {void}
25841 */
25842 function addList(plugins) {
25843 let index = -1
25844
25845 if (plugins === null || plugins === undefined) {
25846 // Empty.
25847 } else if (Array.isArray(plugins)) {
25848 while (++index < plugins.length) {
25849 const thing = plugins[index]
25850 add(thing)
25851 }
25852 } else {
25853 throw new TypeError('Expected a list of plugins, not `' + plugins + '`')
25854 }
25855 }
25856
25857 /**
25858 * @param {Plugin} plugin
25859 * @param {...unknown} [value]
25860 * @returns {void}
25861 */
25862 function addPlugin(plugin, value) {
25863 let index = -1
25864 /** @type {Processor['attachers'][number]|undefined} */
25865 let entry
25866
25867 while (++index < attachers.length) {
25868 if (attachers[index][0] === plugin) {
25869 entry = attachers[index]
25870 break
25871 }
25872 }
25873
25874 if (entry) {
25875 if ((0,is_plain_obj__WEBPACK_IMPORTED_MODULE_2__["default"])(entry[1]) && (0,is_plain_obj__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
25876 value = extend__WEBPACK_IMPORTED_MODULE_1__(true, entry[1], value)
25877 }
25878
25879 entry[1] = value
25880 } else {
25881 // @ts-expect-error: fine.
25882 attachers.push([...arguments])
25883 }
25884 }
25885 }
25886
25887 /** @type {Processor['parse']} */
25888 function parse(doc) {
25889 processor.freeze()
25890 const file = vfile(doc)
25891 const Parser = processor.Parser
25892 assertParser('parse', Parser)
25893
25894 if (newable(Parser, 'parse')) {
25895 // @ts-expect-error: `newable` checks this.
25896 return new Parser(String(file), file).parse()
25897 }
25898
25899 // @ts-expect-error: `newable` checks this.
25900 return Parser(String(file), file) // eslint-disable-line new-cap
25901 }
25902
25903 /** @type {Processor['stringify']} */
25904 function stringify(node, doc) {
25905 processor.freeze()
25906 const file = vfile(doc)
25907 const Compiler = processor.Compiler
25908 assertCompiler('stringify', Compiler)
25909 assertNode(node)
25910
25911 if (newable(Compiler, 'compile')) {
25912 // @ts-expect-error: `newable` checks this.
25913 return new Compiler(node, file).compile()
25914 }
25915
25916 // @ts-expect-error: `newable` checks this.
25917 return Compiler(node, file) // eslint-disable-line new-cap
25918 }
25919
25920 /**
25921 * @param {Node} node
25922 * @param {VFileCompatible|RunCallback} [doc]
25923 * @param {RunCallback} [callback]
25924 * @returns {Promise<Node>|void}
25925 */
25926 function run(node, doc, callback) {
25927 assertNode(node)
25928 processor.freeze()
25929
25930 if (!callback && typeof doc === 'function') {
25931 callback = doc
25932 doc = undefined
25933 }
25934
25935 if (!callback) {
25936 return new Promise(executor)
25937 }
25938
25939 executor(null, callback)
25940
25941 /**
25942 * @param {null|((node: Node) => void)} resolve
25943 * @param {(error: Error) => void} reject
25944 * @returns {void}
25945 */
25946 function executor(resolve, reject) {
25947 // @ts-expect-error: `doc` can’t be a callback anymore, we checked.
25948 transformers.run(node, vfile(doc), done)
25949
25950 /**
25951 * @param {Error|null} error
25952 * @param {Node} tree
25953 * @param {VFile} file
25954 * @returns {void}
25955 */
25956 function done(error, tree, file) {
25957 tree = tree || node
25958 if (error) {
25959 reject(error)
25960 } else if (resolve) {
25961 resolve(tree)
25962 } else {
25963 // @ts-expect-error: `callback` is defined if `resolve` is not.
25964 callback(null, tree, file)
25965 }
25966 }
25967 }
25968 }
25969
25970 /** @type {Processor['runSync']} */
25971 function runSync(node, file) {
25972 /** @type {Node|undefined} */
25973 let result
25974 /** @type {boolean|undefined} */
25975 let complete
25976
25977 processor.run(node, file, done)
25978
25979 assertDone('runSync', 'run', complete)
25980
25981 // @ts-expect-error: we either bailed on an error or have a tree.
25982 return result
25983
25984 /**
25985 * @param {Error|null} [error]
25986 * @param {Node} [tree]
25987 * @returns {void}
25988 */
25989 function done(error, tree) {
25990 ;(0,bail__WEBPACK_IMPORTED_MODULE_4__.bail)(error)
25991 result = tree
25992 complete = true
25993 }
25994 }
25995
25996 /**
25997 * @param {VFileCompatible} doc
25998 * @param {ProcessCallback} [callback]
25999 * @returns {Promise<VFile>|undefined}
26000 */
26001 function process(doc, callback) {
26002 processor.freeze()
26003 assertParser('process', processor.Parser)
26004 assertCompiler('process', processor.Compiler)
26005
26006 if (!callback) {
26007 return new Promise(executor)
26008 }
26009
26010 executor(null, callback)
26011
26012 /**
26013 * @param {null|((file: VFile) => void)} resolve
26014 * @param {(error?: Error|null|undefined) => void} reject
26015 * @returns {void}
26016 */
26017 function executor(resolve, reject) {
26018 const file = vfile(doc)
26019
26020 processor.run(processor.parse(file), file, (error, tree, file) => {
26021 if (error || !tree || !file) {
26022 done(error)
26023 } else {
26024 /** @type {unknown} */
26025 const result = processor.stringify(tree, file)
26026
26027 if (result === undefined || result === null) {
26028 // Empty.
26029 } else if (looksLikeAVFileValue(result)) {
26030 file.value = result
26031 } else {
26032 file.result = result
26033 }
26034
26035 done(error, file)
26036 }
26037 })
26038
26039 /**
26040 * @param {Error|null|undefined} [error]
26041 * @param {VFile|undefined} [file]
26042 * @returns {void}
26043 */
26044 function done(error, file) {
26045 if (error || !file) {
26046 reject(error)
26047 } else if (resolve) {
26048 resolve(file)
26049 } else {
26050 // @ts-expect-error: `callback` is defined if `resolve` is not.
26051 callback(null, file)
26052 }
26053 }
26054 }
26055 }
26056
26057 /** @type {Processor['processSync']} */
26058 function processSync(doc) {
26059 /** @type {boolean|undefined} */
26060 let complete
26061
26062 processor.freeze()
26063 assertParser('processSync', processor.Parser)
26064 assertCompiler('processSync', processor.Compiler)
26065
26066 const file = vfile(doc)
26067
26068 processor.process(file, done)
26069
26070 assertDone('processSync', 'process', complete)
26071
26072 return file
26073
26074 /**
26075 * @param {Error|null|undefined} [error]
26076 * @returns {void}
26077 */
26078 function done(error) {
26079 complete = true
26080 ;(0,bail__WEBPACK_IMPORTED_MODULE_4__.bail)(error)
26081 }
26082 }
26083 }
26084
26085 /**
26086 * Check if `value` is a constructor.
26087 *
26088 * @param {unknown} value
26089 * @param {string} name
26090 * @returns {boolean}
26091 */
26092 function newable(value, name) {
26093 return (
26094 typeof value === 'function' &&
26095 // Prototypes do exist.
26096 // type-coverage:ignore-next-line
26097 value.prototype &&
26098 // A function with keys in its prototype is probably a constructor.
26099 // Classes’ prototype methods are not enumerable, so we check if some value
26100 // exists in the prototype.
26101 // type-coverage:ignore-next-line
26102 (keys(value.prototype) || name in value.prototype)
26103 )
26104 }
26105
26106 /**
26107 * Check if `value` is an object with keys.
26108 *
26109 * @param {Record<string, unknown>} value
26110 * @returns {boolean}
26111 */
26112 function keys(value) {
26113 /** @type {string} */
26114 let key
26115
26116 for (key in value) {
26117 if (own.call(value, key)) {
26118 return true
26119 }
26120 }
26121
26122 return false
26123 }
26124
26125 /**
26126 * Assert a parser is available.
26127 *
26128 * @param {string} name
26129 * @param {unknown} value
26130 * @returns {asserts value is Parser}
26131 */
26132 function assertParser(name, value) {
26133 if (typeof value !== 'function') {
26134 throw new TypeError('Cannot `' + name + '` without `Parser`')
26135 }
26136 }
26137
26138 /**
26139 * Assert a compiler is available.
26140 *
26141 * @param {string} name
26142 * @param {unknown} value
26143 * @returns {asserts value is Compiler}
26144 */
26145 function assertCompiler(name, value) {
26146 if (typeof value !== 'function') {
26147 throw new TypeError('Cannot `' + name + '` without `Compiler`')
26148 }
26149 }
26150
26151 /**
26152 * Assert the processor is not frozen.
26153 *
26154 * @param {string} name
26155 * @param {unknown} frozen
26156 * @returns {asserts frozen is false}
26157 */
26158 function assertUnfrozen(name, frozen) {
26159 if (frozen) {
26160 throw new Error(
26161 'Cannot call `' +
26162 name +
26163 '` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.'
26164 )
26165 }
26166 }
26167
26168 /**
26169 * Assert `node` is a unist node.
26170 *
26171 * @param {unknown} node
26172 * @returns {asserts node is Node}
26173 */
26174 function assertNode(node) {
26175 // `isPlainObj` unfortunately uses `any` instead of `unknown`.
26176 // type-coverage:ignore-next-line
26177 if (!(0,is_plain_obj__WEBPACK_IMPORTED_MODULE_2__["default"])(node) || typeof node.type !== 'string') {
26178 throw new TypeError('Expected node, got `' + node + '`')
26179 // Fine.
26180 }
26181 }
26182
26183 /**
26184 * Assert that `complete` is `true`.
26185 *
26186 * @param {string} name
26187 * @param {string} asyncName
26188 * @param {unknown} complete
26189 * @returns {asserts complete is true}
26190 */
26191 function assertDone(name, asyncName, complete) {
26192 if (!complete) {
26193 throw new Error(
26194 '`' + name + '` finished async. Use `' + asyncName + '` instead'
26195 )
26196 }
26197 }
26198
26199 /**
26200 * @param {VFileCompatible} [value]
26201 * @returns {VFile}
26202 */
26203 function vfile(value) {
26204 return looksLikeAVFile(value) ? value : new vfile__WEBPACK_IMPORTED_MODULE_5__.VFile(value)
26205 }
26206
26207 /**
26208 * @param {VFileCompatible} [value]
26209 * @returns {value is VFile}
26210 */
26211 function looksLikeAVFile(value) {
26212 return Boolean(
26213 value &&
26214 typeof value === 'object' &&
26215 'message' in value &&
26216 'messages' in value
26217 )
26218 }
26219
26220 /**
26221 * @param {unknown} [value]
26222 * @returns {value is VFileValue}
26223 */
26224 function looksLikeAVFileValue(value) {
26225 return typeof value === 'string' || is_buffer__WEBPACK_IMPORTED_MODULE_0__(value)
26226 }
26227
26228
26229 /***/ }),
26230
26231 /***/ "../node_modules/unist-util-generated/lib/index.js":
26232 /*!*********************************************************!*\
26233 !*** ../node_modules/unist-util-generated/lib/index.js ***!
26234 \*********************************************************/
26235 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
26236
26237 "use strict";
26238 __webpack_require__.r(__webpack_exports__);
26239 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26240 /* harmony export */ "generated": () => (/* binding */ generated)
26241 /* harmony export */ });
26242 /**
26243 * @typedef PointLike
26244 * @property {number | null | undefined} [line]
26245 * @property {number | null | undefined} [column]
26246 * @property {number | null | undefined} [offset]
26247 *
26248 * @typedef PositionLike
26249 * @property {PointLike | null | undefined} [start]
26250 * @property {PointLike | null | undefined} [end]
26251 *
26252 * @typedef NodeLike
26253 * @property {PositionLike | null | undefined} [position]
26254 */
26255
26256 /**
26257 * Check if `node` is generated.
26258 *
26259 * @param {NodeLike | null | undefined} [node]
26260 * Node to check.
26261 * @returns {boolean}
26262 * Whether `node` is generated (does not have positional info).
26263 */
26264 function generated(node) {
26265 return (
26266 !node ||
26267 !node.position ||
26268 !node.position.start ||
26269 !node.position.start.line ||
26270 !node.position.start.column ||
26271 !node.position.end ||
26272 !node.position.end.line ||
26273 !node.position.end.column
26274 )
26275 }
26276
26277
26278 /***/ }),
26279
26280 /***/ "../node_modules/unist-util-is/lib/index.js":
26281 /*!**************************************************!*\
26282 !*** ../node_modules/unist-util-is/lib/index.js ***!
26283 \**************************************************/
26284 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
26285
26286 "use strict";
26287 __webpack_require__.r(__webpack_exports__);
26288 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26289 /* harmony export */ "convert": () => (/* binding */ convert),
26290 /* harmony export */ "is": () => (/* binding */ is)
26291 /* harmony export */ });
26292 /**
26293 * @typedef {import('unist').Node} Node
26294 * @typedef {import('unist').Parent} Parent
26295 */
26296
26297 /**
26298 * @typedef {Record<string, unknown>} Props
26299 * @typedef {null | undefined | string | Props | TestFunctionAnything | Array<string | Props | TestFunctionAnything>} Test
26300 * Check for an arbitrary node, unaware of TypeScript inferral.
26301 *
26302 * @callback TestFunctionAnything
26303 * Check if a node passes a test, unaware of TypeScript inferral.
26304 * @param {unknown} this
26305 * The given context.
26306 * @param {Node} node
26307 * A node.
26308 * @param {number | null | undefined} [index]
26309 * The node’s position in its parent.
26310 * @param {Parent | null | undefined} [parent]
26311 * The node’s parent.
26312 * @returns {boolean | void}
26313 * Whether this node passes the test.
26314 */
26315
26316 /**
26317 * @template {Node} Kind
26318 * Node type.
26319 * @typedef {Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind> | Array<Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind>>} PredicateTest
26320 * Check for a node that can be inferred by TypeScript.
26321 */
26322
26323 /**
26324 * Check if a node passes a certain test.
26325 *
26326 * @template {Node} Kind
26327 * Node type.
26328 * @callback TestFunctionPredicate
26329 * Complex test function for a node that can be inferred by TypeScript.
26330 * @param {Node} node
26331 * A node.
26332 * @param {number | null | undefined} [index]
26333 * The node’s position in its parent.
26334 * @param {Parent | null | undefined} [parent]
26335 * The node’s parent.
26336 * @returns {node is Kind}
26337 * Whether this node passes the test.
26338 */
26339
26340 /**
26341 * @callback AssertAnything
26342 * Check that an arbitrary value is a node, unaware of TypeScript inferral.
26343 * @param {unknown} [node]
26344 * Anything (typically a node).
26345 * @param {number | null | undefined} [index]
26346 * The node’s position in its parent.
26347 * @param {Parent | null | undefined} [parent]
26348 * The node’s parent.
26349 * @returns {boolean}
26350 * Whether this is a node and passes a test.
26351 */
26352
26353 /**
26354 * Check if a node is a node and passes a certain node test.
26355 *
26356 * @template {Node} Kind
26357 * Node type.
26358 * @callback AssertPredicate
26359 * Check that an arbitrary value is a specific node, aware of TypeScript.
26360 * @param {unknown} [node]
26361 * Anything (typically a node).
26362 * @param {number | null | undefined} [index]
26363 * The node’s position in its parent.
26364 * @param {Parent | null | undefined} [parent]
26365 * The node’s parent.
26366 * @returns {node is Kind}
26367 * Whether this is a node and passes a test.
26368 */
26369
26370 /**
26371 * Check if `node` is a `Node` and whether it passes the given test.
26372 *
26373 * @param node
26374 * Thing to check, typically `Node`.
26375 * @param test
26376 * A check for a specific node.
26377 * @param index
26378 * The node’s position in its parent.
26379 * @param parent
26380 * The node’s parent.
26381 * @returns
26382 * Whether `node` is a node and passes a test.
26383 */
26384 const is =
26385 /**
26386 * @type {(
26387 * (() => false) &
26388 * (<Kind extends Node = Node>(node: unknown, test: PredicateTest<Kind>, index: number, parent: Parent, context?: unknown) => node is Kind) &
26389 * (<Kind extends Node = Node>(node: unknown, test: PredicateTest<Kind>, index?: null | undefined, parent?: null | undefined, context?: unknown) => node is Kind) &
26390 * ((node: unknown, test: Test, index: number, parent: Parent, context?: unknown) => boolean) &
26391 * ((node: unknown, test?: Test, index?: null | undefined, parent?: null | undefined, context?: unknown) => boolean)
26392 * )}
26393 */
26394 (
26395 /**
26396 * @param {unknown} [node]
26397 * @param {Test} [test]
26398 * @param {number | null | undefined} [index]
26399 * @param {Parent | null | undefined} [parent]
26400 * @param {unknown} [context]
26401 * @returns {boolean}
26402 */
26403 // eslint-disable-next-line max-params
26404 function is(node, test, index, parent, context) {
26405 const check = convert(test)
26406
26407 if (
26408 index !== undefined &&
26409 index !== null &&
26410 (typeof index !== 'number' ||
26411 index < 0 ||
26412 index === Number.POSITIVE_INFINITY)
26413 ) {
26414 throw new Error('Expected positive finite index')
26415 }
26416
26417 if (
26418 parent !== undefined &&
26419 parent !== null &&
26420 (!is(parent) || !parent.children)
26421 ) {
26422 throw new Error('Expected parent node')
26423 }
26424
26425 if (
26426 (parent === undefined || parent === null) !==
26427 (index === undefined || index === null)
26428 ) {
26429 throw new Error('Expected both parent and index')
26430 }
26431
26432 // @ts-expect-error Looks like a node.
26433 return node && node.type && typeof node.type === 'string'
26434 ? Boolean(check.call(context, node, index, parent))
26435 : false
26436 }
26437 )
26438
26439 /**
26440 * Generate an assertion from a test.
26441 *
26442 * Useful if you’re going to test many nodes, for example when creating a
26443 * utility where something else passes a compatible test.
26444 *
26445 * The created function is a bit faster because it expects valid input only:
26446 * a `node`, `index`, and `parent`.
26447 *
26448 * @param test
26449 * * when nullish, checks if `node` is a `Node`.
26450 * * when `string`, works like passing `(node) => node.type === test`.
26451 * * when `function` checks if function passed the node is true.
26452 * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
26453 * * when `array`, checks if any one of the subtests pass.
26454 * @returns
26455 * An assertion.
26456 */
26457 const convert =
26458 /**
26459 * @type {(
26460 * (<Kind extends Node>(test: PredicateTest<Kind>) => AssertPredicate<Kind>) &
26461 * ((test?: Test) => AssertAnything)
26462 * )}
26463 */
26464 (
26465 /**
26466 * @param {Test} [test]
26467 * @returns {AssertAnything}
26468 */
26469 function (test) {
26470 if (test === undefined || test === null) {
26471 return ok
26472 }
26473
26474 if (typeof test === 'string') {
26475 return typeFactory(test)
26476 }
26477
26478 if (typeof test === 'object') {
26479 return Array.isArray(test) ? anyFactory(test) : propsFactory(test)
26480 }
26481
26482 if (typeof test === 'function') {
26483 return castFactory(test)
26484 }
26485
26486 throw new Error('Expected function, string, or object as test')
26487 }
26488 )
26489
26490 /**
26491 * @param {Array<string | Props | TestFunctionAnything>} tests
26492 * @returns {AssertAnything}
26493 */
26494 function anyFactory(tests) {
26495 /** @type {Array<AssertAnything>} */
26496 const checks = []
26497 let index = -1
26498
26499 while (++index < tests.length) {
26500 checks[index] = convert(tests[index])
26501 }
26502
26503 return castFactory(any)
26504
26505 /**
26506 * @this {unknown}
26507 * @param {Array<unknown>} parameters
26508 * @returns {boolean}
26509 */
26510 function any(...parameters) {
26511 let index = -1
26512
26513 while (++index < checks.length) {
26514 if (checks[index].call(this, ...parameters)) return true
26515 }
26516
26517 return false
26518 }
26519 }
26520
26521 /**
26522 * Turn an object into a test for a node with a certain fields.
26523 *
26524 * @param {Props} check
26525 * @returns {AssertAnything}
26526 */
26527 function propsFactory(check) {
26528 return castFactory(all)
26529
26530 /**
26531 * @param {Node} node
26532 * @returns {boolean}
26533 */
26534 function all(node) {
26535 /** @type {string} */
26536 let key
26537
26538 for (key in check) {
26539 // @ts-expect-error: hush, it sure works as an index.
26540 if (node[key] !== check[key]) return false
26541 }
26542
26543 return true
26544 }
26545 }
26546
26547 /**
26548 * Turn a string into a test for a node with a certain type.
26549 *
26550 * @param {string} check
26551 * @returns {AssertAnything}
26552 */
26553 function typeFactory(check) {
26554 return castFactory(type)
26555
26556 /**
26557 * @param {Node} node
26558 */
26559 function type(node) {
26560 return node && node.type === check
26561 }
26562 }
26563
26564 /**
26565 * Turn a custom test into a test for a node that passes that test.
26566 *
26567 * @param {TestFunctionAnything} check
26568 * @returns {AssertAnything}
26569 */
26570 function castFactory(check) {
26571 return assertion
26572
26573 /**
26574 * @this {unknown}
26575 * @param {unknown} node
26576 * @param {Array<unknown>} parameters
26577 * @returns {boolean}
26578 */
26579 function assertion(node, ...parameters) {
26580 return Boolean(
26581 node &&
26582 typeof node === 'object' &&
26583 'type' in node &&
26584 // @ts-expect-error: fine.
26585 Boolean(check.call(this, node, ...parameters))
26586 )
26587 }
26588 }
26589
26590 function ok() {
26591 return true
26592 }
26593
26594
26595 /***/ }),
26596
26597 /***/ "../node_modules/unist-util-position/lib/index.js":
26598 /*!********************************************************!*\
26599 !*** ../node_modules/unist-util-position/lib/index.js ***!
26600 \********************************************************/
26601 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
26602
26603 "use strict";
26604 __webpack_require__.r(__webpack_exports__);
26605 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26606 /* harmony export */ "pointEnd": () => (/* binding */ pointEnd),
26607 /* harmony export */ "pointStart": () => (/* binding */ pointStart),
26608 /* harmony export */ "position": () => (/* binding */ position)
26609 /* harmony export */ });
26610 /**
26611 * @typedef {import('unist').Position} Position
26612 * @typedef {import('unist').Node} Node
26613 * @typedef {import('unist').Point} Point
26614 */
26615
26616 /**
26617 * @typedef NodeLike
26618 * @property {string} type
26619 * @property {PositionLike | null | undefined} [position]
26620 *
26621 * @typedef PositionLike
26622 * @property {PointLike | null | undefined} [start]
26623 * @property {PointLike | null | undefined} [end]
26624 *
26625 * @typedef PointLike
26626 * @property {number | null | undefined} [line]
26627 * @property {number | null | undefined} [column]
26628 * @property {number | null | undefined} [offset]
26629 */
26630
26631 /**
26632 * Get the starting point of `node`.
26633 *
26634 * @param node
26635 * Node.
26636 * @returns
26637 * Point.
26638 */
26639 const pointStart = point('start')
26640
26641 /**
26642 * Get the ending point of `node`.
26643 *
26644 * @param node
26645 * Node.
26646 * @returns
26647 * Point.
26648 */
26649 const pointEnd = point('end')
26650
26651 /**
26652 * Get the positional info of `node`.
26653 *
26654 * @param {NodeLike | Node | null | undefined} [node]
26655 * Node.
26656 * @returns {Position}
26657 * Position.
26658 */
26659 function position(node) {
26660 return {start: pointStart(node), end: pointEnd(node)}
26661 }
26662
26663 /**
26664 * Get the positional info of `node`.
26665 *
26666 * @param {'start' | 'end'} type
26667 * Side.
26668 * @returns
26669 * Getter.
26670 */
26671 function point(type) {
26672 return point
26673
26674 /**
26675 * Get the point info of `node` at a bound side.
26676 *
26677 * @param {NodeLike | Node | null | undefined} [node]
26678 * @returns {Point}
26679 */
26680 function point(node) {
26681 const point = (node && node.position && node.position[type]) || {}
26682
26683 // To do: next major: don’t return points when invalid.
26684 return {
26685 // @ts-expect-error: in practice, null is allowed.
26686 line: point.line || null,
26687 // @ts-expect-error: in practice, null is allowed.
26688 column: point.column || null,
26689 // @ts-expect-error: in practice, null is allowed.
26690 offset: point.offset > -1 ? point.offset : null
26691 }
26692 }
26693 }
26694
26695
26696 /***/ }),
26697
26698 /***/ "../node_modules/unist-util-stringify-position/lib/index.js":
26699 /*!******************************************************************!*\
26700 !*** ../node_modules/unist-util-stringify-position/lib/index.js ***!
26701 \******************************************************************/
26702 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
26703
26704 "use strict";
26705 __webpack_require__.r(__webpack_exports__);
26706 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26707 /* harmony export */ "stringifyPosition": () => (/* binding */ stringifyPosition)
26708 /* harmony export */ });
26709 /**
26710 * @typedef {import('unist').Node} Node
26711 * @typedef {import('unist').Point} Point
26712 * @typedef {import('unist').Position} Position
26713 */
26714
26715 /**
26716 * @typedef NodeLike
26717 * @property {string} type
26718 * @property {PositionLike | null | undefined} [position]
26719 *
26720 * @typedef PositionLike
26721 * @property {PointLike | null | undefined} [start]
26722 * @property {PointLike | null | undefined} [end]
26723 *
26724 * @typedef PointLike
26725 * @property {number | null | undefined} [line]
26726 * @property {number | null | undefined} [column]
26727 * @property {number | null | undefined} [offset]
26728 */
26729
26730 /**
26731 * Serialize the positional info of a point, position (start and end points),
26732 * or node.
26733 *
26734 * @param {Node | NodeLike | Position | PositionLike | Point | PointLike | null | undefined} [value]
26735 * Node, position, or point.
26736 * @returns {string}
26737 * Pretty printed positional info of a node (`string`).
26738 *
26739 * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)
26740 * or a point `l:c` (when given `point`), where `l` stands for line, `c` for
26741 * column, `s` for `start`, and `e` for end.
26742 * An empty string (`''`) is returned if the given value is neither `node`,
26743 * `position`, nor `point`.
26744 */
26745 function stringifyPosition(value) {
26746 // Nothing.
26747 if (!value || typeof value !== 'object') {
26748 return ''
26749 }
26750
26751 // Node.
26752 if ('position' in value || 'type' in value) {
26753 return position(value.position)
26754 }
26755
26756 // Position.
26757 if ('start' in value || 'end' in value) {
26758 return position(value)
26759 }
26760
26761 // Point.
26762 if ('line' in value || 'column' in value) {
26763 return point(value)
26764 }
26765
26766 // ?
26767 return ''
26768 }
26769
26770 /**
26771 * @param {Point | PointLike | null | undefined} point
26772 * @returns {string}
26773 */
26774 function point(point) {
26775 return index(point && point.line) + ':' + index(point && point.column)
26776 }
26777
26778 /**
26779 * @param {Position | PositionLike | null | undefined} pos
26780 * @returns {string}
26781 */
26782 function position(pos) {
26783 return point(pos && pos.start) + '-' + point(pos && pos.end)
26784 }
26785
26786 /**
26787 * @param {number | null | undefined} value
26788 * @returns {number}
26789 */
26790 function index(value) {
26791 return value && typeof value === 'number' ? value : 1
26792 }
26793
26794
26795 /***/ }),
26796
26797 /***/ "../node_modules/unist-util-visit-parents/lib/color.browser.js":
26798 /*!*********************************************************************!*\
26799 !*** ../node_modules/unist-util-visit-parents/lib/color.browser.js ***!
26800 \*********************************************************************/
26801 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
26802
26803 "use strict";
26804 __webpack_require__.r(__webpack_exports__);
26805 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26806 /* harmony export */ "color": () => (/* binding */ color)
26807 /* harmony export */ });
26808 /**
26809 * @param {string} d
26810 * @returns {string}
26811 */
26812 function color(d) {
26813 return d
26814 }
26815
26816
26817 /***/ }),
26818
26819 /***/ "../node_modules/unist-util-visit-parents/lib/index.js":
26820 /*!*************************************************************!*\
26821 !*** ../node_modules/unist-util-visit-parents/lib/index.js ***!
26822 \*************************************************************/
26823 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
26824
26825 "use strict";
26826 __webpack_require__.r(__webpack_exports__);
26827 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26828 /* harmony export */ "CONTINUE": () => (/* binding */ CONTINUE),
26829 /* harmony export */ "EXIT": () => (/* binding */ EXIT),
26830 /* harmony export */ "SKIP": () => (/* binding */ SKIP),
26831 /* harmony export */ "visitParents": () => (/* binding */ visitParents)
26832 /* harmony export */ });
26833 /* harmony import */ var unist_util_is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-is */ "../node_modules/unist-util-is/lib/index.js");
26834 /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/unist-util-visit-parents/lib/color.browser.js");
26835 /**
26836 * @typedef {import('unist').Node} Node
26837 * @typedef {import('unist').Parent} Parent
26838 * @typedef {import('unist-util-is').Test} Test
26839 */
26840
26841 /**
26842 * @typedef {boolean | 'skip'} Action
26843 * Union of the action types.
26844 *
26845 * @typedef {number} Index
26846 * Move to the sibling at `index` next (after node itself is completely
26847 * traversed).
26848 *
26849 * Useful if mutating the tree, such as removing the node the visitor is
26850 * currently on, or any of its previous siblings.
26851 * Results less than 0 or greater than or equal to `children.length` stop
26852 * traversing the parent.
26853 *
26854 * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple
26855 * List with one or two values, the first an action, the second an index.
26856 *
26857 * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult
26858 * Any value that can be returned from a visitor.
26859 */
26860
26861 /**
26862 * @template {Node} [Visited=Node]
26863 * Visited node type.
26864 * @template {Parent} [Ancestor=Parent]
26865 * Ancestor type.
26866 * @callback Visitor
26867 * Handle a node (matching `test`, if given).
26868 *
26869 * Visitors are free to transform `node`.
26870 * They can also transform the parent of node (the last of `ancestors`).
26871 *
26872 * Replacing `node` itself, if `SKIP` is not returned, still causes its
26873 * descendants to be walked (which is a bug).
26874 *
26875 * When adding or removing previous siblings of `node` (or next siblings, in
26876 * case of reverse), the `Visitor` should return a new `Index` to specify the
26877 * sibling to traverse after `node` is traversed.
26878 * Adding or removing next siblings of `node` (or previous siblings, in case
26879 * of reverse) is handled as expected without needing to return a new `Index`.
26880 *
26881 * Removing the children property of an ancestor still results in them being
26882 * traversed.
26883 * @param {Visited} node
26884 * Found node.
26885 * @param {Array<Ancestor>} ancestors
26886 * Ancestors of `node`.
26887 * @returns {VisitorResult}
26888 * What to do next.
26889 *
26890 * An `Index` is treated as a tuple of `[CONTINUE, Index]`.
26891 * An `Action` is treated as a tuple of `[Action]`.
26892 *
26893 * Passing a tuple back only makes sense if the `Action` is `SKIP`.
26894 * When the `Action` is `EXIT`, that action can be returned.
26895 * When the `Action` is `CONTINUE`, `Index` can be returned.
26896 */
26897
26898 /**
26899 * @template {Node} [Tree=Node]
26900 * Tree type.
26901 * @template {Test} [Check=string]
26902 * Test type.
26903 * @typedef {Visitor<import('./complex-types.js').Matches<import('./complex-types.js').InclusiveDescendant<Tree>, Check>, Extract<import('./complex-types.js').InclusiveDescendant<Tree>, Parent>>} BuildVisitor
26904 * Build a typed `Visitor` function from a tree and a test.
26905 *
26906 * It will infer which values are passed as `node` and which as `parents`.
26907 */
26908
26909
26910
26911
26912 /**
26913 * Continue traversing as normal.
26914 */
26915 const CONTINUE = true
26916
26917 /**
26918 * Stop traversing immediately.
26919 */
26920 const EXIT = false
26921
26922 /**
26923 * Do not traverse this node’s children.
26924 */
26925 const SKIP = 'skip'
26926
26927 /**
26928 * Visit nodes, with ancestral information.
26929 *
26930 * This algorithm performs *depth-first* *tree traversal* in *preorder*
26931 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
26932 *
26933 * You can choose for which nodes `visitor` is called by passing a `test`.
26934 * For complex tests, you should test yourself in `visitor`, as it will be
26935 * faster and will have improved type information.
26936 *
26937 * Walking the tree is an intensive task.
26938 * Make use of the return values of the visitor when possible.
26939 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
26940 * to check if a node matches, and then perform different operations.
26941 *
26942 * You can change the tree.
26943 * See `Visitor` for more info.
26944 *
26945 * @param tree
26946 * Tree to traverse.
26947 * @param test
26948 * `unist-util-is`-compatible test
26949 * @param visitor
26950 * Handle each node.
26951 * @param reverse
26952 * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
26953 * @returns
26954 * Nothing.
26955 */
26956 const visitParents =
26957 /**
26958 * @type {(
26959 * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) &
26960 * (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void)
26961 * )}
26962 */
26963 (
26964 /**
26965 * @param {Node} tree
26966 * @param {Test} test
26967 * @param {Visitor<Node>} visitor
26968 * @param {boolean | null | undefined} [reverse]
26969 * @returns {void}
26970 */
26971 function (tree, test, visitor, reverse) {
26972 if (typeof test === 'function' && typeof visitor !== 'function') {
26973 reverse = visitor
26974 // @ts-expect-error no visitor given, so `visitor` is test.
26975 visitor = test
26976 test = null
26977 }
26978
26979 const is = (0,unist_util_is__WEBPACK_IMPORTED_MODULE_0__.convert)(test)
26980 const step = reverse ? -1 : 1
26981
26982 factory(tree, undefined, [])()
26983
26984 /**
26985 * @param {Node} node
26986 * @param {number | undefined} index
26987 * @param {Array<Parent>} parents
26988 */
26989 function factory(node, index, parents) {
26990 /** @type {Record<string, unknown>} */
26991 // @ts-expect-error: hush
26992 const value = node && typeof node === 'object' ? node : {}
26993
26994 if (typeof value.type === 'string') {
26995 const name =
26996 // `hast`
26997 typeof value.tagName === 'string'
26998 ? value.tagName
26999 : // `xast`
27000 typeof value.name === 'string'
27001 ? value.name
27002 : undefined
27003
27004 Object.defineProperty(visit, 'name', {
27005 value:
27006 'node (' + (0,_color_js__WEBPACK_IMPORTED_MODULE_1__.color)(node.type + (name ? '<' + name + '>' : '')) + ')'
27007 })
27008 }
27009
27010 return visit
27011
27012 function visit() {
27013 /** @type {ActionTuple} */
27014 let result = []
27015 /** @type {ActionTuple} */
27016 let subresult
27017 /** @type {number} */
27018 let offset
27019 /** @type {Array<Parent>} */
27020 let grandparents
27021
27022 if (!test || is(node, index, parents[parents.length - 1] || null)) {
27023 result = toResult(visitor(node, parents))
27024
27025 if (result[0] === EXIT) {
27026 return result
27027 }
27028 }
27029
27030 // @ts-expect-error looks like a parent.
27031 if (node.children && result[0] !== SKIP) {
27032 // @ts-expect-error looks like a parent.
27033 offset = (reverse ? node.children.length : -1) + step
27034 // @ts-expect-error looks like a parent.
27035 grandparents = parents.concat(node)
27036
27037 // @ts-expect-error looks like a parent.
27038 while (offset > -1 && offset < node.children.length) {
27039 // @ts-expect-error looks like a parent.
27040 subresult = factory(node.children[offset], offset, grandparents)()
27041
27042 if (subresult[0] === EXIT) {
27043 return subresult
27044 }
27045
27046 offset =
27047 typeof subresult[1] === 'number' ? subresult[1] : offset + step
27048 }
27049 }
27050
27051 return result
27052 }
27053 }
27054 }
27055 )
27056
27057 /**
27058 * Turn a return value into a clean result.
27059 *
27060 * @param {VisitorResult} value
27061 * Valid return values from visitors.
27062 * @returns {ActionTuple}
27063 * Clean result.
27064 */
27065 function toResult(value) {
27066 if (Array.isArray(value)) {
27067 return value
27068 }
27069
27070 if (typeof value === 'number') {
27071 return [CONTINUE, value]
27072 }
27073
27074 return [value]
27075 }
27076
27077
27078 /***/ }),
27079
27080 /***/ "../node_modules/unist-util-visit/lib/index.js":
27081 /*!*****************************************************!*\
27082 !*** ../node_modules/unist-util-visit/lib/index.js ***!
27083 \*****************************************************/
27084 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
27085
27086 "use strict";
27087 __webpack_require__.r(__webpack_exports__);
27088 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27089 /* harmony export */ "CONTINUE": () => (/* reexport safe */ unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.CONTINUE),
27090 /* harmony export */ "EXIT": () => (/* reexport safe */ unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.EXIT),
27091 /* harmony export */ "SKIP": () => (/* reexport safe */ unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.SKIP),
27092 /* harmony export */ "visit": () => (/* binding */ visit)
27093 /* harmony export */ });
27094 /* harmony import */ var unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-visit-parents */ "../node_modules/unist-util-visit-parents/lib/index.js");
27095 /**
27096 * @typedef {import('unist').Node} Node
27097 * @typedef {import('unist').Parent} Parent
27098 * @typedef {import('unist-util-is').Test} Test
27099 * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult
27100 */
27101
27102 /**
27103 * Check if `Child` can be a child of `Ancestor`.
27104 *
27105 * Returns the ancestor when `Child` can be a child of `Ancestor`, or returns
27106 * `never`.
27107 *
27108 * @template {Node} Ancestor
27109 * Node type.
27110 * @template {Node} Child
27111 * Node type.
27112 * @typedef {(
27113 * Ancestor extends Parent
27114 * ? Child extends Ancestor['children'][number]
27115 * ? Ancestor
27116 * : never
27117 * : never
27118 * )} ParentsOf
27119 */
27120
27121 /**
27122 * @template {Node} [Visited=Node]
27123 * Visited node type.
27124 * @template {Parent} [Ancestor=Parent]
27125 * Ancestor type.
27126 * @callback Visitor
27127 * Handle a node (matching `test`, if given).
27128 *
27129 * Visitors are free to transform `node`.
27130 * They can also transform `parent`.
27131 *
27132 * Replacing `node` itself, if `SKIP` is not returned, still causes its
27133 * descendants to be walked (which is a bug).
27134 *
27135 * When adding or removing previous siblings of `node` (or next siblings, in
27136 * case of reverse), the `Visitor` should return a new `Index` to specify the
27137 * sibling to traverse after `node` is traversed.
27138 * Adding or removing next siblings of `node` (or previous siblings, in case
27139 * of reverse) is handled as expected without needing to return a new `Index`.
27140 *
27141 * Removing the children property of `parent` still results in them being
27142 * traversed.
27143 * @param {Visited} node
27144 * Found node.
27145 * @param {Visited extends Node ? number | null : never} index
27146 * Index of `node` in `parent`.
27147 * @param {Ancestor extends Node ? Ancestor | null : never} parent
27148 * Parent of `node`.
27149 * @returns {VisitorResult}
27150 * What to do next.
27151 *
27152 * An `Index` is treated as a tuple of `[CONTINUE, Index]`.
27153 * An `Action` is treated as a tuple of `[Action]`.
27154 *
27155 * Passing a tuple back only makes sense if the `Action` is `SKIP`.
27156 * When the `Action` is `EXIT`, that action can be returned.
27157 * When the `Action` is `CONTINUE`, `Index` can be returned.
27158 */
27159
27160 /**
27161 * Build a typed `Visitor` function from a node and all possible parents.
27162 *
27163 * It will infer which values are passed as `node` and which as `parent`.
27164 *
27165 * @template {Node} Visited
27166 * Node type.
27167 * @template {Parent} Ancestor
27168 * Parent type.
27169 * @typedef {Visitor<Visited, ParentsOf<Ancestor, Visited>>} BuildVisitorFromMatch
27170 */
27171
27172 /**
27173 * Build a typed `Visitor` function from a list of descendants and a test.
27174 *
27175 * It will infer which values are passed as `node` and which as `parent`.
27176 *
27177 * @template {Node} Descendant
27178 * Node type.
27179 * @template {Test} Check
27180 * Test type.
27181 * @typedef {(
27182 * BuildVisitorFromMatch<
27183 * import('unist-util-visit-parents/complex-types.js').Matches<Descendant, Check>,
27184 * Extract<Descendant, Parent>
27185 * >
27186 * )} BuildVisitorFromDescendants
27187 */
27188
27189 /**
27190 * Build a typed `Visitor` function from a tree and a test.
27191 *
27192 * It will infer which values are passed as `node` and which as `parent`.
27193 *
27194 * @template {Node} [Tree=Node]
27195 * Node type.
27196 * @template {Test} [Check=string]
27197 * Test type.
27198 * @typedef {(
27199 * BuildVisitorFromDescendants<
27200 * import('unist-util-visit-parents/complex-types.js').InclusiveDescendant<Tree>,
27201 * Check
27202 * >
27203 * )} BuildVisitor
27204 */
27205
27206
27207
27208 /**
27209 * Visit nodes.
27210 *
27211 * This algorithm performs *depth-first* *tree traversal* in *preorder*
27212 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
27213 *
27214 * You can choose for which nodes `visitor` is called by passing a `test`.
27215 * For complex tests, you should test yourself in `visitor`, as it will be
27216 * faster and will have improved type information.
27217 *
27218 * Walking the tree is an intensive task.
27219 * Make use of the return values of the visitor when possible.
27220 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
27221 * to check if a node matches, and then perform different operations.
27222 *
27223 * You can change the tree.
27224 * See `Visitor` for more info.
27225 *
27226 * @param tree
27227 * Tree to traverse.
27228 * @param test
27229 * `unist-util-is`-compatible test
27230 * @param visitor
27231 * Handle each node.
27232 * @param reverse
27233 * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
27234 * @returns
27235 * Nothing.
27236 */
27237 const visit =
27238 /**
27239 * @type {(
27240 * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) &
27241 * (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void)
27242 * )}
27243 */
27244 (
27245 /**
27246 * @param {Node} tree
27247 * @param {Test} test
27248 * @param {Visitor} visitor
27249 * @param {boolean | null | undefined} [reverse]
27250 * @returns {void}
27251 */
27252 function (tree, test, visitor, reverse) {
27253 if (typeof test === 'function' && typeof visitor !== 'function') {
27254 reverse = visitor
27255 visitor = test
27256 test = null
27257 }
27258
27259 (0,unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.visitParents)(tree, test, overload, reverse)
27260
27261 /**
27262 * @param {Node} node
27263 * @param {Array<Parent>} parents
27264 */
27265 function overload(node, parents) {
27266 const parent = parents[parents.length - 1]
27267 return visitor(
27268 node,
27269 parent ? parent.children.indexOf(node) : null,
27270 parent
27271 )
27272 }
27273 }
27274 )
27275
27276
27277
27278
27279 /***/ }),
27280
27281 /***/ "../node_modules/uvu/assert/index.mjs":
27282 /*!********************************************!*\
27283 !*** ../node_modules/uvu/assert/index.mjs ***!
27284 \********************************************/
27285 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
27286
27287 "use strict";
27288 __webpack_require__.r(__webpack_exports__);
27289 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27290 /* harmony export */ "Assertion": () => (/* binding */ Assertion),
27291 /* harmony export */ "equal": () => (/* binding */ equal),
27292 /* harmony export */ "fixture": () => (/* binding */ fixture),
27293 /* harmony export */ "instance": () => (/* binding */ instance),
27294 /* harmony export */ "is": () => (/* binding */ is),
27295 /* harmony export */ "match": () => (/* binding */ match),
27296 /* harmony export */ "not": () => (/* binding */ not),
27297 /* harmony export */ "ok": () => (/* binding */ ok),
27298 /* harmony export */ "snapshot": () => (/* binding */ snapshot),
27299 /* harmony export */ "throws": () => (/* binding */ throws),
27300 /* harmony export */ "type": () => (/* binding */ type),
27301 /* harmony export */ "unreachable": () => (/* binding */ unreachable)
27302 /* harmony export */ });
27303 /* harmony import */ var dequal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dequal */ "../node_modules/dequal/dist/index.mjs");
27304 /* harmony import */ var uvu_diff__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uvu/diff */ "../node_modules/uvu/diff/index.mjs");
27305
27306
27307
27308 function dedent(str) {
27309 str = str.replace(/\r?\n/g, '\n');
27310 let arr = str.match(/^[ \t]*(?=\S)/gm);
27311 let i = 0, min = 1/0, len = (arr||[]).length;
27312 for (; i < len; i++) min = Math.min(min, arr[i].length);
27313 return len && min ? str.replace(new RegExp(`^[ \\t]{${min}}`, 'gm'), '') : str;
27314 }
27315
27316 class Assertion extends Error {
27317 constructor(opts={}) {
27318 super(opts.message);
27319 this.name = 'Assertion';
27320 this.code = 'ERR_ASSERTION';
27321 if (Error.captureStackTrace) {
27322 Error.captureStackTrace(this, this.constructor);
27323 }
27324 this.details = opts.details || false;
27325 this.generated = !!opts.generated;
27326 this.operator = opts.operator;
27327 this.expects = opts.expects;
27328 this.actual = opts.actual;
27329 }
27330 }
27331
27332 function assert(bool, actual, expects, operator, detailer, backup, msg) {
27333 if (bool) return;
27334 let message = msg || backup;
27335 if (msg instanceof Error) throw msg;
27336 let details = detailer && detailer(actual, expects);
27337 throw new Assertion({ actual, expects, operator, message, details, generated: !msg });
27338 }
27339
27340 function ok(val, msg) {
27341 assert(!!val, false, true, 'ok', false, 'Expected value to be truthy', msg);
27342 }
27343
27344 function is(val, exp, msg) {
27345 assert(val === exp, val, exp, 'is', uvu_diff__WEBPACK_IMPORTED_MODULE_1__.compare, 'Expected values to be strictly equal:', msg);
27346 }
27347
27348 function equal(val, exp, msg) {
27349 assert((0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(val, exp), val, exp, 'equal', uvu_diff__WEBPACK_IMPORTED_MODULE_1__.compare, 'Expected values to be deeply equal:', msg);
27350 }
27351
27352 function unreachable(msg) {
27353 assert(false, true, false, 'unreachable', false, 'Expected not to be reached!', msg);
27354 }
27355
27356 function type(val, exp, msg) {
27357 let tmp = typeof val;
27358 assert(tmp === exp, tmp, exp, 'type', false, `Expected "${tmp}" to be "${exp}"`, msg);
27359 }
27360
27361 function instance(val, exp, msg) {
27362 let name = '`' + (exp.name || exp.constructor.name) + '`';
27363 assert(val instanceof exp, val, exp, 'instance', false, `Expected value to be an instance of ${name}`, msg);
27364 }
27365
27366 function match(val, exp, msg) {
27367 if (typeof exp === 'string') {
27368 assert(val.includes(exp), val, exp, 'match', false, `Expected value to include "${exp}" substring`, msg);
27369 } else {
27370 assert(exp.test(val), val, exp, 'match', false, `Expected value to match \`${String(exp)}\` pattern`, msg);
27371 }
27372 }
27373
27374 function snapshot(val, exp, msg) {
27375 val=dedent(val); exp=dedent(exp);
27376 assert(val === exp, val, exp, 'snapshot', uvu_diff__WEBPACK_IMPORTED_MODULE_1__.lines, 'Expected value to match snapshot:', msg);
27377 }
27378
27379 const lineNums = (x, y) => (0,uvu_diff__WEBPACK_IMPORTED_MODULE_1__.lines)(x, y, 1);
27380 function fixture(val, exp, msg) {
27381 val=dedent(val); exp=dedent(exp);
27382 assert(val === exp, val, exp, 'fixture', lineNums, 'Expected value to match fixture:', msg);
27383 }
27384
27385 function throws(blk, exp, msg) {
27386 if (!msg && typeof exp === 'string') {
27387 msg = exp; exp = null;
27388 }
27389
27390 try {
27391 blk();
27392 assert(false, false, true, 'throws', false, 'Expected function to throw', msg);
27393 } catch (err) {
27394 if (err instanceof Assertion) throw err;
27395
27396 if (typeof exp === 'function') {
27397 assert(exp(err), false, true, 'throws', false, 'Expected function to throw matching exception', msg);
27398 } else if (exp instanceof RegExp) {
27399 assert(exp.test(err.message), false, true, 'throws', false, `Expected function to throw exception matching \`${String(exp)}\` pattern`, msg);
27400 }
27401 }
27402 }
27403
27404 // ---
27405
27406 function not(val, msg) {
27407 assert(!val, true, false, 'not', false, 'Expected value to be falsey', msg);
27408 }
27409
27410 not.ok = not;
27411
27412 is.not = function (val, exp, msg) {
27413 assert(val !== exp, val, exp, 'is.not', false, 'Expected values not to be strictly equal', msg);
27414 }
27415
27416 not.equal = function (val, exp, msg) {
27417 assert(!(0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(val, exp), val, exp, 'not.equal', false, 'Expected values not to be deeply equal', msg);
27418 }
27419
27420 not.type = function (val, exp, msg) {
27421 let tmp = typeof val;
27422 assert(tmp !== exp, tmp, exp, 'not.type', false, `Expected "${tmp}" not to be "${exp}"`, msg);
27423 }
27424
27425 not.instance = function (val, exp, msg) {
27426 let name = '`' + (exp.name || exp.constructor.name) + '`';
27427 assert(!(val instanceof exp), val, exp, 'not.instance', false, `Expected value not to be an instance of ${name}`, msg);
27428 }
27429
27430 not.snapshot = function (val, exp, msg) {
27431 val=dedent(val); exp=dedent(exp);
27432 assert(val !== exp, val, exp, 'not.snapshot', false, 'Expected value not to match snapshot', msg);
27433 }
27434
27435 not.fixture = function (val, exp, msg) {
27436 val=dedent(val); exp=dedent(exp);
27437 assert(val !== exp, val, exp, 'not.fixture', false, 'Expected value not to match fixture', msg);
27438 }
27439
27440 not.match = function (val, exp, msg) {
27441 if (typeof exp === 'string') {
27442 assert(!val.includes(exp), val, exp, 'not.match', false, `Expected value not to include "${exp}" substring`, msg);
27443 } else {
27444 assert(!exp.test(val), val, exp, 'not.match', false, `Expected value not to match \`${String(exp)}\` pattern`, msg);
27445 }
27446 }
27447
27448 not.throws = function (blk, exp, msg) {
27449 if (!msg && typeof exp === 'string') {
27450 msg = exp; exp = null;
27451 }
27452
27453 try {
27454 blk();
27455 } catch (err) {
27456 if (typeof exp === 'function') {
27457 assert(!exp(err), true, false, 'not.throws', false, 'Expected function not to throw matching exception', msg);
27458 } else if (exp instanceof RegExp) {
27459 assert(!exp.test(err.message), true, false, 'not.throws', false, `Expected function not to throw exception matching \`${String(exp)}\` pattern`, msg);
27460 } else if (!exp) {
27461 assert(false, true, false, 'not.throws', false, 'Expected function not to throw', msg);
27462 }
27463 }
27464 }
27465
27466
27467 /***/ }),
27468
27469 /***/ "../node_modules/uvu/diff/index.mjs":
27470 /*!******************************************!*\
27471 !*** ../node_modules/uvu/diff/index.mjs ***!
27472 \******************************************/
27473 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
27474
27475 "use strict";
27476 __webpack_require__.r(__webpack_exports__);
27477 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27478 /* harmony export */ "arrays": () => (/* binding */ arrays),
27479 /* harmony export */ "chars": () => (/* binding */ chars),
27480 /* harmony export */ "circular": () => (/* binding */ circular),
27481 /* harmony export */ "compare": () => (/* binding */ compare),
27482 /* harmony export */ "direct": () => (/* binding */ direct),
27483 /* harmony export */ "lines": () => (/* binding */ lines),
27484 /* harmony export */ "sort": () => (/* binding */ sort),
27485 /* harmony export */ "stringify": () => (/* binding */ stringify)
27486 /* harmony export */ });
27487 /* harmony import */ var kleur__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kleur */ "../node_modules/uvu/node_modules/kleur/index.mjs");
27488 /* harmony import */ var diff__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diff */ "../node_modules/diff/lib/index.mjs");
27489
27490
27491
27492 const colors = {
27493 '--': kleur__WEBPACK_IMPORTED_MODULE_0__["default"].red,
27494 '··': kleur__WEBPACK_IMPORTED_MODULE_0__["default"].grey,
27495 '++': kleur__WEBPACK_IMPORTED_MODULE_0__["default"].green,
27496 };
27497
27498 const TITLE = kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim().italic;
27499 const TAB=kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('→'), SPACE=kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('·'), NL=kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('↵');
27500 const LOG = (sym, str) => colors[sym](sym + PRETTY(str)) + '\n';
27501 const LINE = (num, x) => kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('L' + String(num).padStart(x, '0') + ' ');
27502 const PRETTY = str => str.replace(/[ ]/g, SPACE).replace(/\t/g, TAB).replace(/(\r?\n)/g, NL);
27503
27504 function line(obj, prev, pad) {
27505 let char = obj.removed ? '--' : obj.added ? '++' : '··';
27506 let arr = obj.value.replace(/\r?\n$/, '').split('\n');
27507 let i=0, tmp, out='';
27508
27509 if (obj.added) out += colors[char]().underline(TITLE('Expected:')) + '\n';
27510 else if (obj.removed) out += colors[char]().underline(TITLE('Actual:')) + '\n';
27511
27512 for (; i < arr.length; i++) {
27513 tmp = arr[i];
27514 if (tmp != null) {
27515 if (prev) out += LINE(prev + i, pad);
27516 out += LOG(char, tmp || '\n');
27517 }
27518 }
27519
27520 return out;
27521 }
27522
27523 // TODO: want better diffing
27524 //~> complex items bail outright
27525 function arrays(input, expect) {
27526 let arr = diff__WEBPACK_IMPORTED_MODULE_1__.diffArrays(input, expect);
27527 let i=0, j=0, k=0, tmp, val, char, isObj, str;
27528 let out = LOG('··', '[');
27529
27530 for (; i < arr.length; i++) {
27531 char = (tmp = arr[i]).removed ? '--' : tmp.added ? '++' : '··';
27532
27533 if (tmp.added) {
27534 out += colors[char]().underline(TITLE('Expected:')) + '\n';
27535 } else if (tmp.removed) {
27536 out += colors[char]().underline(TITLE('Actual:')) + '\n';
27537 }
27538
27539 for (j=0; j < tmp.value.length; j++) {
27540 isObj = (tmp.value[j] && typeof tmp.value[j] === 'object');
27541 val = stringify(tmp.value[j]).split(/\r?\n/g);
27542 for (k=0; k < val.length;) {
27543 str = ' ' + val[k++] + (isObj ? '' : ',');
27544 if (isObj && k === val.length && (j + 1) < tmp.value.length) str += ',';
27545 out += LOG(char, str);
27546 }
27547 }
27548 }
27549
27550 return out + LOG('··', ']');
27551 }
27552
27553 function lines(input, expect, linenum = 0) {
27554 let i=0, tmp, output='';
27555 let arr = diff__WEBPACK_IMPORTED_MODULE_1__.diffLines(input, expect);
27556 let pad = String(expect.split(/\r?\n/g).length - linenum).length;
27557
27558 for (; i < arr.length; i++) {
27559 output += line(tmp = arr[i], linenum, pad);
27560 if (linenum && !tmp.removed) linenum += tmp.count;
27561 }
27562
27563 return output;
27564 }
27565
27566 function chars(input, expect) {
27567 let arr = diff__WEBPACK_IMPORTED_MODULE_1__.diffChars(input, expect);
27568 let i=0, output='', tmp;
27569
27570 let l1 = input.length;
27571 let l2 = expect.length;
27572
27573 let p1 = PRETTY(input);
27574 let p2 = PRETTY(expect);
27575
27576 tmp = arr[i];
27577
27578 if (l1 === l2) {
27579 // no length offsets
27580 } else if (tmp.removed && arr[i + 1]) {
27581 let del = tmp.count - arr[i + 1].count;
27582 if (del == 0) {
27583 // wash~
27584 } else if (del > 0) {
27585 expect = ' '.repeat(del) + expect;
27586 p2 = ' '.repeat(del) + p2;
27587 l2 += del;
27588 } else if (del < 0) {
27589 input = ' '.repeat(-del) + input;
27590 p1 = ' '.repeat(-del) + p1;
27591 l1 += -del;
27592 }
27593 }
27594
27595 output += direct(p1, p2, l1, l2);
27596
27597 if (l1 === l2) {
27598 for (tmp=' '; i < l1; i++) {
27599 tmp += input[i] === expect[i] ? ' ' : '^';
27600 }
27601 } else {
27602 for (tmp=' '; i < arr.length; i++) {
27603 tmp += ((arr[i].added || arr[i].removed) ? '^' : ' ').repeat(Math.max(arr[i].count, 0));
27604 if (i + 1 < arr.length && ((arr[i].added && arr[i+1].removed) || (arr[i].removed && arr[i+1].added))) {
27605 arr[i + 1].count -= arr[i].count;
27606 }
27607 }
27608 }
27609
27610 return output + kleur__WEBPACK_IMPORTED_MODULE_0__["default"].red(tmp);
27611 }
27612
27613 function direct(input, expect, lenA = String(input).length, lenB = String(expect).length) {
27614 let gutter = 4;
27615 let lenC = Math.max(lenA, lenB);
27616 let typeA=typeof input, typeB=typeof expect;
27617
27618 if (typeA !== typeB) {
27619 gutter = 2;
27620
27621 let delA = gutter + lenC - lenA;
27622 let delB = gutter + lenC - lenB;
27623
27624 input += ' '.repeat(delA) + kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim(`[${typeA}]`);
27625 expect += ' '.repeat(delB) + kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim(`[${typeB}]`);
27626
27627 lenA += delA + typeA.length + 2;
27628 lenB += delB + typeB.length + 2;
27629 lenC = Math.max(lenA, lenB);
27630 }
27631
27632 let output = colors['++']('++' + expect + ' '.repeat(gutter + lenC - lenB) + TITLE('(Expected)')) + '\n';
27633 return output + colors['--']('--' + input + ' '.repeat(gutter + lenC - lenA) + TITLE('(Actual)')) + '\n';
27634 }
27635
27636 function sort(input, expect) {
27637 var k, i=0, tmp, isArr = Array.isArray(input);
27638 var keys=[], out=isArr ? Array(input.length) : {};
27639
27640 if (isArr) {
27641 for (i=0; i < out.length; i++) {
27642 tmp = input[i];
27643 if (!tmp || typeof tmp !== 'object') out[i] = tmp;
27644 else out[i] = sort(tmp, expect[i]); // might not be right
27645 }
27646 } else {
27647 for (k in expect)
27648 keys.push(k);
27649
27650 for (; i < keys.length; i++) {
27651 if (Object.prototype.hasOwnProperty.call(input, k = keys[i])) {
27652 if (!(tmp = input[k]) || typeof tmp !== 'object') out[k] = tmp;
27653 else out[k] = sort(tmp, expect[k]);
27654 }
27655 }
27656
27657 for (k in input) {
27658 if (!out.hasOwnProperty(k)) {
27659 out[k] = input[k]; // expect didnt have
27660 }
27661 }
27662 }
27663
27664 return out;
27665 }
27666
27667 function circular() {
27668 var cache = new Set;
27669 return function print(key, val) {
27670 if (val === void 0) return '[__VOID__]';
27671 if (typeof val === 'number' && val !== val) return '[__NAN__]';
27672 if (typeof val === 'bigint') return val.toString();
27673 if (!val || typeof val !== 'object') return val;
27674 if (cache.has(val)) return '[Circular]';
27675 cache.add(val); return val;
27676 }
27677 }
27678
27679 function stringify(input) {
27680 return JSON.stringify(input, circular(), 2).replace(/"\[__NAN__\]"/g, 'NaN').replace(/"\[__VOID__\]"/g, 'undefined');
27681 }
27682
27683 function compare(input, expect) {
27684 if (Array.isArray(expect) && Array.isArray(input)) return arrays(input, expect);
27685 if (expect instanceof RegExp) return chars(''+input, ''+expect);
27686
27687 let isA = input && typeof input == 'object';
27688 let isB = expect && typeof expect == 'object';
27689
27690 if (isA && isB) input = sort(input, expect);
27691 if (isB) expect = stringify(expect);
27692 if (isA) input = stringify(input);
27693
27694 if (expect && typeof expect == 'object') {
27695 input = stringify(sort(input, expect));
27696 expect = stringify(expect);
27697 }
27698
27699 isA = typeof input == 'string';
27700 isB = typeof expect == 'string';
27701
27702 if (isA && /\r?\n/.test(input)) return lines(input, ''+expect);
27703 if (isB && /\r?\n/.test(expect)) return lines(''+input, expect);
27704 if (isA && isB) return chars(input, expect);
27705
27706 return direct(input, expect);
27707 }
27708
27709
27710 /***/ }),
27711
27712 /***/ "../node_modules/uvu/node_modules/kleur/index.mjs":
27713 /*!********************************************************!*\
27714 !*** ../node_modules/uvu/node_modules/kleur/index.mjs ***!
27715 \********************************************************/
27716 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
27717
27718 "use strict";
27719 __webpack_require__.r(__webpack_exports__);
27720 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27721 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
27722 /* harmony export */ });
27723
27724
27725 let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;
27726 if (typeof process !== 'undefined') {
27727 ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
27728 isTTY = process.stdout && process.stdout.isTTY;
27729 }
27730
27731 const $ = {
27732 enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && (
27733 FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY
27734 ),
27735
27736 // modifiers
27737 reset: init(0, 0),
27738 bold: init(1, 22),
27739 dim: init(2, 22),
27740 italic: init(3, 23),
27741 underline: init(4, 24),
27742 inverse: init(7, 27),
27743 hidden: init(8, 28),
27744 strikethrough: init(9, 29),
27745
27746 // colors
27747 black: init(30, 39),
27748 red: init(31, 39),
27749 green: init(32, 39),
27750 yellow: init(33, 39),
27751 blue: init(34, 39),
27752 magenta: init(35, 39),
27753 cyan: init(36, 39),
27754 white: init(37, 39),
27755 gray: init(90, 39),
27756 grey: init(90, 39),
27757
27758 // background colors
27759 bgBlack: init(40, 49),
27760 bgRed: init(41, 49),
27761 bgGreen: init(42, 49),
27762 bgYellow: init(43, 49),
27763 bgBlue: init(44, 49),
27764 bgMagenta: init(45, 49),
27765 bgCyan: init(46, 49),
27766 bgWhite: init(47, 49)
27767 };
27768
27769 function run(arr, str) {
27770 let i=0, tmp, beg='', end='';
27771 for (; i < arr.length; i++) {
27772 tmp = arr[i];
27773 beg += tmp.open;
27774 end += tmp.close;
27775 if (!!~str.indexOf(tmp.close)) {
27776 str = str.replace(tmp.rgx, tmp.close + tmp.open);
27777 }
27778 }
27779 return beg + str + end;
27780 }
27781
27782 function chain(has, keys) {
27783 let ctx = { has, keys };
27784
27785 ctx.reset = $.reset.bind(ctx);
27786 ctx.bold = $.bold.bind(ctx);
27787 ctx.dim = $.dim.bind(ctx);
27788 ctx.italic = $.italic.bind(ctx);
27789 ctx.underline = $.underline.bind(ctx);
27790 ctx.inverse = $.inverse.bind(ctx);
27791 ctx.hidden = $.hidden.bind(ctx);
27792 ctx.strikethrough = $.strikethrough.bind(ctx);
27793
27794 ctx.black = $.black.bind(ctx);
27795 ctx.red = $.red.bind(ctx);
27796 ctx.green = $.green.bind(ctx);
27797 ctx.yellow = $.yellow.bind(ctx);
27798 ctx.blue = $.blue.bind(ctx);
27799 ctx.magenta = $.magenta.bind(ctx);
27800 ctx.cyan = $.cyan.bind(ctx);
27801 ctx.white = $.white.bind(ctx);
27802 ctx.gray = $.gray.bind(ctx);
27803 ctx.grey = $.grey.bind(ctx);
27804
27805 ctx.bgBlack = $.bgBlack.bind(ctx);
27806 ctx.bgRed = $.bgRed.bind(ctx);
27807 ctx.bgGreen = $.bgGreen.bind(ctx);
27808 ctx.bgYellow = $.bgYellow.bind(ctx);
27809 ctx.bgBlue = $.bgBlue.bind(ctx);
27810 ctx.bgMagenta = $.bgMagenta.bind(ctx);
27811 ctx.bgCyan = $.bgCyan.bind(ctx);
27812 ctx.bgWhite = $.bgWhite.bind(ctx);
27813
27814 return ctx;
27815 }
27816
27817 function init(open, close) {
27818 let blk = {
27819 open: `\x1b[${open}m`,
27820 close: `\x1b[${close}m`,
27821 rgx: new RegExp(`\\x1b\\[${close}m`, 'g')
27822 };
27823 return function (txt) {
27824 if (this !== void 0 && this.has !== void 0) {
27825 !!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk));
27826 return txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';
27827 }
27828 return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';
27829 };
27830 }
27831
27832 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ($);
27833
27834
27835 /***/ }),
27836
27837 /***/ "../node_modules/vfile-message/lib/index.js":
27838 /*!**************************************************!*\
27839 !*** ../node_modules/vfile-message/lib/index.js ***!
27840 \**************************************************/
27841 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
27842
27843 "use strict";
27844 __webpack_require__.r(__webpack_exports__);
27845 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27846 /* harmony export */ "VFileMessage": () => (/* binding */ VFileMessage)
27847 /* harmony export */ });
27848 /* harmony import */ var unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-stringify-position */ "../node_modules/unist-util-stringify-position/lib/index.js");
27849 /**
27850 * @typedef {import('unist').Node} Node
27851 * @typedef {import('unist').Position} Position
27852 * @typedef {import('unist').Point} Point
27853 * @typedef {object & {type: string, position?: Position | undefined}} NodeLike
27854 */
27855
27856
27857
27858 /**
27859 * Message.
27860 */
27861 class VFileMessage extends Error {
27862 /**
27863 * Create a message for `reason` at `place` from `origin`.
27864 *
27865 * When an error is passed in as `reason`, the `stack` is copied.
27866 *
27867 * @param {string | Error | VFileMessage} reason
27868 * Reason for message, uses the stack and message of the error if given.
27869 *
27870 * > 👉 **Note**: you should use markdown.
27871 * @param {Node | NodeLike | Position | Point | null | undefined} [place]
27872 * Place in file where the message occurred.
27873 * @param {string | null | undefined} [origin]
27874 * Place in code where the message originates (example:
27875 * `'my-package:my-rule'` or `'my-rule'`).
27876 * @returns
27877 * Instance of `VFileMessage`.
27878 */
27879 // To do: next major: expose `undefined` everywhere instead of `null`.
27880 constructor(reason, place, origin) {
27881 /** @type {[string | null, string | null]} */
27882 const parts = [null, null]
27883 /** @type {Position} */
27884 let position = {
27885 // @ts-expect-error: we always follows the structure of `position`.
27886 start: {line: null, column: null},
27887 // @ts-expect-error: "
27888 end: {line: null, column: null}
27889 }
27890
27891 super()
27892
27893 if (typeof place === 'string') {
27894 origin = place
27895 place = undefined
27896 }
27897
27898 if (typeof origin === 'string') {
27899 const index = origin.indexOf(':')
27900
27901 if (index === -1) {
27902 parts[1] = origin
27903 } else {
27904 parts[0] = origin.slice(0, index)
27905 parts[1] = origin.slice(index + 1)
27906 }
27907 }
27908
27909 if (place) {
27910 // Node.
27911 if ('type' in place || 'position' in place) {
27912 if (place.position) {
27913 // To do: next major: deep clone.
27914 // @ts-expect-error: looks like a position.
27915 position = place.position
27916 }
27917 }
27918 // Position.
27919 else if ('start' in place || 'end' in place) {
27920 // @ts-expect-error: looks like a position.
27921 // To do: next major: deep clone.
27922 position = place
27923 }
27924 // Point.
27925 else if ('line' in place || 'column' in place) {
27926 // To do: next major: deep clone.
27927 position.start = place
27928 }
27929 }
27930
27931 // Fields from `Error`.
27932 /**
27933 * Serialized positional info of error.
27934 *
27935 * On normal errors, this would be something like `ParseError`, buit in
27936 * `VFile` messages we use this space to show where an error happened.
27937 */
27938 this.name = (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_0__.stringifyPosition)(place) || '1:1'
27939
27940 /**
27941 * Reason for message.
27942 *
27943 * @type {string}
27944 */
27945 this.message = typeof reason === 'object' ? reason.message : reason
27946
27947 /**
27948 * Stack of message.
27949 *
27950 * This is used by normal errors to show where something happened in
27951 * programming code, irrelevant for `VFile` messages,
27952 *
27953 * @type {string}
27954 */
27955 this.stack = ''
27956
27957 if (typeof reason === 'object' && reason.stack) {
27958 this.stack = reason.stack
27959 }
27960
27961 /**
27962 * Reason for message.
27963 *
27964 * > 👉 **Note**: you should use markdown.
27965 *
27966 * @type {string}
27967 */
27968 this.reason = this.message
27969
27970 /* eslint-disable no-unused-expressions */
27971 /**
27972 * State of problem.
27973 *
27974 * * `true` — marks associated file as no longer processable (error)
27975 * * `false` — necessitates a (potential) change (warning)
27976 * * `null | undefined` — for things that might not need changing (info)
27977 *
27978 * @type {boolean | null | undefined}
27979 */
27980 this.fatal
27981
27982 /**
27983 * Starting line of error.
27984 *
27985 * @type {number | null}
27986 */
27987 this.line = position.start.line
27988
27989 /**
27990 * Starting column of error.
27991 *
27992 * @type {number | null}
27993 */
27994 this.column = position.start.column
27995
27996 /**
27997 * Full unist position.
27998 *
27999 * @type {Position | null}
28000 */
28001 this.position = position
28002
28003 /**
28004 * Namespace of message (example: `'my-package'`).
28005 *
28006 * @type {string | null}
28007 */
28008 this.source = parts[0]
28009
28010 /**
28011 * Category of message (example: `'my-rule'`).
28012 *
28013 * @type {string | null}
28014 */
28015 this.ruleId = parts[1]
28016
28017 /**
28018 * Path of a file (used throughout the `VFile` ecosystem).
28019 *
28020 * @type {string | null}
28021 */
28022 this.file
28023
28024 // The following fields are “well known”.
28025 // Not standard.
28026 // Feel free to add other non-standard fields to your messages.
28027
28028 /**
28029 * Specify the source value that’s being reported, which is deemed
28030 * incorrect.
28031 *
28032 * @type {string | null}
28033 */
28034 this.actual
28035
28036 /**
28037 * Suggest acceptable values that can be used instead of `actual`.
28038 *
28039 * @type {Array<string> | null}
28040 */
28041 this.expected
28042
28043 /**
28044 * Link to docs for the message.
28045 *
28046 * > 👉 **Note**: this must be an absolute URL that can be passed as `x`
28047 * > to `new URL(x)`.
28048 *
28049 * @type {string | null}
28050 */
28051 this.url
28052
28053 /**
28054 * Long form description of the message (you should use markdown).
28055 *
28056 * @type {string | null}
28057 */
28058 this.note
28059 /* eslint-enable no-unused-expressions */
28060 }
28061 }
28062
28063 VFileMessage.prototype.file = ''
28064 VFileMessage.prototype.name = ''
28065 VFileMessage.prototype.reason = ''
28066 VFileMessage.prototype.message = ''
28067 VFileMessage.prototype.stack = ''
28068 VFileMessage.prototype.fatal = null
28069 VFileMessage.prototype.column = null
28070 VFileMessage.prototype.line = null
28071 VFileMessage.prototype.source = null
28072 VFileMessage.prototype.ruleId = null
28073 VFileMessage.prototype.position = null
28074
28075
28076 /***/ }),
28077
28078 /***/ "../node_modules/vfile/lib/index.js":
28079 /*!******************************************!*\
28080 !*** ../node_modules/vfile/lib/index.js ***!
28081 \******************************************/
28082 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28083
28084 "use strict";
28085 __webpack_require__.r(__webpack_exports__);
28086 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
28087 /* harmony export */ "VFile": () => (/* binding */ VFile)
28088 /* harmony export */ });
28089 /* harmony import */ var is_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-buffer */ "../node_modules/is-buffer/index.js");
28090 /* harmony import */ var vfile_message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vfile-message */ "../node_modules/vfile-message/lib/index.js");
28091 /* harmony import */ var _minpath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./minpath.js */ "../node_modules/vfile/lib/minpath.browser.js");
28092 /* harmony import */ var _minproc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./minproc.js */ "../node_modules/vfile/lib/minproc.browser.js");
28093 /* harmony import */ var _minurl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./minurl.js */ "../node_modules/vfile/lib/minurl.shared.js");
28094 /* harmony import */ var _minurl_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./minurl.js */ "../node_modules/vfile/lib/minurl.browser.js");
28095 /**
28096 * @typedef {import('unist').Node} Node
28097 * @typedef {import('unist').Position} Position
28098 * @typedef {import('unist').Point} Point
28099 * @typedef {import('./minurl.shared.js').URL} URL
28100 * @typedef {import('../index.js').Data} Data
28101 * @typedef {import('../index.js').Value} Value
28102 */
28103
28104 /**
28105 * @typedef {Record<string, unknown> & {type: string, position?: Position | undefined}} NodeLike
28106 *
28107 * @typedef {'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'} BufferEncoding
28108 * Encodings supported by the buffer class.
28109 *
28110 * This is a copy of the types from Node, copied to prevent Node globals from
28111 * being needed.
28112 * Copied from: <https://github.com/DefinitelyTyped/DefinitelyTyped/blob/90a4ec8/types/node/buffer.d.ts#L170>
28113 *
28114 * @typedef {Options | URL | Value | VFile} Compatible
28115 * Things that can be passed to the constructor.
28116 *
28117 * @typedef VFileCoreOptions
28118 * Set multiple values.
28119 * @property {Value | null | undefined} [value]
28120 * Set `value`.
28121 * @property {string | null | undefined} [cwd]
28122 * Set `cwd`.
28123 * @property {Array<string> | null | undefined} [history]
28124 * Set `history`.
28125 * @property {URL | string | null | undefined} [path]
28126 * Set `path`.
28127 * @property {string | null | undefined} [basename]
28128 * Set `basename`.
28129 * @property {string | null | undefined} [stem]
28130 * Set `stem`.
28131 * @property {string | null | undefined} [extname]
28132 * Set `extname`.
28133 * @property {string | null | undefined} [dirname]
28134 * Set `dirname`.
28135 * @property {Data | null | undefined} [data]
28136 * Set `data`.
28137 *
28138 * @typedef Map
28139 * Raw source map.
28140 *
28141 * See:
28142 * <https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23>.
28143 * @property {number} version
28144 * Which version of the source map spec this map is following.
28145 * @property {Array<string>} sources
28146 * An array of URLs to the original source files.
28147 * @property {Array<string>} names
28148 * An array of identifiers which can be referenced by individual mappings.
28149 * @property {string | undefined} [sourceRoot]
28150 * The URL root from which all sources are relative.
28151 * @property {Array<string> | undefined} [sourcesContent]
28152 * An array of contents of the original source files.
28153 * @property {string} mappings
28154 * A string of base64 VLQs which contain the actual mappings.
28155 * @property {string} file
28156 * The generated file this source map is associated with.
28157 *
28158 * @typedef {{[key: string]: unknown} & VFileCoreOptions} Options
28159 * Configuration.
28160 *
28161 * A bunch of keys that will be shallow copied over to the new file.
28162 *
28163 * @typedef {Record<string, unknown>} ReporterSettings
28164 * Configuration for reporters.
28165 */
28166
28167 /**
28168 * @template {ReporterSettings} Settings
28169 * Options type.
28170 * @callback Reporter
28171 * Type for a reporter.
28172 * @param {Array<VFile>} files
28173 * Files to report.
28174 * @param {Settings} options
28175 * Configuration.
28176 * @returns {string}
28177 * Report.
28178 */
28179
28180
28181
28182
28183
28184
28185
28186 /**
28187 * Order of setting (least specific to most), we need this because otherwise
28188 * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a
28189 * stem can be set.
28190 *
28191 * @type {Array<'basename' | 'dirname' | 'extname' | 'history' | 'path' | 'stem'>}
28192 */
28193 const order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname']
28194
28195 class VFile {
28196 /**
28197 * Create a new virtual file.
28198 *
28199 * `options` is treated as:
28200 *
28201 * * `string` or `Buffer` — `{value: options}`
28202 * * `URL` — `{path: options}`
28203 * * `VFile` — shallow copies its data over to the new file
28204 * * `object` — all fields are shallow copied over to the new file
28205 *
28206 * Path related fields are set in the following order (least specific to
28207 * most specific): `history`, `path`, `basename`, `stem`, `extname`,
28208 * `dirname`.
28209 *
28210 * You cannot set `dirname` or `extname` without setting either `history`,
28211 * `path`, `basename`, or `stem` too.
28212 *
28213 * @param {Compatible | null | undefined} [value]
28214 * File value.
28215 * @returns
28216 * New instance.
28217 */
28218 constructor(value) {
28219 /** @type {Options | VFile} */
28220 let options
28221
28222 if (!value) {
28223 options = {}
28224 } else if (typeof value === 'string' || buffer(value)) {
28225 options = {value}
28226 } else if ((0,_minurl_js__WEBPACK_IMPORTED_MODULE_1__.isUrl)(value)) {
28227 options = {path: value}
28228 } else {
28229 options = value
28230 }
28231
28232 /**
28233 * Place to store custom information (default: `{}`).
28234 *
28235 * It’s OK to store custom data directly on the file but moving it to
28236 * `data` is recommended.
28237 *
28238 * @type {Data}
28239 */
28240 this.data = {}
28241
28242 /**
28243 * List of messages associated with the file.
28244 *
28245 * @type {Array<VFileMessage>}
28246 */
28247 this.messages = []
28248
28249 /**
28250 * List of filepaths the file moved between.
28251 *
28252 * The first is the original path and the last is the current path.
28253 *
28254 * @type {Array<string>}
28255 */
28256 this.history = []
28257
28258 /**
28259 * Base of `path` (default: `process.cwd()` or `'/'` in browsers).
28260 *
28261 * @type {string}
28262 */
28263 this.cwd = _minproc_js__WEBPACK_IMPORTED_MODULE_2__.proc.cwd()
28264
28265 /* eslint-disable no-unused-expressions */
28266 /**
28267 * Raw value.
28268 *
28269 * @type {Value}
28270 */
28271 this.value
28272
28273 // The below are non-standard, they are “well-known”.
28274 // As in, used in several tools.
28275
28276 /**
28277 * Whether a file was saved to disk.
28278 *
28279 * This is used by vfile reporters.
28280 *
28281 * @type {boolean}
28282 */
28283 this.stored
28284
28285 /**
28286 * Custom, non-string, compiled, representation.
28287 *
28288 * This is used by unified to store non-string results.
28289 * One example is when turning markdown into React nodes.
28290 *
28291 * @type {unknown}
28292 */
28293 this.result
28294
28295 /**
28296 * Source map.
28297 *
28298 * This type is equivalent to the `RawSourceMap` type from the `source-map`
28299 * module.
28300 *
28301 * @type {Map | null | undefined}
28302 */
28303 this.map
28304 /* eslint-enable no-unused-expressions */
28305
28306 // Set path related properties in the correct order.
28307 let index = -1
28308
28309 while (++index < order.length) {
28310 const prop = order[index]
28311
28312 // Note: we specifically use `in` instead of `hasOwnProperty` to accept
28313 // `vfile`s too.
28314 if (
28315 prop in options &&
28316 options[prop] !== undefined &&
28317 options[prop] !== null
28318 ) {
28319 // @ts-expect-error: TS doesn’t understand basic reality.
28320 this[prop] = prop === 'history' ? [...options[prop]] : options[prop]
28321 }
28322 }
28323
28324 /** @type {string} */
28325 let prop
28326
28327 // Set non-path related properties.
28328 for (prop in options) {
28329 // @ts-expect-error: fine to set other things.
28330 if (!order.includes(prop)) {
28331 // @ts-expect-error: fine to set other things.
28332 this[prop] = options[prop]
28333 }
28334 }
28335 }
28336
28337 /**
28338 * Get the full path (example: `'~/index.min.js'`).
28339 *
28340 * @returns {string}
28341 */
28342 get path() {
28343 return this.history[this.history.length - 1]
28344 }
28345
28346 /**
28347 * Set the full path (example: `'~/index.min.js'`).
28348 *
28349 * Cannot be nullified.
28350 * You can set a file URL (a `URL` object with a `file:` protocol) which will
28351 * be turned into a path with `url.fileURLToPath`.
28352 *
28353 * @param {string | URL} path
28354 */
28355 set path(path) {
28356 if ((0,_minurl_js__WEBPACK_IMPORTED_MODULE_1__.isUrl)(path)) {
28357 path = (0,_minurl_js__WEBPACK_IMPORTED_MODULE_3__.urlToPath)(path)
28358 }
28359
28360 assertNonEmpty(path, 'path')
28361
28362 if (this.path !== path) {
28363 this.history.push(path)
28364 }
28365 }
28366
28367 /**
28368 * Get the parent path (example: `'~'`).
28369 */
28370 get dirname() {
28371 return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.dirname(this.path) : undefined
28372 }
28373
28374 /**
28375 * Set the parent path (example: `'~'`).
28376 *
28377 * Cannot be set if there’s no `path` yet.
28378 */
28379 set dirname(dirname) {
28380 assertPath(this.basename, 'dirname')
28381 this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(dirname || '', this.basename)
28382 }
28383
28384 /**
28385 * Get the basename (including extname) (example: `'index.min.js'`).
28386 */
28387 get basename() {
28388 return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.basename(this.path) : undefined
28389 }
28390
28391 /**
28392 * Set basename (including extname) (`'index.min.js'`).
28393 *
28394 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
28395 * on windows).
28396 * Cannot be nullified (use `file.path = file.dirname` instead).
28397 */
28398 set basename(basename) {
28399 assertNonEmpty(basename, 'basename')
28400 assertPart(basename, 'basename')
28401 this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname || '', basename)
28402 }
28403
28404 /**
28405 * Get the extname (including dot) (example: `'.js'`).
28406 */
28407 get extname() {
28408 return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.extname(this.path) : undefined
28409 }
28410
28411 /**
28412 * Set the extname (including dot) (example: `'.js'`).
28413 *
28414 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
28415 * on windows).
28416 * Cannot be set if there’s no `path` yet.
28417 */
28418 set extname(extname) {
28419 assertPart(extname, 'extname')
28420 assertPath(this.dirname, 'extname')
28421
28422 if (extname) {
28423 if (extname.charCodeAt(0) !== 46 /* `.` */) {
28424 throw new Error('`extname` must start with `.`')
28425 }
28426
28427 if (extname.includes('.', 1)) {
28428 throw new Error('`extname` cannot contain multiple dots')
28429 }
28430 }
28431
28432 this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname, this.stem + (extname || ''))
28433 }
28434
28435 /**
28436 * Get the stem (basename w/o extname) (example: `'index.min'`).
28437 */
28438 get stem() {
28439 return typeof this.path === 'string'
28440 ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.basename(this.path, this.extname)
28441 : undefined
28442 }
28443
28444 /**
28445 * Set the stem (basename w/o extname) (example: `'index.min'`).
28446 *
28447 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
28448 * on windows).
28449 * Cannot be nullified (use `file.path = file.dirname` instead).
28450 */
28451 set stem(stem) {
28452 assertNonEmpty(stem, 'stem')
28453 assertPart(stem, 'stem')
28454 this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname || '', stem + (this.extname || ''))
28455 }
28456
28457 /**
28458 * Serialize the file.
28459 *
28460 * @param {BufferEncoding | null | undefined} [encoding='utf8']
28461 * Character encoding to understand `value` as when it’s a `Buffer`
28462 * (default: `'utf8'`).
28463 * @returns {string}
28464 * Serialized file.
28465 */
28466 toString(encoding) {
28467 return (this.value || '').toString(encoding || undefined)
28468 }
28469
28470 /**
28471 * Create a warning message associated with the file.
28472 *
28473 * Its `fatal` is set to `false` and `file` is set to the current file path.
28474 * Its added to `file.messages`.
28475 *
28476 * @param {string | Error | VFileMessage} reason
28477 * Reason for message, uses the stack and message of the error if given.
28478 * @param {Node | NodeLike | Position | Point | null | undefined} [place]
28479 * Place in file where the message occurred.
28480 * @param {string | null | undefined} [origin]
28481 * Place in code where the message originates (example:
28482 * `'my-package:my-rule'` or `'my-rule'`).
28483 * @returns {VFileMessage}
28484 * Message.
28485 */
28486 message(reason, place, origin) {
28487 const message = new vfile_message__WEBPACK_IMPORTED_MODULE_5__.VFileMessage(reason, place, origin)
28488
28489 if (this.path) {
28490 message.name = this.path + ':' + message.name
28491 message.file = this.path
28492 }
28493
28494 message.fatal = false
28495
28496 this.messages.push(message)
28497
28498 return message
28499 }
28500
28501 /**
28502 * Create an info message associated with the file.
28503 *
28504 * Its `fatal` is set to `null` and `file` is set to the current file path.
28505 * Its added to `file.messages`.
28506 *
28507 * @param {string | Error | VFileMessage} reason
28508 * Reason for message, uses the stack and message of the error if given.
28509 * @param {Node | NodeLike | Position | Point | null | undefined} [place]
28510 * Place in file where the message occurred.
28511 * @param {string | null | undefined} [origin]
28512 * Place in code where the message originates (example:
28513 * `'my-package:my-rule'` or `'my-rule'`).
28514 * @returns {VFileMessage}
28515 * Message.
28516 */
28517 info(reason, place, origin) {
28518 const message = this.message(reason, place, origin)
28519
28520 message.fatal = null
28521
28522 return message
28523 }
28524
28525 /**
28526 * Create a fatal error associated with the file.
28527 *
28528 * Its `fatal` is set to `true` and `file` is set to the current file path.
28529 * Its added to `file.messages`.
28530 *
28531 * > 👉 **Note**: a fatal error means that a file is no longer processable.
28532 *
28533 * @param {string | Error | VFileMessage} reason
28534 * Reason for message, uses the stack and message of the error if given.
28535 * @param {Node | NodeLike | Position | Point | null | undefined} [place]
28536 * Place in file where the message occurred.
28537 * @param {string | null | undefined} [origin]
28538 * Place in code where the message originates (example:
28539 * `'my-package:my-rule'` or `'my-rule'`).
28540 * @returns {never}
28541 * Message.
28542 * @throws {VFileMessage}
28543 * Message.
28544 */
28545 fail(reason, place, origin) {
28546 const message = this.message(reason, place, origin)
28547
28548 message.fatal = true
28549
28550 throw message
28551 }
28552 }
28553
28554 /**
28555 * Assert that `part` is not a path (as in, does not contain `path.sep`).
28556 *
28557 * @param {string | null | undefined} part
28558 * File path part.
28559 * @param {string} name
28560 * Part name.
28561 * @returns {void}
28562 * Nothing.
28563 */
28564 function assertPart(part, name) {
28565 if (part && part.includes(_minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.sep)) {
28566 throw new Error(
28567 '`' + name + '` cannot be a path: did not expect `' + _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.sep + '`'
28568 )
28569 }
28570 }
28571
28572 /**
28573 * Assert that `part` is not empty.
28574 *
28575 * @param {string | undefined} part
28576 * Thing.
28577 * @param {string} name
28578 * Part name.
28579 * @returns {asserts part is string}
28580 * Nothing.
28581 */
28582 function assertNonEmpty(part, name) {
28583 if (!part) {
28584 throw new Error('`' + name + '` cannot be empty')
28585 }
28586 }
28587
28588 /**
28589 * Assert `path` exists.
28590 *
28591 * @param {string | undefined} path
28592 * Path.
28593 * @param {string} name
28594 * Dependency name.
28595 * @returns {asserts path is string}
28596 * Nothing.
28597 */
28598 function assertPath(path, name) {
28599 if (!path) {
28600 throw new Error('Setting `' + name + '` requires `path` to be set too')
28601 }
28602 }
28603
28604 /**
28605 * Assert `value` is a buffer.
28606 *
28607 * @param {unknown} value
28608 * thing.
28609 * @returns {value is Buffer}
28610 * Whether `value` is a Node.js buffer.
28611 */
28612 function buffer(value) {
28613 return is_buffer__WEBPACK_IMPORTED_MODULE_0__(value)
28614 }
28615
28616
28617 /***/ }),
28618
28619 /***/ "../node_modules/vfile/lib/minpath.browser.js":
28620 /*!****************************************************!*\
28621 !*** ../node_modules/vfile/lib/minpath.browser.js ***!
28622 \****************************************************/
28623 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28624
28625 "use strict";
28626 __webpack_require__.r(__webpack_exports__);
28627 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
28628 /* harmony export */ "path": () => (/* binding */ path)
28629 /* harmony export */ });
28630 // A derivative work based on:
28631 // <https://github.com/browserify/path-browserify>.
28632 // Which is licensed:
28633 //
28634 // MIT License
28635 //
28636 // Copyright (c) 2013 James Halliday
28637 //
28638 // Permission is hereby granted, free of charge, to any person obtaining a copy of
28639 // this software and associated documentation files (the "Software"), to deal in
28640 // the Software without restriction, including without limitation the rights to
28641 // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
28642 // the Software, and to permit persons to whom the Software is furnished to do so,
28643 // subject to the following conditions:
28644 //
28645 // The above copyright notice and this permission notice shall be included in all
28646 // copies or substantial portions of the Software.
28647 //
28648 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28649 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
28650 // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
28651 // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
28652 // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28653 // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28654 // A derivative work based on:
28655 //
28656 // Parts of that are extracted from Node’s internal `path` module:
28657 // <https://github.com/nodejs/node/blob/master/lib/path.js>.
28658 // Which is licensed:
28659 //
28660 // Copyright Joyent, Inc. and other Node contributors.
28661 //
28662 // Permission is hereby granted, free of charge, to any person obtaining a
28663 // copy of this software and associated documentation files (the
28664 // "Software"), to deal in the Software without restriction, including
28665 // without limitation the rights to use, copy, modify, merge, publish,
28666 // distribute, sublicense, and/or sell copies of the Software, and to permit
28667 // persons to whom the Software is furnished to do so, subject to the
28668 // following conditions:
28669 //
28670 // The above copyright notice and this permission notice shall be included
28671 // in all copies or substantial portions of the Software.
28672 //
28673 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
28674 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28675 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
28676 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
28677 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28678 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
28679 // USE OR OTHER DEALINGS IN THE SOFTWARE.
28680
28681 const path = {basename, dirname, extname, join, sep: '/'}
28682
28683 /* eslint-disable max-depth, complexity */
28684
28685 /**
28686 * Get the basename from a path.
28687 *
28688 * @param {string} path
28689 * File path.
28690 * @param {string | undefined} [ext]
28691 * Extension to strip.
28692 * @returns {string}
28693 * Stem or basename.
28694 */
28695 function basename(path, ext) {
28696 if (ext !== undefined && typeof ext !== 'string') {
28697 throw new TypeError('"ext" argument must be a string')
28698 }
28699
28700 assertPath(path)
28701 let start = 0
28702 let end = -1
28703 let index = path.length
28704 /** @type {boolean | undefined} */
28705 let seenNonSlash
28706
28707 if (ext === undefined || ext.length === 0 || ext.length > path.length) {
28708 while (index--) {
28709 if (path.charCodeAt(index) === 47 /* `/` */) {
28710 // If we reached a path separator that was not part of a set of path
28711 // separators at the end of the string, stop now.
28712 if (seenNonSlash) {
28713 start = index + 1
28714 break
28715 }
28716 } else if (end < 0) {
28717 // We saw the first non-path separator, mark this as the end of our
28718 // path component.
28719 seenNonSlash = true
28720 end = index + 1
28721 }
28722 }
28723
28724 return end < 0 ? '' : path.slice(start, end)
28725 }
28726
28727 if (ext === path) {
28728 return ''
28729 }
28730
28731 let firstNonSlashEnd = -1
28732 let extIndex = ext.length - 1
28733
28734 while (index--) {
28735 if (path.charCodeAt(index) === 47 /* `/` */) {
28736 // If we reached a path separator that was not part of a set of path
28737 // separators at the end of the string, stop now.
28738 if (seenNonSlash) {
28739 start = index + 1
28740 break
28741 }
28742 } else {
28743 if (firstNonSlashEnd < 0) {
28744 // We saw the first non-path separator, remember this index in case
28745 // we need it if the extension ends up not matching.
28746 seenNonSlash = true
28747 firstNonSlashEnd = index + 1
28748 }
28749
28750 if (extIndex > -1) {
28751 // Try to match the explicit extension.
28752 if (path.charCodeAt(index) === ext.charCodeAt(extIndex--)) {
28753 if (extIndex < 0) {
28754 // We matched the extension, so mark this as the end of our path
28755 // component
28756 end = index
28757 }
28758 } else {
28759 // Extension does not match, so our result is the entire path
28760 // component
28761 extIndex = -1
28762 end = firstNonSlashEnd
28763 }
28764 }
28765 }
28766 }
28767
28768 if (start === end) {
28769 end = firstNonSlashEnd
28770 } else if (end < 0) {
28771 end = path.length
28772 }
28773
28774 return path.slice(start, end)
28775 }
28776
28777 /**
28778 * Get the dirname from a path.
28779 *
28780 * @param {string} path
28781 * File path.
28782 * @returns {string}
28783 * File path.
28784 */
28785 function dirname(path) {
28786 assertPath(path)
28787
28788 if (path.length === 0) {
28789 return '.'
28790 }
28791
28792 let end = -1
28793 let index = path.length
28794 /** @type {boolean | undefined} */
28795 let unmatchedSlash
28796
28797 // Prefix `--` is important to not run on `0`.
28798 while (--index) {
28799 if (path.charCodeAt(index) === 47 /* `/` */) {
28800 if (unmatchedSlash) {
28801 end = index
28802 break
28803 }
28804 } else if (!unmatchedSlash) {
28805 // We saw the first non-path separator
28806 unmatchedSlash = true
28807 }
28808 }
28809
28810 return end < 0
28811 ? path.charCodeAt(0) === 47 /* `/` */
28812 ? '/'
28813 : '.'
28814 : end === 1 && path.charCodeAt(0) === 47 /* `/` */
28815 ? '//'
28816 : path.slice(0, end)
28817 }
28818
28819 /**
28820 * Get an extname from a path.
28821 *
28822 * @param {string} path
28823 * File path.
28824 * @returns {string}
28825 * Extname.
28826 */
28827 function extname(path) {
28828 assertPath(path)
28829
28830 let index = path.length
28831
28832 let end = -1
28833 let startPart = 0
28834 let startDot = -1
28835 // Track the state of characters (if any) we see before our first dot and
28836 // after any path separator we find.
28837 let preDotState = 0
28838 /** @type {boolean | undefined} */
28839 let unmatchedSlash
28840
28841 while (index--) {
28842 const code = path.charCodeAt(index)
28843
28844 if (code === 47 /* `/` */) {
28845 // If we reached a path separator that was not part of a set of path
28846 // separators at the end of the string, stop now.
28847 if (unmatchedSlash) {
28848 startPart = index + 1
28849 break
28850 }
28851
28852 continue
28853 }
28854
28855 if (end < 0) {
28856 // We saw the first non-path separator, mark this as the end of our
28857 // extension.
28858 unmatchedSlash = true
28859 end = index + 1
28860 }
28861
28862 if (code === 46 /* `.` */) {
28863 // If this is our first dot, mark it as the start of our extension.
28864 if (startDot < 0) {
28865 startDot = index
28866 } else if (preDotState !== 1) {
28867 preDotState = 1
28868 }
28869 } else if (startDot > -1) {
28870 // We saw a non-dot and non-path separator before our dot, so we should
28871 // have a good chance at having a non-empty extension.
28872 preDotState = -1
28873 }
28874 }
28875
28876 if (
28877 startDot < 0 ||
28878 end < 0 ||
28879 // We saw a non-dot character immediately before the dot.
28880 preDotState === 0 ||
28881 // The (right-most) trimmed path component is exactly `..`.
28882 (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
28883 ) {
28884 return ''
28885 }
28886
28887 return path.slice(startDot, end)
28888 }
28889
28890 /**
28891 * Join segments from a path.
28892 *
28893 * @param {Array<string>} segments
28894 * Path segments.
28895 * @returns {string}
28896 * File path.
28897 */
28898 function join(...segments) {
28899 let index = -1
28900 /** @type {string | undefined} */
28901 let joined
28902
28903 while (++index < segments.length) {
28904 assertPath(segments[index])
28905
28906 if (segments[index]) {
28907 joined =
28908 joined === undefined ? segments[index] : joined + '/' + segments[index]
28909 }
28910 }
28911
28912 return joined === undefined ? '.' : normalize(joined)
28913 }
28914
28915 /**
28916 * Normalize a basic file path.
28917 *
28918 * @param {string} path
28919 * File path.
28920 * @returns {string}
28921 * File path.
28922 */
28923 // Note: `normalize` is not exposed as `path.normalize`, so some code is
28924 // manually removed from it.
28925 function normalize(path) {
28926 assertPath(path)
28927
28928 const absolute = path.charCodeAt(0) === 47 /* `/` */
28929
28930 // Normalize the path according to POSIX rules.
28931 let value = normalizeString(path, !absolute)
28932
28933 if (value.length === 0 && !absolute) {
28934 value = '.'
28935 }
28936
28937 if (value.length > 0 && path.charCodeAt(path.length - 1) === 47 /* / */) {
28938 value += '/'
28939 }
28940
28941 return absolute ? '/' + value : value
28942 }
28943
28944 /**
28945 * Resolve `.` and `..` elements in a path with directory names.
28946 *
28947 * @param {string} path
28948 * File path.
28949 * @param {boolean} allowAboveRoot
28950 * Whether `..` can move above root.
28951 * @returns {string}
28952 * File path.
28953 */
28954 function normalizeString(path, allowAboveRoot) {
28955 let result = ''
28956 let lastSegmentLength = 0
28957 let lastSlash = -1
28958 let dots = 0
28959 let index = -1
28960 /** @type {number | undefined} */
28961 let code
28962 /** @type {number} */
28963 let lastSlashIndex
28964
28965 while (++index <= path.length) {
28966 if (index < path.length) {
28967 code = path.charCodeAt(index)
28968 } else if (code === 47 /* `/` */) {
28969 break
28970 } else {
28971 code = 47 /* `/` */
28972 }
28973
28974 if (code === 47 /* `/` */) {
28975 if (lastSlash === index - 1 || dots === 1) {
28976 // Empty.
28977 } else if (lastSlash !== index - 1 && dots === 2) {
28978 if (
28979 result.length < 2 ||
28980 lastSegmentLength !== 2 ||
28981 result.charCodeAt(result.length - 1) !== 46 /* `.` */ ||
28982 result.charCodeAt(result.length - 2) !== 46 /* `.` */
28983 ) {
28984 if (result.length > 2) {
28985 lastSlashIndex = result.lastIndexOf('/')
28986
28987 if (lastSlashIndex !== result.length - 1) {
28988 if (lastSlashIndex < 0) {
28989 result = ''
28990 lastSegmentLength = 0
28991 } else {
28992 result = result.slice(0, lastSlashIndex)
28993 lastSegmentLength = result.length - 1 - result.lastIndexOf('/')
28994 }
28995
28996 lastSlash = index
28997 dots = 0
28998 continue
28999 }
29000 } else if (result.length > 0) {
29001 result = ''
29002 lastSegmentLength = 0
29003 lastSlash = index
29004 dots = 0
29005 continue
29006 }
29007 }
29008
29009 if (allowAboveRoot) {
29010 result = result.length > 0 ? result + '/..' : '..'
29011 lastSegmentLength = 2
29012 }
29013 } else {
29014 if (result.length > 0) {
29015 result += '/' + path.slice(lastSlash + 1, index)
29016 } else {
29017 result = path.slice(lastSlash + 1, index)
29018 }
29019
29020 lastSegmentLength = index - lastSlash - 1
29021 }
29022
29023 lastSlash = index
29024 dots = 0
29025 } else if (code === 46 /* `.` */ && dots > -1) {
29026 dots++
29027 } else {
29028 dots = -1
29029 }
29030 }
29031
29032 return result
29033 }
29034
29035 /**
29036 * Make sure `path` is a string.
29037 *
29038 * @param {string} path
29039 * File path.
29040 * @returns {asserts path is string}
29041 * Nothing.
29042 */
29043 function assertPath(path) {
29044 if (typeof path !== 'string') {
29045 throw new TypeError(
29046 'Path must be a string. Received ' + JSON.stringify(path)
29047 )
29048 }
29049 }
29050
29051 /* eslint-enable max-depth, complexity */
29052
29053
29054 /***/ }),
29055
29056 /***/ "../node_modules/vfile/lib/minproc.browser.js":
29057 /*!****************************************************!*\
29058 !*** ../node_modules/vfile/lib/minproc.browser.js ***!
29059 \****************************************************/
29060 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
29061
29062 "use strict";
29063 __webpack_require__.r(__webpack_exports__);
29064 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29065 /* harmony export */ "proc": () => (/* binding */ proc)
29066 /* harmony export */ });
29067 // Somewhat based on:
29068 // <https://github.com/defunctzombie/node-process/blob/master/browser.js>.
29069 // But I don’t think one tiny line of code can be copyrighted. 😅
29070 const proc = {cwd}
29071
29072 function cwd() {
29073 return '/'
29074 }
29075
29076
29077 /***/ }),
29078
29079 /***/ "../node_modules/vfile/lib/minurl.browser.js":
29080 /*!***************************************************!*\
29081 !*** ../node_modules/vfile/lib/minurl.browser.js ***!
29082 \***************************************************/
29083 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
29084
29085 "use strict";
29086 __webpack_require__.r(__webpack_exports__);
29087 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29088 /* harmony export */ "isUrl": () => (/* reexport safe */ _minurl_shared_js__WEBPACK_IMPORTED_MODULE_0__.isUrl),
29089 /* harmony export */ "urlToPath": () => (/* binding */ urlToPath)
29090 /* harmony export */ });
29091 /* harmony import */ var _minurl_shared_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./minurl.shared.js */ "../node_modules/vfile/lib/minurl.shared.js");
29092 /// <reference lib="dom" />
29093
29094
29095
29096 // See: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js>
29097
29098 /**
29099 * @param {string | URL} path
29100 * File URL.
29101 * @returns {string}
29102 * File URL.
29103 */
29104 function urlToPath(path) {
29105 if (typeof path === 'string') {
29106 path = new URL(path)
29107 } else if (!(0,_minurl_shared_js__WEBPACK_IMPORTED_MODULE_0__.isUrl)(path)) {
29108 /** @type {NodeJS.ErrnoException} */
29109 const error = new TypeError(
29110 'The "path" argument must be of type string or an instance of URL. Received `' +
29111 path +
29112 '`'
29113 )
29114 error.code = 'ERR_INVALID_ARG_TYPE'
29115 throw error
29116 }
29117
29118 if (path.protocol !== 'file:') {
29119 /** @type {NodeJS.ErrnoException} */
29120 const error = new TypeError('The URL must be of scheme file')
29121 error.code = 'ERR_INVALID_URL_SCHEME'
29122 throw error
29123 }
29124
29125 return getPathFromURLPosix(path)
29126 }
29127
29128 /**
29129 * Get a path from a POSIX URL.
29130 *
29131 * @param {URL} url
29132 * URL.
29133 * @returns {string}
29134 * File path.
29135 */
29136 function getPathFromURLPosix(url) {
29137 if (url.hostname !== '') {
29138 /** @type {NodeJS.ErrnoException} */
29139 const error = new TypeError(
29140 'File URL host must be "localhost" or empty on darwin'
29141 )
29142 error.code = 'ERR_INVALID_FILE_URL_HOST'
29143 throw error
29144 }
29145
29146 const pathname = url.pathname
29147 let index = -1
29148
29149 while (++index < pathname.length) {
29150 if (
29151 pathname.charCodeAt(index) === 37 /* `%` */ &&
29152 pathname.charCodeAt(index + 1) === 50 /* `2` */
29153 ) {
29154 const third = pathname.charCodeAt(index + 2)
29155 if (third === 70 /* `F` */ || third === 102 /* `f` */) {
29156 /** @type {NodeJS.ErrnoException} */
29157 const error = new TypeError(
29158 'File URL path must not include encoded / characters'
29159 )
29160 error.code = 'ERR_INVALID_FILE_URL_PATH'
29161 throw error
29162 }
29163 }
29164 }
29165
29166 return decodeURIComponent(pathname)
29167 }
29168
29169
29170
29171
29172 /***/ }),
29173
29174 /***/ "../node_modules/vfile/lib/minurl.shared.js":
29175 /*!**************************************************!*\
29176 !*** ../node_modules/vfile/lib/minurl.shared.js ***!
29177 \**************************************************/
29178 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
29179
29180 "use strict";
29181 __webpack_require__.r(__webpack_exports__);
29182 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29183 /* harmony export */ "isUrl": () => (/* binding */ isUrl)
29184 /* harmony export */ });
29185 /**
29186 * @typedef URL
29187 * @property {string} hash
29188 * @property {string} host
29189 * @property {string} hostname
29190 * @property {string} href
29191 * @property {string} origin
29192 * @property {string} password
29193 * @property {string} pathname
29194 * @property {string} port
29195 * @property {string} protocol
29196 * @property {string} search
29197 * @property {any} searchParams
29198 * @property {string} username
29199 * @property {() => string} toString
29200 * @property {() => string} toJSON
29201 */
29202
29203 /**
29204 * Check if `fileUrlOrPath` looks like a URL.
29205 *
29206 * @param {unknown} fileUrlOrPath
29207 * File path or URL.
29208 * @returns {fileUrlOrPath is URL}
29209 * Whether it’s a URL.
29210 */
29211 // From: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js#L1501>
29212 function isUrl(fileUrlOrPath) {
29213 return (
29214 fileUrlOrPath !== null &&
29215 typeof fileUrlOrPath === 'object' &&
29216 // @ts-expect-error: indexable.
29217 fileUrlOrPath.href &&
29218 // @ts-expect-error: indexable.
29219 fileUrlOrPath.origin
29220 )
29221 }
29222
29223
29224 /***/ })
29225
29226 /******/ });
29227 /************************************************************************/
29228 /******/ // The module cache
29229 /******/ var __webpack_module_cache__ = {};
29230 /******/
29231 /******/ // The require function
29232 /******/ function __webpack_require__(moduleId) {
29233 /******/ // Check if module is in cache
29234 /******/ var cachedModule = __webpack_module_cache__[moduleId];
29235 /******/ if (cachedModule !== undefined) {
29236 /******/ return cachedModule.exports;
29237 /******/ }
29238 /******/ // Create a new module (and put it into the cache)
29239 /******/ var module = __webpack_module_cache__[moduleId] = {
29240 /******/ // no module.id needed
29241 /******/ // no module.loaded needed
29242 /******/ exports: {}
29243 /******/ };
29244 /******/
29245 /******/ // Execute the module function
29246 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
29247 /******/
29248 /******/ // Return the exports of the module
29249 /******/ return module.exports;
29250 /******/ }
29251 /******/
29252 /************************************************************************/
29253 /******/ /* webpack/runtime/define property getters */
29254 /******/ (() => {
29255 /******/ // define getter functions for harmony exports
29256 /******/ __webpack_require__.d = (exports, definition) => {
29257 /******/ for(var key in definition) {
29258 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
29259 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
29260 /******/ }
29261 /******/ }
29262 /******/ };
29263 /******/ })();
29264 /******/
29265 /******/ /* webpack/runtime/hasOwnProperty shorthand */
29266 /******/ (() => {
29267 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29268 /******/ })();
29269 /******/
29270 /******/ /* webpack/runtime/make namespace object */
29271 /******/ (() => {
29272 /******/ // define __esModule on exports
29273 /******/ __webpack_require__.r = (exports) => {
29274 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
29275 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
29276 /******/ }
29277 /******/ Object.defineProperty(exports, '__esModule', { value: true });
29278 /******/ };
29279 /******/ })();
29280 /******/
29281 /************************************************************************/
29282 var __webpack_exports__ = {};
29283 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
29284 (() => {
29285 "use strict";
29286 /*!***********************************************!*\
29287 !*** ../modules/ai/assets/js/editor/index.js ***!
29288 \***********************************************/
29289
29290
29291 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
29292 var _module = _interopRequireDefault(__webpack_require__(/*! ./module.js */ "../modules/ai/assets/js/editor/module.js"));
29293 new _module.default();
29294 })();
29295
29296 /******/ })()
29297 ;
29298 //# sourceMappingURL=ai.js.map