-
Notifications
You must be signed in to change notification settings - Fork 177
/
jsxcompressor.js
1 lines (1 loc) · 12.2 KB
/
jsxcompressor.js
1
!function(){var e,r,n;!function(t){function o(e,r){return y.call(e,r)}function i(e,r){var n,t,o,i,u,f,a,c,s,l,d=r&&r.split("/"),p=k.map,g=p&&p["*"]||{};if(e&&"."===e.charAt(0))if(r){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),c=0;c<e.length;c+=1)if(l=e[c],"."===l)e.splice(c,1),c-=1;else if(".."===l){if(1===c&&(".."===e[2]||".."===e[0]))break;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||g)&&p){for(n=e.split("/"),c=n.length;c>0;c-=1){if(t=n.slice(0,c).join("/"),d)for(s=d.length;s>0;s-=1)if(o=p[d.slice(0,s).join("/")],o&&(o=o[t])){i=o,u=c;break}if(i)break;!f&&g&&g[t]&&(f=g[t],a=c)}!i&&f&&(i=f,u=a),i&&(n.splice(0,u,i),e=n.join("/"))}return e}function u(e,r){return function(){return p.apply(t,v.call(arguments,0).concat([e,r]))}}function f(e){return function(r){return i(r,e)}}function a(e){return function(r){b[e]=r}}function c(e){if(o(m,e)){var r=m[e];delete m[e],C[e]=!0,d.apply(t,r)}if(!o(b,e)&&!o(C,e))throw new Error("No "+e);return b[e]}function s(e){var r,n=e?e.indexOf("!"):-1;return n>-1&&(r=e.substring(0,n),e=e.substring(n+1,e.length)),[r,e]}function l(e){return function(){return k&&k.config&&k.config[e]||{}}}var d,p,g,h,b={},m={},k={},C={},y=Object.prototype.hasOwnProperty,v=[].slice;g=function(e,r){var n,t=s(e),o=t[0];return e=t[1],o&&(o=i(o,r),n=c(o)),o?e=n&&n.normalize?n.normalize(e,f(r)):i(e,r):(e=i(e,r),t=s(e),o=t[0],e=t[1],o&&(n=c(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},h={require:function(e){return u(e)},exports:function(e){var r=b[e];return"undefined"!=typeof r?r:b[e]={}},module:function(e){return{id:e,uri:"",exports:b[e],config:l(e)}}},d=function(e,r,n,i){var f,s,l,d,p,k,y=[];if(i=i||e,"function"==typeof n){for(r=!r.length&&n.length?["require","exports","module"]:r,p=0;p<r.length;p+=1)if(d=g(r[p],i),s=d.f,"require"===s)y[p]=h.require(e);else if("exports"===s)y[p]=h.exports(e),k=!0;else if("module"===s)f=y[p]=h.module(e);else if(o(b,s)||o(m,s)||o(C,s))y[p]=c(s);else{if(!d.p)throw new Error(e+" missing "+s);d.p.load(d.n,u(i,!0),a(s),{}),y[p]=b[s]}l=n.apply(b[e],y),e&&(f&&f.exports!==t&&f.exports!==b[e]?b[e]=f.exports:l===t&&k||(b[e]=l))}else e&&(b[e]=n)},e=r=p=function(e,r,n,o,i){return"string"==typeof e?h[e]?h[e](r):c(g(e,r).f):(e.splice||(k=e,r.splice?(e=r,r=n,n=null):e=t),r=r||function(){},"function"==typeof n&&(n=o,o=i),o?d(t,e,r,n):setTimeout(function(){d(t,e,r,n)},4),p)},p.config=function(e){return k=e,k.deps&&p(k.deps,k.callback),p},n=function(e,r,n){r.splice||(n=r,r=[]),o(b,e)||o(m,e)||(m[e]=[e,r,n])},n.amd={jQuery:!0}}(),n("../node_modules/almond/almond",function(){}),n("jxg",[],function(){var e={};return"object"!=typeof JXG||JXG.extend||(e=JXG),e.extend=function(e,r,n,t){var o,i;n=n||!1,t=t||!1;for(o in r)(!n||n&&r.hasOwnProperty(o))&&(i=t?o.toLowerCase():o,e[i]=r[o])},e.extend(e,{boards:{},readers:{},elements:{},registerElement:function(e,r){e=e.toLowerCase(),this.elements[e]=r},registerReader:function(e,r){var n,t;for(n=0;n<r.length;n++)t=r[n].toLowerCase(),"function"!=typeof this.readers[t]&&(this.readers[t]=e)},shortcut:function(e,r){return function(){return e[r].apply(this,arguments)}},getRef:function(e,r){return e.select(r)},getReference:function(e,r){return e.select(r)},debugInt:function(){var e,r;for(e=0;e<arguments.length;e++)r=arguments[e],"object"==typeof window&&window.console&&console.log?console.log(r):"object"==typeof document&&document.getElementById("debug")&&(document.getElementById("debug").innerHTML+=r+"<br/>")},debugWST:function(){var r=new Error;e.debugInt.apply(this,arguments),r&&r.stack&&(e.debugInt("stacktrace"),e.debugInt(r.stack.split("\n").slice(1).join("\n")))},debugLine:function(){var r=new Error;e.debugInt.apply(this,arguments),r&&r.stack&&e.debugInt("Called from",r.stack.split("\n").slice(2,3).join("\n"))},debug:function(){e.debugInt.apply(this,arguments)}}),e}),n("utils/zip",["jxg"],function(e){var r=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255],n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],t=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],i=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=256;return e.Util=e.Util||{},e.Util.Unzip=function(a){function c(){return q+=8,N>R?a[R++]:-1}function s(){T=1}function l(){var e;return q++,e=1&T,T>>=1,0===T&&(T=c(),e=1&T,T=128|T>>1),e}function d(e){for(var n=0,t=e;t--;)n=n<<1|l();return e&&(n=r[n]>>8-e),n}function p(){L=0}function g(e){w++,E[L++]=e,S.push(String.fromCharCode(e)),32768===L&&(L=0)}function h(){this.b0=0,this.b1=0,this.jump=null,this.jumppos=-1}function b(){for(;;){if(H[P]>=U)return-1;if(x[H[P]]===P)return H[P]++;H[P]++}}function m(){var e,r=F[X];if(17===P)return-1;if(X++,P++,e=b(),e>=0)r.b0=e;else if(r.b0=32768,m())return-1;if(e=b(),e>=0)r.b1=e,r.jump=null;else if(r.b1=32768,r.jump=F[X],r.jumppos=X,m())return-1;return P--,0}function k(e,r,n){var t;for(F=e,X=0,x=n,U=r,t=0;17>t;t++)H[t]=0;return P=0,m()?-1:0}function C(e){for(var r,n,t,o=0,i=e[o];;)if(t=l()){if(!(32768&i.b1))return i.b1;for(i=i.jump,r=e.length,n=0;r>n;n++)if(e[n]===i){o=n;break}}else{if(!(32768&i.b0))return i.b0;o++,i=e[o]}}function y(){var f,a,b,m,y,v,j,w,A,x,U,z,S,I,O,B,N;do if(f=l(),b=d(2),0===b)for(s(),x=c(),x|=c()<<8,z=c(),z|=c()<<8,65535&(x^~z)&&e.debug("BlockLen checksum mismatch\n");x--;)a=c(),g(a);else if(1===b)for(;;)if(y=r[d(7)]>>1,y>23?(y=y<<1|l(),y>199?(y-=128,y=y<<1|l()):(y-=48,y>143&&(y+=136))):y+=256,256>y)g(y);else{if(256===y)break;for(y-=257,A=d(t[y])+n[y],y=r[d(5)]>>3,i[y]>8?(U=d(8),U|=d(i[y]-8)<<8):U=d(i[y]),U+=o[y],y=0;A>y;y++)a=E[32767&L-U],g(a)}else if(2===b){for(j=new Array(320),I=257+d(5),O=1+d(5),B=4+d(4),y=0;19>y;y++)j[y]=0;for(y=0;B>y;y++)j[u[y]]=d(3);for(A=J.length,m=0;A>m;m++)J[m]=new h;if(k(J,19,j,0))return p(),1;for(S=I+O,m=0,N=-1;S>m;)if(N++,y=C(J),16>y)j[m++]=y;else if(16===y){if(y=3+d(2),m+y>S)return p(),1;for(v=m?j[m-1]:0;y--;)j[m++]=v}else{if(y=17===y?3+d(3):11+d(7),m+y>S)return p(),1;for(;y--;)j[m++]=0}for(A=G.length,m=0;A>m;m++)G[m]=new h;if(k(G,I,j,0))return p(),1;for(A=G.length,m=0;A>m;m++)J[m]=new h;for(w=[],m=I;m<j.length;m++)w[m-I]=j[m];if(k(J,O,w,0))return p(),1;for(;;)if(y=C(G),y>=256){if(y-=256,0===y)break;for(y-=1,A=d(t[y])+n[y],y=C(J),i[y]>8?(U=d(8),U|=d(i[y]-8)<<8):U=d(i[y]),U+=o[y];A--;)a=E[32767&L-U],g(a)}else g(y)}while(!f);return p(),s(),0}function v(){var e,r,n,t,o,i,u,a,s=[];if(S=[],B=!1,s[0]=c(),s[1]=c(),120===s[0]&&218===s[1]&&(y(),O[I]=[S.join(""),"geonext.gxt"],I++),31===s[0]&&139===s[1]&&(z(),O[I]=[S.join(""),"file"],I++),80===s[0]&&75===s[1]&&(B=!0,s[2]=c(),s[3]=c(),3===s[2]&&4===s[3])){for(s[0]=c(),s[1]=c(),j=c(),j|=c()<<8,a=c(),a|=c()<<8,c(),c(),c(),c(),u=c(),u|=c()<<8,u|=c()<<16,u|=c()<<24,i=c(),i|=c()<<8,i|=c()<<16,i|=c()<<24,o=c(),o|=c()<<8,o|=c()<<16,o|=c()<<24,t=c(),t|=c()<<8,n=c(),n|=c()<<8,e=0,M=[];t--;)r=c(),"/"===r|":"===r?e=0:f-1>e&&(M[e++]=String.fromCharCode(r));for(A||(A=M),e=0;n>e;)r=c(),e++;w=0,8===a&&(y(),O[I]=new Array(2),O[I][0]=S.join(""),O[I][1]=M.join(""),I++),z()}}var j,w,A,x,U,z,S=[],I=0,O=[],E=new Array(32768),L=0,B=!1,N=a.length,R=0,T=1,q=0,G=new Array(288),J=new Array(32),X=0,F=null,P=(new Array(64),new Array(64),0),H=new Array(17),M=[];H[0]=0,z=function(){var e,r,n,t,o,i,u=[];if(8&j&&(u[0]=c(),u[1]=c(),u[2]=c(),u[3]=c(),80===u[0]&&75===u[1]&&7===u[2]&&8===u[3]?(e=c(),e|=c()<<8,e|=c()<<16,e|=c()<<24):e=u[0]|u[1]<<8|u[2]<<16|u[3]<<24,r=c(),r|=c()<<8,r|=c()<<16,r|=c()<<24,n=c(),n|=c()<<8,n|=c()<<16,n|=c()<<24),B&&v(),u[0]=c(),8===u[0]){if(j=c(),c(),c(),c(),c(),c(),t=c(),4&j)for(u[0]=c(),u[2]=c(),P=u[0]+256*u[1],o=0;P>o;o++)c();if(8&j)for(o=0,M=[],i=c();i;)("7"===i||":"===i)&&(o=0),f-1>o&&(M[o++]=i),i=c();if(16&j)for(i=c();i;)i=c();2&j&&(c(),c()),y(),e=c(),e|=c()<<8,e|=c()<<16,e|=c()<<24,n=c(),n|=c()<<8,n|=c()<<16,n|=c()<<24,B&&v()}},e.Util.Unzip.prototype.unzipFile=function(e){var r;for(this.unzip(),r=0;r<O.length;r++)if(O[r][1]===e)return O[r][0];return""},e.Util.Unzip.prototype.unzip=function(){return v(),O}},e.Util}),n("utils/encoding",["jxg"],function(e){var r=0,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3,11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,0,12,24,36,60,96,84,12,12,12,48,72,12,12,12,12,12,12,12,12,12,12,12,12,12,0,12,12,12,12,12,0,12,0,12,12,12,24,12,12,12,12,12,24,12,24,12,12,12,12,12,12,12,12,12,24,12,12,12,12,12,24,12,12,12,12,12,12,12,24,12,12,12,12,12,12,12,12,12,36,12,36,12,12,12,36,12,12,12,12,12,36,12,36,12,12,12,36,12,12,12,12,12,12,12,12,12,12];return e.Util=e.Util||{},e.Util.UTF8={encode:function(e){var r,n,t="",o=e.length;if(e=e.replace(/\r\n/g,"\n"),"function"==typeof unescape&&"function"==typeof encodeURIComponent)return unescape(encodeURIComponent(e));for(r=0;o>r;r++)n=e.charCodeAt(r),128>n?t+=String.fromCharCode(n):n>127&&2048>n?(t+=String.fromCharCode(192|n>>6),t+=String.fromCharCode(128|63&n)):(t+=String.fromCharCode(224|n>>12),t+=String.fromCharCode(128|63&n>>6),t+=String.fromCharCode(128|63&n));return t},decode:function(e){var t,o,i,u=0,f=r,a=[],c=e.length;for(t=0;c>t;t++)o=e.charCodeAt(t),i=n[o],u=f!==r?63&o|u<<6:255>>i&o,f=n[256+f+i],f===r&&(u>65535?a.push(55232+(u>>10),56320+(1023&u)):a.push(u));return String.fromCharCode.apply(null,a)},asciiCharCodeAt:function(e,r){var n=e.charCodeAt(r);if(n>255)switch(n){case 8364:n=128;break;case 8218:n=130;break;case 402:n=131;break;case 8222:n=132;break;case 8230:n=133;break;case 8224:n=134;break;case 8225:n=135;break;case 710:n=136;break;case 8240:n=137;break;case 352:n=138;break;case 8249:n=139;break;case 338:n=140;break;case 381:n=142;break;case 8216:n=145;break;case 8217:n=146;break;case 8220:n=147;break;case 8221:n=148;break;case 8226:n=149;break;case 8211:n=150;break;case 8212:n=151;break;case 732:n=152;break;case 8482:n=153;break;case 353:n=154;break;case 8250:n=155;break;case 339:n=156;break;case 382:n=158;break;case 376:n=159}return n}},e.Util.UTF8}),n("utils/base64",["jxg","utils/encoding"],function(e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return e.Util=e.Util||{},e.Util.Base64={encode:function(e){var t,o,i,u,f,a,c,s=[],l=0;for(e=r.encode(e);l<e.length;)t=e.charCodeAt(l++),o=e.charCodeAt(l++),i=e.charCodeAt(l++),u=t>>2,f=(3&t)<<4|o>>4,a=(15&o)<<2|i>>6,c=63&i,isNaN(o)?a=c=64:isNaN(i)&&(c=64),s.push([n.charAt(u),n.charAt(f),n.charAt(a),n.charAt(c)].join(""));return s.join("")},decode:function(e,t){var o,i,u,f,a,c,s,l=[],d=0,p=e.length;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");p>d;)f=n.indexOf(e.charAt(d++)),a=n.indexOf(e.charAt(d++)),c=n.indexOf(e.charAt(d++)),s=n.indexOf(e.charAt(d++)),o=f<<2|a>>4,i=(15&a)<<4|c>>2,u=(3&c)<<6|s,l.push(String.fromCharCode(o)),64!==c&&l.push(String.fromCharCode(i)),64!==s&&l.push(String.fromCharCode(u));return l=l.join(""),t&&(l=r.decode(l)),l},decodeAsArray:function(e){var r,n=this.decode(e),t=[],o=n.length;for(r=0;o>r;r++)t[r]=n.charCodeAt(r);return t}},e.Util.Base64}),n("../build/compressor.deps.js",["jxg","utils/zip","utils/base64"],function(e,r,n){return e.decompress=function(e){return unescape(new r.Unzip(n.decodeAsArray(e)).unzip()[0][0])},e}),window.JXG=r("../build/compressor.deps.js")}();