gina 0.1.6-alpha.75 → 0.1.6-alpha.77
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/framework/v0.1.6-alpha.77/VERSION +1 -0
- package/framework/v0.1.6-alpha.77/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/dist/vendor/gina/js/gina.js +55 -34
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/dist/vendor/gina/js/gina.min.js +360 -359
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +5 -5
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +2 -2
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/controller/controller.js +1 -9
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/validator/src/form-validator.js +33 -23
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/validator/src/main.js +18 -10
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/routing/src/main.js +4 -1
- package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/validator.js +2 -2
- package/package.json +2 -2
- package/framework/v0.1.6-alpha.75/VERSION +0 -1
- package/framework/v0.1.6-alpha.75/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/AUTHORS +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/html/nolayout.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/html/static.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/img/android-chrome-192x192.png +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/img/android-chrome-512x512.png +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/img/apple-touch-icon.png +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/img/favicon-16x16.png +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/img/favicon-32x32.png +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/img/favicon.ico +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/asset/plugin/uuid.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/config.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/connector.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/connector.v2.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/connector.v3.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/connector.v4.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/n1ql.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/session-store.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/controller/controller.framework.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/controller/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/.travis.yml +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/deps/encoding/encoding-indexes.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/deps/encoding/encoding.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/lib/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/lib/types/multipart.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/lib/types/urlencoded.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/lib/utils.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-0.2.14/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/.github/workflows/ci.yml +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/.github/workflows/lint.yml +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/lib/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/lib/types/multipart.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/lib/types/urlencoded.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/lib/utils.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/busboy-1.6.0/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/dev/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/dev/lib/class.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/dev/lib/factory.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/dev/lib/tools.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/gna.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/currency.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/dist/language/en.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/dist/language/fr.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/dist/region/en.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/dist/region/fr.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/src/make.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/src/resources/currency.csv +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/src/resources/region.csv +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/locales/src/resources/region.mapping.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/mime.types +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/model/entity.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/model/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/model/template/entityFactory.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/model/template/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/file/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/file/build.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/file/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/intl/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/intl/build.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/intl/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/intl/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/storage/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/storage/build.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/storage/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/storage/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/validator/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/validator/build.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/plugins/lib/validator/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/router.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/server.express.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/server.isaac.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/server.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/status.codes +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/_gitignore +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/config/app.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/config/routing.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/config/settings.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/config/templates.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_public/css/default.css +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_public/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/command/gina.bat.tpl +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/command/gina.tpl +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/conf/env.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/conf/manifest.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/conf/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/conf/settings.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/conf/statics.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/conf/templates.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/error/client/json/401.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/error/client/json/403.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/error/client/json/404.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/error/server/html/50x.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/error/server/json/500.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/error/server/json/503.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/core/template/extensions/logger/config.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/console.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/context.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/data/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/data/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/data/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/data/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/dateFormat.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/json/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/json/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/json/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/json/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/path.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/plugins/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/plugins/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/plugins/src/api-error.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/plugins/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/prototypes.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/task.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/helpers/text.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/archiver/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/archiver/build.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/archiver/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/archiver/src/dep/jszip.min.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/archiver/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/aliases.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/add.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/arguments.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/copy.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/cp.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/help.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/list.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/rename.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/start.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/status.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/bundle/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/add.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/get.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/help.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/link-dev.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/list.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/set.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/unset.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/env/use.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/build.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/dot.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/get.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/help.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/init.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/link-node-modules.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/link.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/msg.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/open.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/set.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/start.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/status.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/tail.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/update.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/framework/version.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/gina-dev.1.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/gina-framework.1.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/gina.1.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/helper.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/msg.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/port/help.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/port/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/port/inc/scan.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/port/list.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/port/reset.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/port/set.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/add.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/arguments.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/build.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/help.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/import.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/list.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/move.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/rename.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/start.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/status.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/project/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/protocol/help.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/protocol/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/protocol/list.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/protocol/set.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/add.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/help.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/link-local.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/link-production.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/list.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/scope/use.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cmd/view/add.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/collection/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/collection/build.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/collection/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/collection/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/config.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cron/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cron/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/cron/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/domain/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/domain/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/domain/dist/public_suffix_list.dat +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/domain/exemples/backend.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/domain/exemples/frontend.html +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/domain/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/domain/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/generator/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/example/protected_inheritance.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/example/simple_inheritance.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/inherits/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/containers/default/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/containers/file/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/containers/mq/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/containers/mq/listener.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/containers/mq/speaker.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/helper.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/logger/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/math/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/merge/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/merge/example/merge.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/merge/example/merge_2_literal objects.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/merge/example/merge_and_preserve_first.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/merge/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/merge/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/model.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/proc.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/routing/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/routing/build.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/routing/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/session-store.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/shell.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/swig-filters/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/swig-filters/package.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/swig-filters/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/url/README.md +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/url/index.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/url/mocks.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/url/routing.json +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/lib/url/test.js +0 -0
- /package/framework/{v0.1.6-alpha.75 → v0.1.6-alpha.77}/package.json +0 -0
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
Released under the MIT License.
|
|
7
7
|
*/
|
|
8
8
|
var requirejs,require,define;
|
|
9
|
-
(function(B,Q){function V(Fa,Pa){return Pa||''}function la(Fa){return'[object Function]'===Ea.call(Fa)}function U(Fa){return'[object Array]'===Ea.call(Fa)}function N(Fa,Pa){if(Fa){var Ya;for(Ya=0;Ya<Fa.length&&(!Fa[Ya]||!Pa(Fa[Ya],Ya,Fa));Ya+=1);}}function ha(Fa,Pa){if(Fa){var Ya;for(Ya=Fa.length-1;-1<Ya&&(!Fa[Ya]||!Pa(Fa[Ya],Ya,Fa));--Ya);}}function R(Fa,Pa){return W.call(Fa,Pa)}function S(Fa,Pa){return R(Fa,Pa)&&Fa[Pa]}function
|
|
10
|
-
Ya))break}function I(Fa,Pa,Ya,qb){Pa&&
|
|
11
|
-
qb;Ya&&(Pa.originalError=Ya);return Pa}function K(){if(y&&'interactive'===y.readyState)return y;ha(document.getElementsByTagName('script'),function(Fa){if('interactive'===Fa.readyState)return y=Fa});return y}var A,E,n,y,z,F,
|
|
9
|
+
(function(B,Q){function V(Fa,Pa){return Pa||''}function la(Fa){return'[object Function]'===Ea.call(Fa)}function U(Fa){return'[object Array]'===Ea.call(Fa)}function N(Fa,Pa){if(Fa){var Ya;for(Ya=0;Ya<Fa.length&&(!Fa[Ya]||!Pa(Fa[Ya],Ya,Fa));Ya+=1);}}function ha(Fa,Pa){if(Fa){var Ya;for(Ya=Fa.length-1;-1<Ya&&(!Fa[Ya]||!Pa(Fa[Ya],Ya,Fa));--Ya);}}function R(Fa,Pa){return W.call(Fa,Pa)}function S(Fa,Pa){return R(Fa,Pa)&&Fa[Pa]}function v(Fa,Pa){for(var Ya in Fa)if(R(Fa,Ya)&&-1==Ia.indexOf(Ya)&&Pa(Fa[Ya],
|
|
10
|
+
Ya))break}function I(Fa,Pa,Ya,qb){Pa&&v(Pa,function(bb,rb){if(Ya||!R(Fa,rb))!qb||'object'!==typeof bb||!bb||U(bb)||la(bb)||bb instanceof RegExp?Fa[rb]=bb:(Fa[rb]||(Fa[rb]={}),I(Fa[rb],bb,Ya,qb))});return Fa}function w(Fa,Pa){return function(){return Pa.apply(Fa,arguments)}}function za(Fa){throw Fa;}function va(Fa){if(!Fa)return Fa;var Pa=B;N(Fa.split('.'),function(Ya){Pa=Pa[Ya]});return Pa}function P(Fa,Pa,Ya,qb){Pa=Error(Pa+'\nhttps://requirejs.org/docs/errors.html#'+Fa);Pa.requireType=Fa;Pa.requireModules=
|
|
11
|
+
qb;Ya&&(Pa.originalError=Ya);return Pa}function K(){if(y&&'interactive'===y.readyState)return y;ha(document.getElementsByTagName('script'),function(Fa){if('interactive'===Fa.readyState)return y=Fa});return y}var A,E,n,y,z,F,x,u=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,G=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,M=/\.js$/,T=/^\.\//;var ra=Object.prototype;var Ea=ra.toString,W=ra.hasOwnProperty,ia=!('undefined'===typeof window||'undefined'===typeof navigator||!window.document),ea=!ia&&'undefined'!==
|
|
12
12
|
typeof importScripts,Aa=ia&&'PLAYSTATION 3'===navigator.platform?/^complete$/:/^(complete|loaded)$/,ma='undefined'!==typeof opera&&'[object Opera]'===opera.toString(),sa={},Da={},Qa=[],Ja=!1,Ia=['__proto__','constructor'];if('undefined'===typeof define){if('undefined'!==typeof requirejs){if(la(requirejs))return;Da=requirejs;requirejs=void 0}'undefined'===typeof require||la(require)||(Da=require,require=void 0);var Ha=requirejs=function(Fa,Pa,Ya,qb){var bb='_';if(!U(Fa)&&'string'!==typeof Fa){var rb=
|
|
13
13
|
Fa;U(Pa)?(Fa=Pa,Pa=Ya,Ya=qb):Fa=[]}rb&&rb.context&&(bb=rb.context);(qb=S(sa,bb))||(qb=sa[bb]=Ha.s.newContext(bb));rb&&qb.configure(rb);return qb.require(Fa,Pa,Ya)};Ha.config=function(Fa){return Ha(Fa)};Ha.nextTick='undefined'!==typeof Q?function(Fa){Q(Fa,4)}:function(Fa){Fa()};require||=Ha;Ha.version='2.3.7';Ha.jsExtRegExp=/^\/|:|\?|\.js$/;Ha.isBrowser=ia;ra=Ha.s={contexts:sa,newContext:function(Fa){function Pa(H,ka,wa){var Y;ka=ka&&ka.split('/');var oa=h.map,La=oa&&oa['*'];if(H){H=H.split('/');var Ta=
|
|
14
14
|
H.length-1;h.nodeIdCompat&&M.test(H[Ta])&&(H[Ta]=H[Ta].replace(M,''));'.'===H[0].charAt(0)&&ka&&(Ta=ka.slice(0,ka.length-1),H=Ta.concat(H));Ta=H;for(Y=0;Y<Ta.length;Y++){var $a=Ta[Y];'.'===$a?(Ta.splice(Y,1),--Y):'..'===$a&&0!==Y&&(1!==Y||'..'!==Ta[2])&&'..'!==Ta[Y-1]&&0<Y&&(Ta.splice(Y-1,2),Y-=2)}H=H.join('/')}if(wa&&oa&&(ka||La)){Ta=H.split('/');Y=Ta.length;a:for(;0<Y;--Y){var Ab=Ta.slice(0,Y).join('/');if(ka)for($a=ka.length;0<$a;--$a)if(wa=S(oa,ka.slice(0,$a).join('/')))if(wa=S(wa,Ab)){var Bb=
|
|
@@ -16,55 +16,55 @@ wa;var hb=Y;break a}if(!Hb&&La&&S(La,Ab)){var Hb=S(La,Ab);var Wa=Y}}!Bb&&Hb&&(Bb
|
|
|
16
16
|
!0}function bb(H){var ka=H?H.indexOf('!'):-1;if(-1<ka){var wa=H.substring(0,ka);H=H.substring(ka+1,H.length)}return[wa,H]}function rb(H,ka,wa,Y){var oa=null,La=ka?ka.name:null,Ta=H,$a=!0,Ab='';H||($a=!1,H='_@r'+(aa+=1));H=bb(H);oa=H[0];H=H[1];if(oa){oa=Pa(oa,La,Y);var Bb=S(p,oa)}if(H)if(oa)Ab=wa?H:Bb&&Bb.normalize?Bb.normalize(H,function(Hb){return Pa(Hb,La,Y)}):-1===H.indexOf('!')?Pa(H,La,Y):H;else{Ab=Pa(H,La,Y);H=bb(Ab);oa=H[0];Ab=H[1];wa=!0;var hb=Ba.nameToUrl(Ab)}wa=!oa||Bb||wa?'':'_unnormalized'+
|
|
17
17
|
(xa+=1);return{prefix:oa,name:Ab,parentMap:ka,unnormalized:!!wa,url:hb,originalName:Ta,isDefine:$a,id:(oa?oa+'!'+Ab:Ab)+wa}}function Vb(H){var ka=H.id,wa=S(e,ka);wa||=e[ka]=new Ba.Module(H);return wa}function wb(H,ka,wa){var Y=H.id,oa=S(e,Y);if(!R(p,Y)||oa&&!oa.defineEmitComplete)if(oa=Vb(H),oa.error&&'error'===ka)wa(oa.error);else oa.on(ka,wa);else'defined'===ka&&wa(p[Y])}function nb(H,ka){var wa=H.requireModules,Y=!1;if(ka)ka(H);else if(N(wa,function(oa){if(oa=S(e,oa))oa.error=H,oa.events.error&&
|
|
18
18
|
(Y=!0,oa.emit('error',H))}),!Y)Ha.onError(H)}function xb(){Qa.length&&(N(Qa,function(H){var ka=H[0];'string'===typeof ka&&(Ba.defQueueMap[ka]=!0);m.push(H)}),Qa=[])}function yb(H){delete e[H];delete b[H]}function Ka(H,ka,wa){var Y=H.map.id;H.error?H.emit('error',H.error):(ka[Y]=!0,N(H.depMaps,function(oa,La){oa=oa.id;var Ta=S(e,oa);!Ta||H.depMatched[La]||wa[oa]||(S(ka,oa)?(H.defineDep(La,p[oa]),H.check()):Ka(Ta,ka,wa))}),wa[Y]=!0)}function eb(){var H,ka,wa=(H=1E3*h.waitSeconds)&&Ba.startTime+H<(new Date).getTime(),
|
|
19
|
-
Y=[],oa=[],La=!1,Ta=!0;if(!ca){ca=!0;
|
|
19
|
+
Y=[],oa=[],La=!1,Ta=!0;if(!ca){ca=!0;v(b,function($a){var Ab=$a.map,Bb=Ab.id;if($a.enabled&&(Ab.isDefine||oa.push($a),!$a.error))if(!$a.inited&&wa)qb(Bb)?La=ka=!0:(Y.push(Bb),Ya(Bb));else if(!$a.inited&&$a.fetched&&Ab.isDefine&&(La=!0,!Ab.prefix))return Ta=!1});if(wa&&Y.length)return H=P('timeout','Load timeout for modules: '+Y,null,Y),H.contextName=Ba.contextName,nb(H);Ta&&N(oa,function($a){Ka($a,{},{})});wa&&!ka||!La||!ia&&!ea||l||(l=Q(function(){l=0;eb()},50));ca=!1}}function Gb(H){R(p,H[0])||
|
|
20
20
|
Vb(rb(H[0],null,!0)).init(H[1],H[2])}function Ub(H){H=H.currentTarget||H.srcElement;var ka=Ba.onScriptLoad;H.detachEvent&&!ma?H.detachEvent('onreadystatechange',ka):H.removeEventListener('load',ka,!1);ka=Ba.onScriptError;H.detachEvent&&!ma||H.removeEventListener('error',ka,!1);return{node:H,id:H&&H.getAttribute('data-requiremodule')}}function pc(){for(xb();m.length;){var H=m.shift();if(null===H[0])return nb(P('mismatch','Mismatched anonymous define() module: '+H[H.length-1]));Gb(H)}Ba.defQueueMap=
|
|
21
21
|
{}}var ca,l,h={waitSeconds:7,baseUrl:'./',paths:{},bundles:{},pkgs:{},shim:{},config:{}},e={},b={},q={},m=[],p={},O={},D={},aa=1,xa=1;var ba={require:function(H){return H.require?H.require:H.require=Ba.makeRequire(H.map)},exports:function(H){H.usingExports=!0;if(H.map.isDefine)return H.exports?p[H.map.id]=H.exports:H.exports=p[H.map.id]={}},module:function(H){return H.module?H.module:H.module={id:H.map.id,uri:H.map.url,config:function(){return S(h.config,H.map.id)||{}},exports:H.exports||(H.exports=
|
|
22
|
-
{})}}};var pa=function(H){this.events=S(q,H.id)||{};this.map=H;this.shim=S(h.shim,H.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};pa.prototype={init:function(H,ka,wa,Y){Y=Y||{};if(!this.inited){this.factory=ka;if(wa)this.on('error',wa);else this.events.error&&(wa=
|
|
23
|
-
ka){this.depMatched[H]||(this.depMatched[H]=!0,--this.depCount,this.depExports[H]=ka)},fetch:function(){if(!this.fetched){this.fetched=!0;Ba.startTime=(new Date).getTime();var H=this.map;if(this.shim)Ba.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],
|
|
22
|
+
{})}}};var pa=function(H){this.events=S(q,H.id)||{};this.map=H;this.shim=S(h.shim,H.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};pa.prototype={init:function(H,ka,wa,Y){Y=Y||{};if(!this.inited){this.factory=ka;if(wa)this.on('error',wa);else this.events.error&&(wa=w(this,function(oa){this.emit('error',oa)}));this.depMaps=H&&H.slice(0);this.errback=wa;this.inited=!0;this.ignore=Y.ignore;Y.enabled||this.enabled?this.enable():this.check()}},defineDep:function(H,
|
|
23
|
+
ka){this.depMatched[H]||(this.depMatched[H]=!0,--this.depCount,this.depExports[H]=ka)},fetch:function(){if(!this.fetched){this.fetched=!0;Ba.startTime=(new Date).getTime();var H=this.map;if(this.shim)Ba.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],w(this,function(){return H.prefix?this.callPlugin():this.load()}));else return H.prefix?this.callPlugin():this.load()}},load:function(){var H=this.map.url;O[H]||(O[H]=!0,Ba.load(this.map.id,H))},check:function(){if(this.enabled&&!this.enabling){var H=
|
|
24
24
|
this.map.id;var ka=this.depExports;var wa=this.exports,Y=this.factory;if(!this.inited)R(Ba.defQueueMap,H)||this.fetch();else if(this.error)this.emit('error',this.error);else if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(la(Y)){if(this.events.error&&this.map.isDefine||Ha.onError!==za)try{wa=Ba.execCb(H,Y,ka,wa)}catch(Ta){var oa=Ta}else wa=Ba.execCb(H,Y,ka,wa);this.map.isDefine&&void 0===wa&&((ka=this.module)?wa=ka.exports:this.usingExports&&(wa=this.exports));if(oa)return oa.requireMap=
|
|
25
25
|
this.map,oa.requireModules=this.map.isDefine?[this.map.id]:null,oa.requireType=this.map.isDefine?'define':'require',nb(this.error=oa)}else wa=Y;this.exports=wa;if(this.map.isDefine&&!this.ignore&&(p[H]=wa,Ha.onResourceLoad)){var La=[];N(this.depMaps,function(Ta){La.push(Ta.normalizedMap||Ta)});Ha.onResourceLoad(Ba,this.map,La)}yb(H);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit('defined',this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var H=
|
|
26
|
-
this.map,ka=H.id,wa=rb(H.prefix);this.depMaps.push(wa);wb(wa,'defined',
|
|
27
|
-
if(Y=S(e,Ab.id)){this.depMaps.push(Ab);if(this.events.error)Y.on('error',
|
|
28
|
-
Hb&&(hb=Hb);fa&&(Ja=!1);Vb(cb);R(h.config,ka)&&(h.config[Wa]=h.config[ka]);try{Ha.exec(hb)}catch(X){return nb(P('fromtexteval','fromText eval for '+ka+' failed: '+X,X,[ka]))}fa&&(Ja=!0);this.depMaps.push(cb);Ba.completeLoad(Wa);$a([Wa],Bb)});Y.load(H.name,$a,Bb,h)}}));Ba.enable(wa,this);this.pluginMaps[wa.id]=wa},enable:function(){b[this.map.id]=this;this.enabling=this.enabled=!0;N(this.depMaps,
|
|
29
|
-
!1,!this.skipMap);this.depMaps[ka]=H;if(wa=S(ba,H.id)){this.depExports[ka]=wa(this);return}this.depCount+=1;wb(H,'defined',
|
|
26
|
+
this.map,ka=H.id,wa=rb(H.prefix);this.depMaps.push(wa);wb(wa,'defined',w(this,function(Y){var oa=S(D,this.map.id),La=this.map.name,Ta=this.map.parentMap?this.map.parentMap.name:null,$a=Ba.makeRequire(H.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){Y.normalize&&(La=Y.normalize(La,function(hb){return Pa(hb,Ta,!0)})||'');var Ab=rb(H.prefix+'!'+La,this.map.parentMap,!0);wb(Ab,'defined',w(this,function(hb){this.map.normalizedMap=Ab;this.init([],function(){return hb},null,{enabled:!0,ignore:!0})}));
|
|
27
|
+
if(Y=S(e,Ab.id)){this.depMaps.push(Ab);if(this.events.error)Y.on('error',w(this,function(hb){this.emit('error',hb)}));Y.enable()}}else if(oa)this.map.url=Ba.nameToUrl(oa),this.load();else{var Bb=w(this,function(hb){this.init([],function(){return hb},null,{enabled:!0})});Bb.error=w(this,function(hb){this.inited=!0;this.error=hb;hb.requireModules=[ka];v(e,function(Hb){0===Hb.map.id.indexOf(ka+'_unnormalized')&&yb(Hb.map.id)});nb(hb)});Bb.fromText=w(this,function(hb,Hb){var Wa=H.name,cb=rb(Wa),fa=Ja;
|
|
28
|
+
Hb&&(hb=Hb);fa&&(Ja=!1);Vb(cb);R(h.config,ka)&&(h.config[Wa]=h.config[ka]);try{Ha.exec(hb)}catch(X){return nb(P('fromtexteval','fromText eval for '+ka+' failed: '+X,X,[ka]))}fa&&(Ja=!0);this.depMaps.push(cb);Ba.completeLoad(Wa);$a([Wa],Bb)});Y.load(H.name,$a,Bb,h)}}));Ba.enable(wa,this);this.pluginMaps[wa.id]=wa},enable:function(){b[this.map.id]=this;this.enabling=this.enabled=!0;N(this.depMaps,w(this,function(H,ka){var wa;if('string'===typeof H){H=rb(H,this.map.isDefine?this.map:this.map.parentMap,
|
|
29
|
+
!1,!this.skipMap);this.depMaps[ka]=H;if(wa=S(ba,H.id)){this.depExports[ka]=wa(this);return}this.depCount+=1;wb(H,'defined',w(this,function(oa){this.undefed||(this.defineDep(ka,oa),this.check())}));this.errback?wb(H,'error',w(this,this.errback)):this.events.error&&wb(H,'error',w(this,function(oa){this.emit('error',oa)}))}wa=H.id;var Y=e[wa];R(ba,wa)||!Y||Y.enabled||Ba.enable(H,this)}));v(this.pluginMaps,w(this,function(H){var ka=S(e,H.id);ka&&!ka.enabled&&Ba.enable(H,this)}));this.enabling=!1;this.check()},
|
|
30
30
|
on:function(H,ka){var wa=this.events[H];wa||=this.events[H]=[];wa.push(ka)},emit:function(H,ka){N(this.events[H],function(wa){wa(ka)});'error'===H&&delete this.events[H]}};var Ba={config:h,contextName:Fa,registry:e,defined:p,urlFetched:O,defQueue:m,defQueueMap:{},Module:pa,makeModuleMap:rb,nextTick:Ha.nextTick,onError:nb,configure:function(H){H.baseUrl&&'/'!==H.baseUrl.charAt(H.baseUrl.length-1)&&(H.baseUrl+='/');if('string'===typeof H.urlArgs){var ka=H.urlArgs;H.urlArgs=function(oa,La){return(-1===
|
|
31
|
-
La.indexOf('?')?'?':'&')+ka}}var wa=h.shim,Y={paths:!0,bundles:!0,config:!0,map:!0};
|
|
32
|
-
oa.location);h.pkgs[La]=oa.name+'/'+(oa.main||'main').replace(T,'').replace(M,'')});
|
|
31
|
+
La.indexOf('?')?'?':'&')+ka}}var wa=h.shim,Y={paths:!0,bundles:!0,config:!0,map:!0};v(H,function(oa,La){Y[La]?(h[La]||(h[La]={}),I(h[La],oa,!0,!0)):h[La]=oa});H.bundles&&v(H.bundles,function(oa,La){N(oa,function(Ta){Ta!==La&&(D[Ta]=La)})});H.shim&&(v(H.shim,function(oa,La){U(oa)&&(oa={deps:oa});!oa.exports&&!oa.init||oa.exportsFn||(oa.exportsFn=Ba.makeShimExports(oa));wa[La]=oa}),h.shim=wa);H.packages&&N(H.packages,function(oa){oa='string'===typeof oa?{name:oa}:oa;var La=oa.name;oa.location&&(h.paths[La]=
|
|
32
|
+
oa.location);h.pkgs[La]=oa.name+'/'+(oa.main||'main').replace(T,'').replace(M,'')});v(e,function(oa,La){oa.inited||oa.map.unnormalized||(oa.map=rb(La,null,!0))});(H.deps||H.callback)&&Ba.require(H.deps||[],H.callback)},makeShimExports:function(H){return function(){var ka;H.init&&(ka=H.init.apply(B,arguments));return ka||H.exports&&va(H.exports)}},makeRequire:function(H,ka){function wa(Y,oa,La){var Ta;ka.enableBuildCallback&&oa&&la(oa)&&(oa.__requireJsBuild=!0);if('string'===typeof Y){if(la(oa))return nb(P('requireargs',
|
|
33
33
|
'Invalid require call'),La);if(H&&R(ba,Y))return ba[Y](e[H.id]);if(Ha.get)return Ha.get(Ba,Y,H,wa);var $a=rb(Y,H,!1,!0);$a=$a.id;return R(p,$a)?p[$a]:nb(P('notloaded','Module name "'+$a+'" has not been loaded yet for context: '+Fa+(H?'':'. Use require([])')))}pc();Ba.nextTick(function(){pc();Ta=Vb(rb(null,H));Ta.skipMap=ka.skipMap;Ta.init(Y,oa,La,{enabled:!0});eb()});return wa}ka=ka||{};I(wa,{isBrowser:ia,toUrl:function(Y){var oa=Y.lastIndexOf('.'),La=Y.split('/')[0];if(-1!==oa&&('.'!==La&&'..'!==
|
|
34
34
|
La||1<oa)){var Ta=Y.substring(oa,Y.length);Y=Y.substring(0,oa)}return Ba.nameToUrl(Pa(Y,H&&H.id,!0),Ta,!0)},defined:function(Y){return R(p,rb(Y,H,!1,!0).id)},specified:function(Y){Y=rb(Y,H,!1,!0).id;return R(p,Y)||R(e,Y)}});H||(wa.undef=function(Y){xb();var oa=rb(Y,H,!0),La=S(e,Y);La.undefed=!0;Ya(Y);delete p[Y];delete O[oa.url];delete q[Y];ha(m,function(Ta,$a){Ta[0]===Y&&m.splice($a,1)});delete Ba.defQueueMap[Y];La&&(La.events.defined&&(q[Y]=La.events),yb(Y))});return wa},enable:function(H){S(e,
|
|
35
35
|
H.id)&&Vb(H).enable()},completeLoad:function(H){var ka=S(h.shim,H)||{},wa=ka.exports;for(xb();m.length;){var Y=m.shift();if(null===Y[0]){Y[0]=H;if(oa)break;var oa=!0}else Y[0]===H&&(oa=!0);Gb(Y)}Ba.defQueueMap={};Y=S(e,H);if(!oa&&!R(p,H)&&Y&&!Y.inited)if(!h.enforceDefine||wa&&va(wa))Gb([H,ka.deps||[],ka.exportsFn]);else return qb(H)?void 0:nb(P('nodefine','No define call for '+H,null,[H]));eb()},nameToUrl:function(H,ka,wa){var Y,oa;(Y=S(h.pkgs,H))&&(H=Y);if(Y=S(D,H))return Ba.nameToUrl(Y,ka,wa);if(Ha.jsExtRegExp.test(H))Y=
|
|
36
36
|
H+(ka||'');else{Y=h.paths;var La=H.split('/');for(oa=La.length;0<oa;--oa){var Ta=La.slice(0,oa).join('/');if(Ta=S(Y,Ta)){U(Ta)&&(Ta=Ta[0]);La.splice(0,oa,Ta);break}}Y=La.join('/');Y+=ka||(/^data:|^blob:|\?/.test(Y)||wa?'':'.js');Y=('/'===Y.charAt(0)||Y.match(/^[\w\+\.\-]+:/)?'':h.baseUrl)+Y}return h.urlArgs&&!/^blob:/.test(Y)?Y+h.urlArgs(H,Y):Y},load:function(H,ka){Ha.load(Ba,H,ka)},execCb:function(H,ka,wa,Y){return ka.apply(Y,wa)},onScriptLoad:function(H){if('load'===H.type||Aa.test((H.currentTarget||
|
|
37
|
-
H.srcElement).readyState))y=null,H=Ub(H),Ba.completeLoad(H.id)},onScriptError:function(H){var ka=Ub(H);if(!qb(ka.id)){var wa=[];
|
|
37
|
+
H.srcElement).readyState))y=null,H=Ub(H),Ba.completeLoad(H.id)},onScriptError:function(H){var ka=Ub(H);if(!qb(ka.id)){var wa=[];v(e,function(Y,oa){0!==oa.indexOf('_@r')&&N(Y.depMaps,function(La){if(La.id===ka.id)return wa.push(oa),!0})});return nb(P('scripterror','Script error for "'+ka.id+(wa.length?'", needed by: '+wa.join(', '):'"'),H,[ka.id]))}}};Ba.require=Ba.makeRequire();return Ba}};Ha({});N(['toUrl','undef','defined','specified'],function(Fa){Ha[Fa]=function(){var Pa=sa._;return Pa.require[Fa].apply(Pa,
|
|
38
38
|
arguments)}});if(ia){var mb=ra.head=document.getElementsByTagName('head')[0];if(A=document.getElementsByTagName('base')[0])mb=ra.head=A.parentNode}Ha.onError=za;Ha.createNode=function(Fa,Pa,Ya){Pa=Fa.xhtml?document.createElementNS('http://www.w3.org/1999/xhtml','html:script'):document.createElement('script');Pa.type=Fa.scriptType||'text/javascript';Pa.charset='utf-8';Pa.async=!0;return Pa};Ha.load=function(Fa,Pa,Ya){var qb=Fa&&Fa.config||{};if(ia){var bb=Ha.createNode(qb,Pa,Ya);bb.setAttribute('data-requirecontext',
|
|
39
39
|
Fa.contextName);bb.setAttribute('data-requiremodule',Pa);!bb.attachEvent||bb.attachEvent.toString&&0>bb.attachEvent.toString().indexOf('[native code')||ma?(bb.addEventListener('load',Fa.onScriptLoad,!1),bb.addEventListener('error',Fa.onScriptError,!1)):(Ja=!0,bb.attachEvent('onreadystatechange',Fa.onScriptLoad));bb.src=Ya;if(qb.onNodeCreated)qb.onNodeCreated(bb,qb,Pa,Ya);z=bb;A?mb.insertBefore(bb,A):mb.appendChild(bb);z=null;return bb}if(ea)try{Q(function(){},0),importScripts(Ya),Fa.completeLoad(Pa)}catch(rb){Fa.onError(P('importscripts',
|
|
40
|
-
'importScripts failed for '+Pa+' at '+Ya,rb,[Pa]))}};ia&&!Da.skipDataMain&&ha(document.getElementsByTagName('script'),function(Fa){mb||(mb=Fa.parentNode);if(E=Fa.getAttribute('data-main'))return F=E,Da.baseUrl||-1!==F.indexOf('!')||(n=F.split('/'),F=n.pop(),
|
|
41
|
-
(Pa=[],Ya.length&&(Ya.toString().replace(
|
|
42
|
-
!function(B,Q){'object'==typeof exports&&'undefined'!=typeof module?Q(exports):'function'==typeof define&&define.amd?define('vendor/uuid',['exports'],Q):Q((B=B||self).uuid={})}(this,function(B){function Q(){if(!
|
|
43
|
-
z[n[y++]],z[n[y++]],z[n[y++]],z[n[y++]],z[n[y++]]].join('')}function la(n,y,z){var F=function(
|
|
44
|
-
|
|
45
|
-
y,z,F,
|
|
46
|
-
|
|
47
|
-
T=ha(T,
|
|
48
|
-
20,-373897302);
|
|
49
|
-
T,F[
|
|
50
|
-
F[
|
|
51
|
-
M,T,
|
|
52
|
-
F.charCodeAt(
|
|
40
|
+
'importScripts failed for '+Pa+' at '+Ya,rb,[Pa]))}};ia&&!Da.skipDataMain&&ha(document.getElementsByTagName('script'),function(Fa){mb||(mb=Fa.parentNode);if(E=Fa.getAttribute('data-main'))return F=E,Da.baseUrl||-1!==F.indexOf('!')||(n=F.split('/'),F=n.pop(),x=n.length?n.join('/')+'/':'./',Da.baseUrl=x),F=F.replace(M,''),Ha.jsExtRegExp.test(F)&&(F=E),Da.deps=Da.deps?Da.deps.concat(F):[F],!0});define=function(Fa,Pa,Ya){var qb;'string'!==typeof Fa&&(Ya=Pa,Pa=Fa,Fa=null);U(Pa)||(Ya=Pa,Pa=null);!Pa&&la(Ya)&&
|
|
41
|
+
(Pa=[],Ya.length&&(Ya.toString().replace(u,V).replace(G,function(rb,Vb){Pa.push(Vb)}),Pa=(1===Ya.length?['require']:['require','exports','module']).concat(Pa)));if(Ja&&(qb=z||K())){Fa||=qb.getAttribute('data-requiremodule');var bb=sa[qb.getAttribute('data-requirecontext')]}bb?(bb.defQueue.push([Fa,Pa,Ya]),bb.defQueueMap[Fa]=!0):Qa.push([Fa,Pa,Ya])};define.amd={jQuery:!0};Ha.exec=function(Fa){return eval(Fa)};Ha(Da)}})(this,'undefined'===typeof setTimeout?void 0:setTimeout);define('requireLib',function(){});
|
|
42
|
+
!function(B,Q){'object'==typeof exports&&'undefined'!=typeof module?Q(exports):'function'==typeof define&&define.amd?define('vendor/uuid',['exports'],Q):Q((B=B||self).uuid={})}(this,function(B){function Q(){if(!v)throw Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');return v(I)}function V(n,y){y=y||0;var z=va;return[z[n[y++]],z[n[y++]],z[n[y++]],z[n[y++]],'-',z[n[y++]],z[n[y++]],'-',z[n[y++]],z[n[y++]],'-',z[n[y++]],z[n[y++]],'-',z[n[y++]],
|
|
43
|
+
z[n[y++]],z[n[y++]],z[n[y++]],z[n[y++]],z[n[y++]]].join('')}function la(n,y,z){var F=function(x,u,G,M){M=G&&M||0;if('string'==typeof x&&(x=function(T){T=unescape(encodeURIComponent(T));for(var ra=Array(T.length),Ea=0;Ea<T.length;Ea++)ra[Ea]=T.charCodeAt(Ea);return ra}(x)),'string'==typeof u&&(u=function(T){var ra=[];return T.replace(/[a-fA-F0-9]{2}/g,function(Ea){ra.push(parseInt(Ea,16))}),ra}(u)),!Array.isArray(x))throw TypeError('value must be an array of bytes');if(!Array.isArray(u)||16!==u.length)throw TypeError('namespace must be uuid string or an Array of 16 byte values');
|
|
44
|
+
x=z(u.concat(x));if(x[6]=15&x[6]|y,x[8]=63&x[8]|128,G)for(u=0;16>u;++u)G[M+u]=x[u];return G||V(x)};try{F.name=n}catch(x){}return F.DNS='6ba7b810-9dad-11d1-80b4-00c04fd430c8',F.URL='6ba7b811-9dad-11d1-80b4-00c04fd430c8',F}function U(n,y){var z=(65535&n)+(65535&y);return(n>>16)+(y>>16)+(z>>16)<<16|65535&z}function N(n,y,z,F,x,u){return U((G=U(U(y,n),U(F,u)))<<(M=x)|G>>>32-M,z);var G,M}function ha(n,y,z,F,x,u,G){return N(y&z|~y&F,n,y,x,u,G)}function R(n,y,z,F,x,u,G){return N(y&F|z&~F,n,y,x,u,G)}function S(n,
|
|
45
|
+
y,z,F,x,u,G){return N(z^(y|~F),n,y,x,u,G)}for(var v='undefined'!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||'undefined'!=typeof msCrypto&&'function'==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),I=new Uint8Array(16),w,za,va=[],P=0;256>P;++P)va[P]=(P+256).toString(16).substr(1);var K=0,A=0;P=la('v3',48,function(n){if('string'==typeof n){var y=unescape(encodeURIComponent(n));n=Array(y.length);for(var z=0;z<y.length;z++)n[z]=y.charCodeAt(z)}return function(F){var x,
|
|
46
|
+
u=[],G=32*F.length;for(x=0;x<G;x+=8){var M=F[x>>5]>>>x%32&255;M=parseInt('0123456789abcdef'.charAt(M>>>4&15)+'0123456789abcdef'.charAt(15&M),16);u.push(M)}return u}(function(F,x){F[x>>5]|=128<<x%32;F[14+(x+64>>>9<<4)]=x;var u=1732584193,G=-271733879,M=-1732584194,T=271733878;for(x=0;x<F.length;x+=16){var ra=u;var Ea=G;var W=M;var ia=T;u=ha(u,G,M,T,F[x],7,-680876936);T=ha(T,u,G,M,F[x+1],12,-389564586);M=ha(M,T,u,G,F[x+2],17,606105819);G=ha(G,M,T,u,F[x+3],22,-1044525330);u=ha(u,G,M,T,F[x+4],7,-176418897);
|
|
47
|
+
T=ha(T,u,G,M,F[x+5],12,1200080426);M=ha(M,T,u,G,F[x+6],17,-1473231341);G=ha(G,M,T,u,F[x+7],22,-45705983);u=ha(u,G,M,T,F[x+8],7,1770035416);T=ha(T,u,G,M,F[x+9],12,-1958414417);M=ha(M,T,u,G,F[x+10],17,-42063);G=ha(G,M,T,u,F[x+11],22,-1990404162);u=ha(u,G,M,T,F[x+12],7,1804603682);T=ha(T,u,G,M,F[x+13],12,-40341101);M=ha(M,T,u,G,F[x+14],17,-1502002290);G=ha(G,M,T,u,F[x+15],22,1236535329);u=R(u,G,M,T,F[x+1],5,-165796510);T=R(T,u,G,M,F[x+6],9,-1069501632);M=R(M,T,u,G,F[x+11],14,643717713);G=R(G,M,T,u,F[x],
|
|
48
|
+
20,-373897302);u=R(u,G,M,T,F[x+5],5,-701558691);T=R(T,u,G,M,F[x+10],9,38016083);M=R(M,T,u,G,F[x+15],14,-660478335);G=R(G,M,T,u,F[x+4],20,-405537848);u=R(u,G,M,T,F[x+9],5,568446438);T=R(T,u,G,M,F[x+14],9,-1019803690);M=R(M,T,u,G,F[x+3],14,-187363961);G=R(G,M,T,u,F[x+8],20,1163531501);u=R(u,G,M,T,F[x+13],5,-1444681467);T=R(T,u,G,M,F[x+2],9,-51403784);M=R(M,T,u,G,F[x+7],14,1735328473);G=R(G,M,T,u,F[x+12],20,-1926607734);u=N(G^M^T,u,G,F[x+5],4,-378558);T=N(u^G^M,T,u,F[x+8],11,-2022574463);M=N(T^u^G,M,
|
|
49
|
+
T,F[x+11],16,1839030562);G=N(M^T^u,G,M,F[x+14],23,-35309556);u=N(G^M^T,u,G,F[x+1],4,-1530992060);T=N(u^G^M,T,u,F[x+4],11,1272893353);M=N(T^u^G,M,T,F[x+7],16,-155497632);G=N(M^T^u,G,M,F[x+10],23,-1094730640);u=N(G^M^T,u,G,F[x+13],4,681279174);T=N(u^G^M,T,u,F[x],11,-358537222);M=N(T^u^G,M,T,F[x+3],16,-722521979);G=N(M^T^u,G,M,F[x+6],23,76029189);u=N(G^M^T,u,G,F[x+9],4,-640364487);T=N(u^G^M,T,u,F[x+12],11,-421815835);M=N(T^u^G,M,T,F[x+15],16,530742520);G=N(M^T^u,G,M,F[x+2],23,-995338651);u=S(u,G,M,T,
|
|
50
|
+
F[x],6,-198630844);T=S(T,u,G,M,F[x+7],10,1126891415);M=S(M,T,u,G,F[x+14],15,-1416354905);G=S(G,M,T,u,F[x+5],21,-57434055);u=S(u,G,M,T,F[x+12],6,1700485571);T=S(T,u,G,M,F[x+3],10,-1894986606);M=S(M,T,u,G,F[x+10],15,-1051523);G=S(G,M,T,u,F[x+1],21,-2054922799);u=S(u,G,M,T,F[x+8],6,1873313359);T=S(T,u,G,M,F[x+15],10,-30611744);M=S(M,T,u,G,F[x+6],15,-1560198380);G=S(G,M,T,u,F[x+13],21,1309151649);u=S(u,G,M,T,F[x+4],6,-145523070);T=S(T,u,G,M,F[x+11],10,-1120210379);M=S(M,T,u,G,F[x+2],15,718787259);G=S(G,
|
|
51
|
+
M,T,u,F[x+9],21,-343485551);u=U(u,ra);G=U(G,Ea);M=U(M,W);T=U(T,ia)}return[u,G,M,T]}(function(F){var x,u=[];u[(F.length>>2)-1]=void 0;for(x=0;x<u.length;x+=1)u[x]=0;var G=8*F.length;for(x=0;x<G;x+=8)u[x>>5]|=(255&F[x/8])<<x%32;return u}(n),8*n.length))});var E=la('v5',80,function(n){var y=[1518500249,1859775393,2400959708,3395469782],z=[1732584193,4023233417,2562383102,271733878,3285377520];if('string'==typeof n){var F=unescape(encodeURIComponent(n));n=Array(F.length);for(var x=0;x<F.length;x++)n[x]=
|
|
52
|
+
F.charCodeAt(x)}n.push(128);F=Math.ceil((n.length/4+2)/16);var u=Array(F);for(x=0;x<F;x++){u[x]=Array(16);for(var G=0;16>G;G++)u[x][G]=n[64*x+4*G]<<24|n[64*x+4*G+1]<<16|n[64*x+4*G+2]<<8|n[64*x+4*G+3]}u[F-1][14]=8*(n.length-1)/Math.pow(2,32);u[F-1][14]=Math.floor(u[F-1][14]);u[F-1][15]=8*(n.length-1)&4294967295;for(x=0;x<F;x++){n=Array(80);for(G=0;16>G;G++)n[G]=u[x][G];for(G=16;80>G;G++){var M=n[G-3]^n[G-8]^n[G-14]^n[G-16];n[G]=M<<1|M>>>31}M=z[0];var T=z[1],ra=z[2],Ea=z[3],W=z[4];for(G=0;80>G;G++){var ia=
|
|
53
53
|
Math.floor(G/20),ea=M<<5|M>>>27;a:{switch(ia){case 0:var Aa=T&ra^~T&Ea;break a;case 1:Aa=T^ra^Ea;break a;case 2:Aa=T&ra^T&Ea^ra&Ea;break a;case 3:Aa=T^ra^Ea;break a}Aa=void 0}ia=ea+Aa+W+y[ia]+n[G]>>>0;W=Ea;Ea=ra;ra=(T<<30|T>>>2)>>>0;T=M;M=ia}z[0]=z[0]+M>>>0;z[1]=z[1]+T>>>0;z[2]=z[2]+ra>>>0;z[3]=z[3]+Ea>>>0;z[4]=z[4]+W>>>0}return[z[0]>>24&255,z[0]>>16&255,z[0]>>8&255,255&z[0],z[1]>>24&255,z[1]>>16&255,z[1]>>8&255,255&z[1],z[2]>>24&255,z[2]>>16&255,z[2]>>8&255,255&z[2],z[3]>>24&255,z[3]>>16&255,z[3]>>
|
|
54
|
-
8&255,255&z[3],z[4]>>24&255,z[4]>>16&255,z[4]>>8&255,255&z[4]]});B.v1=function(n,y,z){z=y&&z||0;var F=y||[],
|
|
55
|
-
K=G;A=M;za=
|
|
54
|
+
8&255,255&z[3],z[4]>>24&255,z[4]>>16&255,z[4]>>8&255,255&z[4]]});B.v1=function(n,y,z){z=y&&z||0;var F=y||[],x=(n=n||{}).node||w,u=void 0!==n.clockseq?n.clockseq:za;if(null==x||null==u){var G=n.random||(n.rng||Q)();null==x&&(x=w=[1|G[0],G[1],G[2],G[3],G[4],G[5]]);null==u&&(u=za=16383&(G[6]<<8|G[7]))}G=void 0!==n.msecs?n.msecs:(new Date).getTime();var M=void 0!==n.nsecs?n.nsecs:A+1,T=G-K+(M-A)/1E4;if(0>T&&void 0===n.clockseq&&(u=u+1&16383),(0>T||G>K)&&void 0===n.nsecs&&(M=0),1E4<=M)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
55
|
+
K=G;A=M;za=u;n=(1E4*(268435455&(G+=122192928E5))+M)%4294967296;F[z++]=n>>>24&255;F[z++]=n>>>16&255;F[z++]=n>>>8&255;F[z++]=255&n;n=G/4294967296*1E4&268435455;F[z++]=n>>>8&255;F[z++]=255&n;F[z++]=n>>>24&15|16;F[z++]=n>>>16&255;F[z++]=u>>>8|128;F[z++]=255&u;for(u=0;6>u;++u)F[z+u]=x[u];return y||V(F)};B.v3=P;B.v4=function(n,y,z){z=y&&z||0;'string'==typeof n&&(y='binary'===n?Array(16):null,n=null);var F=(n=n||{}).random||(n.rng||Q)();if(F[6]=15&F[6]|64,F[8]=63&F[8]|128,y)for(n=0;16>n;++n)y[z+n]=F[n];
|
|
56
56
|
return y||V(F)};B.v5=E;Object.defineProperty(B,'__esModule',{value:!0})});
|
|
57
|
-
function Merge(){var B=[],Q=!1,V=function(N,ha){var R=N;Q||('object'==typeof N&&Array.isArray(N),Q=!0);'undefined'==typeof R&&(R='undefined'!=typeof ha&&Array.isArray(ha)?[]:{});var S=!1;'boolean'==typeof arguments[arguments.length-1]&&(S=arguments[arguments.length-1]);var
|
|
58
|
-
typeof arguments[
|
|
59
|
-
E[n]=la(K[n],E[n],S):E[n]=K[n]:Array.isArray(K[n])&&Array.isArray(E[n])&&(E[n]=la(K[n],E[n],S));R[va]=E}else{for(n in K)'undefined'==typeof E[n]?Array.isArray(K[n])&&Array.isArray(E[n])?E[n]=la(K[n],E[n],S):E[n]=K[n]:Array.isArray(K[n])&&Array.isArray(E[n])&&(E[n]=la(K[n],E[n],S));'boolean'==typeof P||A?A&&(R[va]=E):R[va]=V(E,K,S)}}}else void 0!==K&&(R[va]='undefined'==typeof P||null==P||P===K||S?K:P)}}B=[];Q=!1;return R},la=function(N,ha,R){B=[];var S=[],
|
|
60
|
-
typeof N[0]&&null!=N[0]&&'undefined'!=typeof N[0][
|
|
61
|
-
0==N.length||'undefined'==typeof N?/^true$/i.test(R)?N:ha:N}if(0==N.length&&0<ha.length)return B=ha;if(0==ha.length&&0<N.length)for(I=0;I<N.length;++I)ha.push(N[I]);if(0==B.length&&0<ha.length)for(I=0;I<ha.length;++I)'object'!=typeof ha[I]&&-1==B.indexOf(ha[I])&&B.push(ha[I]);if(0<ha.length){if('undefined'!=typeof N[0]&&'object'==typeof N[0]&&null!=N[0]&&'undefined'!=typeof N[0][
|
|
62
|
-
var P=null;I=0;for(N=B.length;I<N;++I)S.push(B[I][
|
|
63
|
-
'undefined'!=typeof S&&null!=S&&(S=S[0]||null),-1<ha.indexOf(N[I])&&R)ha.splice(ha.indexOf(N[I]),1,N[I]);else if('undefined'==typeof B[I]&&'object'==typeof N[I])for(
|
|
57
|
+
function Merge(){var B=[],Q=!1,V=function(N,ha){var R=N;Q||('object'==typeof N&&Array.isArray(N),Q=!0);'undefined'==typeof R&&(R='undefined'!=typeof ha&&Array.isArray(ha)?[]:{});var S=!1;'boolean'==typeof arguments[arguments.length-1]&&(S=arguments[arguments.length-1]);var v=1,I=arguments.length,w,za;if('object'!==typeof R&&'function'!==typeof R)R=S?'undefined'==typeof arguments[2]?arguments[1]:arguments[2]:'undefined'==typeof arguments[0]?arguments[1]:arguments[0];else for(;v<I;++v)if('boolean'!=
|
|
58
|
+
typeof arguments[v]&&null!=(w=arguments[v])){if('object'!=typeof w){R=w;break}if(Array.isArray(w)&&Array.isArray(R))R=la(w,R,S);else for(var va in w){R||={name:null};var P=R[va];var K=w[va];if(R!==K)if(K&&(U(K)||(za=Array.isArray(K)))){var A=!1;if(za){za=!1;if(P&&Array.isArray(P))var E=P||[];else if(U(P)){E=P||{};R[va]=E;continue}else E=[];B=E;E=la(K,E,S);R[va]=E}else{E=P&&U(P)?P:null;if(!E){A=!0;E={};for(var n in K)E[n]=K[n]}if(S){for(n in K)'undefined'!=typeof K[n]?Array.isArray(K[n])&&Array.isArray(E[n])?
|
|
59
|
+
E[n]=la(K[n],E[n],S):E[n]=K[n]:Array.isArray(K[n])&&Array.isArray(E[n])&&(E[n]=la(K[n],E[n],S));R[va]=E}else{for(n in K)'undefined'==typeof E[n]?Array.isArray(K[n])&&Array.isArray(E[n])?E[n]=la(K[n],E[n],S):E[n]=K[n]:Array.isArray(K[n])&&Array.isArray(E[n])&&(E[n]=la(K[n],E[n],S));'boolean'==typeof P||A?A&&(R[va]=E):R[va]=V(E,K,S)}}}else void 0!==K&&(R[va]='undefined'==typeof P||null==P||P===K||S?K:P)}}B=[];Q=!1;return R},la=function(N,ha,R){B=[];var S=[],v=V.getKeyComparison();if(/^true$/i.test(R)){if('object'==
|
|
60
|
+
typeof N[0]&&null!=N[0]&&'undefined'!=typeof N[0][v]&&'object'==typeof ha[0]&&'undefined'!=typeof ha[0][v]){B=Array.isArray(ha)?Array.from(ha):JSON.clone(ha);var I=0;for(R=B.length;I<R;++I)S.push(B[I][v]);R=JSON.clone(N);var w=0;I=0;N=R.length;for(var za=P||0,va=ha.length;za<va;++za)a:for(I=I||0;I<N;++I)if(R[I][v]===ha[za][v]){-1<S.indexOf(R[I][v])?(B[w]=R[I],++w):-1==S.indexOf(R[I][v])&&(S.push(R[I][v]),B[w]=R[I],++w);break a}else-1==S.indexOf(R[I][v])&&(S.push(R[I][v]),B.push(R[I]));return B}return Array.isArray(N)&&
|
|
61
|
+
0==N.length||'undefined'==typeof N?/^true$/i.test(R)?N:ha:N}if(0==N.length&&0<ha.length)return B=ha;if(0==ha.length&&0<N.length)for(I=0;I<N.length;++I)ha.push(N[I]);if(0==B.length&&0<ha.length)for(I=0;I<ha.length;++I)'object'!=typeof ha[I]&&-1==B.indexOf(ha[I])&&B.push(ha[I]);if(0<ha.length){if('undefined'!=typeof N[0]&&'object'==typeof N[0]&&null!=N[0]&&'undefined'!=typeof N[0][v]&&'object'==typeof ha[0]&&'undefined'!=typeof ha[0][v]){B=Array.isArray(ha)?Array.from(ha):JSON.clone(ha);R=JSON.clone(N);
|
|
62
|
+
var P=null;I=0;for(N=B.length;I<N;++I)S.push(B[I][v]);for(I=0;I<N;++I)a:for(za=P||0,va=R.length;za<va;++za)if(null!=R[za]&&'undefined'!=typeof R[za][v]&&R[za][v]!==B[I][v]){if(-1==S.indexOf(R[za][v])){B.push(R[za]);S.push(R[za][v]);P=za+1;N<va&&++N;break a}}else if(null!=R[za]&&'undefined'!=typeof R[za][v]&&R[za][v]===B[I][v])P=za+1;else break a;return B}for(I=0;I<N.length;++I)if(S=null,'undefined'==typeof N||'object'!=typeof N[I]||Array.isArray(N[I])||null==N[I]||(S=Object.getOwnPropertyNames(N[I])),
|
|
63
|
+
'undefined'!=typeof S&&null!=S&&(S=S[0]||null),-1<ha.indexOf(N[I])&&R)ha.splice(ha.indexOf(N[I]),1,N[I]);else if('undefined'==typeof B[I]&&'object'==typeof N[I])for(w in B=ha,'undefined'==typeof B[I]&&(B[I]={}),N[I])B[I].hasOwnProperty(w)||(B[I][w]=N[I][w]);else!R&&-1<B.indexOf(N[I])&&/number/i.test(typeof N[I])&&N[I]!==B[I]?B.push(N[I]):'undefined'==typeof ha[I]||/null/i.test(ha[I])||'undefined'==typeof ha[I][v]||'undefined'==typeof N[I]||'undefined'==typeof N[I][v]||ha[I][v]!=N[I][v]?-1==B.indexOf(N[I])&&
|
|
64
64
|
'object'!=typeof N[I]?B.push(N[I]):'undefined'==typeof ha[I]||/null/i.test(ha[I])||'undefined'==typeof ha[I][S]||'undefined'==typeof N[I]||'undefined'==typeof N[I][S]||ha[I][S]!=N[I][S]||(B[I]=R?N[I]:ha[I]):B[I]=R?N[I]:ha[I]}if(0<B.length&&0<ha.length||0==B.length&&0==ha.length)return B};la.prototype.setKeyComparison=function(N){this.keyComparison=N};var U=function(N){if(!N||'[object Object]'!=={}.toString.call(N)||N.nodeType||N.setInterval)return!1;var ha={}.hasOwnProperty,R=ha.call(N,'constructor');
|
|
65
65
|
ha='undefined'!=typeof N.constructor?ha.call(N.constructor.prototype,'isPrototypeOf'):!1;return!N.constructor||R||ha?!0:!1};V.setKeyComparison=function(N){la.keyComparison=N;return V};V.getKeyComparison=function(){var N=la.keyComparison||'id';la.keyComparison='id';return N};return V}'undefined'!==typeof module&&module.exports?('undefined'==typeof JSON.clone&&require('../../../helpers'),module.exports=Merge()):'function'===typeof define&&define.amd&&define('lib/merge',[],function(){return Merge()});
|
|
66
66
|
function registerEvents(B,Q){'undefined'==typeof gina&&'undefined'!=typeof window.gina&&(gina=window.gina);gina.registeredEvents[B]=Q}function mergeEventProps(B,Q){for(let V in Q)'undefined'==typeof B[V]&&(B[V]=Q[V]);return B}
|
|
67
|
-
function addListener(B,Q,V,la){var U=function(R,S,
|
|
67
|
+
function addListener(B,Q,V,la){var U=function(R,S,v,I){'undefined'!=typeof R.event&&R.event.isTouchSupported&&/^(click|mouseout|mouseover)/.test(v)&&-1==R.event[v].indexOf(S)&&(R.event[v][R.event[v].length]=S);'undefined'!=typeof S&&null!=S?S.addEventListener?S.addEventListener(v,I,!1):S.attachEvent&&S.attachEvent('on'+v,I):R.customEvent.addListener(v,I);gina.events[v]='undefined'!=typeof S.id&&'object'!=typeof S.id?S.id:S.getAttribute('id')},N=0,ha=null;if(Array.isArray(V))for(ha=V.length;N<ha;N++)U(B,
|
|
68
68
|
Q,V[N],la);else if(Array.isArray(Q))for(N=0,ha=Q.length;N<ha;N++){let R=/\.$/.test(V)?V+Q[N].id:V;U(B,Q[N],R,la)}else V=/\.$/.test(V)?V+Q.id:V,U(B,Q,V,la)}
|
|
69
69
|
function triggerEvent(B,Q,V,la,U){if('undefined'!=typeof Q&&null!=Q){B=!1;if(jQuery){var N=jQuery.fn.jquery.split(/\./);N=2<N.length?N.splice(0,2).join('.'):N.join('.');N='1.7'>=N?jQuery(Q).data('events'):jQuery._data(jQuery(Q)[0],'events');if(N='undefined'!=typeof N&&'undefined'!=typeof N[V]?!0:!1)N=jQuery.Event(V),jQuery(Q).trigger(N,la),B=N.isDefaultPrevented()}window.CustomEvent||document.createEvent?(window.CustomEvent?N=new CustomEvent(V,{detail:la,bubbles:!0,cancelable:!0,target:Q}):(N=document.createEvent('HTMLEvents'),
|
|
70
70
|
N.detail=la,N.target=Q,N.initEvent(V,!0,!0),N.eventName=V),U&&(N=mergeEventProps(N,U)),'undefined'!=typeof N.defaultPrevented&&N.defaultPrevented&&(B=N.defaultPrevented),B||Q.dispatchEvent(N)):document.createEventObject&&(N=document.createEventObject(),N.srcElement.id=Q.id,N.detail=la,N.target=Q,U&&(N=mergeEventProps(N,U)),Q.fireEvent('on'+V,N))}else B.customEvent.fire(V,la)}
|
|
@@ -72,18 +72,18 @@ function cancelEvent(B){'undefined'!=typeof B&&null!=B&&(B.cancelBubble=!0,B.pre
|
|
|
72
72
|
function setupXhr(B){var Q=null;if(window.XMLHttpRequest)Q=new XMLHttpRequest;else if(window.ActiveXObject)try{Q=new ActiveXObject('Msxml2.XMLHTTP')}catch(la){try{Q=new ActiveXObject('Microsoft.XMLHTTP')}catch(U){}}if('undefined'!=typeof B){if(!B.url||'undefined'==typeof B.url)throw Error('Missing `options.url`');'undefined'==typeof B.method&&(B.method='GET');B.method=B.method.toUpperCase();if(B.withCredentials){if('withCredentials'in Q)B.isSynchrone?Q.open(B.method,B.url,B.isSynchrone):Q.open(B.method,
|
|
73
73
|
B.url);else if('undefined'!=typeof XDomainRequest)Q=new XDomainRequest,Q.open(B.method,B.url);else{result='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';triggerEvent(gina,$target,'error.'+id,result);return}Q.responseType='undefined'!=typeof B.responseType?B.responseType:'';Q.withCredentials=!0}else B.isSynchrone?Q.open(B.method,B.url,B.isSynchrone):Q.open(B.method,B.url);for(var V in B.headers)'Content-Type'==V&&'undefined'!=typeof enctype&&null!=
|
|
74
74
|
enctype&&''!=enctype||Q.setRequestHeader(V,B.headers[V])}return Q}
|
|
75
|
-
function handleXhr(B,Q,V,la){if(!B)throw Error('No `xhr` object initiated');var U=null,N=null,ha=null,R=null,S=null,
|
|
76
|
-
I&&
|
|
77
|
-
I&&(I.eventData.error=K);
|
|
75
|
+
function handleXhr(B,Q,V,la){if(!B)throw Error('No `xhr` object initiated');var U=null,N=null,ha=null,R=null,S=null,v=V.$link||null,I=V.$form||null,w=null;delete V.$link;delete V.$form;I||v?v?(v.target=document.getElementById(v.id),w=gina.link.target,S=gina.link.id):(w=I.target,S=w.getAttribute('id')):(w=Q,S=w.getAttribute('id'));var za=v&&Q.getAttribute('data-gina-link-event-on-success')||v&&Q.getAttribute('data-gina-link-event-on-error')?!0:!1,va=I&&w.getAttribute('data-gina-form-event-on-submit-success')||
|
|
76
|
+
I&&w.getAttribute('data-gina-form-event-on-submit-error')?!0:!1;va&&I&&listenToXhrEvents(I,'form');Q=Q.getAttribute('enctype')||V.headers['Content-Type'];for(var P in V.headers)'Content-Type'==P&&'undefined'!=typeof Q&&null!=Q&&''!=Q||B.setRequestHeader(P,V.headers[P]);B.withCredentials='undefined'!=typeof V.withCredentials?V.withCredentials:!1;B.onerror=function(K,A){K={status:B.status||500,error:'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.'};
|
|
77
|
+
I&&(I.eventData.error=K);v&&(v.eventData.error=K);window.ginaToolbar.update('data-xhr',K,!0);triggerEvent(gina,w,'error.'+S,K);va&&triggerEvent(gina,w,'error.'+S+'.hform',K);za&&triggerEvent(gina,w,'error.'+S+'.hlink',K)};B.onreadystatechange=function(K){K=/Google Inc/i.test(navigator.vendor)?50:0;2==B.readyState&&(N=/^attachment;/.test(B.getResponseHeader('Content-Disposition'))?!0:!1,!B.responseType&&N&&(B.responseType='blob'));if(4==B.readyState)if(U=null,ha=B.getResponseHeader('Content-Type'),
|
|
78
78
|
/^2/.test(B.status)){try{if(/blob/.test(B.responseType)||N){if('undefined'==typeof ha||null==ha)ha='application/octet-stream';U=new Blob([this.response],{type:ha});var A=document.createElement('a');A.style='display: none';document.body.appendChild(A);var E=window.URL.createObjectURL(U);A.href=E;var n=B.getResponseHeader('Content-Disposition');A.download=n.match('=(.*)')[0].substr(1);A.click();window.URL.revokeObjectURL(E);R={status:B.status,statusText:B.statusText,responseType:U.type,type:U.type,
|
|
79
79
|
size:U.size}}!R&&/\/json/.test(ha)&&(R=JSON.parse(B.responseText),'undefined'==typeof R.status&&(R.status=B.status||200));if(!R&&/\/html/.test(ha)&&(R={contentType:ha,content:B.responseText},'undefined'==typeof R.status&&(R.status=B.status),'undefined'!=typeof gina.popin&&gina.hasPopinHandler)){var y=gina.popin.getActivePopin();if(y){XHRData={};try{XHRData=(new DOMParser).parseFromString(R.content,'text/html').getElementById('gina-without-layout-xhr-data'),XHRData=JSON.parse(decodeURIComponent(XHRData.value)),
|
|
80
|
-
XHRView=(new DOMParser).parseFromString(R.content,'text/html').getElementById('gina-without-layout-xhr-view'),XHRView=JSON.parse(decodeURIComponent(XHRView.value)),gina&&typeof window.ginaToolbar&&'undefined'!=typeof XHRData&&window.ginaToolbar.update('data-xhr',XHRData),gina&&typeof window.ginaToolbar&&'undefined'!=typeof XHRView&&window.ginaToolbar.update('view-xhr',XHRView)}catch(
|
|
81
|
-
(I.eventData.success=R);XHRData=R;if(gina&&'object'==typeof window.ginaToolbar&&XHRData)try{'undefined'!=typeof XHRData&&/\/html/.test(ha)&&window.ginaToolbar.update('data-xhr',XHRData)}catch(
|
|
82
|
-
window.ginaToolbar.update('data-xhr',XHRData)}catch(G){throw G;}triggerEvent(gina,
|
|
83
|
-
new Blob([this.response],{type:'text/plain'});var z=new FileReader,F='';z.addEventListener('loadend',
|
|
84
|
-
typeof R.error.fields){
|
|
85
|
-
|
|
86
|
-
'error.'+S+'.hlink',R)}};B.onprogress=function(K){var A='0';K.lengthComputable&&(A=K.loaded/K.total,A=parseInt(100*A));K={status:100,progress:A};I&&(I.eventData.onprogress=K);triggerEvent(gina,
|
|
80
|
+
XHRView=(new DOMParser).parseFromString(R.content,'text/html').getElementById('gina-without-layout-xhr-view'),XHRView=JSON.parse(decodeURIComponent(XHRView.value)),gina&&typeof window.ginaToolbar&&'undefined'!=typeof XHRData&&window.ginaToolbar.update('data-xhr',XHRData),gina&&typeof window.ginaToolbar&&'undefined'!=typeof XHRView&&window.ginaToolbar.update('view-xhr',XHRView)}catch(u){throw u;}y.loadContent(R.content);R=XHRData;triggerEvent(gina,w,'success.'+S,R);return}}R||(R=B.responseText);I&&
|
|
81
|
+
(I.eventData.success=R);XHRData=R;if(gina&&'object'==typeof window.ginaToolbar&&XHRData)try{'undefined'!=typeof XHRData&&/\/html/.test(ha)&&window.ginaToolbar.update('data-xhr',XHRData)}catch(u){throw u;}triggerEvent(gina,w,'success.'+S,R);va&&triggerEvent(gina,w,'success.'+S+'.hform',R);za&&triggerEvent(gina,w,'success.'+S+'.hlink',R)}catch(u){R={status:422,error:u.message,stack:u.stack};I&&(I.eventData.error=R);XHRData=R;if(gina&&'object'==typeof window.ginaToolbar&&XHRData)try{'undefined'!=typeof XHRData&&
|
|
82
|
+
window.ginaToolbar.update('data-xhr',XHRData)}catch(G){throw G;}triggerEvent(gina,w,'error.'+S,R);va&&triggerEvent(gina,w,'error.'+S+'.hform',R);za&&triggerEvent(gina,w,'error.'+S+'.hlink',R)}if('undefined'!=typeof R&&'undefined'!=typeof R.location)return window.location.hash='',R.location=/^http/.test(R.location)||/^\//.test(R.location)?R.location:location.protocol+'//'+R.location,setTimeout(()=>{window.location.href=R.location},K)}else if(0!=B.status)if(R={status:B.status,message:''},/blob/.test(B.responseType)){U=
|
|
83
|
+
new Blob([this.response],{type:'text/plain'});var z=new FileReader,F='';z.addEventListener('loadend',u=>{/string/i.test(typeof u.srcElement.result)?F+=u.srcElement.result:'object'==typeof u.srcElement.result?R=merge(R,u.srcElement.result):R.message+=u.srcElement.result;if(/^2/.test(z.readyState)){if(/^(\{|\[)/.test(F))try{R=merge(R,JSON.parse(F))}catch(T){R=merge(R,T)}R.message||delete R.message;I&&(I.eventData.error=R);if('undefined'!=typeof R&&'undefined'!=typeof R.error&&R.error.fields&&'object'==
|
|
84
|
+
typeof R.error.fields){u={};var G=0,M;for(M in R.error.fields)++G,u[M]={isApplicationValidationError:R.error.fields[M]};0<G&&handleErrorsDisplay(I.target,u)}XHRData=R;if(gina&&'object'==typeof window.ginaToolbar&&XHRData)try{window.ginaToolbar.update('data-xhr',XHRData)}catch(T){throw T;}triggerEvent(gina,w,'error.'+S,R);va&&triggerEvent(gina,w,'error.'+S+'.hform',R);za&&triggerEvent(gina,w,'error.'+S+'.hlink',R)}});z.readAsText(U)}else{try{R=merge(R,JSON.parse(B.responseText))}catch(u){R=merge(R,
|
|
85
|
+
u)}I&&(I.eventData.error=R);if('undefined'!=typeof R&&'undefined'!=typeof R.error&&R.error.fields&&'object'==typeof R.error.fields){A={};E=0;for(var x in R.error.fields)++E,A[x]={isApplicationValidationError:R.error.fields[x]};0<E&&handleErrorsDisplay(I.target,A)}XHRData=R;if(gina&&'object'==typeof window.ginaToolbar&&XHRData)try{window.ginaToolbar.update('data-xhr',XHRData)}catch(u){throw u;}triggerEvent(gina,w,'error.'+S,R);va&&triggerEvent(gina,w,'error.'+S+'.hform',R);za&&triggerEvent(gina,w,
|
|
86
|
+
'error.'+S+'.hlink',R)}};B.onprogress=function(K){var A='0';K.lengthComputable&&(A=K.loaded/K.total,A=parseInt(100*A));K={status:100,progress:A};I&&(I.eventData.onprogress=K);triggerEvent(gina,w,'progress.'+S,K)};B.ontimeout=function(K){R={status:408,error:'Request Timeout'};I&&(I.eventData.ontimeout=R);triggerEvent(gina,w,'error.'+S,R);va&&triggerEvent(gina,w,'error.'+S+'.hform',R);za&&triggerEvent(gina,w,'error.'+S+'.hlink',R)}}
|
|
87
87
|
function removeListener(B,Q,V,la){'undefined'!=typeof B.event&&B.event.isTouchSupported&&/^(click|mouseout|mouseover)/.test(V)&&-1!=B.event[V].indexOf(Q)&&B.event[V].splice(B.event[V].indexOf(Q),1);if('undefined'!=typeof Q&&null!=Q)if(Q.removeEventListener)if(Array.isArray(Q))for(i=0,len=Q.length;i<len;i++)B=/\.$/.test(V)?V+Q[i].id:V,Q.removeEventListener(B,la,!1),'undefined'!=typeof gina.events[B]&&delete gina.events[B];else V=/\.$/.test(V)?V+Q.id:V,Q.removeEventListener(V,la,!1);else{if(Q.attachEvent)if(Array.isArray(Q))for(i=
|
|
88
88
|
0,len=Q.length;i<len;i++)B=/\.$/.test(V)?V+Q[i].id:V,Q.detachEvent('on'+B,la),'undefined'!=typeof gina.events[B]&&delete gina.events[B];else V=/\.$/.test(V)?V+Q.id:V,Q.detachEvent('on'+V,la)}else if(Array.isArray(Q))for(i=0,len=Q.length;i<len;i++){let U=/\.$/.test(V)?V+Q[i].id:V;B.customEvent.removeListener(U,la);'undefined'!=typeof gina.events[U]&&delete gina.events[U]}else V=/\.$/.test(V)?V+Q.id:V,B.customEvent.removeListener(V,la);'undefined'!=typeof gina.events[V]&&delete gina.events[V];'undefined'!=
|
|
89
89
|
typeof la&&la()}
|
|
@@ -93,34 +93,34 @@ Q&&Q(U,N)}),this.initialized&&!this.isReady&&triggerEvent(gina,V,'init.'+la));re
|
|
|
93
93
|
function PrototypesHelper(B){var Q='undefined'!==typeof module&&module.exports?!1:!0,V=B||null;B=null;if('undefined'==typeof GINA_DIR&&!Q&&'undefined'!=typeof process&&3<process.argv.length)if(/^\{/.test(process.argv[2]))B=JSON.parse(process.argv[2]).envVars;else if(/\.ctx$/.test(process.argv[2])){B=require('fs');var la=process.argv[2].split(/\-\-argv\-filename=/)[1];B=JSON.parse(B.readFileSync(la).toString()).envVars}if(V&&'undefined'!=typeof V&&'undefined'!=typeof V.dateFormat)for(let U in V.dateFormat)'undefined'==
|
|
94
94
|
typeof Date[U]&&Object.defineProperty(Date.prototype,U,{writable:!1,enumerable:!1,configurable:!0,value:function(){var N={0:this},ha=1,R;for(R in arguments)N[ha]=arguments[R],++ha;N.length=ha;return V.dateFormat[U].apply(this,N)}});'undefined'==typeof Array.clone&&Object.defineProperty(Array.prototype,'clone',{writable:!1,enumerable:!1,configurable:!0,value:function(){return this.slice(0)}});'undefined'!=typeof JSON.clone||Q||('undefined'!=typeof B&&null!=B?JSON.clone=require(B.GINA_DIR+'/utils/prototypes.json_clone'):
|
|
95
95
|
(B||(Q=process.cwd().match(/.*\/gina/)[0],require(Q+'/utils/helper'),setEnvVar('GINA_DIR',Q,!0),B=getEnvVars()),JSON.clone=require(getEnvVar('GINA_DIR')+'/utils/prototypes.json_clone')));'undefined'==typeof JSON.escape&&(JSON.escape=function(U){try{return U.replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/\t/g,'\\t')}catch(N){throw N;}});'undefined'==typeof Array.toString&&(Array.prototype.toString=function(){return this.join()});'undefined'==typeof Array.inArray&&Object.defineProperty(Array.prototype,
|
|
96
|
-
'inArray',{writable:!1,enumerable:!1,configurable:!0,value:function(U){return-1!=this.indexOf(U)}});'undefined'==typeof Array.from&&Object.defineProperty(Array.prototype,'from',{writable:!1,enumerable:!1,configurable:!0,value:function(U){for(var N={},ha=[],R=U.length,S=0,
|
|
96
|
+
'inArray',{writable:!1,enumerable:!1,configurable:!0,value:function(U){return-1!=this.indexOf(U)}});'undefined'==typeof Array.from&&Object.defineProperty(Array.prototype,'from',{writable:!1,enumerable:!1,configurable:!0,value:function(U){for(var N={},ha=[],R=U.length,S=0,v=0;v<R;v++){var I=U[v];1!==N[I]&&(N[I]=1,ha[S++]=I)}return ha}});'undefined'==typeof Object.count&&Object.defineProperty(Object.prototype,'count',{writable:!0,enumerable:!1,configurable:!0,value:function(){var U=0;try{this instanceof
|
|
97
97
|
String&&JSON.parse(this);for(var N in this)this.hasOwnProperty(N)&&++U;return U}catch(ha){return U}}});'undefined'!=typeof global&&'undefined'==typeof global.__stack&&Object.defineProperty(global,'__stack',{configurable:!0,get:function(){var U=Error.prepareStackTrace;Error.prepareStackTrace=function(ha,R){return R};var N=Error();Error.captureStackTrace(N,arguments.callee);N=N.stack;Error.prepareStackTrace=U;return N}})}
|
|
98
98
|
'undefined'!==typeof module&&module.exports?module.exports=PrototypesHelper:'function'===typeof define&&define.amd&&define('helpers/prototypes',[],function(){return PrototypesHelper});
|
|
99
99
|
function DateFormatHelper(){var B='undefined'!==typeof module&&module.exports?!1:!0,Q=B?require('lib/merge'):require('./../lib/merge');var V='en-US';var la='en';var U={'default':'ddd mmm dd yyyy HH:MM:ss',shortDate:'m/d/yy',shortDate2:'mm/dd/yyyy',mediumDate:'mmm d, yyyy',longDate:'mmmm d, yyyy',fullDate:'dddd, mmmm d, yyyy',cookieDate:'GMT:ddd, dd mmm yyyy HH:MM:ss',logger:'yyyy mmm dd HH:MM:ss',shortTime:'h:MM TT',shortTime2:'h:MM',mediumTime:'h:MM:ss TT',mediumTime2:'h:MM:ss',longTime:'h:MM:ss TT Z',
|
|
100
100
|
longTime2:'h:MM:ss TT',concatenatedDate:'yyyymmdd',isoDate:'yyyy-mm-dd',isoTime:'HH:MM:ss',shortIsoTime:'HH:MM',longIsoTime:'HH:MM:ss TT',isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",longIsoDateTime:"yyyy-mm-dd'T'HH:MM:ss.L",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};var N={en:{dayNames:'Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' '),monthNames:'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December'.split(' '),
|
|
101
101
|
masks:{'default':'ddd mmm dd yyyy HH:MM:ss',shortDate:'m/d/yy',shortDate2:'mm/dd/yyyy',mediumDate:'mmm d, yyyy',longDate:'mmmm d, yyyy',fullDate:'dddd, mmmm d, yyyy'}},fr:{dayNames:'dim lun mar mer jeu ven sam dimanche lundi mardi mercredi jeudi vendredi samedi'.split(' '),monthNames:'Jan F\u00e9v Mar Avr Mai Jui Juil Ao\u00fb Sep Oct Nov D\u00e9c Janvier F\u00e9vrier Mars Avril Mai Juin Juillet Ao\u00fbt Septembre Octobre Novembre D\u00e9cembre'.split(' '),masks:{'default':'ddd mmm dd yyyy HH:MM:ss',
|
|
102
|
-
shortDate:'d/m/yy',shortDate2:'dd/mm/yyyy',mediumDate:'d mmm, yyyy',longDate:'d mmmm, yyyy',fullDate:'dddd, d mmmm, yyyy'}}};var ha=function(
|
|
103
|
-
return{setCulture:function(
|
|
104
|
-
K=/[^-+\dA-Z]/g,A=function(T,ra){T=String(T);for(ra=ra||2;T.length<ra;)T='0'+T;return T};1!=arguments.length||'[object String]'!=Object.prototype.toString.call(
|
|
105
|
-
var G=
|
|
106
|
-
va%10]};return I.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(T){return T in M?M[T]:T.slice(1,T.length-1)})},countDaysTo:ha,getDaysTo:function(
|
|
107
|
-
|
|
108
|
-
[1,2,3,4];break;default:
|
|
109
|
-
I=I.replace(/\s+/g,'').toLowerCase();switch(I){case 'corporate':case 'eu':case 'iso8601':return S(
|
|
102
|
+
shortDate:'d/m/yy',shortDate2:'dd/mm/yyyy',mediumDate:'d mmm, yyyy',longDate:'d mmmm, yyyy',fullDate:'dddd, d mmmm, yyyy'}}};var ha=function(v,I){if(I instanceof Date)return v=v.getTime(),I=I.getTime(),Math.round(Math.abs(v-I)/864E5);throw Error('dateTo is not instance of Date() !');},R=['us','eu','corporate'],S=function(v){d=new Date(v.getFullYear(),v.getMonth(),v.getDate());v=d.getDay()||7;d.setDate(d.getDate()+4-v);v=new Date(Date.parse(d.getFullYear(),0,1));return Math.ceil(((d-v)/864E5+1)/7)};
|
|
103
|
+
return{setCulture:function(v,I){/\-/.test(I)?(V=I,la=I.split(/\-/)[0]):la=I;return this},format:function(v,I,w){var za=N[la]||N.en,va=null;try{va=Q(za.masks,U)}catch(T){Q=(B='undefined'!==typeof module&&module.exports?!1:!0)?require('lib/merge'):require('./../lib/merge'),va=Q(za.masks,U)}'undefined'!=typeof N[V]&&(za=N[V],'undefined'!=typeof N[V].mask&&(va=Q(za.masks,U)));var P=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
|
104
|
+
K=/[^-+\dA-Z]/g,A=function(T,ra){T=String(T);for(ra=ra||2;T.length<ra;)T='0'+T;return T};1!=arguments.length||'[object String]'!=Object.prototype.toString.call(v)||/\d/.test(v)||(I=v,v=void 0);v=v?new Date(v):new Date;if(isNaN(v))throw SyntaxError('invalid date');I=String(va[I]||I||va['default']);'UTC:'==I.slice(0,4)&&(I=I.slice(4),w=!0);var E=w?'getUTC':'get';va=v[E+'Date']();var n=v[E+'Day'](),y=v[E+'Month'](),z=v[E+'FullYear'](),F=v[E+'Hours'](),x=v[E+'Minutes'](),u=v[E+'Seconds']();E=v[E+'Milliseconds']();
|
|
105
|
+
var G=w?0:v.getTimezoneOffset(),M={d:va,dd:A(va),ddd:za.dayNames[n],dddd:za.dayNames[n+7],m:y+1,mm:A(y+1),mmm:za.monthNames[y],mmmm:za.monthNames[y+12],yy:String(z).slice(2),yyyy:z,h:F%12||12,hh:A(F%12||12),H:F,HH:A(F),M:x,MM:A(x),s:u,ss:A(u),l:A(E,3),L:A(E),t:12>F?'a':'p',tt:12>F?'am':'pm',T:12>F?'A':'P',TT:12>F?'AM':'PM',Z:w?'UTC':(String(v).match(P)||['']).pop().replace(K,''),o:(0<G?'-':'+')+A(100*Math.floor(Math.abs(G)/60)+Math.abs(G)%60,4),S:['th','st','nd','rd'][3<va%10?0:(10!=va%100-va%10)*
|
|
106
|
+
va%10]};return I.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(T){return T in M?M[T]:T.slice(1,T.length-1)})},countDaysTo:ha,getDaysTo:function(v,I,w){if(I instanceof Date){I=ha(v,I);var za=v.getMonth(),va=v.getFullYear();v=v.getDate()+1;v=new Date(va,za,v);za=[];for(va=0;va<I;++va)'undefined'!=typeof w?za.push((new Date(v)).format(w)):za.push(new Date(v)),v.setDate(v.getDate()+1);return za||[]}throw Error('dateTo is not instance of Date() !');},getDaysInMonth:function(v){var I=
|
|
107
|
+
v.getMonth();v=v.getFullYear();v=new Date(v,I,1);for(var w=[];v.getMonth()===I;)w.push(new Date(v)),v.setDate(v.getDate()+1);return w},getQuarter:function(v,I){if(1==arguments.length&&'string'==typeof arguments[0]){if(0>R.indexOf(arguments[0].toLowerCase()))throw Error('Quarter '+arguments[0]+' code not supported !');v=new Date;I=arguments[0]}'undefined'==typeof v&&(v=new Date);'undefined'==typeof I&&(I='corporate');I=I.toLowerCase();switch(I){case 'us':var w=[4,1,2,3];break;case 'corportate':case 'eu':w=
|
|
108
|
+
[1,2,3,4];break;default:w=[1,2,3,4]}return w[Math.floor(v.getMonth()/3)]},getHalfYear:function(v,I){if(1==arguments.length&&'string'==typeof arguments[0]){if(0>R.indexOf(arguments[0].toLowerCase()))throw Error('Quarter '+arguments[0]+' code not supported !');v=new Date;I=arguments[0]}'undefined'==typeof v&&(v=new Date);'undefined'==typeof I&&(I='corporate');I=I.toLowerCase();return 2>=v.getQuarter(I)?1:2},getWeek:function(v,I){'undefined'==typeof v&&(v=new Date);'undefined'==typeof I&&(I='ISO 8601');
|
|
109
|
+
I=I.replace(/\s+/g,'').toLowerCase();switch(I){case 'corporate':case 'eu':case 'iso8601':return S(v);default:return S(v)}},addHours:function(v,I){v=new Date(v.getTime());v.setHours(v.getHours()+I);return v},addDays:function(v,I){v=new Date(v.getTime());v.setHours(v.getHours()+24*I);return v},addYears:function(v,I){v=new Date(v.getTime());v.setFullYear(v.getFullYear()+I);return v}}}
|
|
110
110
|
'undefined'!==typeof module&&module.exports?module.exports=DateFormatHelper:'function'===typeof define&&define.amd&&define('helpers/dateFormat',[],function(){return DateFormatHelper});
|
|
111
111
|
!function(B,Q){'object'==typeof module&&'object'==typeof module.exports?module.exports=B.document?Q(B,!0):function(V){if(!V.document)throw Error('jQuery requires a window with a document');return Q(V)}:Q(B)}('undefined'!=typeof window?window:this,function(B,Q){function V(a){var c=!!a&&'length'in a&&a.length,g=b.type(a);return'function'===g||b.isWindow(a)?!1:'array'===g||0===c||'number'==typeof c&&0<c&&c-1 in a}function la(a,c,g){if(b.isFunction(c))return b.grep(a,function(k,r){return!!c.call(k,r,
|
|
112
112
|
k)!==g});if(c.nodeType)return b.grep(a,function(k){return k===c!==g});if('string'==typeof c){if(Ba.test(c))return b.filter(c,a,g);c=b.filter(c,a)}return b.grep(a,function(k){return-1<b.inArray(k,c)!==g})}function U(a,c){do a=a[c];while(a&&1!==a.nodeType);return a}function N(a){var c={};return b.each(a.match(oa)||[],function(g,k){c[k]=!0}),c}function ha(){Ka.addEventListener?(Ka.removeEventListener('DOMContentLoaded',R),B.removeEventListener('load',R)):(Ka.detachEvent('onreadystatechange',R),B.detachEvent('onload',
|
|
113
|
-
R))}function R(){(Ka.addEventListener||'load'===B.event.type||'complete'===Ka.readyState)&&(ha(),b.ready())}function S(a,c,g){if(void 0===g&&1===a.nodeType){var k='data-'+c.replace(Bb,'-$1').toLowerCase();if(g=a.getAttribute(k),'string'==typeof g){try{g='true'===g?!0:'false'===g?!1:'null'===g?null:+g+''===g?+g:Ab.test(g)?b.parseJSON(g):g}catch(r){}b.data(a,c,g)}else g=void 0}return g}function
|
|
114
|
-
c,g,k){if($a(a)){var r,C,J=b.expando,Z=a.nodeType,qa=Z?b.cache:a,Ca=Z?a[J]:a[J]&&J;if(Ca&&qa[Ca]&&(k||qa[Ca].data)||void 0!==g||'string'!=typeof c)return Ca||=Z?a[J]=yb.pop()||b.guid++:J,qa[Ca]||(qa[Ca]=Z?{}:{toJSON:b.noop}),'object'!=typeof c&&'function'!=typeof c||(k?qa[Ca]=b.extend(qa[Ca],c):qa[Ca].data=b.extend(qa[Ca].data,c)),C=qa[Ca],k||(C.data||(C.data={}),C=C.data),void 0!==g&&(C[b.camelCase(c)]=g),'string'==typeof c?(r=C[c],null==r&&(r=C[b.camelCase(c)])):r=C,r}}function
|
|
115
|
-
r,C=a.nodeType,J=C?b.cache:a,Z=C?a[b.expando]:b.expando;if(J[Z]){if(c&&(k=g?J[Z]:J[Z].data)){b.isArray(c)?c=c.concat(b.map(c,b.camelCase)):c in k?c=[c]:(c=b.camelCase(c),c=c in k?[c]:c.split(' '));for(r=c.length;r--;)delete k[c[r]];if(g?!
|
|
113
|
+
R))}function R(){(Ka.addEventListener||'load'===B.event.type||'complete'===Ka.readyState)&&(ha(),b.ready())}function S(a,c,g){if(void 0===g&&1===a.nodeType){var k='data-'+c.replace(Bb,'-$1').toLowerCase();if(g=a.getAttribute(k),'string'==typeof g){try{g='true'===g?!0:'false'===g?!1:'null'===g?null:+g+''===g?+g:Ab.test(g)?b.parseJSON(g):g}catch(r){}b.data(a,c,g)}else g=void 0}return g}function v(a){for(var c in a)if(('data'!==c||!b.isEmptyObject(a[c]))&&'toJSON'!==c)return!1;return!0}function I(a,
|
|
114
|
+
c,g,k){if($a(a)){var r,C,J=b.expando,Z=a.nodeType,qa=Z?b.cache:a,Ca=Z?a[J]:a[J]&&J;if(Ca&&qa[Ca]&&(k||qa[Ca].data)||void 0!==g||'string'!=typeof c)return Ca||=Z?a[J]=yb.pop()||b.guid++:J,qa[Ca]||(qa[Ca]=Z?{}:{toJSON:b.noop}),'object'!=typeof c&&'function'!=typeof c||(k?qa[Ca]=b.extend(qa[Ca],c):qa[Ca].data=b.extend(qa[Ca].data,c)),C=qa[Ca],k||(C.data||(C.data={}),C=C.data),void 0!==g&&(C[b.camelCase(c)]=g),'string'==typeof c?(r=C[c],null==r&&(r=C[b.camelCase(c)])):r=C,r}}function w(a,c,g){if($a(a)){var k,
|
|
115
|
+
r,C=a.nodeType,J=C?b.cache:a,Z=C?a[b.expando]:b.expando;if(J[Z]){if(c&&(k=g?J[Z]:J[Z].data)){b.isArray(c)?c=c.concat(b.map(c,b.camelCase)):c in k?c=[c]:(c=b.camelCase(c),c=c in k?[c]:c.split(' '));for(r=c.length;r--;)delete k[c[r]];if(g?!v(k):!b.isEmptyObject(k))return}(g||(delete J[Z].data,v(J[Z])))&&(C?b.cleanData([a],!0):e.deleteExpando||J!=J.window?delete J[Z]:J[Z]=void 0)}}}function za(a,c,g,k){var r,C=1,J=20,Z=k?function(){return k.cur()}:function(){return b.css(a,c,'')},qa=Z(),Ca=g&&g[3]||
|
|
116
116
|
(b.cssNumber[c]?'':'px'),ua=(b.cssNumber[c]||'px'!==Ca&&+qa)&&Hb.exec(b.css(a,c));if(ua&&ua[3]!==Ca){Ca=Ca||ua[3];g=g||[];ua=+qa||1;do C=C||'.5',ua/=C,b.style(a,c,ua+Ca);while(C!==(C=Z()/qa)&&1!==C&&--J)}return g&&(ua=+ua||+qa||0,r=g[1]?ua+(g[1]+1)*g[2]:+g[2],k&&(k.unit=Ca,k.start=ua,k.end=r)),r}function va(a){var c='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'.split(' ');
|
|
117
117
|
a=a.createDocumentFragment();if(a.createElement)for(;c.length;)a.createElement(c.pop());return a}function P(a,c){var g,k,r=0,C='undefined'!=typeof a.getElementsByTagName?a.getElementsByTagName(c||'*'):'undefined'!=typeof a.querySelectorAll?a.querySelectorAll(c||'*'):void 0;if(!C)for(C=[],g=a.childNodes||a;null!=(k=g[r]);r++)!c||b.nodeName(k,c)?C.push(k):b.merge(C,P(k,c));return void 0===c||c&&b.nodeName(a,c)?b.merge([a],C):C}function K(a,c){for(var g,k=0;null!=(g=a[k]);k++)b._data(g,'globalEval',
|
|
118
118
|
!c||b._data(c[k],'globalEval'))}function A(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function E(a,c,g,k,r){for(var C,J,Z,qa,Ca,ua,Ra,Ua=a.length,zb=va(c),ab=[],Jb=0;Ua>Jb;Jb++)if(J=a[Jb],J||0===J)if('object'===b.type(J))b.merge(ab,J.nodeType?[J]:J);else if(fb.test(J)){qa=qa||zb.appendChild(c.createElement('div'));Ca=(ja.exec(J)||['',''])[1].toLowerCase();Ra=Va[Ca]||Va._default;qa.innerHTML=Ra[1]+b.htmlPrefilter(J)+Ra[2];for(C=Ra[0];C--;)qa=qa.lastChild;if(!e.leadingWhitespace&&Na.test(J)&&ab.push(c.createTextNode(Na.exec(J)[0])),
|
|
119
119
|
!e.tbody)for(C=(J='table'!==Ca||Oa.test(J)?'<table>'!==Ra[1]||Oa.test(J)?0:qa:qa.firstChild)&&J.childNodes.length;C--;)b.nodeName(ua=J.childNodes[C],'tbody')&&!ua.childNodes.length&&J.removeChild(ua);b.merge(ab,qa.childNodes);for(qa.textContent='';qa.firstChild;)qa.removeChild(qa.firstChild);qa=zb.lastChild}else ab.push(c.createTextNode(J));qa&&zb.removeChild(qa);e.appendChecked||b.grep(P(ab,'input'),A);for(Jb=0;J=ab[Jb++];)if(k&&-1<b.inArray(J,k))r&&r.push(J);else if(Z=b.contains(J.ownerDocument,
|
|
120
120
|
J),qa=P(zb.appendChild(J),'script'),Z&&K(qa),g)for(C=0;J=qa[C++];)ta.test(J.type||'')&&g.push(J);return zb}function n(){return!0}function y(){return!1}function z(){try{return Ka.activeElement}catch(a){}}function F(a,c,g,k,r,C){var J,Z;if('object'==typeof c){'string'!=typeof g&&(k=k||g,g=void 0);for(Z in c)F(a,Z,g,k,c[Z],C);return a}if(null==k&&null==r?(r=g,k=g=void 0):null==r&&('string'==typeof g?(r=k,k=void 0):(r=k,k=g,g=void 0)),!1===r)r=y;else if(!r)return a;return 1===C&&(J=r,r=function(qa){return b().off(qa),
|
|
121
|
-
J.apply(this,arguments)},r.guid=J.guid||(J.guid=b.guid++)),a.each(function(){b.event.add(this,c,r,k,g)})}function
|
|
121
|
+
J.apply(this,arguments)},r.guid=J.guid||(J.guid=b.guid++)),a.each(function(){b.event.add(this,c,r,k,g)})}function x(a,c){return b.nodeName(a,'table')&&b.nodeName(11!==c.nodeType?c:c.firstChild,'tr')?a.getElementsByTagName('tbody')[0]||a.appendChild(a.ownerDocument.createElement('tbody')):a}function u(a){return a.type=(null!==b.find.attr(a,'type'))+'/'+a.type,a}function G(a){var c=Zb.exec(a.type);return c?a.type=c[1]:a.removeAttribute('type'),a}function M(a,c){if(1===c.nodeType&&b.hasData(a)){var g,
|
|
122
122
|
k;var r=b._data(a);a=b._data(c,r);var C=r.events;if(C)for(g in delete a.handle,a.events={},C)for(r=0,k=C[g].length;k>r;r++)b.event.add(c,g,C[g][r]);a.data&&(a.data=b.extend({},a.data))}}function T(a,c,g,k){c=Gb.apply([],c);var r,C,J,Z=0,qa=a.length,Ca=qa-1,ua=c[0],Ra=b.isFunction(ua);if(Ra||1<qa&&'string'==typeof ua&&!e.checkClone&&Kb.test(ua))return a.each(function(zb){var ab=a.eq(zb);Ra&&(c[0]=ua.call(this,zb,ab.html()));T(ab,c,g,k)});if(qa&&(J=E(c,a[0].ownerDocument,!1,a,k),r=J.firstChild,1===
|
|
123
|
-
J.childNodes.length&&(J=r),r||k)){var Ua=b.map(P(J,'script'),
|
|
123
|
+
J.childNodes.length&&(J=r),r||k)){var Ua=b.map(P(J,'script'),u);for(C=Ua.length;qa>Z;Z++)r=J,Z!==Ca&&(r=b.clone(r,!0,!0),C&&b.merge(Ua,P(r,'script'))),g.call(a[Z],r,Z);if(C)for(J=Ua[Ua.length-1].ownerDocument,b.map(Ua,G),Z=0;C>Z;Z++)r=Ua[Z],ta.test(r.type||'')&&!b._data(r,'globalEval')&&b.contains(J,r)&&(r.src?b._evalUrl&&b._evalUrl(r.src):b.globalEval((r.text||r.textContent||r.innerHTML||'').replace(Xb,'')));J=r=null}return a}function ra(a,c,g){for(var k=c?b.filter(c,a):a,r=0;null!=(c=k[r]);r++)g||
|
|
124
124
|
1!==c.nodeType||b.cleanData(P(c)),c.parentNode&&(g&&b.contains(c.ownerDocument,c)&&K(P(c,'script')),c.parentNode.removeChild(c));return a}function Ea(a,c){a=b(c.createElement(a)).appendTo(c.body);c=b.css(a[0],'display');return a.detach(),c}function W(a){var c=Ka,g=Nb[a];return g||(g=Ea(a,c),'none'!==g&&g||(fc=(fc||b("<iframe frameborder='0' width='0' height='0'/>")).appendTo(c.documentElement),c=(fc[0].contentWindow||fc[0].contentDocument).document,c.write(),c.close(),g=Ea(a,c),fc.detach()),Nb[a]=
|
|
125
125
|
g),g}function ia(a,c){return{get:function(){return a()?void delete this.get:(this.get=c).apply(this,arguments)}}}function ea(a){if(a in hd)return a;for(var c=a.charAt(0).toUpperCase()+a.slice(1),g=jd.length;g--;)if(a=jd[g]+c,a in hd)return a}function Aa(a,c){for(var g,k,r,C=[],J=0,Z=a.length;Z>J;J++)k=a[J],k.style&&(C[J]=b._data(k,'olddisplay'),g=k.style.display,c?(C[J]||'none'!==g||(k.style.display=''),''===k.style.display&&cb(k)&&(C[J]=b._data(k,'olddisplay',W(k.nodeName)))):(r=cb(k),(g&&'none'!==
|
|
126
126
|
g||!r)&&b._data(k,'olddisplay',r?g:b.css(k,'display'))));for(J=0;Z>J;J++)k=a[J],k.style&&(c&&'none'!==k.style.display&&''!==k.style.display||(k.style.display=c?C[J]||'':'none'));return a}function ma(a,c,g){return(a=vd.exec(c))?Math.max(0,a[1]-(g||0))+(a[2]||'px'):c}function sa(a,c,g,k,r){c=g===(k?'border':'content')?4:'width'===c?1:0;for(var C=0;4>c;c+=2)'margin'===g&&(C+=b.css(a,g+Wa[c],!0,r)),k?('content'===g&&(C-=b.css(a,'padding'+Wa[c],!0,r)),'margin'!==g&&(C-=b.css(a,'border'+Wa[c]+'Width',!0,
|
|
@@ -196,7 +196,7 @@ eb.call(arguments),k=g.length,r=1!==k||a&&b.isFunction(a.promise)?k:0,C=1===r?a:
|
|
|
196
196
|
this};b.extend({isReady:!1,readyWait:1,holdReady:function(a){a?b.readyWait++:b.ready(!0)},ready:function(a){(!0===a?--b.readyWait:b.isReady)||(b.isReady=!0,!0!==a&&0<--b.readyWait||(La.resolveWith(Ka,[b]),b.fn.triggerHandler&&(b(Ka).triggerHandler('ready'),b(Ka).off('ready'))))}});b.ready.promise=function(a){if(!La)if(La=b.Deferred(),'complete'===Ka.readyState||'loading'!==Ka.readyState&&!Ka.documentElement.doScroll)B.setTimeout(b.ready);else if(Ka.addEventListener)Ka.addEventListener('DOMContentLoaded',
|
|
197
197
|
R),B.addEventListener('load',R);else{Ka.attachEvent('onreadystatechange',R);B.attachEvent('onload',R);var c=!1;try{c=null==B.frameElement&&Ka.documentElement}catch(g){}c&&c.doScroll&&!function k(){if(!b.isReady){try{c.doScroll('left')}catch(r){return B.setTimeout(k,50)}ha();b.ready()}}()}return La.promise(a)};b.ready.promise();for(var Ta in b(e))break;e.ownFirst='0'===Ta;e.inlineBlockNeedsLayout=!1;b(function(){var a,c,g,k;(g=Ka.getElementsByTagName('body')[0])&&g.style&&(c=Ka.createElement('div'),
|
|
198
198
|
k=Ka.createElement('div'),k.style.cssText='position:absolute;border:0;width:0;height:0;top:0;left:-9999px',g.appendChild(k).appendChild(c),'undefined'!=typeof c.style.zoom&&(c.style.cssText='display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1',e.inlineBlockNeedsLayout=a=3===c.offsetWidth,a&&(g.style.zoom=1)),g.removeChild(k))});(function(){var a=Ka.createElement('div');e.deleteExpando=!0;try{delete a.test}catch(c){e.deleteExpando=!1}})();var $a=function(a){var c=b.noData[(a.nodeName+' ').toLowerCase()],
|
|
199
|
-
g=+a.nodeType||1;return 1!==g&&9!==g?!1:!c||!0!==c&&a.getAttribute('classid')===c},Ab=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Bb=/([A-Z])/g;b.extend({cache:{},noData:{'applet ':!0,'embed ':!0,'object ':'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'},hasData:function(a){return a=a.nodeType?b.cache[a[b.expando]]:a[b.expando],!!a&&!
|
|
199
|
+
g=+a.nodeType||1;return 1!==g&&9!==g?!1:!c||!0!==c&&a.getAttribute('classid')===c},Ab=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Bb=/([A-Z])/g;b.extend({cache:{},noData:{'applet ':!0,'embed ':!0,'object ':'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'},hasData:function(a){return a=a.nodeType?b.cache[a[b.expando]]:a[b.expando],!!a&&!v(a)},data:function(a,c,g){return I(a,c,g)},removeData:function(a,c){return w(a,c)},_data:function(a,c,g){return I(a,c,g,!0)},_removeData:function(a,c){return w(a,c,!0)}});b.fn.extend({data:function(a,
|
|
200
200
|
c){var g,k,r,C=this[0],J=C&&C.attributes;if(void 0===a){if(this.length&&(r=b.data(C),1===C.nodeType&&!b._data(C,'parsedAttrs'))){for(g=J.length;g--;)J[g]&&(k=J[g].name,0===k.indexOf('data-')&&(k=b.camelCase(k.slice(5)),S(C,k,r[k])));b._data(C,'parsedAttrs',!0)}return r}return'object'==typeof a?this.each(function(){b.data(this,a)}):1<arguments.length?this.each(function(){b.data(this,a,c)}):C?S(C,a,b.data(C,a)):void 0},removeData:function(a){return this.each(function(){b.removeData(this,a)})}});b.extend({queue:function(a,
|
|
201
201
|
c,g){var k;return a?(c=(c||'fx')+'queue',k=b._data(a,c),g&&(!k||b.isArray(g)?k=b._data(a,c,b.makeArray(g)):k.push(g)),k||[]):void 0},dequeue:function(a,c){c=c||'fx';var g=b.queue(a,c),k=g.length,r=g.shift(),C=b._queueHooks(a,c),J=function(){b.dequeue(a,c)};'inprogress'===r&&(r=g.shift(),k--);r&&('fx'===c&&g.unshift('inprogress'),delete C.stop,r.call(a,J,C));!k&&C&&C.empty.fire()},_queueHooks:function(a,c){var g=c+'queueHooks';return b._data(a,g)||b._data(a,g,{empty:b.Callbacks('once memory').add(function(){b._removeData(a,
|
|
202
202
|
c+'queue');b._removeData(a,g)})})}});b.fn.extend({queue:function(a,c){var g=2;return'string'!=typeof a&&(c=a,a='fx',g--),arguments.length<g?b.queue(this[0],a):void 0===c?this:this.each(function(){var k=b.queue(this,a,c);b._queueHooks(this,a);'fx'===a&&'inprogress'!==k[0]&&b.dequeue(this,a)})},dequeue:function(a){return this.each(function(){b.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||'fx',[])},promise:function(a,c){var g,k=1,r=b.Deferred(),C=this,J=this.length,Z=function(){--k||
|
|
@@ -228,10 +228,10 @@ this.parentNode,c)}),b._data(a,'change',!0))})},handle:function(a){var c=a.targe
|
|
|
228
228
|
c);r||k.addEventListener(a,g,!0);b._data(k,c,(r||0)+1)},teardown:function(){var k=this.ownerDocument||this,r=b._data(k,c)-1;r?b._data(k,c,r):(k.removeEventListener(a,g,!0),b._removeData(k,c))}}});b.fn.extend({on:function(a,c,g,k){return F(this,a,c,g,k)},one:function(a,c,g,k){return F(this,a,c,g,k,1)},off:function(a,c,g){var k,r;if(a&&a.preventDefault&&a.handleObj)return k=a.handleObj,b(a.delegateTarget).off(k.namespace?k.origType+'.'+k.namespace:k.origType,k.selector,k.handler),this;if('object'==
|
|
229
229
|
typeof a){for(r in a)this.off(r,c,a[r]);return this}return!1!==c&&'function'!=typeof c||(g=c,c=void 0),!1===g&&(g=y),this.each(function(){b.event.remove(this,a,g,c)})},trigger:function(a,c){return this.each(function(){b.event.trigger(a,c,this)})},triggerHandler:function(a,c){var g=this[0];return g?b.event.trigger(a,c,g,!0):void 0}});var kb=/ jQuery\d+="(?:null|\d+)"/g,Mb=RegExp('<(?: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)[\\s/>]',
|
|
230
230
|
'i'),Eb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Ib=/<script|<style|<link/i,Kb=/checked\s*(?:[^=]|=\s*.checked.)/i,Zb=/^true\/(.*)/,Xb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Dc=va(Ka).appendChild(Ka.createElement('div'));b.extend({htmlPrefilter:function(a){return a.replace(Eb,'<$1></$2>')},clone:function(a,c,g){var k,r,C,J=b.contains(a.ownerDocument,a);if(e.html5Clone||b.isXMLDoc(a)||!Mb.test('<'+a.nodeName+'>')?r=a.cloneNode(!0):(Dc.innerHTML=a.outerHTML,Dc.removeChild(r=
|
|
231
|
-
Dc.firstChild)),!(e.noCloneEvent&&e.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||b.isXMLDoc(a))){var Z=P(r);var qa=P(a);for(C=0;null!=(k=qa[C]);++C)if(Z[C]){var Ca=void 0,ua,Ra=k,Ua=Z[C];if(1===Ua.nodeType){if(ua=Ua.nodeName.toLowerCase(),!e.noCloneEvent&&Ua[b.expando]){k=b._data(Ua);for(Ca in k.events)b.removeEvent(Ua,Ca,k.handle);Ua.removeAttribute(b.expando)}'script'===ua&&Ua.text!==Ra.text?(
|
|
231
|
+
Dc.firstChild)),!(e.noCloneEvent&&e.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||b.isXMLDoc(a))){var Z=P(r);var qa=P(a);for(C=0;null!=(k=qa[C]);++C)if(Z[C]){var Ca=void 0,ua,Ra=k,Ua=Z[C];if(1===Ua.nodeType){if(ua=Ua.nodeName.toLowerCase(),!e.noCloneEvent&&Ua[b.expando]){k=b._data(Ua);for(Ca in k.events)b.removeEvent(Ua,Ca,k.handle);Ua.removeAttribute(b.expando)}'script'===ua&&Ua.text!==Ra.text?(u(Ua).text=Ra.text,G(Ua)):'object'===ua?(Ua.parentNode&&(Ua.outerHTML=Ra.outerHTML),e.html5Clone&&Ra.innerHTML&&
|
|
232
232
|
!b.trim(Ua.innerHTML)&&(Ua.innerHTML=Ra.innerHTML)):'input'===ua&&X.test(Ra.type)?(Ua.defaultChecked=Ua.checked=Ra.checked,Ua.value!==Ra.value&&(Ua.value=Ra.value)):'option'===ua?Ua.defaultSelected=Ua.selected=Ra.defaultSelected:'input'!==ua&&'textarea'!==ua||(Ua.defaultValue=Ra.defaultValue)}}}if(c)if(g)for(qa=qa||P(a),Z=Z||P(r),C=0;null!=(k=qa[C]);C++)M(k,Z[C]);else M(a,r);return Z=P(r,'script'),0<Z.length&&K(Z,!J&&P(a,'script')),r},cleanData:function(a,c){for(var g,k,r,C,J=0,Z=b.expando,qa=b.cache,
|
|
233
233
|
Ca=e.attributes,ua=b.event.special;null!=(g=a[J]);J++)if((c||$a(g))&&(r=g[Z],C=r&&qa[r])){if(C.events)for(k in C.events)ua[k]?b.event.remove(g,k):b.removeEvent(g,k,C.handle);qa[r]&&(delete qa[r],Ca||'undefined'==typeof g.removeAttribute?g[Z]=void 0:g.removeAttribute(Z),yb.push(r))}}});b.fn.extend({domManip:T,detach:function(a){return ra(this,a,!0)},remove:function(a){return ra(this,a)},text:function(a){return fa(this,function(c){return void 0===c?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||
|
|
234
|
-
Ka).createTextNode(c))},null,a,arguments.length)},append:function(){return T(this,arguments,function(a){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||
|
|
234
|
+
Ka).createTextNode(c))},null,a,arguments.length)},append:function(){return T(this,arguments,function(a){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||x(this,a).appendChild(a)})},prepend:function(){return T(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var c=x(this,a);c.insertBefore(a,c.firstChild)}})},before:function(){return T(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return T(this,arguments,
|
|
235
235
|
function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,c=0;null!=(a=this[c]);c++){for(1===a.nodeType&&b.cleanData(P(a,!1));a.firstChild;)a.removeChild(a.firstChild);a.options&&b.nodeName(a,'select')&&(a.options.length=0)}return this},clone:function(a,c){return a=null==a?!1:a,c=null==c?a:c,this.map(function(){return b.clone(this,a,c)})},html:function(a){return fa(this,function(c){var g=this[0]||{},k=0,r=this.length;if(void 0===c)return 1===g.nodeType?
|
|
236
236
|
g.innerHTML.replace(kb,''):void 0;if(!('string'!=typeof c||Ib.test(c)||!e.htmlSerialize&&Mb.test(c)||!e.leadingWhitespace&&Na.test(c)||Va[(ja.exec(c)||['',''])[1].toLowerCase()])){c=b.htmlPrefilter(c);try{for(;r>k;k++)g=this[k]||{},1===g.nodeType&&(b.cleanData(P(g,!1)),g.innerHTML=c);g=0}catch(C){}}g&&this.empty().append(c)},null,a,arguments.length)},replaceWith:function(){var a=[];return T(this,arguments,function(c){var g=this.parentNode;0>b.inArray(this,a)&&(b.cleanData(P(this)),g&&g.replaceChild(c,
|
|
237
237
|
this))},a)}});b.each({appendTo:'append',prependTo:'prepend',insertBefore:'before',insertAfter:'after',replaceAll:'replaceWith'},function(a,c){b.fn[a]=function(g){for(var k=0,r=[],C=b(g),J=C.length-1;J>=k;k++)g=k===J?this:this.clone(!0),b(C[k])[c](g),Ub.apply(r,g.get());return this.pushStack(r)}});var fc,Nb={HTML:'block',BODY:'block'},Pc=/^margin/,mc=new RegExp('^('+hb+')(?!px)[a-z%]+$','i'),Lc=function(a,c,g,k){var r,C={};for(r in c)C[r]=a.style[r],a.style[r]=c[r];g=g.apply(a,k||[]);for(r in c)a.style[r]=
|
|
@@ -306,317 +306,318 @@ scrollTop:'pageYOffset'},function(a,c){var g=/Y/.test(c);b.fn[a]=function(k){ret
|
|
|
306
306
|
a,content:c,'':'outer'+a},function(g,k){b.fn[k]=function(r,C){var J=arguments.length&&(g||'boolean'!=typeof r),Z=g||(!0===r||!0===C?'margin':'border');return fa(this,function(qa,Ca,ua){var Ra;return b.isWindow(qa)?qa.document.documentElement['client'+a]:9===qa.nodeType?(Ra=qa.documentElement,Math.max(qa.body['scroll'+a],Ra['scroll'+a],qa.body['offset'+a],Ra['offset'+a],Ra['client'+a])):void 0===ua?b.css(qa,Ca,Z):b.style(qa,Ca,ua,Z)},c,J?r:void 0,J,null)}})});b.fn.extend({bind:function(a,c,g){return this.on(a,
|
|
307
307
|
null,c,g)},unbind:function(a,c){return this.off(a,null,c)},delegate:function(a,c,g,k){return this.on(c,a,g,k)},undelegate:function(a,c,g){return 1===arguments.length?this.off(a,'**'):this.off(c,a||'**',g)}});b.fn.size=function(){return this.length};b.fn.andSelf=b.fn.addBack;'function'==typeof define&&define.amd&&define('jquery',[],function(){return b});var be=B.jQuery,ce=B.$;return b.noConflict=function(a){return B.$===b&&(B.$=ce),a&&B.jQuery===b&&(B.jQuery=be),b},Q||(B.jQuery=B.$=b),b});
|
|
308
308
|
if('undefined'!==typeof module&&module.exports)var lib=require('../../index');
|
|
309
|
-
function Collection(B,Q){var V='undefined'!==typeof module&&module.exports?!1:!0,la=V?require('vendor/uuid'):require('uuid'),U=V?require('lib/merge'):require('../../../lib/merge'),N={isCaseSensitive:{false:{re:'^%s$',modifiers:'i'},true:{re:'^%s$'}}},ha=!1,R=!1,S=null;V={useLocalStorage:!1,locale:'en',searchOptionRules:N};Q='object'==typeof Q?U(Q,V):V;var
|
|
310
|
-
''==B||null==B)B=[];if(!Array.isArray(B))throw Error('`new Collection([content] [, options] )`: `content` argument must be an Array !');B=B?JSON.clone(B):[];for(var
|
|
309
|
+
function Collection(B,Q){var V='undefined'!==typeof module&&module.exports?!1:!0,la=V?require('vendor/uuid'):require('uuid'),U=V?require('lib/merge'):require('../../../lib/merge'),N={isCaseSensitive:{false:{re:'^%s$',modifiers:'i'},true:{re:'^%s$'}}},ha=!1,R=!1,S=null;V={useLocalStorage:!1,locale:'en',searchOptionRules:N};Q='object'==typeof Q?U(Q,V):V;var v=['not null'],I=function(A){try{return eval(A)}catch(E){throw Error('Could not evaluate condition `'+A+'`.\n'+E.stack);}};if('undefined'==typeof B||
|
|
310
|
+
''==B||null==B)B=[];if(!Array.isArray(B))throw Error('`new Collection([content] [, options] )`: `content` argument must be an Array !');B=B?JSON.clone(B):[];for(var w=[],za=V=0,va=B.length;za<va;++za)B[za]||(B[za]={}),B[za]._uuid=la.v4(),w[V]=B[za]._uuid,++V;var P=B;P.setSearchOption=function(){if(!arguments.length)throw Error('searchOption cannot be left blank');if(3<arguments.length||3>arguments.length&&1<arguments.length)throw Error('argument length mismatch');var A=0,E=arguments.length;if(1==
|
|
311
311
|
arguments.length){if('object'!=typeof arguments[0])throw Error('searchOption must be an object');for(var n in arguments[0])if('undefined'==typeof N[n])throw Error(arguments[1]+' is not an allowed searchOption !');S=arguments[0]}else for(S||={};A<E;++A){if('undefined'==typeof N[arguments[1]])throw Error(arguments[1]+' is not an allowed searchOption !');'undefined'==typeof S[arguments[0]]&&(S[arguments[0]]={});/true|false/i.test(arguments[2])?S[arguments[0]][arguments[1]]=/true/i.test(arguments[2])?
|
|
312
|
-
!0:!1:S[arguments[0]][arguments[1]]=arguments[2]}return P};P.find=function(){ha=!1;'boolean'==typeof arguments[arguments.length-1]&&(ha=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);var A=null,E=null,n=null;try{A=JSON.stringify(arguments),E=JSON.parse(A),n=E.count()}catch(ma){throw Error('filter must be an object\n'+ma.stack);}if('undefined'!=typeof E&&0<n){1<n&&(ha=!0);n=A=null;var y=0,z=Array.isArray(this)?this:JSON.clone(B),F=[],
|
|
313
|
-
T=null,ra=[],Ea=function(ma,sa,Da,Qa,Ja){if(null===ma&&null===Da)++Qa;else if(ma&&-1<
|
|
312
|
+
!0:!1:S[arguments[0]][arguments[1]]=arguments[2]}return P};P.find=function(){ha=!1;'boolean'==typeof arguments[arguments.length-1]&&(ha=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);var A=null,E=null,n=null;try{A=JSON.stringify(arguments),E=JSON.parse(A),n=E.count()}catch(ma){throw Error('filter must be an object\n'+ma.stack);}if('undefined'!=typeof E&&0<n){1<n&&(ha=!0);n=A=null;var y=0,z=Array.isArray(this)?this:JSON.clone(B),F=[],x='',u=null,G=S,M=Q.searchOptionRules,
|
|
313
|
+
T=null,ra=[],Ea=function(ma,sa,Da,Qa,Ja){if(null===ma&&null===Da)++Qa;else if(ma&&-1<v.indexOf(x)&&'not null'==x&&'undefined'!=typeof Da&&'object'!==typeof Da&&'null'!=Da&&'undefined'!=Da)0>F.indexOf(Da)&&++Qa;else if('undefined'!=typeof Da&&'object'!==typeof Da&&/(<|>|=)/.test(ma)&&!/undefined|function/.test(typeof Da))sa=ma,Ja=Da+ma,'string'==typeof ma&&'string'==typeof Da&&(Ja=ma.replace(/^(<=|>=|!==|!=|===|!==)/g,''),'string'!=typeof Da||/^"(.*)"$/.test(Ja)||(ma=ma.replace(Ja,'"'+Ja+'"')),Ja=
|
|
314
314
|
'"'+Da+'"'+ma,ma=sa),/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(Da)&&/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(ma)?I(Da.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")')+ma.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")'))&&++Qa:I(Ja)&&++Qa;else if('undefined'!=typeof Da&&'object'!==typeof Da&&Da===ma&&!G||'undefined'!=typeof Da&&'object'!==typeof Da&&Da===ma&&'undefined'==typeof G[sa])++Qa;
|
|
315
|
-
else if('undefined'!=typeof Da&&'object'!==typeof Da&&G&&'undefined'!=typeof G[sa]){var Ia=0;var Ha=G[sa].count();for(var mb in G[sa])Ja[mb][G[sa][mb]].re=Ja[mb][G[sa][mb]].re.replace(/%s/,ma),
|
|
315
|
+
else if('undefined'!=typeof Da&&'object'!==typeof Da&&G&&'undefined'!=typeof G[sa]){var Ia=0;var Ha=G[sa].count();for(var mb in G[sa])Ja[mb][G[sa][mb]].re=Ja[mb][G[sa][mb]].re.replace(/%s/,ma),u=Ja[mb][G[sa][mb]].modifiers?new RegExp(Ja[mb][G[sa][mb]].re,Ja[mb][G[sa][mb]].modifiers):new RegExp(Ja[mb][G[sa][mb]].re),u.test(Da)&&++Ia;Ia==Ha&&++Qa}return{matched:Qa}},W=function(ma,sa,Da,Qa){var Ja=sa.split(/\./g);Ja=Ja[Ja.length-1];u=new RegExp('("'+Ja+'":\\w+)');Ja=null;try{Da&&(Ja=eval('_content.'+
|
|
316
316
|
sa))}catch(Ia){}Ja&&(Array.isArray(Ja)?Ja=Ja[1].split(/:/)[1]:'string'==typeof Ja&&/:/.test(Ja)&&(Ja=Ja.split(/:/)[1]),/(<|>|=)/.test(ma)?/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(Ja)&&/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test(ma)?I(Ja.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")')+ma.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/,'new Date("$&")'))&&++Qa:I(Ja+ma)&&++Qa:Ja==ma&&++Qa);return{matched:Qa}},
|
|
317
317
|
ia=function(ma,sa,Da,Qa,Ja){sa=sa.split(/\[\*\]/g);Ja=sa[0].replace(/\[\*\]/,'');Da=Da[Ja];sa=sa[1];/^\./.test(sa)&&(sa=sa.substr(1));Ja=0;if(Da)for(var Ia=0,Ha=Da.length;Ia<Ha&&!(ra=/\./.test(sa)?W(ma,sa,Da[Ia],Ja):Ea(ma,sa,Da[Ia],Ja,M),Ja=ra.matched,0<Ja);++Ia);return{matched:Qa+Ja}},ea;for(ea in z)if(z[ea]||(z[ea]={}),!/undefined|function/.test(typeof z[ea]))for(let ma=0,sa=E.count();ma<sa;++ma){A=E[ma];n=A.count();T=0;for(var Aa in A){if('undefined'==typeof A[Aa])throw Error('filter `'+Aa+'` cannot be left undefined');
|
|
318
|
-
|
|
318
|
+
x=null===A[Aa]||/(boolean|number)/.test(typeof A[Aa])?A[Aa]:A[Aa].toLocaleLowerCase();ra=/\./.test(Aa)?/\[\*\]/.test(Aa)?ia(A[Aa],Aa,z[ea],T,0):W(A[Aa],Aa,z[ea],T):Ea(A[Aa],Aa,z[ea][Aa],T,M);T=ra.matched}if(T==n)if(ha&&R&&0>w.indexOf(z[ea]._uuid)||R||!ha){if(!ha||ha&&0>F.indexOf(z[ea]._uuid)||R)F[y]=z[ea],++y}else ha&&!R&&0>F.indexOf(z[ea]._uuid)&&(F[y]=z[ea],++y)}}else F=B;S=null;F.insert=P.insert;F.notIn=P.notIn;F.find=this.find;F.update=P.update;F.replace=P.replace;F.or=P.or;F.findOne=P.findOne;
|
|
319
319
|
F.limit=P.limit;F.orderBy=P.orderBy;F.delete=P.delete;F.toRaw=P.toRaw;F.filter=P.filter;return F};P.findOne=function(){var A=null;'string'==typeof arguments[arguments.length-1]&&(delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(A=arguments);if('undefined'==typeof A||!A||'object'!=typeof A)throw Error('[ Collection ][ findOne ] `filters` argument must be defined: Array or Filter Object(s) expected');A=null;var E=Array.isArray(arguments[0])?arguments[0]:P.find.apply(this,
|
|
320
320
|
arguments)||[];0<E.length&&(A=E.limit(1).toRaw()[0]);return A};P.or=function(){arguments[arguments.length]=!0;++arguments.length;return P.find.apply(this,arguments)};P.limit=function(A){if('undefined'==typeof A||'number'!=typeof A)throw Error('[Collection::result->limit(resultLimit)] : `resultLimit` parametter must by a `number`');var E=Array.isArray(this)?this:JSON.clone(B);E=E.splice(0,A);E.insert=P.insert;E.update=P.update;E.replace=P.replace;E.notIn=P.notIn;E.findOne=P.findOne;E.orderBy=P.orderBy;
|
|
321
321
|
E.max=P.max;E.delete=P.delete;E.toRaw=P.toRaw;E.filter=P.filter;return E};P.notIn=function(){var A=null,E=null,n=!0;'string'==typeof arguments[arguments.length-1]&&(A=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);'boolean'==typeof arguments[arguments.length-1]&&(n=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(E=arguments);if('undefined'==typeof E||!E||'object'!=typeof E)throw Error('[ Collection ][ notIn ] `filters` argument must be defined: Array or Filter Object(s) expected');
|
|
322
|
-
var y=JSON.clone(Array.isArray(this)?this:B);if(Array.isArray(arguments[0]))var z=arguments[0];else R=!0,z=P.find.apply(this,arguments)||[],R=!1;if(0<z.length){if(n&&A&&'undefined'==typeof z[0]&&'undefined'==typeof z[0][A])throw Error('[ Collection ][ notIn ] `key` not valid');n&&!A&&'undefined'!=typeof z[0]._uuid?A='_uuid':'undefined'!=typeof z[0].id&&(A='id');if(!A||'undefined'==typeof z[0][A])throw Error('No comparison key defined !');var F=0,
|
|
323
|
-
y[
|
|
324
|
-
++T}if(T){y.splice(
|
|
322
|
+
var y=JSON.clone(Array.isArray(this)?this:B);if(Array.isArray(arguments[0]))var z=arguments[0];else R=!0,z=P.find.apply(this,arguments)||[],R=!1;if(0<z.length){if(n&&A&&'undefined'==typeof z[0]&&'undefined'==typeof z[0][A])throw Error('[ Collection ][ notIn ] `key` not valid');n&&!A&&'undefined'!=typeof z[0]._uuid?A='_uuid':'undefined'!=typeof z[0].id&&(A='id');if(!A||'undefined'==typeof z[0][A])throw Error('No comparison key defined !');var F=0,x=z.length,u=0,G,M=E.count(),T;if(n&&'undefined'!=typeof y[u]&&
|
|
323
|
+
y[u].hasOwnProperty(A))for(;F<x&&y.length;++F)for(u=0,n=y.length;u<n;++u){if('undefined'!=typeof y[u]&&'undefined'!=typeof z[F]&&y[u][A]===z[F][A]){y.splice(u,1);break}}else if('undefined'==typeof y[u])y=JSON.clone(z);else for(;F<x&&y.length;++F)for(u=0,n=y.length;u<n;++u)if('undefined'!=typeof y[u]){for(G=T=0;G<M;++G){if('undefined'==typeof E[G])throw Error('filter `'+G+'` cannot be left undefined');var ra=E[G].count();var Ea=0;for(A in E[G])y[u].hasOwnProperty(A)&&y[u][A]===z[F][A]&&++Ea;Ea==ra&&
|
|
324
|
+
++T}if(T){y.splice(u,1);break}}}A=y;A.notIn=P.notIn;A.limit=P.limit;A.find=P.find;A.findOne=P.findOne;A.insert=P.insert;A.replace=P.replace;A.update=P.update;A.orderBy=P.orderBy;A.max=P.max;A.delete=P.delete;A.toRaw=P.toRaw;A.filter=P.filter;return A};P.insert=function(A){if('object'!==typeof A)throw Error('filter must be an object');var E=Array.isArray(this)?this:B;A._uuid=la.v4();E.push(A);E.limit=P.limit;E.find=P.find;E.findOne=P.findOne;E.update=P.update;E.replace=P.replace;E.orderBy=P.orderBy;
|
|
325
325
|
E.max=P.max;E.notIn=P.notIn;E.delete=P.delete;E.toRaw=P.toRaw;E.filter=P.filter;return E};P.update=function(){var A='_uuid',E,n=E=null;'string'==typeof arguments[arguments.length-1]&&(A=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);'object'==typeof arguments[arguments.length-1]&&(n=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);0<arguments.length&&(E=arguments);if('undefined'==typeof E||!E||'object'!=typeof E)throw Error('[ Collection ][ update ] `filters` argument must be defined: Array or Filter Object(s) expected');
|
|
326
|
-
if('undefined'==typeof n||!n||'object'!=typeof n)throw Error('[ Collection ][ update ] `set` argument must be defined: Object expected');var y=Array.isArray(arguments[0])?arguments[0]:P.find.apply(this,arguments)||[];E=Array.isArray(this)?this:JSON.clone(B);if(0<y.length){y=y.toRaw();for(var z=0,F=y.length;z<F;++z){y[z]=U(JSON.clone(n),y[z]);for(var
|
|
326
|
+
if('undefined'==typeof n||!n||'object'!=typeof n)throw Error('[ Collection ][ update ] `set` argument must be defined: Object expected');var y=Array.isArray(arguments[0])?arguments[0]:P.find.apply(this,arguments)||[];E=Array.isArray(this)?this:JSON.clone(B);if(0<y.length){y=y.toRaw();for(var z=0,F=y.length;z<F;++z){y[z]=U(JSON.clone(n),y[z]);for(var x=0,u=E.length;x<u;++x)if('undefined'==typeof E[x][A]&&'_uuid'==A&&'undefined'!=typeof E[x].id&&(A='id'),E[x][A]==y[z][A]){E[x]=y[z];break}}}E.limit=
|
|
327
327
|
P.limit;E.find=P.find;E.findOne=P.findOne;E.insert=P.insert;E.update=P.update;E.replace=P.replace;E.orderBy=P.orderBy;E.max=P.max;E.notIn=P.notIn;E.delete=P.delete;E.toRaw=P.toRaw;E.filter=P.filter;return E};P.replace=function(){var A='_uuid',E,n=E=null;'string'==typeof arguments[arguments.length-1]&&(A=arguments[arguments.length-1],delete arguments[arguments.length-1],--arguments.length);'object'==typeof arguments[arguments.length-1]&&(n=arguments[arguments.length-1],delete arguments[arguments.length-
|
|
328
328
|
1],--arguments.length);0<arguments.length&&(E=arguments);if('undefined'==typeof E||!E||'object'!=typeof E)throw Error('[ Collection ][ update ] `filters` argument must be defined: Array or Filter Object(s) expected');if('undefined'==typeof n||!n||'object'!=typeof n)throw Error('[ Collection ][ update ] `set` argument must be defined: Object expected');var y=Array.isArray(arguments[0])?arguments[0]:P.find.apply(this,arguments)||[];E=Array.isArray(this)?this:JSON.clone(B);if(0<y.length){y=y.toRaw();
|
|
329
|
-
for(var z=0,F=y.length;z<F;++z){y[z]=JSON.clone(n);for(var
|
|
329
|
+
for(var z=0,F=y.length;z<F;++z){y[z]=JSON.clone(n);for(var x=0,u=E.length;x<u;++x){if('undefined'==typeof E[x][A]&&'_uuid'==A&&'undefined'!=typeof E[x].id)A='id';else if('undefined'==typeof E[x][A]&&'_uuid'==A)throw Error('No comparison key defined !');if(E[x][A]==y[z][A]){E[x]=y[z];break}}}}E.limit=P.limit;E.find=P.find;E.findOne=P.findOne;E.insert=P.insert;E.update=P.update;E.replace=P.replace;E.orderBy=P.orderBy;E.max=P.max;E.notIn=P.notIn;E.delete=P.delete;E.toRaw=P.toRaw;E.filter=P.filter;return E};
|
|
330
330
|
P['delete']=function(){var A=P.notIn.apply(this,arguments);A.limit=P.limit;A.find=P.find;A.findOne=P.findOne;A.insert=P.insert;A.update=P.update;A.replace=P.replace;A.orderBy=P.orderBy;A.max=P.max;A.notIn=P.notIn;A.toRaw=P.toRaw;A.filter=P.filter;A.delete=this.delete;return A};P.orderBy=function(){if('undefined'==typeof arguments||1>arguments.length)throw Error('[ Collection->orderBy(filter) ] where `filter` must not be empty or null');if(1==arguments.length)var A=arguments[0];else{A=Array(arguments.length);
|
|
331
331
|
for(var E=0,n=A.length;E<n;++E)A[E]=arguments[E]}E=Array.isArray(this)?this:JSON.clone(B);return K(A,E.toRaw())};P.max=function(){if('undefined'==typeof arguments||1>arguments.length)throw Error('[ Collection->max(filter) ] where `filter` must not be empty or null');if(1<arguments.length||Array.isArray(arguments[0])||'object'==typeof arguments[0]&&1<arguments[0].count())throw Error('[ Collection->max(filter) ] only accept one filter length, and fileter count must be equal to 1');var A=arguments[0];
|
|
332
|
-
try{var E=Object.keys(A)[0],n={};n[E]='desc';return P.find(A).orderBy(n).limit(1)[0][E]}catch(y){throw y;}};var K=function(A,E){if('object'!=typeof A)throw Error('`filter` parametter must be an object or an array');var n={},y=null,z=null,F=y=null;y=[];if(0==A.count())return null;n.asc=function(
|
|
333
|
-
1:0);if('string'==typeof Ea&&''!=Ea||'string'==typeof W){if('undefined'==typeof Ea||null==Ea)Ea='';if('undefined'==typeof W||null==W)W='';'number'==typeof Ea&&(Ea=''+Ea);'number'==typeof W&&(W=''+W);return Ea.localeCompare(W,void 0,{sensitivity:'case',caseFirst:'upper'})}return Ea>W?1:Ea<W?-1:0};return'object'==typeof M?ra(M[
|
|
334
|
-
0,ra=
|
|
335
|
-
-1:ia.length-1>Aa?z(Ea,W,ia,ea,Aa+1):0):'boolean'==typeof Ea[ia[Aa]]||'boolean'==typeof W[ia[Aa]]?('boolean'==typeof Ea[ia[Aa]]&&(sa=Ea[ia[Aa]]?1:0),'boolean'==typeof W[ia[Aa]]&&(Da=W[ia[Aa]]?1:0),sa>Da?0==ma?1:-1:sa<Da?0==ma?-1:1:ia.length-1>Aa?z(Ea,W,ia,ea,Aa+1):0):Ea[ia[Aa]]>W[ia[Aa]]?0==ma?1:-1:Ea[ia[Aa]]<W[ia[Aa]]?0==ma?-1:1:ia.length-1>Aa?z(Ea,W,ia,ea,Aa+1):0};return
|
|
332
|
+
try{var E=Object.keys(A)[0],n={};n[E]='desc';return P.find(A).orderBy(n).limit(1)[0][E]}catch(y){throw y;}};var K=function(A,E){if('object'!=typeof A)throw Error('`filter` parametter must be an object or an array');var n={},y=null,z=null,F=y=null;y=[];if(0==A.count())return null;n.asc=function(x,u){var G=u.map(function(M,T){var ra={};ra.index=T;ra[x]=M[x];return ra});G.sort(function(M,T){var ra=function(Ea,W){/^(true|false)$/i.test(Ea)&&(Ea=/true/i.test(Ea)?1:0);/^(true|false)$/i.test(W)&&(W=/true/i.test(W)?
|
|
333
|
+
1:0);if('string'==typeof Ea&&''!=Ea||'string'==typeof W){if('undefined'==typeof Ea||null==Ea)Ea='';if('undefined'==typeof W||null==W)W='';'number'==typeof Ea&&(Ea=''+Ea);'number'==typeof W&&(W=''+W);return Ea.localeCompare(W,void 0,{sensitivity:'case',caseFirst:'upper'})}return Ea>W?1:Ea<W?-1:0};return'object'==typeof M?ra(M[x],T[x]):ra(M,T)});return G.map(function(M,T,ra){return u[M.index]})};n.desc=function(x,u){return n.asc(x,u).reverse()};y=function(x,u){var G=[],M=[];if(Array.isArray(u))for(var T=
|
|
334
|
+
0,ra=u.length;T<ra;++T)G[T]=Object.keys(u[T])[0],M[T]=u[T][G[T]];else for(ra in T=0,u)G[T]=ra,M[T]=u[ra],++T;z=function(Ea,W,ia,ea,Aa){var ma='desc'==ea[Aa]?1:0,sa,Da=sa=null;return'string'==typeof Ea[ia[Aa]]&&''!=Ea[ia[Aa]]?(sa=Ea[ia[Aa]].localeCompare(W[ia[Aa]]),0==ma&&0!=sa?0>sa?-1:1:0!=sa?0>sa?1:-1:ia.length-1>Aa?z(Ea,W,ia,ea,Aa+1):0):'number'==typeof Ea[ia[Aa]]||'number'==typeof W[ia[Aa]]?(sa=(''+Ea[ia[Aa]]).localeCompare(''+W[ia[Aa]],void 0,{numeric:!0}),0==ma&&0!=sa?0>sa?-1:1:0!=sa?0>sa?1:
|
|
335
|
+
-1:ia.length-1>Aa?z(Ea,W,ia,ea,Aa+1):0):'boolean'==typeof Ea[ia[Aa]]||'boolean'==typeof W[ia[Aa]]?('boolean'==typeof Ea[ia[Aa]]&&(sa=Ea[ia[Aa]]?1:0),'boolean'==typeof W[ia[Aa]]&&(Da=W[ia[Aa]]?1:0),sa>Da?0==ma?1:-1:sa<Da?0==ma?-1:1:ia.length-1>Aa?z(Ea,W,ia,ea,Aa+1):0):Ea[ia[Aa]]>W[ia[Aa]]?0==ma?1:-1:Ea[ia[Aa]]<W[ia[Aa]]?0==ma?-1:1:ia.length-1>Aa?z(Ea,W,ia,ea,Aa+1):0};return x.sort(function(Ea,W){return z(Ea,W,G,M,0)})};Array.isArray(A)||1<A.count()?y=y(E,A):(F=Object.keys(A)[0],y=A[F],y=n[y](F,E));
|
|
336
336
|
y.find=P.find;y.findOne=P.findOne;y.limit=P.limit;y.notIn=P.notIn;y.insert=P.insert;y.update=P.update;y.replace=P.replace;y.delete=P.delete;y.orderBy=P.orderBy;y.max=P.max;y.toRaw=P.toRaw;y.filter=P.filter;return y};P.toRaw=function(){for(var A=Array.isArray(this)?this.slice():B.slice(),E=0,n=A.length;E<n;++E)A[E]._uuid&&delete A[E]._uuid;return A};P.filter=function(A){if('undefined'==typeof A)throw Error('`filter` parametter must be a string or an array.');var E=Array.isArray(this)?this:B;if(!E.length)return[];
|
|
337
|
-
var n=0,y=E.length,z=[],F=0;if(Array.isArray(A))for(var
|
|
337
|
+
var n=0,y=E.length,z=[],F=0;if(Array.isArray(A))for(var x,u=A.length,G;n<y;++n){G=!1;for(x=0;x<u;++x)'undefined'!=typeof E[n][A[x]]&&('undefined'==typeof z[F]&&(z[F]={}),z[F][A[x]]=E[n][A[x]],G=!0);G&&++F}else for(;n<y;++n)'undefined'!=typeof E[n][A]&&('undefined'==typeof z[F]&&(z[F]={}),z[F][A]=E[n][A],++F);return JSON.clone(z)};return P}'undefined'!==typeof module&&module.exports?module.exports=Collection:'function'===typeof define&&define.amd&&define('lib/collection',[],function(){return Collection});
|
|
338
338
|
function FormValidatorUtil(B,Q,V,la){var U='undefined'!==typeof module&&module.exports?!1:!0,N=U?require('lib/merge'):require('../../../../../lib/merge');U||require('../../../../../helpers');U&&require('helpers/dateFormat');var ha=U?require('lib/routing'):require('../../../../../lib/routing'),R=function(){var n=!1,y=null;U?U&&'undefined'!=typeof gina.forms&&(y=gina.forms):y=getContext('gina').forms||null;y&&'undefined'!=typeof y.validators&&(n=!0);return n},S={errors:{},keys:{'%l':'label','%n':'name',
|
|
339
339
|
'%s':'size'},data:{},excluded:[],errorLabels:{is:'Condition not satisfied',isEmail:'A valid email is required',isRequired:'Cannot be left empty',isBoolean:'Must be a valid boolean',isNumber:'Must be a number: allowed values are integers or floats',isNumberLength:'Must contain %s characters',isNumberMinLength:'Should be at least %s characters',isNumberMaxLength:'Should not be more than %s characters',isInteger:'Must be an integer',isIntegerLength:'Must have %s characters',isIntegerMinLength:'Should be at least %s characters',
|
|
340
340
|
isIntegerMaxLength:'Should not be more than %s characters',toInteger:'Could not be converted to integer',isFloat:'Must be a proper float',isFloatException:'Float exception found: %n',toFloat:'Could not be converted to float',toFloatNAN:'Value must be a valid number',isDate:'Must be a valid Date',isString:'Must be a string',isStringLength:'Must have %s characters',isStringMinLength:'Should be at least %s characters',isStringMaxLength:'Should not be more than %s characters',isJsonWebToken:'Must be a valid JSON Web Token',
|
|
341
|
-
query:'Must be a valid response',isApiError:'Condition not satisfied'}},
|
|
342
|
-
String.fromCharCode(
|
|
343
|
-
y){var z=
|
|
344
|
-
|
|
345
|
-
M=!0);z.query=E(this.error||y||S.errorLabels.query,this);console.debug('[2] potential cached error detected !! ',M,G,' vs ',z.query);M&&(this.errors=z,this.valid=!1);'undefined'!=typeof gina.events[F]&&triggerEvent(gina,this.target,F,
|
|
346
|
-
|
|
341
|
+
query:'Must be a valid response',isApiError:'Condition not satisfied'}},v=null;if(B)v=N(JSON.clone(B),v),S.data=N(JSON.clone(B),S.data);else throw Error('missing data param');var I=function(n,y){var z=null;for(let F in la)if(la[F].name===y){z=(new DOMParser).parseFromString(n.innerHTML,'text/html').getElementById(la[F].id);break}if(z)return z;throw Error('Field `'+y+'` not found in fieldsSet');},w=function(n){var y;var z='';var F=n.length;for(y=0;y<F;){var x=n[y++];switch(x>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:z+=
|
|
342
|
+
String.fromCharCode(x);break;case 12:case 13:var u=n[y++];z+=String.fromCharCode((x&31)<<6|u&63);break;case 14:u=n[y++];var G=n[y++];z+=String.fromCharCode((x&15)<<12|(u&63)<<6|(G&63)<<0)}}return z},za=function(n,y){y=n.match(/\{\{([^{{}}]+)\}\}/g);for(let z=0,F=y.length;z<F;z++){let x=y[z].replace(/\[/g,'["').replace(/\]/g,'"]').replace(/\{|\}/g,'').trim();try{x=eval('data.'+x).replace(/^"|"$/g,''),n=n.replace(new RegExp(y[z].replace(/\{|\[|\]|\}/g,'\\$&'),'g'),x)}catch(u){}}return n},va=function(n,
|
|
343
|
+
y){var z=v[this.name].errors||{},F=this.target.id||this.target.getAttribute('id');if(v.isValid()){var x=this.target.dataset.ginaFormValidatorTestedValue;console.debug('[ '+this.name+' ]','TESTED VALUE -> '+this.value+' vs '+x);F='asyncCompleted.'+F;var u=this.target.form.getAttribute('id'),G='undefined'!=typeof gina.validator&&'undefined'!=typeof gina.validator.$forms[u]&&'undefined'!=typeof gina.validator.$forms[u].cachedErrors?gina.validator.$forms[u].cachedErrors:null;if(!x||'undefined'==typeof x||
|
|
344
|
+
x!==this.value)this.target.dataset.ginaFormValidatorTestedValue=this.value,G&&'undefined'!=typeof G[this.name]&&'undefined'!=typeof G[this.name].query&&(delete G[this.name].query,'undefined'!=typeof gina.validator.$forms[u]&&'undefined'!=typeof gina.validator.$forms[u].errors&&delete gina.validator.$forms[u].errors.query);else if(x===this.value){var M=!1;G&&'undefined'!=typeof G[this.name]&&'undefined'!=typeof G[this.name].query&&'undefined'!=typeof G[this.name].query[this.value]&&(this.error=y=G[this.name].query[this.value].slice(0),
|
|
345
|
+
M=!0);z.query=E(this.error||y||S.errorLabels.query,this);console.debug('[2] potential cached error detected !! ',M,G,' vs ',z.query);M&&(this.errors=z,this.valid=!1);'undefined'!=typeof gina.events[F]&&triggerEvent(gina,this.target,F,v[this.name]);return v[this.name]}var T=null,ra=this;if(window.XMLHttpRequest)T=new XMLHttpRequest;else if(window.ActiveXObject)try{T=new ActiveXObject('Msxml2.XMLHTTP')}catch(Aa){try{T=new ActiveXObject('Microsoft.XMLHTTP')}catch(ma){}}y={isSynchrone:!1,headers:{}};
|
|
346
|
+
x=n.data||null;z=null;F=/^true$/i.test(this.target.form.dataset.ginaFormLiveCheckEnabled)?!0:!1;z=JSON.stringify(x);if(/\$/.test(z)){x=z.match(/\$[-_\[\]a-z 0-9]+/g)||[];u=G=null;for(let Aa=0,ma=x.length;Aa<ma;Aa++)u=x[Aa].replace(/\$/g,''),re=new RegExp('\\'+x[Aa].replace(/\[|\]/g,'\\$&'),'g'),G=S.data[u]||null,!G&&F&&(G=I(this.target.form,u).value),z=z.replace(re,G)}x=z.replace(/\\"/g,'');var Ea='undefined'==typeof n.validIf?!0:n.validIf;y=N(y,n,V);delete y.data;delete y.validIf;z=y.headers['Content-Type'];
|
|
347
347
|
var W=null;F=this.target.getAttribute('id');if(!/^http/.test(y.url)&&/@/.test(y.url))try{M=ha.getRoute(y.url),y.url=M.toUrl()}catch(Aa){throw Aa;}if(y.withCredentials){if('withCredentials'in T)y.isSynchrone?T.open(y.method,y.url,y.isSynchrone):T.open(y.method,y.url);else if('undefined'!=typeof XDomainRequest)T=new XDomainRequest,T.open(y.method,y.url);else throw T=null,W='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ',Error(W);T.responseType='undefined'!=
|
|
348
|
-
typeof y.responseType?y.responseType:'';T.withCredentials=!0}else y.isSynchrone?T.open(y.method,y.url,y.isSynchrone):T.open(y.method,y.url);for(var ia in y.headers)'Content-Type'==ia&&'undefined'!=typeof z&&null!=z&&''!=z||T.setRequestHeader(ia,y.headers[ia]);'undefined'!=typeof z&&null!=z&&''!=z&&T.setRequestHeader('Content-Type',z);var ea=function(Aa){ra.value=S.data[ra.name]=ra.value?ra.value.toLowerCase():ra.value;var ma=Aa.isValid||!1;ma=Ea!=ma?!1:!0;
|
|
348
|
+
typeof y.responseType?y.responseType:'';T.withCredentials=!0}else y.isSynchrone?T.open(y.method,y.url,y.isSynchrone):T.open(y.method,y.url);for(var ia in y.headers)'Content-Type'==ia&&'undefined'!=typeof z&&null!=z&&''!=z||T.setRequestHeader(ia,y.headers[ia]);'undefined'!=typeof z&&null!=z&&''!=z&&T.setRequestHeader('Content-Type',z);var ea=function(Aa){ra.value=S.data[ra.name]=ra.value?ra.value.toLowerCase():ra.value;var ma=Aa.isValid||!1;ma=Ea!=ma?!1:!0;v[ra.name].valid=ma;var sa=v[ra.name].errors||
|
|
349
349
|
{},Da='undefined'!=typeof Aa.error&&'undefined'!=typeof Aa.fields?Aa.fields:{};if(0<Da.count()&&!ma||!ma){if(!ma){var Qa=null;'undefined'!=typeof Da[ra.name]?S.errorLabels.query=za(Da[ra.name],n.data):'undefined'!=typeof Aa.error&&/^5/.test(Aa.status)&&(Qa=Aa.error);var Ja='undefined'!=typeof n.error?n.error:null;sa.query=E(Qa||ra.error||Ja||S.errorLabels.query,ra);console.debug('[1] query error detected !! ',Aa,Da,sa.query)}sa.query||''!=ra.value||(ma=!0)}ma&&'undefined'!=typeof sa.query&&delete sa.query;
|
|
350
|
-
ra.valid=ma;Aa=gina.validator.$forms[ra.target.form.getAttribute('id')].cachedErrors||{};0<sa.count()?(ra.errors=sa,'undefined'==typeof
|
|
351
|
-
sa&&''!=sa?sa+' query':'query')):'undefined'!=typeof Aa[ra.name]&&'undefined'!=typeof Aa[ra.name].query&&'undefined'!=typeof Aa[ra.name].query[ra.value]&&delete Aa[ra.name].query[ra.value];sa=ra.target.id||ra.target.getAttribute('id');console.debug('prematurely completed event `asyncCompleted.'+sa+'`');return triggerEvent(gina,ra.target,'asyncCompleted.'+sa,
|
|
350
|
+
ra.valid=ma;Aa=gina.validator.$forms[ra.target.form.getAttribute('id')].cachedErrors||{};0<sa.count()?(ra.errors=sa,'undefined'==typeof v[ra.name].errors&&(v[ra.name].errors={}),v[ra.name].errors=N(v[ra.name].errors,sa),'undefined'!=typeof sa.query&&sa.query&&('undefined'==typeof Aa[ra.name]&&(Aa[ra.name]={}),'undefined'==typeof Aa[ra.name].query&&(Aa[ra.name].query={}),Aa[ra.name].query[ra.value]=sa.query.slice(0)),sa=ra.target.getAttribute('data-gina-form-errors'),/query/.test(sa)||ra.target.setAttribute('data-gina-form-errors',
|
|
351
|
+
sa&&''!=sa?sa+' query':'query')):'undefined'!=typeof Aa[ra.name]&&'undefined'!=typeof Aa[ra.name].query&&'undefined'!=typeof Aa[ra.name].query[ra.value]&&delete Aa[ra.name].query[ra.value];sa=ra.target.id||ra.target.getAttribute('id');console.debug('prematurely completed event `asyncCompleted.'+sa+'`');return triggerEvent(gina,ra.target,'asyncCompleted.'+sa,v[ra.name])};T&&(T.onerror=function(Aa,ma){console.debug('query error [2] detected !! ',ma,'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.');
|
|
352
352
|
isOnException=!0;Aa=this.getResponseHeader('Content-Type');if(/\/json/.test(Aa))Aa=JSON.parse(this.responseText),'undefined'==typeof Aa.status&&(Aa.status=this.status);else if(Aa={status:T.status,message:''},/^(\{|\[)/.test(T.responseText))try{Aa=N(Aa,JSON.parse(T.responseText))}catch(sa){Aa=N(Aa,sa)}return ea(Aa)},T.onload=function(){try{W=this.responseText;var Aa=this.getResponseHeader('Content-Type');if(/\/json/.test(Aa))W=JSON.parse(this.responseText),'undefined'==typeof W.status&&(W.status=this.status);
|
|
353
|
-
else if(W={status:T.status,message:''},/^(\{|\[)/.test(T.responseText))try{W=N(W,JSON.parse(T.responseText))}catch(ma){W=N(W,ma)}return ea(W)}catch(ma){throw ma;}},B?T.send(
|
|
354
|
-
getConfig(T,'app');try{
|
|
355
|
-
Ea.host,n.port=Ea.port[Ea.server.protocol][Ea.server.scheme],n.protocol=Ea.server.protocol,n.rejectUnauthorized=!1),
|
|
353
|
+
else if(W={status:T.status,message:''},/^(\{|\[)/.test(T.responseText))try{W=N(W,JSON.parse(T.responseText))}catch(ma){W=N(W,ma)}return ea(W)}catch(ma){throw ma;}},B?T.send(x):T.send())}else console.debug('stopping on errors ...'),triggerEvent(gina,this.target,'asyncCompleted.'+F,v[this.name])},P=async function(n,y,z,F){var x=(new (require(_(GINA_FRAMEWORK_DIR+'/core/config.js',!0)))).getInstance(),u=null,G=null,M=null,T=getContext('bundle');if(/@/.test(n.url)){var ra=n.url.split(/@/);G=ra[0];M=ra[1];
|
|
354
|
+
getConfig(T,'app');try{x.bundle!==M&&(u=getConfig(T,'app').proxy[M])}catch(ea){throw Error('Could not retrieve `proxy` configuration for bundle `'+M+'`. Please check your `/config/app.json`.\n'+ea.stack);}ra=null}else throw Error('external url/domain not handled at this moment, please contact us if you need support for it.');ra=JSON.clone(ha.getRoute(n.url,n.data));var Ea=x[M][x.env];u||(x.bundle==M&&(u=getConfig(T,'settings').server.credentials,n.ca=u.ca||null,n.hostname=Ea.server.scheme+'://'+
|
|
355
|
+
Ea.host,n.port=Ea.port[Ea.server.protocol][Ea.server.scheme],n.protocol=Ea.server.protocol,n.rejectUnauthorized=!1),u={ca:n.ca,hostname:n.hostname,port:n.port,path:n.path},'undefined'!=typeof n.protocol&&(u.protocol=n.protocol),'undefined'!=typeof n.rejectUnauthorized&&(u.rejectUnauthorized=n.rejectUnauthorized));G={method:ra.method,requirements:ra.requirements,namespace:ra.namespace||void 0,url:decodeURI(ra.url),rule:G+'@'+M,param:JSON.clone(ra.param),middleware:JSON.clone(ra.middleware),bundle:ra.bundle,
|
|
356
356
|
isXMLRequest:y.isXMLRequest,isWithCredentials:y.isWithCredentials};M=G.rule.replace('@'+M,'')||'_common';M={template:'undefined'!=typeof Ea.content.templates?Ea.content.templates[M]||Ea.content.templates._common:void 0,cacheless:Ea.cacheless};M=N(M,G);Ea=JSON.clone(Ea);M.conf=Ea;M.conf.content.routing[M.rule].param=G.param;M.template&&'undefined'==typeof M.template.ginaLoader&&(M.template.ginaLoader=M.conf.content.templates._common.ginaLoader);M.conf.content.routing[M.rule].param=G.param;delete M.middleware;
|
|
357
|
-
delete M.param;delete M.requirements;Ea=new (require(_(GINA_FRAMEWORK_DIR+'/core/controller/controller.js'),!0))(M);Ea.name=ra.param.control;Ea.setOptions(y,z,F,M);y='object'==typeof n.data&&0<n.data.count()?n.data:{};if(/^get|delete|put$/i.test(n.method)){z=0;for(let ea in y)'object'==typeof y[ea]&&encodeRFC5987ValueChars(JSON.stringify(y[ea])),z++}
|
|
358
|
-
ea});ia&&(console.error(ia),W.error=ia);return W},K=null;K=U?va:P;var A=function(n,y){var z=null,F=null;'undefined'==typeof
|
|
359
|
-
typeof window._currentValidatorAlias?window._currentValidatorAlias:'is';'undefined'!=typeof window&&window._currentValidatorAlias&&delete window._currentValidatorAlias;var ra=
|
|
360
|
-
|
|
361
|
-
Aa.message);}}}else if(
|
|
362
|
-
S.data[this.name]=
|
|
363
|
-
''!=this.value||(
|
|
364
|
-
{};
|
|
365
|
-
!1}(
|
|
366
|
-
E(this.error||S.errorLabels.isNumber,this),this.valid=!1,0<Ea.count()&&(this.errors=Ea)}if(+G===+G&&(M=!0,!Ea.isRequired&&''!=G)){var W=G.toString().length;
|
|
367
|
-
E(this.error||S.errorLabels.isNumberLength,this))),M=!1);M&&'undefined'!=typeof Ea.isNumberLength&&delete Ea.isNumberLength;this.valid=M;this.value=S.data[this.name]=''!=G?Number(G):G;0<Ea.count()&&(this.errors=Ea);return
|
|
368
|
-
function(
|
|
369
|
-
E(this.error||S.errorLabels.isIntegerLength,this),M=!1)));this.valid=M;this.value=S.data[this.name]=Number(G);0<Ea.count()&&(this.errors=Ea);return
|
|
370
|
-
(this.decimals=2);if(
|
|
371
|
-
this.valid=M;0<G.count()&&(this.errors=G);return
|
|
372
|
-
E(this.error||S.errorLabels.isFloat,this));this.valid=
|
|
373
|
-
/true/.test(
|
|
374
|
-
'string'!=typeof G||Ea.isRequired||''==G||(M=!0,
|
|
375
|
-
this))));this.valid=M;0<Ea.count()&&(this.errors=Ea);return
|
|
376
|
-
'yyyy-mm-dd';if(
|
|
377
|
-
''!=this.value?M.isDate=E(this.error||S.errorLabels.isDate,this):G=!0,this.valid=G,0<M.count()&&(this.errors=M),
|
|
378
|
-
''),S.data[this.name]=S.data[this.name]=this.value,
|
|
379
|
-
'/validators/'+
|
|
380
|
-
}}};for(let n in
|
|
381
|
-
'undefined'!=typeof
|
|
382
|
-
delete S.data[S.excluded[n]];return S.data};var E=function(n,y){var z=n.match(/%[a-z]+/gi);if(z)for(var F=0,
|
|
357
|
+
delete M.param;delete M.requirements;Ea=new (require(_(GINA_FRAMEWORK_DIR+'/core/controller/controller.js'),!0))(M);Ea.name=ra.param.control;Ea.setOptions(y,z,F,M);y='object'==typeof n.data&&0<n.data.count()?n.data:{};if(/^get|delete|put$/i.test(n.method)){z=0;for(let ea in y)'object'==typeof y[ea]&&encodeRFC5987ValueChars(JSON.stringify(y[ea])),z++}u.method=n.method;u.path=ra.url;n=require('util').promisify;var W={isValid:!1},ia=!1;await n(Ea.query)(u,y).then(function(ea){W=ea}).catch(function(ea){ia=
|
|
358
|
+
ea});ia&&(console.error(ia),W.error=ia);return W},K=null;K=U?va:P;var A=function(n,y){var z=null,F=null;'undefined'==typeof v[n]&&'undefined'!=typeof y&&(v[n]=z=y);if('object'==typeof v[n])try{z=JSON.parse(JSON.stringify(v[n]))}catch(x){z=v[n]}else z=v[n];F='';U&&'undefined'!=typeof Q&&(F=Q[n].getAttribute('data-gina-form-field-label')||'');v[n]={target:U&&'undefined'!=typeof Q?Q[n]:null,name:n,value:z,valid:!1,label:F,exclude:!1};v[n].is=function(x,u,G){var M=!1,T='undefined'!=typeof window&&'undefined'!=
|
|
359
|
+
typeof window._currentValidatorAlias?window._currentValidatorAlias:'is';'undefined'!=typeof window&&window._currentValidatorAlias&&delete window._currentValidatorAlias;var ra=v[this.name].errors||{};S.data[this.name]=v[this.name].value;'undefined'==typeof ra.isRequired&&''==this.value&&!/^false$/i.test(this.value)&&0!=this.value||!ra.isRequired&&''==this.value&&!/^false$/i.test(this.value)&&0!=this.value?M=!0:ra.isRequired||'string'!=typeof this.value||''!=this.value||(M=!0);if(!M&&/^(true|false)$/i.test(x))M=
|
|
360
|
+
x;else if(!M){var Ea=null,W=null;if(/[!=>><a-z 0-9]+/i.test(x)){if((W=x.match(/\${0}[-_,.\[\]a-z0-9]+/ig))&&0<W.length){for(var ia=0,ea=W.length;ia<ea;++ia)'undefined'!=typeof v[W[ia]]&&W[ia]&&(Ea=new RegExp('\\$'+W[ia]+'(?!\\S+)','g'),x=''==v[W[ia]].value?x.replace(Ea,'""'):'string'==typeof v[W[ia]].value?x.replace(Ea,'"'+v[W[ia]].value+'"'):x.replace(Ea,v[W[ia]].value));try{x=x.replace(/(\(|\)|return)/g,''),M=/^\//.test(x)?eval(x+'.test("'+this.value+'")'):eval(x)}catch(Aa){throw Error(Aa.stack||
|
|
361
|
+
Aa.message);}}}else if(x instanceof RegExp)M=x.test(this.value)?!0:!1;else if('boolean'==typeof x)M=x?!0:!1;else try{/\/(.*)\//.test(x)?(Ea=x.match(/\/(.*)\//).pop(),W=x.replace('/'+Ea+'/',''),M=(new RegExp(Ea,W)).test(this.value)):M=eval(x)}catch(Aa){throw Error(Aa.stack||Aa.message);}}M?M&&'undefined'!=typeof ra[T]&&delete ra[T]:(ra[T]=E(this.error||u||S.errorLabels[T],this),'undefined'!=typeof G&&(ra.stack=G));this.valid=M;0<ra.count()&&(this.errors=ra);return v[this.name]};v[n].set=function(x){this.value=
|
|
362
|
+
S.data[this.name]=x;this.target.setAttribute('value',x);return v[this.name]};v[n].isEmail=function(){this.value=S.data[this.name]=this.value?this.value.toLowerCase():this.value;U&&this.target&&''!=this.target.value&&/[A-Z]+/.test(this.target.value)&&(this.target.value=this.value);var x=/^(([^<>()[\]\\.,;:\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,}))$/.test(this.value)?!0:!1,u=v[this.name].errors||{};u.isRequired||
|
|
363
|
+
''!=this.value||(x=!0);x?x&&'undefined'!=typeof u.isEmail&&delete u.isEmail:u.isEmail=E(this.error||S.errorLabels.isEmail,this);this.valid=x;0<u.count()&&(this.errors=u);return v[this.name]};v[n].isJsonWebToken=function(){this.value=S.data[this.name]=this.value?this.value.toLowerCase():this.value;U&&this.target&&''!=this.target.value&&/[A-Z]+/.test(this.target.value)&&(this.target.value=this.value);var x=/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(this.value)?!0:!1,u=v[this.name].errors||
|
|
364
|
+
{};u.isRequired||''!=this.value||(x=!0);x?x&&'undefined'!=typeof u.isJsonWebToken&&delete u.isJsonWebToken:u.isJsonWebToken=E(this.error||S.errorLabels.isJsonWebToken,this);this.valid=x;0<u.count()&&(this.errors=u);return v[this.name]};v[n].isBoolean=function(){var x=null,u=v[this.name].errors||{};u.isRequired&&0==this.value&&(delete u.isRequired,this.errors=u);switch(this.value){case 'true':case !0:case 1:x=this.value=S.data[this.name]=!0;break;case 'false':case !1:case 0:x=this.value=S.data[this.name]=
|
|
365
|
+
!1}(x=null!==x?!0:!1)?x&&'undefined'!=typeof u.isBoolean&&delete u.isBoolean:u.isBoolean=E(this.error||S.errorLabels.isBoolean,this);this.valid=x;0<u.count()&&(this.errors=u);return v[this.name]};v[n].isNumber=function(x,u){var G=this.value,M=!1,T=!0,ra=!0,Ea=v[this.name].errors||{};try{'string'==typeof G&&/,|\./g.test(G)?G=S.data[this.name]=this.value=parseFloat(G.replace(/,/g,'.').replace(/\s+/g,'')):'string'==typeof G&&''!=G&&(G=S.data[this.name]=this.value=parseInt(G.replace(/\s+/g,'')))}catch(ia){Ea.isNumber=
|
|
366
|
+
E(this.error||S.errorLabels.isNumber,this),this.valid=!1,0<Ea.count()&&(this.errors=Ea)}if(+G===+G&&(M=!0,!Ea.isRequired&&''!=G)){var W=G.toString().length;x&&'number'==typeof x&&W<x&&(T=!1,this.size=x);u&&'number'==typeof u&&W>u&&(ra=!1,this.size=u)}M&&T&&ra||(M||(Ea.isNumber=E(this.error||S.errorLabels.isNumber,this)),T&&ra||(T||(Ea.isNumberLength=E(this.error||S.errorLabels.isNumberMinLength,this)),ra||(Ea.isNumberLength=E(this.error||S.errorLabels.isNumberMaxLength,this)),x===u&&(Ea.isNumberLength=
|
|
367
|
+
E(this.error||S.errorLabels.isNumberLength,this))),M=!1);M&&'undefined'!=typeof Ea.isNumberLength&&delete Ea.isNumberLength;this.valid=M;this.value=S.data[this.name]=''!=G?Number(G):G;0<Ea.count()&&(this.errors=Ea);return v[this.name]};v[n].toInteger=function(){var x=this.value,u=v[this.name].errors||{};if(x)try{this.value=S.data[this.name]=Math.round(x)}catch(G){u.toInteger=E(this.error||S.errorLabels.toInteger,this),this.valid=!1,0<u.count()&&(this.errors=u)}return v[this.name]};v[n].isInteger=
|
|
368
|
+
function(x,u){var G=this.value,M=!1,T=!0,ra=!0,Ea=v[this.name].errors||{};+G===+G&&0===G%1&&(M=!0,Ea.isRequired||''==G||(x&&'number'==typeof x&&G.length<x&&(T=!1,this.size=x),u&&'number'==typeof u&&G.length>u&&(ra=!1,this.size=u)));M&&T&&ra||(M||(Ea.isInteger=E(this.error||S.errorLabels.isInteger,this)),T&&ra||(T||(Ea.isIntegerLength=E(this.error||S.errorLabels.isIntegerMinLength,this),M=!1),ra||(Ea.isIntegerLength=E(this.error||S.errorLabels.isIntegerMaxLength,this),M=!1),x===u&&(Ea.isIntegerLength=
|
|
369
|
+
E(this.error||S.errorLabels.isIntegerLength,this),M=!1)));this.valid=M;this.value=S.data[this.name]=Number(G);0<Ea.count()&&(this.errors=Ea);return v[this.name]};v[n].toFloat=function(x){var u=document.getElementById(this.target.getAttribute('id')).value||this.value;isFloatingWithCommas=!1;'string'==typeof u&&(u=u.replace(/\s+/g,''),/,/.test(u)&&/\./.test(u)?u=u.replace(/,/g,''):/,/.test(u)&&(u=u.replace(/,/g,'.'),isFloatingWithCommas=!0));S.data[this.name]=u;var G=v[this.name].errors||{},M=!0;x?
|
|
370
|
+
this.decimals=parseInt(x):'undefined'==typeof this.decimals&&(this.decimals=2);if(u)if(this.isNumber().valid)try{Number.isFinite(u)||(u=new Number(parseFloat(u.match(/[0-9.,]+/g).join('').replace(/,/,'.'))))}catch(T){M=!1,G.toFloat=E(this.error||S.errorLabels.toFloat,this),this.valid=!1,0<G.count()&&(this.errors=G)}else M=!1,G.toFloat=E(this.error||S.errorLabels.toFloatNAN,this);else return v[this.name];this.decimals&&u&&!G.toFloat&&(u=parseFloat(u.toFixed(this.decimals)));this.value=S.data[this.name]=
|
|
371
|
+
u;U&&(isFloatingWithCommas&&(u=(''+u).replace(/\./g,',')),this.target.setAttribute('value',u));this.valid=M;0<G.count()&&(this.errors=G);return v[this.name]};v[n].isFloat=function(x){'string'==typeof this.value&&(this.value=this.value.replace(/\s+/g,''));var u=S.data[this.name]=this.value;x=v[this.name].errors||{};'string'==typeof u&&/\./.test(u)&&Number.isFinite(Number(u));'string'==typeof u&&/,/g.test(u)&&(u=this.value=S.data[this.name]=Number(u.replace(/,/g,'.')));Number(u)===u&&0!==u%1?(this.value=
|
|
372
|
+
S.data[this.name]=Number(u),u=!0):u=!1;x.isRequired||''!=this.value||(u=!0);u||(x.isFloat=E(this.error||S.errorLabels.isFloat,this));this.valid=u;0<x.count()&&(this.errors=x);return v[this.name]};v[n].isRequired=function(x){if('boolean'==typeof x&&!x)return this.valid=!0,x=S.excluded.indexOf(this.name),-1<x&&S.excluded.splice(x,1),v[this.name];if(U&&this.target&&'INPUT'==this.target.tagName&&'undefined'!=typeof this.target.type&&'radio'==this.target.type){x=document.getElementsByName(this.name);for(var u=
|
|
373
|
+
0,G=x.length;u<G;++u)if(x[u].checked){/true|false/.test(x[u].value)?this.value=S.data[this.name]=/true/.test(x[u].value)?!0:!1:this.value=S.data[this.name]=x[u].value;this.valid=!0;break}}x='undefined'==typeof this.value||null==this.value||''==this.value||/^\s+/.test(this.value)?!1:!0;u=v[this.name].errors||{};x?x&&'undefined'!=typeof u.isRequired&&delete u.isRequired:u.isRequired=E(this.error||S.errorLabels.isRequired,this);this.valid=x;0<u.count()&&(this.errors=u);return v[this.name]};v[n].isString=
|
|
374
|
+
function(x,u){var G=S.data[this.name]=this.value,M=!1,T=!0,ra=!0,Ea=v[this.name].errors||{};'string'!=typeof G||Ea.isRequired||''==G||(M=!0,x&&'number'==typeof x&&G.length<x&&(T=!1,this.size=x),u&&'number'==typeof u&&G.length>u&&(ra=!1,this.size=u));M&&T&&ra||(!M&&Ea.isRequired&&''==G?(M=!1,Ea.isString=E(this.error||S.errorLabels.isString,this)):M||Ea.isRequired||(M=!0),T&&ra||(M=!1,T||(Ea.isStringLength=E(this.error||S.errorLabels.isStringMinLength,this)),ra||(Ea.isStringLength=E(this.error||S.errorLabels.isStringMaxLength,
|
|
375
|
+
this)),x===u&&(Ea.isStringLength=E(this.error||S.errorLabels.isStringLength,this))));this.valid=M;0<Ea.count()&&(this.errors=Ea);return v[this.name]};v[n].isDate=function(x){var u=this.value,G=!1,M=v[this.name].errors||{},T=null;if(!u||''==u||/NaN|Invalid Date/i.test(u))return/NaN|Invalid Date/i.test(u)&&(console.warn('[FormValidator::isDate] Provided value for field `'+this.name+'` is not allowed: `'+u+'`'),M.isDate=E(this.error||S.errorLabels.isDate,this)),this.valid=G,0<M.count()&&(this.errors=
|
|
376
|
+
M),v[this.name];if('undefined'==typeof x||'undefined'!=typeof x&&/true/i.test(x))x='yyyy-mm-dd';if(u instanceof Date)u=u.format(x);else{try{T=x.match(/[^\/\- ]+/g)}catch(ea){throw Error('[FormValidator::isDate] Provided mask not allowed: `'+x+'`');}try{u=u.match(/[^\/\- ]+/g);var ra={},Ea;var W=0;for(Ea=T.length;W<Ea;++W)ra[T[W]]=u[W];for(var ia in ra)x=x.replace(new RegExp(ia,'g'),ra[ia])}catch(ea){throw Error('[FormValidator::isDate] Provided value not allowed: `'+u+'`'+ea);}u=this.value=S.data[this.name]=
|
|
377
|
+
new Date(x);if(/Invalid Date/i.test(u)||!1===u instanceof Date)return M.isRequired||''!=this.value?M.isDate=E(this.error||S.errorLabels.isDate,this):G=!0,this.valid=G,0<M.count()&&(this.errors=M),v[this.name];G=!0}this.valid=G;return u};v[n].format=function(x,u){var G=this.value;return G?G.format(x,u):v[this.name]};v[n].setFlash=function(x,u){'undefined'!=typeof u&&''!=u&&(this.error=u);return v[this.name]};v[n].setLabel=function(x){'undefined'!=typeof x&&''!=x&&(this.label=x);return v[this.name]};
|
|
378
|
+
v[n].trim=function(x){if('boolean'==typeof x&&x)return this.value=this.value.replace(/^\s+|\s+$/,''),S.data[this.name]=S.data[this.name]=this.value,v[this.name]};v[n].exclude=function(x){if('boolean'==typeof x&&!x)return/^true|false$/i.test(this.value)&&(this.value=/^true$/i.test(this.value)?!0:!1,S.data[this.name]=this.value),v[this.name];this.isExcluded=!1;0>S.excluded.indexOf(this.name)&&(S.excluded.push(this.name),this.isExcluded=!0);return v[this.name]};v[n].query=K;v[n].getValidationContext=
|
|
379
|
+
function(){return{isGFFCtx:U,self:v,local:S,replace:E}};if(R()){z=y=null;try{for(let x in gina.forms.validators)z='/validators/'+x+'/main.js',S.errorLabels[x]='Condition not satisfied',U?(y=w(gina.forms.validators[x].data),y=y.replace(/(\)\s+\{|\)\{){1}/,'$&\n\tvar validationContext = this.getValidationContext(),isGFFCtx = validationContext.isGFFCtx,self = validationContext.self,local = validationContext.local,replace = validationContext.replace;')):y=gina.forms.validators[x].toString(),v[n][x]=eval('('+
|
|
380
|
+
y+')\n//# sourceURL='+x+'.js')}catch(x){throw Error('[UserFormValidator] Could not evaluate: `'+z+'`\n'+x.stack);}}};for(let n in v)A(n,v[n]);v.addField=function(n,y){'undefined'==typeof v[n]&&A(n,y)};v.isValid=function(){return 0<v.getErrors().count()?!1:!0};v.setErrors=function(n){if(!n)return{};for(var y in v)if('object'==typeof v[y]){for(var z in v[y])'object'==typeof n[y]&&'undefined'!=typeof n[y][z]&&('undefined'!=typeof v[y].valid&&/^true$/i.test(v[y].valid)?delete n[y][z]:('undefined'==typeof v[y].errors&&
|
|
381
|
+
(v[y].errors={}),v[y].errors[z]=n[y][z]));('undefined'==typeof v[y].errors&&'undefined'!=typeof n[y]||'undefined'!=typeof v[y].errors&&0==v[y].errors.count()&&'undefined'!=typeof n[y])&&delete n[y]}return n};v.getErrors=function(n){var y={};if('undefined'!=typeof n)return'undefined'!=typeof v[n]&&v[n]&&'undefined'!=typeof v[n].errors&&0<v[n].errors.count()&&(y[n]=v[n].errors),y;for(var z in v)'object'==typeof v[z]&&'undefined'!=typeof v[z].errors&&0<v[z].errors.count()&&(y[z]=v[z].errors);return y};
|
|
382
|
+
v.toData=function(){if(0<S.excluded.length)for(var n=0,y=S.excluded.length;n<y;++n)'undefined'!=typeof S.data[S.excluded[n]]&&delete S.data[S.excluded[n]];return S.data};var E=function(n,y){var z=n.match(/%[a-z]+/gi);if(z)for(var F=0,x=z.length;F<x;++F)n=n.replace(new RegExp(z[F],'g'),y[S.keys[z[F]]]);return n};v.setErrorLabels=function(n){'undefined'!=typeof n&&(S.errorLabels=N(n,S.errorLabels))};return v}
|
|
383
|
+
'undefined'!==typeof module&&module.exports?module.exports=FormValidatorUtil:'function'===typeof define&&define.amd&&define('lib/form-validator',[],function(){return FormValidatorUtil});
|
|
383
384
|
function Routing(){var B='undefined'!==typeof module&&module.exports?!1:!0,Q={allowedMethods:['get','post','put','delete'],reservedParams:['controle','file','title','namespace','path'],notFound:{}};Q.allowedMethodsString=Q.allowedMethods.join(',');var V=null,la=null,U=null;B?(la&&'function'==typeof la||(la=require('lib/merge')),U&&'function'==typeof U||(U=require('lib/form-validator'))):(require('fs'),require('util'),require('../../inherits'),la=require('../../merge'),V=require(__dirname+'/../../../core/plugins')||
|
|
384
|
-
getContext('gina').plugins,U=V.Validator);Q.getUrlProps=function(
|
|
385
|
-
za.envConf[
|
|
386
|
-
try{
|
|
387
|
-
1);else if(/^validator::/.test(
|
|
388
|
-
!
|
|
389
|
-
|
|
390
|
-
z),
|
|
391
|
-
I));
|
|
392
|
-
typeof za[
|
|
393
|
-
|
|
394
|
-
typeof za.params&&E)return za.params[y]=I,'undefined'==typeof za[
|
|
395
|
-
function(ra){F+=ra});n[y[0]]=I.replace(new RegExp(F,'g'),'');E=JSON.parse(K.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g,'"$&"'));z[y[0]]=E;n=new U('routing',n,null,z);for(let ra in E)if(Array.isArray(E[ra]))n[y[0]][ra].apply(n[y[0]],E[ra]);else n[y[0]][ra](E[ra]);E=n.isValid()}else E=(new RegExp(
|
|
396
|
-
I=z.substr(0,z.length),/^\//.test(K)?(E=K.match(/\/(.*)\//).pop(),n=K.replace('/'+E+'/',''),E=(new RegExp(E,n)).test(I)):E=(new RegExp(
|
|
397
|
-
if('undefined'!=typeof I&&'undefined'!=typeof I[K]){var A=new RegExp('(:'+K+'/|:'+K+'$)','g');'undefined'!=typeof
|
|
398
|
-
|
|
399
|
-
window.location.hostname!=window.gina.config.hostname.replace(/^(https|http|wss|ws):\/\//,'').replace(/:\d+$/,'')||(va=!0,window.gina.config.hostname=window.gina.config.hostname.replace(/^(https|http|wss|ws):\/\//,'').replace(/:\d+$/,'')),za=window.gina.config):(za=getContext('gina').config,'undefined'!=typeof getContext('argvFilename')&&(za.getRouting=getContext('gina').Config.instance.getRouting),va=getContext('isProxyHost'));var P=za.env||GINA_ENV,K=null,A=za.bundle;/@/.test(
|
|
400
|
-
null==A||(
|
|
401
|
-
za.envConf._proxyHostname,K.proxy_host=K.proxy_hostname.replace(/^(https|http):\/\//,'')):'undefined'
|
|
402
|
-
'?';za=A[
|
|
385
|
+
getContext('gina').plugins,U=V.Validator);Q.getUrlProps=function(v,I){var w={};if(B){var za=window.gina.config;w.hostname=za.hostname;'undefined'!=typeof v&&(v=this.getRoute('webroot@'+v),w.hostname=v.hostname,w.host=v.host,w.webroot=v.webroot)}else za=getContext('gina').config,'undefined'!=typeof getContext('argvFilename')&&(za.getRouting=getContext('gina').Config.instance.getRouting),'undefined'==typeof v&&(v=za.bundle),'undefined'==typeof I&&(I=za.env),w.hostname=za.envConf[v][I].hostname,w.host=
|
|
386
|
+
za.envConf[v][I].host,w.webroot=za.envConf[v][I].server.webroot;return w};Q.compareUrls=async function(v,I,w,za,va){'undefined'==typeof w&&(w={routing:{}});if(/,/.test(I)){var P=0;I=I.split(/,/g);for(var K=I.length,A={past:!1,request:w};P<K&&!A.past;)A=await N(v,I[P],w,za,va),++P;return A}return await N(v,I,w,za,va)};var N=async function(v,I,w,za,va){var P=null;try{P=v.url.split(/\//)}catch(T){console.warn(T),P=['']}I=I.split(/\//);var K=0,A=0,E=I.length,n=0,y={},z=0,F=w.method.toLowerCase(),x='get';
|
|
387
|
+
try{x=v.method.toLowerCase()}catch(T){}var u=!1;if('undefined'!=typeof v.requirements&&/get|delete/i.test(F)&&'undefined'!=typeof w[F]||'undefined'!=typeof v.requirements&&/get/i.test(F)&&/delete/i.test(x)){/get/i.test(F)&&/delete/i.test(x)&&(F=x);if(/^(delete)$/i.test(F)&&P.length===I.length){'undefined'==typeof w[F]&&(w[F]={});for(let T=0,ra=I.length;T<ra;T++)if(P[T]===I[T])++n;else if(x=I[T].substr(1),'undefined'!=typeof v.requirements[x]){x=v.requirements[x];if(/^\//.test(x))x=x.substr(1,x.lastIndexOf('/')-
|
|
388
|
+
1);else if(/^validator::/.test(x)&&await ha(I[T],P[T],v,w,za,va)){++n;continue}/^:/.test(I[T])&&'undefined'!=typeof x&&(new RegExp(x)).test(P[T])&&(++n,w[F][I[T].substr(1)]=P[T])}u=!0}for(var G in w[F])'undefined'!=typeof v.requirements[G]&&0>I.indexOf(':'+G)&&(I[A]=':'+G,++A,P[K]=w[F][G],++K,u||P.length!==I.length||++E)}if(!u&&P.length===I.length)for(;z<E;++z)P[z]===I[z]?++n:n==z&&/:/.test(I[z])&&await ha(I[z],P[z],v,w,za,va)&&++n;if('undefined'!=typeof v.requirements&&F==v.method.toLowerCase()&&
|
|
389
|
+
!u&&n>=E)for(G=Object.getOwnPropertyNames(v.requirements),K=0,I.join(',').match(/:[-_a-z0-9]+/g);K<G.length;){A=G[K];if('undefined'==typeof v.param[A]&&/^validator::/i.test(v.requirements[A])){if(I.length!=P.length)break;var M=I.join(',').match(/:[-_a-z0-9]+/g);let T=v.requirements[A];z={};x={};u={};try{x=JSON.parse(T.split(/::/).splice(1)[0].replace(/([^:"\s+](\w+)):/g,'"$1":').replace(/([^:"\s+](\w+))\s+:/g,'"$1":'))}catch(ra){throw ra;}if('undefined'!=typeof x.query&&'undefined'!=typeof x.query.data){z=
|
|
390
|
+
x.query.data;for(let ra in z)0>M.indexOf(z[ra])&&delete z[ra];for(let ra=0,Ea=I.length;ra<Ea;ra++)/^:/.test(I[ra])&&(M=I[ra].replace(/^:/,''),''!=M&&'undefined'!=typeof P[ra]&&(z[M]=P[ra],'undefined'==typeof w.params[M]&&(w.params[M]=P[ra])))}z=la(z,JSON.clone(w[F])||{});'undefined'==typeof z[A]&&(z[A]=null);u[A]=x;_validator=B?new U(z):new U('routing',z,null,u);if(0==x.count()){console.error('Route validation failed '+v.rule);--n;K++;continue}for(let ra in x)if('undefined'!=typeof x[ra].data&&(x[ra].data=
|
|
391
|
+
z),u=Array.isArray(x[ra])?await _validator[A][ra].apply(_validator[A],x[ra]):await _validator[A][ra](x[ra],w,za,va),!u.isValid&&(--n,'undefined'!=typeof u.error))throw u.error;}K++}y.past=n===E?!0:!1;y.past&&(w.routing=S(v,w[F]),y.request=w);return y},ha=async function(v,I,w,za,va,P){var K=-1,A=v.match(/:\w+/g);K=new RegExp(v,'g');var E=null,n=null,y=null;E=!1;var z=E=n=n=null,F=null,x=za.method.toLowerCase();if(!A.length)return!1;w.param.path&&K.test(w.param.path)&&(w.param.path=w.param.path.replace(K,
|
|
392
|
+
I));w.param.namespace&&K.test(w.param.namespace)&&(w.param.namespace=w.param.namespace.replace(K,I));'undefined'!=typeof w.param.file&&/:/.test(w.param.file)&&(E=new RegExp('(:'+v+'/|:'+v+'$)','g'),R.variable=I,w.param.file=w.param.file.replace(E,R),E=null);w.param.title&&K.test(w.param.title)&&(w.param.title=w.param.title.replace(K,I));if(1==A.length){E=new RegExp(A[0]);K=-1<A.indexOf(v)?A.indexOf(v):!1;!1===K&&v.match(E)&&(K=0);if(!1===K)return K;if(w.method.toLowerCase()!==x)return!1;'undefined'==
|
|
393
|
+
typeof za[x]&&(za[x]={});y=A[K].substr(1);K=w.requirements[y];if(/^\//.test(K))E=K.match(/\/(.*)\//).pop(),n=K.replace('/'+E+'/',''),E=(new RegExp(E,n)).test(I);else if(/^validator::/.test(K)&&I){n={};E={};z={};F='';v.replace(new RegExp('[^'+y+']','g'),function(ra){F+=ra});n[y]=I.replace(new RegExp(F,'g'),'');try{E=JSON.parse(K.split(/::/).splice(1)[0].replace(/([^:"\s+](\w+)):/g,'"$1":').replace(/([^:"\s+](\w+))\s+:/g,'"$1":'))}catch(ra){throw ra;}'undefined'!=typeof E.query&&'undefined'!=typeof E.query.data&&
|
|
394
|
+
v==E.query.data[Object.keys(E.query.data)[0]]&&(E.query.data[Object.keys(E.query.data)[0]]=n[y],za.params[y]=n[y]);z[y]=E;n=new U('routing',n,null,z);if(0==E.count())return console.error('Route validation failed '+w.rule),!1;for(var u in E)Array.isArray(E[u])?await n[y][u].apply(n[y],E[u]):await n[y][u](E[u],za,va,P);E=n.isValid()}else E=(new RegExp(w.requirements[y])).test(I);if('undefined'!=typeof w.param[y]&&'undefined'!=typeof w.requirements&&'undefined'!=typeof w.requirements[y]&&'undefined'!=
|
|
395
|
+
typeof za.params&&E)return za.params[y]=I,'undefined'==typeof za[x][y]&&(za[x][y]=I),!0}else{va=w.url;P=za.url;x={};z='';var G=!1,M=0;u=0;for(var T=P.length;u<T;++u)if(P.charAt(u)!=va.charAt(M)||G){if(''==z)G=!0,z+=P.charAt(u);else if(u>va.indexOf(A[0])+A[0].length){K=w.requirements[A[0]];I=z.substr(0,z.length);if(/^\//.test(K))E=K.match(/\/(.*)\//).pop(),n=K.replace('/'+E+'/',''),E=(new RegExp(E,n)).test(I);else if(/^validator::/.test(K)){n={};E={};z={};F='';v.replace(new RegExp('[^'+y[0]+']','g'),
|
|
396
|
+
function(ra){F+=ra});n[y[0]]=I.replace(new RegExp(F,'g'),'');E=JSON.parse(K.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g,'"$&"'));z[y[0]]=E;n=new U('routing',n,null,z);for(let ra in E)if(Array.isArray(E[ra]))n[y[0]][ra].apply(n[y[0]],E[ra]);else n[y[0]][ra](E[ra]);E=n.isValid()}else E=(new RegExp(w.requirements[y[0]])).test(I);if(E)x[A[0].substr(1)]=I;else return!1;z='';G=!1;M=va.indexOf(A[0])+A[0].length;--u;A.splice(0,1)}else z+=P.charAt(u),++M;if(u==T-1)if(K=w.requirements[A[0]],
|
|
397
|
+
I=z.substr(0,z.length),/^\//.test(K)?(E=K.match(/\/(.*)\//).pop(),n=K.replace('/'+E+'/',''),E=(new RegExp(E,n)).test(I)):E=(new RegExp(w.requirements[y])).test(I),E)x[A[0].substr(1)]=I;else return!1}else++M;if(x.count()==A.length){y=null;for(y in x)za.params[y]=x[y];return!0}}return!1},R=function(v){return/\/$/.test(v)?R.variable+'/':R.variable},S=function(v,I){var w=null,za,va=v.url,P=null;for(P in v.param)if(('undefined'==typeof I||'undefined'!=typeof I[P])&&/^:/.test(v.param[P])){var K=v.param[P].substr(1);
|
|
398
|
+
if('undefined'!=typeof I&&'undefined'!=typeof I[K]){var A=new RegExp('(:'+K+'/|:'+K+'$)','g');'undefined'!=typeof v.param.path&&/:/.test(v.param.path)&&(v.param.path=v.param.path.replace(A,I[K]));'undefined'!=typeof v.param.title&&/:/.test(v.param.title)&&(v.param.title=v.param.title.replace(A,I[K]));'undefined'!=typeof v.param.namespace&&/:/.test(v.param.namespace)&&(v.param.namespace=v.param.namespace.replace(A,I[K]));'undefined'!=typeof v.param.file&&/:/.test(v.param.file)&&(R.variable=I[K],v.param.file=
|
|
399
|
+
v.param.file.replace(A,R));if(/,/.test(v.url)){w=v.url.split(/,/g);var E=0;for(za=w.length;E<za;++E)R.variable=I[K],w[E]=w[E].replace(A,R);v.url=w.join(',')}else R.variable=I[K],v.url=v.url.replace(A,R)}}if(w){E=0;za=w.length;va=va.split(/,/g);var n=0;for(v.urlIndex=0;E<za;++E)if(w=0,A=va[0].match(/:[-_a-z0-9]+/ig)){P=0;for(K=A.length;P<K;P++){var y=A[P].substr(1);'undefined'!=typeof I[y]&&I[y]&&w++}w>n&&(n=w,v.urlIndex=E)}}return v};Q.getRoute=function(v,I,w){var za=null,va=!1;B?(window.location.port||
|
|
400
|
+
window.location.hostname!=window.gina.config.hostname.replace(/^(https|http|wss|ws):\/\//,'').replace(/:\d+$/,'')||(va=!0,window.gina.config.hostname=window.gina.config.hostname.replace(/^(https|http|wss|ws):\/\//,'').replace(/:\d+$/,'')),za=window.gina.config):(za=getContext('gina').config,'undefined'!=typeof getContext('argvFilename')&&(za.getRouting=getContext('gina').Config.instance.getRouting),va=getContext('isProxyHost'));var P=za.env||GINA_ENV,K=null,A=za.bundle;/@/.test(v)||'undefined'==typeof A||
|
|
401
|
+
null==A||(v=v.toLowerCase(),v+='@'+A);if(/@/.test(v)){var E=v.replace(/(.*):\/\//,'').split(/@/);A=E[1];/\/(.*)$/.test(v)&&(K=v.replace(/(.*):\/\//,'').split(/\/(.*)$/)[1],A=A.replace(/\/(.*)$/,''),P=K||P);v=E[0].toLowerCase()+'@'+A}A=za.getRouting(A,P);if('undefined'==typeof A[v])throw Error('[ RoutingHelper::getRouting(rule, params) ] : `'+v+'` not found !');K=JSON.clone(A[v]);E=null;K=S(K,I);(K.isProxyHost=va)?(K.proxy_hostname=B?window.location.protocol+'//'+document.location.hostname:process.gina.PROXY_HOSTNAME||
|
|
402
|
+
za.envConf._proxyHostname,K.proxy_host=K.proxy_hostname.replace(/^(https|http):\/\//,'')):B||'undefined'==typeof process.gina.PROXY_HOSTNAME||(K.proxy_hostname=process.gina.PROXY_HOSTNAME,K.proxy_host=K.proxy_hostname.replace(/^(https|http):\/\//,''));/,/.test(K.url)&&('undefined'!=typeof K.urlIndex&&(w=K.urlIndex,delete K.urlIndex),w='undefined'!=typeof w?w:0,K.url=K.url.split(/,/g)[w]);/\/$/.test(K.url)&&'/'!=K.url&&(K.url=K.url.substr(0,K.url.length-1));if(/GET/i.test(K.method)&&'undefined'!=typeof I){w=
|
|
403
|
+
'?';za=A[v].url;va=[];A=0;for(let n in K.param)-1<Q.reservedParams.indexOf(n)||(new RegExp(K.param[n])).test(za)||'undefined'==typeof I[n]||(w+=n+'='+encodeRFC5987ValueChars(I[n])+'&',va[A]=I[n],++A);for(let n in I)-1<Q.reservedParams.indexOf(n)||'undefined'!=typeof K.requirements[n]||-1<va.indexOf(n)||(w='object'==typeof I[n]?w+(n+'='+encodeRFC5987ValueChars(JSON.stringify(I[n]))+'&'):w+(n+'='+I[n]+'&'));A=va=za=null;1<w.length&&(w=w.substring(0,w.length-1),K.url+=w);w=null}K.toUrl=function(n){var y=
|
|
403
404
|
null;/^redirect$/i.test(this.param.control)&&(y=Q.getUrlProps(this.bundle,P||GINA_ENV));var z=this.webroot||y.webroot;y=''+this.hostname||''+y.hostname;var F=''+this.url;this.isProxyHost&&(y=''+this.proxy_hostname);this.url='undefined'!=typeof n&&/^true$/i.test(n)?F.replace(new RegExp('^'+z),'/'):F.replace(new RegExp('^('+z+'|/$)'),z);return y+this.url};K.request=function(n,y){var z=null,F=null;'function'==typeof arguments[arguments.length-1]&&(z=arguments[arguments.length-1]);'object'==typeof arguments[2]&&
|
|
404
|
-
(F=arguments[2]);var
|
|
405
|
-
'string'==typeof ra&&(T+='\n'+ra)});G.on('end',function(){if(/^\{/.test(M))try{M=JSON.parse(M),'undefined'!=typeof M.error&&(T=JSON.clone(M),M=null)}catch(ra){T=ra}T?z(T):z(!1,M)})},z?
|
|
406
|
-
I+']',E=E.replace(/%r/,
|
|
407
|
-
B&&(E=gina.config.reverseRouting,A=gina.config.routing),'undefined'!=typeof E[P]&&(z=A[E[P]],I=z.bundle,P=z.webroot,y=z.hostname,z=null));va='boolean'!=typeof arguments[arguments.length-1]?!1:arguments[arguments.length-1];var F=!1,
|
|
408
|
-
method:
|
|
409
|
-
|
|
410
|
-
bundle:A[M].bundle,isXMLRequest};try{if(G=Q.compareUrls(
|
|
411
|
-
n=!0;'undefined'==typeof Q.notFound&&(Q.notFound={});A=null;K='[ RoutingHelper::getRouteByUrl(rule[, bundle, method]) ] : route [ %r ] is called but not found inside your view: `'+
|
|
412
|
-
A.replace(/404:\s+/,'')),'undefined'==typeof Q.notFound[A]?Q.notFound[A]={count:1,message:K}:z&&'undefined'!=typeof Q.notFound[A]&&++Q.notFound[A].count,!1;if((n=gina.config.reverseRouting[
|
|
413
|
-
'undefined'==typeof Q.notFound[A]?K=K.replace(/%r/,A):++Q.notFound[A].count);return!1}console.warn(Error('[ RoutingHelper::getRouteByUrl(rule[, bundle, method, request]) ] : route not found for url: `'+
|
|
414
|
-
function StoragePlugin(B){function Q(K){I=JSON.parse(S.getItem(this.bucket));'undefined'==typeof I[K]&&(I[K]=[],S.setItem(this.bucket,JSON.stringify(I)),I=JSON.parse(S.getItem(this.bucket)));
|
|
415
|
-
-1<
|
|
416
|
-
var U=U||require('vendor/uuid'),N=N||require('helpers/dateFormat'),ha={bucket:'default'},R={},S=null,
|
|
417
|
-
if('object'!==typeof K)throw Error('filter must be an object');A=I[this._collection];K.count();var E=0,n=[],y;for(y in A)for(var z in K){var F='boolean'!=typeof K[z]?K[z].toLocaleLowerCase():K[z];K[z]&&-1<
|
|
418
|
-
typeof K)throw Error('filter must be an object');var A=JSON.clone(I[this._collection]),E=0,n=[],y;for(y in A)for(var z in K)K[z]&&-1<
|
|
419
|
-
(S.setItem(this._bucket,JSON.stringify(I)),!0):!1},drop:function(K){if('undefined'==typeof I[this._collection])throw Error('Collection `'+K+'` not found');delete
|
|
420
|
-
delete A[n][E].save;delete A[n][E]._filter;if(K&&'object'==typeof A[n][E]){var F=function(
|
|
421
|
-
A[n][E]=F(this,A[n][E]):'object'==typeof A[n][E]?A[n][E]=
|
|
405
|
+
(F=arguments[2]);var x=this.webroot||F.webroot,u=this.hostname||F.hostname;F='undefined'!=typeof n&&1==n?path.replace(x,'/'):this.url||F.url;/^\//.test(F)&&(F=u+F);u=/^https/.test(u)?'https':'http';B?window.open(F,'undefined'!=typeof y&&'undefined'!=typeof y.target?y.target:'_self'):('undefined'==typeof y.agent&&(y.agent=!1),u=require(''+u),x=function(G){var M='',T=!1;G.on('data',function(ra){M+=ra});G.on('error',function(ra){T='Failed to get mail content';ra&&'undefined'!=typeof ra.stack?T+=ra.stack:
|
|
406
|
+
'string'==typeof ra&&(T+='\n'+ra)});G.on('end',function(){if(/^\{/.test(M))try{M=JSON.parse(M),'undefined'!=typeof M.error&&(T=JSON.clone(M),M=null)}catch(ra){T=ra}T?z(T):z(!1,M)})},z?u.get(F,y,x):u.get(F,y))};!/:/.test(K.url)||/:d+\//.test(K.url)||/:\/\//.test(K.url)||(I=K.url.match(/(:(.*)\/|:(.*)$)/g).map(function(n){return n.replace(/\//g,'')}).join(', '),E='[ RoutingHelper::getRoute(rule[, bundle, method]) ] : route [ %r ] param placeholder not defined: `'+K.url+'` !\n Check your route description to compare requirements against param variables [ '+
|
|
407
|
+
I+']',E=E.replace(/%r/,v),v=Error(E),console.warn(v),E=v=I=null);return K};Q.getRouteByUrl=function(v,I,w,za,va){2==arguments.length&&'undefined'!=typeof arguments[1]&&arguments[1]&&-1<Q.allowedMethods.indexOf(arguments[1].toLowerCase())&&(w=arguments[1],I=void 0);var P=null,K=null,A=null,E=null,n=null,y=null;if(/#/.test(v)&&1<v.length){var z=v.split(/#/);v=z[0];n='#'+z[1];z=null}1==arguments.length&&'undefined'!=typeof arguments[0]&&(/^(https|http)/i.test(v)||/^\//.test(v)||(v='/'+v),P='/'+v.split(/\//g)[1],
|
|
408
|
+
B&&(E=gina.config.reverseRouting,A=gina.config.routing),'undefined'!=typeof E[P]&&(z=A[E[P]],I=z.bundle,P=z.webroot,y=z.hostname,z=null));va='boolean'!=typeof arguments[arguments.length-1]?!1:arguments[arguments.length-1];var F=!1,x=null,u=null,G=x=u=null;z='undefined'!=typeof w?!0:!1;B?(x=window.gina.config,I='undefined'!=typeof I?I:x.bundle,u=x.env,A=A||x.getRouting(I),E=E||x.reverseRouting,isXMLRequest='undefined'!=typeof isXMLRequest?isXMLRequest:!1,y=y||x.hostname,P=P||x.webroot,za={routing:{},
|
|
409
|
+
method:w,params:{},url:v},I&&(za.bundle=I)):(x=getContext('gina').config,I='undefined'!=typeof I?I:x.bundle,u=x.env,A=x.getRouting(I),y=x.envConf[I][u].hostname,P=x.envConf[I][u].server.webroot,za||={routing:{},isXMLRequest:!1,method:'undefined'!=typeof w?w.toLowerCase():'get',params:{},url:v},va&&(za.method=w),isXMLRequest=za.isXMLRequest||!1);u=v.replace(new RegExp('^('+y+'|'+y.replace(/:\d+/,'')+')'),'');'undefined'==typeof za.routing.path&&(za.routing.path=decodeURI(u));w='undefined'!=typeof w?
|
|
410
|
+
w.toLowerCase():'get';z&&(za.originalMethod=za.method,za.method=w,za.routing.path=decodeURI(u));za.method||(za.method=w);x={};P=new RegExp(w,'i');E=null;var M;for(M in A){if('undefined'==typeof A[M].param)break;if(A[M].bundle==I&&(E=A[M].method,/,/.test(E)&&P.test(E)&&(E=za.method),'undefined'==typeof A[M].method||P.test(E))){x={method:E,requirements:A[M].requirements,namespace:A[M].namespace||void 0,url:decodeURI(u),rule:A[M].originalRule||M,param:A[M].param,middleware:JSON.clone(A[M].middleware),
|
|
411
|
+
bundle:A[M].bundle,isXMLRequest};try{if(G=Q.compareUrls(x,A[M].url,za),G.past){K=JSON.clone(A[M]);K.name=M;F=!0;G={};break}}catch(T){throw Error('Route [ '+M+' ] needs your attention.\n'+T.stack);}}}if(F)return/\/$/.test(v)&&'/'!=v&&(v=v.substr(0,v.length-1)),n&&(v+=n),K.url=v,K.toUrl=function(T){var ra=this.webroot,Ea=this.hostname,W=this.url;this.url='undefined'!=typeof T&&1==T?W.replace(ra,'/'):W;return Ea+this.url},K;if(B){n=!1;if('#'==v&&/GET/i.test(w)&&z||/^404:/.test(v))v=location.pathname,
|
|
412
|
+
n=!0;'undefined'==typeof Q.notFound&&(Q.notFound={});A=null;K='[ RoutingHelper::getRouteByUrl(rule[, bundle, method]) ] : route [ %r ] is called but not found inside your view: `'+v+'` !';if((A=(A=gina.hasPopinHandler&&gina.popinIsBinded?gina.popin.getActivePopin().target.innerHTML.match(/404:\[\w+\][a-z 0-9-_@]+/):document.body.innerHTML.match(/404:\[\w+\][a-z 0-9-_@]+/))&&0<A.length?A[0]:null)&&z&&n)return n=A.match(/\[\w+\]/)[0],A=A.replace('404:'+n,n.replace(/\[|\]/g,'')+'::'),K=K.replace(/%r/,
|
|
413
|
+
A.replace(/404:\s+/,'')),'undefined'==typeof Q.notFound[A]?Q.notFound[A]={count:1,message:K}:z&&'undefined'!=typeof Q.notFound[A]&&++Q.notFound[A].count,!1;if((n=gina.config.reverseRouting[v]||null)&&'undefined'!=typeof n&&n.split(/@(.+)$/)[1]==I)return A=n,'undefined'==typeof Q.notFound[A]?(K=K.replace(/%r/,w.toUpperCase()+'::'+n),Q.notFound[A]={count:1,message:K}):z&&'undefined'!=typeof Q.notFound[A]&&++Q.notFound[A].count,!1;A=Q.compareUrls(x,v,za)||null;A.past&&z&&(A=w.toUpperCase()+'::'+A.request.routing.rule,
|
|
414
|
+
'undefined'==typeof Q.notFound[A]?K=K.replace(/%r/,A):++Q.notFound[A].count);return!1}console.warn(Error('[ RoutingHelper::getRouteByUrl(rule[, bundle, method, request]) ] : route not found for url: `'+v+'` !').stack);return!1};return Q}'undefined'!==typeof module&&module.exports?module.exports=Routing():'function'===typeof define&&define.amd&&define('lib/routing',['require','lib/form-validator','lib/merge'],function(){return Routing()});
|
|
415
|
+
function StoragePlugin(B){function Q(K){I=JSON.parse(S.getItem(this.bucket));'undefined'==typeof I[K]&&(I[K]=[],S.setItem(this.bucket,JSON.stringify(I)),I=JSON.parse(S.getItem(this.bucket)));v[K]={_collection:K,_bucket:this.bucket};v[K]=la(v[K],va);return v[K]}function V(K){if('object'!==typeof K)throw Error('filter must be an object');var A=I[this._collection],E=K.count(),n=0,y=null;if(0==E)return null;for(var z in A)for(var F in K){var x='boolean'!=typeof K[F]?K[F].toLocaleLowerCase():K[F];K[F]&&
|
|
416
|
+
-1<w.indexOf(x)&&'not null'==x&&'undefined'!=typeof A[z][F]&&'object'!==typeof A[z][F]&&A[z][F]===K[F]&&'null'!=A[z][F]&&'undefined'!=A[z][F]?0>y.indexOf(A[z][F])&&(++n,n===E&&(y=A[z],y._index=z,y._collection=this._collection,y._bucket=this._bucket)):'undefined'!=typeof A[z][F]&&'object'!==typeof A[z][F]&&A[z][F]===K[F]&&(++n,n===E&&(y=A[z],y._index=z,y._collection=this._collection,y._bucket=this._bucket,y._filter=K))}y&&(y.save=P);return y}var la=la||require('lib/merge');Q=Q||require('lib/collection');
|
|
417
|
+
var U=U||require('vendor/uuid'),N=N||require('helpers/dateFormat'),ha={bucket:'default'},R={},S=null,v={},I={},w=['not null'],za={bucket:void 0,drop:function(){S.removeItem(ha.bucket);R=null;for(var K in this)delete this[K];return R},Collection:Q},va={insert:function(K){K._id=U.v1();K._createdAt=(new Date).format('isoDateTime');K._updatedAt=(new Date).format('isoDateTime');I[this._collection][I[this._collection].length]=K;S.setItem(this._bucket,JSON.stringify(I))},find:function(K,A){if(!K)return I[this._collection];
|
|
418
|
+
if('object'!==typeof K)throw Error('filter must be an object');A=I[this._collection];K.count();var E=0,n=[],y;for(y in A)for(var z in K){var F='boolean'!=typeof K[z]?K[z].toLocaleLowerCase():K[z];K[z]&&-1<w.indexOf(F)&&'not null'==F&&'undefined'!=typeof A[y][z]&&'object'!==typeof A[y][z]&&'null'!=A[y][z]&&'undefined'!=A[y][z]?0>n.indexOf(A[y][z])&&(n[E]=A[y][z],++E):'undefined'!=typeof A[y][z]&&'object'!==typeof A[y][z]&&A[y][z]===K[z]&&(n[E]=A[y],++E)}return n},findOne:V,update:null,'delete':function(K){if('object'!==
|
|
419
|
+
typeof K)throw Error('filter must be an object');var A=JSON.clone(I[this._collection]),E=0,n=[],y;for(y in A)for(var z in K)K[z]&&-1<w.indexOf(K[z].toLocaleLowerCase())&&'not null'==K[z].toLowerCase()&&'undefined'!=typeof A[y][z]&&'object'!==typeof A[y][z]&&'null'!=A[y][z]&&'undefined'!=A[y][z]?0>n.indexOf(A[y][z])&&(n[E]=A[y][z],delete I[this._collection][y][z],++E):'undefined'!=typeof A[y][z]&&'object'!==typeof A[y][z]&&A[y][z]===K[z]&&(n[E]=A[y],I[this._collection].splice(y,1),++E);return 0<n.length?
|
|
420
|
+
(S.setItem(this._bucket,JSON.stringify(I)),!0):!1},drop:function(K){if('undefined'==typeof I[this._collection])throw Error('Collection `'+K+'` not found');delete v[this._collection];delete I[this._collection];S.setItem(this._bucket,JSON.stringify(I))}},P=function(K){K=K||!1;try{var A=JSON.clone(I),E=this._index,n=this._collection,y=this._bucket,z=this._filter;this._updatedAt=(new Date).format('isoDateTime');A[n][E]=la(A[n][E],this,!0);delete A[n][E]._index;delete A[n][E]._collection;delete A[n][E]._bucket;
|
|
421
|
+
delete A[n][E].save;delete A[n][E]._filter;if(K&&'object'==typeof A[n][E]){var F=function(u,G){for(var M=0,T=u.length;M<T;++M)'object'!=typeof G[M]||'undefined'==typeof u[M]||Array.isArray(u[M])?Array.isArray(u[M])?F(u[M],G[M]):'undefined'==typeof u[M]&&delete G[M]:x(u[M],G[M]);return G},x=function(u,G){for(var M in G)'object'!=typeof G[M]||'undefined'==typeof u[M]||Array.isArray(u[M])?Array.isArray(u[M])?F(u[M],G[M]):'undefined'==typeof u[M]&&delete G[M]:x(u[M],G[M]);return G};Array.isArray(A[n][E])?
|
|
422
|
+
A[n][E]=F(this,A[n][E]):'object'==typeof A[n][E]?A[n][E]=x(this,A[n][E]):'undefined'==typeof this[prop]&&delete A[n][E]}I[n][E]=A[n][E];S.setItem(y,JSON.stringify(I));return V(z)}catch(u){throw u;}};(function(K){if(!window.localStorage||window.localStorage&&'undefined'==!typeof window.localStorage.setItem)throw 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`');if('object'!=
|
|
422
423
|
typeof K&&'undefined'!=typeof K)throw Error('`options` must be an object');'undefined'==typeof K&&(K={});ha=la(K,ha);S=window.localStorage;K=ha.bucket;if(!S.getItem(K)&&void 0!=K)S.setItem(K,JSON.stringify(I));else if(void 0==K)throw Error('`bucket` name cannot be undefined');R.bucket=K;R=la(R,za)})(B);return R}
|
|
423
424
|
if('undefined'!==typeof module&&module.exports){var merge=require('lib/merge');Collection=require('lib/collection');var uuid=require('uuid');module.exports=StoragePlugin}else'function'===typeof define&&define.amd&&define('gina/storage',['helpers/dateFormat','helpers/prototypes'],function(){return StoragePlugin});function insertAfter(B,Q){B.parentNode.insertBefore(Q,B.nextSibling)}
|
|
424
425
|
function getElementsByAttribute(B){for(var Q=[],V=0,la=document.getElementsByTagName('*'),U=0,N=la.length;U<N;++U)null!==la[U].getAttribute(B)&&(Q[V]=la[U],++V);return Q}
|
|
425
426
|
(function(B){var Q=B.prototype,V=Q.parseFromString;try{if((new B).parseFromString('','text/html'))return}catch(la){}Q.parseFromString=function(la,U){if(/^\s*text\/html\s*(?:;|$)/i.test(U)){var N=document.implementation.createHTMLDocument('');-1<la.toLowerCase().indexOf('<!doctype')?N.documentElement.innerHTML=la:N.body.innerHTML=la;return N}return V.apply(this,arguments)}})(DOMParser);define('utils/dom',function(){});
|
|
426
427
|
function fadeIn(B){var Q=.1;B.style.display='block';var V=setInterval(function(){1<=Q&&clearInterval(V);B.style.opacity=Q;B.style.filter='alpha(opacity='+100*Q+')';Q+=.1*Q},10)}function fadeOut(B){var Q=1,V=setInterval(function(){.1>=Q&&(clearInterval(V),B.style.display='none');B.style.opacity=Q;B.style.filter='alpha(opacity='+100*Q+')';Q-=.1*Q},50)}define('utils/effects',function(){});
|
|
427
|
-
function DataHelper(){encodeRFC5987ValueChars=function(V){return encodeURIComponent(V).replace(/['()]/g,escape).replace(/\*/g,'%2A').replace(/%(?:7C|60|5E)/g,unescape)};formatDataFromString=function(V){'object'==typeof V&&(V=JSON.stringify(V));try{V=decodeURIComponent(V)}catch(
|
|
428
|
-
(N=/^(\{|%7B)/.test(la)?!1:!0)?[]:{};U=/^(%7B|%5B)/.test(la)?JSON.parse(decodeURIComponent(la)):JSON.parse(la);if(Array.isArray(U)){N=0;for(var ha=U.length;N<ha;++N)V[N]=B(U[N],V);var R=V}else R=B(U,V);var S=R;break a}catch(
|
|
429
|
-
/=\{/.test(S[ha])||/=\[/.test(S[ha]))try{if(/^\{/.test(S[ha])){V=JSON.parse(S[ha]);break}else la=S[ha].match(/=(.*)/),la[0]=S[ha].split(/=/)[0],V[la[0]]=JSON.parse(la[1])}catch(
|
|
428
|
+
function DataHelper(){encodeRFC5987ValueChars=function(V){return encodeURIComponent(V).replace(/['()]/g,escape).replace(/\*/g,'%2A').replace(/%(?:7C|60|5E)/g,unescape)};formatDataFromString=function(V){'object'==typeof V&&(V=JSON.stringify(V));try{V=decodeURIComponent(V)}catch(v){}/("false"|"true"|"on")/.test(V)&&(V=V.replace(/"false"/g,!1).replace(/"true"/g,!0).replace(/"on"/g,!0));/("null")/i.test(V)&&(V=V.replace(/"null"/ig,null));a:{var la=V,U=V=null,N=null;if(/^(\{|\[|%7B|%5B)/.test(la)){try{V=
|
|
429
|
+
(N=/^(\{|%7B)/.test(la)?!1:!0)?[]:{};U=/^(%7B|%5B)/.test(la)?JSON.parse(decodeURIComponent(la)):JSON.parse(la);if(Array.isArray(U)){N=0;for(var ha=U.length;N<ha;++N)V[N]=B(U[N],V);var R=V}else R=B(U,V);var S=R;break a}catch(v){console.error('[365] could not parse body:\n'+la)}S=void 0}else{V={};S=la.split(/&/g);/("false"|"true"|"on")/.test(la)&&la.replace(/"false"/g,!1).replace(/"true"/g,!0).replace(/"on"/g,!0);la={};ha=0;for(U=S.length;ha<U;++ha)if(S[ha])if(S[ha]=decodeURIComponent(S[ha]),/^\{/.test(S[ha])||
|
|
430
|
+
/=\{/.test(S[ha])||/=\[/.test(S[ha]))try{if(/^\{/.test(S[ha])){V=JSON.parse(S[ha]);break}else la=S[ha].match(/=(.*)/),la[0]=S[ha].split(/=/)[0],V[la[0]]=JSON.parse(la[1])}catch(v){console.error('[parseBody#1] could not parse body:\n'+S[ha])}else{la=S[ha].split(/=/);if(/\{\}":/.test(la[1]))try{la[1]=JSON.parse(la[1])}catch(v){console.error('[parseBody#2] could not parse body:\n'+la[1])}'string'!=typeof la[1]||/\[object /.test(la[1])||(la[0]=decodeURIComponent(la[0]),la[1]=decodeURIComponent(la[1]),
|
|
430
431
|
/^(.*)\[(.*)\]/.test(la[0])?(R=la[0].replace(/\]/g,'').split(/\[/g),V=Q(V,R,0,la[1])):V[la[0]]=la[1])}S=V}}return S};var B=function(V,la){var U=[];la||={};for(let ha in V)if(U[0]=ha,U[1]=V[ha],/^(.*)\[(.*)\]/.test(U[0])){var N=U[0].replace(/\]/g,'').split(/\[/g);la=Q(la,N,0,U[1])}else la[U[0]]=U[1];return la},Q=function(V,la,U,N){for(let ha=0,R=la.length;ha<R;ha++){let S=la[U];if(ha==U){if('undefined'==typeof V[la[U]]||'string'==typeof V[la[U]])Array.isArray(V)?(S=~~la[U],V[S]=/^\d+$/.test(la[U+1])?
|
|
431
432
|
[]:{}):V[la[U]]=/^\d+$/.test(la[U+1])?[]:{};if(U==la.length-1){N='undefined'!=typeof N?N:'';Array.isArray(V[la[U]])?V[la[U]].push(N):V[la[U]]=N;break}else/^\d+$/.test(la[U])&&!Array.isArray(V)&&(V=[]),'undefined'==typeof V[S]&&(V[S]=null),Q(V[S],la,U+1,N)}}return V}}'undefined'!==typeof module&&module.exports?module.exports=DataHelper:'function'===typeof define&&define.amd&&define('utils/data',[],function(){return DataHelper()});
|
|
432
433
|
function ValidatorPlugin(B,Q,V){this.plugin='validator';var la='init ready registered success error progress submit reset change changed keydown keyup focusout focusin validate validated destroy asyncCompleted'.split(' '),U='undefined'!==typeof module&&module.exports?!1:!0,N=null;if(U)require('utils/events'),registerEvents(this.plugin,la),require('utils/dom'),require('utils/effects'),require('utils/data'),N=gina.config.envIsDev;else{if(N=/^true$/i.test(process.env.NODE_ENV_IS_DEV)?!0:!1)delete require.cache[require.resolve('./form-validator')],
|
|
433
|
-
delete require.cache[require.resolve('../../../../../helpers/data')];require('../../../../../helpers/data')}var ha=U?require('vendor/uuid'):require('uuid'),R=U?require('lib/merge'):require('../../../../../lib/merge'),S=U?require('lib/inherits'):require('../../../../../lib/inherits'),
|
|
434
|
+
delete require.cache[require.resolve('../../../../../helpers/data')];require('../../../../../helpers/data')}var ha=U?require('vendor/uuid'):require('uuid'),R=U?require('lib/merge'):require('../../../../../lib/merge'),S=U?require('lib/inherits'):require('../../../../../lib/inherits'),v=U?require('lib/form-validator'):require('./form-validator'),I=U?require('lib/routing'):require('../../../../../lib/routing'),w={id:'validator-'+ha.v4(),plugin:this.plugin,on:U?on:null,eventData:{},target:U?document:
|
|
434
435
|
null,errors:{},initialized:!1,isReady:!1,rules:{},$forms:{},getFormById:null,validateFormById:null,setOptions:null,resetErrorsDisplay:null,resetFields:null},za={id:null,plugin:this.plugin,on:U?on:null,eventData:{},target:U?document:null,cachedErrors:{},lastFocused:U?[]:null,binded:!1,unbinded:!1,withUserBindings:!1,rules:{},setOptions:null,send:null,isValidating:null,isSubmitting:null,submit:null,destroy:null,resetErrorsDisplay:null,resetFields:null},va={},P={},K=null,A={url:'',method:'GET',isSynchrone:!1,
|
|
435
|
-
withCredentials:!1,headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','X-Requested-With':'XMLHttpRequest'}},E=function(l,h,e){e='undefined'!=typeof e?{id:e}:null;var b={},q;for(q in h)b[q]=h[q];if('undefined'!=typeof l&&0<l.count()){try{Ja(l,''),Da(l)}catch(m){throw m;}return ca(e,b,null,
|
|
436
|
-
l=l.replace(/#/,'');if(null!=document.getElementById(l)&&'undefined'==typeof
|
|
437
|
-
typeof q[b])throw Error('['+e.id+'] no rule found with key: `null`');b=q[b]}'string'==typeof e.id&&'undefined'!=typeof q[e.id.replace(/\-/g,'.')]?$target=
|
|
438
|
-
typeof this.$forms&&'undefined'==typeof this.$forms[l]?this.$forms[l]=
|
|
439
|
-
!1,h=null;gina.hasPopinHandler&&gina.popinIsBinded&&(h=gina.popin.getActivePopin());h&&h.isOpen&&(l=!0);return l},F=function(l,h){var e=typeof(0<va.count())?va:
|
|
440
|
-
typeof l)l=l.replace(/#/,'');else{if('object'!=typeof l||Array.isArray(l))throw Error('[ FormValidator::validateFormById(formId[, customRule]) ] `formId` should be a `string`');var b=l.form;l=b.getAttribute('id')||'form.'+ha.v4();b.setAttribute('id',l)}var q=document.getElementsByTagName('form');for(var m={},p=0,O=q.length;p<O;++p)b=q[p].getAttribute('id')||null,'undefined'==typeof m[b]?m[b]=!0:'undefined'==typeof
|
|
441
|
-
b+'` is a duplicate form ID. If not fixed, this could lead to an undesirable behaviour.\n Check inside your popin content'):console.warn('Validator::bindForm($target, customRule): `'+b+'` is a duplicate form ID. If not fixed, this could lead to an undesirable behaviour.'),
|
|
436
|
+
withCredentials:!1,headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','X-Requested-With':'XMLHttpRequest'}},E=function(l,h,e){e='undefined'!=typeof e?{id:e}:null;var b={},q;for(q in h)b[q]=h[q];if('undefined'!=typeof l&&0<l.count()){try{Ja(l,''),Da(l)}catch(m){throw m;}return ca(e,b,null,w.rules)}return new v(b)},n=function(l){A=l=R(l,A)},y=function(l){var h=null;if(!w.$forms)throw Error('`$forms` collection not found');if('undefined'==typeof l)throw Error('[ FormValidator::getFormById(formId) ] `formId` is missing');
|
|
437
|
+
l=l.replace(/#/,'');if(null!=document.getElementById(l)&&'undefined'==typeof w.$forms[l]){var e=document.getElementById(l),b,q=typeof(0<va.count())?va:w.rules;e.getAttribute?(id=e.getAttribute('id')||'form.'+ha.v4(),id!==e.getAttribute('id')&&e.setAttribute('id',id)):(id='form.'+ha.v4(),e.setAttribute('id',id));e.id=za.id=id;if('undefined'!=typeof e.id&&'null'!=e.id&&''!=e.id){za.target=e;w.$forms[e.id]=R({},za);if(b=e.getAttribute('data-gina-form-rule')){b=b.replace(/\-|\//g,'.');if('undefined'==
|
|
438
|
+
typeof q[b])throw Error('['+e.id+'] no rule found with key: `null`');b=q[b]}'string'==typeof e.id&&'undefined'!=typeof q[e.id.replace(/\-/g,'.')]?$target=w.$forms[e.id].target:'object'==typeof e.id?(delete w.$forms[e.id],q=e.attributes.getNamedItem('id').nodeValue||'form.'+ha.v4(),e.setAttribute('id',q),e.id=q,za.target=e,w.$forms[q]=R({},za),$target=w.$forms[q].target):$target=w.$forms[e.id].target;b?yb($target,b):yb($target)}}'undefined'!=typeof w.$forms[l]&&(w.$forms[l].withUserBindings=!0,h='undefined'!=
|
|
439
|
+
typeof this.$forms&&'undefined'==typeof this.$forms[l]?this.$forms[l]=w.$forms[l]:w.$forms[l]);if(!h)throw Error('Validator::getFormById(...) exception: could not retrieve form `'+l+'`');h.binded||(yb(h.target),h=w.$forms[l]);N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),e={id:l,rules:w.$forms[l].rules},'undefined'!=typeof w.$forms[l].errors&&(e.errors=w.$forms[l].errors),window.ginaToolbar.update('forms',e));return h},z=function(){var l=
|
|
440
|
+
!1,h=null;gina.hasPopinHandler&&gina.popinIsBinded&&(h=gina.popin.getActivePopin());h&&h.isOpen&&(l=!0);return l},F=function(l,h){var e=typeof(0<va.count())?va:w.rules;if(!w.$forms)throw Error('`$forms` collection not found');if('undefined'!=typeof l&&'undefined'!=typeof w.$forms[l])return w.$forms[l];if('undefined'==typeof l)if('undefined'!=typeof this.id&&''!=this.id&&null!=this.id)l=this.id;else throw Error('[ FormValidator::validateFormById(formId, customRule) ] `formId` is missing');if('string'==
|
|
441
|
+
typeof l)l=l.replace(/#/,'');else{if('object'!=typeof l||Array.isArray(l))throw Error('[ FormValidator::validateFormById(formId[, customRule]) ] `formId` should be a `string`');var b=l.form;l=b.getAttribute('id')||'form.'+ha.v4();b.setAttribute('id',l)}var q=document.getElementsByTagName('form');for(var m={},p=0,O=q.length;p<O;++p)b=q[p].getAttribute('id')||null,'undefined'==typeof m[b]?m[b]=!0:'undefined'==typeof w.$forms[b]||w.$forms[b].warned||(gina.popinIsBinded?console.warn('Popin/Validator::bindForm($target, customRule): `'+
|
|
442
|
+
b+'` is a duplicate form ID. If not fixed, this could lead to an undesirable behaviour.\n Check inside your popin content'):console.warn('Validator::bindForm($target, customRule): `'+b+'` is a duplicate form ID. If not fixed, this could lead to an undesirable behaviour.'),w.$forms[b].warned=!0);if('undefined'!=typeof this.$forms&&'undefined'!=typeof w.$forms[l])q=this.$forms[l]=w.$forms[l];else{b=document.getElementById(l);za.id=l;za.target=b;q=this.$forms[l]=w.$forms[l]=R({},za);if('undefined'==
|
|
442
443
|
typeof h)if(m=l.replace(/\-/g,'.'),'undefined'!=typeof e)q.rule=Ia(m);else{if('undefined'!=typeof q.target&&null!==q.target&&q.target.getAttribute('data-gina-form-rule'))if(m=q.target.getAttribute('data-gina-form-rule').replace(/\-|\//g,'.'),'undefined'!=typeof e)q.rule=Ia(m);else throw Error('[ FormValidator::validateFormById(formId) ] using `data-gina-form-rule` on form `'+q.target+'`: no matching rule found');}else if(m=h.replace(/\-|\//g,'.'),'undefined'!=typeof e)q.rule=Ia(m);else throw Error('[ FormValidator::validateFormById(formId, customRule) ] `'+
|
|
443
|
-
h+'` is not a valid rule');b&&'undefined'!=typeof this.isPopinContext&&/true/i.test(this.isPopinContext)&&(b.isPopinContext=this.isPopinContext);b&&!q.binded&&yb(b,m)}if(!q)throw Error('[ FormValidator::validateFormById(formId, customRule) ] `'+l+'` not found');return q||null},
|
|
444
|
-
(e.className=e.className.replace(/form\-item\-error/,'form-item-warning'),l=!0);if(!/^true$/i.test(
|
|
445
|
-
else if(/^(true)$/i.test(l.dataset.ginaFormLiveCheckEnabled)&&'undefined'!=typeof b){var p='string'!=typeof l.id?l.getAttribute('id'):l.id;'undefined'==typeof
|
|
446
|
-
b)m=!1}else'undefined'!=typeof
|
|
447
|
-
h=
|
|
444
|
+
h+'` is not a valid rule');b&&'undefined'!=typeof this.isPopinContext&&/true/i.test(this.isPopinContext)&&(b.isPopinContext=this.isPopinContext);b&&!q.binded&&yb(b,m)}if(!q)throw Error('[ FormValidator::validateFormById(formId, customRule) ] `'+l+'` not found');return q||null},x=function(l){var h=l.form.getAttribute('id'),e=l.parentNode;l=!1;var b=e.getElementsByTagName('div');/form\-item\-warning/.test(e.className)?e.className=e.className.replace(/form\-item\-warning/,'form-item-error'):/form\-item\-error/.test(e.className)&&
|
|
445
|
+
(e.className=e.className.replace(/form\-item\-error/,'form-item-warning'),l=!0);if(!/^true$/i.test(w.$forms[h].isValidating)||l)for(h=0,e=b.length;h<e;++h)if(/form\-item\-error\-message/.test(b[h].className)){b[h].className=l?b[h].className+' hidden':b[h].className.replace(/(\s+hidden|hidden)/,'');break}},u={},G=function(l,h,e,b){if(N)var q=null;var m=!1;if('undefined'!=typeof l.dataset.ginaFormIsResetting&&/^(true)$/i.test(l.dataset.ginaFormIsResetting))h={},u={},l.dataset.ginaFormIsResetting=!1;
|
|
446
|
+
else if(/^(true)$/i.test(l.dataset.ginaFormLiveCheckEnabled)&&'undefined'!=typeof b){var p='string'!=typeof l.id?l.getAttribute('id'):l.id;'undefined'==typeof u[p]&&(u[p]={});if(h&&0<h.count()){if(u[p][b]={},u[p][b]=R(h[b],u[p][b]),0==u[p][b].count()&&delete u[p][b],h=u[p],!w.$forms[p].sent||w.$forms[p].isValidating)if(m=!0,p=w.$forms[p].lastFocused,0<p.length&&'undefined'!=typeof p[1]&&p[1].name==b||0<p.length&&!p[1]&&document.activeElement.getAttribute('name')!=p[0].name||document.activeElement.getAttribute('name')!=
|
|
447
|
+
b)m=!1}else'undefined'!=typeof u[p][b]&&(delete u[p][b],'undefined'!=typeof window.gina.validator.$forms[p].errors&&'undefined'!=typeof window.gina.validator.$forms[p].errors[b]&&delete window.gina.validator.$forms[p].errors[b]),('undefined'!=typeof w.$forms&&'undefined'!=typeof w.$forms[p]&&'undefined'!=typeof w.$forms[p].errors&&0==w.$forms[p].errors.count()||'undefined'!=typeof w.$forms&&'undefined'!=typeof w.$forms[p]&&!w.$forms[p].errors)&&Ka(l,!0),'undefined'!=typeof u[p]&&0==u[p].count()?delete u[p]:
|
|
448
|
+
h=u[p]}var O=null;p=l.getAttribute('id');e='undefined'!=typeof e?e:{};for(var D=0,aa=l.length;D<aa;++D){var xa=l[D];if('undefined'==typeof b||b==xa.name){if(/form\-item\-wrapper$/.test(xa.parentNode.className)){var ba=xa.parentNode.parentNode;var pa=xa.parentNode}else ba=xa.parentNode,pa=xa;var Ba=xa.getAttribute('name');var H=xa.getAttribute('data-gina-form-errors');if(Ba){if(h&&'undefined'!=typeof h[Ba]&&!/(form\-item\-error|form\-item\-warning)/.test(ba.className)){ba.className=m?ba.className+
|
|
448
449
|
(''==ba.className?'form-item-warning':' form-item-warning'):ba.className+(''==ba.className?'form-item-error':' form-item-error');O=document.createElement('div');O.className=m?'form-item-error-message hidden':'form-item-error-message';for(var ka in h[Ba])'stack'!=ka&&(ba=document.createElement('p'),ba.appendChild(document.createTextNode(h[Ba][ka])),O.appendChild(ba)),N&&(q||={},q[Ba]||(q[Ba]={}),q[Ba][ka]=h[Ba][ka]);'hidden'!=pa.type&&insertAfter(pa,O)}else if(h&&'undefined'==typeof h[Ba]&&/(form\-item\-error|form\-item\-warning)/.test(ba.className)||
|
|
449
450
|
h&&'undefined'!=typeof h[Ba]&&0==h[Ba].count()&&/(form\-item\-error|form\-item\-warning)/.test(ba.className)){if(document.activeElement.getAttribute('name')!=b&&0<h.count())break;console.debug('[handleErrorsDisplay] Resetting when not in error');Ba=ba.getElementsByTagName('div');pa=0;for(H=Ba.length;pa<H;++pa)if(/form\-item\-error\-message/.test(Ba[pa].className)){Ba[pa].parentElement.removeChild(Ba[pa]);break}ba.className=ba.className.replace(/(\s+form\-item\-error|form\-item\-error|\s+form\-item\-warning|form\-item\-warning)/,
|
|
450
451
|
'')}else if(0<h.count()&&'undefined'!=typeof h[Ba]&&H){H=ba.getElementsByTagName('div');for(var wa=0,Y=H.length;wa<Y;++wa){let oa=H[wa].className.match('form-item-error-message');if(oa&&'undefined'!=typeof oa.length&&0<oa.length){H[wa].parentElement.removeChild(H[wa]);O=document.createElement('div');O.setAttribute('class','form-item-error-message');!m&&/(\s+form\-item\-warning|form\-item\-warning)/.test(ba.className)&&(ba.className=ba.className.replace(/(\s+form\-item\-warning|form\-item\-warning)/,
|
|
451
452
|
' form-item-error'));for(ka in h[Ba])ba=document.createElement('p'),ba.appendChild(document.createTextNode(h[Ba][ka])),O.appendChild(ba),N&&(q||={},q[Ba]||(q[Ba]={}),q[Ba][ka]=h[Ba][ka]);break}}O&&'hidden'!=pa.type&&insertAfter(pa,O)}if('undefined'!=typeof b&&b===xa.name)break}}}q?(triggerEvent(gina,l,'error.'+p,h),N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),l={id:p,errors:q},window.ginaToolbar.update('forms',l))):N&&U&&'undefined'!=
|
|
452
|
-
typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),l={id:p,errors:{}},U&&window.ginaToolbar.update('forms',l));if(gina&&U&&N&&
|
|
453
|
-
l instanceof HTMLFormElement?h=l:/^object$/i.test(typeof l)&&(h=l.target);if(!h)throw Error('[ FormValidator::resetErrorsDisplay([ formId | <form> ]) ] `'+l+'` not found');h.dataset.ginaFormIsResetting=!0;G(h,{});return h},T=function(l){if('undefined'==typeof l){var h='undefined'!=typeof this.target?this.target.getAttribute('id'):this.getAttribute('id');l=
|
|
454
|
-
l+'` not found');l=
|
|
455
|
-
'select'==b&&(q=l.fieldsSet[e].selectedIndex||0,h.selectedIndex=q,h.dataset.value=h.options[h.selectedIndex].value,triggerEvent(gina,h,'change'))}}return l},ra=function(){var l=null,h=null;'undefined'!=typeof this.getAttribute?(l=this.getAttribute('id'),h=this):'undefined'!=typeof this.target&&null!=this.target&&'undefined'!=typeof this.target.getAttribute&&(l=this.target.getAttribute('id'),h=this.target);if('undefined'==typeof
|
|
456
|
-
triggerEvent(gina,h,'submit');return this},Ea=function(l,h){var e=this.target,b=e.getAttribute('id'),q=
|
|
453
|
+
typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),l={id:p,errors:{}},U&&window.ginaToolbar.update('forms',l));if(gina&&U&&N&&w.$forms[p].isSubmitting&&/^true$/i.test(w.$forms[p].isSubmitting)&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&e)try{window.ginaToolbar.update('data-xhr',e)}catch(oa){throw oa;}},M=function(l){var h=null;'undefined'==typeof l&&'undefined'!=typeof this.id&&(l=this.id);/^string$/i.test(typeof l)?(h=l.replace(/#/,''),h=document.getElementById(h)):
|
|
454
|
+
l instanceof HTMLFormElement?h=l:/^object$/i.test(typeof l)&&(h=l.target);if(!h)throw Error('[ FormValidator::resetErrorsDisplay([ formId | <form> ]) ] `'+l+'` not found');h.dataset.ginaFormIsResetting=!0;G(h,{});return h},T=function(l){if('undefined'==typeof l){var h='undefined'!=typeof this.target?this.target.getAttribute('id'):this.getAttribute('id');l=w.$forms[h]}else if('string'==typeof l){h=l.replace(/#/,'');if('undefined'==typeof w.$forms[h])throw Error('[ FormValidator::resetErrorsDisplay([formId]) ] `'+
|
|
455
|
+
l+'` not found');l=w.$forms[h]}if(l.fieldsSet){var e;for(e in l.fieldsSet){h=document.getElementById(e);var b=h.tagName.toLowerCase();var q=h.tagName;/textarea/i.test(q)?(q=l.fieldsSet[e].defaultValue,h.value=q,triggerEvent(gina,h,'change')):'input'==b?(q=l.fieldsSet[e].defaultValue,/$(on|true|false)$/i.test(q)&&(q=/$(on|true)$/i.test(q)?!0:!1),/^(checkbox|radio)$/i.test(h.type)?h.checked=l.fieldsSet[e].defaultChecked:/^(checkbox|radio)$/i.test(h.type)||(h.value=q),triggerEvent(gina,h,'change')):
|
|
456
|
+
'select'==b&&(q=l.fieldsSet[e].selectedIndex||0,h.selectedIndex=q,h.dataset.value=h.options[h.selectedIndex].value,triggerEvent(gina,h,'change'))}}return l},ra=function(){var l=null,h=null;'undefined'!=typeof this.getAttribute?(l=this.getAttribute('id'),h=this):'undefined'!=typeof this.target&&null!=this.target&&'undefined'!=typeof this.target.getAttribute&&(l=this.target.getAttribute('id'),h=this.target);if('undefined'==typeof w.$forms[l])throw Error('[ FormValidator::submit() ] not `$form` binded. Use `FormValidator::getFormById(id)` or `FormValidator::validateFormById(id)` first ');
|
|
457
|
+
triggerEvent(gina,h,'submit');return this},Ea=function(l,h){var e=this.target,b=e.getAttribute('id'),q=w.$forms[b]||this,m=null,p=null,O=null,D=null;if(!('undefined'!=typeof q.isSending&&/^true$/i.test(q.isSending)||'undefined'!=typeof q.sent&&/^true$/i.test(q.sent))){w.$forms[b].isSending=!0;h='undefined'!=typeof h?R(h,A):A;'undefined'!=typeof q.id&&(h.headers['X-Gina-Form-Id']=q.id,'undefined'!=typeof gina.forms.rules&&0<q.rules.count()&&'undefined'!=typeof q.rules[q.id]&&(h.headers['X-Gina-Form-Rule']=
|
|
457
458
|
q.id+'@'+gina.config.bundle));'undefined'!=typeof q.target.dataset.ginaFormRule&&(h.headers['X-Gina-Form-Rule']=q.target.dataset.ginaFormRule+'@'+gina.config.bundle);z()&&($activePopin=gina.popin.getActivePopin(),$activePopin.isOpen&&('undefined'!=typeof $activePopin.id&&(h.headers['X-Gina-Popin-Id']=$activePopin.id),'undefined'!=typeof $activePopin.name&&(h.headers['X-Gina-Popin-Name']=$activePopin.name)));(D=e.getAttribute('data-gina-form-event-on-submit-success')||e.getAttribute('data-gina-form-event-on-submit-error')?
|
|
458
459
|
!0:!1)&&Aa(q);var aa=e.getAttribute('action')||h.url,xa=e.getAttribute('method')||h.method;xa=xa.toUpperCase();h.method=xa;h.url=aa;K||=setupXhr(h);aa=e.getAttribute('enctype')||h.headers['Content-Type'];if(h.withCredentials){if('withCredentials'in K)h.isSynchrone?K.open(h.method,h.url,h.isSynchrone):K.open(h.method,h.url);else if('undefined'!=typeof XDomainRequest)K=new XDomainRequest,K.open(h.method,h.url);else{K=null;m='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';
|
|
459
460
|
triggerEvent(gina,e,'error.'+b,m);return}K.responseType='undefined'!=typeof h.responseType?h.responseType:'';K.withCredentials=!0}else h.isSynchrone?K.open(h.method,h.url,h.isSynchrone):K.open(h.method,h.url);for(var ba in h.headers)'Content-Type'==ba&&'undefined'!=typeof aa&&null!=aa&&''!=aa||K.setRequestHeader(ba,h.headers[ba]);if(K){K.onreadystatechange=function(Y){q.isSubmitting=!1;q.isSending=!1;setTimeout(function(){q.sent=!1},1E3);Y=/Google Inc/i.test(navigator.vendor)?50:0;2==K.readyState&&
|
|
460
461
|
(O=/^attachment;/.test(K.getResponseHeader('Content-Disposition'))?!0:!1,!K.responseType&&O&&(K.responseType='blob'));if(4==K.readyState){var oa=null,La=null,Ta=K.getResponseHeader('Content-Type');if(/^2/.test(K.status)){try{if(/blob/.test(K.responseType)||O){if('undefined'==typeof Ta||null==Ta)Ta='application/octet-stream';La=new Blob([this.response],{type:Ta});var $a=document.createElement('a');$a.style='display: none';document.body.appendChild($a);var Ab=window.URL.createObjectURL(La);$a.href=
|
|
461
|
-
Ab;var Bb=K.getResponseHeader('Content-Disposition');$a.download=Bb.match('=(.*)')[0].substr(1);$a.click();window.URL.revokeObjectURL(Ab);m={status:K.status,statusText:K.statusText,responseType:La.type,type:La.type,size:La.size}}else m=K.responseText;/\/json/.test(Ta)&&(m=JSON.parse(K.responseText),'undefined'==typeof m.status&&(m.status=K.status));if(/\/html/.test(Ta)&&(m={contentType:Ta,content:K.responseText},'undefined'==typeof m.status&&(m.status=K.status),
|
|
462
|
-
(oa=gina.popin.getActivePopin()))){p={};try{p=(new DOMParser).parseFromString(m.content,'text/html').getElementById('gina-without-layout-xhr-data'),p=JSON.parse(decodeURIComponent(p.value)),XHRView=(new DOMParser).parseFromString(m.content,'text/html').getElementById('gina-without-layout-xhr-view'),XHRView=JSON.parse(decodeURIComponent(XHRView.value)),gina&&N&&typeof window.ginaToolbar&&'undefined'!=typeof p&&window.ginaToolbar.update('data-xhr',
|
|
463
|
-
typeof XHRView&&window.ginaToolbar.update('view-xhr',XHRView)}catch(X){throw X;}oa.loadContent(m.content);m=p;triggerEvent(gina,e,'success.'+b,m);return}p=q.eventData.success=m;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&p)try{N&&'undefined'!=typeof p&&!/\/html|\/json/.test(Ta)&&window.ginaToolbar.update('data-xhr',p)}catch(X){throw X;}/^gina\-upload/i.test(b)&&W(gina,e,'success',b,m);var hb=!1;'undefined'!=typeof m.isXhrRedirect
|
|
464
|
-
if('undefined'!=typeof gina.popin&&gina.hasPopinHandler&&'undefined'!=typeof m.popin||'undefined'!=typeof gina.popin&&gina.hasPopinHandler&&'undefined'!=typeof m.location&&hb){oa=gina.popin.getActivePopin();if(!oa&&'undefined'!=typeof m.popin){if('undefined'!=typeof m.popin&&'undefined'==typeof m.popin.name)throw Error('To get a `$popin` instance, you need at list a `popin.name`.');oa=gina.popin.getPopinByName(m.popin.name);if(!oa)throw Error('Popin with name: `'+
|
|
465
|
-
typeof m.popin&&'undefined'!=typeof m.popin.close){oa.isRedirecting=!1;oa.close();var Hb=m.popin.reload?m.popin.reload:!1;m.popin.location||m.popin.url||(delete m.popin,Hb&&(m.popin={reload:Hb}))}if('undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.location||'undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.url||'undefined'!=typeof m.location&&hb){hb=null;oa&&(hb=oa.name,oa.isRedirecting=!0);'undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.target&&
|
|
466
|
-
var Wa=m.location||m.popin.location||m.popin.url;if('undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.name&&hb!=m.popin.name){oa&&oa.isOpen&&oa.close();hb=m.popin.name;oa=gina.popin.getPopinByName(hb);if(!oa)throw Error('Popin with name `'+hb+'` not found !');console.debug('Validator::Popin now redirecting [1-c]');oa.load(oa.name,Wa,oa.options)}else oa&&(console.debug('Validator::Popin now redirecting [1-d]'),oa&&oa.isOpen&&oa.close(),oa.load(oa.name,Wa,
|
|
467
|
-
X.open()},50,oa)}}triggerEvent(gina,e,'success.'+b,m);D&&triggerEvent(gina,e,'success.'+b+'.hform',m)}catch(X){m={status:422,error:X.message,stack:X.stack};p=q.eventData.error=m;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&p)try{N&&'undefined'!=typeof p&&window.ginaToolbar.update('data-xhr',p)}catch(ja){throw ja;}/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,
|
|
468
|
-
typeof m.location)return window.location.hash='',m.location=/^http/.test(m.location)||/^\//.test(m.location)?m.location:location.protocol+'//'+m.location,m.location.replace(/^http(.*):\d+/,'$1').replace(/^:\/\//,'').split(/\//g)[0]==gina.config.hostname&&gina.config.hostname==window.location.host&&(m.location=location.protocol+m.location.replace(/^http(.*):\d+/,'$1').replace(/^:/,'')),setTimeout(()=>{window.location.href=m.location},
|
|
469
|
-
new Blob([this.response],{type:'text/plain'});var cb=new FileReader,fa='';cb.addEventListener('loadend',X=>{/string/i.test(typeof X.srcElement.result)?fa+=X.srcElement.result:'object'==typeof X.srcElement.result?m=R(m,X.srcElement.result):m.message+=X.srcElement.result;if(/2/.test(cb.readyState)){if(/^(\{|\[)/.test(fa))try{m=R(m,JSON.parse(fa))}catch(ja){m=R(m,ja)}m.message||delete m.message;p=q.eventData.error=m;if(gina&&
|
|
470
|
-
p)}catch(ja){throw ja;}/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,e,'error.'+b+'.hform',m)}});cb.readAsText(La)}else{if(/^(\{|\[)/.test(K.responseText))try{m=R(JSON.parse(K.responseText),m)}catch(X){m=R(X,m)}else'object'==typeof K.responseText?m=R(K.responseText,m):m.message=K.responseText;if('undefined'!=typeof m&&'undefined'!=typeof m.error&&
|
|
471
|
-
{},oa[hb]={},oa[hb].isApiError=m.fields[hb],Wa&&!oa[hb].isApiError&&(oa[hb].isApiError=m.error),Y[hb]=oa[hb],G(q.target,oa,l,hb);m.fields=Y}p=q.eventData.error=m;if(gina&&N&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&p)try{window.ginaToolbar.update('data-xhr',p)}catch(X){throw X;}/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,
|
|
472
|
-
oa=parseInt(100*oa));Y={status:100,progress:oa};q.eventData.onprogress=Y;triggerEvent(gina,e,'progress.'+b,Y)};K.ontimeout=function(Y){m={status:408,error:'Request Timeout'};q.eventData.ontimeout=m;/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,e,'error.'+b+'.hform',m)};l||(l=event.detail.data);if(l){h=!1;if('object'==typeof l){ba=[];xa=0;
|
|
473
|
-
'untagged',H,ka;for([H,ka]of l.entries())ka instanceof File?(h||=!0,ba[xa]={key:H,group:Ba,file:ka,bin:''},++xa):pa[H]=ka}else l=JSON.stringify(l);if(h&&0<ba.length){var wa='--ginaWKBoundary'+ha.v4().replace(/\-/g,'');return ea(ba,wa,'',0,function(Y,oa,La){if(Y)/^gina\-upload/i.test(b)&&W(gina,e,'error',b,Y),triggerEvent(gina,e,'error.'+b,Y),D&&triggerEvent(gina,e,'error.'+b+'.hform',Y);
|
|
474
|
-
U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),window.ginaToolbar.update('forms',{id:b,sent:oa}))),!1})}'undefined'!=typeof pa&&0<pa.count()&&(l=JSON.stringify(pa))}catch(Y){/^gina\-upload/i.test(b)&&W(gina,e,'error',b,Y),triggerEvent(gina,e,'error.'+b,Y),D&&triggerEvent(gina,e,'error.'+b+'.hform',Y)}}h||('undefined'!=typeof aa&&null!=
|
|
475
|
-
aa),K.send();q.sent=!0;N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),Ba={id:b,sent:'string'==typeof l?JSON.parse(l):l},window.ginaToolbar.update('forms',Ba))}}},W=function(l,h,e,b,q){l=h.uploadProperties||null;if(!l)throw Error('No uploadProperties found !!');h=document.getElementById(l.uploadTriggerId);
|
|
476
|
-
(p=document.getElementById(l.errorField));p&&(p.style.display='none');if(p&&'success'!=e){var O=q.message||q.error;p.innerHTML='<p>'+O+'</p>';fadeIn(p)}else if(p||'success'==e)for(e=0,q=m.length;e<q;++e){var D=b.id.replace(/\-preview/,'-'+e+'-reset-trigger');O=!1;p=document.getElementById(D);var aa=['reset','js-upload-reset'];p?(/a/i.test(p.tagName)&&(p.href='#'),
|
|
477
|
-
(p.className=''),D=R(p.className.split(/\s+/g),aa),p.className=D.join(' ')):(O=!0,p=document.createElement('A'),p.href='#',p.innerHTML=h.getAttribute('data-gina-form-upload-reset-label')||'Reset',p.className=aa.join(' '),p.id=D);p.style.display='none';if('undefined'==typeof m[e].preview&&l.hasPreviewContainer&&/^image/.test(m[e].mime)&&''!=m[e].location){D=document.createElement('IMG');
|
|
478
|
-
p.id);aa=b.getAttribute('data-preview-max-width')||null;if(D.width&&aa&&D.width>aa){var xa=D.width/aa;D.width=aa;D.height/=xa}else!D.width&&aa&&(D.width=aa);/ul/i.test(l.previewContainer.tagName)?(aa=document.createElement('LI'),aa.className='item',aa.appendChild(D),b.appendChild(aa)):b.appendChild(D);fadeIn(D)}D=l.uploadFields[e];for(var ba in D)if('name'==
|
|
479
|
-
(aa=document.getElementById(D[ba].id))&&aa.parentNode.removeChild(aa);else if(D[ba].value=m[e][ba],'preview'==ba)for(var pa in m[e][ba])if('undefined'!=typeof m[e][ba][pa]&&'undefined'!=typeof D[ba][pa]&&(D[ba][pa].value=m[e][ba][pa]),'tmpUri'==pa&&l.hasPreviewContainer){xa=document.createElement('IMG');xa.src=m[e][ba].tmpUri;xa.style.display=
|
|
480
|
-
xa.setAttribute('data-upload-reset-link-id',p.id);if(aa=b.getAttribute('data-preview-max-width')||null)xa.width=aa;/ul/i.test(l.previewContainer.tagName)?(aa=document.createElement('LI'),aa.className='item',aa.appendChild(xa),b.appendChild(aa)):b.appendChild(xa);fadeIn(xa)}l.hasPreviewContainer&&(/ul/i.test(l.previewContainer.tagName)?(aa=
|
|
481
|
-
function(l,h){console.debug(h+' input files');var e=/reset/i.test(h)?!0:!1,b=null,q=null,m=document.getElementById(l.id+'-preview').childNodes,p=null,O=l.customFiles,D=[];for(let aa=0,xa=m.length;aa<xa;aa++)if(/img/i.test(m[aa].tagName)){e?(b=m[aa].getAttribute('data-upload-original-filename'),D.push(b),(q=m[aa].getAttribute('data-upload-preview-original-filename'))&&
|
|
482
|
-
h+'-link-id')):document.getElementById(O[ba].deleteLinkId);p.style.display='none';m[aa].style.display='none';O.splice(ba,1);l.customFiles=O;e&&(l.value=O.join(', C:\\fakepath\\'));b=new RegExp('^'+(l.name+'['+ba+']').replace(/\-|\[|\]|\./g,'\\$&'));for(let H=0,ka=l.form.length;H<ka;H++)if(q=l.form[H].dataset.ginaFormUploadIsLocked
|
|
483
|
-
{files:O})}catch(wa){throw wa;}q=l.getAttribute('data-gina-form-upload-'+h+'-action');if(!q||'undefined'==typeof q||''==q||/404/.test(q))throw Error('input file `'+l.id+'` error: `data-gina-form-upload-'+h+'-action` is required. You need to provide a valide url.');(b=l.getAttribute('data-gina-form-upload-'+h+'-method'))&&
|
|
484
|
-
let Ba=l.getAttribute('data-gina-form-upload-'+h+'-is-synchrone');if(/null/i.test(Ba)||'undefined'==typeof b||''==b)Ba=!0;q=setupXhr({url:q,method:b,isSynchrone:Ba,headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','X-Requested-With':'XMLHttpRequest'}});/GET|DELETE/i.test(b)?q.send():
|
|
485
|
-
'block'}removeListener(gina,$uploadResetTrigger,'click',function(){p.remove();m[aa].remove()});xa--;aa--;break}}},ea=function(l,h,e,b,q){var m=new FileReader;m.addEventListener('load',function(p){p.preventDefault();try{var O=this.result,D=void 0;p='';var aa=null;'undefined'==typeof D&&(D=8);var xa=D/8;switch(D){case 8:aa=
|
|
486
|
-
ba;O+=pa)D=Math.min(pa,ba-O),xa=aa.subarray(O,O+D),p+=String.fromCharCode.apply(null,xa);l[this.index].bin+=p;l[this.index].file.type||(l[this.index].file.type='application/octet-stream')}catch(Ba){return q(Ba,null,!0)}e+='--'+h+'\r\n';e+='Content-Disposition: form-data; name="'+l[this.index].key+'"; group="'+l[this.index].group+
|
|
487
|
-
|
|
488
|
-
if('undefined'==typeof e)if('undefined'!=typeof this.id&&''!=this.id&&null!=this.id)e=this.id;else throw Error('[ FormValidator::destroy(formId) ] `formId` is missing');if('string'==typeof e)e=e.replace(/#/,'');else{if('object'!=typeof e||Array.isArray(e))throw Error('[ FormValidator::destroy(formId) ] `formId` should be a `string`');
|
|
489
|
-
h.target,'destroy.'+e,function(b){cancelEvent(b);delete
|
|
490
|
-
sa(l[b]);if(p&&Array.isArray(l[b][p].conditions)&&0<l[b][p].conditions.length)for(h=0,e=l[b][p].conditions.length;h<e;)'undefined'!=typeof l[b][p].conditions[h].rules&&0==l[b][p].conditions[h].rules.count()&&(l[b][p].conditions.splice(h,1),e--,h--),h++}},Da=function(l){var h=JSON.stringify(l),e=h.match(/("@import\s+[-_a-z A-Z 0-9/.]+")/g)||
|
|
491
|
-
{};for(let O=0,D=e.length;O<D;++O){var q=e[O].replace(/(@import\s+|"|')/g,'');var m=q.replace(/(@import\s+|"|')/g,'').split(/\s/g);for(let aa=0,xa=m.length;aa<xa;++aa){var p=m[aa].replace(/\//g,'.').replace(/\-/g,'.');'undefined'!=typeof
|
|
492
|
-
'g'),'{}'))):console.warn('[formValidator:rules] <@import error> on `'+e[O]+'`: rule `'+m[aa]+'` not found. Ignoring.')}m=new RegExp(e[O]);if(q=b&&m.test(b.join())?!0:!1)for(let aa=0,xa=b.length;aa<xa;aa++)if(m.test(b[aa])){q=JSON.stringify(l);q=q.substr(1,q.length-1);aa<xa-1&&(q+=',');try{h=h.replace(new RegExp(b[aa],'g'),
|
|
493
|
-
Qa=function(l){gina.hasValidator?(
|
|
494
|
-
|
|
495
|
-
m);za.id=m;za.target=e[b];
|
|
496
|
-
(m=
|
|
497
|
-
|
|
498
|
-
l+'.'),q=null,m=function(O,D,aa,xa,ba,pa,Ba){if(D.length){var H=Object.getOwnPropertyNames(O)[0],ka=D[0];ka=''==ba?ba+=ka:ba+'['+ka+']';1==D.length&&(O[H]=R(O[H],aa,!0));D.splice(0,1);ka==H?m(O[H],D,aa,xa,ka,pa,Ba):'undefined'!=typeof O[H]?m(O[H],D,aa,xa,ka,pa,Ba):m(O,D,aa,xa,ba,pa,Ba)}},p;for(p in
|
|
499
|
-
e=/^true$/i.test(l.disabled)?!0:!1;e&&'undefined'!=typeof h.rule&&'undefined'!=typeof h.rule[l.name]&&'undefined'!=typeof h.rule[l.name].exclude&&/^false$/i.test(h.rule[l.name].exclude)&&(e=!1);if(/^(radio|text|hidden|password|number|date|email)$/i.test(l.type)&&!e){var b=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value'),q=b.set;b.set=function(m){Object.defineProperty(this,
|
|
500
|
-
m,console.debug('Value set: '+m),'undefined'!=typeof gina.events[p]&&(console.debug('trigger event on: ',this.name,p),triggerEvent(gina,this,p,m)));Object.defineProperty(this,'value',b)};Object.defineProperty(l,'value',b)}},Fa=function(l,h,e,b){'undefined'==typeof b&&(b=!1);var q=l.rules,m=
|
|
501
|
-
(p=!1);if(/^(radio|checkbox|text|hidden|password|number|date|email)$/i.test(h.type)&&!p||b&&!p){b=h.name;m=q[b]||null;if(!m&&(xb(q,h),'undefined'==typeof q[b]))return;if(l.target.dataset.ginaFormLiveCheckEnabled&&m&&(b=[],m=null,p=0,/^(radio|checkbox)$/i.test(h.type)?m=/^(radio|checkbox)$/i.test(h.type)?'changed.'+h.id:'change.'+h.id:(addEventListener(gina,h,'focusout.'+h.id,function(D){D.preventDefault();
|
|
502
|
-
h.id,'undefined'==typeof gina.events[m]&&(b[p]=m,++p),m='focusin.'+h.id,'undefined'==typeof gina.events[m]&&(b[p]=m,++p),m='focusout.'+h.id),'undefined'==typeof gina.events[m]&&(b[p]=m,++p),0<b.length)){var O=!1;addListener(gina,h,b,function(D){D.preventDefault();clearTimeout(e);if(!O&&/^changed\./i.test(D.type)||!O&&/^(radio|checkbox)$/i.test(D.target.type))O=!0;else if(O&&/^changed\./i.test(D.type)||O
|
|
503
|
-
|
|
504
|
-
D.target;
|
|
505
|
-
'] onSilentGlobalLiveValidation: '+Y.isValid(),Y,H);var oa=Y.isValid();N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:wa,errors:Y.error||{}}));!oa&&Y.error?
|
|
506
|
-
ba){if(!(0<ba))return++ba,setTimeout(()=>{console.debug(' changed .... '+h.id);aa()},0)}(O,0);/^focusin\./i.test(D.type)?/\-error/.test(h.parentNode.className)&&(console.debug('#1 you just focusin ....'+h.id,h.value,
|
|
507
|
-
null,h.name)):/^keyup\./i.test(D.type)?(h.ginaFormValidatorTestedValue=h.value,e=setTimeout(function(){if(!(-1<['91','17','16'].indexOf(''+D.keyCode)&&0==P.count()))if(-1<['9'].indexOf(''+D.keyCode)){var xa=document.getElementById(
|
|
508
|
-
|
|
509
|
-
function(l,h){if(document.activeElement&&document.activeElement.form){l=Array.prototype.filter.call(document.activeElement.form.querySelectorAll('a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), select:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(q){return 0<q.offsetWidth||0<q.offsetHeight||
|
|
510
|
-
'readonly');addListener(gina,l,'focusout.'+l.id,function(e){e.preventDefault();clearTimeout(h);e=e.currentTarget;triggerEvent(gina,e,'change.'+e.id);e.setAttribute('readonly','readonly')});addListener(gina,l,'focusin.'+l.id,function(e){e.preventDefault();e.currentTarget.removeAttribute('readonly');var b='keydown.'+e.currentTarget.id;
|
|
511
|
-
m.selectionStart,D=m.selectionEnd;m.removeAttribute('readonly');switch(q.keyCode){case 46:case 8:O!=D?(m.value=p.substr(0,O)+p.substr(D),0==O&&(m.value=p.substr(D))):m.value=0==O?p.substring(O+1):p.substr(0,O-1)+p.substr(D);q.currentTarget.setAttribute('readonly','readonly');setTimeout(()=>{m.removeAttribute('readonly');setTimeout(()=>
|
|
512
|
-
break;case 39:O+1<p.length+1&&Pa(m,O+1);break;case 17:case 91:console.debug('CMD hit');q.preventDefault();break;case 67:if(P[67]&&P[91]||P[67]&&P[17]){m.setSelectionRange(O,D);document.execCommand('copy');break}case 86:if(P[86]&&P[91]||P[86]&&P[17]){O!=D&&(m.value=m.value.replace(p.substring(O,D),''));Pa(m,O);document.execCommand('paste');
|
|
513
|
-
break}default:O!=D?(m.value=p.substr(0,O)+q.key,D-1<p.length&&(m.value+=p.substring(D))):m.value=0==O?q.key+p.substring(O):p.substr(0,O)+q.key+p.substr(D),q.currentTarget.setAttribute('readonly','readonly'),setTimeout(()=>{m.removeAttribute('readonly');setTimeout(()=>{Pa(m,O+1)},0)},0)}})})},bb=function(l,h){if(/^(input|textarea)$/i.test(h.tagName)&&
|
|
514
|
-
default:Fa(l,h,null),l=h.getAttribute('autocomplete'),/safari/i.test(navigator.userAgent)&&l&&/^(off|false)/i.test(l)&&qb(h,null)}gina.events['registered.'+h.id]=h.id}},rb=function(l,h,e){var b=h.id+'-'+e+'-'+l+'-trigger',q=document.getElementById(b);q||(b=h.getAttribute('data-gina-form-upload--'+e+ +l+'-trigger'),q=document.getElementById(b));q&&
|
|
515
|
-
ia(h,l)}),q.isBinded=!0):console.warn('[FormValidator::bindForm][upload]['+h.id+'] : did not find `upload '+l+' trigger`.\nPlease, make sure that your delete element ID is `'+b+'-'+l+'-trigger`, or add to your file input ('+h.id+') -> `data-gina-form-upload-'+l+'-trigger="your-custom-id"` definition.')},Vb=function(l,h){var e=function(b,q,m){var p=
|
|
516
|
-
b.getAttribute(q);if(!O||''==O){p||console.warn('`'+q+'` definition not found for `'+b.id+'`. Trying to get default route.');var D=null;try{p&&(O=I.getRoute(p))}catch(aa){D=aa}O?(console.info('Ignore previous warnings regarding upload. I have found a default `'+q+'` route: `'+p+'@'+O.bundle+'`'),b.setAttribute('data-gina-form-upload-action',
|
|
517
|
-
console.error(b))}};e(l,'data-gina-form-upload-action',h);e(l,'data-gina-form-upload-reset-action',h);e(l,'data-gina-form-upload-delete-action',h)},wb=function(l,h,e){l=nb(l);yb(l.target,h);return e?e(l):l},nb=function(l){var h=null,e=null;try{if(l.getAttribute&&l.getAttribute('id'))if(e=l.getAttribute('id'),'undefined'!=typeof
|
|
518
|
-
err.stack);}catch(p){throw Error('Validator::unbindForm($target) could not unbind form `'+l+'`\n'+p.stack);}if('undefined'!=typeof h&&!h.binded)return h;removeListener(gina,h,'success.'+e);removeListener(gina,h,'error.'+e);h.target.getAttribute('data-gina-form-event-on-submit-success')&&removeListener(gina,
|
|
519
|
-
e);removeListener(gina,h,'
|
|
520
|
-
if(q){l.push(q);for(let D=0,aa=la.length;D<aa;D++){var m=la[D];'undefined'!=typeof gina.events[m+'.'+b+'.hform']&&gina.events[m+'.'+b+'.hform']==b&&removeListener(gina,q,m+'.'+b+'.hform')}}}}else for(let D=0,aa=la.length;D<aa;D++)b=la[D]+'.'+e[p].id,'undefined'!=typeof gina.events[b]&&gina.events[b]==e[p].id&&
|
|
521
|
-
removeListener(gina,e[p],b);e=h.target.getElementsByTagName('textarea');if(0<e.length)for(let p=0,O=e.length;p<O;++p)l.push(e[p]);e=h.target.getElementsByTagName('form');if(0<e.length)for(let p=0,O=e.length;p<O;++p)l.push(e[p]);l.push(h.target);for(let p=0,O=l.length;p<O;++p){e=l[p];b=e.getAttribute('id');
|
|
522
|
-
e,m),m=q+'.'+b,'undefined'!=typeof gina.events[m]&&gina.events[m]==b&&removeListener(gina,e,m),m=q+'.'+b,'undefined'!=typeof gina.events[m]&&gina.events[m]==m&&removeListener(gina,e,m),m=q+'.'+b+'.hform','undefined'!=typeof gina.events[m]&&gina.events[m]==b&&removeListener(gina,e,m)}evt=null;h.binded
|
|
523
|
-
flags),re.test(h))){l[h]=l[e];break}},yb=function(l,h){var e=null,b=null,q=typeof(0<va.count())?va:
|
|
524
|
-
typeof e&&e.binded)return!1;console.debug('binding for: '+b);var m=!1,p=null,O='',D=null;'undefined'!=typeof h||'string'==typeof b&&'undefined'!=typeof q[b.replace(/\-|\//g,'.')]?(m=!0,p=h&&'object'==typeof h?h:h&&'string'==typeof h&&'undefined'!=typeof q[h.replace(/\-|\//g,'.')]?Ia(h.replace(/\-|\//g,'.')):Ia(b.replace(/\-|\//g,'.')),e.rules=p,N&&U&&'undefined'!=typeof window.ginaToolbar&&
|
|
525
|
-
objCallback))):e.rules={};'undefined'==typeof e.target.dataset.ginaFormLiveCheckEnabled&&0<e.rules.count()?e.target.dataset.ginaFormLiveCheckEnabled=!0:e.target.dataset.ginaFormLiveCheckEnabled='undefined'!=typeof e.target.dataset.ginaFormLiveCheckEnabled?/^true$/i.test(e.target.dataset.ginaFormLiveCheckEnabled)?!0:!1:!1;e.fieldsSet||(e.fieldsSet={});D=null;l.getElementsByTagName('a');
|
|
526
|
-
{},ba=[],pa={},Ba=null,H={},ka=null,wa=null;for(let fa=0,X=aa.length;fa<X;++fa)xb(e.rules,aa[fa]),wa=aa[fa].getAttribute('id'),wa&&''!=wa||(wa='textareas.'+ha.v4(),aa[fa].setAttribute('id',wa)),e.fieldsSet[wa]||(e.fieldsSet[wa]={id:wa,name:aa[fa].name||null,value:aa[fa].value||'',defaultValue:aa[fa].value||''}),/^true$/i.test(e.target.dataset.ginaFormLiveCheckEnabled)&&bb(e,aa[fa]);
|
|
527
|
-
wa));e.fieldsSet[wa]||(Ba=h[fa].value,/$(on|true|false)$/i.test(Ba)&&(Ba=/$(on|true)$/i.test(Ba)?!0:!1),e.fieldsSet[wa]={id:wa,name:h[fa].name||null,value:Ba||!/^(checkbox|radio)$/i.test(h[fa].type)?'':h[fa].checked,defaultValue:/^(checkbox|radio)$/i.test(h[fa].type)?h[fa].checked:Ba},/^(checkbox|radio)$/i.test(h[fa].type)&&'undefined'==typeof e.fieldsSet[wa].defaultChecked&&
|
|
528
|
-
|
|
529
|
-
(e.rules[h[fa].name]={}),'undefined'!=typeof e.rules[h[fa].name].isRequired&&e.rules[h[fa].name].isRequired||(e.rules[h[fa].name].exclude=!0));if(0<pa.count())for(var Y in pa)h[fa].name!=Y&&(h[fa].getAttribute('data-gina-form-element-group'),pa[Y].test(h[fa].name)&&(h[fa].disabled=!0,'undefined'==typeof H[Y]&&(H[Y]={}),H[Y][h[fa].name]=h[fa]));if(/^file$/i.test(h[fa].type)){wa=
|
|
530
|
-
'text/html');wa&&(Ba=document.getElementById(wa));aa=document.getElementById(h[fa].id+'-error');Vb(h[fa],aa);if((aa=ka.getElementById(wa+'-preview'))&&Ba&&!/none/i.test(window.getComputedStyle(aa).display)&&!/none/i.test(aa.parentElement.style.display)){ka=0;console.debug('preview is visible ...');Ba.customFiles=[];Ba.form=l;aa=aa.childNodes;for(let ja=0,ta=aa.length;ja<ta;ja++){var oa=
|
|
531
|
-
sb;Oa++)/img/i.test(fb[Oa])&&(oa=fb[Oa],oa.setAttribute(''),ka++)}else/img/i.test(aa[ja].tagName)&&(oa=aa[ja],deleteLinkId=wa+'-'+ka+'-delete-trigger',oa=oa.src.substr(oa.src.lastIndexOf('/')+1),Ba.customFiles.push({name:oa,deleteLinkId}),rb('delete',Ba,ka),ka++)}}addListener(gina,h[fa],'change',function(ja){ja.preventDefault();var ta=ja.currentTarget;ja=ta.files;ta.customFiles=
|
|
532
|
-
fb='gina-upload-'+Va.replace(/\[/g,'-').replace(/\]/g,'-'+e.id);ta.setAttribute('data-gina-form-virtual',fb);var Oa=ta.getAttribute('data-gina-form-upload-on-success'),sb=ta.getAttribute('data-gina-form-upload-on-error'),jb=null;if(0<ja.length){var db=null;if(z()){db=gina.popin.getActivePopin();db.$target=(new DOMParser).parseFromString(db.target.outerHTML,'text/html');db.$target.getElementById(db.id).innerHTML=
|
|
533
|
-
document.getElementById(fb);if(!gb){try{gb=y(fb)||null}catch(Rc){}gb||=z()?db.$target.createElement('form'):document.createElement('form');gb.id=fb;gb.action=Na;gb.enctype='multipart/form-data';gb.method='POST';if('undefined'!=typeof ta.form){Na='files';var pb=ta.getAttribute('data-gina-form-upload-prefix')||ta.name||ta.getAttribute('name'),kb=ta.id||ta.getAttribute('id'),Mb=!1,Eb=ta.getAttribute('data-gina-form-upload-preview')||
|
|
534
|
-
'undefined'!=typeof Eb&&(Mb=!0);pb&&(Na=pb);pb=[];for(var Ib='name group originalFilename ext encoding size height width location mime preview'.split(' '),Kb=ta.form.getElementsByTagName('INPUT'),Zb,Xb,Dc,fc,Nb=0,Pc=ja.length;Nb<Pc;++Nb){rb('reset',ta,Nb);pb[Nb]=null;Zb=Na+'['+Nb+']';fc=new RegExp('^'+Zb.replace(/\[/g,'\\[').replace(/\]/g,'\\]'));for(var mc=0,Lc=Kb.length;mc<Lc;++mc)Zb=Kb[mc].getAttribute('type'),jb=Kb[mc].getAttribute('data-gina-form-upload-error')||
|
|
535
|
-
(Xb=Kb[mc],Zb=/\[\w+\]$/i.test(Xb.name)?Xb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,''):Xb.name,Dc=/\[\w+\]$/i.test(Xb.name)?Xb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,''):Xb.name,Xb&&'undefiend'!=typeof Zb&&-1<Ib.indexOf(Zb)&&fc.test(Xb.name)?(pb[Nb]||(pb[Nb]={}),/\[preview\]/i.test(Xb.name)?('undefined'==typeof pb[Nb].preview&&(pb[Nb].preview={}),pb[Nb].preview[Zb]=Xb):pb[Nb][Zb]=Xb):Xb&&'undefiend'!=typeof Zb&&0>Ib.indexOf(Zb)&&fc.test(Xb.name)&&(pb[Nb]||
|
|
536
|
-
('undefined'==typeof pb[Nb].preview&&(pb[Nb].preview={}),pb[Nb].preview[Dc]=Xb):pb[Nb][Dc]=Xb));fc=0;for(mc=Ib.length;fc<mc;++fc)pb[Nb]||(pb[Nb]={}),'undefined'==typeof pb[Nb][Ib[fc]]&&(Zb=Na+'['+Nb+']['+Ib[fc]+']',$newVirtualField=document.createElement('input'),$newVirtualField.type='hidden',$newVirtualField.id='input.'+ha.v4(),$newVirtualField.name=Zb,$newVirtualField.value='',ta.form.appendChild($newVirtualField),pb[Nb][Ib[fc]]=ta.form[ta.form.length-1])}gb.uploadProperties=
|
|
537
|
-
uploadTriggerId:ta.id,$form:ta.form,errorField:jb,mandatoryFields:Ib,uploadFields:pb,hasPreviewContainer:Mb,isPopinContext:z()};Mb&&(gb.uploadProperties.previewContainer=Eb)}Oa?gb.setAttribute('data-gina-form-event-on-submit-success',Oa):gb.setAttribute('data-gina-form-event-on-submit-success','onGenericXhrResponse');sb?gb.setAttribute('data-gina-form-event-on-submit-error',sb):gb.setAttribute('data-gina-form-event-on-submit-error','onGenericXhrResponse');z()?
|
|
538
|
-
document.body.appendChild(gb)}try{var Qc=y(fb),rc=new FormData;ta=null;fb=0;for(var sc=ja.length;fb<sc;++fb)ta=ja[fb],rc.append(Va,ta,ta.name);Qc.send(rc,{withCredentials:!0})}catch(Rc){throw Rc;}}})}}var La=function(fa,X){fa.setAttribute('data-value',fa.value);if(/^(true)$/i.test(X.target.dataset.ginaFormLiveCheckEnabled&&0<X.rules.count())){var ja={},ta={},Na=null;Na=fa.form;ja[event.target.name]=event.target.value;ta[event.target.name]=event.target;
|
|
539
|
-
|
|
540
|
-
db.error;for(let pb in db.error)G(fb,db.error,db.data,pb)}Ka(fb,gb);once=!1})})}};Ba=H=null;Y=0;for(pa=D.length;Y<pa;++Y)if(xb(e.rules,D[Y]),wa=D[Y].getAttribute('id'),!wa||!/^gina\-toolbar/.test(wa)){wa&&''!=wa||(wa='select.'+ha.v4(),D[Y].setAttribute('id',wa));if(Ba=D[Y].getAttribute('data-gina-form-element-group'))H=D[Y].getAttribute('name')||wa,H===wa&&D[Y].setAttribute('name',wa),xa[wa]={id:wa,name:H,group:Ba,target:D[Y]};addListener(gina,D[Y],
|
|
541
|
-
La(fa,e)});if(D[Y].options&&!e.fieldsSet[wa]){H=0;if(Ba=D[Y].getAttribute('data-value')||null)for(ka=0,aa=D[Y].options.length;ka<aa;++ka)if(D[Y].options[ka].value==Ba){H=ka;D[Y].selectedIndex=H;break}'undefined'!=typeof D[Y].options[D[Y].selectedIndex]&&D[Y].options[D[Y].selectedIndex].index&&(H=D[Y].options[D[Y].selectedIndex].index);0<D[Y].options.length&&'undefined'!=typeof D[Y].options[H]&&(Ba=D[Y].options[H].value);e.fieldsSet[wa]={id:wa,
|
|
542
|
-
'undefined'!=typeof D[Y].selectedIndex&&-1<D[Y].selectedIndex&&(D[Y].options[H].selected=!0,D[Y].setAttribute('data-value',D[Y].options[H].value))}}var Ta=function(fa,X,ja,ta){'undefined'==typeof ta&&(ta=!1);if('undefined'==typeof xa[fa])throw Error('Radio & Checkbox dependencies not met: you must use the ID attribue of the `master element` as the `data-gina-form-element-group`');var Na=fa.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');fa=xa[fa].target.checked;
|
|
543
|
-
new RegExp(Na);var fb=new RegExp(X);if(Va.test(xa[Oa].group)&&fb.test(xa[Oa].group)||Va.test(xa[Oa].group))xa[Oa].target.disabled=!0,'undefined'==typeof e.rules[xa[Oa].name]&&(e.rules[xa[Oa].name]={}),e.rules[xa[Oa].name].exclude=!0,ta?(xa[Oa].target.disabled=fa?!1:!0,e.rules[xa[Oa].name].exclude=fa?!1:!0):(xa[Oa].target.disabled=ja,e.rules[xa[Oa].name].exclude=ja)}},$a=function(fa,X,ja,ta){'undefined'==typeof ta&&(ta=!1);if(ta&&
|
|
544
|
-
Ta(X.id,xa[X.id].group,fa,ta);ja=X.name;m&&'undefined'==typeof fa.rules[ja]&&(fa.rules[ja]={});/^true$/i.test(X.checked)?m&&(fa.rules[ja].exclude=!1,'undefined'!=typeof xa[X.id]&&Ta(X.id,xa[X.id].group,!1,ta)):m&&(fa.rules[ja].exclude=!0,'undefined'!=typeof xa[X.id]&&Ta(X.id,xa[X.id].group,!0,ta))},Ab=function(fa,X){'undefined'==typeof X&&(X=!1);var ja=function(Oa,sb,jb){if(sb)$a(e,Oa,sb);else for(let db in xa)if(fb.test(xa[db].group)||
|
|
545
|
-
jb};X&&/^(on)$/i.test(fa.value)&&!fa.checked&&(fa.value=!1);var ta=fa.getAttribute('data-value')||fa.getAttribute('value')||fa.value;ta=/^(true|on)$/.test(ta)?!0:ta;''===ta&&(ta=!1);var Na=/^(true|on|false)$/i.test(ta)?!0:!1;X&&Na&&(/^true$/i.test(ta)&&!fa.checked?fa.checked=!0:/^false$/i.test(ta)&&fa.checked&&(fa.checked=!1));ta=fa.checked;var Va=fa.getAttribute('data-gina-form-element-group')||null,fb=new RegExp(fa.id.replace(/\-|_|@|#|\.|\[|\]/g,
|
|
546
|
-
Bb(fa):(setTimeout(function(){fa.checked=!0;ja(fa,Va,!1);Bb(fa)},0),fa.setAttribute('checked','checked')),Na&&(fa.value=!0,fa.setAttribute('value',!0),typeof('undefined'!=fa.getAttribute('data-value'))&&fa.setAttribute('data-value',!0))):(X?Bb(fa):setTimeout(function(){fa.checked=!1;ja(fa,Va,!0);Bb(fa)},0),fa.removeAttribute('checked'),Na&&(fa.value=!1,fa.setAttribute('value','false'),typeof('undefined'!=fa.getAttribute('data-value'))&&fa.setAttribute('data-value',
|
|
547
|
-
'\\$&'));for(let X in xa)(/checkbox/i.test(xa[X].target.type)&&fa.test(xa[X].group)||/checkbox/i.test(xa[X].target.type)&&fa.test(xa[X].target.getAttribute('data-gina-form-element-group')))&&$a(e,xa[X].target,xa[X].group,!0)},hb=function(fa,X){X=fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');X=new RegExp(X);for(let ja in xa)if(/checkbox|radio/i.test(xa[ja].target.type)||(xa[ja].target.disabled=!0,'undefined'==typeof e.rules[xa[ja].name]&&
|
|
548
|
-
X.test(xa[ja].target.getAttribute('data-gina-form-element-group').replace(/\-|_|@|#|\.|\[|\]/g,'\\$&')))xa[ja].target.disabled=!0,'undefined'==typeof e.rules[xa[ja].name]&&(e.rules[xa[ja].name]={}),/^(true|on)$/i.test(fa.checked)?(xa[ja].target.disabled=!1,e.rules[xa[ja].name].exclude=!1):(xa[ja].target.disabled=!0,e.rules[xa[ja].name].exclude=!0);Bb(fa)},Hb=null,Wa=function(fa,X,ja){X='undefined'!=typeof X&&X?!0:!1;
|
|
549
|
-
Hb=document.getElementsByName(fa.name);for(let Va=0,fb=Hb.length;Va<fb;++Va)Hb[Va].id!==fa.id&&ta&&(Hb[Va].checked=!1,Hb[Va].removeAttribute('checked'),hb(Hb[Va],!0));X?hb(fa):(ta&&'null'!=ta&&'false'!=ta&&''!=ta?setTimeout(function(){ja?hb(fa):(fa.checked=!1,fa.removeAttribute('checked'))},0):setTimeout(function(){ja?hb(fa):(fa.checked=!0,fa.setAttribute('checked','checked'))},0),Na&&(fa.value=/^true$/.test(fa.value)
|
|
550
|
-
typeof h[Y].id||''==h[Y].id)h[Y].id=D+'-'+ha.v4(),h[Y].setAttribute('id',h[Y].id);if('undefined'!=typeof D&&/^checkbox$/i.test(D)){if(h[Y].disabled&&-1<ba.indexOf(h[Y].id)||!h[Y].checked&&-1<ba.indexOf(h[Y].id)){D=new RegExp(h[Y].id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(var cb in xa)D.test(xa[cb].group)&&(xa[cb].target.disabled=!0)}O='change.'+h[Y].id;D=function(fa,X){addListener(gina,fa,X,function(ja){Ab(ja.target);
|
|
551
|
-
typeof gina.events[O]&&gina.events[O]==h[Y].id&&removeListener(gina,h[Y],O);D(h[Y],O)}else'undefined'!=typeof D&&/^radio$/i.test(D)&&(O=h[Y].id,D=function(fa,X){addListener(gina,fa,X,function(ja){Wa(ja.target);triggerEvent(gina,ja.target,'changed.'+ja.target.id)});Wa(fa,!0)},'undefined'!=typeof gina.events[O]&&gina.events[O]==h[Y].id&&removeListener(gina,h[Y],O),D(h[Y],O))}O='click';D=function(){var fa=null;fa='reset.'+
|
|
552
|
-
var ja=
|
|
553
|
-
if(!ta)return!1;/^reset\./.test(ta)||(ta='reset.'+ja.id);gina.events[ta]&&triggerEvent(gina,ja,ta,X.detail)});addListener(gina,l,'keydown',function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;P[X.keyCode]='keydown'==X.type;var ta=ja.id;if(!ta)return!1;/^keydown\./.test(ta)||(ta='keydown.'+ja.id);gina.events[ta]&&(cancelEvent(X),triggerEvent(gina,ja,ta,X.detail,X))});
|
|
554
|
-
X.defaultPrevented)return!1;P[X.keyCode]&&delete P[X.keyCode];var ta=ja.id;if(!ta)return!1;/^keyup\./.test(ta)||(ta='keyup.'+ja.id);gina.events[ta]&&(cancelEvent(X),triggerEvent(gina,ja,ta,X.detail,X))});addListener(gina,l,'focusin',function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;var ta=ja.id;if(!ta)return!1;/^focusin\./.test(ta)||(ta='focusin.'+ja.id);
|
|
555
|
-
Va={id:ja.id,name:ja.name};
|
|
556
|
-
function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;var ta=ja.id;if(!ta)return!1;/^change\./.test(ta)||(ta='change.'+ja.id);gina.events[ta]&&(cancelEvent(X),triggerEvent(gina,ja,ta,X.detail))});addListener(gina,l,'click',function(X){var ja=X.target,ta=!1,Na=!1;if(/(label)/i.test(X.target.tagName)&&'undefined'!=typeof X.target.control&&null!=X.target.control
|
|
557
|
-
'undefined'!=typeof X.target.parentNode.control&&null!=X.target.parentNode.control&&/(checkbox|radio)/i.test(X.target.parentNode.control.type))Na=X.target.getAttribute('for')||X.target.parentNode.getAttribute('for')?!0:!1,ja=X.target.control||X.target.parentNode.control;if(!ja.disabled&&/(checkbox|radio)/i.test(ja.type)&&!Na){if(/checkbox/i.test(ja.type))return Ab(ja);if(/radio/i.test(ja.type))return Wa(ja
|
|
558
|
-
ja.attributes.getNamedItem('data-gina-form-submit')||/a/i.test(ja.parentNode.tagName)&&ja.parentNode.attributes.getNamedItem('data-gina-form-submit')){Na=ja.attributes.getNamedItem('data-gina-form-submit');var Va=ja.parentNode.attributes.getNamedItem('data-gina-form-submit');if(Na||Va)ta=!0,(Va=Na?ja.getAttribute('data-gina-form-submit-method')||X.currentTarget.getAttribute('method'):ja.parentNode.getAttribute('data-gina-form-submit-method')||
|
|
559
|
-
ja.form.setAttribute?ja.form.setAttribute('method',Va):X.currentTarget.setAttribute('method',Va):ja.parentNode.form&&(ja.parentNode.form.setAttribute?ja.parentNode.form.setAttribute('method',Va):X.currentTarget.setAttribute('method',Va)));'undefined'!=typeof ja.id&&ja.getAttribute('id')||ja.setAttribute('id','click.'+ha.v4());ja.id=ja.getAttribute('id');if(/^click\./.test(ja.id)||m){Na=ja.id;if(!Na)return!1;/^click\./.test(Na)||(Na=ja.id);if(!ja.disabled
|
|
560
|
-
if(/radio/i.test(ja.type))return Wa(ja,!1,!0)}if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;if('submit'==ja.type&&!/^submit\./i.test(Na)||ta&&!/^submit\./i.test(Na))Na='submit.'+Na;'reset'!=ja.type||/^reset\./i.test(Na)||(Na='reset.'+Na);gina.events[Na]?(cancelEvent(X),triggerEvent(gina,ja,Na,X.detail)):ta&&'undefined'!=typeof this.id&&''!=this.id&&'undefined'!=typeof gina.validator.$forms[this.id]&&
|
|
561
|
-
'validate.'+b;D=function(){addListener(gina,l,O,function(fa){cancelEvent(fa);var X=e.eventData.error||e.eventData.validation||fa.detail;G(fa.target,X.fields||X.error,X.data);fa=fa.target.getAttribute('id');if('undefined'!=typeof X.isValid&&X.isValid()){var ja=
|
|
562
|
-
'validate.'+b&&removeListener(gina,e,O,D);D();cb=function(fa,X){/^submit\./i.test(fa)||(fa='submit.'+fa);addListener(gina,X,fa,function(ja){cancelEvent(ja);var ta={};ja={_length:0};var Na=l.getAttribute('id'),Va='undefined'!=typeof
|
|
563
|
-
p=(Va=l.getAttribute('data-gina-form-rule'))?Ia(Va.replace(/\-|\//g,'.')):Ia(b.replace(/\-/g,'.')),
|
|
564
|
-
h.push(ba[fa]):ba[fa].getAttribute('id')||/gina\-popin/.test(ba[fa].className)||gina.popinIsBinded||/gina\-link/.test(ba[fa].className)||(D='link.'+ha.v4(),ba[fa].id=D);D=null;Y=!1;for(let fa=0,X=h.length;fa<X;++fa){ba=h[fa];if(/button/i.test(ba.tagName)&&'undefined'!=typeof ba.type&&/submit/i.test(ba.type)||/a/i.test(ba.tagName)&&'undefined'!=typeof ba.dataset.ginaFormSubmit&&/^true$/i.test(ba.dataset.ginaFormSubmit)||/a/i.test(ba.parentNode.tagName)&&
|
|
565
|
-
|
|
566
|
-
ba.id,' form id: '+e.id),
|
|
567
|
-
'submit';addListener(gina,l,O,function(fa){var X=fa.target,ja=X.getAttribute('id'),ta=
|
|
568
|
-
fb=X[Oa].disabled||X[Oa].getAttribute('disabled'),fb=/disabled|true/i.test(fb)?!0:!1,Va&&!fb&&('undefined'!=typeof X[Oa].type&&'radio'==X[Oa].type||'undefined'!=typeof X[Oa].type&&'checkbox'==X[Oa].type?X[Oa].checked?/^(true|false)$/.test(X[Oa].value)?Na[Va]=X[Oa].value=/^true$/.test(X[Oa].value)?!0:!1:Na[Va]=X[Oa].value:ta&&'undefined'!=typeof ta[Va]&&'undefined'!=typeof ta[Va].isBoolean&&'checkbox'==X[Oa].type
|
|
569
|
-
''));Na._length=Na.count();0==Na._length?(delete Na._length,fa={error:[],isValid:function(){return!0},data:Ha(Na)},'undefined'!=typeof gina.events['submit.'+ja]?triggerEvent(gina,X,'submit.'+ja,fa):triggerEvent(gina,X,'validate.'+ja,fa)):(p=(ta=X.getAttribute('data-gina-form-rule'))?Ia(ta.replace(/\-|\//g,'.')):Ia(ja.replace(/\-/g,'.')),
|
|
570
|
-
jb):triggerEvent(gina,X,'validate.'+ja,jb)}))});
|
|
571
|
-
Ka(e,fa.isValid())})):/^(true)$/i.test(e.target.dataset.ginaFormLiveCheckEnabled)||Ka(e,!0)},Ka=function(l,h){$formInstance=null;l instanceof HTMLFormElement?(l=l.getAttribute('id'),$formInstance=
|
|
572
|
-
|
|
573
|
-
typeof
|
|
574
|
-
'undefined'==typeof l[p].form&&(l[p].form={id:m}),'undefined'==typeof l[p].dataset.ginaFormSubmitTriggerFor&&'undefined'!=typeof
|
|
575
|
-
'radio'==l[p].type||'undefined'!=typeof l[p].type&&'checkbox'==l[p].type)if(l[p].checked||'undefined'==typeof h[D]&&'undefined'!=l[p].value&&/^(true|false)$/.test(l[p].value)||!l[p].checked&&'undefined'!=typeof h[D]&&'undefined'!=typeof h[D].isBoolean&&/^(true|false)$/.test(l[p].value))if(/^(true|false)$/.test(l[p].value))if('undefined'==typeof h[D]?h[D]={isBoolean:!0}:
|
|
576
|
-
typeof h[D])throw Error('rule '+D+' is not defined');/^true$/.test(h[D].isBoolean)&&l[p].checked&&(q[D]=/^true$/.test(l[p].value)?!0:!1)}else q[D]=l[p].value=/^true$/.test(l[p].value)?!0:!1;else q[D]=l[p].value;else h&&'undefined'!=typeof h[D]&&'undefined'!=typeof h[D].isBoolean&&'undefined'!=typeof h[D].isRequired&&!/^(true|false)$/.test(l[p].value)&&(q[D]=!1);
|
|
577
|
-
fields:q,rules:h}},Gb=function(l,h,e,b){return'undefined'==typeof l[e]||/^(null|NaN|undefined|\s*)$/i.test(h[e])?h[e]:'undefined'!=typeof l[e].isNumber||'undefined'!=typeof l[e].isInteger||'undefined'!=typeof l[e].isFloat||'undefined'!=typeof l[e].toFloat||'undefined'!=typeof l[e].toInteger?(/,/.test(h[e])&&(h[e]=h[e].replace(/,/g,'.').replace(/\s+/g,'')),
|
|
578
|
-
function(l,h){'string'!=typeof l&&(l=JSON.stringify(JSON.clone(l)));l=JSON.parse(l.replace(/"(true|false)"/gi,'$1'));for(let e in h)h[e]=Gb(l,h,e);return h},pc=function(l,h,e,b){var q=JSON.parse(l.replace(/"(true|false)"/gi,'$1')),m=JSON.stringify(q);b&&(h=e[Object.getOwnPropertyNames(e)[0]].form,e=eb(h,q),delete e.fields._length,h=e.fields,e=e.$fields);b=
|
|
579
|
-
O,'g');p='\\"'+h[b[aa]]+'\\"';var D=O.test(m);D&&'undefined'!=typeof q[b[aa]]?p=Gb(q,h,b[aa],!0):D&&console.warn('`'+b[aa]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+b[aa]+'` to `string`.');l=l.replace(O,p)}if(/\$(.*)/.test(l))for(let aa=0,xa=b.length;aa<xa;aa++)O=b[aa].replace(/\-|_|@|#|\.|\[|\]/g,
|
|
580
|
-
b[aa],!0):D&&console.warn('`'+b[aa]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+b[aa]+'` to `string`.'),l=l.replace(O,p||e[b[aa]].checked);return JSON.parse(l)},ca=function(l,h,e,b,q){delete h._length;var m=JSON.stringify(b);h=Ub(m,h);/\$(.*)/.test(m)&&(b=!/^form$/i.test(l.tagName)&&1==e.count()&&/true/i.test(l.form.dataset.ginaFormLiveCheckEnabled)
|
|
581
|
-
H=0,ka=null,wa=null,Y=null,oa=function(Wa,cb,fa){if('undefined'==typeof cb[Wa]){skipTest=!1;for(var X in cb)if(!/^_comment$/i.test(X)&&/^\//.test(X)&&(ka=X.match(/\/(.*)\//).pop(),wa=X.replace('/'+ka+'/',''),ka=ka.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),ka=new RegExp(ka,wa),ka.test(Wa))){skipTest=!0;cb[Wa]=cb[X];break}if('undefined'==typeof cb[Wa])return}var ja=Object.getOwnPropertyNames(cb)||[];X=0;var ta=
|
|
582
|
-
(ja.splice(X,1),ta--,X--),X++;for(var Na in cb[Wa])if('function'==typeof La[Wa][Na]){/^((is)\d+|is$)/.test(Na)&&'undefined'==typeof La[Wa][Na]&&(La[Wa][Na]=function(){},La[Wa][Na]=S(La[Wa][Na],La[Wa][Na.replace(/\d+/,'')]),La[Wa][Na].setAlias=function(jb){this._currentValidatorAlias=jb}(Na));try{if(Array.isArray(cb[Wa][Na])){Y=JSON.clone(cb[Wa][Na]);if(/\$[\-\w\[\]]*/.test(Y[0])){var Va=Y[0].match(/\$[\-\w\[\]]*/g);
|
|
583
|
-
Y)}else if(/^query$/.test(Na)){ba=e[Wa];pa=ba.getAttribute('id');Ba='asyncCompleted.'+pa;var Oa=0,sb=!1;if('undefined'!=typeof gina.events[Ba]){console.debug('event `'+Ba+'` already added');H=0;break}++H;addListener(gina,ba,Ba,function(jb){jb.preventDefault();Oa++;--H;var db=Object.getOwnPropertyNames(cb[Wa]);db[db.length-1]==Na&&(xa=!0);db='asyncCompleted.'+jb.target.getAttribute('id');
|
|
584
|
-
kb=null;if(xa&&0>=H&&!sb){sb=!0;removeListener(gina,jb.target,db);q._data=La.toData();q._errors=La.getErrors(Wa);kb=0<q._errors.count()?!1:!0;console.debug('[A] query callback triggered ',q._errors,'isFormValid: '+kb,'\nisValidating: '+
|
|
585
|
-
Wa),
|
|
586
|
-
|
|
587
|
-
{}}));G(gb,Mb.error,Mb.data,Wa);Ka(gb,kb)})}});La[Wa][Na](cb[Wa][Na]);continue}else La[Wa][Na](cb[Wa][Na]);delete fa[Wa]}catch(jb){if('conditions'==Na)throw Error('[ ginaFormValidator ] could not evaluate `'+Wa+'->'+Na+'()` where `conditions` must be a `collection` (Array)\nStack:\n'+jb);throw Error('[ ginaFormValidator ] could not evaluate `'+Wa+'->'+Na+'()`\nStack:\n'+jb);}}},La=null,Ta={},$a=!1;
|
|
588
|
-
typeof l.eventData&&'undefined'!=typeof l.eventData.error&&delete l.eventData.error,La=new
|
|
589
|
-
JSON.clone(b):{};var Hb=function(Wa,cb,fa,X,ja,ta,Na,Va){var fb=null;if('undefined'!=typeof ta)for(var Oa in X){var sb=ja[Oa].getAttribute('type');if(U&&'undefined'==typeof ja[Oa])console.warn('field `'+Oa+'` found for your form rule ('+Wa.id+'), but not found in $field collection.\nPlease, check your HTML or remove `'+Oa+'` declaration from your rule if this is a mistake.');else{U&&ja[Oa].getAttribute('data-gina-form-element-group')&&
|
|
590
|
-
ta[Oa].exclude&&!ja[Oa].disabled&&(ta[Oa].exclude=!1);var jb='undefined'!=typeof ta['_case_'+Oa]?!0:!1;if(U&&'input'==ja[Oa].tagName.toLowerCase()&&/^(checkbox)$/i.test(sb))if(!ja[Oa].checked&&'undefined'!=typeof ta[Oa]&&'undefined'!=typeof ta[Oa].isRequired&&/^(false)$/i.test(ta[Oa].isRequired)||ja[Oa].disabled)ta[Oa]={exclude:!0};else{if(!ja[Oa].checked&&'undefined'==typeof ta[Oa])continue}else U&&'input'==ja[Oa].tagName.toLowerCase()
|
|
591
|
-
ja[Oa].value);for(var db in ta)if(/^_case_/.test(db)&&'undefined'!=typeof ta[db].conditions&&(!Array.isArray(ta[db].conditions)||ta[db].conditions.length)&&'undefined'!=typeof ta[db].conditions[0].rules&&'undefined'!=typeof ta[db].conditions&&Array.isArray(ta[db].conditions))if(fb=db.replace('_case_',''),'undefined'==typeof Bb[fb])console.warn('Found case `'+db+'` but field `'+fb+'` is misssing in the dom.\n You should add `'+
|
|
592
|
-
else{'undefined'==typeof cb[fb]&&(cb[fb]=Bb[fb].value);sb=cb[fb];U&&('true'==X[Oa]?sb=!0:'false'==X[Oa]&&(sb=!1));for(var gb=0,pb=ta[db].conditions.length;gb<pb;++gb)if(!(Array.isArray(ta[db].conditions[gb].case)&&-1==ta[db].conditions[gb].case.indexOf(sb)||!Array.isArray(ta[db].conditions[gb].case)&&ta[db].conditions[gb].case!=sb))for(var kb in ta[db].conditions[gb].rules)if(!/^_comment$/i.test(kb)&&kb!=fb&&ja[kb])if(Oa==
|
|
593
|
-
kb.match(/\/(.*)\//).pop(),wa=kb.replace('/'+ka+'/',''),ka=ka.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),ka=new RegExp(ka,wa),ka.test(Oa)){if(ta[db].conditions[gb].case==sb||/^\//.test(ta[db].conditions[gb].case)&&(new RegExp(ta[db].conditions[gb].case)).test(sb))Mb='undefined'!=typeof ta[kb]?ta[kb]:{},ta[kb]=R(ta[db].conditions[gb].rules[kb],Mb);fb!=kb&&'undefined'!=typeof ta[kb]&&oa(kb,ta,X)}}else'undefined'!=
|
|
594
|
-
console.warn('ignoring case `'+caseField+'`: field `NaN'):(U&&/^(true|false)$/i.test(sb)&&'undefined'!=typeof ta[caseField]&&'undefined'!=typeof ta[caseField].isBoolean&&/^(true)$/i.test(ta[caseField].isBoolean)&&(sb=/^(true)$/i.test(sb)?!0:!1),'undefined'!=typeof ta[db].conditions[gb].rules[kb]&&(Mb='undefined'!=typeof ta[db].conditions[gb].rules[kb]?ta[db].conditions[gb].rules[kb]:{},ta[kb]=Mb),
|
|
595
|
-
'undefined'!=typeof ta[kb]?ta[kb]:{};ta[kb]=R(ta[db].conditions[gb].rules[kb],Mb);oa(kb,ta,X)}}if(fb!=Oa&&('undefined'!=typeof ta[Oa]&&oa(Oa,ta,cb),jb)){++Va;jb=ta['_case_'+Oa].conditions;if(!jb)throw Error('[ ginaFormValidator ] case `_case_'+Oa+'` found without `condition(s)` !\nPlease, check your delcaration for `_case_'+Oa+'`');for(let Kb=0,Zb=jb.length;Kb<Zb;++Kb)if(sb=cb[Oa],U&&('true'==X[Oa]?
|
|
596
|
-
|
|
597
|
-
wa),ka.test(sb)&&(Mb[Ib]=jb[Kb].rules[Eb])):Mb[Ib]=jb[Kb].rules[Eb],'undefined'==typeof X[Ib]&&'undefined'!=typeof ja[Ib]&&'undefined'!=typeof ja[Ib].value&&(X[Ib]=ja[Ib].value,U&&/(true|false)/i.test(X[Ib])&&('true'==X[Ib]?X[Ib]=!0:'false'==X[Ib]&&(X[Ib]=!1)),La.addField(Ib,X[Ib]),'undefined'!=typeof fa[Ib]&&(Mb[Ib]=R(Mb[Ib],fa[Ib]))))}else/^\//.test(jb[Kb]['case'])?(ka=jb[Kb]['case'].match(/\/(.*)\//).pop(),
|
|
598
|
-
ka=new RegExp(ka,wa),ka.test(sb)&&(Mb[Eb]=jb[Kb].rules[Eb])):Mb[Eb]=jb[Kb].rules[Eb],'undefined'==typeof X[Eb]&&'undefined'!=typeof ja[Eb]&&'undefined'!=typeof ja[Eb].value&&(X[Eb]=ja[Eb].value,U&&/(true|false)/i.test(X[Eb])&&('true'==X[Eb]?X[Eb]=!0:'false'==X[Eb]&&(X[Eb]=!1)),La.addField(Eb,X[Eb]),'undefined'!=typeof fa[Eb]&&(Mb[Eb]=R(Mb[Eb],fa[Eb])));++aa;if(U)Hb(Wa,cb,fa,X,ja,Mb,Na,Va);else return Hb(Wa,cb,
|
|
599
|
-
(Ta[Oa]=''),0>Ta[Oa].indexOf(rule)&&(Ta[Oa]+=rule+' ');U&&ja[Oa].setAttribute('data-gina-form-errors',Ta[Oa].substr(0,Ta[Oa].length-1))}try{O=Ha(La.toData()),N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.validated||(gina.forms.validated={}),gina.forms.validated[p]||(gina.forms.validated[p]={}),window.ginaToolbar.update('forms',{id:p,validated:O}))}catch(Kb){throw Kb;
|
|
600
|
-
La.toData(),triggerEvent(gina,Wa,'validated.'+p,Na);else return D=!0,{isValid:La.isValid,error:cb,data:O}}};U&&addListener(gina,l,m,function(Wa){Wa.preventDefault();if(!D){D=!0;xa=!1;H=0;var cb=Wa.detail,fa=cb._data||La.toData(),X=cb._errors||La.getErrors()||null;console.debug('instance errors: ',
|
|
601
|
-
Wa.target,'validated.'+Wa.target.id)}});if(U)Hb(l,Ab,$a,h,e,b,q,0);else return Hb(l,Ab,$a,h,e,b,q,0)};return U?Qa(B):E(B,Q,V)}'undefined'!==typeof module&&module.exports?module.exports=ValidatorPlugin:'function'===typeof define&&define.amd&&define('gina/validator',['utils/events','utils/dom','utils/effects','utils/data','lib/form-validator'],function(){return ValidatorPlugin});
|
|
602
|
-
define('gina/toolbar','require jquery vendor/uuid lib/collection lib/routing gina/storage gina/validator'.split(' '),function(B){var Q=B('jquery');Q.noConflict();var V=B('lib/routing');B('lib/collection');var la=B('gina/storage');return function(){var U=null,N=!1,ha=!1,R=!1,S,
|
|
603
|
-
null,Ja=null,Ia=null,Ha=null,mb=null,Fa=null,Pa=null,Ya=function(){I=Q('#gina-toolbar');if(!I.length)return!1;va=I.find('.gina-toolbar-tab > a');P=Q('#gina-toolbar-toggle');K=Q('#gina-toolbar-panels');A=K.find('.gina-toolbar-panel');y=Q('#gina-toolbar-vposition');z=Q('#gina-toolbar-hposition');F=y.add(z);
|
|
604
|
-
Ja=Q('#gina-toolbar-data-html');Ia=Q('#gina-toolbar-view-html');Ha=Q('#gina-toolbar-forms-html');Qa=Q('#gina-toolbar-configuration-environment-html');mb=Q('#gina-toolbar-code-toggle');I.prepend('<textarea class="gina-toolbar-copy"></textarea>');Fa=I.find('.gina-toolbar-copy');v
|
|
605
|
-
position:'top-right',width:'30',panelId:'#gina-toolbar-data',isCollapsed:!0,isUnfolded:[],debug:{forms:{active:!1,strategy:'frontend'}}},
|
|
462
|
+
Ab;var Bb=K.getResponseHeader('Content-Disposition');$a.download=Bb.match('=(.*)')[0].substr(1);$a.click();window.URL.revokeObjectURL(Ab);m={status:K.status,statusText:K.statusText,responseType:La.type,type:La.type,size:La.size}}else m=K.responseText;/\/json/.test(Ta)&&(m=JSON.parse(K.responseText),'undefined'==typeof m.status&&(m.status=K.status),window.ginaToolbar.update('data-xhr',m));if(/\/html/.test(Ta)&&(m={contentType:Ta,content:K.responseText},'undefined'==typeof m.status&&(m.status=K.status),
|
|
463
|
+
'undefined'!=typeof gina.popin&&gina.hasPopinHandler&&(oa=gina.popin.getActivePopin()))){p={};try{p=(new DOMParser).parseFromString(m.content,'text/html').getElementById('gina-without-layout-xhr-data'),p=JSON.parse(decodeURIComponent(p.value)),XHRView=(new DOMParser).parseFromString(m.content,'text/html').getElementById('gina-without-layout-xhr-view'),XHRView=JSON.parse(decodeURIComponent(XHRView.value)),gina&&N&&typeof window.ginaToolbar&&'undefined'!=typeof p&&window.ginaToolbar.update('data-xhr',
|
|
464
|
+
p),gina&&N&&typeof window.ginaToolbar&&'undefined'!=typeof XHRView&&window.ginaToolbar.update('view-xhr',XHRView)}catch(X){throw X;}oa.loadContent(m.content);m=p;triggerEvent(gina,e,'success.'+b,m);return}p=q.eventData.success=m;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&p)try{N&&'undefined'!=typeof p&&!/\/html|\/json/.test(Ta)&&window.ginaToolbar.update('data-xhr',p)}catch(X){throw X;}/^gina\-upload/i.test(b)&&W(gina,e,'success',b,m);var hb=!1;'undefined'!=typeof m.isXhrRedirect&&
|
|
465
|
+
/^true$/i.test(m.isXhrRedirect)&&(hb=!0);if('undefined'!=typeof gina.popin&&gina.hasPopinHandler&&'undefined'!=typeof m.popin||'undefined'!=typeof gina.popin&&gina.hasPopinHandler&&'undefined'!=typeof m.location&&hb){oa=gina.popin.getActivePopin();if(!oa&&'undefined'!=typeof m.popin){if('undefined'!=typeof m.popin&&'undefined'==typeof m.popin.name)throw Error('To get a `$popin` instance, you need at list a `popin.name`.');oa=gina.popin.getPopinByName(m.popin.name);if(!oa)throw Error('Popin with name: `'+
|
|
466
|
+
m.popin.name+'` not found.');}if('undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.close){oa.isRedirecting=!1;oa.close();var Hb=m.popin.reload?m.popin.reload:!1;m.popin.location||m.popin.url||(delete m.popin,Hb&&(m.popin={reload:Hb}))}if('undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.location||'undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.url||'undefined'!=typeof m.location&&hb){hb=null;oa&&(hb=oa.name,oa.isRedirecting=!0);'undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.target&&
|
|
467
|
+
(m.popin.target='_'+m.popin.target);var Wa=m.location||m.popin.location||m.popin.url;if('undefined'!=typeof m.popin&&'undefined'!=typeof m.popin.name&&hb!=m.popin.name){oa&&oa.isOpen&&oa.close();hb=m.popin.name;oa=gina.popin.getPopinByName(hb);if(!oa)throw Error('Popin with name `'+hb+'` not found !');console.debug('Validator::Popin now redirecting [1-c]');oa.load(oa.name,Wa,oa.options)}else oa&&(console.debug('Validator::Popin now redirecting [1-d]'),oa&&oa.isOpen&&oa.close(),oa.load(oa.name,Wa,
|
|
468
|
+
oa.options));if(oa&&!oa.isOpen)return setTimeout(function(X){X.isOpen||X.open()},50,oa)}}triggerEvent(gina,e,'success.'+b,m);D&&triggerEvent(gina,e,'success.'+b+'.hform',m)}catch(X){m={status:422,error:X.message,stack:X.stack};p=q.eventData.error=m;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&p)try{N&&'undefined'!=typeof p&&window.ginaToolbar.update('data-xhr',p)}catch(ja){throw ja;}/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,
|
|
469
|
+
e,'error.'+b+'.hform',m)}if('undefined'!=typeof m&&'undefined'!=typeof m.location)return window.location.hash='',m.location=/^http/.test(m.location)||/^\//.test(m.location)?m.location:location.protocol+'//'+m.location,m.location.replace(/^http(.*):\d+/,'$1').replace(/^:\/\//,'').split(/\//g)[0]==gina.config.hostname&&gina.config.hostname==window.location.host&&(m.location=location.protocol+m.location.replace(/^http(.*):\d+/,'$1').replace(/^:/,'')),setTimeout(()=>{window.location.href=m.location},
|
|
470
|
+
Y)}else if(0!=K.status)if(m={status:K.status},/blob/.test(K.responseType)){La=new Blob([this.response],{type:'text/plain'});var cb=new FileReader,fa='';cb.addEventListener('loadend',X=>{/string/i.test(typeof X.srcElement.result)?fa+=X.srcElement.result:'object'==typeof X.srcElement.result?m=R(m,X.srcElement.result):m.message+=X.srcElement.result;if(/2/.test(cb.readyState)){if(/^(\{|\[)/.test(fa))try{m=R(m,JSON.parse(fa))}catch(ja){m=R(m,ja)}m.message||delete m.message;p=q.eventData.error=m;if(gina&&
|
|
471
|
+
N&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&p)try{window.ginaToolbar.update('data-xhr',p)}catch(ja){throw ja;}/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,e,'error.'+b+'.hform',m)}});cb.readAsText(La)}else{if(/^(\{|\[)/.test(K.responseText))try{m=R(JSON.parse(K.responseText),m)}catch(X){m=R(X,m)}else'object'==typeof K.responseText?m=R(K.responseText,m):m.message=K.responseText;if('undefined'!=typeof m&&'undefined'!=typeof m.error&&
|
|
472
|
+
m.fields&&'object'==typeof m.fields){Wa='undefined'!=typeof m.message?m.message:null;Y={};for(hb in m.fields)oa={},oa[hb]={},oa[hb].isApiError=m.fields[hb],Wa&&!oa[hb].isApiError&&(oa[hb].isApiError=m.error),Y[hb]=oa[hb],G(q.target,oa,l,hb);m.fields=Y}p=q.eventData.error=m;if(gina&&N&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&p)try{window.ginaToolbar.update('data-xhr',p)}catch(X){throw X;}/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,
|
|
473
|
+
e,'error.'+b+'.hform',m)}}};K.onprogress=function(Y){var oa='0';Y.lengthComputable&&(oa=Y.loaded/Y.total,oa=parseInt(100*oa));Y={status:100,progress:oa};q.eventData.onprogress=Y;triggerEvent(gina,e,'progress.'+b,Y)};K.ontimeout=function(Y){m={status:408,error:'Request Timeout'};q.eventData.ontimeout=m;/^gina\-upload/i.test(b)&&W(gina,e,'error',b,m);triggerEvent(gina,e,'error.'+b,m);D&&triggerEvent(gina,e,'error.'+b+'.hform',m)};l||(l=event.detail.data);if(l){h=!1;if('object'==typeof l){ba=[];xa=0;
|
|
474
|
+
var pa={};try{if(l instanceof FormData){var Ba=event.currentTarget.getAttribute('data-gina-form-upload-group')||'untagged',H,ka;for([H,ka]of l.entries())ka instanceof File?(h||=!0,ba[xa]={key:H,group:Ba,file:ka,bin:''},++xa):pa[H]=ka}else l=JSON.stringify(l);if(h&&0<ba.length){var wa='--ginaWKBoundary'+ha.v4().replace(/\-/g,'');return ea(ba,wa,'',0,function(Y,oa,La){if(Y)/^gina\-upload/i.test(b)&&W(gina,e,'error',b,Y),triggerEvent(gina,e,'error.'+b,Y),D&&triggerEvent(gina,e,'error.'+b+'.hform',Y);
|
|
475
|
+
else return La&&(K.setRequestHeader('Content-Type','multipart/form-data; boundary='+wa),K.send(oa),q.sent=!0,N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),window.ginaToolbar.update('forms',{id:b,sent:oa}))),!1})}'undefined'!=typeof pa&&0<pa.count()&&(l=JSON.stringify(pa))}catch(Y){/^gina\-upload/i.test(b)&&W(gina,e,'error',b,Y),triggerEvent(gina,e,'error.'+b,Y),D&&triggerEvent(gina,e,'error.'+b+'.hform',Y)}}h||('undefined'!=typeof aa&&null!=
|
|
476
|
+
aa&&''!=aa&&K.setRequestHeader('Content-Type',aa),K.send(l))}else'undefined'!=typeof aa&&null!=aa&&''!=aa&&K.setRequestHeader('Content-Type',aa),K.send();q.sent=!0;N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.sent||(gina.forms.sent={}),Ba={id:b,sent:'string'==typeof l?JSON.parse(l):l},window.ginaToolbar.update('forms',Ba))}}},W=function(l,h,e,b,q){l=h.uploadProperties||null;if(!l)throw Error('No uploadProperties found !!');h=document.getElementById(l.uploadTriggerId);
|
|
477
|
+
b=null;var m=q.files||[],p=null;l.hasPreviewContainer&&(b=document.getElementById(l.previewContainer.id))&&(b.innerHTML='');l.errorField&&(p=document.getElementById(l.errorField));p&&(p.style.display='none');if(p&&'success'!=e){var O=q.message||q.error;p.innerHTML='<p>'+O+'</p>';fadeIn(p)}else if(p||'success'==e)for(e=0,q=m.length;e<q;++e){var D=b.id.replace(/\-preview/,'-'+e+'-reset-trigger');O=!1;p=document.getElementById(D);var aa=['reset','js-upload-reset'];p?(/a/i.test(p.tagName)&&(p.href='#'),
|
|
478
|
+
p.innerHTML&&''!=p.innerHTML||(p.innerHTML=h.getAttribute('data-gina-form-upload-reset-label')||'Reset'),'undefined'==typeof p.className&&(p.className=''),D=R(p.className.split(/\s+/g),aa),p.className=D.join(' ')):(O=!0,p=document.createElement('A'),p.href='#',p.innerHTML=h.getAttribute('data-gina-form-upload-reset-label')||'Reset',p.className=aa.join(' '),p.id=D);p.style.display='none';if('undefined'==typeof m[e].preview&&l.hasPreviewContainer&&/^image/.test(m[e].mime)&&''!=m[e].location){D=document.createElement('IMG');
|
|
479
|
+
D.src=m[e].tmpUri;D.style.display='none';D.setAttribute('data-upload-original-filename',m[e].originalFilename);D.setAttribute('data-upload-reset-link-id',p.id);aa=b.getAttribute('data-preview-max-width')||null;if(D.width&&aa&&D.width>aa){var xa=D.width/aa;D.width=aa;D.height/=xa}else!D.width&&aa&&(D.width=aa);/ul/i.test(l.previewContainer.tagName)?(aa=document.createElement('LI'),aa.className='item',aa.appendChild(D),b.appendChild(aa)):b.appendChild(D);fadeIn(D)}D=l.uploadFields[e];for(var ba in D)if('name'==
|
|
480
|
+
ba&&''!=D[ba].value||!m[e][ba]||'preview'==ba&&'undefined'==typeof m[e][ba]||/(height|width)/i.test(ba)&&!/^image/.test(m[e].mime))/(preview|height|width)/i.test(ba)&&(aa=document.getElementById(D[ba].id))&&aa.parentNode.removeChild(aa);else if(D[ba].value=m[e][ba],'preview'==ba)for(var pa in m[e][ba])if('undefined'!=typeof m[e][ba][pa]&&'undefined'!=typeof D[ba][pa]&&(D[ba][pa].value=m[e][ba][pa]),'tmpUri'==pa&&l.hasPreviewContainer){xa=document.createElement('IMG');xa.src=m[e][ba].tmpUri;xa.style.display=
|
|
481
|
+
'none';xa.setAttribute('data-upload-original-filename',m[e].originalFilename);xa.setAttribute('data-upload-preview-original-filename',m[e][ba].originalFilename);xa.setAttribute('data-upload-reset-link-id',p.id);if(aa=b.getAttribute('data-preview-max-width')||null)xa.width=aa;/ul/i.test(l.previewContainer.tagName)?(aa=document.createElement('LI'),aa.className='item',aa.appendChild(xa),b.appendChild(aa)):b.appendChild(xa);fadeIn(xa)}l.hasPreviewContainer&&(/ul/i.test(l.previewContainer.tagName)?(aa=
|
|
482
|
+
document.createElement('LI'),aa.className='item',O&&aa.appendChild(p),b.appendChild(aa)):O&&b.appendChild(p));rb('reset',h,e);fadeIn(p)}else throw Error(O);},ia=function(l,h){console.debug(h+' input files');var e=/reset/i.test(h)?!0:!1,b=null,q=null,m=document.getElementById(l.id+'-preview').childNodes,p=null,O=l.customFiles,D=[];for(let aa=0,xa=m.length;aa<xa;aa++)if(/img/i.test(m[aa].tagName)){e?(b=m[aa].getAttribute('data-upload-original-filename'),D.push(b),(q=m[aa].getAttribute('data-upload-preview-original-filename'))&&
|
|
483
|
+
D.push(q)):(b=m[aa].src.substr(m[aa].src.lastIndexOf('/')+1),D.push(b));for(let ba=0,pa=O.length;ba<pa;ba++)if(O[ba].name==b){p=e?document.getElementById(m[aa].getAttribute('data-upload-'+h+'-link-id')):document.getElementById(O[ba].deleteLinkId);p.style.display='none';m[aa].style.display='none';O.splice(ba,1);l.customFiles=O;e&&(l.value=O.join(', C:\\fakepath\\'));b=new RegExp('^'+(l.name+'['+ba+']').replace(/\-|\[|\]|\./g,'\\$&'));for(let H=0,ka=l.form.length;H<ka;H++)if(q=l.form[H].dataset.ginaFormUploadIsLocked||
|
|
484
|
+
!1,b.test(l.form[H].name)&&!/true/i.test(q)&&(l.form[H].remove(),ka--,H--,gina&&N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar))try{window.ginaToolbar.update('data-xhr',{files:O})}catch(wa){throw wa;}q=l.getAttribute('data-gina-form-upload-'+h+'-action');if(!q||'undefined'==typeof q||''==q||/404/.test(q))throw Error('input file `'+l.id+'` error: `data-gina-form-upload-'+h+'-action` is required. You need to provide a valide url.');(b=l.getAttribute('data-gina-form-upload-'+h+'-method'))&&
|
|
485
|
+
'undefined'!=typeof b&&''!=b?b=b.toUpperCase():e?b='POST':(b=1<D.length?'POST':'DELETE',console.warn('`data-gina-form-upload-'+h+'-method` was not defined. Switching to `'+b+'` by default.'));let Ba=l.getAttribute('data-gina-form-upload-'+h+'-is-synchrone');if(/null/i.test(Ba)||'undefined'==typeof b||''==b)Ba=!0;q=setupXhr({url:q,method:b,isSynchrone:Ba,headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','X-Requested-With':'XMLHttpRequest'}});/GET|DELETE/i.test(b)?q.send():
|
|
486
|
+
q.send(JSON.stringify({files:D}));if(/none/i.test(window.getComputedStyle(l).display)){if(/none/i.test(l.parentElement.style.display)){l.parentElement.style.display='block';return}l.style.display='block'}removeListener(gina,$uploadResetTrigger,'click',function(){p.remove();m[aa].remove()});xa--;aa--;break}}},ea=function(l,h,e,b,q){var m=new FileReader;m.addEventListener('load',function(p){p.preventDefault();try{var O=this.result,D=void 0;p='';var aa=null;'undefined'==typeof D&&(D=8);var xa=D/8;switch(D){case 8:aa=
|
|
487
|
+
new Uint8Array(O);break;case 16:aa=new Uint16Array(O);break;case 32:aa=new Uint32Array(O);break;default:aa=new Uint8Array(O)}var ba=aa.length,pa=Math.pow(2,8)+xa;O=0;for(xa=D=null;O<ba;O+=pa)D=Math.min(pa,ba-O),xa=aa.subarray(O,O+D),p+=String.fromCharCode.apply(null,xa);l[this.index].bin+=p;l[this.index].file.type||(l[this.index].file.type='application/octet-stream')}catch(Ba){return q(Ba,null,!0)}e+='--'+h+'\r\n';e+='Content-Disposition: form-data; name="'+l[this.index].key+'"; group="'+l[this.index].group+
|
|
488
|
+
'"; filename="'+l[this.index].file.name+'"\r\nContent-Type: '+l[this.index].file.type+'\r\nContent-Length: '+l[this.index].bin.length+'\r\n\r\n';e+=l[this.index].bin+'\r\n';++this.index;this.index==l.length?(e+='--'+h+'--',q(!1,e,!0)):ea(l,h,e,this.index,q)},!1);m.index=b;l[b].bin='';m.readAsArrayBuffer(l[b].file)},Aa=function(l){var h=l.target.getAttribute('data-gina-form-event-on-submit-success')||null;if(null!=h)if(/\((.*)\)/.test(h))eval(h);else l.on('success.hform',window[h]);h=l.target.getAttribute('data-gina-form-event-on-submit-error')||
|
|
489
|
+
null;if(null!=h)if(/\((.*)\)/.test(h))eval(h);else l.on('error.hform',window[h])},ma=function(l){var h=null,e=l;if(!w.$forms)throw Error('`$forms` collection not found');if('undefined'==typeof e)if('undefined'!=typeof this.id&&''!=this.id&&null!=this.id)e=this.id;else throw Error('[ FormValidator::destroy(formId) ] `formId` is missing');if('string'==typeof e)e=e.replace(/#/,'');else{if('object'!=typeof e||Array.isArray(e))throw Error('[ FormValidator::destroy(formId) ] `formId` should be a `string`');
|
|
490
|
+
l=e.form;e=l.getAttribute('id')||'form.'+ha.v4();l.setAttribute('id',e)}'undefined'!=typeof w.$forms[e]?h=w.$forms[e]:'undefined'!=typeof this.binded&&(h=this);if(h)addListener(gina,h.target,'destroy.'+e,function(b){cancelEvent(b);delete w.$forms[e];removeListener(gina,b.currentTarget,b.type);removeListener(gina,b.currentTarget,'destroy')}),h=nb(h),triggerEvent(gina,h.target,'destroy.'+e);else throw Error('[ FormValidator::destroy(formId) ] `'+e+'` not found');},sa=function(l){l='undefined'!=typeof l?
|
|
491
|
+
l:w.rules;for(let b in l){var h=Object.getOwnPropertyNames(l[b]),e=0;let q=h.length,m=!1,p=null;for(;e<q;){if(/^_case_/.test(h[e])){m=!0;p=h[e];break}e++}m||'object'!=typeof l[b]||sa(l[b]);if(p&&Array.isArray(l[b][p].conditions)&&0<l[b][p].conditions.length)for(h=0,e=l[b][p].conditions.length;h<e;)'undefined'!=typeof l[b][p].conditions[h].rules&&0==l[b][p].conditions[h].rules.count()&&(l[b][p].conditions.splice(h,1),e--,h--),h++}},Da=function(l){var h=JSON.stringify(l),e=h.match(/("@import\s+[-_a-z A-Z 0-9/.]+")/g)||
|
|
492
|
+
[],b=[];for(let O=0,D=e.length;O<D;O++)0>b.indexOf(e[O])&&b.push(e[O]);e=b;b=h.match(/("_merging(.*))(\s+:|:)(.*)(",|")/g);w.rules||(w.rules={});if(e&&0<e.length){l={};for(let O=0,D=e.length;O<D;++O){var q=e[O].replace(/(@import\s+|"|')/g,'');var m=q.replace(/(@import\s+|"|')/g,'').split(/\s/g);for(let aa=0,xa=m.length;aa<xa;++aa){var p=m[aa].replace(/\//g,'.').replace(/\-/g,'.');'undefined'!=typeof w.rules[p]?(p=JSON.stringify(w.rules[p]),p=JSON.parse(p),p._comment='undefined'!=typeof p._comment?
|
|
493
|
+
p._comment+'\n':'',p._comment+='Imported from `'+q+'`',p=JSON.stringify(p),h=h.replace(new RegExp(e[O],'g'),p),w.rules=JSON.parse(JSON.stringify(w.rules).replace(new RegExp(e[O],'g'),'{}'))):console.warn('[formValidator:rules] <@import error> on `'+e[O]+'`: rule `'+m[aa]+'` not found. Ignoring.')}m=new RegExp(e[O]);if(q=b&&m.test(b.join())?!0:!1)for(let aa=0,xa=b.length;aa<xa;aa++)if(m.test(b[aa])){q=JSON.stringify(l);q=q.substr(1,q.length-1);aa<xa-1&&(q+=',');try{h=h.replace(new RegExp(b[aa],'g'),
|
|
494
|
+
q),w.rules=JSON.parse(JSON.stringify(w.rules).replace(new RegExp(b[aa],'g'),'{}'))}catch(ba){throw ba;}}l={}}l=JSON.parse(h);Ja(l,'');try{sa()}catch(O){console.error(O.stack)}}return l},Qa=function(l){gina.hasValidator?(w=R(w,gina.validator),w.on('init',function(h){w.isReady=!0;triggerEvent(gina,w.target,'ready.'+w.id,w)})):(w.target=document,w.setOptions=n,w.getFormById=y,w.validateFormById=F,w.resetErrorsDisplay=M,w.resetFields=T,w.handleErrorsDisplay=G,w.send=Ea,w.on('init',function(h){if('undefined'!=
|
|
495
|
+
typeof l&&l.count())try{Ja(l,''),l=Da(l),gina.forms.rules='undefined'!=typeof gina.forms.rules&&gina.forms.rules?R(gina.forms.rules,l,!0):l,w.rules=R(w.rules,JSON.clone(gina.forms.rules),!0)}catch(O){throw O;}va.count()||(va=JSON.clone(w.rules));za.setOptions=n;za.getFormById=y;za.validateFormById=F;za.resetErrorsDisplay=M;za.resetFields=T;za.handleErrorsDisplay=G;za.submit=ra;za.send=Ea;za.unbind=nb;za.bind=yb;za.reBind=wb;za.destroy=ma;h=0;for(var e=document.getElementsByTagName('form'),b=0,q=e.length;b<
|
|
496
|
+
q;++b){if(e[b].getAttribute){var m=e[b].getAttribute('id')||'form.'+ha.v4();m!==e[b].getAttribute('id')&&e[b].setAttribute('id',m)}else m='form.'+ha.v4(),e[b].setAttribute('id',m);za.id=m;za.target=e[b];w.$forms[m]=R({},za);var p=e[b].getAttribute('data-gina-form-rule');if(p){p=p.replace(/\-|\//g,'.');'undefined'!=typeof l&&(w.$forms[m].rules[p]=w.rules[p]=va[p]=R(JSON.clone(eval('gina.forms.rules.'+p)),w.rules[p]));if('undefined'==typeof va[p])throw Error('['+m+'] no rule found with key: `'+p+'`. Please check if json is not malformed @ /forms/rules/'+
|
|
497
|
+
p.replace(/\./g,'/')+'.json');p=w.rules[p]}'string'==typeof m&&'undefined'!=typeof va[m.replace(/\-/g,'.')]||'object'==typeof p?(m=w.$forms[m].target,p?yb(m,p):yb(m),++h):('object'==typeof e[b].id?(delete w.$forms[e[b].id],m=e[b].attributes.getNamedItem('id').nodeValue||'form.'+ha.v4(),e[b].setAttribute('id',m),e[b].id=m,za.target=e[b],w.$forms[m]=R({},za),m=w.$forms[m].target):m=w.$forms[e[b].id].target,p?yb(m,p):yb(m))}if(window.XMLHttpRequest)K=new XMLHttpRequest;else if(window.ActiveXObject)try{K=
|
|
498
|
+
new ActiveXObject('Msxml2.XMLHTTP')}catch(O){try{K=new ActiveXObject('Microsoft.XMLHTTP')}catch(D){}}w.isReady=!0;gina.hasValidator=!0;gina.validator=w;triggerEvent(gina,w.target,'ready.'+w.id,w)}));w.initialized=!0;return w},Ja=function(l,h){var e;for(e in l)if('object'==typeof l[e]&&'undefined'==typeof w.rules[h+e]){var b=e;/\[|\]/.test(e)&&(b=e.replace(/\[/g,'.').replace(/\]/g,''));w.rules[h+b]=l[e];Ja(l[e],h+b+'.')}},Ia=function(l){if('undefined'!=typeof va[l])return va[l];var h=null;if('undefined'==
|
|
499
|
+
typeof w.rules[l]){if(Ja(va,''),va=Da(va),h=va[l],!h)return{}}else h=w.rules[l];h=JSON.clone(h);var e=new RegExp('^'+l),b=new RegExp('^'+l+'.'),q=null,m=function(O,D,aa,xa,ba,pa,Ba){if(D.length){var H=Object.getOwnPropertyNames(O)[0],ka=D[0];ka=''==ba?ba+=ka:ba+'['+ka+']';1==D.length&&(O[H]=R(O[H],aa,!0));D.splice(0,1);ka==H?m(O[H],D,aa,xa,ka,pa,Ba):'undefined'!=typeof O[H]?m(O[H],D,aa,xa,ka,pa,Ba):m(O,D,aa,xa,ba,pa,Ba)}},p;for(p in w.rules)p!=l&&e.test(p)&&(q=p.replace(b,''),/\./.test(q)&&(q=q.split(/\./g),
|
|
500
|
+
m(h,q,w.rules[p],h,'',0,h.count()-1)));return va[l]=h},Ha=formatDataFromString,mb=function(l){var h=w.$forms[l.form.getAttribute('id')],e=/^true$/i.test(l.disabled)?!0:!1;e&&'undefined'!=typeof h.rule&&'undefined'!=typeof h.rule[l.name]&&'undefined'!=typeof h.rule[l.name].exclude&&/^false$/i.test(h.rule[l.name].exclude)&&(e=!1);if(/^(radio|text|hidden|password|number|date|email)$/i.test(l.type)&&!e){var b=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value'),q=b.set;b.set=function(m){Object.defineProperty(this,
|
|
501
|
+
'value',{set:q});var p='change.'+this.id;m===this.value&&m===this.defaultValue||m===this.value||(this.value=m,console.debug('Value set: '+m),'undefined'!=typeof gina.events[p]&&(console.debug('trigger event on: ',this.name,p),triggerEvent(gina,this,p,m)));Object.defineProperty(this,'value',b)};Object.defineProperty(l,'value',b)}},Fa=function(l,h,e,b){'undefined'==typeof b&&(b=!1);var q=l.rules,m=w.$forms[h.form.getAttribute('id')],p=/^true$/i.test(h.disabled)?!0:!1;p&&'undefined'!=typeof m.rule&&
|
|
502
|
+
'undefined'!=typeof m.rule[h.name]&&'undefined'!=typeof m.rule[h.name].exclude&&/^false$/i.test(m.rule[h.name].exclude)&&(p=!1);if(/^(radio|checkbox|text|hidden|password|number|date|email)$/i.test(h.type)&&!p||b&&!p){b=h.name;m=q[b]||null;if(!m&&(xb(q,h),'undefined'==typeof q[b]))return;if(l.target.dataset.ginaFormLiveCheckEnabled&&m&&(b=[],m=null,p=0,/^(radio|checkbox)$/i.test(h.type)?m=/^(radio|checkbox)$/i.test(h.type)?'changed.'+h.id:'change.'+h.id:(addEventListener(gina,h,'focusout.'+h.id,function(D){D.preventDefault();
|
|
503
|
+
clearTimeout(e)}),m='change.'+h.id,'undefined'==typeof gina.events[m]&&(b[p]=m,++p),m='keyup.'+h.id,'undefined'==typeof gina.events[m]&&(b[p]=m,++p),m='focusin.'+h.id,'undefined'==typeof gina.events[m]&&(b[p]=m,++p),m='focusout.'+h.id),'undefined'==typeof gina.events[m]&&(b[p]=m,++p),0<b.length)){var O=!1;addListener(gina,h,b,function(D){D.preventDefault();clearTimeout(e);if(!O&&/^changed\./i.test(D.type)||!O&&/^(radio|checkbox)$/i.test(D.target.type))O=!0;else if(O&&/^changed\./i.test(D.type)||O&&
|
|
504
|
+
/^(radio|checkbox)$/i.test(D.target.type))return!1;if('undefined'!=typeof w.$forms[D.target.form.getAttribute('id')].isSubmitting&&/true/i.test(w.$forms[D.target.form.getAttribute('id')].isSubmitting))return!1;var aa=function(){console.debug('processing: '+D.target.name+'/'+D.target.id);if(!/^(radio|checkbox)$/i.test(D.target.type)&&D.target.value===D.target.defaultValue&&''!=D.target.value){var xa=w.$forms[D.target.form.getAttribute('id')].errors;if(xa&&0!=xa.count())G(D.target.form,xa,null,D.target.name);
|
|
505
|
+
else return G(D.target.form,{},null,D.target.name),cancelEvent(D)}xa={};var ba={};xa[D.target.name]=D.target.value;ba[D.target.name]=D.target;w.$forms[D.target.form.getAttribute('id')].isValidating=!0;ca(D.target,xa,ba,l.rules,function(pa){w.$forms[D.target.form.getAttribute('id')].isValidating=!1;pa.isValid()?G(D.target.form,{},pa.data,D.target.name):G(D.target.form,pa.error,pa.data,D.target.name);var Ba=D.target.form,H=null,ka=pa=null;pa=eb(Ba,q);H=pa.fields;pa=pa.$fields;var wa=Ba.getAttribute('id');
|
|
506
|
+
ka=w.$forms[wa].rules;w.$forms[wa].isValidating=!0;ca(Ba,H,pa,ka,function(Y){w.$forms[wa].isValidating=!1;console.debug('['+wa+'] onSilentGlobalLiveValidation: '+Y.isValid(),Y,H);var oa=Y.isValid();N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:wa,errors:Y.error||{}}));!oa&&Y.error?w.$forms[h.form.getAttribute('id')].errors=Y.error:oa&&(w.$forms[wa].errors={},console.debug('resetting field: '+h.name),
|
|
507
|
+
u[wa]={},G(Ba,{},null,h.name));Ka(Ba,oa);O=!1})})};if(/^changed\./i.test(D.type)||/^change\./i.test(D.type)&&'radio'==D.target.type)return function(xa,ba){if(!(0<ba))return++ba,setTimeout(()=>{console.debug(' changed .... '+h.id);aa()},0)}(O,0);/^focusin\./i.test(D.type)?/\-error/.test(h.parentNode.className)&&(console.debug('#1 you just focusin ....'+h.id,h.value,w.$forms[h.form.getAttribute('id')].isValidating),x(h)):/^focusout\./i.test(D.type)?/\-warning/.test(h.parentNode.className)&&(console.debug('#1 you just focusout ....'+
|
|
508
|
+
h.id,h.value),w.$forms[h.form.getAttribute('id')].isValidating=!1,x(h),G(h.form,w.$forms[h.form.getAttribute('id')].errors,null,h.name)):/^keyup\./i.test(D.type)?(h.ginaFormValidatorTestedValue=h.value,e=setTimeout(function(){if(!(-1<['91','17','16'].indexOf(''+D.keyCode)&&0==P.count()))if(-1<['9'].indexOf(''+D.keyCode)){var xa=document.getElementById(w.$forms[h.form.getAttribute('id')].lastFocused[1].id),ba=w.$forms[xa.form.getAttribute('id')].errors,pa=!0;console.debug('[TAB] you just focusout from "'+
|
|
509
|
+
w.$forms[h.form.getAttribute('id')].lastFocused[1].id+'" to "'+h.id+'"','errors: ',ba);ba&&0<ba.count()&&(pa=w.$forms[xa.form.getAttribute('id')].isValidating=!1);x(xa);G(xa.form,ba,null,xa.name);Ka(h.form,pa)}else console.debug('[A]['+P.count()+'] keyup ('+D.keyCode+') .... '+h.id,h.value,' VS ',h.ginaFormValidatorTestedValue+'(old)'),aa()},1E3)):/^change\./i.test(D.type)&&!/^(checkbox)$/i.test(D.target.type)&&(console.debug(' change .... '+h.id),aa())})}}},Pa=function(l,h){l.setSelectionRange?(l.focus(),
|
|
510
|
+
l.setSelectionRange(h,h)):l.createTextRange&&(l=l.createTextRange(),l.collapse(!0),l.moveEnd('character',h),l.moveStart('character',h),l.select())},Ya=function(l,h){if(document.activeElement&&document.activeElement.form){l=Array.prototype.filter.call(document.activeElement.form.querySelectorAll('a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), select:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(q){return 0<q.offsetWidth||0<q.offsetHeight||
|
|
511
|
+
q===document.activeElement});var e=l.indexOf(document.activeElement);if(-1<e){var b=l[e+1];h&&(b=l[e-1]);(b||l[0]).focus()}}},qb=function(l,h){l.setAttribute('readonly','readonly');addListener(gina,l,'focusout.'+l.id,function(e){e.preventDefault();clearTimeout(h);e=e.currentTarget;triggerEvent(gina,e,'change.'+e.id);e.setAttribute('readonly','readonly')});addListener(gina,l,'focusin.'+l.id,function(e){e.preventDefault();e.currentTarget.removeAttribute('readonly');var b='keydown.'+e.currentTarget.id;
|
|
512
|
+
'undefined'==typeof gina.events[b]&&addListener(gina,e.currentTarget,b,function(q){q.preventDefault();clearTimeout(h);var m=q.currentTarget,p=q.currentTarget.value,O=m.selectionStart,D=m.selectionEnd;m.removeAttribute('readonly');switch(q.keyCode){case 46:case 8:O!=D?(m.value=p.substr(0,O)+p.substr(D),0==O&&(m.value=p.substr(D))):m.value=0==O?p.substring(O+1):p.substr(0,O-1)+p.substr(D);q.currentTarget.setAttribute('readonly','readonly');setTimeout(()=>{m.removeAttribute('readonly');setTimeout(()=>
|
|
513
|
+
{O!=D?Pa(m,O):0==O?Pa(m,O):Pa(m,O-1)},0)},0);break;case 9:P[16]&&P[9]?Ya(m,!0):Ya(m);break;case 13:case 16:break;case 37:console.debug('moving left ',O-1);Pa(m,O-1);break;case 39:O+1<p.length+1&&Pa(m,O+1);break;case 17:case 91:console.debug('CMD hit');q.preventDefault();break;case 67:if(P[67]&&P[91]||P[67]&&P[17]){m.setSelectionRange(O,D);document.execCommand('copy');break}case 86:if(P[86]&&P[91]||P[86]&&P[17]){O!=D&&(m.value=m.value.replace(p.substring(O,D),''));Pa(m,O);document.execCommand('paste');
|
|
514
|
+
break}case 88:if(P[88]&&P[91]||P[88]&&P[17]){m.setSelectionRange(O,D);document.execCommand('cut');break}case 90:if(P[90]&&P[91]||P[90]&&P[17]){m.value=m.defaultValue;break}default:O!=D?(m.value=p.substr(0,O)+q.key,D-1<p.length&&(m.value+=p.substring(D))):m.value=0==O?q.key+p.substring(O):p.substr(0,O)+q.key+p.substr(D),q.currentTarget.setAttribute('readonly','readonly'),setTimeout(()=>{m.removeAttribute('readonly');setTimeout(()=>{Pa(m,O+1)},0)},0)}})})},bb=function(l,h){if(/^(input|textarea)$/i.test(h.tagName)&&
|
|
515
|
+
'undefined'==typeof gina.events['registered.'+h.id]){/^file$/i.test(h.type)||mb(h);switch(h.tagName.toLowerCase()){case 'textarea':Fa(l,h,null,!0);break;default:Fa(l,h,null),l=h.getAttribute('autocomplete'),/safari/i.test(navigator.userAgent)&&l&&/^(off|false)/i.test(l)&&qb(h,null)}gina.events['registered.'+h.id]=h.id}},rb=function(l,h,e){var b=h.id+'-'+e+'-'+l+'-trigger',q=document.getElementById(b);q||(b=h.getAttribute('data-gina-form-upload--'+e+ +l+'-trigger'),q=document.getElementById(b));q&&
|
|
516
|
+
'undefined'==typeof q.isBinded||q&&'undefined'!=typeof q.isBinded&&!/true/i.test(q.isBinded)?(addListener(gina,q,'click',function(m){m.preventDefault();ia(h,l)}),q.isBinded=!0):console.warn('[FormValidator::bindForm][upload]['+h.id+'] : did not find `upload '+l+' trigger`.\nPlease, make sure that your delete element ID is `'+b+'-'+l+'-trigger`, or add to your file input ('+h.id+') -> `data-gina-form-upload-'+l+'-trigger="your-custom-id"` definition.')},Vb=function(l,h){var e=function(b,q,m){var p=
|
|
517
|
+
null;switch(q){case 'data-gina-form-upload-action':p='upload-to-tmp-xml';break;case 'data-gina-form-upload-reset-action':p='upload-delete-from-tmp-xml'}var O=b.getAttribute(q);if(!O||''==O){p||console.warn('`'+q+'` definition not found for `'+b.id+'`. Trying to get default route.');var D=null;try{p&&(O=I.getRoute(p))}catch(aa){D=aa}O?(console.info('Ignore previous warnings regarding upload. I have found a default `'+q+'` route: `'+p+'@'+O.bundle+'`'),b.setAttribute('data-gina-form-upload-action',
|
|
518
|
+
O.toUrl())):(b='`'+q+'` needs to be defined to proceed for your `input[type=file]` with ID `'+b.id+'`\n'+D+'\n',m&&(m.innerHTML+=b.replace(/(\n|\r)/g,'<br>')),console.error(b))}};e(l,'data-gina-form-upload-action',h);e(l,'data-gina-form-upload-reset-action',h);e(l,'data-gina-form-upload-delete-action',h)},wb=function(l,h,e){l=nb(l);yb(l.target,h);return e?e(l):l},nb=function(l){var h=null,e=null;try{if(l.getAttribute&&l.getAttribute('id'))if(e=l.getAttribute('id'),'undefined'!=typeof w.$forms[e])h=
|
|
519
|
+
w.$forms[e];else throw Error('form instance `'+e+'` not found');else if('undefined'!=typeof l.target)h=l,e=h.id;else throw Error('Validator::unbindForm($target): `$target` must be a DOM element\n'+err.stack);}catch(p){throw Error('Validator::unbindForm($target) could not unbind form `'+l+'`\n'+p.stack);}if('undefined'!=typeof h&&!h.binded)return h;removeListener(gina,h,'success.'+e);removeListener(gina,h,'error.'+e);h.target.getAttribute('data-gina-form-event-on-submit-success')&&removeListener(gina,
|
|
520
|
+
h,'success.'+e+'.hform');h.target.getAttribute('data-gina-form-event-on-submit-error')&&removeListener(gina,h,'error.'+e+'.hform');removeListener(gina,h,'validate.'+e);removeListener(gina,h,'validated.'+e);removeListener(gina,h,'submit.'+e);removeListener(gina,h,'reset.'+e);l=[];e=h.target.getElementsByTagName('button');if(0<e.length)for(let p=0,O=e.length;p<O;++p)l.push(e[p]);e=h.target.getElementsByTagName('a');if(0<e.length)for(let p=0,O=e.length;p<O;++p)l.push(e[p]);e=h.target.getElementsByTagName('input');
|
|
521
|
+
if(0<e.length)for(let p=0,O=e.length;p<O;++p)if(/^(hidden)$/i.test(e[p].type)||l.push(e[p]),/^(file)$/i.test(e[p].type)){var b=e[p].getAttribute('data-gina-form-virtual');if(b){var q=y(b).target;if(q){l.push(q);for(let D=0,aa=la.length;D<aa;D++){var m=la[D];'undefined'!=typeof gina.events[m+'.'+b+'.hform']&&gina.events[m+'.'+b+'.hform']==b&&removeListener(gina,q,m+'.'+b+'.hform')}}}}else for(let D=0,aa=la.length;D<aa;D++)b=la[D]+'.'+e[p].id,'undefined'!=typeof gina.events[b]&&gina.events[b]==e[p].id&&
|
|
522
|
+
removeListener(gina,e[p],b),b=la[D],'undefined'!=typeof gina.events[b]&&gina.events[b]==e[p].id&&removeListener(gina,e[p],b),b=e[p].id,'undefined'!=typeof gina.events[b]&&gina.events[b]==e[p].id&&removeListener(gina,e[p],b);e=h.target.getElementsByTagName('textarea');if(0<e.length)for(let p=0,O=e.length;p<O;++p)l.push(e[p]);e=h.target.getElementsByTagName('form');if(0<e.length)for(let p=0,O=e.length;p<O;++p)l.push(e[p]);l.push(h.target);for(let p=0,O=l.length;p<O;++p){e=l[p];b=e.getAttribute('id');
|
|
523
|
+
for(let D=0,aa=la.length;D<aa;D++)m=q=la[D],'undefined'!=typeof gina.events[m]&&gina.events[m]==b&&removeListener(gina,e,m),m=b,'undefined'!=typeof gina.events[m]&&gina.events[m]==b&&removeListener(gina,e,m),m=q+'.'+b,'undefined'!=typeof gina.events[m]&&gina.events[m]==b&&removeListener(gina,e,m),m=q+'.'+b,'undefined'!=typeof gina.events[m]&&gina.events[m]==m&&removeListener(gina,e,m),m=q+'.'+b+'.hform','undefined'!=typeof gina.events[m]&&gina.events[m]==b&&removeListener(gina,e,m)}evt=null;h.binded=
|
|
524
|
+
!1;return h},xb=function(l,h){h=h.name;if(!l[h])for(let e in l)if(/^\//.test(e)&&(re=e.match(/\/(.*)\//).pop(),flags=e.replace('/'+re+'/',''),re=re.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),re=new RegExp(re,flags),re.test(h))){l[h]=l[e];break}},yb=function(l,h){var e=null,b=null,q=typeof(0<va.count())?va:w.rules;try{if(l.getAttribute&&l.getAttribute('id'))if(b=l.getAttribute('id'),'undefined'!=typeof w.$forms[b])e=w.$forms[b];else throw Error('form instance `'+b+'` not found');else throw Error('Validator::bindForm($target, customRule): `$target` must be a DOM element\n'+
|
|
525
|
+
err.stack);}catch(fa){throw Error('Validator::bindForm($target, customRule) could not bind form `'+l+'`\n'+fa.stack);}if('undefined'!=typeof e&&e.binded)return!1;console.debug('binding for: '+b);var m=!1,p=null,O='',D=null;'undefined'!=typeof h||'string'==typeof b&&'undefined'!=typeof q[b.replace(/\-|\//g,'.')]?(m=!0,p=h&&'object'==typeof h?h:h&&'string'==typeof h&&'undefined'!=typeof q[h.replace(/\-|\//g,'.')]?Ia(h.replace(/\-|\//g,'.')):Ia(b.replace(/\-|\//g,'.')),e.rules=p,N&&U&&'undefined'!=typeof window.ginaToolbar&&
|
|
526
|
+
window.ginaToolbar&&(gina.forms.rules||(gina.forms.rules={}),objCallback={id:b,rules:e.rules},window.ginaToolbar.update('forms',objCallback))):e.rules={};'undefined'==typeof e.target.dataset.ginaFormLiveCheckEnabled&&0<e.rules.count()?e.target.dataset.ginaFormLiveCheckEnabled=!0:e.target.dataset.ginaFormLiveCheckEnabled='undefined'!=typeof e.target.dataset.ginaFormLiveCheckEnabled?/^true$/i.test(e.target.dataset.ginaFormLiveCheckEnabled)?!0:!1:!1;e.fieldsSet||(e.fieldsSet={});D=null;l.getElementsByTagName('a');
|
|
527
|
+
h=l.getElementsByTagName('input');var aa=l.getElementsByTagName('textarea');D=l.getElementsByTagName('select');var xa={},ba=[],pa={},Ba=null,H={},ka=null,wa=null;for(let fa=0,X=aa.length;fa<X;++fa)xb(e.rules,aa[fa]),wa=aa[fa].getAttribute('id'),wa&&''!=wa||(wa='textareas.'+ha.v4(),aa[fa].setAttribute('id',wa)),e.fieldsSet[wa]||(e.fieldsSet[wa]={id:wa,name:aa[fa].name||null,value:aa[fa].value||'',defaultValue:aa[fa].value||''}),/^true$/i.test(e.target.dataset.ginaFormLiveCheckEnabled)&&bb(e,aa[fa]);
|
|
528
|
+
for(let fa=0,X=h.length;fa<X;++fa){xb(e.rules,h[fa]);wa=h[fa].getAttribute('id');wa&&''!=wa||(wa='input.'+ha.v4(),h[fa].setAttribute('id',wa));e.fieldsSet[wa]||(Ba=h[fa].value,/$(on|true|false)$/i.test(Ba)&&(Ba=/$(on|true)$/i.test(Ba)?!0:!1),e.fieldsSet[wa]={id:wa,name:h[fa].name||null,value:Ba||!/^(checkbox|radio)$/i.test(h[fa].type)?'':h[fa].checked,defaultValue:/^(checkbox|radio)$/i.test(h[fa].type)?h[fa].checked:Ba},/^(checkbox|radio)$/i.test(h[fa].type)&&'undefined'==typeof e.fieldsSet[wa].defaultChecked&&
|
|
529
|
+
(e.fieldsSet[wa].defaultChecked=/^(true|on)$/i.test(h[fa].checked)||/^(true|on)$/.test(Ba)&&/^(checkbox)$/i.test(h[fa].type)?!0:!1,/^radio$/i.test(h[fa].type)&&(e.fieldsSet[wa].value=h[fa].value,e.fieldsSet[wa].defaultValue=h[fa].value)));/^true$/i.test(e.target.dataset.ginaFormLiveCheckEnabled)&&bb(e,h[fa]);if(Ba=h[fa].getAttribute('data-gina-form-element-group'))0>ba.indexOf(Ba)&&ba.push(Ba),ka=h[fa].getAttribute('name')||wa,ka===wa&&h[fa].setAttribute('name',wa),xa[wa]={id:wa,name:ka,group:Ba,
|
|
530
|
+
target:h[fa]},pa[h[fa].name]=new RegExp('^'+Ba.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')),m&&('undefined'==typeof e.rules[h[fa].name]&&(e.rules[h[fa].name]={}),'undefined'!=typeof e.rules[h[fa].name].isRequired&&e.rules[h[fa].name].isRequired||(e.rules[h[fa].name].exclude=!0));if(0<pa.count())for(var Y in pa)h[fa].name!=Y&&(h[fa].getAttribute('data-gina-form-element-group'),pa[Y].test(h[fa].name)&&(h[fa].disabled=!0,'undefined'==typeof H[Y]&&(H[Y]={}),H[Y][h[fa].name]=h[fa]));if(/^file$/i.test(h[fa].type)){wa=
|
|
531
|
+
h[fa].getAttribute('data-gina-form-upload-trigger');wa||(wa=h[fa].id);Ba=null;ka=(new DOMParser).parseFromString(l.innerHTML,'text/html');wa&&(Ba=document.getElementById(wa));aa=document.getElementById(h[fa].id+'-error');Vb(h[fa],aa);if((aa=ka.getElementById(wa+'-preview'))&&Ba&&!/none/i.test(window.getComputedStyle(aa).display)&&!/none/i.test(aa.parentElement.style.display)){ka=0;console.debug('preview is visible ...');Ba.customFiles=[];Ba.form=l;aa=aa.childNodes;for(let ja=0,ta=aa.length;ja<ta;ja++){var oa=
|
|
532
|
+
null;if(/ul/i.test(aa[ja].tagName))for(let Na=0,Va=aa[ja].length;Na<Va;Na++){let fb=$$els[ja];for(let Oa=0,sb=fb.length;Oa<sb;Oa++)/img/i.test(fb[Oa])&&(oa=fb[Oa],oa.setAttribute(''),ka++)}else/img/i.test(aa[ja].tagName)&&(oa=aa[ja],deleteLinkId=wa+'-'+ka+'-delete-trigger',oa=oa.src.substr(oa.src.lastIndexOf('/')+1),Ba.customFiles.push({name:oa,deleteLinkId}),rb('delete',Ba,ka),ka++)}}addListener(gina,h[fa],'change',function(ja){ja.preventDefault();var ta=ja.currentTarget;ja=ta.files;ta.customFiles=
|
|
533
|
+
Array.from(ja);if(!ja.length)return!1;var Na=ta.getAttribute('data-gina-form-upload-action'),Va=ta.getAttribute('name'),fb='gina-upload-'+Va.replace(/\[/g,'-').replace(/\]/g,'-'+e.id);ta.setAttribute('data-gina-form-virtual',fb);var Oa=ta.getAttribute('data-gina-form-upload-on-success'),sb=ta.getAttribute('data-gina-form-upload-on-error'),jb=null;if(0<ja.length){var db=null;if(z()){db=gina.popin.getActivePopin();db.$target=(new DOMParser).parseFromString(db.target.outerHTML,'text/html');db.$target.getElementById(db.id).innerHTML=
|
|
534
|
+
document.getElementById(db.id).innerHTML;var gb=db.$target.getElementById(fb)}else gb=document.getElementById(fb);if(!gb){try{gb=y(fb)||null}catch(Rc){}gb||=z()?db.$target.createElement('form'):document.createElement('form');gb.id=fb;gb.action=Na;gb.enctype='multipart/form-data';gb.method='POST';if('undefined'!=typeof ta.form){Na='files';var pb=ta.getAttribute('data-gina-form-upload-prefix')||ta.name||ta.getAttribute('name'),kb=ta.id||ta.getAttribute('id'),Mb=!1,Eb=ta.getAttribute('data-gina-form-upload-preview')||
|
|
535
|
+
kb+'-preview';Eb=z()?db.$target.getElementById(Eb):document.getElementById(Eb);'undefined'!=typeof Eb&&(Mb=!0);pb&&(Na=pb);pb=[];for(var Ib='name group originalFilename ext encoding size height width location mime preview'.split(' '),Kb=ta.form.getElementsByTagName('INPUT'),Zb,Xb,Dc,fc,Nb=0,Pc=ja.length;Nb<Pc;++Nb){rb('reset',ta,Nb);pb[Nb]=null;Zb=Na+'['+Nb+']';fc=new RegExp('^'+Zb.replace(/\[/g,'\\[').replace(/\]/g,'\\]'));for(var mc=0,Lc=Kb.length;mc<Lc;++mc)Zb=Kb[mc].getAttribute('type'),jb=Kb[mc].getAttribute('data-gina-form-upload-error')||
|
|
536
|
+
kb+'-error'||null,Zb&&/hidden/i.test(Zb)&&(Xb=Kb[mc],Zb=/\[\w+\]$/i.test(Xb.name)?Xb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,''):Xb.name,Dc=/\[\w+\]$/i.test(Xb.name)?Xb.name.match(/\[\w+\]$/)[0].replace(/\[|\]/g,''):Xb.name,Xb&&'undefiend'!=typeof Zb&&-1<Ib.indexOf(Zb)&&fc.test(Xb.name)?(pb[Nb]||(pb[Nb]={}),/\[preview\]/i.test(Xb.name)?('undefined'==typeof pb[Nb].preview&&(pb[Nb].preview={}),pb[Nb].preview[Zb]=Xb):pb[Nb][Zb]=Xb):Xb&&'undefiend'!=typeof Zb&&0>Ib.indexOf(Zb)&&fc.test(Xb.name)&&(pb[Nb]||
|
|
537
|
+
(pb[Nb]={}),/\[preview\]/i.test(Xb.name)?('undefined'==typeof pb[Nb].preview&&(pb[Nb].preview={}),pb[Nb].preview[Dc]=Xb):pb[Nb][Dc]=Xb));fc=0;for(mc=Ib.length;fc<mc;++fc)pb[Nb]||(pb[Nb]={}),'undefined'==typeof pb[Nb][Ib[fc]]&&(Zb=Na+'['+Nb+']['+Ib[fc]+']',$newVirtualField=document.createElement('input'),$newVirtualField.type='hidden',$newVirtualField.id='input.'+ha.v4(),$newVirtualField.name=Zb,$newVirtualField.value='',ta.form.appendChild($newVirtualField),pb[Nb][Ib[fc]]=ta.form[ta.form.length-1])}gb.uploadProperties=
|
|
538
|
+
{id:ta.form.id||ta.getAttribute('id'),uploadTriggerId:ta.id,$form:ta.form,errorField:jb,mandatoryFields:Ib,uploadFields:pb,hasPreviewContainer:Mb,isPopinContext:z()};Mb&&(gb.uploadProperties.previewContainer=Eb)}Oa?gb.setAttribute('data-gina-form-event-on-submit-success',Oa):gb.setAttribute('data-gina-form-event-on-submit-success','onGenericXhrResponse');sb?gb.setAttribute('data-gina-form-event-on-submit-error',sb):gb.setAttribute('data-gina-form-event-on-submit-error','onGenericXhrResponse');z()?
|
|
539
|
+
document.getElementById(db.id).appendChild(gb):document.body.appendChild(gb)}try{var Qc=y(fb),rc=new FormData;ta=null;fb=0;for(var sc=ja.length;fb<sc;++fb)ta=ja[fb],rc.append(Va,ta,ta.name);Qc.send(rc,{withCredentials:!0})}catch(Rc){throw Rc;}}})}}var La=function(fa,X){fa.setAttribute('data-value',fa.value);if(/^(true)$/i.test(X.target.dataset.ginaFormLiveCheckEnabled&&0<X.rules.count())){var ja={},ta={},Na=null;Na=fa.form;ja[event.target.name]=event.target.value;ta[event.target.name]=event.target;
|
|
540
|
+
w.$forms[Na.getAttribute('id')].isValidating=!0;ca(event.target,ja,ta,X.rules,function(Va){w.$forms[Na.getAttribute('id')].isValidating=!1;Va.isValid()?G(Na,{},Va.data,event.target.name):G(Na,Va.error,Va.data,event.target.name);var fb=Na,Oa=Va=null,sb=null;Oa=eb(fb,q);Va=Oa.fields;Oa=Oa.$fields;var jb=fb.getAttribute('id');sb=w.$forms[jb].rules;w.$forms[jb].isValidating=!0;ca(fb,Va,Oa,sb,function(db){w.$forms[jb].isValidating=!1;console.debug('[updateSelect]: onSilentGlobalLiveValidation: '+db.isValid(),
|
|
541
|
+
db);var gb=db.isValid();if(!gb){w.$forms[jb].errors=db.error;for(let pb in db.error)G(fb,db.error,db.data,pb)}Ka(fb,gb);once=!1})})}};Ba=H=null;Y=0;for(pa=D.length;Y<pa;++Y)if(xb(e.rules,D[Y]),wa=D[Y].getAttribute('id'),!wa||!/^gina\-toolbar/.test(wa)){wa&&''!=wa||(wa='select.'+ha.v4(),D[Y].setAttribute('id',wa));if(Ba=D[Y].getAttribute('data-gina-form-element-group'))H=D[Y].getAttribute('name')||wa,H===wa&&D[Y].setAttribute('name',wa),xa[wa]={id:wa,name:H,group:Ba,target:D[Y]};addListener(gina,D[Y],
|
|
542
|
+
'change',function(fa){fa=fa.target;/select/i.test(fa.type)&&La(fa,e)});if(D[Y].options&&!e.fieldsSet[wa]){H=0;if(Ba=D[Y].getAttribute('data-value')||null)for(ka=0,aa=D[Y].options.length;ka<aa;++ka)if(D[Y].options[ka].value==Ba){H=ka;D[Y].selectedIndex=H;break}'undefined'!=typeof D[Y].options[D[Y].selectedIndex]&&D[Y].options[D[Y].selectedIndex].index&&(H=D[Y].options[D[Y].selectedIndex].index);0<D[Y].options.length&&'undefined'!=typeof D[Y].options[H]&&(Ba=D[Y].options[H].value);e.fieldsSet[wa]={id:wa,
|
|
543
|
+
name:D[Y].name||null,value:Ba||null,selectedIndex:H||0};'undefined'!=typeof D[Y].selectedIndex&&-1<D[Y].selectedIndex&&(D[Y].options[H].selected=!0,D[Y].setAttribute('data-value',D[Y].options[H].value))}}var Ta=function(fa,X,ja,ta){'undefined'==typeof ta&&(ta=!1);if('undefined'==typeof xa[fa])throw Error('Radio & Checkbox dependencies not met: you must use the ID attribue of the `master element` as the `data-gina-form-element-group`');var Na=fa.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');fa=xa[fa].target.checked;
|
|
544
|
+
for(let Oa in xa)if(!/radio|checkbox/i.test(xa[Oa].target.type)){var Va=new RegExp(Na);var fb=new RegExp(X);if(Va.test(xa[Oa].group)&&fb.test(xa[Oa].group)||Va.test(xa[Oa].group))xa[Oa].target.disabled=!0,'undefined'==typeof e.rules[xa[Oa].name]&&(e.rules[xa[Oa].name]={}),e.rules[xa[Oa].name].exclude=!0,ta?(xa[Oa].target.disabled=fa?!1:!0,e.rules[xa[Oa].name].exclude=fa?!1:!0):(xa[Oa].target.disabled=ja,e.rules[xa[Oa].name].exclude=ja)}},$a=function(fa,X,ja,ta){'undefined'==typeof ta&&(ta=!1);if(ta&&
|
|
545
|
+
'undefined'!=typeof xa[X.id])return fa=/true/i.test(X.checked)?!1:!0,Ta(X.id,xa[X.id].group,fa,ta);ja=X.name;m&&'undefined'==typeof fa.rules[ja]&&(fa.rules[ja]={});/^true$/i.test(X.checked)?m&&(fa.rules[ja].exclude=!1,'undefined'!=typeof xa[X.id]&&Ta(X.id,xa[X.id].group,!1,ta)):m&&(fa.rules[ja].exclude=!0,'undefined'!=typeof xa[X.id]&&Ta(X.id,xa[X.id].group,!0,ta))},Ab=function(fa,X){'undefined'==typeof X&&(X=!1);var ja=function(Oa,sb,jb){if(sb)$a(e,Oa,sb);else for(let db in xa)if(fb.test(xa[db].group)||
|
|
546
|
+
fb.test(xa[db].target.getAttribute('data-gina-form-element-group')))xa[db].target.disabled=jb};X&&/^(on)$/i.test(fa.value)&&!fa.checked&&(fa.value=!1);var ta=fa.getAttribute('data-value')||fa.getAttribute('value')||fa.value;ta=/^(true|on)$/.test(ta)?!0:ta;''===ta&&(ta=!1);var Na=/^(true|on|false)$/i.test(ta)?!0:!1;X&&Na&&(/^true$/i.test(ta)&&!fa.checked?fa.checked=!0:/^false$/i.test(ta)&&fa.checked&&(fa.checked=!1));ta=fa.checked;var Va=fa.getAttribute('data-gina-form-element-group')||null,fb=new RegExp(fa.id.replace(/\-|_|@|#|\.|\[|\]/g,
|
|
547
|
+
'\\$&'));ta&&'null'!=ta&&'false'!=ta&&''!=ta?(X?Bb(fa):(setTimeout(function(){fa.checked=!0;ja(fa,Va,!1);Bb(fa)},0),fa.setAttribute('checked','checked')),Na&&(fa.value=!0,fa.setAttribute('value',!0),typeof('undefined'!=fa.getAttribute('data-value'))&&fa.setAttribute('data-value',!0))):(X?Bb(fa):setTimeout(function(){fa.checked=!1;ja(fa,Va,!0);Bb(fa)},0),fa.removeAttribute('checked'),Na&&(fa.value=!1,fa.setAttribute('value','false'),typeof('undefined'!=fa.getAttribute('data-value'))&&fa.setAttribute('data-value',
|
|
548
|
+
'false')))},Bb=function(fa){fa=new RegExp(fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(let X in xa)(/checkbox/i.test(xa[X].target.type)&&fa.test(xa[X].group)||/checkbox/i.test(xa[X].target.type)&&fa.test(xa[X].target.getAttribute('data-gina-form-element-group')))&&$a(e,xa[X].target,xa[X].group,!0)},hb=function(fa,X){X=fa.id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');X=new RegExp(X);for(let ja in xa)if(/checkbox|radio/i.test(xa[ja].target.type)||(xa[ja].target.disabled=!0,'undefined'==typeof e.rules[xa[ja].name]&&
|
|
549
|
+
(e.rules[xa[ja].name]={}),e.rules[xa[ja].name].exclude=!0),X.test(xa[ja].group)||X.test(xa[ja].target.getAttribute('data-gina-form-element-group').replace(/\-|_|@|#|\.|\[|\]/g,'\\$&')))xa[ja].target.disabled=!0,'undefined'==typeof e.rules[xa[ja].name]&&(e.rules[xa[ja].name]={}),/^(true|on)$/i.test(fa.checked)?(xa[ja].target.disabled=!1,e.rules[xa[ja].name].exclude=!1):(xa[ja].target.disabled=!0,e.rules[xa[ja].name].exclude=!0);Bb(fa)},Hb=null,Wa=function(fa,X,ja){X='undefined'!=typeof X&&X?!0:!1;
|
|
550
|
+
ja='undefined'!=typeof ja&&ja?!0:!1;var ta=fa.checked,Na=/^(true|false)$/i.test(fa.value);Hb=document.getElementsByName(fa.name);for(let Va=0,fb=Hb.length;Va<fb;++Va)Hb[Va].id!==fa.id&&ta&&(Hb[Va].checked=!1,Hb[Va].removeAttribute('checked'),hb(Hb[Va],!0));X?hb(fa):(ta&&'null'!=ta&&'false'!=ta&&''!=ta?setTimeout(function(){ja?hb(fa):(fa.checked=!1,fa.removeAttribute('checked'))},0):setTimeout(function(){ja?hb(fa):(fa.checked=!0,fa.setAttribute('checked','checked'))},0),Na&&(fa.value=/^true$/.test(fa.value)?
|
|
551
|
+
!0:!1))};Y=0;for(pa=h.length;Y<pa;++Y){D=h[Y].getAttribute('type');if('undefined'==typeof h[Y].id||''==h[Y].id)h[Y].id=D+'-'+ha.v4(),h[Y].setAttribute('id',h[Y].id);if('undefined'!=typeof D&&/^checkbox$/i.test(D)){if(h[Y].disabled&&-1<ba.indexOf(h[Y].id)||!h[Y].checked&&-1<ba.indexOf(h[Y].id)){D=new RegExp(h[Y].id.replace(/\-|_|@|#|\.|\[|\]/g,'\\$&'));for(var cb in xa)D.test(xa[cb].group)&&(xa[cb].target.disabled=!0)}O='change.'+h[Y].id;D=function(fa,X){addListener(gina,fa,X,function(ja){Ab(ja.target);
|
|
552
|
+
triggerEvent(gina,ja.target,'changed.'+ja.target.id)});Ab(fa,!0)};'undefined'!=typeof gina.events[O]&&gina.events[O]==h[Y].id&&removeListener(gina,h[Y],O);D(h[Y],O)}else'undefined'!=typeof D&&/^radio$/i.test(D)&&(O=h[Y].id,D=function(fa,X){addListener(gina,fa,X,function(ja){Wa(ja.target);triggerEvent(gina,ja.target,'changed.'+ja.target.id)});Wa(fa,!0)},'undefined'!=typeof gina.events[O]&&gina.events[O]==h[Y].id&&removeListener(gina,h[Y],O),D(h[Y],O))}O='click';D=function(){var fa=null;fa='reset.'+
|
|
553
|
+
l.id;'undefined'==typeof gina.events[fa]&&addListener(gina,l,fa,function(X){X.preventDefault();var ja=w.$forms[X.currentTarget.id||X.target.id];ja.target.dataset.ginaFormIsResetting=!0;T(ja);X=eb(ja.target,ja.rules,!0);ca(ja.target,X.fields,X.$fields,ja.rules,function(ta){var Na=ta.isValid();console.debug('silent reset validation result[isValid:'+Na+']: ',ta);G(ja.target,{});Ka(ja.target,Na);ja.target.dataset.ginaFormIsResetting=!1})});addListener(gina,l,'reset',function(X){var ja=X.target;if('undefined'!=
|
|
554
|
+
typeof X.defaultPrevented&&X.defaultPrevented)return!1;X.preventDefault();var ta=ja.id;if(!ta)return!1;/^reset\./.test(ta)||(ta='reset.'+ja.id);gina.events[ta]&&triggerEvent(gina,ja,ta,X.detail)});addListener(gina,l,'keydown',function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;P[X.keyCode]='keydown'==X.type;var ta=ja.id;if(!ta)return!1;/^keydown\./.test(ta)||(ta='keydown.'+ja.id);gina.events[ta]&&(cancelEvent(X),triggerEvent(gina,ja,ta,X.detail,X))});
|
|
555
|
+
addListener(gina,l,'keyup',function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;P[X.keyCode]&&delete P[X.keyCode];var ta=ja.id;if(!ta)return!1;/^keyup\./.test(ta)||(ta='keyup.'+ja.id);gina.events[ta]&&(cancelEvent(X),triggerEvent(gina,ja,ta,X.detail,X))});addListener(gina,l,'focusin',function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;var ta=ja.id;if(!ta)return!1;/^focusin\./.test(ta)||(ta='focusin.'+ja.id);
|
|
556
|
+
if(gina.events[ta]){cancelEvent(X);var Na=X.target.form.getAttribute('id')||X.currentTarget.getAttribute('id'),Va={id:ja.id,name:ja.name};w.$forms[Na].lastFocused.length?w.$forms[Na].lastFocused.splice(0,0,Va):w.$forms[Na].lastFocused[0]=Va;w.$forms[Na].lastFocused.splice(2);triggerEvent(gina,ja,ta,X.detail)}});addListener(gina,l,'focusout',function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;var ta=ja.id;if(!ta)return!1;/^focusout\./.test(ta)||(ta='focusout.'+
|
|
557
|
+
ja.id);gina.events[ta]&&(cancelEvent(X),triggerEvent(gina,ja,ta,X.detail))});addListener(gina,l,'change',function(X){var ja=X.target;if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;var ta=ja.id;if(!ta)return!1;/^change\./.test(ta)||(ta='change.'+ja.id);gina.events[ta]&&(cancelEvent(X),triggerEvent(gina,ja,ta,X.detail))});addListener(gina,l,'click',function(X){var ja=X.target,ta=!1,Na=!1;if(/(label)/i.test(X.target.tagName)&&'undefined'!=typeof X.target.control&&null!=X.target.control&&
|
|
558
|
+
/(checkbox|radio)/i.test(X.target.control.type)||/(label)/i.test(X.target.parentNode.tagName)&&'undefined'!=typeof X.target.parentNode.control&&null!=X.target.parentNode.control&&/(checkbox|radio)/i.test(X.target.parentNode.control.type))Na=X.target.getAttribute('for')||X.target.parentNode.getAttribute('for')?!0:!1,ja=X.target.control||X.target.parentNode.control;if(!ja.disabled&&/(checkbox|radio)/i.test(ja.type)&&!Na){if(/checkbox/i.test(ja.type))return Ab(ja);if(/radio/i.test(ja.type))return Wa(ja,
|
|
559
|
+
!1,!0)}if(/(button|input)/i.test(ja.tagName)&&/(submit|checkbox|radio)/i.test(ja.type)||/a/i.test(ja.tagName)&&ja.attributes.getNamedItem('data-gina-form-submit')||/a/i.test(ja.parentNode.tagName)&&ja.parentNode.attributes.getNamedItem('data-gina-form-submit')){Na=ja.attributes.getNamedItem('data-gina-form-submit');var Va=ja.parentNode.attributes.getNamedItem('data-gina-form-submit');if(Na||Va)ta=!0,(Va=Na?ja.getAttribute('data-gina-form-submit-method')||X.currentTarget.getAttribute('method'):ja.parentNode.getAttribute('data-gina-form-submit-method')||
|
|
560
|
+
X.currentTarget.getAttribute('method'))&&(Na&&ja.form?ja.form.setAttribute?ja.form.setAttribute('method',Va):X.currentTarget.setAttribute('method',Va):ja.parentNode.form&&(ja.parentNode.form.setAttribute?ja.parentNode.form.setAttribute('method',Va):X.currentTarget.setAttribute('method',Va)));'undefined'!=typeof ja.id&&ja.getAttribute('id')||ja.setAttribute('id','click.'+ha.v4());ja.id=ja.getAttribute('id');if(/^click\./.test(ja.id)||m){Na=ja.id;if(!Na)return!1;/^click\./.test(Na)||(Na=ja.id);if(!ja.disabled&&
|
|
561
|
+
/(checkbox|radio)/i.test(ja.type)){if(/checkbox/i.test(ja.type))return Ab(ja);if(/radio/i.test(ja.type))return Wa(ja,!1,!0)}if('undefined'!=typeof X.defaultPrevented&&X.defaultPrevented)return!1;if('submit'==ja.type&&!/^submit\./i.test(Na)||ta&&!/^submit\./i.test(Na))Na='submit.'+Na;'reset'!=ja.type||/^reset\./i.test(Na)||(Na='reset.'+Na);gina.events[Na]?(cancelEvent(X),triggerEvent(gina,ja,Na,X.detail)):ta&&'undefined'!=typeof this.id&&''!=this.id&&'undefined'!=typeof gina.validator.$forms[this.id]&&
|
|
562
|
+
(gina.validator.getFormById(this.id).submit(),cancelEvent(X))}}})};D();O='validate.'+b;D=function(){addListener(gina,l,O,function(fa){cancelEvent(fa);var X=e.eventData.error||e.eventData.validation||fa.detail;G(fa.target,X.fields||X.error,X.data);fa=fa.target.getAttribute('id');if('undefined'!=typeof X.isValid&&X.isValid()){var ja=w.$forms[fa].target.getAttribute('data-gina-form-inherits-data')||null;ja&&(X.data=R(X.data,JSON.parse(decodeURIComponent(ja))));w.$forms[fa]?w.$forms[fa].send(X.data):
|
|
563
|
+
e&&e.send(X.data)}})};'undefined'!=typeof gina.events[O]&&gina.events[O]=='validate.'+b&&removeListener(gina,e,O,D);D();cb=function(fa,X){/^submit\./i.test(fa)||(fa='submit.'+fa);addListener(gina,X,fa,function(ja){cancelEvent(ja);var ta={};ja={_length:0};var Na=l.getAttribute('id'),Va='undefined'!=typeof w.$forms[Na]?w.$forms[Na].rules:null;w.$forms[Na].sent||(ta=eb(l,Va),ja=ta.fields,ta=ta.$fields,Va=w.$forms[Na].rules,0==ja._length?(delete ja._length,ja={error:[],isValid:function(){return!0},data:Ha(ja)},
|
|
564
|
+
triggerEvent(gina,l,'validate.'+b,ja)):(b=l.getAttribute('id'),p=(Va=l.getAttribute('data-gina-form-rule'))?Ia(Va.replace(/\-|\//g,'.')):Ia(b.replace(/\-/g,'.')),w.$forms[Na].isSubmitting=!0,w.$forms[Na].isSending=!1,ca(l,ja,ta,p,function(fb){triggerEvent(gina,l,'validate.'+b,fb)})))})};ba=null;h=[];ba=[];D=null;ba=l.getElementsByTagName('button');if(0<ba.length)for(let fa=0,X=ba.length;fa<X;++fa)'submit'==ba[fa].type&&h.push(ba[fa]);ba=l.getElementsByTagName('a');if(0<ba.length)for(let fa=0,X=ba.length;fa<
|
|
565
|
+
X;++fa)ba[fa].attributes.getNamedItem('data-gina-form-submit')?h.push(ba[fa]):ba[fa].getAttribute('id')||/gina\-popin/.test(ba[fa].className)||gina.popinIsBinded||/gina\-link/.test(ba[fa].className)||(D='link.'+ha.v4(),ba[fa].id=D);D=null;Y=!1;for(let fa=0,X=h.length;fa<X;++fa){ba=h[fa];if(/button/i.test(ba.tagName)&&'undefined'!=typeof ba.type&&/submit/i.test(ba.type)||/a/i.test(ba.tagName)&&'undefined'!=typeof ba.dataset.ginaFormSubmit&&/^true$/i.test(ba.dataset.ginaFormSubmit)||/a/i.test(ba.parentNode.tagName)&&
|
|
566
|
+
'undefined'!=typeof ba.parentNode.dataset.ginaFormSubmit&&/^true$/i.test(ba.parentNode.dataset.ginaFormSubmit)){/a/i.test(ba.parentNode.tagName)&&(ba=ba.parentNode);if('undefined'==typeof ba.id||'undefined'!=typeof ba.id&&''==ba.id)ba.id='click.'+ha.v4(),ba.setAttribute('id',ba.id);/a/i.test(ba.tagName)&&'undefined'==typeof ba.form&&(ba.form={id:e.id});'undefined'==typeof ba.dataset.ginaFormSubmitTriggerFor&&'undefined'!=typeof w.$forms[e.id]&&'undefined'==typeof w.$forms[e.id].submitTrigger&&'undefined'!=
|
|
567
|
+
typeof ba.form.id&&e.id==ba.form.id&&(console.debug('attching submitTrigger: '+ba.id,' form id: '+e.id),w.$forms[e.id].submitTrigger=e.submitTrigger=ba.id||ba.getAttribute('id'),ba.dataset.ginaFormSubmitTriggerFor=e.id)}'A'==ba.tagName&&(D=ba.getAttribute('onclick'),Y=ba.getAttribute('data-gina-form-submit'),D||Y?/return false/i.test(D)||Y||(D=/;$/.test(D)?D+'return false;':D+'; return false;'):ba.setAttribute('onclick','return false;'));ba.id?O=ba.id:(O='click.'+ha.v4(),ba.id=O,ba.setAttribute('id',
|
|
568
|
+
O));'undefined'!=typeof gina.events[O]&&gina.events[O]==ba.id||cb(O,ba)}O='submit';addListener(gina,l,O,function(fa){var X=fa.target,ja=X.getAttribute('id'),ta=w.$forms[ja],Na=e.binded;(ta=(new DOMParser).parseFromString(X.innerHTML,'text/html').getElementById(ta.submitTrigger))&&ta.disabled&&cancelEvent(fa);if('undefined'!=typeof fa.defaultPrevented&&fa.defaultPrevented)return!1;(m||Na)&&cancelEvent(fa);fa={};Na={_length:0};ta='undefined'!=typeof gina.validator.$forms[ja]?gina.validator.$forms[ja].rules:
|
|
569
|
+
null;for(var Va=null,fb=null,Oa=0,sb=X.length;Oa<sb;++Oa)Va=X[Oa].getAttribute('name'),fb=X[Oa].disabled||X[Oa].getAttribute('disabled'),fb=/disabled|true/i.test(fb)?!0:!1,Va&&!fb&&('undefined'!=typeof X[Oa].type&&'radio'==X[Oa].type||'undefined'!=typeof X[Oa].type&&'checkbox'==X[Oa].type?X[Oa].checked?/^(true|false)$/.test(X[Oa].value)?Na[Va]=X[Oa].value=/^true$/.test(X[Oa].value)?!0:!1:Na[Va]=X[Oa].value:ta&&'undefined'!=typeof ta[Va]&&'undefined'!=typeof ta[Va].isBoolean&&'checkbox'==X[Oa].type&&
|
|
570
|
+
!/^(true|false)$/.test(X[Oa].value)&&(Na[Va]=!1):Na[Va]=X[Oa].value,fa[Va]=X[Oa],fa[Va].setAttribute('data-gina-form-errors',''));Na._length=Na.count();0==Na._length?(delete Na._length,fa={error:[],isValid:function(){return!0},data:Ha(Na)},'undefined'!=typeof gina.events['submit.'+ja]?triggerEvent(gina,X,'submit.'+ja,fa):triggerEvent(gina,X,'validate.'+ja,fa)):(p=(ta=X.getAttribute('data-gina-form-rule'))?Ia(ta.replace(/\-|\//g,'.')):Ia(ja.replace(/\-/g,'.')),w.$forms[ja].isValidating=!0,ca(X,Na,
|
|
571
|
+
fa,p,function(jb){w.$forms[ja].isValidating=!1;'undefined'!=typeof gina.events['submit.'+ja]?triggerEvent(gina,X,'submit.'+ja,jb):triggerEvent(gina,X,'validate.'+ja,jb)}))});w.$forms[b].binded=!0;/^(true)$/i.test(e.target.dataset.ginaFormLiveCheckEnabled&&0<e.rules.count())?(console.debug('silent validation mode on'),cb=eb(e.target,e.rules),ca(e.target,cb.fields,cb.$fields,e.rules,function(fa){console.debug('silent validation result[isValid:'+fa.isValid()+']: ',fa);N&&U&&'undefined'!=typeof window.ginaToolbar&&
|
|
572
|
+
window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:b,errors:fa.error}));Ka(e,fa.isValid())})):/^(true)$/i.test(e.target.dataset.ginaFormLiveCheckEnabled)||Ka(e,!0)},Ka=function(l,h){$formInstance=null;l instanceof HTMLFormElement?(l=l.getAttribute('id'),$formInstance=w.$forms[l]):$formInstance=l;'undefined'==typeof $formInstance.submitTrigger?console.warn('This might be normal, so do not worry if this form is handled by your javascript: `'+$formInstance.id+
|
|
573
|
+
'`\nGina could not complete `updateSubmitTriggerState()`: `submitTrigger` might not be attached to form instance `'+$formInstance.id+'`\nTo disable this warning, You just need to disable `Form Live Checking on your form by adding to your <form>: `data-gina-form-live-check-enabled=false``'):document.getElementById($formInstance.submitTrigger)&&(/true/i.test(h)?document.getElementById($formInstance.submitTrigger).disabled=!1:document.getElementById($formInstance.submitTrigger).disabled=!0)},eb=function(l,
|
|
574
|
+
h,e){'undefined'==typeof e&&(e=!1);var b={},q={},m=l.id||l.getAttribute('id');'undefined'==typeof h&&(h='undefined'!=typeof w.$forms[m].rules&&0<w.$forms[m].rules.count()?w.$forms[m].rules:null,h||'undefined'==typeof gina.validator.$forms[m]||(h=gina.validator.$forms[m].rules));for(var p=0,O=l.length;p<O;++p){if(e)switch(l[p].tagName.toLowerCase()){case 'input':/^(hidden|text)$/i.test(l[p].type)&&(l[p].value=l[p].defaultValue)}if(/button/i.test(l[p].tagName)&&'undefined'!=typeof l[p].type&&/submit/i.test(l[p].type)||
|
|
575
|
+
/a/i.test(l[p].tagName)&&'undefined'!=typeof l[p].dataset.ginaFormSubmit&&/^true$/i.test(l[p].dataset.ginaFormSubmit))/a/i.test(l[p].tagName)&&'undefined'==typeof l[p].form&&(l[p].form={id:m}),'undefined'==typeof l[p].dataset.ginaFormSubmitTriggerFor&&'undefined'!=typeof w.$forms[m]&&'undefined'==typeof w.$forms[m].submitTrigger&&'undefined'!=typeof l[p].form.id&&m==l[p].form.id&&(w.$forms[m].submitTrigger=l[p].id||l[p].getAttribute('id'),l[p].dataset.ginaFormSubmitTriggerFor=m);var D=l[p].getAttribute('name');
|
|
576
|
+
var aa=l[p].disabled||l[p].getAttribute('disabled');aa=/disabled|true/i.test(aa)?!0:!1;if(D&&!aa){if('undefined'!=typeof l[p].type&&'radio'==l[p].type||'undefined'!=typeof l[p].type&&'checkbox'==l[p].type)if(l[p].checked||'undefined'==typeof h[D]&&'undefined'!=l[p].value&&/^(true|false)$/.test(l[p].value)||!l[p].checked&&'undefined'!=typeof h[D]&&'undefined'!=typeof h[D].isBoolean&&/^(true|false)$/.test(l[p].value))if(/^(true|false)$/.test(l[p].value))if('undefined'==typeof h[D]?h[D]={isBoolean:!0}:
|
|
577
|
+
'undefined'!=typeof h[D]&&'undefined'==typeof h[D].isBoolean&&(h[D].isBoolean=!0,h[D].isRequired=!0),'radio'==l[p].type){if('undefined'==typeof h[D])throw Error('rule '+D+' is not defined');/^true$/.test(h[D].isBoolean)&&l[p].checked&&(q[D]=/^true$/.test(l[p].value)?!0:!1)}else q[D]=l[p].value=/^true$/.test(l[p].value)?!0:!1;else q[D]=l[p].value;else h&&'undefined'!=typeof h[D]&&'undefined'!=typeof h[D].isBoolean&&'undefined'!=typeof h[D].isRequired&&!/^(true|false)$/.test(l[p].value)&&(q[D]=!1);
|
|
578
|
+
else q[D]=l[p].value;'undefined'==typeof b[D]&&(b[D]=l[p],b[D].setAttribute('data-gina-form-errors',''))}}q._length=q.count()||0;return{$fields:b,fields:q,rules:h}},Gb=function(l,h,e,b){return'undefined'==typeof l[e]||/^(null|NaN|undefined|\s*)$/i.test(h[e])?h[e]:'undefined'!=typeof l[e].isNumber||'undefined'!=typeof l[e].isInteger||'undefined'!=typeof l[e].isFloat||'undefined'!=typeof l[e].toFloat||'undefined'!=typeof l[e].toInteger?(/,/.test(h[e])&&(h[e]=h[e].replace(/,/g,'.').replace(/\s+/g,'')),
|
|
579
|
+
h[e]):'boolean'==typeof h[e]?h[e]:l[e].isBoolean?/^true$/i.test(h[e])?!0:!1:'undefined'!=typeof b&&/^true$/i.test(b)?'\\"'+h[e]+'\\"':h[e]},Ub=function(l,h){'string'!=typeof l&&(l=JSON.stringify(JSON.clone(l)));l=JSON.parse(l.replace(/"(true|false)"/gi,'$1'));for(let e in h)h[e]=Gb(l,h,e);return h},pc=function(l,h,e,b){var q=JSON.parse(l.replace(/"(true|false)"/gi,'$1')),m=JSON.stringify(q);b&&(h=e[Object.getOwnPropertyNames(e)[0]].form,e=eb(h,q),delete e.fields._length,h=e.fields,e=e.$fields);b=
|
|
580
|
+
[];var p=0;for(O in h)b[p]=O,p++;b.sort().reverse();for(let aa=0,xa=b.length;aa<xa;aa++){var O=b[aa].replace(/\-|_|@|#|\.|\[|\]/g,'\\$&');O=new RegExp('\\$'+O,'g');p='\\"'+h[b[aa]]+'\\"';var D=O.test(m);D&&'undefined'!=typeof q[b[aa]]?p=Gb(q,h,b[aa],!0):D&&console.warn('`'+b[aa]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+b[aa]+'` to `string`.');l=l.replace(O,p)}if(/\$(.*)/.test(l))for(let aa=0,xa=b.length;aa<xa;aa++)O=b[aa].replace(/\-|_|@|#|\.|\[|\]/g,
|
|
581
|
+
'\\$&'),O=new RegExp('\\$'+O,'g'),p=''!=e[b[aa]].value?'\\"'+e[b[aa]].value+'\\"':'\\"\\"',(D=O.test(m))&&'undefined'!=typeof q[b[aa]]?p=Gb(q,h,b[aa],!0):D&&console.warn('`'+b[aa]+'` is used in a dynamic rule without definition. This could lead to an evaluation error. Casting `'+b[aa]+'` to `string`.'),l=l.replace(O,p||e[b[aa]].checked);return JSON.parse(l)},ca=function(l,h,e,b,q){delete h._length;var m=JSON.stringify(b);h=Ub(m,h);/\$(.*)/.test(m)&&(b=!/^form$/i.test(l.tagName)&&1==e.count()&&/true/i.test(l.form.dataset.ginaFormLiveCheckEnabled)?
|
|
582
|
+
!0:!1,b=pc(m,h,e,b));var p=null,O=m=null,D=!1,aa=0;h.count();var xa=!1,ba=null,pa=null,Ba=null,H=0,ka=null,wa=null,Y=null,oa=function(Wa,cb,fa){if('undefined'==typeof cb[Wa]){skipTest=!1;for(var X in cb)if(!/^_comment$/i.test(X)&&/^\//.test(X)&&(ka=X.match(/\/(.*)\//).pop(),wa=X.replace('/'+ka+'/',''),ka=ka.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),ka=new RegExp(ka,wa),ka.test(Wa))){skipTest=!0;cb[Wa]=cb[X];break}if('undefined'==typeof cb[Wa])return}var ja=Object.getOwnPropertyNames(cb)||[];X=0;var ta=
|
|
583
|
+
ja.length;if(0<ta)for(;X<ta;)'undefined'!=typeof cb[ja[X]].exclude&&/^true$/i.test(cb[ja[X]].exclude)&&(ja.splice(X,1),ta--,X--),X++;for(var Na in cb[Wa])if('function'==typeof La[Wa][Na]){/^((is)\d+|is$)/.test(Na)&&'undefined'==typeof La[Wa][Na]&&(La[Wa][Na]=function(){},La[Wa][Na]=S(La[Wa][Na],La[Wa][Na.replace(/\d+/,'')]),La[Wa][Na].setAlias=function(jb){this._currentValidatorAlias=jb}(Na));try{if(Array.isArray(cb[Wa][Na])){Y=JSON.clone(cb[Wa][Na]);if(/\$[\-\w\[\]]*/.test(Y[0])){var Va=Y[0].match(/\$[\-\w\[\]]*/g);
|
|
584
|
+
X=0;for(var fb=Va.length;X<fb;++X)Y[0]=Y[0].replace(Va[X],La[Va[X].replace('$','')].value)}La[Wa][Na].apply(La[Wa],Y)}else if(/^query$/.test(Na)){ba=e[Wa];pa=ba.getAttribute('id');Ba='asyncCompleted.'+pa;var Oa=0,sb=!1;if('undefined'!=typeof gina.events[Ba]){console.debug('event `'+Ba+'` already added');H=0;break}++H;addListener(gina,ba,Ba,function(jb){jb.preventDefault();Oa++;--H;var db=Object.getOwnPropertyNames(cb[Wa]);db[db.length-1]==Na&&(xa=!0);db='asyncCompleted.'+jb.target.getAttribute('id');
|
|
585
|
+
if(!/true/.test(sb)){La[Wa]=jb.detail;var gb=l;/^form$/i.test(l.tagName)||(gb=l.form);var pb=gb.getAttribute('id'),kb=null;if(xa&&0>=H&&!sb){sb=!0;removeListener(gina,jb.target,db);q._data=La.toData();q._errors=La.getErrors(Wa);kb=0<q._errors.count()?!1:!0;console.debug('[A] query callback triggered ',q._errors,'isFormValid: '+kb,'\nisValidating: '+w.$forms[pb].isValidating);q._errors&&('undefined'==typeof w.$forms[pb].errors&&(w.$forms[pb].errors={}),w.$forms[pb].errors[Wa]=q._errors[Wa]);if(!kb&&
|
|
586
|
+
/^true|false$/i.test(w.$forms[pb].isValidating)||''!=La[Wa].target.value)console.debug('[A] Refreshing warning/error on field '+Wa),x(Bb[Wa]),G(gb,q._errors,q._data,Wa),Ka(gb,kb);N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:pb,errors:w.$forms[pb].errors||{}}));triggerEvent(gina,gb,'validated.'+pb,q)}else jb=!1,1==ja.length||ja[ja.length-1]==Wa?(kb=0<q._errors.count()?!1:!0,!kb&&/^true|false$/i.test(w.$forms[pb].isValidating)&&
|
|
587
|
+
(console.debug('[1] Should update error display now ',q._errors),w.$forms[pb].errors=R(q._errors,w.$forms[pb].errors),console.debug('[2] Should update error display now ',w.$forms[pb].errors),x(Bb[Wa]),G(gb,q._errors,q._data,Wa),Ka(gb,kb)),triggerEvent(gina,gb,'validated.'+pb,q)):/^true$/i.test(w.$forms[pb].isValidating)&&1<ja.length&&ja[ja.length-1]!=Wa&&(jb=!0),jb&&ca(gb,Ab,Bb,cb,function(Mb){w.$forms[pb].isValidating=!1;kb=Mb.isValid();N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&
|
|
588
|
+
(gina.forms.errors||(gina.forms.errors={}),window.ginaToolbar.update('forms',{id:pb,errors:Mb.error||{}}));G(gb,Mb.error,Mb.data,Wa);Ka(gb,kb)})}});La[Wa][Na](cb[Wa][Na]);continue}else La[Wa][Na](cb[Wa][Na]);delete fa[Wa]}catch(jb){if('conditions'==Na)throw Error('[ ginaFormValidator ] could not evaluate `'+Wa+'->'+Na+'()` where `conditions` must be a `collection` (Array)\nStack:\n'+jb);throw Error('[ ginaFormValidator ] could not evaluate `'+Wa+'->'+Na+'()`\nStack:\n'+jb);}}},La=null,Ta={},$a=!1;
|
|
589
|
+
U?/^form$/i.test(l.tagName)?(p=l.getAttribute('id'),m='validated.'+p,w.$forms[p].fields=h,'undefined'!=typeof l.eventData&&'undefined'!=typeof l.eventData.error&&delete l.eventData.error,La=new v(h,e,A)):($a=!0,p=l.form.getAttribute('id')||l.form.target.getAttribute('id'),m='validated.'+p,w.$forms[p].fields=h,La=new v(h,e,A,w.$forms[p].fieldsSet)):La=new v(h,null,A);var Ab=null,Bb=null;if($a){$a=l.form.getAttribute('id');var hb=eb(w.$forms[$a].target,w.$forms[$a].rules,!1);Ab=Ub(JSON.stringify(w.$forms[$a].rules),
|
|
590
|
+
JSON.clone(hb.fields));Bb=hb.$fields}else Ab=JSON.clone(h),Bb=e;$a='undefined'!=typeof b?JSON.clone(b):{};var Hb=function(Wa,cb,fa,X,ja,ta,Na,Va){var fb=null;if('undefined'!=typeof ta)for(var Oa in X){var sb=ja[Oa].getAttribute('type');if(U&&'undefined'==typeof ja[Oa])console.warn('field `'+Oa+'` found for your form rule ('+Wa.id+'), but not found in $field collection.\nPlease, check your HTML or remove `'+Oa+'` declaration from your rule if this is a mistake.');else{U&&ja[Oa].getAttribute('data-gina-form-element-group')&&
|
|
591
|
+
'undefined'!=typeof ta[Oa]&&'undefined'!=typeof ta[Oa].exclude&&ta[Oa].exclude&&!ja[Oa].disabled&&(ta[Oa].exclude=!1);var jb='undefined'!=typeof ta['_case_'+Oa]?!0:!1;if(U&&'input'==ja[Oa].tagName.toLowerCase()&&/^(checkbox)$/i.test(sb))if(!ja[Oa].checked&&'undefined'!=typeof ta[Oa]&&'undefined'!=typeof ta[Oa].isRequired&&/^(false)$/i.test(ta[Oa].isRequired)||ja[Oa].disabled)ta[Oa]={exclude:!0};else{if(!ja[Oa].checked&&'undefined'==typeof ta[Oa])continue}else U&&'input'==ja[Oa].tagName.toLowerCase()&&
|
|
592
|
+
/^(radio)$/i.test(sb)&&console.debug('Radio: ',ja[Oa].id,ja[Oa].checked,ja[Oa].value);for(var db in ta)if(/^_case_/.test(db)&&'undefined'!=typeof ta[db].conditions&&(!Array.isArray(ta[db].conditions)||ta[db].conditions.length)&&'undefined'!=typeof ta[db].conditions[0].rules&&'undefined'!=typeof ta[db].conditions&&Array.isArray(ta[db].conditions))if(fb=db.replace('_case_',''),'undefined'==typeof Bb[fb])console.warn('Found case `'+db+'` but field `'+fb+'` is misssing in the dom.\n You should add `'+
|
|
593
|
+
fb+'` element to your form in order to allow Validator to process this case.');else{'undefined'==typeof cb[fb]&&(cb[fb]=Bb[fb].value);sb=cb[fb];U&&('true'==X[Oa]?sb=!0:'false'==X[Oa]&&(sb=!1));for(var gb=0,pb=ta[db].conditions.length;gb<pb;++gb)if(!(Array.isArray(ta[db].conditions[gb].case)&&-1==ta[db].conditions[gb].case.indexOf(sb)||!Array.isArray(ta[db].conditions[gb].case)&&ta[db].conditions[gb].case!=sb))for(var kb in ta[db].conditions[gb].rules)if(!/^_comment$/i.test(kb)&&kb!=fb&&ja[kb])if(Oa==
|
|
594
|
+
kb||/^\//.test(kb)||'undefined'!=typeof X[kb]||'undefined'==typeof cb[kb])if(/^\//.test(kb)){if(ka=kb.match(/\/(.*)\//).pop(),wa=kb.replace('/'+ka+'/',''),ka=ka.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),ka=new RegExp(ka,wa),ka.test(Oa)){if(ta[db].conditions[gb].case==sb||/^\//.test(ta[db].conditions[gb].case)&&(new RegExp(ta[db].conditions[gb].case)).test(sb))Mb='undefined'!=typeof ta[kb]?ta[kb]:{},ta[kb]=R(ta[db].conditions[gb].rules[kb],Mb);fb!=kb&&'undefined'!=typeof ta[kb]&&oa(kb,ta,X)}}else'undefined'!=
|
|
595
|
+
typeof ta[db].conditions[gb].rules[kb]&&(caseField=kb,sb=X[caseField],'undefined'==typeof ja[caseField]?console.warn('ignoring case `'+caseField+'`: field `NaN'):(U&&/^(true|false)$/i.test(sb)&&'undefined'!=typeof ta[caseField]&&'undefined'!=typeof ta[caseField].isBoolean&&/^(true)$/i.test(ta[caseField].isBoolean)&&(sb=/^(true)$/i.test(sb)?!0:!1),'undefined'!=typeof ta[db].conditions[gb].rules[kb]&&(Mb='undefined'!=typeof ta[db].conditions[gb].rules[kb]?ta[db].conditions[gb].rules[kb]:{},ta[kb]=Mb),
|
|
596
|
+
fb!=kb&&'undefined'!=typeof ta[kb]&&'undefined'!=typeof X[kb]&&oa(kb,ta,X)));else{X[kb]=cb[kb];var Mb='undefined'!=typeof ta[kb]?ta[kb]:{};ta[kb]=R(ta[db].conditions[gb].rules[kb],Mb);oa(kb,ta,X)}}if(fb!=Oa&&('undefined'!=typeof ta[Oa]&&oa(Oa,ta,cb),jb)){++Va;jb=ta['_case_'+Oa].conditions;if(!jb)throw Error('[ ginaFormValidator ] case `_case_'+Oa+'` found without `condition(s)` !\nPlease, check your delcaration for `_case_'+Oa+'`');for(let Kb=0,Zb=jb.length;Kb<Zb;++Kb)if(sb=cb[Oa],U&&('true'==X[Oa]?
|
|
597
|
+
sb=!0:'false'==X[Oa]&&(sb=!1)),jb[Kb]['case']===sb||Array.isArray(jb[Kb]['case'])&&-1<jb[Kb]['case'].indexOf(sb)||/^\//.test(jb[Kb]['case'])){Mb={};if('undefined'==typeof jb[Kb].rules[Oa]&&'undefined'==typeof cb[Oa]||ja[Oa].disabled)jb[Kb].rules[Oa]={exclude:!0};for(var Eb in jb[Kb].rules)if(!/^_comment$/i.test(Eb))if(/^\//.test(Eb)){ka=Eb.match(/\/(.*)\//).pop();wa=Eb.replace('/'+ka+'/','');ka=ka.replace(/\[/g,'\\[').replace(/\]/g,'\\]');ka=new RegExp(ka,wa);for(var Ib in ja)ka.test(Ib)&&(/^\//.test(jb[Kb]['case'])?
|
|
598
|
+
(ka=jb[Kb]['case'].match(/\/(.*)\//).pop(),wa=jb[Kb]['case'].replace('/'+ka+'/',''),ka=new RegExp(ka,wa),ka.test(sb)&&(Mb[Ib]=jb[Kb].rules[Eb])):Mb[Ib]=jb[Kb].rules[Eb],'undefined'==typeof X[Ib]&&'undefined'!=typeof ja[Ib]&&'undefined'!=typeof ja[Ib].value&&(X[Ib]=ja[Ib].value,U&&/(true|false)/i.test(X[Ib])&&('true'==X[Ib]?X[Ib]=!0:'false'==X[Ib]&&(X[Ib]=!1)),La.addField(Ib,X[Ib]),'undefined'!=typeof fa[Ib]&&(Mb[Ib]=R(Mb[Ib],fa[Ib]))))}else/^\//.test(jb[Kb]['case'])?(ka=jb[Kb]['case'].match(/\/(.*)\//).pop(),
|
|
599
|
+
wa=jb[Kb]['case'].replace('/'+ka+'/',''),ka=ka.replace(/\[/g,'\\[').replace(/\]/g,'\\]'),ka=new RegExp(ka,wa),ka.test(sb)&&(Mb[Eb]=jb[Kb].rules[Eb])):Mb[Eb]=jb[Kb].rules[Eb],'undefined'==typeof X[Eb]&&'undefined'!=typeof ja[Eb]&&'undefined'!=typeof ja[Eb].value&&(X[Eb]=ja[Eb].value,U&&/(true|false)/i.test(X[Eb])&&('true'==X[Eb]?X[Eb]=!0:'false'==X[Eb]&&(X[Eb]=!1)),La.addField(Eb,X[Eb]),'undefined'!=typeof fa[Eb]&&(Mb[Eb]=R(Mb[Eb],fa[Eb])));++aa;if(U)Hb(Wa,cb,fa,X,ja,Mb,Na,Va);else return Hb(Wa,cb,
|
|
600
|
+
fa,X,ja,Mb,Na,Va)}--Va}}}--aa;if(0>=Va&&0>aa){cb=La.getErrors();for(Oa in cb){for(rule in cb[Oa])Ta[Oa]||(Ta[Oa]=''),0>Ta[Oa].indexOf(rule)&&(Ta[Oa]+=rule+' ');U&&ja[Oa].setAttribute('data-gina-form-errors',Ta[Oa].substr(0,Ta[Oa].length-1))}try{O=Ha(La.toData()),N&&U&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&(gina.forms.validated||(gina.forms.validated={}),gina.forms.validated[p]||(gina.forms.validated[p]={}),window.ginaToolbar.update('forms',{id:p,validated:O}))}catch(Kb){throw Kb;
|
|
601
|
+
}xa=!0;if(!D&&0>=H)if('undefined'!=typeof Na&&'function'===typeof Na)Na._errors=La.getErrors(),Na._data=La.toData(),triggerEvent(gina,Wa,'validated.'+p,Na);else return D=!0,{isValid:La.isValid,error:cb,data:O}}};U&&addListener(gina,l,m,function(Wa){Wa.preventDefault();if(!D){D=!0;xa=!1;H=0;var cb=Wa.detail,fa=cb._data||La.toData(),X=cb._errors||La.getErrors()||null;console.debug('instance errors: ',w.$forms[p].errors,' VS cbErrors: ',X,La.isValid(),' VS d.getErrors(): ',La.getErrors());0<X.count()&&
|
|
602
|
+
La.isValid()&&(La.isValid=function(){return!1});cb({isValid:La.isValid,error:X,data:Ha(fa)});removeListener(gina,Wa.target,'validated.'+Wa.target.id)}});if(U)Hb(l,Ab,$a,h,e,b,q,0);else return Hb(l,Ab,$a,h,e,b,q,0)};return U?Qa(B):E(B,Q,V)}'undefined'!==typeof module&&module.exports?module.exports=ValidatorPlugin:'function'===typeof define&&define.amd&&define('gina/validator',['utils/events','utils/dom','utils/effects','utils/data','lib/form-validator'],function(){return ValidatorPlugin});
|
|
603
|
+
define('gina/toolbar','require jquery vendor/uuid lib/collection lib/routing gina/storage gina/validator'.split(' '),function(B){var Q=B('jquery');Q.noConflict();var V=B('lib/routing');B('lib/collection');var la=B('gina/storage');return function(){var U=null,N=!1,ha=!1,R=!1,S,v=(new la({bucket:'gina'})).Collection('plugin'),I=null,w=null,za=!1,va=null,P=null,K=null,A=null,E=null,n='',y=null,z=null,F=null,x='',u=null,G=0,M=0,T=0,ra='',Ea={},W=null,ia=null,ea=null,Aa=null,ma=null,sa=null,Da=null,Qa=
|
|
604
|
+
null,Ja=null,Ia=null,Ha=null,mb=null,Fa=null,Pa=null,Ya=function(){I=Q('#gina-toolbar');if(!I.length)return!1;va=I.find('.gina-toolbar-tab > a');P=Q('#gina-toolbar-toggle');K=Q('#gina-toolbar-panels');A=K.find('.gina-toolbar-panel');y=Q('#gina-toolbar-vposition');z=Q('#gina-toolbar-hposition');F=y.add(z);u=Q('#gina-toolbar-width');I.find('.gina-toolbar-main');W=Q('#gina-toolbar-json');ia=Q('#gina-toolbar-gina-json');ea=Q('#gina-toolbar-toggle-code-raw');$forms=Q('form:not(.gina-toolbar-options, .gina-toolbar-content)');
|
|
605
|
+
Ja=Q('#gina-toolbar-data-html');Ia=Q('#gina-toolbar-view-html');Ha=Q('#gina-toolbar-forms-html');Qa=Q('#gina-toolbar-configuration-environment-html');mb=Q('#gina-toolbar-code-toggle');I.prepend('<textarea class="gina-toolbar-copy"></textarea>');Fa=I.find('.gina-toolbar-copy');w=v.findOne({_name:'toolbar'});w||(w={_name:'toolbar',_version:'1.0.3',_description:'Toolbar settings',_licence:'MIT',_author:[{name:'Fabrice Delaneau',company:'Freelancer'},{name:'Martin-Luther Etouman',company:'Rhinostone'}],
|
|
606
|
+
position:'top-right',width:'30',panelId:'#gina-toolbar-data',isCollapsed:!0,isUnfolded:[],debug:{forms:{active:!1,strategy:'frontend'}}},v.insert(w),w=v.findOne({_name:'toolbar'}));'1.0.3'!=w._version&&('1.0.1'>w._version&&(w.isUnfolded||(w.isUnfolded=[]),void 0!=w.codeFolding&&delete w.codeFolding),'undefined'==typeof w.isUnfolded||Array.isArray(w.isUnfolded)||(w.isUnfolded=[]),w._version='1.0.3',w.save(!0));x=w.position;G=w.width;n=w.panelId;za=w.isCollapsed;I.removeClass('gina-toolbar-hidden');
|
|
606
607
|
rb()},qb=function(q,m,p){var O=null,D=null;try{D=W?W.text():'',''==D||'null'==D?W.text('{}'):(ma=JSON.parse(D),Da=JSON.parse(ia.text()),W.text(''),Aa||(Aa={jsonObject:JSON.clone(ma),ginaJsonObject:JSON.clone(Da)},sa={}))}catch(H){console.error('Could not load'+(q?' [ '+q+' ] ':' ')+'json\n'+H.message+'\n'+H.stack)}if(ma){m&&!p?(ma[q]||(ma[q]={}),ma[q]=Da[q]=m):'data-xhr'==q&&!m&&ma['data-xhr']?delete ma['data-xhr']:p&&(ma=m,Da=p);b(ma,'');Da.environment&&(delete Da.environment.routing,delete Da.environment.reverseRouting,
|
|
607
608
|
delete Da.environment.forms);ma.environment&&(delete ma.environment.routing,delete ma.environment.reverseRouting,delete ma.environment.forms);Qa.html(eb(ma.environment,Da.environment));O=ma.data;var aa=ma.view;p=ma.forms;var xa=Da.data,ba=Da.view;D=Da.forms;ha=S=!1;var pa=null,Ba=!1;/^(view-xhr)$/.test(q)&&(pa=!0,aa=ma[q],ba=Da[q],O=ma['data-xhr'],xa=Da['data-xhr']);if(!q||/^(data)$/.test(q))Ja.html('<ul class="gina-toolbar-code">'+eb(O,xa,null,pa)+'</ul>'),Ia.html('<div id="gina-toolbar-view-html-properties" class="gina-toolbar-section">\n <h2 class="gina-toolbar-section-title">properties</h2>\n <ul class="gina-toolbar-properties"></ul>\n</div>'),
|
|
608
609
|
Ia.html(Ub(aa,ba,null,pa,Ia)),O=$forms,Ha.html(''),Ha.html(ca(p,D,Ha,0,O,O.length,pa)),Ha.find('div.gina-toolbar-section > h2').off('click').on('click',function(H){H.preventDefault();Q(this).parent().find('ul').first().slideToggle()});if(/^(data-xhr|view-xhr)$/.test(q)){if('undefined'==typeof ma[q]||!ma[q]||'null'==ma[q])return!1;pa=!0;Ba='undefined'!=typeof ma[q].isXHRViewData?!0:Ba;Ba||/^(view-xhr)$/.test(q)||'undefined'==typeof ma['el-xhr']||(sa.data=JSON.clone(ma[q]));Ba&&delete ma[q].isXHRViewData;
|
|
609
610
|
/^(data-xhr)$/.test(q)?Ja.html('<ul class="gina-toolbar-code">'+eb(ma[q],Da[q],null,pa)+'</ul>'):/^(view-xhr)$/.test(q)&&(Ia.html('<div id="gina-toolbar-view-html-properties" class="gina-toolbar-section">\n <h2 class="gina-toolbar-section-title">properties</h2>\n <ul class="gina-toolbar-properties"></ul>\n</div>'),Ia.html(Ub(ma[q],Da[q],null,pa,Ia)))}/^(el-xhr)$/.test(q)&&(pa=!0,O=Q('#'+m).find('form:not(.gina-toolbar-options, .gina-toolbar-content)'),Ha.html(''),Ha.html(ca(p,D,Ha,0,O,O.length,
|
|
610
611
|
pa)),Ha.find('div.gina-toolbar-section > h2').off('click').on('click',function(H){H.preventDefault();Q(this).parent().find('ul').first().slideToggle()}));/^(forms)$/.test(q)&&(ha=pa=!0,Q('#gina-toolbar-form-'+m.id).length||(O=$forms,Ha.html(''),Ha.html(ca(p,D,Ha,0,O,O.length,pa)),Ha.find('div.gina-toolbar-section > h2').off('click').on('click',function(H){H.preventDefault();Q(this).parent().find('ul').first().slideToggle()})),'undefined'!=typeof m.rules&&l(m.id,'rules',m.rules,pa),'undefined'!=typeof m.errors&&
|
|
611
|
-
0<m.errors.count()&&l(m.id,'errors',m.errors,pa),'undefined'!=typeof m.sent&&l(m.id,'sent',m.sent,pa));
|
|
612
|
-
|
|
612
|
+
0<m.errors.count()&&l(m.id,'errors',m.errors,pa),'undefined'!=typeof m.sent&&l(m.id,'sent',m.sent,pa));w.currentFile=ma.file;w.currentFile||(w.currentFile=ma.file);ma.file==w.currentFile&&Q(document).ready(function(){ha?(N=!0,0<w.isUnfolded.length&&!S&&(S=!0,setTimeout(function(){0<w.isUnfolded.length&&bb(w.isUnfolded,w.isUnfolded.length,0)},200))):pa?(N=!0,0<w.isUnfolded.length&&!S&&(S=!0,bb(w.isUnfolded,w.isUnfolded.length,0))):(N=!1,setTimeout(function(){0<w.isUnfolded.length&&bb(w.isUnfolded,
|
|
613
|
+
w.isUnfolded.length,0)},200))})}if(!q||'el-xhr'==q&&!R)R=q&&'el-xhr'==q?!0:!1,pc(q)},bb=function(q,m,p){if(p==m)return!1;var O=q[p],D=null;N&&/^xhr-/.test(O)?(O=O.replace(/^xhr-/,''),D=Q('.gina-toolbar-xhr-folding-state-'+O)):D=Q('.gina-toolbar-folding-state-'+O);xb(D,function(){p+=1;bb(q,m,p)})},rb=function(){Ja.add(Ia).off('click','a').on('click','a',function(m){m.preventDefault();xb(Q(this),null,!0)}).add(Ha).off('click','a').on('click','a',function(m){m.preventDefault();xb(Q(this),null,!0)});
|
|
613
614
|
Qa.add(Ia).off('click','a').on('click','a',function(m){m.preventDefault();xb(Q(this),null,!0)}).add(Ha).off('click','a').on('click','a',function(m){m.preventDefault();xb(Q(this),null,!0)});mb.off('click').on('click',function(m){m.preventDefault();xb('all',null,!0)});Ja.add(Ia,Ha).off('click','.gina-toolbar-value').on('click','.gina-toolbar-value',function(m){m.preventDefault();try{Pa=Q(this).text(),Fa.text(Pa),Fa.select(),document.execCommand('copy',!1,null),Fa.blur()}catch(p){alert('Please press Ctrl/Cmd+C to copy the value')}});
|
|
614
|
-
ea.off('click').on('click',function(m){ma&&window.open('','JSON RAW','width=400,height=100').document.write(JSON.stringify(ma.data))});va.off('click').on('click',function(m){m.preventDefault();va.removeClass('gina-toolbar-active');A.removeClass('gina-toolbar-active');Q(this).addClass('gina-toolbar-active');n=Q(this).attr('href');E=Q(n).addClass('gina-toolbar-active');
|
|
615
|
-
|
|
616
|
-
ra&&'undefined'!=typeof Ea.pressTime&&500>m.getTime()-Ea.pressTime)switch(ra){case 103:I.toggle()}Ea.pressTime=m.getTime();Ea.keynum=ra}});va.filter('[href="'+n+'"]').trigger('click');za||Q('#gina-toolbar-toggle').trigger('click');Vb(
|
|
615
|
+
ea.off('click').on('click',function(m){ma&&window.open('','JSON RAW','width=400,height=100').document.write(JSON.stringify(ma.data))});va.off('click').on('click',function(m){m.preventDefault();va.removeClass('gina-toolbar-active');A.removeClass('gina-toolbar-active');Q(this).addClass('gina-toolbar-active');n=Q(this).attr('href');E=Q(n).addClass('gina-toolbar-active');w.panelId=n;w.save()});P.off('click').on('click',function(m){m.preventDefault();I.toggleClass('gina-toolbar-collapsed');za=I.hasClass('gina-toolbar-collapsed');
|
|
616
|
+
w.isCollapsed=za;w.save()});F.off('change').on('change',function(m){m.preventDefault();m=y.val();var p=z.val();x=m+'-'+p;Vb(x);w.position=x;w.save()});u.off('change').on('change',function(m){m.preventDefault();G=u.val();wb(G);w.width=G;w.save()});Q(window).off('resize').on('resize',function(){nb()});Q('body').off('keypress').on('keypress',function(m){if(!/INPUT|TEXTAREA/.test(m.target.tagName)){ra=m.keyCode?m.keyCode:m.which?m.which:m.charCode;m=new Date;if('undefined'!=typeof Ea.keynum&&Ea.keynum==
|
|
617
|
+
ra&&'undefined'!=typeof Ea.pressTime&&500>m.getTime()-Ea.pressTime)switch(ra){case 103:I.toggle()}Ea.pressTime=m.getTime();Ea.keynum=ra}});va.filter('[href="'+n+'"]').trigger('click');za||Q('#gina-toolbar-toggle').trigger('click');Vb(x);var q=x.split('-');y.val(q[0]);z.val(q[1]);wb(G);u.val(G);nb();q=W?W.text():'';/^\{\{ (.*) \}\}/.test(q)?e(q,qb):qb()},Vb=function(q){I.removeClass('gina-toolbar-top-left gina-toolbar-top-right gina-toolbar-bottom-left gina-toolbar-bottom-right').addClass('gina-toolbar-'+
|
|
617
618
|
q)},wb=function(q){I.removeClass('gina-toolbar-auto gina-toolbar-100 gina-toolbar-80 gina-toolbar-60 gina-toolbar-50 gina-toolbar-40 gina-toolbar-30').addClass('gina-toolbar-'+q)},nb=function(){M=window.innerHeight-32;I.find('.gina-toolbar-main').css('max-height',M+'px');var q=E.find('.gina-toolbar-main'),m=q.find('.gina-toolbar-content');T=q.height();T==M?m.addClass('gina-toolbar-content-end'):m.removeClass('gina-toolbar-content-end')},xb=function(q,m,p){'undefined'==typeof p&&(p=!1);if(void 0!=
|
|
618
|
-
q&&q.length&&'all'!=q){U=q.attr('class');var O=!1;if(/(gina-toolbar-folding-state-[a-z 0-9_-]+|gina-toolbar-xhr-folding-state-[a-z 0-9_-]+)/i.test(U))if(/gina-toolbar-folding-state-[a-z0-9_-]+/i.test(U)?U=U.match(/gina-toolbar-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-folding-state-/,''):(O=!0,'undefined'!=typeof U&&(U=U.match(/gina-toolbar-xhr-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-xhr-folding-state-/,'xhr-'))),0>
|
|
619
|
-
(q.addClass('gina-toolbar-unfolded'),q.next('ul').slideToggle('fast'));else if(-1<
|
|
619
|
+
q&&q.length&&'all'!=q){U=q.attr('class');var O=!1;if(/(gina-toolbar-folding-state-[a-z 0-9_-]+|gina-toolbar-xhr-folding-state-[a-z 0-9_-]+)/i.test(U))if(/gina-toolbar-folding-state-[a-z0-9_-]+/i.test(U)?U=U.match(/gina-toolbar-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-folding-state-/,''):(O=!0,'undefined'!=typeof U&&(U=U.match(/gina-toolbar-xhr-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-xhr-folding-state-/,'xhr-'))),0>w.isUnfolded.indexOf(U))w.isUnfolded.push(U),w.save(),q.hasClass('gina-toolbar-unfolded')||
|
|
620
|
+
(q.addClass('gina-toolbar-unfolded'),q.next('ul').slideToggle('fast'));else if(-1<w.isUnfolded.indexOf(U)&&q.hasClass('gina-toolbar-unfolded')){for(var D=new RegExp('^('+U+')'),aa=0,xa=w.isUnfolded.length;aa<xa;++aa)D.test(w.isUnfolded[aa])&&(!ha&&p||ha&&O||p)&&(w.isUnfolded.splice(aa,1),--aa);w.save(!0);0>w.isUnfolded.indexOf(U)&&(q.removeClass('gina-toolbar-unfolded'),q.next('ul').slideToggle('fast'))}else q.addClass('gina-toolbar-unfolded'),q.next('ul').slideToggle('fast')}'undefined'!=typeof m&&
|
|
620
621
|
null!=m&&m()},yb=function(q){var m={},p=null,O=[],D=0;for(p in q)q.hasOwnProperty(p)&&(O[D]=p,++D);var aa=O.length;O.sort();for(D=0;D<aa;++D)p=O[D],m[p]=q[p];return m},Ka=function(q,m){var p='';if('undefined'!=typeof q&&''!=q){var O=q;'string'==typeof q&&(O=q.replace(/(\]\[|\[)/g,'-').replace(/\]/,'').replace(/[^A-Za-z0-9_-]/g,'_'));p+=O+'-'}'undefined'!=typeof m&&''!=m?(q=m,'string'==typeof m&&(q=m.replace(/(\]\[|\[)/g,'-').replace(/\]/,'')),p+=q):p=p.substr(0,p.length-1);return p.trim()},eb=function(q,
|
|
621
622
|
m,p,O,D){var aa='';p='undefined'!=typeof p&&null!=p?p.replace(/[^A-Za-z0-9_-]/g,'_'):'';var xa='undefined'!=typeof D&&null!=D?D:'',ba='undefined'!=typeof O&&null!=O?'-xhr':'';if(q){q=yb(q);m=yb(m);for(var pa in q)if('object'!=typeof q[pa]||Array.isArray(q[pa])||null===q[pa])if(Array.isArray(q[pa])){p+='-'+pa.replace(/[^A-Za-z0-9_-]/g,'_');var Ba=0<q[pa].length||'undefined'!=typeof m[pa]&&0<m[pa].length?'':' is-empty';aa+='<li class="gina-toolbar-collection">';aa+='<a href="#" class="gina-toolbar-key gina-toolbar'+
|
|
622
623
|
ba+'-folding-state-'+Ka(xa,pa.replace(/[^A-Za-z0-9_-]/g,'_'))+Ba+'">'+pa+' <span>['+q[pa].length+']</span></a>';aa+='<ul class="gina-toolbar-collection">'+Gb(q[pa],m[pa],p,O,D)+'</ul>';aa+='</li>';p=p.substr(0,p.length-pa.length)}else Ba=null===m[pa]?'null':typeof m[pa],'undefined'==Ba?(aa+='<li class="gina-toolbar-key-value">',aa+='<span class="gina-toolbar-key gina-toolbar-key-added">'+pa+':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+Ba+'">'+q[pa]+'</span>'):(q[pa]!==m[pa]&&
|
|
@@ -642,23 +643,23 @@ m).remove(),!1;$section.html(eb(p,p,q,O,m))}else D.find('ul.gina-toolbar-section
|
|
|
642
643
|
Ja.html(q);W.text('');Ja.find('input').off('change').on('change',function(p){var O=Q(this)[0].files,D=p=null;if(1==O.length)p=Q(this)[0].files[0],D=new FileReader,D.addEventListener('load',function(){W.text(D.result);ia.text(D.result);m()},!1),D.readAsBinaryString(p);else{var aa=0;D=[];for(var xa=0,ba=O.length;xa<ba;++xa)switch(p=O[xa],!0){case /user/.test(p.name):D[xa]=new FileReader;D[xa].addEventListener('load',function(pa){W.text(pa.currentTarget.result);++aa;aa==O.length&&m()},!1);D[xa].readAsBinaryString(p);
|
|
643
644
|
break;case /gina/.test(p.name):D[xa]=new FileReader,D[xa].addEventListener('load',function(pa){ia.text(pa.currentTarget.result);++aa;aa==O.length&&m()},!1),D[xa].readAsBinaryString(p)}}});return!1},b=function(q,m){for(var p in q)'object'==typeof q[p]&&b(q[p],m+p+'-')};this.update=function(q,m){qb(q,m)};this.restore=function(){sa&&'undefined'!=typeof sa.data&&(Aa.jsonObject.data=sa.data);qb('data',Aa.jsonObject,Aa.ginaJsonObject);R=!1;V.notFound={}};if('undefined'!=typeof gina.validator)gina.validator.on('initialized',
|
|
644
645
|
function(){console.log('toolbar validator ready');Ya()});else Ya()}});
|
|
645
|
-
define('gina','require vendor/uuid lib/merge utils/events helpers/prototypes helpers/dateFormat gina/toolbar'.split(' '),function(B){B('utils/events');var Q=B('lib/merge'),V=B('helpers/dateFormat')();B('helpers/prototypes')({dateFormat:V});var la=B('vendor/uuid');window.process||function(U,N,ha,R,S,
|
|
646
|
-
window.getComputedStyle||(window.getComputedStyle=function(U,N){this.el=U;this.getPropertyValue=function(ha){var R=/(\-([a-z]){1})/g;'float'==ha&&(ha='styleFloat');R.test(ha)&&(ha=ha.replace(R,function(S,
|
|
646
|
+
define('gina','require vendor/uuid lib/merge utils/events helpers/prototypes helpers/dateFormat gina/toolbar'.split(' '),function(B){B('utils/events');var Q=B('lib/merge'),V=B('helpers/dateFormat')();B('helpers/prototypes')({dateFormat:V});var la=B('vendor/uuid');window.process||function(U,N,ha,R,S,v,I){for(v=U[ha]||(U[ha]={});!I&&S<R.length;)I=U[R[S++]+'requestAnimationFrame'];v[N]=v[N]||I&&I.bind(U)||U.setImmediate||U.setTimeout}(window,'nextTick','process',['r','webkitR','mozR','msR','oR'],0);
|
|
647
|
+
window.getComputedStyle||(window.getComputedStyle=function(U,N){this.el=U;this.getPropertyValue=function(ha){var R=/(\-([a-z]){1})/g;'float'==ha&&(ha='styleFloat');R.test(ha)&&(ha=ha.replace(R,function(S,v,I){return I.toUpperCase()}));return U.currentStyle[ha]?U.currentStyle[ha]:null};return this});return function(U){this.plugin='gina';var N='gina-'+la.v1(),ha=document,R;document.id=N;N={id:N,isFrameworkLoaded:!1,hasValidator:!1,hasPopinHandler:!1,config:{},session:null,registeredEvents:{},events:{},
|
|
647
648
|
setOptions:function(S){R=Q(R,S,!0)}};'undefined'!=typeof parent.window.gina&&(window.gina=Q(window.gina||{},parent.window.gina));N=Q(window.gina||{},N);registerEvents(this.plugin,['ginaloaded','ready']);triggerEvent(U,ha,'ginaloaded',N)}});
|
|
648
649
|
!function(B,Q){'object'==typeof exports&&'undefined'!=typeof module?module.exports=Q():'function'==typeof define&&define.amd?define('vendor/engine.io',Q):(B='undefined'!=typeof globalThis?globalThis:B||self).eio=Q()}(this,function(){function B(ca,l){for(var h=0;h<l.length;h++){var e=l[h];e.enumerable=e.enumerable||!1;e.configurable=!0;'value'in e&&(e.writable=!0);var b=Object,q=b.defineProperty;var m=e.key;a:if('object'==typeof m&&m){var p=m[Symbol.toPrimitive];if(void 0!==p){m=p.call(m,'string');
|
|
649
650
|
if('object'!=typeof m)break a;throw new TypeError('@@toPrimitive must return a primitive value.');}m=String(m)}q.call(b,ca,'symbol'==typeof m?m:m+'',e)}}function Q(ca,l,h){return l&&B(ca.prototype,l),h&&B(ca,h),Object.defineProperty(ca,'prototype',{writable:!1}),ca}function V(){return V=Object.assign?Object.assign.bind():function(ca){for(var l=1;l<arguments.length;l++){var h=arguments[l],e;for(e in h)({}).hasOwnProperty.call(h,e)&&(ca[e]=h[e])}return ca},V.apply(null,arguments)}function la(ca){return la=
|
|
650
651
|
Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},la(ca)}function U(ca,l){ca.prototype=Object.create(l.prototype);ca.prototype.constructor=ca;ha(ca,l)}function N(){try{var ca=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(l){}return(N=function(){return!!ca})()}function ha(ca,l){return ha=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(h,e){return h.__proto__=e,h},ha(ca,l)}function R(ca){return R=
|
|
651
652
|
'function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&'function'==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?'symbol':typeof l},R(ca)}function S(ca){var l='function'==typeof Map?new Map:void 0;return S=function(h){function e(){return function(b,q,m){if(N())return Reflect.construct.apply(null,arguments);var p=[null];p.push.apply(p,q);p=new (b.bind.apply(b,p));return m&&ha(p,m.prototype),p}(h,arguments,la(this).constructor)}if(null===
|
|
652
|
-
h||!function(b){try{return-1!==Function.toString.call(b).indexOf('[native code]')}catch(q){return'function'==typeof b}}(h))return h;if('function'!=typeof h)throw new TypeError('Super expression must either be null or a function');if(void 0!==l){if(l.has(h))return l.get(h);l.set(h,e)}return e.prototype=Object.create(h.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),ha(e,h)},S(ca)}function
|
|
653
|
-
new Uint8Array(ca.buffer,ca.byteOffset,ca.byteLength)}function I(){return new TransformStream({transform:function(ca,l){!function(h,e){M&&h.data instanceof Blob?h.data.arrayBuffer().then(
|
|
654
|
-
q.setUint16(1,e)}else b=new Uint8Array(9),q=new DataView(b.buffer),q.setUint8(0,127),q.setBigUint64(1,BigInt(e));ca.data&&'string'!=typeof ca.data&&(b[0]|=128);l.enqueue(b);l.enqueue(h)})}})}function
|
|
653
|
+
h||!function(b){try{return-1!==Function.toString.call(b).indexOf('[native code]')}catch(q){return'function'==typeof b}}(h))return h;if('function'!=typeof h)throw new TypeError('Super expression must either be null or a function');if(void 0!==l){if(l.has(h))return l.get(h);l.set(h,e)}return e.prototype=Object.create(h.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),ha(e,h)},S(ca)}function v(ca){return ca instanceof Uint8Array?ca:ca instanceof ArrayBuffer?new Uint8Array(ca):
|
|
654
|
+
new Uint8Array(ca.buffer,ca.byteOffset,ca.byteLength)}function I(){return new TransformStream({transform:function(ca,l){!function(h,e){M&&h.data instanceof Blob?h.data.arrayBuffer().then(v).then(e):T&&(h.data instanceof ArrayBuffer||ra(h.data))?e(v(h.data)):Ea(h,!1,function(b){u||=new TextEncoder;e(u.encode(b))})}(ca,function(h){var e=h.length;if(126>e){var b=new Uint8Array(1);(new DataView(b.buffer)).setUint8(0,e)}else if(65536>e){b=new Uint8Array(3);var q=new DataView(b.buffer);q.setUint8(0,126);
|
|
655
|
+
q.setUint16(1,e)}else b=new Uint8Array(9),q=new DataView(b.buffer),q.setUint8(0,127),q.setBigUint64(1,BigInt(e));ca.data&&'string'!=typeof ca.data&&(b[0]|=128);l.enqueue(b);l.enqueue(h)})}})}function w(ca){return ca.reduce(function(l,h){return l+h.length},0)}function za(ca,l){if(ca[0].length===l)return ca.shift();for(var h=new Uint8Array(l),e=0,b=0;b<l;b++)h[b]=ca[0][e++],e===ca[0].length&&(ca.shift(),e=0);return ca.length&&e<ca[0].length&&(ca[0]=ca[0].slice(e)),h}function va(ca){if(ca){for(var l in va.prototype)ca[l]=
|
|
655
656
|
va.prototype[l];return ca}}function P(ca){for(var l=arguments.length,h=Array(1<l?l-1:0),e=1;e<l;e++)h[e-1]=arguments[e];return h.reduce(function(b,q){return ca.hasOwnProperty(q)&&(b[q]=ca[q]),b},{})}function K(ca,l){l.useNativeTimers?(ca.setTimeoutFn=Ha.bind(Ia),ca.clearTimeoutFn=mb.bind(Ia)):(ca.setTimeoutFn=Ia.setTimeout.bind(Ia),ca.clearTimeoutFn=Ia.clearTimeout.bind(Ia))}function A(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function E(){}function n(){for(var ca in bb.requests)bb.requests.hasOwnProperty(ca)&&
|
|
656
657
|
bb.requests[ca].abort()}function y(ca){ca=ca.xdomain;try{if('undefined'!=typeof XMLHttpRequest&&(!ca||qb))return new XMLHttpRequest}catch(l){}if(!ca)try{return new (Ia[['Active'].concat('Object').join('X')])('Microsoft.XMLHTTP')}catch(l){}}function z(ca){if(8E3<ca.length)throw'URI too long';var l=ca,h=ca.indexOf('['),e=ca.indexOf(']');-1!=h&&-1!=e&&(ca=ca.substring(0,h)+ca.substring(h,e).replace(/:/g,';')+ca.substring(e,ca.length));var b,q;ca=yb.exec(ca||'');for(var m={},p=14;p--;)m[Ka[p]]=ca[p]||
|
|
657
658
|
'';return-1!=h&&-1!=e&&(m.source=l,m.host=m.host.substring(1,m.host.length-1).replace(/;/g,':'),m.authority=m.authority.replace('[','').replace(']','').replace(/;/g,':'),m.ipv6uri=!0),m.pathNames=function(O,D){O=D.replace(/\/{2,9}/g,'/').split('/');'/'!=D.slice(0,1)&&0!==D.length||O.splice(0,1);'/'==D.slice(-1)&&O.splice(O.length-1,1);return O}(0,m.path),m.queryKey=(b=m.query,q={},b.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(O,D,aa){D&&(q[D]=aa)}),q),m}var F=Object.create(null);F.open='0';F.close=
|
|
658
|
-
'1';F.ping='2';F.pong='3';F.message='4';F.upgrade='5';F.noop='6';var
|
|
659
|
+
'1';F.ping='2';F.pong='3';F.message='4';F.upgrade='5';F.noop='6';var x=Object.create(null);Object.keys(F).forEach(function(ca){x[F[ca]]=ca});for(var u,G={type:'error',data:'parser error'},M='function'==typeof Blob||'undefined'!=typeof Blob&&'[object BlobConstructor]'===Object.prototype.toString.call(Blob),T='function'==typeof ArrayBuffer,ra=function(ca){return'function'==typeof ArrayBuffer.isView?ArrayBuffer.isView(ca):ca&&ca.buffer instanceof ArrayBuffer},Ea=function(ca,l,h){var e=ca.type;ca=ca.data;
|
|
659
660
|
return M&&ca instanceof Blob?l?h(ca):W(ca,h):T&&(ca instanceof ArrayBuffer||ra(ca))?l?h(ca):W(new Blob([ca]),h):h(F[e]+(ca||''))},W=function(ca,l){var h=new FileReader;return h.onload=function(){var e=h.result.split(',')[1];l('b'+(e||''))},h.readAsDataURL(ca)},ia='undefined'==typeof Uint8Array?[]:new Uint8Array(256),ea=0;64>ea;ea++)ia['ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charCodeAt(ea)]=ea;var Aa,ma='function'==typeof ArrayBuffer,sa=function(ca,l){if('string'!=typeof ca)return{type:'message',
|
|
660
|
-
data:Da(ca,l)};var h=ca.charAt(0);if('b'===h){ca=ca.substring(1);if(ma){var e=.75*ca.length;h=ca.length;var b=0;'='===ca[ca.length-1]&&(e--,'='===ca[ca.length-2]&&e--);var q=new ArrayBuffer(e),m=new Uint8Array(q);for(e=0;e<h;e+=4){var p=ia[ca.charCodeAt(e)];var O=ia[ca.charCodeAt(e+1)];var D=ia[ca.charCodeAt(e+2)];var aa=ia[ca.charCodeAt(e+3)];m[b++]=p<<2|O>>4;m[b++]=(15&O)<<4|D>>2;m[b++]=(3&D)<<6|63&aa}l=Da(q,l)}else l={base64:!0,data:ca};l={type:'message',data:l}}else l=
|
|
661
|
-
data:ca.substring(1)}:{type:
|
|
661
|
+
data:Da(ca,l)};var h=ca.charAt(0);if('b'===h){ca=ca.substring(1);if(ma){var e=.75*ca.length;h=ca.length;var b=0;'='===ca[ca.length-1]&&(e--,'='===ca[ca.length-2]&&e--);var q=new ArrayBuffer(e),m=new Uint8Array(q);for(e=0;e<h;e+=4){var p=ia[ca.charCodeAt(e)];var O=ia[ca.charCodeAt(e+1)];var D=ia[ca.charCodeAt(e+2)];var aa=ia[ca.charCodeAt(e+3)];m[b++]=p<<2|O>>4;m[b++]=(15&O)<<4|D>>2;m[b++]=(3&D)<<6|63&aa}l=Da(q,l)}else l={base64:!0,data:ca};l={type:'message',data:l}}else l=x[h]?1<ca.length?{type:x[h],
|
|
662
|
+
data:ca.substring(1)}:{type:x[h]}:G;return l},Da=function(ca,l){return'blob'===l?ca instanceof Blob?ca:new Blob([ca]):ca instanceof ArrayBuffer?ca:ca.buffer},Qa=String.fromCharCode(30);va.prototype.on=va.prototype.addEventListener=function(ca,l){return this.t=this.t||{},(this.t['$'+ca]=this.t['$'+ca]||[]).push(l),this};va.prototype.once=function(ca,l){function h(){this.off(ca,h);l.apply(this,arguments)}return h.fn=l,this.on(ca,h),this};va.prototype.off=va.prototype.removeListener=va.prototype.removeAllListeners=
|
|
662
663
|
va.prototype.removeEventListener=function(ca,l){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var h,e=this.t['$'+ca];if(!e)return this;if(1==arguments.length)return delete this.t['$'+ca],this;for(var b=0;b<e.length;b++)if((h=e[b])===l||h.fn===l){e.splice(b,1);break}return 0===e.length&&delete this.t['$'+ca],this};va.prototype.emit=function(ca){this.t=this.t||{};for(var l=Array(arguments.length-1),h=this.t['$'+ca],e=1;e<arguments.length;e++)l[e-1]=arguments[e];if(h){e=0;for(var b=
|
|
663
664
|
(h=h.slice(0)).length;e<b;++e)h[e].apply(this,l)}return this};va.prototype.emitReserved=va.prototype.emit;va.prototype.listeners=function(ca){return this.t=this.t||{},this.t['$'+ca]||[]};va.prototype.hasListeners=function(ca){return!!this.listeners(ca).length};var Ja='function'==typeof Promise&&'function'==typeof Promise.resolve?function(ca){return Promise.resolve().then(ca)}:function(ca,l){return l(ca,0)},Ia='undefined'!=typeof self?self:'undefined'!=typeof window?window:Function('return this')(),
|
|
664
665
|
Ha=Ia.setTimeout,mb=Ia.clearTimeout,Fa=function(ca){function l(h,e,b){var q;return(q=ca.call(this,h)||this).description=e,q.context=b,q.type='TransportError',q}return U(l,ca),l}(S(Error));ea=function(ca){function l(e){var b;return(b=ca.call(this)||this).writable=!1,K(b,e),b.opts=e,b.query=e.query,b.socket=e.socket,b.supportsBinary=!e.forceBase64,b}U(l,ca);var h=l.prototype;return h.onError=function(e,b,q){return ca.prototype.emitReserved.call(this,'error',new Fa(e,b,q)),this},h.open=function(){return this.readyState=
|
|
@@ -678,7 +679,7 @@ Vb&&!h,e}return U(l,ca),l.prototype.request=function(){var h=0<arguments.length&
|
|
|
678
679
|
context:b})};this.ws.onmessage=function(b){return e.onData(b.data)};this.ws.onerror=function(b){return e.onError('websocket error',b)}},h.write=function(e){var b=this;this.writable=!1;for(var q=function(){var p=e[m],O=m===e.length-1;Ea(p,b.supportsBinary,function(D){try{b.doWrite(p,D)}catch(aa){}O&&Ja(function(){b.writable=!0;b.emitReserved('drain')},b.setTimeoutFn)})},m=0;m<e.length;m++)q()},h.doClose=function(){void 0!==this.ws&&(this.ws.onerror=function(){},this.ws.close(),this.ws=null)},h.uri=
|
|
679
680
|
function(){var e=this.opts.secure?'wss':'ws',b=this.query||{};return this.opts.timestampRequests&&(b[this.opts.timestampParam]=A()),this.supportsBinary||(b.b64=1),this.createUri(e,b)},Q(l,[{key:'name',get:function(){return'websocket'}}])}(ea);var nb=Ia.WebSocket||Ia.MozWebSocket;Pa=function(ca){function l(){return ca.apply(this,arguments)||this}U(l,ca);var h=l.prototype;return h.createSocket=function(e,b,q){return wb?new nb(e,b,q):b?new nb(e,b):new nb(e)},h.doWrite=function(e,b){this.ws.send(b)},
|
|
680
681
|
l}(Pa);ea=function(ca){function l(){return ca.apply(this,arguments)||this}U(l,ca);var h=l.prototype;return h.doOpen=function(){var e=this;try{this.M=new WebTransport(this.createUri('https'),this.opts.transportOptions[this.name])}catch(b){return this.emitReserved('error',b)}this.M.closed.then(function(){e.onClose()}).catch(function(b){e.onError('webtransport error',b)});this.M.ready.then(function(){e.M.createBidirectionalStream().then(function(b){var q=function(p,O){Aa||=new TextDecoder;var D=[],aa=
|
|
681
|
-
0,xa=-1,ba=!1;return new TransformStream({transform:function(pa,Ba){for(D.push(pa);;){if(0===aa){if(1>
|
|
682
|
+
0,xa=-1,ba=!1;return new TransformStream({transform:function(pa,Ba){for(D.push(pa);;){if(0===aa){if(1>w(D))break;pa=za(D,1);ba=!(128&~pa[0]);xa=127&pa[0];aa=126>xa?3:126===xa?1:2}else if(1===aa){if(2>w(D))break;pa=za(D,2);xa=(new DataView(pa.buffer,pa.byteOffset,pa.length)).getUint16(0);aa=3}else if(2===aa){if(8>w(D))break;pa=za(D,8);pa=new DataView(pa.buffer,pa.byteOffset,pa.length);var H=pa.getUint32(0);if(H>Math.pow(2,21)-1){Ba.enqueue(G);break}xa=H*Math.pow(2,32)+pa.getUint32(4);aa=3}else{if(w(D)<
|
|
682
683
|
xa)break;pa=za(D,xa);Ba.enqueue(sa(ba?pa:Aa.decode(pa),O));aa=0}if(0===xa||xa>p){Ba.enqueue(G);break}}}})}(Number.MAX_SAFE_INTEGER,e.socket.binaryType),m=b.readable.pipeThrough(q).getReader();q=I();q.readable.pipeTo(b.writable);e.C=q.writable.getWriter();!function O(){m.read().then(function(D){var aa=D.value;D.done||(e.onPacket(aa),O())}).catch(function(D){})}();b={type:'open'};e.query.sid&&(b.data='{"sid":"'.concat(e.query.sid,'"}'));e.C.write(b).then(function(){return e.onOpen()})})})},h.write=
|
|
683
684
|
function(e){var b=this;this.writable=!1;for(var q=function(){var p=m===e.length-1;b.C.write(e[m]).then(function(){p&&Ja(function(){b.writable=!0;b.emitReserved('drain')},b.setTimeoutFn)})},m=0;m<e.length;m++)q()},h.doClose=function(){var e;null===(e=this.M)||void 0===e||e.close()},Q(l,[{key:'name',get:function(){return'webtransport'}}])}(ea);var xb={websocket:Pa,webtransport:ea,polling:rb},yb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
|
|
684
685
|
Ka='source protocol authority userInfo user password host port relative path directory file query anchor'.split(' '),eb='function'==typeof addEventListener&&'function'==typeof removeEventListener,Gb=[];eb&&addEventListener('offline',function(){Gb.forEach(function(ca){return ca()})},!1);var Ub=function(ca){function l(e,b){var q;((q=ca.call(this)||this).binaryType='arraybuffer',q.writeBuffer=[],q.L=0,q.R=-1,q.D=-1,q.P=-1,q.I=1/0,e&&'object'===R(e)&&(b=e,e=null),e)?(e=z(e),b.hostname=e.host,b.secure=
|
|
@@ -702,27 +703,27 @@ function BindingHelper(B){var Q={};'undefined'!=typeof B&&(Q=B);Q.process=functi
|
|
|
702
703
|
N.handler+'` could not be reached. You must expose it to the `window` do object before any call.');var R=N.handler;delete N.handler;window[R].apply(this,Object.values(N));N.handler=R}else Q[ha].apply(this,Object.values(N));N.call=ha}catch(S){console.error('BindingHelper encountered error while trying to execute `'+ha+'`'+S.stack||S)}Q.process(V,la,U+1)}};return Q}define('helpers/binding',[],function(){return BindingHelper});
|
|
703
704
|
if('undefined'!==typeof module&&module.exports){var fs=require('fs'),os=require('os'),dns=require('dns'),execSync=require('child_process').execSync,util=require('util'),promisify=util.promisify;try{var console=require('../../logger')}catch(B){}}
|
|
704
705
|
function Domain(B,Q){var V='undefined'!==typeof module&&module.exports?!1:!0,la=!1;V&&(la=!!window.MSInputMethodContext&&!!document.documentMode);'function'==typeof B&&(Q=B,B=void 0);var U={filename:'../dist/public_suffix_list.dat',url:'https://publicsuffix.org/list/public_suffix_list.dat',alternativeUrl:'https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat',isCachingRequired:!1,isUpdating:!1},N=null,ha=null,R=function(va,P,K){if('undefined'==typeof P)P=U;else for(let A in U)'undefined'==
|
|
705
|
-
typeof P[A]&&(P[A]=U[A]);V||(P.filename=__dirname+'/'+P.filename);V&&P.isCachingRequired&&(console.warn('[DOMAIN] `options.isCachingRequired` is only available for backend'),P.isCachingRequired=!1);N=P;if(K)return
|
|
706
|
+
typeof P[A]&&(P[A]=U[A]);V||(P.filename=__dirname+'/'+P.filename);V&&P.isCachingRequired&&(console.warn('[DOMAIN] `options.isCachingRequired` is only available for backend'),P.isCachingRequired=!1);N=P;if(K)return v(P,function(A){A?K(A):(console.debug('[DOMAIN] PSL Loaded'),K(A,va))});v(P);console.debug('[DOMAIN] PSL Loaded');return va},S=function(){},v=async function(va,P){var K=V||va.isCachingRequired?va.url:va.filename,A='undefined'!=typeof va.isUpdating?va.isUpdating:!1,E=null;if(V)if(ha&&!A)P(!1);
|
|
706
707
|
else if(window.fetch){E=A=null;try{A=await fetch(K),ha=E=await A.text()}catch(y){E=Error('[DOMAIN] Could not load PSL\n'+(y.stack||y.message||y));P(E);return}va.isUpdating=!1;P(!1)}else E=Error('[DOMAIN] Fetch API not supported'),P(E);else{K=!1;if('undefined'!=typeof fs.accessSync)try{fs.accessSync(va.filename,fs.constants.F_OK),K=!0}catch(y){K=!1;try{fs.lstatSync(va.filename).isSymbolicLink()&&(K=!0)}catch(z){}}else K=fs.existsSync(va.filename);K||(va.isCachingRequired=!0);if(va.isCachingRequired){K=
|
|
707
708
|
'curl -o '+va.filename+' '+va.url+' >/dev/null 2>&1';console.debug('[DOMAIN] Running: '+K);try{execSync(K)}catch(y){console.warn('[DOMAIN] could not fetch from `'+va.url+'`. Trying with `'+va.alternativeUrl+'`');K='curl -o '+va.filename+' '+va.alternativeUrl+' >/dev/null 2>&1';try{execSync(K)}catch(z){P(z);return}}var n=!1;nIntervId=setInterval(()=>{if('undefined'!=typeof fs.accessSync)try{fs.accessSync(va.filename,fs.constants.F_OK),n=!0}catch(y){n=!1;try{fs.lstatSync(va.filename).isSymbolicLink()&&
|
|
708
|
-
(n=!0)}catch(z){}}else n=fs.existsSync(va.filename);n&&(clearInterval(nIntervId),ha=fs.readFileSync(va.filename).toString(),P(!1))},200)}try{ha=fs.readFileSync(va.filename).toString(),P&&P(!1)}catch(y){console.warn('[DOMAIN] could not read from `'+va.filename+'`'),
|
|
709
|
+
(n=!0)}catch(z){}}else n=fs.existsSync(va.filename);n&&(clearInterval(nIntervId),ha=fs.readFileSync(va.filename).toString(),P(!1))},200)}try{ha=fs.readFileSync(va.filename).toString(),P&&P(!1)}catch(y){console.warn('[DOMAIN] could not read from `'+va.filename+'`'),v(B,P)}}},I=function(va){N.isUpdating=!0;v(N,va)},w=async function(va){va='undefined'!=typeof va&&''!=va?va:os.hostname();if(/\./.test(va))return va;console.debug('[DOMAIN][getFQDN] FQDN: '+va);var P=null,K=null;P=await promisify(dns.lookup)(va,
|
|
709
710
|
{hints:dns.ADDRCONFIG||dns.V4MAPPED}).then(function(A){console.debug('[DOMAIN][getFQDN] IP: '+A.address);console.debug('[DOMAIN][getFQDN] FAMILY: '+A.family);return A}).catch(function(A){K=A});if(K)throw K;va=await promisify(dns.lookupService)(P.address,0).then(function(A){console.debug('[DOMAIN][getFQDN] FQDN: '+A.hostname);console.debug('[DOMAIN][getFQDN] Service: '+A.service);return A.hostname}).catch(function(A){});if(K)throw K;if(!/\./.test(va))throw Error('[DOMAIN][getFQDN] `'+va+'` is not a FQDN !');
|
|
710
|
-
return va},za={getRootDomain:function(va,P){'undefined'==typeof P&&(P=!1);va=va.trim();var K=!1,A=!1,E=va.replace(/^(.*):\/\/|\/(.*)/g,''),n=E.split(/\./g).reverse(),y=n.length?n.length-1:0,z=ha.replace(/\/\/\s*(.*)\n|^\s*\n/gm,'').split(/\n/).filter(function(F,
|
|
711
|
-
(A=A.replace(/:(.*)$/,'')),(A=K||!K&&-1<z.indexOf(A)?!0:!1)?1<y&&!K?(n.splice(2),E=n.reverse().join('.')):E+='.'+n.reverse().join('.'):1<y?(n.splice(2),E=n.reverse().join('.')):E+='.'+n.reverse().join('.'));/:(.*)$/.test(E)&&(E=E.replace(/:(.*)$/,''));console.debug('[DOMAIN] isSLD: '+K,va,' -> ',E);/^true$/i.test(P);return{value:E,isSLD:K,isRegisteredTldOrSld:A}}};V?za.onReady=S:(za.updatePSL=I,za.getFQDN=
|
|
711
|
+
return va},za={getRootDomain:function(va,P){'undefined'==typeof P&&(P=!1);va=va.trim();var K=!1,A=!1,E=va.replace(/^(.*):\/\/|\/(.*)/g,''),n=E.split(/\./g).reverse(),y=n.length?n.length-1:0,z=ha.replace(/\/\/\s*(.*)\n|^\s*\n/gm,'').split(/\n/).filter(function(F,x,u){/[^a-z 0-9.]+/.test(F)&&(F=F.replace(/[^a-z 0-9.]+/g,'').replace(/^\./g,''));return/\./.test(F)&&!K&&(new RegExp('.'+F+'$')).test(E)?(K=!0,y=F.split(/\./g).length,u.splice(0,u.length),!1):F});E=n[y];0<y&&(n=n.splice(0,y),A=n[0],/:(.*)$/.test(A)&&
|
|
712
|
+
(A=A.replace(/:(.*)$/,'')),(A=K||!K&&-1<z.indexOf(A)?!0:!1)?1<y&&!K?(n.splice(2),E=n.reverse().join('.')):E+='.'+n.reverse().join('.'):1<y?(n.splice(2),E=n.reverse().join('.')):E+='.'+n.reverse().join('.'));/:(.*)$/.test(E)&&(E=E.replace(/:(.*)$/,''));console.debug('[DOMAIN] isSLD: '+K,va,' -> ',E);/^true$/i.test(P);return{value:E,isSLD:K,isRegisteredTldOrSld:A}}};V?za.onReady=S:(za.updatePSL=I,za.getFQDN=w);return V&&la&&!window.fetch?(la=document.createElement('script'),la.type='text/javascript',
|
|
712
713
|
la.src='https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.min.js',S=document.createElement('script'),S.type='text/javascript',S.src='https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js',document.head.appendChild(la),document.head.appendChild(S),setTimeout(()=>R(za,B,Q),500)):R(za,B,Q)}'undefined'!==typeof module&&module.exports?module.exports=Domain:'function'===typeof define&&define.amd&&define('lib/domain',[],function(){return Domain});
|
|
713
|
-
define('gina/link','require jquery vendor/uuid lib/domain lib/merge utils/events'.split(' '),function(B){B('jquery').noConflict();var Q=B('vendor/uuid'),V=B('lib/domain'),la=null,U=B('lib/merge');B('utils/events');return function(N){function ha(n,y){var z=A(n),F=z.id,
|
|
714
|
-
window.location.protocol+'//'+window.location.host)).test(n)){var
|
|
715
|
-
y.url,y.isSynchrone):
|
|
716
|
-
n.options=U(y,S.options);y=document.getElementById(n.id)||null;if('undefined'==typeof
|
|
717
|
-
typeof z[F].tagName&&P(z[F],y,evt)}n.request=ha;n.getLinkById=K;n.getLinkByUrl=A;
|
|
718
|
-
request:null,$forms:[]},
|
|
719
|
-
typeof n&&(n=
|
|
720
|
-
(F=z.getAttribute('onclick'));F?'undefined'==typeof F||/return false/.test(F)||(F=/;$/.test(F)?F+'return false;':F+'; return false;',z.setAttribute('onclick',F)):z.setAttribute('onclick','return false;');'undefined'==typeof
|
|
721
|
-
new ActiveXObject('Microsoft.XMLHTTP')}catch(F){}}evt='click';addListener(gina,
|
|
722
|
-
gina.link=U(gina.link,
|
|
714
|
+
define('gina/link','require jquery vendor/uuid lib/domain lib/merge utils/events'.split(' '),function(B){B('jquery').noConflict();var Q=B('vendor/uuid'),V=B('lib/domain'),la=null,U=B('lib/merge');B('utils/events');return function(N){function ha(n,y){var z=A(n),F=z.id,x=document.getElementById(F)||null;(x.getAttribute('data-gina-link-event-on-success')||x.getAttribute('data-gina-link-event-on-error'))&&listenToXhrEvents(z);y='undefined'==typeof y?za:U(y,za);if(/^(http|https):/.test(n)&&!(new RegExp('^'+
|
|
715
|
+
window.location.protocol+'//'+window.location.host)).test(n)){var u=la.getRootDomain(window.location.hostname).value,G=la.getRootDomain(n).value;u=u===G?!0:!1;gina.config.envIsDev&&(console.debug('Checking CORS from Popin plugin...TODO - local CORS Proxy'),console.debug('Is request from same domain ? ',u));u||(n=n.match(/^(https|http):/)[0]+'//corsacme.herokuapp.com/?'+n)}y.url=n;z&&'undefined'!=typeof z.options&&(y=U(z.options,y));y.withCredentials?'withCredentials'in w?y.isSynchrone?w.open(y.method,
|
|
716
|
+
y.url,y.isSynchrone):w.open(y.method,y.url):'undefined'!=typeof XDomainRequest?(w=new XDomainRequest,w.open(y.method,y.url)):(w=null,triggerEvent(gina,x,'error.'+F,'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ')):y.isSynchrone?w.open(y.method,y.url,y.isSynchrone):w.open(y.method,y.url);if(!w)throw Error('No `xhr` object initiated');y.$link=z;handleXhr(w,x,y,B);w.send()}function R(n,y){if('object'!=typeof y)throw Error('`options` must be an object');
|
|
717
|
+
n.options=U(y,S.options);y=document.getElementById(n.id)||null;if('undefined'==typeof v.$links[n.id]){if(-1<va.indexOf(n.id))throw Error('`link '+n.id+'` already exists !');if(!gina.events[evt]){addListener(gina,y,evt,function(x){cancelEvent(x);x=K(x.target.id);var u=x.url;'undefined'==typeof x.options.isSynchrone&&(x.options.isSynchrone=!1);'undefined'==typeof x.options.withCredentials&&(x.options.withCredentials=!1);ha(u,x.options)});var z=y.childNodes,F=0;lLen=z.length;if(0<lLen)for(;F<lLen;++F)'undefined'!=
|
|
718
|
+
typeof z[F].tagName&&P(z[F],y,evt)}n.request=ha;n.getLinkById=K;n.getLinkByUrl=A;v.$links[n.id]=n}}this.plugin='link';registerEvents(this.plugin,'loaded ready open close destroy success error progress'.split(' '));var S={options:{url:void 0,'class':'gina-link-default'},authorizedEvents:['ready','success','error'],events:{}},v={plugin:this.plugin,id:'gina-links-'+Q.v4(),on,eventData:{},$links:{},target:document,isReady:!1,initialized:!1},I={plugin:this.plugin,on,eventData:{},target:document,url:null,
|
|
719
|
+
request:null,$forms:[]},w=null,za={url:'',method:'GET',isSynchrone:!1,withCredentials:!0,headers:{'X-Requested-With':'XMLHttpRequest'}},va=[],P=function(n,y,z){addListener(gina,n,'click',function(F){cancelEvent(F);triggerEvent(gina,y,z)})},K=function(n){return'undefined'!=typeof v.$links[n]?v.$links[n]:null},A=function(n){var y=null,z;for(z in gina.link.$links)if('undefined'!=typeof gina.link.$links[z].url&&gina.link.$links[z].url==n){y=gina.link.$links[z];break}return y},E=function(n,y){'undefined'==
|
|
720
|
+
typeof n&&(n=v.target);var z,F=null;n=n.getElementsByTagName('a');for(var x=0,u=n.length;x<u;++x)if(((z=n[x].getAttribute('data-gina-link'))||''==z)&&!/^false$/i.test(z)){z=n[x];var G={type:'a',method:'GET'};var M=z.getAttribute('data-gina-link-url');G.url='undefined'!=typeof M&&null!=M?M:z.getAttribute('href');M=z.getAttribute('id');if('undefined'==typeof M||null==M||''==M||/popin\.link/.test(M))M='link.click.gina-link-'+v.id+'-'+Q.v4();z.id=M;evt=G.id=M;z.setAttribute('id',evt);'A'==z.tagName&&
|
|
721
|
+
(F=z.getAttribute('onclick'));F?'undefined'==typeof F||/return false/.test(F)||(F=/;$/.test(F)?F+'return false;':F+'; return false;',z.setAttribute('onclick',F)):z.setAttribute('onclick','return false;');'undefined'==typeof v.$links[G.id]&&(G.target=z,z=U(G,I),R(z,y))}};new V(function(n,y){if(n)throw n;la=y});return function(n){v.bindLinks=E;v.request=ha;v.getLinkById=K;v.getLinkByUrl=A;v.on('init',function(y){if(window.XMLHttpRequest)w=new XMLHttpRequest;else if(window.ActiveXObject)try{w=new ActiveXObject('Msxml2.XMLHTTP')}catch(z){try{w=
|
|
722
|
+
new ActiveXObject('Microsoft.XMLHTTP')}catch(F){}}evt='click';addListener(gina,v.target,evt,function(z){'undefined'==typeof z.target.id&&(z.target.setAttribute('id',evt+'.'+Q.v4()),z.target.id=z.target.getAttribute('id'));if(/^link\.click\./.test(z.target.id)){cancelEvent(z);var F=z.target.id;(new RegExp('^link.click.gina-link-'+v.id)).test(F)&&triggerEvent(gina,z.target,F,z.detail)}});'undefined'==typeof n&&(n={});v.options=n;E(v.target,n);gina.linkIsBinded=!0;v.isReady=!0;gina.hasLinkHandler=!0;
|
|
723
|
+
gina.link=U(gina.link,v);triggerEvent(gina,v.target,'ready.'+v.id,v)});v.initialized=!0;return v}(N)}});
|
|
723
724
|
define('gina/popin','require vendor/uuid jquery lib/domain lib/merge utils/events'.split(' '),function(B){B('jquery').noConflict();var Q=B('vendor/uuid'),V=B('lib/domain'),la=null,U=B('lib/merge');B('utils/events');return function(N){function ha(){var W=null,ia;for(ia in gina.popin.$popins)if('undefined'!=typeof gina.popin.$popins[ia].isOpen&&gina.popin.$popins[ia].isOpen){W=gina.popin.$popins[ia];break}!W&&gina.popin.activePopinId&&(W=gina.popin.$popins[gina.popin.activePopinId]);return W}function R(W,
|
|
724
725
|
ia){var ea=W.target,Aa=W.type;'undefined'!=typeof W.detail&&'function'==typeof W.detail.trim&&(ea.innerHTML=W.detail.trim());W=function(wb,nb,xb){var yb=xb.getAttribute('data-gina-popin-is-link');yb=/^true$/i.test(yb)?!0:!1;'link'!=wb||yb||(wb='action');addListener(gina,xb,nb,function(Ka){cancelEvent(Ka);if('close'!=wb){var eb=!1,Gb='loaded.'+ia.id;'undefined'==typeof gina.events[Gb]&&addListener(gina,ea,Gb,function(Ub){Ub.preventDefault();eb||(eb=!0,I(Ub.detail))});Gb={isSynchrone:!1,withCredentials:!1};
|
|
725
|
-
Gb=U(ia.options,Gb);
|
|
726
|
+
Gb=U(ia.options,Gb);v(ia.name,xb.href,Gb)}removeListener(gina,Ka.target,Ka.type)});addListener(gina,xb,'click',function(Ka){cancelEvent(Ka);if(null!=Ka.target.getAttribute('disabled')&&'false'!=Ka.target.getAttribute('disabled'))return!1;if('link'==wb){var eb=Ka.target.getAttribute('href')||null,Gb=Ka.target.getAttribute('target');null!=Gb&&''!=Gb?window.open(eb,Gb):triggerEvent(gina,Ka.target,Ka.currentTarget.id,ia)}else'undefined'==typeof Ka.target.id&&(Ka.target.setAttribute('id',nb+'.'+Q.v4()),
|
|
726
727
|
Ka.target.id=Ka.target.getAttribute('id')),/^popin\.close\./.test(Ka.target.id)&&(cancelEvent(Ka),ia.isRedirecting=!1,K(ia.name)),/^popin\.click\./.test(Ka.target.id)&&(cancelEvent(Ka),eb=Ka.target.id,(new RegExp('^popin.click.gina-popin-'+n.id)).test(eb)&&triggerEvent(gina,Ka.target,eb,Ka.detail))})};gina.popinIsBinded=!0;var ma=null,sa=null,Da=null;if(!ia.isOpen&&E.options.cancelOnOverlayClick){var Qa=ia.target;if(!E.options.useDialogMode||gina.config.envIsDev)Qa=n.target.childNodes[0];addListener(gina,
|
|
727
728
|
Qa,'mousedown',function(wb){if(/gina-popin-is-active/.test(wb.target.className)){removeListener(gina,wb.target,'mousedown');wb=[];ma=0;var nb=ea.getElementsByTagName('button');sa=0;Da=nb.length;if(0<Da)for(;sa<Da;++sa)/gina-popin-close/.test(nb[sa].className)&&(wb[ma]=nb[sa],++ma);nb=ea.getElementsByTagName('div');sa=0;Da=nb.length;if(0<Da)for(;sa<Da;++sa)/gina-popin-close/.test(nb[sa].className)&&(wb[ma]=nb[sa],++ma);nb=ea.getElementsByTagName('a');sa=0;Da=nb.length;if(0<Da)for(;sa<Da;++sa)/gina-popin-close/.test(nb[sa].className)&&
|
|
728
729
|
(wb[ma]=nb[sa],++ma);sa=0;for(Da=wb.length;sa<Da;++sa){nb=wb[sa];let xb=nb.getAttribute('id');for(let yb=0,Ka=A.length;yb<Ka;yb++){let eb=A[yb];'undefined'!=typeof gina.events[eb]&&gina.events[eb]==xb&&removeListener(gina,nb,eb);'undefined'!=typeof gina.events[xb]&&gina.events[xb]==xb&&removeListener(gina,nb,xb);'undefined'!=typeof gina.events[eb+'.'+xb]&&gina.events[eb+'.'+xb]==xb&&removeListener(gina,nb,eb+'.'+xb);'undefined'!=typeof gina.events[eb+'.'+xb]&&gina.events[eb+'.'+xb]==eb+'.'+xb&&removeListener(gina,
|
|
@@ -735,7 +736,7 @@ wb.currentTarget.href+='?inheritedData='+encodeRFC5987ValueChars(JSON.stringify(
|
|
|
735
736
|
removeListener(gina,ia.target,Aa)}function S(W,ia){var ea=ha();if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&'undefined'!=typeof W&&'undefined'!=typeof ia&&W){ea=W;try{var Aa=null;!ia&&ea.error&&/^(\{|\[)/.test(ea.error)&&(ea.error=JSON.parse(ea.error));if('undefined'!=typeof ea.error&&'object'==typeof ea.error&&'object'==typeof ea.error){Aa={status:ea.status};for(xErr in ea.error)/^error$/.test(xErr)||(Aa[xErr]=ea.error[xErr]);Aa.error=ea.error.error;ea=Aa}else'undefined'!=
|
|
736
737
|
typeof ea.error&&'string'==typeof ea.error&&(ea=W);ea.isXHRViewData=!0;ginaToolbar.update('data-xhr',ea);return}catch(ma){throw ma;}}try{ea=M(n.activePopinId)}catch(ma){ea&&ginaToolbar.update('data-xhr',ma)}ea||(new DOMParser).parseFromString(W,'text/html').getElementsByClassName('popin')[0]||(new DOMParser).parseFromString(W,'text/html').getElementsByTagName('div');ea='string'==typeof W&&/<(.*)>/.test(W)?(new DOMParser).parseFromString(W,'text/html').getElementById('gina-without-layout-xhr-data'):
|
|
737
738
|
document.getElementById('gina-without-layout-xhr-data');if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&ea)try{'undefined'!=typeof ea.value&&ea.value&&(ea=JSON.parse(decodeURIComponent(ea.value)),ea.isXHRViewData=!0,ginaToolbar.update('data-xhr',ea))}catch(ma){throw ma;}W='string'==typeof W&&/<(.*)>/.test(W)?(new DOMParser).parseFromString(W,'text/html').getElementById('gina-without-layout-xhr-view'):document.getElementById('gina-without-layout-xhr-view');if(gina&&'undefined'!=
|
|
738
|
-
typeof window.ginaToolbar&&window.ginaToolbar&&W)try{'undefined'!=typeof W.value&&W.value&&(W=JSON.parse(decodeURIComponent(W.value)),ginaToolbar.update('view-xhr',W))}catch(ma){throw ma;}}function
|
|
739
|
+
typeof window.ginaToolbar&&window.ginaToolbar&&W)try{'undefined'!=typeof W.value&&W.value&&(W=JSON.parse(decodeURIComponent(W.value)),ginaToolbar.update('view-xhr',W))}catch(ma){throw ma;}}function v(W,ia,ea){if('undefined'==typeof W){if('undefined'==typeof this.name)throw Error('`$popin.name` needs to be defined !');W=this.name}else'undefined'==typeof this.name&&'undefined'!=W&&(this.name=W);var Aa=T(W),ma=Aa.id;gina.popin.activePopinId||(gina.popin.activePopinId=ma);var sa=document.getElementById(ma)||
|
|
739
740
|
null;if(null==sa){var Da=null;E.options.useDialogMode?(Da=Aa.options.class+' '+ma,sa=document.createElement('dialog'),sa.setAttribute('id',ma),sa.setAttribute('class',Da),sa.setAttribute('data-type','modal'),sa.setAttribute('aria-labelledby',W),($overlay=document.getElementById('gina-popins-overlay'))?$overlay.appendChild(sa):n.target.appendChild(sa)):(Da=Aa.options.class+' '+ma,sa=document.createElement('div'),sa.setAttribute('id',ma),sa.setAttribute('class',Da),n.target.firstChild.appendChild(sa))}'undefined'==
|
|
740
741
|
typeof ea?ea=Ea:(W=Ea.withCredentials,ea=U(ea,Ea),ea.withCredentials=W);/^(http|https):/.test(ia)&&!(new RegExp('^'+window.location.protocol+'//'+window.location.host)).test(ia)&&(W=la.getRootDomain(window.location.hostname).value,Da=la.getRootDomain(ia).value,W=W===Da?!0:!1,gina.config.envIsDev&&(console.debug('Checking CORS from Popin plugin...TODO - local CORS Proxy'),console.debug('Is request from same domain ? ',W)),W||(ia=ia.match(/^(https|http):/)[0]+'//corsacme.herokuapp.com/?'+ia,ea.withCredentials=
|
|
741
742
|
!1));ea.url=ia;Aa.options=U(ea,Aa.options);var Qa=null;ea.withCredentials?'withCredentials'in F?ea.isSynchrone?F.open(ea.method,ea.url,ea.isSynchrone):F.open(ea.method,ea.url):'undefined'!=typeof XDomainRequest?(F=new XDomainRequest,F.open(ea.method,ea.url)):(F=null,Qa='CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ',triggerEvent(gina,sa,'error.'+ma,Qa)):ea.isSynchrone?F.open(ea.method,ea.url,ea.isSynchrone):F.open(ea.method,ea.url);var Ja=!1;if(F){F.withCredentials=
|
|
@@ -745,22 +746,22 @@ Aa.close();var Ya=Ha.popin.reload?Ha.popin.reload:!1;Ha.popin.location||Ha.popin
|
|
|
745
746
|
return}if('undefined'!=typeof Ha.reload){document.location.reload();return}'undefined'!=typeof Ha.popin&&'undefined'!=typeof Ha.popin.close&&(Aa.isRedirecting=!1,K(Aa.name))}if(!Fa){GINA_ENV_IS_DEV&&S(Ha);triggerEvent(gina,sa,'loaded.'+ma,Ha);return}GINA_ENV_IS_DEV&&S(Ha);triggerEvent(gina,$forms[0],'success.'+ma,Ha)}GINA_ENV_IS_DEV&&S(Ha)}catch(qb){Ja=!1,Ha={status:422,error:qb.description||qb.stack},/application\/json/.test(F.getResponseHeader('Content-Type'))&&(Ha.error=JSON.parse(F.responseText),
|
|
746
747
|
Ja=!0),n.eventData.error=Ha,GINA_ENV_IS_DEV&&S(Ha,Ja),triggerEvent(gina,sa,'error.'+ma,Ha)}else Ja=!1,Ha={status:F.status,error:F.responseText},/application\/json/.test(F.getResponseHeader('Content-Type'))&&(Ha.error=JSON.parse(F.responseText),Ja=!0),n.eventData.error=Ha,GINA_ENV_IS_DEV&&S(Ha,Ja),triggerEvent(gina,sa,'error.'+ma,Ha)};F.send();return{open:function(){var Ha=!1;addListener(gina,sa,'loaded.'+ma,function(mb){mb.preventDefault();Ha||(Ha=!0,n.activePopinId=Aa.id,R(mb,Aa),va(Aa.name))})}}}}
|
|
747
748
|
function I(W,ia){var ea=ha();if(ea){if(!ea.isOpen)throw Error('Popin `'+ea.name+'` is not open !');ea.isRedirecting='undefined'!=typeof ia?ia:!1;ia=ea.target;ia.innerHTML=W.trim();P(ea.name,!0);R({target:ia,type:'loaded.'+ea.id},ea);if(!E.options.useDialogMode&&/safari/i.test(window.navigator.userAgent))for(W=document.getElementsByTagName('link'),ia=0;ia<W.length;ia++)if('stylesheet'==W[ia].getAttribute('rel')){var Aa=W[ia].getAttribute('href').split('?')[0];/gina\.min\.css|gina\.css/.test(Aa)&&(Aa=
|
|
748
|
-
Aa+'?version='+(new Date).getMilliseconds(),W[ia].setAttribute('href',Aa))}ea.isRedirecting?triggerEvent(gina,n.target,'loaded.'+ea.id,ea):triggerEvent(gina,n.target,'open.'+ea.id,ea);if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar)try{ginaToolbar.update('el-xhr',ea.id)}catch(ma){throw ma;}}}function
|
|
749
|
+
Aa+'?version='+(new Date).getMilliseconds(),W[ia].setAttribute('href',Aa))}ea.isRedirecting?triggerEvent(gina,n.target,'loaded.'+ea.id,ea):triggerEvent(gina,n.target,'open.'+ea.id,ea);if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar)try{ginaToolbar.update('el-xhr',ea.id)}catch(ma){throw ma;}}}function w(W){var ia=setupXhr();ia.open('GET',W,!0);ia.setRequestHeader('Content-Type','text/javascript');ia.onload=function(){eval(ia.response)};ia.send()}function za(W){var ia=setupXhr();
|
|
749
750
|
ia.open('GET',W,!0);ia.setRequestHeader('Content-Type','text/css');ia.onload=function(){eval(ia.response)};ia.send()}function va(W){var ia='undefined'!=typeof W?T(W):M(this.id);if(!ia)throw Error('Popin name `'+W+'` not found !');W=document.getElementById(ia.id);var ea=ia.parentScripts,Aa=W.getElementsByTagName('script'),ma=ia.parentStyles,sa=W.getElementsByTagName('link'),Da=0,Qa=Aa.length,Ja=gina.config.hostname.replace(/(https|http|):\/\//,'').replace(/:\d+$/,'');for(Ja=new RegExp(Ja+':\\d+|'+
|
|
750
|
-
Ja);Da<Qa;++Da){if('undefined'==typeof Aa[Da].src||''==Aa[Da].src)continue;let Ia=Aa[Da].src.replace(/(https|http|):\/\//,'').replace(Ja,'');-1<ea.indexOf(Ia)||
|
|
751
|
+
Ja);Da<Qa;++Da){if('undefined'==typeof Aa[Da].src||''==Aa[Da].src)continue;let Ia=Aa[Da].src.replace(/(https|http|):\/\//,'').replace(Ja,'');-1<ea.indexOf(Ia)||w(Aa[Da].src)}Da=0;for(Qa=sa.length;Da<Qa;++Da)'undefined'!=typeof sa[Da].href&&''!=sa[Da].href&&(ea=sa[Da].href.replace(/(https|http|):\/\//,'').replace(Ja,''),-1<ma.indexOf(ea)||za(sa[Da].href));R({target:W,type:'loaded.'+ia.id},ia);/gina-popin-is-active/.test(W.className)||(W.className+=' gina-popin-is-active');if(!E.options.useDialogMode||
|
|
751
752
|
gina.config.envIsDev)/gina-popin-is-active/.test(n.target.firstChild.className)||(n.target.firstChild.className+=' gina-popin-is-active'),/gina-popin-is-active/.test(n.target.firstChild.className)&&removeListener(gina,n.target,'open.'+ia.id);E.options.useDialogMode&&!W.getAttribute('open')&&('function'===typeof W.showModal?gina.config.envIsDev?W.show():W.showModal():W.setAttribute('open',!0));ia.isOpen=!0;ia.target=W;n.activePopinId=ia.id;if(gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar)try{ginaToolbar.update('el-xhr',
|
|
752
753
|
ia.id)}catch(Ia){throw Ia;}triggerEvent(gina,n.target,'open.'+ia.id,ia)}function P(W,ia){var ea='undefined'!=typeof W?T(W):ha();if(!ea&&'undefined'!=typeof W)throw Error('Popin `'+W+'` not found !');if('undefined'!=typeof ea&&null!=ea&&(W=ea.target,ia='undefined'!=typeof ia?ia:!1,null!=W&&/gina-popin-is-active/.test(W.className))){ia||(n.target.firstChild.className=n.target.firstChild.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/,''),W.className=W.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/,
|
|
753
754
|
''),W.innerHTML='');if(z&&(ia=0,W=ea.$forms.length,z.$forms&&0<W))for(;ia<W;++ia)'undefined'!=typeof z.$forms[ea.$forms[ia]]&&z.$forms[ea.$forms[ia]].destroy(),ea.$forms.splice(ia,1);gina.popinIsBinded=!1;removeListener(gina,ea.target,'loaded.'+ea.id)}}function K(W){if('undefined'==typeof W&&/^true$/.test(this.isOpen)){W=this.name;var ia=this}else{ia=T(W)||ha();if(!ia)return;W=ia.name}if(!ia&&'undefined'!=typeof W)throw Error('Popin `'+W+'` not found !');if(ia.isOpen&&'undefined'!=typeof ia&&null!=
|
|
754
755
|
ia&&!ia.isRedirecting){var ea=ia.target;'function'===typeof ea.close?ea.close():ea.removeAttribute('open');removeListener(gina,ia.target,'ready.'+n.id);ia.hasForm&&(ia.hasForm=!1);if(null!=ea&&/gina-popin-is-active/.test(ea.className)){P(W);ia.isOpen=!1;gina.popinIsBinded=!1;GINA_ENV_IS_DEV&&gina&&'undefined'!=typeof window.ginaToolbar&&window.ginaToolbar&&ginaToolbar.restore();n.activePopinId=null;if(0<ia.$headers.length){W=0;ea=ia.$headers.length;try{for(;W<ea;++W)document.getElementById(ia.$headers[W].id).remove()}catch(Aa){console.warn('Could not remove script `'+
|
|
755
756
|
ia.$headers[W].id+'`\n'+Aa.stack)}ia.$headers=[]}triggerEvent(gina,ia.target,'close.'+ia.id,ia)}}}this.plugin='popin';var A='init loaded ready open close click destroy success error progress'.split(' ');registerEvents(this.plugin,A);var E={options:{name:void 0,'class':'gina-popin-default',useDialogMode:!0,cancelOnOverlayClick:!1},authorizedEvents:['ready','error'],events:{}},n={plugin:this.plugin,id:'gina-popins-'+Q.v4(),on,eventData:{},$popins:{},activePopinId:null,getActivePopin:null,target:document,
|
|
756
|
-
isReady:!1,initialized:!1},y={plugin:this.plugin,on,eventData:{},target:document,name:null,load:null,loadContent:null,open:null,isOpen:!1,isRedirecting:!1,close:null,$forms:[],hasForm:!1,$headers:[]},z=null,F=null,
|
|
757
|
+
isReady:!1,initialized:!1},y={plugin:this.plugin,on,eventData:{},target:document,name:null,load:null,loadContent:null,open:null,isOpen:!1,isRedirecting:!1,close:null,$forms:[],hasForm:!1,$headers:[]},z=null,F=null,x=[],u=function(){var W=document.createElement('div');W.id=n.id;W.setAttribute('id',n.id);W.setAttribute('class','gina-popins');if(!E.options.useDialogMode||gina.config.envIsDev){var ia=document.createElement('div');ia.setAttribute('id','gina-popins-overlay');ia.setAttribute('class','gina-popins-overlay');
|
|
757
758
|
W.appendChild(ia)}document.body.appendChild(W);n.target=W;n.on=on;gina.popinContainer=n.id},G=function(W,ia,ea){addListener(gina,W,'click',function(Aa){cancelEvent(Aa);triggerEvent(gina,ia,ea)})},M=function(W){return'undefined'!=typeof n.$popins[W]?n.$popins[W]:null},T=function(W){var ia=null,ea;for(ea in n.$popins)if(n.$popins[ea].name===W){ia=n.$popins[ea];break}return ia},ra=function(W,ia){ia=getElementsByAttribute('data-gina-popin-name');var ea=null,Aa=null,ma=null,sa=null,Da=null,Qa=null;Da=
|
|
758
759
|
0;for(Qa=ia.length;Da<Qa;++Da){ea=ia[Da];Aa=ea.getAttribute('data-gina-popin-name');'A'==ea.tagName&&(ma=ea.getAttribute('href'),''==ma||'#'==ma||/#/.test(ma))&&(ma=null);ma||'undefined'==typeof ea.getAttribute('data-gina-popin-url')||(ma=ea.getAttribute('data-gina-popin-url'));if(!ma)throw Error('Found `data-gina-popin-name` without `url` !');ea.url||(ea.url=ma);ea.popinName||(ea.popinName=Aa);if(Aa==W.name&&(sa='popin.click.gina-popin-'+n.id+'-'+Q.v4()+'-'+Aa,ea.id=sa,ea.setAttribute('id',sa),!gina.events[sa])){addListener(gina,
|
|
759
|
-
ea,sa,function(Ia){cancelEvent(Ia);var Ha=!1;addListener(gina,W.target,'loaded.'+W.id,function(Fa){Fa.preventDefault();Ha||(Ha=!0,console.debug('active popin should be ',W.id),gina.popin.activePopinId=W.id,R(Fa,W),W.isOpen||va(W.name))});Ia={isSynchrone:!1,withCredentials:!1};Ia=U(W.options,Ia);var mb=this.getAttribute('data-gina-popin-url')||this.getAttribute('href');if(!mb)throw Error('Popin `url` not defined, please check value for `data-gina-popin-url`');
|
|
760
|
+
ea,sa,function(Ia){cancelEvent(Ia);var Ha=!1;addListener(gina,W.target,'loaded.'+W.id,function(Fa){Fa.preventDefault();Ha||(Ha=!0,console.debug('active popin should be ',W.id),gina.popin.activePopinId=W.id,R(Fa,W),W.isOpen||va(W.name))});Ia={isSynchrone:!1,withCredentials:!1};Ia=U(W.options,Ia);var mb=this.getAttribute('data-gina-popin-url')||this.getAttribute('href');if(!mb)throw Error('Popin `url` not defined, please check value for `data-gina-popin-url`');v(W.name,mb,Ia)});Aa=ea.childNodes;var Ja=
|
|
760
761
|
0;lLen=Aa.length;if(0<lLen)for(;Ja<lLen;++Ja)'undefined'!=typeof Aa[Ja].tagName&&G(Aa[Ja],ea,sa)}}sa='click';addListener(gina,document,sa,function(Ia){if(null!=Ia.target.getAttribute('disabled')&&'false'!=Ia.target.getAttribute('disabled'))return!1;'undefined'==typeof Ia.target.id&&(Ia.target.setAttribute('id',sa+'.'+Q.v4()),Ia.target.id=Ia.target.getAttribute('id'));if(/^popin\.close\./.test(Ia.target.id)){cancelEvent(Ia);var Ha=Ia.target.id;triggerEvent(gina,Ia.target,Ha,Ia.detail)}/^popin\.click\./.test(Ia.target.id)&&
|
|
761
|
-
(cancelEvent(Ia),Ha=Ia.target.id,(new RegExp('^popin.click.gina-popin-'+n.id)).test(Ha)&&triggerEvent(gina,Ia.target,Ha,Ia.detail))});gina.popinIsBinded=!1},Ea={url:'',method:'GET',isSynchrone:!1,withCredentials:!0,headers:{'X-Requested-With':'XMLHttpRequest'}};gina.hasPopinHandler?(n.target=document.getElementById(gina.popinContainer),n.on=on):
|
|
762
|
-
n.close=K;addListener(gina,n.target,'init.'+n.id,function(ia){ia=null;if('undefined'==typeof n.$popins['gina-popin-'+n.id+'-'+W.name]){var ea=ia=U({},y);if('object'!=typeof W)throw Error('`options` must be an object');ea.options=U(W,E.options);ea.id='gina-popin-'+n.id+'-'+ea.options.name;if('undefined'==typeof n.$popins[ea.id]){if('string'!=typeof ea.options.name||''==ea.options.name)throw Error('`options.name` can not be left `empty` or `undefined`');if(-1<
|
|
763
|
-
ea.options.name+'` already exists !');'undefined'!=typeof ea.options.validator&&(z=ea.options.validator,ea.validateFormById=z.validateFormById);ea.options['class']='gina-popin-container '+ea.options['class'];ea.name=ea.options.name;ea.target=n.target;ea.load=
|
|
762
|
+
(cancelEvent(Ia),Ha=Ia.target.id,(new RegExp('^popin.click.gina-popin-'+n.id)).test(Ha)&&triggerEvent(gina,Ia.target,Ha,Ia.detail))});gina.popinIsBinded=!1},Ea={url:'',method:'GET',isSynchrone:!1,withCredentials:!0,headers:{'X-Requested-With':'XMLHttpRequest'}};gina.hasPopinHandler?(n.target=document.getElementById(gina.popinContainer),n.on=on):u();new V(function(W,ia){if(W)throw W;la=ia});return function(W){n.getPopinById=M;n.getPopinByName=T;n.load=v;n.loadContent=I;n.getActivePopin=ha;n.open=va;
|
|
763
|
+
n.close=K;addListener(gina,n.target,'init.'+n.id,function(ia){ia=null;if('undefined'==typeof n.$popins['gina-popin-'+n.id+'-'+W.name]){var ea=ia=U({},y);if('object'!=typeof W)throw Error('`options` must be an object');ea.options=U(W,E.options);ea.id='gina-popin-'+n.id+'-'+ea.options.name;if('undefined'==typeof n.$popins[ea.id]){if('string'!=typeof ea.options.name||''==ea.options.name)throw Error('`options.name` can not be left `empty` or `undefined`');if(-1<x.indexOf(ea.options.name))throw Error('`popin '+
|
|
764
|
+
ea.options.name+'` already exists !');'undefined'!=typeof ea.options.validator&&(z=ea.options.validator,ea.validateFormById=z.validateFormById);ea.options['class']='gina-popin-container '+ea.options['class'];ea.name=ea.options.name;ea.target=n.target;ea.load=v;ea.loadContent=I;ea.open=va;ea.close=K;GINA_ENV_IS_DEV&&(ea.updateToolbar=S);ea.parentScripts=[];ea.parentStyles=[];var Aa=gina.config.hostname.replace(/(https|http|):\/\//,'').replace(/:\d+$/,'');Aa=new RegExp(Aa+':\\d+|'+Aa);var ma=document.getElementsByTagName('script');
|
|
764
765
|
for(let Da=0,Qa=ma.length;Da<Qa;Da++)if(ma[Da].src&&''!=ma[Da].src){var sa=ma[Da].src.replace(/(https|http|):\/\//,'').replace(Aa,'');ea.parentScripts[Da]=sa}ma=document.getElementsByTagName('link');for(let Da=0,Qa=ma.length;Da<Qa;Da++)'undefined'!=typeof ma[Da].rel&&/stylesheet/i.test(ma[Da].rel)&&(sa=ma[Da].href.replace(/(https|http|):\/\//,'').replace(Aa,''),ea.parentStyles[Da]=sa);n.$popins[ea.id]=ea;if(window.XMLHttpRequest)F=new XMLHttpRequest;else if(window.ActiveXObject)try{F=new ActiveXObject('Msxml2.XMLHTTP')}catch(Da){try{F=
|
|
765
766
|
new ActiveXObject('Microsoft.XMLHTTP')}catch(Qa){}}ra(ea)}}n.isReady=!0;gina.hasPopinHandler=!0;gina.popin=U(gina.popin,n);triggerEvent(gina,n.target,'ready.'+n.id,ia)});n.initialized=!0;return n}(N)}});
|
|
766
767
|
'function'!==typeof Object.assign&&Object.defineProperty(Object,'assign',{value:function(B,Q){if(null===B||void 0===B)throw new TypeError('Cannot convert undefined or null to object');for(var V=Object(B),la=1;la<arguments.length;la++){var U=arguments[la];if(null!==U&&void 0!==U)for(var N in U)Object.prototype.hasOwnProperty.call(U,N)&&(V[N]=U[N])}return V},writable:!0,configurable:!0});
|