/*!
 * TypeScript / Javascript AutoMapper Library v1.9.0
 * https://github.com/loedeman/AutoMapper
 *
 * Copyright 2015-2017 Interest IT / Bert Loedeman and other contributors
 * Released under the MIT license
 *
 * Date: 2017-11-21T17:00:00.000Z
 */
var AutoMapperJs;!function(t){"use strict";var e=function(){function e(){}return e.getClassName=function(t){if(t&&t.name)return t.name;if(t&&t.constructor){var e=t.toString();if(e){var r=e.match(/function\s*(\w+)/);if(r&&2===r.length)return r[1]}if(t.constructor.name)return t.constructor.name;if(t.constructor.toString()){var n=t.constructor.toString(),o=void 0;if((o="["===n.charAt(0)?n.match(/\[\w+\s*(\w+)\]/):n.match(/function\s*(\w+)/))&&2===o.length)return o[1]}}throw new Error("Unable to extract class name from type '"+t+"'")},e.getFunctionParameters=function(t){var e=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,r=/([^\s,]+)/g,n=t.replace(e,""),o=n.slice(n.indexOf("(")+1,n.indexOf(")")).match(r);return null===o&&(o=new Array),o},e.handleCurrying=function(t,e,r){function n(e,o,i){for(var a=o.slice(0),p=i,s=0;s<e.length;s++,i--)o[o.length]=e[s];if(i-e.length<=0){var u=t.apply(r,o);return o=a,i=p,u}return function(){return n(arguments,o.slice(0),i)}}var o=t.length-e.length;return n([],Array.prototype.slice.apply(e),o)},e.getMappingMetadataFromTransformationFunction=function(t,r,n){if("function"!=typeof r)return{destination:t,source:t,transformation:e.getDestinationTransformation(r,!1,n,!1),sourceMapping:n,condition:null,ignore:!1,async:!1};var o=r.toString(),i=e.getFunctionParameters(o),a=i.length>=1?i[0]:"",p=n?t:e.getMapFromString(o,t,a),s={destination:t,source:p,transformation:e.getDestinationTransformation(r,!0,n,2===i.length),sourceMapping:n,condition:null,ignore:e.getIgnoreFromString(o,t),async:2===i.length};return!s.async&&e.getFunctionCallIndex(o,"condition",a)>=0&&(s.condition=e.getConditionFromFunction(r,p)),s},e.getDestinationTransformation=function(e,r,n,o){if(!r)return{transformationType:t.DestinationTransformationType.Constant,constant:e};return n?o?{transformationType:t.DestinationTransformationType.AsyncSourceMemberOptions,asyncSourceMemberConfigurationOptionsFunc:e}:{transformationType:t.DestinationTransformationType.SourceMemberOptions,sourceMemberConfigurationOptionsFunc:e}:o?{transformationType:t.DestinationTransformationType.AsyncMemberOptions,asyncMemberConfigurationOptionsFunc:e}:{transformationType:t.DestinationTransformationType.MemberOptions,memberConfigurationOptionsFunc:e}},e.getIgnoreFromString=function(t,r){var n=e.getFunctionCallIndex(t,"ignore",r);if(n<0)return!1;var o=t.indexOf("(",n)+1,i=t.indexOf(")",o);if(o<0||i<0)return!1;var a=t.substring(o,i).replace(/\r/g,"").replace(/\n/g,"").trim();return null===a||""===a},e.getMapFromString=function(t,r,n){var o=e.getFunctionCallIndex(t,"mapFrom",n);if(o<0)return r;var i=t.indexOf("(",o)+1,a=t.indexOf(")",i);if(i<0||a<0)return r;var p=t.substring(i,a).replace(/'/g,"").replace(/"/g,"").trim();return null===p||""===p?r:p},e.getFunctionCallIndex=function(t,e,r){var n=t.indexOf(r+"."+e);return n<0&&(n=t.indexOf("."+e)),n},e.getConditionFromFunction=function(t,e){var r={};r[e]={};var n,o={ignore:function(){},condition:function(t){n=t},mapFrom:function(t){},sourceObject:r,sourcePropertyName:e,intermediatePropertyValue:{}};try{t(o)}catch(t){}return n},e}();t.AutoMapperHelper=e}(AutoMapperJs||(AutoMapperJs={}));var AutoMapperJs;!function(t){"use strict";var e=function(){function e(){}return e.assertConfigurationIsValid=function(t,r){for(var n in t)t.hasOwnProperty(n)&&e.assertMappingConfiguration(t[n],r)},e.assertMappingConfiguration=function(r,n){var o=r.sourceKey+"=>"+r.destinationKey,i=r.sourceTypeClass,a=r.destinationTypeClass,p=i?t.AutoMapperHelper.getClassName(i):void 0,s=a?t.AutoMapperHelper.getClassName(a):void 0;if(!i||!a){if(!1===n)return;throw new Error("Mapping '"+o+"' cannot be validated, since mapping.sourceType or mapping.destinationType are unspecified.")}for(var u=function(t){if(t)throw new Error("Mapping '"+o+"' is invalid: "+t+" (source: '"+p+"', destination: '"+s+"').")},c=new Array,f=new i,l=new a,y=0,m=r.properties;y<m.length;y++){var h=m[y];u(e.validatePropertyMapping(h,h.name,f,l)),c.push(h.name)}for(var g in f)f.hasOwnProperty(g)&&(c.indexOf(g)>=0||(u(e.validateProperty(g,l)),c.push(g)));for(var d in l)l.hasOwnProperty(d)&&(c.indexOf(d)>=0||u("Destination member '"+d+"' does not exist on source type"))},e.validatePropertyMapping=function(t,r,n,o){var i=e.getDestinationProperty(t.destinationPropertyName,t);return i.sourceMapping?e.validateSourcePropertyMapping(t,i,r,n,o):e.validateDestinationPropertyMapping(t,i,r,n,o)},e.validateSourcePropertyMapping=function(t,e,r,n,o){if(!n.hasOwnProperty(r))return"Source member '"+r+"' is configured, but does not exist on source type";{if(!e.ignore)return o.hasOwnProperty(r)?void 0:"Source member '"+r+"' is configured to be mapped, but does not exist on destination type";if(o.hasOwnProperty(r))return"Source member '"+r+"' is ignored, but does exist on destination type"}},e.validateDestinationPropertyMapping=function(t,e,r,n,o){if(!o.hasOwnProperty(e.name))return"Destination member '"+e.destinationPropertyName+"' is configured, but does not exist on destination type";{if(!e.ignore)return n.hasOwnProperty(r)?void 0:"Destination member '"+r+"' is configured to be mapped, but does not exist on source type";if(n.hasOwnProperty(r))return"Destination member '"+r+"' is ignored, but does exist on source type"}},e.validateProperty=function(t,e){if(!e.hasOwnProperty(t))return"Source member '"+t+"' is configured to be mapped, but does not exist on destination type"},e.getDestinationProperty=function(t,e){if(e.destination)return e.destination;if(e.children)for(var r=0,n=e.children;r<n.length;r++){var o=n[r],i=this.getDestinationProperty(t,o);if(i)return i}return null},e}();t.AutoMapperValidator=e}(AutoMapperJs||(AutoMapperJs={}));var AutoMapperJs;!function(t){"use strict";!function(t){t[t.Constant=1]="Constant",t[t.MemberOptions=2]="MemberOptions",t[t.AsyncMemberOptions=4]="AsyncMemberOptions",t[t.SourceMemberOptions=8]="SourceMemberOptions",t[t.AsyncSourceMemberOptions=16]="AsyncSourceMemberOptions"}(t.DestinationTransformationType||(t.DestinationTransformationType={}))}(AutoMapperJs||(AutoMapperJs={}));var AutoMapperJs;!function(t){"use strict";var e=function(){function e(){}return e.prototype.getMapping=function(t,e,r){var n=this.getKey(e),o=this.getKey(r),i=t[n+o];if(!i)throw new Error("Could not find map object with a source of "+n+" and a destination of "+o);return i},e.prototype.getKey=function(e){return"string"==typeof e?e:t.AutoMapperHelper.getClassName(e)},e.prototype.isArray=function(t){return t instanceof Array},e.prototype.handleArray=function(t,e,r){for(var n=e.length,o=new Array(e.length),i=0;i<n;i++){var a=e[i],p=void 0;null===a||void 0===a?p=a:r(a,p=this.createDestinationObject(t.destinationTypeClass)),o[i]=p}return o},e.prototype.handleItem=function(t,e,r,n){for(var o=!1,i=0,a=t.properties;i<a.length;i++)o=!0,n(a[i].name);for(var p in e)e.hasOwnProperty(p)&&(o=!0,n(p));return o||null!==e&&void 0!==e?r:e},e.prototype.handleProperty=function(t,e,r,n,o,i){var a=this.getPropertyMappings(t.properties,r);if(a.length>0)for(var p=0,s=a;p<s.length;p++){var u=s[p];this.processMappedProperty(t,u,e,r,o)}else this.handlePropertyWithAutoMapping(t,e,r,n,i)},e.prototype.setPropertyValue=function(t,e,r,n){if(t.forAllMemberMappings.length>0)for(var o=0,i=t.forAllMemberMappings;o<i.length;o++)(0,i[o])(r,e.name,n);else r[e.name]=n},e.prototype.setPropertyValueByName=function(t,e,r,n){if(t.forAllMemberMappings.length>0)for(var o=0,i=t.forAllMemberMappings;o<i.length;o++)(0,i[o])(e,r,n);else e[r]=n},e.prototype.createDestinationObject=function(t){return t?new t:{}},e.prototype.shouldProcessDestination=function(t,e){return!t.ignore&&(!t.conditionFunction||!1!==t.conditionFunction(e))},e.prototype.handlePropertyWithAutoMapping=function(t,e,r,n,o){if(!(t.ignoreAllNonExisting||t.destinationTypeClass&&Object.keys(n).indexOf(r)<0)){var i=null,a=!1;"object"==typeof n[r]&&n[r]&&(a="Object"!==n[r].constructor.name)&&(this.createMap(e[r].constructor.name,n[r].constructor.name).convertToType(n[r].constructor),i=this.map(e[r].constructor.name,n[r].constructor.name,e[r]));var p=this.getDestinationPropertyName(t.profile,r),s=this.getDestinationPropertyValue(e,r,i,a);this.setPropertyValueByName(t,n,p,s),o&&o(s)}},e.prototype.getDestinationPropertyValue=function(t,e,r,n){return n?r:t?t[e]:null},e.prototype.getDestinationPropertyName=function(t,e){if(!t)return e;try{for(var r=e.split(t.sourceMemberNamingConvention.splittingExpression),n=r.length-1;n>=0;n--)""===r[n]&&r.splice(n,1);return t.destinationMemberNamingConvention.transformPropertyName(r)}catch(t){return e}},e.prototype.getPropertyMappings=function(t,e){for(var r=[],n=0,o=t;n<o.length;n++){var i=o[n];i.name===e&&r.push(i)}return r},e.prototype.processMappedProperty=function(t,e,r,n,o){if(e.children&&e.children.length>0)for(var i=r?r[e.name]:null,a=0,p=e.children;a<p.length;a++){var s=p[a];return void this.processMappedProperty(t,s,i,s.name,o)}o(e.destination,this.createMemberConfigurationOptions(r,n))},e.prototype.createMemberConfigurationOptions=function(t,e){return{mapFrom:function(t){},condition:function(t){},ignore:function(){},sourceObject:t,sourcePropertyName:e,intermediatePropertyValue:t?t[e]:t}},e}();t.AutoMapperBase=e}(AutoMapperJs||(AutoMapperJs={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),AutoMapperJs;!function(t){"use strict";var e=function(e){function r(){var t=e.call(this)||this;return r.asyncInstance=t,t}return __extends(r,e),r.prototype.createMap=function(t,e){throw new Error("Method AsyncAutoMapper.createMap is not implemented.")},r.prototype.createMapForMember=function(t,e){var r=this;t.async=!0,t.mapItemFunction=function(t,e,n,o){return r.mapItem(t,e,n,o)}},r.prototype.createMapConvertUsing=function(t,e){var r=this;t.async=!0,t.typeConverterFunction=e,t.mapItemFunction=function(t,e,n,o){return r.mapItemUsingTypeConverter(t,e,n,o)}},r.prototype.map=function(t,r,n,o,i){var a=this;switch(arguments.length){case 5:return void this.mapWithMapping(e.prototype.getMapping.call(this,t,r,n),o,i);case 4:return function(i){return a.mapWithMapping(e.prototype.getMapping.call(a,t,r,n),o,i)};case 3:return function(o,i){return a.mapWithMapping(e.prototype.getMapping.call(a,t,r,n),o,i)};case 2:return function(e,n,o){return a.map(t,r,e,n,o)};default:throw new Error("The AsyncAutoMapper.map function expects between 2 and 5 parameters, you provided "+arguments.length+".")}},r.prototype.mapWithMapping=function(t,r,n){if(!e.prototype.isArray.call(this,r))return t.mapItemFunction(t,r,e.prototype.createDestinationObject.call(this,t.destinationTypeClass),n);this.mapArray(t,r,n)},r.prototype.mapArray=function(t,r,n){var o=0,i=e.prototype.handleArray.call(this,t,r,function(e,r){o++,t.mapItemFunction(t,e,r,function(t){o--})}),a=function(){0===o?n(i):setTimeout(function(){a()},10*o)};a()},r.prototype.mapItemUsingTypeConverter=function(t,e,r,n){var o={sourceValue:e,destinationValue:r};t.typeConverterFunction(o,n)},r.prototype.mapItem=function(t,r,n,o){var i=this,a=0;e.prototype.handleItem.call(this,t,r,n,function(e){a++,i.mapProperty(t,r,e,n,function(t){a--})});var p=function(){0===a?o(n):setTimeout(function(){p()},10*a)};p()},r.prototype.mapProperty=function(t,r,n,o,i){var a=this;e.prototype.handleProperty.call(this,t,r,n,o,function(e,n){a.transform(t,r,e,o,n,function(t,e){i(t)})},function(t){i(t)})},r.prototype.transform=function(t,r,n,o,i,a){var p=this,s=n.child;if(s){var u=o[n.name];return u||(u={}),void this.transform(t,r,s,u,i,function(t,e){e&&(o[n.name]=u),a(i.intermediatePropertyValue,e)})}e.prototype.shouldProcessDestination.call(this,n,r)?this.processTransformations(n,n.transformations,i,function(r,s){s&&e.prototype.setPropertyValue.call(p,t,n,o,i.intermediatePropertyValue),a(i.intermediatePropertyValue,s)}):a(void 0,!1)},r.prototype.processTransformations=function(t,e,r,n){var o=this;if(0!==e.length){var i=e[0];this.processTransformation(t,i,r,function(i,a){a?o.processTransformations(t,e.slice(1),r,n):n(r.intermediatePropertyValue,!1)})}else n(r.intermediatePropertyValue,!0)},r.prototype.processTransformation=function(e,r,n,o){switch(r.transformationType){case t.DestinationTransformationType.Constant:return n.intermediatePropertyValue=r.constant,void o(n.intermediatePropertyValue,!0);case t.DestinationTransformationType.MemberOptions:if(void 0!==(i=r.memberConfigurationOptionsFunc(n)))n.intermediatePropertyValue=i;else if(!n.sourceObject)return void o(n.intermediatePropertyValue,!1);return void o(n.intermediatePropertyValue,!0);case t.DestinationTransformationType.SourceMemberOptions:var i=r.sourceMemberConfigurationOptionsFunc(n);if(void 0!==i)n.intermediatePropertyValue=i;else if(!n.sourceObject)return void o(n.intermediatePropertyValue,!1);return void o(n.intermediatePropertyValue,!0);case t.DestinationTransformationType.AsyncMemberOptions:return void r.asyncMemberConfigurationOptionsFunc(n,function(t){void 0!==t&&(n.intermediatePropertyValue=t),o(n.intermediatePropertyValue,!0)});case t.DestinationTransformationType.AsyncSourceMemberOptions:return void r.asyncSourceMemberConfigurationOptionsFunc(n,function(t){void 0!==t&&(n.intermediatePropertyValue=t),o(n.intermediatePropertyValue,!0)});default:return void o(n.intermediatePropertyValue,!1)}},r}(t.AutoMapperBase);e.asyncInstance=new e,t.AsyncAutoMapper=e}(AutoMapperJs||(AutoMapperJs={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),AutoMapperJs;!function(t){"use strict";var e=function(e){function r(){var n=e.call(this)||this;return r._instance?r._instance:(r._instance=n,n._profiles={},n._mappings={},n._asyncMapper=new t.AsyncAutoMapper,n)}return __extends(r,e),r.getInstance=function(){return r._instance},r.prototype.initialize=function(t){var e=this;t({addProfile:function(t){t.configure(),e._profiles[t.profileName]=t},createMap:function(t,r){return e.createMap.apply(e,arguments)}})},r.prototype.createMap=function(e,r){if(arguments.length<2)return t.AutoMapperHelper.handleCurrying(this.createMap,arguments,this);var n=this.createMappingObjectForGivenKeys(e,r);return this.createMapGetFluentApiFunctions(n)},r.prototype.map=function(t,r,n){var o=this;return 3===arguments.length?this.mapInternal(e.prototype.getMapping.call(this,this._mappings,t,r),n):2===arguments.length?function(n){return o.mapInternal(e.prototype.getMapping.call(o,o._mappings,t,r),n)}:1===arguments.length?function(e,r){return o.map(t,e,r)}:function(t,e,r){return o.map(t,e,r)}},r.prototype.mapAsync=function(t,e,r,n){switch(arguments.length){case 4:return this._asyncMapper.map(this._mappings,t,e,r,n);case 3:return this._asyncMapper.map(this._mappings,t,e,r);case 2:return this._asyncMapper.map(this._mappings,t,e);case 1:return this._asyncMapper.map(this._mappings,t);default:throw new Error("The mapAsync function expects between 1 and 4 parameters, you provided "+arguments.length+".")}},r.prototype.assertConfigurationIsValid=function(e){void 0===e&&(e=!0),t.AutoMapperValidator.assertConfigurationIsValid(this._mappings,e)},r.prototype.createMapForAllMembers=function(t,e,r){return t.forAllMemberMappings.push(r),e},r.prototype.createMapIgnoreAllNonExisting=function(t,e){return t.ignoreAllNonExisting=!0,e},r.prototype.createMapConvertToType=function(t,e,r){if(t.destinationTypeClass)throw new Error("Destination type class can only be set once.");return t.destinationTypeClass=r,e},r.prototype.createMapConvertUsing=function(e,r){var n=this,o=function(r){if(!r||1!==t.AutoMapperHelper.getFunctionParameters(r.toString()).length)throw new Error("The function provided does not provide exactly one (resolutionContext) parameter.");e.typeConverterFunction=r,e.mapItemFunction=function(t,e,r){return n.mapItemUsingTypeConverter(t,e,r)}};try{if(r instanceof t.TypeConverter)return void o(r.convert);switch(t.AutoMapperHelper.getFunctionParameters(r.toString()).length){case 0:var i;try{i=new r}catch(t){}if(i instanceof t.TypeConverter)return void o(i.convert);break;case 1:return void o(r);case 2:return void this._asyncMapper.createMapConvertUsing(e,r)}o(r)}catch(t){throw new Error("The value provided for typeConverterClassOrFunction is invalid. "+t)}},r.prototype.createMapWithProfile=function(t,e){var r=this._profiles[e];if(void 0===r||r.profileName!==e)throw new Error("Could not find profile with profile name '"+e+"'.");t.profile=r,this.createMapWithProfileMergeMappings(t,e)},r.prototype.createMapWithProfileMergeMappings=function(t,e){var r=e+"=>"+t.sourceKey+e+"=>"+t.destinationKey,n=this._mappings[r];if(n){n.forAllMemberMappings.length>0&&(s=t.forAllMemberMappings).push.apply(s,n.forAllMemberMappings),n.typeConverterFunction&&(t.typeConverterFunction=n.typeConverterFunction,t.mapItemFunction=n.mapItemFunction),n.destinationTypeClass&&(t.destinationTypeClass=n.destinationTypeClass);for(var o=0,i=n.properties;o<i.length;o++){var a=i[o],p=this.getDestinationProperty(a.destinationPropertyName,a).sourceMapping;this.mergeSourceProperty(a,t.properties,p)||t.properties.push(a)}var s}},r.prototype.mapInternal=function(t,r){if(null===r||void 0===r)return r;if(t.async)throw new Error("Impossible to use asynchronous mapping using automapper.map(); use automapper.mapAsync() instead.");return e.prototype.isArray.call(this,r)?this.mapArray(t,r):t.mapItemFunction(t,r,e.prototype.createDestinationObject.call(this,t.destinationTypeClass))},r.prototype.mapArray=function(t,r){return e.prototype.handleArray.call(this,t,r,function(e,r){t.mapItemFunction(t,e,r)})},r.prototype.mapItem=function(t,r,n){var o=this;return n=e.prototype.handleItem.call(this,t,r,n,function(e){o.mapProperty(t,r,n,e)})},r.prototype.mapItemUsingTypeConverter=function(t,e,r,n){var o={sourceValue:e,destinationValue:r};return t.typeConverterFunction(o)},r.prototype.mapProperty=function(t,r,n,o){var i=this;e.prototype.handleProperty.call(this,t,r,o,n,function(e,o){return i.transform(t,r,e,n,o)})},r.prototype.transform=function(t,r,n,o,i){var a=n.child;if(a){var p=o[n.name];p||(p={});var s=this.transform(t,r,a,p,i);return s&&(o[n.name]=p),s}if(!e.prototype.shouldProcessDestination.call(this,n,r))return!1;for(var u=0,c=n.transformations;u<c.length;u++){var f=c[u];if(!this.processTransformation(n,f,i))return!1}return e.prototype.setPropertyValue.call(this,t,n,o,i.intermediatePropertyValue),!0},r.prototype.processTransformation=function(e,r,n){switch(r.transformationType){case t.DestinationTransformationType.Constant:return n.intermediatePropertyValue=r.constant,!0;case t.DestinationTransformationType.MemberOptions:if(void 0!==(o=r.memberConfigurationOptionsFunc(n)))n.intermediatePropertyValue=o;else if(!n.sourceObject)return!1;return!0;case t.DestinationTransformationType.SourceMemberOptions:var o=r.sourceMemberConfigurationOptionsFunc(n);if(void 0!==o)n.intermediatePropertyValue=o;else if(!n.sourceObject)return!1;return!0;default:return!1}},r.prototype.createMappingObjectForGivenKeys=function(t,r){var n=this,o={sourceKey:e.prototype.getKey.call(this,t),destinationKey:e.prototype.getKey.call(this,r),forAllMemberMappings:new Array,properties:[],typeConverterFunction:void 0,mapItemFunction:function(t,e,r){return n.mapItem(t,e,r)},sourceTypeClass:"string"==typeof t?void 0:t,destinationTypeClass:"string"==typeof r?void 0:r,profile:void 0,async:!1};return this._mappings[o.sourceKey+o.destinationKey]=o,o},r.prototype.createMapGetFluentApiFunctions=function(t){var e=this,r={forMember:function(n,o){return e.createMapForMember({mapping:t,propertyName:n,transformation:o,sourceMapping:!1,fluentFunctions:r})},forSourceMember:function(n,o){return e.createMapForMember({mapping:t,propertyName:n,transformation:o,sourceMapping:!0,fluentFunctions:r})},forAllMembers:function(n){return e.createMapForAllMembers(t,r,n)},ignoreAllNonExisting:function(){return e.createMapIgnoreAllNonExisting(t,r)},convertToType:function(n){return e.createMapConvertToType(t,r,n)},convertUsing:function(r){return e.createMapConvertUsing(t,r)},withProfile:function(r){return e.createMapWithProfile(t,r)}};return r},r.prototype.createMapForMember=function(e){var r=e.mapping,n=e.propertyName,o=e.transformation,i=e.sourceMapping,a=e.fluentFunctions,p=t.AutoMapperHelper.getMappingMetadataFromTransformationFunction(n,o,i);this.validateForMemberParameters(p);p.source,p.destination;var s=this.createSourceProperty(p,null);return this.mergeSourceProperty(s,r.properties,i)||r.properties.push(s),p.async&&this._asyncMapper.createMapForMember(r,this.findProperty(s.name,r.properties)),a},r.prototype.validateForMemberParameters=function(e){if(e.sourceMapping&&e.transformation.transformationType===t.DestinationTransformationType.Constant)throw new Error("Configuration of forSourceMember has to be a function with one (sync) or two (async) options parameters.")},r.prototype.createSourceProperty=function(t,e){var r=e?e.level+1:0,n=t.source.split("."),o={name:n[r],sourcePropertyName:t.source,destinationPropertyName:t.destination,parent:e,level:r,children:[],destination:null};if(r+1<n.length){var i=this.createSourceProperty(t,o);i&&o.children.push(i),o.destination=null}else o.destination=this.createDestinationProperty(t,null);return o},r.prototype.createDestinationProperty=function(t,e){var r=e?e.level+1:0,n=t.destination.split("."),o={name:n[r],sourcePropertyName:t.source,destinationPropertyName:t.destination,parent:e,level:r,child:null,transformations:[],conditionFunction:null,ignore:!1,sourceMapping:!1};return r+1<n.length?o.child=this.createDestinationProperty(t,o):(o.sourceMapping=t.sourceMapping,o.conditionFunction=t.condition,o.ignore=t.ignore,o.transformations.push(t.transformation)),o},r.prototype.mergeSourceProperty=function(t,e,r){var n=r?this.findProperty(t.name,e):this.matchSourcePropertyByDestination(t,e);if(!n)return!1;if(t.destination){if(n.children.length>0){var o=this.getDestinationProperty(n.destinationPropertyName,n);return this.handleMapFromProperties(t,n)?!!this.mergeDestinationProperty(t.destination,o)&&(n.destination=o,n.children=[],!0):this.mergeDestinationProperty(t.destination,o)}return!!this.mergeDestinationProperty(t.destination,n.destination)&&(this.handleMapFromProperties(t,n),!0)}if(n.children.length>0){for(var i=0,a=t.children;i<a.length;i++){var p=a[i];if(!this.mergeSourceProperty(p,n.children,r))return!1}return t.destinationPropertyName!==t.sourcePropertyName&&(n.name=t.name,n.sourcePropertyName=t.sourcePropertyName),!0}var s=this.getDestinationProperty(n.destinationPropertyName,t);return t.destinationPropertyName!==t.sourcePropertyName?!!this.mergeDestinationProperty(n.destination,s,!0)&&(n.children=t.children,n.name=t.name,n.sourcePropertyName=t.sourcePropertyName,n.destination=null,!0):this.mergeDestinationProperty(s,n.destination)},r.prototype.handleMapFromProperties=function(t,e){return t.destinationPropertyName!==t.sourcePropertyName&&t.sourcePropertyName!==e.sourcePropertyName&&(e.name=t.name,e.sourcePropertyName=t.sourcePropertyName,!0)},r.prototype.getDestinationProperty=function(t,e){if(e.destination)return e.destination;for(var r=0,n=e.children;r<n.length;r++){var o=n[r],i=this.getDestinationProperty(t,o);if(i)return i}return null},r.prototype.mergeDestinationProperty=function(t,e,r){if(void 0===r&&(r=!1),t.child)return!!e.child&&(!!this.mergeDestinationProperty(t.child,e.child,r)&&(this.handleMapFromProperties(t,e),!0));if(e.sourceMapping!==t.sourceMapping&&e.sourcePropertyName!==t.sourcePropertyName)return!1;t.sourceMapping&&(e.sourceMapping=t.sourceMapping),t.ignore&&(e.ignore=t.ignore),t.conditionFunction&&(e.conditionFunction=t.conditionFunction);var n=[];if(r){for(var o=0,i=t.transformations;o<i.length;o++){l=i[o];n.push(l)}for(var a=0,p=e.transformations;a<p.length;a++){l=p[a];n.push(l)}}else{for(var s=0,u=e.transformations;s<u.length;s++){l=u[s];n.push(l)}for(var c=0,f=t.transformations;c<f.length;c++){var l=f[c];n.push(l)}}return e.transformations=n,this.handleMapFromProperties(t,e),!0},r.prototype.matchSourcePropertyByDestination=function(t,e){if(!e)return null;for(var r=0,n=e;r<n.length;r++){var o=n[r];if(o.destinationPropertyName===t.destinationPropertyName)return o}return null},r.prototype.findProperty=function(t,e){if(!e)return null;for(var r=0,n=e;r<n.length;r++){var o=n[r];if(o.name===t)return o}return null},r}(t.AutoMapperBase);e._instance=new e,t.AutoMapper=e}(AutoMapperJs||(AutoMapperJs={}));var automapper=function(t){return t.automapper=AutoMapperJs.AutoMapper.getInstance(),t.automapper}(this),AutoMapperJs;!function(t){"use strict";var e=function(){function t(){}return t.prototype.configure=function(){},t.prototype.createMap=function(t,e){for(var r=Array.prototype.slice.apply(arguments),n=0,o=r.length;n<o;n++)r[n]&&(r[n]=this.profileName+"=>"+r[n]);return automapper.createMap.apply(automapper,r)},t}();t.Profile=e}(AutoMapperJs||(AutoMapperJs={}));var AutoMapperJs;!function(t){"use strict";var e=function(){function t(){}return t.prototype.convert=function(t){throw new Error("The TypeConverter.convert method is abstract. Use a TypeConverter extension class instead.")},t}();t.TypeConverter=e}(AutoMapperJs||(AutoMapperJs={}));var AutoMapperJs;!function(t){"use strict";var e=function(){function t(){this.splittingExpression=/(^[a-z]+(?=$|[A-Z]{1}[a-z0-9]+)|[A-Z]?[a-z0-9]+)/,this.separatorCharacter=""}return t.prototype.transformPropertyName=function(t){for(var e="",r=0,n=t.length;r<n;r++)e+=0===r?t[r].charAt(0).toLowerCase()+t[r].substr(1):t[r].charAt(0).toUpperCase()+t[r].substr(1);return e},t}();t.CamelCaseNamingConvention=e}(AutoMapperJs||(AutoMapperJs={}));var AutoMapperJs;!function(t){"use strict";var e=function(){function t(){this.splittingExpression=/(^[A-Z]+(?=$|[A-Z]{1}[a-z0-9]+)|[A-Z]?[a-z0-9]+)/,this.separatorCharacter=""}return t.prototype.transformPropertyName=function(t){for(var e="",r=0,n=t.length;r<n;r++)e+=t[r].charAt(0).toUpperCase()+t[r].substr(1);return e},t}();t.PascalCaseNamingConvention=e}(AutoMapperJs||(AutoMapperJs={}));
//# sourceMappingURL=automapper.min.js.map
