From 279a1586815de16c1f879933d805823d33f14d7f Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 18 Apr 2018 15:05:30 +0200 Subject: Deployed to server - fixed settings page --- main/app/sprinkles/ConfigManager/CHANGELOG.md | 0 main/app/sprinkles/ConfigManager/LICENSE | 0 main/app/sprinkles/ConfigManager/README.md | 0 .../app/sprinkles/ConfigManager/asset-bundles.json | 0 .../ConfigManager/assets/js/ConfigManager.js | 0 main/app/sprinkles/ConfigManager/composer.json | 0 .../ConfigManager/locale/en_US/AdminLTE.php | 0 .../ConfigManager/locale/en_US/ConfigManager.php | 0 .../ConfigManager/locale/fr_FR/AdminLTE.php | 0 .../ConfigManager/locale/fr_FR/ConfigManager.php | 0 .../ConfigManager/routes/ConfigManager.php | 0 .../ConfigManager/schema/config/AdminLTE.json | 0 .../ConfigManager/schema/config/site.json | 0 .../sprinkles/ConfigManager/src/ConfigManager.php | 0 .../src/Controller/ConfigManagerController.php | 0 .../src/Database/Migrations/v100/SettingsTable.php | 0 .../Migrations/v101/SettingsPermissions.php | 0 .../ConfigManager/src/Database/Models/Config.php | 0 .../src/ServicesProvider/ServicesProvider.php | 0 .../ConfigManager/src/Util/ConfigManager.php | 0 .../templates/pages/ConfigManager.html.twig | 0 main/app/sprinkles/FormGenerator/.gitignore | 0 main/app/sprinkles/FormGenerator/CHANGELOG.md | 0 main/app/sprinkles/FormGenerator/LICENSE | 0 main/app/sprinkles/FormGenerator/README.md | 0 .../app/sprinkles/FormGenerator/asset-bundles.json | 0 .../assets/js/widget-formGenerator.js | 0 main/app/sprinkles/FormGenerator/bower.json | 0 main/app/sprinkles/FormGenerator/composer.json | 0 .../FormGenerator/locale/en_US/FormGenerator.php | 0 .../FormGenerator/locale/fr_FR/FormGenerator.php | 0 .../FormGenerator/routes/FormGenerator.php | 0 .../src/Controller/FormGeneratorController.php | 0 .../sprinkles/FormGenerator/src/Element/Alert.php | 0 .../FormGenerator/src/Element/BaseInput.php | 0 .../FormGenerator/src/Element/Checkbox.php | 0 .../sprinkles/FormGenerator/src/Element/Hidden.php | 0 .../FormGenerator/src/Element/InputInterface.php | 0 .../sprinkles/FormGenerator/src/Element/Select.php | 0 .../sprinkles/FormGenerator/src/Element/Text.php | 0 .../FormGenerator/src/Element/Textarea.php | 0 main/app/sprinkles/FormGenerator/src/Form.php | 0 .../FormGenerator/FormGenerator.html.twig | 0 .../templates/FormGenerator/confirm.html.twig | 0 .../templates/FormGenerator/macros/alert.html.twig | 0 .../FormGenerator/macros/checkbox.html.twig | 0 .../FormGenerator/macros/hidden.html.twig | 0 .../FormGenerator/macros/select.html.twig | 0 .../templates/FormGenerator/macros/text.html.twig | 0 .../FormGenerator/macros/textarea.html.twig | 0 .../templates/FormGenerator/modal-large.html.twig | 0 .../templates/FormGenerator/modal.html.twig | 0 .../templates/FormGenerator/typehead.html.twig | 0 .../FormGenerator/tests/Unit/FormGeneratorTest.php | 0 .../FormGenerator/tests/Unit/data/bad.json | 0 .../FormGenerator/tests/Unit/data/good.json | 0 main/app/sprinkles/account/asset-bundles.json | 0 .../userfrosting/js/pages/account-settings.js | 0 .../userfrosting/js/pages/forgot-password.js | 0 .../assets/userfrosting/js/pages/register.js | 0 .../userfrosting/js/pages/resend-verification.js | 0 .../userfrosting/js/pages/set-or-reset-password.js | 0 .../assets/userfrosting/js/pages/sign-in.js | 0 main/app/sprinkles/account/bower.json | 0 main/app/sprinkles/account/composer.json | 0 main/app/sprinkles/account/config/default.php | 0 main/app/sprinkles/account/config/production.php | 0 .../sprinkles/account/factories/Permissions.php | 0 main/app/sprinkles/account/factories/Roles.php | 0 main/app/sprinkles/account/factories/Users.php | 0 main/app/sprinkles/account/locale/ar/messages.php | 0 main/app/sprinkles/account/locale/ar/validate.php | 36 +- .../sprinkles/account/locale/de_DE/messages.php | 0 .../sprinkles/account/locale/de_DE/validate.php | 0 .../sprinkles/account/locale/en_US/messages.php | 0 .../sprinkles/account/locale/en_US/validate.php | 0 .../sprinkles/account/locale/es_ES/messages.php | 0 .../sprinkles/account/locale/es_ES/validate.php | 0 main/app/sprinkles/account/locale/fa/messages.php | 0 main/app/sprinkles/account/locale/fa/validate.php | 0 .../sprinkles/account/locale/fr_FR/messages.php | 0 .../sprinkles/account/locale/fr_FR/validate.php | 0 .../sprinkles/account/locale/it_IT/messages.php | 0 .../sprinkles/account/locale/it_IT/validate.php | 0 .../sprinkles/account/locale/pt_PT/messages.php | 0 .../sprinkles/account/locale/pt_PT/validate.php | 0 .../sprinkles/account/locale/ru_RU/messages.php | 0 .../sprinkles/account/locale/ru_RU/validate.php | 0 .../sprinkles/account/locale/th_TH/messages.php | 328 +- .../sprinkles/account/locale/th_TH/validate.php | 36 +- main/app/sprinkles/account/locale/tr/messages.php | 0 main/app/sprinkles/account/locale/tr/validate.php | 0 .../sprinkles/account/locale/zh_CN/messages.php | 0 .../sprinkles/account/locale/zh_CN/validate.php | 0 main/app/sprinkles/account/routes/routes.php | 0 .../account/schema/requests/account-settings.yaml | 0 .../account/schema/requests/account-verify.yaml | 0 .../account/schema/requests/check-username.yaml | 0 .../account/schema/requests/deny-password.yaml | 0 .../account/schema/requests/forgot-password.yaml | 0 .../sprinkles/account/schema/requests/login.yaml | 0 .../account/schema/requests/profile-settings.yaml | 0 .../account/schema/requests/register.yaml | 0 .../schema/requests/resend-verification.yaml | 0 .../account/schema/requests/set-password.yaml | 0 main/app/sprinkles/account/src/Account.php | 0 .../account/src/Authenticate/AuthGuard.php | 0 .../account/src/Authenticate/Authenticator.php | 0 .../Exception/AccountDisabledException.php | 0 .../Exception/AccountInvalidException.php | 0 .../Exception/AccountNotVerifiedException.php | 0 .../Exception/AuthCompromisedException.php | 0 .../Exception/AuthExpiredException.php | 0 .../Exception/InvalidCredentialsException.php | 0 .../sprinkles/account/src/Authenticate/Hasher.php | 0 .../src/Authorize/AccessConditionExpression.php | 0 .../src/Authorize/AuthorizationException.php | 0 .../account/src/Authorize/AuthorizationManager.php | 0 .../src/Authorize/ParserNodeFunctionEvaluator.php | 0 .../account/src/Bakery/CreateAdminUser.php | 0 .../account/src/Controller/AccountController.php | 0 .../Exception/SpammyRequestException.php | 0 .../Database/Migrations/v400/ActivitiesTable.php | 0 .../src/Database/Migrations/v400/GroupsTable.php | 0 .../Migrations/v400/PasswordResetsTable.php | 0 .../Migrations/v400/PermissionRolesTable.php | 0 .../Database/Migrations/v400/PermissionsTable.php | 0 .../Database/Migrations/v400/PersistencesTable.php | 0 .../Database/Migrations/v400/RoleUsersTable.php | 0 .../src/Database/Migrations/v400/RolesTable.php | 0 .../src/Database/Migrations/v400/UsersTable.php | 0 .../Migrations/v400/VerificationsTable.php | 0 .../account/src/Database/Models/Activity.php | 0 .../account/src/Database/Models/Group.php | 0 .../account/src/Database/Models/PasswordReset.php | 0 .../account/src/Database/Models/Permission.php | 0 .../sprinkles/account/src/Database/Models/Role.php | 0 .../sprinkles/account/src/Database/Models/User.php | 0 .../account/src/Database/Models/Verification.php | 0 .../Handler/AuthCompromisedExceptionHandler.php | 0 .../Error/Handler/AuthExpiredExceptionHandler.php | 0 .../Error/Handler/ForbiddenExceptionHandler.php | 0 .../app/sprinkles/account/src/Facades/Password.php | 0 .../src/Log/UserActivityDatabaseHandler.php | 0 .../account/src/Log/UserActivityProcessor.php | 0 .../src/Repository/PasswordResetRepository.php | 0 .../account/src/Repository/TokenRepository.php | 0 .../src/Repository/VerificationRepository.php | 0 .../src/ServicesProvider/ServicesProvider.php | 0 .../account/src/Twig/AccountExtension.php | 0 .../account/src/Util/HashFailedException.php | 0 main/app/sprinkles/account/src/Util/Util.php | 0 .../templates/forms/settings-account.html.twig | 0 .../templates/forms/settings-profile.html.twig | 0 .../templates/mail/password-reset.html.twig | 0 .../templates/mail/resend-verification.html.twig | 0 .../templates/mail/verify-account.html.twig | 0 .../account/templates/modals/tos.html.twig | 0 .../templates/navigation/main-nav.html.twig | 0 .../templates/navigation/user-card.html.twig | 0 .../templates/pages/account-settings.html.twig | 4 +- .../templates/pages/error/compromised.html.twig | 0 .../templates/pages/forgot-password.html.twig | 0 .../account/templates/pages/register.html.twig | 0 .../templates/pages/resend-verification.html.twig | 0 .../templates/pages/reset-password.html.twig | 0 .../account/templates/pages/set-password.html.twig | 0 .../account/templates/pages/sign-in.html.twig | 0 .../sprinkles/account/tests/Unit/FactoriesTest.php | 0 .../sprinkles/account/tests/Unit/HasherTest.php | 0 main/app/sprinkles/admin/asset-bundles.json | 0 .../assets/userfrosting/css/tablesorter-custom.css | 0 .../assets/userfrosting/js/pages/activities.js | 0 .../assets/userfrosting/js/pages/dashboard.js | 0 .../admin/assets/userfrosting/js/pages/group.js | 0 .../admin/assets/userfrosting/js/pages/groups.js | 0 .../assets/userfrosting/js/pages/permission.js | 0 .../assets/userfrosting/js/pages/permissions.js | 0 .../admin/assets/userfrosting/js/pages/role.js | 0 .../admin/assets/userfrosting/js/pages/roles.js | 0 .../admin/assets/userfrosting/js/pages/user.js | 0 .../admin/assets/userfrosting/js/pages/users.js | 0 .../admin/assets/userfrosting/js/widgets/groups.js | 0 .../admin/assets/userfrosting/js/widgets/roles.js | 0 .../admin/assets/userfrosting/js/widgets/users.js | 0 main/app/sprinkles/admin/composer.json | 0 main/app/sprinkles/admin/locale/ar/messages.php | 0 main/app/sprinkles/admin/locale/de_DE/messages.php | 0 main/app/sprinkles/admin/locale/en_US/messages.php | 0 main/app/sprinkles/admin/locale/es_ES/messages.php | 0 main/app/sprinkles/admin/locale/fa/messages.php | 0 main/app/sprinkles/admin/locale/fr_FR/messages.php | 0 main/app/sprinkles/admin/locale/it_IT/messages.php | 0 main/app/sprinkles/admin/locale/pt_PT/messages.php | 0 main/app/sprinkles/admin/locale/ru_RU/messages.php | 0 main/app/sprinkles/admin/locale/th_TH/messages.php | 266 +- main/app/sprinkles/admin/locale/tr/messages.php | 0 main/app/sprinkles/admin/locale/zh_CN/messages.php | 0 main/app/sprinkles/admin/routes/activities.php | 0 main/app/sprinkles/admin/routes/admin.php | 0 main/app/sprinkles/admin/routes/groups.php | 0 main/app/sprinkles/admin/routes/permissions.php | 0 main/app/sprinkles/admin/routes/roles.php | 0 main/app/sprinkles/admin/routes/users.php | 0 .../admin/schema/requests/group/create.yaml | 0 .../admin/schema/requests/group/edit-info.yaml | 0 .../admin/schema/requests/group/get-by-slug.yaml | 0 .../admin/schema/requests/role/create.yaml | 0 .../admin/schema/requests/role/edit-field.yaml | 0 .../admin/schema/requests/role/edit-info.yaml | 0 .../admin/schema/requests/role/get-by-slug.yaml | 0 .../admin/schema/requests/user/create.yaml | 0 .../admin/schema/requests/user/edit-field.yaml | 0 .../admin/schema/requests/user/edit-info.yaml | 0 .../admin/schema/requests/user/edit-password.yaml | 0 .../schema/requests/user/get-by-username.yaml | 0 main/app/sprinkles/admin/src/Admin.php | 0 .../admin/src/Controller/ActivityController.php | 0 .../admin/src/Controller/AdminController.php | 0 .../admin/src/Controller/GroupController.php | 0 .../admin/src/Controller/PermissionController.php | 0 .../admin/src/Controller/RoleController.php | 0 .../admin/src/Controller/UserController.php | 0 .../src/ServicesProvider/ServicesProvider.php | 0 .../admin/src/Sprunje/ActivitySprunje.php | 0 .../sprinkles/admin/src/Sprunje/GroupSprunje.php | 0 .../admin/src/Sprunje/PermissionSprunje.php | 0 .../admin/src/Sprunje/PermissionUserSprunje.php | 0 .../sprinkles/admin/src/Sprunje/RoleSprunje.php | 0 .../admin/src/Sprunje/UserPermissionSprunje.php | 0 .../sprinkles/admin/src/Sprunje/UserSprunje.php | 0 .../admin/templates/forms/group.html.twig | 0 .../sprinkles/admin/templates/forms/role.html.twig | 0 .../sprinkles/admin/templates/forms/user.html.twig | 0 .../admin/templates/mail/password-create.html.twig | 0 .../templates/modals/confirm-clear-cache.html.twig | 0 .../modals/confirm-delete-group.html.twig | 0 .../templates/modals/confirm-delete-role.html.twig | 0 .../templates/modals/confirm-delete-user.html.twig | 0 .../admin/templates/modals/group.html.twig | 0 .../modals/role-manage-permissions.html.twig | 0 .../admin/templates/modals/role.html.twig | 0 .../templates/modals/user-manage-roles.html.twig | 0 .../templates/modals/user-set-password.html.twig | 0 .../admin/templates/modals/user.html.twig | 0 .../admin/templates/navigation/navbar.html.twig | 0 .../templates/navigation/sidebar-menu.html.twig | 0 .../templates/navigation/sidebar-user.html.twig | 0 .../admin/templates/navigation/sidebar.html.twig | 0 .../admin/templates/navigation/user-card.html.twig | 0 .../templates/pages/abstract/dashboard.html.twig | 0 .../admin/templates/pages/activities.html.twig | 0 .../admin/templates/pages/dashboard.html.twig | 0 .../admin/templates/pages/group.html.twig | 0 .../admin/templates/pages/groups.html.twig | 0 .../admin/templates/pages/permission.html.twig | 0 .../admin/templates/pages/permissions.html.twig | 0 .../sprinkles/admin/templates/pages/role.html.twig | 0 .../admin/templates/pages/roles.html.twig | 0 .../sprinkles/admin/templates/pages/user.html.twig | 0 .../admin/templates/pages/users.html.twig | 0 .../admin/templates/tables/activities.html.twig | 0 .../admin/templates/tables/groups.html.twig | 0 .../admin/templates/tables/permissions.html.twig | 0 .../admin/templates/tables/roles.html.twig | 0 .../admin/templates/tables/users.html.twig | 0 .../admin/tests/Integration/SprunjeTests.php | 0 main/app/sprinkles/core/asset-bundles.json | 0 .../sprinkles/core/assets/SiteAssets/css/main.css | 500 +- .../sprinkles/core/assets/SiteAssets/css/slick.css | 2 +- .../assets/SiteAssets/icons/BurgerMenuShort.svg | 114 +- .../SiteAssets/icons/ExploreGlobeOutline.svg | 420 +- .../assets/SiteAssets/icons/FriendFeedOutline.svg | 164 +- .../SiteAssets/icons/MessageBubbleOutline.svg | 146 +- .../assets/SiteAssets/icons/UserGroupOutline.svg | 160 +- .../core/assets/SiteAssets/icons/UserOutline.svg | 108 +- .../core/assets/SiteAssets/js/encryption.js | 6812 ++++++------ .../core/assets/SiteAssets/js/fontawesome.js | 8 +- .../sprinkles/core/assets/SiteAssets/js/jquery.js | 6 +- .../core/assets/SiteAssets/js/language.js | 72 +- .../sprinkles/core/assets/SiteAssets/js/linkify.js | 736 +- .../sprinkles/core/assets/SiteAssets/js/main.js | 180 +- .../sprinkles/core/assets/SiteAssets/js/slick.js | 1110 +- .../php/Chatserver/bin/WebChatServer.php | 34 +- .../php/Chatserver/src/ChatProcessor.php | 234 +- .../core/assets/SiteAssets/php/SavePublicKey.php | 32 +- .../core/assets/SiteAssets/php/composer.lock | 943 -- .../core/assets/SiteAssets/php/scripts.php | 22 +- .../core/assets/SiteAssets/php/stylesheet.php | 10 +- .../php/vendor/cboden/ratchet/.gitignore | 8 +- .../php/vendor/natxet/CssMin/src/CssMin.php | 10310 +++++++++---------- .../nubs/random-name-generator/composer.lock | 1963 ---- .../assets/font-starcraft/css/font-starcraft.css | 0 .../assets/font-starcraft/fonts/font-starcraft.eot | Bin .../assets/font-starcraft/fonts/font-starcraft.svg | 0 .../assets/font-starcraft/fonts/font-starcraft.ttf | Bin .../font-starcraft/fonts/font-starcraft.woff | Bin .../assets/userfrosting/css/AdminLTE-skins-all.css | 0 .../core/assets/userfrosting/css/AdminLTE.css | 0 .../assets/userfrosting/css/tablesorter-reflow.css | 0 .../core/assets/userfrosting/css/uf-alerts.css | 0 .../core/assets/userfrosting/css/uf-collection.css | 0 .../userfrosting/css/uf-jqueryvalidation.css | 0 .../core/assets/userfrosting/css/userfrosting.css | 0 .../core/assets/userfrosting/favicons/README.md | 0 .../favicons/android-chrome-144x144.png | Bin .../favicons/android-chrome-192x192.png | Bin .../favicons/android-chrome-256x256.png | Bin .../userfrosting/favicons/android-chrome-36x36.png | Bin .../favicons/android-chrome-384x384.png | Bin .../userfrosting/favicons/android-chrome-48x48.png | Bin .../favicons/android-chrome-512x512.png | Bin .../userfrosting/favicons/android-chrome-72x72.png | Bin .../userfrosting/favicons/android-chrome-96x96.png | Bin .../apple-touch-icon-114x114-precomposed.png | Bin .../favicons/apple-touch-icon-114x114.png | Bin .../apple-touch-icon-120x120-precomposed.png | Bin .../favicons/apple-touch-icon-120x120.png | Bin .../apple-touch-icon-144x144-precomposed.png | Bin .../favicons/apple-touch-icon-144x144.png | Bin .../apple-touch-icon-152x152-precomposed.png | Bin .../favicons/apple-touch-icon-152x152.png | Bin .../apple-touch-icon-180x180-precomposed.png | Bin .../favicons/apple-touch-icon-180x180.png | Bin .../apple-touch-icon-57x57-precomposed.png | Bin .../favicons/apple-touch-icon-57x57.png | Bin .../apple-touch-icon-60x60-precomposed.png | Bin .../favicons/apple-touch-icon-60x60.png | Bin .../apple-touch-icon-72x72-precomposed.png | Bin .../favicons/apple-touch-icon-72x72.png | Bin .../apple-touch-icon-76x76-precomposed.png | Bin .../favicons/apple-touch-icon-76x76.png | Bin .../favicons/apple-touch-icon-precomposed.png | Bin .../userfrosting/favicons/apple-touch-icon.png | Bin .../assets/userfrosting/favicons/favicon-16x16.png | Bin .../assets/userfrosting/favicons/favicon-32x32.png | Bin .../core/assets/userfrosting/favicons/favicon.ico | Bin .../core/assets/userfrosting/favicons/ieconfig.xml | 24 +- .../assets/userfrosting/favicons/manifest.json | 0 .../userfrosting/favicons/mstile-144x144.png | Bin .../userfrosting/favicons/mstile-150x150.png | Bin .../userfrosting/favicons/mstile-310x150.png | Bin .../userfrosting/favicons/mstile-310x310.png | Bin .../assets/userfrosting/favicons/mstile-70x70.png | Bin .../userfrosting/favicons/safari-pinned-tab.svg | 0 .../core/assets/userfrosting/images/cupcake.png | Bin .../core/assets/userfrosting/images/logo.svg | 1028 +- .../core/assets/userfrosting/js/AdminLTE-custom.js | 0 .../core/assets/userfrosting/js/AdminLTE.js | 0 .../core/assets/userfrosting/js/attrchange.js | 0 .../js/fortress-jqueryvalidation-methods.js | 0 .../assets/userfrosting/js/handlebars-helpers.js | 0 .../core/assets/userfrosting/js/query-string.js | 0 .../js/tablesorter/widget-sort2Hash.js | 0 .../core/assets/userfrosting/js/uf-alerts.js | 0 .../core/assets/userfrosting/js/uf-captcha.js | 0 .../core/assets/userfrosting/js/uf-collection.js | 0 .../core/assets/userfrosting/js/uf-copy.js | 0 .../core/assets/userfrosting/js/uf-form.js | 0 .../core/assets/userfrosting/js/uf-init.js | 0 .../userfrosting/js/uf-jqueryvalidation-config.js | 0 .../core/assets/userfrosting/js/uf-modal.js | 0 .../core/assets/userfrosting/js/uf-table.js | 0 .../userfrosting/js/uf-tablesorter-parsers.js | 106 +- main/app/sprinkles/core/bower.json | 0 main/app/sprinkles/core/composer.json | 0 main/app/sprinkles/core/config/default.php | 0 main/app/sprinkles/core/config/dev.php | 0 main/app/sprinkles/core/config/production.php | 0 main/app/sprinkles/core/config/testing.php | 0 main/app/sprinkles/core/extra/adjectives.php | 0 main/app/sprinkles/core/extra/nouns.php | 0 main/app/sprinkles/core/locale/ar/errors.php | 0 main/app/sprinkles/core/locale/ar/messages.php | 0 main/app/sprinkles/core/locale/ar/validate.php | 0 main/app/sprinkles/core/locale/de_DE/errors.php | 0 main/app/sprinkles/core/locale/de_DE/main.php | 28 +- main/app/sprinkles/core/locale/de_DE/messages.php | 0 main/app/sprinkles/core/locale/de_DE/validate.php | 0 main/app/sprinkles/core/locale/en_US/errors.php | 0 main/app/sprinkles/core/locale/en_US/main.php | 28 +- main/app/sprinkles/core/locale/en_US/messages.php | 0 main/app/sprinkles/core/locale/en_US/validate.php | 0 main/app/sprinkles/core/locale/es_ES/errors.php | 0 main/app/sprinkles/core/locale/es_ES/messages.php | 0 main/app/sprinkles/core/locale/es_ES/validate.php | 0 main/app/sprinkles/core/locale/fa/errors.php | 0 main/app/sprinkles/core/locale/fa/messages.php | 0 main/app/sprinkles/core/locale/fa/validate.php | 0 main/app/sprinkles/core/locale/fr_FR/errors.php | 0 main/app/sprinkles/core/locale/fr_FR/main.php | 30 +- main/app/sprinkles/core/locale/fr_FR/messages.php | 0 main/app/sprinkles/core/locale/fr_FR/validate.php | 0 main/app/sprinkles/core/locale/it_IT/errors.php | 0 main/app/sprinkles/core/locale/it_IT/messages.php | 0 main/app/sprinkles/core/locale/it_IT/validate.php | 0 main/app/sprinkles/core/locale/pt_PT/errors.php | 0 main/app/sprinkles/core/locale/pt_PT/messages.php | 0 main/app/sprinkles/core/locale/pt_PT/validate.php | 0 main/app/sprinkles/core/locale/ru_RU/errors.php | 0 main/app/sprinkles/core/locale/ru_RU/messages.php | 0 main/app/sprinkles/core/locale/ru_RU/validate.php | 0 main/app/sprinkles/core/locale/th_TH/errors.php | 102 +- main/app/sprinkles/core/locale/th_TH/messages.php | 204 +- main/app/sprinkles/core/locale/th_TH/validate.php | 50 +- main/app/sprinkles/core/locale/valitron/ar.php | 0 main/app/sprinkles/core/locale/valitron/de.php | 0 main/app/sprinkles/core/locale/valitron/el.php | 0 main/app/sprinkles/core/locale/valitron/en.php | 0 main/app/sprinkles/core/locale/valitron/es.php | 0 main/app/sprinkles/core/locale/valitron/fr.php | 0 main/app/sprinkles/core/locale/valitron/id.php | 0 main/app/sprinkles/core/locale/valitron/it.php | 0 main/app/sprinkles/core/locale/valitron/ja.php | 0 main/app/sprinkles/core/locale/valitron/lv.php | 0 main/app/sprinkles/core/locale/valitron/pt-br.php | 0 main/app/sprinkles/core/locale/valitron/ro.php | 0 main/app/sprinkles/core/locale/valitron/ru.php | 0 main/app/sprinkles/core/locale/valitron/th.php | 68 +- main/app/sprinkles/core/locale/valitron/zh-cn.php | 0 main/app/sprinkles/core/locale/valitron/zh-tw.php | 0 main/app/sprinkles/core/locale/zh_CN/errors.php | 0 main/app/sprinkles/core/locale/zh_CN/messages.php | 0 main/app/sprinkles/core/locale/zh_CN/validate.php | 0 main/app/sprinkles/core/routes/routes.php | 0 main/app/sprinkles/core/schema/.gitkeep | 0 main/app/sprinkles/core/src/Alert/AlertStream.php | 0 .../sprinkles/core/src/Alert/CacheAlertStream.php | 0 .../core/src/Alert/SessionAlertStream.php | 0 .../core/src/Controller/CoreController.php | 0 .../core/src/Controller/SimpleController.php | 0 main/app/sprinkles/core/src/Core.php | 0 main/app/sprinkles/core/src/Database/Builder.php | 0 .../core/src/Database/DatabaseInvalidException.php | 0 .../src/Database/Migrations/v400/SessionsTable.php | 0 .../Database/Migrations/v400/ThrottlesTable.php | 0 .../Database/Models/Concerns/HasRelationships.php | 0 .../sprinkles/core/src/Database/Models/Model.php | 0 .../core/src/Database/Models/Throttle.php | 0 .../Relations/BelongsToManyConstrained.php | 0 .../Database/Relations/BelongsToManyThrough.php | 0 .../src/Database/Relations/BelongsToManyUnique.php | 0 .../src/Database/Relations/Concerns/Syncable.php | 0 .../src/Database/Relations/Concerns/Unique.php | 0 .../src/Database/Relations/HasManySyncable.php | 0 .../src/Database/Relations/MorphManySyncable.php | 0 .../src/Database/Relations/MorphToManyUnique.php | 0 .../core/src/Error/ExceptionHandlerManager.php | 0 .../core/src/Error/Handler/ExceptionHandler.php | 0 .../Error/Handler/ExceptionHandlerInterface.php | 0 .../src/Error/Handler/HttpExceptionHandler.php | 0 .../src/Error/Handler/NotFoundExceptionHandler.php | 0 .../Error/Handler/PhpMailerExceptionHandler.php | 0 .../core/src/Error/Renderer/ErrorRenderer.php | 0 .../src/Error/Renderer/ErrorRendererInterface.php | 0 .../core/src/Error/Renderer/HtmlRenderer.php | 0 .../core/src/Error/Renderer/JsonRenderer.php | 0 .../core/src/Error/Renderer/PlainTextRenderer.php | 0 .../core/src/Error/Renderer/WhoopsRenderer.php | 0 .../core/src/Error/Renderer/XmlRenderer.php | 0 main/app/sprinkles/core/src/Facades/Debug.php | 0 main/app/sprinkles/core/src/Facades/Translator.php | 0 .../src/Http/Concerns/DeterminesContentType.php | 0 .../app/sprinkles/core/src/Log/DatabaseHandler.php | 0 main/app/sprinkles/core/src/Log/MixedFormatter.php | 0 .../app/sprinkles/core/src/Mail/EmailRecipient.php | 0 main/app/sprinkles/core/src/Mail/MailMessage.php | 0 main/app/sprinkles/core/src/Mail/Mailer.php | 0 .../sprinkles/core/src/Mail/StaticMailMessage.php | 0 .../sprinkles/core/src/Mail/TwigMailMessage.php | 0 main/app/sprinkles/core/src/Model/UFModel.php | 0 main/app/sprinkles/core/src/Router.php | 0 .../core/src/ServicesProvider/ServicesProvider.php | 0 main/app/sprinkles/core/src/Sprunje/Sprunje.php | 0 .../sprinkles/core/src/Throttle/ThrottleRule.php | 0 main/app/sprinkles/core/src/Throttle/Throttler.php | 0 .../core/src/Throttle/ThrottlerException.php | 0 main/app/sprinkles/core/src/Twig/CacheHelper.php | 0 main/app/sprinkles/core/src/Twig/CoreExtension.php | 0 .../core/src/Util/BadClassNameException.php | 0 main/app/sprinkles/core/src/Util/Captcha.php | 0 .../sprinkles/core/src/Util/CheckEnvironment.php | 0 main/app/sprinkles/core/src/Util/ClassMapper.php | 0 .../sprinkles/core/src/Util/EnvironmentInfo.php | 0 .../sprinkles/core/src/Util/ShutdownHandler.php | 0 main/app/sprinkles/core/src/Util/Util.php | 0 .../sprinkles/core/templates/forms/csrf.html.twig | 0 main/app/sprinkles/core/templates/mail/.gitkeep | 0 .../core/templates/modals/modal.html.twig | 0 .../core/templates/navigation/breadcrumb.html.twig | 0 .../core/templates/navigation/main-nav.html.twig | 0 .../sprinkles/core/templates/pages/about.html.twig | 0 .../core/templates/pages/abstract/base.html.twig | 62 +- .../templates/pages/abstract/default.html.twig | 62 +- .../core/templates/pages/abstract/error.html.twig | 0 .../templates/pages/abstract/mainsite.html.twig | 217 +- .../core/templates/pages/error/400.html.twig | 0 .../core/templates/pages/error/404.html.twig | 0 .../templates/pages/error/config-errors.html.twig | 0 .../sprinkles/core/templates/pages/index.html.twig | 0 .../sprinkles/core/templates/pages/legal.html.twig | 0 .../core/templates/pages/partials/alerts.html.twig | 0 .../templates/pages/partials/analytics.html.twig | 0 .../core/templates/pages/partials/chat.js.twig | 244 +- .../core/templates/pages/partials/config.js.twig | 0 .../templates/pages/partials/favicons.html.twig | 0 .../core/templates/pages/partials/footer.html.twig | 0 .../core/templates/pages/partials/legal.html.twig | 0 .../core/templates/pages/partials/page.js.twig | 0 .../templates/pages/partials/privacy.html.twig | 0 .../core/templates/pages/privacy.html.twig | 0 .../templates/tables/table-paginated.html.twig | 0 .../templates/tables/table-tool-menu.html.twig | 0 .../core/tests/Integration/DatabaseTests.php | 0 .../core/tests/Unit/BelongsToManyThroughTest.php | 0 .../core/tests/Unit/DatabaseSyncableTest.php | 0 main/app/sprinkles/core/tests/Unit/SprunjeTest.php | 0 main/app/sprinkles/extend-user/.gitignore | 4 +- main/app/sprinkles/extend-user/README.md | 0 main/app/sprinkles/extend-user/composer.json | 0 main/app/sprinkles/extend-user/routes/member.php | 0 .../extend-user/schema/requests/user/create.yaml | 0 .../schema/requests/user/edit-info.yaml | 0 .../src/Controller/MemberController.php | 0 .../src/Database/Migrations/v400/MembersTable.php | 0 .../extend-user/src/Database/Models/Member.php | 0 .../extend-user/src/Database/Models/MemberAux.php | 0 .../src/Database/Scopes/MemberAuxScope.php | 0 .../src/ServicesProvider/ServicesProvider.php | 0 .../extend-user/templates/forms/user.html.twig | 0 .../extend-user/templates/pages/user.html.twig | 0 531 files changed, 12074 insertions(+), 14947 deletions(-) mode change 100755 => 100644 main/app/sprinkles/ConfigManager/CHANGELOG.md mode change 100755 => 100644 main/app/sprinkles/ConfigManager/LICENSE mode change 100755 => 100644 main/app/sprinkles/ConfigManager/README.md mode change 100755 => 100644 main/app/sprinkles/ConfigManager/asset-bundles.json mode change 100755 => 100644 main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js mode change 100755 => 100644 main/app/sprinkles/ConfigManager/composer.json mode change 100755 => 100644 main/app/sprinkles/ConfigManager/locale/en_US/AdminLTE.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/locale/en_US/ConfigManager.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/locale/fr_FR/AdminLTE.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/locale/fr_FR/ConfigManager.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/routes/ConfigManager.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/schema/config/AdminLTE.json mode change 100755 => 100644 main/app/sprinkles/ConfigManager/schema/config/site.json mode change 100755 => 100644 main/app/sprinkles/ConfigManager/src/ConfigManager.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/src/Controller/ConfigManagerController.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/src/Database/Migrations/v100/SettingsTable.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/src/Database/Migrations/v101/SettingsPermissions.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/src/Database/Models/Config.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/src/ServicesProvider/ServicesProvider.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/src/Util/ConfigManager.php mode change 100755 => 100644 main/app/sprinkles/ConfigManager/templates/pages/ConfigManager.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/.gitignore mode change 100755 => 100644 main/app/sprinkles/FormGenerator/CHANGELOG.md mode change 100755 => 100644 main/app/sprinkles/FormGenerator/LICENSE mode change 100755 => 100644 main/app/sprinkles/FormGenerator/README.md mode change 100755 => 100644 main/app/sprinkles/FormGenerator/asset-bundles.json mode change 100755 => 100644 main/app/sprinkles/FormGenerator/assets/js/widget-formGenerator.js mode change 100755 => 100644 main/app/sprinkles/FormGenerator/bower.json mode change 100755 => 100644 main/app/sprinkles/FormGenerator/composer.json mode change 100755 => 100644 main/app/sprinkles/FormGenerator/locale/en_US/FormGenerator.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/locale/fr_FR/FormGenerator.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/routes/FormGenerator.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Controller/FormGeneratorController.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/Alert.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/BaseInput.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/Checkbox.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/Hidden.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/InputInterface.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/Select.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/Text.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Element/Textarea.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/src/Form.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/FormGenerator.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/confirm.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/alert.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/checkbox.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/hidden.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/select.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/text.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/textarea.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/modal-large.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/modal.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/templates/FormGenerator/typehead.html.twig mode change 100755 => 100644 main/app/sprinkles/FormGenerator/tests/Unit/FormGeneratorTest.php mode change 100755 => 100644 main/app/sprinkles/FormGenerator/tests/Unit/data/bad.json mode change 100755 => 100644 main/app/sprinkles/FormGenerator/tests/Unit/data/good.json mode change 100755 => 100644 main/app/sprinkles/account/asset-bundles.json mode change 100755 => 100644 main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js mode change 100755 => 100644 main/app/sprinkles/account/assets/userfrosting/js/pages/forgot-password.js mode change 100755 => 100644 main/app/sprinkles/account/assets/userfrosting/js/pages/register.js mode change 100755 => 100644 main/app/sprinkles/account/assets/userfrosting/js/pages/resend-verification.js mode change 100755 => 100644 main/app/sprinkles/account/assets/userfrosting/js/pages/set-or-reset-password.js mode change 100755 => 100644 main/app/sprinkles/account/assets/userfrosting/js/pages/sign-in.js mode change 100755 => 100644 main/app/sprinkles/account/bower.json mode change 100755 => 100644 main/app/sprinkles/account/composer.json mode change 100755 => 100644 main/app/sprinkles/account/config/default.php mode change 100755 => 100644 main/app/sprinkles/account/config/production.php mode change 100755 => 100644 main/app/sprinkles/account/factories/Permissions.php mode change 100755 => 100644 main/app/sprinkles/account/factories/Roles.php mode change 100755 => 100644 main/app/sprinkles/account/factories/Users.php mode change 100755 => 100644 main/app/sprinkles/account/locale/ar/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/ar/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/de_DE/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/de_DE/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/en_US/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/en_US/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/es_ES/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/es_ES/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/fa/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/fa/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/fr_FR/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/fr_FR/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/it_IT/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/it_IT/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/pt_PT/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/pt_PT/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/ru_RU/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/ru_RU/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/th_TH/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/th_TH/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/tr/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/tr/validate.php mode change 100755 => 100644 main/app/sprinkles/account/locale/zh_CN/messages.php mode change 100755 => 100644 main/app/sprinkles/account/locale/zh_CN/validate.php mode change 100755 => 100644 main/app/sprinkles/account/routes/routes.php mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/account-settings.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/account-verify.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/check-username.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/deny-password.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/forgot-password.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/login.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/profile-settings.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/register.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/resend-verification.yaml mode change 100755 => 100644 main/app/sprinkles/account/schema/requests/set-password.yaml mode change 100755 => 100644 main/app/sprinkles/account/src/Account.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/AuthGuard.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Authenticator.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Exception/AccountDisabledException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Exception/AccountInvalidException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Exception/AccountNotVerifiedException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Exception/AuthCompromisedException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Exception/AuthExpiredException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Exception/InvalidCredentialsException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authenticate/Hasher.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authorize/AccessConditionExpression.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authorize/AuthorizationException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authorize/AuthorizationManager.php mode change 100755 => 100644 main/app/sprinkles/account/src/Authorize/ParserNodeFunctionEvaluator.php mode change 100755 => 100644 main/app/sprinkles/account/src/Bakery/CreateAdminUser.php mode change 100755 => 100644 main/app/sprinkles/account/src/Controller/AccountController.php mode change 100755 => 100644 main/app/sprinkles/account/src/Controller/Exception/SpammyRequestException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/ActivitiesTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/GroupsTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/PasswordResetsTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/PermissionRolesTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/PermissionsTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/PersistencesTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/RoleUsersTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/RolesTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/UsersTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Migrations/v400/VerificationsTable.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Models/Activity.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Models/Group.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Models/PasswordReset.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Models/Permission.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Models/Role.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Models/User.php mode change 100755 => 100644 main/app/sprinkles/account/src/Database/Models/Verification.php mode change 100755 => 100644 main/app/sprinkles/account/src/Error/Handler/AuthCompromisedExceptionHandler.php mode change 100755 => 100644 main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php mode change 100755 => 100644 main/app/sprinkles/account/src/Error/Handler/ForbiddenExceptionHandler.php mode change 100755 => 100644 main/app/sprinkles/account/src/Facades/Password.php mode change 100755 => 100644 main/app/sprinkles/account/src/Log/UserActivityDatabaseHandler.php mode change 100755 => 100644 main/app/sprinkles/account/src/Log/UserActivityProcessor.php mode change 100755 => 100644 main/app/sprinkles/account/src/Repository/PasswordResetRepository.php mode change 100755 => 100644 main/app/sprinkles/account/src/Repository/TokenRepository.php mode change 100755 => 100644 main/app/sprinkles/account/src/Repository/VerificationRepository.php mode change 100755 => 100644 main/app/sprinkles/account/src/ServicesProvider/ServicesProvider.php mode change 100755 => 100644 main/app/sprinkles/account/src/Twig/AccountExtension.php mode change 100755 => 100644 main/app/sprinkles/account/src/Util/HashFailedException.php mode change 100755 => 100644 main/app/sprinkles/account/src/Util/Util.php mode change 100755 => 100644 main/app/sprinkles/account/templates/forms/settings-account.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/forms/settings-profile.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/mail/password-reset.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/mail/resend-verification.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/mail/verify-account.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/modals/tos.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/navigation/main-nav.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/navigation/user-card.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/account-settings.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/error/compromised.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/forgot-password.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/register.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/resend-verification.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/reset-password.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/set-password.html.twig mode change 100755 => 100644 main/app/sprinkles/account/templates/pages/sign-in.html.twig mode change 100755 => 100644 main/app/sprinkles/account/tests/Unit/FactoriesTest.php mode change 100755 => 100644 main/app/sprinkles/account/tests/Unit/HasherTest.php mode change 100755 => 100644 main/app/sprinkles/admin/asset-bundles.json mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/css/tablesorter-custom.css mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/activities.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/dashboard.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/group.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/groups.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/permission.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/permissions.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/role.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/roles.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/user.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/pages/users.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/widgets/groups.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/widgets/roles.js mode change 100755 => 100644 main/app/sprinkles/admin/assets/userfrosting/js/widgets/users.js mode change 100755 => 100644 main/app/sprinkles/admin/composer.json mode change 100755 => 100644 main/app/sprinkles/admin/locale/ar/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/de_DE/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/en_US/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/es_ES/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/fa/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/fr_FR/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/it_IT/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/pt_PT/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/ru_RU/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/th_TH/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/tr/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/locale/zh_CN/messages.php mode change 100755 => 100644 main/app/sprinkles/admin/routes/activities.php mode change 100755 => 100644 main/app/sprinkles/admin/routes/admin.php mode change 100755 => 100644 main/app/sprinkles/admin/routes/groups.php mode change 100755 => 100644 main/app/sprinkles/admin/routes/permissions.php mode change 100755 => 100644 main/app/sprinkles/admin/routes/roles.php mode change 100755 => 100644 main/app/sprinkles/admin/routes/users.php mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/group/create.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/group/edit-info.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/group/get-by-slug.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/role/create.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/role/edit-field.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/role/edit-info.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/role/get-by-slug.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/user/create.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/user/edit-field.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/user/edit-info.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/user/edit-password.yaml mode change 100755 => 100644 main/app/sprinkles/admin/schema/requests/user/get-by-username.yaml mode change 100755 => 100644 main/app/sprinkles/admin/src/Admin.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Controller/ActivityController.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Controller/AdminController.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Controller/GroupController.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Controller/PermissionController.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Controller/RoleController.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Controller/UserController.php mode change 100755 => 100644 main/app/sprinkles/admin/src/ServicesProvider/ServicesProvider.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Sprunje/ActivitySprunje.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Sprunje/GroupSprunje.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Sprunje/PermissionSprunje.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Sprunje/PermissionUserSprunje.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Sprunje/RoleSprunje.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Sprunje/UserPermissionSprunje.php mode change 100755 => 100644 main/app/sprinkles/admin/src/Sprunje/UserSprunje.php mode change 100755 => 100644 main/app/sprinkles/admin/templates/forms/group.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/forms/role.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/forms/user.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/mail/password-create.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/confirm-clear-cache.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/confirm-delete-group.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/confirm-delete-role.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/confirm-delete-user.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/group.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/role-manage-permissions.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/role.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/user-manage-roles.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/user-set-password.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/modals/user.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/navigation/navbar.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/navigation/sidebar-menu.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/navigation/sidebar-user.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/navigation/sidebar.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/navigation/user-card.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/abstract/dashboard.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/activities.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/dashboard.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/group.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/groups.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/permission.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/permissions.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/role.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/roles.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/user.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/pages/users.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/tables/activities.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/tables/groups.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/tables/permissions.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/tables/roles.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/templates/tables/users.html.twig mode change 100755 => 100644 main/app/sprinkles/admin/tests/Integration/SprunjeTests.php mode change 100755 => 100644 main/app/sprinkles/core/asset-bundles.json delete mode 100644 main/app/sprinkles/core/assets/SiteAssets/php/composer.lock delete mode 100644 main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/composer.lock mode change 100755 => 100644 main/app/sprinkles/core/assets/font-starcraft/css/font-starcraft.css mode change 100755 => 100644 main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.eot mode change 100755 => 100644 main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.svg mode change 100755 => 100644 main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.ttf mode change 100755 => 100644 main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.woff mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/css/AdminLTE-skins-all.css mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/css/AdminLTE.css mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/css/tablesorter-reflow.css mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/css/uf-alerts.css mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/css/uf-collection.css mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/css/uf-jqueryvalidation.css mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/css/userfrosting.css mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/README.md mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-144x144.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-192x192.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-256x256.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-36x36.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-384x384.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-48x48.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-512x512.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-72x72.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/android-chrome-96x96.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-114x114-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-114x114.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-120x120-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-120x120.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-144x144-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-144x144.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-152x152-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-152x152.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-180x180-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-180x180.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-57x57-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-57x57.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-60x60-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-60x60.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-72x72-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-72x72.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-76x76-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-76x76.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon-precomposed.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/apple-touch-icon.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/favicon-16x16.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/favicon-32x32.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/favicon.ico mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/ieconfig.xml mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/manifest.json mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/mstile-144x144.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/mstile-150x150.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/mstile-310x150.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/mstile-310x310.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/mstile-70x70.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/favicons/safari-pinned-tab.svg mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/images/cupcake.png mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/images/logo.svg mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/AdminLTE-custom.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/attrchange.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/fortress-jqueryvalidation-methods.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/handlebars-helpers.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/query-string.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/tablesorter/widget-sort2Hash.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-alerts.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-captcha.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-collection.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-copy.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-form.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-init.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-jqueryvalidation-config.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-table.js mode change 100755 => 100644 main/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js mode change 100755 => 100644 main/app/sprinkles/core/bower.json mode change 100755 => 100644 main/app/sprinkles/core/composer.json mode change 100755 => 100644 main/app/sprinkles/core/config/default.php mode change 100755 => 100644 main/app/sprinkles/core/config/dev.php mode change 100755 => 100644 main/app/sprinkles/core/config/production.php mode change 100755 => 100644 main/app/sprinkles/core/config/testing.php mode change 100755 => 100644 main/app/sprinkles/core/extra/adjectives.php mode change 100755 => 100644 main/app/sprinkles/core/extra/nouns.php mode change 100755 => 100644 main/app/sprinkles/core/locale/ar/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/ar/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/ar/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/de_DE/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/de_DE/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/de_DE/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/en_US/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/en_US/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/en_US/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/es_ES/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/es_ES/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/es_ES/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/fa/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/fa/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/fa/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/fr_FR/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/fr_FR/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/fr_FR/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/it_IT/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/it_IT/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/it_IT/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/pt_PT/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/pt_PT/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/pt_PT/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/ru_RU/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/ru_RU/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/ru_RU/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/th_TH/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/th_TH/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/th_TH/validate.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/ar.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/de.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/el.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/en.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/es.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/fr.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/id.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/it.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/ja.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/lv.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/pt-br.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/ro.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/ru.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/th.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/zh-cn.php mode change 100755 => 100644 main/app/sprinkles/core/locale/valitron/zh-tw.php mode change 100755 => 100644 main/app/sprinkles/core/locale/zh_CN/errors.php mode change 100755 => 100644 main/app/sprinkles/core/locale/zh_CN/messages.php mode change 100755 => 100644 main/app/sprinkles/core/locale/zh_CN/validate.php mode change 100755 => 100644 main/app/sprinkles/core/routes/routes.php mode change 100755 => 100644 main/app/sprinkles/core/schema/.gitkeep mode change 100755 => 100644 main/app/sprinkles/core/src/Alert/AlertStream.php mode change 100755 => 100644 main/app/sprinkles/core/src/Alert/CacheAlertStream.php mode change 100755 => 100644 main/app/sprinkles/core/src/Alert/SessionAlertStream.php mode change 100755 => 100644 main/app/sprinkles/core/src/Controller/CoreController.php mode change 100755 => 100644 main/app/sprinkles/core/src/Controller/SimpleController.php mode change 100755 => 100644 main/app/sprinkles/core/src/Core.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Builder.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/DatabaseInvalidException.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Migrations/v400/SessionsTable.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Migrations/v400/ThrottlesTable.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Models/Concerns/HasRelationships.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Models/Model.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Models/Throttle.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/BelongsToManyConstrained.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/BelongsToManyThrough.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/BelongsToManyUnique.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/Concerns/Syncable.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/HasManySyncable.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/MorphManySyncable.php mode change 100755 => 100644 main/app/sprinkles/core/src/Database/Relations/MorphToManyUnique.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/ExceptionHandlerManager.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Handler/ExceptionHandler.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Handler/ExceptionHandlerInterface.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Handler/HttpExceptionHandler.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Handler/NotFoundExceptionHandler.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Handler/PhpMailerExceptionHandler.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Renderer/ErrorRenderer.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Renderer/ErrorRendererInterface.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Renderer/HtmlRenderer.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Renderer/JsonRenderer.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Renderer/PlainTextRenderer.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php mode change 100755 => 100644 main/app/sprinkles/core/src/Error/Renderer/XmlRenderer.php mode change 100755 => 100644 main/app/sprinkles/core/src/Facades/Debug.php mode change 100755 => 100644 main/app/sprinkles/core/src/Facades/Translator.php mode change 100755 => 100644 main/app/sprinkles/core/src/Http/Concerns/DeterminesContentType.php mode change 100755 => 100644 main/app/sprinkles/core/src/Log/DatabaseHandler.php mode change 100755 => 100644 main/app/sprinkles/core/src/Log/MixedFormatter.php mode change 100755 => 100644 main/app/sprinkles/core/src/Mail/EmailRecipient.php mode change 100755 => 100644 main/app/sprinkles/core/src/Mail/MailMessage.php mode change 100755 => 100644 main/app/sprinkles/core/src/Mail/Mailer.php mode change 100755 => 100644 main/app/sprinkles/core/src/Mail/StaticMailMessage.php mode change 100755 => 100644 main/app/sprinkles/core/src/Mail/TwigMailMessage.php mode change 100755 => 100644 main/app/sprinkles/core/src/Model/UFModel.php mode change 100755 => 100644 main/app/sprinkles/core/src/Router.php mode change 100755 => 100644 main/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php mode change 100755 => 100644 main/app/sprinkles/core/src/Sprunje/Sprunje.php mode change 100755 => 100644 main/app/sprinkles/core/src/Throttle/ThrottleRule.php mode change 100755 => 100644 main/app/sprinkles/core/src/Throttle/Throttler.php mode change 100755 => 100644 main/app/sprinkles/core/src/Throttle/ThrottlerException.php mode change 100755 => 100644 main/app/sprinkles/core/src/Twig/CacheHelper.php mode change 100755 => 100644 main/app/sprinkles/core/src/Twig/CoreExtension.php mode change 100755 => 100644 main/app/sprinkles/core/src/Util/BadClassNameException.php mode change 100755 => 100644 main/app/sprinkles/core/src/Util/Captcha.php mode change 100755 => 100644 main/app/sprinkles/core/src/Util/CheckEnvironment.php mode change 100755 => 100644 main/app/sprinkles/core/src/Util/ClassMapper.php mode change 100755 => 100644 main/app/sprinkles/core/src/Util/EnvironmentInfo.php mode change 100755 => 100644 main/app/sprinkles/core/src/Util/ShutdownHandler.php mode change 100755 => 100644 main/app/sprinkles/core/src/Util/Util.php mode change 100755 => 100644 main/app/sprinkles/core/templates/forms/csrf.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/mail/.gitkeep mode change 100755 => 100644 main/app/sprinkles/core/templates/modals/modal.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/navigation/breadcrumb.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/navigation/main-nav.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/about.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/abstract/base.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/abstract/default.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/abstract/error.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/error/400.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/error/404.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/error/config-errors.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/index.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/legal.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/alerts.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/analytics.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/config.js.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/favicons.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/footer.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/legal.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/page.js.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/partials/privacy.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/pages/privacy.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/tables/table-paginated.html.twig mode change 100755 => 100644 main/app/sprinkles/core/templates/tables/table-tool-menu.html.twig mode change 100755 => 100644 main/app/sprinkles/core/tests/Integration/DatabaseTests.php mode change 100755 => 100644 main/app/sprinkles/core/tests/Unit/BelongsToManyThroughTest.php mode change 100755 => 100644 main/app/sprinkles/core/tests/Unit/DatabaseSyncableTest.php mode change 100755 => 100644 main/app/sprinkles/core/tests/Unit/SprunjeTest.php mode change 100755 => 100644 main/app/sprinkles/extend-user/.gitignore mode change 100755 => 100644 main/app/sprinkles/extend-user/README.md mode change 100755 => 100644 main/app/sprinkles/extend-user/composer.json mode change 100755 => 100644 main/app/sprinkles/extend-user/routes/member.php mode change 100755 => 100644 main/app/sprinkles/extend-user/schema/requests/user/create.yaml mode change 100755 => 100644 main/app/sprinkles/extend-user/schema/requests/user/edit-info.yaml mode change 100755 => 100644 main/app/sprinkles/extend-user/src/Controller/MemberController.php mode change 100755 => 100644 main/app/sprinkles/extend-user/src/Database/Migrations/v400/MembersTable.php mode change 100755 => 100644 main/app/sprinkles/extend-user/src/Database/Models/Member.php mode change 100755 => 100644 main/app/sprinkles/extend-user/src/Database/Models/MemberAux.php mode change 100755 => 100644 main/app/sprinkles/extend-user/src/Database/Scopes/MemberAuxScope.php mode change 100755 => 100644 main/app/sprinkles/extend-user/src/ServicesProvider/ServicesProvider.php mode change 100755 => 100644 main/app/sprinkles/extend-user/templates/forms/user.html.twig mode change 100755 => 100644 main/app/sprinkles/extend-user/templates/pages/user.html.twig (limited to 'main/app/sprinkles') diff --git a/main/app/sprinkles/ConfigManager/CHANGELOG.md b/main/app/sprinkles/ConfigManager/CHANGELOG.md old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/LICENSE b/main/app/sprinkles/ConfigManager/LICENSE old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/README.md b/main/app/sprinkles/ConfigManager/README.md old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/asset-bundles.json b/main/app/sprinkles/ConfigManager/asset-bundles.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js b/main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/composer.json b/main/app/sprinkles/ConfigManager/composer.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/locale/en_US/AdminLTE.php b/main/app/sprinkles/ConfigManager/locale/en_US/AdminLTE.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/locale/en_US/ConfigManager.php b/main/app/sprinkles/ConfigManager/locale/en_US/ConfigManager.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/locale/fr_FR/AdminLTE.php b/main/app/sprinkles/ConfigManager/locale/fr_FR/AdminLTE.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/locale/fr_FR/ConfigManager.php b/main/app/sprinkles/ConfigManager/locale/fr_FR/ConfigManager.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/routes/ConfigManager.php b/main/app/sprinkles/ConfigManager/routes/ConfigManager.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/schema/config/AdminLTE.json b/main/app/sprinkles/ConfigManager/schema/config/AdminLTE.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/schema/config/site.json b/main/app/sprinkles/ConfigManager/schema/config/site.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/src/ConfigManager.php b/main/app/sprinkles/ConfigManager/src/ConfigManager.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/src/Controller/ConfigManagerController.php b/main/app/sprinkles/ConfigManager/src/Controller/ConfigManagerController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/src/Database/Migrations/v100/SettingsTable.php b/main/app/sprinkles/ConfigManager/src/Database/Migrations/v100/SettingsTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/src/Database/Migrations/v101/SettingsPermissions.php b/main/app/sprinkles/ConfigManager/src/Database/Migrations/v101/SettingsPermissions.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/src/Database/Models/Config.php b/main/app/sprinkles/ConfigManager/src/Database/Models/Config.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/src/ServicesProvider/ServicesProvider.php b/main/app/sprinkles/ConfigManager/src/ServicesProvider/ServicesProvider.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/src/Util/ConfigManager.php b/main/app/sprinkles/ConfigManager/src/Util/ConfigManager.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/ConfigManager/templates/pages/ConfigManager.html.twig b/main/app/sprinkles/ConfigManager/templates/pages/ConfigManager.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/.gitignore b/main/app/sprinkles/FormGenerator/.gitignore old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/CHANGELOG.md b/main/app/sprinkles/FormGenerator/CHANGELOG.md old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/LICENSE b/main/app/sprinkles/FormGenerator/LICENSE old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/README.md b/main/app/sprinkles/FormGenerator/README.md old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/asset-bundles.json b/main/app/sprinkles/FormGenerator/asset-bundles.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/assets/js/widget-formGenerator.js b/main/app/sprinkles/FormGenerator/assets/js/widget-formGenerator.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/bower.json b/main/app/sprinkles/FormGenerator/bower.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/composer.json b/main/app/sprinkles/FormGenerator/composer.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/locale/en_US/FormGenerator.php b/main/app/sprinkles/FormGenerator/locale/en_US/FormGenerator.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/locale/fr_FR/FormGenerator.php b/main/app/sprinkles/FormGenerator/locale/fr_FR/FormGenerator.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/routes/FormGenerator.php b/main/app/sprinkles/FormGenerator/routes/FormGenerator.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Controller/FormGeneratorController.php b/main/app/sprinkles/FormGenerator/src/Controller/FormGeneratorController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/Alert.php b/main/app/sprinkles/FormGenerator/src/Element/Alert.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/BaseInput.php b/main/app/sprinkles/FormGenerator/src/Element/BaseInput.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/Checkbox.php b/main/app/sprinkles/FormGenerator/src/Element/Checkbox.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/Hidden.php b/main/app/sprinkles/FormGenerator/src/Element/Hidden.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/InputInterface.php b/main/app/sprinkles/FormGenerator/src/Element/InputInterface.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/Select.php b/main/app/sprinkles/FormGenerator/src/Element/Select.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/Text.php b/main/app/sprinkles/FormGenerator/src/Element/Text.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Element/Textarea.php b/main/app/sprinkles/FormGenerator/src/Element/Textarea.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/src/Form.php b/main/app/sprinkles/FormGenerator/src/Form.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/FormGenerator.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/FormGenerator.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/confirm.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/confirm.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/alert.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/alert.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/checkbox.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/checkbox.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/hidden.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/hidden.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/select.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/select.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/text.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/text.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/textarea.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/textarea.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal-large.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal-large.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/typehead.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/typehead.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/tests/Unit/FormGeneratorTest.php b/main/app/sprinkles/FormGenerator/tests/Unit/FormGeneratorTest.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/tests/Unit/data/bad.json b/main/app/sprinkles/FormGenerator/tests/Unit/data/bad.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/FormGenerator/tests/Unit/data/good.json b/main/app/sprinkles/FormGenerator/tests/Unit/data/good.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/asset-bundles.json b/main/app/sprinkles/account/asset-bundles.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/forgot-password.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/forgot-password.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/register.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/register.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/resend-verification.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/resend-verification.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/set-or-reset-password.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/set-or-reset-password.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/sign-in.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/sign-in.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/bower.json b/main/app/sprinkles/account/bower.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/composer.json b/main/app/sprinkles/account/composer.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/config/default.php b/main/app/sprinkles/account/config/default.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/config/production.php b/main/app/sprinkles/account/config/production.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/factories/Permissions.php b/main/app/sprinkles/account/factories/Permissions.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/factories/Roles.php b/main/app/sprinkles/account/factories/Roles.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/factories/Users.php b/main/app/sprinkles/account/factories/Users.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/ar/messages.php b/main/app/sprinkles/account/locale/ar/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/ar/validate.php b/main/app/sprinkles/account/locale/ar/validate.php old mode 100755 new mode 100644 index 37693fb..0283680 --- a/main/app/sprinkles/account/locale/ar/validate.php +++ b/main/app/sprinkles/account/locale/ar/validate.php @@ -1,18 +1,18 @@ - [ - "PASSWORD_MISMATCH" => "يجب أن تكون كلمة المرور وكلمة المرور التأكيدية نفس" - ] -]; + [ + "PASSWORD_MISMATCH" => "يجب أن تكون كلمة المرور وكلمة المرور التأكيدية نفس" + ] +]; diff --git a/main/app/sprinkles/account/locale/de_DE/messages.php b/main/app/sprinkles/account/locale/de_DE/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/de_DE/validate.php b/main/app/sprinkles/account/locale/de_DE/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/en_US/messages.php b/main/app/sprinkles/account/locale/en_US/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/en_US/validate.php b/main/app/sprinkles/account/locale/en_US/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/es_ES/messages.php b/main/app/sprinkles/account/locale/es_ES/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/es_ES/validate.php b/main/app/sprinkles/account/locale/es_ES/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/fa/messages.php b/main/app/sprinkles/account/locale/fa/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/fa/validate.php b/main/app/sprinkles/account/locale/fa/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/fr_FR/messages.php b/main/app/sprinkles/account/locale/fr_FR/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/fr_FR/validate.php b/main/app/sprinkles/account/locale/fr_FR/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/it_IT/messages.php b/main/app/sprinkles/account/locale/it_IT/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/it_IT/validate.php b/main/app/sprinkles/account/locale/it_IT/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/pt_PT/messages.php b/main/app/sprinkles/account/locale/pt_PT/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/pt_PT/validate.php b/main/app/sprinkles/account/locale/pt_PT/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/ru_RU/messages.php b/main/app/sprinkles/account/locale/ru_RU/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/ru_RU/validate.php b/main/app/sprinkles/account/locale/ru_RU/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/th_TH/messages.php b/main/app/sprinkles/account/locale/th_TH/messages.php old mode 100755 new mode 100644 index 642a7c5..012c7f4 --- a/main/app/sprinkles/account/locale/th_TH/messages.php +++ b/main/app/sprinkles/account/locale/th_TH/messages.php @@ -1,164 +1,164 @@ - [ - "@TRANSLATION" => "บัญชี", - - "ACCESS_DENIED" => "หืมม ดูเหมือนว่าคุณไม่ได้รับอนุญาตให้ทำเช่นนั้น", - - "DISABLED" => "บัญชีนี้ถูกปิดการใช้งานไปแล้ว กรุณาติดต่อเราสำหรับข้อมูลเพิ่มเติม", - - "EMAIL_UPDATED" => "ปรับปรุงบัญชีอีเมลแล้ว", - - "INVALID" => "ไม่พบบัญชีนี้ มันอาจถูกลบไปแล้ว กรุณาติดต่อเราสำหรับข้อมูลเพิ่มเติม", - - "MASTER_NOT_EXISTS" => "คุณไม่สามารถสมัครสมาชิกได้จนกว่าจะสร้างบัญชีหลัก!", - "MY" => "บัญชีของฉัน", - - "SESSION_COMPROMISED" => "เซสชันของคุณถูกลักลอบใช้ คุณควรจะออกจากระบบบนอุปกรณ์ทั้งหมดแล้วกลับเข้าสู่ระบบและตรวจสอบให้แน่ใจว่าไม่มีการแก้ไขข้อมูลของคุณ", - "SESSION_COMPROMISED_TITLE" => "บัญชีของคุณอาจถูกบุกรุก", - "SESSION_EXPIRED" => "เซสชันของคุณหมดอายุ กรุณาเข้าสู่ระบบอีกครั้ง", - - "SETTINGS" => [ - "@TRANSLATION" => "การตั้งค่าบัญชี", - "DESCRIPTION" => "ปรับปรุงการตั้งค่าบัญชีของคุณ รวมไปถึงอีเมล ชื่อ และรหัสผ่าน", - "UPDATED" => "ปรับปรุงการตั้งค่าบัญชีของคุณแล้ว" - ], - - "TOOLS" => "เครื่องมือบัญชี", - - "UNVERIFIED" => "บัญชีของคุณยังไม่ได้รับการยืนยัน กรุณาตรวจสอบกล่องอีเมลและจดหมายขยะของคุณสำหรับขั้นตอนการเปิดใช้งานบัญชี", - - "VERIFICATION" => [ - "NEW_LINK_SENT" => "เราได้ส่งลิงก์สำหรับการยืนยันใหม่ไปยังอีเมล {{email}} กรุณาตรวจสอบอีเมลนี้ในกล่องอีเมลและจดหมายขยะของคุณ", - "RESEND" => "ส่งอีเมลยืนยันอีกครั้ง", - "COMPLETE" => "คุณได้ยืนยันอีเมลของคุณเรียบร้อยแล้ว คุณสามารถเข้าสู่ระบบได้ทันที", - "EMAIL" => "กรุณากรอกอีเมลที่คุณได้ใช้สมัครไว้แล้วอีเมลยืนยันจะถูกส่งไปให้ใหม่", - "PAGE" => "ส่งอีเมลยืนยันสำหรับบัญชีของฉันใหม่", - "SEND" => "ส่งอีเมลยืนยันให้บัญชีของฉัน", - "TOKEN_NOT_FOUND" => "ไม่พบโทเคนยืนยันอีเมล / บัญชีนี้ได้ยืนยันแล้ว", - ] - ], - - "EMAIL" => [ - "INVALID" => "อีเมล {{email}} ไม่มีอยู่จริง", - "IN_USE" => "อีเมล {{email}} ได้ถูกใช้งานแล้ว" - ], - - "FIRST_NAME" => "ชื่อจริง", - - "HEADER_MESSAGE_ROOT" => "คุณได้เข้าสู่ระบบเป็นผู้ดูแลสูงสุด", - - "LAST_NAME" => "นามสกุล", - - "LOCALE.ACCOUNT" => "ภาษาและสถานที่ที่จะใช้สำหรับบัญชีของคุณ", - - "LOGIN" => [ - "@TRANSLATION" => "เข้าสู่ะระบบ", - - "ALREADY_COMPLETE" => "คุณได้เข้าสู่ระบบอยู่แล้ว!", - "SOCIAL" => "หรือเข้าสู่ระบบด้วย", - "REQUIRED" => "ขออภัย คุณจะต้องเข้าสู่ระบบเพื่อเข้าถึงส่วนนี้" - ], - - "LOGOUT" => "ออกจากระบบ", - - "NAME" => "ชื่อ", - - "PAGE" => [ - "LOGIN" => [ - "DESCRIPTION" => "เข้าสู่ระบบไปยังบัญชี {{site_name}} หรือสมัครสมาชิกสำหรับบัญชีใหม่", - "SUBTITLE" => "สมัครสมาชิกฟรี หรือเข้าสู่ระบบด้วยบัญชีที่มีอยู่", - "TITLE" => "มาเริ่มกันเลย!", - ] - ], - - "PASSWORD" => [ - "@TRANSLATION" => "รหัสผ่าน", - - "BETWEEN" => "ระหว่าง {{min}}-{{max}} ตัวอักษร", - - "CONFIRM" => "ยืนยันรหัสผ่าน", - "CONFIRM_CURRENT" => "กรุณายืนยันรหัสผ่านปัจจุบันของคุณ", - "CONFIRM_NEW" => "ยืนยันรหัสผ่านใหม่", - "CONFIRM_NEW_EXPLAIN" => "กรอกรหัสผ่านใหม่ของคุณอีกครั้ง", - "CONFIRM_NEW_HELP" => "กรอกเฉพาะเมื่อคุณต้องการตั้งรหัสผ่านใหม่", - "CURRENT" => "รหัสผ่านปัจจุบัน", - "CURRENT_EXPLAIN" => "คุณจะต้องยืนยันรหัสผ่านปัจจุบันเพื่อแก้ไขข้อมูล", - - "FORGOTTEN" => "ลืมรหัสผ่าน", - "FORGET" => [ - "@TRANSLATION" => "ฉันลืมรหัสผ่านของฉัน", - - "COULD_NOT_UPDATE" => "ไม่สามารถปรับปรุงรหัสผ่าน", - "EMAIL" => "กรุณากรอกที่อยู่อีเมลที่คุณเคยใช้เข้าสู่ระบบ ลิงก์ขั้นตอนการรีเซ็ตรหัสผ่านของคุณจะถูกส่งไปให้คุณ", - "EMAIL_SEND" => "ลิงก์รีเซ็ตรหัสผ่านจากอีเมล", - "INVALID" => "ขอรีเซ็ตรหัสผ่านนี้ไม่มีอยู่ หรือหมดอายุไปแล้ว กรุณาลอง ส่งคำขอของคุณอีกครั้ง", - "PAGE" => "รับลิงก์สำหรับการรีเซ็ตรหัสผ่านของคุณ", - "REQUEST_CANNED" => "คำขอลืมรหัสผ่านได้ถูกยกเลิก", - "REQUEST_SENT" => "หากอีเมล {{email}} ตรงกับบัญชีในระบบของเราลิงก์การรีเซ็ตรหัสผ่านจะถูกส่งไปที่ {{email}}" - ], - - "RESET" => [ - "@TRANSLATION" => "รีเซ็ตรหัสผ่าน", - "CHOOSE" => "กรุณาเลือกรหัสผ่านใหม่เพื่อดำเนินการต่อ", - "PAGE" => "เลือกรหัสผ่านใหม่สำหรับบัญชีของคุณ", - "SEND" => "ตั้งรหัสผ่านใหม่และเข้าสู่ระบบ" - ], - - "HASH_FAILED" => "เข้ารหัสรหัสผ่านล้มเหลว กรุณาติดต่อผู้ดูแลระบบของเว็บไซต์", - "INVALID" => "รหัสผ่านปัจจุบันไม่ตรงกับรหัสผ่านที่เราบันทึกไว้", - "NEW" => "รหัสผ่านใหม่", - "NOTHING_TO_UPDATE" => "คุณไม่สามารถปรังปรุงด้วยรหัสผ่านเดียวกัน", - "UPDATED" => "ปรังปรุงรหัสผ่านของบัญชีแล้ว" - ], - - "REGISTER" => "สมัครสมาชิก", - "REGISTER_ME" => "ให้ฉันสมัครสมาชิกด้วย", - - "REGISTRATION" => [ - "BROKEN" => "เราขออภัย มันมีปัญหาในการดำเนินการสมัครสมาชิกของเรา กรุณาติดต่อเราโดยตรงเพื่อขอความช่วยเหลือ", - "COMPLETE_TYPE1" => "คุณได้สมัครสมาชิกเรียบร้อยแล้ว คุณสามารถเข้าสู่ระบบได้ทันที", - "COMPLETE_TYPE2" => "คุณได้สมัครสมาชิกเรียบร้อยแล้ว คุณจะได้รับอีเมลยืนยันที่มีลิงก์สำหรับเปิดใช้งานบัญชีของคุณอยู่ คุณจะไม่สามารถเข้าสู่ระบบจนกว่าคุณจะยืนยันอีเมลแล้ว", - "DISABLED" => "เราขออภัย ระบบสมัครสมาชิกได้ถูกปิดไว้", - "LOGOUT" => "เราขออภัย คุณไม่สามารถสมัครสมาชิกขณะที่เข้าสู่ระบบอยู่ กรุณาออกจากระบบก่อน", - "WELCOME" => "การสมัครสมาชิกนั้นรวดเร็ว และง่ายดาย" - ], - - "RATE_LIMIT_EXCEEDED" => "ถึงขีดจำกัดสำหรับการกระทำนี้แล้ว คุณจะต้องรออีก {{delay}} วินาที ก่อนที่คุณจะได้รับอนุญาตให้ลองใหม่อีกครั้ง", - "REMEMBER_ME" => "จำฉันไว้ในระบบ!", - "REMEMBER_ME_ON_COMPUTER" => "จำฉันไว้ในระบบบนคอมพิวเตอร์นี้ (ไม่แนะนำสำหรับคอมพิวเตอร์สาธารณะ)", - - "SIGNIN" => "เข้าสู่ะระบบ", - "SIGNIN_OR_REGISTER" => "เข้าสู่ระบบหรือสมัครสมาชิก", - "SIGNUP" => "สมัครสมาชิก", - - "TOS" => "ข้อตกลงและเงื่อนไข", - "TOS_AGREEMENT" => "ในการสมัครสมาชิกกับ {{site_title}} หมายถึงคุณยอมรับ ข้อตกลงและเงื่อนไข แล้ว", - "TOS_FOR" => "ข้อตกลงและเงื่อนไขสำหรับ {{title}}", - - "USERNAME" => [ - "@TRANSLATION" => "ชื่อผู้ใช้", - - "CHOOSE" => "เลือกชื่อผู้ใช้ที่เป็นเป็นเอกลักษณ์", - "INVALID" => "ชื่อผู้ใช้ไม่ถูกต้อง", - "IN_USE" => "ชื่อผู้ใช้ {{user_name}} ถูกใช้งานแล้ว" - ], - - "USER_ID_INVALID" => "ไม่พบหมายเลขผู้ใช้ที่ร้องขอมา", - "USER_OR_EMAIL_INVALID" => "ชื่อผู้ใช้หรือที่อยู่อีเมลไม่ถูกต้อง", - "USER_OR_PASS_INVALID" => "ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง", - - "WELCOME" => "ยินดีต้อนรับ {{first_name}}" -]; + [ + "@TRANSLATION" => "บัญชี", + + "ACCESS_DENIED" => "หืมม ดูเหมือนว่าคุณไม่ได้รับอนุญาตให้ทำเช่นนั้น", + + "DISABLED" => "บัญชีนี้ถูกปิดการใช้งานไปแล้ว กรุณาติดต่อเราสำหรับข้อมูลเพิ่มเติม", + + "EMAIL_UPDATED" => "ปรับปรุงบัญชีอีเมลแล้ว", + + "INVALID" => "ไม่พบบัญชีนี้ มันอาจถูกลบไปแล้ว กรุณาติดต่อเราสำหรับข้อมูลเพิ่มเติม", + + "MASTER_NOT_EXISTS" => "คุณไม่สามารถสมัครสมาชิกได้จนกว่าจะสร้างบัญชีหลัก!", + "MY" => "บัญชีของฉัน", + + "SESSION_COMPROMISED" => "เซสชันของคุณถูกลักลอบใช้ คุณควรจะออกจากระบบบนอุปกรณ์ทั้งหมดแล้วกลับเข้าสู่ระบบและตรวจสอบให้แน่ใจว่าไม่มีการแก้ไขข้อมูลของคุณ", + "SESSION_COMPROMISED_TITLE" => "บัญชีของคุณอาจถูกบุกรุก", + "SESSION_EXPIRED" => "เซสชันของคุณหมดอายุ กรุณาเข้าสู่ระบบอีกครั้ง", + + "SETTINGS" => [ + "@TRANSLATION" => "การตั้งค่าบัญชี", + "DESCRIPTION" => "ปรับปรุงการตั้งค่าบัญชีของคุณ รวมไปถึงอีเมล ชื่อ และรหัสผ่าน", + "UPDATED" => "ปรับปรุงการตั้งค่าบัญชีของคุณแล้ว" + ], + + "TOOLS" => "เครื่องมือบัญชี", + + "UNVERIFIED" => "บัญชีของคุณยังไม่ได้รับการยืนยัน กรุณาตรวจสอบกล่องอีเมลและจดหมายขยะของคุณสำหรับขั้นตอนการเปิดใช้งานบัญชี", + + "VERIFICATION" => [ + "NEW_LINK_SENT" => "เราได้ส่งลิงก์สำหรับการยืนยันใหม่ไปยังอีเมล {{email}} กรุณาตรวจสอบอีเมลนี้ในกล่องอีเมลและจดหมายขยะของคุณ", + "RESEND" => "ส่งอีเมลยืนยันอีกครั้ง", + "COMPLETE" => "คุณได้ยืนยันอีเมลของคุณเรียบร้อยแล้ว คุณสามารถเข้าสู่ระบบได้ทันที", + "EMAIL" => "กรุณากรอกอีเมลที่คุณได้ใช้สมัครไว้แล้วอีเมลยืนยันจะถูกส่งไปให้ใหม่", + "PAGE" => "ส่งอีเมลยืนยันสำหรับบัญชีของฉันใหม่", + "SEND" => "ส่งอีเมลยืนยันให้บัญชีของฉัน", + "TOKEN_NOT_FOUND" => "ไม่พบโทเคนยืนยันอีเมล / บัญชีนี้ได้ยืนยันแล้ว", + ] + ], + + "EMAIL" => [ + "INVALID" => "อีเมล {{email}} ไม่มีอยู่จริง", + "IN_USE" => "อีเมล {{email}} ได้ถูกใช้งานแล้ว" + ], + + "FIRST_NAME" => "ชื่อจริง", + + "HEADER_MESSAGE_ROOT" => "คุณได้เข้าสู่ระบบเป็นผู้ดูแลสูงสุด", + + "LAST_NAME" => "นามสกุล", + + "LOCALE.ACCOUNT" => "ภาษาและสถานที่ที่จะใช้สำหรับบัญชีของคุณ", + + "LOGIN" => [ + "@TRANSLATION" => "เข้าสู่ะระบบ", + + "ALREADY_COMPLETE" => "คุณได้เข้าสู่ระบบอยู่แล้ว!", + "SOCIAL" => "หรือเข้าสู่ระบบด้วย", + "REQUIRED" => "ขออภัย คุณจะต้องเข้าสู่ระบบเพื่อเข้าถึงส่วนนี้" + ], + + "LOGOUT" => "ออกจากระบบ", + + "NAME" => "ชื่อ", + + "PAGE" => [ + "LOGIN" => [ + "DESCRIPTION" => "เข้าสู่ระบบไปยังบัญชี {{site_name}} หรือสมัครสมาชิกสำหรับบัญชีใหม่", + "SUBTITLE" => "สมัครสมาชิกฟรี หรือเข้าสู่ระบบด้วยบัญชีที่มีอยู่", + "TITLE" => "มาเริ่มกันเลย!", + ] + ], + + "PASSWORD" => [ + "@TRANSLATION" => "รหัสผ่าน", + + "BETWEEN" => "ระหว่าง {{min}}-{{max}} ตัวอักษร", + + "CONFIRM" => "ยืนยันรหัสผ่าน", + "CONFIRM_CURRENT" => "กรุณายืนยันรหัสผ่านปัจจุบันของคุณ", + "CONFIRM_NEW" => "ยืนยันรหัสผ่านใหม่", + "CONFIRM_NEW_EXPLAIN" => "กรอกรหัสผ่านใหม่ของคุณอีกครั้ง", + "CONFIRM_NEW_HELP" => "กรอกเฉพาะเมื่อคุณต้องการตั้งรหัสผ่านใหม่", + "CURRENT" => "รหัสผ่านปัจจุบัน", + "CURRENT_EXPLAIN" => "คุณจะต้องยืนยันรหัสผ่านปัจจุบันเพื่อแก้ไขข้อมูล", + + "FORGOTTEN" => "ลืมรหัสผ่าน", + "FORGET" => [ + "@TRANSLATION" => "ฉันลืมรหัสผ่านของฉัน", + + "COULD_NOT_UPDATE" => "ไม่สามารถปรับปรุงรหัสผ่าน", + "EMAIL" => "กรุณากรอกที่อยู่อีเมลที่คุณเคยใช้เข้าสู่ระบบ ลิงก์ขั้นตอนการรีเซ็ตรหัสผ่านของคุณจะถูกส่งไปให้คุณ", + "EMAIL_SEND" => "ลิงก์รีเซ็ตรหัสผ่านจากอีเมล", + "INVALID" => "ขอรีเซ็ตรหัสผ่านนี้ไม่มีอยู่ หรือหมดอายุไปแล้ว กรุณาลอง ส่งคำขอของคุณอีกครั้ง", + "PAGE" => "รับลิงก์สำหรับการรีเซ็ตรหัสผ่านของคุณ", + "REQUEST_CANNED" => "คำขอลืมรหัสผ่านได้ถูกยกเลิก", + "REQUEST_SENT" => "หากอีเมล {{email}} ตรงกับบัญชีในระบบของเราลิงก์การรีเซ็ตรหัสผ่านจะถูกส่งไปที่ {{email}}" + ], + + "RESET" => [ + "@TRANSLATION" => "รีเซ็ตรหัสผ่าน", + "CHOOSE" => "กรุณาเลือกรหัสผ่านใหม่เพื่อดำเนินการต่อ", + "PAGE" => "เลือกรหัสผ่านใหม่สำหรับบัญชีของคุณ", + "SEND" => "ตั้งรหัสผ่านใหม่และเข้าสู่ระบบ" + ], + + "HASH_FAILED" => "เข้ารหัสรหัสผ่านล้มเหลว กรุณาติดต่อผู้ดูแลระบบของเว็บไซต์", + "INVALID" => "รหัสผ่านปัจจุบันไม่ตรงกับรหัสผ่านที่เราบันทึกไว้", + "NEW" => "รหัสผ่านใหม่", + "NOTHING_TO_UPDATE" => "คุณไม่สามารถปรังปรุงด้วยรหัสผ่านเดียวกัน", + "UPDATED" => "ปรังปรุงรหัสผ่านของบัญชีแล้ว" + ], + + "REGISTER" => "สมัครสมาชิก", + "REGISTER_ME" => "ให้ฉันสมัครสมาชิกด้วย", + + "REGISTRATION" => [ + "BROKEN" => "เราขออภัย มันมีปัญหาในการดำเนินการสมัครสมาชิกของเรา กรุณาติดต่อเราโดยตรงเพื่อขอความช่วยเหลือ", + "COMPLETE_TYPE1" => "คุณได้สมัครสมาชิกเรียบร้อยแล้ว คุณสามารถเข้าสู่ระบบได้ทันที", + "COMPLETE_TYPE2" => "คุณได้สมัครสมาชิกเรียบร้อยแล้ว คุณจะได้รับอีเมลยืนยันที่มีลิงก์สำหรับเปิดใช้งานบัญชีของคุณอยู่ คุณจะไม่สามารถเข้าสู่ระบบจนกว่าคุณจะยืนยันอีเมลแล้ว", + "DISABLED" => "เราขออภัย ระบบสมัครสมาชิกได้ถูกปิดไว้", + "LOGOUT" => "เราขออภัย คุณไม่สามารถสมัครสมาชิกขณะที่เข้าสู่ระบบอยู่ กรุณาออกจากระบบก่อน", + "WELCOME" => "การสมัครสมาชิกนั้นรวดเร็ว และง่ายดาย" + ], + + "RATE_LIMIT_EXCEEDED" => "ถึงขีดจำกัดสำหรับการกระทำนี้แล้ว คุณจะต้องรออีก {{delay}} วินาที ก่อนที่คุณจะได้รับอนุญาตให้ลองใหม่อีกครั้ง", + "REMEMBER_ME" => "จำฉันไว้ในระบบ!", + "REMEMBER_ME_ON_COMPUTER" => "จำฉันไว้ในระบบบนคอมพิวเตอร์นี้ (ไม่แนะนำสำหรับคอมพิวเตอร์สาธารณะ)", + + "SIGNIN" => "เข้าสู่ะระบบ", + "SIGNIN_OR_REGISTER" => "เข้าสู่ระบบหรือสมัครสมาชิก", + "SIGNUP" => "สมัครสมาชิก", + + "TOS" => "ข้อตกลงและเงื่อนไข", + "TOS_AGREEMENT" => "ในการสมัครสมาชิกกับ {{site_title}} หมายถึงคุณยอมรับ ข้อตกลงและเงื่อนไข แล้ว", + "TOS_FOR" => "ข้อตกลงและเงื่อนไขสำหรับ {{title}}", + + "USERNAME" => [ + "@TRANSLATION" => "ชื่อผู้ใช้", + + "CHOOSE" => "เลือกชื่อผู้ใช้ที่เป็นเป็นเอกลักษณ์", + "INVALID" => "ชื่อผู้ใช้ไม่ถูกต้อง", + "IN_USE" => "ชื่อผู้ใช้ {{user_name}} ถูกใช้งานแล้ว" + ], + + "USER_ID_INVALID" => "ไม่พบหมายเลขผู้ใช้ที่ร้องขอมา", + "USER_OR_EMAIL_INVALID" => "ชื่อผู้ใช้หรือที่อยู่อีเมลไม่ถูกต้อง", + "USER_OR_PASS_INVALID" => "ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง", + + "WELCOME" => "ยินดีต้อนรับ {{first_name}}" +]; diff --git a/main/app/sprinkles/account/locale/th_TH/validate.php b/main/app/sprinkles/account/locale/th_TH/validate.php old mode 100755 new mode 100644 index 1a2e90a..6540aa2 --- a/main/app/sprinkles/account/locale/th_TH/validate.php +++ b/main/app/sprinkles/account/locale/th_TH/validate.php @@ -1,18 +1,18 @@ - [ - "PASSWORD_MISMATCH" => "รหัสผ่านและรหัสผ่านยืนยันของคุณจะต้องตรงกัน" - ] -]; + [ + "PASSWORD_MISMATCH" => "รหัสผ่านและรหัสผ่านยืนยันของคุณจะต้องตรงกัน" + ] +]; diff --git a/main/app/sprinkles/account/locale/tr/messages.php b/main/app/sprinkles/account/locale/tr/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/tr/validate.php b/main/app/sprinkles/account/locale/tr/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/zh_CN/messages.php b/main/app/sprinkles/account/locale/zh_CN/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/locale/zh_CN/validate.php b/main/app/sprinkles/account/locale/zh_CN/validate.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/routes/routes.php b/main/app/sprinkles/account/routes/routes.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/account-settings.yaml b/main/app/sprinkles/account/schema/requests/account-settings.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/account-verify.yaml b/main/app/sprinkles/account/schema/requests/account-verify.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/check-username.yaml b/main/app/sprinkles/account/schema/requests/check-username.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/deny-password.yaml b/main/app/sprinkles/account/schema/requests/deny-password.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/forgot-password.yaml b/main/app/sprinkles/account/schema/requests/forgot-password.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/login.yaml b/main/app/sprinkles/account/schema/requests/login.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/profile-settings.yaml b/main/app/sprinkles/account/schema/requests/profile-settings.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/register.yaml b/main/app/sprinkles/account/schema/requests/register.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/resend-verification.yaml b/main/app/sprinkles/account/schema/requests/resend-verification.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/schema/requests/set-password.yaml b/main/app/sprinkles/account/schema/requests/set-password.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Account.php b/main/app/sprinkles/account/src/Account.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/AuthGuard.php b/main/app/sprinkles/account/src/Authenticate/AuthGuard.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Authenticator.php b/main/app/sprinkles/account/src/Authenticate/Authenticator.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Exception/AccountDisabledException.php b/main/app/sprinkles/account/src/Authenticate/Exception/AccountDisabledException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Exception/AccountInvalidException.php b/main/app/sprinkles/account/src/Authenticate/Exception/AccountInvalidException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Exception/AccountNotVerifiedException.php b/main/app/sprinkles/account/src/Authenticate/Exception/AccountNotVerifiedException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Exception/AuthCompromisedException.php b/main/app/sprinkles/account/src/Authenticate/Exception/AuthCompromisedException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Exception/AuthExpiredException.php b/main/app/sprinkles/account/src/Authenticate/Exception/AuthExpiredException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Exception/InvalidCredentialsException.php b/main/app/sprinkles/account/src/Authenticate/Exception/InvalidCredentialsException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authenticate/Hasher.php b/main/app/sprinkles/account/src/Authenticate/Hasher.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authorize/AccessConditionExpression.php b/main/app/sprinkles/account/src/Authorize/AccessConditionExpression.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authorize/AuthorizationException.php b/main/app/sprinkles/account/src/Authorize/AuthorizationException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authorize/AuthorizationManager.php b/main/app/sprinkles/account/src/Authorize/AuthorizationManager.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Authorize/ParserNodeFunctionEvaluator.php b/main/app/sprinkles/account/src/Authorize/ParserNodeFunctionEvaluator.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Bakery/CreateAdminUser.php b/main/app/sprinkles/account/src/Bakery/CreateAdminUser.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Controller/AccountController.php b/main/app/sprinkles/account/src/Controller/AccountController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Controller/Exception/SpammyRequestException.php b/main/app/sprinkles/account/src/Controller/Exception/SpammyRequestException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/ActivitiesTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/ActivitiesTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/GroupsTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/GroupsTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/PasswordResetsTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/PasswordResetsTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/PermissionRolesTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/PermissionRolesTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/PermissionsTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/PermissionsTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/PersistencesTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/PersistencesTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/RoleUsersTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/RoleUsersTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/RolesTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/RolesTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/UsersTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/UsersTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Migrations/v400/VerificationsTable.php b/main/app/sprinkles/account/src/Database/Migrations/v400/VerificationsTable.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Models/Activity.php b/main/app/sprinkles/account/src/Database/Models/Activity.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Models/Group.php b/main/app/sprinkles/account/src/Database/Models/Group.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Models/PasswordReset.php b/main/app/sprinkles/account/src/Database/Models/PasswordReset.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Models/Permission.php b/main/app/sprinkles/account/src/Database/Models/Permission.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Models/Role.php b/main/app/sprinkles/account/src/Database/Models/Role.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Models/User.php b/main/app/sprinkles/account/src/Database/Models/User.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Database/Models/Verification.php b/main/app/sprinkles/account/src/Database/Models/Verification.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Error/Handler/AuthCompromisedExceptionHandler.php b/main/app/sprinkles/account/src/Error/Handler/AuthCompromisedExceptionHandler.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php b/main/app/sprinkles/account/src/Error/Handler/AuthExpiredExceptionHandler.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Error/Handler/ForbiddenExceptionHandler.php b/main/app/sprinkles/account/src/Error/Handler/ForbiddenExceptionHandler.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Facades/Password.php b/main/app/sprinkles/account/src/Facades/Password.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Log/UserActivityDatabaseHandler.php b/main/app/sprinkles/account/src/Log/UserActivityDatabaseHandler.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Log/UserActivityProcessor.php b/main/app/sprinkles/account/src/Log/UserActivityProcessor.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Repository/PasswordResetRepository.php b/main/app/sprinkles/account/src/Repository/PasswordResetRepository.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Repository/TokenRepository.php b/main/app/sprinkles/account/src/Repository/TokenRepository.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Repository/VerificationRepository.php b/main/app/sprinkles/account/src/Repository/VerificationRepository.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/ServicesProvider/ServicesProvider.php b/main/app/sprinkles/account/src/ServicesProvider/ServicesProvider.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Twig/AccountExtension.php b/main/app/sprinkles/account/src/Twig/AccountExtension.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Util/HashFailedException.php b/main/app/sprinkles/account/src/Util/HashFailedException.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/src/Util/Util.php b/main/app/sprinkles/account/src/Util/Util.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/forms/settings-account.html.twig b/main/app/sprinkles/account/templates/forms/settings-account.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/forms/settings-profile.html.twig b/main/app/sprinkles/account/templates/forms/settings-profile.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/mail/password-reset.html.twig b/main/app/sprinkles/account/templates/mail/password-reset.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/mail/resend-verification.html.twig b/main/app/sprinkles/account/templates/mail/resend-verification.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/mail/verify-account.html.twig b/main/app/sprinkles/account/templates/mail/verify-account.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/modals/tos.html.twig b/main/app/sprinkles/account/templates/modals/tos.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/navigation/main-nav.html.twig b/main/app/sprinkles/account/templates/navigation/main-nav.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/navigation/user-card.html.twig b/main/app/sprinkles/account/templates/navigation/user-card.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/pages/account-settings.html.twig b/main/app/sprinkles/account/templates/pages/account-settings.html.twig old mode 100755 new mode 100644 index 61cd3d0..86db3d9 --- a/main/app/sprinkles/account/templates/pages/account-settings.html.twig +++ b/main/app/sprinkles/account/templates/pages/account-settings.html.twig @@ -34,7 +34,7 @@ {% block scripts_page %} @@ -42,4 +42,4 @@ {{ assets.js('js/pages/account-settings') | raw }} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/main/app/sprinkles/account/templates/pages/error/compromised.html.twig b/main/app/sprinkles/account/templates/pages/error/compromised.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/pages/forgot-password.html.twig b/main/app/sprinkles/account/templates/pages/forgot-password.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/pages/register.html.twig b/main/app/sprinkles/account/templates/pages/register.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/pages/resend-verification.html.twig b/main/app/sprinkles/account/templates/pages/resend-verification.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/pages/reset-password.html.twig b/main/app/sprinkles/account/templates/pages/reset-password.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/pages/set-password.html.twig b/main/app/sprinkles/account/templates/pages/set-password.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/templates/pages/sign-in.html.twig b/main/app/sprinkles/account/templates/pages/sign-in.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/tests/Unit/FactoriesTest.php b/main/app/sprinkles/account/tests/Unit/FactoriesTest.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/account/tests/Unit/HasherTest.php b/main/app/sprinkles/account/tests/Unit/HasherTest.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/asset-bundles.json b/main/app/sprinkles/admin/asset-bundles.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/css/tablesorter-custom.css b/main/app/sprinkles/admin/assets/userfrosting/css/tablesorter-custom.css old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/activities.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/activities.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/dashboard.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/dashboard.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/group.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/group.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/groups.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/groups.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/permission.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/permission.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/permissions.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/permissions.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/role.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/role.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/roles.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/roles.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/user.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/user.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/pages/users.js b/main/app/sprinkles/admin/assets/userfrosting/js/pages/users.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/widgets/groups.js b/main/app/sprinkles/admin/assets/userfrosting/js/widgets/groups.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/widgets/roles.js b/main/app/sprinkles/admin/assets/userfrosting/js/widgets/roles.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/widgets/users.js b/main/app/sprinkles/admin/assets/userfrosting/js/widgets/users.js old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/composer.json b/main/app/sprinkles/admin/composer.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/ar/messages.php b/main/app/sprinkles/admin/locale/ar/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/de_DE/messages.php b/main/app/sprinkles/admin/locale/de_DE/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/en_US/messages.php b/main/app/sprinkles/admin/locale/en_US/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/es_ES/messages.php b/main/app/sprinkles/admin/locale/es_ES/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/fa/messages.php b/main/app/sprinkles/admin/locale/fa/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/fr_FR/messages.php b/main/app/sprinkles/admin/locale/fr_FR/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/it_IT/messages.php b/main/app/sprinkles/admin/locale/it_IT/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/pt_PT/messages.php b/main/app/sprinkles/admin/locale/pt_PT/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/ru_RU/messages.php b/main/app/sprinkles/admin/locale/ru_RU/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/th_TH/messages.php b/main/app/sprinkles/admin/locale/th_TH/messages.php old mode 100755 new mode 100644 index 546232d..ccc2ca5 --- a/main/app/sprinkles/admin/locale/th_TH/messages.php +++ b/main/app/sprinkles/admin/locale/th_TH/messages.php @@ -1,134 +1,134 @@ - [ - 1 => "กิจกรรม", - 2 => "กิจกรรม", - - "LAST" => "กิจกรรมล่าสุด", - "PAGE" => "รายการกิจกรรมของผู้ใช้", - "TIME" => "เวลาที่ทำกิจกรรม" - ], - - "CACHE" => [ - "CLEAR" => "ล้างแคช", - "CLEAR_CONFIRM" => "คุณแน่ใจหรือที่จะล้างแคชของเว็บ?", - "CLEAR_CONFIRM_YES" => "ใช่ ล้างแคชเลย", - "CLEARED" => "ล้างแคชเรียบร้อยแล้ว!" - ], - - "DASHBOARD" => "แผงควบคุม", - "DELETE_MASTER" => "คุณไม่สามารถลบบัญชีหลักได้!", - "DELETION_SUCCESSFUL" => "ลบผู้ใช้ {{user_name}} เรียบร้อยแล้ว", - "DETAILS_UPDATED" => "ปรับปรุงรายระเอียดบัญชีให้กับ {{user_name}} แล้ว", - "DISABLE_MASTER" => "คุณไม่สามารถปิดการใช้งานบัญชีหลัก!", - "DISABLE_SUCCESSFUL" => "ปิดการใช้งานบัญชีของผู้ใช้ {{user_name}} เรียบร้อยแล้ว", - - "ENABLE_SUCCESSFUL" => "เปิดการใช้งานบัญชีของผู้ใช้ {{user_name}} เรียบร้อยแล้ว", - - "GROUP" => [ - 1 => "กลุ่ม", - 2 => "กลุ่ม", - - "CREATE" => "สร้างกลุ่ม", - "DELETE" => "ลบกลุ่ม", - "DELETE_CONFIRM" => "คุณแน่ใจหรือที่จะลบกลุ่ม {{name}}?", - "DELETE_YES" => "ใช่ ลบกลุ่มนี้เลย", - "EDIT" => "แก้ไขกลุ่ม", - "ICON" => "ไอคอนกลุ่ม", - "ICON_EXPLAIN" => "ไอคอนสำหรับสมาชิกกลุ่ม", - "INFO_PAGE" => "หน้าข้อมูลกลุ่มสำหรับ {{name}}", - //"MANAGE" => "Manage group", - "NAME" => "ชื่อกลุ่ม", - "NAME_EXPLAIN" => "กรุณาตั้งชื่อสำหรับกลุ่มนี้", - "PAGE_DESCRIPTION" => "รายชื่อกลุ่มในเว็บของคุณ ประกอบไปด้วยเครื่องมือในการจัดการสำหรับการแก้ไขและลบกลุ่ม" - ], - - "MANUALLY_ACTIVATED" => "บัญชีของ {{user_name}} ได้เปิดใช้งานเองแล้ว", - "MASTER_ACCOUNT_EXISTS" => "มีบัญชีหลักอยู่แล้ว!", - "MIGRATION" => [ - "REQUIRED" => "ต้องการการปรับปรุงฐานข้อมูล" - ], - - "PERMISSION" => [ - 1 => "สิทธิการเข้าถึง", - 2 => "สิทธิการเข้าถึง", - - "ASSIGN_NEW" => "กำหนดสิทธิการเข้าถึงใหม่", - "HOOK_CONDITION" => "ข้อกำหนด/เงื่อนไข", - "MANAGE" => "จัดการสิทธิการเข้าถึง", - "PAGE_DESCRIPTION" => "รายการสิทธิการเข้าถึงในเว็บของคุณ ประกอบไปด้วยเครื่องมือในการจัดการสำหรับการแก้ไขและลบสิทธิการเข้าถึง", - "UPDATE" => "ปรับปรุงสิทธิการเข้าถึง" - ], - - "ROLE" => [ - 1 => "ตำแหน่ง", - 2 => "ตำแหน่ง", - - "ASSIGN_NEW" => "กำหนดตำแหน่งใหม่", - "CREATE" => "สร้างตำแหน่ง", - "DELETE" => "ลบตำแหน่ง", - "DELETE_CONFIRM" => "คุณแน่ใจหรือที่จะลบตำแหน่ง {{name}}?", - "DELETE_YES" => "ใช่ ลบตำแหน่งนี้เลย", - "EDIT" => "แก้ไขตำแหน่ง", - "INFO_PAGE" => "หน้าข้อมูลตำแหน่งสำหรับ {{name}}", - "MANAGE" => "จัดการตำแหน่ง", - "NAME" => "ชื่อ", - "NAME_EXPLAIN" => "กรุณาตั้งชื่อสำหรับตำแหน่งนี้", - "PAGE_DESCRIPTION" => "รายชื่อตำแหน่งในเว็บของคุณ ประกอบไปด้วยเครื่องมือในการจัดการสำหรับแก้ไขและลบตำแหน่ง", - "UPDATED" => "ปรับปรุงตำแหน่ง" - ], - - "SYSTEM_INFO" => [ - "@TRANSLATION" => "ข้อมูลระบบ", - - "DB_NAME" => "ชื่อฐานข้อมูล", - "DB_VERSION" => "เวอร์ชั่นฐานข้อมูล", - "DIRECTORY" => "ไดเรกทอรีของโปรเจค", - "PHP_VERSION" => "เวอร์ชั่น PHP", - "SERVER" => "ซอฟต์แวร์เว็บเซิร์ฟเวอร์", - "SPRINKLES" => "Sprinkles ที่ถูกโหลด", - "UF_VERSION" => "เวอร์ชั่น UserFrosting", - "URL" => "URL ของรากเว็บไซต์" - ], - - "USER" => [ - 1 => "ผู้ใช้", - 2 => "ผู้ใช้", - - "ADMIN" => [ - "CHANGE_PASSWORD" => "เปลี่ยนรหัสผ่านผู้ใช้", - "SEND_PASSWORD_LINK" => "ส่งลิงก์ที่จะอนุญาตให้ผู้ใช้เลือกรหัสผ่านเองให้กับผู้ใช้", - "SET_PASSWORD" => "ตั้งรหัสผ่านของผู้ใช้เป็น" - ], - - "ACTIVATE" => "เปิดใช้งานผู้ใช้", - "CREATE" => "สร้างผู้ใช้", - "DELETE" => "ลบผู้ใช้", - "DELETE_CONFIRM" => "คุณแน่ใจหรือที่จะลบผู้ใช้ {{name}}?", - "DELETE_YES" => "ใช่ ลบผู้ใช้นี้เลย", - "DISABLE" => "ปิดการใช้งานผู้ใช้", - "EDIT" => "แก้ไขผู้ใช้", - "ENABLE" => "เปิดการใช้งานผู้ใช้", - "INFO_PAGE" => "หน้าข้อมูลของผู้ใช้ {{name}}", - "PAGE_DESCRIPTION" => "รายชื่อผู้ใช้ในเว็บของคุณ ประกอบไปด้วยเครื่องมือสำหรับการจัดการ รวมทั้งความสามารถในการแก้ไขรายละเอียดผู้ใช้ การเปิดใช้งานผู้ใช้ การเปิด/ปิดบัญชีผู้ใช้และอื่น ๆ", - "LATEST" => "ผู้ใช้ล่าสุด", - "VIEW_ALL" => "ดูผู้ใช้ทั้งหมด" - ], - "X_USER" => [ - 0 => "ไม่มีผู้ใช้", - 1 => "{{plural}} ผู้ใช้", - 2 => "{{plural}} ผู้ใช้" - ] + [ + 1 => "กิจกรรม", + 2 => "กิจกรรม", + + "LAST" => "กิจกรรมล่าสุด", + "PAGE" => "รายการกิจกรรมของผู้ใช้", + "TIME" => "เวลาที่ทำกิจกรรม" + ], + + "CACHE" => [ + "CLEAR" => "ล้างแคช", + "CLEAR_CONFIRM" => "คุณแน่ใจหรือที่จะล้างแคชของเว็บ?", + "CLEAR_CONFIRM_YES" => "ใช่ ล้างแคชเลย", + "CLEARED" => "ล้างแคชเรียบร้อยแล้ว!" + ], + + "DASHBOARD" => "แผงควบคุม", + "DELETE_MASTER" => "คุณไม่สามารถลบบัญชีหลักได้!", + "DELETION_SUCCESSFUL" => "ลบผู้ใช้ {{user_name}} เรียบร้อยแล้ว", + "DETAILS_UPDATED" => "ปรับปรุงรายระเอียดบัญชีให้กับ {{user_name}} แล้ว", + "DISABLE_MASTER" => "คุณไม่สามารถปิดการใช้งานบัญชีหลัก!", + "DISABLE_SUCCESSFUL" => "ปิดการใช้งานบัญชีของผู้ใช้ {{user_name}} เรียบร้อยแล้ว", + + "ENABLE_SUCCESSFUL" => "เปิดการใช้งานบัญชีของผู้ใช้ {{user_name}} เรียบร้อยแล้ว", + + "GROUP" => [ + 1 => "กลุ่ม", + 2 => "กลุ่ม", + + "CREATE" => "สร้างกลุ่ม", + "DELETE" => "ลบกลุ่ม", + "DELETE_CONFIRM" => "คุณแน่ใจหรือที่จะลบกลุ่ม {{name}}?", + "DELETE_YES" => "ใช่ ลบกลุ่มนี้เลย", + "EDIT" => "แก้ไขกลุ่ม", + "ICON" => "ไอคอนกลุ่ม", + "ICON_EXPLAIN" => "ไอคอนสำหรับสมาชิกกลุ่ม", + "INFO_PAGE" => "หน้าข้อมูลกลุ่มสำหรับ {{name}}", + //"MANAGE" => "Manage group", + "NAME" => "ชื่อกลุ่ม", + "NAME_EXPLAIN" => "กรุณาตั้งชื่อสำหรับกลุ่มนี้", + "PAGE_DESCRIPTION" => "รายชื่อกลุ่มในเว็บของคุณ ประกอบไปด้วยเครื่องมือในการจัดการสำหรับการแก้ไขและลบกลุ่ม" + ], + + "MANUALLY_ACTIVATED" => "บัญชีของ {{user_name}} ได้เปิดใช้งานเองแล้ว", + "MASTER_ACCOUNT_EXISTS" => "มีบัญชีหลักอยู่แล้ว!", + "MIGRATION" => [ + "REQUIRED" => "ต้องการการปรับปรุงฐานข้อมูล" + ], + + "PERMISSION" => [ + 1 => "สิทธิการเข้าถึง", + 2 => "สิทธิการเข้าถึง", + + "ASSIGN_NEW" => "กำหนดสิทธิการเข้าถึงใหม่", + "HOOK_CONDITION" => "ข้อกำหนด/เงื่อนไข", + "MANAGE" => "จัดการสิทธิการเข้าถึง", + "PAGE_DESCRIPTION" => "รายการสิทธิการเข้าถึงในเว็บของคุณ ประกอบไปด้วยเครื่องมือในการจัดการสำหรับการแก้ไขและลบสิทธิการเข้าถึง", + "UPDATE" => "ปรับปรุงสิทธิการเข้าถึง" + ], + + "ROLE" => [ + 1 => "ตำแหน่ง", + 2 => "ตำแหน่ง", + + "ASSIGN_NEW" => "กำหนดตำแหน่งใหม่", + "CREATE" => "สร้างตำแหน่ง", + "DELETE" => "ลบตำแหน่ง", + "DELETE_CONFIRM" => "คุณแน่ใจหรือที่จะลบตำแหน่ง {{name}}?", + "DELETE_YES" => "ใช่ ลบตำแหน่งนี้เลย", + "EDIT" => "แก้ไขตำแหน่ง", + "INFO_PAGE" => "หน้าข้อมูลตำแหน่งสำหรับ {{name}}", + "MANAGE" => "จัดการตำแหน่ง", + "NAME" => "ชื่อ", + "NAME_EXPLAIN" => "กรุณาตั้งชื่อสำหรับตำแหน่งนี้", + "PAGE_DESCRIPTION" => "รายชื่อตำแหน่งในเว็บของคุณ ประกอบไปด้วยเครื่องมือในการจัดการสำหรับแก้ไขและลบตำแหน่ง", + "UPDATED" => "ปรับปรุงตำแหน่ง" + ], + + "SYSTEM_INFO" => [ + "@TRANSLATION" => "ข้อมูลระบบ", + + "DB_NAME" => "ชื่อฐานข้อมูล", + "DB_VERSION" => "เวอร์ชั่นฐานข้อมูล", + "DIRECTORY" => "ไดเรกทอรีของโปรเจค", + "PHP_VERSION" => "เวอร์ชั่น PHP", + "SERVER" => "ซอฟต์แวร์เว็บเซิร์ฟเวอร์", + "SPRINKLES" => "Sprinkles ที่ถูกโหลด", + "UF_VERSION" => "เวอร์ชั่น UserFrosting", + "URL" => "URL ของรากเว็บไซต์" + ], + + "USER" => [ + 1 => "ผู้ใช้", + 2 => "ผู้ใช้", + + "ADMIN" => [ + "CHANGE_PASSWORD" => "เปลี่ยนรหัสผ่านผู้ใช้", + "SEND_PASSWORD_LINK" => "ส่งลิงก์ที่จะอนุญาตให้ผู้ใช้เลือกรหัสผ่านเองให้กับผู้ใช้", + "SET_PASSWORD" => "ตั้งรหัสผ่านของผู้ใช้เป็น" + ], + + "ACTIVATE" => "เปิดใช้งานผู้ใช้", + "CREATE" => "สร้างผู้ใช้", + "DELETE" => "ลบผู้ใช้", + "DELETE_CONFIRM" => "คุณแน่ใจหรือที่จะลบผู้ใช้ {{name}}?", + "DELETE_YES" => "ใช่ ลบผู้ใช้นี้เลย", + "DISABLE" => "ปิดการใช้งานผู้ใช้", + "EDIT" => "แก้ไขผู้ใช้", + "ENABLE" => "เปิดการใช้งานผู้ใช้", + "INFO_PAGE" => "หน้าข้อมูลของผู้ใช้ {{name}}", + "PAGE_DESCRIPTION" => "รายชื่อผู้ใช้ในเว็บของคุณ ประกอบไปด้วยเครื่องมือสำหรับการจัดการ รวมทั้งความสามารถในการแก้ไขรายละเอียดผู้ใช้ การเปิดใช้งานผู้ใช้ การเปิด/ปิดบัญชีผู้ใช้และอื่น ๆ", + "LATEST" => "ผู้ใช้ล่าสุด", + "VIEW_ALL" => "ดูผู้ใช้ทั้งหมด" + ], + "X_USER" => [ + 0 => "ไม่มีผู้ใช้", + 1 => "{{plural}} ผู้ใช้", + 2 => "{{plural}} ผู้ใช้" + ] ]; \ No newline at end of file diff --git a/main/app/sprinkles/admin/locale/tr/messages.php b/main/app/sprinkles/admin/locale/tr/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/locale/zh_CN/messages.php b/main/app/sprinkles/admin/locale/zh_CN/messages.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/routes/activities.php b/main/app/sprinkles/admin/routes/activities.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/routes/admin.php b/main/app/sprinkles/admin/routes/admin.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/routes/groups.php b/main/app/sprinkles/admin/routes/groups.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/routes/permissions.php b/main/app/sprinkles/admin/routes/permissions.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/routes/roles.php b/main/app/sprinkles/admin/routes/roles.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/routes/users.php b/main/app/sprinkles/admin/routes/users.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/group/create.yaml b/main/app/sprinkles/admin/schema/requests/group/create.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/group/edit-info.yaml b/main/app/sprinkles/admin/schema/requests/group/edit-info.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/group/get-by-slug.yaml b/main/app/sprinkles/admin/schema/requests/group/get-by-slug.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/role/create.yaml b/main/app/sprinkles/admin/schema/requests/role/create.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/role/edit-field.yaml b/main/app/sprinkles/admin/schema/requests/role/edit-field.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/role/edit-info.yaml b/main/app/sprinkles/admin/schema/requests/role/edit-info.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/role/get-by-slug.yaml b/main/app/sprinkles/admin/schema/requests/role/get-by-slug.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/user/create.yaml b/main/app/sprinkles/admin/schema/requests/user/create.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/user/edit-field.yaml b/main/app/sprinkles/admin/schema/requests/user/edit-field.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/user/edit-info.yaml b/main/app/sprinkles/admin/schema/requests/user/edit-info.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/user/edit-password.yaml b/main/app/sprinkles/admin/schema/requests/user/edit-password.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/schema/requests/user/get-by-username.yaml b/main/app/sprinkles/admin/schema/requests/user/get-by-username.yaml old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Admin.php b/main/app/sprinkles/admin/src/Admin.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Controller/ActivityController.php b/main/app/sprinkles/admin/src/Controller/ActivityController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Controller/AdminController.php b/main/app/sprinkles/admin/src/Controller/AdminController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Controller/GroupController.php b/main/app/sprinkles/admin/src/Controller/GroupController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Controller/PermissionController.php b/main/app/sprinkles/admin/src/Controller/PermissionController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Controller/RoleController.php b/main/app/sprinkles/admin/src/Controller/RoleController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Controller/UserController.php b/main/app/sprinkles/admin/src/Controller/UserController.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/ServicesProvider/ServicesProvider.php b/main/app/sprinkles/admin/src/ServicesProvider/ServicesProvider.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Sprunje/ActivitySprunje.php b/main/app/sprinkles/admin/src/Sprunje/ActivitySprunje.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Sprunje/GroupSprunje.php b/main/app/sprinkles/admin/src/Sprunje/GroupSprunje.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Sprunje/PermissionSprunje.php b/main/app/sprinkles/admin/src/Sprunje/PermissionSprunje.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Sprunje/PermissionUserSprunje.php b/main/app/sprinkles/admin/src/Sprunje/PermissionUserSprunje.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Sprunje/RoleSprunje.php b/main/app/sprinkles/admin/src/Sprunje/RoleSprunje.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Sprunje/UserPermissionSprunje.php b/main/app/sprinkles/admin/src/Sprunje/UserPermissionSprunje.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/src/Sprunje/UserSprunje.php b/main/app/sprinkles/admin/src/Sprunje/UserSprunje.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/forms/group.html.twig b/main/app/sprinkles/admin/templates/forms/group.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/forms/role.html.twig b/main/app/sprinkles/admin/templates/forms/role.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/forms/user.html.twig b/main/app/sprinkles/admin/templates/forms/user.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/mail/password-create.html.twig b/main/app/sprinkles/admin/templates/mail/password-create.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/confirm-clear-cache.html.twig b/main/app/sprinkles/admin/templates/modals/confirm-clear-cache.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/confirm-delete-group.html.twig b/main/app/sprinkles/admin/templates/modals/confirm-delete-group.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/confirm-delete-role.html.twig b/main/app/sprinkles/admin/templates/modals/confirm-delete-role.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/confirm-delete-user.html.twig b/main/app/sprinkles/admin/templates/modals/confirm-delete-user.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/group.html.twig b/main/app/sprinkles/admin/templates/modals/group.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/role-manage-permissions.html.twig b/main/app/sprinkles/admin/templates/modals/role-manage-permissions.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/role.html.twig b/main/app/sprinkles/admin/templates/modals/role.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/user-manage-roles.html.twig b/main/app/sprinkles/admin/templates/modals/user-manage-roles.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/user-set-password.html.twig b/main/app/sprinkles/admin/templates/modals/user-set-password.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/modals/user.html.twig b/main/app/sprinkles/admin/templates/modals/user.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/navigation/navbar.html.twig b/main/app/sprinkles/admin/templates/navigation/navbar.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/navigation/sidebar-menu.html.twig b/main/app/sprinkles/admin/templates/navigation/sidebar-menu.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/navigation/sidebar-user.html.twig b/main/app/sprinkles/admin/templates/navigation/sidebar-user.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/navigation/sidebar.html.twig b/main/app/sprinkles/admin/templates/navigation/sidebar.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/navigation/user-card.html.twig b/main/app/sprinkles/admin/templates/navigation/user-card.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/abstract/dashboard.html.twig b/main/app/sprinkles/admin/templates/pages/abstract/dashboard.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/activities.html.twig b/main/app/sprinkles/admin/templates/pages/activities.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/dashboard.html.twig b/main/app/sprinkles/admin/templates/pages/dashboard.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/group.html.twig b/main/app/sprinkles/admin/templates/pages/group.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/groups.html.twig b/main/app/sprinkles/admin/templates/pages/groups.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/permission.html.twig b/main/app/sprinkles/admin/templates/pages/permission.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/permissions.html.twig b/main/app/sprinkles/admin/templates/pages/permissions.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/role.html.twig b/main/app/sprinkles/admin/templates/pages/role.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/roles.html.twig b/main/app/sprinkles/admin/templates/pages/roles.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/user.html.twig b/main/app/sprinkles/admin/templates/pages/user.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/pages/users.html.twig b/main/app/sprinkles/admin/templates/pages/users.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/tables/activities.html.twig b/main/app/sprinkles/admin/templates/tables/activities.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/tables/groups.html.twig b/main/app/sprinkles/admin/templates/tables/groups.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/tables/permissions.html.twig b/main/app/sprinkles/admin/templates/tables/permissions.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/tables/roles.html.twig b/main/app/sprinkles/admin/templates/tables/roles.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/templates/tables/users.html.twig b/main/app/sprinkles/admin/templates/tables/users.html.twig old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/admin/tests/Integration/SprunjeTests.php b/main/app/sprinkles/admin/tests/Integration/SprunjeTests.php old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/core/asset-bundles.json b/main/app/sprinkles/core/asset-bundles.json old mode 100755 new mode 100644 diff --git a/main/app/sprinkles/core/assets/SiteAssets/css/main.css b/main/app/sprinkles/core/assets/SiteAssets/css/main.css index 68bb4a3..c44727b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/css/main.css +++ b/main/app/sprinkles/core/assets/SiteAssets/css/main.css @@ -1,250 +1,250 @@ -/****** -GENERAL -******/ -* { - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-overflow-scrolling: touch; - - outline: none; - ie-dummy: expression(this.hideFocus=true); -} - -::-webkit-scrollbar { - width: 0; - background: transparent; -} - -body { - font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; - height: 100%; - width: 100%; - overflow: hidden; - background-color: #0c1d34; - color: #426A91; - margin: 0; - padding: 0; - border: 0; -} - -.main { - height: 100%; -} - -a { - text-decoration: none; - color: #4a93c0; -} - -hr { - width: 100%; - display: block; - height: 1px; - border: 0; - border-top: 1px solid #112a42; - margin: 1em 0; - padding: 0; -} - -/******* -FLICKITY -*******/ -.main-carousel { - background: #EEE; -} - -.carousel-cell { - width: 100%; - height: calc(100vh - 75px); - height: -moz-calc(100vh - 75px); - height: -webkit-calc(100vh - 75px); - height: -o-calc(100vh - 75px); - height: calc(100vh - 75px); - background: #0c1d34; - counter-increment: carousel-cell; -} - -/****** -HEADER -******/ -.header { - display: flex; - flex-wrap: nowrap; - justify-content: space-between; - align-content: center; - margin: 20px; -} - -.LeftButtonHeader { - width: 20px; - height: 20px; - -webkit-filter: invert(.5); - -moz-filter: invert(.5); -} - -.HeaderCaption { - color: lightgrey; -} - -.RightButtonHeader { - width: 20px; - height: 20px; - -webkit-filter: invert(.5); - -moz-filter: invert(.5); -} - -/*********** -GENERAL TABS -***********/ -.MainInTab { - height: 100%; -} - -/********** -CHAT WINDOW -**********/ -.ChatWindow { - position: relative; - height: 100%; - margin: 5px; -} - -.ChatMessages { - overflow-y: scroll; - max-height: calc(100% - 135px); /* navbar + input + some margin*/ - max-height: -moz-calc(100% - 135px); - max-height: -webkit-calc(100% - 135px); - max-height: -o-calc(100% - 135px); - height: 100%; - width: 100%; -} - -.ChatMessage { - display: block; - position: relative; - min-width: 50px; - max-width: 50%; - width: auto; - height: auto; - word-wrap: break-word; - text-align: center; - padding: 10px; -} - -.ServerChatMessage { - display: inline-block; - position: relative; - left: 50%; - transform: translateX(-50%); - text-align: center; - padding: 5px; - -webkit-border-radius: 25px; - -moz-border-radius: 25px; - border-radius: 25px; - background: linear-gradient(to right, #ad4eff, #7c41f9); - color: #FFF; - font-size: x-small; -} - -.MessageSent { - float: right; - background-color: #12213b; -} - -.AloneMessage { - -webkit-border-radius: 25px; - -moz-border-radius: 25px; - border-radius: 25px; -} - -.TopMessage { - -webkit-border-radius: 25px 25px 10px 10px; - -moz-border-radius: 25px 25px 10px 10px; - border-radius: 25px 25px 10px 10px; -} - -.MiddleMessage { - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; -} - -.BottomMessage { - -webkit-border-radius: 10px 10px 25px 25px; - -moz-border-radius: 10px 10px 25px 25px; - border-radius: 10px 10px 25px 25px; -} - -.MessageReceived { - float: left; - background-color: #13223c; -} - -.ChatInput { - position: absolute; - margin: auto; - bottom: 90px; /* 75+15 */ - left: 0; - z-index: 600; - width: 100%; - height: 40px; - border: none; - color: #FFF; - background-color: #13223C; -} - -#ChatTextInput { - display: none; -} - -/***** -NAVBAR -*****/ -.Navbar { - display: flex; - flex-wrap: nowrap; - justify-content: center; - align-content: center; - position: absolute; - bottom: 0; - left: 0; - height: 75px; - width: 100%; - background-color: #13223c; -} - -.NavbarIconWrap { - margin: auto; -} - -.NavbarIconWrap img { - height: 30px; - width: 30px; - filter: invert(.5); - -webkit-filter: invert(.5); - -moz-filter: invert(.5); -} - -.NavbarLine { - position: absolute; - bottom: 73px; - left: 0; - width: 20% !important; - height: 2px; - background: #eb12b5; -} - -.ActiveTab { - -webkit-transition: -moz-transform .3s ease-out; - -moz-transition: -webkit-transform .3s ease-out; - - filter: invert(19%) sepia(93%) saturate(4612%) hue-rotate(303deg) brightness(98%) contrast(101%); - -webkit-filter: invert(19%) sepia(93%) saturate(4612%) hue-rotate(303deg) brightness(98%) contrast(101%); - -moz-filter: invert(19%) sepia(93%) saturate(4612%) hue-rotate(303deg) brightness(98%) contrast(101%); -} +/****** +GENERAL +******/ +* { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-overflow-scrolling: touch; + + outline: none; + ie-dummy: expression(this.hideFocus=true); +} + +::-webkit-scrollbar { + width: 0; + background: transparent; +} + +body { + font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; + height: 100%; + width: 100%; + overflow: hidden; + background-color: #0c1d34; + color: #426A91; + margin: 0; + padding: 0; + border: 0; +} + +.main { + height: 100%; +} + +a { + text-decoration: none; + color: #4a93c0; +} + +hr { + width: 100%; + display: block; + height: 1px; + border: 0; + border-top: 1px solid #112a42; + margin: 1em 0; + padding: 0; +} + +/******* +FLICKITY +*******/ +.main-carousel { + background: #EEE; +} + +.carousel-cell { + width: 100%; + height: calc(100vh - 75px); + height: -moz-calc(100vh - 75px); + height: -webkit-calc(100vh - 75px); + height: -o-calc(100vh - 75px); + height: calc(100vh - 75px); + background: #0c1d34; + counter-increment: carousel-cell; +} + +/****** +HEADER +******/ +.header { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + align-content: center; + margin: 20px; +} + +.LeftButtonHeader { + width: 20px; + height: 20px; + -webkit-filter: invert(.5); + -moz-filter: invert(.5); +} + +.HeaderCaption { + color: lightgrey; +} + +.RightButtonHeader { + width: 20px; + height: 20px; + -webkit-filter: invert(.5); + -moz-filter: invert(.5); +} + +/*********** +GENERAL TABS +***********/ +.MainInTab { + height: 100%; +} + +/********** +CHAT WINDOW +**********/ +.ChatWindow { + position: relative; + height: 100%; + margin: 5px; +} + +.ChatMessages { + overflow-y: scroll; + max-height: calc(100% - 135px); /* navbar + input + some margin*/ + max-height: -moz-calc(100% - 135px); + max-height: -webkit-calc(100% - 135px); + max-height: -o-calc(100% - 135px); + height: 100%; + width: 100%; +} + +.ChatMessage { + display: block; + position: relative; + min-width: 50px; + max-width: 50%; + width: auto; + height: auto; + word-wrap: break-word; + text-align: center; + padding: 10px; +} + +.ServerChatMessage { + display: inline-block; + position: relative; + left: 50%; + transform: translateX(-50%); + text-align: center; + padding: 5px; + -webkit-border-radius: 25px; + -moz-border-radius: 25px; + border-radius: 25px; + background: linear-gradient(to right, #ad4eff, #7c41f9); + color: #FFF; + font-size: x-small; +} + +.MessageSent { + float: right; + background-color: #12213b; +} + +.AloneMessage { + -webkit-border-radius: 25px; + -moz-border-radius: 25px; + border-radius: 25px; +} + +.TopMessage { + -webkit-border-radius: 25px 25px 10px 10px; + -moz-border-radius: 25px 25px 10px 10px; + border-radius: 25px 25px 10px 10px; +} + +.MiddleMessage { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; +} + +.BottomMessage { + -webkit-border-radius: 10px 10px 25px 25px; + -moz-border-radius: 10px 10px 25px 25px; + border-radius: 10px 10px 25px 25px; +} + +.MessageReceived { + float: left; + background-color: #13223c; +} + +.ChatInput { + position: absolute; + margin: auto; + bottom: 90px; /* 75+15 */ + left: 0; + z-index: 600; + width: 100%; + height: 40px; + border: none; + color: #FFF; + background-color: #13223C; +} + +#ChatTextInput { + display: none; +} + +/***** +NAVBAR +*****/ +.Navbar { + display: flex; + flex-wrap: nowrap; + justify-content: center; + align-content: center; + position: absolute; + bottom: 0; + left: 0; + height: 75px; + width: 100%; + background-color: #13223c; +} + +.NavbarIconWrap { + margin: auto; +} + +.NavbarIconWrap img { + height: 30px; + width: 30px; + filter: invert(.5); + -webkit-filter: invert(.5); + -moz-filter: invert(.5); +} + +.NavbarLine { + position: absolute; + bottom: 73px; + left: 0; + width: 20% !important; + height: 2px; + background: #eb12b5; +} + +.ActiveTab { + -webkit-transition: -moz-transform .3s ease-out; + -moz-transition: -webkit-transform .3s ease-out; + + filter: invert(19%) sepia(93%) saturate(4612%) hue-rotate(303deg) brightness(98%) contrast(101%); + -webkit-filter: invert(19%) sepia(93%) saturate(4612%) hue-rotate(303deg) brightness(98%) contrast(101%); + -moz-filter: invert(19%) sepia(93%) saturate(4612%) hue-rotate(303deg) brightness(98%) contrast(101%); +} diff --git a/main/app/sprinkles/core/assets/SiteAssets/css/slick.css b/main/app/sprinkles/core/assets/SiteAssets/css/slick.css index f2465cb..4169151 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/css/slick.css +++ b/main/app/sprinkles/core/assets/SiteAssets/css/slick.css @@ -1,2 +1,2 @@ -.slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.slick-list:focus{outline:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slick-track{position:relative;top:0;left:0;display:block;margin-left:auto;margin-right:auto}.slick-track:after,.slick-track:before{display:table;content:''}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{display:none;float:left;height:100%;min-height:1px}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none} +.slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.slick-list:focus{outline:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slick-track{position:relative;top:0;left:0;display:block;margin-left:auto;margin-right:auto}.slick-track:after,.slick-track:before{display:table;content:''}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{display:none;float:left;height:100%;min-height:1px}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none} /*# sourceMappingURL=slick.min.css.map */ \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/SiteAssets/icons/BurgerMenuShort.svg b/main/app/sprinkles/core/assets/SiteAssets/icons/BurgerMenuShort.svg index 1bf78bd..e8e825e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/icons/BurgerMenuShort.svg +++ b/main/app/sprinkles/core/assets/SiteAssets/icons/BurgerMenuShort.svg @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/icons/ExploreGlobeOutline.svg b/main/app/sprinkles/core/assets/SiteAssets/icons/ExploreGlobeOutline.svg index 6778254..3bd2b1c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/icons/ExploreGlobeOutline.svg +++ b/main/app/sprinkles/core/assets/SiteAssets/icons/ExploreGlobeOutline.svg @@ -1,210 +1,210 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/icons/FriendFeedOutline.svg b/main/app/sprinkles/core/assets/SiteAssets/icons/FriendFeedOutline.svg index 4243deb..1facc93 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/icons/FriendFeedOutline.svg +++ b/main/app/sprinkles/core/assets/SiteAssets/icons/FriendFeedOutline.svg @@ -1,82 +1,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/icons/MessageBubbleOutline.svg b/main/app/sprinkles/core/assets/SiteAssets/icons/MessageBubbleOutline.svg index 81ea5cc..14322ff 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/icons/MessageBubbleOutline.svg +++ b/main/app/sprinkles/core/assets/SiteAssets/icons/MessageBubbleOutline.svg @@ -1,73 +1,73 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/icons/UserGroupOutline.svg b/main/app/sprinkles/core/assets/SiteAssets/icons/UserGroupOutline.svg index ca8c11c..0a8c0f4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/icons/UserGroupOutline.svg +++ b/main/app/sprinkles/core/assets/SiteAssets/icons/UserGroupOutline.svg @@ -1,80 +1,80 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/icons/UserOutline.svg b/main/app/sprinkles/core/assets/SiteAssets/icons/UserOutline.svg index 6051129..32062dc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/icons/UserOutline.svg +++ b/main/app/sprinkles/core/assets/SiteAssets/icons/UserOutline.svg @@ -1,54 +1,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/encryption.js b/main/app/sprinkles/core/assets/SiteAssets/js/encryption.js index 7826bbb..3a1a485 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/js/encryption.js +++ b/main/app/sprinkles/core/assets/SiteAssets/js/encryption.js @@ -1,3407 +1,3407 @@ -// Copyright (c) 2005 Tom Wu -// All Rights Reserved. -// See "LICENSE" for details. -// Basic JavaScript BN library - subset useful for RSA encryption. - -// Bits per digit -var dbits; - -// JavaScript engine analysis -var canary = 0xdeadbeefcafe; -var j_lm = ((canary & 0xffffff) == 0xefcafe); - -// (public) Constructor - -function BigInteger(a, b, c) { - if (a != null) if ("number" === typeof a) this.fromNumber(a, b, c); - else if (b == null && "string" !== typeof a) this.fromString(a, 256); - else this.fromString(a, b); -} - -// return new, unset BigInteger - -function nbi() { - return new BigInteger(null); -} - -// am: Compute w_j += (x*this_i), propagate carries, -// c is initial carry, returns final carry. -// c < 3*dvalue, x < 2*dvalue, this_i < dvalue -// We need to select the fastest one that works in this environment. -// am1: use a single mult and divide to get the high bits, -// max digit bits should be 26 because -// max internal value = 2*dvalue^2-2*dvalue (< 2^53) - -function am1(i, x, w, j, c, n) { - while (--n >= 0) { - var v = x * this[i++] + w[j] + c; - c = Math.floor(v / 0x4000000); - w[j++] = v & 0x3ffffff; - } - return c; -} - -// am2 avoids a big mult-and-extract completely. -// Max digit bits should be <= 30 because we do bitwise ops -// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) - -function am2(i, x, w, j, c, n) { - var xl = x & 0x7fff, - xh = x >> 15; - while (--n >= 0) { - var l = this[i] & 0x7fff; - var h = this[i++] >> 15; - var m = xh * l + h * xl; - l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff); - c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30); - w[j++] = l & 0x3fffffff; - } - return c; -} - -// Alternately, set max digit bits to 28 since some -// browsers slow down when dealing with 32-bit numbers. - -function am3(i, x, w, j, c, n) { - var xl = x & 0x3fff, - xh = x >> 14; - while (--n >= 0) { - var l = this[i] & 0x3fff; - var h = this[i++] >> 14; - var m = xh * l + h * xl; - l = xl * l + ((m & 0x3fff) << 14) + w[j] + c; - c = (l >> 28) + (m >> 14) + xh * h; - w[j++] = l & 0xfffffff; - } - return c; -} - -if (j_lm && (navigator.appName == "Microsoft Internet Explorer")) { - BigInteger.prototype.am = am2; - dbits = 30; -} -else if (j_lm && (navigator.appName != "Netscape")) { - BigInteger.prototype.am = am1; - dbits = 26; -} -else { // Mozilla/Netscape seems to prefer am3 - BigInteger.prototype.am = am3; - dbits = 28; -} - -BigInteger.prototype.DB = dbits; -BigInteger.prototype.DM = ((1 << dbits) - 1); -BigInteger.prototype.DV = (1 << dbits); - -var BI_FP = 52; -BigInteger.prototype.FV = Math.pow(2, BI_FP); -BigInteger.prototype.F1 = BI_FP - dbits; -BigInteger.prototype.F2 = 2 * dbits - BI_FP; - -// Digit conversions -var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; -var BI_RC = new Array(); -var rr, vv; -rr = "0".charCodeAt(0); -for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; -rr = "a".charCodeAt(0); -for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; -rr = "A".charCodeAt(0); -for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; - -function int2char(n) { - return BI_RM.charAt(n); -} - -function intAt(s, i) { - var c = BI_RC[s.charCodeAt(i)]; - return (c == null) ? -1 : c; -} - -// (protected) copy this to r - -function bnpCopyTo(r) { - for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]; - r.t = this.t; - r.s = this.s; -} - -// (protected) set from integer value x, -DV <= x < DV - -function bnpFromInt(x) { - this.t = 1; - this.s = (x < 0) ? -1 : 0; - if (x > 0) this[0] = x; - else if (x < -1) this[0] = x + DV; - else this.t = 0; -} - -// return bigint initialized to value - -function nbv(i) { - var r = nbi(); - r.fromInt(i); - return r; -} - -// (protected) set from string and radix - -function bnpFromString(s, b) { - var k; - if (b == 16) k = 4; - else if (b == 8) k = 3; - else if (b == 256) k = 8; // byte array - else if (b == 2) k = 1; - else if (b == 32) k = 5; - else if (b == 4) k = 2; - else { - this.fromRadix(s, b); - return; - } - this.t = 0; - this.s = 0; - var i = s.length, - mi = false, - sh = 0; - while (--i >= 0) { - var x = (k == 8) ? s[i] & 0xff : intAt(s, i); - if (x < 0) { - if (s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if (sh == 0) this[this.t++] = x; - else if (sh + k > this.DB) { - this[this.t - 1] |= (x & ((1 << (this.DB - sh)) - 1)) << sh; - this[this.t++] = (x >> (this.DB - sh)); - } - else this[this.t - 1] |= x << sh; - sh += k; - if (sh >= this.DB) sh -= this.DB; - } - if (k == 8 && (s[0] & 0x80) != 0) { - this.s = -1; - if (sh > 0) this[this.t - 1] |= ((1 << (this.DB - sh)) - 1) << sh; - } - this.clamp(); - if (mi) BigInteger.ZERO.subTo(this, this); -} - -// (protected) clamp off excess high words - -function bnpClamp() { - var c = this.s & this.DM; - while (this.t > 0 && this[this.t - 1] == c) --this.t; -} - -// (public) return string representation in given radix - -function bnToString(b) { - if (this.s < 0) return "-" + this.negate().toString(b); - var k; - if (b == 16) k = 4; - else if (b == 8) k = 3; - else if (b == 2) k = 1; - else if (b == 32) k = 5; - else if (b == 64) k = 6; - else if (b == 4) k = 2; - else return this.toRadix(b); - var km = (1 << k) - 1, - d, m = false, - r = "", - i = this.t; - var p = this.DB - (i * this.DB) % k; - if (i-- > 0) { - if (p < this.DB && (d = this[i] >> p) > 0) { - m = true; - r = int2char(d); - } - while (i >= 0) { - if (p < k) { - d = (this[i] & ((1 << p) - 1)) << (k - p); - d |= this[--i] >> (p += this.DB - k); - } - else { - d = (this[i] >> (p -= k)) & km; - if (p <= 0) { - p += this.DB; - --i; - } - } - if (d > 0) m = true; - if (m) r += int2char(d); - } - } - return m ? r : "0"; -} - -// (public) -this - -function bnNegate() { - var r = nbi(); - BigInteger.ZERO.subTo(this, r); - return r; -} - -// (public) |this| - -function bnAbs() { - return (this.s < 0) ? this.negate() : this; -} - -// (public) return + if this > a, - if this < a, 0 if equal - -function bnCompareTo(a) { - var r = this.s - a.s; - if (r != 0) return r; - var i = this.t; - r = i - a.t; - if (r != 0) return r; - while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r; - return 0; -} - -// returns bit length of the integer x - -function nbits(x) { - var r = 1, - t; - if ((t = x >>> 16) != 0) { - x = t; - r += 16; - } - if ((t = x >> 8) != 0) { - x = t; - r += 8; - } - if ((t = x >> 4) != 0) { - x = t; - r += 4; - } - if ((t = x >> 2) != 0) { - x = t; - r += 2; - } - if ((t = x >> 1) != 0) { - x = t; - r += 1; - } - return r; -} - -// (public) return the number of bits in "this" - -function bnBitLength() { - if (this.t <= 0) return 0; - return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM)); -} - -// (protected) r = this << n*DB - -function bnpDLShiftTo(n, r) { - var i; - for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]; - for (i = n - 1; i >= 0; --i) r[i] = 0; - r.t = this.t + n; - r.s = this.s; -} - -// (protected) r = this >> n*DB - -function bnpDRShiftTo(n, r) { - for (var i = n; i < this.t; ++i) r[i - n] = this[i]; - r.t = Math.max(this.t - n, 0); - r.s = this.s; -} - -// (protected) r = this << n - -function bnpLShiftTo(n, r) { - var bs = n % this.DB; - var cbs = this.DB - bs; - var bm = (1 << cbs) - 1; - var ds = Math.floor(n / this.DB), - c = (this.s << bs) & this.DM, - i; - for (i = this.t - 1; i >= 0; --i) { - r[i + ds + 1] = (this[i] >> cbs) | c; - c = (this[i] & bm) << bs; - } - for (i = ds - 1; i >= 0; --i) r[i] = 0; - r[ds] = c; - r.t = this.t + ds + 1; - r.s = this.s; - r.clamp(); -} - -// (protected) r = this >> n - -function bnpRShiftTo(n, r) { - r.s = this.s; - var ds = Math.floor(n / this.DB); - if (ds >= this.t) { - r.t = 0; - return; - } - var bs = n % this.DB; - var cbs = this.DB - bs; - var bm = (1 << bs) - 1; - r[0] = this[ds] >> bs; - for (var i = ds + 1; i < this.t; ++i) { - r[i - ds - 1] |= (this[i] & bm) << cbs; - r[i - ds] = this[i] >> bs; - } - if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs; - r.t = this.t - ds; - r.clamp(); -} - -// (protected) r = this - a - -function bnpSubTo(a, r) { - var i = 0, - c = 0, - m = Math.min(a.t, this.t); - while (i < m) { - c += this[i] - a[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - if (a.t < this.t) { - c -= a.s; - while (i < this.t) { - c += this[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c += this.s; - } - else { - c += this.s; - while (i < a.t) { - c -= a[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = (c < 0) ? -1 : 0; - if (c < -1) r[i++] = this.DV + c; - else if (c > 0) r[i++] = c; - r.t = i; - r.clamp(); -} - -// (protected) r = this * a, r != this,a (HAC 14.12) -// "this" should be the larger one if appropriate. - -function bnpMultiplyTo(a, r) { - var x = this.abs(), - y = a.abs(); - var i = x.t; - r.t = i + y.t; - while (--i >= 0) r[i] = 0; - for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t); - r.s = 0; - r.clamp(); - if (this.s != a.s) BigInteger.ZERO.subTo(r, r); -} - -// (protected) r = this^2, r != this (HAC 14.16) - -function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2 * x.t; - while (--i >= 0) r[i] = 0; - for (i = 0; i < x.t - 1; ++i) { - var c = x.am(i, x[i], r, 2 * i, 0, 1); - if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) { - r[i + x.t] -= x.DV; - r[i + x.t + 1] = 1; - } - } - if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1); - r.s = 0; - r.clamp(); -} - -// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) -// r != q, this != m. q or r may be null. - -function bnpDivRemTo(m, q, r) { - var pm = m.abs(); - if (pm.t <= 0) return; - var pt = this.abs(); - if (pt.t < pm.t) { - if (q != null) q.fromInt(0); - if (r != null) this.copyTo(r); - return; - } - if (r == null) r = nbi(); - var y = nbi(), - ts = this.s, - ms = m.s; - var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus - if (nsh > 0) { - pm.lShiftTo(nsh, y); - pt.lShiftTo(nsh, r); - } - else { - pm.copyTo(y); - pt.copyTo(r); - } - var ys = y.t; - var y0 = y[ys - 1]; - if (y0 == 0) return; - var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0); - var d1 = this.FV / yt, - d2 = (1 << this.F1) / yt, - e = 1 << this.F2; - var i = r.t, - j = i - ys, - t = (q == null) ? nbi() : q; - y.dlShiftTo(j, t); - if (r.compareTo(t) >= 0) { - r[r.t++] = 1; - r.subTo(t, r); - } - BigInteger.ONE.dlShiftTo(ys, t); - t.subTo(y, y); // "negative" y so we can replace sub with am later - while (y.t < ys) y[y.t++] = 0; - while (--j >= 0) { - // Estimate quotient digit - var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2); - if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out - y.dlShiftTo(j, t); - r.subTo(t, r); - while (r[i] < --qd) r.subTo(t, r); - } - } - if (q != null) { - r.drShiftTo(ys, q); - if (ts != ms) BigInteger.ZERO.subTo(q, q); - } - r.t = ys; - r.clamp(); - if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder - if (ts < 0) BigInteger.ZERO.subTo(r, r); -} - -// (public) this mod a - -function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a, null, r); - if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r); - return r; -} - -// Modular reduction using "classic" algorithm - -function Classic(m) { - this.m = m; -} - -function cConvert(x) { - if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; -} - -function cRevert(x) { - return x; -} - -function cReduce(x) { - x.divRemTo(this.m, null, x); -} - -function cMulTo(x, y, r) { - x.multiplyTo(y, r); - this.reduce(r); -} - -function cSqrTo(x, r) { - x.squareTo(r); - this.reduce(r); -} - -Classic.prototype.convert = cConvert; -Classic.prototype.revert = cRevert; -Classic.prototype.reduce = cReduce; -Classic.prototype.mulTo = cMulTo; -Classic.prototype.sqrTo = cSqrTo; - -// (protected) return "-1/this % 2^DB"; useful for Mont. reduction -// justification: -// xy == 1 (mod m) -// xy = 1+km -// xy(2-xy) = (1+km)(1-km) -// x[y(2-xy)] = 1-k^2m^2 -// x[y(2-xy)] == 1 (mod m^2) -// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 -// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. -// JS multiply "overflows" differently from C/C++, so care is needed here. - -function bnpInvDigit() { - if (this.t < 1) return 0; - var x = this[0]; - if ((x & 1) == 0) return 0; - var y = x & 3; // y == 1/x mod 2^2 - y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4 - y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8 - y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return (y > 0) ? this.DV - y : -y; -} - -// Montgomery reduction - -function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp & 0x7fff; - this.mph = this.mp >> 15; - this.um = (1 << (m.DB - 15)) - 1; - this.mt2 = 2 * m.t; -} - -// xR mod m - -function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t, r); - r.divRemTo(this.m, null, r); - if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r); - return r; -} - -// x/R mod m - -function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; -} - -// x = x/R mod m (HAC 14.32) - -function montReduce(x) { - while (x.t <= this.mt2) // pad x so am has enough room later - x[x.t++] = 0; - for (var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x[i]*mp mod DV - var j = x[i] & 0x7fff; - var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM; - // use am to combine the multiply-shift-add into one call - j = i + this.m.t; - x[j] += this.m.am(0, u0, x, i, 0, this.m.t); - // propagate carry - while (x[j] >= x.DV) { - x[j] -= x.DV; - x[++j]++; - } - } - x.clamp(); - x.drShiftTo(this.m.t, x); - if (x.compareTo(this.m) >= 0) x.subTo(this.m, x); -} - -// r = "x^2/R mod m"; x != r - -function montSqrTo(x, r) { - x.squareTo(r); - this.reduce(r); -} - -// r = "xy/R mod m"; x,y != r - -function montMulTo(x, y, r) { - x.multiplyTo(y, r); - this.reduce(r); -} - -Montgomery.prototype.convert = montConvert; -Montgomery.prototype.revert = montRevert; -Montgomery.prototype.reduce = montReduce; -Montgomery.prototype.mulTo = montMulTo; -Montgomery.prototype.sqrTo = montSqrTo; - -// (protected) true iff this is even - -function bnpIsEven() { - return ((this.t > 0) ? (this[0] & 1) : this.s) == 0; -} - -// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) - -function bnpExp(e, z) { - if (e > 0xffffffff || e < 1) return BigInteger.ONE; - var r = nbi(), - r2 = nbi(), - g = z.convert(this), - i = nbits(e) - 1; - g.copyTo(r); - while (--i >= 0) { - z.sqrTo(r, r2); - if ((e & (1 << i)) > 0) z.mulTo(r2, g, r); - else { - var t = r; - r = r2; - r2 = t; - } - } - return z.revert(r); -} - -// (public) this^e % m, 0 <= e < 2^32 - -function bnModPowInt(e, m) { - var z; - if (e < 256 || m.isEven()) z = new Classic(m); - else z = new Montgomery(m); - return this.exp(e, z); -} - -// protected -BigInteger.prototype.copyTo = bnpCopyTo; -BigInteger.prototype.fromInt = bnpFromInt; -BigInteger.prototype.fromString = bnpFromString; -BigInteger.prototype.clamp = bnpClamp; -BigInteger.prototype.dlShiftTo = bnpDLShiftTo; -BigInteger.prototype.drShiftTo = bnpDRShiftTo; -BigInteger.prototype.lShiftTo = bnpLShiftTo; -BigInteger.prototype.rShiftTo = bnpRShiftTo; -BigInteger.prototype.subTo = bnpSubTo; -BigInteger.prototype.multiplyTo = bnpMultiplyTo; -BigInteger.prototype.squareTo = bnpSquareTo; -BigInteger.prototype.divRemTo = bnpDivRemTo; -BigInteger.prototype.invDigit = bnpInvDigit; -BigInteger.prototype.isEven = bnpIsEven; -BigInteger.prototype.exp = bnpExp; - -// public -BigInteger.prototype.toString = bnToString; -BigInteger.prototype.negate = bnNegate; -BigInteger.prototype.abs = bnAbs; -BigInteger.prototype.compareTo = bnCompareTo; -BigInteger.prototype.bitLength = bnBitLength; -BigInteger.prototype.mod = bnMod; -BigInteger.prototype.modPowInt = bnModPowInt; - -// "constants" -BigInteger.ZERO = nbv(0); -BigInteger.ONE = nbv(1); - - -function bnClone() { - var r = nbi(); - this.copyTo(r); - return r; -} - -// (public) return value as integer - -function bnIntValue() { - if (this.s < 0) { - if (this.t == 1) return this[0] - this.DV; - else if (this.t == 0) return -1; - } - else if (this.t == 1) return this[0]; - else if (this.t == 0) return 0; - // assumes 16 < DB < 32 - return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]; -} - -// (public) return value as byte - -function bnByteValue() { - return (this.t == 0) ? this.s : (this[0] << 24) >> 24; -} - -// (public) return value as short (assumes DB>=16) - -function bnShortValue() { - return (this.t == 0) ? this.s : (this[0] << 16) >> 16; -} - -// (protected) return x s.t. r^x < DV - -function bnpChunkSize(r) { - return Math.floor(Math.LN2 * this.DB / Math.log(r)); -} - -// (public) 0 if this == 0, 1 if this > 0 - -function bnSigNum() { - if (this.s < 0) return -1; - else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; - else return 1; -} - -// (protected) convert to radix string - -function bnpToRadix(b) { - if (b == null) b = 10; - if (this.signum() == 0 || b < 2 || b > 36) return "0"; - var cs = this.chunkSize(b); - var a = Math.pow(b, cs); - var d = nbv(a), - y = nbi(), - z = nbi(), - r = ""; - this.divRemTo(d, y, z); - while (y.signum() > 0) { - r = (a + z.intValue()).toString(b).substr(1) + r; - y.divRemTo(d, y, z); - } - return z.intValue().toString(b) + r; -} - -// (protected) convert from radix string - -function bnpFromRadix(s, b) { - this.fromInt(0); - if (b == null) b = 10; - var cs = this.chunkSize(b); - var d = Math.pow(b, cs), - mi = false, - j = 0, - w = 0; - for (var i = 0; i < s.length; ++i) { - var x = intAt(s, i); - if (x < 0) { - if (s.charAt(i) == "-" && this.signum() == 0) mi = true; - continue; - } - w = b * w + x; - if (++j >= cs) { - this.dMultiply(d); - this.dAddOffset(w, 0); - j = 0; - w = 0; - } - } - if (j > 0) { - this.dMultiply(Math.pow(b, j)); - this.dAddOffset(w, 0); - } - if (mi) BigInteger.ZERO.subTo(this, this); -} - -// (protected) alternate constructor - -function bnpFromNumber(a, b, c) { - if ("number" == typeof b) { - // new BigInteger(int,int,RNG) - if (a < 2) this.fromInt(1); - else { - this.fromNumber(a, c); - if (!this.testBit(a - 1)) // force MSB set - this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this); - if (this.isEven()) this.dAddOffset(1, 0); // force odd - while (!this.isProbablePrime(b)) { - this.dAddOffset(2, 0); - if (this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a - 1), this); - } - } - } - else { - // new BigInteger(int,RNG) - var x = new Array(), - t = a & 7; - x.length = (a >> 3) + 1; - b.nextBytes(x); - if (t > 0) x[0] &= ((1 << t) - 1); - else x[0] = 0; - this.fromString(x, 256); - } -} - -// (public) convert to bigendian byte array - -function bnToByteArray() { - var i = this.t, - r = new Array(); - r[0] = this.s; - var p = this.DB - (i * this.DB) % 8, - d, k = 0; - if (i-- > 0) { - if (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p) r[k++] = d | (this.s << (this.DB - p)); - while (i >= 0) { - if (p < 8) { - d = (this[i] & ((1 << p) - 1)) << (8 - p); - d |= this[--i] >> (p += this.DB - 8); - } - else { - d = (this[i] >> (p -= 8)) & 0xff; - if (p <= 0) { - p += this.DB; - --i; - } - } - if ((d & 0x80) != 0) d |= -256; - if (k == 0 && (this.s & 0x80) != (d & 0x80)) ++k; - if (k > 0 || d != this.s) r[k++] = d; - } - } - return r; -} - -function bnEquals(a) { - return (this.compareTo(a) == 0); -} - -function bnMin(a) { - return (this.compareTo(a) < 0) ? this : a; -} - -function bnMax(a) { - return (this.compareTo(a) > 0) ? this : a; -} - -// (protected) r = this op a (bitwise) - -function bnpBitwiseTo(a, op, r) { - var i, f, m = Math.min(a.t, this.t); - for (i = 0; i < m; ++i) r[i] = op(this[i], a[i]); - if (a.t < this.t) { - f = a.s & this.DM; - for (i = m; i < this.t; ++i) r[i] = op(this[i], f); - r.t = this.t; - } - else { - f = this.s & this.DM; - for (i = m; i < a.t; ++i) r[i] = op(f, a[i]); - r.t = a.t; - } - r.s = op(this.s, a.s); - r.clamp(); -} - -// (public) this & a - -function op_and(x, y) { - return x & y; -} - -function bnAnd(a) { - var r = nbi(); - this.bitwiseTo(a, op_and, r); - return r; -} - -// (public) this | a - -function op_or(x, y) { - return x | y; -} - -function bnOr(a) { - var r = nbi(); - this.bitwiseTo(a, op_or, r); - return r; -} - -// (public) this ^ a - -function op_xor(x, y) { - return x ^ y; -} - -function bnXor(a) { - var r = nbi(); - this.bitwiseTo(a, op_xor, r); - return r; -} - -// (public) this & ~a - -function op_andnot(x, y) { - return x & ~y; -} - -function bnAndNot(a) { - var r = nbi(); - this.bitwiseTo(a, op_andnot, r); - return r; -} - -// (public) ~this - -function bnNot() { - var r = nbi(); - for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]; - r.t = this.t; - r.s = ~this.s; - return r; -} - -// (public) this << n - -function bnShiftLeft(n) { - var r = nbi(); - if (n < 0) this.rShiftTo(-n, r); - else this.lShiftTo(n, r); - return r; -} - -// (public) this >> n - -function bnShiftRight(n) { - var r = nbi(); - if (n < 0) this.lShiftTo(-n, r); - else this.rShiftTo(n, r); - return r; -} - -// return index of lowest 1-bit in x, x < 2^31 - -function lbit(x) { - if (x == 0) return -1; - var r = 0; - if ((x & 0xffff) == 0) { - x >>= 16; - r += 16; - } - if ((x & 0xff) == 0) { - x >>= 8; - r += 8; - } - if ((x & 0xf) == 0) { - x >>= 4; - r += 4; - } - if ((x & 3) == 0) { - x >>= 2; - r += 2; - } - if ((x & 1) == 0) ++r; - return r; -} - -// (public) returns index of lowest 1-bit (or -1 if none) - -function bnGetLowestSetBit() { - for (var i = 0; i < this.t; ++i) - if (this[i] != 0) return i * this.DB + lbit(this[i]); - if (this.s < 0) return this.t * this.DB; - return -1; -} - -// return number of 1 bits in x - -function cbit(x) { - var r = 0; - while (x != 0) { - x &= x - 1; - ++r; - } - return r; -} - -// (public) return number of set bits - -function bnBitCount() { - var r = 0, - x = this.s & this.DM; - for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x); - return r; -} - -// (public) true iff nth bit is set - -function bnTestBit(n) { - var j = Math.floor(n / this.DB); - if (j >= this.t) return (this.s != 0); - return ((this[j] & (1 << (n % this.DB))) != 0); -} - -// (protected) this op (1<>= this.DB; - } - if (a.t < this.t) { - c += a.s; - while (i < this.t) { - c += this[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c += this.s; - } - else { - c += this.s; - while (i < a.t) { - c += a[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c += a.s; - } - r.s = (c < 0) ? -1 : 0; - if (c > 0) r[i++] = c; - else if (c < -1) r[i++] = this.DV + c; - r.t = i; - r.clamp(); -} - -// (public) this + a - -function bnAdd(a) { - var r = nbi(); - this.addTo(a, r); - return r; -} - -// (public) this - a - -function bnSubtract(a) { - var r = nbi(); - this.subTo(a, r); - return r; -} - -// (public) this * a - -function bnMultiply(a) { - var r = nbi(); - this.multiplyTo(a, r); - return r; -} - -// (public) this^2 - -function bnSquare() { - var r = nbi(); - this.squareTo(r); - return r; -} - -// (public) this / a - -function bnDivide(a) { - var r = nbi(); - this.divRemTo(a, r, null); - return r; -} - -// (public) this % a - -function bnRemainder(a) { - var r = nbi(); - this.divRemTo(a, null, r); - return r; -} - -// (public) [this/a,this%a] - -function bnDivideAndRemainder(a) { - var q = nbi(), - r = nbi(); - this.divRemTo(a, q, r); - return new Array(q, r); -} - -// (protected) this *= n, this >= 0, 1 < n < DV - -function bnpDMultiply(n) { - this[this.t] = this.am(0, n - 1, this, 0, 0, this.t); - ++this.t; - this.clamp(); -} - -// (protected) this += n << w words, this >= 0 - -function bnpDAddOffset(n, w) { - if (n == 0) return; - while (this.t <= w) this[this.t++] = 0; - this[w] += n; - while (this[w] >= this.DV) { - this[w] -= this.DV; - if (++w >= this.t) this[this.t++] = 0; - ++this[w]; - } -} - -// A "null" reducer - -function NullExp() { -} - -function nNop(x) { - return x; -} - -function nMulTo(x, y, r) { - x.multiplyTo(y, r); -} - -function nSqrTo(x, r) { - x.squareTo(r); -} - -NullExp.prototype.convert = nNop; -NullExp.prototype.revert = nNop; -NullExp.prototype.mulTo = nMulTo; -NullExp.prototype.sqrTo = nSqrTo; - -// (public) this^e - -function bnPow(e) { - return this.exp(e, new NullExp()); -} - -// (protected) r = lower n words of "this * a", a.t <= n -// "this" should be the larger one if appropriate. - -function bnpMultiplyLowerTo(a, n, r) { - var i = Math.min(this.t + a.t, n); - r.s = 0; // assumes a,this >= 0 - r.t = i; - while (i > 0) r[--i] = 0; - var j; - for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t); - for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i); - r.clamp(); -} - -// (protected) r = "this * a" without lower n words, n > 0 -// "this" should be the larger one if appropriate. - -function bnpMultiplyUpperTo(a, n, r) { - --n; - var i = r.t = this.t + a.t - n; - r.s = 0; // assumes a,this >= 0 - while (--i >= 0) r[i] = 0; - for (i = Math.max(n - this.t, 0); i < a.t; ++i) - r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n); - r.clamp(); - r.drShiftTo(1, r); -} - -// Barrett modular reduction - -function Barrett(m) { - // setup Barrett - this.r2 = nbi(); - this.q3 = nbi(); - BigInteger.ONE.dlShiftTo(2 * m.t, this.r2); - this.mu = this.r2.divide(m); - this.m = m; -} - -function barrettConvert(x) { - if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m); - else if (x.compareTo(this.m) < 0) return x; - else { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; - } -} - -function barrettRevert(x) { - return x; -} - -// x = x mod m (HAC 14.42) - -function barrettReduce(x) { - x.drShiftTo(this.m.t - 1, this.r2); - if (x.t > this.m.t + 1) { - x.t = this.m.t + 1; - x.clamp(); - } - this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3); - this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); - while (x.compareTo(this.r2) < 0) x.dAddOffset(1, this.m.t + 1); - x.subTo(this.r2, x); - while (x.compareTo(this.m) >= 0) x.subTo(this.m, x); -} - -// r = x^2 mod m; x != r - -function barrettSqrTo(x, r) { - x.squareTo(r); - this.reduce(r); -} - -// r = x*y mod m; x,y != r - -function barrettMulTo(x, y, r) { - x.multiplyTo(y, r); - this.reduce(r); -} - -Barrett.prototype.convert = barrettConvert; -Barrett.prototype.revert = barrettRevert; -Barrett.prototype.reduce = barrettReduce; -Barrett.prototype.mulTo = barrettMulTo; -Barrett.prototype.sqrTo = barrettSqrTo; - -// (public) this^e % m (HAC 14.85) - -function bnModPow(e, m) { - var i = e.bitLength(), - k, r = nbv(1), - z; - if (i <= 0) return r; - else if (i < 18) k = 1; - else if (i < 48) k = 3; - else if (i < 144) k = 4; - else if (i < 768) k = 5; - else k = 6; - if (i < 8) z = new Classic(m); - else if (m.isEven()) z = new Barrett(m); - else z = new Montgomery(m); - - // precomputation - var g = new Array(), - n = 3, - k1 = k - 1, - km = (1 << k) - 1; - g[1] = z.convert(this); - if (k > 1) { - var g2 = nbi(); - z.sqrTo(g[1], g2); - while (n <= km) { - g[n] = nbi(); - z.mulTo(g2, g[n - 2], g[n]); - n += 2; - } - } - - var j = e.t - 1, - w, is1 = true, - r2 = nbi(), - t; - i = nbits(e[j]) - 1; - while (j >= 0) { - if (i >= k1) w = (e[j] >> (i - k1)) & km; - else { - w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i); - if (j > 0) w |= e[j - 1] >> (this.DB + i - k1); - } - - n = k; - while ((w & 1) == 0) { - w >>= 1; - --n; - } - if ((i -= n) < 0) { - i += this.DB; - --j; - } - if (is1) { // ret == 1, don't bother squaring or multiplying it - g[w].copyTo(r); - is1 = false; - } - else { - while (n > 1) { - z.sqrTo(r, r2); - z.sqrTo(r2, r); - n -= 2; - } - if (n > 0) z.sqrTo(r, r2); - else { - t = r; - r = r2; - r2 = t; - } - z.mulTo(r2, g[w], r); - } - - while (j >= 0 && (e[j] & (1 << i)) == 0) { - z.sqrTo(r, r2); - t = r; - r = r2; - r2 = t; - if (--i < 0) { - i = this.DB - 1; - --j; - } - } - } - return z.revert(r); -} - -// (public) gcd(this,a) (HAC 14.54) - -function bnGCD(a) { - var x = (this.s < 0) ? this.negate() : this.clone(); - var y = (a.s < 0) ? a.negate() : a.clone(); - if (x.compareTo(y) < 0) { - var t = x; - x = y; - y = t; - } - var i = x.getLowestSetBit(), - g = y.getLowestSetBit(); - if (g < 0) return x; - if (i < g) g = i; - if (g > 0) { - x.rShiftTo(g, x); - y.rShiftTo(g, y); - } - while (x.signum() > 0) { - if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x); - if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y); - if (x.compareTo(y) >= 0) { - x.subTo(y, x); - x.rShiftTo(1, x); - } - else { - y.subTo(x, y); - y.rShiftTo(1, y); - } - } - if (g > 0) y.lShiftTo(g, y); - return y; -} - -// (protected) this % n, n < 2^26 - -function bnpModInt(n) { - if (n <= 0) return 0; - var d = this.DV % n, - r = (this.s < 0) ? n - 1 : 0; - if (this.t > 0) if (d == 0) r = this[0] % n; - else for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n; - return r; -} - -// (public) 1/this % m (HAC 14.61) - -function bnModInverse(m) { - var ac = m.isEven(); - if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; - var u = m.clone(), - v = this.clone(); - var a = nbv(1), - b = nbv(0), - c = nbv(0), - d = nbv(1); - while (u.signum() != 0) { - while (u.isEven()) { - u.rShiftTo(1, u); - if (ac) { - if (!a.isEven() || !b.isEven()) { - a.addTo(this, a); - b.subTo(m, b); - } - a.rShiftTo(1, a); - } - else if (!b.isEven()) b.subTo(m, b); - b.rShiftTo(1, b); - } - while (v.isEven()) { - v.rShiftTo(1, v); - if (ac) { - if (!c.isEven() || !d.isEven()) { - c.addTo(this, c); - d.subTo(m, d); - } - c.rShiftTo(1, c); - } - else if (!d.isEven()) d.subTo(m, d); - d.rShiftTo(1, d); - } - if (u.compareTo(v) >= 0) { - u.subTo(v, u); - if (ac) a.subTo(c, a); - b.subTo(d, b); - } - else { - v.subTo(u, v); - if (ac) c.subTo(a, c); - d.subTo(b, d); - } - } - if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; - if (d.compareTo(m) >= 0) return d.subtract(m); - if (d.signum() < 0) d.addTo(m, d); - else return d; - if (d.signum() < 0) return d.add(m); - else return d; -} - -var lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]; -var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; - -// (public) test primality with certainty >= 1-.5^t - -function bnIsProbablePrime(t) { - var i, x = this.abs(); - if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) { - for (i = 0; i < lowprimes.length; ++i) - if (x[0] == lowprimes[i]) return true; - return false; - } - if (x.isEven()) return false; - i = 1; - while (i < lowprimes.length) { - var m = lowprimes[i], - j = i + 1; - while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]; - m = x.modInt(m); - while (i < j) if (m % lowprimes[i++] == 0) return false; - } - return x.millerRabin(t); -} - -// (protected) true if probably prime (HAC 4.24, Miller-Rabin) - -function bnpMillerRabin(t) { - var n1 = this.subtract(BigInteger.ONE); - var k = n1.getLowestSetBit(); - if (k <= 0) return false; - var r = n1.shiftRight(k); - t = (t + 1) >> 1; - if (t > lowprimes.length) t = lowprimes.length; - var a = nbi(); - for (var i = 0; i < t; ++i) { - //Pick bases at random, instead of starting at 2 - a.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]); - var y = a.modPow(r, this); - if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { - var j = 1; - while (j++ < k && y.compareTo(n1) != 0) { - y = y.modPowInt(2, this); - if (y.compareTo(BigInteger.ONE) == 0) return false; - } - if (y.compareTo(n1) != 0) return false; - } - } - return true; -} - -// protected -BigInteger.prototype.chunkSize = bnpChunkSize; -BigInteger.prototype.toRadix = bnpToRadix; -BigInteger.prototype.fromRadix = bnpFromRadix; -BigInteger.prototype.fromNumber = bnpFromNumber; -BigInteger.prototype.bitwiseTo = bnpBitwiseTo; -BigInteger.prototype.changeBit = bnpChangeBit; -BigInteger.prototype.addTo = bnpAddTo; -BigInteger.prototype.dMultiply = bnpDMultiply; -BigInteger.prototype.dAddOffset = bnpDAddOffset; -BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; -BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; -BigInteger.prototype.modInt = bnpModInt; -BigInteger.prototype.millerRabin = bnpMillerRabin; - -// public -BigInteger.prototype.clone = bnClone; -BigInteger.prototype.intValue = bnIntValue; -BigInteger.prototype.byteValue = bnByteValue; -BigInteger.prototype.shortValue = bnShortValue; -BigInteger.prototype.signum = bnSigNum; -BigInteger.prototype.toByteArray = bnToByteArray; -BigInteger.prototype.equals = bnEquals; -BigInteger.prototype.min = bnMin; -BigInteger.prototype.max = bnMax; -BigInteger.prototype.and = bnAnd; -BigInteger.prototype.or = bnOr; -BigInteger.prototype.xor = bnXor; -BigInteger.prototype.andNot = bnAndNot; -BigInteger.prototype.not = bnNot; -BigInteger.prototype.shiftLeft = bnShiftLeft; -BigInteger.prototype.shiftRight = bnShiftRight; -BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; -BigInteger.prototype.bitCount = bnBitCount; -BigInteger.prototype.testBit = bnTestBit; -BigInteger.prototype.setBit = bnSetBit; -BigInteger.prototype.clearBit = bnClearBit; -BigInteger.prototype.flipBit = bnFlipBit; -BigInteger.prototype.add = bnAdd; -BigInteger.prototype.subtract = bnSubtract; -BigInteger.prototype.multiply = bnMultiply; -BigInteger.prototype.divide = bnDivide; -BigInteger.prototype.remainder = bnRemainder; -BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; -BigInteger.prototype.modPow = bnModPow; -BigInteger.prototype.modInverse = bnModInverse; -BigInteger.prototype.pow = bnPow; -BigInteger.prototype.gcd = bnGCD; -BigInteger.prototype.isProbablePrime = bnIsProbablePrime; - -// JSBN-specific extension -BigInteger.prototype.square = bnSquare; - -// seedrandom.js version 2.0. -// Author: David Bau 4/2/2011 -// -// Defines a method Math.seedrandom() that, when called, substitutes -// an explicitly seeded RC4-based algorithm for Math.random(). Also -// supports automatic seeding from local or network sources of entropy. -// -// Usage: -// -// -// -// Math.seedrandom('yipee'); Sets Math.random to a function that is -// initialized using the given explicit seed. -// -// Math.seedrandom(); Sets Math.random to a function that is -// seeded using the current time, dom state, -// and other accumulated local entropy. -// The generated seed string is returned. -// -// Math.seedrandom('yowza', true); -// Seeds using the given explicit seed mixed -// together with accumulated entropy. -// -// -// Seeds using physical random bits downloaded -// from random.org. -// -// Seeds using urandom bits from call.jsonlib.com, -// which is faster than random.org. -// -// Examples: -// -// Math.seedrandom("hello"); // Use "hello" as the seed. -// document.write(Math.random()); // Always 0.5463663768140734 -// document.write(Math.random()); // Always 0.43973793770592234 -// var rng1 = Math.random; // Remember the current prng. -// -// var autoseed = Math.seedrandom(); // New prng with an automatic seed. -// document.write(Math.random()); // Pretty much unpredictable. -// -// Math.random = rng1; // Continue "hello" prng sequence. -// document.write(Math.random()); // Always 0.554769432473455 -// -// Math.seedrandom(autoseed); // Restart at the previous seed. -// document.write(Math.random()); // Repeat the 'unpredictable' value. -// -// Notes: -// -// Each time seedrandom('arg') is called, entropy from the passed seed -// is accumulated in a pool to help generate future seeds for the -// zero-argument form of Math.seedrandom, so entropy can be injected over -// time by calling seedrandom with explicit data repeatedly. -// -// On speed - This javascript implementation of Math.random() is about -// 3-10x slower than the built-in Math.random() because it is not native -// code, but this is typically fast enough anyway. Seeding is more expensive, -// especially if you use auto-seeding. Some details (timings on Chrome 4): -// -// Our Math.random() - avg less than 0.002 milliseconds per call -// seedrandom('explicit') - avg less than 0.5 milliseconds per call -// seedrandom('explicit', true) - avg less than 2 milliseconds per call -// seedrandom() - avg about 38 milliseconds per call -// -// LICENSE (BSD): -// -// Copyright 2010 David Bau, all rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of this module nor the names of its contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/** - * All code is in an anonymous closure to keep the global namespace clean. - * - * @param {number=} overflow - * @param {number=} startdenom - */ -(function (pool, math, width, chunks, significance, overflow, startdenom) { - - - // - // seedrandom() - // This is the seedrandom function described above. - // - math['seedrandom'] = function seedrandom(seed, use_entropy) { - var key = []; - var arc4; - - // Flatten the seed string or build one from local entropy if needed. - seed = mixkey(flatten( - use_entropy ? [seed, pool] : arguments.length ? seed : [new Date().getTime(), pool, window], 3), key); - - // Use the seed to initialize an ARC4 generator. - arc4 = new ARC4(key); - - // Mix the randomness into accumulated entropy. - mixkey(arc4.S, pool); - - // Override Math.random - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - math['random'] = function random() { // Closure to return a random double: - var n = arc4.g(chunks); // Start with a numerator n < 2 ^ 48 - var d = startdenom; // and denominator d = 2 ^ 48. - var x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. - } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. - } - return (n + x) / d; // Form the number within [0, 1). - }; - - // Return the seed that was used - return seed; - }; - - // - // ARC4 - // - // An ARC4 implementation. The constructor takes a key in the form of - // an array of at most (width) integers that should be 0 <= x < (width). - // - // The g(count) method returns a pseudorandom integer that concatenates - // the next (count) outputs from ARC4. Its return value is a number x - // that is in the range 0 <= x < (width ^ count). - // - /** @constructor */ - - function ARC4(key) { - var t, u, me = this, - keylen = key.length; - var i = 0, - j = me.i = me.j = me.m = 0; - me.S = []; - me.c = []; - - // The empty key [] is treated as [0]. - if (!keylen) { - key = [keylen++]; - } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { - me.S[i] = i++; - } - for (i = 0; i < width; i++) { - t = me.S[i]; - j = lowbits(j + t + key[i % keylen]); - u = me.S[j]; - me.S[i] = u; - me.S[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - me.g = function getnext(count) { - var s = me.S; - var i = lowbits(me.i + 1); - var t = s[i]; - var j = lowbits(me.j + t); - var u = s[j]; - s[i] = u; - s[j] = t; - var r = s[lowbits(t + u)]; - while (--count) { - i = lowbits(i + 1); - t = s[i]; - j = lowbits(j + t); - u = s[j]; - s[i] = u; - s[j] = t; - r = r * width + s[lowbits(t + u)]; - } - me.i = i; - me.j = j; - return r; - }; - // For robust unpredictability discard an initial batch of values. - // See http://www.rsa.com/rsalabs/node.asp?id=2009 - me.g(width); - } - - // - // flatten() - // Converts an object tree to nested arrays of strings. - // - /** @param {Object=} result - * @param {string=} prop - * @param {string=} typ */ - - function flatten(obj, depth, result, prop, typ) { - result = []; - typ = typeof (obj); - if (depth && typ == 'object') { - for (prop in obj) { - if (prop.indexOf('S') < 5) { // Avoid FF3 bug (local/sessionStorage) - try { - result.push(flatten(obj[prop], depth - 1)); - } - catch (e) { - } - } - } - } - return (result.length ? result : obj + (typ != 'string' ? '\0' : '')); - } - - // - // mixkey() - // Mixes a string seed into a key that is an array of integers, and - // returns a shortened string seed that is equivalent to the result key. - // - /** @param {number=} smear - * @param {number=} j */ - - function mixkey(seed, key, smear, j) { - seed += ''; // Ensure the seed is a string - smear = 0; - for (j = 0; j < seed.length; j++) { - key[lowbits(j)] = lowbits((smear ^= key[lowbits(j)] * 19) + seed.charCodeAt(j)); - } - seed = ''; - for (j in key) { - seed += String.fromCharCode(key[j]); - } - return seed; - } - - // - // lowbits() - // A quick "n mod width" for width a power of 2. - // - - - function lowbits(n) { - return n & (width - 1); - } - - // - // The following constants are related to IEEE 754 limits. - // - startdenom = math.pow(width, chunks); - significance = math.pow(2, significance); - overflow = significance * 2; - - // - // When seedrandom.js is loaded, we immediately mix a few bits - // from the built-in RNG into the entropy pool. Because we do - // not want to intefere with determinstic PRNG state later, - // seedrandom will not call math.random on its own again after - // initialization. - // - mixkey(math.random(), pool); - - // End anonymous scope, and pass initial values. -})([], // pool: entropy pool starts empty - Math, // math: package containing random, pow, and seedrandom - 256, // width: each RC4 output is 0 <= x < 256 - 6, // chunks: at least six RC4 outputs for each double - 52 // significance: there are 52 significant digits in a double -); - - -// This is not really a random number generator object, and two SeededRandom -// objects will conflict with one another, but it's good enough for generating -// the rsa key. -function SeededRandom() { -} - -function SRnextBytes(ba) { - var i; - for (i = 0; i < ba.length; i++) { - ba[i] = Math.floor(Math.random() * 256); - } -} - -SeededRandom.prototype.nextBytes = SRnextBytes; - -// prng4.js - uses Arcfour as a PRNG - -function Arcfour() { - this.i = 0; - this.j = 0; - this.S = new Array(); -} - -// Initialize arcfour context from key, an array of ints, each from [0..255] -function ARC4init(key) { - var i, j, t; - for (i = 0; i < 256; ++i) - this.S[i] = i; - j = 0; - for (i = 0; i < 256; ++i) { - j = (j + this.S[i] + key[i % key.length]) & 255; - t = this.S[i]; - this.S[i] = this.S[j]; - this.S[j] = t; - } - this.i = 0; - this.j = 0; -} - -function ARC4next() { - var t; - this.i = (this.i + 1) & 255; - this.j = (this.j + this.S[this.i]) & 255; - t = this.S[this.i]; - this.S[this.i] = this.S[this.j]; - this.S[this.j] = t; - return this.S[(t + this.S[this.i]) & 255]; -} - -Arcfour.prototype.init = ARC4init; -Arcfour.prototype.next = ARC4next; - -// Plug in your RNG constructor here -function prng_newstate() { - return new Arcfour(); -} - -// Pool size must be a multiple of 4 and greater than 32. -// An array of bytes the size of the pool will be passed to init() -var rng_psize = 256; - -// Random number generator - requires a PRNG backend, e.g. prng4.js - -// For best results, put code like -// -// in your main HTML document. - -var rng_state; -var rng_pool; -var rng_pptr; - -// Mix in a 32-bit integer into the pool -function rng_seed_int(x) { - rng_pool[rng_pptr++] ^= x & 255; - rng_pool[rng_pptr++] ^= (x >> 8) & 255; - rng_pool[rng_pptr++] ^= (x >> 16) & 255; - rng_pool[rng_pptr++] ^= (x >> 24) & 255; - if (rng_pptr >= rng_psize) rng_pptr -= rng_psize; -} - -// Mix in the current time (w/milliseconds) into the pool -function rng_seed_time() { - rng_seed_int(new Date().getTime()); -} - -// Initialize the pool with junk if needed. -if (rng_pool == null) { - rng_pool = new Array(); - rng_pptr = 0; - var t; - if (navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) { - // Extract entropy (256 bits) from NS4 RNG if available - var z = window.crypto.random(32); - for (t = 0; t < z.length; ++t) - rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; - } - while (rng_pptr < rng_psize) { // extract some randomness from Math.random() - t = Math.floor(65536 * Math.random()); - rng_pool[rng_pptr++] = t >>> 8; - rng_pool[rng_pptr++] = t & 255; - } - rng_pptr = 0; - rng_seed_time(); - //rng_seed_int(window.screenX); - //rng_seed_int(window.screenY); -} - -function rng_get_byte() { - if (rng_state == null) { - rng_seed_time(); - rng_state = prng_newstate(); - rng_state.init(rng_pool); - for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) - rng_pool[rng_pptr] = 0; - rng_pptr = 0; - //rng_pool = null; - } - // TODO: allow reseeding after first request - return rng_state.next(); -} - -function rng_get_bytes(ba) { - var i; - for (i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); -} - -function SecureRandom() { -} - -SecureRandom.prototype.nextBytes = rng_get_bytes; - - -/** - * - * Secure Hash Algorithm (SHA256) - * http://www.webtoolkit.info/ - * - * Original code by Angel Marin, Paul Johnston. - * - **/ - -function SHA256(s) { - - var chrsz = 8; - var hexcase = 0; - - function safe_add(x, y) { - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); - } - - function S(X, n) { - return (X >>> n) | (X << (32 - n)); - } - - function R(X, n) { - return (X >>> n); - } - - function Ch(x, y, z) { - return ((x & y) ^ ((~x) & z)); - } - - function Maj(x, y, z) { - return ((x & y) ^ (x & z) ^ (y & z)); - } - - function Sigma0256(x) { - return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); - } - - function Sigma1256(x) { - return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); - } - - function Gamma0256(x) { - return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); - } - - function Gamma1256(x) { - return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); - } - - function core_sha256(m, l) { - var K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2); - var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); - var W = new Array(64); - var a, b, c, d, e, f, g, h, i, j; - var T1, T2; - - m[l >> 5] |= 0x80 << (24 - l % 32); - m[((l + 64 >> 9) << 4) + 15] = l; - - for (var i = 0; i < m.length; i += 16) { - a = HASH[0]; - b = HASH[1]; - c = HASH[2]; - d = HASH[3]; - e = HASH[4]; - f = HASH[5]; - g = HASH[6]; - h = HASH[7]; - - for (var j = 0; j < 64; j++) { - if (j < 16) W[j] = m[j + i]; - else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); - - T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); - T2 = safe_add(Sigma0256(a), Maj(a, b, c)); - - h = g; - g = f; - f = e; - e = safe_add(d, T1); - d = c; - c = b; - b = a; - a = safe_add(T1, T2); - } - - HASH[0] = safe_add(a, HASH[0]); - HASH[1] = safe_add(b, HASH[1]); - HASH[2] = safe_add(c, HASH[2]); - HASH[3] = safe_add(d, HASH[3]); - HASH[4] = safe_add(e, HASH[4]); - HASH[5] = safe_add(f, HASH[5]); - HASH[6] = safe_add(g, HASH[6]); - HASH[7] = safe_add(h, HASH[7]); - } - return HASH; - } - - function str2binb(str) { - var bin = Array(); - var mask = (1 << chrsz) - 1; - for (var i = 0; i < str.length * chrsz; i += chrsz) { - bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32); - } - return bin; - } - - function Utf8Encode(string) { - string = string.replace(/\r\n/g, "\n"); - var utftext = ""; - - for (var n = 0; n < string.length; n++) { - - var c = string.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } - else if ((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } - else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } - - } - - return utftext; - } - - function binb2hex(binarray) { - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; - var str = ""; - for (var i = 0; i < binarray.length * 4; i++) { - str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + - hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF); - } - return str; - } - - s = Utf8Encode(s); - return binb2hex(core_sha256(str2binb(s), s.length * chrsz)); -} - -var sha256 = {} -sha256.hex = function (s) { - return SHA256(s); -} - -/** - * - * Secure Hash Algorithm (SHA1) - * http://www.webtoolkit.info/ - * - **/ - -function SHA1(msg) { - - function rotate_left(n, s) { - var t4 = (n << s) | (n >>> (32 - s)); - return t4; - }; - - function lsb_hex(val) { - var str = ""; - var i; - var vh; - var vl; - - for (i = 0; i <= 6; i += 2) { - vh = (val >>> (i * 4 + 4)) & 0x0f; - vl = (val >>> (i * 4)) & 0x0f; - str += vh.toString(16) + vl.toString(16); - } - return str; - }; - - function cvt_hex(val) { - var str = ""; - var i; - var v; - - for (i = 7; i >= 0; i--) { - v = (val >>> (i * 4)) & 0x0f; - str += v.toString(16); - } - return str; - }; - - - function Utf8Encode(string) { - string = string.replace(/\r\n/g, "\n"); - var utftext = ""; - - for (var n = 0; n < string.length; n++) { - - var c = string.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } - else if ((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } - else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } - - } - - return utftext; - }; - - var blockstart; - var i, j; - var W = new Array(80); - var H0 = 0x67452301; - var H1 = 0xEFCDAB89; - var H2 = 0x98BADCFE; - var H3 = 0x10325476; - var H4 = 0xC3D2E1F0; - var A, B, C, D, E; - var temp; - - msg = Utf8Encode(msg); - - var msg_len = msg.length; - - var word_array = new Array(); - for (i = 0; i < msg_len - 3; i += 4) { - j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 | - msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3); - word_array.push(j); - } - - switch (msg_len % 4) { - case 0: - i = 0x080000000; - break; - case 1: - i = msg.charCodeAt(msg_len - 1) << 24 | 0x0800000; - break; - - case 2: - i = msg.charCodeAt(msg_len - 2) << 24 | msg.charCodeAt(msg_len - 1) << 16 | 0x08000; - break; - - case 3: - i = msg.charCodeAt(msg_len - 3) << 24 | msg.charCodeAt(msg_len - 2) << 16 | msg.charCodeAt(msg_len - 1) << 8 | 0x80; - break; - } - - word_array.push(i); - - while ((word_array.length % 16) != 14) word_array.push(0); - - word_array.push(msg_len >>> 29); - word_array.push((msg_len << 3) & 0x0ffffffff); - - - for (blockstart = 0; blockstart < word_array.length; blockstart += 16) { - - for (i = 0; i < 16; i++) W[i] = word_array[blockstart + i]; - for (i = 16; i <= 79; i++) W[i] = rotate_left(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); - - A = H0; - B = H1; - C = H2; - D = H3; - E = H4; - - for (i = 0; i <= 19; i++) { - temp = (rotate_left(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff; - E = D; - D = C; - C = rotate_left(B, 30); - B = A; - A = temp; - } - - for (i = 20; i <= 39; i++) { - temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff; - E = D; - D = C; - C = rotate_left(B, 30); - B = A; - A = temp; - } - - for (i = 40; i <= 59; i++) { - temp = (rotate_left(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff; - E = D; - D = C; - C = rotate_left(B, 30); - B = A; - A = temp; - } - - for (i = 60; i <= 79; i++) { - temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff; - E = D; - D = C; - C = rotate_left(B, 30); - B = A; - A = temp; - } - - H0 = (H0 + A) & 0x0ffffffff; - H1 = (H1 + B) & 0x0ffffffff; - H2 = (H2 + C) & 0x0ffffffff; - H3 = (H3 + D) & 0x0ffffffff; - H4 = (H4 + E) & 0x0ffffffff; - - } - - var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4); - - return temp.toLowerCase(); - -} - -var sha1 = {} -sha1.hex = function (s) { - return SHA1(s); -} - -/** - * - * MD5 (Message-Digest Algorithm) - * http://www.webtoolkit.info/ - * - **/ - -var MD5 = function (string) { - - function RotateLeft(lValue, iShiftBits) { - return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); - } - - function AddUnsigned(lX, lY) { - var lX4, lY4, lX8, lY8, lResult; - lX8 = (lX & 0x80000000); - lY8 = (lY & 0x80000000); - lX4 = (lX & 0x40000000); - lY4 = (lY & 0x40000000); - lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); - if (lX4 & lY4) { - return (lResult ^ 0x80000000 ^ lX8 ^ lY8); - } - if (lX4 | lY4) { - if (lResult & 0x40000000) { - return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); - } else { - return (lResult ^ 0x40000000 ^ lX8 ^ lY8); - } - } else { - return (lResult ^ lX8 ^ lY8); - } - } - - function F(x, y, z) { - return (x & y) | ((~x) & z); - } - - function G(x, y, z) { - return (x & z) | (y & (~z)); - } - - function H(x, y, z) { - return (x ^ y ^ z); - } - - function I(x, y, z) { - return (y ^ (x | (~z))); - } - - function FF(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - function GG(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - function HH(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - function II(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - function ConvertToWordArray(string) { - var lWordCount; - var lMessageLength = string.length; - var lNumberOfWords_temp1 = lMessageLength + 8; - var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; - var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; - var lWordArray = Array(lNumberOfWords - 1); - var lBytePosition = 0; - var lByteCount = 0; - while (lByteCount < lMessageLength) { - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); - lByteCount++; - } - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); - lWordArray[lNumberOfWords - 2] = lMessageLength << 3; - lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; - return lWordArray; - }; - - function WordToHex(lValue) { - var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount; - for (lCount = 0; lCount <= 3; lCount++) { - lByte = (lValue >>> (lCount * 8)) & 255; - WordToHexValue_temp = "0" + lByte.toString(16); - WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2); - } - return WordToHexValue; - }; - - function Utf8Encode(string) { - string = string.replace(/\r\n/g, "\n"); - var utftext = ""; - - for (var n = 0; n < string.length; n++) { - - var c = string.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } - else if ((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } - else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } - - } - - return utftext; - }; - - var x = Array(); - var k, AA, BB, CC, DD, a, b, c, d; - var S11 = 7, S12 = 12, S13 = 17, S14 = 22; - var S21 = 5, S22 = 9, S23 = 14, S24 = 20; - var S31 = 4, S32 = 11, S33 = 16, S34 = 23; - var S41 = 6, S42 = 10, S43 = 15, S44 = 21; - - string = Utf8Encode(string); - - x = ConvertToWordArray(string); - - a = 0x67452301; - b = 0xEFCDAB89; - c = 0x98BADCFE; - d = 0x10325476; - - for (k = 0; k < x.length; k += 16) { - AA = a; - BB = b; - CC = c; - DD = d; - a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); - d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); - c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); - b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); - a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); - d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); - c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); - b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); - a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); - d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); - c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); - b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); - a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); - d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); - c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); - b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); - a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); - d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); - c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); - b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); - a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); - d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); - c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); - b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); - a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); - d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); - c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); - b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); - a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); - d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); - c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); - b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); - a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); - d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); - c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); - b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); - a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); - d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); - c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); - b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); - a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); - d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); - c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); - b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); - a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); - d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); - c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); - b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); - a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); - d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); - c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); - b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); - a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); - d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); - c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); - b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); - a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); - d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); - c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); - b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); - a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); - d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); - c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); - b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); - a = AddUnsigned(a, AA); - b = AddUnsigned(b, BB); - c = AddUnsigned(c, CC); - d = AddUnsigned(d, DD); - } - - var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); - - return temp.toLowerCase(); -} - -// Depends on jsbn.js and rng.js -// Version 1.1: support utf-8 encoding in pkcs1pad2 -// convert a (hex) string to a bignum object - - -function parseBigInt(str, r) { - return new BigInteger(str, r); -} - -function linebrk(s, n) { - var ret = ""; - var i = 0; - while (i + n < s.length) { - ret += s.substring(i, i + n) + "\n"; - i += n; - } - return ret + s.substring(i, s.length); -} - -function byte2Hex(b) { - if (b < 0x10) return "0" + b.toString(16); - else return b.toString(16); -} - -// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint - - -function pkcs1pad2(s, n) { - if (n < s.length + 11) { // TODO: fix for utf-8 - //alert("Message too long for RSA (n=" + n + ", l=" + s.length + ")"); - //return null; - throw "Message too long for RSA (n=" + n + ", l=" + s.length + ")"; - } - var ba = new Array(); - var i = s.length - 1; - while (i >= 0 && n > 0) { - var c = s.charCodeAt(i--); - if (c < 128) { // encode using utf-8 - ba[--n] = c; - } - else if ((c > 127) && (c < 2048)) { - ba[--n] = (c & 63) | 128; - ba[--n] = (c >> 6) | 192; - } - else { - ba[--n] = (c & 63) | 128; - ba[--n] = ((c >> 6) & 63) | 128; - ba[--n] = (c >> 12) | 224; - } - } - ba[--n] = 0; - var rng = new SecureRandom(); - var x = new Array(); - while (n > 2) { // random non-zero pad - x[0] = 0; - while (x[0] == 0) rng.nextBytes(x); - ba[--n] = x[0]; - } - ba[--n] = 2; - ba[--n] = 0; - return new BigInteger(ba); -} - -// "empty" RSA key constructor - - -function RSAKey() { - this.n = null; - this.e = 0; - this.d = null; - this.p = null; - this.q = null; - this.dmp1 = null; - this.dmq1 = null; - this.coeff = null; -} - -// Set the public key fields N and e from hex strings - - -function RSASetPublic(N, E) { - if (N != null && E != null && N.length > 0 && E.length > 0) { - this.n = parseBigInt(N, 16); - this.e = parseInt(E, 16); - } - else alert("Invalid RSA public key"); -} - -// Perform raw public operation on "x": return x^e (mod n) - - -function RSADoPublic(x) { - return x.modPowInt(this.e, this.n); -} - -// Return the PKCS#1 RSA encryption of "text" as an even-length hex string - - -function RSAEncrypt(text) { - var m = pkcs1pad2(text, (this.n.bitLength() + 7) >> 3); - if (m == null) return null; - var c = this.doPublic(m); - if (c == null) return null; - var h = c.toString(16); - if ((h.length & 1) == 0) return h; - else return "0" + h; -} - -// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string -//function RSAEncryptB64(text) { -// var h = this.encrypt(text); -// if(h) return hex2b64(h); else return null; -//} -// protected -RSAKey.prototype.doPublic = RSADoPublic; - -// public -RSAKey.prototype.setPublic = RSASetPublic; -RSAKey.prototype.encrypt = RSAEncrypt; - -// Version 1.1: support utf-8 decoding in pkcs1unpad2 -// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext - -function pkcs1unpad2(d, n) { - var b = d.toByteArray(); - var i = 0; - while (i < b.length && b[i] == 0) ++i; - if (b.length - i != n - 1 || b[i] != 2) return null; - ++i; - while (b[i] != 0) - if (++i >= b.length) return null; - var ret = ""; - while (++i < b.length) { - var c = b[i] & 255; - if (c < 128) { // utf-8 decode - ret += String.fromCharCode(c); - } - else if ((c > 191) && (c < 224)) { - ret += String.fromCharCode(((c & 31) << 6) | (b[i + 1] & 63)); - ++i; - } - else { - ret += String.fromCharCode(((c & 15) << 12) | ((b[i + 1] & 63) << 6) | (b[i + 2] & 63)); - i += 2; - } - } - return ret; -} - -// Set the private key fields N, e, and d from hex strings -function RSASetPrivate(N, E, D) { - if (N != null && E != null && N.length > 0 && E.length > 0) { - this.n = parseBigInt(N, 16); - this.e = parseInt(E, 16); - this.d = parseBigInt(D, 16); - } - else alert("Invalid RSA private key"); -} - -// Set the private key fields N, e, d and CRT params from hex strings -function RSASetPrivateEx(N, E, D, P, Q, DP, DQ, C) { - if (N != null && E != null && N.length > 0 && E.length > 0) { - this.n = parseBigInt(N, 16); - this.e = parseInt(E, 16); - this.d = parseBigInt(D, 16); - this.p = parseBigInt(P, 16); - this.q = parseBigInt(Q, 16); - this.dmp1 = parseBigInt(DP, 16); - this.dmq1 = parseBigInt(DQ, 16); - this.coeff = parseBigInt(C, 16); - } - else alert("Invalid RSA private key"); -} - -// Generate a new random private key B bits long, using public expt E -function RSAGenerate(B, E) { - var rng = new SeededRandom(); - var qs = B >> 1; - this.e = parseInt(E, 16); - var ee = new BigInteger(E, 16); - for (; ;) { - for (; ;) { - this.p = new BigInteger(B - qs, 1, rng); - if (this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break; - } - for (; ;) { - this.q = new BigInteger(qs, 1, rng); - if (this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break; - } - if (this.p.compareTo(this.q) <= 0) { - var t = this.p; - this.p = this.q; - this.q = t; - } - var p1 = this.p.subtract(BigInteger.ONE); - var q1 = this.q.subtract(BigInteger.ONE); - var phi = p1.multiply(q1); - if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0) { - this.n = this.p.multiply(this.q); - this.d = ee.modInverse(phi); - this.dmp1 = this.d.mod(p1); - this.dmq1 = this.d.mod(q1); - this.coeff = this.q.modInverse(this.p); - break; - } - } -} - -// Perform raw private operation on "x": return x^d (mod n) -function RSADoPrivate(x) { - if (this.p == null || this.q == null) return x.modPow(this.d, this.n); - // TODO: re-calculate any missing CRT params - var xp = x.mod(this.p).modPow(this.dmp1, this.p); - var xq = x.mod(this.q).modPow(this.dmq1, this.q); - while (xp.compareTo(xq) < 0) - xp = xp.add(this.p); - return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq); -} - -// Return the PKCS#1 RSA decryption of "ctext". -// "ctext" is an even-length hex string and the output is a plain string. -function RSADecrypt(ctext) { - var c = parseBigInt(ctext, 16); - var m = this.doPrivate(c); - if (m == null) return null; - return pkcs1unpad2(m, (this.n.bitLength() + 7) >> 3); -} - -// protected -RSAKey.prototype.doPrivate = RSADoPrivate; - -// public -RSAKey.prototype.setPrivate = RSASetPrivate; -RSAKey.prototype.setPrivateEx = RSASetPrivateEx; -RSAKey.prototype.generate = RSAGenerate; -RSAKey.prototype.decrypt = RSADecrypt; - - -// -// rsa-sign.js - adding signing functions to RSAKey class. -// -// -// version: 1.0 (2010-Jun-03) -// -// Copyright (c) 2010 Kenji Urushima (kenji.urushima@gmail.com) -// -// This software is licensed under the terms of the MIT License. -// http://www.opensource.org/licenses/mit-license.php -// -// The above copyright and license notice shall be -// included in all copies or substantial portions of the Software. -// -// Depends on: -// function sha1.hex(s) of sha1.js -// jsbn.js -// jsbn2.js -// rsa.js -// rsa2.js -// -// keysize / pmstrlen -// 512 / 128 -// 1024 / 256 -// 2048 / 512 -// 4096 / 1024 -// As for _RSASGIN_DIHEAD values for each hash algorithm, see PKCS#1 v2.1 spec (p38). -var _RSASIGN_DIHEAD = []; -_RSASIGN_DIHEAD['sha1'] = "3021300906052b0e03021a05000414"; -_RSASIGN_DIHEAD['sha256'] = "3031300d060960864801650304020105000420"; -//_RSASIGN_DIHEAD['md2'] = "3020300c06082a864886f70d020205000410"; -//_RSASIGN_DIHEAD['md5'] = "3020300c06082a864886f70d020505000410"; -//_RSASIGN_DIHEAD['sha384'] = "3041300d060960864801650304020205000430"; -//_RSASIGN_DIHEAD['sha512'] = "3051300d060960864801650304020305000440"; -var _RSASIGN_HASHHEXFUNC = []; -_RSASIGN_HASHHEXFUNC['sha1'] = sha1.hex; -_RSASIGN_HASHHEXFUNC['sha256'] = sha256.hex; - -// ======================================================================== -// Signature Generation -// ======================================================================== - -function _rsasign_getHexPaddedDigestInfoForString(s, keySize, hashAlg) { - var pmStrLen = keySize / 4; - var hashFunc = _RSASIGN_HASHHEXFUNC[hashAlg]; - var sHashHex = hashFunc(s); - - var sHead = "0001"; - var sTail = "00" + _RSASIGN_DIHEAD[hashAlg] + sHashHex; - var sMid = ""; - var fLen = pmStrLen - sHead.length - sTail.length; - for (var i = 0; i < fLen; i += 2) { - sMid += "ff"; - } - sPaddedMessageHex = sHead + sMid + sTail; - return sPaddedMessageHex; -} - -function _rsasign_signString(s, hashAlg) { - var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), hashAlg); - var biPaddedMessage = parseBigInt(hPM, 16); - var biSign = this.doPrivate(biPaddedMessage); - var hexSign = biSign.toString(16); - return hexSign; -} - -function _rsasign_signStringWithSHA1(s) { - var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), 'sha1'); - var biPaddedMessage = parseBigInt(hPM, 16); - var biSign = this.doPrivate(biPaddedMessage); - var hexSign = biSign.toString(16); - return hexSign; -} - -function _rsasign_signStringWithSHA256(s) { - var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), 'sha256'); - var biPaddedMessage = parseBigInt(hPM, 16); - var biSign = this.doPrivate(biPaddedMessage); - var hexSign = biSign.toString(16); - return hexSign; -} - -// ======================================================================== -// Signature Verification -// ======================================================================== - -function _rsasign_getDecryptSignatureBI(biSig, hN, hE) { - var rsa = new RSAKey(); - rsa.setPublic(hN, hE); - var biDecryptedSig = rsa.doPublic(biSig); - return biDecryptedSig; -} - -function _rsasign_getHexDigestInfoFromSig(biSig, hN, hE) { - var biDecryptedSig = _rsasign_getDecryptSignatureBI(biSig, hN, hE); - var hDigestInfo = biDecryptedSig.toString(16).replace(/^1f+00/, ''); - return hDigestInfo; -} - -function _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo) { - for (var algName in _RSASIGN_DIHEAD) { - var head = _RSASIGN_DIHEAD[algName]; - var len = head.length; - if (hDigestInfo.substring(0, len) == head) { - var a = [algName, hDigestInfo.substring(len)]; - return a; - } - } - return []; -} - -function _rsasign_verifySignatureWithArgs(sMsg, biSig, hN, hE) { - var hDigestInfo = _rsasign_getHexDigestInfoFromSig(biSig, hN, hE); - var digestInfoAry = _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo); - if (digestInfoAry.length == 0) return false; - var algName = digestInfoAry[0]; - var diHashValue = digestInfoAry[1]; - var ff = _RSASIGN_HASHHEXFUNC[algName]; - var msgHashValue = ff(sMsg); - return (diHashValue == msgHashValue); -} - -function _rsasign_verifyHexSignatureForMessage(hSig, sMsg) { - var biSig = parseBigInt(hSig, 16); - var result = _rsasign_verifySignatureWithArgs(sMsg, biSig, this.n.toString(16), this.e.toString(16)); - return result; -} - -function _rsasign_verifyString(sMsg, hSig) { - hSig = hSig.replace(/[ \n]+/g, ""); - var biSig = parseBigInt(hSig, 16); - var biDecryptedSig = this.doPublic(biSig); - var hDigestInfo = biDecryptedSig.toString(16).replace(/^1f+00/, ''); - var digestInfoAry = _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo); - - if (digestInfoAry.length == 0) return false; - var algName = digestInfoAry[0]; - var diHashValue = digestInfoAry[1]; - var ff = _RSASIGN_HASHHEXFUNC[algName]; - var msgHashValue = ff(sMsg); - return (diHashValue == msgHashValue); -} - -RSAKey.prototype.signString = _rsasign_signString; -RSAKey.prototype.signStringWithSHA1 = _rsasign_signStringWithSHA1; -RSAKey.prototype.signStringWithSHA256 = _rsasign_signStringWithSHA256; - -RSAKey.prototype.verifyString = _rsasign_verifyString; -RSAKey.prototype.verifyHexSignatureForMessage = _rsasign_verifyHexSignatureForMessage; - -/* - * jsaes version 0.1 - Copyright 2006 B. Poettering - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - * 02111-1307 USA - */ - -// later modifications by wwwtyro@github - -var aes = (function () { - - var my = {}; - - my.Sbox = new Array(99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22); - - my.ShiftRowTab = new Array(0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11); - - my.Init = function () { - my.Sbox_Inv = new Array(256); - for (var i = 0; i < 256; i++) - my.Sbox_Inv[my.Sbox[i]] = i; - - my.ShiftRowTab_Inv = new Array(16); - for (var i = 0; i < 16; i++) - my.ShiftRowTab_Inv[my.ShiftRowTab[i]] = i; - - my.xtime = new Array(256); - for (var i = 0; i < 128; i++) { - my.xtime[i] = i << 1; - my.xtime[128 + i] = (i << 1) ^ 0x1b; - } - } - - my.Done = function () { - delete my.Sbox_Inv; - delete my.ShiftRowTab_Inv; - delete my.xtime; - } - - my.ExpandKey = function (key) { - var kl = key.length, - ks, Rcon = 1; - switch (kl) { - case 16: - ks = 16 * (10 + 1); - break; - case 24: - ks = 16 * (12 + 1); - break; - case 32: - ks = 16 * (14 + 1); - break; - default: - alert("my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!"); - } - for (var i = kl; i < ks; i += 4) { - var temp = key.slice(i - 4, i); - if (i % kl == 0) { - temp = new Array(my.Sbox[temp[1]] ^ Rcon, my.Sbox[temp[2]], my.Sbox[temp[3]], my.Sbox[temp[0]]); - if ((Rcon <<= 1) >= 256) Rcon ^= 0x11b; - } - else if ((kl > 24) && (i % kl == 16)) temp = new Array(my.Sbox[temp[0]], my.Sbox[temp[1]], my.Sbox[temp[2]], my.Sbox[temp[3]]); - for (var j = 0; j < 4; j++) - key[i + j] = key[i + j - kl] ^ temp[j]; - } - } - - my.Encrypt = function (block, key) { - var l = key.length; - my.AddRoundKey(block, key.slice(0, 16)); - for (var i = 16; i < l - 16; i += 16) { - my.SubBytes(block, my.Sbox); - my.ShiftRows(block, my.ShiftRowTab); - my.MixColumns(block); - my.AddRoundKey(block, key.slice(i, i + 16)); - } - my.SubBytes(block, my.Sbox); - my.ShiftRows(block, my.ShiftRowTab); - my.AddRoundKey(block, key.slice(i, l)); - } - - my.Decrypt = function (block, key) { - var l = key.length; - my.AddRoundKey(block, key.slice(l - 16, l)); - my.ShiftRows(block, my.ShiftRowTab_Inv); - my.SubBytes(block, my.Sbox_Inv); - for (var i = l - 32; i >= 16; i -= 16) { - my.AddRoundKey(block, key.slice(i, i + 16)); - my.MixColumns_Inv(block); - my.ShiftRows(block, my.ShiftRowTab_Inv); - my.SubBytes(block, my.Sbox_Inv); - } - my.AddRoundKey(block, key.slice(0, 16)); - } - - my.SubBytes = function (state, sbox) { - for (var i = 0; i < 16; i++) - state[i] = sbox[state[i]]; - } - - my.AddRoundKey = function (state, rkey) { - for (var i = 0; i < 16; i++) - state[i] ^= rkey[i]; - } - - my.ShiftRows = function (state, shifttab) { - var h = new Array().concat(state); - for (var i = 0; i < 16; i++) - state[i] = h[shifttab[i]]; - } - - my.MixColumns = function (state) { - for (var i = 0; i < 16; i += 4) { - var s0 = state[i + 0], - s1 = state[i + 1]; - var s2 = state[i + 2], - s3 = state[i + 3]; - var h = s0 ^ s1 ^ s2 ^ s3; - state[i + 0] ^= h ^ my.xtime[s0 ^ s1]; - state[i + 1] ^= h ^ my.xtime[s1 ^ s2]; - state[i + 2] ^= h ^ my.xtime[s2 ^ s3]; - state[i + 3] ^= h ^ my.xtime[s3 ^ s0]; - } - } - - my.MixColumns_Inv = function (state) { - for (var i = 0; i < 16; i += 4) { - var s0 = state[i + 0], - s1 = state[i + 1]; - var s2 = state[i + 2], - s3 = state[i + 3]; - var h = s0 ^ s1 ^ s2 ^ s3; - var xh = my.xtime[h]; - var h1 = my.xtime[my.xtime[xh ^ s0 ^ s2]] ^ h; - var h2 = my.xtime[my.xtime[xh ^ s1 ^ s3]] ^ h; - state[i + 0] ^= h1 ^ my.xtime[s0 ^ s1]; - state[i + 1] ^= h2 ^ my.xtime[s1 ^ s2]; - state[i + 2] ^= h1 ^ my.xtime[s2 ^ s3]; - state[i + 3] ^= h2 ^ my.xtime[s3 ^ s0]; - } - } - - return my; - -}()); - - -var cryptico = (function () { - - var my = {}; - - aes.Init(); - - var base64Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - - my.b256to64 = function (t) { - var a, c, n; - var r = '', l = 0, s = 0; - var tl = t.length; - for (n = 0; n < tl; n++) { - c = t.charCodeAt(n); - if (s == 0) { - r += base64Chars.charAt((c >> 2) & 63); - a = (c & 3) << 4; - } - else if (s == 1) { - r += base64Chars.charAt((a | (c >> 4) & 15)); - a = (c & 15) << 2; - } - else if (s == 2) { - r += base64Chars.charAt(a | ((c >> 6) & 3)); - l += 1; - r += base64Chars.charAt(c & 63); - } - l += 1; - s += 1; - if (s == 3) s = 0; - } - if (s > 0) { - r += base64Chars.charAt(a); - l += 1; - r += '='; - l += 1; - } - if (s == 1) { - r += '='; - } - return r; - } - - my.b64to256 = function (t) { - var c, n; - var r = '', s = 0, a = 0; - var tl = t.length; - for (n = 0; n < tl; n++) { - c = base64Chars.indexOf(t.charAt(n)); - if (c >= 0) { - if (s) r += String.fromCharCode(a | (c >> (6 - s)) & 255); - s = (s + 2) & 7; - a = (c << s) & 255; - } - } - return r; - } - - my.b16to64 = function (h) { - var i; - var c; - var ret = ""; - if (h.length % 2 == 1) { - h = "0" + h; - } - for (i = 0; i + 3 <= h.length; i += 3) { - c = parseInt(h.substring(i, i + 3), 16); - ret += base64Chars.charAt(c >> 6) + base64Chars.charAt(c & 63); - } - if (i + 1 == h.length) { - c = parseInt(h.substring(i, i + 1), 16); - ret += base64Chars.charAt(c << 2); - } - else if (i + 2 == h.length) { - c = parseInt(h.substring(i, i + 2), 16); - ret += base64Chars.charAt(c >> 2) + base64Chars.charAt((c & 3) << 4); - } - while ((ret.length & 3) > 0) ret += "="; - return ret; - } - - my.b64to16 = function (s) { - var ret = ""; - var i; - var k = 0; - var slop; - for (i = 0; i < s.length; ++i) { - if (s.charAt(i) == "=") break; - v = base64Chars.indexOf(s.charAt(i)); - if (v < 0) continue; - if (k == 0) { - ret += int2char(v >> 2); - slop = v & 3; - k = 1; - } - else if (k == 1) { - ret += int2char((slop << 2) | (v >> 4)); - slop = v & 0xf; - k = 2; - } - else if (k == 2) { - ret += int2char(slop); - ret += int2char(v >> 2); - slop = v & 3; - k = 3; - } - else { - ret += int2char((slop << 2) | (v >> 4)); - ret += int2char(v & 0xf); - k = 0; - } - } - if (k == 1) ret += int2char(slop << 2); - return ret; - } - - // Converts a string to a byte array. - my.string2bytes = function (string) { - var bytes = new Array(); - for (var i = 0; i < string.length; i++) { - bytes.push(string.charCodeAt(i)); - } - return bytes; - } - - // Converts a byte array to a string. - my.bytes2string = function (bytes) { - var string = ""; - for (var i = 0; i < bytes.length; i++) { - string += String.fromCharCode(bytes[i]); - } - return string; - } - - // Returns a XOR b, where a and b are 16-byte byte arrays. - my.blockXOR = function (a, b) { - var xor = new Array(16); - for (var i = 0; i < 16; i++) { - xor[i] = a[i] ^ b[i]; - } - return xor; - } - - // Returns a 16-byte initialization vector. - my.blockIV = function () { - var r = new SecureRandom(); - var IV = new Array(16); - r.nextBytes(IV); - return IV; - } - - // Returns a copy of bytes with zeros appended to the end - // so that the (length of bytes) % 16 == 0. - my.pad16 = function (bytes) { - var newBytes = bytes.slice(0); - var padding = (16 - (bytes.length % 16)) % 16; - for (i = bytes.length; i < bytes.length + padding; i++) { - newBytes.push(0); - } - return newBytes; - } - - // Removes trailing zeros from a byte array. - my.depad = function (bytes) { - var newBytes = bytes.slice(0); - while (newBytes[newBytes.length - 1] == 0) { - newBytes = newBytes.slice(0, newBytes.length - 1); - } - return newBytes; - } - - // AES CBC Encryption. - my.encryptAESCBC = function (plaintext, key) { - var exkey = key.slice(0); - aes.ExpandKey(exkey); - var blocks = my.string2bytes(plaintext); - blocks = my.pad16(blocks); - var encryptedBlocks = my.blockIV(); - for (var i = 0; i < blocks.length / 16; i++) { - var tempBlock = blocks.slice(i * 16, i * 16 + 16); - var prevBlock = encryptedBlocks.slice((i) * 16, (i) * 16 + 16); - tempBlock = my.blockXOR(prevBlock, tempBlock); - aes.Encrypt(tempBlock, exkey); - encryptedBlocks = encryptedBlocks.concat(tempBlock); - } - var ciphertext = my.bytes2string(encryptedBlocks); - return my.b256to64(ciphertext) - } - - // AES CBC Decryption. - my.decryptAESCBC = function (encryptedText, key) { - var exkey = key.slice(0); - aes.ExpandKey(exkey); - var encryptedText = my.b64to256(encryptedText); - var encryptedBlocks = my.string2bytes(encryptedText); - var decryptedBlocks = new Array(); - for (var i = 1; i < encryptedBlocks.length / 16; i++) { - var tempBlock = encryptedBlocks.slice(i * 16, i * 16 + 16); - var prevBlock = encryptedBlocks.slice((i - 1) * 16, (i - 1) * 16 + 16); - aes.Decrypt(tempBlock, exkey); - tempBlock = my.blockXOR(prevBlock, tempBlock); - decryptedBlocks = decryptedBlocks.concat(tempBlock); - } - decryptedBlocks = my.depad(decryptedBlocks); - return my.bytes2string(decryptedBlocks); - } - - // Wraps a string to 60 characters. - my.wrap60 = function (string) { - var outstr = ""; - for (var i = 0; i < string.length; i++) { - if (i % 60 == 0 && i != 0) outstr += "\n"; - outstr += string[i]; - } - return outstr; - } - - // Generate a random key for the AES-encrypted message. - my.generateAESKey = function () { - var key = new Array(32); - var r = new SecureRandom(); - r.nextBytes(key); - return key; - } - - // Generates an RSA key from a passphrase. - my.generateRSAKey = function (passphrase, bitlength) { - Math.seedrandom(sha256.hex(passphrase)); - var rsa = new RSAKey(); - rsa.generate(bitlength, "03"); - return rsa; - } - - // Returns the ascii-armored version of the public key. - my.publicKeyString = function (rsakey) { - pubkey = my.b16to64(rsakey.n.toString(16)); - return pubkey; - } - - // Returns an MD5 sum of a publicKeyString for easier identification. - my.publicKeyID = function (publicKeyString) { - return MD5(publicKeyString); - } - - my.publicKeyFromString = function (string) { - var N = my.b64to16(string.split("|")[0]); - var E = "03"; - var rsa = new RSAKey(); - rsa.setPublic(N, E); - return rsa - } - - my.encrypt = function (plaintext, publickeystring, signingkey) { - var cipherblock = ""; - var aeskey = my.generateAESKey(); - try { - var publickey = my.publicKeyFromString(publickeystring); - cipherblock += my.b16to64(publickey.encrypt(my.bytes2string(aeskey))) + "?"; - } - catch (err) { - return {status: "Invalid public key"}; - } - if (signingkey) { - signString = cryptico.b16to64(signingkey.signString(plaintext, "sha256")); - plaintext += "::52cee64bb3a38f6403386519a39ac91c::"; - plaintext += cryptico.publicKeyString(signingkey); - plaintext += "::52cee64bb3a38f6403386519a39ac91c::"; - plaintext += signString; - } - cipherblock += my.encryptAESCBC(plaintext, aeskey); - return {status: "success", cipher: cipherblock}; - } - - my.decrypt = function (ciphertext, key) { - var cipherblock = ciphertext.split("?"); - var aeskey = key.decrypt(my.b64to16(cipherblock[0])); - if (aeskey == null) { - return {status: "failure"}; - } - aeskey = my.string2bytes(aeskey); - var plaintext = my.decryptAESCBC(cipherblock[1], aeskey).split("::52cee64bb3a38f6403386519a39ac91c::"); - if (plaintext.length == 3) { - var publickey = my.publicKeyFromString(plaintext[1]); - var signature = my.b64to16(plaintext[2]); - if (publickey.verifyString(plaintext[0], signature)) { - return { - status: "success", - plaintext: plaintext[0], - signature: "verified", - publicKeyString: my.publicKeyString(publickey) - }; - } - else { - return { - status: "success", - plaintext: plaintext[0], - signature: "forged", - publicKeyString: my.publicKeyString(publickey) - }; - } - } - else { - return {status: "success", plaintext: plaintext[0], signature: "unsigned"}; - } - } - - return my; - +// Copyright (c) 2005 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. +// Basic JavaScript BN library - subset useful for RSA encryption. + +// Bits per digit +var dbits; + +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = ((canary & 0xffffff) == 0xefcafe); + +// (public) Constructor + +function BigInteger(a, b, c) { + if (a != null) if ("number" === typeof a) this.fromNumber(a, b, c); + else if (b == null && "string" !== typeof a) this.fromString(a, 256); + else this.fromString(a, b); +} + +// return new, unset BigInteger + +function nbi() { + return new BigInteger(null); +} + +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) + +function am1(i, x, w, j, c, n) { + while (--n >= 0) { + var v = x * this[i++] + w[j] + c; + c = Math.floor(v / 0x4000000); + w[j++] = v & 0x3ffffff; + } + return c; +} + +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) + +function am2(i, x, w, j, c, n) { + var xl = x & 0x7fff, + xh = x >> 15; + while (--n >= 0) { + var l = this[i] & 0x7fff; + var h = this[i++] >> 15; + var m = xh * l + h * xl; + l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff); + c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30); + w[j++] = l & 0x3fffffff; + } + return c; +} + +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. + +function am3(i, x, w, j, c, n) { + var xl = x & 0x3fff, + xh = x >> 14; + while (--n >= 0) { + var l = this[i] & 0x3fff; + var h = this[i++] >> 14; + var m = xh * l + h * xl; + l = xl * l + ((m & 0x3fff) << 14) + w[j] + c; + c = (l >> 28) + (m >> 14) + xh * h; + w[j++] = l & 0xfffffff; + } + return c; +} + +if (j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; +} +else if (j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; +} +else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} + +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = ((1 << dbits) - 1); +BigInteger.prototype.DV = (1 << dbits); + +var BI_FP = 52; +BigInteger.prototype.FV = Math.pow(2, BI_FP); +BigInteger.prototype.F1 = BI_FP - dbits; +BigInteger.prototype.F2 = 2 * dbits - BI_FP; + +// Digit conversions +var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; +var BI_RC = new Array(); +var rr, vv; +rr = "0".charCodeAt(0); +for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; +rr = "a".charCodeAt(0); +for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; +rr = "A".charCodeAt(0); +for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; + +function int2char(n) { + return BI_RM.charAt(n); +} + +function intAt(s, i) { + var c = BI_RC[s.charCodeAt(i)]; + return (c == null) ? -1 : c; +} + +// (protected) copy this to r + +function bnpCopyTo(r) { + for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; +} + +// (protected) set from integer value x, -DV <= x < DV + +function bnpFromInt(x) { + this.t = 1; + this.s = (x < 0) ? -1 : 0; + if (x > 0) this[0] = x; + else if (x < -1) this[0] = x + DV; + else this.t = 0; +} + +// return bigint initialized to value + +function nbv(i) { + var r = nbi(); + r.fromInt(i); + return r; +} + +// (protected) set from string and radix + +function bnpFromString(s, b) { + var k; + if (b == 16) k = 4; + else if (b == 8) k = 3; + else if (b == 256) k = 8; // byte array + else if (b == 2) k = 1; + else if (b == 32) k = 5; + else if (b == 4) k = 2; + else { + this.fromRadix(s, b); + return; + } + this.t = 0; + this.s = 0; + var i = s.length, + mi = false, + sh = 0; + while (--i >= 0) { + var x = (k == 8) ? s[i] & 0xff : intAt(s, i); + if (x < 0) { + if (s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if (sh == 0) this[this.t++] = x; + else if (sh + k > this.DB) { + this[this.t - 1] |= (x & ((1 << (this.DB - sh)) - 1)) << sh; + this[this.t++] = (x >> (this.DB - sh)); + } + else this[this.t - 1] |= x << sh; + sh += k; + if (sh >= this.DB) sh -= this.DB; + } + if (k == 8 && (s[0] & 0x80) != 0) { + this.s = -1; + if (sh > 0) this[this.t - 1] |= ((1 << (this.DB - sh)) - 1) << sh; + } + this.clamp(); + if (mi) BigInteger.ZERO.subTo(this, this); +} + +// (protected) clamp off excess high words + +function bnpClamp() { + var c = this.s & this.DM; + while (this.t > 0 && this[this.t - 1] == c) --this.t; +} + +// (public) return string representation in given radix + +function bnToString(b) { + if (this.s < 0) return "-" + this.negate().toString(b); + var k; + if (b == 16) k = 4; + else if (b == 8) k = 3; + else if (b == 2) k = 1; + else if (b == 32) k = 5; + else if (b == 64) k = 6; + else if (b == 4) k = 2; + else return this.toRadix(b); + var km = (1 << k) - 1, + d, m = false, + r = "", + i = this.t; + var p = this.DB - (i * this.DB) % k; + if (i-- > 0) { + if (p < this.DB && (d = this[i] >> p) > 0) { + m = true; + r = int2char(d); + } + while (i >= 0) { + if (p < k) { + d = (this[i] & ((1 << p) - 1)) << (k - p); + d |= this[--i] >> (p += this.DB - k); + } + else { + d = (this[i] >> (p -= k)) & km; + if (p <= 0) { + p += this.DB; + --i; + } + } + if (d > 0) m = true; + if (m) r += int2char(d); + } + } + return m ? r : "0"; +} + +// (public) -this + +function bnNegate() { + var r = nbi(); + BigInteger.ZERO.subTo(this, r); + return r; +} + +// (public) |this| + +function bnAbs() { + return (this.s < 0) ? this.negate() : this; +} + +// (public) return + if this > a, - if this < a, 0 if equal + +function bnCompareTo(a) { + var r = this.s - a.s; + if (r != 0) return r; + var i = this.t; + r = i - a.t; + if (r != 0) return r; + while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r; + return 0; +} + +// returns bit length of the integer x + +function nbits(x) { + var r = 1, + t; + if ((t = x >>> 16) != 0) { + x = t; + r += 16; + } + if ((t = x >> 8) != 0) { + x = t; + r += 8; + } + if ((t = x >> 4) != 0) { + x = t; + r += 4; + } + if ((t = x >> 2) != 0) { + x = t; + r += 2; + } + if ((t = x >> 1) != 0) { + x = t; + r += 1; + } + return r; +} + +// (public) return the number of bits in "this" + +function bnBitLength() { + if (this.t <= 0) return 0; + return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM)); +} + +// (protected) r = this << n*DB + +function bnpDLShiftTo(n, r) { + var i; + for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]; + for (i = n - 1; i >= 0; --i) r[i] = 0; + r.t = this.t + n; + r.s = this.s; +} + +// (protected) r = this >> n*DB + +function bnpDRShiftTo(n, r) { + for (var i = n; i < this.t; ++i) r[i - n] = this[i]; + r.t = Math.max(this.t - n, 0); + r.s = this.s; +} + +// (protected) r = this << n + +function bnpLShiftTo(n, r) { + var bs = n % this.DB; + var cbs = this.DB - bs; + var bm = (1 << cbs) - 1; + var ds = Math.floor(n / this.DB), + c = (this.s << bs) & this.DM, + i; + for (i = this.t - 1; i >= 0; --i) { + r[i + ds + 1] = (this[i] >> cbs) | c; + c = (this[i] & bm) << bs; + } + for (i = ds - 1; i >= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t + ds + 1; + r.s = this.s; + r.clamp(); +} + +// (protected) r = this >> n + +function bnpRShiftTo(n, r) { + r.s = this.s; + var ds = Math.floor(n / this.DB); + if (ds >= this.t) { + r.t = 0; + return; + } + var bs = n % this.DB; + var cbs = this.DB - bs; + var bm = (1 << bs) - 1; + r[0] = this[ds] >> bs; + for (var i = ds + 1; i < this.t; ++i) { + r[i - ds - 1] |= (this[i] & bm) << cbs; + r[i - ds] = this[i] >> bs; + } + if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs; + r.t = this.t - ds; + r.clamp(); +} + +// (protected) r = this - a + +function bnpSubTo(a, r) { + var i = 0, + c = 0, + m = Math.min(a.t, this.t); + while (i < m) { + c += this[i] - a[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + if (a.t < this.t) { + c -= a.s; + while (i < this.t) { + c += this[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while (i < a.t) { + c -= a[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c < 0) ? -1 : 0; + if (c < -1) r[i++] = this.DV + c; + else if (c > 0) r[i++] = c; + r.t = i; + r.clamp(); +} + +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. + +function bnpMultiplyTo(a, r) { + var x = this.abs(), + y = a.abs(); + var i = x.t; + r.t = i + y.t; + while (--i >= 0) r[i] = 0; + for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t); + r.s = 0; + r.clamp(); + if (this.s != a.s) BigInteger.ZERO.subTo(r, r); +} + +// (protected) r = this^2, r != this (HAC 14.16) + +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2 * x.t; + while (--i >= 0) r[i] = 0; + for (i = 0; i < x.t - 1; ++i) { + var c = x.am(i, x[i], r, 2 * i, 0, 1); + if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) { + r[i + x.t] -= x.DV; + r[i + x.t + 1] = 1; + } + } + if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1); + r.s = 0; + r.clamp(); +} + +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. + +function bnpDivRemTo(m, q, r) { + var pm = m.abs(); + if (pm.t <= 0) return; + var pt = this.abs(); + if (pt.t < pm.t) { + if (q != null) q.fromInt(0); + if (r != null) this.copyTo(r); + return; + } + if (r == null) r = nbi(); + var y = nbi(), + ts = this.s, + ms = m.s; + var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus + if (nsh > 0) { + pm.lShiftTo(nsh, y); + pt.lShiftTo(nsh, r); + } + else { + pm.copyTo(y); + pt.copyTo(r); + } + var ys = y.t; + var y0 = y[ys - 1]; + if (y0 == 0) return; + var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0); + var d1 = this.FV / yt, + d2 = (1 << this.F1) / yt, + e = 1 << this.F2; + var i = r.t, + j = i - ys, + t = (q == null) ? nbi() : q; + y.dlShiftTo(j, t); + if (r.compareTo(t) >= 0) { + r[r.t++] = 1; + r.subTo(t, r); + } + BigInteger.ONE.dlShiftTo(ys, t); + t.subTo(y, y); // "negative" y so we can replace sub with am later + while (y.t < ys) y[y.t++] = 0; + while (--j >= 0) { + // Estimate quotient digit + var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2); + if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out + y.dlShiftTo(j, t); + r.subTo(t, r); + while (r[i] < --qd) r.subTo(t, r); + } + } + if (q != null) { + r.drShiftTo(ys, q); + if (ts != ms) BigInteger.ZERO.subTo(q, q); + } + r.t = ys; + r.clamp(); + if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder + if (ts < 0) BigInteger.ZERO.subTo(r, r); +} + +// (public) this mod a + +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a, null, r); + if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r); + return r; +} + +// Modular reduction using "classic" algorithm + +function Classic(m) { + this.m = m; +} + +function cConvert(x) { + if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; +} + +function cRevert(x) { + return x; +} + +function cReduce(x) { + x.divRemTo(this.m, null, x); +} + +function cMulTo(x, y, r) { + x.multiplyTo(y, r); + this.reduce(r); +} + +function cSqrTo(x, r) { + x.squareTo(r); + this.reduce(r); +} + +Classic.prototype.convert = cConvert; +Classic.prototype.revert = cRevert; +Classic.prototype.reduce = cReduce; +Classic.prototype.mulTo = cMulTo; +Classic.prototype.sqrTo = cSqrTo; + +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. + +function bnpInvDigit() { + if (this.t < 1) return 0; + var x = this[0]; + if ((x & 1) == 0) return 0; + var y = x & 3; // y == 1/x mod 2^2 + y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4 + y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8 + y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y > 0) ? this.DV - y : -y; +} + +// Montgomery reduction + +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp & 0x7fff; + this.mph = this.mp >> 15; + this.um = (1 << (m.DB - 15)) - 1; + this.mt2 = 2 * m.t; +} + +// xR mod m + +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t, r); + r.divRemTo(this.m, null, r); + if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r); + return r; +} + +// x/R mod m + +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} + +// x = x/R mod m (HAC 14.32) + +function montReduce(x) { + while (x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for (var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i] & 0x7fff; + var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM; + // use am to combine the multiply-shift-add into one call + j = i + this.m.t; + x[j] += this.m.am(0, u0, x, i, 0, this.m.t); + // propagate carry + while (x[j] >= x.DV) { + x[j] -= x.DV; + x[++j]++; + } + } + x.clamp(); + x.drShiftTo(this.m.t, x); + if (x.compareTo(this.m) >= 0) x.subTo(this.m, x); +} + +// r = "x^2/R mod m"; x != r + +function montSqrTo(x, r) { + x.squareTo(r); + this.reduce(r); +} + +// r = "xy/R mod m"; x,y != r + +function montMulTo(x, y, r) { + x.multiplyTo(y, r); + this.reduce(r); +} + +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; + +// (protected) true iff this is even + +function bnpIsEven() { + return ((this.t > 0) ? (this[0] & 1) : this.s) == 0; +} + +// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) + +function bnpExp(e, z) { + if (e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), + r2 = nbi(), + g = z.convert(this), + i = nbits(e) - 1; + g.copyTo(r); + while (--i >= 0) { + z.sqrTo(r, r2); + if ((e & (1 << i)) > 0) z.mulTo(r2, g, r); + else { + var t = r; + r = r2; + r2 = t; + } + } + return z.revert(r); +} + +// (public) this^e % m, 0 <= e < 2^32 + +function bnModPowInt(e, m) { + var z; + if (e < 256 || m.isEven()) z = new Classic(m); + else z = new Montgomery(m); + return this.exp(e, z); +} + +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.isEven = bnpIsEven; +BigInteger.prototype.exp = bnpExp; + +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.modPowInt = bnModPowInt; + +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); + + +function bnClone() { + var r = nbi(); + this.copyTo(r); + return r; +} + +// (public) return value as integer + +function bnIntValue() { + if (this.s < 0) { + if (this.t == 1) return this[0] - this.DV; + else if (this.t == 0) return -1; + } + else if (this.t == 1) return this[0]; + else if (this.t == 0) return 0; + // assumes 16 < DB < 32 + return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]; +} + +// (public) return value as byte + +function bnByteValue() { + return (this.t == 0) ? this.s : (this[0] << 24) >> 24; +} + +// (public) return value as short (assumes DB>=16) + +function bnShortValue() { + return (this.t == 0) ? this.s : (this[0] << 16) >> 16; +} + +// (protected) return x s.t. r^x < DV + +function bnpChunkSize(r) { + return Math.floor(Math.LN2 * this.DB / Math.log(r)); +} + +// (public) 0 if this == 0, 1 if this > 0 + +function bnSigNum() { + if (this.s < 0) return -1; + else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; + else return 1; +} + +// (protected) convert to radix string + +function bnpToRadix(b) { + if (b == null) b = 10; + if (this.signum() == 0 || b < 2 || b > 36) return "0"; + var cs = this.chunkSize(b); + var a = Math.pow(b, cs); + var d = nbv(a), + y = nbi(), + z = nbi(), + r = ""; + this.divRemTo(d, y, z); + while (y.signum() > 0) { + r = (a + z.intValue()).toString(b).substr(1) + r; + y.divRemTo(d, y, z); + } + return z.intValue().toString(b) + r; +} + +// (protected) convert from radix string + +function bnpFromRadix(s, b) { + this.fromInt(0); + if (b == null) b = 10; + var cs = this.chunkSize(b); + var d = Math.pow(b, cs), + mi = false, + j = 0, + w = 0; + for (var i = 0; i < s.length; ++i) { + var x = intAt(s, i); + if (x < 0) { + if (s.charAt(i) == "-" && this.signum() == 0) mi = true; + continue; + } + w = b * w + x; + if (++j >= cs) { + this.dMultiply(d); + this.dAddOffset(w, 0); + j = 0; + w = 0; + } + } + if (j > 0) { + this.dMultiply(Math.pow(b, j)); + this.dAddOffset(w, 0); + } + if (mi) BigInteger.ZERO.subTo(this, this); +} + +// (protected) alternate constructor + +function bnpFromNumber(a, b, c) { + if ("number" == typeof b) { + // new BigInteger(int,int,RNG) + if (a < 2) this.fromInt(1); + else { + this.fromNumber(a, c); + if (!this.testBit(a - 1)) // force MSB set + this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this); + if (this.isEven()) this.dAddOffset(1, 0); // force odd + while (!this.isProbablePrime(b)) { + this.dAddOffset(2, 0); + if (this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a - 1), this); + } + } + } + else { + // new BigInteger(int,RNG) + var x = new Array(), + t = a & 7; + x.length = (a >> 3) + 1; + b.nextBytes(x); + if (t > 0) x[0] &= ((1 << t) - 1); + else x[0] = 0; + this.fromString(x, 256); + } +} + +// (public) convert to bigendian byte array + +function bnToByteArray() { + var i = this.t, + r = new Array(); + r[0] = this.s; + var p = this.DB - (i * this.DB) % 8, + d, k = 0; + if (i-- > 0) { + if (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p) r[k++] = d | (this.s << (this.DB - p)); + while (i >= 0) { + if (p < 8) { + d = (this[i] & ((1 << p) - 1)) << (8 - p); + d |= this[--i] >> (p += this.DB - 8); + } + else { + d = (this[i] >> (p -= 8)) & 0xff; + if (p <= 0) { + p += this.DB; + --i; + } + } + if ((d & 0x80) != 0) d |= -256; + if (k == 0 && (this.s & 0x80) != (d & 0x80)) ++k; + if (k > 0 || d != this.s) r[k++] = d; + } + } + return r; +} + +function bnEquals(a) { + return (this.compareTo(a) == 0); +} + +function bnMin(a) { + return (this.compareTo(a) < 0) ? this : a; +} + +function bnMax(a) { + return (this.compareTo(a) > 0) ? this : a; +} + +// (protected) r = this op a (bitwise) + +function bnpBitwiseTo(a, op, r) { + var i, f, m = Math.min(a.t, this.t); + for (i = 0; i < m; ++i) r[i] = op(this[i], a[i]); + if (a.t < this.t) { + f = a.s & this.DM; + for (i = m; i < this.t; ++i) r[i] = op(this[i], f); + r.t = this.t; + } + else { + f = this.s & this.DM; + for (i = m; i < a.t; ++i) r[i] = op(f, a[i]); + r.t = a.t; + } + r.s = op(this.s, a.s); + r.clamp(); +} + +// (public) this & a + +function op_and(x, y) { + return x & y; +} + +function bnAnd(a) { + var r = nbi(); + this.bitwiseTo(a, op_and, r); + return r; +} + +// (public) this | a + +function op_or(x, y) { + return x | y; +} + +function bnOr(a) { + var r = nbi(); + this.bitwiseTo(a, op_or, r); + return r; +} + +// (public) this ^ a + +function op_xor(x, y) { + return x ^ y; +} + +function bnXor(a) { + var r = nbi(); + this.bitwiseTo(a, op_xor, r); + return r; +} + +// (public) this & ~a + +function op_andnot(x, y) { + return x & ~y; +} + +function bnAndNot(a) { + var r = nbi(); + this.bitwiseTo(a, op_andnot, r); + return r; +} + +// (public) ~this + +function bnNot() { + var r = nbi(); + for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]; + r.t = this.t; + r.s = ~this.s; + return r; +} + +// (public) this << n + +function bnShiftLeft(n) { + var r = nbi(); + if (n < 0) this.rShiftTo(-n, r); + else this.lShiftTo(n, r); + return r; +} + +// (public) this >> n + +function bnShiftRight(n) { + var r = nbi(); + if (n < 0) this.lShiftTo(-n, r); + else this.rShiftTo(n, r); + return r; +} + +// return index of lowest 1-bit in x, x < 2^31 + +function lbit(x) { + if (x == 0) return -1; + var r = 0; + if ((x & 0xffff) == 0) { + x >>= 16; + r += 16; + } + if ((x & 0xff) == 0) { + x >>= 8; + r += 8; + } + if ((x & 0xf) == 0) { + x >>= 4; + r += 4; + } + if ((x & 3) == 0) { + x >>= 2; + r += 2; + } + if ((x & 1) == 0) ++r; + return r; +} + +// (public) returns index of lowest 1-bit (or -1 if none) + +function bnGetLowestSetBit() { + for (var i = 0; i < this.t; ++i) + if (this[i] != 0) return i * this.DB + lbit(this[i]); + if (this.s < 0) return this.t * this.DB; + return -1; +} + +// return number of 1 bits in x + +function cbit(x) { + var r = 0; + while (x != 0) { + x &= x - 1; + ++r; + } + return r; +} + +// (public) return number of set bits + +function bnBitCount() { + var r = 0, + x = this.s & this.DM; + for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x); + return r; +} + +// (public) true iff nth bit is set + +function bnTestBit(n) { + var j = Math.floor(n / this.DB); + if (j >= this.t) return (this.s != 0); + return ((this[j] & (1 << (n % this.DB))) != 0); +} + +// (protected) this op (1<>= this.DB; + } + if (a.t < this.t) { + c += a.s; + while (i < this.t) { + c += this[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while (i < a.t) { + c += a[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c += a.s; + } + r.s = (c < 0) ? -1 : 0; + if (c > 0) r[i++] = c; + else if (c < -1) r[i++] = this.DV + c; + r.t = i; + r.clamp(); +} + +// (public) this + a + +function bnAdd(a) { + var r = nbi(); + this.addTo(a, r); + return r; +} + +// (public) this - a + +function bnSubtract(a) { + var r = nbi(); + this.subTo(a, r); + return r; +} + +// (public) this * a + +function bnMultiply(a) { + var r = nbi(); + this.multiplyTo(a, r); + return r; +} + +// (public) this^2 + +function bnSquare() { + var r = nbi(); + this.squareTo(r); + return r; +} + +// (public) this / a + +function bnDivide(a) { + var r = nbi(); + this.divRemTo(a, r, null); + return r; +} + +// (public) this % a + +function bnRemainder(a) { + var r = nbi(); + this.divRemTo(a, null, r); + return r; +} + +// (public) [this/a,this%a] + +function bnDivideAndRemainder(a) { + var q = nbi(), + r = nbi(); + this.divRemTo(a, q, r); + return new Array(q, r); +} + +// (protected) this *= n, this >= 0, 1 < n < DV + +function bnpDMultiply(n) { + this[this.t] = this.am(0, n - 1, this, 0, 0, this.t); + ++this.t; + this.clamp(); +} + +// (protected) this += n << w words, this >= 0 + +function bnpDAddOffset(n, w) { + if (n == 0) return; + while (this.t <= w) this[this.t++] = 0; + this[w] += n; + while (this[w] >= this.DV) { + this[w] -= this.DV; + if (++w >= this.t) this[this.t++] = 0; + ++this[w]; + } +} + +// A "null" reducer + +function NullExp() { +} + +function nNop(x) { + return x; +} + +function nMulTo(x, y, r) { + x.multiplyTo(y, r); +} + +function nSqrTo(x, r) { + x.squareTo(r); +} + +NullExp.prototype.convert = nNop; +NullExp.prototype.revert = nNop; +NullExp.prototype.mulTo = nMulTo; +NullExp.prototype.sqrTo = nSqrTo; + +// (public) this^e + +function bnPow(e) { + return this.exp(e, new NullExp()); +} + +// (protected) r = lower n words of "this * a", a.t <= n +// "this" should be the larger one if appropriate. + +function bnpMultiplyLowerTo(a, n, r) { + var i = Math.min(this.t + a.t, n); + r.s = 0; // assumes a,this >= 0 + r.t = i; + while (i > 0) r[--i] = 0; + var j; + for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t); + for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i); + r.clamp(); +} + +// (protected) r = "this * a" without lower n words, n > 0 +// "this" should be the larger one if appropriate. + +function bnpMultiplyUpperTo(a, n, r) { + --n; + var i = r.t = this.t + a.t - n; + r.s = 0; // assumes a,this >= 0 + while (--i >= 0) r[i] = 0; + for (i = Math.max(n - this.t, 0); i < a.t; ++i) + r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n); + r.clamp(); + r.drShiftTo(1, r); +} + +// Barrett modular reduction + +function Barrett(m) { + // setup Barrett + this.r2 = nbi(); + this.q3 = nbi(); + BigInteger.ONE.dlShiftTo(2 * m.t, this.r2); + this.mu = this.r2.divide(m); + this.m = m; +} + +function barrettConvert(x) { + if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m); + else if (x.compareTo(this.m) < 0) return x; + else { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; + } +} + +function barrettRevert(x) { + return x; +} + +// x = x mod m (HAC 14.42) + +function barrettReduce(x) { + x.drShiftTo(this.m.t - 1, this.r2); + if (x.t > this.m.t + 1) { + x.t = this.m.t + 1; + x.clamp(); + } + this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3); + this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); + while (x.compareTo(this.r2) < 0) x.dAddOffset(1, this.m.t + 1); + x.subTo(this.r2, x); + while (x.compareTo(this.m) >= 0) x.subTo(this.m, x); +} + +// r = x^2 mod m; x != r + +function barrettSqrTo(x, r) { + x.squareTo(r); + this.reduce(r); +} + +// r = x*y mod m; x,y != r + +function barrettMulTo(x, y, r) { + x.multiplyTo(y, r); + this.reduce(r); +} + +Barrett.prototype.convert = barrettConvert; +Barrett.prototype.revert = barrettRevert; +Barrett.prototype.reduce = barrettReduce; +Barrett.prototype.mulTo = barrettMulTo; +Barrett.prototype.sqrTo = barrettSqrTo; + +// (public) this^e % m (HAC 14.85) + +function bnModPow(e, m) { + var i = e.bitLength(), + k, r = nbv(1), + z; + if (i <= 0) return r; + else if (i < 18) k = 1; + else if (i < 48) k = 3; + else if (i < 144) k = 4; + else if (i < 768) k = 5; + else k = 6; + if (i < 8) z = new Classic(m); + else if (m.isEven()) z = new Barrett(m); + else z = new Montgomery(m); + + // precomputation + var g = new Array(), + n = 3, + k1 = k - 1, + km = (1 << k) - 1; + g[1] = z.convert(this); + if (k > 1) { + var g2 = nbi(); + z.sqrTo(g[1], g2); + while (n <= km) { + g[n] = nbi(); + z.mulTo(g2, g[n - 2], g[n]); + n += 2; + } + } + + var j = e.t - 1, + w, is1 = true, + r2 = nbi(), + t; + i = nbits(e[j]) - 1; + while (j >= 0) { + if (i >= k1) w = (e[j] >> (i - k1)) & km; + else { + w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i); + if (j > 0) w |= e[j - 1] >> (this.DB + i - k1); + } + + n = k; + while ((w & 1) == 0) { + w >>= 1; + --n; + } + if ((i -= n) < 0) { + i += this.DB; + --j; + } + if (is1) { // ret == 1, don't bother squaring or multiplying it + g[w].copyTo(r); + is1 = false; + } + else { + while (n > 1) { + z.sqrTo(r, r2); + z.sqrTo(r2, r); + n -= 2; + } + if (n > 0) z.sqrTo(r, r2); + else { + t = r; + r = r2; + r2 = t; + } + z.mulTo(r2, g[w], r); + } + + while (j >= 0 && (e[j] & (1 << i)) == 0) { + z.sqrTo(r, r2); + t = r; + r = r2; + r2 = t; + if (--i < 0) { + i = this.DB - 1; + --j; + } + } + } + return z.revert(r); +} + +// (public) gcd(this,a) (HAC 14.54) + +function bnGCD(a) { + var x = (this.s < 0) ? this.negate() : this.clone(); + var y = (a.s < 0) ? a.negate() : a.clone(); + if (x.compareTo(y) < 0) { + var t = x; + x = y; + y = t; + } + var i = x.getLowestSetBit(), + g = y.getLowestSetBit(); + if (g < 0) return x; + if (i < g) g = i; + if (g > 0) { + x.rShiftTo(g, x); + y.rShiftTo(g, y); + } + while (x.signum() > 0) { + if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x); + if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y); + if (x.compareTo(y) >= 0) { + x.subTo(y, x); + x.rShiftTo(1, x); + } + else { + y.subTo(x, y); + y.rShiftTo(1, y); + } + } + if (g > 0) y.lShiftTo(g, y); + return y; +} + +// (protected) this % n, n < 2^26 + +function bnpModInt(n) { + if (n <= 0) return 0; + var d = this.DV % n, + r = (this.s < 0) ? n - 1 : 0; + if (this.t > 0) if (d == 0) r = this[0] % n; + else for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n; + return r; +} + +// (public) 1/this % m (HAC 14.61) + +function bnModInverse(m) { + var ac = m.isEven(); + if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; + var u = m.clone(), + v = this.clone(); + var a = nbv(1), + b = nbv(0), + c = nbv(0), + d = nbv(1); + while (u.signum() != 0) { + while (u.isEven()) { + u.rShiftTo(1, u); + if (ac) { + if (!a.isEven() || !b.isEven()) { + a.addTo(this, a); + b.subTo(m, b); + } + a.rShiftTo(1, a); + } + else if (!b.isEven()) b.subTo(m, b); + b.rShiftTo(1, b); + } + while (v.isEven()) { + v.rShiftTo(1, v); + if (ac) { + if (!c.isEven() || !d.isEven()) { + c.addTo(this, c); + d.subTo(m, d); + } + c.rShiftTo(1, c); + } + else if (!d.isEven()) d.subTo(m, d); + d.rShiftTo(1, d); + } + if (u.compareTo(v) >= 0) { + u.subTo(v, u); + if (ac) a.subTo(c, a); + b.subTo(d, b); + } + else { + v.subTo(u, v); + if (ac) c.subTo(a, c); + d.subTo(b, d); + } + } + if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; + if (d.compareTo(m) >= 0) return d.subtract(m); + if (d.signum() < 0) d.addTo(m, d); + else return d; + if (d.signum() < 0) return d.add(m); + else return d; +} + +var lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]; +var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; + +// (public) test primality with certainty >= 1-.5^t + +function bnIsProbablePrime(t) { + var i, x = this.abs(); + if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) { + for (i = 0; i < lowprimes.length; ++i) + if (x[0] == lowprimes[i]) return true; + return false; + } + if (x.isEven()) return false; + i = 1; + while (i < lowprimes.length) { + var m = lowprimes[i], + j = i + 1; + while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]; + m = x.modInt(m); + while (i < j) if (m % lowprimes[i++] == 0) return false; + } + return x.millerRabin(t); +} + +// (protected) true if probably prime (HAC 4.24, Miller-Rabin) + +function bnpMillerRabin(t) { + var n1 = this.subtract(BigInteger.ONE); + var k = n1.getLowestSetBit(); + if (k <= 0) return false; + var r = n1.shiftRight(k); + t = (t + 1) >> 1; + if (t > lowprimes.length) t = lowprimes.length; + var a = nbi(); + for (var i = 0; i < t; ++i) { + //Pick bases at random, instead of starting at 2 + a.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]); + var y = a.modPow(r, this); + if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { + var j = 1; + while (j++ < k && y.compareTo(n1) != 0) { + y = y.modPowInt(2, this); + if (y.compareTo(BigInteger.ONE) == 0) return false; + } + if (y.compareTo(n1) != 0) return false; + } + } + return true; +} + +// protected +BigInteger.prototype.chunkSize = bnpChunkSize; +BigInteger.prototype.toRadix = bnpToRadix; +BigInteger.prototype.fromRadix = bnpFromRadix; +BigInteger.prototype.fromNumber = bnpFromNumber; +BigInteger.prototype.bitwiseTo = bnpBitwiseTo; +BigInteger.prototype.changeBit = bnpChangeBit; +BigInteger.prototype.addTo = bnpAddTo; +BigInteger.prototype.dMultiply = bnpDMultiply; +BigInteger.prototype.dAddOffset = bnpDAddOffset; +BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; +BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; +BigInteger.prototype.modInt = bnpModInt; +BigInteger.prototype.millerRabin = bnpMillerRabin; + +// public +BigInteger.prototype.clone = bnClone; +BigInteger.prototype.intValue = bnIntValue; +BigInteger.prototype.byteValue = bnByteValue; +BigInteger.prototype.shortValue = bnShortValue; +BigInteger.prototype.signum = bnSigNum; +BigInteger.prototype.toByteArray = bnToByteArray; +BigInteger.prototype.equals = bnEquals; +BigInteger.prototype.min = bnMin; +BigInteger.prototype.max = bnMax; +BigInteger.prototype.and = bnAnd; +BigInteger.prototype.or = bnOr; +BigInteger.prototype.xor = bnXor; +BigInteger.prototype.andNot = bnAndNot; +BigInteger.prototype.not = bnNot; +BigInteger.prototype.shiftLeft = bnShiftLeft; +BigInteger.prototype.shiftRight = bnShiftRight; +BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; +BigInteger.prototype.bitCount = bnBitCount; +BigInteger.prototype.testBit = bnTestBit; +BigInteger.prototype.setBit = bnSetBit; +BigInteger.prototype.clearBit = bnClearBit; +BigInteger.prototype.flipBit = bnFlipBit; +BigInteger.prototype.add = bnAdd; +BigInteger.prototype.subtract = bnSubtract; +BigInteger.prototype.multiply = bnMultiply; +BigInteger.prototype.divide = bnDivide; +BigInteger.prototype.remainder = bnRemainder; +BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; +BigInteger.prototype.modPow = bnModPow; +BigInteger.prototype.modInverse = bnModInverse; +BigInteger.prototype.pow = bnPow; +BigInteger.prototype.gcd = bnGCD; +BigInteger.prototype.isProbablePrime = bnIsProbablePrime; + +// JSBN-specific extension +BigInteger.prototype.square = bnSquare; + +// seedrandom.js version 2.0. +// Author: David Bau 4/2/2011 +// +// Defines a method Math.seedrandom() that, when called, substitutes +// an explicitly seeded RC4-based algorithm for Math.random(). Also +// supports automatic seeding from local or network sources of entropy. +// +// Usage: +// +// +// +// Math.seedrandom('yipee'); Sets Math.random to a function that is +// initialized using the given explicit seed. +// +// Math.seedrandom(); Sets Math.random to a function that is +// seeded using the current time, dom state, +// and other accumulated local entropy. +// The generated seed string is returned. +// +// Math.seedrandom('yowza', true); +// Seeds using the given explicit seed mixed +// together with accumulated entropy. +// +// +// Seeds using physical random bits downloaded +// from random.org. +// +// Seeds using urandom bits from call.jsonlib.com, +// which is faster than random.org. +// +// Examples: +// +// Math.seedrandom("hello"); // Use "hello" as the seed. +// document.write(Math.random()); // Always 0.5463663768140734 +// document.write(Math.random()); // Always 0.43973793770592234 +// var rng1 = Math.random; // Remember the current prng. +// +// var autoseed = Math.seedrandom(); // New prng with an automatic seed. +// document.write(Math.random()); // Pretty much unpredictable. +// +// Math.random = rng1; // Continue "hello" prng sequence. +// document.write(Math.random()); // Always 0.554769432473455 +// +// Math.seedrandom(autoseed); // Restart at the previous seed. +// document.write(Math.random()); // Repeat the 'unpredictable' value. +// +// Notes: +// +// Each time seedrandom('arg') is called, entropy from the passed seed +// is accumulated in a pool to help generate future seeds for the +// zero-argument form of Math.seedrandom, so entropy can be injected over +// time by calling seedrandom with explicit data repeatedly. +// +// On speed - This javascript implementation of Math.random() is about +// 3-10x slower than the built-in Math.random() because it is not native +// code, but this is typically fast enough anyway. Seeding is more expensive, +// especially if you use auto-seeding. Some details (timings on Chrome 4): +// +// Our Math.random() - avg less than 0.002 milliseconds per call +// seedrandom('explicit') - avg less than 0.5 milliseconds per call +// seedrandom('explicit', true) - avg less than 2 milliseconds per call +// seedrandom() - avg about 38 milliseconds per call +// +// LICENSE (BSD): +// +// Copyright 2010 David Bau, all rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of this module nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/** + * All code is in an anonymous closure to keep the global namespace clean. + * + * @param {number=} overflow + * @param {number=} startdenom + */ +(function (pool, math, width, chunks, significance, overflow, startdenom) { + + + // + // seedrandom() + // This is the seedrandom function described above. + // + math['seedrandom'] = function seedrandom(seed, use_entropy) { + var key = []; + var arc4; + + // Flatten the seed string or build one from local entropy if needed. + seed = mixkey(flatten( + use_entropy ? [seed, pool] : arguments.length ? seed : [new Date().getTime(), pool, window], 3), key); + + // Use the seed to initialize an ARC4 generator. + arc4 = new ARC4(key); + + // Mix the randomness into accumulated entropy. + mixkey(arc4.S, pool); + + // Override Math.random + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + math['random'] = function random() { // Closure to return a random double: + var n = arc4.g(chunks); // Start with a numerator n < 2 ^ 48 + var d = startdenom; // and denominator d = 2 ^ 48. + var x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + // Return the seed that was used + return seed; + }; + + // + // ARC4 + // + // An ARC4 implementation. The constructor takes a key in the form of + // an array of at most (width) integers that should be 0 <= x < (width). + // + // The g(count) method returns a pseudorandom integer that concatenates + // the next (count) outputs from ARC4. Its return value is a number x + // that is in the range 0 <= x < (width ^ count). + // + /** @constructor */ + + function ARC4(key) { + var t, u, me = this, + keylen = key.length; + var i = 0, + j = me.i = me.j = me.m = 0; + me.S = []; + me.c = []; + + // The empty key [] is treated as [0]. + if (!keylen) { + key = [keylen++]; + } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + me.S[i] = i++; + } + for (i = 0; i < width; i++) { + t = me.S[i]; + j = lowbits(j + t + key[i % keylen]); + u = me.S[j]; + me.S[i] = u; + me.S[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + me.g = function getnext(count) { + var s = me.S; + var i = lowbits(me.i + 1); + var t = s[i]; + var j = lowbits(me.j + t); + var u = s[j]; + s[i] = u; + s[j] = t; + var r = s[lowbits(t + u)]; + while (--count) { + i = lowbits(i + 1); + t = s[i]; + j = lowbits(j + t); + u = s[j]; + s[i] = u; + s[j] = t; + r = r * width + s[lowbits(t + u)]; + } + me.i = i; + me.j = j; + return r; + }; + // For robust unpredictability discard an initial batch of values. + // See http://www.rsa.com/rsalabs/node.asp?id=2009 + me.g(width); + } + + // + // flatten() + // Converts an object tree to nested arrays of strings. + // + /** @param {Object=} result + * @param {string=} prop + * @param {string=} typ */ + + function flatten(obj, depth, result, prop, typ) { + result = []; + typ = typeof (obj); + if (depth && typ == 'object') { + for (prop in obj) { + if (prop.indexOf('S') < 5) { // Avoid FF3 bug (local/sessionStorage) + try { + result.push(flatten(obj[prop], depth - 1)); + } + catch (e) { + } + } + } + } + return (result.length ? result : obj + (typ != 'string' ? '\0' : '')); + } + + // + // mixkey() + // Mixes a string seed into a key that is an array of integers, and + // returns a shortened string seed that is equivalent to the result key. + // + /** @param {number=} smear + * @param {number=} j */ + + function mixkey(seed, key, smear, j) { + seed += ''; // Ensure the seed is a string + smear = 0; + for (j = 0; j < seed.length; j++) { + key[lowbits(j)] = lowbits((smear ^= key[lowbits(j)] * 19) + seed.charCodeAt(j)); + } + seed = ''; + for (j in key) { + seed += String.fromCharCode(key[j]); + } + return seed; + } + + // + // lowbits() + // A quick "n mod width" for width a power of 2. + // + + + function lowbits(n) { + return n & (width - 1); + } + + // + // The following constants are related to IEEE 754 limits. + // + startdenom = math.pow(width, chunks); + significance = math.pow(2, significance); + overflow = significance * 2; + + // + // When seedrandom.js is loaded, we immediately mix a few bits + // from the built-in RNG into the entropy pool. Because we do + // not want to intefere with determinstic PRNG state later, + // seedrandom will not call math.random on its own again after + // initialization. + // + mixkey(math.random(), pool); + + // End anonymous scope, and pass initial values. +})([], // pool: entropy pool starts empty + Math, // math: package containing random, pow, and seedrandom + 256, // width: each RC4 output is 0 <= x < 256 + 6, // chunks: at least six RC4 outputs for each double + 52 // significance: there are 52 significant digits in a double +); + + +// This is not really a random number generator object, and two SeededRandom +// objects will conflict with one another, but it's good enough for generating +// the rsa key. +function SeededRandom() { +} + +function SRnextBytes(ba) { + var i; + for (i = 0; i < ba.length; i++) { + ba[i] = Math.floor(Math.random() * 256); + } +} + +SeededRandom.prototype.nextBytes = SRnextBytes; + +// prng4.js - uses Arcfour as a PRNG + +function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); +} + +// Initialize arcfour context from key, an array of ints, each from [0..255] +function ARC4init(key) { + var i, j, t; + for (i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for (i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; +} + +function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; +} + +Arcfour.prototype.init = ARC4init; +Arcfour.prototype.next = ARC4next; + +// Plug in your RNG constructor here +function prng_newstate() { + return new Arcfour(); +} + +// Pool size must be a multiple of 4 and greater than 32. +// An array of bytes the size of the pool will be passed to init() +var rng_psize = 256; + +// Random number generator - requires a PRNG backend, e.g. prng4.js + +// For best results, put code like +// +// in your main HTML document. + +var rng_state; +var rng_pool; +var rng_pptr; + +// Mix in a 32-bit integer into the pool +function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if (rng_pptr >= rng_psize) rng_pptr -= rng_psize; +} + +// Mix in the current time (w/milliseconds) into the pool +function rng_seed_time() { + rng_seed_int(new Date().getTime()); +} + +// Initialize the pool with junk if needed. +if (rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if (navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for (t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + while (rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); +} + +function rng_get_byte() { + if (rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); +} + +function rng_get_bytes(ba) { + var i; + for (i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); +} + +function SecureRandom() { +} + +SecureRandom.prototype.nextBytes = rng_get_bytes; + + +/** + * + * Secure Hash Algorithm (SHA256) + * http://www.webtoolkit.info/ + * + * Original code by Angel Marin, Paul Johnston. + * + **/ + +function SHA256(s) { + + var chrsz = 8; + var hexcase = 0; + + function safe_add(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + function S(X, n) { + return (X >>> n) | (X << (32 - n)); + } + + function R(X, n) { + return (X >>> n); + } + + function Ch(x, y, z) { + return ((x & y) ^ ((~x) & z)); + } + + function Maj(x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); + } + + function Sigma0256(x) { + return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); + } + + function Sigma1256(x) { + return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); + } + + function Gamma0256(x) { + return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); + } + + function Gamma1256(x) { + return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); + } + + function core_sha256(m, l) { + var K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2); + var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); + var W = new Array(64); + var a, b, c, d, e, f, g, h, i, j; + var T1, T2; + + m[l >> 5] |= 0x80 << (24 - l % 32); + m[((l + 64 >> 9) << 4) + 15] = l; + + for (var i = 0; i < m.length; i += 16) { + a = HASH[0]; + b = HASH[1]; + c = HASH[2]; + d = HASH[3]; + e = HASH[4]; + f = HASH[5]; + g = HASH[6]; + h = HASH[7]; + + for (var j = 0; j < 64; j++) { + if (j < 16) W[j] = m[j + i]; + else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); + + T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); + T2 = safe_add(Sigma0256(a), Maj(a, b, c)); + + h = g; + g = f; + f = e; + e = safe_add(d, T1); + d = c; + c = b; + b = a; + a = safe_add(T1, T2); + } + + HASH[0] = safe_add(a, HASH[0]); + HASH[1] = safe_add(b, HASH[1]); + HASH[2] = safe_add(c, HASH[2]); + HASH[3] = safe_add(d, HASH[3]); + HASH[4] = safe_add(e, HASH[4]); + HASH[5] = safe_add(f, HASH[5]); + HASH[6] = safe_add(g, HASH[6]); + HASH[7] = safe_add(h, HASH[7]); + } + return HASH; + } + + function str2binb(str) { + var bin = Array(); + var mask = (1 << chrsz) - 1; + for (var i = 0; i < str.length * chrsz; i += chrsz) { + bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32); + } + return bin; + } + + function Utf8Encode(string) { + string = string.replace(/\r\n/g, "\n"); + var utftext = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } + else if ((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } + else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + + return utftext; + } + + function binb2hex(binarray) { + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; + var str = ""; + for (var i = 0; i < binarray.length * 4; i++) { + str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + + hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF); + } + return str; + } + + s = Utf8Encode(s); + return binb2hex(core_sha256(str2binb(s), s.length * chrsz)); +} + +var sha256 = {} +sha256.hex = function (s) { + return SHA256(s); +} + +/** + * + * Secure Hash Algorithm (SHA1) + * http://www.webtoolkit.info/ + * + **/ + +function SHA1(msg) { + + function rotate_left(n, s) { + var t4 = (n << s) | (n >>> (32 - s)); + return t4; + }; + + function lsb_hex(val) { + var str = ""; + var i; + var vh; + var vl; + + for (i = 0; i <= 6; i += 2) { + vh = (val >>> (i * 4 + 4)) & 0x0f; + vl = (val >>> (i * 4)) & 0x0f; + str += vh.toString(16) + vl.toString(16); + } + return str; + }; + + function cvt_hex(val) { + var str = ""; + var i; + var v; + + for (i = 7; i >= 0; i--) { + v = (val >>> (i * 4)) & 0x0f; + str += v.toString(16); + } + return str; + }; + + + function Utf8Encode(string) { + string = string.replace(/\r\n/g, "\n"); + var utftext = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } + else if ((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } + else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + + return utftext; + }; + + var blockstart; + var i, j; + var W = new Array(80); + var H0 = 0x67452301; + var H1 = 0xEFCDAB89; + var H2 = 0x98BADCFE; + var H3 = 0x10325476; + var H4 = 0xC3D2E1F0; + var A, B, C, D, E; + var temp; + + msg = Utf8Encode(msg); + + var msg_len = msg.length; + + var word_array = new Array(); + for (i = 0; i < msg_len - 3; i += 4) { + j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 | + msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3); + word_array.push(j); + } + + switch (msg_len % 4) { + case 0: + i = 0x080000000; + break; + case 1: + i = msg.charCodeAt(msg_len - 1) << 24 | 0x0800000; + break; + + case 2: + i = msg.charCodeAt(msg_len - 2) << 24 | msg.charCodeAt(msg_len - 1) << 16 | 0x08000; + break; + + case 3: + i = msg.charCodeAt(msg_len - 3) << 24 | msg.charCodeAt(msg_len - 2) << 16 | msg.charCodeAt(msg_len - 1) << 8 | 0x80; + break; + } + + word_array.push(i); + + while ((word_array.length % 16) != 14) word_array.push(0); + + word_array.push(msg_len >>> 29); + word_array.push((msg_len << 3) & 0x0ffffffff); + + + for (blockstart = 0; blockstart < word_array.length; blockstart += 16) { + + for (i = 0; i < 16; i++) W[i] = word_array[blockstart + i]; + for (i = 16; i <= 79; i++) W[i] = rotate_left(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); + + A = H0; + B = H1; + C = H2; + D = H3; + E = H4; + + for (i = 0; i <= 19; i++) { + temp = (rotate_left(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff; + E = D; + D = C; + C = rotate_left(B, 30); + B = A; + A = temp; + } + + for (i = 20; i <= 39; i++) { + temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff; + E = D; + D = C; + C = rotate_left(B, 30); + B = A; + A = temp; + } + + for (i = 40; i <= 59; i++) { + temp = (rotate_left(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff; + E = D; + D = C; + C = rotate_left(B, 30); + B = A; + A = temp; + } + + for (i = 60; i <= 79; i++) { + temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff; + E = D; + D = C; + C = rotate_left(B, 30); + B = A; + A = temp; + } + + H0 = (H0 + A) & 0x0ffffffff; + H1 = (H1 + B) & 0x0ffffffff; + H2 = (H2 + C) & 0x0ffffffff; + H3 = (H3 + D) & 0x0ffffffff; + H4 = (H4 + E) & 0x0ffffffff; + + } + + var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4); + + return temp.toLowerCase(); + +} + +var sha1 = {} +sha1.hex = function (s) { + return SHA1(s); +} + +/** + * + * MD5 (Message-Digest Algorithm) + * http://www.webtoolkit.info/ + * + **/ + +var MD5 = function (string) { + + function RotateLeft(lValue, iShiftBits) { + return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); + } + + function AddUnsigned(lX, lY) { + var lX4, lY4, lX8, lY8, lResult; + lX8 = (lX & 0x80000000); + lY8 = (lY & 0x80000000); + lX4 = (lX & 0x40000000); + lY4 = (lY & 0x40000000); + lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); + if (lX4 & lY4) { + return (lResult ^ 0x80000000 ^ lX8 ^ lY8); + } + if (lX4 | lY4) { + if (lResult & 0x40000000) { + return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); + } else { + return (lResult ^ 0x40000000 ^ lX8 ^ lY8); + } + } else { + return (lResult ^ lX8 ^ lY8); + } + } + + function F(x, y, z) { + return (x & y) | ((~x) & z); + } + + function G(x, y, z) { + return (x & z) | (y & (~z)); + } + + function H(x, y, z) { + return (x ^ y ^ z); + } + + function I(x, y, z) { + return (y ^ (x | (~z))); + } + + function FF(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + function GG(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + function HH(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + function II(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + function ConvertToWordArray(string) { + var lWordCount; + var lMessageLength = string.length; + var lNumberOfWords_temp1 = lMessageLength + 8; + var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; + var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; + var lWordArray = Array(lNumberOfWords - 1); + var lBytePosition = 0; + var lByteCount = 0; + while (lByteCount < lMessageLength) { + lWordCount = (lByteCount - (lByteCount % 4)) / 4; + lBytePosition = (lByteCount % 4) * 8; + lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); + lByteCount++; + } + lWordCount = (lByteCount - (lByteCount % 4)) / 4; + lBytePosition = (lByteCount % 4) * 8; + lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); + lWordArray[lNumberOfWords - 2] = lMessageLength << 3; + lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; + return lWordArray; + }; + + function WordToHex(lValue) { + var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount; + for (lCount = 0; lCount <= 3; lCount++) { + lByte = (lValue >>> (lCount * 8)) & 255; + WordToHexValue_temp = "0" + lByte.toString(16); + WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2); + } + return WordToHexValue; + }; + + function Utf8Encode(string) { + string = string.replace(/\r\n/g, "\n"); + var utftext = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } + else if ((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } + else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + + return utftext; + }; + + var x = Array(); + var k, AA, BB, CC, DD, a, b, c, d; + var S11 = 7, S12 = 12, S13 = 17, S14 = 22; + var S21 = 5, S22 = 9, S23 = 14, S24 = 20; + var S31 = 4, S32 = 11, S33 = 16, S34 = 23; + var S41 = 6, S42 = 10, S43 = 15, S44 = 21; + + string = Utf8Encode(string); + + x = ConvertToWordArray(string); + + a = 0x67452301; + b = 0xEFCDAB89; + c = 0x98BADCFE; + d = 0x10325476; + + for (k = 0; k < x.length; k += 16) { + AA = a; + BB = b; + CC = c; + DD = d; + a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); + d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); + c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); + b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); + a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); + d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); + c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); + b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); + a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); + d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); + c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); + b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); + a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); + d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); + c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); + b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); + a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); + d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); + c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); + b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); + a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); + d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); + c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); + b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); + a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); + d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); + c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); + b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); + a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); + d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); + c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); + b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); + a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); + d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); + c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); + b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); + a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); + d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); + c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); + b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); + a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); + d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); + c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); + b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); + a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); + d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); + c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); + b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); + a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); + d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); + c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); + b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); + a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); + d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); + c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); + b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); + a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); + d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); + c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); + b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); + a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); + d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); + c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); + b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); + a = AddUnsigned(a, AA); + b = AddUnsigned(b, BB); + c = AddUnsigned(c, CC); + d = AddUnsigned(d, DD); + } + + var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); + + return temp.toLowerCase(); +} + +// Depends on jsbn.js and rng.js +// Version 1.1: support utf-8 encoding in pkcs1pad2 +// convert a (hex) string to a bignum object + + +function parseBigInt(str, r) { + return new BigInteger(str, r); +} + +function linebrk(s, n) { + var ret = ""; + var i = 0; + while (i + n < s.length) { + ret += s.substring(i, i + n) + "\n"; + i += n; + } + return ret + s.substring(i, s.length); +} + +function byte2Hex(b) { + if (b < 0x10) return "0" + b.toString(16); + else return b.toString(16); +} + +// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint + + +function pkcs1pad2(s, n) { + if (n < s.length + 11) { // TODO: fix for utf-8 + //alert("Message too long for RSA (n=" + n + ", l=" + s.length + ")"); + //return null; + throw "Message too long for RSA (n=" + n + ", l=" + s.length + ")"; + } + var ba = new Array(); + var i = s.length - 1; + while (i >= 0 && n > 0) { + var c = s.charCodeAt(i--); + if (c < 128) { // encode using utf-8 + ba[--n] = c; + } + else if ((c > 127) && (c < 2048)) { + ba[--n] = (c & 63) | 128; + ba[--n] = (c >> 6) | 192; + } + else { + ba[--n] = (c & 63) | 128; + ba[--n] = ((c >> 6) & 63) | 128; + ba[--n] = (c >> 12) | 224; + } + } + ba[--n] = 0; + var rng = new SecureRandom(); + var x = new Array(); + while (n > 2) { // random non-zero pad + x[0] = 0; + while (x[0] == 0) rng.nextBytes(x); + ba[--n] = x[0]; + } + ba[--n] = 2; + ba[--n] = 0; + return new BigInteger(ba); +} + +// "empty" RSA key constructor + + +function RSAKey() { + this.n = null; + this.e = 0; + this.d = null; + this.p = null; + this.q = null; + this.dmp1 = null; + this.dmq1 = null; + this.coeff = null; +} + +// Set the public key fields N and e from hex strings + + +function RSASetPublic(N, E) { + if (N != null && E != null && N.length > 0 && E.length > 0) { + this.n = parseBigInt(N, 16); + this.e = parseInt(E, 16); + } + else alert("Invalid RSA public key"); +} + +// Perform raw public operation on "x": return x^e (mod n) + + +function RSADoPublic(x) { + return x.modPowInt(this.e, this.n); +} + +// Return the PKCS#1 RSA encryption of "text" as an even-length hex string + + +function RSAEncrypt(text) { + var m = pkcs1pad2(text, (this.n.bitLength() + 7) >> 3); + if (m == null) return null; + var c = this.doPublic(m); + if (c == null) return null; + var h = c.toString(16); + if ((h.length & 1) == 0) return h; + else return "0" + h; +} + +// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string +//function RSAEncryptB64(text) { +// var h = this.encrypt(text); +// if(h) return hex2b64(h); else return null; +//} +// protected +RSAKey.prototype.doPublic = RSADoPublic; + +// public +RSAKey.prototype.setPublic = RSASetPublic; +RSAKey.prototype.encrypt = RSAEncrypt; + +// Version 1.1: support utf-8 decoding in pkcs1unpad2 +// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext + +function pkcs1unpad2(d, n) { + var b = d.toByteArray(); + var i = 0; + while (i < b.length && b[i] == 0) ++i; + if (b.length - i != n - 1 || b[i] != 2) return null; + ++i; + while (b[i] != 0) + if (++i >= b.length) return null; + var ret = ""; + while (++i < b.length) { + var c = b[i] & 255; + if (c < 128) { // utf-8 decode + ret += String.fromCharCode(c); + } + else if ((c > 191) && (c < 224)) { + ret += String.fromCharCode(((c & 31) << 6) | (b[i + 1] & 63)); + ++i; + } + else { + ret += String.fromCharCode(((c & 15) << 12) | ((b[i + 1] & 63) << 6) | (b[i + 2] & 63)); + i += 2; + } + } + return ret; +} + +// Set the private key fields N, e, and d from hex strings +function RSASetPrivate(N, E, D) { + if (N != null && E != null && N.length > 0 && E.length > 0) { + this.n = parseBigInt(N, 16); + this.e = parseInt(E, 16); + this.d = parseBigInt(D, 16); + } + else alert("Invalid RSA private key"); +} + +// Set the private key fields N, e, d and CRT params from hex strings +function RSASetPrivateEx(N, E, D, P, Q, DP, DQ, C) { + if (N != null && E != null && N.length > 0 && E.length > 0) { + this.n = parseBigInt(N, 16); + this.e = parseInt(E, 16); + this.d = parseBigInt(D, 16); + this.p = parseBigInt(P, 16); + this.q = parseBigInt(Q, 16); + this.dmp1 = parseBigInt(DP, 16); + this.dmq1 = parseBigInt(DQ, 16); + this.coeff = parseBigInt(C, 16); + } + else alert("Invalid RSA private key"); +} + +// Generate a new random private key B bits long, using public expt E +function RSAGenerate(B, E) { + var rng = new SeededRandom(); + var qs = B >> 1; + this.e = parseInt(E, 16); + var ee = new BigInteger(E, 16); + for (; ;) { + for (; ;) { + this.p = new BigInteger(B - qs, 1, rng); + if (this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break; + } + for (; ;) { + this.q = new BigInteger(qs, 1, rng); + if (this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break; + } + if (this.p.compareTo(this.q) <= 0) { + var t = this.p; + this.p = this.q; + this.q = t; + } + var p1 = this.p.subtract(BigInteger.ONE); + var q1 = this.q.subtract(BigInteger.ONE); + var phi = p1.multiply(q1); + if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0) { + this.n = this.p.multiply(this.q); + this.d = ee.modInverse(phi); + this.dmp1 = this.d.mod(p1); + this.dmq1 = this.d.mod(q1); + this.coeff = this.q.modInverse(this.p); + break; + } + } +} + +// Perform raw private operation on "x": return x^d (mod n) +function RSADoPrivate(x) { + if (this.p == null || this.q == null) return x.modPow(this.d, this.n); + // TODO: re-calculate any missing CRT params + var xp = x.mod(this.p).modPow(this.dmp1, this.p); + var xq = x.mod(this.q).modPow(this.dmq1, this.q); + while (xp.compareTo(xq) < 0) + xp = xp.add(this.p); + return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq); +} + +// Return the PKCS#1 RSA decryption of "ctext". +// "ctext" is an even-length hex string and the output is a plain string. +function RSADecrypt(ctext) { + var c = parseBigInt(ctext, 16); + var m = this.doPrivate(c); + if (m == null) return null; + return pkcs1unpad2(m, (this.n.bitLength() + 7) >> 3); +} + +// protected +RSAKey.prototype.doPrivate = RSADoPrivate; + +// public +RSAKey.prototype.setPrivate = RSASetPrivate; +RSAKey.prototype.setPrivateEx = RSASetPrivateEx; +RSAKey.prototype.generate = RSAGenerate; +RSAKey.prototype.decrypt = RSADecrypt; + + +// +// rsa-sign.js - adding signing functions to RSAKey class. +// +// +// version: 1.0 (2010-Jun-03) +// +// Copyright (c) 2010 Kenji Urushima (kenji.urushima@gmail.com) +// +// This software is licensed under the terms of the MIT License. +// http://www.opensource.org/licenses/mit-license.php +// +// The above copyright and license notice shall be +// included in all copies or substantial portions of the Software. +// +// Depends on: +// function sha1.hex(s) of sha1.js +// jsbn.js +// jsbn2.js +// rsa.js +// rsa2.js +// +// keysize / pmstrlen +// 512 / 128 +// 1024 / 256 +// 2048 / 512 +// 4096 / 1024 +// As for _RSASGIN_DIHEAD values for each hash algorithm, see PKCS#1 v2.1 spec (p38). +var _RSASIGN_DIHEAD = []; +_RSASIGN_DIHEAD['sha1'] = "3021300906052b0e03021a05000414"; +_RSASIGN_DIHEAD['sha256'] = "3031300d060960864801650304020105000420"; +//_RSASIGN_DIHEAD['md2'] = "3020300c06082a864886f70d020205000410"; +//_RSASIGN_DIHEAD['md5'] = "3020300c06082a864886f70d020505000410"; +//_RSASIGN_DIHEAD['sha384'] = "3041300d060960864801650304020205000430"; +//_RSASIGN_DIHEAD['sha512'] = "3051300d060960864801650304020305000440"; +var _RSASIGN_HASHHEXFUNC = []; +_RSASIGN_HASHHEXFUNC['sha1'] = sha1.hex; +_RSASIGN_HASHHEXFUNC['sha256'] = sha256.hex; + +// ======================================================================== +// Signature Generation +// ======================================================================== + +function _rsasign_getHexPaddedDigestInfoForString(s, keySize, hashAlg) { + var pmStrLen = keySize / 4; + var hashFunc = _RSASIGN_HASHHEXFUNC[hashAlg]; + var sHashHex = hashFunc(s); + + var sHead = "0001"; + var sTail = "00" + _RSASIGN_DIHEAD[hashAlg] + sHashHex; + var sMid = ""; + var fLen = pmStrLen - sHead.length - sTail.length; + for (var i = 0; i < fLen; i += 2) { + sMid += "ff"; + } + sPaddedMessageHex = sHead + sMid + sTail; + return sPaddedMessageHex; +} + +function _rsasign_signString(s, hashAlg) { + var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), hashAlg); + var biPaddedMessage = parseBigInt(hPM, 16); + var biSign = this.doPrivate(biPaddedMessage); + var hexSign = biSign.toString(16); + return hexSign; +} + +function _rsasign_signStringWithSHA1(s) { + var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), 'sha1'); + var biPaddedMessage = parseBigInt(hPM, 16); + var biSign = this.doPrivate(biPaddedMessage); + var hexSign = biSign.toString(16); + return hexSign; +} + +function _rsasign_signStringWithSHA256(s) { + var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), 'sha256'); + var biPaddedMessage = parseBigInt(hPM, 16); + var biSign = this.doPrivate(biPaddedMessage); + var hexSign = biSign.toString(16); + return hexSign; +} + +// ======================================================================== +// Signature Verification +// ======================================================================== + +function _rsasign_getDecryptSignatureBI(biSig, hN, hE) { + var rsa = new RSAKey(); + rsa.setPublic(hN, hE); + var biDecryptedSig = rsa.doPublic(biSig); + return biDecryptedSig; +} + +function _rsasign_getHexDigestInfoFromSig(biSig, hN, hE) { + var biDecryptedSig = _rsasign_getDecryptSignatureBI(biSig, hN, hE); + var hDigestInfo = biDecryptedSig.toString(16).replace(/^1f+00/, ''); + return hDigestInfo; +} + +function _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo) { + for (var algName in _RSASIGN_DIHEAD) { + var head = _RSASIGN_DIHEAD[algName]; + var len = head.length; + if (hDigestInfo.substring(0, len) == head) { + var a = [algName, hDigestInfo.substring(len)]; + return a; + } + } + return []; +} + +function _rsasign_verifySignatureWithArgs(sMsg, biSig, hN, hE) { + var hDigestInfo = _rsasign_getHexDigestInfoFromSig(biSig, hN, hE); + var digestInfoAry = _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo); + if (digestInfoAry.length == 0) return false; + var algName = digestInfoAry[0]; + var diHashValue = digestInfoAry[1]; + var ff = _RSASIGN_HASHHEXFUNC[algName]; + var msgHashValue = ff(sMsg); + return (diHashValue == msgHashValue); +} + +function _rsasign_verifyHexSignatureForMessage(hSig, sMsg) { + var biSig = parseBigInt(hSig, 16); + var result = _rsasign_verifySignatureWithArgs(sMsg, biSig, this.n.toString(16), this.e.toString(16)); + return result; +} + +function _rsasign_verifyString(sMsg, hSig) { + hSig = hSig.replace(/[ \n]+/g, ""); + var biSig = parseBigInt(hSig, 16); + var biDecryptedSig = this.doPublic(biSig); + var hDigestInfo = biDecryptedSig.toString(16).replace(/^1f+00/, ''); + var digestInfoAry = _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo); + + if (digestInfoAry.length == 0) return false; + var algName = digestInfoAry[0]; + var diHashValue = digestInfoAry[1]; + var ff = _RSASIGN_HASHHEXFUNC[algName]; + var msgHashValue = ff(sMsg); + return (diHashValue == msgHashValue); +} + +RSAKey.prototype.signString = _rsasign_signString; +RSAKey.prototype.signStringWithSHA1 = _rsasign_signStringWithSHA1; +RSAKey.prototype.signStringWithSHA256 = _rsasign_signStringWithSHA256; + +RSAKey.prototype.verifyString = _rsasign_verifyString; +RSAKey.prototype.verifyHexSignatureForMessage = _rsasign_verifyHexSignatureForMessage; + +/* + * jsaes version 0.1 - Copyright 2006 B. Poettering + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307 USA + */ + +// later modifications by wwwtyro@github + +var aes = (function () { + + var my = {}; + + my.Sbox = new Array(99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22); + + my.ShiftRowTab = new Array(0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11); + + my.Init = function () { + my.Sbox_Inv = new Array(256); + for (var i = 0; i < 256; i++) + my.Sbox_Inv[my.Sbox[i]] = i; + + my.ShiftRowTab_Inv = new Array(16); + for (var i = 0; i < 16; i++) + my.ShiftRowTab_Inv[my.ShiftRowTab[i]] = i; + + my.xtime = new Array(256); + for (var i = 0; i < 128; i++) { + my.xtime[i] = i << 1; + my.xtime[128 + i] = (i << 1) ^ 0x1b; + } + } + + my.Done = function () { + delete my.Sbox_Inv; + delete my.ShiftRowTab_Inv; + delete my.xtime; + } + + my.ExpandKey = function (key) { + var kl = key.length, + ks, Rcon = 1; + switch (kl) { + case 16: + ks = 16 * (10 + 1); + break; + case 24: + ks = 16 * (12 + 1); + break; + case 32: + ks = 16 * (14 + 1); + break; + default: + alert("my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!"); + } + for (var i = kl; i < ks; i += 4) { + var temp = key.slice(i - 4, i); + if (i % kl == 0) { + temp = new Array(my.Sbox[temp[1]] ^ Rcon, my.Sbox[temp[2]], my.Sbox[temp[3]], my.Sbox[temp[0]]); + if ((Rcon <<= 1) >= 256) Rcon ^= 0x11b; + } + else if ((kl > 24) && (i % kl == 16)) temp = new Array(my.Sbox[temp[0]], my.Sbox[temp[1]], my.Sbox[temp[2]], my.Sbox[temp[3]]); + for (var j = 0; j < 4; j++) + key[i + j] = key[i + j - kl] ^ temp[j]; + } + } + + my.Encrypt = function (block, key) { + var l = key.length; + my.AddRoundKey(block, key.slice(0, 16)); + for (var i = 16; i < l - 16; i += 16) { + my.SubBytes(block, my.Sbox); + my.ShiftRows(block, my.ShiftRowTab); + my.MixColumns(block); + my.AddRoundKey(block, key.slice(i, i + 16)); + } + my.SubBytes(block, my.Sbox); + my.ShiftRows(block, my.ShiftRowTab); + my.AddRoundKey(block, key.slice(i, l)); + } + + my.Decrypt = function (block, key) { + var l = key.length; + my.AddRoundKey(block, key.slice(l - 16, l)); + my.ShiftRows(block, my.ShiftRowTab_Inv); + my.SubBytes(block, my.Sbox_Inv); + for (var i = l - 32; i >= 16; i -= 16) { + my.AddRoundKey(block, key.slice(i, i + 16)); + my.MixColumns_Inv(block); + my.ShiftRows(block, my.ShiftRowTab_Inv); + my.SubBytes(block, my.Sbox_Inv); + } + my.AddRoundKey(block, key.slice(0, 16)); + } + + my.SubBytes = function (state, sbox) { + for (var i = 0; i < 16; i++) + state[i] = sbox[state[i]]; + } + + my.AddRoundKey = function (state, rkey) { + for (var i = 0; i < 16; i++) + state[i] ^= rkey[i]; + } + + my.ShiftRows = function (state, shifttab) { + var h = new Array().concat(state); + for (var i = 0; i < 16; i++) + state[i] = h[shifttab[i]]; + } + + my.MixColumns = function (state) { + for (var i = 0; i < 16; i += 4) { + var s0 = state[i + 0], + s1 = state[i + 1]; + var s2 = state[i + 2], + s3 = state[i + 3]; + var h = s0 ^ s1 ^ s2 ^ s3; + state[i + 0] ^= h ^ my.xtime[s0 ^ s1]; + state[i + 1] ^= h ^ my.xtime[s1 ^ s2]; + state[i + 2] ^= h ^ my.xtime[s2 ^ s3]; + state[i + 3] ^= h ^ my.xtime[s3 ^ s0]; + } + } + + my.MixColumns_Inv = function (state) { + for (var i = 0; i < 16; i += 4) { + var s0 = state[i + 0], + s1 = state[i + 1]; + var s2 = state[i + 2], + s3 = state[i + 3]; + var h = s0 ^ s1 ^ s2 ^ s3; + var xh = my.xtime[h]; + var h1 = my.xtime[my.xtime[xh ^ s0 ^ s2]] ^ h; + var h2 = my.xtime[my.xtime[xh ^ s1 ^ s3]] ^ h; + state[i + 0] ^= h1 ^ my.xtime[s0 ^ s1]; + state[i + 1] ^= h2 ^ my.xtime[s1 ^ s2]; + state[i + 2] ^= h1 ^ my.xtime[s2 ^ s3]; + state[i + 3] ^= h2 ^ my.xtime[s3 ^ s0]; + } + } + + return my; + +}()); + + +var cryptico = (function () { + + var my = {}; + + aes.Init(); + + var base64Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + my.b256to64 = function (t) { + var a, c, n; + var r = '', l = 0, s = 0; + var tl = t.length; + for (n = 0; n < tl; n++) { + c = t.charCodeAt(n); + if (s == 0) { + r += base64Chars.charAt((c >> 2) & 63); + a = (c & 3) << 4; + } + else if (s == 1) { + r += base64Chars.charAt((a | (c >> 4) & 15)); + a = (c & 15) << 2; + } + else if (s == 2) { + r += base64Chars.charAt(a | ((c >> 6) & 3)); + l += 1; + r += base64Chars.charAt(c & 63); + } + l += 1; + s += 1; + if (s == 3) s = 0; + } + if (s > 0) { + r += base64Chars.charAt(a); + l += 1; + r += '='; + l += 1; + } + if (s == 1) { + r += '='; + } + return r; + } + + my.b64to256 = function (t) { + var c, n; + var r = '', s = 0, a = 0; + var tl = t.length; + for (n = 0; n < tl; n++) { + c = base64Chars.indexOf(t.charAt(n)); + if (c >= 0) { + if (s) r += String.fromCharCode(a | (c >> (6 - s)) & 255); + s = (s + 2) & 7; + a = (c << s) & 255; + } + } + return r; + } + + my.b16to64 = function (h) { + var i; + var c; + var ret = ""; + if (h.length % 2 == 1) { + h = "0" + h; + } + for (i = 0; i + 3 <= h.length; i += 3) { + c = parseInt(h.substring(i, i + 3), 16); + ret += base64Chars.charAt(c >> 6) + base64Chars.charAt(c & 63); + } + if (i + 1 == h.length) { + c = parseInt(h.substring(i, i + 1), 16); + ret += base64Chars.charAt(c << 2); + } + else if (i + 2 == h.length) { + c = parseInt(h.substring(i, i + 2), 16); + ret += base64Chars.charAt(c >> 2) + base64Chars.charAt((c & 3) << 4); + } + while ((ret.length & 3) > 0) ret += "="; + return ret; + } + + my.b64to16 = function (s) { + var ret = ""; + var i; + var k = 0; + var slop; + for (i = 0; i < s.length; ++i) { + if (s.charAt(i) == "=") break; + v = base64Chars.indexOf(s.charAt(i)); + if (v < 0) continue; + if (k == 0) { + ret += int2char(v >> 2); + slop = v & 3; + k = 1; + } + else if (k == 1) { + ret += int2char((slop << 2) | (v >> 4)); + slop = v & 0xf; + k = 2; + } + else if (k == 2) { + ret += int2char(slop); + ret += int2char(v >> 2); + slop = v & 3; + k = 3; + } + else { + ret += int2char((slop << 2) | (v >> 4)); + ret += int2char(v & 0xf); + k = 0; + } + } + if (k == 1) ret += int2char(slop << 2); + return ret; + } + + // Converts a string to a byte array. + my.string2bytes = function (string) { + var bytes = new Array(); + for (var i = 0; i < string.length; i++) { + bytes.push(string.charCodeAt(i)); + } + return bytes; + } + + // Converts a byte array to a string. + my.bytes2string = function (bytes) { + var string = ""; + for (var i = 0; i < bytes.length; i++) { + string += String.fromCharCode(bytes[i]); + } + return string; + } + + // Returns a XOR b, where a and b are 16-byte byte arrays. + my.blockXOR = function (a, b) { + var xor = new Array(16); + for (var i = 0; i < 16; i++) { + xor[i] = a[i] ^ b[i]; + } + return xor; + } + + // Returns a 16-byte initialization vector. + my.blockIV = function () { + var r = new SecureRandom(); + var IV = new Array(16); + r.nextBytes(IV); + return IV; + } + + // Returns a copy of bytes with zeros appended to the end + // so that the (length of bytes) % 16 == 0. + my.pad16 = function (bytes) { + var newBytes = bytes.slice(0); + var padding = (16 - (bytes.length % 16)) % 16; + for (i = bytes.length; i < bytes.length + padding; i++) { + newBytes.push(0); + } + return newBytes; + } + + // Removes trailing zeros from a byte array. + my.depad = function (bytes) { + var newBytes = bytes.slice(0); + while (newBytes[newBytes.length - 1] == 0) { + newBytes = newBytes.slice(0, newBytes.length - 1); + } + return newBytes; + } + + // AES CBC Encryption. + my.encryptAESCBC = function (plaintext, key) { + var exkey = key.slice(0); + aes.ExpandKey(exkey); + var blocks = my.string2bytes(plaintext); + blocks = my.pad16(blocks); + var encryptedBlocks = my.blockIV(); + for (var i = 0; i < blocks.length / 16; i++) { + var tempBlock = blocks.slice(i * 16, i * 16 + 16); + var prevBlock = encryptedBlocks.slice((i) * 16, (i) * 16 + 16); + tempBlock = my.blockXOR(prevBlock, tempBlock); + aes.Encrypt(tempBlock, exkey); + encryptedBlocks = encryptedBlocks.concat(tempBlock); + } + var ciphertext = my.bytes2string(encryptedBlocks); + return my.b256to64(ciphertext) + } + + // AES CBC Decryption. + my.decryptAESCBC = function (encryptedText, key) { + var exkey = key.slice(0); + aes.ExpandKey(exkey); + var encryptedText = my.b64to256(encryptedText); + var encryptedBlocks = my.string2bytes(encryptedText); + var decryptedBlocks = new Array(); + for (var i = 1; i < encryptedBlocks.length / 16; i++) { + var tempBlock = encryptedBlocks.slice(i * 16, i * 16 + 16); + var prevBlock = encryptedBlocks.slice((i - 1) * 16, (i - 1) * 16 + 16); + aes.Decrypt(tempBlock, exkey); + tempBlock = my.blockXOR(prevBlock, tempBlock); + decryptedBlocks = decryptedBlocks.concat(tempBlock); + } + decryptedBlocks = my.depad(decryptedBlocks); + return my.bytes2string(decryptedBlocks); + } + + // Wraps a string to 60 characters. + my.wrap60 = function (string) { + var outstr = ""; + for (var i = 0; i < string.length; i++) { + if (i % 60 == 0 && i != 0) outstr += "\n"; + outstr += string[i]; + } + return outstr; + } + + // Generate a random key for the AES-encrypted message. + my.generateAESKey = function () { + var key = new Array(32); + var r = new SecureRandom(); + r.nextBytes(key); + return key; + } + + // Generates an RSA key from a passphrase. + my.generateRSAKey = function (passphrase, bitlength) { + Math.seedrandom(sha256.hex(passphrase)); + var rsa = new RSAKey(); + rsa.generate(bitlength, "03"); + return rsa; + } + + // Returns the ascii-armored version of the public key. + my.publicKeyString = function (rsakey) { + pubkey = my.b16to64(rsakey.n.toString(16)); + return pubkey; + } + + // Returns an MD5 sum of a publicKeyString for easier identification. + my.publicKeyID = function (publicKeyString) { + return MD5(publicKeyString); + } + + my.publicKeyFromString = function (string) { + var N = my.b64to16(string.split("|")[0]); + var E = "03"; + var rsa = new RSAKey(); + rsa.setPublic(N, E); + return rsa + } + + my.encrypt = function (plaintext, publickeystring, signingkey) { + var cipherblock = ""; + var aeskey = my.generateAESKey(); + try { + var publickey = my.publicKeyFromString(publickeystring); + cipherblock += my.b16to64(publickey.encrypt(my.bytes2string(aeskey))) + "?"; + } + catch (err) { + return {status: "Invalid public key"}; + } + if (signingkey) { + signString = cryptico.b16to64(signingkey.signString(plaintext, "sha256")); + plaintext += "::52cee64bb3a38f6403386519a39ac91c::"; + plaintext += cryptico.publicKeyString(signingkey); + plaintext += "::52cee64bb3a38f6403386519a39ac91c::"; + plaintext += signString; + } + cipherblock += my.encryptAESCBC(plaintext, aeskey); + return {status: "success", cipher: cipherblock}; + } + + my.decrypt = function (ciphertext, key) { + var cipherblock = ciphertext.split("?"); + var aeskey = key.decrypt(my.b64to16(cipherblock[0])); + if (aeskey == null) { + return {status: "failure"}; + } + aeskey = my.string2bytes(aeskey); + var plaintext = my.decryptAESCBC(cipherblock[1], aeskey).split("::52cee64bb3a38f6403386519a39ac91c::"); + if (plaintext.length == 3) { + var publickey = my.publicKeyFromString(plaintext[1]); + var signature = my.b64to16(plaintext[2]); + if (publickey.verifyString(plaintext[0], signature)) { + return { + status: "success", + plaintext: plaintext[0], + signature: "verified", + publicKeyString: my.publicKeyString(publickey) + }; + } + else { + return { + status: "success", + plaintext: plaintext[0], + signature: "forged", + publicKeyString: my.publicKeyString(publickey) + }; + } + } + else { + return {status: "success", plaintext: plaintext[0], signature: "unsigned"}; + } + } + + return my; + }()); \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/fontawesome.js b/main/app/sprinkles/core/assets/SiteAssets/js/fontawesome.js index 497accc..bff7ed3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/js/fontawesome.js +++ b/main/app/sprinkles/core/assets/SiteAssets/js/fontawesome.js @@ -1,5 +1,5 @@ -/*! - * Font Awesome Free 5.0.10 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */ +/*! + * Font Awesome Free 5.0.10 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + */ !function(){"use strict";var c={};try{"undefined"!=typeof window&&(c=window)}catch(c){}var l=(c.navigator||{}).userAgent,h=void 0===l?"":l,v=c,z=(~h.indexOf("MSIE")||h.indexOf("Trident/"),"___FONT_AWESOME___"),e=function(){try{return!0}catch(c){return!1}}(),a=[1,2,3,4,5,6,7,8,9,10],m=a.concat([11,12,13,14,15,16,17,18,19,20]);["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter"].concat(a.map(function(c){return c+"x"})).concat(m.map(function(c){return"w-"+c}));var s=v||{};s[z]||(s[z]={}),s[z].styles||(s[z].styles={}),s[z].hooks||(s[z].hooks={}),s[z].shims||(s[z].shims=[]);var t=s[z],f=Object.assign||function(c){for(var l=1;l>>0;h--;)l[h]=c[h];return l}function X(c){return c.classList?D(c.classList):(c.getAttribute("class")||"").split(" ").filter(function(c){return c})}function Y(c,l){var h,v=l.split("-"),z=v[0],e=v.slice(1).join("-");return z!==c||""===e||(h=e,~d.indexOf(h))?null:e}function U(c){return(""+c).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function K(h){return Object.keys(h||{}).reduce(function(c,l){return c+(l+": ")+h[l]+";"},"")}function G(c){return c.size!==I.size||c.x!==I.x||c.y!==I.y||c.rotate!==I.rotate||c.flipX||c.flipY}function J(c){var l=c.transform,h=c.containerWidth,v=c.iconWidth;return{outer:{transform:"translate("+h/2+" 256)"},inner:{transform:"translate("+32*l.x+", "+32*l.y+") "+" "+("scale("+l.size/16*(l.flipX?-1:1)+", "+l.size/16*(l.flipY?-1:1)+") ")+" "+("rotate("+l.rotate+" 0 0)")},path:{transform:"translate("+v/2*-1+" -256)"}}}var Q={x:0,y:0,width:"100%",height:"100%"},Z=function(c){var l=c.children,h=c.attributes,v=c.main,z=c.mask,e=c.transform,a=v.width,m=v.icon,s=z.width,t=z.icon,f=J({transform:e,containerWidth:s,iconWidth:a}),r={tag:"rect",attributes:k({},Q,{fill:"white"})},M={tag:"g",attributes:k({},f.inner),children:[{tag:"path",attributes:k({},m.attributes,f.path,{fill:"black"})}]},i={tag:"g",attributes:k({},f.outer),children:[M]},n="mask-"+B(),H="clip-"+B(),V={tag:"defs",children:[{tag:"clipPath",attributes:{id:H},children:[t]},{tag:"mask",attributes:k({},Q,{id:n,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[r,i]}]};return l.push(V,{tag:"rect",attributes:k({fill:"currentColor","clip-path":"url(#"+H+")",mask:"url(#"+n+")"},Q)}),{children:l,attributes:h}},$=function(c){var l=c.children,h=c.attributes,v=c.main,z=c.transform,e=K(c.styles);if(0"+a.map(uc).join("")+""}var dc=function(){};function pc(c){return"string"==typeof(c.getAttribute?c.getAttribute(g):null)}var bc={replace:function(c){var l=c[0],h=c[1].map(function(c){return uc(c)}).join("\n");if(l.parentNode&&l.outerHTML)l.outerHTML=h+(O.keepOriginalSource&&"svg"!==l.tagName.toLowerCase()?"\x3c!-- "+l.outerHTML+" --\x3e":"");else if(l.parentNode){var v=document.createElement("span");l.parentNode.replaceChild(v,l),v.outerHTML=h}},nest:function(c){var l=c[0],h=c[1];if(~X(l).indexOf(O.replacementClass))return bc.replace(c);var v=new RegExp(O.familyPrefix+"-.*");delete h[0].attributes.style;var z=h[0].attributes.class.split(" ").reduce(function(c,l){return l===O.replacementClass||l.match(v)?c.toSvg.push(l):c.toNode.push(l),c},{toNode:[],toSvg:[]});h[0].attributes.class=z.toSvg.join(" ");var e=h.map(function(c){return uc(c)}).join("\n");l.setAttribute("class",z.toNode.join(" ")),l.setAttribute(g,""),l.innerHTML=e}};function gc(h,c){var v="function"==typeof c?c:dc;0===h.length?v():(m.requestAnimationFrame||function(c){return c()})(function(){var c=!0===O.autoReplaceSvg?bc.replace:bc[O.autoReplaceSvg]||bc.replace,l=sc.begin("mutate");h.map(c),l(),v()})}var yc=!1;var wc=null;var kc=function(c){var l=c.getAttribute("style"),h=[];return l&&(h=l.split(";").reduce(function(c,l){var h=l.split(":"),v=h[0],z=h.slice(1);return v&&0li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1em}.svg-inline--fa.fa-stack-2x{height:2em;width:2em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}";if("fa"!==l||h!==c){var z=new RegExp("\\.fa\\-","g"),e=new RegExp("\\."+c,"g");v=v.replace(z,"."+l+"-").replace(e,"."+h)}return v};var Qc=function(){function c(){y(this,c),this.definitions={}}return w(c,[{key:"add",value:function(){for(var l=this,c=arguments.length,h=Array(c),v=0;va?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.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},m.extend=m.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||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},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=r(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(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[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=r(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&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","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}"+M+"?|("+M+")|.)","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)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(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||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(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 I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===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+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(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 ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&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=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(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 typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),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))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),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===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(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?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.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 fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.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},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.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=fb.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=fb.selectors={cacheLength:50,createPseudo:hb,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]||fb.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]&&fb.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("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.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+" ").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()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(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),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.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:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(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 sb(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 tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(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 vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(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?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(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 vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(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]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.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)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(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&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.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?m.extend(a,d):d}},e={};return d.pipe=d.then,m.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&&m.isFunction(a.promise)?e:0,g=1===f?a:m.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]&&m.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;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; - if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.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.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.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 m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;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},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!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(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(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=wb(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=wb(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?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(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,m.cleanData(ub(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,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("