eventman/static/js/formly.min.js
2016-06-18 20:01:17 +02:00

4 lines
No EOL
40 KiB
JavaScript

/*! angular-formly v8.0.4 | MIT | built with ♥ by Astrism <astrisms@gmail.com>, Kent C. Dodds <kent@doddsfamily.us> (ó ì_í)=óò=(ì_í ò) */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("api-check"),require("angular")):"function"==typeof define&&define.amd?define(["api-check","angular"],t):"object"==typeof exports?exports.ngFormly=t(require("api-check"),require("angular")):e.ngFormly=t(e.apiCheck,e.angular)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=o(r);t["default"]=i["default"],e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(18);o.version||(o=window.angular),t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){return i(e,".")||i(e,"[")&&i(e,"]")}function i(e,t){return e&&e.indexOf?-1!==e.indexOf(t):!1}function a(e,t,n,o,r){return v["default"].isFunction(t)?t(o,n,e,r):e.$eval(t,v["default"].extend({$viewValue:o,$modelValue:n},r))}function l(e,t,n){if(t.id)return t.id;var o=t.type;return!o&&t.template?o="template":!o&&t.templateUrl&&(o="templateUrl"),[e,o,t.key,n].join("_")}function f(e){return v["default"].forEach(arguments,function(t,n){n&&v["default"].forEach(t,function(t,n){v["default"].isDefined(e[n])?s(e[n],t)&&f(e[n],t):e[n]=v["default"].copy(t)})}),e}function s(e,t){return v["default"].isObject(e)&&v["default"].isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}function u(e,t){if(e.prop||(e=v["default"].element(e)),e.prop("nodeName")===t.toUpperCase())return e;for(var n=e.children(),o=0;n&&o<n.length;o++){var r=u(n[o],t);if(r)return r}}function p(e){return e&&!v["default"].isArray(e)?e=[e]:e||(e=[]),e}function d(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return function(){var e=arguments;t.forEach(function(t){return t.apply(null,e)})}}function c(e,t,n){return n&&(e=e[n],t=t[n]),t&&e?(v["default"].forEach(t,function(t){-1===e.indexOf(t)&&e.push(t)}),e):t?t:e}function m(e,t){return v["default"].isString(e)&&v["default"].isString(t)?e.length>=t.length&&e.substring(0,t.length)===t:!1}function y(e,t){return v["default"].isString(e)&&v["default"].isString(t)?e.length>=t.length&&-1!==e.indexOf(t):!1}Object.defineProperty(t,"__esModule",{value:!0});var h=n(1),v=o(h);t["default"]={containsSelector:r,containsSpecialChar:i,formlyEval:a,getFieldId:l,reverseDeepMerge:f,findByNodeName:u,arrayify:p,extendFunction:d,extendArray:c,startsWith:m,contains:y},e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]="https://github.com/formly-js/angular-formly/blob/8.0.4/other/ERRORS_AND_WARNINGS.md#",e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){return{restrict:"A",require:"ngModel",link:function(t,n,o,r){function i(e,t,n){l(t,n),t=a["default"].isObject(t)?t.expression:t,p?f(t,n,e):s(t,n,e)}function l(n,o){var i=n.message;i&&(u.validation.messages[o]=function(){return e.formlyEval(t,i,r.$modelValue,r.$viewValue)})}function f(n,o,i){var a=i?"$asyncValidators":"$validators";r[a][o]=function(o,r){return e.formlyEval(t,n,o,r)}}function s(n,o,i){var a=void 0;r.$parsers.unshift(function(l){var f=e.formlyEval(t,n,r.$modelValue,l);return i?(r.$pending=r.$pending||{},r.$pending[o]=!0,a=f,f.then(function(){a===f&&r.$setValidity(o,!0)})["catch"](function(){a===f&&r.$setValidity(o,!1)})["finally"](function(){var e=r.$pending||{};1===Object.keys(e).length?delete r.$pending:delete r.$pending[o]})):r.$setValidity(o,f),l})}var u=t.options;u.validation.messages=u.validation.messages||{},a["default"].forEach(u.validation.messages,function(n,o){u.validation.messages[o]=function(){return e.formlyEval(t,n,r.$modelValue,r.$viewValue)}});var p=r.hasOwnProperty("$validators")&&!o.hasOwnProperty("useParsers");a["default"].forEach(u.validators,a["default"].bind(null,i,!1)),a["default"].forEach(u.asyncValidators,a["default"].bind(null,i,!0))}}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i);t["default"]=r,r.$inject=["formlyUtil"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t,n,o,i,f,u,d,c,m){function y(e,n,o,r,i){function a(){return n(function(){var n=e.options,r=u();s["default"].forEach(n.expressionProperties,function(i,a){var l=o(a).assign,f=t.when(d.formlyEval(e,i,r,r));f.then(function(e){l(n,e)})})},0,!1)}function l(){e.formOptions.watchAllExpressions&&!function(){var t=e.options,n=u();s["default"].forEach(t.expressionProperties,function(r,i){var a=o(i).assign;e.$watch(function(){return d.formlyEval(e,r,n,n)},function(e){a(t,e)},!0)})}()}function u(t){return e.model&&e.options.key?(s["default"].isDefined(t)&&c(e.options.key,e.model,t),m(e.options.key,e.model)):void 0}function p(e){return s["default"].isNumber(e)||!d.containsSelector(e)}function c(t,n,r){if(t&&n)if(p(t))n[t]=r;else{var i=o(e.options.key).assign;i&&i(e.model,r)}}function m(e,t){return e&&t?p(e)?t[e]:o(e)(t):void 0}function y(t){d.reverseDeepMerge(t,{originalModel:t.model,extras:{},data:{},templateOptions:{},validation:{}}),e.to=e.options.templateOptions,e.formOptions=e.formOptions||{}}function h(){if(s["default"].isFunction(f.extras.getFieldId))e.id=f.extras.getFieldId(e.options,e.model,e);else{var t=e.form&&e.form.$name||e.formId;e.id=d.getFieldId(t,e.options,e.index)}e.options.id=e.id,e.name=e.options.name||e.options.id,e.options.name=e.name}function v(){s["default"].isDefined(e.options.defaultValue)&&!s["default"].isDefined(m(e.options.key,e.model))&&c(e.options.key,e.model,e.options.defaultValue)}function b(){e.options.initialValue=e.model&&m(e.options.key,e.model)}function O(e,t){t&&x(e,t.defaultOptions);var n=j(e.optionsTypes).reverse();s["default"].forEach(n,function(t){x(e,f.getType(t,!0,e).defaultOptions)})}function x(t,n){n&&(s["default"].isFunction(n)&&(n=n(t,e)),d.reverseDeepMerge(t,n))}function E(e,t){var n=e.key||t||0;s["default"].extend(e,{key:n,value:e.value||u,runExpressions:a,resetModel:w,updateInitialValue:k})}function w(){c(e.options.key,e.model,e.options.initialValue),e.options.formControl&&(s["default"].isArray(e.options.formControl)?s["default"].forEach(e.options.formControl,function(e){$(e,!0)}):$(e.options.formControl)),e.form&&(e.form.$setUntouched&&e.form.$setUntouched(),e.form.$setPristine())}function $(t,n){n||t.$setViewValue(m(e.options.key,e.model)),t.$render(),t.$setUntouched&&t.$setUntouched(),t.$setPristine(),e.$root.$$phase||e.$digest()}function k(){e.options.initialValue=m(e.options.key,e.model)}function M(e){e.validation.messages=e.validation.messages||{},s["default"].forEach(i.messages,function(t,n){e.validation.messages[n]||(e.validation.messages[n]=function(e,n,o){return d.formlyEval(o,t,n,e)})})}function C(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];s["default"].forEach([n.controller,t.controller],function(t){t&&r(t,{$scope:e})})}function T(){e.options.options=e.options.options||{},e.options.options.formState=e.formState,e.to=e.options.templateOptions}if(e.options.fieldGroup)return void T();var F=g(e.options);y(e.options),O(e.options,F),E(e.options,e.index),A(e.options),h(),v(),b(),a(),l(),M(e.options),C(e,e.options,F)}function h(e,o,u,p){function c(){k(e.options),o.addClass("formly-field-group");var t="";e.options.elementAttributes&&(t=Object.keys(e.options.elementAttributes).map(function(t){return t+'="'+e.options.elementAttributes[t]+'"'}).join(" "));var n="model";e.options.form=e.form,e.options.key&&(n="model['"+e.options.key+"']"),x('\n <formly-form model="'+n+'"\n fields="options.fieldGroup"\n options="options.options"\n form="options.form"\n class="'+e.options.className+'"\n '+t+"\n is-field-group>\n </formly-form>\n ").then(E(e.options,e.formOptions)).then(w)}function y(){e.options.elementAttributes&&o.attr(e.options.elementAttributes)}function h(){e.options.className&&o.addClass(e.options.className),e.options.type&&o.addClass("formly-field-"+e.options.type)}function w(t){return o.html(v(t)),n(o.contents())(e),t}function $(t){function n(t){var n=/\{\{(.*?)}}/,r=n.exec(t);r&&(t=i(t)(e)),o(t)}function o(t){e.$watch('form["'+t+'"]',function(t){t&&(_>1?(e.options.formControl||(e.options.formControl=[]),e.options.formControl.push(t)):e.options.formControl=t,e.fc=e.options.formControl,y(),u(),p(),c())})}function u(){y=e.$watch(function(){var t=f.extras.errorExistsAndShouldBeVisibleExpression,n=e.options,o=j(e.fc);return o.some(function(e){return e.$invalid})?"boolean"==typeof n.validation.show?n.validation.show:t?o.some(function(n){return d.formlyEval(e,t,n.$modelValue,n.$viewValue)}):o.some(function(e){var t=s["default"].isUndefined(e.$touched)&&e.$dirty;return e.$touched||t}):!1},function(t){e.options.validation.errorExistsAndShouldBeVisible=t,e.showError=t})}function p(){m("parsers")}function c(){m("formatters");var t=e.fc,n=e.form.$pristine;e.options.formatters&&!function(){var o=t.$modelValue;t.$formatters.forEach(function(e){o=e(o)}),t.$setViewValue(o),t.$render(),t.$setPristine(),n&&e.form.$setPristine()}()}function m(t){function n(r){if(!r)return[];s["default"].isString(r)&&(r=f.getType(r,!0,e.options));var i=[];return r["extends"]&&(i=d.extendArray(i,n(r["extends"]))),i=d.extendArray(i,l(r,t,[])),i=d.extendArray(i,o(a(r)))}function o(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],t=[];return s["default"].forEach(s["default"].copy(j(e)).reverse(),function(e){t=d.extendArray(t,n(e))}),t}function i(t){function n(n){var o=e.options.value();return d.formlyEval(e,t,o,n)}return n[u]=t,n}var u="originalParser";"formatters"===t&&(u="originalFormatter");var p=n(C);p=d.extendArray(p,o(e.options.optionsTypes)),p=d.extendArray(p,e.options[t]),s["default"].forEach(p,function(e,t){p[t]=i(e)});var c=e.fc;s["default"].isArray(c)||(c=[c]),s["default"].forEach(c,function(e){var n;e["$"+t]=(n=e["$"+t]).concat.apply(n,r(p))})}var y=s["default"].noop;if(!e.options.noFormControl){var h=s["default"].element("<div>"+t+"</div>"),v=h[0].querySelectorAll("[ng-model],[data-ng-model]");v.length&&s["default"].forEach(v,function(e){_++,n(e.getAttribute("name"))})}}function A(){C&&C.link&&C.link.apply(F,T),e.options.link&&e.options.link.apply(F,T)}function M(n){return function(o){var r=t.when(o);return s["default"].forEach(n,function(n){r=r.then(function(o){return t.when(n(o,e.options,e)).then(function(e){return s["default"].isString(e)?e:v(e)})})}),r}}if(e.options.fieldGroup)return void c();!p&&e.options.model&&e.$watch("options.model",function(){return e.options.runExpressions()},!0),y(),h();var C=g(e.options),T=arguments,F=this,_=0,W=b(e.options,e.formOptions);O(e.options).then(M(W.preWrapper)).then(E(e.options,e.formOptions)).then(M(W.postWrapper)).then(w).then($).then(A)["catch"](function(t){m("there-was-a-problem-setting-the-template-for-this-field","There was a problem setting the template for this field ",e.options,t)})}function v(e){var t=s["default"].element("<a></a>");return t.append(e).html()}function g(e){return e.type&&f.getType(e.type)}function b(e,t){function n(e){var t=e||{},n=t.preWrapper,i=void 0===n?[]:n,a=t.postWrapper,l=void 0===a?[]:a;o=o.concat(i),r=r.concat(l)}var o=[],r=[];return n(e.templateManipulators),n(t.templateManipulators),n(f.templateManipulators),{preWrapper:o,postWrapper:r}}function O(e){function t(t,n){return s["default"].isDefined(e[t])?e[t]:n&&s["default"].isDefined(n[t])?n[t]:void 0}var n=f.getType(e.type,!0,e),o=t("template",n),r=t("templateUrl",n);if(s["default"].isUndefined(o)&&!r)throw c.getFieldError("type-type-has-no-template","Type '"+e.type+"' has no template. On element:",e);return x(r||o,s["default"].isUndefined(o),e)}function x(n,r,i){var a=void 0;if(a=s["default"].isFunction(n)?t.when(n(i)):t.when(n),!r)return a;var l=function(){var t={cache:o};return{v:a.then(function(n){return e.get(n,t)}).then(function(e){return e.data})["catch"](function(e){m("problem-loading-template-for-templateurl","Problem loading template for "+n,e)})}}();return"object"==typeof l?l.v:void 0}function E(e,n){var o=$(e,n);return function(n){if(!o.length)return t.when(n);o.forEach(function(t){c.checkWrapper(t,e),M(t,e)});var r=o.map(function(e){return x(e.template||e.templateUrl,!e.template)});return t.all(r).then(function(e){e.forEach(function(e,t){c.checkWrapperTemplate(e,o[t])}),e.reverse();var t=e.shift();return e.forEach(function(e){t=w(t,e)}),w(t,n)})}}function w(e,t){var n=s["default"].element("<a></a>");n.append(e);var o=n.find("formly-transclude");return o.length||(o=d.findByNodeName(n,"formly-transclude")),o.replaceWith(t),n.html()}function $(e,t){var n=e.wrapper;if(null===n)return[];n=n?j(n).map(f.getWrapper):j(f.getWrapperByType(e.type));var o=f.getType(e.type,!0,e);if(o&&o.wrapper){var r=j(o.wrapper).map(f.getWrapper);n=n.concat(r)}if(t.wrapper){var i=j(t.wrapper).map(f.getWrapper);n=n.concat(i)}var a=f.getWrapper();return a&&n.push(a),n}function A(e){u["throw"](u.formlyFieldOptions,e,{prefix:"formly-field directive",url:"formly-field-directive-validation-failed"});var t=e.type&&f.getType(e.type);t&&M(t,e,!0),e.expressionProperties&&e.expressionProperties.hide&&m("dont-use-expressionproperties.hide-use-hideexpression-instead","You have specified `hide` in `expressionProperties`. Use `hideExpression` instead",e)}function k(e){u["throw"](u.fieldGroup,e,{prefix:"formly-field directive",url:"formly-field-directive-validation-failed"})}function M(e,t,n){var o=e.apiCheck,r=e.apiCheckInstance,i=e.apiCheckFunction,a=e.apiCheckOptions;C(o,r,i,a,t),n&&t.type&&s["default"].forEach(f.getTypeHeritage(t.type),function(e){C(e.apiCheck,e.apiCheckInstance,e.apiCheckFunction,e.apiCheckOptions,t)})}function C(e,t,n,o,r){if(e){var i=t||f.extras.apiCheckInstance||u;if(!i.config.disabled&&!p["default"].globalConfig.disabled){var a=n||"warn",l=e(i);s["default"].forEach(l,function(e,t){var n=i.shape(e),l=s["default"].extend({prefix:"formly-field type "+r.type+" for property "+t,url:u.config.output.docsBaseUrl+"formly-field-type-apicheck-failed"},o);i[a](n,r[t],l)})}}}var j=d.arrayify;return y.$inject=["$scope","$timeout","$parse","$controller","formlyValidationMessages"],{restrict:"AE",transclude:!0,require:"?^formlyForm",scope:{options:"=",model:"=",originalModel:"=?",formId:"@",index:"=?",fields:"=?",formState:"=?",formOptions:"=?",form:"=?"},controller:y,link:h}}function a(e){return l(e,"optionsTypes",[])}function l(e,t,n){return e.defaultOptions&&e.defaultOptions[t]||n}Object.defineProperty(t,"__esModule",{value:!0});var f=n(1),s=o(f),u=n(4),p=o(u);t["default"]=i,i.$inject=["$http","$q","$compile","$templateCache","$interpolate","formlyConfig","formlyApiCheck","formlyUtil","formlyUsability","formlyWarn"],e.exports=t["default"]},function(e,t){"use strict";function n(e,t){return{restrict:"A",link:function(n,o,r){var i=null,a=o[0],l=t[0];r.$observe("formlyFocus",function(t){"true"===t?e(function(){i=l.activeElement,a.focus()},~~r.focusWait):"false"===t&&l.activeElement===a&&(a.blur(),r.hasOwnProperty("refocus")&&i&&i.focus())})}}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n,n.$inject=["$timeout","$document"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t,n,o,i){function l(t,n){function r(){return n.rootEl||"ng-form"}function a(){return n.fieldRootEl||"div"}function l(){return n.hideDirective||o.extras.defaultHideDirective||"ng-if"}function s(){return n.trackBy?"track by "+n.trackBy:""}function u(){var t=v,o=n.bindName;if(o){if(f["default"].version.minor<3)throw e.getFormlyError("bind-name attribute on formly-form not allowed in < angular 1.3");t=i.startSymbol()+"::'formly_' + "+o+i.endSymbol()}return t}function d(){return n.transcludeClass||""}function m(e){var t=["model","form","fields","options","name","role","class","data-model","data-form","data-fields","data-options","data-name"],n=[];return f["default"].forEach(e,function(e){var o=e.nodeName,r=e.value;"undefined"!==o&&-1===t.indexOf(o)&&n.push(p(o)+'="'+r+'"')}),n.join(" ")}var y=r(),h=a(),v="formly_"+c++,g="";return n.hasOwnProperty("isFieldGroup")&&t.parent().parent().hasClass("formly")&&(g=m(t.parent().parent()[0].attributes)),"\n <"+y+' class="formly"\n name="'+u()+'"\n role="form" '+g+">\n <"+h+' formly-field\n ng-repeat="field in fields '+s()+'"\n '+l()+'="!field.hide"\n class="formly-field"\n options="field"\n model="field.model || model"\n original-model="model"\n fields="fields"\n form="theFormlyForm"\n form-id="'+u()+'"\n form-state="options.formState"\n form-options="options"\n index="$index">\n </'+h+'>\n <div ng-transclude class="'+d()+'"></div>\n </'+y+">\n "}function s(i,l,s){function u(){f["default"].forEach(i.fields,c)}function p(e,t){var n=e.$validate;t?t.then(n):n()}function c(e,t){var n=e.model||i.model,o=e.runExpressions&&e.runExpressions();if(e.hideExpression){var r=n[e.key];e.hide=C(e.hideExpression,r,e,t,{model:n})}e.extras&&e.extras.validateOnModelChange&&e.formControl&&(f["default"].isArray(e.formControl)?f["default"].forEach(e.formControl,function(e){p(e,o)}):p(e.formControl,o))}function m(){i.fields=i.fields||[],y(i.options);var t=i.options.fieldTransform||o.extras.fieldTransform;f["default"].isArray(t)||(t=[t]),f["default"].forEach(t,function(t){if(t&&(i.fields=t(i.fields,i.model,i.options,i.form),!i.fields))throw e.getFormlyError("fieldTransform must return an array of fields")}),b(),i.options.watchAllExpressions&&f["default"].forEach(i.fields,O),f["default"].forEach(i.fields,w),f["default"].forEach(i.fields,$)}function y(e){o.extras.fieldTransform&&f["default"].isFunction(o.extras.fieldTransform)?t("fieldtransform-as-a-function-deprecated","fieldTransform as a function has been deprecated.","Attempted for formlyConfig.extras: "+o.extras.fieldTransform.name,o.extras):e.fieldTransform&&f["default"].isFunction(e.fieldTransform)&&t("fieldtransform-as-a-function-deprecated","fieldTransform as a function has been deprecated.","Attempted for form",e)}function h(){l["throw"]([l.formOptionsApi.optional],[i.options],{prefix:"formly-form options check"}),i.options=i.options||{},i.options.formState=i.options.formState||{},f["default"].extend(i.options,{updateInitialValue:v,resetModel:g})}function v(){f["default"].forEach(i.fields,function(e){d(e)&&e.options?e.options.updateInitialValue():e.updateInitialValue()})}function g(){f["default"].forEach(i.fields,function(e){d(e)&&e.options?e.options.resetModel():e.resetModel&&e.resetModel()})}function b(){var e=[i.model],t=i.options.manualModelWatcher;i.options.formState&&e.push(i.options.formState),f["default"].forEach(i.fields,function(n){var o=x(n);n.model&&o&&-1===e.indexOf(n.model)&&!t&&(i.$watch(function(){return n.model},u,!0),e.push(n.model))})}function O(e,t){e.hideExpression&&!function(){var n=e.model||i.model;i.$watch(function(){var o=n[e.key];return C(e.hideExpression,o,e,t,{model:n})},function(t){return e.hide=t},!0)}()}function x(t){function n(n){var o=i.fields.indexOf(t),r=C(n,void 0,t,o,{model:i.model});if(!r)throw e.getFieldError("field-model-must-be-initialized","Field model must be initialized. When specifying a model as a string for a field, the result of the expression must have been initialized ahead of time.",t);return r}var o=!0;return f["default"].isString(t.model)&&!function(){var e=t.model;o=!E(e),t.model=n(e),i.$watch(function(){return n(e)},function(e){return t.model=e})}(),o}function E(e){return["model","formState"].some(function(t){return s.startsWith(e,t+".")||s.startsWith(e,t+"[")})}function w(e,t){d(e)||(e.key=e.key||t||0)}function $(t,n){if(f["default"].isDefined(t.watcher)){var o=t.watcher;f["default"].isArray(o)||(o=[o]),f["default"].forEach(o,function(o){if(!f["default"].isDefined(o.listener)&&!o.runFieldExpressions)throw e.getFieldError("all-field-watchers-must-have-a-listener","All field watchers must have a listener",t);var r=A(o,t,n),a=k(o,t,n),l=o.type||"$watch";o.stopWatching=i[l](r,a,o.watchDeep)})}}function A(e,t,o){var l=void 0;return f["default"].isUndefined(e.expression)?t.key&&(l="model['"+t.key.toString().split(".").join("']['")+"']"):l=e.expression,f["default"].isFunction(l)?!function(){var n=l;l=function(){var t=M.apply(void 0,[e,o].concat(a.call(arguments)));return n.apply(void 0,r(t))},l.displayName="Formly Watch Expression for field for "+t.key}():t.model&&(l=n(l).bind(null,i,{model:t.model})),l}function k(e,t,n){var o=e.listener;return(f["default"].isFunction(o)||e.runFieldExpressions)&&!function(){var i=o;o=function(){var o=void 0;if(i){var l=M.apply(void 0,[e,n].concat(a.call(arguments)));o=i.apply(void 0,r(l))}return e.runFieldExpressions&&c(t,n),o},o.displayName="Formly Watch Listener for field for "+t.key}(),o}function M(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;n>r;r++)o[r-2]=arguments[r];return[i.fields[t]].concat(o,[e.stopWatching])}function C(e,t,n,o){var r=arguments.length<=4||void 0===arguments[4]?{}:arguments[4];return r=f["default"].extend(j(n,o),r),s.formlyEval(i,e,t,t,r)}function j(e,t){return{model:e.model,options:e,index:t,formState:i.options.formState,originalModel:i.model,formOptions:i.options,formId:i.formId}}h(),i.model=i.model||{},m(),i.options.manualModelWatcher?f["default"].isFunction(i.options.manualModelWatcher)&&i.$watch(i.options.manualModelWatcher,u,!0):i.$watch("model",u,!0),i.options.formState&&i.$watch("options.formState",u,!0)}function u(e,r,i){function a(){var a=i.name;if(e.formId=a,e.theFormlyForm=e[a],i.form){var l=n(i.form),f=l.assign,s=l(e.$parent);s?(e.theFormlyForm=s,e[a]&&e.theFormlyForm.$removeControl(e[a]),r.removeData("$formController")):f(e.$parent,e[a])}e.theFormlyForm||o.disableWarnings||t("formly-form-has-no-formcontroller","Your formly-form does not have a `form` property. Many functions of the form (like validation) may not work",r,e)}function l(){var t=o.extras.removeChromeAutoComplete===!0,n=e.options&&e.options.removeChromeAutoComplete===!1,i=e.options&&e.options.removeChromeAutoComplete===!0;if(t&&!n||i){var a=document.createElement("input");a.setAttribute("autocomplete","address-level4"),a.setAttribute("hidden","true"),r[0].appendChild(a)}}a(),l()}function p(e){return e?e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):""}function d(e){return e&&!!e.fieldGroup}var c=1;return s.$inject=["$scope","formlyApiCheck","formlyUtil"],{restrict:"AE",template:l,replace:!0,transclude:!0,scope:{fields:"=",model:"=",form:"=?",options:"=?"},controller:s,link:u}}Object.defineProperty(t,"__esModule",{value:!0});var a=Array.prototype.slice,l=n(1),f=o(l);t["default"]=i,i.$inject=["formlyUsability","formlyWarn","$parse","formlyConfig","$interpolate"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=o(r),a=n(10),l=o(a),f=n(3),s=o(f),u=n(12),p=o(u),d=n(11),c=o(d),m=n(13),y=o(m),h=n(16),v=o(h),g=n(17),b=o(g),O=n(5),x=o(O),E=n(6),w=o(E),$=n(7),A=o($),k=n(8),M=o(k),C=n(15),j=o(C),T=n(14),F=o(T),_="formly";t["default"]=_;var W=i["default"].module(_,[]);W.constant("formlyApiCheck",l["default"]),W.constant("formlyErrorAndWarningsUrlPrefix",s["default"]),W.constant("formlyVersion","8.0.4"),W.provider("formlyUsability",p["default"]),W.provider("formlyConfig",c["default"]),W.factory("formlyValidationMessages",y["default"]),W.factory("formlyUtil",v["default"]),W.factory("formlyWarn",b["default"]),W.directive("formlyCustomValidation",x["default"]),W.directive("formlyField",w["default"]),W.directive("formlyFocus",A["default"]),W.directive("formlyForm",M["default"]),W.run(j["default"]),W.run(F["default"]),e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){function n(n,r,i,a){var l=a&&a.hasOwnProperty(r),f=e.some(function(e){return a&&a.hasOwnProperty(e)});return f||l?l?t(n,r,i,a):void 0:s.utils.getError(r,i,o)}a["default"].isArray(e)||(e=[e]);var o="specified if these are not specified: `"+e.join(", ")+"` (otherwise it's optional)";return n.type=o,s.utils.checkerHelpers.setupChecker(n)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i),l=n(4),f=o(l),s=f["default"]({output:{prefix:"angular-formly:",docsBaseUrl:n(3)}}),u=s.oneOfType([s.string,s.func]),p=s.typeOrArrayOf(s.string).nullable,d=s.func,c=s.shape.onlyIf("apiCheck",s.func.withProperties({warn:s.func,"throw":s.func,shape:s.func})),m=s.shape.onlyIf("apiCheck",s.oneOf(["throw","warn"])),y=s.shape({name:r("types",s.string).optional,template:s.shape.ifNot("templateUrl",s.string).optional,templateUrl:s.shape.ifNot("template",s.string).optional,types:s.typeOrArrayOf(s.string).optional,overwriteOk:s.bool.optional,apiCheck:d.optional,apiCheckInstance:c.optional,apiCheckFunction:m.optional,apiCheckOptions:s.object.optional}).strict,h=s.objectOf(s.oneOfType([u,s.shape({expression:u,message:u.optional}).strict])),v=s.oneOfType([s.string,s.object]),g=s.shape({preWrapper:s.arrayOf(s.func).nullable.optional,postWrapper:s.arrayOf(s.func).nullable.optional}).strict.nullable,b=s.objectOf(s.oneOfType([u,s.shape({expression:u,message:u.optional}).strict])),O=s.typeOrArrayOf(s.shape({expression:u.optional,listener:u.optional,runFieldExpressions:s.bool.optional})),x={$$hashKey:s.any.optional,type:s.shape.ifNot(["template","templateUrl"],s.string).optional,template:s.shape.ifNot(["type","templateUrl"],s.oneOfType([s.string,s.func])).optional,templateUrl:s.shape.ifNot(["type","template"],s.oneOfType([s.string,s.func])).optional,key:s.oneOfType([s.string,s.number]).optional,model:v.optional,originalModel:v.optional,className:s.string.optional,id:s.string.optional,name:s.string.optional,expressionProperties:h.optional,extras:s.shape({validateOnModelChange:s.bool.optional,skipNgModelAttrsManipulator:s.oneOfType([s.string,s.bool]).optional}).strict.optional,data:s.object.optional,templateOptions:s.object.optional,wrapper:p.optional,modelOptions:s.shape({updateOn:s.string.optional,debounce:s.oneOfType([s.objectOf(s.number),s.number]).optional,allowInvalid:s.bool.optional,getterSetter:s.bool.optional,timezone:s.string.optional}).optional,watcher:O.optional,validators:b.optional,asyncValidators:b.optional,parsers:s.arrayOf(u).optional,formatters:s.arrayOf(u).optional,noFormControl:s.bool.optional,hide:s.bool.optional,hideExpression:u.optional,ngModelElAttrs:s.objectOf(s.string).optional,ngModelAttrs:s.objectOf(s.shape({statement:s.shape.ifNot(["value","attribute","bound","boolean"],s.any).optional,value:s.shape.ifNot("statement",s.any).optional,attribute:s.shape.ifNot("statement",s.any).optional,bound:s.shape.ifNot("statement",s.any).optional,"boolean":s.shape.ifNot("statement",s.any).optional}).strict).optional,elementAttributes:s.objectOf(s.string).optional,optionsTypes:s.typeOrArrayOf(s.string).optional,link:s.func.optional,controller:s.oneOfType([s.string,s.func,s.array]).optional,validation:s.shape({show:s.bool.nullable.optional,messages:s.objectOf(u).optional,errorExistsAndShouldBeVisible:s.bool.optional}).optional,formControl:s.typeOrArrayOf(s.object).optional,value:s.func.optional,runExpressions:s.func.optional,templateManipulators:g.optional,resetModel:s.func.optional,updateInitialValue:s.func.optional,initialValue:s.any.optional,defaultValue:s.any.optional},E=s.shape(x).strict,w=s.shape({formState:s.object.optional,resetModel:s.func.optional,updateInitialValue:s.func.optional,removeChromeAutoComplete:s.bool.optional,templateManipulators:g.optional,manualModelWatcher:s.oneOfType([s.bool,s.func]).optional,watchAllExpressions:s.bool.optional,wrapper:p.optional,fieldTransform:s.oneOfType([s.func,s.array]).optional,data:s.object.optional}).strict,$=s.shape({$$hashKey:s.any.optional,key:s.oneOfType([s.string,s.number]).optional,fieldGroup:s.arrayOf(s.oneOfType([E,s.object])),className:s.string.optional,options:w.optional,templateOptions:s.object.optional,wrapper:p.optional,watcher:O.optional,hide:s.bool.optional,hideExpression:u.optional,data:s.object.optional,model:v.optional,form:s.object.optional,elementAttributes:s.objectOf(s.string).optional}).strict,A=a["default"].copy(x);A.key=s.string.optional;var k=s.shape({name:s.string,template:s.shape.ifNot("templateUrl",s.oneOfType([s.string,s.func])).optional,templateUrl:s.shape.ifNot("template",s.oneOfType([s.string,s.func])).optional,controller:s.oneOfType([s.func,s.string,s.array]).optional,link:s.func.optional,defaultOptions:s.oneOfType([s.func,s.shape(A)]).optional,"extends":s.string.optional,wrapper:p.optional,data:s.object.optional,apiCheck:d.optional,apiCheckInstance:c.optional,apiCheckFunction:m.optional,apiCheckOptions:s.object.optional,overwriteOk:s.bool.optional}).strict;a["default"].extend(s,{formlyTypeOptions:k,formlyFieldOptions:E,formlyExpression:u,formlyWrapperType:y,fieldGroup:$,formOptionsApi:w}),t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t,n){function o(e){if(!l["default"].isArray(e)){if(l["default"].isObject(e))return i(e),e["extends"]&&a(e),M[e.name]=e,M[e.name];throw F("You must provide an object or array for setType. You provided: "+JSON.stringify(arguments))}var t=function(){var t=[];return l["default"].forEach(e,function(e){t.push(o(e))}),{v:t}}();return"object"==typeof t?t.v:void 0}function i(e){n["throw"](n.formlyTypeOptions,e,{prefix:"formlyConfig.setType",url:"settype-validation-failed"}),e.overwriteOk?e.overwriteOk=void 0:O(e.name,M,e,"types")}function a(e){var t=c(e["extends"],!0,e);u(e,t),p(e,t),d(e,t),s["default"].reverseDeepMerge(e,t),f(e,t)}function f(e,t){e.template&&t.templateUrl?delete e.templateUrl:e.templateUrl&&t.template&&delete e.template}function u(e,t){var n=t.controller;if(l["default"].isDefined(n)){var o=e.controller;l["default"].isDefined(o)?(e.controller=function(e,t){t(n,{$scope:e}),t(o,{$scope:e})},e.controller.$inject=["$scope","$controller"]):e.controller=n}}function p(e,t){var n=t.link;if(l["default"].isDefined(n)){var o=e.link;l["default"].isDefined(o)?e.link=function(){n.apply(void 0,arguments),o.apply(void 0,arguments)}:e.link=n}}function d(e,t){var n=t.defaultOptions;if(l["default"].isDefined(n)){var o=e.defaultOptions,r=l["default"].isFunction(o),i=l["default"].isFunction(n);i?e.defaultOptions=function(e,t){var i=n(e,t),a={};s["default"].reverseDeepMerge(a,e,i);var l=o;return r&&(l=l(a,t)),s["default"].reverseDeepMerge(i,l),i}:r&&(e.defaultOptions=function(e,t){var r={};return s["default"].reverseDeepMerge(r,e,n),o(r,t)})}}function c(e,t,n){if(!e)return void 0;var o=M[e];if(o||t!==!0)return o;throw F('There is no type by the name of "'+e+'": '+JSON.stringify(n))}function m(e){var t=[],n=e;for(l["default"].isString(n)&&(n=c(e)),e=n["extends"];e;)n=c(e),t.push(n),e=n["extends"];return t}function y(e,t){for(var n=!0;n;){var o=e,r=t;if(n=!1,l["default"].isArray(o))return o.map(function(e){return y(e)});if(l["default"].isObject(o))return o.types=h(o),o.name=v(o,r),g(o),C[o.name]=o,
o;l["default"].isString(o)&&(e={template:o,name:r},t=void 0,n=!0)}}function h(e){return l["default"].isString(e.types)?[e.types]:l["default"].isDefined(e.types)?e.types:[]}function v(e,t){return e.name||t||e.types.join(" ")||j}function g(t){e.checkWrapper(t),t.template&&e.checkWrapperTemplate(t.template,t),t.overwriteOk?delete t.overwriteOk:O(t.name,C,t,"templateWrappers"),b(t)}function b(e){var t=!l["default"].isArray(e.types)||!e.types.every(l["default"].isString);if(t)throw F("Attempted to create a template wrapper with types that is not a string or an array of strings")}function O(e,t,n,o){t.hasOwnProperty(e)&&A("overwriting-types-or-wrappers",["Attempting to overwrite "+e+" on "+o+" which is currently",JSON.stringify(t[e])+" with "+JSON.stringify(n),'To supress this warning, specify the property "overwriteOk: true"'].join(" "))}function x(e){return C[e||j]}function E(e){var t=[];for(var n in C)C.hasOwnProperty(n)&&C[n].types&&-1!==C[n].types.indexOf(e)&&t.push(C[n]);return t}function w(e){var t=C[e];return delete C[e],t}function $(e){var t=E(e);return t?l["default"].isArray(t)?(t.forEach(function(e){return w(e.name)}),t):w(t.name):void 0}function A(){if(!T.disableWarnings&&console.warn){var e=Array.prototype.slice.call(arguments),n=e.shift();e.unshift("Formly Warning:"),e.push(""+t+n),console.warn.apply(console,r(e))}}var k=this,M={},C={},j="default",T=this,F=e.getFormlyError;l["default"].extend(this,{setType:o,getType:c,getTypeHeritage:m,setWrapper:y,getWrapper:x,getWrapperByType:E,removeWrapperByName:w,removeWrappersForType:$,disableWarnings:!1,extras:{disableNgModelAttrsManipulator:!1,fieldTransform:[],ngModelAttrsManipulatorPreferUnbound:!1,removeChromeAutoComplete:!1,defaultHideDirective:"ng-if",getFieldId:null},templateManipulators:{preWrapper:[],postWrapper:[]},$get:function(){return k}})}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),l=o(a),f=n(2),s=o(f);t["default"]=i,i.$inject=["formlyUsabilityProvider","formlyErrorAndWarningsUrlPrefix","formlyApiCheck"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){function n(e,t,n){return arguments.length<3&&(n=t,t=e,e=null),new Error(r(e,t)+(" Field definition: "+a["default"].toJson(n)))}function o(e,t){return t||(t=e,e=null),new Error(r(e,t))}function r(e,n){var o="";return null!==e&&(o=""+t+e),"Formly Error: "+n+". "+o}function i(t){e["throw"](e.formlyWrapperType,t,{prefix:"formlyConfig.setWrapper",urlSuffix:"setwrapper-validation-failed"})}function l(e,t){var n="<formly-transclude></formly-transclude>";if(-1===e.indexOf(n))throw o('Template wrapper templates must use "'+n+'" somewhere in them. This one does not have "<formly-transclude></formly-transclude>" in it: '+e+"\nAdditional information: "+JSON.stringify(t))}var f=this;a["default"].extend(this,{getFormlyError:o,getFieldError:n,checkWrapper:i,checkWrapperTemplate:l,getErrorMessage:r,$get:function(){return f}})}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i);t["default"]=r,r.$inject=["formlyApiCheck","formlyErrorAndWarningsUrlPrefix"],e.exports=t["default"]},function(e,t){"use strict";function n(){function e(e,t,r,i,a){o.messages[e]=n(t,r,i,a)}function t(e,t){o.messages[e]=function(){return t}}function n(e,t,n,o){return function(r,i,a){return"undefined"!=typeof a.options.templateOptions[e]?t+" "+a.options.templateOptions[e]+" "+n:o}}var o={addTemplateOptionValueMessage:e,addStringMessage:t,messages:{}};return o}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){e&&e.documentMode<9&&!function(){var t=e.get(0),n=["formly-field","formly-form"];a["default"].forEach(n,function(e){t.createElement(e)})}()}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i);t["default"]=r,r.$inject=["$document"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){function n(e,n,r){function i(){(a["default"].isDefined(n.validators)||a["default"].isDefined(n.validation.messages))&&u(g,"formly-custom-validation","")}function l(){d(n.key)&&p(g,"ng-model","model."+n.key)}function c(){a["default"].isDefined(n.modelOptions)&&(u(g,"ng-model-options","options.modelOptions"),n.modelOptions.getterSetter&&p(g,"ng-model","options.value"))}function m(){if(n.templateOptions||n.expressionProperties){var e=n.templateOptions||{},o=n.expressionProperties||{},r=f();a["default"].extend(r,n.ngModelAttrs),a["default"].forEach(r,function(r,i){var l=void 0,f=void 0,p="options.templateOptions['"+i+"']",d=e[i],c=s(o,i),m=a["default"].isDefined(d),y=a["default"].isDefined(c);if(r.value)f=r.value,l=i;else if(r.statement&&m)if(f=r.statement,a["default"].isString(e[i]))l="$eval("+p+")";else{if(!a["default"].isFunction(e[i]))throw new Error("options.templateOptions."+i+" must be a string or function: "+JSON.stringify(n));l=p+"(model[options.key], options, this, $event)"}else r.bound&&y?(f=r.bound,l=p):(r.attribute||r["boolean"])&&y?(f=r.attribute||r["boolean"],l=""+t.startSymbol()+p+t.endSymbol()):r.attribute&&m?(f=r.attribute,l=d):r["boolean"]?m&&!y&&d&&(f=r["boolean"],l=!0):r.bound&&m&&(f=r.bound,l=p);a["default"].isDefined(f)&&a["default"].isDefined(l)&&u(g,f,l)})}}function y(){a["default"].forEach(n.ngModelElAttrs,function(e,t){p(g,t,e)})}var h=document.createElement("div"),v=n.extras&&n.extras.skipNgModelAttrsManipulator;if(v===!0)return e;h.innerHTML=e;var g=o(h,v);return g&&g.length?(u(g,"id",r.id),u(g,"name",r.name||r.id),i(),l(),c(),m(),y(),h.innerHTML):e}function o(e,t){var n=a["default"].isString(t)?":not("+t+")":"",o=":not([formly-skip-ng-model-attrs-manipulator])",i="[ng-model]"+n+o+", [data-ng-model]"+n+o;try{return e.querySelectorAll(i)}catch(l){return r(e,t)}}function r(e,t){var n=e.querySelectorAll("[ng-model], [data-ng-model]"),o=[];o.item=function(e){return this[e]};for(var r=0;r<n.length;r++){var l=n[r];l.hasAttribute("formly-skip-ng-model-attrs-manipulator")||a["default"].isString(t)&&i(l,t)||o.push(l)}return o}function i(e,t){var n=document.createElement("div");return n.innerHTML=e.outerHTML,n.querySelector(t)}function f(){var t={focus:{attribute:"formly-focus"}},n=[],o=["required","disabled"],r=["pattern","minlength"],i=["change","keydown","keyup","keypress","click","focus","blur"],l=["placeholder","min","max","step","tabindex","type"];return e.extras.ngModelAttrsManipulatorPreferUnbound?r.push("maxlength"):n.push("maxlength"),a["default"].forEach(n,function(e){t[e]={bound:"ng-"+e}}),a["default"].forEach(o,function(e){t[e]={"boolean":e,bound:"ng-"+e}}),a["default"].forEach(r,function(e){t[e]={attribute:e,bound:"ng-"+e}}),a["default"].forEach(i,function(e){var n="on"+e.substr(0,1).toUpperCase()+e.substr(1);t[n]={statement:"ng-"+e}}),a["default"].forEach(l,function(e){t[e]={attribute:e}}),t}function s(e,t){return e["templateOptions."+t]||e["templateOptions['"+t+"']"]||e['templateOptions["'+t+'"]']}function u(e,t,n){a["default"].forEach(e,function(e){e.getAttribute(t)||e.setAttribute(t,n)})}function p(e,t,n){a["default"].forEach(e,function(e){e.setAttribute(t,n)})}function d(e){return l.contains(e,".")||l.contains(e,"[")&&l.contains(e,"]")}e.extras.disableNgModelAttrsManipulator||e.templateManipulators.preWrapper.push(n)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=o(i),l=n(2);t["default"]=r,r.$inject=["formlyConfig","$interpolate"],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(){return a["default"]}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=o(i);t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t,o){return function(){if(!e.disableWarnings){var r=Array.prototype.slice.call(arguments),i=r.shift();r.unshift("Formly Warning:"),r.push(""+t+i),o.warn.apply(o,n(r))}}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o,o.$inject=["formlyConfig","formlyErrorAndWarningsUrlPrefix","$log"],e.exports=t["default"]},function(e,n){e.exports=t}])});
//# sourceMappingURL=formly.min.js.map