!function(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var r=n();for(var e in r)("object"==typeof exports?exports:t)[e]=r[e]}}(this,function(){return function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){function e(t,n){this._model=t||{components:{},connections:{},pages:{},eventHandlers:{},EventTypes:{}},this._onUpdateCallback=n}function o(t,n,r,e,o){var c={type:t,name:n,targetId:e,params:r};this._onUpdateCallback&&this._onUpdateCallback(e,b,c,o)}function c(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}function i(t,n,r,e,o){var c=a.get(t,["components",n]);c&&(c[r]=a.assign(c[r],e),o&&o(n,r,e))}function u(t){return Object.keys(t.components)}var a=r(1),f="data",p="state",s="type",l="props",v="parent",y="events",d="layout",b="behavior",h="publicAPI",g="isDisplayed",m="id";e.prototype.addComponent=function(t,n){var r={};r[v]=n[v],r[p]=n[p]||{},r[s]=n[s],r[f]=n[f]||{},r[l]=n[l]||{},r[d]=n[d]||{},r[y]=n[y]||[],r[g]=n[g]||!1,r[m]=n[m],this._model.components[t]=r},e.prototype.addPagesData=function(t){this._model.pages.pagesData=t.pagesData,this._model.pages.currentPageId=t.currentPageId,this._model.pages.baseUrl=t.baseUrl},e.prototype.addConnections=function(t){this._model.connections=t},e.prototype.addEventTypes=function(t){this._model.EventTypes=t},e.prototype.getComp=function(t){return a.get(this._model.components,t)},e.prototype.getState=function(t){return a.get(this._model.components,[t,p])},e.prototype.getData=function(t){return a.get(this._model.components,[t,f])},e.prototype.getType=function(t){return a.get(this._model.components,[t,s])},e.prototype.getProps=function(t){return a.get(this._model.components,[t,l])},e.prototype.getEvents=function(t){return a.get(this._model.components,[t,y])},e.prototype.getLayout=function(t){return a.get(this._model.components,[t,d])},e.prototype.getId=function(t){return a.get(this._model.components,[t,m])},e.prototype.getEventTypes=function(){return a.clone(this._model.EventTypes)},e.prototype.getPublicAPI=function(t){return a.get(this._model.components,[t,h])},e.prototype.getCallbackById=function(t){return this._model.eventHandlers[t]},e.prototype.getParent=function(t){return a.get(this._model.components,[t,v])},e.prototype.getChildren=function(t){var n=u(this._model);return n.filter(function(n){return a.get(this._model.components,[n,v])===t},this)},e.prototype.setData=function(t,n){i(this._model,t,f,n,this._onUpdateCallback)},e.prototype.setProps=function(t,n,r){i(this._model,t,l,n,function(t,n,e){this._onUpdateCallback.call(this,t,n,e,r)}.bind(this))},e.prototype.setLayout=function(t,n){i(this._model,t,d,n,this._onUpdateCallback)},e.prototype.setPublicAPI=function(t,n){var r=a.get(this._model.components,t);r&&(r[h]=n)},e.prototype.executeCompBehavior=function(t,n,r,e){o.call(this,"comp",n,r,t,e)},e.prototype.executeAnimation=function(t,n,r,e){o.call(this,"animation",n,r,t,e)},e.prototype.setUpdateCallback=function(t){this._onUpdateCallback=t},e.prototype.registerEvent=function(t,n,r,e){var o;a.isFunction(e)?(o=c(),this._model.eventHandlers[o]=e):o=e;var i={contextId:t,eventType:r,callbackId:o},u=a.get(this._model,["components",n]);void 0!==u&&(u.events.push(i),a.isFunction(this._onUpdateCallback)&&this._onUpdateCallback(n,"registerEvent",i))},e.prototype.unregisterAll=function(t,n){var r=a.get(this._model,["components",t]);if(void 0!==r){var e=[];r.events.forEach(function(t){t.eventType===n?delete this._model.eventHandlers[t.callbackId]:e.push(t)},this),r.events=e,a.isFunction(this._onUpdateCallback)&&this._onUpdateCallback(t,"unregisterAll",{eventType:n})}},e.prototype.toJson=function(){return this._model},e.prototype.getScopedRMI=function(t){var n=new this.constructor(this._model,this._onUpdateCallback);return n.getCompIdsFromRole=n.getCompIdsFromRole.bind(n,t),n.getCompIdsFromType=n.getCompIdsFromType.bind(n,t),n.getConfig=n.getConfig.bind(n,t),n},e.prototype.getCompIdsFromType=function(t,n){var r=u(this._model),e=[];return r.forEach(function(t){var r=this.getType(t);r===n&&e.push(t)},this),e},e.prototype.getCompIdsFromRole=function(t,n){var r=a.get(this._model.connections,[t,n]);return r?Object.keys(r):[]},e.prototype.getConfig=function(t,n,r){var e=a.get(this._model.connections,[t,r]);return e?e[n]:{}},e.prototype.getCompsFromType=function(t){var n=[],r=u(this._model);return r.forEach(function(r){var e=this.getType(r);e===t&&n.push(this.getComp(r))},this),n},e.prototype.updateModel=function(t){for(var n in t){var r=this.getComp(n),e=t[n];if(r)for(var o in e)a.assign(r[o],e[o])}},t.exports=e},function(t,n,r){t.exports={findIndex:r(2),filter:r(45),get:r(53),assign:r(54),isFunction:r(16),clone:r(61)}},function(t,n,r){var e=r(3),o=e();t.exports=o},function(t,n,r){function e(t){return function(n,r,e){return n&&n.length?(r=o(r,e,3),c(n,r,t)):-1}}var o=r(4),c=r(44);t.exports=e},function(t,n,r){function e(t,n,r){var e=typeof t;return"function"==e?void 0===n?t:i(t,n,r):null==t?u:"object"==e?o(t):void 0===n?a(t):c(t,n)}var o=r(5),c=r(33),i=r(40),u=r(41),a=r(42);t.exports=e},function(t,n,r){function e(t){var n=c(t);if(1==n.length&&n[0][2]){var r=n[0][0],e=n[0][1];return function(t){return null!=t&&(t[r]===e&&(void 0!==e||r in i(t)))}}return function(t){return o(t,n)}}var o=r(6),c=r(30),i=r(29);t.exports=e},function(t,n,r){function e(t,n,r){var e=n.length,i=e,u=!r;if(null==t)return!i;for(t=c(t);e--;){var a=n[e];if(u&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++ef))return!1;for(;++a-1&&t%1==0&&t<=e}var e=9007199254740991;t.exports=r},function(t,n,r){function e(t){for(var n=a(t),r=n.length,e=r&&t.length,f=!!e&&u(e)&&(c(t)||o(t)),s=-1,l=[];++s-1&&t%1==0&&t0;++eo?0:o+n),r=void 0===r||r>o?o:+r||0,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var c=Array(o);++e2?r[i-2]:void 0,a=i>2?r[2]:void 0,f=i>1?r[i-1]:void 0;for("function"==typeof u?(u=o(u,f,5),i-=2):(u="function"==typeof f?f:void 0,i-=u?1:0),a&&c(r[0],r[1],a)&&(u=i<3?void 0:u,i=1);++e