From 00b3857df994b588ef4426e5916180b535ec8fea Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Wed, 4 Mar 2015 10:21:31 +0000 Subject: [PATCH] updated milo-core --- bower.json | 2 +- lib/milo.js | 2 +- milo.bundle.js | 9 ++++++--- milo.bundle.map | 8 ++++---- milo.min.js | 6 +++--- milo.min.js.map | 2 +- package.json | 4 ++-- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/bower.json b/bower.json index 3002b17..0f55cf4 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "milo", - "version": "0.2.2", + "version": "0.2.3", "homepage": "https://github.com/milojs/milo", "authors": [ "MOL Technical " diff --git a/lib/milo.js b/lib/milo.js index 551d4a4..86cee19 100644 --- a/lib/milo.js +++ b/lib/milo.js @@ -63,7 +63,7 @@ _.extend(milo, { Component: require('./components/c_class'), Command: require('./command'), registry: require('./registry'), - milo_version: '0.2.2', + milo_version: '0.2.3', createComponentClass: require('./util/create_component_class'), destroy: destroy }); diff --git a/milo.bundle.js b/milo.bundle.js index bd46065..eb776f5 100644 --- a/milo.bundle.js +++ b/milo.bundle.js @@ -9227,7 +9227,7 @@ _.extend(milo, { Component: require('./components/c_class'), Command: require('./command'), registry: require('./registry'), - milo_version: '0.2.2', + milo_version: '0.2.3', createComponentClass: require('./util/create_component_class'), destroy: destroy }); @@ -12984,7 +12984,10 @@ function _wrapMixinMethod(method) { function _getMixinInstance(methodName) { if (this instanceof Mixin) return this; var instanceKeys = this.constructor[config.mixin.instancePropertiesMap] - return this[instanceKeys[methodName]]; + , mixinProp = instanceKeys[methodName] + , mixin = this[mixinProp]; + if (!mixin) throw new Error('Mixin ' + mixinProp + ' does not exist'); + return mixin; } @@ -19050,5 +19053,5 @@ function makeFindMethod(eachMethod, findWhat) { } },{}]},{},[66]) -//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9qYXNvbmlhbmdyZWVuL3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mdW5jdGlvbiBDb21wb25lbnRGYWNldCRvbkNvbmZpZ01lc3NhZ2VzKG1lc3NhZ2VTdWJzY3JpYmVycykge1xuICAgIHZhciBub3RZZXRSZWdpc3RlcmVkTWFwID0gXy5tYXBLZXlzKG1lc3NhZ2VTdWJzY3JpYmVycywgZnVuY3Rpb24oc3Vic2NyaWJlciwgbWVzc2FnZXMpIHtcbiAgICAgICAgdmFyIHN1YnNjcmliZXJUeXBlID0gdHlwZW9mIHN1YnNjcmliZXI7XG4gICAgICAgIGlmIChzdWJzY3JpYmVyVHlwZSA9PSAnZnVuY3Rpb24nKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMub24obWVzc2FnZXMsIHN1YnNjcmliZXIpO1xuXG4gICAgICAgIGlmIChzdWJzY3JpYmVyVHlwZSA9PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgdmFyIGNvbnRleHRUeXBlID0gdHlwZW9mIHN1YnNjcmliZXIuY29udGV4dDtcbiAgICAgICAgICAgIGlmIChjb250ZXh0VHlwZSA9PSAnb2JqZWN0JylcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5vbihtZXNzYWdlcywgc3Vic2NyaWJlcik7XG5cbiAgICAgICAgICAgIGlmIChjb250ZXh0VHlwZSA9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmIChzdWJzY3JpYmVyLmNvbnRleHQgPT0gdGhpcy5uYW1lIHx8IHN1YnNjcmliZXIuY29udGV4dCA9PSAnZmFjZXQnKVxuICAgICAgICAgICAgICAgICAgICBzdWJzY3JpYmVyID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3Vic2NyaWJlcjogc3Vic2NyaWJlci5zdWJzY3JpYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dDogdGhpc1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN1YnNjcmliZXIuY29udGV4dCA9PSAnb3duZXInKVxuICAgICAgICAgICAgICAgICAgICBzdWJzY3JpYmVyID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3Vic2NyaWJlcjogc3Vic2NyaWJlci5zdWJzY3JpYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dDogdGhpcy5vd25lclxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bmtub3duIHN1YnNjcmliZXIgY29udGV4dCBpbiBjb25maWd1cmF0aW9uOiAnICsgc3Vic2NyaWJlci5jb250ZXh0KTtcblxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm9uKG1lc3NhZ2VzLCBzdWJzY3JpYmVyKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bmtub3duIHN1YnNjcmliZXIgY29udGV4dCB0eXBlIGluIGNvbmZpZ3VyYXRpb246ICcgKyBjb250ZXh0VHlwZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ3Vua25vd24gc3Vic2NyaWJlciB0eXBlIGluIGNvbmZpZ3VyYXRpb246ICcgKyBzdWJzY3JpYmVyVHlwZSk7XG4gICAgfSwgdGhpcyk7XG5cbiAgICByZXR1cm4gbm90WWV0UmVnaXN0ZXJlZE1hcDtcbn1cblxuXG4vLyBjaGVja0RlcGVuZGVuY2llc1xuZnVuY3Rpb24gQ29tcG9uZW50RmFjZXQkY2hlY2soKSB7XG4gICAgaWYgKHRoaXMucmVxdWlyZSkge1xuICAgICAgICB0aGlzLnJlcXVpcmUuZm9yRWFjaChmdW5jdGlvbihyZXFGYWNldCkge1xuICAgICAgICAgICAgaWYgKCEgdGhpcy5vd25lci5oYXNGYWNldChyZXFGYWNldCkpXG4gICAgICAgICAgICAgICAgdGhpcy5vd25lci5hZGRGYWNldChyZXFGYWNldCk7XG4gICAgICAgIH0sIHRoaXMpO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c2VkUGF0aFtpXVxuICAgICAgICAgICAgLCBub2RlS2V5ID0gcGF0aFV0aWxzLmdldFBhdGhOb2RlS2V5KHBhdGhOb2RlKTtcbiAgICAgICAgaWYgKHBhdGhOb2RlLnN5bnRheCA9PSAnYXJyYXknICYmIGN1cnJlbnRDb21wb25lbnQubGlzdCkge1xuICAgICAgICAgICAgdmFyIGl0ZW1Db21wb25lbnQgPSBjdXJyZW50Q29tcG9uZW50Lmxpc3QuaXRlbShub2RlS2V5KTtcbiAgICAgICAgICAgIGlmICghIGl0ZW1Db21wb25lbnQgJiYgY3JlYXRlSXRlbSAhPT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICBpdGVtQ29tcG9uZW50ID0gY3VycmVudENvbXBvbmVudC5saXN0Ll9hZGRJdGVtKG5vZGVLZXkpO1xuICAgICAgICAgICAgICAgIGl0ZW1Db21wb25lbnQuZGF0YS5fcGF0aCA9IHBhdGhOb2RlLnByb3BlcnR5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudENvbXBvbmVudCA9IGl0ZW1Db21wb25lbnQ7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVudENvbXBvbmVudC5jb250YWluZXIpXG4gICAgICAgICAgICBjdXJyZW50Q29tcG9uZW50ID0gY3VycmVudENvbXBvbmVudC5jb250YWluZXIuc2NvcGVbbm9kZUtleV07XG5cbiAgICAgICAgdmFyIGN1cnJlbnREYXRhRmFjZXQgPSBjdXJyZW50Q29tcG9uZW50ICYmIGN1cnJlbnRDb21wb25lbnQuZGF0YTtcbiAgICAgICAgaWYgKCEgY3VycmVudERhdGFGYWNldClcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIHJldHVybiBjdXJyZW50RGF0YUZhY2V0O1xufVxuXG5cbi8qKlxuICogRGF0YSBmYWNldCBpbnN0YW5jZSBtZXRob2RcbiAqIFJldHVybnMgcGF0aCB0byBhY2Nlc3MgdGhpcyBkYXRhIGZhY2V0IGZyb20gc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ib29sZWFuJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gYWxsb3dDb21wcztcbiAgICAgICAgICAgIC8vIGNvbXBvbmVudCBjbGFzc1xuICAgICAgICAgICAgY2FzZSAnc3RyaW5nJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbWV0YSAmJiBtZXRhLmNvbXBDbGFzcyA9PSBhbGxvd0NvbXBzO1xuICAgICAgICAgICAgLy8gdGVzdCBmdW5jdGlvblxuICAgICAgICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICAgICAgICAgIHJldHVybiBhbGxvd0NvbXBzLmNhbGwodGhpcy5vd25lciwgbWV0YSwgZHQsIG9yaWdpbmFsRHJvcENvbXBvbmVudCk7XG4gICAgICAgICAgICBjYXNlICdvYmplY3QnOlxuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGFsbG93Q29tcHMpKVxuICAgICAgICAgICAgICAgICAgICAvLyBsaXN0IG9mIGFsbG93ZWQgY2xhc3Nlc1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWxsb3dDb21wcy5pbmRleE9mKG1ldGEgJiYgbWV0YS5jb21wQ2xhc3MpID49IDA7XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG1hcCBvZiBjbGFzczogYm9vbGVhbnx0ZXN0IGZ1bmN0aW9uXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ZXN0ID0gYWxsb3dDb21wc1ttZXRhICYmIG1ldGEuY29tcENsYXNzXTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICEhIF8ucmVzdWx0KHRlc3QsIHRoaXMub3duZXIsIG1ldGEsIGR0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSW5jb3JyZWN0IGFsbG93ZWQgY29tcG9uZW50cyBpbiBjb25maWcnKTtcbiAgICAgICAgfVxuICAg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SBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcbiAgICB3cmFwRWwuaW5uZXJIVE1MID0gaXRlbXNIVE1MO1xuXG4gICAgbWlsb0JpbmRlcih3cmFwRWwsIHRoaXMub3duZXIuY29udGFpbmVyLnNjb3BlKTtcbiAgICB2YXIgY2hpbGRyZW4gPSBkb21VdGlscy5jaGlsZHJlbih3cmFwRWwpO1xuXG4gICAgaWYgKGNvdW50ICE9IGNoaWxkcmVuLmxlbmd0aClcbiAgICAgICAgbG9nZ2VyLmVycm9yKCdudW1iZXIgb2YgaXRlbXMgYWRkZWQgaXMgZGlmZmVyZW50IGZyb20gcmVxdWVzdGVkJyk7XG5cbiAgICBpZiAoY2hpbGRyZW4gJiYgY2hpbGRyZW4ubGVuZ3RoKSB7XG4gICAgICAgIHZhciBsaXN0TGVuZ3RoID0gdGhpcy5jb3VudCgpO1xuICAgICAgICB2YXIgc3BsaWNlSW5kZXggPSBpbmRleCA8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHR5cGVvZiBpbmRleCA9PSAndW5kZWZpbmVkJyB8fCBpbmRleCA+IGxpc3RMZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsaXN0TGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogaW5kZXg7XG5cbiAgICAgICAgdmFyIHByZXZDb21wb25lbnQgPSBzcGxpY2VJbmRleCA9PSAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGhpcy5pdGVtU2FtcGxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdGhpcy5fbGlzdEl0ZW1zW3NwbGljZUluZGV4IC0gMV07XG5cbiAgICAgICAgdmFyIGZyYWcgPSBkb2N1bWVudC5jcmVhdGVEb2N1bWVudEZyYWdtZW50KClcbiAgICAgICAgICAgICwgbmV3Q29tcG9uZ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gICAgICAgICAgICAgICB7ez8gaGFzU3ViVHJlZSB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cIm1sLXVpLWZvbGR0cmVlLWJ1dHRvblwiPjwvZGl2PlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ez99fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ez0gaXQuaXRlbVRlbXBsYXRlKHsgaXRlbTogaXRlbSwgaWQ6IGl0Lml0ZW1JRHNbaW5kZXhdIH0pIH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3s/IGhhc1N1YlRyZWUgfX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3s9IGl0LnRyZWVUZW1wbGF0ZShpdGVtKSB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7P319XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2xpPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7e359fVxcXG4gICAgICAgICAgICAgICAgICAgIDwvdWw+JztcblxudmFyIERFRkFVTFRfQ09NUElMRURfSVRFTV9URU1QTEFURSA9IGRvVC5jb21waWxlKCdcXFxuICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJtbC11aS1mb2xkdHJlZS1sYWJlbFwiIGRhdGEtaXRlbS1pZD1cInt7PSBpdC5pZCB9fVwiPlxcXG4gICAgICAgICAgICAgICAge3s9IGl0Lml0ZW0ubGFiZWwgfX1cXFxuICAgICAgICAgICAgPC9zcGFuPicpXG4gICAgLCBDT01QSUxFRF9UUkVFX1RFTVBMQVRFID0gZG9ULmNvbXBpbGUoVFJFRV9URU1QTEFURSk7XG5cblxudmFyIE1MRm9sZFRyZWUgPSBDb21wb25lbnQuY3JlYXRlQ29tcG9uZW50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9XCJbZXZlbnRzXTpjbG9zZUJ0blwiIHR5cGU9XCJidXR0b25cIiBjbGFzcz1cImNsb3NlXCI+JnRpbWVzOzwvYnV0dG9uPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxoNCBjbGFzcz1cIm1vZGFsLXRpdGxlXCI+e3s9IGl0LnRpdGxlIH19PC9oND5cXFxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxcbiAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICB7ez8gaXQuaHRtbCB8fCBpdC50ZXh0IH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJtb2RhbC1ib2R5XCIgbWwtYmluZD1cIltjb250YWluZXJdOmRpYWxvZ0JvZHlcIj5cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7PyBpdC5odG1sIH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3s9IGl0Lmh0bWwgfX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7Pz99fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPnt7PSBpdC50ZXh0IH19PC9wPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxcbiAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICB7ez8gaXQuYnV0dG9ucyAmJiBpdC5idXR0b25zLmxlbmd0aCB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwibW9kYWwtZm9vdGVyXCI+XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e34gaXQuYnV0dG9ucyA6YnRuIH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ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7XG5cblxuY29uZmlnKHtcbiAgICBhdHRyczoge1xuICAgICAgICBiaW5kOiAnbWwtYmluZCcsXG4gICAgICAgIGxvYWQ6ICdtbC1sb2FkJ1xuICAgIH0sXG4gICAgY29tcG9uZW50UmVmOiAnX19fbWlsb19jb21wb25lbnQnLFxuICAgIGNvbXBvbmVudFByZWZpeDogJ21pbG9fJyxcbiAgICB0ZW1wbGF0ZToge1xuICAgICAgICBjb21waWxlOiBkb1QuY29tcGlsZVxuICAgIH0sXG4gICAgZG9tU3RvcmFnZToge1xuICAgICAgICB0eXBlU3VmZml4OiAnOl9fX21pbG9fZGF0YV90eXBlJyxcbiAgICAgICAgcHJlZml4U2VwYXJhdG9yOiAnLycsXG4gICAgICAgIHJvb3Q6ICcnLFxuICAgICAgICBtZXNzYWdlS2V5OiAnX19fbWlsb19tZXNzYWdlLycsXG4gICAgICAgIG1lc3NhZ2VUaW1lc3RhbXA6ICdfX19taWxvX3RpbWVzdGFtcCcsXG4gICAgICAgIHF1b3RhRXhjZWVkZWQ6IHtcbiAgICAgICAgICAgIHRocm93RXJyb3I6IHRydWUsXG4gICAgICAgICAgICBtZXNzYWdlOiBmYWxzZVxuICAgICAgICB9XG4gICAgfSxcbiAgICBkcmFnRHJvcDoge1xuICAgICAgICBkYXRhVHlwZXM6IHtcbiAgICAgICAgICAgIGNvbXBvbmVudDogJ3gtYXBwbGljYXRpb24vbWlsby9jb21wb25lbnQnLFxuICAgICAgICAgICAgY29tcG9uZW50TWV0YVRlbXBsYXRlOiAneC1hcHBsaWNhdGlvbi9taWxvL2NvbXBvbmVudC1tZXRhLyVjbGFzcy8lbmFtZS8lcGFyYW1zJyxcbiAgICAgICAgICAgIGNvbXBvbmVudE1ldGFSZWdleDogL154XFwtYXBwbGljYXRpb25cXC9taWxvXFwvY29tcG9uZW50XFwtbWV0YVxcLyhbYS16MC05XSspXFwvKFthLXowLTldKylcXC8oW2EtejAtOV0qKSQvLFxuICAgICAgICB9XG4gICAgfSxcbiAgICBy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IGZyb21EUy5vblN5bmMoJ2RhdGFjaGFuZ2VzJywgb25EYXRhKTtcbiAgICAgICAgcmV0dXJuIG9uRGF0YTtcblxuICAgICAgICBmdW5jdGlvbiBvbkRhdGEobWVzc2FnZSwgYmF0Y2gpIHtcbiAgICAgICAgICAgIHZhciBzZW5kRGF0YSA9IHtcbiAgICAgICAgICAgICAgICBjaGFuZ2VzOiBbXSxcbiAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbjogYmF0Y2gudHJhbnNhY3Rpb25cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYmF0Y2guY2hhbmdlcy5mb3JFYWNoKGZ1bmN0aW9uKGNoYW5nZSkge1xuICAgICAgICAgICAgICAgIHZhciBzb3VyY2VQYXRoID0gY2hhbmdlLnBhdGhcbiAgICAgICAgICAgICAgICAgICAgLCB0YXJnZXRQYXRoID0gdHJhbnNsYXRlUGF0aChzb3VyY2VQYXRoKTtcblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGFyZ2V0UGF0aCA9PSAndW5kZWZpbmVkJykgcmV0dXJuO1xuXG4gICAgICAgICAgICAgICAgdmFyIGNoYW5nZSA9IF8uY2xvbmUoY2hhbmdlKTtcbiAgICAgICAgICAgICAgICBfLmV4dGVuZChjaGFuZ2UsIHtcbiAgICAgICAgICAgICAgICAgICAgc291cmNlOiBmcm9tRFMsXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IHRhcmdldFBhdGhcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHRyYW5zbGF0ZURhdGEoc291cmNlUGF0aCwgY2hhbmdlKTtcbiAgICAgICAgICAgICAgICB2YWxpZGF0ZURhdGEoc291cmNlUGF0aCwgY2hhbmdlKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBpZiAoISBjaGFuZ2VzUXVldWUubGVuZ3RoKVxuICAgICAgICAgICAgICAgIF8uZGVmZXIocG9zdENoYW5nZURhdGEpO1xuXG4gICAgICAgICAgICBjaGFuZ2VzUXVldWUucHVzaChzZW5kRGF0YSk7XG5cblxuICAgICAgICAgICAgZnVuY3Rpb24gdHJhbnNsYXRlUGF0aChzb3VyY2VQYXRoKSB7XG4gICAgICAgICAgICAgICAgaWYgKHBhdGhUcmFuc2xhdGlvbikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHJhbnNsYXRlZFBhdGggPSBwYXRoVHJhbnNsYXRpb25bc291cmNlUGF0aF07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2xhdGVkUGF0aCkgcmV0dXJuIHRyYW5zbGF0ZWRQYXRoO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXBhdHRlcm5UcmFuc2xhdGlvbi5sZW5ndGgpIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB0ID0gXy5maW5kKHBhdHRlcm5UcmFuc2xhdGlvbiwgZnVuY3Rpb24ocFRyYW5zbGF0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcFRyYW5zbGF0aW9uLmZyb21QYXR0ZXJuLnRlc3Qoc291cmNlUGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXB0KSByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIHZhciB0cmFuc2xhdGVkUGF0aCA9IHNvdXJjZVBhdGgucmVwbGFjZShwdC5mcm9tU3RhdGljUGF0aCwgcHQudG9TdGF0aWNQYXRoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCEgKChzdWJzY3JpcHRpb25QYXR0ZXJuIGluc3RhbmNlb2YgUmVnRXhwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdWJzY3JpcHRpb25QYXR0ZXJuLnRlc3Qoc291cmNlUGF0aCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBzdWJzY3JpcHRpb25QYXR0ZXJuID09IHNvdXJjZVBhdGgpKSByZXR1cm47XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNsYXRlZFBhdGggfHwgc291cmNlUGF0aDtcbiAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICBmdW5jdGlvbiB0cmFuc2xhdGVEYXRhKHNvdXJjZVBhdGgsIGNoYW5nZSkge1xuICAgICAgICAgICAgICAgIGlmIChkYXRhVHJhbnNsYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRyYW5zbGF0ZSA9IGRhdGFUcmFuc2xhdGlvbltzb3VyY2VQYXRoXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zbGF0ZSAmJiB0eXBlb2YgdHJhbnNsYXRlID09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5nZS5vbGRWYWx1ZSA9IHRyYW5zbGF0ZShjaGFuZ2Uub2xkVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlLm5ld1ZhbHVlID0gdHJhbnNsYXRlKGNoYW5nZS5uZXdWYWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBcbiAgICAgICAgICAgIGZ1bmN0aW9uIHZhbGlkYXRlRGF0YShzb3VyY2VQYXRoLCBjaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICBwcm9wYWdhdGVEYXRhKGNoYW5nZSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoZGF0YVZhbGlkYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZhbGlkYXRvcnMgPSBkYXRhVmFsaWRhdGlvbltzb3VyY2VQYXRoXVxuICAgICAgICAgICAgICAgICAgICAgICAgLCBwYXNzZWRDb3VudCA9IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICwgYWxyZWFkeUZhaWxlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZGF0b3JzKVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9ycy5mb3JFYWNoKGNhbGxWYWxpZGF0b3IpOyAgIFxuICAgICAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gY2FsbFZhbGlkYXRvcih2YWxpZGF0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yKGNoYW5nZS5uZXdWYWx1ZSwgZnVuY3Rpb24oZXJyLCByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UucGF0aCA9IHNvdXJjZVBhdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISBhbHJlYWR5RmFpbGVkICYmIChlcnIgfHwgcmVzcG9uc2UudmFsaWQpICYmICsrcGFzc2VkQ291bnQgPT0gdmFsaWRhdG9ycy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tRFMucG9zdE1lc3NhZ2UoJ3ZhbGlkYXRlZCcsIHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoISByZXNwb25zZS52YWxpZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscmVhZHlGYWlsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb21EUy5wb3N0TWVzc2FnZSgndmFsaWRhdGVkJywgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgZnVuY3Rpb24gcHJvcGFnYXRlRGF0YShjaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICBzZW5kRGF0YS5jaGFuZ2VzLnB1c2goY2hhbmdlKTtcbiAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICBmdW5jd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wbGV0ZWQnIDogJ2NoYW5nZXN0YXJ0ZWQnO1xuICAgICAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UobWVzc2FnZSwgeyBzb3VyY2U6IGZyb21EUywgdGFyZ2V0OiB0b0RTIH0pO1xuICAgICAgICAgICAgfVxuXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIG1lcmdlVHJhbnNhY3Rpb25zKGJhdGNoZXMpIHtcbiAgICAgICAgICAgICAgICB2YXIgdHJhbnNhY3Rpb25zID0gW11cbiAgICAgICAgICAgICAgICAgICAgLCBjdXJyZW50VHJhbnNhY3Rpb247XG5cbiAgICAgICAgICAgICAgICBiYXRjaGVzLmZvckVhY2goZnVuY3Rpb24oYmF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgYmF0Y2gudHJhbnNhY3Rpb24pIGN1cnJlbnRUcmFuc2FjdGlvbiA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgYmF0Y2guY2hhbmdlcy5sZW5ndGgpIHJldHVybjtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoYmF0Y2gudHJhbnNhY3Rpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50VHJhbnNhY3Rpb24pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5hcHBlbmRBcnJheShjdXJyZW50VHJhbnNhY3Rpb24sIGJhdGNoLmNoYW5nZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFRyYW5zYWN0aW9uID0gXy5jbG9uZShiYXRjaC5jaGFuZ2VzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbnMucHVzaChjdXJyZW50VHJhbnNhY3Rpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICA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J1xcXFxbJyArIGludGVycG9sYXRpb25TeW50YXggKyAnXFxcXF0nXG5cbiAgICAsIHByb3BlcnR5U3RhclN5bnRheCA9ICdcXFxcLlxcXFwqJ1xuICAgICwgYXJyYXlTdGFyU3ludGF4ID0gJ1xcXFxbXFxcXCpcXFxcXSdcbiAgICAsIHN0YXJTeW50YXggPSAnXFxcXConXG5cbiAgICAsIHBhdGhQYXJzZVN5bnRheCA9IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eVBhdGhTeW50YXgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlQYXRoU3ludGF4LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5SW50ZXJwb2xhdGVTeW50YXgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlJbnRlcnBvbGF0ZVN5bnRheFxuICAgICAgICAgICAgICAgICAgICAgICAgXS5qb2luKCd8JylcbiAgICAsIHBhdGhQYXJzZVBhdHRlcm4gPSBuZXcgUmVnRXhwKHBhdGhQYXJzZVN5bnRheCwgJ2cnKVxuXG4gICAgLCBwYXR0ZXJuUGF0aFBhcnNlU3ludGF4ID0gIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhQYXJzZVN5bnRheCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5U3RhclN5bnRheCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycmF5U3RhclN5bnRheCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJTeW50YXhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXS5qb2luKCd8JylcbiAgICAsIHBhdHRlcm5QYXRoUGFyc2VQYXR0ZXJuID0gbmV3IFJlZ0V4cChwYXR0ZXJuUGF0aFBhcnNlU3ludGF4LCAnZycpXG5cbiAgICAvLywgdGFyZ2V0UGF0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FZhbHVlJyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gYWRkTWVzc2FnZXMobWVzc2FnZXMsIG1lc3NhZ2VzSGFzaCwgcm9vdFBhdGgsIG9iaiwgbXNnVHlwZSwgdmFsdWVQcm9wKSB7XG4gICAgICAgIF9hZGRNZXNzYWdlcyhyb290UGF0aCwgb2JqKTtcblxuXG4gICAgICAgIGZ1bmN0aW9uIF9hZGRNZXNzYWdlcyhyb290UGF0aCwgb2JqKSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvYmopKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGhTeW50YXggPSByb290UGF0aCArICdbJCRdJztcbiAgICAgICAgICAgICAgICBvYmouZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgYWRkTWVzc2FnZSh2YWx1ZSwgaW5kZXgsIHBhdGhTeW50YXgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgcGF0aFN5bnRheCA9IHJvb3RQYXRoICsgJy4kJCc7XG4gICAgICAgICAgICAgICAgXy5lYWNoS2V5KG9iaiwgZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgICAgICAgICAgICAgICAgICBhZGRNZXNzYWdlKHZhbHVlLCBrZXksIHBhdGhTeW50YXgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gYWRkTWVzc2FnZSh2YWx1ZSwga2V5LCBwYXRoU3ludGF4KSB7XG4gICAgICAgICAgICB2YXIgcGF0aCA9IHBhdGhTeW50YXgucmVwbGFjZSgnJCQnLCBrZXkpXG4gICAgICAgICAgICAgICAgLCBleGlzdGluZ01zZyA9IG1lc3NhZ2VzSGFzaFtwYXRoXTtcblxuICAgICAgICAgICAgaWYgKGV4aXN0aW5nTXNnK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Juc1trZXldO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcHRpb25hbFBhdHRlcm5zLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgICBjaGVja1N1YnRyZWUoc3ViVmFsdWUsIG9wdGlvbmFsUGF0dGVybnNba2V5XSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghdW5rbm93bktleXNBbGxvd2VkKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTWF0Y2guRXJyb3IoXCJVbmtub3duIGtleVwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICBpZiAoZXJyIGluc3RhbmNlb2YgTWF0Y2guRXJyb3IpXG4gICAgICAgICAgICAgICAgZXJyLnBhdGggPSBfcHJlcGVuZFBhdGgoa2V5LCBlcnIucGF0aCk7XG4gICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgIH1cbiAgICB9LCB0aGlzLCB0cnVlKTtcblxuICAgIF8uZWFjaEtleShyZXF1aXJlZFBhdHRlcm5zLCBmdW5jdGlvbih2YWx1ZSwga2V5KSB7XG4gICAgICAgIHRocm93IG5ldyBNYXRjaC5FcnJvcihcIk1pc3Npbmcga2V5ICdcIiArIGtleSArIFwiJ1wiKTtcbiAgICB9LCB0aGlzLCB0cnVlKTtcbn07XG5cblxudmFyIF9qc0tleXdvcmRzID0gW1wiZG9cIiwgXCJpZlwiLCBcImluXCIsIFwiZm9yXCIsIFwibGV0XCIsIFwibmV3XCIsIFwidHJ5XCIsIFwidmFyXCIsIFwiY2FzZVwiLFxuICAgIFwiZWxzZVwiLCBcImVudW1cIiwgXCJldmFsXCIsIFwiZmFsc2VcIiwgXCJudWxsXCIsIFwidGhpc1wiLCBcInRydWVcIiwgXCJ2b2lkXCIsIFwid2l0aFwiLFxuICAgIFwiYnJlYWtcIiwgXCJjYXRjaFwiLCBcImNsYXNzXCIsI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BLZXlzXShwcm90b19vYmplY3QuanMuaHRtbCNtYXBLZXlzKVxuICogLSBbcmVkdWNlS2V5c10ocHJvdG9fb2JqZWN0LmpzLmh0bWwjcmVkdWNlS2V5cylcbiAqIC0gW2ZpbHRlcktleXNdKHByb3RvX29iamVjdC5qcy5odG1sI2ZpbHRlcktleXMpXG4gKiAtIFtzb21lS2V5XShwcm90b19vYmplY3QuanMuaHRtbCNzb21lS2V5KVxuICogLSBbZXZlcnlLZXldKHByb3RvX29iamVjdC5qcy5odG1sI2V2ZXJ5S2V5KVxuICogLSBbZmluZFZhbHVlXShwcm90b19vYmplY3QuanMuaHRtbCNmaW5kVmFsdWUpXG4gKiAtIFtmaW5kS2V5XShwcm90b19vYmplY3QuanMuaHRtbCNmaW5kS2V5KVxuICogLSBbcGlja0tleXNdKHByb3RvX29iamVjdC5qcy5odG1sI3BpY2tLZXlzKVxuICogLSBbb21pdEtleXNdKHByb3RvX29iamVjdC5qcy5odG1sI29taXRLZXlzKVxuICogLSBbaXNFcXVhbF0ocHJvdG9fb2JqZWN0LmpzLmh0bWwjaXNFcXVhbClcbiAqIC0gW2lzTm90XShwcm90b19vYmplY3QuanMuaHRtbCNpc05vdClcbiAqL1xudmFyIG9iamVjdE1ldGhvZHMgPSByZXF1aXJlKCcuL3Byb3RvX29iamVjdCcpO1xuXG5cbi8qKlxuICogW19fQXJyYXkgZnVuY3Rpb25zX19dKHByb3RvX2FycmF5LmpzLmh0bWwpXG4gKlxuICogLSBbZmluZF0ocHJvdG9fYXJyYXkuanMuaHRtbCNmaW5kKVxuICogLSBbZmluZEluZGV4XShwcm90b19hcnJheS5qcy5odG1sI2ZpbmRJbmRleClcbiAqIC0gW2FwcGVuZEFycmF5XShwcm90b19hcnJheS5qcy5odG1sI2FwcGVuZEFycmF5KVxuICogLSBbcHJlcGVuZEFycmF5XShwcm90b19hcnJheS5qcy5odG1sI3ByZXBlbmRBcnJheSlcbiAqIC0gW3NwbGljZUl0ZW1dKHByb3RvX2Fycm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XIgY2F1Z2h0RXJyb3I7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBlYWNoTWV0aG9kLmNhbGwodGhpcywgdGVzdEl0ZW0sIHRoaXNBcmcsIG9ubHlFbnVtZXJhYmxlKTtcbiAgICAgICAgfSBjYXRjaCAoZm91bmQpIHtcbiAgICAgICAgICAgIGlmIChmb3VuZCA9PT0gX2Vycm9yKSB0aHJvdyBjYXVnaHRFcnJvcjtcbiAgICAgICAgICAgIGVsc2UgcmV0dXJuIGZvdW5kO1xuICAgICAgICB9XG4gICAgICAgIC8vIGlmIGxvb2tpbmcgZm9yIGluZGV4IGFuZCBub3QgZm91bmQsIHJldHVybiAtMVxuICAgICAgICBpZiAoYXJnSW5kZXggJiYgZWFjaE1ldGhvZCA9PSBBcnJheS5wcm90b3R5cGUuZm9yRWFjaClcbiAgICAgICAgICAgIHJldHVybiAtMTsgXG5cbiAgICAgICAgZnVuY3Rpb24gdGVzdEl0ZW0odmFsdWUsIGluZGV4LCBzZWxmKSB7XG4gICAgICAgICAgICB2YXIgdGVzdDtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdGVzdCA9IGNhbGxiYWNrLmNhbGwodGhpcywgdmFsdWUsIGluZGV4LCBzZWxmKTtcbiAgICAgICAgICAgIH0gY2F0Y2goZXJyKSB7XG4gICAgICAgICAgICAgICAgY2F1Z2h0RXJyb3IgPSBlcnI7XG4gICAgICAgICAgICAgICAgdGhyb3cgX2Vycm9yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRlc3QpXG4gICAgICAgICAgICAgICAgdGhyb3cgYXJndW1lbnRzW2FyZ0luZGV4XTtcbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ== +//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9ldmdlbnlwb2JlcmV6a2luL1dvcmsvQ0MvbWlsby9saWIvYWJzdHJhY3QvZmFjZXQu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vbnRleHRUeXBlID0gdHlwZW9mIHN1YnNjcmliZXIuY29udGV4dDtcbiAgICAgICAgICAgIGlmIChjb250ZXh0VHlwZSA9PSAnb2JqZWN0JylcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5vbihtZXNzYWdlcywgc3Vic2NyaWJlcik7XG5cbiAgICAgICAgICAgIGlmIChjb250ZXh0VHlwZSA9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmIChzdWJzY3JpYmVyLmNvbnRleHQgPT0gdGhpcy5uYW1lIHx8IHN1YnNjcmliZXIuY29udGV4dCA9PSAnZmFjZXQnKVxuICAgICAgICAgICAgICAgICAgICBzdWJzY3JpYmVyID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3Vic2NyaWJlcjogc3Vic2NyaWJlci5zdWJzY3JpYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dDogdGhpc1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN1YnNjcmliZXIuY29udGV4dCA9PSAnb3duZXInKVxuICAgICAgICAgICAgICAgICAgICBzdWJzY3JpYmVyID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3Vic2NyaWJlcjogc3Vic2NyaWJlci5zdWJzY3JpYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dDogdGhpcy5vd25lclxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bmtub3duIHN1YnNjcmliZXIgY29udGV4dCBpbiBjb25maWd1cmF0aW9uOiAnICsgc3Vic2NyaWJlci5jb250ZXh0KTtcblxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm9uKG1lc3NhZ2VzLCBzdWJzY3JpYmVyKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bm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9IGxpc3RGYWNldC5jb3VudCgpXG4gICAgICAgICAgICAgICAgICAgICwgbmV3SXRlbXNDb3VudCA9IHZhbHVlLmxlbmd0aCAtIGxpc3RMZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKG5ld0l0ZW1zQ291bnQgPj0gMykge1xuICAgICAgICAgICAgICAgICAgICBsaXN0RmFjZXQuX2FkZEl0ZW1zKG5ld0l0ZW1zQ291bnQpO1xuICAgICAgICAgICAgICAgICAgICBsaXN0RmFjZXQuX3VwZGF0ZURhdGFQYXRocyhsaXN0TGVuZ3RoLCBsaXN0RmFjZXQuY291bnQoKSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFsdWUuZm9yRWFjaChmdW5jdGlvbihjaGlsZFZhbHVlLCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICBzZXRDaGlsZERhdGEuY2FsbCh0aGlzLCB2YWx1ZVNldCwgY2hpbGRWYWx1ZSwgaW5kZXgsICdbJCRdJyk7XG4gICAgICAgICAgICAgICAgfSwgdGhpcyk7XG5cbiAgICAgICAgICAgICAgICB2YXIgbGlzdENvdW50ID0gbGlzdEZhY2V0LmNvdW50KClcbiAgICAgICAgICAgICAgICAgICAgLCByZW1vdmVDb3VudCA9IGxpc3RDb3VudCAtIHZhbHVlLmxlbmd0aDtcblxuICAgICAgICAgICAgICAgIHdoaWxlIChyZW1vdmVDb3VudC0tID4gMClcbiAgICAgICAgICAgICAgICAgICAgbGlzdEZhY2V0Ll9yZW1vdmVJdGVtKHZhbHVlLmxlbmd0aCk7XG4gICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICBsb2dnZXIud2FybignRGF0YTogc2V0dGluZyBhcnJheSBkYXRhIHdpdGhvdXQgTGlzdCBmYWNldCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWVTZXQgPSB7fTtcbiAgICAgICAgICAgIF8uZWFjaEtleSh2YWx1ZSwgZnVuY3Rpb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G5cbiAgICB0cmVlV2Fsa2VyLmN1cnJlbnROb2RlID0gZWw7XG4gICAgdmFyIG5leHROb2RlID0gdHJlZVdhbGtlcltmaW5kRGlyZWN0aW9uc1tkaXJlY3Rpb25dXSgpXG4gICAgICAgICwgY29tcG9uZW50c05hbWVzID0gT2JqZWN0LmtleXMoc2NvcGUpXG4gICAgICAgICwgZm91bmQgPSBmYWxzZTtcblxuICAgIHdoaWxlIChuZXh0Tm9kZSkge1xuICAgICAgICB2YXIgYXR0ciA9IG5ldyBCaW5kQXR0cmlidXRlKG5leHROb2RlKTtcbiAgICAgICAgaWYgKGF0dHIubm9kZSkge1xuICAgICAgICAgICAgYXR0ci5wYXJzZSgpLnZhbGlkYXRlKCk7XG4gICAgICAgICAgICBpZiAoc2NvcGUuaGFzT3duUHJvcGVydHkoYXR0ci5jb21wTmFtZSkpIHtcbiAgICAgICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gc2NvcGVbYXR0ci5jb21wTmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKCEgaXRlcmF0b3IgfHwgaXRlcmF0b3IoY29tcG9uZW50KSkge1xuICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0cmVlV2Fsa2VyLmN1cnJlbnROb2RlID0gbmV4dE5vZGU7XG4gICAgICAgIG5leHROb2RlID0gdHJlZVdhbGtlcltmaW5kRGlyZWN0aW9uc1tkaXJlY3Rpb25dXSgpO1xuICAgIH1cblxuICAgIGlmIChmb3VuZCkgcmV0dXJuIGNvbXBvbmVudDtcbn1cblxuXG4vLyByZXR1cm5zIHRydWUgaWYgdGhlIGVsZW1lbnQgaGFzIHRleHQgYmVmb3JlIHNlbGVjdGlvblxuZnVuY3Rpb24gaGFzVGV4dEJlZm9yZVNlbGVjdGlvbigpIHtcbiAgICB2YXIgc2V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q29tcHMpKVxuICAgICAgICAgICAgICAgICAgICAvLyBsaXN0IG9mIGFsbG93ZWQgY2xhc3Nlc1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWxsb3dDb21wcy5pbmRleE9mKG1ldGEgJiYgbWV0YS5jb21wQ2xhc3MpID49IDA7XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG1hcCBvZiBjbGFzczogYm9vbGVhbnx0ZXN0IGZ1bmN0aW9uXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ZXN0ID0gYWxsb3dDb21wc1ttZXRhICYmIG1ldGEuY29tcENsYXNzXTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICEhIF8ucmVzdWx0KHRlc3QsIHRoaXMub3duZXIsIG1ldGEsIGR0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSW5jb3JyZWN0IGFsbG93ZWQgY29tcG9uZW50cyBpbiBjb25maWcnKTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBkYXRhVHlwZXMgPSBhbGxvdyAmJiBhbGxvdy5kYXRhVHlwZXNcbiAgICAgICAgc3dpdGNoICh0eXBlb2YgZGF0YVR5cGVzKSB7XG4gICAgICAgICAgICBjYXNlICd1bmRlZmluZWQnOlxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIGNhc2UgJ3N0cmluZyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGR0LnR5cGVzLmluZGV4T2YoZGF0YVR5cGVzKSA+PSAwO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gVE9ETyB0ZXN0IGZvciBvdGhlciBkYXRhIHR5cGVzXG59XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBDb21wb25lbnRGYWNldCA9IHJlcXVpcmUoJy4uL2NfZmFjZXQ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b3VudCgpO1xuICAgICAgICB2YXIgc3BsaWNlSW5kZXggPSBpbmRleCA8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHR5cGVvZiBpbmRleCA9PSAndW5kZWZpbmVkJyB8fCBpbmRleCA+IGxpc3RMZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsaXN0TGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogaW5kZXg7XG5cbiAgICAgICAgdmFyIHByZXZDb21wb25lbnQgPSBzcGxpY2VJbmRleCA9PSAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGhpcy5pdGVtU2FtcGxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdGhpcy5fbGlzdEl0ZW1zW3NwbGljZUluZGV4IC0gMV07XG5cbiAgICAgICAgdmFyIGZyYWcgPSBkb2N1bWVudC5jcmVhdGVEb2N1bWVudEZyYWdtZW50KClcbiAgICAgICAgICAgICwgbmV3Q29tcG9uZW50cyA9IFtdO1xuXG4gICAgICAgIGNoaWxkcmVuLmZvckVhY2goZnVuY3Rpb24oZWwsIGkpIHtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSBDb21wb25lbnQuZ2V0Q29tcG9uZW50KGVsKTtcbiAgICAgICAgICAgIGlmICghIGNvbXBvbmVudClcbiAgICAgICAgICAgICAgICByZXR1cm4gbG9nZ2VyLmVycm9yKCdMaXN0OiBlbGVtZW50IGluIG5ldyBpdGVtcyBpcyBub3QgYSBjb21wb25lbnQnKTtcbiAgICAgICAgICAgIG5ld0NvbXBvbmVudHMucHVzaChjb21wb25lbnQpO1xuICAgICAgICAgICAgdGhpcy5fc2V0SXRlbShzcGxpY2VJbmRleCsrLCBjb21wb25lbnQpO1xuICAgICAgICAgICAgZnJhZy5hcHBlbmRDaGlsZChlbCk7XG4gICAgICAgICAgICBlbC5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BDb21wb25lbnRDbGFzcyA9IGNvbXBvbmVudHNSZWdpc3RyeS5nZXQoYXR0ci5jb21wQ2xhc3MpO1xuICAgIGlmICghIENvbXBvbmVudENsYXNzKVxuICAgICAgICByZXBvcnRCaW5kZXJFcnJvcih0aHJvd09uRXJyb3JzLCAnY2xhc3MgJyArIGF0dHIuY29tcENsYXNzICsgJyBpcyBub3QgcmVnaXN0ZXJlZCcpO1xuICAgIHJldHVybiBDb21wb25lbnRDbGFzcztcbn1cblxuXG5mdW5jdGlvbiBnZXRDb21wb25lbnRFeHRyYUZhY2V0cyhDb21wb25lbnRDbGFzcywgYXR0ciwgdGhyb3dPbkVycm9ycykge1xuICAgIHZhciBmYWNldHMgPSBhdHRyLmNvbXBGYWNldHNcbiAgICAgICAgLCBleHRyYUZhY2V0c0NsYXNzZXMgPSB7fTtcblxuICAgIGlmIChBcnJheS5pc0FycmF5KGZhY2V0cykpXG4gICAgICAgIGZhY2V0cy5mb3JFYWNoKGZ1bmN0aW9uKGZjdE5hbWUpIHtcbiAgICAgICAgICAgIGZjdE5hbWUgPSBfLmZpcnN0VXBwZXJDYXNlKGZjdE5hbWUpO1xuICAgICAgICAgICAgaWYgKENvbXBvbmVudENsYXNzLmhhc0ZhY2V0KGZjdE5hbWUpKVxuICAgICAgICAgICAgICAgIHJlcG9ydEJpbmRlckVycm9yKHRocm93T25FcnJvcnMsICdjbGFzcyAnICsgQ29tcG9uZW50Q2xhc3MubmFtZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICcgYWxyZWFkeSBoYXMgZmFjZXQgJyArIGZjdE5hbWUpO1xuICAgICAgICAgICAgaWYgKGV4dHJhRmFjZXRzQ2xhc3Nlc1tmY3ROYW1lXSlcbiAgICAgICAgICAgICAgICByZXBvcnRCaW5kZXJFcnJvcih0aHJvd09uRXJyb3JzLCAnY29tcG9uZW50ICcgKyBhdHRyLmNvbXBOYW1lXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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dWlyZSgnbWlsby1jb3JlJykucHJvdG87XG5cblxudmFyIENPTUJPX0NIQU5HRV9NRVNTQUdFID0gJ21sY29tYm9jaGFuZ2UnO1xuXG52YXIgREFUQUxJU1RfVEVNUExBVEUgPSAne3t+IGl0LmNvbWJvT3B0aW9ucyA6b3B0aW9uIH19IFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT1cInt7PSBvcHRpb24ubGFiZWwgfX1cIj48L29wdGlvbj4gXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICB7e359fSc7XG5cbnZhciBNTENvbWJvID0gQ29tcG9uZW50LmNyZWF0ZUNvbXBvbmVudENsYXNzKCdNTENvbWJvJywge1xuICAgIGV2ZW50czogdW5kZWZpbmVkLFxuICAgIGRhdGE6IHtcbiAgICAgICAgZ2V0OiBNTENvbWJvX2dldCxcbiAgICAgICAgc2V0OiBNTENvbWJvX3NldCxcbiAgICAgICAgZGVsOiBNTENvbWJvX2RlbCxcbiAgICAgICAgc3BsaWNlOiB1bmRlZmluZWQsXG4gICAgICAgIGV2ZW50OiBDT01CT19DSEFOR0VfTUVTU0FHRVxuICAgIH0sXG4gICAgbW9kZWw6IHtcbiAgICAgICAgbWVzc2FnZXM6IHtcbiAgICAgICAgICAgICcqKionOiB7IHN1YnNjcmliZXI6IG9uT3B0aW9uc0NoYW5nZSwgY29udGV4dDogJ293bmVyJyB9XG4gICAgICAgIH1cbiAgICB9LFxuICAgIGRvbToge1xuICAgICAgICBjbHM6ICdtbC11aS1kYXRhbGlzdCdcbiAgICB9LFxuICAgIGNvbnRhaW5lcjogdW5kZWZpbmVkXG59KTtcblxuY29tcG9uZW50c1JlZ2lzdHJ5LmFkZChNTENvbWJvKTtcblxubW9kdWxlLmV4cG9ydHMgPSBNTENvbWJvO1xuXG5cbl8uZXh0ZW5kUHJvdG8oTUxDb21ibywge1xuICAgIGluaXQ6IE1MQ29tYm8kaW5pdFxufSk7XG5cblxuZnVuY3Rpb24g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bnQgPSByZXF1aXJlKCcuLi9jX2NsYXNzJylcbiAgICAsIHVuaXF1ZUlkID0gcmVxdWlyZSgnLi4vLi4vdXRpbC91bmlxdWVfaWQnKTtcblxudmFyIFRSRUVfVEVNUExBVEUgPSAnPHVsIGNsYXNzPVwibWwtdWktZm9sZHRyZWUtbGlzdFwiPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7e34gaXQuZGF0YS5pdGVtcyA6aXRlbTppbmRleCB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3sgdmFyIGhhc1N1YlRyZWUgPSBpdGVtLml0ZW1zICYmIGl0ZW0uaXRlbXMubGVuZ3RoOyB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGxpIHt7PyBoYXNTdWJUcmVlIH19Y2xhc3M9XCJtbC11aS1mb2xkdHJlZS0taGFzLW11bHRpcGxlXCJ7ez99fT5cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwibWwtdWktZm9sZHRyZWUtaXRlbVwiPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ez8gaGFzU3ViVHJlZSB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cIm1sLXVpLWZvbGR0cmVlLWJ1dHRvblwiPjwvZGl2PlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ez99fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ez0gaXQuaXRlbVRlbXBsYXRlKHsgaXRlbTogaXRlbSwgaWQ6IGl0Lml0ZW1JRHNbaW5kZXhdIH0pIH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3s/IGhhc1N1YlRyZWUgfX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3s9IGl0LnRyZWVUZW1wbGF0ZShpdGVtKSB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7P319XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2xpPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7e359fVxcXG4gICAgICAgICAgICAgICAgICAgIDwvdWw+JztcblxudmFyIERFRkFVTFRfQ09NUElMRURfSVRFTV9URU1QTEFURSA9IGRvVC5jb21waWxlKCdcXFxuICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJtbC11aS1mb2xkdHJlZS1sYWJlbFwiIGRhdGEtaXRlbS1pZD1cInt7PSBpdC5pZCB9fVwiPlxcXG4gICAgICAgICAgICAgICAge3s9IGl0Lml0ZW0ubGFiZWwgfX1cXFxuICAgICAgICAgICAgPC9zcGFuPicpXG4gICAgLCBDT01QSUxFRF9UUkVFX1RFTVBMQVRFID0gZG9ULmNvbXBpbGUoVFJFRV9URU1QTEFURSk7XG5cblxudmFyIE1MRm9sZFRyZWUgPSBDb21wb25lbnQuY3JlYXRlQ29tcG9uZW50Q2xhc3MoJ01MRm9sZFRyZWUnLCB7XG4gICAgY29udGFpbmVyOiB1bmRlZmluZWQsXG4gICAgZXZlbnRzOiB7XG4gICAgICAgIG1lc3NhZ2VzOiB7XG4gICAgICAgICAgICAnY2xpY2sgZGJsY2xpY2snOiB7IHN1YnNjcmliZXI6IG9uSXRlbUV2ZW50LCBjb250ZXh0OiAnb3duZXInIH1cbiAgICAgICAgfVxuICAgIH0sXG4gICAgZG9tOiB7XG4gICAgICAgIGNsczogJ21sLXVpLWZvbGR0cmVlLW1haW4nXG4gICAgfVxufSk7XG5cbmNvbXBvbmVudHNSZWdpc3RyeS5hZGQoTUxGb2xkVHJlZSk7XG5cbm1vZHVsZS5leHBvcnRzID0gTUxGb2xkVHJlZTtcblxuXy5leHRlbmRQcm90byhNTEZvbGRUcmVlLCB7XG4gICAgc2V0SXRlbVRlbXBsYXRl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wb25lbnRzLCBjYWxsIHNldHVwIHN1Yi10YXNrc1xuICovXG5mdW5jdGlvbiBjb21wb25lbnRTZXR1cCgpIHtcbiAgICB2YXIgc2NvcGUgPSB0aGlzLmNvbnRhaW5lci5zY29wZTtcblxuICAgIF8uZGVmaW5lUHJvcGVydGllcyh0aGlzLCB7XG4gICAgICAgIF9jb21ib0lucHV0OiBzY29wZS5pbnB1dCxcbiAgICAgICAgX2NvbWJvTGlzdDogc2NvcGUubGlzdCxcbiAgICAgICAgX2NvbWJvT3B0aW9uczogc2NvcGUub3B0aW9ucyxcbiAgICAgICAgX2NvbWJvQmVmb3JlOiBzY29wZS5iZWZvcmUsXG4gICAgICAgIF9jb21ib0FmdGVyOiBzY29wZS5hZnRlcixcbiAgICAgICAgX2NvbWJvQWRkSXRlbURpdjogc2NvcGUuYWRkSXRlbURpdixcbiAgICAgICAgX2NvbWJvQWRkUHJvbXB0OiBzY29wZS5hZGRQcm9tcHQsXG4gICAgICAgIF9jb21ib0FkZEJ0bjogc2NvcGUuYWRkQnRuLFxuICAgICAgICBfb3B0aW9uVGVtcGxhdGU6IGRvVC5jb21waWxlKE9QVElPTlNfVEVNUExBVEUpXG4gICAgfSk7XG5cbiAgICBfLmRlZmluZVByb3BlcnRpZXModGhpcywge1xuICAgICAgICBfc3RhcnRJbmRleDogMCxcbiAgICAgICAgX2VuZEluZGV4OiBNQVhfUkVOREVSRUQsXG4gICAgICAgIF9oaWRkZW46IGZhbHNlLFxuICAgICAgICBfZWxlbWVudEhlaWdodDogREVGQVVMVF9FTEVNRU5UX0hFSUdIVCxcbiAgICAgICAgX3RvdGFsOiAwLFxuICAgICAgICBfb3B0aW9uc0hlaWdodDogMjAwLFxuICAgICAgICBfbGFzdFNjcm9sbFBvczogMCxcbiAgICAgICAgX2N1cnJlbnRWYWx1ZTogbnVsbCxcbiAgICAgICAgX3NlbGVjdGVkOiBudWxsLFxuICAgICAgICBfaXNBZGRCdXR0b25TaG93bjogZmFsc2VcbiAgICB9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ZycsICdtb2RhbCcsICdmYWRlJ10sXG4gICAgICAgIGF0dHJpYnV0ZXM6IHtcbiAgICAgICAgICAgICdyb2xlJzogJ2RpYWxvZycsXG4gICAgICAgICAgICAnYXJpYS1oaWRkZW4nOiAndHJ1ZSdcbiAgICAgICAgfVxuICAgIH0sXG4gICAgdGVtcGxhdGU6IHtcbiAgICAgICAgdGVtcGxhdGU6ICdcXFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cIm1vZGFsLWRpYWxvZyB7ez0gaXQuY3NzQ2xhc3MgfX1cIj5cXFxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJtb2RhbC1jb250ZW50XCI+XFxcbiAgICAgICAgICAgICAgICAgICAge3s/IGl0LnRpdGxlIH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJtb2RhbC1oZWFkZXJcIj5cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7PyBpdC5jbG9zZS5idXR0b24gfX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIG1sLWJpbmQ9XCJbZXZlbnRzXTpjbG9zZUJ0blwiIHR5cGU9XCJidXR0b25cIiBjbGFzcz1cImNsb3NlXCI+JnRpbWVzOzwvYnV0dG9uPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxoNCBjbGFzcz1cIm1vZGFsLXRpdGxlXCI+e3s9IGl0LnRpdGxlIH19PC9oND5cXFxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxcbiAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICB7ez8gaXQuaHRtbCB8fCBpdC50ZXh0IH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJtb2RhbC1ib2R5XCIgbWwtYmluZD1cIltjb250YWluZXJdOmRpYWxvZ0JvZHlcIj5cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7PyBpdC5odG1sIH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3s9IGl0Lmh0bWwgfX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7Pz99fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPnt7PSBpdC50ZXh0IH19PC9wPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxcbiAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgICAgICB7ez8gaXQuYnV0dG9ucyAmJiBpdC5idXR0b25zLmxlbmd0aCB9fVxcXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwibW9kYWwtZm9vdGVyXCI+XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e34gaXQuYnV0dG9ucyA6YnRuIH19XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCJcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJidG4gYnRuLXt7PSBidG4udHlwZSB9fXt7PyBidG4uY2xzIH19IHt7PSBidG4uY2xzIH19e3s/fX1cIlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtbC1iaW5kPVwiW2V2ZW50c106e3s9IGJ0bi5uYW1lIH19XCI+e3s9IGJ0bi5sYWJlbCB9fTwvYnV0dG9uPlxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3t+fX1cXFxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxcbiAgICAgICAgICAgICAgICAgICAge3s/fX1cXFxuICAgICAgICAgICAgICAgIDwvZGl2PlxcXG4gICAgICAgICAgICA8L2Rpdj4nXG4gICAgfVx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IG1lc3NhZ2VUaW1lc3RhbXA6ICdfX19taWxvX3RpbWVzdGFtcCcsXG4gICAgICAgIHF1b3RhRXhjZWVkZWQ6IHtcbiAgICAgICAgICAgIHRocm93RXJyb3I6IHRydWUsXG4gICAgICAgICAgICBtZXNzYWdlOiBmYWxzZVxuICAgICAgICB9XG4gICAgfSxcbiAgICBkcmFnRHJvcDoge1xuICAgICAgICBkYXRhVHlwZXM6IHtcbiAgICAgICAgICAgIGNvbXBvbmVudDogJ3gtYXBwbGljYXRpb24vbWlsby9jb21wb25lbnQnLFxuICAgICAgICAgICAgY29tcG9uZW50TWV0YVRlbXBsYXRlOiAneC1hcHBsaWNhdGlvbi9taWxvL2NvbXBvbmVudC1tZXRhLyVjbGFzcy8lbmFtZS8lcGFyYW1zJyxcbiAgICAgICAgICAgIGNvbXBvbmVudE1ldGFSZWdleDogL154XFwtYXBwbGljYXRpb25cXC9taWxvXFwvY29tcG9uZW50XFwtbWV0YVxcLyhbYS16MC05XSspXFwvKFthLXowLTldKylcXC8oW2EtejAtOV0qKSQvLFxuICAgICAgICB9XG4gICAgfSxcbiAgICByZXF1ZXN0OiB7XG4gICAgICAgIGpzb25wVGltZW91dDogNjAwMDAsXG4gICAgICAgIGpzb25wQ2FsbGJhY2tQcmVmaXg6ICdfX19taWxvX2NhbGxiYWNrXycsXG4gICAgICAgIG9wdGlvbnNLZXk6ICdfX19taWxvX29wdGlvbnMnLFxuICAgICAgICBkZWZhdWx0czoge1xuICAgICAgICAgICAgdGltZW91dDogNjAwMDBcbiAgICAgICAgfVxuICAgIH0sXG4gICAgd2Vic29ja2V0OiB7XG4gICAgICAgIHJwYzoge1xuICAgICAgICAgICAgdGltZW91dDogMTUwMDAsXG4gICAgICAgICAgICByZXNwb25zZVByZWZpeDogJ3Jlc3BvbnNlXydcbiAgICAgICAgfVxuICAgIH0sXG4gICAgZGVwcmVjYXRpb25XYXJuaW5nOiAnb25jZSdcbn0pO1xuIiwiJ3VzZSBzdHJpY3QnO1xu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dHJ5IHtcbiAgICAgICAgICAgICAgICBwb3N0TWVzc2FnZSgnc3VjY2VzcycpO1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrICYmIGNhbGxiYWNrKG51bGwsIHJlcS5yZXNwb25zZVRleHQsIHJlcSk7XG4gICAgICAgICAgICB9IGNhdGNoKGUpIHsgZXJyb3IgPSBlOyB9XG4gICAgICAgICAgICB4UHJvbWlzZS5yZXNvbHZlKHJlcS5yZXNwb25zZVRleHQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdmFyIGVycm9yUmVhc29uID0gcmVxLnN0YXR1cyB8fCBldmVudFR5cGU7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHBvc3RNZXNzYWdlKCdlcnJvcicpO1xuICAgICAgICAgICAgICAgIHBvc3RNZXNzYWdlKCdlcnJvcicgKyBlcnJvclJlYXNvbik7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2sgJiYgY2FsbGJhY2soZXJyb3JSZWFzb24sIHJlcS5yZXNwb25zZVRleHQsIHJlcSk7XG4gICAgICAgICAgICB9IGNhdGNoKGUpIHsgZXJyb3IgPSBlOyB9XG4gICAgICAgICAgICB4UHJvbWlzZS5yZWplY3QoeyByZWFzb246IGVycm9yUmVhc29uLCByZXNwb25zZTogcmVxLnJlc3BvbnNlVGV4dCB9KTtcbiAgICAgICAgfVxuICAgIH0gY2F0Y2goZSkge1xuICAgICAgICBlcnJvciA9IGVycm9yIHx8IGU7XG4gICAgfVxuXG4gICAgLy8gbm90IHJlbW92aW5nIHN1YnNjcmlwdGlvbiBjcmVhdGVzIG1lbW9yeSBsZWFrLCBkZWxldGluZyBwcm9wZXJ0eSB3b3VsZCBub3QgcmVtb3ZlIHN1YnNjcmlwdGlvblxuICAgIHJlcS5vbnJlYWR5c3RhdGVjaGFuZ2UgPSByZXEub250aW1lb3V0ID0gcmVxLm9uYWJvcnQgPSB1bmRlZmluZWQ7XG5cbiAgICBpZiA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BhbiBpbnRcbiAgICAgICAgaWYgKHR5cGVvZiBieXRlID09ICdzdHJpbmcnKSBieXRlID0gYnl0ZS5jaGFyQ29kZUF0KDApXG5cbiAgICAgICAgaWYgKHNraXAgPCAwKSB7IC8vIHdlIGhhdmUgYSBjYXJyeSBmcm9tIHRoZSBwcmV2aW91cyBieXRlXG4gICAgICAgICAgICBiaXRzIHw9IChieXRlID4+ICgtc2tpcCkpXG4gICAgICAgIH0gZWxzZSB7IC8vIG5vIGNhcnJ5XG4gICAgICAgICAgICBiaXRzID0gKGJ5dGUgPDwgc2tpcCkgJiAyNDhcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChza2lwID4gMykge1xuICAgICAgICAgICAgLy8gbm90IGVub3VnaCBkYXRhIHRvIHByb2R1Y2UgYSBjaGFyYWN0ZXIsIGdldCB1cyBhbm90aGVyIG9uZVxuICAgICAgICAgICAgc2tpcCAtPSA4XG4gICAgICAgICAgICByZXR1cm4gMVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNraXAgPCA0KSB7XG4gICAgICAgICAgICAvLyBwcm9kdWNlIGEgY2hhcmFjdGVyXG4gICAgICAgICAgICB0aGlzLm91dHB1dCArPSBhbHBoYWJldFtiaXRzID4+IDNdXG4gICAgICAgICAgICBza2lwICs9IDVcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAwXG4gICAgfVxuXG4gICAgLy8gRmx1c2ggYW55IHJlbWFpbmluZyBiaXRzIGxlZnQgaW4gdGhlIHN0cmVhbVxuICAgIHRoaXMuZmluaXNoID0gZnVuY3Rpb24oY2hlY2spIHtcbiAgICAgICAgdmFyIG91dHB1dCA9IHRoaXMub3V0cHV0ICsgKHNraXAgPCAwID8gYWxwaGFiZXRbYml0cyA+PiAzXSA6ICcnKSArIChjaGVjayA/ICckJyA6ICcnKVxuICAgICAgICB0aGlzLm91dHB1dCA9ICcnXG4gICAgICAgIHJldHVybiBvdXRwdXRcbiAgICB9XG59XG5cbi8qKlxuICogUHJv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xuICAgICAgICAgICAgYmF0Y2guY2hhbmdlcy5mb3JFYWNoKGZ1bmN0aW9uKGNoYW5nZSkge1xuICAgICAgICAgICAgICAgIHZhciBzb3VyY2VQYXRoID0gY2hhbmdlLnBhdGhcbiAgICAgICAgICAgICAgICAgICAgLCB0YXJnZXRQYXRoID0gdHJhbnNsYXRlUGF0aChzb3VyY2VQYXRoKTtcblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGFyZ2V0UGF0aCA9PSAndW5kZWZpbmVkJykgcmV0dXJuO1xuXG4gICAgICAgICAgICAgICAgdmFyIGNoYW5nZSA9IF8uY2xvbmUoY2hhbmdlKTtcbiAgICAgICAgICAgICAgICBfLmV4dGVuZChjaGFuZ2UsIHtcbiAgICAgICAgICAgICAgICAgICAgc291cmNlOiBmcm9tRFMsXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IHRhcmdldFBhdGhcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHRyYW5zbGF0ZURhdGEoc291cmNlUGF0aCwgY2hhbmdlKTtcbiAgICAgICAgICAgICAgICB2YWxpZGF0ZURhdGEoc291cmNlUGF0aCwgY2hhbmdlKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBpZiAoISBjaGFuZ2VzUXVldWUubGVuZ3RoKVxuICAgICAgICAgICAgICAgIF8uZGVmZXIocG9zdENoYW5nZURhdGEpO1xuXG4gICAgICAgICAgICBjaGFuZ2VzUXVldWUucHVzaChzZW5kRGF0YSk7XG5cblxuICAgICAgICAgICAgZnVuY3Rpb24gdHJhbnNsYXRlUGF0aChzb3VyY2VQYXRoKSB7XG4gICAgICAgICAgICAgICAgaWYgKHBhdGhUcmFuc2xhdGlvbikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHJhbnNsYXRlZFBhdGggPSBwYXRoVHJhbnNsYXRpb25bc291cmNlUGF0aF07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2xhdGVkUGF0aCkgcmV0dXJuIHRyYW5zbGF0ZWRQYXRoO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXBhdHRlcm5UcmFuc2xhdGlvbi5sZW5ndGgpIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB0ID0gXy5maW5kKHBhdHRlcm5UcmFuc2xhdGlvbiwgZnVuY3Rpb24ocFRyYW5zbGF0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcFRyYW5zbGF0aW9uLmZyb21QYXR0ZXJuLnRlc3Qoc291cmNlUGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXB0KSByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIHZhciB0cmFuc2xhdGVkUGF0aCA9IHNvdXJjZVBhdGgucmVwbGFjZShwdC5mcm9tU3RhdGljUGF0aCwgcHQudG9TdGF0aWNQYXRoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCEgKChzdWJzY3JpcHRpb25QYXR0ZXJuIGluc3RhbmNlb2YgUmVnRXhwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdWJzY3JpcHRpb25QYXR0ZXJuLnRlc3Qoc291cmNlUGF0aCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBzdWJzY3JpcHRpb25QYXR0ZXJuID09IHNvdXJjZVBhdGgpKSByZXR1cm47XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNsYXRlZFBhdGggfHwgc291cmNlUGF0aDtcbiAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICBmdW5jdGlvbiB0cmFuc2xhdGVEYXRhKHNvdXJjZVBhdGgsIGNoYW5nZSkge1xuICAgICAgICAgICAgICAgIGlmIChkYXRhVHJhbnNsYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRyYW5zbGF0ZSA9IGRhdGFUcmFuc2xhdGlvbltzb3VyY2VQYXRoXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zbGF0ZSAmJiB0eXBlb2YgdHJhbnNsYXRlID09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5nZS5vbGRWYWx1ZSA9IHRyYW5zbGF0ZShjaGFuZ2Uub2xkVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlLm5ld1ZhbHVlID0gdHJhbnNsYXRlKGNoYW5nZS5uZXdWYWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBcbiAgICAgICAgICAgIGZ1bmN0aW9uIHZhbGlkYXRlRGF0YShzb3VyY2VQYXRoLCBjaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICBwcm9wYWdhdGVEYXRhKGNoYW5nZSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoZGF0YVZhbGlkYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZhbGlkYXRvcnMgPSBkYXRhVmFsaWRhdGlvbltzb3VyY2VQYXRoXVxuICAgICAgICAgICAgICAgICAgICAgICAgLCBwYXNzZWRDb3VudCA9IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICwgYWxyZWFkeUZhaWxlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZGF0b3JzKVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9ycy5mb3JFYWNoKGNhbGxWYWxpZGF0b3IpOyAgIFxuICAgICAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gY2FsbFZhbGlkYXRvcih2YWxpZGF0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yKGNoYW5nZS5uZXdWYWx1ZSwgZnVuY3Rpb24oZXJyLCByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UucGF0aCA9IHNvdXJjZVBhdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISBhbHJlYWR5RmFpbGVkICYmIChlcnIgfHwgcmVzcG9uc2UudmFsaWQpICYmICsrcGFzc2VkQ291bnQgPT0gdmFsaWRhdG9ycy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tRFMucG9zdE1lc3NhZ2UoJ3ZhbGlkYXRlZCcsIHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoISByZXNwb25zZS52YWxpZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscmVhZHlGYWlsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb21EUy5wb3N0TWVzc2FnZSgndmFsaWRhdGVkJywgcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgZnVuY3Rpb24gcHJvcGFnYXRlRGF0YShjaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICBzZW5kRGF0YS5jaGFuZ2VzLnB1c2goY2hhbmdlKTtcbiAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICBmdW5jdGlvbiBwb3N0Q2hhbmdlRGF0YSgpIHtcbiAgICAgICAgICAgICAgICAvLyBwcmV2ZW50IGVuZGxlc3MgbG9vcCBvZiB1cGRhdGVzIGZvciAyLXdheSBjb25uZWN0aW9uXG4gICAgICAgICAgICAgICAgaWYgKHNlbGZbcmV2ZXJzZUxpbmtdKSB2YXIgY2FsbGJhY2sgPSBzdWJzY3JpcHRpb25Td2l0Y2g7XG5cbiAgICAgICAgICAgICAgICB2YXIgdHJhbnNhY3Rpb25zID0gbWVyZ2VUcmFuc2FjdGlvb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ICAgICAgLCBjdXJyZW50VHJhbnNhY3Rpb247XG5cbiAgICAgICAgICAgICAgICBiYXRjaGVzLmZvckVhY2goZnVuY3Rpb24oYmF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgYmF0Y2gudHJhbnNhY3Rpb24pIGN1cnJlbnRUcmFuc2FjdGlvbiA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgYmF0Y2guY2hhbmdlcy5sZW5ndGgpIHJldHVybjtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoYmF0Y2gudHJhbnNhY3Rpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50VHJhbnNhY3Rpb24pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5hcHBlbmRBcnJheShjdXJyZW50VHJhbnNhY3Rpb24sIGJhdGNoLmNoYW5nZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFRyYW5zYWN0aW9uID0gXy5jbG9uZShiYXRjaC5jaGFuZ2VzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbnMucHVzaChjdXJyZW50VHJhbnNhY3Rpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9ucy5wdXNoKGJhdGNoLmNoYW5nZXMpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRyYW5zYWN0aW9ucztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cblxuXG4vKipcbiAqIHR1cm5PZmZcbiAqIE1ldGhvZCBvZiBDb25uZWN0b3IgdGhhdCBkaXNhYmxlcyBjb25uZWN0aW9uIChpZiBpdCB3YXMgcHJldmlvdX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gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlQYXRoU3ludGF4LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5SW50ZXJwb2xhdGVTeW50YXgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlJbnRlcnBvbGF0ZVN5bnRheFxuICAgICAgICAgICAgICAgICAgICAgICAgXS5qb2luKCd8JylcbiAgICAsIHBhdGhQYXJzZVBhdHRlcm4gPSBuZXcgUmVnRXhwKHBhdGhQYXJzZVN5bnRheCwgJ2cnKVxuXG4gICAgLCBwYXR0ZXJuUGF0aFBhcnNlU3ludGF4ID0gIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhQYXJzZVN5bnRheCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5U3RhclN5bnRheCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycmF5U3RhclN5bnRheCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJTeW50YXhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXS5qb2luKCd8JylcbiAgICAsIHBhdHRlcm5QYXRoUGFyc2VQYXR0ZXJuID0gbmV3IFJlZ0V4cChwYXR0ZXJuUGF0aFBhcnNlU3ludGF4LCAnZycpXG5cbiAgICAvLywgdGFyZ2V0UGF0aFBhcnNlUGF0dGVybiA9IC9cXC5bQS1aYS16XVtBLVphLXowLTlfXSp8XFxbWzAtOV0rXFxdfFxcLlxcJFsxLTldWzAtOV0qfFxcW1xcJFsxLTldWzAtOV0qXFxdfFxcJFsxLTldWzAtOV0vZ1xuICAgICwgcGF0aE5vZGVUeXBlcyA9IHtcbiAgICAgICAgJy4nOiB7IHN5bnRheDogJ29iamVjdCcsIGVtcHR5OiAne30nIH0sXG4gICAgICAgICdbJzogeyBzeW50YXg6ICdhcnJheScsIGVtcHR5OiAnW10nfSx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3s/IG5leHROb2RlIH19XFxuICAgICAgICAgICAge3tcXG4gICAgICAgICAgICAgICAgdmFyIGN1cnJOb2RlID0gbmV4dE5vZGU7XFxuICAgICAgICAgICAgICAgIHZhciBjdXJyUHJvcCA9IGN1cnJOb2RlLnByb3BlcnR5O1xcbiAgICAgICAgICAgICAgICB2YXIgZW1wdHlQcm9wID0gJ1tdJztcXG4gICAgICAgICAgICB9fVxcblxcbiAgICAgICAgICAgIHt7IyBkZWYuY3JlYXRlVHJlZVN0ZXAgfX1cXG4gICAgICAgIHt7P319XFxuXFxuICAgIH0gZWxzZSBpZiAoc3BsaWNlSG93TWFueSA+IDApIHtcXG4gICAgICAgIHt7IC8qIGlmIGl0ZW1zIGFyZSBub3QgaW5zZXJ0ZWQsIG9ubHkgdHJhdmVyc2UgbW9kZWwgdHJlZSBpZiBpdGVtcyBhcmUgZGVsZXRlZCBmcm9tIGFycmF5ICovIH19XFxuICAgICAgICB7ez8gaXQucGFyc2VkUGF0aC5sZW5ndGggfX1cXG4gICAgICAgICAgICB7eyMgZGVmLnRyYXZlcnNlVHJlZSB9fVxcblxcbiAgICAgICAgICAgIHt7XFxuICAgICAgICAgICAgICAgIHZhciBjdXJyTm9kZSA9IGl0LnBhcnNlZFBhdGhbY291bnRdO1xcbiAgICAgICAgICAgICAgICB2YXIgY3VyclByb3AgPSBjdXJyTm9kZS5wcm9wZXJ0eTsgICAgICAgXFxuICAgICAgICAgICAgfX1cXG5cXG4gICAgICAgICAgICB7eyAvKiBleHRyYSBicmFjZSBjbG9zZXMgJ2Vsc2UnIGluIGRlZi50cmF2ZXJzZVRyZWVTdGVwICovIH19XFxuICAgICAgICAgICAge3sjIGRlZi50cmF2ZXJzZVRyZWVTdGVwIH19IH1cXG4gICAgICAgIHt7P319XFxuICAgIH1cXG5cXG4gICAge3sgLyogc3BsaWNlIGl0ZW1zICovIH19XFxuICAgIGlmIChhZGRJdGVtcyB8fCAoISB0cmVlRG9lc05vdEV4aXN0ICYmIG1cXG4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heShvYmopKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGhTeW50YXggPSByb290UGF0aCArICdbJCRdJztcbiAgICAgICAgICAgICAgICBvYmouZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgYWRkTWVzc2FnZSh2YWx1ZSwgaW5kZXgsIHBhdGhTeW50YXgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgcGF0aFN5bnRheCA9IHJvb3RQYXRoICsgJy4kJCc7XG4gICAgICAgICAgICAgICAgXy5lYWNoS2V5KG9iaiwgZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgICAgICAgICAgICAgICAgICBhZGRNZXNzYWdlKHZhbHVlLCBrZXksIHBhdGhTeW50YXgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gYWRkTWVzc2FnZSh2YWx1ZSwga2V5LCBwYXRoU3ludGF4KSB7XG4gICAgICAgICAgICB2YXIgcGF0aCA9IHBhdGhTeW50YXgucmVwbGFjZSgnJCQnLCBrZXkpXG4gICAgICAgICAgICAgICAgLCBleGlzdGluZ01zZyA9IG1lc3NhZ2VzSGFzaFtwYXRoXTtcblxuICAgICAgICAgICAgaWYgKGV4aXN0aW5nTXNnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGV4aXN0aW5nTXNnLnR5cGUgPT0gbXNnVHlwZSlcbiAgICAgICAgICAgICAgICAgICAgbG9nZ2VyLmVycm9yKCdzZXR0ZXIgZXJyb3I6IHNhbWUgbWVzc2FnZSB0eXBlIHBvc3RlZCBvbiB0aGUgc2FtZSBwYXRoJyk7XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGV4aXN0aW5nTXNnLnR5cGUgPSAnY2hhbmdlZCc7XG4gICAgICAg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RXhwZWN0ZWQgb2JqZWN0LCBnb3QgbnVsbFwiKTtcblxuICAgIHZhciByZXF1aXJlZFBhdHRlcm5zID0ge307XG4gICAgdmFyIG9wdGlvbmFsUGF0dGVybnMgPSB7fTtcblxuICAgIF8uZWFjaEtleShwYXR0ZXJuLCBmdW5jdGlvbihzdWJQYXR0ZXJuLCBrZXkpIHtcbiAgICAgICAgaWYgKHBhdHRlcm5ba2V5XSBpbnN0YW5jZW9mIE9wdGlvbmFsKVxuICAgICAgICAgICAgb3B0aW9uYWxQYXR0ZXJuc1trZXldID0gcGF0dGVybltrZXldLnBhdHRlcm47XG4gICAgICAgIGVsc2VcbiAgICAgICAgICAgIHJlcXVpcmVkUGF0dGVybnNba2V5XSA9IHBhdHRlcm5ba2V5XTtcbiAgICB9LCB0aGlzLCB0cnVlKTtcblxuICAgIF8uZWFjaEtleSh2YWx1ZSwgZnVuY3Rpb24oc3ViVmFsdWUsIGtleSkge1xuICAgICAgICB2YXIgc3ViVmFsdWUgPSB2YWx1ZVtrZXldO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgaWYgKHJlcXVpcmVkUGF0dGVybnMuaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgICAgICAgICAgIGNoZWNrU3VidHJlZShzdWJWYWx1ZSwgcmVxdWlyZWRQYXR0ZXJuc1trZXldKTtcbiAgICAgICAgICAgICAgICBkZWxldGUgcmVxdWlyZWRQYXR0ZXJuc1trZXldO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcHRpb25hbFBhdHRlcm5zLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgICBjaGVja1N1YnRyZWUoc3ViVmFsdWUsIG9wdGlvbmFsUGF0dGVybnNba2V5XSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghdW5rbm93bktleXNBbGxvd2VkKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTWF0Y2guRXJyb3Io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UX09QVElPTlMpO1xuICAgIF8uZXh0ZW5kKHRoaXMsIG9wdHMgfHwge30pO1xufTtcblxuXG4vKipcbiAqIExvZyBtZXRob2QuXG4gKlxuICogQGFwaSBwdWJsaWNcbiAqL1xuXG5Mb2dnZXIucHJvdG90eXBlLmxvZyA9IGZ1bmN0aW9uICh0eXBlKSB7XG4gICAgdmFyIGluZGV4ID0gbGV2ZWxzLmluZGV4T2YodHlwZSk7XG5cbiAgICBpZiAoISB0aGlzLmVuYWJsZWQgfHwgaW5kZXggPiB0aGlzLmxldmVsKVxuICAgICAgICByZXR1cm4gdGhpcztcblxuICAgIHZhciBhcmdzID0gXy5zbGljZShhcmd1bWVudHMsIDEpO1xuXG4gICAgaWYgKGluZGV4IDw9IHRoaXMudGhyb3dMZXZlbClcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFt0aGlzLmxvZ1ByZWZpeCwgdHlwZSArICc6J10uY29uY2F0KGFyZ3MpLmpvaW4oJyAnKSk7XG5cbiAgICBjb25zb2xlLmxvZy5hcHBseShcbiAgICAgICAgICBjb25zb2xlXG4gICAgICAgICwgWyB0aGlzLmxvZ1ByZWZpeENvbG9yXG4gICAgICAgICAgICAgID8gJyAgICcgKyBjb2xvcmVkKHRoaXMubG9nUHJlZml4LCB0aGlzLmxvZ1ByZWZpeENvbG9yKVxuICAgICAgICAgICAgICA6IHRoaXMubG9nUHJlZml4LFxuICAgICAgICAgICAgKHRoaXMuY29sb3JzXG4gICAgICAgICAgICAgID8gJyAnICsgY29sb3JlZChwYWQodHlwZSksIGNvbG9yc1tpbmRleF0pXG4gICAgICAgICAgICAgIDogdHlwZSkgKyAnOidcbiAgICAgICAgICBdLmNvbmNhdChhcmdzKVxuICAgICk7XG5cbiAgICByZXR1cm4gdGhpcztcbn07XG5cbi8qKlxuICogR2VuZXJhdGUgbWV0aG9kcy5cbiAqL1xuXG5sZXZlbHMuZm9yRWFjaChmdW5jdGlvbiAobmFtZSkge1xuICAgIExvZ2dlci5wcm90b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B0aGlzOyAvLyBmaXJzdCBwYXJhbWV0ZXIgb2YgXy50aHJvdHRsZVxuICAgIHZhciBjb250ZXh0LCBhcmdzLCByZXN1bHQ7XG4gICAgdmFyIHRpbWVvdXQgPSBudWxsO1xuICAgIHZhciBwcmV2aW91cyA9IDA7XG4gICAgb3B0aW9ucyB8fCAob3B0aW9ucyA9IHt9KTtcblxuICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIG5vdyA9IERhdGUubm93KCk7XG4gICAgICAgIGlmICghcHJldmlvdXMgJiYgb3B0aW9ucy5sZWFkaW5nID09PSBmYWxzZSkgcHJldmlvdXMgPSBub3c7XG4gICAgICAgIHZhciByZW1haW5pbmcgPSB3YWl0IC0gKG5vdyAtIHByZXZpb3VzKTtcbiAgICAgICAgY29udGV4dCA9IHRoaXM7XG4gICAgICAgIGFyZ3MgPSBhcmd1bWVudHM7XG4gICAgICAgIGlmIChyZW1haW5pbmcgPD0gMCkge1xuICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRpbWVvdXQpO1xuICAgICAgICAgICAgdGltZW91dCA9IG51bGw7XG4gICAgICAgICAgICBwcmV2aW91cyA9IG5vdztcbiAgICAgICAgICAgIHJlc3VsdCA9IGZ1bmMuYXBwbHkoY29udGV4dCwgYXJncyk7XG4gICAgICAgIH0gZWxzZSBpZiAoIXRpbWVvdXQgJiYgb3B0aW9ucy50cmFpbGluZyAhPT0gZmFsc2UpXG4gICAgICAgICAgICB0aW1lb3V0ID0gc2V0VGltZW91dChsYXRlciwgcmVtYWluaW5nKTtcblxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBsYXRlcigpIHtcbiAgICAgICAgcHJldmlvdXMgPSBvcHRpb25zLmxlYWRpbmcgPT09IGZhbHNlID8gMCA6IERhdGUubm93KCk7XG4gICAgICAgIHRpbWVvdXQgPSBudWxsO1xuICAgICAgICByZXN1bHQgPSBmdW5jLmFwcGx5KGNv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ICAgICAgIC8vIGlmIGxvb2tpbmcgZm9yIGluZGV4IGFuZCBub3QgZm91bmQsIHJldHVybiAtMVxuICAgICAgICBpZiAoYXJnSW5kZXggJiYgZWFjaE1ldGhvZCA9PSBBcnJheS5wcm90b3R5cGUuZm9yRWFjaClcbiAgICAgICAgICAgIHJldHVybiAtMTsgXG5cbiAgICAgICAgZnVuY3Rpb24gdGVzdEl0ZW0odmFsdWUsIGluZGV4LCBzZWxmKSB7XG4gICAgICAgICAgICB2YXIgdGVzdDtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdGVzdCA9IGNhbGxiYWNrLmNhbGwodGhpcywgdmFsdWUsIGluZGV4LCBzZWxmKTtcbiAgICAgICAgICAgIH0gY2F0Y2goZXJyKSB7XG4gICAgICAgICAgICAgICAgY2F1Z2h0RXJyb3IgPSBlcnI7XG4gICAgICAgICAgICAgICAgdGhyb3cgX2Vycm9yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRlc3QpXG4gICAgICAgICAgICAgICAgdGhyb3cgYXJndW1lbnRzW2FyZ0luZGV4XTtcbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ== ; \ No newline at end of file diff --git a/milo.bundle.map b/milo.bundle.map index 9788e14..6721b79 100644 --- a/milo.bundle.map +++ b/milo.bundle.map @@ -134,7 +134,7 @@ "/Users/evgenypoberezkin/Work/CC/milo/node_modules/milo-core/node_modules/mol-proto/lib/utils.js" ], "names": [], - "mappings": ";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnMA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACznBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", + "mappings": ";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnMA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACznBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ @@ -157,7 +157,7 @@ "'use strict';\n\n\nvar ComponentFacet = require('../c_facet')\n , miloBinder = require('../../binder')\n , Scope = require('../scope')\n , miloCore = require('milo-core')\n , _ = miloCore.proto\n , logger = miloCore.util.logger\n , facetsRegistry = require('./cf_registry')\n , domUtils = require('../../util/dom');\n\n\n/**\n * `milo.registry.facets.get('Container')`\n * A special component facet that makes component create its own inner scope.\n * When [milo.binder](../../binder.js.html) binds DOM tree and creates components, if components are inside component WITH Container facet, they are put on the `scope` of it (component.container.scope - see [Scope](../scope.js.html)), otherwise they are put on the same scope even though they may be deeper in DOM tree.\n * It allows creating namespaces avoiding components names conflicts, at the same time creating more shallow components tree than the DOM tree.\n * To create components for elements inside the current component use:\n * ```\n * component.container.binder();\n * ```\n * See [milo.binder](../../binder.js.html)\n */\nvar Container = _.createSubclass(ComponentFacet, 'Container');\n\n\n/**\n * ####Container facet instance methods####\n *\n * - [binder](#Container$binder) - create components from DOM inside the current one\n */\n_.extendProto(Container, {\n start: Container$start,\n path: Container$path,\n getState: Container$getState,\n setState: Container$setState,\n binder: Container$binder,\n destroy: Container$destroy,\n unwrap: Container$unwrap,\n\n append: Container$append,\n insertBefore: Container$insertBefore,\n remove: Container$remove\n});\n\nfacetsRegistry.add(Container);\n\nmodule.exports = Container;\n\n\n/**\n * Container instance method.\n * Scans DOM, creates components and adds to scope children of component element.\n */\nfunction Container$binder() {\n return miloBinder(this.owner.el, this.scope, false);\n}\n\n\n/**\n * Container instance method.\n * Setup empty scope object on start\n */\nfunction Container$start() {\n ComponentFacet.prototype.start.apply(this, arguments);\n this.scope = new Scope(this.owner.el, this);\n}\n\n\nvar allowedNamePattern = /^[A-Za-z][A-Za-z0-9\\_\\$]*$/;\n/**\n * Container instance method.\n * Safely traverses component scope\n * Returns component in scope for a given path\n * If path is invalid the method will throw, if there is no component at a given path or some of the components along the path does not have Container facet the method will return undefined, \n * \n * @param {String} path path of child component in scope, each name should be prefixed with '.', e.g.: '.child.subchild'\n * @return {Component}\n */\nfunction Container$path(path) {\n path = path.split('.');\n var len = path.length;\n if (path[0] || len < 2) throwInvalidPath();\n var comp = this.owner;\n for (var i = 1; i < len; i++) {\n var name = path[i];\n if (!allowedNamePattern.test(name)) throwInvalidPath();\n if (!comp.container) return;\n comp = comp.container.scope[name];\n if (!comp) return;\n }\n return comp;\n\n function throwInvalidPath() {\n throw new Error('path ' + path + ' is invalid');\n }\n}\n\n\n/**\n * Container instance method\n * Called by `Component.prototype.getState` to get facet's state\n * Returns the state of components in the scope\n *\n * @param {Boolean} deepCopy true by default\n * @return {Object}\n */\nfunction Container$getState(deepCopy) {\n var state = { scope: {} };\n if (deepCopy !== false)\n this.scope._each(function(component, compName) {\n state.scope[compName] = component._getState();\n });\n return state;\n}\n\n\n/**\n * Container instance method\n * Called by `Component.prototype.setState` to set facet's state\n * Sets the state of components in the scope\n *\n * @param {Object} data data to set on facet's model\n */\nfunction Container$setState(state) {\n _.eachKey(state.scope, function(compData, compName) {\n var component = this.scope[compName];\n if (component)\n component.setState(compData);\n else\n logger.warn('component \"' + compName + '\" does not exist on scope');\n }, this);\n}\n\nfunction Container$destroy() {\n this.scope._each(function(component) {\n component.destroy();\n });\n this.scope._detachElement();\n ComponentFacet.prototype.destroy.apply(this, arguments);\n}\n\n\n/**\n * Container instance method\n * Moves all of the contents of the owner into the parent scope\n * \n * @param {Boolean} renameChildren pass false to not rename scope children (default is true)\n * @param {Boolean} destroy If not false, the component will be destroyed at the end (default is true).\n */\nfunction Container$unwrap(renameChildren, destroy) {\n domUtils.unwrapElement(this.owner.el);\n this.scope && this.scope._each(function (child) {\n child.remove();\n if (renameChildren !== false) child.rename(undefined, false);\n this.owner.scope && this.owner.scope._add(child);\n }, this);\n if (destroy !== false) this.owner.destroy();\n}\n\n\n/**\n * Container instance method\n * Append component to DOM and to scope\n * @param {Component} comp component that will be appended\n */\nfunction Container$append(comp) {\n this.scope._add(comp);\n this.owner.el.appendChild(comp.el);\n}\n\n\n/**\n * Container instance method\n * Insert component to DOM and to scope before another component\n * @param {Component} comp component that will be inserted\n * @param {Component} sibling component before which component will be appended\n */\nfunction Container$insertBefore(comp, sibling) {\n this.scope._add(comp);\n this.el.insertBefore(comp.el, sibling && sibling.el);\n}\n\nfunction Container$remove(comp) {\n this.scope._remove(comp);\n this.owner.el.removeChild(comp.el);\n}\n", "'use strict';\n\nvar miloCore = require('milo-core')\n , Mixin = miloCore.classes.Mixin\n , ComponentFacet = require('../c_facet')\n , facetsRegistry = require('./cf_registry')\n\n , Messenger = miloCore.Messenger\n , DOMEventsSource = require('../msg_src/dom_events')\n , DataMsgAPI = require('../msg_api/data')\n , getElementDataAccess = require('../msg_api/de_data')\n , Model = miloCore.Model\n , pathUtils = Model._utils.path\n , modelUtils = Model._utils.model\n , changeDataHandler = Model._utils.changeDataHandler\n , getTransactionFlag = changeDataHandler.getTransactionFlag\n , setTransactionFlag = changeDataHandler.setTransactionFlag\n , postTransactionFinished = changeDataHandler.postTransactionFinished\n\n , _ = miloCore.proto\n , logger = miloCore.util.logger;\n\n\n/**\n * `milo.registry.facets.get('Data')`\n * Facet to give access to DOM data\n */\nvar Data = _.createSubclass(ComponentFacet, 'Data');\n\n\n/**\n * Data facet instance methods\n *\n * - [start](#Data$start) - start Data facet\n * - [get](#Data$get) - get DOM data from DOM tree\n * - [set](#Data$set) - set DOM data to DOM tree\n * - [path](#Data$path) - get reference to Data facet by path\n */\n_.extendProto(Data, {\n start: Data$start,\n getState: Data$getState,\n setState: Data$setState,\n\n get: Data$get,\n set: Data$set,\n del: Data$del,\n splice: Data$splice,\n len: Data$len,\n path: Data$path,\n getPath: Data$getPath,\n getKey: Data$getKey,\n\n _get: Data$_get,\n _set: Data$_set,\n _del: Data$_del,\n _splice: Data$_splice,\n _len: Data$_len,\n\n _setScalarValue: Data$_setScalarValue,\n _getScalarValue: Data$_getScalarValue,\n _bubbleUpDataChange: Data$_bubbleUpDataChange,\n _queueDataChange: Data$_queueDataChange,\n _postDataChanges: Data$_postDataChanges,\n _prepareMessageSource: _prepareMessageSource\n});\n\nfacetsRegistry.add(Data);\n\nmodule.exports = Data;\n\n\n/**\n * ModelPath methods added to Data prototype\n */\n['push', 'pop', 'unshift', 'shift'].forEach(function(methodName) {\n var method = Model.Path.prototype[methodName];\n _.defineProperty(Data.prototype, methodName, method);\n});\n\n\n\n// these methods will be wrapped to support \"*\" pattern subscriptions\nvar proxyDataSourceMethods = {\n // value: 'value',\n trigger: 'trigger'\n };\n\n\n/**\n * Data facet instance method\n * Starts Data facet\n * Called by component after component is initialized.\n */\nfunction Data$start() {\n // change messenger methods to work with \"*\" subscriptions (like Model class)\n pathUtils.wrapMessengerMethods.call(this);\n\n ComponentFacet.prototype.start.apply(this, arguments);\n\n // get/set methods to set data of element\n this.elData = getElementDataAccess(this.owner.el);\n\n this._dataChangesQueue = [];\n\n this._prepareMessageSource();\n\n // store facet data path\n this._path = '.' + this.owner.name;\n\n // current value\n this._value = this.get();\n\n // prepare internal and external messengers\n // this._prepareMessengers();\n\n // subscribe to DOM event and accessors' messages\n this.onSync('', onOwnDataChange);\n\n // message to mark the end of batch on the current level\n this.onSync('datachangesfinished', onDataChangesFinished);\n\n // changes in scope children with Data facet\n this.onSync('childdata', onChildData);\n\n // to enable reactive connections\n this.onSync('changedata', changeDataHandler);\n}\n\n\n/**\n * Data facet instance method\n * Create and connect internal and external messengers of Data facet.\n * External messenger's methods are proxied on the Data facet and they allows \"*\" subscriptions.\n */\n// function _prepareMessengers() {\n // Data facet will post all its changes on internal messenger\n // var internalMessenger = new Messenger(this);\n\n // message source to connect internal messenger to external\n // var internalMessengerSource = new MessengerMessageSource(this, undefined, new ModelMsgAPI, internalMessenger);\n\n // external messenger to which all model users will subscribe,\n // that will allow \"*\" subscriptions and support \"changedata\" message api.\n // var externalMessenger = new Messenger(this, Messenger.defaultMethods, internalMessengerSource);\n\n// _.defineProperties(this, {\n// _messenger: externalMessenger,\n// _internalMessenger: internalMessenger\n// });\n// }\n\n\n/**\n * Data facet instance method\n * Initializes DOMEventsSource and connects it to Data facet messenger\n *\n * @private\n */\nfunction _prepareMessageSource() {\n var dataAPI = new DataMsgAPI(this.owner)\n , dataEventsSource = new DOMEventsSource(this, proxyDataSourceMethods, dataAPI, this.owner);\n this._setMessageSource(dataEventsSource);\n\n _.defineProperty(this, '_dataEventsSource', dataEventsSource);\n\n // make value method of DataMsgAPI available on Data facet\n // this is a private method, get() should be used to get data.\n Mixin.prototype._createProxyMethod.call(dataAPI, 'value', 'value', this);\n}\n\n\n/**\n * Subscriber to data change event\n *\n * @private\n * @param {String} msgType in this instance will be ''\n * @param {Object} data data change information\n */\nfunction onOwnDataChange(msgType, data) {\n this._bubbleUpDataChange(data);\n this._queueDataChange(data);\n if (data.path === '') {\n var inTransaction = getTransactionFlag(data);\n this.postMessage('datachangesfinished', { transaction: inTransaction });\n }\n}\n\n\n/**\n * Data facet instance method\n * Sends data `message` to DOM parent\n *\n * @private\n * @param {Object} msgData data change message\n */\nfunction Data$_bubbleUpDataChange(msgData) {\n var parentData = this.scopeParent();\n\n if (parentData) {\n var parentMsg = _.clone(msgData);\n parentMsg.path = (this._path || ('.' + this.owner.name)) + parentMsg.path;\n parentData.postMessage('childdata', parentMsg || msgData);\n }\n}\n\n\n/**\n * Data facet instance method\n * Queues data messages to be dispatched to connector\n *\n * @private\n * @param {Object} change data change description\n */\nfunction Data$_queueDataChange(change) {\n this._dataChangesQueue.push(change);\n}\n\n\n/**\n * Subscriber to datachangesfinished event.\n * Calls the method to post changes batch and bubbles up the message\n *\n * @param {[type]} msg [description]\n * @param {[type]} data [description]\n */\nfunction onDataChangesFinished(msg, data) {\n this._postDataChanges(data.inTransaction);\n var parentData = this.scopeParent();\n if (parentData) parentData.postMessage('datachangesfinished', data);\n}\n\n\n/**\n * Dispatches all changes collected in the batch\n * Used for data propagation - connector subscribes to this message\n *\n * @private\n */\nfunction Data$_postDataChanges(inTransaction) {\n var queue = this._dataChangesQueue.reverse();\n this.postMessageSync('datachanges', {\n changes: queue,\n transaction: inTransaction\n });\n this._dataChangesQueue = []; // it can't be .length = 0, as the actual array may still be used\n}\n\n\n/**\n * Subscriber to data change event in child Data facet\n *\n * @private\n * @param {String} msgType\n * @param {Obejct} data data change information\n */\nfunction onChildData(msgType, data) {\n this.postMessage(data.path, data);\n this._bubbleUpDataChange(data);\n this._queueDataChange(data);\n}\n\n\n/**\n * Data facet instance method\n * Sets data in DOM hierarchy recursively.\n * Returns the object with the data actually set (can be different, if components matching some properties are missing).\n *\n * @param {Object|String|Number} value value to be set. If the value if scalar, it will be set on component's element, if the value is object - on DOM tree inside component\n * @return {Object|String|Number}\n */\nfunction Data$set(value) {\n var inTransaction = getTransactionFlag(Data$set);\n\n try {\n return executeHook.call(this, 'set', arguments);\n } catch (e) {\n if (e != noHook) throw e;\n }\n\n setTransactionFlag(this._set, inTransaction);\n\n var oldValue = this._value\n , newValue = this._set(value);\n\n // this message triggers onOwnDataChange, as well as actuall DOM change\n // so the parent gets notified\n var msg = { path: '', type: 'changed',\n newValue: newValue, oldValue: oldValue };\n setTransactionFlag(msg, inTransaction);\n this.postMessage('', msg);\n\n return newValue;\n}\n\n\nfunction Data$_set(value) {\n var inTransaction = getTransactionFlag(Data$_set);\n\n var valueSet;\n if (value != null && typeof value == 'object') {\n if (Array.isArray(value)) {\n valueSet = [];\n\n var listFacet = this.owner.list;\n if (listFacet){\n var listLength = listFacet.count()\n , newItemsCount = value.length - listLength;\n if (newItemsCount >= 3) {\n listFacet._addItems(newItemsCount);\n listFacet._updateDataPaths(listLength, listFacet.count());\n }\n\n value.forEach(function(childValue, index) {\n setChildData.call(this, valueSet, childValue, index, '[$$]');\n }, this);\n\n var listCount = listFacet.count()\n , removeCount = listCount - value.length;\n\n while (removeCount-- > 0)\n listFacet._removeItem(value.length);\n } else\n logger.warn('Data: setting array data without List facet');\n } else {\n valueSet = {};\n _.eachKey(value, function(childValue, key) {\n setChildData.call(this, valueSet, childValue, key, '.$$');\n }, this);\n }\n } else\n valueSet = this._setScalarValue(value);\n\n this._value = valueSet;\n\n return valueSet;\n\n\n function setChildData(valueSet, childValue, key, pathSyntax) {\n var childPath = pathSyntax.replace('$$', key);\n var childDataFacet = this.path(childPath, typeof childValue != 'undefined');\n if (childDataFacet) {\n setTransactionFlag(childDataFacet.set, inTransaction);\n valueSet[key] = childDataFacet.set(childValue);\n }\n }\n}\n\n\n/**\n * Data facet instance method\n * Deletes component from view and scope, only in case it has Item facet on it\n */\nfunction Data$del() {\n var inTransaction = getTransactionFlag(Data$del);\n\n try {\n var result = executeHook.call(this, 'del');\n postTransactionFinished.call(this, inTransaction);\n return result;\n } catch (e) {\n if (e != noHook) throw e;\n }\n\n var oldValue = this._value;\n\n setTransactionFlag(this._del, inTransaction);\n this._del();\n\n // this message triggers onOwnDataChange, as well as actuall DOM change\n // so the parent gets notified\n var msg = { path: '', type: 'deleted', oldValue: oldValue };\n setTransactionFlag(msg, inTransaction);\n this.postMessage('', msg);\n}\n\n\nfunction Data$_del() {\n var inTransaction = getTransactionFlag(Data$_del);\n setTransactionFlag(this._set, inTransaction);\n this._set();\n}\n\n\n/**\n * Data facet instance method\n * Sets scalar value to DOM element\n *\n * @private\n * @param {String|Number} value value to set to DOM element\n */\nfunction Data$_setScalarValue(value) {\n return this.elData.set(this.owner.el, value);\n}\n\n\n/**\n * Data facet instance method\n * Get structured data from DOM hierarchy recursively\n * Returns DOM data\n *\n * @param {Boolean} deepGet true by default\n * @return {Object}\n */\nfunction Data$get(deepGet) {\n try {\n return executeHook.call(this, 'get', arguments);\n } catch (e) {\n if (e != noHook) throw e;\n }\n\n return this._get(deepGet);\n}\n\nfunction Data$_get(deepGet) {\n if (deepGet === false) // a hack to enable getting shallow state\n return;\n\n var comp = this.owner\n , scopeData;\n\n if (comp.list) {\n scopeData = [];\n comp.list.each(function(listItem, index) {\n scopeData[index] = listItem.data.get();\n });\n\n if (comp.container)\n comp.container.scope._each(function(scopeItem, name) {\n if (! comp.list.contains(scopeItem) && scopeItem.data)\n scopeData[name] = scopeItem.data.get();\n });\n } else if (comp.container) {\n scopeData = {};\n comp.container.scope._each(function(scopeItem, name) {\n if (scopeItem.data)\n scopeData[name] = scopeItem.data.get();\n });\n } else\n scopeData = this._getScalarValue();\n\n this._value = scopeData;\n\n return scopeData;\n}\n\n\n/**\n * Data facet instance method\n * Gets scalar data from DOM element\n *\n * @private\n */\nfunction Data$_getScalarValue() {\n return this.elData.get(this.owner.el);\n}\n\n\n/**\n * Data facet instance method\n * Splices List items. Requires List facet to be present on component. Works in the same way as array splice.\n * Returns data retrieved from removed items\n *\n * @param {Integer} spliceIndex index to delete/insert at\n * @param {Integer} spliceHowMany number of items to delete\n * @param {List} arguments optional items to insert\n * @return {Array}\n */\nfunction Data$splice(spliceIndex, spliceHowMany) { //, ... arguments\n var inTransaction = getTransactionFlag(Data$splice);\n var result;\n\n try {\n var result = executeHook.call(this, 'splice', arguments);\n postTransactionFinished.call(this, inTransaction);\n return result;\n } catch (e) {\n if (e != noHook) throw e;\n }\n\n setTransactionFlag(this._splice, inTransaction);\n result = this._splice.apply(this, arguments);\n\n if (!result) return;\n\n var msg = { path: '', type: 'splice',\n index: result.spliceIndex,\n removed: result.removed,\n addedCount: result.addedCount,\n newValue: this._value };\n setTransactionFlag(msg, inTransaction);\n this.postMessage('', msg);\n\n return result.removed;\n}\n\n\nvar noHook = {};\nfunction executeHook(methodName, args) {\n var hook = this.config[methodName];\n switch (typeof hook) {\n case 'function':\n return hook.apply(this.owner, args);\n\n case 'string':\n return this.owner[hook].apply(this.owner, args);\n\n default:\n throw noHook;\n }\n}\n\n\nfunction Data$_splice(spliceIndex, spliceHowMany) { //, ... arguments\n var inTransaction = getTransactionFlag(Data$_splice);\n\n var listFacet = this.owner.list;\n if (! listFacet)\n return logger.warn('Data: cannot use splice method without List facet');\n\n var removed = [];\n\n var listLength = listFacet.count();\n arguments[0] = spliceIndex =\n modelUtils.normalizeSpliceIndex(spliceIndex, listLength);\n\n if (spliceHowMany > 0 && listLength > 0) {\n for (var i = spliceIndex; i < spliceIndex + spliceHowMany; i++) {\n var item = listFacet.item(spliceIndex);\n if (item) {\n var itemData = item.data.get();\n listFacet._removeItem(spliceIndex);\n } else\n logger.warn('Data: no item for index', i);\n\n removed.push(itemData);\n }\n\n listFacet._updateDataPaths(spliceIndex, listFacet.count());\n }\n\n var added = [];\n\n var argsLen = arguments.length\n , addItems = argsLen > 2\n , addedCount = argsLen - 2;\n if (addItems) {\n listFacet._addItems(addedCount, spliceIndex);\n for (var i = 2, j = spliceIndex; i < argsLen; i++, j++) {\n var item = listFacet.item(j);\n if (item) {\n setTransactionFlag(item.data.set, inTransaction);\n var itemData = item.data.set(arguments[i]);\n } else\n logger.warn('Data: no item for index', j);\n\n added.push(itemData);\n }\n\n // change paths of items that were added and items after them\n listFacet._updateDataPaths(spliceIndex, listFacet.count());\n }\n\n // if (Array.isArray(this._value)) {\n // _.prependArray(added, [spliceIndex, spliceHowMany]);\n // Array.prototype.splice.apply(this._value, added);\n // } else\n this._value = this.get();\n\n return {\n spliceIndex: spliceIndex,\n removed: removed,\n addedCount: addItems ? addedCount : 0\n };\n}\n\n\nfunction Data$len() {\n try {\n return executeHook.call(this, 'len');\n } catch (e) {\n if (e != noHook) throw e;\n }\n \n return this._len();\n}\n\n\nfunction Data$_len() {\n if (this.owner.list) return this.owner.list.count();\n else logger.error('Data: len called without list facet');\n}\n\n\n/**\n * Data facet instance method\n * Returns data facet of a child component (by scopes) corresponding to the path\n * @param {String} accessPath data access path\n */\nfunction Data$path(accessPath, createItem) {\n // createItem = true; // this hack seems to be no longer needed...\n\n if (! accessPath)\n return this;\n\n var parsedPath = pathUtils.parseAccessPath(accessPath);\n var currentComponent = this.owner;\n\n for (var i = 0, len = parsedPath.length; i < len; i++) {\n var pathNode = parsedPath[i]\n , nodeKey = pathUtils.getPathNodeKey(pathNode);\n if (pathNode.syntax == 'array' && currentComponent.list) {\n var itemComponent = currentComponent.list.item(nodeKey);\n if (! itemComponent && createItem !== false) {\n itemComponent = currentComponent.list._addItem(nodeKey);\n itemComponent.data._path = pathNode.property;\n }\n currentComponent = itemComponent;\n } else if (currentComponent.container)\n currentComponent = currentComponent.container.scope[nodeKey];\n\n var currentDataFacet = currentComponent && currentComponent.data;\n if (! currentDataFacet)\n break;\n }\n\n return currentDataFacet;\n}\n\n\n/**\n * Data facet instance method\n * Returns path to access this data facet from parent (using path method)\n *\n * @return {String}\n */\nfunction Data$getPath() {\n return this._path;\n}\n\n\n/**\n * Data facet instance method\n * Returns key to access the value related to this data facet on the value related to parent data facet.\n * If component has List facet, returns index\n *\n * @return {String|Integer}\n */\nfunction Data$getKey() {\n var path = this._path;\n return path[0] == '['\n ? +path.slice(1, -1) // remove \"[\" and \"]\"\n : path.slice(1) // remove leading \".\"\n}\n\n\n/**\n * Data facet instance method\n * Called by `Component.prototype.getState` to get facet's state\n * Returns DOM data\n *\n * @param {Boolean} deepState, true by default\n * @return {Object}\n */\nfunction Data$getState(deepState) {\n return { state: this.get(deepState) };\n}\n\n\n/**\n * Data facet instance method\n * Called by `Component.prototype.setState` to set facet's state\n * Simply sets model data\n *\n * @param {Object} state data to set on facet's model\n */\nfunction Data$setState(state) {\n return this.set(state.state);\n}\n", "'use strict';\n\n\nvar ComponentFacet = require('../c_facet')\n , facetsRegistry = require('./cf_registry') \n , miloCore = require('milo-core')\n , _ = miloCore.proto\n , check = miloCore.util.check\n , Match = check.Match\n , doT = miloCore.util.doT\n , binder = require('../../binder')\n , BindAttribute = require('../../attributes/a_bind')\n , domUtils = require('../../util/dom')\n , config = require('../../config');\n\n\n/**\n * `milo.registry.facets.get('Dom')`\n * Facet with component related dom utils\n */\nvar Dom = _.createSubclass(ComponentFacet, 'Dom');\n\n_.extend(Dom, {\n createElement: Dom$$createElement\n});\n\n\n/**\n * Facet class method\n * Creates an element from a passed configuation object\n * \n * @param {Object} config with the properties `domConfig`, `content`, `template`\n * @return {Element} an html element \n */\nfunction Dom$$createElement(config) {\n var domConfig = config.domConfig || {}\n , tagName = domConfig.tagName || 'div'\n , newEl = document.createElement(tagName)\n , content = config.content\n , template = config.template;\n\n // TODO it will be called again when/if component is instantiated\n // Should be someproperty on element to indicate it's been called?\n _applyConfigToElement(newEl, domConfig);\n\n if (typeof content == 'string') {\n if (template)\n newEl.innerHTML = doT.template(template)({content: content});\n else\n newEl.innerHTML = content;\n }\n return newEl;\n}\n\n\nfunction _applyConfigToElement(el, config) {\n var cssClasses = config && config.cls\n , configAttributes = config && config.attributes;\n\n if (configAttributes)\n _.eachKey(configAttributes, function(attrValue, attrName) {\n el.setAttribute(attrName, attrValue);\n });\n\n if (cssClasses)\n _attachCssClasses(el, 'add', cssClasses);\n}\n\n\n_.extendProto(Dom, {\n start: start,\n\n show: show,\n hide: hide,\n toggle: toggle,\n detach: detach,\n remove: remove,\n append: append,\n prepend: prepend,\n appendChildren: appendChildren,\n prependChildren: prependChildren,\n insertAfter: insertAfter,\n insertBefore: insertBefore,\n appendToScopeParent: appendToScopeParent,\n children: Dom$children,\n setStyle: setStyle,\n setStyles: setStyles,\n copy: copy,\n createElement: createElement,\n\n addCssClasses: _.partial(_manageCssClasses, 'add'),\n removeCssClasses: _.partial(_manageCssClasses, 'remove'),\n toggleCssClasses: _.partial(_manageCssClasses, 'toggle'),\n\n find: find,\n hasTextBeforeSelection: hasTextBeforeSelection,\n hasTextAfterSelection: hasTextAfterSelection,\n});\n\nfacetsRegistry.add(Dom);\n\nmodule.exports = Dom;\n\n\n// start Dom facet\nfunction start() {\n var el = this.owner.el;\n _applyConfigToElement(el, this.config);\n var currentStyle = window.getComputedStyle(el)\n this._visible = currentStyle && currentStyle.display != 'none';\n}\n\n// show HTML element of component\nfunction show() {\n this.toggle(true);\n}\n\n// hide HTML element of component\nfunction hide() {\n this.toggle(false);\n}\n\n// show/hide\nfunction toggle(doShow) {\n doShow = typeof doShow == 'undefined'\n ? ! this._visible\n : !! doShow;\n\n this._visible = doShow;\n var el = this.owner.el;\n\n el.style.display = doShow ? 'block' : 'none';\n\n return doShow;\n}\n\n\nfunction _manageCssClasses(methodName, cssClasses, enforce) {\n _attachCssClasses(this.owner.el, methodName, cssClasses, enforce);\n}\n\n\nfunction _attachCssClasses(el, methodName, cssClasses, enforce) {\n var classList = el.classList\n , doToggle = methodName == 'toggle';\n\n if (Array.isArray(cssClasses))\n cssClasses.forEach(callMethod);\n else if (typeof cssClasses == 'string')\n callMethod(cssClasses);\n else\n throw new Error('unknown type of CSS classes parameter');\n\n function callMethod(cssCls) {\n doToggle\n // Only pass 'enforce' if a value has been provided (The 'toggle' function of the classList will treat undefined === false resulting in only allowing classes to be removed)\n ? enforce === undefined ? classList[methodName](cssCls) : classList[methodName](cssCls, enforce)\n : classList[methodName](cssCls);\n }\n}\n\n\nfunction detach() {\n if (this.owner.el) \n domUtils.detachComponent(this.owner.el);\n}\n\n\nfunction setStyle(property, value) {\n if (!this.owner.el) {\n throw new Error(\"Cannot call setStyle on owner with no element: \" + this.owner.constructor.name);\n }\n this.owner.el.style[property] = value;\n}\n\nfunction setStyles(properties) {\n for (var property in properties)\n this.owner.el.style[property] = properties[property];\n}\n\n\n// create a copy of DOM element using facet config if set\nfunction copy(isDeep) {\n return this.owner.el && this.owner.el.cloneNode(isDeep);\n}\n\n\nfunction createElement() {\n var newEl = Dom.createElement(this.config);\n return newEl;\n}\n\n\n// remove HTML element of component\nfunction remove() {\n domUtils.removeElement(this.owner.el);\n}\n\n// append inside HTML element of component\nfunction append(el) {\n this.owner.el.appendChild(el);\n}\n\n// prepend inside HTML element of component\nfunction prepend(el) {\n var thisEl = this.owner.el\n , firstChild = thisEl.firstChild;\n if (firstChild)\n thisEl.insertBefore(el, firstChild);\n else\n thisEl.appendChild(el);\n}\n\n// appends children of element inside this component's element\nfunction appendChildren(el) {\n while(el.childNodes.length)\n this.append(el.childNodes[0]);\n}\n\n// prepends children of element inside this component's element\nfunction prependChildren(el) {\n while(el.childNodes.length)\n this.prepend(el.childNodes[el.childNodes.length - 1]);\n}\n\nfunction insertAfter(el) {\n var thisEl = this.owner.el\n , parent = thisEl.parentNode; \n parent.insertBefore(el, thisEl.nextSibling);\n}\n\nfunction insertBefore(el) {\n var thisEl = this.owner.el\n , parent = thisEl.parentNode;\n parent.insertBefore(el, thisEl);\n}\n\n\n// appends component's element to scope parent. If it was alredy in DOM it will be moved\nfunction appendToScopeParent() {\n var parent = this.owner.getScopeParent();\n if (parent) parent.el.appendChild(this.owner.el);\n}\n\n\n/**\n * Dom facet instance method\n * Returns the list of child elements of the component element\n *\n * @return {Array[Element]}\n */\nfunction Dom$children() {\n return domUtils.children(this.owner.el);\n}\n\n\nvar findDirections = {\n 'up': 'previousNode',\n 'down': 'nextNode'\n};\n\n// Finds component passing optional iterator's test\n// in the same scope as the current component (this)\n// by traversing DOM tree upwards (direction = \"up\")\n// or downwards (direction = \"down\")\nfunction find(direction, iterator) {\n if (! findDirections.hasOwnProperty(direction))\n throw new Error('incorrect find direction: ' + direction);\n\n var el = this.owner.el\n , scope = this.owner.scope\n , treeWalker = document.createTreeWalker(scope._rootEl, NodeFilter.SHOW_ELEMENT);\n\n treeWalker.currentNode = el;\n var nextNode = treeWalker[findDirections[direction]]()\n , componentsNames = Object.keys(scope)\n , found = false;\n\n while (nextNode) {\n var attr = new BindAttribute(nextNode);\n if (attr.node) {\n attr.parse().validate();\n if (scope.hasOwnProperty(attr.compName)) {\n var component = scope[attr.compName];\n if (! iterator || iterator(component)) {\n found = true;\n break;\n }\n }\n }\n treeWalker.currentNode = nextNode;\n nextNode = treeWalker[findDirections[direction]]();\n }\n\n if (found) return component;\n}\n\n\n// returns true if the element has text before selection\nfunction hasTextBeforeSelection() {\n var selection = window.getSelection();\n if (! selection.isCollapsed) return true;\n \n var text = selection.focusNode && selection.focusNode.textContent;\n var startPos = text && text.charAt(0) == ' ' ? 1 : 0;\n if (selection.anchorOffset != startPos) return true;\n\n // walk up the DOM tree to check if there are text nodes before cursor\n var treeWalker = document.createTreeWalker(this.owner.el, NodeFilter.SHOW_TEXT);\n treeWalker.currentNode = selection.anchorNode;\n var prevNode = treeWalker.previousNode();\n\n var isText = prevNode ? !prevNode.nodeValue.trim() == '' : false;\n\n return isText;\n}\n\n\nfunction hasTextAfterSelection() {\n var selection = window.getSelection();\n if (! selection.isCollapsed) return true;\n\n var text = selection.focusNode && selection.focusNode.textContent;\n var startPos = text && text.charAt(text.length-1) == ' ' ? selection.anchorNode.length-1 : selection.anchorNode.length;\n if (selection.anchorOffset < startPos) return true;\n\n // walk up the DOM tree to check if there are text nodes after cursor\n var treeWalker = document.createTreeWalker(this.owner.el, NodeFilter.SHOW_TEXT);\n treeWalker.currentNode = selection.anchorNode;\n var nextNode = treeWalker.nextNode();\n \n //To capture when treewalker gives us an empty text node (unknown reason)\n var isText = nextNode ? !nextNode.nodeValue.trim() == '' : false;\n\n return isText;\n}\n", - "'use strict';\n\n// \n// ###drag facet\n\nvar ComponentFacet = require('../c_facet')\n , facetsRegistry = require('./cf_registry')\n , DOMEventsSource = require('../msg_src/dom_events')\n , Component = require('../c_class')\n , DragDrop = require('../../util/dragdrop')\n , miloCore = require('milo-core')\n , _ = miloCore.proto\n , logger = miloCore.util.logger;\n\n\n/**\n * `milo.registry.facets.get('Drag')`\n * Facet for components that can be dragged\n * Drag facet supports the following configuration parameters:\n *\n * - meta: object with properties\n * - params: object of key-value pairs that will be passed in metadata data type (can also be function or method name that returns this object). See config.dragDrop.dataTypes.componentMetaTemplate\n * - data: data that will be stored in the above meta data type (or function)\n * - allowedEffects: string (or function) as specified here: https://developer.mozilla.org/en-US/docs/DragDrop/Drag_Operations#dragstart\n * - dataTypes: map of additional data types the component will supply to data transfer object, key is data type, value is a function that returns it, component will be passed as the context to this function\n *\n * If function is specified in any parameter it will be called with the component as the context\n */\nvar Drag = _.createSubclass(ComponentFacet, 'Drag');\n\n_.extendProto(Drag, {\n init: Drag$init,\n start: Drag$start,\n setHandle: Drag$setHandle\n});\n\nfacetsRegistry.add(Drag);\n\nmodule.exports = Drag;\n\n\nfunction Drag$init() {\n ComponentFacet.prototype.init.apply(this, arguments); \n\n this._createMessageSourceWithAPI(DOMEventsSource);\n this._dragData = {};\n\n var dataTypeInfo = this.config._dataTypeInfo || '';\n this._dataTypeInfo = typeof dataTypeInfo == 'function'\n ? dataTypeInfo\n : function() { return dataTypeInfo; };\n}\n\n\n/**\n * Drag facet instance method\n * Sets the drag handle element of component. This element has to be dragged for the component to be dragged.\n *\n * @param {Element} handleEl\n */\nfunction Drag$setHandle(handleEl) {\n if (! this.owner.el.contains(handleEl))\n return logger.warn('drag handle should be inside element to be dragged')\n this._dragHandle = handleEl;\n}\n\n\nfunction Drag$start() {\n ComponentFacet.prototype.start.apply(this, arguments);\n _addDragAttribute.call(this);\n\n this.onMessages({\n 'mousedown': onMouseDown,\n 'mouseenter mouseleave mousemove': onMouseMovement,\n 'dragstart': onDragStart,\n 'drag': onDragging,\n 'dragend': onDragEnd\n });\n\n this.owner.onMessages({\n 'getstatestarted':\n { subscriber: _removeDragAttribute, context: this },\n 'getstatecompleted':\n { subscriber: _addDragAttribute, context: this }\n });\n}\n\n\n/**\n * Adds draggable attribute to component's element\n *\n * @private\n */\nfunction _addDragAttribute() {\n if (this.owner.el)\n this.owner.el.setAttribute('draggable', true);\n}\n\n\nfunction _removeDragAttribute() {\n if (this.owner.el)\n this.owner.el.removeAttribute('draggable');\n}\n\n\nfunction onMouseDown(eventType, event) {\n this.__mouseDownTarget = event.target;\n if (targetInDragHandle.call(this)) {\n window.getSelection().empty();\n event.stopPropagation();\n }\n}\n\n\nfunction onMouseMovement(eventType, event) {\n var shouldBeDraggable = targetInDragHandle.call(this);\n this.owner.el.setAttribute('draggable', shouldBeDraggable);\n if (document.body.getAttribute('data-dragEnableEvent') != 'false')\n event.stopPropagation();\n}\n\n\nfunction onDragStart(eventType, event) {\n event.stopPropagation();\n if (this.config.off || ! targetInDragHandle.call(this)) {\n event.preventDefault();\n return;\n }\n\n var owner = this.owner;\n var dt = new DragDrop(event);\n\n this._dragData = dt.setComponentState(owner);\n setMeta.call(this);\n setAdditionalDataTypes.call(this);\n _setAllowedEffects.call(this, dt);\n\n DragDrop.service.postMessageSync('dragdropstarted', {\n eventType: 'dragstart',\n dragDrop: dt,\n dragFacet: this\n });\n\n function setMeta() {\n var params = getMetaData.call(this, 'params')\n , data = getMetaData.call(this, 'data');\n\n this._dragMetaDataType = dt.setComponentMeta(owner, params, data);\n this._dragMetaData = data;\n }\n\n function getMetaData(property) {\n try { var func = this.config.meta[property]; } catch(e) {}\n if (typeof func == 'string') func = owner[func];\n return _.result(func, owner);\n }\n\n function setAdditionalDataTypes() {\n if (this.config.dataTypes) {\n this._dataTypesData = _.mapKeys(this.config.dataTypes, function (getDataFunc, dataType) {\n var data = getDataFunc.call(this.owner, dataType);\n if (typeof data == 'object') data = JSON.stringify(data);\n if (data) dt.setData(dataType, data);\n return data;\n }, this);\n }\n }\n}\n\n\nfunction onDragging(eventType, event) {\n if (_dragIsDisabled.call(this, event)) return;\n\n var dt = new DragDrop(event);\n dt.setComponentState(this.owner, this._dragData);\n dt.setData(this._dragMetaDataType, this._dragMetaData);\n if (this._dataTypesData) {\n _.eachKey(this._dataTypesData, function(data, dataType) {\n if (data) dt.setData(dataType, data);\n });\n }\n\n _setAllowedEffects.call(this, dt);\n}\n\n\nfunction onDragEnd(eventType, event) {\n if (_dragIsDisabled.call(this, event)) return;\n\n event.stopPropagation();\n var dt = new DragDrop(event);\n DragDrop.service.postMessageSync('completedragdrop', {\n eventType: 'dragend',\n dragDrop: dt,\n dragFacet: this\n });\n}\n\n\nfunction _setAllowedEffects(DragDrop) {\n var effects = _.result(this.config.allowedEffects, this.owner);\n DragDrop.setAllowedEffects(effects);\n}\n\n\nfunction targetInDragHandle() {\n return ! this._dragHandle || this._dragHandle.contains(this.__mouseDownTarget);\n}\n\n\nfunction _dragIsDisabled(event) {\n if (this.config.off) {\n event.preventDefault();\n return true;\n }\n return false;\n}\n", + "'use strict';\n\n// \n// ###drag facet\n\nvar ComponentFacet = require('../c_facet')\n , facetsRegistry = require('./cf_registry')\n , DOMEventsSource = require('../msg_src/dom_events')\n , Component = require('../c_class')\n , DragDrop = require('../../util/dragdrop')\n , miloCore = require('milo-core')\n , _ = miloCore.proto\n , logger = miloCore.util.logger;\n\n\n/**\n * `milo.registry.facets.get('Drag')`\n * Facet for components that can be dragged\n * Drag facet supports the following configuration parameters:\n *\n * - meta: object with properties\n * - params: object of key-value pairs that will be passed in metadata data type (can also be function or method name that returns this object). See config.dragDrop.dataTypes.componentMetaTemplate\n * - data: data that will be stored in the above meta data type (or function)\n * - allowedEffects: string (or function) as specified here: https://developer.mozilla.org/en-US/docs/DragDrop/Drag_Operations#dragstart\n * - dataTypes: map of additional data types the component will supply to data transfer object, key is data type, value is a function that returns it, component will be passed as the context to this function\n *\n * If function is specified in any parameter it will be called with the component as the context\n */\nvar Drag = _.createSubclass(ComponentFacet, 'Drag');\n\n_.extendProto(Drag, {\n init: Drag$init,\n start: Drag$start,\n setHandle: Drag$setHandle\n});\n\nfacetsRegistry.add(Drag);\n\nmodule.exports = Drag;\n\n\nfunction Drag$init() {\n ComponentFacet.prototype.init.apply(this, arguments); \n\n this._createMessageSourceWithAPI(DOMEventsSource);\n this._dragData = {};\n\n var dataTypeInfo = this.config._dataTypeInfo || '';\n this._dataTypeInfo = typeof dataTypeInfo == 'function'\n ? dataTypeInfo\n : function() { return dataTypeInfo; };\n}\n\n\n/**\n * Drag facet instance method\n * Sets the drag handle element of component. This element has to be dragged for the component to be dragged.\n *\n * @param {Element} handleEl\n */\nfunction Drag$setHandle(handleEl) {\n if (! this.owner.el.contains(handleEl))\n return logger.warn('drag handle should be inside element to be dragged')\n this._dragHandle = handleEl;\n}\n\n\nfunction Drag$start() {\n ComponentFacet.prototype.start.apply(this, arguments);\n _addDragAttribute.call(this);\n _createDragImage.call(this);\n\n this.onMessages({\n 'mousedown': onMouseDown,\n 'mouseenter mouseleave mousemove': onMouseMovement,\n 'dragstart': onDragStart,\n 'drag': onDragging,\n 'dragend': onDragEnd\n });\n\n this.owner.onMessages({\n 'getstatestarted':\n { subscriber: _removeDragAttribute, context: this },\n 'getstatecompleted':\n { subscriber: _addDragAttribute, context: this }\n });\n}\n\n\n/**\n * Adds draggable attribute to component's element\n *\n * @private\n */\nfunction _addDragAttribute() {\n if (this.owner.el)\n this.owner.el.setAttribute('draggable', true);\n}\n\n\nfunction _removeDragAttribute() {\n if (this.owner.el)\n this.owner.el.removeAttribute('draggable');\n}\n\n\nfunction _createDragImage() {\n var dragImage = this.config.dragImage;\n if (dragImage) {\n this._dragElement = new Image();\n this._dragElement.src = dragImage.url;\n }\n}\n\n\nfunction onMouseDown(eventType, event) {\n this.__mouseDownTarget = event.target;\n if (targetInDragHandle.call(this)) {\n window.getSelection().empty();\n event.stopPropagation();\n }\n}\n\n\nfunction onMouseMovement(eventType, event) {\n var shouldBeDraggable = targetInDragHandle.call(this);\n this.owner.el.setAttribute('draggable', shouldBeDraggable);\n if (document.body.getAttribute('data-dragEnableEvent') != 'false')\n event.stopPropagation();\n}\n\n\nfunction onDragStart(eventType, event) {\n event.stopPropagation();\n if (this.config.off || ! targetInDragHandle.call(this)) {\n event.preventDefault();\n return;\n }\n\n var dragImage = this.config.dragImage;\n if (dragImage)\n event.dataTransfer.setDragImage(this._dragElement, dragImage.x || 0, dragImage.y || 0);\n\n var owner = this.owner;\n var dt = new DragDrop(event);\n\n this._dragData = dt.setComponentState(owner);\n setMeta.call(this);\n setAdditionalDataTypes.call(this);\n _setAllowedEffects.call(this, dt);\n\n DragDrop.service.postMessageSync('dragdropstarted', {\n eventType: 'dragstart',\n dragDrop: dt,\n dragFacet: this\n });\n\n function setMeta() {\n var params = getMetaData.call(this, 'params')\n , data = getMetaData.call(this, 'data');\n\n this._dragMetaDataType = dt.setComponentMeta(owner, params, data);\n this._dragMetaData = data;\n }\n\n function getMetaData(property) {\n try { var func = this.config.meta[property]; } catch(e) {}\n if (typeof func == 'string') func = owner[func];\n return _.result(func, owner);\n }\n\n function setAdditionalDataTypes() {\n if (this.config.dataTypes) {\n this._dataTypesData = _.mapKeys(this.config.dataTypes, function (getDataFunc, dataType) {\n var data = getDataFunc.call(this.owner, dataType);\n if (typeof data == 'object') data = JSON.stringify(data);\n if (data) dt.setData(dataType, data);\n return data;\n }, this);\n }\n }\n}\n\n\nfunction onDragging(eventType, event) {\n if (_dragIsDisabled.call(this, event)) return;\n\n var dt = new DragDrop(event);\n dt.setComponentState(this.owner, this._dragData);\n dt.setData(this._dragMetaDataType, this._dragMetaData);\n if (this._dataTypesData) {\n _.eachKey(this._dataTypesData, function(data, dataType) {\n if (data) dt.setData(dataType, data);\n });\n }\n\n _setAllowedEffects.call(this, dt);\n}\n\n\nfunction onDragEnd(eventType, event) {\n if (_dragIsDisabled.call(this, event)) return;\n\n event.stopPropagation();\n var dt = new DragDrop(event);\n DragDrop.service.postMessageSync('completedragdrop', {\n eventType: 'dragend',\n dragDrop: dt,\n dragFacet: this\n });\n}\n\n\nfunction _setAllowedEffects(DragDrop) {\n var effects = _.result(this.config.allowedEffects, this.owner);\n DragDrop.setAllowedEffects(effects);\n}\n\n\nfunction targetInDragHandle() {\n return ! this._dragHandle || this._dragHandle.contains(this.__mouseDownTarget);\n}\n\n\nfunction _dragIsDisabled(event) {\n if (this.config.off) {\n event.preventDefault();\n return true;\n }\n return false;\n}\n", "'use strict';\n\n// \n// ###drop facet\n\nvar ComponentFacet = require('../c_facet')\n , facetsRegistry = require('./cf_registry')\n , DOMEventsSource = require('../msg_src/dom_events')\n , DropMsgAPI = require('../msg_api/drop')\n , DragDrop = require('../../util/dragdrop')\n , _ = require('milo-core').proto;\n\n/**\n * `milo.registry.facets.get('Drop')`\n * Facet for components that can accept drops\n * Drop facet supports the following configuration parameters:\n *\n * - allow - an object that will define allowed data types during drag (`dragenter` and `dragover` events) with these properties:\n * - components: `true` by default (all components will be accepted)\n * OR string with allowed component class\n * OR list of allowed components classes (strings)\n * OR map with allowed classes in keys and `true`/test functions in values\n * OR test function that will be passed object defined below\n * OR `false` to NOT accept components\n * - dataTypes: `false` by default (no other data types will be accepted)\n * OR string with allowed data type\n * OR list of additional data types that a drop target would accept\n * OR test function that will be passed DragDrop object\n * OR `true` to accept all data types\n * - checkParent: `false` by default\n * OR `true` will call parent component drop allow to check if parent component will accept the component\n * If test functions are used, they should return boolean. Each test function can also set drop effect as defined here:\n * https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer#dropEffect.28.29\n * Setting drop effect that is not allowed by dragged object will prevent drop.\n * Test functions for components will be passed the owner of Drop facet as context, the object with the following possible properties as the first parameter:\n * compClass - name of component class as stored in registry\n * compName - name of component (all lowercase)\n * params - parameters as encoded in dataType, passed to `milo.util.dragDrop.setComponentMeta` by Drag facet\n * metaDataType - data type of the data that has compClass, compName and params encoded\n *\n * ... and DragDrop instance as the second parameter\n *\n * Test function for other data types will be passed the owner of Drop facet as context and DragDrop instance as the first parameter\n *\n * ####Events####\n *\n * In addition to configuring allowed components and data types, components classes should subscribe to events.\n * At the very least, they should subscribe to `drop` event.\n *\n * Drop facet emits dragin/dragout messages that are emitted whenever actual component element is entered or left\n * (which is different from dragenter and dragleave messages that are emitted whenever any child element is entered or left, as long as event bubbles up)\n * If child component has drop facet attached, dragout will be emitted on the current component when the child is entered.\n *\n * You can see the demonstration of when messages are emitted [here](http://jsbin.com/buqov/6)\n * \n */\nvar Drop = _.createSubclass(ComponentFacet, 'Drop');\n\n\n_.extendProto(Drop, {\n init: Drop$init,\n start: Drop$start\n // _reattach: _reattachEventsOnElementChange\n});\n\nfacetsRegistry.add(Drop);\n\nmodule.exports = Drop;\n\n\nfunction Drop$init() {\n ComponentFacet.prototype.init.apply(this, arguments);\n this._createMessageSourceWithAPI(DOMEventsSource, new DropMsgAPI);\n}\n\n\nfunction Drop$start() {\n ComponentFacet.prototype.start.apply(this, arguments);\n this.owner.el.classList.add('cc-module-relative');\n this.onMessages({\n 'dragenter dragover': onDragging,\n 'drop': onDrop,\n 'dragenter dragover dragleave drop dragin dragout': postToService\n });\n}\n\n\nfunction onDragging(eventType, event) {\n var dt = new DragDrop(event);\n\n event.stopPropagation();\n event.preventDefault();\n\n if (! _handleDropDependency.call(this, dt))\n dt.setDropEffect('none');\n}\n\n\nfunction onDrop(eventType, event) {\n event.stopPropagation();\n var dt = new DragDrop(event);\n DragDrop.service.postMessageSync('dragdropcompleted', {\n eventType: 'drop',\n dragDrop: dt,\n dropFacet: this,\n component: this.owner\n });\n}\n\n\nfunction postToService(eventType, event) {\n DragDrop.service.postMessageSync(eventType, {\n event: event,\n dropFacet: this,\n component: this.owner\n });\n}\n\n\nvar _handleDropDependency = _.throttle(_handleDropDependencyNothrottle, 50);\nfunction _handleDropDependencyNothrottle(dt, originalDropComponent) {\n var allow = this.config.allow\n , parentAllowed = true;\n\n originalDropComponent = originalDropComponent || this.owner;\n\n if (allow && allow.checkParent) {\n var parent = this.owner.getScopeParent('Drop');\n if (parent)\n parentAllowed = _handleDropDependencyNothrottle.call(parent.drop, dt, originalDropComponent);\n }\n\n return parentAllowed && _isDropAllowed.call(this, dt, originalDropComponent);\n}\n\n\n/**\n * Checks if drop is allowed based on facet configuration (see above)\n * \n * @param {DragDrop} dt\n * @return {Boolean}\n */\nfunction _isDropAllowed(dt, originalDropComponent) {\n var allow = this.config.allow;\n\n if (dt.isComponent()) {\n var allowComps = allow && allow.components\n , meta = dt.getComponentMeta();\n\n switch (typeof allowComps) {\n case 'undefined':\n return true;\n case 'boolean':\n return allowComps;\n // component class\n case 'string':\n return meta && meta.compClass == allowComps;\n // test function\n case 'function':\n return allowComps.call(this.owner, meta, dt, originalDropComponent);\n case 'object':\n if (Array.isArray(allowComps))\n // list of allowed classes\n return allowComps.indexOf(meta && meta.compClass) >= 0;\n else {\n // map of class: boolean|test function\n var test = allowComps[meta && meta.compClass];\n return !! _.result(test, this.owner, meta, dt);\n }\n default:\n throw new Error('Incorrect allowed components in config');\n }\n } else {\n var dataTypes = allow && allow.dataTypes\n switch (typeof dataTypes) {\n case 'undefined':\n return false;\n case 'string':\n return dt.types.indexOf(dataTypes) >= 0;\n }\n }\n\n // TODO test for other data types\n}\n", "'use strict';\n\nvar ComponentFacet = require('../c_facet')\n , facetsRegistry = require('./cf_registry')\n , miloCore = require('milo-core')\n , Messenger = miloCore.Messenger\n , DOMEventsSource = require('../msg_src/dom_events')\n , _ = miloCore.proto;\n\n\n/**\n * `milo.registry.facets.get('Events')`\n * Component facet that manages subscriptions to DOM events using [Messenger](../../messenger/index.js.html) with [DOMEventsSource](../msg_src/dom_events.js.html).\n * All public methods of Messenger and `trigger` method of [DOMEventsSource](../msg_src/dom_events.js.html) are proxied directly to this facet.\n * For example, to subscribe to `click` event use:\n * ```\n * component.frame.on('click', function() {\n * // ...\n * });\n * ```\n * See [Messenger](../../messenger/index.js.html)\n */\nvar Events = _.createSubclass(ComponentFacet, 'Events');\n\n\n/**\n * ####Events facet instance methods####\n *\n * - [init](#Events$init) - called by constructor automatically\n */\n_.extendProto(Events, {\n init: Events$init\n // _reattach: _reattachEventsOnElementChange\n});\n\nfacetsRegistry.add(Events);\n\nmodule.exports = Events;\n\n\n/**\n * Expose DOMEventsSource trigger method on Events prototype\n */\nvar MSG_SOURCE_KEY = '_domEventsSource'\nDOMEventsSource.useWith(Events, MSG_SOURCE_KEY, ['trigger']);\n\n\n/**\n * Events facet instance method\n * Initialzes facet, connects DOMEventsSource to facet's messenger\n */\nfunction Events$init() {\n ComponentFacet.prototype.init.apply(this, arguments);\n\n var domEventsSource = new DOMEventsSource(this, undefined, undefined, this.owner);\n this._setMessageSource(domEventsSource);\n _.defineProperty(this, MSG_SOURCE_KEY, domEventsSource);\n}\n", "'use strict';\n\n\nvar ComponentFacet = require('../c_facet')\n , facetsRegistry = require('./cf_registry')\n , miloCore = require('milo-core')\n , Messenger = miloCore.Messenger\n , FrameMessageSource = require('../msg_src/frame')\n , domEventsConstructors = require('../../services/de_constrs')\n , _ = miloCore.proto;\n\n\n/**\n * `milo.registry.facets.get('Frame')`\n * Component facet that simplifies sending window messages to iframe and subscribing to messages on inner window of iframe.\n * All public methods of Messenger and `trigger` method of [FrameMessageSource](../msg_src/frame.js.html) are proxied directly to this facet.\n * For example, to send custom message to iframe window use:\n * ```\n * iframeComponent.frame.trigger('mymessage', myData);\n * ```\n * To subscribe to this messages inside frame use (with milo - see [milo.mail](../../mail/index.js.html)):\n * ```\n * milo.mail.on('message:mymessage', function(msgType, msgData) {\n * // data is inside of window message data\n * // msgType == 'message:mymessage'\n * var myData = msgData.data;\n * // ... app logic here\n * });\n * ```\n * or without milo:\n * ```\n * window.attachEventListener('message', function(message) {\n * var msgType = message.type; // e.g., 'mymessage'\n * var myData = message.data;\n * // ... message routing and code here\n * });\n * ```\n * Milo does routing based on sent message type automatically.\n * See [Messenger](../../messenger/index.js.html) and [milo.mail](../../mail/index.js.html).\n */\n var Frame = _.createSubclass(ComponentFacet, 'Frame');\n\n\n/**\n * Calls passed function when frame DOM becomes ready. If already ready calls immediately\n */\nvar Frame$whenReady = _makeWhenReadyFunc(Frame$isReady, 'domready');\n\n/**\n * Calls passed function when frame milo becomes ready. If already ready calls immediately\n */\nvar Frame$whenMiloReady = _makeWhenReadyFunc(Frame$isMiloReady, 'message:miloready');\n\n\n/**\n * ####Events facet instance methods####\n *\n * - [init](#Frame$init) - called by constructor automatically\n */\n_.extendProto(Frame, {\n init: Frame$init,\n start: Frame$start,\n destroy: Frame$destroy,\n getWindow: Frame$getWindow,\n isReady: Frame$isReady,\n whenReady: Frame$whenReady,\n isMiloReady: Frame$isMiloReady,\n whenMiloReady: Frame$whenMiloReady,\n milo: Frame$milo\n // _reattach: _reattachEventsOnElementChange\n});\n\n\nfacetsRegistry.add(Frame);\n\nmodule.exports = Frame;\n\n\n/**\n * Expose FrameMessageSource trigger method on Events prototype\n */\nvar MSG_SOURCE_KEY = '_messageSource';\nFrameMessageSource.useWith(Frame, MSG_SOURCE_KEY, ['trigger']);\n\n\n/**\n * Frame facet instance method\n * Initialzes facet, connects FrameMessageSource to facet's messenger\n */\nfunction Frame$init() {\n ComponentFacet.prototype.init.apply(this, arguments);\n \n var messageSource = new FrameMessageSource(this, undefined, undefined, this.owner);\n this._setMessageSource(messageSource);\n\n _.defineProperty(this, MSG_SOURCE_KEY, messageSource);\n}\n\n\n/**\n * Frame facet instance method\n * Emits frameloaded event when ready.\n */\nfunction Frame$start() {\n ComponentFacet.prototype.start.apply(this, arguments);\n var self = this;\n milo(postDomReady);\n\n function postDomReady(event) {\n self.postMessage('domready', event);\n }\n}\n\n\nfunction Frame$destroy() {\n ComponentFacet.prototype.destroy.apply(this, arguments);\n}\n\n\n/**\n * Frame facet instance method\n * Retrieves the internal window of the frame \n *\n * @param {Window}\n */\nfunction Frame$getWindow() {\n return this.owner.el.contentWindow;\n}\n\n\n/**\n * Frame facet instance method\n * Returns document.readyState if frame doument state is 'interactive' or 'complete', false otherwise\n *\n * @return {String|Boolean}\n */\nfunction Frame$isReady() {\n var readyState = this.getWindow().document.readyState;\n return readyState != 'loading' ? readyState : false;\n}\n\n\n/**\n * Frame facet instance method\n * Returns true if milo is loaded and has finished initializing inside the frame\n *\n * @return {Boolean}\n */\nfunction Frame$isMiloReady() {\n var frameMilo = this.getWindow().milo;\n return this.isReady() && frameMilo && frameMilo.milo_version;\n}\n\n\n/**\n * Gives access to milo in the frame (assuming it is loaded there)\n * Calls function when both milo and DOM are ready if function is passed.\n * Returns the reference to milo inside the frame if the window is already available.\n * \n * @param {Function} func function to be called when milo and DOM are ready in the frame\n * @return {Function} reference to milo in the frame \n */\nfunction Frame$milo(func) {\n if (typeof func == 'function') {\n var self = this;\n this.whenMiloReady(function() {\n self.getWindow().milo(func)\n });\n }\n var win = this.getWindow();\n return win && win.milo;\n}\n\n\nfunction _makeWhenReadyFunc(isReadyFunc, event) {\n return function Frame_whenReadyFunc(func) { // , arguments\n var self = this\n , args = _.slice(arguments, 1);\n if (isReadyFunc.call(this))\n callFunc();\n else\n this.on(event, callFunc);\n\n function callFunc() {\n func.apply(self, args);\n }\n }\n}\n", @@ -203,7 +203,7 @@ "'use strict';\n\nvar Component = require('../../c_class')\n , componentsRegistry = require('../../c_registry')\n , miloCore = require('milo-core')\n , _ = miloCore.proto\n , logger = miloCore.util.logger\n , DOMListeners = require('../../../util/dom_listeners');\n\n\nvar TOGGLE_CSS_CLASS = 'dropdown-toggle'\n , MENU_CSS_CLASS = 'dropdown-menu';\n\n\nvar MLDropdown = Component.createComponentClass('MLDropdown', {\n events: undefined,\n dom: {\n cls: ['ml-bs-dropdown', 'dropdown']\n }\n});\n\ncomponentsRegistry.add(MLDropdown);\n\nmodule.exports = MLDropdown;\n\n\n_.extendProto(MLDropdown, {\n start: MLDropdown$start,\n destroy: MLDropdown$destroy,\n toggleMenu: MLDropdown$toggleMenu,\n showMenu: MLDropdown$showMenu,\n hideMenu: MLDropdown$hideMenu\n});\n\n\nfunction MLDropdown$start() {\n var toggleEl = this.el.querySelector('.' + TOGGLE_CSS_CLASS)\n , menuEl = this.el.querySelector('.' + MENU_CSS_CLASS);\n\n if (! (toggleEl && menuEl))\n return logger.error('MLDropdown:', TOGGLE_CSS_CLASS, 'or', MENU_CSS_CLASS, 'isn\\'t found');\n\n var doc = window.document\n , clickHandler = this.toggleMenu.bind(this, undefined);\n\n var listeners = new DOMListeners;\n this._dropdown = {\n menu: menuEl,\n visible: false,\n listeners: listeners\n };\n this.hideMenu();\n var self = this;\n\n listeners.add(toggleEl, 'click', clickHandler);\n //maybe only add this events if is open?\n listeners.add(doc, 'mouseout', onDocOut);\n listeners.add(doc, 'click', onClick);\n\n\n function onDocOut(event) {\n var target = event.target\n , relatedTarget = event.relatedTarget\n , listeners = self._dropdown.listeners;\n\n if (isIframe(target))\n listeners.remove(target.contentWindow.document, 'click', onClick);\n\n if (isIframe(relatedTarget))\n listeners.add(relatedTarget.contentWindow.document, 'click', onClick);\n }\n\n function onClick(event) {\n if (!self.el.contains(event.target))\n self.hideMenu();\n }\n}\n\n\nfunction isIframe(el) {\n return el && el.tagName == 'IFRAME';\n}\n\n\nfunction MLDropdown$destroy() {\n this._dropdown.listeners.removeAll();\n delete this._dropdown;\n Component.prototype.destroy.apply(this, arguments);\n}\n\n\nfunction MLDropdown$showMenu() {\n this.toggleMenu(true);\n}\n\n\nfunction MLDropdown$hideMenu() {\n this.toggleMenu(false);\n}\n\n\nfunction MLDropdown$toggleMenu(doShow) {\n doShow = typeof doShow == 'undefined'\n ? ! this._dropdown.visible\n : !! doShow;\n\n this._dropdown.visible = doShow;\n\n var menu = this._dropdown.menu;\n menu.style.display = doShow\n ? 'block'\n : 'none';\n}\n", "'use strict';\n\n\n// \n// milo.config\n// -----------\n\n// It is the function that allows to change milo configurations and also\n// access them on config's properties.\n\n// ```javascript\n// milo.config({\n// attrs: {\n// bind: 'ml-bind',\n// load: 'ml-load'\n// }\n// });\n// ```\n\n\nvar miloCore = require('milo-core')\n , _ = miloCore.proto\n , doT = miloCore.util.doT;\n\n\nvar config = module.exports = miloCore.config;\n\n\nconfig({\n attrs: {\n bind: 'ml-bind',\n load: 'ml-load'\n },\n componentRef: '___milo_component',\n componentPrefix: 'milo_',\n template: {\n compile: doT.compile\n },\n domStorage: {\n typeSuffix: ':___milo_data_type',\n prefixSeparator: '/',\n root: '',\n messageKey: '___milo_message/',\n messageTimestamp: '___milo_timestamp',\n quotaExceeded: {\n throwError: true,\n message: false\n }\n },\n dragDrop: {\n dataTypes: {\n component: 'x-application/milo/component',\n componentMetaTemplate: 'x-application/milo/component-meta/%class/%name/%params',\n componentMetaRegex: /^x\\-application\\/milo\\/component\\-meta\\/([a-z0-9]+)\\/([a-z0-9]+)\\/([a-z0-9]*)$/,\n }\n },\n request: {\n jsonpTimeout: 60000,\n jsonpCallbackPrefix: '___milo_callback_',\n optionsKey: '___milo_options',\n defaults: {\n timeout: 60000\n }\n },\n websocket: {\n rpc: {\n timeout: 15000,\n responsePrefix: 'response_'\n }\n },\n deprecationWarning: 'once'\n});\n", "'use strict';\n\n\nvar miloMail = require('./services/mail')\n , request = require('./util/request')\n , miloCore = require('milo-core')\n , logger = miloCore.util.logger\n , _ = miloCore.proto\n , utilDom = require('./util/dom')\n , config = require('./config')\n , LoadAttribute = require('./attributes/a_load');\n\n\nmodule.exports = loader;\n\n/**\n * `milo.loader`\n * \n * Recursively scans the document tree inside `rootEl` (document.body by default) looking for __ml-load__ @attribute.\n * One level load is executed. No additional loader get called on inside __ml-load__ attributes. \n *\n * Possible usages:\n * - milo.loader([myRootEl,][myRemoveAttribute,]myCallback)\n * \n * @param {Element} rootEl Root element inside which DOM will be scanned (document.body by default).\n * @param {Boolean} removeAttribute If set to true, then the __ml-load__ attribute will be removed once loader has been executed (False by default).\n * @param {Function} callback Callback to call after all elements get loaded (Required).\n */\nfunction loader(rootEl, removeAttribute, callback) {\n milo(function() {\n _loader(rootEl, removeAttribute, callback);\n });\n}\n\n\nfunction _loader(rootEl, removeAttribute, callback) {\n if (typeof rootEl == 'function') {\n callback = rootEl;\n rootEl = undefined;\n removeAttribute = false;\n }\n\n if (typeof removeAttribute == 'function') {\n callback = removeAttribute;\n removeAttribute = false;\n }\n\n rootEl = rootEl || document.body;\n\n miloMail.postMessage('loader', { state: 'started' });\n _loadViewsInElement(rootEl, removeAttribute, function(views) {\n miloMail.postMessage('loader', { \n state: 'finished',\n views: views\n });\n callback(views);\n });\n}\n\n\nfunction _loadViewsInElement(rootEl, removeAttribute, callback) {\n var loadElements = rootEl.getAttribute(config.attrs.load)\n ? [rootEl]\n : rootEl.querySelectorAll('[' + config.attrs.load + ']');\n\n var views = {}\n , totalCount = loadElements.length\n , loadedCount = 0;\n\n _.forEach(loadElements, function (el) {\n loadView(el, removeAttribute, function(err) {\n views[el.id] = err || el;\n loadedCount++;\n if (loadedCount == totalCount)\n callback(views);\n });\n });\n};\n\n\nfunction loadView(el, removeAttribute, callback) {\n if (utilDom.children(el).length)\n throw new Error('can\\'t load html into element that is not empty');\n\n var attr = new LoadAttribute(el);\n\n attr.parse().validate();\n\n request.get(attr.loadUrl, function(err, html) {\n if (err) {\n err.message = err.message || 'can\\'t load file ' + attr.loadUrl;\n // logger.error(err.message);\n callback(err);\n return;\n }\n\n el.innerHTML = html;\n if (removeAttribute) LoadAttribute.remove(el);\n callback(null);\n });\n}\n", - "'use strict';\n\nvar miloCore = require('milo-core')\n , _ = miloCore.proto;\n\n\n// register included facets\nrequire('./use_facets');\n\n// register included components\nrequire('./use_components');\n\n\n/**\n * `milo`\n *\n * A minimalist browser framework that binds DOM elements to JS components and components to models.\n *\n * `milo` is available as global object in the browser.\n * At the moment it is not possiible to require it with browserify to have it bundled with the app because of the way [brfs](https://github.com/substack/brfs) browserify plugin is implemented.\n * It is possible though to require `milo` with node to use universal parts of the framework (abstract classes, Messenger, Model, etc.):\n * ```\n * var milo = require('mol-milo');\n * ```\n * \n * `milo` itself is a function that in the browser can be used to delay execution until DOM is ready.\n */\nfunction milo(func) {\n milo.util.domReady(func);\n}\n\n\n/**\n * ####Milo packages####\n *\n * - [loader](./loader.js.html) - loading subviews into page\n * - [binder](./binder.js.html) - components instantiation and binding of DOM elements to them\n * - [minder](./minder.js.html) - data reactivity, one or two way, shallow or deep, as you like it\n * - [mail](./mail/index.js.html) - applicaiton level messenger, also connects to messages from other windows dispatched with `window.postMessage`.\n * - [config](./config.js.html) - milo configuration\n * - [util](./util/index.js.html) - logger, request, dom, check, error, etc.\n * - [classes](./classes.js.html) - abstract and base classes\n * - [attributes](./attributes/index.js.html) - classes that wrap DOM elements attributes recognized by milo\n * - [ComponentFacet](./components/c_facet.js.html) - base class of Component facet\n * - [Component](./components/c_class.js.html) - base Component class\n * - [Messenger](./messenger/index.js.html) - generic Messenger used in most other milo classes, can be mixed into app classes too.\n * - [Model](./model/index.js.html) - Model class that emits messages on changes to any depth without timer based watching\n * - [registry](./registry.js.html) - registries of fasets and components classes\n */\n_.extend(milo, {\n Messenger: miloCore.Messenger,\n Model: miloCore.Model,\n minder: miloCore.minder,\n loader: require('./loader'),\n binder: require('./binder'),\n mail: require('./services/mail'),\n window: require('./services/window'),\n config: require('./config'),\n util: require('./util'),\n classes: require('./classes'),\n attributes: require('./attributes'),\n ComponentFacet: require('./components/c_facet'),\n Component: require('./components/c_class'),\n Command: require('./command'),\n registry: require('./registry'),\n milo_version: '0.2.1',\n createComponentClass: require('./util/create_component_class'),\n destroy: destroy\n});\n\n\n// export for node/browserify\nif (typeof module == 'object' && module.exports) \n module.exports = milo;\n\n// global milo for browser\nif (typeof window == 'object') {\n window.milo = milo;\n milo.mail.trigger('miloready');\n}\n\n\nfunction destroy() {\n miloCore.destroy();\n milo.mail.destroy();\n milo.window.destroy();\n milo.util.destroy();\n}\n", + "'use strict';\n\nvar miloCore = require('milo-core')\n , _ = miloCore.proto;\n\n\n// register included facets\nrequire('./use_facets');\n\n// register included components\nrequire('./use_components');\n\n\n/**\n * `milo`\n *\n * A minimalist browser framework that binds DOM elements to JS components and components to models.\n *\n * `milo` is available as global object in the browser.\n * At the moment it is not possiible to require it with browserify to have it bundled with the app because of the way [brfs](https://github.com/substack/brfs) browserify plugin is implemented.\n * It is possible though to require `milo` with node to use universal parts of the framework (abstract classes, Messenger, Model, etc.):\n * ```\n * var milo = require('mol-milo');\n * ```\n * \n * `milo` itself is a function that in the browser can be used to delay execution until DOM is ready.\n */\nfunction milo(func) {\n milo.util.domReady(func);\n}\n\n\n/**\n * ####Milo packages####\n *\n * - [loader](./loader.js.html) - loading subviews into page\n * - [binder](./binder.js.html) - components instantiation and binding of DOM elements to them\n * - [minder](./minder.js.html) - data reactivity, one or two way, shallow or deep, as you like it\n * - [mail](./mail/index.js.html) - applicaiton level messenger, also connects to messages from other windows dispatched with `window.postMessage`.\n * - [config](./config.js.html) - milo configuration\n * - [util](./util/index.js.html) - logger, request, dom, check, error, etc.\n * - [classes](./classes.js.html) - abstract and base classes\n * - [attributes](./attributes/index.js.html) - classes that wrap DOM elements attributes recognized by milo\n * - [ComponentFacet](./components/c_facet.js.html) - base class of Component facet\n * - [Component](./components/c_class.js.html) - base Component class\n * - [Messenger](./messenger/index.js.html) - generic Messenger used in most other milo classes, can be mixed into app classes too.\n * - [Model](./model/index.js.html) - Model class that emits messages on changes to any depth without timer based watching\n * - [registry](./registry.js.html) - registries of fasets and components classes\n */\n_.extend(milo, {\n Messenger: miloCore.Messenger,\n Model: miloCore.Model,\n minder: miloCore.minder,\n loader: require('./loader'),\n binder: require('./binder'),\n mail: require('./services/mail'),\n window: require('./services/window'),\n config: require('./config'),\n util: require('./util'),\n classes: require('./classes'),\n attributes: require('./attributes'),\n ComponentFacet: require('./components/c_facet'),\n Component: require('./components/c_class'),\n Command: require('./command'),\n registry: require('./registry'),\n milo_version: '0.2.2',\n createComponentClass: require('./util/create_component_class'),\n destroy: destroy\n});\n\n\n// export for node/browserify\nif (typeof module == 'object' && module.exports) \n module.exports = milo;\n\n// global milo for browser\nif (typeof window == 'object') {\n window.milo = milo;\n milo.mail.trigger('miloready');\n}\n\n\nfunction destroy() {\n miloCore.destroy();\n milo.mail.destroy();\n milo.window.destroy();\n milo.util.destroy();\n}\n", "'use strict';\n\n/**\n * Registries of facets and of components\n *\n * - [facets](./components/c_facets/cf_registry.js.html)\n * - [components](./components/c_registry.js.html)\n */\nvar registry = module.exports = {\n facets: require('./components/c_facets/cf_registry'),\n components: require('./components/c_registry'),\n commands: require('./command/cmd_registry')\n};\n", "'use strict';\n\n// \n// ###dom events constructors\n\n\nvar _ = require('milo-core').proto;\n\n\n// https://developer.mozilla.org/en-US/docs/Web/Reference/Events\n\nvar eventTypes = {\n ClipboardEvent: ['copy', 'cut', 'paste', 'beforecopy', 'beforecut', 'beforepaste'],\n Event: ['input', 'readystatechange'],\n FocusEvent: ['focus', 'blur', 'focusin', 'focusout'],\n KeyboardEvent: ['keydown', 'keypress', 'keyup'],\n MouseEvent: ['click', 'contextmenu', 'dblclick', 'mousedown', 'mouseup',\n 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover',\n 'show' /* context menu */],\n TouchEvent: ['touchstart', 'touchend', 'touchmove', 'touchenter', 'touchleave', 'touchcancel'],\n};\n\n\n// mock window and event constructors for testing\nif (typeof window != 'undefined')\n var global = window;\nelse {\n global = {};\n _.eachKey(eventTypes, function(eTypes, eventConstructorName) {\n var eventConstructor = _.makeFunction(eventConstructorName, 'type', 'properties',\n 'this.type = type; _.extend(this, properties);');\n global[eventConstructorName] = eventConstructor;\n });\n}\n\n\nvar domEventsConstructors = {};\n\n_.eachKey(eventTypes, function(eTypes, eventConstructorName) {\n eTypes.forEach(function(type) {\n if (Object.hasOwnProperty(domEventsConstructors, type))\n throw new Error('duplicate event type ' + type);\n\n domEventsConstructors[type] = global[eventConstructorName];\n });\n});\n\n\nmodule.exports = domEventsConstructors;\n", "'use strict';\n\n\nvar miloCore = require('milo-core')\n , MessageSource = miloCore.classes.MessageSource\n , Component = require('../components/c_class')\n , domEventsConstructors = require('./de_constrs') // TODO merge with DOMEventSource ??\n , _ = miloCore.proto\n , check = miloCore.util.check\n , Match = check.Match;\n\nvar DOMEmitterSource = _.createSubclass(MessageSource, 'DOMEmitterSource', true);\n\n\n_.extendProto(DOMEmitterSource, {\n // implementing MessageSource interface\n init: init,\n destroy: DOMEmitterSource$destroy,\n addSourceSubscriber: _.partial(sourceSubscriberMethod, 'addEventListener'),\n removeSourceSubscriber: _.partial(sourceSubscriberMethod, 'removeEventListener'),\n postMessage: DOMEmitterSource$postMessage,\n trigger: trigger,\n\n // class specific methods\n emitter: emitter,\n handleEvent: handleEvent, // event dispatcher - as defined by Event DOM API\n});\n\nmodule.exports = DOMEmitterSource;\n\n\nvar useCapturePattern = /__capture$/\n , useCapturePostfix = '__capture';\n\n\n// init DOM event source\nfunction init(hostObject, proxyMethods, messengerAPIOrClass, eventEmitter) {\n this.eventEmitter = eventEmitter;\n MessageSource.prototype.init.apply(this, arguments);\n}\n\n\nfunction DOMEmitterSource$destroy() {\n MessageSource.prototype.destroy.apply(this, arguments);\n delete this.eventEmitter;\n}\n\n\n// get DOM element of component\nfunction emitter() {\n return this.eventEmitter;\n}\n\n\nfunction sourceSubscriberMethod(method, eventType) {\n if (! (eventType && typeof eventType == 'string')) return;\n var capture = useCapturePattern.test(eventType);\n eventType = eventType.replace(useCapturePattern, '');\n this.emitter()[method](eventType, this, capture);\n}\n\n\n// event dispatcher - as defined by Event DOM API\nfunction handleEvent(event) {\n var isCapturePhase;\n if (typeof window != 'undefined')\n isCapturePhase = event.eventPhase == window.Event.CAPTURING_PHASE;\n\n if (isCapturePhase)\n event += useCapturePostfix;\n\n this.dispatchMessage(event.type, event);\n}\n\n\nfunction DOMEmitterSource$postMessage(message, data) {\n this.messenger.postMessageSync(message, data);\n}\n\n\nfunction trigger(eventType, properties) {\n check(eventType, String);\n check(properties, Match.Optional(Object));\n\n eventType = eventType.replace(useCapturePattern, '');\n var EventConstructor = domEventsConstructors[eventType];\n\n if (typeof EventConstructor != 'function')\n throw new Error('unsupported event type');\n\n // check if it is correct\n if (typeof properties != 'undefined')\n properties.type = eventType;\n\n var domEvent = new EventConstructor(eventType, properties);\n var notCancelled = this.emitter().dispatchEvent(domEvent);\n return notCancelled;\n}\n", @@ -235,7 +235,7 @@ "'use strict';\n\n\nvar miloCore = require('milo-core')\n , MessageSource = miloCore.classes.MessageSource\n , _ = miloCore.proto\n , logger = miloCore.util.logger\n , uniqueId = require('../../util/unique_id')\n , config = require('../../config')\n , check = miloCore.util.check\n , Match = check.Match;\n\n\nvar WSMessageSource = _.createSubclass(MessageSource, 'WSMessageSource', true);\n\n\n_.extendProto(WSMessageSource, {\n // implementing MessageSource interface\n addSourceSubscriber: addSourceSubscriber,\n removeSourceSubscriber: removeSourceSubscriber,\n \n // class specific methods\n handleEvent: WSMessageSource$handleEvent,\n connect: WSMessageSource$connect,\n trigger: WSMessageSource$trigger\n});\n\n\nmodule.exports = WSMessageSource;\n\n\nfunction WSMessageSource$connect(options) {\n this._options = options = options || {};\n\n var host = options.host || window.location.host.replace(/:.*/, '')\n , port = options.port || '8080';\n\n var self = this;\n\n if (this._ws) {\n // TODO should unsubscribe differently\n this._ws.onopen = this.ws.onmessage = this.ws.onclose = this.ws.onerror = undefined;\n this._ws.close();\n }\n\n this._ws = new WebSocket('ws://' + host + ':' + port);\n\n // TODO reconnect\n}\n\n\n\nfunction addSourceSubscriber (sourceMessage) {\n _wsSubscriberMethod.call(this, 'addEventListener', sourceMessage);\n}\n\n\nfunction removeSourceSubscriber (sourceMessage) {\n _wsSubscriberMethod.call(this, 'removeEventListener', sourceMessage);\n}\n\n\nfunction _wsSubscriberMethod (method, sourceMessage) { \n if (!this._ws) return logger.error('websocket is not created');\n this._ws[method](sourceMessage, this);\n}\n\n\n// event dispatcher - as defined by Event DOM API\nfunction WSMessageSource$handleEvent (event) {\n this.dispatchMessage(event.type, event);\n}\n\n\nfunction WSMessageSource$trigger (msg, data, callback) {\n if (!this._ws) return logger.error('websocket is not created');\n\n data = data || {};\n data.type = msg;\n\n var self = this;\n \n if (callback) {\n data.callbackCorrId = uniqueId();\n var interval = _.delay(onTimeout, config.websocket.rpc.timeout);\n toggleRpcSubscription('once', data.callbackCorrId);\n } \n\n this._ws.send(JSON.stringify(data));\n\n\n function onTimeout() {\n toggleRpcSubscription('off', data.callbackCorrId);\n callback(new Error('websocket rpc: timeout'));\n }\n\n function onResponse(msg, msgData) {\n clearInterval(interval);\n if (typeof msgData == 'object') {\n var err = msgData.error ? new Error(msgData.error) : null;\n callback(err, msgData.data)\n } else\n callback(new Error('websocket rpc: invalid response data'), msgData);\n }\n\n function toggleRpcSubscription(onOff, corrId) {\n self.messenger[onOff](config.websocket.rpc.responsePrefix + corrId, onResponse);\n }\n}\n", ";(function(){\n\n// This would be the place to edit if you want a different\n// Base32 implementation\n\nvar alphabet = '0123456789abcdefghjkmnpqrtuvwxyz'\nvar alias = { o:0, i:1, l:1, s:5 }\n\n/**\n * Build a lookup table and memoize it\n *\n * Return an object that maps a character to its\n * byte value.\n */\n\nvar lookup = function() {\n var table = {}\n // Invert 'alphabet'\n for (var i = 0; i < alphabet.length; i++) {\n table[alphabet[i]] = i\n }\n // Splice in 'alias'\n for (var key in alias) {\n if (!alias.hasOwnProperty(key)) continue\n table[key] = table['' + alias[key]]\n }\n lookup = function() { return table }\n return table\n}\n\n/**\n * A streaming encoder\n *\n * var encoder = new base32.Encoder()\n * var output1 = encoder.update(input1)\n * var output2 = encoder.update(input2)\n * var lastoutput = encode.update(lastinput, true)\n */\n\nfunction Encoder() {\n var skip = 0 // how many bits we will skip from the first byte\n var bits = 0 // 5 high bits, carry from one byte to the next\n\n this.output = ''\n\n // Read one byte of input\n // Should not really be used except by \"update\"\n this.readByte = function(byte) {\n // coerce the byte to an int\n if (typeof byte == 'string') byte = byte.charCodeAt(0)\n\n if (skip < 0) { // we have a carry from the previous byte\n bits |= (byte >> (-skip))\n } else { // no carry\n bits = (byte << skip) & 248\n }\n\n if (skip > 3) {\n // not enough data to produce a character, get us another one\n skip -= 8\n return 1\n }\n\n if (skip < 4) {\n // produce a character\n this.output += alphabet[bits >> 3]\n skip += 5\n }\n\n return 0\n }\n\n // Flush any remaining bits left in the stream\n this.finish = function(check) {\n var output = this.output + (skip < 0 ? alphabet[bits >> 3] : '') + (check ? '$' : '')\n this.output = ''\n return output\n }\n}\n\n/**\n * Process additional input\n *\n * input: string of bytes to convert\n * flush: boolean, should we flush any trailing bits left\n * in the stream\n * returns: a string of characters representing 'input' in base32\n */\n\nEncoder.prototype.update = function(input, flush) {\n for (var i = 0; i < input.length; ) {\n i += this.readByte(input[i])\n }\n // consume all output\n var output = this.output\n this.output = ''\n if (flush) {\n output += this.finish()\n }\n return output\n}\n\n// Functions analogously to Encoder\n\nfunction Decoder() {\n var skip = 0 // how many bits we have from the previous character\n var byte = 0 // current byte we're producing\n\n this.output = ''\n\n // Consume a character from the stream, store\n // the output in this.output. As before, better\n // to use update().\n this.readChar = function(char) {\n if (typeof char != 'string'){\n if (typeof char == 'number') {\n char = String.fromCharCode(char)\n }\n }\n char = char.toLowerCase()\n var val = lookup()[char]\n if (typeof val == 'undefined') {\n // character does not exist in our lookup table\n return // skip silently. An alternative would be:\n // throw Error('Could not find character \"' + char + '\" in lookup table.')\n }\n val <<= 3 // move to the high bits\n byte |= val >>> skip\n skip += 5\n if (skip >= 8) {\n // we have enough to preduce output\n this.output += String.fromCharCode(byte)\n skip -= 8\n if (skip > 0) byte = (val << (5 - skip)) & 255\n else byte = 0\n }\n\n }\n\n this.finish = function(check) {\n var output = this.output + (skip < 0 ? alphabet[bits >> 3] : '') + (check ? '$' : '')\n this.output = ''\n return output\n }\n}\n\nDecoder.prototype.update = function(input, flush) {\n for (var i = 0; i < input.length; i++) {\n this.readChar(input[i])\n }\n var output = this.output\n this.output = ''\n if (flush) {\n output += this.finish()\n }\n return output\n}\n\n/** Convenience functions\n *\n * These are the ones to use if you just have a string and\n * want to convert it without dealing with streams and whatnot.\n */\n\n// String of data goes in, Base32-encoded string comes out.\nfunction encode(input) {\n var encoder = new Encoder()\n var output = encoder.update(input, true)\n return output\n}\n\n// Base32-encoded string goes in, decoded data comes out.\nfunction decode(input) {\n var decoder = new Decoder()\n var output = decoder.update(input, true)\n return output\n}\n\nvar base32 = {\n Decoder: Decoder,\n Encoder: Encoder,\n encode: encode,\n decode: decode\n}\n\nif (typeof window !== 'undefined') {\n // we're in a browser - OMG!\n window.base32 = base32\n}\n\nif (typeof module !== 'undefined' && module.exports) {\n // nodejs/browserify\n module.exports = base32\n}\n})();\n", "\n// not implemented\n// The reason for having an empty file and not throwing is to allow\n// untraditional implementation of this module.\n", - "'use strict';\n\nvar _ = require('mol-proto')\n , check = require('../util/check')\n , Match = check.Match\n , config = require('../config');\n\n\nmodule.exports = Mixin;\n\n/**\n * `milo.classes.Mixin` - an abstract Mixin class.\n * Can be subclassed using:\n * ```\n * var MyMixin = _.createSubclass(milo.classes.Mixin, 'MyMixin');\n * ```\n *\n * Mixin pattern is also used, but Mixin in milo is implemented as a separate object that is stored on the property of the host object and can create proxy methods on the host object if required.\n * Classes [Messenger](../messenger/index.js.html) and [MessageSource](../messenger/m_source.js.html) are subclasses of Mixin abstract class. `this` in proxy methods refers to Mixin instance, the reference to the host object is `this._hostObject`.\n *\n * @param {Object} hostObject Optional object where a Mixin instance will be stored on. It is used to proxy methods and also to find the reference when it is needed for host object implementation.\n * @param {Object} proxyMethods Optional map of proxy method names as keys and Mixin methods names as values, so proxied methods can be renamed to avoid name-space conflicts if two different Mixin instances with the same method names are put on the object\n * @param {List} arguments all constructor arguments will be passed to init method of Mixin subclass together with hostObject and proxyMethods\n * @return {Mixin}\n */\nfunction Mixin(hostObject, proxyMethods) { // , other args - passed to init method\n check(hostObject, Match.Optional(Match.OneOf(Object, Function)));\n\n // store hostObject\n _.defineProperty(this, '_hostObject', hostObject);\n\n // proxy methods to hostObject\n if (proxyMethods)\n this._createProxyMethods(proxyMethods);\n\n // calling init if it is defined in the class\n if (this.init)\n this.init.apply(this, arguments);\n}\n\n\n/**\n * ####Mixin instance methods####\n * These methods are called by constructor, they are not to be called from subclasses.\n *\n * - [_createProxyMethod](#_createProxyMethod)\n * - [_createProxyMethods](#_createProxyMethods)\n */\n_.extendProto(Mixin, {\n _createProxyMethod: _createProxyMethod, // deprecated, should not be used\n _createProxyMethods: _createProxyMethods // deprecated, should not be used\n});\n\n\n/**\n * ####Mixin class methods####\n * These method should be called in host class declaration.\n *\n * - [useWith](#Mixin$$useWith)\n */\n_.extend(Mixin, {\n useWith: Mixin$$useWith\n});\n\n\n/**\n * Creates a proxied method of Mixin subclass on host object.\n *\n * @param {String} mixinMethodName name of method in Mixin subclass\n * @param {String} proxyMethodName name of created proxy method on host object\n * @param {Object} hostObject Optional reference to the host object; if not specified the host object passed to constructor wil be used. It allows to use the same instance of Mixin on two host objects.\n */\nfunction _createProxyMethod(proxyMethodName, mixinMethodName, hostObject) {\n hostObject = hostObject || this._hostObject;\n\n // Mixin class does not allow shadowing methods that exist on the host object\n if (hostObject[proxyMethodName])\n throw new Error('method ' + proxyMethodName +\n ' already defined in host object');\n\n var method = this[mixinMethodName]\n check(method, Function);\n\n // Bind proxied Mixin's method to Mixin instance\n var boundMethod = method.bind(this);\n\n _.defineProperty(hostObject, proxyMethodName, boundMethod, _.WRIT);\n}\n\n\n/**\n * Creates proxied methods of Mixin subclass on host object.\n *\n * @param {Hash[String]|Array[String]} proxyMethods map of names of methods, key - proxy method name, value - mixin method name. Can be array.\n * @param {Object} hostObject an optional reference to the host object; if not specified the host object passed to constructor wil be used. It allows to use the same instance of Mixin on two host objects.\n */\nfunction _createProxyMethods(proxyMethods, hostObject) {\n check(proxyMethods, Match.Optional(Match.OneOf([String], Match.ObjectHash(String))));\n\n // creating and binding proxy methods on the host object\n if (Array.isArray(proxyMethods))\n proxyMethods.forEach(function(methodName) {\n // method called this way to allow using _createProxyMethods with objects\n // that are not inheriting from Mixin\n _createProxyMethod.call(this, methodName, methodName, hostObject);\n }, this);\n else\n _.eachKey(proxyMethods, function(mixinMethodName, proxyMethodName) {\n // method called this way to allow using _createProxyMethods with objects\n // that are not inheriting from Mixin\n _createProxyMethod.call(this, proxyMethodName, mixinMethodName, hostObject);\n }, this);\n}\n\n\n/**\n * Sets mixin instance property name on the host class\n * Can be called only once\n *\n * @private\n * @param {Function} this Mixin subclass (not instance)\n * @param {Function} hostClass\n * @param {String} instanceKey\n */\nfunction Mixin_setInstanceKey(hostClass, method, instanceKey) {\n check(hostClass, Function);\n check(instanceKey, Match.IdentifierString);\n\n var prop = config.mixin.instancePropertiesMap\n , instanceKeys = hostClass[prop] = hostClass[prop] || {};\n\n if (instanceKeys[method.name])\n throw new Error('Mixin: instance property for method with name '\n + method.name + ' is already set');\n\n instanceKeys[method.name] = instanceKey;\n}\n\n\n/**\n * Adds method of Mixin subclass to host class prototype.\n *\n * @private\n * @param {Function} this Mixin subclass (not instance)\n * @param {String} mixinMethodName name of method in Mixin subclass\n * @param {String} hostMethodName (optional) name of created proxy method on host object, same if not specified\n * @param {Object} hostObject object class, must be specified as the last parameter (2nd or 3rd)\n */\nfunction Mixin_addMethod(hostClass, instanceKey, mixinMethodName, hostMethodName) {\n var method = this.prototype[mixinMethodName];\n check(method, Function);\n\n var wrappedMethod = _wrapMixinMethod.call(this, method);\n\n _.defineProperty(hostClass.prototype, hostMethodName, wrappedMethod, _.WRIT);\n\n Mixin_setInstanceKey(hostClass, method, instanceKey)\n}\n\n\n/**\n * Returns method that will be exposed on the host class prototype\n *\n * @private\n * @param {Function} this Mixin subclass (not instance)\n * @return {Function}\n */\nfunction _wrapMixinMethod(method) {\n return function() { // ,... arguments\n var mixinInstance = _getMixinInstance.call(this, method.name);\n return method.apply(mixinInstance, arguments);\n }\n}\n\n\n/**\n * Returns the reference to the instance of mixin subclass.\n * This method is used when methods are exposed on the host class prototype (using addMehtods) rather than on host instance.\n * Subclasses should not use this methods - whenever subclass method is exposed on the prototype it will be wrapped to set correct context for the subclass method.\n *\n * @private\n * @return {Object}\n */\nfunction _getMixinInstance(methodName) {\n if (this instanceof Mixin) return this;\n var instanceKeys = this.constructor[config.mixin.instancePropertiesMap]\n return this[instanceKeys[methodName]];\n}\n\n\n/**\n * Adds methods of Mixin subclass to host class prototype.\n *\n * @param {Function} this Mixin subclass (not instance)\n * @param {Object} hostClass host object class; must be specified.\n * @param {String} instanceKey the name of the property the host class instance will store mixin instance on\n * @param {Hash[String]|Array[String]} mixinMethods map of names of methods, key - host method name, value - mixin method name. Can be array.\n */\nfunction Mixin$$useWith(hostClass, instanceKey, mixinMethods) {\n check(mixinMethods, Match.Optional(Match.OneOf([String], Match.ObjectHash(String))));\n\n if (Array.isArray(mixinMethods))\n mixinMethods.forEach(function(methodName) {\n Mixin_addMethod.call(this, hostClass, instanceKey, methodName, methodName);\n }, this);\n else\n _.eachKey(mixinMethods, function(mixinMethodName, hostMethodName) {\n Mixin_addMethod.call(this, hostClass, instanceKey, mixinMethodName, hostMethodName);\n }, this);\n}\n", + "'use strict';\n\nvar _ = require('mol-proto')\n , check = require('../util/check')\n , Match = check.Match\n , config = require('../config');\n\n\nmodule.exports = Mixin;\n\n/**\n * `milo.classes.Mixin` - an abstract Mixin class.\n * Can be subclassed using:\n * ```\n * var MyMixin = _.createSubclass(milo.classes.Mixin, 'MyMixin');\n * ```\n *\n * Mixin pattern is also used, but Mixin in milo is implemented as a separate object that is stored on the property of the host object and can create proxy methods on the host object if required.\n * Classes [Messenger](../messenger/index.js.html) and [MessageSource](../messenger/m_source.js.html) are subclasses of Mixin abstract class. `this` in proxy methods refers to Mixin instance, the reference to the host object is `this._hostObject`.\n *\n * @param {Object} hostObject Optional object where a Mixin instance will be stored on. It is used to proxy methods and also to find the reference when it is needed for host object implementation.\n * @param {Object} proxyMethods Optional map of proxy method names as keys and Mixin methods names as values, so proxied methods can be renamed to avoid name-space conflicts if two different Mixin instances with the same method names are put on the object\n * @param {List} arguments all constructor arguments will be passed to init method of Mixin subclass together with hostObject and proxyMethods\n * @return {Mixin}\n */\nfunction Mixin(hostObject, proxyMethods) { // , other args - passed to init method\n check(hostObject, Match.Optional(Match.OneOf(Object, Function)));\n\n // store hostObject\n _.defineProperty(this, '_hostObject', hostObject);\n\n // proxy methods to hostObject\n if (proxyMethods)\n this._createProxyMethods(proxyMethods);\n\n // calling init if it is defined in the class\n if (this.init)\n this.init.apply(this, arguments);\n}\n\n\n/**\n * ####Mixin instance methods####\n * These methods are called by constructor, they are not to be called from subclasses.\n *\n * - [_createProxyMethod](#_createProxyMethod)\n * - [_createProxyMethods](#_createProxyMethods)\n */\n_.extendProto(Mixin, {\n _createProxyMethod: _createProxyMethod, // deprecated, should not be used\n _createProxyMethods: _createProxyMethods // deprecated, should not be used\n});\n\n\n/**\n * ####Mixin class methods####\n * These method should be called in host class declaration.\n *\n * - [useWith](#Mixin$$useWith)\n */\n_.extend(Mixin, {\n useWith: Mixin$$useWith\n});\n\n\n/**\n * Creates a proxied method of Mixin subclass on host object.\n *\n * @param {String} mixinMethodName name of method in Mixin subclass\n * @param {String} proxyMethodName name of created proxy method on host object\n * @param {Object} hostObject Optional reference to the host object; if not specified the host object passed to constructor wil be used. It allows to use the same instance of Mixin on two host objects.\n */\nfunction _createProxyMethod(proxyMethodName, mixinMethodName, hostObject) {\n hostObject = hostObject || this._hostObject;\n\n // Mixin class does not allow shadowing methods that exist on the host object\n if (hostObject[proxyMethodName])\n throw new Error('method ' + proxyMethodName +\n ' already defined in host object');\n\n var method = this[mixinMethodName]\n check(method, Function);\n\n // Bind proxied Mixin's method to Mixin instance\n var boundMethod = method.bind(this);\n\n _.defineProperty(hostObject, proxyMethodName, boundMethod, _.WRIT);\n}\n\n\n/**\n * Creates proxied methods of Mixin subclass on host object.\n *\n * @param {Hash[String]|Array[String]} proxyMethods map of names of methods, key - proxy method name, value - mixin method name. Can be array.\n * @param {Object} hostObject an optional reference to the host object; if not specified the host object passed to constructor wil be used. It allows to use the same instance of Mixin on two host objects.\n */\nfunction _createProxyMethods(proxyMethods, hostObject) {\n check(proxyMethods, Match.Optional(Match.OneOf([String], Match.ObjectHash(String))));\n\n // creating and binding proxy methods on the host object\n if (Array.isArray(proxyMethods))\n proxyMethods.forEach(function(methodName) {\n // method called this way to allow using _createProxyMethods with objects\n // that are not inheriting from Mixin\n _createProxyMethod.call(this, methodName, methodName, hostObject);\n }, this);\n else\n _.eachKey(proxyMethods, function(mixinMethodName, proxyMethodName) {\n // method called this way to allow using _createProxyMethods with objects\n // that are not inheriting from Mixin\n _createProxyMethod.call(this, proxyMethodName, mixinMethodName, hostObject);\n }, this);\n}\n\n\n/**\n * Sets mixin instance property name on the host class\n * Can be called only once\n *\n * @private\n * @param {Function} this Mixin subclass (not instance)\n * @param {Function} hostClass\n * @param {String} instanceKey\n */\nfunction Mixin_setInstanceKey(hostClass, method, instanceKey) {\n check(hostClass, Function);\n check(instanceKey, Match.IdentifierString);\n\n var prop = config.mixin.instancePropertiesMap\n , instanceKeys = hostClass[prop] = hostClass[prop] || {};\n\n if (instanceKeys[method.name])\n throw new Error('Mixin: instance property for method with name '\n + method.name + ' is already set');\n\n instanceKeys[method.name] = instanceKey;\n}\n\n\n/**\n * Adds method of Mixin subclass to host class prototype.\n *\n * @private\n * @param {Function} this Mixin subclass (not instance)\n * @param {String} mixinMethodName name of method in Mixin subclass\n * @param {String} hostMethodName (optional) name of created proxy method on host object, same if not specified\n * @param {Object} hostObject object class, must be specified as the last parameter (2nd or 3rd)\n */\nfunction Mixin_addMethod(hostClass, instanceKey, mixinMethodName, hostMethodName) {\n var method = this.prototype[mixinMethodName];\n check(method, Function);\n\n var wrappedMethod = _wrapMixinMethod.call(this, method);\n\n _.defineProperty(hostClass.prototype, hostMethodName, wrappedMethod, _.WRIT);\n\n Mixin_setInstanceKey(hostClass, method, instanceKey)\n}\n\n\n/**\n * Returns method that will be exposed on the host class prototype\n *\n * @private\n * @param {Function} this Mixin subclass (not instance)\n * @return {Function}\n */\nfunction _wrapMixinMethod(method) {\n return function() { // ,... arguments\n var mixinInstance = _getMixinInstance.call(this, method.name);\n return method.apply(mixinInstance, arguments);\n }\n}\n\n\n/**\n * Returns the reference to the instance of mixin subclass.\n * This method is used when methods are exposed on the host class prototype (using addMehtods) rather than on host instance.\n * Subclasses should not use this methods - whenever subclass method is exposed on the prototype it will be wrapped to set correct context for the subclass method.\n *\n * @private\n * @return {Object}\n */\nfunction _getMixinInstance(methodName) {\n if (this instanceof Mixin) return this;\n var instanceKeys = this.constructor[config.mixin.instancePropertiesMap]\n , mixinProp = instanceKeys[methodName]\n , mixin = this[mixinProp];\n if (!mixin) throw new Error('Mixin ' + mixinProp + ' does not exist');\n return mixin;\n}\n\n\n/**\n * Adds methods of Mixin subclass to host class prototype.\n *\n * @param {Function} this Mixin subclass (not instance)\n * @param {Object} hostClass host object class; must be specified.\n * @param {String} instanceKey the name of the property the host class instance will store mixin instance on\n * @param {Hash[String]|Array[String]} mixinMethods map of names of methods, key - host method name, value - mixin method name. Can be array.\n */\nfunction Mixin$$useWith(hostClass, instanceKey, mixinMethods) {\n check(mixinMethods, Match.Optional(Match.OneOf([String], Match.ObjectHash(String))));\n\n if (Array.isArray(mixinMethods))\n mixinMethods.forEach(function(methodName) {\n Mixin_addMethod.call(this, hostClass, instanceKey, methodName, methodName);\n }, this);\n else\n _.eachKey(mixinMethods, function(mixinMethodName, hostMethodName) {\n Mixin_addMethod.call(this, hostClass, instanceKey, mixinMethodName, hostMethodName);\n }, this);\n}\n", "'use strict';\n\n// \n// milo.classes\n// -----------\n\n// This module contains foundation classes\n\nvar classes = {\n Mixin: require('./abstract/mixin'),\n MessageSource: require('./messenger/m_source'),\n MessengerMessageSource: require('./messenger/msngr_source'),\n MessengerAPI: require('./messenger/m_api'),\n MessengerRegexpAPI: require('./messenger/m_api_rx')\n};\n\nmodule.exports = classes;\n", "'use strict';\n\n\nvar _ = require('mol-proto');\n\n\nmodule.exports = config;\n\nfunction config(options) {\n _.deepExtend(config, options);\n}\n\nconfig({\n mixin: {\n instancePropertiesMap: '___mixin_instances'\n },\n check: true,\n debug: false\n});\n", "'use strict';\n\nvar Mixin = require('../abstract/mixin')\n , MessageSource = require('./m_source')\n , _ = require('mol-proto')\n , check = require('../util/check')\n , Match = check.Match;\n\n\n/**\n * `milo.Messenger`\n * A generic Messenger class that is used for all kinds of messaging in milo. It is subclassed from [Mixin](../abstract/mixin.js.html) and it proxies its methods to the host object for convenience.\n * All facets and components have messenger attached to them. Messenger class interoperates with [MessageSource](./m_source.js.html) class that connects the messenger to some external source of messages (e.g., DOM events) and [MessengerAPI](./m_api.js.html) class that allows to define higher level messages than messages that exist on the source.\n * Messenger class is used internally in milo and can be used together with any objects/classes in the application.\n * milo also defines a global messenger [milo.mail](../mail/index.js.html) that dispatches `domready` event and can be used for any application wide messaging.\n * To initialize your app after DOM is ready use:\n * ```\n * milo.mail.on('domready', function() {\n * // application starts\n * });\n * ```\n * or the following shorter form of the same:\n * ```\n * milo(function() {\n * // application starts\n * });\n * ```\n */\nvar Messenger = _.createSubclass(Mixin, 'Messenger');\n\nvar messagesSplitRegExp = Messenger.messagesSplitRegExp = /\\s*(?:\\,|\\s)\\s*/;\n\n\n/**\n * ####Messenger instance methods####\n *\n * - [init](#init)\n * - [on](#Messenger$on) (alias - onMessage, deprecated)\n * - [off](#Messenger$off) (alias - offMessage, deprecated)\n * - [onMessages](#onMessages)\n * - [offMessages](#offMessages)\n * - [once](#once)\n * - [onceSync](#onceSync)\n * - [postMessage](#postMessage)\n * - [getSubscribers](#getSubscribers)\n *\n * \"Private\" methods\n *\n * - [_chooseSubscribersHash](#_chooseSubscribersHash)\n * - [_registerSubscriber](#_registerSubscriber)\n * - [_removeSubscriber](#_removeSubscriber)\n * - [_removeAllSubscribers](#_removeAllSubscribers)\n * - [_callPatternSubscribers](#_callPatternSubscribers)\n * - [_callSubscribers](#_callSubscribers)\n * - [_setMessageSource](#_setMessageSource)\n * - [getMessageSource](#getMessageSource)\n */\n_.extendProto(Messenger, {\n init: init, // called by Mixin (superclass)\n destroy: Messenger$destroy,\n on: Messenger$on,\n once: Messenger$once,\n onceSync: Messenger$onceSync,\n onSync: Messenger$onSync,\n onAsync: Messenger$onAsync,\n onMessage: Messenger$on, // deprecated\n off: Messenger$off,\n offMessage: Messenger$off, // deprecated\n onMessages: onMessages,\n offMessages: offMessages,\n offAll: Messenger$offAll,\n postMessage: postMessage,\n postMessageSync: postMessageSync,\n getSubscribers: getSubscribers,\n getMessageSource: getMessageSource,\n _chooseSubscribersHash: _chooseSubscribersHash,\n _registerSubscriber: _registerSubscriber,\n _removeSubscriber: _removeSubscriber,\n _removeAllSubscribers: _removeAllSubscribers,\n _callPatternSubscribers: _callPatternSubscribers,\n _callSubscribers: _callSubscribers,\n _callSubscriber: _callSubscriber,\n _setMessageSource: _setMessageSource\n});\n\n\n/**\n * A default map of proxy methods used by ComponentFacet and Component classes to pass to Messenger when it is instantiated.\n * This map is for convenience only, it is NOT used internally by Messenger, a host class should pass it for methods to be proxied this way.\n */\nMessenger.defaultMethods = {\n on: 'on',\n onSync: 'onSync',\n once: 'once',\n onceSync: 'onceSync',\n off: 'off',\n onMessages: 'onMessages',\n offMessages: 'offMessages',\n postMessage: 'postMessage',\n postMessageSync: 'postMessageSync',\n getSubscribers: 'getSubscribers'\n};\n\n\nmodule.exports = Messenger;\n\n\nMessenger.subscriptions = [];\n\n\n/**\n * Messenger instance method\n * Initializes Messenger. Method is called by Mixin class constructor.\n * See [on](#Messenger$on) method, [Messenger](#Messenger) class above and [MessageSource](./m_source.js.html) class.\n *\n * @param {Object} hostObject Optional object that stores the messenger on one of its properties. It is used to proxy methods of messenger and also as a context for subscribers when they are called by the Messenger. See `on` method.\n * @param {Object} proxyMethods Optional map of method names; key - proxy method name, value - messenger's method name.\n * @param {MessageSource} messageSource Optional messageSource linked to the messenger. If messageSource is supplied, the reference to the messenger will stored on its 'messenger' property\n */\nfunction init(hostObject, proxyMethods, messageSource) {\n // hostObject and proxyMethods are used in Mixin and checked there\n if (messageSource)\n this._setMessageSource(messageSource);\n\n _initializeSubscribers.call(this);\n}\n\n\nfunction _initializeSubscribers() {\n _.defineProperties(this, {\n _messageSubscribers: {},\n _patternMessageSubscribers: {},\n }, _.CONF);\n}\n\n\n/**\n * Destroys messenger. Maybe needs to unsubscribe all subscribers\n */\nfunction Messenger$destroy() {\n this.offAll();\n var messageSource = this.getMessageSource();\n if (messageSource)\n messageSource.destroy();\n}\n\n\n/**\n * Messenger instance method.\n * Registers a subscriber function for a certain message(s).\n * This method returns `true` if the subscription was successful. It can be unsuccessful if the passed subscriber has already been subscribed to this message type - double subscription never happens and it is safe to subscribe again - no error or warning is thrown or logged.\n * Subscriber is passed two parameters: `message` (string) and `data` (object). Data object is supplied when message is dispatched, Messenger itself adds nothing to it. For example, [events facet](../components/c_facets/Events.js.html) sends actual DOM event when it posts message.\n * Usage:\n * ```\n * // subscribes onMouseUpDown to two DOM events on component via events facet.\n * myComp.events.on('mousedown mouseup', onMouseUpDown);\n * function onMouseUpDown(eventType, event) {\n * // ...\n * }\n *\n * myComp.data.on(/.+/, function(msg, data) {\n * logger.debug(msg, data);\n * }); // subscribes anonymous function to all non-empty messages on data facet\n * // it will not be possible to unsubscribe anonymous subscriber separately,\n * // but myComp.data.off(/.+/) will unsubscribe it\n * ```\n * If messenger has [MessageSource](./m_source.js.html) attached to it, MessageSource will be notified when the first subscriber for a given message is added, so it can subscribe to the source.\n * [Components](../components/c_class.js.html) and [facets](../components/c_facet.js.html) change this method name to `on` when they proxy it.\n * See [postMessage](#postMessage).\n *\n * @param {String|Array[String]|RegExp} messages Message types that should envoke the subscriber.\n * If string is passed, it can be a sigle message or multiple message types separated by whitespace with optional commas.\n * If an array of strings is passed, each string is a message type to subscribe for.\n * If a RegExp is passed, the subscriber will be envoked when the message dispatched on the messenger matches the pattern (or IS the RegExp with identical pattern).\n * Pattern subscriber does NOT cause any subscription to MessageSource, it only captures messages that are already subscribed to with precise message types.\n * @param {Function|Object} subscriber Message subscriber - a function that will be called when the message is dispatched on the messenger (usually via proxied postMessage method of host object).\n * If hostObject was supplied to Messenger constructor, hostObject will be the context (the value of this) for the subscriber envocation.\n * Subscriber can also be an object with properties `subscriber` (function) and `context` (\"this\" value when subscriber is called)\n * @return {Boolean}\n */\nfunction Messenger$on(messages, subscriber) {\n return _Messenger_onWithOptions.call(this, messages, subscriber);\n}\n\n\nfunction Messenger$once(messages, subscriber) {\n return _Messenger_onWithOptions.call(this, messages, subscriber, { dispatchTimes: 1 });\n}\n\nfunction Messenger$onceSync(messages, subscriber) {\n return _Messenger_onWithOptions.call(this, messages, subscriber, { dispatchTimes: 1, sync: true });\n}\n\n\nfunction Messenger$onSync(messages, subscriber) {\n return _Messenger_onWithOptions.call(this, messages, subscriber, { sync: true });\n}\n\n\nfunction Messenger$onAsync(messages, subscriber) {\n return _Messenger_onWithOptions.call(this, messages, subscriber, { sync: false });\n}\n\n\nfunction _Messenger_onWithOptions(messages, subscriber, options) {\n check(messages, Match.OneOf(String, [String], RegExp));\n check(subscriber, Match.OneOf(Function, {\n subscriber: Function,\n context: Match.Any,\n options: Match.Optional(Object),\n }));\n\n if (typeof subscriber == 'function') {\n subscriber = {\n subscriber: subscriber,\n context: this._hostObject,\n };\n }\n\n if (options) {\n subscriber.options = subscriber.options || {};\n _.extend(subscriber.options, options);\n }\n\n return _Messenger_on.call(this, messages, subscriber);\n}\n\n\nfunction _Messenger_on(messages, subscriber) {\n _.defineProperty(subscriber, '__messages', messages);\n return _eachMessage.call(this, '_registerSubscriber', messages, subscriber);\n}\n\n\nfunction _eachMessage(methodName, messages, subscriber) {\n if (typeof messages == 'string')\n messages = messages.split(messagesSplitRegExp);\n\n var subscribersHash = this._chooseSubscribersHash(messages);\n\n if (messages instanceof RegExp)\n return this[methodName](subscribersHash, messages, subscriber);\n\n else {\n var changed = false;\n\n messages.forEach(function(message) {\n var subscriptionChanged = this[methodName](subscribersHash, message, subscriber);\n changed = changed || subscriptionChanged;\n }, this);\n\n return changed;\n }\n}\n\n\n/**\n * \"Private\" Messenger instance method\n * It is called by [on](#Messenger$on) to register subscriber for one message type.\n * Returns `true` if this subscriber is not yet registered for this type of message.\n * If messenger has [MessageSource](./m_source.js.html) attached to it, MessageSource will be notified when the first subscriber for a given message is added.\n *\n * @private\n * @param {Object} subscribersHash The map of subscribers determined by [on](#Messenger$on) based on Message type, can be `this._patternMessageSubscribers` or `this._messageSubscribers`\n * @param {String} message Message type\n * @param {Function|Object} subscriber Subscriber function to be added or object with properties `subscriber` (function) and `context` (value of \"this\" when subscriber is called)\n * @return {Boolean}\n */\nfunction _registerSubscriber(subscribersHash, message, subscriber) {\n if (! (subscribersHash[message] && subscribersHash[message].length)) {\n subscribersHash[message] = [];\n if (message instanceof RegExp)\n subscribersHash[message].pattern = message;\n if (this._messageSource)\n this._messageSource.onSubscriberAdded(message);\n var noSubscribers = true;\n }\n\n var msgSubscribers = subscribersHash[message];\n var notYetRegistered = noSubscribers || _indexOfSubscriber.call(this, msgSubscribers, subscriber) == -1;\n\n if (notYetRegistered)\n msgSubscribers.push(subscriber);\n\n return notYetRegistered;\n}\n\n\n/**\n * Finds subscriber index in the list\n *\n * @param {Array[Function|Object]} list list of subscribers\n * @param {Function|Object} subscriber subscriber function or object with properties `subscriber` (function) and `context` (\"this\" object)\n */\nfunction _indexOfSubscriber(list, subscriber) {\n var self = this;\n return _.findIndex(list, function(subscr){\n return subscriber.subscriber == subscr.subscriber\n && subscriber.context == subscr.context\n });\n}\n\n\n/**\n * Messenger instance method.\n * Subscribes to multiple messages passed as map together with subscribers.\n * Usage:\n * ```\n * myComp.events.onMessages({\n * 'mousedown': onMouseDown,\n * 'mouseup': onMouseUp\n * });\n * function onMouseDown(eventType, event) {}\n * function onMouseUp(eventType, event) {}\n * ```\n * Returns map with the same keys (message types) and boolean values indicating whether particular subscriber was added.\n * It is NOT possible to add pattern subscriber using this method, as although you can use RegExp as the key, JavaScript will automatically convert it to string.\n *\n * @param {Object[Function]} messageSubscribers Map of message subscribers to be added\n * @return {Object[Boolean]}\n */\nfunction onMessages(messageSubscribers) {\n check(messageSubscribers, Match.ObjectHash(Match.OneOf(Function, { subscriber: Function, context: Match.Any })));\n\n var notYetRegisteredMap = _.mapKeys(messageSubscribers, function(subscriber, messages) {\n return this.on(messages, subscriber);\n }, this);\n\n return notYetRegisteredMap;\n}\n\n\n/**\n * Messenger instance method.\n * Removes a subscriber for message(s). Removes all subscribers for the message if subscriber isn't passed.\n * This method returns `true` if the subscriber was registered. No error or warning is thrown or logged if you remove subscriber that was not registered.\n * [Components](../components/c_class.js.html) and [facets](../components/c_facet.js.html) change this method name to `off` when they proxy it.\n * Usage:\n * ```\n * // unsubscribes onMouseUpDown from two DOM events.\n * myComp.events.off('mousedown mouseup', onMouseUpDown);\n * ```\n * If messenger has [MessageSource](./m_source.js.html) attached to it, MessageSource will be notified when the last subscriber for a given message is removed and there is no more subscribers for this message.\n *\n * @param {String|Array[String]|RegExp} messages Message types that a subscriber should be removed for.\n * If string is passed, it can be a sigle message or multiple message types separated by whitespace with optional commas.\n * If an array of strings is passed, each string is a message type to remove a subscriber for.\n * If a RegExp is passed, the pattern subscriber will be removed.\n * RegExp subscriber does NOT cause any subscription to MessageSource, it only captures messages that are already subscribed to with precise message types.\n * @param {Function} subscriber Message subscriber - Optional function that will be removed from the list of subscribers for the message(s). If subscriber is not supplied, all subscribers will be removed from this message(s).\n * @return {Boolean}\n */\nfunction Messenger$off(messages, subscriber) {\n check(messages, Match.OneOf(String, [String], RegExp));\n check(subscriber, Match.Optional(Match.OneOf(Function, {\n subscriber: Function,\n context: Match.Any,\n options: Match.Optional(Object),\n // __messages: Match.Optional(Match.OneOf(String, [String], RegExp))\n })));\n\n return _Messenger_off.call(this, messages, subscriber);\n}\n\n\nfunction _Messenger_off(messages, subscriber) {\n return _eachMessage.call(this, '_removeSubscriber', messages, subscriber);\n}\n\n\n/**\n * \"Private\" Messenger instance method\n * It is called by [off](#Messenger$off) to remove subscriber for one message type.\n * Returns `true` if this subscriber was registered for this type of message.\n * If messenger has [MessageSource](./m_source.js.html) attached to it, MessageSource will be notified when the last subscriber for a given message is removed and there is no more subscribers for this message.\n *\n * @private\n * @param {Object} subscribersHash The map of subscribers determined by [off](#Messenger$off) based on message type, can be `this._patternMessageSubscribers` or `this._messageSubscribers`\n * @param {String} message Message type\n * @param {Function} subscriber Subscriber function to be removed\n * @return {Boolean}\n */\nfunction _removeSubscriber(subscribersHash, message, subscriber) {\n var msgSubscribers = subscribersHash[message];\n if (! msgSubscribers || ! msgSubscribers.length)\n return false; // nothing removed\n\n if (subscriber) {\n if (typeof subscriber == 'function')\n subscriber = { subscriber: subscriber, context: this._hostObject };\n\n var subscriberIndex = _indexOfSubscriber.call(this, msgSubscribers, subscriber);\n if (subscriberIndex == -1)\n return false; // nothing removed\n msgSubscribers.splice(subscriberIndex, 1);\n if (! msgSubscribers.length)\n this._removeAllSubscribers(subscribersHash, message);\n\n } else\n this._removeAllSubscribers(subscribersHash, message);\n\n return true; // subscriber(s) removed\n}\n\n\n/**\n * \"Private\" Messenger instance method\n * It is called by [_removeSubscriber](#_removeSubscriber) to remove all subscribers for one message type.\n * If messenger has [MessageSource](./m_source.js.html) attached to it, MessageSource will be notified that all message subscribers were removed so it can unsubscribe from the source.\n *\n * @private\n * @param {Object} subscribersHash The map of subscribers determined by [off](#Messenger$off) based on message type, can be `this._patternMessageSubscribers` or `this._messageSubscribers`\n * @param {String} message Message type\n */\nfunction _removeAllSubscribers(subscribersHash, message) {\n delete subscribersHash[message];\n if (this._messageSource && typeof message == 'string')\n this._messageSource.onSubscriberRemoved(message);\n}\n\n\n/**\n * Messenger instance method.\n * Unsubscribes from multiple messages passed as map together with subscribers.\n * Returns map with the same keys (message types) and boolean values indicating whether particular subscriber was removed.\n * If a subscriber for one of the messages is not supplied, all subscribers for this message will be removed.\n * Usage:\n * ```\n * myComp.events.offMessages({\n * 'mousedown': onMouseDown,\n * 'mouseup': onMouseUp,\n * 'click': undefined // all subscribers to this message will be removed\n * });\n * ```\n * It is NOT possible to remove pattern subscriber(s) using this method, as although you can use RegExp as the key, JavaScript will automatically convert it to string.\n *\n * @param {Object[Function]} messageSubscribers Map of message subscribers to be removed\n * @return {Object[Boolean]}\n */\nfunction offMessages(messageSubscribers) {\n check(messageSubscribers, Match.ObjectHash(Match.Optional(Match.OneOf(Function, { subscriber: Function, context: Match.Any }))));\n\n var subscriberRemovedMap = _.mapKeys(messageSubscribers, function(subscriber, messages) {\n return this.off(messages, subscriber);\n }, this);\n\n return subscriberRemovedMap;\n}\n\n\n/**\n * Unsubscribes all subscribers\n */\nfunction Messenger$offAll() {\n _offAllSubscribers.call(this, this._patternMessageSubscribers);\n _offAllSubscribers.call(this, this._messageSubscribers);\n}\n\n\nfunction _offAllSubscribers(subscribersHash) {\n _.eachKey(subscribersHash, function(subscribers, message) {\n this._removeAllSubscribers(subscribersHash, message);\n }, this);\n}\n\n\n// TODO - send event to messageSource\n\n\n/**\n * Messenger instance method.\n * Dispatches the message calling all subscribers registered for this message and, if the message is a string, calling all pattern subscribers when message matches the pattern.\n * Each subscriber is passed the same parameters that are passed to theis method.\n * The context of the subscriber envocation is set to the host object (`this._hostObject`) that was passed to the messenger constructor.\n * Subscribers are called in the next tick (\"asynchronously\") apart from those that were subscribed with `onSync` (or that have `options.sync == true`).\n *\n * @param {String|RegExp} message message to be dispatched\n * If the message is a string, the subscribers registered with exactly this message will be called and also pattern subscribers registered with the pattern that matches the dispatched message.\n * If the message is RegExp, only the subscribers registered with exactly this pattern will be called.\n * @param {Any} data data that will be passed to the subscriber as the second parameter. Messenger does not modify this data in any way.\n * @param {Function} callback optional callback to pass to subscriber\n * @param {Boolean} _synchronous if true passed, subscribers will be envoked synchronously apart from those that have `options.sync == false`. This parameter should not be used, instead postMessageSync should be used.\n */\nfunction postMessage(message, data, callback, _synchronous) {\n check(message, Match.OneOf(String, RegExp));\n check(callback, Match.Optional(Function));\n\n var subscribersHash = this._chooseSubscribersHash(message);\n var msgSubscribers = subscribersHash[message];\n\n this._callSubscribers(message, data, callback, msgSubscribers, _synchronous);\n\n if (typeof message == 'string')\n this._callPatternSubscribers(message, data, callback, msgSubscribers, _synchronous);\n}\n\n\n/**\n * Same as postMessage apart from envoking subscribers synchronously, apart from those subscribed with `onAsync` (or with `options.sync == false`).\n *\n * @param {String|RegExp} message\n * @param {Any} data\n * @param {Function} callback\n */\nfunction postMessageSync(message, data, callback) {\n this.postMessage(message, data, callback, true);\n}\n\n\n/**\n * \"Private\" Messenger instance method\n * Envokes pattern subscribers with the pattern that matches the message.\n * The method is called by [postMessage](#postMessage) - see more information there.\n *\n * @private\n * @param {String} message message to be dispatched. Pattern subscribers registered with the pattern that matches the dispatched message will be called.\n * @param {Any} data data that will be passed to the subscriber as the second parameter. Messenger does not modify this data in any way.\n * @param {Function} callback optional callback to pass to subscriber\n * @param {Array[Function|Object]} calledMsgSubscribers array of subscribers already called, they won't be called again if they are among pattern subscribers.\n */\nfunction _callPatternSubscribers(message, data, callback, calledMsgSubscribers, _synchronous) {\n _.eachKey(this._patternMessageSubscribers,\n function(patternSubscribers) {\n var pattern = patternSubscribers.pattern;\n if (pattern.test(message)) {\n if (calledMsgSubscribers) {\n var patternSubscribers = patternSubscribers.filter(function(subscriber) {\n var index = _indexOfSubscriber.call(this, calledMsgSubscribers, subscriber);\n return index == -1;\n });\n }\n this._callSubscribers(message, data, callback, patternSubscribers, _synchronous);\n }\n }\n , this);\n}\n\n\n/**\n * \"Private\" Messenger instance method\n * Envokes subscribers from the passed list.\n * The method is called by [postMessage](#postMessage) and [_callPatternSubscribers](#_callPatternSubscribers).\n *\n * @private\n * @param {String} message message to be dispatched, passed to subscribers as the first parameter.\n * @param {Any} data data that will be passed to the subscriber as the second parameter. Messenger does not modify this data in any way.\n * @param {Array[Function|Object]} msgSubscribers the array of message subscribers to be called. Each subscriber is called with the host object (see Messenger constructor) as the context.\n * @param {Function} callback optional callback to pass to subscriber\n */\nfunction _callSubscribers(message, data, callback, msgSubscribers, _synchronous) {\n if (msgSubscribers && msgSubscribers.length) {\n // cloning is necessary as some of the subscribers\n // can be unsubscribed during the dispatch\n // so this array would change in the process\n msgSubscribers = msgSubscribers.slice();\n\n msgSubscribers.forEach(function(subscriber) {\n this._callSubscriber(subscriber, message, data, callback, _synchronous);\n }, this);\n }\n}\n\n\nfunction _callSubscriber(subscriber, message, data, callback, _synchronous) {\n var syncSubscriber = subscriber.options && subscriber.options.sync\n , synchro = (_synchronous && syncSubscriber !== false)\n || syncSubscriber;\n\n var dispatchTimes = subscriber.options && subscriber.options.dispatchTimes;\n if (dispatchTimes) {\n if (dispatchTimes <= 1) {\n var messages = subscriber.__messages;\n this.off(messages, subscriber);\n } else if (dispatchTimes > 1)\n subscriber.options.dispatchTimes--;\n }\n\n if (synchro)\n subscriber.subscriber.call(subscriber.context, message, data, callback);\n else\n _.deferMethod(subscriber.subscriber, 'call', subscriber.context, message, data, callback);\n}\n\n\n/**\n * Messenger instance method.\n * Returns the array of subscribers that would be called if the message were dispatched.\n * If `includePatternSubscribers === false`, pattern subscribers with matching patters will not be included (by default they are included).\n * If there are no subscribers to the message, `undefined` will be returned, not an empty array, so it is safe to use the result in boolean tests.\n *\n * @param {String|RegExp} message Message to get subscribers for.\n * If the message is RegExp, only pattern subscribers registered with exactly this pattern will be returned.\n * If the message is String, subscribers registered with the string messages and pattern subscribers registered with matching pattern will be returned (unless the second parameter is false).\n * @param {Boolean} includePatternSubscribers Optional false to prevent inclusion of patter subscribers, by default they are included.\n * @return {Array|undefined}\n */\nfunction getSubscribers(message, includePatternSubscribers) {\n check(message, Match.OneOf(String, RegExp));\n\n var subscribersHash = this._chooseSubscribersHash(message);\n var msgSubscribers = subscribersHash[message]\n ? [].concat(subscribersHash[message])\n : [];\n\n // pattern subscribers are incuded by default\n if (includePatternSubscribers !== false && typeof message == 'string') {\n _.eachKey(this._patternMessageSubscribers,\n function(patternSubscribers) {\n var pattern = patternSubscribers.pattern;\n if (patternSubscribers && patternSubscribers.length\n && pattern.test(message))\n _.appendArray(msgSubscribers, patternSubscribers);\n }\n );\n }\n\n // return undefined if there are no subscribers\n return msgSubscribers.length\n ? msgSubscribers\n : undefined;\n}\n\n\n/**\n * \"Private\" Messenger instance method\n * Returns the map of subscribers for a given message type.\n *\n * @private\n * @param {String|RegExp} message Message to choose the map of subscribers for\n * @return {Object[Function]}\n */\nfunction _chooseSubscribersHash(message) {\n return message instanceof RegExp\n ? this._patternMessageSubscribers\n : this._messageSubscribers;\n}\n\n\n/**\n * Messenger instance method\n * Sets [MessageSource](./m_source.js.html) for the messenger also setting the reference to the messenger in the MessageSource.\n * MessageSource can be passed to message constructor; this method allows to set it at a later time. For example, the subclasses of [ComponentFacet](../components/c_facet.js.html) use this method to set different MessageSource'es in the messenger that is created by ComponentFacet.\n * Currently the method is implemented in such way that it can be called only once - MessageSource cannot be changed after this method is called.\n *\n * @param {MessageSource} messageSource an instance of MessageSource class to attach to this messenger (and to have this messenger attached to it too)\n */\nfunction _setMessageSource(messageSource) {\n check(messageSource, MessageSource);\n\n _.defineProperty(this, '_messageSource', messageSource);\n messageSource.messenger = this;\n}\n\n\n/**\n * Messenger instance method\n * Returns messenger MessageSource\n *\n * @return {MessageSource}\n */\nfunction getMessageSource() {\n return this._messageSource\n}\n", diff --git a/milo.min.js b/milo.min.js index 21d58bc..59e9720 100644 --- a/milo.min.js +++ b/milo.min.js @@ -1,8 +1,8 @@ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gthis._maxLength){var b=this.actions.shift();b.destroy()}return this.position=this.actions.length,this.position-1}function e(){this.actions.length&&(this.position--,this.actions.length--)}function f(){for(var a=this.position;a=0||b.indexOf(v.firstLowerCase(a))>=0)}var r=a("../abstract/facet"),s=a("milo-core"),t=s.Messenger,u=a("./c_utils"),v=s.proto,w=v.createSubclass(r,"ComponentFacet");b.exports=w;var x=v.partial(k,i),y=v.partial(k,j);v.extendProto(w,{init:c,start:e,check:g,destroy:h,onConfigMessages:f,domParent:i,postDomParent:x,scopeParent:j,postScopeParent:y,getMessageSource:m,dispatchSourceMessage:n,_createMessenger:d,_setMessageSource:l,_createMessageSource:o,_createMessageSourceWithAPI:p}),v.extend(w,{requiresFacet:q});var z="_messenger";t.useWith(w,z,t.defaultMethods)},{"../abstract/facet":1,"./c_utils":33,"milo-core":106}],17:[function(a,b){"use strict";function c(){return n(this.owner.el,this.scope,!1)}function d(){m.prototype.start.apply(this,arguments),this.scope=new o(this.owner.el,this)}function e(a){function b(){throw new Error("path "+a+" is invalid")}a=a.split(".");var c=a.length;(a[0]||2>c)&&b();for(var d=this.owner,e=1;c>e;e++){var f=a[e];if(v.test(f)||b(),!d.container)return;if(d=d.container.scope[f],!d)return}return d}function f(a){var b={scope:{}};return a!==!1&&this.scope._each(function(a,c){b.scope[c]=a._getState()}),b}function g(a){q.eachKey(a.scope,function(a,b){var c=this.scope[b];c?c.setState(a):r.warn('component "'+b+'" does not exist on scope')},this)}function h(){this.scope._each(function(a){a.destroy()}),this.scope._detachElement(),m.prototype.destroy.apply(this,arguments)}function i(a,b){t.unwrapElement(this.owner.el),this.scope&&this.scope._each(function(b){b.remove(),a!==!1&&b.rename(void 0,!1),this.owner.scope&&this.owner.scope._add(b)},this),b!==!1&&this.owner.destroy()}function j(a){this.scope._add(a),this.owner.el.appendChild(a.el)}function k(a,b){this.scope._add(a),this.el.insertBefore(a.el,b&&b.el)}function l(a){this.scope._remove(a),this.owner.el.removeChild(a.el)}var m=a("../c_facet"),n=a("../../binder"),o=a("../scope"),p=a("milo-core"),q=p.proto,r=p.util.logger,s=a("./cf_registry"),t=a("../../util/dom"),u=q.createSubclass(m,"Container");q.extendProto(u,{start:d,path:e,getState:f,setState:g,binder:c,destroy:h,unwrap:i,append:j,insertBefore:k,remove:l}),s.add(u),b.exports=u;var v=/^[A-Za-z][A-Za-z0-9\_\$]*$/},{"../../binder":8,"../../util/dom":79,"../c_facet":16,"../scope":40,"./cf_registry":30,"milo-core":106}],18:[function(a,b){"use strict";function c(){K.wrapMessengerMethods.call(this),E.prototype.start.apply(this,arguments),this.elData=I(this.owner.el),this._dataChangesQueue=[],this._prepareMessageSource(),this._path="."+this.owner.name,this._value=this.get(),this.onSync("",e),this.onSync("datachangesfinished",h),this.onSync("childdata",j),this.onSync("changedata",M)}function d(){var a=new H(this.owner),b=new G(this,T,a,this.owner);this._setMessageSource(b),Q.defineProperty(this,"_dataEventsSource",b),D.prototype._createProxyMethod.call(a,"value","value",this)}function e(a,b){if(this._bubbleUpDataChange(b),this._queueDataChange(b),""===b.path){var c=N(b);this.postMessage("datachangesfinished",{transaction:c})}}function f(a){var b=this.scopeParent();if(b){var c=Q.clone(a);c.path=(this._path||"."+this.owner.name)+c.path,b.postMessage("childdata",c||a)}}function g(a){this._dataChangesQueue.push(a)}function h(a,b){this._postDataChanges(b.inTransaction);var c=this.scopeParent();c&&c.postMessage("datachangesfinished",b)}function i(a){var b=this._dataChangesQueue.reverse();this.postMessageSync("datachanges",{changes:b,transaction:a}),this._dataChangesQueue=[]}function j(a,b){this.postMessage(b.path,b),this._bubbleUpDataChange(b),this._queueDataChange(b)}function k(a){var b=N(k);try{return t.call(this,"set",arguments)}catch(c){if(c!=U)throw c}O(this._set,b);var d=this._value,e=this._set(a),f={path:"",type:"changed",newValue:e,oldValue:d};return O(f,b),this.postMessage("",f),e}function l(a){function b(a,b,c,e){var f=e.replace("$$",c),g=this.path(f,"undefined"!=typeof b);g&&(O(g.set,d),a[c]=g.set(b))}var c,d=N(l);if(null!=a&&"object"==typeof a)if(Array.isArray(a)){c=[];var e=this.owner.list;if(e){var f=e.count(),g=a.length-f;g>=3&&(e._addItems(g),e._updateDataPaths(f,e.count())),a.forEach(function(a,d){b.call(this,c,a,d,"[$$]")},this);for(var h=e.count(),i=h-a.length;i-->0;)e._removeItem(a.length)}else R.warn("Data: setting array data without List facet")}else c={},Q.eachKey(a,function(a,d){b.call(this,c,a,d,".$$")},this);else c=this._setScalarValue(a);return this._value=c,c}function m(){var a=N(m);try{var b=t.call(this,"del");return P.call(this,a),b}catch(c){if(c!=U)throw c}var d=this._value;O(this._del,a),this._del();var e={path:"",type:"deleted",oldValue:d};O(e,a),this.postMessage("",e)}function n(){var a=N(n);O(this._set,a),this._set()}function o(a){return this.elData.set(this.owner.el,a)}function p(a){try{return t.call(this,"get",arguments)}catch(b){if(b!=U)throw b}return this._get(a)}function q(a){if(a!==!1){var b,c=this.owner;return c.list?(b=[],c.list.each(function(a,c){b[c]=a.data.get()}),c.container&&c.container.scope._each(function(a,d){!c.list.contains(a)&&a.data&&(b[d]=a.data.get())})):c.container?(b={},c.container.scope._each(function(a,c){a.data&&(b[c]=a.data.get())})):b=this._getScalarValue(),this._value=b,b}}function r(){return this.elData.get(this.owner.el)}function s(){var a,b=N(s);try{var a=t.call(this,"splice",arguments);return P.call(this,b),a}catch(c){if(c!=U)throw c}if(O(this._splice,b),a=this._splice.apply(this,arguments)){var d={path:"",type:"splice",index:a.spliceIndex,removed:a.removed,addedCount:a.addedCount,newValue:this._value};return O(d,b),this.postMessage("",d),a.removed}}function t(a,b){var c=this.config[a];switch(typeof c){case"function":return c.apply(this.owner,b);case"string":return this.owner[c].apply(this.owner,b);default:throw U}}function u(a,b){var c=N(u),d=this.owner.list;if(!d)return R.warn("Data: cannot use splice method without List facet");var e=[],f=d.count();if(arguments[0]=a=L.normalizeSpliceIndex(a,f),b>0&&f>0){for(var g=a;a+b>g;g++){var h=d.item(a);if(h){var i=h.data.get();d._removeItem(a)}else R.warn("Data: no item for index",g);e.push(i)}d._updateDataPaths(a,d.count())}var j=[],k=arguments.length,l=k>2,m=k-2;if(l){d._addItems(m,a);for(var g=2,n=a;k>g;g++,n++){var h=d.item(n);if(h){O(h.data.set,c);var i=h.data.set(arguments[g])}else R.warn("Data: no item for index",n);j.push(i)}d._updateDataPaths(a,d.count())}return this._value=this.get(),{spliceIndex:a,removed:e,addedCount:l?m:0}}function v(){try{return t.call(this,"len")}catch(a){if(a!=U)throw a}return this._len()}function w(){return this.owner.list?this.owner.list.count():void R.error("Data: len called without list facet")}function x(a,b){if(!a)return this;for(var c=K.parseAccessPath(a),d=this.owner,e=0,f=c.length;f>e;e++){var g=c[e],h=K.getPathNodeKey(g);if("array"==g.syntax&&d.list){var i=d.list.item(h);i||b===!1||(i=d.list._addItem(h),i.data._path=g.property),d=i}else d.container&&(d=d.container.scope[h]);var j=d&&d.data;if(!j)break}return j}function y(){return this._path}function z(){var a=this._path;return"["==a[0]?+a.slice(1,-1):a.slice(1)}function A(a){return{state:this.get(a)}}function B(a){return this.set(a.state)}var C=a("milo-core"),D=C.classes.Mixin,E=a("../c_facet"),F=a("./cf_registry"),G=(C.Messenger,a("../msg_src/dom_events")),H=a("../msg_api/data"),I=a("../msg_api/de_data"),J=C.Model,K=J._utils.path,L=J._utils.model,M=J._utils.changeDataHandler,N=M.getTransactionFlag,O=M.setTransactionFlag,P=M.postTransactionFinished,Q=C.proto,R=C.util.logger,S=Q.createSubclass(E,"Data");Q.extendProto(S,{start:c,getState:A,setState:B,get:p,set:k,del:m,splice:s,len:v,path:x,getPath:y,getKey:z,_get:q,_set:l,_del:n,_splice:u,_len:w,_setScalarValue:o,_getScalarValue:r,_bubbleUpDataChange:f,_queueDataChange:g,_postDataChanges:i,_prepareMessageSource:d}),F.add(S),b.exports=S,["push","pop","unshift","shift"].forEach(function(a){var b=J.Path.prototype[a];Q.defineProperty(S.prototype,a,b)});var T={trigger:"trigger"},U={}},{"../c_facet":16,"../msg_api/data":35,"../msg_api/de_data":36,"../msg_src/dom_events":38,"./cf_registry":30,"milo-core":106}],19:[function(a,b){"use strict";function c(a){var b=a.domConfig||{},c=b.tagName||"div",e=document.createElement(c),f=a.content,g=a.template;return d(e,b),"string"==typeof f&&(e.innerHTML=g?G.template(g)({content:f}):f),e}function d(a,b){var c=b&&b.cls,d=b&&b.attributes;d&&E.eachKey(d,function(b,c){a.setAttribute(c,b)}),c&&j(a,"add",c)}function e(){var a=this.owner.el;d(a,this.config);var b=window.getComputedStyle(a);this._visible=b&&"none"!=b.display}function f(){this.toggle(!0) -}function g(){this.toggle(!1)}function h(a){a="undefined"==typeof a?!this._visible:!!a,this._visible=a;var b=this.owner.el;return b.style.display=a?"block":"none",a}function i(a,b,c){j(this.owner.el,a,b,c)}function j(a,b,c,d){function e(a){g?void 0===d?f[b](a):f[b](a,d):f[b](a)}var f=a.classList,g="toggle"==b;if(Array.isArray(c))c.forEach(e);else{if("string"!=typeof c)throw new Error("unknown type of CSS classes parameter");e(c)}}function k(){this.owner.el&&I.detachComponent(this.owner.el)}function l(a,b){if(!this.owner.el)throw new Error("Cannot call setStyle on owner with no element: "+this.owner.constructor.name);this.owner.el.style[a]=b}function m(a){for(var b in a)this.owner.el.style[b]=a[b]}function n(a){return this.owner.el&&this.owner.el.cloneNode(a)}function o(){var a=J.createElement(this.config);return a}function p(){I.removeElement(this.owner.el)}function q(a){this.owner.el.appendChild(a)}function r(a){var b=this.owner.el,c=b.firstChild;c?b.insertBefore(a,c):b.appendChild(a)}function s(a){for(;a.childNodes.length;)this.append(a.childNodes[0])}function t(a){for(;a.childNodes.length;)this.prepend(a.childNodes[a.childNodes.length-1])}function u(a){var b=this.owner.el,c=b.parentNode;c.insertBefore(a,b.nextSibling)}function v(a){var b=this.owner.el,c=b.parentNode;c.insertBefore(a,b)}function w(){var a=this.owner.getScopeParent();a&&a.el.appendChild(this.owner.el)}function x(){return I.children(this.owner.el)}function y(a,b){if(!K.hasOwnProperty(a))throw new Error("incorrect find direction: "+a);var c=this.owner.el,d=this.owner.scope,e=document.createTreeWalker(d._rootEl,NodeFilter.SHOW_ELEMENT);e.currentNode=c;for(var f=e[K[a]](),g=(Object.keys(d),!1);f;){var h=new H(f);if(h.node&&(h.parse().validate(),d.hasOwnProperty(h.compName))){var i=d[h.compName];if(!b||b(i)){g=!0;break}}e.currentNode=f,f=e[K[a]]()}return g?i:void 0}function z(){var a=window.getSelection();if(!a.isCollapsed)return!0;var b=a.focusNode&&a.focusNode.textContent,c=b&&" "==b.charAt(0)?1:0;if(a.anchorOffset!=c)return!0;var d=document.createTreeWalker(this.owner.el,NodeFilter.SHOW_TEXT);d.currentNode=a.anchorNode;var e=d.previousNode(),f=e?""==!e.nodeValue.trim():!1;return f}function A(){var a=window.getSelection();if(!a.isCollapsed)return!0;var b=a.focusNode&&a.focusNode.textContent,c=b&&" "==b.charAt(b.length-1)?a.anchorNode.length-1:a.anchorNode.length;if(a.anchorOffset=0;var f=d[e&&e.compClass];return!!o.result(f,this.owner,e,a);default:throw new Error("Incorrect allowed components in config")}}else{var g=c&&c.dataTypes;switch(typeof g){case"undefined":return!1;case"string":return a.types.indexOf(g)>=0}}}var j=a("../c_facet"),k=a("./cf_registry"),l=a("../msg_src/dom_events"),m=a("../msg_api/drop"),n=a("../../util/dragdrop"),o=a("milo-core").proto,p=o.createSubclass(j,"Drop");o.extendProto(p,{init:c,start:d}),k.add(p),b.exports=p;var q=o.throttle(h,50)},{"../../util/dragdrop":82,"../c_facet":16,"../msg_api/drop":37,"../msg_src/dom_events":38,"./cf_registry":30,"milo-core":106}],22:[function(a,b){"use strict";function c(){d.prototype.init.apply(this,arguments);var a=new g(this,void 0,void 0,this.owner);this._setMessageSource(a),h.defineProperty(this,j,a)}var d=a("../c_facet"),e=a("./cf_registry"),f=a("milo-core"),g=(f.Messenger,a("../msg_src/dom_events")),h=f.proto,i=h.createSubclass(d,"Events");h.extendProto(i,{init:c}),e.add(i),b.exports=i;var j="_domEventsSource";g.useWith(i,j,["trigger"])},{"../c_facet":16,"../msg_src/dom_events":38,"./cf_registry":30,"milo-core":106}],23:[function(a,b){"use strict";function c(){k.prototype.init.apply(this,arguments);var a=new n(this,void 0,void 0,this.owner);this._setMessageSource(a),o.defineProperty(this,s,a)}function d(){function a(a){b.postMessage("domready",a)}k.prototype.start.apply(this,arguments);var b=this;milo(a)}function e(){k.prototype.destroy.apply(this,arguments)}function f(){return this.owner.el.contentWindow}function g(){var a=this.getWindow().document.readyState;return"loading"!=a?a:!1}function h(){var a=this.getWindow().milo;return this.isReady()&&a&&a.milo_version}function i(a){if("function"==typeof a){var b=this;this.whenMiloReady(function(){b.getWindow().milo(a)})}var c=this.getWindow();return c&&c.milo}function j(a,b){return function(c){function d(){c.apply(e,f)}var e=this,f=o.slice(arguments,1);a.call(this)?d():this.on(b,d)}}var k=a("../c_facet"),l=a("./cf_registry"),m=a("milo-core"),n=(m.Messenger,a("../msg_src/frame")),o=(a("../../services/de_constrs"),m.proto),p=o.createSubclass(k,"Frame"),q=j(g,"domready"),r=j(h,"message:miloready");o.extendProto(p,{init:c,start:d,destroy:e,getWindow:f,isReady:g,whenReady:q,isMiloReady:h,whenMiloReady:r,milo:i}),l.add(p),b.exports=p;var s="_messageSource";n.useWith(p,s,["trigger"])},{"../../services/de_constrs":68,"../c_facet":16,"../msg_src/frame":39,"./cf_registry":30,"milo-core":106}],24:[function(a,b){"use strict";function c(){return{state:{index:this.getIndex()}}}function d(a){this.setIndex(a.state.index)}function e(){return this.index}function f(a){this.index=a}function g(){this.list.removeItem(this.index)}function h(){this.list.extractItem(this.index)}var i=a("../c_facet"),j=a("./cf_registry"),k=a("milo-core"),l=(k.Model,k.proto),m=(a("../../services/mail"),l.createSubclass(i,"Item"));l.extendProto(m,{getState:c,setState:d,getIndex:e,setIndex:f,removeItem:g,extractItem:h,require:["Container","Dom","Data"]}),j.add(m),b.exports=m},{"../../services/mail":70,"../c_facet":16,"./cf_registry":30,"milo-core":106}],25:[function(a,b){"use strict";function c(){y.prototype.init.apply(this,arguments);C.defineProperties(this,{_listItems:[],_listItemsHash:{}}),C.defineProperty(this,"itemSample",null,C.WRIT)}function d(){this.owner.on("childrenbound",e)}function e(){var a=this.dom.children(),b=this.list._listItems,c=this.list._listItemsHash;if(a&&a.forEach(function(a){var d=z.getComponent(a);d&&d.item&&(b.push(d),c[d.name]=d,d.item.list=this.list)},this),b.length){var d=b[0];b.splice(0,1),delete c[d.name],b.forEach(function(a,b){a.item.setIndex(b)})}if(!d)throw new Error("No child component has Item facet");this.list.itemSample=d,d.dom.hide(),d.remove(!0),d.dom.removeCssClasses(L),d.walkScopeTree(function(a){delete a.el[K.componentRef]}),this.list._createCacheTemplate()}function f(){if(!this.itemSample)return!1;{var a=this.itemSample,b=a.el.cloneNode(!0),c=a.componentInfo.attr;C.clone(c)}c.compName="{{= it.componentName() }}",c.el=b,c.decorate();var d="{{ var i = it.count; while(i--) { }}"+b.outerHTML+"{{ } }}";this.itemsTemplate=F.compile(d)}function g(a){return this._listItems[a]}function h(){return this._listItems.length}function i(a,b){this._listItems.splice(a,0,b),this._listItemsHash[b.name]=b,b.item.list=this,b.item.setIndex(+a)}function k(a){return this._listItemsHash[a.name]==a}function l(a,b){return a=a||this.count(),this.owner.data.splice(a,0,b||{}),this.item(a)}function m(a){if(a=a||this.count(),this.item(a))throw Error("attempt to create item with ID of existing item");var b=z.copy(this.itemSample,!0),c=this._itemPreviousComponent(a);return c.el.parentNode?(c.dom.insertAfter(b.el),this._setItem(a,b),b.el.style.display="",n.call(this,a+1),b):E.warn("list item sample was removed from DOM, probably caused by wrong data. Reset list data with array")}function n(a,b){a=a||0,b=b||this.count();for(var c=a;b>c;c++){var d=this._listItems[c];d?d.item.setIndex(c):E.warn("List: no item at position",c)}}function o(a,b){var c=C.slice(arguments,2);c.lengtha)throw new Error("can't add negative number of items");if(0!=a){var c=this.itemsTemplate({componentName:J,count:a}),d=document.createElement("div");d.innerHTML=c,D(d,this.owner.container.scope);var e=I.children(d);if(a!=e.length&&E.error("number of items added is different from requested"),e&&e.length){var f=this.count(),g=0>b?0:"undefined"==typeof b||b>f?f:b,h=0==g?this.itemSample:this._listItems[g-1],i=document.createDocumentFragment(),j=[];if(e.forEach(function(a){var b=z.getComponent(a);return b?(j.push(b),this._setItem(g++,b),i.appendChild(a),void(a.style.display="")):E.error("List: element in new items is not a component")},this),n.call(this,g),!h.el.parentNode)return E.warn("list item sample was removed from DOM, probably caused by wrong data. Reset list data with array");h.dom.insertAfter(i),C.deferMethod(j,"forEach",function(a){a.broadcast("stateready")})}}}function q(a){return this.owner.data.splice(a,1)}function r(a){var b=this._removeItem(a,!1);return this._updateDataPaths(a,this.count()),b}function s(a,b){var c=this.item(a);return c?(this._listItems[a]=void 0,delete this._listItemsHash[c.name],b!==!1?c.destroy():(c.remove(),c.dom.remove()),this._listItems.splice(a,1),n.call(this,a),c):E.warn("attempt to remove list item with id that does not exist")}function t(a,b){var c=this.item(a);c.dom.insertAfter(b.el),this._removeItem(a),this._setItem(a,b)}function u(a){for(;a>=0&&!this._listItems[a];)a--;return a>=0?this._listItems[a]:this.itemSample}function v(a,b){for(var c=a;b>c;c++){var d=this.item(c);d?d.data._path="["+c+"]":E.warn("Data: no item for index",j)}}function w(a,b){this._listItems.forEach(function(b,c){b?a.apply(this,arguments):E.warn("List$each: item",c,"is undefined")},b||this)}function x(){this.itemSample&&this.itemSample.destroy(!0),y.prototype.destroy.apply(this,arguments)}var y=a("../c_facet"),z=a("../c_class"),A=a("./cf_registry"),B=a("milo-core"),C=B.proto,D=(a("../../services/mail"),a("../../binder")),E=B.util.logger,F=B.util.doT,G=B.util.check,H=G.Match,I=a("../../util/dom"),J=a("../../util/component_name"),K=a("../../config"),L="ml-list-item-sample",M=C.createSubclass(y,"List");C.extendProto(M,{init:c,start:d,destroy:x,require:["Container","Dom","Data"],_itemPreviousComponent:u,item:g,count:h,contains:k,addItem:l,addItems:o,replaceItem:t,removeItem:q,extractItem:r,each:w,_setItem:i,_removeItem:s,_addItem:m,_addItems:p,_createCacheTemplate:f,_updateDataPaths:v}),A.add(M),b.exports=M},{"../../binder":8,"../../config":64,"../../services/mail":70,"../../util/component_name":76,"../../util/dom":79,"../c_class":15,"../c_facet":16,"./cf_registry":30,"milo-core":106}],26:[function(a,b){"use strict";function c(){this.m=new k(this.config.data,this),h.prototype.init.apply(this,arguments)}function d(){var a=this.m.get();return"object"==typeof a&&(a=l.deepClone(a)),{state:a}}function e(a){return this.m.set(a.state)}function f(){this._messenger=this.m._messenger}function g(){this.m.destroy(),h.prototype.destroy.apply(this,arguments)}var h=a("../c_facet"),i=a("./cf_registry"),j=a("milo-core"),k=j.Model,l=(j.classes.Mixin,j.proto),m=l.createSubclass(h,"Model");l.extendProto(m,{init:c,getState:d,setState:e,_createMessenger:f,destroy:g}),i.add(m),b.exports=m,k.useWith(m,"m")},{"../c_facet":16,"./cf_registry":30,"milo-core":106}],27:[function(a,b){"use strict";function c(){this.m=new i(this.config.options,this),f.prototype.init.apply(this,arguments),this.m.proxyMethods(this)}function d(){this._messenger=this.m._messenger}function e(){this.m.destroy(),f.prototype.destroy.apply(this,arguments)}var f=a("../c_facet"),g=a("./cf_registry"),h=a("milo-core"),i=h.Model,j=h.proto,k=j.createSubclass(f,"Options");j.extendProto(k,{init:c,destroy:e,_createMessenger:d}),g.add(k),b.exports=k},{"../c_facet":16,"./cf_registry":30,"milo-core":106}],28:[function(a,b){"use strict";function c(){i.prototype.init.apply(this,arguments);var a=this.config.interpolate===!1?void 0:this.config.compile||milo.config.template.compile;this.set(this.config.template||"",a,this.config.compileOptions)}function d(){i.prototype.start.apply(this,arguments),this.config.autoRender&&(this.render(),this.config.autoBinder&&this.binder())}function e(){return this._template}function f(a,b,c){return m(a,o.OneOf(String,Function)),m(b,o.Optional(Function)),"function"==typeof a?this._template=a:(this._templateStr=a,b?this._compile=b:b=this._compile,b&&(this._template=b(a,c))),this}function g(a){return this.owner.el.innerHTML=this._template?this._template(a):this._templateStr,this}function h(){return this.owner.container?this.owner.container.binder():void n.error("TemplateFacet: Binder called without container facet.")}var i=a("../c_facet"),j=a("./cf_registry"),k=a("milo-core"),l=k.proto,m=k.util.check,n=k.util.logger,o=m.Match,p=(a("../../binder"),l.createSubclass(i,"Template"));l.extendProto(p,{init:c,start:d,set:f,getCompiled:e,render:g,binder:h}),j.add(p),b.exports=p},{"../../binder":8,"../c_facet":16,"./cf_registry":30,"milo-core":106}],29:[function(a,b){"use strict";function c(){j.prototype.init.apply(this,arguments),this._activeState="",this._defaultKey="",this._state={}}function d(){return this._state[this._activeState]||this._state[this._defaultKey]}function e(a){this._state[""]=a,this.setActiveState("")}function f(a){this._activeState=a}function g(a,b,c){if(!a)throw new Error("Transfer$setStateWithKey: no key");this._defaultKey=c?a:this._defaultKey||a,this._state[a]=b,this.setActiveState(a)}function h(a){return"string"==typeof a&&this._state[a]}function i(){var a=this.getState();return{compName:a&&a.compName,compClass:a&&a.compClass}}var j=a("../c_facet"),k=a("./cf_registry"),l=a("milo-core").proto,m=l.createSubclass(j,"Transfer");l.extendProto(m,{init:c,getState:d,setState:e,setActiveState:f,setStateWithKey:g,getStateWithKey:h,getComponentMeta:i}),k.add(m),b.exports=m},{"../c_facet":16,"./cf_registry":30,"milo-core":106}],30:[function(a,b){"use strict";var c=a("../../abstract/registry"),d=a("../c_facet"),e=new c(d);e.add(d),b.exports=e},{"../../abstract/registry":3,"../c_facet":16}],31:[function(a,b){"use strict";function c(a,b,c,d){c.parse().validate(),this.scope=a,this.el=b,this.attr=c,this.name=c.compName,this.ComponentClass=f(c,d),this.extraFacetsClasses=g(this.ComponentClass,c,d),this.ComponentClass&&i(this.ComponentClass,this.extraFacetsClasses)&&(this.container={})}function d(){delete this.el,this.attr.destroy()}function e(a,b){a=a||l(),m.rename(this,a,b),this.attr.compName=a,this.attr.decorate()}function f(a,b){var c=j.get(a.compClass);return c||h(b,"class "+a.compClass+" is not registered"),c}function g(a,b,c){var d=b.compFacets,e={};return Array.isArray(d)&&d.forEach(function(d){d=p.firstUpperCase(d),a.hasFacet(d)&&h(c,"class "+a.name+" already has facet "+d),e[d]&&h(c,"component "+b.compName+" already has facet "+d);var f=k.get(d);e[d]=f}),e}function h(a,b){if(a!==!1)throw new Error(b);o.error("ComponentInfo binder error:",b)}function i(a,b){function c(){return a.prototype.facetsClasses&&p.someKey(a.prototype.facetsClasses,d)}function d(a){return a.requiresFacet("container")}return a.hasFacet("container")||"Container"in b||p.someKey(b,d)||c()}var j=a("./c_registry"),k=a("./c_facets/cf_registry"),l=a("../util/component_name"),m=a("./scope"),n=a("milo-core"),o=n.util.logger,p=n.proto;b.exports=c,p.extendProto(c,{destroy:d,rename:e})},{"../util/component_name":76,"./c_facets/cf_registry":30,"./c_registry":32,"./scope":40,"milo-core":106}],32:[function(a,b){"use strict";var c=a("../abstract/registry"),d=a("./c_class"),e=new c(d);e.add(d),b.exports=e},{"../abstract/registry":3,"./c_class":15}],33:[function(a,b){"use strict";function c(a){return a.hasOwnProperty(h.componentRef)}function d(a){return a&&a[h.componentRef]}function e(a,b,c){j(b,k.Optional(Boolean)),j(c,k.Optional(k.OneOf(Function,String)));var d=f(c);return g(a,b,d)}function f(a){if("function"==typeof a)return a;if("string"==typeof a){var b=l.firstLowerCase(a);return function(a){return a.hasFacet(b)}}}function g(a,b,c){if(b!==!1){var e=d(a);if(e&&(!c||c(e)))return e}return a.parentNode?g(a.parentNode,!0,c):void 0}{var h=a("../config"),i=a("milo-core"),j=i.util.check,k=j.Match,l=i.proto;b.exports={isComponent:c,getComponent:d,getContainingComponent:e,_makeComponentConditionFunc:f}}},{"../config":64,"milo-core":106}],34:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("View",["container"]);d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],35:[function(a,b){"use strict";function c(a){j.prototype.init.apply(this,arguments),this.component=a,this.elData=h(a.el)}function d(){var a=this.component.data.config.get,b="function"==typeof a?a.call(this.component):this.elData.get(this.component.el);return this.component.data._value=b,b}function e(a){var b=this.component.data.config.event,c=b||this.elData.event(this.component.el);return""==a&&c?c:void 0}function f(a,b,c){return c.newValue!=c.oldValue}function g(){var a=this.component.data._value,b=this.value(),c={path:"",type:"changed",oldValue:a,newValue:b};return c}var h=a("./de_data"),i=a("milo-core"),j=i.classes.MessengerAPI,k=i.proto,l=i.util.check,m=(l.Match,k.createSubclass(j,"DataMsgAPI",!0));k.extendProto(m,{init:c,translateToSourceMessage:e,filterSourceMessage:f,createInternalData:g,value:d}),b.exports=m},{"./de_data":36,"milo-core":106}],36:[function(a,b){"use strict";function c(a){var b=h[a.type];return b?b.property:h.byDefault.property}function d(a){var b=h[a.type];return b?b.event:h.byDefault.event}var e=a("milo-core").proto,f=function(a){var b=a.tagName.toLowerCase(),c=g[b];return c||g.byDefault};b.exports=f;var g={byDefault:{property:"innerHTML"},div:{property:"innerHTML"},span:{property:"innerHTML",event:"input"},p:{property:"innerHTML",event:"input"},input:{property:c,event:d},textarea:{property:"value",event:"input"},select:{property:"value",event:"change"},img:{property:"src"},caption:{property:"innerHTML",event:"input"},thead:{property:"innerHTML",event:"input"},tbody:{property:"innerHTML",event:"input"},tfoot:{property:"innerHTML",event:"input"}};e.eachKey(g,function(a){var b=a.property,c=a.event;"function"!=typeof b&&(a.property=function(){return b});var d=a.property;"function"!=typeof c&&(a.event=function(){return c}),a.get||(a.get=function(a){return a[d(a)]}),a.set||(a.set=function(a,b){return a[d(a)]="undefined"==typeof b?"":b})});var h={byDefault:{property:"value",event:"input"},checkbox:{property:"checked",event:"change"},radio:{property:"checked",event:"change"},text:{property:"value",event:"input"}}},{"milo-core":106}],37:[function(a,b){"use strict";function c(a){return h.hasOwnProperty(a)?h[a]:a}function d(){delete this._currentTarget,delete this._inside}function e(a,b,c){var e=!0;return"dragenter"==a&&"dragin"==b?(this._currentTarget=c.target,e=!this._inside,this._inside=!0):"dragleave"==a&&"dragout"==b?(e=this._currentTarget==c.target,e&&d.call(this)):"drop"==a&&d.call(this),e}var f=a("milo-core").classes.MessengerAPI,g=_.createSubclass(f,"DropMsgAPI",!0);_.extendProto(g,{translateToSourceMessage:c,filterSourceMessage:e}),b.exports=g;var h={dragin:"dragenter",dragout:"dragleave"}},{"milo-core":106}],38:[function(a,b){"use strict";function c(a,b,c,d){k(d,i),this.component=d,h.prototype.init.apply(this,arguments)}function d(){h.prototype.destroy.apply(this,arguments),delete this.component}function e(){return this.component.el}var f=a("../../services/dom_source"),g=a("milo-core"),h=g.classes.MessageSource,i=a("../c_class"),j=g.proto,k=g.util.check,l=(k.Match,j.createSubclass(f,"DOMEventsSource",!0));j.extendProto(l,{init:c,destroy:d,emitter:e}),b.exports=l},{"../../services/dom_source":69,"../c_class":15,"milo-core":106}],39:[function(a,b){"use strict";function c(a,b,c,d){if(m(d,i),this.component=d,"iframe"!=d.el.tagName.toLowerCase())throw new Error("component for FrameMessageSource can only be attached to iframe element");k.prototype.init.apply(this,arguments)}function d(){return this.component.el.contentWindow}function e(){var a=this.frameWindow();a?a.addEventListener("message",this,!1):n.warn("FrameMessageSource: frame window is undefined")}function f(){var a=this.frameWindow();a?a.removeEventListener("message",this,!1):n.warn("FrameMessageSource: frame window is undefined")}function g(a,b){b=b||{},b.type=a,this.frameWindow().postMessage(b,"*")}function h(a){this.dispatchMessage(a.data.type,a)}var i=a("../c_class"),j=a("milo-core"),k=j.classes.MessageSource,l=j.proto,m=j.util.check,n=j.util.logger,o=(m.Match,l.createSubclass(k,"FrameMessageSource",!0));l.extendProto(o,{init:c,addSourceSubscriber:e,removeSourceSubscriber:f,trigger:g,frameWindow:d,handleEvent:h}),b.exports=o},{"../c_class":15,"milo-core":106}],40:[function(a,b){"use strict";function c(a,b){u.defineProperties(this,{_rootEl:a,_hostObject:b},u.WRIT)}function d(a,b){if("string"==typeof b?a.name=b:b=a.name,this.hasOwnProperty(b))throw new Error("duplicate object name: "+b);l(b),f.call(this,a,b)}function e(a,b){"string"==typeof b?a.name=b:b=a.name;var c=this.hasOwnProperty(b);c?x.error("Scope: duplicate object name: "+b):(c=!y.test(b),c&&x.error("Scope: name should start from letter, this name is not allowed: "+b)),c&&(b=v(),a.name=b),f.call(this,a,b)}function f(a,b){this[b]=a,a.scope=this,"function"==typeof a.postMessage&&a.postMessage("addedtoscope")}function g(a){w(a,c),a._each(d,this)}function h(a,b){b._add(a),this._remove(a.name),a.scope=b}function i(a){a._each(function(b){this._add(b,b.name),a._remove(b.name)},this)}function j(a,b){u.eachKey(this,a,b||this,!0)}function k(a,b){return u.filterKeys(this,a,b||this,!0)}function l(a){if(!y.test(a))throw new Error("name should start from letter, this name is not allowed: "+a)}function m(){return Object.keys(this).length}function n(){var a=Object.keys(this)[0];return a&&this[a]}function o(a,b){if(!(a in this))return void(b||x.warn("removing object that is not in scope"));var c=this[a];delete this[a],"function"==typeof c.postMessage&&c.postMessage("removedfromscope")}function p(){this._each(function(a,b){delete this[b].scope,delete this[b]},this)}function q(){this._rootEl=null}function r(a){return this.hasOwnProperty(a.name)}function s(a,b,c){a.scope&&c!==!1?(a.scope._remove(a.name),a.scope._add(a,b)):a.name=b}var t=a("milo-core"),u=t.proto,v=a("../util/component_name"),w=t.util.check,x=(w.Match,t.util.logger);u.extendProto(c,{_add:d,_safeAdd:e,_copy:g,_each:j,_move:h,_merge:i,_length:m,_any:n,_remove:o,_clean:p,_detachElement:q,_has:r,_filter:k}),u.extend(c,{rename:s}),b.exports=c;var y=/^[A-Za-z][A-Za-z0-9\_\$]*$/},{"../util/component_name":76,"milo-core":106}],41:[function(a,b){"use strict";function c(a){this.el.disabled=a}function d(){return!!this.el.disabled}var e=a("../c_class"),f=a("../c_registry"),g=a("milo-core").proto,h=e.createComponentClass("MLButton",{events:void 0,dom:{cls:"ml-ui-button"}});f.add(h),b.exports=h,g.extendProto(h,{disable:c,isDisabled:d})},{"../c_class":15,"../c_registry":32,"milo-core":106}],42:[function(a,b){"use strict";function c(){k.prototype.init.apply(this,arguments),this.on("childrenbound",d)}function d(){m.defineProperties(this,{_comboInput:this.container.scope.input,_comboList:this.container.scope.datalist}),this._comboList.template.set(o),this._comboInput.data.on("input",{subscriber:i,context:this})}function e(){return this._comboInput?this._comboInput.data.get():void 0}function f(a){return h.call(this,"set",a)}function g(){return h.call(this,"del",value)}function h(a,b){if(this._comboInput){var c=this._comboInput.data[a](b);return i.call(this),c}}function i(){this.data.dispatchSourceMessage(n)}function j(){this._comboList.template.render({comboOptions:this.model.get()})}var k=a("../c_class"),l=a("../c_registry"),m=a("milo-core").proto,n="mlcombochange",o='{{~ it.comboOptions :option }} {{~}}',p=k.createComponentClass("MLCombo",{events:void 0,data:{get:e,set:f,del:g,splice:void 0,event:n},model:{messages:{"***":{subscriber:j,context:"owner"}}},dom:{cls:"ml-ui-datalist"},container:void 0});l.add(p),b.exports=p,m.extendProto(p,{init:c})},{"../c_class":15,"../c_registry":32,"milo-core":106}],43:[function(a,b){"use strict";function c(){r.prototype.init.apply(this,arguments),this._dataValidation=function(){},this.model.set([]),this.once("childrenbound",j)}function d(a){"function"==typeof a&&(this._dataValidation=a)}function e(a){this._combo.setOptions(a)}function f(){this._combo.clearComboInput()}function g(a){this._combo.toggleAddButton(a)}function h(a){this._combo.setAddItemPrompt(a)}function i(){r.prototype.destroy.apply(this,arguments),this._connector&&milo.minder.destroyConnector(this._connector),this._connector=null}function j(){this.template.render().binder(),k.call(this)}function k(){t.defineProperties(this,{_combo:this.container.scope.combo,_list:this.container.scope.list}),this._connector=milo.minder(this._list.model,"<<<->>>",this.model),this._combo.data.on("",{subscriber:l,context:this}),this._combo.on("additem",{subscriber:q,context:this})}function l(a,b){b.newValue&&this._dataValidation(a,b,this._list.model.get())&&this._list.model.push(b.newValue),this._combo.data.del(),this._combo.data._value=""}function m(){this.data.dispatchSourceMessage(u)}function n(){var a=this.model.get();return"object"==typeof a?t.clone(a):a}function o(a){this.model.set(a)}function p(){return this.model.set([])}function q(a,b){this.postMessage("additem",b),this.events.postMessage("milo_combolistadditem",b)}var r=a("../c_class"),s=a("../c_registry"),t=a("milo-core").proto,u="mlcombolistchange",v=r.createComponentClass("MLComboList",{dom:{cls:"ml-ui-combo-list"},data:{get:n,set:o,del:p,event:u},events:void 0,container:void 0,model:{messages:{"***":{subscriber:m,context:"owner"}}},template:{template:'
'}});s.add(v),b.exports=v,t.extendProto(v,{init:c,setOptions:e,setDataValidation:d,toggleAddButton:g,destroy:i,setAddItemPrompt:h,clearComboInput:f})},{"../c_class":15,"../c_registry":32,"milo-core":106}],44:[function(a,b){"use strict";function c(){return n.date(this.el.min)}function d(a){var b=n.toDate(a);this.el.min=b?k(b):""}function e(){return n.date(this.el.max)}function f(a){var b=n.toDate(a);this.el.max=b?k(b):""}function g(){return n.toDate(this.el.value)}function h(a){var b=n.toDate(a);this.el.value=b?k(b):"",j.call(this)}function i(){this.el.value="",j.call(this)}function j(){this.data.dispatchSourceMessage("input")}function k(a){function b(a){return 10>a?"0"+a:a}var c=[a.getFullYear(),b(a.getMonth()+1),b(a.getDate())],d=c.join("-");return d}var l=a("../c_class"),m=a("../c_registry"),n=a("milo-core").proto,o=l.createComponentClass("MLDate",{events:void 0,data:{get:g,set:h,del:i},dom:{cls:"ml-ui-date"}});n.extendProto(o,{getMin:c,setMin:d,getMax:e,setMax:f}),m.add(o),b.exports=o},{"../c_class":15,"../c_registry":32,"milo-core":106}],45:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLDropTarget",["drop"]); -d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],46:[function(a,b){"use strict";function c(a){a.classList.toggle("ml-ui-foldtree--unfold")}function d(a,b){var c=b.getAttribute("data-item-id"),d=this._itemsMap[c];this.postMessage("mlfoldtree_"+a,{item:d,el:b})}function e(a,b){var e=b.target;if(e.classList.contains("ml-ui-foldtree-button"))c(e.parentNode.parentNode);else{if(!e.classList.contains("ml-ui-foldtree-label"))return;d.call(this,a,e)}b.stopPropagation()}function f(a){this._itemTemplate=h.compile(a)}function g(a){function b(a){if(a.items)var d=_.map(a.items,function(a){var b=k();return c._itemsMap[b]=a,b});return n({itemIDs:d,data:a,itemTemplate:c._itemTemplate||m,treeTemplate:b})}var c=this;this._data=a,c._itemsMap={},this.el.innerHTML=b(a)}var h=a("milo-core").util.doT,i=a("../c_registry"),j=a("../c_class"),k=a("../../util/unique_id"),l='
    {{~ it.data.items :item:index }} {{ var hasSubTree = item.items && item.items.length; }}
  • {{? hasSubTree }}
    {{?}} {{= it.itemTemplate({ item: item, id: it.itemIDs[index] }) }}
    {{? hasSubTree }} {{= it.treeTemplate(item) }} {{?}}
  • {{~}}
',m=h.compile(' {{= it.item.label }} '),n=h.compile(l),o=j.createComponentClass("MLFoldTree",{container:void 0,events:{messages:{"click dblclick":{subscriber:e,context:"owner"}}},dom:{cls:"ml-ui-foldtree-main"}});i.add(o),b.exports=o,_.extendProto(o,{setItemTemplate:f,renderTree:g})},{"../../util/unique_id":92,"../c_class":15,"../c_registry":32,"milo-core":106}],47:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLGroup",{container:void 0,data:void 0,events:void 0,dom:{cls:"ml-ui-group"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],48:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLHyperlink",{events:void 0,data:void 0,dom:{cls:"ml-ui-hyperlink"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],49:[function(a,b){"use strict";function c(){i.prototype.init.apply(this,arguments)}function d(a){return this.model.set(a),a}function e(){var a=this.model.get();return a&&"object"==typeof a?k.clone(a):a}function f(){this.model.del()}function g(){this.data.dispatchSourceMessage(l)}function h(a,b){this.el.src=b.newValue,g.call(this)}var i=a("../c_class"),j=a("../c_registry"),k=a("milo-core").proto,l="mlimagechange",m=i.createComponentClass("MLImage",{data:{set:d,get:e,del:f,splice:void 0,event:l},model:{messages:{".src":{subscriber:h,context:"owner"}}},events:void 0,container:void 0,dom:{tagName:"img",cls:"ml-ui-image"}});j.add(m),b.exports=m,k.extendProto(m,{init:c})},{"../c_class":15,"../c_registry":32,"milo-core":106}],50:[function(a,b){"use strict";function c(a){this.el.disabled=a}function d(){return!!this.el.disabled}function e(a){this.el.setAttribute("maxlength",a)}var f=a("../c_class"),g=a("../c_registry"),h=a("milo-core").proto,i=f.createComponentClass("MLInput",{data:void 0,events:void 0,dom:{cls:"ml-ui-input"}});g.add(i),b.exports=i,h.extendProto(i,{disable:c,isDisabled:d,setMaxLength:e})},{"../c_class":15,"../c_registry":32,"milo-core":106}],51:[function(a,b){"use strict";function c(){p.prototype.init.apply(this,arguments),this.once("childrenbound",d),this.model.set([])}function d(){h.call(this)}function e(a){this._input.el.setAttribute("placeHolder",a)}function f(a){t=a||t}function g(){p.prototype.destroy.apply(this,arguments),this._connector&&milo.minder.destroyConnector(this._connector),this._connector=null}function h(){this.template.render().binder(),i.call(this)}function i(){r.defineProperties(this,{_input:this.container.scope.input,_button:this.container.scope.button,_list:this.container.scope.list}),this._connector=milo.minder(this._list.model,"<<<->>>",this.model),this._button.events.on("click",{subscriber:j,context:this})}function j(){var a=this._input.data.get(0);this._input.data&&t(a,function(a,b){this._list.model.push({label:a,value:b})}.bind(this)),this._input.data.del()}function k(){this.data.dispatchSourceMessage(s)}function l(){var a=this.model.get();return a?r.clone(a):void 0}function m(a){this.model.set(a)}function n(){return this.model.set([])}function o(){this.model.splice.apply(this.model,arguments)}var p=a("../c_class"),q=a("../c_registry"),r=a("milo-core").proto,s="mlinputlistchange",t=function(a,b){b(a)},u=p.createComponentClass("MLInputList",{dom:{cls:"ml-ui-input-list"},data:{get:l,set:m,del:n,splice:o,event:s},events:void 0,container:void 0,model:{messages:{"***":{subscriber:k,context:"owner"}}},template:{template:'
'}});q.add(u),b.exports=u,r.extendProto(u,{init:c,setAsync:f,setPlaceHolder:e,destroy:g})},{"../c_class":15,"../c_registry":32,"milo-core":106}],52:[function(a,b){"use strict";function c(){h.prototype.init.apply(this,arguments),this.on("childrenbound",g)}function d(){this._connector&&milo.minder.destroyConnector(this._connector),this._connector=null,h.prototype.destroy.apply(this,arguments)}function e(a){this.model.splice(a,1)}function f(a,b){var c=this.model.splice(a,1);return this.model.splice(b,0,c[0])}function g(){this.model.set([]),this._connector=milo.minder(this.model,"<<<-",this.data).deferChangeMode("<<<->>>")}var h=a("../c_class"),i=a("../c_registry"),j=a("milo-core").proto,k=h.createComponentClass("MLList",{dom:{cls:"ml-ui-list"},data:void 0,events:void 0,model:void 0,list:void 0});i.add(k),b.exports=k,j.extendProto(k,{init:c,destroy:d,removeItem:e,moveItem:f})},{"../c_class":15,"../c_registry":32,"milo-core":106}],53:[function(a,b){"use strict";function c(){q.prototype.init.apply(this,arguments),this.on("childrenbound",d)}function d(){var a=this.container.scope.deleteBtn;a&&a.events.on("click",{subscriber:this.removeItem,context:this})}function e(){try{var a=this.item.list.owner}catch(b){}a&&a.removeItem(this.item.index)}function f(a){var b=this.item.list.owner;b&&b.moveItem(this.item.index,a)}function g(a){return a.params&&a.params.index&&"MLListItem"==a.compClass}function h(){return this.isDropAllowed.apply(this,arguments)}function i(a,b){k.call(this);var c=new r(b),d=c.getComponentMeta(),e=c.getComponentState(),f=this.item.list.owner,g=d.params&&d.params.index;f.moveItem(+g,this.item.index,e)}function j(){this.dom.addCssClasses("ml-drag-over")}function k(){this.dom.removeCssClasses("ml-drag-over")}function l(){return{index:this.item.index}}function m(){var a=this.model.get();return null!==a&&"object"==typeof a?t.clone(a):a}function n(a){return"object"==typeof a&&this.data._set(a),this.model.set(a),p.call(this),a}function o(){this.data._del(),this.model.del(),p.call(this)}function p(){this.data.dispatchSourceMessage(u)}var q=a("../c_class"),r=a("../../util/dragdrop"),s=a("../c_registry"),t=a("milo-core").proto,u="mllistitemchange",v=q.createComponentClass("MLListItem",{container:void 0,dom:void 0,drag:{meta:{params:l}},drop:{messages:{dragenter:{subscriber:j,context:"owner"},dragover:{subscriber:j,context:"owner"},dragleave:{subscriber:k,context:"owner"},drop:{subscriber:i,context:"owner"}},allow:{components:h}},data:{get:m,set:n,del:o,event:u},model:void 0,item:void 0});s.add(v);var v=b.exports=v;t.extendProto(v,{init:c,moveItem:f,removeItem:e,isDropAllowed:g})},{"../../util/dragdrop":82,"../c_class":15,"../c_registry":32,"milo-core":106}],54:[function(a,b){"use strict";function c(){o.defineProperty(this,"_radioList",[],o.CONF),o.defineProperty(this,q,r+n()),this._renderOptions={},l.prototype.init.apply(this,arguments)}function d(a){this._renderOptions=a}function e(a){var b,c=this._radioList;return c.length?(c.forEach(function(c){c.checked=c.value==a,c.checked&&(b=a)}),i.call(this),b):void 0}function f(){var a=o.find(this._radioList,function(a){return a.checked});return a&&a.value||void 0}function g(){var a=this._radioList;return a.length&&a.forEach(function(a){a.checked=!1}),void i.call(this)}function h(a,b){"radio"==b.target.type&&i.call(this)}function i(){this.data.dispatchSourceMessage(p)}function j(){this.template.render({radioOptions:this.model.get(),elementName:this[q],_renderOptions:this._renderOptions});var a=this.el.querySelectorAll('input[type="radio"]'),b=o.toArray(a);this._radioList.length=0,this._radioList.splice.apply(this._radioList,[0,0].concat(b))}function k(){delete this._radioList,l.prototype.destroy.apply(this,arguments)}var l=a("../c_class"),m=a("../c_registry"),n=a("../../util/unique_id"),o=a("milo-core").proto,p="mlradiogroupchange",q="_mlRadioGroupElementID",r="ml-radio-group-",s=l.createComponentClass("MLRadioGroup",{data:{set:e,get:f,del:g,splice:void 0,event:p},model:{messages:{"***":{subscriber:j,context:"owner"}}},events:{messages:{click:{subscriber:h,context:"owner"}}},container:void 0,dom:{cls:"ml-ui-radio-group"},template:{template:'{{~ it.radioOptions :option }} {{##def.elID:{{= it.elementName }}-{{= option.value }}#}} {{~}}'}});m.add(s),b.exports=s,o.extendProto(s,{init:c,destroy:k,setRenderOptions:d})},{"../../util/unique_id":92,"../c_class":15,"../c_registry":32,"milo-core":106}],55:[function(a,b){"use strict";function c(a){var b={context:this,subscriber:e};this.model.off("**",b),this.model.set(a),this.model.on("**",b),e.call(this)}function d(a){this.el.disabled=a}function e(){this.template.render({selectOptions:this.model.get()})}var f=a("../c_class"),g=a("../c_registry"),h=a("milo-core").proto,i=f.createComponentClass("MLSelect",{dom:{cls:"ml-ui-select"},data:void 0,events:void 0,model:{messages:{"**":{subscriber:e,context:"owner"}}},template:{template:'{{~ it.selectOptions :option }} {{~}}'}});g.add(i),b.exports=i,h.extendProto(i,{setOptions:c,disable:d})},{"../c_class":15,"../c_registry":32,"milo-core":106}],56:[function(a,b){"use strict";function c(){K.prototype.init.apply(this,arguments),this.once("childrenbound",d),N.defineProperties(this,{_optionsData:[],_filteredOptionsData:[]},N.WRIT)}function d(){this.template.render().binder(),e.call(this)}function e(){var a=this.container.scope;N.defineProperties(this,{_comboInput:a.input,_comboList:a.list,_comboOptions:a.options,_comboBefore:a.before,_comboAfter:a.after,_comboAddItemDiv:a.addItemDiv,_comboAddPrompt:a.addPrompt,_comboAddBtn:a.addBtn,_optionTemplate:O.compile(S)}),N.defineProperties(this,{_startIndex:0,_endIndex:T,_hidden:!1,_elementHeight:V,_total:0,_optionsHeight:200,_lastScrollPos:0,_currentValue:null,_selected:null,_isAddButtonShown:!1},N.WRIT),this.dom.setStyles({position:"relative"}),p(this._comboList,this._comboOptions,this),q(this._comboInput,this),r(this._comboAddBtn,this),this.events.on("keydown",{subscriber:y,context:this})}function f(a){this._hidden=!a,this._comboList.dom.toggle(a)}function g(){this._hidden=!1,this.el.classList.add(Q),this._comboList.dom.toggle(!0)}function h(){this._hidden=!0,this.el.classList.remove(Q),this._comboList.dom.toggle(!1)}function i(a,b){this._comboAddItemDiv.dom.toggle(a),b&&b.preserveState&&(this.__showAddOnClick=this._isAddButtonShown),this._isAddButtonShown=a}function j(a){this._addItemPrompt=a,this._comboAddPrompt.el.innerHTML=a,this.toggleAddButton(!1)}function k(a){this._optionsData=a,this.setFilteredOptions(a)}function l(a){this._optionsURL=a.url,this._formatOptionsURL=a.formatOptions||function(a){return a}}function m(a){var b=this._optionsURL,c=this._comboInput.data.get();a=a||N.noop,milo.util.request.post(b,{name:c},function(b,d){if(b)return P.error('Can not search for "'+c+'"'),a(new Error("Request error"));var e=N.jsonParse(d);e?a(null,e):a(new Error("Data error"))})}function n(a){return a?(this._filteredOptionsData=a,this._total=a.length,void this.update()):P.error("setFilteredOptions: parameter is undefined")}function o(){var a=this._hidden,b=this._filteredOptionsData.slice(this._startIndex,this._endIndex);this._comboOptions.template.render({comboOptions:b}),this._elementHeight=this._elementHeight||V,a&&this.hideOptions();var c=this._startIndex*this._elementHeight,d=(this._total-this._endIndex)*this._elementHeight;this._comboBefore.el.style.height=c+"px",this._comboAfter.el.style.height=d>0?d+"px":"0px"}function p(a,b,c){c.toggleAddButton(!1),b.template.set(S),a.dom.setStyles({overflow:"scroll",height:c._optionsHeight+"px",width:"100%",position:"absolute",zIndex:10}),c.hideOptions(),a.events.onMessages({click:{subscriber:G,context:c},scroll:{subscriber:H,context:c}})}function q(a,b){a.events.once("focus",function(){a.data.on("",{subscriber:v,context:b}),a.events.on("click",{subscriber:D,context:b}),a.events.on("keydown",{subscriber:E,context:b})})}function r(a,b){a.events.on("click",{subscriber:F,context:b})}function s(){return this._currentValue}function t(a){this._currentValue=a,this._comboInput.data.set(a&&a.label),N.deferMethod(this,"hideOptions")}function u(){this._currentValue=null,this._comboInput.data.set("")}function v(a,b){var c=b.newValue&&b.newValue.trim();if(this._optionsURL){var d=this;m.call(this,function(a,b){if(!a&&b)try{var e=b.data.map(d._formatOptionsURL);d.setOptions(e),x.call(d,c,d._optionsData)}catch(f){P.error("Data error",f)}})}else{var e=w.call(this,c);x.call(this,c,e)}}function w(a){return this._optionsData.filter(function(b){if(delete b.selected,b.label){var c=b.label.toLowerCase();return 0==c.trim().toLowerCase().indexOf(a.toLowerCase())}})}function x(a,b){function c(b){return b.label.toLowerCase()===a.toLowerCase()}a?(b.length&&N.find(b,c)?this.toggleAddButton(!1,{preserveState:!0}):this._addItemPrompt&&this.toggleAddButton(this._optionsData.length>1||this._optionsURL),b.length?(this.showOptions(),b[0].selected=!0,this._selected=b[0]):this.hideOptions()):this.toggleAddButton(!1,{preserveState:!0}),this.setFilteredOptions(b),this._comboList.el.scrollTop=0}function y(a,b){var c=X[b.keyCode];c&&z.call(this,c)}function z(a){var b=this.el.querySelectorAll(".selected")[0],c=this._comboList.el.scrollTop,d=b?b.offsetTop:0,e=d-c;if(b){var f=I.call(this,b),g=this._filteredOptionsData[f],h=this._filteredOptionsData[f+a];h&&(delete g.selected,h.selected=!0,this._selected=h,this.update())}else this._filteredOptionsData[0]&&(this._filteredOptionsData[0].selected=!0,this.update());e>this._optionsHeight-2*this._elementHeight&&1===a&&(this._comboList.el.scrollTop+=this._elementHeight*a*5),ethis._lastScrollPos?"down":"up",e=this._comboOptions.el.lastElementChild,f=this._comboOptions.el.firstElementChild,g=e?e.offsetTop:0,h=f?f.offsetTop:0,i=g-c-this._optionsHeight+this._elementHeight,j=c-h,k=Math.floor(j/this._elementHeight),l=Math.floor(i/this._elementHeight),m=Math.floor(c/this._elementHeight)-U;("down"==d&&U>l||"up"==d&&U>k)&&(this._startIndex=m>0?m:0,this._endIndex=m+T,this._elementHeight=e.style.height,this.update()),this._lastScrollPos=c}function I(a){return Number(a.getAttribute("data-value"))+this._startIndex}function J(){delete this._selected.selected,this.hideOptions(),this.toggleAddButton(!1),this._comboInput.data.off("",{subscriber:v,context:this}),this.data.set(this._selected),this.data.dispatchSourceMessage(R),this._comboInput.data.on("",{subscriber:v,context:this}),this._selected=null,this.setFilteredOptions(this._optionsData)}var K=a("../c_class"),L=a("../c_registry"),M=a("milo-core"),N=M.proto,O=M.util.doT,P=M.util.logger,Q="ml-ui-supercombo-open",R="mlsupercombochange",S='{{~ it.comboOptions :option:index }}
{{= option.label }}
{{~}}',T=100,U=25,V=20,W=K.createComponentClass("MLSuperCombo",{events:{messages:{mouseleave:{subscriber:B,context:"owner"},mouseover:{subscriber:A,context:"owner"}}},data:{get:s,set:t,del:u,splice:void 0,event:R},dom:{cls:"ml-ui-supercombo"},template:{template:'
'},container:void 0});L.add(W),b.exports=W,N.extendProto(W,{init:c,showOptions:g,hideOptions:h,toggleOptions:f,setOptions:k,initOptionsURL:l,setFilteredOptions:n,update:o,toggleAddButton:i,setAddItemPrompt:j,clearComboInput:u});var X={40:1,38:-1}},{"../c_class":15,"../c_registry":32,"milo-core":106}],57:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLText",{data:void 0,events:void 0,dom:{cls:"ml-ui-text"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],58:[function(a,b){"use strict";function c(a){return this._autoresize?m.warn("MLTextarea startAutoresize: autoresize is already on"):(this._autoresize=!0,this._autoresizeOptions=a,e.call(this),void d.call(this,"on"))}function d(a){this.events[a]("click",{subscriber:e,context:this}),this.data[a]("",{subscriber:e,context:this})}function e(){this.el.style.height=0;var a=this.el.scrollHeight,b=this._autoresizeOptions.minHeight,c=this._autoresizeOptions.maxHeight;a=a>=c?c:b>=a?b:a,this.el.style.height=a+"px"}function f(){return this._autoresize?(this._autoresize=!1,void d.call(this,"off")):m.warn("MLTextarea stopAutoresize: autoresize is not on")}function g(){return this._autoresize}function h(a){this.el.disabled=a}var i=a("../c_class"),j=a("../c_registry"),k=a("milo-core"),l=k.proto,m=k.util.logger,n=i.createComponentClass("MLTextarea",{data:void 0,events:void 0,dom:{cls:"ml-ui-textarea"}});j.add(n),b.exports=n;l.extendProto(n,{startAutoresize:c,stopAutoresize:f,isAutoresized:g,disable:h})},{"../c_class":15,"../c_registry":32,"milo-core":106}],59:[function(a,b){"use strict";function c(){var a=this.el.value,b=a.match(j);if(b){var c=b[1],d=b[2];if(!(c>23||d>59)){var e=new Date(1970,0,1,c,d);return h.toDate(e)}}}function d(a){function b(a){return 10>a?"0"+a:a}var c=h.toDate(a);if(!c)return void(this.el.value="");var d=k.replace("hh",b(c.getHours())).replace("mm",b(c.getMinutes()));return this.el.value=d,d}function e(){this.el.value=""}var f=a("../c_class"),g=a("../c_registry"),h=a("milo-core").proto,i=f.createComponentClass("MLTime",{events:void 0,data:{get:c,set:d,del:e},dom:{cls:"ml-ui-time"}});g.add(i),b.exports=i;var j=/^([0-9]{1,2})(?:\:|\.)([0-9]{1,2})$/,k="hh:mm"},{"../c_class":15,"../c_registry":32,"milo-core":106}],60:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLWrapper",{container:void 0,data:void 0,events:void 0,dom:{cls:"ml-ui-wrapper"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],61:[function(a,b){"use strict";function c(a){m(a,{message:String,type:n.Optional(String),close:n.Optional(Boolean),timeout:n.Optional(Number)});var b=q.createOnElement();a=f(a);var c=p[a.type];b.dom.addCssClasses(c),b._alert={options:a,visible:!1},b.template.render(a).binder();var d=b.container.scope;if(a.close&&d.closeBtn.events.on("click",{subscriber:e,context:b}),a.timeout){setTimeout(function(){b._alert.visible&&b.closeAlert()},a.timeout)}return b}function d(a){var b=q.createAlert(a);return b.openAlert(),b}function e(){this.closeAlert()}function f(a){return a=o.clone(a),a.close="undefined"==typeof a.close||a.close===!0,a.timeout=Math.floor(a.timeout),a.type=a.type||"info",a}function g(){i.call(this,!0)}function h(){i.call(this,!1),this.destroy()}function i(a){a="undefined"==typeof a?!this._alert.visible:!!a;var b=a?"add":"remove",c=a?"appendChild":"removeChild";this._alert.visible=a,document.body[c](this.el),this.dom.toggle(a),this.el.setAttribute("aria-hidden",!a),this.el.classList[b]("in"),this.el[a?"focus":"blur"]()}var j=a("../../c_class"),k=a("../../c_registry"),l=(a("../../../util/component_name"),a("milo-core")),m=(l.util.logger,l.util.check),n=m.Match,o=l.proto,p={success:"alert-success",warning:"alert-warning",info:"alert-info",danger:"alert-danger",fixed:"alert-fixed"},q=j.createComponentClass("MLAlert",{container:void 0,events:void 0,dom:{cls:["ml-bs-alert","alert","fade"],attributes:{role:"alert","aria-hidden":"true"}},template:{template:' {{? it.close }} {{?}} {{= it.message}}'}});k.add(q),b.exports=q,o.extend(q,{createAlert:c,openAlert:d}),o.extendProto(q,{openAlert:g,closeAlert:h})},{"../../../util/component_name":76,"../../c_class":15,"../../c_registry":32,"milo-core":106}],62:[function(a,b){"use strict";function c(a,b){v(a,{title:w.Optional(String),html:w.Optional(String),text:w.Optional(String),close:w.Optional(w.OneOf(Boolean,{backdrop:w.Optional(Boolean),keyboard:w.Optional(Boolean),button:w.Optional(Boolean)})),buttons:w.Optional([{name:w.Optional(String),type:String,label:String,close:w.Optional(Boolean),result:w.Optional(String),data:w.Optional(w.Any),cls:w.Optional(String)}]),cssClass:w.Optional(String)});var c=A.createOnElement();a=i(a),c._dialog={options:a,visible:!1},c.template.render(a).binder();var e=c.container.scope;return a.close.backdrop&&c.events.on("click",{subscriber:f,context:c}),a.title&&a.close.button&&e.closeBtn.events.on("click",{subscriber:g,context:c}),a.buttons.forEach(function(a){var b={subscriber:x.partial(d,a),context:c};e[a.name].events.on("click",b)}),b&&b(c),c}function d(a){a.close!==!1&&k.call(this,!1);var b=x.result(a.data,this,a);e.call(this,a.result,b)}function e(a,b){var c=this._dialog.subscriber;"function"==typeof c?c.call(this,a,b):c.subscriber.call(c.context,a,b)}function f(a,b){b.target==this.el&&this.closeDialog("dismissed")}function g(){this.closeDialog("closed")}function h(a){D&&D._dialog.options.close.keyboard&&27==a.keyCode&&D.closeDialog("dismissed")}function i(a){return a=x.clone(a),a.buttons=x.clone(a.buttons||y),a.buttons.forEach(function(a){a.name=a.name||s()}),a.close="undefined"==typeof a.close||a.close===!0?x.object(z,!0):"object"==typeof a.close?x.mapToObject(z,function(b){return a.close[b]!==!1}):x.object(z,!1),a}function j(a,b,c){var d=A.createDialog(a,c);return d.openDialog(b),d}function k(a){a="undefined"==typeof a?!this._dialog.visible:!!a;var b=a?"add":"remove",c=a?"appendChild":"removeChild";this._dialog.visible=a,a&&!B&&l(),document.body[c](this.el),C&&document.body[c](C),this.dom.toggle(a),this.el.setAttribute("aria-hidden",!a),document.body.classList[b]("modal-open"),this.el.classList[b]("in"),D=a?this:void 0,this.el[a?"focus":"blur"]()}function l(){C=document.createElement("div"),C.className="modal-backdrop fade in",document.addEventListener("keydown",h),B=!0}function m(a){return v(a,w.OneOf(Function,{subscriber:Function,context:w.Any})),D?u.warn("MLDialog openDialog: can't open dialog, another dialog is already open"):(this._dialog.subscriber=a,void k.call(this,!0))}function n(a,b){return D?(a=a||"closed",k.call(this,!1),void e.call(this,a,b)):u.warn("MLDialog closeDialog: can't close dialog, no dialog open")}function o(){return D}function p(){document.removeEventListener("keydown",h),q.prototype.destroy.apply(this,arguments)}var q=a("../../c_class"),r=a("../../c_registry"),s=a("../../../util/component_name"),t=a("milo-core"),u=t.util.logger,v=t.util.check,w=v.Match,x=t.proto,y=[{type:"default",label:"OK",result:"OK"}],z=["backdrop","keyboard","button"],A=q.createComponentClass("MLDialog",{container:void 0,events:void 0,dom:{cls:["ml-bs-dialog","modal","fade"],attributes:{role:"dialog","aria-hidden":"true"}},template:{template:' '}});r.add(A),b.exports=A,x.extend(A,{createDialog:c,openDialog:j,getOpenedDialog:o}),x.extendProto(A,{openDialog:m,closeDialog:n,destroy:p});var B,C,D},{"../../../util/component_name":76,"../../c_class":15,"../../c_registry":32,"milo-core":106}],63:[function(a,b){"use strict";function c(){function a(a){var c=a.target,e=a.relatedTarget,f=i._dropdown.listeners;d(c)&&f.remove(c.contentWindow.document,"click",b),d(e)&&f.add(e.contentWindow.document,"click",b)}function b(a){i.el.contains(a.target)||i.hideMenu()}var c=this.el.querySelector("."+o),e=this.el.querySelector("."+p);if(!c||!e)return m.error("MLDropdown:",o,"or",p,"isn't found");var f=window.document,g=this.toggleMenu.bind(this,void 0),h=new n;this._dropdown={menu:e,visible:!1,listeners:h},this.hideMenu();var i=this;h.add(c,"click",g),h.add(f,"mouseout",a),h.add(f,"click",b)}function d(a){return a&&"IFRAME"==a.tagName}function e(){this._dropdown.listeners.removeAll(),delete this._dropdown,i.prototype.destroy.apply(this,arguments)}function f(){this.toggleMenu(!0)}function g(){this.toggleMenu(!1)}function h(a){a="undefined"==typeof a?!this._dropdown.visible:!!a,this._dropdown.visible=a;var b=this._dropdown.menu;b.style.display=a?"block":"none"}var i=a("../../c_class"),j=a("../../c_registry"),k=a("milo-core"),l=k.proto,m=k.util.logger,n=a("../../../util/dom_listeners"),o="dropdown-toggle",p="dropdown-menu",q=i.createComponentClass("MLDropdown",{events:void 0,dom:{cls:["ml-bs-dropdown","dropdown"]}});j.add(q),b.exports=q,l.extendProto(q,{start:c,destroy:e,toggleMenu:h,showMenu:f,hideMenu:g})},{"../../../util/dom_listeners":80,"../../c_class":15,"../../c_registry":32,"milo-core":106}],64:[function(a,b){"use strict";var c=a("milo-core"),d=(c.proto,c.util.doT),e=b.exports=c.config;e({attrs:{bind:"ml-bind",load:"ml-load"},componentRef:"___milo_component",componentPrefix:"milo_",template:{compile:d.compile},domStorage:{typeSuffix:":___milo_data_type",prefixSeparator:"/",root:"",messageKey:"___milo_message/",messageTimestamp:"___milo_timestamp",quotaExceeded:{throwError:!0,message:!1}},dragDrop:{dataTypes:{component:"x-application/milo/component",componentMetaTemplate:"x-application/milo/component-meta/%class/%name/%params",componentMetaRegex:/^x\-application\/milo\/component\-meta\/([a-z0-9]+)\/([a-z0-9]+)\/([a-z0-9]*)$/}},request:{jsonpTimeout:6e4,jsonpCallbackPrefix:"___milo_callback_",optionsKey:"___milo_options",defaults:{timeout:6e4}},websocket:{rpc:{timeout:15e3,responsePrefix:"response_"}},deprecationWarning:"once"})},{"milo-core":106}],65:[function(a,b){"use strict";function c(a,b,c){milo(function(){d(a,b,c)})}function d(a,b,c){"function"==typeof a&&(c=a,a=void 0,b=!1),"function"==typeof b&&(c=b,b=!1),a=a||document.body,g.postMessage("loader",{state:"started"}),e(a,b,function(a){g.postMessage("loader",{state:"finished",views:a}),c(a)})}function e(a,b,c){var d=a.getAttribute(l.attrs.load)?[a]:a.querySelectorAll("["+l.attrs.load+"]"),e={},g=d.length,h=0;j.forEach(d,function(a){f(a,b,function(b){e[a.id]=b||a,h++,h==g&&c(e)})})}function f(a,b,c){if(k.children(a).length)throw new Error("can't load html into element that is not empty");var d=new m(a);d.parse().validate(),h.get(d.loadUrl,function(e,f){return e?(e.message=e.message||"can't load file "+d.loadUrl,void c(e)):(a.innerHTML=f,b&&m.remove(a),void c(null))})}var g=a("./services/mail"),h=a("./util/request"),i=a("milo-core"),j=(i.util.logger,i.proto),k=a("./util/dom"),l=a("./config"),m=a("./attributes/a_load");b.exports=c},{"./attributes/a_load":6,"./config":64,"./services/mail":70,"./util/dom":79,"./util/request":87,"milo-core":106}],66:[function(a,b){"use strict";function c(a){c.util.domReady(a)}function d(){e.destroy(),c.mail.destroy(),c.window.destroy(),c.util.destroy()}var e=a("milo-core"),f=e.proto;a("./use_facets"),a("./use_components"),f.extend(c,{Messenger:e.Messenger,Model:e.Model,minder:e.minder,loader:a("./loader"),binder:a("./binder"),mail:a("./services/mail"),window:a("./services/window"),config:a("./config"),util:a("./util"),classes:a("./classes"),attributes:a("./attributes"),ComponentFacet:a("./components/c_facet"),Component:a("./components/c_class"),Command:a("./command"),registry:a("./registry"),milo_version:"0.2.1",createComponentClass:a("./util/create_component_class"),destroy:d}),"object"==typeof b&&b.exports&&(b.exports=c),"object"==typeof window&&(window.milo=c,c.mail.trigger("miloready")) +}function g(){this.toggle(!1)}function h(a){a="undefined"==typeof a?!this._visible:!!a,this._visible=a;var b=this.owner.el;return b.style.display=a?"block":"none",a}function i(a,b,c){j(this.owner.el,a,b,c)}function j(a,b,c,d){function e(a){g?void 0===d?f[b](a):f[b](a,d):f[b](a)}var f=a.classList,g="toggle"==b;if(Array.isArray(c))c.forEach(e);else{if("string"!=typeof c)throw new Error("unknown type of CSS classes parameter");e(c)}}function k(){this.owner.el&&I.detachComponent(this.owner.el)}function l(a,b){if(!this.owner.el)throw new Error("Cannot call setStyle on owner with no element: "+this.owner.constructor.name);this.owner.el.style[a]=b}function m(a){for(var b in a)this.owner.el.style[b]=a[b]}function n(a){return this.owner.el&&this.owner.el.cloneNode(a)}function o(){var a=J.createElement(this.config);return a}function p(){I.removeElement(this.owner.el)}function q(a){this.owner.el.appendChild(a)}function r(a){var b=this.owner.el,c=b.firstChild;c?b.insertBefore(a,c):b.appendChild(a)}function s(a){for(;a.childNodes.length;)this.append(a.childNodes[0])}function t(a){for(;a.childNodes.length;)this.prepend(a.childNodes[a.childNodes.length-1])}function u(a){var b=this.owner.el,c=b.parentNode;c.insertBefore(a,b.nextSibling)}function v(a){var b=this.owner.el,c=b.parentNode;c.insertBefore(a,b)}function w(){var a=this.owner.getScopeParent();a&&a.el.appendChild(this.owner.el)}function x(){return I.children(this.owner.el)}function y(a,b){if(!K.hasOwnProperty(a))throw new Error("incorrect find direction: "+a);var c=this.owner.el,d=this.owner.scope,e=document.createTreeWalker(d._rootEl,NodeFilter.SHOW_ELEMENT);e.currentNode=c;for(var f=e[K[a]](),g=(Object.keys(d),!1);f;){var h=new H(f);if(h.node&&(h.parse().validate(),d.hasOwnProperty(h.compName))){var i=d[h.compName];if(!b||b(i)){g=!0;break}}e.currentNode=f,f=e[K[a]]()}return g?i:void 0}function z(){var a=window.getSelection();if(!a.isCollapsed)return!0;var b=a.focusNode&&a.focusNode.textContent,c=b&&" "==b.charAt(0)?1:0;if(a.anchorOffset!=c)return!0;var d=document.createTreeWalker(this.owner.el,NodeFilter.SHOW_TEXT);d.currentNode=a.anchorNode;var e=d.previousNode(),f=e?""==!e.nodeValue.trim():!1;return f}function A(){var a=window.getSelection();if(!a.isCollapsed)return!0;var b=a.focusNode&&a.focusNode.textContent,c=b&&" "==b.charAt(b.length-1)?a.anchorNode.length-1:a.anchorNode.length;if(a.anchorOffset=0;var f=d[e&&e.compClass];return!!o.result(f,this.owner,e,a);default:throw new Error("Incorrect allowed components in config")}}else{var g=c&&c.dataTypes;switch(typeof g){case"undefined":return!1;case"string":return a.types.indexOf(g)>=0}}}var j=a("../c_facet"),k=a("./cf_registry"),l=a("../msg_src/dom_events"),m=a("../msg_api/drop"),n=a("../../util/dragdrop"),o=a("milo-core").proto,p=o.createSubclass(j,"Drop");o.extendProto(p,{init:c,start:d}),k.add(p),b.exports=p;var q=o.throttle(h,50)},{"../../util/dragdrop":82,"../c_facet":16,"../msg_api/drop":37,"../msg_src/dom_events":38,"./cf_registry":30,"milo-core":106}],22:[function(a,b){"use strict";function c(){d.prototype.init.apply(this,arguments);var a=new g(this,void 0,void 0,this.owner);this._setMessageSource(a),h.defineProperty(this,j,a)}var d=a("../c_facet"),e=a("./cf_registry"),f=a("milo-core"),g=(f.Messenger,a("../msg_src/dom_events")),h=f.proto,i=h.createSubclass(d,"Events");h.extendProto(i,{init:c}),e.add(i),b.exports=i;var j="_domEventsSource";g.useWith(i,j,["trigger"])},{"../c_facet":16,"../msg_src/dom_events":38,"./cf_registry":30,"milo-core":106}],23:[function(a,b){"use strict";function c(){k.prototype.init.apply(this,arguments);var a=new n(this,void 0,void 0,this.owner);this._setMessageSource(a),o.defineProperty(this,s,a)}function d(){function a(a){b.postMessage("domready",a)}k.prototype.start.apply(this,arguments);var b=this;milo(a)}function e(){k.prototype.destroy.apply(this,arguments)}function f(){return this.owner.el.contentWindow}function g(){var a=this.getWindow().document.readyState;return"loading"!=a?a:!1}function h(){var a=this.getWindow().milo;return this.isReady()&&a&&a.milo_version}function i(a){if("function"==typeof a){var b=this;this.whenMiloReady(function(){b.getWindow().milo(a)})}var c=this.getWindow();return c&&c.milo}function j(a,b){return function(c){function d(){c.apply(e,f)}var e=this,f=o.slice(arguments,1);a.call(this)?d():this.on(b,d)}}var k=a("../c_facet"),l=a("./cf_registry"),m=a("milo-core"),n=(m.Messenger,a("../msg_src/frame")),o=(a("../../services/de_constrs"),m.proto),p=o.createSubclass(k,"Frame"),q=j(g,"domready"),r=j(h,"message:miloready");o.extendProto(p,{init:c,start:d,destroy:e,getWindow:f,isReady:g,whenReady:q,isMiloReady:h,whenMiloReady:r,milo:i}),l.add(p),b.exports=p;var s="_messageSource";n.useWith(p,s,["trigger"])},{"../../services/de_constrs":68,"../c_facet":16,"../msg_src/frame":39,"./cf_registry":30,"milo-core":106}],24:[function(a,b){"use strict";function c(){return{state:{index:this.getIndex()}}}function d(a){this.setIndex(a.state.index)}function e(){return this.index}function f(a){this.index=a}function g(){this.list.removeItem(this.index)}function h(){this.list.extractItem(this.index)}var i=a("../c_facet"),j=a("./cf_registry"),k=a("milo-core"),l=(k.Model,k.proto),m=(a("../../services/mail"),l.createSubclass(i,"Item"));l.extendProto(m,{getState:c,setState:d,getIndex:e,setIndex:f,removeItem:g,extractItem:h,require:["Container","Dom","Data"]}),j.add(m),b.exports=m},{"../../services/mail":70,"../c_facet":16,"./cf_registry":30,"milo-core":106}],25:[function(a,b){"use strict";function c(){y.prototype.init.apply(this,arguments);C.defineProperties(this,{_listItems:[],_listItemsHash:{}}),C.defineProperty(this,"itemSample",null,C.WRIT)}function d(){this.owner.on("childrenbound",e)}function e(){var a=this.dom.children(),b=this.list._listItems,c=this.list._listItemsHash;if(a&&a.forEach(function(a){var d=z.getComponent(a);d&&d.item&&(b.push(d),c[d.name]=d,d.item.list=this.list)},this),b.length){var d=b[0];b.splice(0,1),delete c[d.name],b.forEach(function(a,b){a.item.setIndex(b)})}if(!d)throw new Error("No child component has Item facet");this.list.itemSample=d,d.dom.hide(),d.remove(!0),d.dom.removeCssClasses(L),d.walkScopeTree(function(a){delete a.el[K.componentRef]}),this.list._createCacheTemplate()}function f(){if(!this.itemSample)return!1;{var a=this.itemSample,b=a.el.cloneNode(!0),c=a.componentInfo.attr;C.clone(c)}c.compName="{{= it.componentName() }}",c.el=b,c.decorate();var d="{{ var i = it.count; while(i--) { }}"+b.outerHTML+"{{ } }}";this.itemsTemplate=F.compile(d)}function g(a){return this._listItems[a]}function h(){return this._listItems.length}function i(a,b){this._listItems.splice(a,0,b),this._listItemsHash[b.name]=b,b.item.list=this,b.item.setIndex(+a)}function k(a){return this._listItemsHash[a.name]==a}function l(a,b){return a=a||this.count(),this.owner.data.splice(a,0,b||{}),this.item(a)}function m(a){if(a=a||this.count(),this.item(a))throw Error("attempt to create item with ID of existing item");var b=z.copy(this.itemSample,!0),c=this._itemPreviousComponent(a);return c.el.parentNode?(c.dom.insertAfter(b.el),this._setItem(a,b),b.el.style.display="",n.call(this,a+1),b):E.warn("list item sample was removed from DOM, probably caused by wrong data. Reset list data with array")}function n(a,b){a=a||0,b=b||this.count();for(var c=a;b>c;c++){var d=this._listItems[c];d?d.item.setIndex(c):E.warn("List: no item at position",c)}}function o(a,b){var c=C.slice(arguments,2);c.lengtha)throw new Error("can't add negative number of items");if(0!=a){var c=this.itemsTemplate({componentName:J,count:a}),d=document.createElement("div");d.innerHTML=c,D(d,this.owner.container.scope);var e=I.children(d);if(a!=e.length&&E.error("number of items added is different from requested"),e&&e.length){var f=this.count(),g=0>b?0:"undefined"==typeof b||b>f?f:b,h=0==g?this.itemSample:this._listItems[g-1],i=document.createDocumentFragment(),j=[];if(e.forEach(function(a){var b=z.getComponent(a);return b?(j.push(b),this._setItem(g++,b),i.appendChild(a),void(a.style.display="")):E.error("List: element in new items is not a component")},this),n.call(this,g),!h.el.parentNode)return E.warn("list item sample was removed from DOM, probably caused by wrong data. Reset list data with array");h.dom.insertAfter(i),C.deferMethod(j,"forEach",function(a){a.broadcast("stateready")})}}}function q(a){return this.owner.data.splice(a,1)}function r(a){var b=this._removeItem(a,!1);return this._updateDataPaths(a,this.count()),b}function s(a,b){var c=this.item(a);return c?(this._listItems[a]=void 0,delete this._listItemsHash[c.name],b!==!1?c.destroy():(c.remove(),c.dom.remove()),this._listItems.splice(a,1),n.call(this,a),c):E.warn("attempt to remove list item with id that does not exist")}function t(a,b){var c=this.item(a);c.dom.insertAfter(b.el),this._removeItem(a),this._setItem(a,b)}function u(a){for(;a>=0&&!this._listItems[a];)a--;return a>=0?this._listItems[a]:this.itemSample}function v(a,b){for(var c=a;b>c;c++){var d=this.item(c);d?d.data._path="["+c+"]":E.warn("Data: no item for index",j)}}function w(a,b){this._listItems.forEach(function(b,c){b?a.apply(this,arguments):E.warn("List$each: item",c,"is undefined")},b||this)}function x(){this.itemSample&&this.itemSample.destroy(!0),y.prototype.destroy.apply(this,arguments)}var y=a("../c_facet"),z=a("../c_class"),A=a("./cf_registry"),B=a("milo-core"),C=B.proto,D=(a("../../services/mail"),a("../../binder")),E=B.util.logger,F=B.util.doT,G=B.util.check,H=G.Match,I=a("../../util/dom"),J=a("../../util/component_name"),K=a("../../config"),L="ml-list-item-sample",M=C.createSubclass(y,"List");C.extendProto(M,{init:c,start:d,destroy:x,require:["Container","Dom","Data"],_itemPreviousComponent:u,item:g,count:h,contains:k,addItem:l,addItems:o,replaceItem:t,removeItem:q,extractItem:r,each:w,_setItem:i,_removeItem:s,_addItem:m,_addItems:p,_createCacheTemplate:f,_updateDataPaths:v}),A.add(M),b.exports=M},{"../../binder":8,"../../config":64,"../../services/mail":70,"../../util/component_name":76,"../../util/dom":79,"../c_class":15,"../c_facet":16,"./cf_registry":30,"milo-core":106}],26:[function(a,b){"use strict";function c(){this.m=new k(this.config.data,this),h.prototype.init.apply(this,arguments)}function d(){var a=this.m.get();return"object"==typeof a&&(a=l.deepClone(a)),{state:a}}function e(a){return this.m.set(a.state)}function f(){this._messenger=this.m._messenger}function g(){this.m.destroy(),h.prototype.destroy.apply(this,arguments)}var h=a("../c_facet"),i=a("./cf_registry"),j=a("milo-core"),k=j.Model,l=(j.classes.Mixin,j.proto),m=l.createSubclass(h,"Model");l.extendProto(m,{init:c,getState:d,setState:e,_createMessenger:f,destroy:g}),i.add(m),b.exports=m,k.useWith(m,"m")},{"../c_facet":16,"./cf_registry":30,"milo-core":106}],27:[function(a,b){"use strict";function c(){this.m=new i(this.config.options,this),f.prototype.init.apply(this,arguments),this.m.proxyMethods(this)}function d(){this._messenger=this.m._messenger}function e(){this.m.destroy(),f.prototype.destroy.apply(this,arguments)}var f=a("../c_facet"),g=a("./cf_registry"),h=a("milo-core"),i=h.Model,j=h.proto,k=j.createSubclass(f,"Options");j.extendProto(k,{init:c,destroy:e,_createMessenger:d}),g.add(k),b.exports=k},{"../c_facet":16,"./cf_registry":30,"milo-core":106}],28:[function(a,b){"use strict";function c(){i.prototype.init.apply(this,arguments);var a=this.config.interpolate===!1?void 0:this.config.compile||milo.config.template.compile;this.set(this.config.template||"",a,this.config.compileOptions)}function d(){i.prototype.start.apply(this,arguments),this.config.autoRender&&(this.render(),this.config.autoBinder&&this.binder())}function e(){return this._template}function f(a,b,c){return m(a,o.OneOf(String,Function)),m(b,o.Optional(Function)),"function"==typeof a?this._template=a:(this._templateStr=a,b?this._compile=b:b=this._compile,b&&(this._template=b(a,c))),this}function g(a){return this.owner.el.innerHTML=this._template?this._template(a):this._templateStr,this}function h(){return this.owner.container?this.owner.container.binder():void n.error("TemplateFacet: Binder called without container facet.")}var i=a("../c_facet"),j=a("./cf_registry"),k=a("milo-core"),l=k.proto,m=k.util.check,n=k.util.logger,o=m.Match,p=(a("../../binder"),l.createSubclass(i,"Template"));l.extendProto(p,{init:c,start:d,set:f,getCompiled:e,render:g,binder:h}),j.add(p),b.exports=p},{"../../binder":8,"../c_facet":16,"./cf_registry":30,"milo-core":106}],29:[function(a,b){"use strict";function c(){j.prototype.init.apply(this,arguments),this._activeState="",this._defaultKey="",this._state={}}function d(){return this._state[this._activeState]||this._state[this._defaultKey]}function e(a){this._state[""]=a,this.setActiveState("")}function f(a){this._activeState=a}function g(a,b,c){if(!a)throw new Error("Transfer$setStateWithKey: no key");this._defaultKey=c?a:this._defaultKey||a,this._state[a]=b,this.setActiveState(a)}function h(a){return"string"==typeof a&&this._state[a]}function i(){var a=this.getState();return{compName:a&&a.compName,compClass:a&&a.compClass}}var j=a("../c_facet"),k=a("./cf_registry"),l=a("milo-core").proto,m=l.createSubclass(j,"Transfer");l.extendProto(m,{init:c,getState:d,setState:e,setActiveState:f,setStateWithKey:g,getStateWithKey:h,getComponentMeta:i}),k.add(m),b.exports=m},{"../c_facet":16,"./cf_registry":30,"milo-core":106}],30:[function(a,b){"use strict";var c=a("../../abstract/registry"),d=a("../c_facet"),e=new c(d);e.add(d),b.exports=e},{"../../abstract/registry":3,"../c_facet":16}],31:[function(a,b){"use strict";function c(a,b,c,d){c.parse().validate(),this.scope=a,this.el=b,this.attr=c,this.name=c.compName,this.ComponentClass=f(c,d),this.extraFacetsClasses=g(this.ComponentClass,c,d),this.ComponentClass&&i(this.ComponentClass,this.extraFacetsClasses)&&(this.container={})}function d(){delete this.el,this.attr.destroy()}function e(a,b){a=a||l(),m.rename(this,a,b),this.attr.compName=a,this.attr.decorate()}function f(a,b){var c=j.get(a.compClass);return c||h(b,"class "+a.compClass+" is not registered"),c}function g(a,b,c){var d=b.compFacets,e={};return Array.isArray(d)&&d.forEach(function(d){d=p.firstUpperCase(d),a.hasFacet(d)&&h(c,"class "+a.name+" already has facet "+d),e[d]&&h(c,"component "+b.compName+" already has facet "+d);var f=k.get(d);e[d]=f}),e}function h(a,b){if(a!==!1)throw new Error(b);o.error("ComponentInfo binder error:",b)}function i(a,b){function c(){return a.prototype.facetsClasses&&p.someKey(a.prototype.facetsClasses,d)}function d(a){return a.requiresFacet("container")}return a.hasFacet("container")||"Container"in b||p.someKey(b,d)||c()}var j=a("./c_registry"),k=a("./c_facets/cf_registry"),l=a("../util/component_name"),m=a("./scope"),n=a("milo-core"),o=n.util.logger,p=n.proto;b.exports=c,p.extendProto(c,{destroy:d,rename:e})},{"../util/component_name":76,"./c_facets/cf_registry":30,"./c_registry":32,"./scope":40,"milo-core":106}],32:[function(a,b){"use strict";var c=a("../abstract/registry"),d=a("./c_class"),e=new c(d);e.add(d),b.exports=e},{"../abstract/registry":3,"./c_class":15}],33:[function(a,b){"use strict";function c(a){return a.hasOwnProperty(h.componentRef)}function d(a){return a&&a[h.componentRef]}function e(a,b,c){j(b,k.Optional(Boolean)),j(c,k.Optional(k.OneOf(Function,String)));var d=f(c);return g(a,b,d)}function f(a){if("function"==typeof a)return a;if("string"==typeof a){var b=l.firstLowerCase(a);return function(a){return a.hasFacet(b)}}}function g(a,b,c){if(b!==!1){var e=d(a);if(e&&(!c||c(e)))return e}return a.parentNode?g(a.parentNode,!0,c):void 0}{var h=a("../config"),i=a("milo-core"),j=i.util.check,k=j.Match,l=i.proto;b.exports={isComponent:c,getComponent:d,getContainingComponent:e,_makeComponentConditionFunc:f}}},{"../config":64,"milo-core":106}],34:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("View",["container"]);d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],35:[function(a,b){"use strict";function c(a){j.prototype.init.apply(this,arguments),this.component=a,this.elData=h(a.el)}function d(){var a=this.component.data.config.get,b="function"==typeof a?a.call(this.component):this.elData.get(this.component.el);return this.component.data._value=b,b}function e(a){var b=this.component.data.config.event,c=b||this.elData.event(this.component.el);return""==a&&c?c:void 0}function f(a,b,c){return c.newValue!=c.oldValue}function g(){var a=this.component.data._value,b=this.value(),c={path:"",type:"changed",oldValue:a,newValue:b};return c}var h=a("./de_data"),i=a("milo-core"),j=i.classes.MessengerAPI,k=i.proto,l=i.util.check,m=(l.Match,k.createSubclass(j,"DataMsgAPI",!0));k.extendProto(m,{init:c,translateToSourceMessage:e,filterSourceMessage:f,createInternalData:g,value:d}),b.exports=m},{"./de_data":36,"milo-core":106}],36:[function(a,b){"use strict";function c(a){var b=h[a.type];return b?b.property:h.byDefault.property}function d(a){var b=h[a.type];return b?b.event:h.byDefault.event}var e=a("milo-core").proto,f=function(a){var b=a.tagName.toLowerCase(),c=g[b];return c||g.byDefault};b.exports=f;var g={byDefault:{property:"innerHTML"},div:{property:"innerHTML"},span:{property:"innerHTML",event:"input"},p:{property:"innerHTML",event:"input"},input:{property:c,event:d},textarea:{property:"value",event:"input"},select:{property:"value",event:"change"},img:{property:"src"},caption:{property:"innerHTML",event:"input"},thead:{property:"innerHTML",event:"input"},tbody:{property:"innerHTML",event:"input"},tfoot:{property:"innerHTML",event:"input"}};e.eachKey(g,function(a){var b=a.property,c=a.event;"function"!=typeof b&&(a.property=function(){return b});var d=a.property;"function"!=typeof c&&(a.event=function(){return c}),a.get||(a.get=function(a){return a[d(a)]}),a.set||(a.set=function(a,b){return a[d(a)]="undefined"==typeof b?"":b})});var h={byDefault:{property:"value",event:"input"},checkbox:{property:"checked",event:"change"},radio:{property:"checked",event:"change"},text:{property:"value",event:"input"}}},{"milo-core":106}],37:[function(a,b){"use strict";function c(a){return h.hasOwnProperty(a)?h[a]:a}function d(){delete this._currentTarget,delete this._inside}function e(a,b,c){var e=!0;return"dragenter"==a&&"dragin"==b?(this._currentTarget=c.target,e=!this._inside,this._inside=!0):"dragleave"==a&&"dragout"==b?(e=this._currentTarget==c.target,e&&d.call(this)):"drop"==a&&d.call(this),e}var f=a("milo-core").classes.MessengerAPI,g=_.createSubclass(f,"DropMsgAPI",!0);_.extendProto(g,{translateToSourceMessage:c,filterSourceMessage:e}),b.exports=g;var h={dragin:"dragenter",dragout:"dragleave"}},{"milo-core":106}],38:[function(a,b){"use strict";function c(a,b,c,d){k(d,i),this.component=d,h.prototype.init.apply(this,arguments)}function d(){h.prototype.destroy.apply(this,arguments),delete this.component}function e(){return this.component.el}var f=a("../../services/dom_source"),g=a("milo-core"),h=g.classes.MessageSource,i=a("../c_class"),j=g.proto,k=g.util.check,l=(k.Match,j.createSubclass(f,"DOMEventsSource",!0));j.extendProto(l,{init:c,destroy:d,emitter:e}),b.exports=l},{"../../services/dom_source":69,"../c_class":15,"milo-core":106}],39:[function(a,b){"use strict";function c(a,b,c,d){if(m(d,i),this.component=d,"iframe"!=d.el.tagName.toLowerCase())throw new Error("component for FrameMessageSource can only be attached to iframe element");k.prototype.init.apply(this,arguments)}function d(){return this.component.el.contentWindow}function e(){var a=this.frameWindow();a?a.addEventListener("message",this,!1):n.warn("FrameMessageSource: frame window is undefined")}function f(){var a=this.frameWindow();a?a.removeEventListener("message",this,!1):n.warn("FrameMessageSource: frame window is undefined")}function g(a,b){b=b||{},b.type=a,this.frameWindow().postMessage(b,"*")}function h(a){this.dispatchMessage(a.data.type,a)}var i=a("../c_class"),j=a("milo-core"),k=j.classes.MessageSource,l=j.proto,m=j.util.check,n=j.util.logger,o=(m.Match,l.createSubclass(k,"FrameMessageSource",!0));l.extendProto(o,{init:c,addSourceSubscriber:e,removeSourceSubscriber:f,trigger:g,frameWindow:d,handleEvent:h}),b.exports=o},{"../c_class":15,"milo-core":106}],40:[function(a,b){"use strict";function c(a,b){u.defineProperties(this,{_rootEl:a,_hostObject:b},u.WRIT)}function d(a,b){if("string"==typeof b?a.name=b:b=a.name,this.hasOwnProperty(b))throw new Error("duplicate object name: "+b);l(b),f.call(this,a,b)}function e(a,b){"string"==typeof b?a.name=b:b=a.name;var c=this.hasOwnProperty(b);c?x.error("Scope: duplicate object name: "+b):(c=!y.test(b),c&&x.error("Scope: name should start from letter, this name is not allowed: "+b)),c&&(b=v(),a.name=b),f.call(this,a,b)}function f(a,b){this[b]=a,a.scope=this,"function"==typeof a.postMessage&&a.postMessage("addedtoscope")}function g(a){w(a,c),a._each(d,this)}function h(a,b){b._add(a),this._remove(a.name),a.scope=b}function i(a){a._each(function(b){this._add(b,b.name),a._remove(b.name)},this)}function j(a,b){u.eachKey(this,a,b||this,!0)}function k(a,b){return u.filterKeys(this,a,b||this,!0)}function l(a){if(!y.test(a))throw new Error("name should start from letter, this name is not allowed: "+a)}function m(){return Object.keys(this).length}function n(){var a=Object.keys(this)[0];return a&&this[a]}function o(a,b){if(!(a in this))return void(b||x.warn("removing object that is not in scope"));var c=this[a];delete this[a],"function"==typeof c.postMessage&&c.postMessage("removedfromscope")}function p(){this._each(function(a,b){delete this[b].scope,delete this[b]},this)}function q(){this._rootEl=null}function r(a){return this.hasOwnProperty(a.name)}function s(a,b,c){a.scope&&c!==!1?(a.scope._remove(a.name),a.scope._add(a,b)):a.name=b}var t=a("milo-core"),u=t.proto,v=a("../util/component_name"),w=t.util.check,x=(w.Match,t.util.logger);u.extendProto(c,{_add:d,_safeAdd:e,_copy:g,_each:j,_move:h,_merge:i,_length:m,_any:n,_remove:o,_clean:p,_detachElement:q,_has:r,_filter:k}),u.extend(c,{rename:s}),b.exports=c;var y=/^[A-Za-z][A-Za-z0-9\_\$]*$/},{"../util/component_name":76,"milo-core":106}],41:[function(a,b){"use strict";function c(a){this.el.disabled=a}function d(){return!!this.el.disabled}var e=a("../c_class"),f=a("../c_registry"),g=a("milo-core").proto,h=e.createComponentClass("MLButton",{events:void 0,dom:{cls:"ml-ui-button"}});f.add(h),b.exports=h,g.extendProto(h,{disable:c,isDisabled:d})},{"../c_class":15,"../c_registry":32,"milo-core":106}],42:[function(a,b){"use strict";function c(){k.prototype.init.apply(this,arguments),this.on("childrenbound",d)}function d(){m.defineProperties(this,{_comboInput:this.container.scope.input,_comboList:this.container.scope.datalist}),this._comboList.template.set(o),this._comboInput.data.on("input",{subscriber:i,context:this})}function e(){return this._comboInput?this._comboInput.data.get():void 0}function f(a){return h.call(this,"set",a)}function g(){return h.call(this,"del",value)}function h(a,b){if(this._comboInput){var c=this._comboInput.data[a](b);return i.call(this),c}}function i(){this.data.dispatchSourceMessage(n)}function j(){this._comboList.template.render({comboOptions:this.model.get()})}var k=a("../c_class"),l=a("../c_registry"),m=a("milo-core").proto,n="mlcombochange",o='{{~ it.comboOptions :option }} {{~}}',p=k.createComponentClass("MLCombo",{events:void 0,data:{get:e,set:f,del:g,splice:void 0,event:n},model:{messages:{"***":{subscriber:j,context:"owner"}}},dom:{cls:"ml-ui-datalist"},container:void 0});l.add(p),b.exports=p,m.extendProto(p,{init:c})},{"../c_class":15,"../c_registry":32,"milo-core":106}],43:[function(a,b){"use strict";function c(){r.prototype.init.apply(this,arguments),this._dataValidation=function(){},this.model.set([]),this.once("childrenbound",j)}function d(a){"function"==typeof a&&(this._dataValidation=a)}function e(a){this._combo.setOptions(a)}function f(){this._combo.clearComboInput()}function g(a){this._combo.toggleAddButton(a)}function h(a){this._combo.setAddItemPrompt(a)}function i(){r.prototype.destroy.apply(this,arguments),this._connector&&milo.minder.destroyConnector(this._connector),this._connector=null}function j(){this.template.render().binder(),k.call(this)}function k(){t.defineProperties(this,{_combo:this.container.scope.combo,_list:this.container.scope.list}),this._connector=milo.minder(this._list.model,"<<<->>>",this.model),this._combo.data.on("",{subscriber:l,context:this}),this._combo.on("additem",{subscriber:q,context:this})}function l(a,b){b.newValue&&this._dataValidation(a,b,this._list.model.get())&&this._list.model.push(b.newValue),this._combo.data.del(),this._combo.data._value=""}function m(){this.data.dispatchSourceMessage(u)}function n(){var a=this.model.get();return"object"==typeof a?t.clone(a):a}function o(a){this.model.set(a)}function p(){return this.model.set([])}function q(a,b){this.postMessage("additem",b),this.events.postMessage("milo_combolistadditem",b)}var r=a("../c_class"),s=a("../c_registry"),t=a("milo-core").proto,u="mlcombolistchange",v=r.createComponentClass("MLComboList",{dom:{cls:"ml-ui-combo-list"},data:{get:n,set:o,del:p,event:u},events:void 0,container:void 0,model:{messages:{"***":{subscriber:m,context:"owner"}}},template:{template:'
'}});s.add(v),b.exports=v,t.extendProto(v,{init:c,setOptions:e,setDataValidation:d,toggleAddButton:g,destroy:i,setAddItemPrompt:h,clearComboInput:f})},{"../c_class":15,"../c_registry":32,"milo-core":106}],44:[function(a,b){"use strict";function c(){return n.date(this.el.min)}function d(a){var b=n.toDate(a);this.el.min=b?k(b):""}function e(){return n.date(this.el.max)}function f(a){var b=n.toDate(a);this.el.max=b?k(b):""}function g(){return n.toDate(this.el.value)}function h(a){var b=n.toDate(a);this.el.value=b?k(b):"",j.call(this)}function i(){this.el.value="",j.call(this)}function j(){this.data.dispatchSourceMessage("input")}function k(a){function b(a){return 10>a?"0"+a:a}var c=[a.getFullYear(),b(a.getMonth()+1),b(a.getDate())],d=c.join("-");return d}var l=a("../c_class"),m=a("../c_registry"),n=a("milo-core").proto,o=l.createComponentClass("MLDate",{events:void 0,data:{get:g,set:h,del:i},dom:{cls:"ml-ui-date"}});n.extendProto(o,{getMin:c,setMin:d,getMax:e,setMax:f}),m.add(o),b.exports=o +},{"../c_class":15,"../c_registry":32,"milo-core":106}],45:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLDropTarget",["drop"]);d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],46:[function(a,b){"use strict";function c(a){a.classList.toggle("ml-ui-foldtree--unfold")}function d(a,b){var c=b.getAttribute("data-item-id"),d=this._itemsMap[c];this.postMessage("mlfoldtree_"+a,{item:d,el:b})}function e(a,b){var e=b.target;if(e.classList.contains("ml-ui-foldtree-button"))c(e.parentNode.parentNode);else{if(!e.classList.contains("ml-ui-foldtree-label"))return;d.call(this,a,e)}b.stopPropagation()}function f(a){this._itemTemplate=h.compile(a)}function g(a){function b(a){if(a.items)var d=_.map(a.items,function(a){var b=k();return c._itemsMap[b]=a,b});return n({itemIDs:d,data:a,itemTemplate:c._itemTemplate||m,treeTemplate:b})}var c=this;this._data=a,c._itemsMap={},this.el.innerHTML=b(a)}var h=a("milo-core").util.doT,i=a("../c_registry"),j=a("../c_class"),k=a("../../util/unique_id"),l='
    {{~ it.data.items :item:index }} {{ var hasSubTree = item.items && item.items.length; }}
  • {{? hasSubTree }}
    {{?}} {{= it.itemTemplate({ item: item, id: it.itemIDs[index] }) }}
    {{? hasSubTree }} {{= it.treeTemplate(item) }} {{?}}
  • {{~}}
',m=h.compile(' {{= it.item.label }} '),n=h.compile(l),o=j.createComponentClass("MLFoldTree",{container:void 0,events:{messages:{"click dblclick":{subscriber:e,context:"owner"}}},dom:{cls:"ml-ui-foldtree-main"}});i.add(o),b.exports=o,_.extendProto(o,{setItemTemplate:f,renderTree:g})},{"../../util/unique_id":92,"../c_class":15,"../c_registry":32,"milo-core":106}],47:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLGroup",{container:void 0,data:void 0,events:void 0,dom:{cls:"ml-ui-group"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],48:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLHyperlink",{events:void 0,data:void 0,dom:{cls:"ml-ui-hyperlink"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],49:[function(a,b){"use strict";function c(){i.prototype.init.apply(this,arguments)}function d(a){return this.model.set(a),a}function e(){var a=this.model.get();return a&&"object"==typeof a?k.clone(a):a}function f(){this.model.del()}function g(){this.data.dispatchSourceMessage(l)}function h(a,b){this.el.src=b.newValue,g.call(this)}var i=a("../c_class"),j=a("../c_registry"),k=a("milo-core").proto,l="mlimagechange",m=i.createComponentClass("MLImage",{data:{set:d,get:e,del:f,splice:void 0,event:l},model:{messages:{".src":{subscriber:h,context:"owner"}}},events:void 0,container:void 0,dom:{tagName:"img",cls:"ml-ui-image"}});j.add(m),b.exports=m,k.extendProto(m,{init:c})},{"../c_class":15,"../c_registry":32,"milo-core":106}],50:[function(a,b){"use strict";function c(a){this.el.disabled=a}function d(){return!!this.el.disabled}function e(a){this.el.setAttribute("maxlength",a)}var f=a("../c_class"),g=a("../c_registry"),h=a("milo-core").proto,i=f.createComponentClass("MLInput",{data:void 0,events:void 0,dom:{cls:"ml-ui-input"}});g.add(i),b.exports=i,h.extendProto(i,{disable:c,isDisabled:d,setMaxLength:e})},{"../c_class":15,"../c_registry":32,"milo-core":106}],51:[function(a,b){"use strict";function c(){p.prototype.init.apply(this,arguments),this.once("childrenbound",d),this.model.set([])}function d(){h.call(this)}function e(a){this._input.el.setAttribute("placeHolder",a)}function f(a){t=a||t}function g(){p.prototype.destroy.apply(this,arguments),this._connector&&milo.minder.destroyConnector(this._connector),this._connector=null}function h(){this.template.render().binder(),i.call(this)}function i(){r.defineProperties(this,{_input:this.container.scope.input,_button:this.container.scope.button,_list:this.container.scope.list}),this._connector=milo.minder(this._list.model,"<<<->>>",this.model),this._button.events.on("click",{subscriber:j,context:this})}function j(){var a=this._input.data.get(0);this._input.data&&t(a,function(a,b){this._list.model.push({label:a,value:b})}.bind(this)),this._input.data.del()}function k(){this.data.dispatchSourceMessage(s)}function l(){var a=this.model.get();return a?r.clone(a):void 0}function m(a){this.model.set(a)}function n(){return this.model.set([])}function o(){this.model.splice.apply(this.model,arguments)}var p=a("../c_class"),q=a("../c_registry"),r=a("milo-core").proto,s="mlinputlistchange",t=function(a,b){b(a)},u=p.createComponentClass("MLInputList",{dom:{cls:"ml-ui-input-list"},data:{get:l,set:m,del:n,splice:o,event:s},events:void 0,container:void 0,model:{messages:{"***":{subscriber:k,context:"owner"}}},template:{template:'
'}});q.add(u),b.exports=u,r.extendProto(u,{init:c,setAsync:f,setPlaceHolder:e,destroy:g})},{"../c_class":15,"../c_registry":32,"milo-core":106}],52:[function(a,b){"use strict";function c(){h.prototype.init.apply(this,arguments),this.on("childrenbound",g)}function d(){this._connector&&milo.minder.destroyConnector(this._connector),this._connector=null,h.prototype.destroy.apply(this,arguments)}function e(a){this.model.splice(a,1)}function f(a,b){var c=this.model.splice(a,1);return this.model.splice(b,0,c[0])}function g(){this.model.set([]),this._connector=milo.minder(this.model,"<<<-",this.data).deferChangeMode("<<<->>>")}var h=a("../c_class"),i=a("../c_registry"),j=a("milo-core").proto,k=h.createComponentClass("MLList",{dom:{cls:"ml-ui-list"},data:void 0,events:void 0,model:void 0,list:void 0});i.add(k),b.exports=k,j.extendProto(k,{init:c,destroy:d,removeItem:e,moveItem:f})},{"../c_class":15,"../c_registry":32,"milo-core":106}],53:[function(a,b){"use strict";function c(){q.prototype.init.apply(this,arguments),this.on("childrenbound",d)}function d(){var a=this.container.scope.deleteBtn;a&&a.events.on("click",{subscriber:this.removeItem,context:this})}function e(){try{var a=this.item.list.owner}catch(b){}a&&a.removeItem(this.item.index)}function f(a){var b=this.item.list.owner;b&&b.moveItem(this.item.index,a)}function g(a){return a.params&&a.params.index&&"MLListItem"==a.compClass}function h(){return this.isDropAllowed.apply(this,arguments)}function i(a,b){k.call(this);var c=new r(b),d=c.getComponentMeta(),e=c.getComponentState(),f=this.item.list.owner,g=d.params&&d.params.index;f.moveItem(+g,this.item.index,e)}function j(){this.dom.addCssClasses("ml-drag-over")}function k(){this.dom.removeCssClasses("ml-drag-over")}function l(){return{index:this.item.index}}function m(){var a=this.model.get();return null!==a&&"object"==typeof a?t.clone(a):a}function n(a){return"object"==typeof a&&this.data._set(a),this.model.set(a),p.call(this),a}function o(){this.data._del(),this.model.del(),p.call(this)}function p(){this.data.dispatchSourceMessage(u)}var q=a("../c_class"),r=a("../../util/dragdrop"),s=a("../c_registry"),t=a("milo-core").proto,u="mllistitemchange",v=q.createComponentClass("MLListItem",{container:void 0,dom:void 0,drag:{meta:{params:l}},drop:{messages:{dragenter:{subscriber:j,context:"owner"},dragover:{subscriber:j,context:"owner"},dragleave:{subscriber:k,context:"owner"},drop:{subscriber:i,context:"owner"}},allow:{components:h}},data:{get:m,set:n,del:o,event:u},model:void 0,item:void 0});s.add(v);var v=b.exports=v;t.extendProto(v,{init:c,moveItem:f,removeItem:e,isDropAllowed:g})},{"../../util/dragdrop":82,"../c_class":15,"../c_registry":32,"milo-core":106}],54:[function(a,b){"use strict";function c(){o.defineProperty(this,"_radioList",[],o.CONF),o.defineProperty(this,q,r+n()),this._renderOptions={},l.prototype.init.apply(this,arguments)}function d(a){this._renderOptions=a}function e(a){var b,c=this._radioList;return c.length?(c.forEach(function(c){c.checked=c.value==a,c.checked&&(b=a)}),i.call(this),b):void 0}function f(){var a=o.find(this._radioList,function(a){return a.checked});return a&&a.value||void 0}function g(){var a=this._radioList;return a.length&&a.forEach(function(a){a.checked=!1}),void i.call(this)}function h(a,b){"radio"==b.target.type&&i.call(this)}function i(){this.data.dispatchSourceMessage(p)}function j(){this.template.render({radioOptions:this.model.get(),elementName:this[q],_renderOptions:this._renderOptions});var a=this.el.querySelectorAll('input[type="radio"]'),b=o.toArray(a);this._radioList.length=0,this._radioList.splice.apply(this._radioList,[0,0].concat(b))}function k(){delete this._radioList,l.prototype.destroy.apply(this,arguments)}var l=a("../c_class"),m=a("../c_registry"),n=a("../../util/unique_id"),o=a("milo-core").proto,p="mlradiogroupchange",q="_mlRadioGroupElementID",r="ml-radio-group-",s=l.createComponentClass("MLRadioGroup",{data:{set:e,get:f,del:g,splice:void 0,event:p},model:{messages:{"***":{subscriber:j,context:"owner"}}},events:{messages:{click:{subscriber:h,context:"owner"}}},container:void 0,dom:{cls:"ml-ui-radio-group"},template:{template:'{{~ it.radioOptions :option }} {{##def.elID:{{= it.elementName }}-{{= option.value }}#}} {{~}}'}});m.add(s),b.exports=s,o.extendProto(s,{init:c,destroy:k,setRenderOptions:d})},{"../../util/unique_id":92,"../c_class":15,"../c_registry":32,"milo-core":106}],55:[function(a,b){"use strict";function c(a){var b={context:this,subscriber:e};this.model.off("**",b),this.model.set(a),this.model.on("**",b),e.call(this)}function d(a){this.el.disabled=a}function e(){this.template.render({selectOptions:this.model.get()})}var f=a("../c_class"),g=a("../c_registry"),h=a("milo-core").proto,i=f.createComponentClass("MLSelect",{dom:{cls:"ml-ui-select"},data:void 0,events:void 0,model:{messages:{"**":{subscriber:e,context:"owner"}}},template:{template:'{{~ it.selectOptions :option }} {{~}}'}});g.add(i),b.exports=i,h.extendProto(i,{setOptions:c,disable:d})},{"../c_class":15,"../c_registry":32,"milo-core":106}],56:[function(a,b){"use strict";function c(){K.prototype.init.apply(this,arguments),this.once("childrenbound",d),N.defineProperties(this,{_optionsData:[],_filteredOptionsData:[]},N.WRIT)}function d(){this.template.render().binder(),e.call(this)}function e(){var a=this.container.scope;N.defineProperties(this,{_comboInput:a.input,_comboList:a.list,_comboOptions:a.options,_comboBefore:a.before,_comboAfter:a.after,_comboAddItemDiv:a.addItemDiv,_comboAddPrompt:a.addPrompt,_comboAddBtn:a.addBtn,_optionTemplate:O.compile(S)}),N.defineProperties(this,{_startIndex:0,_endIndex:T,_hidden:!1,_elementHeight:V,_total:0,_optionsHeight:200,_lastScrollPos:0,_currentValue:null,_selected:null,_isAddButtonShown:!1},N.WRIT),this.dom.setStyles({position:"relative"}),p(this._comboList,this._comboOptions,this),q(this._comboInput,this),r(this._comboAddBtn,this),this.events.on("keydown",{subscriber:y,context:this})}function f(a){this._hidden=!a,this._comboList.dom.toggle(a)}function g(){this._hidden=!1,this.el.classList.add(Q),this._comboList.dom.toggle(!0)}function h(){this._hidden=!0,this.el.classList.remove(Q),this._comboList.dom.toggle(!1)}function i(a,b){this._comboAddItemDiv.dom.toggle(a),b&&b.preserveState&&(this.__showAddOnClick=this._isAddButtonShown),this._isAddButtonShown=a}function j(a){this._addItemPrompt=a,this._comboAddPrompt.el.innerHTML=a,this.toggleAddButton(!1)}function k(a){this._optionsData=a,this.setFilteredOptions(a)}function l(a){this._optionsURL=a.url,this._formatOptionsURL=a.formatOptions||function(a){return a}}function m(a){var b=this._optionsURL,c=this._comboInput.data.get();a=a||N.noop,milo.util.request.post(b,{name:c},function(b,d){if(b)return P.error('Can not search for "'+c+'"'),a(new Error("Request error"));var e=N.jsonParse(d);e?a(null,e):a(new Error("Data error"))})}function n(a){return a?(this._filteredOptionsData=a,this._total=a.length,void this.update()):P.error("setFilteredOptions: parameter is undefined")}function o(){var a=this._hidden,b=this._filteredOptionsData.slice(this._startIndex,this._endIndex);this._comboOptions.template.render({comboOptions:b}),this._elementHeight=this._elementHeight||V,a&&this.hideOptions();var c=this._startIndex*this._elementHeight,d=(this._total-this._endIndex)*this._elementHeight;this._comboBefore.el.style.height=c+"px",this._comboAfter.el.style.height=d>0?d+"px":"0px"}function p(a,b,c){c.toggleAddButton(!1),b.template.set(S),a.dom.setStyles({overflow:"scroll",height:c._optionsHeight+"px",width:"100%",position:"absolute",zIndex:10}),c.hideOptions(),a.events.onMessages({click:{subscriber:G,context:c},scroll:{subscriber:H,context:c}})}function q(a,b){a.events.once("focus",function(){a.data.on("",{subscriber:v,context:b}),a.events.on("click",{subscriber:D,context:b}),a.events.on("keydown",{subscriber:E,context:b})})}function r(a,b){a.events.on("click",{subscriber:F,context:b})}function s(){return this._currentValue}function t(a){this._currentValue=a,this._comboInput.data.set(a&&a.label),N.deferMethod(this,"hideOptions")}function u(){this._currentValue=null,this._comboInput.data.set("")}function v(a,b){var c=b.newValue&&b.newValue.trim();if(this._optionsURL){var d=this;m.call(this,function(a,b){if(!a&&b)try{var e=b.data.map(d._formatOptionsURL);d.setOptions(e),x.call(d,c,d._optionsData)}catch(f){P.error("Data error",f)}})}else{var e=w.call(this,c);x.call(this,c,e)}}function w(a){return this._optionsData.filter(function(b){if(delete b.selected,b.label){var c=b.label.toLowerCase();return 0==c.trim().toLowerCase().indexOf(a.toLowerCase())}})}function x(a,b){function c(b){return b.label.toLowerCase()===a.toLowerCase()}a?(b.length&&N.find(b,c)?this.toggleAddButton(!1,{preserveState:!0}):this._addItemPrompt&&this.toggleAddButton(this._optionsData.length>1||this._optionsURL),b.length?(this.showOptions(),b[0].selected=!0,this._selected=b[0]):this.hideOptions()):this.toggleAddButton(!1,{preserveState:!0}),this.setFilteredOptions(b),this._comboList.el.scrollTop=0}function y(a,b){var c=X[b.keyCode];c&&z.call(this,c)}function z(a){var b=this.el.querySelectorAll(".selected")[0],c=this._comboList.el.scrollTop,d=b?b.offsetTop:0,e=d-c;if(b){var f=I.call(this,b),g=this._filteredOptionsData[f],h=this._filteredOptionsData[f+a];h&&(delete g.selected,h.selected=!0,this._selected=h,this.update())}else this._filteredOptionsData[0]&&(this._filteredOptionsData[0].selected=!0,this.update());e>this._optionsHeight-2*this._elementHeight&&1===a&&(this._comboList.el.scrollTop+=this._elementHeight*a*5),ethis._lastScrollPos?"down":"up",e=this._comboOptions.el.lastElementChild,f=this._comboOptions.el.firstElementChild,g=e?e.offsetTop:0,h=f?f.offsetTop:0,i=g-c-this._optionsHeight+this._elementHeight,j=c-h,k=Math.floor(j/this._elementHeight),l=Math.floor(i/this._elementHeight),m=Math.floor(c/this._elementHeight)-U;("down"==d&&U>l||"up"==d&&U>k)&&(this._startIndex=m>0?m:0,this._endIndex=m+T,this._elementHeight=e.style.height,this.update()),this._lastScrollPos=c}function I(a){return Number(a.getAttribute("data-value"))+this._startIndex}function J(){delete this._selected.selected,this.hideOptions(),this.toggleAddButton(!1),this._comboInput.data.off("",{subscriber:v,context:this}),this.data.set(this._selected),this.data.dispatchSourceMessage(R),this._comboInput.data.on("",{subscriber:v,context:this}),this._selected=null,this.setFilteredOptions(this._optionsData)}var K=a("../c_class"),L=a("../c_registry"),M=a("milo-core"),N=M.proto,O=M.util.doT,P=M.util.logger,Q="ml-ui-supercombo-open",R="mlsupercombochange",S='{{~ it.comboOptions :option:index }}
{{= option.label }}
{{~}}',T=100,U=25,V=20,W=K.createComponentClass("MLSuperCombo",{events:{messages:{mouseleave:{subscriber:B,context:"owner"},mouseover:{subscriber:A,context:"owner"}}},data:{get:s,set:t,del:u,splice:void 0,event:R},dom:{cls:"ml-ui-supercombo"},template:{template:'
'},container:void 0});L.add(W),b.exports=W,N.extendProto(W,{init:c,showOptions:g,hideOptions:h,toggleOptions:f,setOptions:k,initOptionsURL:l,setFilteredOptions:n,update:o,toggleAddButton:i,setAddItemPrompt:j,clearComboInput:u});var X={40:1,38:-1}},{"../c_class":15,"../c_registry":32,"milo-core":106}],57:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLText",{data:void 0,events:void 0,dom:{cls:"ml-ui-text"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],58:[function(a,b){"use strict";function c(a){return this._autoresize?m.warn("MLTextarea startAutoresize: autoresize is already on"):(this._autoresize=!0,this._autoresizeOptions=a,e.call(this),void d.call(this,"on"))}function d(a){this.events[a]("click",{subscriber:e,context:this}),this.data[a]("",{subscriber:e,context:this})}function e(){this.el.style.height=0;var a=this.el.scrollHeight,b=this._autoresizeOptions.minHeight,c=this._autoresizeOptions.maxHeight;a=a>=c?c:b>=a?b:a,this.el.style.height=a+"px"}function f(){return this._autoresize?(this._autoresize=!1,void d.call(this,"off")):m.warn("MLTextarea stopAutoresize: autoresize is not on")}function g(){return this._autoresize}function h(a){this.el.disabled=a}var i=a("../c_class"),j=a("../c_registry"),k=a("milo-core"),l=k.proto,m=k.util.logger,n=i.createComponentClass("MLTextarea",{data:void 0,events:void 0,dom:{cls:"ml-ui-textarea"}});j.add(n),b.exports=n;l.extendProto(n,{startAutoresize:c,stopAutoresize:f,isAutoresized:g,disable:h})},{"../c_class":15,"../c_registry":32,"milo-core":106}],59:[function(a,b){"use strict";function c(){var a=this.el.value,b=a.match(j);if(b){var c=b[1],d=b[2];if(!(c>23||d>59)){var e=new Date(1970,0,1,c,d);return h.toDate(e)}}}function d(a){function b(a){return 10>a?"0"+a:a}var c=h.toDate(a);if(!c)return void(this.el.value="");var d=k.replace("hh",b(c.getHours())).replace("mm",b(c.getMinutes()));return this.el.value=d,d}function e(){this.el.value=""}var f=a("../c_class"),g=a("../c_registry"),h=a("milo-core").proto,i=f.createComponentClass("MLTime",{events:void 0,data:{get:c,set:d,del:e},dom:{cls:"ml-ui-time"}});g.add(i),b.exports=i;var j=/^([0-9]{1,2})(?:\:|\.)([0-9]{1,2})$/,k="hh:mm"},{"../c_class":15,"../c_registry":32,"milo-core":106}],60:[function(a,b){"use strict";var c=a("../c_class"),d=a("../c_registry"),e=c.createComponentClass("MLWrapper",{container:void 0,data:void 0,events:void 0,dom:{cls:"ml-ui-wrapper"}});d.add(e),b.exports=e},{"../c_class":15,"../c_registry":32}],61:[function(a,b){"use strict";function c(a){m(a,{message:String,type:n.Optional(String),close:n.Optional(Boolean),timeout:n.Optional(Number)});var b=q.createOnElement();a=f(a);var c=p[a.type];b.dom.addCssClasses(c),b._alert={options:a,visible:!1},b.template.render(a).binder();var d=b.container.scope;if(a.close&&d.closeBtn.events.on("click",{subscriber:e,context:b}),a.timeout){setTimeout(function(){b._alert.visible&&b.closeAlert()},a.timeout)}return b}function d(a){var b=q.createAlert(a);return b.openAlert(),b}function e(){this.closeAlert()}function f(a){return a=o.clone(a),a.close="undefined"==typeof a.close||a.close===!0,a.timeout=Math.floor(a.timeout),a.type=a.type||"info",a}function g(){i.call(this,!0)}function h(){i.call(this,!1),this.destroy()}function i(a){a="undefined"==typeof a?!this._alert.visible:!!a;var b=a?"add":"remove",c=a?"appendChild":"removeChild";this._alert.visible=a,document.body[c](this.el),this.dom.toggle(a),this.el.setAttribute("aria-hidden",!a),this.el.classList[b]("in"),this.el[a?"focus":"blur"]()}var j=a("../../c_class"),k=a("../../c_registry"),l=(a("../../../util/component_name"),a("milo-core")),m=(l.util.logger,l.util.check),n=m.Match,o=l.proto,p={success:"alert-success",warning:"alert-warning",info:"alert-info",danger:"alert-danger",fixed:"alert-fixed"},q=j.createComponentClass("MLAlert",{container:void 0,events:void 0,dom:{cls:["ml-bs-alert","alert","fade"],attributes:{role:"alert","aria-hidden":"true"}},template:{template:' {{? it.close }} {{?}} {{= it.message}}'}});k.add(q),b.exports=q,o.extend(q,{createAlert:c,openAlert:d}),o.extendProto(q,{openAlert:g,closeAlert:h})},{"../../../util/component_name":76,"../../c_class":15,"../../c_registry":32,"milo-core":106}],62:[function(a,b){"use strict";function c(a,b){v(a,{title:w.Optional(String),html:w.Optional(String),text:w.Optional(String),close:w.Optional(w.OneOf(Boolean,{backdrop:w.Optional(Boolean),keyboard:w.Optional(Boolean),button:w.Optional(Boolean)})),buttons:w.Optional([{name:w.Optional(String),type:String,label:String,close:w.Optional(Boolean),result:w.Optional(String),data:w.Optional(w.Any),cls:w.Optional(String)}]),cssClass:w.Optional(String)});var c=A.createOnElement();a=i(a),c._dialog={options:a,visible:!1},c.template.render(a).binder();var e=c.container.scope;return a.close.backdrop&&c.events.on("click",{subscriber:f,context:c}),a.title&&a.close.button&&e.closeBtn.events.on("click",{subscriber:g,context:c}),a.buttons.forEach(function(a){var b={subscriber:x.partial(d,a),context:c};e[a.name].events.on("click",b)}),b&&b(c),c}function d(a){a.close!==!1&&k.call(this,!1);var b=x.result(a.data,this,a);e.call(this,a.result,b)}function e(a,b){var c=this._dialog.subscriber;"function"==typeof c?c.call(this,a,b):c.subscriber.call(c.context,a,b)}function f(a,b){b.target==this.el&&this.closeDialog("dismissed")}function g(){this.closeDialog("closed")}function h(a){D&&D._dialog.options.close.keyboard&&27==a.keyCode&&D.closeDialog("dismissed")}function i(a){return a=x.clone(a),a.buttons=x.clone(a.buttons||y),a.buttons.forEach(function(a){a.name=a.name||s()}),a.close="undefined"==typeof a.close||a.close===!0?x.object(z,!0):"object"==typeof a.close?x.mapToObject(z,function(b){return a.close[b]!==!1}):x.object(z,!1),a}function j(a,b,c){var d=A.createDialog(a,c);return d.openDialog(b),d}function k(a){a="undefined"==typeof a?!this._dialog.visible:!!a;var b=a?"add":"remove",c=a?"appendChild":"removeChild";this._dialog.visible=a,a&&!B&&l(),document.body[c](this.el),C&&document.body[c](C),this.dom.toggle(a),this.el.setAttribute("aria-hidden",!a),document.body.classList[b]("modal-open"),this.el.classList[b]("in"),D=a?this:void 0,this.el[a?"focus":"blur"]()}function l(){C=document.createElement("div"),C.className="modal-backdrop fade in",document.addEventListener("keydown",h),B=!0}function m(a){return v(a,w.OneOf(Function,{subscriber:Function,context:w.Any})),D?u.warn("MLDialog openDialog: can't open dialog, another dialog is already open"):(this._dialog.subscriber=a,void k.call(this,!0))}function n(a,b){return D?(a=a||"closed",k.call(this,!1),void e.call(this,a,b)):u.warn("MLDialog closeDialog: can't close dialog, no dialog open")}function o(){return D}function p(){document.removeEventListener("keydown",h),q.prototype.destroy.apply(this,arguments)}var q=a("../../c_class"),r=a("../../c_registry"),s=a("../../../util/component_name"),t=a("milo-core"),u=t.util.logger,v=t.util.check,w=v.Match,x=t.proto,y=[{type:"default",label:"OK",result:"OK"}],z=["backdrop","keyboard","button"],A=q.createComponentClass("MLDialog",{container:void 0,events:void 0,dom:{cls:["ml-bs-dialog","modal","fade"],attributes:{role:"dialog","aria-hidden":"true"}},template:{template:' '}});r.add(A),b.exports=A,x.extend(A,{createDialog:c,openDialog:j,getOpenedDialog:o}),x.extendProto(A,{openDialog:m,closeDialog:n,destroy:p});var B,C,D},{"../../../util/component_name":76,"../../c_class":15,"../../c_registry":32,"milo-core":106}],63:[function(a,b){"use strict";function c(){function a(a){var c=a.target,e=a.relatedTarget,f=i._dropdown.listeners;d(c)&&f.remove(c.contentWindow.document,"click",b),d(e)&&f.add(e.contentWindow.document,"click",b)}function b(a){i.el.contains(a.target)||i.hideMenu()}var c=this.el.querySelector("."+o),e=this.el.querySelector("."+p);if(!c||!e)return m.error("MLDropdown:",o,"or",p,"isn't found");var f=window.document,g=this.toggleMenu.bind(this,void 0),h=new n;this._dropdown={menu:e,visible:!1,listeners:h},this.hideMenu();var i=this;h.add(c,"click",g),h.add(f,"mouseout",a),h.add(f,"click",b)}function d(a){return a&&"IFRAME"==a.tagName}function e(){this._dropdown.listeners.removeAll(),delete this._dropdown,i.prototype.destroy.apply(this,arguments)}function f(){this.toggleMenu(!0)}function g(){this.toggleMenu(!1)}function h(a){a="undefined"==typeof a?!this._dropdown.visible:!!a,this._dropdown.visible=a;var b=this._dropdown.menu;b.style.display=a?"block":"none"}var i=a("../../c_class"),j=a("../../c_registry"),k=a("milo-core"),l=k.proto,m=k.util.logger,n=a("../../../util/dom_listeners"),o="dropdown-toggle",p="dropdown-menu",q=i.createComponentClass("MLDropdown",{events:void 0,dom:{cls:["ml-bs-dropdown","dropdown"]}});j.add(q),b.exports=q,l.extendProto(q,{start:c,destroy:e,toggleMenu:h,showMenu:f,hideMenu:g})},{"../../../util/dom_listeners":80,"../../c_class":15,"../../c_registry":32,"milo-core":106}],64:[function(a,b){"use strict";var c=a("milo-core"),d=(c.proto,c.util.doT),e=b.exports=c.config;e({attrs:{bind:"ml-bind",load:"ml-load"},componentRef:"___milo_component",componentPrefix:"milo_",template:{compile:d.compile},domStorage:{typeSuffix:":___milo_data_type",prefixSeparator:"/",root:"",messageKey:"___milo_message/",messageTimestamp:"___milo_timestamp",quotaExceeded:{throwError:!0,message:!1}},dragDrop:{dataTypes:{component:"x-application/milo/component",componentMetaTemplate:"x-application/milo/component-meta/%class/%name/%params",componentMetaRegex:/^x\-application\/milo\/component\-meta\/([a-z0-9]+)\/([a-z0-9]+)\/([a-z0-9]*)$/}},request:{jsonpTimeout:6e4,jsonpCallbackPrefix:"___milo_callback_",optionsKey:"___milo_options",defaults:{timeout:6e4}},websocket:{rpc:{timeout:15e3,responsePrefix:"response_"}},deprecationWarning:"once"})},{"milo-core":106}],65:[function(a,b){"use strict";function c(a,b,c){milo(function(){d(a,b,c)})}function d(a,b,c){"function"==typeof a&&(c=a,a=void 0,b=!1),"function"==typeof b&&(c=b,b=!1),a=a||document.body,g.postMessage("loader",{state:"started"}),e(a,b,function(a){g.postMessage("loader",{state:"finished",views:a}),c(a)})}function e(a,b,c){var d=a.getAttribute(l.attrs.load)?[a]:a.querySelectorAll("["+l.attrs.load+"]"),e={},g=d.length,h=0;j.forEach(d,function(a){f(a,b,function(b){e[a.id]=b||a,h++,h==g&&c(e)})})}function f(a,b,c){if(k.children(a).length)throw new Error("can't load html into element that is not empty");var d=new m(a);d.parse().validate(),h.get(d.loadUrl,function(e,f){return e?(e.message=e.message||"can't load file "+d.loadUrl,void c(e)):(a.innerHTML=f,b&&m.remove(a),void c(null))})}var g=a("./services/mail"),h=a("./util/request"),i=a("milo-core"),j=(i.util.logger,i.proto),k=a("./util/dom"),l=a("./config"),m=a("./attributes/a_load");b.exports=c},{"./attributes/a_load":6,"./config":64,"./services/mail":70,"./util/dom":79,"./util/request":87,"milo-core":106}],66:[function(a,b){"use strict";function c(a){c.util.domReady(a)}function d(){e.destroy(),c.mail.destroy(),c.window.destroy(),c.util.destroy()}var e=a("milo-core"),f=e.proto;a("./use_facets"),a("./use_components"),f.extend(c,{Messenger:e.Messenger,Model:e.Model,minder:e.minder,loader:a("./loader"),binder:a("./binder"),mail:a("./services/mail"),window:a("./services/window"),config:a("./config"),util:a("./util"),classes:a("./classes"),attributes:a("./attributes"),ComponentFacet:a("./components/c_facet"),Component:a("./components/c_class"),Command:a("./command"),registry:a("./registry"),milo_version:"0.2.2",createComponentClass:a("./util/create_component_class"),destroy:d}),"object"==typeof b&&b.exports&&(b.exports=c),"object"==typeof window&&(window.milo=c,c.mail.trigger("miloready")) },{"./attributes":7,"./binder":8,"./classes":9,"./command":12,"./components/c_class":15,"./components/c_facet":16,"./config":64,"./loader":65,"./registry":67,"./services/mail":70,"./services/window":73,"./use_components":74,"./use_facets":75,"./util":85,"./util/create_component_class":77,"milo-core":106}],67:[function(a,b){"use strict";b.exports={facets:a("./components/c_facets/cf_registry"),components:a("./components/c_registry"),commands:a("./command/cmd_registry")}},{"./command/cmd_registry":11,"./components/c_facets/cf_registry":30,"./components/c_registry":32}],68:[function(a,b){"use strict";var c=a("milo-core").proto,d={ClipboardEvent:["copy","cut","paste","beforecopy","beforecut","beforepaste"],Event:["input","readystatechange"],FocusEvent:["focus","blur","focusin","focusout"],KeyboardEvent:["keydown","keypress","keyup"],MouseEvent:["click","contextmenu","dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","mouseout","mouseover","show"],TouchEvent:["touchstart","touchend","touchmove","touchenter","touchleave","touchcancel"]};if("undefined"!=typeof window)var e=window;else e={},c.eachKey(d,function(a,b){var d=c.makeFunction(b,"type","properties","this.type = type; _.extend(this, properties);");e[b]=d});var f={};c.eachKey(d,function(a,b){a.forEach(function(a){if(Object.hasOwnProperty(f,a))throw new Error("duplicate event type "+a);f[a]=e[b]})}),b.exports=f},{"milo-core":106}],69:[function(a,b){"use strict";function c(a,b,c,d){this.eventEmitter=d,k.prototype.init.apply(this,arguments)}function d(){k.prototype.destroy.apply(this,arguments),delete this.eventEmitter}function e(){return this.eventEmitter}function f(a,b){if(b&&"string"==typeof b){var c=q.test(b);b=b.replace(q,""),this.emitter()[a](b,this,c)}}function g(a){var b;"undefined"!=typeof window&&(b=a.eventPhase==window.Event.CAPTURING_PHASE),b&&(a+=r),this.dispatchMessage(a.type,a)}function h(a,b){this.messenger.postMessageSync(a,b)}function i(a,b){n(a,String),n(b,o.Optional(Object)),a=a.replace(q,"");var c=l[a];if("function"!=typeof c)throw new Error("unsupported event type");"undefined"!=typeof b&&(b.type=a);var d=new c(a,b),e=this.emitter().dispatchEvent(d);return e}var j=a("milo-core"),k=j.classes.MessageSource,l=(a("../components/c_class"),a("./de_constrs")),m=j.proto,n=j.util.check,o=n.Match,p=m.createSubclass(k,"DOMEmitterSource",!0);m.extendProto(p,{init:c,destroy:d,addSourceSubscriber:m.partial(f,"addEventListener"),removeSourceSubscriber:m.partial(f,"removeEventListener"),postMessage:h,trigger:i,emitter:e,handleEvent:g}),b.exports=p;var q=/__capture$/,r="__capture"},{"../components/c_class":15,"./de_constrs":68,"milo-core":106}],70:[function(a,b){"use strict";var c=a("milo-core"),d=c.Messenger,e=a("./mail_api"),f=a("./mail_source"),g=(c.proto,new d),h=new f(g,{trigger:"trigger"},new e);g._setMessageSource(h),b.exports=g},{"./mail_api":71,"./mail_source":72,"milo-core":106}],71:[function(a,b){"use strict";function c(a){return"domready"==a?"readystatechange":j.test(a)?"message":void 0}function d(a,b,c){return"readystatechange"==a?!0:"message"==a?k+c.data.type==b:void 0}var e=a("milo-core"),f=e.classes.MessengerAPI,g=e.proto,h=e.util.check,i=(h.Match,g.createSubclass(f,"MailMsgAPI",!0));g.extendProto(i,{translateToSourceMessage:c,filterSourceMessage:d}),b.exports=i;var j=/^message\:/,k="message:"},{"milo-core":106}],72:[function(a,b){"use strict";function c(a){if(e(a))if("loading"==document.readyState)document.addEventListener("readystatechange",this,!1);else{var b=l.readystatechange,c=new b("readystatechange",{target:document});this.dispatchMessage("readystatechange",c)}else this._windowSubscriberMethod("addEventListener",a)}function d(a){e(a)?document.removeEventListener("readystatechange",this,!1):this._windowSubscriberMethod("removeEventListener",a)}function e(a){return"readystatechange"==a&&"object"==typeof document}function f(a){return"message"==a&&"object"==typeof window}function g(a,b){f(b)&&window[a]("message",this,!1)}function h(a){this.dispatchMessage(a.type,a)}function i(a,b){b=b||{},b.type="message:"+a,"object"==typeof window&&window.postMessage(b,"*")}var j=a("milo-core"),k=j.classes.MessageSource,l=a("../de_constrs"),m=j.proto,n=j.util.check,o=(n.Match,m.createSubclass(k,"MailMessageSource",!0));m.extendProto(o,{addSourceSubscriber:c,removeSourceSubscriber:d,trigger:i,_windowSubscriberMethod:g,handleEvent:h}),b.exports=o},{"../de_constrs":68,"milo-core":106}],73:[function(a,b){"use strict";function c(){return window.top==window.self||window.__karma__}var d=a("milo-core"),e=d.Messenger,f=a("./dom_source"),g=d.proto,h=new e,i=new f(h,{trigger:"trigger"},void 0,window);h._setMessageSource(i),b.exports=h,g.extend(h,{isTop:c})},{"./dom_source":69,"milo-core":106}],74:[function(a){"use strict";a("./components/classes/View"),a("./components/ui/Group"),a("./components/ui/Wrapper"),a("./components/ui/Text"),a("./components/ui/Select"),a("./components/ui/Input"),a("./components/ui/InputList"),a("./components/ui/Textarea"),a("./components/ui/RadioGroup"),a("./components/ui/Button"),a("./components/ui/Hyperlink"),a("./components/ui/List"),a("./components/ui/ListItem"),a("./components/ui/Time"),a("./components/ui/Date"),a("./components/ui/Combo"),a("./components/ui/SuperCombo"),a("./components/ui/ComboList"),a("./components/ui/Image"),a("./components/ui/DropTarget"),a("./components/ui/FoldTree"),a("./components/ui/bootstrap/Dropdown")},{"./components/classes/View":34,"./components/ui/Button":41,"./components/ui/Combo":42,"./components/ui/ComboList":43,"./components/ui/Date":44,"./components/ui/DropTarget":45,"./components/ui/FoldTree":46,"./components/ui/Group":47,"./components/ui/Hyperlink":48,"./components/ui/Image":49,"./components/ui/Input":50,"./components/ui/InputList":51,"./components/ui/List":52,"./components/ui/ListItem":53,"./components/ui/RadioGroup":54,"./components/ui/Select":55,"./components/ui/SuperCombo":56,"./components/ui/Text":57,"./components/ui/Textarea":58,"./components/ui/Time":59,"./components/ui/Wrapper":60,"./components/ui/bootstrap/Dropdown":63}],75:[function(a){"use strict";a("./components/c_facets/Dom"),a("./components/c_facets/Data"),a("./components/c_facets/Frame"),a("./components/c_facets/Events"),a("./components/c_facets/Options"),a("./components/c_facets/Template"),a("./components/c_facets/Container"),a("./components/c_facets/ModelFacet"),a("./components/c_facets/Drag"),a("./components/c_facets/Drop"),a("./components/c_facets/List"),a("./components/c_facets/Item"),a("./components/c_facets/Transfer")},{"./components/c_facets/Container":17,"./components/c_facets/Data":18,"./components/c_facets/Dom":19,"./components/c_facets/Drag":20,"./components/c_facets/Drop":21,"./components/c_facets/Events":22,"./components/c_facets/Frame":23,"./components/c_facets/Item":24,"./components/c_facets/List":25,"./components/c_facets/ModelFacet":26,"./components/c_facets/Options":27,"./components/c_facets/Template":28,"./components/c_facets/Transfer":29}],76:[function(a,b){"use strict";function c(){return f+d()}var d=a("./unique_id"),e=a("../config"),f=e.componentPrefix;b.exports=c},{"../config":64,"./unique_id":92}],77:[function(a,b){"use strict";function c(a){f(a,{superClassName:g.Optional(String),className:String,facets:g.Optional(Object),methods:g.Optional(g.ObjectHash(Function)),staticMethods:g.Optional(g.ObjectHash(Function))});var b=h.get(a.superClassName||"Component"),c=b.createComponentClass(a.className,a.facets);if(a.methods&&e.extendProto(c,a.methods),a.staticMethods){if(void 0!==a.staticMethods["super"])throw"'super' is a reserved keyword";e.extend(c,a.staticMethods)}return c["super"]=b.prototype,h.add(c),c}var d=a("milo-core"),e=d.proto,f=d.util.check,g=f.Match,h=a("../components/c_registry");b.exports=c},{"../components/c_registry":32,"milo-core":106}],78:[function(a,b){"use strict";var c=a("milo-core"),d=c.proto,e=c.util.logger,f=a("../config");b.exports=function g(a,b){function c(){return!f.deprecationWarning||h&&"always"!=f.deprecationWarning||(e.error(b||"Function "+a.name+" is DEPRECATED"),h=!0),a.apply(this,arguments)}var h;switch(typeof a){case"object":return d.mapKeys(a,function(a){return g(a,b)});case"function":for(var i in a)c[i]=g(a[i],b);return c;default:return a}}},{"../config":64,"milo-core":106}],79:[function(a,b){"use strict";function c(a){return d(a.childNodes,Node.ELEMENT_NODE)}function d(a,b){return N.filter(a,function(a){return a.nodeType==b})}function e(a){for(;a;){if(a.nodeType==Node.ELEMENT_NODE)return a;a=a.parentNode}return null}function f(a){var b=a.ownerDocument;if(!b)return O.error("selectElementContents: element has no document");var c=b.createRange();c.selectNodeContents(a);var d=F(a),e=d.getSelection();e.removeAllRanges(),e.addRange(c)}function g(a){var b=p(a),c=q(a);b&&c&&k(b,0,c,c.textContent.length)}function h(a,b){var c=a.ownerDocument;if(!c)return O.error("setCaretPosition: element has no document");var d=c.createRange();d.setStart(a,b);var e=F(a),f=e.getSelection();f.removeAllRanges(),f.addRange(d)}function i(a){return j(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset)}function j(a,b,c,d){var e=a.compareDocumentPosition(c);return e&Node.DOCUMENT_POSITION_FOLLOWING?1:e&Node.DOCUMENT_POSITION_PRECEDING?-1:a==c?d>b?1:b>d?-1:0:void 0}function k(a,b,c,d){var e=a.ownerDocument;if(!e)return O("setCaretPosition: element has no document");var f,g,h=-1==j(a,b,c,d),i=e.createRange(),k=F(a),l=k.getSelection();h?(i.setStart(c,d),i.setEnd(a,b),i.collapse(!1)):(i.setStart(a,b),i.setEnd(c,d)),f=i.commonAncestorContainer==Node.ELEMENT_NODE?i.commonAncestorContainer:i.commonAncestorContainer.parentElement,f.isContentEditable||(g=f.contentEditable,f.contentEditable="true"),l.removeAllRanges(),l.addRange(i),h&&l.extend(c,d),g&&(f.contentEditable=g)}function l(a){a=a||window;var b=a.getSelection();b.removeAllRanges()}function m(a,b){var c,d;for(c=a.offsetTop,d=a.offsetLeft,a=a.offsetParent;a;)c+=a.offsetTop+n(a,"Height",b),d+=a.offsetLeft+n(a,"Width",b),a=a.offsetParent;return{topOffset:c,leftOffset:d}}function n(a,b,c){if(c){var d="Height"==b?"top":"left",e=window.getComputedStyle(a),f=parseInt(e.getPropertyValue("border-"+d+"-width"),10);if(f)return f}return 0}function o(a){var b=a.parentNode;b&&(b.removeChild(a),b.normalize())}function p(a){if(a.nodeType==Node.TEXT_NODE)return a;var b=E(a,NodeFilter.SHOW_TEXT);return b.firstChild()}function q(a){if(a.nodeType==Node.TEXT_NODE)return a;var b=E(a,NodeFilter.SHOW_TEXT);return b.lastChild()}function r(a){var b=a.parentNode;if(b){var c=document.createDocumentFragment(),d=N.slice(a.childNodes);d.forEach(c.appendChild,c),b.replaceChild(c,a),b.normalize()}}function s(a,b){var c=b.parentNode;c&&(c.insertBefore(a,b),a.appendChild(b))}function t(a){return v(a,"trimRight")}function u(a){return v(a,"trimLeft")}function v(a,b){var c=a.length;return a.textContent=a.textContent[b](),c!==a.length}function w(a){delete a[L.componentRef]}function x(a){var b=document.createElement("DIV");return b.innerHTML=a,b.textContent||""}function y(a,b,c,d){for(var e=document.createTreeWalker(a,b);e.nextNode();){var f=c.call(d||a,e.currentNode);if(f===!1)break}}function z(a,b){function c(a){return a.contains(b)}if(a&&a.contains(b)){for(var d=[],e=a;e!=b;){var f=N.findIndex(e.childNodes,c);d.push(f),e=e.childNodes[f]}return d}}function A(a,b,c){if(b){var d=b.length;if(0===d)return a;for(var e=a,f=0;d>f;f++){var g=e.childNodes;if(!g){c||(e=void 0);break}var h=b[f],i=g[h];if(!i){e=c?g[g.length-1]:void 0;break}e=i}return e}}function B(a,b,c,d){var e=c.nodeType==Node.TEXT_NODE;if(a.contains(c)&&o(c),0!=b.length){var f=A(a,b.slice(0,-1),d),g=f.childNodes;if(!g){if(!d)return;f=f.parentNode,g=f.childNodes}var h=b[b.length-1],i=g[h];return i?(f.insertBefore(c,i),e&&f.normalize(),!0):0!==g.length||0!==h&&!d?(i=g[h-1],i||d?(f.appendChild(c),e&&f.normalize(),!0):void 0):(f.appendChild(c),e&&f.normalize(),!0)}}function C(a,b){var c,d=0;if(!Array.isArray(a)&&Array.isArray(b))return O.error("isTreePathBefore: One or both paths are not valid treepath arrays.");for(d;db[d]){c=!1;break}}return"undefined"==typeof c&&a.length\&]/gim,function(a){return"&#"+a.charCodeAt(0)+";"})}function E(a,b){return b=b||NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,document.createTreeWalker(a,b)}function F(a){var b=a.ownerDocument;return b&&(b.defaultView||b.parentWindow)}function G(a,b){function c(b){var c=document.createRange(),d=!1;return c.selectNode(b),-1!=c.compareBoundaryPoints(window.Range.START_TO_START,a)&&1!=c.compareBoundaryPoints(window.Range.END_TO_END,a)&&(d=!0),c.detach(),d}for(var d,e=a.commonAncestorContainer,f=e.ownerDocument,g=f.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);d=g.nextNode();)c(d)&&b(d)}function H(a){var b=F(a.startContainer),c=b.milo.Component,d=[];return G(a,function(a){if(a.nodeType!=Node.TEXT_NODE){var b=c.getComponent(a);b&&d.push(b)}}),d}function I(a){var b=H(a);b.forEach(function(a){a.destroy(!0)}),a.deleteContents()}function J(a,b){return 0==a.compareBoundaryPoints(window.Range.START_TO_START,b)&&0==a.compareBoundaryPoints(window.Range.END_TO_END,b)}function K(a,b){var c=document.createElement("div");c.setAttribute("style","width: 1px; height: 1px; position:fixed; left:"+a+"px; top:"+b+"px; background-color:red; z-index: 100"),setTimeout(function(){document.body.appendChild(c)},200)}var L=a("../config"),M=a("milo-core"),N=M.proto,O=M.util.logger,P={children:c,filterNodeListByType:d,containingElement:e,selectElementContents:f,selectElementText:g,getElementOffset:m,setCaretPosition:h,getSelectionDirection:i,setSelection:k,clearSelection:l,removeElement:o,unwrapElement:r,wrapInElement:s,detachComponent:w,firstTextNode:p,lastTextNode:q,trimNodeRight:t,trimNodeLeft:u,stripHtml:x,htmlEntities:D,walkTree:y,createTreeWalker:E,treePathOf:z,getNodeAtTreePath:A,insertAtTreePath:B,isTreePathBefore:C,getNodeWindow:F,getComponentsFromRange:H,deleteRangeWithComponents:I,forEachNodesInRange:G,areRangesEqual:J,addDebugPoint:K};b.exports=P},{"../config":64,"milo-core":106}],80:[function(a,b){"use strict";function c(){this.listeners=[]}function d(a,b,c){this.listeners.push({target:a,eventType:b,handler:c}),a.addEventListener(b,c)}function e(a,b,c){var d={target:a,eventType:b,handler:c},e=h.findIndex(this.listeners,h.partial(h.isEqual,d));e>-1&&(this.listeners.splice(e,1),g(d))}function f(){this.listeners.forEach(g),this.listeners=[]}function g(a){a.target.removeEventListener(a.eventType,a.handler)}var h=a("milo-core").proto;b.exports=c,h.extendProto(c,{add:d,remove:e,removeAll:f})},{"milo-core":106}],81:[function(a,b){"use strict";function c(a){function b(){a.apply(c,i)}var c=this,i=f.slice(arguments,1);e.call(this)?b():(h||(document.addEventListener("readystatechange",d),h=!0),g.push(b))}function d(){document.removeEventListener("readystatechange",d),g.forEach(function(a){a()})}function e(){var a=document.readyState;return"loading"==a?!1:a}var f=a("milo-core").proto;b.exports=c;var g=[],h=!1;f.extend(c,{isReady:e})},{"milo-core":106}],82:[function(a,b){"use strict";function c(a){this.event=a,this.dataTransfer=a.dataTransfer,this.types=a.dataTransfer.types}function d(){return A.dataTypes.component}function e(){return C.indexOf(this.types,c.componentDataType())>=0}function f(){var a=c.componentDataType(),b=this.dataTransfer.getData(a),d=C.jsonParse(b);return d}function g(a,b){if(!b){var d=a.getTransferState({requestedBy:"drag"});b=JSON.stringify(d)}var e=c.componentDataType();return b&&this.dataTransfer.setData(e,b),this.dataTransfer.setData("text/html",a.el.outerHTML),b}function h(a,b,c){var d=j(a),e=C.toQueryString(b),f=A.dataTypes.componentMetaTemplate.replace("%class",i(d.compClass||"")).replace("%name",i(d.compName||"")).replace("%params",i(e||""));return c&&"object"==typeof c&&(c=JSON.stringify(c)),this.dataTransfer.setData(f,c||""),f}function i(a){return D.encode(a).toLowerCase()}function j(a){return a.transfer?a.transfer.getComponentMeta():{compClass:a.constructor.name,compName:a.name}}function k(){var a,b=C.find(this.types,function(b){return a=b.match(B),!!a});if(b){for(var c=1;4>c;c++)a[c]=D.decode(a[c]);return{compClass:a[1],compName:a[2],params:C.fromQueryString(a[3]),metaDataType:b,metaData:C.jsonParse(this.dataTransfer.getData(b))?C.jsonParse(this.dataTransfer.getData(b)):this.dataTransfer.getData(b)}}}function l(){return this.dataTransfer.effectAllowed}function m(a){this.dataTransfer.effectAllowed=a}function n(){return this.dataTransfer.dropEffect}function o(a){this.dataTransfer.dropEffect=a}function p(a){var b=this.getAllowedEffects(),c="copy"==a,d="move"==a,e="link"==a,f=c||e||d;switch(b){case"copy":case"move":case"link":return b==a;case"copyLink":return c||e;case"copyMove":return c||d;case"linkMove":return e||d;case"all":case"uninitialized":return f;case"none":return!1}}function q(a){return this.dataTransfer.getData(a)}function r(a,b){this.dataTransfer.setData(a,b)}function s(a){this.dataTransfer.clearData(a)}function t(a,b){E=b.dragDrop,F=b.dragFacet}function u(a,b){F&&F.postMessageSync("dragdropcompleted",b),E=void 0,F=void 0}function v(a,b){E&&G.postMessageSync("dragdropcompleted",b)}function w(){return E}function x(){G.offAll()}var y=(a("../components/c_class"),a("milo-core")),z=y.Messenger,A=a("../config").dragDrop,B=A.dataTypes.componentMetaRegex,C=y.proto,D=a("base32");b.exports=c,C.extend(c,{componentDataType:d}),C.extendProto(c,{isComponent:e,getComponentState:f,setComponentState:g,getComponentMeta:k,setComponentMeta:h,getAllowedEffects:l,setAllowedEffects:m,getDropEffect:n,setDropEffect:o,isEffectAllowed:p,getData:q,setData:r,clearData:s});var E,F,G=new z;C.extend(c,{service:G,destroy:x}),G.onMessages({dragdropstarted:t,dragdropcompleted:u,completedragdrop:v}),C.extend(G,{getCurrentDragDrop:w})},{"../components/c_class":15,"../config":64,base32:96,"milo-core":106}],83:[function(a,b){"use strict";function c(a){var b=e.makeFunction(a,"message",'this.name = "'+a+'"; this.message = message || "There was an error";');return e.makeSubclass(b,Error),b}function d(){throw new g.AbstractClass("calling the method of an absctract class")}var e=a("milo-core").proto,f=["AbstractClass","Mixin","Messenger","Component","Attribute","Binder","Loader","MailMessageSource","Facet","Scope","Model","DomFacet","EditableFacet","List","Connector","Registry","FrameMessageSource","Drop","Angular","StorageMessageSource"],g={toBeImplemented:d,createClass:c};f.forEach(function(a){g[a]=c(a+"Error")}),b.exports=g},{"milo-core":106}],84:[function(a,b){"use strict";function c(a,b,c){var d=f(a);if(!d)return void s.error("fragment.getState: range has no common container");var i=a.cloneContents(),j=e(i,c);g(d,j),b&&h(j);var k=j.getState();return t.deferMethod(j,"destroy"),k}function d(a,b,c){try{var d=f(a);if(!d)return void c(new Error("fragment.getState: range has no common container"));"function"==typeof b&&(c=b,b=!1);var i=a.cloneContents(),j=e(i);g(d,j),t.defer(function(){j.broadcast("stateready"),t.defer(function(){b&&h(j);var a=j.getState();j.destroy(),c(null,a)})})}catch(k){c(k)}}function e(a,b){var c=document.createElement("div"),d=new o(c);t.extend(d,{compClass:b||"Component",compFacets:b?[]:["container"],compName:"wrapper"}),d.decorate(),c.appendChild(a);var e=p(c);return e.wrapper}function f(a){var b=q.containingElement(a.commonAncestorContainer);return n.getContainingComponent(b,!0,"container")}function g(a,b){var c=a.container.scope;b.container.scope._each(function(a,b){var d=c[b];if(!d)return s.error("fragment.getState: conponent",b,"not found in range");var e=d._getState(!0);a.setState(e)})}function h(a){a.container.scope._each(function(a){a.rename()})}function i(a){var b=k(a);return a=j(b)}function j(a){var b=document.createRange();return a.siblings?(b.setStartBefore(a.start),b.setEndAfter(a.end)):b.selectNode(a.start),b}function k(a){var b=a.commonAncestorContainer,c=a.startContainer,d=a.endContainer;if(c==d)return c!=b&&s.error("deleteSelectionCommand logical error: start==end, but container is different"),{siblings:!1,start:c};if(c==b||d==b)return{siblings:!1,start:b};var e=l(b,c),f=l(b,d);return e&&f?e==f?(s.error("deleteSelectionCommand logical error: same siblings"),{siblings:!1,start:e}):{siblings:!0,start:e,end:f}:void 0}function l(a,b){return t.find(a.childNodes,function(a){return a.contains(b)})}function m(a){return function(b,c){var d={siblings:c.siblings,start:a(b,c.start)};return d.siblings&&(d.end=a(b,c.end)),d}}{var n=a("../components/c_class"),o=a("../attributes/a_bind"),p=a("../binder"),q=a("./dom"),r=a("milo-core"),s=r.util.logger,t=(r.util.check,r.proto),u=m(q.treePathOf),v=m(q.getNodeAtTreePath);b.exports={getState:c,getStateAsync:d,expandRangeToSiblings:i,getRangeSiblings:k,createRangeFromSiblings:j,createRangeFromNodes:j,createRangePaths:u,createRangeNodes:v}}},{"../attributes/a_bind":4,"../binder":8,"../components/c_class":15,"./dom":79,"milo-core":106}],85:[function(a,b){"use strict";function c(){f.request.destroy(),f.dragDrop.destroy()}var d=a("milo-core"),e=a("./deprecate"),f={logger:d.util.logger,request:a("./request"),websocket:a("./websocket"),check:d.util.check,error:e(a("./error"),"milo.util.error is DEPRECATED and will be REMOVED soon!"),count:e(a("./unique_id"),"milo.util.count is DEPRECATED! Use milo.util.uniqueId instead"),uniqueId:a("./unique_id"),componentName:a("./component_name"),dom:a("./dom"),domListeners:a("./dom_listeners"),selection:a("./selection"),fragment:a("./fragment"),jsonParse:e(a("./json_parse"),"milo.util.jsonParse is DEPRECATED! Use _.jsonParse instead"),storage:a("./storage"),domReady:a("./domready"),dragDrop:a("./dragdrop"),dialog:e(a("../components/ui/bootstrap/Dialog"),"milo.util.dialog is DEPRECATED! Use milo.registry.components.get('MLDialog') instead"),alert:e(a("../components/ui/bootstrap/Alert"),"milo.util.alert is DEPRECATED! Use milo.registry.components.get('MLAlert') instead"),deprecate:e,doT:d.util.doT,destroy:c};b.exports=f},{"../components/ui/bootstrap/Alert":61,"../components/ui/bootstrap/Dialog":62,"./component_name":76,"./deprecate":78,"./dom":79,"./dom_listeners":80,"./domready":81,"./dragdrop":82,"./error":83,"./fragment":84,"./json_parse":86,"./request":87,"./selection":88,"./storage":89,"./unique_id":92,"./websocket":93,"milo-core":106}],86:[function(a,b){"use strict";function c(a){try{return JSON.parse(a)}catch(b){}}b.exports=c},{}],87:[function(a,b){"use strict";function c(a){return function(){var b=Promise.prototype[a].apply(this,arguments);return f(b,this._request),b}}function d(a,b,c){function f(a){h(i,c,j,a.type)}b.url=a,b.contentType=b.contentType||"application/json;charset=UTF-8",z&&d.postMessageSync("request",{options:b});var i=new XMLHttpRequest;i.open(b.method,b.url,!0),i.setRequestHeader("Content-Type",b.contentType),g(i,b.headers),i.timeout=b.timeout||t.request.defaults.timeout,i.onreadystatechange=i.ontimeout=i.onabort=f;var j=e(i);return i.send(JSON.stringify(b.data)),i[t.request.optionsKey]=b,w.push(i),j.promise}function e(a){var b,c,d=new Promise(function(a,d){b=a,c=d});return f(d,a),d["catch"](r.noop),{promise:d,resolve:b,reject:c}}function f(a,b){return a._request=b,a.then=x,a["catch"]=y,a}function g(a,b){b&&r.eachKey(b,function(b,c){a.setRequestHeader(c,b)})}function h(a,b,c,e){function f(b){z&&d.postMessage(b,{status:status,response:a.responseText})}if(4==a.readyState&&(a.status||"readystatechange"!=e)){r.spliceItem(w,a);var g;try{if(a.status>=200&&a.status<400){try{f("success"),b&&b(null,a.responseText,a)}catch(h){g=h}c.resolve(a.responseText)}else{var i=a.status||e;try{f("error"),f("error"+i),b&&b(i,a.responseText,a)}catch(h){g=h}c.reject({reason:i,response:a.responseText})}}catch(h){g=g||h}if(a.onreadystatechange=a.ontimeout=a.onabort=void 0,w.length||f("requestscompleted"),g)throw new Error("Exception: "+g)}}function i(){z=new v(d,["on","once","onSync","off","onMessages","offMessages","postMessage","postMessageSync"])}function j(a,b){return d(a,{method:"GET"},b)}function k(a,b,c){return d(a,{method:"POST",data:b},c)}function l(a,b){var c=d(a,{method:"GET"}),e=c.then(JSON.parse);return b&&e.then(function(a){b(null,a)},function(a){b(a.reason,a.response)}),e}function m(a,b){function c(a,c){r.spliceItem(w,window[k]);try{g(a?"error":"success",a,c),a&&(u.error("No JSONP response or timeout"),g("errorjsonptimeout",a)),b&&b(a,c)}catch(d){var e=d}if(a?i.reject(a):i.resolve(c),f(),w.length||g("requestscompleted"),e)throw e}function f(){clearTimeout(m),j.removeChild(h),delete window[k]}function g(a,b,c){z&&d.postMessage(a,{status:b,response:c})}var h=document.createElement("script"),i=e(h),j=window.document.head,k=t.request.jsonpCallbackPrefix+s(),l=r.extend({url:a},A);z&&d.postMessageSync("request",{options:l}),r.isEqual(r.omitKeys(l,"url"),A)||u.warn("Ignored not allowed request options change in JSONP request - only URL can be changed");var m=setTimeout(function(){var a=new Error("No JSONP response or no callback in response");c(a)},t.request.jsonpTimeout);return window[k]=r.partial(c,null),w.push(window[k]),h.type="text/javascript",h.src=l.url+(-1==l.url.indexOf("?")?"?":"&")+"callback="+k,j.appendChild(h),i.promise}function n(a,b,c,f){function i(a){f&&(j.upload.onprogress=void 0),h(j,c,k,a.type)}"string"==typeof a&&(a={method:"POST",url:a}),a.method=a.method||"POST",a.file=!0,z&&d.postMessageSync("request",{options:a});var j=new XMLHttpRequest;f&&(j.upload.onprogress=f),j.open(a.method,a.url,!0),g(j,a.headers),j.timeout=a.timeout||t.request.defaults.timeout,j.onreadystatechange=j.ontimeout=j.onabort=i;var k=e(j);if(a.binary)j.send(b);else{var l=new FormData;l.append("file",b),j.send(l)}return w.push(j),k.promise}function o(){z&&z.destroy(),d._destroyed=!0}function p(a,b){a=r.once(a),b&&r.delay(a,b,"timeout"),w.length?z.once("requestscompleted",a):r.defer(a)}var q=a("milo-core"),r=q.proto,s=a("./unique_id"),t=a("../config"),u=q.util.logger,v=q.Messenger;b.exports=d;var w=[],x=c("then"),y=c("catch");r.extend(d,{get:j,post:k,json:l,jsonp:m,file:n,useMessenger:i,destroy:o,whenRequestsCompleted:p});var z,A={method:"GET",jsonp:!0}},{"../config":64,"./unique_id":92,"milo-core":106}],88:[function(a,b){"use strict";function c(a){return!this instanceof c?new c(a):(this.window=a||window,void this.init())}function d(){this.selection=this.window.getSelection(),this.selection.rangeCount&&(this.range=this.selection.getRangeAt(0)),this.isCollapsed=this.selection.isCollapsed}function e(){return this.range?(this._text||(this._text=this.range.toString()),this._text):void 0}function f(){return this.range?(this._textNodes||(this._textNodes=h.call(this)),this._textNodes):void 0}function g(){this.selection.removeAllRanges()}function h(){var a=[];if(this.isCollapsed)return a;for(var b=this.range.startContainer,c=this.range.endContainer,d=this.range.commonAncestorContainer,e=this.window.document.createTreeWalker(d,NodeFilter.SHOW_TEXT),f=e.currentNode=b;f&&(!g||c.contains(f));){a.push(f);var g=g||c.contains(f);f=e.nextNode()}return a}function i(a,b){return this.range?("undefined"==typeof this[a]&&(this[a]=z(this.range[b])),this[a]):void 0}function j(a,b){return this.range?("undefined"==typeof this[a]&&(this[a]=F.getContainingComponent(this[b]())),this[a]):void 0}function k(){if(this._containedComponents)return this._containedComponents;var a=this._containedComponents=[];return this.isCollapsed||!this.range?a:B(this.range)}function l(a,b){if(!this.isCollapsed&&this.range){var c=this.containedComponents();c.forEach(a,b)}}function m(a){if(!this.isCollapsed&&this.range){var b=this._getPostDeleteSelectionPoint(a);C(this.range),this._selectAfterDelete(b),b.node.parentNode.normalize()}}function n(a){var b=this.range.startContainer,c=this.range.startOffset;return a&&this.range.startContainer!=this.range.endContainer&&(b=this.range.endContainer,c=0),{node:b,offset:c}}function o(a){var b=a.node,c=a.offset;if(b){b.nodeType==Node.TEXT_NODE&&(b.textContent=b.textContent.trimRight()),b.nodeValue||(b.nodeValue=" ");var d=c>b.length?b.length:c;A(b,d)}}function p(){return this.range}function q(a){var b=this.range,d=a.ownerDocument,e=d.defaultView||d.parentWindow;return b?c.createStateObject(a,b.startContainer,b.startOffset,b.endContainer,b.endOffset):{window:e}}function r(a,b,c,d,e){d=d||b,e=e||c;var f=a.ownerDocument,g=f.defaultView||f.parentWindow;return{window:g,rootEl:a,start:s(a,b,c),end:s(a,d,e)}}function s(a,b,c){var d=y.treePathOf(a,b);return d||E.error("Selection point is outside of root element"),{treePath:d,offset:c}}function t(a){var b=a.window.milo.util.dom;if(!(a.rootEl&&a.start&&a.end))return b.clearSelection(a.window),new c(a.window);var d=u(a.rootEl,a.start),e=u(a.rootEl,a.end);try{return b.setSelection(d,a.start.offset,e,a.end.offset),new c(a.window)}catch(f){E.error("Text selection: can't create selection",f,f.message)}}function u(a,b){var c=y.getNodeAtTreePath(a,b.treePath);return c||E.error("TextSelection createFromState: no node at treePath"),c}function v(a,b){var d,e=a.startContainer.ownerDocument.defaultView,f=e.getSelection();return f.removeAllRanges(),b?(d=a.cloneRange(),d.collapse(!1),f.addRange(d),f.extend(a.startContainer,a.startOffset)):f.addRange(a),new c(e)}function w(){var a,b,c=this.range.commonAncestorContainer.ownerDocument,d=this.range.cloneRange();return d.endContainer.nodeType!==Node.TEXT_NODE&&(a=c.createTreeWalker(c.body,NodeFilter.SHOW_TEXT),a.currentNode=d.endContainer,b=a.previousNode(),d.setEnd(b,b.length)),d}function x(){return y.getSelectionDirection(this.selection)}var y=a("../dom"),z=y.containingElement,A=y.setCaretPosition,B=y.getComponentsFromRange,C=y.deleteRangeWithComponents,D=a("milo-core"),E=D.util.logger,F=a("../../components/c_class"),G=D.proto;b.exports=c;var H=G.partial(i,"_startElement","startContainer"),I=G.partial(i,"_endElement","endContainer"),J=G.partial(i,"_containingElement","commonAncestorContainer"),K=G.partial(j,"_startComponent","startElement"),L=G.partial(j,"_endComponent","endElement"),M=G.partial(j,"_containingComponent","containingElement");G.extendProto(c,{init:d,text:e,textNodes:f,clear:g,startElement:H,endElement:I,containingElement:J,startComponent:K,endComponent:L,containingComponent:M,containedComponents:k,eachContainedComponent:l,del:m,_getPostDeleteSelectionPoint:n,_selectAfterDelete:o,getRange:p,getState:q,getNormalizedRange:w,getDirection:x}),G.extend(c,{createFromRange:v,createFromState:t,createStateObject:r})},{"../../components/c_class":15,"../dom":79,"milo-core":106}],89:[function(a,b){"use strict";function c(a,b,c){"undefined"!=typeof window&&(c=c||window,a=B.domStorage.root+(a?a+B.domStorage.prefixSeparator:""),C.defineProperties(this,{keyPrefix:a,sessionOnly:!!b,window:c,_storage:b?c.sessionStorage:c.localStorage,_typeSuffix:B.domStorage.typeSuffix,_keys:{}},C.WRIT))}function d(a){if("object"==typeof a)C.eachKey(a,function(a,b){this.setItem(b,a)},this);else{var b=arguments.length;if(b%2)throw new DomStorageError("DOMStorage: set should have even number of arguments or object");for(var c=0;b>c;c++){var d=arguments[c],e=arguments[++c];this.setItem(d,e)}}}function e(){var a={};return C.deepForEach(arguments,function(b){a[b]=this.getItem(b)},this),a}function f(){C.deepForEach(arguments,function(a){this.removeItem(a)},this)}function g(a){var b=this._storageKey(a);return null!=this._storage.getItem(b)}function h(a){var b=this._storageKey(a),c=o.call(this,b),d=this._storage.getItem(b),e=u(d,c);return e}function i(a,b){var c=this._storageKey(a),d=p.call(this,c,b),e=t(b,d);try{this._storage.setItem(c,e)}catch(f){if("QuotaExceededError"!=f.name)throw f;var g=B.domStorage.quotaExceeded;if(g.message&&milo.mail.postMessage("quotaexceedederror",b),g.throwError)throw f}this._keys[a]=!0,H[this.sessionOnly]._keys[c]=!0}function j(a){var b=this._storageKey(a);this._storage.removeItem(b),q.call(this,b),delete this._keys[a],delete H[this.sessionOnly]._keys[b]}function k(){var a=Object.keys(this._keys),b=a.filter(function(a){return this.hasItem(a)?!0:void delete this._keys[a] -},this);return b}function l(){return this.get(this.getAllKeys())}function m(a){return this.keyPrefix+a}function n(a){return a.indexOf(this._typeSuffix)>=0?void 0:C.unPrefix(a,this.keyPrefix)}function o(a){return a=r.call(this,a),this._storage.getItem(a)}function p(a,b){var c=s(b);return a=r.call(this,a),this._storage.setItem(a,c),c}function q(a){a=r.call(this,a),this._storage.removeItem(a)}function r(a){return a+this._typeSuffix}function s(a){var b=typeof a,c=a&&a.constructor.name,d=I[c];return d||("object"!=b?b:null==a?"null":a.constructor.name)}function t(a,b){b=b||s(a);var c=J[b];return c?c(a,b):a&&a.toString==Object.prototype.toString?JSON.stringify(a):""+a}function u(a,b){var c=K[b];return c?c(a,b):a}function v(a,b,c,d){b&&(J[a]=b),c&&(K[a]=c),I[a]=d||a}function w(){var a=new A(this),b=new z(this,void 0,a);C.defineProperties(this,{_messenger:b,_messageSource:a},C.WRIT)}function x(){this._storage=void 0,this.window=void 0,this._messenger&&this._messenger.destroy(),this._destroyed=!0}{var y=a("milo-core"),z=y.Messenger,A=a("./msg_src"),B=a("../../config"),C=y.proto,D=y.util.check;D.Match}a("./model"),b.exports=c;var E={"true":{},"false":{}};C.extendProto(c,{get:e,set:d,remove:f,hasItem:g,getItem:h,setItem:i,removeItem:j,_storageKey:m,_domStorageKey:n,getAllKeys:k,getAllItems:l,createMessenger:w,destroy:x}),z.useWith(c,"_messenger",z.defaultMethods),A.useWith(c,"_messageSource",["trigger"]);var F=new c("",!0),G=new c("",!1),H={"true":F,"false":G};C.extend(c,{registerDataType:v,local:G,session:F,storage:H,_storedKeys:E});var I={},J={Array:JSON.stringify},K={Object:C.jsonParse,Array:C.jsonParse,Date:function(a){return new Date(a)},"boolean":function(a){return"true"==a},number:Number,"function":C.toFunction,RegExp:C.toRegExp}},{"../../config":64,"./model":90,"./msg_src":91,"milo-core":106}],90:[function(a){"use strict";function b(){var b=a("./index");b.registerDataType("Model",c,d),b.registerDataType("ModelPath",c,d,"Model")}function c(a){var b=a.get();return JSON.stringify(b)}function d(a){var b=g.jsonParse(a);return new f(b)}var e=a("milo-core"),f=e.Model,g=e.proto;f.registerWithDOMStorage=b},{"./index":89,"milo-core":106}],91:[function(a,b){"use strict";function c(a){if("DOMStorage"!=a.constructor.name)throw new Error("hostObject should be an instance of DOMStorage");this.storage=a,this.messageKey=l.domStorage.messageKey,this.window=a.window,j.prototype.init.apply(this,arguments)}function d(){this.window.addEventListener("storage",this,!1)}function e(){this.window.removeEventListener("storage",this,!1)}function f(a,b){this.messenger.postMessageSync(a,b)}function g(a,b){var c=this.messageKey+a;b=b||{},b[l.domStorage.messageTimestamp]=m(),k.deferMethod(this.storage,"setItem",c,b)}function h(a){if(a.storageArea==this.storage._storage){var b=this.storage._domStorageKey(a.key);if(b){var c=k.unPrefix(b,this.messageKey);if(c){var d=this.storage.getItem(b);d&&this.dispatchMessage(c,d)}}}}var i=a("milo-core"),j=i.classes.MessageSource,k=i.proto,l=a("../../config"),m=a("../../util/unique_id"),n=k.createSubclass(j,"StorageMessageSource",!0);k.extendProto(n,{init:c,addSourceSubscriber:d,removeSourceSubscriber:e,postMessage:f,trigger:g,handleEvent:h}),b.exports=n},{"../../config":64,"../../util/unique_id":92,"milo-core":106}],92:[function(a,b){"use strict";function c(){var a=Date.now();return f=""+a,d==a?(e=""===e?0:e+1,f+="_"+e):(d=a,e=""),f}var d=Date.now(),e="",f=""+d;c.get=function(){return f},b.exports=c},{}],93:[function(a,b){"use strict";function c(){var a=new d,b=new e(a,{send:"trigger",connect:"connect"},new f);return a._setMessageSource(b),a}var d=a("milo-core").Messenger,e=a("./msg_src"),f=a("./msg_api");b.exports=c},{"./msg_api":94,"./msg_src":95,"milo-core":106}],94:[function(a,b){"use strict";function c(a){return k.indexOf(a)>=0?a:"message"}function d(a,b,c){if(k.indexOf(b)>=0)return!0;if("message"==a){var d=c&&c.type;return d==b}}function e(a,b,c){var d="message"==a?h.jsonParse(c.data)||c.data:c;return d}var f=a("milo-core"),g=f.classes.MessengerAPI,h=f.proto,i=f.util.check,j=(i.Match,h.createSubclass(g,"WSMsgAPI",!0));h.extendProto(j,{translateToSourceMessage:c,filterSourceMessage:d,createInternalData:e}),b.exports=j;var k=["open","close","error","message"]},{"milo-core":106}],95:[function(a,b){"use strict";function c(a){this._options=a=a||{};var b=a.host||window.location.host.replace(/:.*/,""),c=a.port||"8080";this._ws&&(this._ws.onopen=this.ws.onmessage=this.ws.onclose=this.ws.onerror=void 0,this._ws.close()),this._ws=new WebSocket("ws://"+b+":"+c)}function d(a){f.call(this,"addEventListener",a)}function e(a){f.call(this,"removeEventListener",a)}function f(a,b){return this._ws?void this._ws[a](b,this):l.error("websocket is not created")}function g(a){this.dispatchMessage(a.type,a)}function h(a,b,c){function d(){f("off",b.callbackCorrId),c(new Error("websocket rpc: timeout"))}function e(a,b){if(clearInterval(h),"object"==typeof b){var d=b.error?new Error(b.error):null;c(d,b.data)}else c(new Error("websocket rpc: invalid response data"),b)}function f(a,b){g.messenger[a](n.websocket.rpc.responsePrefix+b,e)}if(!this._ws)return l.error("websocket is not created");b=b||{},b.type=a;var g=this;if(c){b.callbackCorrId=m();var h=k.delay(d,n.websocket.rpc.timeout);f("once",b.callbackCorrId)}this._ws.send(JSON.stringify(b))}var i=a("milo-core"),j=i.classes.MessageSource,k=i.proto,l=i.util.logger,m=a("../../util/unique_id"),n=a("../../config"),o=i.util.check,p=(o.Match,k.createSubclass(j,"WSMessageSource",!0));k.extendProto(p,{addSourceSubscriber:d,removeSourceSubscriber:e,handleEvent:g,connect:c,trigger:h}),b.exports=p},{"../../config":64,"../../util/unique_id":92,"milo-core":106}],96:[function(a,b){!function(){function a(){var a=0,b=0;this.output="",this.readByte=function(c){return"string"==typeof c&&(c=c.charCodeAt(0)),0>a?b|=c>>-a:b=c<3?(a-=8,1):(4>a&&(this.output+=f[b>>3],a+=5),0)},this.finish=function(c){var d=this.output+(0>a?f[b>>3]:"")+(c?"$":"");return this.output="",d}}function c(){var a=0,b=0;this.output="",this.readChar=function(c){"string"!=typeof c&&"number"==typeof c&&(c=String.fromCharCode(c)),c=c.toLowerCase();var d=h()[c];"undefined"!=typeof d&&(d<<=3,b|=d>>>a,a+=5,a>=8&&(this.output+=String.fromCharCode(b),a-=8,b=a>0?d<<5-a&255:0))},this.finish=function(b){var c=this.output+(0>a?f[bits>>3]:"")+(b?"$":"");return this.output="",c}}function d(b){var c=new a,d=c.update(b,!0);return d}function e(a){var b=new c,d=b.update(a,!0);return d}var f="0123456789abcdefghjkmnpqrtuvwxyz",g={o:0,i:1,l:1,s:5},h=function(){for(var a={},b=0;b=h){var i=a.__messages;this.off(i,a)}else h>1&&a.options.dispatchTimes--;g?a.subscriber.call(a.context,b,c,d):I.deferMethod(a.subscriber,"call",a.context,b,c,d)}function C(a,b){J(a,K.OneOf(String,RegExp));var c=this._chooseSubscribersHash(a),d=c[a]?[].concat(c[a]):[];return b!==!1&&"string"==typeof a&&I.eachKey(this._patternMessageSubscribers,function(b){var c=b.pattern;b&&b.length&&c.test(a)&&I.appendArray(d,b)}),d.length?d:void 0}function D(a){return a instanceof RegExp?this._patternMessageSubscribers:this._messageSubscribers}function E(a){J(a,H),I.defineProperty(this,"_messageSource",a),a.messenger=this}function F(){return this._messageSource}var G=a("../abstract/mixin"),H=a("./m_source"),I=a("mol-proto"),J=a("../util/check"),K=J.Match,L=I.createSubclass(G,"Messenger"),M=L.messagesSplitRegExp=/\s*(?:\,|\s)\s*/;I.extendProto(L,{init:c,destroy:e,on:f,once:g,onceSync:h,onSync:i,onAsync:j,onMessage:f,off:q,offMessage:q,onMessages:p,offMessages:u,offAll:v,postMessage:x,postMessageSync:y,getSubscribers:C,getMessageSource:F,_chooseSubscribersHash:D,_registerSubscriber:n,_removeSubscriber:s,_removeAllSubscribers:t,_callPatternSubscribers:z,_callSubscribers:A,_callSubscriber:B,_setMessageSource:E}),L.defaultMethods={on:"on",onSync:"onSync",once:"once",onceSync:"onceSync",off:"off",onMessages:"onMessages",offMessages:"offMessages",postMessage:"postMessage",postMessageSync:"postMessageSync",getSubscribers:"getSubscribers"},b.exports=L,L.subscriptions=[]},{"../abstract/mixin":98,"../util/check":117,"./m_source":104,"mol-proto":123}],102:[function(a,b){"use strict";function c(){this.init&&this.init.apply(this,arguments)}function d(){l.defineProperty(this,"_internalMessages",{})}function e(){}function f(a){var b,c=this.translateToSourceMessage(a);if("undefined"!=typeof c)return this._internalMessages.hasOwnProperty(c)?(b=this._internalMessages[c],void(-1==b.indexOf(a)?b.push(a):m.warn("Duplicate addInternalMessage call for internal message "+a))):(b=this._internalMessages[c]=[],b.push(a),c)}function g(a){function b(){m.warn("notification received: un-subscribe from internal message "+a+" without previous subscription notification")}var c=this.translateToSourceMessage(a);if("undefined"!=typeof c){var d=this._internalMessages[c];if(d&&d.length){var e=d.indexOf(a);if(e>=0){if(d.splice(e,1),0==d.length)return delete this._internalMessages[c],c}else b()}else b()}}function h(a){return this._internalMessages[a]}function i(a){return a}function j(a,b,c){return c}function k(){return!0}var l=a("mol-proto"),m=a("../util/logger");b.exports=c,l.extendProto(c,{init:d,destroy:e,addInternalMessage:f,removeInternalMessage:g,getInternalMessages:h,translateToSourceMessage:i,createInternalData:j,filterSourceMessage:k})},{"../util/logger":119,"mol-proto":123}],103:[function(a,b){"use strict";function c(){g.prototype.init.apply(this,arguments),h.defineProperties(this,{_patternInternalMessages:{}}),this._catchAllSubscribed=!1}function d(){var a=g.prototype.addInternalMessage.apply(this,arguments);if(a&&a instanceof RegExp){if(this._internalMessages[a].pattern=a,this._patternInternalMessages[a]=this._internalMessages[a],this._catchAllSubscribed)return;return this._catchAllSubscribed=!0,/.*/}return a}function e(){var a=g.prototype.removeInternalMessage.apply(this,arguments);if(a&&a instanceof RegExp){delete this._patternInternalMessages[a];var b=!Object.keys(this._patternInternalMessages).length;if(b)return this._catchAllSubscribed=!1,/.*/}return a}function f(a){var b=g.prototype.getInternalMessages.apply(this,arguments);if("string"==typeof a){b=b||[];var c=h.object(b,!0);h.eachKey(this._patternInternalMessages,function(d){var e=d.pattern;e.test(a)&&d.forEach(function(a){c[a]||(b.push(a),c[a]=!0)})})}return b}var g=a("./m_api"),h=a("mol-proto"),i=h.createSubclass(g,"MessengerRegexpAPI");b.exports=i,h.extendProto(i,{init:c,addInternalMessage:d,removeInternalMessage:e,getInternalMessages:f})},{"./m_api":102,"mol-proto":123}],104:[function(a,b){"use strict";function c(a,b,c){this._prepareMessengerAPI(c)}function d(){this.messengerAPI&&this.messengerAPI.destroy()}function e(a){n.defineProperty(this,"messenger",a)}function f(a){o(a,p.Optional(m)),a||(a=new m),n.defineProperty(this,"messengerAPI",a)}function g(a){var b=this.messengerAPI.addInternalMessage(a);"undefined"!=typeof b&&this.addSourceSubscriber(b)}function h(a){var b=this.messengerAPI.removeInternalMessage(a);"undefined"!=typeof b&&this.removeSourceSubscriber(b)}function i(a,b){var c=this.messengerAPI,d=c.getInternalMessages(a);d&&d.forEach(function(d){var e=c.createInternalData(a,d,b),f=c.filterSourceMessage(a,d,e);f&&this.postMessage(d,e)},this)}function j(a,b){this.messenger.postMessage(a,b)}function k(){throw new Error("calling the method of an absctract class")}var l=a("../abstract/mixin"),m=a("./m_api"),n=(a("../util/logger"),a("mol-proto")),o=a("../util/check"),p=o.Match,q=n.createSubclass(l,"MessageSource",!0);b.exports=q,n.extendProto(q,{init:c,destroy:d,setMessenger:e,onSubscriberAdded:g,onSubscriberRemoved:h,dispatchMessage:i,postMessage:j,_prepareMessengerAPI:f,trigger:k,addSourceSubscriber:k,removeSourceSubscriber:k})},{"../abstract/mixin":98,"../util/check":117,"../util/logger":119,"./m_api":102,"mol-proto":123}],105:[function(a,b){"use strict";function c(a,b,c,d){g.prototype.init.apply(this,arguments),this.sourceMessenger=d}function d(a){this.sourceMessenger.onSync(a,{context:this,subscriber:this.dispatchMessage})}function e(a){this.sourceMessenger.off(a,{context:this,subscriber:this.dispatchMessage})}function f(a,b){this.messenger.postMessageSync(a,b)}var g=a("./m_source"),h=a("mol-proto"),i=(a("../util/check"),h.createSubclass(g,"MessengerMessageSource"));b.exports=i,h.extendProto(i,{init:c,addSourceSubscriber:d,removeSourceSubscriber:e,postMessage:f})},{"../util/check":117,"./m_source":104,"mol-proto":123}],106:[function(a,b){"use strict";function c(){e.minder.destroy()}var d=a("mol-proto"),e={minder:a("./minder"),config:a("./config"),util:a("./util"),classes:a("./classes"),Messenger:a("./messenger"),Model:a("./model"),destroy:c,proto:d};"object"==typeof b&&b.exports&&(b.exports=e),"object"==typeof window&&(window.milo=e)},{"./classes":99,"./config":100,"./messenger":101,"./minder":107,"./model":110,"./util":118,"mol-proto":123}],107:[function(a,b){"use strict";function c(a,b,c,e){if(Array.isArray(a)){var f=a,g=f.map(function(a){return new p(a[0],a[1],a[2],a[3])});return g.forEach(d),g}var h=new p(a,b,c,e);return d(h),h}function d(a){a.___minder_id=u.push(a)-1,a.on(/.*/,e),c.postMessage("added",{connector:a}),c.postMessage("turnedon",{connector:a})}function e(a,b){var b=b?r.clone(b):{};r.extend(b,{id:this.___minder_id,connector:this}),c.postMessage(a,b),v.length||w||(r.defer(f),w=!0),v.push({msg:a,data:b})}function f(){v.length?(v.length=0,r.defer(f),c.postMessage("propagationticked")):(w=!1,c.postMessage("propagationcompleted"))}function g(){return w}function h(a){function b(){w?c.once("propagationcompleted",b):a()}w?c.once("propagationcompleted",b):r.defer(b)}function i(a){return"undefined"==typeof a?u:u.filter(function(b){return b.isOn===a})}function j(a){a.destroy();var b=u.indexOf(a);b>=0?delete u[b]:s.warn("minder: connector destroyed that is not registered in minder")}function k(a,b){var d=c.getConnectors(a),e=d.map(function(a){var b={leftSource:l(a.ds1),rightSource:l(a.ds2),mode:a.mode,isOn:a.isOn};return a.options&&(b.options=a.options),b});return b&&(e=e.filter(function(a){return m(a.leftSource,b)||m(a.rightSource,b)})),e}function l(a){var b=[];return"function"==typeof a&&(a._model&&a._accessPath&&(b.unshift(a._accessPath),a=a._model),b.unshift(a),a=a._hostObject),"object"==typeof a&&(b.unshift(a),a.owner&&b.unshift(a.owner)),b}function m(a,b){return a.some(function(a){var c=a.constructor&&a.constructor.name;return n(c,b)||n(a.name,b)||n(a,b)})}function n(a,b){return a&&"string"==typeof a&&a.indexOf(b)>=0}function o(){function a(a){a&&!a._destroyed&&a.destroy()}u.forEach(function(b){a(b.ds1),a(b.ds2),b.destroy()}),t.destroy(),c._destroyed=!0}var p=a("./model/connector"),q=a("./messenger"),r=a("mol-proto"),s=a("./util/logger");b.exports=c;var t=new q(c,q.defaultMethods),u=[],v=[],w=!1;r.extend(c,{getConnectors:i,getExpandedConnections:k,isPropagating:g,whenPropagationCompleted:h,destroyConnector:j,destroy:o})},{"./messenger":101,"./model/connector":109,"./util/logger":119,"mol-proto":123}],108:[function(a,b){"use strict";function c(a,b){r.defineProperty(a,"__inChangeTransaction",b,r.CONF|r.WRIT)}function d(a){var b=a.__inChangeTransaction;return delete a.__inChangeTransaction,b}function e(a,b){var e=d(a);return c(b,e),e}function f(){this.postMessageSync("datachanges",{transaction:!1,changes:[]})}function g(a,b,c){h.call(this,b.changes,c)}function h(a,b){i.call(this,b,!1),l.call(this,k(j(a))),i.call(this,b,!0)}function i(a,b){a&&a(null,b),this.postMessage(b?"changecompleted":"changestarted")}function j(a){var b=a[0].source,c=!0;if(a.length>1)for(var d=1,e=a.length;e>d;d++)a[d].source!=b&&(o.error("changedata: changes from different sources in the same transaction, sources:",a[d].source.name,b.name),c=!1,b=a[d].source);return a}function k(a){function b(a){("splice"==a.type?c:d)(a)}function c(a){var b=q.parseAccessPath(a.path),c=i.some(function(a){return b.length"]});var l=e.dataValidation;l&&o.extend(this,{dataValidation1:l["<-"],dataValidation2:l["->"]})}this.turnOn()}function d(a){function b(){throw new Error("invalid Connector mode: "+a)}var c=a.match(q);c||b();var d=c[1].length,e=c[2].length;d&&e&&d!=e&&b(),d||e||b(),o.extend(this,{mode:a,depth1:d,depth2:e})}function e(a){return this.turnOff(),d.call(this,a),this.turnOn(),this}function f(a){return o.deferMethod(this,"changeMode",a),this}function g(a){var b={};return o.eachKey(a,function(a,c){b[a]=c}),b}function h(a){function b(a,b){throw new Error("Invalid pattern translation: "+a+", "+b)}function c(a){return a.replace(/[\.\[]?\*.*$/,"")}var d=[];return o.eachKey(a,function(e,f){var g=f.indexOf("*"),h=e.indexOf("*");g>=0&&h>=0?(f.slice(g)!=e.slice(h)&&b(f,e),delete a[f],d.push({fromPattern:n.createRegexPath(f),fromStaticPath:c(f,g),toPattern:n.createRegexPath(e),toStaticPath:c(e,h)})):(g>=0||h>=0)&&b(f,e)}),d}function i(a){return a.map(function(a){return{fromPattern:a.toPattern,fromStaticPath:a.toStaticPath,toPattern:a.fromPattern,toStaticPath:a.fromStaticPath}})}function j(){function a(a,b,e,f,g,h,i,j){function k(k,l){function m(a){if(g){var b=g[a];if(b)return b;if(!h.length)return;var d=o.find(h,function(b){return b.fromPattern.test(a)});if(!d)return;var b=a.replace(d.fromStaticPath,d.toStaticPath)}else if(!(c instanceof RegExp&&c.test(a)||c==a))return;return b||a}function n(a,b){if(i){var c=i[a];c&&"function"==typeof c&&(b.oldValue=c(b.oldValue),b.newValue=c(b.newValue))}}function p(a,c){function d(d){d(c.newValue,function(c,d){d.path=a,g||!c&&!d.valid||++f!=e.length?d.valid||(g=!0,b.postMessage("validated",d)):b.postMessage("validated",d)})}if(q(c),j){var e=j[a],f=0,g=!1;e&&e.forEach(d)}}function q(a){u.changes.push(a)}function r(){if(d[a])var b=s;var c=t(f);f.length=0,c.forEach(function(a){e.postMessageSync("changedata",{changes:a},b)})}function s(c,f){if(!c){var g=f?"onSync":"off";e[g]("datachanges",d[a]);var h=f?"changecompleted":"changestarted";d.postMessage(h,{source:b,target:e})}}function t(a){var b,c=[];return a.forEach(function(a){a.transaction||(b=void 0),a.changes.length&&(a.transaction?b?o.appendArray(b,a.changes):(b=o.clone(a.changes),c.push(b)):c.push(a.changes))}),c}var u={changes:[],transaction:l.transaction};l.changes.forEach(function(a){var c=a.path,d=m(c);if("undefined"!=typeof d){var a=o.clone(a);o.extend(a,{source:b,path:d}),n(c,a),p(c,a)}}),f.length||o.defer(r),f.push(u)}return b.onSync("datachanges",k),k}if(this.isOn)return p.warn("data sources are already connected");var b=this._subscriptionPath=new Array(this.depth1||this.depth2).join("*"),c=n.createRegexPath(b),d=this;this.depth1&&(this._link1=a("_link2",this.ds2,this.ds1,this._changesQueue1,this.pathTranslation1,this.patternTranslation1,this.dataTranslation1,this.dataValidation1)),this.depth2&&(this._link2=a("_link1",this.ds1,this.ds2,this._changesQueue2,this.pathTranslation2,this.patternTranslation2,this.dataTranslation2,this.dataValidation2)),this.isOn=!0,this.postMessage("turnedon")}function k(){function a(a,c){b[c]&&(a.off("datachanges",b[c]),delete b[c])}if(!this.isOn)return p.warn("data sources are already disconnected");var b=this;a(this.ds1,"_link2",this.pathTranslation2),a(this.ds2,"_link1",this.pathTranslation1),this.isOn=!1,this.postMessage("turnedoff")}function l(){this.turnOff(),this.postMessage("destroyed"),this._messenger.destroy(),delete this.ds1,delete this.ds2,this._destroyed=!0}var m=a("../messenger"),n=a("./path_utils"),o=a("mol-proto"),p=a("../util/logger");b.exports=c;var q=/^(\<*)\-+(\>*)$/;o.extendProto(c,{turnOn:j,turnOff:k,destroy:l,changeMode:e,deferChangeMode:f})},{"../messenger":101,"../util/logger":119,"./path_utils":115,"mol-proto":123}],110:[function(a,b){"use strict";function c(a,b,d){var f=function(){return e.apply(f,arguments)};return f.__proto__=c.prototype,f._hostObject=b,f._options=d||{},f._options.reactive!==!1&&(f._prepareMessengers(),f.onSync("changedata",p)),a&&(f._data=a),f}function d(){return this._data}function e(a){return a?(u.splice(arguments,0,0,null,this),new(Function.prototype.bind.apply(l,arguments))):this}function f(a){a=a||this._hostObject,t.prototype._createProxyMethods.call(this[w],q.defaultMethods,a)}function g(a,b,d){d=d||x,t.useWith.call(c,a,b,d)}function h(a){a=a||this._hostObject,t.prototype._createProxyMethods.call(this,x,a)}function i(){var a=new q(this,void 0,void 0),b=new r(this,void 0,new s,a),c=new q(this,void 0,b);u.defineProperty(this,w,c),u.defineProperty(this,"_internalMessenger",a)}function j(){return this._hostObject}function k(){this[w].destroy(),this._internalMessenger.destroy(),this._destroyed=!0}{var l=a("./m_path"),m=a("./synthesize"),n=a("./path_utils"),o=a("./model_utils"),p=a("./change_data"),q=a("../messenger"),r=a("../messenger/msngr_source"),s=a("./m_msg_api"),t=a("../abstract/mixin"),u=a("mol-proto"),v=a("../util/check");v.Match,a("../util/logger")}b.exports=c,c.prototype.__proto__=c.__proto__,u.extendProto(c,{path:e,get:d,proxyMessenger:f,proxyMethods:h,_prepareMessengers:i,_getHostObject:j,destroy:k}),u.extendProto(c,m.modelMethods),u.extend(c,{Path:l,useWith:g,_utils:{path:n,model:o,changeDataHandler:p}});var w="_messenger";q.useWith(c,w,q.defaultMethods),["len","push","pop","unshift","shift"].forEach(function(a){var b=l.prototype[a];u.defineProperty(c.prototype,a,b)});var x=["path","get","set","del","splice","len","push","pop","unshift","shift"]},{"../abstract/mixin":98,"../messenger":101,"../messenger/msngr_source":105,"../util/check":117,"../util/logger":119,"./change_data":108,"./m_msg_api":111,"./m_path":112,"./model_utils":113,"./path_utils":115,"./synthesize":116,"mol-proto":123}],111:[function(a,b){"use strict";function c(a){return a instanceof RegExp?a:e.createRegexPath(a)}var d=a("../messenger/m_api_rx"),e=a("./path_utils"),f=a("mol-proto"),g=f.createSubclass(d,"ModelMsgAPI");b.exports=g,f.extendProto(g,{translateToSourceMessage:c})},{"../messenger/m_api_rx":103,"./path_utils":115,"mol-proto":123}],112:[function(a,b){"use strict";function c(a,b){v(b,String);var f=function(){return e.apply(f,arguments)};f.__proto__=c.prototype,u.defineProperties(f,{_model:a,_path:b,_args:u.slice(arguments,1),_options:a._options});var g=p.parseAccessPath(b);u.defineProperty(f,"_accessPath",d(g,f._args)),f._options.reactive!==!1&&(f._prepareMessenger(),f.onSync("changedata",q));var h=o(b,g);return u.defineProperties(f,h),Object.freeze(f),f}function d(a,b){return a.reduce(function(a,c){var d=c.interpolate;return a+(d?"array"==c.syntax?"["+b[d]+"]":"."+b[d]:c.property)},"")}function e(a){if(!a)return this;var b=this._args.length-1;b>0&&(a=a.replace(/\$[1-9][0-9]*/g,function(a){return"$"+(+a.slice(1)+b)}));var d=this._path+a,e=[this._model,d].concat(this._args.slice(1)).concat(u.slice(arguments,1));return u.newApply(c,e)}function f(){return this.path(".length").get()||0}function g(){var a=this.len(),b=a+arguments.length;return u.splice(arguments,0,0,a,0),this.splice.apply(this,arguments),b}function h(){return this.splice(this.len()-1,1)[0]}function i(){var a=this.len();return a+=arguments.length,u.splice(arguments,0,0,0,0),this.splice.apply(this,arguments),a}function j(){return this.splice(0,1)[0]}function k(){var a=new s(this._accessPath),b=new t(this,void 0,a,this._model),c=new r(this,void 0,b);u.defineProperty(this,w,c)}function l(){return{model:this._model,path:this._path,args:this._args}}function m(a){v(a,{model:Function,path:String,args:Array});var b=a.model;return b.apply(b,a.args)}function n(){this[w].destroy()}{var o=a("./synthesize"),p=a("./path_utils"),q=a("./change_data"),r=a("../messenger"),s=a("./path_msg_api"),t=a("../messenger/msngr_source"),u=a("mol-proto"),v=a("../util/check");v.Match}b.exports=c,c.prototype.__proto__=c.__proto__,u.extendProto(c,{path:e,len:f,push:g,pop:h,unshift:i,shift:j,_prepareMessenger:k,_getDefinition:l,destroy:n}),u.extend(c,{_createFromDefinition:m});var w="_messenger";r.useWith(c,w,r.defaultMethods)},{"../messenger":101,"../messenger/msngr_source":105,"../util/check":117,"./change_data":108,"./path_msg_api":114,"./path_utils":115,"./synthesize":116,"mol-proto":123}],113:[function(a,b){"use strict";function c(a,b){return a>b?b:a>=0?a:a+b>0?a+b:0}var d={normalizeSpliceIndex:c};b.exports=d},{}],114:[function(a,b){"use strict";function c(a){g.prototype.init.apply(this,arguments),this.rootPath=a}function d(a){return a instanceof RegExp?a:"datachanges"==a?a:this.rootPath+a +},this);return b}function l(){return this.get(this.getAllKeys())}function m(a){return this.keyPrefix+a}function n(a){return a.indexOf(this._typeSuffix)>=0?void 0:C.unPrefix(a,this.keyPrefix)}function o(a){return a=r.call(this,a),this._storage.getItem(a)}function p(a,b){var c=s(b);return a=r.call(this,a),this._storage.setItem(a,c),c}function q(a){a=r.call(this,a),this._storage.removeItem(a)}function r(a){return a+this._typeSuffix}function s(a){var b=typeof a,c=a&&a.constructor.name,d=I[c];return d||("object"!=b?b:null==a?"null":a.constructor.name)}function t(a,b){b=b||s(a);var c=J[b];return c?c(a,b):a&&a.toString==Object.prototype.toString?JSON.stringify(a):""+a}function u(a,b){var c=K[b];return c?c(a,b):a}function v(a,b,c,d){b&&(J[a]=b),c&&(K[a]=c),I[a]=d||a}function w(){var a=new A(this),b=new z(this,void 0,a);C.defineProperties(this,{_messenger:b,_messageSource:a},C.WRIT)}function x(){this._storage=void 0,this.window=void 0,this._messenger&&this._messenger.destroy(),this._destroyed=!0}{var y=a("milo-core"),z=y.Messenger,A=a("./msg_src"),B=a("../../config"),C=y.proto,D=y.util.check;D.Match}a("./model"),b.exports=c;var E={"true":{},"false":{}};C.extendProto(c,{get:e,set:d,remove:f,hasItem:g,getItem:h,setItem:i,removeItem:j,_storageKey:m,_domStorageKey:n,getAllKeys:k,getAllItems:l,createMessenger:w,destroy:x}),z.useWith(c,"_messenger",z.defaultMethods),A.useWith(c,"_messageSource",["trigger"]);var F=new c("",!0),G=new c("",!1),H={"true":F,"false":G};C.extend(c,{registerDataType:v,local:G,session:F,storage:H,_storedKeys:E});var I={},J={Array:JSON.stringify},K={Object:C.jsonParse,Array:C.jsonParse,Date:function(a){return new Date(a)},"boolean":function(a){return"true"==a},number:Number,"function":C.toFunction,RegExp:C.toRegExp}},{"../../config":64,"./model":90,"./msg_src":91,"milo-core":106}],90:[function(a){"use strict";function b(){var b=a("./index");b.registerDataType("Model",c,d),b.registerDataType("ModelPath",c,d,"Model")}function c(a){var b=a.get();return JSON.stringify(b)}function d(a){var b=g.jsonParse(a);return new f(b)}var e=a("milo-core"),f=e.Model,g=e.proto;f.registerWithDOMStorage=b},{"./index":89,"milo-core":106}],91:[function(a,b){"use strict";function c(a){if("DOMStorage"!=a.constructor.name)throw new Error("hostObject should be an instance of DOMStorage");this.storage=a,this.messageKey=l.domStorage.messageKey,this.window=a.window,j.prototype.init.apply(this,arguments)}function d(){this.window.addEventListener("storage",this,!1)}function e(){this.window.removeEventListener("storage",this,!1)}function f(a,b){this.messenger.postMessageSync(a,b)}function g(a,b){var c=this.messageKey+a;b=b||{},b[l.domStorage.messageTimestamp]=m(),k.deferMethod(this.storage,"setItem",c,b)}function h(a){if(a.storageArea==this.storage._storage){var b=this.storage._domStorageKey(a.key);if(b){var c=k.unPrefix(b,this.messageKey);if(c){var d=this.storage.getItem(b);d&&this.dispatchMessage(c,d)}}}}var i=a("milo-core"),j=i.classes.MessageSource,k=i.proto,l=a("../../config"),m=a("../../util/unique_id"),n=k.createSubclass(j,"StorageMessageSource",!0);k.extendProto(n,{init:c,addSourceSubscriber:d,removeSourceSubscriber:e,postMessage:f,trigger:g,handleEvent:h}),b.exports=n},{"../../config":64,"../../util/unique_id":92,"milo-core":106}],92:[function(a,b){"use strict";function c(){var a=Date.now();return f=""+a,d==a?(e=""===e?0:e+1,f+="_"+e):(d=a,e=""),f}var d=Date.now(),e="",f=""+d;c.get=function(){return f},b.exports=c},{}],93:[function(a,b){"use strict";function c(){var a=new d,b=new e(a,{send:"trigger",connect:"connect"},new f);return a._setMessageSource(b),a}var d=a("milo-core").Messenger,e=a("./msg_src"),f=a("./msg_api");b.exports=c},{"./msg_api":94,"./msg_src":95,"milo-core":106}],94:[function(a,b){"use strict";function c(a){return k.indexOf(a)>=0?a:"message"}function d(a,b,c){if(k.indexOf(b)>=0)return!0;if("message"==a){var d=c&&c.type;return d==b}}function e(a,b,c){var d="message"==a?h.jsonParse(c.data)||c.data:c;return d}var f=a("milo-core"),g=f.classes.MessengerAPI,h=f.proto,i=f.util.check,j=(i.Match,h.createSubclass(g,"WSMsgAPI",!0));h.extendProto(j,{translateToSourceMessage:c,filterSourceMessage:d,createInternalData:e}),b.exports=j;var k=["open","close","error","message"]},{"milo-core":106}],95:[function(a,b){"use strict";function c(a){this._options=a=a||{};var b=a.host||window.location.host.replace(/:.*/,""),c=a.port||"8080";this._ws&&(this._ws.onopen=this.ws.onmessage=this.ws.onclose=this.ws.onerror=void 0,this._ws.close()),this._ws=new WebSocket("ws://"+b+":"+c)}function d(a){f.call(this,"addEventListener",a)}function e(a){f.call(this,"removeEventListener",a)}function f(a,b){return this._ws?void this._ws[a](b,this):l.error("websocket is not created")}function g(a){this.dispatchMessage(a.type,a)}function h(a,b,c){function d(){f("off",b.callbackCorrId),c(new Error("websocket rpc: timeout"))}function e(a,b){if(clearInterval(h),"object"==typeof b){var d=b.error?new Error(b.error):null;c(d,b.data)}else c(new Error("websocket rpc: invalid response data"),b)}function f(a,b){g.messenger[a](n.websocket.rpc.responsePrefix+b,e)}if(!this._ws)return l.error("websocket is not created");b=b||{},b.type=a;var g=this;if(c){b.callbackCorrId=m();var h=k.delay(d,n.websocket.rpc.timeout);f("once",b.callbackCorrId)}this._ws.send(JSON.stringify(b))}var i=a("milo-core"),j=i.classes.MessageSource,k=i.proto,l=i.util.logger,m=a("../../util/unique_id"),n=a("../../config"),o=i.util.check,p=(o.Match,k.createSubclass(j,"WSMessageSource",!0));k.extendProto(p,{addSourceSubscriber:d,removeSourceSubscriber:e,handleEvent:g,connect:c,trigger:h}),b.exports=p},{"../../config":64,"../../util/unique_id":92,"milo-core":106}],96:[function(a,b){!function(){function a(){var a=0,b=0;this.output="",this.readByte=function(c){return"string"==typeof c&&(c=c.charCodeAt(0)),0>a?b|=c>>-a:b=c<3?(a-=8,1):(4>a&&(this.output+=f[b>>3],a+=5),0)},this.finish=function(c){var d=this.output+(0>a?f[b>>3]:"")+(c?"$":"");return this.output="",d}}function c(){var a=0,b=0;this.output="",this.readChar=function(c){"string"!=typeof c&&"number"==typeof c&&(c=String.fromCharCode(c)),c=c.toLowerCase();var d=h()[c];"undefined"!=typeof d&&(d<<=3,b|=d>>>a,a+=5,a>=8&&(this.output+=String.fromCharCode(b),a-=8,b=a>0?d<<5-a&255:0))},this.finish=function(b){var c=this.output+(0>a?f[bits>>3]:"")+(b?"$":"");return this.output="",c}}function d(b){var c=new a,d=c.update(b,!0);return d}function e(a){var b=new c,d=b.update(a,!0);return d}var f="0123456789abcdefghjkmnpqrtuvwxyz",g={o:0,i:1,l:1,s:5},h=function(){for(var a={},b=0;b=h){var i=a.__messages;this.off(i,a)}else h>1&&a.options.dispatchTimes--;g?a.subscriber.call(a.context,b,c,d):I.deferMethod(a.subscriber,"call",a.context,b,c,d)}function C(a,b){J(a,K.OneOf(String,RegExp));var c=this._chooseSubscribersHash(a),d=c[a]?[].concat(c[a]):[];return b!==!1&&"string"==typeof a&&I.eachKey(this._patternMessageSubscribers,function(b){var c=b.pattern;b&&b.length&&c.test(a)&&I.appendArray(d,b)}),d.length?d:void 0}function D(a){return a instanceof RegExp?this._patternMessageSubscribers:this._messageSubscribers}function E(a){J(a,H),I.defineProperty(this,"_messageSource",a),a.messenger=this}function F(){return this._messageSource}var G=a("../abstract/mixin"),H=a("./m_source"),I=a("mol-proto"),J=a("../util/check"),K=J.Match,L=I.createSubclass(G,"Messenger"),M=L.messagesSplitRegExp=/\s*(?:\,|\s)\s*/;I.extendProto(L,{init:c,destroy:e,on:f,once:g,onceSync:h,onSync:i,onAsync:j,onMessage:f,off:q,offMessage:q,onMessages:p,offMessages:u,offAll:v,postMessage:x,postMessageSync:y,getSubscribers:C,getMessageSource:F,_chooseSubscribersHash:D,_registerSubscriber:n,_removeSubscriber:s,_removeAllSubscribers:t,_callPatternSubscribers:z,_callSubscribers:A,_callSubscriber:B,_setMessageSource:E}),L.defaultMethods={on:"on",onSync:"onSync",once:"once",onceSync:"onceSync",off:"off",onMessages:"onMessages",offMessages:"offMessages",postMessage:"postMessage",postMessageSync:"postMessageSync",getSubscribers:"getSubscribers"},b.exports=L,L.subscriptions=[]},{"../abstract/mixin":98,"../util/check":117,"./m_source":104,"mol-proto":123}],102:[function(a,b){"use strict";function c(){this.init&&this.init.apply(this,arguments)}function d(){l.defineProperty(this,"_internalMessages",{})}function e(){}function f(a){var b,c=this.translateToSourceMessage(a);if("undefined"!=typeof c)return this._internalMessages.hasOwnProperty(c)?(b=this._internalMessages[c],void(-1==b.indexOf(a)?b.push(a):m.warn("Duplicate addInternalMessage call for internal message "+a))):(b=this._internalMessages[c]=[],b.push(a),c)}function g(a){function b(){m.warn("notification received: un-subscribe from internal message "+a+" without previous subscription notification")}var c=this.translateToSourceMessage(a);if("undefined"!=typeof c){var d=this._internalMessages[c];if(d&&d.length){var e=d.indexOf(a);if(e>=0){if(d.splice(e,1),0==d.length)return delete this._internalMessages[c],c}else b()}else b()}}function h(a){return this._internalMessages[a]}function i(a){return a}function j(a,b,c){return c}function k(){return!0}var l=a("mol-proto"),m=a("../util/logger");b.exports=c,l.extendProto(c,{init:d,destroy:e,addInternalMessage:f,removeInternalMessage:g,getInternalMessages:h,translateToSourceMessage:i,createInternalData:j,filterSourceMessage:k})},{"../util/logger":119,"mol-proto":123}],103:[function(a,b){"use strict";function c(){g.prototype.init.apply(this,arguments),h.defineProperties(this,{_patternInternalMessages:{}}),this._catchAllSubscribed=!1}function d(){var a=g.prototype.addInternalMessage.apply(this,arguments);if(a&&a instanceof RegExp){if(this._internalMessages[a].pattern=a,this._patternInternalMessages[a]=this._internalMessages[a],this._catchAllSubscribed)return;return this._catchAllSubscribed=!0,/.*/}return a}function e(){var a=g.prototype.removeInternalMessage.apply(this,arguments);if(a&&a instanceof RegExp){delete this._patternInternalMessages[a];var b=!Object.keys(this._patternInternalMessages).length;if(b)return this._catchAllSubscribed=!1,/.*/}return a}function f(a){var b=g.prototype.getInternalMessages.apply(this,arguments);if("string"==typeof a){b=b||[];var c=h.object(b,!0);h.eachKey(this._patternInternalMessages,function(d){var e=d.pattern;e.test(a)&&d.forEach(function(a){c[a]||(b.push(a),c[a]=!0)})})}return b}var g=a("./m_api"),h=a("mol-proto"),i=h.createSubclass(g,"MessengerRegexpAPI");b.exports=i,h.extendProto(i,{init:c,addInternalMessage:d,removeInternalMessage:e,getInternalMessages:f})},{"./m_api":102,"mol-proto":123}],104:[function(a,b){"use strict";function c(a,b,c){this._prepareMessengerAPI(c)}function d(){this.messengerAPI&&this.messengerAPI.destroy()}function e(a){n.defineProperty(this,"messenger",a)}function f(a){o(a,p.Optional(m)),a||(a=new m),n.defineProperty(this,"messengerAPI",a)}function g(a){var b=this.messengerAPI.addInternalMessage(a);"undefined"!=typeof b&&this.addSourceSubscriber(b)}function h(a){var b=this.messengerAPI.removeInternalMessage(a);"undefined"!=typeof b&&this.removeSourceSubscriber(b)}function i(a,b){var c=this.messengerAPI,d=c.getInternalMessages(a);d&&d.forEach(function(d){var e=c.createInternalData(a,d,b),f=c.filterSourceMessage(a,d,e);f&&this.postMessage(d,e)},this)}function j(a,b){this.messenger.postMessage(a,b)}function k(){throw new Error("calling the method of an absctract class")}var l=a("../abstract/mixin"),m=a("./m_api"),n=(a("../util/logger"),a("mol-proto")),o=a("../util/check"),p=o.Match,q=n.createSubclass(l,"MessageSource",!0);b.exports=q,n.extendProto(q,{init:c,destroy:d,setMessenger:e,onSubscriberAdded:g,onSubscriberRemoved:h,dispatchMessage:i,postMessage:j,_prepareMessengerAPI:f,trigger:k,addSourceSubscriber:k,removeSourceSubscriber:k})},{"../abstract/mixin":98,"../util/check":117,"../util/logger":119,"./m_api":102,"mol-proto":123}],105:[function(a,b){"use strict";function c(a,b,c,d){g.prototype.init.apply(this,arguments),this.sourceMessenger=d}function d(a){this.sourceMessenger.onSync(a,{context:this,subscriber:this.dispatchMessage})}function e(a){this.sourceMessenger.off(a,{context:this,subscriber:this.dispatchMessage})}function f(a,b){this.messenger.postMessageSync(a,b)}var g=a("./m_source"),h=a("mol-proto"),i=(a("../util/check"),h.createSubclass(g,"MessengerMessageSource"));b.exports=i,h.extendProto(i,{init:c,addSourceSubscriber:d,removeSourceSubscriber:e,postMessage:f})},{"../util/check":117,"./m_source":104,"mol-proto":123}],106:[function(a,b){"use strict";function c(){e.minder.destroy()}var d=a("mol-proto"),e={minder:a("./minder"),config:a("./config"),util:a("./util"),classes:a("./classes"),Messenger:a("./messenger"),Model:a("./model"),destroy:c,proto:d};"object"==typeof b&&b.exports&&(b.exports=e),"object"==typeof window&&(window.milo=e)},{"./classes":99,"./config":100,"./messenger":101,"./minder":107,"./model":110,"./util":118,"mol-proto":123}],107:[function(a,b){"use strict";function c(a,b,c,e){if(Array.isArray(a)){var f=a,g=f.map(function(a){return new p(a[0],a[1],a[2],a[3])});return g.forEach(d),g}var h=new p(a,b,c,e);return d(h),h}function d(a){a.___minder_id=u.push(a)-1,a.on(/.*/,e),c.postMessage("added",{connector:a}),c.postMessage("turnedon",{connector:a})}function e(a,b){var b=b?r.clone(b):{};r.extend(b,{id:this.___minder_id,connector:this}),c.postMessage(a,b),v.length||w||(r.defer(f),w=!0),v.push({msg:a,data:b})}function f(){v.length?(v.length=0,r.defer(f),c.postMessage("propagationticked")):(w=!1,c.postMessage("propagationcompleted"))}function g(){return w}function h(a){function b(){w?c.once("propagationcompleted",b):a()}w?c.once("propagationcompleted",b):r.defer(b)}function i(a){return"undefined"==typeof a?u:u.filter(function(b){return b.isOn===a})}function j(a){a.destroy();var b=u.indexOf(a);b>=0?delete u[b]:s.warn("minder: connector destroyed that is not registered in minder")}function k(a,b){var d=c.getConnectors(a),e=d.map(function(a){var b={leftSource:l(a.ds1),rightSource:l(a.ds2),mode:a.mode,isOn:a.isOn};return a.options&&(b.options=a.options),b});return b&&(e=e.filter(function(a){return m(a.leftSource,b)||m(a.rightSource,b)})),e}function l(a){var b=[];return"function"==typeof a&&(a._model&&a._accessPath&&(b.unshift(a._accessPath),a=a._model),b.unshift(a),a=a._hostObject),"object"==typeof a&&(b.unshift(a),a.owner&&b.unshift(a.owner)),b}function m(a,b){return a.some(function(a){var c=a.constructor&&a.constructor.name;return n(c,b)||n(a.name,b)||n(a,b)})}function n(a,b){return a&&"string"==typeof a&&a.indexOf(b)>=0}function o(){function a(a){a&&!a._destroyed&&a.destroy()}u.forEach(function(b){a(b.ds1),a(b.ds2),b.destroy()}),t.destroy(),c._destroyed=!0}var p=a("./model/connector"),q=a("./messenger"),r=a("mol-proto"),s=a("./util/logger");b.exports=c;var t=new q(c,q.defaultMethods),u=[],v=[],w=!1;r.extend(c,{getConnectors:i,getExpandedConnections:k,isPropagating:g,whenPropagationCompleted:h,destroyConnector:j,destroy:o})},{"./messenger":101,"./model/connector":109,"./util/logger":119,"mol-proto":123}],108:[function(a,b){"use strict";function c(a,b){r.defineProperty(a,"__inChangeTransaction",b,r.CONF|r.WRIT)}function d(a){var b=a.__inChangeTransaction;return delete a.__inChangeTransaction,b}function e(a,b){var e=d(a);return c(b,e),e}function f(){this.postMessageSync("datachanges",{transaction:!1,changes:[]})}function g(a,b,c){h.call(this,b.changes,c)}function h(a,b){i.call(this,b,!1),l.call(this,k(j(a))),i.call(this,b,!0)}function i(a,b){a&&a(null,b),this.postMessage(b?"changecompleted":"changestarted")}function j(a){var b=a[0].source,c=!0;if(a.length>1)for(var d=1,e=a.length;e>d;d++)a[d].source!=b&&(o.error("changedata: changes from different sources in the same transaction, sources:",a[d].source.name,b.name),c=!1,b=a[d].source);return a}function k(a){function b(a){("splice"==a.type?c:d)(a)}function c(a){var b=q.parseAccessPath(a.path),c=i.some(function(a){return b.length"]});var l=e.dataValidation;l&&o.extend(this,{dataValidation1:l["<-"],dataValidation2:l["->"]})}this.turnOn()}function d(a){function b(){throw new Error("invalid Connector mode: "+a)}var c=a.match(q);c||b();var d=c[1].length,e=c[2].length;d&&e&&d!=e&&b(),d||e||b(),o.extend(this,{mode:a,depth1:d,depth2:e})}function e(a){return this.turnOff(),d.call(this,a),this.turnOn(),this}function f(a){return o.deferMethod(this,"changeMode",a),this}function g(a){var b={};return o.eachKey(a,function(a,c){b[a]=c}),b}function h(a){function b(a,b){throw new Error("Invalid pattern translation: "+a+", "+b)}function c(a){return a.replace(/[\.\[]?\*.*$/,"")}var d=[];return o.eachKey(a,function(e,f){var g=f.indexOf("*"),h=e.indexOf("*");g>=0&&h>=0?(f.slice(g)!=e.slice(h)&&b(f,e),delete a[f],d.push({fromPattern:n.createRegexPath(f),fromStaticPath:c(f,g),toPattern:n.createRegexPath(e),toStaticPath:c(e,h)})):(g>=0||h>=0)&&b(f,e)}),d}function i(a){return a.map(function(a){return{fromPattern:a.toPattern,fromStaticPath:a.toStaticPath,toPattern:a.fromPattern,toStaticPath:a.fromStaticPath}})}function j(){function a(a,b,e,f,g,h,i,j){function k(k,l){function m(a){if(g){var b=g[a];if(b)return b;if(!h.length)return;var d=o.find(h,function(b){return b.fromPattern.test(a)});if(!d)return;var b=a.replace(d.fromStaticPath,d.toStaticPath)}else if(!(c instanceof RegExp&&c.test(a)||c==a))return;return b||a}function n(a,b){if(i){var c=i[a];c&&"function"==typeof c&&(b.oldValue=c(b.oldValue),b.newValue=c(b.newValue))}}function p(a,c){function d(d){d(c.newValue,function(c,d){d.path=a,g||!c&&!d.valid||++f!=e.length?d.valid||(g=!0,b.postMessage("validated",d)):b.postMessage("validated",d)})}if(q(c),j){var e=j[a],f=0,g=!1;e&&e.forEach(d)}}function q(a){u.changes.push(a)}function r(){if(d[a])var b=s;var c=t(f);f.length=0,c.forEach(function(a){e.postMessageSync("changedata",{changes:a},b)})}function s(c,f){if(!c){var g=f?"onSync":"off";e[g]("datachanges",d[a]);var h=f?"changecompleted":"changestarted";d.postMessage(h,{source:b,target:e})}}function t(a){var b,c=[];return a.forEach(function(a){a.transaction||(b=void 0),a.changes.length&&(a.transaction?b?o.appendArray(b,a.changes):(b=o.clone(a.changes),c.push(b)):c.push(a.changes))}),c}var u={changes:[],transaction:l.transaction};l.changes.forEach(function(a){var c=a.path,d=m(c);if("undefined"!=typeof d){var a=o.clone(a);o.extend(a,{source:b,path:d}),n(c,a),p(c,a)}}),f.length||o.defer(r),f.push(u)}return b.onSync("datachanges",k),k}if(this.isOn)return p.warn("data sources are already connected");var b=this._subscriptionPath=new Array(this.depth1||this.depth2).join("*"),c=n.createRegexPath(b),d=this;this.depth1&&(this._link1=a("_link2",this.ds2,this.ds1,this._changesQueue1,this.pathTranslation1,this.patternTranslation1,this.dataTranslation1,this.dataValidation1)),this.depth2&&(this._link2=a("_link1",this.ds1,this.ds2,this._changesQueue2,this.pathTranslation2,this.patternTranslation2,this.dataTranslation2,this.dataValidation2)),this.isOn=!0,this.postMessage("turnedon")}function k(){function a(a,c){b[c]&&(a.off("datachanges",b[c]),delete b[c])}if(!this.isOn)return p.warn("data sources are already disconnected");var b=this;a(this.ds1,"_link2",this.pathTranslation2),a(this.ds2,"_link1",this.pathTranslation1),this.isOn=!1,this.postMessage("turnedoff")}function l(){this.turnOff(),this.postMessage("destroyed"),this._messenger.destroy(),delete this.ds1,delete this.ds2,this._destroyed=!0}var m=a("../messenger"),n=a("./path_utils"),o=a("mol-proto"),p=a("../util/logger");b.exports=c;var q=/^(\<*)\-+(\>*)$/;o.extendProto(c,{turnOn:j,turnOff:k,destroy:l,changeMode:e,deferChangeMode:f})},{"../messenger":101,"../util/logger":119,"./path_utils":115,"mol-proto":123}],110:[function(a,b){"use strict";function c(a,b,d){var f=function(){return e.apply(f,arguments)};return f.__proto__=c.prototype,f._hostObject=b,f._options=d||{},f._options.reactive!==!1&&(f._prepareMessengers(),f.onSync("changedata",p)),a&&(f._data=a),f}function d(){return this._data}function e(a){return a?(u.splice(arguments,0,0,null,this),new(Function.prototype.bind.apply(l,arguments))):this}function f(a){a=a||this._hostObject,t.prototype._createProxyMethods.call(this[w],q.defaultMethods,a)}function g(a,b,d){d=d||x,t.useWith.call(c,a,b,d)}function h(a){a=a||this._hostObject,t.prototype._createProxyMethods.call(this,x,a)}function i(){var a=new q(this,void 0,void 0),b=new r(this,void 0,new s,a),c=new q(this,void 0,b);u.defineProperty(this,w,c),u.defineProperty(this,"_internalMessenger",a)}function j(){return this._hostObject}function k(){this[w].destroy(),this._internalMessenger.destroy(),this._destroyed=!0}{var l=a("./m_path"),m=a("./synthesize"),n=a("./path_utils"),o=a("./model_utils"),p=a("./change_data"),q=a("../messenger"),r=a("../messenger/msngr_source"),s=a("./m_msg_api"),t=a("../abstract/mixin"),u=a("mol-proto"),v=a("../util/check");v.Match,a("../util/logger")}b.exports=c,c.prototype.__proto__=c.__proto__,u.extendProto(c,{path:e,get:d,proxyMessenger:f,proxyMethods:h,_prepareMessengers:i,_getHostObject:j,destroy:k}),u.extendProto(c,m.modelMethods),u.extend(c,{Path:l,useWith:g,_utils:{path:n,model:o,changeDataHandler:p}});var w="_messenger";q.useWith(c,w,q.defaultMethods),["len","push","pop","unshift","shift"].forEach(function(a){var b=l.prototype[a];u.defineProperty(c.prototype,a,b)});var x=["path","get","set","del","splice","len","push","pop","unshift","shift"]},{"../abstract/mixin":98,"../messenger":101,"../messenger/msngr_source":105,"../util/check":117,"../util/logger":119,"./change_data":108,"./m_msg_api":111,"./m_path":112,"./model_utils":113,"./path_utils":115,"./synthesize":116,"mol-proto":123}],111:[function(a,b){"use strict";function c(a){return a instanceof RegExp?a:e.createRegexPath(a)}var d=a("../messenger/m_api_rx"),e=a("./path_utils"),f=a("mol-proto"),g=f.createSubclass(d,"ModelMsgAPI");b.exports=g,f.extendProto(g,{translateToSourceMessage:c})},{"../messenger/m_api_rx":103,"./path_utils":115,"mol-proto":123}],112:[function(a,b){"use strict";function c(a,b){v(b,String);var f=function(){return e.apply(f,arguments)};f.__proto__=c.prototype,u.defineProperties(f,{_model:a,_path:b,_args:u.slice(arguments,1),_options:a._options});var g=p.parseAccessPath(b);u.defineProperty(f,"_accessPath",d(g,f._args)),f._options.reactive!==!1&&(f._prepareMessenger(),f.onSync("changedata",q));var h=o(b,g);return u.defineProperties(f,h),Object.freeze(f),f}function d(a,b){return a.reduce(function(a,c){var d=c.interpolate;return a+(d?"array"==c.syntax?"["+b[d]+"]":"."+b[d]:c.property)},"")}function e(a){if(!a)return this;var b=this._args.length-1;b>0&&(a=a.replace(/\$[1-9][0-9]*/g,function(a){return"$"+(+a.slice(1)+b)}));var d=this._path+a,e=[this._model,d].concat(this._args.slice(1)).concat(u.slice(arguments,1));return u.newApply(c,e)}function f(){return this.path(".length").get()||0}function g(){var a=this.len(),b=a+arguments.length;return u.splice(arguments,0,0,a,0),this.splice.apply(this,arguments),b}function h(){return this.splice(this.len()-1,1)[0]}function i(){var a=this.len();return a+=arguments.length,u.splice(arguments,0,0,0,0),this.splice.apply(this,arguments),a}function j(){return this.splice(0,1)[0]}function k(){var a=new s(this._accessPath),b=new t(this,void 0,a,this._model),c=new r(this,void 0,b);u.defineProperty(this,w,c)}function l(){return{model:this._model,path:this._path,args:this._args}}function m(a){v(a,{model:Function,path:String,args:Array});var b=a.model;return b.apply(b,a.args)}function n(){this[w].destroy()}{var o=a("./synthesize"),p=a("./path_utils"),q=a("./change_data"),r=a("../messenger"),s=a("./path_msg_api"),t=a("../messenger/msngr_source"),u=a("mol-proto"),v=a("../util/check");v.Match}b.exports=c,c.prototype.__proto__=c.__proto__,u.extendProto(c,{path:e,len:f,push:g,pop:h,unshift:i,shift:j,_prepareMessenger:k,_getDefinition:l,destroy:n}),u.extend(c,{_createFromDefinition:m});var w="_messenger";r.useWith(c,w,r.defaultMethods)},{"../messenger":101,"../messenger/msngr_source":105,"../util/check":117,"./change_data":108,"./path_msg_api":114,"./path_utils":115,"./synthesize":116,"mol-proto":123}],113:[function(a,b){"use strict";function c(a,b){return a>b?b:a>=0?a:a+b>0?a+b:0}var d={normalizeSpliceIndex:c};b.exports=d},{}],114:[function(a,b){"use strict";function c(a){g.prototype.init.apply(this,arguments),this.rootPath=a}function d(a){return a instanceof RegExp?a:"datachanges"==a?a:this.rootPath+a }function e(a,b,c){if("datachanges"==b){var d=c.changes.map(f,this).filter(function(a){return a}),e={changes:d,transaction:c.transaction};return e}var e=f.call(this,c);return e}function f(a){var b=a.path,c=h.unPrefix(b,this.rootPath);if("string"==typeof c){var a=h.clone(a);return a.fullPath=b,a.path=c,a}}var g=a("../messenger/m_api"),h=(a("./path_utils"),a("../util/logger"),a("mol-proto")),i=h.createSubclass(g,"ModelPathMsgAPI");b.exports=i,h.extendProto(i,{init:c,translateToSourceMessage:d,createInternalData:e})},{"../messenger/m_api":102,"../util/logger":119,"./path_utils":115,"mol-proto":123}],115:[function(a,b){"use strict";function c(a,b){b=b||t;var c=[];if(!a)return c;var d=a.replace(b,function(a){var b={property:a};return i.extend(b,w[a[0]]),"$"==a[1]&&(b.interpolate=e(b,!0)),c.push(b),""});if(d)throw new Error("incorrect model path: "+a);return c}function d(a){if(g(a,h.OneOf(String,RegExp)),a instanceof RegExp||-1==a.indexOf("*"))return a;var b=j.parseAccessPath(a,v),c="^",d=!1;b.forEach(function(a){var b=a.property,e=x[b];e?(c+="("+e+"|)",d=!0):c+=b.replace(/(\.|\[|\])/g,"\\$1")}),c+="$";try{return new RegExp(c)}catch(e){throw new Error("can't construct regex for path pattern: "+a)}}function e(a,b){var c=a.property,d=b?2:1;return"array"==a.syntax?c.slice(d,c.length-1):c.slice(d)}function f(a){a=a||["on","off"];var b=i.mapToObject(a,function(a){var b=this[a];return function(a,c){var e=d(a);b.call(this,e,c)}},this);i.defineProperties(this,b)}var g=a("../util/check"),h=g.Match,i=a("mol-proto"),j={parseAccessPath:c,createRegexPath:d,getPathNodeKey:e,wrapMessengerMethods:f};b.exports=j;var k="\\.[A-Za-z_-][A-Za-z0-9_-]*",l="\\[[0-9]+\\]",m="\\$[1-9][0-9]*",n="\\."+m,o="\\["+m+"\\]",p="\\.\\*",q="\\[\\*\\]",r="\\*",s=[k,l,n,o].join("|"),t=new RegExp(s,"g"),u=[s,p,q,r].join("|"),v=new RegExp(u,"g"),w={".":{syntax:"object",empty:"{}"},"[":{syntax:"array",empty:"[]"},"*":{syntax:"match",empty:"{}"}},x={".*":k,"[*]":l};x["*"]=x[".*"]+"|"+x["[*]"]},{"../util/check":117,"mol-proto":123}],116:[function(require,module,exports){"use strict";function _synthesizePathMethods(a,b){var c=_.mapKeys(synthesizers,function(c){return _synthesize(c,a,b)});return c}function _synthesize(synthesizer,path,parsedPath){function addChangeMessage(a,b,c){a.push(c),b[c.path]=c}function addTreeChangesMessages(a,b,c,d,e){var f=valueIsTree(d),g=valueIsTree(e);g&&addMessages(a,b,c,e,"added","newValue"),f&&addMessages(a,b,c,d,"removed","oldValue")}function addMessages(a,b,c,d,e,f){function g(a,b){if(Array.isArray(b)){var c=a+"[$$]";b.forEach(function(a,b){h(a,b,c)})}else{var c=a+".$$";_.eachKey(b,function(a,b){h(a,b,c)})}}function h(c,d,h){var i=h.replace("$$",d),j=b[i];if(j)j.type==e?logger.error("setter error: same message type posted on the same path"):(j.type="changed",j[f]=c);else{var k={path:i,type:e};k[f]=c,addChangeMessage(a,b,k)}valueIsTree(c)&&g(i,c)}g(c,d)}function cloneTree(a){return valueIsNormalObject(a)?_.deepClone(a):a}function protectValue(a){return valueIsNormalObject(a)?Array.isArray(a)?a.slice():Object.create(a):a}function valueIsTree(a){return valueIsNormalObject(a)&&Object.keys(a).length}function valueIsNormalObject(a){return!(null==a||"object"!=typeof a||a instanceof Date||a instanceof RegExp)}function addBatchIdsToMessage(a,b,c){_.defineProperties(a,{__batch_id:b,__msg_id:c})}var method,methodCode=synthesizer({parsedPath:parsedPath,getPathNodeKey:pathUtils.getPathNodeKey});try{eval(methodCode)}catch(e){throw ModelError("ModelPath method compilation error; path: "+path+", code: "+methodCode)}return method}var pathUtils=require("../path_utils"),modelUtils=require("../model_utils"),logger=require("../../util/logger"),fs=require("fs"),doT=require("dot"),_=require("mol-proto"),changeDataHandler=require("../change_data"),getTransactionFlag=changeDataHandler.getTransactionFlag,postTransactionFinished=changeDataHandler.postTransactionFinished,templates={get:"'use strict';\n/* Only use this style of comments, not \"//\" */\n\nmethod = function get() {\n var m = {{# def.modelAccessPrefix }};\n return m {{~ it.parsedPath :pathNode }}\n {{? pathNode.interpolate}}\n && (m = m[this._args[ {{= pathNode.interpolate }} ]])\n {{??}}\n && (m = m{{= pathNode.property }})\n {{?}} {{~}};\n};\n",set:"'use strict';\n/* Only use this style of comments, not \"//\" */\n\n{{# def.include_defines }}\n{{# def.include_create_tree }}\n\n\n/**\n * Template that synthesizes setter for Model and for ModelPath\n */\nmethod = function set(value) {\n {{# def.initVars:'set' }}\n\n {{# def.createTree:'set' }}\n\n {{\n currNode = nextNode;\n currProp = currNode && currNode.property;\n }}\n\n {{ /* assign value to the last property */ }}\n {{? currProp }}\n wasDef = {{# def.wasDefined}};\n {{# def.changeAccessPath }}\n\n var old = m{{# def.currProp }};\n\n {{ /* clone value to prevent same reference in linked models */ }}\n m{{# def.currProp }} = cloneTree(value);\n {{?}}\n\n {{ /* add message related to the last property change */ }}\n if (this._options.reactive !== false) {\n if (! wasDef)\n {{# def.addMsg }} accessPath, type: 'added',\n newValue: value });\n else if (old != value)\n {{# def.addMsg }} accessPath, type: 'changed',\n oldValue: old, newValue: value });\n\n {{ /* add message related to changes in (sub)properties inside removed and assigned value */ }}\n if (! wasDef || old != value)\n addTreeChangesMessages(messages, messagesHash,\n accessPath, old, value); /* defined in the function that synthesizes ModelPath setter */\n\n {{ /* post all stored messages */ }}\n {{# def.postMessages }}\n }\n};\n",del:"'use strict';\n/* Only use this style of comments, not \"//\" */\n\n{{# def.include_defines }}\n{{# def.include_traverse_tree }}\n\nmethod = function del() {\n {{# def.initVars:'del' }}\n\n {{? it.parsedPath.length }}\n {{# def.traverseTree }}\n\n {{\n var currNode = it.parsedPath[count];\n var currProp = currNode.property; \n }}\n\n if (! treeDoesNotExist && m && m.hasOwnProperty && {{# def.wasDefined}}) {\n var old = m{{# def.currProp }};\n delete m{{# def.currProp }};\n {{# def.changeAccessPath }}\n var didDelete = true;\n }\n {{??}}\n if (typeof m != 'undefined') {\n var old = m;\n {{# def.modelAccessPrefix }} = undefined;\n var didDelete = true;\n }\n {{?}}\n\n if (didDelete && this._options.reactive !== false) {\n {{# def.addMsg }} accessPath, type: 'deleted', oldValue: old });\n\n addTreeChangesMessages(messages, messagesHash,\n accessPath, old, undefined); /* defined in the function that synthesizes ModelPath setter */\n\n {{ /* post all stored messages */ }}\n {{# def.postMessages }}\n }\n};\n",splice:"'use strict';\n/* Only use this style of comments, not \"//\" */\n\n{{# def.include_defines }}\n{{# def.include_create_tree }}\n{{# def.include_traverse_tree }}\n\nmethod = function splice(spliceIndex, spliceHowMany) { /* ,... - extra arguments to splice into array */\n {{# def.initVars:'splice' }}\n\n var argsLen = arguments.length;\n var addItems = argsLen > 2;\n\n if (addItems) {\n {{ /* only create model tree if items are inserted in array */ }}\n\n {{ /* if model is undefined it will be set to an empty array */ }} \n var value = [];\n {{# def.createTree:'splice' }}\n\n {{? nextNode }}\n {{\n var currNode = nextNode;\n var currProp = currNode.property;\n var emptyProp = '[]';\n }}\n\n {{# def.createTreeStep }}\n {{?}}\n\n } else if (spliceHowMany > 0) {\n {{ /* if items are not inserted, only traverse model tree if items are deleted from array */ }}\n {{? it.parsedPath.length }}\n {{# def.traverseTree }}\n\n {{\n var currNode = it.parsedPath[count];\n var currProp = currNode.property; \n }}\n\n {{ /* extra brace closes 'else' in def.traverseTreeStep */ }}\n {{# def.traverseTreeStep }} }\n {{?}}\n }\n\n {{ /* splice items */ }}\n if (addItems || (! treeDoesNotExist && m\n && m.length > spliceIndex ) ) {\n var oldLength = m.length = m.length || 0;\n\n arguments[0] = spliceIndex = normalizeSpliceIndex(spliceIndex, m.length);\n\n {{ /* clone added arguments to prevent same references in linked models */ }}\n if (addItems)\n for (var i = 2; i < argsLen; i++)\n arguments[i] = cloneTree(arguments[i]);\n\n {{ /* actual splice call */ }}\n var removed = Array.prototype.splice.apply(m, arguments);\n\n if (this._options.reactive !== false) {\n {{# def.addMsg }} accessPath, type: 'splice',\n index: spliceIndex, removed: removed, addedCount: addItems ? argsLen - 2 : 0,\n newValue: m });\n\n if (removed && removed.length)\n removed.forEach(function(item, index) {\n var itemPath = accessPath + '[' + (spliceIndex + index) + ']';\n {{# def.addMsg }} itemPath, type: 'removed', oldValue: item });\n\n if (valueIsTree(item))\n addMessages(messages, messagesHash, itemPath, item, 'removed', 'oldValue');\n });\n\n if (addItems)\n for (var i = 2; i < argsLen; i++) {\n var item = arguments[i];\n var itemPath = accessPath + '[' + (spliceIndex + i - 2) + ']';\n {{# def.addMsg }} itemPath, type: 'added', newValue: item });\n\n if (valueIsTree(item))\n addMessages(messages, messagesHash, itemPath, item, 'added', 'newValue');\n }\n\n {{ /* post all stored messages */ }}\n {{# def.postMessages }}\n }\n }\n\n return removed || [];\n}\n"},include_defines="'use strict';\n/* Only use this style of comments, not \"//\" */\n\n/**\n * Inserts initialization code\n */\n {{## def.initVars:method:\n var m = {{# def.modelAccessPrefix }};\n var messages = [], messagesHash = {};\n var accessPath = '';\n var treeDoesNotExist;\n /* hack to prevent sending finished events to allow for propagation of batches without splitting them */\n var inChangeTransaction = getTransactionFlag( {{= method }} );\n #}}\n\n/**\n * Inserts the beginning of function call to add message to list\n */\n{{## def.addMsg: addChangeMessage(messages, messagesHash, { path: #}}\n\n/**\n * Inserts current property/index for both normal and interpolated properties/indexes\n */\n{{## def.currProp:{{? currNode.interpolate }}[this._args[ {{= currNode.interpolate }} ]]{{??}}{{= currProp }}{{?}} #}}\n\n/**\n * Inserts condition to test whether normal/interpolated property/index exists\n */\n{{## def.wasDefined: m.hasOwnProperty(\n {{? currNode.interpolate }}\n this._args[ {{= currNode.interpolate }} ]\n {{??}}\n '{{= it.getPathNodeKey(currNode) }}'\n {{?}}\n) #}}\n\n\n/**\n * Inserts code to update access path for current property\n * Because of the possibility of interpolated properties, it can't be calculated in template, it can only be calculated during accessor call.\n */\n{{## def.changeAccessPath:\n accessPath += {{? currNode.interpolate }}\n {{? currNode.syntax == 'array' }}\n '[' + this._args[ {{= currNode.interpolate }} ] + ']';\n {{??}}\n '.' + this._args[ {{= currNode.interpolate }} ];\n {{?}}\n {{??}}\n '{{= currProp }}';\n {{?}}\n#}}\n\n\n/**\n * Inserts code to post stored messages\n */\n{{## def.postMessages:\n if (messages.length) {\n {{# def.modelPostBatchCode }}('datachanges', {\n changes: messages,\n transaction: inChangeTransaction\n });\n\n messages.forEach(function(msg) {\n {{# def.modelPostMessageCode }}(msg.path, msg);\n }, this);\n }\n#}}\n",include_create_tree="'use strict';\n/* Only use this style of comments, not \"//\" */\n\n/**\n * Inserts code to create model tree as neccessary for `set` and `splice` accessors and to add messages to send list if the tree changes.\n */\n{{## def.createTree:method:\n var wasDef = true;\n var old = m;\n\n {{ var emptyProp = it.parsedPath[0] && it.parsedPath[0].empty; }}\n {{? emptyProp }}\n {{ /* create top level model if it was not previously defined */ }}\n if (! m) {\n m = {{# def.modelAccessPrefix }} = {{= emptyProp }};\n wasDef = false;\n\n if (this._options.reactive !== false) {\n {{# def.addMsg }} '', type: 'added',\n newValue: m });\n }\n }\n {{??}}\n {{? method == 'splice' }}\n if (! m) {\n {{?}}\n m = {{# def.modelAccessPrefix }} = cloneTree(value);\n wasDef = typeof old != 'undefined';\n {{? method == 'splice' }}\n }\n {{?}} \n {{?}}\n\n\n {{ /* create model tree if it doesn't exist */ }}\n {{ var modelDataProperty = '';\n var nextNode = it.parsedPath[0];\n var count = it.parsedPath.length - 1;\n\n for (var i = 0; i < count; i++) {\n var currNode = nextNode;\n var currProp = currNode.property;\n nextNode = it.parsedPath[i + 1];\n var emptyProp = nextNode && nextNode.empty;\n }}\n\n {{# def.createTreeStep }}\n\n {{ } /* for loop */ }}\n#}}\n\n\n/**\n * Inserts code to create one step in the model tree\n */\n{{## def.createTreeStep:\n {{# def.changeAccessPath }}\n\n if (! {{# def.wasDefined }}) { \n {{ /* property does not exist */ }}\n m = m{{# def.currProp }} = {{= emptyProp }};\n\n if (this._options.reactive !== false) {\n {{# def.addMsg }} accessPath, type: 'added', \n newValue: m });\n }\n\n } else if (typeof m{{# def.currProp }} != 'object') {\n {{ /* property is not object */ }}\n var old = m{{# def.currProp }};\n m = m{{# def.currProp }} = {{= emptyProp }};\n\n if (this._options.reactive !== false) {\n {{# def.addMsg }} accessPath, type: 'changed', \n oldValue: old, newValue: m });\n }\n\n } else {\n {{ /* property exists, just traverse down the model tree */ }}\n m = m{{# def.currProp }};\n }\n#}}\n",include_traverse_tree="'use strict';\n/* Only use this style of comments, not \"//\" */\n\n/**\n * Inserts code to traverse model tree for `delete` and `splice` accessors.\n */\n{{## def.traverseTree:\n {{ \n var count = it.parsedPath.length-1;\n\n for (var i = 0; i < count; i++) { \n var currNode = it.parsedPath[i];\n var currProp = currNode.property;\n }}\n {{# def.traverseTreeStep }}\n\n {{ } /* for loop */\n\n var i = count;\n while (i--) { /* closing braces for else's above */\n }}\n }\n {{ } /* while loop */ }}\n#}}\n\n\n/**\n * Inserts code to traverse one step in the model tree\n */\n{{## def.traverseTreeStep:\n if (! (m && m.hasOwnProperty && {{# def.wasDefined}} ) )\n treeDoesNotExist = true;\n else {\n m = m{{# def.currProp }};\n {{# def.changeAccessPath }}\n {{ /* brace from else is not closed on purpose - all braces are closed in while loop */ }}\n#}}\n",dotDef={include_defines:include_defines,include_create_tree:include_create_tree,include_traverse_tree:include_traverse_tree,getPathNodeKey:pathUtils.getPathNodeKey,modelAccessPrefix:"this._model._data",modelPostMessageCode:"this._model._internalMessenger.postMessage",modelPostBatchCode:"this._model.postMessageSync",internalMessenger:"this._model._internalMessenger"},modelDotDef=_(dotDef).clone().extend({modelAccessPrefix:"this._data",modelPostMessageCode:"this._internalMessenger.postMessage",modelPostBatchCode:"this.postMessageSync",internalMessenger:"this._internalMessenger"})._(),dotSettings=_.clone(doT.templateSettings);dotSettings.strip=!1;var synthesizers=_.mapKeys(templates,function(a){return doT.template(a,dotSettings,dotDef)}),modelSynthesizers=_.mapToObject(["set","del","splice"],function(a){return doT.template(templates[a],dotSettings,modelDotDef)}),synthesizePathMethods=_.memoize(_synthesizePathMethods,void 0,1e3),normalizeSpliceIndex=modelUtils.normalizeSpliceIndex;module.exports=synthesizePathMethods;var modelMethods=_.mapKeys(modelSynthesizers,function(a){return _synthesize(a,"",[])});synthesizePathMethods.modelMethods=modelMethods},{"../../util/logger":119,"../change_data":108,"../model_utils":113,"../path_utils":115,dot:122,fs:97,"mol-proto":123}],117:[function(a,b){"use strict";function c(a){this.pattern=a}function d(a){if(0==a.length)throw new Error("Must provide at least one choice to Match.OneOf");this.choices=a}function e(a){this.condition=a}function f(a){this.pattern=a}function g(a){this.pattern=a}function h(a,b){this.Superclass=a,this.matchSuperclass=b}function i(a,b){if(b!==n.Any){for(var l=0;lthis.level)return this;var g=e.slice(arguments,1);if(b<=this.throwLevel)throw new Error([this.logPrefix,a+":"].concat(g).join(" "));return console.log.apply(console,[this.logPrefixColor?" "+d(this.logPrefix,this.logPrefixColor):this.logPrefix,(this.colors?" "+d(c(a),h[b]):a)+":"].concat(g)),this},f.forEach(function(a){j.prototype[a]=function(){this.log.apply(this,[a].concat(e.toArray(arguments)))}}),b.exports=j},{"mol-proto":123}],121:[function(a,b){!function(){"use strict";function a(b,c,d){return("string"==typeof c?c:c.toString()).replace(b.define||g,function(a,c,e,f){return 0===c.indexOf("def.")&&(c=c.substring(4)),c in d||(":"===e?(b.defineParams&&f.replace(b.defineParams,function(a,b,e){d[c]={arg:b,text:e}}),c in d||(d[c]=f)):new Function("def","def['"+c+"']="+f)(d)),""}).replace(b.use||g,function(c,e){b.useParams&&(e=e.replace(b.useParams,function(a,b,c,e){if(d[c]&&d[c].arg&&e){var f=(c+":"+e).replace(/'|\\/g,"_");return d.__exp=d.__exp||{},d.__exp[f]=d[c].text.replace(new RegExp("(^|[^\\w$])"+d[c].arg+"([^\\w$])","g"),"$1"+e+"$2"),b+"def.__exp['"+f+"']"}}));var f=new Function("def","return "+e)(d);return f?a(b,f,d):f})}function c(a){return a.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var d,e={version:"1.0.3",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:!0,append:!0,selfcontained:!1,doNotSkipEncoded:!1},template:void 0,compile:void 0};e.encodeHTMLSource=function(a){var b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},c=a?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(a){return a?a.toString().replace(c,function(a){return b[a]||a}):""}},d=function(){return this||(0,eval)("this")}(),"undefined"!=typeof b&&b.exports?b.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):d.doT=e;var f={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},g=/$^/;e.template=function(b,h,i){h=h||e.templateSettings;var j,k,l=h.append?f.append:f.split,m=0,n=h.use||h.define?a(h,b,i||{}):b;n=("var out='"+(h.strip?n.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):n).replace(/'|\\/g,"\\$&").replace(h.interpolate||g,function(a,b){return l.start+c(b)+l.end}).replace(h.encode||g,function(a,b){return j=!0,l.startencode+c(b)+l.end}).replace(h.conditional||g,function(a,b,d){return b?d?"';}else if("+c(d)+"){out+='":"';}else{out+='":d?"';if("+c(d)+"){out+='":"';}out+='"}).replace(h.iterate||g,function(a,b,d,e){return b?(m+=1,k=e||"i"+m,b=c(b),"';var arr"+m+"="+b+";if(arr"+m+"){var "+d+","+k+"=-1,l"+m+"=arr"+m+".length-1;while("+k+"a;a++)c=e[a],/\.def(\.dot|\.jst)?$/.test(c)&&(console.log("Loaded def "+c),this.__includes[c.substring(0,c.indexOf("."))]=f(d+c));for(a=0,b=e.length;b>a;a++)c=e[a],/\.dot(\.def|\.jst)?$/.test(c)&&(console.log("Compiling "+c+" to function"),this.__rendermodule[c.substring(0,c.indexOf("."))]=this.compilePath(d+c)),/\.jst(\.dot|\.def)?$/.test(c)&&(console.log("Compiling "+c+" to file"),this.compileToFile(this.__destination+c.substring(0,c.indexOf("."))+".js",f(d+c)));return this.__rendermodule}},{"./doT":121,fs:97}],123:[function(a,b){"use strict";function c(a){var b=Object.create(c.prototype);return b.self=a,b}function d(){return this.self}var e=a("./utils"),f=a("./proto_prototype"),g=a("./proto_object"),h=a("./proto_array"),i=a("./proto_function"),j=a("./proto_string"),k=a("./proto_number"),l=a("./proto_util"),m={};g.extend.call(m,g),m.extend.call(m,f),m.extend.call(m,h),m.extend.call(m,j),m.extend.call(m,k),m.extend.call(m,i),m.extend.call(m,l),m.defineProperty(c,"__",m),m.extendProto.call(c,{_:d}),m.extend.call(c,g._constants);var n=m.mapKeys.call(m,e.makeProtoFunction,!0);m.extend.call(c,n);var o=m.mapKeys.call(m,e.makeProtoInstanceMethod,!0);m.extendProto.call(c,o),"object"==typeof window&&(window._&&(c.underscore=window._),window._=c),"object"==typeof b&&b.exports&&(b.exports=c)},{"./proto_array":124,"./proto_function":125,"./proto_number":126,"./proto_object":127,"./proto_prototype":128,"./proto_string":129,"./proto_util":130,"./utils":131}],124:[function(a,b){"use strict";function c(a){if(!a.length)return this;Array.isArray(a)||(a=f.call(a));var b=[this.length,0].concat(a);return m.splice.apply(this,b),this}function d(a){if(!a.length)return this;Array.isArray(a)||(a=f.call(a));var b=[0,0].concat(a);return m.splice.apply(this,b),this}function e(a){var b=this.indexOf(a);return b>=0&&this.splice(b,1),this}function f(){return m.slice.call(this)}function g(a){var b={},c=Array.isArray(a);return m.forEach.call(this,function(d,e){b[d]=c?a[e]:a}),b}function h(a,b){var c={};return Array.prototype.forEach.call(this,function(d,e){c[d]=a.call(b,d,e,this)},this),c}function i(a){function b(b){return m.findIndex.call(d,function(c){return a(b,c)})}function c(a){return d.indexOf(a)}var d=[];return a||(b=c),this.forEach(function(a){var c=b(a);-1==c&&d.push(a)}),d}function j(a,b){function c(){m.forEach.call(this,function(f){Array.isArray(f)?c.call(f):a.call(b,f,d++,e)})}var d=0,e=this;c.call(this)}var k=a("./proto_object"),l=a("./utils"),m=b.exports={appendArray:c,prependArray:d,toArray:f,object:g,mapToObject:h,unique:i,deepForEach:j,spliceItem:e},n=["join","pop","push","concat","reverse","shift","unshift","slice","splice","sort","filter","forEach","some","every","map","indexOf","lastIndexOf","reduce","reduceRight"],o=h.call(n,function(a){return Array.prototype[a]});k.extend.call(m,o),m.find=Array.prototype.find||l.makeFindMethod(m.forEach,"value"),m.findIndex=Array.prototype.findIndex||l.makeFindMethod(m.forEach,"index")},{"./proto_object":127,"./utils":131}],125:[function(require,module,exports){"use strict";function makeFunction(arg1,arg2,funcBody){for(var name=this,count=arguments.length-1,funcBody=arguments[count],func,code="",i=0;count>i;i++)code+=", "+arguments[i];return code=["func = function ",name,"(",code.slice(2),") {\n",funcBody,"\n}"].join(""),eval(code),func}function partial(){var a=this,b=slice.call(arguments);return function(){return a.apply(this,b.concat(slice.call(arguments)))}}function partialRight(){var a=this,b=slice.call(arguments);return function(){return a.apply(this,slice.call(arguments).concat(b))}}function memoize(a,b){var c=this,d={},e=[];return b=b||1e3,function(){var f=a?a.apply(this,arguments):arguments[0];if(d.hasOwnProperty(f))return d[f];var g=d[f]=c.apply(this,arguments);return e.push(f),e.length>b&&delete d[e.shift()],g}}function delay(a){var b=slice.call(arguments,1);return _delay(this,a,b)}function defer(){return _delay(this,1,arguments)}function _delay(a,b,c,d){return setTimeout(a.apply.bind(a,d||null,c),b)}function deferTicks(a){if(2>a)return defer.apply(this,arguments);var b=repeat.call(deferFunc,a-1);return b=b.concat(this,slice.call(arguments,1)),deferFunc.apply(null,b)}function delayMethod(a,b){var c=slice.call(arguments,2);return _delayMethod(this,a,b,c)}function deferMethod(a){var b=slice.call(arguments,1);return _delayMethod(this,a,1,b)}function _delayMethod(a,b,c,d){return setTimeout(function(){var c="string"==typeof b?a[b]:b; c.apply(a,d)},c)}function delayed(a){var b=this,c=slice.call(arguments,1);return function(){var d=c.concat(slice.call(arguments));return _delay(b,a,d,this)}}function deferred(){var a=this,b=slice.call(arguments);return function(){var c=b.concat(slice.call(arguments));return _delay(a,1,c,this)}}function debounce(a,b){var c,d,e,f,g,h=this;return function(){function i(){var j=Date.now()-f;a>j?c=setTimeout(i,a-j):(c=null,b||(g=h.apply(e,d)))}e=this,d=arguments,f=Date.now();var j=b&&!c;return c||(c=setTimeout(i,a)),j&&(g=h.apply(e,d)),g}}function throttle(a,b){function c(){i=b.leading===!1?0:Date.now(),h=null,f=g.apply(d,e)}var d,e,f,g=this,h=null,i=0;return b||(b={}),function(){var j=Date.now();i||b.leading!==!1||(i=j);var k=a-(j-i);return d=this,e=arguments,0>=k?(clearTimeout(h),h=null,i=j,f=g.apply(d,e)):h||b.trailing===!1||(h=setTimeout(c,k)),f}}function once(){var a,b=this,c=!1;return function(){return c?a:(c=!0,a=b.apply(this,arguments),b=null,a)}}function waitFor(a,b,c,d){function e(){if(g())a();else{if(!(Date.now()-f>=b))return;c&&c()}clearInterval(h)}var f=Date.now(),g=this;d=d||50;var h=setInterval(e,d)}function not(){var a=this;return function(){return!a.apply(this,arguments)}}var makeProtoFunction=require("./utils").makeProtoFunction,repeat=require("./proto_util").repeat,functionMethods=module.exports={makeFunction:makeFunction,partial:partial,partialRight:partialRight,memoize:memoize,delay:delay,defer:defer,delayed:delayed,deferred:deferred,deferTicks:deferTicks,delayMethod:delayMethod,deferMethod:deferMethod,debounce:debounce,throttle:throttle,once:once,waitFor:waitFor,not:not},slice=Array.prototype.slice,deferFunc=makeProtoFunction(defer)},{"./proto_util":130,"./utils":131}],126:[function(a,b){"use strict";function c(){return!isNaN(parseFloat(this))&&isFinite(this)}b.exports={isNumeric:c}},{}],127:[function(a,b){"use strict";function c(a,b){var c={};return p.call(a,function(b,d){c[d]=Object.getOwnPropertyDescriptor(a,d)},this,b),Object.defineProperties(this,c),this}function d(){if(Array.isArray(this))return this.slice();if(this instanceof Date)return new Date(this);if(this instanceof RegExp)return new RegExp(this);var a=Object.create(this.constructor.prototype);return c.call(a,this),a}function e(a,b,c){return Object.defineProperty(this,a,f(b,c)),this}function f(a,b){var d={value:a};return b&&c.call(d,{enumerable:!!(b&B.ENUMERABLE),configurable:!!(b&B.CONFIGURABLE),writable:!!(b&B.WRITABLE)}),d}function g(a,b){var c=q.call(a,function(a){return f(a,b)},!0);return Object.defineProperties(this,c),this}function h(a,b){return i(this,a,b,[])}function i(a,b,c,d){if(!(d.indexOf(b)>=0)){d.push(b);var e=Array.isArray(b)?Array.prototype.forEach:p;return e.call(b,function(e,f){var g=Object.getOwnPropertyDescriptor(b,f);"object"!=typeof e||null==e||e instanceof RegExp||e instanceof Date?Object.defineProperty(a,f,g):(a.hasOwnProperty(f)&&"object"==typeof a[f]&&null!=a[f]||(a[f]=Array.isArray(e)?[]:{}),i(a[f],e,c,d))},this,c),a}}function j(a){if(this instanceof Date)return new Date(this);if(this instanceof RegExp)return new RegExp(this);var b=Array.isArray(this)?[]:{};return h.call(b,this,a),b}function k(){return Object.keys(this)}function l(a){var b=a?Object.keys(this):m.call(this);return b.map(function(a){return this[a]},this)}function m(){return Object.getOwnPropertyNames(this)}function n(a,b){for(var c=b?Object.keys(this):m.call(this),d=0;dd;d++){var e=b.charCodeAt(d);a=(a<<5)+a+e}return a}function unPrefix(a){return 0==this.indexOf(a)?this.replace(a,""):void 0}var __=require("./proto_object"),stringMethods=module.exports={firstUpperCase:firstUpperCase,firstLowerCase:firstLowerCase,toRegExp:toRegExp,toFunction:toFunction,toDate:toDate,toQueryString:toQueryString,fromQueryString:fromQueryString,jsonParse:jsonParse,hashCode:hashCode,unPrefix:unPrefix},regexpStringPattern=/^\/(.*)\/([gimy]*)$/},{"./proto_object":127}],130:[function(a,b){"use strict";function c(a,b){for(var c=Array(Math.max(0,this)),d=0;this>d;d++)c[d]=a.call(b,d);return c}function d(a){for(var b=Array(Math.max(0,a)),c=0;a>c;c++)b[c]=this;return b}function e(a){return a.call(this,this),this}function f(a){var b=Array.prototype.slice.call(arguments,1);return"function"==typeof this?this.apply(a,b):this}function g(){return this}function h(){var a=this;return function(b){return b[a]}}function i(){var a=this;return function(b,c){return b[a]c[a]?1:0}}function j(){}b.exports={times:c,repeat:d,tap:e,result:f,identity:g,property:h,compareProperty:i,noop:j}},{}],131:[function(a,b){"use strict";function c(a){return function(){return this.self=a.apply(this.self,arguments),this}}function d(a){return function(){return a.call.apply(a,arguments)}}function e(a,b){var c="value"==b?0:1;return function(b,d,e){function g(a,d,e){var g;try{g=b.call(this,a,d,e)}catch(i){throw h=i,f}if(g)throw arguments[c]}var h;try{a.call(this,g,d,e)}catch(i){if(i===f)throw h;return i}return c&&a==Array.prototype.forEach?-1:void 0}}var f=(b.exports={makeProtoInstanceMethod:c,makeProtoFunction:d,makeFindMethod:e},new Error)},{}]},{},[66]); //# sourceMappingURL=milo.min.js.map \ No newline at end of file diff --git a/milo.min.js.map b/milo.min.js.map index c52b381..2048a4b 100644 --- a/milo.min.js.map +++ b/milo.min.js.map @@ -1 +1 @@ -{"version":3,"file":"milo.min.js","sources":["milo.bundle.js"],"names":["e","t","n","r","s","o","u","a","require","i","Error","f","exports","call","length",1,"module","Facet","owner","config","this","name","_","firstLowerCase","constructor","init","apply","arguments","proto","extendProto","milo-core",2,"FacetedObject","instantiateFacet","FacetClass","facetName","fctConfig","facetsConfig","facets","facetsDescriptors","enumerable","value","facetsClasses","eachKey","Object","defineProperties","defineProperty","FacetedObject$addFacet","facetConfig","throwOnErrors","check","Function","Match","Optional","String","protoFacets","prototype","message","logger","error","newFacet","ENUM","FacetedObject$$hasFacet","FacetedObject$$getFacetConfig","hasFacet","FacetedObject$$createFacetedClass","addInheritedFacets","superClass","facetsInfo","facetsInfoName","inheritedFacetsInfo","clone","extend","ObjectHash","Subclass","fctName","hasOwnProperty","FacetedClass","createSubclass","miloCore","util","createFacetedClass","getFacetConfig","addFacet","./facet",3,"ClassRegistry","FoundationClass","setClass","__registeredClasses","add","aClass","IdentifierString","get","remove","nameOrClass","OneOf","clean",4,"attrName","attrs","bind","parse","node","bindTo","match","ATTRIBUTE_REGEXP","compClass","compFacets","split","FACETS_SPLIT_REGEXP","undefined","compName","validate","render","milo","componentName","ATTRIBUTE_TEMPLATE","replace","join","BindAttribute$$setInfo","el","componentClass","componentFacets","attr","BindAttribute","decorate","Attribute","setInfo","../config","./a_class",5,"attributes","Attribute$$remove","deep","removeAttribute","selector","children","querySelectorAll","forEach","childEl","Attribute$remove","Attribute$destroy","Attribute$get","getAttribute","Attribute$set","setAttribute","Attribute$decorate","set","toBeImplemented","destroy",6,"load","loadUrl","LoadAttribute",7,"./a_bind","./a_load",8,"binder","scopeEl","rootScope","bindRootElement","createBinderScope","scope","info","ComponentInfo","Component","create","twoPass","scanScope","scan","hostObject","Scope","_rootEl","addMethod","_each","compInfo","aComponent","container","scopeObjectFactory","createScopeForElement","postChildrenBoundMessage","elComp","getComponent","postMessageSync","scopedObject","isContainer","childNodes","innerScope","_hostObject","createScopeForChildren","containerEl","utilDom","document","body","componentsRegistry","./attributes/a_bind","./components/c_facets/cf_registry","./components/c_info","./components/c_registry","./components/scope","./services/mail","./util/dom",9,"coreClasses","classes","Mixin","MessageSource","MessengerMessageSource","MessengerAPI","DOMEventsSource","Transaction","TransactionHistory","./abstract/facet","./abstract/faceted_object","./abstract/registry","./command/transaction","./command/transaction_history","./components/msg_src/dom_events",10,"ActionsHistory","maxLength","_maxLength","Infinity","actions","position","ActionsHistory$store","command","_truncateToCurrentPosition","push","act","shift","ActionsHistory$deleteLast","ActionsHistory$undo","cb","undo","ActionsHistory$redo","redo","ActionsHistory$undoAll","ActionsHistory$redoAll","ActionsHistory$undoAllAsync","deferMethod","defer","ActionsHistory$redoAllAsync","ActionsHistory$each","funcOrMethod","thisArg","func","ActionsHistory$eachReverse","reverse","each","ActionsHistory$getLastAction","ActionsHistory$getDescription","map","getDescription","store","deleteLast","undoAll","redoAll","undoAllAsync","redoAllAsync","eachReverse","getLastAction",11,"Command","commandsRegistry","../abstract/registry","./index",12,"Command$init","args","slice","Command$execute","result","Command$setUndo","undoCommand","UNDO_COMMAND","warn","Command$getUndo","Command$undo","undoCmd","getUndo","execute","Command$setArguments","toArray","Command$getArguments","Command$changeArguments","Command$addArguments","appendArray","Command$$create","newApply","Command$$createWithUndo","Command$destroy","Command$setComment","comment","Command$getDescription","setUndo","setArguments","addArguments","getArguments","changeArguments","setComment","createWithUndo",13,"commands","Transaction$execute","Transaction$undo","Transaction$redo","Transaction$destroy","Transaction$storeCommand","Transaction$merge","transaction","cmd","Transaction$setComment","Transaction$getDescription","storeCommand","merge","./actions_history",14,"transactions","currentBatch","currentTransaction","SCHEDULED","TransactionHistory$storeCommand","appendTransaction","_postTransactionMessage","_storeTransaction","TransactionHistory$deleteLastTransaction","_addBatchToTransaction","_storeCurrentTransaction","TransactionHistory$endTransaction","TransactionHistory$storeTransaction","endTransaction","msg","_messenger","postMessage","TransactionHistory$undo","TransactionHistory$redo","TransactionHistory$inTransaction","TransactionHistory$getDescription","TransactionHistory$useMessenger","Messenger","defaultMethods","TransactionHistory$destroy","storeTransaction","deleteLastTransaction","inTransaction","useMessenger","./transaction",15,"Component$$createComponentClass","Array","isArray","configMap","fct","keys","fctClassName","firstUpperCase","facetsRegistry","ComponentClass","_registerWithDomStorage","className","DOMStorage","registerDataType","Component_domStorageSerializer","Component_domStorageParser","component","state","getState","JSON","stringify","compStr","jsonParse","createFromState","Component$$create","extraFacetsClasses","Component$$copy","deepCopy","Boolean","newEl","dom","copy","cloneNode","createOnElement","extraFacets","_getState","setState","Component$$createOnElement","innerHTML","_createComponentElement","_findOrCreateComponentRootScope","_addAttributeAndBindComponent","broadcast","Dom","domFacetConfig","templateFacetConfig","template","elConfig","domConfig","content","createElement","parent","getContainingComponent","miloBinder","Component$$createFromState","newUniqueName","ObjectIncluding","facetsStates","outerHTML","wrapEl","_createComponentWrapElement","_any","_add","domUtils","compEl","miloComponentName","Component$$createFromDataTransfer","dataTransfer","dataType","find","types","type","COMPONENT_DATA_TYPE_REGEX","test","getData","Component$init","element","componentInfo","componentRef","messenger","MESSENGER_PROPERTY","allFacets","start","Component$start","Component$createElement","Component$hasFacet","facetNameOrClass","facet","ComponentFacet","Component$addFacet","facetClassName","Component$allFacets","method","mapKeys","Component$rename","renameInScope","rename","Component$remove","preserveScopeProperty","quiet","_remove","Component$insertInto","parentEl","referenceEl","insertBefore","setScopeParentFromDOM","Component$getState","rootComponent","Component$getTransferState","options","transfer","Component$_getState","deepState","filterKeys","fctState","Component$setState","Component$getScopeParent","conditionOrFacet","_callGetScopeParent","_getScopeParent","_getScopeParentFunc","conditionFunc","componentUtils","_makeComponentConditionFunc","Component$getScopeParentWithClass","comp","Component$getTopScopeParent","_getTopScopeParent","topParent","Component$getTopScopeParentWithClass","Component$setScopeParentFromDOM","foundParent","parentNode","Component$walkScopeTree","callback","walkScopeTree","Component$treePathOf","treePathOf","Component$getComponentAtTreePath","treePath","nearest","getNodeAtTreePath","Component$insertAtTreePath","wasInserted","insertAtTreePath","Component$broadcast","data","synchronously","postMethod","Component$destroy","_destroyed","detachComponent","removeElement","Component$isDestroyed","createComponentClass","isComponent","createFromDataTransfer","insertInto","getTransferState","getScopeParent","getTopScopeParent","getScopeParentWithClass","getTopScopeParentWithClass","getComponentAtTreePath","isDestroyed","useWith","../abstract/faceted_object","../attributes/a_bind","../binder","../util/component_name","../util/dom","../util/storage","./c_facets/cf_registry","./c_utils","./scope",16,"ComponentFacet$init","_createMessenger","ComponentFacet$start","messages","onConfigMessages","ComponentFacet$onConfigMessages","messageSubscribers","notYetRegisteredMap","subscriber","subscriberType","on","contextType","context","ComponentFacet$check","reqFacet","ComponentFacet$destroy","domParent","parentComponent","scopeParent","_postParent","getParentMethod","messageType","messageData","parentFacet","_setMessageSource","messageSource","getMessageSource","dispatchSourceMessage","dispatchMessage","_createMessageSource","MessageSourceClass","_createMessageSourceWithAPI","messengerAPIOrClass","requiresFacet","facetRequire","indexOf","postDomParent","partial","postScopeParent","../abstract/facet",17,"Container$binder","Container$start","Container$path","path","throwInvalidPath","len","allowedNamePattern","Container$getState","Container$setState","compData","Container$destroy","_detachElement","Container$unwrap","renameChildren","unwrapElement","child","Container$append","appendChild","Container$insertBefore","sibling","Container$remove","removeChild","Container","unwrap","append","../../binder","../../util/dom","../c_facet","../scope","./cf_registry",18,"Data$start","pathUtils","wrapMessengerMethods","elData","getElementDataAccess","_dataChangesQueue","_prepareMessageSource","_path","_value","onSync","onOwnDataChange","onDataChangesFinished","onChildData","changeDataHandler","dataAPI","DataMsgAPI","dataEventsSource","proxyDataSourceMethods","_createProxyMethod","msgType","_bubbleUpDataChange","_queueDataChange","getTransactionFlag","Data$_bubbleUpDataChange","msgData","parentData","parentMsg","Data$_queueDataChange","change","_postDataChanges","Data$_postDataChanges","queue","changes","Data$set","executeHook","noHook","setTransactionFlag","_set","oldValue","newValue","Data$_set","setChildData","valueSet","childValue","key","pathSyntax","childPath","childDataFacet","listFacet","list","listLength","count","newItemsCount","_addItems","_updateDataPaths","index","listCount","removeCount","_removeItem","_setScalarValue","Data$del","postTransactionFinished","_del","Data$_del","Data$_setScalarValue","Data$get","deepGet","_get","Data$_get","scopeData","listItem","scopeItem","contains","_getScalarValue","Data$_getScalarValue","Data$splice","_splice","spliceIndex","removed","addedCount","methodName","hook","Data$_splice","spliceHowMany","modelUtils","normalizeSpliceIndex","item","itemData","added","argsLen","addItems","j","Data$len","_len","Data$_len","Data$path","accessPath","createItem","parsedPath","parseAccessPath","currentComponent","pathNode","nodeKey","getPathNodeKey","syntax","itemComponent","_addItem","property","currentDataFacet","Data$getPath","Data$getKey","Data$getState","Data$setState","Model","_utils","model","Data","del","splice","getPath","getKey","Path","trigger","../msg_api/data","../msg_api/de_data","../msg_src/dom_events",19,"Dom$$createElement","tagName","_applyConfigToElement","doT","cssClasses","cls","configAttributes","attrValue","_attachCssClasses","currentStyle","window","getComputedStyle","_visible","display","show","toggle","hide","doShow","style","_manageCssClasses","enforce","callMethod","cssCls","doToggle","classList","detach","setStyle","setStyles","properties","isDeep","prepend","thisEl","firstChild","appendChildren","prependChildren","insertAfter","nextSibling","appendToScopeParent","Dom$children","direction","iterator","findDirections","treeWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","currentNode","nextNode","found","hasTextBeforeSelection","selection","getSelection","isCollapsed","text","focusNode","textContent","startPos","charAt","anchorOffset","SHOW_TEXT","anchorNode","prevNode","previousNode","isText","nodeValue","trim","hasTextAfterSelection","addCssClasses","removeCssClasses","toggleCssClasses","up","down","../../attributes/a_bind","../../config",20,"Drag$init","_dragData","dataTypeInfo","_dataTypeInfo","Drag$setHandle","handleEl","_dragHandle","Drag$start","_addDragAttribute","onMessages","mousedown","onMouseDown","mouseenter mouseleave mousemove","onMouseMovement","dragstart","onDragStart","drag","onDragging","dragend","onDragEnd","getstatestarted","_removeDragAttribute","getstatecompleted","eventType","event","__mouseDownTarget","target","targetInDragHandle","empty","stopPropagation","shouldBeDraggable","setMeta","params","getMetaData","_dragMetaDataType","dt","setComponentMeta","_dragMetaData","meta","setAdditionalDataTypes","dataTypes","_dataTypesData","getDataFunc","setData","off","preventDefault","DragDrop","setComponentState","_setAllowedEffects","service","dragDrop","dragFacet","_dragIsDisabled","effects","allowedEffects","setAllowedEffects","Drag","setHandle","../../util/dragdrop","../c_class",21,"Drop$init","DropMsgAPI","Drop$start","dragenter dragover","drop","onDrop","dragenter dragover dragleave drop dragin dragout","postToService","_handleDropDependency","setDropEffect","dropFacet","_handleDropDependencyNothrottle","originalDropComponent","allow","parentAllowed","checkParent","_isDropAllowed","allowComps","components","getComponentMeta","Drop","throttle","../msg_api/drop",22,"Events$init","domEventsSource","MSG_SOURCE_KEY","Events",23,"Frame$init","FrameMessageSource","Frame$start","postDomReady","self","Frame$destroy","Frame$getWindow","contentWindow","Frame$isReady","readyState","getWindow","Frame$isMiloReady","frameMilo","isReady","milo_version","Frame$milo","whenMiloReady","win","_makeWhenReadyFunc","isReadyFunc","callFunc","Frame","Frame$whenReady","Frame$whenMiloReady","whenReady","isMiloReady","../../services/de_constrs","../msg_src/frame",24,"ItemFacet$getState","getIndex","ItemFacet$setState","setIndex","ItemFacet$getIndex","ItemFacet$setIndex","ItemFacet$removeItem","removeItem","ItemFacet$extractItem","extractItem","ItemFacet","../../services/mail",25,"List$init","_listItems","_listItemsHash","WRIT","List$start","onChildrenBound","items","itemsHash","foundItem","itemSample","LIST_SAMPLE_CSS_CLASS","miloConfig","_createCacheTemplate","List$_createCacheTemplate","itemElCopy","itemsTemplateStr","itemsTemplate","compile","List$item","List$count","List$_setItem","List$contains","List$addItem","List$_addItem","prevComponent","_itemPreviousComponent","_setItem","_updateItemsIndexes","fromIndex","toIndex","List$addItems","itemsData","concat","repeat","spliceArgs","dataFacet","List$_addItems","Integer","itemsHTML","frag","createDocumentFragment","newComponents","List$removeItem","List$extractItem","itemComp","List$_removeItem","doDestroyItem","List$replaceItem","newItem","oldItem","List$_updateDataPaths","List$each","List$destroy","List","addItem","replaceItem","../../util/component_name",26,"ModelFacet$init","m","ModelFacet$getState","modelValue","deepClone","ModelFacet$setState","ModelFacet$_createMessenger","ModelFacet$destroy","ModelFacet",27,"Options$init","proxyMethods","Options$_createMessenger","Options$destroy","Options",28,"Template$init","interpolate","compileOptions","Template$start","autoRender","autoBinder","Template$getCompiled","_template","Template$set","templateStr","_templateStr","_compile","Template$render","Template$binder","Template","getCompiled",29,"Transfer$init","_activeState","_defaultKey","_state","Transfer$getState","Transfer$setState","setActiveState","Transfer$setActiveState","Transfer$setStateWithKey","isDefaultKey","Transfer$getStateWithKey","Transfer$getComponentMeta","Transfer","setStateWithKey","getStateWithKey",30,"../../abstract/registry",31,"getComponentClass","getComponentExtraFacets","hasContainerFacet","ComponentInfo$destroy","ComponentInfo$rename","reportBinderError","classHasFacetThatRequiresContainer","someKey","facetRequiresContainer","./c_registry",32,"./c_class",33,"returnCurrent","_getContainingComponent",34,"View","../c_registry",35,"DataMsgAPI$init","DataMsgAPI$value","componentGetter","translateToSourceMessage","componentEvent","filterSourceMessage","sourceMessage","createInternalData","internalData","./de_data",36,"inputDataProperty","inputType","inputElementTypes","byDefault","inputChangeEvent","toLowerCase","domElementsDataAccess","div","span","p","input","textarea","select","img","caption","thead","tbody","tfoot","tagInfo","propFunc","checkbox","radio",37,"dropEventsMap","resetFilterVars","_currentTarget","_inside","ok","dragin","dragout",38,"DOMEventsSource$destroy","emitter","DOMEmitterSource","../../services/dom_source",39,"frameWindow","addSourceSubscriber","addEventListener","removeSourceSubscriber","removeEventListener","handleEvent",40,"rootEl","Scope$_add","object","checkName","__add","Scope$_safeAdd","shouldRename","Scope$_copy","aScope","Scope$_move","otherScope","Scope$_merge","Scope$_each","Scope$_filter","Scope$_length","Scope$_any","Scope$_remove","Scope$_clean","Scope$_detachElement","Scope$_has","Scope$$rename","obj","_safeAdd","_copy","_move","_merge","_length","_clean","_has","_filter",41,"MLButton$disable","disable","disabled","MLButton$isDisabled","MLButton","events","isDisabled",42,"MLCombo$init","_comboInput","_comboList","datalist","DATALIST_TEMPLATE","dispatchChangeMessage","MLCombo_get","MLCombo_set","changeComboData","MLCombo_del","COMBO_CHANGE_MESSAGE","onOptionsChange","comboOptions","MLCombo","***",43,"MLComboList$init","_dataValidation","once","MLComboList$setDataValidation","dataValidation","MLComboList$setOptions","arr","_combo","setOptions","MLComboList$clearComboInput","clearComboInput","MLComboList$toggleAddButton","toggleAddButton","MLComboList$setAddItemPrompt","prompt","setAddItemPrompt","MLComboList$destroy","_connector","minder","destroyConnector","componentSetup","combo","_list","onComboChange","onAddItem","onItemsChange","COMBO_LIST_CHANGE_MESSAGE","MLComboList_get","MLComboList_set","MLComboList_del","MLComboList","setDataValidation",44,"MLDate$getMin","date","min","MLDate$setMin","toDate","toISO8601Format","MLDate$getMax","max","MLDate$setMax","MLDate_get","MLDate_set","dispatchInputMessage","MLDate_del","pad","dateArr","getFullYear","getMonth","getDate","dateStr","MLDate","getMin","setMin","getMax","setMax",45,"MLDropTarget",46,"foldUnfold","itemMessage","id","_itemsMap","onItemEvent","MLFoldTree$setItemTemplate","_itemTemplate","MLFoldTree$renderTree","_renderTree","itemsIDs","uniqueId","COMPILED_TREE_TEMPLATE","itemIDs","itemTemplate","DEFAULT_COMPILED_ITEM_TEMPLATE","treeTemplate","_data","TREE_TEMPLATE","MLFoldTree","click dblclick","setItemTemplate","renderTree","../../util/unique_id",47,"MLGroup",48,"MLHyperlink",49,"MLImage$init","MLImage_set","MLImage_get","MLImage_del","IMAGE_CHANGE_MESSAGE","onModelChange","src","MLImage",".src",50,"MLInput$disable","MLInput$isDisabled","MLInput$setMaxLength","MLInput","setMaxLength",51,"MLInputList$init","MLInputList$setPlaceHolder","placeHolder","_input","MLInputList$setAsync","newHandler","asyncHandler","MLInputList$destroy","_button","button","onClick","label","INPUT_LIST_CHANGE_MESSAGE","MLInputList_get","MLInputList_set","MLInputList_del","MLInputList_splice","MLInputList","setAsync","setPlaceHolder",52,"MLList$init","MLList$destroy","MLList$removeItem","MLList$moveItem","from","to","splicedData","deferChangeMode","MLList","moveItem",53,"MLListItem$init","deleteBtn","MLListItem$removeItem","listOwner","MLListItem$moveItem","MLListItem$isDropAllowed","isComponentAllowed","isDropAllowed","onItemDrop","onDragOut","getComponentState","onDragHover","MLListItem_get","MLListItem_set","_sendChangeMessage","MLListItem_del","LISTITEM_CHANGE_MESSAGE","MLListItem","dragenter","dragover","dragleave",54,"MLRadioGroup$init","CONF","ELEMENT_NAME_PROPERTY","ELEMENT_NAME_PREFIX","_renderOptions","MLRadioGroup$setRenderOptions","MLRadioGroup_set","setResult","_radioList","checked","MLRadioGroup_get","MLRadioGroup_del","onGroupClick","RADIO_CHANGE_MESSAGE","radioOptions","elementName","radioEls","MLRadioGroup$destroy","MLRadioGroup","click","setRenderOptions",55,"MLSelect$setOptions","modelChangeListener","MLSelect$disable","selectOptions","MLSelect","**",56,"MLSuperCombo$init","_optionsData","_filteredOptionsData","_comboOptions","_comboBefore","before","_comboAfter","after","_comboAddItemDiv","addItemDiv","_comboAddPrompt","addPrompt","_comboAddBtn","addBtn","_optionTemplate","OPTIONS_TEMPLATE","_startIndex","_endIndex","MAX_RENDERED","_hidden","_elementHeight","DEFAULT_ELEMENT_HEIGHT","_total","_optionsHeight","_lastScrollPos","_currentValue","_selected","_isAddButtonShown","setupComboList","setupComboInput","setupComboBtn","changeSelected","MLSuperCombo$toggleOptions","MLSuperCombo$showOptions","COMBO_OPEN","MLSuperCombo$hideOptions","MLSuperCombo$toggleAddButton","preserveState","__showAddOnClick","MLSuperCombo$setAddItemPrompt","_addItemPrompt","MLSuperCombo$setOptions","setFilteredOptions","MLSuperCombo$initOptionsURL","_optionsURL","url","_formatOptionsURL","formatOptions","_getOptionsURL","queryString","noop","request","post","err","response","responseData","MLSuperCombo$setFilteredOptions","update","MLSuperCombo$update","wasHidden","arrToShow","hideOptions","beforeHeight","afterHeight","height","overflow","width","zIndex","onListClick","scroll","onListScroll","onDataChange","onInputClick","onEnterKey","btn","onAddBtn","MLSuperCombo_get","MLSuperCombo_set","MLSuperCombo_del","_updateOptionsAndAddButton","filteredData","_filterData","filter","option","selected","filteredArr","isExactMatch","showOptions","scrollTop","directionMap","keyCode","_changeSelected","scrollPos","selectedPos","offsetTop","relativePos","_getDataValueFromElement","thisItem","adjItem","onMouseOver","_mouseIsOver","onMouseLeave","_mouseOutTimer","clearInterval","setTimeout","_onMouseLeave","_setData","lastElementChild","lastChild","firstElementChild","lastElPosition","firstElPosition","distFromLastEl","distFromFirstEl","elsFromStart","Math","floor","elsToTheEnd","totalElementsBefore","BUFFER","Number","MLSuperCombo","mouseleave","mouseover","toggleOptions","initOptionsURL",57,"MLText",58,"MLTextarea$startAutoresize","_autoresize","_autoresizeOptions","_adjustAreaHeight","_manageSubscriptions","onOff","newHeight","scrollHeight","minHeight","maxHeight","MLTextarea$stopAutoresize","MLTextarea$isAutoresized","MLTextarea$disable","MLTextarea","startAutoresize","stopAutoresize","isAutoresized",59,"MLTime_get","timeStr","TIME_REGEX","hours","mins","time","Date","MLTime_set","TIME_TEMPLATE","getHours","getMinutes","MLTime_del","MLTime",60,"MLWrapper",61,"MLAlert$$createAlert","close","timeout","alert","MLAlert","_prepareOptions","alertCls","ALERT_CSS_CLASSES","_alert","visible","alertScope","closeBtn","_onCloseBtnClick","closeAlert","MLAlert$$openAlert","createAlert","openAlert","MLAlert$openAlert","_toggleAlert","MLAlert$closeAlert","addRemove","appendRemove","success","warning","danger","fixed","role","aria-hidden","../../../util/component_name","../../c_class","../../c_registry",62,"MLDialog$$createDialog","initialize","title","html","backdrop","keyboard","buttons","Any","cssClass","dialog","MLDialog","_dialog","dialogScope","_onBackdropClick","buttonSubscriber","_dialogButtonClick","_toggleDialog","_dispatchResult","closeDialog","_onKeyDown","openedDialog","DEFAULT_BUTTONS","CLOSE_OPTIONS","mapToObject","opt","MLDialog$$openDialog","createDialog","openDialog","dialogsInitialized","_initializeDialogs","backdropEl","MLDialog$openDialog","MLDialog$closeDialog","MLDialog$$getOpenedDialog","MLDialog$destroy","getOpenedDialog",63,"MLDropdown$start","onDocOut","relatedTarget","listeners","_dropdown","isIframe","hideMenu","toggleEl","querySelector","TOGGLE_CSS_CLASS","menuEl","MENU_CSS_CLASS","doc","clickHandler","toggleMenu","DOMListeners","menu","MLDropdown$destroy","removeAll","MLDropdown$showMenu","MLDropdown$hideMenu","MLDropdown$toggleMenu","MLDropdown","showMenu","../../../util/dom_listeners",64,"componentPrefix","domStorage","typeSuffix","prefixSeparator","root","messageKey","messageTimestamp","quotaExceeded","throwError","componentMetaTemplate","componentMetaRegex","jsonpTimeout","jsonpCallbackPrefix","optionsKey","defaults","websocket","rpc","responsePrefix","deprecationWarning",65,"loader","_loader","miloMail","_loadViewsInElement","views","loadElements","totalCount","loadedCount","loadView","./attributes/a_load","./config","./util/request",66,"domReady","mail","registry","./attributes","./binder","./classes","./command","./components/c_class","./components/c_facet","./loader","./registry","./services/window","./use_components","./use_facets","./util","./util/create_component_class",67,"./command/cmd_registry",68,"eventTypes","ClipboardEvent","Event","FocusEvent","KeyboardEvent","MouseEvent","TouchEvent","global","eTypes","eventConstructorName","eventConstructor","makeFunction","domEventsConstructors",69,"eventEmitter","DOMEmitterSource$destroy","sourceSubscriberMethod","capture","useCapturePattern","isCapturePhase","eventPhase","CAPTURING_PHASE","useCapturePostfix","DOMEmitterSource$postMessage","EventConstructor","domEvent","notCancelled","dispatchEvent","../components/c_class","./de_constrs",70,"MailMsgAPI","MailMessageSource","mailMsgSource","./mail_api","./mail_source",71,"windowMessageRegExp","windowMessagePrefix",72,"isReadyStateChange","readystatechange","_windowSubscriberMethod","isWindowMessage","../de_constrs",73,"windowService_isTop","top","__karma__","windowService","domEmitterSource","isTop","./dom_source",74,"./components/classes/View","./components/ui/Button","./components/ui/Combo","./components/ui/ComboList","./components/ui/Date","./components/ui/DropTarget","./components/ui/FoldTree","./components/ui/Group","./components/ui/Hyperlink","./components/ui/Image","./components/ui/Input","./components/ui/InputList","./components/ui/List","./components/ui/ListItem","./components/ui/RadioGroup","./components/ui/Select","./components/ui/SuperCombo","./components/ui/Text","./components/ui/Textarea","./components/ui/Time","./components/ui/Wrapper","./components/ui/bootstrap/Dropdown",75,"./components/c_facets/Container","./components/c_facets/Data","./components/c_facets/Dom","./components/c_facets/Drag","./components/c_facets/Drop","./components/c_facets/Events","./components/c_facets/Frame","./components/c_facets/Item","./components/c_facets/List","./components/c_facets/ModelFacet","./components/c_facets/Options","./components/c_facets/Template","./components/c_facets/Transfer",76,"prefix","./unique_id",77,"superClassName","methods","staticMethods","SuperClass","componentRegistry","../components/c_registry",78,"deprecate","fn","deprecated","warned","prop",79,"filterNodeListByType","Node","ELEMENT_NODE","nodeList","nodeType","containingElement","selectElementContents","ownerDocument","range","createRange","selectNodeContents","getNodeWindow","sel","removeAllRanges","addRange","selectElementText","fromNode","firstTextNode","toNode","lastTextNode","setSelection","setCaretPosition","pos","setStart","getSelectionDirection","_getDirection","focusOffset","startOffset","endOffset","docPosition","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","originalContentEditable","backward","setEnd","collapse","commonAncestorContainer","parentElement","isContentEditable","contentEditable","clearSelection","getElementOffset","includeBorder","yPos","xPos","offsetLeft","offsetParent","getBorder","topOffset","leftOffset","side","styles","sideValue","parseInt","getPropertyValue","normalize","TEXT_NODE","replaceChild","wrapInElement","wrapIntoEl","trimNodeRight","_trimNode","trimNodeLeft","stripHtml","str","walkTree","tw","containsEl","nodeIndex","findIndex","childIndex","toNormalize","isTreePathBefore","path1","path2","isBefore","htmlEntities","charCodeAt","whatToShow","defaultView","parentWindow","forEachNodesInRange","isNodeInsideRange","nodeRange","isInside","selectNode","compareBoundaryPoints","Range","START_TO_START","END_TO_END","rangeContainer","getComponentsFromRange","startContainer","deleteRangeWithComponents","deleteContents","areRangesEqual","range1","range2","addDebugPoint","x","y","dbEl",80,"DOMListeners$add","handler","DOMListeners$remove","listener","idx","isEqual","_removeListener","DOMListeners$removeAll","l",81,"domReadySubscribed","onDomReady","domReadyFuncs",82,"DragDrop$$componentDataType","dragDropConfig","DragDrop$isComponent","componentDataType","DragDrop$getComponentState","stateStr","DragDrop$setComponentState","requestedBy","DragDrop$setComponentMeta","_componentMeta","paramsStr","toQueryString","_encode","base32","encode","DragDrop$getComponentMeta","metaDataType","dType","decode","fromQueryString","metaData","DragDrop$getAllowedEffects","effectAllowed","DragDrop$setAllowedEffects","DragDrop$getDropEffect","dropEffect","DragDrop$setDropEffect","effect","DragDrop$isEffectAllowed","getAllowedEffects","isCopy","isMove","isLink","isAllowed","DragDrop$getData","DragDrop$setData","dataStr","DragDrop$clearData","clearData","onDragDropStarted","_currentDragDrop","_currentDragFacet","onDragDropCompleted","onCompleteDragDrop","dragDropService","getCurrentDragDrop","DragDrop_destroy","offAll","getDropEffect","isEffectAllowed","dragdropstarted","dragdropcompleted","completedragdrop",83,"error$createClass","errorClassName","ErrorClass","makeSubclass","error$toBeImplemented","AbstractClass","errorClassNames","createClass",84,"fragment_getState","wrapperClassName","_getRangeContainer","cloneContents","wrapper","_wrapFragmentInContainer","_transferStates","_renameChildren","wrapperState","fragment_getStateAsync","fromComp","toComp","fromScope","toChildComp","fromChildComp","expandRangeToSiblings","siblings","getRangeSiblings","createRangeFromSiblings","nodes","setStartBefore","setEndAfter","end","containerNode","startNode","endNode","endContainer","startSibling","_findContainingChild","endSibling","selNode","_createNodesAndPathsFunc","fromObj","toObj","createRangePaths","createRangeNodes","getStateAsync","createRangeFromNodes","./dom",85,"util_destroy","domListeners","fragment","storage","../components/ui/bootstrap/Alert","../components/ui/bootstrap/Dialog","./component_name","./deprecate","./dom_listeners","./domready","./dragdrop","./error","./fragment","./json_parse","./request","./selection","./storage","./websocket",86,87,"createPromiseOverride","functionName","promise","Promise","keepRequestObject","_request","opts","onReady","_onReady","req","xPromise","contentType","XMLHttpRequest","open","setRequestHeader","setRequestHeaders","headers","onreadystatechange","ontimeout","onabort","_createXPromise","send","_pendingRequests","resolvePromise","rejectPromise","resolve","reject","then","promiseThen","promiseCatch","status","responseText","spliceItem","errorReason","reason","request$useMessenger","request$get","request$post","request$json","jsonPromise","errData","request$jsonp","_onResult","uniqueCallback","cleanUp","clearTimeout","head","script","jsonpOptions","omitKeys","request$file","fileData","progress","upload","onprogress","file","binary","formData","FormData","request$destroy","whenRequestsCompleted","delay","json","jsonp",88,"TextSelection","TextSelection$init","rangeCount","getRangeAt","TextSelection$text","_text","toString","TextSelection$textNodes","_textNodes","_getTextNodes","TextSelection$clear","textNodes","selStart","selEnd","inEnd","_getElement","thisPropName","rangePropName","_getComponent","elMethodName","TextSelection$containedComponents","_containedComponents","TextSelection$eachContainedComponent","containedComponents","TextSelection$del","selectEndContainer","selPoint","_getPostDeleteSelectionPoint","_selectAfterDelete","selOffset","offset","trimRight","TextSelection$getRange","TextSelection$getState","createStateObject","TextSelection$$createStateObject","_getSelectionPointState","TextSelection$$createFromState","_selectionNodeFromState","pointState","TextSelection$$createFromRange","endRange","cloneRange","TextSelection$$getNormalizedRange","newRange","TextSelection$$getDirection","TextSelection$startElement","TextSelection$endElement","TextSelection$containingElement","TextSelection$startComponent","TextSelection$endComponent","TextSelection$containingComponent","clear","startElement","endElement","startComponent","endComponent","containingComponent","eachContainedComponent","getRange","getNormalizedRange","getDirection","createFromRange","../../components/c_class","../dom",89,"keyPrefix","sessionOnly","_storage","sessionStorage","localStorage","_typeSuffix","_keys","DOMStorage$set","setItem","DomStorageError","DOMStorage$get","deepForEach","getItem","DOMStorage$remove","DOMStorage$hasItem","pKey","_storageKey","DOMStorage$getItem","_getKeyDataType","valueStr","_parseData","DOMStorage$setItem","_setKeyDataType","_serializeData","cfg","_domStorage","DOMStorage$removeItem","_removeKeyDataType","DOMStorage$getAllKeys","storedKeys","keysInStorage","hasItem","DOMStorage$getAllItems","getAllKeys","DOMStorage$_storageKey","DOMStorage$_domStorageKey","storageKey","unPrefix","_dataTypeKey","_getValueType","valueType","valuesDataTypes","serializer","dataSerializers","parser","dataParsers","DOMStorage$$registerDataType","storeAsDataType","DOMStorage$createMessenger","storageMessageSource","StorageMessageSource","_messageSource","DOMStorage$destroy","_storedKeys","true","false","_domStorageKey","getAllItems","createMessenger","_sessionStorage","_localStorage","local","session","valStr","boolean","number","function","toFunction","RegExp","toRegExp","./model","./msg_src",90,"Model$$registerWithDOMStorage","Model_domStorageSerializer","Model_domStorageParser","registerWithDOMStorage",91,"StorageMessageSource$addSourceSubscriber","StorageMessageSource$removeSourceSubscriber","StorageMessageSource$postMessage","StorageMessageSource$trigger","storageArea",92,"uniqueCount","newTimestamp","now","uniqueID","timestamp",93,"wsMessenger","wsMsgSource","WSMessageSource","connect","WSMsgAPI","./msg_api",94,"SOCKET_MESSAGES",95,"WSMessageSource$connect","_options","host","location","port","_ws","onopen","ws","onmessage","onclose","onerror","WebSocket","_wsSubscriberMethod","WSMessageSource$handleEvent","WSMessageSource$trigger","onTimeout","toggleRpcSubscription","callbackCorrId","onResponse","interval","corrId",96,"Encoder","skip","bits","output","readByte","byte","alphabet","finish","Decoder","readChar","char","fromCharCode","val","lookup","encoder","decoder","alias","table","flush",97,98,"_createProxyMethods","proxyMethodName","mixinMethodName","boundMethod","Mixin_setInstanceKey","hostClass","instanceKey","mixin","instancePropertiesMap","instanceKeys","Mixin_addMethod","hostMethodName","wrappedMethod","_wrapMixinMethod","mixinInstance","_getMixinInstance","Mixin$$useWith","mixinMethods","../util/check","mol-proto",99,"MessengerRegexpAPI","./abstract/mixin","./messenger/m_api","./messenger/m_api_rx","./messenger/m_source","./messenger/msngr_source",100,"deepExtend","debug",101,"_initializeSubscribers","_messageSubscribers","_patternMessageSubscribers","Messenger$destroy","Messenger$on","_Messenger_onWithOptions","Messenger$once","dispatchTimes","Messenger$onceSync","sync","Messenger$onSync","Messenger$onAsync","_Messenger_on","_eachMessage","messagesSplitRegExp","subscribersHash","_chooseSubscribersHash","changed","subscriptionChanged","_registerSubscriber","pattern","onSubscriberAdded","noSubscribers","msgSubscribers","notYetRegistered","_indexOfSubscriber","subscr","Messenger$off","_Messenger_off","_removeSubscriber","subscriberIndex","_removeAllSubscribers","onSubscriberRemoved","offMessages","subscriberRemovedMap","Messenger$offAll","_offAllSubscribers","subscribers","_synchronous","_callSubscribers","_callPatternSubscribers","calledMsgSubscribers","patternSubscribers","_callSubscriber","syncSubscriber","synchro","__messages","getSubscribers","includePatternSubscribers","onceSync","onAsync","onMessage","offMessage","subscriptions","../abstract/mixin","./m_source",102,"MessengerAPI$destroy","addInternalMessage","internalMsgs","_internalMessages","removeInternalMessage","unexpectedNotificationWarning","messageIndex","getInternalMessages","sourceData","../util/logger",103,"_patternInternalMessages","_catchAllSubscribed","noPatternInternalMessages","internalMessages","internalMessagesHash","patternMessages","sourcePattern","./m_api",104,"messengerAPI","_prepareMessengerAPI","MessageSource$destroy","setMessenger","newSourceMessage","removedSourceMessage","api","shouldDispatch",105,"sourceMessenger","MessengerMessageSource$postMessage",106,"./messenger","./minder",107,"ds1","mode","ds2","connDescriptions","connectors","descr","Connector","_addConnector","cnct","___minder_id","_connectors","onConnectorMessage","connector","_receivedMessages","_isPropagating","_idleCheck","minder_isPropagating","minder_whenPropagationCompleted","executeCallback","minder_getConnectors","isOn","minder_destroyConnector","minder_getExpandedConnections","searchStr","getConnectors","connections","connection","leftSource","_getExpandedSource","rightSource","cnctn","_sourceMatchesString","ds","source","_model","_accessPath","unshift","matchStr","some","srcNode","_stringMatch","substr","minder_destroy","destroyDS","getExpandedConnections","isPropagating","whenPropagationCompleted","./model/connector","./util/logger",108,"flag","__inChangeTransaction","passTransactionFlag","fromFunc","toFunc","processChanges","notify","processTransaction","prepareTransaction","validateTransaction","changeFinished","sameSource","checkChange","checkSplice","checkMethod","parentPathChanged","pathsToChange","parentPath","_pathIsParentOf","todo","exitLoop","pathsToSplice","hadSplice","parentPathSpliced","every","processChange","modelPath","executeSplice","executeMethod","howMany","CHANGE_TYPE_TO_METHOD_MAP","deleted","./path_utils",109,"setupMode","_changesQueue1","_changesQueue2","pathTranslation","patternTranslation","getPatternTranslations","pathTranslation1","reverseTranslationRules","pathTranslation2","patternTranslation1","reversePatternTranslationRules","patternTranslation2","dataTranslation","dataTranslation1","dataTranslation2","dataValidation1","dataValidation2","turnOn","modeParseError","parsedMode","modePattern","depth1","depth2","Connector$changeMode","turnOff","Connector$deferChangeMode","rules","reverseRules","path2_value","path1_key","_throwInvalidTranslation","_getStaticPath","starIndex1","starIndex2","fromPattern","createRegexPath","fromStaticPath","toPattern","toStaticPath","pt","Connector$turnOn","linkDataSource","reverseLink","fromDS","toDS","changesQueue","onData","batch","translatePath","sourcePath","translatedPath","pTranslation","subscriptionPattern","translateData","translate","validateData","callValidator","validator","alreadyFailed","valid","passedCount","validators","propagateData","sendData","postChangeData","subscriptionSwitch","mergeTransactions","batches","targetPath","subscriptionPath","_subscriptionPath","_link1","_link2","Connector$turnOff","unlinkDataSource","linkName","Connector$destroy","changeMode","../messenger",110,"Model$path","__proto__","reactive","_prepareMessengers","Model$get","ModelPath","proxyMessenger","modelHostObject","Model$$useWith","modelMethodsToProxy","internalMessenger","internalMessengerSource","ModelMsgAPI","externalMessenger","_getHostObject","Model$destroy","_internalMessenger","synthesize","modelMethods","../messenger/msngr_source","./change_data","./m_msg_api","./m_path","./model_utils","./synthesize",111,"../messenger/m_api_rx",112,"ModelPath$path","_args","interpolateAccessPath","_prepareMessenger","freeze","reduce","accessPathStr","currNode","thisPathArgsCount","newPath","ModelPath$len","ModelPath$push","newLength","ModelPath$pop","ModelPath$unshift","ModelPath$shift","mPathAPI","ModelPathMsgAPI","modelMessageSource","mPathMessenger","_getDefinition","_createFromDefinition","definition","ModelPath$destroy","pop","./path_msg_api",113,114,"rootPath","internalChanges","truncateChangePath","fullPath","../messenger/m_api",115,"nodeParsePattern","pathParsePattern","unparsed","nodeStr","pathNodeTypes","patternPathParsePattern","regexStr","patternsStarted","regex","nodeRegex","interpolated","startIndex","methodsNames","wrappedMethods","origMethod","regexPath","propertyPathSyntax","arrayPathSyntax","interpolationSyntax","propertyInterpolateSyntax","arrayInterpolateSyntax","propertyStarSyntax","arrayStarSyntax","starSyntax","pathParseSyntax","patternPathParseSyntax",".","[","*",".*","[*]",116,"_synthesizePathMethods","synthesizers","synthszr","_synthesize","synthesizer","addChangeMessage","messagesHash","addTreeChangesMessages","oldIsTree","valueIsTree","newIsTree","addMessages","valueProp","_addMessages","addMessage","existingMsg","cloneTree","valueIsNormalObject","protectValue","addBatchIdsToMessage","batchId","msgId","__batch_id","__msg_id","methodCode","eval","ModelError","fs","templates","include_defines","include_create_tree","include_traverse_tree","dotDef","modelAccessPrefix","modelPostMessageCode","modelPostBatchCode","modelDotDef","dotSettings","templateSettings","strip","tmpl","modelSynthesizers","synthesizePathMethods","memoize","../../util/logger","../change_data","../model_utils","../path_utils","dot",117,"choices","Where","condition","Superclass","matchSuperclassToo","matchSuperclass","checkSubtree","typeofChecks","_jsKeywords","valueElement","_prependPath","unknownKeysAllowed","keyPattern","emptyHash","requiredPatterns","optionalPatterns","subPattern","subValue","base","TypeError",118,"./check","./logger",119,"Logger","level","./logger_class",120,"maxLevelLength","colored","color","levels","colors","DEFAULT_OPTIONS","throwLevel","enabled","logPrefix","log","console","logPrefixColor",121,"resolveDefs","c","block","def","define","code","assign","substring","defineParams","param","v","arg","use","useParams","d","rw","__exp","unescape","_globals","version","evaluate","conditional","iterate","varname","selfcontained","doNotSkipEncoded","encodeHTMLSource","encodeHTMLRules","&","<",">","\"","'","/","matchHTML","amd","startend","startencode","needhtmlencode","indv","cse","sid","elsecase","vname","iname","_encodeHTML",122,"InstallDots","__path","__destination","destination","__global","__rendermodule","rendermodule","__settings","__includes","addexports","ret","readdata","readFileSync","process","compileAll","compileToFile","modulename","lastIndexOf","defs","settings","compileoptions","defaultcompiled","compiled","writeFileSync","compilePath","k","defFolder","sources","readdirSync","./doT",123,"Proto","wrapped","unwrapProto","utils","prototypeMethods","objectMethods","arrayMethods","functionMethods","stringMethods","numberMethods","utilMethods","__","_constants","protoFuncs","makeProtoFunction","protoInstanceMethods","makeProtoInstanceMethod","underscore","./proto_array","./proto_function","./proto_number","./proto_object","./proto_prototype","./proto_string","./proto_util","./utils",124,"arrayToAppend","prependArray","arrayToPrepend","values","valuesIsArray","unique","itemIndex","filtered","it","itemIndexOf","_deepForEach","nativeArrayMethodsNames","nativeArrayMethods","makeFindMethod",125,"arg1","arg2","funcBody","partialRight","hashFunc","limit","cache","keysList","wait","_delay","deferTicks","ticks","deferFunc","delayMethod","funcOrMethodName","_delayMethod","delayed","passArgs","deferred","debounce","immediate","later","last","callNow","previous","leading","remaining","trailing","memo","ran","waitFor","maxTimeout","timedOutFunc","checkInterval","testCondition","setInterval","not",126,"isNumeric","isNaN","parseFloat","isFinite",127,"onlyEnumerable","descriptors","getOwnPropertyDescriptor","clonedObject","propertyName","decriptorFlags","_getDescriptor","descriptor","constants","ENUMERABLE","configurable","CONFIGURABLE","writable","WRITABLE","propertyValues","_extendTree","selfNode","objNode","objTraversed","loop","allKeys","getOwnPropertyNames","keyOf","searchElement","allKeysOf","mapProperty","reduceKeys","initialValue","filterProperty","testProperty","_passed","everyKey","_didNotPass","pickKeys","ArrayProto","multiline","ignoreCase","isNot","findValue","findKey",128,"propDescriptors","applyConstructor","thisClass","subclass","constructorCode",129,"toUpperCase","rx","regexpStringPattern","getTime","qs","encodeURIComponent","pairs","results","decodeURIComponent","pair","splitPair","hashCode","hash",130,"times","tap","identity","compareProperty","b",131,"eachMethod","findWhat","argIndex","testItem","caughtError","_error"],"mappings":"CAAC,QAAUA,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATC,UAAqBA,OAAQ,KAAIF,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGI,EAAE,MAAOA,GAAEJ,GAAE,EAAI,MAAM,IAAIK,OAAM,uBAAuBL,EAAE,KAAK,GAAIM,GAAET,EAAEG,IAAIO,WAAYX,GAAEI,GAAG,GAAGQ,KAAKF,EAAEC,QAAQ,SAASZ,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIW,EAAEA,EAAEC,QAAQZ,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGO,QAAkD,IAAI,GAA1CH,GAAkB,kBAATD,UAAqBA,QAAgBH,EAAE,EAAEA,EAAEF,EAAEW,OAAOT,IAAID,EAAED,EAAEE,GAAI,OAAOD,KAAKW,GAAG,SAASP,EAAQQ,GAC/a,YAeA,SAASC,GAAMC,EAAOC,GAClBC,KAAKC,KAAOC,EAAEC,eAAeH,KAAKI,YAAYH,MAC9CD,KAAKF,MAAQA,EACbE,KAAKD,OAASA,MACdC,KAAKK,KAAKC,MAAMN,KAAMO,WAhB1B,GAAIL,GAAId,EAAQ,aAAaoB,KAE7BZ,GAAOJ,QAAUK,EAqBjBK,EAAEO,YAAYZ,GACVQ,KAAM,iBAGPK,YAAY,MAAMC,GAAG,SAASvB,EAAQQ,GACzC,YAsBA,SAASgB,KA4BL,QAASC,GAAiBC,EAAYC,GAElC,GAAIC,GAAYC,EAAaF,EAG7BG,GAAOH,GAAa,GAAID,GAAWd,KAAMgB,GAGzCG,EAAkBJ,IACdK,YAAY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file":"milo.min.js","sources":["milo.bundle.js"],"names":["e","t","n","r","s","o","u","a","require","i","Error","f","exports","call","length",1,"module","Facet","owner","config","this","name","_","firstLowerCase","constructor","init","apply","arguments","proto","extendProto","milo-core",2,"FacetedObject","instantiateFacet","FacetClass","facetName","fctConfig","facetsConfig","facets","facetsDescriptors","enumerable","value","facetsClasses","eachKey","Object","defineProperties","defineProperty","FacetedObject$addFacet","facetConfig","throwOnErrors","check","Function","Match","Optional","String","protoFacets","prototype","message","logger","error","newFacet","ENUM","FacetedObject$$hasFacet","FacetedObject$$getFacetConfig","hasFacet","FacetedObject$$createFacetedClass","addInheritedFacets","superClass","facetsInfo","facetsInfoName","inheritedFacetsInfo","clone","extend","ObjectHash","Subclass","fctName","hasOwnProperty","FacetedClass","createSubclass","miloCore","util","createFacetedClass","getFacetConfig","addFacet","./facet",3,"ClassRegistry","FoundationClass","setClass","__registeredClasses","add","aClass","IdentifierString","get","remove","nameOrClass","OneOf","clean",4,"attrName","attrs","bind","parse","node","bindTo","match","ATTRIBUTE_REGEXP","compClass","compFacets","split","FACETS_SPLIT_REGEXP","undefined","compName","validate","render","milo","componentName","ATTRIBUTE_TEMPLATE","replace","join","BindAttribute$$setInfo","el","componentClass","componentFacets","attr","BindAttribute","decorate","Attribute","setInfo","../config","./a_class",5,"attributes","Attribute$$remove","deep","removeAttribute","selector","children","querySelectorAll","forEach","childEl","Attribute$remove","Attribute$destroy","Attribute$get","getAttribute","Attribute$set","setAttribute","Attribute$decorate","set","toBeImplemented","destroy",6,"load","loadUrl","LoadAttribute",7,"./a_bind","./a_load",8,"binder","scopeEl","rootScope","bindRootElement","createBinderScope","scope","info","ComponentInfo","Component","create","twoPass","scanScope","scan","hostObject","Scope","_rootEl","addMethod","_each","compInfo","aComponent","container","scopeObjectFactory","createScopeForElement","postChildrenBoundMessage","elComp","getComponent","postMessageSync","scopedObject","isContainer","childNodes","innerScope","_hostObject","createScopeForChildren","containerEl","utilDom","document","body","componentsRegistry","./attributes/a_bind","./components/c_facets/cf_registry","./components/c_info","./components/c_registry","./components/scope","./services/mail","./util/dom",9,"coreClasses","classes","Mixin","MessageSource","MessengerMessageSource","MessengerAPI","DOMEventsSource","Transaction","TransactionHistory","./abstract/facet","./abstract/faceted_object","./abstract/registry","./command/transaction","./command/transaction_history","./components/msg_src/dom_events",10,"ActionsHistory","maxLength","_maxLength","Infinity","actions","position","ActionsHistory$store","command","_truncateToCurrentPosition","push","act","shift","ActionsHistory$deleteLast","ActionsHistory$undo","cb","undo","ActionsHistory$redo","redo","ActionsHistory$undoAll","ActionsHistory$redoAll","ActionsHistory$undoAllAsync","deferMethod","defer","ActionsHistory$redoAllAsync","ActionsHistory$each","funcOrMethod","thisArg","func","ActionsHistory$eachReverse","reverse","each","ActionsHistory$getLastAction","ActionsHistory$getDescription","map","getDescription","store","deleteLast","undoAll","redoAll","undoAllAsync","redoAllAsync","eachReverse","getLastAction",11,"Command","commandsRegistry","../abstract/registry","./index",12,"Command$init","args","slice","Command$execute","result","Command$setUndo","undoCommand","UNDO_COMMAND","warn","Command$getUndo","Command$undo","undoCmd","getUndo","execute","Command$setArguments","toArray","Command$getArguments","Command$changeArguments","Command$addArguments","appendArray","Command$$create","newApply","Command$$createWithUndo","Command$destroy","Command$setComment","comment","Command$getDescription","setUndo","setArguments","addArguments","getArguments","changeArguments","setComment","createWithUndo",13,"commands","Transaction$execute","Transaction$undo","Transaction$redo","Transaction$destroy","Transaction$storeCommand","Transaction$merge","transaction","cmd","Transaction$setComment","Transaction$getDescription","storeCommand","merge","./actions_history",14,"transactions","currentBatch","currentTransaction","SCHEDULED","TransactionHistory$storeCommand","appendTransaction","_postTransactionMessage","_storeTransaction","TransactionHistory$deleteLastTransaction","_addBatchToTransaction","_storeCurrentTransaction","TransactionHistory$endTransaction","TransactionHistory$storeTransaction","endTransaction","msg","_messenger","postMessage","TransactionHistory$undo","TransactionHistory$redo","TransactionHistory$inTransaction","TransactionHistory$getDescription","TransactionHistory$useMessenger","Messenger","defaultMethods","TransactionHistory$destroy","storeTransaction","deleteLastTransaction","inTransaction","useMessenger","./transaction",15,"Component$$createComponentClass","Array","isArray","configMap","fct","keys","fctClassName","firstUpperCase","facetsRegistry","ComponentClass","_registerWithDomStorage","className","DOMStorage","registerDataType","Component_domStorageSerializer","Component_domStorageParser","component","state","getState","JSON","stringify","compStr","jsonParse","createFromState","Component$$create","extraFacetsClasses","Component$$copy","deepCopy","Boolean","newEl","dom","copy","cloneNode","createOnElement","extraFacets","_getState","setState","Component$$createOnElement","innerHTML","_createComponentElement","_findOrCreateComponentRootScope","_addAttributeAndBindComponent","broadcast","Dom","domFacetConfig","templateFacetConfig","template","elConfig","domConfig","content","createElement","parent","getContainingComponent","miloBinder","Component$$createFromState","newUniqueName","ObjectIncluding","facetsStates","outerHTML","wrapEl","_createComponentWrapElement","_any","_add","domUtils","compEl","miloComponentName","Component$$createFromDataTransfer","dataTransfer","dataType","find","types","type","COMPONENT_DATA_TYPE_REGEX","test","getData","Component$init","element","componentInfo","componentRef","messenger","MESSENGER_PROPERTY","allFacets","start","Component$start","Component$createElement","Component$hasFacet","facetNameOrClass","facet","ComponentFacet","Component$addFacet","facetClassName","Component$allFacets","method","mapKeys","Component$rename","renameInScope","rename","Component$remove","preserveScopeProperty","quiet","_remove","Component$insertInto","parentEl","referenceEl","insertBefore","setScopeParentFromDOM","Component$getState","rootComponent","Component$getTransferState","options","transfer","Component$_getState","deepState","filterKeys","fctState","Component$setState","Component$getScopeParent","conditionOrFacet","_callGetScopeParent","_getScopeParent","_getScopeParentFunc","conditionFunc","componentUtils","_makeComponentConditionFunc","Component$getScopeParentWithClass","comp","Component$getTopScopeParent","_getTopScopeParent","topParent","Component$getTopScopeParentWithClass","Component$setScopeParentFromDOM","foundParent","parentNode","Component$walkScopeTree","callback","walkScopeTree","Component$treePathOf","treePathOf","Component$getComponentAtTreePath","treePath","nearest","getNodeAtTreePath","Component$insertAtTreePath","wasInserted","insertAtTreePath","Component$broadcast","data","synchronously","postMethod","Component$destroy","_destroyed","detachComponent","removeElement","Component$isDestroyed","createComponentClass","isComponent","createFromDataTransfer","insertInto","getTransferState","getScopeParent","getTopScopeParent","getScopeParentWithClass","getTopScopeParentWithClass","getComponentAtTreePath","isDestroyed","useWith","../abstract/faceted_object","../attributes/a_bind","../binder","../util/component_name","../util/dom","../util/storage","./c_facets/cf_registry","./c_utils","./scope",16,"ComponentFacet$init","_createMessenger","ComponentFacet$start","messages","onConfigMessages","ComponentFacet$onConfigMessages","messageSubscribers","notYetRegisteredMap","subscriber","subscriberType","on","contextType","context","ComponentFacet$check","reqFacet","ComponentFacet$destroy","domParent","parentComponent","scopeParent","_postParent","getParentMethod","messageType","messageData","parentFacet","_setMessageSource","messageSource","getMessageSource","dispatchSourceMessage","dispatchMessage","_createMessageSource","MessageSourceClass","_createMessageSourceWithAPI","messengerAPIOrClass","requiresFacet","facetRequire","indexOf","postDomParent","partial","postScopeParent","../abstract/facet",17,"Container$binder","Container$start","Container$path","path","throwInvalidPath","len","allowedNamePattern","Container$getState","Container$setState","compData","Container$destroy","_detachElement","Container$unwrap","renameChildren","unwrapElement","child","Container$append","appendChild","Container$insertBefore","sibling","Container$remove","removeChild","Container","unwrap","append","../../binder","../../util/dom","../c_facet","../scope","./cf_registry",18,"Data$start","pathUtils","wrapMessengerMethods","elData","getElementDataAccess","_dataChangesQueue","_prepareMessageSource","_path","_value","onSync","onOwnDataChange","onDataChangesFinished","onChildData","changeDataHandler","dataAPI","DataMsgAPI","dataEventsSource","proxyDataSourceMethods","_createProxyMethod","msgType","_bubbleUpDataChange","_queueDataChange","getTransactionFlag","Data$_bubbleUpDataChange","msgData","parentData","parentMsg","Data$_queueDataChange","change","_postDataChanges","Data$_postDataChanges","queue","changes","Data$set","executeHook","noHook","setTransactionFlag","_set","oldValue","newValue","Data$_set","setChildData","valueSet","childValue","key","pathSyntax","childPath","childDataFacet","listFacet","list","listLength","count","newItemsCount","_addItems","_updateDataPaths","index","listCount","removeCount","_removeItem","_setScalarValue","Data$del","postTransactionFinished","_del","Data$_del","Data$_setScalarValue","Data$get","deepGet","_get","Data$_get","scopeData","listItem","scopeItem","contains","_getScalarValue","Data$_getScalarValue","Data$splice","_splice","spliceIndex","removed","addedCount","methodName","hook","Data$_splice","spliceHowMany","modelUtils","normalizeSpliceIndex","item","itemData","added","argsLen","addItems","j","Data$len","_len","Data$_len","Data$path","accessPath","createItem","parsedPath","parseAccessPath","currentComponent","pathNode","nodeKey","getPathNodeKey","syntax","itemComponent","_addItem","property","currentDataFacet","Data$getPath","Data$getKey","Data$getState","Data$setState","Model","_utils","model","Data","del","splice","getPath","getKey","Path","trigger","../msg_api/data","../msg_api/de_data","../msg_src/dom_events",19,"Dom$$createElement","tagName","_applyConfigToElement","doT","cssClasses","cls","configAttributes","attrValue","_attachCssClasses","currentStyle","window","getComputedStyle","_visible","display","show","toggle","hide","doShow","style","_manageCssClasses","enforce","callMethod","cssCls","doToggle","classList","detach","setStyle","setStyles","properties","isDeep","prepend","thisEl","firstChild","appendChildren","prependChildren","insertAfter","nextSibling","appendToScopeParent","Dom$children","direction","iterator","findDirections","treeWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","currentNode","nextNode","found","hasTextBeforeSelection","selection","getSelection","isCollapsed","text","focusNode","textContent","startPos","charAt","anchorOffset","SHOW_TEXT","anchorNode","prevNode","previousNode","isText","nodeValue","trim","hasTextAfterSelection","addCssClasses","removeCssClasses","toggleCssClasses","up","down","../../attributes/a_bind","../../config",20,"Drag$init","_dragData","dataTypeInfo","_dataTypeInfo","Drag$setHandle","handleEl","_dragHandle","Drag$start","_addDragAttribute","_createDragImage","onMessages","mousedown","onMouseDown","mouseenter mouseleave mousemove","onMouseMovement","dragstart","onDragStart","drag","onDragging","dragend","onDragEnd","getstatestarted","_removeDragAttribute","getstatecompleted","dragImage","_dragElement","Image","src","url","eventType","event","__mouseDownTarget","target","targetInDragHandle","empty","stopPropagation","shouldBeDraggable","setMeta","params","getMetaData","_dragMetaDataType","dt","setComponentMeta","_dragMetaData","meta","setAdditionalDataTypes","dataTypes","_dataTypesData","getDataFunc","setData","off","preventDefault","setDragImage","x","y","DragDrop","setComponentState","_setAllowedEffects","service","dragDrop","dragFacet","_dragIsDisabled","effects","allowedEffects","setAllowedEffects","Drag","setHandle","../../util/dragdrop","../c_class",21,"Drop$init","DropMsgAPI","Drop$start","dragenter dragover","drop","onDrop","dragenter dragover dragleave drop dragin dragout","postToService","_handleDropDependency","setDropEffect","dropFacet","_handleDropDependencyNothrottle","originalDropComponent","allow","parentAllowed","checkParent","_isDropAllowed","allowComps","components","getComponentMeta","Drop","throttle","../msg_api/drop",22,"Events$init","domEventsSource","MSG_SOURCE_KEY","Events",23,"Frame$init","FrameMessageSource","Frame$start","postDomReady","self","Frame$destroy","Frame$getWindow","contentWindow","Frame$isReady","readyState","getWindow","Frame$isMiloReady","frameMilo","isReady","milo_version","Frame$milo","whenMiloReady","win","_makeWhenReadyFunc","isReadyFunc","callFunc","Frame","Frame$whenReady","Frame$whenMiloReady","whenReady","isMiloReady","../../services/de_constrs","../msg_src/frame",24,"ItemFacet$getState","getIndex","ItemFacet$setState","setIndex","ItemFacet$getIndex","ItemFacet$setIndex","ItemFacet$removeItem","removeItem","ItemFacet$extractItem","extractItem","ItemFacet","../../services/mail",25,"List$init","_listItems","_listItemsHash","WRIT","List$start","onChildrenBound","items","itemsHash","foundItem","itemSample","LIST_SAMPLE_CSS_CLASS","miloConfig","_createCacheTemplate","List$_createCacheTemplate","itemElCopy","itemsTemplateStr","itemsTemplate","compile","List$item","List$count","List$_setItem","List$contains","List$addItem","List$_addItem","prevComponent","_itemPreviousComponent","_setItem","_updateItemsIndexes","fromIndex","toIndex","List$addItems","itemsData","concat","repeat","spliceArgs","dataFacet","List$_addItems","Integer","itemsHTML","frag","createDocumentFragment","newComponents","List$removeItem","List$extractItem","itemComp","List$_removeItem","doDestroyItem","List$replaceItem","newItem","oldItem","List$_updateDataPaths","List$each","List$destroy","List","addItem","replaceItem","../../util/component_name",26,"ModelFacet$init","m","ModelFacet$getState","modelValue","deepClone","ModelFacet$setState","ModelFacet$_createMessenger","ModelFacet$destroy","ModelFacet",27,"Options$init","proxyMethods","Options$_createMessenger","Options$destroy","Options",28,"Template$init","interpolate","compileOptions","Template$start","autoRender","autoBinder","Template$getCompiled","_template","Template$set","templateStr","_templateStr","_compile","Template$render","Template$binder","Template","getCompiled",29,"Transfer$init","_activeState","_defaultKey","_state","Transfer$getState","Transfer$setState","setActiveState","Transfer$setActiveState","Transfer$setStateWithKey","isDefaultKey","Transfer$getStateWithKey","Transfer$getComponentMeta","Transfer","setStateWithKey","getStateWithKey",30,"../../abstract/registry",31,"getComponentClass","getComponentExtraFacets","hasContainerFacet","ComponentInfo$destroy","ComponentInfo$rename","reportBinderError","classHasFacetThatRequiresContainer","someKey","facetRequiresContainer","./c_registry",32,"./c_class",33,"returnCurrent","_getContainingComponent",34,"View","../c_registry",35,"DataMsgAPI$init","DataMsgAPI$value","componentGetter","translateToSourceMessage","componentEvent","filterSourceMessage","sourceMessage","createInternalData","internalData","./de_data",36,"inputDataProperty","inputType","inputElementTypes","byDefault","inputChangeEvent","toLowerCase","domElementsDataAccess","div","span","p","input","textarea","select","img","caption","thead","tbody","tfoot","tagInfo","propFunc","checkbox","radio",37,"dropEventsMap","resetFilterVars","_currentTarget","_inside","ok","dragin","dragout",38,"DOMEventsSource$destroy","emitter","DOMEmitterSource","../../services/dom_source",39,"frameWindow","addSourceSubscriber","addEventListener","removeSourceSubscriber","removeEventListener","handleEvent",40,"rootEl","Scope$_add","object","checkName","__add","Scope$_safeAdd","shouldRename","Scope$_copy","aScope","Scope$_move","otherScope","Scope$_merge","Scope$_each","Scope$_filter","Scope$_length","Scope$_any","Scope$_remove","Scope$_clean","Scope$_detachElement","Scope$_has","Scope$$rename","obj","_safeAdd","_copy","_move","_merge","_length","_clean","_has","_filter",41,"MLButton$disable","disable","disabled","MLButton$isDisabled","MLButton","events","isDisabled",42,"MLCombo$init","_comboInput","_comboList","datalist","DATALIST_TEMPLATE","dispatchChangeMessage","MLCombo_get","MLCombo_set","changeComboData","MLCombo_del","COMBO_CHANGE_MESSAGE","onOptionsChange","comboOptions","MLCombo","***",43,"MLComboList$init","_dataValidation","once","MLComboList$setDataValidation","dataValidation","MLComboList$setOptions","arr","_combo","setOptions","MLComboList$clearComboInput","clearComboInput","MLComboList$toggleAddButton","toggleAddButton","MLComboList$setAddItemPrompt","prompt","setAddItemPrompt","MLComboList$destroy","_connector","minder","destroyConnector","componentSetup","combo","_list","onComboChange","onAddItem","onItemsChange","COMBO_LIST_CHANGE_MESSAGE","MLComboList_get","MLComboList_set","MLComboList_del","MLComboList","setDataValidation",44,"MLDate$getMin","date","min","MLDate$setMin","toDate","toISO8601Format","MLDate$getMax","max","MLDate$setMax","MLDate_get","MLDate_set","dispatchInputMessage","MLDate_del","pad","dateArr","getFullYear","getMonth","getDate","dateStr","MLDate","getMin","setMin","getMax","setMax",45,"MLDropTarget",46,"foldUnfold","itemMessage","id","_itemsMap","onItemEvent","MLFoldTree$setItemTemplate","_itemTemplate","MLFoldTree$renderTree","_renderTree","itemsIDs","uniqueId","COMPILED_TREE_TEMPLATE","itemIDs","itemTemplate","DEFAULT_COMPILED_ITEM_TEMPLATE","treeTemplate","_data","TREE_TEMPLATE","MLFoldTree","click dblclick","setItemTemplate","renderTree","../../util/unique_id",47,"MLGroup",48,"MLHyperlink",49,"MLImage$init","MLImage_set","MLImage_get","MLImage_del","IMAGE_CHANGE_MESSAGE","onModelChange","MLImage",".src",50,"MLInput$disable","MLInput$isDisabled","MLInput$setMaxLength","MLInput","setMaxLength",51,"MLInputList$init","MLInputList$setPlaceHolder","placeHolder","_input","MLInputList$setAsync","newHandler","asyncHandler","MLInputList$destroy","_button","button","onClick","label","INPUT_LIST_CHANGE_MESSAGE","MLInputList_get","MLInputList_set","MLInputList_del","MLInputList_splice","MLInputList","setAsync","setPlaceHolder",52,"MLList$init","MLList$destroy","MLList$removeItem","MLList$moveItem","from","to","splicedData","deferChangeMode","MLList","moveItem",53,"MLListItem$init","deleteBtn","MLListItem$removeItem","listOwner","MLListItem$moveItem","MLListItem$isDropAllowed","isComponentAllowed","isDropAllowed","onItemDrop","onDragOut","getComponentState","onDragHover","MLListItem_get","MLListItem_set","_sendChangeMessage","MLListItem_del","LISTITEM_CHANGE_MESSAGE","MLListItem","dragenter","dragover","dragleave",54,"MLRadioGroup$init","CONF","ELEMENT_NAME_PROPERTY","ELEMENT_NAME_PREFIX","_renderOptions","MLRadioGroup$setRenderOptions","MLRadioGroup_set","setResult","_radioList","checked","MLRadioGroup_get","MLRadioGroup_del","onGroupClick","RADIO_CHANGE_MESSAGE","radioOptions","elementName","radioEls","MLRadioGroup$destroy","MLRadioGroup","click","setRenderOptions",55,"MLSelect$setOptions","modelChangeListener","MLSelect$disable","selectOptions","MLSelect","**",56,"MLSuperCombo$init","_optionsData","_filteredOptionsData","_comboOptions","_comboBefore","before","_comboAfter","after","_comboAddItemDiv","addItemDiv","_comboAddPrompt","addPrompt","_comboAddBtn","addBtn","_optionTemplate","OPTIONS_TEMPLATE","_startIndex","_endIndex","MAX_RENDERED","_hidden","_elementHeight","DEFAULT_ELEMENT_HEIGHT","_total","_optionsHeight","_lastScrollPos","_currentValue","_selected","_isAddButtonShown","setupComboList","setupComboInput","setupComboBtn","changeSelected","MLSuperCombo$toggleOptions","MLSuperCombo$showOptions","COMBO_OPEN","MLSuperCombo$hideOptions","MLSuperCombo$toggleAddButton","preserveState","__showAddOnClick","MLSuperCombo$setAddItemPrompt","_addItemPrompt","MLSuperCombo$setOptions","setFilteredOptions","MLSuperCombo$initOptionsURL","_optionsURL","_formatOptionsURL","formatOptions","_getOptionsURL","queryString","noop","request","post","err","response","responseData","MLSuperCombo$setFilteredOptions","update","MLSuperCombo$update","wasHidden","arrToShow","hideOptions","beforeHeight","afterHeight","height","overflow","width","zIndex","onListClick","scroll","onListScroll","onDataChange","onInputClick","onEnterKey","btn","onAddBtn","MLSuperCombo_get","MLSuperCombo_set","MLSuperCombo_del","_updateOptionsAndAddButton","filteredData","_filterData","filter","option","selected","filteredArr","isExactMatch","showOptions","scrollTop","directionMap","keyCode","_changeSelected","scrollPos","selectedPos","offsetTop","relativePos","_getDataValueFromElement","thisItem","adjItem","onMouseOver","_mouseIsOver","onMouseLeave","_mouseOutTimer","clearInterval","setTimeout","_onMouseLeave","_setData","lastElementChild","lastChild","firstElementChild","lastElPosition","firstElPosition","distFromLastEl","distFromFirstEl","elsFromStart","Math","floor","elsToTheEnd","totalElementsBefore","BUFFER","Number","MLSuperCombo","mouseleave","mouseover","toggleOptions","initOptionsURL",57,"MLText",58,"MLTextarea$startAutoresize","_autoresize","_autoresizeOptions","_adjustAreaHeight","_manageSubscriptions","onOff","newHeight","scrollHeight","minHeight","maxHeight","MLTextarea$stopAutoresize","MLTextarea$isAutoresized","MLTextarea$disable","MLTextarea","startAutoresize","stopAutoresize","isAutoresized",59,"MLTime_get","timeStr","TIME_REGEX","hours","mins","time","Date","MLTime_set","TIME_TEMPLATE","getHours","getMinutes","MLTime_del","MLTime",60,"MLWrapper",61,"MLAlert$$createAlert","close","timeout","alert","MLAlert","_prepareOptions","alertCls","ALERT_CSS_CLASSES","_alert","visible","alertScope","closeBtn","_onCloseBtnClick","closeAlert","MLAlert$$openAlert","createAlert","openAlert","MLAlert$openAlert","_toggleAlert","MLAlert$closeAlert","addRemove","appendRemove","success","warning","danger","fixed","role","aria-hidden","../../../util/component_name","../../c_class","../../c_registry",62,"MLDialog$$createDialog","initialize","title","html","backdrop","keyboard","buttons","Any","cssClass","dialog","MLDialog","_dialog","dialogScope","_onBackdropClick","buttonSubscriber","_dialogButtonClick","_toggleDialog","_dispatchResult","closeDialog","_onKeyDown","openedDialog","DEFAULT_BUTTONS","CLOSE_OPTIONS","mapToObject","opt","MLDialog$$openDialog","createDialog","openDialog","dialogsInitialized","_initializeDialogs","backdropEl","MLDialog$openDialog","MLDialog$closeDialog","MLDialog$$getOpenedDialog","MLDialog$destroy","getOpenedDialog",63,"MLDropdown$start","onDocOut","relatedTarget","listeners","_dropdown","isIframe","hideMenu","toggleEl","querySelector","TOGGLE_CSS_CLASS","menuEl","MENU_CSS_CLASS","doc","clickHandler","toggleMenu","DOMListeners","menu","MLDropdown$destroy","removeAll","MLDropdown$showMenu","MLDropdown$hideMenu","MLDropdown$toggleMenu","MLDropdown","showMenu","../../../util/dom_listeners",64,"componentPrefix","domStorage","typeSuffix","prefixSeparator","root","messageKey","messageTimestamp","quotaExceeded","throwError","componentMetaTemplate","componentMetaRegex","jsonpTimeout","jsonpCallbackPrefix","optionsKey","defaults","websocket","rpc","responsePrefix","deprecationWarning",65,"loader","_loader","miloMail","_loadViewsInElement","views","loadElements","totalCount","loadedCount","loadView","./attributes/a_load","./config","./util/request",66,"domReady","mail","registry","./attributes","./binder","./classes","./command","./components/c_class","./components/c_facet","./loader","./registry","./services/window","./use_components","./use_facets","./util","./util/create_component_class",67,"./command/cmd_registry",68,"eventTypes","ClipboardEvent","Event","FocusEvent","KeyboardEvent","MouseEvent","TouchEvent","global","eTypes","eventConstructorName","eventConstructor","makeFunction","domEventsConstructors",69,"eventEmitter","DOMEmitterSource$destroy","sourceSubscriberMethod","capture","useCapturePattern","isCapturePhase","eventPhase","CAPTURING_PHASE","useCapturePostfix","DOMEmitterSource$postMessage","EventConstructor","domEvent","notCancelled","dispatchEvent","../components/c_class","./de_constrs",70,"MailMsgAPI","MailMessageSource","mailMsgSource","./mail_api","./mail_source",71,"windowMessageRegExp","windowMessagePrefix",72,"isReadyStateChange","readystatechange","_windowSubscriberMethod","isWindowMessage","../de_constrs",73,"windowService_isTop","top","__karma__","windowService","domEmitterSource","isTop","./dom_source",74,"./components/classes/View","./components/ui/Button","./components/ui/Combo","./components/ui/ComboList","./components/ui/Date","./components/ui/DropTarget","./components/ui/FoldTree","./components/ui/Group","./components/ui/Hyperlink","./components/ui/Image","./components/ui/Input","./components/ui/InputList","./components/ui/List","./components/ui/ListItem","./components/ui/RadioGroup","./components/ui/Select","./components/ui/SuperCombo","./components/ui/Text","./components/ui/Textarea","./components/ui/Time","./components/ui/Wrapper","./components/ui/bootstrap/Dropdown",75,"./components/c_facets/Container","./components/c_facets/Data","./components/c_facets/Dom","./components/c_facets/Drag","./components/c_facets/Drop","./components/c_facets/Events","./components/c_facets/Frame","./components/c_facets/Item","./components/c_facets/List","./components/c_facets/ModelFacet","./components/c_facets/Options","./components/c_facets/Template","./components/c_facets/Transfer",76,"prefix","./unique_id",77,"superClassName","methods","staticMethods","SuperClass","componentRegistry","../components/c_registry",78,"deprecate","fn","deprecated","warned","prop",79,"filterNodeListByType","Node","ELEMENT_NODE","nodeList","nodeType","containingElement","selectElementContents","ownerDocument","range","createRange","selectNodeContents","getNodeWindow","sel","removeAllRanges","addRange","selectElementText","fromNode","firstTextNode","toNode","lastTextNode","setSelection","setCaretPosition","pos","setStart","getSelectionDirection","_getDirection","focusOffset","startOffset","endOffset","docPosition","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","originalContentEditable","backward","setEnd","collapse","commonAncestorContainer","parentElement","isContentEditable","contentEditable","clearSelection","getElementOffset","includeBorder","yPos","xPos","offsetLeft","offsetParent","getBorder","topOffset","leftOffset","side","styles","sideValue","parseInt","getPropertyValue","normalize","TEXT_NODE","replaceChild","wrapInElement","wrapIntoEl","trimNodeRight","_trimNode","trimNodeLeft","stripHtml","str","walkTree","tw","containsEl","nodeIndex","findIndex","childIndex","toNormalize","isTreePathBefore","path1","path2","isBefore","htmlEntities","charCodeAt","whatToShow","defaultView","parentWindow","forEachNodesInRange","isNodeInsideRange","nodeRange","isInside","selectNode","compareBoundaryPoints","Range","START_TO_START","END_TO_END","rangeContainer","getComponentsFromRange","startContainer","deleteRangeWithComponents","deleteContents","areRangesEqual","range1","range2","addDebugPoint","dbEl",80,"DOMListeners$add","handler","DOMListeners$remove","listener","idx","isEqual","_removeListener","DOMListeners$removeAll","l",81,"domReadySubscribed","onDomReady","domReadyFuncs",82,"DragDrop$$componentDataType","dragDropConfig","DragDrop$isComponent","componentDataType","DragDrop$getComponentState","stateStr","DragDrop$setComponentState","requestedBy","DragDrop$setComponentMeta","_componentMeta","paramsStr","toQueryString","_encode","base32","encode","DragDrop$getComponentMeta","metaDataType","dType","decode","fromQueryString","metaData","DragDrop$getAllowedEffects","effectAllowed","DragDrop$setAllowedEffects","DragDrop$getDropEffect","dropEffect","DragDrop$setDropEffect","effect","DragDrop$isEffectAllowed","getAllowedEffects","isCopy","isMove","isLink","isAllowed","DragDrop$getData","DragDrop$setData","dataStr","DragDrop$clearData","clearData","onDragDropStarted","_currentDragDrop","_currentDragFacet","onDragDropCompleted","onCompleteDragDrop","dragDropService","getCurrentDragDrop","DragDrop_destroy","offAll","getDropEffect","isEffectAllowed","dragdropstarted","dragdropcompleted","completedragdrop",83,"error$createClass","errorClassName","ErrorClass","makeSubclass","error$toBeImplemented","AbstractClass","errorClassNames","createClass",84,"fragment_getState","wrapperClassName","_getRangeContainer","cloneContents","wrapper","_wrapFragmentInContainer","_transferStates","_renameChildren","wrapperState","fragment_getStateAsync","fromComp","toComp","fromScope","toChildComp","fromChildComp","expandRangeToSiblings","siblings","getRangeSiblings","createRangeFromSiblings","nodes","setStartBefore","setEndAfter","end","containerNode","startNode","endNode","endContainer","startSibling","_findContainingChild","endSibling","selNode","_createNodesAndPathsFunc","fromObj","toObj","createRangePaths","createRangeNodes","getStateAsync","createRangeFromNodes","./dom",85,"util_destroy","domListeners","fragment","storage","../components/ui/bootstrap/Alert","../components/ui/bootstrap/Dialog","./component_name","./deprecate","./dom_listeners","./domready","./dragdrop","./error","./fragment","./json_parse","./request","./selection","./storage","./websocket",86,87,"createPromiseOverride","functionName","promise","Promise","keepRequestObject","_request","opts","onReady","_onReady","req","xPromise","contentType","XMLHttpRequest","open","setRequestHeader","setRequestHeaders","headers","onreadystatechange","ontimeout","onabort","_createXPromise","send","_pendingRequests","resolvePromise","rejectPromise","resolve","reject","then","promiseThen","promiseCatch","status","responseText","spliceItem","errorReason","reason","request$useMessenger","request$get","request$post","request$json","jsonPromise","errData","request$jsonp","_onResult","uniqueCallback","cleanUp","clearTimeout","head","script","jsonpOptions","omitKeys","request$file","fileData","progress","upload","onprogress","file","binary","formData","FormData","request$destroy","whenRequestsCompleted","delay","json","jsonp",88,"TextSelection","TextSelection$init","rangeCount","getRangeAt","TextSelection$text","_text","toString","TextSelection$textNodes","_textNodes","_getTextNodes","TextSelection$clear","textNodes","selStart","selEnd","inEnd","_getElement","thisPropName","rangePropName","_getComponent","elMethodName","TextSelection$containedComponents","_containedComponents","TextSelection$eachContainedComponent","containedComponents","TextSelection$del","selectEndContainer","selPoint","_getPostDeleteSelectionPoint","_selectAfterDelete","selOffset","offset","trimRight","TextSelection$getRange","TextSelection$getState","createStateObject","TextSelection$$createStateObject","_getSelectionPointState","TextSelection$$createFromState","_selectionNodeFromState","pointState","TextSelection$$createFromRange","endRange","cloneRange","TextSelection$$getNormalizedRange","newRange","TextSelection$$getDirection","TextSelection$startElement","TextSelection$endElement","TextSelection$containingElement","TextSelection$startComponent","TextSelection$endComponent","TextSelection$containingComponent","clear","startElement","endElement","startComponent","endComponent","containingComponent","eachContainedComponent","getRange","getNormalizedRange","getDirection","createFromRange","../../components/c_class","../dom",89,"keyPrefix","sessionOnly","_storage","sessionStorage","localStorage","_typeSuffix","_keys","DOMStorage$set","setItem","DomStorageError","DOMStorage$get","deepForEach","getItem","DOMStorage$remove","DOMStorage$hasItem","pKey","_storageKey","DOMStorage$getItem","_getKeyDataType","valueStr","_parseData","DOMStorage$setItem","_setKeyDataType","_serializeData","cfg","_domStorage","DOMStorage$removeItem","_removeKeyDataType","DOMStorage$getAllKeys","storedKeys","keysInStorage","hasItem","DOMStorage$getAllItems","getAllKeys","DOMStorage$_storageKey","DOMStorage$_domStorageKey","storageKey","unPrefix","_dataTypeKey","_getValueType","valueType","valuesDataTypes","serializer","dataSerializers","parser","dataParsers","DOMStorage$$registerDataType","storeAsDataType","DOMStorage$createMessenger","storageMessageSource","StorageMessageSource","_messageSource","DOMStorage$destroy","_storedKeys","true","false","_domStorageKey","getAllItems","createMessenger","_sessionStorage","_localStorage","local","session","valStr","boolean","number","function","toFunction","RegExp","toRegExp","./model","./msg_src",90,"Model$$registerWithDOMStorage","Model_domStorageSerializer","Model_domStorageParser","registerWithDOMStorage",91,"StorageMessageSource$addSourceSubscriber","StorageMessageSource$removeSourceSubscriber","StorageMessageSource$postMessage","StorageMessageSource$trigger","storageArea",92,"uniqueCount","newTimestamp","now","uniqueID","timestamp",93,"wsMessenger","wsMsgSource","WSMessageSource","connect","WSMsgAPI","./msg_api",94,"SOCKET_MESSAGES",95,"WSMessageSource$connect","_options","host","location","port","_ws","onopen","ws","onmessage","onclose","onerror","WebSocket","_wsSubscriberMethod","WSMessageSource$handleEvent","WSMessageSource$trigger","onTimeout","toggleRpcSubscription","callbackCorrId","onResponse","interval","corrId",96,"Encoder","skip","bits","output","readByte","byte","alphabet","finish","Decoder","readChar","char","fromCharCode","val","lookup","encoder","decoder","alias","table","flush",97,98,"_createProxyMethods","proxyMethodName","mixinMethodName","boundMethod","Mixin_setInstanceKey","hostClass","instanceKey","mixin","instancePropertiesMap","instanceKeys","Mixin_addMethod","hostMethodName","wrappedMethod","_wrapMixinMethod","mixinInstance","_getMixinInstance","mixinProp","Mixin$$useWith","mixinMethods","../util/check","mol-proto",99,"MessengerRegexpAPI","./abstract/mixin","./messenger/m_api","./messenger/m_api_rx","./messenger/m_source","./messenger/msngr_source",100,"deepExtend","debug",101,"_initializeSubscribers","_messageSubscribers","_patternMessageSubscribers","Messenger$destroy","Messenger$on","_Messenger_onWithOptions","Messenger$once","dispatchTimes","Messenger$onceSync","sync","Messenger$onSync","Messenger$onAsync","_Messenger_on","_eachMessage","messagesSplitRegExp","subscribersHash","_chooseSubscribersHash","changed","subscriptionChanged","_registerSubscriber","pattern","onSubscriberAdded","noSubscribers","msgSubscribers","notYetRegistered","_indexOfSubscriber","subscr","Messenger$off","_Messenger_off","_removeSubscriber","subscriberIndex","_removeAllSubscribers","onSubscriberRemoved","offMessages","subscriberRemovedMap","Messenger$offAll","_offAllSubscribers","subscribers","_synchronous","_callSubscribers","_callPatternSubscribers","calledMsgSubscribers","patternSubscribers","_callSubscriber","syncSubscriber","synchro","__messages","getSubscribers","includePatternSubscribers","onceSync","onAsync","onMessage","offMessage","subscriptions","../abstract/mixin","./m_source",102,"MessengerAPI$destroy","addInternalMessage","internalMsgs","_internalMessages","removeInternalMessage","unexpectedNotificationWarning","messageIndex","getInternalMessages","sourceData","../util/logger",103,"_patternInternalMessages","_catchAllSubscribed","noPatternInternalMessages","internalMessages","internalMessagesHash","patternMessages","sourcePattern","./m_api",104,"messengerAPI","_prepareMessengerAPI","MessageSource$destroy","setMessenger","newSourceMessage","removedSourceMessage","api","shouldDispatch",105,"sourceMessenger","MessengerMessageSource$postMessage",106,"./messenger","./minder",107,"ds1","mode","ds2","connDescriptions","connectors","descr","Connector","_addConnector","cnct","___minder_id","_connectors","onConnectorMessage","connector","_receivedMessages","_isPropagating","_idleCheck","minder_isPropagating","minder_whenPropagationCompleted","executeCallback","minder_getConnectors","isOn","minder_destroyConnector","minder_getExpandedConnections","searchStr","getConnectors","connections","connection","leftSource","_getExpandedSource","rightSource","cnctn","_sourceMatchesString","ds","source","_model","_accessPath","unshift","matchStr","some","srcNode","_stringMatch","substr","minder_destroy","destroyDS","getExpandedConnections","isPropagating","whenPropagationCompleted","./model/connector","./util/logger",108,"flag","__inChangeTransaction","passTransactionFlag","fromFunc","toFunc","processChanges","notify","processTransaction","prepareTransaction","validateTransaction","changeFinished","sameSource","checkChange","checkSplice","checkMethod","parentPathChanged","pathsToChange","parentPath","_pathIsParentOf","todo","exitLoop","pathsToSplice","hadSplice","parentPathSpliced","every","processChange","modelPath","executeSplice","executeMethod","howMany","CHANGE_TYPE_TO_METHOD_MAP","deleted","./path_utils",109,"setupMode","_changesQueue1","_changesQueue2","pathTranslation","patternTranslation","getPatternTranslations","pathTranslation1","reverseTranslationRules","pathTranslation2","patternTranslation1","reversePatternTranslationRules","patternTranslation2","dataTranslation","dataTranslation1","dataTranslation2","dataValidation1","dataValidation2","turnOn","modeParseError","parsedMode","modePattern","depth1","depth2","Connector$changeMode","turnOff","Connector$deferChangeMode","rules","reverseRules","path2_value","path1_key","_throwInvalidTranslation","_getStaticPath","starIndex1","starIndex2","fromPattern","createRegexPath","fromStaticPath","toPattern","toStaticPath","pt","Connector$turnOn","linkDataSource","reverseLink","fromDS","toDS","changesQueue","onData","batch","translatePath","sourcePath","translatedPath","pTranslation","subscriptionPattern","translateData","translate","validateData","callValidator","validator","alreadyFailed","valid","passedCount","validators","propagateData","sendData","postChangeData","subscriptionSwitch","mergeTransactions","batches","targetPath","subscriptionPath","_subscriptionPath","_link1","_link2","Connector$turnOff","unlinkDataSource","linkName","Connector$destroy","changeMode","../messenger",110,"Model$path","__proto__","reactive","_prepareMessengers","Model$get","ModelPath","proxyMessenger","modelHostObject","Model$$useWith","modelMethodsToProxy","internalMessenger","internalMessengerSource","ModelMsgAPI","externalMessenger","_getHostObject","Model$destroy","_internalMessenger","synthesize","modelMethods","../messenger/msngr_source","./change_data","./m_msg_api","./m_path","./model_utils","./synthesize",111,"../messenger/m_api_rx",112,"ModelPath$path","_args","interpolateAccessPath","_prepareMessenger","freeze","reduce","accessPathStr","currNode","thisPathArgsCount","newPath","ModelPath$len","ModelPath$push","newLength","ModelPath$pop","ModelPath$unshift","ModelPath$shift","mPathAPI","ModelPathMsgAPI","modelMessageSource","mPathMessenger","_getDefinition","_createFromDefinition","definition","ModelPath$destroy","pop","./path_msg_api",113,114,"rootPath","internalChanges","truncateChangePath","fullPath","../messenger/m_api",115,"nodeParsePattern","pathParsePattern","unparsed","nodeStr","pathNodeTypes","patternPathParsePattern","regexStr","patternsStarted","regex","nodeRegex","interpolated","startIndex","methodsNames","wrappedMethods","origMethod","regexPath","propertyPathSyntax","arrayPathSyntax","interpolationSyntax","propertyInterpolateSyntax","arrayInterpolateSyntax","propertyStarSyntax","arrayStarSyntax","starSyntax","pathParseSyntax","patternPathParseSyntax",".","[","*",".*","[*]",116,"_synthesizePathMethods","synthesizers","synthszr","_synthesize","synthesizer","addChangeMessage","messagesHash","addTreeChangesMessages","oldIsTree","valueIsTree","newIsTree","addMessages","valueProp","_addMessages","addMessage","existingMsg","cloneTree","valueIsNormalObject","protectValue","addBatchIdsToMessage","batchId","msgId","__batch_id","__msg_id","methodCode","eval","ModelError","fs","templates","include_defines","include_create_tree","include_traverse_tree","dotDef","modelAccessPrefix","modelPostMessageCode","modelPostBatchCode","modelDotDef","dotSettings","templateSettings","strip","tmpl","modelSynthesizers","synthesizePathMethods","memoize","../../util/logger","../change_data","../model_utils","../path_utils","dot",117,"choices","Where","condition","Superclass","matchSuperclassToo","matchSuperclass","checkSubtree","typeofChecks","_jsKeywords","valueElement","_prependPath","unknownKeysAllowed","keyPattern","emptyHash","requiredPatterns","optionalPatterns","subPattern","subValue","base","TypeError",118,"./check","./logger",119,"Logger","level","./logger_class",120,"maxLevelLength","colored","color","levels","colors","DEFAULT_OPTIONS","throwLevel","enabled","logPrefix","log","console","logPrefixColor",121,"resolveDefs","c","block","def","define","code","assign","substring","defineParams","param","v","arg","use","useParams","d","rw","__exp","unescape","_globals","version","evaluate","conditional","iterate","varname","selfcontained","doNotSkipEncoded","encodeHTMLSource","encodeHTMLRules","&","<",">","\"","'","/","matchHTML","amd","startend","startencode","needhtmlencode","indv","cse","sid","elsecase","vname","iname","_encodeHTML",122,"InstallDots","__path","__destination","destination","__global","__rendermodule","rendermodule","__settings","__includes","addexports","ret","readdata","readFileSync","process","compileAll","compileToFile","modulename","lastIndexOf","defs","settings","compileoptions","defaultcompiled","compiled","writeFileSync","compilePath","k","defFolder","sources","readdirSync","./doT",123,"Proto","wrapped","unwrapProto","utils","prototypeMethods","objectMethods","arrayMethods","functionMethods","stringMethods","numberMethods","utilMethods","__","_constants","protoFuncs","makeProtoFunction","protoInstanceMethods","makeProtoInstanceMethod","underscore","./proto_array","./proto_function","./proto_number","./proto_object","./proto_prototype","./proto_string","./proto_util","./utils",124,"arrayToAppend","prependArray","arrayToPrepend","values","valuesIsArray","unique","itemIndex","filtered","it","itemIndexOf","_deepForEach","nativeArrayMethodsNames","nativeArrayMethods","makeFindMethod",125,"arg1","arg2","funcBody","partialRight","hashFunc","limit","cache","keysList","wait","_delay","deferTicks","ticks","deferFunc","delayMethod","funcOrMethodName","_delayMethod","delayed","passArgs","deferred","debounce","immediate","later","last","callNow","previous","leading","remaining","trailing","memo","ran","waitFor","maxTimeout","timedOutFunc","checkInterval","testCondition","setInterval","not",126,"isNumeric","isNaN","parseFloat","isFinite",127,"onlyEnumerable","descriptors","getOwnPropertyDescriptor","clonedObject","propertyName","decriptorFlags","_getDescriptor","descriptor","constants","ENUMERABLE","configurable","CONFIGURABLE","writable","WRITABLE","propertyValues","_extendTree","selfNode","objNode","objTraversed","loop","allKeys","getOwnPropertyNames","keyOf","searchElement","allKeysOf","mapProperty","reduceKeys","initialValue","filterProperty","testProperty","_passed","everyKey","_didNotPass","pickKeys","ArrayProto","multiline","ignoreCase","isNot","findValue","findKey",128,"propDescriptors","applyConstructor","thisClass","subclass","constructorCode",129,"toUpperCase","rx","regexpStringPattern","getTime","qs","encodeURIComponent","pairs","results","decodeURIComponent","pair","splitPair","hashCode","hash",130,"times","tap","identity","compareProperty","b",131,"eachMethod","findWhat","argIndex","testItem","caughtError","_error"],"mappings":"CAAC,QAAUA,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATC,UAAqBA,OAAQ,KAAIF,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGI,EAAE,MAAOA,GAAEJ,GAAE,EAAI,MAAM,IAAIK,OAAM,uBAAuBL,EAAE,KAAK,GAAIM,GAAET,EAAEG,IAAIO,WAAYX,GAAEI,GAAG,GAAGQ,KAAK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z6F,EAAOJ,SACfgyF,wBAAyBA,EACzBF,kBAAmBA,EACnB0B,eAAgBA,GAqBP,GAAI1zF,kBAsCN","sourceRoot":"/"} \ No newline at end of file diff --git a/package.json b/package.json index 255a022..55281c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mol-milo", - "version": "0.2.2", + "version": "0.2.3", "description": "Browser/nodejs reactive programming and data driven DOM manipulation with modular components.", "keywords": [ "framework", @@ -31,7 +31,7 @@ }, "dependencies": { "base32": "milojs/base32-js", - "milo-core": "^0.1.14" + "milo-core": "^0.1.15" }, "devDependencies": { "async": "~0.2.9",