· 9 years ago · Jan 18, 2017, 01:52 PM
1<?php
2
3/*
4
5 Copyright 2011-12 Cory Lamle lifeinthegrid.com
6
7
8
9 This program is free software; you can redistribute it and/or modify
10
11 it under the terms of the GNU General Public License, version 2, as
12
13 published by the Free Software Foundation.
14
15
16
17 This program is distributed in the hope that it will be useful,
18
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
23 GNU General Public License for more details.
24
25
26
27 You should have received a copy of the GNU General Public License
28
29 along with this program; if not, write to the Free Software
30
31 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32
33
34
35 SOURCE CONTRIBUTORS:
36
37 Gaurav Aggarwal
38
39 David Coveney of Interconnect IT Ltd
40
41 https://github.com/interconnectit/Search-Replace-DB/
42
43 */
44
45
46
47if (file_exists('dtoken.php')) {
48
49 //This is most likely inside the snapshot folder.
50
51
52
53 //DOWNLOAD ONLY: (Only enable download from within the snapshot directory)
54
55 if (isset($_GET['get']) && isset($_GET['file'])) {
56
57 //Clean the input, strip out anything not alpha-numeric or "_.", so restricts
58
59 //only downloading files in same folder, and removes risk of allowing directory
60
61 //separators in other charsets (vulnerability in older IIS servers), also
62
63 //strips out anything that might cause it to use an alternate stream since
64
65 //that would require :// near the front.
66
67 $filename = preg_replace('/[^a-zA-Z0-9_.]*/','',$_GET['file']);
68
69 if (strlen($filename) && file_exists($filename) && (strstr($filename, '_installer.php'))) {
70
71 //Attempt to push the file to the browser
72
73 header('Content-Description: File Transfer');
74
75 header('Content-Type: application/octet-stream');
76
77 header('Content-Disposition: attachment; filename=installer.php');
78
79 header('Content-Transfer-Encoding: binary');
80
81 header('Expires: 0');
82
83 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
84
85 header('Pragma: public');
86
87 header('Content-Length: ' . filesize($filename));
88
89 //FIXME: We should consider removing all error supression like this
90
91 //as it makes troubleshooting a wild goose chase for times that the
92
93 //script failes on such a line. The same can and should be accomplished
94
95 //at the server level by turning off displaying errors in PHP.
96
97 @ob_clean();
98
99 @flush();
100
101 if (@readfile($filename) == false) {
102
103 $data = file_get_contents($filename);
104
105 if ($data == false) {
106
107 die("Unable to read installer file. The server currently has readfile and file_get_contents disabled on this server. Please contact your server admin to remove this restriction");
108
109 } else {
110
111 print $data;
112
113 }
114
115 }
116
117 } else {
118
119 header("HTTP/1.1 404 Not Found", true, 404);
120
121 header("Status: 404 Not Found");
122
123 }
124
125 }
126
127
128
129 //Prevent Access from rovers or direct browsing in snapshop directory, or when
130
131 //requesting to download a file, should not go past this point.
132
133 exit;
134
135}
136
137?>
138
139
140
141<?php if (false) : ?>
142
143 <!DOCTYPE html>
144
145 <html>
146
147 <head>
148
149 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
150
151 <title>Error: PHP is not running</title>
152
153 </head>
154
155 <body>
156
157 <h2>Error: PHP is not running</h2>
158
159 <p>Duplicator requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
160
161 </body>
162
163 </html>
164
165<?php endif; ?>
166
167
168
169
170
171<?php
172
173/* ==============================================================================================
174
175ADVANCED FEATURES - Allows admins to perform aditional logic on the import.
176
177
178
179$GLOBALS['TABLES_SKIP_COLS']
180
181 Add Known column names of tables you don't want the search and replace logic to run on.
182
183
184
185$GLOBALS['REPLACE_LIST']
186
187 Add additional search and replace items to step 2 for the serialize engine.
188
189 Place directly below $GLOBALS['REPLACE_LIST'] variable below your items
190
191 EXAMPLE:
192
193 array_push($GLOBALS['REPLACE_LIST'], array('search' => 'https://oldurl/', 'replace' => 'https://newurl/'));
194
195 array_push($GLOBALS['REPLACE_LIST'], array('search' => 'ftps://oldurl/', 'replace' => 'ftps://newurl/'));
196
197 ================================================================================================= */
198
199
200
201$GLOBALS['FW_TABLEPREFIX'] = 'wp_';
202
203$GLOBALS['FW_URL_OLD'] = 'http://mrapk.ir/max2';
204
205$GLOBALS['FW_URL_NEW'] = '';
206
207$GLOBALS['FW_PACKAGE_NAME'] = 'maxshoptwo_561d0fb0f09571345151013173536_archive.zip';
208
209$GLOBALS['FW_PACKAGE_NOTES'] = '';
210
211$GLOBALS['FW_SECURE_NAME'] = 'maxshoptwo_561d0fb0f09571345151013173536';
212
213$GLOBALS['FW_DBHOST'] = '';
214
215$GLOBALS['FW_DBHOST'] = empty($GLOBALS['FW_DBHOST']) ? 'localhost' : $GLOBALS['FW_DBHOST'];
216
217$GLOBALS['FW_DBPORT'] = '';
218
219$GLOBALS['FW_DBPORT'] = empty($GLOBALS['FW_DBPORT']) ? 3306 : $GLOBALS['FW_DBPORT'];
220
221$GLOBALS['FW_DBNAME'] = '';
222
223$GLOBALS['FW_DBUSER'] = '';
224
225$GLOBALS['FW_DBPASS'] = '';
226
227$GLOBALS['FW_SSL_ADMIN'] = 0;
228
229$GLOBALS['FW_SSL_LOGIN'] = 0;
230
231$GLOBALS['FW_CACHE_WP'] = 0;
232
233$GLOBALS['FW_CACHE_PATH'] = 0;
234
235$GLOBALS['FW_BLOGNAME'] = 'قالب وردپرس مکس شاپ';
236
237$GLOBALS['FW_WPROOT'] = '/home1/mrapkir/public_html/max2/';
238
239$GLOBALS['FW_DUPLICATOR_VERSION'] = '0.5.32';
240
241$GLOBALS['FW_OPTS_DELETE'] = json_decode('["duplicator_ui_view_state","duplicator_package_active","duplicator_settings"]', true);
242
243
244
245//DATABASE SETUP: all time in seconds
246
247$GLOBALS['DB_MAX_TIME'] = 5000;
248
249$GLOBALS['DB_MAX_PACKETS'] = 268435456;
250
251ini_set('mysql.connect_timeout', '5000');
252
253
254
255//PHP SETUP: all time in seconds
256
257ini_set('memory_limit', '5000M');
258
259ini_set("max_execution_time", '5000');
260
261ini_set("max_input_time", '5000');
262
263ini_set('default_socket_timeout', '5000');
264
265@set_time_limit(0);
266
267
268
269$GLOBALS['DBCHARSET_DEFAULT'] = 'utf8';
270
271$GLOBALS['DBCOLLATE_DEFAULT'] = 'utf8_general_ci';
272
273
274
275//UPDATE TABLE SETTINGS
276
277$GLOBALS['TABLES_SKIP_COLS'] = array('');
278
279$GLOBALS['REPLACE_LIST'] = array();
280
281
282
283
284
285/* ================================================================================================
286
287 END ADVANCED FEATURES: Do not edit below here.
288
289 =================================================================================================== */
290
291
292
293//CONSTANTS
294
295define("DUPLICATOR_INIT", 1);
296
297define("DUPLICATOR_SSDIR_NAME", 'wp-snapshots'); //This should match DUPLICATOR_SSDIR_NAME in duplicator.php
298
299
300
301//SHARED POST PARMS
302
303$_POST['action_step'] = isset($_POST['action_step']) ? $_POST['action_step'] : "1";
304
305
306
307/* Host has several combinations :
308
309localhost | localhost:55 | localhost: | http://localhost | http://localhost:55 */
310
311$_POST['dbhost'] = isset($_POST['dbhost']) ? trim($_POST['dbhost']) : null;
312
313$_POST['dbport'] = isset($_POST['dbport']) ? trim($_POST['dbport']) : 3306;
314
315$_POST['dbuser'] = isset($_POST['dbuser']) ? trim($_POST['dbuser']) : null;
316
317$_POST['dbpass'] = isset($_POST['dbpass']) ? trim($_POST['dbpass']) : null;
318
319$_POST['dbname'] = isset($_POST['dbname']) ? trim($_POST['dbname']) : null;
320
321$_POST['dbcharset'] = isset($_POST['dbcharset']) ? trim($_POST['dbcharset']) : $GLOBALS['DBCHARSET_DEFAULT'];
322
323$_POST['dbcollate'] = isset($_POST['dbcollate']) ? trim($_POST['dbcollate']) : $GLOBALS['DBCOLLATE_DEFAULT'];
324
325
326
327//GLOBALS
328
329$GLOBALS["SQL_FILE_NAME"] = "installer-data.sql";
330
331$GLOBALS["LOG_FILE_NAME"] = "installer-log.txt";
332
333$GLOBALS['SEPERATOR1'] = str_repeat("********", 10);
334
335$GLOBALS['LOGGING'] = isset($_POST['logging']) ? $_POST['logging'] : 1;
336
337$GLOBALS['CURRENT_ROOT_PATH'] = dirname(__FILE__);
338
339$GLOBALS['CHOWN_ROOT_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}", 0755);
340
341$GLOBALS['CHOWN_LOG_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}/{$GLOBALS['LOG_FILE_NAME']}", 0644);
342
343$GLOBALS['URL_SSL'] = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? true : false;
344
345$GLOBALS['URL_PATH'] = ($GLOBALS['URL_SSL']) ? "https://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}" : "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
346
347
348
349
350
351
352
353
354
355//Restart log if user starts from step 1
356
357if ($_POST['action_step'] == 1) {
358
359 $GLOBALS['LOG_FILE_HANDLE'] = @fopen($GLOBALS['LOG_FILE_NAME'], "w+");
360
361} else {
362
363 $GLOBALS['LOG_FILE_HANDLE'] = @fopen($GLOBALS['LOG_FILE_NAME'], "a+");
364
365}
366
367?>
368
369
370
371<?php
372
373// Exit if accessed directly
374
375if (! defined('DUPLICATOR_INIT')) {
376
377 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
378
379 $_baseURL = "http://" . $_baseURL;
380
381 header("HTTP/1.1 301 Moved Permanently");
382
383 header("Location: $_baseURL");
384
385 exit;
386
387}
388
389
390
391define('ERR_CONFIG_FOUND', 'A wp-config.php already exists in this location. This error prevents users from accidentally overwriting the wrong directories contents. You have two options: <ul><li>Empty this root directory except for the package and installer and try again.</li><li>Delete just the wp-config.php file and try again. This will over-write all other files in the directory.</li></ul>');
392
393define('ERR_ZIPNOTFOUND', 'The packaged zip file was not found. Be sure the zip package is in the same directory as the installer file. If you are trying to reinstall a package you can copy the package from the "' . DUPLICATOR_SSDIR_NAME . '" directory back up to your root which is the same location as your installer.php file.');
394
395define('ERR_ZIPOPEN', 'Failed to open zip archive file. Please be sure the archive is completely downloaded before running the installer. Try to extract the archive manually to make sure the file is not corrupted.');
396
397define('ERR_ZIPEXTRACTION', 'Errors extracting zip file. Portions or part of the zip archive did not extract correctly. Try to extract the archive manually with a client side program like unzip/win-zip/winrar to make sure the file is not corrupted. If the file extracts correctly then there is an invalid file or directory that PHP is unable to extract. This can happen if your moving from one operating system to another where certain naming conventions work on one environment and not another. <br/><br/> Workarounds: <br/> 1. Create a new package and be sure to exclude any directories that have invalid names or files in them. This warning will be displayed on the scan results under "Invalid Names". <br/> 2. Manually extract the zip file with a client side program. Then under advanced options in step 1 of the installer check the "Manual package extraction" option and perform the install.');
398
399define('ERR_ZIPMANUAL', 'When choosing manual package extraction, the contents of the package must already be extracted and the wp-config.php and database.sql files must be present in the same directory as the installer.php for the process to continue. Please manually extract the package into the current directory before continuing in manual extraction mode. Also validate that the wp-config.php and database.sql files are present.');
400
401define('ERR_MAKELOG', 'PHP is having issues writing to the log file <b>' . DupUtil::set_safe_path($GLOBALS['CURRENT_ROOT_PATH']) . '\installer-log.txt .</b> In order for the Duplicator to proceed validate your owner/group and permission settings for PHP on this path. Try temporarily setting you permissions to 777 to see if the issue gets resolved. If you are on a shared hosting environment please contact your hosting company and tell them you are getting errors writing files to the path above when using PHP.');
402
403define('ERR_ZIPARCHIVE', 'In order to extract the archive.zip file the PHP ZipArchive module must be installed. Please read the FAQ for more details. You can still install this package but you will need to check the Manual package extraction checkbox found in the Advanced Options. Please read the online user guide for details in performing a manual package extraction.');
404
405define('ERR_MYSQLI_SUPPORT', 'In order to complete an install the mysqli extension for PHP is required. If you are on a hosted server please contact your host and request that mysqli be enabled. For more information visit: http://php.net/manual/en/mysqli.installation.php');
406
407define('ERR_DBCONNECT', 'DATABASE CONNECTION FAILED!<br/>');
408
409define('ERR_DBCONNECT_CREATE', 'DATABASE CREATION FAILURE!<br/> Unable to create database "%s". Check to make sure the user has "Create" privileges. Some hosts will restrict creation of a database only through the cpanel. Try creating the database manually to proceed with installation. If the database already exists then check the radio button labeled "Connect and Remove All Data" which will remove all existing tables.');
410
411define('ERR_DBTRYCLEAN', 'DATABASE CREATION FAILURE!<br/> Unable to remove all tables from database "%s".<br/> Please remove all tables from this database and try the installation again.');
412
413define('ERR_DBCREATE', 'The database "%s" does not exists.<br/> Change mode to create in order to create a new database.');
414
415define('ERR_DBEMPTY', 'The database "%s" has "%s" tables. The Duplicator only works with an EMPTY database. Enable the action "Connect and Remove All Data" radio button to remove all tables and or create a new database. Some hosting providers do not allow table removal from scripts. In this case you will need to login to your hosting providers control panel and remove the tables manually. Please contact your hosting provider for further details. Always backup all your data before proceeding!');
416
417
418
419/** * *****************************************************
420
421 * DUPX_Log
422
423 * Class used to log information */
424
425
426
427class DUPX_Log {
428
429
430
431 /** METHOD: LOG
432
433 * Used to write debug info to the text log file
434
435 * @param string $msg Any text data
436
437 * @param int $loglevel Log level
438
439 */
440
441 static public function Info($msg, $logging = 1) {
442
443 if ($logging <= $GLOBALS["LOGGING"]) {
444
445 @fwrite($GLOBALS["LOG_FILE_HANDLE"], "{$msg}\n");
446
447 }
448
449 }
450
451
452
453 static public function Error($errorMessage) {
454
455 if ($logging <= $GLOBALS["LOGGING"]) {
456
457 $breaks = array("<br />","<br>","<br/>");
458
459 $msg = str_ireplace($breaks, "\r\n", $errorMessage);
460
461 @fwrite($GLOBALS["LOG_FILE_HANDLE"], "\nINSTALLER ERROR:\n{$msg}\n");
462
463 @fclose($GLOBALS["LOG_FILE_HANDLE"]);
464
465 }
466
467 die("<div class='dup-ui-error'><b style='color:#B80000;'>INSTALL ERROR!</b><br/>{$errorMessage}</div><br/>");
468
469 }
470
471}
472
473?>
474
475
476
477
478
479<?php
480
481// Exit if accessed directly
482
483if (! defined('DUPLICATOR_INIT')) {
484
485 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
486
487 $_baseURL = "http://" . $_baseURL;
488
489 header("HTTP/1.1 301 Moved Permanently");
490
491 header("Location: $_baseURL");
492
493 exit;
494
495}
496
497
498
499/** * *****************************************************
500
501 * CLASS::DupUtil
502
503 * Various Static Utility methods for working with the installer */
504
505class DupUtil {
506
507
508
509
510
511
512
513 /** METHOD: GET_MICROTIME
514
515 * Get current microtime as a float. Can be used for simple profiling.
516
517 */
518
519 static public function get_microtime() {
520
521 return microtime(true);
522
523 }
524
525
526
527 /** METHOD: ELAPSED_TIME
528
529 * Return a string with the elapsed time.
530
531 * Order of $end and $start can be switched.
532
533 */
534
535 static public function elapsed_time($end, $start) {
536
537 return sprintf("%.4f sec.", abs($end - $start));
538
539 }
540
541
542
543 /** METHOD: ESC_HTML_ATTR
544
545 * @param string $string Thing that needs escaping
546
547 * @param bool $echo Do we echo or return?
548
549 * @return string Escaped string.
550
551 */
552
553 static public function esc_html_attr($string = '', $echo = false) {
554
555 $output = htmlentities($string, ENT_QUOTES, 'UTF-8');
556
557 if ($echo)
558
559 echo $output;
560
561 else
562
563 return $output;
564
565 }
566
567
568
569 /** METHOD: TABLE_COUNT
570
571 * Count the tables in a given database
572
573 * @param string $_POST['dbname'] Database to count tables in
574
575 */
576
577 static public function dbtable_count($conn, $dbname) {
578
579 $res = mysqli_query($conn, "SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = '{$dbname}' ");
580
581 $row = mysqli_fetch_row($res);
582
583 return is_null($row) ? 0 : $row[0];
584
585 }
586
587
588
589 /** METHOD: TABLE_ROW_COUNT
590
591 * Returns the table count
592
593 * @param string $conn A valid link resource
594
595 * @param string $table_name A valid table name
596
597 */
598
599 static public function table_row_count($conn, $table_name) {
600
601 $total = mysqli_query($conn, "SELECT COUNT(*) FROM `$table_name`");
602
603 if ($total) {
604
605 $total = @mysqli_fetch_array($total);
606
607 return $total[0];
608
609 } else {
610
611 return 0;
612
613 }
614
615 }
616
617
618
619 /** METHOD: ADD_ENDING_SLASH
620
621 * Adds a slash to the end of a path
622
623 * @param string $path A path
624
625 */
626
627 static public function add_slash($path) {
628
629 $last_char = substr($path, strlen($path) - 1, 1);
630
631 if ($last_char != '/') {
632
633 $path .= '/';
634
635 }
636
637 return $path;
638
639 }
640
641
642
643 /** METHOD: SET_SAFE_PATH
644
645 * Makes path safe for any OS
646
647 * Paths should ALWAYS READ be "/"
648
649 * uni: /home/path/file.xt
650
651 * win: D:/home/path/file.txt
652
653 * @param string $path The path to make safe
654
655 */
656
657 static public function set_safe_path($path) {
658
659 return str_replace("\\", "/", $path);
660
661 }
662
663
664
665 static public function unset_safe_path($path) {
666
667 return str_replace("/", "\\", $path);
668
669 }
670
671
672
673 /** METHOD: FCGI_FLUSH
674
675 * PHP_SAPI for fcgi requires a data flush of at least 256
676
677 * bytes every 40 seconds or else it forces a script hault
678
679 */
680
681 static public function fcgi_flush() {
682
683 echo(str_repeat(' ', 256));
684
685 @flush();
686
687 }
688
689
690
691 /** METHOD: COPY_FILE
692
693 * A safe method used to copy larger files
694
695 * @param string $source The path to the file being copied
696
697 * @param string $destination The path to the file being made
698
699 */
700
701 static public function copy_file($source, $destination) {
702
703 $sp = fopen($source, 'r');
704
705 $op = fopen($destination, 'w');
706
707
708
709 while (!feof($sp)) {
710
711 $buffer = fread($sp, 512); // use a buffer of 512 bytes
712
713 fwrite($op, $buffer);
714
715 }
716
717 // close handles
718
719 fclose($op);
720
721 fclose($sp);
722
723 }
724
725
726
727 /** METHOD: string_has_value
728
729 * Finds a string in a file and returns true if found
730
731 * @param array $list A list of strings to search for
732
733 * @param string $haystack The string to search in
734
735 */
736
737 static public function string_has_value($list, $file) {
738
739 foreach ($list as $var) {
740
741 if (strstr($file, $var) !== false) {
742
743 return true;
744
745 }
746
747 }
748
749 return false;
750
751 }
752
753
754
755 /** METHOD: get_active_plugins
756
757 * Returns the active plugins for a package
758
759 * @param conn $dbh A database connection handle
760
761 * @return array $list A list of active plugins
762
763 */
764
765 static public function get_active_plugins($dbh) {
766
767 $query = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name = 'active_plugins' ");
768
769 if ($query) {
770
771 $row = @mysqli_fetch_array($query);
772
773 $all_plugins = unserialize($row[0]);
774
775 if (is_array($all_plugins)) {
776
777 return $all_plugins;
778
779 }
780
781 }
782
783 return array();
784
785 }
786
787
788
789 /** METHOD: get_database_tables
790
791 * Returns the tables for a database
792
793 * @param conn $dbh A database connection handle
794
795 * @return array $list A list of all table names
796
797 */
798
799 static public function get_database_tables($dbh) {
800
801 $query = @mysqli_query($dbh, 'SHOW TABLES');
802
803 if ($query) {
804
805 while ($table = @mysqli_fetch_array($query)) {
806
807 $all_tables[] = $table[0];
808
809 }
810
811 if (is_array($all_tables)) {
812
813 return $all_tables;
814
815 }
816
817 }
818
819 return array();
820
821 }
822
823
824
825 /**
826
827 * MySQL connection support for sock
828
829 * @param same as mysqli_connect
830
831 * @return database connection handle
832
833 */
834
835 static public function db_connect( $host, $username, $password, $dbname = '', $port = null ) {
836
837
838
839 //sock connections
840
841 if ( 'sock' === substr( $host, -4 ) )
842
843 {
844
845 $url_parts = parse_url( $host );
846
847 $dbh = @mysqli_connect( 'localhost', $username, $password, $dbname, null, $url_parts['path'] );
848
849 }
850
851 else
852
853 {
854
855 $dbh = @mysqli_connect( $host, $username, $password, $dbname, $port );
856
857 }
858
859 return $dbh;
860
861 }
862
863
864
865
866
867 /**
868
869 * MySQL database version number
870
871 * @param conn $dbh Database connection handle
872
873 * @return false|string false on failure, version number on success
874
875 */
876
877 static public function mysql_version($dbh) {
878
879 if (function_exists('mysqli_get_server_info')) {
880
881 return preg_replace('/[^0-9.].*/', '', mysqli_get_server_info($dbh));
882
883 } else {
884
885 return 0;
886
887 }
888
889 }
890
891
892
893 /**
894
895 * MySQL server variable
896
897 * @param conn $dbh Database connection handle
898
899 * @return string the server variable to query for
900
901 */
902
903 static public function mysql_variable_value($dbh, $variable) {
904
905 $result = @mysqli_query($dbh, "SHOW VARIABLES LIKE '{$variable}'");
906
907 $row = @mysqli_fetch_array($result);
908
909 @mysqli_free_result($result);
910
911 return isset($row[1]) ? $row[1] : null;
912
913 }
914
915
916
917 /**
918
919 * Determine if a MySQL database supports a particular feature
920
921 * @param conn $dbh Database connection handle
922
923 * @param string $feature the feature to check for
924
925 * @return bool
926
927 */
928
929 static public function mysql_has_ability($dbh, $feature) {
930
931 $version = self::mysql_version($dbh);
932
933
934
935 switch (strtolower($feature)) {
936
937 case 'collation' :
938
939 case 'group_concat' :
940
941 case 'subqueries' :
942
943 return version_compare($version, '4.1', '>=');
944
945 case 'set_charset' :
946
947 return version_compare($version, '5.0.7', '>=');
948
949 };
950
951 return false;
952
953 }
954
955
956
957 /**
958
959 * Sets the MySQL connection's character set.
960
961 * @param resource $dbh The resource given by mysqli_connect
962
963 * @param string $charset The character set (optional)
964
965 * @param string $collate The collation (optional)
966
967 */
968
969 static public function mysql_set_charset($dbh, $charset = null, $collate = null) {
970
971
972
973 $charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset;
974
975 $collate = (!isset($collate) ) ? $GLOBALS['DBCOLLATE_DEFAULT'] : $collate;
976
977
978
979 if (self::mysql_has_ability($dbh, 'collation') && !empty($charset)) {
980
981 if (function_exists('mysqli_set_charset') && self::mysql_has_ability($dbh, 'set_charset')) {
982
983 return mysqli_set_charset($dbh, $charset);
984
985 } else {
986
987 $sql = " SET NAMES {$charset}";
988
989 if (!empty($collate))
990
991 $sql .= " COLLATE {$collate}";
992
993 return mysqli_query($dbh, $sql);
994
995 }
996
997 }
998
999 }
1000
1001
1002
1003 /**
1004
1005 * READABLE_BYTESIZE
1006
1007 * Display human readable byte sizes
1008
1009 * @param string $size The size in bytes
1010
1011 */
1012
1013 static public function readable_bytesize($size) {
1014
1015 try {
1016
1017 $units = array('B', 'KB', 'MB', 'GB', 'TB');
1018
1019 for ($i = 0; $size >= 1024 && $i < 4; $i++)
1020
1021 $size /= 1024;
1022
1023 return round($size, 2) . $units[$i];
1024
1025 } catch (Exception $e) {
1026
1027 return "n/a";
1028
1029 }
1030
1031 }
1032
1033
1034
1035 /**
1036
1037 * PREG_REPLACEMENT_QUOTE
1038
1039 * The characters that are special in the replacement value of preg_replace are not the
1040
1041 * same characters that are special in the pattern
1042
1043 * @param string $str The string to replace on
1044
1045 */
1046
1047 static public function preg_replacement_quote($str) {
1048
1049 return preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', $str);
1050
1051 }
1052
1053
1054
1055
1056
1057 /**
1058
1059 * IS_WEB_CONNECTED
1060
1061 * Check to see if the internet is accessable
1062
1063 * @param string $url A url e.g without prefix "ajax.googleapis.com"
1064
1065 * @param string $port A valid port number
1066
1067 * @return bool
1068
1069 */
1070
1071 static public function is_url_active($url, $port) {
1072
1073 if (function_exists('fsockopen')) {
1074
1075 $port = isset($port) && is_integer($port) ? $port : 80;
1076
1077 $connected = @fsockopen($url, $port); //website and port
1078
1079 if ($connected){
1080
1081 $is_conn = true;
1082
1083 @fclose($connected);
1084
1085 } else {
1086
1087 $is_conn = false;
1088
1089 }
1090
1091 return $is_conn;
1092
1093 } else {
1094
1095 return false;
1096
1097 }
1098
1099 }
1100
1101
1102
1103
1104
1105}
1106
1107?>
1108
1109
1110
1111<?php
1112
1113// Exit if accessed directly
1114
1115if (! defined('DUPLICATOR_INIT')) {
1116
1117 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
1118
1119 $_baseURL = "http://" . $_baseURL;
1120
1121 header("HTTP/1.1 301 Moved Permanently");
1122
1123 header("Location: $_baseURL");
1124
1125 exit;
1126
1127}
1128
1129
1130
1131/** * *****************************************************
1132
1133 * DUPX_Config
1134
1135 * Class used to update and edit web server configuration files */
1136
1137
1138
1139class DUPX_Config {
1140
1141
1142
1143
1144
1145 /**
1146
1147 * Clear .htaccess and web.config files and backup
1148
1149 */
1150
1151 static public function Reset() {
1152
1153
1154
1155 DUPX_Log::Info("\nWEB SERVER CONFIGURATION FILE RESET:");
1156
1157
1158
1159 //Apache
1160
1161 @copy('.htaccess', '.htaccess.orig');
1162
1163 @unlink('.htaccess');
1164
1165 //IIS
1166
1167 @copy('web.config', 'web.config.orig');
1168
1169 @unlink('web.config');
1170
1171
1172
1173 DUPX_Log::Info("- Backup of .htaccess/web.config made to .orig");
1174
1175 DUPX_Log::Info("- Reset of .htaccess/web.config files");
1176
1177 $tmp_htaccess = '# RESET FOR DUPLICATOR INSTALLER USEAGE';
1178
1179 file_put_contents('.htaccess', $tmp_htaccess);
1180
1181 @chmod('.htaccess', 0644);
1182
1183 }
1184
1185
1186
1187
1188
1189 /** METHOD: ResetHTACCESS
1190
1191 * Resetst the .htaccess file
1192
1193 */
1194
1195 static public function Setup() {
1196
1197
1198
1199 if (! isset($_POST['url_new'])) {
1200
1201 return;
1202
1203 }
1204
1205
1206
1207 DUPX_Log::Info("\nWEB SERVER CONFIGURATION FILE BASIC SETUP:");
1208
1209 $currdata = parse_url($_POST['url_old']);
1210
1211 $newdata = parse_url($_POST['url_new']);
1212
1213 $currpath = DupUtil::add_slash(isset($currdata['path']) ? $currdata['path'] : "");
1214
1215 $newpath = DupUtil::add_slash(isset($newdata['path']) ? $newdata['path'] : "");
1216
1217
1218
1219 $tmp_htaccess = <<<HTACCESS
1220
1221# BEGIN WordPress
1222
1223<IfModule mod_rewrite.c>
1224
1225RewriteEngine On
1226
1227RewriteBase {$newpath}
1228
1229RewriteRule ^index\.php$ - [L]
1230
1231RewriteCond %{REQUEST_FILENAME} !-f
1232
1233RewriteCond %{REQUEST_FILENAME} !-d
1234
1235RewriteRule . {$newpath}index.php [L]
1236
1237</IfModule>
1238
1239# END WordPress
1240
1241HTACCESS;
1242
1243
1244
1245 file_put_contents('.htaccess', $tmp_htaccess);
1246
1247 @chmod('.htaccess', 0644);
1248
1249 DUPX_Log::Info("created basic .htaccess file. If using IIS web.config this process will need to be done manually.");
1250
1251
1252
1253 }
1254
1255
1256
1257
1258
1259}
1260
1261?>
1262
1263
1264
1265
1266
1267<?php
1268
1269// Exit if accessed directly
1270
1271if (! defined('DUPLICATOR_INIT')) {
1272
1273 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
1274
1275 $_baseURL = "http://" . $_baseURL;
1276
1277 header("HTTP/1.1 301 Moved Permanently");
1278
1279 header("Location: $_baseURL");
1280
1281 exit;
1282
1283}
1284
1285
1286
1287/** * *****************************************************
1288
1289 * CLASS::DUPDBTEXTSWAP
1290
1291 * Walks every table in db that then walks every row and column replacing searches with replaces
1292
1293 * large tables are split into 50k row blocks to save on memory. */
1294
1295class DUPX_Serializer {
1296
1297
1298
1299 /**
1300
1301 * LOG ERRORS
1302
1303 */
1304
1305 static public function log_errors($report) {
1306
1307 if (!empty($report['errsql'])) {
1308
1309 DUPX_Log::Info("====================================");
1310
1311 DUPX_Log::Info("DATA-REPLACE ERRORS (MySQL)");
1312
1313 foreach ($report['errsql'] as $error) {
1314
1315 DUPX_Log::Info($error);
1316
1317 }
1318
1319 DUPX_Log::Info("");
1320
1321 }
1322
1323 if (!empty($report['errser'])) {
1324
1325 DUPX_Log::Info("====================================");
1326
1327 DUPX_Log::Info("DATA-REPLACE ERRORS (Serialization):");
1328
1329 foreach ($report['errser'] as $error) {
1330
1331 DUPX_Log::Info($error);
1332
1333 }
1334
1335 DUPX_Log::Info("");
1336
1337 }
1338
1339 if (!empty($report['errkey'])) {
1340
1341 DUPX_Log::Info("====================================");
1342
1343 DUPX_Log::Info("DATA-REPLACE ERRORS (Key):");
1344
1345 DUPX_Log::Info('Use SQL: SELECT @row := @row + 1 as row, t.* FROM some_table t, (SELECT @row := 0) r');
1346
1347 foreach ($report['errkey'] as $error) {
1348
1349 DUPX_Log::Info($error);
1350
1351 }
1352
1353 }
1354
1355 }
1356
1357
1358
1359 /**
1360
1361 * LOG STATS
1362
1363 */
1364
1365 static public function log_stats($report) {
1366
1367 if (!empty($report) && is_array($report)) {
1368
1369 $stats = "--------------------------------------\n";
1370
1371 $stats .= sprintf("SEARCH1:\t'%s' \nREPLACE1:\t'%s' \n", $_POST['url_old'], $_POST['url_new']);
1372
1373 $stats .= sprintf("SEARCH2:\t'%s' \nREPLACE2:\t'%s' \n", $_POST['path_old'], $_POST['path_new']);
1374
1375 $stats .= sprintf("SCANNED:\tTables:%d | Rows:%d | Cells:%d \n", $report['scan_tables'], $report['scan_rows'], $report['scan_cells']);
1376
1377 $stats .= sprintf("UPDATED:\tTables:%d | Rows:%d |Cells:%d \n", $report['updt_tables'], $report['updt_rows'], $report['updt_cells']);
1378
1379 $stats .= sprintf("ERRORS:\t\t%d \nRUNTIME:\t%f sec", $report['err_all'], $report['time']);
1380
1381 DUPX_Log::Info($stats);
1382
1383 }
1384
1385 }
1386
1387
1388
1389 /**
1390
1391 * Returns only the text type columns of a table ignoring all numeric types
1392
1393 */
1394
1395 static public function getTextColumns($conn, $table) {
1396
1397
1398
1399 $type_where = "type NOT LIKE 'tinyint%' AND ";
1400
1401 $type_where .= "type NOT LIKE 'smallint%' AND ";
1402
1403 $type_where .= "type NOT LIKE 'mediumint%' AND ";
1404
1405 $type_where .= "type NOT LIKE 'int%' AND ";
1406
1407 $type_where .= "type NOT LIKE 'bigint%' AND ";
1408
1409 $type_where .= "type NOT LIKE 'float%' AND ";
1410
1411 $type_where .= "type NOT LIKE 'double%' AND ";
1412
1413 $type_where .= "type NOT LIKE 'decimal%' AND ";
1414
1415 $type_where .= "type NOT LIKE 'numeric%' AND ";
1416
1417 $type_where .= "type NOT LIKE 'date%' AND ";
1418
1419 $type_where .= "type NOT LIKE 'time%' AND ";
1420
1421 $type_where .= "type NOT LIKE 'year%' ";
1422
1423
1424
1425 $result = mysqli_query($conn, "SHOW COLUMNS FROM `{$table}` WHERE {$type_where}");
1426
1427 if (!$result) {
1428
1429 return null;
1430
1431 }
1432
1433 $fields = array();
1434
1435 if (mysqli_num_rows($result) > 0) {
1436
1437 while ($row = mysqli_fetch_assoc($result)) {
1438
1439 $fields[] = $row['Field'];
1440
1441 }
1442
1443 }
1444
1445
1446
1447 //Return Primary which is needed for index lookup
1448
1449 $result = mysqli_query($conn, "SHOW INDEX FROM `{$table}` WHERE KEY_NAME LIKE '%PRIMARY%'");
1450
1451 if (mysqli_num_rows($result) > 0) {
1452
1453 while ($row = mysqli_fetch_assoc($result)) {
1454
1455 $fields[] = $row['Column_name'];
1456
1457 }
1458
1459 }
1460
1461
1462
1463 return (count($fields) > 0) ? $fields : null;
1464
1465 }
1466
1467
1468
1469 /**
1470
1471 * LOAD
1472
1473 * Begins the processing for replace logic
1474
1475 * @param mysql $conn The db connection object
1476
1477 * @param array $list Key value pair of 'search' and 'replace' arrays
1478
1479 * @param array $tables The tables we want to look at.
1480
1481 * @return array Collection of information gathered during the run.
1482
1483 */
1484
1485 static public function load($conn, $list = array(), $tables = array(), $cols = array(), $fullsearch = false) {
1486
1487 $exclude_cols = $cols;
1488
1489
1490
1491 $report = array('scan_tables' => 0, 'scan_rows' => 0, 'scan_cells' => 0,
1492
1493 'updt_tables' => 0, 'updt_rows' => 0, 'updt_cells' => 0,
1494
1495 'errsql' => array(), 'errser' => array(), 'errkey' => array(),
1496
1497 'errsql_sum' => 0, 'errser_sum' => 0, 'errkey_sum' => 0,
1498
1499 'time' => '', 'err_all' => 0);
1500
1501
1502
1503 $walk_function = create_function('&$str', '$str = "`$str`";');
1504
1505
1506
1507 $profile_start = DupUtil::get_microtime();
1508
1509 if (is_array($tables) && !empty($tables)) {
1510
1511
1512
1513 foreach ($tables as $table) {
1514
1515 $report['scan_tables']++;
1516
1517 $columns = array();
1518
1519
1520
1521 // Get a list of columns in this table
1522
1523 $fields = mysqli_query($conn, 'DESCRIBE ' . $table);
1524
1525 while ($column = mysqli_fetch_array($fields)) {
1526
1527 $columns[$column['Field']] = $column['Key'] == 'PRI' ? true : false;
1528
1529 }
1530
1531
1532
1533 // Count the number of rows we have in the table if large we'll split into blocks
1534
1535 $row_count = mysqli_query($conn, "SELECT COUNT(*) FROM `{$table}`");
1536
1537 $rows_result = mysqli_fetch_array($row_count);
1538
1539 @mysqli_free_result($row_count);
1540
1541 $row_count = $rows_result[0];
1542
1543 if ($row_count == 0) {
1544
1545 DUPX_Log::Info("{$table}^ ({$row_count})");
1546
1547 continue;
1548
1549 }
1550
1551
1552
1553 $page_size = 25000;
1554
1555 $offset = ($page_size + 1);
1556
1557 $pages = ceil($row_count / $page_size);
1558
1559
1560
1561 // Grab the columns of the table. Only grab text based columns because
1562
1563 // they are the only data types that should allow any type of search/replace logic
1564
1565 $colList = '*';
1566
1567 $colMsg = '*';
1568
1569 if (! $fullsearch) {
1570
1571 $colList = self::getTextColumns($conn, $table);
1572
1573 if ($colList != null && is_array($colList)) {
1574
1575 array_walk($colList, $walk_function);
1576
1577 $colList = implode(',', $colList);
1578
1579 }
1580
1581 $colMsg = (empty($colList)) ? '*' : '~';
1582
1583 }
1584
1585
1586
1587 if (empty($colList)) {
1588
1589 DUPX_Log::Info("{$table}^ ({$row_count})");
1590
1591 continue;
1592
1593 } else {
1594
1595 DUPX_Log::Info("{$table}{$colMsg} ({$row_count})");
1596
1597 }
1598
1599
1600
1601 //Paged Records
1602
1603 for ($page = 0; $page < $pages; $page++) {
1604
1605
1606
1607 $current_row = 0;
1608
1609 $start = $page * $page_size;
1610
1611 $end = $start + $page_size;
1612
1613 $sql = sprintf("SELECT {$colList} FROM `%s` LIMIT %d, %d", $table, $start, $offset);
1614
1615 $data = mysqli_query($conn, $sql);
1616
1617
1618
1619 if (!$data)
1620
1621 $report['errsql'][] = mysqli_error($conn);
1622
1623
1624
1625 $scan_count = ($row_count < $end) ? $row_count : $end;
1626
1627 DUPX_Log::Info("\tScan => {$start} of {$scan_count}", 2);
1628
1629 //DEBUG ONLY:
1630
1631 //DUPX_Log::Info("\t{$sql}", 3);
1632
1633
1634
1635 //Loops every row
1636
1637 while ($row = mysqli_fetch_array($data)) {
1638
1639 $report['scan_rows']++;
1640
1641 $current_row++;
1642
1643 $upd_col = array();
1644
1645 $upd_sql = array();
1646
1647 $where_sql = array();
1648
1649 $upd = false;
1650
1651 $serial_err = 0;
1652
1653
1654
1655 //Loops every cell
1656
1657 foreach ($columns as $column => $primary_key) {
1658
1659 if (in_array($column, $exclude_cols)) {
1660
1661 continue;
1662
1663 }
1664
1665
1666
1667 $report['scan_cells']++;
1668
1669 $edited_data = $data_to_fix = $row[$column];
1670
1671 $base64coverted = false;
1672
1673
1674
1675 //Only replacing string values
1676
1677 if (!empty($row[$column]) && !is_numeric($row[$column])) {
1678
1679
1680
1681 //Base 64 detection
1682
1683 if (base64_decode($row[$column], true)) {
1684
1685 $decoded = base64_decode($row[$column], true);
1686
1687 if (self::is_serialized($decoded)) {
1688
1689 $edited_data = $decoded;
1690
1691 $base64coverted = true;
1692
1693 }
1694
1695 }
1696
1697
1698
1699 //Replace logic - level 1: simple check on basic serilized strings
1700
1701 foreach ($list as $item) {
1702
1703 $edited_data = self::recursive_unserialize_replace($item['search'], $item['replace'], $edited_data);
1704
1705 }
1706
1707
1708
1709 //Replace logic - level 2: repair larger/complex serilized strings
1710
1711 $serial_check = self::fix_serial_string($edited_data);
1712
1713 if ($serial_check['fixed']) {
1714
1715 $edited_data = $serial_check['data'];
1716
1717 } elseif ($serial_check['tried'] && !$serial_check['fixed']) {
1718
1719 $serial_err++;
1720
1721 }
1722
1723 }
1724
1725
1726
1727 //Change was made
1728
1729 if ($edited_data != $data_to_fix || $serial_err > 0) {
1730
1731 $report['updt_cells']++;
1732
1733 //Base 64 encode
1734
1735 if ($base64coverted) {
1736
1737 $edited_data = base64_encode($edited_data);
1738
1739 }
1740
1741 $upd_col[] = $column;
1742
1743 $upd_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $edited_data) . '"';
1744
1745 $upd = true;
1746
1747 }
1748
1749
1750
1751 if ($primary_key) {
1752
1753 $where_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $data_to_fix) . '"';
1754
1755 }
1756
1757 }
1758
1759
1760
1761 //PERFORM ROW UPDATE
1762
1763 if ($upd && !empty($where_sql)) {
1764
1765 $sql = "UPDATE `{$table}` SET " . implode(', ', $upd_sql) . ' WHERE ' . implode(' AND ', array_filter($where_sql));
1766
1767 $result = mysqli_query($conn, $sql) or $report['errsql'][] = mysqli_error($conn);
1768
1769 //DEBUG ONLY:
1770
1771 DUPX_Log::Info("\t{$sql}", 3);
1772
1773 if ($result) {
1774
1775 if ($serial_err > 0) {
1776
1777 $report['errser'][] = "SELECT " . implode(', ', $upd_col) . " FROM `{$table}` WHERE " . implode(' AND ', array_filter($where_sql)) . ';';
1778
1779 }
1780
1781 $report['updt_rows']++;
1782
1783 }
1784
1785 } elseif ($upd) {
1786
1787 $report['errkey'][] = sprintf("Row [%s] on Table [%s] requires a manual update.", $current_row, $table);
1788
1789 }
1790
1791 }
1792
1793 DupUtil::fcgi_flush();
1794
1795 @mysqli_free_result($data);
1796
1797 }
1798
1799
1800
1801 if ($upd) {
1802
1803 $report['updt_tables']++;
1804
1805 }
1806
1807 }
1808
1809 }
1810
1811 $profile_end = DupUtil::get_microtime();
1812
1813 $report['time'] = DupUtil::elapsed_time($profile_end, $profile_start);
1814
1815 $report['errsql_sum'] = empty($report['errsql']) ? 0 : count($report['errsql']);
1816
1817 $report['errser_sum'] = empty($report['errser']) ? 0 : count($report['errser']);
1818
1819 $report['errkey_sum'] = empty($report['errkey']) ? 0 : count($report['errkey']);
1820
1821 $report['err_all'] = $report['errsql_sum'] + $report['errser_sum'] + $report['errkey_sum'];
1822
1823 return $report;
1824
1825 }
1826
1827
1828
1829 /**
1830
1831 * Take a serialised array and unserialise it replacing elements and
1832
1833 * unserialising any subordinate arrays and performing the replace.
1834
1835 * @param string $from String we're looking to replace.
1836
1837 * @param string $to What we want it to be replaced with
1838
1839 * @param array $data Used to pass any subordinate arrays back to in.
1840
1841 * @param bool $serialised Does the array passed via $data need serialising.
1842
1843 * @return array The original array with all elements replaced as needed.
1844
1845 */
1846
1847 static private function recursive_unserialize_replace($from = '', $to = '', $data = '', $serialised = false) {
1848
1849
1850
1851 // some unseriliased data cannot be re-serialised eg. SimpleXMLElements
1852
1853 try {
1854
1855
1856
1857 if (is_string($data) && ($unserialized = @unserialize($data)) !== false) {
1858
1859 $data = self::recursive_unserialize_replace($from, $to, $unserialized, true);
1860
1861 } elseif (is_array($data)) {
1862
1863 $_tmp = array();
1864
1865 foreach ($data as $key => $value) {
1866
1867 $_tmp[$key] = self::recursive_unserialize_replace($from, $to, $value, false);
1868
1869 }
1870
1871 $data = $_tmp;
1872
1873 unset($_tmp);
1874
1875 } elseif (is_object($data)) {
1876
1877 $dataClass = get_class($data);
1878
1879 $_tmp = new $dataClass();
1880
1881 foreach ($data as $key => $value) {
1882
1883 $_tmp->$key = self::recursive_unserialize_replace($from, $to, $value, false);
1884
1885 }
1886
1887 $data = $_tmp;
1888
1889 unset($_tmp);
1890
1891 } else {
1892
1893 if (is_string($data)) {
1894
1895 $data = str_replace($from, $to, $data);
1896
1897 }
1898
1899 }
1900
1901
1902
1903 if ($serialised)
1904
1905 return serialize($data);
1906
1907 } catch (Exception $error) {
1908
1909 DUPX_Log::Info("\nRECURSIVE UNSERIALIZE ERROR: With string\n" . $error, 2);
1910
1911 }
1912
1913 return $data;
1914
1915 }
1916
1917
1918
1919 /**
1920
1921 * IS_SERIALIZED
1922
1923 * Test if a string in properly serialized */
1924
1925 static public function is_serialized($data) {
1926
1927 $test = @unserialize(($data));
1928
1929 return ($test !== false || $test === 'b:0;') ? true : false;
1930
1931 }
1932
1933
1934
1935 /**
1936
1937 * FIX_STRING
1938
1939 * Fixes the string length of a string object that has been serialized but the length is broken
1940
1941 * @param string $data The string ojbect to recalculate the size on.
1942
1943 * @return
1944
1945 */
1946
1947 static private function fix_serial_string($data) {
1948
1949
1950
1951 $result = array('data' => $data, 'fixed' => false, 'tried' => false);
1952
1953
1954
1955 if (preg_match("/s:[0-9]+:/", $data)) {
1956
1957 if (!self::is_serialized($data)) {
1958
1959 $regex = '!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|d:|i:|o:|N;))!s';
1960
1961 $serial_string = preg_match('/^s:[0-9]+:"(.*$)/s', trim($data), $matches);
1962
1963 //Nested serial string
1964
1965 if ($serial_string) {
1966
1967 $inner = preg_replace_callback($regex, 'DupDBTextSwap::fix_string_callback', rtrim($matches[1], '";'));
1968
1969 $serialized_fixed = 's:' . strlen($inner) . ':"' . $inner . '";';
1970
1971 } else {
1972
1973 $serialized_fixed = preg_replace_callback($regex, 'DupDBTextSwap::fix_string_callback', $data);
1974
1975 }
1976
1977
1978
1979 if (self::is_serialized($serialized_fixed)) {
1980
1981 $result['data'] = $serialized_fixed;
1982
1983 $result['fixed'] = true;
1984
1985 }
1986
1987 $result['tried'] = true;
1988
1989 }
1990
1991 }
1992
1993 return $result;
1994
1995 }
1996
1997
1998
1999 static private function fix_string_callback($matches) {
2000
2001 return 's:' . strlen(($matches[2]));
2002
2003 }
2004
2005
2006
2007}
2008
2009?>
2010
2011
2012
2013<?php
2014
2015if (isset($_POST['action_ajax'])) {
2016
2017 switch ($_POST['action_ajax']) {
2018
2019 case "1" :
2020
2021 ?> <?php
2022
2023// Exit if accessed directly
2024
2025if (! defined('DUPLICATOR_INIT')) {
2026
2027 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
2028
2029 $_baseURL = "http://" . $_baseURL;
2030
2031 header("HTTP/1.1 301 Moved Permanently");
2032
2033 header("Location: $_baseURL");
2034
2035 exit;
2036
2037}
2038
2039
2040
2041//POST PARAMS
2042
2043$_POST['dbaction'] = isset($_POST['dbaction']) ? $_POST['dbaction'] : 'create';
2044
2045$_POST['dbnbsp'] = (isset($_POST['dbnbsp']) && $_POST['dbnbsp'] == '1') ? true : false;
2046
2047$_POST['ssl_admin'] = (isset($_POST['ssl_admin'])) ? true : false;
2048
2049$_POST['ssl_login'] = (isset($_POST['ssl_login'])) ? true : false;
2050
2051$_POST['cache_wp'] = (isset($_POST['cache_wp'])) ? true : false;
2052
2053$_POST['cache_path'] = (isset($_POST['cache_path'])) ? true : false;
2054
2055$_POST['package_name'] = isset($_POST['package_name']) ? $_POST['package_name'] : null;
2056
2057$_POST['zip_manual'] = (isset($_POST['zip_manual']) && $_POST['zip_manual'] == '1') ? true : false;
2058
2059
2060
2061//LOGGING
2062
2063$POST_LOG = $_POST;
2064
2065unset($POST_LOG['dbpass']);
2066
2067ksort($POST_LOG);
2068
2069
2070
2071//PAGE VARS
2072
2073$root_path = DupUtil::set_safe_path($GLOBALS['CURRENT_ROOT_PATH']);
2074
2075$package_path = "{$root_path}/{$_POST['package_name']}";
2076
2077$package_size = @filesize($package_path);
2078
2079$ajax1_start = DupUtil::get_microtime();
2080
2081$zip_support = class_exists('ZipArchive') ? 'Enabled' : 'Not Enabled';
2082
2083$JSON = array();
2084
2085$JSON['pass'] = 0;
2086
2087
2088
2089/* JSON RESPONSE: Most sites have warnings turned off by default, but if they're turned on the warnings
2090
2091cause errors in the JSON data Here we hide the status so warning level is reset at it at the end*/
2092
2093$ajax1_error_level = error_reporting();
2094
2095error_reporting(E_ERROR);
2096
2097
2098
2099//===============================
2100
2101//DATABASE TEST CONNECTION
2102
2103//===============================
2104
2105if (isset($_GET['dbtest'])) {
2106
2107
2108
2109 $html = "";
2110
2111 $baseport = parse_url($_POST['dbhost'], PHP_URL_PORT);
2112
2113 $dbConn = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], null, $_POST['dbport']);
2114
2115 $dbErr = mysqli_connect_error();
2116
2117 $dbFound = mysqli_select_db($dbConn, $_POST['dbname']);
2118
2119 $port_view = (is_int($baseport) || substr($_POST['dbhost'], -1) == ":") ? "Port=[Set in Host]" : "Port={$_POST['dbport']}";
2120
2121
2122
2123 $tstSrv = ($dbConn) ? "<div class='dup-pass'>Success</div>" : "<div class='dup-fail'>Fail</div>";
2124
2125 $tstDB = ($dbFound) ? "<div class='dup-pass'>Success</div>" : "<div class='dup-fail'>Fail</div>";
2126
2127 $html .= "<div class='dup-db-test'>";
2128
2129 $html .= "<small style='display:block; padding:5px'>Using Connection String:<br/>Host={$_POST['dbhost']}; Database={$_POST['dbname']}; Uid={$_POST['dbuser']}; Pwd={$_POST['dbpass']}; {$port_view}</small>";
2130
2131 $html .= "<label>Server Connected:</label> {$tstSrv} <br/>";
2132
2133 $html .= "<label>Database Found:</label> {$tstDB} <br/>";
2134
2135
2136
2137
2138
2139 if ($_POST['dbaction'] == 'create'){
2140
2141 $tblcount = DupUtil::dbtable_count($dbConn, $_POST['dbname']);
2142
2143 $html .= ($tblcount > 0)
2144
2145 ? "<div class='dup-fail'><b>WARNING</b></div><br/>" . sprintf(ERR_DBEMPTY, $_POST['dbname'], $tblcount)
2146
2147 : "";
2148
2149 }
2150
2151 $html .= "</div>";
2152
2153 die($html);
2154
2155}
2156
2157
2158
2159//===============================
2160
2161//ERROR MESSAGES
2162
2163//===============================
2164
2165//ERR_MAKELOG
2166
2167($GLOBALS['LOG_FILE_HANDLE'] != false) or DUPX_Log::Error(ERR_MAKELOG);
2168
2169
2170
2171//ERR_MYSQLI_SUPPORT
2172
2173function_exists('mysqli_connect') or DUPX_Log::Error(ERR_MYSQLI_SUPPORT);
2174
2175
2176
2177//ERR_DBCONNECT
2178
2179$dbh = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], null, $_POST['dbport']);
2180
2181@mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2182
2183($dbh) or DUPX_Log::Error(ERR_DBCONNECT . mysqli_connect_error());
2184
2185if ($_POST['dbaction'] == 'empty') {
2186
2187 mysqli_select_db($dbh, $_POST['dbname']) or DUPX_Log::Error(sprintf(ERR_DBCREATE, $_POST['dbname']));
2188
2189}
2190
2191//ERR_DBEMPTY
2192
2193if ($_POST['dbaction'] == 'create' ) {
2194
2195 $tblcount = DupUtil::dbtable_count($dbh, $_POST['dbname']);
2196
2197 if ($tblcount > 0) {
2198
2199 DUPX_Log::Error(sprintf(ERR_DBEMPTY, $_POST['dbname'], $tblcount));
2200
2201 }
2202
2203}
2204
2205
2206
2207//ERR_ZIPMANUAL
2208
2209if ($_POST['zip_manual']) {
2210
2211 if (!file_exists("wp-config.php") && !file_exists("database.sql")) {
2212
2213 DUPX_Log::Error(ERR_ZIPMANUAL);
2214
2215 }
2216
2217} else {
2218
2219 //ERR_CONFIG_FOUND
2220
2221 (!file_exists('wp-config.php'))
2222
2223 or DUPX_Log::Error(ERR_CONFIG_FOUND);
2224
2225 //ERR_ZIPNOTFOUND
2226
2227 (is_readable("{$package_path}"))
2228
2229 or DUPX_Log::Error(ERR_ZIPNOTFOUND);
2230
2231}
2232
2233
2234
2235DUPX_Log::Info("********************************************************************************");
2236
2237DUPX_Log::Info('DUPLICATOR INSTALL-LOG');
2238
2239DUPX_Log::Info('STEP1 START @ ' . @date('h:i:s'));
2240
2241DUPX_Log::Info('NOTICE: Do NOT post to public sites or forums');
2242
2243DUPX_Log::Info("********************************************************************************");
2244
2245DUPX_Log::Info("VERSION:\t{$GLOBALS['FW_DUPLICATOR_VERSION']}");
2246
2247DUPX_Log::Info("PHP:\t\t" . phpversion() . ' | SAPI: ' . php_sapi_name());
2248
2249DUPX_Log::Info("SERVER:\t\t{$_SERVER['SERVER_SOFTWARE']}");
2250
2251DUPX_Log::Info("DOC ROOT:\t{$root_path}");
2252
2253DUPX_Log::Info("DOC ROOT 755:\t" . var_export($GLOBALS['CHOWN_ROOT_PATH'], true));
2254
2255DUPX_Log::Info("LOG FILE 644:\t" . var_export($GLOBALS['CHOWN_LOG_PATH'], true));
2256
2257DUPX_Log::Info("BUILD NAME:\t{$GLOBALS['FW_SECURE_NAME']}");
2258
2259DUPX_Log::Info("REQUEST URL:\t{$GLOBALS['URL_PATH']}");
2260
2261
2262
2263$log = "--------------------------------------\n";
2264
2265$log .= "POST DATA\n";
2266
2267$log .= "--------------------------------------\n";
2268
2269$log .= print_r($POST_LOG, true);
2270
2271DUPX_Log::Info($log, 2);
2272
2273
2274
2275
2276
2277//====================================================================================================
2278
2279//UNZIP & FILE SETUP - Extract the zip file and prep files
2280
2281//====================================================================================================
2282
2283$log = "\n********************************************************************************\n";
2284
2285$log .= "ARCHIVE SETUP\n";
2286
2287$log .= "********************************************************************************\n";
2288
2289$log .= "NAME:\t{$_POST['package_name']}\n";
2290
2291$log .= "SIZE:\t" . DupUtil::readable_bytesize(@filesize($_POST['package_name'])) . "\n";
2292
2293$log .= "ZIP:\t{$zip_support} (ZipArchive Support)";
2294
2295DUPX_Log::Info($log);
2296
2297
2298
2299$zip_start = DupUtil::get_microtime();
2300
2301
2302
2303if ($_POST['zip_manual']) {
2304
2305 DUPX_Log::Info("\n** PACKAGE EXTRACTION IS IN MANUAL MODE ** \n");
2306
2307} else {
2308
2309 if ($GLOBALS['FW_PACKAGE_NAME'] != $_POST['package_name']) {
2310
2311 $log = "\n--------------------------------------\n";
2312
2313 $log .= "WARNING: This package set may be incompatible! \nBelow is a summary of the package this installer was built with and the package used. \n";
2314
2315 $log .= "To guarantee accuracy the installer and archive should match. For details see the online FAQs.";
2316
2317 $log .= "\nCREATED WITH:\t{$GLOBALS['FW_PACKAGE_NAME']} \nPROCESSED WITH:\t{$_POST['package_name']} \n";
2318
2319 $log .= "--------------------------------------\n";
2320
2321 DUPX_Log::Info($log);
2322
2323 }
2324
2325
2326
2327 if (! class_exists('ZipArchive')) {
2328
2329 DUPX_Log::Info("ERROR: Stopping install process. Trying to extract without ZipArchive module installed. Please use the 'Manual Package extraction' mode to extract zip file.");
2330
2331 DUPX_Log::Error(ERR_ZIPARCHIVE);
2332
2333 }
2334
2335
2336
2337 $target = $root_path;
2338
2339 $zip = new ZipArchive();
2340
2341 if ($zip->open($_POST['package_name']) === TRUE) {
2342
2343 DUPX_Log::Info("EXTRACTING");
2344
2345 if (! $zip->extractTo($target)) {
2346
2347 DUPX_Log::Error(ERR_ZIPEXTRACTION);
2348
2349 }
2350
2351 $log = print_r($zip, true);
2352
2353 $close_response = $zip->close();
2354
2355 $log .= "COMPLETE: " . var_export($close_response, true);
2356
2357 DUPX_Log::Info($log);
2358
2359 } else {
2360
2361 DUPX_Log::Error(ERR_ZIPOPEN);
2362
2363 }
2364
2365 $zip = null;
2366
2367}
2368
2369
2370
2371//===============================
2372
2373//WP-CONFIG: wp-config
2374
2375//===============================
2376
2377$wpconfig = @file_get_contents('wp-config.php', true);
2378
2379
2380
2381$patterns = array(
2382
2383 "/'DB_NAME',\s*'.*?'/",
2384
2385 "/'DB_USER',\s*'.*?'/",
2386
2387 "/'DB_PASSWORD',\s*'.*?'/",
2388
2389 "/'DB_HOST',\s*'.*?'/");
2390
2391
2392
2393$db_host = ($_POST['dbport'] == 3306) ? $_POST['dbhost'] : "{$_POST['dbhost']}:{$_POST['dbport']}";
2394
2395
2396
2397$replace = array(
2398
2399 "'DB_NAME', " . '\'' . $_POST['dbname'] . '\'',
2400
2401 "'DB_USER', " . '\'' . $_POST['dbuser'] . '\'',
2402
2403 "'DB_PASSWORD', " . '\'' . DupUtil::preg_replacement_quote($_POST['dbpass']) . '\'',
2404
2405 "'DB_HOST', " . '\'' . $db_host . '\'');
2406
2407
2408
2409//SSL CHECKS
2410
2411if ($_POST['ssl_admin']) {
2412
2413 if (! strstr($wpconfig, 'FORCE_SSL_ADMIN')) {
2414
2415 $wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_ADMIN', true);";
2416
2417 }
2418
2419} else {
2420
2421 array_push($patterns, "/'FORCE_SSL_ADMIN',\s*true/");
2422
2423 array_push($replace, "'FORCE_SSL_ADMIN', false");
2424
2425}
2426
2427
2428
2429if ($_POST['ssl_login']) {
2430
2431 if (! strstr($wpconfig, 'FORCE_SSL_LOGIN')) {
2432
2433 $wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_LOGIN', true);";
2434
2435 }
2436
2437} else {
2438
2439 array_push($patterns, "/'FORCE_SSL_LOGIN',\s*true/");
2440
2441 array_push($replace, "'FORCE_SSL_LOGIN', false");
2442
2443}
2444
2445
2446
2447//CACHE CHECKS
2448
2449if ($_POST['cache_wp']) {
2450
2451 if (! strstr($wpconfig, 'WP_CACHE')) {
2452
2453 $wpconfig = $wpconfig . PHP_EOL . "define('WP_CACHE', true);";
2454
2455 }
2456
2457} else {
2458
2459 array_push($patterns, "/'WP_CACHE',\s*true/");
2460
2461 array_push($replace, "'WP_CACHE', false");
2462
2463}
2464
2465if (! $_POST['cache_path']) {
2466
2467 array_push($patterns, "/'WPCACHEHOME',\s*'.*?'/");
2468
2469 array_push($replace, "'WPCACHEHOME', ''");
2470
2471}
2472
2473
2474
2475$wpconfig = preg_replace($patterns, $replace, $wpconfig);
2476
2477file_put_contents('wp-config.php', $wpconfig);
2478
2479$wpconfig = null;
2480
2481
2482
2483//CONFIG FILE RESETS
2484
2485DUPX_Config::Reset();
2486
2487
2488
2489
2490
2491//===============================
2492
2493//DATABASE SCRIPT
2494
2495//===============================
2496
2497@chmod("{$root_path}/database.sql", 0777);
2498
2499$sql_file = @file_get_contents('database.sql', true);
2500
2501if ($sql_file == false || strlen($sql_file) < 10) {
2502
2503 $sql_file = file_get_contents('installer-data.sql', true);
2504
2505 if ($sql_file == false || strlen($sql_file) < 10) {
2506
2507 DUPX_Log::Info("ERROR: Unable to read from the extracted database.sql file .\nValidate the permissions and/or group-owner rights on directory '{$root_path}'\n");
2508
2509 }
2510
2511}
2512
2513
2514
2515//Complex Subject See: http://webcollab.sourceforge.net/unicode.html
2516
2517//Removes invalid space characters
2518
2519if ($_POST['dbnbsp']) {
2520
2521 DUPX_Log::Info("ran fix non-breaking space characters\n");
2522
2523 $sql_file = preg_replace('/\xC2\xA0/', ' ', $sql_file);
2524
2525}
2526
2527
2528
2529//Write new contents to install-data.sql
2530
2531@chmod($sql_result_file_path, 0777);
2532
2533file_put_contents($GLOBALS['SQL_FILE_NAME'], $sql_file);
2534
2535
2536
2537$sql_result_file_data = explode(";\n", $sql_file);
2538
2539$sql_result_file_length = count($sql_result_file_data);
2540
2541$sql_result_file_path = "{$root_path}/{$GLOBALS['SQL_FILE_NAME']}";
2542
2543$sql_file = null;
2544
2545
2546
2547if (!is_readable($sql_result_file_path) || filesize($sql_result_file_path) == 0) {
2548
2549 DUPX_Log::Info("ERROR: Unable to create new sql file {$GLOBALS['SQL_FILE_NAME']}.\nValidate the permissions and/or group-owner rights on directory '{$root_path}' and file '{$GLOBALS['SQL_FILE_NAME']}'\n");
2550
2551}
2552
2553
2554
2555DUPX_Log::Info("\nUPDATED FILES:");
2556
2557DUPX_Log::Info("- SQL FILE: '{$sql_result_file_path}'");
2558
2559DUPX_Log::Info("- WP-CONFIG: '{$root_path}/wp-config.php'");
2560
2561$zip_end = DupUtil::get_microtime();
2562
2563DUPX_Log::Info("\nARCHIVE RUNTIME: " . DupUtil::elapsed_time($zip_end, $zip_start));
2564
2565DUPX_Log::Info("\n");
2566
2567DupUtil::fcgi_flush();
2568
2569
2570
2571
2572
2573//====================================================================================================
2574
2575//DATABASE ROUTINES
2576
2577//====================================================================================================
2578
2579
2580
2581@mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2582
2583@mysqli_query($dbh, "SET max_allowed_packet = {$GLOBALS['DB_MAX_PACKETS']}");
2584
2585DupUtil::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
2586
2587
2588
2589//Set defaults incase the variable could not be read
2590
2591$dbvar_maxtime = DupUtil::mysql_variable_value($dbh, 'wait_timeout');
2592
2593$dbvar_maxpacks = DupUtil::mysql_variable_value($dbh, 'max_allowed_packet');
2594
2595$dbvar_maxtime = is_null($dbvar_maxtime) ? 300 : $dbvar_maxtime;
2596
2597$dbvar_maxpacks = is_null($dbvar_maxpacks) ? 1048576 : $dbvar_maxpacks;
2598
2599
2600
2601
2602
2603DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}");
2604
2605DUPX_Log::Info('DATABASE-ROUTINES');
2606
2607DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}");
2608
2609DUPX_Log::Info("--------------------------------------");
2610
2611DUPX_Log::Info("SERVER ENVIROMENT");
2612
2613DUPX_Log::Info("--------------------------------------");
2614
2615DUPX_Log::Info("MYSQL VERSION:\t" . mysqli_get_server_info($dbh));
2616
2617DUPX_Log::Info("TIMEOUT:\t{$dbvar_maxtime}");
2618
2619DUPX_Log::Info("MAXPACK:\t{$dbvar_maxpacks}");
2620
2621
2622
2623//CREATE DB
2624
2625switch ($_POST['dbaction']) {
2626
2627 case "create":
2628
2629 mysqli_query($dbh, "CREATE DATABASE IF NOT EXISTS `{$_POST['dbname']}`");
2630
2631 mysqli_select_db($dbh, $_POST['dbname'])
2632
2633 or DUPX_Log::Error(sprintf(ERR_DBCONNECT_CREATE, $_POST['dbname']));
2634
2635 break;
2636
2637 case "empty":
2638
2639 //DROP DB TABLES
2640
2641 $drop_log = "Database already empty. Ready for install.";
2642
2643 $sql = "SHOW TABLES FROM `{$_POST['dbname']}`";
2644
2645 $found_tables = null;
2646
2647 if ($result = mysqli_query($dbh, $sql)) {
2648
2649 while ($row = mysqli_fetch_row($result)) {
2650
2651 $found_tables[] = $row[0];
2652
2653 }
2654
2655 if (count($found_tables) > 0) {
2656
2657 foreach ($found_tables as $table_name) {
2658
2659 $sql = "DROP TABLE `{$_POST['dbname']}`.`{$table_name}`";
2660
2661 if (!$result = mysqli_query($dbh, $sql)) {
2662
2663 DUPX_Log::Error(sprintf(ERR_DBTRYCLEAN, $_POST['dbname']));
2664
2665 }
2666
2667 }
2668
2669 }
2670
2671 $drop_log = 'removed (' . count($found_tables) . ') tables';
2672
2673 }
2674
2675 break;
2676
2677}
2678
2679
2680
2681
2682
2683//WRITE DATA
2684
2685DUPX_Log::Info("--------------------------------------");
2686
2687DUPX_Log::Info("DATABASE RESULTS");
2688
2689DUPX_Log::Info("--------------------------------------");
2690
2691$profile_start = DupUtil::get_microtime();
2692
2693$fcgi_buffer_pool = 5000;
2694
2695$fcgi_buffer_count = 0;
2696
2697$dbquery_rows = 0;
2698
2699$dbtable_rows = 1;
2700
2701$dbquery_errs = 0;
2702
2703$counter = 0;
2704
2705@mysqli_autocommit($dbh, false);
2706
2707while ($counter < $sql_result_file_length) {
2708
2709
2710
2711 $query_strlen = strlen(trim($sql_result_file_data[$counter]));
2712
2713 if ($dbvar_maxpacks < $query_strlen) {
2714
2715 DUPX_Log::Info("**ERROR** Query size limit [length={$query_strlen}] [sql=" . substr($sql_result_file_data[$counter], 75) . "...]");
2716
2717 $dbquery_errs++;
2718
2719 } elseif ($query_strlen > 0) {
2720
2721 @mysqli_free_result(@mysqli_query($dbh, ($sql_result_file_data[$counter])));
2722
2723 $err = mysqli_error($dbh);
2724
2725 //Check to make sure the connection is alive
2726
2727 if (!empty($err)) {
2728
2729
2730
2731 if (!mysqli_ping($dbh)) {
2732
2733 mysqli_close($dbh);
2734
2735 $dbh = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport'] );
2736
2737 // Reset session setup
2738
2739 @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2740
2741 DupUtil::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
2742
2743 }
2744
2745 DUPX_Log::Info("**ERROR** database error write '{$err}' - [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]");
2746
2747 $dbquery_errs++;
2748
2749
2750
2751 //Buffer data to browser to keep connection open
2752
2753 } else {
2754
2755 if ($fcgi_buffer_count++ > $fcgi_buffer_pool) {
2756
2757 $fcgi_buffer_count = 0;
2758
2759 DupUtil::fcgi_flush();
2760
2761 }
2762
2763 $dbquery_rows++;
2764
2765 }
2766
2767 }
2768
2769 $counter++;
2770
2771}
2772
2773@mysqli_commit($dbh);
2774
2775@mysqli_autocommit($dbh, true);
2776
2777
2778
2779DUPX_Log::Info("ERRORS FOUND:\t{$dbquery_errs}");
2780
2781DUPX_Log::Info("DROP TABLE:\t{$drop_log}");
2782
2783DUPX_Log::Info("QUERIES RAN:\t{$dbquery_rows}\n");
2784
2785
2786
2787$dbtable_count = 0;
2788
2789if ($result = mysqli_query($dbh, "SHOW TABLES")) {
2790
2791 while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
2792
2793 $table_rows = DupUtil::table_row_count($dbh, $row[0]);
2794
2795 $dbtable_rows += $table_rows;
2796
2797 DUPX_Log::Info("{$row[0]}: ({$table_rows})");
2798
2799 $dbtable_count++;
2800
2801 }
2802
2803 @mysqli_free_result($result);
2804
2805}
2806
2807
2808
2809if ($dbtable_count == 0) {
2810
2811 DUPX_Log::Info("NOTICE: You may have to manually run the installer-data.sql to validate data input. Also check to make sure your installer file is correct and the
2812
2813 table prefix '{$GLOBALS['FW_TABLEPREFIX']}' is correct for this particular version of WordPress. \n");
2814
2815}
2816
2817
2818
2819
2820
2821//DATA CLEANUP: Perform Transient Cache Cleanup
2822
2823//Remove all duplicator entries and record this one since this is a new install.
2824
2825$dbdelete_count = 0;
2826
2827@mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}duplicator_packages`");
2828
2829$dbdelete_count1 = @mysqli_affected_rows($dbh) or 0;
2830
2831@mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE `option_name` LIKE ('_transient%') OR `option_name` LIKE ('_site_transient%')");
2832
2833$dbdelete_count2 = @mysqli_affected_rows($dbh) or 0;
2834
2835$dbdelete_count = (abs($dbdelete_count1) + abs($dbdelete_count2));
2836
2837DUPX_Log::Info("Removed '{$dbdelete_count}' cache/transient rows");
2838
2839//Reset Duplicator Options
2840
2841foreach ($GLOBALS['FW_OPTS_DELETE'] as $value) {
2842
2843 mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE `option_name` = '{$value}'");
2844
2845}
2846
2847
2848
2849@mysqli_close($dbh);
2850
2851
2852
2853$profile_end = DupUtil::get_microtime();
2854
2855DUPX_Log::Info("\nSECTION RUNTIME: " . DupUtil::elapsed_time($profile_end, $profile_start));
2856
2857
2858
2859//FINAL RESULTS
2860
2861$ajax1_end = DupUtil::get_microtime();
2862
2863$ajax1_sum = DupUtil::elapsed_time($ajax1_end, $ajax1_start);
2864
2865DUPX_Log::Info("\n{$GLOBALS['SEPERATOR1']}");
2866
2867DUPX_Log::Info('STEP1 COMPLETE @ ' . @date('h:i:s') . " - TOTAL RUNTIME: {$ajax1_sum}");
2868
2869DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}");
2870
2871
2872
2873$JSON['pass'] = 1;
2874
2875$JSON['table_count'] = $dbtable_count;
2876
2877$JSON['table_rows'] = $dbtable_rows;
2878
2879$JSON['query_errs'] = $dbquery_errs;
2880
2881echo json_encode($JSON);
2882
2883error_reporting($ajax1_error_level);
2884
2885die('');
2886
2887?> <?php break;
2888
2889 case "2" :
2890
2891 ?> <?php
2892
2893// Exit if accessed directly
2894
2895if (! defined('DUPLICATOR_INIT')) {
2896
2897 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
2898
2899 $_baseURL = "http://" . $_baseURL;
2900
2901 header("HTTP/1.1 301 Moved Permanently");
2902
2903 header("Location: $_baseURL");
2904
2905 exit;
2906
2907}
2908
2909
2910
2911/* JSON RESPONSE: Most sites have warnings turned off by default, but if they're turned on the warnings
2912
2913cause errors in the JSON data Here we hide the status so warning level is reset at it at the end*/
2914
2915$ajax2_error_level = error_reporting();
2916
2917error_reporting(E_ERROR);
2918
2919
2920
2921//====================================================================================================
2922
2923//DATABASE UPDATES
2924
2925//====================================================================================================
2926
2927
2928
2929$ajax2_start = DupUtil::get_microtime();
2930
2931
2932
2933//MYSQL CONNECTION
2934
2935$dbh = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], html_entity_decode($_POST['dbpass']), $_POST['dbname'], $_POST['dbport']);
2936
2937$charset_server = @mysqli_character_set_name($dbh);
2938
2939@mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2940
2941DupUtil::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
2942
2943
2944
2945//POST PARAMS
2946
2947$_POST['blogname'] = mysqli_real_escape_string($dbh, $_POST['blogname']);
2948
2949$_POST['postguid'] = isset($_POST['postguid']) && $_POST['postguid'] == 1 ? 1 : 0;
2950
2951$_POST['fullsearch'] = isset($_POST['fullsearch']) && $_POST['fullsearch'] == 1 ? 1 : 0;
2952
2953$_POST['path_old'] = isset($_POST['path_old']) ? trim($_POST['path_old']) : null;
2954
2955$_POST['path_new'] = isset($_POST['path_new']) ? trim($_POST['path_new']) : null;
2956
2957$_POST['siteurl'] = isset($_POST['siteurl']) ? rtrim(trim($_POST['siteurl']), '/') : null;
2958
2959$_POST['tables'] = isset($_POST['tables']) && is_array($_POST['tables']) ? array_map('stripcslashes', $_POST['tables']) : array();
2960
2961$_POST['url_old'] = isset($_POST['url_old']) ? trim($_POST['url_old']) : null;
2962
2963$_POST['url_new'] = isset($_POST['url_new']) ? rtrim(trim($_POST['url_new']), '/') : null;
2964
2965
2966
2967//LOGGING
2968
2969$POST_LOG = $_POST;
2970
2971unset($POST_LOG['tables']);
2972
2973unset($POST_LOG['plugins']);
2974
2975unset($POST_LOG['dbpass']);
2976
2977ksort($POST_LOG);
2978
2979
2980
2981$date = @date('h:i:s');
2982
2983$charset_client = @mysqli_character_set_name($dbh);
2984
2985
2986
2987$log = <<<LOG
2988
2989\n\n
2990
2991********************************************************************************
2992
2993DUPLICATOR INSTALL-LOG
2994
2995STEP2 START @ {$date}
2996
2997NOTICE: Do not post to public sites or forums
2998
2999********************************************************************************
3000
3001CHARSET SERVER:\t{$charset_server}
3002
3003CHARSET CLIENT:\t {$charset_client} \n
3004
3005LOG;
3006
3007DUPX_Log::Info($log);
3008
3009
3010
3011//Detailed logging
3012
3013$log = "--------------------------------------\n";
3014
3015$log .= "POST DATA\n";
3016
3017$log .= "--------------------------------------\n";
3018
3019$log .= print_r($POST_LOG, true);
3020
3021$log .= "--------------------------------------\n";
3022
3023$log .= "SCANNED TABLES\n";
3024
3025$log .= "--------------------------------------\n";
3026
3027$log .= (isset($_POST['tables']) && count($_POST['tables'] > 0))
3028
3029 ? print_r($_POST['tables'], true)
3030
3031 : 'No tables selected to update';
3032
3033$log .= "--------------------------------------\n";
3034
3035$log .= "KEEP PLUGINS ACTIVE\n";
3036
3037$log .= "--------------------------------------\n";
3038
3039$log .= (isset($_POST['plugins']) && count($_POST['plugins'] > 0))
3040
3041 ? print_r($_POST['plugins'], true)
3042
3043 : 'No plugins selected for activation';
3044
3045DUPX_Log::Info($log, 2);
3046
3047
3048
3049//UPDATE SETTINGS
3050
3051$serial_plugin_list = (isset($_POST['plugins']) && count($_POST['plugins'] > 0)) ? @serialize($_POST['plugins']) : '';
3052
3053mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['blogname']}' WHERE option_name = 'blogname' ");
3054
3055mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$serial_plugin_list}' WHERE option_name = 'active_plugins' ");
3056
3057
3058
3059$log = "--------------------------------------\n";
3060
3061$log .= "SERIALIZER ENGINE\n";
3062
3063$log .= "[*] scan every column\n";
3064
3065$log .= "[~] scan only text columns\n";
3066
3067$log .= "[^] no searchable columns\n";
3068
3069$log .= "--------------------------------------";
3070
3071DUPX_Log::Info($log);
3072
3073
3074
3075$url_old_json = str_replace('"', "", json_encode($_POST['url_old']));
3076
3077$url_new_json = str_replace('"', "", json_encode($_POST['url_new']));
3078
3079$path_old_json = str_replace('"', "", json_encode($_POST['path_old']));
3080
3081$path_new_json = str_replace('"', "", json_encode($_POST['path_new']));
3082
3083
3084
3085array_push($GLOBALS['REPLACE_LIST'],
3086
3087 array('search' => $_POST['url_old'], 'replace' => $_POST['url_new']),
3088
3089 array('search' => $url_old_json, 'replace' => $url_new_json),
3090
3091 array('search' => $_POST['path_old'], 'replace' => $_POST['path_new']),
3092
3093 array('search' => $path_old_json, 'replace' => $path_new_json),
3094
3095 array('search' => rtrim(DupUtil::unset_safe_path($_POST['path_old']), '\\'), 'replace' => rtrim($_POST['path_new'], '/'))
3096
3097);
3098
3099
3100
3101@mysqli_autocommit($dbh, false);
3102
3103$report = DUPX_Serializer::load($dbh, $GLOBALS['REPLACE_LIST'], $_POST['tables'], $GLOBALS['TABLES_SKIP_COLS'], $_POST['fullsearch']);
3104
3105@mysqli_commit($dbh);
3106
3107@mysqli_autocommit($dbh, true);
3108
3109
3110
3111
3112
3113//BUILD JSON RESPONSE
3114
3115$JSON = array();
3116
3117$JSON['step1'] = json_decode(urldecode($_POST['json']));
3118
3119$JSON['step2'] = $report;
3120
3121$JSON['step2']['warn_all'] = 0;
3122
3123$JSON['step2']['warnlist'] = array();
3124
3125
3126
3127DUPX_Serializer::log_stats($report);
3128
3129DUPX_Serializer::log_errors($report);
3130
3131
3132
3133//Reset the postguid data
3134
3135if ($_POST['postguid']) {
3136
3137 mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}posts` SET guid = REPLACE(guid, '{$_POST['url_new']}', '{$_POST['url_old']}')");
3138
3139 $update_guid = @mysqli_affected_rows($dbh) or 0;
3140
3141 DUPX_Log::Info("Reverted '{$update_guid}' post guid columns back to '{$_POST['url_old']}'");
3142
3143}
3144
3145
3146
3147/* FINAL UPDATES: Must happen after the global replace to prevent double pathing
3148
3149 http://xyz.com/abc01 will become http://xyz.com/abc0101 with trailing data */
3150
3151mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['url_new']}' WHERE option_name = 'home' ");
3152
3153mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['siteurl']}' WHERE option_name = 'siteurl' ");
3154
3155
3156
3157
3158
3159//====================================================================================================
3160
3161//FINAL CLEANUP
3162
3163//====================================================================================================
3164
3165DUPX_Log::Info("\n********************************************************************************");
3166
3167DUPX_Log::Info('START FINAL CLEANUP: ' . @date('h:i:s'));
3168
3169DUPX_Log::Info("********************************************************************************");
3170
3171
3172
3173/*CREATE NEW USER LOGIC */
3174
3175if (strlen($_POST['wp_username']) >= 4 && strlen($_POST['wp_password']) >= 6) {
3176
3177
3178
3179 $newuser_check = mysqli_query($dbh, "SELECT COUNT(*) AS count FROM `{$GLOBALS['FW_TABLEPREFIX']}users` WHERE user_login = '{$_POST['wp_username']}' ");
3180
3181 $newuser_row = mysqli_fetch_row($newuser_check);
3182
3183 $newuser_count = is_null($newuser_row) ? 0 : $newuser_row[0];
3184
3185
3186
3187 if ($newuser_count == 0) {
3188
3189
3190
3191 $newuser_datetime = @date("Y-m-d H:i:s");
3192
3193 $newuser_security = mysqli_real_escape_string($dbh, 'a:1:{s:13:"administrator";s:1:"1";}');
3194
3195
3196
3197 $newuser_test1 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}users`
3198
3199 (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_registered`, `user_activation_key`, `user_status`, `display_name`)
3200
3201 VALUES ('{$_POST['wp_username']}', MD5('{$_POST['wp_password']}'), '{$_POST['wp_username']}', '', '{$newuser_datetime}', '', '0', '{$_POST['wp_username']}')");
3202
3203
3204
3205 $newuser_insert_id = mysqli_insert_id($dbh);
3206
3207
3208
3209 $newuser_test2 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta`
3210
3211 (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', '{$GLOBALS['FW_TABLEPREFIX']}capabilities', '{$newuser_security}')");
3212
3213
3214
3215 $newuser_test3 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta`
3216
3217 (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', '{$GLOBALS['FW_TABLEPREFIX']}user_level', '10')");
3218
3219
3220
3221 //Misc Meta-Data Settings:
3222
3223 @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'rich_editing', 'true')");
3224
3225 @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'admin_color', 'fresh')");
3226
3227 @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'nickname', '{$_POST['wp_username']}')");
3228
3229
3230
3231 if ($newuser_test1 && $newuser_test2 && $newuser_test3) {
3232
3233 DUPX_Log::Info("NEW WP-ADMIN USER: New username '{$_POST['wp_username']}' was created successfully \n ");
3234
3235 } else {
3236
3237 $newuser_warnmsg = "NEW WP-ADMIN USER: Failed to create the user '{$_POST['wp_username']}' \n ";
3238
3239 $JSON['step2']['warnlist'][] = $newuser_warnmsg;
3240
3241 DUPX_Log::Info($newuser_warnmsg);
3242
3243 }
3244
3245 }
3246
3247 else {
3248
3249 $newuser_warnmsg = "NEW WP-ADMIN USER: Username '{$_POST['wp_username']}' already exists in the database. Unable to create new account \n";
3250
3251 $JSON['step2']['warnlist'][] = $newuser_warnmsg;
3252
3253 DUPX_Log::Info($newuser_warnmsg);
3254
3255 }
3256
3257}
3258
3259
3260
3261/*MU Updates*/
3262
3263$mu_newDomain = parse_url($_POST['url_new']);
3264
3265$mu_oldDomain = parse_url($_POST['url_old']);
3266
3267$mu_newDomainHost = $mu_newDomain['host'];
3268
3269$mu_oldDomainHost = $mu_oldDomain['host'];
3270
3271$mu_updates = @mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}blogs` SET domain = '{$mu_newDomainHost}' WHERE domain = '{$mu_oldDomainHost}'");
3272
3273if ($mu_updates) {
3274
3275 DUPX_Log::Info("Update MU table blogs: domain {$mu_newDomainHost} ");
3276
3277} else {
3278
3279 DUPX_Log::Info("UPDATE `{$GLOBALS['FW_TABLEPREFIX']}blogs` SET domain = '{$mu_newDomainHost}' WHERE domain = '{$mu_oldDomainHost}'");
3280
3281}
3282
3283
3284
3285
3286
3287/*UPDATE WP-CONFIG FILE */
3288
3289$patterns = array("/'WP_HOME',\s*'.*?'/",
3290
3291 "/'WP_SITEURL',\s*'.*?'/",
3292
3293 "/'DOMAIN_CURRENT_SITE',\s*'.*?'/");
3294
3295
3296
3297$replace = array("'WP_HOME', " . '\'' . $_POST['url_new'] . '\'',
3298
3299 "'WP_SITEURL', " . '\'' . $_POST['url_new'] . '\'',
3300
3301 "'DOMAIN_CURRENT_SITE', " . '\'' . $mu_newDomainHost . '\'');
3302
3303
3304
3305$config_file = @file_get_contents('wp-config.php', true);
3306
3307$config_file = preg_replace($patterns, $replace, $config_file);
3308
3309file_put_contents('wp-config.php', $config_file);
3310
3311
3312
3313
3314
3315//Create Snapshots directory
3316
3317if (!file_exists(DUPLICATOR_SSDIR_NAME)) {
3318
3319 mkdir(DUPLICATOR_SSDIR_NAME, 0755);
3320
3321}
3322
3323$fp = fopen(DUPLICATOR_SSDIR_NAME . '/index.php', 'w');
3324
3325fclose($fp);
3326
3327
3328
3329
3330
3331//===============================
3332
3333//WARNING TESTS
3334
3335//===============================
3336
3337DUPX_Log::Info("\n--------------------------------------");
3338
3339DUPX_Log::Info("WARNINGS");
3340
3341DUPX_Log::Info("--------------------------------------");
3342
3343$config_vars = array('WP_CONTENT_DIR', 'WP_CONTENT_URL', 'WPCACHEHOME', 'COOKIE_DOMAIN', 'WP_SITEURL', 'WP_HOME', 'WP_TEMP_DIR');
3344
3345$config_found = DupUtil::string_has_value($config_vars, $config_file);
3346
3347
3348
3349//Files
3350
3351if ($config_found) {
3352
3353 $msg = 'WP-CONFIG WARNING: The wp-config.php has one or more of these values "' . implode(", ", $config_vars) . '" which may cause issues please validate these values by opening the file.';
3354
3355 $JSON['step2']['warnlist'][] = $msg;
3356
3357 DUPX_Log::Info($msg);
3358
3359}
3360
3361
3362
3363//Database
3364
3365$result = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name IN ('upload_url_path','upload_path')");
3366
3367if ($result) {
3368
3369 while ($row = mysqli_fetch_row($result)) {
3370
3371 if (strlen($row[0])) {
3372
3373 $msg = "MEDIA SETTINGS WARNING: The table '{$GLOBALS['FW_TABLEPREFIX']}options' has at least one the following values ['upload_url_path','upload_path'] set please validate settings. These settings can be changed in the wp-admin by going to Settings->Media area see 'Uploading Files'";
3374
3375 $JSON['step2']['warnlist'][] = $msg;
3376
3377 DUPX_Log::Info($msg);
3378
3379 break;
3380
3381 }
3382
3383 }
3384
3385}
3386
3387
3388
3389if (empty($JSON['step2']['warnlist'])) {
3390
3391 DUPX_Log::Info("No Warnings Found\n");
3392
3393}
3394
3395
3396
3397$JSON['step2']['warn_all'] = empty($JSON['step2']['warnlist']) ? 0 : count($JSON['step2']['warnlist']);
3398
3399
3400
3401mysqli_close($dbh);
3402
3403@unlink('database.sql');
3404
3405
3406
3407//CONFIG Setup
3408
3409DUPX_Config::Setup();
3410
3411
3412
3413$ajax2_end = DupUtil::get_microtime();
3414
3415$ajax2_sum = DupUtil::elapsed_time($ajax2_end, $ajax2_start);
3416
3417DUPX_Log::Info("********************************************************************************");
3418
3419DUPX_Log::Info('STEP 2 COMPLETE @ ' . @date('h:i:s') . " - TOTAL RUNTIME: {$ajax2_sum}");
3420
3421DUPX_Log::Info("********************************************************************************");
3422
3423
3424
3425$JSON['step2']['pass'] = 1;
3426
3427error_reporting($ajax2_error_level);
3428
3429die(json_encode($JSON));
3430
3431?> <?php
3432
3433 break;
3434
3435 }
3436
3437 @fclose($GLOBALS["LOG_FILE_HANDLE"]);
3438
3439 die("");
3440
3441}
3442
3443?>
3444
3445
3446
3447<!DOCTYPE html>
3448
3449<html>
3450
3451<head>
3452
3453 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
3454
3455 <meta name="robots" content="noindex,nofollow">
3456
3457 <title>Wordpress Duplicator</title>
3458
3459 <?php
3460
3461 // Exit if accessed directly
3462
3463 if (! defined('DUPLICATOR_INIT')) {
3464
3465 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
3466
3467 $_baseURL = "http://" . $_baseURL;
3468
3469 header("HTTP/1.1 301 Moved Permanently");
3470
3471 header("Location: $_baseURL");
3472
3473 exit;
3474
3475 }
3476
3477?>
3478
3479<?php if( DupUtil::is_url_active("ajax.googleapis.com", 443) ): ?>
3480
3481 <link rel='stylesheet' href='//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css' type='text/css' media='all' />
3482
3483<?php else: ?>
3484
3485 <style type="text/css">
3486
3487 /*! jQuery UI - v1.11.2 - 2014-12-20
3488
3489 * http://jqueryui.com
3490
3491 * Includes: core.css, progressbar.css, theme.css
3492
3493 * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
3494
3495 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
3496
3497
3498
3499 .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
3500
3501 </style>
3502
3503<?php endif; ?>
3504
3505 <?php
3506
3507 // Exit if accessed directly
3508
3509 if (! defined('DUPLICATOR_INIT')) {
3510
3511 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] :$_SERVER['HTTP_HOST'];
3512
3513 $_baseURL = "http://" . $_baseURL;
3514
3515 header("HTTP/1.1 301 Moved Permanently");
3516
3517 header("Location:$_baseURL");
3518
3519 exit;
3520
3521 }
3522
3523?>
3524
3525<style>
3526
3527 body {font-family:"Open Sans",sans-serif;}
3528
3529 body,td,th {font-size:13px;color:#000;}
3530
3531 fieldset {border:1px solid silver; border-radius:5px; padding:10px}
3532
3533 h3 {margin:1px; padding:1px; font-size:14px;}
3534
3535 a {color:#222}
3536
3537 a:hover{color:gray}
3538
3539 input[type=text] { width:500px; border-radius:3px; height:17px; font-size:12px; border:1px solid silver;}
3540
3541 input.readonly {background-color:#efefef;}
3542
3543 i.small {font-size:11px}
3544
3545
3546
3547 /* ============================
3548
3549 COMMON VIEW ELEMENTS*/
3550
3551 div#content {border:1px solid #CDCDCD; width:750px; min-height:550px; margin:auto; margin-top:18px; border-radius:5px; box-shadow:0 8px 6px -6px #333;}
3552
3553 div#content-inner {padding:10px 30px; min-height:550px}
3554
3555 form.content-form {min-height:550px; position:relative; line-height:17px}
3556
3557 div.dup-logfile-link {float:right; font-weight:normal; font-size:12px}
3558
3559
3560
3561 /* WIZARD STEPS */
3562
3563 table.header-wizard {border-top-left-radius:5px; border-top-right-radius:5px; width:100%; box-shadow:0 6px 4px -4px #777; background-color:#F1F1F1}
3564
3565 div#dup-wiz {padding:0px; margin:7px 0 10px 20px; height:20px }
3566
3567 div#dup-wiz-steps {margin:0px 0 0 10px; padding:0px; clear:both; font-weight:bold;font-size:12px; min-width:250px }
3568
3569 #dup-wiz span {display:block;float:left; text-align:center; width:15px; margin:3px 4px 0 0px; line-height:15px; color:#ccc; border:1px solid #CCCCCC; border-radius:4px;}
3570
3571 /* WIZ-DEFAULT*/
3572
3573 #dup-wiz a { position:relative; display:block; width:auto; height:24px; margin-right:18px; padding:0px 10px 0 3px; float:left; line-height:24px; color:#000; background:#E4E4E4; }
3574
3575 #dup-wiz a:before { width:0px; height:0px; border-top:12px solid #E4E4E4; border-bottom:12px solid #E4E4E4; border-left:12px solid transparent; position:absolute; content:""; top:0px; left:-12px; }
3576
3577 #dup-wiz a:after { width:0; height:0; border-top:12px solid transparent; border-bottom:12px solid transparent; border-left:12px solid #E4E4E4; position:absolute; content:""; top:0px; right:-12px; }
3578
3579 /* WIZ-COMPLETED */
3580
3581 #dup-wiz .completed-step a {color:#ccc; background:#999;}
3582
3583 #dup-wiz .completed-step a:before {border-top:12px solid #999; border-bottom:12px solid #999;}
3584
3585 #dup-wiz .completed-step a:after {border-left:12px solid #999;}
3586
3587 #dup-wiz .completed-step span {color:#ccc;}
3588
3589 /* WIZ-ACTIVE */
3590
3591 #dup-wiz .active-step a {color:#fff; background:#999;}
3592
3593 #dup-wiz .active-step a:before {border-top:12px solid #999; border-bottom:12px solid #999;}
3594
3595 #dup-wiz .active-step a:after {border-left:12px solid #999;}
3596
3597 #dup-wiz .active-step span {color:#fff;}
3598
3599
3600
3601 /*Help */
3602
3603 select#dup-hlp-lnk {border-radius:3px; font-size:11px; margin:3px 5px 0 0px; background-color:#efefef; border:1px solid silver}
3604
3605 div.dup-help-page {padding:5px 0 0 5px}
3606
3607 div.dup-help-page fieldset {margin-bottom:25px}
3608
3609 div#dup-main-help h3 {background-color:#dfdfdf; border:1px solid silver; border-radius:5px; padding:3px; margin-bottom:8px}
3610
3611
3612
3613 div#progress-area {padding:5px; margin:150px 0 0 0px; text-align:center;}
3614
3615 div#ajaxerr-data {padding:5px; height:350px; width:99%; border:1px solid silver; border-radius:5px; background-color:#efefef; font-size:12px; overflow-y:scroll}
3616
3617 div.title-header {padding:2px; border-bottom:1px solid silver; font-weight:bold; margin-bottom:5px;}
3618
3619
3620
3621 /*BOXES:Expandable sections */
3622
3623 div.dup-box {padding:0px; display:block; background-color:#fff; border:1px solid #e5e5e5; box-shadow:0 1px 1px rgba(0,0,0,.04);}
3624
3625 div.dup-box-title {font-size:14px; padding:5px 0 0 10px; font-weight:bold; cursor:pointer; height:23px; margin:0px; background-color:#F9F9F9}
3626
3627 div.dup-box-title:hover {background-color:#efefef;}
3628
3629 div.dup-box-arrow {text-decoration:none!important; float:right; width:27px; height:30px; font-size:16px; cursor:pointer; padding:1px 0 0 0px; white-space:nowrap}
3630
3631 div.dup-box-panel {padding:10px 15px 10px 15px; border-top:1px solid #EEEEEE; margin:-1px 0 0 0px; background-color:#F9F9F9; box-shadow:0 8px 6px -6px #999;}
3632
3633
3634
3635 /* ============================
3636
3637 STEP 1 VIEW */
3638
3639 i#dup-step1-sys-req-msg {font-weight:normal; display:block; padding:0px 0 0 20px;}
3640
3641 div.circle-pass, div.circle-fail {display:block;width:13px;height:13px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;text-decoration:none;box-shadow:1px 1px 2px #000;background:#207D1D;opacity:0.95; display:inline-block;}
3642
3643 div.circle-fail {background:#9A0D1D !important;}
3644
3645 select#logging {font-size:11px}
3646
3647 table.dup-step1-inputs {width:100%; border:0px;}
3648
3649 table.dup-step1-inputs td{white-space:nowrap; padding:2px;}
3650
3651 table.dup-step1-inputs td:first-child{width:125px}
3652
3653 div.dup-step1-modes {padding:0px 15px 0 0px;}
3654
3655 div#dup-step1-dbconn {margin:auto; text-align:center; margin:15px 0 20px 0px}
3656
3657 input#dup-step1-dbconn-btn {font-size:11px; height:20px; border:1px solid gray; border-radius:3px; cursor:pointer}
3658
3659 input#dup-step1-dbport-btn {font-size:11px; height:20px; border:1px solid gray; border-radius:3px; cursor:pointer; width:85px}
3660
3661 div.dup-db-test label{display:inline-block; width:150px; font-weight:bold; white-space:nowrap;}
3662
3663 div.dup-db-test small{display:block; margin:5px 0 5px 0px; font-style:italic; color:#444}
3664
3665 div#dbconn-test-msg {font-size:12px}
3666
3667 div#dup-step1-dbconn-status {border:1px solid silver; border-radius:3px; background-color:#f9f9f9; padding:10px; margin-top:10px; height:125px; overflow-y: scroll}
3668
3669
3670
3671 /*Warning Area and Message */
3672
3673 div#dup-step1-warning {margin-top:40px;padding:5px;font-size:11px; color:gray; line-height:12px;font-style:italic; overflow-y:scroll; height:75px; border:1px solid #dfdfdf; background-color:#fff; border-radius:3px}
3674
3675 div#dup-step1-warning-check {padding:5px; font-size:12px; font-weight:normal; font-style:italic;}
3676
3677 div#dup-step1-warning-emptydb {display:none; color:#AF2222; margin:0px 0 0 20px}
3678
3679 div#dup-step1-tryagain {padding-top:50px; text-align:center; width:100%; font-size:16px; color:#444; font-weight:bold;}
3680
3681
3682
3683 /*Dialog*/
3684
3685 div#dup-step1-dialog-data {height:90%; font-size:11px; padding:5px; line-height:16px; }
3686
3687 td.dup-step1-dialog-data-details {padding:0px 0 0 30px; border-radius:4px; line-height:14px; font-size:11px; display:none}
3688
3689 td.dup-step1-dialog-data-details b {width:50px;display:inline-block}
3690
3691 .dup-pass {display:inline-block; color:green;}
3692
3693 .dup-ok {display:inline-block; color:#5860C7;}
3694
3695 .dup-fail {display:inline-block; color:#AF0000;}
3696
3697 hr.dup-dots { border:none; border-top:1px dotted silver; height:1px; width:100%;}
3698
3699 div.dup-ui-error {padding-top:2px; font-size:14px}
3700
3701 div.help {color:#555; font-style:italic; font-size:11px}
3702
3703
3704
3705 /* ============================
3706
3707 STEP 2 VIEW */
3708
3709 table.table-inputs-step2{width:100%; border:0px;}
3710
3711 table.table-inputs-step2 td{white-space:nowrap; padding:2px;}
3712
3713 div#dup-step2-adv-opts {margin-top:5px; }
3714
3715 div.dup-step2-allnonelinks {font-size:11px; float:right;}
3716
3717
3718
3719 /* ============================
3720
3721 STEP 3 VIEW */
3722
3723 div.dup-step3-final-msg {height:110px; border:1px solid #CDCDCD; padding:8px;font-size:12px; border-radius:5px;box-shadow:0 4px 2px -2px #777;}
3724
3725 div.dup-step3-final-title {color:#BE2323;}
3726
3727 div.dup-step3-connect {font-size:12px; text-align:center; font-style:italic; position:absolute; bottom:10px; padding:10px; width:100%; margin-top:20px}
3728
3729 table.dup-step3-report-results,
3730
3731 table.dup-step3-report-errs {border-collapse:collapse; border:1px solid #dfdfdf; }
3732
3733 table.dup-step3-report-errs td {text-align:center; width:33%}
3734
3735 table.dup-step3-report-results th, table.dup-step3-report-errs th {background-color:#efefef; padding:0px; font-size:12px; padding:0px}
3736
3737 table.dup-step3-report-results td, table.dup-step3-report-errs td {padding:0px; white-space:nowrap; border:1px solid #dfdfdf; text-align:center; font-size:11px}
3738
3739 table.dup-step3-report-results td:first-child {text-align:left; font-weight:bold; padding-left:3px}
3740
3741
3742
3743 div.dup-step3-err-title a {}
3744
3745 div.dup-step3-err-msg {padding:8px; display:none; border:1px dashed #999; margin:10px 0 20px 0px; border-radius:5px;}
3746
3747 div.dup-step3-err-msg div.content{padding:5px; font-size:11px; line-height:17px; max-height:125px; overflow-y:scroll; border:1px solid silver; margin:3px; }
3748
3749 div.dup-step3-err-msg div.info{padding:2px; background-color:#FCFEC5; border:1px solid silver; border-radius:5px; font-size:11px; line-height:16px }
3750
3751 table.dup-step3-final-step {width:100%;}
3752
3753 table.dup-step3-final-step td {padding:5px 15px 5px 5px}
3754
3755 table.dup-step3-final-step td:first-child {white-space:nowrap; font-weight:bold}
3756
3757 div.dup-step3-go-back {border-bottom:1px dotted #dfdfdf; border-top:1px dotted #dfdfdf; margin:auto; text-align:center}
3758
3759
3760
3761 /* ============================
3762
3763 BUTTONS */
3764
3765 div.dup-footer-buttons {position:absolute; bottom:10px; padding:10px; width:100%; text-align:right;}
3766
3767 div.dup-footer-buttons input, button {
3768
3769 color:#000; font-size:12px; border-radius:5px; padding:6px 8px 4px 8px; border:1px solid #999;
3770
3771 background-color:#F1F1F1;
3772
3773 background-image:-ms-linear-gradient(top, #F9F9F9, #ECECEC);
3774
3775 background-image:-moz-linear-gradient(top, #F9F9F9, #ECECEC);
3776
3777 background-image:linear-gradient(top, #F9F9F9, #ECECEC);
3778
3779 }
3780
3781 div.dup-footer-buttons input[disabled=disabled]{background-color:#F4F4F4; color:silver; border:1px solid silver;}
3782
3783 div.dup-footer-buttons input, button {cursor:pointer; border:1px solid #000; }
3784
3785
3786
3787 /*!
3788
3789 * password indicator
3790
3791 */
3792
3793 .top_testresult{font-weight:bold; font-size:11px; color:#222; padding:1px 1px 1px 4px; margin:4px 0 0 0px; width:495px; dislay:inline-block}
3794
3795 .top_testresult span{margin:0;}
3796
3797 .top_shortPass{background:#edabab; border:1px solid #bc0000;display:block;}
3798
3799 .top_badPass{background:#edabab;border:1px solid #bc0000;display:block;}
3800
3801 .top_goodPass{background:#ffffe0; border:1px solid #e6db55; display:block;}
3802
3803 .top_strongPass{background:#d3edab; border:1px solid #73bc00; display:block;}
3804
3805
3806
3807 /* ============================
3808
3809 CUSTOME OVERIDE */
3810
3811 /*Hide X button on close dialog*/
3812
3813 div.ui-dialog-titlebar button.ui-dialog-titlebar-close {display:none !important}
3814
3815
3816
3817 /*================================================
3818
3819 PARSLEY:Overrides*/
3820
3821 input.parsley-error, textarea.parsley-error {
3822
3823 color:#B94A48 !important;
3824
3825 background-color:#F2DEDE !important;
3826
3827 border:1px solid #EED3D7 !important;
3828
3829 }
3830
3831 ul.parsley-error-list {margin:1px 0 0 -40px; list-style-type:none; font-size:10px}
3832
3833</style>
3834
3835 <?php
3836
3837 // Exit if accessed directly
3838
3839 if (! defined('DUPLICATOR_INIT')) {
3840
3841 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
3842
3843 $_baseURL = "http://" . $_baseURL;
3844
3845 header("HTTP/1.1 301 Moved Permanently");
3846
3847 header("Location: $_baseURL");
3848
3849 exit;
3850
3851 }
3852
3853?>
3854
3855<!-- ========================================
3856
3857JQUERY ASSETS -->
3858
3859<?php if(DupUtil::is_url_active("ajax.googleapis.com", 443) ): ?>
3860
3861 <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
3862
3863 <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
3864
3865<?php else: ?>
3866
3867 <script type="text/javascript">
3868
3869 /*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
3870
3871 !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=mb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=nb(b);function qb(){}qb.prototype=d.filters=d.pseudos,d.setFilters=new qb,g=gb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?gb.error(a):z(a,i).slice(0)};function rb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)
3872
3873 },removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
3874
3875 },removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec=/#.*$/,fc=/([?&])_=[^&]*/,gc=/^(.*?):[ \t]*([^\r\n]*)$/gm,hc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ic=/^(?:GET|HEAD)$/,jc=/^\/\//,kc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lc={},mc={},nc="*/".concat("*"),oc=a.location.href,pc=kc.exec(oc.toLowerCase())||[];function qc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rc(a,b,c,d){var e={},f=a===mc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function uc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:oc,type:"GET",isLocal:hc.test(pc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sc(sc(a,n.ajaxSettings),b):sc(n.ajaxSettings,a)},ajaxPrefilter:qc(lc),ajaxTransport:qc(mc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gc.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||oc)+"").replace(ec,"").replace(jc,pc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pc[1]&&h[2]===pc[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pc[3]||("http:"===pc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rc(lc,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ic.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fc.test(d)?d.replace(fc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rc(mc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tc(k,v,f)),u=uc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vc=/%20/g,wc=/\[\]$/,xc=/\r?\n/g,yc=/^(?:submit|button|image|reset|file)$/i,zc=/^(?:input|select|textarea|keygen)/i;function Ac(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wc.test(a)?d(a,e):Ac(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ac(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ac(c,a[c],b,e);return d.join("&").replace(vc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zc.test(this.nodeName)&&!yc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xc,"\r\n")}}):{name:b.name,value:c.replace(xc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bc=0,Cc={},Dc={0:200,1223:204},Ec=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cc)Cc[a]()}),k.cors=!!Ec&&"withCredentials"in Ec,k.ajax=Ec=!!Ec,n.ajaxTransport(function(a){var b;return k.cors||Ec&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Dc[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fc=[],Gc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hc)return Hc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ic=a.document.documentElement;function Jc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ic;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ic})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kc=a.jQuery,Lc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lc),b&&a.jQuery===n&&(a.jQuery=Kc),n},typeof b===U&&(a.jQuery=a.$=n),n});
3876
3877 </script>
3878
3879 <script type="text/javascript">
3880
3881 /*! jQuery UI - v1.11.2 - 2014-12-20
3882
3883 * http://jqueryui.com
3884
3885 * Includes: core.js, widget.js, progressbar.js
3886
3887 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
3888
3889 (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var s=0,n=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,a=n.call(arguments,1),o=0,r=a.length;r>o;o++)for(i in a[o])s=a[o][i],a[o].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,r=n.call(arguments,1),h=this;return a=!o&&r.length?e.widget.extend.apply(null,[a].concat(r)):a,o?this.each(function(){var i,n=e.data(this,s);return"instance"===a?(h=n,!1):n?e.isFunction(n[a])&&"_"!==a.charAt(0)?(i=n[a].apply(n,r),i!==n&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(a||{}),t._init&&t._init()):e.data(this,s,new i(a,this))}),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget,e.widget("ui.progressbar",{version:"1.11.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}})});
3890
3891 </script>
3892
3893<?php endif; ?>
3894
3895
3896
3897<!-- ========================================
3898
3899KNOCKOUT ASSETS -->
3900
3901<?php if( DupUtil::is_url_active("ajax.aspnetcdn.com", 443) ): ?>
3902
3903 <script src="//ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js"></script>
3904
3905<?php else: ?>
3906
3907 <script type="text/javascript">
3908
3909 // Knockout JavaScript library v2.2.1
3910
3911 // (c) Steven Sanderson - http://knockoutjs.com/
3912
3913 // License: MIT (http://www.opensource.org/licenses/mit-license.php)
3914
3915
3916
3917 (function() {function j(w){throw w;}var m=!0,p=null,r=!1;function u(w){return function(){return w}};var x=window,y=document,ga=navigator,F=window.jQuery,I=void 0;
3918
3919 function L(w){function ha(a,d,c,e,f){var g=[];a=b.j(function(){var a=d(c,f)||[];0<g.length&&(b.a.Ya(M(g),a),e&&b.r.K(e,p,[c,a,f]));g.splice(0,g.length);b.a.P(g,a)},p,{W:a,Ka:function(){return 0==g.length||!b.a.X(g[0])}});return{M:g,j:a.pa()?a:I}}function M(a){for(;a.length&&!b.a.X(a[0]);)a.splice(0,1);if(1<a.length){for(var d=a[0],c=a[a.length-1],e=[d];d!==c;){d=d.nextSibling;if(!d)return;e.push(d)}Array.prototype.splice.apply(a,[0,a.length].concat(e))}return a}function S(a,b,c,e,f){var g=Math.min,
3920
3921 h=Math.max,k=[],l,n=a.length,q,s=b.length,v=s-n||1,G=n+s+1,J,A,z;for(l=0;l<=n;l++){A=J;k.push(J=[]);z=g(s,l+v);for(q=h(0,l-1);q<=z;q++)J[q]=q?l?a[l-1]===b[q-1]?A[q-1]:g(A[q]||G,J[q-1]||G)+1:q+1:l+1}g=[];h=[];v=[];l=n;for(q=s;l||q;)s=k[l][q]-1,q&&s===k[l][q-1]?h.push(g[g.length]={status:c,value:b[--q],index:q}):l&&s===k[l-1][q]?v.push(g[g.length]={status:e,value:a[--l],index:l}):(g.push({status:"retained",value:b[--q]}),--l);if(h.length&&v.length){a=10*n;var t;for(b=c=0;(f||b<a)&&(t=h[c]);c++){for(e=
3922
3923 0;k=v[e];e++)if(t.value===k.value){t.moved=k.index;k.moved=t.index;v.splice(e,1);b=e=0;break}b+=e}}return g.reverse()}function T(a,d,c,e,f){f=f||{};var g=a&&N(a),g=g&&g.ownerDocument,h=f.templateEngine||O;b.za.vb(c,h,g);c=h.renderTemplate(c,e,f,g);("number"!=typeof c.length||0<c.length&&"number"!=typeof c[0].nodeType)&&j(Error("Template engine must return an array of DOM nodes"));g=r;switch(d){case "replaceChildren":b.e.N(a,c);g=m;break;case "replaceNode":b.a.Ya(a,c);g=m;break;case "ignoreTargetNode":break;
3924
3925 default:j(Error("Unknown renderMode: "+d))}g&&(U(c,e),f.afterRender&&b.r.K(f.afterRender,p,[c,e.$data]));return c}function N(a){return a.nodeType?a:0<a.length?a[0]:p}function U(a,d){if(a.length){var c=a[0],e=a[a.length-1];V(c,e,function(a){b.Da(d,a)});V(c,e,function(a){b.s.ib(a,[d])})}}function V(a,d,c){var e;for(d=b.e.nextSibling(d);a&&(e=a)!==d;)a=b.e.nextSibling(e),(1===e.nodeType||8===e.nodeType)&&c(e)}function W(a,d,c){a=b.g.aa(a);for(var e=b.g.Q,f=0;f<a.length;f++){var g=a[f].key;if(e.hasOwnProperty(g)){var h=
3926
3927 e[g];"function"===typeof h?(g=h(a[f].value))&&j(Error(g)):h||j(Error("This template engine does not support the '"+g+"' binding within its templates"))}}a="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+b.g.ba(a)+" } })()})";return c.createJavaScriptEvaluatorBlock(a)+d}function X(a,d,c,e){function f(a){return function(){return k[a]}}function g(){return k}var h=0,k,l;b.j(function(){var n=c&&c instanceof b.z?c:new b.z(b.a.d(c)),q=n.$data;e&&b.eb(a,n);if(k=("function"==typeof d?
3928
3929 d(n,a):d)||b.J.instance.getBindings(a,n)){if(0===h){h=1;for(var s in k){var v=b.c[s];v&&8===a.nodeType&&!b.e.I[s]&&j(Error("The binding '"+s+"' cannot be used with virtual elements"));if(v&&"function"==typeof v.init&&(v=(0,v.init)(a,f(s),g,q,n))&&v.controlsDescendantBindings)l!==I&&j(Error("Multiple bindings ("+l+" and "+s+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")),l=s}h=2}if(2===h)for(s in k)(v=b.c[s])&&"function"==
3930
3931 typeof v.update&&(0,v.update)(a,f(s),g,q,n)}},p,{W:a});return{Nb:l===I}}function Y(a,d,c){var e=m,f=1===d.nodeType;f&&b.e.Ta(d);if(f&&c||b.J.instance.nodeHasBindings(d))e=X(d,p,a,c).Nb;e&&Z(a,d,!f)}function Z(a,d,c){for(var e=b.e.firstChild(d);d=e;)e=b.e.nextSibling(d),Y(a,d,c)}function $(a,b){var c=aa(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:p}function aa(a,b){for(var c=a,e=1,f=[];c=c.nextSibling;){if(H(c)&&(e--,0===e))return f;f.push(c);B(c)&&e++}b||j(Error("Cannot find closing comment tag to match: "+
3932
3933 a.nodeValue));return p}function H(a){return 8==a.nodeType&&(K?a.text:a.nodeValue).match(ia)}function B(a){return 8==a.nodeType&&(K?a.text:a.nodeValue).match(ja)}function P(a,b){for(var c=p;a!=c;)c=a,a=a.replace(ka,function(a,c){return b[c]});return a}function la(){var a=[],d=[];this.save=function(c,e){var f=b.a.i(a,c);0<=f?d[f]=e:(a.push(c),d.push(e))};this.get=function(c){c=b.a.i(a,c);return 0<=c?d[c]:I}}function ba(a,b,c){function e(e){var g=b(a[e]);switch(typeof g){case "boolean":case "number":case "string":case "function":f[e]=
3934
3935 g;break;case "object":case "undefined":var h=c.get(g);f[e]=h!==I?h:ba(g,b,c)}}c=c||new la;a=b(a);if(!("object"==typeof a&&a!==p&&a!==I&&!(a instanceof Date)))return a;var f=a instanceof Array?[]:{};c.save(a,f);var g=a;if(g instanceof Array){for(var h=0;h<g.length;h++)e(h);"function"==typeof g.toJSON&&e("toJSON")}else for(h in g)e(h);return f}function ca(a,d){if(a)if(8==a.nodeType){var c=b.s.Ua(a.nodeValue);c!=p&&d.push({sb:a,Fb:c})}else if(1==a.nodeType)for(var c=0,e=a.childNodes,f=e.length;c<f;c++)ca(e[c],
3936
3937 d)}function Q(a,d,c,e){b.c[a]={init:function(a){b.a.f.set(a,da,{});return{controlsDescendantBindings:m}},update:function(a,g,h,k,l){h=b.a.f.get(a,da);g=b.a.d(g());k=!c!==!g;var n=!h.Za;if(n||d||k!==h.qb)n&&(h.Za=b.a.Ia(b.e.childNodes(a),m)),k?(n||b.e.N(a,b.a.Ia(h.Za)),b.Ea(e?e(l,g):l,a)):b.e.Y(a),h.qb=k}};b.g.Q[a]=r;b.e.I[a]=m}function ea(a,d,c){c&&d!==b.k.q(a)&&b.k.T(a,d);d!==b.k.q(a)&&b.r.K(b.a.Ba,p,[a,"change"])}var b="undefined"!==typeof w?w:{};b.b=function(a,d){for(var c=a.split("."),e=b,f=0;f<
3938
3939 c.length-1;f++)e=e[c[f]];e[c[c.length-1]]=d};b.p=function(a,b,c){a[b]=c};b.version="2.2.1";b.b("version",b.version);b.a=new function(){function a(a,d){if("input"!==b.a.u(a)||!a.type||"click"!=d.toLowerCase())return r;var c=a.type;return"checkbox"==c||"radio"==c}var d=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,c={},e={};c[/Firefox\/2/i.test(ga.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");
3940
3941 for(var f in c){var g=c[f];if(g.length)for(var h=0,k=g.length;h<k;h++)e[g[h]]=f}var l={propertychange:m},n,c=3;f=y.createElement("div");for(g=f.getElementsByTagName("i");f.innerHTML="\x3c!--[if gt IE "+ ++c+"]><i></i><![endif]--\x3e",g[0];);n=4<c?c:I;return{Na:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],o:function(a,b){for(var d=0,c=a.length;d<c;d++)b(a[d])},i:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var d=0,c=a.length;d<
3942
3943 c;d++)if(a[d]===b)return d;return-1},lb:function(a,b,d){for(var c=0,e=a.length;c<e;c++)if(b.call(d,a[c]))return a[c];return p},ga:function(a,d){var c=b.a.i(a,d);0<=c&&a.splice(c,1)},Ga:function(a){a=a||[];for(var d=[],c=0,e=a.length;c<e;c++)0>b.a.i(d,a[c])&&d.push(a[c]);return d},V:function(a,b){a=a||[];for(var d=[],c=0,e=a.length;c<e;c++)d.push(b(a[c]));return d},fa:function(a,b){a=a||[];for(var d=[],c=0,e=a.length;c<e;c++)b(a[c])&&d.push(a[c]);return d},P:function(a,b){if(b instanceof Array)a.push.apply(a,
3944
3945 b);else for(var d=0,c=b.length;d<c;d++)a.push(b[d]);return a},extend:function(a,b){if(b)for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);return a},ka:function(a){for(;a.firstChild;)b.removeNode(a.firstChild)},Hb:function(a){a=b.a.L(a);for(var d=y.createElement("div"),c=0,e=a.length;c<e;c++)d.appendChild(b.A(a[c]));return d},Ia:function(a,d){for(var c=0,e=a.length,g=[];c<e;c++){var f=a[c].cloneNode(m);g.push(d?b.A(f):f)}return g},N:function(a,d){b.a.ka(a);if(d)for(var c=0,e=d.length;c<e;c++)a.appendChild(d[c])},
3946
3947 Ya:function(a,d){var c=a.nodeType?[a]:a;if(0<c.length){for(var e=c[0],g=e.parentNode,f=0,h=d.length;f<h;f++)g.insertBefore(d[f],e);f=0;for(h=c.length;f<h;f++)b.removeNode(c[f])}},bb:function(a,b){7>n?a.setAttribute("selected",b):a.selected=b},D:function(a){return(a||"").replace(d,"")},Rb:function(a,d){for(var c=[],e=(a||"").split(d),f=0,g=e.length;f<g;f++){var h=b.a.D(e[f]);""!==h&&c.push(h)}return c},Ob:function(a,b){a=a||"";return b.length>a.length?r:a.substring(0,b.length)===b},tb:function(a,b){if(b.compareDocumentPosition)return 16==
3948
3949 (b.compareDocumentPosition(a)&16);for(;a!=p;){if(a==b)return m;a=a.parentNode}return r},X:function(a){return b.a.tb(a,a.ownerDocument)},u:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,d,c){var e=n&&l[d];if(!e&&"undefined"!=typeof F){if(a(b,d)){var f=c;c=function(a,b){var d=this.checked;b&&(this.checked=b.nb!==m);f.call(this,a);this.checked=d}}F(b).bind(d,c)}else!e&&"function"==typeof b.addEventListener?b.addEventListener(d,c,r):"undefined"!=typeof b.attachEvent?b.attachEvent("on"+
3950
3951 d,function(a){c.call(b,a)}):j(Error("Browser doesn't support addEventListener or attachEvent"))},Ba:function(b,d){(!b||!b.nodeType)&&j(Error("element must be a DOM node when calling triggerEvent"));if("undefined"!=typeof F){var c=[];a(b,d)&&c.push({nb:b.checked});F(b).trigger(d,c)}else"function"==typeof y.createEvent?"function"==typeof b.dispatchEvent?(c=y.createEvent(e[d]||"HTMLEvents"),c.initEvent(d,m,m,x,0,0,0,0,0,r,r,r,r,0,b),b.dispatchEvent(c)):j(Error("The supplied element doesn't support dispatchEvent")):
3952
3953 "undefined"!=typeof b.fireEvent?(a(b,d)&&(b.checked=b.checked!==m),b.fireEvent("on"+d)):j(Error("Browser doesn't support triggering events"))},d:function(a){return b.$(a)?a():a},ua:function(a){return b.$(a)?a.t():a},da:function(a,d,c){if(d){var e=/[\w-]+/g,f=a.className.match(e)||[];b.a.o(d.match(e),function(a){var d=b.a.i(f,a);0<=d?c||f.splice(d,1):c&&f.push(a)});a.className=f.join(" ")}},cb:function(a,d){var c=b.a.d(d);if(c===p||c===I)c="";if(3===a.nodeType)a.data=c;else{var e=b.e.firstChild(a);
3954
3955 !e||3!=e.nodeType||b.e.nextSibling(e)?b.e.N(a,[y.createTextNode(c)]):e.data=c;b.a.wb(a)}},ab:function(a,b){a.name=b;if(7>=n)try{a.mergeAttributes(y.createElement("<input name='"+a.name+"'/>"),r)}catch(d){}},wb:function(a){9<=n&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},ub:function(a){if(9<=n){var b=a.style.width;a.style.width=0;a.style.width=b}},Lb:function(a,d){a=b.a.d(a);d=b.a.d(d);for(var c=[],e=a;e<=d;e++)c.push(e);return c},L:function(a){for(var b=[],d=0,c=a.length;d<
3956
3957 c;d++)b.push(a[d]);return b},Pb:6===n,Qb:7===n,Z:n,Oa:function(a,d){for(var c=b.a.L(a.getElementsByTagName("input")).concat(b.a.L(a.getElementsByTagName("textarea"))),e="string"==typeof d?function(a){return a.name===d}:function(a){return d.test(a.name)},f=[],g=c.length-1;0<=g;g--)e(c[g])&&f.push(c[g]);return f},Ib:function(a){return"string"==typeof a&&(a=b.a.D(a))?x.JSON&&x.JSON.parse?x.JSON.parse(a):(new Function("return "+a))():p},xa:function(a,d,c){("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&&
3958
3959 j(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"));return JSON.stringify(b.a.d(a),d,c)},Jb:function(a,d,c){c=c||{};var e=c.params||{},f=c.includeFields||this.Na,g=a;if("object"==typeof a&&"form"===b.a.u(a))for(var g=a.action,h=f.length-1;0<=h;h--)for(var k=b.a.Oa(a,f[h]),l=k.length-1;0<=l;l--)e[k[l].name]=k[l].value;d=b.a.d(d);var n=y.createElement("form");
3960
3961 n.style.display="none";n.action=g;n.method="post";for(var w in d)a=y.createElement("input"),a.name=w,a.value=b.a.xa(b.a.d(d[w])),n.appendChild(a);for(w in e)a=y.createElement("input"),a.name=w,a.value=e[w],n.appendChild(a);y.body.appendChild(n);c.submitter?c.submitter(n):n.submit();setTimeout(function(){n.parentNode.removeChild(n)},0)}}};b.b("utils",b.a);b.b("utils.arrayForEach",b.a.o);b.b("utils.arrayFirst",b.a.lb);b.b("utils.arrayFilter",b.a.fa);b.b("utils.arrayGetDistinctValues",b.a.Ga);b.b("utils.arrayIndexOf",
3962
3963 b.a.i);b.b("utils.arrayMap",b.a.V);b.b("utils.arrayPushAll",b.a.P);b.b("utils.arrayRemoveItem",b.a.ga);b.b("utils.extend",b.a.extend);b.b("utils.fieldsIncludedWithJsonPost",b.a.Na);b.b("utils.getFormFields",b.a.Oa);b.b("utils.peekObservable",b.a.ua);b.b("utils.postJson",b.a.Jb);b.b("utils.parseJson",b.a.Ib);b.b("utils.registerEventHandler",b.a.n);b.b("utils.stringifyJson",b.a.xa);b.b("utils.range",b.a.Lb);b.b("utils.toggleDomNodeCssClass",b.a.da);b.b("utils.triggerEvent",b.a.Ba);b.b("utils.unwrapObservable",
3964
3965 b.a.d);Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments);a=c.shift();return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});b.a.f=new function(){var a=0,d="__ko__"+(new Date).getTime(),c={};return{get:function(a,d){var c=b.a.f.la(a,r);return c===I?I:c[d]},set:function(a,d,c){c===I&&b.a.f.la(a,r)===I||(b.a.f.la(a,m)[d]=c)},la:function(b,f){var g=b[d];if(!g||!("null"!==g&&c[g])){if(!f)return I;g=b[d]="ko"+
3966
3967 a++;c[g]={}}return c[g]},clear:function(a){var b=a[d];return b?(delete c[b],a[d]=p,m):r}}};b.b("utils.domData",b.a.f);b.b("utils.domData.clear",b.a.f.clear);b.a.F=new function(){function a(a,d){var e=b.a.f.get(a,c);e===I&&d&&(e=[],b.a.f.set(a,c,e));return e}function d(c){var e=a(c,r);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);b.a.f.clear(c);"function"==typeof F&&"function"==typeof F.cleanData&&F.cleanData([c]);if(f[c.nodeType])for(e=c.firstChild;c=e;)e=c.nextSibling,8===c.nodeType&&d(c)}
3968
3969 var c="__ko_domNodeDisposal__"+(new Date).getTime(),e={1:m,8:m,9:m},f={1:m,9:m};return{Ca:function(b,d){"function"!=typeof d&&j(Error("Callback must be a function"));a(b,m).push(d)},Xa:function(d,e){var f=a(d,r);f&&(b.a.ga(f,e),0==f.length&&b.a.f.set(d,c,I))},A:function(a){if(e[a.nodeType]&&(d(a),f[a.nodeType])){var c=[];b.a.P(c,a.getElementsByTagName("*"));for(var k=0,l=c.length;k<l;k++)d(c[k])}return a},removeNode:function(a){b.A(a);a.parentNode&&a.parentNode.removeChild(a)}}};b.A=b.a.F.A;b.removeNode=
3970
3971 b.a.F.removeNode;b.b("cleanNode",b.A);b.b("removeNode",b.removeNode);b.b("utils.domNodeDisposal",b.a.F);b.b("utils.domNodeDisposal.addDisposeCallback",b.a.F.Ca);b.b("utils.domNodeDisposal.removeDisposeCallback",b.a.F.Xa);b.a.ta=function(a){var d;if("undefined"!=typeof F)if(F.parseHTML)d=F.parseHTML(a);else{if((d=F.clean([a]))&&d[0]){for(a=d[0];a.parentNode&&11!==a.parentNode.nodeType;)a=a.parentNode;a.parentNode&&a.parentNode.removeChild(a)}}else{var c=b.a.D(a).toLowerCase();d=y.createElement("div");
3972
3973 c=c.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!c.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!c.indexOf("<td")||!c.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];a="ignored<div>"+c[1]+a+c[2]+"</div>";for("function"==typeof x.innerShiv?d.appendChild(x.innerShiv(a)):d.innerHTML=a;c[0]--;)d=d.lastChild;d=b.a.L(d.lastChild.childNodes)}return d};b.a.ca=function(a,d){b.a.ka(a);d=b.a.d(d);if(d!==p&&d!==I)if("string"!=typeof d&&(d=d.toString()),
3974
3975 "undefined"!=typeof F)F(a).html(d);else for(var c=b.a.ta(d),e=0;e<c.length;e++)a.appendChild(c[e])};b.b("utils.parseHtmlFragment",b.a.ta);b.b("utils.setHtml",b.a.ca);var R={};b.s={ra:function(a){"function"!=typeof a&&j(Error("You can only pass a function to ko.memoization.memoize()"));var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);R[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},hb:function(a,b){var c=R[a];c===I&&j(Error("Couldn't find any memo with ID "+
3976
3977 a+". Perhaps it's already been unmemoized."));try{return c.apply(p,b||[]),m}finally{delete R[a]}},ib:function(a,d){var c=[];ca(a,c);for(var e=0,f=c.length;e<f;e++){var g=c[e].sb,h=[g];d&&b.a.P(h,d);b.s.hb(c[e].Fb,h);g.nodeValue="";g.parentNode&&g.parentNode.removeChild(g)}},Ua:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:p}};b.b("memoization",b.s);b.b("memoization.memoize",b.s.ra);b.b("memoization.unmemoize",b.s.hb);b.b("memoization.parseMemoText",b.s.Ua);b.b("memoization.unmemoizeDomNodeAndDescendants",
3978
3979 b.s.ib);b.Ma={throttle:function(a,d){a.throttleEvaluation=d;var c=p;return b.j({read:a,write:function(b){clearTimeout(c);c=setTimeout(function(){a(b)},d)}})},notify:function(a,d){a.equalityComparer="always"==d?u(r):b.m.fn.equalityComparer;return a}};b.b("extenders",b.Ma);b.fb=function(a,d,c){this.target=a;this.ha=d;this.rb=c;b.p(this,"dispose",this.B)};b.fb.prototype.B=function(){this.Cb=m;this.rb()};b.S=function(){this.w={};b.a.extend(this,b.S.fn);b.p(this,"subscribe",this.ya);b.p(this,"extend",
3980
3981 this.extend);b.p(this,"getSubscriptionsCount",this.yb)};b.S.fn={ya:function(a,d,c){c=c||"change";var e=new b.fb(this,d?a.bind(d):a,function(){b.a.ga(this.w[c],e)}.bind(this));this.w[c]||(this.w[c]=[]);this.w[c].push(e);return e},notifySubscribers:function(a,d){d=d||"change";this.w[d]&&b.r.K(function(){b.a.o(this.w[d].slice(0),function(b){b&&b.Cb!==m&&b.ha(a)})},this)},yb:function(){var a=0,b;for(b in this.w)this.w.hasOwnProperty(b)&&(a+=this.w[b].length);return a},extend:function(a){var d=this;if(a)for(var c in a){var e=
3982
3983 b.Ma[c];"function"==typeof e&&(d=e(d,a[c]))}return d}};b.Qa=function(a){return"function"==typeof a.ya&&"function"==typeof a.notifySubscribers};b.b("subscribable",b.S);b.b("isSubscribable",b.Qa);var C=[];b.r={mb:function(a){C.push({ha:a,La:[]})},end:function(){C.pop()},Wa:function(a){b.Qa(a)||j(Error("Only subscribable things can act as dependencies"));if(0<C.length){var d=C[C.length-1];d&&!(0<=b.a.i(d.La,a))&&(d.La.push(a),d.ha(a))}},K:function(a,b,c){try{return C.push(p),a.apply(b,c||[])}finally{C.pop()}}};
3984
3985 var ma={undefined:m,"boolean":m,number:m,string:m};b.m=function(a){function d(){if(0<arguments.length){if(!d.equalityComparer||!d.equalityComparer(c,arguments[0]))d.H(),c=arguments[0],d.G();return this}b.r.Wa(d);return c}var c=a;b.S.call(d);d.t=function(){return c};d.G=function(){d.notifySubscribers(c)};d.H=function(){d.notifySubscribers(c,"beforeChange")};b.a.extend(d,b.m.fn);b.p(d,"peek",d.t);b.p(d,"valueHasMutated",d.G);b.p(d,"valueWillMutate",d.H);return d};b.m.fn={equalityComparer:function(a,
3986
3987 b){return a===p||typeof a in ma?a===b:r}};var E=b.m.Kb="__ko_proto__";b.m.fn[E]=b.m;b.ma=function(a,d){return a===p||a===I||a[E]===I?r:a[E]===d?m:b.ma(a[E],d)};b.$=function(a){return b.ma(a,b.m)};b.Ra=function(a){return"function"==typeof a&&a[E]===b.m||"function"==typeof a&&a[E]===b.j&&a.zb?m:r};b.b("observable",b.m);b.b("isObservable",b.$);b.b("isWriteableObservable",b.Ra);b.R=function(a){0==arguments.length&&(a=[]);a!==p&&(a!==I&&!("length"in a))&&j(Error("The argument passed when initializing an observable array must be an array, or null, or undefined."));
3988
3989 var d=b.m(a);b.a.extend(d,b.R.fn);return d};b.R.fn={remove:function(a){for(var b=this.t(),c=[],e="function"==typeof a?a:function(b){return b===a},f=0;f<b.length;f++){var g=b[f];e(g)&&(0===c.length&&this.H(),c.push(g),b.splice(f,1),f--)}c.length&&this.G();return c},removeAll:function(a){if(a===I){var d=this.t(),c=d.slice(0);this.H();d.splice(0,d.length);this.G();return c}return!a?[]:this.remove(function(d){return 0<=b.a.i(a,d)})},destroy:function(a){var b=this.t(),c="function"==typeof a?a:function(b){return b===
3990
3991 a};this.H();for(var e=b.length-1;0<=e;e--)c(b[e])&&(b[e]._destroy=m);this.G()},destroyAll:function(a){return a===I?this.destroy(u(m)):!a?[]:this.destroy(function(d){return 0<=b.a.i(a,d)})},indexOf:function(a){var d=this();return b.a.i(d,a)},replace:function(a,b){var c=this.indexOf(a);0<=c&&(this.H(),this.t()[c]=b,this.G())}};b.a.o("pop push reverse shift sort splice unshift".split(" "),function(a){b.R.fn[a]=function(){var b=this.t();this.H();b=b[a].apply(b,arguments);this.G();return b}});b.a.o(["slice"],
3992
3993 function(a){b.R.fn[a]=function(){var b=this();return b[a].apply(b,arguments)}});b.b("observableArray",b.R);b.j=function(a,d,c){function e(){b.a.o(z,function(a){a.B()});z=[]}function f(){var a=h.throttleEvaluation;a&&0<=a?(clearTimeout(t),t=setTimeout(g,a)):g()}function g(){if(!q)if(n&&w())A();else{q=m;try{var a=b.a.V(z,function(a){return a.target});b.r.mb(function(c){var d;0<=(d=b.a.i(a,c))?a[d]=I:z.push(c.ya(f))});for(var c=s.call(d),e=a.length-1;0<=e;e--)a[e]&&z.splice(e,1)[0].B();n=m;h.notifySubscribers(l,
3994
3995 "beforeChange");l=c}finally{b.r.end()}h.notifySubscribers(l);q=r;z.length||A()}}function h(){if(0<arguments.length)return"function"===typeof v?v.apply(d,arguments):j(Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.")),this;n||g();b.r.Wa(h);return l}function k(){return!n||0<z.length}var l,n=r,q=r,s=a;s&&"object"==typeof s?(c=s,s=c.read):(c=c||{},s||(s=c.read));"function"!=typeof s&&j(Error("Pass a function that returns the value of the ko.computed"));
3996
3997 var v=c.write,G=c.disposeWhenNodeIsRemoved||c.W||p,w=c.disposeWhen||c.Ka||u(r),A=e,z=[],t=p;d||(d=c.owner);h.t=function(){n||g();return l};h.xb=function(){return z.length};h.zb="function"===typeof c.write;h.B=function(){A()};h.pa=k;b.S.call(h);b.a.extend(h,b.j.fn);b.p(h,"peek",h.t);b.p(h,"dispose",h.B);b.p(h,"isActive",h.pa);b.p(h,"getDependenciesCount",h.xb);c.deferEvaluation!==m&&g();if(G&&k()){A=function(){b.a.F.Xa(G,arguments.callee);e()};b.a.F.Ca(G,A);var D=w,w=function(){return!b.a.X(G)||D()}}return h};
3998
3999 b.Bb=function(a){return b.ma(a,b.j)};w=b.m.Kb;b.j[w]=b.m;b.j.fn={};b.j.fn[w]=b.j;b.b("dependentObservable",b.j);b.b("computed",b.j);b.b("isComputed",b.Bb);b.gb=function(a){0==arguments.length&&j(Error("When calling ko.toJS, pass the object you want to convert."));return ba(a,function(a){for(var c=0;b.$(a)&&10>c;c++)a=a();return a})};b.toJSON=function(a,d,c){a=b.gb(a);return b.a.xa(a,d,c)};b.b("toJS",b.gb);b.b("toJSON",b.toJSON);b.k={q:function(a){switch(b.a.u(a)){case "option":return a.__ko__hasDomDataOptionValue__===
4000
4001 m?b.a.f.get(a,b.c.options.sa):7>=b.a.Z?a.getAttributeNode("value").specified?a.value:a.text:a.value;case "select":return 0<=a.selectedIndex?b.k.q(a.options[a.selectedIndex]):I;default:return a.value}},T:function(a,d){switch(b.a.u(a)){case "option":switch(typeof d){case "string":b.a.f.set(a,b.c.options.sa,I);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=d;break;default:b.a.f.set(a,b.c.options.sa,d),a.__ko__hasDomDataOptionValue__=m,a.value="number"===typeof d?
4002
4003 d:""}break;case "select":for(var c=a.options.length-1;0<=c;c--)if(b.k.q(a.options[c])==d){a.selectedIndex=c;break}break;default:if(d===p||d===I)d="";a.value=d}}};b.b("selectExtensions",b.k);b.b("selectExtensions.readValue",b.k.q);b.b("selectExtensions.writeValue",b.k.T);var ka=/\@ko_token_(\d+)\@/g,na=["true","false"],oa=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;b.g={Q:[],aa:function(a){var d=b.a.D(a);if(3>d.length)return[];"{"===d.charAt(0)&&(d=d.substring(1,d.length-1));a=[];for(var c=
4004
4005 p,e,f=0;f<d.length;f++){var g=d.charAt(f);if(c===p)switch(g){case '"':case "'":case "/":c=f,e=g}else if(g==e&&"\\"!==d.charAt(f-1)){g=d.substring(c,f+1);a.push(g);var h="@ko_token_"+(a.length-1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f=f-(g.length-h.length),c=p}}e=c=p;for(var k=0,l=p,f=0;f<d.length;f++){g=d.charAt(f);if(c===p)switch(g){case "{":c=f;l=g;e="}";break;case "(":c=f;l=g;e=")";break;case "[":c=f,l=g,e="]"}g===l?k++:g===e&&(k--,0===k&&(g=d.substring(c,f+1),a.push(g),h="@ko_token_"+(a.length-
4006
4007 1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f-=g.length-h.length,c=p))}e=[];d=d.split(",");c=0;for(f=d.length;c<f;c++)k=d[c],l=k.indexOf(":"),0<l&&l<k.length-1?(g=k.substring(l+1),e.push({key:P(k.substring(0,l),a),value:P(g,a)})):e.push({unknown:P(k,a)});return e},ba:function(a){var d="string"===typeof a?b.g.aa(a):a,c=[];a=[];for(var e,f=0;e=d[f];f++)if(0<c.length&&c.push(","),e.key){var g;a:{g=e.key;var h=b.a.D(g);switch(h.length&&h.charAt(0)){case "'":case '"':break a;default:g="'"+h+"'"}}e=e.value;
4008
4009 c.push(g);c.push(":");c.push(e);e=b.a.D(e);0<=b.a.i(na,b.a.D(e).toLowerCase())?e=r:(h=e.match(oa),e=h===p?r:h[1]?"Object("+h[1]+")"+h[2]:e);e&&(0<a.length&&a.push(", "),a.push(g+" : function(__ko_value) { "+e+" = __ko_value; }"))}else e.unknown&&c.push(e.unknown);d=c.join("");0<a.length&&(d=d+", '_ko_property_writers' : { "+a.join("")+" } ");return d},Eb:function(a,d){for(var c=0;c<a.length;c++)if(b.a.D(a[c].key)==d)return m;return r},ea:function(a,d,c,e,f){if(!a||!b.Ra(a)){if((a=d()._ko_property_writers)&&
4010
4011 a[c])a[c](e)}else(!f||a.t()!==e)&&a(e)}};b.b("expressionRewriting",b.g);b.b("expressionRewriting.bindingRewriteValidators",b.g.Q);b.b("expressionRewriting.parseObjectLiteral",b.g.aa);b.b("expressionRewriting.preProcessBindings",b.g.ba);b.b("jsonExpressionRewriting",b.g);b.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",b.g.ba);var K="\x3c!--test--\x3e"===y.createComment("test").text,ja=K?/^\x3c!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\x3e$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,ia=K?/^\x3c!--\s*\/ko\s*--\x3e$/:
4012
4013 /^\s*\/ko\s*$/,pa={ul:m,ol:m};b.e={I:{},childNodes:function(a){return B(a)?aa(a):a.childNodes},Y:function(a){if(B(a)){a=b.e.childNodes(a);for(var d=0,c=a.length;d<c;d++)b.removeNode(a[d])}else b.a.ka(a)},N:function(a,d){if(B(a)){b.e.Y(a);for(var c=a.nextSibling,e=0,f=d.length;e<f;e++)c.parentNode.insertBefore(d[e],c)}else b.a.N(a,d)},Va:function(a,b){B(a)?a.parentNode.insertBefore(b,a.nextSibling):a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)},Pa:function(a,d,c){c?B(a)?a.parentNode.insertBefore(d,
4014
4015 c.nextSibling):c.nextSibling?a.insertBefore(d,c.nextSibling):a.appendChild(d):b.e.Va(a,d)},firstChild:function(a){return!B(a)?a.firstChild:!a.nextSibling||H(a.nextSibling)?p:a.nextSibling},nextSibling:function(a){B(a)&&(a=$(a));return a.nextSibling&&H(a.nextSibling)?p:a.nextSibling},jb:function(a){return(a=B(a))?a[1]:p},Ta:function(a){if(pa[b.a.u(a)]){var d=a.firstChild;if(d){do if(1===d.nodeType){var c;c=d.firstChild;var e=p;if(c){do if(e)e.push(c);else if(B(c)){var f=$(c,m);f?c=f:e=[c]}else H(c)&&
4016
4017 (e=[c]);while(c=c.nextSibling)}if(c=e){e=d.nextSibling;for(f=0;f<c.length;f++)e?a.insertBefore(c[f],e):a.appendChild(c[f])}}while(d=d.nextSibling)}}}};b.b("virtualElements",b.e);b.b("virtualElements.allowedBindings",b.e.I);b.b("virtualElements.emptyNode",b.e.Y);b.b("virtualElements.insertAfter",b.e.Pa);b.b("virtualElements.prepend",b.e.Va);b.b("virtualElements.setDomNodeChildren",b.e.N);b.J=function(){this.Ha={}};b.a.extend(b.J.prototype,{nodeHasBindings:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind")!=
4018
4019 p;case 8:return b.e.jb(a)!=p;default:return r}},getBindings:function(a,b){var c=this.getBindingsString(a,b);return c?this.parseBindingsString(c,b,a):p},getBindingsString:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind");case 8:return b.e.jb(a);default:return p}},parseBindingsString:function(a,d,c){try{var e;if(!(e=this.Ha[a])){var f=this.Ha,g,h="with($context){with($data||{}){return{"+b.g.ba(a)+"}}}";g=new Function("$context","$element",h);e=f[a]=g}return e(d,c)}catch(k){j(Error("Unable to parse bindings.\nMessage: "+
4020
4021 k+";\nBindings value: "+a))}}});b.J.instance=new b.J;b.b("bindingProvider",b.J);b.c={};b.z=function(a,d,c){d?(b.a.extend(this,d),this.$parentContext=d,this.$parent=d.$data,this.$parents=(d.$parents||[]).slice(0),this.$parents.unshift(this.$parent)):(this.$parents=[],this.$root=a,this.ko=b);this.$data=a;c&&(this[c]=a)};b.z.prototype.createChildContext=function(a,d){return new b.z(a,this,d)};b.z.prototype.extend=function(a){var d=b.a.extend(new b.z,this);return b.a.extend(d,a)};b.eb=function(a,d){if(2==
4022
4023 arguments.length)b.a.f.set(a,"__ko_bindingContext__",d);else return b.a.f.get(a,"__ko_bindingContext__")};b.Fa=function(a,d,c){1===a.nodeType&&b.e.Ta(a);return X(a,d,c,m)};b.Ea=function(a,b){(1===b.nodeType||8===b.nodeType)&&Z(a,b,m)};b.Da=function(a,b){b&&(1!==b.nodeType&&8!==b.nodeType)&&j(Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"));b=b||x.document.body;Y(a,b,m)};b.ja=function(a){switch(a.nodeType){case 1:case 8:var d=b.eb(a);if(d)return d;
4024
4025 if(a.parentNode)return b.ja(a.parentNode)}return I};b.pb=function(a){return(a=b.ja(a))?a.$data:I};b.b("bindingHandlers",b.c);b.b("applyBindings",b.Da);b.b("applyBindingsToDescendants",b.Ea);b.b("applyBindingsToNode",b.Fa);b.b("contextFor",b.ja);b.b("dataFor",b.pb);var fa={"class":"className","for":"htmlFor"};b.c.attr={update:function(a,d){var c=b.a.d(d())||{},e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]),g=f===r||f===p||f===I;g&&a.removeAttribute(e);8>=b.a.Z&&e in fa?(e=fa[e],g?a.removeAttribute(e):
4026
4027 a[e]=f):g||a.setAttribute(e,f.toString());"name"===e&&b.a.ab(a,g?"":f.toString())}}};b.c.checked={init:function(a,d,c){b.a.n(a,"click",function(){var e;if("checkbox"==a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=d(),g=b.a.d(f);"checkbox"==a.type&&g instanceof Array?(e=b.a.i(g,a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):b.g.ea(f,c,"checked",e,m)});"radio"==a.type&&!a.name&&b.c.uniqueName.init(a,u(m))},update:function(a,d){var c=b.a.d(d());
4028
4029 "checkbox"==a.type?a.checked=c instanceof Array?0<=b.a.i(c,a.value):c:"radio"==a.type&&(a.checked=a.value==c)}};b.c.css={update:function(a,d){var c=b.a.d(d());if("object"==typeof c)for(var e in c){var f=b.a.d(c[e]);b.a.da(a,e,f)}else c=String(c||""),b.a.da(a,a.__ko__cssValue,r),a.__ko__cssValue=c,b.a.da(a,c,m)}};b.c.enable={update:function(a,d){var c=b.a.d(d());c&&a.disabled?a.removeAttribute("disabled"):!c&&!a.disabled&&(a.disabled=m)}};b.c.disable={update:function(a,d){b.c.enable.update(a,function(){return!b.a.d(d())})}};
4030
4031 b.c.event={init:function(a,d,c,e){var f=d()||{},g;for(g in f)(function(){var f=g;"string"==typeof f&&b.a.n(a,f,function(a){var g,n=d()[f];if(n){var q=c();try{var s=b.a.L(arguments);s.unshift(e);g=n.apply(e,s)}finally{g!==m&&(a.preventDefault?a.preventDefault():a.returnValue=r)}q[f+"Bubble"]===r&&(a.cancelBubble=m,a.stopPropagation&&a.stopPropagation())}})})()}};b.c.foreach={Sa:function(a){return function(){var d=a(),c=b.a.ua(d);if(!c||"number"==typeof c.length)return{foreach:d,templateEngine:b.C.oa};
4032
4033 b.a.d(d);return{foreach:c.data,as:c.as,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:b.C.oa}}},init:function(a,d){return b.c.template.init(a,b.c.foreach.Sa(d))},update:function(a,d,c,e,f){return b.c.template.update(a,b.c.foreach.Sa(d),c,e,f)}};b.g.Q.foreach=r;b.e.I.foreach=m;b.c.hasfocus={init:function(a,d,c){function e(e){a.__ko_hasfocusUpdating=m;var f=a.ownerDocument;"activeElement"in
4034
4035 f&&(e=f.activeElement===a);f=d();b.g.ea(f,c,"hasfocus",e,m);a.__ko_hasfocusUpdating=r}var f=e.bind(p,m),g=e.bind(p,r);b.a.n(a,"focus",f);b.a.n(a,"focusin",f);b.a.n(a,"blur",g);b.a.n(a,"focusout",g)},update:function(a,d){var c=b.a.d(d());a.__ko_hasfocusUpdating||(c?a.focus():a.blur(),b.r.K(b.a.Ba,p,[a,c?"focusin":"focusout"]))}};b.c.html={init:function(){return{controlsDescendantBindings:m}},update:function(a,d){b.a.ca(a,d())}};var da="__ko_withIfBindingData";Q("if");Q("ifnot",r,m);Q("with",m,r,function(a,
4036
4037 b){return a.createChildContext(b)});b.c.options={update:function(a,d,c){"select"!==b.a.u(a)&&j(Error("options binding applies only to SELECT elements"));for(var e=0==a.length,f=b.a.V(b.a.fa(a.childNodes,function(a){return a.tagName&&"option"===b.a.u(a)&&a.selected}),function(a){return b.k.q(a)||a.innerText||a.textContent}),g=a.scrollTop,h=b.a.d(d());0<a.length;)b.A(a.options[0]),a.remove(0);if(h){c=c();var k=c.optionsIncludeDestroyed;"number"!=typeof h.length&&(h=[h]);if(c.optionsCaption){var l=y.createElement("option");
4038
4039 b.a.ca(l,c.optionsCaption);b.k.T(l,I);a.appendChild(l)}d=0;for(var n=h.length;d<n;d++){var q=h[d];if(!q||!q._destroy||k){var l=y.createElement("option"),s=function(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c},v=s(q,c.optionsValue,q);b.k.T(l,b.a.d(v));q=s(q,c.optionsText,v);b.a.cb(l,q);a.appendChild(l)}}h=a.getElementsByTagName("option");d=k=0;for(n=h.length;d<n;d++)0<=b.a.i(f,b.k.q(h[d]))&&(b.a.bb(h[d],m),k++);a.scrollTop=g;e&&"value"in c&&ea(a,b.a.ua(c.value),m);b.a.ub(a)}}};
4040
4041 b.c.options.sa="__ko.optionValueDomData__";b.c.selectedOptions={init:function(a,d,c){b.a.n(a,"change",function(){var e=d(),f=[];b.a.o(a.getElementsByTagName("option"),function(a){a.selected&&f.push(b.k.q(a))});b.g.ea(e,c,"value",f)})},update:function(a,d){"select"!=b.a.u(a)&&j(Error("values binding applies only to SELECT elements"));var c=b.a.d(d());c&&"number"==typeof c.length&&b.a.o(a.getElementsByTagName("option"),function(a){var d=0<=b.a.i(c,b.k.q(a));b.a.bb(a,d)})}};b.c.style={update:function(a,
4042
4043 d){var c=b.a.d(d()||{}),e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]);a.style[e]=f||""}}};b.c.submit={init:function(a,d,c,e){"function"!=typeof d()&&j(Error("The value for a submit binding must be a function"));b.a.n(a,"submit",function(b){var c,h=d();try{c=h.call(e,a)}finally{c!==m&&(b.preventDefault?b.preventDefault():b.returnValue=r)}})}};b.c.text={update:function(a,d){b.a.cb(a,d())}};b.e.I.text=m;b.c.uniqueName={init:function(a,d){if(d()){var c="ko_unique_"+ ++b.c.uniqueName.ob;b.a.ab(a,
4044
4045 c)}}};b.c.uniqueName.ob=0;b.c.value={init:function(a,d,c){function e(){h=r;var e=d(),f=b.k.q(a);b.g.ea(e,c,"value",f)}var f=["change"],g=c().valueUpdate,h=r;g&&("string"==typeof g&&(g=[g]),b.a.P(f,g),f=b.a.Ga(f));if(b.a.Z&&("input"==a.tagName.toLowerCase()&&"text"==a.type&&"off"!=a.autocomplete&&(!a.form||"off"!=a.form.autocomplete))&&-1==b.a.i(f,"propertychange"))b.a.n(a,"propertychange",function(){h=m}),b.a.n(a,"blur",function(){h&&e()});b.a.o(f,function(c){var d=e;b.a.Ob(c,"after")&&(d=function(){setTimeout(e,
4046
4047 0)},c=c.substring(5));b.a.n(a,c,d)})},update:function(a,d){var c="select"===b.a.u(a),e=b.a.d(d()),f=b.k.q(a),g=e!=f;0===e&&(0!==f&&"0"!==f)&&(g=m);g&&(f=function(){b.k.T(a,e)},f(),c&&setTimeout(f,0));c&&0<a.length&&ea(a,e,r)}};b.c.visible={update:function(a,d){var c=b.a.d(d()),e="none"!=a.style.display;c&&!e?a.style.display="":!c&&e&&(a.style.display="none")}};b.c.click={init:function(a,d,c,e){return b.c.event.init.call(this,a,function(){var a={};a.click=d();return a},c,e)}};b.v=function(){};b.v.prototype.renderTemplateSource=
4048
4049 function(){j(Error("Override renderTemplateSource"))};b.v.prototype.createJavaScriptEvaluatorBlock=function(){j(Error("Override createJavaScriptEvaluatorBlock"))};b.v.prototype.makeTemplateSource=function(a,d){if("string"==typeof a){d=d||y;var c=d.getElementById(a);c||j(Error("Cannot find template with ID "+a));return new b.l.h(c)}if(1==a.nodeType||8==a.nodeType)return new b.l.O(a);j(Error("Unknown template type: "+a))};b.v.prototype.renderTemplate=function(a,b,c,e){a=this.makeTemplateSource(a,e);
4050
4051 return this.renderTemplateSource(a,b,c)};b.v.prototype.isTemplateRewritten=function(a,b){return this.allowTemplateRewriting===r?m:this.makeTemplateSource(a,b).data("isRewritten")};b.v.prototype.rewriteTemplate=function(a,b,c){a=this.makeTemplateSource(a,c);b=b(a.text());a.text(b);a.data("isRewritten",m)};b.b("templateEngine",b.v);var qa=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi,ra=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;b.za={vb:function(a,
4052
4053 d,c){d.isTemplateRewritten(a,c)||d.rewriteTemplate(a,function(a){return b.za.Gb(a,d)},c)},Gb:function(a,b){return a.replace(qa,function(a,e,f,g,h,k,l){return W(l,e,b)}).replace(ra,function(a,e){return W(e,"\x3c!-- ko --\x3e",b)})},kb:function(a){return b.s.ra(function(d,c){d.nextSibling&&b.Fa(d.nextSibling,a,c)})}};b.b("__tr_ambtns",b.za.kb);b.l={};b.l.h=function(a){this.h=a};b.l.h.prototype.text=function(){var a=b.a.u(this.h),a="script"===a?"text":"textarea"===a?"value":"innerHTML";if(0==arguments.length)return this.h[a];
4054
4055 var d=arguments[0];"innerHTML"===a?b.a.ca(this.h,d):this.h[a]=d};b.l.h.prototype.data=function(a){if(1===arguments.length)return b.a.f.get(this.h,"templateSourceData_"+a);b.a.f.set(this.h,"templateSourceData_"+a,arguments[1])};b.l.O=function(a){this.h=a};b.l.O.prototype=new b.l.h;b.l.O.prototype.text=function(){if(0==arguments.length){var a=b.a.f.get(this.h,"__ko_anon_template__")||{};a.Aa===I&&a.ia&&(a.Aa=a.ia.innerHTML);return a.Aa}b.a.f.set(this.h,"__ko_anon_template__",{Aa:arguments[0]})};b.l.h.prototype.nodes=
4056
4057 function(){if(0==arguments.length)return(b.a.f.get(this.h,"__ko_anon_template__")||{}).ia;b.a.f.set(this.h,"__ko_anon_template__",{ia:arguments[0]})};b.b("templateSources",b.l);b.b("templateSources.domElement",b.l.h);b.b("templateSources.anonymousTemplate",b.l.O);var O;b.wa=function(a){a!=I&&!(a instanceof b.v)&&j(Error("templateEngine must inherit from ko.templateEngine"));O=a};b.va=function(a,d,c,e,f){c=c||{};(c.templateEngine||O)==I&&j(Error("Set a template engine before calling renderTemplate"));
4058
4059 f=f||"replaceChildren";if(e){var g=N(e);return b.j(function(){var h=d&&d instanceof b.z?d:new b.z(b.a.d(d)),k="function"==typeof a?a(h.$data,h):a,h=T(e,f,k,h,c);"replaceNode"==f&&(e=h,g=N(e))},p,{Ka:function(){return!g||!b.a.X(g)},W:g&&"replaceNode"==f?g.parentNode:g})}return b.s.ra(function(e){b.va(a,d,c,e,"replaceNode")})};b.Mb=function(a,d,c,e,f){function g(a,b){U(b,k);c.afterRender&&c.afterRender(b,a)}function h(d,e){k=f.createChildContext(b.a.d(d),c.as);k.$index=e;var g="function"==typeof a?
4060
4061 a(d,k):a;return T(p,"ignoreTargetNode",g,k,c)}var k;return b.j(function(){var a=b.a.d(d)||[];"undefined"==typeof a.length&&(a=[a]);a=b.a.fa(a,function(a){return c.includeDestroyed||a===I||a===p||!b.a.d(a._destroy)});b.r.K(b.a.$a,p,[e,a,h,c,g])},p,{W:e})};b.c.template={init:function(a,d){var c=b.a.d(d());if("string"!=typeof c&&!c.name&&(1==a.nodeType||8==a.nodeType))c=1==a.nodeType?a.childNodes:b.e.childNodes(a),c=b.a.Hb(c),(new b.l.O(a)).nodes(c);return{controlsDescendantBindings:m}},update:function(a,
4062
4063 d,c,e,f){d=b.a.d(d());c={};e=m;var g,h=p;"string"!=typeof d&&(c=d,d=c.name,"if"in c&&(e=b.a.d(c["if"])),e&&"ifnot"in c&&(e=!b.a.d(c.ifnot)),g=b.a.d(c.data));"foreach"in c?h=b.Mb(d||a,e&&c.foreach||[],c,a,f):e?(f="data"in c?f.createChildContext(g,c.as):f,h=b.va(d||a,f,c,a)):b.e.Y(a);f=h;(g=b.a.f.get(a,"__ko__templateComputedDomDataKey__"))&&"function"==typeof g.B&&g.B();b.a.f.set(a,"__ko__templateComputedDomDataKey__",f&&f.pa()?f:I)}};b.g.Q.template=function(a){a=b.g.aa(a);return 1==a.length&&a[0].unknown||
4064
4065 b.g.Eb(a,"name")?p:"This template engine does not support anonymous templates nested within its templates"};b.e.I.template=m;b.b("setTemplateEngine",b.wa);b.b("renderTemplate",b.va);b.a.Ja=function(a,b,c){a=a||[];b=b||[];return a.length<=b.length?S(a,b,"added","deleted",c):S(b,a,"deleted","added",c)};b.b("utils.compareArrays",b.a.Ja);b.a.$a=function(a,d,c,e,f){function g(a,b){t=l[b];w!==b&&(z[a]=t);t.na(w++);M(t.M);s.push(t);A.push(t)}function h(a,c){if(a)for(var d=0,e=c.length;d<e;d++)c[d]&&b.a.o(c[d].M,
4066
4067 function(b){a(b,d,c[d].U)})}d=d||[];e=e||{};var k=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")===I,l=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")||[],n=b.a.V(l,function(a){return a.U}),q=b.a.Ja(n,d),s=[],v=0,w=0,B=[],A=[];d=[];for(var z=[],n=[],t,D=0,C,E;C=q[D];D++)switch(E=C.moved,C.status){case "deleted":E===I&&(t=l[v],t.j&&t.j.B(),B.push.apply(B,M(t.M)),e.beforeRemove&&(d[D]=t,A.push(t)));v++;break;case "retained":g(D,v++);break;case "added":E!==I?
4068
4069 g(D,E):(t={U:C.value,na:b.m(w++)},s.push(t),A.push(t),k||(n[D]=t))}h(e.beforeMove,z);b.a.o(B,e.beforeRemove?b.A:b.removeNode);for(var D=0,k=b.e.firstChild(a),H;t=A[D];D++){t.M||b.a.extend(t,ha(a,c,t.U,f,t.na));for(v=0;q=t.M[v];k=q.nextSibling,H=q,v++)q!==k&&b.e.Pa(a,q,H);!t.Ab&&f&&(f(t.U,t.M,t.na),t.Ab=m)}h(e.beforeRemove,d);h(e.afterMove,z);h(e.afterAdd,n);b.a.f.set(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult",s)};b.b("utils.setDomNodeChildrenFromArrayMapping",b.a.$a);b.C=function(){this.allowTemplateRewriting=
4070
4071 r};b.C.prototype=new b.v;b.C.prototype.renderTemplateSource=function(a){var d=!(9>b.a.Z)&&a.nodes?a.nodes():p;if(d)return b.a.L(d.cloneNode(m).childNodes);a=a.text();return b.a.ta(a)};b.C.oa=new b.C;b.wa(b.C.oa);b.b("nativeTemplateEngine",b.C);b.qa=function(){var a=this.Db=function(){if("undefined"==typeof F||!F.tmpl)return 0;try{if(0<=F.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&j(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));
4072
4073 var f=b.data("precompiled");f||(f=b.text()||"",f=F.template(p,"{{ko_with $item.koBindingContext}}"+f+"{{/ko_with}}"),b.data("precompiled",f));b=[c.$data];c=F.extend({koBindingContext:c},e.templateOptions);c=F.tmpl(f,b,c);c.appendTo(y.createElement("div"));F.fragments={};return c};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){y.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(F.tmpl.tag.ko_code=
4074
4075 {open:"__.push($1 || '');"},F.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};b.qa.prototype=new b.v;w=new b.qa;0<w.Db&&b.wa(w);b.b("jqueryTmplTemplateEngine",b.qa)}"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?L(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],L):L(x.ko={});m;
4076
4077 })();
4078
4079 </script>
4080
4081<?php endif; ?>
4082
4083
4084
4085<script type="text/javascript">
4086
4087/* json2.js
4088
4089 * See www.JSON.org/js.html*/
4090
4091if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
4092
4093Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+
4094
4095f(this.getUTCMonth()+1)+'-'+
4096
4097f(this.getUTCDate())+'T'+
4098
4099f(this.getUTCHours())+':'+
4100
4101f(this.getUTCMinutes())+':'+
4102
4103f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case'string':return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c;}
4104
4105c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+
4106
4107(c%16).toString(16);})+'"':'"'+value+'"';case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
4108
4109if(typeof value.toJSON==='function'){return stringify(value.toJSON());}
4110
4111a=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||'null');}
4112
4113return'['+a.join(',')+']';}
4114
4115if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}else{for(k in value){if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}
4116
4117return'{'+a.join(',')+'}';}}
4118
4119return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==='object'){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n;}}}}
4120
4121return filter(k,v);}
4122
4123if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof filter==='function'?walk('',j):j;}
4124
4125throw new SyntaxError('parseJSON');}};}();}
4126
4127</script>
4128
4129
4130
4131<script type="text/javascript">
4132
4133/**
4134
4135 * password_strength_plugin.js
4136
4137 * Copyright (c) 20010 myPocket technologies (www.mypocket-technologies.com)
4138
4139 * @author Darren Mason (djmason9@gmail.com)
4140
4141 * @date 3/13/2009
4142
4143 * @projectDescription Password Strength Meter is a jQuery plug-in provide you smart algorithm to detect a password strength.
4144
4145 * Based on Firas Kassem orginal plugin - phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/
4146
4147 * @version 1.0.1 */
4148
4149(function(a){a.fn.shortPass="Too short";a.fn.badPass="Weak";a.fn.goodPass="Good";a.fn.strongPass="Strong";a.fn.samePassword="Username and Password identical.";a.fn.resultStyle="";a.fn.passStrength=function(b){var d={shortPass:"shortPass",badPass:"badPass",goodPass:"goodPass",strongPass:"strongPass",baseStyle:"testresult",userid:"",messageloc:1};
4150
4151var c=a.extend(d,b);return this.each(function(){var e=a(this);a(e).unbind().keyup(function(){var f=a.fn.teststrength(a(this).val(),a(c.userid).val(),c);if(c.messageloc===1){a(this).next("."+c.baseStyle).remove();a(this).after('<span class="'+c.baseStyle+'"><span></span></span>');a(this).next("."+c.baseStyle).addClass(a(this).resultStyle).find("span").text(f)
4152
4153}else{a(this).prev("."+c.baseStyle).remove();a(this).before('<span class="'+c.baseStyle+'"><span></span></span>');a(this).prev("."+c.baseStyle).addClass(a(this).resultStyle).find("span").text(f)}});a.fn.teststrength=function(f,i,g){var h=0;if(f.length<4){this.resultStyle=g.shortPass;return a(this).shortPass
4154
4155}if(f.toLowerCase()==i.toLowerCase()){this.resultStyle=g.badPass;return a(this).samePassword}h+=f.length*4;h+=(a.fn.checkRepetition(1,f).length-f.length)*1;h+=(a.fn.checkRepetition(2,f).length-f.length)*1;h+=(a.fn.checkRepetition(3,f).length-f.length)*1;h+=(a.fn.checkRepetition(4,f).length-f.length)*1;
4156
4157if(f.match(/(.*[0-9].*[0-9].*[0-9])/)){h+=5}if(f.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){h+=5}if(f.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){h+=10}if(f.match(/([a-zA-Z])/)&&f.match(/([0-9])/)){h+=15}if(f.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&f.match(/([0-9])/)){h+=15}if(f.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&f.match(/([a-zA-Z])/)){h+=15
4158
4159}if(f.match(/^\w+$/)||f.match(/^\d+$/)){h-=10}if(h<0){h=0}if(h>100){h=100}if(h<34){this.resultStyle=g.badPass;return a(this).badPass}if(h<68){this.resultStyle=g.goodPass;return a(this).goodPass}this.resultStyle=g.strongPass;return a(this).strongPass}})}})(jQuery);$.fn.checkRepetition=function(a,f){var d="";
4160
4161for(var c=0;c<f.length;c++){var e=true;for(var b=0;b<a&&(b+c+a)<f.length;b++){e=e&&(f.charAt(b+c)==f.charAt(b+c+a))}if(b<a){e=false}if(e){c+=a-1;e=false}else{d+=f.charAt(c)}}return d};
4162
4163</script>
4164
4165
4166
4167
4168
4169<script type="text/javascript">
4170
4171/* Parsley dist/parsley.min.js build version 1.2.2 http://parsleyjs.org */
4172
4173!function(d){var h=function(a){this.messages={defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",urlstrict:"This value should be a valid url.",number:"This value should be a valid number.",digits:"This value should be digits.",dateIso:"This value should be a valid date (YYYY-MM-DD).",alphanum:"This value should be alphanumeric.",phone:"This value should be a valid phone number."},notnull:"This value should not be null.",
4174
4175notblank:"This value should not be blank.",required:"This value is required.",regexp:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or less.",rangelength:"This value length is invalid. It should be between %s and %s characters long.",
4176
4177mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or less.",rangecheck:"You must select between %s and %s choices.",equalto:"This value should be the same."};this.init(a)};h.prototype={constructor:h,validators:{notnull:function(){return{validate:function(a){return 0<a.length},priority:2}},notblank:function(){return{validate:function(a){return"string"===typeof a&&""!==a.replace(/^\s+/g,"").replace(/\s+$/g,"")},priority:2}},required:function(){var a=this;return{validate:function(b){if("object"===
4178
4179typeof b){for(var c in b)if(a.required().validate(b[c]))return!0;return!1}return a.notnull().validate(b)&&a.notblank().validate(b)},priority:512}},type:function(){return{validate:function(a,b){var c;switch(b){case "number":c=/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/;break;case "digits":c=/^\d+$/;break;case "alphanum":c=/^\w+$/;break;case "email":c=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))){2,6}$/i;
4180
4181break;case "url":a=/(https?|s?ftp|git)/i.test(a)?a:"http://"+a;case "urlstrict":c=/^(https?|s?ftp|git):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
4182
4183break;case "dateIso":c=/^(\d{4})\D?(0[1-9]|1[0-2])\D?([12]\d|0[1-9]|3[01])$/;break;case "phone":c=/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/;break;default:return!1}return""!==a?c.test(a):!1},priority:256}},regexp:function(){return{validate:function(a,b,c){return RegExp(b,c.options.regexpFlag||"").test(a)},priority:64}},minlength:function(){return{validate:function(a,b){return a.length>=b},priority:32}},maxlength:function(){return{validate:function(a,
4184
4185b){return a.length<=b},priority:32}},rangelength:function(){var a=this;return{validate:function(b,c){return a.minlength().validate(b,c[0])&&a.maxlength().validate(b,c[1])},priority:32}},min:function(){return{validate:function(a,b){return Number(a)>=b},priority:32}},max:function(){return{validate:function(a,b){return Number(a)<=b},priority:32}},range:function(){var a=this;return{validate:function(b,c){return a.min().validate(b,c[0])&&a.max().validate(b,c[1])},priority:32}},equalto:function(){return{validate:function(a,
4186
4187b,c){c.options.validateIfUnchanged=!0;return a===d(b).val()},priority:64}},remote:function(){return{validate:function(a,b,c){var e={},f={};e[c.$element.attr("name")]=a;"undefined"!==typeof c.options.remoteDatatype&&(f={dataType:c.options.remoteDatatype});var g=function(a,b){"undefined"!==typeof b&&("undefined"!==typeof c.Validator.messages.remote&&b!==c.Validator.messages.remote)&&d(c.UI.ulError+" .remote").remove();if(!1===a)c.options.listeners.onFieldError(c.element,c.constraints,c);else!0===a&&
4188
4189!1===c.options.listeners.onFieldSuccess(c.element,c.constraints,c)&&(a=!1);c.updtConstraint({name:"remote",valid:a},b);c.manageValidationResult()},k=function(a){if("object"===typeof a)return a;try{a=d.parseJSON(a)}catch(b){}return a},l=function(a){return"object"===typeof a&&null!==a?"undefined"!==typeof a.error?a.error:"undefined"!==typeof a.message?a.message:null:null};d.ajax(d.extend({},{url:b,data:e,type:c.options.remoteMethod||"GET",success:function(a){a=k(a);g(1===a||!0===a||"object"===typeof a&&
4190
4191null!==a&&"undefined"!==typeof a.success,l(a))},error:function(a){a=k(a);g(!1,l(a))}},f));return null},priority:64}},mincheck:function(){var a=this;return{validate:function(b,c){return a.minlength().validate(b,c)},priority:32}},maxcheck:function(){var a=this;return{validate:function(b,c){return a.maxlength().validate(b,c)},priority:32}},rangecheck:function(){var a=this;return{validate:function(b,c){return a.rangelength().validate(b,c)},priority:32}}},init:function(a){var b=a.validators;a=a.messages;
4192
4193for(var c in b)this.addValidator(c,b[c]);for(c in a)this.addMessage(c,a[c])},formatMesssage:function(a,b){if("object"===typeof b){for(var c in b)a=this.formatMesssage(a,b[c]);return a}return"string"===typeof a?a.replace(/%s/i,b):""},addValidator:function(a,b){if("undefined"===typeof b().validate)throw Error("Validator `"+a+"` must have a validate method. See more here: http://parsleyjs.org/documentation.html#javascript-general");"undefined"===typeof b().priority&&(b={validate:b().validate,priority:32},
4194
4195window.console&&window.console.warn&&window.console.warn("Validator `"+a+"` should have a priority. Default priority 32 given"));this.validators[a]=b},addMessage:function(a,b,c){if("undefined"!==typeof c&&!0===c)this.messages.type[a]=b;else if("type"===a)for(var d in b)this.messages.type[d]=b[d];else this.messages[a]=b}};var n=function(a){this.init(a)};n.prototype={constructor:n,init:function(a){this.ParsleyInstance=a;this.hash=a.hash;this.options=this.ParsleyInstance.options;this.errorClassHandler=
4196
4197this.options.errors.classHandler(this.ParsleyInstance.element,this.ParsleyInstance.isRadioOrCheckbox)||this.ParsleyInstance.$element;this.ulErrorManagement()},ulErrorManagement:function(){this.ulError="#"+this.hash;this.ulTemplate=d(this.options.errors.errorsWrapper).attr("id",this.hash).addClass("parsley-error-list")},removeError:function(a){a=this.ulError+" ."+a;var b=this;this.options.animate?d(a).fadeOut(this.options.animateDuration,function(){d(this).remove();b.ulError&&0===d(b.ulError).children().length&&
4198
4199b.removeErrors()}):d(a).remove()},addError:function(a){for(var b in a){var c=d(this.options.errors.errorElem).addClass(b);d(this.ulError).append(this.options.animate?d(c).html(a[b]).hide().fadeIn(this.options.animateDuration):d(c).html(a[b]))}},removeErrors:function(){this.options.animate?d(this.ulError).fadeOut(this.options.animateDuration,function(){d(this).remove()}):d(this.ulError).remove()},reset:function(){this.ParsleyInstance.valid=null;this.removeErrors();this.ParsleyInstance.validatedOnce=
4200
4201!1;this.errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);for(var a in this.constraints)this.constraints[a].valid=null;return this},manageError:function(a){d(this.ulError).length||this.manageErrorContainer();if(!("required"===a.name&&null!==this.ParsleyInstance.getVal()&&0<this.ParsleyInstance.getVal().length))if(this.ParsleyInstance.isRequired&&"required"!==a.name&&(null===this.ParsleyInstance.getVal()||0===this.ParsleyInstance.getVal().length))this.removeError(a.name);
4202
4203else{var b=a.name,c=!1!==this.options.errorMessage?"custom-error-message":b,e={};a=!1!==this.options.errorMessage?this.options.errorMessage:"type"===a.name?this.ParsleyInstance.Validator.messages[b][a.requirements]:"undefined"===typeof this.ParsleyInstance.Validator.messages[b]?this.ParsleyInstance.Validator.messages.defaultMessage:this.ParsleyInstance.Validator.formatMesssage(this.ParsleyInstance.Validator.messages[b],a.requirements);d(this.ulError+" ."+c).length||(e[c]=a,this.addError(e))}},manageErrorContainer:function(){var a=
4204
4205this.options.errorContainer||this.options.errors.container(this.ParsleyInstance.element,this.ParsleyInstance.isRadioOrCheckbox),b=this.options.animate?this.ulTemplate.css("display",""):this.ulTemplate;"undefined"!==typeof a?d(a).append(b):!this.ParsleyInstance.isRadioOrCheckbox?this.ParsleyInstance.$element.after(b):this.ParsleyInstance.$element.parent().after(b)}};var m=function(a,b,c){this.options=b;if("ParsleyFieldMultiple"===c)return this;this.init(a,c||"ParsleyField")};m.prototype={constructor:m,
4206
4207init:function(a,b){this.type=b;this.valid=!0;this.element=a;this.validatedOnce=!1;this.$element=d(a);this.val=this.$element.val();this.Validator=new h(this.options);this.isRequired=!1;this.constraints={};"undefined"===typeof this.isRadioOrCheckbox&&(this.isRadioOrCheckbox=!1,this.hash=this.generateHash());this.UI=new n(this);this.bindHtml5Constraints();this.addConstraints();this.hasConstraints()&&this.bindValidationEvents()},setParent:function(a){this.$parent=d(a)},getParent:function(){return this.$parent},
4208
4209bindHtml5Constraints:function(){if(this.$element.hasClass("required")||this.$element.attr("required"))this.options.required=!0;var a=this.$element.attr("type");"undefined"!==typeof a&&RegExp(a,"i").test("email url number range tel")&&(this.options.type="tel"===a?"phone":a,RegExp(this.options.type,"i").test("number range")&&(this.options.type="number","undefined"!==typeof this.$element.attr("min")&&this.$element.attr("min").length&&(this.options.min=this.$element.attr("min")),"undefined"!==typeof this.$element.attr("max")&&
4210
4211this.$element.attr("max").length&&(this.options.max=this.$element.attr("max"))));"string"===typeof this.$element.attr("pattern")&&this.$element.attr("pattern").length&&(this.options.regexp=this.$element.attr("pattern"))},addConstraints:function(){for(var a in this.options){var b={};b[a]=this.options[a];this.addConstraint(b,!0,!1)}},addConstraint:function(a,b,c){for(var d in a)d=d.toLowerCase(),"function"===typeof this.Validator.validators[d]&&(this.constraints[d]={name:d,requirements:a[d],valid:null},
4212
4213"required"===d&&(this.isRequired=!0),this.addCustomConstraintMessage(d));"undefined"===typeof b&&this.bindValidationEvents()},updateConstraint:function(a,b){for(var c in a)this.updtConstraint({name:c,requirements:a[c],valid:null},b)},updtConstraint:function(a,b){this.constraints[a.name]=d.extend(!0,this.constraints[a.name],a);"string"===typeof b&&(this.Validator.messages[a.name]=b);this.bindValidationEvents()},removeConstraint:function(a){a=a.toLowerCase();delete this.constraints[a];"required"===
4214
4215a&&(this.isRequired=!1);this.hasConstraints()?this.bindValidationEvents():this.UI.reset()},addCustomConstraintMessage:function(a){var b=a+("type"===a&&"undefined"!==typeof this.options[a]?this.options[a].charAt(0).toUpperCase()+this.options[a].substr(1):"")+"Message";"undefined"!==typeof this.options[b]&&this.Validator.addMessage("type"===a?this.options[a]:a,this.options[b],"type"===a)},bindValidationEvents:function(){this.valid=null;this.$element.addClass("parsley-validated");this.$element.off("."+
4216
4217this.type);this.options.remote&&!/change/i.test(this.options.trigger)&&(this.options.trigger=!this.options.trigger?"change":" change");var a=(!this.options.trigger?"":this.options.trigger)+(/key/i.test(this.options.trigger)?"":" keyup");this.$element.is("select")&&(a+=/change/i.test(a)?"":" change");a=a.replace(/^\s+/g,"").replace(/\s+$/g,"");this.$element.on((a+" ").split(" ").join("."+this.type+" "),!1,d.proxy(this.eventValidation,this))},generateHash:function(){return"parsley-"+(Math.random()+
4218
4219"").substring(2)},getHash:function(){return this.hash},getVal:function(){return"undefined"!==typeof this.$element.domApi(this.options.namespace).value?this.$element.domApi(this.options.namespace).value:this.$element.val()},eventValidation:function(a){var b=this.getVal();if("keyup"===a.type&&!/keyup/i.test(this.options.trigger)&&!this.validatedOnce||"change"===a.type&&!/change/i.test(this.options.trigger)&&!this.validatedOnce||!this.isRadioOrCheckbox&&this.getLength(b)<this.options.validationMinlength&&
4220
4221!this.validatedOnce)return!0;this.validate()},getLength:function(a){return!a||!a.hasOwnProperty("length")?0:a.length},isValid:function(){return this.validate(!1)},hasConstraints:function(){for(var a in this.constraints)return!0;return!1},validate:function(a){var b=this.getVal(),c=null;if(!this.hasConstraints()||this.$element.is(this.options.excluded))return null;if(this.options.listeners.onFieldValidate(this.element,this)||""===b&&!this.isRequired)return this.UI.reset(),null;if(!this.needsValidation(b))return this.valid;
4222
4223c=this.applyValidators();("undefined"!==typeof a?a:this.options.showErrors)&&this.manageValidationResult();return c},needsValidation:function(a){if(!this.options.validateIfUnchanged&&null!==this.valid&&this.val===a&&this.validatedOnce)return!1;this.val=a;return this.validatedOnce=!0},applyValidators:function(){var a=null,b;for(b in this.constraints){var c=this.Validator.validators[this.constraints[b].name]().validate(this.val,this.constraints[b].requirements,this);!1===c?(a=!1,this.constraints[b].valid=
4224
4225a):!0===c&&(this.constraints[b].valid=!0,a=!1!==a)}if(!1===a)this.options.listeners.onFieldError(this.element,this.constraints,this);else!0===a&&!1===this.options.listeners.onFieldSuccess(this.element,this.constraints,this)&&(a=!1);return a},manageValidationResult:function(){var a=null,b=[],c;for(c in this.constraints)!1===this.constraints[c].valid?(b.push(this.constraints[c]),a=!1):!0===this.constraints[c].valid&&(this.UI.removeError(this.constraints[c].name),a=!1!==a);this.valid=a;if(!0===this.valid)return this.UI.removeErrors(),
4226
4227this.UI.errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass),!0;if(!1===this.valid){if(!0===this.options.priorityEnabled){for(var a=0,e,f=0;f<b.length;f++)e=this.Validator.validators[b[f].name]().priority,e>a&&(c=b[f],a=e);this.UI.manageError(c)}else for(f=0;f<b.length;f++)this.UI.manageError(b[f]);this.UI.errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);return!1}this.UI.ulError&&0===d(this.ulError).children().length&&
4228
4229this.UI.removeErrors();return a},addListener:function(a){for(var b in a)this.options.listeners[b]=a[b]},destroy:function(){this.$element.removeClass("parsley-validated");this.UI.reset();this.$element.off("."+this.type).removeData(this.type)}};var p=function(a,b,c){this.initMultiple(a,b);this.inherit(a,b);this.Validator=new h(b);this.init(a,c||"ParsleyFieldMultiple")};p.prototype={constructor:p,initMultiple:function(a,b){this.element=a;this.$element=d(a);this.group=b.group||!1;this.hash=this.getName();
4230
4231this.siblings=this.group?'[parsley-group="'+this.group+'"]':'input[name="'+this.$element.attr("name")+'"]';this.isRadioOrCheckbox=!0;this.isRadio=this.$element.is("input[type=radio]");this.isCheckbox=this.$element.is("input[type=checkbox]");this.errorClassHandler=b.errors.classHandler(a,this.isRadioOrCheckbox)||this.$element.parent()},inherit:function(a,b){var c=new m(a,b,"ParsleyFieldMultiple"),d;for(d in c)"undefined"===typeof this[d]&&(this[d]=c[d])},getName:function(){if(this.group)return"parsley-"+
4232
4233this.group;if("undefined"===typeof this.$element.attr("name"))throw"A radio / checkbox input must have a parsley-group attribute or a name to be Parsley validated !";return"parsley-"+this.$element.attr("name").replace(/(:|\.|\[|\])/g,"")},getVal:function(){if(this.isRadio)return d(this.siblings+":checked").val()||"";if(this.isCheckbox){var a=[];d(this.siblings+":checked").each(function(){a.push(d(this).val())});return a}},bindValidationEvents:function(){this.valid=null;this.$element.addClass("parsley-validated");
4234
4235this.$element.off("."+this.type);var a=this,b=(!this.options.trigger?"":this.options.trigger)+(/change/i.test(this.options.trigger)?"":" change"),b=b.replace(/^\s+/g,"").replace(/\s+$/g,"");d(this.siblings).each(function(){d(this).on(b.split(" ").join("."+a.type+" "),!1,d.proxy(a.eventValidation,a))})}};var q=function(a,b,c){this.init(a,b,c||"parsleyForm")};q.prototype={constructor:q,init:function(a,b,c){this.type=c;this.items=[];this.$element=d(a);this.options=b;var e=this;this.$element.find(b.inputs).each(function(){e.addItem(this)});
4236
4237this.$element.on("submit."+this.type,!1,d.proxy(this.validate,this))},addListener:function(a){for(var b in a)if(/Field/.test(b))for(var c=0;c<this.items.length;c++)this.items[c].addListener(a);else this.options.listeners[b]=a[b]},addItem:function(a){if(d(a).is(this.options.excluded))return!1;a=d(a).parsley(this.options);a.setParent(this);this.items.push(a)},removeItem:function(a){a=d(a).parsley();for(var b=0;b<this.items.length;b++)if(this.items[b].hash===a.hash)return this.items[b].destroy(),this.items.splice(b,
4238
42391),!0;return!1},validate:function(a){var b=!0;this.focusedField=!1;for(var c=0;c<this.items.length;c++)if("undefined"!==typeof this.items[c]&&!1===this.items[c].validate()&&(b=!1,!this.focusedField&&"first"===this.options.focus||"last"===this.options.focus))this.focusedField=this.items[c].$element;if(this.focusedField&&!b)if(0<this.options.scrollDuration){var e=this,c=this.focusedField.offset().top-d(window).height()/2;d("html, body").animate({scrollTop:c},this.options.scrollDuration,function(){e.focusedField.focus()})}else this.focusedField.focus();
4240
4241a=this.options.listeners.onFormValidate(b,a,this);return"undefined"!==typeof a?a:b},isValid:function(){for(var a=0;a<this.items.length;a++)if(!1===this.items[a].isValid())return!1;return!0},removeErrors:function(){for(var a=0;a<this.items.length;a++)this.items[a].parsley("reset")},destroy:function(){for(var a=0;a<this.items.length;a++)this.items[a].destroy();this.$element.off("."+this.type).removeData(this.type)},reset:function(){for(var a=0;a<this.items.length;a++)this.items[a].UI.reset()}};d.fn.parsley=
4242
4243function(a,b){function c(b,c){var e=d(b).data(c);if(!e){switch(c){case "parsleyForm":e=new q(b,f,"parsleyForm");break;case "parsleyField":e=new m(b,f,"parsleyField");break;case "parsleyFieldMultiple":e=new p(b,f,"parsleyFieldMultiple");break;default:return}d(b).data(c,e)}return"string"===typeof a&&"function"===typeof e[a]?(e=e[a].apply(e,k),"undefined"!==typeof e?e:d(b)):e}var e=d(this).data("parsleyNamespace")?d(this).data("parsleyNamespace"):"undefined"!==typeof a&&"undefined"!==typeof a.namespace?
4244
4245a.namespace:d.fn.parsley.defaults.namespace,f=d.extend(!0,{},d.fn.parsley.defaults,"undefined"!==typeof window.ParsleyConfig?window.ParsleyConfig:{},a,this.domApi(e)),g=null,k=Array.prototype.slice.call(arguments,1);d(this).is("form")||"undefined"!==typeof d(this).domApi(e).bind?g=c(d(this),"parsleyForm"):d(this).is(f.inputs)&&(g=c(d(this),!d(this).is("input[type=radio], input[type=checkbox]")?"parsleyField":"parsleyFieldMultiple"));return"function"===typeof b?b():g};d(window).on("load",function(){d("[parsley-validate], [data-parsley-validate]").each(function(){d(this).parsley()})});
4246
4247d.fn.domApi=function(a){var b,c={},e=RegExp("^"+a,"i");if("undefined"===typeof this[0])return{};for(var f in this[0].attributes)if(b=this[0].attributes[f],null!==b&&b.specified&&e.test(b.name)){var g=c,k=r(b.name.replace(a,"")),l;b=b.value;var h=void 0;try{l=b?"true"==b||("false"==b?!1:"null"==b?null:!isNaN(h=Number(b))?h:/^[\[\{]/.test(b)?d.parseJSON(b):b):b}catch(m){l=b}g[k]=l}return c};var r=function(a){return a.replace(/-+(.)?/g,function(a,c){return c?c.toUpperCase():""})};d.fn.parsley.defaults=
4248
4249{namespace:"parsley-",inputs:"input, textarea, select",excluded:"input[type=hidden], input[type=file], :disabled",priorityEnabled:!0,trigger:!1,animate:!0,animateDuration:300,scrollDuration:500,focus:"first",validationMinlength:3,successClass:"parsley-success",errorClass:"parsley-error",errorMessage:!1,validators:{},showErrors:!0,messages:{},validateIfUnchanged:!1,errors:{classHandler:function(a,b){},container:function(a,b){},errorsWrapper:"<ul></ul>",errorElem:"<li></li>"},listeners:{onFieldValidate:function(a,
4250
4251b){return!1},onFormValidate:function(a,b,c){},onFieldError:function(a,b,c){},onFieldSuccess:function(a,b,c){}}}}(window.jQuery||window.Zepto);
4252
4253</script>
4254
4255 <?php
4256
4257 // Exit if accessed directly
4258
4259 if (! defined('DUPLICATOR_INIT')) {
4260
4261 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
4262
4263 $_baseURL = "http://" . $_baseURL;
4264
4265 header("HTTP/1.1 301 Moved Permanently");
4266
4267 header("Location: $_baseURL");
4268
4269 exit;
4270
4271 }
4272
4273?>
4274
4275
4276
4277<script type="text/javascript">
4278
4279 //Unique namespace
4280
4281 Duplicator = new Object();
4282
4283
4284
4285 Duplicator.showProgressBar = function () {
4286
4287 Duplicator.animateProgressBar('progress-bar');
4288
4289 $('#ajaxerr-area').hide();
4290
4291 $('#progress-area').show();
4292
4293 }
4294
4295 Duplicator.hideProgressBar = function () {
4296
4297 $('#progress-area').hide(100);
4298
4299 $('#ajaxerr-area').fadeIn(400);
4300
4301 }
4302
4303 Duplicator.animateProgressBar = function(id) {
4304
4305 //Create Progress Bar
4306
4307 var $mainbar = $("#" + id);
4308
4309 $mainbar.progressbar({ value: 100 });
4310
4311 $mainbar.height(25);
4312
4313 runAnimation($mainbar);
4314
4315
4316
4317 function runAnimation($pb) {
4318
4319 $pb.css({ "padding-left": "0%", "padding-right": "90%" });
4320
4321 $pb.progressbar("option", "value", 100);
4322
4323 $pb.animate({ paddingLeft: "90%", paddingRight: "0%" }, 3500, "linear", function () { runAnimation($pb); });
4324
4325 }
4326
4327 }
4328
4329
4330
4331
4332
4333 Duplicator.toggleMetaBox = function() {
4334
4335 var $title = jQuery(this);
4336
4337 var $panel = $title.parent().find('.dup-box-panel');
4338
4339 var $arrow = $title.parent().find('.dup-box-arrow');
4340
4341 var value = $panel.is(":visible") ? 0 : 1;
4342
4343 $panel.toggle();
4344
4345 (value) ? $arrow.html('-') : $arrow.html('+');
4346
4347 }
4348
4349
4350
4351 $(document).ready(function() {
4352
4353 //ATTACHED EVENTS
4354
4355 $('#dup-hlp-lnk').change(function() {
4356
4357 if ($(this).val() != "null")
4358
4359 window.open($(this).val())
4360
4361 });
4362
4363
4364
4365 //Init: Toggle MetaBoxes
4366
4367 $('div.dup-box div.dup-box-title').each(function() {
4368
4369 var $title = $(this);
4370
4371 var $panel = $title.parent().find('.dup-box-panel');
4372
4373 var $arrow = $title.find('.dup-box-arrow');
4374
4375 $title.click(Duplicator.toggleMetaBox);
4376
4377 ($panel.is(":visible")) ? $arrow.html('-') : $arrow.html('+');
4378
4379 });
4380
4381
4382
4383 });
4384
4385</script>
4386
4387
4388
4389</head>
4390
4391<body>
4392
4393
4394
4395<div id="content">
4396
4397 <!-- =========================================
4398
4399 HEADER TEMPLATE: Common header on all steps -->
4400
4401 <table cellspacing="0" class="header-wizard">
4402
4403 <tr>
4404
4405 <td style="width:100%;">
4406
4407 <div style="font-size:22px; padding:5px 0px 0px 0px">
4408
4409 <!-- !!DO NOT CHANGE/EDIT OR REMOVE PRODUCT NAME!!
4410
4411 If your interested in Private Label Rights please contact us at the URL below to discuss
4412
4413 customizations to product labeling: http://lifeinthegrid.com -->
4414
4415 Duplicator - Installer
4416
4417 </div>
4418
4419 </td>
4420
4421 <td style="white-space:nowrap; text-align:right">
4422
4423 <select id="dup-hlp-lnk">
4424
4425 <option value="null"> - Online Resources -</option>
4426
4427 <option value="http://lifeinthegrid.com/duplicator-docs">» Knowledge Base</option>
4428
4429 <option value="http://lifeinthegrid.com/duplicator-guide">» User Guide</option>
4430
4431 <option value="http://lifeinthegrid.com/duplicator-faq">» Common FAQs</option>
4432
4433 <option value="http://lifeinthegrid.com/duplicator-hosts">» Approved Hosts</option>
4434
4435 </select>
4436
4437 </td>
4438
4439 </tr>
4440
4441 <tr>
4442
4443 <td>
4444
4445
4446
4447 <?php if (isset($_GET['help'])) :?>
4448
4449 <div style="margin:4px 0px 10px 15px; font-size:18px">
4450
4451 Help Overview
4452
4453 </div>
4454
4455 <?php else : ?>
4456
4457 <?php
4458
4459 $step1CSS = ($_POST['action_step'] <= 1) ? "active-step" : "complete-step";
4460
4461 $step2CSS = ($_POST['action_step'] == 2) ? "active-step" : "";
4462
4463
4464
4465 $step3CSS = "";
4466
4467 if ($_POST['action_step'] == 3) {
4468
4469 $step2CSS = "complete-step";
4470
4471 $step3CSS = "active-step";
4472
4473 }
4474
4475 ?>
4476
4477 <div id="dup-wiz">
4478
4479 <div id="dup-wiz-steps">
4480
4481 <div class="<?php echo $step1CSS; ?>"><a><span>1</span> Deploy</a></div>
4482
4483 <div class="<?php echo $step2CSS; ?>"><a><span>2</span> Update </a></div>
4484
4485 <div class="<?php echo $step3CSS; ?>"><a><span>3</span> Test </a></div>
4486
4487 </div>
4488
4489 </div>
4490
4491 <?php endif; ?>
4492
4493
4494
4495 </td>
4496
4497 <td style="white-space:nowrap">
4498
4499
4500
4501 <i style='font-size:11px; color:#999'>
4502
4503 version: <?php echo $GLOBALS['FW_DUPLICATOR_VERSION'] ?> <a href="installer.php?help=1" target="_blank">[Help]</a>
4504
4505 </i>
4506
4507
4508
4509 </td>
4510
4511 </tr>
4512
4513 </table>
4514
4515
4516
4517 <!-- =========================================
4518
4519 FORM DATA: Data Steps -->
4520
4521 <div id="content-inner">
4522
4523<?php
4524
4525
4526
4527if (! isset($_GET['help'])) {
4528
4529switch ($_POST['action_step']) {
4530
4531 case "1" :
4532
4533 ?> <?php
4534
4535 // Exit if accessed directly
4536
4537 if (! defined('DUPLICATOR_INIT')) {
4538
4539 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
4540
4541 $_baseURL = "http://" . $_baseURL;
4542
4543 header("HTTP/1.1 301 Moved Permanently");
4544
4545 header("Location: $_baseURL");
4546
4547 exit;
4548
4549 }
4550
4551 //DETECT ARCHIVE FILES
4552
4553 $zip_file_name = "No package file found";
4554
4555 $zip_file_count = 0;
4556
4557 foreach (glob("*.zip") as $filename) {
4558
4559 $zip_file_name = $filename;
4560
4561 $zip_file_count++;
4562
4563 }
4564
4565 if ($zip_file_count > 1) {
4566
4567 $zip_file_name = "Too many zip files in directory";
4568
4569 }
4570
4571
4572
4573 $req01a = @is_writeable($GLOBALS["CURRENT_ROOT_PATH"]) ? 'Pass' : 'Fail';
4574
4575 if (is_dir($GLOBALS["CURRENT_ROOT_PATH"])) {
4576
4577 if ($dh = @opendir($GLOBALS["CURRENT_ROOT_PATH"])) {
4578
4579 closedir($dh);
4580
4581 } else {
4582
4583 $req01a = 'Fail';
4584
4585 }
4586
4587 }
4588
4589 $req01b = ($zip_file_count == 1) ? 'Pass' : 'Fail';
4590
4591 $req01 = ($req01a == 'Pass' && $req01b == 'Pass') ? 'Pass' : 'Fail';
4592
4593 $safe_ini = strtolower(@ini_get('safe_mode'));
4594
4595 $req02 = $safe_ini != 'on' || $safe_ini != 'yes' || $safe_ini != 'true' || ini_get("safe_mode") != 1 ? 'Pass' : 'Fail';
4596
4597 $req03 = function_exists('mysqli_connect') ? 'Pass' : 'Fail';
4598
4599 $php_compare = version_compare(phpversion(), '5.2.17');
4600
4601 $req04 = $php_compare >= 0 ? 'Pass' : 'Fail';
4602
4603 $total_req = ($req01 == 'Pass' && $req02 == 'Pass' && $req03 == 'Pass' && $req04 == 'Pass') ? 'Pass' : 'Fail';
4604
4605?>
4606
4607
4608
4609<script type="text/javascript">
4610
4611 /** **********************************************
4612
4613 * METHOD: Performs Ajax post to extract files and create db
4614
4615 * Timeout (10000000 = 166 minutes) */
4616
4617 Duplicator.runDeployment = function() {
4618
4619
4620
4621 var $form = $('#dup-step1-input-form');
4622
4623 $form.parsley('validate');
4624
4625 if (! $form.parsley('isValid')) {
4626
4627 return;
4628
4629 }
4630
4631
4632
4633 var msg = "Continue installation with the following settings?\n\n";
4634
4635 msg += "Server: " + $("#dbhost").val() + "\nDatabase: " + $("#dbname").val() + "\n\n";
4636
4637 msg += "WARNING: Be sure these database parameters are correct!\n";
4638
4639 msg += "Entering the wrong information WILL overwrite an existing database.\n";
4640
4641 msg += "Make sure to have backups of all your data before proceeding.\n\n";
4642
4643
4644
4645 var answer = confirm(msg);
4646
4647 if (answer) {
4648
4649 $.ajax({
4650
4651 type: "POST",
4652
4653 timeout: 10000000,
4654
4655 dataType: "json",
4656
4657 url: window.location.href,
4658
4659 data: $form.serialize(),
4660
4661 beforeSend: function() {
4662
4663 Duplicator.showProgressBar();
4664
4665 $form.hide();
4666
4667 $('#dup-step1-result-form').show();
4668
4669 },
4670
4671 success: function(data, textStatus, xhr){
4672
4673 if (typeof(data) != 'undefined' && data.pass == 1) {
4674
4675 $("#ajax-dbhost").val($("#dbhost").val());
4676
4677 $("#ajax-dbport").val($("#dbport").val());
4678
4679 $("#ajax-dbuser").val($("#dbuser").val());
4680
4681 $("#ajax-dbpass").val($("#dbpass").val());
4682
4683 $("#ajax-dbname").val($("#dbname").val());
4684
4685 $("#ajax-dbcharset").val($("#dbcharset").val());
4686
4687 $("#ajax-dbcollate").val($("#dbcollate").val());
4688
4689 $("#ajax-logging").val($("#logging").val());
4690
4691 $("#ajax-json").val(escape(JSON.stringify(data)));
4692
4693 setTimeout(function() {$('#dup-step1-result-form').submit();}, 1000);
4694
4695 $('#progress-area').fadeOut(700);
4696
4697 } else {
4698
4699 Duplicator.hideProgressBar();
4700
4701 }
4702
4703 },
4704
4705 error: function(xhr) {
4706
4707 var status = "<b>server code:</b> " + xhr.status + "<br/><b>status:</b> " + xhr.statusText + "<br/><b>response:</b> " + xhr.responseText;
4708
4709 $('#ajaxerr-data').html(status);
4710
4711 Duplicator.hideProgressBar();
4712
4713 }
4714
4715 });
4716
4717 }
4718
4719 };
4720
4721
4722
4723 /** **********************************************
4724
4725 * METHOD: Accetps Useage Warning */
4726
4727 Duplicator.acceptWarning = function() {
4728
4729 if ($("#accept-warnings").is(':checked')) {
4730
4731 $("#dup-step1-deploy-btn").removeAttr("disabled");
4732
4733 } else {
4734
4735 $("#dup-step1-deploy-btn").attr("disabled", "true");
4736
4737 }
4738
4739 };
4740
4741
4742
4743 /** **********************************************
4744
4745 * METHOD: Go back on AJAX result view */
4746
4747 Duplicator.hideErrorResult = function() {
4748
4749 $('#dup-step1-result-form').hide();
4750
4751 $('#dup-step1-input-form').show(200);
4752
4753 };
4754
4755
4756
4757 /** **********************************************
4758
4759 * METHOD: Shows results of database connection
4760
4761 * Timeout (45000 = 45 secs) */
4762
4763 Duplicator.dlgTestDB = function () {
4764
4765 $.ajax({
4766
4767 type: "POST",
4768
4769 timeout: 45000,
4770
4771 url: window.location.href + '?' + 'dbtest=1',
4772
4773 data: $('#dup-step1-input-form').serialize(),
4774
4775 success: function(data){ $('#dbconn-test-msg').html(data); },
4776
4777 error: function(data){ alert('An error occurred while testing the database connection! Contact your server admin to make sure the connection inputs are correct!'); }
4778
4779 });
4780
4781
4782
4783 $('#dbconn-test-msg').html("Attempting Connection. Please wait...");
4784
4785 $("#dup-step1-dbconn-status").show(500);
4786
4787
4788
4789 };
4790
4791
4792
4793 Duplicator.showDeleteWarning = function () {
4794
4795 ($('#dbaction-empty').prop('checked'))
4796
4797 ? $('#dup-step1-warning-emptydb').show(300)
4798
4799 : $('#dup-step1-warning-emptydb').hide(300);
4800
4801 };
4802
4803
4804
4805 Duplicator.togglePort = function () {
4806
4807
4808
4809 $('#dup-step1-dbport-btn').hide();
4810
4811 $('#dbport').show();
4812
4813 }
4814
4815
4816
4817
4818
4819 //DOCUMENT LOAD
4820
4821 $(document).ready(function() {
4822
4823 $('#dup-step1-dialog-data').appendTo('#dup-step1-result-container');
4824
4825 $( "input[name='dbaction']").click(Duplicator.showDeleteWarning);
4826
4827 Duplicator.acceptWarning();
4828
4829 Duplicator.showDeleteWarning();
4830
4831 });
4832
4833</script>
4834
4835
4836
4837
4838
4839<!-- =========================================
4840
4841VIEW: STEP 1- INPUT -->
4842
4843<form id='dup-step1-input-form' method="post" class="content-form" parsley-validate>
4844
4845 <input type="hidden" name="action_ajax" value="1" />
4846
4847 <input type="hidden" name="action_step" value="1" />
4848
4849 <input type="hidden" name="package_name" value="<?php echo $zip_file_name ?>" />
4850
4851
4852
4853 <div class="dup-logfile-link">
4854
4855 <select name="logging" id="logging">
4856
4857 <option value="1" selected="selected">Light Logging</option>
4858
4859 <option value="2">Detailed Logging</option>
4860
4861 <!--option value="3">Debug Logging</option-->
4862
4863 </select>
4864
4865 </div>
4866
4867 <h3 style="margin-bottom:5px">
4868
4869 Step 1: Files & Database
4870
4871 </h3>
4872
4873 <hr size="1" />
4874
4875
4876
4877 <!-- CHECKS: FAIL -->
4878
4879 <?php if ( $total_req == 'Fail') : ?>
4880
4881
4882
4883 <div class="dup-box">
4884
4885 <div class="dup-box-title">
4886
4887 <div id="system-circle" class="circle-fail"></div> Requirements: Fail
4888
4889 <div class="dup-box-arrow"></div>
4890
4891 </div>
4892
4893 <div class="dup-box-panel" style="display:none">
4894
4895 <div id="dup-step1-result-container"></div>
4896
4897 </div>
4898
4899 </div><br/>
4900
4901
4902
4903 <i id="dup-step1-sys-req-msg">
4904
4905 This installation will not be able to proceed until the system requirements pass. Please validate your system requirements by clicking on the button above.
4906
4907 In order to get these values to pass please contact your server administrator, hosting provider or visit the online FAQ.
4908
4909 </i><br/>
4910
4911
4912
4913 <div style="line-height:28px; font-size:14px; padding:0px 0px 0px 30px; font-weight:normal">
4914
4915 <b>Helpful Resources:</b><br/>
4916
4917 » <a href="http://lifeinthegrid.com/duplicator-faq" target="_blank">Common FAQs</a> <br/>
4918
4919 » <a href="http://lifeinthegrid.com/duplicator-guide" target="_blank">User Guide</a> <br/>
4920
4921 » <a href="http://lifeinthegrid.com/duplicator-hosts" target="_blank">Approved Hosts</a> <br/>
4922
4923 </div><br/>
4924
4925
4926
4927 <!-- CHECKS: PASS -->
4928
4929 <?php else : ?>
4930
4931
4932
4933
4934
4935 <div class="dup-box">
4936
4937 <div class="dup-box-title">
4938
4939 <div id="system-circle" class="circle-pass"></div> Requirements: Pass
4940
4941 <div class="dup-box-arrow"></div>
4942
4943 </div>
4944
4945 <div class="dup-box-panel" style="display:none">
4946
4947 <div id="dup-step1-result-container"></div>
4948
4949 </div>
4950
4951 </div><br/>
4952
4953
4954
4955 <div class="title-header">
4956
4957 MySQL Database
4958
4959 </div>
4960
4961 <table class="dup-step1-inputs">
4962
4963 <tr>
4964
4965 <td>Action</td>
4966
4967 <td>
4968
4969 <div class="dup-step1-modes">
4970
4971 <input type="radio" name="dbaction" id="dbaction-create" value="create" checked="checked" />
4972
4973 <label for="dbaction-create">Create New Database</label>
4974
4975 </div>
4976
4977 <div class="dup-step1-modes">
4978
4979 <input type="radio" name="dbaction" id="dbaction-empty" value="empty" />
4980
4981 <label for="dbaction-empty">Connect and Remove All Data</label>
4982
4983 </div>
4984
4985 </td>
4986
4987 </tr>
4988
4989 <tr>
4990
4991 <td>Host</td>
4992
4993 <td>
4994
4995 <input type="text" name="dbhost" id="dbhost" parsley-required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBHOST']); ?>" placeholder="localhost" style="width:410px" />
4996
4997 <input id="dup-step1-dbport-btn" type="button" onclick="Duplicator.togglePort()" style="" value="Port: <?php echo htmlspecialchars($GLOBALS['FW_DBPORT']); ?>" />
4998
4999 <input name="dbport" id="dbport" type="text" style="width:80px; display:none" value="<?php echo htmlspecialchars($GLOBALS['FW_DBPORT']); ?>" />
5000
5001 </td>
5002
5003 </tr>
5004
5005 <tr>
5006
5007 <td>Name</td>
5008
5009 <td><input type="text" name="dbname" id="dbname" parsley-required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBNAME']); ?>" placeholder="new or existing database name" /></td>
5010
5011 </tr>
5012
5013 <tr>
5014
5015 <td>User</td>
5016
5017 <td><input type="text" name="dbuser" id="dbuser" parsley-required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBUSER']); ?>" placeholder="valid database username" /></td>
5018
5019 </tr>
5020
5021 <tr>
5022
5023 <td>Password</td>
5024
5025 <td><input type="text" name="dbpass" id="dbpass" value="<?php echo htmlspecialchars($GLOBALS['FW_DBPASS']); ?>" placeholder="valid database user password" /></td>
5026
5027 </tr>
5028
5029 </table>
5030
5031
5032
5033
5034
5035 <!-- =========================================
5036
5037 DIALOG: DB CONNECTION CHECK -->
5038
5039 <div id="dup-step1-dbconn">
5040
5041 <input id="dup-step1-dbconn-btn" type="button" onclick="Duplicator.dlgTestDB()" style="" value="Test Connection" />
5042
5043 <div id="dup-step1-dbconn-status" style="display:none">
5044
5045 <div style="padding: 0px 10px 10px 10px;">
5046
5047 <div id="dbconn-test-msg" style="min-height:80px"></div>
5048
5049 </div>
5050
5051 <small><a href="javascript:void()" onclick="$('#dup-step1-dbconn-status').hide(1000)">Hide Connection Details</a></small>
5052
5053 </div>
5054
5055 </div>
5056
5057
5058
5059 <!-- !!DO NOT CHANGE/EDIT OR REMOVE THIS SECTION!!
5060
5061 If your interested in Private Label Rights please contact us at the URL below to discuss
5062
5063 customizations to product labeling: http://lifeinthegrid.com -->
5064
5065 <a href="javascript:void(0)" onclick="$('#dup-step1-cpanel').toggle(250)"><b>Need Setup Help...</b></a>
5066
5067 <div id='dup-step1-cpanel' style="display:none">
5068
5069 <div style="padding:10px 0px 0px 10px;line-height:22px">
5070
5071 » Check out the <a href="http://lifeinthegrid.com/duplicator-tutorials" target="_blank">video tutorials & guides</a> <br/>
5072
5073 » Get help from our <a href="http://lifeinthegrid.com/labs/duplicator/resources/" target="_blank">resources page</a>
5074
5075 </div>
5076
5077 </div><br/><br/>
5078
5079
5080
5081 <a href="javascript:void(0)" onclick="$('#dup-step1-adv-opts').toggle(250)"><b>Advanced Options...</b></a>
5082
5083 <div id='dup-step1-adv-opts' style="display:none">
5084
5085 <table class="dup-step1-inputs">
5086
5087 <tr><td colspan="2"><input type="checkbox" name="zip_manual" id="zip_manual" value="1" /> <label for="zip_manual">Manual package extraction</label></td></tr>
5088
5089 <tr><td colspan="2"><input type="checkbox" name="ssl_admin" id="ssl_admin" <?php echo ($GLOBALS['FW_SSL_ADMIN']) ? "checked='checked'" : ""; ?> /> <label for="ssl_admin">Enforce SSL on Admin</label></td></tr>
5090
5091 <tr><td colspan="2"><input type="checkbox" name="ssl_login" id="ssl_login" <?php echo ($GLOBALS['FW_SSL_LOGIN']) ? "checked='checked'" : ""; ?> /> <label for="ssl_login">Enforce SSL on Login</label></td></tr>
5092
5093 <tr><td colspan="2"><input type="checkbox" name="cache_wp" id="cache_wp" <?php echo ($GLOBALS['FW_CACHE_WP']) ? "checked='checked'" : ""; ?> /> <label for="cache_wp">Keep Cache Enabled</label></td></tr>
5094
5095 <tr><td colspan="2"><input type="checkbox" name="cache_path" id="cache_path" <?php echo ($GLOBALS['FW_CACHE_PATH']) ? "checked='checked'" : ""; ?> /> <label for="cache_path">Keep Cache Home Path</label></td></tr>
5096
5097 <tr><td colspan="2"><input type="checkbox" name="dbnbsp" id="dbnbsp" value="1" /> <label for="dbnbsp">Fix non-breaking space characters</label></td></tr>
5098
5099 <tr><td style="width:130px">MySQL Charset</td><td><input type="text" name="dbcharset" id="dbcharset" value="<?php echo $_POST['dbcharset'] ?>" /> </td></tr>
5100
5101 <tr><td>MySQL Collation </td><td><input type="text" name="dbcollate" id="dbcollate" value="<?php echo $_POST['dbcollate'] ?>" /> </tr>
5102
5103 </table>
5104
5105 </div>
5106
5107
5108
5109 <!-- NOTICES -->
5110
5111 <div id="dup-step1-warning">
5112
5113 <b>WARNINGS & NOTICES</b>
5114
5115 <p>
5116
5117 <b>Disclaimer:</b>
5118
5119 This plugin require above average technical knowledge. Please use it at your own risk and always back up your database and files beforehand using another backup
5120
5121 system besides the Duplicator. If you're not sure about how to use this tool then please enlist the guidance of a technical professional. <u>Always</u> test
5122
5123 this installer in a sandbox environment before trying to deploy into a production setting.
5124
5125 </p>
5126
5127 <p>
5128
5129 <b>Database:</b>
5130
5131 Do not connect to an existing database unless you are 100% sure you want to remove all of it's data. Connecting to a database
5132
5133 that already exists will permanently DELETE all data in that database. This tool is designed to populate and fill a database with NEW data from a duplicated
5134
5135 database using the SQL script in the package name above.
5136
5137 </p>
5138
5139 <p>
5140
5141 <b>Setup:</b>
5142
5143 Only the archive and installer.php file should be in the install directory, unless you have manually extracted the package and checked the
5144
5145 'Manual Package Extraction' checkbox. All other files will be OVERWRITTEN during install. Make sure you have full backups of all your databases and files
5146
5147 before continuing with an installation.</p>
5148
5149 <p>
5150
5151 <b>Manual Extraction:</b>
5152
5153 Manual extraction requires that all contents in the package are extracted to the same directory as the installer.php file.
5154
5155 Manual extraction is only needed when your server does not support the ZipArchive extension. Please see the online help for more details.
5156
5157 </p>
5158
5159 <p>
5160
5161 <b>After Install:</b>When you are done with the installation remove the installer.php, installer-data.sql and the installer-log.txt files from your directory.
5162
5163 These files contain sensitive information and should not remain on a production system.
5164
5165 </p><br/>
5166
5167 </div>
5168
5169
5170
5171 <div id="dup-step1-warning-check">
5172
5173 <input id="accept-warnings" name="accpet-warnings" type="checkbox" onclick="Duplicator.acceptWarning()" /> <label for="accept-warnings">I have read all warnings & notices</label><br/>
5174
5175 <div id="dup-step1-warning-emptydb">
5176
5177 The remove action will delete <u>all</u> tables and data from the database!
5178
5179 </div>
5180
5181 </div><br/><br/><br/>
5182
5183
5184
5185 <div class="dup-footer-buttons">
5186
5187 <input id="dup-step1-deploy-btn" type="button" value=" Run Deployment " onclick="Duplicator.runDeployment()" />
5188
5189 </div>
5190
5191 <?php endif; ?>
5192
5193</form>
5194
5195
5196
5197
5198
5199<!-- =========================================
5200
5201VIEW: STEP 1 - AJAX RESULT
5202
5203Auto Posts to view.step2.php -->
5204
5205<form id='dup-step1-result-form' method="post" class="content-form" style="display:none">
5206
5207 <input type="hidden" name="action_step" value="2" />
5208
5209 <input type="hidden" name="package_name" value="<?php echo $zip_file_name ?>" />
5210
5211 <input type="hidden" name="logging" id="ajax-logging" />
5212
5213 <input type="hidden" name="dbhost" id="ajax-dbhost" />
5214
5215 <input type="hidden" name="dbport" id="ajax-dbport" />
5216
5217 <input type="hidden" name="dbuser" id="ajax-dbuser" />
5218
5219 <input type="hidden" name="dbpass" id="ajax-dbpass" />
5220
5221 <input type="hidden" name="dbname" id="ajax-dbname" />
5222
5223 <input type="hidden" name="json" id="ajax-json" />
5224
5225 <input type="hidden" name="dbcharset" id="ajax-dbcharset" />
5226
5227 <input type="hidden" name="dbcollate" id="ajax-dbcollate" />
5228
5229
5230
5231 <div class="dup-logfile-link"><a href="installer-log.txt" target="_blank">installer-log.txt</a></div>
5232
5233 <h3>Step 1: Files & Database</h3>
5234
5235 <hr size="1" />
5236
5237
5238
5239 <!-- PROGRESS BAR -->
5240
5241 <div id="progress-area">
5242
5243 <div style="width:500px; margin:auto">
5244
5245 <h3>Processing Files & Database Please Wait...</h3>
5246
5247 <div id="progress-bar"></div>
5248
5249 <i>This may take several minutes</i>
5250
5251 </div>
5252
5253 </div>
5254
5255
5256
5257 <!-- AJAX SYSTEM ERROR -->
5258
5259 <div id="ajaxerr-area" style="display:none">
5260
5261 <p>Please try again an issue has occurred.</p>
5262
5263 <div style="padding: 0px 10px 10px 0px;">
5264
5265 <div id="ajaxerr-data">An unknown issue has occurred with the file and database setup process. Please see the installer-log.txt file for more details.</div>
5266
5267 <div style="text-align:center; margin:10px auto 0px auto">
5268
5269 <input type="button" onclick='Duplicator.hideErrorResult()' value="« Try Again" /><br/><br/>
5270
5271 <i style='font-size:11px'>See online help for more details at <a href='http://lifeinthegrid.com/support' target='_blank'>support.lifeinthegrid.com</a></i>
5272
5273 </div>
5274
5275 </div>
5276
5277 </div>
5278
5279</form>
5280
5281
5282
5283
5284
5285<!-- =========================================
5286
5287PANEL: SERVER CHECKS -->
5288
5289<div id="dup-step1-dialog" title="System Status" style="display:none">
5290
5291<div id="dup-step1-dialog-data" style="padding: 0px 10px 10px 10px;">
5292
5293
5294
5295 <b>Archive Name:</b> <?php echo $zip_file_name; ?> <br/>
5296
5297 <b>Package Notes:</b> <?php echo empty($GLOBALS['FW_PACKAGE_NOTES']) ? 'No notes provided for this pakcage.' : $GLOBALS['FW_PACKAGE_NOTES']; ?><br/><br/>
5298
5299
5300
5301 <!-- SYSTEM REQUIREMENTS -->
5302
5303 <b>REQUIREMENTS</b> <i style='font-size:11px'>click links for details</i>
5304
5305 <hr size="1"/>
5306
5307 <table style="width:100%">
5308
5309 <tr>
5310
5311 <td style="width:300px"><a href="javascript:void(0)" onclick="$('#dup-SRV01').toggle(400)">Root Directory</a></td>
5312
5313 <td class="<?php echo ($req01 == 'Pass') ? 'dup-pass' : 'dup-fail' ?>"><?php echo $req01; ?></td>
5314
5315 </tr>
5316
5317 <tr>
5318
5319 <td colspan="2" id="dup-SRV01" class='dup-step1-dialog-data-details'>
5320
5321 <?php
5322
5323 echo "<i>Path: {$GLOBALS['CURRENT_ROOT_PATH']} </i><br/>";
5324
5325 printf("<b>[%s]</b> %s <br/>", $req01a, "Is Writable by PHP");
5326
5327 printf("<b>[%s]</b> %s <br/>", $req01b, "Contains only one zip file<div style='padding-left:70px'>Result = {$zip_file_name} <br/> <i>Note: Manual extraction still requires the archive.zip file</i> </div> ");
5328
5329 ?>
5330
5331 </td>
5332
5333 </tr>
5334
5335 <tr>
5336
5337 <td>Safe Mode Off</td>
5338
5339 <td class="<?php echo ($req02 == 'Pass') ? 'dup-pass' : 'dup-fail' ?>"><?php echo $req02; ?></td>
5340
5341 </tr>
5342
5343 <tr>
5344
5345 <td><a href="http://us2.php.net/manual/en/mysqli.installation.php" target="_blank">MySQLi Support</a></td>
5346
5347 <td class="<?php echo ($req03 == 'Pass') ? 'dup-pass' : 'dup-fail' ?>"><?php echo $req03; ?></td>
5348
5349 </tr>
5350
5351 <tr>
5352
5353 <td valign="top">
5354
5355 PHP Version: <?php echo phpversion(); ?><br/>
5356
5357 <i style="font-size:10px">(PHP 5.2.17+ is required)</i>
5358
5359 </td>
5360
5361 <td class="<?php echo ($req04 == 'Pass') ? 'dup-pass' : 'dup-fail' ?>"><?php echo $req04; ?> </td>
5362
5363 </tr>
5364
5365 </table>
5366
5367
5368
5369 <!-- SYSTEM CHECKS -->
5370
5371 <b>CHECKS</b><hr style='margin-top:-2px' size="1"/>
5372
5373 <table style="width:100%">
5374
5375 <tr>
5376
5377 <td style="width:300px"></td>
5378
5379 <td></td>
5380
5381 </tr>
5382
5383 <tr>
5384
5385 <?php if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') !== false): ?>
5386
5387 <td><b>Web Server:</b> Apache</td>
5388
5389 <td><div class='dup-pass'>Good</div></td>
5390
5391 <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false): ?>
5392
5393 <td><b>Web Server:</b> LiteSpeed</td>
5394
5395 <td><div class='dup-ok'>OK</div></td>
5396
5397 <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false): ?>
5398
5399 <td><b>Web Server:</b> Nginx</td>
5400
5401 <td><div class='dup-ok'>OK</div></td>
5402
5403 <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false): ?>
5404
5405 <td><b>Web Server:</b> Lighthttpd</td>
5406
5407 <td><div class='dup-ok'>OK</div></td>
5408
5409 <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'iis') !== false): ?>
5410
5411 <td><b>Web Server:</b> Microsoft IIS</td>
5412
5413 <td><div class='dup-ok'>OK</div></td>
5414
5415 <?php else: ?>
5416
5417 <td><b>Web Server:</b> Not detected</td>
5418
5419 <td><div class='dup-fail'>Caution</div></td>
5420
5421 <?php endif; ?>
5422
5423 </tr>
5424
5425 <tr>
5426
5427 <?php
5428
5429 $open_basedir_set = ini_get("open_basedir");
5430
5431 if (empty($open_basedir_set)):
5432
5433 ?>
5434
5435 <td><b>Open Base Dir:</b> Off
5436
5437 <td><div class='dup-pass'>Good</div>
5438
5439 <?php else: ?>
5440
5441 <td><b>Open Base Dir:</b> On</td>
5442
5443 <td><div class='dup-fail'>Caution</div></td>
5444
5445 <?php endif; ?>
5446
5447 </tr>
5448
5449 </table>
5450
5451
5452
5453 <hr class='dup-dots' />
5454
5455 <!-- SAPI -->
5456
5457 <b>PHP SAPI:</b> <?php echo php_sapi_name(); ?><br/>
5458
5459 <b>PHP ZIP Archive:</b> <?php echo class_exists('ZipArchive') ? 'Is Installed' : 'Not Installed'; ?> <br/>
5460
5461 <b>CDN Accessible:</b> <?php echo ( DupUtil::is_url_active("ajax.aspnetcdn.com", 443) && DupUtil::is_url_active("ajax.googleapis.com", 443)) ? 'Yes' : 'No'; ?> <br/>
5462
5463 Need an <a href='http://lifeinthegrid.com/duplicator-hosts' target='_blank'>approved</a> Duplicator hosting provider?
5464
5465
5466
5467</div>
5468
5469</div>
5470
5471
5472
5473
5474
5475
5476
5477 <?php
5478
5479 break;
5480
5481 case "2" :
5482
5483 ?> <?php
5484
5485 // Exit if accessed directly
5486
5487 if (! defined('DUPLICATOR_INIT')) {
5488
5489 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
5490
5491 $_baseURL = "http://" . $_baseURL;
5492
5493 header("HTTP/1.1 301 Moved Permanently");
5494
5495 header("Location: $_baseURL");
5496
5497 exit;
5498
5499 }
5500
5501 $dbh = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport']);
5502
5503
5504
5505 $all_tables = DupUtil::get_database_tables($dbh);
5506
5507 $active_plugins = DupUtil::get_active_plugins($dbh);
5508
5509
5510
5511
5512
5513 $old_path = $GLOBALS['FW_WPROOT'];
5514
5515 $new_path = DupUtil::set_safe_path($GLOBALS['CURRENT_ROOT_PATH']);
5516
5517 $new_path = ((strrpos($old_path, '/') + 1) == strlen($old_path)) ? DupUtil::add_slash($new_path) : $new_path;
5518
5519?>
5520
5521
5522
5523<script type="text/javascript">
5524
5525 /** **********************************************
5526
5527 * METHOD:
5528
5529 * Timeout (10000000 = 166 minutes) */
5530
5531 Duplicator.runUpdate = function() {
5532
5533
5534
5535 //Validation
5536
5537 var wp_username = $.trim($("#wp_username").val()).length || 0;
5538
5539 var wp_password = $.trim($("#wp_password").val()).length || 0;
5540
5541
5542
5543 if ( $.trim($("#url_new").val()) == "" ) {alert("The 'New URL' field is required!"); return false;}
5544
5545 if ( $.trim($("#siteurl").val()) == "" ) {alert("The 'Site URL' field is required!"); return false;}
5546
5547 if (wp_username >= 1 && wp_username < 4) {alert("The New Admin Account 'Username' must be four or more characters"); return false;}
5548
5549 if (wp_username >= 4 && wp_password < 6) {alert("The New Admin Account 'Password' must be six or more characters"); return false;}
5550
5551
5552
5553 $.ajax({
5554
5555 type: "POST",
5556
5557 timeout: 10000000,
5558
5559 dataType: "json",
5560
5561 url: window.location.href,
5562
5563 data: $('#dup-step2-input-form').serialize(),
5564
5565 beforeSend: function() {
5566
5567 Duplicator.showProgressBar();
5568
5569 $('#dup-step2-input-form').hide();
5570
5571 $('#dup-step2-result-form').show();
5572
5573 },
5574
5575 success: function(data){
5576
5577 if (typeof(data) != 'undefined' && data.step2.pass == 1) {
5578
5579 $("#ajax-url_new").val($("#url_new").val());
5580
5581 $("#ajax-json").val(escape(JSON.stringify(data)));
5582
5583 setTimeout(function(){$('#dup-step2-result-form').submit();}, 1000);
5584
5585 $('#progress-area').fadeOut(1800);
5586
5587 } else {
5588
5589 Duplicator.hideProgressBar();
5590
5591 }
5592
5593 },
5594
5595 error: function(xhr) {
5596
5597 var status = "<b>server code:</b> " + xhr.status + "<br/><b>status:</b> " + xhr.statusText + "<br/><b>response:</b> " + xhr.responseText;
5598
5599 $('#ajaxerr-data').html(status);
5600
5601 Duplicator.hideProgressBar();
5602
5603 }
5604
5605 });
5606
5607 };
5608
5609
5610
5611 /** **********************************************
5612
5613 * METHOD: Returns the windows active url */
5614
5615 Duplicator.getNewURL = function(id) {
5616
5617 var filename= window.location.pathname.split('/').pop() || 'installer.php' ;
5618
5619 $("#" + id).val(window.location.href.replace(filename, ''));
5620
5621 };
5622
5623
5624
5625 /** **********************************************
5626
5627 * METHOD: Allows user to edit the package url */
5628
5629 Duplicator.editOldURL = function() {
5630
5631 var msg = 'This is the URL that was generated when the package was created.\n';
5632
5633 msg += 'Changing this value may cause issues with the install process.\n\n';
5634
5635 msg += 'Only modify this value if you know exactly what the value should be.\n';
5636
5637 msg += 'See "General Settings" in the WordPress Administrator for more details.\n\n';
5638
5639 msg += 'Are you sure you want to continue?';
5640
5641
5642
5643 if (confirm(msg)) {
5644
5645 $("#url_old").removeAttr('readonly');
5646
5647 $("#url_old").removeClass('readonly');
5648
5649 $('#edit_url_old').hide('slow');
5650
5651 }
5652
5653 };
5654
5655
5656
5657 /** **********************************************
5658
5659 * METHOD: Allows user to edit the package path */
5660
5661 Duplicator.editOldPath = function() {
5662
5663 var msg = 'This is the SERVER URL that was generated when the package was created.\n';
5664
5665 msg += 'Changing this value may cause issues with the install process.\n\n';
5666
5667 msg += 'Only modify this value if you know exactly what the value should be.\n';
5668
5669 msg += 'Are you sure you want to continue?';
5670
5671
5672
5673 if (confirm(msg)) {
5674
5675 $("#path_old").removeAttr('readonly');
5676
5677 $("#path_old").removeClass('readonly');
5678
5679 $('#edit_path_old').hide('slow');
5680
5681 }
5682
5683 };
5684
5685
5686
5687 /** **********************************************
5688
5689 * METHOD: Go back on AJAX result view */
5690
5691 Duplicator.hideErrorResult2 = function() {
5692
5693 $('#dup-step2-result-form').hide();
5694
5695 $('#dup-step2-input-form').show(200);
5696
5697 };
5698
5699
5700
5701 //DOCUMENT LOAD
5702
5703 $(document).ready(function() {
5704
5705 Duplicator.getNewURL('url_new');
5706
5707 Duplicator.getNewURL('siteurl');
5708
5709
5710
5711 $("#wp_password").passStrength({
5712
5713 shortPass: "top_shortPass",
5714
5715 badPass: "top_badPass",
5716
5717 goodPass: "top_goodPass",
5718
5719 strongPass: "top_strongPass",
5720
5721 baseStyle: "top_testresult",
5722
5723 userid: "#wp_username",
5724
5725 messageloc: 1 });
5726
5727 });
5728
5729</script>
5730
5731
5732
5733
5734
5735<!-- =========================================
5736
5737VIEW: STEP 2- INPUT -->
5738
5739<form id='dup-step2-input-form' method="post" class="content-form">
5740
5741 <input type="hidden" name="action_ajax" value="2" />
5742
5743 <input type="hidden" name="action_step" value="2" />
5744
5745 <input type="hidden" name="logging" value="<?php echo $_POST['logging'] ?>" />
5746
5747 <input type="hidden" name="package_name" value="<?php echo $_POST['package_name'] ?>" />
5748
5749 <input type="hidden" name="json" value="<?php echo $_POST['json']; ?>" />
5750
5751 <input type="hidden" name="dbhost" value="<?php echo $_POST['dbhost'] ?>" />
5752
5753 <input type="hidden" name="dbport" value="<?php echo $_POST['dbport'] ?>" />
5754
5755 <input type="hidden" name="dbuser" value="<?php echo $_POST['dbuser'] ?>" />
5756
5757 <input type="hidden" name="dbpass" value="<?php echo htmlentities($_POST['dbpass']) ?>" />
5758
5759 <input type="hidden" name="dbname" value="<?php echo $_POST['dbname'] ?>" />
5760
5761 <input type="hidden" name="dbcharset" value="<?php echo $_POST['dbcharset'] ?>" />
5762
5763 <input type="hidden" name="dbcollate" value="<?php echo $_POST['dbcollate'] ?>" />
5764
5765
5766
5767
5768
5769 <div class="dup-logfile-link"><a href="installer-log.txt" target="_blank">installer-log.txt</a></div>
5770
5771 <h3>Step 2: Files & Database</h3>
5772
5773 <hr size="1" /><br />
5774
5775
5776
5777 <div class="title-header">Old Settings</div>
5778
5779 <table class="table-inputs-step2">
5780
5781 <tr valign="top">
5782
5783 <td style="width:80px">URL</td>
5784
5785 <td>
5786
5787 <input type="text" name="url_old" id="url_old" value="<?php echo $GLOBALS['FW_URL_OLD'] ?>" readonly="readonly" class="readonly" />
5788
5789 <a href="javascript:Duplicator.editOldURL()" id="edit_url_old" style="font-size:12px">edit</a>
5790
5791 </td>
5792
5793 </tr>
5794
5795 <tr valign="top">
5796
5797 <td>Path</td>
5798
5799 <td>
5800
5801 <input type="text" name="path_old" id="path_old" value="<?php echo $old_path ?>" readonly="readonly" class="readonly" />
5802
5803 <a href="javascript:Duplicator.editOldPath()" id="edit_path_old" style="font-size:12px">edit</a>
5804
5805 </td>
5806
5807 </tr>
5808
5809 </table>
5810
5811
5812
5813 <div class="title-header" style="margin-top:8px">New Settings</div>
5814
5815 <table class="table-inputs-step2">
5816
5817 <tr>
5818
5819 <td style="width:80px">URL</td>
5820
5821 <td>
5822
5823 <input type="text" name="url_new" id="url_new" value="<?php echo $GLOBALS['FW_URL_NEW'] ?>" />
5824
5825 <a href="javascript:Duplicator.getNewURL('url_new')" style="font-size:12px">get</a>
5826
5827 </td>
5828
5829 </tr>
5830
5831 <tr>
5832
5833 <td>Path</td>
5834
5835 <td><input type="text" name="path_new" id="path_new" value="<?php echo $new_path ?>" /></td>
5836
5837 </tr>
5838
5839 <tr>
5840
5841 <td>Title</td>
5842
5843 <td><input type="text" name="blogname" id="blogname" value="<?php echo $GLOBALS['FW_BLOGNAME'] ?>" /></td>
5844
5845 </tr>
5846
5847 </table><br/>
5848
5849
5850
5851 <!-- ==========================
5852
5853 CREATE NEW USER -->
5854
5855 <a href="javascript:void(0)" onclick="$('#dup-step2-user-opts').toggle(0)"><b>New Admin Account...</b></a>
5856
5857 <div id='dup-step2-user-opts' style="display:none;">
5858
5859 <table class="table-inputs-step2" style="margin-top:7px">
5860
5861 <tr><td colspan="2"><i style="color:gray;font-size: 11px">This feature is optional. If the username already exists the account will NOT be created or updated.</i></td></tr>
5862
5863 <tr>
5864
5865 <td>Username </td>
5866
5867 <td><input type="text" name="wp_username" id="wp_username" value="" title="4 characters minimum" placeholder="(4 or more characters)" /></td>
5868
5869 </tr>
5870
5871 <tr>
5872
5873 <td valign="top">Password</td>
5874
5875 <td><input type="text" name="wp_password" id="wp_password" value="" title="6 characters minimum" placeholder="(6 or more characters)" /></td>
5876
5877 </tr>
5878
5879 </table>
5880
5881 </div><br/><br/>
5882
5883
5884
5885
5886
5887 <!-- ==========================
5888
5889 ADVANCED OPTIONS -->
5890
5891 <a href="javascript:void(0)" onclick="$('#dup-step2-adv-opts').toggle(0)"><b>Advanced Options...</b></a>
5892
5893 <div id='dup-step2-adv-opts' style="display:none;">
5894
5895 <table style="width: 100%;">
5896
5897 <tr>
5898
5899 <td valign="top" style="width:80px">Site URL</td>
5900
5901 <td>
5902
5903 <input type="text" name="siteurl" id="siteurl" value="" />
5904
5905 <a href="javascript:Duplicator.getNewURL('siteurl')" style="font-size:12px">get</a><br/>
5906
5907 </td>
5908
5909 </tr>
5910
5911 </table><br/>
5912
5913
5914
5915
5916
5917 <table>
5918
5919 <tr>
5920
5921 <td style="padding-right:10px">
5922
5923 Scan Tables
5924
5925 <div class="dup-step2-allnonelinks">
5926
5927 <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',true);">[All]</a>
5928
5929 <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',false);">[None]</a>
5930
5931 </div><br style="clear:both" />
5932
5933 <select id="tables" name="tables[]" multiple="multiple" style="width:315px; height:100px">
5934
5935 <?php
5936
5937 foreach( $all_tables as $table ) {
5938
5939 echo '<option selected="selected" value="' . DupUtil::esc_html_attr( $table ) . '">' . $table . '</option>';
5940
5941 }
5942
5943 ?>
5944
5945 </select>
5946
5947
5948
5949 </td>
5950
5951 <td valign="top">
5952
5953 Activate Plugins
5954
5955 <div class="dup-step2-allnonelinks">
5956
5957 <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',true);">[All]</a>
5958
5959 <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',false);">[None]</a>
5960
5961 </div><br style="clear:both" />
5962
5963 <select id="plugins" name="plugins[]" multiple="multiple" style="width:315px; height:100px">
5964
5965 <?php
5966
5967 foreach ($active_plugins as $plugin) {
5968
5969 echo '<option selected="selected" value="' . DupUtil::esc_html_attr( $plugin ) . '">' . dirname($plugin) . '</option>';
5970
5971 }
5972
5973 ?>
5974
5975 </select>
5976
5977 </td>
5978
5979 </tr>
5980
5981 </table><br/>
5982
5983
5984
5985 <input type="checkbox" name="postguid" id="postguid" value="1" /> <label for="postguid">Keep Post GUID unchanged</label><br/>
5986
5987
5988
5989 <input type="checkbox" name="fullsearch" id="fullsearch" value="1" /> <label for="fullsearch">Enable Full Search <small>(very slow)</small> </label><br/>
5990
5991 <br/><br/><br/><br/>
5992
5993
5994
5995 </div>
5996
5997
5998
5999 <div class="dup-footer-buttons">
6000
6001 <input id="dup-step2-next" type="button" value=" Run Update " onclick="Duplicator.runUpdate()" />
6002
6003 </div>
6004
6005</form>
6006
6007
6008
6009
6010
6011<!-- =========================================
6012
6013VIEW: STEP 2 - AJAX RESULT -->
6014
6015<form id='dup-step2-result-form' method="post" class="content-form" style="display:none">
6016
6017 <input type="hidden" name="action_step" value="3" />
6018
6019 <input type="hidden" name="package_name" value="<?php echo $_POST['package_name'] ?>" />
6020
6021 <!-- Set via jQuery -->
6022
6023 <input type="hidden" name="url_new" id="ajax-url_new" />
6024
6025 <input type="hidden" name="json" id="ajax-json" />
6026
6027
6028
6029 <div class="dup-logfile-link"><a href="installer-log.txt" target="_blank">installer-log.txt</a></div>
6030
6031 <h3>Step 2: Update Table Data</h3>
6032
6033 <hr size="1" />
6034
6035
6036
6037 <!-- PROGRESS BAR -->
6038
6039 <div id="progress-area">
6040
6041 <div style="width:500px; margin:auto">
6042
6043 <h3>Processing Data Replacement Please Wait...</h3>
6044
6045 <div id="progress-bar"></div>
6046
6047 <i>This may take several minutes</i>
6048
6049 </div>
6050
6051 </div>
6052
6053
6054
6055 <!-- AJAX SYSTEM ERROR -->
6056
6057 <div id="ajaxerr-area" style="display:none">
6058
6059 <p>Please try again an issue has occurred.</p>
6060
6061 <div style="padding: 0px 10px 10px 10px;">
6062
6063 <div id="ajaxerr-data">An unknown issue has occurred with the data replacement setup process. Please see the installer-log.txt file for more details.</div>
6064
6065 <div style="text-align:center; margin:10px auto 0px auto">
6066
6067 <input type="button" onclick='Duplicator.hideErrorResult2()' value="« Try Again" /><br/><br/>
6068
6069 <i style='font-size:11px'>See online help for more details at <a href='http://lifeinthegrid.com/support' target='_blank'>support.lifeinthegrid.com</a></i>
6070
6071 </div>
6072
6073 </div>
6074
6075 </div>
6076
6077</form>
6078
6079
6080
6081 <?php
6082
6083 break;
6084
6085 case "3" :
6086
6087 ?> <?php
6088 // Exit if accessed directly
6089 if (! defined('DUPLICATOR_INIT')) {
6090 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
6091 $_baseURL = "http://" . $_baseURL;
6092 header("HTTP/1.1 301 Moved Permanently");
6093 header("Location: $_baseURL");
6094 exit;
6095 }
6096?>
6097<script type="text/javascript">
6098 /** **********************************************
6099 * METHOD: Posts to page to remove install files */
6100 Duplicator.removeInstallerFiles = function(package_name) {
6101 var msg = "You will now be redirected to the cleanup page.\nSelect 'Delete Reserved Files' to remove installer files.";
6102 alert(msg);
6103
6104 var nurl = '<?php echo rtrim($_POST['url_new'], "/"); ?>/wp-admin/admin.php?page=duplicator-tools&tab=cleanup';
6105 window.open(nurl, "_blank");
6106 };
6107</script>
6108
6109
6110<!-- =========================================
6111VIEW: STEP 3- INPUT -->
6112<form id='dup-step3-input-form' method="post" class="content-form" style="line-height:20px">
6113 <input type="hidden" name="url_new" id="url_new" value="<?php echo rtrim($_POST['url_new'], "/"); ?>" />
6114 <div class="dup-logfile-link"><a href="installer-log.txt" target="_blank">installer-log.txt</a></div>
6115 <h3>Step 3: Test Site</h3>
6116 <hr size="1" /><br />
6117
6118 <div class="title-header">
6119 <div class="dup-step3-final-title">VERY IMPORTANT FINAL STEPS!</div>
6120 </div>
6121
6122 <table class="dup-step3-final-step">
6123 <tr>
6124 <td>1. <a href="javascript:void(0)" onclick="$('#dup-step3-install-report').toggle(400)">Review Install Report</a>
6125 </td>
6126 <td>
6127 <i id="dup-step3-install-report-count">
6128 <b>Errors:</b>
6129 <span data-bind="with: status.step1">Deploy (<span data-bind="text: query_errs"></span>)</span>
6130 <span data-bind="with: status.step2">Update (<span data-bind="text: err_all"></span>)</span>
6131 <span data-bind="with: status.step2" style="color:#888"><b>Warnings:</b> (<span data-bind="text: warn_all"></span>)</span>
6132 </i>
6133 </td>
6134 </tr>
6135 <tr>
6136 <td style="width:170px">
6137 2. <a href='<?php echo rtrim($_POST['url_new'], "/"); ?>/wp-admin/options-permalink.php' target='_blank'> Save Permalinks</a>
6138 </td>
6139 <td><i>Updates URL rewrite rules in .htaccess (requires login)</i></td>
6140 </tr>
6141 <tr>
6142 <td>3. <a href='<?php echo $_POST['url_new']; ?>' target='_blank'>Test Site</a></td>
6143 <td><i>Validate all pages, links images and plugins</i></td>
6144 </tr>
6145 <tr>
6146 <td>4. <a href="javascript:void(0)" onclick="Duplicator.removeInstallerFiles('<?php echo $_POST['package_name'] ?>')">Security Cleanup</a></td>
6147 <td><i>Validate installer files are removed (requires login)</i></td>
6148 </tr>
6149 </table><br/>
6150
6151 <div class="dup-step3-go-back">
6152 <i style='font-size:11px'>To re-install <a href="javascript:history.go(-2)">start over at step 1</a>.</i><br/>
6153 <i style="font-size:11px;">The .htaccess file was reset. Resave plugins that write to this file.</i>
6154 </div>
6155
6156
6157 <!-- ========================
6158 INSTALL REPORT -->
6159 <div id="dup-step3-install-report" style='display:none'>
6160 <table class='dup-step3-report-results' style="width:100%">
6161 <tr><th colspan="4">Database Results</th></tr>
6162 <tr style="font-weight:bold">
6163 <td style="width:150px"></td>
6164 <td>Tables</td>
6165 <td>Rows</td>
6166 <td>Cells</td>
6167 </tr>
6168 <tr data-bind="with: status.step1">
6169 <td>Created</td>
6170 <td><span data-bind="text: table_count"></span></td>
6171 <td><span data-bind="text: table_rows"></span></td>
6172 <td>n/a</td>
6173 </tr>
6174 <tr data-bind="with: status.step2">
6175 <td>Scanned</td>
6176 <td><span data-bind="text: scan_tables"></span></td>
6177 <td><span data-bind="text: scan_rows"></span></td>
6178 <td><span data-bind="text: scan_cells"></span></td>
6179 </tr>
6180 <tr data-bind="with: status.step2">
6181 <td>Updated</td>
6182 <td><span data-bind="text: updt_tables"></span></td>
6183 <td><span data-bind="text: updt_rows"></span></td>
6184 <td><span data-bind="text: updt_cells"></span></td>
6185 </tr>
6186 </table>
6187
6188 <table class='dup-step3-report-errs' style="width:100%; border-top:none">
6189 <tr><th colspan="4">Errors & Warnings <br/> <i style="font-size:10px; font-weight:normal">(click links below to view details)</i></th></tr>
6190 <tr>
6191 <td data-bind="with: status.step1">
6192 <a href="javascript:void(0);" onclick="$('#dup-step3-errs-create').toggle(400)">Step1: Deploy Errors (<span data-bind="text: query_errs"></span>)</a><br/>
6193 </td>
6194 <td data-bind="with: status.step2">
6195 <a href="javascript:void(0);" onclick="$('#dup-step3-errs-upd').toggle(400)">Step2: Update Errors (<span data-bind="text: err_all"></span>)</a>
6196 </td>
6197 <td data-bind="with: status.step2">
6198 <a href="#dup-step2-errs-warn-anchor" onclick="$('#dup-step3-warnlist').toggle(400)">General Warnings (<span data-bind="text: warn_all"></span>)</a>
6199 </td>
6200 </tr>
6201 <tr><td colspan="4"></td></tr>
6202 </table>
6203
6204
6205 <div id="dup-step3-errs-create" class="dup-step3-err-msg">
6206
6207 <b data-bind="with: status.step1">STEP 1: DEPLOY ERRORS (<span data-bind="text: query_errs"></span>)</b><br/>
6208 <div class="info">Queries that error during the deploy process are logged to the <a href="installer-log.txt" target="_blank">install-log.txt</a> file.
6209 To view the error result look under the section titled 'DATABASE RESULTS'. If errors are present they will be marked with '**ERROR**'. <br/><br/> For errors titled
6210 'Query size limit' you will need to manually post the values or update your mysql server with the max_allowed_packet setting to handle larger payloads.
6211 If your on a hosted server you will need to contact the server admin, for more details see: https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html. <br/><br/>
6212 </div>
6213
6214 </div>
6215
6216
6217 <div id="dup-step3-errs-upd" class="dup-step3-err-msg">
6218
6219 <!-- MYSQL QUERY ERRORS -->
6220 <b data-bind="with: status.step2">STEP2: UPDATE ERRORS (<span data-bind="text: errsql_sum"></span>) </b><br/>
6221 <div class="info">Errors that show here are the result of queries that could not be performed.</div>
6222 <div class="content">
6223 <div data-bind="foreach: status.step2.errsql"><div data-bind="text: $data"></div></div>
6224 <div data-bind="visible: status.step2.errsql.length == 0">No MySQL query errors found</div>
6225 </div>
6226
6227 <!-- TABLE KEY ERRORS -->
6228 <b data-bind="with: status.step2">TABLE KEY ERRORS (<span data-bind="text: errkey_sum"></span>)</b><br/>
6229 <div class="info">
6230 A primary key is required on a table to efficiently run the update engine. Below is a list of tables and the rows that will need to
6231 be manually updated. Use the query below to find the data.<br/>
6232 <i>SELECT @row := @row + 1 as row, t.* FROM some_table t, (SELECT @row := 0) r</i>
6233 </div>
6234 <div class="content">
6235 <div data-bind="foreach: status.step2.errkey"><div data-bind="text: $data"></div></div>
6236 <div data-bind="visible: status.step2.errkey.length == 0">No missing primary key errors</div>
6237 </div>
6238
6239 <!-- SERIALIZE ERRORS -->
6240 <b data-bind="with: status.step2">SERIALIZATION ERRORS (<span data-bind="text: errser_sum"></span>)</b><br/>
6241 <div class="info">
6242 Use the SQL below to display data that may have not been updated correctly during the serialization process.
6243 </div>
6244 <div class="content">
6245 <div data-bind="foreach: status.step2.errser"><div data-bind="text: $data"></div></div>
6246 <div data-bind="visible: status.step2.errser.length == 0">No serialization errors found</div>
6247 </div>
6248
6249 </div>
6250
6251
6252 <!-- WARNINGS-->
6253 <div id="dup-step3-warnlist" class="dup-step3-err-msg">
6254 <a href="#" id="dup-step2-errs-warn-anchor"></a>
6255 <b>GENERAL WARNINGS</b><br/>
6256 <div class="info">
6257 The following is a list of warnings that may need to be fixed in order to finalize your setup. For more details about
6258 warnings see the <a href="http://codex.wordpress.org/" target="_blank">wordpress codex.</a>.
6259 </div>
6260 <div class="content">
6261 <div data-bind="foreach: status.step2.warnlist">
6262 <div data-bind="text: $data"></div>
6263 </div>
6264 <div data-bind="visible: status.step2.warnlist.length == 0">
6265 No warnings found
6266 </div>
6267 </div>
6268 </div><br/>
6269
6270
6271 </div><br/><br/>
6272
6273 <div class='dup-step3-connect'>
6274 <a href="installer.php?help=1#troubleshoot" target="_blank">Troubleshoot</a> |
6275 <a href='http://support.lifeinthegrid.com/knowledgebase.php' target='_blank'>FAQs</a> |
6276 <a href='http://lifeinthegrid.com/duplicator' target='_blank'>Support</a> |
6277 <a href='http://snapcreek.com/duplicator/' target='_blank'>Go Pro!</a>
6278 </div><br/>
6279</form>
6280
6281<script type="text/javascript">
6282 MyViewModel = function() {
6283 this.status = <?php echo urldecode($_POST['json']); ?>;
6284 var errorCount = this.status.step2.err_all || 0;
6285 (errorCount >= 1 )
6286 ? $('#dup-step3-install-report-count').css('color', '#BE2323')
6287 : $('#dup-step3-install-report-count').css('color', '#197713')
6288 };
6289 ko.applyBindings(new MyViewModel());
6290</script>
6291
6292 <?php
6293
6294 break;
6295
6296}
6297
6298} else {
6299
6300 ?> <?php
6301
6302 // Exit if accessed directly
6303
6304 if (! defined('DUPLICATOR_INIT')) {
6305
6306 $_baseURL = strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
6307
6308 $_baseURL = "http://" . $_baseURL;
6309
6310 header("HTTP/1.1 301 Moved Permanently");
6311
6312 header("Location: $_baseURL");
6313
6314 exit;
6315
6316 }
6317
6318?>
6319
6320<!-- =========================================
6321
6322HELP FORM -->
6323
6324<div id="dup-main-help">
6325
6326 <div style="text-align:center">For in-depth help please see the <a href="http://lifeinthegrid.com/duplicator-docs" target="_blank">online resources</a></div>
6327
6328
6329
6330 <h3>Step 1 - Deploy</h3>
6331
6332 <div id="dup-help-step1" class="dup-help-page">
6333
6334 <!-- MYSQL SERVER -->
6335
6336 <fieldset>
6337
6338 <legend><b>MySQL Server</b></legend>
6339
6340
6341
6342 <b>Action:</b><br/>
6343
6344 'Create New' will attempt to create a new database if it does not exist. This option will not work on many hosting providers. If the database does not exist then you will need to login to your control panel and create the database. If 'Connect and Remove All Data' is checked this will DELETE all tables in the database you are connecting to as the Duplicator requires a blank database. Please make sure you have backups of all your data before using an portion of the installer, as this option WILL remove all data. Please contact your server administrator for more details.
6345
6346 <br/><br/>
6347
6348
6349
6350 <b>Host:</b><br/>
6351
6352 The name of the host server that the database resides on. Many times this will be localhost, however each hosting provider will have it's own naming convention please check with your server administrator. To add a port number just append it to the host i.e. 'localhost:3306'.
6353
6354 <br/><br/>
6355
6356
6357
6358 <b>User:</b><br/>
6359
6360 The name of a MySQL database server user. This is special account that has privileges to access a database and can read from or write to that database. <i style='font-size:11px'>This is <b>not</b> the same thing as your WordPress administrator account</i>
6361
6362 <br/><br/>
6363
6364
6365
6366 <b>Password:</b><br/>
6367
6368 The password of the MySQL database server user.
6369
6370 <br/><br/>
6371
6372
6373
6374 <b>Name:</b><br/>
6375
6376 The name of the database to which this installation will connect and install the new tables onto.
6377
6378 <br/><br/>
6379
6380
6381
6382 <div class="help" style="border-top:1px solid silver">
6383
6384 <b>Common Database Connection Issues:</b><br/>
6385
6386 - Double check case sensitive values 'User', 'Password' & the 'Database Name' <br/>
6387
6388 - Validate the database and database user exist on this server <br/>
6389
6390 - Check if the database user has the correct permission levels to this database <br/>
6391
6392 - The host 'localhost' may not work on all hosting providers <br/>
6393
6394 - Contact your hosting provider for the exact required parameters <br/>
6395
6396 - See the 'Database Setup Help' section on step 1 for more details<br/>
6397
6398 - Visit the online resources 'Common FAQ page' <br/>
6399
6400 </div>
6401
6402
6403
6404
6405
6406 </fieldset>
6407
6408
6409
6410 <!-- ADVANCED OPTS -->
6411
6412 <fieldset>
6413
6414 <legend><b>Advanced Options</b></legend>
6415
6416 <b>Manual Package Extraction:</b><br/>
6417
6418 This allows you to manually extract the zip archive on your own. This can be useful if your system does not have the ZipArchive support enabled.
6419
6420 <br/><br/>
6421
6422
6423
6424 <b>Enforce SSL on Admin:</b><br/>
6425
6426 Turn off SSL support for WordPress. This sets FORCE_SSL_ADMIN in your wp-config file to false if true, otherwise it will create the setting if not set.
6427
6428 <br/><br/>
6429
6430
6431
6432 <b>Enforce SSL on Login:</b><br/>
6433
6434 Turn off SSL support for WordPress Logins. This sets FORCE_SSL_LOGIN in your wp-config file to false if true, otherwise it will create the setting if not set.
6435
6436 <br/><br/>
6437
6438
6439
6440 <b>Keep Cache Enabled:</b><br/>
6441
6442 Turn off Cache support for WordPress. This sets WP_CACHE in your wp-config file to false if true, otherwise it will create the setting if not set.
6443
6444 <br/><br/>
6445
6446
6447
6448 <b>Keep Cache Home Path:</b><br/>
6449
6450 This sets WPCACHEHOME in your wp-config file to nothing if true, otherwise nothing is changed.
6451
6452 <br/><br/>
6453
6454
6455
6456 <b>Fix non-breaking space characters:</b><br/>
6457
6458 The process will remove utf8 characters represented as 'xC2' 'xA0' and replace with a uniform space. Use this option if you find strange question marks in you posts
6459
6460 <br/><br/>
6461
6462
6463
6464 <b>MySQL Charset & MySQL Collation:</b><br/>
6465
6466 When the database is populated from the SQL script it will use this value as part of its connection. Only change this value if you know what your databases character set should be.
6467
6468 <br/>
6469
6470 </fieldset>
6471
6472 </div>
6473
6474
6475
6476 <h3>Step 2 - Update</h3>
6477
6478 <div id="dup-help-step2" class="dup-help-page">
6479
6480
6481
6482 <!-- SETTINGS-->
6483
6484 <fieldset>
6485
6486 <legend><b>Settings</b></legend>
6487
6488 <b>Old Settings:</b><br/>
6489
6490 The URL and Path settings are the original values that the package was created with. These values should not be changed.
6491
6492 <br/><br/>
6493
6494
6495
6496 <b>New Settings:</b><br/>
6497
6498 These are the new values (URL, Path and Title) you can update for the new location at which your site will be installed at.
6499
6500 <br/>
6501
6502 </fieldset>
6503
6504
6505
6506 <!-- NEW ADMIN ACCOUNT-->
6507
6508 <fieldset>
6509
6510 <legend><b>New Admin Account</b></legend>
6511
6512 <b>Username:</b><br/>
6513
6514 The new username to create. This will create a new WordPress administrator account. Please note that usernames are not changeable from the within the UI.
6515
6516 <br/><br/>
6517
6518
6519
6520 <b>Password:</b><br/>
6521
6522 The new password for the user.
6523
6524 <br/>
6525
6526 </fieldset>
6527
6528
6529
6530 <!-- ADVANCED OPTS -->
6531
6532 <fieldset>
6533
6534 <legend><b>Advanced Options</b></legend>
6535
6536 <b>Site URL:</b><br/>
6537
6538 For details see WordPress <a href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">Site URL</a> & <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory" target="_blank">Alternate Directory</a>. If you're not sure about this value then leave it the same as the new settings URL.
6539
6540 <br/><br/>
6541
6542
6543
6544 <b>Scan Tables:</b><br/>
6545
6546 Select the tables to be updated. This process will update all of the 'Old Settings' with the 'New Settings'. Hold down the 'ctrl key' to select/deselect multiple.
6547
6548 <br/><br/>
6549
6550
6551
6552 <b>Activate Plugins:</b><br/>
6553
6554 These plug-ins are the plug-ins that were activated when the package was created and represent the plug-ins that will be activated after the install.
6555
6556 <br/><br/>
6557
6558
6559
6560 <b>Post GUID:</b><br/>
6561
6562 If your moving a site keep this value checked. For more details see the <a href="http://codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note" target="_blank">notes on GUIDS</a>. Changing values in the posts table GUID column can change RSS readers to evaluate that the posts are new and may show them in feeds again.
6563
6564 <br/><br/>
6565
6566
6567
6568 <b>Full Search:</b><br/>
6569
6570 Full search forces a scan of every single cell in the database. If it is not checked then only text based columns are searched which makes the update process much faster.
6571
6572 <br/>
6573
6574 </fieldset>
6575
6576
6577
6578 </div>
6579
6580
6581
6582 <h3>Step 3 - Test</h3>
6583
6584 <div id="dup-help-step3" class="dup-help-page">
6585
6586 <fieldset>
6587
6588 <legend><b>Final Steps</b></legend>
6589
6590
6591
6592 <b>Resave Permalinks</b><br/>
6593
6594 Re-saving your perma-links will reconfigure your .htaccess file to match the correct path on your server. This step requires logging back into the WordPress administrator.
6595
6596 <br/><br/>
6597
6598
6599
6600 <b>Delete Installer Files</b><br/>
6601
6602 When you're completed with the installation please delete all installer files. Leaving these files on your server can impose a security risk!
6603
6604 <br/><br/>
6605
6606
6607
6608 <b>Test Entire Site</b><br/>
6609
6610 After the install is complete run through your entire site and test all pages and posts.
6611
6612 <br/><br/>
6613
6614
6615
6616 <b>View Install Report</b><br/>
6617
6618 The install report is designed to give you a synopsis of the possible errors and warnings that may exist after the installation is completed.
6619
6620 <br/>
6621
6622 </fieldset>
6623
6624 </div>
6625
6626
6627
6628
6629
6630 <h3>Troubleshooting Tips</h3>
6631
6632 <div id="troubleshoot" class="dup-help-page">
6633
6634 <fieldset>
6635
6636 <legend><b>Quick Overview</b></legend>
6637
6638
6639
6640 <div style="padding: 0px 10px 10px 10px;">
6641
6642 <b>Common Quick Fix Issues:</b>
6643
6644 <ul>
6645
6646 <li>Use an <a href='http://lifeinthegrid.com/duplicator-hosts' target='_blank'>approved hosting provider</a></li>
6647
6648 <li>Validate directory and file permissions (see below)</li>
6649
6650 <li>Validate web server configuration file (see below)</li>
6651
6652 <li>Clear your browsers cache</li>
6653
6654 <li>Deactivate and reactivate all plugins</li>
6655
6656 <li>Resave a plugins settings if it reports errors</li>
6657
6658 <li>Make sure your root directory is empty</li>
6659
6660 </ul>
6661
6662
6663
6664 <b>Permissions:</b><br/>
6665
6666 Not all operating systems are alike. Therefore, when you move a package (zip file) from one location to another the file and directory permissions may not always stick. If this is the case then check your WordPress directories and make sure it's permissions are set to 755. For files make sure the permissions are set to 644 (this does not apply to windows servers). Also pay attention to the owner/group attributes. For a full overview of the correct file changes see the <a href='http://codex.wordpress.org/Hardening_WordPress#File_permissions' target='_blank'>WordPress permissions codex</a>
6667
6668 <br/><br/>
6669
6670
6671
6672 <b>Web server configuration files:</b><br/>
6673
6674 For Apache web server the root .htaccess file was copied to .htaccess.orig. A new stripped down .htaccess file was created to help simplify access issues. For IIS web server the web.config file was copied to web.config.orig, however no new web.config file was created. If you have not altered this file manually then resaving your permalinks and resaving your plugins should resolve most all changes that were made to the root web configuration file. If your still experiencing issues then open the .orig file and do a compare to see what changes need to be made. <br/><br/><b>Plugin Notes:</b><br/> It's impossible to know how all 3rd party plugins function. The Duplicator attempts to fix the new install URL for settings stored in the WordPress options table. Please validate that all plugins retained there settings after installing. If you experience issues try to bulk deactivate all plugins then bulk reactivate them on your new duplicated site. If you run into issues were a plugin does not retain its data then try to resave the plugins settings.
6675
6676 <br/><br/>
6677
6678
6679
6680 <b>Cache Systems:</b><br/>
6681
6682 Any type of cache system such as Super Cache, W3 Cache, etc. should be emptied before you create a package. Another alternative is to include the cache directory in the directory exclusion path list found in the options dialog. Including a directory such as \pathtowordpress\wp-content\w3tc\ (the w3 Total Cache directory) will exclude this directory from being packaged. In is highly recommended to always perform a cache empty when you first fire up your new site even if you excluded your cache directory.
6683
6684 <br/><br/>
6685
6686
6687
6688 <b>Trying Again:</b><br/>
6689
6690 If you need to retry and reinstall this package you can easily run the process again by deleting all files except the installer.php and package file and then browse to the installer.php again.
6691
6692 <br/><br/>
6693
6694
6695
6696 <b>Additional Notes:</b><br/>
6697
6698 If you have made changes to your PHP files directly this might have an impact on your duplicated site. Be sure all changes made will correspond to the sites new location.
6699
6700 Only the package (zip file) and the installer.php file should be in the directory where you are installing the site. Please read through our knowledge base before submitting any issues.
6701
6702 If you have a large log file that needs evaluated please email the file, or attach it to a help ticket.
6703
6704 <br/><br/>
6705
6706
6707
6708 </div>
6709
6710 </fieldset>
6711
6712 </div>
6713
6714
6715
6716 <div style="text-align:center">For in-depth help please see the <a href="http://lifeinthegrid.com/duplicator-docs" target="_blank">online resources</a></div>
6717
6718
6719
6720 <br/><br/>
6721
6722</div> <?php
6723
6724}
6725
6726
6727
6728?>
6729
6730 </div>
6731
6732</div><br/>
6733
6734
6735
6736
6737
6738</body>
6739
6740</html>