2025/2/8第一次更新

This commit is contained in:
爱吃咸鱼小猫咪
2025-02-08 18:50:38 +08:00
commit d7af560866
26519 changed files with 5046029 additions and 0 deletions
@@ -0,0 +1 @@
"use strict";const e=require("./wxDiscode.js"),t=require("./htmlparser.js");var r="",s="",n={};l("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");var a=l("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"),o=l("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),i=l("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");function l(e){for(var t={},r=e.split(","),s=0;s<r.length;s++)t[r[s]]=!0;return t}function c(e){var t=[];if(0==r.length||!n)return(c={node:"text"}).text=e,o=[c];e=e.replace(/\[([^\[\]]+)\]/g,":$1:");for(var a=new RegExp("[:]"),o=e.split(a),i=0;i<o.length;i++){var l=o[i],c={};n[l]?(c.node="element",c.tag="emoji",c.text=n[l],c.baseSrc=s):(c.node="text",c.text=l),t.push(c)}return t}l("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),l("wxxxcode-style,script,style,view,scroll-view,block");const d={html2json:function(r,s){r=function(e){return e.replace(/<!--.*?-->/gi,"").replace(/[ ]+</gi,"<")}(r=function(e){return e.replace(/\<head(.|\n)*<\/head\>/gi,"").replace(/\<title(.|\n)*<\/title\>/gi,"").replace(/\<script(.|\n)*<\/script\>/gi,"").replace(/\<meta(.|\n)*<\/meta\>/gi,"").replace(/\<style(.|\n)*<\/style\>/gm,"")}(r=function(e){return e.replace(/<\?xml.*\?>\n/,"").replace(/<.*!doctype.*\>\n/,"").replace(/<.*!DOCTYPE.*\>\n/,"")}(r))),r=e.wxDiscode.strDiscode(r);var n=[],l={node:s,nodes:[],images:[],imageUrls:[]},d=0;return t.HTMLParser(r,{start:function(t,r,c,p){var u,m={node:"element",tag:t};(p&&(m.content=p),0===n.length)?(m.index=d.toString(),d+=1):(void 0===(u=n[0]).nodes&&(u.nodes=[]),m.index=u.index+"."+u.nodes.length);if(a[t]?m.tagType="block":o[t]?m.tagType="inline":i[t]&&(m.tagType="closeSelf"),0!==r.length&&(m.attr=r.reduce((function(e,t){var r=t.name,s=t.value;return"class"==r&&(m.classStr=s),"style"==r&&(m.styleStr=s),s.match(/ /)&&(s=s.split(" ")),e[r]?Array.isArray(e[r])?e[r].push(s):e[r]=[e[r],s]:e[r]=s,e}),{})),"img"===m.tag){m.imgIndex=l.images.length;var g=m.attr.src;""==g[0]&&g.splice(0,1),g=e.wxDiscode.urlToHttpUrl(g,"https"),m.attr.src=g,m.from=s,l.images.push(m),l.imageUrls.push(g)}if("font"===m.tag){var f=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"],h={color:"color",face:"font-family",size:"font-size"};for(var x in m.attr.style||(m.attr.style=[]),m.styleStr||(m.styleStr=""),h)if(m.attr[x]){var v="size"===x?f[m.attr[x]-1]:m.attr[x];m.attr.style.push(h[x]),m.attr.style.push(v),m.styleStr+=h[x]+": "+v+";"}}("source"===m.tag&&(l.source=m.attr.src),c)?(void 0===(u=n[0]||l).nodes&&(u.nodes=[]),u.nodes.push(m)):n.unshift(m)},end:function(e){var t=n.shift();if(t.tag!==e&&console.error("invalid state: mismatch end tag"),"video"===t.tag&&l.source&&(t.attr.src=l.source,delete l.source),0===n.length)l.nodes.push(t);else{var r=n[0];void 0===r.nodes&&(r.nodes=[]),r.nodes.push(t)}},chars:function(e){var t={node:"text",text:e,textArray:c(e)};if(0===n.length)t.index=d.toString(),d+=1,l.nodes.push(t);else{var r=n[0];void 0===r.nodes&&(r.nodes=[]),t.index=r.index+"."+r.nodes.length,r.nodes.push(t)}},comment:function(e){}}),l},emojisInit:function(e="",t="/fuiParse/emojis/",a){r=e,s=t,n=a}};exports.HtmlToJson=d;
@@ -0,0 +1 @@
"use strict";var e=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,t=/^<\/([-A-Za-z0-9_]+)[^>]*>/,r=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,s=/^<code.*?>([\s\S]*?)<\/code>/,a=f("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"),i=f("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"),n=f("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),o=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),l=f("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),c=f("wxxxcode-style,script,style,view,scroll-view,block"),d="";function f(e){for(var t={},r=e.split(","),s=0;s<r.length;s++)t[r[s]]=!0;return t}exports.HTMLParser=function(f,p){var u,h,m,b=[],g=f;for(b.last=function(){return this[this.length-1]};f;){if(h=!0,b.last()&&c[b.last()])f=f.replace(new RegExp("([\\s\\S]*?)</"+b.last()+"[^>]*>"),(function(e,t){return t=t.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),p.chars&&""!==t.trim()&&p.chars(t),""})),k("",b.last());else{if(0==f.indexOf("\x3c!--"))(u=f.indexOf("--\x3e"))>=0&&(p.comment&&p.comment(f.substring(4,u)),f=f.substring(u+3),h=!1);else if(0==f.indexOf("</"))(m=f.match(t))&&(f=f.substring(m[0].length),m[0].replace(t,k),h=!1);else if(0==f.indexOf("<")&&(m=f.match(e))){if("code"===m[1]){var v=f.match(s);d=v[1]||""}f=f.substring(m[0].length),m[0].replace(e,w),h=!1}if(h){u=f.indexOf("<");for(var x="";0===u;)x+="<",u=(f=f.substring(1)).indexOf("<");x+=u<0?f:f.substring(0,u),f=u<0?"":f.substring(u),p.chars&&""!==x.trim()&&p.chars(x)}}if(f==g)throw"Parse Error: "+f;g=f}function w(e,t,s,c){if(t=t.toLowerCase(),i[t])for(;b.last()&&n[b.last()];)k("",b.last());if(o[t]&&b.last()==t&&k("",t),(c=a[t]||!!c)||b.push(t),p.start){var f=[];if(s.replace(r,(function(e,t){var r=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:l[t]?t:"";f.push({name:t,value:r,escaped:r.replace(/(^|[^\\])"/g,'$1\\"')})})),p.start){var u=d||"";p.start(t,f,c,u),d=""}}}function k(e,t){if(t){t=t.toLowerCase();for(r=b.length-1;r>=0&&b[r]!=t;r--);}else var r=0;if(r>=0){for(var s=b.length-1;s>=r;s--)p.end&&p.end(b[s]);b.length=r}}k()};
@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js");let t=0,n=0;e.index.getSystemInfo({success(e){t=e.windowWidth,n=e.windowHeight}});const s={getSystemInfo:()=>[t,n],cacheInstance:(()=>{let e={};return{set:(t,n=null)=>(e[t]||(e[t]=n),e[t]||{}),get:t=>e[t]||{},clear:()=>{e={}},remove:t=>{e[t]&&delete e[t]}}})()};exports.util=s;
@@ -0,0 +1 @@
"use strict";const e={strDiscode:function(e){return e=function(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/&OElig;/g,"Œ")).replace(/&oelig;/g,"œ")).replace(/&Scaron;/g,"Š")).replace(/&scaron;/g,"š")).replace(/&Yuml;/g,"Ÿ")).replace(/&fnof;/g,"ƒ")).replace(/&circ;/g,"ˆ")).replace(/&tilde;/g,"˜")).replace(/&ensp;/g,"")).replace(/&emsp;/g,"")).replace(/&thinsp;/g,"")).replace(/&zwnj;/g,"")).replace(/&zwj;/g,"")).replace(/&lrm;/g,"")).replace(/&rlm;/g,"")).replace(/&ndash;/g,"")).replace(/&mdash;/g,"—")).replace(/&lsquo;/g,"")).replace(/&rsquo;/g,"")).replace(/&sbquo;/g,"")).replace(/&ldquo;/g,"“")).replace(/&rdquo;/g,"”")).replace(/&bdquo;/g,"„")).replace(/&dagger;/g,"†")).replace(/&Dagger;/g,"‡")).replace(/&bull;/g,"•")).replace(/&hellip;/g,"…")).replace(/&permil;/g,"‰")).replace(/&prime;/g,"")).replace(/&Prime;/g,"″")).replace(/&lsaquo;/g,"")).replace(/&rsaquo;/g,"")).replace(/&oline;/g,"‾")).replace(/&euro;/g,"€")).replace(/&trade;/g,"™")).replace(/&larr;/g,"←")).replace(/&uarr;/g,"↑")).replace(/&rarr;/g,"→")).replace(/&darr;/g,"↓")).replace(/&harr;/g,"↔")).replace(/&crarr;/g,"↵")).replace(/&lceil;/g,"⌈")).replace(/&rceil;/g,"⌉")).replace(/&lfloor;/g,"⌊")).replace(/&rfloor;/g,"⌋")).replace(/&loz;/g,"◊")).replace(/&spades;/g,"♠")).replace(/&clubs;/g,"♣")).replace(/&hearts;/g,"♥")).replace(/&diams;/g,"♦")).replace(/&#39;/g,"'")}(e=function(e){return(e=(e=(e=(e=(e=e.replace(/&nbsp;/g," ")).replace(/&quot;/g,"'")).replace(/&amp;/g,"&")).replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/&#8226;/g,"•")}(e=function(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/&Alpha;/g,"Α")).replace(/&Beta;/g,"Β")).replace(/&Gamma;/g,"Γ")).replace(/&Delta;/g,"Δ")).replace(/&Epsilon;/g,"Ε")).replace(/&Zeta;/g,"Ζ")).replace(/&Eta;/g,"Η")).replace(/&Theta;/g,"Θ")).replace(/&Iota;/g,"Ι")).replace(/&Kappa;/g,"Κ")).replace(/&Lambda;/g,"Λ")).replace(/&Mu;/g,"Μ")).replace(/&Nu;/g,"Ν")).replace(/&Xi;/g,"Ν")).replace(/&Omicron;/g,"Ο")).replace(/&Pi;/g,"Π")).replace(/&Rho;/g,"Ρ")).replace(/&Sigma;/g,"Σ")).replace(/&Tau;/g,"Τ")).replace(/&Upsilon;/g,"Υ")).replace(/&Phi;/g,"Φ")).replace(/&Chi;/g,"Χ")).replace(/&Psi;/g,"Ψ")).replace(/&Omega;/g,"Ω")).replace(/&alpha;/g,"α")).replace(/&beta;/g,"β")).replace(/&gamma;/g,"γ")).replace(/&delta;/g,"δ")).replace(/&epsilon;/g,"ε")).replace(/&zeta;/g,"ζ")).replace(/&eta;/g,"η")).replace(/&theta;/g,"θ")).replace(/&iota;/g,"ι")).replace(/&kappa;/g,"κ")).replace(/&lambda;/g,"λ")).replace(/&mu;/g,"μ")).replace(/&nu;/g,"ν")).replace(/&xi;/g,"ξ")).replace(/&omicron;/g,"ο")).replace(/&pi;/g,"π")).replace(/&rho;/g,"ρ")).replace(/&sigmaf;/g,"ς")).replace(/&sigma;/g,"σ")).replace(/&tau;/g,"τ")).replace(/&upsilon;/g,"υ")).replace(/&phi;/g,"φ")).replace(/&chi;/g,"χ")).replace(/&psi;/g,"ψ")).replace(/&omega;/g,"ω")).replace(/&thetasym;/g,"ϑ")).replace(/&upsih;/g,"ϒ")).replace(/&piv;/g,"ϖ")).replace(/&middot;/g,"·")}(e=function(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/&forall;/g,"∀")).replace(/&part;/g,"∂")).replace(/&exists;/g,"∃")).replace(/&empty;/g,"∅")).replace(/&nabla;/g,"∇")).replace(/&isin;/g,"∈")).replace(/&notin;/g,"∉")).replace(/&ni;/g,"∋")).replace(/&prod;/g,"∏")).replace(/&sum;/g,"∑")).replace(/&minus;/g,"")).replace(/&lowast;/g,"")).replace(/&radic;/g,"√")).replace(/&prop;/g,"∝")).replace(/&infin;/g,"∞")).replace(/&ang;/g,"∠")).replace(/&and;/g,"∧")).replace(/&or;/g,"")).replace(/&cap;/g,"∩")).replace(/&cap;/g,"")).replace(/&int;/g,"∫")).replace(/&there4;/g,"∴")).replace(/&sim;/g,"")).replace(/&cong;/g,"≅")).replace(/&asymp;/g,"≈")).replace(/&ne;/g,"≠")).replace(/&le;/g,"≤")).replace(/&ge;/g,"≥")).replace(/&sub;/g,"⊂")).replace(/&sup;/g,"⊃")).replace(/&nsub;/g,"⊄")).replace(/&sube;/g,"⊆")).replace(/&supe;/g,"⊇")).replace(/&oplus;/g,"⊕")).replace(/&otimes;/g,"⊗")).replace(/&perp;/g,"⊥")).replace(/&sdot;/g,"⋅")}(e))))},urlToHttpUrl:function(e,a){return new RegExp("^//").test(e)&&(e=a+":"+e),e}};exports.wxDiscode=e;