bin.shen
2016-12-05 a4c9331bbfe3e8765ccdc1c54cc6931bac49cc82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
<?xml version="1.0"?>
<!-- Generated by Soya.IO.WSFFactory v0.95 [Tue, 28 Feb 2006 21:22:15 UTC] -->
<package>
<job>
<?job error="false" debug="false" ?>
<resource id="about">
-----------------------------------------------------------------------------
  ESC (ECMAScript Cruncher)
  * Version       : 1.14
  * Date          : 2006-02-28 22:22:15 [+0100]
  * License       : GNU GPL 2 (http://www.gnu.org/copyleft/gpl.txt)
  * Copyright (C) 2001-2006 Thomas Loo &lt;tloo@saltstorm.net&gt;
 
  ---------------------------------------------------------------------------
  ESC is an ECMAScript(*) pre-processor enabling an unlimited number of
  external scripts to be compressed/crunched into tight, bandwidth-optimized
  packages. ESC supports compressing of external sources only. Trying to
  process scripts inlined in HTML, ASP, PHP or equivalent pages are NOT
  recommended with this version of ESC. This feature might be added in a
  future version. Type "cscript ESC.wsf -help" for usage instructions.
 
  ESC is built using components from the Soya Scripting API 1.0.0-b10,
  a uni-host/cross-browser ECMAScript compliant class-library distributed
  freely under the terms of the BSD License. The Soya Scripting API,
  'lib-soya' and the Soya SDK can be found at http://www.saltstorm.net/
  ---------------------------------------------------------------------------
  * ECMAScript is the international standard for javascript.
-----------------------------------------------------------------------------
</resource>
 
<resource id="copyright">
-----------------------------------------------------------------------------
 
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  version 2 as published by the Free Software Foundation.
 
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
-----------------------------------------------------------------------------
 
</resource>
 
<resource id="usage">
------------------------------------------------------------------------------
 Usage: cscript ESC.wsf -l [0-4] -ow output.js foo.js bar.js C:\scripts\baz...
 -----------------------------------------------------------------------------
  -a  [-about]             : Description page
  -c  [-copyright]         : Copyright/license notice
  -e  [-example]           : Examples of usage
  -h  [-help]              : This help-screen
 -----------------------------------------------------------------------------
  -l  [-level]   [01(2)34] : [optional] Set crunch-level (4 sets -$ on)
  -s  [-silent]            : [optional] Run silent, nada stdout
  -v  [-verbose]           : [optional] Run in verbose mode
  -$                       : [optional] Activate variable-substitution engine
 -----------------------------------------------------------------------------
  -oa &lt;filename&gt;           : Target filename for appending
  -ow &lt;filename&gt;           : Target filename for writing
  -ow STDOUT               : Write stream to STDOUT
 -----------------------------------------------------------------------------
 &lt;input-file(s)&gt;           : [required]
  file(s) and/or directories containing scripts to crunch...
  (paths containing spaces must be quoted)
</resource>
 
<resource id="example">
-----------------------------------------------------------------------------
 Examples of usage.
 
  Crunch 'original1.js','original2.js' and 'original3.js' at
  level 2 (default) and save the output as 'crunched.js'.
  Any previous file named 'crunched.js' will be overwritten.
   X:\cscript ESC.wsf -ow crunched.js original1.js original2.js original3.js
  ---------------------------------------------------------------------------
 
  Grab all scriptfiles (.js) in directory 'C:\script-directory' and crunch
  them at level 1 (comment and empty line removal only) and append the result
  to 'crunched.js'. If 'crunched.js' doesn't exist, it will be created.
   X:\cscript ESC.wsf -l 1 -oa crunched.js C:\script-directory
  ---------------------------------------------------------------------------
 
  Subject 'original1.js' and 'original2.js' for variable substitution,
  but perform no comment or whitespace removal.
  Redirect output to STDOUT instead of writing to file.
   X:\cscript ESC.wsf -l 0 -$ -ow STDOUT original1.js original2.js
  ---------------------------------------------------------------------------
 
  Crunch 'original.js' using variable substitution and remove
  any occurance of whitespace (where permitted...)
  and save it as 'crunched.js' (equals -l 3 -$)
   X:\cscript ESC.wsf -l 4 -ow crunched.js original.js
  ---------------------------------------------------------------------------
 
 Try 'ESC.wsf -help' for information about available run-time directives.
-----------------------------------------------------------------------------
</resource>
 
<resource id="wscript">
ESC must be run from a DOS command prompt under    
cscript.exe. Do you want to switch host and have
ESC bring up a helpscreen ?
 
</resource>
 
<resource id="jscript">
ESC needs JScript 5.5 or higher to score...
You need to update your version of JScript to run ESC.
Read the 'Requirements' section in the manual for information
how to obtain and install the latest version of Microsofts
'Windows Script' package.
 
</resource>
 
<resource id="common.map">
 
Anchor
ActiveXObject
Call
Closure
Components
Dictionary
Document
DOMParser
Embed
EvalError
Event
Form
Global
HttpCookie
Image
JavaArray
JavaClass
JavaMethod
JavaObject
JavaPackage
Layer
MimeType
MimeTypeArray
Option
Url
Packages
Plugin
PluginArray
Popup
RangeError
ReferenceError
TypeError
StyleClass
StyleSelector
SyntaxError
TypeError
WScript
URIError
XMLHttpRequest
XMLSerializer
XPathEvaluator
XSLTDocument
XSLTProcessor
Attr
CDATASection
CharacterData
Comment
CSS2Properties
DOMException
DOMImplementation
DocumentType
Element
EntityReference
EvalError
NamedNodeMap
Node
NodeList
Notation
ProcessingInstruction
Text
HTMLElement
HTMLDocument
HTMLCollection
HTMLHtmlElement
HTMLHeadElement
HTMLLinkElement
HTMLTitleElement
HTMLMetaElement
HTMLBaseElement
HTMLIsIndexElement
HTMLStyleElement
HTMLBodyElement
HTMLFormElement
HTMLSelectElement
HTMLOptGroupElement
HTMLOptionElement
HTMLInputElement
HTMLTextAreaElement
HTMLButtonElement
HTMLLabelElement
HTMLFieldSetElement
HTMLLegendElement
HTMLUListElement
HTMLOListElement 
HTMLDListElement
HTMLDirectoryElement
HTMLMenuElement
HTMLLIElement
HTMLBlockquoteElement 
HTMLDivElement
HTMLParagraphElement
HTMLHeadingElement
HTMLQuoteElement
HTMLPreElement
HTMLBRElement
HTMLBaseFontElement 
HTMLFontElement
HTMLHRElement
HTMLModElement 
HTMLAnchorElement
HTMLImageElement
HTMLObjectElement
HTMLParamElement
HTMLAppletElement
HTMLMapElement
HTMLAreaElement
HTMLScriptElement
HTMLTableElement
HTMLTableCaptionElement
HTMLTableColElement
HTMLTableSectionElement
HTMLTableRowElement
HTMLTableCellElement
HTMLFrameSetElement
HTMLFrameElement
HTMLIFrameElement
_newEnum
alert
atob
attachEvent
back
btoa
captureEvents
clearTimeout
clearInterval
close
CollectGarbage
confirm
createEventObject 
createPopup
decodeURI
decodeURIComponent
detachEvent
dump
encodeURI
encodeURIComponent
escape
eval
execScript
find
forward
frameElement
getAttention
GetAttention
getClass
getComputedStyle
getResource
GetObject
home
isFinite
isNaN
moveBy
moveTo
open
openDialog
parseInt
parseFloat
print
prompt
releaseEvents
resizeBy
resizeTo
ScriptEngine
ScriptEngineMajorVersion
ScriptEngineMinorVersion
ScriptEngineBuildVersion    
scroll
scrollBy
scrollByLines
scrollByPages
scrollIntoView
scrollTo
setCursor
setInterval
setTimeout
showHelp
showModalDialog
showModelessDialog
sizeToContent
stop
taint
toString
updateCommands
unescape
untaint
valueOf
_content
appCore
arguments
arity
callee
caller
clientInformation
clipboardData
closed
constructor
controllers
crypto
debug
defaultStatus
directories
document
element
event
external
history
forward
frames
Infinity
innerHeight
innerWidth
java
length
loading
location
locationbar
name
menubar
navigator
netscape
offscreenBuffering
opener
opera
outerHeight
outerWidth
pageXOffset
pageYOffset
parent
personalbar
pkcs11
prompter
prototype
returnValue
screen
screenLeft
screenTop
screenX
screenY
scrollX
scrollY
scrollbars
self
sidebar
status
statusbar
style
sun
title
toolbar
top
window
onafterprint
onbeforeprint
onbeforeunload
onblur
onchange
onclick
onclose
onerror
onfocus
onhelp
onload
onresize
onreset
onscroll
onselect
onunload
onmousedown
onmouseup
onmouseover
onmouseout
onkeydown
onkeyup
onkeypress
onmousemove
onsubmit
onreset
onchange
onselect
onclose
onabort
onerror
onpaint
ondragdrop
Soya
BOOTSTRAP
</resource>
 
<resource id="core.map">
 
abstract
break
continue
const
class
catch
case
debugger
default
double
delete
do
enum
extends
else
function
finally
float
false
for
get
instanceof
implements
import
int
in
if
long
null
new
protected
private
package
public
return
switch
static
super
set
typeof
throw
true
this
try
undefined
void
var
while
with
getter
setter
__defineGetter__
__defineSetter__
end
elif 
cc_on 
_win32
_win16
_mac
_alpha
_x86
_mc680x0
_PowerPC
_jscript
_jscript_build
_jscript_version
Array
Boolean
Date
Enumerator
Error
Function
Math
Number
Object
RegExp
String
VBArray
 
</resource>
 
<script language="JScript">
<![CDATA[
/*** <POD [ESCtool] (Soya/1.0.0-b10; crlvl:2/1; Tue, 28 Feb 2006 21:22:16 UTC)> ***/
/**
Proving that ESC actually can handle name-mangling and as a general self-sanity
 check, ESC has been used to compress itself along with other required Soya-beans
 while creating the package you see below. To examine these beans in a more human
 readable form, get the latest distribution of the Soya API.
**/
function Soya_API($h)
{
this.name='Soya';
this.version='1.0.0-b10';
this.type='static';
this.debug=0;
this.host=$h;
this.libPath='/lib-soya/';
this.podPath='pods';
this.resourcePath='resources';
this.attachBean=$a;
this.declareBean=$b;
this.registerBean=$c;
this.BeanPrototype=Soya_BeanPrototype;
this.beans=new Object();
this.beans.all=new Array();
Soya_Loader.prototype=new this.BeanPrototype();
this.Loader=new Object();
this.Loader.orphans=new Array();
this.Loader.callbacks=new Object();
this.declareBean('Soya.BeanPrototype',null,this.name,false,true);
}
function Soya_VirtualBean(){}
function Soya_BeanPrototype(){
this.name='Soya.BeanPrototype';
}
function $a($i){
if(!$i.virtual){
eval($i.mutexName).prototype=$i;
eval($i.name+'='+(!$i.constructable?'new ':' ')+
$i.mutexName+(!$i.constructable?'()':''));
}
else eval($i.name+'=this.beans["'+$i.name+'"]');
$i.complete=true;
if(this.Loader&&this.Loader.callbacks[$i.name])
this.Loader.callbacks[$i.name](eval($i.name));
}
function $b($j,$k,$l,$m,$n){
var $o=$k?new this.BeanPrototype():new Soya_VirtualBean();
$o.name=$j;
$o.mutexName=$k||'Soya_VirtualBean';
$o.parentName=$l;
$o.iid=0;
$o.stack=new Array();
$o.complete=Boolean($n);
$o.constructable=($k&&!$m);
$o.virtual=!$k;
return(this.beans[$j]=this.beans.all[this.beans.all.length]=$o);
}
function $c($j,$m,$p,i){
var $q;
var $r=$j.split('\x2e');
var $k=$r.join('\x5f');
if(!this.beans[$j]){
if($p){
var $s='';
$q=$r[0];
for(i=1;i<$r.length-1;i++){
$s+=$q;
$q+=('\x2e'+$r[i]);
if(i<=$p&&!this.beans[$q])
this.attachBean(this.declareBean($q,null,$s,true,true));
}
}
$r.length-=$p?$p:1;
$q=$r.join('\x2e');
this.declareBean($j,$k,$q,$m);
if($r.length>1&&!this.beans[$q])
this.Loader.orphans[this.Loader.orphans.length]=this.beans[$j];
else{
this.attachBean(this.beans[$j]);
var $t=new Array();
for(i=0;i<this.Loader.orphans.length;i++)
if(this.Loader.orphans[i].parentName==$j)
this.attachBean(this.Loader.orphans[i]);
else $t[$t.length]=this.Loader.orphans[i];
this.Loader.orphans=$t;
}
}
return Boolean(i)
}
function $d($u){
this.getResourcePath=Function('sName',
"return(Soya.libPath + Soya.resourcePath + '/' + (sName||this.name).split('.').join('/') + '/')");
this.getClass=Function('sName','return eval(Soya.beans[sName || this.name].mutexName)');
this.toString=Function("return('[object ' + (this.name || 'noname') + ']')");
this.getBeanPath=Function('sName',
"return(Soya.libPath + (sName||this.name).split('.').join('/') + '.js')");
this.type='static';
if(!$u){
this.finalize=$f;
this.initialize=$e;
}
}
function $e($v){
this.iid=this.getClass().prototype.iid++;
if(this.stackable)
this.stack[this.iid]=this;
if(!Soya.beans[this.name].initialized){
$v=$v||
Soya.host[Soya.beans[this.name].mutexName+'_initialize'];
if(typeof($v)=='function')
Soya.beans[this.name].initialized=!$v(this.getClass(),this);
}
}
function $f($w){
$w=$w||
Soya.host[Soya.beans[this.name].mutexName+'_finalize'];
if(typeof($w)=='function')
$w(this.getClass(),this);
}
function Soya_Loader(){};
function $g($x,$y,$z){
if(!Soya.fso)
Soya.fso=new ActiveXObject('Scripting.FilesystemObject');
if(Soya.fso.FileExists($x)){
var $i=Soya.fso.GetFile($x),
$A=Soya.fso.OpenTextFile($i.Path),
$B=$A.Read($z||$i.Size);
$A.Close();
return $B;
}
else if(!$y)
return(WScript.Echo(this.name+' '+Soya.version+
'> File Not found: '+$x),WScript.Quit(99));
else return '';
}
Soya_BeanPrototype.prototype=new $d(0);
Soya_VirtualBean.prototype=new $d(1);
Soya_API.prototype=new $d(1);
var Soya=new Soya_API(this);
if(typeof(BOOTSTRAP)=='function')BOOTSTRAP(Soya);
function Soya_Common()
{
this.name='Soya.Common';
this.type='static';
this.version='1.03';
this.dependencies=[];
this.destroy=$E;
this.makeFunction=$G;
this.typematch=$F;
this.getObject=$C;
this.$ih=$H;
Function.prototype.getArguments=$D;
Soya.BeanPrototype.prototype.Extends=
Function('oBean','bOvr','Soya.Common.$ih(oBean, this, bOvr)');
Soya.BeanPrototype.prototype.Implements=
Function('oBean','bOvr','Soya.Common.$ih(this, oBean, bOvr)');
this.interfaces=new Object();
this.interfaces['Scripting.FilesystemObject']=Soya.fso;
}
function $C($I,$J){
if(typeof(this.interfaces[$I])=='undefined'){
if(typeof ActiveXObject=='function'){
Soya.host.msieax=null;
if(typeof Error=='function')
eval('try{Soya.host.msieax=new ActiveXObject("'+$I+'")}catch(e){}');
else{
var $K=String("on error resume next\nself.msieax=CreateObject('"+$I+"'))");
self.execScript($K,'vbscript');
}
if(!$J)
return Soya.host.msieax;
this.interfaces[$I]=Soya.host.msieax;
}
}
return this.interfaces[$I]||void(0);
}
function $D($L){
var $M=[],
$N=(isNaN($L)||$L<1)?
0:Math.min($L,this.arguments.length);
for(;$N<this.arguments.length;$N++)
$M[$M.length]=this.arguments[$N];
return $M;
}
function $E($O){
if($O!=null&&typeof($O)=='object')
for(var $P in $O){
if(typeof($O[$P])=='object'&&$O[$P])
if($O[$P].constructor&&!$O[$P].style){
this.destroy($O[$P]);
delete($O[$P]);
}
else $O[$P]=null;
}
}
function $F($Q,$R){
var $S;
switch(typeof($Q)){
case 'number':$S=2;break;
case 'boolean':$S=4;break;
case 'string':$S=8;break;
case 'function':$S=16;break;
case 'object':$S=32;break;
default:$S=1;break;
}
return Boolean($S&($R||62));
}
function $G($T){
if($T&&this.typematch($T,16))
return $T;
else return Function(($T&&this.typematch($T,8))?$T:'');
}
function $H($U,$V,$W){
for(var $P in $U)
if($P!='name'&&(!$W||typeof($V[$P])=='undefined'))
$V[$P]=$U[$P];
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.Common',true);
function Soya_WSH()
{
this.name='Soya.WSH';
this.type='static';
this.version='0.88';
this.dependencies=['Soya.Common','Soya.WSH.Registry'];
this.osInfo={};
this.arguments={length:0};
this.$09=function($00)
{return $00.length<2?$00:$00.replace(/^\\-/,'-').replace(/\\{2}/g,'\\')};
this.getArgument=function($01){return(this.arguments[$01]||"")}
this.getArguments=$X;
this.getOSInfo=$Z;
this.getShell=$Y;
}
function $X(){
if(!this.arguments.length&&WScript.Arguments.length){
var i,$02,$03=[],$04=new RegExp('^-+');
for(i=0;i<WScript.Arguments.length;i++)
$03[$03.length]=WScript.Arguments.item(i);
for(i=0;i<$03.length;i++){
$02=$03[i].replace($04,'-');
if($02.length>1&&$04.test($02)){
if(typeof $03[i+1]!='undefined'&&!$04.test($03[i+1]))
this.arguments[this.$09($02.replace($04,''))]=
this.$09($03[1+(i++)]);
else this.arguments[this.$09($02.replace($04,''))]=1;
};
else if($02.length)
this.arguments[this.arguments.length++]=this.$09($03[i]);
}
}
return this.arguments;
}
function $Y(){
if(!this.shell)
this.shell=Soya.Common.getObject('WScript.Shell');
return this.shell;
}
function $Z(){
if(this.osInfo.$0a)
return this.osInfo;
var $05=Soya.Common.getObject('Scripting.FilesystemObject'),
$06=this.getShell().ExpandEnvironmentStrings("%SYSTEMROOT%");
this.osInfo.MSIEVersion=Soya.WSH.Registry.regRead('HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Version');
this.osInfo.NETVersion=Soya.WSH.Registry.regRead('HKLM\SOFTWARE\Microsoft\.NETFramework\\Version')||-1;
this.osInfo.SPVersion=Soya.WSH.Registry.regRead('HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CSDVersion')||-1;
this.osInfo.JSVersion=parseFloat(ScriptEngineMajorVersion()+'.'+ScriptEngineMinorVersion());
if($05.FolderExists($06+'\\system32'))
$07=$05.GetFileVersion($06+'\\system32\\kernel32.dll');
else if($05.FolderExists($06+'\\system'))
$07=$05.GetFileVersion($06+'\\system\\kernel32.dll');
if($07){
/^(\d)\.(\d+)\.(\d+)\.\d+$/.test($07);
this.osInfo.majorVersion=parseInt(RegExp.$1);
this.osInfo.minorVersion=parseInt(RegExp.$2,10);
this.osInfo.buildVersion=parseInt(RegExp.$3,10);
this.osInfo.version=$07;
var $08={
'4.00.950':'Win95',
'4.00.1111':'Win95 OSR2',
'4.00.1381':'WinNT',
'4.10.1998':'Win98',
'4.10.2222':'Win98SE',
'4.90.3000':'WinME',
'5.0.2195':'Win2K',
'5.10.2600':'WinXP'
};
this.osInfo.name=$08[$07.replace(/\.\d+$/,'')]||'unknown';
}
this.osInfo.$0a=1;
return this.osInfo;
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.WSH',true);
function Soya_Saltstorm_ESC($0t,$0u,$0v,$y)
{
this.name='Soya.Saltstorm.ESC';
this.version='1.14';
this.type='constructor';
this.dependencies=['Soya.Common','Soya.ECMA.Array'];
this.resourcePath=$0v||'';
this.crunchLevel=$0t||2;
this.substitute=false;
this.verbose=$0u;
this.silent=($y||typeof window=='object');
this.initialize();
this.flush();
}
function Soya_Saltstorm_ESC_initialize($0w,$0x){
$0y=$0x;
var $0z="(?:\"{2}|'{2}|\".*?.\"|'.*?.'|\\/(?!\\*|\\/)..*?\\/)";
var $0A="[-!%&;<=>~:\\/\\^\\+\\|\\,\\(\\)\\*\\?\\[\\]\\{\\}]+";
var $0B="\\/\\*(?!@).(?:.|\\n)*?\\*\\/|\\/\\/.*";
var $0C="\".*?.\"|'.*?.'|\\s*\\/{2,}.*\\n";
var $0D="\\}(?!catch|else|while)([^;,\\|\\.\\]\\)\\}])";
with($0w){
prototype.fileFilter=new RegExp('.+\\\\(?!$|_)\\w*\\.js$','i');
prototype.$1r=["0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",9];
prototype.$1s={};
prototype.fso=Soya.Loader.fso||new ActiveXObject('Scripting.FilesystemObject');
prototype.core={};
prototype.bless={};
prototype.mangle={};
prototype.common={};
prototype.$1t=$g;
prototype.crunch=$0r;
prototype.flush=function(){this.buffer='';this.report=new $0c()};
prototype.getSubstitute=$0g;
prototype.loadMaps=$0d;
prototype.out=$0b;
prototype.load=$0e;
prototype.save=$0f;
prototype.getReport=$0s;
prototype.$1u=new RegExp("[$_]");
prototype.$1v=new RegExp("[^$\\w]","g");
prototype.$1w=new RegExp("^[\\x00\\.\"']");
prototype.$1x=new RegExp("\\s+$");
prototype.$1y=new RegExp("^\\s*\\W");
prototype.$1z=new RegExp("^[-\\\\+\"~'!]");
prototype.$1A=new RegExp("("+$0z+")|("+$0B+")","g");
prototype.$1B=new RegExp("("+$0C+")","g");
prototype.$1C=new RegExp("("+$0z+")|(\\r?\\n\\s+)|(\\x20{2,})","g");
prototype.$1D=new RegExp("("+$0z+")|(\\w+)?\\s+("+$0A+")","g");
prototype.$1E=new RegExp("("+$0z+")|("+$0A+")[ \\t]+","g");
prototype.$1F=new RegExp("("+$0z+")|function[\\n\\s]+([$\\w]+)","g");
prototype.$1G=new RegExp("("+$0z+")|("+$0B+")|(\\W[\\n\\s]*?[$\\w]+)\\b","gm");
prototype.$1H=new RegExp("("+$0z+")|(\\x00)|\\.[\\n\\s]*?([$_][$\\w]{3,})","g");
prototype.$1I=new RegExp("("+$0z+")|(\\S)\\s*[\\r\\n]+\\s*(\\S)","g");
prototype.$1J=new RegExp("[$\\w][$\\w]");
prototype.$1K=new RegExp("("+$0D+")","g");
}
}
function $0b($0E,$0F){
if(!this.silent){
var $0G=String((!$0F?'ESC> ':'')+($0E||''));
WScript.Echo($0G);
}
}
function $0c(){
this.scripts=[];
this.rawSize=
this.crunchedSize=
this.elapsedTime=0;
}
function $0d(){
if(this.$1L)
return;
var $0H,$0I,$0J,$0K,$0L;
for(var i=0;i<arguments.length;i++){
$0H=arguments[i].replace(/\W.+$/,'');
try{
$0J=getResource(arguments[i]).split(/\r?\n/g)||[];
for(var j=0;j<$0J.length;j++)
if($0J[j].length&&!$0y.$1y.test($0J[j]))
Soya_Saltstorm_ESC.prototype[$0H][$0J[j].replace($0y.$1x,'')]=1;
if(this.verbose)
this.out('Parsed map "'+$0H+'", '+$0J.length+' entries.')
}
catch($0M){
if($0M)
$0J=null;
}
if($0J)
continue;
else $0I=this.fso.BuildPath(this.resourcePath,arguments[i]);
if(/^common|core/.test(arguments[i])&&!this.fso.FileExists($0I)){
this.out('Couldn\'t $0N $0O:'+
this.fso.GetAbsolutePathName($0I));
return WScript.Quit(99);
}
else if(typeof this[$0H]!='object'){
this.out('Unrecognized mapname : '+$0H);
return WScript.Quit(99);
}
else if(this.fso.FileExists($0I)){
$0J=this.fso.OpenTextFile($0I);
$0L=0;
while(!$0J.AtEndOfStream){
$0K=$0J.ReadLine();
if($0K.length&&!$0y.$1y.test($0K))
Soya_Saltstorm_ESC.prototype[$0H][$0K.replace($0y.$1x,'')]=++$0L;
}
$0J.Close();
Soya_Saltstorm_ESC.prototype[$0H].length=$0L;
if(this.verbose)
this.out('Loaded map "'+$0H+'", '+$0L+' entries. ['+$0I+']');
}
}
this.$1L=1;
}
function $0e(){
var i,$0P,$0Q,$0R,$0S=[];
for(i=0;i<arguments.length;i++){
if(arguments[i]&&this.fso.FolderExists(arguments[i])){
$0R=new Enumerator(this.fso.GetFolder(arguments[i]).SubFolders);
for(;!$0R.atEnd();$0R.moveNext())
arguments[arguments.length++]=$0R.item().Path;
$0R=new Enumerator(this.fso.GetFolder(arguments[i]).Files);
for(;!$0R.atEnd();$0R.moveNext())
if($0R.item().Size&&this.fileFilter.test($0R.item().Path))
$0S.push($0R.item().Path);
}
else if(arguments[i])
$0S.push(arguments[i]);
}
for(i=0;i<$0S.length;i++){
if(!this.fso.FileExists($0S[i])){
this.out('Couldn\'t $0N $0T:"' + this.fso.GetAbsolutePathName(aLoadQueue[i]) + '"');
return WScript.Quit(99);
}
else if(this.verbose)
this.out('Loading script :"'+this.fso.GetAbsolutePathName($0S[i])+'"');
$0Q=this.fso.GetFile($0S[i]);
this.buffer+=(this.report.scripts.length?'\r\n':'');
this.buffer+=this.$1t($0Q.Path,true);
this.report.scripts.push(
$0Q.Path+' ('+($0Q.Size/1024).toFixed(2)+' kb)');
}
return $0S.length;
}
function $0f($0U,$0V){
var $0W;
if(!$0U){
this.out('Need an output filename!');
return WScript.Quit(99);
}
else if(this.fso.FolderExists($0U)){
this.out('Need an output filename, "'+
this.fso.GetAbsolutePathName($0U)+'" is a folder.');
return WScript.Quit(99);
}
this.outFile=this.fso.GetAbsolutePathName($0U);
this.outMode=$0V?'Writing':'Appending';
$0W=this.fso.OpenTextFile(this.outFile,($0V?2:8),true);
$0W.WriteLine(this.buffer);
$0W.Close();
}
function $0g($0X){
if(!this.$1s[$0X]){
var k=1;
while(k<5){
this.$1r[k]++;
if(this.$1r[k]&&!(this.$1r[k]%62)){
k++;
if(this.$1r.length==k)
this.$1r[k]=-1;
}
else break;
}
this.$1s[$0X]='$';
for(k=this.$1r.length-1;k>0;k--)
this.$1s[$0X]+=this.$1r[0].charAt(this.$1r[k]%62);
if(this.verbose)
this.out('Substituting ['+this.$1s[$0X]+'] -> ['+$0X+']');
}
return this.$1s[$0X];
}
function $0h($0Y,$0Z,$10){
if(typeof $10!='undefined')
return '';
else return $0Y;
}
function $0i($0Y,$11){
if(typeof $11!='undefined'&&/^\s+/.test($11))
return '\r\n';
else return $0Y;
}
function $0j($0Y,$12,$13){
if(typeof $12!='undefined')
return $0Y;
else if($13&&$13.length>2&&
($0y.mangle[$13]||$0y.$1u.test($13.charAt(0))))
$13=$0y.getSubstitute($13);
else Soya_Saltstorm_ESC.prototype.bless[$13]=1;
return String('function \x00'+$13);
}
function $0k($0Y,$12,$14,$15){
if(typeof $12=='undefined'&&typeof $14=='undefined'&&typeof $15=='string'){
$15=$15.replace(/\s+/g,'');
if(!$0y.$1w.test($15)&&isNaN(parseInt($15.substr(1),10))){
$15=$15.replace($0y.$1v,'');
if($15.length>2&&!$0y.core[$15]&&!$0y.common[$15]&&
!$0y.bless[$15]&&($0y.mangle[$15]||!$0y.mangle.length))
return $0Y.replace($15,$0y.getSubstitute($15));
}
}
return $0Y;
}
function $0l($0Y,$12,$16,$P){
if(typeof $P=='string')
return(!$0y.core[$P]&&!$0y.common[$P]&&!$0y.bless[$P])?
String('.'+$0y.getSubstitute($P)):$0Y;
else if(typeof $12!='undefined')
return $0Y;
else return '';
}
function $0m($0Y,$12,$17,$18,$19){
if(typeof $12!='undefined')
return $0Y;
else if(typeof $17!='undefined')
return '\r\n';
else if(typeof $18!='undefined')
return ' ';
else return '';
}
function $0n($0Y,$12,$1a,$1b){
if(typeof $12=='undefined'){
if(!$0y.$1z.test($1b)||!$1a||!$0y.core[$1a])
return($1a||'')+$1b;
else return $0Y;
}
else return $12;
}
function $0o($0Y,$12,$1b){
if(typeof $12!='undefined')
return $0Y;
else return $1b;
}
function $0p($0Y,$1c,$1d){
return('};'+$1d);
}
function $0q($0Y,$12,$1e,$1f){
if(typeof $1e=='undefined')
return $0Y;
var $1g=($0y.$1J.test($1e+$1f))?' ':'';
return $1e+$1g+$1f;
}
function $0r($1h,$0t,$1i){
var $B=(typeof $1h=='string')?$1h:this.buffer;
this.loadMaps('core.map','common.map','bless.map','mangle.map');
if(!this.buffer.length&&!$1h)
return String();
else if(typeof $0t=='number')
this.crunchLevel=$0t;
var $1j=(new Date()).getTime()-1;
var $1k=$B.length;
this.report.rawSize+=$B.length;
if(this.crunchLevel>=1){
$B=$B.replace(this.$1A,$0h)
.replace(this.$1B,$0i)
.replace(/\s*\r?\n/g,'\r\n');
if(this.verbose)
this.out('Removing comments, empty lines and trailing whitespace, saved '+
($1k-$B.length)+' bytes.');
$1k=$B.length;
}
if(this.crunchLevel>=2){
$B=$B.replace(this.$1C,$0m);
if(this.verbose)
this.out('Removing tabs and spaces, saved '+
($1k-$B.length)+' bytes.');
$1k=$B.length;
$B=$B.replace(this.$1D,$0n);
if(this.verbose)
this.out('Removing spaces left to operators, saved '+
($1k-$B.length)+' bytes.');
$1k=$B.length;
$B=$B.replace(this.$1E,$0o);
if(this.verbose)
this.out('Removing spaces right to operators, saved '+
($1k-$B.length)+' bytes.');
$1k=$B.length;
}
if(this.substitute||$1i||this.crunchLevel>=4){
$B=$B.replace(this.$1F,$0j);
$B=$B.replace(this.$1G,$0k);
$B=$B.replace(this.$1H,$0l);
if(this.verbose)
this.out('Substitution summary, saved '+
($1k-$B.length)+' bytes.');
$1k=$B.length;
}
if(this.crunchLevel>=3){
$B=$B.replace(this.$1I,$0q);
$B=$B.replace(this.$1K,$0p);
$B+='\r\n';
if(this.verbose){
this.out('Removing newlines, saved '+
($1k-$B.length)+' bytes.');
this.out('',1);
}
}
if(typeof $1h=='string'){
this.report.crunchedSize+=$B.length;
this.buffer+=$B;
}
else{
this.buffer=$B;
this.report.crunchedSize=$B.length;
}
this.report.elapsedTime+=(new Date()).getTime()-$1j;
return this.buffer;
}
function $0s($1l){
var $1m=($1l||'\r\n'),
$1n=this.label?String($1m+this.label+$1m):'';
if(!this.report.elapsedTime){
$1n+='Nothing to report, yet...';
return(!$1o)?this.out($1n,1):$1n;
}
var $1p=Boolean(this.substitute||this.crunchLevel>=4),
$1q=this.report.rawSize-this.report.crunchedSize;
if(this.report.scripts.length){
$1n+="-----------------------------------------------------------------------------"+$1m;
$1n+=" Crunching script(s):\r\n\t * "+this.report.scripts.join("\r\n\t * ")+$1m;
$1n+="-----------------------------------------------------------------------------"+$1m;
$1n+=" "+(this.outMode||"Put")+" to : "+(this.outFile||"[buffer]")+" ("+
(this.report.crunchedSize/1024).toFixed(2)+" kb)"+$1m;
}
$1n+="-----------------------------------------------------------------------------"+$1m;
$1n+=" Processtime     :\t"+(this.report.elapsedTime/1000).toFixed(3)+" secs"+$1m;
$1n+=" Crunch-level    :\t"+this.crunchLevel+$1m;
$1n+=" Subst. engine   :\t"+($1p?'On':'Off')+$1m;
if($1p)
$1n+=" Substitutions   :\t"+(this.$1r[1]-9)+$1m;
$1n+=" Original size   :\t"+(this.report.rawSize/1024).toFixed(2)+" kb"+$1m;
$1n+=" Crunched size   :\t"+(this.report.crunchedSize/1024).toFixed(2)+" kb"+$1m;
$1n+=" Saving ratio    :\t"+($1q/1024).toFixed(2)+" kb"+$1m;
$1n+="   -'' ''-   (%) :\t"+(($1q/this.report.rawSize)*100).toFixed(2)+" %"+$1m;
$1n+="-----------------------------------------------------------------------------"+$1m;
return $1n;
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.Saltstorm.ESC',false,1);
 
/*** </POD> ***/
 
]]>
</script>
<script language="JScript">
<![CDATA[
    /*
    Command flow control script for ESC.wsf
    Edited : 2005-02-06
    */
 
    var oShell = WScript.CreateObject('WScript.Shell');
 
    if(!oShell)
      WScript.Quit(64);
 
    // Do we have Jscript 5.5+ ?
    else if(oShell && parseFloat(ScriptEngineMajorVersion() + '.' + ScriptEngineMinorVersion()) < 5.5)
      oShell.Popup(getResource('jscript'), 64, WScript.ScriptName, 16), WScript.Quit(4);
    
    // Is ESC executed under cscript ?
    // if not let user select switching to cscript automagically.
    else if(oShell && WScript.FullName.toLowerCase().indexOf('cscript') < 0){
      if(oShell.Popup(getResource('wscript'), 64, WScript.ScriptName, 52) == 6)
        oShell.Run('%comspec% /Q /K cscript //NoLogo ' + WScript.ScriptName + ' -a', 9);
      WScript.Quit(3);
      }
 
    // get the cmdline arguments formatted in a nice manner.
    var oArgs = Soya.WSH.getArguments();
 
    // should we run in verbose-mode ?;
    var bVerbose = Boolean(!oArgs.s && !oArgs.silent && (oArgs.v || oArgs.verbose));
 
    // create an instance of the ESC object.
    var esc = new Soya.Saltstorm.ESC(oArgs.l || oArgs.level, bVerbose);
    esc.label = 'ESC (ECMAScript Cruncher) ' + esc.version +
             '\r\nCopyright (C) 2001-2005 Thomas Loo <tloo@saltstorm.net>';
 
    esc.resourcePath = esc.fso.GetParentFolderName(WScript.ScriptFullName || '.');
    var sOutput = String(oArgs.oa || oArgs.ow || '');
 
    if(oArgs.a || oArgs.about){
      WScript.Echo(getResource('about'));
      WScript.Quit(1);
      }
    else if(oArgs.c || oArgs.copyright){
      WScript.Echo('\n' + esc.label + getResource('copyright'));
      WScript.Quit(1);
      }
    else if(oArgs.e || oArgs.example){
      WScript.Echo('\n' + esc.label + getResource('example'));
      WScript.Quit(1);
      }
 
    // if there are options missing, print out the help table and quit.
    else if((oArgs.h || oArgs.help) || !sOutput.length || !oArgs[0]){
      WScript.Echo('\n' + esc.label + getResource('usage'));
      WScript.Quit((oArgs.h || oArgs.help) ? 1 : 2);
      }
    
    // Wake up the variable substitution engine if option set (-$);
    esc.substitute = Boolean(oArgs.$);
 
    // load input files;
    for(var i = 0; i < oArgs.length; i++)
      esc.load(oArgs[i]);
 
    // crunch baby, crunch!;
    if(sOutput.toUpperCase() == 'STDOUT'){
      esc.silent = true;
      WScript.StdOut.Write(esc.crunch());
      }
    else if(sOutput.length){
      esc.crunch();
      esc.save(sOutput, Boolean(oArgs.ow));
      // write report to stdout if not silence'd.
      if(!oArgs.s && !oArgs.silent)
        WScript.StdOut.Write(esc.getReport());
      }
    
    // Shutting down nicely..
    WScript.Quit(0);
 
]]>
</script>
</job>
</package>