2024-06-18 08:24:14 +03:00
"use strict" ; var Al = ( e , t , l ) => { if ( ! t . has ( e ) ) throw TypeError ( "Cannot " + l ) } ; var Yl = ( e , t , l ) => ( Al ( e , t , "read from private field" ) , l ? l . call ( e ) : t . get ( e ) ) , xl = ( e , t , l ) => { if ( t . has ( e ) ) throw TypeError ( "Cannot add the same private member more than once" ) ; t instanceof WeakSet ? t . add ( e ) : t . set ( e , l ) } , yl = ( e , t , l , n ) => ( Al ( e , t , "write to private field" ) , n ? n . call ( e , l ) : t . set ( e , l ) , l ) ; / * !
2024-06-13 21:01:37 +03:00
THIS IS A GENERATED / BUNDLED FILE BY ESBUILD
if you want to view the source , please visit the github repository https : //github.com/mokeyish/obsidian-enhancing-export .
2024-06-18 08:24:14 +03:00
* / O b j e c t . d e f i n e P r o p e r t i e s ( e x p o r t s , { _ _ e s M o d u l e : { v a l u e : ! 0 } , [ S y m b o l . t o S t r i n g T a g ] : { v a l u e : " M o d u l e " } } ) ; c o n s t W e = r e q u i r e ( " o b s i d i a n " ) , t c = r e q u i r e ( " c h i l d _ p r o c e s s " ) , N t = r e q u i r e ( " p r o c e s s " ) , m n = r e q u i r e ( " e l e c t r o n " ) , G n = r e q u i r e ( " f s " ) , d e = r e q u i r e ( " p a t h " ) , l c = r e q u i r e ( " u t i l " ) ; f u n c t i o n b l ( e ) { c o n s t t = O b j e c t . c r e a t e ( n u l l , { [ S y m b o l . t o S t r i n g T a g ] : { v a l u e : " M o d u l e " } } ) ; i f ( e ) { f o r ( c o n s t l i n e ) i f ( l ! = = " d e f a u l t " ) { c o n s t n = O b j e c t . g e t O w n P r o p e r t y D e s c r i p t o r ( e , l ) ; O b j e c t . d e f i n e P r o p e r t y ( t , l , n . g e t ? n : { e n u m e r a b l e : ! 0 , g e t : ( ) = > e [ l ] } ) } } r e t u r n t . d e f a u l t = e , O b j e c t . f r e e z e ( t ) } c o n s t n c = b l ( W e ) , S e = b l ( m n ) , U t = b l ( G n ) , f t = { M a r k d o w n : { n a m e : " M a r k d o w n " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - s - o " $ { o u t p u t P a t h } " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , " M a r k d o w n ( H u g o ) " : { n a m e : " M a r k d o w n ( H u g o ) " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n + h u g o . l u a " - s - o " $ { o u t p u t P a t h } " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , H t m l : { n a m e : " H t m l " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a t h _ b l o c k . l u a " - - e m b e d - r e s o u r c e s - - s t a n d a l o n e - - m e t a d a t a t i t l e = " $ { c u r r e n t F i l e N a m e } " - s - o " $ { o u t p u t P a t h } " - t h t m l ' , c u s t o m A r g u m e n t s : ' - - m a t h j a x = " h t t p s : / / c d n . j s d e l i v r . n e t / n p m / m a t h j a x @ 3 / e s 5 / t e x - s v g - f u l l . j s " ' , e x t e n s i o n : " . h t m l " } , T e x t B u n d l e : { n a m e : " T e x t B u n d l e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - V m e d i a _ d i r = " $ { o u t p u t D i r } / $ { o u t p u t F i l e N a m e } . t e x t b u n d l e / a s s e t s " - s - o " $ { o u t p u t D i r } / $ { o u t p u t F i l e N a m e } . t e x t b u n d l e / t e x t . m d " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , T y p s t : { n a m e : " T y p s t " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - s - o " $ { o u t p u t P a t h } " - t t y p s t ' , e x t e n s i o n : " . t y p " } , P D F : { n a m e : " P D F " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / p d f . l u a " $ { o p t i o n s . t e x t e m p l a t e ? ` - - r e s o u r c e - p a t h = " $ { p l u g i n D i r } / t e x t e m p l a t e " - - t e m p l a t e = " $ { o p t i o n s . t e x t e m p l a t e } " ` : ` ` } - o " $ { o u t p u t P a t h } " - t p d f ' , c u s t o m A r g u m e n t s : " - - p d f - e n g i n e = p d f l a t e x " , o p t i o n s M e t a : { t e x t e m p l a t e : " p r e s e t : t e x t e m p l a t e " } , e x t e n s i o n : " . p d f " } , " W o r d ( . d o c x ) " : { n a m e : " W o r d ( . d o c x ) " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - o " $ { o u t p u t P a t h } " - t d o c x ' , e x t e n s i o n : " . d o c x " } , O p e n O f f i c e : { n a m e : " O p e n O f f i c e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - o " $ { o u t p u t P a t h } " - t o d t ' , e x t e n s i o n : " . o d t " } , R T F : { n a m e : " R T F " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t r t f ' , e x t e n s i o n : " . r t f " } , E p u b : { n a m e : " E p u b " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - o " $ { o u t p u t P a t h } " - t e p u b ' , e x t e n s i o n : " . e p u b " } , L a t e x : { n a m e : " L a t e x " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " $ { o p t i o n s . t e x t e m p l a t e ? ` - - r e s o u r c e - p a t h = " $ { p l u g i n D i r } / t e x t e m p l a t e " - - t e m p l a t e = " $ { o p t i o n s . t e x t e m p l a t e } " ` : ` ` } - - e x t r a c t - m e d i a = " $ { o u t p u t D i r } " - s - o " $ { o u t p u t P a t h } " - t l a t e x ' , o p t i o n s M e t a : { t e x t e m p l a t e : " p r e s e t : t e x t e m p l a t e " } , e x t e n s i o n : " . t e x " } , " M e d i a W i k i " : { n a m e : " M e d i a W i k i " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t m e d i a w i k i ' , e x t e n s i o n : " . m e d i a w i k i " } , r e S t r u c t u r e d T e x t : { n a m e : " r e S t r u c t u r e d T e x t " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t r s t ' , e x t e n s i o n : " . r s t " } , T e x t i l e : { n a m e : " T e x t i l e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u
2024-06-13 21:01:37 +03:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-06-18 08:24:14 +03:00
* /function ct(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let l="",n=!1;const c=e.match(/ ^ - + /);for(let i=c?c[0].length:0;i<e.length;i++){let s=e.charAt(i);n&&(n=!1,s=s.toUpperCase()),i!==0&&(s==="-"||s==="_")?n=!0:s!=="-"&&s!=="_"&&(l+=s)}return l}}function Bn(e,t){const l=e.toLowerCase();t=t||"-";let n="";for(let c=0;c<e.length;c++){const i=l.charAt(c),s=e.charAt(c);i!==s&&c>0?n+=`${t}${l.charAt(c)}`:n+=s}return n}function Fn(e){return e==null?!1:typeof e=="number"||/ ^ 0 x [ 0 - 9 a - f ] + $ / i . test ( e ) ? ! 0 : /^0[^.]/ . test ( e ) ? ! 1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/ . test ( e ) } / * *
2024-06-13 21:01:37 +03:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-06-18 08:24:14 +03:00
* /function Kc(e){if(Array.isArray(e))return e.map(s=>typeof s!="string"?s+"":s);e=e.trim();let t=0,l=null,n=null,c=null;const i=[];for(let s=0;s<e.length;s++){if(l=n,n=e.charAt(s),n===" "&&!c){l!==" "&&t++;continue}n===c?c=null:(n==="'"||n==='"')&&!c&&(c=n),i[t]||(i[t]=""),i[t]+=n}return i}/ * *
2024-06-13 21:01:37 +03:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-06-18 08:24:14 +03:00
* /var he;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(he||(he={}));/ * *
2024-06-13 21:01:37 +03:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-06-18 08:24:14 +03:00
* /let Ye;class Qc{constructor(t){Ye=t}parse(t,l){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},l),c=Kc(t),i=typeof t=="string",s=zc(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),r=Object.assign(Object.create(null),n.default),C=n.configObjects||[],u=n.envPrefix,h=a["populate--"],Y=h?"--":"_",X=Object.create(null),M=Object.create(null),O=n.__||Ye.format,b={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},j=/ ^ - ( [ 0 - 9 ] + ( \ . [ 0 - 9 ] + ) ? | \ . [ 0 - 9 ] + ) $ / , k = new RegExp ( "^--" + a [ "negation-prefix" ] + "(.+)" ) ; [ ] . concat ( n . array || [ ] ) . filter ( Boolean ) . forEach ( function ( o ) { const g = typeof o == "object" ? o . key : o , W = Object . keys ( o ) . map ( function ( Z ) { return { boolean : "bools" , string : "strings" , number : "numbers" } [ Z ] } ) . filter ( Boolean ) . pop ( ) ; W && ( b [ W ] [ g ] = ! 0 ) , b . arrays [ g ] = ! 0 , b . keys . push ( g ) } ) , [ ] . concat ( n . boolean || [ ] ) . filter ( Boolean ) . forEach ( function ( o ) { b . bools [ o ] = ! 0 , b . keys . push ( o ) } ) , [ ] . concat ( n . string || [ ] ) . filter ( Boolean ) . forEach ( function ( o ) { b . strings [ o ] = ! 0 , b . keys . push ( o ) } ) , [ ] . concat ( n . number || [ ] ) . filter ( Boolean ) . forEach ( function ( o ) { b . numbers [ o ] = ! 0 , b . keys . push ( o ) } ) , [ ] . concat ( n . count || [ ] ) . filter ( Boolean ) . forEach ( function ( o ) { b . counts [ o ] = ! 0 , b . keys . push ( o ) } ) , [ ] . concat ( n . normalize || [ ] ) . filter ( Boolean ) . forEach ( function ( o ) { b . normalize [ o ] = ! 0 , b . keys . push ( o ) } ) , typeof n . narg == "object" && Object . entries ( n . narg ) . forEach ( ( [ o , g ] ) => { typeof g == "number" && ( b . nargs [ o ] = g , b . keys . push ( o ) ) } ) , typeof n . coerce == "object" && Object . entries ( n . coerce ) . forEach ( ( [ o , g ] ) => { typeof g == "function" && ( b . coercions [ o ] = g , b . keys . push ( o ) ) } ) , typeof n . config < "u" && ( Array . isArray ( n . config ) || typeof n . config == "string" ? [ ] . concat ( n . config ) . filter ( Boolean ) . forEach ( function ( o ) { b . configs [ o ] = ! 0 } ) : typeof n . config == "object" && Object . entries ( n . config ) . forEach ( ( [ o , g ] ) => { ( typeof g == "boolean" || typeof g == "function" ) && ( b . configs [ o ] = g ) } ) ) , te ( n . key , s , n . default , b . arrays ) , Object . keys ( r ) . forEach ( function ( o ) { ( b . aliases [ o ] || [ ] ) . forEach ( function ( g ) { r [ g ] = r [ o ] } ) } ) ; let z = null ; ec ( ) ; let $ = [ ] ; const w = Object . assign ( Object . create ( null ) , { _ : [ ] } ) , be = { } ; for ( let o = 0 ; o < c . length ; o ++ ) { const g = c [ o ] , W = g . replace ( /^-{3,}/ , "---" ) ; let Z , d , y , A , J , q ; if ( g !== "--" && /^-/ . test ( g ) && Qe ( g ) ) Ze ( g ) ; else if ( W . match ( /^---+(=|$)/ ) ) { Ze ( g ) ; continue } else if ( g . match ( /^--.+=/ ) || ! a [ "short-option-groups" ] && g . match ( /^-.+=/ ) ) A = g . match ( /^--?([^=]+)=([\s\S]*)$/ ) , A !== null && Array . isArray ( A ) && A . length >= 3 && ( V ( A [ 1 ] , b . arrays ) ? o = f ( o , A [ 1 ] , c , A [ 2 ] ) : V ( A [ 1 ] , b . nargs ) !== ! 1 ? o = p ( o , A [ 1 ] , c , A [ 2 ] ) : R ( A [ 1 ] , A [ 2 ] , ! 0 ) ) ; else if ( g . match ( k ) && a [ "boolean-negation" ] ) A = g . match ( k ) , A !== null && Array . isArray ( A ) && A . length >= 2 && ( d = A [ 1 ] , R ( d , V ( d , b . arrays ) ? [ ! 1 ] : ! 1 ) ) ; else if ( g . match ( /^--.+/ ) || ! a [ "short-option-groups" ] && g . match ( /^-[^-]+/ ) ) A = g . match ( /^--?(.+)/ ) , A !== null && Array . isArray ( A ) && A . length >= 2 && ( d = A [ 1 ] , V ( d , b . arrays ) ? o = f ( o , d , c ) : V ( d , b . nargs ) !== ! 1 ? o = p ( o , d , c ) : ( J = c [ o + 1 ] , J !== void 0 && ( ! J . match ( /^-/ ) || J . match ( j ) ) && ! V ( d , b . bools ) && ! V ( d , b . counts ) || /^(true|false)$/ . test ( J ) ? ( R ( d , J ) , o ++ ) : R ( d , ze ( d ) ) ) ) ; else if ( g . match ( /^-.\..+=/ ) ) A = g . match ( /^-([^=]+)=([\s\S]*)$/ ) , A !== null && Array . isArray ( A ) && A . length >= 3 && R ( A [ 1 ] , A [ 2 ] ) ; else if ( g . match ( /^-.\..+/ ) && ! g . match ( j ) ) J = c [ o + 1 ] , A = g . match ( /^-(.\..+)/ ) , A !== null && Array . isArray ( A ) && A . length >= 2 && ( d = A [ 1 ] , J !== void 0 && ! J . match ( /^-/ ) && ! V ( d , b . bools ) && ! V ( d , b . counts ) ? ( R ( d , J ) , o ++ ) : R ( d , ze ( d ) ) ) ; else if ( g . match ( /^-[^-]+/ ) && ! g . match ( j ) ) { y = g . slice ( 1
2024-06-13 21:01:37 +03:00
* @ fileoverview Main entrypoint for libraries using yargs - parser in Node . js
* CJS and ESM environments .
*
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-06-18 08:24:14 +03:00
* /var Tt,$t,Mt;const wl=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,El=($t=(Tt=process==null?void 0:process.versions)===null||Tt===void 0?void 0:Tt.node)!==null&&$t!==void 0?$t:(Mt=process==null?void 0:process.version)===null||Mt===void 0?void 0:Mt.slice(1);if(El&&Number(El.match(/ ^ ( [ ^ . ] + ) / ) [ 1 ] ) < wl ) throw Error ( ` yargs parser supports a minimum Node.js version of ${ wl } . Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions ` ) ; const jc = process ? process . env : { } , Hn = new Qc ( { cwd : process . cwd , env : ( ) => jc , format : lc . format , normalize : de . normalize , resolve : de . resolve , require : e => { if ( typeof require < "u" ) return require ( e ) ; if ( e . match ( /\.json$/ ) ) return JSON . parse ( Gn . readFileSync ( e , "utf8" ) ) ; throw Error ( "only .json config files are supported in ESM" ) } } ) , Zt = function ( t , l ) { return Hn . parse ( t . slice ( ) , l ) . argv } ; Zt . detailed = function ( e , t ) { return Hn . parse ( e . slice ( ) , t ) } ; Zt . camelCase = ct ; Zt . decamelize = Bn ; Zt . looksLikeNumber = Fn ; const Lc = { exportToOo : "导出为......" , exportWithPrevious : "使用上一次设置导出" , exportSuccessNotice : L ` 导出文件 ${ 0 } 成功! ` , exportCommandOutputMessage : L ` 命令: ${ 0 } ` , exportErrorOutputMessage : L ` 命令 ${ 0 } ,错误: ${ 1 } ` , pleaseOpenFile : "请打开一个文件先。" , preparing : L ` 正在生成 " ${ 0 } " ...... ` , exportDialog : { fileName : "文件名" , type : "类型" , exportTo : "导出到" , title : L ` 导出为 ${ 0 } ` , export : "导出" , selectExportFolder : "请选择导出文件夹" , overwriteConfirmation : "覆盖提示" } , messageBox : { yes : "是" , no : "否" , ok : "确认" , cancel : "取消" } , overwriteConfirmationDialog : { replace : "替换" , title : L ` " ${ 0 } " 已经存在。您要替换它吗? ` , message : L ` " ${ 0 } " 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。 ` } , settingTab : { title : "导出设置" , general : "通用" , name : "名称" , customLocation : "自定义" , pandocVersion : L ` 版本: ${ 0 } ` , pandocVersionWithWarning : L ` Version: ${ 0 } , 请升级版本到 ${ 1 } ` , pandocNotFound : "找不到 Pandoc, 请填写 Pandoc 文件路径,或者将其添加到系统环境变量中。" , pandocPath : "Pandoc 路径" , defaultFolderForExportedFile : "默认的导出文件夹" , openExportedFileLocation : "打开导出文件所在目录" , sameFolderWithCurrentFile : "与原文件同一目录下" , openExportedFile : "打开导出文件" , pandocPathPlaceholder : "(自动检测)" , editCommandTemplate : "编辑命令模板" , chooseCommandTemplate : "选择模板" , afterExport : "导出后" , command : "命令" , arguments : "参数" , auto : "自动" , reset : "重置" , add : "添加" , remove : "移除" , rename : "重命名" , targetFileExtensions : "目标文件扩展名" , targetFileExtensionsTip : "(用空格分开)" , showCommandOutput : "显示命令行输出" , runCommand : "运行自定义命令" , extraArguments : "自定义参数" , save : "保存" , new : "新建" , template : "模板" , advanced : "高级" , environmentVariables : "环境变量" , environmentVariablesDesc : "定义导出的环境变量." , ShowExportProgressBar : "显示导出进度条" } } , Tc = { exportToOo : "Export to..." , exportSuccessNotice : L ` Export file ${ 0 } success! ` , exportCommandOutputMessage : L ` Command: ${ 0 } ` , exportErrorOutputMessage : L ` Command: ${ 0 } , Error:${ 1 } ` , exportWithPrevious : "Export with Previous" , pleaseOpenFile : "Please open a file first." , preparing : L ` generating " ${ 0 } "... ` , exportDialog : { exportTo : "Export to" , fileName : "File Name" , title : L ` Export to ${ 0 } ` , export : "Export" , selectExportFolder : "Please select an export folder." , overwriteConfirmation : "Overwrite confirmation" , type : "Type" } , messageBox : { yes : "Yes" , no : "No" , ok : "Ok" , cancel : "Cancel" } , overwriteConfirmationDialog : { replace : "Replace" , title : L ` " ${ 0 } " already exists. Do you want to replace it? ` , message : L ` A file or folder with the same name already exists in the folder " ${ 0 } ". Replacing it will overwrite its current contents. ` } , settingTab : { general : "General" , name : "Name" , title : "Export Settings" , pandocVersion : L ` Version: ${ 0 } ` , pandocVersionWithWarning : L ` Version: ${ 0 } , please upgrade version to ${ 1 } ` , pandocNotFound : "Pandoc not found, please fill in the Pandoc file path, or add it to the system environment variables." , defaultFold
` )).replace("pandoc.exe","").replace("pandoc","").trim();let n=[...l].filter(c=>c===".").length;if(n===1)l= ` $ { l } . 0 ` ;else for(;n>2;)l=l.substring(0,l.lastIndexOf(".")),n-=1;return qa.parse(l,!0)}const tr="3.1.7",Vt={normalizePath:zn,getVersion:er,requiredVersion:tr};async function Un(e,t,l,n,c,i,s,a,r,C){const{settings:u,lang:h,manifest:Y,app:{vault:{adapter:X,config:M},metadataCache:O}}=e;if(!n){const ce=hn(c);n= ` $ { t . basename } $ { ce } ` }i==null&&(i=u.showOverwriteConfirmation);const b=u.showExportProgressBar,j=X.getBasePath(),k= ` $ { j } / $ { Y . dir } ` ,z= ` $ { k } / lua ` , $ =l,w= ` $ { $ } / $ { n } ` ,be=n.substring(0,n.lastIndexOf(".")),Ze=n,p=X.getFullPath(t.path),f=de.dirname(p),R=t.basename,N=t.name;let _=M.attachmentFolderPath??"/";_==="/"?_=j:_.startsWith(".")?_=de.join(f,_.substring(1)):_=de.join(j,_);let I=null;try{I=O.getCache(t.path).frontmatter}catch(ce){console.error(ce)}const m={pluginDir:k,luaDir:z,outputDir: $ ,outputPath:w,outputFileName:be,outputFileFullName:Ze,currentDir:f,currentPath:p,currentFileName:R,currentFileFullName:N,attachmentFolderPath:_,vaultDir:j,metadata:I,options:s,fromFormat:app.vault.config.useMarkdownLinks?"markdown":"markdown+wikilinks_title_after_pipe"},H=c.type==="custom"&&c.showCommandOutput,B=c.openExportedFileLocation??u.openExportedFileLocation,F=c.openExportedFile??u.openExportedFile;if(i&&Ut.existsSync(w)){const ce=await Se.remote.dialog.showSaveDialog({title:h.overwriteConfirmationDialog.title(Ze),defaultPath:w,properties:["showOverwriteConfirmation","createDirectory"]});if(ce.canceled)return;m.outputPath=ce.filePath,m.outputDir=de.dirname(m.outputPath),m.outputFileFullName=de.basename(m.outputPath),m.outputFileName=de.basename(m.outputFileFullName,de.extname(m.outputFileFullName))}let x;b&&(x=Dc.show(h.preparing(m.outputFileFullName)));const v=m.env=In(ue(u.env)??{},m);let E=Vt.normalizePath(ue(u.pandocPath));if(Nt.platform==="win32"){E=E.replaceAll(" \\ ","/");const ce=["pluginDir","luaDir","outputDir","outputPath","currentDir","currentPath","attachmentFolderPath","vaultDir"];for(const Ve of ce){const Qe=m[Ve];m[Ve]=Qe.replaceAll(" \\ ","/")}}const S=c.type==="pandoc"? ` $ { E } "\${currentPath}" $ { c . arguments ? ? "" } $ { c . customArguments ? ? "" } ` :c.command,K=il(S,m),te=Zt(K.match(/(?:[^ \s "]+|"[^"]*")+/g),{alias:{output:["o"]}}),V=de.normalize(cc(te.output)),Ge=de.dirname(V);Ut.existsSync(Ge)||Ut.mkdirSync(Ge);try{console.log( ` [ $ { e . manifest . name } ] : export command and options : ` ,{cmd:K,options:{cwd:m.currentDir,env:v}}),await cl(K,{cwd:m.currentDir,env:v}),x==null||x();const ce=async()=>{if(B&&setTimeout(()=>{Se.remote.shell.showItemInFolder(V)},1e3),F&&await Se.remote.shell.openPath(V),c.type==="pandoc"&&c.runCommand===!0&&c.command){const Ve=il(c.command,m);await cl(Ve,{cwd:m.currentDir,env:v})}a&&a()};if(H){const Ve=new Kl(app,h.exportCommandOutputMessage(K));Ve.onClose=ce,Ve.open()}else new We.Notice(h.exportSuccessNotice(m.outputFileFullName),1500),await ce()}catch(ce){x==null||x(),new Kl(app,h.exportErrorOutputMessage(K,ce)).open(),r&&r()}}const gl=e=>{const t=new We.Modal(e.app);let l=[],n=!1;return Fe(()=>{se(t.titleEl,()=>e.title)}),Fe(()=>{se(t.contentEl,()=>e.children)}),Fe(()=>{const c=Object.entries(e.classList??{}).filter(([,i])=>i).map(([i])=>i);l.length>0&&t.containerEl.removeClasses(l),c.length>0&&t.containerEl.addClasses(c),l=c}),Fe(()=>{t.containerEl.style.display=e.hidden?"None":""}),t.onClose=()=>{n||(n=!0,e.onClose())},pn(()=>t.open()),_e(()=>{n||t.close()}),document.createTextNode("")};var lr=me("<button>");const ul=e=>(()=>{var t=lr();return Gl(t,"click",e.onClick,!0),se(t,()=>e.children),ne(()=>t.classList.toggle("mod-cta",!!e.cta)),t})();ml(["click"]);var nr=me("<div><div class=setting-item-info><div class=setting-item-name></div><div class=setting-item-description></div></div><div class=setting-item-control>"),cr=me("<div class=checkbox-container><input type=checkbox>"),ir=me("<div class=setting-editor-extra-setting-button>"),sr=me("<input type=text>"),ar=me("<textarea>"),rr=me("<select class=dropdown>"),or=me("<option>");const jn=dc(),dr=()=>gc(jn),Q=e=>{const t={settingEl:null};return G(jn.Provi
` )),r=(...p)=>{c(...p),t.saveSettings()},C=p=>{try{const f={};for(let R of p.split( `
` )){R=R.trim();const N=R.indexOf("=");if(N>0){const _=R.substring(0,N);let I=R.substring(N+1).trim();I.startsWith('"')&&I.endsWith('"')&&(I=I.substring(1,I.length-1)),f[_]=I}}r("env",Be(n.env??{},f))}catch(f){alert(f)}},u=le(()=>n.items.find(p=>p.name===n.lastEditName)??n.items.first()),h=p=>{const f=u();return p===void 0||p===f.type?f:void 0},Y=le(()=>ue(n.customDefaultExportDirectory)),X=p=>{const f=n.items.findIndex(R=>R.name===n.lastEditName);r("items",f===-1?0:f,Xr(R=>(p(R),R)))},M=le(()=>{const p=i();return p?app.vault.config.useMarkdownLinks&&p.compare(Vt.requiredVersion)===-1?l.settingTab.pandocVersionWithWarning(Vt.requiredVersion):l.settingTab.pandocVersion(p):l.settingTab.pandocNotFound}),[O,b]=oe(),j=()=>{const[p,f]=oe(Object.keys(ft)[0]),[R,N]=oe(),_=()=>{const I=JSON.parse(JSON.stringify(ft[p()]));I.name=R(),Xt(()=>{r("items",m=>[...m,I]),r("lastEditName",I.name)}),b(void 0)};return G(gl,{app,get title(){return l.settingTab.new},onClose:()=>b(void 0),get children(){return[G(Q,{get name(){return l.settingTab.template},get children(){return G(rt,{get options(){return Object.entries(ft).map(([I,m])=>({name:m.name,value:I}))},get selected(){return R()??p()},onChange:I=>f(I)})}}),G(Q,{get name(){return l.settingTab.name},get children(){return G(ge,{get value(){return R()??""},onChange:I=>N(I)})}}),(()=>{var I=un();return se(I,G(ul,{cta:!0,onClick:_,get children(){return l.settingTab.save}})),I})()]}})},k=()=>{const[p,f]=oe(h().name),R=()=>{Xt(()=>{X(N=>N.name=p()),r("lastEditName",p())}),b(void 0)};return G(gl,{app,get title(){return l.settingTab.rename},onClose:()=>b(void 0),get children(){return[G(Q,{get name(){return l.settingTab.name},get children(){return G(ge,{get value(){return p()??""},onChange:N=>f(N)})}}),(()=>{var N=un();return se(N,G(ul,{cta:!0,onClick:R,get children(){return l.settingTab.add}})),N})()]}})},z=()=>{const p=()=>h("pandoc"),f=R=>{X(N=>N.type==="pandoc"?R(N):void 0)};return[G(Q,{get name(){return l.settingTab.arguments},get children(){return G(ge,{style:"width: 100%",get value(){return p().arguments??""},onChange:R=>f(N=>N.arguments=R)})}}),G(Q,{get name(){return l.settingTab.extraArguments},get children(){return G(ge,{style:"width: 100%",get value(){return p().customArguments??""},get title(){return p().customArguments},onChange:R=>f(N=>N.customArguments=R)})}}),G(Q,{get name(){return l.settingTab.afterExport},heading:!0}),G(Q,{get name(){return l.settingTab.openExportedFileLocation},get children(){return G(Ce,{get checked(){return p().openExportedFileLocation??!1},onChange:R=>f(N=>N.openExportedFileLocation=R)})}}),G(Q,{get name(){return l.settingTab.openExportedFile},get children(){return G(Ce,{get checked(){return p().openExportedFile??!1},onChange:R=>f(N=>N.openExportedFile=R)})}}),G(Q,{get name(){return l.settingTab.runCommand},get children(){return G(Ce,{get checked(){return p().runCommand},onChange:R=>f(N=>N.runCommand=R)})}}),G(Rt,{get when(){return p().runCommand},get children(){return G(Q,{get children(){return G(ge,{style:"width: 100%",get value(){return p().command??""},onChange:R=>f(N=>N.command=R)})}})}})]}, $ =()=>{const p=()=>h("custom"),f=R=>{X(N=>N.type==="custom"?R(N):void 0)};return[G(Q,{get name(){return l.settingTab.command},get children(){return G(ge,{style:"width: 100%",get value(){return p().command},onChange:R=>f(N=>N.command=R)})}}),G(Q,{get name(){return l.settingTab.targetFileExtensions},get children(){return G(ge,{get value(){return p().targetFileExtensions??""},onChange:R=>f(N=>N.targetFileExtensions=R)})}}),G(Q,{get name(){return l.settingTab.afterExport},heading:!0}),G(Q,{get name(){return l.settingTab.showCommandOutput},get children(){return G(Ce,{get checked(){return p().showCommandOutput??!1},onChange:R=>f(N=>N.showCommandOutput=R)})}}),G(Q,{get name(){return l.settingTab.openExportedFileLocation},get children(){return G(Ce,{get checked(){return p().openExportedFileLocation??!1},onChange:R=>f(N=>N.openExportedFileLocation=R)})}}),G(Q,{get name(){return l.settingTab.openExportedFile},get children(){return G(Ce,{get checked(){return p().openExportedFile?