text: /*!
   * Usine Data API client.
   * Copyright © 2015-2017 Hyperboloide. All rights reserved.
   */
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require(void 0)):"function"==typeof define&&define.amd?define(["lodash"],e):"object"==typeof exports?exports.udapi=e(require("lodash")):t.udapi=e(t._)}(this,function(t){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=26)}([function(e,r){e.exports=t},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(27))},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(1),a=function(t){function e(e){var r=t.call(this)||this;return r.name="",r.help="",r.mandatory=!1,r.id=e,r}return i(e,t),e.prototype.serialize=function(){var e=n({},t.prototype.serialize.call(this),{name:this.name,type:this.type(),mandatory:this.mandatory});return o.isEmpty(this.help)||(e.help=this.help),e},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),o.isEmpty(e)?this:(this.name=e.name,o.isEmpty(e.help)||(this.help=e.help),o.isBoolean(e.mandatory)&&(this.mandatory=e.mandatory),this)},e}(s.ValidableObject);e.Field=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),n=function(){function t(){this.items=new Array}return t.prototype.index=function(t){return this.items.findIndex(function(e){return e==t.id})},t.prototype.has=function(t){return-1!=this.index(t)},t.prototype.add=function(t){this.has(t)||this.items.push(t.id)},t.prototype.canMoveDown=function(t){return this.has(t)&&t.id!=i.last(this.items)},t.prototype.canMoveUp=function(t){return this.has(t)&&t.id!=i.head(this.items)},t.prototype.moveUp=function(t){if(this.canMoveUp(t)){var e=this.index(t),r=this.items[e];this.items[e]=this.items[e-1],this.items[e-1]=r}},t.prototype.moveDown=function(t){if(this.canMoveDown(t)){var e=this.index(t),r=this.items[e];this.items[e]=this.items[e+1],this.items[e+1]=r}},t.prototype.remove=function(t){var e=this.index(t);this.items.splice(e,1)},t.prototype.serialize=function(){return this.items},t.prototype.deserialize=function(t){var e=this;return this.items=new Array,i.each(t,function(t){return e.items.push(i.toSafeInteger(t))}),this},t}();e.Display=n},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(0),a=r(2),l=r(3),u=r(1),p=function(t){function e(e){var r=t.call(this)||this;return r.id=e,r}return i(e,t),e.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{id:this.id,label:this.label})},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),this.label=e.label,this},e}(u.ValidableObject);e.ChoiceValue=p;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.values=new Map,e.display=new l.Display,e}return i(e,t),e.prototype.isEmpty=function(){return 0==this.values.size},e.prototype.getValue=function(t){return this.values.get(t)},e.prototype.createValue=function(t,e){void 0===e&&(e="");var r=new p(t);return r.label=e,this.values.set(t,r),this.display.add(r),r},e.prototype.valueIndex=function(t){return this.display.index(t)},e.prototype.removeValue=function(t){this.values.delete(t.id),this.display.remove(t)},e.prototype.serialize=function(){var e=this;return n({},t.prototype.serialize.call(this),{values:s.map(this.display.items,function(t){return e.getValue(t).serialize()})})},e.prototype.deserialize=function(e){t.prototype.deserialize.call(this,e),this.values=new Map,this.display=new l.Display;try{for(var r=o(e.values),i=r.next();!i.done;i=r.next()){var n=i.value,a=s.toSafeInteger(n.id),u=new p(a).deserialize(n);this.values.set(a,u),this.display.add(u)}}catch(t){c={error:t}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(c)throw c.error}}return this;var c,f},e}(a.Field);e.ChoiceField=c},function(t,e,r){"use strict";function i(t,e){switch(e){case a.BooleanType:return new a.Boolean(t);case l.DateFieldType:return new l.DateField(t);case u.EmbeddedType:return new u.Embedded(t);case p.FileType:return new p.File(t);case c.MultipleType:return new c.Multiple(t);case f.NumberType:return new f.Number(t);case h.RadioType:return new h.Radio(t);case d.ReferenceType:return new d.Reference(t);case y.TextType:return new y.Text(t);default:return null}}function n(t,e){if(!o.isString(e.type))return null;var r=i(t,e.type);return o.isEmpty(r)||r.deserialize(e),r}Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(2);e.Field=s.Field;var a=r(15);e.Boolean=a.Boolean,e.BooleanType=a.BooleanType;var l=r(16);e.DateField=l.DateField,e.DateFieldType=l.DateFieldType;var u=r(17);e.Embedded=u.Embedded,e.EmbeddedType=u.EmbeddedType;var p=r(18);e.File=p.File,e.FileType=p.FileType;var c=r(19);e.Multiple=c.Multiple,e.MultipleType=c.MultipleType;var f=r(20);e.Number=f.Number,e.NumberType=f.NumberType;var h=r(21);e.Radio=h.Radio,e.RadioType=h.RadioType;var d=r(22);e.Reference=d.Reference,e.ReferenceType=d.ReferenceType;var y=r(23);e.Text=y.Text,e.TextType=y.TextType,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(4)),e.create=i,e.extract=n},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}function n(t,r){var i=function(e){return new l.EditableForm(t).deserialize(e)};return t.GET(i,e.url,"/",r)}function o(t,r){var i=function(e){return new l.EditableForm(t).deserialize(e)};return t.POST(i,r.serialize(),e.url)}function s(t,r){var i=function(e){return new l.EditableForm(t).deserialize(e)};return t.PUT(i,r.serialize(),e.url,"/",r.url)}function a(t,r){return t.DELETE(e.url,"/",r)}Object.defineProperty(e,"__esModule",{value:!0}),i(r(5)),i(r(8)),i(r(3)),i(r(7)),i(r(10)),i(r(11));var l=r(10);e.url="/forms",e.Get=n,e.Insert=o,e.Update=s,e.Remove=a},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),l=r(1),u=r(12),p=r(11),c=r(5),f=r(8),h=r(3),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.url="",e.proto=2,e.version=0,e.states=!1,e.name="",e.description="",e.fields=new Map,e.sections=new Map,e.display=new h.Display,e.fsm=new f.FSM,e._nextid=0,e}return i(e,t),e.prototype.nextid=function(){return this._nextid+=1},e.prototype.isNew=function(){return 0==this.version},e.prototype.isEmpty=function(){return 0==this.fields.size},e.prototype.hasField=function(t){return this.fields.has(t)},e.prototype.hasEmbeddedField=function(t){try{for(var e=o(this.getEmbeddeds()),r=e.next();!r.done;r=e.next()){if(r.value.hasField(t))return!0}}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=e.return)&&n.call(e)}finally{if(i)throw i.error}}return!1;var i,n},e.prototype.hasFieldsOfType=function(t){try{for(var e=o(this.fields),r=e.next();!r.done;r=e.next()){var i=s(r.value,2);i[0];if(i[1].type()==t)return!0}}catch(t){n={error:t}}finally{try{r&&!r.done&&(a=e.return)&&a.call(e)}finally{if(n)throw n.error}}return!1;var n,a},e.prototype.hasEmbeddedFieldsOfType=function(t){try{for(var e=o(this.getEmbeddeds()),r=e.next();!r.done;r=e.next()){if(r.value.hasFieldsOfType(t))return!0}}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=e.return)&&n.call(e)}finally{if(i)throw i.error}}return!1;var i,n},e.prototype.addField=function(t,e,r){void 0===e&&(e="");var i=c.create(this.nextid(),t);return i.name=e,this.fields.set(i.id,i),this.display.add(i),a.isNil(r)?this.fsm.addField(i):r.addField(i),i},e.prototype.addEmbeddedField=function(t,e,r){if(void 0===r&&(r=""),this.hasField(t.id)){var i=c.create(this.nextid(),e);return i.name=r,t.fields.set(i.id,i),t.display.add(i),this.fsm.addField(i),i}},e.prototype.getField=function(t){return this.fields.get(t)},e.prototype.getFieldsOfType=function(t){var e=new Array;try{for(var r=o(this.fields),i=r.next();!i.done;i=r.next()){var n=s(i.value,2),a=(n[0],n[1]);a.type()==t&&e.push(a)}}catch(t){l={error:t}}finally{try{i&&!i.done&&(u=r.return)&&u.call(r)}finally{if(l)throw l.error}}return e;var l,u},e.prototype.getEmbeddedField=function(t){try{for(var e=o(this.getEmbeddeds()),r=e.next();!r.done;r=e.next()){var i=r.value;if(i.hasField(t))return[i,i.getField(t)]}}catch(t){n={error:t}}finally{try{r&&!r.done&&(s=e.return)&&s.call(e)}finally{if(n)throw n.error}}return[null,null];var n,s},e.prototype.getEmbeddeds=function(){var t=new Array;try{for(var e=o(this.fields),r=e.next();!r.done;r=e.next()){var i=s(r.value,2),n=(i[0],i[1]);"embedded"==n.type()&&n&&t.push(n)}}catch(t){a={error:t}}finally{try{r&&!r.done&&(l=e.return)&&l.call(e)}finally{if(a)throw a.error}}return t;var a,l},e.prototype.removeField=function(t){var e=this;if(this.hasField(t.id)){if("embedded"==t.type()){var r=t;r.fields.forEach(function(t){return e.removeField(t)})}this.fields.delete(t.id),this.display.remove(t)}else{var i=s(this.getEmbeddedField(t.id),2),r=i[0],n=i[1];a.isEmpty(t)||(r.fields.delete(n.id),r.display.remove(n))}this.fsm.removeField(t)},e.prototype.getSection=function(t){return this.sections.get(t)},e.prototype.addSection=function(){var t=new p.Section(this.nextid());return this.sections.set(t.id,t),this.display.add(t),t},e.prototype.removeSection=function(t){this.sections.delete(t.id),this.display.remove(t)},e.prototype.addState=function(t){var e=new f.State(this.nextid());return e.name=t,this.fsm.add(e),e},e.prototype.serialize=function(){var e={};this.fields.forEach(function(t,r){return e[""+r]=t.serialize()});var r={};return this.sections.forEach(function(t,e){return r[""+e]=t.serialize()}),a.omitBy(n({},t.prototype.serialize.call(this),{url:this.url,owner:this.owner?this.owner.serialize():null,created:this.created?this.created.toJSON():null,updated:this.updated?this.updated.toJSON():null,proto:this.proto,version:this.version,states:this.states,name:this.name,description:this.description,fields:e,sections:r,display:this.display.serialize(),fsm:this.fsm.serialize(),nextid:this._nextid}),a.isNil)},e.prototype.deserialize=function(e){var r=this;return t.prototype.deserialize.call(this,e),a.isEmpty(e)?this:(this.url=e.url,a.isObject(e.owner)&&(this.owner=(new u.User).deserialize(e.owner)),a.isNil(e.created)||(this.created=new Date(e.created)),a.isNil(e.updated)||(this.updated=new Date(e.updated)),this.proto=e.proto,this.version=e.version,this.states=e.states,this.name=e.name,a.isNil(e.description)||(this.description=e.description),this.fields=new Map,a.each(e.fields,function(t,e){var i=a.toSafeInteger(e);r.fields.set(i,c.extract(i,t))}),this.sections=new Map,a.each(e.sections,function(t,e){var i=a.toSafeInteger(e);r.sections.set(i,new p.Section(i).deserialize(t))}),this.display=(new h.Display).deserialize(e.display),a.isObject(e.fsm)&&(this.fsm=(new f.FSM).deserialize(e.fsm)),this._nextid=a.toSafeInteger(e.nextid),this)},e}(l.ValidableObject);e.Form=d},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(24)),i(r(9))},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(1),a=function(t){function e(e){var r=t.call(this)||this;return r.fields=new Array,r.nexts=new Array,r.id=e,r}return i(e,t),e.prototype.hasField=function(t){return o.includes(this.fields,t.id)},e.prototype.addField=function(t){this.hasField(t)||this.fields.push(t.id)},e.prototype.removeField=function(t){this.fields=o.without(this.fields,t.id)},e.prototype.hasNext=function(t){return o.includes(this.nexts,t.id)},e.prototype.addNext=function(t){this.hasNext(t)||this.nexts.push(t.id)},e.prototype.removeNext=function(t){this.nexts=o.without(this.nexts,t.id)},e.prototype.isTerminal=function(){return 0==this.nexts.length},e.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{name:this.name,fields:this.fields,nexts:this.nexts})},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),o.isObject(e)&&(this.name=e.name,this.fields=e.fields,this.nexts=e.nexts),this},e}(s.ValidableObject);e.State=a},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r(6),o=r(7),s=function(t){function e(e){var r=t.call(this)||this;return r.s=e,r}return i(e,t),e.prototype.update=function(){return n.Update(this.s,this)},e.prototype.remove=function(){return n.Remove(this.s,this.url)},e}(o.Form);e.EditableForm=s},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(1),s=function(t){function e(e){var r=t.call(this)||this;return r.id=e,r}return i(e,t),e.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{html:this.html})},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),this.html=e.html,this},e}(o.ValidableObject);e.Section=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.equal=function(t){return t.id==this.id},t.prototype.serialize=function(){return{id:this.id,name:this.name,picture:this.picture}},t.prototype.deserialize=function(t){return this.id=t.id,this.name=t.name,this.picture=t.picture,this},t}();e.User=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(25))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(12))},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),o=r(2);e.BooleanType="boolean";var s=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i(r,t),r.prototype.type=function(){return e.BooleanType},r.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return n.isEmpty(this.label)||(e.label=this.label),n.isBoolean(this.default)&&(e.default=this.default),e},r.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),!n.isEmpty(e.label)&&n.isString(e.label)&&(this.label=e.label),n.isBoolean(e.default)&&(this.default=e.default),this},r}(o.Field);e.Boolean=s},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),o=r(2);e.DateFieldType="date";var s=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i(r,t),r.prototype.type=function(){return e.DateFieldType},r.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return n.isDate(this.default)&&(e.default=this.default.toJSON()),e},r.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),n.isEmpty(e.default)||(this.default=new Date(e.default)),this},r}(o.Field);e.DateField=s},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),l=r(5),u=r(3),p=r(1),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.max=99,e.min=1,e}return i(e,t),e.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{min:this.min,max:this.max})},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),a.isObject(e)&&(a.isNumber(e.min)&&(this.min=a.toSafeInteger(e.min)),a.isNumber(e.max)&&(this.max=a.toSafeInteger(e.max))),this},e}(p.ValidableObject);e.EmbeddedOptions=c,e.EmbeddedType="embedded";var f=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.fields=new Map,e.display=new u.Display,e.options=new c,e}return i(r,t),r.prototype.type=function(){return e.EmbeddedType},r.prototype.isEmpty=function(){return 0==this.fields.size},r.prototype.hasField=function(t){return this.fields.has(t)},r.prototype.hasFieldsOfType=function(t){try{for(var e=o(this.fields),r=e.next();!r.done;r=e.next()){var i=s(r.value,2);i[0];if(i[1].type()==t)return!0}}catch(t){n={error:t}}finally{try{r&&!r.done&&(a=e.return)&&a.call(e)}finally{if(n)throw n.error}}return!1;var n,a},r.prototype.getField=function(t){return this.fields.get(t)},r.prototype.getFieldsOfType=function(t){var e=new Array;try{for(var r=o(this.fields),i=r.next();!i.done;i=r.next()){var n=s(i.value,2),a=(n[0],n[1]);a.type()==t&&e.push(a)}}catch(t){l={error:t}}finally{try{i&&!i.done&&(u=r.return)&&u.call(r)}finally{if(l)throw l.error}}return e;var l,u},r.prototype.hasChildErrors=function(){try{for(var t=o(this.fields.values()),e=t.next();!e.done;e=t.next()){if(e.value.hasErrors())return!0}}catch(t){r={error:t}}finally{try{e&&!e.done&&(i=t.return)&&i.call(t)}finally{if(r)throw r.error}}return!1;var r,i},r.prototype.setErrors=function(e){var r=this;if(t.prototype.setErrors.call(this,e),a.has(e,"fields.items")){var i=e.fields.items;a.each(i,function(t,e){var i=a.toSafeInteger(e);r.hasField(i)&&r.getField(i).setErrors(t)})}},r.prototype.serialize=function(){var e={};return this.fields.forEach(function(t,r){return e[""+r]=t.serialize()}),n({},t.prototype.serialize.call(this),{options:this.options.serialize(),fields:e,display:this.display.serialize()})},r.prototype.deserialize=function(e){var r=this;return t.prototype.deserialize.call(this,e),this.fields=new Map,a.each(e.fields,function(t,e){var i=a.toSafeInteger(e);r.fields.set(i,l.extract(i,t))}),this.display=(new u.Display).deserialize(e.display),this.options=(new c).deserialize(e.options),this},r}(l.Field);e.Embedded=f},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.FileType="file";var o=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i(r,t),r.prototype.type=function(){return e.FileType},r}(n.Field);e.File=o},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(4);e.MultipleType="multiple";var a=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.default=new Array,e}return i(r,t),r.prototype.type=function(){return e.MultipleType},r.prototype.removeValue=function(e){t.prototype.removeValue.call(this,e),this.isDefault(e)&&this.toggleDefault(e)},r.prototype.isDefault=function(t){return-1!=this.default.indexOf(t.id)},r.prototype.toggleDefault=function(t){var e=this.default.indexOf(t.id);-1!=e?this.default.splice(e,1):this.default.push(t.id)},r.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return o.isEmpty(this.default)||(e.default=this.default),e},r.prototype.deserialize=function(e){if(t.prototype.deserialize.call(this,e),!o.isEmpty(e.default)){this.default=new Array;try{for(var r=n(e.default),i=r.next();!i.done;i=r.next()){var s=i.value;this.default.push(o.toSafeInteger(s))}}catch(t){a={error:t}}finally{try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}}}return this;var a,l},r}(s.ChoiceField);e.Multiple=a},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(2),a=r(1),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.integer=!1,e}return i(e,t),e.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{integer:this.integer})},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),this.integer=!1,o.isBoolean(e.integer)&&(this.integer=e.integer),this},e}(a.ValidableObject);e.NumberOptions=l,e.NumberType="number";var u=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.options=new l,e}return i(r,t),r.prototype.type=function(){return e.NumberType},r.prototype.serialize=function(){var e=n({},t.prototype.serialize.call(this),{options:this.options.serialize()});return o.isNil(this.default)||(e.default=this.default),e},r.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),o.isEmpty(e.options)||(this.options=(new l).deserialize(e.options)),o.isNumber(e.default)&&(this.default=o.toNumber(e.default)),this},r}(s.Field);e.Number=u},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(4),a=r(1),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.display="list",e}return i(e,t),e.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{display:this.display})},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),this.display="list",!o.isNil(e)&&o.isString(e.display)&&(this.display=e.display),this},e}(a.ValidableObject);e.RadioOptions=l,e.RadioType="radio";var u=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.options=new l,e}return i(r,t),r.prototype.type=function(){return e.RadioType},r.prototype.removeValue=function(e){t.prototype.removeValue.call(this,e),this.isDefault(e)&&this.setDefault(null)},r.prototype.isDefault=function(t){return!o.isNil(this.default)&&this.default==t.id},r.prototype.setDefault=function(t){o.isEmpty(t)?this.default=null:this.default=t.id},r.prototype.serialize=function(){var e=t.prototype.serialize.call(this);return o.isNil(this.default)||(e.default=this.default),e.options=this.options.serialize(),e},r.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),this.options=(new l).deserialize(e.options),o.isNil(e.default)||(this.default=o.toSafeInteger(e.default)),this},r}(s.ChoiceField);e.Radio=u},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(2);e.ReferenceType="reference";var s=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i(r,t),r.prototype.type=function(){return e.ReferenceType},r.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{form:this.form})},r.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),this.form=e.form,this},r}(o.Field);e.Reference=s},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),s=r(2),a=r(1),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.textarea=!1,e.rows=1,e}return i(e,t),e.prototype.serialize=function(){return n({},t.prototype.serialize.call(this),{textarea:this.textarea,rows:this.rows})},e.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),this.textarea=!1,o.isBoolean(e.textarea)&&(this.textarea=e.textarea),o.isInteger(e.rows)&&(this.rows=e.rows),this},e}(a.ValidableObject);e.TextOptions=l,e.TextType="text";var u=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.options=new l,e}return i(r,t),r.prototype.type=function(){return e.TextType},r.prototype.serialize=function(){var e=n({},t.prototype.serialize.call(this),{options:this.options.serialize()});return o.isEmpty(this.default)||(e.default=this.default),e},r.prototype.deserialize=function(e){return t.prototype.deserialize.call(this,e),o.isEmpty(e.options)||(this.options=(new l).deserialize(e.options)),o.isEmpty(e.default)||(this.default=e.default),this},r}(s.Field);e.Text=u},function(t,e,r){"use strict";var i=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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(0),a=r(1),l=r(9),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.states=new Map,e}return i(e,t),e.prototype.has=function(t){return this.states.has(t)},e.prototype.length=function(){return this.states.size},e.prototype.get=function(t){return this.states.get(t)},e.prototype.all=function(){return this.states.values()},e.prototype.add=function(t){this.has(t.id)||(this.states.set(t.id,t),s.isNil(this.initial)&&(this.initial=t))},e.prototype.remove=function(t){this.states.delete(t.id)},e.prototype.hasField=function(t){try{for(var e=o(this.states.values()),r=e.next();!r.done;r=e.next()){if(r.value.hasField(t))return!0}}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=e.return)&&n.call(e)}finally{if(i)throw i.error}}return!1;var i,n},e.prototype.addField=function(t){this.states.forEach(function(e){return e.addField(t)})},e.prototype.removeField=function(t){this.states.forEach(function(e){return e.removeField(t)})},e.prototype.statesFor=function(t){var e=new Array;try{for(var r=o(this.states.values()),i=r.next();!i.done;i=r.next()){var n=i.value;n.hasField(t)&&e.push(n)}}catch(t){s={error:t}}finally{try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}}return e;var s,a},e.prototype.hasChildErrors=function(){try{for(var t=o(this.states.values()),e=t.next();!e.done;e=t.next()){if(e.value.hasErrors())return!0}}catch(t){r={error:t}}finally{try{e&&!e.done&&(i=t.return)&&i.call(t)}finally{if(r)throw r.error}}return!1;var r,i},e.prototype.setErrors=function(e){var r=this;if(t.prototype.setErrors.call(this,e),s.has(e,"states.items")){var i=e.states.items;s.each(i,function(t,e){var i=s.toSafeInteger(e);r.has(i)&&r.get(i).setErrors(t)})}},e.prototype.serialize=function(){var e={};return this.states.forEach(function(t,r){return e[""+r]=t.serialize()}),n({},t.prototype.serialize.call(this),{initial:this.initial.id,states:e})},e.prototype.deserialize=function(e){var r=this;return t.prototype.deserialize.call(this,e),this.states=new Map,s.isObject(e.states)&&(s.each(e.states,function(t,e){var i=s.toSafeInteger(e);r.states.set(i,new l.State(i).deserialize(t))}),this.initial=this.states.get(s.toSafeInteger(e.initial))),this},e}(a.ValidableObject);e.FSM=u},function(t,e,r){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var s=r(0),a=function(){function t(t,e){this.defaultTransformers=new Array,this.config=t,this.client=e;var r=e.defaults.transformResponse;this.defaultTransformers=s.isArray(r)?r:[r]}return t.prototype.wrapTransform=function(t){var e=this,r=s.clone(this.defaultTransformers);return r.push(function(r){return e.toHTTPAPIResponse(t,r)}),r},t.prototype.voidTransform=function(t){},t.prototype.toHTTPAPIResponse=function(t,e){return s.isNil(e)||!s.isObject(e)?{errors:null,data:null}:s.isNil(e.data)?{errors:null,data:t(e)}:{errors:e.errors,data:!s.isNil(e.data)&&s.isObject(e.data)?t(e.data):null}},t.prototype.clientConfig=function(t){var e={"X-Requested-With":"XMLHttpRequest",Accept:"application/json"};null!=this.config.apiKey&&(e.ApiKey=this.config.apiKey);var r=this.client.defaults.transformResponse;return s.isNil(t)||(r=this.wrapTransform(t)),{baseURL:this.config.baseURL+"/api",headers:e,responseType:"json",transformResponse:r}},t.prototype.joinUrlFragments=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return""+t+e})},t.prototype.GET=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return this.client.request(i({},this.clientConfig(),{method:"GET",url:this.joinUrlFragments.apply(this,o(e)),transformResponse:this.wrapTransform(t)}))},t.prototype.POST=function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.client.request(i({},this.clientConfig(),{method:"POST",url:this.joinUrlFragments.apply(this,o(r)),data:e,transformResponse:this.wrapTransform(t)}))},t.prototype.PUT=function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.client.request(i({},this.clientConfig(),{method:"PUT",url:this.joinUrlFragments.apply(this,o(r)),data:e,transformResponse:this.wrapTransform(t)}))},t.prototype.DELETE=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.client.request(i({},this.clientConfig(),{method:"DELETE",url:this.joinUrlFragments.apply(this,o(t)),transformResponse:this.wrapTransform(this.voidTransform)}))},t}();e.Session=a},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(6)),i(r(13)),i(r(1)),i(r(14))},function(t,e,r){"use strict";var i=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),o=function(){function t(){}return t.prototype.serialize=function(){return{code:this.code,data:this.data}},t.prototype.deserialize=function(t){return this.code=t.code,this.data=t.data,this},t}();e.ValidationError=o;var s=function(){function t(){this.errors=new Array}return t.prototype.hasErrors=function(){return this.errors.length>0},t.prototype.setErrors=function(t){this._extract(t)},t.prototype.first=function(){if(this.hasErrors())return this.errors[0]},t.prototype.serialize=function(){var t=[];try{for(var e=i(this.errors),r=e.next();!r.done;r=e.next()){var n=r.value;t.push(n.serialize())}}catch(t){o={error:t}}finally{try{r&&!r.done&&(s=e.return)&&s.call(e)}finally{if(o)throw o.error}}return t;var o,s},t.prototype.deserialize=function(t){return this._extract(t)},t.prototype._extract=function(t){var e=this;return this.errors=new Array,n.isArray(t)&&n.each(t,function(t){return e.errors.push((new o).deserialize(t))}),this},t}();e.ValidationList=s;var a=function(){function t(){this.errors=new Map}return t.prototype.hasErrors=function(){return this.errors.size>0},t.prototype.hasChildErrors=function(){return!1},t.prototype.setErrors=function(t){this._extract(t)},t.prototype.serialize=function(){var t={};return this.errors.forEach(function(e,r){return t[""+r]=e.serialize()}),n.isEmpty(t)?{}:{errors:t}},t.prototype.deserialize=function(t){return n.isEmpty(t)||this._extract(t.errors),this},t.prototype._extract=function(t){var e=this;return this.errors=new Map,n.isObject(t)&&n.each(t,function(t,r){var i=(n.toSafeInteger(r),(new s).deserialize(t));i.hasErrors()&&e.errors.set(r,i)}),this},t}();e.ValidableObject=a;var l=function(){function t(){this.errors=new s}return t.prototype.hasErrors=function(){return!n.isNil(this.errors)&&this.errors.hasErrors()},t.prototype.hasChildErrors=function(){return!1},t.prototype.setErrors=function(t){this.errors=(new s).deserialize(t)},t}();e.ValidableProperty=l}])});
  //# sourceMappingURL=udapi.min.js.map