tungsten 0.2.19 → 0.2.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tungsten/enhancements/radio-groups.js +28 -0
- data/app/assets/javascripts/tungsten/tungsten.js +1 -0
- data/app/assets/stylesheets/tungsten/form/_check-radio.scss +0 -9
- data/lib/tungsten/version.rb +1 -1
- data/public/{code-0.2.19.js → code-0.2.20.js} +0 -0
- data/public/{code-0.2.19.js.gz → code-0.2.20.js.gz} +0 -0
- data/public/{tungsten-0.2.19.css → tungsten-0.2.20.css} +0 -5
- data/public/tungsten-0.2.20.css.gz +0 -0
- data/public/{tungsten-0.2.19.js → tungsten-0.2.20.js} +108 -78
- data/public/tungsten-0.2.20.js.gz +0 -0
- metadata +9 -8
- data/public/tungsten-0.2.19.css.gz +0 -0
- data/public/tungsten-0.2.19.js.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17233de29ba54ebe918aac125a9204c186bb78ce2c7d17683f400c8422bf2dbd
|
4
|
+
data.tar.gz: 1997c066826e5e50dc81fd0462a7b29a8d20f50cf42d6b6c21083fb746ca1b00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cf29938f510185a46b826fd73a00d60f371da611e0c3fde09593d77c6bc5e95b9cd86829e012b99ea1c6bbe93b0b380a4ed56196ad0460b12922bc00d0bce8e
|
7
|
+
data.tar.gz: 98d7d5bbb3d19522022357b9edeb41bd808f7016a331a1b5feb99734708569ff74a21c8538711820a5d138177f068a7a5f974524fcb54229c10c35a1223bfea0
|
@@ -0,0 +1,28 @@
|
|
1
|
+
var toolbox = require('compose-toolbox'),
|
2
|
+
Event = toolbox.event
|
3
|
+
|
4
|
+
function disableRadioGroupInputs ( input ) {
|
5
|
+
var input = ( input.target || input )
|
6
|
+
var inputName = input.name
|
7
|
+
var radioGroup = document.querySelectorAll('input[name=' + inputName + ']')
|
8
|
+
|
9
|
+
radioGroup.forEach(function(radioInput) {
|
10
|
+
var radioBlock = toolbox.getClosest( radioInput, '.radio-block' )
|
11
|
+
if (radioBlock) {
|
12
|
+
var radioSecondaryInputs = radioBlock.querySelectorAll('input[type=text]')
|
13
|
+
radioSecondaryInputs.forEach(function(radioSecondaryInput) {
|
14
|
+
if (radioInput.checked === false) {
|
15
|
+
radioSecondaryInput.setAttribute("disabled", "");
|
16
|
+
} else {
|
17
|
+
radioSecondaryInput.removeAttribute("disabled", "");
|
18
|
+
}
|
19
|
+
})
|
20
|
+
}
|
21
|
+
})
|
22
|
+
}
|
23
|
+
|
24
|
+
Event.change( function() {
|
25
|
+
toolbox.each( document.querySelectorAll('input[type=radio]'), disableRadioGroupInputs )
|
26
|
+
})
|
27
|
+
|
28
|
+
Event.on( document, 'input', 'input[type=radio]', disableRadioGroupInputs )
|
@@ -21,6 +21,7 @@ require( './enhancements/form-submit-helpers' )
|
|
21
21
|
require( './enhancements/input-number-only' )
|
22
22
|
require( './enhancements/input-unit' )
|
23
23
|
require( './enhancements/link-here' )
|
24
|
+
require( './enhancements/radio-groups' )
|
24
25
|
require( './enhancements/textarea-expand' )
|
25
26
|
require( './enhancements/tiered-select' )
|
26
27
|
|
@@ -94,15 +94,6 @@ label.tick-box {
|
|
94
94
|
}
|
95
95
|
}
|
96
96
|
|
97
|
-
&:not(.checked-radio) ~ [data-input-type=text] {
|
98
|
-
.input[type=text] {
|
99
|
-
background: $gray-02;
|
100
|
-
box-shadow: $disabled-shadow;
|
101
|
-
color: $gray-06;
|
102
|
-
cursor: not-allowed;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
97
|
// Checkboxes
|
107
98
|
input[type=checkbox] {
|
108
99
|
|
data/lib/tungsten/version.rb
CHANGED
File without changes
|
Binary file
|
@@ -2298,11 +2298,6 @@ label.tick-box input[type=radio]:focus:checked + .tick:before, label.tick-box in
|
|
2298
2298
|
label.tick-box input[type=radio]:focus:checked + .tick:after, label.tick-box input[type=radio]:active:checked + .tick:after {
|
2299
2299
|
-webkit-transform: scale(0.35);
|
2300
2300
|
transform: scale(0.35); }
|
2301
|
-
label.tick-box:not(.checked-radio) ~ [data-input-type=text] .input[type=text] {
|
2302
|
-
background: #f5f7fa;
|
2303
|
-
box-shadow: 0 0 0 1px #d6dde7 inset, 0 0 0 transparent;
|
2304
|
-
color: #c3cdda;
|
2305
|
-
cursor: not-allowed; }
|
2306
2301
|
label.tick-box input[type=checkbox] + .tick {
|
2307
2302
|
border-radius: 3px;
|
2308
2303
|
position: relative; }
|
Binary file
|
@@ -107,7 +107,7 @@ Event.change(function(){
|
|
107
107
|
})
|
108
108
|
|
109
109
|
|
110
|
-
},{"../modules/notify":
|
110
|
+
},{"../modules/notify":12,"compose-toolbox":63}],4:[function(require,module,exports){
|
111
111
|
var toolbox = require( 'compose-toolbox' )
|
112
112
|
var Event = toolbox.event
|
113
113
|
var notify = require( '../modules/notify' )
|
@@ -181,7 +181,7 @@ window.onpageshow = function(event) {
|
|
181
181
|
}
|
182
182
|
}
|
183
183
|
|
184
|
-
},{"../modules/notify":
|
184
|
+
},{"../modules/notify":12,"compose-toolbox":63}],5:[function(require,module,exports){
|
185
185
|
var Event = require('compose-toolbox').event
|
186
186
|
|
187
187
|
function numberInputOnly(event) {
|
@@ -202,7 +202,7 @@ function numberInputOnly(event) {
|
|
202
202
|
// Prevent non numeric input on input type of number
|
203
203
|
Event.on( document, 'keydown', 'input[type=number]', numberInputOnly )
|
204
204
|
|
205
|
-
},{"compose-toolbox":
|
205
|
+
},{"compose-toolbox":63}],6:[function(require,module,exports){
|
206
206
|
var toolbox = require('compose-toolbox'),
|
207
207
|
Event = toolbox.event,
|
208
208
|
convert = require('../modules/unit-converter'),
|
@@ -274,7 +274,7 @@ Event.change( function() {
|
|
274
274
|
Event.on(document, 'input', '[data-unit]', setValue)
|
275
275
|
Event.on(document, 'input', '[data-unit-select]', unitChange)
|
276
276
|
|
277
|
-
},{"../modules/unit-converter":
|
277
|
+
},{"../modules/unit-converter":13,"compose-form-up":41,"compose-toolbox":63}],7:[function(require,module,exports){
|
278
278
|
var Event = require('compose-toolbox').event
|
279
279
|
|
280
280
|
Event.change(function(){
|
@@ -287,7 +287,36 @@ Event.change(function(){
|
|
287
287
|
})
|
288
288
|
|
289
289
|
|
290
|
-
},{"compose-toolbox":
|
290
|
+
},{"compose-toolbox":63}],8:[function(require,module,exports){
|
291
|
+
var toolbox = require('compose-toolbox'),
|
292
|
+
Event = toolbox.event
|
293
|
+
|
294
|
+
function disableRadioGroupInputs ( input ) {
|
295
|
+
var input = ( input.target || input )
|
296
|
+
var inputName = input.name
|
297
|
+
var radioGroup = document.querySelectorAll('input[name=' + inputName + ']')
|
298
|
+
|
299
|
+
radioGroup.forEach(function(radioInput) {
|
300
|
+
var radioBlock = toolbox.getClosest( radioInput, '.radio-block' )
|
301
|
+
if (radioBlock) {
|
302
|
+
var radioSecondaryInputs = radioBlock.querySelectorAll('input[type=text]')
|
303
|
+
radioSecondaryInputs.forEach(function(radioSecondaryInput) {
|
304
|
+
if (radioInput.checked === false) {
|
305
|
+
radioSecondaryInput.setAttribute("disabled", "");
|
306
|
+
} else {
|
307
|
+
radioSecondaryInput.removeAttribute("disabled", "");
|
308
|
+
}
|
309
|
+
})
|
310
|
+
}
|
311
|
+
})
|
312
|
+
}
|
313
|
+
|
314
|
+
Event.change( function() {
|
315
|
+
toolbox.each( document.querySelectorAll('input[type=radio]'), disableRadioGroupInputs )
|
316
|
+
})
|
317
|
+
|
318
|
+
Event.on( document, 'input', 'input[type=radio]', disableRadioGroupInputs )
|
319
|
+
},{"compose-toolbox":63}],9:[function(require,module,exports){
|
291
320
|
var Event = require( 'compose-toolbox' ).event
|
292
321
|
|
293
322
|
function autoSizeTextarea( textarea ) {
|
@@ -322,7 +351,7 @@ Event.on(document, 'keyup toggler:show', 'textarea', function(event){
|
|
322
351
|
|
323
352
|
|
324
353
|
|
325
|
-
},{"compose-toolbox":
|
354
|
+
},{"compose-toolbox":63}],10:[function(require,module,exports){
|
326
355
|
var Event = require('compose-toolbox').event
|
327
356
|
|
328
357
|
// Check if child select matches parent selected option
|
@@ -395,7 +424,7 @@ Event.ready(function(){
|
|
395
424
|
Event.on(document, 'change', '.select-parent', function(event){
|
396
425
|
test(event.currentTarget)
|
397
426
|
})
|
398
|
-
},{"compose-toolbox":
|
427
|
+
},{"compose-toolbox":63}],11:[function(require,module,exports){
|
399
428
|
var event = require( 'compose-toolbox' ).event
|
400
429
|
|
401
430
|
// Public API function
|
@@ -452,7 +481,7 @@ var clipboard = function() {
|
|
452
481
|
|
453
482
|
module.exports = clipboard
|
454
483
|
|
455
|
-
},{"compose-toolbox":
|
484
|
+
},{"compose-toolbox":63}],12:[function(require,module,exports){
|
456
485
|
var toolbox = require( 'compose-toolbox' ),
|
457
486
|
Event = toolbox.event,
|
458
487
|
esvg = require( '../_esvg' ),
|
@@ -572,7 +601,7 @@ notify.remove = remove
|
|
572
601
|
|
573
602
|
module.exports = notify
|
574
603
|
|
575
|
-
},{"../_esvg":1,"compose-toolbox":
|
604
|
+
},{"../_esvg":1,"compose-toolbox":63}],13:[function(require,module,exports){
|
576
605
|
const unitsTable = {
|
577
606
|
bit: 1,
|
578
607
|
byte: 8,
|
@@ -627,7 +656,7 @@ function convert(num, as, to) {
|
|
627
656
|
|
628
657
|
module.exports = convert
|
629
658
|
|
630
|
-
},{}],
|
659
|
+
},{}],14:[function(require,module,exports){
|
631
660
|
// Icons must come before event registrations
|
632
661
|
require( './_icons' ) // Import svg icons (from Esvg)
|
633
662
|
var esvg = require( './_esvg' )
|
@@ -651,6 +680,7 @@ require( './enhancements/form-submit-helpers' )
|
|
651
680
|
require( './enhancements/input-number-only' )
|
652
681
|
require( './enhancements/input-unit' )
|
653
682
|
require( './enhancements/link-here' )
|
683
|
+
require( './enhancements/radio-groups' )
|
654
684
|
require( './enhancements/textarea-expand' )
|
655
685
|
require( './enhancements/tiered-select' )
|
656
686
|
|
@@ -672,7 +702,7 @@ window.Tungsten = module.exports = toolbox.merge( {
|
|
672
702
|
dialog : dialog
|
673
703
|
}, toolbox )
|
674
704
|
|
675
|
-
},{"./_esvg":1,"./_icons":2,"./enhancements/flash-messages":3,"./enhancements/form-submit-helpers":4,"./enhancements/input-number-only":5,"./enhancements/input-unit":6,"./enhancements/link-here":7,"./enhancements/textarea-expand":
|
705
|
+
},{"./_esvg":1,"./_icons":2,"./enhancements/flash-messages":3,"./enhancements/form-submit-helpers":4,"./enhancements/input-number-only":5,"./enhancements/input-unit":6,"./enhancements/link-here":7,"./enhancements/radio-groups":8,"./enhancements/textarea-expand":9,"./enhancements/tiered-select":10,"./modules/clipboard":11,"./modules/notify":12,"compose-dialog":17,"compose-form-up":41,"compose-time-toggle":58,"compose-toggler":62,"compose-toolbox":63,"superagent":75}],15:[function(require,module,exports){
|
676
706
|
/*!
|
677
707
|
* Bean - copyright (c) Jacob Thornton 2011-2012
|
678
708
|
* https://github.com/fat/bean
|
@@ -1449,7 +1479,7 @@ window.Tungsten = module.exports = toolbox.merge( {
|
|
1449
1479
|
return bean
|
1450
1480
|
});
|
1451
1481
|
|
1452
|
-
},{}],
|
1482
|
+
},{}],16:[function(require,module,exports){
|
1453
1483
|
|
1454
1484
|
/**
|
1455
1485
|
* Expose `Emitter`.
|
@@ -1614,7 +1644,7 @@ Emitter.prototype.hasListeners = function(event){
|
|
1614
1644
|
return !! this.listeners(event).length;
|
1615
1645
|
};
|
1616
1646
|
|
1617
|
-
},{}],
|
1647
|
+
},{}],17:[function(require,module,exports){
|
1618
1648
|
var toolbox = require('compose-toolbox'),
|
1619
1649
|
Event = toolbox.event,
|
1620
1650
|
options = {},
|
@@ -1847,7 +1877,7 @@ module.exports = {
|
|
1847
1877
|
defaults: defaults
|
1848
1878
|
}
|
1849
1879
|
|
1850
|
-
},{"compose-toolbox":
|
1880
|
+
},{"compose-toolbox":18}],18:[function(require,module,exports){
|
1851
1881
|
// Shims
|
1852
1882
|
require( './lib/shims/_classlist' )
|
1853
1883
|
var merge = require( './lib/shims/_object.assign' ),
|
@@ -1929,7 +1959,7 @@ var toolbox = {
|
|
1929
1959
|
|
1930
1960
|
module.exports = toolbox
|
1931
1961
|
|
1932
|
-
},{"./lib/ease":
|
1962
|
+
},{"./lib/ease":19,"./lib/fromtop":20,"./lib/scrollto":21,"./lib/shims/_classlist":22,"./lib/shims/_object.assign":23,"./lib/time":24,"compose-event":25,"luxon":72}],19:[function(require,module,exports){
|
1933
1963
|
// easing functions http://gizma.com/easing/
|
1934
1964
|
var ease = {
|
1935
1965
|
|
@@ -1966,12 +1996,12 @@ ease.default = ease.inOutQuad
|
|
1966
1996
|
|
1967
1997
|
module.exports = ease
|
1968
1998
|
|
1969
|
-
},{}],
|
1999
|
+
},{}],20:[function(require,module,exports){
|
1970
2000
|
module.exports = function( el ) {
|
1971
2001
|
return Math.round( el.getBoundingClientRect().top + window.pageYOffset );
|
1972
2002
|
}
|
1973
2003
|
|
1974
|
-
},{}],
|
2004
|
+
},{}],21:[function(require,module,exports){
|
1975
2005
|
var ease = require( './ease' )
|
1976
2006
|
var fromTop = require( './fromtop' )
|
1977
2007
|
|
@@ -2033,7 +2063,7 @@ function scrollTo(to, callback, duration) {
|
|
2033
2063
|
|
2034
2064
|
module.exports = scrollTo
|
2035
2065
|
|
2036
|
-
},{"./ease":
|
2066
|
+
},{"./ease":19,"./fromtop":20}],22:[function(require,module,exports){
|
2037
2067
|
/**
|
2038
2068
|
* ClassList polyfill
|
2039
2069
|
* Cross-browser full element.classList implementation
|
@@ -2269,7 +2299,7 @@ if ( 'document' in self ) {
|
|
2269
2299
|
}
|
2270
2300
|
}
|
2271
2301
|
|
2272
|
-
},{}],
|
2302
|
+
},{}],23:[function(require,module,exports){
|
2273
2303
|
/**
|
2274
2304
|
* Object.assign polyfill
|
2275
2305
|
* Cross-browser full Object.assign implementation
|
@@ -2309,7 +2339,7 @@ var merge = function() {
|
|
2309
2339
|
|
2310
2340
|
module.exports = merge
|
2311
2341
|
|
2312
|
-
},{}],
|
2342
|
+
},{}],24:[function(require,module,exports){
|
2313
2343
|
var DateTime = require( 'luxon' ).DateTime
|
2314
2344
|
|
2315
2345
|
function isBefore( date, end ) {
|
@@ -2390,7 +2420,7 @@ module.exports = {
|
|
2390
2420
|
prettyPrint: prettyPrint
|
2391
2421
|
}
|
2392
2422
|
|
2393
|
-
},{"luxon":
|
2423
|
+
},{"luxon":72}],25:[function(require,module,exports){
|
2394
2424
|
require( './lib/shims/custom-event' )
|
2395
2425
|
|
2396
2426
|
var bean = require( 'bean' )
|
@@ -2630,7 +2660,7 @@ function isEmpty( obj ) {
|
|
2630
2660
|
return true;
|
2631
2661
|
}
|
2632
2662
|
|
2633
|
-
},{"./lib/animation-events":
|
2663
|
+
},{"./lib/animation-events":26,"./lib/bubble-form-events":27,"./lib/callback-manager":28,"./lib/debounce":29,"./lib/delay":30,"./lib/media":31,"./lib/page":33,"./lib/repeat":34,"./lib/resize":35,"./lib/scroll":36,"./lib/shims/custom-event":37,"./lib/submit":38,"./lib/tap-events":39,"./lib/throttle":40,"bean":15,"keymaster":71}],26:[function(require,module,exports){
|
2634
2664
|
var cssAnimEventTypes = getAnimationEventTypes()
|
2635
2665
|
var supported = cssAnimEventTypes.animationstart !== undefined
|
2636
2666
|
|
@@ -2711,7 +2741,7 @@ function transformAnimationEvents (event) {
|
|
2711
2741
|
}
|
2712
2742
|
}
|
2713
2743
|
|
2714
|
-
},{}],
|
2744
|
+
},{}],27:[function(require,module,exports){
|
2715
2745
|
var Event = require( 'bean' ),
|
2716
2746
|
page = require( './page' ),
|
2717
2747
|
formEls;
|
@@ -2766,7 +2796,7 @@ var bubbleFormEvents = function () {
|
|
2766
2796
|
|
2767
2797
|
module.exports = bubbleFormEvents
|
2768
2798
|
|
2769
|
-
},{"./page":
|
2799
|
+
},{"./page":33,"bean":15}],28:[function(require,module,exports){
|
2770
2800
|
var Manager = {
|
2771
2801
|
new: function() {
|
2772
2802
|
var manager = {
|
@@ -2827,7 +2857,7 @@ var Manager = {
|
|
2827
2857
|
|
2828
2858
|
module.exports = Manager
|
2829
2859
|
|
2830
|
-
},{}],
|
2860
|
+
},{}],29:[function(require,module,exports){
|
2831
2861
|
var now = function() {
|
2832
2862
|
return Date.now()
|
2833
2863
|
}
|
@@ -2962,7 +2992,7 @@ var debounce = function( fn, wait, options ) {
|
|
2962
2992
|
|
2963
2993
|
module.exports = debounce
|
2964
2994
|
|
2965
|
-
},{}],
|
2995
|
+
},{}],30:[function(require,module,exports){
|
2966
2996
|
var now = function() {
|
2967
2997
|
return Date.now()
|
2968
2998
|
}
|
@@ -3014,7 +3044,7 @@ var queueDelay = function ( handle ) {
|
|
3014
3044
|
|
3015
3045
|
module.exports = delay
|
3016
3046
|
|
3017
|
-
},{}],
|
3047
|
+
},{}],31:[function(require,module,exports){
|
3018
3048
|
// This simplifies common uses for window.matchMedia
|
3019
3049
|
// namely, adding listeners for width and height queries
|
3020
3050
|
|
@@ -3073,7 +3103,7 @@ var media = {
|
|
3073
3103
|
|
3074
3104
|
module.exports = media
|
3075
3105
|
|
3076
|
-
},{}],
|
3106
|
+
},{}],32:[function(require,module,exports){
|
3077
3107
|
var Event = require( 'bean' )
|
3078
3108
|
var callbackManager = require( './callback-manager' )
|
3079
3109
|
var throttle = require( './throttle' )
|
@@ -3124,7 +3154,7 @@ var optimizedEventManager = {
|
|
3124
3154
|
|
3125
3155
|
module.exports = optimizedEventManager
|
3126
3156
|
|
3127
|
-
},{"./callback-manager":
|
3157
|
+
},{"./callback-manager":28,"./debounce":29,"./throttle":40,"bean":15}],33:[function(require,module,exports){
|
3128
3158
|
var Event = require( 'bean' )
|
3129
3159
|
var callbackManager = require( './callback-manager' )
|
3130
3160
|
|
@@ -3173,7 +3203,7 @@ module.exports = {
|
|
3173
3203
|
change: change
|
3174
3204
|
}
|
3175
3205
|
|
3176
|
-
},{"./callback-manager":
|
3206
|
+
},{"./callback-manager":28,"bean":15}],34:[function(require,module,exports){
|
3177
3207
|
var delay = require( './delay' )
|
3178
3208
|
|
3179
3209
|
var repeat = function( fn, wait, limit ) {
|
@@ -3194,7 +3224,7 @@ var repeat = function( fn, wait, limit ) {
|
|
3194
3224
|
|
3195
3225
|
module.exports = repeat
|
3196
3226
|
|
3197
|
-
},{"./delay":
|
3227
|
+
},{"./delay":30}],35:[function(require,module,exports){
|
3198
3228
|
var manager = require( './optimized-event-manager' )
|
3199
3229
|
var resize = manager.new( 'resize' )
|
3200
3230
|
|
@@ -3215,7 +3245,7 @@ resize.disableAnimation = function() {
|
|
3215
3245
|
|
3216
3246
|
module.exports = resize
|
3217
3247
|
|
3218
|
-
},{"./optimized-event-manager":
|
3248
|
+
},{"./optimized-event-manager":32}],36:[function(require,module,exports){
|
3219
3249
|
var manager = require( './optimized-event-manager' )
|
3220
3250
|
var scroll = manager.new( 'scroll' )
|
3221
3251
|
|
@@ -3234,7 +3264,7 @@ scroll.disablePointer = function() {
|
|
3234
3264
|
|
3235
3265
|
module.exports = scroll
|
3236
3266
|
|
3237
|
-
},{"./optimized-event-manager":
|
3267
|
+
},{"./optimized-event-manager":32}],37:[function(require,module,exports){
|
3238
3268
|
// Custom Event Polyfill
|
3239
3269
|
(function () {
|
3240
3270
|
|
@@ -3252,7 +3282,7 @@ module.exports = scroll
|
|
3252
3282
|
window.CustomEvent = CustomEvent;
|
3253
3283
|
})()
|
3254
3284
|
|
3255
|
-
},{}],
|
3285
|
+
},{}],38:[function(require,module,exports){
|
3256
3286
|
// Manually trigger a cancelable form submit event.
|
3257
3287
|
function submit( form ) {
|
3258
3288
|
if ( !form.tagName || form.tagName != 'FORM' ) {
|
@@ -3268,7 +3298,7 @@ function submit( form ) {
|
|
3268
3298
|
|
3269
3299
|
module.exports = submit
|
3270
3300
|
|
3271
|
-
},{}],
|
3301
|
+
},{}],39:[function(require,module,exports){
|
3272
3302
|
var endEvents = [
|
3273
3303
|
'touchend'
|
3274
3304
|
]
|
@@ -3357,7 +3387,7 @@ function Tap(callback, options) {
|
|
3357
3387
|
}
|
3358
3388
|
}
|
3359
3389
|
|
3360
|
-
},{}],
|
3390
|
+
},{}],40:[function(require,module,exports){
|
3361
3391
|
var debounce = require( './debounce' )
|
3362
3392
|
|
3363
3393
|
var throttle = function( fn, wait, options ) {
|
@@ -3377,7 +3407,7 @@ var throttle = function( fn, wait, options ) {
|
|
3377
3407
|
|
3378
3408
|
module.exports = throttle
|
3379
3409
|
|
3380
|
-
},{"./debounce":
|
3410
|
+
},{"./debounce":29}],41:[function(require,module,exports){
|
3381
3411
|
var validation = require( './lib/validation' ),
|
3382
3412
|
progressive = require( './lib/progressive' ),
|
3383
3413
|
getLabel = require( './lib/get-label' ),
|
@@ -3401,7 +3431,7 @@ module.exports = {
|
|
3401
3431
|
slider: slider
|
3402
3432
|
}
|
3403
3433
|
|
3404
|
-
},{"./lib/diff":
|
3434
|
+
},{"./lib/diff":42,"./lib/get-label":44,"./lib/input-change":45,"./lib/progressive":47,"./lib/reset":48,"./lib/slider/input":52,"./lib/step-labels":55,"./lib/stepped-number-input":56,"./lib/validation":57}],42:[function(require,module,exports){
|
3405
3435
|
var toolbox = require( 'compose-toolbox' ),
|
3406
3436
|
Event = toolbox.event,
|
3407
3437
|
getLabel = require( './get-label'),
|
@@ -3607,7 +3637,7 @@ module.exports = {
|
|
3607
3637
|
watch: watch
|
3608
3638
|
}
|
3609
3639
|
|
3610
|
-
},{"./get-label":
|
3640
|
+
},{"./get-label":44,"./input-change":45,"./selector":49,"./slider/helpers":51,"compose-toolbox":63}],43:[function(require,module,exports){
|
3611
3641
|
module.exports = function extractData (el, pattern) {
|
3612
3642
|
var data = {}
|
3613
3643
|
|
@@ -3622,7 +3652,7 @@ module.exports = function extractData (el, pattern) {
|
|
3622
3652
|
return data
|
3623
3653
|
}
|
3624
3654
|
|
3625
|
-
},{}],
|
3655
|
+
},{}],44:[function(require,module,exports){
|
3626
3656
|
var toolbox = require( 'compose-toolbox' )
|
3627
3657
|
var Selector = require( './selector' )
|
3628
3658
|
|
@@ -3706,7 +3736,7 @@ getLabel.legend = getLegendText
|
|
3706
3736
|
|
3707
3737
|
module.exports = getLabel
|
3708
3738
|
|
3709
|
-
},{"./selector":
|
3739
|
+
},{"./selector":49,"compose-toolbox":63}],45:[function(require,module,exports){
|
3710
3740
|
var toolbox = require( 'compose-toolbox' ),
|
3711
3741
|
Event = toolbox.event,
|
3712
3742
|
getLabel = require( './get-label' ),
|
@@ -3853,13 +3883,13 @@ module.exports = {
|
|
3853
3883
|
watch: watch
|
3854
3884
|
}
|
3855
3885
|
|
3856
|
-
},{"./get-label":
|
3886
|
+
},{"./get-label":44,"./selector":49,"compose-toolbox":63}],46:[function(require,module,exports){
|
3857
3887
|
module.exports = function objectSize (object) {
|
3858
3888
|
var length = 0; for(var i in object) { length++ }
|
3859
3889
|
return length
|
3860
3890
|
}
|
3861
3891
|
|
3862
|
-
},{}],
|
3892
|
+
},{}],47:[function(require,module,exports){
|
3863
3893
|
var toolbox = require( 'compose-toolbox' ),
|
3864
3894
|
Event = toolbox.event,
|
3865
3895
|
Callback = toolbox.event.callback,
|
@@ -4189,7 +4219,7 @@ module.exports = {
|
|
4189
4219
|
new: newForm
|
4190
4220
|
}
|
4191
4221
|
|
4192
|
-
},{"compose-toolbox":
|
4222
|
+
},{"compose-toolbox":63}],48:[function(require,module,exports){
|
4193
4223
|
var Event = require( 'compose-event' ),
|
4194
4224
|
toolbox = require( 'compose-toolbox' ),
|
4195
4225
|
getLabel = require( './get-label' )
|
@@ -4261,10 +4291,10 @@ Event.on( document, 'click', '[data-reset-input]', resetValue )
|
|
4261
4291
|
Event.on( document, 'click', '[data-restore-default]', restoreDefault )
|
4262
4292
|
Event.on( document, 'click', '[type=reset]', resetForm )
|
4263
4293
|
|
4264
|
-
},{"./get-label":
|
4294
|
+
},{"./get-label":44,"compose-event":25,"compose-toolbox":63}],49:[function(require,module,exports){
|
4265
4295
|
module.exports = 'input:not([type=hidden]), select, textarea'
|
4266
4296
|
|
4267
|
-
},{}],
|
4297
|
+
},{}],50:[function(require,module,exports){
|
4268
4298
|
var toolbox = require( 'compose-toolbox' ),
|
4269
4299
|
extractData = require( '../extract-data' ),
|
4270
4300
|
objectSize = require( '../object-size' ),
|
@@ -4441,7 +4471,7 @@ module.exports = {
|
|
4441
4471
|
getData: getData
|
4442
4472
|
}
|
4443
4473
|
|
4444
|
-
},{"../extract-data":
|
4474
|
+
},{"../extract-data":43,"../object-size":46,"../step-index":54,"./helpers":51,"compose-toolbox":63}],51:[function(require,module,exports){
|
4445
4475
|
function getValues( min, max, values, step ) {
|
4446
4476
|
var result = {}
|
4447
4477
|
step = step || 1
|
@@ -4565,7 +4595,7 @@ module.exports = {
|
|
4565
4595
|
split: split
|
4566
4596
|
}
|
4567
4597
|
|
4568
|
-
},{}],
|
4598
|
+
},{}],52:[function(require,module,exports){
|
4569
4599
|
var toolbox = require( 'compose-toolbox' ),
|
4570
4600
|
template = require( './template' ),
|
4571
4601
|
events = require( './events' )
|
@@ -4616,7 +4646,7 @@ module.exports = {
|
|
4616
4646
|
getData: events.getData
|
4617
4647
|
}
|
4618
4648
|
|
4619
|
-
},{"./events":
|
4649
|
+
},{"./events":50,"./template":53,"compose-toolbox":63}],53:[function(require,module,exports){
|
4620
4650
|
var objectSize = require('../object-size')
|
4621
4651
|
|
4622
4652
|
function html( data, sliderHTML ) {
|
@@ -4728,7 +4758,7 @@ module.exports = {
|
|
4728
4758
|
}
|
4729
4759
|
|
4730
4760
|
|
4731
|
-
},{"../object-size":
|
4761
|
+
},{"../object-size":46}],54:[function(require,module,exports){
|
4732
4762
|
module.exports = function stepIndex (el) {
|
4733
4763
|
var min = Number(el.getAttribute('min') || 0),
|
4734
4764
|
max = Number(el.getAttribute('max') || 100),
|
@@ -4744,7 +4774,7 @@ module.exports = function stepIndex (el) {
|
|
4744
4774
|
return ( value / step ) - ( min / step )
|
4745
4775
|
}
|
4746
4776
|
|
4747
|
-
},{}],
|
4777
|
+
},{}],55:[function(require,module,exports){
|
4748
4778
|
var toolbox = require( 'compose-toolbox' ),
|
4749
4779
|
extractData = require( './extract-data' ),
|
4750
4780
|
stepIndex = require( './step-index' ),
|
@@ -4827,7 +4857,7 @@ module.exports = {
|
|
4827
4857
|
watch: watch
|
4828
4858
|
}
|
4829
4859
|
|
4830
|
-
},{"./extract-data":
|
4860
|
+
},{"./extract-data":43,"./object-size":46,"./step-index":54,"compose-toolbox":63}],56:[function(require,module,exports){
|
4831
4861
|
var toolbox = require( 'compose-toolbox' ),
|
4832
4862
|
Event = toolbox.event,
|
4833
4863
|
watching = false
|
@@ -4906,7 +4936,7 @@ module.exports = {
|
|
4906
4936
|
round: roundToNearest
|
4907
4937
|
}
|
4908
4938
|
|
4909
|
-
},{"compose-toolbox":
|
4939
|
+
},{"compose-toolbox":63}],57:[function(require,module,exports){
|
4910
4940
|
// Dependencies
|
4911
4941
|
var toolbox = require( 'compose-toolbox' ),
|
4912
4942
|
Event = toolbox.event,
|
@@ -5234,7 +5264,7 @@ module.exports = {
|
|
5234
5264
|
invalidateField: invalidateField
|
5235
5265
|
}
|
5236
5266
|
|
5237
|
-
},{"compose-toolbox":
|
5267
|
+
},{"compose-toolbox":63}],58:[function(require,module,exports){
|
5238
5268
|
var TimeToggle = require('./lib/toggle.js')
|
5239
5269
|
var Event = require('compose-event')
|
5240
5270
|
|
@@ -5246,7 +5276,7 @@ Event.change(TimeToggle.setup)
|
|
5246
5276
|
|
5247
5277
|
module.exports = TimeToggle
|
5248
5278
|
|
5249
|
-
},{"./lib/date-to-html.js":
|
5279
|
+
},{"./lib/date-to-html.js":59,"./lib/timeago.js":60,"./lib/toggle.js":61,"compose-event":25}],59:[function(require,module,exports){
|
5250
5280
|
// Converts a simple date string into Date + Time + Timezone wrapped in HTML
|
5251
5281
|
//
|
5252
5282
|
// Input:
|
@@ -5331,7 +5361,7 @@ var pad = function datePad(num, pad){
|
|
5331
5361
|
|
5332
5362
|
module.exports = DateToHTML
|
5333
5363
|
|
5334
|
-
},{}],
|
5364
|
+
},{}],60:[function(require,module,exports){
|
5335
5365
|
// Timeago by Brandon Mathis, based on JavaScript Pretty Date Copyright (c) 2011 John Resig
|
5336
5366
|
// Returns relative time
|
5337
5367
|
|
@@ -5426,7 +5456,7 @@ var Timeago = {
|
|
5426
5456
|
|
5427
5457
|
module.exports = Timeago
|
5428
5458
|
|
5429
|
-
},{}],
|
5459
|
+
},{}],61:[function(require,module,exports){
|
5430
5460
|
var Timeago = require('./timeago')
|
5431
5461
|
var DateToHTML = require('./date-to-html')
|
5432
5462
|
var Event = require('compose-event')
|
@@ -5519,7 +5549,7 @@ var Toggle = {
|
|
5519
5549
|
|
5520
5550
|
module.exports = Toggle
|
5521
5551
|
|
5522
|
-
},{"./date-to-html":
|
5552
|
+
},{"./date-to-html":59,"./timeago":60,"compose-event":25}],62:[function(require,module,exports){
|
5523
5553
|
var Event = require('compose-event')
|
5524
5554
|
|
5525
5555
|
var Toggler = {
|
@@ -5938,7 +5968,7 @@ Event.change(Toggler.refresh)
|
|
5938
5968
|
|
5939
5969
|
module.exports = Toggler
|
5940
5970
|
|
5941
|
-
},{"compose-event":
|
5971
|
+
},{"compose-event":25}],63:[function(require,module,exports){
|
5942
5972
|
// Shims
|
5943
5973
|
require( './lib/shims/_classlist' )
|
5944
5974
|
var merge = require( './lib/shims/_object.assign' ),
|
@@ -6036,19 +6066,19 @@ var toolbox = {
|
|
6036
6066
|
|
6037
6067
|
module.exports = toolbox
|
6038
6068
|
|
6039
|
-
},{"./lib/ease":
|
6040
|
-
arguments[4][18][0].apply(exports,arguments)
|
6041
|
-
},{"dup":18}],64:[function(require,module,exports){
|
6069
|
+
},{"./lib/ease":64,"./lib/fromtop":65,"./lib/scrollto":66,"./lib/shims/_classlist":67,"./lib/shims/_object.assign":68,"./lib/time":69,"compose-event":25,"luxon":72}],64:[function(require,module,exports){
|
6042
6070
|
arguments[4][19][0].apply(exports,arguments)
|
6043
6071
|
},{"dup":19}],65:[function(require,module,exports){
|
6044
6072
|
arguments[4][20][0].apply(exports,arguments)
|
6045
|
-
},{"
|
6073
|
+
},{"dup":20}],66:[function(require,module,exports){
|
6046
6074
|
arguments[4][21][0].apply(exports,arguments)
|
6047
|
-
},{"dup":21}],67:[function(require,module,exports){
|
6075
|
+
},{"./ease":64,"./fromtop":65,"dup":21}],67:[function(require,module,exports){
|
6048
6076
|
arguments[4][22][0].apply(exports,arguments)
|
6049
6077
|
},{"dup":22}],68:[function(require,module,exports){
|
6050
6078
|
arguments[4][23][0].apply(exports,arguments)
|
6051
|
-
},{"dup":23
|
6079
|
+
},{"dup":23}],69:[function(require,module,exports){
|
6080
|
+
arguments[4][24][0].apply(exports,arguments)
|
6081
|
+
},{"dup":24,"luxon":72}],70:[function(require,module,exports){
|
6052
6082
|
if (typeof Object.create === 'function') {
|
6053
6083
|
// implementation from standard node.js 'util' module
|
6054
6084
|
module.exports = function inherits(ctor, superCtor) {
|
@@ -6073,7 +6103,7 @@ if (typeof Object.create === 'function') {
|
|
6073
6103
|
}
|
6074
6104
|
}
|
6075
6105
|
|
6076
|
-
},{}],
|
6106
|
+
},{}],71:[function(require,module,exports){
|
6077
6107
|
// keymaster.js
|
6078
6108
|
// (c) 2011-2013 Thomas Fuchs
|
6079
6109
|
// keymaster.js may be freely distributed under the MIT license.
|
@@ -6371,7 +6401,7 @@ if (typeof Object.create === 'function') {
|
|
6371
6401
|
|
6372
6402
|
})(this);
|
6373
6403
|
|
6374
|
-
},{}],
|
6404
|
+
},{}],72:[function(require,module,exports){
|
6375
6405
|
'use strict';
|
6376
6406
|
|
6377
6407
|
Object.defineProperty(exports, '__esModule', { value: true });
|
@@ -13326,7 +13356,7 @@ exports.LocalZone = LocalZone;
|
|
13326
13356
|
exports.Settings = Settings;
|
13327
13357
|
|
13328
13358
|
|
13329
|
-
},{"util":
|
13359
|
+
},{"util":81}],73:[function(require,module,exports){
|
13330
13360
|
// shim for using process in browser
|
13331
13361
|
var process = module.exports = {};
|
13332
13362
|
|
@@ -13512,7 +13542,7 @@ process.chdir = function (dir) {
|
|
13512
13542
|
};
|
13513
13543
|
process.umask = function() { return 0; };
|
13514
13544
|
|
13515
|
-
},{}],
|
13545
|
+
},{}],74:[function(require,module,exports){
|
13516
13546
|
function Agent() {
|
13517
13547
|
this._defaults = [];
|
13518
13548
|
}
|
@@ -13534,7 +13564,7 @@ Agent.prototype._setDefaults = function(req) {
|
|
13534
13564
|
|
13535
13565
|
module.exports = Agent;
|
13536
13566
|
|
13537
|
-
},{}],
|
13567
|
+
},{}],75:[function(require,module,exports){
|
13538
13568
|
/**
|
13539
13569
|
* Root reference for iframes.
|
13540
13570
|
*/
|
@@ -14456,7 +14486,7 @@ request.put = function(url, data, fn) {
|
|
14456
14486
|
return req;
|
14457
14487
|
};
|
14458
14488
|
|
14459
|
-
},{"./agent-base":
|
14489
|
+
},{"./agent-base":74,"./is-object":76,"./request-base":77,"./response-base":78,"component-emitter":16}],76:[function(require,module,exports){
|
14460
14490
|
'use strict';
|
14461
14491
|
|
14462
14492
|
/**
|
@@ -14473,7 +14503,7 @@ function isObject(obj) {
|
|
14473
14503
|
|
14474
14504
|
module.exports = isObject;
|
14475
14505
|
|
14476
|
-
},{}],
|
14506
|
+
},{}],77:[function(require,module,exports){
|
14477
14507
|
'use strict';
|
14478
14508
|
|
14479
14509
|
/**
|
@@ -15169,7 +15199,7 @@ RequestBase.prototype._setTimeouts = function() {
|
|
15169
15199
|
}
|
15170
15200
|
};
|
15171
15201
|
|
15172
|
-
},{"./is-object":
|
15202
|
+
},{"./is-object":76}],78:[function(require,module,exports){
|
15173
15203
|
'use strict';
|
15174
15204
|
|
15175
15205
|
/**
|
@@ -15307,7 +15337,7 @@ ResponseBase.prototype._setStatusProperties = function(status){
|
|
15307
15337
|
this.unprocessableEntity = 422 == status;
|
15308
15338
|
};
|
15309
15339
|
|
15310
|
-
},{"./utils":
|
15340
|
+
},{"./utils":79}],79:[function(require,module,exports){
|
15311
15341
|
'use strict';
|
15312
15342
|
|
15313
15343
|
/**
|
@@ -15380,14 +15410,14 @@ exports.cleanHeader = function(header, changesOrigin){
|
|
15380
15410
|
return header;
|
15381
15411
|
};
|
15382
15412
|
|
15383
|
-
},{}],
|
15413
|
+
},{}],80:[function(require,module,exports){
|
15384
15414
|
module.exports = function isBuffer(arg) {
|
15385
15415
|
return arg && typeof arg === 'object'
|
15386
15416
|
&& typeof arg.copy === 'function'
|
15387
15417
|
&& typeof arg.fill === 'function'
|
15388
15418
|
&& typeof arg.readUInt8 === 'function';
|
15389
15419
|
}
|
15390
|
-
},{}],
|
15420
|
+
},{}],81:[function(require,module,exports){
|
15391
15421
|
(function (process,global){
|
15392
15422
|
// Copyright Joyent, Inc. and other Node contributors.
|
15393
15423
|
//
|
@@ -15978,7 +16008,7 @@ function hasOwnProperty(obj, prop) {
|
|
15978
16008
|
|
15979
16009
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
15980
16010
|
|
15981
|
-
},{"./support/isBuffer":
|
16011
|
+
},{"./support/isBuffer":80,"_process":73,"inherits":70}]},{},[14])(14)
|
15982
16012
|
});
|
15983
16013
|
|
15984
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJhcHAvYXNzZXRzL2phdmFzY3JpcHRzL3R1bmdzdGVuL19lc3ZnLmpzIiwiYXBwL2Fzc2V0cy9qYXZhc2NyaXB0cy90dW5nc3Rlbi9faWNvbnMuanMiLCJhcHAvYXNzZXRzL2phdmFzY3JpcHRzL3R1bmdzdGVuL2VuaGFuY2VtZW50cy9mbGFzaC1tZXNzYWdlcy5qcyIsImFwcC9hc3NldHMvamF2YXNjcmlwdHMvdHVuZ3N0ZW4vZW5oYW5jZW1lbnRzL2Zvcm0tc3VibWl0LWhlbHBlcnMuanMiLCJhcHAvYXNzZXRzL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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgLy8ga2V5Ym9hcmRcbiAgICAgICAgJ29yaWVudGF0aW9uY2hhbmdlICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIC8vIG1vYmlsZVxuICAgICAgICAnZm9jdXMgYmx1ciBjaGFuZ2UgcmVzZXQgc2VsZWN0IHN1Ym1pdCAnICAgICAgICAgICAgICAgICAgICAgICAgICsgLy8gZm9ybSBlbGVtZW50c1xuICAgICAgICAnbG9hZCB1bmxvYWQgYmVmb3JldW5sb2FkIHJlc2l6ZSBtb3ZlIERPTUNvbnRlbnRMb2FkZWQgJyAgICAgICAgICsgLy8gd2luZG93XG4gICAgICAgICdyZWFkeXN0YXRlY2hhbmdlIG1lc3NhZ2UgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyB3aW5kb3dcbiAgICAgICAgJ2Vycm9yIGFib3J0IHNjcm9sbCAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1pc2NcbiAgICAgIC8vIGVsZW1lbnQuZmlyZUV2ZW50KCdvblhZWicuLi4gaXMgbm90IGZvcmdpdmluZyBpZiB3ZSB0cnkgdG8gZmlyZSBhbiBldmVudFxuICAgICAgLy8gdGhhdCBkb2Vzbid0IGFjdHVhbGx5IGV4aXN0LCBzbyBtYWtlIHN1cmUgd2Ugb25seSBkbyB0aGVzZSBvbiBuZXdlciBicm93c2Vyc1xuICAgICwgdzNjTmF0aXZlRXZlbnRzID1cbiAgICAgICAgJ3Nob3cgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIC8vIG1vdXNlIGJ1dHRvbnNcbiAgICAgICAgJ2lucHV0IGludmFsaWQgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIC8vIGZvcm0gZWxlbWVudHNcbiAgICAgICAgJ3RvdWNoc3RhcnQgdG91Y2htb3ZlIHRvdWNoZW5kIHRvdWNoY2FuY2VsICcgICAgICAgICAgICAgICAgICAgICArIC8vIHRvdWNoXG4gICAgICAgICdnZXN0dXJlc3RhcnQgZ2VzdHVyZWNoYW5nZSBnZXN0dXJlZW5kICcgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyBnZXN0dXJlXG4gICAgICAgICd0ZXh0aW5wdXQgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyBUZXh0RXZlbnRcbiAgICAgICAgJ3JlYWR5c3RhdGVjaGFuZ2UgcGFnZXNob3cgcGFnZWhpZGUgcG9wc3RhdGUgJyAgICAgICAgICAgICAgICAgICArIC8vIHdpbmRvd1xuICAgICAgICAnaGFzaGNoYW5nZSBvZmZsaW5lIG9ubGluZSAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgLy8gd2luZG93XG4gICAgICAgICdhZnRlcnByaW50IGJlZm9yZXByaW50ICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyBwcmludGluZ1xuICAgICAgICAnZHJhZ3N0YXJ0IGRyYWdlbnRlciBkcmFnb3ZlciBkcmFnbGVhdmUgZHJhZyBkcm9wIGRyYWdlbmQgJyAgICAgICsgLy8gZG5kXG4gICAgICAgICdsb2Fkc3RhcnQgcHJvZ3Jlc3Mgc3VzcGVuZCBlbXB0aWVkIHN0YWxsZWQgbG9hZG1ldGFkYXRhICcgICAgICAgKyAvLyBtZWRpYVxuICAgICAgICAnbG9hZGVkZGF0YSBjYW5wbGF5IGNhbnBsYXl0aHJvdWdoIHBsYXlpbmcgd2FpdGluZyBzZWVraW5nICcgICAgICsgLy8gbWVkaWFcbiAgICAgICAgJ3NlZWtlZCBlbmRlZCBkdXJhdGlvbmNoYW5nZSB0aW1ldXBkYXRlIHBsYXkgcGF1c2UgcmF0ZWNoYW5nZSAnICAr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cmVEb2N1bWVudFBvc2l0aW9uKGVsZW1lbnQpICYgMTYpID09PSAxNlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgOiAnY29udGFpbnMnIGluIHJvb3RcbiAgICAgICAgICAgICAgICA/IGZ1bmN0aW9uIChlbGVtZW50LCBjb250YWluZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyID0gY29udGFpbmVyLm5vZGVUeXBlID09PSA5IHx8IGNvbnRhaW5lciA9PT0gd2luZG93ID8gcm9vdCA6IGNvbnRhaW5lclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udGFpbmVyICE9PSBlbGVtZW50ICYmIGNvbnRhaW5lci5jb250YWlucyhlbGVtZW50KVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIDogZnVuY3Rpb24gKGVsZW1lbnQsIGNvbnRhaW5lcikge1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoZWxlbWVudCA9IGVsZW1lbnQucGFyZW50Tm9kZSkgaWYgKGVsZW1lbnQgPT09IGNvbnRhaW5lcikgcmV0dXJuIDFcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDBcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAsIGNoZWNrID0gZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgIHZhciByZWxhdGVkID0gZXZlbnQucmVsYXRlZFRhcmdldFxuICAgICAgICAgICAgICByZXR1cm4gIXJlbGF0ZWRcbiAgICAgICAgICAgICAgICA/IHJlbGF0ZWQgPT0gbnVsbFxuICAgICAgICAgICAgICAgIDogKHJlbGF0ZWQgIT09IHRoaXMgJiYgcmVsYXRlZC5wcmVmaXggIT09ICd4dWwnICYmICEvZG9jdW1lbnQvLnRlc3QodGhpcy50b1N0cmluZygpKVxuICAgICAgICAgICAgICAgICAgICAmJiAhaXNBbmNlc3RvcihyZWxhdGVkLCB0aGlzKSlcbiAgICAgICAgICAgIH1cblxuICAg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N0YXRlUHJvcHMgICA9IGNvbW1vblByb3BzLmNvbmNhdChzdHIyYXJyKCdzdGF0ZScpKVxuICAgICAgICAgICwgb3Zlck91dFJlZ2V4ID0gL292ZXJ8b3V0L1xuICAgICAgICAgICAgLy8gc29tZSBldmVudCB0eXBlcyBuZWVkIHNwZWNpYWwgaGFuZGxpbmcgYW5kIHNvbWUgbmVlZCBzcGVjaWFsIHByb3BlcnRpZXMsIGRvIHRoYXQgYWxsIGhlcmVcbiAgICAgICAgICAsIHR5cGVGaXhlcnMgICA9IFtcbiAgICAgICAgICAgICAgICB7IC8vIGtleSBldmVudHNcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAva2V5L2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoZXZlbnQsIG5ld0V2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgbmV3RXZlbnQua2V5Q29kZSA9IGV2ZW50LmtleUNvZGUgfHwgZXZlbnQud2hpY2hcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ga2V5UHJvcHNcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLCB7IC8vIG1vdXNlIGV2ZW50c1xuICAgICAgICAgICAgICAgICAgICByZWc6IC9jbGlja3xtb3VzZSg/ISguKndoZWVsfHNjcm9sbCkpfG1lbnV8ZHJhZ3xkcm9wL2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoZXZlbnQsIG5ld0V2ZW50LCB0eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgbmV3RXZlbnQucmlnaHRDbGljayA9IGV2ZW50LndoaWNoID09PSAzIHx8IGV2ZW50LmJ1dHRvbiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgIG5ld0V2ZW50LnBvcyA9IHsgeDogMCwgeTogMCB9XG4gICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LnBhZ2VYIHx8IGV2ZW50LnBhZ2VZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdFdmVudC5jbGllbnRYID0gZXZlbnQucGFnZVhcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0V2ZW50LmNsaWVudFkgPSBldmVudC5wYWdlWVxuICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuY2xpZW50WCB8fCBldmVudC5jbGllbnRZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdFdmVudC5jbGllbnRYID0gZXZlbnQuY2xpZW50WCArIGRvYy5ib2R5LnNjcm9sbExlZnQgKyByb290LnNjcm9sbExlZnRcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0V2ZW50LmNsaWVudFkgPSBldmVudC5jbGllbnRZICsgZG9jLmJvZHkuc2Nyb2xsVG9wICsgcm9vdC5zY3JvbGxUb3BcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgaWYgKG92ZXJPdXRSZWdleC50ZXN0KHR5cGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdFdmVudC5yZWxhdGVkVGFyZ2V0ID0gZXZlbnQucmVsYXRlZFRhcmdldFxuICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBldmVudFsodHlwZSA9PSAnbW91c2VvdmVyJyA/ICdmcm9tJyA6ICd0bycpICsgJ0VsZW1lbnQnXVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbW91c2VQcm9wc1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAsIHsgLy8gbW91c2Ugd2hlZWwgZXZlbnRzXG4gICAgICAgICAgICAgICAgICAgIHJlZzogL21vdXNlLiood2hlZWx8c2Nyb2xsKS9pXG4gICAgICAgICAgICAgICAgICAsIGZpeDogZnVuY3Rpb24gKCkgeyByZXR1cm4gbW91c2VXaGVlbFByb3BzIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgeyAvLyBUZXh0RXZlbnRcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAvXnRleHQvaVxuICAgICAgICAgICAgICAgICAgLCBmaXg6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRleHRQcm9wcyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAsIHsgLy8gdG91Y2ggYW5kIGdlc3R1cmUgZXZlbnRzXG4gICAgICAgICAgICAgICAgICAgIHJlZzogL150b3VjaHxeZ2VzdHVyZS9pXG4gICAgICAgICAgICAgICAgICAsIGZpeDogZnVuY3Rpb24gKCkgeyByZXR1cm4gdG91Y2hQcm9wcyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAsIHsgLy8gbWVzc2FnZSBldmVudHNcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAvXm1lc3NhZ2UkL2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoKSB7IHJldHVybiBtZXNzYWdlUHJvcHMgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLCB7IC8vIHBvcHN0YXRlIGV2ZW50c1xuICAgICAgICAgICAgICAgICAgICByZWc6IC9ecG9wc3RhdGUkL2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoKSB7IHJldHVybiBzdGF0ZVByb3BzIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgeyAvLyBldmVyeXRoaW5nIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAvLiovXG4gICAgICAgICAgICAgICAgICAsIGZpeDogZnVuY3Rpb24gKCkgeyByZXR1cm4gY29tbW9uUHJvcHMgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICAsIHR5cGVGaXhlck1hcCA9IHt9IC8vIHVzZWQgdG8gbWFwIGV2ZW50IHR5cGVzIH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AgICAgICAgIGlmICghZml4ZXIpIHsgLy8gaGF2ZW4ndCBlbmNvdW50ZXJlZCB0aGlzIGV2ZW50IHR5cGUgYmVmb3JlLCBtYXAgYSBmaXhlciBmdW5jdGlvbiBmb3IgaXRcbiAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDAsIGwgPSB0eXBlRml4ZXJzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZUZpeGVyc1tpXS5yZWcudGVzdCh0eXBlKSkgeyAvLyBndWFyYW50ZWVkIHRvIG1hdGNoIGF0IGxlYXN0IG9uZSwgbGFzdCBpcyAuKlxuICAgICAgICAgICAgICAgICAgICAgIHR5cGVGaXhlck1hcFt0eXBlXSA9IGZpeGVyID0gdHlwZUZpeGVyc1tpXS5maXhcbiAgICAgICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcHJvcHMgPSBmaXhlcihldmVudCwgdGhpcywgdHlwZSlcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSBwcm9wcy5sZW5ndGg7IGktLTspIHtcbiAgICAgICAgICAgICAgICAgIGlmICghKChwID0gcHJvcHNbaV0pIGluIHRoaXMpICYmIHAgaW4gZXZlbnQpIHRoaXNbcF0gPSBldmVudFtwXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgIC8vIHByZXZlbnREZWZhdWx0KCkgYW5kIHN0b3BQcm9wYWdhdGlvbigpIGFyZSBhIGNvbnNpc3RlbnQgaW50ZXJmYWNlIHRvIHRob3NlIGZ1bmN0aW9uc1xuICAgICAgICAvLyBvbiB0aGUgRE9NLCBzdG9wKCkgaXMgYW4gYWxpYXMgZm9yIGJvdGggb2YgdGhlbSB0b2dldGhlclxuICAgICAgICBFdmVudC5wcm90b3R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mFwcGx5KGVsZW1lbnQsIGFyZ3MgPyBzbGljZS5jYWxsKGVhcmdzLCBldmVudCA/IDAgOiAxKS5jb25jYXQoYXJncykgOiBlYXJncylcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgZmluZFRhcmdldCA9IGZ1bmN0aW9uIChldmVudCwgZXZlbnRFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gZm4uX19iZWFuRGVsID8gZm4uX19iZWFuRGVsLmZ0KGV2ZW50LnRhcmdldCwgZWxlbWVudCkgOiBldmVudEVsZW1lbnRcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgaGFuZGxlciA9IGNvbmRpdGlvblxuICAgICAgICAgICAgICAgICAgPyBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgdGFyZ2V0ID0gZmluZFRhcmdldChldmVudCwgdGhpcykgLy8gZGVsZWF0ZWQgZXZlbnRcbiAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZGl0aW9uLmFwcGx5KHRhcmdldCwgYXJndW1lbnRzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50KSBldmVudC5jdXJyZW50VGFyZ2V0ID0gdGFyZ2V0XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbChldmVudCwgYXJndW1lbnRzKVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgOiBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICBpZiAoZm4uX19iZWFuRGVsKSBldmVudCA9IGV2ZW50LmNsb25lKGZpbmRUYXJnZXQoZXZlbnQpKSAvLyBkZWxlZ2F0ZWQgZXZlbnQsIGZpeCB0aGUgZml4XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGwoZXZlbnQsIGFyZ3VtZW50cylcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGFuZGxlci5fX2JlYW5EZWwgPSBmbi5fX2JlYW5EZWxcbiAgICAgICAgICAgIHJldHVybiBoYW5kbGVyXG4gICAgICAgICAgfVxuXG4gICAgICAgICwgUmVnRW50cnkgPSBmdW5jdGlvbiAoZWxlbWVudCwgdHlwZSwgaGFuZGxlciwgb3JpZ2luYWwsIG5hbWVzcGFjZXMsIGFyZ3MsIHJvb3QpIHtcbiAgICAgICAgICAgIHZhciBjdXN0b21UeXBlICAgICA9IGN1c3RvbUV2ZW50c1t0eXBlXVxuICAgICAgICAgICAgICAsIGlzTmF0aXZlXG5cbiAgICAgICAgICAgIGlmICh0eXBlID09ICd1bmxvYWQnKSB7XG4gICAgICAgICAgICAgIC8vIHNlbGYgY2xlYW4tdXBcbiAgICAgICAgICAgICAgaGFuZGxlciA9IG9uY2UocmVtb3ZlTGlzdGVuZXIsIGVsZW1lbnQsIHR5cGUsIGhhbmRsZXIsIG9yaWdpbmFsKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY3VzdG9tVHlwZSkge1xuICAgICAgICAgICAgICBpZiAoY3VzdG9tVHlwZS5jb25kaXRpb24pIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVyID0gd3JhcHBlZEhhbmRsZXIoZWxlbWVudCwgaGFuZGxlciwgY3VzdG9tVHlwZS5jb25kaXRpb24sIGFyZ3MpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgdHlwZSA9IGN1c3RvbVR5cGUuYmFzZSB8fCB0eXBlXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuaXNOYXRpdmUgICAgICA9IGlzTmF0aXZlID0gbmF0aXZlRXZlbnRzW3R5cGVdICYmICEhZWxlbWVudFtldmVudFN1cHBvcnRdXG4gICAgICAgICAgICB0aGlzLmN1c3RvbVR5cGUgICAgPSAhVzNDX01PREVMICYmICFpc05hdGl2ZSAmJiB0eXBlXG4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gICAgIC8vIHJvb3RMaXN0ZW5lcnMgc28gd2UgY2FuIGxvb2sgdGhlbSB1cCBmYXN0XG4gICAgICAgIHZhciBtYXAgPSB7fVxuXG4gICAgICAgICAgLy8gZ2VuZXJpYyBmdW5jdGlvbmFsIHNlYXJjaCBvZiBvdXIgcmVnaXN0cnkgZm9yIG1hdGNoaW5nIGxpc3RlbmVycyxcbiAgICAgICAgICAvLyBgZm5gIHJldHVybnMgZmFsc2UgdG8gYnJlYWsgb3V0IG9mIHRoZSBsb29wXG4gICAgICAgICAgLCBmb3JBbGwgPSBmdW5jdGlvbiAoZWxlbWVudCwgdHlwZSwgb3JpZ2luYWwsIGhhbmRsZXIsIHJvb3QsIGZuKSB7XG4gICAgICAgICAgICAgIHZhciBwZnggPSByb290ID8gJ3InIDogJyQnXG4gICAgICAgICAgICAgIGlmICghdHlwZSB8fCB0eXBlID09ICcqJykge1xuICAgICAgICAgICAgICAgIC8vIHNlYXJjaCB0aGUgd2hvbGUgcmVnaXN0cnlcbiAgICAgICAgICAgICAgICBmb3IgKHZhciB0IGluIG1hcCkge1xuICAgICAgICAgICAgICAgICAgaWYgKHQuY2hhckF0KDApID09IHBmeCkge1xuICAgICAgICAgICAgICAgICAgICBmb3JBbGwoZWxlbWVudCwgdC5zdWJzdHIoMSksIG9yaWdpbmFsLCBoYW5kbGVyLCByb290LCBmbilcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGkgPSAwLCBsLCBsaXN0ID0gbWFwW3BmeCArIHR5cGVdLCBhbGwgPSBlbGVtZW50ID09ICcqJ1xuICAgICAgICAgICAgICAgIGlmICghbGlzdCkgcmV0dXJuXG4gICAgICAgICAgICAgICAgZm9yIChsID0gbGlzdC5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgIGlmICgoYWxsIHx8IGxpc3RbaV0ubWF0Y2hlcyhlbGVtZW50LCBvcmlnaW5hbCwgaGFuZGxlcikpICYmICFmbihsaXN0W2ldLCBsaXN0LCBpLCB0eXBlKSkgcmV0dXJuXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAsIGhhcyA9IGZ1bmN0aW9uIChlbGVtZW50LCB0eXBlLCBvcmlnaW5hbCwgcm9vdCkge1xuICAgICAgICAgICAgICAvLyB3ZSdyZSBub3QgdXNpbmcgZm9yQWxsIGhlcmUgc2ltcGx5IGJlY2F1c2UgaXQncyBhIGJpdCBzbG93ZXIgYW5kIHRoaXNcbiAgICAgICAgICAgICAgLy8gbmVlZHMgdG8gYmUgZmFzdFxuICAgICAgICAgICAgICB2YXIgaSwgbGlzdCA9IG1hcFsocm9vdCA/ICdyJyA6ICckJykgKyB0eXBlXVxuICAgICAgICAgICAgICBpZiAobGlzdCkge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IGxpc3QubGVuZ3RoOyBpLS07KSB7XG4gICAgICAgICAgICAgICAgICBpZiAoIWxpc3RbaV0ucm9vdCAmJiBsaXN0W2ldLm1hdGNoZXMoZWxlbWVudCwgb3JpZ2luYWwsIG51bGwpKSByZXR1cm4gdHJ1ZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICwgZ2V0ID0gZnVuY3Rpb24gKGVsZW1lbnQsIHR5cGUsIG9yaWdpbmFsLCByb290KSB7XG4gICAgICAgICAgICAgIHZhciBlbnRyaWVzID0gW11cbiAgICAgICAgICAgICAgZm9yQWxsKGVsZW1lbnQsIHR5cGUsIG9yaWdpbmFsLCBudWxsLCByb290LCBmdW5jdGlvbiAoZW50cnkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZW50cmllcy5wdXNoKGVudHJ5KVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICByZXR1cm4gZW50cmllc1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgLCBwdXQgPSBmdW5jdGlvbiAoZW50cnkpIHtcbiAgICAgICAgICAgICAgdmFyIGhhcyA9ICFlbnRyeS5yb290ICYmICF0aGlzLmhhcyhlbnRyeS5lbGVtZW50LCBlbnRyeS50eXBlLCBudWxsLCBmYWxzZSlcbiAgICAgICAgICAgICAgICAsIGtleSA9IChlbnRyeS5yb290ID8gJ3InIDogJyQnKSArIGVudHJ5LnR5cGVcbiAgICAgICAgICAgICAgOyhtYXBba2V5XSB8fCAobWFwW2tleV0gPSBbXSkpLnB1c2goZW50cnkpXG4gICAgICAgICAgICAgIHJldHVybiBoYXNcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICwgZGVsID0gZnVuY3Rpb24gKGVudHJ5KSB7XG4gICAgICAgICAgICAgIGZvckFsbChlbnRyeS5lbGVtZW50LCBlbnRyeS50eXBlLCBudWxsLCBlbnRyeS5oYW5kbGVyLCBlbnRyeS5yb290LCBmdW5jdGlvbiAoZW50cnksIGxpc3QsIGkpIHtcbiAgICAgICAgICAgICAgICBsaXN0LnNwbGljZShpLCAxKVxuICAgICAgICAgICAgICAgIGVudHJ5LnJlbW92ZWQgPSB0cnVlXG4gICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09PSAwKSBkZWxldGUgbWFwWyhlbnRyeS5yb290ID8gJ3InIDogJyQnKSArIGVudHJ5LnR5cGVdXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGR1bXAgYWxsIGVudHJpZXMsIHVzZWQgZm9yIG9udW5sb2FkXG4gICAgICAgICAgLCBlbnRyaWVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICB2YXIgdCwgZW50cmllcyA9IFtdXG4gICAgICAgICAgICAgIGZvciAodCBpbiBtYXApIHtcbi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ICAgICAgICAgICwgbnVsbFxuICAgICAgICAgICAgICAgICwgbnVsbFxuICAgICAgICAgICAgICAgICwgdHJ1ZSAvLyBpcyByb290XG4gICAgICAgICAgICAgICkpXG4gICAgICAgICAgICAgIGlmIChjdXN0b20gJiYgZWxlbWVudFsnX29uJyArIGN1c3RvbV0gPT0gbnVsbCkgZWxlbWVudFsnX29uJyArIGN1c3RvbV0gPSAwXG4gICAgICAgICAgICAgIGVudHJ5LnRhcmdldC5hdHRhY2hFdmVudCgnb24nICsgZW50cnkuZXZlbnRUeXBlLCBlbnRyeS5oYW5kbGVyKVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgZW50cnkgPSByZWdpc3RyeS5nZXQoZWxlbWVudCwgY3VzdG9tIHx8IHR5cGUsIHJvb3RMaXN0ZW5lciwgdHJ1ZSlbMF1cbiAgICAgICAgICAgICAgaWYgKGVudHJ5KSB7XG4gICAgICAgICAgICAgICAgZW50cnkudGFyZ2V0LmRldGFjaEV2ZW50KCdvbicgKyBlbnRyeS5ldmVudFR5cGUsIGVudHJ5LmhhbmRsZXIpXG4gICAgICAgICAgICAgICAgcmVnaXN0cnkuZGVsKGVudHJ5KVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgLCBvbmNlID0gZnVuY3Rpb24gKHJtLCBlbGVtZW50LCB0eXBlLCBmbiwgb3JpZ2luYWxGbikge1xuICAgICAgICAvLyB3cmFwIHRoZSBoYW5kbGVyIGluIGEgaGFuZGxlciB0aGF0IGRvZXMgYSByZW1vdmUgYXMgd2VsbFxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIGZuLmFwcGx5KHRoaXMsIGFyZ3VtZW50cylcbiAgICAgICAgICBybShlbGVtZW50LCB0eXBlLCBvcmlnaW5hbEZuKVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAsIHJlbW92ZUxpc3RlbmVyID0gZnVuY3Rpb24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W5kbGVyc1tpXS5vcmlnaW5hbCkge1xuICAgICAgICAgICAgYXJncyA9IFsgZWxlbWVudCwgaGFuZGxlcnNbaV0udHlwZSBdXG4gICAgICAgICAgICBpZiAoYmVhbkRlbCA9IGhhbmRsZXJzW2ldLmhhbmRsZXIuX19iZWFuRGVsKSBhcmdzLnB1c2goYmVhbkRlbC5zZWxlY3RvcilcbiAgICAgICAgICAgIGFyZ3MucHVzaChoYW5kbGVyc1tpXS5vcmlnaW5hbClcbiAgICAgICAgICAgIG9uLmFwcGx5KG51bGwsIGFyZ3MpXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBlbGVtZW50XG4gICAgICB9XG5cbiAgICAsIGJlYW4gPSB7XG4gICAgICAgICAgJ29uJyAgICAgICAgICAgICAgICA6IG9uXG4gICAgICAgICwgJ2FkZCcgICAgICAgICAgICAgICA6IGFkZFxuICAgICAgICAsICdvbmUnICAgICAgICAgICAgICAgOiBvbmVcbiAgICAgICAgLCAnb2ZmJyAgICAgICAgICAgICAgIDogb2ZmXG4gICAgICAgICwgJ3JlbW92ZScgICAgICAgICAgICA6IG9mZlxuICAgICAgICAsICdjbG9uZScgICAgICAgICAgICAgOiBjbG9uZVxuICAgICAgICAsICdmaXJlJyAgICAgICAgICAgICAgOiBmaXJlXG4gICAgICAgICwgJ0V2ZW50JyAgICAgICAgICAgICA6IEV2ZW50XG4gICAgICAgICwgJ3NldFNlbGVjdG9yRW5naW5lJyA6IHNldFNlbGVjdG9yRW5naW5lXG4gICAgICAgICwgJ25vQ29uZmxpY3QnICAgICAgICA6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNvbnRleHRbbmFtZV0gPSBvbGRcbiAgICAgICAgICAgIHJldHVybiB0aGlzXG4gICAgICAgICAgfVxuICAgICAgfVxuXG4gIC8vIGZvciBJRSwgY2xlYW4gdXAgb24gdW5sb2FkIHRvIGF2b2lkIGxlYWtzXG4gIGlmICh3aW4uYXR0YWNoRXZlbn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uXG4gICAgICBET01FeCA9IGZ1bmN0aW9uKCB0eXBlLCBtZXNzYWdlICkge1xuICAgICAgICB0aGlzLm5hbWUgICAgPSB0eXBlO1xuICAgICAgICB0aGlzLmNvZGUgICAgPSBET01FeGNlcHRpb25bIHR5cGUgXTtcbiAgICAgICAgdGhpcy5tZXNzYWdlID0gbWVzc2FnZTtcbiAgICAgIH0sXG5cbiAgICAgIGNoZWNrVG9rZW5BbmRHZXRJbmRleCA9IGZ1bmN0aW9uKCBjbGFzc0xpc3QsIHRva2VuICkge1xuICAgICAgICBpZiAoIHRva2VuID09PSAnJyApIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRE9NRXgoXG4gICAgICAgICAgICAnU1lOVEFYX0VSUicsXG4gICAgICAgICAgICAnQW4gaW52YWxpZCBvciBpbGxlZ2FsIHN0cmluZyB3YXMgc3BlY2lmaWVkJ1xuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCAvXFxzLy50ZXN0KCB0b2tlbiApICkge1xuICAgICAgICAgIHRocm93IG5ldyBET01FeChcbiAgICAgICAgICAgICdJTlZBTElEX0NIQVJBQ1RFUl9FUlInLFxuICAgICAgICAgICAgJ1N0cmluZyBjb250YWlucyBhbiBpbnZhbGlkIGNoYXJhY3RlcidcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhcnJJbmRleE9mLmNhbGwoIGNsYXNzTGlzdCwgdG9rZW4gKTtcbiAgICAgIH0sXG5cbiAgICAgIENsYXNzTGlzdCA9IGZ1bmN0aW9uKCBlbGVtICkge1xuICAgICAgICB2YXIgdHJpbW1lZENsYXNzZXMgPSBzdHJUcmltLmNhbGwoIGVsZW0uZ2V0QXR0cmlidXRlKCAnY2xhc3MnICkgfHwgJycgKSxcbiAgICAgICAgICAgIGNsYXNzZXMgPSB0cmltbWVkQ2xhc3NlcyA/IHRyaW1tZWRDbGFzc2VzLnNwbGl0KCAvXFxzKy8gKSA6IFtdO1xuXG4gIC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uXG4gICAgICBkbyB7XG4gICAgICAgIHRva2VuID0gdG9rZW5zWyBpdGVyIF0gKyAnJztcbiAgICAgICAgaWYgKCBjaGVja1Rva2VuQW5kR2V0SW5kZXgoIHRoaXMsIHRva2VuICkgPT09IC0xICkge1xuICAgICAgICAgIHRoaXMucHVzaCggdG9rZW4gKTtcbiAgICAgICAgICB1cGRhdGVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICB3aGlsZSAoICsraXRlciA8IGxlbiApO1xuXG4gICAgICBpZiAoIHVwZGF0ZWQgKSB7XG4gICAgICAgIHRoaXMuX3VwZGF0ZUNsYXNzTmFtZSgpO1xuICAgICAgfVxuICAgIH07XG5cbiAgICBjbGFzc0xpc3RQcm90by5yZW1vdmUgPSBmdW5jdGlvbigpIHtcbiAgICAgIHZhclxuICAgICAgICB0b2tlbnMgID0gYXJndW1lbnRzLFxuICAgICAgICBpdGVyICAgID0gMCxcbiAgICAgICAgbGVuICAgICA9IHRva2Vucy5sZW5ndGgsXG4gICAgICAgIHVwZGF0ZWQgPSBmYWxzZSxcbiAgICAgICAgdG9rZW4sXG4gICAgICAgIGluZGV4O1xuXG4gICAgICBkbyB7XG4gICAgICAgIHRva2VuID0gdG9rZW5zWyBpdGVyIF0gKyAnJztcbiAgICAgICAgaW5kZXggPSBjaGVja1Rva2VuQW5kR2V0SW5kZXgoIHRoaXMsIHRva2VuICk7XG5cbiAgICAgICAgd2hpbGUgKCBpbmRleCAhPT0gLTEgKSB7XG4gICAgICAgICAgdGhpcy5zcGxpY2UoIGluZGV4LCAxICk7XG4gICAgICAgICAgdXBkYXRlZCA9IHRydWU7XG4gICAgICAgICAgaW5kZXggPSBjaGVja1Rva2VuQW5kR2V0SW5kZXgoIHRoaXMsIHRva2VuICk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgd2hpbGUgKCArK2l0ZXIgPCBsZW4gKTtcblxuICAgICAgaWYgKCB1cGRhdGVkICkge1xuICAgICAgIC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G4gICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IGxlbjsgaSsrICkge1xuICAgICAgICAgICAgICB0b2tlbiA9IGFyZ3VtZW50c1sgaSBdO1xuICAgICAgICAgICAgICBvcmlnaW5hbC5jYWxsKCB0aGlzLCB0b2tlbiApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG4gICAgICAgIH07XG4gICAgICAgIGNyZWF0ZU1ldGhvZCggJ2FkZCcgKTtcbiAgICAgICAgY3JlYXRlTWV0aG9kKCAncmVtb3ZlJyApO1xuICAgICAgfVxuXG4gICAgICB0ZXN0RWxlbWVudC5jbGFzc0xpc3QudG9nZ2xlKCAnYzMnLCBmYWxzZSApO1xuXG4gICAgICBpZiAoIHRlc3RFbGVtZW50LmNsYXNzTGlzdC5jb250YWlucyggJ2MzJyApICkge1xuICAgICAgICB2YXIgX3RvZ2dsZSA9IERPTVRva2VuTGlzdC5wcm90b3R5cGUudG9nZ2xlO1xuXG4gICAgICAgIERPTVRva2VuTGlzdC5wcm90b3R5cGUudG9nZ2xlID0gZnVuY3Rpb24oIHRva2VuLCBmb3JjZSApIHtcbiAgICAgICAgICBpZiAoIDEgaW4gYXJndW1lbnRzICYmICF0aGlzLmNvbnRhaW5zKCB0b2tlbiApID09PSAhZm9yY2UgKSB7XG4gICAgICAgICAgICByZXR1cm4gZm9yY2U7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBfdG9nZ2xlLmNhbGwoIHRoaXMsIHRva2VuICk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICB9XG5cbiAgICAgIHRlc3RFbGVtZW50ID0gbnVsbDtcblxuICAgIH0oKSk7XG5cbiAgfVxufVxuIiwiLyoqXG4gKiBPYmplY3QuYXNzaWduIHBvbHlmaWxsXG4gKiBDcm9zcy1icm93c2VyIGZ1bGwgT2JqZWN0LmFzc2lnbiBpbXBsZW1lbnRhdGlvblxuICogQHNvdXJjZSBodHRwczovL2RldmV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bnZhciB0YXAgICAgICAgICAgICAgICA9IHJlcXVpcmUoICcuL2xpYi90YXAtZXZlbnRzJyApXG52YXIgZGVib3VuY2UgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvZGVib3VuY2UnIClcbnZhciB0aHJvdHRsZSAgICAgICAgICA9IHJlcXVpcmUoICcuL2xpYi90aHJvdHRsZScgKVxudmFyIGRlbGF5ICAgICAgICAgICAgID0gcmVxdWlyZSggJy4vbGliL2RlbGF5JyApXG52YXIgcmVwZWF0ICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvcmVwZWF0JyApXG52YXIgYnViYmxlRm9ybUV2ZW50cyAgPSByZXF1aXJlKCAnLi9saWIvYnViYmxlLWZvcm0tZXZlbnRzJyApXG52YXIgc3VibWl0ICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvc3VibWl0JyApXG52YXIgc2Nyb2xsICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvc2Nyb2xsJyApXG52YXIgcmVzaXplICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvcmVzaXplJyApXG52YXIgY2FsbGJhY2tNYW5hZ2VyICAgPSByZXF1aXJlKCAnLi9saWIvY2FsbGJhY2stbWFuYWdlcicgKVxudmFyIG1lZGlhICAgICAgICAgICAgID0gcmVxdWlyZSggJy4vbGliL21lZGlhJyApXG5cbnZhciBzbGljZSAgICAgICAgICAgICA9IEFycmF5LnByb3RvdHlwZS5zbGljZVxudmFyIGZvcm1CdWJibGluZyAgICAgID0gZmFsc2VcblxubW9kdWxlLmV4cG9ydHMgPSB7XG5cbiAgLy8gRE9NIGV2ZW50c1xuICBvbjogb24sXG4gIG9mZjogb2ZmLFxuICBvbmU6IG9uZSxcbiAgZmlyZTogZmlyZSxcbiAgY2xvbmU6IGJlYW4uY2xvbmUsXG4gIHJlYWR5OiBwYWdlLnJlYWR5LFxuICBjaGFuZ2U6IHBhZ2UuY2hhbmdlLFxuICBhZnRlckFuaW1hdGlvbjogY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cnJvdyA9IFsnSicsICdGJywgJ00nLCAnQScsICdNJywgJ0onLCAnSicsICdBJywgJ1MnLCAnTycsICdOJywgJ0QnXTtcblxuZnVuY3Rpb24gbW9udGhzKGxlbmd0aCkge1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgJ25hcnJvdyc6XG4gICAgICByZXR1cm4gbW9udGhzTmFycm93O1xuICAgIGNhc2UgJ3Nob3J0JzpcbiAgICAgIHJldHVybiBtb250aHNTaG9ydDtcbiAgICBjYXNlICdsb25nJzpcbiAgICAgIHJldHVybiBtb250aHNMb25nO1xuICAgIGNhc2UgJ251bWVyaWMnOlxuICAgICAgcmV0dXJuIFsnMScsICcyJywgJzMnLCAnNCcsICc1JywgJzYnLCAnNycsICc4JywgJzknLCAnMTAnLCAnMTEnLCAnMTInXTtcbiAgICBjYXNlICcyLWRpZ2l0JzpcbiAgICAgIHJldHVybiBbJzAxJywgJzAyJywgJzAzJywgJzA0JywgJzA1JywgJzA2JywgJzA3JywgJzA4JywgJzA5JywgJzEwJywgJzExJywgJzEyJ107XG4gICAgZGVmYXVsdDpcbiAgICAgIHJldHVybiBudWxsO1xuICB9XG59XG5cbnZhciB3ZWVrZGF5c0xvbmcgPSBbJ01vbmRheScsICdUdWVzZGF5JywgJ1dlZG5lc2RheScsICdUaHVyc2RheScsICdGcmlkYXknLCAnU2F0dXJkYXknLCAnU3VuZGF5J107XG5cbnZhciB3ZWVrZGF5c1Nob3J0ID0gWydNb24nLCAnVHVlJywgJ1dlZCcsICdUaHUnLCAnRnJpJywgJ1NhdCcsICdTdW4nXTtcblxudmFyIHdlZWtkYXlzTmFycm93ID0gWydNJywgJ1QnLCAnVycsICdUJywgJ0YnLCAnUycsICdTJ107XG5cbmZ1bmN0aW9uIHdlZWtkYXlzKGxlbmd0aCkge1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgJ25hcnJvdyc6XG4gICAgICByZXR1cm4gd2Vla2RheXNOYXJyb3c7XG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B7XG4gICAgdmFyIGN1cnJlbnQgPSBudWxsLFxuICAgICAgICBjdXJyZW50RnVsbCA9ICcnLFxuICAgICAgICBicmFja2V0ZWQgPSBmYWxzZTtcbiAgICB2YXIgc3BsaXRzID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmbXQubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBjID0gZm10LmNoYXJBdChpKTtcbiAgICAgIGlmIChjID09PSBcIidcIikge1xuICAgICAgICBpZiAoY3VycmVudEZ1bGwubGVuZ3RoID4gMCkge1xuICAgICAgICAgIHNwbGl0cy5wdXNoKHsgbGl0ZXJhbDogYnJhY2tldGVkLCB2YWw6IGN1cnJlbnRGdWxsIH0pO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnQgPSBudWxsO1xuICAgICAgICBjdXJyZW50RnVsbCA9ICcnO1xuICAgICAgICBicmFja2V0ZWQgPSAhYnJhY2tldGVkO1xuICAgICAgfSBlbHNlIGlmIChicmFja2V0ZWQpIHtcbiAgICAgICAgY3VycmVudEZ1bGwgKz0gYztcbiAgICAgIH0gZWxzZSBpZiAoYyA9PT0gY3VycmVudCkge1xuICAgICAgICBjdXJyZW50RnVsbCArPSBjO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGN1cnJlbnRGdWxsLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICBzcGxpdHMucHVzaCh7IGxpdGVyYWw6IGZhbHNlLCB2YWw6IGN1cnJlbnRGdWxsIH0pO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnRGdWxsID0gYztcbiAgICAgICAgY3VycmVudCA9IGM7XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGN1cnJlbnRGdWxsLmxlbmd0aCA+IDApIHtcbiAgICAgIHNwbGl0cy5wdXNoKHsgbGl0ZXJhbDogYnJhY2tldGVkLCB2YWw6IGN1cnJlbnRGdWxsIH0pO1xuICAgIH1cblxuICAgIHJldHVybiBzcGxpdHM7X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m1pbGxpc2Vjb25kKTtcbiAgICAgICAgY2FzZSAndSc6XG4gICAgICAgIC8vIGZhbGxzIHRocm91Z2hcbiAgICAgICAgY2FzZSAnU1NTJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0Lm1pbGxpc2Vjb25kLCAzKTtcbiAgICAgICAgLy8gc2Vjb25kc1xuICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LnNlY29uZCk7XG4gICAgICAgIGNhc2UgJ3NzJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LnNlY29uZCwgMik7XG4gICAgICAgIC8vIG1pbnV0ZXNcbiAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5taW51dGUpO1xuICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5taW51dGUsIDIpO1xuICAgICAgICAvLyBob3Vyc1xuICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LmhvdXIgJSAxMiA9PT0gMCA/IDEyIDogZHQuaG91ciAlIDEyKTtcbiAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgIHJldHVybiBfdGhpcy5udW0oZHQuaG91ciAlIDEyID09PSAwID8gMTIgOiBkdC5ob3VyICUgMTIsIDIpO1xuICAgICAgICBjYXNlICdIJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LmhvdXIpO1xuICAgICAgICBjYXNlICdISCc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5ob3VyLCAyKTtcbiAgICAgICAgLy8gb2Zmc2V0XG4gICAgICAgIGNhc2UgJ1onOlxuICAgICAgICAgIC8vIGxpa2UgKzZcbiAgICAgICAgICByZXR1cm4gZm9ybWF0T2Zmc2V0KHsgZm9ybWF0OiAnbmFycm93JywgYWxsb3daOiBfdGhpcy5v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VxuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyBtb250aDogJ251bWVyaWMnLCBkYXk6ICdudW1lcmljJyB9LCAnbW9udGgnKSA6IF90aGlzLm51bShkdC5tb250aCk7XG4gICAgICAgIGNhc2UgJ0xMJzpcbiAgICAgICAgICAvLyBsaWtlIDAxLCBkb2Vzbid0IHNlZW0gdG8gd29ya1xuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyBtb250aDogJzItZGlnaXQnLCBkYXk6ICdudW1lcmljJyB9LCAnbW9udGgnKSA6IF90aGlzLm51bShkdC5tb250aCwgMik7XG4gICAgICAgIGNhc2UgJ0xMTCc6XG4gICAgICAgICAgLy8gbGlrZSBKYW5cbiAgICAgICAgICByZXR1cm4gbW9udGgoJ3Nob3J0JywgdHJ1ZSk7XG4gICAgICAgIGNhc2UgJ0xMTEwnOlxuICAgICAgICAgIC8vIGxpa2UgSmFudWFyeVxuICAgICAgICAgIHJldHVybiBtb250aCgnbG9uZycsIHRydWUpO1xuICAgICAgICBjYXNlICdMTExMTCc6XG4gICAgICAgICAgLy8gbGlrZSBKXG4gICAgICAgICAgcmV0dXJuIG1vbnRoKCduYXJyb3cnLCB0cnVlKTtcbiAgICAgICAgLy8gbW9udGhzIC0gZm9ybWF0XG4gICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgIC8vIGxpa2UgMVxuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyBtb250aDogJ251bWVyaWMnIH0sICdtb250aCcpIDogX3RoaXMubnVtKGR0Lm1vbnRoKTtcbiAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgIC8vIGxpa2UgMDFcbiAgICAgICAgICByZXR1cm4gb3V0cHV0Q2FsID8gc3RyaW5nKHsgbW9udGg6ICcyLWRpZ2l0JyB9LCAnbW9udGgnKSA6IF90aGlzLm51bShkdC5tb250aCwgMik7XG4gICAgICAgIGNhc2UgJ01NTSc6XG4gICAgICAgICAgLy8gbGlrZSBKYW5cbiAgICAgICAgICByZXR1cm4gbW9udGgoJ3Nob3J0JywgZmFsc2UpO1xuICAgICAgICBjYXNlICdNTU1NJzpcbiAgICAgICAgICAvLyBsaWtlIEphbnVhcnlcbiAgICAgICAgICByZXR1cm4gbW9udGgoJ2xvbmcnLCBmYWxzZSk7XG4gICAgICAgIGNhc2UgJ01NTU1NJzpcbiAgICAgICAgICAvLyBsaWtlIEpcbiAgICAgICAgICByZXR1cm4gbW9udGgoJ25hcnJvdycsIGZhbHNlKTtcbiAgICAgICAgLy8geWVhcnNcbiAgICAgICAgY2FzZSAneSc6XG4gICAgICAgICAgLy8gbGlrZSAyMDE0XG4gICAgICAgICAgcmV0dXJuIG91dHB1dENhbCA/IHN0cmluZyh7IHllYXI6ICdudW1lcmljJyB9LCAneWVhcicpIDogX3RoaXMubnVtKGR0LnllYXIpO1xuICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgLy8gbGlrZSAxNFxuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyB5ZWFyOiAnMi1kaWdpdCcgfSwgJ3llYXInKSA6IF90aGlzLm51bShkdC55ZWFyLnRvU3RyaW5nKCkuc2xpY2UoLTIpLCAyKTtcbiAgICAgICAgY2FzZSAneXl5eSc6XG4gICAgICAgICAgLy8gbGlrZSAwMDEyXG4gICAgICAgICAgcmV0dXJuIG91dHB1dENhbCA/IHN0cmluZyh7IHllYXI6ICdudW1lcmljJyB9LCAneWVhcicpIDogX3RoaXMubnVtKGR0LnllYXIsIDQpO1xuICAgICAgICBjYXNlICd5eXl5eXknOlxuICAgICAgICAgIC8vIGxpa2UgMDAwMDEyXG4gICAgICAgICAgcmV0dXJuIG91dHB1dENhbCA/IHN0cmluZyh7IHllYXI6ICdudW1lcmljJyB9LCAneWVhcicpIDogX3RoaXMubnVtKGR0LnllYXIsIDYpO1xuICAgICAgICAvLyBlcmFzXG4gICAgICAgIGNhc2UgJ0cnOlxuICAgICAgICAgIC8vIGxpa2UgQURcbiAgICAgICAgICByZXR1cm4gZXJhKCdzaG9ydCcpO1xuICAgICAgICBjYXNlICdHRyc6XG4gICAgICAgICAgLy8gbGlrZSBBbm5vIERvbWluaVxuICAgICAgICAgIHJldHVybiBlcmEoJ2xvbmcnKTtcbiAgICAgICAgY2FzZSAnR0dHR0cnOlxuICAgICAgICAgIHJldHVybiBlcmEoJ25hcnJvdycpO1xuICAgICAgICBjYXNlICdrayc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC53ZWVrWWVhci50b1N0cmluZygpLnNsaWNlKC0yKSwgMik7XG4gICAgICAgIGNhc2UgJ2tra2snOlxuICAgICAgICAgIHJldHVybiBfdGhpcy5udW0oZHQud2Vla1llYXIsIDQpO1xuICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LndlZWtOdW1iZXIpO1xuICAgICAgICBjYXNlICdXVyc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC53ZWVrTnVtYmVyLCAyKTtcbiAgICAgICAgY2FzZSAnbyc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5vcmRpbmFsKTtcbiAgICAgICAgY2FzZSAnb29vJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0Lm9yZGluYWwsIDMpO1xuICAgICAgICBjYXNlICdxJzpcbiAgICAgICAgICAvLyBsaWtlIDFcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LnF1YXJ0ZXIpO1xuICAgICAgICBjYXNlICdxcSc6XG4gICAgICAgICAgLy8gbGlrZSAwMVxuICAgICAgICAgIHJldHVybiBfdGhpcy5udW0oZHQucXVhcnRlciwgMik7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgcmV0dXJuIG1heWJlTWFjcm8odG9rZW4pO1xuICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gc3RyaW5naWZ5VG9rZW5zKEZvcm1hdHRlci5wYXJzZUZvcm1hdChmbXQpLCB0b2tlblRvU3RyaW5nKTtcbiAgfTtcblxuICBGb3JtYXR0ZXIucHJvdG90eXBlLmZvcm1hdER1cmF0aW9uRnJvbVN0cmluZyA9IGZ1bmN0aW9uIGZvcm1hdER1cmF0aW9uRnJvbVN0cmluZyhkdXIsIGZtdCkge1xuICAgIHZhciBfdGhpczIgPSB0aGlzO1xuXG4gICAgdmFyIHRva2VuVG9GaWVsZCA9IGZ1bmN0aW9uIHRva2VuVG9GaWVsZCh0b2tlbikge1xuICAgICAgc3dpdGNoICh0b2tlblswXSkge1xuICAgICAgICBjYXNlICdTJzpcbiAgICAgICAgICByZXR1cm4gJ21pbGxpc2Vjb25kJztcbiAgICAgICAgY2FzZSAncyc6XG4gICAgICAgICAgcmV0dXJuICdzZWNvbmQnO1xuICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICByZXR1cm4gJ21pbnV0ZSc7XG4gICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgIHJldHVybiAnaG91cic7XG4gICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgIHJldHVybiAnZGF5JztcbiAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgcmV0dXJuICdtb250aCc7XG4gICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgIHJldHVybiAneWVhcic7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9XG4gICAgfSxcbiAgICAgICAgdG9rZW5Ub1N0cmluZyA9IGZ1bmN0aW9uIHRva2VuVG9TdHJpbmcobGlsZHVyKSB7XG4gICAgICByZXR1cm4gZnVuY3Rpb24gKHRva2VuKSB7XG4gICAgICAgIHZhciBtYXBwZWQgPSB0b2tlblRvRmllbGQodG9rZW4pO1xuICAgICAgICBpZiAobWFwcGVkKSB7XG4gICAgICAgICAgcmV0dXJuIF90aGlzMi5udW0obGlsZHVyLmdldChtYXBwZ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AgICAgICAgX2kzID0gX2l0ZXJhdG9yMy5uZXh0KCk7XG4gICAgICAgIGlmIChfaTMuZG9uZSkgYnJlYWs7XG4gICAgICAgIF9yZWY0ID0gX2kzLnZhbHVlO1xuICAgICAgfVxuXG4gICAgICB2YXIgayA9IF9yZWY0O1xuXG4gICAgICBpZiAodW5pdHMuaW5kZXhPZihrKSA+PSAwKSB7XG4gICAgICAgIGxhc3RVbml0ID0gaztcblxuICAgICAgICB2YXIgb3duID0gMDtcblxuICAgICAgICAvLyBhbnl0aGluZyB3ZSBoYXZlbid0IGJvaWxlZCBkb3duIHlldCBzaG91bGQgZ2V0IGJvaWxlZCB0byB0aGlzIHVuaXRcbiAgICAgICAgZm9yICh2YXIgYWsgaW4gYWNjdW11bGF0ZWQpIHtcbiAgICAgICAgICBpZiAoYWNjdW11bGF0ZWQuaGFzT3duUHJvcGVydHkoYWspKSB7XG4gICAgICAgICAgICBvd24gKz0gdGhpcy5tYXRyaXhbYWtdW2tdICogYWNjdW11bGF0ZWRbYWtdO1xuICAgICAgICAgICAgYWNjdW11bGF0ZWRbYWtdID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBwbHVzIGFueXRoaW5nIHRoYXQncyBhbHJlYWR5IGluIHRoaXMgdW5pdFxuICAgICAgICBpZiAoaXNOdW1iZXIodmFsc1trXSkpIHtcbiAgICAgICAgICBvd24gKz0gdmFsc1trXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBpID0gTWF0aC50cnVuYyhvd24pO1xuICAgICAgICBidWlsdFtrXSA9IGk7XG4gICAgICAgIGFjY3VtdWxhdGVkW2tdID0gb3duIC0gaTtcblxuICAgICAgICAvLyBwbHVzIGFueXRoaW5nIGZ1cnRoZXIgZG93biB0aGUgY2hhaW4gdGhhdCBzaG91bGQgYmUgcm9sbGVkIHVwIGluIHRvIHRoaXNcbiAgICAgICAgZm9yICh2YXIgZG93biBpbiB2YWxzKSB7XG4gICAgICAgICAgaWY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gICByZXR1cm4gaW50VW5pdCh0d28pO1xuICAgICAgY2FzZSAnTExMJzpcbiAgICAgICAgcmV0dXJuIG9uZU9mKGxvYy5tb250aHMoJ3Nob3J0JywgdHJ1ZSwgZmFsc2UpLCAxKTtcbiAgICAgIGNhc2UgJ0xMTEwnOlxuICAgICAgICByZXR1cm4gb25lT2YobG9jLm1vbnRocygnbG9uZycsIHRydWUsIGZhbHNlKSwgMSk7XG4gICAgICAvLyBkYXRlc1xuICAgICAgY2FzZSAnZCc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KG9uZU9yVHdvKTtcbiAgICAgIGNhc2UgJ2RkJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQodHdvKTtcbiAgICAgIC8vIG9yZGluYWxzXG4gICAgICBjYXNlICdvJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lVG9UaHJlZSk7XG4gICAgICBjYXNlICdvb28nOlxuICAgICAgICByZXR1cm4gaW50VW5pdCh0aHJlZSk7XG4gICAgICAvLyB0aW1lXG4gICAgICBjYXNlICdISCc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KHR3byk7XG4gICAgICBjYXNlICdIJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lT3JUd28pO1xuICAgICAgY2FzZSAnaGgnOlxuICAgICAgICByZXR1cm4gaW50VW5pdCh0d28pO1xuICAgICAgY2FzZSAnaCc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KG9uZU9yVHdvKTtcbiAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQodHdvKTtcbiAgICAgIGNhc2UgJ20nOlxuICAgICAgICByZXR1cm4gaW50VW5pdChvbmVPclR3byk7XG4gICAgICBjYXNlICdzJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lT3JUd28pO1xuICAgICAgY2FzZSAnc3MnOlxuICAgICAgICByZXR1cm4gaW50VW5pdCh0d28pO1xuICAgICAgY2FzZSAnUyc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KG9uZVRvVGhyZWUpO1xuICAgICAgY2FzZSAnU1NTJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQodGhyZWUpO1xuICAgICAgY2FzZSAndSc6XG4gICAgICAgIHJldHVybiBzaW1wbGUoL1xcZHsxLDl9Lyk7XG4gICAgICAvLyBtZXJpZGllbVxuICAgICAgY2FzZSAnYSc6XG4gICAgICAgIHJldHVybiBvbmVPZihsb2MubWVyaWRpZW1zKCksIDApO1xuICAgICAgLy8gd2Vla1llYXIgKGspXG4gICAgICBjYXNlICdra2trJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQoZm91cik7XG4gICAgICBjYXNlICdrayc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KHR3b1RvRm91ciwgdW50cnVuY2F0ZVllYXIpO1xuICAgICAgLy8gd2Vla051bWJlciAoVylcbiAgICAgIGNhc2UgJ1cnOlxuICAgICAgICByZXR1cm4gaW50VW5pdChvbmVPclR3byk7XG4gICAgICBjYXNlICdXVyc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KHR3byk7XG4gICAgICAvLyB3ZWVrZGF5c1xuICAgICAgY2FzZSAnRSc6XG4gICAgICBjYXNlICdjJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lKTtcbiAgICAgIGNhc2UgJ0VFRSc6XG4gICAgICAgIHJldHVybiBvbmVPZihsb2Mud2Vla2RheXMoJ3Nob3J0JywgZmFsc2UsIGZhbHNlKSwgMSk7XG4gICAgICBjYXNlICdFRUVFJzpcbiAgICAgICAgcmV0dXJuIG9uZU9mKGxvYy53ZWVrZGF5cygnbG9uZycsIGZhbHNlLCBmYWxzZSksIDEpO1xuICAgICAgY2FzZSAnY2NjJzpcbiAgICAgICAgcmV0dXJuIG9uZU9mKGxvYy53ZWVrZGF5cygnc2hvcnQnLCB0cnVlLCBmYWxzZSksIDEpO1xuICAgICAgY2FzZSAnY2NjYyc6XG4gICAgICAgIHJldHVybiBvbmVPZihsb2Mud2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ybWF0IGNvbnN0cnVjdG9yIG9wdGlvbnMsIHNhbWUgYXMgYHRvTG9jYWxlU3RyaW5nYC5cclxuICAgKiBAZXhhbXBsZSBEYXRlVGltZS5sb2NhbCgpLnRvTG9jYWxlU3RyaW5nKCk7IC8vPT4gW1xyXG4gICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy89PiAgIHsgdHlwZTogJ2RheScsIHZhbHVlOiAnMjUnIH0sXHJcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLz0+ICAgeyB0eXBlOiAnbGl0ZXJhbCcsIHZhbHVlOiAnLycgfSxcclxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vPT4gICB7IHR5cGU6ICdtb250aCcsIHZhbHVlOiAnMDUnIH0sXHJcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLz0+ICAgeyB0eXBlOiAnbGl0ZXJhbCcsIHZhbHVlOiAnLycgfSxcclxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vPT4gICB7IHR5cGU6ICd5ZWFyJywgdmFsdWU6ICcxOTgyJyB9XHJcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLz0+IF1cclxuICAgKi9cblxuXG4gIERhdGVUaW1lLnByb3RvdHlwZS50b0xvY2FsZVBhcnRzID0gZnVuY3Rpb24gdG9Mb2NhbGVQYXJ0cygpIHtcbiAgICB2YXIgb3B0cyA9IGFyZ3VtZW50cy5sZW5ndGggPiAwICYmIGFyZ3VtZW50c1swXSAhPT0gdW5kZWZpbmVkID8gYXJndW1lbnRzWzBdIDoge307XG5cbiAgICByZXR1cm4gdGhpcy5pc1ZhbGlkID8gRm9ybWF0dGVyLmNyZWF0ZSh0aGlzLmxvYy5jbG9uZShvcHRzKSwgb3B0cykuZm9ybWF0RGF0ZVRpbWVQYXJ0cyh0aGlzKSA6IFtdO1xuICB9O1xu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udWFsIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnanNvbicpXG4gKiAgICAgICAgIC5zZW5kKCd7XCJuYW1lXCI6XCJ0alwifScpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gbWFudWFsIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoJ25hbWU9dGonKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBkZWZhdWx0cyB0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgLnNlbmQoJ25hbWU9dG9iaScpXG4gKiAgICAgICAgLnNlbmQoJ3NwZWNpZXM9ZmVycmV0JylcbiAqICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqIEBwYXJhbSB7U3RyaW5nfE9iamVjdH0gZGF0YVxuICogQHJldHVybiB7UmVxdWVzdH0gZm9yIGNoYWluaW5nXG4gKiBAYXBpIHB1YmxpY1xuICovXG5cblJlcXVlc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hlZWwgbW91c2VtdWx0aXdoZWVsIERPTU1vdXNlU2Nyb2xsICcgICAgICAgICAgICAgICAgICAgICArIC8vIG1vdXNlIHdoZWVsXG4gICAgICAgICdtb3VzZW92ZXIgbW91c2VvdXQgbW91c2Vtb3ZlIHNlbGVjdHN0YXJ0IHNlbGVjdGVuZCAnICAgICAgICAgICAgKyAvLyBtb3VzZSBtb3ZlbWVudFxuICAgICAgICAna2V5ZG93biBrZXlwcmVzcyBrZXl1cCAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgLy8ga2V5Ym9hcmRcbiAgICAgICAgJ29yaWVudGF0aW9uY2hhbmdlICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIC8vIG1vYmlsZVxuICAgICAgICAnZm9jdXMgYmx1ciBjaGFuZ2UgcmVzZXQgc2VsZWN0IHN1Ym1pdCAnICAgICAgICAgICAgICAgICAgICAgICAgICsgLy8gZm9ybSBlbGVtZW50c1xuICAgICAgICAnbG9hZCB1bmxvYWQgYmVmb3JldW5sb2FkIHJlc2l6ZSBtb3ZlIERPTUNvbnRlbnRMb2FkZWQgJyAgICAgICAgICsgLy8gd2luZG93XG4gICAgICAgICdyZWFkeXN0YXRlY2hhbmdlIG1lc3NhZ2UgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyB3aW5kb3dcbiAgICAgICAgJ2Vycm9yIGFib3J0IHNjcm9sbCAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1pc2NcbiAgICAgIC8vIGVsZW1lbnQuZmlyZUV2ZW50KCdvblhZWicuLi4gaXMgbm90IGZvcmdpdmluZyBpZiB3ZSB0cnkgdG8gZmlyZSBhbiBldmVudFxuICAgICAgLy8gdGhhdCBkb2Vzbid0IGFjdHVhbGx5IGV4aXN0LCBzbyBtYWtlIHN1cmUgd2Ugb25seSBkbyB0aGVzZSBvbiBuZXdlciBicm93c2Vyc1xuICAgICwgdzNjTmF0aXZlRXZlbnRzID1cbiAgICAgICAgJ3Nob3cgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIC8vIG1vdXNlIGJ1dHRvbnNcbiAgICAgICAgJ2lucHV0IGludmFsaWQgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIC8vIGZvcm0gZWxlbWVudHNcbiAgICAgICAgJ3RvdWNoc3RhcnQgdG91Y2htb3ZlIHRvdWNoZW5kIHRvdWNoY2FuY2VsICcgICAgICAgICAgICAgICAgICAgICArIC8vIHRvdWNoXG4gICAgICAgICdnZXN0dXJlc3RhcnQgZ2VzdHVyZWNoYW5nZSBnZXN0dXJlZW5kICcgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyBnZXN0dXJlXG4gICAgICAgICd0ZXh0aW5wdXQgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyBUZXh0RXZlbnRcbiAgICAgICAgJ3JlYWR5c3RhdGVjaGFuZ2UgcGFnZXNob3cgcGFnZWhpZGUgcG9wc3RhdGUgJyAgICAgICAgICAgICAgICAgICArIC8vIHdpbmRvd1xuICAgICAgICAnaGFzaGNoYW5nZSBvZmZsaW5lIG9ubGluZSAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgLy8gd2luZG93XG4gICAgICAgICdhZnRlcnByaW50IGJlZm9yZXByaW50ICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAvLyBwcmludGluZ1xuICAgICAgICAnZHJhZ3N0YXJ0IGRyYWdlbnRlciBkcmFnb3ZlciBkcmFnbGVhdmUgZHJhZyBkcm9wIGRyYWdlbmQgJyAgICAgICsgLy8gZG5kXG4gICAgICAgICdsb2Fkc3RhcnQgcHJvZ3Jlc3Mgc3VzcGVuZCBlbXB0aWVkIHN0YW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A9IChmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBpc0FuY2VzdG9yID0gJ2NvbXBhcmVEb2N1bWVudFBvc2l0aW9uJyBpbiByb290XG4gICAgICAgICAgICAgID8gZnVuY3Rpb24gKGVsZW1lbnQsIGNvbnRhaW5lcikge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRhaW5lci5jb21wYXJlRG9jdW1lbnRQb3NpdGlvbiAmJiAoY29udGFpbmVyLmNvbXBhcmVEb2N1bWVudFBvc2l0aW9uKGVsZW1lbnQpICYgMTYpID09PSAxNlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgOiAnY29udGFpbnMnIGluIHJvb3RcbiAgICAgICAgICAgICAgICA/IGZ1bmN0aW9uIChlbGVtZW50LCBjb250YWluZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyID0gY29udGFpbmVyLm5vZGVUeXBlID09PSA5IHx8IGNvbnRhaW5lciA9PT0gd2luZG93ID8gcm9vdCA6IGNvbnRhaW5lclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udGFpbmVyICE9PSBlbGVtZW50ICYmIGNvbnRhaW5lci5jb250YWlucyhlbGVtZW50KVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIDogZnVuY3Rpb24gKGVsZW1lbnQsIGNvbnRhaW5lcikge1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoZWxlbWVudCA9IGVsZW1lbnQucGFyZW50Tm9kZSkgaWYgKGVsZW1lbnQgPT09IGNvbnRhaW5lcikgcmV0dXJuIDFcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDBcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAsIGNoZWNrID0gZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgIHZhciByZWxhdGVkID0gZXZlbnQucmVsYXRlZFRhcmdldFxuICAgICAgICAgICAgICByZXR1cm4gIXJlbGF0ZWRc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YnViYmxlcyBjYW5jZWxhYmxlIGN0cmxLZXkgY3VycmVudFRhcmdldCAnICtcbiAgICAgICAgICAgICAgJ2RldGFpbCBldmVudFBoYXNlIGdldE1vZGlmaWVyU3RhdGUgaXNUcnVzdGVkIG1ldGFLZXkgcmVsYXRlZE5vZGUgcmVsYXRlZFRhcmdldCBzaGlmdEtleSAnICArXG4gICAgICAgICAgICAgICdzcmNFbGVtZW50IHRhcmdldCB0aW1lU3RhbXAgdHlwZSB2aWV3IHdoaWNoIHByb3BlcnR5TmFtZSBwYXRoJylcbiAgICAgICAgICAsIG1vdXNlUHJvcHMgICA9IGNvbW1vblByb3BzLmNvbmNhdChzdHIyYXJyKCdidXR0b24gYnV0dG9ucyBjbGllbnRYIGNsaWVudFkgZGF0YVRyYW5zZmVyICcgICAgICArXG4gICAgICAgICAgICAgICdmcm9tRWxlbWVudCBvZmZzZXRYIG9mZnNldFkgcGFnZVggcGFnZVkgc2NyZWVuWCBzY3JlZW5ZIHRvRWxlbWVudCBtb3ZlbWVudFggbW92ZW1lbnRZIHJlZ2lvbicpKVxuICAgICAgICAgICwgbW91c2VXaGVlbFByb3BzID0gbW91c2VQcm9wcy5jb25jYXQoc3RyMmFycignd2hlZWxEZWx0YSB3aGVlbERlbHRhWCB3aGVlbERlbHRhWSB3aGVlbERlbHRhWiAnICtcbiAgICAgICAgICAgICAgJ2F4aXMnKSkgLy8gJ2F4aXMnIGlzIEZGIHNwZWNpZmljXG4gICAgICAgICAgLCBrZXlQcm9wcyAgICAgPSBjb21tb25Qcm9wcy5jb25jYXQoc3RyMmFycignY2hhciBjaGFyQ29kZSBrZXkga2V5Q29kZSBrZXlJZGVudGlmaWVyICcgICAgICAgICAgK1xuICAgICAgICAgICAgICAna2V5TG9jYXRpb24gbG9jYXRpb24gaXNDb21wb3NpbmcgY29kZScpKVxuICAgICAgICAgICwgdGV4dFByb3BzICAgID0gY29tbW9uUHJvcHMuY29uY2F0KHN0cjJhcnIoJ2RhdGEnKSlcbiAgICAgICAgICAsIHRvdWNoUHJvcHMgICA9IGNvbW1vblByb3BzLmNvbmNhdChzdHIyYXJyKCd0b3VjaGVzIHRhcmdldFRvdWNoZXMgY2hhbmdlZFRvdWNoZXMgc2NhbGUgcm90YXRpb24nKSlcbiAgICAgICAgICAsIG1lc3NhZ2VQcm9wcyA9IGNvbW1vblByb3BzLmNvbmNhdChzdHIyYXJyKCdkYXRhIG9yaWdpbiBzb3VyY2UnKSlcbiAgICAgICAgICAsIHN0YXRlUHJvcHMgICA9IGNvbW1vblByb3BzLmNvbmNhdChzdHIyYXJyKCdzdGF0ZScpKVxuICAgICAgICAgICwgb3Zlck91dFJlZ2V4ID0gL292ZXJ8b3V0L1xuICAgICAgICAgICAgLy8gc29tZSBldmVudCB0eXBlcyBuZWVkIHNwZWNpYWwgaGFuZGxpbmcgYW5kIHNvbWUgbmVlZCBzcGVjaWFsIHByb3BlcnRpZXMsIGRvIHRoYXQgYWxsIGhlcmVcbiAgICAgICAgICAsIHR5cGVGaXhlcnMgICA9IFtcbiAgICAgICAgICAgICAgICB7IC8vIGtleSBldmVudHNcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAva2V5L2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoZXZlbnQsIG5ld0V2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgbmV3RXZlbnQua2V5Q29kZSA9IGV2ZW50LmtleUNvZGUgfHwgZXZlbnQud2hpY2hcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ga2V5UHJvcHNcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLCB7IC8vIG1vdXNlIGV2ZW50c1xuICAgICAgICAgICAgICAgICAgICByZWc6IC9jbGlja3xtb3VzZSg/ISguKndoZWVsfHNjcm9sbCkpfG1lbnV8ZHJhZ3xkcm9wL2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoZXZlbnQsIG5ld0V2ZW50LCB0eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgbmV3RXZlbnQucmlnaHRDbGljayA9IGV2ZW50LndoaWNoID09PSAzIHx8IGV2ZW50LmJ1dHRvbiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgIG5ld0V2ZW50LnBvcyA9IHsgeDogMCwgeTogMCB9XG4gICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LnBhZ2VYIHx8IGV2ZW50LnBhZ2VZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdFdmVudC5jbGllbnRYID0gZXZlbnQucGFnZVhcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0V2ZW50LmNsaWVudFkgPSBldmVudC5wYWdlWVxuICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuY2xpZW50WCB8fCBldmVudC5jbGllbnRZKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdFdmVudC5jbGllbnRYID0gZXZlbnQuY2xpZW50WCArIGRvYy5ib2R5LnNjcm9sbExlZnQgKyByb290LnNjcm9sbExlZnRcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0V2ZW50LmNsaWVudFkgPSBldmVudC5jbGllbnRZICsgZG9jLmJvZHkuc2Nyb2xsVG9wICsgcm9vdC5zY3JvbGxUb3BcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgaWYgKG92ZXJPdXRSZWdleC50ZXN0KHR5cGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdFdmVudC5yZWxhdGVkVGFyZ2V0ID0gZXZlbnQucmVsYXRlZFRhcmdldFxuICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBldmVudFsodHlwZSA9PSAnbW91c2VvdmVyJyA/ICdmcm9tJyA6ICd0bycpICsgJ0VsZW1lbnQnXVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbW91c2VQcm9wc1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAsIHsgLy8gbW91c2Ugd2hlZWwgZXZlbnRzXG4gICAgICAgICAgICAgICAgICAgIHJlZzogL21vdXNlLiood2hlZWx8c2Nyb2xsKS9pXG4gICAgICAgICAgICAgICAgICAsIGZpeDogZnVuY3Rpb24gKCkgeyByZXR1cm4gbW91c2VXaGVlbFByb3BzIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgeyAvLyBUZXh0RXZlbnRcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAvXnRleHQvaVxuICAgICAgICAgICAgICAgICAgLCBmaXg6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRleHRQcm9wcyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAsIHsgLy8gdG91Y2ggYW5kIGdlc3R1cmUgZXZlbnRzXG4gICAgICAgICAgICAgICAgICAgIHJlZzogL150b3VjaHxeZ2VzdHVyZS9pXG4gICAgICAgICAgICAgICAgICAsIGZpeDogZnVuY3Rpb24gKCkgeyByZXR1cm4gdG91Y2hQcm9wcyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAsIHsgLy8gbWVzc2FnZSBldmVudHNcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAvXm1lc3NhZ2UkL2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoKSB7IHJldHVybiBtZXNzYWdlUHJvcHMgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLCB7IC8vIHBvcHN0YXRlIGV2ZW50c1xuICAgICAgICAgICAgICAgICAgICByZWc6IC9ecG9wc3RhdGUkL2lcbiAgICAgICAgICAgICAgICAgICwgZml4OiBmdW5jdGlvbiAoKSB7IHJldHVybiBzdGF0ZVByb3BzIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgeyAvLyBldmVyeXRoaW5nIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmVnOiAvLiovXG4gICAgICAgICAgICAgICAgICAsIGZpeDogZnVuY3Rpb24gKCkgeyByZXR1cm4gY29tbW9uUHJvcHMgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICAsIHR5cGVGaXhlck1hcCA9IHt9IC8vIHVzZWQgdG8gbWFwIGV2ZW50IHR5cGVzIHRvIGZpeGVyIGZ1bmN0aW9ucyAoYWJvdmUpLCBhIGJhc2ljIGNhY2hlIG1lY2hhbmlzbVxuXG4gICAgICAgICAgLCBFdmVudCA9IGZ1bmN0aW9uIChldmVudCwgZWxlbWVudCwgaXNOYXRpdmUpIHtcbiAgICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm5cbiAgICAgICAgICAgICAgZXZlbnQgPSBldmVudCB8fCAoKGVsZW1lbnQub3duZXJEb2N1bWVudCB8fCBlbGVtZW50LmRvY3VtZW50IHx8IGVsZW1lbnQpLnBhcmVudFdpbmRvdyB8fCB3aW4pLmV2ZW50XG4gICAgICAgICAgICAgIHRoaXMub3JpZ2luYWxFdmVudCA9IGV2ZW50XG4gICAgICAgICAgICAgIHRoaXMuaXNOYXRpdmUgICAgICAgPSBpc05hdGl2ZVxuICAgICAgICAgICAgICB0aGlzLmlzQmVhbiAgICAgICAgID0gdHJ1ZVxuXG4gICAgICAgICAgICAgIGlmICghZXZlbnQpIHJldHVyblxuXG4gICAgICAgICAgICAgIHZhciB0eXBlICAgPSBldmVudC50eXBlXG4gICAgICAgICAgICAgICAgLCB0YXJnZXQgPSBldmVudC50YXJnZXQgfHwgZXZlbnQuc3JjRWxlbWVudFxuICAgICAgICAgICAgICAgICwgaSwgbCwgcCwgcHJvcHMsIGZpeGVyXG5cbiAgICAgICAgICAgICAgdGhpcy50YXJnZXQgPSB0YXJnZXQgJiYgdGFyZ2V0Lm5vZGVUeXBlID09PSAzID8gdGFyZ2V0LnBhcmVudE5vZGUgOiB0YXJnZXRcblxuICAgICAgICAgICAgICBpZiAoaXNOYXRpdmUpIHsgLy8gd2Ugb25seSBuZWVkIGJhc2ljIGF1Z21lbnRhdGlvbiBvbiBjdXN0b20gZXZlbnRzLCB0aGUgcmVzdCBleHBlbnNpdmUgJiBwb2ludGxlc3NcbiAgICAgICAgICAgICAgICBmaXhlciA9IHR5cGVGaXhlck1hcFt0eXBlXVxuICAgICAgICAgICAgICAgIGlmICghZml4ZXIpIHsgLy8gaGF2ZW4ndCBlbmNvdW50ZXJlZCB0aGlzIGV2ZW50IHR5cGUgYmVmb3JlLCBtYXAgYSBmaXhlciBmdW5jdGlvbiBmb3IgaXRcbiAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDAsIGwgPSB0eXBlRml4ZXJzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZUZpeGVyc1tpXS5yZWcudGVzdCh0eXBlKSkgeyAvLyBndWFyYW50ZWVkIHRvIG1hdGNoIGF0IGxlYXN0IG9uZSwgbGFzdCBpcyAuKlxuICAgICAgICAgICAgICAgICAgICAgIHR5cGVGaXhlck1hcFt0eXBlXSA9IGZpeGVyID0gdHlwZUZpeGVyc1tpXS5maXhcbiAgICAgICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcHJvcHMgPSBmaXhlcihldmVudCwgdGhpcywgdHlwZSlcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSBwcm9wcy5sZW5ndGg7IGktLTspIHtcbiAgICAgICAgICAgICAgICAgIGlmICghKChwID0gcHJvcHNbaV0pIGluIHRoaXMpICYmIHAgaW4gZXZlbnQpIHRoaXNbcF0gPSBldmVudFtwXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICA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cHBlZCBzbyB3ZSBjYW4gaGFuZGxlIGRlbGVnYXRpb24gYW5kIGN1c3RvbSBldmVudHNcbiAgICAgICAgdmFyIHdyYXBwZWRIYW5kbGVyID0gZnVuY3Rpb24gKGVsZW1lbnQsIGZuLCBjb25kaXRpb24sIGFyZ3MpIHtcbiAgICAgICAgICAgIHZhciBjYWxsID0gZnVuY3Rpb24gKGV2ZW50LCBlYXJncykge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIGZuLmFwcGx5KGVsZW1lbnQsIGFyZ3MgPyBzbGljZS5jYWxsKGVhcmdzLCBldmVudCA/IDAgOiAxKS5jb25jYXQoYXJncykgOiBlYXJncylcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgZmluZFRhcmdldCA9IGZ1bmN0aW9uIChldmVudCwgZXZlbnRFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gZm4uX19iZWFuRGVsID8gZm4uX19iZWFuRGVsLmZ0KGV2ZW50LnRhcmdldCwgZWxlbWVudCkgOiBldmVudEVsZW1lbnRcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICwgaGFuZGxlciA9IGNvbmRpdGlvblxuICAgICAgICAgICAgICAgICAgPyBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgdGFyZ2V0ID0gZmluZFRhcmdldChldmVudCwgdGhpcykgLy8gZGVsZWF0ZWQgZXZlbnRcbiAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZGl0aW9uLmFwcGx5KHRhcmdldCwgYXJndW1lbnRzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50KSBldmVudC5jdXJyZW50VGFyZ2V0ID0gdGFyZ2V0XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbChldmVudCwgYXJndW1lbnRzKVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgOiBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICBpZiAoZm4uX19iZWFuRGVsKSBldmVudCA9IGV2ZW50LmNsb25lKGZpbmRUYXJnZXQoZXZlbnQpKSAvLyBkZWxlZ2F0ZWQgZXZlbnQsIGZpeCB0aGUgZml4XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGwoZXZlbnQsIGFyZ3VtZW50cylcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGFuZGxlci5fX2JlYW5EZWwgPSBmbi5fX2JlYW5EZWxcbiAgICAgICAgICAgIHJldHVybiBoYW5kbGVyXG4gICAgICAgICAgfVxuXG4gICAgICAgICwgUmVnRW50cnkgPSBmdW5jdGlvbiAoZWxlbWVudCwgdHlwZSwgaGFuZGxlciwgb3JpZ2luYWwsIG5hbWVzcGFjZXMsIGFyZ3MsIHJvb3QpIHtcbiAgICAgICAgICAgIHZhciBjdXN0b21UeXBlICAgICA9IGN1c3RvbUV2ZW50c1t0eXBlXVxuICAgICAgICAgICAgICAsIGlzTmF0aXZlXG5cbiAgICAgICAgICAgIGlmICh0eXBlID09ICd1bmxvYWQnKSB7XG4gICAgICAgICAgICAgIC8vIHNlbGYgY2xlYW4tdXBcbiAgICAgICAgICAgICAgaGFuZGxlciA9IG9uY2UocmVtb3ZlTGlzdGVuZXIsIGVsZW1lbnQsIHR5cGUsIGhhbmRsZXIsIG9yaWdpbmFsKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY3VzdG9tVHlwZSkge1xuICAgICAgICAgICAgICBpZiAoY3VzdG9tVHlwZS5jb25kaXRpb24pIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVyID0gd3JhcHBlZEhhbmRsZXIoZWxlbWVudCwgaGFuZGxlciwgY3VzdG9tVHlwZS5jb25kaXRpb24sIGFyZ3MpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgdH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b3JlcyBhcnJheXMgYnkgZXZlbnQgdHlwZSwganVzdCBiZWNhdXNlIGl0J3MgYmV0dGVyIHRoYW4gc3RvcmluZ1xuICAgICAgICAvLyBldmVyeXRoaW5nIGluIGEgc2luZ2xlIGFycmF5LlxuICAgICAgICAvLyB1c2VzICckJyBhcyBhIHByZWZpeCBmb3IgdGhlIGtleXMgZm9yIHNhZmV0eSBhbmQgJ3InIGFzIGEgc3BlY2lhbCBwcmVmaXggZm9yXG4gICAgICAgIC8vIHJvb3RMaXN0ZW5lcnMgc28gd2UgY2FuIGxvb2sgdGhlbSB1cCBmYXN0XG4gICAgICAgIHZhciBtYXAgPSB7fVxuXG4gICAgICAgICAgLy8gZ2VuZXJpYyBmdW5jdGlvbmFsIHNlYXJjaCBvZiBvdXIgcmVnaXN0cnkgZm9yIG1hdGNoaW5nIGxpc3RlbmVycyxcbiAgICAgICAgICAvLyBgZm5gIHJldHVybnMgZmFsc2UgdG8gYnJlYWsgb3V0IG9mIHRoZSBsb29wXG4gICAgICAgICAgLCBmb3JBbGwgPSBmdW5jdGlvbiAoZWxlbWVudCwgdHlwZSwgb3JpZ2luYWwsIGhhbmRsZXIsIHJvb3QsIGZuKSB7XG4gICAgICAgICAgICAgIHZhciBwZnggPSByb290ID8gJ3InIDogJyQnXG4gICAgICAgICAgICAgIGlmICghdHlwZSB8fCB0eXBlID09ICcqJykge1xuICAgICAgICAgICAgICAgIC8vIHNlYXJjaCB0aGUgd2hvbGUgcmVnaXN0cnlcbiAgICAgICAgICAgICAgICBmb3IgKHZhciB0IGluIG1hcCkge1xuICAgICAgICAgICAgICAgICAgaWYgKHQuY2hhckF0KDApID09IHBmeCkge1xuICAgICAgICAgICAgICAgICAgICBmb3JBbGwoZWxlbWVudCwgdC5zdWJzdHIoMSksIG9yaWdpbmFsLCBoYW5kbGVyLCByb290LCBmbilcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGkgPSAwLCBsLCBsaXN0ID0gbWFwW3BmeCArIHR5cGVdLCBhbGwgPSBlbGVtZW50ID09ICcqJ1xuICAgICAgICAgICAgICAgIGlmICghbGlzdCkgcmV0dXJuXG4gICAgICAgICAgICAgICAgZm9yIChsID0gbGlzdC5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgIGlmICgoYWxsIHx8IGxpc3RbaV0ubWF0Y2hlcyhlbGVtZW50LCBvcmlnaW5hbCwgaGFuZGxlcikpICYmICFmbihsaXN0W2ldLCBsaXN0LCBpLCB0eXBlKSkgcmV0dXJuXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAsIGhhcyA9IGZ1bmN0aW9uIChlbGVtZW50LCB0eXBlLCBvcmlnaW5hbCwgcm9vdCkge1xuICAgICAgICAgICAgICAvLyB3ZSdyZSBub3QgdXNpbmcgZm9yQWxsIGhlcmUgc2ltcGx5IGJlY2F1c2UgaXQncyBhIGJpdCBzbG93ZXIgYW5kIHRoaXNcbiAgICAgICAgICAgICAgLy8gbmVlZHMgdG8gYmUgZmFzdFxuICAgICAgICAgICAgICB2YXIgaSwgbGlzdCA9IG1hcFsocm9vdCA/ICdyJyA6ICckJykgKyB0eXBlXVxuICAgICAgICAgICAgICBpZiAobGlzdCkge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IGxpc3QubGVuZ3RoOyBpLS07KSB7XG4gICAgICAgICAgICAgICAgICBpZiAoIWxpc3RbaV0ucm9vdCAmJiBsaXN0W2ldLm1hdGNoZXMoZWxlbWVudCwgb3JpZ2luYWwsIG51bGwpKSByZXR1cm4gdHJ1ZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICwgZ2V0ID0gZnVuY3Rpb24gKGVsZW1lbnQsIHR5cGUsIG9yaWdpbmFsLCByb290KSB7XG4gICAgICAgICAgICAgIHZhciBlbnRyaWVzID0gW11cbiAgICAgICAgICAgICAgZm9yQWxsKGVsZW1lbnQsIHR5cGUsIG9yaWdpbmFsLCBudWxsLCByb290LCBmdW5jdGlvbiAoZW50cnkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZW50cmllcy5wdXNoKGVudHJ5KVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICByZXR1cm4gZW50cmllc1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgLCBwdXQgPSBmdW5jdGlvbiAoZW50cnkpIHtcbiAgICAgICAgICAgICAgdmFyIGhhcyA9ICFlbnRyeS5yb290ICYmICF0aGlzLmhhcyhlbnRyeS5lbGVtZW50LCBlbnRyeS50eXBlLCBudWxsLCBmYWxzZSlcbiAgICAgICAgICAgICAgICAsIGtleSA9IChlbnRyeS5yb290ID8gJ3InIDogJyQnKSArIGVudHJ5LnR5cGVcbiAgICAgICAgICAgICAgOyhtYXBba2V5XSB8fCAobWFwW2tleV0gPSBbXSkpLnB1c2goZW50cnkpXG4gICAgICAgICAgICAgIHJldHVybiBoYXNcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICwgZGVsID0gZnVuY3Rpb24gKGVudHJ5KSB7XG4gICAgICAgICAgICAgIGZvckFsbChlbnRyeS5lbGVtZW50LCBlbnRyeS50eXBlLCBudWxsLCBlbnRyeS5oYW5kbGVyLCBlbnRyeS5yb290LCBmdW5jdGlvbiAoZW50cnksIGxpc3QsIGkpIHtcbiAgICAgICAgICAgICAgICBsaXN0LnNwbGljZShpLCAxKVxuICAgICAgICAgICAgICAgIGVudHJ5LnJlbW92ZWQgPSB0cnVlXG4gICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09PSAwKSBkZWxldGUgbWFwWyhlbnRyeS5yb290ID8gJ3InIDogJyQnKSArIGVudHJ5LnR5cGVdXG4gICAgICAgICA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VtZW50XG4gICAgICAgICAgICAgICAgLCBjdXN0b20gfHwgdHlwZVxuICAgICAgICAgICAgICAgICwgZnVuY3Rpb24gKGV2ZW50KSB7IC8vIGhhbmRsZXJcbiAgICAgICAgICAgICAgICAgICAgcm9vdExpc3RlbmVyLmNhbGwoZWxlbWVudCwgZXZlbnQsIGN1c3RvbSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAsIHJvb3RMaXN0ZW5lclxuICAgICAgICAgICAgICAgICwgbnVsbFxuICAgICAgICAgICAgICAgICwgbnVsbFxuICAgICAgICAgICAgICAgICwgdHJ1ZSAvLyBpcyByb290XG4gICAgICAgICAgICAgICkpXG4gICAgICAgICAgICAgIGlmIChjdXN0b20gJiYgZWxlbWVudFsnX29uJyArIGN1c3RvbV0gPT0gbnVsbCkgZWxlbWVudFsnX29uJyArIGN1c3RvbV0gPSAwXG4gICAgICAgICAgICAgIGVudHJ5LnRhcmdldC5hdHRhY2hFdmVudCgnb24nICsgZW50cnkuZXZlbnRUeXBlLCBlbnRyeS5oYW5kbGVyKVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgZW50cnkgPSByZWdpc3RyeS5nZXQoZWxlbWVudCwgY3VzdG9tIHx8IHR5cGUsIHJvb3RMaXN0ZW5lciwgdHJ1ZSlbMF1cbiAgICAgICAgICAgICAgaWYgKGVudHJ5KSB7XG4gICAgICAgICAgICAgICAgZW50cnkudGFyZ2V0LmRldGFjaEV2ZW50KCdvbicgKyBlbnRyeS5ldmVudFR5cGUsIGVudHJ5LmhhbmRsZXIpXG4gICAgICAgICAgICAgICAgcmVnaXN0cnkuZGVsKGVudHJ5KVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgLCBvbmNlID0gZnVuY3Rpb24gKHJtLCBlbGVtZW50LCB0eXBlLCBmbiwgb3JpZ2luYWxGbikge1xuICAgICAgICAvLyB3cmFwIHRoZSBoYW5kb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sIGZyb20sIHR5cGUpIHtcbiAgICAgICAgdmFyIGhhbmRsZXJzID0gcmVnaXN0cnkuZ2V0KGZyb20sIHR5cGUsIG51bGwsIGZhbHNlKVxuICAgICAgICAgICwgbCA9IGhhbmRsZXJzLmxlbmd0aFxuICAgICAgICAgICwgaSA9IDBcbiAgICAgICAgICAsIGFyZ3MsIGJlYW5EZWxcblxuICAgICAgICBmb3IgKDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgIGlmIChoYW5kbGVyc1tpXS5vcmlnaW5hbCkge1xuICAgICAgICAgICAgYXJncyA9IFsgZWxlbWVudCwgaGFuZGxlcnNbaV0udHlwZSBdXG4gICAgICAgICAgICBpZiAoYmVhbkRlbCA9IGhhbmRsZXJzW2ldLmhhbmRsZXIuX19iZWFuRGVsKSBhcmdzLnB1c2goYmVhbkRlbC5zZWxlY3RvcilcbiAgICAgICAgICAgIGFyZ3MucHVzaChoYW5kbGVyc1tpXS5vcmlnaW5hbClcbiAgICAgICAgICAgIG9uLmFwcGx5KG51bGwsIGFyZ3MpXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBlbGVtZW50XG4gICAgICB9XG5cbiAgICAsIGJlYW4gPSB7XG4gICAgICAgICAgJ29uJyAgICAgICAgICAgICAgICA6IG9uXG4gICAgICAgICwgJ2FkZCcgICAgICAgICAgICAgICA6IGFkZFxuICAgICAgICAsICdvbmUnICAgICAgICAgICAgICAgOiBvbmVcbiAgICAgICAgLCAnb2ZmJyAgICAgICAgICAgICAgIDogb2ZmXG4gICAgICAgICwgJ3JlbW92ZScgICAgICAgICAgICA6IG9mZlxuICAgICAgICAsICdjbG9uZScgICAgICAgICAgICAgOiBjbG9uZVxuICAgICAgICAsICdmaXJlJyAgICAgICAgICAgICAgOiBmaXJlXG4gICAgICAgICwgJ0V2ZW50JyAgICAgICAgICAgICA6IEV2ZW50XG4gICAgICAgICwgJ3NldFNlbGVjdG9yRW5naW5lJyA6IHNldFNlbGVjdG9yR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bmRleE9mIHx8IGZ1bmN0aW9uKCBpdGVtICkge1xuICAgICAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCB0aGlzLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgIGlmICggaSBpbiB0aGlzICYmIHRoaXNbIGkgXSA9PT0gaXRlbSApIHtcbiAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gLTE7XG4gICAgICB9LFxuXG4gICAgICBET01FeCA9IGZ1bmN0aW9uKCB0eXBlLCBtZXNzYWdlICkge1xuICAgICAgICB0aGlzLm5hbWUgICAgPSB0eXBlO1xuICAgICAgICB0aGlzLmNvZGUgICAgPSBET01FeGNlcHRpb25bIHR5cGUgXTtcbiAgICAgICAgdGhpcy5tZXNzYWdlID0gbWVzc2FnZTtcbiAgICAgIH0sXG5cbiAgICAgIGNoZWNrVG9rZW5BbmRHZXRJbmRleCA9IGZ1bmN0aW9uKCBjbGFzc0xpc3QsIHRva2VuICkge1xuICAgICAgICBpZiAoIHRva2VuID09PSAnJyApIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRE9NRXgoXG4gICAgICAgICAgICAnU1lOVEFYX0VSUicsXG4gICAgICAgICAgICAnQW4gaW52YWxpZCBvciBpbGxlZ2FsIHN0cmluZyB3YXMgc3BlY2lmaWVkJ1xuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCAvXFxzLy50ZXN0KCB0b2tlbiApICkge1xuICAgICAgICAgIHRocm93IG5ldyBET01FeChcbiAgICAgICAgICAgICdJTlZBTElEX0NIQVJBQ1RFUl9FUlInLFxuICAgICAgICAgICAgJ1N0cmluZyBjb250YWlucyBhbiBpbnZhbGlkIGNoYXJhY3RlcidcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhcnJJbmRleE9mLmNhbGwoIGNsYXNzTGlzdCwgdG9rZW4gKTtcbiAgICAgIH0sXG5cbiAgICAg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B0b2tlbiApICE9PSAtMTtcbiAgICB9O1xuXG4gICAgY2xhc3NMaXN0UHJvdG8uYWRkID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXJcbiAgICAgICAgdG9rZW5zICA9IGFyZ3VtZW50cyxcbiAgICAgICAgaXRlciAgICA9IDAsXG4gICAgICAgIGxlbiAgICAgPSB0b2tlbnMubGVuZ3RoLFxuICAgICAgICB1cGRhdGVkID0gZmFsc2UsXG4gICAgICAgIHRva2VuO1xuXG4gICAgICBkbyB7XG4gICAgICAgIHRva2VuID0gdG9rZW5zWyBpdGVyIF0gKyAnJztcbiAgICAgICAgaWYgKCBjaGVja1Rva2VuQW5kR2V0SW5kZXgoIHRoaXMsIHRva2VuICkgPT09IC0xICkge1xuICAgICAgICAgIHRoaXMucHVzaCggdG9rZW4gKTtcbiAgICAgICAgICB1cGRhdGVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICB3aGlsZSAoICsraXRlciA8IGxlbiApO1xuXG4gICAgICBpZiAoIHVwZGF0ZWQgKSB7XG4gICAgICAgIHRoaXMuX3VwZGF0ZUNsYXNzTmFtZSgpO1xuICAgICAgfVxuICAgIH07XG5cbiAgICBjbGFzc0xpc3RQcm90by5yZW1vdmUgPSBmdW5jdGlvbigpIHtcbiAgICAgIHZhclxuICAgICAgICB0b2tlbnMgID0gYXJndW1lbnRzLFxuICAgICAgICBpdGVyICAgID0gMCxcbiAgICAgICAgbGVuICAgICA9IHRva2Vucy5sZW5ndGgsXG4gICAgICAgIHVwZGF0ZWQgPSBmYWxzZSxcbiAgICAgICAgdG9rZW4sXG4gICAgICAgIGluZGV4O1xuXG4gICAgICBkbyB7XG4gICAgICAgIHRva2VuID0gdG9rZW5zWyBpdGVyIF0gKyAnJztcbiAgICAgICAgaW5kZXggPSBjaGVja1Rva2VuQW5kR2V0SW5kZXgoIHRoaXMsIHRva2VuICk7XG5cbiAgICAgICAgd2hpbGUgKCBpbmRleCAhPT0gLTEgKSB7XG4gICAgICAgICAgdGhpcy5zcGxpY2UoIGluZGV4LCAxICk7XG4gICAgICAgICAgdXBkYXRlZCA9IHRydWU7XG4gICAgICAgICAgaW5kZXggPSBjaGVja1Rva2VuQW5kR2V0SW5kZXgoIHRoaXMsIHRva2VuICk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgd2hpbGUgKCArK2l0ZXIgPCBsZW4gKTtcblxuICAgICAgaWYgKCB1cGRhdGVkICkge1xuICAgICAgICB0aGlzLl91cGRhdGVDbGFzc05hbWUoKTtcbiAgICAgIH1cbiAgICB9O1xuXG4gICAgY2xhc3NMaXN0UHJvdG8udG9nZ2xlID0gZnVuY3Rpb24oIHRva2VuLCBmb3JjZSApIHtcbiAgICAgIHRva2VuICs9ICcnO1xuXG4gICAgICB2YXJcbiAgICAgICAgcmVzdWx0ID0gdGhpcy5jb250YWlucyggdG9rZW4gKSxcbiAgICAgICAgbWV0aG9kID0gcmVzdWx0ID8gZm9yY2UgIT09IHRydWUgJiYgJ3JlbW92ZScgOiBmb3JjZSAhPT0gZmFsc2UgJiYgJ2FkZCc7XG5cbiAgICAgIGlmICggbWV0aG9kICkge1xuICAgICAgICB0aGlzWyBtZXRob2QgXSggdG9rZW4gKTtcbiAgICAgIH1cblxuICAgICAgaWYgKCBmb3JjZSA9PT0gdHJ1ZSB8fCBmb3JjZSA9PT0gZmFsc2UgKSB7XG4gICAgICAgIHJldHVybiBmb3JjZTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiAhcmVzdWx0O1xuICAgICAgfVxuICAgIH07XG5cbiAgICBjbGFzc0xpc3RQcm90by50b1N0cmluZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgcmV0dXJuIHRoaXMuam9pbiggJyAnICk7XG4gICAgfTtcblxuICAgIGlmICggb2JqQ3RyLmRlZmluZVByb3BlcnR5ICkge1xuICAgICAgdmFyIGNsYXNzTGlzdFByb3BEZXNjID0ge1xuICAgICAgICAgIGdldCAgICAgICAg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GliL3NoaW1zL2N1c3RvbS1ldmVudCcgKVxuXG52YXIgYmVhbiA9IHJlcXVpcmUoICdiZWFuJyApXG52YXIga2V5ICA9IHJlcXVpcmUoICdrZXltYXN0ZXInICkgXG52YXIgYW5pbWF0aW9uRXZlbnQgICAgPSByZXF1aXJlKCAnLi9saWIvYW5pbWF0aW9uLWV2ZW50cycgKVxudmFyIHBhZ2UgICAgICAgICAgICAgID0gcmVxdWlyZSggJy4vbGliL3BhZ2UnIClcbnZhciB0YXAgICAgICAgICAgICAgICA9IHJlcXVpcmUoICcuL2xpYi90YXAtZXZlbnRzJyApXG52YXIgZGVib3VuY2UgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvZGVib3VuY2UnIClcbnZhciB0aHJvdHRsZSAgICAgICAgICA9IHJlcXVpcmUoICcuL2xpYi90aHJvdHRsZScgKVxudmFyIGRlbGF5ICAgICAgICAgICAgID0gcmVxdWlyZSggJy4vbGliL2RlbGF5JyApXG52YXIgcmVwZWF0ICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvcmVwZWF0JyApXG52YXIgYnViYmxlRm9ybUV2ZW50cyAgPSByZXF1aXJlKCAnLi9saWIvYnViYmxlLWZvcm0tZXZlbnRzJyApXG52YXIgc3VibWl0ICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvc3VibWl0JyApXG52YXIgc2Nyb2xsICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvc2Nyb2xsJyApXG52YXIgcmVzaXplICAgICAgICAgICAgPSByZXF1aXJlKCAnLi9saWIvcmVzaXplJyApXG52YXIgY2FsbGJhY2tNYW5hZ2VyICAgPSByZXF1aXJlKCAnLi9saWIvY2FsbGJhY2stbWFuYWdlcicgKVxudmFyIG1lZGlhICAgICAgICAgICAgID0gcmVxdWlyZSggJy4vbGliL21lZGlhJyApXG5cbnZhciBzbGljZSAgICAgICAgICAgICA9IEFycmF5LnByb3RvdHlwZS5zbGljZVxudmFyIGZvcm1CdWJibGluZ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JywgJ01heScsICdKdW5lJywgJ0p1bHknLCAnQXVndXN0JywgJ1NlcHRlbWJlcicsICdPY3RvYmVyJywgJ05vdmVtYmVyJywgJ0RlY2VtYmVyJ107XG5cbnZhciBtb250aHNTaG9ydCA9IFsnSmFuJywgJ0ZlYicsICdNYXInLCAnQXByJywgJ01heScsICdKdW4nLCAnSnVsJywgJ0F1ZycsICdTZXAnLCAnT2N0JywgJ05vdicsICdEZWMnXTtcblxudmFyIG1vbnRoc05hcnJvdyA9IFsnSicsICdGJywgJ00nLCAnQScsICdNJywgJ0onLCAnSicsICdBJywgJ1MnLCAnTycsICdOJywgJ0QnXTtcblxuZnVuY3Rpb24gbW9udGhzKGxlbmd0aCkge1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgJ25hcnJvdyc6XG4gICAgICByZXR1cm4gbW9udGhzTmFycm93O1xuICAgIGNhc2UgJ3Nob3J0JzpcbiAgICAgIHJldHVybiBtb250aHNTaG9ydDtcbiAgICBjYXNlICdsb25nJzpcbiAgICAgIHJldHVybiBtb250aHNMb25nO1xuICAgIGNhc2UgJ251bWVyaWMnOlxuICAgICAgcmV0dXJuIFsnMScsICcyJywgJzMnLCAnNCcsICc1JywgJzYnLCAnNycsICc4JywgJzknLCAnMTAnLCAnMTEnLCAnMTInXTtcbiAgICBjYXNlICcyLWRpZ2l0JzpcbiAgICAgIHJldHVybiBbJzAxJywgJzAyJywgJzAzJywgJzA0JywgJzA1JywgJzA2JywgJzA3JywgJzA4JywgJzA5JywgJzEwJywgJzExJywgJzEyJ107XG4gICAgZGVmYXVsdDpcbiAgICAgIHJldHVybiBudWxsO1xuICB9XG59XG5cbnZhciB3ZWVrZGF5c0xvbmcgPSBbJ01vbmRheScsICdUdWVzZGF5JywgJ1dlZG5lc2RheScsICdUaHVyc2RheScsICdGcmlkYXknLCAnU2F0dXJkYXknLCAnU3VuZGF5J107XG5cbnZhciB3ZWVrZGF5c1Nob3J0ID0gWydNb24nLCAnVHVlJywg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1pbnV0ZXMgPSBNYXRoLmFicyhkdC5vZmZzZXQgJSA2MCksXG4gICAgICAgICAgc2lnbiA9IGhvdXJzID49IDAgPyAnKycgOiAnLScsXG4gICAgICAgICAgYmFzZSA9ICcnICsgc2lnbiArIE1hdGguYWJzKGhvdXJzKTtcblxuICAgICAgc3dpdGNoIChvcHRzLmZvcm1hdCkge1xuICAgICAgICBjYXNlICdzaG9ydCc6XG4gICAgICAgICAgcmV0dXJuICcnICsgc2lnbiArIF90aGlzLm51bShNYXRoLmFicyhob3VycyksIDIpICsgJzonICsgX3RoaXMubnVtKG1pbnV0ZXMsIDIpO1xuICAgICAgICBjYXNlICduYXJyb3cnOlxuICAgICAgICAgIHJldHVybiBtaW51dGVzID4gMCA/IGJhc2UgKyAnOicgKyBtaW51dGVzIDogYmFzZTtcbiAgICAgICAgY2FzZSAndGVjaGllJzpcbiAgICAgICAgICByZXR1cm4gJycgKyBzaWduICsgX3RoaXMubnVtKE1hdGguYWJzKGhvdXJzKSwgMikgKyBfdGhpcy5udW0obWludXRlcywgMik7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgdGhyb3cgbmV3IFJhbmdlRXJyb3IoJ1ZhbHVlIGZvcm1hdCAnICsgb3B0cy5mb3JtYXQgKyAnIGlzIG91dCBvZiByYW5nZSBmb3IgcHJvcGVydHkgZm9ybWF0Jyk7XG4gICAgICB9XG4gICAgfSxcbiAgICAgICAgbWVyaWRpZW0gPSBmdW5jdGlvbiBtZXJpZGllbSgpIHtcbiAgICAgIHJldHVybiBrbm93bkVuZ2xpc2ggPyBtZXJpZGllbUZvckRhdGVUaW1lKGR0KSA6IHN0cmluZyh7IGhvdXI6ICdudW1lcmljJywgaG91cjEyOiB0cnVlIH0sICdkYXlwZXJpb2QnKTtcbiAgICB9LFxuICAgICAgICBtb250aCA9IGZ1bmN0aW9uIG1vbnRoKGxlbmd0aCwgc3RhbmRhbG9uZSkge1xuICAgICAgcmV0dXJuIGtub3duRW5nbGlzaCA/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bGVuZGFyO1xuXG4gICAgICAvLyBXaGVyZSBwb3NzaWJsZTogaHR0cDovL2NsZHIudW5pY29kZS5vcmcvdHJhbnNsYXRpb24vZGF0ZS10aW1lI1RPQy1TdGFuZC1BbG9uZS12cy4tRm9ybWF0LVN0eWxlc1xuICAgICAgc3dpdGNoICh0b2tlbikge1xuICAgICAgICAvLyBtc1xuICAgICAgICBjYXNlICdTJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0Lm1pbGxpc2Vjb25kKTtcbiAgICAgICAgY2FzZSAndSc6XG4gICAgICAgIC8vIGZhbGxzIHRocm91Z2hcbiAgICAgICAgY2FzZSAnU1NTJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0Lm1pbGxpc2Vjb25kLCAzKTtcbiAgICAgICAgLy8gc2Vjb25kc1xuICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LnNlY29uZCk7XG4gICAgICAgIGNhc2UgJ3NzJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LnNlY29uZCwgMik7XG4gICAgICAgIC8vIG1pbnV0ZXNcbiAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5taW51dGUpO1xuICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5taW51dGUsIDIpO1xuICAgICAgICAvLyBob3Vyc1xuICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LmhvdXIgJSAxMiA9PT0gMCA/IDEyIDogZHQuaG91ciAlIDEyKTtcbiAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgIHJldHVybiBfdGhpcy5udW0oZHQuaG91ciAlIDEyID09PSAwID8gMTIgOiBkdC5ob3VyICUgMTIsIDIpO1xuICAgICAgICBjYXNlICdIJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LmhvdXIpO1xuICAgICAgICBjYXNlICdISCc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5ob3VyLCAyKTtcbiAgICAgICAgLy8gb2Zmc2V0XG4gICAgICAgIGNhc2UgJ1onOlxuICAgICAgICAgIC8vIGxpa2UgKzZcbiAgICAgICAgICByZXR1cm4gZm9ybWF0T2Zmc2V0KHsgZm9ybWF0OiAnbmFycm93JywgYWxsb3daOiBfdGhpcy5vcHRzLmFsbG93WiB9KTtcbiAgICAgICAgY2FzZSAnWlonOlxuICAgICAgICAgIC8vIGxpa2UgKzA2OjAwXG4gICAgICAgICAgcmV0dXJuIGZvcm1hdE9mZnNldCh7IGZvcm1hdDogJ3Nob3J0JywgYWxsb3daOiBfdGhpcy5vcHRzLmFsbG93WiB9KTtcbiAgICAgICAgY2FzZSAnWlpaJzpcbiAgICAgICAgICAvLyBsaWtlICswNjAwXG4gICAgICAgICAgcmV0dXJuIGZvcm1hdE9mZnNldCh7IGZvcm1hdDogJ3RlY2hpZScsIGFsbG93WjogZmFsc2UgfSk7XG4gICAgICAgIGNhc2UgJ1paWlonOlxuICAgICAgICAgIC8vIGxpa2UgRVNUXG4gICAgICAgICAgcmV0dXJuIGR0Lm9mZnNldE5hbWVTaG9ydDtcbiAgICAgICAgY2FzZSAnWlpaWlonOlxuICAgICAgICAgIC8vIGxpa2UgRWFzdGVybiBTdGFuZGFyZCBUaW1lXG4gICAgICAgICAgcmV0dXJuIGR0Lm9mZnNldE5hbWVMb25nO1xuICAgICAgICAvLyB6b25lXG4gICAgICAgIGNhc2UgJ3onOlxuICAgICAgICAgIC8vIGxpa2UgQW1lcmljYS9OZXdfWW9ya1xuICAgICAgICAgIHJldHVybiBkdC56b25lTmFtZTtcbiAgICAgICAgLy8gbWVyaWRpZW1zXG4gICAgICAgIGNhc2UgJ2EnOlxuICAgICAgICAgIHJldHVybiBtZXJpZGllbSgpO1xuICAgICAgICAvLyBkYXRlc1xuICAgICAgICB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WVzZGF5J1xuICAgICAgICAgIHJldHVybiB3ZWVrZGF5KCdsb25nJywgZmFsc2UpO1xuICAgICAgICBjYXNlICdFRUVFRSc6XG4gICAgICAgICAgLy8gbGlrZSAnVCdcbiAgICAgICAgICByZXR1cm4gd2Vla2RheSgnbmFycm93JywgZmFsc2UpO1xuICAgICAgICAvLyBtb250aHMgLSBzdGFuZGFsb25lXG4gICAgICAgIGNhc2UgJ0wnOlxuICAgICAgICAgIC8vIGxpa2UgMVxuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyBtb250aDogJ251bWVyaWMnLCBkYXk6ICdudW1lcmljJyB9LCAnbW9udGgnKSA6IF90aGlzLm51bShkdC5tb250aCk7XG4gICAgICAgIGNhc2UgJ0xMJzpcbiAgICAgICAgICAvLyBsaWtlIDAxLCBkb2Vzbid0IHNlZW0gdG8gd29ya1xuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyBtb250aDogJzItZGlnaXQnLCBkYXk6ICdudW1lcmljJyB9LCAnbW9udGgnKSA6IF90aGlzLm51bShkdC5tb250aCwgMik7XG4gICAgICAgIGNhc2UgJ0xMTCc6XG4gICAgICAgICAgLy8gbGlrZSBKYW5cbiAgICAgICAgICByZXR1cm4gbW9udGgoJ3Nob3J0JywgdHJ1ZSk7XG4gICAgICAgIGNhc2UgJ0xMTEwnOlxuICAgICAgICAgIC8vIGxpa2UgSmFudWFyeVxuICAgICAgICAgIHJldHVybiBtb250aCgnbG9uZycsIHRydWUpO1xuICAgICAgICBjYXNlICdMTExMTCc6XG4gICAgICAgICAgLy8gbGlrZSBKXG4gICAgICAgICAgcmV0dXJuIG1vbnRoKCduYXJyb3cnLCB0cnVlKTtcbiAgICAgICAgLy8gbW9udGhzIC0gZm9ybWF0XG4gICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgIC8vIGxpa2UgMVxuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyBtb250aDogJ251bWVyaWMnIH0sICdtb250aCcpIDogX3RoaXMubnVtKGR0Lm1vbnRoKTtcbiAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgIC8vIGxpa2UgMDFcbiAgICAgICAgICByZXR1cm4gb3V0cHV0Q2FsID8gc3RyaW5nKHsgbW9udGg6ICcyLWRpZ2l0JyB9LCAnbW9udGgnKSA6IF90aGlzLm51bShkdC5tb250aCwgMik7XG4gICAgICAgIGNhc2UgJ01NTSc6XG4gICAgICAgICAgLy8gbGlrZSBKYW5cbiAgICAgICAgICByZXR1cm4gbW9udGgoJ3Nob3J0JywgZmFsc2UpO1xuICAgICAgICBjYXNlICdNTU1NJzpcbiAgICAgICAgICAvLyBsaWtlIEphbnVhcnlcbiAgICAgICAgICByZXR1cm4gbW9udGgoJ2xvbmcnLCBmYWxzZSk7XG4gICAgICAgIGNhc2UgJ01NTU1NJzpcbiAgICAgICAgICAvLyBsaWtlIEpcbiAgICAgICAgICByZXR1cm4gbW9udGgoJ25hcnJvdycsIGZhbHNlKTtcbiAgICAgICAgLy8geWVhcnNcbiAgICAgICAgY2FzZSAneSc6XG4gICAgICAgICAgLy8gbGlrZSAyMDE0XG4gICAgICAgICAgcmV0dXJuIG91dHB1dENhbCA/IHN0cmluZyh7IHllYXI6ICdudW1lcmljJyB9LCAneWVhcicpIDogX3RoaXMubnVtKGR0LnllYXIpO1xuICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgLy8gbGlrZSAxNFxuICAgICAgICAgIHJldHVybiBvdXRwdXRDYWwgPyBzdHJpbmcoeyB5ZWFyOiAnMi1kaWdpdCcgfSwgJ3llYXInKSA6IF90aGlzLm51bShkdC55ZWFyLnRvU3RyaW5nKCkuc2xpY2UoLTIpLCAyKTtcbiAgICAgICAgY2FzZSAneXl5eSc6XG4gICAgICAgICAgLy8gbGlrZSAwMDEyXG4gICAgICAgICAgcmV0dXJuIG91dHB1dENhbCA/IHN0cmluZyh7IHllYXI6ICdudW1lcmljJyB9LCAneWVhcicpIDogX3RoaXMubnVtKGR0LnllYXIsIDQpO1xuICAgICAgICBjYXNlICd5eXl5eXknOlxuICAgICAgICAgIC8vIGxpa2UgMDAwMDEyXG4gICAgICAgICAgcmV0dXJuIG91dHB1dENhbCA/IHN0cmluZyh7IHllYXI6ICdudW1lcmljJyB9LCAneWVhcicpIDogX3RoaXMubnVtKGR0LnllYXIsIDYpO1xuICAgICAgICAvLyBlcmFzXG4gICAgICAgIGNhc2UgJ0cnOlxuICAgICAgICAgIC8vIGxpa2UgQURcbiAgICAgICAgICByZXR1cm4gZXJhKCdzaG9ydCcpO1xuICAgICAgICBjYXNlICdHRyc6XG4gICAgICAgICAgLy8gbGlrZSBBbm5vIERvbWluaVxuICAgICAgICAgIHJldHVybiBlcmEoJ2xvbmcnKTtcbiAgICAgICAgY2FzZSAnR0dHR0cnOlxuICAgICAgICAgIHJldHVybiBlcmEoJ25hcnJvdycpO1xuICAgICAgICBjYXNlICdrayc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC53ZWVrWWVhci50b1N0cmluZygpLnNsaWNlKC0yKSwgMik7XG4gICAgICAgIGNhc2UgJ2tra2snOlxuICAgICAgICAgIHJldHVybiBfdGhpcy5udW0oZHQud2Vla1llYXIsIDQpO1xuICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LndlZWtOdW1iZXIpO1xuICAgICAgICBjYXNlICdXVyc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC53ZWVrTnVtYmVyLCAyKTtcbiAgICAgICAgY2FzZSAnbyc6XG4gICAgICAgICAgcmV0dXJuIF90aGlzLm51bShkdC5vcmRpbmFsKTtcbiAgICAgICAgY2FzZSAnb29vJzpcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0Lm9yZGluYWwsIDMpO1xuICAgICAgICBjYXNlICdxJzpcbiAgICAgICAgICAvLyBsaWtlIDFcbiAgICAgICAgICByZXR1cm4gX3RoaXMubnVtKGR0LnF1YXJ0ZXIpO1xuICAgICAgICBjYXNlICdxcSc6XG4gICAgICAgICAgLy8gbGlrZSAwMVxuICAgICAgICAgIHJldHVybiBfdGhpcy5udW0oZHQucXVhcnRlciwgMik7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgcmV0dXJuIG1heWJlTWFjcm8odG9rZW4pO1xuICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gc3RyaW5naWZ5VG9rZW5zKEZvcm1hdHRlci5wYXJzZUZvcm1hdChmbXQpLCB0b2tlblRvU3RyaW5nKTtcbiAgfTtcblxuICBGb3JtYXR0ZXIucHJvdG90eXBlLmZvcm1hdER1cmF0aW9uRnJvbVN0cmluZyA9IGZ1bmN0aW9uIGZvcm1hdER1cmF0aW9uRnJvbVN0cmluZyhkdXIsIGZtdCkge1xuICAgIHZhciBfdGhpczIgPSB0aGlzO1xuXG4gICAgdmFyIHRva2VuVG9GaWVsZCA9IGZ1bmN0aW9uIHRva2VuVG9GaWVsZCh0b2tlbikge1xuICAgICAgc3dpdGNoICh0b2tlblswXSkge1xuICAgICAgICBjYXNlICdTJzpcbiAgICAgICAgICByZXR1cm4gJ21pbGxpc2Vjb25kJztcbiAgICAgICAgY2FzZSAncyc6XG4gICAgICAgICAgcmV0dXJuICdzZWNvbmQnO1xuICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICByZXR1cm4gJ21pbnV0ZSc7XG4gICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgIHJldHVybiAnaG91cic7XG4gICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgIHJldHVybiAnZGF5JztcbiAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgcmV0dXJuICdtb250aCc7XG4gICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgIHJldHVybiAneWVhcic7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9XG4gICA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gIHJldHVybiBvbmVPZihsb2MubW9udGhzKCdzaG9ydCcsIGZhbHNlLCBmYWxzZSksIDEpO1xuICAgICAgY2FzZSAnTU1NTSc6XG4gICAgICAgIHJldHVybiBvbmVPZihsb2MubW9udGhzKCdsb25nJywgZmFsc2UsIGZhbHNlKSwgMSk7XG4gICAgICBjYXNlICdMJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lT3JUd28pO1xuICAgICAgY2FzZSAnTEwnOlxuICAgICAgICByZXR1cm4gaW50VW5pdCh0d28pO1xuICAgICAgY2FzZSAnTExMJzpcbiAgICAgICAgcmV0dXJuIG9uZU9mKGxvYy5tb250aHMoJ3Nob3J0JywgdHJ1ZSwgZmFsc2UpLCAxKTtcbiAgICAgIGNhc2UgJ0xMTEwnOlxuICAgICAgICByZXR1cm4gb25lT2YobG9jLm1vbnRocygnbG9uZycsIHRydWUsIGZhbHNlKSwgMSk7XG4gICAgICAvLyBkYXRlc1xuICAgICAgY2FzZSAnZCc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KG9uZU9yVHdvKTtcbiAgICAgIGNhc2UgJ2RkJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQodHdvKTtcbiAgICAgIC8vIG9yZGluYWxzXG4gICAgICBjYXNlICdvJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lVG9UaHJlZSk7XG4gICAgICBjYXNlICdvb28nOlxuICAgICAgICByZXR1cm4gaW50VW5pdCh0aHJlZSk7XG4gICAgICAvLyB0aW1lXG4gICAgICBjYXNlICdISCc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KHR3byk7XG4gICAgICBjYXNlICdIJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lT3JUd28pO1xuICAgICAgY2FzZSAnaGgnOlxuICAgICAgICByZXR1cm4gaW50VW5pdCh0d28pO1xuICAgICAgY2FzZSAnaCc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KG9uZU9yVHdvKTtcbiAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQodHdvKTtcbiAgICAgIGNhc2UgJ20nOlxuICAgICAgICByZXR1cm4gaW50VW5pdChvbmVPclR3byk7XG4gICAgICBjYXNlICdzJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lT3JUd28pO1xuICAgICAgY2FzZSAnc3MnOlxuICAgICAgICByZXR1cm4gaW50VW5pdCh0d28pO1xuICAgICAgY2FzZSAnUyc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KG9uZVRvVGhyZWUpO1xuICAgICAgY2FzZSAnU1NTJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQodGhyZWUpO1xuICAgICAgY2FzZSAndSc6XG4gICAgICAgIHJldHVybiBzaW1wbGUoL1xcZHsxLDl9Lyk7XG4gICAgICAvLyBtZXJpZGllbVxuICAgICAgY2FzZSAnYSc6XG4gICAgICAgIHJldHVybiBvbmVPZihsb2MubWVyaWRpZW1zKCksIDApO1xuICAgICAgLy8gd2Vla1llYXIgKGspXG4gICAgICBjYXNlICdra2trJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQoZm91cik7XG4gICAgICBjYXNlICdrayc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KHR3b1RvRm91ciwgdW50cnVuY2F0ZVllYXIpO1xuICAgICAgLy8gd2Vla051bWJlciAoVylcbiAgICAgIGNhc2UgJ1cnOlxuICAgICAgICByZXR1cm4gaW50VW5pdChvbmVPclR3byk7XG4gICAgICBjYXNlICdXVyc6XG4gICAgICAgIHJldHVybiBpbnRVbml0KHR3byk7XG4gICAgICAvLyB3ZWVrZGF5c1xuICAgICAgY2FzZSAnRSc6XG4gICAgICBjYXNlICdjJzpcbiAgICAgICAgcmV0dXJuIGludFVuaXQob25lKTtcbiAgICAgIGNhc2UgJ0VFRSc6XG4gICAgICAgIHJldHVybiBvbmVPZihsb2Mud2Vla2RheXMoJ3Nob3J0JywgZmFsc2UsIGZhbHNlKSwgMSk7XG4gICAgICBjYXN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HZhciB0b0ZpZWxkID0gZnVuY3Rpb24gdG9GaWVsZCh0b2tlbikge1xuICAgIHN3aXRjaCAodG9rZW4pIHtcbiAgICAgIGNhc2UgJ1MnOlxuICAgICAgICByZXR1cm4gJ21pbGxpc2Vjb25kJztcbiAgICAgIGNhc2UgJ3MnOlxuICAgICAgICByZXR1cm4gJ3NlY29uZCc7XG4gICAgICBjYXNlICdtJzpcbiAgICAgICAgcmV0dXJuICdtaW51dGUnO1xuICAgICAgY2FzZSAnaCc6XG4gICAgICBjYXNlICdIJzpcbiAgICAgICAgcmV0dXJuICdob3VyJztcbiAgICAgIGNhc2UgJ2QnOlxuICAgICAgICByZXR1cm4gJ2RheSc7XG4gICAgICBjYXNlICdvJzpcbiAgICAgICAgcmV0dXJuICdvcmRpbmFsJztcbiAgICAgIGNhc2UgJ0wnOlxuICAgICAgY2FzZSAnTSc6XG4gICAgICAgIHJldHVybiAnbW9udGgnO1xuICAgICAgY2FzZSAneSc6XG4gICAgICAgIHJldHVybiAneWVhcic7XG4gICAgICBjYXNlICdFJzpcbiAgICAgIGNhc2UgJ2MnOlxuICAgICAgICByZXR1cm4gJ3dlZWtkYXknO1xuICAgICAgY2FzZSAnVyc6XG4gICAgICAgIHJldHVybiAnd2Vla051bWJlcic7XG4gICAgICBjYXNlICdrJzpcbiAgICAgICAgcmV0dXJuICd3ZWVrWWVhcic7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG4gIH07XG5cbiAgdmFyIHpvbmUgPSB2b2lkIDA7XG4gIGlmICghaXNVbmRlZmluZWQobWF0Y2hlcy5aKSkge1xuICAgIHpvbmUgPSBuZXcgRml4ZWRPZmZzZXRab25lKG1hdGNoZXMuWik7XG4gIH0gZWxzZSBpZiAoIWlzVW5kZWZpbmVkKG1hdGNoZXMueikpIHtcbiAgICB6b25lID0gbmV3IElBTkFab25lKG1hdGNoZXMueik7XG4gIH0gZWxzZSB7XG4gICAgem9uZSA9IG51bG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Bsb2NhbGUgaGFzIGJlZW4gc3BlY2lmaWVkXHJcbiAgICogQHNlZSBodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZy9lbi1VUy9kb2NzL1dlYi9KYXZhU2NyaXB0L1JlZmVyZW5jZS9HbG9iYWxfT2JqZWN0cy9EYXRlVGltZUZvcm1hdC9mb3JtYXRUb1BhcnRzXHJcbiAgICogQHBhcmFtIG9wdHMge09iamVjdH0gLSBJbnRsLkRhdGVUaW1lRm9ybWF0IGNvbnN0cnVjdG9yIG9wdGlvbnMsIHNhbWUgYXMgYHRvTG9jYWxlU3RyaW5nYC5cclxuICAgKiBAZXhhbXBsZSBEYXRlVGltZS5sb2NhbCgpLnRvTG9jYWxlU3RyaW5nKCk7IC8vPT4gW1xyXG4gICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy89PiAgIHsgdHlwZTogJ2RheScsIHZhbHVlOiAnMjUnIH0sXHJcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLz0+ICAgeyB0eXBlOiAnbGl0ZXJhbCcsIHZhbHVlOiAnLycgfSxcclxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vPT4gICB7IHR5cGU6ICdtb250aCcsIHZhbHVlOiAnMDUnIH0sXHJcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLz0+ICAgeyB0eXBlOiAnbGl0ZXJhbCcsIHZhbHVlOiAnLycgfSxcclxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vPT4gICB7IHR5cGU6ICd5ZWFyJywgdmFsdWU6ICcxOTgyJyB9XHJcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLz0+IF1cclxuICAgKi9cblxuXG4gIERhdGVUaW1lLnByb3RvdHlwZS50b0xvY2FsZVBhcnRzID0gZnVuY3Rpb24gdG9Mb2NhbGVQYXJ0cygpIHtcbiAgICB2Y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dGhpcy5fZGF0YSxcbiAgICBoZWFkZXJzOiB0aGlzLl9oZWFkZXIsXG4gIH07XG59O1xuXG4vKipcbiAqIFNlbmQgYGRhdGFgIGFzIHRoZSByZXF1ZXN0IGJvZHksIGRlZmF1bHRpbmcgdGhlIGAudHlwZSgpYCB0byBcImpzb25cIiB3aGVuXG4gKiBhbiBvYmplY3QgaXMgZ2l2ZW4uXG4gKlxuICogRXhhbXBsZXM6XG4gKlxuICogICAgICAgLy8gbWFudWFsIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnanNvbicpXG4gKiAgICAgICAgIC5zZW5kKCd7XCJuYW1lXCI6XCJ0alwifScpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gbWFudWFsIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoJ25hbWU9dGonKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBkZWZhdWx0cyB0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgcmVxdWVzdC5wb3N0K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XplKG5hbWUsICduYW1lJyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG5hbWUgPSBuYW1lLnJlcGxhY2UoLycvZywgXCJcXFxcJ1wiKVxuICAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxcXFwiL2csICdcIicpXG4gICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oXlwifFwiJCkvZywgXCInXCIpO1xuICAgICAgbmFtZSA9IGN0eC5zdHlsaXplKG5hbWUsICdzdHJpbmcnKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gbmFtZSArICc6ICcgKyBzdHI7XG59XG5cblxuZnVuY3Rpb24gcmVkdWNlVG9TaW5nbGVTdHJpbmcob3V0cHV0LCBiYXNlLCBicmFjZXMpIHtcbiAgdmFyIG51bUxpbmVzRXN0ID0gMDtcbiAgdmFyIGxlbmd0aCA9IG91dHB1dC5yZWR1Y2UoZnVuY3Rpb24ocHJldiwgY3VyKSB7XG4gICAgbnVtTGluZXNFc3QrKztcbiAgICBpZiAoY3VyLmluZGV4T2YoJ1xcbicpID49IDApIG51bUxpbmVzRXN0Kys7XG4gICAgcmV0dXJuIHByZXYgKyBjdXIucmVwbGFjZSgvXFx1MDAxYlxcW1xcZFxcZD9tL2csICcnKS5sZW5ndGggKyAxO1xuICB9LCAwKTtcblxuICBpZiAobGVuZ3RoID4gNjApIHtcbiAgICByZXR1cm4gYnJhY2VzWzBdICtcbiAgICAgICAgICAgKGJhc2UgPT09ICcnID8gJycgOiBiYXNlICsgJ1xcbiAnKSArXG4gICAgICAgICAgICcgJyArXG4gICAgICAgICAgIG91dHB1dC5qb2luKCcsXFxuICAnKSArXG4gICAgICAgICAgICcgJyArXG4gICAgICAgICAgIGJyYWNlc1sxXTtcbiAgfVxuXG4gIHJldHVybiBicmFjZXNbMF0gKyBiYXNlICsgJyAnICsgb3V0cHV0LmpvaW4oJywgJykgKyAnICcgKyBicmFjZXNbMV07XG59XG5cblxuLy8gTk9URTogVGhlc2UgdHlwZSBjaGVja2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