@@ -1,4 +1,4 @@
module . exports = ( ( ) => { var _Mathhypot = Math . hypot , _Mathacos = Math . acos , _Mathtan = Math . tan , _Mathasin = Math . asin , _Mathsin = Math . sin , _Mathcos = Math . cos , _MathPI = Math . PI , _Mathsqrt = Math . sqrt , _NumberisInteger = Number . isInteger , _Stringprototype = String . prototype , _NumberPOSITIVE _INFINITY = Number . POSITIVE _INFINITY , _NumberNEGATIVE _INFINITY = Number . NEGATIVE _INFINITY , _NumberMAX _SAFE _INTEGER = Number . MAX _SAFE _INTEGER , _Mathround = Math . round , _StringfromCharCode = String . fromCharCode , _Mathabs = Math . abs , _Mathpow = Math . pow , _Mathfloor = Math . floor , _Mathceil = Math . ceil , _Mathmax = Math . max , _Mathmin = Math . min ; function _ _webpack _require _ _ ( e ) { if ( _ _webpack _module _cache _ _ [ e ] ) return _ _webpack _module _cache _ _ [ e ] . exports ; var t = _ _webpack _module _cache _ _ [ e ] = { exports : { } } , r = ! 0 ; try { _ _webpack _modules _ _ [ e ] . call ( t . exports , t , t . exports , _ _webpack _require _ _ ) , r = ! 1 } finally { r && delete _ _webpack _module _cache _ _ [ e ] } return t . exports } var _ _webpack _modules _ _ = { 45274 : ( e , t , r ) => { "use strict" ; async function n ( { log : e = ! 0 } = { } ) { const t = e ? console . debug : ( ) => null ; t ( ` metrics/setup > setup ` ) ; const n = "src/templates" , a = { templates : { } , settings : { } , statics : r . ab + "html" , node _modules : b . resolve ( "node_modules" ) } ; if ( t ( ` metrics/setup > load settings.json ` ) , y . existsSync ( r . ab + "settings.json" ) ? ( a . settings = JSON . parse ( ` ${ await y . promises . readFile ( b . resolve ( "settings.json" ) ) } ` ) , t ( ` metrics/setup > load settings.json > success ` ) ) : t ( ` metrics/setup > load settings.json > (missing) ` ) , a . settings . templates || ( a . settings . templates = { default : "classic" , enabled : [ ] } ) , a . settings . plugins || ( a . settings . plugins = { } ) , a . settings . plugins . base = { parts : [ "header" , "activity" , "community" , "repositories" , "metadata" ] } , a . settings . debug && t ( a . settings ) , t ( ` metrics/setup > load package.json ` ) , y . existsSync ( r . ab + "package.json" ) ? ( a . package = JSON . parse ( ` ${ await y . promises . readFile ( b . resolve ( "package.json" ) ) } ` ) , t ( ` metrics/setup > load package.json > success ` ) ) : ( t ( ` metrics/setup > load package.json > (missing) ` ) , a . package = { version : "2.9.0-beta" , author : "lowlighter" } ) , y . existsSync ( r . ab + "templates" ) ) for ( const e of await y . promises . readdir ( n ) ) { if ( /.*[.]mjs$/ . test ( e ) ) continue ; t ( ` metrics/setup > load template [ ${ e } ] ` ) ; const r = [ ` ${ n } / ${ e } /query.graphql ` , ` ${ n } / ${ e } /image.svg ` , ` ${ n } / ${ e } /style.css ` , ` ${ n } / ${ e } /fonts.css ` ] , [ o , i , s , l ] = await Promise . all ( r . map ( async e => ` ${ await y . promises . readFile ( b . resolve ( e ) ) } ` ) ) ; a . templates [ e ] = { query : o , image : i , style : s , fonts : l } , t ( ` metrics/setup > load template [ ${ e } ] > success ` ) , a . settings . debug && Object . defineProperty ( a . templates , e , { get ( ) { t ( ` metrics/setup > reload template [ ${ e } ] ` ) ; const [ n , a , o , i ] = r . map ( e => ` ${ y . readFileSync ( b . resolve ( e ) ) } ` ) ; return t ( ` metrics/setup > reload template [ ${ e } ] > success ` ) , { query : n , image : a , style : o , fonts : i } } } ) } else t ( ` metrics/setup > load templates from build ` ) , a . templates = JSON . parse ( Buffer . from ( ` eyJjbGFzc2ljIjp7InF1ZXJ5IjoicXVlcnkgTWV0cmljcyB7XHJcbiAgdXNlcihsb2dpbjogJGxvZ2luKSB7XHJcbiAgICBkYXRhYmFzZUlkXHJcbiAgICBuYW1lXHJcbiAgICBsb2dpblxyXG4gICAgY3JlYXRlZEF0XHJcbiAgICBhdmF0YXJVcmxcclxuICAgIHdlYnNpdGVVcmxcclxuICAgIGlzSGlyZWFibGVcclxuICAgIHR3aXR0ZXJVc2VybmFtZVxyXG4gICAgZ2lzdHMge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICByZXBvc2l0b3JpZXMobGFzdDogJHJlcG9zaXRvcmllcywgaXNGb3JrOiBmYWxzZSwgb3duZXJBZmZpbGlhdGlvbnM6IE9XTkVSKSB7XHJcbiAgICAgIHRvdGFsQ291bnRcclxuICAgICAgdG90YWxEaXNrVXNhZ2VcclxuICAgICAgbm9kZXMge1xyXG4gICAgICAgIG5hbWVcclxuICAgICAgICB3YXRjaGVycyB7XHJcbiAgICAgICAgICB0b3RhbENvdW50XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHN0YXJnYXplcnMge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICBsYW5ndWFnZXMoZmlyc3Q6IDQpIHtcclxuICAgICAgICAgIGVkZ2VzIHtcclxuICAgICAgICAgICAgc2l6ZVxyXG4gICAgICAgICAgICBub2RlIHtcclxuICAgICAgICAgICAgICBjb2xvclxyXG4gICAgICAgICAgICAgIG5hbWVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpc3N1ZXNfb3BlbjogaXNzdWVzKHN0YXRlczogT1BFTikge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICBpc3N1ZXNfY2xvc2VkOiBpc3N1ZXMoc3RhdGVzOiBDTE9TRUQpIHtcclxuICAgICAgICAgIHRvdGFsQ291bnRcclxuICAgICAgICB9XHJcbiAgICAgICAgcHJfb3BlbjogcHVsbFJlcXVlc3RzKHN0YXRlczogT1BFTikge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICBwcl9tZXJnZWQ6IHB1bGxSZXF1ZXN0cyhzdGF0ZXM6IE1FUkdFRCkge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICByZWxlYXNlcyB7XHJcbiAgICAgICAgICB0b3RhbENvdW50XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGZvcmtDb3VudFxyXG4gICAgICAgIGxpY2Vuc2VJbmZvIHtcclxuICAgICAgICAgIHNwZHhJZFxyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgfVxyXG4gICAgcGFja2FnZXMge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBzdGFycmVkUmVwb3NpdG9yaWVzIHtcclxuICAgICAgdG90YWxDb3VudFxyXG4gICAgfVxyXG4gICAgd2F0Y2hpbmcge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBzcG9uc29yc2hpcHNBc1Nwb25zb3Ige1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBzcG9uc29yc2hpcHNBc01haW50YWluZXIge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBjb250cmlidXRpb25zQ29sbGVjdGlvbiB7XHJcbiAgICAgIHRvdGFsUmVwb3NpdG9yaWVzV2l0aENvbnRyaWJ1dGVkQ29tbWl0c1xyXG4gICAgICB0b3RhbENvbW1pdENvbnRyaWJ1dGlvbnNcclxuICAgICAgcmVzdHJpY3RlZENvbnRyaWJ1dGlvbnNDb3VudFxyXG4gICAgICB0b3RhbElzc3VlQ29udHJpYnV0aW9uc1xyXG4gICAgICB0b3RhbFB1b
Line truncated
module . exports = ( ( ) => { var _Mathhypot = Math . hypot , _Mathacos = Math . acos , _Mathtan = Math . tan , _Mathasin = Math . asin , _Mathsin = Math . sin , _Mathcos = Math . cos , _MathPI = Math . PI , _Mathsqrt = Math . sqrt , _NumberisInteger = Number . isInteger , _NumberPOSITIVE _INFINITY = Number . POSITIVE _INFINITY , _NumberNEGATIVE _INFINITY = Number . NEGATIVE _INFINITY , _Stringprototype = String . prototype , _NumberMAX _SAFE _INTEGER = Number . MAX _SAFE _INTEGER , _StringfromCharCode = String . fromCharCode , _Mathabs = Math . abs , _Mathpow = Math . pow , _Mathround = Math . round , _Mathfloor = Math . floor , _Mathceil = Math . ceil , _Mathmax = Math . max , _Mathmin = Math . min ; function _ _webpack _require _ _ ( e ) { if ( _ _webpack _module _cache _ _ [ e ] ) return _ _webpack _module _cache _ _ [ e ] . exports ; var t = _ _webpack _module _cache _ _ [ e ] = { exports : { } } , r = ! 0 ; try { _ _webpack _modules _ _ [ e ] . call ( t . exports , t , t . exports , _ _webpack _require _ _ ) , r = ! 1 } finally { r && delete _ _webpack _module _cache _ _ [ e ] } return t . exports } var _ _webpack _modules _ _ = { 45274 : ( e , t , r ) => { "use strict" ; async function n ( { log : e = ! 0 } = { } ) { const t = e ? console . debug : ( ) => null ; t ( ` metrics/setup > setup ` ) ; const n = "src/templates" , a = { templates : { } , settings : { } , statics : r . ab + "html" , node _modules : b . resolve ( "node_modules" ) } ; if ( t ( ` metrics/setup > load settings.json ` ) , y . existsSync ( r . ab + "settings.json" ) ? ( a . settings = JSON . parse ( ` ${ await y . promises . readFile ( b . resolve ( "settings.json" ) ) } ` ) , t ( ` metrics/setup > load settings.json > success ` ) ) : t ( ` metrics/setup > load settings.json > (missing) ` ) , a . settings . templates || ( a . settings . templates = { default : "classic" , enabled : [ ] } ) , a . settings . plugins || ( a . settings . plugins = { } ) , a . settings . plugins . base = { parts : [ "header" , "activity" , "community" , "repositories" , "metadata" ] } , a . settings . debug && t ( S . inspect ( a . settings , { depth : 1 / 0 , maxStringLength : 256 } ) ) , t ( ` metrics/setup > load package.json ` ) , y . existsSync ( r . ab + "package.json" ) ? ( a . package = JSON . parse ( ` ${ await y . promises . readFile ( b . resolve ( "package.json" ) ) } ` ) , t ( ` metrics/setup > load package.json > success ` ) ) : ( t ( ` metrics/setup > load package.json > (missing) ` ) , a . package = { version : "2.9.0" , author : "lowlighter" } ) , y . existsSync ( r . ab + "templates" ) ) for ( const e of await y . promises . readdir ( n ) ) { if ( /.*[.]mjs$/ . test ( e ) ) continue ; t ( ` metrics/setup > load template [ ${ e } ] ` ) ; const r = [ ` ${ n } / ${ e } /query.graphql ` , ` ${ n } / ${ e } /image.svg ` , ` ${ n } / ${ e } /style.css ` , ` ${ n } / ${ e } /fonts.css ` ] , [ o , i , s , l ] = await Promise . all ( r . map ( async e => ` ${ await y . promises . readFile ( b . resolve ( e ) ) } ` ) ) ; a . templates [ e ] = { query : o , image : i , style : s , fonts : l } , t ( ` metrics/setup > load template [ ${ e } ] > success ` ) , a . settings . debug && Object . defineProperty ( a . templates , e , { get ( ) { t ( ` metrics/setup > reload template [ ${ e } ] ` ) ; const [ n , a , o , i ] = r . map ( e => ` ${ y . readFileSync ( b . resolve ( e ) ) } ` ) ; return t ( ` metrics/setup > reload template [ ${ e } ] > success ` ) , { query : n , image : a , style : o , fonts : i } } } ) } else t ( ` metrics/setup > load templates from build ` ) , a . templates = JSON . parse ( Buffer . from ( ` eyJjbGFzc2ljIjp7InF1ZXJ5IjoicXVlcnkgTWV0cmljcyB7XHJcbiAgdXNlcihsb2dpbjogJGxvZ2luKSB7XHJcbiAgICBkYXRhYmFzZUlkXHJcbiAgICBuYW1lXHJcbiAgICBsb2dpblxyXG4gICAgY3JlYXRlZEF0XHJcbiAgICBhdmF0YXJVcmxcclxuICAgIHdlYnNpdGVVcmxcclxuICAgIGlzSGlyZWFibGVcclxuICAgIHR3aXR0ZXJVc2VybmFtZVxyXG4gICAgZ2lzdHMge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICByZXBvc2l0b3JpZXMobGFzdDogJHJlcG9zaXRvcmllcywgaXNGb3JrOiBmYWxzZSwgb3duZXJBZmZpbGlhdGlvbnM6IE9XTkVSKSB7XHJcbiAgICAgIHRvdGFsQ291bnRcclxuICAgICAgdG90YWxEaXNrVXNhZ2VcclxuICAgICAgbm9kZXMge1xyXG4gICAgICAgIG5hbWVcclxuICAgICAgICB3YXRjaGVycyB7XHJcbiAgICAgICAgICB0b3RhbENvdW50XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHN0YXJnYXplcnMge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICBsYW5ndWFnZXMoZmlyc3Q6IDQpIHtcclxuICAgICAgICAgIGVkZ2VzIHtcclxuICAgICAgICAgICAgc2l6ZVxyXG4gICAgICAgICAgICBub2RlIHtcclxuICAgICAgICAgICAgICBjb2xvclxyXG4gICAgICAgICAgICAgIG5hbWVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpc3N1ZXNfb3BlbjogaXNzdWVzKHN0YXRlczogT1BFTikge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICBpc3N1ZXNfY2xvc2VkOiBpc3N1ZXMoc3RhdGVzOiBDTE9TRUQpIHtcclxuICAgICAgICAgIHRvdGFsQ291bnRcclxuICAgICAgICB9XHJcbiAgICAgICAgcHJfb3BlbjogcHVsbFJlcXVlc3RzKHN0YXRlczogT1BFTikge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICBwcl9tZXJnZWQ6IHB1bGxSZXF1ZXN0cyhzdGF0ZXM6IE1FUkdFRCkge1xyXG4gICAgICAgICAgdG90YWxDb3VudFxyXG4gICAgICAgIH1cclxuICAgICAgICByZWxlYXNlcyB7XHJcbiAgICAgICAgICB0b3RhbENvdW50XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGZvcmtDb3VudFxyXG4gICAgICAgIGxpY2Vuc2VJbmZvIHtcclxuICAgICAgICAgIHNwZHhJZFxyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgfVxyXG4gICAgcGFja2FnZXMge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBzdGFycmVkUmVwb3NpdG9yaWVzIHtcclxuICAgICAgdG90YWxDb3VudFxyXG4gICAgfVxyXG4gICAgd2F0Y2hpbmcge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBzcG9uc29yc2hpcHNBc1Nwb25zb3Ige1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBzcG9uc29yc2hpcHNBc01haW50YWluZXIge1xyXG4gICAgICB0b3RhbENvdW50XHJcbiAgICB9XHJcbiAgICBjb250cmlidXRpb25zQ29sbGVjdGlvbiB7XHJcbiAgICAgIHRvdGFsUmVwb3NpdG9yaWVzV2l0aENvbnRyaWJ1dGVkQ29tbWl0c1xyXG4gICAgICB0b3RhbENvbW1pdENvbnRyaWJ1dGlvbnNcclxuICAgICAgcmVzdHJpY3RlZENvbnRyaWJ1dGlvbnNDb3VudFxyXG4gICAgICB0b3RhbElzc3VlQ29
Line truncated
query Gists {
user ( login : "${e}" ) {
gists ( last : 100 ) {
@@ -16,7 +16,7 @@ module.exports=(()=>{var _Mathhypot=Math.hypot,_Mathacos=Math.acos,_Mathtan=Math
}
}
}
` );let o=0,i=0,s=0;for(const e of a.nodes)e.isFork||(o+=e.stargazerCount,i+=e.forks.totalCount,s+=e.comments.totalCount);return{totalCount:a.totalCount,stargazers:o,forks:i,comments:s}}catch(e){throw console.debug(e),{error:{message: ` An error occured ` }}}},habits:async function({login:e,rest:t,imports:r,q:n},{enabled:a=!1,from:o=100}={}){try{if(!a||!n.habits)return null;let{"habits.from":i=o.from??500,"habits.days":s=30,"habits.facts":l=!0,"habits.charts":d=!1}=n;i=_Mathmax(1,_Mathmin(1e3,+i)),s=_Mathmax(1,_Mathmin(30,+i));const p={facts:l,charts:d,commits:{hour:NaN,hours:{},day:NaN,days:{}},indents:{style:"",spaces:0,tabs:0},linguist:{available:!1,ordered:[],languages:{}}},c=_Mathceil(i/100),u=[];try{for(let r=0;r<c;r++)console.debug( ` metrics / compute / $ { e } / plugins > habits > loaded page $ { r } ` ),u.push(...(await t.activity.listEventsForAuthenticatedUser({username:e,per_page:100,page:r})).data)}catch{console.debug( ` metrics / compute / $ { e } / plugins > habits > no more events to load ` )}console.debug( ` metrics / compute / $ { e } / plugins > habits > no more events to load ( $ { u . length } loaded ) ` );const m=u.filter(({type:e})=>"PushEvent"===e).filter(({actor:t})=>t.login===e).filter(({created_at:e})=>new Date(e)>new Date(Date.now()-1e3*(60*(60*(24*s)))));console.debug( ` metrics / compute / $ { e } / plugins > habits > filtered out $ { m . length } commits ` );const g=m[0]?.actor?.id??0,h=[...(await Promise.allSettled(m.flatMap(({payload:e})=>e.commits).map(e=>e.url).map(async e=>(await t.request(e)).data.files)))].filter(({status:e})=>"fulfilled"===e).map(({value:e})=>e).flatMap(e=>e.map(e=>({name:r.paths.basename(e.filename),patch:e.patch??""}))).map(({name:e,patch:t})=>({name:e,patch:t.split(" \n ").filter(e=>/^[-+]/.test(e)).map(e=>e.substring(1)).join(" \n ")}));{const e=m.map(({created_at:e})=>new Date(e).getDay());for(const t of e)p.commits.days[t]=(p.commits.days[t]??0)+1;p.commits.days.max=_Mathmax(...Object.values(p.commits.days)),p.commits.day=e.length?["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][Object.entries(p.commits.days).sort(([e,t],[r,n])=>n-t).map(([e,t])=>e)[0]]??NaN:NaN}{const e=m.map(({created_at:e})=>new Date(e).getHours());for(const t of e)p.commits.hours[t]=(p.commits.hours[t]??0)+1;p.commits.hours.max=_Mathmax(...Object.values(p.commits.hours)),p.commits.hour=e.length? ` $ { Object . entries ( p . commits . hours ) . sort ( ( [ e , t ] , [ r , n ] ) => n - t ) . map ( ( [ e , t ] ) => e ) [ 0 ] } ` .padStart(2,"0"):NaN}if(h.map(({patch:e})=>e.match(/((?: \t )|(?: )) /gm)??[]).forEach(e=>p.indents[/^ \t /.test(e)?"tabs":"spaces"]++),p.indents.style=p.indents.spaces>p.indents.tabs?"spaces":p.indents.tabs>p.indents.spaces?"tabs":"",d){const t={win32:"wsl"}[process.platform]??"";if(h.length&&(await r.run( ` $ { t } which github - linguist ` ))){p.linguist.available=!0;const n=r.paths.join(r.os.tmpdir(), ` $ { g } ` );await r.fs.mkdir(n,{recursive:!0}),await Promise.all(h.map(async({name:e,patch:t},a)=>await r.fs.writeFile(r.paths.join(n, ` $ { a } $ { r . paths . extname ( e ) } ` ),t))),console.debug( ` metrics / compute / $ { e } / plugins > habits > created temp dir $ { n } with $ { h . length } files ` ),await r.run( ` git init && git add . && git config user . name "linguist" && git config user . email "null@github.com" && git commit - m "linguist" ` ,{cwd:n}).catch(console.debug),await r.run( ` git status ` ,{cwd:n}),console.debug( ` metrics / compute / $ { e } / plugins > habits > created temp git repository ` ),console.debug( ` metrics / compute / $ { e } / plugins > habits > running linguist ` ),(await r.run( ` $ { t } github - linguist ` ,{cwd:n})).split(" \n ").map(e=>e.match(/(?<value>[ \d .]+)% \s +(?<language> \w +)/)?.groups).filter(e=>e).map(({value:e,language:t})=>p.linguist.languages[t]=(p.linguist.languages[t]??0)+e/100),p.linguist.ordered=Object.entries(p.linguist.languages).sort(([e,t],[r,n])=>n-t)}else console.debug( ` metrics / compute / $ { e } / plugins > habits > linguist is not available ` )}return p}catch(e){throw console.debug(e),{error:{message: ` An error occured ` }}}},isocalendar:async function({login:e,graphql:t,q:r},{enabled:n=!1}={}){try{if(!n||!r.isocalendar)return null;let{"isocalendar.duration":a="half-year"}=r;a=["full-year","half-year"].includes(a)?a:"full-year";const o=new Date,s=new Date(o);"full-year"===a?s.setFullYear(o.getFullYear()-1):s.setHours(-4320);const l=new Date(s);l.setHours(-336);const d={};for(const[r,n,a]of[["padding",l,s],["weeks",s,o]]){console.debug( ` metrics / compute / $ { e } / plugins > isocalendar > loading "${r}" from "${n.toISOString()}" to "${a.toISOString()}" ` );const{user:{calendar:{contributionCalendar:{weeks:o}}}}=await t( `
` );console.debug( ` metrics / compute / $ { e } / plugins > gists > processing $ { a . nodes . length } gists ` );let o=0,i=0,s=0;for(const e of a.nodes)e.isFork||(o+=e.stargazerCount,i+=e.forks.totalCount,s+=e.comments.totalCount);return{totalCount:a.totalCount,stargazers:o,forks:i,comments:s}}catch(e){throw{error:{message:"An error occured",instance:e}}}},habits:async function({login:e,rest:t,imports:r,data:n,q:a},{enabled:o=!1,from:i=100}={}){try{if(!o||!a.habits)return null;let{"habits.from":s=i.from??500,"habits.days":l=30,"habits.facts":d=!0,"habits.charts":p=!1}=a;s=_Mathmax(1,_Mathmin(1e3,+s)),l=_Mathmax(1,_Mathmin(30,+s));const c={facts:d,charts:p,commits:{hour:NaN,hours:{},day:NaN,days:{}},indents:{style:"",spaces:0,tabs:0},linguist:{available:!1,ordered:[],languages:{}}},u=_Mathceil(s/100),m=n.config.timezone?.offset??0;console.debug( ` metrics / compute / $ { e } / plugins > habits > querying api ` );const g=[];try{for(let r=0;r<u;r++)console.debug( ` metrics / compute / $ { e } / plugins > habits > loading page $ { r } ` ),g.push(...(await t.activity.listEventsForAuthenticatedUser({username:e,per_page:100,page:r})).data)}catch{console.debug( ` metrics / compute / $ { e } / plugins > habits > no more page to load ` )}console.debug( ` metrics / compute / $ { e } / plugins > habits > $ { g . length } events loaded ` );const h=g.filter(({type:e})=>"PushEvent"===e).filter(({actor:t})=>t.login===e).filter(({created_at:e})=>new Date(e)>new Date(Date.now()-1e3*(60*(60*(24*l)))));console.debug( ` metrics / compute / $ { e } / plugins > habits > filtered out $ { h . length } push events over last $ { l } days ` ),console.debug( ` metrics / compute / $ { e } / plugins > habits > loading patches ` );const f=[...(await Promise.allSettled(h.flatMap(({payload:e})=>e.commits).map(e=>e.url).map(async e=>(await t.request(e)).data.files)))].filter(({status:e})=>"fulfilled"===e).map(({value:e})=>e).flatMap(e=>e.map(e=>({name:r.paths.basename(e.filename),patch:e.patch??""}))).map(({name:e,patch:t})=>({name:e,patch:t.split(" \n ").filter(e=>/^[-+]/.test(e)).map(e=>e.substring(1)).join(" \n ")}));{console.debug( ` metrics / compute / $ { e } / plugins > habits > searching most active day of week ` );const t=h.map(({created_at:e})=>new Date(new Date(e).getTime()+m).getDay());for(const e of t)c.commits.days[e]=(c.commits.days[e]??0)+1;c.commits.days.max=_Mathmax(...Object.values(c.commits.days)),c.commits.day=t.length?["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][Object.entries(c.commits.days).sort(([e,t],[r,n])=>n-t).map(([e,t])=>e)[0]]??NaN:NaN}{console.debug( ` metrics / compute / $ { e } / plugins > habits > searching most active time of day ` );const t=h.map(({created_at:e})=>new Date(new Date(e).getTime()+m).getHours());for(const e of t)c.commits.hours[e]=(c.commits.hours[e]??0)+1;c.commits.hours.max=_Mathmax(...Object.values(c.commits.hours)),c.commits.hour=t.length? ` $ { Object . entries ( c . commits . hours ) . sort ( ( [ e , t ] , [ r , n ] ) => n - t ) . map ( ( [ e , t ] ) => e ) [ 0 ] } ` .padStart(2,"0"):NaN}if(console.debug( ` metrics / compute / $ { e } / plugins > habits > searching indent style ` ),f.map(({patch:e})=>e.match(/((?: \t )|(?: )) /gm)??[]).forEach(e=>c.indents[/^ \t /.test(e)?"tabs":"spaces"]++),c.indents.style=c.indents.spaces>c.indents.tabs?"spaces":c.indents.tabs>c.indents.spaces?"tabs":"",p){console.debug( ` metrics / compute / $ { e } / plugins > habits > searching recently used languages using linguist ` );const t={win32:"wsl"}[process.platform]??"";if(f.length&&(await r.run( ` $ { t } which github - linguist ` ))){c.linguist.available=!0;const n=r.paths.join(r.os.tmpdir(), ` $ { h [ 0 ] ? . actor ? . id ? ? 0 } ` );console.debug( ` metrics / compute / $ { e } / plugins > habits > creating temp dir $ { n } with $ { f . length } files ` ),await r.fs.mkdir(n,{recursive:!0}),await Promise.all(f.map(async({name:e,patch:t},a)=>await r.fs.writeFile(r.paths.join(n, ` $ { a } $ { r . paths . extname ( e ) } ` ),t))),console.debug( ` metrics / compute / $ { e } / plugins > habits > creating temp git repository ` ),await r.run( ` git init && git add . && git config user . name "linguist" && git config user . email "null@github.com" && git commit - m "linguist" ` ,{cwd:n}).catch(console.debug),await r.run( ` git status ` ,{cwd:n}),console.debug( ` metrics / compute / $ { e } / plugins > habits > running linguist ` ),(await r.run( ` $ { t } github - linguist -- breakdown ` ,{cwd:n})).split(" \n ").map(e=>e.match(/(?<value>[ \d .]+)% \s +(?<language> \w +)/)?.groups).filter(e=>e).map(({value:e,language:t})=>c.linguist.languages[t]=(c.linguist.languages[t]??0)+e/100),c.linguist.ordered=Object.entries(c.linguist.languages).sort(([e,t],[r,n])=>n-t)}else console.debug( ` metrics / compute / $ { e } / plugins > habits > linguist not available ` )}return c}catch(e){if(e.error?.message)throw e;throw{error:{message:"An error occured",instance:e}}}},isocalendar:async function({login:e,graphql:t,q:r},{enabled:n=!1}={}){try{if(!n||!r.isocalendar)return null;let{"isocalendar.duration":a="half-year"}=r;a=["full-year","half-year"].includes(a)?a:"full-year";const o=new Date,s=new Date(o);"full-year"===a?s.setFullYear(o.getFullYear()-1):s.setHours(-4320);const l=new Date(s);l.setHours(-336),console.debug( ` metrics / compute / $ { e } Line truncated
query Calendar {
user ( login : "${e}" ) {
calendar : contributionsCollection ( from : "${n.toISOString()}" , to : "${a.toISOString()}" ) {
@@ -32,7 +32,7 @@ module.exports=(()=>{var _Mathhypot=Math.hypot,_Mathacos=Math.acos,_Mathtan=Math
}
}
}
` );d[r]=o}const p=d.weeks[0].contributionDays,c=d.padding.flatMap(({contributionDays:e})=>e).filter(({date:e})=>!p.map(({date:e})=>e).includes(e));for(;7>p.length;)p.unshift(c.pop());let u=0,m={max:0,current:0},g=[],h=0;for(const e of d.weeks)for(const t of e.contributionDays)g.push(t.contributionCount),u=_Mathmax(u,t.contributionCount),m.current=t.contributionCount?m.current+1:0,m.max=_Mathmax(m.max,m.current);h=(g.reduce((e,t)=>e+t,0)/g.length).toFixed(2).replace(/[.]0+ $ /,"");const f=6;let y=0,i=0,b= `
` );d[r]=o}console.debug( ` metrics / compute / $ { e } / plugins > isocalendar > applying padding ` ); const p=d.weeks[0].contributionDays,c=d.padding.flatMap(({contributionDays:e})=>e).filter(({date:e})=>!p.map(({date:e})=>e).includes(e));for(;7>p.length;)p.unshift(c.pop());console.debug( ` metrics / compute / $ { e } / plugins > isocalendar > computing stats ` ); let u=0,m={max:0,current:0},g=[],h=0;for(const e of d.weeks)for(const t of e.contributionDays)g.push(t.contributionCount),u=_Mathmax(u,t.contributionCount),m.current=t.contributionCount?m.current+1:0,m.max=_Mathmax(m.max,m.current);h=(g.reduce((e,t)=>e+t,0)/g.length).toFixed(2).replace(/[.]0+$ /,""),console.debug( ` metrics / compute / $ { e } / plugins > isocalendar > computing svg render ` ) ;const f=6;let y=0,i=0,b=`
< svg version = "1.1" xmlns = "http://www.w3.org/2000/svg" style = "margin-top: -52px;" viewBox = "0,0 480,${" full - year "===a?270:170}" >
$ { [ 1 , 2 ] . map ( e => `
< filter id = "brightness${e}" >
@@ -45,7 +45,7 @@ module.exports=(()=>{var _Mathhypot=Math.hypot,_Mathacos=Math.acos,_Mathtan=Math
< path fill = "${t.color}" d = "M1.7,2 0,1 1.7,0 3.4,1 z" / >
< path fill = "${t.color}" filter = "url(#brightness1)" d = "M0,1 1.7,2 1.7,${2+e*f} 0,${1+e*f} z" / >
< path fill = "${t.color}" filter = "url(#brightness2)" d = "M1.7,2 3.4,1 3.4,${1+e*f} 1.7,${2+e*f} z" / >
< /g>`,i++}b+=`</g > ` ,y++}return b+= ` < / g > < / s v g > ` , { s t r e a k : m , m a x : u , a v e r a g e : h , s v g : b , d u r a t i o n : a } } c a t c h ( e ) { t h r o w c o n s o l e . d e b u g ( e ) , { e r r o r : { m e s s a g e : ` A n e r r o r o c c u r e d ` } } } } , l a n g u a g e s : a s y n c f u n c t i o n ( { l o g i n : e , d a t a : t , q : r } , { e n a b l e d : n = ! 1 } = { } ) { t r y { i f ( ! n | | ! r . l a n g u a g e s ) r e t u r n n u l l ; l e t { " l a n g u a g e s . i g n o r e d " : a = " " , " l a n g u a g e s . s k i p p e d " : o = " " } = r ; a = d e c o d e U R I C o m p o n e n t ( a ) . s p l i t ( " , " ) . m a p ( e = > e . t r i m ( ) . t o L o c a l e L o w e r C a s e ( ) ) . f i l t e r ( e = > e ) , o = d e c o d e U R I C o m p o n e n t ( o ) . s p l i t ( " , " ) . m a p ( e = > e . t r i m ( ) . t o L o c a l e L o w e r C a s e ( ) ) . f i l t e r ( e = > e ) ; c o n s t s = { c o l o r s : { } , t o t a l : 0 , s t a t s : { } } ; f o r ( c o n s t r o f t . u s e r . r e p o s i t o r i e s . n o d e s ) { i f ( o . i n c l u d e s ( r . n a m e . t o L o c a l e L o w e r C a s e ( ) ) ) { c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l a n g u a g e s > s k i p p e d r e p o s i t o r y $ { r . n a m e } ` ) ; c o n t i n u e } f o r ( c o n s t { s i z e : t , n o d e : { c o l o r : n , n a m e : o } } o f O b j e c t . v a l u e s ( r . l a n g u a g e s . e d g e s ) ) { i f ( a . i n c l u d e s ( o . t o L o c a l e L o w e r C a s e ( ) ) ) { c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l a n g u a g e s > i g n o r e d l a n g u a g e $ { o } ` ) ; c o n t i n u e } s . s t a t s [ o ] = ( s . s t a t s [ o ] ? ? 0 ) + t , s . c o l o r s [ o ] = n ? ? " # e d e d e d " , s . t o t a l + = t } } O b j e c t . k e y s ( s . s t a t s ) . m a p ( e = > s . s t a t s [ e ] / = s . t o t a l ) , s . f a v o r i t e s = O b j e c t . e n t r i e s ( s . s t a t s ) . s o r t ( ( [ e , t ] , [ r , n ] ) = > n - t ) . s l i c e ( 0 , 8 ) . m a p ( ( [ e , t ] ) = > ( { n a m e : e , v a l u e : t , c o l o r : s . c o l o r s [ e ] , x : 0 } ) ) ; f o r ( l e t e = 1 ; e < s . f a v o r i t e s . l e n g t h ; e + + ) s . f a v o r i t e s [ e ] . x = s . f a v o r i t e s [ e - 1 ] . x + s . f a v o r i t e s [ e - 1 ] . v a l u e ; r e t u r n s } c a t c h ( e ) { t h r o w c o n s o l e . d e b u g ( e ) , { e r r o r : { m e s s a g e : ` A n e r r o r o c c u r e d ` } } } } , l i n e s : a s y n c f u n c t i o n ( { l o g i n : e , d a t a : t , i m p o r t s : r , r e s t : n , q : a } , { e n a b l e d : o = ! 1 } = { } ) { t r y { i f ( ! o | | ! a . l i n e s ) r e t u r n n u l l ; c o n s t i = t . u s e r . r e p o s i t o r i e s . n o d e s . m a p ( ( { n a m e : e } ) = > e ) ? ? [ ] , s = { a d d e d : 0 , d e l e t e d : 0 } , l = a w a i t P r o m i s e . a l l ( i . m a p ( a s y n c t = > a w a i t n . r e p o s . g e t C o n t r i b u t o r s S t a t s ( { o w n e r : e , r e p o : t } ) ) ) ; r e t u r n l . m a p ( ( { d a t a : t } ) = > { i f ( A r r a y . i s A r r a y ( t ) ) { c o n s t [ r ] = t . f i l t e r ( ( { a u t h o r : t } ) = > t . l o g i n = = = e ) ; r & & r . w e e k s . f o r E a c h ( ( { a : e , d : t } ) = > ( s . a d d e d + = e , s . d e l e t e d + = t ) ) } } ) , s . a d d e d = r . f o r m a t ( s . a d d e d ) , s . d e l e t e d = r . f o r m a t ( s . d e l e t e d ) , s } c a t c h ( e ) { t h r o w c o n s o l e . d e b u g ( e ) , { e r r o r : { m e s s a g e : ` A n e r r o r o c c u r e d ` } } } } , m u s i c : a , p a g e s p e e d : a s y n c f u n c t i o n ( { l o g i n : e , i m p o r t s : t , d a t a : r , q : n } , { e n a b l e d : a = ! 1 , t o k e n : o = n u l l } = { } ) { t r y { i f ( ! a | | ! n . p a g e s p e e d | | ! r . u s e r . w e b s i t e U r l ) r e t u r n n u l l ; l e t { " p a g e s p e e d . d e t a i l e d " : i = ! 1 } = n ; i = ! ! i ; l e t s = r . u s e r . w e b s i t e U r l ; / ^ h t t p s ? : [ / ] [ / ] / . t e s t ( s ) | | ( s = ` h t t p s : / / $ { s } ` ) ; c o n s t l = { u r l : s , d e t a i l e d : i , s c o r e s : [ ] , m e t r i c s : { } } , d = n e w M a p ; i f ( a w a i t P r o m i s e . a l l ( [ " p e r f o r m a n c e " , " a c c e s s i b i l i t y " , " b e s t - p r a c t i c e s " , " s e o " ] . m a p ( a s y n c r = > { c o n s t { s c o r e : n , t i t l e : a } = ( a w a i t t . a x i o s . g e t ( ` h t t p s : / / w w w . g o o g l e a p i s . c o m / p a g e s p e e d o n l i n e / v 5 / r u n P a g e s p e e d ? c a t e g o r y = $ { r } & u r l = $ { s } & k e y = $ { o } ` ) ) . d a t a . l i g h t h o u s e R e s u l t . c a t e g o r i e s [ r ] ; d . s e t ( r , { s c o r e : n , t i t l e : a } ) , c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > p a g e s p e e d > $ { r } a u d i t p e r f o r m e d ` ) } ) ) , l . s c o r e s = [ d . g e t ( " p e r f o r m a n c e " ) , d . g e t ( " a c c e s s i b i l i t y " ) , d . g e t ( " b e s t - p r a c t i c e s " ) , d . g e t ( " s e o " ) ] , i & & O b j e c t . a s s i g n ( l . m e t r i c s , . . . ( a w a i t t . a x i o s . g e t ( ` h t t p s : / / w w w . g o o g l e a p i s . c o m / p a g e s p e e d o n l i n e / v 5 / r u n P a g e s p e e d ? & u r l = $ { s } & k e y = $ { o } ` ) ) . d a t a . l i g h t h o u s e R e s u l t . a u d i t s . m e t r i c s . d e t a i l s . i t e m s ) , 4 > l . s c o r e s . f i l t e r ( e = > e ) . l e n g t h ) t h r o w { e r r o r : { m e s s a g e : " I n c o m p l e t e P a g e S p e e d r e s u l t s " } , u r l : s } ; r e t u r n l } c a t c h ( e ) { i f ( e . r e s p o n s e ? . s t a t u s ) t h r o w { e r r o r : { m e s s a g e : ` P a g e S p e e d t o k e n e r r o r ( c o d e $ { e . r e s p o n s e . s t a t u s } ) ` } , u r l } ; i f ( e . e r r o r ? . m e s s a g e ) t h r o w e ; t h r o w c o n s o l e . d e b u g ( e ) , { e r r o r : { m e s s a g e : ` A n e r r o r o c c u r e d ` } } } } , p o s t s : a s y n c f u n c t i o n ( { i m p o r t s : e , d a t a : t , q : r } , { e n a b l e d : n = ! 1 } = { } ) { t r y { i f ( ! n | | ! r . p o s t s ) r e t u r n n u l l ; c o n s t a = t . u s e r . l o g i n ; l e t { " p o s t s . s o u r c e " : o = " " , " p o s t s . l i m i t " : i = 4 } = r ; i = _ M a t h m a x ( 1 , _ M a t h m i n ( 3 0 , + i ) ) ; l e t s = n u l l ; s w i t c h ( o ) { c a s e " d e v . t o " : { s = ( a w a i t e . a x i o s . g e t ( ` h t t p s : / / d e v . t o / a p i / a r t i c l e s ? u s e r n a m e = $ { a } & s t a t e = f r e s h ` ) ) . d a t a . m a p ( ( { t i t l e : e , r e a d a b l e _ p u b l i s h _ d a t e : t } ) = > ( { t i t l e : e , d a t e : t } ) ) ; b r e a k } d e f a u l t : t h r o w { e r r o r : { m e s s a g e : ` U n s u p p o r t e d s o u r c e " $ { o } " ` } } ; } i f ( A r r a y . i s A r r a y ( s ) ) r e t u r n 0 < i & & ( c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { a } / p l u g i n s > p o s t s > k e e p i n g o n l y $ { i } p o s t s ` ) , s = s . s l i c e ( 0 , i ) ) , { s o u r c e : o , l i s t : s } ; t h r o w { e r r o r : { m e s s a g e : ` A n e r r o r o c c u r e d ( c o u l d n o t r e t r i e v e p o s t s ) ` } } } c a t c h ( e ) { t h r o w c o n s o l e . d e b u g ( e ) , { e r r o r : { m e s s a g e : ` A n e r r o r o c c u r e d ` } } } } , p r o j e c t s : a s y n c f u n c t i o n ( { l o g i n : e , g r a p h q l : t , q : r } , { e n a b l e d : n = ! 1 } = { } ) { t r y { i f ( ! n | | ! r . p r o j e c t s ) r e t u r n n u l l ; l e t { " p r o j e c t s . l i m i t " : a = 4 } = r ; a = _ M a t h m a x ( 1 , _ M a t h m i n ( 1 0 0 , + a ) ) ; c o n s t { u s e r : { p r o j e c t s : o } } = a w a i t t ( `
< /g>`,i++}b+=`</g > ` ,y++}return b+= ` < / g > < / s v g > ` , { s t r e a k : m , m a x : u , a v e r a g e : h , s v g : b , d u r a t i o n : a } } c a t c h ( e ) { t h r o w { e r r o r : { m e s s a g e : " A n e r r o r o c c u r e d " , i n s t a n c e : e } } } } , l a n g u a g e s : a s y n c f u n c t i o n ( { l o g i n : e , d a t a : t , q : r } , { e n a b l e d : n = ! 1 } = { } ) { t r y { i f ( ! n | | ! r . l a n g u a g e s ) r e t u r n n u l l ; l e t { " l a n g u a g e s . i g n o r e d " : a = " " , " l a n g u a g e s . s k i p p e d " : o = " " } = r ; a = d e c o d e U R I C o m p o n e n t ( a ) . s p l i t ( " , " ) . m a p ( e = > e . t r i m ( ) . t o L o c a l e L o w e r C a s e ( ) ) . f i l t e r ( e = > e ) , o = d e c o d e U R I C o m p o n e n t ( o ) . s p l i t ( " , " ) . m a p ( e = > e . t r i m ( ) . t o L o c a l e L o w e r C a s e ( ) ) . f i l t e r ( e = > e ) , c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l a n g u a g e s > p r o c e s s i n g $ { t . u s e r . r e p o s i t o r i e s . n o d e s . l e n g t h } r e p o s i t o r i e s ` ) ; c o n s t s = { c o l o r s : { } , t o t a l : 0 , s t a t s : { } } ; f o r ( c o n s t r o f t . u s e r . r e p o s i t o r i e s . n o d e s ) { i f ( o . i n c l u d e s ( r . n a m e . t o L o c a l e L o w e r C a s e ( ) ) ) { c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l a n g u a g e s > s k i p p e d r e p o s i t o r y $ { r . n a m e } ` ) ; c o n t i n u e } f o r ( c o n s t { s i z e : t , n o d e : { c o l o r : n , n a m e : o } } o f O b j e c t . v a l u e s ( r . l a n g u a g e s . e d g e s ) ) { i f ( a . i n c l u d e s ( o . t o L o c a l e L o w e r C a s e ( ) ) ) { c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l a n g u a g e s > i g n o r e d l a n g u a g e $ { o } ` ) ; c o n t i n u e } s . s t a t s [ o ] = ( s . s t a t s [ o ] ? ? 0 ) + t , s . c o l o r s [ o ] = n ? ? " # e d e d e d " , s . t o t a l + = t } } c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l a n g u a g e s > c o m p u t i n g s t a t s ` ) , O b j e c t . k e y s ( s . s t a t s ) . m a p ( e = > s . s t a t s [ e ] / = s . t o t a l ) , s . f a v o r i t e s = O b j e c t . e n t r i e s ( s . s t a t s ) . s o r t ( ( [ e , t ] , [ r , n ] ) = > n - t ) . s l i c e ( 0 , 8 ) . m a p ( ( [ e , t ] ) = > ( { n a m e : e , v a l u e : t , c o l o r : s . c o l o r s [ e ] , x : 0 } ) ) ; f o r ( l e t e = 1 ; e < s . f a v o r i t e s . l e n g t h ; e + + ) s . f a v o r i t e s [ e ] . x = s . f a v o r i t e s [ e - 1 ] . x + s . f a v o r i t e s [ e - 1 ] . v a l u e ; r e t u r n s } c a t c h ( e ) { t h r o w { e r r o r : { m e s s a g e : " A n e r r o r o c c u r e d " , i n s t a n c e : e } } } } , l i n e s : a s y n c f u n c t i o n ( { l o g i n : e , d a t a : t , i m p o r t s : r , r e s t : n , q : a } , { e n a b l e d : o = ! 1 } = { } ) { t r y { i f ( ! o | | ! a . l i n e s ) r e t u r n n u l l ; c o n s t i = t . u s e r . r e p o s i t o r i e s . n o d e s . m a p ( ( { n a m e : e } ) = > e ) ? ? [ ] ; c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l i n e s > q u e r y i n g a p i ` ) ; c o n s t s = { a d d e d : 0 , d e l e t e d : 0 } , l = a w a i t P r o m i s e . a l l ( i . m a p ( a s y n c t = > a w a i t n . r e p o s . g e t C o n t r i b u t o r s S t a t s ( { o w n e r : e , r e p o : t } ) ) ) ; r e t u r n c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > l i n e s > c o m p u t i n g t o t a l d i f f ` ) , l . m a p ( ( { d a t a : t } ) = > { i f ( A r r a y . i s A r r a y ( t ) ) { c o n s t [ r ] = t . f i l t e r ( ( { a u t h o r : t } ) = > t . l o g i n = = = e ) ; r & & r . w e e k s . f o r E a c h ( ( { a : e , d : t } ) = > ( s . a d d e d + = e , s . d e l e t e d + = t ) ) } } ) , s . a d d e d = r . f o r m a t ( s . a d d e d ) , s . d e l e t e d = r . f o r m a t ( s . d e l e t e d ) , s } c a t c h ( e ) { t h r o w { e r r o r : { m e s s a g e : " A n e r r o r o c c u r e d " , i n s t a n c e : e } } } } , m u s i c : a , p a g e s p e e d : a s y n c f u n c t i o n ( { l o g i n : e , i m p o r t s : t , d a t a : r , q : n } , { e n a b l e d : a = ! 1 , t o k e n : o = n u l l } = { } ) { t r y { i f ( ! a | | ! n . p a g e s p e e d | | ! r . u s e r . w e b s i t e U r l ) r e t u r n n u l l ; l e t { " p a g e s p e e d . d e t a i l e d " : i = ! 1 } = n ; i = ! ! i ; l e t s = r . u s e r . w e b s i t e U r l ; / ^ h t t p s ? : [ / ] [ / ] / . t e s t ( s ) | | ( s = ` h t t p s : / / $ { s } ` ) ; c o n s t l = { u r l : s , d e t a i l e d : i , s c o r e s : [ ] , m e t r i c s : { } } ; c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > p a g e s p e e d > q u e r y i n g a p i f o r $ { s } ` ) ; c o n s t d = n e w M a p ; i f ( a w a i t P r o m i s e . a l l ( [ " p e r f o r m a n c e " , " a c c e s s i b i l i t y " , " b e s t - p r a c t i c e s " , " s e o " ] . m a p ( a s y n c r = > { c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > p a g e s p e e d > p e r f o r m i n g a u d i t $ { r } ` ) ; c o n s t n = a w a i t t . a x i o s . g e t ( ` h t t p s : / / w w w . g o o g l e a p i s . c o m / p a g e s p e e d o n l i n e / v 5 / r u n P a g e s p e e d ? c a t e g o r y = $ { r } & u r l = $ { s } & k e y = $ { o } ` ) ; c o n s o l e . d e b u g ( n . d a t a ) ; c o n s t { s c o r e : a , t i t l e : i } = n . d a t a . l i g h t h o u s e R e s u l t . c a t e g o r i e s [ r ] ; d . s e t ( r , { s c o r e : a , t i t l e : i } ) , c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > p a g e s p e e d > p e r f o r m e d a u d i t $ { r } ( s t a t u s c o d e $ { n . s t a t u s } ) ` ) } ) ) , l . s c o r e s = [ d . g e t ( " p e r f o r m a n c e " ) , d . g e t ( " a c c e s s i b i l i t y " ) , d . g e t ( " b e s t - p r a c t i c e s " ) , d . g e t ( " s e o " ) ] , i ) { c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > p a g e s p e e d > p e r f o r m i n g d e t a i l e d a u d i t ` ) ; c o n s t r = a w a i t t . a x i o s . g e t ( ` h t t p s : / / w w w . g o o g l e a p i s . c o m / p a g e s p e e d o n l i n e / v 5 / r u n P a g e s p e e d ? & u r l = $ { s } & k e y = $ { o } ` ) ; c o n s o l e . d e b u g ( r . d a t a ) , O b j e c t . a s s i g n ( l . m e t r i c s , . . . r . d a t a . l i g h t h o u s e R e s u l t . a u d i t s . m e t r i c s . d e t a i l s . i t e m s ) , c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { e } / p l u g i n s > p a g e s p e e d > p e r f o r m e d d e t a i l e d a u d i t ( s t a t u s c o d e $ { r . s t a t u s } ) ` ) } r e t u r n l } c a t c h ( e ) { l e t t = " A n e r r o r o c c u r e d " ; i f ( e . i s A x i o s E r r o r ) { c o n s t r = e . r e s p o n s e ? . s t a t u s , n = e . r e s p o n s e ? . d a t a ? . e r r o r ? . m e s s a g e ? . m a t c h ( / L i g h t h o u s e r e t u r n e d e r r o r : ( ? < d e s c r i p t i o n > [ A - Z _ ] + ) / ) ? . g r o u p s ? . d e s c r i p t i o n ? ? n u l l ; t = ` A P I r e t u r n e d $ { r } $ { n ? ` ( $ { n } ) ` : " " } ` , e = e . r e s p o n s e ? . d a t a ? ? n u l l } t h r o w { e r r o r : { m e s s a g e : t , i n s t a n c e : e } } } } , p o s t s : a s y n c f u n c t i o n ( { i m p o r t s : e , d a t a : t , q : r } , { e n a b l e d : n = ! 1 } = { } ) { t r y { i f ( ! n | | ! r . p o s t s ) r e t u r n n u l l ; c o n s t a = t . u s e r . l o g i n ; l e t { " p o s t s . s o u r c e " : o = " " , " p o s t s . l i m i t " : i = 4 } = r ; i = _ M a t h m a x ( 1 , _ M a t h m i n ( 3 0 , + i ) ) , c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { a } / p l u g i n s > p o s t s > p r o c e s s i n g w i t h s o u r c e $ { o } ` ) ; l e t s = n u l l ; s w i t c h ( o ) { c a s e " d e v . t o " : { c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { a } / p l u g i n s > p o s t s > q u e r y i n g a p i ` ) , s = ( a w a i t e . a x i o s . g e t ( ` h t t p s : / / d e v . t o / a p i / a r t i c l e s ? u s e r n a m e = $ { a } & s t a t e = f r e s h ` ) ) . d a t a . m a p ( ( { t i t l e : e , r e a d a b l e _ p u b l i s h _ d a t e : t } ) = > ( { t i t l e : e , d a t e : t } ) ) ; b r e a k } d e f a u l t : t h r o w { e r r o r : { m e s s a g e : ` U n s u p p o r t e d s o u r c e " $ { o } " ` } } ; } i f ( A r r a y . i s A r r a y ( s ) ) r e t u r n 0 < i & & ( c o n s o l e . d e b u g ( ` m e t r i c s / c o m p u t e / $ { a } / p l u g i n s > p o s t s > k e e p i n g o n l y $ { i } p o s t s ` ) , s = s . s l i c e ( 0 , i ) ) , { s o u r c e : o , l i s t : s } ; t h r o w { e r r o r : { m e s s a g e : ` A n e r r o r o c c u r e d ( c o u l d n o t r e t r i e v e p o s t s ) ` } } } c a t c h ( e ) { t h r o w { e r r o r : { m e s s a g e : " A n e r r o r o c c u r e d " , i n s t a n c e : e } } } } , p r o j e c t s : a s y n c f u n c t i o n ( { l o g i n : e , g r a p h q l : t , q : r } , { e n a b l e d : n = ! 1 } = { } ) { t r y { i f ( ! n | | ! r . p r o j e c t s ) r e t u r n n u l l ; l e t { " p r o j e c t s . l i m i t " : a = 4 } = r ; a = _ M a t h m a x ( 1 , _ M a t h m i n ( 1 Line truncated
query Projects {
user ( login : "${e}" ) {
projects ( last : $ { a } , states : OPEN , orderBy : { field : UPDATED _AT , direction : DESC } ) {
@@ -63,32 +63,32 @@ module.exports=(()=>{var _Mathhypot=Math.hypot,_Mathacos=Math.acos,_Mathtan=Math
}
}
}
` ),i=[];for(const e of o.nodes){const t=(Date.now()-new Date(e.updatedAt).getTime())/86400000;let r=1>t?"less than 1 day ago":30>t? ` $ { _Mathfloor ( t ) } day$ { 2 <= t ? "s" : "" } ago ` :new Date(e.updatedAt).toDateString().substring(4);const{enabled:n,todoCount:a,inProgressCount:o,doneCount:s}=e.progress;i.push({name:e.name,updated:r,progress:{enabled:n,todo:a,doing:o,done:s,total:a+o+s}})}return{list:i,totalCount:o.totalCount}}catch(e){throw console.debug(e),{error:{message: ` An error occured ` }}}},topics:async function({login:e,imports:t,q:r},{enabled:n=!1}={}){try{if(!n||!r.topics)return null;let{"topics.sort":a="stars","topics.limit":o=15}=r;const i="random"===a;a={starred:"created",activity:"updated",stars:"stars",random:"created"}[a]??"starred",o=_Mathmax(1,_Mathmin(20,+o));let s=[];console.debug( ` metrics / compute / $ { e } / plugins > topics > starting browser ` );const l=await t.puppeteer.launch({headless:!0,executablePath:process.env.PUPPETEER_BROWSER_PATH,args:["--no-sandbox","--disable-extensions","--disable-setuid-sandbox","--disable-dev-shm-usage"]});console.debug( ` metrics / compute / $ { e } / plugins > topics > loaded $ { await l . version ( ) } ` );const d=await l.newPage();for(let t=1;100>=t;t++){console.debug( ` metrics / compute / $ { e } / plugins > topics > loading page $ { t } ` ),await d.goto( ` https : //github.com/stars/${e}/topics?direction=desc&page=${t}&sort=${a}`);const r=d.mainFrame();await Promise.race([r.waitForSelector("ul.repo-list"),r.waitForSelector(".blankslate")]);const n=await r.evaluate(()=>[...document.querySelectorAll("ul.repo-list li")].map(e=>({name:e.querySelector(".f3").innerText,description:e.querySelector(".f5").innerText,icon:e.querySelector("img")?.src??null})));if(!n.length)break;s.push(...n)}if(console.debug(`metrics/compute/${e}/plugins > music > closing browser`),await l.close(),i&&(s=t.shuffle(s)),0<o){console.debug(`metrics/compute/${e}/plugins > topics > keeping only ${o} topics`);const t=s.slice(o);s=s.slice(0,o),s.push({name:`And ${t.length} more...`,description:t.map(({name:e})=>e).join(", "),icon:null})}for(const r of s)r.icon&&(console.debug(`metrics/compute/${e}/plugins > topics > processing ${r.name}`),r.icon=await t.imgb64(r.icon)),r.description=t.htmlescape(r.description);return{list:s}}catch(e){throw console.debug(e),{error:{message:`An error occured`}}}},traffic:async function({login:e,imports:t,data:r,rest:n,q:a},{enabled:o=!1}={}){try{if(!o||!a.traffic)return null;const i=r.user.repositories.nodes.map(({name:e})=>e)??[],s={count:0,uniques:0},l=await Promise.all(i.map(async t=>await n.repos.getViews({owner:e,repo:t})));return l.filter(({data:e})=>e).map(({data:{count:e,uniques:t}})=>(s.count+=e,s.uniques+=t)),s.count=t.format(s.count),s.uniques=t.format(s.uniques),{views:s}}catch(e){if(403===e.status)throw{error:{message:`Insufficient token rights`}};throw console.debug(e),{error:{message:`An error occured`}}}},tweets:async function({login:e,imports:t,data:r,q:n},{enabled:a=!1,token:o=null}={}){try{if(!a||!n.tweets)return null;let{"tweets.limit":i=2}=n;i=_Mathmax(1,_Mathmin(10,+i));const s=r.user.twitterUsername;console.debug(`metrics/compute/${e}/plugins > tweets > loading twitter profile (@${s})`);const{data:{data:l=null}}=await t.axios.get(`https://api.twitter.com/2/users/by/username/${s}?user.fields=profile_image_url,verified`,{headers:{Authorization:`Bearer ${o}`}});console.debug(`metrics/compute/${e}/plugins > tweets > loading tweets`);const{data:{data:d=[]}}=await t.axios.get(`https://api.twitter.com/2/tweets/search/recent?query=from:${s}&tweet.fields=created_at&expansions=entities.mentions.username`,{headers:{Authorization:`Bearer ${o}`}});return l?.profile_image_url&&(console.debug(`metrics/compute/${e}/plugins > tweets > loading profile image`),l.profile_image=await t.imgb64(l.profile_image_url)),0<i&&(console.debug(`metrics/compute/${e}/plugins > tweets > keeping only ${i} tweets`),d.splice(i)),await Promise.all(d.map(async r=>{r.mentions=r.entities?.mentions.map(({username:e})=>e)??[],console.debug(`metrics/compute/${e}/plugins > tweets > formatting tweet ${r.id}`),r.text=t.htmlescape(t.htmlescape(r.text,{"<":!0,">":!0}).replace(new RegExp(`@(${r.mentions.join("|")})`,"gi"),` <span class="mention">@$1</span> `).replace(/(?<!&)[#|# ]([a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c-\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u
Line truncated
` );console.debug( ` metrics / compute / $ { e } / plugins > posts > processing $ { o . nodes . length } projects ` );const i=[];for(const e of o.nodes){const t=(Date.now()-new Date(e.updatedAt).getTime())/86400000;let r=1>t?"less than 1 day ago":30>t? ` $ { _Mathfloor ( t ) } day$ { 2 <= t ? "s" : "" } ago ` :new Date(e.updatedAt).toDateString().substring(4);const{enabled:n,todoCount:a,inProgressCount:o,doneCount:s}=e.progress;i.push({name:e.name,updated:r,progress:{enabled:n,todo:a,doing:o,done:s,total:a+o+s}})}return{list:i,totalCount:o.totalCount}}catch(e){let t="An error occured";throw e.errors?.map(({type:e})=>e)?.includes("INSUFFICIENT_SCOPES")&&(t="Insufficient token rights"),{error:{message:t,instance:e}}}},topics:async function({login:e,imports:t,q:r},{enabled:n=!1}={}){try{if(!n||!r.topics)return null;let{"topics.sort":a="stars","topics.limit":o=15}=r;const i="random"===a;a={starred:"created",activity:"updated",stars:"stars",random:"created"}[a]??"starred",o=_Mathmax(1,_Mathmin(20,+o)),console.debug( ` metrics / compute / $ { e } / plugins > topics > searching starred topics ` );let s=[];console.debug( ` metrics / compute / $ { e } / plugins > topics > starting browser ` );const l=await t.puppeteer.launch({headless:!0,executablePath:process.env.PUPPETEER_BROWSER_PATH,args:["--no-sandbox","--disable-extensions","--disable-setuid-sandbox","--disable-dev-shm-usage"]});console.debug( ` metrics / compute / $ { e } / plugins > topics > started $ { await l . version ( ) } ` );const d=await l.newPage();for(let t=1;100>=t;t++){console.debug( ` metrics / compute / $ { e } / plugins > topics > loading page $ { t } ` ),await d.goto( ` https : //github.com/stars/${e}/topics?direction=desc&page=${t}&sort=${a}`);const r=d.mainFrame();await Promise.race([r.waitForSelector("ul.repo-list"),r.waitForSelector(".blankslate")]);const n=await r.evaluate(()=>[...document.querySelectorAll("ul.repo-list li")].map(e=>({name:e.querySelector(".f3").innerText,description:e.querySelector(".f5").innerText,icon:e.querySelector("img")?.src??null})));if(console.debug(`metrics/compute/${e}/plugins > topics > extracted ${n.length} starred topics`),!n.length){console.debug(`metrics/compute/${e}/plugins > topics > no more page to load`);break}s.push(...n)}if(console.debug(`metrics/compute/${e}/plugins > music > closing browser`),await l.close(),i&&(console.debug(`metrics/compute/${e}/plugins > topics > shuffling topics`),s=t.shuffle(s)),0<o){console.debug(`metrics/compute/${e}/plugins > topics > keeping only ${o} topics`);const t=s.slice(o);s=s.slice(0,o),s.push({name:`And ${t.length} more...`,description:t.map(({name:e})=>e).join(", "),icon:null})}console.debug(`metrics/compute/${e}/plugins > topics > loading artworks`);for(const r of s)r.icon&&(console.debug(`metrics/compute/${e}/plugins > topics > processing ${r.name}`),r.icon=await t.imgb64(r.icon)),r.description=t.htmlescape(r.description);return{list:s}}catch(e){throw{error:{message:"An error occured",instance:e}}}},traffic:async function({login:e,imports:t,data:r,rest:n,q:a},{enabled:o=!1}={}){try{if(!o||!a.traffic)return null;const i=r.user.repositories.nodes.map(({name:e})=>e)??[];console.debug(`metrics/compute/${e}/plugins > traffic > querying api`);const s={count:0,uniques:0},l=await Promise.all(i.map(async t=>await n.repos.getViews({owner:e,repo:t})));return console.debug(`metrics/compute/${e}/plugins > traffic > computing stats`),l.filter(({data:e})=>e).map(({data:{count:e,uniques:t}})=>(s.count+=e,s.uniques+=t)),s.count=t.format(s.count),s.uniques=t.format(s.uniques),{views:s}}catch(e){let t="An error occured";throw 403===e.status&&(t="Insufficient token rights"),{error:{message:t,instance:e}}}},tweets:async function({login:e,imports:t,data:r,q:n},{enabled:a=!1,token:o=null}={}){try{if(!a||!n.tweets)return null;let{"tweets.limit":i=2}=n;i=_Mathmax(1,_Mathmin(10,+i));const s=r.user.twitterUsername;console.debug(`metrics/compute/${e}/plugins > tweets > loading twitter profile (@${s})`);const{data:{data:l=null}}=await t.axios.get(`https://api.twitter.com/2/users/by/username/${s}?user.fields=profile_image_url,verified`,{headers:{Authorization:`Bearer ${o}`}});console.debug(`metrics/compute/${e}/plugins > tweets > querying api`);const{data:{data:d=[]}}=await t.axios.get(`https://api.twitter.com/2/tweets/search/recent?query=from:${s}&tweet.fields=created_at&expansions=entities.mentions.username`,{headers:{Authorization:`Bearer ${o}`}});return l?.profile_image_url&&(console.debug(`metrics/compute/${e}/plugins > tweets > loading profile image`),l.profile_image=await t.imgb64(l.profile_image_url)),0<i&&(console.debug(`metrics/compute/${e}/plugins > tweets > keeping only ${i} tweets`),d.splice(i)),await Promise.all(d.map(async r=>{r.mentions=r.entities?.mentions.map(({username:e})=>e)??[],console.debug(`metrics/compute/${e}/plugins > tweets > formatting tweet ${r.id}`),r.text=t.htmlescape(t.htmlescape(r.text,{"<":!0,">":!0}).replace(new RegExp(`@(${r.mentions.join("|")})`,"gi"),` <span class="mention">@$1</span> `).replace(/(?<!&)[#|# ]([a-z0-9_\u00c0-\u00d6\u00d8-\u00f6
Line truncated
query Sha {
repository ( owner : "${t.context.repo.owner}" , name : "${t.context.repo.repo}" ) {
object ( expression : "${r}:${m}" ) { ... on Blob { oid } }
}
}
` );o=e}catch(e){console.debug(e)}console.log( ` Previous render sha | $ { o || "none" } ` ),await a.repos.createOrUpdateFileContents({...t.context.repo,path:m,message: ` Update $ { m } - [ Skip GitHub Action ] ` ,content:Buffer.from(w).toString("base64"),...(o?{sha:o}:{})}),console.log( ` Commit to repo | ok ` )}console.log( ` Success ! ` ),process.exit(0)}catch(t){if(console.error(t),!i(e.getInput("debug")))for(const e of["_".repeat(64),"An error occured, logging debug message :",...s])console.log(e);e.setFailed(t.message),process.exit(1)}})().catch(()=>process.exit(1))},12541:function(e,t,r){"use strict";function n(e,t,r){const n=new p(e,t,r);process.stdout.write(n.toString()+s.EOL)}function a(e){return l.toCommandValue(e).replace(/%/g,"%25").replace(/ \r /g,"%0D").replace(/ \n /g,"%0A")}function o(e){return l.toCommandValue(e).replace(/%/g,"%25").replace(/ \r /g,"%0D").replace(/ \n /g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(t,"__esModule",{value:!0});const s=i(r(12087)),l=r(74332);t.issueCommand=n,t.issue=function(e,t=""){n(e,{},t)};const d="::";class p{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r}toString(){let e=d+this.command;if(this.properties&&0<Object.keys(this.properties).length){e+=" ";let t=!0;for(const r in this.properties)if(this.properties.hasOwnProperty(r)){const n=this.properties[r];n&&(t?t=!1:e+=",",e+= ` $ { r } = $ { o ( n ) } ` )}}return e+= ` $ { d } $ { a ( this . message ) } ` ,e}}},32882:function(e,t,r){"use strict";function n(e){process.exitCode=g.Failure,a(e)}function a(e){d.issue("error",e instanceof Error?e.toString():e)}function o(e){d.issue("group",e)}function i(){d.issue("endgroup")}var s=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function i(e){try{l(n.next(e))}catch(t){o(t)}}function s(e){try{l(n["throw"](e))}catch(t){o(t)}}function l(e){e.done?r(e.value):a(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())})},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(12541),p=r(29582),c=r(74332),u=l(r(12087)),m=l(r(85622));var g;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(g=t.ExitCode||(t.ExitCode={})),t.exportVariable=function(e,t){const r=c.toCommandValue(t);process.env[e]=r;const n=process.env.GITHUB_ENV||"";if(n){const t= ` $ { e } << $ { "_GitHubActionsFileCommandDelimeter_" } $ { u . EOL } $ { r } $ { u . EOL } $ { "_GitHubActionsFileCommandDelimeter_" } ` ;p.issueCommand("ENV",t)}else d.issueCommand("set-env",{name:e},r)},t.setSecret=function(e){d.issueCommand("add-mask",{},e)},t.addPath=function(e){const t=process.env.GITHUB_PATH||"";t?p.issueCommand("PATH",e):d.issueCommand("add-path",{},e),process.env.PATH= ` $ { e } $ { m . delimiter } $ { process . env . PATH } ` },t.getInput=function(e,t){const r=process.env[ ` INPUT _$ { e . replace ( / /g , "_" ) . toUpperCase ( ) } ` ]||"";if(t&&t.required&&!r)throw new Error( ` Input required and not supplied : $ { e } ` );return r.trim()},t.setOutput=function(e,t){d.issueCommand("set-output",{name:e},t)},t.setCommandEcho=function(e){d.issue("echo",e?"on":"off")},t.setFailed=n,t.isDebug=function(){return"1"===process.env.RUNNER_DEBUG},t.debug=function(e){d.issueCommand("debug",{},e)},t.error=a,t.warning=function(e){d.issue("warning",e instanceof Error?e.toString():e)},t.info=function(e){process.stdout.write(e+u.EOL)},t.startGroup=o,t.endGroup=i,t.group=function(e,t){return s(this,void 0,void 0,function*(){o(e);let r;try{r=yield t()}finally{i()}return r})},t.saveState=function(e,t){d.issueCommand("save-state",{name:e},t)},t.getState=function(e){return process.env[ ` STATE _$ { e } ` ]||""}},29582:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=n(r(35747)),o=n(r(12087)),i=r(74332);t.issueCommand=function(e,t){const r=process.env[ ` GITHUB _$ { e } ` ];if(!r)throw new Error( ` Unable to find environment variable for file command $ { e } ` );if(!a.existsSync(r))throw new Error( ` Missing file at path : $ { r } ` );a.appendFileSync(r, ` $ { i . toCommandValue ( t ) } $ { o . EOL } ` ,{encoding:"utf8"})}},74332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toCommandValue=function(e){return null===e||void 0===e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e)}},84873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;const n=r(35747),a=r(12087);class o{constructor(){if(this.payload={},process.env.GITHUB_EVENT_PATH)if(n.existsSync(process.env.GITHUB_EVENT_PATH))this.p
Line truncated
` );o=e}catch(e){console.debug(e)}console.log( ` Previous render sha | $ { o ? ? "none" } ` ),await a.repos.createOrUpdateFileContents({...t.context.repo,path:m,message: ` Update $ { m } - [ Skip GitHub Action ] ` ,content:Buffer.from(T).toString("base64"),...(o?{sha:o}:{})}),console.log( ` Commit to repo | ok ` )}console.log( ` Success ! ` ),process.exit(0)}catch(t){if(console.error(t),!i(e.getInput("debug")))for(const e of["_".repeat(64),"An error occured, logging debug message :",...s])console.log(e);e.setFailed(t.message),process.exit(1)}})().catch(()=>process.exit(1))},12541:function(e,t,r){"use strict";function n(e,t,r){const n=new p(e,t,r);process.stdout.write(n.toString()+s.EOL)}function a(e){return l.toCommandValue(e).replace(/%/g,"%25").replace(/ \r /g,"%0D").replace(/ \n /g,"%0A")}function o(e){return l.toCommandValue(e).replace(/%/g,"%25").replace(/ \r /g,"%0D").replace(/ \n /g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(t,"__esModule",{value:!0});const s=i(r(12087)),l=r(74332);t.issueCommand=n,t.issue=function(e,t=""){n(e,{},t)};const d="::";class p{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r}toString(){let e=d+this.command;if(this.properties&&0<Object.keys(this.properties).length){e+=" ";let t=!0;for(const r in this.properties)if(this.properties.hasOwnProperty(r)){const n=this.properties[r];n&&(t?t=!1:e+=",",e+= ` $ { r } = $ { o ( n ) } ` )}}return e+= ` $ { d } $ { a ( this . message ) } ` ,e}}},32882:function(e,t,r){"use strict";function n(e){process.exitCode=g.Failure,a(e)}function a(e){d.issue("error",e instanceof Error?e.toString():e)}function o(e){d.issue("group",e)}function i(){d.issue("endgroup")}var s=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function i(e){try{l(n.next(e))}catch(t){o(t)}}function s(e){try{l(n["throw"](e))}catch(t){o(t)}}function l(e){e.done?r(e.value):a(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())})},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(t,"__esModule",{value:!0});const d=r(12541),p=r(29582),c=r(74332),u=l(r(12087)),m=l(r(85622));var g;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(g=t.ExitCode||(t.ExitCode={})),t.exportVariable=function(e,t){const r=c.toCommandValue(t);process.env[e]=r;const n=process.env.GITHUB_ENV||"";if(n){const t= ` $ { e } << $ { "_GitHubActionsFileCommandDelimeter_" } $ { u . EOL } $ { r } $ { u . EOL } $ { "_GitHubActionsFileCommandDelimeter_" } ` ;p.issueCommand("ENV",t)}else d.issueCommand("set-env",{name:e},r)},t.setSecret=function(e){d.issueCommand("add-mask",{},e)},t.addPath=function(e){const t=process.env.GITHUB_PATH||"";t?p.issueCommand("PATH",e):d.issueCommand("add-path",{},e),process.env.PATH= ` $ { e } $ { m . delimiter } $ { process . env . PATH } ` },t.getInput=function(e,t){const r=process.env[ ` INPUT _$ { e . replace ( / /g , "_" ) . toUpperCase ( ) } ` ]||"";if(t&&t.required&&!r)throw new Error( ` Input required and not supplied : $ { e } ` );return r.trim()},t.setOutput=function(e,t){d.issueCommand("set-output",{name:e},t)},t.setCommandEcho=function(e){d.issue("echo",e?"on":"off")},t.setFailed=n,t.isDebug=function(){return"1"===process.env.RUNNER_DEBUG},t.debug=function(e){d.issueCommand("debug",{},e)},t.error=a,t.warning=function(e){d.issue("warning",e instanceof Error?e.toString():e)},t.info=function(e){process.stdout.write(e+u.EOL)},t.startGroup=o,t.endGroup=i,t.group=function(e,t){return s(this,void 0,void 0,function*(){o(e);let r;try{r=yield t()}finally{i()}return r})},t.saveState=function(e,t){d.issueCommand("save-state",{name:e},t)},t.getState=function(e){return process.env[ ` STATE _$ { e } ` ]||""}},29582:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(t,"__esModule",{value:!0});const a=n(r(35747)),o=n(r(12087)),i=r(74332);t.issueCommand=function(e,t){const r=process.env[ ` GITHUB _$ { e } ` ];if(!r)throw new Error( ` Unable to find environment variable for file command $ { e } ` );if(!a.existsSync(r))throw new Error( ` Missing file at path : $ { r } ` );a.appendFileSync(r, ` $ { i . toCommandValue ( t ) } $ { o . EOL } ` ,{encoding:"utf8"})}},74332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toCommandValue=function(e){return null===e||void 0===e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e)}},84873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;const n=r(35747),a=r(12087);class o{constructor(){if(this.payload={},process.env.GITHUB_EVENT_PATH)if(n.existsSync(process.env.GITHUB_EVENT_PATH))this.p
Line truncated
* @ file Embedded JavaScript templating engine . { @ link http : //ejs.co}
* @ author Matthew Eernisse < mde @ fleegix . org >
* @ author Tiancheng "Timothy" Gu < timothygu99 @ gmail . com >
* @ project EJS
* @ license { @ link http : //www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
* /function n(e,r){var n;if(r.some(function(r){return n=t.resolveInclude(e,r,!0),g.existsSync(n)}))return n}function a(e,r){var a=r.views,o=/ ^ [ A - Za - z ] + : \ \ | ^ \ //.exec(e),i,s;if(o&&o.length)e=e.replace(/^\/*/,""),i=Array.isArray(r.root)?n(e,r.root):t.resolveInclude(e,r.root||"/",!0);else if(r.filename&&(s=t.resolveInclude(e,r.filename),g.existsSync(s)&&(i=s)),!i&&Array.isArray(a)&&(i=n(e,a)),!i&&"function"!=typeof r.includer)throw new Error("Could not find the include file \""+r.escapeFunction(e)+"\"");return i}function i(e,r){var n=e.filename,a=1<arguments.length,o;if(e.cache){if(!n)throw new Error("cache option requires a filename");if(o=t.cache.get(n),o)return o;a||(r=l(n).toString().replace(x,""))}else if(!a){if(!n)throw new Error("Internal EJS error: no file name or template provided");r=l(n).toString().replace(x,"")}return o=t.compile(r,e),e.cache&&t.cache.set(n,o),o}function s(e,r,n){var a;if(!n){if("function"==typeof t.promiseImpl)return new t.promiseImpl(function(t,n){try{a=i(e)(r),t(a)}catch(e){n(e)}});throw new Error("Please provide a callback function")}else{try{a=i(e)(r)}catch(e){return n(e)}n(null,a)}}function l(e){return t.fileLoader(e)}function p(e,t){var r=h.shallowCopy({},t);if(r.filename=a(e,r),"function"==typeof t.includer){var n=t.includer(e,r.filename);if(n&&(n.filename&&(r.filename=n.filename),n.template))return i(r,n.template)}return i(r)}function c(e,t,r,n,a){var o=t.split("\n"),s=_Mathmax(n-3,0),l=_Mathmin(o.length,n+3),d=a(r),p=o.slice(s,l).map(function(e,t){var r=t+s+1;return(r==n?" >> ":" ")+r+"| "+e}).join("\n");throw e.path=d,e.message=(d||"ejs")+":"+n+"\n"+p+"\n\n"+e.message,e}function u(e){return e.replace(/;(\s*$)/,"$1")}function m(e,r){r=r||{};var n={};this.templateText=e,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",n.client=r.client||!1,n.escapeFunction=r.escape||r.escapeFunction||h.escapeXML,n.compileDebug=!1!==r.compileDebug,n.debug=!!r.debug,n.filename=r.filename,n.openDelimiter=r.openDelimiter||t.openDelimiter||"<",n.closeDelimiter=r.closeDelimiter||t.closeDelimiter||">",n.delimiter=r.delimiter||t.delimiter||"%",n.strict=r.strict||!1,n.context=r.context,n.cache=r.cache||!1,n.rmWhitespace=r.rmWhitespace,n.root=r.root,n.includer=r.includer,n.outputFunctionName=r.outputFunctionName,n.localsName=r.localsName||t.localsName||"locals",n.views=r.views,n.async=r.async,n.destructuredLocals=r.destructuredLocals,n.legacyInclude="undefined"==typeof r.legacyInclude||!!r.legacyInclude,n._with=!n.strict&&("undefined"==typeof r._with||r._with),this.opts=n,this.regex=this.createRegex()}var g=r(35747),o=r(85622),h=r(74998),f=!1,y=r(52021).i8,b=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],S=b.concat("cache"),x=/^\uFEFF/;t.cache=h.cache,t.fileLoader=g.readFileSync,t.localsName="locals",t.promiseImpl=new Function("return this;")().Promise,t.resolveInclude=function(e,t,r){var n=o.dirname,a=o.extname,i=o.resolve,s=i(r?t:n(t),e),l=a(e);return l||(s+=".ejs"),s},t.compile=function(e,t){var r;return t&&t.scope&&(!f&&(console.warn("`scope` option is deprecated and will be removed in EJS 3"),f=!0),!t.context&&(t.context=t.scope),delete t.scope),r=new m(e,t),r.compile()},t.render=function(e,t,r){var n=t||{},a=r||{};return 2==arguments.length&&h.shallowCopyFromList(a,n,b),i(a,e)(n)},t.renderFile=function(){var e=Array.prototype.slice.call(arguments),t=e.shift(),r={filename:t},n,a,o;return"function"==typeof arguments[arguments.length-1]&&(n=e.pop()),e.length?(a=e.shift(),e.length?h.shallowCopy(r,e.pop()):(a.settings&&(a.settings.views&&(r.views=a.settings.views),a.settings["view cache"]&&(r.cache=!0),o=a.settings["view options"],o&&h.shallowCopy(r,o)),h.shallowCopyFromList(r,a,S)),r.filename=t):a={},s(r,a,n)},t.Template=m,t.clearCache=function(){t.cache.reset()},m.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},m.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=h.escapeRegExpChars(this.opts.delimiter),r=h.escapeRegExpChars(this.opts.openDelimiter),n=h.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(/</g,r).replace(/>/g,n),new RegExp(e)},compile:function(){var t=this.opts,r="",n="",a=t.escapeFunction,s,l,e;if(!this.source){if(this.generateSource(),r+=" var __output = \"\";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n",t.outputFunctionName&&(r+=" var "+t.outputFunctionName+" = __append;\n"),t.destructuredLocals&&t.destructuredLocals.length){for(var d=" var __locals = ("+t.localsName+" || {}),\n",u=0,m;u<t.destructuredLocals.length;u++)m=t.destructuredLocals[u],0<u&&(d+=",\n "),d+=m+" = __locals."+m;r+=d+";\n"}!1!==t._with&&(r+=" with ("+t.localsName+" || {}) {\n",n+=" }\n"),n+=" return __output;\n",this.source=r+this.source+n}s=t.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+(t.filename?JSON.stringify(t.filename):"un
Line truncated
* /function n(e,r){var n;if(r.some(function(r){return n=t.resolveInclude(e,r,!0),g.existsSync(n)}))return n}function a(e,r){var a=r.views,o=/ ^ [ A - Za - z ] + : \ \ | ^ \ //.exec(e),i,s;if(o&&o.length)e=e.replace(/^\/*/,""),i=Array.isArray(r.root)?n(e,r.root):t.resolveInclude(e,r.root||"/",!0);else if(r.filename&&(s=t.resolveInclude(e,r.filename),g.existsSync(s)&&(i=s)),!i&&Array.isArray(a)&&(i=n(e,a)),!i&&"function"!=typeof r.includer)throw new Error("Could not find the include file \""+r.escapeFunction(e)+"\"");return i}function i(e,r){var n=e.filename,a=1<arguments.length,o;if(e.cache){if(!n)throw new Error("cache option requires a filename");if(o=t.cache.get(n),o)return o;a||(r=l(n).toString().replace(x,""))}else if(!a){if(!n)throw new Error("Internal EJS error: no file name or template provided");r=l(n).toString().replace(x,"")}return o=t.compile(r,e),e.cache&&t.cache.set(n,o),o}function s(e,r,n){var a;if(!n){if("function"==typeof t.promiseImpl)return new t.promiseImpl(function(t,n){try{a=i(e)(r),t(a)}catch(e){n(e)}});throw new Error("Please provide a callback function")}else{try{a=i(e)(r)}catch(e){return n(e)}n(null,a)}}function l(e){return t.fileLoader(e)}function p(e,t){var r=h.shallowCopy({},t);if(r.filename=a(e,r),"function"==typeof t.includer){var n=t.includer(e,r.filename);if(n&&(n.filename&&(r.filename=n.filename),n.template))return i(r,n.template)}return i(r)}function c(e,t,r,n,a){var o=t.split("\n"),s=_Mathmax(n-3,0),l=_Mathmin(o.length,n+3),d=a(r),p=o.slice(s,l).map(function(e,t){var r=t+s+1;return(r==n?" >> ":" ")+r+"| "+e}).join("\n");throw e.path=d,e.message=(d||"ejs")+":"+n+"\n"+p+"\n\n"+e.message,e}function u(e){return e.replace(/;(\s*$)/,"$1")}function m(e,r){r=r||{};var n={};this.templateText=e,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",n.client=r.client||!1,n.escapeFunction=r.escape||r.escapeFunction||h.escapeXML,n.compileDebug=!1!==r.compileDebug,n.debug=!!r.debug,n.filename=r.filename,n.openDelimiter=r.openDelimiter||t.openDelimiter||"<",n.closeDelimiter=r.closeDelimiter||t.closeDelimiter||">",n.delimiter=r.delimiter||t.delimiter||"%",n.strict=r.strict||!1,n.context=r.context,n.cache=r.cache||!1,n.rmWhitespace=r.rmWhitespace,n.root=r.root,n.includer=r.includer,n.outputFunctionName=r.outputFunctionName,n.localsName=r.localsName||t.localsName||"locals",n.views=r.views,n.async=r.async,n.destructuredLocals=r.destructuredLocals,n.legacyInclude="undefined"==typeof r.legacyInclude||!!r.legacyInclude,n._with=!n.strict&&("undefined"==typeof r._with||r._with),this.opts=n,this.regex=this.createRegex()}var g=r(35747),o=r(85622),h=r(74998),f=!1,y=r(52021).i8,b=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],S=b.concat("cache"),x=/^\uFEFF/;t.cache=h.cache,t.fileLoader=g.readFileSync,t.localsName="locals",t.promiseImpl=new Function("return this;")().Promise,t.resolveInclude=function(e,t,r){var n=o.dirname,a=o.extname,i=o.resolve,s=i(r?t:n(t),e),l=a(e);return l||(s+=".ejs"),s},t.compile=function(e,t){var r;return t&&t.scope&&(!f&&(console.warn("`scope` option is deprecated and will be removed in EJS 3"),f=!0),!t.context&&(t.context=t.scope),delete t.scope),r=new m(e,t),r.compile()},t.render=function(e,t,r){var n=t||{},a=r||{};return 2==arguments.length&&h.shallowCopyFromList(a,n,b),i(a,e)(n)},t.renderFile=function(){var e=Array.prototype.slice.call(arguments),t=e.shift(),r={filename:t},n,a,o;return"function"==typeof arguments[arguments.length-1]&&(n=e.pop()),e.length?(a=e.shift(),e.length?h.shallowCopy(r,e.pop()):(a.settings&&(a.settings.views&&(r.views=a.settings.views),a.settings["view cache"]&&(r.cache=!0),o=a.settings["view options"],o&&h.shallowCopy(r,o)),h.shallowCopyFromList(r,a,S)),r.filename=t):a={},s(r,a,n)},t.Template=m,t.clearCache=function(){t.cache.reset()},m.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},m.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=h.escapeRegExpChars(this.opts.delimiter),r=h.escapeRegExpChars(this.opts.openDelimiter),n=h.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(/</g,r).replace(/>/g,n),new RegExp(e)},compile:function(){var t=this.opts,r="",n="",a=t.escapeFunction,s,l,e;if(!this.source){if(this.generateSource(),r+=" var __output = \"\";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n",t.outputFunctionName&&(r+=" var "+t.outputFunctionName+" = __append;\n"),t.destructuredLocals&&t.destructuredLocals.length){for(var d=" var __locals = ("+t.localsName+" || {}),\n",u=0,m;u<t.destructuredLocals.length;u++)m=t.destructuredLocals[u],0<u&&(d+=",\n "),d+=m+" = __locals."+m;r+=d+";\n"}!1!==t._with&&(r+=" with ("+t.localsName+" || {}) {\n",n+=" }\n"),n+=" return __output;\n",this.source=r+this.source+n}s=t.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+(t.filename?JSON.stringify(t.filename):"un
Line truncated
* is - plain - object < https : //github.com/jonschlinkert/is-plain-object>
*
* Copyright ( c ) 2014 - 2017 , Jon Schlinkert .
* Released under the MIT License .
* / f u n c t i o n r ( e ) { r e t u r n " [ o b j e c t O b j e c t ] " = = = O b j e c t . p r o t o t y p e . t o S t r i n g . c a l l ( e ) } O b j e c t . d e f i n e P r o p e r t y ( t , " _ _ e s M o d u l e " , { v a l u e : ! 0 } ) , t . i s P l a i n O b j e c t = f u n c t i o n ( e ) { v a r t , n ; r e t u r n ! 1 ! = = r ( e ) & & ( ( t = e . c o n s t r u c t o r , v o i d 0 = = = t ) | | ( n = t . p r o t o t y p e , ! 1 ! = = r ( n ) & & ! 1 ! = = n . h a s O w n P r o p e r t y ( " i s P r o t o t y p e O f " ) ) ) } } , 3 1 8 9 4 : ( e , t , r ) = > { " u s e s t r i c t " ; v a r n = r ( 7 1 5 8 ) ; e . e x p o r t s = n } , 7 1 5 8 : ( e , t , r ) = > { " u s e s t r i c t " ; f u n c t i o n n ( e ) { r e t u r n f u n c t i o n ( ) { t h r o w n e w E r r o r ( " F u n c t i o n " + e + " i s d e p r e c a t e d a n d c a n n o t b e u s e d . " ) } } v a r a = r ( 3 4 3 4 ) , o = r ( 8 6 1 5 6 ) ; e . e x p o r t s . T y p e = r ( 7 8 0 9 9 ) , e . e x p o r t s . S c h e m a = r ( 5 8 1 2 6 ) , e . e x p o r t s . F A I L S A F E _ S C H E M A = r ( 2 1 7 1 2 ) , e . e x p o r t s . J S O N _ S C H E M A = r ( 7 5 6 9 8 ) , e . e x p o r t s . C O R E _ S C H E M A = r ( 1 1 2 7 7 ) , e . e x p o r t s . D E F A U L T _ S A F E _ S C H E M A = r ( 2 3 7 1 3 ) , e . e x p o r t s . D E F A U L T _ F U L L _ S C H E M A = r ( 1 7 0 2 8 ) , e . e x p o r t s . l o a d = a . l o a d , e . e x p o r t s . l o a d A l l = a . l o a d A l l , e . e x p o r t s . s a f e L o a d = a . s a f e L o a d , e . e x p o r t s . s a f e L o a d A l l = a . s a f e L o a d A l l , e . e x p o r t s . d u m p = o . d u m p , e . e x p o r t s . s a f e D u m p = o . s a f e D u m p , e . e x p o r t s . Y A M L E x c e p t i o n = r ( 4 1 0 3 0 ) , e . e x p o r t s . M I N I M A L _ S C H E M A = r ( 2 1 7 1 2 ) , e . e x p o r t s . S A F E _ S C H E M A = r ( 2 3 7 1 3 ) , e . e x p o r t s . D E F A U L T _ S C H E M A = r ( 1 7 0 2 8 ) , e . e x p o r t s . s c a n = n ( " s c a n " ) , e . e x p o r t s . p a r s e = n ( " p a r s e " ) , e . e x p o r t s . c o m p o s e = n ( " c o m p o s e " ) , e . e x p o r t s . a d d C o n s t r u c t o r = n ( " a d d C o n s t r u c t o r " ) } , 3 9 9 9 0 : e = > { " u s e s t r i c t " ; f u n c t i o n t ( e ) { r e t u r n " u n d e f i n e d " = = t y p e o f e | | n u l l = = = e } e . e x p o r t s . i s N o t h i n g = t , e . e x p o r t s . i s O b j e c t = f u n c t i o n ( e ) { r e t u r n " o b j e c t " = = t y p e o f e & & n u l l ! = = e } , e . e x p o r t s . t o A r r a y = f u n c t i o n ( e ) { r e t u r n A r r a y . i s A r r a y ( e ) ? e : t ( e ) ? [ ] : [ e ] } , e . e x p o r t s . r e p e a t = f u n c t i o n ( e , t ) { v a r r = " " , n ; f o r ( n = 0 ; n < t ; n + = 1 ) r + = e ; r e t u r n r } , e . e x p o r t s . i s N e g a t i v e Z e r o = f u n c t i o n ( e ) { r e t u r n 0 = = = e & & _ N u m b e r N E G A T I V E _ I N F I N I T Y = = = 1 / e } , e . e x p o r t s . e x t e n d = f u n c t i o n ( e , t ) { v a r r , n , a , o ; i f ( t ) f o r ( o = O b j e c t . k e y s ( t ) , r = 0 , n = o . l e n g t h ; r < n ; r + = 1 ) a = o [ r ] , e [ a ] = t [ a ] ; r e t u r n e } } , 8 6 1 5 6 : ( e , t , r ) = > { " u s e s t r i c t " ; f u n c t i o n n ( e , t ) { v a r r , n , a , o , i , s , l ; i f ( n u l l = = = t ) r e t u r n { } ; f o r ( r = { } , n = O b j e c t . k e y s ( t ) , ( a = 0 , o = n . l e n g t h ) ; a < o ; a + = 1 ) i = n [ a ] , s = t [ i ] + " " , " ! ! " = = = i . s l i c e ( 0 , 2 ) & & ( i = " t a g : y a m l . o r g , 2 0 0 2 : " + i . s l i c e ( 2 ) ) , l = e . c o m p i l e d T y p e M a p . f a l l b a c k [ i ] , l & & q . c a l l ( l . s t y l e A l i a s e s , s ) & & ( s = l . s t y l e A l i a s e s [ s ] ) , r [ i ] = s ; r e t u r n r } f u n c t i o n a ( e ) { v a r t , r , n ; i f ( t = e . t o S t r i n g ( 1 6 ) . t o U p p e r C a s e ( ) , 2 5 5 > = e ) r = " x " , n = 2 ; e l s e i f ( 6 5 5 3 5 > = e ) r = " u " , n = 4 ; e l s e i f ( 4 2 9 4 9 6 7 2 9 5 > = e ) r = " U " , n = 8 ; e l s e t h r o w n e w R ( " c o d e p o i n t w i t h i n a s t r i n g m a y n o t b e g r e a t e r t h a n 0 x F F F F F F F F " ) ; r e t u r n " \ \ " + r + z . r e p e a t ( " 0 " , n - t . l e n g t h ) + t } f u n c t i o n o ( e ) { t h i s . s c h e m a = e . s c h e m a | | M , t h i s . i n d e n t = _ M a t h m a x ( 1 , e . i n d e n t | | 2 ) , t h i s . n o A r r a y I n d e n t = e . n o A r r a y I n d e n t | | ! 1 , t h i s . s k i p I n v a l i d = e . s k i p I n v a l i d | | ! 1 , t h i s . f l o w L e v e l = z . i s N o t h i n g ( e . f l o w L e v e l ) ? - 1 : e . f l o w L e v e l , t h i s . s t y l e M a p = n ( t h i s . s c h e m a , e . s t y l e s | | n u l l ) , t h i s . s o r t K e y s = e . s o r t K e y s | | ! 1 , t h i s . l i n e W i d t h = e . l i n e W i d t h | | 8 0 , t h i s . n o R e f s = e . n o R e f s | | ! 1 , t h i s . n o C o m p a t M o d e = e . n o C o m p a t M o d e | | ! 1 , t h i s . c o n d e n s e F l o w = e . c o n d e n s e F l o w | | ! 1 , t h i s . i m p l i c i t T y p e s = t h i s . s c h e m a . c o m p i l e d I m p l i c i t , t h i s . e x p l i c i t T y p e s = t h i s . s c h e m a . c o m p i l e d E x p l i c i t , t h i s . t a g = n u l l , t h i s . r e s u l t = " " , t h i s . d u p l i c a t e s = [ ] , t h i s . u s e d D u p l i c a t e s = n u l l } f u n c t i o n i ( e , t ) { f o r ( v a r r = z . r e p e a t ( " " , t ) , n = 0 , a = - 1 , o = " " , i = e . l e n g t h , s ; n < i ; ) a = e . i n d e x O f ( " \ n " , n ) , - 1 = = = a ? ( s = e . s l i c e ( n ) , n = i ) : ( s = e . s l i c e ( n , a + 1 ) , n = a + 1 ) , s . l e n g t h & & " \ n " ! = = s & & ( o + = r ) , o + = s ; r e t u r n o } f u n c t i o n s ( e , t ) { r e t u r n " \ n " + z . r e p e a t ( " " , e . i n d e n t * t ) } f u n c t i o n l ( e , t ) { v a r r , n , a ; f o r ( r = 0 , n = e . i m p l i c i t T y p e s . l e n g t h ; r < n ; r + = 1 ) i f ( a = e . i m p l i c i t T y p e s [ r ] , a . r e s o l v e ( t ) ) r e t u r n ! 0 ; r e t u r n ! 1 } f u n c t i o n d ( e ) { r e t u r n 3 2 = = = e | | 9 = = = e } f u n c t i o n p ( e ) { r e t u r n 3 2 < = e & & 1 2 6 > = e | | 1 6 1 < = e & & 5 5 2 9 5 > = e & & 8 2 3 2 ! = = e & & 8 2 3 3 ! = = e | | 5 7 3 4 4 < = e & & 6 5 5 3 3 > = e & & 6 5 2 7 9 ! = = e | | 6 5 5 3 6 < = e & & 1 1 1 4 1 1 1 > = e } f u n c t i o n u ( e ) { r e t u r n p ( e ) & & ! d ( e ) & & 6 5 2 7 9 ! = = e & & 1 3 ! = = e & & 1 0 ! = = e } f u n c t i o n m ( e , t ) { r e t u r n p ( e ) & & 6 5 2 7 9 ! = = e & & 4 4 ! = = e & & 9 1 ! = = e & & 9 3 ! = = e & & 1 2 3 ! = = e & & 1 2 5 ! = = e & & 5 8 ! = = e & & ( 3 5 ! = = e | | t & & u ( t ) ) } f u n c t i o n g ( e ) { r e t u r n p ( e ) & & 6 5 2 7 9 ! = = e & & ! d ( e ) & & 4 5 ! = = e & & 6 3 ! = = e & & 5 8 ! = = e & & 4 4 ! = = e & & 9 1 ! = = e & & 9 3 ! = = e & & 1 2 3 ! = = e & & 1 2 5 ! = = e & & 3 5 ! = = e & & 3 8 ! = = e & & 4 2 ! = = e & & 3 3 ! = = e & & 1 2 4 ! = = e & & 6 1 ! = = e & & 6 2 ! = = e & & 3 9 ! = = e & & 3 4 ! = = e & & 3 7 ! = = e & & 6 4 ! = = e & & 9 6 ! = = e } f u n c t i o n h ( e ) { r e t u r n / ^ \ n * / . t e s t ( e ) } f u n c t i o n f ( e , t , r , n , a ) { v a r o = ! 1 , s = ! 1 , l = - 1 ! = = n , c = - 1 , u = g ( e . c h a r C o d e A t ( 0 ) ) & & ! d ( e . c h a r C o d e A t ( e . l e n g t h - 1 ) ) , f , y , b ; i f ( t ) f o r ( f = 0 ; f < e . l e n g t h ; f + + ) { i f ( y = e . c h a r C o d e A t ( f ) , ! p ( y ) ) r e t u r n 5 ; b = 0 < f ? e . c h a r C o d e A t ( f - 1 ) : n u l l , u = u & & m ( y , b ) } e l s e { f o r ( f = 0 ; f < e . l e n g t h ; f + + ) { i f ( y = e . c h a r C o d e A t ( f ) , 1 0 = = = y ) o = ! 0 , l & & ( s = s | | f - c - 1 > n & & " " ! = = e [ c + 1 ] , c = f ) ; e l s e i f ( ! p ( y ) ) r e t u r n 5 ; b = 0 < f ? e . c h a r C o d e A t ( f - 1 ) : n u l l , u = u & & m ( y , b ) } s = s | | l & & f - c - 1 > n & & " " ! = = e [ c + 1 ] } r e t u r n o | | s ? 9 < r & & h ( e ) ? 5 : s ? 4 : 3 : u & & ! a ( e ) ? 1 : 2 } f u n c t i o n y ( e , t , r , n ) { e . d u m p = f u n c t i o n ( ) { f u n c t i o n a ( t ) { r e t u r n l ( e , t ) } i f ( 0 = = = t . l e n g t h ) r e t u r n " ' ' " ; i f ( ! e . n o C o m p a t M o d e & & - 1 ! = = N . i n d e x O f ( t ) ) r e t u r n " ' " + t + " ' " ; v a r o = e . i n d e n t * _ M a t h m a x ( 1 , r ) , s = - 1 = = = e . l i n e W i d t h ? - 1 : _ M a t h m a x ( _ M a t h m i n ( e . l i n e W i d t h , 4 0 ) , e . l i n e W i d t h - o ) , d = n | | - 1 < e . f l o w L e v e l & & r > = e . f l o w L e v e l ; s w i t c h ( f ( t , d , e . i n d e n t , s , a ) ) { c a s e 1 : r e t u r n t ; c a s e 2 : r e t u r n " ' " + t . r e p l a c e ( / ' / g , " ' ' " ) + " ' " ; c a s e 3 : r e t u r n " | " + b ( t , e . i n d e n t ) + S ( i ( t , o ) ) ; c a s e 4 : r e t u r n " > " + b ( t , e . i n d e n t ) + S ( i ( x ( t , s ) , o ) ) ; c a s e 5 : r e t u r n " \ " " + k ( t , s ) + " \ " " ; d e f a u l t : t h r o w n e w R ( " i m p o s s i b l e e r r o r : i n v a l i d s c a l a r s t y l e " ) ; } } ( ) } f u n c t i o n b ( e , t ) { v a r r = h ( e ) ? t + " " : " " , n = " \ n " = = = e [ e . l e n g t h - 1 ] , a = n & & ( " \ n " = = = e [ e . l e n g t h - 2 ] | | " \ n " = = = e ) , o = a ? " + " : n ? " " : " - " ; r e t u r n r + o + " \ n " } f u n c t i o n S ( e ) { r e t u r n " \ n " = = = e [ e . l e n g t h - 1 ] ? e . s l i c e ( 0 , - 1 ) : e } f u n c t i o n x ( e , t ) { f o r ( v a r r = / ( \ n + ) ( [ ^ \ n ] * ) / g , n = f u n c t i o n ( ) { v a r n = e . i n d e x O f ( " \ n " ) ; r e t u r n Line truncated
* / f u n c t i o n r ( e ) { r e t u r n " [ o b j e c t O b j e c t ] " = = = O b j e c t . p r o t o t y p e . t o S t r i n g . c a l l ( e ) } O b j e c t . d e f i n e P r o p e r t y ( t , " _ _ e s M o d u l e " , { v a l u e : ! 0 } ) , t . i s P l a i n O b j e c t = f u n c t i o n ( e ) { v a r t , n ; r e t u r n ! 1 ! = = r ( e ) & & ( ( t = e . c o n s t r u c t o r , v o i d 0 = = = t ) | | ( n = t . p r o t o t y p e , ! 1 ! = = r ( n ) & & ! 1 ! = = n . h a s O w n P r o p e r t y ( " i s P r o t o t y p e O f " ) ) ) } } , 3 1 8 9 4 : ( e , t , r ) = > { " u s e s t r i c t " ; v a r n = r ( 7 1 5 8 ) ; e . e x p o r t s = n } , 7 1 5 8 : ( e , t , r ) = > { " u s e s t r i c t " ; f u n c t i o n n ( e ) { r e t u r n f u n c t i o n ( ) { t h r o w n e w E r r o r ( " F u n c t i o n " + e + " i s d e p r e c a t e d a n d c a n n o t b e u s e d . " ) } } v a r a = r ( 3 4 3 4 ) , o = r ( 8 6 1 5 6 ) ; e . e x p o r t s . T y p e = r ( 7 8 0 9 9 ) , e . e x p o r t s . S c h e m a = r ( 5 8 1 2 6 ) , e . e x p o r t s . F A I L S A F E _ S C H E M A = r ( 2 1 7 1 2 ) , e . e x p o r t s . J S O N _ S C H E M A = r ( 7 5 6 9 8 ) , e . e x p o r t s . C O R E _ S C H E M A = r ( 1 1 2 7 7 ) , e . e x p o r t s . D E F A U L T _ S A F E _ S C H E M A = r ( 2 3 7 1 3 ) , e . e x p o r t s . D E F A U L T _ F U L L _ S C H E M A = r ( 1 7 0 2 8 ) , e . e x p o r t s . l o a d = a . l o a d , e . e x p o r t s . l o a d A l l = a . l o a d A l l , e . e x p o r t s . s a f e L o a d = a . s a f e L o a d , e . e x p o r t s . s a f e L o a d A l l = a . s a f e L o a d A l l , e . e x p o r t s . d u m p = o . d u m p , e . e x p o r t s . s a f e D u m p = o . s a f e D u m p , e . e x p o r t s . Y A M L E x c e p t i o n = r ( 4 1 0 3 0 ) , e . e x p o r t s . M I N I M A L _ S C H E M A = r ( 2 1 7 1 2 ) , e . e x p o r t s . S A F E _ S C H E M A = r ( 2 3 7 1 3 ) , e . e x p o r t s . D E F A U L T _ S C H E M A = r ( 1 7 0 2 8 ) , e . e x p o r t s . s c a n = n ( " s c a n " ) , e . e x p o r t s . p a r s e = n ( " p a r s e " ) , e . e x p o r t s . c o m p o s e = n ( " c o m p o s e " ) , e . e x p o r t s . a d d C o n s t r u c t o r = n ( " a d d C o n s t r u c t o r " ) } , 3 9 9 9 0 : e = > { " u s e s t r i c t " ; f u n c t i o n t ( e ) { r e t u r n " u n d e f i n e d " = = t y p e o f e | | n u l l = = = e } e . e x p o r t s . i s N o t h i n g = t , e . e x p o r t s . i s O b j e c t = f u n c t i o n ( e ) { r e t u r n " o b j e c t " = = t y p e o f e & & n u l l ! = = e } , e . e x p o r t s . t o A r r a y = f u n c t i o n ( e ) { r e t u r n A r r a y . i s A r r a y ( e ) ? e : t ( e ) ? [ ] : [ e ] } , e . e x p o r t s . r e p e a t = f u n c t i o n ( e , t ) { v a r r = " " , n ; f o r ( n = 0 ; n < t ; n + = 1 ) r + = e ; r e t u r n r } , e . e x p o r t s . i s N e g a t i v e Z e r o = f u n c t i o n ( e ) { r e t u r n 0 = = = e & & _ N u m b e r N E G A T I V E _ I N F I N I T Y = = = 1 / e } , e . e x p o r t s . e x t e n d = f u n c t i o n ( e , t ) { v a r r , n , a , o ; i f ( t ) f o r ( o = O b j e c t . k e y s ( t ) , r = 0 , n = o . l e n g t h ; r < n ; r + = 1 ) a = o [ r ] , e [ a ] = t [ a ] ; r e t u r n e } } , 8 6 1 5 6 : ( e , t , r ) = > { " u s e s t r i c t " ; f u n c t i o n n ( e , t ) { v a r r , n , a , o , i , s , l ; i f ( n u l l = = = t ) r e t u r n { } ; f o r ( r = { } , n = O b j e c t . k e y s ( t ) , ( a = 0 , o = n . l e n g t h ) ; a < o ; a + = 1 ) i = n [ a ] , s = t [ i ] + " " , " ! ! " = = = i . s l i c e ( 0 , 2 ) & & ( i = " t a g : y a m l . o r g , 2 0 0 2 : " + i . s l i c e ( 2 ) ) , l = e . c o m p i l e d T y p e M a p . f a l l b a c k [ i ] , l & & q . c a l l ( l . s t y l e A l i a s e s , s ) & & ( s = l . s t y l e A l i a s e s [ s ] ) , r [ i ] = s ; r e t u r n r } f u n c t i o n a ( e ) { v a r t , r , n ; i f ( t = e . t o S t r i n g ( 1 6 ) . t o U p p e r C a s e ( ) , 2 5 5 > = e ) r = " x " , n = 2 ; e l s e i f ( 6 5 5 3 5 > = e ) r = " u " , n = 4 ; e l s e i f ( 4 2 9 4 9 6 7 2 9 5 > = e ) r = " U " , n = 8 ; e l s e t h r o w n e w R ( " c o d e p o i n t w i t h i n a s t r i n g m a y n o t b e g r e a t e r t h a n 0 x F F F F F F F F " ) ; r e t u r n " \ \ " + r + z . r e p e a t ( " 0 " , n - t . l e n g t h ) + t } f u n c t i o n o ( e ) { t h i s . s c h e m a = e . s c h e m a | | I , t h i s . i n d e n t = _ M a t h m a x ( 1 , e . i n d e n t | | 2 ) , t h i s . n o A r r a y I n d e n t = e . n o A r r a y I n d e n t | | ! 1 , t h i s . s k i p I n v a l i d = e . s k i p I n v a l i d | | ! 1 , t h i s . f l o w L e v e l = z . i s N o t h i n g ( e . f l o w L e v e l ) ? - 1 : e . f l o w L e v e l , t h i s . s t y l e M a p = n ( t h i s . s c h e m a , e . s t y l e s | | n u l l ) , t h i s . s o r t K e y s = e . s o r t K e y s | | ! 1 , t h i s . l i n e W i d t h = e . l i n e W i d t h | | 8 0 , t h i s . n o R e f s = e . n o R e f s | | ! 1 , t h i s . n o C o m p a t M o d e = e . n o C o m p a t M o d e | | ! 1 , t h i s . c o n d e n s e F l o w = e . c o n d e n s e F l o w | | ! 1 , t h i s . i m p l i c i t T y p e s = t h i s . s c h e m a . c o m p i l e d I m p l i c i t , t h i s . e x p l i c i t T y p e s = t h i s . s c h e m a . c o m p i l e d E x p l i c i t , t h i s . t a g = n u l l , t h i s . r e s u l t = " " , t h i s . d u p l i c a t e s = [ ] , t h i s . u s e d D u p l i c a t e s = n u l l } f u n c t i o n i ( e , t ) { f o r ( v a r r = z . r e p e a t ( " " , t ) , n = 0 , a = - 1 , o = " " , i = e . l e n g t h , s ; n < i ; ) a = e . i n d e x O f ( " \ n " , n ) , - 1 = = = a ? ( s = e . s l i c e ( n ) , n = i ) : ( s = e . s l i c e ( n , a + 1 ) , n = a + 1 ) , s . l e n g t h & & " \ n " ! = = s & & ( o + = r ) , o + = s ; r e t u r n o } f u n c t i o n s ( e , t ) { r e t u r n " \ n " + z . r e p e a t ( " " , e . i n d e n t * t ) } f u n c t i o n l ( e , t ) { v a r r , n , a ; f o r ( r = 0 , n = e . i m p l i c i t T y p e s . l e n g t h ; r < n ; r + = 1 ) i f ( a = e . i m p l i c i t T y p e s [ r ] , a . r e s o l v e ( t ) ) r e t u r n ! 0 ; r e t u r n ! 1 } f u n c t i o n d ( e ) { r e t u r n 3 2 = = = e | | 9 = = = e } f u n c t i o n p ( e ) { r e t u r n 3 2 < = e & & 1 2 6 > = e | | 1 6 1 < = e & & 5 5 2 9 5 > = e & & 8 2 3 2 ! = = e & & 8 2 3 3 ! = = e | | 5 7 3 4 4 < = e & & 6 5 5 3 3 > = e & & 6 5 2 7 9 ! = = e | | 6 5 5 3 6 < = e & & 1 1 1 4 1 1 1 > = e } f u n c t i o n u ( e ) { r e t u r n p ( e ) & & ! d ( e ) & & 6 5 2 7 9 ! = = e & & 1 3 ! = = e & & 1 0 ! = = e } f u n c t i o n m ( e , t ) { r e t u r n p ( e ) & & 6 5 2 7 9 ! = = e & & 4 4 ! = = e & & 9 1 ! = = e & & 9 3 ! = = e & & 1 2 3 ! = = e & & 1 2 5 ! = = e & & 5 8 ! = = e & & ( 3 5 ! = = e | | t & & u ( t ) ) } f u n c t i o n g ( e ) { r e t u r n p ( e ) & & 6 5 2 7 9 ! = = e & & ! d ( e ) & & 4 5 ! = = e & & 6 3 ! = = e & & 5 8 ! = = e & & 4 4 ! = = e & & 9 1 ! = = e & & 9 3 ! = = e & & 1 2 3 ! = = e & & 1 2 5 ! = = e & & 3 5 ! = = e & & 3 8 ! = = e & & 4 2 ! = = e & & 3 3 ! = = e & & 1 2 4 ! = = e & & 6 1 ! = = e & & 6 2 ! = = e & & 3 9 ! = = e & & 3 4 ! = = e & & 3 7 ! = = e & & 6 4 ! = = e & & 9 6 ! = = e } f u n c t i o n h ( e ) { r e t u r n / ^ \ n * / . t e s t ( e ) } f u n c t i o n f ( e , t , r , n , a ) { v a r o = ! 1 , s = ! 1 , l = - 1 ! = = n , c = - 1 , u = g ( e . c h a r C o d e A t ( 0 ) ) & & ! d ( e . c h a r C o d e A t ( e . l e n g t h - 1 ) ) , f , y , b ; i f ( t ) f o r ( f = 0 ; f < e . l e n g t h ; f + + ) { i f ( y = e . c h a r C o d e A t ( f ) , ! p ( y ) ) r e t u r n 5 ; b = 0 < f ? e . c h a r C o d e A t ( f - 1 ) : n u l l , u = u & & m ( y , b ) } e l s e { f o r ( f = 0 ; f < e . l e n g t h ; f + + ) { i f ( y = e . c h a r C o d e A t ( f ) , 1 0 = = = y ) o = ! 0 , l & & ( s = s | | f - c - 1 > n & & " " ! = = e [ c + 1 ] , c = f ) ; e l s e i f ( ! p ( y ) ) r e t u r n 5 ; b = 0 < f ? e . c h a r C o d e A t ( f - 1 ) : n u l l , u = u & & m ( y , b ) } s = s | | l & & f - c - 1 > n & & " " ! = = e [ c + 1 ] } r e t u r n o | | s ? 9 < r & & h ( e ) ? 5 : s ? 4 : 3 : u & & ! a ( e ) ? 1 : 2 } f u n c t i o n y ( e , t , r , n ) { e . d u m p = f u n c t i o n ( ) { f u n c t i o n a ( t ) { r e t u r n l ( e , t ) } i f ( 0 = = = t . l e n g t h ) r e t u r n " ' ' " ; i f ( ! e . n o C o m p a t M o d e & & - 1 ! = = N . i n d e x O f ( t ) ) r e t u r n " ' " + t + " ' " ; v a r o = e . i n d e n t * _ M a t h m a x ( 1 , r ) , s = - 1 = = = e . l i n e W i d t h ? - 1 : _ M a t h m a x ( _ M a t h m i n ( e . l i n e W i d t h , 4 0 ) , e . l i n e W i d t h - o ) , d = n | | - 1 < e . f l o w L e v e l & & r > = e . f l o w L e v e l ; s w i t c h ( f ( t , d , e . i n d e n t , s , a ) ) { c a s e 1 : r e t u r n t ; c a s e 2 : r e t u r n " ' " + t . r e p l a c e ( / ' / g , " ' ' " ) + " ' " ; c a s e 3 : r e t u r n " | " + b ( t , e . i n d e n t ) + S ( i ( t , o ) ) ; c a s e 4 : r e t u r n " > " + b ( t , e . i n d e n t ) + S ( i ( x ( t , s ) , o ) ) ; c a s e 5 : r e t u r n " \ " " + k ( t , s ) + " \ " " ; d e f a u l t : t h r o w n e w R ( " i m p o s s i b l e e r r o r : i n v a l i d s c a l a r s t y l e " ) ; } } ( ) } f u n c t i o n b ( e , t ) { v a r r = h ( e ) ? t + " " : " " , n = " \ n " = = = e [ e . l e n g t h - 1 ] , a = n & & ( " \ n " = = = e [ e . l e n g t h - 2 ] | | " \ n " = = = e ) , o = a ? " + " : n ? " " : " - " ; r e t u r n r + o + " \ n " } f u n c t i o n S ( e ) { r e t u r n " \ n " = = = e [ e . l e n g t h - 1 ] ? e . s l i c e ( 0 , - 1 ) : e } f u n c t i o n x ( e , t ) { f o r ( v a r r = / ( \ n + ) ( [ ^ \ n ] * ) / g , n = f u n c t i o n ( ) { v a r n = e . i n d e x O f ( " \ n " ) ; r e t u r n Line truncated
( ( ) => {
$ { r }
const checkWaitForOptions = $ { function ( e , t , r ) { if ( ! e ) return r ; if ( ! t && ! r ) return e ; const n = e . nodeType === Node . TEXT _NODE ? e . parentElement : e , a = window . getComputedStyle ( n ) , o = a && "hidden" !== a . visibility && function ( ) { const e = n . getBoundingClientRect ( ) ; return ! ! ( e . top || e . bottom || e . width || e . height ) } ( ) ; return t === o || r === ! o ? e : null } } ;
return ( $ { e } ) ( ... args )
} ) ( ) ` },readProtocolStream:async function(e,t,r){if(!g.isNode&&r)throw new Error("Cannot write to a path outside of Node.js environment.");const n=g.isNode?await s():null;let a=!1,o;r&&n&&(o=await n.promises.open(r,"w"));const i=[];for(;!a;){const s=await e.send("IO.read",{handle:t});a=s.eof;const l=Buffer.from(s.data,s.base64Encoded?"base64":void 0);i.push(l),r&&n&&(await n.promises.writeFile(o,l))}r&&(await o.close()),await e.send("IO.close",{handle:t});let l=null;try{l=Buffer.concat(i)}finally{return l}},waitWithTimeout:async function(e,t,r){let n;const a=new c.TimeoutError( ` waiting for $ { t } failed : timeout $ { r } ms exceeded ` ),o=new Promise((e,t)=>n=t);let i=null;r&&(i=setTimeout(()=>n(a),r));try{return await Promise.race([e,o])}finally{i&&clearTimeout(i)}},waitForEvent:async function(e,t,r,o,i){function s(){a([m]),clearTimeout(l)}let l,d,p;const u=new Promise((e,t)=>{d=e,p=t}),m=n(e,t,e=>{r(e)&&d(e)});o&&(l=setTimeout(()=>{p(new c.TimeoutError("Timeout exceeded while waiting for event"))},o));const g=await Promise.race([u,i]).then(e=>(s(),e),e=>{throw s(),e});if(g instanceof Error)throw g;return g},isString:o,isNumber:function(e){return"number"==typeof e||e instanceof Number},importFSModule:s,addEventListener:n,removeEventListeners:a,valueFromRemoteObject:function(e){if(m.assert(!e.objectId,"Cannot extract value when objectId is given"),e.unserializableValue){if("bigint"===e.type&&"undefined"!=typeof BigInt)return BigInt(e.unserializableValue.replace("n",""));switch(e.unserializableValue){case"-0":return-0;case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-Infinity;default:throw new Error("Unsupported unserializable value: "+e.unserializableValue);}}return e.value},getExceptionMessage:function(e){if(e.exception)return e.exception.description||e.exception.value;let t=e.text;if(e.stackTrace)for(const r of e.stackTrace.callFrames){const e=r.url+":"+r.lineNumber+":"+r.columnNumber,n=r.functionName||"<anonymous>";t+= ` \ n at $ { n } ( $ { e } ) ` }return t},releaseObject:async function(e,r){r.objectId&&(await e.send("Runtime.releaseObject",{objectId:r.objectId}).catch(e=>{t.debugError(e)}))}}},23222:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=void 0,t.isNode=!!("undefined"!=typeof process&&process.version)},80527:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initializePuppeteerNode=void 0;const a=r(9323),o=r(14148),i=n(r(10837));t.initializePuppeteerNode=e=>{const t=i.default.sync(__dirname);let r=o.PUPPETEER_REVISIONS.chromium;const n="puppeteer-core"===e,s=n?void 0:process.env.PUPPETEER_PRODUCT||process.env.npm_config_puppeteer_product||process.env.npm_package_config_puppeteer_product;return n||"firefox"!==s||(r=o.PUPPETEER_REVISIONS.firefox),new a.PuppeteerNode({projectRoot:t,preferredRevision:r,isPuppeteerCore:n,productName:s})}},90176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(80527),a=r(23222);if(!a.isNode)throw new Error("Trying to run Puppeteer-Node in a web environment.");t.default=n.initializePuppeteerNode("puppeteer")},77463:function(e,t,r){"use strict";function n(e,t,r){if("chrome"===e){if("linux"===t)return"chrome-linux";if("mac"===t)return"chrome-mac";if("win32"===t||"win64"===t)return 591479<parseInt(r,10)?"chrome-win":"chrome-win32"}else if("firefox"===e)return t}function a(e,t,r,a){const o=x.format(R[e][t],r,a,n(e,t,a));return o}function o(){b.stat("/usr/bin/chromium-browser",function(e,t){if(void 0===t)throw console.error( ` The chromium binary is not available for arm64 : ` ),console.error( ` If you are on Ubuntu , you can install with : ` ),console.error( ` \ n apt - get install chromium - browser \ n ` ),new Error})}function i(e){return new Promise(t=>{b.access(e,e=>t(!e))})}function s(e,t){const r=S.basename(t),n=r.split("-");if(2!==n.length)return null;const[a,o]=n;return R[e][a]?{product:e,platform:a,revision:o}:null}function l(e,t,r){function n(e){a+=e.length,r(a,o)}z( ` Downloading binary from $ { e } ` );let a=0,o=0,i,s;const l=new Promise((e,t)=>{i=e,s=t}),d=u(e,"GET",a=>{if(200!==a.statusCode){const t=new Error( ` Download failed : server returned code $ { a . statusCode } . URL : $ { e } ` );return a.resume(),void s(t)}const l=b.createWriteStream(t);l.on("finish",()=>i()),l.on("error",e=>s(e)),a.pipe(l),o=parseInt(a.headers["content-length"],10),r&&a.on("data",n)});return d.on("error",e=>s(e)),l}function d(e,t){if(z( ` Installing $ { e } to $ { t } ` ),e.endsWith(".zip"))return _.default(e,{dir:t});if(e.endsWith(".tar.bz2"))return p(e,t);if(e.endsWith(".dmg"))return W(t).then(()=>c(e,t));throw new Error( ` Unsupported archive format : $ { e } ` )}function p(e,t){const n=r(16974),a=r(1650);return new Promise((r,o)=>{const i=n.extract(t);i.on("error",o),i.on("finish",r);const s=b.createReadStream(e);s.pipe(a()).pipe(i)})}function c(e,t){function r(){if(n){const e= ` hdiutil detach "${n}" - quiet ` ;z( ` Unmounting $ { n } ` ),v.exec(e,e=>{e&&console.
Line truncated
} ) ( ) ` },readProtocolStream:async function(e,t,r){if(!g.isNode&&r)throw new Error("Cannot write to a path outside of Node.js environment.");const n=g.isNode?await s():null;let a=!1,o;r&&n&&(o=await n.promises.open(r,"w"));const i=[];for(;!a;){const s=await e.send("IO.read",{handle:t});a=s.eof;const l=Buffer.from(s.data,s.base64Encoded?"base64":void 0);i.push(l),r&&n&&(await n.promises.writeFile(o,l))}r&&(await o.close()),await e.send("IO.close",{handle:t});let l=null;try{l=Buffer.concat(i)}finally{return l}},waitWithTimeout:async function(e,t,r){let n;const a=new c.TimeoutError( ` waiting for $ { t } failed : timeout $ { r } ms exceeded ` ),o=new Promise((e,t)=>n=t);let i=null;r&&(i=setTimeout(()=>n(a),r));try{return await Promise.race([e,o])}finally{i&&clearTimeout(i)}},waitForEvent:async function(e,t,r,o,i){function s(){a([m]),clearTimeout(l)}let l,d,p;const u=new Promise((e,t)=>{d=e,p=t}),m=n(e,t,e=>{r(e)&&d(e)});o&&(l=setTimeout(()=>{p(new c.TimeoutError("Timeout exceeded while waiting for event"))},o));const g=await Promise.race([u,i]).then(e=>(s(),e),e=>{throw s(),e});if(g instanceof Error)throw g;return g},isString:o,isNumber:function(e){return"number"==typeof e||e instanceof Number},importFSModule:s,addEventListener:n,removeEventListeners:a,valueFromRemoteObject:function(e){if(m.assert(!e.objectId,"Cannot extract value when objectId is given"),e.unserializableValue){if("bigint"===e.type&&"undefined"!=typeof BigInt)return BigInt(e.unserializableValue.replace("n",""));switch(e.unserializableValue){case"-0":return-0;case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-Infinity;default:throw new Error("Unsupported unserializable value: "+e.unserializableValue);}}return e.value},getExceptionMessage:function(e){if(e.exception)return e.exception.description||e.exception.value;let t=e.text;if(e.stackTrace)for(const r of e.stackTrace.callFrames){const e=r.url+":"+r.lineNumber+":"+r.columnNumber,n=r.functionName||"<anonymous>";t+= ` \ n at $ { n } ( $ { e } ) ` }return t},releaseObject:async function(e,r){r.objectId&&(await e.send("Runtime.releaseObject",{objectId:r.objectId}).catch(e=>{t.debugError(e)}))}}},23222:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=void 0,t.isNode=!!("undefined"!=typeof process&&process.version)},80527:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initializePuppeteerNode=void 0;const a=r(9323),o=r(14148),i=n(r(10837));t.initializePuppeteerNode=e=>{const t=i.default.sync(__dirname);let r=o.PUPPETEER_REVISIONS.chromium;const n="puppeteer-core"===e,s=n?void 0:process.env.PUPPETEER_PRODUCT||process.env.npm_config_puppeteer_product||process.env.npm_package_config_puppeteer_product;return n||"firefox"!==s||(r=o.PUPPETEER_REVISIONS.firefox),new a.PuppeteerNode({projectRoot:t,preferredRevision:r,isPuppeteerCore:n,productName:s})}},90176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(80527),a=r(23222);if(!a.isNode)throw new Error("Trying to run Puppeteer-Node in a web environment.");t.default=n.initializePuppeteerNode("puppeteer")},77463:function(e,t,r){"use strict";function n(e,t,r){if("chrome"===e){if("linux"===t)return"chrome-linux";if("mac"===t)return"chrome-mac";if("win32"===t||"win64"===t)return 591479<parseInt(r,10)?"chrome-win":"chrome-win32"}else if("firefox"===e)return t}function a(e,t,r,a){const o=x.format(R[e][t],r,a,n(e,t,a));return o}function o(){b.stat("/usr/bin/chromium-browser",function(e,t){if(void 0===t)throw console.error( ` The chromium binary is not available for arm64 : ` ),console.error( ` If you are on Ubuntu , you can install with : ` ),console.error( ` \ n apt - get install chromium - browser \ n ` ),new Error})}function i(e){return new Promise(t=>{b.access(e,e=>t(!e))})}function s(e,t){const r=S.basename(t),n=r.split("-");if(2!==n.length)return null;const[a,o]=n;return R[e][a]?{product:e,platform:a,revision:o}:null}function l(e,t,r){function n(e){a+=e.length,r(a,o)}z( ` Downloading binary from $ { e } ` );let a=0,o=0,i,s;const l=new Promise((e,t)=>{i=e,s=t}),d=u(e,"GET",a=>{if(200!==a.statusCode){const t=new Error( ` Download failed : server returned code $ { a . statusCode } . URL : $ { e } ` );return a.resume(),void s(t)}const l=b.createWriteStream(t);l.on("finish",()=>i()),l.on("error",e=>s(e)),a.pipe(l),o=parseInt(a.headers["content-length"],10),r&&a.on("data",n)});return d.on("error",e=>s(e)),l}function d(e,t){if(z( ` Installing $ { e } to $ { t } ` ),e.endsWith(".zip"))return _.default(e,{dir:t});if(e.endsWith(".tar.bz2"))return p(e,t);if(e.endsWith(".dmg"))return W(t).then(()=>c(e,t));throw new Error( ` Unsupported archive format : $ { e } ` )}function p(e,t){const n=r(16974),a=r(1650);return new Promise((r,o)=>{const i=n.extract(t);i.on("error",o),i.on("finish",r);const s=b.createReadStream(e);s.pipe(a()).pipe(i)})}function c(e,t){function r(){if(n){const e= ` hdiutil detach "${n}" - quiet ` ;z( ` Unmounting $ { n } ` ),v.exec(e,e=>{e&&console.
Line truncated
This means that , on future Puppeteer launches , Puppeteer might not be able to launch the browser .
Please check your open processes and ensure that the browser processes that Puppeteer launched have been killed .
If you think this is a bug , please report it on the Puppeteer issue tracker . ` } \n Error cause: ${ e . stack } ` ) } u . helper . removeEventListeners ( this . _listeners ) } async setupConnection ( e ) { const { usePipe : t , timeout : r , slowMo : a , preferredRevision : o } = e ; if ( ! t ) { const e = await n ( this . proc , r , o ) , t = await g . NodeWebSocketTransport . create ( e ) ; this . connection = new m . Connection ( e , t , a ) } else { const { 3 : e , 4 : t } = this . proc . stdio , r = new h . PipeTransport ( e , t ) ; this . connection = new m . Connection ( "" , r , a ) } return this . connection } } } , 93935 : function ( e , t , r ) { "use strict" ; function n ( e ) { let t ; if ( ! e . _isPuppeteerCore ) { const e = process . env . PUPPETEER _EXECUTABLE _PATH || process . env . npm _config _puppeteer _executable _path || process . env . npm _package _config _puppeteer _executable _path ; if ( e ) { const t = d . existsSync ( e ) ? null : "Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: " + e ; return { executablePath : e , missingText : t } } t = process . env . PUPPETEER _DOWNLOAD _PATH || process . env . npm _config _puppeteer _download _path || process . env . npm _package _config _puppeteer _download _path } const r = new p . BrowserFetcher ( e . _projectRoot , { product : e . product , path : t } ) ; if ( ! e . _isPuppeteerCore && "chrome" === e . product ) { const e = process . env . PUPPETEER _CHROMIUM _REVISION ; if ( e ) { const t = r . revisionInfo ( e ) , n = t . local ? null : "Tried to use PUPPETEER_CHROMIUM_REVISION env variable to launch browser but did not find executable at: " + t . executablePath ; return { executablePath : t . executablePath , missingText : n } } } const n = r . revisionInfo ( e . _preferredRevision ) , a = n . local ? null : ` Could not find browser revision ${ e . _preferredRevision } . Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary. ` ; return { executablePath : n . executablePath , missingText : a } } var a = this && this . _ _createBinding || ( Object . create ? function ( e , t , r , n ) { void 0 === n && ( n = r ) , Object . defineProperty ( e , n , { enumerable : ! 0 , get : function ( ) { return t [ r ] } } ) } : function ( e , t , r , n ) { void 0 === n && ( n = r ) , e [ n ] = t [ r ] } ) , o = this && this . _ _setModuleDefault || ( Object . create ? function ( e , t ) { Object . defineProperty ( e , "default" , { enumerable : ! 0 , value : t } ) } : function ( e , t ) { e [ "default" ] = t } ) , i = this && this . _ _importStar || function ( e ) { if ( e && e . _ _esModule ) return e ; var t = { } ; if ( null != e ) for ( var r in e ) "default" != r && Object . hasOwnProperty . call ( e , r ) && a ( t , e , r ) ; return o ( t , e ) , t } ; Object . defineProperty ( t , "__esModule" , { value : ! 0 } ) ; const s = i ( r ( 12087 ) ) , l = i ( r ( 85622 ) ) , d = i ( r ( 35747 ) ) , p = r ( 77463 ) , c = r ( 10487 ) , u = r ( 15228 ) , m = r ( 31669 ) , g = m . promisify ( d . mkdtemp ) , h = m . promisify ( d . writeFile ) ; class f { constructor ( e , t , r ) { this . _projectRoot = e , this . _preferredRevision = t , this . _isPuppeteerCore = r } async launch ( e = { } ) { const { ignoreDefaultArgs : t = ! 1 , args : r = [ ] , dumpio : a = ! 1 , executablePath : o = null , pipe : i = ! 1 , env : d = process . env , handleSIGINT : p = ! 0 , handleSIGTERM : m = ! 0 , handleSIGHUP : h = ! 0 , ignoreHTTPSErrors : f = ! 1 , defaultViewport : y = { width : 800 , height : 600 } , slowMo : b = 0 , timeout : S = 3e4 } = e , x = l . join ( s . tmpdir ( ) , "puppeteer_dev_chrome_profile-" ) , v = [ ] ; t ? Array . isArray ( t ) ? v . push ( ... this . defaultArgs ( e ) . filter ( e => ! t . includes ( e ) ) ) : v . push ( ... r ) : v . push ( ... this . defaultArgs ( e ) ) ; let k = null ; v . some ( e => e . startsWith ( "--remote-debugging-" ) ) || v . push ( i ? "--remote-debugging-pipe" : "--remote-debugging-port=0" ) , v . some ( e => e . startsWith ( "--user-data-dir" ) ) || ( k = await g ( x ) , v . push ( ` --user-data-dir= ${ k } ` ) ) ; let C = o ; if ( "arm64" === s . arch ( ) ) C = "/usr/bin/chromium-browser" ; else if ( ! o ) { const { missingText : e , executablePath : t } = n ( this ) ; if ( e ) throw new Error ( e ) ; C = t } const _ = v . includes ( "--remote-debugging-pipe" ) , w = new u . BrowserRunner ( C , v , k ) ; w . start ( { handleSIGHUP : h , handleSIGTERM : m , handleSIGINT : p , dumpio : a , env : d , pipe : _ } ) ; try { const e = await w . setupConnection ( { usePipe : _ , timeout : S , slowMo : b , preferredRevision : this . _preferredRevision } ) , t = await c . Browser . create ( e , [ ] , f , y , w . proc , w . close . bind ( w ) ) ; return await t . waitForTarget ( e => "page" === e . type ( ) ) , t } catch ( e ) { throw w . kill ( ) , e } } defaultArgs ( e = { } ) { const t = [ "--disable-background-networking" , "--enable-features=NetworkService,NetworkServiceInProcess" , "--disable-background-timer-throttling" , "--disable-backgrounding-occluded-windows" , "--disable-breakpad" , "--disable-client-side-phishing-detection" , "--disable-component-extensions-with-background-pages" , "--disable-default-apps" , "--disable-dev-shm-usage" , "--disable-extensions" , "--disable-features=TranslateUI" , "--disable-hang-monitor" , "--disable-ipc-flooding-protection" , "--disable-popup-blocking" , "--disable-prompt-on-repost" , "--disable-renderer-backgrounding" , "--disable-sync" , "--force-color-profile=srgb" , "--metrics-recording-only" , "--no-first-run" , "--enable-automation" , "--password-store=basic" , "--use-mock-keychain" , "--enable-blink-features=IdleDetection" ] , { devtools : r = ! 1 , headless : n = ! r , args : a = [ ] , userDataDir : o = null } = e ; return o && t . push ( ` --user-data-dir= ${ l . resolve ( o ) } ` ) , r && t . push ( "--auto-open-devtools-for-tabs" ) , n && t . push ( "--headless" , "--hide-scrollbars" , "--mute-audio" ) , a . every ( e => e . startsWith ( "-" ) ) && t . push ( "about:blank" ) , t . push ( ... a ) , t } executablePath ( ) { return n ( this ) . executablePath } get product ( ) { return "chrome" } } class y { constructor ( e , t , r ) { this . _projectRoot = e , this . _preferredRevision = t , this . _is Line truncated
If you think this is a bug , please report it on the Puppeteer issue tracker . ` } \n Error cause: ${ e . stack } ` ) } u . helper . removeEventListeners ( this . _listeners ) } async setupConnection ( e ) { const { usePipe : t , timeout : r , slowMo : a , preferredRevision : o } = e ; if ( ! t ) { const e = await n ( this . proc , r , o ) , t = await g . NodeWebSocketTransport . create ( e ) ; this . connection = new m . Connection ( e , t , a ) } else { const { 3 : e , 4 : t } = this . proc . stdio , r = new h . PipeTransport ( e , t ) ; this . connection = new m . Connection ( "" , r , a ) } return this . connection } } } , 93935 : function ( e , t , r ) { "use strict" ; function n ( e ) { let t ; if ( ! e . _isPuppeteerCore ) { const e = process . env . PUPPETEER _EXECUTABLE _PATH || process . env . npm _config _puppeteer _executable _path || process . env . npm _package _config _puppeteer _executable _path ; if ( e ) { const t = d . existsSync ( e ) ? null : "Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: " + e ; return { executablePath : e , missingText : t } } t = process . env . PUPPETEER _DOWNLOAD _PATH || process . env . npm _config _puppeteer _download _path || process . env . npm _package _config _puppeteer _download _path } const r = new p . BrowserFetcher ( e . _projectRoot , { product : e . product , path : t } ) ; if ( ! e . _isPuppeteerCore && "chrome" === e . product ) { const e = process . env . PUPPETEER _CHROMIUM _REVISION ; if ( e ) { const t = r . revisionInfo ( e ) , n = t . local ? null : "Tried to use PUPPETEER_CHROMIUM_REVISION env variable to launch browser but did not find executable at: " + t . executablePath ; return { executablePath : t . executablePath , missingText : n } } } const n = r . revisionInfo ( e . _preferredRevision ) , a = n . local ? null : ` Could not find browser revision ${ e . _preferredRevision } . Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary. ` ; return { executablePath : n . executablePath , missingText : a } } var a = this && this . _ _createBinding || ( Object . create ? function ( e , t , r , n ) { void 0 === n && ( n = r ) , Object . defineProperty ( e , n , { enumerable : ! 0 , get : function ( ) { return t [ r ] } } ) } : function ( e , t , r , n ) { void 0 === n && ( n = r ) , e [ n ] = t [ r ] } ) , o = this && this . _ _setModuleDefault || ( Object . create ? function ( e , t ) { Object . defineProperty ( e , "default" , { enumerable : ! 0 , value : t } ) } : function ( e , t ) { e [ "default" ] = t } ) , i = this && this . _ _importStar || function ( e ) { if ( e && e . _ _esModule ) return e ; var t = { } ; if ( null != e ) for ( var r in e ) "default" != r && Object . hasOwnProperty . call ( e , r ) && a ( t , e , r ) ; return o ( t , e ) , t } ; Object . defineProperty ( t , "__esModule" , { value : ! 0 } ) ; const s = i ( r ( 12087 ) ) , l = i ( r ( 85622 ) ) , d = i ( r ( 35747 ) ) , p = r ( 77463 ) , c = r ( 10487 ) , u = r ( 15228 ) , m = r ( 31669 ) , g = m . promisify ( d . mkdtemp ) , h = m . promisify ( d . writeFile ) ; class f { constructor ( e , t , r ) { this . _projectRoot = e , this . _preferredRevision = t , this . _isPuppeteerCore = r } async launch ( e = { } ) { const { ignoreDefaultArgs : t = ! 1 , args : r = [ ] , dumpio : a = ! 1 , executablePath : o = null , pipe : i = ! 1 , env : d = process . env , handleSIGINT : p = ! 0 , handleSIGTERM : m = ! 0 , handleSIGHUP : h = ! 0 , ignoreHTTPSErrors : f = ! 1 , defaultViewport : y = { width : 800 , height : 600 } , slowMo : b = 0 , timeout : S = 3e4 } = e , x = l . join ( s . tmpdir ( ) , "puppeteer_dev_chrome_profile-" ) , v = [ ] ; t ? Array . isArray ( t ) ? v . push ( ... this . defaultArgs ( e ) . filter ( e => ! t . includes ( e ) ) ) : v . push ( ... r ) : v . push ( ... this . defaultArgs ( e ) ) ; let k = null ; v . some ( e => e . startsWith ( "--remote-debugging-" ) ) || v . push ( i ? "--remote-debugging-pipe" : "--remote-debugging-port=0" ) , v . some ( e => e . startsWith ( "--user-data-dir" ) ) || ( k = await g ( x ) , v . push ( ` --user-data-dir= ${ k } ` ) ) ; let C = o ; if ( "arm64" === s . arch ( ) ) C = "/usr/bin/chromium-browser" ; else if ( ! o ) { const { missingText : e , executablePath : t } = n ( this ) ; if ( e ) throw new Error ( e ) ; C = t } const _ = v . includes ( "--remote-debugging-pipe" ) , w = new u . BrowserRunner ( C , v , k ) ; w . start ( { handleSIGHUP : h , handleSIGTERM : m , handleSIGINT : p , dumpio : a , env : d , pipe : _ } ) ; try { const e = await w . setupConnection ( { usePipe : _ , timeout : S , slowMo : b , preferredRevision : this . _preferredRevision } ) , t = await c . Browser . create ( e , [ ] , f , y , w . proc , w . close . bind ( w ) ) ; return await t . waitForTarget ( e => "page" === e . type ( ) ) , t } catch ( e ) { throw w . kill ( ) , e } } defaultArgs ( e = { } ) { const t = [ "--disable-background-networking" , "--enable-features=NetworkService,NetworkServiceInProcess" , "--disable-background-timer-throttling" , "--disable-backgrounding-occluded-windows" , "--disable-breakpad" , "--disable-client-side-phishing-detection" , "--disable-component-extensions-with-background-pages" , "--disable-default-apps" , "--disable-dev-shm-usage" , "--disable-extensions" , "--disable-features=TranslateUI" , "--disable-hang-monitor" , "--disable-ipc-flooding-protection" , "--disable-popup-blocking" , "--disable-prompt-on-repost" , "--disable-renderer-backgrounding" , "--disable-sync" , "--force-color-profile=srgb" , "--metrics-recording-only" , "--no-first-run" , "--enable-automation" , "--password-store=basic" , "--use-mock-keychain" , "--enable-blink-features=IdleDetection" ] , { devtools : r = ! 1 , headless : n = ! r , args : a = [ ] , userDataDir : o = null } = e ; return o && t . push ( ` --user-data-dir= ${ l . resolve ( o ) } ` ) , r && t . push ( "--auto-open-devtools-for-tabs" ) , n && t . push ( "--headless" , "--hide-scrollbars" , "--mute-audio" ) , a . every ( e => e . startsWith ( "-" ) ) && t . push ( "about:blank" ) , t . push ( ... a ) , t } executablePath ( ) { return n ( this ) . executablePath } get product ( ) { return "chrome" } } class y { constructor ( e , t , r ) { this . _projectRoot = e , this . _preferredRevision = t , this . _is Line truncated
* SVGO is a Nodejs - based tool for optimizing SVG vector graphics files .
*
* @ see https : //github.com/svg/svgo
@@ -96,7 +96,7 @@ If you think this is a bug, please report it on the Puppeteer issue tracker.`}\n
* @ author Kir Belevich < kir @ soulshine . in > ( https : //github.com/deepsweet)
* @ copyright © 2012 Kir Belevich
* @ license MIT https : //raw.githubusercontent.com/svg/svgo/master/LICENSE
* / v a r n = r ( 4 2 3 4 2 ) , a = r ( 3 7 1 7 ) , o = r ( 6 5 9 9 4 ) , i = r ( 7 1 9 2 1 ) , s = r ( 7 9 7 3 6 ) . B y , l = r ( 5 8 5 2 9 ) , d = f u n c t i o n ( e ) { t h i s . c o n f i g = n ( e ) } ; d . p r o t o t y p e . o p t i m i z e = f u n c t i o n ( e , t ) { r e t u r n t = t | | { } , n e w P r o m i s e ( ( r , n ) = > { i f ( t h i s . c o n f i g . e r r o r ) r e t u r n v o i d n ( t h i s . c o n f i g . e r r o r ) ; v a r a = t h i s . c o n f i g , o = a . m u l t i p a s s ? 1 0 : 1 , i = 0 , l = _ N u m b e r P O S I T I V E _ I N F I N I T Y , d = e = > e . e r r o r ? v o i d n ( e . e r r o r ) : v o i d ( t . m u l t i p a s s C o u n t = i , + + i < o & & e . d a t a . l e n g t h < l ? ( l = e . d a t a . l e n g t h , t h i s . _ o p t i m i z e O n c e ( e . d a t a , t , d ) ) : ( a . d a t a u r i & & ( e . d a t a = s ( e . d a t a , a . d a t a u r i ) ) , t & & t . p a t h & & ( e . p a t h = t . p a t h ) , r ( e ) ) ) ; t h i s . _ o p t i m i z e O n c e ( e , t , d ) } ) } , d . p r o t o t y p e . _ o p t i m i z e O n c e = f u n c t i o n ( e , t , r ) { v a r n = t h i s . c o n f i g ; a ( e , f u n c t i o n ( e ) { r e t u r n e . e r r o r ? v o i d r ( e ) : v o i d ( e = o ( e , t , n . p l u g i n s ) , r ( l ( e , n . j s 2 s v g ) ) ) } ) } , d . p r o t o t y p e . c r e a t e C o n t e n t I t e m = f u n c t i o n ( e ) { r e t u r n n e w i ( e ) } , d . C o n f i g = n , e . e x p o r t s = d , e . e x p o r t s . d e f a u l t = d } , 4 2 3 4 2 : ( e , t , r ) = > { f u n c t i o n n ( e ) { r e t u r n " _ c o l l e c t i o n s . j s " = = = e | | " _ c o l l e c t i o n s " = = = e ? r ( 7 6 3 4 4 ) : " _ p a t h . j s " = = = e | | " _ p a t h " = = = e ? r ( 5 4 8 7 0 ) : " _ t r a n s f o r m s . j s " = = = e | | " _ t r a n s f o r m s " = = = e ? r ( 2 2 5 2 7 ) : " a d d A t t r i b u t e s T o S V G E l e m e n t . j s " = = = e | | " a d d A t t r i b u t e s T o S V G E l e m e n t " = = = e ? r ( 5 5 1 9 ) : " a d d C l a s s e s T o S V G E l e m e n t . j s " = = = e | | " a d d C l a s s e s T o S V G E l e m e n t " = = = e ? r ( 7 5 1 1 8 ) : " c l e a n u p A t t r s . j s " = = = e | | " c l e a n u p A t t r s " = = = e ? r ( 4 1 0 6 ) : " c l e a n u p E n a b l e B a c k g r o u n d . j s " = = = e | | " c l e a n u p E n a b l e B a c k g r o u n d " = = = e ? r ( 2 6 4 8 3 ) : " c l e a n u p I D s . j s " = = = e | | " c l e a n u p I D s " = = = e ? r ( 3 7 7 6 2 ) : " c l e a n u p L i s t O f V a l u e s . j s " = = = e | | " c l e a n u p L i s t O f V a l u e s " = = = e ? r ( 9 2 3 3 1 ) : " c l e a n u p N u m e r i c V a l u e s . j s " = = = e | | " c l e a n u p N u m e r i c V a l u e s " = = = e ? r ( 3 6 2 9 6 ) : " c o l l a p s e G r o u p s . j s " = = = e | | " c o l l a p s e G r o u p s " = = = e ? r ( 5 9 6 1 6 ) : " c o n v e r t C o l o r s . j s " = = = e | | " c o n v e r t C o l o r s " = = = e ? r ( 8 3 2 5 4 ) : " c o n v e r t E l l i p s e T o C i r c l e . j s " = = = e | | " c o n v e r t E l l i p s e T o C i r c l e " = = = e ? r ( 5 6 0 6 1 ) : " c o n v e r t P a t h D a t a . j s " = = = e | | " c o n v e r t P a t h D a t a " = = = e ? r ( 7 6 3 0 7 ) : " c o n v e r t S h a p e T o P a t h . j s " = = = e | | " c o n v e r t S h a p e T o P a t h " = = = e ? r ( 2 4 1 9 9 ) : " c o n v e r t S t y l e T o A t t r s . j s " = = = e | | " c o n v e r t S t y l e T o A t t r s " = = = e ? r ( 7 2 4 4 6 ) : " c o n v e r t T r a n s f o r m . j s " = = = e | | " c o n v e r t T r a n s f o r m " = = = e ? r ( 7 2 2 3 4 ) : " i n l i n e S t y l e s . j s " = = = e | | " i n l i n e S t y l e s " = = = e ? r ( 8 1 8 6 2 ) : " m e r g e P a t h s . j s " = = = e | | " m e r g e P a t h s " = = = e ? r ( 4 6 1 2 3 ) : " m i n i f y S t y l e s . j s " = = = e | | " m i n i f y S t y l e s " = = = e ? r ( 7 7 6 8 6 ) : " m o v e E l e m s A t t r s T o G r o u p . j s " = = = e | | " m o v e E l e m s A t t r s T o G r o u p " = = = e ? r ( 4 2 7 7 8 ) : " m o v e G r o u p A t t r s T o E l e m s . j s " = = = e | | " m o v e G r o u p A t t r s T o E l e m s " = = = e ? r ( 6 9 0 7 8 ) : " p r e f i x I d s . j s " = = = e | | " p r e f i x I d s " = = = e ? r ( 3 3 0 9 9 ) : " r e m o v e A t t r i b u t e s B y S e l e c t o r . j s " = = = e | | " r e m o v e A t t r i b u t e s B y S e l e c t o r " = = = e ? r ( 6 5 7 3 1 ) : " r e m o v e A t t r s . j s " = = = e | | " r e m o v e A t t r s " = = = e ? r ( 9 1 5 8 5 ) : " r e m o v e C o m m e n t s . j s " = = = e | | " r e m o v e C o m m e n t s " = = = e ? r ( 1 3 3 8 3 ) : " r e m o v e D e s c . j s " = = = e | | " r e m o v e D e s c " = = = e ? r ( 8 1 6 6 8 ) : " r e m o v e D i m e n s i o n s . j s " = = = e | | " r e m o v e D i m e n s i o n s " = = = e ? r ( 4 1 6 9 0 ) : " r e m o v e D o c t y p e . j s " = = = e | | " r e m o v e D o c t y p e " = = = e ? r ( 4 2 1 1 4 ) : " r e m o v e E d i t o r s N S D a t a . j s " = = = e | | " r e m o v e E d i t o r s N S D a t a " = = = e ? r ( 7 0 3 2 5 ) : " r e m o v e E l e m e n t s B y A t t r . j s " = = = e | | " r e m o v e E l e m e n t s B y A t t r " = = = e ? r ( 7 0 5 3 5 ) : " r e m o v e E m p t y A t t r s . j s " = = = e | | " r e m o v e E m p t y A t t r s " = = = e ? r ( 6 3 1 5 1 ) : " r e m o v e E m p t y C o n t a i n e r s . j s " = = = e | | " r e m o v e E m p t y C o n t a i n e r s " = = = e ? r ( 4 1 0 5 9 ) : " r e m o v e E m p t y T e x t . j s " = = = e | | " r e m o v e E m p t y T e x t " = = = e ? r ( 1 4 1 5 6 ) : " r e m o v e H i d d e n E l e m s . j s " = = = e | | " r e m o v e H i d d e n E l e m s " = = = e ? r ( 1 3 7 8 ) : " r e m o v e M e t a d a t a . j s " = = = e | | " r e m o v e M e t a d a t a " = = = e ? r ( 2 8 8 7 3 ) : " r e m o v e N o n I n h e r i t a b l e G r o u p A t t r s . j s " = = = e | | " r e m o v e N o n I n h e r i t a b l e G r o u p A t t r s " = = = e ? r ( 6 7 6 6 2 ) : " r e m o v e O f f C a n v a s P a t h s . j s " = = = e | | " r e m o v e O f f C a n v a s P a t h s " = = = e ? r ( 5 8 2 6 7 ) : " r e m o v e R a s t e r I m a g e s . j s " = = = e | | " r e m o v e R a s t e r I m a g e s " = = = e ? r ( 9 9 0 6 2 ) : " r e m o v e S c r i p t E l e m e n t . j s " = = = e | | " r e m o v e S c r i p t E l e m e n t " = = = e ? r ( 6 4 1 8 6 ) : " r e m o v e S t y l e E l e m e n t . j s " = = = e | | " r e m o v e S t y l e E l e m e n t " = = = e ? r ( 9 9 6 8 1 ) : " r e m o v e T i t l e . j s " = = = e | | " r e m o v e T i t l e " = = = e ? r ( 7 6 0 8 7 ) : " r e m o v e U n k n o w n s A n d D e f a u l t s . j s " = = = e | | " r e m o v e U n k n o w n s A n d D e f a u l t s " = = = e ? r ( 8 3 1 6 ) : " r e m o v e U n u s e d N S . j s " = = = e | | " r e m o v e U n u s e d N S " = = = e ? r ( 7 7 9 2 6 ) : " r e m o v e U s e l e s s D e f s . j s " = = = e | | " r e m o v e U s e l e s s D e f s " = = = e ? r ( 1 8 2 0 ) : " r e m o v e U s e l e s s S t r o k e A n d F i l l . j s " = = = e | | " r e m o v e U s e l e s s S t r o k e A n d F i l l " = = = e ? r ( 7 5 1 9 ) : " r e m o v e V i e w B o x . j s " = = = e | | " r e m o v e V i e w B o x " = = = e ? r ( 8 1 3 0 6 ) : " r e m o v e X M L N S . j s " = = = e | | " r e m o v e X M L N S " = = = e ? r ( 4 4 9 8 7 ) : " r e m o v e X M L P r o c I n s t . j s " = = = e | | " r e m o v e X M L P r o c I n s t " = = = e ? r ( 9 7 4 2 7 ) : " r e u s e P a t h s . j s " = = = e | | " r e u s e P a t h s " = = = e ? r ( 8 6 6 0 7 ) : " s o r t A t t r s . j s " = = = e | | " s o r t A t t r s " = = = e ? r ( 1 7 5 4 9 ) : " s o r t D e f s C h i l d r e n . j s " = = = e | | " s o r t D e f s C h i l d r e n " = = = e ? r ( 5 6 8 1 ) : v o i d 0 } f u n c t i o n a ( e , t ) { v a r r , n ; r e t u r n t . m a p ( f u n c t i o n ( t ) { r e t u r n " o b j e c t " = = t y p e o f t ? ( n = O b j e c t . k e y s ( t ) [ 0 ] , " o b j e c t " = = t y p e o f t [ n ] & & t [ n ] . f n & & " f u n c t i o n " = = t y p e o f t [ n ] . f n ? r = i ( n , t [ n ] ) : ( r = l ( d ( e , n , t [ n ] . p a t h ) , t , n ) , r . n a m e = n ) ) : ( r = d ( e , t ) , r . n a m e = t , " o b j e c t " = = t y p e o f r . p a r a m s & & ( r . p a r a m s = O b j e c t . a s s i g n ( { } , r . p a r a m s ) ) ) , r } ) } f u n c t i o n o ( e , t ) { v a r r ; r e t u r n t . p l u g i n s & & t . p l u g i n s . f o r E a c h ( f u n c t i o n ( n ) { " o b j e c t " = = t y p e o f n & & ( r = O b j e c t . k e y s ( n ) [ 0 ] , n u l l = = n [ r ] & & c o n s o l e . e r r o r ( ` E r r o r : ' $ { r } ' p l u g i n i s m i s c o n f i g u r e d ! H a v e y o u p a d d e d i t s c o n t e n t i n Y M L p r o p e r l y ? \ n ` ) , " o b j e c t " = = t y p e o f n [ r ] & & n [ r ] . f n & & " f u n c t i o n " = = t y p e o f n [ r ] . f n ? e . p l u g i n s . p u s h ( i ( r , n [ r ] ) ) : " o b j e c t " = = t y p e o f n [ r ] & & n [ r ] . p a t h ? e . p l u g i n s . p u s h ( l ( d ( t , v o i d 0 , n [ r ] . p a t h ) , n , r ) ) : e . p l u g i n s . f o r E a c h ( f u n c t i o n ( e ) { e . n a m e = = = r & & ( e = l ( e , n , r ) ) } ) ) } ) , e . m u l t i p a s s = t . m u l t i p a s s , t . s v g 2 j s & & ( e . s v g 2 j s = t . s v g 2 j s ) , t . j s 2 s v g & & ( e . j s 2 s v g = t . j s 2 s v g ) , e } f u n c t i o n i ( e , t ) { r e t u r n t . a c t i v e = ! 0 , t . p a r a m s = O b j e c t . a s s i g n ( { } , t . p a r a m s | | { } ) , t . n a m e = e , t } f u n c t i o n s ( e ) { v a r t ; r e t u r n e . r e d u c e ( f u n c t i o n ( e , r ) { r e t u r n t & & r . t y p e = = t [ 0 ] . t y p e ? t . p u s h ( r ) : e . p u s h ( t = [ r ] ) , e } , [ ] ) } f u n c t i o n l ( e , t , r ) { r e t u r n " o b j e c t " = = t y p e o f t [ r ] ? ( e . p a r a m s = O b j e c t . a s Line truncated
* / v a r n = r ( 4 2 3 4 2 ) , a = r ( 3 7 1 7 ) , o = r ( 6 5 9 9 4 ) , i = r ( 7 1 9 2 1 ) , s = r ( 7 9 7 3 6 ) . B y , l = r ( 5 8 5 2 9 ) , d = f u n c t i o n ( e ) { t h i s . c o n f i g = n ( e ) } ; d . p r o t o t y p e . o p t i m i z e = f u n c t i o n ( e , t ) { r e t u r n t = t | | { } , n e w P r o m i s e ( ( r , n ) = > { i f ( t h i s . c o n f i g . e r r o r ) r e t u r n v o i d n ( t h i s . c o n f i g . e r r o r ) ; v a r a = t h i s . c o n f i g , o = a . m u l t i p a s s ? 1 0 : 1 , i = 0 , l = _ N u m b e r P O S I T I V E _ I N F I N I T Y , d = e = > e . e r r o r ? v o i d n ( e . e r r o r ) : v o i d ( t . m u l t i p a s s C o u n t = i , + + i < o & & e . d a t a . l e n g t h < l ? ( l = e . d a t a . l e n g t h , t h i s . _ o p t i m i z e O n c e ( e . d a t a , t , d ) ) : ( a . d a t a u r i & & ( e . d a t a = s ( e . d a t a , a . d a t a u r i ) ) , t & & t . p a t h & & ( e . p a t h = t . p a t h ) , r ( e ) ) ) ; t h i s . _ o p t i m i z e O n c e ( e , t , d ) } ) } , d . p r o t o t y p e . _ o p t i m i z e O n c e = f u n c t i o n ( e , t , r ) { v a r n = t h i s . c o n f i g ; a ( e , f u n c t i o n ( e ) { r e t u r n e . e r r o r ? v o i d r ( e ) : v o i d ( e = o ( e , t , n . p l u g i n s ) , r ( l ( e , n . j s 2 s v g ) ) ) } ) } , d . p r o t o t y p e . c r e a t e C o n t e n t I t e m = f u n c t i o n ( e ) { r e t u r n n e w i ( e ) } , d . C o n f i g = n , e . e x p o r t s = d , e . e x p o r t s . d e f a u l t = d } , 4 2 3 4 2 : ( e , t , r ) = > { f u n c t i o n n ( e ) { r e t u r n " _ c o l l e c t i o n s . j s " = = = e | | " _ c o l l e c t i o n s " = = = e ? r ( 7 6 3 4 4 ) : " _ p a t h . j s " = = = e | | " _ p a t h " = = = e ? r ( 5 4 8 7 0 ) : " _ t r a n s f o r m s . j s " = = = e | | " _ t r a n s f o r m s " = = = e ? r ( 2 2 5 2 7 ) : " a d d A t t r i b u t e s T o S V G E l e m e n t . j s " = = = e | | " a d d A t t r i b u t e s T o S V G E l e m e n t " = = = e ? r ( 5 5 1 9 ) : " a d d C l a s s e s T o S V G E l e m e n t . j s " = = = e | | " a d d C l a s s e s T o S V G E l e m e n t " = = = e ? r ( 7 5 1 1 8 ) : " c l e a n u p A t t r s . j s " = = = e | | " c l e a n u p A t t r s " = = = e ? r ( 4 1 0 6 ) : " c l e a n u p E n a b l e B a c k g r o u n d . j s " = = = e | | " c l e a n u p E n a b l e B a c k g r o u n d " = = = e ? r ( 2 6 4 8 3 ) : " c l e a n u p I D s . j s " = = = e | | " c l e a n u p I D s " = = = e ? r ( 3 7 7 6 2 ) : " c l e a n u p L i s t O f V a l u e s . j s " = = = e | | " c l e a n u p L i s t O f V a l u e s " = = = e ? r ( 9 2 3 3 1 ) : " c l e a n u p N u m e r i c V a l u e s . j s " = = = e | | " c l e a n u p N u m e r i c V a l u e s " = = = e ? r ( 3 6 2 9 6 ) : " c o l l a p s e G r o u p s . j s " = = = e | | " c o l l a p s e G r o u p s " = = = e ? r ( 5 9 6 1 6 ) : " c o n v e r t C o l o r s . j s " = = = e | | " c o n v e r t C o l o r s " = = = e ? r ( 8 3 2 5 4 ) : " c o n v e r t E l l i p s e T o C i r c l e . j s " = = = e | | " c o n v e r t E l l i p s e T o C i r c l e " = = = e ? r ( 5 6 0 6 1 ) : " c o n v e r t P a t h D a t a . j s " = = = e | | " c o n v e r t P a t h D a t a " = = = e ? r ( 7 6 3 0 7 ) : " c o n v e r t S h a p e T o P a t h . j s " = = = e | | " c o n v e r t S h a p e T o P a t h " = = = e ? r ( 2 4 1 9 9 ) : " c o n v e r t S t y l e T o A t t r s . j s " = = = e | | " c o n v e r t S t y l e T o A t t r s " = = = e ? r ( 7 2 4 4 6 ) : " c o n v e r t T r a n s f o r m . j s " = = = e | | " c o n v e r t T r a n s f o r m " = = = e ? r ( 7 2 2 3 4 ) : " i n l i n e S t y l e s . j s " = = = e | | " i n l i n e S t y l e s " = = = e ? r ( 8 1 8 6 2 ) : " m e r g e P a t h s . j s " = = = e | | " m e r g e P a t h s " = = = e ? r ( 4 6 1 2 3 ) : " m i n i f y S t y l e s . j s " = = = e | | " m i n i f y S t y l e s " = = = e ? r ( 7 7 6 8 6 ) : " m o v e E l e m s A t t r s T o G r o u p . j s " = = = e | | " m o v e E l e m s A t t r s T o G r o u p " = = = e ? r ( 4 2 7 7 8 ) : " m o v e G r o u p A t t r s T o E l e m s . j s " = = = e | | " m o v e G r o u p A t t r s T o E l e m s " = = = e ? r ( 6 9 0 7 8 ) : " p r e f i x I d s . j s " = = = e | | " p r e f i x I d s " = = = e ? r ( 3 3 0 9 9 ) : " r e m o v e A t t r i b u t e s B y S e l e c t o r . j s " = = = e | | " r e m o v e A t t r i b u t e s B y S e l e c t o r " = = = e ? r ( 6 5 7 3 1 ) : " r e m o v e A t t r s . j s " = = = e | | " r e m o v e A t t r s " = = = e ? r ( 9 1 5 8 5 ) : " r e m o v e C o m m e n t s . j s " = = = e | | " r e m o v e C o m m e n t s " = = = e ? r ( 1 3 3 8 3 ) : " r e m o v e D e s c . j s " = = = e | | " r e m o v e D e s c " = = = e ? r ( 8 1 6 6 8 ) : " r e m o v e D i m e n s i o n s . j s " = = = e | | " r e m o v e D i m e n s i o n s " = = = e ? r ( 4 1 6 9 0 ) : " r e m o v e D o c t y p e . j s " = = = e | | " r e m o v e D o c t y p e " = = = e ? r ( 4 2 1 1 4 ) : " r e m o v e E d i t o r s N S D a t a . j s " = = = e | | " r e m o v e E d i t o r s N S D a t a " = = = e ? r ( 7 0 3 2 5 ) : " r e m o v e E l e m e n t s B y A t t r . j s " = = = e | | " r e m o v e E l e m e n t s B y A t t r " = = = e ? r ( 7 0 5 3 5 ) : " r e m o v e E m p t y A t t r s . j s " = = = e | | " r e m o v e E m p t y A t t r s " = = = e ? r ( 6 3 1 5 1 ) : " r e m o v e E m p t y C o n t a i n e r s . j s " = = = e | | " r e m o v e E m p t y C o n t a i n e r s " = = = e ? r ( 4 1 0 5 9 ) : " r e m o v e E m p t y T e x t . j s " = = = e | | " r e m o v e E m p t y T e x t " = = = e ? r ( 1 4 1 5 6 ) : " r e m o v e H i d d e n E l e m s . j s " = = = e | | " r e m o v e H i d d e n E l e m s " = = = e ? r ( 1 3 7 8 ) : " r e m o v e M e t a d a t a . j s " = = = e | | " r e m o v e M e t a d a t a " = = = e ? r ( 2 8 8 7 3 ) : " r e m o v e N o n I n h e r i t a b l e G r o u p A t t r s . j s " = = = e | | " r e m o v e N o n I n h e r i t a b l e G r o u p A t t r s " = = = e ? r ( 6 7 6 6 2 ) : " r e m o v e O f f C a n v a s P a t h s . j s " = = = e | | " r e m o v e O f f C a n v a s P a t h s " = = = e ? r ( 5 8 2 6 7 ) : " r e m o v e R a s t e r I m a g e s . j s " = = = e | | " r e m o v e R a s t e r I m a g e s " = = = e ? r ( 9 9 0 6 2 ) : " r e m o v e S c r i p t E l e m e n t . j s " = = = e | | " r e m o v e S c r i p t E l e m e n t " = = = e ? r ( 6 4 1 8 6 ) : " r e m o v e S t y l e E l e m e n t . j s " = = = e | | " r e m o v e S t y l e E l e m e n t " = = = e ? r ( 9 9 6 8 1 ) : " r e m o v e T i t l e . j s " = = = e | | " r e m o v e T i t l e " = = = e ? r ( 7 6 0 8 7 ) : " r e m o v e U n k n o w n s A n d D e f a u l t s . j s " = = = e | | " r e m o v e U n k n o w n s A n d D e f a u l t s " = = = e ? r ( 8 3 1 6 ) : " r e m o v e U n u s e d N S . j s " = = = e | | " r e m o v e U n u s e d N S " = = = e ? r ( 7 7 9 2 6 ) : " r e m o v e U s e l e s s D e f s . j s " = = = e | | " r e m o v e U s e l e s s D e f s " = = = e ? r ( 1 8 2 0 ) : " r e m o v e U s e l e s s S t r o k e A n d F i l l . j s " = = = e | | " r e m o v e U s e l e s s S t r o k e A n d F i l l " = = = e ? r ( 7 5 1 9 ) : " r e m o v e V i e w B o x . j s " = = = e | | " r e m o v e V i e w B o x " = = = e ? r ( 8 1 3 0 6 ) : " r e m o v e X M L N S . j s " = = = e | | " r e m o v e X M L N S " = = = e ? r ( 4 4 9 8 7 ) : " r e m o v e X M L P r o c I n s t . j s " = = = e | | " r e m o v e X M L P r o c I n s t " = = = e ? r ( 9 7 4 2 7 ) : " r e u s e P a t h s . j s " = = = e | | " r e u s e P a t h s " = = = e ? r ( 8 6 6 0 7 ) : " s o r t A t t r s . j s " = = = e | | " s o r t A t t r s " = = = e ? r ( 1 7 5 4 9 ) : " s o r t D e f s C h i l d r e n . j s " = = = e | | " s o r t D e f s C h i l d r e n " = = = e ? r ( 5 6 8 1 ) : v o i d 0 } f u n c t i o n a ( e , t ) { v a r r , n ; r e t u r n t . m a p ( f u n c t i o n ( t ) { r e t u r n " o b j e c t " = = t y p e o f t ? ( n = O b j e c t . k e y s ( t ) [ 0 ] , " o b j e c t " = = t y p e o f t [ n ] & & t [ n ] . f n & & " f u n c t i o n " = = t y p e o f t [ n ] . f n ? r = i ( n , t [ n ] ) : ( r = l ( d ( e , n , t [ n ] . p a t h ) , t , n ) , r . n a m e = n ) ) : ( r = d ( e , t ) , r . n a m e = t , " o b j e c t " = = t y p e o f r . p a r a m s & & ( r . p a r a m s = O b j e c t . a s s i g n ( { } , r . p a r a m s ) ) ) , r } ) } f u n c t i o n o ( e , t ) { v a r r ; r e t u r n t . p l u g i n s & & t . p l u g i n s . f o r E a c h ( f u n c t i o n ( n ) { " o b j e c t " = = t y p e o f n & & ( r = O b j e c t . k e y s ( n ) [ 0 ] , n u l l = = n [ r ] & & c o n s o l e . e r r o r ( ` E r r o r : ' $ { r } ' p l u g i n i s m i s c o n f i g u r e d ! H a v e y o u p a d d e d i t s c o n t e n t i n Y M L p r o p e r l y ? \ n ` ) , " o b j e c t " = = t y p e o f n [ r ] & & n [ r ] . f n & & " f u n c t i o n " = = t y p e o f n [ r ] . f n ? e . p l u g i n s . p u s h ( i ( r , n [ r ] ) ) : " o b j e c t " = = t y p e o f n [ r ] & & n [ r ] . p a t h ? e . p l u g i n s . p u s h ( l ( d ( t , v o i d 0 , n [ r ] . p a t h ) , n , r ) ) : e . p l u g i n s . f o r E a c h ( f u n c t i o n ( e ) { e . n a m e = = = r & & ( e = l ( e , n , r ) ) } ) ) } ) , e . m u l t i p a s s = t . m u l t i p a s s , t . s v g 2 j s & & ( e . s v g 2 j s = t . s v g 2 j s ) , t . j s 2 s v g & & ( e . j s 2 s v g = t . j s 2 s v g ) , e } f u n c t i o n i ( e , t ) { r e t u r n t . a c t i v e = ! 0 , t . p a r a m s = O b j e c t . a s s i g n ( { } , t . p a r a m s | | { } ) , t . n a m e = e , t } f u n c t i o n s ( e ) { v a r t ; r e t u r n e . r e d u c e ( f u n c t i o n ( e , r ) { r e t u r n t & & r . t y p e = = t [ 0 ] . t y p e ? t . p u s h ( r ) : e . p u s h ( t = [ r ] ) , e } , [ ] ) } f u n c t i o n l ( e , t , r ) { r e t u r n " o b j e c t " = = t y p e o f t [ r ] ? ( e . p a r a m s = O b j e c t . a s Line truncated
* @ license
* The MIT License
*
@@ -172,4 +172,4 @@ If you think this is a bug, please report it on the Puppeteer issue tracker.`}\n
* ОБЕСПЕЧЕНИЕМ ИЛИ ИСПОЛЬЗОВАНИЕМ ПРОГРАММНОГО
* ОБЕСПЕЧЕНИЯ
* ИЛИ ИНЫМИ ДЕЙСТВИЯМИ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ .
* /function n(e,t){return e.renameElem("use"),e.removeAttr("d"),e.removeAttr("stroke"),e.removeAttr("fill"),e.addAttr({name:"xlink:href",local:"xlink:href",prefix:"none",value:"#"+t}),delete e.pathJS,e}function a(e,t){if(!e.isEmpty())for(let r of e.content)t(r),a(r,t)}var o=r(71921);t.type="full",t.active=!1,t.description="Finds <path> elements with the same d, fill, and stroke, and converts them to <use> elements referencing a single <path> def.",t.fn=function(e){const t=new Map;let r=0;const i=[];a(e,e=>{if(!e.isElem("path")||!e.hasAttr("d"))return;const a=e.attr("d").value,o=e.hasAttr("fill")&&e.attr("fill").value||"",s=e.hasAttr("stroke")&&e.attr("stroke").value||"",l=a+";s:"+s+";f:"+o,d=t.get(l);return d?void(!d.reused&&(d.reused=!0,!d.elem.hasAttr("id")&&d.elem.addAttr({name:"id",local:"id",prefix:"",value:"reuse-"+r++}),i.push(d.elem)),e=n(e,d.elem.attr("id").value)):void t.set(l,{elem:e,reused:!1})});const s=new o({elem:"defs",prefix:"",local:"defs",content:[],attrs:[]},e);e.content[0].spliceContent(0,0,s);for(let t of i){const e=t.style,r=t.class;delete t.style,delete t.class;const a=t.clone();t.style=e,t.class=r,a.removeAttr("transform"),s.spliceContent(0,0,a),t=n(t,a.attr("id").value),t.removeAttr("id")}return e}},17549:(e,t)=>{"use strict";t.type="perItem",t.active=!1,t.description="sorts element attributes (disabled by default)",t.params={order:["id","width","height","x","x1","x2","y","y1","y2","cx","cy","r","fill","stroke","marker","d","points"]},t.fn=function(e,t){var r=[],n={},o=t.order.length+1,i=t.xmlnsOrder||"front";e.elem&&(e.eachAttr(function(e){r.push(e)}),r.sort(function(e,r){if(e.prefix!=r.prefix){if("front"==i){if("xmlns"==e.prefix)return-1;if("xmlns"==r.prefix)return 1}return e.prefix<r.prefix?-1:1}for(var n=o,a=o,s=0;s<t.order.length;s++)e.name==t.order[s]?n=s:0===e.name.indexOf(t.order[s]+"-")&&(n=s+.5),r.name==t.order[s]?a=s:0===r.name.indexOf(t.order[s]+"-")&&(a=s+.5);return n==a?e.name<r.name?-1:1:n-a}),r.forEach(function(e){n[e.name]=e}),e.attrs=n)}},5681:(e,t)=>{"use strict";t.type="perItem",t.active=!0,t.description="Sorts children of <defs> to improve compression",t.fn=function(e){if(e.isElem("defs")){if(e.content){var t=e.content.reduce(function(e,t){return t.elem in e?e[t.elem]++:e[t.elem]=1,e},{});e.content.sort(function(e,r){var n=t[r.elem]-t[e.elem];if(0!=n)return n;var a=r.elem.length-e.elem.length;return 0==a?e.elem==r.elem?0:e.elem>r.elem?-1:1:a})}return!0}}},16974:(e,t,r)=>{function n(e,t,r,a){return t===r?a(null,!0):void e.lstat(t,function(o,i){return o&&"ENOENT"!==o.code?a(o):o||i.isDirectory()?n(e,p.join(t,".."),r,a):void a(null,!1)})}function a(e,t,r){l(e,{fs:t.fs},function(e,n){!e&&n&&t.own?o(n,t.uid,t.gid,r):r(e)})}var o=r(28729),i=r(15283),s=r(537),l=r(23607),d=r(35747),p=r(85622),c=r(12087),u="win32"===c.platform(),m=function(){},g=function(e){return e},h=u?function(e){return e.replace(/ \ \ / g , "/" ) . replace ( /[:?<>|]/g , "_" ) } : g , f = function ( e , t , r , n , a , o ) { var s = a || [ "." ] ; return function ( a ) { if ( ! s . length ) return a ( ) ; var l = s . shift ( ) , d = p . join ( r , l ) ; t . call ( e , d , function ( t , c ) { return t ? a ( t ) : c . isDirectory ( ) ? void e . readdir ( d , function ( e , t ) { if ( e ) return a ( e ) ; o && t . sort ( ) ; for ( var d = 0 ; d < t . length ; d ++ ) n ( p . join ( r , l , t [ d ] ) ) || s . push ( p . join ( l , t [ d ] ) ) ; a ( null , l , c ) } ) : a ( null , l , c ) } ) } } , y = function ( e , t ) { return function ( r ) { r . name = r . name . split ( "/" ) . slice ( t ) . join ( "/" ) ; var n = r . linkname ; return n && ( "link" === r . type || p . isAbsolute ( n ) ) && ( r . linkname = n . split ( "/" ) . slice ( t ) . join ( "/" ) ) , e ( r ) } } ; t . pack = function ( e , t ) { e || ( e = "." ) , t || ( t = { } ) ; var r = t . fs || d , n = t . ignore || t . filter || m , a = t . map || m , o = t . mapStream || g , l = f ( r , t . dereference ? r . stat : r . lstat , e , n , t . entries , t . sort ) , c = ! 1 !== t . strict , u = "number" == typeof t . umask ? ~ t . umask : ~ x ( ) , b = "number" == typeof t . dmode ? t . dmode : 0 , S = "number" == typeof t . fmode ? t . fmode : 0 , v = t . pack || i . pack ( ) , k = t . finish || m ; t . strip && ( a = y ( a , t . strip ) ) , t . readable && ( b |= parseInt ( 555 , 8 ) , S |= parseInt ( 444 , 8 ) ) , t . writable && ( b |= parseInt ( 333 , 8 ) , S |= parseInt ( 222 , 8 ) ) ; var C = function ( t , n ) { r . readlink ( p . join ( e , t ) , function ( e , t ) { return e ? v . destroy ( e ) : void ( n . linkname = h ( t ) , v . entry ( n , w ) ) } ) } , _ = function ( n , i , l ) { if ( n ) return v . destroy ( n ) ; if ( ! i ) return ! 1 !== t . finalize && v . finalize ( ) , k ( v ) ; if ( l . isSocket ( ) ) return w ( ) ; var d = { name : h ( i ) , mode : ( l . mode | ( l . isDirectory ( ) ? b : S ) ) & u , mtime : l . mtime , size : l . size , type : "file" , uid : l . uid , gid : l . gid } ; if ( l . isDirectory ( ) ) return d . size = 0 , d . type = "directory" , d = a ( d ) || d , v . entry ( d , w ) ; if ( l . isSymbolicLink ( ) ) return d . size = 0 , d . type = "symlink" , d = a ( d ) || d , C ( i , d ) ; if ( d = a ( d ) || d , ! l . isFile ( ) ) return c ? v . destroy ( new Error ( "unsupported type for " + i ) ) : w ( ) ; var m = v . entry ( d , w ) ; if ( m ) { var g = o ( r . createReadStream ( p . join ( e , i ) , { start : 0 , end : 0 < d . size ? d . size - 1 : d . size } ) , d ) ; g . on ( "error" , function ( e ) { m . destroy ( e ) } ) , s ( g , m ) } } , w = function ( e ) { return e ? v . destroy ( e ) : void l ( _ ) } ; return w ( ) , v } ; var b = function ( e ) { return e . length ? e [ e . length - 1 ] : null } , S = function ( ) { return process . getuid ? process . getuid ( ) : - 1 } , x = function ( ) { return process . umask ? process . umask ( ) : 0 } ; t . extract = function ( e , t ) { e || ( e = "." ) , t || ( t = { } ) ; var r = t . fs || d , o = t . ignore || t . filter || m , l = t . map || m , c = t . mapStream || g , f = ! 1 !== t . chown && ! Line truncated
* /function n(e,t){return e.renameElem("use"),e.removeAttr("d"),e.removeAttr("stroke"),e.removeAttr("fill"),e.addAttr({name:"xlink:href",local:"xlink:href",prefix:"none",value:"#"+t}),delete e.pathJS,e}function a(e,t){if(!e.isEmpty())for(let r of e.content)t(r),a(r,t)}var o=r(71921);t.type="full",t.active=!1,t.description="Finds <path> elements with the same d, fill, and stroke, and converts them to <use> elements referencing a single <path> def.",t.fn=function(e){const t=new Map;let r=0;const i=[];a(e,e=>{if(!e.isElem("path")||!e.hasAttr("d"))return;const a=e.attr("d").value,o=e.hasAttr("fill")&&e.attr("fill").value||"",s=e.hasAttr("stroke")&&e.attr("stroke").value||"",l=a+";s:"+s+";f:"+o,d=t.get(l);return d?void(!d.reused&&(d.reused=!0,!d.elem.hasAttr("id")&&d.elem.addAttr({name:"id",local:"id",prefix:"",value:"reuse-"+r++}),i.push(d.elem)),e=n(e,d.elem.attr("id").value)):void t.set(l,{elem:e,reused:!1})});const s=new o({elem:"defs",prefix:"",local:"defs",content:[],attrs:[]},e);e.content[0].spliceContent(0,0,s);for(let t of i){const e=t.style,r=t.class;delete t.style,delete t.class;const a=t.clone();t.style=e,t.class=r,a.removeAttr("transform"),s.spliceContent(0,0,a),t=n(t,a.attr("id").value),t.removeAttr("id")}return e}},17549:(e,t)=>{"use strict";t.type="perItem",t.active=!1,t.description="sorts element attributes (disabled by default)",t.params={order:["id","width","height","x","x1","x2","y","y1","y2","cx","cy","r","fill","stroke","marker","d","points"]},t.fn=function(e,t){var r=[],n={},o=t.order.length+1,i=t.xmlnsOrder||"front";e.elem&&(e.eachAttr(function(e){r.push(e)}),r.sort(function(e,r){if(e.prefix!=r.prefix){if("front"==i){if("xmlns"==e.prefix)return-1;if("xmlns"==r.prefix)return 1}return e.prefix<r.prefix?-1:1}for(var n=o,a=o,s=0;s<t.order.length;s++)e.name==t.order[s]?n=s:0===e.name.indexOf(t.order[s]+"-")&&(n=s+.5),r.name==t.order[s]?a=s:0===r.name.indexOf(t.order[s]+"-")&&(a=s+.5);return n==a?e.name<r.name?-1:1:n-a}),r.forEach(function(e){n[e.name]=e}),e.attrs=n)}},5681:(e,t)=>{"use strict";t.type="perItem",t.active=!0,t.description="Sorts children of <defs> to improve compression",t.fn=function(e){if(e.isElem("defs")){if(e.content){var t=e.content.reduce(function(e,t){return t.elem in e?e[t.elem]++:e[t.elem]=1,e},{});e.content.sort(function(e,r){var n=t[r.elem]-t[e.elem];if(0!=n)return n;var a=r.elem.length-e.elem.length;return 0==a?e.elem==r.elem?0:e.elem>r.elem?-1:1:a})}return!0}}},16974:(e,t,r)=>{function n(e,t,r,a){return t===r?a(null,!0):void e.lstat(t,function(o,i){return o&&"ENOENT"!==o.code?a(o):o||i.isDirectory()?n(e,p.join(t,".."),r,a):void a(null,!1)})}function a(e,t,r){l(e,{fs:t.fs},function(e,n){!e&&n&&t.own?o(n,t.uid,t.gid,r):r(e)})}var o=r(28729),i=r(15283),s=r(537),l=r(23607),d=r(35747),p=r(85622),c=r(12087),u="win32"===c.platform(),m=function(){},g=function(e){return e},h=u?function(e){return e.replace(/ \ \ / g , "/" ) . replace ( /[:?<>|]/g , "_" ) } : g , f = function ( e , t , r , n , a , o ) { var s = a || [ "." ] ; return function ( a ) { if ( ! s . length ) return a ( ) ; var l = s . shift ( ) , d = p . join ( r , l ) ; t . call ( e , d , function ( t , c ) { return t ? a ( t ) : c . isDirectory ( ) ? void e . readdir ( d , function ( e , t ) { if ( e ) return a ( e ) ; o && t . sort ( ) ; for ( var d = 0 ; d < t . length ; d ++ ) n ( p . join ( r , l , t [ d ] ) ) || s . push ( p . join ( l , t [ d ] ) ) ; a ( null , l , c ) } ) : a ( null , l , c ) } ) } } , y = function ( e , t ) { return function ( r ) { r . name = r . name . split ( "/" ) . slice ( t ) . join ( "/" ) ; var n = r . linkname ; return n && ( "link" === r . type || p . isAbsolute ( n ) ) && ( r . linkname = n . split ( "/" ) . slice ( t ) . join ( "/" ) ) , e ( r ) } } ; t . pack = function ( e , t ) { e || ( e = "." ) , t || ( t = { } ) ; var r = t . fs || d , n = t . ignore || t . filter || m , a = t . map || m , o = t . mapStream || g , l = f ( r , t . dereference ? r . stat : r . lstat , e , n , t . entries , t . sort ) , c = ! 1 !== t . strict , u = "number" == typeof t . umask ? ~ t . umask : ~ x ( ) , b = "number" == typeof t . dmode ? t . dmode : 0 , S = "number" == typeof t . fmode ? t . fmode : 0 , v = t . pack || i . pack ( ) , k = t . finish || m ; t . strip && ( a = y ( a , t . strip ) ) , t . readable && ( b |= parseInt ( 555 , 8 ) , S |= parseInt ( 444 , 8 ) ) , t . writable && ( b |= parseInt ( 333 , 8 ) , S |= parseInt ( 222 , 8 ) ) ; var C = function ( t , n ) { r . readlink ( p . join ( e , t ) , function ( e , t ) { return e ? v . destroy ( e ) : void ( n . linkname = h ( t ) , v . entry ( n , w ) ) } ) } , _ = function ( n , i , l ) { if ( n ) return v . destroy ( n ) ; if ( ! i ) return ! 1 !== t . finalize && v . finalize ( ) , k ( v ) ; if ( l . isSocket ( ) ) return w ( ) ; var d = { name : h ( i ) , mode : ( l . mode | ( l . isDirectory ( ) ? b : S ) ) & u , mtime : l . mtime , size : l . size , type : "file" , uid : l . uid , gid : l . gid } ; if ( l . isDirectory ( ) ) return d . size = 0 , d . type = "directory" , d = a ( d ) || d , v . entry ( d , w ) ; if ( l . isSymbolicLink ( ) ) return d . size = 0 , d . type = "symlink" , d = a ( d ) || d , C ( i , d ) ; if ( d = a ( d ) || d , ! l . isFile ( ) ) return c ? v . destroy ( new Error ( "unsupported type for " + i ) ) : w ( ) ; var m = v . entry ( d , w ) ; if ( m ) { var g = o ( r . createReadStream ( p . join ( e , i ) , { start : 0 , end : 0 < d . size ? d . size - 1 : d . size } ) , d ) ; g . on ( "error" , function ( e ) { m . destroy ( e ) } ) , s ( g , m ) } } , w = function ( e ) { return e ? v . destroy ( e ) : void l ( _ ) } ; return w ( ) , v } ; var b = function ( e ) { return e . length ? e [ e . length - 1 ] : null } , S = function ( ) { return process . getuid ? process . getuid ( ) : - 1 } , x = function ( ) { return process . umask ? process . umask ( ) : 0 } ; t . extract = function ( e , t ) { e || ( e = "." ) , t || ( t = { } ) ; var r = t . fs || d , o = t . ignore || t . filter || m , l = t . map || m , c = t . mapStream || g , f = ! 1 !== t . chown && ! Line truncated