mark-deco 0.8.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cache/filesystem.d.ts +2 -2
- package/dist/cache/filesystem.d.ts.map +1 -1
- package/dist/cache/index.d.ts +2 -2
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/localstorage.d.ts +2 -2
- package/dist/cache/localstorage.d.ts.map +1 -1
- package/dist/cache/memory.d.ts +2 -2
- package/dist/cache/memory.d.ts.map +1 -1
- package/dist/fetcher.d.ts +2 -2
- package/dist/fetcher.d.ts.map +1 -1
- package/dist/frontmatter.d.ts +2 -2
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/index.cjs +12 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +264 -246
- package/dist/index.js.map +1 -1
- package/dist/{internal-BLcZHfk2.js → internal-CKDIHp_4.js} +3 -3
- package/dist/{internal-BLcZHfk2.js.map → internal-CKDIHp_4.js.map} +1 -1
- package/dist/{internal-B7OqH3Vn.cjs → internal-rnp2rYyf.cjs} +5 -6
- package/dist/{internal-B7OqH3Vn.cjs.map → internal-rnp2rYyf.cjs.map} +1 -1
- package/dist/internal.cjs +4 -5
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -3
- package/dist/internal.js.map +1 -1
- package/dist/logger.d.ts +2 -2
- package/dist/logger.d.ts.map +1 -1
- package/dist/plugins/card/amazon-rules.d.ts +2 -2
- package/dist/plugins/card/amazon-rules.d.ts.map +1 -1
- package/dist/plugins/card/fetcher.d.ts +2 -2
- package/dist/plugins/card/fetcher.d.ts.map +1 -1
- package/dist/plugins/card/html-generator.d.ts +2 -2
- package/dist/plugins/card/html-generator.d.ts.map +1 -1
- package/dist/plugins/card/index.d.ts +2 -2
- package/dist/plugins/card/index.d.ts.map +1 -1
- package/dist/plugins/card/ogp-rules.d.ts +2 -2
- package/dist/plugins/card/ogp-rules.d.ts.map +1 -1
- package/dist/plugins/card/rule-engine.d.ts +2 -2
- package/dist/plugins/card/rule-engine.d.ts.map +1 -1
- package/dist/plugins/card/types.d.ts +2 -2
- package/dist/plugins/card/types.d.ts.map +1 -1
- package/dist/plugins/card/utils.d.ts +2 -2
- package/dist/plugins/card/utils.d.ts.map +1 -1
- package/dist/plugins/card-plugin.d.ts +2 -2
- package/dist/plugins/card-plugin.d.ts.map +1 -1
- package/dist/plugins/mermaid/index.d.ts +2 -2
- package/dist/plugins/mermaid/index.d.ts.map +1 -1
- package/dist/plugins/mermaid/types.d.ts +2 -2
- package/dist/plugins/mermaid/types.d.ts.map +1 -1
- package/dist/plugins/mermaid-plugin.d.ts +2 -2
- package/dist/plugins/mermaid-plugin.d.ts.map +1 -1
- package/dist/plugins/oembed/fetcher.d.ts +2 -2
- package/dist/plugins/oembed/fetcher.d.ts.map +1 -1
- package/dist/plugins/oembed/html-generator.d.ts +2 -2
- package/dist/plugins/oembed/html-generator.d.ts.map +1 -1
- package/dist/plugins/oembed/index.d.ts +2 -2
- package/dist/plugins/oembed/index.d.ts.map +1 -1
- package/dist/plugins/oembed/providers.d.ts +2 -2
- package/dist/plugins/oembed/providers.d.ts.map +1 -1
- package/dist/plugins/oembed/providers.json.d.ts +2 -2
- package/dist/plugins/oembed/redirect-resolver.d.ts +2 -2
- package/dist/plugins/oembed/redirect-resolver.d.ts.map +1 -1
- package/dist/plugins/oembed/types.d.ts +2 -2
- package/dist/plugins/oembed/types.d.ts.map +1 -1
- package/dist/plugins/oembed/utils.d.ts +2 -2
- package/dist/plugins/oembed/utils.d.ts.map +1 -1
- package/dist/plugins/oembed-plugin.d.ts +2 -2
- package/dist/plugins/oembed-plugin.d.ts.map +1 -1
- package/dist/plugins/remark-attr.d.ts +2 -2
- package/dist/plugins/remark-attr.d.ts.map +1 -1
- package/dist/plugins/responsive-images.d.ts +2 -2
- package/dist/plugins/responsive-images.d.ts.map +1 -1
- package/dist/plugins/shared/error-formatter.d.ts +2 -2
- package/dist/plugins/shared/error-formatter.d.ts.map +1 -1
- package/dist/processor.d.ts +2 -2
- package/dist/processor.d.ts.map +1 -1
- package/dist/types.d.ts +33 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/responsive-image.d.ts +2 -2
- package/dist/utils/responsive-image.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: mark-deco
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.11.0
|
|
4
4
|
* description: Flexible Markdown to HTML conversion library
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: ec7d18a1171bc2a08b89e66baf98ef2b7f969208
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { CacheStorage } from './index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/cache/filesystem.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAmB3D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,UAAU,MAAM,KACf,YA4OF,CAAC"}
|
|
1
|
+
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/cache/filesystem.ts"],"names":[],"mappings":";;;;;;;;;AAMA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAmB3D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,UAAU,MAAM,KACf,YA4OF,CAAC"}
|
package/dist/cache/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: mark-deco
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.11.0
|
|
4
4
|
* description: Flexible Markdown to HTML conversion library
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: ec7d18a1171bc2a08b89e66baf98ef2b7f969208
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,4CAA4C;IAC5C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,gCAAgC;IAChC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,4BAA4B;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,uCAAuC;IACvC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAGR;AAGD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":";;;;;;;;;AAKA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,4CAA4C;IAC5C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,gCAAgC;IAChC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,4BAA4B;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,uCAAuC;IACvC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAGR;AAGD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: mark-deco
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.11.0
|
|
4
4
|
* description: Flexible Markdown to HTML conversion library
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: ec7d18a1171bc2a08b89e66baf98ef2b7f969208
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { CacheStorage } from './index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localstorage.d.ts","sourceRoot":"","sources":["../../src/cache/localstorage.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,YAAW,MAAiB,KAC3B,YAiRF,CAAC"}
|
|
1
|
+
{"version":3,"file":"localstorage.d.ts","sourceRoot":"","sources":["../../src/cache/localstorage.ts"],"names":[],"mappings":";;;;;;;;;AAMA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,YAAW,MAAiB,KAC3B,YAiRF,CAAC"}
|
package/dist/cache/memory.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: mark-deco
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.11.0
|
|
4
4
|
* description: Flexible Markdown to HTML conversion library
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: ec7d18a1171bc2a08b89e66baf98ef2b7f969208
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { CacheStorage } from './index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/cache/memory.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAO,YAqI3C,CAAC"}
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/cache/memory.ts"],"names":[],"mappings":";;;;;;;;;AAMA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAO,YAqI3C,CAAC"}
|
package/dist/fetcher.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: mark-deco
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.11.0
|
|
4
4
|
* description: Flexible Markdown to HTML conversion library
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: ec7d18a1171bc2a08b89e66baf98ef2b7f969208
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { CacheStorage } from './cache/index.js';
|
package/dist/fetcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../src/fetcher.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAeD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,EACjB,UAAS,MAAc,EACvB,eAAe,YAAY,EAC3B,UAAU,oBAAoB,KAC7B,WAsJF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,EACjB,UAAS,MAAc,KACtB,WAgBF,CAAC"}
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../src/fetcher.ts"],"names":[],"mappings":";;;;;;;;;AAKA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAeD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,EACjB,UAAS,MAAc,EACvB,eAAe,YAAY,EAC3B,UAAU,oBAAoB,KAC7B,WAsJF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,EACjB,UAAS,MAAc,KACtB,WAgBF,CAAC"}
|
package/dist/frontmatter.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: mark-deco
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.11.0
|
|
4
4
|
* description: Flexible Markdown to HTML conversion library
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: ec7d18a1171bc2a08b89e66baf98ef2b7f969208
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { FrontmatterData } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAsCnE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAWzE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,MAAM,GACd,MAAM,CAMR"}
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":";;;;;;;;;AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAsCnE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAWzE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,MAAM,GACd,MAAM,CAMR"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";/*!
|
|
2
2
|
* name: mark-deco
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.11.0
|
|
4
4
|
* description: Flexible Markdown to HTML conversion library
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
8
|
-
* git.commit.hash:
|
|
9
|
-
*/
|
|
10
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tt=require("js-beautify"),et=require("rehype-stringify"),rt=require("remark-gfm"),nt=require("remark-parse"),at=require("remark-rehype"),st=require("unified"),q=require("unist-util-visit"),M=require("js-yaml"),v=require("./internal-B7OqH3Vn.cjs");function B(e){const t=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/,n=e.match(t);if(!n)return{data:{},content:e};const o=n[1]||"",r=e.slice(n[0].length);try{const a=M.load(o,{schema:M.JSON_SCHEMA});return{data:a&&typeof a=="object"&&!Array.isArray(a)?a:{},content:r}}catch(a){const h=a instanceof Error?a.message:"Unknown YAML parsing error";throw new Error(`Failed to parse frontmatter YAML: ${h}`)}}function ot(e){if(!e||Object.keys(e).length===0)return"";const t=M.dump(e,{lineWidth:0});return typeof t!="string"||t.length===0?"":t.endsWith(`
|
|
8
|
+
* git.commit.hash: ec7d18a1171bc2a08b89e66baf98ef2b7f969208
|
|
9
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("js-beautify"),rt=require("rehype-stringify"),nt=require("remark-gfm"),at=require("remark-parse"),st=require("remark-rehype"),ot=require("unified"),A=require("unist-util-visit"),U=require("js-yaml"),E=require("./internal-rnp2rYyf.cjs");function W(e){const t=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/,n=e.match(t);if(!n)return{data:{},content:e};const o=n[1]||"",r=e.slice(n[0].length);try{const a=U.load(o,{schema:U.JSON_SCHEMA});return{data:a&&typeof a=="object"&&!Array.isArray(a)?a:{},content:r}}catch(a){const u=a instanceof Error?a.message:"Unknown YAML parsing error";throw new Error(`Failed to parse frontmatter YAML: ${u}`)}}function ct(e){if(!e||Object.keys(e).length===0)return"";const t=U.dump(e,{lineWidth:0});return typeof t!="string"||t.length===0?"":t.endsWith(`
|
|
11
10
|
`)?t:`${t}
|
|
12
|
-
`}function
|
|
13
|
-
${
|
|
14
|
-
`}${n}`}const R=()=>{},it={debug:R,info:R,warn:R,error:R},lt={debug:console.debug,info:console.info,warn:console.warn,error:console.error},
|
|
11
|
+
`}function G(e,t){const n=t??"";return`${`---
|
|
12
|
+
${ct(e)}---
|
|
13
|
+
`}${n}`}const R=()=>{},it={debug:R,info:R,warn:R,error:R},lt={debug:console.debug,info:console.info,warn:console.warn,error:console.error},Z=()=>it,ht=()=>lt,F=e=>{const t={},n=e.slice(1,-1).trim(),o=n.match(/\.([a-zA-Z0-9_-]+)/g);if(o){const u=o.map(m=>m.slice(1));t.class=u.join(" ")}const r=n.match(/#([a-zA-Z0-9_-]+)/);r&&r[1]&&(t.id=r[1]);const a=n.match(/([a-zA-Z0-9_-]+)=["']?([^"'\s]*)["']?/g);if(a)for(const u of a){const[m,d]=u.split("=");m&&d&&m!=="class"&&m!=="id"&&(t[m]=d.replace(/["']/g,""))}return t},ut=e=>{const t=e.lang?` class="language-${e.lang}"`:"",n=e.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return`<pre><code${t}>${n}</code></pre>`},P=(e,t)=>{e.data||(e.data={}),e.data.hProperties||(e.data.hProperties={}),Object.entries(t).forEach(([n,o])=>{if(n==="class"){const r=e.data.hProperties.class;r?typeof r=="string"&&r.startsWith("language-")?e.data.hProperties.class=`${r} ${o}`:e.data.hProperties.class=`${r} ${o}`:e.data.hProperties.class=o}else e.data.hProperties[n]=o})},ft=()=>e=>{A.visit(e,(t,n,o)=>{if(t.type==="heading"&&t.children?.length>0){const r=t.children[t.children.length-1];if(r?.type==="text"&&r.value){const a=r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);if(a){const u=a[1].trim(),m=a[2],d=F(m);r.value=u,P(t,d)}}}if(t.type==="paragraph"&&t.children?.length>0){const r=t.children[t.children.length-1];if(r?.type==="text"&&r.value){const a=r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);if(a){const u=a[1].trim(),m=a[2],d=F(m);r.value=u,P(t,d)}}}if(t.type==="link"&&o&&typeof n=="number"){const r=o.children[n+1];if(r?.type==="text"&&r.value){const a=r.value.match(/^\s*(\{[^}]+\})/);if(a){const u=a[1],m=F(u);P(t,m),r.value=r.value.replace(a[0],"")}}}if(t.type==="image"&&o&&typeof n=="number"){const r=o.children[n+1];if(r?.type==="text"&&r.value){const a=r.value.match(/^\s*(\{[^}]+\})/);if(a){const u=a[1],m=F(u);P(t,m),r.value=r.value.replace(a[0],"")}}}if(t.type==="listItem"&&t.children?.length>0){const r=t.children[t.children.length-1];if(r?.type==="paragraph"&&r.children?.length>0){const a=r.children[r.children.length-1];if(a?.type==="text"&&a.value){const u=a.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);if(u){const m=u[1].trim(),d=u[2],c=F(d);a.value=m,P(t,c)}}}}if(t.type==="list"&&o&&typeof n=="number"){const r=o.children[n+1];if(r?.type==="paragraph"&&r.children?.length===1){const a=r.children[0];if(a?.type==="text"&&a.value){const u=a.value.match(/^\s*(\{[^}]+\})\s*$/);if(u){const m=u[1],d=F(m);P(t,d),o.children.splice(n+1,1)}}}}if(t.type==="blockquote"&&t.children?.length>0){const r=t.children[t.children.length-1];if(r?.type==="paragraph"&&r.children?.length>0){const a=r.children[r.children.length-1];if(a?.type==="text"&&a.value){const u=a.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);if(u){const m=u[1].trim(),d=u[2],c=F(d);a.value=m,P(t,c)}}}}if(t.type==="blockquote"&&o&&typeof n=="number"){const r=o.children[n+1];if(r?.type==="paragraph"&&r.children?.length===1){const a=r.children[0];if(a?.type==="text"&&a.value){const u=a.value.match(/^\s*(\{[^}]+\})\s*$/);if(u){const m=u[1],d=F(m);P(t,d),o.children.splice(n+1,1)}}}}if(t.type==="inlineCode"&&o&&typeof n=="number"){const r=o.children[n+1];if(r?.type==="text"&&r.value){const a=r.value.match(/^\s*(\{[^}]+\})/);if(a){const u=a[1],m=F(u);P(t,m),r.value=r.value.replace(a[0],"")}}}if(t.type==="code"&&t.meta){const r=t.meta.match(/\{([^}]+)\}/);if(r){const a=`{${r[1]}}`,u=F(a),m={type:"html",value:`<div class="${u.class||""}" ${Object.entries(u).filter(([d])=>d!=="class").map(([d,c])=>`${d}="${c}"`).join(" ")}>${ut(t)}</div>`};o&&typeof n=="number"&&(o.children[n]=m),t.meta=t.meta.replace(r[0],"").trim()||null}}})},dt=()=>e=>{A.visit(e,"element",t=>{if(t.tagName==="img"){const n=E.generateResponsiveImageStyles();t.properties||(t.properties={});const o=t.properties.style||"",r=o?`${o}; ${n}`:n;t.properties.style=r}})},{html:pt}=et,X={indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,end_with_newline:!1,wrap_line_length:0,indent_inner_html:!0,indent_empty_lines:!1,unformatted:["code","pre","textarea"],content_unformatted:["pre","code","textarea"],extra_liners:[]},z=e=>{if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(z);if(e&&typeof e=="object"){const t=Object.entries(e).filter(([,o])=>o!==void 0).sort(([o],[r])=>o<r?-1:o>r?1:0),n={};for(const[o,r]of t)n[o]=z(r);return n}return e},j=e=>JSON.stringify(z(e??{})),J=e=>e.type==="text"||e.type==="inlineCode"?e.value||"":e.children&&Array.isArray(e.children)?e.children.map(J).join(""):"",mt=(e,t)=>`${e}-${t.join("-")}`,yt=e=>{const t=[],n=[];for(const o of e){const r=o.level;for(;n.length>r;)n.pop();for(;n.length<r;)n.push(0);const a=r-1;n[a]=(n[a]||0)+1;const u=n.slice(0,r);t.push({level:o.level,text:o.text,numbers:u})}return t},V=(e,t,n)=>{const o=E.generateHeadingId(t);return o!==void 0?`${e}-${o}`:n()},gt=e=>{const t=[],n=[];for(const o of e){const r={level:o.level,text:o.text,id:o.id,children:[]};for(;n.length>0;){const a=n[n.length-1];if(a&&a.level>=o.level)n.pop();else break}if(n.length===0)t.push(r);else{const a=n[n.length-1];a&&a.children.push(r)}n.push(r)}return t},wt=e=>{const{plugins:t=[],logger:n=Z(),fetcher:o}=e,r=new Map;for(const s of t){if(r.has(s.name))throw new Error(`Plugin with name '${s.name}' is already registered`);r.set(s.name,s)}const a=async(s,h,f)=>{const p=r.get(s);return p?await p.processBlock(h,f):`<pre><code class="language-${s}">${E.escapeHtml(h)}</code></pre>`},u=(s,h,f)=>{const p={logger:n,signal:h,frontmatter:s,getUniqueId:f,fetcher:o};return()=>async y=>{const g=[];A.visit(y,"code",(w,k,H)=>{if(!w.lang||!r.has(w.lang))return;const $=(async()=>{const v={type:"html",value:await a(w.lang,w.value,p)};H&&typeof k=="number"&&(H.children[k]=v)})();g.push($)}),await Promise.all(g)}},m=(s,h,f=!1,p=!1,y="")=>()=>g=>{const w=[],k=[];A.visit(g,"heading",v=>{v.depth>=1&&v.depth<=6&&k.push(v)});let H=[];if(f){const v=k.map(O=>({level:O.depth,text:J(O)}));H=yt(v)}const $=[];k.forEach((v,O)=>{const T=J(v),N=v.data?.hProperties?.id;let b;if(N)b=N;else if(f&&p){const S=V(y,T,()=>h(T)).replace(`${y}-`,"");for(;$.length>0;){const C=$[$.length-1];if(C&&C.level>=v.depth)$.pop();else break}const _=$.map(C=>C.contentId);b=_.length>0?`${y}-${_.join("-")}-${S}`:`${y}-${S}`,$.push({level:v.depth,contentId:S})}else if(f&&O<H.length){const S=H[O];S?b=mt(y,S.numbers):b=h(T)}else b=h(T);v.data||(v.data={}),v.data.hProperties||(v.data.hProperties={}),N||(v.data.hProperties.id=b),w.push({level:v.depth,text:T,id:b})});const I=gt(w);s.push(...I)},d=s=>{throw n.error(`Failed to process markdown: ${s instanceof Error?s.message:"Unknown error"}`),new Error(`Failed to process markdown: ${s instanceof Error?s.message:"Unknown error"}`)},c=async(s,h,f,p,y,g)=>{const{signal:w,useContentStringHeaderId:k=!1,useHierarchicalHeadingId:H=!0,advancedOptions:$}=f??{},{allowDangerousHtml:I=!0,htmlOptions:v=X,gfmOptions:O={},remarkPlugins:T=[],rehypePlugins:N=[]}=$||{},b=[];let S=0;const _=()=>`${h}-${++S}`;let L=ot.unified().use(at);if(T)for(const x of T)Array.isArray(x)?L=L.use(x[0],x[1]):L=L.use(x);let C=L.use(nt,O).use(ft).use(m(b,k?x=>V(h,x,_):_,H,k,h)).use(u(p,w,_)).use(st,{allowDangerousHtml:I}).use(dt).use(rt,{allowDangerousHtml:I});if(N)for(const x of N)Array.isArray(x)?C=C.use(x[0],x[1]):C=C.use(x);const M=await C.process(y),K=String(M);return{html:pt(K,v),frontmatter:p,changed:g,headingTree:b,composeMarkdown:()=>g?G(p,y):s,uniqueIdPrefix:h}};return{process:async(s,h,f={})=>{try{const{data:p,content:y}=W(s);return await c(s,h,f,p,y,!1)}catch(p){return d(p)}},processWithFrontmatterTransform:async(s,h,f,p,y={})=>{try{const{data:g,content:w}=W(s),k=j(g),$=f({originalFrontmatter:g,markdownContent:w,uniqueIdPrefix:h});if($===void 0)return;const{frontmatter:I,uniqueIdPrefix:v}=$,O=v??h,N=(I===g?k:j(I))!==k,b=await c(s,O,y,I,w,N);let S=b.frontmatter;if(p){const M={frontmatter:S,headingTree:b.headingTree};S=p(M)}const L=j(S)!==k,C=()=>L?G(S,w):s;return{html:b.html,frontmatter:S,changed:L,headingTree:b.headingTree,composeMarkdown:C,uniqueIdPrefix:b.uniqueIdPrefix}}catch(g){return d(g)}}}},vt=(e,t={})=>{const{maxRedirects:n=5,timeoutEachRedirect:o=1e4}=t;return{name:"oembed",processBlock:async(a,u)=>{const m=a.trim();if(!E.isValidUrl(m))throw new Error(`Invalid URL: ${m}`);try{const d=await E.fetchOEmbedData(m,n,o,u,e);return E.generateHtml(d,m,t)}catch(d){u.logger.warn("oEmbed fetch failed for URL:",m,d);const c=E.formatErrorInfo(d);return E.generateFallbackHtml(m,c)}}}},Et=(e={})=>({name:"card",processBlock:async(n,o)=>{const r=n.trim();if(!E.isValidUrl$1(r))throw new Error(`Invalid URL: ${r}`);try{const a=await E.fetchMetadata(r,e,o);return E.generateCardHtml(a,r,e)}catch(a){o.logger.warn("Card plugin fetch failed for URL:",r,a);const u=E.formatErrorInfo(a);return E.generateFallbackHtml$1(r,u)}}}),kt=(e={})=>{const{className:t="mermaid",includeId:n=!0}=e;return{name:"mermaid",processBlock:async(r,a)=>{const u=r.trim();if(!u){a.logger.warn("Mermaid plugin received empty content");const l=n?` id="${a.getUniqueId()}"`:"";return`<div class="${t}-wrapper">
|
|
15
14
|
<style>
|
|
16
15
|
.${t}-wrapper .${t} > svg {
|
|
17
16
|
width: auto !important;
|
|
@@ -20,7 +19,7 @@ ${ot(e)}---
|
|
|
20
19
|
}
|
|
21
20
|
</style>
|
|
22
21
|
<div class="${t}"${l}><!-- Empty mermaid content --></div>
|
|
23
|
-
</div>`}const m=n?` id="${a.getUniqueId()}"`:"",d=
|
|
22
|
+
</div>`}const m=n?` id="${a.getUniqueId()}"`:"",d=u.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),c=`<div class="${t}-wrapper">
|
|
24
23
|
<style>
|
|
25
24
|
.${t}-wrapper .${t} > svg {
|
|
26
25
|
width: auto !important;
|
|
@@ -29,13 +28,13 @@ ${ot(e)}---
|
|
|
29
28
|
}
|
|
30
29
|
</style>
|
|
31
30
|
<div class="${t}"${m}>${d}</div>
|
|
32
|
-
</div>`;return a.logger.debug("Mermaid plugin processed content:",{contentLength:
|
|
31
|
+
</div>`;return a.logger.debug("Mermaid plugin processed content:",{contentLength:u.length,className:t,includeId:n}),c}}};/*!
|
|
33
32
|
* name: async-primitives
|
|
34
|
-
* version: 1.
|
|
33
|
+
* version: 1.3.0
|
|
35
34
|
* description: A collection of primitive functions for asynchronous operations
|
|
36
35
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
37
36
|
* license: MIT
|
|
38
37
|
* repository.url: https://github.com/kekyo/async-primitives.git
|
|
39
|
-
* git.commit.hash:
|
|
40
|
-
*/const
|
|
38
|
+
* git.commit.hash: 6b1d53b0ee118665efe2e6e75428483d2b530aba
|
|
39
|
+
*/const Q=()=>{},Y={release:Q,[Symbol.dispose]:Q},bt=(e,t)=>{if(!e)return Y;if(e.aborted){try{t()}catch(a){console.warn("AbortHook callback error: ",a)}return Y}let n;n=()=>{if(n){e.removeEventListener("abort",n),n=void 0;try{t()}catch(a){console.warn("AbortHook callback error: ",a)}}};const o=()=>{n&&(e.removeEventListener("abort",n),n=void 0)};return e.addEventListener("abort",n,{once:!0}),{release:o,[Symbol.dispose]:o}},St=e=>{typeof setImmediate=="function"?setImmediate(e):setTimeout(e,0)},D=()=>new Error("Lock acquisition was aborted"),$t=e=>{let t=!0;const n=()=>{t&&(t=!1,e())};return{get isActive(){return t},release:n,[Symbol.dispose]:n}},B=(e=20)=>{let t=!1;const n=[];let o=0;const r=()=>{var l;if(t||n.length===0)return;const i=n.shift();if((l=i.signal)!=null&&l.aborted){i.reject(D()),a();return}t=!0;const s=$t(u);i.resolve(s)},a=()=>{o++,o>=e?(o=0,St(r)):r()},u=()=>{t&&(t=!1,a())},m=l=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)},d=async l=>{if(l){if(l.aborted)throw D();return new Promise((i,s)=>{const h={resolve:void 0,reject:void 0,signal:l},f=bt(l,()=>{m(h),s(D())});h.resolve=p=>{f.release(),i(p)},h.reject=p=>{f.release(),s(p)},n.push(h),r()})}else return new Promise((i,s)=>{n.push({resolve:i,reject:s}),r()})};return{lock:d,waiter:{wait:d},get isLocked(){return t},get pendingCount(){return n.length}}},Ct=(e="cache:")=>{const t=B(),n=()=>{try{return typeof window<"u"&&typeof window.localStorage<"u"&&window.localStorage!==null}catch{return!1}},o=async()=>{if(!n())return;const c=Date.now(),l=[];for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);if(!s||!s.startsWith(e))continue;const h=localStorage.getItem(s);if(h)try{const f=JSON.parse(h);f.ttl!==void 0&&(f.ttl===0||c>f.timestamp+f.ttl)&&l.push(s)}catch{l.push(s)}}for(const i of l)localStorage.removeItem(i)};return{get:async c=>{if(!n())throw new Error("localStorage is not available in this environment");const l=e+c,i=localStorage.getItem(l);if(!i)return null;let s;try{s=JSON.parse(i)}catch{const h=await t.lock();try{return localStorage.removeItem(l),null}finally{h.release()}}if(s.ttl!==void 0&&(s.ttl===0||Date.now()>s.timestamp+s.ttl)){const f=await t.lock();try{const p=Date.now();return(s.ttl===0||p>s.timestamp+s.ttl)&&localStorage.removeItem(l),null}finally{f.release()}}return s.data},set:async(c,l,i)=>{if(!n())throw new Error("localStorage is not available in this environment");const s=e+c,h={data:l,timestamp:Date.now()};i!==void 0&&(h.ttl=i);const f=JSON.stringify(h),p=await t.lock();try{try{localStorage.setItem(s,f)}catch(y){if(y instanceof Error&&y.name==="QuotaExceededError"){await o();try{localStorage.setItem(s,f)}catch(g){throw new Error(`Failed to store cache entry: ${g}`)}}else throw new Error(`Failed to store cache entry: ${y}`)}}finally{p.release()}},delete:async c=>{if(!n())throw new Error("localStorage is not available in this environment");const l=e+c,i=await t.lock();try{localStorage.removeItem(l)}finally{i.release()}},clear:async()=>{if(!n())throw new Error("localStorage is not available in this environment");const c=[];for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);s&&s.startsWith(e)&&c.push(s)}if(c.length===0)return;const l=await t.lock();try{for(const i of c)localStorage.removeItem(i)}finally{l.release()}},size:async()=>{if(!n())throw new Error("localStorage is not available in this environment");const c=[];for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);s&&s.startsWith(e)&&c.push(s)}if(c.length===0)return 0;const l=await t.lock();try{const i=Date.now();let s=0;for(const h of c){const f=localStorage.getItem(h);if(f)try{const p=JSON.parse(f);if(p.ttl!==void 0&&(p.ttl===0||i>p.timestamp+p.ttl)){localStorage.removeItem(h);continue}s++}catch{localStorage.removeItem(h)}}return s}finally{l.release()}}}},tt=()=>{const e=new Map,t=B(),n=(d=Date.now())=>{const c=[];for(const[l,i]of e.entries())i.ttl!==void 0&&(i.ttl===0||d>i.timestamp+i.ttl)&&c.push(l);for(const l of c)e.delete(l);return c};return{get:async d=>{const c=e.get(d);if(!c)return null;if(c.ttl!==void 0&&(c.ttl===0||Date.now()>c.timestamp+c.ttl)){const i=await t.lock();try{const s=e.get(d);if(s&&s.ttl!==void 0){const h=Date.now();(s.ttl===0||h>s.timestamp+s.ttl)&&e.delete(d)}return null}finally{i.release()}}return c.data},set:async(d,c,l)=>{const i={data:c,timestamp:Date.now()};l!==void 0&&(i.ttl=l);const s=await t.lock();try{e.set(d,i)}finally{s.release()}},delete:async d=>{const c=await t.lock();try{e.delete(d)}finally{c.release()}},clear:async()=>{const d=await t.lock();try{e.clear()}finally{d.release()}},size:async()=>{if(Array.from(e.entries()).length===0)return 0;const c=await t.lock();try{return n(),e.size}finally{c.release()}}}},xt=async e=>{try{const n=require("crypto").createHash("sha256");return n.update(e,"utf8"),n.digest("hex")}catch(t){throw new Error(`Failed to generate hash: ${t}`)}},Ht=e=>{if(typeof window<"u")throw new Error("File system cache is only available in Node.js environment, not in browsers");const t=B(),n=async c=>`${await xt(c)}.json`,o=async()=>{try{const{promises:c}=require("fs");await c.mkdir(e,{recursive:!0})}catch(c){if(c.code!=="EEXIST")throw new Error(`Failed to create cache directory: ${c}`)}};return{get:async c=>{const l=await n(c);try{await o()}catch(p){throw new Error(`Failed to ensure cache directory: ${p}`)}const{promises:i}=require("fs"),h=require("path").join(e,l);let f;try{const p=await i.readFile(h,"utf-8");f=JSON.parse(p)}catch{return null}if(f.ttl!==void 0&&(f.ttl===0||Date.now()>f.timestamp+f.ttl)){const y=await t.lock();try{const g=Date.now();return(f.ttl===0||g>f.timestamp+f.ttl)&&await i.unlink(h),null}catch{return null}finally{y.release()}}return f.data},set:async(c,l,i)=>{const s=await n(c),h={data:l,timestamp:Date.now()};i!==void 0&&(h.ttl=i);const f=JSON.stringify(h,null,2),p=await t.lock();try{await o();const{promises:y}=require("fs"),w=require("path").join(e,s);try{await y.writeFile(w,f,"utf-8")}catch(k){throw new Error(`Failed to write cache entry: ${k}`)}}catch(y){throw new Error(`Failed to import required modules: ${y}`)}finally{p.release()}},delete:async c=>{const l=await n(c),i=await t.lock();try{await o();const{promises:s}=require("fs"),f=require("path").join(e,l);try{await s.unlink(f)}catch{}}catch(s){throw new Error(`Failed to import required modules: ${s}`)}finally{i.release()}},clear:async()=>{const c=await t.lock();try{await o();const{promises:l}=require("fs"),i=require("path"),h=(await l.readdir(e)).filter(f=>f.endsWith(".json"));for(const f of h){const p=i.join(e,f);try{await l.unlink(p)}catch{}}}catch(l){throw new Error(`Failed to import required modules: ${l}`)}finally{c.release()}},size:async()=>{await o();const{promises:c}=require("fs"),l=require("path"),s=(await c.readdir(e)).filter(f=>f.endsWith(".json"));if(s.length===0)return 0;const h=await t.lock();try{const f=Date.now();let p=0;for(const y of s){const g=l.join(e,y);try{const w=await c.readFile(g,"utf8"),k=JSON.parse(w);if(k.ttl!==void 0&&(k.ttl===0||f>k.timestamp+k.ttl)){await c.unlink(g);continue}p++}catch{try{await c.unlink(g)}catch{}}}return p}catch(f){throw new Error(`Failed to import required modules: ${f}`)}finally{h.release()}}}};function q(e,t,n){return`fetch:${e}:${t}:${n||"default"}`}const Ft=(e,t=6e4,n,o)=>{const{cache:r=!0,cacheTTL:a=3600*1e3,cacheFailures:u=!0,failureCacheTTL:m=300*1e3}=o||{},d=r?n||tt():void 0;return{rawFetcher:async(l,i,s,h)=>{if(r&&d){const y=q(l,i,e),g=await d.get(y);if(g)try{const w=JSON.parse(g);if(w.type==="success")return h?.info(`Cache HIT (success) for URL: ${l}`),new Response(w.data,{status:200,statusText:"OK",headers:{"Content-Type":i,"X-Cache":"HIT"}});if(w.type==="error"&&u)throw h?.info(`Cache HIT (error) for URL: ${l}`),new Error("Cached error");h?.debug(`Cache entry type ${w.type} not eligible for use, cacheFailures: ${u}`)}catch(w){if(h?.warn(`Failed to parse cached entry for URL ${l}:`,w),w instanceof SyntaxError)h?.debug("JSON parse error, continuing to network fetch");else throw w}else h?.info(`Cache MISS for URL: ${l}`)}let f,p=null;try{f=await E.fetchData(l,i,e,t,s,h)}catch(y){if(p=y,r&&d&&u)try{const g=q(l,i,e),w={type:"error",data:"",error:{message:p.message,...p.message.includes("HTTP error, status:")&&{status:parseInt(p.message.match(/status: (\d+)/)?.[1]||"0")}},timestamp:Date.now()};await d.set(g,JSON.stringify(w),m),h?.debug(`Cached error for URL: ${l}`)}catch(g){h?.warn(`Failed to cache error for URL ${l}:`,g),console.warn("Failed to cache error:",g)}throw p}if(r&&d&&f.ok)try{const y=await f.clone().text(),g=q(l,i,e),w={type:"success",data:y,timestamp:Date.now()};await d.set(g,JSON.stringify(w),a),h?.debug(`Cached successful response for URL: ${l}`)}catch(y){h?.warn(`Failed to cache response for URL ${l}:`,y),console.warn("Failed to cache response:",y)}return f},userAgent:e}},It=(e,t=6e4)=>({rawFetcher:async(o,r,a,u)=>(u?.debug(`Direct fetch for URL: ${o}`),await E.fetchData(o,r,e,t,a,u)),userAgent:e});exports.defaultProviderList=E.defaultProviderList;exports.fetchData=E.fetchData;exports.fetchJson=E.fetchJson;exports.fetchText=E.fetchText;exports.generateHeadingId=E.generateHeadingId;exports.createCachedFetcher=Ft;exports.createCardPlugin=Et;exports.createDirectFetcher=It;exports.createFileSystemCacheStorage=Ht;exports.createLocalCacheStorage=Ct;exports.createMarkdownProcessor=wt;exports.createMemoryCacheStorage=tt;exports.createMermaidPlugin=kt;exports.createOEmbedPlugin=vt;exports.defaultHtmlOptions=X;exports.generateCacheKey=q;exports.getConsoleLogger=ht;exports.getNoOpLogger=Z;
|
|
41
40
|
//# sourceMappingURL=index.cjs.map
|