gina 0.0.9-p91b → 0.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +46 -0
- package/{core/asset/html/static.html → Icon/r} +0 -0
- package/LICENSE +1 -1
- package/README-4Contributors.md +96 -0
- package/README.md +296 -104
- package/bin/cli +287 -0
- package/bin/cli-debug +60 -0
- package/bin/cmd +184 -0
- package/bin/gina +180 -0
- package/config/logger.json +17 -0
- package/doc/framework/cli/doc.json +9 -0
- package/doc/framework/index.md +60 -0
- package/framework/v0.1.1-alpha.2/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.2}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.2/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.2/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.2/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.2/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.2/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.2/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.2/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.2/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.2/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.2/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.2/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.2/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.2/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.2/core/router.js +664 -0
- package/framework/v0.1.1-alpha.2/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.2/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.2/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.2/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.2/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.2/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.2/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.2/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.2/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.2/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.2/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.2/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.2/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.2/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.2/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.2/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.2/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.2/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.2/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.2/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.2/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.2/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/main.js +734 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.2/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.2/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.2/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.2/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.2/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.2/package.json +14 -0
- package/package.json +35 -33
- package/resources/etc/init.d/debian/gina +117 -0
- package/resources/home/framework/env.json +34 -0
- package/resources/home/framework/locals.json +14 -0
- package/resources/home/framework/project.json +48 -0
- package/resources/home/framework/projects.json +6 -0
- package/resources/home/main.json +47 -0
- package/resources/home/settings.json +22 -0
- package/resources/home/user/extensions/logger/default/config.json +77 -0
- package/resources/home/user/extensions/logger/file/config.json +11 -0
- package/resources/img/android-chrome-192x192.png +0 -0
- package/resources/img/android-chrome-512x512.png +0 -0
- package/resources/img/apple-touch-icon.png +0 -0
- package/resources/img/favicon-16x16.png +0 -0
- package/resources/img/favicon-32x32.png +0 -0
- package/resources/img/favicon.ico +0 -0
- package/resources/package.json.template +50 -0
- package/script/lib.js +24 -0
- package/script/post_install.js +449 -157
- package/script/pre_install.js +277 -36
- package/script/prepare_version.js +425 -0
- package/utils/helper.js +438 -0
- package/utils/prototypes.js +239 -0
- package/utils/prototypes.json_clone.js +175 -0
- package/.npmignore +0 -6
- package/MIDDLEWARE +0 -1
- package/SUCCESS +0 -1
- package/VERSION +0 -1
- package/core/asset/html/nolayout.html +0 -1
- package/core/asset/js/plugin/build.dev.json +0 -28
- package/core/asset/js/plugin/build.json +0 -31
- package/core/asset/js/plugin/dist/gina.min.css +0 -1
- package/core/asset/js/plugin/dist/gina.min.css.map +0 -1
- package/core/asset/js/plugin/dist/gina.min.js +0 -13731
- package/core/asset/js/plugin/dist/gina.min.js.map +0 -42
- package/core/asset/js/plugin/dist/gina.onload.min.js +0 -3
- package/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
- package/core/asset/js/plugin/readme.md +0 -152
- package/core/asset/js/plugin/src/gina/main.js +0 -132
- package/core/asset/js/plugin/src/gina/popin/css/design.css +0 -23
- package/core/asset/js/plugin/src/gina/popin/css/main.css +0 -1112
- package/core/asset/js/plugin/src/gina/popin/css/popin.css +0 -3
- package/core/asset/js/plugin/src/gina/popin/css/popin.css.map +0 -1
- package/core/asset/js/plugin/src/gina/popin/doc/TOC.md +0 -29
- package/core/asset/js/plugin/src/gina/popin/doc/css.md +0 -162
- package/core/asset/js/plugin/src/gina/popin/doc/extend.md +0 -663
- package/core/asset/js/plugin/src/gina/popin/doc/faq.md +0 -46
- package/core/asset/js/plugin/src/gina/popin/doc/html.md +0 -227
- package/core/asset/js/plugin/src/gina/popin/doc/js.md +0 -37
- package/core/asset/js/plugin/src/gina/popin/doc/misc.md +0 -178
- package/core/asset/js/plugin/src/gina/popin/doc/usage.md +0 -130
- package/core/asset/js/plugin/src/gina/popin/main.js +0 -783
- package/core/asset/js/plugin/src/gina/popin/sass/config.sass +0 -37
- package/core/asset/js/plugin/src/gina/popin/sass/gina-design.sass +0 -622
- package/core/asset/js/plugin/src/gina/popin/sass/gina-popin.sass +0 -54
- package/core/asset/js/plugin/src/gina/popin/sass/helper.scss +0 -73
- package/core/asset/js/plugin/src/gina/toolbar/.npmignore +0 -19
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css +0 -433
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css.map +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/index.html +0 -285
- package/core/asset/js/plugin/src/gina/toolbar/index.kit +0 -120
- package/core/asset/js/plugin/src/gina/toolbar/jquery-3.1.0.min.js +0 -4
- package/core/asset/js/plugin/src/gina/toolbar/main.js +0 -693
- package/core/asset/js/plugin/src/gina/toolbar/mock.gina.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/mock.user.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/readme.md +0 -7
- package/core/asset/js/plugin/src/gina/toolbar/sass/toolbar.sass +0 -563
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/info-optim.svg +0 -13
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/logo-gina.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings-big.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.afdesign +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/test.jpg +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/toolbar.html +0 -104
- package/core/asset/js/plugin/src/gina/utils/dom.js +0 -24
- package/core/asset/js/plugin/src/gina/utils/events.js +0 -201
- package/core/asset/js/plugin/src/gina/utils/loader.js +0 -57
- package/core/asset/js/plugin/src/main.js +0 -235
- package/core/asset/js/plugin/src/vendor/jquery/1.11.1-css-event_alias.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/1.12.4.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/2.1.1-css-event_alias-sizzle.min.js +0 -4
- package/core/asset/js/plugin/src/vendor/jquery/README.md +0 -14
- package/core/asset/js/plugin/src/vendor/jquery/slim-3.1.1.min.js +0 -4
- package/core/config.js +0 -1225
- package/core/controller/controller.js +0 -1860
- package/core/gna.js +0 -908
- package/core/plugins/lib/validator/src/form-validator.js +0 -788
- package/core/plugins/lib/validator/src/main.js +0 -2056
- package/core/router.js +0 -717
- package/core/server.js +0 -1363
- package/core/template/conf/env.json +0 -70
- package/core/template/conf/settings.json +0 -48
- package/core/template/conf/statics.json +0 -6
- package/core/template/conf/views.json +0 -16
- package/core/template/samples/bundle/config/app.json +0 -4
- package/core/template/samples/bundle/config/routing.json +0 -9
- package/core/template/samples/bundle/controllers/setup.js +0 -33
- package/core/template/views/js/vendor/readme.md +0 -1
- package/core/template/views/readme.md +0 -1
- package/core/utils/helpers/dateFormat.js +0 -264
- package/core/utils/helpers/index.js +0 -202
- package/core/utils/index.js +0 -75
- package/core/utils/lib/cmd/app.js +0 -686
- package/core/utils/lib/cmd/basic.help.txt +0 -40
- package/core/utils/lib/cmd/basic.js +0 -141
- package/core/utils/lib/cmd/gina-add-bundle.js +0 -328
- package/core/utils/lib/cmd/gina-add-views.js +0 -99
- package/core/utils/lib/cmd/gina-build.js +0 -218
- package/core/utils/lib/cmd/gina-clean.js +0 -26
- package/core/utils/lib/cmd/gina-connect.js +0 -176
- package/core/utils/lib/cmd/gina-delete-bundle.js +0 -176
- package/core/utils/lib/cmd/gina-deploy.js +0 -452
- package/core/utils/lib/cmd/gina-init-project.js +0 -83
- package/core/utils/lib/cmd/gina-start-bundle.js +0 -3
- package/core/utils/lib/cmd/gina-start.js +0 -3
- package/core/utils/lib/cmd/index.js +0 -157
- package/core/utils/lib/cmd/project.js +0 -14
- package/core/utils/lib/collection/src/main.js +0 -650
- package/core/utils/lib/logger/containers/file.js +0 -11
- package/core/utils/lib/logger/index.js +0 -260
- package/core/utils/lib/merge/src/main.js +0 -344
- package/core/utils/lib/proc.js +0 -416
- package/core/utils/lib/routing/src/main.js +0 -165
- package/documentation/css/default.css +0 -3
- package/documentation/html/home.html +0 -6
- package/documentation/html/inc/_footer.html +0 -5
- package/documentation/html/layout.html +0 -21
- package/documentation/img/debug-conf1.png +0 -0
- package/documentation/img/debug-conf2.png +0 -0
- package/documentation/img/debug-conf3.png +0 -0
- package/documentation/img/debug-conf4.png +0 -0
- package/documentation/img/debug-conf5.png +0 -0
- package/documentation/img/debug-conf6.png +0 -0
- package/documentation/img/debug-conf7.png +0 -0
- package/documentation/img/debug-new1.png +0 -0
- package/documentation/img/debug-new2.png +0 -0
- package/documentation/img/debug-start.png +0 -0
- package/documentation/md/api/controller/main.md +0 -74
- package/migration_note.md +0 -7
- package/package-lock.json +0 -611
- package/script/pre_publish.js +0 -207
- package/tutorial/Commands/README.md +0 -56
- package/tutorial/Commands/add-bundle-result.png +0 -0
- package/tutorial/Commands/add-bundle.png +0 -0
- package/tutorial/Commands/delete-bundle.png +0 -0
- package/tutorial/Commands/help.png +0 -0
- package/tutorial/Commands/init-project.png +0 -0
- package/tutorial/Commands/start-bundle-result.png +0 -0
- package/tutorial/Commands/start-bundle-stop.png +0 -0
- package/tutorial/Commands/start-bundle.png +0 -0
- package/tutorial/Commands/version.png +0 -0
- package/tutorial/ETC/README.md +0 -74
- package/tutorial/ETC/add-bundle-result.png +0 -0
- package/tutorial/ETC/add-bundle.png +0 -0
- package/tutorial/ETC/init-project.png +0 -0
- package/tutorial/Install/README.md +0 -54
- package/tutorial/Install/git-get.png +0 -0
- package/tutorial/Install/git-install-end.png +0 -0
- package/tutorial/Install/git-install-result.png +0 -0
- package/tutorial/Install/git-install-start.png +0 -0
- package/tutorial/Install/install-end.png +0 -0
- package/tutorial/Install/install-result.png +0 -0
- package/tutorial/Install/install-start.png +0 -0
- package/tutorial/WebStorm/README.md +0 -30
- package/tutorial/WebStorm/closure-compiler.png +0 -0
- package/tutorial/WebStorm/sass.png +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"../../../../../node_modules/requirejs/require.js",
|
|
5
|
-
"../../../../../node_modules/node-uuid/uuid.js",
|
|
6
|
-
"../../../../utils/lib/merge/src/main.js",
|
|
7
|
-
"gina/utils/events.js",
|
|
8
|
-
"../../../../utils/helpers/dateFormat.js",
|
|
9
|
-
"vendor/jquery/1.12.4.min.js",
|
|
10
|
-
"../../../../utils/lib/collection/src/main.js",
|
|
11
|
-
"../../../../plugins/lib/storage/src/main.js",
|
|
12
|
-
"gina/toolbar/main.js",
|
|
13
|
-
"gina/main.js",
|
|
14
|
-
"../../../../../node_modules/engine.io-client/engine.io.js",
|
|
15
|
-
"../../../../plugins/lib/validator/src/main.js",
|
|
16
|
-
"gina/popin/main.js",
|
|
17
|
-
"gina/utils/dom.js",
|
|
18
|
-
"../../../../plugins/lib/validator/src/form-validator.js",
|
|
19
|
-
"main.js"
|
|
20
|
-
],
|
|
21
|
-
"names": [],
|
|
22
|
-
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpmEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxQA;AACA;AACA;AACA;AACA;AACA,ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1oBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACraA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACrrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnmJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxgEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC/wBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
|
|
23
|
-
"file": "gina.min.js",
|
|
24
|
-
"sourcesContent": [
|
|
25
|
-
"/** vim: et:ts=4:sw=4:sts=4\n * @license RequireJS 2.3.4 Copyright jQuery Foundation and other contributors.\n * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE\n */\n//Not using strict: uneven strict support in browsers, #392, and causes\n//problems with requirejs.exec()/transpiler plugins that may not be strict.\n/*jslint regexp: true, nomen: true, sloppy: true */\n/*global window, navigator, document, importScripts, setTimeout, opera */\n\nvar requirejs, require, define;\n(function (global, setTimeout) {\n var req, s, head, baseElement, dataMain, src,\n interactiveScript, currentlyAddingScript, mainScript, subPath,\n version = '2.3.4',\n commentRegExp = /\\/\\*[\\s\\S]*?\\*\\/|([^:\"'=]|^)\\/\\/.*$/mg,\n cjsRequireRegExp = /[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,\n jsSuffixRegExp = /\\.js$/,\n currDirRegExp = /^\\.\\//,\n op = Object.prototype,\n ostring = op.toString,\n hasOwn = op.hasOwnProperty,\n isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),\n isWebWorker = !isBrowser && typeof importScripts !== 'undefined',\n //PS3 indicates loaded and complete, but need to wait for complete\n //specifically. Sequence is 'loading', 'loaded', execution,\n // then 'complete'. The UA check is unfortunate, but not sure how\n //to feature test w/o causing perf issues.\n readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?\n /^complete$/ : /^(complete|loaded)$/,\n defContextName = '_',\n //Oh the tragedy, detecting opera. See the usage of isOpera for reason.\n isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',\n contexts = {},\n cfg = {},\n globalDefQueue = [],\n useInteractive = false;\n\n //Could match something like ')//comment', do not lose the prefix to comment.\n function commentReplace(match, singlePrefix) {\n return singlePrefix || '';\n }\n\n function isFunction(it) {\n return ostring.call(it) === '[object Function]';\n }\n\n function isArray(it) {\n return ostring.call(it) === '[object Array]';\n }\n\n /**\n * Helper function for iterating over an array. If the func returns\n * a true value, it will break out of the loop.\n */\n function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }\n\n /**\n * Helper function for iterating over an array backwards. If the func\n * returns a true value, it will break out of the loop.\n */\n function eachReverse(ary, func) {\n if (ary) {\n var i;\n for (i = ary.length - 1; i > -1; i -= 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }\n\n function hasProp(obj, prop) {\n return hasOwn.call(obj, prop);\n }\n\n function getOwn(obj, prop) {\n return hasProp(obj, prop) && obj[prop];\n }\n\n /**\n * Cycles over properties in an object and calls a function for each\n * property value. If the function returns a truthy value, then the\n * iteration is stopped.\n */\n function eachProp(obj, func) {\n var prop;\n for (prop in obj) {\n if (hasProp(obj, prop)) {\n if (func(obj[prop], prop)) {\n break;\n }\n }\n }\n }\n\n /**\n * Simple function to mix in properties from source into target,\n * but only if target does not already have a property of the same name.\n */\n function mixin(target, source, force, deepStringMixin) {\n if (source) {\n eachProp(source, function (value, prop) {\n if (force || !hasProp(target, prop)) {\n if (deepStringMixin && typeof value === 'object' && value &&\n !isArray(value) && !isFunction(value) &&\n !(value instanceof RegExp)) {\n\n if (!target[prop]) {\n target[prop] = {};\n }\n mixin(target[prop], value, force, deepStringMixin);\n } else {\n target[prop] = value;\n }\n }\n });\n }\n return target;\n }\n\n //Similar to Function.prototype.bind, but the 'this' object is specified\n //first, since it is easier to read/figure out what 'this' will be.\n function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }\n\n function scripts() {\n return document.getElementsByTagName('script');\n }\n\n function defaultOnError(err) {\n throw err;\n }\n\n //Allow getting a global that is expressed in\n //dot notation, like 'a.b.c'.\n function getGlobal(value) {\n if (!value) {\n return value;\n }\n var g = global;\n each(value.split('.'), function (part) {\n g = g[part];\n });\n return g;\n }\n\n /**\n * Constructs an error with a pointer to an URL with more information.\n * @param {String} id the error ID that maps to an ID on a web page.\n * @param {String} message human readable error.\n * @param {Error} [err] the original error, if there is one.\n *\n * @returns {Error}\n */\n function makeError(id, msg, err, requireModules) {\n var e = new Error(msg + '\\nhttp://requirejs.org/docs/errors.html#' + id);\n e.requireType = id;\n e.requireModules = requireModules;\n if (err) {\n e.originalError = err;\n }\n return e;\n }\n\n if (typeof define !== 'undefined') {\n //If a define is already in play via another AMD loader,\n //do not overwrite.\n return;\n }\n\n if (typeof requirejs !== 'undefined') {\n if (isFunction(requirejs)) {\n //Do not overwrite an existing requirejs instance.\n return;\n }\n cfg = requirejs;\n requirejs = undefined;\n }\n\n //Allow for a require config object\n if (typeof require !== 'undefined' && !isFunction(require)) {\n //assume it is a config object.\n cfg = require;\n require = undefined;\n }\n\n function newContext(contextName) {\n var inCheckLoaded, Module, context, handlers,\n checkLoadedTimeoutId,\n config = {\n //Defaults. Do not set a default for map\n //config to speed up normalize(), which\n //will run faster if there is no default.\n waitSeconds: 7,\n baseUrl: './',\n paths: {},\n bundles: {},\n pkgs: {},\n shim: {},\n config: {}\n },\n registry = {},\n //registry of just enabled modules, to speed\n //cycle breaking code when lots of modules\n //are registered, but not activated.\n enabledRegistry = {},\n undefEvents = {},\n defQueue = [],\n defined = {},\n urlFetched = {},\n bundlesMap = {},\n requireCounter = 1,\n unnormalizedCounter = 1;\n\n /**\n * Trims the . and .. from an array of path segments.\n * It will keep a leading path segment if a .. will become\n * the first path segment, to help with module name lookups,\n * which act like paths, but can be remapped. But the end result,\n * all paths that use this function should look normalized.\n * NOTE: this method MODIFIES the input array.\n * @param {Array} ary the array of path segments.\n */\n function trimDots(ary) {\n var i, part;\n for (i = 0; i < ary.length; i++) {\n part = ary[i];\n if (part === '.') {\n ary.splice(i, 1);\n i -= 1;\n } else if (part === '..') {\n // If at the start, or previous value is still ..,\n // keep them so that when converted to a path it may\n // still work when converted to a path, even though\n // as an ID it is less than ideal. In larger point\n // releases, may be better to just kick out an error.\n if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {\n continue;\n } else if (i > 0) {\n ary.splice(i - 1, 2);\n i -= 2;\n }\n }\n }\n }\n\n /**\n * Given a relative module name, like ./something, normalize it to\n * a real name that can be mapped to a path.\n * @param {String} name the relative name\n * @param {String} baseName a real name that the name arg is relative\n * to.\n * @param {Boolean} applyMap apply the map config to the value. Should\n * only be done if this normalization is for a dependency ID.\n * @returns {String} normalized name\n */\n function normalize(name, baseName, applyMap) {\n var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,\n foundMap, foundI, foundStarMap, starI, normalizedBaseParts,\n baseParts = (baseName && baseName.split('/')),\n map = config.map,\n starMap = map && map['*'];\n\n //Adjust any relative paths.\n if (name) {\n name = name.split('/');\n lastIndex = name.length - 1;\n\n // If wanting node ID compatibility, strip .js from end\n // of IDs. Have to do this here, and not in nameToUrl\n // because node allows either .js or non .js to map\n // to same file.\n if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {\n name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');\n }\n\n // Starts with a '.' so need the baseName\n if (name[0].charAt(0) === '.' && baseParts) {\n //Convert baseName to array, and lop off the last part,\n //so that . matches that 'directory' and not name of the baseName's\n //module. For instance, baseName of 'one/two/three', maps to\n //'one/two/three.js', but we want the directory, 'one/two' for\n //this normalization.\n normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);\n name = normalizedBaseParts.concat(name);\n }\n\n trimDots(name);\n name = name.join('/');\n }\n\n //Apply map config if available.\n if (applyMap && map && (baseParts || starMap)) {\n nameParts = name.split('/');\n\n outerLoop: for (i = nameParts.length; i > 0; i -= 1) {\n nameSegment = nameParts.slice(0, i).join('/');\n\n if (baseParts) {\n //Find the longest baseName segment match in the config.\n //So, do joins on the biggest to smallest lengths of baseParts.\n for (j = baseParts.length; j > 0; j -= 1) {\n mapValue = getOwn(map, baseParts.slice(0, j).join('/'));\n\n //baseName segment has config, find if it has one for\n //this name.\n if (mapValue) {\n mapValue = getOwn(mapValue, nameSegment);\n if (mapValue) {\n //Match, update name to the new value.\n foundMap = mapValue;\n foundI = i;\n break outerLoop;\n }\n }\n }\n }\n\n //Check for a star map match, but just hold on to it,\n //if there is a shorter segment match later in a matching\n //config, then favor over this star map.\n if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {\n foundStarMap = getOwn(starMap, nameSegment);\n starI = i;\n }\n }\n\n if (!foundMap && foundStarMap) {\n foundMap = foundStarMap;\n foundI = starI;\n }\n\n if (foundMap) {\n nameParts.splice(0, foundI, foundMap);\n name = nameParts.join('/');\n }\n }\n\n // If the name points to a package's name, use\n // the package main instead.\n pkgMain = getOwn(config.pkgs, name);\n\n return pkgMain ? pkgMain : name;\n }\n\n function removeScript(name) {\n if (isBrowser) {\n each(scripts(), function (scriptNode) {\n if (scriptNode.getAttribute('data-requiremodule') === name &&\n scriptNode.getAttribute('data-requirecontext') === context.contextName) {\n scriptNode.parentNode.removeChild(scriptNode);\n return true;\n }\n });\n }\n }\n\n function hasPathFallback(id) {\n var pathConfig = getOwn(config.paths, id);\n if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {\n //Pop off the first array value, since it failed, and\n //retry\n pathConfig.shift();\n context.require.undef(id);\n\n //Custom require that does not do map translation, since\n //ID is \"absolute\", already mapped/resolved.\n context.makeRequire(null, {\n skipMap: true\n })([id]);\n\n return true;\n }\n }\n\n //Turns a plugin!resource to [plugin, resource]\n //with the plugin being undefined if the name\n //did not have a plugin prefix.\n function splitPrefix(name) {\n var prefix,\n index = name ? name.indexOf('!') : -1;\n if (index > -1) {\n prefix = name.substring(0, index);\n name = name.substring(index + 1, name.length);\n }\n return [prefix, name];\n }\n\n /**\n * Creates a module mapping that includes plugin prefix, module\n * name, and path. If parentModuleMap is provided it will\n * also normalize the name via require.normalize()\n *\n * @param {String} name the module name\n * @param {String} [parentModuleMap] parent module map\n * for the module name, used to resolve relative names.\n * @param {Boolean} isNormalized: is the ID already normalized.\n * This is true if this call is done for a define() module ID.\n * @param {Boolean} applyMap: apply the map config to the ID.\n * Should only be true if this map is for a dependency.\n *\n * @returns {Object}\n */\n function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {\n var url, pluginModule, suffix, nameParts,\n prefix = null,\n parentName = parentModuleMap ? parentModuleMap.name : null,\n originalName = name,\n isDefine = true,\n normalizedName = '';\n\n //If no name, then it means it is a require call, generate an\n //internal name.\n if (!name) {\n isDefine = false;\n name = '_@r' + (requireCounter += 1);\n }\n\n nameParts = splitPrefix(name);\n prefix = nameParts[0];\n name = nameParts[1];\n\n if (prefix) {\n prefix = normalize(prefix, parentName, applyMap);\n pluginModule = getOwn(defined, prefix);\n }\n\n //Account for relative paths if there is a base name.\n if (name) {\n if (prefix) {\n if (isNormalized) {\n normalizedName = name;\n } else if (pluginModule && pluginModule.normalize) {\n //Plugin is loaded, use its normalize method.\n normalizedName = pluginModule.normalize(name, function (name) {\n return normalize(name, parentName, applyMap);\n });\n } else {\n // If nested plugin references, then do not try to\n // normalize, as it will not normalize correctly. This\n // places a restriction on resourceIds, and the longer\n // term solution is not to normalize until plugins are\n // loaded and all normalizations to allow for async\n // loading of a loader plugin. But for now, fixes the\n // common uses. Details in #1131\n normalizedName = name.indexOf('!') === -1 ?\n normalize(name, parentName, applyMap) :\n name;\n }\n } else {\n //A regular module.\n normalizedName = normalize(name, parentName, applyMap);\n\n //Normalized name may be a plugin ID due to map config\n //application in normalize. The map config values must\n //already be normalized, so do not need to redo that part.\n nameParts = splitPrefix(normalizedName);\n prefix = nameParts[0];\n normalizedName = nameParts[1];\n isNormalized = true;\n\n url = context.nameToUrl(normalizedName);\n }\n }\n\n //If the id is a plugin id that cannot be determined if it needs\n //normalization, stamp it with a unique ID so two matching relative\n //ids that may conflict can be separate.\n suffix = prefix && !pluginModule && !isNormalized ?\n '_unnormalized' + (unnormalizedCounter += 1) :\n '';\n\n return {\n prefix: prefix,\n name: normalizedName,\n parentMap: parentModuleMap,\n unnormalized: !!suffix,\n url: url,\n originalName: originalName,\n isDefine: isDefine,\n id: (prefix ?\n prefix + '!' + normalizedName :\n normalizedName) + suffix\n };\n }\n\n function getModule(depMap) {\n var id = depMap.id,\n mod = getOwn(registry, id);\n\n if (!mod) {\n mod = registry[id] = new context.Module(depMap);\n }\n\n return mod;\n }\n\n function on(depMap, name, fn) {\n var id = depMap.id,\n mod = getOwn(registry, id);\n\n if (hasProp(defined, id) &&\n (!mod || mod.defineEmitComplete)) {\n if (name === 'defined') {\n fn(defined[id]);\n }\n } else {\n mod = getModule(depMap);\n if (mod.error && name === 'error') {\n fn(mod.error);\n } else {\n mod.on(name, fn);\n }\n }\n }\n\n function onError(err, errback) {\n var ids = err.requireModules,\n notified = false;\n\n if (errback) {\n errback(err);\n } else {\n each(ids, function (id) {\n var mod = getOwn(registry, id);\n if (mod) {\n //Set error on module, so it skips timeout checks.\n mod.error = err;\n if (mod.events.error) {\n notified = true;\n mod.emit('error', err);\n }\n }\n });\n\n if (!notified) {\n req.onError(err);\n }\n }\n }\n\n /**\n * Internal method to transfer globalQueue items to this context's\n * defQueue.\n */\n function takeGlobalQueue() {\n //Push all the globalDefQueue items into the context's defQueue\n if (globalDefQueue.length) {\n each(globalDefQueue, function(queueItem) {\n var id = queueItem[0];\n if (typeof id === 'string') {\n context.defQueueMap[id] = true;\n }\n defQueue.push(queueItem);\n });\n globalDefQueue = [];\n }\n }\n\n handlers = {\n 'require': function (mod) {\n if (mod.require) {\n return mod.require;\n } else {\n return (mod.require = context.makeRequire(mod.map));\n }\n },\n 'exports': function (mod) {\n mod.usingExports = true;\n if (mod.map.isDefine) {\n if (mod.exports) {\n return (defined[mod.map.id] = mod.exports);\n } else {\n return (mod.exports = defined[mod.map.id] = {});\n }\n }\n },\n 'module': function (mod) {\n if (mod.module) {\n return mod.module;\n } else {\n return (mod.module = {\n id: mod.map.id,\n uri: mod.map.url,\n config: function () {\n return getOwn(config.config, mod.map.id) || {};\n },\n exports: mod.exports || (mod.exports = {})\n });\n }\n }\n };\n\n function cleanRegistry(id) {\n //Clean up machinery used for waiting modules.\n delete registry[id];\n delete enabledRegistry[id];\n }\n\n function breakCycle(mod, traced, processed) {\n var id = mod.map.id;\n\n if (mod.error) {\n mod.emit('error', mod.error);\n } else {\n traced[id] = true;\n each(mod.depMaps, function (depMap, i) {\n var depId = depMap.id,\n dep = getOwn(registry, depId);\n\n //Only force things that have not completed\n //being defined, so still in the registry,\n //and only if it has not been matched up\n //in the module already.\n if (dep && !mod.depMatched[i] && !processed[depId]) {\n if (getOwn(traced, depId)) {\n mod.defineDep(i, defined[depId]);\n mod.check(); //pass false?\n } else {\n breakCycle(dep, traced, processed);\n }\n }\n });\n processed[id] = true;\n }\n }\n\n function checkLoaded() {\n var err, usingPathFallback,\n waitInterval = config.waitSeconds * 1000,\n //It is possible to disable the wait interval by using waitSeconds of 0.\n expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),\n noLoads = [],\n reqCalls = [],\n stillLoading = false,\n needCycleCheck = true;\n\n //Do not bother if this call was a result of a cycle break.\n if (inCheckLoaded) {\n return;\n }\n\n inCheckLoaded = true;\n\n //Figure out the state of all the modules.\n eachProp(enabledRegistry, function (mod) {\n var map = mod.map,\n modId = map.id;\n\n //Skip things that are not enabled or in error state.\n if (!mod.enabled) {\n return;\n }\n\n if (!map.isDefine) {\n reqCalls.push(mod);\n }\n\n if (!mod.error) {\n //If the module should be executed, and it has not\n //been inited and time is up, remember it.\n if (!mod.inited && expired) {\n if (hasPathFallback(modId)) {\n usingPathFallback = true;\n stillLoading = true;\n } else {\n noLoads.push(modId);\n removeScript(modId);\n }\n } else if (!mod.inited && mod.fetched && map.isDefine) {\n stillLoading = true;\n if (!map.prefix) {\n //No reason to keep looking for unfinished\n //loading. If the only stillLoading is a\n //plugin resource though, keep going,\n //because it may be that a plugin resource\n //is waiting on a non-plugin cycle.\n return (needCycleCheck = false);\n }\n }\n }\n });\n\n if (expired && noLoads.length) {\n //If wait time expired, throw error of unloaded modules.\n err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);\n err.contextName = context.contextName;\n return onError(err);\n }\n\n //Not expired, check for a cycle.\n if (needCycleCheck) {\n each(reqCalls, function (mod) {\n breakCycle(mod, {}, {});\n });\n }\n\n //If still waiting on loads, and the waiting load is something\n //other than a plugin resource, or there are still outstanding\n //scripts, then just try back later.\n if ((!expired || usingPathFallback) && stillLoading) {\n //Something is still waiting to load. Wait for it, but only\n //if a timeout is not already in effect.\n if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {\n checkLoadedTimeoutId = setTimeout(function () {\n checkLoadedTimeoutId = 0;\n checkLoaded();\n }, 50);\n }\n }\n\n inCheckLoaded = false;\n }\n\n Module = function (map) {\n this.events = getOwn(undefEvents, map.id) || {};\n this.map = map;\n this.shim = getOwn(config.shim, map.id);\n this.depExports = [];\n this.depMaps = [];\n this.depMatched = [];\n this.pluginMaps = {};\n this.depCount = 0;\n\n /* this.exports this.factory\n this.depMaps = [],\n this.enabled, this.fetched\n */\n };\n\n Module.prototype = {\n init: function (depMaps, factory, errback, options) {\n options = options || {};\n\n //Do not do more inits if already done. Can happen if there\n //are multiple define calls for the same module. That is not\n //a normal, common case, but it is also not unexpected.\n if (this.inited) {\n return;\n }\n\n this.factory = factory;\n\n if (errback) {\n //Register for errors on this module.\n this.on('error', errback);\n } else if (this.events.error) {\n //If no errback already, but there are error listeners\n //on this module, set up an errback to pass to the deps.\n errback = bind(this, function (err) {\n this.emit('error', err);\n });\n }\n\n //Do a copy of the dependency array, so that\n //source inputs are not modified. For example\n //\"shim\" deps are passed in here directly, and\n //doing a direct modification of the depMaps array\n //would affect that config.\n this.depMaps = depMaps && depMaps.slice(0);\n\n this.errback = errback;\n\n //Indicate this module has be initialized\n this.inited = true;\n\n this.ignore = options.ignore;\n\n //Could have option to init this module in enabled mode,\n //or could have been previously marked as enabled. However,\n //the dependencies are not known until init is called. So\n //if enabled previously, now trigger dependencies as enabled.\n if (options.enabled || this.enabled) {\n //Enable this module and dependencies.\n //Will call this.check()\n this.enable();\n } else {\n this.check();\n }\n },\n\n defineDep: function (i, depExports) {\n //Because of cycles, defined callback for a given\n //export can be called more than once.\n if (!this.depMatched[i]) {\n this.depMatched[i] = true;\n this.depCount -= 1;\n this.depExports[i] = depExports;\n }\n },\n\n fetch: function () {\n if (this.fetched) {\n return;\n }\n this.fetched = true;\n\n context.startTime = (new Date()).getTime();\n\n var map = this.map;\n\n //If the manager is for a plugin managed resource,\n //ask the plugin to load it now.\n if (this.shim) {\n context.makeRequire(this.map, {\n enableBuildCallback: true\n })(this.shim.deps || [], bind(this, function () {\n return map.prefix ? this.callPlugin() : this.load();\n }));\n } else {\n //Regular dependency.\n return map.prefix ? this.callPlugin() : this.load();\n }\n },\n\n load: function () {\n var url = this.map.url;\n\n //Regular dependency.\n if (!urlFetched[url]) {\n urlFetched[url] = true;\n context.load(this.map.id, url);\n }\n },\n\n /**\n * Checks if the module is ready to define itself, and if so,\n * define it.\n */\n check: function () {\n if (!this.enabled || this.enabling) {\n return;\n }\n\n var err, cjsModule,\n id = this.map.id,\n depExports = this.depExports,\n exports = this.exports,\n factory = this.factory;\n\n if (!this.inited) {\n // Only fetch if not already in the defQueue.\n if (!hasProp(context.defQueueMap, id)) {\n this.fetch();\n }\n } else if (this.error) {\n this.emit('error', this.error);\n } else if (!this.defining) {\n //The factory could trigger another require call\n //that would result in checking this module to\n //define itself again. If already in the process\n //of doing that, skip this work.\n this.defining = true;\n\n if (this.depCount < 1 && !this.defined) {\n if (isFunction(factory)) {\n //If there is an error listener, favor passing\n //to that instead of throwing an error. However,\n //only do it for define()'d modules. require\n //errbacks should not be called for failures in\n //their callbacks (#699). However if a global\n //onError is set, use that.\n if ((this.events.error && this.map.isDefine) ||\n req.onError !== defaultOnError) {\n try {\n exports = context.execCb(id, factory, depExports, exports);\n } catch (e) {\n err = e;\n }\n } else {\n exports = context.execCb(id, factory, depExports, exports);\n }\n\n // Favor return value over exports. If node/cjs in play,\n // then will not have a return value anyway. Favor\n // module.exports assignment over exports object.\n if (this.map.isDefine && exports === undefined) {\n cjsModule = this.module;\n if (cjsModule) {\n exports = cjsModule.exports;\n } else if (this.usingExports) {\n //exports already set the defined value.\n exports = this.exports;\n }\n }\n\n if (err) {\n err.requireMap = this.map;\n err.requireModules = this.map.isDefine ? [this.map.id] : null;\n err.requireType = this.map.isDefine ? 'define' : 'require';\n return onError((this.error = err));\n }\n\n } else {\n //Just a literal value\n exports = factory;\n }\n\n this.exports = exports;\n\n if (this.map.isDefine && !this.ignore) {\n defined[id] = exports;\n\n if (req.onResourceLoad) {\n var resLoadMaps = [];\n each(this.depMaps, function (depMap) {\n resLoadMaps.push(depMap.normalizedMap || depMap);\n });\n req.onResourceLoad(context, this.map, resLoadMaps);\n }\n }\n\n //Clean up\n cleanRegistry(id);\n\n this.defined = true;\n }\n\n //Finished the define stage. Allow calling check again\n //to allow define notifications below in the case of a\n //cycle.\n this.defining = false;\n\n if (this.defined && !this.defineEmitted) {\n this.defineEmitted = true;\n this.emit('defined', this.exports);\n this.defineEmitComplete = true;\n }\n\n }\n },\n\n callPlugin: function () {\n var map = this.map,\n id = map.id,\n //Map already normalized the prefix.\n pluginMap = makeModuleMap(map.prefix);\n\n //Mark this as a dependency for this plugin, so it\n //can be traced for cycles.\n this.depMaps.push(pluginMap);\n\n on(pluginMap, 'defined', bind(this, function (plugin) {\n var load, normalizedMap, normalizedMod,\n bundleId = getOwn(bundlesMap, this.map.id),\n name = this.map.name,\n parentName = this.map.parentMap ? this.map.parentMap.name : null,\n localRequire = context.makeRequire(map.parentMap, {\n enableBuildCallback: true\n });\n\n //If current map is not normalized, wait for that\n //normalized name to load instead of continuing.\n if (this.map.unnormalized) {\n //Normalize the ID if the plugin allows it.\n if (plugin.normalize) {\n name = plugin.normalize(name, function (name) {\n return normalize(name, parentName, true);\n }) || '';\n }\n\n //prefix and name should already be normalized, no need\n //for applying map config again either.\n normalizedMap = makeModuleMap(map.prefix + '!' + name,\n this.map.parentMap,\n true);\n on(normalizedMap,\n 'defined', bind(this, function (value) {\n this.map.normalizedMap = normalizedMap;\n this.init([], function () { return value; }, null, {\n enabled: true,\n ignore: true\n });\n }));\n\n normalizedMod = getOwn(registry, normalizedMap.id);\n if (normalizedMod) {\n //Mark this as a dependency for this plugin, so it\n //can be traced for cycles.\n this.depMaps.push(normalizedMap);\n\n if (this.events.error) {\n normalizedMod.on('error', bind(this, function (err) {\n this.emit('error', err);\n }));\n }\n normalizedMod.enable();\n }\n\n return;\n }\n\n //If a paths config, then just load that file instead to\n //resolve the plugin, as it is built into that paths layer.\n if (bundleId) {\n this.map.url = context.nameToUrl(bundleId);\n this.load();\n return;\n }\n\n load = bind(this, function (value) {\n this.init([], function () { return value; }, null, {\n enabled: true\n });\n });\n\n load.error = bind(this, function (err) {\n this.inited = true;\n this.error = err;\n err.requireModules = [id];\n\n //Remove temp unnormalized modules for this module,\n //since they will never be resolved otherwise now.\n eachProp(registry, function (mod) {\n if (mod.map.id.indexOf(id + '_unnormalized') === 0) {\n cleanRegistry(mod.map.id);\n }\n });\n\n onError(err);\n });\n\n //Allow plugins to load other code without having to know the\n //context or how to 'complete' the load.\n load.fromText = bind(this, function (text, textAlt) {\n /*jslint evil: true */\n var moduleName = map.name,\n moduleMap = makeModuleMap(moduleName),\n hasInteractive = useInteractive;\n\n //As of 2.1.0, support just passing the text, to reinforce\n //fromText only being called once per resource. Still\n //support old style of passing moduleName but discard\n //that moduleName in favor of the internal ref.\n if (textAlt) {\n text = textAlt;\n }\n\n //Turn off interactive script matching for IE for any define\n //calls in the text, then turn it back on at the end.\n if (hasInteractive) {\n useInteractive = false;\n }\n\n //Prime the system by creating a module instance for\n //it.\n getModule(moduleMap);\n\n //Transfer any config to this other module.\n if (hasProp(config.config, id)) {\n config.config[moduleName] = config.config[id];\n }\n\n try {\n req.exec(text);\n } catch (e) {\n return onError(makeError('fromtexteval',\n 'fromText eval for ' + id +\n ' failed: ' + e,\n e,\n [id]));\n }\n\n if (hasInteractive) {\n useInteractive = true;\n }\n\n //Mark this as a dependency for the plugin\n //resource\n this.depMaps.push(moduleMap);\n\n //Support anonymous modules.\n context.completeLoad(moduleName);\n\n //Bind the value of that module to the value for this\n //resource ID.\n localRequire([moduleName], load);\n });\n\n //Use parentName here since the plugin's name is not reliable,\n //could be some weird string with no path that actually wants to\n //reference the parentName's path.\n plugin.load(map.name, localRequire, load, config);\n }));\n\n context.enable(pluginMap, this);\n this.pluginMaps[pluginMap.id] = pluginMap;\n },\n\n enable: function () {\n enabledRegistry[this.map.id] = this;\n this.enabled = true;\n\n //Set flag mentioning that the module is enabling,\n //so that immediate calls to the defined callbacks\n //for dependencies do not trigger inadvertent load\n //with the depCount still being zero.\n this.enabling = true;\n\n //Enable each dependency\n each(this.depMaps, bind(this, function (depMap, i) {\n var id, mod, handler;\n\n if (typeof depMap === 'string') {\n //Dependency needs to be converted to a depMap\n //and wired up to this module.\n depMap = makeModuleMap(depMap,\n (this.map.isDefine ? this.map : this.map.parentMap),\n false,\n !this.skipMap);\n this.depMaps[i] = depMap;\n\n handler = getOwn(handlers, depMap.id);\n\n if (handler) {\n this.depExports[i] = handler(this);\n return;\n }\n\n this.depCount += 1;\n\n on(depMap, 'defined', bind(this, function (depExports) {\n if (this.undefed) {\n return;\n }\n this.defineDep(i, depExports);\n this.check();\n }));\n\n if (this.errback) {\n on(depMap, 'error', bind(this, this.errback));\n } else if (this.events.error) {\n // No direct errback on this module, but something\n // else is listening for errors, so be sure to\n // propagate the error correctly.\n on(depMap, 'error', bind(this, function(err) {\n this.emit('error', err);\n }));\n }\n }\n\n id = depMap.id;\n mod = registry[id];\n\n //Skip special modules like 'require', 'exports', 'module'\n //Also, don't call enable if it is already enabled,\n //important in circular dependency cases.\n if (!hasProp(handlers, id) && mod && !mod.enabled) {\n context.enable(depMap, this);\n }\n }));\n\n //Enable each plugin that is used in\n //a dependency\n eachProp(this.pluginMaps, bind(this, function (pluginMap) {\n var mod = getOwn(registry, pluginMap.id);\n if (mod && !mod.enabled) {\n context.enable(pluginMap, this);\n }\n }));\n\n this.enabling = false;\n\n this.check();\n },\n\n on: function (name, cb) {\n var cbs = this.events[name];\n if (!cbs) {\n cbs = this.events[name] = [];\n }\n cbs.push(cb);\n },\n\n emit: function (name, evt) {\n each(this.events[name], function (cb) {\n cb(evt);\n });\n if (name === 'error') {\n //Now that the error handler was triggered, remove\n //the listeners, since this broken Module instance\n //can stay around for a while in the registry.\n delete this.events[name];\n }\n }\n };\n\n function callGetModule(args) {\n //Skip modules already defined.\n if (!hasProp(defined, args[0])) {\n getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);\n }\n }\n\n function removeListener(node, func, name, ieName) {\n //Favor detachEvent because of IE9\n //issue, see attachEvent/addEventListener comment elsewhere\n //in this file.\n if (node.detachEvent && !isOpera) {\n //Probably IE. If not it will throw an error, which will be\n //useful to know.\n if (ieName) {\n node.detachEvent(ieName, func);\n }\n } else {\n node.removeEventListener(name, func, false);\n }\n }\n\n /**\n * Given an event from a script node, get the requirejs info from it,\n * and then removes the event listeners on the node.\n * @param {Event} evt\n * @returns {Object}\n */\n function getScriptData(evt) {\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\n //all old browsers will be supported, but this one was easy enough\n //to support and still makes sense.\n var node = evt.currentTarget || evt.srcElement;\n\n //Remove the listeners once here.\n removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');\n removeListener(node, context.onScriptError, 'error');\n\n return {\n node: node,\n id: node && node.getAttribute('data-requiremodule')\n };\n }\n\n function intakeDefines() {\n var args;\n\n //Any defined modules in the global queue, intake them now.\n takeGlobalQueue();\n\n //Make sure any remaining defQueue items get properly processed.\n while (defQueue.length) {\n args = defQueue.shift();\n if (args[0] === null) {\n return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +\n args[args.length - 1]));\n } else {\n //args are id, deps, factory. Should be normalized by the\n //define() function.\n callGetModule(args);\n }\n }\n context.defQueueMap = {};\n }\n\n context = {\n config: config,\n contextName: contextName,\n registry: registry,\n defined: defined,\n urlFetched: urlFetched,\n defQueue: defQueue,\n defQueueMap: {},\n Module: Module,\n makeModuleMap: makeModuleMap,\n nextTick: req.nextTick,\n onError: onError,\n\n /**\n * Set a configuration for the context.\n * @param {Object} cfg config object to integrate.\n */\n configure: function (cfg) {\n //Make sure the baseUrl ends in a slash.\n if (cfg.baseUrl) {\n if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {\n cfg.baseUrl += '/';\n }\n }\n\n // Convert old style urlArgs string to a function.\n if (typeof cfg.urlArgs === 'string') {\n var urlArgs = cfg.urlArgs;\n cfg.urlArgs = function(id, url) {\n return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs;\n };\n }\n\n //Save off the paths since they require special processing,\n //they are additive.\n var shim = config.shim,\n objs = {\n paths: true,\n bundles: true,\n config: true,\n map: true\n };\n\n eachProp(cfg, function (value, prop) {\n if (objs[prop]) {\n if (!config[prop]) {\n config[prop] = {};\n }\n mixin(config[prop], value, true, true);\n } else {\n config[prop] = value;\n }\n });\n\n //Reverse map the bundles\n if (cfg.bundles) {\n eachProp(cfg.bundles, function (value, prop) {\n each(value, function (v) {\n if (v !== prop) {\n bundlesMap[v] = prop;\n }\n });\n });\n }\n\n //Merge shim\n if (cfg.shim) {\n eachProp(cfg.shim, function (value, id) {\n //Normalize the structure\n if (isArray(value)) {\n value = {\n deps: value\n };\n }\n if ((value.exports || value.init) && !value.exportsFn) {\n value.exportsFn = context.makeShimExports(value);\n }\n shim[id] = value;\n });\n config.shim = shim;\n }\n\n //Adjust packages if necessary.\n if (cfg.packages) {\n each(cfg.packages, function (pkgObj) {\n var location, name;\n\n pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;\n\n name = pkgObj.name;\n location = pkgObj.location;\n if (location) {\n config.paths[name] = pkgObj.location;\n }\n\n //Save pointer to main module ID for pkg name.\n //Remove leading dot in main, so main paths are normalized,\n //and remove any trailing .js, since different package\n //envs have different conventions: some use a module name,\n //some use a file name.\n config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')\n .replace(currDirRegExp, '')\n .replace(jsSuffixRegExp, '');\n });\n }\n\n //If there are any \"waiting to execute\" modules in the registry,\n //update the maps for them, since their info, like URLs to load,\n //may have changed.\n eachProp(registry, function (mod, id) {\n //If module already has init called, since it is too\n //late to modify them, and ignore unnormalized ones\n //since they are transient.\n if (!mod.inited && !mod.map.unnormalized) {\n mod.map = makeModuleMap(id, null, true);\n }\n });\n\n //If a deps array or a config callback is specified, then call\n //require with those args. This is useful when require is defined as a\n //config object before require.js is loaded.\n if (cfg.deps || cfg.callback) {\n context.require(cfg.deps || [], cfg.callback);\n }\n },\n\n makeShimExports: function (value) {\n function fn() {\n var ret;\n if (value.init) {\n ret = value.init.apply(global, arguments);\n }\n return ret || (value.exports && getGlobal(value.exports));\n }\n return fn;\n },\n\n makeRequire: function (relMap, options) {\n options = options || {};\n\n function localRequire(deps, callback, errback) {\n var id, map, requireMod;\n\n if (options.enableBuildCallback && callback && isFunction(callback)) {\n callback.__requireJsBuild = true;\n }\n\n if (typeof deps === 'string') {\n if (isFunction(callback)) {\n //Invalid call\n return onError(makeError('requireargs', 'Invalid require call'), errback);\n }\n\n //If require|exports|module are requested, get the\n //value for them from the special handlers. Caveat:\n //this only works while module is being defined.\n if (relMap && hasProp(handlers, deps)) {\n return handlers[deps](registry[relMap.id]);\n }\n\n //Synchronous access to one module. If require.get is\n //available (as in the Node adapter), prefer that.\n if (req.get) {\n return req.get(context, deps, relMap, localRequire);\n }\n\n //Normalize module name, if it contains . or ..\n map = makeModuleMap(deps, relMap, false, true);\n id = map.id;\n\n if (!hasProp(defined, id)) {\n return onError(makeError('notloaded', 'Module name \"' +\n id +\n '\" has not been loaded yet for context: ' +\n contextName +\n (relMap ? '' : '. Use require([])')));\n }\n return defined[id];\n }\n\n //Grab defines waiting in the global queue.\n intakeDefines();\n\n //Mark all the dependencies as needing to be loaded.\n context.nextTick(function () {\n //Some defines could have been added since the\n //require call, collect them.\n intakeDefines();\n\n requireMod = getModule(makeModuleMap(null, relMap));\n\n //Store if map config should be applied to this require\n //call for dependencies.\n requireMod.skipMap = options.skipMap;\n\n requireMod.init(deps, callback, errback, {\n enabled: true\n });\n\n checkLoaded();\n });\n\n return localRequire;\n }\n\n mixin(localRequire, {\n isBrowser: isBrowser,\n\n /**\n * Converts a module name + .extension into an URL path.\n * *Requires* the use of a module name. It does not support using\n * plain URLs like nameToUrl.\n */\n toUrl: function (moduleNamePlusExt) {\n var ext,\n index = moduleNamePlusExt.lastIndexOf('.'),\n segment = moduleNamePlusExt.split('/')[0],\n isRelative = segment === '.' || segment === '..';\n\n //Have a file extension alias, and it is not the\n //dots from a relative path.\n if (index !== -1 && (!isRelative || index > 1)) {\n ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);\n moduleNamePlusExt = moduleNamePlusExt.substring(0, index);\n }\n\n return context.nameToUrl(normalize(moduleNamePlusExt,\n relMap && relMap.id, true), ext, true);\n },\n\n defined: function (id) {\n return hasProp(defined, makeModuleMap(id, relMap, false, true).id);\n },\n\n specified: function (id) {\n id = makeModuleMap(id, relMap, false, true).id;\n return hasProp(defined, id) || hasProp(registry, id);\n }\n });\n\n //Only allow undef on top level require calls\n if (!relMap) {\n localRequire.undef = function (id) {\n //Bind any waiting define() calls to this context,\n //fix for #408\n takeGlobalQueue();\n\n var map = makeModuleMap(id, relMap, true),\n mod = getOwn(registry, id);\n\n mod.undefed = true;\n removeScript(id);\n\n delete defined[id];\n delete urlFetched[map.url];\n delete undefEvents[id];\n\n //Clean queued defines too. Go backwards\n //in array so that the splices do not\n //mess up the iteration.\n eachReverse(defQueue, function(args, i) {\n if (args[0] === id) {\n defQueue.splice(i, 1);\n }\n });\n delete context.defQueueMap[id];\n\n if (mod) {\n //Hold on to listeners in case the\n //module will be attempted to be reloaded\n //using a different config.\n if (mod.events.defined) {\n undefEvents[id] = mod.events;\n }\n\n cleanRegistry(id);\n }\n };\n }\n\n return localRequire;\n },\n\n /**\n * Called to enable a module if it is still in the registry\n * awaiting enablement. A second arg, parent, the parent module,\n * is passed in for context, when this method is overridden by\n * the optimizer. Not shown here to keep code compact.\n */\n enable: function (depMap) {\n var mod = getOwn(registry, depMap.id);\n if (mod) {\n getModule(depMap).enable();\n }\n },\n\n /**\n * Internal method used by environment adapters to complete a load event.\n * A load event could be a script load or just a load pass from a synchronous\n * load call.\n * @param {String} moduleName the name of the module to potentially complete.\n */\n completeLoad: function (moduleName) {\n var found, args, mod,\n shim = getOwn(config.shim, moduleName) || {},\n shExports = shim.exports;\n\n takeGlobalQueue();\n\n while (defQueue.length) {\n args = defQueue.shift();\n if (args[0] === null) {\n args[0] = moduleName;\n //If already found an anonymous module and bound it\n //to this name, then this is some other anon module\n //waiting for its completeLoad to fire.\n if (found) {\n break;\n }\n found = true;\n } else if (args[0] === moduleName) {\n //Found matching define call for this script!\n found = true;\n }\n\n callGetModule(args);\n }\n context.defQueueMap = {};\n\n //Do this after the cycle of callGetModule in case the result\n //of those calls/init calls changes the registry.\n mod = getOwn(registry, moduleName);\n\n if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {\n if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {\n if (hasPathFallback(moduleName)) {\n return;\n } else {\n return onError(makeError('nodefine',\n 'No define call for ' + moduleName,\n null,\n [moduleName]));\n }\n } else {\n //A script that does not call define(), so just simulate\n //the call for it.\n callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);\n }\n }\n\n checkLoaded();\n },\n\n /**\n * Converts a module name to a file path. Supports cases where\n * moduleName may actually be just an URL.\n * Note that it **does not** call normalize on the moduleName,\n * it is assumed to have already been normalized. This is an\n * internal API, not a public one. Use toUrl for the public API.\n */\n nameToUrl: function (moduleName, ext, skipExt) {\n var paths, syms, i, parentModule, url,\n parentPath, bundleId,\n pkgMain = getOwn(config.pkgs, moduleName);\n\n if (pkgMain) {\n moduleName = pkgMain;\n }\n\n bundleId = getOwn(bundlesMap, moduleName);\n\n if (bundleId) {\n return context.nameToUrl(bundleId, ext, skipExt);\n }\n\n //If a colon is in the URL, it indicates a protocol is used and it is just\n //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)\n //or ends with .js, then assume the user meant to use an url and not a module id.\n //The slash is important for protocol-less URLs as well as full paths.\n if (req.jsExtRegExp.test(moduleName)) {\n //Just a plain path, not module name lookup, so just return it.\n //Add extension if it is included. This is a bit wonky, only non-.js things pass\n //an extension, this method probably needs to be reworked.\n url = moduleName + (ext || '');\n } else {\n //A module that needs to be converted to a path.\n paths = config.paths;\n\n syms = moduleName.split('/');\n //For each module name segment, see if there is a path\n //registered for it. Start with most specific name\n //and work up from it.\n for (i = syms.length; i > 0; i -= 1) {\n parentModule = syms.slice(0, i).join('/');\n\n parentPath = getOwn(paths, parentModule);\n if (parentPath) {\n //If an array, it means there are a few choices,\n //Choose the one that is desired\n if (isArray(parentPath)) {\n parentPath = parentPath[0];\n }\n syms.splice(0, i, parentPath);\n break;\n }\n }\n\n //Join the path parts together, then figure out if baseUrl is needed.\n url = syms.join('/');\n url += (ext || (/^data\\:|^blob\\:|\\?/.test(url) || skipExt ? '' : '.js'));\n url = (url.charAt(0) === '/' || url.match(/^[\\w\\+\\.\\-]+:/) ? '' : config.baseUrl) + url;\n }\n\n return config.urlArgs && !/^blob\\:/.test(url) ?\n url + config.urlArgs(moduleName, url) : url;\n },\n\n //Delegates to req.load. Broken out as a separate function to\n //allow overriding in the optimizer.\n load: function (id, url) {\n req.load(context, id, url);\n },\n\n /**\n * Executes a module callback function. Broken out as a separate function\n * solely to allow the build system to sequence the files in the built\n * layer in the right sequence.\n *\n * @private\n */\n execCb: function (name, callback, args, exports) {\n return callback.apply(exports, args);\n },\n\n /**\n * callback for script loads, used to check status of loading.\n *\n * @param {Event} evt the event from the browser for the script\n * that was loaded.\n */\n onScriptLoad: function (evt) {\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\n //all old browsers will be supported, but this one was easy enough\n //to support and still makes sense.\n if (evt.type === 'load' ||\n (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {\n //Reset interactive script so a script node is not held onto for\n //to long.\n interactiveScript = null;\n\n //Pull out the name of the module and the context.\n var data = getScriptData(evt);\n context.completeLoad(data.id);\n }\n },\n\n /**\n * Callback for script errors.\n */\n onScriptError: function (evt) {\n var data = getScriptData(evt);\n if (!hasPathFallback(data.id)) {\n var parents = [];\n eachProp(registry, function(value, key) {\n if (key.indexOf('_@r') !== 0) {\n each(value.depMaps, function(depMap) {\n if (depMap.id === data.id) {\n parents.push(key);\n return true;\n }\n });\n }\n });\n return onError(makeError('scripterror', 'Script error for \"' + data.id +\n (parents.length ?\n '\", needed by: ' + parents.join(', ') :\n '\"'), evt, [data.id]));\n }\n }\n };\n\n context.require = context.makeRequire();\n return context;\n }\n\n /**\n * Main entry point.\n *\n * If the only argument to require is a string, then the module that\n * is represented by that string is fetched for the appropriate context.\n *\n * If the first argument is an array, then it will be treated as an array\n * of dependency string names to fetch. An optional function callback can\n * be specified to execute when all of those dependencies are available.\n *\n * Make a local req variable to help Caja compliance (it assumes things\n * on a require that are not standardized), and to give a short\n * name for minification/local scope use.\n */\n req = requirejs = function (deps, callback, errback, optional) {\n\n //Find the right context, use default\n var context, config,\n contextName = defContextName;\n\n // Determine if have config object in the call.\n if (!isArray(deps) && typeof deps !== 'string') {\n // deps is a config object\n config = deps;\n if (isArray(callback)) {\n // Adjust args if there are dependencies\n deps = callback;\n callback = errback;\n errback = optional;\n } else {\n deps = [];\n }\n }\n\n if (config && config.context) {\n contextName = config.context;\n }\n\n context = getOwn(contexts, contextName);\n if (!context) {\n context = contexts[contextName] = req.s.newContext(contextName);\n }\n\n if (config) {\n context.configure(config);\n }\n\n return context.require(deps, callback, errback);\n };\n\n /**\n * Support require.config() to make it easier to cooperate with other\n * AMD loaders on globally agreed names.\n */\n req.config = function (config) {\n return req(config);\n };\n\n /**\n * Execute something after the current tick\n * of the event loop. Override for other envs\n * that have a better solution than setTimeout.\n * @param {Function} fn function to execute later.\n */\n req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {\n setTimeout(fn, 4);\n } : function (fn) { fn(); };\n\n /**\n * Export require as a global, but only if it does not already exist.\n */\n if (!require) {\n require = req;\n }\n\n req.version = version;\n\n //Used to filter out dependencies that are already paths.\n req.jsExtRegExp = /^\\/|:|\\?|\\.js$/;\n req.isBrowser = isBrowser;\n s = req.s = {\n contexts: contexts,\n newContext: newContext\n };\n\n //Create default context.\n req({});\n\n //Exports some context-sensitive methods on global require.\n each([\n 'toUrl',\n 'undef',\n 'defined',\n 'specified'\n ], function (prop) {\n //Reference from contexts instead of early binding to default context,\n //so that during builds, the latest instance of the default context\n //with its config gets used.\n req[prop] = function () {\n var ctx = contexts[defContextName];\n return ctx.require[prop].apply(ctx, arguments);\n };\n });\n\n if (isBrowser) {\n head = s.head = document.getElementsByTagName('head')[0];\n //If BASE tag is in play, using appendChild is a problem for IE6.\n //When that browser dies, this can be removed. Details in this jQuery bug:\n //http://dev.jquery.com/ticket/2709\n baseElement = document.getElementsByTagName('base')[0];\n if (baseElement) {\n head = s.head = baseElement.parentNode;\n }\n }\n\n /**\n * Any errors that require explicitly generates will be passed to this\n * function. Intercept/override it if you want custom error handling.\n * @param {Error} err the error object.\n */\n req.onError = defaultOnError;\n\n /**\n * Creates the node for the load command. Only used in browser envs.\n */\n req.createNode = function (config, moduleName, url) {\n var node = config.xhtml ?\n document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :\n document.createElement('script');\n node.type = config.scriptType || 'text/javascript';\n node.charset = 'utf-8';\n node.async = true;\n return node;\n };\n\n /**\n * Does the request to load a module for the browser case.\n * Make this a separate function to allow other environments\n * to override it.\n *\n * @param {Object} context the require context to find state.\n * @param {String} moduleName the name of the module.\n * @param {Object} url the URL to the module.\n */\n req.load = function (context, moduleName, url) {\n var config = (context && context.config) || {},\n node;\n if (isBrowser) {\n //In the browser so use a script tag\n node = req.createNode(config, moduleName, url);\n\n node.setAttribute('data-requirecontext', context.contextName);\n node.setAttribute('data-requiremodule', moduleName);\n\n //Set up load listener. Test attachEvent first because IE9 has\n //a subtle issue in its addEventListener and script onload firings\n //that do not match the behavior of all other browsers with\n //addEventListener support, which fire the onload event for a\n //script right after the script execution. See:\n //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution\n //UNFORTUNATELY Opera implements attachEvent but does not follow the script\n //script execution mode.\n if (node.attachEvent &&\n //Check if node.attachEvent is artificially added by custom script or\n //natively supported by browser\n //read https://github.com/requirejs/requirejs/issues/187\n //if we can NOT find [native code] then it must NOT natively supported.\n //in IE8, node.attachEvent does not have toString()\n //Note the test for \"[native code\" with no closing brace, see:\n //https://github.com/requirejs/requirejs/issues/273\n !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&\n !isOpera) {\n //Probably IE. IE (at least 6-8) do not fire\n //script onload right after executing the script, so\n //we cannot tie the anonymous define call to a name.\n //However, IE reports the script as being in 'interactive'\n //readyState at the time of the define call.\n useInteractive = true;\n\n node.attachEvent('onreadystatechange', context.onScriptLoad);\n //It would be great to add an error handler here to catch\n //404s in IE9+. However, onreadystatechange will fire before\n //the error handler, so that does not help. If addEventListener\n //is used, then IE will fire error before load, but we cannot\n //use that pathway given the connect.microsoft.com issue\n //mentioned above about not doing the 'script execute,\n //then fire the script load event listener before execute\n //next script' that other browsers do.\n //Best hope: IE10 fixes the issues,\n //and then destroys all installs of IE 6-9.\n //node.attachEvent('onerror', context.onScriptError);\n } else {\n node.addEventListener('load', context.onScriptLoad, false);\n node.addEventListener('error', context.onScriptError, false);\n }\n node.src = url;\n\n //Calling onNodeCreated after all properties on the node have been\n //set, but before it is placed in the DOM.\n if (config.onNodeCreated) {\n config.onNodeCreated(node, config, moduleName, url);\n }\n\n //For some cache cases in IE 6-8, the script executes before the end\n //of the appendChild execution, so to tie an anonymous define\n //call to the module name (which is stored on the node), hold on\n //to a reference to this node, but clear after the DOM insertion.\n currentlyAddingScript = node;\n if (baseElement) {\n head.insertBefore(node, baseElement);\n } else {\n head.appendChild(node);\n }\n currentlyAddingScript = null;\n\n return node;\n } else if (isWebWorker) {\n try {\n //In a web worker, use importScripts. This is not a very\n //efficient use of importScripts, importScripts will block until\n //its script is downloaded and evaluated. However, if web workers\n //are in play, the expectation is that a build has been done so\n //that only one script needs to be loaded anyway. This may need\n //to be reevaluated if other use cases become common.\n\n // Post a task to the event loop to work around a bug in WebKit\n // where the worker gets garbage-collected after calling\n // importScripts(): https://webkit.org/b/153317\n setTimeout(function() {}, 0);\n importScripts(url);\n\n //Account for anonymous modules\n context.completeLoad(moduleName);\n } catch (e) {\n context.onError(makeError('importscripts',\n 'importScripts failed for ' +\n moduleName + ' at ' + url,\n e,\n [moduleName]));\n }\n }\n };\n\n function getInteractiveScript() {\n if (interactiveScript && interactiveScript.readyState === 'interactive') {\n return interactiveScript;\n }\n\n eachReverse(scripts(), function (script) {\n if (script.readyState === 'interactive') {\n return (interactiveScript = script);\n }\n });\n return interactiveScript;\n }\n\n //Look for a data-main script attribute, which could also adjust the baseUrl.\n if (isBrowser && !cfg.skipDataMain) {\n //Figure out baseUrl. Get it from the script tag with require.js in it.\n eachReverse(scripts(), function (script) {\n //Set the 'head' where we can append children by\n //using the script's parent.\n if (!head) {\n head = script.parentNode;\n }\n\n //Look for a data-main attribute to set main script for the page\n //to load. If it is there, the path to data main becomes the\n //baseUrl, if it is not already set.\n dataMain = script.getAttribute('data-main');\n if (dataMain) {\n //Preserve dataMain in case it is a path (i.e. contains '?')\n mainScript = dataMain;\n\n //Set final baseUrl if there is not already an explicit one,\n //but only do so if the data-main value is not a loader plugin\n //module ID.\n if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {\n //Pull off the directory of data-main for use as the\n //baseUrl.\n src = mainScript.split('/');\n mainScript = src.pop();\n subPath = src.length ? src.join('/') + '/' : './';\n\n cfg.baseUrl = subPath;\n }\n\n //Strip off any trailing .js since mainScript is now\n //like a module name.\n mainScript = mainScript.replace(jsSuffixRegExp, '');\n\n //If mainScript is still a path, fall back to dataMain\n if (req.jsExtRegExp.test(mainScript)) {\n mainScript = dataMain;\n }\n\n //Put the data-main script in the files to load.\n cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];\n\n return true;\n }\n });\n }\n\n /**\n * The function that handles definitions of modules. Differs from\n * require() in that a string for the module should be the first argument,\n * and the function to execute after dependencies are loaded should\n * return a value to define the module corresponding to the first argument's\n * name.\n */\n define = function (name, deps, callback) {\n var node, context;\n\n //Allow for anonymous modules\n if (typeof name !== 'string') {\n //Adjust args appropriately\n callback = deps;\n deps = name;\n name = null;\n }\n\n //This module may not have dependencies\n if (!isArray(deps)) {\n callback = deps;\n deps = null;\n }\n\n //If no name, and callback is a function, then figure out if it a\n //CommonJS thing with dependencies.\n if (!deps && isFunction(callback)) {\n deps = [];\n //Remove comments from the callback string,\n //look for require calls, and pull them into the dependencies,\n //but only if there are function args.\n if (callback.length) {\n callback\n .toString()\n .replace(commentRegExp, commentReplace)\n .replace(cjsRequireRegExp, function (match, dep) {\n deps.push(dep);\n });\n\n //May be a CommonJS thing even without require calls, but still\n //could use exports, and module. Avoid doing exports and module\n //work though if it just needs require.\n //REQUIRES the function to expect the CommonJS variables in the\n //order listed below.\n deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);\n }\n }\n\n //If in IE 6-8 and hit an anonymous define() call, do the interactive\n //work.\n if (useInteractive) {\n node = currentlyAddingScript || getInteractiveScript();\n if (node) {\n if (!name) {\n name = node.getAttribute('data-requiremodule');\n }\n context = contexts[node.getAttribute('data-requirecontext')];\n }\n }\n\n //Always save off evaluating the def call until the script onload handler.\n //This allows multiple modules to be in a file without prematurely\n //tracing dependencies, and allows for anonymous module support,\n //where the module name is not known until the script onload event\n //occurs. If no context, use the global queue, and get it processed\n //in the onscript load callback.\n if (context) {\n context.defQueue.push([name, deps, callback]);\n context.defQueueMap[name] = true;\n } else {\n globalDefQueue.push([name, deps, callback]);\n }\n };\n\n define.amd = {\n jQuery: true\n };\n\n /**\n * Executes the text. Normally just uses eval, but can be modified\n * to use a better, environment-specific call. Only used for transpiling\n * loader plugins, not for plain JS modules.\n * @param {String} text the text to execute/evaluate.\n */\n req.exec = function (text) {\n /*jslint evil: true */\n return eval(text);\n };\n\n //Set up with config info.\n req(cfg);\n}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout)));\n\ndefine(\"requireLib\", function(){});\n\n",
|
|
26
|
-
"// uuid.js\n//\n// Copyright (c) 2010-2012 Robert Kieffer\n// MIT License - http://opensource.org/licenses/mit-license.php\n\n/*global window, require, define */\n(function(_window) {\n 'use strict';\n\n // Unique ID creation requires a high quality random # generator. We feature\n // detect to determine the best RNG source, normalizing to a function that\n // returns 128-bits of randomness, since that's what's usually required\n var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot;\n\n function setupBrowser() {\n // Allow for MSIE11 msCrypto\n var _crypto = _window.crypto || _window.msCrypto;\n\n if (!_rng && _crypto && _crypto.getRandomValues) {\n // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n //\n // Moderately fast, high quality\n try {\n var _rnds8 = new Uint8Array(16);\n _whatwgRNG = _rng = function whatwgRNG() {\n _crypto.getRandomValues(_rnds8);\n return _rnds8;\n };\n _rng();\n } catch(e) {}\n }\n\n if (!_rng) {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var _rnds = new Array(16);\n _mathRNG = _rng = function() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; }\n _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return _rnds;\n };\n if ('undefined' !== typeof console && console.warn) {\n console.warn(\"[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()\");\n }\n }\n }\n\n function setupNode() {\n // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html\n //\n // Moderately fast, high quality\n if ('function' === typeof require) {\n try {\n var _rb = require('crypto').randomBytes;\n _nodeRNG = _rng = _rb && function() {return _rb(16);};\n _rng();\n } catch(e) {}\n }\n }\n\n if (_window) {\n setupBrowser();\n } else {\n setupNode();\n }\n\n // Buffer class to use\n var BufferClass = ('function' === typeof Buffer) ? Buffer : Array;\n\n // Maps for number <-> hex string conversion\n var _byteToHex = [];\n var _hexToByte = {};\n for (var i = 0; i < 256; i++) {\n _byteToHex[i] = (i + 0x100).toString(16).substr(1);\n _hexToByte[_byteToHex[i]] = i;\n }\n\n // **`parse()` - Parse a UUID into it's component bytes**\n function parse(s, buf, offset) {\n var i = (buf && offset) || 0, ii = 0;\n\n buf = buf || [];\n s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {\n if (ii < 16) { // Don't overflow!\n buf[i + ii++] = _hexToByte[oct];\n }\n });\n\n // Zero out remaining bytes if string was short\n while (ii < 16) {\n buf[i + ii++] = 0;\n }\n\n return buf;\n }\n\n // **`unparse()` - Convert UUID byte array (ala parse()) into a string**\n function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }\n\n // **`v1()` - Generate time-based UUID**\n //\n // Inspired by https://github.com/LiosK/UUID.js\n // and http://docs.python.org/library/uuid.html\n\n // random #'s we need to init node and clockseq\n var _seedBytes = _rng();\n\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n var _nodeId = [\n _seedBytes[0] | 0x01,\n _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]\n ];\n\n // Per 4.2.2, randomize (14 bit) clockseq\n var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;\n\n // Previous uuid creation time\n var _lastMSecs = 0, _lastNSecs = 0;\n\n // See https://github.com/broofa/node-uuid for API details\n function v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n\n var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq;\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = (options.msecs != null) ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq == null) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n var node = options.node || _nodeId;\n for (var n = 0; n < 6; n++) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : unparse(b);\n }\n\n // **`v4()` - Generate random UUID**\n\n // See https://github.com/broofa/node-uuid for API details\n function v4(options, buf, offset) {\n // Deprecated - 'format' argument, as supported in v1.2\n var i = buf && offset || 0;\n\n if (typeof(options) === 'string') {\n buf = (options === 'binary') ? new BufferClass(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || _rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ii++) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || unparse(rnds);\n }\n\n // Export public API\n var uuid = v4;\n uuid.v1 = v1;\n uuid.v4 = v4;\n uuid.parse = parse;\n uuid.unparse = unparse;\n uuid.BufferClass = BufferClass;\n uuid._rng = _rng;\n uuid._mathRNG = _mathRNG;\n uuid._nodeRNG = _nodeRNG;\n uuid._whatwgRNG = _whatwgRNG;\n\n if (('undefined' !== typeof module) && module.exports) {\n // Publish as node.js module\n module.exports = uuid;\n } else if (typeof define === 'function' && define.amd) {\n // Publish as AMD module\n define('vendor/uuid',[],function() {return uuid;});\n\n\n } else {\n // Publish as global (in browsers)\n _previousRoot = _window.uuid;\n\n // **`noConflict()` - (browser only) to reset global 'uuid' var**\n uuid.noConflict = function() {\n _window.uuid = _previousRoot;\n return uuid;\n };\n\n _window.uuid = uuid;\n }\n})('undefined' !== typeof window ? window : null);\n\n",
|
|
27
|
-
"function Merge() {\n var newTarget = [];\n /**\n *\n * @param {object} target - Target object\n * @param {object} source - Source object\n * @param {boolean} [override] - Override when copying\n *\n * @return {object} [result]\n * */\n var browse = function (target, source) {\n\n if ( typeof(target) == 'undefined' ) {\n target = ( typeof(source) != 'undefined' && Array.isArray(source)) ? [] : {}\n }\n\n var override = false;\n if (( typeof(arguments[arguments.length-1]) == 'boolean' )) {\n override = arguments[arguments.length-1]\n }\n\n var i = 1;\n var length = arguments.length;\n\n var options, name, src, copy, copyIsArray, clone;\n\n\n\n // Handle case when target is a string or something (possible in deep copy)\n if (typeof(target) !== 'object' && typeof(target) !== 'function') {\n if (override) {\n if (typeof(arguments[2]) == 'undefined') {\n target = arguments[1]\n } else {\n target = arguments[2]\n }\n } else {\n if (typeof(arguments[0]) == 'undefined') {\n target = arguments[1]\n } else {\n target = arguments[0]\n }\n }\n\n } else {\n\n for (; i < length; i++) {\n // Only deal with non-null/undefined values\n if ( typeof(arguments[i]) != 'boolean' && ( options = arguments[i]) != null) {\n if ( typeof(options) != 'object') {\n target = options;\n break;\n }\n\n // both target & options are arrays\n if ( Array.isArray(options) && Array.isArray(target) ) {\n\n\n target = mergeArray(options, target, override);\n\n } else {\n // Merge the base object\n for (var name in options) {\n if (!target) {\n target = { name: null }\n }\n\n src = target[ name ] ;\n copy = options[ name ];\n\n\n // Prevent never-ending loop\n if (target === copy) {\n continue\n }\n\n // Recurse if we're merging plain objects or arrays\n if (\n copy\n && (\n isObject(copy) ||\n ( copyIsArray = Array.isArray(copy) )\n )\n ) {\n\n var createMode = false;\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && Array.isArray(src) ? src : [];\n\n newTarget = clone;\n clone = mergeArray(copy, clone, override);\n target[ name ] = clone;\n continue\n\n } else {\n\n clone = src && isObject(src) ? src : null;\n\n if (!clone) {\n createMode = true;\n clone = {};\n // copy props\n for (var prop in copy) {\n clone[prop] = copy[prop]\n }\n }\n }\n\n\n\n //[propose] Supposed to go deep... deep... deep...\n if ( !override ) {\n // add those in copy not in clone (target)\n\n for (var prop in copy) {\n if (typeof(clone[ prop ]) == 'undefined') {\n if ( Array.isArray(copy[ prop ]) && Array.isArray(clone[ prop ]) ) {\n clone[ prop ] = mergeArray(copy[ prop ], clone[ prop ], override);\n } else {\n clone[ prop ] = copy[ prop ] // don't override existing\n }\n } else if ( Array.isArray(copy[ prop ]) && Array.isArray(clone[ prop ]) ) {\n clone[ prop ] = mergeArray(copy[ prop ], clone[ prop ], override);\n }\n }\n\n\n\n // Never move original objects, clone them\n if (typeof(src) != \"boolean\" && !createMode ) {//if property is not boolean\n //target[ name ] = browse(clone, copy, override)\n process.nextTick(function onBrowse() {\n target[ name ] = browse(clone, copy, override)\n });\n\n } else if (createMode) {\n target[ name ] = clone;\n }\n\n } else {\n\n for (var prop in copy) {\n if ( typeof(copy[ prop ]) != 'undefined' ) {\n //clone[prop] = copy[prop]\n if ( Array.isArray(copy[ prop ]) && Array.isArray(clone[ prop ]) ) {\n clone[ prop ] = mergeArray(copy[ prop ], clone[ prop ], override);\n } else {\n clone[ prop ] = copy[ prop ] // don't override existing\n }\n } else if ( Array.isArray(copy[ prop ]) && Array.isArray(clone[ prop ]) ) {\n clone[ prop ] = mergeArray(copy[ prop ], clone[ prop ], override);\n }\n }\n\n target[ name ] = clone\n }\n\n } else if (copy !== undefined) {\n //[propose]Don't override existing if prop defined or override @ false\n if (\n typeof(src) != \"undefined\"\n && src != null\n && src !== copy && !override\n ) {\n target[ name ] = src\n } else {\n target[ name ] = copy;\n }\n\n }\n }\n }\n }\n\n }\n\n }\n\n newTarget = [];\n return target\n }\n\n // Will not merge functions items: this is normal\n // Merging arrays is OK, but merging collections is still experimental\n var mergeArray = function(options, target, override) {\n newTarget = [];\n\n if (override) {\n\n // if collection, comparison will be done uppon the `id` attribute\n if (\n typeof(options[0]) == 'object' && typeof(options[0].id) != 'undefined'\n && typeof(target[0]) == 'object' && typeof(target[0].id) != 'undefined'\n ) {\n\n newTarget = JSON.parse(JSON.stringify(target));\n var _options = JSON.parse(JSON.stringify(options));\n var next = null;\n\n for (var a = 0, aLen = target.length; a < aLen; ++a) {\n\n for (var n = next || 0, nLen = _options.length; n < nLen; ++n) {\n if ( typeof(_options[n].id) != 'undefined' && _options[n].id === target[a].id ) {\n newTarget[a] = _options[n];\n\n next = n+1;\n break\n } else {\n newTarget.push(_options[n]);\n\n next = n+1;\n break\n }\n }\n }\n\n return newTarget\n\n } else { // normal case `arrays` or merging from a blank collection\n return options\n }\n }\n\n if ( options.length == 0 && target.length > 0) {\n newTarget = target;\n }\n\n if ( target.length == 0 && options.length > 0) {\n for (var a = 0; a < options.length; ++a ) {\n target.push(options[a]);\n }\n }\n\n if (newTarget.length == 0 && target.length > 0) {\n // ok, but don't merge objects\n for (var a = 0; a < target.length; ++a ) {\n if ( typeof(target[a]) != 'object' && newTarget.indexOf(target[a]) == -1)\n newTarget.push(target[a]);\n }\n }\n\n if ( target.length > 0 ) {\n\n // if collection, comparison will be done uppon the `id` attribute\n if (\n typeof(options[0]) == 'object' && typeof(options[0].id) != 'undefined'\n && typeof(target[0]) == 'object' && typeof(target[0].id) != 'undefined'\n ) {\n\n newTarget = JSON.parse(JSON.stringify(target))\n var _options = JSON.parse(JSON.stringify(options));\n var next = null;\n\n for (var a = 0, aLen = newTarget.length; a < aLen; ++a) {\n end:\n for (var n = next || 0, nLen = _options.length; n < nLen; ++n) {\n\n if (\n _options[n] != null && typeof(_options[n].id) != 'undefined' && _options[n].id !== newTarget[a].id\n\n ) {\n newTarget.push(_options[n]);\n\n next = n+1;\n break end;\n } else if( _options[n] != null && typeof(_options[n].id) != 'undefined' && _options[n].id === newTarget[a].id ) {\n\n next = n+1;\n break end;\n\n } else {\n break end;\n }\n\n }\n\n\n }\n\n return newTarget\n\n\n } else { // normal case `arrays`\n for (var a = 0; a < options.length; ++a ) {\n if ( target.indexOf(options[a]) > -1 && override) {\n target.splice(target.indexOf(options[a]), 1, options[a])\n } else {\n if (newTarget.indexOf(options[a]) == -1)\n newTarget.push(options[a]);\n }\n }\n }\n\n\n }\n\n if (newTarget.length > 0 && target.length > 0 ) {\n return newTarget\n }\n }\n\n\n /**\n * Check if object before merging.\n * */\n var isObject = function (obj) {\n if (\n !obj\n || {}.toString.call(obj) !== '[object Object]'\n || obj.nodeType\n || obj.setInterval\n ) {\n return false\n }\n\n var hasOwn = {}.hasOwnProperty;\n var hasOwnConstructor = hasOwn.call(obj, 'constructor');\n // added test for node > v6\n var hasMethodPrototyped = ( typeof(obj.constructor) != 'undefined' ) ? hasOwn.call(obj.constructor.prototype, 'isPrototypeOf') : false;\n\n\n if (\n obj.constructor && !hasOwnConstructor && !hasMethodPrototyped\n ) {\n return false\n }\n\n //Own properties are enumerated firstly, so to speed up,\n //if last one is own, then all properties are own.\n var key;\n return key === undefined || hasOwn.call(obj, key)\n }\n\n return browse\n}\n\nif ( ( typeof(module) !== 'undefined' ) && module.exports ) {\n // Publish as node.js module\n module.exports = Merge()\n} else if ( typeof(define) === 'function' && define.amd) {\n // Publish as AMD module\n define( 'utils/merge',[],function() { return Merge() })\n};\n",
|
|
28
|
-
"function registerEvents(plugin, events) {\n gina.registeredEvents[plugin] = events\n}\n\nfunction addListener(target, element, name, callback) {\n\n if ( typeof(target.event) != 'undefined' && target.event.isTouchSupported && /^(click|mouseout|mouseover)/.test(name) && target.event[name].indexOf(element) == -1) {\n target.event[name][target.event[name].length] = element\n }\n\n if (typeof(element) != 'undefined' && element != null) {\n if (element.addEventListener) {\n element.addEventListener(name, callback, false)\n } else if (element.attachEvent) {\n element.attachEvent('on' + name, callback)\n }\n } else {\n target.customEvent.addListener(name, callback)\n }\n\n gina.events[name] = ( typeof(element.id) != 'undefined' && typeof(element.id) != 'object' ) ? element.id : element.getAttribute('id')\n}\n\nfunction triggerEvent (target, element, name, args) {\n if (typeof(element) != 'undefined' && element != null) {\n var evt = null, isDefaultPrevented = false, isAttachedToDOM = false;\n\n // done separately because it can be listen at the same time by the user & by gina\n if ( jQuery ) { //thru jQuery if detected\n\n // Check if listener is in use: e.g $('#selector').on('eventName', cb)\n var $events = null; // attached events list\n // Before jQuery 1.7\n var version = jQuery['fn']['jquery'].split(/\\./);\n if (version.length > 2) {\n version = version.splice(0,2).join('.');\n } else {\n version = version.join('.');\n }\n\n if (version <= '1.7') {\n $events = jQuery(element)['data']('events')\n } else {// From 1.8 +\n $events = jQuery['_data'](jQuery(element)[0], \"events\")\n }\n\n isAttachedToDOM = ( typeof($events) != 'undefined' && typeof($events[name]) != 'undefined' ) ? true : false;\n\n if (isAttachedToDOM) { // only trigger if attached\n evt = jQuery.Event( name );\n jQuery(element)['trigger'](evt, args);\n isDefaultPrevented = evt['isDefaultPrevented']();\n }\n\n\n }\n\n if (window.CustomEvent || document.createEvent) {\n\n if (window.CustomEvent) { // new method from ie9\n evt = new CustomEvent(name, {\n 'detail' : args,\n 'bubbles' : true,\n 'cancelable': true,\n 'target' : element\n })\n } else { // before ie9\n\n evt = document.createEvent('HTMLEvents');\n // OR\n // evt = document.createEvent('Event');\n\n evt['detail'] = args;\n evt['target'] = element;\n evt.initEvent(name, true, true);\n\n evt['eventName'] = name;\n\n }\n\n if ( typeof(evt.defaultPrevented) != 'undefined' && evt.defaultPrevented )\n isDefaultPrevented = evt.defaultPrevented;\n\n if ( !isDefaultPrevented ) {\n //console.log('dispatching ['+name+'] to ', element.id, isAttachedToDOM, evt.detail);\n element.dispatchEvent(evt)\n }\n\n } else if (document.createEventObject) { // non standard\n evt = document.createEventObject();\n evt.srcElement.id = element.id;\n evt.detail = args;\n evt.target = element;\n element.fireEvent('on' + name, evt)\n }\n\n } else {\n target.customEvent.fire(name, args)\n }\n}\n\nfunction cancelEvent(event) {\n if (typeof(event) != 'undefined' && event != null) {\n\n event.cancelBubble = true;\n\n if (event.preventDefault) {\n event.preventDefault()\n }\n\n if (event.stopPropagation) {\n event.stopPropagation()\n }\n\n\n event.returnValue = false;\n }\n}\n\nfunction removeListener(target, element, name, callback) {\n if (typeof(target.event) != 'undefined' && target.event.isTouchSupported && /^(click|mouseout|mouseover)/.test(name) && target.event[name].indexOf(element) != -1) {\n target.event[name].splice(target.event[name].indexOf(element), 1)\n }\n\n if (typeof(element) != 'undefined' && element != null) {\n if (element.removeEventListener) {\n element.removeEventListener(name, callback, false)\n } else if (element.attachEvent) {\n element.detachEvent('on' + name, callback)\n }\n } else {\n target.customEvent.removeListener(name, callback)\n }\n\n //console.log('tying to removing ', name, element);// avoid event proxies\n //if (! /^(click|submit)$/.test(name))\n if ( /**! /^(click|submit)$/.test(name) &&*/ typeof(gina.events[name]) != 'undefined' ) {\n //console.log('------> [removed] ' + name);\n delete gina.events[name]\n }\n}\n\nfunction on(event, cb) {\n\n if (!this.plugin) throw new Error('No `plugin` reference found for this event: `'+ event);\n\n var events = gina.registeredEvents[this.plugin];\n\n if ( events.indexOf(event) < 0 && !/^init$/.test(event) ) {\n cb(new Error('Event `'+ event +'` not handled by ginaEventHandler'))\n } else {\n var $target = null, id = null;\n if ( typeof(this.id) != 'undefined' && typeof(this.id) != 'object' ) {\n $target = this.target || this;\n id = this.id;\n } else if ( typeof(this.target) != 'undefined' ) {\n $target = this.target;\n if (!$target) {\n $target = this;\n }\n id = ( typeof($target.getAttribute) != 'undefined' ) ? $target.getAttribute('id') : this.id;\n } else {\n $target = this.target;\n id = instance.id;\n }\n\n if ( this.eventData && !$target.eventData)\n $target.eventData = this.eventData\n\n event += '.' + id;\n\n\n if (!gina.events[event]) {\n\n addListener(gina, $target, event, function(e) {\n\n cancelEvent(e);\n\n var data = null;\n if (e['detail']) {\n data = e['detail'];\n } else if ( typeof(this.eventData.submit) != 'undefined' ) {\n data = this.eventData.submit\n } else if ( typeof(this.eventData.error) != 'undefined' ) {\n data = this.eventData.error\n } else if ( typeof(this.eventData.success) != 'undefined' ) {\n data = this.eventData.success;\n }\n\n if (cb)\n cb(e, data);\n });\n\n if (this.initialized && !this.isReady)\n triggerEvent(gina, $target, 'init.' + id);\n\n }\n\n return this\n }\n}\n;\ndefine(\"utils/events\", function(){});\n\n",
|
|
29
|
-
"/**\n * Credits & thanks to Steven Levithan :)\n * http://blog.stevenlevithan.com/archives/date-time-format\n *\n * Date Format 1.2.3\n * (c) 2007-2009 Steven Levithan <stevenlevithan.com>\n * MIT license\n *\n * Includes enhancements by Scott Trenda <scott.trenda.net>\n * and Kris Kowal <cixar.com/~kris.kowal/>\n *\n * Accepts a date, a mask, or a date and a mask.\n * Returns a formatted version of the given date.\n * The date defaults to the current date/time.\n * The mask defaults to dateFormat.masks.default.\n *\n * @param {string} date\n * @param {string} mask\n */\nfunction DateFormatHelper() {\n\n var self = {};\n\n self.masks = {\n \"default\": \"ddd mmm dd yyyy HH:MM:ss\",\n shortDate: \"m/d/yy\",\n shortDate2: \"mm/dd/yyyy\",\n mediumDate: \"mmm d, yyyy\",\n longDate: \"mmmm d, yyyy\",\n fullDate: \"dddd, mmmm d, yyyy\",\n shortTime: \"h:MM TT\",\n shortTime2: \"h:MM\",\n mediumTime: \"h:MM:ss TT\",\n mediumTime2: \"h:MM:ss\",\n longTime: \"h:MM:ss TT Z\",\n longTime2: \"h:MM:ss TT\",\n concatenatedDate: \"yyyymmdd\",\n isoDate: \"yyyy-mm-dd\",\n isoTime: \"HH:MM:ss\",\n shortIsoTime: \"HH:MM\",\n longIsoTime: \"HH:MM:ss TT\",\n isoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n isoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n };\n\n\n self.i18n = {\n dayNames: [\n \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\",\n \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"\n ],\n monthNames: [\n \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\",\n \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ]\n };\n\n var format = function(date, mask, utc) {\n var dF = self;\n\n var\ttoken = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\\1?|[LloSZ]|\"[^\"]*\"|'[^']*'/g,\n timezone = /\\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\\d{4})?)\\b/g,\n timezoneClip = /[^-+\\dA-Z]/g,\n pad = function (val, len) {\n val = String(val);\n len = len || 2;\n while (val.length < len) val = \"0\" + val;\n return val;\n };\n\n // You can't provide utc if you skip other args (use the \"UTC:\" mask prefix)\n if (arguments.length == 1 && Object.prototype.toString.call(date) == \"[object String]\" && !/\\d/.test(date)) {\n mask = date;\n date = undefined;\n }\n\n // Passing date through Date applies Date.parse, if necessary\n date = date ? new Date(date) : new Date;\n if (isNaN(date)) throw SyntaxError(\"invalid date\");\n\n mask = String(dF.masks[mask] || mask || dF.masks[\"default\"]);\n\n // Allow setting the utc argument via the mask\n if (mask.slice(0, 4) == \"UTC:\") {\n mask = mask.slice(4);\n utc = true;\n }\n\n var\t_ = utc ? \"getUTC\" : \"get\",\n d = date[_ + \"Date\"](),\n D = date[_ + \"Day\"](),\n m = date[_ + \"Month\"](),\n y = date[_ + \"FullYear\"](),\n H = date[_ + \"Hours\"](),\n M = date[_ + \"Minutes\"](),\n s = date[_ + \"Seconds\"](),\n L = date[_ + \"Milliseconds\"](),\n o = utc ? 0 : date.getTimezoneOffset(),\n flags = {\n d: d,\n dd: pad(d),\n ddd: dF.i18n.dayNames[D],\n dddd: dF.i18n.dayNames[D + 7],\n m: m + 1,\n mm: pad(m + 1),\n mmm: dF.i18n.monthNames[m],\n mmmm: dF.i18n.monthNames[m + 12],\n yy: String(y).slice(2),\n yyyy: y,\n h: H % 12 || 12,\n hh: pad(H % 12 || 12),\n H: H,\n HH: pad(H),\n M: M,\n MM: pad(M),\n s: s,\n ss: pad(s),\n l: pad(L, 3),\n L: pad(L > 99 ? Math.round(L / 10) : L),\n t: H < 12 ? \"a\" : \"p\",\n tt: H < 12 ? \"am\" : \"pm\",\n T: H < 12 ? \"A\" : \"P\",\n TT: H < 12 ? \"AM\" : \"PM\",\n Z: utc ? \"UTC\" : (String(date).match(timezone) || [\"\"]).pop().replace(timezoneClip, \"\"),\n o: (o > 0 ? \"-\" : \"+\") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),\n S: [\"th\", \"st\", \"nd\", \"rd\"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]\n };\n\n\n\n return mask.replace(token, function ($0) {\n return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);\n });\n }\n\n /**\n * Get mask name from a given format\n *\n * @param {string} format\n *\n * @return {string} maskName\n * */\n var getMaskNameFromFormat = function (format) {\n\n var name = \"default\";\n\n for (var f in self.masks) {\n if ( self.masks[f] === format )\n return f\n }\n\n return name\n }\n\n\n /**\n * Count days from the current date to another\n *\n * TODO - add a closure to `ignoreWeekend()` based on Utils::Validator\n * TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator\n *\n * @param {object} dateTo\n * @return {number} count\n * */\n var countDaysTo = function(date, dateTo) {\n\n if ( dateTo instanceof Date) {\n // The number of milliseconds in one day\n var oneDay = 1000 * 60 * 60 * 24\n\n // Convert both dates to milliseconds\n var date1Ms = date.getTime()\n var date2Ms = dateTo.getTime()\n\n // Calculate the difference in milliseconds\n var count = Math.abs(date1Ms - date2Ms)\n\n // Convert back to days and return\n return Math.round(count/oneDay);\n } else {\n throw new Error('dateTo is not instance of Date() !')\n }\n }\n\n /**\n * Will give an array of dates between the current date to a targeted date\n *\n * TODO - add a closure to `ignoreWeekend()` based on Utils::Validator\n * TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator\n *\n * @param {object} dateTo\n * @param {string} [ mask ]\n *\n * @return {array} dates\n * */\n var getDaysTo = function(date, dateTo, mask) {\n\n if ( dateTo instanceof Date) {\n var count = countDaysTo(date, dateTo)\n , month = date.getMonth()\n , year = date.getFullYear()\n , day = date.getDate() + 1\n , dateObj = new Date(year, month, day)\n , days = []\n , i = 0;\n\n for (; i < count; ++i) {\n if ( typeof(mask) != 'undefined' ) {\n days.push(new Date(dateObj).format(mask));\n } else {\n days.push(new Date(dateObj));\n }\n\n dateObj.setDate(dateObj.getDate() + 1);\n }\n\n return days || [];\n } else {\n throw new Error('dateTo is not instance of Date() !')\n }\n }\n\n var getDaysInMonth = function(date) {\n var month = date.getMonth();\n var year = date.getFullYear();\n var dateObj = new Date(year, month, 1);\n var days = [];\n while (dateObj.getMonth() === month) {\n days.push(new Date(dateObj));\n dateObj.setDate(dateObj.getDate() + 1);\n }\n return days;\n }\n\n /**\n * Add or subtract hours\n * Adding 2 hours\n * => myDate.addHours(2)\n * Subtracting 10 hours\n * => myDate.addHours(-10)\n * */\n var addHours = function(date, h) {\n var copiedDate = new Date(date.getTime());\n copiedDate.setHours(copiedDate.getHours()+h);\n return copiedDate;\n }\n\n return {\n format : format,\n countDaysTo : countDaysTo,\n getDaysTo : getDaysTo,\n getDaysInMonth : getDaysInMonth,\n addHours : addHours\n }\n\n};\n\nif ( ( typeof(module) !== 'undefined' ) && module.exports ) {\n // Publish as node.js module\n module.exports = DateFormatHelper\n} else if ( typeof(define) === 'function' && define.amd) {\n // Publish as AMD module\n define( 'helpers/dateFormat',[],function() { return DateFormatHelper })\n};\n",
|
|
30
|
-
"/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */\n!function(a,b){\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error(\"jQuery requires a window with a document\");return b(a)}:b(a)}(\"undefined\"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m=\"1.12.4\",n=function(a,b){return new n.fn.init(a,b)},o=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,p=/^-ms-/,q=/-([\\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:\"\",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.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()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for(\"boolean\"==typeof g&&(j=g,g=arguments[h]||{},h++),\"object\"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:\"jQuery\"+(m+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return\"function\"===n.type(a)},isArray:Array.isArray||function(a){return\"array\"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||\"object\"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,\"constructor\")&&!k.call(a.constructor.prototype,\"isPrototypeOf\"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+\"\":\"object\"==typeof a||\"function\"==typeof a?i[j.call(a)]||\"object\":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,\"ms-\").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?\"\":(a+\"\").replace(o,\"\")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,\"string\"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.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,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return\"string\"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),\"function\"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"),function(a,b){i[\"[object \"+b+\"]\"]=b.toLowerCase()});function s(a){var b=!!a&&\"length\"in a&&a.length,c=n.type(a);return\"function\"===c||n.isWindow(a)?!1:\"array\"===c||0===b||\"number\"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=\"sizzle\"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",L=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",M=\"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",N=\"\\\\[\"+L+\"*(\"+M+\")(?:\"+L+\"*([*^$|!~]?=)\"+L+\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\"+M+\"))|)\"+L+\"*\\\\]\",O=\":(\"+M+\")(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+N+\")*)|.*)\\\\)|)\",P=new RegExp(L+\"+\",\"g\"),Q=new RegExp(\"^\"+L+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+L+\"+$\",\"g\"),R=new RegExp(\"^\"+L+\"*,\"+L+\"*\"),S=new RegExp(\"^\"+L+\"*([>+~]|\"+L+\")\"+L+\"*\"),T=new RegExp(\"=\"+L+\"*([^\\\\]'\\\"]*?)\"+L+\"*\\\\]\",\"g\"),U=new RegExp(O),V=new RegExp(\"^\"+M+\"$\"),W={ID:new RegExp(\"^#(\"+M+\")\"),CLASS:new RegExp(\"^\\\\.(\"+M+\")\"),TAG:new RegExp(\"^(\"+M+\"|[*])\"),ATTR:new RegExp(\"^\"+N),PSEUDO:new RegExp(\"^\"+O),CHILD:new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+L+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+L+\"*(?:([+-]|)\"+L+\"*(\\\\d+)|))\"+L+\"*\\\\)|)\",\"i\"),bool:new RegExp(\"^(?:\"+K+\")$\",\"i\"),needsContext:new RegExp(\"^\"+L+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+L+\"*((?:-\\\\d)?\\\\d*)\"+L+\"*\\\\)|)(?=[^-]|$)\",\"i\")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\\d$/i,Z=/^[^{]+\\{\\s*\\[native \\w/,$=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,_=/[+~]/,aa=/'|\\\\/g,ba=new RegExp(\"\\\\\\\\([\\\\da-f]{1,6}\"+L+\"?|(\"+L+\")|.)\",\"ig\"),ca=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)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],\"string\"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+\" \"]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if(\"object\"!==b.nodeName.toLowerCase()){(k=b.getAttribute(\"id\"))?k=k.replace(aa,\"\\\\$&\"):b.setAttribute(\"id\",k=u),r=g(a),h=r.length,l=V.test(k)?\"#\"+k:\"[id='\"+k+\"']\";while(h--)r[h]=l+\" \"+qa(r[h]);s=r.join(\",\"),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute(\"id\")}}}return i(a.replace(Q,\"$1\"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+\" \")>d.cacheLength&&delete b[a.shift()],b[c+\" \"]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement(\"div\");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split(\"|\"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return\"input\"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return(\"input\"===c||\"button\"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(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 oa(a){return a&&\"undefined\"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?\"HTML\"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener(\"unload\",da,!1):e.attachEvent&&e.attachEvent(\"onunload\",da)),c.attributes=ia(function(a){return a.className=\"i\",!a.getAttribute(\"className\")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment(\"\")),!a.getElementsByTagName(\"*\").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(\"undefined\"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute(\"id\")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c=\"undefined\"!=typeof a.getAttributeNode&&a.getAttributeNode(\"id\");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return\"undefined\"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if(\"*\"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return\"undefined\"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML=\"<a id='\"+u+\"'></a><select id='\"+u+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\",a.querySelectorAll(\"[msallowcapture^='']\").length&&q.push(\"[*^$]=\"+L+\"*(?:''|\\\"\\\")\"),a.querySelectorAll(\"[selected]\").length||q.push(\"\\\\[\"+L+\"*(?:value|\"+K+\")\"),a.querySelectorAll(\"[id~=\"+u+\"-]\").length||q.push(\"~=\"),a.querySelectorAll(\":checked\").length||q.push(\":checked\"),a.querySelectorAll(\"a#\"+u+\"+*\").length||q.push(\".#.+[+~]\")}),ia(function(a){var b=n.createElement(\"input\");b.setAttribute(\"type\",\"hidden\"),a.appendChild(b).setAttribute(\"name\",\"D\"),a.querySelectorAll(\"[name=d]\").length&&q.push(\"name\"+L+\"*[*^$|!~]?=\"),a.querySelectorAll(\":enabled\").length||q.push(\":enabled\",\":disabled\"),a.querySelectorAll(\"*,:x\"),q.push(\",.*:\")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,\"div\"),s.call(a,\"[s!='']:x\"),r.push(\"!=\",O)}),q=q.length&&new RegExp(q.join(\"|\")),r=r.length&&new RegExp(r.join(\"|\")),b=Z.test(o.compareDocumentPosition),t=b||Z.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===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,\"='$1']\"),c.matchesSelector&&p&&!A[b+\" \"]&&(!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 fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error(\"Syntax error, unrecognized expression: \"+a)},fa.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=fa.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=fa.selectors={cacheLength:50,createPseudo:ha,match:W,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(ba,ca),a[3]=(a[3]||a[4]||a[5]||\"\").replace(ba,ca),\"~=\"===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]||fa.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]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||\"\":c&&U.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(ba,ca).toLowerCase();return\"*\"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+\" \"];return b||(b=new RegExp(\"(^|\"+L+\")\"+a+\"(\"+L+\"|$)\"))&&y(a,function(a){return b.test(\"string\"==typeof a.className&&a.className||\"undefined\"!=typeof a.getAttribute&&a.getAttribute(\"class\")||\"\")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?\"!=\"===b:b?(e+=\"\",\"=\"===b?e===c:\"!=\"===b?e!==c:\"^=\"===b?c&&0===e.indexOf(c):\"*=\"===b?c&&e.indexOf(c)>-1:\"$=\"===b?c&&e.slice(-c.length)===c:\"~=\"===b?(\" \"+e.replace(P,\" \")+\" \").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,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p=\"only\"===a&&!o&&\"nextSibling\"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error(\"unsupported pseudo: \"+a);return e[u]?e(b):e.length>1?(c=[a,a,\"\",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,\"$1\"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||\"\")||fa.error(\"unsupported lang: \"+a),a=a.replace(ba,ca).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 Y.test(a.nodeName)},input:function(a){return X.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:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+\" \"];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q,\" \")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d=\"\";c>b;b++)d+=a[b].value;return d}function ra(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,k=[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(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(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 ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(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 va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||\"*\",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[\" \"],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(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 va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:\" \"===a[i-2].type?\"*\":\"\"})).replace(Q,\"$1\"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s=\"0\",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG(\"*\",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+\" \"];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.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(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.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(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split(\"\").sort(B).join(\"\")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement(\"div\"))}),ia(function(a){return a.innerHTML=\"<a href='#'></a>\",\"#\"===a.firstChild.getAttribute(\"href\")})||ja(\"type|href|height|width\",function(a,b,c){return c?void 0:a.getAttribute(b,\"type\"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML=\"<input/>\",a.firstChild.setAttribute(\"value\",\"\"),\"\"===a.firstChild.getAttribute(\"value\")})||ja(\"value\",function(a,b,c){return c||\"input\"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute(\"disabled\")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[\":\"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/,y=/^.[^:#\\[\\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if(\"string\"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=\":not(\"+a+\")\"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if(\"string\"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+\" \"+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,\"string\"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,\"string\"==typeof a){if(e=\"<\"===a.charAt(0)&&\">\"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?\"undefined\"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||\"string\"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?\"string\"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,\"parentNode\")},parentsUntil:function(a,b,c){return u(a,\"parentNode\",c)},next:function(a){return F(a,\"nextSibling\")},prev:function(a){return F(a,\"previousSibling\")},nextAll:function(a){return u(a,\"nextSibling\")},prevAll:function(a){return u(a,\"previousSibling\")},nextUntil:function(a,b,c){return u(a,\"nextSibling\",c)},prevUntil:function(a,b,c){return u(a,\"previousSibling\",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,\"iframe\")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return\"Until\"!==a.slice(-5)&&(d=c),d&&\"string\"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a=\"string\"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:\"\")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&\"string\"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c=\"\",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[[\"resolve\",\"done\",n.Callbacks(\"once memory\"),\"resolved\"],[\"reject\",\"fail\",n.Callbacks(\"once memory\"),\"rejected\"],[\"notify\",\"progress\",n.Callbacks(\"memory\")]],c=\"pending\",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+\"With\"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+\"With\"](this===e?d:this,arguments),this},e[f[0]+\"With\"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler(\"ready\"),n(d).off(\"ready\"))))}});function J(){d.addEventListener?(d.removeEventListener(\"DOMContentLoaded\",K),a.removeEventListener(\"load\",K)):(d.detachEvent(\"onreadystatechange\",K),a.detachEvent(\"onload\",K))}function K(){(d.addEventListener||\"load\"===a.event.type||\"complete\"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),\"complete\"===d.readyState||\"loading\"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener(\"DOMContentLoaded\",K),a.addEventListener(\"load\",K);else{d.attachEvent(\"onreadystatechange\",K),a.attachEvent(\"onload\",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll(\"left\")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst=\"0\"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName(\"body\")[0],c&&c.style&&(b=d.createElement(\"div\"),e=d.createElement(\"div\"),e.style.cssText=\"position:absolute;border:0;width:0;height:0;top:0;left:-9999px\",c.appendChild(e).appendChild(b),\"undefined\"!=typeof b.style.zoom&&(b.style.cssText=\"display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1\",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement(\"div\");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+\" \").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute(\"classid\")===b},N=/^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d=\"data-\"+b.replace(O,\"-$1\").toLowerCase();if(c=a.getAttribute(d),\"string\"==typeof c){try{c=\"true\"===c?!0:\"false\"===c?!1:\"null\"===c?null:+c+\"\"===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;\n}return c}function Q(a){var b;for(b in a)if((\"data\"!==b||!n.isEmptyObject(a[b]))&&\"toJSON\"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.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()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),\"object\"!=typeof b&&\"function\"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),\"string\"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(\" \")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{\"applet \":!0,\"embed \":!0,\"object \":\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,\"parsedAttrs\"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf(\"data-\")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,\"parsedAttrs\",!0)}return e}return\"object\"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||\"fx\")+\"queue\",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||\"fx\";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};\"inprogress\"===e&&(e=c.shift(),d--),e&&(\"fx\"===b&&c.unshift(\"inprogress\"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+\"queueHooks\";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks(\"once memory\").add(function(){n._removeData(a,b+\"queue\"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return\"string\"!=typeof a&&(b=a,a=\"fx\",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),\"fx\"===a&&\"inprogress\"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||\"fx\",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};\"string\"!=typeof a&&(b=a,a=void 0),a=a||\"fx\";while(g--)c=n._data(f[g],a+\"queueHooks\"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName(\"body\")[0],c&&c.style?(b=d.createElement(\"div\"),e=d.createElement(\"div\"),e.style.cssText=\"position:absolute;border:0;width:0;height:0;top:0;left:-9999px\",c.appendChild(e).appendChild(b),\"undefined\"!=typeof b.style.zoom&&(b.style.cssText=\"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1\",b.appendChild(d.createElement(\"div\")).style.width=\"5px\",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,U=new RegExp(\"^(?:([+-])=|)(\"+T+\")([a-z%]*)$\",\"i\"),V=[\"Top\",\"Right\",\"Bottom\",\"Left\"],W=function(a,b){return a=b||a,\"none\"===n.css(a,\"display\")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,\"\")},i=h(),j=c&&c[3]||(n.cssNumber[b]?\"\":\"px\"),k=(n.cssNumber[b]||\"px\"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||\".5\",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if(\"object\"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\\w:-]+)/,_=/^$|\\/(?:java|ecma)script/i,aa=/^\\s+/,ba=\"abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video\";function ca(a){var b=ba.split(\"|\"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement(\"div\"),b=d.createDocumentFragment(),c=d.createElement(\"input\");a.innerHTML=\" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>\",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName(\"tbody\").length,l.htmlSerialize=!!a.getElementsByTagName(\"link\").length,l.html5Clone=\"<:nav></:nav>\"!==d.createElement(\"nav\").cloneNode(!0).outerHTML,c.type=\"checkbox\",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML=\"<textarea>x</textarea>\",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement(\"input\"),c.setAttribute(\"type\",\"radio\"),c.setAttribute(\"checked\",\"checked\"),c.setAttribute(\"name\",\"t\"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,\"<select multiple='multiple'>\",\"</select>\"],legend:[1,\"<fieldset>\",\"</fieldset>\"],area:[1,\"<map>\",\"</map>\"],param:[1,\"<object>\",\"</object>\"],thead:[1,\"<table>\",\"</table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],col:[2,\"<table><tbody></tbody><colgroup>\",\"</colgroup></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:l.htmlSerialize?[0,\"\",\"\"]:[1,\"X<div>\",\"</div>\"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f=\"undefined\"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||\"*\"):\"undefined\"!=typeof a.querySelectorAll?a.querySelectorAll(b||\"*\"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,\"globalEval\",!b||n._data(b[d],\"globalEval\"))}var ga=/<|&#?\\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if(\"object\"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement(\"div\")),j=($.exec(g)||[\"\",\"\"])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g=\"table\"!==j||ha.test(g)?\"<table>\"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],\"tbody\")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent=\"\";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,\"input\"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),\"script\"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||\"\")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement(\"div\");for(b in{submit:!0,change:!0,focusin:!0})c=\"on\"+b,(l[b]=c in a)||(e.setAttribute(c,\"t\"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if(\"object\"==typeof b){\"string\"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&(\"string\"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return\"undefined\"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||\"\").match(G)||[\"\"],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||\"\").split(\".\").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(\".\")},i),(m=g[o])||(m=g[o]=[],m.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?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||\"\").match(G)||[\"\"],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||\"\").split(\".\").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp(\"(^|\\\\.)\"+p.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&(\"**\"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,\"events\"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,\"type\")?b.type:b,r=k.call(b,\"namespace\")?b.namespace.split(\".\"):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(\".\")>-1&&(r=q.split(\".\"),q=r.shift(),r.sort()),h=q.indexOf(\":\")<0&&\"on\"+q,b=b[n.expando]?b:new n.Event(q,\"object\"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join(\".\"),b.rnamespace=b.namespace?new RegExp(\"(^|\\\\.)\"+r.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,\"events\")||{})[b.type]&&n._data(i,\"handle\"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,\"events\")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!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&&(\"click\"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||\"click\"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+\" \",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:\"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),fixHooks:{},keyHooks:{props:\"char charCode key keyCode\".split(\" \"),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:\"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:\"focusin\"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:\"focusout\"},click:{trigger:function(){return n.nodeName(this,\"input\")&&\"checkbox\"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,\"a\")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d=\"on\"+b;a.detachEvent&&(\"undefined\"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\",pointerenter:\"pointerover\",pointerleave:\"pointerout\"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,\"form\")?!1:void n.event.add(this,\"click._submit keypress._submit\",function(a){var b=a.target,c=n.nodeName(b,\"input\")||n.nodeName(b,\"button\")?n.prop(b,\"form\"):void 0;c&&!n._data(c,\"submit\")&&(n.event.add(c,\"submit._submit\",function(a){a._submitBubble=!0}),n._data(c,\"submit\",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate(\"submit\",this.parentNode,a))},teardown:function(){return n.nodeName(this,\"form\")?!1:void n.event.remove(this,\"._submit\")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?(\"checkbox\"!==this.type&&\"radio\"!==this.type||(n.event.add(this,\"propertychange._change\",function(a){\"checked\"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,\"click._change\",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate(\"change\",this,a)})),!1):void n.event.add(this,\"beforeactivate._change\",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,\"change\")&&(n.event.add(b,\"change._change\",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate(\"change\",this.parentNode,a)}),n._data(b,\"change\",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||\"radio\"!==b.type&&\"checkbox\"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,\"._change\"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:\"focusin\",blur:\"focusout\"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+\".\"+d.namespace:d.origType,d.selector,d.handler),this;if(\"object\"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&\"function\"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\\d+=\"(?:null|\\d+)\"/g,ua=new RegExp(\"<(?:\"+ba+\")[\\\\s/>]\",\"i\"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi,wa=/<script|<style|<link/i,xa=/checked\\s*(?:[^=]|=\\s*.checked.)/i,ya=/^true\\/(.*)/,za=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement(\"div\"));function Ca(a,b){return n.nodeName(a,\"table\")&&n.nodeName(11!==b.nodeType?b:b.firstChild,\"tr\")?a.getElementsByTagName(\"tbody\")[0]||a.appendChild(a.ownerDocument.createElement(\"tbody\")):a}function Da(a){return a.type=(null!==n.find.attr(a,\"type\"))+\"/\"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute(\"type\"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._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++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}\"script\"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):\"object\"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):\"input\"===c&&Z.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)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&\"string\"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,\"script\"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,\"script\"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||\"\")&&!n._data(g,\"globalEval\")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||\"\").replace(za,\"\")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,\"script\")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,\"<$1></$2>\")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test(\"<\"+a.nodeName+\">\")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,\"script\"),d.length>0&&fa(d,!i&&ea(a,\"script\")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||\"undefined\"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.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 n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,\"\"):void 0;if(\"string\"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||[\"\",\"\"])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:\"block\",BODY:\"block\"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],\"display\");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),\"none\"!==c&&c||(Ja=(Ja||n(\"<iframe frameborder='0' width='0' height='0'/>\")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp(\"^(\"+T+\")(?!px)[a-z%]+$\",\"i\"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement(\"div\"),j=d.createElement(\"div\");if(j.style){j.style.cssText=\"float:left;opacity:.5\",l.opacity=\"0.5\"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip=\"content-box\",j.cloneNode(!0).style.backgroundClip=\"\",l.clearCloneStyle=\"content-box\"===j.style.backgroundClip,i=d.createElement(\"div\"),i.style.cssText=\"border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute\",j.innerHTML=\"\",i.appendChild(j),l.boxSizing=\"\"===j.style.boxSizing||\"\"===j.style.MozBoxSizing||\"\"===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText=\"-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%\",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b=\"1%\"!==(l||{}).top,h=\"2px\"===(l||{}).marginLeft,e=\"4px\"===(l||{width:\"4px\"}).width,j.style.marginRight=\"50%\",c=\"4px\"===(l||{marginRight:\"4px\"}).marginRight,k=j.appendChild(d.createElement(\"div\")),k.style.cssText=j.style.cssText=\"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0\",k.style.marginRight=k.style.width=\"0\",j.style.width=\"1px\",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display=\"none\",f=0===j.getClientRects().length,f&&(j.style.display=\"\",j.innerHTML=\"<table><tr><td></td><td>t</td></tr></table>\",j.childNodes[0].style.borderCollapse=\"separate\",k=j.getElementsByTagName(\"td\"),k[0].style.cssText=\"margin:0;border:0;padding:0;display:none\",f=0===k[0].offsetHeight,f&&(k[0].style.display=\"\",k[1].style.display=\"none\",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,\"\"!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+\"\"}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left=\"fontSize\"===b?\"1em\":g,g=h.pixelLeft+\"px\",h.left=d,f&&(e.left=f)),void 0===g?g:g+\"\"||\"auto\"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\\([^)]*\\)/i,Wa=/opacity\\s*=\\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp(\"^(\"+T+\")(.*)$\",\"i\"),Za={position:\"absolute\",visibility:\"hidden\",display:\"block\"},$a={letterSpacing:\"0\",fontWeight:\"400\"},_a=[\"Webkit\",\"O\",\"Moz\",\"ms\"],ab=d.createElement(\"div\").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,\"olddisplay\"),c=d.style.display,b?(f[g]||\"none\"!==c||(d.style.display=\"\"),\"\"===d.style.display&&W(d)&&(f[g]=n._data(d,\"olddisplay\",Ma(d.nodeName)))):(e=W(d),(c&&\"none\"!==c||!e)&&n._data(d,\"olddisplay\",e?c:n.css(d,\"display\"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&\"none\"!==d.style.display&&\"\"!==d.style.display||(d.style.display=b?f[g]||\"\":\"none\"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||\"px\"):b}function eb(a,b,c,d,e){for(var f=c===(d?\"border\":\"content\")?4:\"width\"===b?1:0,g=0;4>f;f+=2)\"margin\"===c&&(g+=n.css(a,c+V[f],!0,e)),d?(\"content\"===c&&(g-=n.css(a,\"padding\"+V[f],!0,e)),\"margin\"!==c&&(g-=n.css(a,\"border\"+V[f]+\"Width\",!0,e))):(g+=n.css(a,\"padding\"+V[f],!0,e),\"padding\"!==c&&(g+=n.css(a,\"border\"+V[f]+\"Width\",!0,e)));return g}function fb(a,b,c){var d=!0,e=\"width\"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g=l.boxSizing&&\"border-box\"===n.css(a,\"boxSizing\",!1,f);if(0>=e||null==e){if(e=Sa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Oa.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+eb(a,b,c||(g?\"border\":\"content\"),d,f)+\"px\"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,\"opacity\");return\"\"===c?\"1\":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{\"float\":l.cssFloat?\"cssFloat\":\"styleFloat\"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&\"get\"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,\"string\"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f=\"number\"),null!=c&&c===c&&(\"number\"===f&&(c+=e&&e[3]||(n.cssNumber[h]?\"\":\"px\")),l.clearCloneStyle||\"\"!==c||0!==b.indexOf(\"background\")||(i[b]=\"inherit\"),!(g&&\"set\"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&\"get\"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),\"normal\"===f&&b in $a&&(f=$a[b]),\"\"===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each([\"height\",\"width\"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,\"display\"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&\"border-box\"===n.css(a,\"boxSizing\",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||\"\")?.01*parseFloat(RegExp.$1)+\"\":b?\"1\":\"\"},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?\"alpha(opacity=\"+100*b+\")\":\"\",f=d&&d.filter||c.filter||\"\";c.zoom=1,(b>=1||\"\"===b)&&\"\"===n.trim(f.replace(Va,\"\"))&&c.removeAttribute&&(c.removeAttribute(\"filter\"),\"\"===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+\" \"+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:\"inline-block\"},Sa,[a,\"marginRight\"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,\"marginLeft\"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{\n marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+\"px\":void 0}),n.each({margin:\"\",padding:\"\",border:\"Width\"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f=\"string\"==typeof c?c.split(\" \"):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return\"boolean\"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?\"\":\"px\")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,\"\"),b&&\"auto\"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:\"swing\"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d[\"margin\"+c]=d[\"padding\"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners[\"*\"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,\"fxshow\");c.queue||(h=n._queueHooks(a,\"fx\"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,\"fx\").length||h.empty.fire()})})),1===a.nodeType&&(\"height\"in b||\"width\"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,\"display\"),k=\"none\"===j?n._data(a,\"olddisplay\")||Ma(a.nodeName):j,\"inline\"===k&&\"none\"===n.css(a,\"float\")&&(l.inlineBlockNeedsLayout&&\"inline\"!==Ma(a.nodeName)?p.zoom=1:p.display=\"inline-block\")),c.overflow&&(p.overflow=\"hidden\",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||\"toggle\"===e,e===(q?\"hide\":\"show\")){if(\"show\"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))\"inline\"===(\"none\"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?\"hidden\"in r&&(q=r.hidden):r=n._data(a,\"fxshow\",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,\"fxshow\");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start=\"width\"===d||\"height\"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&\"expand\"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{\"*\":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=[\"*\"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&\"object\"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:\"number\"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue=\"fx\"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css(\"opacity\",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,\"finish\"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return\"string\"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||\"fx\",[]),this.each(function(){var b=!0,e=null!=a&&a+\"queueHooks\",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||\"fx\"),this.each(function(){var b,c=n._data(this),d=c[a+\"queue\"],e=c[a+\"queueHooks\"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each([\"toggle\",\"show\",\"hide\"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||\"boolean\"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb(\"show\"),slideUp:mb(\"hide\"),slideToggle:mb(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||\"fx\",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement(\"input\"),c=d.createElement(\"div\"),e=d.createElement(\"select\"),f=e.appendChild(d.createElement(\"option\"));c=d.createElement(\"div\"),c.setAttribute(\"className\",\"t\"),c.innerHTML=\" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>\",a=c.getElementsByTagName(\"a\")[0],b.setAttribute(\"type\",\"checkbox\"),c.appendChild(b),a=c.getElementsByTagName(\"a\")[0],a.style.cssText=\"top:1px\",l.getSetAttribute=\"t\"!==c.className,l.style=/top/.test(a.getAttribute(\"style\")),l.hrefNormalized=\"/a\"===a.getAttribute(\"href\"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement(\"form\").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement(\"input\"),b.setAttribute(\"value\",\"\"),l.input=\"\"===b.getAttribute(\"value\"),b.value=\"t\",b.setAttribute(\"type\",\"radio\"),l.radioValue=\"t\"===b.value}();var rb=/\\r/g,sb=/[\\x20\\t\\r\\n\\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e=\"\":\"number\"==typeof e?e+=\"\":n.isArray(e)&&(e=n.map(e,function(a){return null==a?\"\":a+\"\"})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&\"set\"in b&&void 0!==b.set(this,e,\"value\")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&\"get\"in b&&void 0!==(c=b.get(e,\"value\"))?c:(c=e.value,\"string\"==typeof c?c.replace(rb,\"\"):null==c?\"\":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,\"value\");return null!=b?b:n.trim(n.text(a)).replace(sb,\" \")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f=\"select-one\"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute(\"disabled\"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,\"optgroup\"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each([\"radio\",\"checkbox\"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute(\"value\")?\"on\":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return\"undefined\"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&\"set\"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+\"\"),c):e&&\"get\"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&\"radio\"===b&&n.nodeName(a,\"input\")){var c=a.value;return a.setAttribute(\"type\",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase(\"default-\"+c)]=a[d]=!1:n.attr(a,c,\"\"),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase(\"default-\"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase(\"default-\"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,\"input\")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+=\"\",\"value\"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&\"\"!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,\"\"===b?!1:b,c)}},n.each([\"width\",\"height\"],function(a,b){n.attrHooks[b]={set:function(a,c){return\"\"===c?(a.setAttribute(b,\"auto\"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+\"\"}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&\"set\"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&\"get\"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,\"tabindex\");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{\"for\":\"htmlFor\",\"class\":\"className\"}}),l.hrefNormalized||n.each([\"href\",\"src\"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype=\"encoding\");var Bb=/[\\t\\r\\n\\f]/g;function Cb(a){return n.attr(a,\"class\")||\"\"}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if(\"string\"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(\" \"+e+\" \").replace(Bb,\" \")){g=0;while(f=b[g++])d.indexOf(\" \"+f+\" \")<0&&(d+=f+\" \");h=n.trim(d),e!==h&&n.attr(c,\"class\",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr(\"class\",\"\");if(\"string\"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(\" \"+e+\" \").replace(Bb,\" \")){g=0;while(f=b[g++])while(d.indexOf(\" \"+f+\" \")>-1)d=d.replace(\" \"+f+\" \",\" \");h=n.trim(d),e!==h&&n.attr(c,\"class\",h)}}return this},toggleClass:function(a,b){var c=typeof a;return\"boolean\"==typeof b&&\"string\"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if(\"string\"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&\"boolean\"!==c||(b=Cb(this),b&&n._data(this,\"__className__\",b),n.attr(this,\"class\",b||a===!1?\"\":n._data(this,\"__className__\")||\"\"))})},hasClass:function(a){var b,c,d=0;b=\" \"+a+\" \";while(c=this[d++])if(1===c.nodeType&&(\" \"+Cb(c)+\" \").replace(Bb,\" \").indexOf(b)>-1)return!0;return!1}}),n.each(\"blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu\".split(\" \"),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\\?/,Gb=/(,)|(\\[|{)|(}|])|\"(?:[^\"\\\\\\r\\n]|\\\\[\"\\\\\\/bfnrt]|\\\\u[\\da-fA-F]{4})*\"\\s*:?|true|false|null|-?(?!0\\d)\\d+(?:\\.\\d+|)(?:[eE][+-]?\\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+\"\");var c,d=null,e=n.trim(b+\"\");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,\"\")}))?Function(\"return \"+e)():n.error(\"Invalid JSON: \"+b)},n.parseXML=function(b){var c,d;if(!b||\"string\"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,\"text/xml\")):(c=new a.ActiveXObject(\"Microsoft.XMLDOM\"),c.async=\"false\",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName(\"parsererror\").length||n.error(\"Invalid XML: \"+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\\/\\//,Nb=/^([\\w.+-]+:)(?:\\/\\/(?:[^\\/?#]*@|)([^\\/?#:]*)(?::(\\d+)|)|)/,Ob={},Pb={},Qb=\"*/\".concat(\"*\"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){\"string\"!=typeof b&&(c=b,b=\"*\");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])\"+\"===d.charAt(0)?(d=d.slice(1)||\"*\",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return\"string\"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e[\"*\"]&&g(\"*\")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while(\"*\"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader(\"Content-Type\"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+\" \"+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if(\"*\"===f)f=i;else if(\"*\"!==i&&i!==f){if(g=j[i+\" \"+f]||j[\"* \"+f],!g)for(e in j)if(h=e.split(\" \"),h[1]===f&&(g=j[i+\" \"+h[0]]||j[\"* \"+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a[\"throws\"])b=g(b);else try{b=g(b)}catch(l){return{state:\"parsererror\",error:g?l:\"No conversion from \"+i+\" to \"+f}}}return{state:\"success\",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:\"GET\",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":Qb,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/\\bxml\\b/,html:/\\bhtml/,json:/\\bjson\\b/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":n.parseJSON,\"text xml\":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){\"object\"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks(\"once memory\"),r=l.statusCode||{},s={},t={},u=0,v=\"canceled\",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+\"\").replace(Hb,\"\").replace(Mb,Sb[1]+\"//\"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||\"*\").toLowerCase().match(G)||[\"\"],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||(\"http:\"===d[1]?\"80\":\"443\"))===(Sb[3]||(\"http:\"===Sb[1]?\"80\":\"443\")))),l.data&&l.processData&&\"string\"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger(\"ajaxStart\"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?\"&\":\"?\")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,\"$1_=\"+Eb++):f+(Fb.test(f)?\"&\":\"?\")+\"_=\"+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader(\"If-Modified-Since\",n.lastModified[f]),n.etag[f]&&w.setRequestHeader(\"If-None-Match\",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader(\"Content-Type\",l.contentType),w.setRequestHeader(\"Accept\",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(\"*\"!==l.dataTypes[0]?\", \"+Qb+\"; q=0.01\":\"\"):l.accepts[\"*\"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v=\"abort\";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger(\"ajaxSend\",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort(\"timeout\")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,\"No Transport\");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||\"\",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader(\"Last-Modified\"),x&&(n.lastModified[f]=x),x=w.getResponseHeader(\"etag\"),x&&(n.etag[f]=x)),204===b||\"HEAD\"===l.type?y=\"nocontent\":304===b?y=\"notmodified\":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y=\"error\",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+\"\",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?\"ajaxSuccess\":\"ajaxError\",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger(\"ajaxComplete\",[w,l]),--n.active||n.event.trigger(\"ajaxStop\")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,\"json\")},getScript:function(a,b){return n.get(a,void 0,b,\"script\")}}),n.each([\"get\",\"post\"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:\"GET\",dataType:\"script\",cache:!0,async:!1,global:!1,\"throws\":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,\"body\")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,\"display\")}function Zb(a){if(!n.contains(a.ownerDocument||d,a))return!0;while(a&&1===a.nodeType){if(\"none\"===Yb(a)||\"hidden\"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\\[\\]$/,ac=/\\r?\\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+\"[\"+(\"object\"==typeof e&&null!=e?b:\"\")+\"]\",e,c,d)});else if(c||\"object\"!==n.type(b))d(a,b);else for(e in b)dc(a+\"[\"+e+\"]\",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?\"\":b,d[d.length]=encodeURIComponent(a)+\"=\"+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join(\"&\").replace($b,\"+\")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,\"elements\");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(\":disabled\")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,\"\\r\\n\")}}):{name:b.name,value:c.replace(ac,\"\\r\\n\")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent(\"onunload\",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&\"withCredentials\"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d[\"X-Requested-With\"]||(d[\"X-Requested-With\"]=\"XMLHttpRequest\");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+\"\");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,\"string\"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=\"\"}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject(\"Microsoft.XMLHTTP\")}catch(b){}}n.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/\\b(?:java|ecma)script\\b/},converters:{\"text script\":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter(\"script\",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type=\"GET\",a.global=!1)}),n.ajaxTransport(\"script\",function(a){if(a.crossDomain){var b,c=d.head||n(\"head\")[0]||d.documentElement;return{send:function(e,f){b=d.createElement(\"script\"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,\"success\"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\\?(?=&|$)|\\?\\?/;n.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var a=jc.pop()||n.expando+\"_\"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter(\"json jsonp\",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?\"url\":\"string\"==typeof b.data&&0===(b.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&kc.test(b.data)&&\"data\");return h||\"jsonp\"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,\"$1\"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?\"&\":\"?\")+b.jsonp+\"=\"+e),b.converters[\"script json\"]=function(){return g||n.error(e+\" was not called\"),g[0]},b.dataTypes[0]=\"json\",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),\"script\"):void 0}),n.parseHTML=function(a,b,c){if(!a||\"string\"!=typeof a)return null;\"boolean\"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if(\"string\"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(\" \");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&\"object\"==typeof b&&(e=\"POST\"),g.length>0&&n.ajax({url:a,type:e||\"GET\",dataType:\"html\",data:b}).done(function(a){f=arguments,g.html(d?n(\"<div>\").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,\"position\"),l=n(a),m={};\"static\"===k&&(a.style.position=\"relative\"),h=l.offset(),f=n.css(a,\"top\"),i=n.css(a,\"left\"),j=(\"absolute\"===k||\"fixed\"===k)&&n.inArray(\"auto\",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),\"using\"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(\"undefined\"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return\"fixed\"===n.css(d,\"position\")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],\"html\")||(c=a.offset()),c.top+=n.css(a[0],\"borderTopWidth\",!0),c.left+=n.css(a[0],\"borderLeftWidth\",!0)),{top:b.top-c.top-n.css(d,\"marginTop\",!0),left:b.left-c.left-n.css(d,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,\"html\")&&\"static\"===n.css(a,\"position\"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each([\"top\",\"left\"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+\"px\":c):void 0})}),n.each({Height:\"height\",Width:\"width\"},function(a,b){n.each({\n padding:\"inner\"+a,content:b,\"\":\"outer\"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||\"boolean\"!=typeof d),g=c||(d===!0||e===!0?\"margin\":\"border\");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement[\"client\"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body[\"scroll\"+a],e[\"scroll\"+a],b.body[\"offset\"+a],e[\"offset\"+a],e[\"client\"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,\"**\"):this.off(b,a||\"**\",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});\n",
|
|
31
|
-
"/**\n * Collection cLass\n * Allows you to handle your own collections as you would normaly with mongodb\n * Dependencies :\n * - utils/merge\n * - uuid\n *\n *\n * @param {array} collection\n * @param {object} [options]\n *\n * @return {object} instance\n *\n * Collection::find\n * @param {object} filter\n * eg.: { uid: \"someUID\" }\n * eg.: { type: \"not null\" }\n * eg.: { \"obj.prop\": true }\n * eg.: { \"lastUpdate\": \">= 2016-12-01T00:00:00\" }\n * eg.: { \"activity\": null }\n *\n * @return {array} result\n *\n * Collection::findOne\n * @param {object} filter\n * @return {object|array|string} result\n *\n * Collection::update\n * @param {object} filter\n * @param {object} set\n *\n * @return {array} result\n *\n * */\nfunction Collection(content, option) {\n\n var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;\n var uuid = (isGFFCtx) ? require('vendor/uuid') : require('uuid');\n var merge = (isGFFCtx) ? require('utils/merge') : require('../../../../utils/lib/merge');\n\n var instance = this;\n\n var defaultOptions = {\n 'useLocalStorage': false,\n 'locale': 'en' // get settigs.region, or user.region\n };\n\n var content = (content) ? JSON.parse(JSON.stringify(content)) : [] // original content -> not to be touched\n //var content = (Array.isArray(content)) ? content : [] // original content -> not to be touched\n , options = (typeof(options) == 'object') ? merge(options, defaultOptions) : defaultOptions\n , keywords = ['not null'] // TODO - null, exists (`true` if property is defined)\n ;\n ;\n\n this['uuids'] = {}; // uuids are generated for each new instance\n if ( content.length > 0 ) {\n for (var i = 0, len = content.length; i<len; ++i) {\n if (!content[i]) {\n // throw new Error('field index `'+ i +'` cannot be left undefined or null !');\n //content.splice(i, 1);\n content[i] = { id: uuid.v4(), noEntryFound: true };\n }\n\n content[i]._uuid = uuid.v4();\n this['uuids'][ content[i]._uuid ] = content[i]\n }\n }\n\n //this.find = function(filter, withOrClause) {\n this['find'] = function() {\n\n var withOrClause = false;\n if ( typeof(arguments[arguments.length-1]) == 'boolean' ) {\n withOrClause = arguments[arguments.length-1];\n delete arguments[arguments.length-1];\n arguments.length -= 1;\n }\n\n var filters = JSON.parse(JSON.stringify(arguments));\n\n if ( typeof(filters) != 'undefined' && typeof(filters) !== 'object' ) {\n throw new Error('filter must be an object');\n } else if ( typeof(filters) != 'undefined' && filters.count() > 0 ) {\n\n var filter = null\n , condition = null\n , i = 0\n , tmpContent = ( Array.isArray(this) && !withOrClause) ? this : JSON.parse(JSON.stringify(content))\n , resultObj = {}\n , result = []\n , localeLowerCase = ''\n , re = null\n , field = null\n , value = null\n ;\n\n for (var o in tmpContent) {\n\n if (!tmpContent[o]) {\n tmpContent[o] = {}\n }\n tmpContent[o].matched = {};\n for (var l = 0, lLen = filters.count(); l<lLen; ++l) {\n filter = filters[l];\n condition = filter.count();\n\n for (var f in filter) {\n if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');\n\n localeLowerCase = ( typeof(filter[f]) != 'boolean' && filter[f] !== null ) ? filter[f].toLocaleLowerCase() : filter[f];\n // cases with tmpContent.prop\n if ( /\\./.test(f) ) {\n //JSON.stringify(tmpContent[o]).match(/(\"gross\":\\w+)/)[1].split(/:/)[1]\n field = f.split(/\\./g);\n field = field[field.length-1];\n re = new RegExp('(\"'+ field +'\":\\\\w+)' );\n if ( !/undefined|function/.test( typeof(tmpContent[o]) ) ) {\n value = JSON.stringify(tmpContent[o]).match(re);\n if ( value && value.length > 0) {\n value = value[1].split(/:/)[1];\n if ( /(<|>|=)/.test(filter[f]) ) {\n\n // looking for a datetime ?\n if (\n /(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/.test( value )\n && /(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/.test( filter[f] )\n ) {\n\n if ( eval( value.replace(/(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/, 'new Date(\"$&\")') + filter[f].replace(/(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/, 'new Date(\"$&\")') ) ) {\n tmpContent[o].matched[f] = true;\n resultObj[ tmpContent[o]._uuid ] = tmpContent[o]\n }\n\n } else if ( eval( value + filter[f] ) ) {\n\n tmpContent[o].matched[f] = true;\n resultObj[ tmpContent[o]._uuid ] = tmpContent[o]\n }\n } else {\n if (value == filter[f]) {\n\n tmpContent[o].matched[f] = true;\n resultObj[ tmpContent[o]._uuid ] = tmpContent[o]\n }\n }\n } else {\n value = null\n }\n }\n\n\n } else { // normal case\n\n if ( filter[f] === null && tmpContent[o][f] === null ) { // null case\n\n tmpContent[o].matched[f] = true;\n resultObj[ tmpContent[o]._uuid ] = tmpContent[o]\n\n } else if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] != 'null' && tmpContent[o][f] != 'undefined' ) {\n if (result.indexOf(tmpContent[o][f]) < 0 ) {\n tmpContent[o].matched[f] = true;\n //if (typeof(tmpContent[o][f]) == 'object' ) {\n // resultObj[ tmpContent[o][f]._uuid ] = tmpContent[o][f]\n //} else {\n if ( !resultObj[o] ) {\n resultObj[o] = {}\n }\n\n resultObj[tmpContent[o]._uuid] = tmpContent[o];\n //}\n }\n\n } else if ( typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && /(<|>|=)/.test(filter[f]) && !/undefined|function/.test( typeof(tmpContent[o][f]) ) ) { // with operations\n // looking for a datetime ?\n if (\n /(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/.test( tmpContent[o][f] )\n && /(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/.test( filter[f] )\n ) {\n\n if ( eval( tmpContent[o][f].replace(/(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/, 'new Date(\"$&\")') + filter[f].replace(/(\\d{4})\\-(\\d{2})\\-(\\d{2})(\\s+|T)(\\d{2}):(\\d{2}):(\\d{2})/, 'new Date(\"$&\")') ) ) {\n tmpContent[o].matched[f] = true;\n resultObj[ tmpContent[o]._uuid ] = tmpContent[o]\n }\n\n } else if ( eval( tmpContent[o][f] + filter[f] ) ) {\n tmpContent[o].matched[f] = true;\n resultObj[ tmpContent[o]._uuid ] = tmpContent[o]\n }\n } else if ( typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] === filter[f] ) {\n\n tmpContent[o].matched[f] = true;\n resultObj[ tmpContent[o]._uuid ] = tmpContent[o]\n }\n }\n\n }\n\n }\n }\n } else {\n result = content\n }\n\n if (withOrClause) {\n for (var obj in resultObj) {\n if ( typeof(resultObj[obj].matched) != 'undefined' && resultObj[obj].matched.count() == condition ) {\n delete resultObj[obj].matched;\n result[i] = resultObj[obj];\n ++i\n }\n }\n\n // merging with previous result (this)\n result = merge(this, result, true)\n } else {\n var matched = 0;\n for (var obj in resultObj) {\n if ( typeof(resultObj[obj].matched) != 'undefined' && resultObj[obj].matched.count() == condition ) {\n delete resultObj[obj].matched;\n result[i] = resultObj[obj];\n ++i\n }\n }\n }\n\n // chaining\n result.notIn = instance.notIn;\n result.find = instance.find;\n result.update = instance.update;\n result.or = instance.or;\n result.findOne = instance.findOne;\n result.limit = instance.limit;\n result.orderBy = instance.orderBy;\n\n return result\n }\n\n this['or'] = function () {\n arguments[arguments.length] = true;\n arguments.length += 1;\n\n return instance.find.apply(this, arguments);\n }\n\n this['limit'] = function(resultLimit) {\n if ( typeof(resultLimit) == 'undefined' || typeof(resultLimit) != 'number' ) {\n throw new Error('[Collection::result->limit(resultLimit)] : `resultLimit` parametter must by a `number`')\n }\n\n var result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));\n\n //resultLimit\n result = result.splice(0, resultLimit);\n\n // chaining\n result.update = instance.update;\n result.replace = instance.replace;\n result.notIn = instance.notIn;\n result.findOne = instance.findOne;\n result.orderBy = instance.orderBy;\n\n return result\n }\n\n this['findOne'] = function(filter) {\n if ( typeof(filter) !== 'object' ) {\n throw new Error('filter must be an object');\n } else {\n var condition = filter.count()\n , i = 0\n , tmpContent = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content))\n , result = []\n , localeLowerCase = '';\n\n if (condition == 0) return null;\n\n for (var o in tmpContent) {\n for (var f in filter) {\n if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');\n\n localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];\n if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] === filter[f] && tmpContent[o][f] != 'null' && tmpContent[o][f] != 'undefined' ) {\n if (result.indexOf(tmpContent[o][f]) < 0 ) {\n ++i;\n if (i === condition) result = tmpContent[o]\n }\n\n } else if ( typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] === filter[f] ) {\n ++i;\n if (i === condition) result = tmpContent[o]\n } else if ( filter[f] === null && tmpContent[o][f] === null ) { // null case\n ++i;\n if (i === condition) result = tmpContent[o]\n }\n }\n }\n }\n\n\n return ( Array.isArray(result) && !result.length ) ? null : result\n }\n\n\n\n this['notIn'] = function(collection){\n\n // where `this` is the source & `collection` is the target to be compared with\n\n if ( typeof(collection) == 'undefined' )\n return Array.isArray(this) ? this : content;\n\n if (!Array.isArray(this))\n throw new Error('<source>.notIn(<target>): `<source>` must be a valid `CollectionResultSet` (Array)');\n\n if (!Array.isArray(collection))\n throw new Error('<source>.notIn(<target>): `<target>` must be a valid CollectionResultSet (Array)');\n\n if (this.length == 0)\n return collection;\n\n var result = []\n , r = 0\n , source = JSON.parse(JSON.stringify(this))\n , target = JSON.parse(JSON.stringify(collection));\n\n // removing those not in collection\n for (var i = 0, len = target.length; i < len; ++i) {\n for (var s = 0, sLen = source.length; s < sLen; ++s) {\n if (target[i]._uuid == source[s]._uuid) {\n target.splice(i, 1);\n source.splice(s, 1);\n --i;\n break\n }\n }\n }\n\n result = target;\n\n result.limit = instance.limit;\n result.find = instance.find;\n result.findOne = instance.findOne;\n result.orderBy = instance.orderBy;\n\n return result\n }\n\n this['insert'] = function (set) {\n\n if ( typeof(set) !== 'object' ) {\n throw new Error('filter must be an object');\n } else {\n\n\n content.push(set);\n\n var index = content.length-1;\n content[ index ]._uuid = uuid.v4();\n instance['uuids'][ content[index]._uuid ] = content[index];\n\n var result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));\n }\n\n // chaining\n result.find = instance.find;\n result.findOne = instance.findOne;\n result.orderBy = instance.orderBy;\n result.notIn = instance.notIn;\n\n return result\n }\n\n this['update'] = function(filter, set) {\n if ( typeof(filter) !== 'object' ) {\n throw new Error('filter must be an object');\n } else {\n var condition = filter.count()\n , i = 0\n , localeLowerCase = ''\n , result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));\n\n for (var o in result) {\n for (var f in filter) {\n if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');\n\n localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];\n if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] != 'null' && result[o][f] != 'undefined' ) {\n\n result[o] = merge(result[o], set, true);\n\n } else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f] ) {\n ++i;\n if (i === condition) result[o] = merge(result[o], set, true);\n } else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f]) {\n\n result[o] = merge(result[o], set, true);\n }\n }\n }\n }\n\n // chaining\n result.find = instance.find;\n result.findOne = instance.findOne;\n result.orderBy = instance.orderBy;\n result.notIn = instance.notIn;\n\n return result\n }\n\n this['replace'] = function(filter, set) {\n if ( typeof(filter) !== 'object' ) {\n throw new Error('filter must be an object');\n } else {\n var condition = filter.count()\n , i = 0\n , localeLowerCase = ''\n , result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));\n\n for (var o in result) {\n for (var f in filter) {\n if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');\n\n localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];\n if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] != 'null' && result[o][f] != 'undefined' ) {\n\n result[o] = set;\n\n } else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f] ) {\n ++i;\n if (i === condition) result[o] = set;\n } else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f]) {\n\n result[o] = set;\n }\n }\n }\n }\n\n // chaining\n result.find = instance.find;\n result.findOne = instance.findOne;\n result.orderBy = instance.orderBy;\n result.notIn = instance.notIn;\n\n return result\n }\n\n this['delete'] = function(filter) {\n if ( typeof(filter) !== 'object' ) {\n throw new Error('filter must be an object');\n } else {\n var condition = filter.count()\n , i = 0\n , localeLowerCase = ''\n , _content = Array.isArray(this) ? JSON.parse(JSON.stringify(this)) : JSON.parse(JSON.stringify(content))\n , result = JSON.parse(JSON.stringify(_content));\n\n for (var o in _content) {\n for (var f in filter) {\n if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');\n\n localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];\n if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(_content[o][f]) != 'undefined' && typeof(_content[o][f]) !== 'object' && _content[o][f] != 'null' && _content[o][f] != 'undefined' ) {\n result.splice(o, 1)\n } else if ( typeof(_content[o][f]) != 'undefined' && typeof(_content[o][f]) !== 'object' && _content[o][f] === filter[f] ) {\n ++i;\n if (i === condition) result.splice(o, 1);\n } else if ( typeof(_content[o][f]) != 'undefined' && typeof(_content[o][f]) !== 'object' && _content[o][f] === filter[f] ) {\n result.splice(o, 1)\n }\n }\n }\n }\n\n //content = result;\n return result\n }\n\n\n var sortKeywords = [ 'asc', 'desc' ];\n /**\n * sort\n *\n * @param {object|array} filter\n * */\n this['orderBy'] = function (filter) {\n\n if ( typeof(filter) == 'undefined' )\n throw new Error('[ Collection->sort(filter) ] where `filter` must not be empty or null' );\n\n\n var variableContent = (Array.isArray(this)) ? this : JSON.parse(JSON.stringify(content));\n return sortResult(filter, variableContent)\n }\n\n /**\n * sortResult\n * ref.:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare#Browser_compatibility\n *\n * e.g.:\n * .orderBy({ name: 'asc' })\n *\n * // overriding filters -> last filter is always right\n * .orderBy([ { updatedAt : 'desc'}, { name: 'asc' } ])\n *\n * // combining filters -> the first one is always right\n * .orderBy({ updatedAt : 'desc'}, { name: 'asc' })\n *\n * @param {object|array} filter\n * */\n var sortResult = function (filter, content) {\n if ( typeof(filter) != 'object') {\n throw new Error('`filter` parametter must be an object or an array')\n }\n\n var condition = filter.count()\n , sortOp = {}\n , key = null\n , prop = null\n , result = []\n ;\n\n if (condition == 0) return null;\n\n\n // asc\n sortOp['asc'] = function (prop, content) {\n return content.sort(function onAscSort(a, b) {\n\n if ( typeof(a) == 'string' && a != '') {\n // var fieldA = a.toUpperCase(); // ignore upper and lowercase\n // var fieldB = b.toUpperCase(); // ignore upper and lowercase\n //\n // if (fieldA < fieldB) {\n // return -1;\n // }\n //\n // if (fieldA > fieldB) {\n // return 1;\n // }\n //\n // // fields must be equal\n // return 0;\n\n return a.localeCompare(b)\n\n } else if ( typeof(a) == 'boolean' || typeof(b) == 'boolean' ) {\n\n if (typeof(a) == 'boolean' ) {\n a = (a) ? 1: 0;\n }\n if (typeof(b) == 'boolean' ) {\n b = (b) ? 1: 0;\n }\n\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n\n // a must be equal to b\n return 0;\n\n } else if ( typeof(a) == 'object' ) {\n try {\n if ( typeof(a[prop]) == 'number' ) {\n\n a[prop] = '' + a[prop];\n b[prop] = '' + b[prop];\n }\n\n return a[prop].localeCompare(b[prop], { numeric: true})\n\n } catch (err) {\n return -1\n }\n\n } else {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n // a must be equal to b\n return 0;\n }\n })\n }\n\n // desc\n sortOp['desc'] = function (prop, content) {\n return sortOp['asc'](prop, content).reverse()\n }\n\n if ( Array.isArray(filter) ) {\n\n for (var f = 0, len = filter.length; f < len; ++f) {\n\n prop = Object.keys(filter[f])[0];\n key = filter[f][prop];\n\n result = sortOp[key](prop, content);\n }\n } else {\n\n if (filter.count() > 1) {\n\n for (var f in filter) {\n prop = Object.keys(filter)[0];\n key = filter[prop];\n\n result = sortOp[key](prop, content);\n }\n\n } else {\n prop = Object.keys(filter)[0];\n key = filter[prop];\n\n result = sortOp[key](prop, content);\n }\n }\n\n\n\n // chaining\n result.findOne = instance.findOne;\n result.limit = instance.limit;\n result.notIn = instance.notIn;\n result.update = instance.update;\n result.replace = instance.replace;\n result.delete = instance.delete;\n\n return result\n };\n\n};\n\nif ( ( typeof(module) !== 'undefined' ) && module.exports ) {\n // Publish as node.js module\n module.exports = Collection\n} else if ( typeof(define) === 'function' && define.amd) {\n // Publish as AMD module\n define('utils/collection',[],function() { return Collection })\n};\n",
|
|
32
|
-
"/**\n * Gina Local Storage\n * N.B.: this is based on Web StorageAPI & Node LocalStorage\n * See.:\n * - https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API\n * - https://www.npmjs.com/package/node-localstorage\n * */\nfunction StoragePlugin(options) {\n\n var merge = merge || require('utils/merge');\n var Collection = Collection || require('utils/collection');\n var uuid = uuid || require('vendor/uuid');\n\n\n var self = {\n 'options' : {\n 'bucket': 'default'\n }\n };\n\n var bucketInstance = {};\n var storage = null;\n\n var entities = {}, collections = {}; // entities & collections (data) objects\n var keywords = ['not null']; // TODO - null, exists\n\n\n var proto = {\n 'bucket' : undefined,\n 'drop' : bucketDrop,\n 'Collection': Collection\n };\n\n var entityProto = {\n 'insert' : collectionInsert,\n 'find' : collectionFind,\n 'findOne' : collectionFindOne,\n 'update' : null,\n 'delete' : collectionDelete,\n 'drop' : collectionDrop\n };\n\n var init = function(options) {\n\n // detect if cookies are enabled\n if ( !window.localStorage || window.localStorage && ! typeof(window.localStorage.setItem) == 'undefined' ) {\n throw new Error('Make sure your browser supports `window.localStorage` to use Gina Storage. See: `https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API#Browser_compatibility`');\n }\n\n if ( typeof(options) != 'object' && typeof(options) != 'undefined' ) {\n throw new Error('`options` must be an object')\n } else if ( typeof(options) == 'undefined' ) {\n var options = {}\n }\n\n self.options = merge(options, self.options);\n storage = window.localStorage;\n\n var bucketName = self.options['bucket'];\n var bucket = storage.getItem(bucketName);\n\n if (!bucket && bucketName != undefined) {\n //console.log('creating new bucket !');\n bucketCreate(bucketName);\n } else if (bucketName == undefined) {\n throw new Error('`bucket` name cannot be undefined')\n }\n\n bucketInstance['bucket'] = bucketName;\n bucketInstance = merge(bucketInstance, proto);\n }\n\n\n\n /**\n * Create bucket\n *\n * @param {string} bucketName\n * */\n var bucketCreate = function(bucketName) {\n storage.setItem(bucketName, JSON.stringify(collections));\n }\n\n /**\n * Drop bucket\n *\n * */\n function bucketDrop() {\n storage.removeItem(self.options['bucket']);\n bucketInstance = null;\n\n for (var prop in this) {\n delete this[prop]\n }\n\n return bucketInstance;\n }\n\n /**\n * Create or Get Collection by name\n *\n * @param {string} name - Collection name\n * */\n function Collection(name) {\n // retrieve collections state\n collections = JSON.parse(storage.getItem(this['bucket']));\n //console.log('collections ', (collections || null) );\n if ( typeof(collections[name]) == 'undefined' ) {\n collections[name] = [];\n storage.setItem(this['bucket'], JSON.stringify(collections));\n collections = JSON.parse(storage.getItem(this['bucket']));\n }\n\n entities[name] = { '_collection': name, '_bucket': this['bucket'] };\n entities[name] = merge(entities[name], entityProto);\n\n return entities[name]\n }\n\n /**\n * Drop collection\n *\n * @param {string} name\n * */\n function collectionDrop(name) {\n if ( typeof(collections[ this['_collection'] ]) == 'undefined' ) {\n throw new Error('Collection `'+name+'` not found')\n }\n\n delete entities[ this['_collection'] ]; // delete entity\n delete collections[ this['_collection'] ]; // delete data\n\n storage.setItem(this['_bucket'], JSON.stringify(collections));\n }\n\n /**\n * Insert into collection\n *\n * @param {object} content\n * */\n function collectionInsert(content) {\n\n // TODO - add uuid\n content['_id'] = uuid.v1();\n content['_createdAt'] = new Date().format(\"isoDateTime\");\n content['_updatedAt'] = new Date().format(\"isoDateTime\");\n\n collections[ this['_collection'] ][ collections[ this['_collection'] ].length ] = content;\n\n storage.setItem(this['_bucket'], JSON.stringify(collections));\n }\n\n /**\n * Find from collection\n *\n * // TODO - add options\n *\n * @param {object} filter\n * @param {object} [options] - e.g.: limit\n *\n * @return {array} result\n * */\n function collectionFind(filter, options) {\n if (!filter) {\n // TODO - limit of ten by\n return collections[ this['_collection'] ]\n }\n\n if ( typeof(filter) !== 'object' ) { // == findAll\n throw new Error('filter must be an object');\n } else {\n //console.log('search into ', this['_collection'], collections[ this['_collection'] ], collections);\n var content = collections[ this['_collection'] ]\n , condition = filter.count()\n , i = 0\n , found = []\n , localeLowerCase = '';\n\n for (var o in content) {\n for (var f in filter) {\n localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];\n if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] != 'null' && content[o][f] != 'undefined' ) {\n if (found.indexOf(content[o][f]) < 0 ) {\n found[i] = content[o][f];\n ++i\n }\n\n } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {\n found[i] = content[o];\n ++i\n }\n }\n }\n }\n\n return found\n }\n\n //function collectionLimit(limit) {}\n\n /**\n * Find a single result from collection\n *\n * e.g:\n * // getting a record\n * > var objectRecord = <bucket>.Collection('myBucket').findOne({_name: \"someName\"});\n *\n * // updating record by adding or updating an existing property\n * > objectRecord.myProperty = 'some value';\n * > objectRecord.save();\n *\n * // deleting record\n * > objectRecord.myProperty.delete()\n *\n * @param {object} filter\n *\n * @returns {object|array|string} result\n *\n * */\n function collectionFindOne(filter) {\n\n if ( typeof(filter) !== 'object' ) {\n throw new Error('filter must be an object');\n } else {\n var content = collections[ this['_collection'] ]\n , condition = filter.count()\n , i = 0\n , result = null\n , localeLowerCase = '';\n\n\n //console.log('condition ', condition, '\\nfitler', filter, '\\ncontent', content);\n if (condition == 0) return null;\n\n for (var o in content) {\n for (var f in filter) {\n localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];\n if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] && content[o][f] != 'null' && content[o][f] != 'undefined' ) {\n if (result.indexOf(content[o][f]) < 0 ) {\n ++i;\n if (i === condition) {\n result = content[o];\n result['_index'] = o;\n result['_collection'] = this['_collection'];\n result['_bucket'] = this['_bucket'];\n }\n\n }\n\n } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {\n ++i;\n if (i === condition) {\n result = content[o];\n result['_index'] = o;\n result['_collection'] = this['_collection'];\n result['_bucket'] = this['_bucket'];\n result['_filter'] = filter;\n }\n }\n }\n }\n }\n\n if (result) {\n /**\n * save\n * e.g.:\n * // updating property\n * <obj>.property = 'value';\n * <obj>.save();\n *\n * // deleting property\n * delete <obj>.property;\n * <obj>.save(true);\n *\n * @param {boolean} enforceDeleted\n * */\n result['save'] = function(enforceDeleted) {\n\n var enforceDeleted = enforceDeleted || false;\n\n try {\n //backing up collections\n var tmpCollections = JSON.parse(JSON.stringify(collections));\n var index = this['_index'];\n var collection = this['_collection'];\n var bucket = this['_bucket'];\n var filter = this['_filter'];\n this['_updatedAt'] = new Date().format(\"isoDateTime\");\n\n merge(tmpCollections[ collection ][ index ], this, true);\n\n // cleaning\n delete tmpCollections[ collection ][ index ]['_index'];\n delete tmpCollections[ collection ][ index ]['_collection'];\n delete tmpCollections[ collection ][ index ]['_bucket'];\n delete tmpCollections[ collection ][ index ]['save'];\n delete tmpCollections[ collection ][ index ]['_filter'];\n\n if (enforceDeleted && typeof(tmpCollections[ collection ][ index ]) == 'object' ) {\n\n var parseEnforcedCollection = function (arr, target) {\n for (var i = 0, len = arr.length; i < len; ++i) {\n if ( typeof (target[i]) == 'object' && typeof(arr[i]) != 'undefined' && !Array.isArray(arr[i]) ) {\n parseEnforced(arr[i], target[i])\n } else if ( !Array.isArray(arr[i]) ){\n if (typeof(arr[i]) == 'undefined') {\n delete target[i]\n }\n } else { // is collection type\n parseEnforcedCollection(arr[i], target[i])\n }\n }\n\n return target\n }\n\n var parseEnforced = function (obj, target) {\n for (var prop in target) {\n if ( typeof (target[prop]) == 'object' && typeof(obj[prop]) != 'undefined' && !Array.isArray(obj[prop]) ) {\n parseEnforced(obj[prop], target[prop])\n } else if ( !Array.isArray(obj[prop]) ){\n if (typeof(obj[prop]) == 'undefined') {\n delete target[ prop ]\n }\n } else { // is collection type\n parseEnforcedCollection(obj[prop], target[prop])\n }\n }\n\n return target\n };\n\n if ( Array.isArray(tmpCollections[ collection ][ index ]) ) {\n tmpCollections[ collection ][ index ] = parseEnforcedCollection(this, tmpCollections[ collection ][ index ])\n } else if ( typeof(tmpCollections[ collection ][ index ] ) == 'object' ) {\n tmpCollections[ collection ][ index ] = parseEnforced(this, tmpCollections[ collection ][ index ])\n } else {\n if (typeof(this[prop]) == 'undefined') {\n delete tmpCollections[ collection ][ index ]\n }\n }\n }\n\n collections[ collection ][ index ] = tmpCollections[ collection ][ index ];\n\n // saving\n storage.setItem(bucket, JSON.stringify(collections));\n\n return collectionFindOne(filter)\n\n } catch (err) {\n throw err\n }\n }\n }\n\n\n return result\n }\n\n /**\n * Delete from collection\n *\n * @param {object} filter\n *\n * @return {array} result\n * */\n function collectionDelete(filter) {\n\n if ( typeof(filter) !== 'object' ) {\n throw new Error('filter must be an object');\n } else {\n var content = JSON.parse(JSON.stringify( collections[ this['_collection'] ] ))\n //, condition = filter.count()\n , i = 0\n , found = [];\n\n for (var o in content) {\n for (var f in filter) {\n if ( filter[f] && keywords.indexOf(filter[f].toLocaleLowerCase()) > -1 && filter[f].toLowerCase() == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] != 'null' && content[o][f] != 'undefined' ) {\n if (found.indexOf(content[o][f]) < 0 ) {\n found[i] = content[o][f];\n delete collections[ this['_collection'] ][o][f];\n ++i\n }\n\n } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {\n found[i] = content[o];\n collections[ this['_collection'] ].splice(o, 1);\n ++i\n }\n }\n }\n }\n\n if (found.length > 0 ) {\n storage.setItem(this['_bucket'], JSON.stringify(collections));\n return true\n }\n\n return false\n }\n\n init(options);\n\n\n return bucketInstance\n};\n\nif ( ( typeof(module) !== 'undefined' ) && module.exports ) {\n // Publish as node.js module\n var merge = require('../../../../utils/lib/merge');\n var Collection = require('../../../../utils/collection');\n var uuid = require('uuid');\n\n module.exports = StoragePlugin\n} else if ( typeof(define) === 'function' && define.amd) {\n // Publish as AMD module\n define('gina/storage',[],function() { return StoragePlugin })\n};\n",
|
|
33
|
-
"define('gina/toolbar', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/collection', 'gina/storage' ], function (require) {\n\n var $ = require('jquery');\n var merge = require('utils/merge');\n var Collection = require('utils/collection');\n var Storage = require('gina/storage');\n\n function Toolbar() {\n\n //console.log('Toolbar jquery is ', $.fn.jquery);\n\n var self = {\n version : '1.0.2',\n foldingPaths : {},\n foldingClass : null,\n isUnfolded : null\n };\n\n var bucket = new Storage({bucket: 'gina'}) // <Bucket>\n , plugins = bucket.Collection('plugin'); // <Collection>\n\n var $toolbar = null\n , settings = null\n , isCollapsed = false\n , $tabs = null\n , $logo = null\n , $panelsContainer = null\n , $panels = null\n , $currentPanel = null\n , panelId = ''\n , $verticalPos = null\n , $horizontalPos = null\n , $toolbarPos = null\n , position = ''\n , $toolbarWidth = null\n , width = 0\n , $toolbarHeight = null\n , toolbarHeight = 0\n , contentHeight = 0\n , keynum = ''\n , lastPressedKey = {}\n , coockie = null\n , $json = null\n , $ginaJson = null\n , $jsonRAW = null\n , originalData = null\n , jsonObject = null\n , ginaJsonObject = null\n , $htmlData = null\n , $codeFoldingToggle = null\n , codeFolding = true\n , timeoutId = null\n , $copyCache = null\n , copyValue = null\n ;\n\n var init = function () {\n // Get elements\n $toolbar = $('#gina-toolbar');\n $tabs = $toolbar.find('.gina-toolbar-tab > a');\n $logo = $('#gina-toolbar-toggle');\n $panelsContainer = $('#gina-toolbar-panels');\n $panels = $panelsContainer.find('.gina-toolbar-panel');\n $verticalPos = $('#gina-toolbar-vposition');\n $horizontalPos = $('#gina-toolbar-hposition');\n $toolbarPos = $verticalPos.add($horizontalPos);\n $toolbarWidth = $('#gina-toolbar-width');\n $toolbarHeight = $toolbar.find('.gina-toolbar-main');\n $json = $('#gina-toolbar-json');\n $ginaJson = $('#gina-toolbar-gina-json');\n $jsonRAW = $('#gina-toolbar-toggle-code-raw');\n $htmlData = $('#gina-toolbar-data-html');\n $codeFoldingToggle = $('#gina-toolbar-code-toggle');\n\n // Append textarea for copy/paste then select it\n $toolbar.prepend('<textarea class=\"gina-toolbar-copy\"></textarea>');\n $copyCache = $toolbar.find('.gina-toolbar-copy');\n\n // Get toolbar settings\n settings = plugins.findOne({_name: 'toolbar'});\n\n if ( !settings ) {\n // default settings\n settings = {\n _name : 'toolbar',\n _version : self.version,\n _description : 'Toolbar settings',\n _licence : 'MIT',\n _author : [\n {name: 'Fabrice Delaneau', company: 'Freelancer'},\n {name: 'Martin-Luther Etouman', company: 'Rhinostone'}\n ],\n position : 'top-right',\n width : '30',\n panelId : '#gina-toolbar-data',\n isCollapsed : true,\n isUnfolded : []\n };\n // saving default settings\n plugins.insert(settings);\n\n }\n\n // in case of local storage schema update;\n if (settings._version != self.version) {\n checkSchemaUpdate();\n }\n\n position = settings.position;\n width = settings.width;\n panelId = settings.panelId;\n isCollapsed = settings.isCollapsed;\n\n $toolbar.removeClass('gina-toolbar-hidden');\n handle() // Bind behaviors\n };\n\n\n var checkSchemaUpdate = function () {\n // Run every update from your current version up to the head\n\n if (settings._version < '1.0.1') {\n if (!settings.isUnfolded ) {\n settings.isUnfolded = [];\n }\n if (settings.codeFolding != undefined) {\n delete settings.codeFolding;\n }\n }\n\n if ( typeof(settings.isUnfolded) != 'undefined' && !Array.isArray(settings.isUnfolded) ) {\n settings.isUnfolded = [];\n }\n\n // update version number\n settings._version = self.version;\n\n // save all changes\n settings.save(true);\n }\n\n /**\n * loadData\n *\n * @param {object} [section]\n * @param {object} [data]\n * @param {object} [ginaData]\n *\n * */\n var loadData = function (section, data, ginaData) {\n\n try {\n var txt = $json.text();\n if (txt == '' || txt == 'null' ) {\n $json.text('Empty')\n } else {\n jsonObject = JSON.parse(txt);\n ginaJsonObject = JSON.parse($ginaJson.text());\n $json.text('');\n\n // backing up document data\n if (!originalData) {\n originalData = {\n jsonObject : JSON.parse(JSON.stringify(jsonObject)),\n ginaJsonObject : JSON.parse(JSON.stringify(ginaJsonObject))\n }\n }\n }\n\n } catch (err) {\n $json.text('Could not load data');\n }\n\n if (jsonObject) {\n\n if (data && !ginaData) {\n if ( !jsonObject[section] )\n jsonObject[section] = {};\n\n jsonObject[section] = ginaJsonObject[section] = data;\n\n } else if ( section == 'data-xhr' && !data && jsonObject['data-xhr'] ) {\n // reset xhr\n delete jsonObject['data-xhr'];\n } else if (ginaData) {\n jsonObject = data;\n ginaJsonObject = ginaData;\n }\n\n // Make folding paths\n makeFoldingPaths(jsonObject, '');\n // Create DOM from JSON\n $htmlData.html('<ul class=\"gina-toolbar-code\">' + parseObject(jsonObject, ginaJsonObject) +'</ul>');\n\n // Manage folding state\n settings.currentFile = jsonObject.file;\n if (!settings.currentFile) {\n // Init currentFile if none exists\n settings.currentFile = jsonObject.file;\n } else if (jsonObject.file == settings.currentFile) {\n // If current page is the same as the previous page, unfold code as neede\n $(document).ready(function () {\n if ( settings.isUnfolded.length > 0)\n initFoldingState(settings.isUnfolded, settings.isUnfolded.length, 0);\n })\n }\n }\n }\n \n var initFoldingState = function (unfolded, len, i) {\n\n if (i == len) return false;\n\n var key = unfolded[i];\n\n if ( unfolded.indexOf(key) > -1 ) {\n\n toggleCodeFolding( $('.gina-toolbar-folding-state-'+ key), function onCodeToggled() {\n i += 1;\n initFoldingState(unfolded, len, i)\n });\n\n } else {\n i += 1;\n initFoldingState(unfolded, len, i)\n }\n }\n\n var handle = function () {\n\n\n // Add folding behavior\n $htmlData.off('click', 'a').on('click', 'a', function(event) {\n event.preventDefault();\n\n toggleCodeFolding($(this))\n });\n\n // Expand/collapse all code\n $codeFoldingToggle.off('click').on('click', function(event) {\n event.preventDefault();\n\n toggleCodeFolding('all')\n });\n\n // Add value to the clipboard\n $htmlData.off('click', '.gina-toolbar-value').on('click', '.gina-toolbar-value', function(event) {\n event.preventDefault();\n try {\n copyValue = $(this).text();\n $copyCache.text(copyValue);\n $copyCache.select();\n document.execCommand('copy', false, null);\n $copyCache.blur();\n } catch(err) {\n alert('Please press Ctrl/Cmd+C to copy the value');\n // throw err;\n }\n\n });\n\n // display RAW\n $jsonRAW.off('click').on('click', function(event){\n if (jsonObject) {\n var jsonOut = window.open(\"\", \"JSON RAW\", \"width=400,height=100\");\n //jsonOut.document.write( '<pre>' + JSON.stringify(jsonObject, null, 2) + '</pre>' );\n jsonOut.document.write( JSON.stringify(jsonObject) );\n }\n });\n\n // Tabs\n $tabs.off('click').on('click', function(event) {\n event.preventDefault();\n\n // Hide all panels\n $tabs.removeClass('gina-toolbar-active');\n $panels.removeClass('gina-toolbar-active');\n\n // Show selected tab\n $(this).addClass('gina-toolbar-active');\n\n // Show selected panel\n panelId = $(this).attr('href');\n $currentPanel = $(panelId).addClass('gina-toolbar-active');\n\n // Save current active tab to coockie\n settings.panelId = panelId;\n settings.save()\n });\n\n // Show/hide Toolbar\n $logo.off('click').on('click', function(event) {\n event.preventDefault();\n\n $toolbar.toggleClass('gina-toolbar-collapsed');\n\n // Save current visibility state to coockie\n isCollapsed = $toolbar.hasClass('gina-toolbar-collapsed')\n settings.isCollapsed = isCollapsed;\n settings.save()\n });\n\n // Toolbar position\n $toolbarPos.off('change').on('change', function(event) {\n event.preventDefault();\n\n // Get selected option value\n var vposition = $verticalPos.val();\n var hposition = $horizontalPos.val();\n position = vposition + '-' + hposition\n changeToolbarPosition(position);\n\n // Save new position to coockie\n settings.position = position;\n settings.save()\n });\n\n // Toolbar width\n $toolbarWidth.off('change').on('change', function(event) {\n event.preventDefault();\n\n // Get selected option value\n width = $toolbarWidth.val();\n changeToolbarWidth(width);\n\n // Save new width to coockie\n settings.width = width;\n settings.save()\n });\n\n // Toolbar height\n $(window).off('resize').on('resize', function() {\n changeToolbarHeight();\n });\n\n // Show/hide toolbar using gg shorcut\n $('body').off('keypress').on('keypress', function(event) {\n // console.log('event', event);\n if(event.keyCode) {\n // IE\n keynum = event.keyCode;\n } else if(event.which) {\n // Netscape/Firefox/Opera\n keynum = event.which;\n } else {\n // Chrome/Safari\n keynum = event.charCode;\n }\n var now = new Date();\n if (\n typeof lastPressedKey.keynum != \"undefined\"\n && lastPressedKey.keynum == keynum\n && typeof lastPressedKey.pressTime != \"undefined\"\n && now.getTime() - lastPressedKey.pressTime < 500\n ) {\n switch (keynum) {\n case 103: //This is the \"g\" key\n $toolbar.toggle();\n // variousTools.setCookie(\"gina-toolbar[hub]\", params.display.hub, 365);\n break;\n }\n }\n lastPressedKey.pressTime = now.getTime();\n lastPressedKey.keynum = keynum;\n });\n\n\n // Updates Toolbar with current values\n\n // Select the current tab\n $tabs.filter('[href=\"' + panelId +'\"]').trigger('click');\n\n // Open toolbar if needed\n if (!isCollapsed) {\n $('#gina-toolbar-toggle').trigger('click');\n }\n\n // Change Toolbar Position and init selects\n changeToolbarPosition(position);\n\n var positions = position.split('-');\n $verticalPos.val(positions[0]);\n $horizontalPos.val(positions[1]);\n\n // Change Toolbar Width and init select\n changeToolbarWidth(width);\n\n $toolbarWidth.val(width);\n\n // Change Toolbar max-Height;\n changeToolbarHeight();\n\n // Parse JSON\n var txt = $json.text();\n // dev only - allows HTML 5 mock\n if ( /^\\{\\{ (.*) \\}\\}/.test(txt) ) {\n // loading mock\n //var url = document.location.protocol + '//' + document.location.pathname.replace('index.html', '');\n //url + 'mock.json';\n loadJSON(txt, loadData); //parse\n\n } else {\n loadData()\n }\n }\n\n\n var changeToolbarPosition = function (position) {\n $toolbar\n .removeClass('gina-toolbar-top-left gina-toolbar-top-right gina-toolbar-bottom-left gina-toolbar-bottom-right')\n .addClass('gina-toolbar-'+ position);\n }\n\n var changeToolbarWidth = function (width) {\n $toolbar\n .removeClass('gina-toolbar-auto gina-toolbar-100 gina-toolbar-80 gina-toolbar-60 gina-toolbar-50 gina-toolbar-40 gina-toolbar-30')\n .addClass('gina-toolbar-'+ width);\n }\n\n var changeToolbarHeight = function () {\n // Use window height - 32px for the header\n toolbarHeight = window.innerHeight - 32;\n $toolbar\n .find('.gina-toolbar-main')\n .css('max-height', toolbarHeight +'px');\n\n checkContentHeight()\n }\n\n var checkContentHeight = function () {\n // check toolbar content against window height\n var $currentMain = $currentPanel.find('.gina-toolbar-main');\n var $currentContent = $currentMain.find('.gina-toolbar-content');\n contentHeight = $currentMain.height();\n if (contentHeight == toolbarHeight) {\n $currentContent.addClass('gina-toolbar-content-end')\n } else {\n $currentContent.removeClass('gina-toolbar-content-end')\n }\n }\n\n var toggleCodeFolding = function ($el, cb) {\n\n if ($el != undefined && $el.length && $el != 'all') {\n\n $el.next('ul').slideToggle('fast');\n $el.toggleClass('gina-toolbar-unfolded');\n\n // Check container height after animation\n // if (timeoutId != null) {\n // window.clearTimeout(timeoutId)\n // }\n // timeoutId = window.setTimeout(checkContentHeight, 300);\n\n // Save element folding state\n self.foldingClass = $el.attr('class');\n self.foldingClass = self.foldingClass.match(/gina-toolbar-folding-state-([-a-z]+)/)[1]\n\n if ($el.hasClass('gina-toolbar-unfolded')) {\n if ( settings.isUnfolded.indexOf(self.foldingClass) < 0 )\n settings.isUnfolded.push(self.foldingClass);\n\n //settings.isUnfolded[self.foldingClass] = true;\n settings.save()\n } else {\n //delete settings.isUnfolded[self.foldingClass];\n if ( settings.isUnfolded.indexOf(self.foldingClass) > -1 )\n settings.isUnfolded.splice( settings.isUnfolded.indexOf(self.foldingClass) );\n\n settings.save(true)\n }\n\n if ( typeof(cb) != 'undefined' )\n cb()\n }\n }\n\n var orderKeys = function(obj) {\n\n var newObj = {}\n , k = null\n , keys = []\n , i = 0\n , len = null\n ;\n\n for (k in obj) {\n if ( obj.hasOwnProperty(k) ){\n keys[i] = k;\n ++i\n }\n }\n\n len = keys.length;\n keys.sort();\n\n for (i = 0; i < len; ++i) {\n k = keys[i];\n newObj[k] = obj[k];\n }\n\n return newObj\n }\n\n var parseObject = function(obj, ginaObj, id) {\n var html = '';\n var id = id || '';\n var count = '';\n var objType = '';\n\n obj = orderKeys(obj);\n ginaObj = orderKeys(ginaObj);\n\n for (var i in obj) {\n //console.log('i', i);\n if ( typeof(obj[i]) == 'object' && !Array.isArray(obj[i]) && obj[i] !== null ) { // parse\n id += i + '-';\n html += '<li class=\"gina-toolbar-object\">';\n html += '<a href=\"#\" class=\"gina-toolbar-key gina-toolbar-folding-state-'+ id.substr(0, id.length - 1) +'\">'+ i +' <span>{ }</span></a>';\n html += '<ul class=\"gina-toolbar-object\">'+ parseObject(obj[i], ginaObj[i], id) +'</ul>';\n html += '</li>';\n // clear one level\n id = id.substr(0, id.length - i.length - 1);\n } else if ( Array.isArray(obj[i]) ) {\n id += i + '-';\n html += '<li class=\"gina-toolbar-collection\">';\n html += '<a href=\"#\" class=\"gina-toolbar-key gina-toolbar-folding-state-'+ id.substr(0, id.length - 1) +'\">'+ i +' <span>['+ obj[i].length +']</span></a>';\n html += '<ul class=\"gina-toolbar-collection\">'+ parseCollection(obj[i], ginaObj[i], id) +'</ul>';\n html += '</li>';\n // clear one level\n id = id.substr(0, id.length - i.length - 1);\n } else {\n objType = (ginaObj[i] === null) ? 'null' : typeof(ginaObj[i]);\n if ( objType == 'undefined' ) { // new key declaration added by user\n html += '<li class=\"gina-toolbar-key-value\">';\n html += '<span class=\"gina-toolbar-key gina-toolbar-key-added\">'+ i +':</span> <span class=\"gina-toolbar-value gina-toolbar-value-type-is-'+ objType +'\">'+ obj[i] +'</span>';\n html += '</li>';\n } else {\n\n if (/^_comment/.test(i) ) continue;\n\n if (obj[i] !== ginaObj[i] ) {\n html += '<li class=\"gina-toolbar-key-value gina-toolbar-is-overridden\">';\n html += '<span class=\"gina-toolbar-key\">'+ i +':</span> <span class=\"gina-toolbar-value\">'+ ginaObj[i] +'</span>';\n html += '</li>';\n\n html += '<li class=\"gina-toolbar-key-value\">';\n html += '<span class=\"gina-toolbar-key\">'+ i +':</span> <span class=\"gina-toolbar-value gina-toolbar-value-type-is-'+ objType +'\">'+ obj[i] +'</span>';\n html += '</li>';\n } else {\n html += '<li class=\"gina-toolbar-key-value\">';\n html += '<span class=\"gina-toolbar-key\">'+ i +':</span> <span class=\"gina-toolbar-value gina-toolbar-value-type-is-'+ objType +'\">'+ obj[i] +'</span>';\n html += '</li>';\n }\n }\n }\n }\n return html\n }\n\n var parseCollection = function (arr, ginaArr, id) {\n var html = '';\n var id = id || '';\n for (var i = 0, len = arr.length; i<len; ++i) {\n if ( typeof(arr[i]) == 'object' && !Array.isArray(arr[i]) ) {\n id += i + '-';\n html += '<li class=\"gina-toolbar-object\">';\n html += '<a href=\"#\" class=\"gina-toolbar-key gina-toolbar-folding-state-'+ id.substr(0, id.length - 1) +'\">'+ i +' <span>{ }</span></a>';\n html += '<ul class=\"gina-toolbar-object\">' + parseObject(arr[i], ginaArr[i], id) +'</ul>';\n html += '</li>';\n // clear one level\n id = id.substr(0, id.length - i.toString().length - 1);\n\n } else if ( Array.isArray(arr[i]) ) {\n id += i + '-';\n html += '<li class=\"gina-toolbar-collection\">';\n html += '<a href=\"#\" class=\"gina-toolbar-key gina-toolbar-folding-state-'+ id.substr(0, id.length - 1) +'\"\">'+ i +'<span>[ ]</span></a>';\n html += '<ul class=\"gina-toolbar-collection\">' + parseCollection(arr[i], ginaArr[i], id) +'</ul>';\n html += '</li>';\n // clear one level\n id = id.substr(0, id.length - i.toString().length - 1);\n } else {\n html += '<li class=\"gina-toolbar-key-value\"><span class=\"gina-toolbar-key\">'+ i +':</span> <span class=\"gina-toolbar-value\">'+ arr[i] +'</span></li>';\n }\n }\n return html\n }\n\n var createInputFile = function(id, label) {\n var html = '';\n html = '<label class=\"gina-toolbar-input-file\">',\n html += '<input type=\"file\" multiple id=\"' + id +'\">'\n html += label\n html += '</label>'\n return html\n }\n\n var loadJSON = function(txt, cb) {\n\n var html = createInputFile('mock', 'Select your JSON file');\n $htmlData.html(html);\n $json.text('');\n\n $htmlData.find('input').off('change').on('change', function(e) {\n\n var files = $(this)[0].files;\n var file = null;\n\n\n if (files.length == 1) {\n file = $(this)[0].files[0]; // jQuery way\n var reader = new FileReader();\n reader.addEventListener('load', function(){\n // user\n $json.text(reader.result);\n // gina <- being duplicated to prevent bugs\n $ginaJson.text(reader.result);\n cb();\n }, false);\n\n reader.readAsBinaryString(file)\n } else {\n var done = 0;\n var complete = function (done) {\n\n if (done == files.length) {\n cb()\n }\n };\n var reader = [];\n\n for (var i = 0, len = files.length; i < len; ++i) {\n file = files[i];\n switch (true) {\n case /user/.test(file.name):\n\n reader[i] = new FileReader();\n reader[i].addEventListener('load', function(e){\n\n // user\n $json.text(e.currentTarget.result);\n ++done;\n complete(done)\n }, false);\n\n reader[i].readAsBinaryString(file);\n\n break;\n\n case /gina/.test(file.name):\n //console.log(file);\n reader[i] = new FileReader();\n reader[i].addEventListener('load', function(e){\n // gina\n $ginaJson.text(e.currentTarget.result);\n ++done;\n complete(done)\n }, false);\n\n reader[i].readAsBinaryString(file);\n\n break;\n }\n }\n }\n\n });\n\n return false;\n }\n\n var makeFoldingPaths = function(obj, tmp) {\n for (var r in obj) {\n if ( typeof(obj[r]) == 'object' ) {\n self.foldingPaths[tmp + r] = tmp + r;\n makeFoldingPaths(obj[r], tmp + r+'-');\n }\n }\n }\n\n this.update = function (section, data) {\n loadData(section, data);\n }\n\n this.restore = function () {\n loadData('data', originalData.jsonObject, originalData.ginaJsonObject);\n }\n\n init();\n };\n\n return Toolbar\n});\n",
|
|
34
|
-
"define('gina', [ 'require', 'vendor/uuid', 'utils/merge', 'utils/events', 'helpers/dateFormat', 'gina/toolbar' ], function (require) {\n var eventsHandler = require('utils/events'); // events handler\n var merge = require('utils/merge');\n var dateFormat = require('helpers/dateFormat')();\n var uuid = require('vendor/uuid');\n\n\n\n /**\n * Imports & definitions\n * */\n\n var jQuery = (window['jQuery']) ? window['jQuery'] : null;\n\n if (!window.process ) {\n (function(window, nextTick, process, prefixes, i, p, fnc) {\n p = window[process] || (window[process] = {});\n while (!fnc && i < prefixes.length) {\n fnc = window[prefixes[i++] + 'equestAnimationFrame'];\n }\n p[nextTick] = p[nextTick] || (fnc && fnc.bind(window)) || window.setImmediate || window.setTimeout;\n })(window, 'nextTick', 'process', 'r webkitR mozR msR oR'.split(' '), 0);\n }\n\n if (!window.getComputedStyle) {\n /**\n * Returns the roster widget element.\n * @this {Window}\n * @return {ComputedStyle}\n */\n\n window.getComputedStyle = function(el, pseudo) {\n this.el = el;\n this.getPropertyValue = function(prop) {\n var re = /(\\-([a-z]){1})/g;\n if (prop == 'float') {\n prop = 'styleFloat'\n }\n if (re.test(prop)) {\n prop = prop.replace(re, function () {\n return arguments[2].toUpperCase()\n })\n }\n return el.currentStyle[prop] ? el.currentStyle[prop] : null\n }\n return this\n }\n }\n\n /**\n * Custom object properties definition\n * */\n\n Object.defineProperty( Date.prototype, 'format', {\n writable: false,\n enumerable: false,\n //If loaded several times, it can lead to an exception. That's why I put this.\n configurable: true,\n value: function(mask, utc){ return dateFormat.format(this, mask, utc) }\n });\n\n\n Object.defineProperty( Object.prototype, 'count', {\n writable: true,\n enumerable: false,\n //If loaded several times, it can lead to an exception. That's why I put this.\n configurable: true,\n value: function(){\n try {\n var self = this;\n if (this instanceof String) self = JSON.parse(this);\n var i = 0;\n for (var prop in this)\n if (this.hasOwnProperty(prop)) ++i;\n\n return i\n } catch (err) {\n return i\n }\n }\n });\n\n\n function construct(gina) {\n\n this.plugin = 'gina';\n\n var events = [ 'ginaloaded', 'ready' ];\n\n /**\n * setOptions\n * Override default options or add new options properties\n *\n * @param {object} options\n * */\n var setOptions = function(options) {\n proto.options = merge(proto.options, options, true)\n }\n\n var proto = { // instance proto\n 'id' : 'gina-' + uuid.v1(),\n\n 'plugin' : this.plugin,\n 'on' : on,\n 'eventData' : {},\n 'target' : document, // by default\n };\n\n document.id = proto.id;\n\n var $instance = {\n 'id' : proto.id,\n\n 'isFrameworkLoaded' : false,\n 'hasValidator' : false,\n 'hasPopinHandler' : false,\n 'options' : {},\n 'registeredEvents' : {},\n 'events' : {},\n\n 'setOptions' : setOptions\n };\n\n $instance = merge( (window['gina'] || {}), $instance);\n\n registerEvents(this.plugin, events);\n\n triggerEvent(gina, proto.target, 'ginaloaded', $instance)\n }\n\n return construct\n});\n",
|
|
35
|
-
"(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine('vendor/engine.io',[], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"eio\"] = factory();\n\telse\n\t\troot[\"eio\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = __webpack_require__(1);\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tmodule.exports = __webpack_require__(2);\n\n\t/**\n\t * Exports parser\n\t *\n\t * @api public\n\t *\n\t */\n\tmodule.exports.parser = __webpack_require__(9);\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n\t/**\n\t * Module dependencies.\n\t */\n\n\tvar transports = __webpack_require__(3);\n\tvar Emitter = __webpack_require__(19);\n\tvar debug = __webpack_require__(23)('engine.io-client:socket');\n\tvar index = __webpack_require__(30);\n\tvar parser = __webpack_require__(9);\n\tvar parseuri = __webpack_require__(31);\n\tvar parsejson = __webpack_require__(32);\n\tvar parseqs = __webpack_require__(20);\n\n\t/**\n\t * Module exports.\n\t */\n\n\tmodule.exports = Socket;\n\n\t/**\n\t * Socket constructor.\n\t *\n\t * @param {String|Object} uri or options\n\t * @param {Object} options\n\t * @api public\n\t */\n\n\tfunction Socket(uri, opts) {\n\t if (!(this instanceof Socket)) return new Socket(uri, opts);\n\n\t opts = opts || {};\n\n\t if (uri && 'object' === (typeof uri === 'undefined' ? 'undefined' : _typeof(uri))) {\n\t opts = uri;\n\t uri = null;\n\t }\n\n\t if (uri) {\n\t uri = parseuri(uri);\n\t opts.hostname = uri.host;\n\t opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';\n\t opts.port = uri.port;\n\t if (uri.query) opts.query = uri.query;\n\t } else if (opts.host) {\n\t opts.hostname = parseuri(opts.host).host;\n\t }\n\n\t this.secure = null != opts.secure ? opts.secure : global.location && 'https:' === location.protocol;\n\n\t if (opts.hostname && !opts.port) {\n\t // if no port is specified manually, use the protocol default\n\t opts.port = this.secure ? '443' : '80';\n\t }\n\n\t this.agent = opts.agent || false;\n\t this.hostname = opts.hostname || (global.location ? location.hostname : 'localhost');\n\t this.port = opts.port || (global.location && location.port ? location.port : this.secure ? 443 : 80);\n\t this.query = opts.query || {};\n\t if ('string' === typeof this.query) this.query = parseqs.decode(this.query);\n\t this.upgrade = false !== opts.upgrade;\n\t this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n\t this.forceJSONP = !!opts.forceJSONP;\n\t this.jsonp = false !== opts.jsonp;\n\t this.forceBase64 = !!opts.forceBase64;\n\t this.enablesXDR = !!opts.enablesXDR;\n\t this.timestampParam = opts.timestampParam || 't';\n\t this.timestampRequests = opts.timestampRequests;\n\t this.transports = opts.transports || ['polling', 'websocket'];\n\t this.transportOptions = opts.transportOptions || {};\n\t this.readyState = '';\n\t this.writeBuffer = [];\n\t this.prevBufferLen = 0;\n\t this.policyPort = opts.policyPort || 843;\n\t this.rememberUpgrade = opts.rememberUpgrade || false;\n\t this.binaryType = null;\n\t this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n\t this.perMessageDeflate = false !== opts.perMessageDeflate ? opts.perMessageDeflate || {} : false;\n\n\t if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n\t if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n\t this.perMessageDeflate.threshold = 1024;\n\t }\n\n\t // SSL options for Node.js client\n\t this.pfx = opts.pfx || null;\n\t this.key = opts.key || null;\n\t this.passphrase = opts.passphrase || null;\n\t this.cert = opts.cert || null;\n\t this.ca = opts.ca || null;\n\t this.ciphers = opts.ciphers || null;\n\t this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n\t this.forceNode = !!opts.forceNode;\n\n\t // other options for Node.js client\n\t var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === 'object' && global;\n\t if (freeGlobal.global === freeGlobal) {\n\t if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n\t this.extraHeaders = opts.extraHeaders;\n\t }\n\n\t if (opts.localAddress) {\n\t this.localAddress = opts.localAddress;\n\t }\n\t }\n\n\t // set on handshake\n\t this.id = null;\n\t this.upgrades = null;\n\t this.pingInterval = null;\n\t this.pingTimeout = null;\n\n\t // set on heartbeat\n\t this.pingIntervalTimer = null;\n\t this.pingTimeoutTimer = null;\n\n\t this.open();\n\t}\n\n\tSocket.priorWebsocketSuccess = false;\n\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\n\tEmitter(Socket.prototype);\n\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\n\tSocket.protocol = parser.protocol; // this is an int\n\n\t/**\n\t * Expose deps for legacy compatibility\n\t * and standalone browser access.\n\t */\n\n\tSocket.Socket = Socket;\n\tSocket.Transport = __webpack_require__(8);\n\tSocket.transports = __webpack_require__(3);\n\tSocket.parser = __webpack_require__(9);\n\n\t/**\n\t * Creates transport of the given type.\n\t *\n\t * @param {String} transport name\n\t * @return {Transport}\n\t * @api private\n\t */\n\n\tSocket.prototype.createTransport = function (name) {\n\t debug('creating transport \"%s\"', name);\n\t var query = clone(this.query);\n\n\t // append engine.io protocol identifier\n\t query.EIO = parser.protocol;\n\n\t // transport name\n\t query.transport = name;\n\n\t // per-transport options\n\t var options = this.transportOptions[name] || {};\n\n\t // session id if we already have one\n\t if (this.id) query.sid = this.id;\n\n\t var transport = new transports[name]({\n\t query: query,\n\t socket: this,\n\t agent: options.agent || this.agent,\n\t hostname: options.hostname || this.hostname,\n\t port: options.port || this.port,\n\t secure: options.secure || this.secure,\n\t path: options.path || this.path,\n\t forceJSONP: options.forceJSONP || this.forceJSONP,\n\t jsonp: options.jsonp || this.jsonp,\n\t forceBase64: options.forceBase64 || this.forceBase64,\n\t enablesXDR: options.enablesXDR || this.enablesXDR,\n\t timestampRequests: options.timestampRequests || this.timestampRequests,\n\t timestampParam: options.timestampParam || this.timestampParam,\n\t policyPort: options.policyPort || this.policyPort,\n\t pfx: options.pfx || this.pfx,\n\t key: options.key || this.key,\n\t passphrase: options.passphrase || this.passphrase,\n\t cert: options.cert || this.cert,\n\t ca: options.ca || this.ca,\n\t ciphers: options.ciphers || this.ciphers,\n\t rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,\n\t perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,\n\t extraHeaders: options.extraHeaders || this.extraHeaders,\n\t forceNode: options.forceNode || this.forceNode,\n\t localAddress: options.localAddress || this.localAddress,\n\t requestTimeout: options.requestTimeout || this.requestTimeout,\n\t protocols: options.protocols || void 0\n\t });\n\n\t return transport;\n\t};\n\n\tfunction clone(obj) {\n\t var o = {};\n\t for (var i in obj) {\n\t if (obj.hasOwnProperty(i)) {\n\t o[i] = obj[i];\n\t }\n\t }\n\t return o;\n\t}\n\n\t/**\n\t * Initializes transport to use and starts probe.\n\t *\n\t * @api private\n\t */\n\tSocket.prototype.open = function () {\n\t var transport;\n\t if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {\n\t transport = 'websocket';\n\t } else if (0 === this.transports.length) {\n\t // Emit error on next tick so it can be listened to\n\t var self = this;\n\t setTimeout(function () {\n\t self.emit('error', 'No transports available');\n\t }, 0);\n\t return;\n\t } else {\n\t transport = this.transports[0];\n\t }\n\t this.readyState = 'opening';\n\n\t // Retry with the next transport if the transport is disabled (jsonp: false)\n\t try {\n\t transport = this.createTransport(transport);\n\t } catch (e) {\n\t this.transports.shift();\n\t this.open();\n\t return;\n\t }\n\n\t transport.open();\n\t this.setTransport(transport);\n\t};\n\n\t/**\n\t * Sets the current transport. Disables the existing one (if any).\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.setTransport = function (transport) {\n\t debug('setting transport %s', transport.name);\n\t var self = this;\n\n\t if (this.transport) {\n\t debug('clearing existing transport %s', this.transport.name);\n\t this.transport.removeAllListeners();\n\t }\n\n\t // set up transport\n\t this.transport = transport;\n\n\t // set up transport listeners\n\t transport.on('drain', function () {\n\t self.onDrain();\n\t }).on('packet', function (packet) {\n\t self.onPacket(packet);\n\t }).on('error', function (e) {\n\t self.onError(e);\n\t }).on('close', function () {\n\t self.onClose('transport close');\n\t });\n\t};\n\n\t/**\n\t * Probes a transport.\n\t *\n\t * @param {String} transport name\n\t * @api private\n\t */\n\n\tSocket.prototype.probe = function (name) {\n\t debug('probing transport \"%s\"', name);\n\t var transport = this.createTransport(name, { probe: 1 });\n\t var failed = false;\n\t var self = this;\n\n\t Socket.priorWebsocketSuccess = false;\n\n\t function onTransportOpen() {\n\t if (self.onlyBinaryUpgrades) {\n\t var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n\t failed = failed || upgradeLosesBinary;\n\t }\n\t if (failed) return;\n\n\t debug('probe transport \"%s\" opened', name);\n\t transport.send([{ type: 'ping', data: 'probe' }]);\n\t transport.once('packet', function (msg) {\n\t if (failed) return;\n\t if ('pong' === msg.type && 'probe' === msg.data) {\n\t debug('probe transport \"%s\" pong', name);\n\t self.upgrading = true;\n\t self.emit('upgrading', transport);\n\t if (!transport) return;\n\t Socket.priorWebsocketSuccess = 'websocket' === transport.name;\n\n\t debug('pausing current transport \"%s\"', self.transport.name);\n\t self.transport.pause(function () {\n\t if (failed) return;\n\t if ('closed' === self.readyState) return;\n\t debug('changing transport and sending upgrade packet');\n\n\t cleanup();\n\n\t self.setTransport(transport);\n\t transport.send([{ type: 'upgrade' }]);\n\t self.emit('upgrade', transport);\n\t transport = null;\n\t self.upgrading = false;\n\t self.flush();\n\t });\n\t } else {\n\t debug('probe transport \"%s\" failed', name);\n\t var err = new Error('probe error');\n\t err.transport = transport.name;\n\t self.emit('upgradeError', err);\n\t }\n\t });\n\t }\n\n\t function freezeTransport() {\n\t if (failed) return;\n\n\t // Any callback called by transport should be ignored since now\n\t failed = true;\n\n\t cleanup();\n\n\t transport.close();\n\t transport = null;\n\t }\n\n\t // Handle any error that happens while probing\n\t function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }\n\n\t function onTransportClose() {\n\t onerror('transport closed');\n\t }\n\n\t // When the socket is closed while we're probing\n\t function onclose() {\n\t onerror('socket closed');\n\t }\n\n\t // When the socket is upgraded while we're probing\n\t function onupgrade(to) {\n\t if (transport && to.name !== transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }\n\n\t // Remove all listeners on the transport and on self\n\t function cleanup() {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }\n\n\t transport.once('open', onTransportOpen);\n\t transport.once('error', onerror);\n\t transport.once('close', onTransportClose);\n\n\t this.once('close', onclose);\n\t this.once('upgrading', onupgrade);\n\n\t transport.open();\n\t};\n\n\t/**\n\t * Called when connection is deemed open.\n\t *\n\t * @api public\n\t */\n\n\tSocket.prototype.onOpen = function () {\n\t debug('socket open');\n\t this.readyState = 'open';\n\t Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;\n\t this.emit('open');\n\t this.flush();\n\n\t // we check for `readyState` in case an `open`\n\t // listener already closed the socket\n\t if ('open' === this.readyState && this.upgrade && this.transport.pause) {\n\t debug('starting upgrade probes');\n\t for (var i = 0, l = this.upgrades.length; i < l; i++) {\n\t this.probe(this.upgrades[i]);\n\t }\n\t }\n\t};\n\n\t/**\n\t * Handles a packet.\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.onPacket = function (packet) {\n\t if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n\t debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\n\t this.emit('packet', packet);\n\n\t // Socket is live - any packet counts\n\t this.emit('heartbeat');\n\n\t switch (packet.type) {\n\t case 'open':\n\t this.onHandshake(parsejson(packet.data));\n\t break;\n\n\t case 'pong':\n\t this.setPing();\n\t this.emit('pong');\n\t break;\n\n\t case 'error':\n\t var err = new Error('server error');\n\t err.code = packet.data;\n\t this.onError(err);\n\t break;\n\n\t case 'message':\n\t this.emit('data', packet.data);\n\t this.emit('message', packet.data);\n\t break;\n\t }\n\t } else {\n\t debug('packet received with socket readyState \"%s\"', this.readyState);\n\t }\n\t};\n\n\t/**\n\t * Called upon handshake completion.\n\t *\n\t * @param {Object} handshake obj\n\t * @api private\n\t */\n\n\tSocket.prototype.onHandshake = function (data) {\n\t this.emit('handshake', data);\n\t this.id = data.sid;\n\t this.transport.query.sid = data.sid;\n\t this.upgrades = this.filterUpgrades(data.upgrades);\n\t this.pingInterval = data.pingInterval;\n\t this.pingTimeout = data.pingTimeout;\n\t this.onOpen();\n\t // In case open handler closes socket\n\t if ('closed' === this.readyState) return;\n\t this.setPing();\n\n\t // Prolong liveness of socket on heartbeat\n\t this.removeListener('heartbeat', this.onHeartbeat);\n\t this.on('heartbeat', this.onHeartbeat);\n\t};\n\n\t/**\n\t * Resets ping timeout.\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.onHeartbeat = function (timeout) {\n\t clearTimeout(this.pingTimeoutTimer);\n\t var self = this;\n\t self.pingTimeoutTimer = setTimeout(function () {\n\t if ('closed' === self.readyState) return;\n\t self.onClose('ping timeout');\n\t }, timeout || self.pingInterval + self.pingTimeout);\n\t};\n\n\t/**\n\t * Pings server every `this.pingInterval` and expects response\n\t * within `this.pingTimeout` or closes connection.\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.setPing = function () {\n\t var self = this;\n\t clearTimeout(self.pingIntervalTimer);\n\t self.pingIntervalTimer = setTimeout(function () {\n\t debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n\t self.ping();\n\t self.onHeartbeat(self.pingTimeout);\n\t }, self.pingInterval);\n\t};\n\n\t/**\n\t* Sends a ping packet.\n\t*\n\t* @api private\n\t*/\n\n\tSocket.prototype.ping = function () {\n\t var self = this;\n\t this.sendPacket('ping', function () {\n\t self.emit('ping');\n\t });\n\t};\n\n\t/**\n\t * Called on `drain` event\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.onDrain = function () {\n\t this.writeBuffer.splice(0, this.prevBufferLen);\n\n\t // setting prevBufferLen = 0 is very important\n\t // for example, when upgrading, upgrade packet is sent over,\n\t // and a nonzero prevBufferLen could cause problems on `drain`\n\t this.prevBufferLen = 0;\n\n\t if (0 === this.writeBuffer.length) {\n\t this.emit('drain');\n\t } else {\n\t this.flush();\n\t }\n\t};\n\n\t/**\n\t * Flush write buffers.\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.flush = function () {\n\t if ('closed' !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) {\n\t debug('flushing %d packets in socket', this.writeBuffer.length);\n\t this.transport.send(this.writeBuffer);\n\t // keep track of current length of writeBuffer\n\t // splice writeBuffer and callbackBuffer on `drain`\n\t this.prevBufferLen = this.writeBuffer.length;\n\t this.emit('flush');\n\t }\n\t};\n\n\t/**\n\t * Sends a message.\n\t *\n\t * @param {String} message.\n\t * @param {Function} callback function.\n\t * @param {Object} options.\n\t * @return {Socket} for chaining.\n\t * @api public\n\t */\n\n\tSocket.prototype.write = Socket.prototype.send = function (msg, options, fn) {\n\t this.sendPacket('message', msg, options, fn);\n\t return this;\n\t};\n\n\t/**\n\t * Sends a packet.\n\t *\n\t * @param {String} packet type.\n\t * @param {String} data.\n\t * @param {Object} options.\n\t * @param {Function} callback function.\n\t * @api private\n\t */\n\n\tSocket.prototype.sendPacket = function (type, data, options, fn) {\n\t if ('function' === typeof data) {\n\t fn = data;\n\t data = undefined;\n\t }\n\n\t if ('function' === typeof options) {\n\t fn = options;\n\t options = null;\n\t }\n\n\t if ('closing' === this.readyState || 'closed' === this.readyState) {\n\t return;\n\t }\n\n\t options = options || {};\n\t options.compress = false !== options.compress;\n\n\t var packet = {\n\t type: type,\n\t data: data,\n\t options: options\n\t };\n\t this.emit('packetCreate', packet);\n\t this.writeBuffer.push(packet);\n\t if (fn) this.once('flush', fn);\n\t this.flush();\n\t};\n\n\t/**\n\t * Closes the connection.\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.close = function () {\n\t if ('opening' === this.readyState || 'open' === this.readyState) {\n\t this.readyState = 'closing';\n\n\t var self = this;\n\n\t if (this.writeBuffer.length) {\n\t this.once('drain', function () {\n\t if (this.upgrading) {\n\t waitForUpgrade();\n\t } else {\n\t close();\n\t }\n\t });\n\t } else if (this.upgrading) {\n\t waitForUpgrade();\n\t } else {\n\t close();\n\t }\n\t }\n\n\t function close() {\n\t self.onClose('forced close');\n\t debug('socket closing - telling transport to close');\n\t self.transport.close();\n\t }\n\n\t function cleanupAndClose() {\n\t self.removeListener('upgrade', cleanupAndClose);\n\t self.removeListener('upgradeError', cleanupAndClose);\n\t close();\n\t }\n\n\t function waitForUpgrade() {\n\t // wait for upgrade to finish since we can't send packets while pausing a transport\n\t self.once('upgrade', cleanupAndClose);\n\t self.once('upgradeError', cleanupAndClose);\n\t }\n\n\t return this;\n\t};\n\n\t/**\n\t * Called upon transport error\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.onError = function (err) {\n\t debug('socket error %j', err);\n\t Socket.priorWebsocketSuccess = false;\n\t this.emit('error', err);\n\t this.onClose('transport error', err);\n\t};\n\n\t/**\n\t * Called upon transport close.\n\t *\n\t * @api private\n\t */\n\n\tSocket.prototype.onClose = function (reason, desc) {\n\t if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n\t debug('socket close with reason: \"%s\"', reason);\n\t var self = this;\n\n\t // clear timers\n\t clearTimeout(this.pingIntervalTimer);\n\t clearTimeout(this.pingTimeoutTimer);\n\n\t // stop event from firing again for transport\n\t this.transport.removeAllListeners('close');\n\n\t // ensure transport won't stay open\n\t this.transport.close();\n\n\t // ignore further transport communication\n\t this.transport.removeAllListeners();\n\n\t // set ready state\n\t this.readyState = 'closed';\n\n\t // clear session id\n\t this.id = null;\n\n\t // emit close event\n\t this.emit('close', reason, desc);\n\n\t // clean buffers after, so users can still\n\t // grab the buffers on `close` event\n\t self.writeBuffer = [];\n\t self.prevBufferLen = 0;\n\t }\n\t};\n\n\t/**\n\t * Filters upgrades, returning only those matching client transports.\n\t *\n\t * @param {Array} server upgrades\n\t * @api private\n\t *\n\t */\n\n\tSocket.prototype.filterUpgrades = function (upgrades) {\n\t var filteredUpgrades = [];\n\t for (var i = 0, j = upgrades.length; i < j; i++) {\n\t if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n\t }\n\t return filteredUpgrades;\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\t/**\n\t * Module dependencies\n\t */\n\n\tvar XMLHttpRequest = __webpack_require__(4);\n\tvar XHR = __webpack_require__(6);\n\tvar JSONP = __webpack_require__(27);\n\tvar websocket = __webpack_require__(28);\n\n\t/**\n\t * Export transports.\n\t */\n\n\texports.polling = polling;\n\texports.websocket = websocket;\n\n\t/**\n\t * Polling transport polymorphic constructor.\n\t * Decides on xhr vs jsonp based on feature detection.\n\t *\n\t * @api private\n\t */\n\n\tfunction polling(opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\t// browser shim for xmlhttprequest module\n\n\tvar hasCORS = __webpack_require__(5);\n\n\tmodule.exports = function (opts) {\n\t var xdomain = opts.xdomain;\n\n\t // scheme must be same when usign XDomainRequest\n\t // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\t var xscheme = opts.xscheme;\n\n\t // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n\t // https://github.com/Automattic/engine.io-client/pull/217\n\t var enablesXDR = opts.enablesXDR;\n\n\t // XMLHttpRequest can be disabled on IE\n\t try {\n\t if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n\t return new XMLHttpRequest();\n\t }\n\t } catch (e) {}\n\n\t // Use XDomainRequest for IE8 if enablesXDR is true\n\t // because loading bar keeps flashing when using jsonp-polling\n\t // https://github.com/yujiosaka/socke.io-ie8-loading-example\n\t try {\n\t if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {\n\t return new XDomainRequest();\n\t }\n\t } catch (e) {}\n\n\t if (!xdomain) {\n\t try {\n\t return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');\n\t } catch (e) {}\n\t }\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Module exports.\n\t *\n\t * Logic borrowed from Modernizr:\n\t *\n\t * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n\t */\n\n\ttry {\n\t module.exports = typeof XMLHttpRequest !== 'undefined' &&\n\t 'withCredentials' in new XMLHttpRequest();\n\t} catch (err) {\n\t // if XMLHttp support is disabled in IE then it will throw\n\t // when trying to create\n\t module.exports = false;\n\t}\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\t/**\n\t * Module requirements.\n\t */\n\n\tvar XMLHttpRequest = __webpack_require__(4);\n\tvar Polling = __webpack_require__(7);\n\tvar Emitter = __webpack_require__(19);\n\tvar inherit = __webpack_require__(21);\n\tvar debug = __webpack_require__(23)('engine.io-client:polling-xhr');\n\n\t/**\n\t * Module exports.\n\t */\n\n\tmodule.exports = XHR;\n\tmodule.exports.Request = Request;\n\n\t/**\n\t * Empty function\n\t */\n\n\tfunction empty() {}\n\n\t/**\n\t * XHR Polling constructor.\n\t *\n\t * @param {Object} opts\n\t * @api public\n\t */\n\n\tfunction XHR(opts) {\n\t Polling.call(this, opts);\n\t this.requestTimeout = opts.requestTimeout;\n\t this.extraHeaders = opts.extraHeaders;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t this.xd = opts.hostname !== global.location.hostname || port !== opts.port;\n\t this.xs = opts.secure !== isSSL;\n\t }\n\t}\n\n\t/**\n\t * Inherits from Polling.\n\t */\n\n\tinherit(XHR, Polling);\n\n\t/**\n\t * XHR supports binary\n\t */\n\n\tXHR.prototype.supportsBinary = true;\n\n\t/**\n\t * Creates a request.\n\t *\n\t * @param {String} method\n\t * @api private\n\t */\n\n\tXHR.prototype.request = function (opts) {\n\t opts = opts || {};\n\t opts.uri = this.uri();\n\t opts.xd = this.xd;\n\t opts.xs = this.xs;\n\t opts.agent = this.agent || false;\n\t opts.supportsBinary = this.supportsBinary;\n\t opts.enablesXDR = this.enablesXDR;\n\n\t // SSL options for Node.js client\n\t opts.pfx = this.pfx;\n\t opts.key = this.key;\n\t opts.passphrase = this.passphrase;\n\t opts.cert = this.cert;\n\t opts.ca = this.ca;\n\t opts.ciphers = this.ciphers;\n\t opts.rejectUnauthorized = this.rejectUnauthorized;\n\t opts.requestTimeout = this.requestTimeout;\n\n\t // other options for Node.js client\n\t opts.extraHeaders = this.extraHeaders;\n\n\t return new Request(opts);\n\t};\n\n\t/**\n\t * Sends data.\n\t *\n\t * @param {String} data to send.\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\n\tXHR.prototype.doWrite = function (data, fn) {\n\t var isBinary = typeof data !== 'string' && data !== undefined;\n\t var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n\t var self = this;\n\t req.on('success', fn);\n\t req.on('error', function (err) {\n\t self.onError('xhr post error', err);\n\t });\n\t this.sendXhr = req;\n\t};\n\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\n\tXHR.prototype.doPoll = function () {\n\t debug('xhr poll');\n\t var req = this.request();\n\t var self = this;\n\t req.on('data', function (data) {\n\t self.onData(data);\n\t });\n\t req.on('error', function (err) {\n\t self.onError('xhr poll error', err);\n\t });\n\t this.pollXhr = req;\n\t};\n\n\t/**\n\t * Request constructor\n\t *\n\t * @param {Object} options\n\t * @api public\n\t */\n\n\tfunction Request(opts) {\n\t this.method = opts.method || 'GET';\n\t this.uri = opts.uri;\n\t this.xd = !!opts.xd;\n\t this.xs = !!opts.xs;\n\t this.async = false !== opts.async;\n\t this.data = undefined !== opts.data ? opts.data : null;\n\t this.agent = opts.agent;\n\t this.isBinary = opts.isBinary;\n\t this.supportsBinary = opts.supportsBinary;\n\t this.enablesXDR = opts.enablesXDR;\n\t this.requestTimeout = opts.requestTimeout;\n\n\t // SSL options for Node.js client\n\t this.pfx = opts.pfx;\n\t this.key = opts.key;\n\t this.passphrase = opts.passphrase;\n\t this.cert = opts.cert;\n\t this.ca = opts.ca;\n\t this.ciphers = opts.ciphers;\n\t this.rejectUnauthorized = opts.rejectUnauthorized;\n\n\t // other options for Node.js client\n\t this.extraHeaders = opts.extraHeaders;\n\n\t this.create();\n\t}\n\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\n\tEmitter(Request.prototype);\n\n\t/**\n\t * Creates the XHR object and sends the request.\n\t *\n\t * @api private\n\t */\n\n\tRequest.prototype.create = function () {\n\t var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\n\t // SSL options for Node.js client\n\t opts.pfx = this.pfx;\n\t opts.key = this.key;\n\t opts.passphrase = this.passphrase;\n\t opts.cert = this.cert;\n\t opts.ca = this.ca;\n\t opts.ciphers = this.ciphers;\n\t opts.rejectUnauthorized = this.rejectUnauthorized;\n\n\t var xhr = this.xhr = new XMLHttpRequest(opts);\n\t var self = this;\n\n\t try {\n\t debug('xhr open %s: %s', this.method, this.uri);\n\t xhr.open(this.method, this.uri, this.async);\n\t try {\n\t if (this.extraHeaders) {\n\t xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n\t for (var i in this.extraHeaders) {\n\t if (this.extraHeaders.hasOwnProperty(i)) {\n\t xhr.setRequestHeader(i, this.extraHeaders[i]);\n\t }\n\t }\n\t }\n\t } catch (e) {}\n\n\t if ('POST' === this.method) {\n\t try {\n\t if (this.isBinary) {\n\t xhr.setRequestHeader('Content-type', 'application/octet-stream');\n\t } else {\n\t xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n\t }\n\t } catch (e) {}\n\t }\n\n\t try {\n\t xhr.setRequestHeader('Accept', '*/*');\n\t } catch (e) {}\n\n\t // ie6 check\n\t if ('withCredentials' in xhr) {\n\t xhr.withCredentials = true;\n\t }\n\n\t if (this.requestTimeout) {\n\t xhr.timeout = this.requestTimeout;\n\t }\n\n\t if (this.hasXDR()) {\n\t xhr.onload = function () {\n\t self.onLoad();\n\t };\n\t xhr.onerror = function () {\n\t self.onError(xhr.responseText);\n\t };\n\t } else {\n\t xhr.onreadystatechange = function () {\n\t if (xhr.readyState === 2) {\n\t var contentType;\n\t try {\n\t contentType = xhr.getResponseHeader('Content-Type');\n\t } catch (e) {}\n\t if (contentType === 'application/octet-stream') {\n\t xhr.responseType = 'arraybuffer';\n\t }\n\t }\n\t if (4 !== xhr.readyState) return;\n\t if (200 === xhr.status || 1223 === xhr.status) {\n\t self.onLoad();\n\t } else {\n\t // make sure the `error` event handler that's user-set\n\t // does not throw in the same tick and gets caught here\n\t setTimeout(function () {\n\t self.onError(xhr.status);\n\t }, 0);\n\t }\n\t };\n\t }\n\n\t debug('xhr data %s', this.data);\n\t xhr.send(this.data);\n\t } catch (e) {\n\t // Need to defer since .create() is called directly fhrom the constructor\n\t // and thus the 'error' event can only be only bound *after* this exception\n\t // occurs. Therefore, also, we cannot throw here at all.\n\t setTimeout(function () {\n\t self.onError(e);\n\t }, 0);\n\t return;\n\t }\n\n\t if (global.document) {\n\t this.index = Request.requestsCount++;\n\t Request.requests[this.index] = this;\n\t }\n\t};\n\n\t/**\n\t * Called upon successful response.\n\t *\n\t * @api private\n\t */\n\n\tRequest.prototype.onSuccess = function () {\n\t this.emit('success');\n\t this.cleanup();\n\t};\n\n\t/**\n\t * Called if we have data.\n\t *\n\t * @api private\n\t */\n\n\tRequest.prototype.onData = function (data) {\n\t this.emit('data', data);\n\t this.onSuccess();\n\t};\n\n\t/**\n\t * Called upon error.\n\t *\n\t * @api private\n\t */\n\n\tRequest.prototype.onError = function (err) {\n\t this.emit('error', err);\n\t this.cleanup(true);\n\t};\n\n\t/**\n\t * Cleans up house.\n\t *\n\t * @api private\n\t */\n\n\tRequest.prototype.cleanup = function (fromError) {\n\t if ('undefined' === typeof this.xhr || null === this.xhr) {\n\t return;\n\t }\n\t // xmlhttprequest\n\t if (this.hasXDR()) {\n\t this.xhr.onload = this.xhr.onerror = empty;\n\t } else {\n\t this.xhr.onreadystatechange = empty;\n\t }\n\n\t if (fromError) {\n\t try {\n\t this.xhr.abort();\n\t } catch (e) {}\n\t }\n\n\t if (global.document) {\n\t delete Request.requests[this.index];\n\t }\n\n\t this.xhr = null;\n\t};\n\n\t/**\n\t * Called upon load.\n\t *\n\t * @api private\n\t */\n\n\tRequest.prototype.onLoad = function () {\n\t var data;\n\t try {\n\t var contentType;\n\t try {\n\t contentType = this.xhr.getResponseHeader('Content-Type');\n\t } catch (e) {}\n\t if (contentType === 'application/octet-stream') {\n\t data = this.xhr.response || this.xhr.responseText;\n\t } else {\n\t data = this.xhr.responseText;\n\t }\n\t } catch (e) {\n\t this.onError(e);\n\t }\n\t if (null != data) {\n\t this.onData(data);\n\t }\n\t};\n\n\t/**\n\t * Check if it has XDomainRequest.\n\t *\n\t * @api private\n\t */\n\n\tRequest.prototype.hasXDR = function () {\n\t return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n\t};\n\n\t/**\n\t * Aborts the request.\n\t *\n\t * @api public\n\t */\n\n\tRequest.prototype.abort = function () {\n\t this.cleanup();\n\t};\n\n\t/**\n\t * Aborts pending requests when unloading the window. This is needed to prevent\n\t * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n\t * emitted.\n\t */\n\n\tRequest.requestsCount = 0;\n\tRequest.requests = {};\n\n\tif (global.document) {\n\t if (global.attachEvent) {\n\t global.attachEvent('onunload', unloadHandler);\n\t } else if (global.addEventListener) {\n\t global.addEventListener('beforeunload', unloadHandler, false);\n\t }\n\t}\n\n\tfunction unloadHandler() {\n\t for (var i in Request.requests) {\n\t if (Request.requests.hasOwnProperty(i)) {\n\t Request.requests[i].abort();\n\t }\n\t }\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\t/**\n\t * Module dependencies.\n\t */\n\n\tvar Transport = __webpack_require__(8);\n\tvar parseqs = __webpack_require__(20);\n\tvar parser = __webpack_require__(9);\n\tvar inherit = __webpack_require__(21);\n\tvar yeast = __webpack_require__(22);\n\tvar debug = __webpack_require__(23)('engine.io-client:polling');\n\n\t/**\n\t * Module exports.\n\t */\n\n\tmodule.exports = Polling;\n\n\t/**\n\t * Is XHR2 supported?\n\t */\n\n\tvar hasXHR2 = function () {\n\t var XMLHttpRequest = __webpack_require__(4);\n\t var xhr = new XMLHttpRequest({ xdomain: false });\n\t return null != xhr.responseType;\n\t}();\n\n\t/**\n\t * Polling interface.\n\t *\n\t * @param {Object} opts\n\t * @api private\n\t */\n\n\tfunction Polling(opts) {\n\t var forceBase64 = opts && opts.forceBase64;\n\t if (!hasXHR2 || forceBase64) {\n\t this.supportsBinary = false;\n\t }\n\t Transport.call(this, opts);\n\t}\n\n\t/**\n\t * Inherits from Transport.\n\t */\n\n\tinherit(Polling, Transport);\n\n\t/**\n\t * Transport name.\n\t */\n\n\tPolling.prototype.name = 'polling';\n\n\t/**\n\t * Opens the socket (triggers polling). We write a PING message to determine\n\t * when the transport is open.\n\t *\n\t * @api private\n\t */\n\n\tPolling.prototype.doOpen = function () {\n\t this.poll();\n\t};\n\n\t/**\n\t * Pauses polling.\n\t *\n\t * @param {Function} callback upon buffers are flushed and transport is paused\n\t * @api private\n\t */\n\n\tPolling.prototype.pause = function (onPause) {\n\t var self = this;\n\n\t this.readyState = 'pausing';\n\n\t function pause() {\n\t debug('paused');\n\t self.readyState = 'paused';\n\t onPause();\n\t }\n\n\t if (this.polling || !this.writable) {\n\t var total = 0;\n\n\t if (this.polling) {\n\t debug('we are currently polling - waiting to pause');\n\t total++;\n\t this.once('pollComplete', function () {\n\t debug('pre-pause polling complete');\n\t --total || pause();\n\t });\n\t }\n\n\t if (!this.writable) {\n\t debug('we are currently writing - waiting to pause');\n\t total++;\n\t this.once('drain', function () {\n\t debug('pre-pause writing complete');\n\t --total || pause();\n\t });\n\t }\n\t } else {\n\t pause();\n\t }\n\t};\n\n\t/**\n\t * Starts polling cycle.\n\t *\n\t * @api public\n\t */\n\n\tPolling.prototype.poll = function () {\n\t debug('polling');\n\t this.polling = true;\n\t this.doPoll();\n\t this.emit('poll');\n\t};\n\n\t/**\n\t * Overloads onData to detect payloads.\n\t *\n\t * @api private\n\t */\n\n\tPolling.prototype.onData = function (data) {\n\t var self = this;\n\t debug('polling got data %s', data);\n\t var callback = function callback(packet, index, total) {\n\t // if its the first message we consider the transport open\n\t if ('opening' === self.readyState) {\n\t self.onOpen();\n\t }\n\n\t // if its a close packet, we close the ongoing requests\n\t if ('close' === packet.type) {\n\t self.onClose();\n\t return false;\n\t }\n\n\t // otherwise bypass onData and handle the message\n\t self.onPacket(packet);\n\t };\n\n\t // decode payload\n\t parser.decodePayload(data, this.socket.binaryType, callback);\n\n\t // if an event did not trigger closing\n\t if ('closed' !== this.readyState) {\n\t // if we got data we're not polling\n\t this.polling = false;\n\t this.emit('pollComplete');\n\n\t if ('open' === this.readyState) {\n\t this.poll();\n\t } else {\n\t debug('ignoring poll - transport state \"%s\"', this.readyState);\n\t }\n\t }\n\t};\n\n\t/**\n\t * For polling, send a close packet.\n\t *\n\t * @api private\n\t */\n\n\tPolling.prototype.doClose = function () {\n\t var self = this;\n\n\t function close() {\n\t debug('writing close packet');\n\t self.write([{ type: 'close' }]);\n\t }\n\n\t if ('open' === this.readyState) {\n\t debug('transport open - closing');\n\t close();\n\t } else {\n\t // in case we're trying to close while\n\t // handshaking is in progress (GH-164)\n\t debug('transport not open - deferring close');\n\t this.once('open', close);\n\t }\n\t};\n\n\t/**\n\t * Writes a packets payload.\n\t *\n\t * @param {Array} data packets\n\t * @param {Function} drain callback\n\t * @api private\n\t */\n\n\tPolling.prototype.write = function (packets) {\n\t var self = this;\n\t this.writable = false;\n\t var callbackfn = function callbackfn() {\n\t self.writable = true;\n\t self.emit('drain');\n\t };\n\n\t parser.encodePayload(packets, this.supportsBinary, function (data) {\n\t self.doWrite(data, callbackfn);\n\t });\n\t};\n\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\n\tPolling.prototype.uri = function () {\n\t var query = this.query || {};\n\t var schema = this.secure ? 'https' : 'http';\n\t var port = '';\n\n\t // cache busting is forced\n\t if (false !== this.timestampRequests) {\n\t query[this.timestampParam] = yeast();\n\t }\n\n\t if (!this.supportsBinary && !query.sid) {\n\t query.b64 = 1;\n\t }\n\n\t query = parseqs.encode(query);\n\n\t // avoid port if default for schema\n\t if (this.port && ('https' === schema && Number(this.port) !== 443 || 'http' === schema && Number(this.port) !== 80)) {\n\t port = ':' + this.port;\n\t }\n\n\t // prepend ? to query\n\t if (query.length) {\n\t query = '?' + query;\n\t }\n\n\t var ipv6 = this.hostname.indexOf(':') !== -1;\n\t return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\t/**\n\t * Module dependencies.\n\t */\n\n\tvar parser = __webpack_require__(9);\n\tvar Emitter = __webpack_require__(19);\n\n\t/**\n\t * Module exports.\n\t */\n\n\tmodule.exports = Transport;\n\n\t/**\n\t * Transport abstract constructor.\n\t *\n\t * @param {Object} options.\n\t * @api private\n\t */\n\n\tfunction Transport(opts) {\n\t this.path = opts.path;\n\t this.hostname = opts.hostname;\n\t this.port = opts.port;\n\t this.secure = opts.secure;\n\t this.query = opts.query;\n\t this.timestampParam = opts.timestampParam;\n\t this.timestampRequests = opts.timestampRequests;\n\t this.readyState = '';\n\t this.agent = opts.agent || false;\n\t this.socket = opts.socket;\n\t this.enablesXDR = opts.enablesXDR;\n\n\t // SSL options for Node.js client\n\t this.pfx = opts.pfx;\n\t this.key = opts.key;\n\t this.passphrase = opts.passphrase;\n\t this.cert = opts.cert;\n\t this.ca = opts.ca;\n\t this.ciphers = opts.ciphers;\n\t this.rejectUnauthorized = opts.rejectUnauthorized;\n\t this.forceNode = opts.forceNode;\n\n\t // other options for Node.js client\n\t this.extraHeaders = opts.extraHeaders;\n\t this.localAddress = opts.localAddress;\n\t}\n\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\n\tEmitter(Transport.prototype);\n\n\t/**\n\t * Emits an error.\n\t *\n\t * @param {String} str\n\t * @return {Transport} for chaining\n\t * @api public\n\t */\n\n\tTransport.prototype.onError = function (msg, desc) {\n\t var err = new Error(msg);\n\t err.type = 'TransportError';\n\t err.description = desc;\n\t this.emit('error', err);\n\t return this;\n\t};\n\n\t/**\n\t * Opens the transport.\n\t *\n\t * @api public\n\t */\n\n\tTransport.prototype.open = function () {\n\t if ('closed' === this.readyState || '' === this.readyState) {\n\t this.readyState = 'opening';\n\t this.doOpen();\n\t }\n\n\t return this;\n\t};\n\n\t/**\n\t * Closes the transport.\n\t *\n\t * @api private\n\t */\n\n\tTransport.prototype.close = function () {\n\t if ('opening' === this.readyState || 'open' === this.readyState) {\n\t this.doClose();\n\t this.onClose();\n\t }\n\n\t return this;\n\t};\n\n\t/**\n\t * Sends multiple packets.\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\n\tTransport.prototype.send = function (packets) {\n\t if ('open' === this.readyState) {\n\t this.write(packets);\n\t } else {\n\t throw new Error('Transport not open');\n\t }\n\t};\n\n\t/**\n\t * Called upon open\n\t *\n\t * @api private\n\t */\n\n\tTransport.prototype.onOpen = function () {\n\t this.readyState = 'open';\n\t this.writable = true;\n\t this.emit('open');\n\t};\n\n\t/**\n\t * Called with data.\n\t *\n\t * @param {String} data\n\t * @api private\n\t */\n\n\tTransport.prototype.onData = function (data) {\n\t var packet = parser.decodePacket(data, this.socket.binaryType);\n\t this.onPacket(packet);\n\t};\n\n\t/**\n\t * Called with a decoded packet.\n\t */\n\n\tTransport.prototype.onPacket = function (packet) {\n\t this.emit('packet', packet);\n\t};\n\n\t/**\n\t * Called upon close.\n\t *\n\t * @api private\n\t */\n\n\tTransport.prototype.onClose = function () {\n\t this.readyState = 'closed';\n\t this.emit('close');\n\t};\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\n\tvar keys = __webpack_require__(10);\n\tvar hasBinary = __webpack_require__(11);\n\tvar sliceBuffer = __webpack_require__(13);\n\tvar after = __webpack_require__(14);\n\tvar utf8 = __webpack_require__(15);\n\n\tvar base64encoder;\n\tif (global && global.ArrayBuffer) {\n\t base64encoder = __webpack_require__(17);\n\t}\n\n\t/**\n\t * Check if we are running an android browser. That requires us to use\n\t * ArrayBuffer with polling transports...\n\t *\n\t * http://ghinda.net/jpeg-blob-ajax-android/\n\t */\n\n\tvar isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\n\t/**\n\t * Check if we are running in PhantomJS.\n\t * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n\t * https://github.com/ariya/phantomjs/issues/11395\n\t * @type boolean\n\t */\n\tvar isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);\n\n\t/**\n\t * When true, avoids using Blobs to encode payloads.\n\t * @type boolean\n\t */\n\tvar dontSendBlobs = isAndroid || isPhantomJS;\n\n\t/**\n\t * Current protocol version.\n\t */\n\n\texports.protocol = 3;\n\n\t/**\n\t * Packet types.\n\t */\n\n\tvar packets = exports.packets = {\n\t open: 0 // non-ws\n\t , close: 1 // non-ws\n\t , ping: 2\n\t , pong: 3\n\t , message: 4\n\t , upgrade: 5\n\t , noop: 6\n\t};\n\n\tvar packetslist = keys(packets);\n\n\t/**\n\t * Premade error packet.\n\t */\n\n\tvar err = { type: 'error', data: 'parser error' };\n\n\t/**\n\t * Create a blob api even for blob builder when vendor prefixes exist\n\t */\n\n\tvar Blob = __webpack_require__(18);\n\n\t/**\n\t * Encodes a packet.\n\t *\n\t * <packet type id> [ <data> ]\n\t *\n\t * Example:\n\t *\n\t * 5hello world\n\t * 3\n\t * 4\n\t *\n\t * Binary is encoded in an identical principle\n\t *\n\t * @api private\n\t */\n\n\texports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n\t if (typeof supportsBinary === 'function') {\n\t callback = supportsBinary;\n\t supportsBinary = false;\n\t }\n\n\t if (typeof utf8encode === 'function') {\n\t callback = utf8encode;\n\t utf8encode = null;\n\t }\n\n\t var data = (packet.data === undefined)\n\t ? undefined\n\t : packet.data.buffer || packet.data;\n\n\t if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n\t return encodeArrayBuffer(packet, supportsBinary, callback);\n\t } else if (Blob && data instanceof global.Blob) {\n\t return encodeBlob(packet, supportsBinary, callback);\n\t }\n\n\t // might be an object with { base64: true, data: dataAsBase64String }\n\t if (data && data.base64) {\n\t return encodeBase64Object(packet, callback);\n\t }\n\n\t // Sending data as a utf-8 string\n\t var encoded = packets[packet.type];\n\n\t // data fragment is optional\n\t if (undefined !== packet.data) {\n\t encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);\n\t }\n\n\t return callback('' + encoded);\n\n\t};\n\n\tfunction encodeBase64Object(packet, callback) {\n\t // packet data is an object { base64: true, data: dataAsBase64String }\n\t var message = 'b' + exports.packets[packet.type] + packet.data.data;\n\t return callback(message);\n\t}\n\n\t/**\n\t * Encode packet helpers for binary types\n\t */\n\n\tfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}\n\n\tfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var fr = new FileReader();\n\t fr.onload = function() {\n\t packet.data = fr.result;\n\t exports.encodePacket(packet, supportsBinary, true, callback);\n\t };\n\t return fr.readAsArrayBuffer(packet.data);\n\t}\n\n\tfunction encodeBlob(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t if (dontSendBlobs) {\n\t return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n\t }\n\n\t var length = new Uint8Array(1);\n\t length[0] = packets[packet.type];\n\t var blob = new Blob([length.buffer, packet.data]);\n\n\t return callback(blob);\n\t}\n\n\t/**\n\t * Encodes a packet with binary data in a base64 string\n\t *\n\t * @param {Object} packet, has `type` and `data`\n\t * @return {String} base64 encoded message\n\t */\n\n\texports.encodeBase64Packet = function(packet, callback) {\n\t var message = 'b' + exports.packets[packet.type];\n\t if (Blob && packet.data instanceof global.Blob) {\n\t var fr = new FileReader();\n\t fr.onload = function() {\n\t var b64 = fr.result.split(',')[1];\n\t callback(message + b64);\n\t };\n\t return fr.readAsDataURL(packet.data);\n\t }\n\n\t var b64data;\n\t try {\n\t b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n\t } catch (e) {\n\t // iPhone Safari doesn't let you apply with typed arrays\n\t var typed = new Uint8Array(packet.data);\n\t var basic = new Array(typed.length);\n\t for (var i = 0; i < typed.length; i++) {\n\t basic[i] = typed[i];\n\t }\n\t b64data = String.fromCharCode.apply(null, basic);\n\t }\n\t message += global.btoa(b64data);\n\t return callback(message);\n\t};\n\n\t/**\n\t * Decodes a packet. Changes format to Blob if requested.\n\t *\n\t * @return {Object} with `type` and `data` (if any)\n\t * @api private\n\t */\n\n\texports.decodePacket = function (data, binaryType, utf8decode) {\n\t if (data === undefined) {\n\t return err;\n\t }\n\t // String data\n\t if (typeof data === 'string') {\n\t if (data.charAt(0) === 'b') {\n\t return exports.decodeBase64Packet(data.substr(1), binaryType);\n\t }\n\n\t if (utf8decode) {\n\t data = tryDecode(data);\n\t if (data === false) {\n\t return err;\n\t }\n\t }\n\t var type = data.charAt(0);\n\n\t if (Number(type) != type || !packetslist[type]) {\n\t return err;\n\t }\n\n\t if (data.length > 1) {\n\t return { type: packetslist[type], data: data.substring(1) };\n\t } else {\n\t return { type: packetslist[type] };\n\t }\n\t }\n\n\t var asArray = new Uint8Array(data);\n\t var type = asArray[0];\n\t var rest = sliceBuffer(data, 1);\n\t if (Blob && binaryType === 'blob') {\n\t rest = new Blob([rest]);\n\t }\n\t return { type: packetslist[type], data: rest };\n\t};\n\n\tfunction tryDecode(data) {\n\t try {\n\t data = utf8.decode(data, { strict: false });\n\t } catch (e) {\n\t return false;\n\t }\n\t return data;\n\t}\n\n\t/**\n\t * Decodes a packet encoded in a base64 string\n\t *\n\t * @param {String} base64 encoded message\n\t * @return {Object} with `type` and `data` (if any)\n\t */\n\n\texports.decodeBase64Packet = function(msg, binaryType) {\n\t var type = packetslist[msg.charAt(0)];\n\t if (!base64encoder) {\n\t return { type: type, data: { base64: true, data: msg.substr(1) } };\n\t }\n\n\t var data = base64encoder.decode(msg.substr(1));\n\n\t if (binaryType === 'blob' && Blob) {\n\t data = new Blob([data]);\n\t }\n\n\t return { type: type, data: data };\n\t};\n\n\t/**\n\t * Encodes multiple messages (payload).\n\t *\n\t * <length>:data\n\t *\n\t * Example:\n\t *\n\t * 11:hello world2:hi\n\t *\n\t * If any contents are binary, they will be encoded as base64 strings. Base64\n\t * encoded strings are marked with a b before the length specifier\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\n\texports.encodePayload = function (packets, supportsBinary, callback) {\n\t if (typeof supportsBinary === 'function') {\n\t callback = supportsBinary;\n\t supportsBinary = null;\n\t }\n\n\t var isBinary = hasBinary(packets);\n\n\t if (supportsBinary && isBinary) {\n\t if (Blob && !dontSendBlobs) {\n\t return exports.encodePayloadAsBlob(packets, callback);\n\t }\n\n\t return exports.encodePayloadAsArrayBuffer(packets, callback);\n\t }\n\n\t if (!packets.length) {\n\t return callback('0:');\n\t }\n\n\t function setLengthHeader(message) {\n\t return message.length + ':' + message;\n\t }\n\n\t function encodeOne(packet, doneCallback) {\n\t exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {\n\t doneCallback(null, setLengthHeader(message));\n\t });\n\t }\n\n\t map(packets, encodeOne, function(err, results) {\n\t return callback(results.join(''));\n\t });\n\t};\n\n\t/**\n\t * Async array map using after\n\t */\n\n\tfunction map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}\n\n\t/*\n\t * Decodes data when a payload is maybe expected. Possible binary contents are\n\t * decoded from their base64 representation\n\t *\n\t * @param {String} data, callback method\n\t * @api public\n\t */\n\n\texports.decodePayload = function (data, binaryType, callback) {\n\t if (typeof data !== 'string') {\n\t return exports.decodePayloadAsBinary(data, binaryType, callback);\n\t }\n\n\t if (typeof binaryType === 'function') {\n\t callback = binaryType;\n\t binaryType = null;\n\t }\n\n\t var packet;\n\t if (data === '') {\n\t // parser error - ignoring payload\n\t return callback(err, 0, 1);\n\t }\n\n\t var length = '', n, msg;\n\n\t for (var i = 0, l = data.length; i < l; i++) {\n\t var chr = data.charAt(i);\n\n\t if (chr !== ':') {\n\t length += chr;\n\t continue;\n\t }\n\n\t if (length === '' || (length != (n = Number(length)))) {\n\t // parser error - ignoring payload\n\t return callback(err, 0, 1);\n\t }\n\n\t msg = data.substr(i + 1, n);\n\n\t if (length != msg.length) {\n\t // parser error - ignoring payload\n\t return callback(err, 0, 1);\n\t }\n\n\t if (msg.length) {\n\t packet = exports.decodePacket(msg, binaryType, false);\n\n\t if (err.type === packet.type && err.data === packet.data) {\n\t // parser error in individual packet - ignoring payload\n\t return callback(err, 0, 1);\n\t }\n\n\t var ret = callback(packet, i + n, l);\n\t if (false === ret) return;\n\t }\n\n\t // advance cursor\n\t i += n;\n\t length = '';\n\t }\n\n\t if (length !== '') {\n\t // parser error - ignoring payload\n\t return callback(err, 0, 1);\n\t }\n\n\t};\n\n\t/**\n\t * Encodes multiple messages (payload) as binary.\n\t *\n\t * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n\t * 255><data>\n\t *\n\t * Example:\n\t * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n\t *\n\t * @param {Array} packets\n\t * @return {ArrayBuffer} encoded payload\n\t * @api private\n\t */\n\n\texports.encodePayloadAsArrayBuffer = function(packets, callback) {\n\t if (!packets.length) {\n\t return callback(new ArrayBuffer(0));\n\t }\n\n\t function encodeOne(packet, doneCallback) {\n\t exports.encodePacket(packet, true, true, function(data) {\n\t return doneCallback(null, data);\n\t });\n\t }\n\n\t map(packets, encodeOne, function(err, encodedPackets) {\n\t var totalLength = encodedPackets.reduce(function(acc, p) {\n\t var len;\n\t if (typeof p === 'string'){\n\t len = p.length;\n\t } else {\n\t len = p.byteLength;\n\t }\n\t return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n\t }, 0);\n\n\t var resultArray = new Uint8Array(totalLength);\n\n\t var bufferIndex = 0;\n\t encodedPackets.forEach(function(p) {\n\t var isString = typeof p === 'string';\n\t var ab = p;\n\t if (isString) {\n\t var view = new Uint8Array(p.length);\n\t for (var i = 0; i < p.length; i++) {\n\t view[i] = p.charCodeAt(i);\n\t }\n\t ab = view.buffer;\n\t }\n\n\t if (isString) { // not true binary\n\t resultArray[bufferIndex++] = 0;\n\t } else { // true binary\n\t resultArray[bufferIndex++] = 1;\n\t }\n\n\t var lenStr = ab.byteLength.toString();\n\t for (var i = 0; i < lenStr.length; i++) {\n\t resultArray[bufferIndex++] = parseInt(lenStr[i]);\n\t }\n\t resultArray[bufferIndex++] = 255;\n\n\t var view = new Uint8Array(ab);\n\t for (var i = 0; i < view.length; i++) {\n\t resultArray[bufferIndex++] = view[i];\n\t }\n\t });\n\n\t return callback(resultArray.buffer);\n\t });\n\t};\n\n\t/**\n\t * Encode as Blob\n\t */\n\n\texports.encodePayloadAsBlob = function(packets, callback) {\n\t function encodeOne(packet, doneCallback) {\n\t exports.encodePacket(packet, true, true, function(encoded) {\n\t var binaryIdentifier = new Uint8Array(1);\n\t binaryIdentifier[0] = 1;\n\t if (typeof encoded === 'string') {\n\t var view = new Uint8Array(encoded.length);\n\t for (var i = 0; i < encoded.length; i++) {\n\t view[i] = encoded.charCodeAt(i);\n\t }\n\t encoded = view.buffer;\n\t binaryIdentifier[0] = 0;\n\t }\n\n\t var len = (encoded instanceof ArrayBuffer)\n\t ? encoded.byteLength\n\t : encoded.size;\n\n\t var lenStr = len.toString();\n\t var lengthAry = new Uint8Array(lenStr.length + 1);\n\t for (var i = 0; i < lenStr.length; i++) {\n\t lengthAry[i] = parseInt(lenStr[i]);\n\t }\n\t lengthAry[lenStr.length] = 255;\n\n\t if (Blob) {\n\t var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n\t doneCallback(null, blob);\n\t }\n\t });\n\t }\n\n\t map(packets, encodeOne, function(err, results) {\n\t return callback(new Blob(results));\n\t });\n\t};\n\n\t/*\n\t * Decodes data when a payload is maybe expected. Strings are decoded by\n\t * interpreting each byte as a key code for entries marked to start with 0. See\n\t * description of encodePayloadAsBinary\n\t *\n\t * @param {ArrayBuffer} data, callback method\n\t * @api public\n\t */\n\n\texports.decodePayloadAsBinary = function (data, binaryType, callback) {\n\t if (typeof binaryType === 'function') {\n\t callback = binaryType;\n\t binaryType = null;\n\t }\n\n\t var bufferTail = data;\n\t var buffers = [];\n\n\t while (bufferTail.byteLength > 0) {\n\t var tailArray = new Uint8Array(bufferTail);\n\t var isString = tailArray[0] === 0;\n\t var msgLength = '';\n\n\t for (var i = 1; ; i++) {\n\t if (tailArray[i] === 255) break;\n\n\t // 310 = char length of Number.MAX_VALUE\n\t if (msgLength.length > 310) {\n\t return callback(err, 0, 1);\n\t }\n\n\t msgLength += tailArray[i];\n\t }\n\n\t bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n\t msgLength = parseInt(msgLength);\n\n\t var msg = sliceBuffer(bufferTail, 0, msgLength);\n\t if (isString) {\n\t try {\n\t msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n\t } catch (e) {\n\t // iPhone Safari doesn't let you apply to typed arrays\n\t var typed = new Uint8Array(msg);\n\t msg = '';\n\t for (var i = 0; i < typed.length; i++) {\n\t msg += String.fromCharCode(typed[i]);\n\t }\n\t }\n\t }\n\n\t buffers.push(msg);\n\t bufferTail = sliceBuffer(bufferTail, msgLength);\n\t }\n\n\t var total = buffers.length;\n\t buffers.forEach(function(buffer, i) {\n\t callback(exports.decodePacket(buffer, binaryType, true), i, total);\n\t });\n\t};\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Gets the keys for an object.\n\t *\n\t * @return {Array} keys\n\t * @api private\n\t */\n\n\tmodule.exports = Object.keys || function keys (obj){\n\t var arr = [];\n\t var has = Object.prototype.hasOwnProperty;\n\n\t for (var i in obj) {\n\t if (has.call(obj, i)) {\n\t arr.push(i);\n\t }\n\t }\n\t return arr;\n\t};\n\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/* global Blob File */\n\n\t/*\n\t * Module requirements.\n\t */\n\n\tvar isArray = __webpack_require__(12);\n\n\tvar toString = Object.prototype.toString;\n\tvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\n\tvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\n\t/**\n\t * Module exports.\n\t */\n\n\tmodule.exports = hasBinary;\n\n\t/**\n\t * Checks for binary data.\n\t *\n\t * Supports Buffer, ArrayBuffer, Blob and File.\n\t *\n\t * @param {Object} anything\n\t * @api public\n\t */\n\n\tfunction hasBinary (obj) {\n\t if (!obj || typeof obj !== 'object') {\n\t return false;\n\t }\n\n\t if (isArray(obj)) {\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t if (hasBinary(obj[i])) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\n\t if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n\t (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||\n\t (withNativeBlob && obj instanceof Blob) ||\n\t (withNativeFile && obj instanceof File)\n\t ) {\n\t return true;\n\t }\n\n\t // see: https://github.com/Automattic/has-binary/pull/4\n\t if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n\t return hasBinary(obj.toJSON(), true);\n\t }\n\n\t for (var key in obj) {\n\t if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n\t return true;\n\t }\n\t }\n\n\t return false;\n\t}\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\tvar toString = {}.toString;\n\n\tmodule.exports = Array.isArray || function (arr) {\n\t return toString.call(arr) == '[object Array]';\n\t};\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t/**\n\t * An abstraction for slicing an arraybuffer even when\n\t * ArrayBuffer.prototype.slice is not supported\n\t *\n\t * @api public\n\t */\n\n\tmodule.exports = function(arraybuffer, start, end) {\n\t var bytes = arraybuffer.byteLength;\n\t start = start || 0;\n\t end = end || bytes;\n\n\t if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\n\t if (start < 0) { start += bytes; }\n\t if (end < 0) { end += bytes; }\n\t if (end > bytes) { end = bytes; }\n\n\t if (start >= bytes || start >= end || bytes === 0) {\n\t return new ArrayBuffer(0);\n\t }\n\n\t var abv = new Uint8Array(arraybuffer);\n\t var result = new Uint8Array(end - start);\n\t for (var i = start, ii = 0; i < end; i++, ii++) {\n\t result[ii] = abv[i];\n\t }\n\t return result.buffer;\n\t};\n\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\tmodule.exports = after\n\n\tfunction after(count, callback, err_cb) {\n\t var bail = false\n\t err_cb = err_cb || noop\n\t proxy.count = count\n\n\t return (count === 0) ? callback() : proxy\n\n\t function proxy(err, result) {\n\t if (proxy.count <= 0) {\n\t throw new Error('after called too many times')\n\t }\n\t --proxy.count\n\n\t // after first error, rest are passed to err_cb\n\t if (err) {\n\t bail = true\n\t callback(err)\n\t // future error callbacks will go to error handler\n\t callback = err_cb\n\t } else if (proxy.count === 0 && !bail) {\n\t callback(null, result)\n\t }\n\t }\n\t}\n\n\tfunction noop() {}\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/utf8js v2.1.2 by @mathias */\n\t;(function(root) {\n\n\t\t// Detect free variables `exports`\n\t\tvar freeExports = typeof exports == 'object' && exports;\n\n\t\t// Detect free variable `module`\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\tmodule.exports == freeExports && module;\n\n\t\t// Detect free variable `global`, from Node.js or Browserified code,\n\t\t// and use it as `root`\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\t\troot = freeGlobal;\n\t\t}\n\n\t\t/*--------------------------------------------------------------------------*/\n\n\t\tvar stringFromCharCode = String.fromCharCode;\n\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [];\n\t\t\tvar counter = 0;\n\t\t\tvar length = string.length;\n\t\t\tvar value;\n\t\t\tvar extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2encode(array) {\n\t\t\tvar length = array.length;\n\t\t\tvar index = -1;\n\t\t\tvar value;\n\t\t\tvar output = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tvalue = array[index];\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\n\t\tfunction checkScalarValue(codePoint, strict) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\t\tif (strict) {\n\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t\t\t' is not a scalar value'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t/*--------------------------------------------------------------------------*/\n\n\t\tfunction createByte(codePoint, shift) {\n\t\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t\t}\n\n\t\tfunction encodeCodePoint(codePoint, strict) {\n\t\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\t\treturn stringFromCharCode(codePoint);\n\t\t\t}\n\t\t\tvar symbol = '';\n\t\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\t\tif (!checkScalarValue(codePoint, strict)) {\n\t\t\t\t\tcodePoint = 0xFFFD;\n\t\t\t\t}\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\t\treturn symbol;\n\t\t}\n\n\t\tfunction utf8encode(string, opts) {\n\t\t\topts = opts || {};\n\t\t\tvar strict = false !== opts.strict;\n\n\t\t\tvar codePoints = ucs2decode(string);\n\t\t\tvar length = codePoints.length;\n\t\t\tvar index = -1;\n\t\t\tvar codePoint;\n\t\t\tvar byteString = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tcodePoint = codePoints[index];\n\t\t\t\tbyteString += encodeCodePoint(codePoint, strict);\n\t\t\t}\n\t\t\treturn byteString;\n\t\t}\n\n\t\t/*--------------------------------------------------------------------------*/\n\n\t\tfunction readContinuationByte() {\n\t\t\tif (byteIndex >= byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\n\t\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\n\t\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\t\treturn continuationByte & 0x3F;\n\t\t\t}\n\n\t\t\t// If we end up here, it’s not a continuation byte\n\t\t\tthrow Error('Invalid continuation byte');\n\t\t}\n\n\t\tfunction decodeSymbol(strict) {\n\t\t\tvar byte1;\n\t\t\tvar byte2;\n\t\t\tvar byte3;\n\t\t\tvar byte4;\n\t\t\tvar codePoint;\n\n\t\t\tif (byteIndex > byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\n\t\t\tif (byteIndex == byteCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Read first byte\n\t\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\n\t\t\t// 1-byte sequence (no continuation bytes)\n\t\t\tif ((byte1 & 0x80) == 0) {\n\t\t\t\treturn byte1;\n\t\t\t}\n\n\t\t\t// 2-byte sequence\n\t\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\t\tif (codePoint >= 0x80) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\t\treturn checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 4-byte sequence\n\t\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tbyte4 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow Error('Invalid UTF-8 detected');\n\t\t}\n\n\t\tvar byteArray;\n\t\tvar byteCount;\n\t\tvar byteIndex;\n\t\tfunction utf8decode(byteString, opts) {\n\t\t\topts = opts || {};\n\t\t\tvar strict = false !== opts.strict;\n\n\t\t\tbyteArray = ucs2decode(byteString);\n\t\t\tbyteCount = byteArray.length;\n\t\t\tbyteIndex = 0;\n\t\t\tvar codePoints = [];\n\t\t\tvar tmp;\n\t\t\twhile ((tmp = decodeSymbol(strict)) !== false) {\n\t\t\t\tcodePoints.push(tmp);\n\t\t\t}\n\t\t\treturn ucs2encode(codePoints);\n\t\t}\n\n\t\t/*--------------------------------------------------------------------------*/\n\n\t\tvar utf8 = {\n\t\t\t'version': '2.1.2',\n\t\t\t'encode': utf8encode,\n\t\t\t'decode': utf8decode\n\t\t};\n\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn utf8;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = utf8;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tvar object = {};\n\t\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\t\tfor (var key in utf8) {\n\t\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.utf8 = utf8;\n\t\t}\n\n\t}(this));\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module), (function() { return this; }())))\n\n/***/ },\n/* 16 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports) {\n\n\t/*\n\t * base64-arraybuffer\n\t * https://github.com/niklasvh/base64-arraybuffer\n\t *\n\t * Copyright (c) 2012 Niklas von Hertzen\n\t * Licensed under the MIT license.\n\t */\n\t(function(){\n\t \"use strict\";\n\n\t var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n\t // Use a lookup table to find the index.\n\t var lookup = new Uint8Array(256);\n\t for (var i = 0; i < chars.length; i++) {\n\t lookup[chars.charCodeAt(i)] = i;\n\t }\n\n\t exports.encode = function(arraybuffer) {\n\t var bytes = new Uint8Array(arraybuffer),\n\t i, len = bytes.length, base64 = \"\";\n\n\t for (i = 0; i < len; i+=3) {\n\t base64 += chars[bytes[i] >> 2];\n\t base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n\t base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n\t base64 += chars[bytes[i + 2] & 63];\n\t }\n\n\t if ((len % 3) === 2) {\n\t base64 = base64.substring(0, base64.length - 1) + \"=\";\n\t } else if (len % 3 === 1) {\n\t base64 = base64.substring(0, base64.length - 2) + \"==\";\n\t }\n\n\t return base64;\n\t };\n\n\t exports.decode = function(base64) {\n\t var bufferLength = base64.length * 0.75,\n\t len = base64.length, i, p = 0,\n\t encoded1, encoded2, encoded3, encoded4;\n\n\t if (base64[base64.length - 1] === \"=\") {\n\t bufferLength--;\n\t if (base64[base64.length - 2] === \"=\") {\n\t bufferLength--;\n\t }\n\t }\n\n\t var arraybuffer = new ArrayBuffer(bufferLength),\n\t bytes = new Uint8Array(arraybuffer);\n\n\t for (i = 0; i < len; i+=4) {\n\t encoded1 = lookup[base64.charCodeAt(i)];\n\t encoded2 = lookup[base64.charCodeAt(i+1)];\n\t encoded3 = lookup[base64.charCodeAt(i+2)];\n\t encoded4 = lookup[base64.charCodeAt(i+3)];\n\n\t bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n\t bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n\t bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n\t }\n\n\t return arraybuffer;\n\t };\n\t})();\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Create a blob builder even when vendor prefixes exist\n\t */\n\n\tvar BlobBuilder = global.BlobBuilder\n\t || global.WebKitBlobBuilder\n\t || global.MSBlobBuilder\n\t || global.MozBlobBuilder;\n\n\t/**\n\t * Check if Blob constructor is supported\n\t */\n\n\tvar blobSupported = (function() {\n\t try {\n\t var a = new Blob(['hi']);\n\t return a.size === 2;\n\t } catch(e) {\n\t return false;\n\t }\n\t})();\n\n\t/**\n\t * Check if Blob constructor supports ArrayBufferViews\n\t * Fails in Safari 6, so we need to map to ArrayBuffers there.\n\t */\n\n\tvar blobSupportsArrayBufferView = blobSupported && (function() {\n\t try {\n\t var b = new Blob([new Uint8Array([1,2])]);\n\t return b.size === 2;\n\t } catch(e) {\n\t return false;\n\t }\n\t})();\n\n\t/**\n\t * Check if BlobBuilder is supported\n\t */\n\n\tvar blobBuilderSupported = BlobBuilder\n\t && BlobBuilder.prototype.append\n\t && BlobBuilder.prototype.getBlob;\n\n\t/**\n\t * Helper function that maps ArrayBufferViews to ArrayBuffers\n\t * Used by BlobBuilder constructor and old browsers that didn't\n\t * support it in the Blob constructor.\n\t */\n\n\tfunction mapArrayBufferViews(ary) {\n\t for (var i = 0; i < ary.length; i++) {\n\t var chunk = ary[i];\n\t if (chunk.buffer instanceof ArrayBuffer) {\n\t var buf = chunk.buffer;\n\n\t // if this is a subarray, make a copy so we only\n\t // include the subarray region from the underlying buffer\n\t if (chunk.byteLength !== buf.byteLength) {\n\t var copy = new Uint8Array(chunk.byteLength);\n\t copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n\t buf = copy.buffer;\n\t }\n\n\t ary[i] = buf;\n\t }\n\t }\n\t}\n\n\tfunction BlobBuilderConstructor(ary, options) {\n\t options = options || {};\n\n\t var bb = new BlobBuilder();\n\t mapArrayBufferViews(ary);\n\n\t for (var i = 0; i < ary.length; i++) {\n\t bb.append(ary[i]);\n\t }\n\n\t return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n\t};\n\n\tfunction BlobConstructor(ary, options) {\n\t mapArrayBufferViews(ary);\n\t return new Blob(ary, options || {});\n\t};\n\n\tmodule.exports = (function() {\n\t if (blobSupported) {\n\t return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n\t } else if (blobBuilderSupported) {\n\t return BlobBuilderConstructor;\n\t } else {\n\t return undefined;\n\t }\n\t})();\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\r\n\t/**\r\n\t * Expose `Emitter`.\r\n\t */\r\n\r\n\tif (true) {\r\n\t module.exports = Emitter;\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize a new `Emitter`.\r\n\t *\r\n\t * @api public\r\n\t */\r\n\r\n\tfunction Emitter(obj) {\r\n\t if (obj) return mixin(obj);\r\n\t};\r\n\r\n\t/**\r\n\t * Mixin the emitter properties.\r\n\t *\r\n\t * @param {Object} obj\r\n\t * @return {Object}\r\n\t * @api private\r\n\t */\r\n\r\n\tfunction mixin(obj) {\r\n\t for (var key in Emitter.prototype) {\r\n\t obj[key] = Emitter.prototype[key];\r\n\t }\r\n\t return obj;\r\n\t}\r\n\r\n\t/**\r\n\t * Listen on the given `event` with `fn`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\r\n\tEmitter.prototype.on =\r\n\tEmitter.prototype.addEventListener = function(event, fn){\r\n\t this._callbacks = this._callbacks || {};\r\n\t (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n\t .push(fn);\r\n\t return this;\r\n\t};\r\n\r\n\t/**\r\n\t * Adds an `event` listener that will be invoked a single\r\n\t * time then automatically removed.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\r\n\tEmitter.prototype.once = function(event, fn){\r\n\t function on() {\r\n\t this.off(event, on);\r\n\t fn.apply(this, arguments);\r\n\t }\r\n\r\n\t on.fn = fn;\r\n\t this.on(event, on);\r\n\t return this;\r\n\t};\r\n\r\n\t/**\r\n\t * Remove the given callback for `event` or all\r\n\t * registered callbacks.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\r\n\tEmitter.prototype.off =\r\n\tEmitter.prototype.removeListener =\r\n\tEmitter.prototype.removeAllListeners =\r\n\tEmitter.prototype.removeEventListener = function(event, fn){\r\n\t this._callbacks = this._callbacks || {};\r\n\r\n\t // all\r\n\t if (0 == arguments.length) {\r\n\t this._callbacks = {};\r\n\t return this;\r\n\t }\r\n\r\n\t // specific event\r\n\t var callbacks = this._callbacks['$' + event];\r\n\t if (!callbacks) return this;\r\n\r\n\t // remove all handlers\r\n\t if (1 == arguments.length) {\r\n\t delete this._callbacks['$' + event];\r\n\t return this;\r\n\t }\r\n\r\n\t // remove specific handler\r\n\t var cb;\r\n\t for (var i = 0; i < callbacks.length; i++) {\r\n\t cb = callbacks[i];\r\n\t if (cb === fn || cb.fn === fn) {\r\n\t callbacks.splice(i, 1);\r\n\t break;\r\n\t }\r\n\t }\r\n\t return this;\r\n\t};\r\n\r\n\t/**\r\n\t * Emit `event` with the given args.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Mixed} ...\r\n\t * @return {Emitter}\r\n\t */\r\n\r\n\tEmitter.prototype.emit = function(event){\r\n\t this._callbacks = this._callbacks || {};\r\n\t var args = [].slice.call(arguments, 1)\r\n\t , callbacks = this._callbacks['$' + event];\r\n\r\n\t if (callbacks) {\r\n\t callbacks = callbacks.slice(0);\r\n\t for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n\t callbacks[i].apply(this, args);\r\n\t }\r\n\t }\r\n\r\n\t return this;\r\n\t};\r\n\r\n\t/**\r\n\t * Return array of callbacks for `event`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Array}\r\n\t * @api public\r\n\t */\r\n\r\n\tEmitter.prototype.listeners = function(event){\r\n\t this._callbacks = this._callbacks || {};\r\n\t return this._callbacks['$' + event] || [];\r\n\t};\r\n\r\n\t/**\r\n\t * Check if this emitter has `event` handlers.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Boolean}\r\n\t * @api public\r\n\t */\r\n\r\n\tEmitter.prototype.hasListeners = function(event){\r\n\t return !! this.listeners(event).length;\r\n\t};\r\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports) {\n\n\t/**\r\n\t * Compiles a querystring\r\n\t * Returns string representation of the object\r\n\t *\r\n\t * @param {Object}\r\n\t * @api private\r\n\t */\r\n\r\n\texports.encode = function (obj) {\r\n\t var str = '';\r\n\r\n\t for (var i in obj) {\r\n\t if (obj.hasOwnProperty(i)) {\r\n\t if (str.length) str += '&';\r\n\t str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r\n\t }\r\n\t }\r\n\r\n\t return str;\r\n\t};\r\n\r\n\t/**\r\n\t * Parses a simple querystring into an object\r\n\t *\r\n\t * @param {String} qs\r\n\t * @api private\r\n\t */\r\n\r\n\texports.decode = function(qs){\r\n\t var qry = {};\r\n\t var pairs = qs.split('&');\r\n\t for (var i = 0, l = pairs.length; i < l; i++) {\r\n\t var pair = pairs[i].split('=');\r\n\t qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r\n\t }\r\n\t return qry;\r\n\t};\r\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t\n\tmodule.exports = function(a, b){\n\t var fn = function(){};\n\t fn.prototype = b.prototype;\n\t a.prototype = new fn;\n\t a.prototype.constructor = a;\n\t};\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\tvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n\t , length = 64\n\t , map = {}\n\t , seed = 0\n\t , i = 0\n\t , prev;\n\n\t/**\n\t * Return a string representing the specified number.\n\t *\n\t * @param {Number} num The number to convert.\n\t * @returns {String} The string representation of the number.\n\t * @api public\n\t */\n\tfunction encode(num) {\n\t var encoded = '';\n\n\t do {\n\t encoded = alphabet[num % length] + encoded;\n\t num = Math.floor(num / length);\n\t } while (num > 0);\n\n\t return encoded;\n\t}\n\n\t/**\n\t * Return the integer value specified by the given string.\n\t *\n\t * @param {String} str The string to convert.\n\t * @returns {Number} The integer value represented by the string.\n\t * @api public\n\t */\n\tfunction decode(str) {\n\t var decoded = 0;\n\n\t for (i = 0; i < str.length; i++) {\n\t decoded = decoded * length + map[str.charAt(i)];\n\t }\n\n\t return decoded;\n\t}\n\n\t/**\n\t * Yeast: A tiny growing id generator.\n\t *\n\t * @returns {String} A unique id.\n\t * @api public\n\t */\n\tfunction yeast() {\n\t var now = encode(+new Date());\n\n\t if (now !== prev) return seed = 0, prev = now;\n\t return now +'.'+ encode(seed++);\n\t}\n\n\t//\n\t// Map each character to its index.\n\t//\n\tfor (; i < length; i++) map[alphabet[i]] = i;\n\n\t//\n\t// Expose the `yeast`, `encode` and `decode` functions.\n\t//\n\tyeast.encode = encode;\n\tyeast.decode = decode;\n\tmodule.exports = yeast;\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * This is the web browser implementation of `debug()`.\n\t *\n\t * Expose `debug()` as the module.\n\t */\n\n\texports = module.exports = __webpack_require__(25);\n\texports.log = log;\n\texports.formatArgs = formatArgs;\n\texports.save = save;\n\texports.load = load;\n\texports.useColors = useColors;\n\texports.storage = 'undefined' != typeof chrome\n\t && 'undefined' != typeof chrome.storage\n\t ? chrome.storage.local\n\t : localstorage();\n\n\t/**\n\t * Colors.\n\t */\n\n\texports.colors = [\n\t 'lightseagreen',\n\t 'forestgreen',\n\t 'goldenrod',\n\t 'dodgerblue',\n\t 'darkorchid',\n\t 'crimson'\n\t];\n\n\t/**\n\t * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n\t * and the Firebug extension (any Firefox version) are known\n\t * to support \"%c\" CSS customizations.\n\t *\n\t * TODO: add a `localStorage` variable to explicitly enable/disable colors\n\t */\n\n\tfunction useColors() {\n\t // NB: In an Electron preload script, document will be defined but not fully\n\t // initialized. Since we know we're in Chrome, we'll just detect this case\n\t // explicitly\n\t if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n\t return true;\n\t }\n\n\t // is webkit? http://stackoverflow.com/a/16459606/376773\n\t // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t // is firebug? http://stackoverflow.com/a/398120/376773\n\t (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t // is firefox >= v31?\n\t // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t // double check webkit in userAgent just in case we are in a worker\n\t (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n\t}\n\n\t/**\n\t * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n\t */\n\n\texports.formatters.j = function(v) {\n\t try {\n\t return JSON.stringify(v);\n\t } catch (err) {\n\t return '[UnexpectedJSONParseError]: ' + err.message;\n\t }\n\t};\n\n\n\t/**\n\t * Colorize log arguments if enabled.\n\t *\n\t * @api public\n\t */\n\n\tfunction formatArgs(args) {\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return;\n\n\t var c = 'color: ' + this.color;\n\t args.splice(1, 0, c, 'color: inherit')\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-zA-Z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t}\n\n\t/**\n\t * Invokes `console.log()` when available.\n\t * No-op when `console.log` is not a \"function\".\n\t *\n\t * @api public\n\t */\n\n\tfunction log() {\n\t // this hackery is required for IE8/9, where\n\t // the `console.log` function doesn't have 'apply'\n\t return 'object' === typeof console\n\t && console.log\n\t && Function.prototype.apply.call(console.log, console, arguments);\n\t}\n\n\t/**\n\t * Save `namespaces`.\n\t *\n\t * @param {String} namespaces\n\t * @api private\n\t */\n\n\tfunction save(namespaces) {\n\t try {\n\t if (null == namespaces) {\n\t exports.storage.removeItem('debug');\n\t } else {\n\t exports.storage.debug = namespaces;\n\t }\n\t } catch(e) {}\n\t}\n\n\t/**\n\t * Load `namespaces`.\n\t *\n\t * @return {String} returns the previously persisted debug modes\n\t * @api private\n\t */\n\n\tfunction load() {\n\t var r;\n\t try {\n\t r = exports.storage.debug;\n\t } catch(e) {}\n\n\t // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\t if (!r && typeof process !== 'undefined' && 'env' in process) {\n\t r = process.env.DEBUG;\n\t }\n\n\t return r;\n\t}\n\n\t/**\n\t * Enable namespaces listed in `localStorage.debug` initially.\n\t */\n\n\texports.enable(load());\n\n\t/**\n\t * Localstorage attempts to return the localstorage.\n\t *\n\t * This is necessary because safari throws\n\t * when a user disables cookies/localstorage\n\t * and you attempt to access it.\n\t *\n\t * @return {LocalStorage}\n\t * @api private\n\t */\n\n\tfunction localstorage() {\n\t try {\n\t return window.localStorage;\n\t } catch (e) {}\n\t}\n\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(24)))\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things. But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals. It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\n\tfunction defaultSetTimout() {\n\t throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t try {\n\t if (typeof setTimeout === 'function') {\n\t cachedSetTimeout = setTimeout;\n\t } else {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t } catch (e) {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t try {\n\t if (typeof clearTimeout === 'function') {\n\t cachedClearTimeout = clearTimeout;\n\t } else {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t } catch (e) {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t} ())\n\tfunction runTimeout(fun) {\n\t if (cachedSetTimeout === setTimeout) {\n\t //normal enviroments in sane situations\n\t return setTimeout(fun, 0);\n\t }\n\t // if setTimeout wasn't available but was latter defined\n\t if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t cachedSetTimeout = setTimeout;\n\t return setTimeout(fun, 0);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedSetTimeout(fun, 0);\n\t } catch(e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedSetTimeout.call(null, fun, 0);\n\t } catch(e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t return cachedSetTimeout.call(this, fun, 0);\n\t }\n\t }\n\n\n\t}\n\tfunction runClearTimeout(marker) {\n\t if (cachedClearTimeout === clearTimeout) {\n\t //normal enviroments in sane situations\n\t return clearTimeout(marker);\n\t }\n\t // if clearTimeout wasn't available but was latter defined\n\t if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t cachedClearTimeout = clearTimeout;\n\t return clearTimeout(marker);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedClearTimeout(marker);\n\t } catch (e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedClearTimeout.call(null, marker);\n\t } catch (e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t return cachedClearTimeout.call(this, marker);\n\t }\n\t }\n\n\n\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\n\tfunction cleanUpNextTick() {\n\t if (!draining || !currentQueue) {\n\t return;\n\t }\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = runTimeout(cleanUpNextTick);\n\t draining = true;\n\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t runClearTimeout(timeout);\n\t}\n\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t runTimeout(drainQueue);\n\t }\n\t};\n\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\n\tfunction noop() {}\n\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\tprocess.prependListener = noop;\n\tprocess.prependOnceListener = noop;\n\n\tprocess.listeners = function (name) { return [] }\n\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * This is the common logic for both the Node.js and web browser\n\t * implementations of `debug()`.\n\t *\n\t * Expose `debug()` as the module.\n\t */\n\n\texports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\n\texports.coerce = coerce;\n\texports.disable = disable;\n\texports.enable = enable;\n\texports.enabled = enabled;\n\texports.humanize = __webpack_require__(26);\n\n\t/**\n\t * The currently active debug mode names, and names to skip.\n\t */\n\n\texports.names = [];\n\texports.skips = [];\n\n\t/**\n\t * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t *\n\t * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t */\n\n\texports.formatters = {};\n\n\t/**\n\t * Previous log timestamp.\n\t */\n\n\tvar prevTime;\n\n\t/**\n\t * Select a color.\n\t * @param {String} namespace\n\t * @return {Number}\n\t * @api private\n\t */\n\n\tfunction selectColor(namespace) {\n\t var hash = 0, i;\n\n\t for (i in namespace) {\n\t hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t hash |= 0; // Convert to 32bit integer\n\t }\n\n\t return exports.colors[Math.abs(hash) % exports.colors.length];\n\t}\n\n\t/**\n\t * Create a debugger with the given `namespace`.\n\t *\n\t * @param {String} namespace\n\t * @return {Function}\n\t * @api public\n\t */\n\n\tfunction createDebug(namespace) {\n\n\t function debug() {\n\t // disabled?\n\t if (!debug.enabled) return;\n\n\t var self = debug;\n\n\t // set `diff` timestamp\n\t var curr = +new Date();\n\t var ms = curr - (prevTime || curr);\n\t self.diff = ms;\n\t self.prev = prevTime;\n\t self.curr = curr;\n\t prevTime = curr;\n\n\t // turn the `arguments` into a proper Array\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\n\t args[0] = exports.coerce(args[0]);\n\n\t if ('string' !== typeof args[0]) {\n\t // anything else let's inspect with %O\n\t args.unshift('%O');\n\t }\n\n\t // apply any `formatters` transformations\n\t var index = 0;\n\t args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n\t // if we encounter an escaped % then don't increase the array index\n\t if (match === '%%') return match;\n\t index++;\n\t var formatter = exports.formatters[format];\n\t if ('function' === typeof formatter) {\n\t var val = args[index];\n\t match = formatter.call(self, val);\n\n\t // now we need to remove `args[index]` since it's inlined in the `format`\n\t args.splice(index, 1);\n\t index--;\n\t }\n\t return match;\n\t });\n\n\t // apply env-specific formatting (colors, etc.)\n\t exports.formatArgs.call(self, args);\n\n\t var logFn = debug.log || exports.log || console.log.bind(console);\n\t logFn.apply(self, args);\n\t }\n\n\t debug.namespace = namespace;\n\t debug.enabled = exports.enabled(namespace);\n\t debug.useColors = exports.useColors();\n\t debug.color = selectColor(namespace);\n\n\t // env-specific initialization logic for debug instances\n\t if ('function' === typeof exports.init) {\n\t exports.init(debug);\n\t }\n\n\t return debug;\n\t}\n\n\t/**\n\t * Enables a debug mode by namespaces. This can include modes\n\t * separated by a colon and wildcards.\n\t *\n\t * @param {String} namespaces\n\t * @api public\n\t */\n\n\tfunction enable(namespaces) {\n\t exports.save(namespaces);\n\n\t exports.names = [];\n\t exports.skips = [];\n\n\t var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t var len = split.length;\n\n\t for (var i = 0; i < len; i++) {\n\t if (!split[i]) continue; // ignore empty strings\n\t namespaces = split[i].replace(/\\*/g, '.*?');\n\t if (namespaces[0] === '-') {\n\t exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t } else {\n\t exports.names.push(new RegExp('^' + namespaces + '$'));\n\t }\n\t }\n\t}\n\n\t/**\n\t * Disable debug output.\n\t *\n\t * @api public\n\t */\n\n\tfunction disable() {\n\t exports.enable('');\n\t}\n\n\t/**\n\t * Returns true if the given mode name is enabled, false otherwise.\n\t *\n\t * @param {String} name\n\t * @return {Boolean}\n\t * @api public\n\t */\n\n\tfunction enabled(name) {\n\t var i, len;\n\t for (i = 0, len = exports.skips.length; i < len; i++) {\n\t if (exports.skips[i].test(name)) {\n\t return false;\n\t }\n\t }\n\t for (i = 0, len = exports.names.length; i < len; i++) {\n\t if (exports.names[i].test(name)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}\n\n\t/**\n\t * Coerce `val`.\n\t *\n\t * @param {Mixed} val\n\t * @return {Mixed}\n\t * @api private\n\t */\n\n\tfunction coerce(val) {\n\t if (val instanceof Error) return val.stack || val.message;\n\t return val;\n\t}\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Helpers.\n\t */\n\n\tvar s = 1000;\n\tvar m = s * 60;\n\tvar h = m * 60;\n\tvar d = h * 24;\n\tvar y = d * 365.25;\n\n\t/**\n\t * Parse or format the given `val`.\n\t *\n\t * Options:\n\t *\n\t * - `long` verbose formatting [false]\n\t *\n\t * @param {String|Number} val\n\t * @param {Object} [options]\n\t * @throws {Error} throw an error if val is not a non-empty string or a number\n\t * @return {String|Number}\n\t * @api public\n\t */\n\n\tmodule.exports = function(val, options) {\n\t options = options || {};\n\t var type = typeof val;\n\t if (type === 'string' && val.length > 0) {\n\t return parse(val);\n\t } else if (type === 'number' && isNaN(val) === false) {\n\t return options.long ? fmtLong(val) : fmtShort(val);\n\t }\n\t throw new Error(\n\t 'val is not a non-empty string or a valid number. val=' +\n\t JSON.stringify(val)\n\t );\n\t};\n\n\t/**\n\t * Parse the given `str` and return milliseconds.\n\t *\n\t * @param {String} str\n\t * @return {Number}\n\t * @api private\n\t */\n\n\tfunction parse(str) {\n\t str = String(str);\n\t if (str.length > 100) {\n\t return;\n\t }\n\t var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n\t str\n\t );\n\t if (!match) {\n\t return;\n\t }\n\t var n = parseFloat(match[1]);\n\t var type = (match[2] || 'ms').toLowerCase();\n\t switch (type) {\n\t case 'years':\n\t case 'year':\n\t case 'yrs':\n\t case 'yr':\n\t case 'y':\n\t return n * y;\n\t case 'days':\n\t case 'day':\n\t case 'd':\n\t return n * d;\n\t case 'hours':\n\t case 'hour':\n\t case 'hrs':\n\t case 'hr':\n\t case 'h':\n\t return n * h;\n\t case 'minutes':\n\t case 'minute':\n\t case 'mins':\n\t case 'min':\n\t case 'm':\n\t return n * m;\n\t case 'seconds':\n\t case 'second':\n\t case 'secs':\n\t case 'sec':\n\t case 's':\n\t return n * s;\n\t case 'milliseconds':\n\t case 'millisecond':\n\t case 'msecs':\n\t case 'msec':\n\t case 'ms':\n\t return n;\n\t default:\n\t return undefined;\n\t }\n\t}\n\n\t/**\n\t * Short format for `ms`.\n\t *\n\t * @param {Number} ms\n\t * @return {String}\n\t * @api private\n\t */\n\n\tfunction fmtShort(ms) {\n\t if (ms >= d) {\n\t return Math.round(ms / d) + 'd';\n\t }\n\t if (ms >= h) {\n\t return Math.round(ms / h) + 'h';\n\t }\n\t if (ms >= m) {\n\t return Math.round(ms / m) + 'm';\n\t }\n\t if (ms >= s) {\n\t return Math.round(ms / s) + 's';\n\t }\n\t return ms + 'ms';\n\t}\n\n\t/**\n\t * Long format for `ms`.\n\t *\n\t * @param {Number} ms\n\t * @return {String}\n\t * @api private\n\t */\n\n\tfunction fmtLong(ms) {\n\t return plural(ms, d, 'day') ||\n\t plural(ms, h, 'hour') ||\n\t plural(ms, m, 'minute') ||\n\t plural(ms, s, 'second') ||\n\t ms + ' ms';\n\t}\n\n\t/**\n\t * Pluralization helper.\n\t */\n\n\tfunction plural(ms, n, name) {\n\t if (ms < n) {\n\t return;\n\t }\n\t if (ms < n * 1.5) {\n\t return Math.floor(ms / n) + ' ' + name;\n\t }\n\t return Math.ceil(ms / n) + ' ' + name + 's';\n\t}\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\t/**\n\t * Module requirements.\n\t */\n\n\tvar Polling = __webpack_require__(7);\n\tvar inherit = __webpack_require__(21);\n\n\t/**\n\t * Module exports.\n\t */\n\n\tmodule.exports = JSONPPolling;\n\n\t/**\n\t * Cached regular expressions.\n\t */\n\n\tvar rNewline = /\\n/g;\n\tvar rEscapedNewline = /\\\\n/g;\n\n\t/**\n\t * Global JSONP callbacks.\n\t */\n\n\tvar callbacks;\n\n\t/**\n\t * Noop.\n\t */\n\n\tfunction empty() {}\n\n\t/**\n\t * JSONP Polling constructor.\n\t *\n\t * @param {Object} opts.\n\t * @api public\n\t */\n\n\tfunction JSONPPolling(opts) {\n\t Polling.call(this, opts);\n\n\t this.query = this.query || {};\n\n\t // define global callbacks array if not present\n\t // we do this here (lazily) to avoid unneeded global pollution\n\t if (!callbacks) {\n\t // we need to consider multiple engines in the same page\n\t if (!global.___eio) global.___eio = [];\n\t callbacks = global.___eio;\n\t }\n\n\t // callback identifier\n\t this.index = callbacks.length;\n\n\t // add callback to jsonp global\n\t var self = this;\n\t callbacks.push(function (msg) {\n\t self.onData(msg);\n\t });\n\n\t // append to query string\n\t this.query.j = this.index;\n\n\t // prevent spurious errors from being emitted when the window is unloaded\n\t if (global.document && global.addEventListener) {\n\t global.addEventListener('beforeunload', function () {\n\t if (self.script) self.script.onerror = empty;\n\t }, false);\n\t }\n\t}\n\n\t/**\n\t * Inherits from Polling.\n\t */\n\n\tinherit(JSONPPolling, Polling);\n\n\t/*\n\t * JSONP only supports binary as base64 encoded strings\n\t */\n\n\tJSONPPolling.prototype.supportsBinary = false;\n\n\t/**\n\t * Closes the socket.\n\t *\n\t * @api private\n\t */\n\n\tJSONPPolling.prototype.doClose = function () {\n\t if (this.script) {\n\t this.script.parentNode.removeChild(this.script);\n\t this.script = null;\n\t }\n\n\t if (this.form) {\n\t this.form.parentNode.removeChild(this.form);\n\t this.form = null;\n\t this.iframe = null;\n\t }\n\n\t Polling.prototype.doClose.call(this);\n\t};\n\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\n\tJSONPPolling.prototype.doPoll = function () {\n\t var self = this;\n\t var script = document.createElement('script');\n\n\t if (this.script) {\n\t this.script.parentNode.removeChild(this.script);\n\t this.script = null;\n\t }\n\n\t script.async = true;\n\t script.src = this.uri();\n\t script.onerror = function (e) {\n\t self.onError('jsonp poll error', e);\n\t };\n\n\t var insertAt = document.getElementsByTagName('script')[0];\n\t if (insertAt) {\n\t insertAt.parentNode.insertBefore(script, insertAt);\n\t } else {\n\t (document.head || document.body).appendChild(script);\n\t }\n\t this.script = script;\n\n\t var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\n\t if (isUAgecko) {\n\t setTimeout(function () {\n\t var iframe = document.createElement('iframe');\n\t document.body.appendChild(iframe);\n\t document.body.removeChild(iframe);\n\t }, 100);\n\t }\n\t};\n\n\t/**\n\t * Writes with a hidden iframe.\n\t *\n\t * @param {String} data to send\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\n\tJSONPPolling.prototype.doWrite = function (data, fn) {\n\t var self = this;\n\n\t if (!this.form) {\n\t var form = document.createElement('form');\n\t var area = document.createElement('textarea');\n\t var id = this.iframeId = 'eio_iframe_' + this.index;\n\t var iframe;\n\n\t form.className = 'socketio';\n\t form.style.position = 'absolute';\n\t form.style.top = '-1000px';\n\t form.style.left = '-1000px';\n\t form.target = id;\n\t form.method = 'POST';\n\t form.setAttribute('accept-charset', 'utf-8');\n\t area.name = 'd';\n\t form.appendChild(area);\n\t document.body.appendChild(form);\n\n\t this.form = form;\n\t this.area = area;\n\t }\n\n\t this.form.action = this.uri();\n\n\t function complete() {\n\t initIframe();\n\t fn();\n\t }\n\n\t function initIframe() {\n\t if (self.iframe) {\n\t try {\n\t self.form.removeChild(self.iframe);\n\t } catch (e) {\n\t self.onError('jsonp polling iframe removal error', e);\n\t }\n\t }\n\n\t try {\n\t // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n\t var html = '<iframe src=\"javascript:0\" name=\"' + self.iframeId + '\">';\n\t iframe = document.createElement(html);\n\t } catch (e) {\n\t iframe = document.createElement('iframe');\n\t iframe.name = self.iframeId;\n\t iframe.src = 'javascript:0';\n\t }\n\n\t iframe.id = self.iframeId;\n\n\t self.form.appendChild(iframe);\n\t self.iframe = iframe;\n\t }\n\n\t initIframe();\n\n\t // escape \\n to prevent it from being converted into \\r\\n by some UAs\n\t // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n\t data = data.replace(rEscapedNewline, '\\\\\\n');\n\t this.area.value = data.replace(rNewline, '\\\\n');\n\n\t try {\n\t this.form.submit();\n\t } catch (e) {}\n\n\t if (this.iframe.attachEvent) {\n\t this.iframe.onreadystatechange = function () {\n\t if (self.iframe.readyState === 'complete') {\n\t complete();\n\t }\n\t };\n\t } else {\n\t this.iframe.onload = complete;\n\t }\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n\t/**\n\t * Module dependencies.\n\t */\n\n\tvar Transport = __webpack_require__(8);\n\tvar parser = __webpack_require__(9);\n\tvar parseqs = __webpack_require__(20);\n\tvar inherit = __webpack_require__(21);\n\tvar yeast = __webpack_require__(22);\n\tvar debug = __webpack_require__(23)('engine.io-client:websocket');\n\tvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\n\tvar NodeWebSocket;\n\tif (typeof window === 'undefined') {\n\t try {\n\t NodeWebSocket = __webpack_require__(29);\n\t } catch (e) {}\n\t}\n\n\t/**\n\t * Get either the `WebSocket` or `MozWebSocket` globals\n\t * in the browser or try to resolve WebSocket-compatible\n\t * interface exposed by `ws` for Node-like environment.\n\t */\n\n\tvar WebSocket = BrowserWebSocket;\n\tif (!WebSocket && typeof window === 'undefined') {\n\t WebSocket = NodeWebSocket;\n\t}\n\n\t/**\n\t * Module exports.\n\t */\n\n\tmodule.exports = WS;\n\n\t/**\n\t * WebSocket transport constructor.\n\t *\n\t * @api {Object} connection options\n\t * @api public\n\t */\n\n\tfunction WS(opts) {\n\t var forceBase64 = opts && opts.forceBase64;\n\t if (forceBase64) {\n\t this.supportsBinary = false;\n\t }\n\t this.perMessageDeflate = opts.perMessageDeflate;\n\t this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;\n\t this.protocols = opts.protocols;\n\t if (!this.usingBrowserWebSocket) {\n\t WebSocket = NodeWebSocket;\n\t }\n\t Transport.call(this, opts);\n\t}\n\n\t/**\n\t * Inherits from Transport.\n\t */\n\n\tinherit(WS, Transport);\n\n\t/**\n\t * Transport name.\n\t *\n\t * @api public\n\t */\n\n\tWS.prototype.name = 'websocket';\n\n\t/*\n\t * WebSockets support binary\n\t */\n\n\tWS.prototype.supportsBinary = true;\n\n\t/**\n\t * Opens socket.\n\t *\n\t * @api private\n\t */\n\n\tWS.prototype.doOpen = function () {\n\t if (!this.check()) {\n\t // let probe timeout\n\t return;\n\t }\n\n\t var uri = this.uri();\n\t var protocols = this.protocols;\n\t var opts = {\n\t agent: this.agent,\n\t perMessageDeflate: this.perMessageDeflate\n\t };\n\n\t // SSL options for Node.js client\n\t opts.pfx = this.pfx;\n\t opts.key = this.key;\n\t opts.passphrase = this.passphrase;\n\t opts.cert = this.cert;\n\t opts.ca = this.ca;\n\t opts.ciphers = this.ciphers;\n\t opts.rejectUnauthorized = this.rejectUnauthorized;\n\t if (this.extraHeaders) {\n\t opts.headers = this.extraHeaders;\n\t }\n\t if (this.localAddress) {\n\t opts.localAddress = this.localAddress;\n\t }\n\n\t try {\n\t this.ws = this.usingBrowserWebSocket ? protocols ? new WebSocket(uri, protocols) : new WebSocket(uri) : new WebSocket(uri, protocols, opts);\n\t } catch (err) {\n\t return this.emit('error', err);\n\t }\n\n\t if (this.ws.binaryType === undefined) {\n\t this.supportsBinary = false;\n\t }\n\n\t if (this.ws.supports && this.ws.supports.binary) {\n\t this.supportsBinary = true;\n\t this.ws.binaryType = 'nodebuffer';\n\t } else {\n\t this.ws.binaryType = 'arraybuffer';\n\t }\n\n\t this.addEventListeners();\n\t};\n\n\t/**\n\t * Adds event listeners to the socket\n\t *\n\t * @api private\n\t */\n\n\tWS.prototype.addEventListeners = function () {\n\t var self = this;\n\n\t this.ws.onopen = function () {\n\t self.onOpen();\n\t };\n\t this.ws.onclose = function () {\n\t self.onClose();\n\t };\n\t this.ws.onmessage = function (ev) {\n\t self.onData(ev.data);\n\t };\n\t this.ws.onerror = function (e) {\n\t self.onError('websocket error', e);\n\t };\n\t};\n\n\t/**\n\t * Writes data to socket.\n\t *\n\t * @param {Array} array of packets.\n\t * @api private\n\t */\n\n\tWS.prototype.write = function (packets) {\n\t var self = this;\n\t this.writable = false;\n\n\t // encodePacket efficient as it uses WS framing\n\t // no need for encodePayload\n\t var total = packets.length;\n\t for (var i = 0, l = total; i < l; i++) {\n\t (function (packet) {\n\t parser.encodePacket(packet, self.supportsBinary, function (data) {\n\t if (!self.usingBrowserWebSocket) {\n\t // always create a new object (GH-437)\n\t var opts = {};\n\t if (packet.options) {\n\t opts.compress = packet.options.compress;\n\t }\n\n\t if (self.perMessageDeflate) {\n\t var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;\n\t if (len < self.perMessageDeflate.threshold) {\n\t opts.compress = false;\n\t }\n\t }\n\t }\n\n\t // Sometimes the websocket has already been closed but the browser didn't\n\t // have a chance of informing us about it yet, in that case send will\n\t // throw an error\n\t try {\n\t if (self.usingBrowserWebSocket) {\n\t // TypeError is thrown when passing the second argument on Safari\n\t self.ws.send(data);\n\t } else {\n\t self.ws.send(data, opts);\n\t }\n\t } catch (e) {\n\t debug('websocket closed before onclose event');\n\t }\n\n\t --total || done();\n\t });\n\t })(packets[i]);\n\t }\n\n\t function done() {\n\t self.emit('flush');\n\n\t // fake drain\n\t // defer to next tick to allow Socket to clear writeBuffer\n\t setTimeout(function () {\n\t self.writable = true;\n\t self.emit('drain');\n\t }, 0);\n\t }\n\t};\n\n\t/**\n\t * Called upon close\n\t *\n\t * @api private\n\t */\n\n\tWS.prototype.onClose = function () {\n\t Transport.prototype.onClose.call(this);\n\t};\n\n\t/**\n\t * Closes socket.\n\t *\n\t * @api private\n\t */\n\n\tWS.prototype.doClose = function () {\n\t if (typeof this.ws !== 'undefined') {\n\t this.ws.close();\n\t }\n\t};\n\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\n\tWS.prototype.uri = function () {\n\t var query = this.query || {};\n\t var schema = this.secure ? 'wss' : 'ws';\n\t var port = '';\n\n\t // avoid port if default for schema\n\t if (this.port && ('wss' === schema && Number(this.port) !== 443 || 'ws' === schema && Number(this.port) !== 80)) {\n\t port = ':' + this.port;\n\t }\n\n\t // append timestamp to URI\n\t if (this.timestampRequests) {\n\t query[this.timestampParam] = yeast();\n\t }\n\n\t // communicate binary support capabilities\n\t if (!this.supportsBinary) {\n\t query.b64 = 1;\n\t }\n\n\t query = parseqs.encode(query);\n\n\t // prepend ? to query\n\t if (query.length) {\n\t query = '?' + query;\n\t }\n\n\t var ipv6 = this.hostname.indexOf(':') !== -1;\n\t return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\n\t/**\n\t * Feature detection for WebSocket.\n\t *\n\t * @return {Boolean} whether this transport is available.\n\t * @api public\n\t */\n\n\tWS.prototype.check = function () {\n\t return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 29 */\n/***/ function(module, exports) {\n\n\t/* (ignored) */\n\n/***/ },\n/* 30 */\n/***/ function(module, exports) {\n\n\t\n\tvar indexOf = [].indexOf;\n\n\tmodule.exports = function(arr, obj){\n\t if (indexOf) return arr.indexOf(obj);\n\t for (var i = 0; i < arr.length; ++i) {\n\t if (arr[i] === obj) return i;\n\t }\n\t return -1;\n\t};\n\n/***/ },\n/* 31 */\n/***/ function(module, exports) {\n\n\t/**\r\n\t * Parses an URI\r\n\t *\r\n\t * @author Steven Levithan <stevenlevithan.com> (MIT license)\r\n\t * @api private\r\n\t */\r\n\r\n\tvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\r\n\r\n\tvar parts = [\r\n\t 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r\n\t];\r\n\r\n\tmodule.exports = function parseuri(str) {\r\n\t var src = str,\r\n\t b = str.indexOf('['),\r\n\t e = str.indexOf(']');\r\n\r\n\t if (b != -1 && e != -1) {\r\n\t str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r\n\t }\r\n\r\n\t var m = re.exec(str || ''),\r\n\t uri = {},\r\n\t i = 14;\r\n\r\n\t while (i--) {\r\n\t uri[parts[i]] = m[i] || '';\r\n\t }\r\n\r\n\t if (b != -1 && e != -1) {\r\n\t uri.source = src;\r\n\t uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r\n\t uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r\n\t uri.ipv6uri = true;\r\n\t }\r\n\r\n\t return uri;\r\n\t};\r\n\n\n/***/ },\n/* 32 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\r\n\t * JSON parse.\r\n\t *\r\n\t * @see Based on jQuery#parseJSON (MIT) and JSON2\r\n\t * @api private\r\n\t */\r\n\r\n\tvar rvalidchars = /^[\\],:{}\\s]*$/;\r\n\tvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\r\n\tvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\r\n\tvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\r\n\tvar rtrimLeft = /^\\s+/;\r\n\tvar rtrimRight = /\\s+$/;\r\n\r\n\tmodule.exports = function parsejson(data) {\r\n\t if ('string' != typeof data || !data) {\r\n\t return null;\r\n\t }\r\n\r\n\t data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\r\n\r\n\t // Attempt to parse using the native JSON parser first\r\n\t if (global.JSON && JSON.parse) {\r\n\t return JSON.parse(data);\r\n\t }\r\n\r\n\t if (rvalidchars.test(data.replace(rvalidescape, '@')\r\n\t .replace(rvalidtokens, ']')\r\n\t .replace(rvalidbraces, ''))) {\r\n\t return (new Function('return ' + data))();\r\n\t }\r\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }\n/******/ ])\n});\n;\n",
|
|
36
|
-
"/**\n * ValidatorPlugin\n *\n * Dependencies:\n * - utils/form-validator\n * - utils/merge\n * - utils/events\n * - vendor/uuid\n *\n * @param {object} rule\n * @param {object} [ data ] // from request\n * @param {string} [ formId ]\n * */\nfunction ValidatorPlugin(rules, data, formId) {\n\n this.plugin = 'validator';\n\n /**\n * validator event handler - isGFFCtx only\n * */\n var events = ['ready', 'error', 'progress', 'submit', 'success', 'change', \"destroy\"];\n\n /** imports */\n var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;\n if (isGFFCtx) {\n require('utils/events');\n registerEvents(this.plugin, events);\n\n require('utils/dom');\n\n } else {\n var cacheless = (process.env.IS_CACHELESS == 'false') ? false : true;\n if (cacheless) {\n delete require.cache[require.resolve('./form-validator')]\n }\n }\n\n var uuid = (isGFFCtx) ? require('vendor/uuid') : require('uuid');\n var merge = (isGFFCtx) ? require('utils/merge') : require('../../../../utils/lib/merge');\n var FormValidator = (isGFFCtx) ? require('utils/form-validator') : require('./form-validator');\n\n /** definitions */\n var instance = { // isGFFCtx only\n 'id' : 'validator-' + uuid.v1(),\n\n 'plugin' : this.plugin,\n 'on' : (isGFFCtx) ? on : null,\n 'eventData' : {},\n 'target' : (isGFFCtx) ? document : null, // by default\n\n 'initialized' : false,\n 'isReady' : false,\n 'rules' : {},\n '$forms' : {},\n 'getFormById' : null,\n 'validateFormById' : null,\n 'setOptions' : null,\n 'resetErrorsDisplay': null,\n 'resetFields' : null\n };\n\n // validator proto\n var $validator = { // isGFFCtx only\n 'id' : null, // form id\n\n 'plugin' : this.plugin,\n 'on' : (isGFFCtx) ? on : null,\n 'eventData' : {},\n 'target' : (isGFFCtx) ? document : null, // by default\n\n 'binded' : false,\n 'withUserBindings' : false,\n 'rules' : {},\n 'setOptions' : null,\n 'send' : null,\n 'submit' : null,\n 'destroy' : null,\n 'resetErrorsDisplay' : null,\n 'resetFields' : null\n };\n\n\n /**\n * XML Request - isGFFCtx only\n * */\n var xhr = null;\n var xhrOptions = {\n 'url' : '',\n 'method' : 'GET',\n 'isSynchrone' : false,\n 'withCredentials': false,\n 'headers' : {\n // to upload, use `multipart/form-data` for `enctype`\n 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n // cross domain is enabled by default, but you need to setup `Access-Control-Allow-Origin`\n 'X-Requested-With': 'XMLHttpRequest' // in case of cross domain origin\n\n }\n };\n\n /**\n * backend definitions\n * */\n var setCustomRules = function (customRules) {\n // parsing rules\n if ( typeof(customRule) != 'undefined' ) {\n parseRules(customRule, '');\n checkForRulesImports(customRule);\n }\n }\n\n var backendProto = {\n 'setCustomRules': setCustomRules\n };\n\n\n /**\n * Backend init\n *\n * @param {object} rules\n * @param {object} [customRule]\n * */\n var backendInit = function (rules, data, formId) {\n\n var $form = ( typeof(formId) != 'undefined' ) ? { 'id': formId } : null;\n var fields = {};\n\n for (var field in data) {\n fields[field] = data[field]\n }\n\n\n // parsing rules\n if ( typeof(rules) != 'undefined' && rules.count() > 0 ) {\n parseRules(rules, '');\n checkForRulesImports(rules);\n\n backendProto.rules = instance.rules;\n\n return validate($form, fields, null, instance.rules)\n\n } else {\n // without rules - by hand\n return new FormValidator(fields)\n }\n }\n\n\n /**\n * GFF definitions\n * */\n\n var setOptions = function (options) {\n var options = merge(options, xhrOptions);\n xhrOptions = options;\n }\n\n\n var getFormById = function(formId) {\n var $form = null, _id = formId;\n\n if ( !instance['$forms'] )\n throw new Error('`$forms` collection not found');\n\n if ( typeof(_id) == 'undefined') {\n throw new Error('[ FormValidator::getFormById(formId) ] `formId` is missing')\n }\n\n _id = _id.replace(/\\#/, '');\n\n if ( typeof(instance['$forms'][_id]) != 'undefined' ) {\n instance['$forms'][_id].withUserBindings = true;\n\n $form = this.$forms[_id] = instance['$forms'][_id];\n\n return $form\n }\n\n return null\n }\n\n\n /**\n * validateFormById\n *\n * @param {string} formId\n * @param {object} [customRule]\n *\n * @return {object} $form\n * */\n var validateFormById = function(formId, customRule) {\n var $form = null, _id = formId;\n\n\n if ( !instance['$forms'] ) {\n throw new Error('`$forms` collection not found')\n }\n\n\n if ( typeof(_id) == 'undefined') {\n if ( typeof(this.id) != 'undefined' && this.id != '' && this.id != null ) {\n _id = this.id\n } else {\n throw new Error('[ FormValidator::validateFormById(formId, customRule) ] `formId` is missing')\n }\n }\n\n if ( typeof(_id) == 'string') {\n _id = _id.replace(/\\#/, '')\n } else if ( typeof(_id) == 'object' && !Array.isArray(_id) ) { // weird exception\n\n var $target = _id.form;\n _id = $target.getAttribute('id') || 'form.'+uuid.v1();\n\n $target.setAttribute('id', _id);// just in case\n\n } else {\n throw new Error('[ FormValidator::validateFormById(formId[, customRule]) ] `formId` should be a `string`');\n }\n\n if ( typeof(instance['$forms'][_id]) != 'undefined' ) {\n $form = this.$forms[_id] = instance['$forms'][_id];\n } else { // binding a form out of context (outside of the main instance)\n var $target = document.getElementById(_id);\n $validator.id = _id;\n $validator.target = $target;\n\n $form = this.$forms[_id] = instance.$forms[_id] = merge({}, $validator);\n\n var rule = null;\n if ( typeof(customRule) == 'undefined') {\n rule = _id.replace(/\\-/g, '.');\n\n if ( typeof(instance.rules[rule]) != 'undefined' ) {\n $form['rule'] = customRule = instance.rules[rule];\n } else if ( $form.target.getAttribute('data-gina-form-rule') ) {\n rule = $form.target.getAttribute('data-gina-form-rule').replace(/\\-/g, '.');\n\n if ( typeof(instance.rules[rule]) != 'undefined' ) {\n $form['rule'] = instance.rules[rule]\n } else {\n throw new Error('[ FormValidator::validateFormById(formId) ] using `data-gina-form-rule` on form `'+$form.target+'`: no matching rule found')\n }\n } // no else to allow form without any rule\n } else {\n rule = customRule.replace(/\\-/g, '.');\n\n if ( typeof(instance.rules[rule]) != 'undefined' ) {\n $form['rule'] = instance.rules[rule]\n } else {\n throw new Error('[ FormValidator::validateFormById(formId, customRule) ] `'+customRule+'` is not a valid rule')\n }\n }\n\n if ($target && !$form.binded)\n bindForm($target, rule);\n }\n\n if (!$form) throw new Error('[ FormValidator::validateFormById(formId, customRule) ] `'+_id+'` not found');\n\n return $form || null;\n\n }\n\n var handleErrorsDisplay = function($form, errors, data) {\n\n if ( gina.options.env == 'dev' )\n var formsErrors = null;\n\n var name = null, errAttr = null;\n var $err = null, $msg = null;\n var $el = null, $parent = null, $target = null;\n var id = $form.getAttribute('id');\n\n for (var i = 0, len = $form.length; i<len; ++i) {\n $el = $form[i];\n if ( /form\\-item\\-wrapper$/.test($el.parentNode.className) ) {\n $parent = $el.parentNode.parentNode;\n $target = $el.parentNode;\n } else {\n $parent = $el.parentNode;\n $target = $el;\n }\n\n name = $el.getAttribute('name');\n errAttr = $el.getAttribute('data-gina-form-errors');\n\n if (!name) continue;\n\n if ( typeof(errors[name]) != 'undefined' && !/form\\-item\\-error/.test($parent.className) ) {\n\n $parent.className += ($parent.className == '' ) ? 'form-item-error' : ' form-item-error';\n\n $err = document.createElement('div');\n $err.setAttribute('class', 'form-item-error-message');\n\n // injecting error messages\n for (var e in errors[name]) {\n\n if (e != 'stack') { // ignore stack for display\n $msg = document.createElement('p');\n $msg.appendChild( document.createTextNode(errors[name][e]) );\n $err.appendChild($msg);\n }\n\n if ( gina.options.env == 'dev' ) {\n if (!formsErrors) formsErrors = {};\n if ( !formsErrors[ name ] )\n formsErrors[ name ] = {};\n\n formsErrors[ name ][e] = errors[name][e]\n }\n }\n\n if ($target.type != 'hidden')\n insertAfter($target, $err);\n\n } else if ( typeof(errors[name]) == 'undefined' && /form\\-item\\-error/.test($parent.className) ) {\n // reset when not in error\n // remove child elements\n var $children = $parent.getElementsByTagName('div');\n for (var c = 0, cLen = $children.length; c<cLen; ++c) {\n if ( /form\\-item\\-error\\-message/.test($children[c].className) ) {\n //$parent.removeChild($children[c]);\n $children[c].parentElement.removeChild($children[c]);\n break\n }\n }\n\n $parent.className = $parent.className.replace(/(\\s+form\\-item\\-error|form\\-item\\-error)/, '');\n\n } else if ( typeof(errors[name]) != 'undefined' && errAttr) {\n // refreshing already displayed error on msg update\n var $divs = $parent.getElementsByTagName('div');\n for (var d = 0, dLen = $divs.length; d<dLen; ++d) {\n if ($divs[d].className == 'form-item-error-message') {\n\n $divs[d].parentElement.removeChild($divs[d]);\n $err = document.createElement('div');\n $err.setAttribute('class', 'form-item-error-message');\n\n // injecting error messages\n for (var e in errors[name]) {\n $msg = document.createElement('p');\n $msg.appendChild( document.createTextNode(errors[name][e]) );\n $err.appendChild($msg);\n\n if ( gina.options.env == 'dev' ) {\n if (!formsErrors) formsErrors = {};\n if ( !formsErrors[ name ] )\n formsErrors[ name ] = {};\n\n formsErrors[ name ][e] = errors[name][e]\n }\n }\n\n break;\n }\n }\n\n if ($target.type != 'hidden')\n insertAfter($target, $err);\n\n }\n }\n\n\n if ( formsErrors ) {\n\n triggerEvent(gina, $form, 'error.' + id, errors)\n\n if ( typeof(window.ginaToolbar) == 'object' ) {\n // update toolbar\n if (!gina.forms.errors)\n gina.forms.errors = {};\n\n gina.forms.errors = formsErrors;\n\n window.ginaToolbar.update('forms', gina.forms);\n }\n\n }\n }\n\n\n /**\n * Reset errors display\n *\n * @param {object|string} [$form|formId]\n *\n * */\n var resetErrorsDisplay = function($form) {\n var $form = $form, _id = null;\n if ( typeof($form) == 'undefined' ) {\n if ( typeof(this.target) != 'undefined' ) {\n _id = this.target.getAttribute('id');\n } else {\n _id = this.getAttribute('id');\n }\n\n $form = instance.$forms[_id]\n } else if ( typeof($form) == 'string' ) {\n _id = $form;\n _id = _id.replace(/\\#/, '');\n\n if ( typeof(instance.$forms[_id]) == 'undefined') {\n throw new Error('[ FormValidator::resetErrorsDisplay([formId]) ] `'+$form+'` not found')\n }\n\n $form = instance.$forms[_id]\n }\n //reseting error display\n handleErrorsDisplay($form['target'], []);\n\n return $form\n }\n\n /**\n * Reset fields\n *\n * @param {object|string} [$form|formId]\n *\n * */\n var resetFields = function($form) {\n var $form = $form, _id = null;\n if ( typeof($form) == 'undefined' ) {\n if ( typeof(this.target) != 'undefined' ) {\n _id = this.target.getAttribute('id');\n } else {\n _id = this.getAttribute('id');\n }\n\n $form = instance.$forms[_id]\n } else if ( typeof($form) == 'string' ) {\n _id = $form;\n _id = _id.replace(/\\#/, '');\n\n if ( typeof(instance.$forms[_id]) == 'undefined') {\n throw new Error('[ FormValidator::resetErrorsDisplay([formId]) ] `'+$form+'` not found')\n }\n\n $form = instance.$forms[_id]\n }\n\n if ($form.defaultFields) {\n\n var elId = null\n , $element = null\n , type = null;\n\n for (var f in $form.defaultFields) {\n\n $element = document.getElementById(f)\n type = $element.tagName.toLowerCase();\n\n if (type == 'input') {\n $element.value = $form.defaultFields[f];\n } else if ( type == 'select' ) {\n $element.options[ $form.defaultFields[f] ].selected = true;\n $element.setAttribute('data-value', $element.options[ $form.defaultFields[f] ].value);\n }\n }\n }\n\n return $form\n }\n\n // TODO - efreshErrorsDisplay\n // var refreshErrorsDisplay = function ($form) {\n //\n // }\n\n var submit = function () {\n\n var $form = null, _id = null, $target = null;\n\n if ( this.getAttribute ) {\n _id = this.getAttribute('id');\n $target = this;\n } else if ( typeof(this.target) && this.target.getAttribute ) {\n _id = this.target.getAttribute('id');\n $target = this.target\n }\n\n if ( typeof(instance.$forms[_id]) == 'undefined') {\n throw new Error('[ FormValidator::submit() ] not `$form` binded. Use `FormValidator::getFormById(id)` or `FormValidator::validateFormById(id)` first ')\n }\n\n triggerEvent(gina, $target, 'submit');\n\n return this;\n }\n\n\n /**\n * send\n * N.B.: no validation here; if you want to validate against rules, use `.submit()` before\n *\n *\n * @param {object} data\n * @param {object} [ options ]\n * */\n var send = function(data, options) {\n\n var $target = this.target , id = $target.getAttribute('id');\n var $form = instance.$forms[id] || this;\n\n // forward callback to HTML attribute\n listenToXhrEvents($form);\n\n if (options) {\n var options = merge(options, xhrOptions);\n } else {\n var options = xhrOptions;\n }\n\n var url = $target.getAttribute('action') || options.url;\n var method = $target.getAttribute('method') || options.method;\n method = method.toUpperCase();\n options.method = method;\n options.url = url;\n\n // to upload, use `multipart/form-data` for `enctype`\n var enctype = $target.getAttribute('enctype');\n\n if ( options.withCredentials ) {\n\n if ('withCredentials' in xhr) {\n // XHR for Chrome/Firefox/Opera/Safari.\n if (options.isSynchrone) {\n xhr.open(options.method, options.url, options.isSynchrone)\n } else {\n xhr.open(options.method, options.url)\n }\n } else if ( typeof XDomainRequest != 'undefined' ) {\n // XDomainRequest for IE.\n xhr = new XDomainRequest();\n xhr.open(options.method, options.url);\n } else {\n // CORS not supported.\n xhr = null;\n var result = 'CORS not supported: the server is missing the header `\"Access-Control-Allow-Credentials\": true` ';\n triggerEvent(gina, $target, 'error.' + id, result);\n\n return\n }\n\n xhr.withCredentials = true;\n } else {\n if (options.isSynchrone) {\n xhr.open(options.method, options.url, options.isSynchrone)\n } else {\n xhr.open(options.method, options.url)\n }\n }\n\n // setting up headers\n for (var hearder in options.headers) {\n if ( hearder == 'Content-Type' && typeof (enctype) != 'undefined' && enctype != null && enctype != '') {\n options.headers[hearder] = enctype\n }\n\n xhr.setRequestHeader(hearder, options.headers[hearder]);\n }\n\n if (xhr) {\n // catching ready state cb\n xhr.onreadystatechange = function (event) {\n\n if (xhr.readyState == 4) {\n // 200, 201, 201' etc ...\n if( /^2/.test(xhr.status) ) {\n\n try {\n var result = xhr.responseText;\n if ( /json$/.test( xhr.getResponseHeader(\"Content-Type\") ) ) {\n result = JSON.parse(xhr.responseText)\n }\n\n $form.eventData.success = result;\n\n var XHRData = result;\n if ( gina && typeof(window.ginaToolbar) == \"object\" && XHRData ) {\n try {\n\n if ( typeof(XHRData) != 'undefined' ) {\n window.ginaToolbar.update(\"data-xhr\", XHRData);\n }\n\n } catch (err) {\n throw err\n }\n }\n\n triggerEvent(gina, $target, 'success.' + id, result)\n\n } catch (err) {\n var result = {\n status: 422,\n error : err.message,\n stack : err.stack\n\n };\n\n $form.eventData.error = result;\n\n // // update toolbar\n // var XHRData = result;\n // if ( gina && typeof(window.ginaToolbar) == \"object\" && XHRData ) {\n // try {\n //\n // // forward backend appplication errors to forms.errors when available\n // if ( XHRData.error && typeof(XHRData.error) == 'object' && $form.fields ) {\n // var formsErrors = {}, errCount = 0;\n // for (var e in XHRData.error) {\n // if ( typeof($form.fields[e]) != 'undefined' ) {\n // ++errCount;\n // formsErrors[e] = XHRData.error[e];\n //\n // if ( typeof(XHRData.stack) != 'undefined' )\n // formsErrors[e].stack = XHRData.stack;\n // }\n // }\n //\n // if (errCount > 0) {\n // handleErrorsDisplay($form.target, formsErrors);\n // }\n // }\n // // update toolbar\n // ginaToolbar.update(\"data-xhr\", XHRData );\n //\n // } catch (err) {\n // throw err\n // }\n // }\n\n var XHRData = result;\n if ( gina && typeof(window.ginaToolbar) == \"object\" && XHRData ) {\n try {\n\n if ( typeof(XHRData) != 'undefined' ) {\n window.ginaToolbar.update(\"data-xhr\", XHRData);\n }\n\n } catch (err) {\n throw err\n }\n }\n\n triggerEvent(gina, $target, 'error.' + id, result)\n }\n\n } else if ( xhr.status != 0) {\n\n var result = { 'status': xhr.status };\n\n if ( /^(\\{|\\[).test( xhr.responseText ) /) {\n\n try {\n result = JSON.parse(xhr.responseText);\n } catch (err) {\n result = merge(result, err)\n }\n\n } else if ( typeof(xhr.responseText) == 'object' ) {\n result = xhr.responseText\n } else {\n result.message = xhr.responseText\n }\n\n $form.eventData.error = result;\n\n // update toolbar\n var XHRData = result;\n if ( gina && typeof(window.ginaToolbar) == \"object\" && XHRData ) {\n try {\n\n // forward backend appplication errors to forms.errors when available\n if ( XHRData.error && typeof(XHRData.error) == 'object' && $form.fields ) {\n var formsErrors = {}, errCount = 0;\n for (var e in XHRData.error) {\n if ( typeof($form.fields[e]) != 'undefined' ) {\n ++errCount;\n formsErrors[e] = XHRData.error[e];\n\n if ( typeof(XHRData.stack) != 'undefined' )\n formsErrors[e].stack = XHRData.stack;\n }\n }\n\n if (errCount > 0) {\n handleErrorsDisplay($form.target, formsErrors);\n }\n }\n // update toolbar\n ginaToolbar.update('data-xhr', XHRData );\n\n } catch (err) {\n throw err\n }\n }\n\n triggerEvent(gina, $target, 'error.' + id, result)\n }\n }\n };\n\n // catching request progress\n xhr.onprogress = function(event) {\n // console.log(\n // 'progress position '+ event.position,\n // '\\nprogress total size '+ event.totalSize\n // );\n\n var percentComplete = (event.position / event.totalSize)*100;\n var result = {\n 'status': 100,\n 'progress': percentComplete\n };\n\n $form.eventData.onprogress = result;\n\n triggerEvent(gina, $target, 'progress.' + id, result)\n };\n\n // catching timeout\n xhr.ontimeout = function (event) {\n var result = {\n 'status': 408,\n 'error': 'Request Timeout'\n };\n\n $form.eventData.ontimeout = result;\n\n triggerEvent(gina, $target, 'error.' + id, result)\n };\n\n\n // sending\n if (!data)\n data = event.detail.data;\n\n if (data) {\n if ( typeof(data) == 'object' ) {\n try {\n data = JSON.stringify(data)\n } catch (err) {\n triggerEvent(gina, $target, 'error.' + id, err)\n }\n }\n //console.log('sending -> ', data);\n //try {\n xhr.send(data)\n // } catch (err) {\n // var XHRData = result;\n // if ( gina && typeof(window.ginaToolbar) == \"object\" && XHRData ) {\n // try {\n //\n // if ( typeof(XHRData) != 'undefined' ) {\n // window.ginaToolbar.update(\"data-xhr\", XHRData);\n // }\n //\n // } catch (err) {\n // throw err\n // }\n // }\n // }\n\n } else {\n xhr.send()\n }\n $form.sent = true;\n\n\n }\n }\n\n var listenToXhrEvents = function($form) {\n\n //$form['plugin'] = $validator.plugin;\n //$form['on'] = $validator.on;\n\n\n //data-gina-form-event-on-submit-success\n var htmlSuccesEventCallback = $form.target.getAttribute('data-gina-form-event-on-submit-success') || null;\n if (htmlSuccesEventCallback != null) {\n\n if ( /\\((.*)\\)/.test(htmlSuccesEventCallback) ) {\n eval(htmlSuccesEventCallback)\n } else {\n $form.on('success', window[htmlSuccesEventCallback])\n }\n }\n\n //data-gina-form-event-on-submit-error\n var htmlErrorEventCallback = $form.target.getAttribute('data-gina-form-event-on-submit-error') || null;\n if (htmlErrorEventCallback != null) {\n if ( /\\((.*)\\)/.test(htmlErrorEventCallback) ) {\n eval(htmlErrorEventCallback)\n } else {\n $form.on('error', window[htmlErrorEventCallback])\n }\n }\n }\n\n var destroy = function(formId) {\n var $form = null, _id = formId;\n\n\n if ( !instance['$forms'] )\n throw new Error('`$forms` collection not found');\n\n\n if ( typeof(_id) == 'undefined') {\n if ( typeof(this.id) != 'undefined' && this.id != '' && this.id != null ) {\n _id = this.id\n } else {\n throw new Error('[ FormValidator::destroy(formId) ] `formId` is missing')\n }\n }\n\n if ( typeof(_id) == 'string') {\n _id = _id.replace(/\\#/, '')\n } else if ( typeof(_id) == 'object' && !Array.isArray(_id) ) { // weird exception\n var $target = _id.form;\n _id = $target.getAttribute('id') || 'form.'+uuid.v1();\n\n $target.setAttribute('id', _id);// just in case\n\n } else {\n throw new Error('[ FormValidator::destroy(formId) ] `formId` should be a `string`');\n }\n\n if ( typeof(instance['$forms'][_id]) != 'undefined' ) {\n $form = instance['$forms'][_id]\n } else if ( typeof(this.binded) != 'undefined' ) {\n $form = this;\n }\n\n if ($form) {\n // remove existing listeners\n\n // form events\n removeListener(gina, $form, 'success.' + _id);\n removeListener(gina, $form, 'validate.' + _id);\n removeListener(gina, $form, 'submit.' + _id);\n removeListener(gina, $form, 'error.' + _id);\n\n // binded elements\n var $el = null\n , evt = null\n , $els = []\n , $elTMP = [];\n\n // submit buttons\n $elTMP = $form.target.getElementsByTagName('button');\n if ( $elTMP.length > 0 ) {\n for(var i = 0, len = $elTMP.length; i < len; ++i) {\n if ($elTMP[i].type == 'submit')\n $els.push($elTMP[i])\n }\n }\n\n // submit links\n $elTMP = $form.target.getElementsByTagName('a');\n if ( $elTMP.length > 0 ) {\n for(var i = 0, len = $elTMP.length; i < len; ++i) {\n if ( $elTMP[i].attributes.getNamedItem('data-gina-form-submit') || /^click\\./.test( $elTMP[i].attributes.getNamedItem('id') ) )\n $els.push($elTMP[i])\n }\n }\n\n // checkbox & radio\n $elTMP = $form.target.getElementsByTagName('input');\n if ( $elTMP.length > 0 ) {\n for(var i = 0, len = $elTMP.length; i < len; ++i) {\n if ($elTMP[i].type == 'checkbox' || $elTMP[i].type == 'radio' )\n $els.push( $elTMP[i] )\n }\n }\n\n for (var i = 0, len = $els.length; i < len; ++i) {\n\n $el = $els[i];\n if ($el.type == 'submit') {\n\n evt = $el.getAttribute('id');\n if ( typeof(gina.events[ evt ]) != 'undefined' )\n removeListener(gina, $el, gina.events[ evt ]);\n\n } else {\n\n evt ='click.' + $el.getAttribute('id');\n if ( typeof(gina.events[ evt ]) != 'undefined' )\n removeListener(gina, $el, evt);\n }\n }\n\n $form.binded = false;\n\n //addListener(gina, instance['$forms'][_id].target, 'destroy.' + _id, function(event) {\n addListener(gina, $form.target, 'destroy.' + _id, function(event) {\n\n cancelEvent(event);\n\n delete instance['$forms'][_id];\n removeListener(gina, event.currentTarget, event.type);\n removeListener(gina, event.currentTarget,'destroy');\n });\n\n //triggerEvent(gina, instance['$forms'][_id].target, 'destroy.' + _id);\n triggerEvent(gina, $form.target, 'destroy.' + _id);\n\n } else {\n throw new Error('[ FormValidator::destroy(formId) ] `'+_id+'` not found');\n }\n\n }\n\n var checkForRulesImports = function (rules) {\n // check if rules has imports & replace\n var rulesStr = JSON.stringify(rules, null, 4);\n var importedRules = rulesStr.match(/(\\\"@import\\s+[a-z A-Z 0-9/.]+\\\")/g);\n if (importedRules && importedRules.length > 0) {\n var ruleArr = [], rule = {}, tmpRule = null;\n for (var r = 0, len = importedRules.length; r<len; ++r) {\n ruleArr = importedRules[r].replace(/(@import\\s+|\\\"|\\')/g, '').split(/\\s/g);\n // [\"\"@import client/form\", \"\"@import project26/edit demo/edit\"]\n //console.log('ruleArr -> ', ruleArr, importedRules[r]);\n for (var i = 0, iLen = ruleArr.length; i<iLen; ++i) {\n tmpRule = ruleArr[i].replace(/\\//g, '.');\n if ( typeof(instance.rules[ tmpRule ]) != 'undefined' ) {\n rule = merge(rule, instance.rules[ tmpRule ])\n } else {\n console.warn('[formValidator:rules] <@import error> on `'+importedRules[r]+'`: rule `'+ruleArr[i]+'` not found. Ignoring.')\n }\n }\n //console.log('replacing ', importedRules[r]);\n rulesStr = rulesStr.replace(importedRules[r], JSON.stringify(rule));\n instance.rules = JSON.parse( JSON.stringify(instance.rules).replace( new RegExp(importedRules[r], 'g'), JSON.stringify(rule)) );\n //console.log('str ', rulesStr);\n rule = {}\n\n }\n\n if (!instance.rules) {\n instance.rules = {}\n }\n\n rules = JSON.parse(rulesStr);\n parseRules(rules, '');\n\n // if (!isGFFCtx) {\n // backendProto.rules = instance.rules\n // }\n }\n }\n\n var init = function (rules) {\n\n if (gina.hasValidator) {\n instance = merge(instance, gina.validator);\n instance.on('init', function(event) {\n instance.isReady = true;\n triggerEvent(gina, instance.target, 'ready.' + instance.id, instance)\n })\n } else {\n setupInstanceProto();\n instance.on('init', function(event) {\n // parsing rules\n if ( typeof(rules) != 'undefined' && rules.count() ) {\n gina.forms.rules = JSON.parse(JSON.stringify(rules));// making copy\n parseRules(rules, '');\n checkForRulesImports(rules);\n }\n\n $validator.setOptions = setOptions;\n $validator.getFormById = getFormById;\n $validator.validateFormById = validateFormById;\n $validator.resetErrorsDisplay = resetErrorsDisplay;\n $validator.resetFields = resetFields;\n $validator.handleErrorsDisplay = handleErrorsDisplay;\n $validator.submit = submit;\n $validator.send = send;\n $validator.destroy = destroy;\n\n var id = null\n , $target = null\n , i = 0\n , $forms = []\n , $allForms = document.getElementsByTagName('form');\n\n\n // has rule ?\n for (var f=0, len = $allForms.length; f<len; ++f) {\n // preparing prototype (need at least an ID for this)\n\n if ($allForms[f].getAttribute) {\n id = $allForms[f].getAttribute('id') || 'form.' + uuid.v1();\n if ( id !== $allForms[f].getAttribute('id') ) {\n $allForms[f].setAttribute('id', id)\n }\n } else {\n id = 'form.' + uuid.v1();\n $allForms[f].setAttribute('id', id)\n }\n\n $allForms[f]['id'] = $validator.id = id;\n\n if ( typeof($allForms[f].id) != 'undefined' && $allForms[f].id != 'null' && $allForms[f].id != '') {\n\n $validator.target = $allForms[f];\n instance.$forms[$allForms[f].id] = merge({}, $validator);\n\n var customRule = $allForms[f].getAttribute('data-gina-form-rule');\n\n if (customRule) {\n customRule = customRule.replace(/\\-/g, '.');\n if ( typeof(instance.rules[customRule]) == 'undefined' ) {\n throw new Error('['+$allForms[f].id+'] no rule found with key: `'+customRule+'`');\n customRule = null\n } else {\n customRule = instance.rules[customRule]\n }\n }\n\n // finding forms handled by rules\n if ( typeof($allForms[f].id) == 'string' && typeof(instance.rules[$allForms[f].id.replace(/\\-/g, '.')]) != 'undefined' ) {\n $target = instance.$forms[$allForms[f].id].target;\n if (customRule) {\n bindForm($target, customRule)\n } else {\n bindForm($target)\n }\n\n ++i\n } else {\n // weird exception when having in the form an element with name=\"id\"\n if ( typeof($allForms[f].id) == 'object' ) {\n delete instance.$forms[$allForms[f].id];\n\n var _id = $allForms[f].attributes.getNamedItem('id').nodeValue || 'form.'+uuid.v1();\n\n $allForms[f].setAttribute('id', _id);\n $allForms[f]['id'] = _id;\n\n $validator.target = $allForms[f];\n instance.$forms[_id] = merge({}, $validator);\n\n $target = instance.$forms[_id].target;\n if (customRule) {\n bindForm($target, customRule)\n } else {\n bindForm($target)\n }\n } else {\n\n $target = instance.$forms[$allForms[f].id].target;\n if (customRule) {\n bindForm($target, customRule)\n } else {\n bindForm($target)\n }\n }\n }\n }\n\n }\n\n\n // setting up AJAX\n if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n xhr = new XMLHttpRequest();\n } else if (window.ActiveXObject) { // IE\n try {\n xhr = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n catch (e) {}\n }\n }\n\n instance.isReady = true;\n gina.hasValidator = true;\n gina.validator = instance;\n triggerEvent(gina, instance.target, 'ready.' + instance.id, instance);\n });\n\n }\n\n instance.initialized = true;\n return instance\n }\n\n /**\n * parseRules - Preparing rules paths\n *\n * @param {object} rules\n * @param {string} tmp - path\n * */\n var parseRules = function(rules, tmp) {\n var _r = null;\n for (var r in rules) {\n\n if ( typeof(rules[r]) == 'object' && typeof(instance.rules[tmp + r]) == 'undefined' ) {\n\n _r = r;\n if (/\\[|\\]/.test(r) ) { // must be a real path\n _r = r.replace(/\\[/g, '.').replace(/\\]/g, '');\n }\n\n instance.rules[tmp + _r] = rules[r];\n //delete instance.rules[r];\n parseRules(rules[r], tmp + _r +'.');\n }\n }\n }\n\n /**\n * makeObject - Preparing form data\n *\n * @param {object} obj - data\n * @param {string\\number\\boolean} value\n * @param {array} string\n * @param {number} len\n * @param {number} i\n *\n * */\n var makeObject = function (obj, value, args, len, i) {\n\n if (i >= len) {\n return false\n }\n\n var key = args[i].replace(/^\\[|\\]$/g, '');\n var nextKey = ( i < len-1 && typeof(args[i+1]) != 'undefined' ) ? args[i+1].replace(/^\\[|\\]$/g, '') : null;\n\n if ( typeof(obj[key]) == 'undefined' ) {\n if (nextKey && /^\\d+$/.test(nextKey)) {\n nextKey = parseInt(nextKey);\n obj[key] = []\n } else {\n obj[key] = {}\n }\n }\n\n for (var o in obj) {\n\n if ( typeof(obj[o]) == 'object' ) {\n\n if ( Array.isArray(obj[o]) ) {\n\n\n if (o === key) {\n\n var _args = JSON.parse(JSON.stringify(args));\n _args.splice(0, 1);\n\n for (var a = i, aLen = _args.length; a < aLen; ++a) {\n key = parseInt(_args[a].replace(/^\\[|\\]$/g, ''))\n obj[o][key] = {};\n\n if (a == aLen-1) {\n obj[o][key] = value;\n }\n }\n }\n\n } else if ( o === key ) {\n\n if (i == len-1) {\n obj[o] = value;\n } else {\n makeObject(obj[o], value, args, len, i+1)\n }\n }\n }\n }\n\n }\n\n var formatData = function (data) {\n\n var args = null\n , obj = {}\n , key = null\n , fields = {};\n\n for (name in data) {\n\n if ( /\\[(.*)\\]/.test(name) ) {\n // backup name key\n key = name;\n\n // properties\n args = name.match(/(\\[[-_\\[a-z 0-9]*\\]\\]|\\[[-_\\[a-z 0-9]*\\])/ig);\n\n // root\n name = name.match(/^[-_a-z 0-9]+\\[{0}/ig);\n\n // building object tree\n makeObject(obj, data[key], args, args.length, 0);\n\n fields[name] = merge( fields[name], obj );\n obj = {}\n\n } else {\n fields[name] = data[name];\n }\n }\n\n return fields\n }\n\n\n var validate = function($form, fields, $fields, rules, cb) {\n\n delete fields['_length']; //cleaning\n\n var id = null, data = null;\n if (isGFFCtx) {\n id = $form.getAttribute('id') || $form.id;\n instance.$forms[id].fields = fields;\n }\n //console.log(fields, $fields);\n\n var d = new FormValidator(fields, $fields), args = null;\n var fieldErrorsAttributes = {};\n var re = null, flags = null;\n\n var forEachField = function($form, fields, $fields, rules, cb, i) {\n var hasCase = false, conditions = null;\n var caseValue = null, caseType = null;\n var localRules = null;\n\n //console.log('parsing ', fields, $fields, rules);\n\n for (var field in fields) {\n\n hasCase = ( typeof(rules['_case_' + field]) != 'undefined' ) ? true : false;\n if (hasCase) {\n\n conditions = rules['_case_' + field]['conditions'];\n\n if ( !conditions ) {\n throw new Error('[ ginaFormValidator ] case `_case_'+field+'` found without `condition(s)` !');\n }\n\n for (var c = 0, cLen = conditions.length; c<cLen; ++c) {\n\n caseValue = fields[field];\n\n if (isGFFCtx) {\n if (fields[field] == \"true\")\n caseValue = true;\n else if (fields[field] == \"false\")\n caseValue = false;\n }\n\n //console.log(caseValue +' VS '+ conditions[c]['case'], \"->\", (caseValue == conditions[c]['case'] || Array.isArray(conditions[c]['case']) && conditions[c]['case'].indexOf(caseValue) > -1) );\n if ( conditions[c]['case'] === caseValue || Array.isArray(conditions[c]['case']) && conditions[c]['case'].indexOf(caseValue) > -1 || /^\\//.test(conditions[c]['case']) ) {\n\n //console.log('[fields ] ' + JSON.stringify(fields, null, 4));\n localRules = {};\n\n for (var f in conditions[c]['rules']) {\n //console.log('F: ', f, '\\nrule: '+ JSON.stringify(conditions[c]['rules'][f], null, 2));\n if ( /^\\//.test(f) ) { // RegExp found\n\n re = f.match(/\\/(.*)\\//).pop();\n flags = f.replace('/'+ re +'/', '');\n re = new RegExp(re, flags);\n\n for (var localField in $fields) {\n if ( re.test(localField) ) {\n if ( /^\\//.test(conditions[c]['case']) ) {\n re = conditions[c]['case'].match(/\\/(.*)\\//).pop();\n flags = conditions[c]['case'].replace('/'+ re +'/', '');\n re = new RegExp(re, flags);\n\n if ( re.test(caseValue) ) {\n localRules[localField] = conditions[c]['rules'][f]\n }\n\n } else {\n localRules[localField] = conditions[c]['rules'][f]\n }\n }\n }\n\n } else {\n if ( /^\\//.test(conditions[c]['case']) ) {\n re = conditions[c]['case'].match(/\\/(.*)\\//).pop();\n flags = conditions[c]['case'].replace('/'+ re +'/', '');\n re = new RegExp(re, flags);\n\n if ( re.test(caseValue) ) {\n localRules[f] = conditions[c]['rules'][f]\n }\n\n } else {\n localRules[f] = conditions[c]['rules'][f]\n }\n }\n }\n //console.log('parsing ', localRules, fields);\n if (isGFFCtx)\n forEachField($form, fields, $fields, localRules, cb, i+1);\n else\n return forEachField($form, fields, $fields, localRules, cb, i+1);\n }\n }\n\n }\n\n\n if ( typeof(rules[field]) == 'undefined' ) continue;\n\n\n // check against rule\n for (var rule in rules[field]) {\n // check for rule params\n try {\n\n if ( Array.isArray(rules[field][rule]) ) { // has args\n //convert array to arguments\n args = rules[field][rule];\n d[field][rule].apply(d[field], args);\n } else {\n d[field][rule](rules[field][rule]);\n }\n\n } catch (err) {\n if (rule == 'conditions') {\n throw new Error('[ ginaFormValidator ] could not evaluate `'+field+'->'+rule+'()` where `conditions` must be a `collection` (Array)\\nStack:\\n'+ (err.stack|err.message))\n } else {\n throw new Error('[ ginaFormValidator ] could not evaluate `'+field+'->'+rule+'()`\\nStack:\\n'+ (err.stack|err.message))\n }\n }\n\n }\n }\n\n\n --i;\n\n if (i < 0) {\n\n var errors = d['getErrors']();\n\n // adding data attribute to handle display refresh\n for (var field in errors) {\n for (rule in errors[field]) {\n if (!fieldErrorsAttributes[field]) {\n fieldErrorsAttributes[field] = ''\n }\n\n if (fieldErrorsAttributes[field].indexOf(rule) < 0)\n fieldErrorsAttributes[field] += rule +' ';\n }\n\n if (isGFFCtx)\n $fields[field].setAttribute('data-gina-form-errors', fieldErrorsAttributes[field].substr(0, fieldErrorsAttributes[field].length-1))\n }\n\n //calling back\n try {\n data = formatData( d['toData']() );\n\n if ( typeof(window.ginaToolbar) == 'object' ) {\n // update toolbar\n if (!gina.forms.sent)\n gina.forms.sent = {};\n\n gina.forms.sent = data;\n\n window.ginaToolbar.update('forms', gina.forms);\n }\n } catch (err) {\n throw err\n }\n\n if ( typeof(cb) != 'undefined' && typeof(cb) === 'function' ) {\n\n cb({\n 'isValid' : d['isValid'],\n 'errors' : errors,\n 'data' : data\n })\n\n } else {\n\n return {\n 'isValid' : d['isValid'],\n 'errors' : errors,\n 'data' : data\n }\n }\n }\n }\n\n if (isGFFCtx)\n forEachField($form, fields, $fields, rules, cb, 0);\n else\n return forEachField($form, fields, $fields, rules, cb, 0);\n }\n\n /**\n * bindForm\n *\n * @param {object} target - DOM element\n * @param {object} [customRule]\n * */\n var bindForm = function($target, customRule) {\n\n var $form = null, _id = null;\n\n try {\n if ( $target.getAttribute && $target.getAttribute('id') ) {\n _id = $target.getAttribute('id');\n if ( typeof(instance.$forms[_id]) != 'undefined')\n $form = instance.$forms[_id];\n else\n throw new Error('form instance `'+ _id +'` not found');\n\n } else {\n throw new Error('Validator::bindForm($target, customRule): `$target` must be a DOM element\\n'+err.stack )\n }\n } catch(err) {\n throw new Error('Validator::bindForm($target, customRule) could not bind form `'+ $target +'`\\n'+err.stack )\n }\n\n if ( typeof($form) != 'undefined' && $form.binded) {\n return false\n }\n\n var withRules = false, rule = null, evt = '', procced = null;\n\n if ( typeof(customRule) != 'undefined' || typeof(_id) == 'string' && typeof(instance.rules[_id.replace(/\\-/g, '.')]) != 'undefined' ) {\n withRules = true;\n\n if ( customRule && typeof(customRule) == 'object' ) {\n rule = customRule\n } else if ( customRule && typeof(customRule) == 'string' && typeof(instance.rules[customRule.replace(/\\-/g, '.')]) != 'undefined') {\n rule = instance.rules[customRule.replace(/\\-/g, '.')]\n } else {\n rule = instance.rules[_id.replace(/\\-/g, '.')]\n }\n\n $form.rules = rule\n }\n\n // form fields\n if (!$form.defaultFields)\n $form.defaultFields = {};\n\n // binding form elements\n var type = null\n , id = null\n // input: checkbox, radio\n , $inputs = $target.getElementsByTagName('input')\n // select\n , $select = $target.getElementsByTagName('select')\n ;\n\n var elId = null;\n for (var i = 0, len = $inputs.length; i < len; ++i) {\n elId = $inputs[i].getAttribute('id');\n if (!elId) {\n elId = 'input.' + uuid.v1();\n $inputs[i].setAttribute('id', elId)\n }\n\n if (!$form.defaultFields[ elId ])\n $form.defaultFields[ elId ] = $inputs[i].value;\n }\n\n var selectedIndex = null, selectedValue = null;\n for (var s = 0, sLen = $select.length; s < sLen; ++s) {\n elId = $select[s].getAttribute('id');\n if (!elId) {\n elId = 'select.' + uuid.v1();\n $select[s].setAttribute('id', elId)\n }\n\n if ($select[s].options && !$form.defaultFields[ elId ]) {\n selectedIndex = 0;\n selectedValue = $select[s].getAttribute('data-value');\n\n if ( $select[s].options[ $select[s].selectedIndex ].index ) {\n selectedIndex = $select[s].options[ $select[s].selectedIndex ].index\n } else if ( typeof(selectedValue) != 'undefined' ) {\n for (var o = 0, oLen = $select[s].options.length; o < oLen; ++o ) {\n if ( $select[s].options[o].value == selectedValue) {\n selectedIndex = o;\n break\n }\n }\n }\n\n $form.defaultFields[ elId ] = selectedIndex;\n // update select\n $select[s].options[ selectedIndex ].selected = true;\n $select[s].setAttribute('data-value', $select[s].options[ selectedIndex ].value);\n\n }\n }\n\n var updateCheckBox = function($el) {\n\n var checked = $el.checked;\n\n if ( !checked || checked == 'null' || checked == 'false' || checked == '' ) {\n\n // prevents ticking behavior\n setTimeout(function () {\n $el.checked = false;\n }, 0);\n\n $el.removeAttribute('checked');\n $el.value = false;\n $el.setAttribute('value', 'false');\n\n } else {\n\n // prevents ticking behavior\n setTimeout(function () {\n $el.checked = true;\n }, 0);\n\n $el.setAttribute('checked', 'checked');\n //boolean exception handling\n $el.value = true;\n $el.setAttribute('value', 'true');\n\n }\n };\n\n var updateRadio = function($el, isInit) {\n var checked = $el.checked;\n var isBoolean = /^(true|false)$/i.test($el.value);\n\n // loop if radio group\n if (!isInit) {\n var radioGroup = document.getElementsByName($el.name);\n //console.log('found ', radioGroup.length, radioGroup)\n for (var r = 0, rLen = radioGroup.length; r < rLen; ++r) {\n if (radioGroup[r].id !== $el.id) {\n radioGroup[r].checked = false;\n radioGroup[r].removeAttribute('checked');\n }\n }\n }\n\n if ( !checked || checked == 'null' || checked == 'false' || checked == '' ) {\n\n // prevents ticking behavior\n setTimeout(function () {\n $el.checked = false;\n }, 0)\n\n $el.removeAttribute('checked');\n\n if (isBoolean) {\n $el.value = false;\n }\n\n } else {\n\n // prevents ticking behavior\n setTimeout(function () {\n $el.checked = true;\n }, 0)\n\n $el.setAttribute('checked', 'checked');\n\n if (isBoolean) { // no multiple choice supported\n $el.value = true;\n }\n var radioGroup = document.getElementsByName($el.name);\n //console.log('found ', radioGroup.length, radioGroup)\n for (var r = 0, rLen = radioGroup.length; r < rLen; ++r) {\n if (radioGroup[r].id !== $el.id) {\n radioGroup[r].checked = false;\n radioGroup[r].removeAttribute('checked');\n if (isBoolean) {\n radioGroup[r].value = false;\n }\n }\n }\n\n\n }\n }\n\n evt = 'click';\n\n procced = function () {\n // click proxy\n addListener(gina, $target, 'click', function(event) {\n\n if ( /(label)/i.test(event.target.tagName) )\n return false;\n\n if ( typeof(event.target.id) == 'undefined' || !event.target.getAttribute('id') ) {\n event.target.setAttribute('id', 'click.' + uuid.v1() );\n event.target.id = event.target.getAttribute('id')\n } else {\n event.target.id = event.target.getAttribute('id')\n }\n\n\n if (/^click\\./.test(event.target.id) || withRules) {\n\n var _evt = event.target.id;\n\n if (!_evt) return false;\n\n if ( ! /^click\\./.test(_evt) ) {\n _evt = event.target.id\n }\n\n // prevent event to be triggered twice\n if ( typeof(event.defaultPrevented) != 'undefined' && event.defaultPrevented )\n return false;\n\n if (gina.events[_evt]) {\n cancelEvent(event);\n\n triggerEvent(gina, event.target, _evt, event.detail);\n }\n\n }\n\n })\n }\n\n\n procced()\n\n for (var i=0, len = $inputs.length; i<len; ++i) {\n type = $inputs[i].getAttribute('type');\n\n if ( typeof($inputs[i].id) == 'undefined' || $inputs[i].id == '' ) {\n $inputs[i]['id'] = type +'-'+ uuid.v1();\n $inputs[i].setAttribute('id', $inputs[i]['id'])\n }\n\n\n // recover default state only on value === true || false || on\n if ( typeof(type) != 'undefined' && type == 'checkbox' && /^(true|false|on)$/i.test($inputs[i].value) || typeof(type) != 'undefined' && type == 'checkbox' && !$inputs[i].getAttribute('value') ) {\n\n if ( !/^(true|false|on)$/i.test($inputs[i].value) ) {\n\n if ( !$inputs[i].checked || $inputs[i].checked == 'null' || $inputs[i].checked == 'false' || $inputs[i].checked == '' ) {\n $inputs[i].value = false;\n $inputs[i].setAttribute('value', false)\n } else {\n $inputs[i].value = true;\n $inputs[i].setAttribute('value', true)\n }\n }\n\n\n evt = $inputs[i].id;\n\n procced = function ($el, evt) {\n\n // recover default state only on value === true || false\n addListener(gina, $el, evt, function(event) {\n\n if ( /^(true|false|on)$/i.test(event.target.value) ) {\n cancelEvent(event);\n updateCheckBox(event.target);\n }\n });\n\n // default state recovery\n var value = $el.value || $el.getAttribute('value') || $el.getAttribute('data-value');\n if ( /^(true|false|on)$/i.test(value) ) {\n\n if ( typeof(value) != 'undefined' && /^(true|on|false)$/.test(value) ) {\n $el.checked = /true|on/.test(value) ? true : false;\n }\n\n updateCheckBox($el);\n }\n\n\n }\n\n if ( typeof(gina.events[evt]) != 'undefined' && gina.events[evt] == $inputs[i].id ) {\n removeListener(gina, $inputs[i], evt);\n procced($inputs[i], evt)\n\n } else {\n procced($inputs[i], evt)\n }\n\n } else if ( typeof(type) != 'undefined' && type == 'radio' ) {\n\n evt = $inputs[i].id;\n\n procced = function ($el, evt) {\n addListener(gina, $el, evt, function(event) {\n\n cancelEvent(event);\n updateRadio(event.target);\n });\n\n\n updateRadio($el, true);\n }\n\n if ( typeof(gina.events[evt]) != 'undefined' && gina.events[evt] == $inputs[i].id ) {\n removeListener(gina, $inputs[i], evt);\n procced(event.target, evt)\n\n } else {\n procced($inputs[i], evt)\n }\n }\n }\n\n\n if (withRules) {\n\n evt = 'validate.' + _id;\n procced = function () {\n\n // attach form event\n addListener(gina, $target, evt, function(event) {\n cancelEvent(event);\n\n\n var result = event['detail'] || $form.eventData.validation;\n //console.log('$form[ '+_id+' ] validation done !!!\\n isValid ? ', result['isValid'](), '\\nErrors -> ', result['errors'], '\\nData -> ', result['data']);\n\n handleErrorsDisplay(event['target'], result['errors'], result['data']);\n\n var _id = event.target.getAttribute('id');\n\n if ( result['isValid']() ) { // send if valid\n // now sending to server\n // TODO - remove comments, or replace 'submit' by 'submit.' + _id\n //if ( $form.withUserBindings && /validate\\./.test(event.type) && typeof(gina.events[event.type]) != 'undefined' ) {\n // triggerEvent(gina, event.target, 'submit', result)\n //} else {\n\n if (instance.$forms[_id]) {\n instance.$forms[_id].send(result['data']);\n } else if ($form) { // just in case the form is being destroyed\n $form.send(result['data']);\n }\n //}\n }\n\n return false\n\n })\n }\n\n if ( typeof(gina.events[evt]) != 'undefined' && gina.events[evt] == 'validate.' + _id ) {\n removeListener(gina, $form, evt, procced)\n } else {\n procced()\n }\n\n\n\n var proccedToSubmit = function (evt, $submit) {\n // console.log('placing submit ', evt, $submit);\n // attach submit events\n addListener(gina, $submit, evt, function(event) {\n // start validation\n cancelEvent(event);\n\n // getting fields & values\n var $fields = {}\n , fields = { '_length': 0 }\n , id = $target.getAttribute('id')\n , rules = ( typeof(gina.validator.$forms[id]) != 'undefined' ) ? gina.validator.$forms[id].rules : null\n , name = null\n , value = 0\n , type = null\n , index = { checkbox: 0, radio: 0 };\n\n\n for (var i = 0, len = $target.length; i<len; ++i) {\n\n name = $target[i].getAttribute('name');\n\n if (!name) continue;\n\n // TODO - add switch cases against tagName (checkbox/radio)\n if ( typeof($target[i].type) != 'undefined' && $target[i].type == 'radio' || typeof($target[i].type) != 'undefined' && $target[i].type == 'checkbox' ) {\n\n if ( $target[i].checked ) {\n fields[name] = $target[i].value\n } else if ( // force validator to pass `false` if boolean is required explicitly\n rules\n && typeof(rules[name]) != 'undefined'\n && typeof(rules[name].isBoolean)\n && typeof(rules[name].isRequired)\n ) {\n fields[name] = false;\n }\n\n } else {\n fields[name] = $target[i].value;\n }\n\n\n $fields[name] = $target[i];\n // reset filed error data attributes\n $fields[name].setAttribute('data-gina-form-errors', '');\n\n ++fields['_length']\n }\n\n //console.log('$fields =>\\n' + $fields);\n\n //instance.$forms[ $target.getAttribute('id') ].sent = false;\n\n if ( fields['_length'] == 0 ) { // nothing to validate\n delete fields['_length'];\n var result = {\n 'errors' : [],\n 'isValid' : function() { return true },\n 'data' : formatData(fields)\n };\n\n triggerEvent(gina, $target, 'validate.' + _id, result)\n\n } else {\n // update rule in case the current event is triggered outside the main sequence\n // e.g.: form `id` attribute rewritten on the fly\n _id = $target.getAttribute('id');\n var customRule = $target.getAttribute('data-gina-form-rule');\n\n if ( customRule ) { // 'data-gina-form-rule'\n rule = gina.validator.rules[ customRule.replace(/\\-/g, '.') ];\n } else {\n rule = gina.validator.$forms[ _id ].rules;\n }\n\n //console.log('testing rule [ '+_id.replace(/\\-/g, '.') +' ]\\n'+ JSON.stringify(rule, null, 4));\n //console.log('validating ', $form, fields, rule);\n validate($target, fields, $fields, rule, function onValidation(result){\n //console.log('validation result ', 'validate.' + _id, JSON.stringify(result.data, null, 2));\n //console.log('events ', 'validate.' + _id, self.events )\n triggerEvent(gina, $target, 'validate.' + _id, result)\n })\n }\n\n });\n }\n\n\n // binding submit button\n var $submit = null, $buttons = [], $buttonsTMP = [], buttonId = null;\n $buttonsTMP = $target.getElementsByTagName('button');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ($buttonsTMP[b].type == 'submit')\n $buttons.push($buttonsTMP[b])\n }\n }\n\n $buttonsTMP = $target.getElementsByTagName('a');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ( $buttonsTMP[b].attributes.getNamedItem('data-gina-form-submit'))\n $buttons.push($buttonsTMP[b])\n }\n }\n\n\n var onclickAttribute = null, isSubmitType = false;\n for (var b=0, len=$buttons.length; b<len; ++b) {\n\n $submit = $buttons[b];\n\n if ($submit.tagName == 'A') { // without this test, XHR callback is ignored\n //console.log('a#$buttons ', $buttonsTMP[b]);\n onclickAttribute = $submit.getAttribute('onclick');\n isSubmitType = $submit.getAttribute('data-gina-form-submit');\n\n if ( !onclickAttribute && !isSubmitType) {\n $submit.setAttribute('onclick', 'return false;')\n } else if ( !/return false/ && !isSubmitType) {\n if ( /\\;$/.test(onclickAttribute) ) {\n onclickAttribute += 'return false;'\n } else {\n onclickAttribute += '; return false;'\n }\n }\n }\n\n if (!$submit['id']) {\n\n evt = 'click.'+ uuid.v1();\n $submit['id'] = evt;\n $submit.setAttribute( 'id', evt);\n\n } else {\n evt = $submit['id'];\n }\n\n\n if ( typeof(gina.events[evt]) == 'undefined' || gina.events[evt] != $submit.id ) {\n proccedToSubmit(evt, $submit)\n }\n\n }\n }\n\n\n\n evt = 'submit';\n\n // submit proxy\n addListener(gina, $target, evt, function(e) {\n\n var $target = e.target\n , id = $target.getAttribute('id')\n , isBinded = instance.$forms[id].binded\n ;\n\n // prevent event to be triggered twice\n if ( typeof(e.defaultPrevented) != 'undefined' && e.defaultPrevented )\n return false;\n\n if (withRules || isBinded) {\n cancelEvent(e);\n }\n\n\n // just collect data for over forms\n // getting fields & values\n var $fields = {}\n , fields = { '_length': 0 }\n , id = $target.getAttribute('id')\n , rules = ( typeof(gina.validator.$forms[id]) != 'undefined' ) ? gina.validator.$forms[id].rules : null\n , name = null\n , value = 0\n , type = null\n , index = { checkbox: 0, radio: 0 };\n\n\n for (var i = 0, len = $target.length; i<len; ++i) {\n name = $target[i].getAttribute('name');\n\n if (!name) continue;\n\n // checkbox/radio\n if ( typeof($target[i].type) != 'undefined' && $target[i].type == 'radio' || typeof($target[i].type) != 'undefined' && $target[i].type == 'checkbox' ) {\n\n if ( $target[i].checked ) {\n fields[name] = $target[i].value\n } else if ( // force validator to pass `false` if boolean is required explicitly\n rules\n && typeof(rules[name]) != 'undefined'\n && typeof(rules[name].isBoolean)\n && typeof(rules[name].isRequired)\n ) {\n fields[name] = false;\n }\n\n } else {\n fields[name] = $target[i].value;\n }\n\n\n\n $fields[name] = $target[i];\n // reset filed error data attributes\n $fields[name].setAttribute('data-gina-form-errors', '');\n\n ++fields['_length']\n }\n\n\n if ( fields['_length'] == 0 ) { // nothing to validate\n\n delete fields['_length'];\n var result = {\n 'errors' : [],\n 'isValid' : function() { return true },\n 'data' : formatData(fields)\n };\n\n if ( typeof(gina.events['submit.' + id]) != 'undefined' ) { // if `on('submit', cb)` is binded\n triggerEvent(gina, $target, 'submit.' + id, result);\n } else {\n triggerEvent(gina, $target, 'validate.' + id, result);\n }\n\n } else {\n // update rule in case the current event is triggered outside the main sequence\n // e.g.: form `id` attribute rewritten on the fly\n //ruleId = id.replace(/-/g, '.');\n //if ( typeof(instance.$forms[id].rules) != 'undefined' )\n // rule = instance.$forms[id].rules;\n\n var customRule = $target.getAttribute('data-gina-form-rule');\n\n if ( customRule ) { // 'data-gina-form-rule'\n rule = gina.validator.rules[ customRule.replace(/\\-/g, '.') ];\n } else {\n rule = gina.validator.$forms[ id ].rules;\n }\n\n validate($target, fields, $fields, rule, function onValidation(result){\n if ( typeof(gina.events['submit.' + id]) != 'undefined' ) { // if `on('submit', cb)` is binded\n triggerEvent(gina, $target, 'submit.' + id, result);\n } else {\n triggerEvent(gina, $target, 'validate.' + id, result);\n }\n })\n }\n });\n\n instance.$forms[_id]['binded'] = true;\n }\n\n var setupInstanceProto = function() {\n\n instance.setOptions = setOptions;\n instance.getFormById = getFormById;\n instance.validateFormById = validateFormById;\n instance.target = document;\n instance.validateFormById = validateFormById;\n instance.resetErrorsDisplay = resetErrorsDisplay;\n instance.resetFields = resetFields;\n instance.handleErrorsDisplay = handleErrorsDisplay;\n instance.send = send;\n }\n\n if (isGFFCtx) {\n return init(rules)\n } else {\n return backendInit(rules, data, formId)\n }\n\n};\n\nif ( ( typeof(module) !== 'undefined' ) && module.exports ) {\n // Publish as node.js module\n module.exports = ValidatorPlugin\n} else if ( typeof(define) === 'function' && define.amd) {\n // Publish as AMD module\n define('gina/validator', [],function(){ return ValidatorPlugin })\n};\n",
|
|
37
|
-
"define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/events' ], function (require) {\n\n var $ = require('jquery');\n var uuid = require('vendor/uuid');\n var merge = require('utils/merge');\n\n require('utils/events'); // events\n\n /**\n * Gina Popin Handler\n *\n * @param {object} options\n * */\n function Popin(options) {\n\n this.plugin = 'popin';\n\n var events = ['loaded', 'ready', 'open', 'close', 'destroy', 'success', 'error', 'progress'];\n registerEvents(this.plugin, events);\n\n var self = { // local use only\n 'options' : {\n 'name' : undefined,\n 'class': 'gina-popin-default'\n },\n autorizedEvents : ['ready', 'error'],\n events: {}\n };\n\n var instance = {\n plugin : this.plugin,\n id : 'gina-popins-' + uuid.v1(),\n on : on,\n eventData : {},\n\n target : document, // by default\n isReady : false,\n initialized : false\n };\n\n // popin proto\n var $popin = { // is on main `gina-popins` container (first level)\n 'plugin' : this.plugin,\n 'on' : on,\n 'eventData' : {},\n 'target' : document, // by default\n\n 'name' : null,\n 'load' : null,\n 'loadContent' : null,\n 'open' : null,\n 'isOpen' : false,\n 'close' : null,\n '$forms' : []\n };\n\n var $validator = null; // validator instance\n\n\n // XML Request\n var xhr = null;\n\n var registeredPopins = [];\n\n\n /**\n * popinCreateContainer\n *\n * Creates HTML container and add it to the DOM\n *\n *\n * */\n var popinCreateContainer = function() {\n\n // creating template\n // <div class=\"gina-popins\">\n // <div class=\"gina-popins-overlay gina-popin-is-active\"></div>\n // </div>\n var $container = document.createElement('div');\n $container.id = instance.id;\n $container.setAttribute('id', instance.id);\n $container.setAttribute('class', 'gina-popins');\n\n var $overlay = document.createElement('div');\n $overlay.setAttribute('id', 'gina-popins-overlay');\n $overlay.setAttribute('class', 'gina-popins-overlay');\n\n\n $container.appendChild( $overlay );\n\n // adding to DOM\n document.body.appendChild($container);\n\n instance.target = $container;\n instance.on = on;\n\n gina.popinContainer = instance.id;\n gina.hasPopinHandler = true;\n }\n \n var popinGetContainer = function () {\n //instance.id = gina.popinContainer\n instance.target = document.getElementById(gina.popinContainer);\n instance.on = on;\n }\n\n var bindOpen = function() {\n var attr = 'data-gina-popin-name';\n var $els = getElementsByAttribute(attr);\n var $el = null, name = null;\n var url = null;\n var proceed = null, evt = null;\n\n\n for (var i = 0, len = $els.length; i < len; ++i) {\n $el = $els[i];\n name = $el.getAttribute(attr);\n if ( $el.tagName == 'A' ) {\n url = $el.getAttribute('href');\n if (url == '' || url =='#' || /\\#/.test(url) ) {\n url = null\n }\n }\n\n if ( !url && typeof( $el.getAttribute('data-gina-popin-url') ) != 'undefined') {\n url = $el.getAttribute('data-gina-popin-url');\n\n }\n\n if (!url) {\n throw new Error('Found `data-gina-popin-name` without `url` !')\n }\n\n if ( !$el['url'] ) {\n $el['url'] = url;\n }\n\n if ( !$el['popinName'] ) {\n $el['popinName'] = name;\n }\n\n if (name == $popin.name) {\n evt = 'popin.click.'+ 'gina-popin-' + instance.id +'-'+ uuid.v1() +'-'+ name;\n $el['id'] = evt;\n $el.setAttribute( 'id', evt);\n\n if (!gina.events[evt]) {\n //proceed = function () {\n // attach submit events\n addListener(gina, $el, evt, function(e) {\n cancelEvent(e);\n\n var fired = false;\n $popin.on('loaded', function (e) {\n e.preventDefault();\n\n if (!fired) {\n fired = true;\n\n e.target.innerHTML = e.detail;\n\n\n // bind with formValidator if forms are found\n if ( /<form/i.test(e.target.innerHTML) && typeof($validator) != 'undefined' ) {\n var _id = null;\n var $forms = e.target.getElementsByTagName('form');\n for (var i = 0, len = $forms.length; i < len; ++i) {\n\n if ( !$forms[i]['id'] || typeof($forms[i]) != 'string' ) {\n _id = $forms[i].getAttribute('id') || 'form.' + uuid.v1();\n $forms[i].setAttribute('id', _id);// just in case\n $forms[i]['id'] = _id\n } else {\n _id = $forms[i]['id']\n }\n\n //console.log('pushing ', _id, $forms[i]['id'], typeof($forms[i]['id']), $forms[i].getAttribute('id'));\n if ($popin['$forms'].indexOf(_id) < 0)\n $popin['$forms'].push(_id);\n\n $forms[i].close = popinClose;\n $validator.validateFormById($forms[i].getAttribute('id')) //$forms[i]['id']\n\n removeListener(gina, $popin.target, e.type);\n }\n }\n\n popinOpen($popin.name);\n }\n });\n\n // loading & binding popin\n popinLoad($popin.name, e.target.url);\n });\n }\n\n\n // if ( typeof(instance.events[evt]) != 'undefined' && instance.events[evt] == $el.id ) {\n // removeListener(gina, $el, evt, proceed);\n // delete instance.events[evt]\n // } else {\n // proceed()\n // }\n }\n\n }\n\n // proxies\n // click on main document\n evt = 'click';// click proxy\n // for proxies, use popinInstance.id as target is always `document`\n addListener(gina, document, evt, function(event) {\n\n if ( typeof(event.target.id) == 'undefined' ) {\n event.target.setAttribute('id', evt +'.'+ uuid.v1() );\n event.target.id = event.target.getAttribute('id')\n }\n\n if ( /^popin\\.close\\./.test(event.target.id) ) {\n cancelEvent(event);\n\n var _evt = event.target.id;\n\n triggerEvent(gina, event.target, _evt, event.detail);\n }\n\n if ( /^popin\\.click\\./.test(event.target.id) ) {\n cancelEvent(event);\n //console.log('popin.click !! ', event.target);\n var _evt = event.target.id;\n\n if ( new RegExp( '^popin.click.gina-popin-' + instance.id).test(_evt) )\n triggerEvent(gina, event.target, _evt, event.detail);\n\n }\n });\n\n gina.popinIsBindinded = true\n }\n\n\n\n /**\n * XML Request options\n * */\n var xhrOptions = {\n 'url' : '',\n 'method' : 'GET',\n 'isSynchrone' : false,\n 'withCredentials': true, // if should be enabled under a trusted env\n 'headers' : {\n // cross domain is enabled by default, but you need to setup `Access-Control-Allow-Origin`\n 'X-Requested-With': 'XMLHttpRequest' // in case of cross domain origin\n\n }\n };\n\n /**\n * popinLoad\n *\n * @param {string} name\n * @param {string} url\n * @param {object} [options]\n * */\n function popinLoad(name, url, options) {\n\n var id = 'gina-popin-' + instance.id +'-'+ name;\n\n // popin element\n var $el = document.getElementById(id) || null;\n\n if ( $el == null ) {\n\n var className = self.options.class +' '+ id;\n $el = document.createElement('div');\n $el.setAttribute('id', id);\n $el.setAttribute('class', className);\n instance.target.firstChild.appendChild($el);\n }\n\n if ( typeof(options) != 'undefined' ) {\n var options = merge(options, xhrOptions);\n } else {\n var options = xhrOptions;\n }\n\n options.url = url;\n\n\n if ( options.withCredentials ) {\n if ('withCredentials' in xhr) {\n // XHR for Chrome/Firefox/Opera/Safari.\n if (options.isSynchrone) {\n xhr.open(options.method, options.url, options.isSynchrone)\n } else {\n xhr.open(options.method, options.url)\n }\n } else if ( typeof XDomainRequest != 'undefined' ) {\n // XDomainRequest for IE.\n xhr = new XDomainRequest();\n xhr.open(options.method, options.url);\n } else {\n // CORS not supported.\n xhr = null;\n var result = 'CORS not supported: the server is missing the header `\"Access-Control-Allow-Credentials\": true` ';\n triggerEvent(gina, $el, 'error.' + id, result)\n }\n } else {\n if (options.isSynchrone) {\n xhr.open(options.method, options.url, options.isSynchrone)\n } else {\n xhr.open(options.method, options.url)\n }\n }\n\n // setting up headers\n for (var hearder in options.headers) {\n xhr.setRequestHeader(hearder, options.headers[hearder]);\n }\n\n if (xhr) {\n // catching ready state cb\n xhr.onreadystatechange = function (event) {\n if (xhr.readyState == 4) {\n // 200, 201, 201' etc ...\n if( /^2/.test(xhr.status) ) {\n\n try {\n var result = xhr.responseText;\n if ( /json$/.test( xhr.getResponseHeader(\"Content-Type\") ) ) {\n result = JSON.parse(xhr.responseText)\n }\n\n\n instance.eventData.success = result;\n\n triggerEvent(gina, $el, 'loaded.' + id, result);\n\n } catch (err) {\n var result = {\n 'status': 422,\n 'error' : err.description\n };\n\n instance.eventData.error = result;\n\n triggerEvent(gina, $el, 'error.' + id, result)\n }\n\n } else {\n //console.log('error event triggered ', event.target, $form);\n var result = {\n 'status': xhr.status,\n 'error' : xhr.responseText\n };\n\n instance.eventData.error = result;\n\n // update toolbar\n var XHRData = result;\n if ( gina && typeof(window.ginaToolbar) == \"object\" && XHRData ) {\n try {\n if ( XHRData.error && /^(\\{|\\[).test(XHRData.error) /)\n XHRData.error = JSON.parse(XHRData.error);\n\n // bad .. should not happen\n if ( typeof(XHRData.error.error) != 'undefined' )\n XHRData.error = XHRData.error.error;\n\n ginaToolbar.update(\"data-xhr\", XHRData )\n } catch (err) {\n throw err\n }\n }\n\n\n triggerEvent(gina, $el, 'error.' + id, result)\n }\n }\n };\n\n // catching request progress\n // xhr.onprogress = function(event) {\n // //console.log(\n // // 'progress position '+ event.position,\n // // '\\nprogress total size '+ event.totalSize\n // //);\n //\n // var percentComplete = (event.position / event.totalSize)*100;\n // var result = {\n // 'status': 100,\n // 'progress': percentComplete\n // };\n //\n // instance.eventData.onprogress = result;\n //\n // triggerEvent(gina, $el, 'progress.' + id, result)\n // };\n\n // catching timeout\n // xhr.ontimeout = function (event) {\n // var result = {\n // 'status': 408,\n // 'error': 'Request Timeout'\n // };\n //\n // instance.eventData.ontimeout = result;\n //\n // triggerEvent(gina, $el, 'error.' + id, result)\n // };\n\n\n // sending\n xhr.send();\n\n return {\n 'open': function () {\n var fired = false;\n addListener(gina, $el, 'loaded.' + id, function(e) {\n //$popin.on('loaded', function (e) {\n e.preventDefault();\n\n if (!fired) {\n fired = true;\n\n e.target.innerHTML = e.detail;\n\n\n // bind with formValidator if forms are found\n if ( /<form/i.test(e.target.innerHTML) && typeof($validator) != 'undefined' ) {\n var _id = null;\n var $forms = e.target.getElementsByTagName('form');\n for (var i = 0, len = $forms.length; i < len; ++i) {\n\n if ( !$forms[i]['id'] || typeof($forms[i]) != 'string' ) {\n _id = $forms[i].getAttribute('id') || 'form.' + uuid.v1();\n $forms[i].setAttribute('id', _id);// just in case\n $forms[i]['id'] = _id\n } else {\n _id = $forms[i]['id']\n }\n\n //console.log('pushing ', _id, $forms[i]['id'], typeof($forms[i]['id']), $forms[i].getAttribute('id'));\n if ($popin['$forms'].indexOf(_id) < 0)\n $popin['$forms'].push(_id);\n\n $forms[i].close = popinClose;\n $validator.validateFormById($forms[i].getAttribute('id')) //$forms[i]['id']\n\n removeListener(gina, $popin.target, e.type);\n }\n }\n\n popinOpen($popin.name);\n }\n });\n }\n }\n }\n\n }\n\n function popinLoadContent() {\n\n }\n\n /**\n * popinOpen\n *\n * Opens a popin by name\n *\n * @parama {string} name\n *\n * */\n function popinOpen(name) {\n\n // bind overlay on click\n var $overlay = instance.target.childNodes[0];\n\n addListener(gina, $overlay, 'click', function(event) {\n\n // don't cancel here, it will corrupt child elements behaviors such as checkboxes and radio buttons\n\n if ( /gina-popin-is-active/.test(event.target.className) ) {\n\n\n // remove listeners\n removeListener(gina, event.target, 'click');\n\n // binding popin close\n var $close = [], $buttonsTMP = [];\n\n $buttonsTMP = $el.getElementsByTagName('button');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ( /gina-popin-close/.test($buttonsTMP[b].className) )\n $close.push($buttonsTMP[b])\n }\n }\n\n $buttonsTMP = $el.getElementsByTagName('div');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ( /gina-popin-close/.test($buttonsTMP[b].className) )\n $close.push($buttonsTMP[b])\n }\n }\n\n $buttonsTMP = $el.getElementsByTagName('a');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ( /gina-popin-close/.test($buttonsTMP[b].className) )\n $close.push($buttonsTMP[b])\n }\n }\n\n for (var b = 0, len = $close.length; b < len; ++b) {\n removeListener(gina, $close[b], $close[b].getAttribute('id') )\n }\n\n popinClose(name);\n }\n });\n\n\n var id = null, $el = null;\n if ( typeof(name) == 'string' && name != '' ) {\n id = 'gina-popin-' + instance.id +'-'+ name;\n if (id !== $popin.id)\n throw new Error('Popin `'+name+'` not found !')\n } else if ( typeof(name) == 'undefined' ) {\n id = $popin.id\n }\n\n $el = document.getElementById(id);\n\n if ( !/gina-popin-is-active/.test($el.className) )\n $el.className += ' gina-popin-is-active';\n\n if ( !/gina-popin-is-active/.test(instance.target.firstChild.className) )\n instance.target.firstChild.className += ' gina-popin-is-active';\n\n // binding popin close\n var $close = [], $buttonsTMP = [];\n\n $buttonsTMP = $el.getElementsByTagName('button');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ( /gina-popin-close/.test($buttonsTMP[b].className) )\n $close.push($buttonsTMP[b])\n }\n }\n\n $buttonsTMP = $el.getElementsByTagName('div');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ( /gina-popin-close/.test($buttonsTMP[b].className) )\n $close.push($buttonsTMP[b])\n }\n }\n\n $buttonsTMP = $el.getElementsByTagName('a');\n if ( $buttonsTMP.length > 0 ) {\n for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {\n if ( /gina-popin-close/.test($buttonsTMP[b].className) )\n $close.push($buttonsTMP[b])\n }\n }\n var onclickAttribute = null, evt = null;\n for (var b = 0, len = $close.length; b < len; ++b) {\n if ($close[b].tagName == 'A') {\n onclickAttribute = $close[b].getAttribute('onclick');\n }\n\n if ( !onclickAttribute ) {\n $close[b].setAttribute('onclick', 'return false;')\n } else if ( !/return false/) {\n if ( /\\;$/.test(onclickAttribute) ) {\n onclickAttribute += 'return false;'\n } else {\n onclickAttribute += '; return false;'\n }\n }\n\n if (!$close[b]['id']) {\n\n evt = 'popin.close.'+ uuid.v1();\n $close[b]['id'] = evt;\n $close[b].setAttribute( 'id', evt);\n\n } else {\n evt = $close[b]['id'];\n }\n\n var register = function (evt, $close) {\n // attach submit events\n addListener(gina, $close, evt, function(event) {\n\n cancelEvent(event);\n\n popinClose(name);\n removeListener(gina, event.target, event.type)\n });\n }\n\n\n if ( typeof(gina.events[evt]) == 'undefined' || gina.events[evt] != $close[b].id ) {\n register(evt, $close[b])\n }\n }\n\n\n if ( /gina-popin-is-active/.test(event.target.className) ) {\n removeListener(gina, event.target, event.target.getAttribute('id'))\n }\n\n $popin.isOpen = true;\n // so it can be forwarded to the handler who is listening\n $popin.target = $el;\n\n // update toolbar\n var XHRData = document.getElementById('gina-without-layout-xhr-data');\n if ( gina && typeof(window.ginaToolbar) == \"object\" && XHRData ) {\n try {\n\n if ( typeof(XHRData.value) != 'undefined' && XHRData.value ) {\n XHRData = JSON.parse( decodeURIComponent( XHRData.value ) );\n // reset data-xhr\n ginaToolbar.update(\"data-xhr\", null);\n\n ginaToolbar.update(\"data-xhr\", XHRData);\n }\n\n } catch (err) {\n throw err\n }\n }\n\n triggerEvent(gina, instance.target, 'open.'+ $popin.id, $popin);\n }\n\n\n /**\n * popinClose\n *\n * Closes a popin by `name` or all `is-active`\n *\n * @parama {string} [name]\n *\n * */\n function popinClose(name) {\n var id = null, $el = null;\n if ( typeof(name) == 'string' && name != '' ) {\n if (name !== $popin.name)\n throw new Error('Popin `'+name+'` not found !');\n }\n // by default\n id = $popin.id;\n\n $el = $popin.target;\n\n if ( $el != null && /gina-popin-is-active/.test($el.className) ) {\n instance.target.firstChild.className = instance.target.firstChild.className.replace(/\\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\\s/, '');\n $el.className = $el.className.replace(/\\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\\s/, '');\n $el.innerHTML = '';\n\n // removing from FormValidator instance\n var i = 0, formsLength = $popin['$forms'].length;\n if ($validator['$forms'] && formsLength > 0) {\n for (; i < formsLength; ++i) {\n $validator['$forms'][ $popin['$forms'][i] ].destroy();\n $popin['$forms'].splice( i, 1);\n }\n }\n // remove listeners\n removeListener(gina, $popin.target, 'loaded.' + $popin.id);\n\n\n\n\n $popin.isOpen = false;\n\n // restore toolbar\n if ( gina && typeof(window.ginaToolbar) == \"object\" )\n ginaToolbar.restore();\n\n triggerEvent(gina, $popin.target, 'close.'+ id, $popin);\n }\n }\n\n /**\n * popinDestroy\n *\n * Destroyes a popin by name\n *\n * @parama {string} name\n *\n * */\n function popinDestroy(name) {\n var id = null, $el = null;\n if ( typeof(name) == 'string' && name != '' ) {\n id = 'gina-popin-' + instance.id +'-'+ name;\n if (id !== $popin.id)\n throw new Error('Popin `'+name+'` not found !')\n } else if ( typeof(name) == 'undefined' ) {\n id = $popin.id\n }\n }\n\n var init = function(options) {\n\n instance.on('init', function(event) {\n\n if ( typeof(options) != 'object' ) {\n throw new Error('`options` must be an object')\n }\n\n self.options = merge(options, self.options);\n\n if ( typeof(self.options['name']) != 'string' || self.options['name'] == '' ) {\n throw new Error('`options.name` can not be left `empty` or `undefined`')\n }\n\n if ( registeredPopins.indexOf(self.options['name']) > -1 ) {\n throw new Error('`popin '+self.options['name']+'` already exists !')\n }\n\n if ( typeof(self.options['validator']) != 'undefined' ) {\n $validator = self.options['validator']\n }\n\n self.options['class'] = 'gina-popin-container ' + self.options['class'];\n\n $popin.id = 'gina-popin-' + instance.id +'-'+ self.options['name'];\n $popin.name = self.options['name'];\n $popin.load = popinLoad;\n $popin.loadContent = popinLoadContent;\n $popin.open = popinOpen;\n $popin.close = popinClose;\n\n if ( typeof($validator) != 'undefined' )\n $popin.validateFormById = $validator.validateFormById;\n\n // setting up AJAX\n if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n xhr = new XMLHttpRequest();\n } else if (window.ActiveXObject) { // IE\n try {\n xhr = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n catch (e) {}\n }\n }\n\n bindOpen();\n\n instance.isReady = true;\n\n // trigger validator ready event\n triggerEvent(gina, instance.target, 'ready.' + instance.id, $popin);\n });\n\n instance.initialized = true;\n\n return instance\n }\n\n\n\n if ( !gina.hasPopinHandler ) {\n popinCreateContainer();\n } else {\n popinGetContainer()\n }\n\n return init(options)\n };\n\n return Popin\n});\n",
|
|
38
|
-
"/**\n * Operations on selectors\n * */\n\nfunction insertAfter(referenceNode, newNode) {\n //console.log('inserting after ',referenceNode, newNode, referenceNode.nextSibling);\n referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n\n}\n\nfunction getElementsByAttribute(attribute) {\n var matching = [], m = 0;\n var els = document.getElementsByTagName('*');\n\n for (var i = 0, n = els.length; i < n; ++i) {\n if (els[i].getAttribute(attribute) !== null) {\n // Element exists with attribute. Add to array.\n matching[m] = els[i];\n ++m\n }\n }\n\n return matching\n};\ndefine(\"utils/dom\", function(){});\n\n",
|
|
39
|
-
"/**\n * FormValidatorUtil\n *\n * Dependencies:\n * - utils/merge\n * - utils/helpers\n * - utils/helpers/dateFormat\n *\n * @param {object} data\n * @param {object} [ $fields ] - isGFFCtx only\n * */\nfunction FormValidatorUtil(data, $fields) {\n\n var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;\n\n if (isGFFCtx && !$fields )\n throw new Error('No `Validator` instance found.\\nTry:\\nvar FormValidator = require(\"gina/validator\"):\\nvar formValidator = new FormValidator(...);')\n\n var merge = (isGFFCtx) ? require('utils/merge') : require('../../../../utils/lib/merge');\n var helpers = (isGFFCtx) ? {} : require('../../../../utils/helpers');\n var dateFormat = (isGFFCtx) ? require('helpers/dateFormat') : helpers.dateFormat;\n\n var local = {\n 'errors': {},\n 'keys': {\n '%l': 'label', // %l => label: needs `data-gina-form-field-label` attribute (frontend only)\n '%n': 'name', // %n => field name\n '%s': 'size' // %s => length\n },\n 'errorLabels': {},\n 'data': {}, // output to send\n 'excluded': []\n };\n\n local.errorLabels = {\n 'is': 'Condition not satisfied',\n 'isEmail': 'A valid email is required',\n 'isRequired': 'Cannot be left empty',\n 'isBoolean': 'Must be a valid boolean',\n 'isNumber': 'Must be a number: allowed values are integers or floats',\n 'isNumberLength': 'Must contain %s characters',\n 'isNumberMinLength': 'Should be at least %s characters',\n 'isNumberMaxLength': 'Should not be more than %s characters',\n 'isInteger': 'Must be an integer',\n 'isIntegerLength': 'Must have %s characters',\n 'isIntegerMinLength': 'Should be at least %s characters',\n 'isIntegerMaxLength': 'Should not be more than %s characters',\n 'toInteger': 'Could not be converted to integer',\n 'isFloat': 'Must be a proper float',\n 'isFloatException': 'Float exception found: %n',\n 'toFloat': 'Could not be converted to float',\n 'toFloatNAN': 'Value must be a valid number',\n 'isDate': 'Must be a valid Date',\n 'isString': 'Must be a string',\n 'isStringLength': 'Must have %s characters',\n 'isStringMinLength': 'Should be at least %s characters',\n 'isStringMaxLength': 'Should not be more than %s characters'\n };\n\n if (!data) {\n throw new Error('missing data param')\n } else {\n // cloning\n var self = JSON.parse( JSON.stringify(data) );\n local.data = JSON.parse( JSON.stringify(data) )\n }\n\n\n var val = null, label = null;\n for (var el in self) {\n\n if ( typeof(self[el]) == 'object' ) {\n try {\n val = JSON.parse( JSON.stringify( self[el] ))\n } catch (err) {\n val = self[el]\n }\n } else {\n val = self[el]\n }\n\n label = '';\n if ( isGFFCtx && typeof($fields) != 'undefined' ) { // frontend only\n label = $fields[el].getAttribute('data-gina-form-field-label') || '';\n }\n\n // keys are stringyfied because of the compiler !!!\n self[el] = {\n 'target': (isGFFCtx) ? $fields[el] : null,\n 'name': el,\n 'value': val,\n 'valid': false,\n // is name by default, but you should use setLabe(name) to change it if you need to\n 'label': label,\n // check as field to exclude while sending datas to the model\n 'exclude': false\n };\n\n /**\n *\n * is(condition) -> validate if value matches `condition`\n *\n * When entered in a JSON rule, you must double the backslashes\n *\n * e.g.:\n * \"/\\\\D+/\" -> like [^0-9]\n * \"/^[0-9]+$/\" -> only numbers\n * \"$field === $fieldOther\" -> will be evaluated\n *\n * @param {object|string} condition - RegExp object, or condition to eval, or eval result\n * @param {string} [errorMessage] - error message\n * @param {string} [errorStack] - error stack\n *\n * */\n self[el]['is'] = function(condition, errorMessage, errorStack) {\n var valid = false;\n var errors = {};\n\n if ( /\\$[-_\\[\\]a-z 0-9]+/i.test(condition) ) {\n\n var variables = condition.match(/\\${0}[-_\\[\\]a-z0-9]+/ig); // without space(s)\n var compiledCondition = condition;\n var re = null\n for (var i = 0, len = variables.length; i < len; ++i) {\n if (variables[i]) {\n re = new RegExp(\"\\\\$\"+ variables[i] +\"(?!\\\\S+)\", \"g\");\n if ( self[ variables[i] ].value == \"\" ) {\n compiledCondition = compiledCondition.replace(re, '\"');\n } else if ( typeof(self[ variables[i] ].value) == 'string' ) {\n compiledCondition = compiledCondition.replace(re, '\"'+ self[ variables[i] ].value +'\"');\n } else {\n compiledCondition = compiledCondition.replace(re, self[ variables[i] ].value);\n }\n }\n }\n\n try {\n // security checks\n compiledCondition = compiledCondition.replace(/(\\(|\\)|return)/g, '');\n valid = eval(compiledCondition)\n } catch (err) {\n throw new Error(err.stack||err.message)\n }\n } else if ( condition instanceof RegExp ) {\n\n valid = condition.test(this.value) ? true : false;\n\n } else if( typeof(condition) == 'boolean') {\n\n valid = (condition) ? true : false;\n\n } else {\n try {\n // TODO - motif /gi to pass to the second argument\n valid = new RegExp(condition.replace(/\\//g, '')).test(this.value)\n } catch (err) {\n throw new Error(err.stack||err.message)\n }\n }\n\n if (!valid) {\n errors['is'] = replace(this.error || errorMessage || local.errorLabels['is'], this);\n if ( typeof(errorStack) != 'undefined' )\n errors['stack'] = errorStack;\n }\n\n this.valid = valid;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this.name]\n }\n\n self[el]['isEmail'] = function() {\n\n\n this.value = local['data'][this.name] = this.value.toLowerCase();\n\n var rgx = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n var isValid = rgx.test(this['value']) ? true : false;\n var errors = self[this['name']]['errors'] || {};\n\n if ( !errors['isRequired'] && this.value == '' ) {\n isValid = true;\n }\n\n if (!isValid) {\n errors['isEmail'] = replace(this['error'] || local.errorLabels['isEmail'], this)\n }\n\n this.valid = isValid;\n\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this['name']]\n }\n\n /**\n * Check if boolean and convert to `true/false` booloean if value is a string or a number\n * Will include `false` value if isRequired\n * */\n self[el]['isBoolean'] = function() {\n var val = null\n , errors = self[this['name']]['errors'] || {}\n ;\n\n if ( errors['isRequired'] && this.value == false ) {\n isValid = true;\n delete errors['isRequired'];\n this['errors'] = errors;\n }\n\n switch(this.value) {\n case 'true':\n case true:\n case 1:\n val = this.value = local.data[this.name] = true;\n break;\n case 'false':\n case false:\n case 0:\n val = this.value = local.data[this.name] = false;\n break;\n }\n var valid = (val !== null) ? true : false;\n\n if (!valid) {\n errors['isBoolean'] = replace(this.error || local.errorLabels['isBoolean'], this)\n }\n\n this.valid = valid;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this.name]\n }\n\n /**\n * Check if value is an a Number.\n * - valid if a number is found\n * - cast into a number if a string is found\n * - if string is blank, no transformation will be done: valid if not required\n *\n * @param {number} minLength\n * @param {number} maxLength\n *\n * @return {object} result\n * */\n self[el]['isNumber'] = function(minLength, maxLength) {\n var val = this.value\n , len = 0\n , isValid = false\n , isMinLength = true\n , isMaxLength = true\n , errors = {}\n ;\n\n\n // test if val is a number\n try {\n // if val is a string replaces comas by points\n if ( typeof(val) == 'string' && /,/g.test(val) ) {\n val = this.value = parseFloat( val.replace(/,/g, '.').replace(/\\s+/g, '') );\n } else if ( typeof(val) == 'string' && val != '') {\n val = this.value = parseInt( val );\n }\n\n } catch (err) {\n errors['isNumber'] = replace(this.error || local.errorLabels['isNumber'], this);\n this.valid = false;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n }\n\n if ( +val === +val ) {\n isValid = true;\n if ( !errors['isRequired'] && val != '' ) {\n len = val.toString().length;\n // if so also test max and min length if defined\n if (minLength && typeof(minLength) == 'number' && len < minLength) {\n isMinLength = false;\n this['size'] = minLength;\n }\n if (maxLength && typeof(maxLength) == 'number' && len > maxLength) {\n isMaxLength = false;\n this['size'] = maxLength;\n }\n }\n }\n\n // if val is invalid return error message\n if ( !isValid || !isMinLength || !isMaxLength ) {\n\n if ( !isValid )\n errors['isNumber'] = replace(this.error || local.errorLabels['isNumber'], this);\n if ( !isMinLength || !isMaxLength ) {\n if ( !isMinLength )\n errors['isNumberLength'] = replace(this.error || local.errorLabels['isNumberMinLength'], this);\n if ( !isMaxLength )\n errors['isNumberLength'] = replace(this.error || local.errorLabels['isNumberMaxLength'], this);\n if ( minLength === maxLength )\n errors['isNumberLength'] = replace(this.error || local.errorLabels['isNumberLength'], this);\n }\n\n isValid = false;\n }\n\n this.valid = isValid;\n val = this.value = local.data[this.name] = ( val != '' ) ? Number(val) : val;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this.name]\n }\n\n self[el]['toInteger'] = function() {\n var val = this.value, errors = {};\n\n if (!val) {\n return self[this.name]\n } else {\n try {\n //val = this.value = local.data[this.name] = ~~(val.match(/[0-9]+/g).join(''));\n val = this.value = local.data[this.name] = Math.round(val);\n } catch (err) {\n\n errors['toInteger'] = replace(this.error || local.errorLabels['toInteger'], this);\n this.valid = false;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n }\n\n }\n\n return self[this.name]\n }\n\n self[el]['isInteger'] = function(minLength, maxLength) {\n var val = this.value\n , isValid = false\n , isMinLength = true\n , isMaxLength = true\n , errors = {}\n ;\n\n // test if val is a number\n if ( +val === +val && val % 1 === 0 ) {\n isValid = true;\n if ( !errors['isRequired'] && val != '' ) {\n // if so also test max and min length if defined\n if (minLength && typeof(minLength) == 'number' && val.length < minLength) {\n isMinLength = false;\n this['size'] = minLength;\n }\n if (maxLength && typeof(maxLength) == 'number' && val.length > maxLength) {\n isMaxLength = false;\n this['size'] = maxLength;\n }\n }\n }\n // if val is invalid return error message\n if ( !isValid || !isMinLength || !isMaxLength ) {\n\n if ( !isValid )\n errors['isInteger'] = replace(this.error || local.errorLabels['isInteger'], this);\n\n if ( !isMinLength || !isMaxLength ) {\n\n if ( !isMinLength ) {\n errors['isIntegerLength'] = replace(this.error || local.errorLabels['isIntegerMinLength'], this);\n isValid = false;\n }\n\n if ( !isMaxLength ) {\n errors['isIntegerLength'] = replace(this.error || local.errorLabels['isIntegerMaxLength'], this);\n isValid = false;\n }\n\n if ( minLength === maxLength ) {\n errors['isIntegerLength'] = replace(this.error || local.errorLabels['isIntegerLength'], this);\n isValid = false;\n }\n }\n }\n\n this.valid = isValid;\n val = this.value = local.data[this.name] = Number(val);\n\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this.name]\n }\n\n\n self[el]['toFloat'] = function(decimals) {\n if ( typeof(this.value) == 'string' ) {\n this.value = this.value.replace(/\\s+/g, '');\n }\n\n var val = this.value, errors = {}, isValid = true;\n\n if (decimals) {\n this['decimals'] = parseInt(decimals)\n } else if ( typeof(this['decimals']) == 'undefined' ) {\n this['decimals'] = 2\n }\n\n if (!val) {\n return self[this.name]\n } else {\n if ( this['isNumber']().valid ) {\n try {\n\n if ( !Number.isFinite(val) ) {\n val = this.value = local.data[this.name] = new Number(parseFloat(val.match(/[0-9.,]+/g).join('').replace(/,/, '.')));// Number <> number\n }\n\n this.target.setAttribute('value', val);\n } catch(err) {\n isValid = false;\n errors['toFloat'] = replace(this.error || local.errorLabels['toFloat'], this);\n this.valid = false;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n }\n } else {\n isValid = false;\n errors['toFloat'] = replace(this.error || local.errorLabels['toFloatNAN'], this)\n }\n }\n\n if (this['decimals'] && val && !errors['toFloat']) {\n this.value = local.data[this.name] = parseFloat(this.value.toFixed(this['decimals']));\n }\n\n this.valid = isValid;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this.name]\n }\n\n /**\n * Check if value is float. No transformation is done here.\n * Can be used in combo preceded by *.toFloat(2) to transform data if needed:\n * 1 => 1.0\n * or\n * 3 500,5 => 3500.50\n *\n *\n * @param {number} [ decimals ]\n *\n * TODO - decimals transformation\n * */\n self[el]['isFloat'] = function(decimals) {\n\n if ( typeof(this.value) == 'string' ) {\n this.value = this.value.replace(/\\s+/g, '');\n }\n\n var val = this.value\n , isValid = false\n , errors = {};\n\n\n if ( typeof(val) == 'string' && /\\./.test(val) && Number.isFinite( Number(val) ) ) {\n isValid = true\n }\n\n // if string replaces comas by points\n if (typeof(val) == 'string' && /,/g.test(val)) {\n val = this.value = local.data[this.name] = Number(val.replace(/,/g, '.'))\n }\n\n // test if val is strictly a float\n if ( Number(val) === val && val % 1 !== 0 ) {\n this.value = local.data[this.name] = Number(val);\n isValid = true\n } else {\n isValid = false\n }\n\n if ( !errors['isRequired'] && this.value == '' ) {\n isValid = true\n }\n\n if (!isValid) {\n errors['isFloat'] = replace(this.error || local.errorLabels['isFloat'], this)\n }\n\n this.valid = isValid;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this.name]\n }\n\n self[el]['isRequired'] = function(isApplicable) {\n\n if ( typeof(isApplicable) == 'boolean' && !isApplicable ) {\n\n this.valid = true;\n\n return self[this.name]\n }\n\n // radio group case\n if ( isGFFCtx && this.target.tagName == 'INPUT' && typeof(this.target.type) != 'undefined' && this.target.type == 'radio' ) {\n var radios = document.getElementsByName(this.name);\n for (var i = 0, len = radios.length; i < len; ++i) {\n if (radios[i].checked) {\n if ( /true|false/.test(radios[i].value) ) {\n this.value = local.data[this.name] = ( /true/.test(radios[i].value) ) ? true : false\n } else {\n this.value = local.data[this.name] = radios[i].value;\n }\n\n this.valid = true;\n break;\n }\n }\n }\n\n\n var isValid = ( typeof(this.value) != 'undefined' && this.value != null && this.value != '') ? true : false;\n var errors = {};\n\n\n if (!isValid) {\n errors['isRequired'] = replace(this.error || local.errorLabels['isRequired'], this)\n }\n\n this.valid = isValid;\n if (errors.count() > 0)\n this['errors'] = errors;\n\n return self[this.name]\n }\n /**\n *\n * isString() -> validate if value is string\n * isString(10) -> validate if value is at least 10 chars length\n * isString(0, 45) -> no minimum length, but validate if value is maximum 45 chars length\n *\n * @param {number|undefined} [ minLength ]\n * @param {number} [ maxLength ]\n * */\n self[el]['isString'] = function(minLength, maxLength) {\n\n var val = this.value\n , isValid = false\n , isMinLength = true\n , isMaxLength = true\n , errors = {}\n ;\n\n\n // test if val is a string\n if ( typeof(val) == 'string' ) {\n isValid = true;\n\n if ( !errors['isRequired'] && val != '' ) {\n // if so also test max and min length if defined\n if (minLength && typeof(minLength) == 'number' && val.length < minLength) {\n isMinLength = false;\n this['size'] = minLength;\n }\n if (maxLength && typeof(maxLength) == 'number' && val.length > maxLength) {\n isMaxLength = false;\n this['size'] = maxLength;\n }\n }\n\n }\n\n // if val is invalid return error message\n if (!isValid || !isMinLength || !isMaxLength ) {\n\n if (!isValid && errors['isRequired'] && val == '') {\n isValid = false;\n errors['isString'] = replace(this['error'] || local.errorLabels['isString'], this);\n } else if (!isValid && !errors['isRequired']) {\n isValid = true;\n }\n\n if ( !isMinLength || !isMaxLength) {\n isValid = false;\n\n if ( !isMinLength )\n errors['isStringLength'] = replace(this['error'] || local.errorLabels['isStringMinLength'], this);\n if ( !isMaxLength )\n errors['isStringLength'] = replace(this['error'] || local.errorLabels['isStringMaxLength'], this);\n if (minLength === maxLength)\n errors['isStringLength'] = replace(this['error'] || local.errorLabels['isStringLength'], this);\n }\n\n }\n\n this.valid = isValid;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n\n return self[this.name]\n }\n\n /**\n * Check if date\n *\n * @param {string} [mask] - by default \"yyyy-mm-dd\"\n *\n * @return {date} date - extended by gina::utils::dateFormat; an adaptation of Steven Levithan's code\n * */\n self[el]['isDate'] = function(mask) {\n var val = this.value\n , isValid = false\n , errors = {}\n ;\n if (!val) return self[this.name];\n\n var m = mask.match(/[^\\/\\- ]+/g);\n val = val.match(/[^\\/\\- ]+/g);\n var dic = {}, d, len;\n for (d=0, len=m.length; d<len; ++d) {\n dic[m[d]] = val[d]\n }\n var newMask = 'yyyy-mm-dd';\n for (var v in dic) {\n newMask = newMask.replace(new RegExp(v, \"g\"), dic[v])\n }\n\n var date = this.value = local.data[this.name] = new Date(newMask);\n\n if ( date instanceof Date ) {\n isValid = true;\n } else {\n if ( !errors['isRequired'] && this.value == '' ) {\n isValid = true\n } else {\n errors['isDate'] = replace(this.error || local.errorLabels['isDate'], this);\n }\n\n this.valid = isValid;\n if ( errors.count() > 0 )\n this['errors'] = errors;\n\n return self[this.name]\n }\n\n this.valid = isValid;\n\n return date\n }\n\n /**\n * Formating date using DateFormatHelper\n * Check out documentation in the helper source: `utils/helpers/dateFormat.js`\n * e.g.:\n * d.start\n * .isDate('dd/mm/yyyy')\n * .format('isoDateTime');\n *\n *\n * */\n self[el]['format'] = function(mask, utc) {\n var val = this.value;\n if (!val) return self[this.name];\n\n return val.format(mask, utc)\n };\n\n /**\n * Set flash\n *\n * @param {str} flash\n * */\n self[el]['setFlash'] = function(regex, flash) {\n if ( typeof(flash) != 'undefined' && flash != '') {\n this.error = flash\n }\n return self[this.name]\n }\n\n /**\n * Set label\n *\n * @param {str} label\n * */\n self[el]['setLabel'] = function(label) {\n if ( typeof(label) != 'undefined' && label != '') {\n this.label = label\n }\n return self[this.name]\n }\n\n /**\n * Exclude when converting back to datas\n *\n * @return {object} data\n * */\n self[el]['exclude'] = function(isApplicable) {\n\n if ( typeof(isApplicable) == 'boolean' && !isApplicable ) {\n\n local.data[this.name] = this.value;\n\n return self[this.name]\n }\n\n // list field to be purged\n local.excluded.push(this.name);\n }\n\n } // EO for (var el in self)\n\n /**\n * Check if errors found during validation\n *\n * @return {boolean}\n * */\n self['isValid'] = function() {\n\n var i = self['getErrors']().count();\n var valid = true;\n\n if (i > 0) {\n valid = false;\n }\n\n return valid\n }\n\n self['getErrors'] = function() {\n var errors = {};\n\n for (var field in self) {\n if ( typeof(self[field]) != 'function' && typeof(self[field]['errors']) != 'undefined' ) {\n if ( self[field]['errors'].count() > 0)\n errors[field] = self[field]['errors'];\n }\n }\n\n return errors\n }\n\n self['toData'] = function() {\n\n // cleaning data\n if (local.excluded.length > 0) {\n for (var i = 0, len = local.excluded.length; i < len; ++i) {\n if ( typeof(local.data[ local.excluded[i] ]) != 'undefined' ) {\n delete local.data[ local.excluded[i] ]\n }\n }\n }\n\n return local.data\n }\n\n var replace = function(target, fieldObj) {\n var keys = target.match(/%[a-z]+/gi);\n if (keys) {\n for (var k = 0, len = keys.length; k < len; ++k) {\n target = target.replace(new RegExp(keys[k], 'g'), fieldObj[local.keys[keys[k]]])\n }\n }\n\n return target\n }\n\n self['setErrorLabels'] = function (errorLabels) {\n if ( typeof(errorLabels) != 'undefined') {\n local.errorLabels = merge(errorLabels, local.errorLabels)\n }\n }\n\n return self\n};\n\nif ( ( typeof(module) !== 'undefined' ) && module.exports ) {\n // Publish as node.js module\n module.exports = FormValidatorUtil\n} else if ( typeof(define) === 'function' && define.amd) {\n // Publish as AMD module\n define('utils/form-validator',[],function() { return FormValidatorUtil })\n};\n",
|
|
40
|
-
"/**\n * Gina Frontend Framework\n *\n * Usage:\n * By adding gina tag in the end of the DOM ( just before </body>)\n *\n * <script type=\"text/javascript\" src=\"/js/vendor/gina/gina.min.js\"></script>\n *\n * You can add options through the `data-options`\n * <script type=\"text/javascript\" src=\"/js/vendor/gina/gina.min.js\" data-options=\"{ env: 'dev', webroot: '/' }\"></script>\n *\n * Through RequireJS\n *\n * var gina = require('gina');\n *\n * Useful Globals\n *\n * window['originalContext']\n * - passe your `jQuery` or your `DollarDom` context to Gina\n *\n * */\n\nvar readyList = [ { name: 'gina', ctx: window['gina'], fn: onGinaLoaded } ];\nvar readyFired = false;\nvar readyEventHandlersInstalled = false;\n\n// call this when the document is ready\n// this function protects itself against being called more than once\nfunction ready() {\n\n if (!readyFired) {\n\n // this must be set to true before we start calling callbacks\n readyFired = true;\n var result = null;\n var i = i || 0;\n\n var handleEvent = function (i, readyList) {\n\n if ( readyList[i] ) {\n\n if (readyList[i].name == 'gina') {\n\n var scheduler = window.setInterval(function (i, readyList) {\n try {\n\n readyList[i].ctx = window.gina;\n result = readyList[i].fn.call(window, readyList[i].ctx);\n\n // clear\n if (result) {\n window.clearInterval(scheduler);\n ++i;\n handleEvent(i, readyList)\n }\n } catch (err) {\n window.clearInterval(scheduler);\n throw err\n }\n\n }, 50, i, readyList);\n\n\n } else {\n readyList[i].fn.call(window, readyList[i].ctx);\n ++i;\n handleEvent(i, readyList)\n }\n\n } else { // end\n // allow any closures held by these functions to free\n readyList = [];\n }\n }\n\n handleEvent(i, readyList)\n }\n}\n\nfunction readyStateChange() {\n if ( document.readyState === 'complete' ) {\n gina.ready();\n }\n}\n\n\nif ( typeof(window['gina']) == 'undefined' ) {// could have be defined by loader\n\n var gina = {\n /**\n * ready\n * This is the one public interface use to wrap `handlers`\n * It is an equivalent of jQuery(document).ready(cb)\n *\n * No need to use it for `handlers`, it is automatically applied for each `handler`\n *\n * @callback {callback} callback\n * @param {object} [context] - if present, it will be passed\n * */\n /**@js_externs ready*/\n ready: function(callback, context) {\n\n\n // if ready has already fired, then just schedule the callback\n // to fire asynchronously, but right away\n if (readyFired) {\n setTimeout(function() {callback(context);}, 1);\n return;\n } else {\n // add the function and context to the list\n readyList.push({ name: 'anonymous', fn: callback, ctx: context });\n }\n\n // if document already ready to go, schedule the ready function to run\n // IE only safe when readyState is \"complete\", others safe when readyState is \"interactive\"\n if (document.readyState === \"complete\" || (!document.attachEvent && document.readyState === \"interactive\")) {\n setTimeout(ready, 1);\n } else if (!readyEventHandlersInstalled) {\n // otherwise if we don't have event handlers installed, install them\n if (document.addEventListener) {\n // first choice is DOMContentLoaded event\n document.addEventListener(\"DOMContentLoaded\", ready, false);\n // backup is window load event\n window.addEventListener(\"load\", ready, false);\n } else {\n // must be IE\n document.attachEvent(\"onreadystatechange\", readyStateChange);\n window.attachEvent(\"onload\", ready);\n }\n readyEventHandlersInstalled = true;\n }\n\n }\n };\n\n window['gina'] = gina;\n}\n\n\ndefine('core', ['require', 'gina'], function (require) {\n require('gina')(window['gina']); // passing core required lib through parameters\n});\n\n\nrequire.config({\n \"packages\": [\"gina\"]\n});\n\nrequire([\n //vendors\n \"vendor/uuid\",\n \"vendor/engine.io\",\n\n \"core\",\n\n // plugins\n \"gina/validator\",\n \"gina/popin\",\n \"gina/storage\",\n\n // utils\n \"utils/dom\",\n \"utils/events\",\n \"utils/form-validator\",\n \"utils/collection\"\n]);\n\n\n// catching freelancer script load event\nvar tags = document.getElementsByTagName('script');\n\nfor (var t = 0, len = tags.length; t < len; ++t) {\n\n if ( /gina.min.js|gina.js/.test( tags[t].getAttribute('src') ) ) {\n\n tags[t]['onload'] = function onGinaLoaded(e) {\n // TODO - get the version number from the response ?? console.log('tag ', tags[t].getAttribute('data-options'));\n // var req = new XMLHttpRequest();\n // req.open('GET', document.location, false);\n // req.send(null);\n // var version = req.getAllResponseHeaders().match(/X-Powered-By:(.*)/)[0].replace('X-Powered-By: ', '');\n if (window['onGinaLoaded']) {\n var onGinaLoaded = window['onGinaLoaded']\n } else {\n function onGinaLoaded(gina) {\n\n if (!gina) {\n return false\n } else {\n if ( gina[\"isFrameworkLoaded\"] ) {\n return true\n }\n var options = gina.options = {\n /**@js_externs env*/\n //env : '{{ page.environment.env }}',\n /**@js_externs version*/\n //version : '{{ page.environment.version }}',\n /**@js_externs webroot*/\n webroot : '/'\n };\n\n gina[\"setOptions\"](options);\n gina[\"isFrameworkLoaded\"] = true;\n\n // making adding css to the head\n var link = null;\n link = document.createElement('link');\n link.href = ((options.webroot !== '/') ? options.webroot + '/' : options.webroot) + \"js/vendor/gina/gina.min.css\";\n link.media = \"screen\";\n link.rel = \"stylesheet\";\n link.type = \"text/css\";\n document.getElementsByTagName('head')[0].appendChild(link);\n\n return true\n }\n }\n }\n\n\n if (document.addEventListener) {\n document.addEventListener(\"ginaloaded\", function(event){\n //console.log('Gina Framework is ready !');\n window['gina'] = event.detail;\n onGinaLoaded(event.detail)\n })\n } else if (document.attachEvent) {\n document.attachEvent(\"ginaloaded\", function(event){\n window['gina'] = event.detail;\n onGinaLoaded(event.detail)\n })\n }\n }()\n break;\n }\n};\n"
|
|
41
|
-
]
|
|
42
|
-
}
|