Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@heduapp/book-objects

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heduapp/book-objects - npm Package Compare versions

Comparing version 0.13.4 to 0.14.0

2

business-object/index.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t){e.exports=require("uuid")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(4),s=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,s){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=u.Locales.Czech),void 0===s&&(s=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=s,this.internalChildren=[],this.internalLocale=u.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return s.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=s.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(26);t.Book=i.Book;var u=n(25);t.Chapter=u.Chapter;var s=n(24);t.Comment=s.Comment;var c=n(23);t.GenericObject=c.GenericObject;var p=n(22);t.Text=p.Text;var a=n(21);t.Answer=a.Answer;var f=n(20);t.Environment=f.Environment;var l=n(19);t.Supplement=l.Supplement;var b=n(18);t.Question=b.Question;var d=n(17);t.Problem=d.Problem;var h=n(16);t.Link=h.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},,,,,,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=n(0),s=n(1),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=n(0),s=n(1),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(4),s=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,s){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=u.Locales.Czech),void 0===s&&(s=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=s,this.internalChildren=[],this.internalLocale=u.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return s.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=s.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.Book=i.Book;var u=n(11);t.Chapter=u.Chapter;var s=n(12);t.Comment=s.Comment;var c=n(13);t.GenericObject=c.GenericObject;var p=n(14);t.Text=p.Text;var a=n(15);t.Answer=a.Answer;var f=n(16);t.Environment=f.Environment;var l=n(17);t.Supplement=l.Supplement;var b=n(18);t.Question=b.Question;var d=n(19);t.Problem=d.Problem;var h=n(20);t.Link=h.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=39)}({39:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}})});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=41)}({41:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}})});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=35)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t){e.exports=require("uuid")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(4),s=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,s){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=u.Locales.Czech),void 0===s&&(s=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=s,this.internalChildren=[],this.internalLocale=u.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return s.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=s.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(26);t.Book=i.Book;var u=n(25);t.Chapter=u.Chapter;var s=n(24);t.Comment=s.Comment;var c=n(23);t.GenericObject=c.GenericObject;var p=n(22);t.Text=p.Text;var a=n(21);t.Answer=a.Answer;var f=n(20);t.Environment=f.Environment;var l=n(19);t.Supplement=l.Supplement;var b=n(18);t.Question=b.Question;var d=n(17);t.Problem=d.Problem;var h=n(16);t.Link=h.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},,,,,,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=n(0),s=n(1),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=n(0),s=n(1),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),u=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,o=t.objectType,u=t.elementType,s=t.locale,c=t.uuid,p=t.sortOrder,a=t.text,f=e.decodeChildren(n);switch(o){case i.BusinessObjectType.Book:return new i.Book(f,r,s,c);case i.BusinessObjectType.Chapter:return new i.Chapter(f,p,r,s,c);case i.BusinessObjectType.Comment:return new i.Comment(f,p,r,s,c);case i.BusinessObjectType.Problem:return new i.Problem(f,p,r,s,c);case i.BusinessObjectType.Supplement:return new i.Supplement(f,p,r,s,c);case i.BusinessObjectType.Question:return new i.Question(f,p,r,c);case i.BusinessObjectType.Answer:return new i.Answer(f,p,r,c);case i.BusinessObjectType.Environment:return new i.Environment(f,p,r,c);case i.BusinessObjectType.Link:return new i.Link(f,p,r,c);case i.BusinessObjectType.Content:return new i.Content(f,p,r,c);case i.BusinessObjectType.Text:return new i.Text(a,p,c);default:return new i.GenericObject(u||"unknown",f,p,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=u}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=38)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(4),s=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,s){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=u.Locales.Czech),void 0===s&&(s=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=s,this.internalChildren=[],this.internalLocale=u.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return s.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=s.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.Book=i.Book;var u=n(11);t.Chapter=u.Chapter;var s=n(12);t.Comment=s.Comment;var c=n(13);t.GenericObject=c.GenericObject;var p=n(14);t.Text=p.Text;var a=n(15);t.Answer=a.Answer;var f=n(16);t.Environment=f.Environment;var l=n(17);t.Supplement=l.Supplement;var b=n(18);t.Question=b.Question;var d=n(19);t.Problem=d.Problem;var h=n(20);t.Link=h.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),u=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,o=t.objectType,u=t.elementType,s=t.locale,c=t.uuid,p=t.sortOrder,a=t.text,f=e.decodeChildren(n);switch(o){case i.BusinessObjectType.Book:return new i.Book(f,r,s,c);case i.BusinessObjectType.Chapter:return new i.Chapter(f,p,r,s,c);case i.BusinessObjectType.Comment:return new i.Comment(f,p,r,s,c);case i.BusinessObjectType.Problem:return new i.Problem(f,p,r,s,c);case i.BusinessObjectType.Supplement:return new i.Supplement(f,p,r,s,c);case i.BusinessObjectType.Question:return new i.Question(f,p,r,c);case i.BusinessObjectType.Answer:return new i.Answer(f,p,r,c);case i.BusinessObjectType.Environment:return new i.Environment(f,p,r,c);case i.BusinessObjectType.Link:return new i.Link(f,p,r,c);case i.BusinessObjectType.Content:return new i.Content(f,p,r,c);case i.BusinessObjectType.Text:return new i.Text(a,p,c);default:return new i.GenericObject(u||"unknown",f,p,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=u}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=38)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t){e.exports=require("uuid")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(30);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(26);t.Book=o.Book;var s=n(25);t.Chapter=s.Chapter;var u=n(24);t.Comment=u.Comment;var c=n(23);t.GenericObject=c.GenericObject;var a=n(22);t.Text=a.Text;var l=n(21);t.Answer=l.Answer;var p=n(20);t.Environment=p.Environment;var f=n(19);t.Supplement=f.Supplement;var d=n(18);t.Question=d.Question;var b=n(17);t.Problem=b.Problem;var h=n(16);t.Link=h.Link;var v=n(9);t.Content=v.Content;var y=n(4);t.Locales=y.Locales},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(6);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(12),c=n(6);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(6);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(8)),a=n(6),l=n(12),p=n(11),f=n(15),d=n(5),b=n(7),h=n(29),v=n(28),y=n(10);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,_=n.children,O=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(O)return O(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var C=n;return u.default.createElement(a.Environment,r({},{environment:C}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(h.GenericObject,r({},{object:B,overrides:o}));case c.BusinessObjectType.Book:var w=n;return u.default.createElement(v.Book,r({},{book:w}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(y.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),_.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(13);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(14),c=n(27),a=n(10);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),s=n(0),u=n(1),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),s=n(0),u=n(1),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(11),u=n(14);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(15);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(8)),c=n(3),a=n(5),l=n(33),p=n(13),f=n(32);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var _=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,_,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(34),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(11);t.Question=s.Question;var u=n(12);t.Answer=u.Answer;var c=n(30);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(27);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(6);t.Environment=p.Environment;var f=n(13);t.BusinessObject=f.BusinessObject;var d=n(14);t.Comment=d.Comment;var b=n(28);t.Book=b.Book;var h=n(10);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},,,,function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(31),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return i(this,void 0,void 0,function(){var t=this;return o(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=35)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(10);t.Book=o.Book;var s=n(11);t.Chapter=s.Chapter;var u=n(12);t.Comment=u.Comment;var c=n(13);t.GenericObject=c.GenericObject;var a=n(14);t.Text=a.Text;var l=n(15);t.Answer=l.Answer;var p=n(16);t.Environment=p.Environment;var f=n(17);t.Supplement=f.Supplement;var d=n(18);t.Question=d.Question;var b=n(19);t.Problem=b.Problem;var h=n(20);t.Link=h.Link;var v=n(9);t.Content=v.Content;var y=n(4);t.Locales=y.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(27);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(22),c=n(30),a=n(26);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(23);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(6)),a=n(8),l=n(24),p=n(25),f=n(21),d=n(5),b=n(7),h=n(28),v=n(29),y=n(26);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,_=n.children,O=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(O)return O(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var C=n;return u.default.createElement(a.Environment,r({},{environment:C}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(h.GenericObject,r({},{object:B,overrides:o}));case c.BusinessObjectType.Book:var w=n;return u.default.createElement(v.Book,r({},{book:w}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(y.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),_.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(24),c=n(8);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(32),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(6)),c=n(3),a=n(5),l=n(33),p=n(23),f=n(34);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var _=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,_,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(21);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(25),u=n(22);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(25);t.Question=s.Question;var u=n(24);t.Answer=u.Answer;var c=n(27);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(30);t.Problem=a.Problem;var l=n(28);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(23);t.BusinessObject=f.BusinessObject;var d=n(22);t.Comment=d.Comment;var b=n(29);t.Book=b.Book;var h=n(26);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(31),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return i(this,void 0,void 0,function(){var t=this;return o(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a}])});
//# sourceMappingURL=index.js.map

@@ -7,4 +7,4 @@ import { IEncoder, IDecoder } from './codec';

decodeSync<T extends AbstractBusinessObject>(source: string): T;
encode(businessObject: IBusinessObject): Promise<string>;
encodeSync(businessObject: IBusinessObject): string;
encode(businessObject: IBusinessObject, pretty?: boolean): Promise<string>;
encodeSync(businessObject: IBusinessObject, pretty?: boolean): string;
private encodeChildren;

@@ -11,0 +11,0 @@ private encodeChild;

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=37)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t){e.exports=require("uuid")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(4),s=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,s){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=u.Locales.Czech),void 0===s&&(s=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=s,this.internalChildren=[],this.internalLocale=u.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return s.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=s.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(26);t.Book=i.Book;var u=n(25);t.Chapter=u.Chapter;var s=n(24);t.Comment=s.Comment;var c=n(23);t.GenericObject=c.GenericObject;var p=n(22);t.Text=p.Text;var a=n(21);t.Answer=a.Answer;var f=n(20);t.Environment=f.Environment;var l=n(19);t.Supplement=l.Supplement;var d=n(18);t.Question=d.Question;var b=n(17);t.Problem=b.Problem;var h=n(16);t.Link=h.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},,,,,,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(1),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=n(0),s=n(1),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=n(0),s=n(1),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},,,,,,,,,,function(e,t){e.exports=require("xml-js")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,s)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(36),s=n(8),c=n(9),p=function(){function e(){}return e.prototype.decode=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=u.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.encodeSync(e)]})})},e.prototype.encodeSync=function(e){var t={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},n=u.js2xml(t);return this.encodeXMLEntities(n)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,o={attributes:e.attributes,elements:this.encodeChildren(n),type:"element"};switch(t){case s.BusinessObjectType.Generic:var i=e.elementType;return r({},o,{name:i});case s.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},o,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,u=e.attributes;if(void 0===t&&(t=0),o===s.BusinessObjectType.Text)return new s.Text(""+i,t);var p=this.decodeElements(r);switch(n){case s.BusinessObjectType.Book:return new s.Book(p,u);case s.BusinessObjectType.Chapter:return new s.Chapter(p,t,u);case s.BusinessObjectType.Comment:return new s.Comment(p,t,u);case s.BusinessObjectType.Problem:return new s.Problem(p,t,u);case s.BusinessObjectType.Question:return new s.Question(p,t,u);case s.BusinessObjectType.Answer:return new s.Answer(p,t,u);case s.BusinessObjectType.Environment:return new s.Environment(p,t,u);case s.BusinessObjectType.Supplement:return new s.Supplement(p,t,u);case s.BusinessObjectType.Link:return new s.Link(p,t,u);case s.BusinessObjectType.Content:return new c.Content(p,t,u);default:return new s.GenericObject(n||"unknown",this.decodeElements(r),t,u)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e}();t.XMLCodec=p}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=36)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(4),s=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,s){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=u.Locales.Czech),void 0===s&&(s=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=s,this.internalChildren=[],this.internalLocale=u.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return s.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=s.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.Book=i.Book;var u=n(11);t.Chapter=u.Chapter;var s=n(12);t.Comment=s.Comment;var c=n(13);t.GenericObject=c.GenericObject;var p=n(14);t.Text=p.Text;var a=n(15);t.Answer=a.Answer;var f=n(16);t.Environment=f.Environment;var l=n(17);t.Supplement=l.Supplement;var d=n(18);t.Question=d.Question;var b=n(19);t.Problem=b.Problem;var h=n(20);t.Link=h.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,s)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(37),s=n(6),c=n(9),p=function(){function e(){}return e.prototype.decode=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=u.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,function(){return i(this,function(n){return[2,this.encodeSync(e,t)]})})},e.prototype.encodeSync=function(e,t){void 0===t&&(t=!1);var n={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},r=t?{spaces:4,fullTagEmptyElement:!0,ignoreDeclaration:!0,ignoreDoctype:!0,textFn:function(e){return"\n"+e.replace(/[\r\n]/gm,"").replace(" "," ").trim()}}:{},o=u.js2xml(n,r);return this.encodeXMLEntities(o)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,o={attributes:e.attributes,elements:this.encodeChildren(n),type:"element"};switch(t){case s.BusinessObjectType.Generic:var i=e.elementType;return r({},o,{name:i});case s.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},o,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,u=e.attributes;if(void 0===t&&(t=0),o===s.BusinessObjectType.Text)return new s.Text(""+i,t);var p=this.decodeElements(r);switch(n){case s.BusinessObjectType.Book:return new s.Book(p,u);case s.BusinessObjectType.Chapter:return new s.Chapter(p,t,u);case s.BusinessObjectType.Comment:return new s.Comment(p,t,u);case s.BusinessObjectType.Problem:return new s.Problem(p,t,u);case s.BusinessObjectType.Question:return new s.Question(p,t,u);case s.BusinessObjectType.Answer:return new s.Answer(p,t,u);case s.BusinessObjectType.Environment:return new s.Environment(p,t,u);case s.BusinessObjectType.Supplement:return new s.Supplement(p,t,u);case s.BusinessObjectType.Link:return new s.Link(p,t,u);case s.BusinessObjectType.Content:return new c.Content(p,t,u);default:return new s.GenericObject(n||"unknown",this.decodeElements(r),t,u)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e}();t.XMLCodec=p},function(e,t){e.exports=require("xml-js")}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=41)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t){e.exports=require("uuid")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(30);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(26);t.Book=o.Book;var s=n(25);t.Chapter=s.Chapter;var u=n(24);t.Comment=u.Comment;var c=n(23);t.GenericObject=c.GenericObject;var a=n(22);t.Text=a.Text;var l=n(21);t.Answer=l.Answer;var p=n(20);t.Environment=p.Environment;var f=n(19);t.Supplement=f.Supplement;var d=n(18);t.Question=d.Question;var h=n(17);t.Problem=h.Problem;var b=n(16);t.Link=b.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(6);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(12),c=n(6);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(6);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(8)),a=n(6),l=n(12),p=n(11),f=n(15),d=n(5),h=n(7),b=n(29),y=n(28),v=n(10);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var w=n;return u.default.createElement(l.Answer,r({},{answer:w}));case c.BusinessObjectType.Environment:var T=n;return u.default.createElement(a.Environment,r({},{environment:T}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(b.GenericObject,r({},{object:B,overrides:o}));case c.BusinessObjectType.Book:var C=n;return u.default.createElement(y.Book,r({},{book:C}));case c.BusinessObjectType.Supplement:var x=n;return u.default.createElement(v.Supplement,r({},{supplement:x}));default:var E=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(h.Title,r({},{title:E})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(13);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(14),c=n(27),a=n(10);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),s=n(0),u=n(1),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),s=n(0),u=n(1),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(11),u=n(14);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(15);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(8)),c=n(3),a=n(5),l=n(33),p=n(13),f=n(32);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,h=o.objectType,b=o.children,y=o.attributes;if(h===u.BusinessObjectType.Text){var v=t.text;return s.default.createElement(a.Text,r({},{text:v}))}if(h===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:b.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(y.style){var O=r({},y,{style:f.transformCSSToInlineStyle(y.style)});return c.createElement(d,O,m)}return c.createElement(d,y,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(34),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(11);t.Question=s.Question;var u=n(12);t.Answer=u.Answer;var c=n(30);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(27);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(6);t.Environment=p.Environment;var f=n(13);t.BusinessObject=f.BusinessObject;var d=n(14);t.Comment=d.Comment;var h=n(28);t.Book=h.Book;var b=n(10);t.Supplement=b.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),s=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,i=t.objectType,s=t.elementType,u=t.locale,c=t.uuid,a=t.sortOrder,l=t.text,p=e.decodeChildren(n);switch(i){case o.BusinessObjectType.Book:return new o.Book(p,r,u,c);case o.BusinessObjectType.Chapter:return new o.Chapter(p,a,r,u,c);case o.BusinessObjectType.Comment:return new o.Comment(p,a,r,u,c);case o.BusinessObjectType.Problem:return new o.Problem(p,a,r,u,c);case o.BusinessObjectType.Supplement:return new o.Supplement(p,a,r,u,c);case o.BusinessObjectType.Question:return new o.Question(p,a,r,c);case o.BusinessObjectType.Answer:return new o.Answer(p,a,r,c);case o.BusinessObjectType.Environment:return new o.Environment(p,a,r,c);case o.BusinessObjectType.Link:return new o.Link(p,a,r,c);case o.BusinessObjectType.Content:return new o.Content(p,a,r,c);case o.BusinessObjectType.Text:return new o.Text(l,a,c);default:return new o.GenericObject(s||"unknown",p,a,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=s},function(e,t){e.exports=require("xml-js")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(36),u=n(8),c=n(9),a=function(){function e(){}return e.prototype.decode=function(e){return i(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=s.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e){return i(this,void 0,void 0,function(){return o(this,function(t){return[2,this.encodeSync(e)]})})},e.prototype.encodeSync=function(e){var t={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},n=s.js2xml(t);return this.encodeXMLEntities(n)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,i={attributes:e.attributes,elements:this.encodeChildren(n),type:"element"};switch(t){case u.BusinessObjectType.Generic:var o=e.elementType;return r({},i,{name:o});case u.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,i=e.type,o=e.text,s=e.attributes;if(void 0===t&&(t=0),i===u.BusinessObjectType.Text)return new u.Text(""+o,t);var a=this.decodeElements(r);switch(n){case u.BusinessObjectType.Book:return new u.Book(a,s);case u.BusinessObjectType.Chapter:return new u.Chapter(a,t,s);case u.BusinessObjectType.Comment:return new u.Comment(a,t,s);case u.BusinessObjectType.Problem:return new u.Problem(a,t,s);case u.BusinessObjectType.Question:return new u.Question(a,t,s);case u.BusinessObjectType.Answer:return new u.Answer(a,t,s);case u.BusinessObjectType.Environment:return new u.Environment(a,t,s);case u.BusinessObjectType.Supplement:return new u.Supplement(a,t,s);case u.BusinessObjectType.Link:return new u.Link(a,t,s);case u.BusinessObjectType.Content:return new c.Content(a,t,s);default:return new u.GenericObject(n||"unknown",this.decodeElements(r),t,s)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e}();t.XMLCodec=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(31),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return i(this,void 0,void 0,function(){var t=this;return o(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a},,function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(38)),r(n(37)),r(n(35))},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(8));t.BusinessObject=i;var o=r(n(31));t.JSX=o;var s=r(n(40));t.Codec=s}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=39)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(10);t.Book=o.Book;var s=n(11);t.Chapter=s.Chapter;var u=n(12);t.Comment=u.Comment;var c=n(13);t.GenericObject=c.GenericObject;var a=n(14);t.Text=a.Text;var l=n(15);t.Answer=l.Answer;var p=n(16);t.Environment=p.Environment;var f=n(17);t.Supplement=f.Supplement;var d=n(18);t.Question=d.Question;var h=n(19);t.Problem=h.Problem;var b=n(20);t.Link=b.Link;var y=n(9);t.Content=y.Content;var v=n(4);t.Locales=v.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(27);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(22),c=n(30),a=n(26);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(23);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(6)),a=n(8),l=n(24),p=n(25),f=n(21),d=n(5),h=n(7),b=n(28),y=n(29),v=n(26);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var w=n;return u.default.createElement(l.Answer,r({},{answer:w}));case c.BusinessObjectType.Environment:var T=n;return u.default.createElement(a.Environment,r({},{environment:T}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(b.GenericObject,r({},{object:B,overrides:o}));case c.BusinessObjectType.Book:var C=n;return u.default.createElement(y.Book,r({},{book:C}));case c.BusinessObjectType.Supplement:var x=n;return u.default.createElement(v.Supplement,r({},{supplement:x}));default:var E=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(h.Title,r({},{title:E})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(24),c=n(8);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(32),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(6)),c=n(3),a=n(5),l=n(33),p=n(23),f=n(34);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,h=o.objectType,b=o.children,y=o.attributes;if(h===u.BusinessObjectType.Text){var v=t.text;return s.default.createElement(a.Text,r({},{text:v}))}if(h===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:b.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(y.style){var O=r({},y,{style:f.transformCSSToInlineStyle(y.style)});return c.createElement(d,O,m)}return c.createElement(d,y,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(21);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(25),u=n(22);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(25);t.Question=s.Question;var u=n(24);t.Answer=u.Answer;var c=n(27);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(30);t.Problem=a.Problem;var l=n(28);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(23);t.BusinessObject=f.BusinessObject;var d=n(22);t.Comment=d.Comment;var h=n(29);t.Book=h.Book;var b=n(26);t.Supplement=b.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(31),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return i(this,void 0,void 0,function(){var t=this;return o(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(37),u=n(6),c=n(9),a=function(){function e(){}return e.prototype.decode=function(e){return i(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=s.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e,t){return void 0===t&&(t=!1),i(this,void 0,void 0,function(){return o(this,function(n){return[2,this.encodeSync(e,t)]})})},e.prototype.encodeSync=function(e,t){void 0===t&&(t=!1);var n={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},r=t?{spaces:4,fullTagEmptyElement:!0,ignoreDeclaration:!0,ignoreDoctype:!0,textFn:function(e){return"\n"+e.replace(/[\r\n]/gm,"").replace(" "," ").trim()}}:{},i=s.js2xml(n,r);return this.encodeXMLEntities(i)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,i={attributes:e.attributes,elements:this.encodeChildren(n),type:"element"};switch(t){case u.BusinessObjectType.Generic:var o=e.elementType;return r({},i,{name:o});case u.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,i=e.type,o=e.text,s=e.attributes;if(void 0===t&&(t=0),i===u.BusinessObjectType.Text)return new u.Text(""+o,t);var a=this.decodeElements(r);switch(n){case u.BusinessObjectType.Book:return new u.Book(a,s);case u.BusinessObjectType.Chapter:return new u.Chapter(a,t,s);case u.BusinessObjectType.Comment:return new u.Comment(a,t,s);case u.BusinessObjectType.Problem:return new u.Problem(a,t,s);case u.BusinessObjectType.Question:return new u.Question(a,t,s);case u.BusinessObjectType.Answer:return new u.Answer(a,t,s);case u.BusinessObjectType.Environment:return new u.Environment(a,t,s);case u.BusinessObjectType.Supplement:return new u.Supplement(a,t,s);case u.BusinessObjectType.Link:return new u.Link(a,t,s);case u.BusinessObjectType.Content:return new c.Content(a,t,s);default:return new u.GenericObject(n||"unknown",this.decodeElements(r),t,s)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e}();t.XMLCodec=a},function(e,t){e.exports=require("xml-js")},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),s=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,i=t.objectType,s=t.elementType,u=t.locale,c=t.uuid,a=t.sortOrder,l=t.text,p=e.decodeChildren(n);switch(i){case o.BusinessObjectType.Book:return new o.Book(p,r,u,c);case o.BusinessObjectType.Chapter:return new o.Chapter(p,a,r,u,c);case o.BusinessObjectType.Comment:return new o.Comment(p,a,r,u,c);case o.BusinessObjectType.Problem:return new o.Problem(p,a,r,u,c);case o.BusinessObjectType.Supplement:return new o.Supplement(p,a,r,u,c);case o.BusinessObjectType.Question:return new o.Question(p,a,r,c);case o.BusinessObjectType.Answer:return new o.Answer(p,a,r,c);case o.BusinessObjectType.Environment:return new o.Environment(p,a,r,c);case o.BusinessObjectType.Link:return new o.Link(p,a,r,c);case o.BusinessObjectType.Content:return new o.Content(p,a,r,c);case o.BusinessObjectType.Text:return new o.Text(l,a,c);default:return new o.GenericObject(s||"unknown",p,a,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=s},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(6));t.BusinessObject=i;var o=r(n(31));t.JSX=o;var s=r(n(40));t.Codec=s},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(35)),r(n(36)),r(n(38))}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=31)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t){e.exports=require("uuid")},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(30);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(26);t.Book=o.Book;var s=n(25);t.Chapter=s.Chapter;var u=n(24);t.Comment=u.Comment;var c=n(23);t.GenericObject=c.GenericObject;var a=n(22);t.Text=a.Text;var l=n(21);t.Answer=l.Answer;var p=n(20);t.Environment=p.Environment;var f=n(19);t.Supplement=f.Supplement;var d=n(18);t.Question=d.Question;var b=n(17);t.Problem=b.Problem;var h=n(16);t.Link=h.Link;var v=n(9);t.Content=v.Content;var y=n(4);t.Locales=y.Locales},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(6);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(12),c=n(6);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(6);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(8)),a=n(6),l=n(12),p=n(11),f=n(15),d=n(5),b=n(7),h=n(29),v=n(28),y=n(10);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var C=n;return u.default.createElement(a.Environment,r({},{environment:C}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(h.GenericObject,r({},{object:B,overrides:o}));case c.BusinessObjectType.Book:var w=n;return u.default.createElement(v.Book,r({},{book:w}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(y.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(13);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(14),c=n(27),a=n(10);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(1),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),s=n(0),u=n(1),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),s=n(0),u=n(1),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(2),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(11),u=n(14);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(15);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(8)),c=n(3),a=n(5),l=n(33),p=n(13),f=n(32);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var O=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,O,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(34),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(11);t.Question=s.Question;var u=n(12);t.Answer=u.Answer;var c=n(30);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(27);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(6);t.Environment=p.Environment;var f=n(13);t.BusinessObject=f.BusinessObject;var d=n(14);t.Comment=d.Comment;var b=n(28);t.Book=b.Book;var h=n(10);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=31)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(10);t.Book=o.Book;var s=n(11);t.Chapter=s.Chapter;var u=n(12);t.Comment=u.Comment;var c=n(13);t.GenericObject=c.GenericObject;var a=n(14);t.Text=a.Text;var l=n(15);t.Answer=l.Answer;var p=n(16);t.Environment=p.Environment;var f=n(17);t.Supplement=f.Supplement;var d=n(18);t.Question=d.Question;var b=n(19);t.Problem=b.Problem;var h=n(20);t.Link=h.Link;var v=n(9);t.Content=v.Content;var y=n(4);t.Locales=y.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(27);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(22),c=n(30),a=n(26);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(23);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(6)),a=n(8),l=n(24),p=n(25),f=n(21),d=n(5),b=n(7),h=n(28),v=n(29),y=n(26);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var C=n;return u.default.createElement(a.Environment,r({},{environment:C}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(h.GenericObject,r({},{object:B,overrides:o}));case c.BusinessObjectType.Book:var w=n;return u.default.createElement(v.Book,r({},{book:w}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(y.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(24),c=n(8);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(32),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(6)),c=n(3),a=n(5),l=n(33),p=n(23),f=n(34);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var O=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,O,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(21);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(25),u=n(22);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(25);t.Question=s.Question;var u=n(24);t.Answer=u.Answer;var c=n(27);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(30);t.Problem=a.Problem;var l=n(28);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(23);t.BusinessObject=f.BusinessObject;var d=n(22);t.Comment=d.Comment;var b=n(29);t.Book=b.Book;var h=n(26);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}}])});
//# sourceMappingURL=index.js.map
{
"name": "@heduapp/book-objects",
"version": "0.13.4",
"version": "0.14.0",
"author": "H-Edu s.r.o.",

@@ -5,0 +5,0 @@ "main": "./index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc