From 689537c7afa699533f222d99ae47c2b91be6db1f Mon Sep 17 00:00:00 2001 From: Mina Nagy Zaki Date: Fri, 28 Apr 2017 10:44:55 +0200 Subject: [PATCH 1/6] tests: remove duplicate sf-schema tests --- src/directives/sf-schema.directive.spec.js | 191 --------------------- 1 file changed, 191 deletions(-) diff --git a/src/directives/sf-schema.directive.spec.js b/src/directives/sf-schema.directive.spec.js index b662b3385..93af13372 100644 --- a/src/directives/sf-schema.directive.spec.js +++ b/src/directives/sf-schema.directive.spec.js @@ -2217,197 +2217,6 @@ describe('sf-schema.directive.js', function() { }); }); - it('should not add "has-success" class to radios field if a correct value is entered, but disableSuccessState is set on form', function () { - var field = { - name: 'radios', - property: { - type: 'boolean', - }, - form: { - key: ["field"], - type: "radios", - titleMap: [ - { - "value": false, - "name": "No way" - }, - { - "value": true, - "name": "OK" - } - ] - } - }; - - inject(function($compile, $rootScope) { - var scope = $rootScope.$new(); - scope.model = {} - scope.schema = { - type: 'object', - properties: { - field: field.property - } - }; - scope.form = [field.form]; - - var tmpl = angular.element('
'); - $compile(tmpl)(scope); - runSync(scope, tmpl); - var ngModelCtrl = tmpl.find('.field').scope().ngModel; - ngModelCtrl.$valid = true; - ngModelCtrl.$pristine = false; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-success').should.be.true; - scope.form[0].disableSuccessState = true; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-success').should.be.false; - }); - }); - - it('should not add "has-error" class to radios field if invalid value is entered, but disableErrorState is set on form', function () { - var field = { - name: 'radios', - property: { - type: 'boolean', - }, - form: { - key: ["field"], - type: "radios", - titleMap: [ - { - "value": false, - "name": "No way" - }, - { - "value": true, - "name": "OK" - } - ] - } - }; - - inject(function($compile, $rootScope) { - var scope = $rootScope.$new(); - scope.model = { - field: field.errorValue - } - scope.schema = { - type: 'object', - properties: { - field: field.property - } - }; - scope.form = [field.form]; - - var tmpl = angular.element('
'); - $compile(tmpl)(scope); - runSync(scope, tmpl); - var ngModelCtrl = tmpl.find('.field').scope().ngModel; - ngModelCtrl.$invalid = true; - ngModelCtrl.$pristine = false; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-error').should.be.true; - scope.form[0].disableErrorState = true; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-error').should.be.false; - }); - }); - - it('should not add "has-success" class to radios-inline field if a correct value is entered, but disableSuccessState is set on form', function () { - var field = { - name: 'radios', - property: { - type: 'boolean', - }, - form: { - key: ["field"], - type: "radios", - titleMap: [ - { - "value": false, - "name": "No way" - }, - { - "value": true, - "name": "OK" - } - ] - } - }; - - inject(function($compile, $rootScope) { - var scope = $rootScope.$new(); - scope.model = {} - scope.schema = { - type: 'object', - properties: { - field: field.property - } - }; - scope.form = [field.form]; - - var tmpl = angular.element('
'); - $compile(tmpl)(scope); - runSync(scope, tmpl); - var ngModelCtrl = tmpl.find('.field').scope().ngModel; - ngModelCtrl.$valid = true; - ngModelCtrl.$pristine = false; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-success').should.be.true; - scope.form[0].disableSuccessState = true; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-success').should.be.false; - }); - }); - - it('should not add "has-error" class to radios-inline field if invalid value is entered, but disableErrorState is set on form', function () { - var field = { - name: 'radios', - property: { - type: 'boolean', - }, - form: { - key: ["field"], - type: "radios", - titleMap: [ - { - "value": false, - "name": "No way" - }, - { - "value": true, - "name": "OK" - } - ] - } - }; - - inject(function($compile, $rootScope) { - var scope = $rootScope.$new(); - scope.model = { - field: field.errorValue - } - scope.schema = { - type: 'object', - properties: { - field: { type: 'boolean' } - } - }; - scope.form = [field.form]; - - var tmpl = angular.element('
'); - $compile(tmpl)(scope); - runSync(scope, tmpl); - var ngModelCtrl = tmpl.find('.field').scope().ngModel; - ngModelCtrl.$invalid = true; - ngModelCtrl.$pristine = false; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-error').should.be.true; - scope.form[0].disableErrorState = true; - $rootScope.$apply(); - tmpl.find('.field').hasClass('has-error').should.be.false; - }); - }); /* TODO it('should handle onChange for array type', function () { From 0a2075518891ee97713adf5428cc67d94cbe2bd2 Mon Sep 17 00:00:00 2001 From: Mina Nagy Zaki Date: Fri, 28 Apr 2017 10:46:14 +0200 Subject: [PATCH 2/6] tests: sf-field tests for form.key generation issue json-schema-form/angular-schema-form#870 --- src/directives/sf-field.directive.spec.js | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/directives/sf-field.directive.spec.js diff --git a/src/directives/sf-field.directive.spec.js b/src/directives/sf-field.directive.spec.js new file mode 100644 index 000000000..c31e67bf4 --- /dev/null +++ b/src/directives/sf-field.directive.spec.js @@ -0,0 +1,80 @@ +chai.should(); + +var runSync = function (scope, tmpl) { + var directiveScope = tmpl.isolateScope(); + var stub = sinon.stub(directiveScope, 'resolveReferences', function(schema, form) { + directiveScope.render(schema, form); + }); + scope.$apply(); +} + +describe('sf-field.directive.js',function() { + beforeEach(module('schemaForm')); + beforeEach( + module(function($sceProvider){ + $sceProvider.enabled(false); + }) + ); + + var keyTests = [ + { + name: 'array of objects', + targetKey: ['arrayOfObjects', 0, 'stringVal'], + schema: { + type: 'object', + properties: { + arrayOfObjects: { + type: 'array', + items: { + type: 'object', + properties: { + stringVal: { + type: 'string', + 'x-schema-form': { + htmlClass: 'targetKey' + } + } + } + } + } + } + }, + }, + + { + name: 'array of strings', + targetKey: ['arrayOfStrings', 0], + schema: { + type: 'object', + properties: { + arrayOfStrings: { + type: 'array', + items: { + type: 'string', + 'x-schema-form': { + htmlClass: 'targetKey' + } + } + } + } + } + } + ]; + + keyTests.forEach(function(keyTest) { + it('should generate correct form keys for ' + keyTest.name, function(done) { + inject(function($compile,$rootScope) { + var scope = $rootScope.$new(); + scope.model = {}; + scope.schema = keyTest.schema; + + var tmpl = angular.element('
'); + + $compile(tmpl)(scope); + runSync(scope, tmpl); + + tmpl.children().find('.targetKey').scope().form.key.should.deep.equal(keyTest.targetKey); + }); + }); + }); +}); From 45f993e8fc3bd8f0fb1f04537c19ec874bba9350 Mon Sep 17 00:00:00 2001 From: Mina Nagy Zaki Date: Fri, 28 Apr 2017 10:47:20 +0200 Subject: [PATCH 3/6] tests: use mocha reporter and enable diffs mocha reporter is better than dots + progress but especially for diff output as it is needed to see deep comparisons between arrays/objects (for example while looking at wrong keys in the sf-field.directive tests) --- karma.conf.js | 6 +++++- package.json | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 0e9b9204f..b024a62db 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -34,7 +34,11 @@ module.exports = function(config) { // test results reporter to use // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' - reporters: ['dots','progress','coverage','growler'], + reporters: ['mocha','coverage','growler'], + + mochaReporter: { + showDiff: true + }, preprocessors: { 'src/**/*.js': ['coverage'] diff --git a/package.json b/package.json index 91f48cc24..eacf40b8f 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "babel-polyfill": "^6.16.0", "babel-preset-es2015": "^6.18.0", "chai": "^3.5.0", + "diff": "^3.2.0", "html-webpack-externals-plugin": "^2.1.2", "karma": "^1.3.0", "karma-babel-preprocessor": "^6.0.1", @@ -58,6 +59,7 @@ "karma-coverage": "^1.1.1", "karma-growler-reporter": "0.0.1", "karma-mocha": "^1.3.0", + "karma-mocha-reporter": "^2.2.3", "karma-phantomjs-launcher": "^1.0.2", "karma-webpack": "^1.8.0", "mocha": "^3.2.0", From f22e9618ba6627de5119d293bf85485263569d5d Mon Sep 17 00:00:00 2001 From: Mina Nagy Zaki Date: Sat, 29 Apr 2017 12:14:42 +0200 Subject: [PATCH 4/6] sf-field: add more key tests, with supplied form --- src/directives/sf-field.directive.spec.js | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/directives/sf-field.directive.spec.js b/src/directives/sf-field.directive.spec.js index c31e67bf4..9686afb49 100644 --- a/src/directives/sf-field.directive.spec.js +++ b/src/directives/sf-field.directive.spec.js @@ -20,6 +20,7 @@ describe('sf-field.directive.js',function() { { name: 'array of objects', targetKey: ['arrayOfObjects', 0, 'stringVal'], + schema: { type: 'object', properties: { @@ -39,11 +40,23 @@ describe('sf-field.directive.js',function() { } } }, + + form: [ + { + key: 'arrayOfObjects', + items: [ + { + key: 'arrayOfObjects[].stringVal' + } + ] + } + ] }, { name: 'array of strings', targetKey: ['arrayOfStrings', 0], + schema: { type: 'object', properties: { @@ -74,7 +87,27 @@ describe('sf-field.directive.js',function() { runSync(scope, tmpl); tmpl.children().find('.targetKey').scope().form.key.should.deep.equal(keyTest.targetKey); + done(); }); }); + + if (keyTest.form) { + it('should generate correct form keys for ' + keyTest.name + ' with user specified form', function(done) { + inject(function($compile,$rootScope) { + var scope = $rootScope.$new(); + scope.model = {}; + scope.schema = keyTest.schema; + scope.form = keyTest.form; + + var tmpl = angular.element('
'); + + $compile(tmpl)(scope); + runSync(scope, tmpl); + + tmpl.children().find('.targetKey').scope().form.key.should.deep.equal(keyTest.targetKey); + done(); + }); + }); + } }); }); From 19a142a4cff640d38c024f984728a09f572e27c9 Mon Sep 17 00:00:00 2001 From: Mina Nagy Zaki Date: Sat, 29 Apr 2017 12:18:59 +0200 Subject: [PATCH 5/6] sf-field: fix form key edge case --- src/directives/sf-field.directive.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/directives/sf-field.directive.js b/src/directives/sf-field.directive.js index 01b74d254..e68ff0995 100644 --- a/src/directives/sf-field.directive.js +++ b/src/directives/sf-field.directive.js @@ -46,18 +46,18 @@ sfPath, sfSelect) { if(scope.completeKey !== scope.form.key) { if (typeof scope.$index === 'number') { key = key.concat(scope.$index); - }; + } if(scope.form.key && scope.form.key.length) { if(typeof key[key.length-1] === 'number' && scope.form.key.length >= 1) { let trim = scope.form.key.length - key.length; - scope.completeKey = key.concat(scope.form.key.slice(-trim)); - } - else { + scope.completeKey = + trim > 0 ? key.concat(scope.form.key.slice(-trim)) : key; + } else { scope.completeKey = scope.form.key.slice(); - }; - }; - }; + } + } + } // If there is no key then there's nothing to return if(!Array.isArray(scope.completeKey)) { From dead8ab71a95abee1b68f726baf4356e11aa7e31 Mon Sep 17 00:00:00 2001 From: Mina Nagy Zaki Date: Mon, 1 May 2017 10:41:10 +0200 Subject: [PATCH 6/6] build angular-schema-form --- dist/angular-schema-form.js | 111 ++++++++++++++++---------------- dist/angular-schema-form.min.js | 11 ++-- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/dist/angular-schema-form.js b/dist/angular-schema-form.js index 40b8b370c..f17d5548f 100644 --- a/dist/angular-schema-form.js +++ b/dist/angular-schema-form.js @@ -1,7 +1,7 @@ /*! * angular-schema-form * @version 1.0.0-alpha.5 - * @date Wed, 26 Apr 2017 14:49:08 GMT + * @date Mon, 01 May 2017 08:39:39 GMT * @link https://github.com/json-schema-form/angular-schema-form * @license MIT * Copyright (c) 2014-2017 JSON Schema Form @@ -14,9 +14,9 @@ /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; -/******/ +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, @@ -2729,33 +2729,34 @@ module.exports = __webpack_require__(4); /***/ }) /******/ ]); //# sourceMappingURL=json-schema-form-core.js.map + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(19).setImmediate)) /***/ }), /* 2 */ /***/ (function(module, exports) { -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; /***/ }), @@ -2842,7 +2843,7 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps) /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__); -/* harmony default export */ __webpack_exports__["a"] = function (sfValidator, $parse, sfSelect, $interpolate) { +/* harmony default export */ __webpack_exports__["a"] = (function (sfValidator, $parse, sfSelect, $interpolate) { return { restrict: 'A', scope: false, @@ -3032,7 +3033,7 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps) }; } }; -}; +}); /***/ }), /* 6 */ @@ -3048,7 +3049,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol /** * Directive that handles the model arrays */ -/* harmony default export */ __webpack_exports__["a"] = function (sfSelect, sfPath, schemaForm) { +/* harmony default export */ __webpack_exports__["a"] = (function (sfSelect, sfPath, schemaForm) { return { scope: true, controller: ['$scope', function SFArrayController($scope) { @@ -3279,7 +3280,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; } }; -}; +}); /***/ }), /* 7 */ @@ -3297,7 +3298,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol * Takes the form definition as argument. * If the form definition has a "onChange" defined as either a function or */ -/* harmony default export */ __webpack_exports__["a"] = function () { +/* harmony default export */ __webpack_exports__["a"] = (function () { return { require: 'ngModel', restrict: 'AC', @@ -3325,7 +3326,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } } }; -}; +}); /***/ }), /* 8 */ @@ -3338,7 +3339,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol -/* harmony default export */ __webpack_exports__["a"] = function ($parse, $compile, $http, $templateCache, $interpolate, $q, sfErrorMessage, sfPath, sfSelect) { +/* harmony default export */ __webpack_exports__["a"] = (function ($parse, $compile, $http, $templateCache, $interpolate, $q, sfErrorMessage, sfPath, sfSelect) { var keyFormat = { COMPLETE: '*', @@ -3383,17 +3384,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol if (scope.completeKey !== scope.form.key) { if (typeof scope.$index === 'number') { key = key.concat(scope.$index); - }; + } if (scope.form.key && scope.form.key.length) { if (typeof key[key.length - 1] === 'number' && scope.form.key.length >= 1) { var trim = scope.form.key.length - key.length; - scope.completeKey = key.concat(scope.form.key.slice(-trim)); + scope.completeKey = trim > 0 ? key.concat(scope.form.key.slice(-trim)) : key; } else { scope.completeKey = scope.form.key.slice(); - }; - }; - }; + } + } + } // If there is no key then there's nothing to return if (!Array.isArray(scope.completeKey)) { @@ -3659,7 +3660,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } } }; -}; +}); /***/ }), /* 9 */ @@ -3669,7 +3670,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol /** * Directive that handles keys and array indexes */ -/* harmony default export */ __webpack_exports__["a"] = function (schemaForm, sfPath) { +/* harmony default export */ __webpack_exports__["a"] = (function (schemaForm, sfPath) { return { scope: true, require: ['?^^sfNewArray'], @@ -3698,7 +3699,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol } } }; -};; +});; /***/ }), /* 10 */ @@ -3709,7 +3710,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__); -/* harmony default export */ __webpack_exports__["a"] = function ($injector, sfErrorMessage) { +/* harmony default export */ __webpack_exports__["a"] = (function ($injector, sfErrorMessage) { //Inject sanitizer if it exists var $sanitize = $injector.has('$sanitize') ? $injector.get('$sanitize') : function (html) { @@ -3802,7 +3803,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }); } }; -}; +}); /***/ }), /* 11 */ @@ -3818,7 +3819,7 @@ FIXME: real documentation
*/ -/* harmony default export */ __webpack_exports__["a"] = function ($compile, $http, $templateCache, $q, schemaForm, schemaFormDecorators, sfSelect, sfPath, sfBuilder) { +/* harmony default export */ __webpack_exports__["a"] = (function ($compile, $http, $templateCache, $q, schemaForm, schemaFormDecorators, sfSelect, sfPath, sfBuilder) { return { scope: { @@ -4032,7 +4033,7 @@ FIXME: real documentation }; } }; -}; +}); /***/ }), /* 12 */ @@ -4043,7 +4044,7 @@ FIXME: real documentation /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__); -/* harmony default export */ __webpack_exports__["a"] = function ($compileProvider, sfPathProvider) { +/* harmony default export */ __webpack_exports__["a"] = (function ($compileProvider, sfPathProvider) { var defaultDecorator = ''; var decorators = {}; @@ -4463,11 +4464,11 @@ FIXME: real documentation * @param {string} name directive name (CamelCased) * @param {Object} fields, an object that maps "type" => `{ template, builder, replace}`. attributes `builder` and `replace` are optional, and replace defaults to true. - `template` should be the key of the template to load and it should be pre-loaded + `template` should be the key of the template to load and it should be pre-loaded in `$templateCache`. - `builder` can be a function or an array of functions. They will be called in + `builder` can be a function or an array of functions. They will be called in the order they are supplied. - `replace` (DEPRECATED) is for backwards compatability. If false the builder + `replace` (DEPRECATED) is for backwards compatability. If false the builder will use the "old" way of building that form field using a directive. */ @@ -4575,7 +4576,7 @@ FIXME: real documentation //Create a default directive createDirective('sfDecorator'); -};; +});; /***/ }), /* 13 */ @@ -4593,7 +4594,7 @@ FIXME: real documentation /** * Schema form service. */ -/* harmony default export */ __webpack_exports__["a"] = function () { +/* harmony default export */ __webpack_exports__["a"] = (function () { var postProcessFn = function postProcessFn(form) { return form; }; @@ -4714,7 +4715,7 @@ FIXME: real documentation return service; }; -}; +}); /***/ }), /* 14 */ @@ -4723,7 +4724,7 @@ FIXME: real documentation "use strict"; // FIXME: type template (using custom builder) -/* harmony default export */ __webpack_exports__["a"] = function (sfPathProvider) { +/* harmony default export */ __webpack_exports__["a"] = (function (sfPathProvider) { var SNAKE_CASE_REGEXP = /[A-Z]/g; var snakeCase = function snakeCase(name, separator) { @@ -5042,7 +5043,7 @@ FIXME: real documentation internalBuild: _build }; }]; -}; +}); /***/ }), /* 15 */ @@ -5053,7 +5054,7 @@ FIXME: real documentation /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__); -/* harmony default export */ __webpack_exports__["a"] = function () { +/* harmony default export */ __webpack_exports__["a"] = (function () { // The codes are tv4 error codes. // Not all of these can actually happen in a field, but for @@ -5179,7 +5180,7 @@ FIXME: real documentation return service; }]; -}; +}); /***/ }), /* 16 */ @@ -5219,7 +5220,7 @@ var sfPathProviderClass = function () { return sfPathProviderClass; }(); -/* harmony default export */ __webpack_exports__["a"] = sfPathProviderClass; +/* harmony default export */ __webpack_exports__["a"] = (sfPathProviderClass); /***/ }), /* 17 */ diff --git a/dist/angular-schema-form.min.js b/dist/angular-schema-form.min.js index 6a6981fc9..98d17ea76 100644 --- a/dist/angular-schema-form.min.js +++ b/dist/angular-schema-form.min.js @@ -1,12 +1,12 @@ /*! * angular-schema-form * @version 1.0.0-alpha.5 - * @date Wed, 26 Apr 2017 14:49:08 GMT + * @date Mon, 01 May 2017 08:39:39 GMT * @link https://github.com/json-schema-form/angular-schema-form * @license MIT * Copyright (c) 2014-2017 JSON Schema Form */ -!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=21)}([function(e,t){e.exports=angular},function(e,t,r){(function(t,r){/*! +!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=21)}([function(e,t){e.exports=angular},function(e,t,r){(function(t,r){/*! * json-schema-form-core * @version 1.0.0-alpha.4 * @date Sat, 15 Apr 2017 08:25:55 GMT @@ -14,11 +14,11 @@ * @license MIT * Copyright (c) 2014-2017 JSON Schema Form */ -e.exports=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=13)}([function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){var o=e.slice(),i=t||"-";return n&&(o=o.filter(function(e){return"number"!=typeof e})),(0!==r.length?r+i:"")+o.join(i)}return""}Object.defineProperty(t,"__esModule",{value:!0});var o=r(2);r.n(o);r.o(o,"parse")&&r.d(t,"parse",function(){return o.parse}),r.o(o,"stringify")&&r.d(t,"stringify",function(){return o.stringify}),r.o(o,"normalize")&&r.d(t,"normalize",function(){return o.normalize}),t.name=n},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.a=function(e,t){if(!Array.isArray(e)){var r=function(){var r=[];return t?t.forEach(function(t){r.push({name:e[t],value:t})}):Object.keys(e).forEach(function(t){r.push({name:e[t],value:t})}),{v:r}}();if("object"===("undefined"==typeof r?"undefined":n(r)))return r.v}return e}},function(e,t,r){e.exports=r(11).ObjectPath},function(e,t,r){"use strict";function n(e,t,r,o){var i=e[g(r.type)];if(i)for(var a=void 0,s=function(t,r,o){return n(e,t,r,o)},u=0;u-1?n=i:(r=h(e,"Undefined")?void 0:v(e),h(r,"Undefined")?n=i:(n=r,n.path=I(D.join(r.path,i.path)),n.query=o(r.query,i.query))),n.fragment=void 0,(V.indexOf(n.reference)===-1&&0===n.path.indexOf("../")?"../":"")+R.serialize(n)}function a(e,t){var r,n=[];return t.length>0&&(r=e,t.slice(0,t.length-1).forEach(function(e){e in r&&(r=r[e],n.push(r))})),n}function s(e,t,r,o,i,a,s,f,l){var p,d;if(r.length>0)try{p=c(t,r)}catch(t){"remote"===e&&(o.error=t.message,o.missing=!0)}else p=t;if(h(p,"Undefined")||(o.value=p),h(p,"Array")||h(p,"Object"))return d=n(i),"local"===e?(delete d.subDocPath,t=p):(d.relativeBase=D.dirname(a[a.length-1]),0===r.length?delete d.subDocPath:d.subDocPath=r),u(t,d,a,s,f,l)}function u(e,t,r,n,o,a){var u=Promise.resolve(),c=n.length?A(n[n.length-1]):[],f=O(e,t),l=t.subDocPath||[],d=T(l),m=["#"];return r.forEach(function(e,t){"#"!==e.charAt(0)&&m.push(n[t])}),m.reverse(),"#"!==(r[r.length-1]||"").charAt(0)&&(o.documents[T(c)]=e),Object.keys(f).forEach(function(y){var v,g,b,x,w=f[y];b=0===r.length?c.concat(A(y)):c.concat(A(y).slice(0===r.length?0:l.length)),x=T(b),h(o[x],"Undefined")&&(o.refs[x]=f[y],h(w.error,"Undefined")&&"invalid"!==w.type&&(N.indexOf(w.type)>-1?(v=i(t.relativeBase,w.uri),g=r.indexOf(v)):(v=w.uri,g=n.indexOf(v)),w.ancestorPtrs=m,w.indirect=a,g===-1?N.indexOf(w.type)>-1?u=u.then(function(){return p(v,t).then(function(e){return s("remote",e,h(w.uriDetails.fragment,"Undefined")?[]:A(decodeURI(w.uriDetails.fragment)),w,t,r.concat(v),n.concat(x),o,a)}).catch(function(e){w.error=e.message,w.missing=!0})}):0!==x.indexOf(v+"/")&&x!==v&&0!==d.indexOf(v+"/")&&d!==v?0!==v.indexOf(d+"/")&&(u=u.then(function(){return s("local",e,A(v),w,t,r.concat(v),n.concat(x),o,a||v.indexOf(d+"/")===-1&&v!==d)})):w.circular=!0:(n.slice(g).forEach(function(e){o.refs[e].circular=!0}),w.circular=!0)))}),u=u.then(function(){function e(i,a,s,u){Object.keys(o.refs).forEach(function(c){var f=o.refs[c];n.indexOf(u)===-1&&r.indexOf(s)===-1&&t.indexOf(u)===-1&&c!==s&&0===c.indexOf(u+"/")&&(a.indexOf(u)>-1?a.forEach(function(e){t.indexOf(u)===-1&&t.push(e)}):e(i.concat(s),a.concat(u),c,f.uri),r.push(s),n.push(u))})}var t=[],r=[],n=[];Object.keys(o.refs).forEach(function(r){var n=o.refs[r];"local"!==n.type||n.circular||t.indexOf(n.uri)!==-1||e([],[],r,n.uri)}),Object.keys(o.refs).forEach(function(e){var r=o.refs[e];t.indexOf(r.uri)>-1&&(r.circular=!0)})}).then(function(){return o})}function c(e,t){var r=e;return t.forEach(function(e){if(e=decodeURI(e),!(e in r))throw Error("JSON Pointer points to missing location: "+T(t));r=r[e]}),r}function f(e){return Object.keys(e).filter(function(e){return"$ref"!==e})}function l(e){var t;switch(e.uriDetails.reference){case"absolute":case"uri":t="remote";break;case"same-document":t="local";break;default:t=e.uriDetails.reference}return t}function p(e,t){var r=q[e],o=Promise.resolve(),i=n(t.loaderOptions||{});return h(r,"Undefined")?(h(i.processContent,"Undefined")&&(i.processContent=function(e,t){t(void 0,JSON.parse(e.text))}),o=_.load(decodeURI(e),i),o=o.then(function(t){return q[e]={value:t},t}).catch(function(t){throw q[e]={error:t},t})):o=o.then(function(){return r.value}),o=o.then(function(e){return n(e)})}function d(e,t){var r=!0;try{if(!h(e,"Object"))throw new Error("obj is not an Object");if(!h(e.$ref,"String"))throw new Error("obj.$ref is not a String")}catch(e){if(t)throw e;r=!1}return r}function h(e,t){return"Undefined"===t?"undefined"==typeof e:Object.prototype.toString.call(e)==="[object "+t+"]"}function m(e){var t,r;return h(e.filter,"Array")||h(e.filter,"String")?(r=h(e.filter,"String")?[e.filter]:e.filter,t=function(e){return r.indexOf(e.type)>-1||r.indexOf(l(e))>-1}):h(e.filter,"Function")?t=e.filter:h(e.filter,"Undefined")&&(t=function(){return!0}),function(r,n){return("invalid"!==r.type||e.includeInvalid===!0)&&t(r,n)}}function y(e){var t;return h(e.subDocPath,"Array")?t=e.subDocPath:h(e.subDocPath,"String")?t=A(e.subDocPath):h(e.subDocPath,"Undefined")&&(t=[]),t}function v(e){return R.parse(encodeURI(decodeURI(e)))}function g(e,t,r){c(e,t.slice(0,t.length-1))[decodeURI(t[t.length-1])]=r}function b(e,t,r,n){function o(t,o){r.push(o),b(e,t,r,n),r.pop()}var i=!0;h(n,"Function")&&(i=n(e,t,r)),e.indexOf(t)===-1&&(e.push(t),i!==!1&&(h(t,"Array")?t.forEach(function(e,t){o(e,t.toString())}):h(t,"Object")&&Object.keys(t).forEach(function(e){o(t[e],e)}))),e.pop()}function x(e,t){if(e=h(e,"Undefined")?{}:n(e),!h(e,"Object"))throw new TypeError("options must be an Object");if(!(h(e.filter,"Undefined")||h(e.filter,"Array")||h(e.filter,"Function")||h(e.filter,"String")))throw new TypeError("options.filter must be an Array, a Function of a String");if(!h(e.includeInvalid,"Undefined")&&!h(e.includeInvalid,"Boolean"))throw new TypeError("options.includeInvalid must be a Boolean");if(!h(e.refPreProcessor,"Undefined")&&!h(e.refPreProcessor,"Function"))throw new TypeError("options.refPreProcessor must be a Function");if(!h(e.refPostProcessor,"Undefined")&&!h(e.refPostProcessor,"Function"))throw new TypeError("options.refPostProcessor must be a Function");if(!h(e.subDocPath,"Undefined")&&!h(e.subDocPath,"Array")&&!S(e.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(e.filter=m(e),e.subDocPath=y(e),!h(t,"Undefined"))try{c(t,e.subDocPath)}catch(e){throw e.message=e.message.replace("JSON Pointer","options.subDocPath"),e}return e}function w(){q={}}function E(e){if(!h(e,"Array"))throw new TypeError("path must be an array");return e.map(function(e){return h(e,"String")||(e=JSON.stringify(e)),decodeURI(e.replace(/~1/g,"/").replace(/~0/g,"~"))})}function $(e){if(!h(e,"Array"))throw new TypeError("path must be an array");return e.map(function(e){return h(e,"String")||(e=JSON.stringify(e)),e.replace(/~/g,"~0").replace(/\//g,"~1")})}function O(e,t){var r={};if(!h(e,"Array")&&!h(e,"Object"))throw new TypeError("obj must be an Array or an Object");return t=x(t,e),b(a(e,t.subDocPath),c(e,t.subDocPath),n(t.subDocPath),function(e,o,i){var a,s=!0;return d(o)&&(h(t.refPreProcessor,"Undefined")||(o=t.refPreProcessor(n(o),i)),a=P(o),h(t.refPostProcessor,"Undefined")||(a=t.refPostProcessor(a,i)),t.filter(a,i)&&(r[T(i)]=a),f(o).length>0&&(s=!1)),s}),r}function C(e,t){var r=Promise.resolve();return r=r.then(function(){if(!h(e,"String"))throw new TypeError("location must be a string");return t=x(t),e=i(t.relativeBase,e),p(e,t)}).then(function(r){var o=n(q[e]),i=n(t),a=v(e);return h(o.refs,"Undefined")&&(delete i.filter,delete i.subDocPath,i.includeInvalid=!0,q[e].refs=O(r,i)),h(t.filter,"Undefined")||(i.filter=t.filter),h(a.fragment,"Undefined")?h(a.subDocPath,"Undefined")||(i.subDocPath=t.subDocPath):i.subDocPath=A(decodeURI(a.fragment)),{refs:O(r,i),value:r}})}function P(e){var t,r,n,o={def:e};try{d(e,!0)?(t=e.$ref,n=L[t],h(n,"Undefined")&&(n=L[t]=v(t)),o.uri=t,o.uriDetails=n,h(n.error,"Undefined")?o.type=l(o):(o.error=o.uriDetails.error,o.type="invalid"),r=f(e),r.length>0&&(o.warning="Extra JSON Reference properties will be ignored: "+r.join(", "))):o.type="invalid"}catch(e){o.error=e.message,o.type="invalid"}return o}function S(e,t){var r,n=!0;try{if(!h(e,"String"))throw new Error("ptr is not a String");if(""!==e){if(r=e.charAt(0),["#","/"].indexOf(r)===-1)throw new Error("ptr must start with a / or #/");if("#"===r&&"#"!==e&&"/"!==e.charAt(1))throw new Error("ptr must start with a / or #/");if(e.match(U))throw new Error("ptr has invalid token(s)")}}catch(e){if(t===!0)throw e;n=!1}return n}function k(e,t){return d(e,t)&&"invalid"!==P(e,t).type}function A(e){if(!S(e))throw new Error("ptr must be a JSON Pointer");var t=e.split("/");return t.shift(),E(t)}function T(e,t){if(!h(e,"Array"))throw new Error("path must be an Array");return(t!==!1?"#":"")+(e.length>0?"/":"")+$(e).join("/")}function M(e,t){var r=Promise.resolve();return r=r.then(function(){if(!h(e,"Array")&&!h(e,"Object"))throw new TypeError("obj must be an Array or an Object");t=x(t,e),e=n(e)}).then(function(){return u(e,t,[],[],{documents:{},refs:{}})}).then(function(t){function r(e,t){return A(e).length-A(t).length}var n={},o={};return Object.keys(t.refs).sort(r).forEach(function(r){var i=t.refs[r];i.indirect||(o[r]=i),delete i.indirect,h(i.error,"Undefined")&&"invalid"!==i.type?(h(i.value,"Undefined")&&i.circular&&(i.value=i.def),h(i.value,"Undefined")?n[r]=i:("#"===r?e=i.value:g(e,A(r),i.value),delete i.ancestorPtrs)):delete i.ancestorPtrs}),Object.keys(n).forEach(function(r){var o=n[r];o.ancestorPtrs.forEach(function(n,i){if(h(o.value,"Undefined"))try{o.value=c(t.documents[n],A(o.uri)),delete o.ancestorPtrs,g(e,A(r),o.value)}catch(e){i===o.ancestorPtrs.length-1&&(o.error=e.message,o.missing=!0,delete o.ancestorPtrs)}})}),{refs:o,resolved:e}})}function j(e,t){var r=Promise.resolve();return r=r.then(function(){if(!h(e,"String"))throw new TypeError("location must be a string");return t=x(t),e=i(t.relativeBase,e),p(e,t)}).then(function(r){var o=n(t),i=v(e);return h(i.fragment,"Undefined")||(o.subDocPath=A(decodeURI(i.fragment))),o.relativeBase=D.dirname(e),M(r,o).then(function(e){return{refs:e.refs,resolved:e.resolved,value:r}})})}var D=e("path"),_=e("path-loader"),F=e("querystring"),I=e("slash"),R=e("uri-js"),U=/~(?:[^01]|$)/g,q={},N=["relative","remote"],V=["absolute","uri"],L={};"undefined"==typeof Promise&&e("native-promise-only"),t.exports.clearCache=w,t.exports.decodePath=E,t.exports.encodePath=$,t.exports.findRefs=O,t.exports.findRefsAt=C,t.exports.getRefDetails=P,t.exports.isPtr=S,t.exports.isRef=k,t.exports.pathFromPtr=A,t.exports.pathToPtr=T,t.exports.resolveRefs=M,t.exports.resolveRefsAt=j},{"native-promise-only":3,path:4,"path-loader":5,querystring:11,slash:13,"uri-js":23}],2:[function(e,t,r){function n(e){if(e)return o(e)}function o(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n,o=0;o2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){var o=e.slice(),i=t||"-";return n&&(o=o.filter(function(e){return"number"!=typeof e})),(0!==r.length?r+i:"")+o.join(i)}return""}Object.defineProperty(t,"__esModule",{value:!0});var o=r(2);r.n(o);r.o(o,"parse")&&r.d(t,"parse",function(){return o.parse}),r.o(o,"stringify")&&r.d(t,"stringify",function(){return o.stringify}),r.o(o,"normalize")&&r.d(t,"normalize",function(){return o.normalize}),t.name=n},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.a=function(e,t){if(!Array.isArray(e)){var r=function(){var r=[];return t?t.forEach(function(t){r.push({name:e[t],value:t})}):Object.keys(e).forEach(function(t){r.push({name:e[t],value:t})}),{v:r}}();if("object"===(void 0===r?"undefined":n(r)))return r.v}return e}},function(e,t,r){e.exports=r(11).ObjectPath},function(e,t,r){"use strict";function n(e,t,r,o){var i=e[g(r.type)];if(i)for(var a=void 0,s=function(t,r,o){return n(e,t,r,o)},u=0;u-1?n=i:(r=h(e,"Undefined")?void 0:y(e),h(r,"Undefined")?n=i:(n=r,n.path=I(D.join(r.path,i.path)),n.query=o(r.query,i.query))),n.fragment=void 0,(-1===V.indexOf(n.reference)&&0===n.path.indexOf("../")?"../":"")+R.serialize(n)}function a(e,t){var r,n=[];return t.length>0&&(r=e,t.slice(0,t.length-1).forEach(function(e){e in r&&(r=r[e],n.push(r))})),n}function s(e,t,r,o,i,a,s,f,l){var p,d;if(r.length>0)try{p=c(t,r)}catch(t){"remote"===e&&(o.error=t.message,o.missing=!0)}else p=t;if(h(p,"Undefined")||(o.value=p),h(p,"Array")||h(p,"Object"))return d=n(i),"local"===e?(delete d.subDocPath,t=p):(d.relativeBase=D.dirname(a[a.length-1]),0===r.length?delete d.subDocPath:d.subDocPath=r),u(t,d,a,s,f,l)}function u(e,t,r,n,o,a){var u=Promise.resolve(),c=n.length?k(n[n.length-1]):[],f=O(e,t),l=t.subDocPath||[],d=T(l),m=["#"];return r.forEach(function(e,t){"#"!==e.charAt(0)&&m.push(n[t])}),m.reverse(),"#"!==(r[r.length-1]||"").charAt(0)&&(o.documents[T(c)]=e),Object.keys(f).forEach(function(v){var y,g,b,x,w=f[v];b=0===r.length?c.concat(k(v)):c.concat(k(v).slice(0===r.length?0:l.length)),x=T(b),h(o[x],"Undefined")&&(o.refs[x]=f[v],h(w.error,"Undefined")&&"invalid"!==w.type&&(N.indexOf(w.type)>-1?(y=i(t.relativeBase,w.uri),g=r.indexOf(y)):(y=w.uri,g=n.indexOf(y)),w.ancestorPtrs=m,w.indirect=a,-1===g?N.indexOf(w.type)>-1?u=u.then(function(){return p(y,t).then(function(e){return s("remote",e,h(w.uriDetails.fragment,"Undefined")?[]:k(decodeURI(w.uriDetails.fragment)),w,t,r.concat(y),n.concat(x),o,a)}).catch(function(e){w.error=e.message,w.missing=!0})}):0!==x.indexOf(y+"/")&&x!==y&&0!==d.indexOf(y+"/")&&d!==y?0!==y.indexOf(d+"/")&&(u=u.then(function(){return s("local",e,k(y),w,t,r.concat(y),n.concat(x),o,a||-1===y.indexOf(d+"/")&&y!==d)})):w.circular=!0:(n.slice(g).forEach(function(e){o.refs[e].circular=!0}),w.circular=!0)))}),u=u.then(function(){function e(i,a,s,u){Object.keys(o.refs).forEach(function(c){var f=o.refs[c];-1===n.indexOf(u)&&-1===r.indexOf(s)&&-1===t.indexOf(u)&&c!==s&&0===c.indexOf(u+"/")&&(a.indexOf(u)>-1?a.forEach(function(e){-1===t.indexOf(u)&&t.push(e)}):e(i.concat(s),a.concat(u),c,f.uri),r.push(s),n.push(u))})}var t=[],r=[],n=[];Object.keys(o.refs).forEach(function(r){var n=o.refs[r];"local"!==n.type||n.circular||-1!==t.indexOf(n.uri)||e([],[],r,n.uri)}),Object.keys(o.refs).forEach(function(e){var r=o.refs[e];t.indexOf(r.uri)>-1&&(r.circular=!0)})}).then(function(){return o})}function c(e,t){var r=e;return t.forEach(function(e){if(!((e=decodeURI(e))in r))throw Error("JSON Pointer points to missing location: "+T(t));r=r[e]}),r}function f(e){return Object.keys(e).filter(function(e){return"$ref"!==e})}function l(e){var t;switch(e.uriDetails.reference){case"absolute":case"uri":t="remote";break;case"same-document":t="local";break;default:t=e.uriDetails.reference}return t}function p(e,t){var r=q[e],o=Promise.resolve(),i=n(t.loaderOptions||{});return h(r,"Undefined")?(h(i.processContent,"Undefined")&&(i.processContent=function(e,t){t(void 0,JSON.parse(e.text))}),o=F.load(decodeURI(e),i),o=o.then(function(t){return q[e]={value:t},t}).catch(function(t){throw q[e]={error:t},t})):o=o.then(function(){return r.value}),o=o.then(function(e){return n(e)})}function d(e,t){var r=!0;try{if(!h(e,"Object"))throw new Error("obj is not an Object");if(!h(e.$ref,"String"))throw new Error("obj.$ref is not a String")}catch(e){if(t)throw e;r=!1}return r}function h(e,t){return"Undefined"===t?void 0===e:Object.prototype.toString.call(e)==="[object "+t+"]"}function m(e){var t,r;return h(e.filter,"Array")||h(e.filter,"String")?(r=h(e.filter,"String")?[e.filter]:e.filter,t=function(e){return r.indexOf(e.type)>-1||r.indexOf(l(e))>-1}):h(e.filter,"Function")?t=e.filter:h(e.filter,"Undefined")&&(t=function(){return!0}),function(r,n){return("invalid"!==r.type||!0===e.includeInvalid)&&t(r,n)}}function v(e){var t;return h(e.subDocPath,"Array")?t=e.subDocPath:h(e.subDocPath,"String")?t=k(e.subDocPath):h(e.subDocPath,"Undefined")&&(t=[]),t}function y(e){return R.parse(encodeURI(decodeURI(e)))}function g(e,t,r){c(e,t.slice(0,t.length-1))[decodeURI(t[t.length-1])]=r}function b(e,t,r,n){function o(t,o){r.push(o),b(e,t,r,n),r.pop()}var i=!0;h(n,"Function")&&(i=n(e,t,r)),-1===e.indexOf(t)&&(e.push(t),!1!==i&&(h(t,"Array")?t.forEach(function(e,t){o(e,t.toString())}):h(t,"Object")&&Object.keys(t).forEach(function(e){o(t[e],e)}))),e.pop()}function x(e,t){if(e=h(e,"Undefined")?{}:n(e),!h(e,"Object"))throw new TypeError("options must be an Object");if(!(h(e.filter,"Undefined")||h(e.filter,"Array")||h(e.filter,"Function")||h(e.filter,"String")))throw new TypeError("options.filter must be an Array, a Function of a String");if(!h(e.includeInvalid,"Undefined")&&!h(e.includeInvalid,"Boolean"))throw new TypeError("options.includeInvalid must be a Boolean");if(!h(e.refPreProcessor,"Undefined")&&!h(e.refPreProcessor,"Function"))throw new TypeError("options.refPreProcessor must be a Function");if(!h(e.refPostProcessor,"Undefined")&&!h(e.refPostProcessor,"Function"))throw new TypeError("options.refPostProcessor must be a Function");if(!h(e.subDocPath,"Undefined")&&!h(e.subDocPath,"Array")&&!P(e.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(e.filter=m(e),e.subDocPath=v(e),!h(t,"Undefined"))try{c(t,e.subDocPath)}catch(e){throw e.message=e.message.replace("JSON Pointer","options.subDocPath"),e}return e}function w(){q={}}function E(e){if(!h(e,"Array"))throw new TypeError("path must be an array");return e.map(function(e){return h(e,"String")||(e=JSON.stringify(e)),decodeURI(e.replace(/~1/g,"/").replace(/~0/g,"~"))})}function $(e){if(!h(e,"Array"))throw new TypeError("path must be an array");return e.map(function(e){return h(e,"String")||(e=JSON.stringify(e)),e.replace(/~/g,"~0").replace(/\//g,"~1")})}function O(e,t){var r={};if(!h(e,"Array")&&!h(e,"Object"))throw new TypeError("obj must be an Array or an Object");return t=x(t,e),b(a(e,t.subDocPath),c(e,t.subDocPath),n(t.subDocPath),function(e,o,i){var a,s=!0;return d(o)&&(h(t.refPreProcessor,"Undefined")||(o=t.refPreProcessor(n(o),i)),a=A(o),h(t.refPostProcessor,"Undefined")||(a=t.refPostProcessor(a,i)),t.filter(a,i)&&(r[T(i)]=a),f(o).length>0&&(s=!1)),s}),r}function C(e,t){var r=Promise.resolve();return r=r.then(function(){if(!h(e,"String"))throw new TypeError("location must be a string");return t=x(t),e=i(t.relativeBase,e),p(e,t)}).then(function(r){var o=n(q[e]),i=n(t),a=y(e);return h(o.refs,"Undefined")&&(delete i.filter,delete i.subDocPath,i.includeInvalid=!0,q[e].refs=O(r,i)),h(t.filter,"Undefined")||(i.filter=t.filter),h(a.fragment,"Undefined")?h(a.subDocPath,"Undefined")||(i.subDocPath=t.subDocPath):i.subDocPath=k(decodeURI(a.fragment)),{refs:O(r,i),value:r}})}function A(e){var t,r,n,o={def:e};try{d(e,!0)?(t=e.$ref,n=L[t],h(n,"Undefined")&&(n=L[t]=y(t)),o.uri=t,o.uriDetails=n,h(n.error,"Undefined")?o.type=l(o):(o.error=o.uriDetails.error,o.type="invalid"),r=f(e),r.length>0&&(o.warning="Extra JSON Reference properties will be ignored: "+r.join(", "))):o.type="invalid"}catch(e){o.error=e.message,o.type="invalid"}return o}function P(e,t){var r,n=!0;try{if(!h(e,"String"))throw new Error("ptr is not a String");if(""!==e){if(r=e.charAt(0),-1===["#","/"].indexOf(r))throw new Error("ptr must start with a / or #/");if("#"===r&&"#"!==e&&"/"!==e.charAt(1))throw new Error("ptr must start with a / or #/");if(e.match(U))throw new Error("ptr has invalid token(s)")}}catch(e){if(!0===t)throw e;n=!1}return n}function S(e,t){return d(e,t)&&"invalid"!==A(e,t).type}function k(e){if(!P(e))throw new Error("ptr must be a JSON Pointer");var t=e.split("/");return t.shift(),E(t)}function T(e,t){if(!h(e,"Array"))throw new Error("path must be an Array");return(!1!==t?"#":"")+(e.length>0?"/":"")+$(e).join("/")}function M(e,t){var r=Promise.resolve();return r=r.then(function(){if(!h(e,"Array")&&!h(e,"Object"))throw new TypeError("obj must be an Array or an Object");t=x(t,e),e=n(e)}).then(function(){return u(e,t,[],[],{documents:{},refs:{}})}).then(function(t){function r(e,t){return k(e).length-k(t).length}var n={},o={};return Object.keys(t.refs).sort(r).forEach(function(r){var i=t.refs[r];i.indirect||(o[r]=i),delete i.indirect,h(i.error,"Undefined")&&"invalid"!==i.type?(h(i.value,"Undefined")&&i.circular&&(i.value=i.def),h(i.value,"Undefined")?n[r]=i:("#"===r?e=i.value:g(e,k(r),i.value),delete i.ancestorPtrs)):delete i.ancestorPtrs}),Object.keys(n).forEach(function(r){var o=n[r];o.ancestorPtrs.forEach(function(n,i){if(h(o.value,"Undefined"))try{o.value=c(t.documents[n],k(o.uri)),delete o.ancestorPtrs,g(e,k(r),o.value)}catch(e){i===o.ancestorPtrs.length-1&&(o.error=e.message,o.missing=!0,delete o.ancestorPtrs)}})}),{refs:o,resolved:e}})}function j(e,t){var r=Promise.resolve();return r=r.then(function(){if(!h(e,"String"))throw new TypeError("location must be a string");return t=x(t),e=i(t.relativeBase,e),p(e,t)}).then(function(r){var o=n(t),i=y(e);return h(i.fragment,"Undefined")||(o.subDocPath=k(decodeURI(i.fragment))),o.relativeBase=D.dirname(e),M(r,o).then(function(e){return{refs:e.refs,resolved:e.resolved,value:r}})})}var D=e("path"),F=e("path-loader"),_=e("querystring"),I=e("slash"),R=e("uri-js"),U=/~(?:[^01]|$)/g,q={},N=["relative","remote"],V=["absolute","uri"],L={};"undefined"==typeof Promise&&e("native-promise-only"),t.exports.clearCache=w,t.exports.decodePath=E,t.exports.encodePath=$,t.exports.findRefs=O,t.exports.findRefsAt=C,t.exports.getRefDetails=A,t.exports.isPtr=P,t.exports.isRef=S,t.exports.pathFromPtr=k,t.exports.pathToPtr=T,t.exports.resolveRefs=M,t.exports.resolveRefsAt=j},{"native-promise-only":3,path:4,"path-loader":5,querystring:11,slash:13,"uri-js":23}],2:[function(e,t,r){function n(e){if(e)return o(e)}function o(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n,o=0;o0&&e(n,s))}catch(e){a.call(new u(s),e)}}}function a(t){var r=this;r.triggered||(r.triggered=!0,r.def&&(r=r.def),r.msg=t,r.state=2,r.chain.length>0&&e(n,r))}function s(e,t,r,n){for(var o=0;o=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,o="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+r||"."},r.normalize=function(e){var o=r.isAbsolute(e),i="/"===a(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var o=n(e.split("/")),i=n(t.split("/")),a=Math.min(o.length,i.length),s=a,u=0;u1)for(var r=1;r0&&c>u&&(c=u);for(var f=0;f=0?(l=m.substr(0,y),p=m.substr(y+1)):(l=m,p=""),d=decodeURIComponent(l),h=decodeURIComponent(p),n(a,d)?o(a[d])?a[d].push(h):a[d]=[a[d],h]:a[d]=h}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],10:[function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n=200&&t.status<300)return r.callback(e,t);var n=new Error(t.statusText||"Unsuccessful HTTP response");n.original=e,n.response=t,n.status=t.status,r.callback(n,t)})}function h(e,t){var r=x("DELETE",e);return t&&r.end(t),r}var m,y=e("emitter"),v=e("reduce"),g=e("./request-base"),b=e("./is-object");m="undefined"!=typeof window?window:"undefined"!=typeof self?self:this;var x=t.exports=e("./request").bind(null,d);x.getXHR=function(){if(!(!m.XMLHttpRequest||m.location&&"file:"==m.location.protocol&&m.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var w="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};x.serializeObject=i,x.parseString=s,x.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},x.serialize={"application/x-www-form-urlencoded":i,"application/json":JSON.stringify},x.parse={"application/x-www-form-urlencoded":s,"application/json":JSON.parse},p.prototype.get=function(e){return this.header[e.toLowerCase()]},p.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=f(t);var r=l(t);for(var n in r)this[n]=r[n]},p.prototype.parseBody=function(e){var t=x.parse[this.type];return!t&&c(this.type)&&(t=x.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null},p.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},p.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot "+t+" "+r+" ("+this.status+")",o=new Error(n);return o.status=this.status,o.method=t,o.url=r,o},x.Response=p,y(d.prototype);for(var E in g)d.prototype[E]=g[E];d.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this},d.prototype.type=function(e){return this.set("Content-Type",x.types[e]||e),this},d.prototype.responseType=function(e){return this._responseType=e,this},d.prototype.accept=function(e){return this.set("Accept",x.types[e]||e),this},d.prototype.auth=function(e,t,r){switch(r||(r={type:"basic"}),r.type){case"basic":var n=btoa(e+":"+t);this.set("Authorization","Basic "+n);break;case"auto":this.username=e,this.password=t}return this},d.prototype.query=function(e){return"string"!=typeof e&&(e=i(e)),e&&this._query.push(e),this},d.prototype.attach=function(e,t,r){return this._getFormData().append(e,t,r||t.name),this},d.prototype._getFormData=function(){return this._formData||(this._formData=new m.FormData),this._formData},d.prototype.send=function(e){var t=b(e),r=this._header["content-type"];if(t&&b(this._data))for(var n in e)this._data[n]=e[n];else"string"==typeof e?(r||this.type("form"),r=this._header["content-type"],"application/x-www-form-urlencoded"==r?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||o(e)?this:(r||this.type("json"),this)},p.prototype.parse=function(e){return m.console&&console.warn("Client-side parse() method has been renamed to serialize(). This method is not compatible with superagent v2.0"),this.serialize(e),this},p.prototype.serialize=function(e){return this._parser=e,this},d.prototype.callback=function(e,t){var r=this._callback;this.clearTimeout(),r(e,t)},d.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},d.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},d.prototype.withCredentials=function(){return this._withCredentials=!0,this},d.prototype.end=function(e){var t=this,r=this.xhr=x.getXHR(),i=this._query.join("&"),a=this._timeout,s=this._formData||this._data;this._callback=e||n,r.onreadystatechange=function(){if(4==r.readyState){var e;try{e=r.status}catch(t){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var u=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(r.onprogress=u);try{r.upload&&this.hasListeners("progress")&&(r.upload.onprogress=u)}catch(e){}if(a&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},a)),i&&(i=x.serializeObject(i),this.url+=~this.url.indexOf("?")?"&"+i:"?"+i),this.username&&this.password?r.open(this.method,this.url,!0,this.username,this.password):r.open(this.method,this.url,!0),this._withCredentials&&(r.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!o(s)){var f=this._header["content-type"],l=this._parser||x.serialize[f?f.split(";")[0]:""];!l&&c(f)&&(l=x.serialize["application/json"]),l&&(s=l(s))}for(var p in this.header)null!=this.header[p]&&r.setRequestHeader(p,this.header[p]);return this._responseType&&(r.responseType=this._responseType),this.emit("request",this),r.send("undefined"!=typeof s?s:null),this},x.Request=d,x.get=function(e,t,r){var n=x("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},x.head=function(e,t,r){var n=x("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},x.del=h,x.delete=h,x.patch=function(e,t,r){var n=x("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},x.post=function(e,t,r){var n=x("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},x.put=function(e,t,r){var n=x("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}},{"./is-object":15,"./request":17,"./request-base":16,emitter:2,reduce:12}],15:[function(e,t,r){function n(e){return null!=e&&"object"==("undefined"==typeof e?"undefined":c(e))}t.exports=n},{}],16:[function(e,t,r){var n=e("./is-object");r.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},r.parse=function(e){return this._parser=e,this},r.timeout=function(e){return this._timeout=e,this},r.then=function(e,t){return this.end(function(r,n){r?t(r):e(n)})},r.use=function(e){return e(this),this},r.get=function(e){return this._header[e.toLowerCase()]},r.getHeader=r.get,r.set=function(e,t){if(n(e)){for(var r in e)this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},r.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},r.field=function(e,t){return this._getFormData().append(e,t),this}},{"./is-object":15}],17:[function(e,t,r){function n(e,t,r){return"function"==typeof r?new e("GET",t).end(r):2==arguments.length?new e("GET",t):new e(t,r)}t.exports=n},{}],18:[function(e,t,r){/*! https://mths.be/punycode v1.3.2 by @mathias, modified for URI.js */var n=function(){function e(e){throw new RangeError(C[e])}function t(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function r(e,r){var n=e.split("@"),o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace(O,".");var i=e.split("."),a=t(i,r).join(".");return o+a}function n(e){for(var t,r,n=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(e-=65536,t+=k(e>>>10&1023|55296),e=56320|1023&e),t+=k(e)}).join("")}function i(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h}function a(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function s(e,t,r){var n=0;for(e=r?S(e/g):e>>1,e+=S(e/t);e>P*y>>1;n+=h)e=S(e/P);return S(n+(P+1)*e/(e+v))}function u(t){var r,n,a,u,c,f,l,p,v,g,E=[],$=t.length,O=0,C=x,P=b;for(n=t.lastIndexOf(w),n<0&&(n=0),a=0;a=128&&e("not-basic"),E.push(t.charCodeAt(a));for(u=n>0?n+1:0;u<$;){for(c=O,f=1,l=h;u>=$&&e("invalid-input"),p=i(t.charCodeAt(u++)),(p>=h||p>S((d-O)/f))&&e("overflow"),O+=p*f,v=l<=P?m:l>=P+y?y:l-P,!(pS(d/g)&&e("overflow"),f*=g;r=E.length+1,P=s(O-c,r,0==c),S(O/r)>d-C&&e("overflow"),C+=S(O/r),O%=r,E.splice(O++,0,C)}return o(E)}function c(t){var r,o,i,u,c,f,l,p,v,g,E,$,O,C,P,A=[];for(t=n(t),$=t.length,r=x,o=0,c=b,f=0;f<$;++f)E=t[f],E<128&&A.push(k(E));for(i=u=A.length,u&&A.push(w);i<$;){for(l=d,f=0;f<$;++f)E=t[f],E>=r&&ES((d-o)/O)&&e("overflow"),o+=(l-r)*O,r=l,f=0;f<$;++f)if(E=t[f],Ed&&e("overflow"),E==r){for(p=o,v=h;g=v<=c?m:v>=c+y?y:v-c,!(p= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-m,S=Math.floor,k=String.fromCharCode;return p={version:"1.3.2",ucs2:{decode:n,encode:o},decode:u,encode:c,toASCII:l,toUnicode:f}}();"undefined"==typeof COMPILED&&"undefined"!=typeof t&&(t.exports=n)},{}],19:[function(e,t,r){e("./schemes/http"),e("./schemes/urn"),e("./schemes/mailto")},{"./schemes/http":20,"./schemes/mailto":21,"./schemes/urn":22}],20:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri");n.SCHEMES.http=n.SCHEMES.https={domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}}},{"../uri":23}],21:[function(e,t,r){if("undefined"==typeof COMPILED&&"undefined"==typeof n&&"function"==typeof e)var n=e("../uri"),o=e("../punycode");!function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;nA-Z\\x5E-\\x7E]",h=e(d,'[\\"\\\\]'),m=t(p+"+"+t("\\."+p+"+")+"*"),y=t("\\\\"+h),v=t(d+"|"+y),g=t('\\"'+v+'*\\"'),b="[\\x21-\\x5A\\x5E-\\x7E]",x="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",w=t(c+"|"+l+"|"+x),E=t(m+"|\\["+b+"*\\]"),$=t(m+"|"+g),O=t($+"\\@"+E),C=t(O+t("\\,"+O)+"*"),P=t(w+"*"),S=P,k=t(P+"\\="+S),A=t(k+t("\\&"+k)+"*"),T=t("\\?"+A),M=(n.VALIDATE_SUPPORT&&new RegExp("^mailto\\:"+C+"?"+T+"?$"),new RegExp(c,"g")),j=new RegExp(l,"g"),D=new RegExp(e("[^]",p,"[\\.]",'[\\"]',h),"g"),_=new RegExp(e("[^]",p,"[\\.]","[\\[]",b,"[\\]]"),"g"),F=new RegExp(e("[^]",c,x),"g"),I=F,R=n.VALIDATE_SUPPORT&&new RegExp("^"+C+"$"),U=n.VALIDATE_SUPPORT&&new RegExp("^"+A+"$");n.SCHEMES.mailto={parse:function(e,t){n.VALIDATE_SUPPORT&&!e.error&&(e.path&&!R.test(e.path)?e.error="Email address is not valid":e.query&&!U.test(e.query)&&(e.error="Header fields are invalid"));var r=e.to=e.path?e.path.split(","):[];if(e.path=void 0,e.query){for(var i=!1,a={},s=e.query.split("&"),u=0,c=s.length;u\[\]\^\`\{\|\}\~\x7F-\xFF]/g,f=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;n.SCHEMES.urn={parse:function(e,t){var r,o,i=e.path.match(s);return i||(t.tolerant||(e.error=e.error||"URN is not strictly valid."),i=e.path.match(u)),i?(r="urn:"+i[1].toLowerCase(),o=n.SCHEMES[r],o||(o=n.SCHEMES[r]={parse:function(e,t){return e},serialize:n.SCHEMES.urn.serialize}),e.scheme=r,e.path=i[2],e=o.parse(e,t)):e.error=e.error||"URN can not be parsed.",e},serialize:function(t,r){var n,o=t.scheme||r.scheme;if(o&&"urn"!==o){var n=o.match(a);n||(n=["urn:"+o,o]),t.scheme="urn",t.path=n[1]+":"+(t.path?t.path.replace(c,e):"")}return t}},n.SCHEMES["urn:uuid"]={parse:function(e,t){return t.tolerant||e.path&&e.path.match(f)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,t){return t.tolerant||e.path&&e.path.match(f)?e.path=(e.path||"").toLowerCase():e.scheme=void 0,n.SCHEMES.urn.serialize(e,t)}}}()},{"../uri":23}],23:[function(e,t,r){/** +!function(t,r,n){r[t]=r[t]||n(),void 0!==o&&o.exports?o.exports=r[t]:"function"==typeof e&&e.amd&&e(function(){return r[t]})}("Promise",void 0!==t?t:this,function(){"use strict";function e(e,t){h.add(e,t),d||(d=v(h.drain))}function t(e){var t,r=void 0===e?"undefined":c(e);return null==e||"object"!=r&&"function"!=r||(t=e.then),"function"==typeof t&&t}function n(){for(var e=0;e0&&e(n,s))}catch(e){a.call(new u(s),e)}}}function a(t){var r=this;r.triggered||(r.triggered=!0,r.def&&(r=r.def),r.msg=t,r.state=2,r.chain.length>0&&e(n,r))}function s(e,t,r,n){for(var o=0;o=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,o="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+r||"."},r.normalize=function(e){var o=r.isAbsolute(e),i="/"===a(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var o=n(e.split("/")),i=n(t.split("/")),a=Math.min(o.length,i.length),s=a,u=0;u1)for(var r=1;r0&&u>s&&(u=s);for(var c=0;c=0?(f=h.substr(0,m),l=h.substr(m+1)):(f=h,l=""),p=decodeURIComponent(f),d=decodeURIComponent(l),n(a,p)?o(a[p])?a[p].push(d):a[p]=[a[p],d]:a[p]=d}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],10:[function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n=200&&t.status<300)return r.callback(e,t);var n=new Error(t.statusText||"Unsuccessful HTTP response");n.original=e,n.response=t,n.status=t.status,r.callback(n,t)})}function h(e,t){var r=x("DELETE",e);return t&&r.end(t),r}var m,v=e("emitter"),y=e("reduce"),g=e("./request-base"),b=e("./is-object");m="undefined"!=typeof window?window:"undefined"!=typeof self?self:this;var x=t.exports=e("./request").bind(null,d);x.getXHR=function(){if(!(!m.XMLHttpRequest||m.location&&"file:"==m.location.protocol&&m.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var w="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};x.serializeObject=i,x.parseString=s,x.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},x.serialize={"application/x-www-form-urlencoded":i,"application/json":JSON.stringify},x.parse={"application/x-www-form-urlencoded":s,"application/json":JSON.parse},p.prototype.get=function(e){return this.header[e.toLowerCase()]},p.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=f(t);var r=l(t);for(var n in r)this[n]=r[n]},p.prototype.parseBody=function(e){var t=x.parse[this.type];return!t&&c(this.type)&&(t=x.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null},p.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},p.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot "+t+" "+r+" ("+this.status+")",o=new Error(n);return o.status=this.status,o.method=t,o.url=r,o},x.Response=p,v(d.prototype);for(var E in g)d.prototype[E]=g[E];d.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this},d.prototype.type=function(e){return this.set("Content-Type",x.types[e]||e),this},d.prototype.responseType=function(e){return this._responseType=e,this},d.prototype.accept=function(e){return this.set("Accept",x.types[e]||e),this},d.prototype.auth=function(e,t,r){switch(r||(r={type:"basic"}),r.type){case"basic":var n=btoa(e+":"+t);this.set("Authorization","Basic "+n);break;case"auto":this.username=e,this.password=t}return this},d.prototype.query=function(e){return"string"!=typeof e&&(e=i(e)),e&&this._query.push(e),this},d.prototype.attach=function(e,t,r){return this._getFormData().append(e,t,r||t.name),this},d.prototype._getFormData=function(){return this._formData||(this._formData=new m.FormData),this._formData},d.prototype.send=function(e){var t=b(e),r=this._header["content-type"];if(t&&b(this._data))for(var n in e)this._data[n]=e[n];else"string"==typeof e?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"==r?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||o(e)?this:(r||this.type("json"),this)},p.prototype.parse=function(e){return m.console&&console.warn("Client-side parse() method has been renamed to serialize(). This method is not compatible with superagent v2.0"),this.serialize(e),this},p.prototype.serialize=function(e){return this._parser=e,this},d.prototype.callback=function(e,t){var r=this._callback;this.clearTimeout(),r(e,t)},d.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},d.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},d.prototype.withCredentials=function(){return this._withCredentials=!0,this},d.prototype.end=function(e){var t=this,r=this.xhr=x.getXHR(),i=this._query.join("&"),a=this._timeout,s=this._formData||this._data;this._callback=e||n,r.onreadystatechange=function(){if(4==r.readyState){var e;try{e=r.status}catch(t){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var u=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(r.onprogress=u);try{r.upload&&this.hasListeners("progress")&&(r.upload.onprogress=u)}catch(e){}if(a&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},a)),i&&(i=x.serializeObject(i),this.url+=~this.url.indexOf("?")?"&"+i:"?"+i),this.username&&this.password?r.open(this.method,this.url,!0,this.username,this.password):r.open(this.method,this.url,!0),this._withCredentials&&(r.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!o(s)){var f=this._header["content-type"],l=this._parser||x.serialize[f?f.split(";")[0]:""];!l&&c(f)&&(l=x.serialize["application/json"]),l&&(s=l(s))}for(var p in this.header)null!=this.header[p]&&r.setRequestHeader(p,this.header[p]);return this._responseType&&(r.responseType=this._responseType),this.emit("request",this),r.send(void 0!==s?s:null),this},x.Request=d,x.get=function(e,t,r){var n=x("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},x.head=function(e,t,r){var n=x("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},x.del=h,x.delete=h,x.patch=function(e,t,r){var n=x("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},x.post=function(e,t,r){var n=x("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},x.put=function(e,t,r){var n=x("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}},{"./is-object":15,"./request":17,"./request-base":16,emitter:2,reduce:12}],15:[function(e,t,r){function n(e){return null!=e&&"object"==(void 0===e?"undefined":c(e))}t.exports=n},{}],16:[function(e,t,r){var n=e("./is-object");r.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},r.parse=function(e){return this._parser=e,this},r.timeout=function(e){return this._timeout=e,this},r.then=function(e,t){return this.end(function(r,n){r?t(r):e(n)})},r.use=function(e){return e(this),this},r.get=function(e){return this._header[e.toLowerCase()]},r.getHeader=r.get,r.set=function(e,t){if(n(e)){for(var r in e)this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},r.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},r.field=function(e,t){return this._getFormData().append(e,t),this}},{"./is-object":15}],17:[function(e,t,r){function n(e,t,r){return"function"==typeof r?new e("GET",t).end(r):2==arguments.length?new e("GET",t):new e(t,r)}t.exports=n},{}],18:[function(e,t,r){/*! https://mths.be/punycode v1.3.2 by @mathias, modified for URI.js */var n=function(){function e(e){throw new RangeError(O[e])}function t(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function r(e,r){var n=e.split("@"),o="";return n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace($,"."),o+t(e.split("."),r).join(".")}function n(e){for(var t,r,n=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(e-=65536,t+=P(e>>>10&1023|55296),e=56320|1023&e),t+=P(e)}).join("")}function i(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d}function a(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function s(e,t,r){var n=0;for(e=r?A(e/y):e>>1,e+=A(e/t);e>C*m>>1;n+=d)e=A(e/C);return A(n+(C+1)*e/(e+v))}function u(t){var r,n,a,u,c,f,l,v,y,w,E=[],$=t.length,O=0,C=b,P=g;for(n=t.lastIndexOf(x),n<0&&(n=0),a=0;a=128&&e("not-basic"),E.push(t.charCodeAt(a));for(u=n>0?n+1:0;u<$;){for(c=O,f=1,l=d;u>=$&&e("invalid-input"),v=i(t.charCodeAt(u++)),(v>=d||v>A((p-O)/f))&&e("overflow"),O+=v*f,y=l<=P?h:l>=P+m?m:l-P,!(vA(p/w)&&e("overflow"),f*=w;r=E.length+1,P=s(O-c,r,0==c),A(O/r)>p-C&&e("overflow"),C+=A(O/r),O%=r,E.splice(O++,0,C)}return o(E)}function c(t){var r,o,i,u,c,f,l,v,y,w,E,$,O,C,S,k=[];for(t=n(t),$=t.length,r=b,o=0,c=g,f=0;f<$;++f)(E=t[f])<128&&k.push(P(E));for(i=u=k.length,u&&k.push(x);i<$;){for(l=p,f=0;f<$;++f)(E=t[f])>=r&&EA((p-o)/O)&&e("overflow"),o+=(l-r)*O,r=l,f=0;f<$;++f)if(E=t[f],Ep&&e("overflow"),E==r){for(v=o,y=d;w=y<=c?h:y>=c+m?m:y-c,!(v= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=d-h,A=Math.floor,P=String.fromCharCode;return{version:"1.3.2",ucs2:{decode:n,encode:o},decode:u,encode:c,toASCII:l,toUnicode:f}}();"undefined"==typeof COMPILED&&void 0!==t&&(t.exports=n)},{}],19:[function(e,t,r){e("./schemes/http"),e("./schemes/urn"),e("./schemes/mailto")},{"./schemes/http":20,"./schemes/mailto":21,"./schemes/urn":22}],20:[function(e,t,r){if("undefined"==typeof COMPILED&&void 0===n&&"function"==typeof e)var n=e("../uri");n.SCHEMES.http=n.SCHEMES.https={domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}}},{"../uri":23}],21:[function(e,t,r){if("undefined"==typeof COMPILED&&void 0===n&&"function"==typeof e)var n=e("../uri"),o=e("../punycode");!function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;nA-Z\\x5E-\\x7E]",h=e(d,'[\\"\\\\]'),m=t(p+"+"+t("\\."+p+"+")+"*"),v=t("\\\\"+h),y=t(d+"|"+v),g=t('\\"'+y+'*\\"'),b=t(c+"|"+l+"|[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),x=t(m+"|\\[[\\x21-\\x5A\\x5E-\\x7E]*\\]"),w=t(m+"|"+g),E=t(w+"\\@"+x),$=t(E+t("\\,"+E)+"*"),O=t(b+"*"),C=O,A=t(O+"\\="+C),P=t(A+t("\\&"+A)+"*"),S=t("\\?"+P),k=(n.VALIDATE_SUPPORT&&new RegExp("^mailto\\:"+$+"?"+S+"?$"),new RegExp(c,"g")),T=new RegExp(l,"g"),M=new RegExp(e("[^]",p,"[\\.]",'[\\"]',h),"g"),j=new RegExp(e("[^]",p,"[\\.]","[\\[]","[\\x21-\\x5A\\x5E-\\x7E]","[\\]]"),"g"),D=new RegExp(e("[^]",c,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),F=D,_=n.VALIDATE_SUPPORT&&new RegExp("^"+$+"$"),I=n.VALIDATE_SUPPORT&&new RegExp("^"+P+"$");n.SCHEMES.mailto={parse:function(e,t){n.VALIDATE_SUPPORT&&!e.error&&(e.path&&!_.test(e.path)?e.error="Email address is not valid":e.query&&!I.test(e.query)&&(e.error="Header fields are invalid"));var r=e.to=e.path?e.path.split(","):[];if(e.path=void 0,e.query){for(var i=!1,a={},s=e.query.split("&"),u=0,c=s.length;u\[\]\^\`\{\|\}\~\x7F-\xFF]/g,e):"")}return t}},n.SCHEMES["urn:uuid"]={parse:function(e,t){return t.tolerant||e.path&&e.path.match(i)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,t){return t.tolerant||e.path&&e.path.match(i)?e.path=(e.path||"").toLowerCase():e.scheme=void 0,n.SCHEMES.urn.serialize(e,t)}}}()},{"../uri":23}],23:[function(e,t,r){/** * URI.js * * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. @@ -27,5 +27,4 @@ e.exports=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n, * @see http://github.com/garycourt/uri-js * @license URI.js v2.0.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -var n=!1,o=!0,i=!0,a=function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function a(e){for(var t,r,n,o="",i=0,a=e.length;i=194&&t<224?(a-i>=6?(r=parseInt(e.substr(i+4,2),16),o+=String.fromCharCode((31&t)<<6|63&r)):o+=e.substr(i,6),i+=6):t>=224?(a-i>=9?(r=parseInt(e.substr(i+4,2),16),n=parseInt(e.substr(i+7,2),16),o+=String.fromCharCode((15&t)<<12|(63&r)<<6|63&n)):o+=e.substr(i,9),i+=9):(o+=e.substr(i,3),i+=3);return o}function u(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function c(e){return e.toUpperCase()}function f(e,t){function r(e){var r=a(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,n).replace(t.PCT_ENCODED,c)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,n).replace(t.PCT_ENCODED,c)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,n).replace(t.PCT_ENCODED,c)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,n).replace(t.PCT_ENCODED,c)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,n).replace(t.PCT_ENCODED,c)),e}function l(e,t){void 0===t&&(t={});var r,n,u=o&&t.iri!==!1?E:w,c=!1,l={};if("suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e),i?(r=e.match(u.URI_REF),r&&(r=r[1]?r.slice(1,10):r.slice(10,19)),r||(c=!0,t.tolerant||(l.error=l.error||"URI is not strictly valid."),r=e.match($))):r=e.match($),r){if(k?(l.scheme=r[1],l.userinfo=r[3],l.host=r[4],l.port=parseInt(r[5],10),l.path=r[6]||"",l.query=r[7],l.fragment=r[8],isNaN(l.port)&&(l.port=r[5])):(l.scheme=r[1]||void 0,l.userinfo=e.indexOf("@")!==-1?r[3]:void 0,l.host=e.indexOf("//")!==-1?r[4]:void 0,l.port=parseInt(r[5],10),l.path=r[6]||"",l.query=e.indexOf("?")!==-1?r[7]:void 0,l.fragment=e.indexOf("#")!==-1?r[8]:void 0,isNaN(l.port)&&(l.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:void 0)),void 0!==l.scheme||void 0!==l.userinfo||void 0!==l.host||void 0!==l.port||l.path||void 0!==l.query?void 0===l.scheme?l.reference="relative":void 0===l.fragment?l.reference="absolute":l.reference="uri":l.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==l.reference&&(l.error=l.error||"URI is not a "+t.reference+" reference."),n=A[(t.scheme||l.scheme||"").toLowerCase()],!o||"undefined"==typeof s||t.unicodeSupport||n&&n.unicodeSupport)f(l,u);else{if(l.host&&(t.domainHost||n&&n.domainHost))try{l.host=s.toASCII(l.host.replace(u.PCT_ENCODED,a).toLowerCase())}catch(e){l.error=l.error||"Host's domain name can not be converted to ASCII via punycode: "+e}f(l,w)}n&&n.parse&&n.parse(l,t)}else c=!0,l.error=l.error||"URI can not be parsed.";return l}function p(e,t){var r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(e.host),"number"==typeof e.port&&(r.push(":"),r.push(e.port.toString(10))),r.length?r.join(""):void 0}function d(e){for(var t,r=[];e.length;)e.match(O)?e=e.replace(O,""):e.match(C)?e=e.replace(C,"/"):e.match(P)?(e=e.replace(P,"/"),r.pop()):"."===e||".."===e?e="":(t=e.match(S)[0],e=e.slice(t.length),r.push(t));return r.join("")}function h(e,t){void 0===t&&(t={});var r,n,i,u=o&&t.iri?E:w,c=[];if(r=A[(t.scheme||e.scheme||"").toLowerCase()],r&&r.serialize&&r.serialize(e,t),o&&"undefined"!=typeof s&&e.host&&(t.domainHost||r&&r.domainHost))try{e.host=t.iri?s.toUnicode(e.host):s.toASCII(e.host.replace(u.PCT_ENCODED,a).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}return f(e,u),"suffix"!==t.reference&&e.scheme&&(c.push(e.scheme),c.push(":")),n=p(e,t),void 0!==n&&("suffix"!==t.reference&&c.push("//"),c.push(n),e.path&&"/"!==e.path.charAt(0)&&c.push("/")),void 0!==e.path&&(i=e.path,t.absolutePath||r&&r.absolutePath||(i=d(i)),void 0===n&&(i=i.replace(/^\/\//,"/%2F")),c.push(i)),void 0!==e.query&&(c.push("?"),c.push(e.query)),void 0!==e.fragment&&(c.push("#"),c.push(e.fragment)),c.join("")}function m(e,t,r,n){void 0===r&&(r={});var o={};return n||(e=l(h(e,r),r),t=l(h(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=d(t.path),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=d(t.path),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=d(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=d(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function y(e,t,r){return h(m(l(e,r),l(t,r),r,!0),r)}function v(e,t){return"string"==typeof e?e=h(l(e,t),t):"object"===u(e)&&(e=l(h(e,t),t)),e}function g(e,t,r){return"string"==typeof e?e=h(l(e,r),r):"object"===u(e)&&(e=h(e,r)),"string"==typeof t?t=h(l(t,r),r):"object"===u(t)&&(t=h(t,r)),e===t}function b(e,t){return e&&e.toString().replace(o&&t&&t.iri?E.ESCAPE:w.ESCAPE,n)}function x(e,t){return e&&e.toString().replace(o&&t&&t.iri?E.PCT_ENCODED:w.PCT_ENCODED,a)}var w=r(!1),E=o?r(!0):void 0,$=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i,O=/^\.\.?\//,C=/^\/\.(\/|$)/,P=/^\/\.\.(\/|$)/,S=/^\/?(?:.|\n)*?(?=\/|$)/,k=void 0==="".match(/(){0}/)[1],A={};return{IRI_SUPPORT:o,VALIDATE_SUPPORT:i,pctEncChar:n,pctDecChars:a,SCHEMES:A,parse:l,_recomposeAuthority:p,removeDotSegments:d,serialize:h,resolveComponents:m,resolve:y,normalize:v,equal:g,escapeComponent:b,unescapeComponent:x}}();if(!n&&"undefined"!=typeof t&&"function"==typeof e){var s=e("./punycode");t.exports=a,e("./schemes")}},{"./punycode":18,"./schemes":19}]},{},[1])(1)})},function(e,t,r){"use strict";function n(e,t){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.i(i.createDefaults)(),c=arguments[3],f=arguments[4],l=arguments[5],p=arguments[6],d=[],h=[];t=t||[];var m=t.indexOf("*");f=f||{};var y={},v=t.indexOf("...");if("object"===("undefined"==typeof e?"undefined":s(e))&&e.hasOwnProperty("properties")){l=l||e.readonly||e.readOnly,y=r.i(i.defaultForm)(e,u,c,f);var g=y.lookup;e=g||e,d=d.concat(y.form)}return m!==-1&&(t=t.slice(0,m).concat(d).concat(t.slice(m+1))),y.form&&v!==-1&&!function(){var e=t.map(function(e){return"string"==typeof e?e:e.key?e.key:void 0}).filter(function(e){return void 0!==e});h=h.concat(y.form.map(function(t){var r=e.indexOf(t.key[0])!==-1;if(!r)return t}).filter(function(e){return void 0!==e}))}(),v!==-1&&(t=t.slice(0,v).concat(h).concat(t.slice(v+1))),t.map(function(t){if("string"==typeof t&&(t={key:t}),t.key&&"string"==typeof t.key&&(t.key=r.i(o.parse)(t.key)),t.titleMap&&(t.titleMap=r.i(a.a)(t.titleMap)),t.key){var i=r.i(o.stringify)(t.key);e[i]&&!function(){var r=e[i];r&&Object.keys(r).forEach(function(e){void 0===t[e]&&(t[e]=r[e])})}()}return l===!0&&(t.readonly=!0),t.items&&(t.items=n(e,t.items,u,c,f,t.readonly,p)),t.tabs&&t.tabs.forEach(function(r){r.items&&(r.items=n(e,r.items,u,c,f,t.readonly,p))}),"checkbox"===t.type&&(void 0===t.schema?t.schema={default:!1}:void 0===t.schema.default&&(t.schema.default=!1)),p&&"template"===t.type&&!t.template&&t.templateUrl&&p.push(t),t})}var o=r(0),i=r(3),a=r(1);t.a=n;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}},function(e,t,r){"use strict";function n(e,t){var r=new Promise(function(t,r){o.resolveRefs(e,{filter:["relative","local","remote"]}).then(function(e){t(e.resolved)}).catch(function(e){r(new Error(e))})});return"function"!=typeof t?r:void r.then(function(e){t(null,e)}).catch(function(e){t(e)})}var o=r(5);r.n(o);t.a=n},function(e,t,r){"use strict";function n(e,t,r){t||(t=this);var n="string"==typeof e?o.parse(e):e;if("undefined"!=typeof r&&1===n.length)return t[n[0]]=r,t;"undefined"!=typeof r&&"undefined"==typeof t[n[0]]&&(t[n[0]]=n.length>2&&i.test(n[1])?[]:{});for(var a=t[n[0]],s=1;si&&(a.push(e.slice(i,r)),i=r),n=e.slice(r+1,r+2),'"'!==n&&"'"!==n)o=e.indexOf("]",r),o===-1&&(o=e.length),a.push(e.slice(i+1,o)),i="."===e.slice(o+1,o+2)?o+2:o+1;else{for(o=e.indexOf(n+"]",r),o===-1&&(o=e.length);"\\"===e.slice(o-1,o)&&r0){n.titleMapValues=[];var t=function(t){n.titleMapValues=[],t=t||[],e.titleMap.forEach(function(e){n.titleMapValues.push(t.indexOf(e.value)!==-1)})};t(n.modelArray),n.$watchCollection("modelArray",t),n.$watchCollection("titleMapValues",function(t,r){if(t&&t!==r){var o=f();e.titleMap.forEach(function(e,r){var n=o.indexOf(e.value);n===-1&&t[r]&&o.push(e.value),n===-1||t[r]||o.splice(n,1)}),n.validateField&&n.validateField()}})}l()}});n.appendToArray=function(){var t,i=f();if(n.form&&n.form.schema&&n.form.schema.items){var a=n.form.schema.items;a.type&&a.type.indexOf("object")!==-1?(t={},n.options&&n.options.setSchemaDefaults===!1||(t=o.a.isDefined(a.default)?a.default:t,t&&r.traverseSchema(a,function(r,n){o.a.isDefined(r.default)&&e(n,t,r.default)}))):(a.type&&(a.type.indexOf("array")!==-1?t=[]:a.type.indexOf("string")===-1&&a.type.indexOf("number")===-1||(t="")),n.options&&n.options.setSchemaDefaults===!1||(t=a.default||t))}return i.push(t),i},n.deleteFromArray=function(e){var t=n.modelArray.indexOf(e),r=n.modelArray;return r&&r.splice(t,1),e.$$hashKey&&(n.destroyed=e.$$hashKey),r};var p=function(e){return function(t){t.key&&(t.key[t.key.indexOf("")]=e)}},d={};n.copyWithIndex=function(e){var t=n.form;if(!d[e]){var i=t.items[0];if(t.items.length>1&&(i={type:"section",items:t.items.map(function(e){return e.ngModelOptions=t.ngModelOptions,o.a.isUndefined(e.readonly)&&(e.readonly=t.readonly),e})}),i){var a=o.a.copy(i);a.arrayIndex=e,r.traverseForm(a,p(e)),d[e]=a}}return d[e]}}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(){return{require:"ngModel",restrict:"AC",scope:!1,link:function(e,t,r,n){var i=e.$eval(r.sfChanged);i&&i.onChange&&n.$viewChangeListeners.push(function(){o.a.isFunction(i.onChange)?i.onChange(n.$modelValue,i):e.evalExpr(i.onChange,{modelValue:n.$modelValue,form:i,arrayIndex:e.$index,arrayIndices:e.arrayIndices,path:e.path,$i:e.$i,$index:e.$index})})}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.a=function(e,t,r,n,a,s,u,c,f){var l={COMPLETE:"*",PATH:"string",INDICES:"number"};return{restrict:"AE",replace:!1,transclude:!1,scope:!0,require:["^sfSchema","?^form","?^^sfKeyController"],link:{pre:function(e,t,r,n){var o=n[0];n[1],n[2];e.$on("schemaFormPropagateNgModelController",function(t,r){t.stopPropagation(),t.preventDefault(),e.ngModel=r}),e.initialForm=Object.assign({},o.lookup["f"+r.sfField]),e.form=o.lookup["f"+r.sfField]},post:function(e,t,r,n){var s=n[0],p=n[1];n[2];e.getKey=function(t){var r=t||l.COMPLETE,n=e.parentKey?e.parentKey.slice(0,e.parentKey.length-1):[];if(e.completeKey!==e.form.key&&("number"==typeof e.$index&&(n=n.concat(e.$index)),e.form.key&&e.form.key.length))if("number"==typeof n[n.length-1]&&e.form.key.length>=1){var o=e.form.key.length-n.length;e.completeKey=n.concat(e.form.key.slice(-o))}else e.completeKey=e.form.key.slice();if(Array.isArray(e.completeKey))return r===l.COMPLETE?e.completeKey:e.completeKey.reduce(function(e,t,n){return-1!==[r].indexOf("undefined"==typeof t?"undefined":i(t))?e.concat(t):e},[])},e.form.key&&(e.form.key=e.completeKey=e.getKey()),e.showTitle=function(){return e.form&&e.form.notitle!==!0&&e.form.title},e.fieldId=function(t,r){var n=r||!1,o=t&&p&&p.$name?p.$name:void 0,i=e.completeKey;return Array.isArray(i)?c.name(i,"-",o,n):""},e.listToCheckboxValues=function(e){var t={};return o.a.forEach(e,function(e){t[e]=!0}),t},e.checkboxValuesToList=function(e){var t=[];return o.a.forEach(e,function(e,r){e&&t.push(r)}),t},e.buttonClick=function(t,r){o.a.isFunction(r.onClick)?r.onClick(t,r):o.a.isString(r.onClick)&&(s?s.evalInParentScope(r.onClick,{$event:t,form:r}):e.$eval(r.onClick,{$event:t,form:r}))},e.evalExpr=function(t,r){return s?s.evalInParentScope(t,r):e.$eval(t,r)},e.evalInScope=function(t,r){if(t)return e.$eval(t,r)},e.interp=function(e,t){return e&&a(e)(t)},e.hasSuccess=function(){return!!e.ngModel&&(e.options&&e.options.pristine&&e.options.pristine.success===!1?e.ngModel.$valid&&!e.ngModel.$pristine&&!e.ngModel.$isEmpty(e.ngModel.$modelValue):e.ngModel.$valid&&(!e.ngModel.$pristine||!e.ngModel.$isEmpty(e.ngModel.$modelValue)))},e.hasError=function(){return!!e.ngModel&&(e.options&&e.options.pristine&&e.options.pristine.errors===!1?e.ngModel.$invalid&&!e.ngModel.$pristine:e.ngModel.$invalid)},e.errorMessage=function(t){return u.interpolate(t&&t.code+""||"default",e.ngModel&&e.ngModel.$modelValue||"",e.ngModel&&e.ngModel.$viewValue||"",e.form,e.options&&e.options.validationMessage)},e.form.htmlClass=e.form.htmlClass||"",e.idClass=e.fieldId(!1)+" "+e.fieldId(!1,!0);var d=e.form;d.key&&(e.$on("schemaForm.error."+d.key.join("."),function(t,r,n,o,i){i=o,n!==!0&&n!==!1||(o=n,n=void 0),void 0!=i&&e.ngModel.$$parentForm.$name!==i||e.ngModel&&r&&(e.ngModel.$setDirty?e.ngModel.$setDirty():(e.ngModel.$dirty=!0,e.ngModel.$pristine=!1),n&&(d.validationMessage||(d.validationMessage={}),d.validationMessage[r]=n),e.ngModel.$setValidity(r,o===!0),o===!0&&(e.ngModel.$validate(),e.$broadcast("schemaFormValidate")))}),e.$on("$destroy",function(){var t=e.getKey();"number"==typeof e.arrayIndex?e.arrayIndex+1:0;if(!e.externalDestructionInProgress){var r=d.destroyStrategy||e.options&&e.options.destroyStrategy||"remove";if(t&&"retain"!==r){var n=e.model;if(t.length>1&&(n=f(t.slice(0,t.length-1),n)),n&&e.destroyed&&n.$$hashKey&&n.$$hashKey!==e.destroyed)return;if(void 0===n)return;var o=d.schema&&d.schema.type||"";"empty"===r&&o.indexOf("string")!==-1?n[t.slice(-1)]="":"empty"===r&&o.indexOf("object")!==-1?n[t.slice(-1)]={}:"empty"===r&&o.indexOf("array")!==-1?n[t.slice(-1)]=[]:"null"===r?n[t.slice(-1)]=null:delete n[t.slice(-1)]}}}))}}}}},function(e,t,r){"use strict";t.a=function(e,t){return{scope:!0,require:["?^^sfNewArray"],link:{pre:function(e,r,n,o){e.parentKey=e.parentKey||[];var i=t.parse(n.sfParentKey),a=i.length-e.parentKey.length;i.length>1&&(i=i.splice(-a)),e.parentKey=e.parentKey.concat(i,Number(n.sfIndex)),e.arrayIndex=Number(n.sfIndex),e.arrayIndices=e.arrayIndices||[],e.arrayIndices=e.arrayIndices.concat(e.arrayIndex),e.$i=e.arrayIndices,e.path=function(t){var r=-1;return t=t.replace(/\[\]/gi,function(t){return r++,"["+e.$i[r]+"]"}),e.evalExpr(t,e)}}}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(e,t){var r=e.has("$sanitize")?e.get("$sanitize"):function(e){return e};return{scope:!1,restrict:"EA",link:function(e,n,i){var a="";i.sfMessage&&e.$watch(i.sfMessage,function(t){t&&(a=r(t),c(!!e.ngModel))});var s,u=function(e){e!==s&&(n.html(e),s=e)},c=function(r){if(r)if(e.hasError()){var n=[];o.a.forEach(e.ngModel&&e.ngModel.$error,function(e,t){e&&n.push(t)}),n=n.filter(function(e){return"schemaForm"!==e});var i=n[0];u(i?t.interpolate(i,e.ngModel.$modelValue,e.ngModel.$viewValue,e.form,e.options&&e.options.validationMessage):a)}else u(a);else u(a)};c();var f=e.$watch("ngModel",function(e){e&&(e.$parsers.push(function(e){return c(!0),e}),e.$formatters.push(function(e){return c(!0),e}),f())});e.$watchCollection("ngModel.$error",function(){c(!!e.ngModel)})}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(e,t,r,n,i,a,s,u,c){return{scope:{schema:"=sfSchema",initialForm:"=sfForm",model:"=sfModel",options:"=sfOptions"},controller:["$scope",function(e){this.$onInit=function(){this.evalInParentScope=function(t,r){return e.$parent.$eval(t,r)};var t=this;e.lookup=function(e){return e&&(t.lookup=e),t.lookup}},1===o.a.version.major&&o.a.version.minor<5&&this.$onInit()}],replace:!1,restrict:"A",transclude:!0,require:"?form",link:function(u,f,l,p,d){u.formCtrl=p;var h={};d(u,function(e){if(e.addClass("schema-form-ignore"),f.prepend(e),f[0].querySelectorAll){var t=f[0].querySelectorAll("[ng-model]");if(t)for(var r=0;r0?n.all(a.map(function(e){return t.get(e.templateUrl,{cache:r}).then(function(t){e.template=t.data})})).then(function(){u.internalRender(e,o,s)}):u.internalRender(e,o,s)},u.internalRender=function(t,r,n){m&&(u.externalDestructionInProgress=!0,m.$destroy(),u.externalDestructionInProgress=!1),m=u.$new(),m.schemaForm={form:n,schema:t},Array.prototype.forEach.call(f.children(),function(e){var t=o.a.element(e);!1===t.hasClass("schema-form-ignore")&&t.remove()});for(var p={},d=f[0].querySelectorAll("*[sf-insert-field]"),h=0;h1&&(r=p(u.key.slice(0,u.key.length-1),r)),void 0===r)return;var n=u.schema&&u.schema.type||"";"empty"===t&&n.indexOf("string")!==-1?r[u.key.slice(-1)]="":"empty"===t&&n.indexOf("object")!==-1?r[u.key.slice(-1)]={}:"empty"===t&&n.indexOf("array")!==-1?r[u.key.slice(-1)]=[]:"null"===t?r[u.key.slice(-1)]=null:delete r[u.key.slice(-1)]}}})),g()}})}}}])},s=function(t,r,n){ -n=!!o.a.isDefined(n)&&n,e.directive("sf"+o.a.uppercase(t[0])+t.substr(1),function(){return{restrict:"EAC",scope:!0,replace:!0,transclude:n,template:'',link:function(e,r,n){var i={items:"c",titleMap:"c",schema:"c"},a={type:t},s=!0;o.a.forEach(n,function(t,r){if("$"!==r[0]&&0!==r.indexOf("ng")&&"sfField"!==r){var u=function(t){o.a.isDefined(t)&&t!==a[r]&&(a[r]=t,s&&a.type&&(a.key||o.a.isUndefined(n.key))&&(e.form=a,s=!1))};"model"===r?e.$watch(t,function(t){t&&e.model!==t&&(e.model=t)}):"c"===i[r]?e.$watchCollection(t,u):n.$observe(r,u)}})}}})};this.createDecorator=function(e,t){n[e]={__name:e},o.a.forEach(t,function(t,r){n[e][r]={template:t,replace:!1,builder:[]}}),n[r]||(r=e),a(e)},this.defineDecorator=function(e,t){n[e]={__name:e},o.a.forEach(t,function(t,r){t.builder=t.builder||[],t.replace=!o.a.isDefined(t.replace)||t.replace,n[e][r]=t}),n[r]||(r=e),a(e)},this.createDirective=s,this.createDirectives=function(e){o.a.forEach(e,function(e,t){s(t,e)})},this.decorator=function(e){return e=e||r,n[e]},this.addMapping=function(e,t,r,o,i){n[e]&&(n[e][t]={template:r,builder:o,replace:!!i})},this.defineAddOn=function(e,t,r,o){n[e]&&(n[e][t]={template:r,builder:o,replace:!0})},this.$get=function(){return{decorator:function(e){return n[e]||n[r]},defaultDecorator:r}},a("sfDecorator")}},function(e,t,r){"use strict";var n=r(0),o=(r.n(n),r(1));r.n(o);t.a=function(){var e=function(e){return e},t=o.schemaDefaults.createDefaults();this.defaults=t,this.stdFormObj=o.schemaDefaults.stdFormObj,this.defaultFormDefinition=o.schemaDefaults.defaultFormDefinition,this.postProcess=function(t){e=t},this.appendRule=function(e,t){this.defaults[e]||(this.defaults[e]=[]),this.defaults[e].push(t)},this.prependRule=function(e,t){this.defaults[e]||(this.defaults[e]=[]),this.defaults[e].unshift(t)},this.createStandardForm=o.schemaDefaults.stdFormObj,this.$get=function(){var t={},n=this.defaults;return t.jsonref=o.jsonref,t.defaults=function(e,t,r,i){var a=t||n;return o.schemaDefaults.defaultForm(e,a,r,i)},t.merge=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["*"],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.typeDefault,s=arguments[3],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],f=arguments[6],l=r.i(o.merge)(n,i,a,s,u,c,f);return e(l)},t.typeDefault=n,t.traverseSchema=o.traverseSchema,t.traverseForm=o.traverseForm,t}}},function(e,t,r){"use strict";t.a=function(e){var t=/[A-Z]/g,r=function(e,r){return r=r||"_",e.replace(t,function(e,t){return(t?r:"")+e.toLowerCase()})},n=0;"firstElementChild"in document.createDocumentFragment()||Object.defineProperty(DocumentFragment.prototype,"firstElementChild",{get:function(){for(var e,t=this.childNodes,r=0,n=t.length;r0&&e.fieldFrag.firstChild.setAttribute("ng-model-options",JSON.stringify(e.form.ngModelOptions))},transclusion:function(e){var t=e.fieldFrag.querySelectorAll("[sf-field-transclude]");if(t.length)for(var r=0;r0;)d.appendChild(h.childNodes[0]);var y={fieldFrag:d,form:f,lookup:c,state:u,path:s+"["+l+"]",build:function(t,r,a){return e(t,n,o,i,r,a,c)}},v=f.builder||p.builder;"function"==typeof v?v(y):v.forEach(function(e){e(y)}),(a(f,i)||t).appendChild(d)}else{var g=document.createElement(r(n.__name,"-"));u.arrayCompatFlag?g.setAttribute("form","copyWithIndex($index)"):g.setAttribute("form",s+"["+l+"]"),(a(f,i)||t).appendChild(g)}return t},f),f};return{build:function(t,r,n,o){return s(t,r,function(t,r){return"template"===t.type?t.template:e.get(r.template)},n,void 0,void 0,o)},builder:o,stdBuilders:i,internalBuild:s}}]}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(){var e={default:"Field does not validate",0:"Invalid type, expected {{schema.type}}",1:"No enum match for: {{viewValue}}",10:'Data does not match any schemas from "anyOf"',11:'Data does not match any schemas from "oneOf"',12:'Data is valid against more than one schema from "oneOf"',13:'Data matches schema from "not"',100:"Value is not a multiple of {{schema.multipleOf}}",101:"{{viewValue}} is less than the allowed minimum of {{schema.minimum}}",102:"{{viewValue}} is equal to the exclusive minimum {{schema.minimum}}",103:"{{viewValue}} is greater than the allowed maximum of {{schema.maximum}}",104:"{{viewValue}} is equal to the exclusive maximum {{schema.maximum}}",105:"Value is not a valid number",200:"String is too short ({{viewValue.length}} chars), minimum {{schema.minLength}}",201:"String is too long ({{viewValue.length}} chars), maximum {{schema.maxLength}}",202:"String does not match pattern: {{schema.pattern}}",300:"Too few properties defined, minimum {{schema.minProperties}}",301:"Too many properties defined, maximum {{schema.maxProperties}}",302:"Required",303:"Additional properties not allowed",304:"Dependency failed - key must exist",400:"Array is too short ({{value.length}}), minimum {{schema.minItems}}",401:"Array is too long ({{value.length}}), maximum {{schema.maxItems}}",402:"Array items are not unique",403:"Additional items not allowed",500:"Format validation failed",501:'Keyword failed: "{{title}}"',600:"Circular $refs",1e3:"Unknown property (not in schema)"};e.number=e[105],e.required=e[302],e.min=e[101],e.max=e[103],e.maxlength=e[201],e.minlength=e[200],e.pattern=e[202],this.setDefaultMessages=function(t){e=t},this.getDefaultMessages=function(){return e},this.setDefaultMessage=function(t,r){e[t]=r},this.$get=["$interpolate",function(t){var r={};return r.defaultMessages=e,r.interpolate=function(r,n,i,a,s){s=s||{};var u=a.validationMessage||{};0===r.indexOf("tv4-")&&(r=r.substring(4));var c=u.default||s.default||"";[u,s,e].some(function(e){return o.a.isString(e)||o.a.isFunction(e)?(c=e,!0):e&&e[r]?(c=e[r],!0):void 0});var f={error:r,value:n,viewValue:i,form:a,schema:a.schema,title:a.title||a.schema&&a.schema.title};return o.a.isFunction(c)?c(f):t(c)(f)},r}]}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=r(1),i=(r.n(o),r(0)),a=(r.n(i),function(){function e(e,t){for(var r=0;r1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(18),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},,function(e,t,r){r(1),e.exports=r(4)}]); \ No newline at end of file +var n=!0,o=!0,i=function(){function e(){for(var e=[],t=0;t1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,n=1;n>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function s(e){for(var t,r,n,o="",i=0,a=e.length;i=194&&t<224?(a-i>=6?(r=parseInt(e.substr(i+4,2),16),o+=String.fromCharCode((31&t)<<6|63&r)):o+=e.substr(i,6),i+=6):t>=224?(a-i>=9?(r=parseInt(e.substr(i+4,2),16),n=parseInt(e.substr(i+7,2),16),o+=String.fromCharCode((15&t)<<12|(63&r)<<6|63&n)):o+=e.substr(i,9),i+=9):(o+=e.substr(i,3),i+=3);return o}function u(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function c(e){return e.toUpperCase()}function f(e,t){function r(e){var r=s(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,i).replace(t.PCT_ENCODED,c)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,i).replace(t.PCT_ENCODED,c)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,i).replace(t.PCT_ENCODED,c)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,i).replace(t.PCT_ENCODED,c)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,i).replace(t.PCT_ENCODED,c)),e}function l(e,t){void 0===t&&(t={});var r,i,u=n&&!1!==t.iri?E:w,c={};if("suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e),o?(r=e.match(u.URI_REF),r&&(r=r[1]?r.slice(1,10):r.slice(10,19)),r||(!0,t.tolerant||(c.error=c.error||"URI is not strictly valid."),r=e.match($))):r=e.match($),r){if(S?(c.scheme=r[1],c.userinfo=r[3],c.host=r[4],c.port=parseInt(r[5],10),c.path=r[6]||"",c.query=r[7],c.fragment=r[8],isNaN(c.port)&&(c.port=r[5])):(c.scheme=r[1]||void 0,c.userinfo=-1!==e.indexOf("@")?r[3]:void 0,c.host=-1!==e.indexOf("//")?r[4]:void 0,c.port=parseInt(r[5],10),c.path=r[6]||"",c.query=-1!==e.indexOf("?")?r[7]:void 0,c.fragment=-1!==e.indexOf("#")?r[8]:void 0,isNaN(c.port)&&(c.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:void 0)),void 0!==c.scheme||void 0!==c.userinfo||void 0!==c.host||void 0!==c.port||c.path||void 0!==c.query?void 0===c.scheme?c.reference="relative":void 0===c.fragment?c.reference="absolute":c.reference="uri":c.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==c.reference&&(c.error=c.error||"URI is not a "+t.reference+" reference."),i=k[(t.scheme||c.scheme||"").toLowerCase()],!n||void 0===a||t.unicodeSupport||i&&i.unicodeSupport)f(c,u);else{if(c.host&&(t.domainHost||i&&i.domainHost))try{c.host=a.toASCII(c.host.replace(u.PCT_ENCODED,s).toLowerCase())}catch(e){c.error=c.error||"Host's domain name can not be converted to ASCII via punycode: "+e}f(c,w)}i&&i.parse&&i.parse(c,t)}else!0,c.error=c.error||"URI can not be parsed.";return c}function p(e,t){var r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(e.host),"number"==typeof e.port&&(r.push(":"),r.push(e.port.toString(10))),r.length?r.join(""):void 0}function d(e){for(var t,r=[];e.length;)e.match(O)?e=e.replace(O,""):e.match(C)?e=e.replace(C,"/"):e.match(A)?(e=e.replace(A,"/"),r.pop()):"."===e||".."===e?e="":(t=e.match(P)[0],e=e.slice(t.length),r.push(t));return r.join("")}function h(e,t){void 0===t&&(t={});var r,o,i,u=n&&t.iri?E:w,c=[];if(r=k[(t.scheme||e.scheme||"").toLowerCase()],r&&r.serialize&&r.serialize(e,t),n&&void 0!==a&&e.host&&(t.domainHost||r&&r.domainHost))try{e.host=t.iri?a.toUnicode(e.host):a.toASCII(e.host.replace(u.PCT_ENCODED,s).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}return f(e,u),"suffix"!==t.reference&&e.scheme&&(c.push(e.scheme),c.push(":")),o=p(e,t),void 0!==o&&("suffix"!==t.reference&&c.push("//"),c.push(o),e.path&&"/"!==e.path.charAt(0)&&c.push("/")),void 0!==e.path&&(i=e.path,t.absolutePath||r&&r.absolutePath||(i=d(i)),void 0===o&&(i=i.replace(/^\/\//,"/%2F")),c.push(i)),void 0!==e.query&&(c.push("?"),c.push(e.query)),void 0!==e.fragment&&(c.push("#"),c.push(e.fragment)),c.join("")}function m(e,t,r,n){void 0===r&&(r={});var o={};return n||(e=l(h(e,r),r),t=l(h(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=d(t.path),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=d(t.path),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=d(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=d(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function v(e,t,r){return h(m(l(e,r),l(t,r),r,!0),r)}function y(e,t){return"string"==typeof e?e=h(l(e,t),t):"object"===u(e)&&(e=l(h(e,t),t)),e}function g(e,t,r){return"string"==typeof e?e=h(l(e,r),r):"object"===u(e)&&(e=h(e,r)),"string"==typeof t?t=h(l(t,r),r):"object"===u(t)&&(t=h(t,r)),e===t}function b(e,t){return e&&e.toString().replace(n&&t&&t.iri?E.ESCAPE:w.ESCAPE,i)}function x(e,t){return e&&e.toString().replace(n&&t&&t.iri?E.PCT_ENCODED:w.PCT_ENCODED,s)}var w=r(!1),E=n?r(!0):void 0,$=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i,O=/^\.\.?\//,C=/^\/\.(\/|$)/,A=/^\/\.\.(\/|$)/,P=/^\/?(?:.|\n)*?(?=\/|$)/,S=void 0==="".match(/(){0}/)[1],k={};return{IRI_SUPPORT:n,VALIDATE_SUPPORT:o,pctEncChar:i,pctDecChars:s,SCHEMES:k,parse:l,_recomposeAuthority:p,removeDotSegments:d,serialize:h,resolveComponents:m,resolve:v,normalize:y,equal:g,escapeComponent:b,unescapeComponent:x}}();if(void 0!==t&&"function"==typeof e){var a=e("./punycode");t.exports=i,e("./schemes")}},{"./punycode":18,"./schemes":19}]},{},[1])(1)})},function(e,t,r){"use strict";function n(e,t){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.i(i.createDefaults)(),c=arguments[3],f=arguments[4],l=arguments[5],p=arguments[6],d=[],h=[];t=t||[];var m=t.indexOf("*");f=f||{};var v={},y=t.indexOf("...");if("object"===(void 0===e?"undefined":s(e))&&e.hasOwnProperty("properties")){l=l||e.readonly||e.readOnly,v=r.i(i.defaultForm)(e,u,c,f);var g=v.lookup;e=g||e,d=d.concat(v.form)}return-1!==m&&(t=t.slice(0,m).concat(d).concat(t.slice(m+1))),v.form&&-1!==y&&function(){var e=t.map(function(e){return"string"==typeof e?e:e.key?e.key:void 0}).filter(function(e){return void 0!==e});h=h.concat(v.form.map(function(t){if(-1===e.indexOf(t.key[0]))return t}).filter(function(e){return void 0!==e}))}(),-1!==y&&(t=t.slice(0,y).concat(h).concat(t.slice(y+1))),t.map(function(t){if("string"==typeof t&&(t={key:t}),t.key&&"string"==typeof t.key&&(t.key=r.i(o.parse)(t.key)),t.titleMap&&(t.titleMap=r.i(a.a)(t.titleMap)),t.key){var i=r.i(o.stringify)(t.key);e[i]&&function(){var r=e[i];r&&Object.keys(r).forEach(function(e){void 0===t[e]&&(t[e]=r[e])})}()}return!0===l&&(t.readonly=!0),t.items&&(t.items=n(e,t.items,u,c,f,t.readonly,p)),t.tabs&&t.tabs.forEach(function(r){r.items&&(r.items=n(e,r.items,u,c,f,t.readonly,p))}),"checkbox"===t.type&&(void 0===t.schema?t.schema={default:!1}:void 0===t.schema.default&&(t.schema.default=!1)),p&&"template"===t.type&&!t.template&&t.templateUrl&&p.push(t),t})}var o=r(0),i=r(3),a=r(1);t.a=n;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}},function(e,t,r){"use strict";function n(e,t){var r=new Promise(function(t,r){o.resolveRefs(e,{filter:["relative","local","remote"]}).then(function(e){t(e.resolved)}).catch(function(e){r(new Error(e))})});if("function"!=typeof t)return r;r.then(function(e){t(null,e)}).catch(function(e){t(e)})}var o=r(5);r.n(o);t.a=n},function(e,t,r){"use strict";function n(e,t,r){t||(t=this);var n="string"==typeof e?o.parse(e):e;if(void 0!==r&&1===n.length)return t[n[0]]=r,t;void 0!==r&&void 0===t[n[0]]&&(t[n[0]]=n.length>2&&i.test(n[1])?[]:{});for(var a=t[n[0]],s=1;si&&(a.push(e.slice(i,r)),i=r),'"'!==(n=e.slice(r+1,r+2))&&"'"!==n)o=e.indexOf("]",r),-1===o&&(o=e.length),a.push(e.slice(i+1,o)),i="."===e.slice(o+1,o+2)?o+2:o+1;else{for(o=e.indexOf(n+"]",r),-1===o&&(o=e.length);"\\"===e.slice(o-1,o)&&r0){n.titleMapValues=[];var t=function(t){n.titleMapValues=[],t=t||[],e.titleMap.forEach(function(e){n.titleMapValues.push(-1!==t.indexOf(e.value))})};t(n.modelArray),n.$watchCollection("modelArray",t),n.$watchCollection("titleMapValues",function(t,r){if(t&&t!==r){var o=f();e.titleMap.forEach(function(e,r){var n=o.indexOf(e.value);-1===n&&t[r]&&o.push(e.value),-1===n||t[r]||o.splice(n,1)}),n.validateField&&n.validateField()}})}l()}});n.appendToArray=function(){var t,i=f();if(n.form&&n.form.schema&&n.form.schema.items){var a=n.form.schema.items;a.type&&-1!==a.type.indexOf("object")?(t={},n.options&&!1===n.options.setSchemaDefaults||(t=o.a.isDefined(a.default)?a.default:t)&&r.traverseSchema(a,function(r,n){o.a.isDefined(r.default)&&e(n,t,r.default)})):(a.type&&(-1!==a.type.indexOf("array")?t=[]:-1===a.type.indexOf("string")&&-1===a.type.indexOf("number")||(t="")),n.options&&!1===n.options.setSchemaDefaults||(t=a.default||t))}return i.push(t),i},n.deleteFromArray=function(e){var t=n.modelArray.indexOf(e),r=n.modelArray;return r&&r.splice(t,1),e.$$hashKey&&(n.destroyed=e.$$hashKey),r};var p=function(e){return function(t){t.key&&(t.key[t.key.indexOf("")]=e)}},d={};n.copyWithIndex=function(e){var t=n.form;if(!d[e]){var i=t.items[0];if(t.items.length>1&&(i={type:"section",items:t.items.map(function(e){return e.ngModelOptions=t.ngModelOptions,o.a.isUndefined(e.readonly)&&(e.readonly=t.readonly),e})}),i){var a=o.a.copy(i);a.arrayIndex=e,r.traverseForm(a,p(e)),d[e]=a}}return d[e]}}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(){return{require:"ngModel",restrict:"AC",scope:!1,link:function(e,t,r,n){var i=e.$eval(r.sfChanged);i&&i.onChange&&n.$viewChangeListeners.push(function(){o.a.isFunction(i.onChange)?i.onChange(n.$modelValue,i):e.evalExpr(i.onChange,{modelValue:n.$modelValue,form:i,arrayIndex:e.$index,arrayIndices:e.arrayIndices,path:e.path,$i:e.$i,$index:e.$index})})}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.a=function(e,t,r,n,a,s,u,c,f){var l={COMPLETE:"*",PATH:"string",INDICES:"number"};return{restrict:"AE",replace:!1,transclude:!1,scope:!0,require:["^sfSchema","?^form","?^^sfKeyController"],link:{pre:function(e,t,r,n){var o=n[0];n[1],n[2];e.$on("schemaFormPropagateNgModelController",function(t,r){t.stopPropagation(),t.preventDefault(),e.ngModel=r}),e.initialForm=Object.assign({},o.lookup["f"+r.sfField]),e.form=o.lookup["f"+r.sfField]},post:function(e,t,r,n){var s=n[0],p=n[1];n[2];e.getKey=function(t){var r=t||l.COMPLETE,n=e.parentKey?e.parentKey.slice(0,e.parentKey.length-1):[];if(e.completeKey!==e.form.key&&("number"==typeof e.$index&&(n=n.concat(e.$index)),e.form.key&&e.form.key.length))if("number"==typeof n[n.length-1]&&e.form.key.length>=1){var o=e.form.key.length-n.length;e.completeKey=o>0?n.concat(e.form.key.slice(-o)):n}else e.completeKey=e.form.key.slice();if(Array.isArray(e.completeKey))return r===l.COMPLETE?e.completeKey:e.completeKey.reduce(function(e,t,n){return-1!==[r].indexOf(void 0===t?"undefined":i(t))?e.concat(t):e},[])},e.form.key&&(e.form.key=e.completeKey=e.getKey()),e.showTitle=function(){return e.form&&!0!==e.form.notitle&&e.form.title},e.fieldId=function(t,r){var n=r||!1,o=t&&p&&p.$name?p.$name:void 0,i=e.completeKey;return Array.isArray(i)?c.name(i,"-",o,n):""},e.listToCheckboxValues=function(e){var t={};return o.a.forEach(e,function(e){t[e]=!0}),t},e.checkboxValuesToList=function(e){var t=[];return o.a.forEach(e,function(e,r){e&&t.push(r)}),t},e.buttonClick=function(t,r){o.a.isFunction(r.onClick)?r.onClick(t,r):o.a.isString(r.onClick)&&(s?s.evalInParentScope(r.onClick,{$event:t,form:r}):e.$eval(r.onClick,{$event:t,form:r}))},e.evalExpr=function(t,r){return s?s.evalInParentScope(t,r):e.$eval(t,r)},e.evalInScope=function(t,r){if(t)return e.$eval(t,r)},e.interp=function(e,t){return e&&a(e)(t)},e.hasSuccess=function(){return!!e.ngModel&&(e.options&&e.options.pristine&&!1===e.options.pristine.success?e.ngModel.$valid&&!e.ngModel.$pristine&&!e.ngModel.$isEmpty(e.ngModel.$modelValue):e.ngModel.$valid&&(!e.ngModel.$pristine||!e.ngModel.$isEmpty(e.ngModel.$modelValue)))},e.hasError=function(){return!!e.ngModel&&(e.options&&e.options.pristine&&!1===e.options.pristine.errors?e.ngModel.$invalid&&!e.ngModel.$pristine:e.ngModel.$invalid)},e.errorMessage=function(t){return u.interpolate(t&&t.code+""||"default",e.ngModel&&e.ngModel.$modelValue||"",e.ngModel&&e.ngModel.$viewValue||"",e.form,e.options&&e.options.validationMessage)},e.form.htmlClass=e.form.htmlClass||"",e.idClass=e.fieldId(!1)+" "+e.fieldId(!1,!0);var d=e.form;d.key&&(e.$on("schemaForm.error."+d.key.join("."),function(t,r,n,o,i){i=o,!0!==n&&!1!==n||(o=n,n=void 0),void 0!=i&&e.ngModel.$$parentForm.$name!==i||e.ngModel&&r&&(e.ngModel.$setDirty?e.ngModel.$setDirty():(e.ngModel.$dirty=!0,e.ngModel.$pristine=!1),n&&(d.validationMessage||(d.validationMessage={}),d.validationMessage[r]=n),e.ngModel.$setValidity(r,!0===o),!0===o&&(e.ngModel.$validate(),e.$broadcast("schemaFormValidate")))}),e.$on("$destroy",function(){var t=e.getKey();"number"==typeof e.arrayIndex&&e.arrayIndex;if(!e.externalDestructionInProgress){var r=d.destroyStrategy||e.options&&e.options.destroyStrategy||"remove";if(t&&"retain"!==r){var n=e.model;if(t.length>1&&(n=f(t.slice(0,t.length-1),n)),n&&e.destroyed&&n.$$hashKey&&n.$$hashKey!==e.destroyed)return;if(void 0===n)return;var o=d.schema&&d.schema.type||"";"empty"===r&&-1!==o.indexOf("string")?n[t.slice(-1)]="":"empty"===r&&-1!==o.indexOf("object")?n[t.slice(-1)]={}:"empty"===r&&-1!==o.indexOf("array")?n[t.slice(-1)]=[]:"null"===r?n[t.slice(-1)]=null:delete n[t.slice(-1)]}}}))}}}}},function(e,t,r){"use strict";t.a=function(e,t){return{scope:!0,require:["?^^sfNewArray"],link:{pre:function(e,r,n,o){e.parentKey=e.parentKey||[];var i=t.parse(n.sfParentKey),a=i.length-e.parentKey.length;i.length>1&&(i=i.splice(-a)),e.parentKey=e.parentKey.concat(i,Number(n.sfIndex)),e.arrayIndex=Number(n.sfIndex),e.arrayIndices=e.arrayIndices||[],e.arrayIndices=e.arrayIndices.concat(e.arrayIndex),e.$i=e.arrayIndices,e.path=function(t){var r=-1;return t=t.replace(/\[\]/gi,function(t){return r++,"["+e.$i[r]+"]"}),e.evalExpr(t,e)}}}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(e,t){var r=e.has("$sanitize")?e.get("$sanitize"):function(e){return e};return{scope:!1,restrict:"EA",link:function(e,n,i){var a="";i.sfMessage&&e.$watch(i.sfMessage,function(t){t&&(a=r(t),c(!!e.ngModel))});var s,u=function(e){e!==s&&(n.html(e),s=e)},c=function(r){if(r)if(e.hasError()){var n=[];o.a.forEach(e.ngModel&&e.ngModel.$error,function(e,t){e&&n.push(t)}),n=n.filter(function(e){return"schemaForm"!==e});var i=n[0];u(i?t.interpolate(i,e.ngModel.$modelValue,e.ngModel.$viewValue,e.form,e.options&&e.options.validationMessage):a)}else u(a);else u(a)};c();var f=e.$watch("ngModel",function(e){e&&(e.$parsers.push(function(e){return c(!0),e}),e.$formatters.push(function(e){return c(!0),e}),f())});e.$watchCollection("ngModel.$error",function(){c(!!e.ngModel)})}}}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(e,t,r,n,i,a,s,u,c){return{scope:{schema:"=sfSchema",initialForm:"=sfForm",model:"=sfModel",options:"=sfOptions"},controller:["$scope",function(e){this.$onInit=function(){this.evalInParentScope=function(t,r){return e.$parent.$eval(t,r)};var t=this;e.lookup=function(e){return e&&(t.lookup=e),t.lookup}},1===o.a.version.major&&o.a.version.minor<5&&this.$onInit()}],replace:!1,restrict:"A",transclude:!0,require:"?form",link:function(u,f,l,p,d){u.formCtrl=p;var h={};d(u,function(e){if(e.addClass("schema-form-ignore"),f.prepend(e),f[0].querySelectorAll){var t=f[0].querySelectorAll("[ng-model]");if(t)for(var r=0;r0?n.all(a.map(function(e){return t.get(e.templateUrl,{cache:r}).then(function(t){e.template=t.data})})).then(function(){u.internalRender(e,o,s)}):u.internalRender(e,o,s)},u.internalRender=function(t,r,n){m&&(u.externalDestructionInProgress=!0,m.$destroy(),u.externalDestructionInProgress=!1),m=u.$new(),m.schemaForm={form:n,schema:t},Array.prototype.forEach.call(f.children(),function(e){var t=o.a.element(e);!1===t.hasClass("schema-form-ignore")&&t.remove()});for(var p={},d=f[0].querySelectorAll("*[sf-insert-field]"),h=0;h1&&(r=p(u.key.slice(0,u.key.length-1),r)),void 0===r)return;var n=u.schema&&u.schema.type||"";"empty"===t&&-1!==n.indexOf("string")?r[u.key.slice(-1)]="":"empty"===t&&-1!==n.indexOf("object")?r[u.key.slice(-1)]={}:"empty"===t&&-1!==n.indexOf("array")?r[u.key.slice(-1)]=[]:"null"===t?r[u.key.slice(-1)]=null:delete r[u.key.slice(-1)]}}})),g()}})}}}])},s=function(t,r,n){n=!!o.a.isDefined(n)&&n,e.directive("sf"+o.a.uppercase(t[0])+t.substr(1),function(){return{restrict:"EAC",scope:!0,replace:!0,transclude:n,template:'',link:function(e,r,n){var i={items:"c",titleMap:"c",schema:"c"},a={type:t},s=!0;o.a.forEach(n,function(t,r){if("$"!==r[0]&&0!==r.indexOf("ng")&&"sfField"!==r){var u=function(t){o.a.isDefined(t)&&t!==a[r]&&(a[r]=t,s&&a.type&&(a.key||o.a.isUndefined(n.key))&&(e.form=a,s=!1))};"model"===r?e.$watch(t,function(t){t&&e.model!==t&&(e.model=t)}):"c"===i[r]?e.$watchCollection(t,u):n.$observe(r,u)}})}}})};this.createDecorator=function(e,t){n[e]={__name:e},o.a.forEach(t,function(t,r){n[e][r]={template:t,replace:!1,builder:[]}}),n[r]||(r=e),a(e)},this.defineDecorator=function(e,t){n[e]={__name:e},o.a.forEach(t,function(t,r){t.builder=t.builder||[],t.replace=!o.a.isDefined(t.replace)||t.replace,n[e][r]=t}),n[r]||(r=e),a(e)},this.createDirective=s,this.createDirectives=function(e){o.a.forEach(e,function(e,t){s(t)})},this.decorator=function(e){return e=e||r,n[e]},this.addMapping=function(e,t,r,o,i){n[e]&&(n[e][t]={template:r,builder:o,replace:!!i})},this.defineAddOn=function(e,t,r,o){n[e]&&(n[e][t]={template:r,builder:o,replace:!0})},this.$get=function(){return{decorator:function(e){return n[e]||n[r]},defaultDecorator:r}},a("sfDecorator")}},function(e,t,r){"use strict";var n=r(0),o=(r.n(n),r(1));r.n(o);t.a=function(){var e=function(e){return e},t=o.schemaDefaults.createDefaults();this.defaults=t,this.stdFormObj=o.schemaDefaults.stdFormObj,this.defaultFormDefinition=o.schemaDefaults.defaultFormDefinition,this.postProcess=function(t){e=t},this.appendRule=function(e,t){this.defaults[e]||(this.defaults[e]=[]),this.defaults[e].push(t)},this.prependRule=function(e,t){this.defaults[e]||(this.defaults[e]=[]),this.defaults[e].unshift(t)},this.createStandardForm=o.schemaDefaults.stdFormObj,this.$get=function(){var t={},n=this.defaults;return t.jsonref=o.jsonref,t.defaults=function(e,t,r,i){var a=t||n;return o.schemaDefaults.defaultForm(e,a,r,i)},t.merge=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["*"],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.typeDefault,s=arguments[3],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],f=arguments[6],l=r.i(o.merge)(n,i,a,s,u,c,f);return e(l)},t.typeDefault=n,t.traverseSchema=o.traverseSchema,t.traverseForm=o.traverseForm,t}}},function(e,t,r){"use strict";t.a=function(e){var t=function(e,t){return t=t||"_",e.replace(/[A-Z]/g,function(e,r){return(r?t:"")+e.toLowerCase()})},r=0;"firstElementChild"in document.createDocumentFragment()||Object.defineProperty(DocumentFragment.prototype,"firstElementChild",{get:function(){for(var e,t=this.childNodes,r=0,n=t.length;r0&&e.fieldFrag.firstChild.setAttribute("ng-model-options",JSON.stringify(e.form.ngModelOptions))},transclusion:function(e){var t=e.fieldFrag.querySelectorAll("[sf-field-transclude]");if(t.length)for(var r=0;r0;)d.appendChild(h.childNodes[0]);var v={fieldFrag:d,form:f,lookup:c,state:u,path:s+"["+l+"]",build:function(t,r,a){return e(t,n,o,i,r,a,c)}},y=f.builder||p.builder;"function"==typeof y?y(v):y.forEach(function(e){e(v)}),(a(f,i)||r).appendChild(d)}else{var g=document.createElement(t(n.__name,"-"));u.arrayCompatFlag?g.setAttribute("form","copyWithIndex($index)"):g.setAttribute("form",s+"["+l+"]"),(a(f,i)||r).appendChild(g)}return r},f),f};return{build:function(t,r,n,o){return s(t,r,function(t,r){return"template"===t.type?t.template:e.get(r.template)},n,void 0,void 0,o)},builder:n,stdBuilders:o,internalBuild:s}}]}},function(e,t,r){"use strict";var n=r(0),o=r.n(n);t.a=function(){var e={default:"Field does not validate",0:"Invalid type, expected {{schema.type}}",1:"No enum match for: {{viewValue}}",10:'Data does not match any schemas from "anyOf"',11:'Data does not match any schemas from "oneOf"',12:'Data is valid against more than one schema from "oneOf"',13:'Data matches schema from "not"',100:"Value is not a multiple of {{schema.multipleOf}}",101:"{{viewValue}} is less than the allowed minimum of {{schema.minimum}}",102:"{{viewValue}} is equal to the exclusive minimum {{schema.minimum}}",103:"{{viewValue}} is greater than the allowed maximum of {{schema.maximum}}",104:"{{viewValue}} is equal to the exclusive maximum {{schema.maximum}}",105:"Value is not a valid number",200:"String is too short ({{viewValue.length}} chars), minimum {{schema.minLength}}",201:"String is too long ({{viewValue.length}} chars), maximum {{schema.maxLength}}",202:"String does not match pattern: {{schema.pattern}}",300:"Too few properties defined, minimum {{schema.minProperties}}",301:"Too many properties defined, maximum {{schema.maxProperties}}",302:"Required",303:"Additional properties not allowed",304:"Dependency failed - key must exist",400:"Array is too short ({{value.length}}), minimum {{schema.minItems}}",401:"Array is too long ({{value.length}}), maximum {{schema.maxItems}}",402:"Array items are not unique",403:"Additional items not allowed",500:"Format validation failed",501:'Keyword failed: "{{title}}"',600:"Circular $refs",1e3:"Unknown property (not in schema)"};e.number=e[105],e.required=e[302],e.min=e[101],e.max=e[103],e.maxlength=e[201],e.minlength=e[200],e.pattern=e[202],this.setDefaultMessages=function(t){e=t},this.getDefaultMessages=function(){return e},this.setDefaultMessage=function(t,r){e[t]=r},this.$get=["$interpolate",function(t){var r={};return r.defaultMessages=e,r.interpolate=function(r,n,i,a,s){s=s||{};var u=a.validationMessage||{};0===r.indexOf("tv4-")&&(r=r.substring(4));var c=u.default||s.default||"";[u,s,e].some(function(e){return o.a.isString(e)||o.a.isFunction(e)?(c=e,!0):e&&e[r]?(c=e[r],!0):void 0});var f={error:r,value:n,viewValue:i,form:a,schema:a.schema,title:a.title||a.schema&&a.schema.title};return o.a.isFunction(c)?c(f):t(c)(f)},r}]}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=r(1),i=(r.n(o),r(0)),a=(r.n(i),function(){function e(e,t){for(var r=0;r1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(18),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},,function(e,t,r){r(1),e.exports=r(4)}]); \ No newline at end of file