opal-components
Version:
[Rionite](https://github.com/Riim/Rionite) component set.
1 lines • 229 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rionite"),require("cellx-decorators"),require("cellx"),require("@riim/next-tick"),require("@riim/gettext"),require("@riim/mixin"),require("@riim/map-set-polyfill"),require("date-exists"),require("@riim/debounce-throttle"),require("@riim/next-uid"),require("@riim/escape-html"),require("@riim/hyphenize"),require("created-browser-history")):"function"==typeof define&&define.amd?define(["rionite","cellx-decorators","cellx","@riim/next-tick","@riim/gettext","@riim/mixin","@riim/map-set-polyfill","date-exists","@riim/debounce-throttle","@riim/next-uid","@riim/escape-html","@riim/hyphenize","created-browser-history"],e):"object"==typeof exports?exports.OpalComponents=e(require("rionite"),require("cellx-decorators"),require("cellx"),require("@riim/next-tick"),require("@riim/gettext"),require("@riim/mixin"),require("@riim/map-set-polyfill"),require("date-exists"),require("@riim/debounce-throttle"),require("@riim/next-uid"),require("@riim/escape-html"),require("@riim/hyphenize"),require("created-browser-history")):t.OpalComponents=e(t.rionite,t["cellx-decorators"],t.cellx,t["@riim/next-tick"],t["@riim/gettext"],t["@riim/mixin"],t["@riim/map-set-polyfill"],t["date-exists"],t["@riim/debounce-throttle"],t["@riim/next-uid"],t["@riim/escape-html"],t["@riim/hyphenize"],t["created-browser-history"])}(this,function(t,e,n,o,i,r,a,l,s,p,c,u,d){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=18)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){t.exports=n},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isFocusable=function(t){if(t.hasAttribute("tabindex"))return t.tabIndex>=0;switch(t.tagName){case"a":case"area":return t.hasAttribute("href")&&t.tabIndex>=0;case"button":case"input":case"textarea":case"select":return!t.hasAttribute("disabled")&&t.tabIndex>=0;case"iframe":case"object":case"embed":return t.tabIndex>=0}return t.hasAttribute("contenteditable")&&t.tabIndex>=0}},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),a=n(0);n(85);var l=n(86);e.OpalInputValidatorRule=l.OpalInputValidatorRule;var s=n(89),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.failedRule=null,e}return o(e,t),Object.defineProperty(e.prototype,"valid",{get:function(){return!this.failedRule},enumerable:!0,configurable:!0}),e.prototype.ready=function(){this.rules=Array.prototype.map.call(this.element.getElementsByClassName("OpalInputValidatorRule"),function(t){return t.$component})},e.prototype.elementAttached=function(){this.listenTo(this.target,"change",this._onTargetChange)},e.prototype._onTargetChange=function(){this.validate()},e.prototype.validate=function(){return this._validate(this.rules)},e.prototype._validate=function(t){var e,n=this;t.forEach(function(t){e||n._checkValue(t)?t.hideMessage():(e=t,t.showMessage())});var o=this.failedRule;return this.failedRule=e||null,+!!e^+!!o&&(e?(this.element.setAttribute("valid","no"),this.emit("input-validation-error")):(this.element.removeAttribute("valid"),this.emit("input-validation-valid"))),!e},e.prototype._checkValue=function(t){return!1},e.prototype.focusTarget=function(){return this.target.focus(),this},i([r.observable],e.prototype,"failedRule",void 0),i([r.computed],e.prototype,"valid",null),e=i([a.Component.Config({elementIs:"OpalInputValidator",template:s.default})],e)}(a.Component);e.OpalInputValidator=p},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),a=n(3),l=n(2),s=n(1),p=n(0),c=n(5);n(115);var u=n(116),d=n(117);e.OpalSelectOption=d.OpalSelectOption;var h=n(120),f=Array.prototype.map,m=Object.freeze({value:"value",text:"text",disabled:"disabled"}),_=Object.freeze({value:"value",text:"text",disabled:"disabled"}),b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._needOptionsUpdating=!1,e._notUpdateOptions=!1,e._opened=!1,e._onсeFocusedAfterLoading=!1,e}return o(e,t),e,Object.defineProperty(e.prototype,"value",{get:function(){var t=this;return this.viewModel.map(function(e){return e[t._viewModelItemValueFieldName]})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_buttonText",{get:function(){var t=this,e=this.viewModel.map(function(e){return e[t._viewModelItemTextFieldName]}).join(", ");return e?(e.length>this.params.maxTextLength&&(e=r.getText.nt("Выбран{n:|о|о} {n}",this.viewModel.length)),e):this.params.placeholder},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return f.call(this.optionElements,function(t){return t.$component})},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var t=this.params;t.dataListKeypath?(l.define(this,"dataList",new l.Cell(Function("return this."+t.dataListKeypath+";"),{context:this.ownerComponent||window})),this._isParamDataListSpecified=!0):t.$specified.has("dataList")?(l.define(this,"dataList",function(){return t.dataList}),this._isParamDataListSpecified=!0):(this.dataList=null,this._isParamDataListSpecified=!1);var e=t.dataListItemSchema,n=this.constructor.defaultDataListItemSchema;this._dataListItemValueFieldName=e.value||n.value,this._dataListItemTextFieldName=e.text||n.text,this._dataListItemDisabledFieldName=e.disabled||n.disabled,this.viewModel=t.viewModel||new l.ObservableList;var o=t.viewModelItemSchema,i=this.constructor.defaultViewModelItemSchema;this._viewModelItemValueFieldName=o.value||i.value,this._viewModelItemTextFieldName=o.text||i.text,this._viewModelItemDisabledFieldName=o.disabled||i.disabled,this._addNewItem=t.addNewItem},e.prototype.ready=function(){this.optionElements=this.element.getElementsByClassName("OpalSelectOption"),this.params.viewModel&&!this.params.value?this._needOptionsUpdating=!0:(this._notUpdateOptions=!0,this.$("menu").renderContent(),this._notUpdateOptions=!1,this._initViewModel())},e.prototype._initViewModel=function(){var t,e=this,n=this.params.value;if(n){if(!Array.isArray(n))throw new TypeError('Parameter "value" must be an array');this._notUpdateOptions=!0,this.viewModel.clear(),n.length&&(this.params.multiple?t=this.options.filter(function(t){return-1!=n.indexOf(t.value)}):(n=n[0],(o=this.options.find(function(t){return t.value==n}))&&(t=[o])))}else if(this.params.multiple)t=this.options.filter(function(t){return t.selected});else{var o=this.options.find(function(t){return t.selected});o&&(t=[o])}t&&t.length&&(this._notUpdateOptions=!0,this.viewModel.addRange(t.map(function(t){return n={},n[e._viewModelItemValueFieldName]=t.value,n[e._viewModelItemTextFieldName]=t.text,n;var n}))),this._notUpdateOptions=!1,n&&this._updateOptions()},e.prototype.elementAttached=function(){this.params.focused&&(this._documentKeyDownListening=this.listenTo(document,"keydown",this._onDocumentKeyDown),this.focus()),this.listenTo(this,{"param-value-change":this._onParamValueChange,"param-view-model-change":this._onParamViewModelChange,"param-focused-change":this._onParamFocusedChange}),this.listenTo(this.viewModel,"change",this._onViewModelChange),this.listenTo("button",{focus:this._onButtonFocus,blur:this._onButtonBlur,click:this._onButtonClick}),this.listenTo("menu",{"param-opened-change":this._onMenuParamOpenedChange,"<OpalSelectOption>select":this._onMenuSelectOptionSelect,"<OpalSelectOption>deselect":this._onMenuSelectOptionDeselect,"<OpalTextInput>confirm":this._onMenuTextInputConfirm,"<*>change":this._onMenuChange})},e.prototype._onParamValueChange=function(t){var e=this.viewModel,n=t.data.value;if(n){if(!Array.isArray(n))throw new TypeError('Parameter "value" must be an array');if(n.length){var o=this.params.multiple;return void(!o&&e.length&&n[0]==e.get(0)[this._viewModelItemValueFieldName]||(this._needOptionsUpdating?(this._needOptionsUpdating=!1,this._notUpdateOptions=!0,this.$("menu").renderContent(),this._notUpdateOptions=!1,this._updateViewModel(n,o)):this._updateViewModel(n,o)))}}e.clear()},e.prototype._updateViewModel=function(t,e){var n=this.viewModel,o=this._viewModelItemValueFieldName,i=this._viewModelItemTextFieldName;e?this.options.forEach(function(e){var r=e.value,a=n.findIndex(function(t){return t[o]==r});-1==t.indexOf(r)?-1!=a&&n.removeAt(a):-1==a&&n.add((l={},l[o]=r,l[i]=e.text,l));var l}):(t=t[0],this.options.some(function(e){return e.value==t&&(n.set(0,(r={},r[o]=t,r[i]=e.text,r)),!0);var r})||n.clear())},e.prototype._onParamViewModelChange=function(t){if(t.data.value!=this.viewModel)throw new TypeError('Parameter "viewModel" is readonly')},e.prototype._onParamFocusedChange=function(t){t.data.value?(this._documentKeyDownListening||(this._documentKeyDownListening=this.listenTo(document,"keydown",this._onDocumentKeyDown)),this.focus(),this.emit("focus")):(this._opened||(this._documentKeyDownListening.stop(),this._documentKeyDownListening=null),this.blur(),this.emit("blur"))},e.prototype._onViewModelChange=function(){this._needOptionsUpdating||this._notUpdateOptions||this._updateOptions()},e.prototype._onButtonFocus=function(){this.params.focused=!0},e.prototype._onButtonBlur=function(){this.params.focused=!1},e.prototype._onButtonClick=function(t){t.target.checked?this.open():this.close()},e.prototype._onMenuParamOpenedChange=function(t){return t.data.value||this.close(),!1},e.prototype._onMenuSelectOptionSelect=function(t){var e=this.viewModel,n=(o={},o[this._viewModelItemValueFieldName]=t.target.value,o[this._viewModelItemTextFieldName]=t.target.text,o);return this.params.multiple?(this._notUpdateOptions=!0,e.add(n),this._notUpdateOptions=!1,this.emit("select")):(e.length?e.set(0,n):e.add(n),this.close(),this.focus(),this.emit("select"),this.emit("change")),!1;var o},e.prototype._onMenuSelectOptionDeselect=function(t){if(this.params.multiple){var e=t.target.value;this._notUpdateOptions=!0,this.viewModel.removeAt(this.viewModel.findIndex(function(t){return t.value==e})),this._notUpdateOptions=!1}else t.target.select(),this.close(),this.focus();return this.emit("deselect"),!1},e.prototype._onMenuTextInputConfirm=function(t){var e=this,n=t.target;if(n===this.$("new-item-input")){if(!this._addNewItem)throw new TypeError('Parameter "addNewItem" is required');var o=n.value;return n.clear(),n.params.loading=!0,n.params.disabled=!0,this._addNewItem(o).then(function(t){n.params.loading=!1,n.params.disabled=!1;var o=t[e._viewModelItemValueFieldName],i=t[e._viewModelItemTextFieldName];e.dataList&&e.dataList.add((s={},s[e._dataListItemValueFieldName]=o,s[e._dataListItemTextFieldName]=i,s));var r=e.$("loaded-list");r&&(r.params.query="");var a=e.viewModel,l=(p={},p[e._viewModelItemValueFieldName]=o,p[e._viewModelItemTextFieldName]=i,p);e.params.multiple?(a.add(l),e.emit("input")):(a.length?a.set(0,l):a.add(l),e.close(),e.focus(),e.emit("input"),e.emit("change"));var s,p},function(){n.params.loading=!1,n.params.disabled=!1}),!1}},e.prototype._onMenuChange=function(t){!this._notUpdateOptions&&(t.target instanceof p.RtIfThen||t.target instanceof p.RtRepeat)&&(this.optionsCell.pull(),this._updateOptions())},e.prototype.open=function(){var t=this;if(this._opened)return!1;this._opened=!0,this._valueOnOpen=this.viewModel.map(function(e){return e[t._viewModelItemValueFieldName]}),this._documentFocusListening=this.listenTo(document,"focus",this._onDocumentFocus,this,!0),this._documentKeyDownListening||(this._documentKeyDownListening=this.listenTo(document,"keydown",this._onDocumentKeyDown)),this.$("button").check(),this._notUpdateOptions=!0,this.$("menu").open(),this._notUpdateOptions=!1,this._needOptionsUpdating&&(this._needOptionsUpdating=!1,this._updateOptions());var e=this.$("loaded-list");e&&e.checkLoading();var n=this.$("focus");if(n)n.focus();else{var o=this.$("filtered-list");o&&(n=o.$("query-input")),n?n.focus():this._focusOptions()}return!0},e.prototype.close=function(){var t=this;return!!this._opened&&(this._opened=!1,this._documentFocusListening.stop(),this.params.focused||(this._documentKeyDownListening.stop(),this._documentKeyDownListening=null),this.$("button").uncheck(),this.$("menu").close(),this.params.multiple&&(u.isEqualArray(this.viewModel.map(function(e){return e[t._viewModelItemValueFieldName]}),this._valueOnOpen)||this.emit("change")),!0)},e.prototype.toggle=function(t){return void 0!==t?t?this.open():!this.close():this.open()||!this.close()},e.prototype._onDocumentFocus=function(t){c.isFocusable(t.target)&&(this.element.contains(t.target.parentNode)||this.close())},e.prototype._onDocumentKeyDown=function(t){switch(t.which){case 32:this._opened?this.params.focused&&(t.preventDefault(),this.close()):(t.preventDefault(),this.open());break;case 38:if(t.preventDefault(),this._opened){if(document.activeElement==document.body)this._focusOptions()&&document.body.classList.remove("_no-focus-highlight");else for(var e=1,n=(o=this.options).length;e<n;e++)if(o[e].params.focused){do{if(!(i=o[--e]).params.disabled&&i.element.offsetWidth){document.body.classList.remove("_no-focus-highlight"),i.focus();break}}while(e);break}}else this.open();break;case 40:if(t.preventDefault(),this._opened){if(document.activeElement==document.body)this._focusOptions()&&document.body.classList.remove("_no-focus-highlight");else for(var o=this.options,e=0,n=o.length-1;e<n;e++)if(o[e].params.focused){do{var i=o[++e];if(!i.params.disabled&&i.element.offsetWidth){document.body.classList.remove("_no-focus-highlight"),i.focus();break}}while(e<n);break}}else this.open();break;case 27:t.preventDefault(),this.close(),this.focus()}},e.prototype._updateOptions=function(){var t=this.viewModel,e=this._viewModelItemValueFieldName,n=this._viewModelItemDisabledFieldName;this.options.forEach(function(o){var i=o.value,r=t.find(function(t){return t[e]==i});r?(o.selected=!0,o.disabled=r[n]):o.selected=!1})},e.prototype._focusOptions=function(){for(var t,e=this.options,n=0,o=e.length;n<o;n++){var i=e[n];if(!i.params.disabled){if(i.selected){t=i;break}t||(t=i)}}return!!t&&(t.focus(),!0)},e.prototype.focus=function(){return this.$("button").focus(),this},e.prototype.blur=function(){return this.$("button").blur(),this},e.defaultDataListItemSchema=m,e.defaultViewModelItemSchema=_,i([s.observable],e.prototype,"viewModel",void 0),i([s.computed],e.prototype,"value",null),i([s.computed],e.prototype,"_buttonText",null),i([s.computed],e.prototype,"options",null),e=i([p.Component.Config({elementIs:"OpalSelect",params:{viewType:String,size:"m",multiple:{default:!1,readonly:!0},dataList:{type:Object},dataListKeypath:{type:String,readonly:!0},dataListItemSchema:{type:eval,default:m,readonly:!0},value:eval,viewModel:{type:Object},viewModelItemSchema:{type:eval,default:_,readonly:!0},addNewItem:{type:Object,readonly:!0},text:String,maxTextLength:20,placeholder:r.getText.t("Не выбрано"),tabIndex:0,focused:!1,disabled:!1},template:h.default,events:{"menu-slot":{"<*>loaded":function(t){if(!this._onсeFocusedAfterLoading&&t.target===this.$("loaded-list")){this._onсeFocusedAfterLoading=!0,this._focusOptions();var e=this.$("focus");if(!e){var n=this.$("filtered-list");n&&(e=n.$("query-input"))}e&&a.nextTick(function(){e.focus()})}}}}})],e)}(p.Component);e.OpalSelect=b},function(t,e,n){"use strict";function o(t,e){void 0===e&&(e=null);for(var n=0,i=t;n<i.length;n++){var r=i[n];r.parent=e,o(r.children,r)}return t}var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),a=n(2);e.fixParent=o;var l=function(t){function e(e){var n=t.call(this)||this;return n._items=e?o(e.map(function t(e){return r.assign(r.assign({},e),{children:e.children?e.children.map(t):[]})})):[],n}return i(e,t),Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var e=t.length;if(!e)throw new TypeError("Indexpath cannot be empty");for(var n,o=this._items,i=0,r=e-1;i<r;i++){if(!(n=o[t[i]]))return;if(!(o=n.children))return}return o[t[e-1]]},e.prototype.set=function(t,e){var n=t.length;if(!n)throw new TypeError("Indexpath cannot be empty");var o;if(1==n)o=this._items;else{var i=this.get(t.slice(0,-1));if(!i)throw new TypeError('Item by indexpath "['+t.slice(0,-1).join(",")+']" is not exist');o=i.children,e.parent=i}var r=t[n-1];return e!==o[r]&&(o[r]=e,this.emit("change")),this},e.prototype.forEach=function(t,e){},e.prototype.map=function(t,e){return[]},e.prototype.filter=function(t,e){return[]},e.prototype.every=function(t,e){return!1},e.prototype.some=function(t,e){return!1},e.prototype.reduce=function(t,e){},e.prototype.reduceRight=function(t,e){},e}(a.EventEmitter);e.ObservableTreeList=l,["forEach","map","filter","every","some"].forEach(function(t){l.prototype[t]=function(e,n){return this._items[t](function(t,o){return e.call(n,t,o,this)},this)}}),["reduce","reduceRight"].forEach(function(t){l.prototype[t]=function(e,n){function o(t,n,o){return e(t,n,o,r)}var i=this._items,r=this;return arguments.length>=2?i[t](o,n):i[t](o)}})},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);n(63);var a=n(64);e.OpalTab=a.OpalTab;var l=n(67),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e=i([r.Component.Config({elementIs:"OpalTabList",template:l.default})],e)}(r.Component);e.OpalTabList=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseDate=function(t){var e=t.match(/\d+/g);return new Date(+e[2],+e[1]-1,+e[0])}},function(t,e){t.exports=r},function(t,e,n){"use strict";function o(t){return t&&t.trim().replace(/\s+/g," ").toLowerCase()}var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),r=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var a=n(2),l=n(1),s=n(0),p=n(8),c=n(13),u=n(14);n(111);var d=n(15);e.OpalTreeListItem=d.OpalTreeListItem,n(15);var h=n(114),f=Object.freeze({value:"id",text:"name"}),m=Object.freeze({value:"id",text:"name"}),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e,Object.defineProperty(e.prototype,"filteredDataTreeList",{get:function(){var t=o(this.params.query);if(!t)return this.dataTreeList;var e=this._dataTreeListItemValueFieldName,n=this._dataTreeListItemTextFieldName;return new p.ObservableTreeList(p.fixParent(this.dataTreeList.reduce(function i(r,a){if(a.children.length){var l=a.children.reduce(i,[]);(l.length||-1!=o(a[n]).indexOf(t))&&r.push((s={$original:a},s[e]=a[e],s[n]=a[n],s.children=l,s))}else-1!=o(a[n]).indexOf(t)&&r.push((p={$original:a},p[e]=a[e],p[n]=a[n],p.children=[],p));return r;var s,p},[])))},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var t=this.params;if(t.dataTreeListKeypath)a.define(this,"dataTreeList",new a.Cell(Function("return this."+t.dataTreeListKeypath+";"),{context:this.ownerComponent||window}));else{if(!t.$specified.has("dataTreeList"))throw new TypeError('Parameter "dataTreeList" is required');a.define(this,"dataTreeList",function(){return t.dataTreeList})}var e=t.dataTreeListItemSchema,n=this.constructor.defaultDataTreeListItemSchema;this._dataTreeListItemValueFieldName=e.value||n.value,this._dataTreeListItemTextFieldName=e.text||n.text,this.viewModel=t.viewModel||new a.ObservableList;var o=t.viewModelItemSchema,i=this.constructor.defaultViewModelItemSchema;this._viewModelItemValueFieldName=o.value||i.value,this._viewModelItemTextFieldName=o.text||i.text},e.prototype.elementAttached=function(){this.listenTo(this,"<*>change",this._onChange)},e.prototype._onChange=function(t){var e=t.target;if(e.element.classList.contains("OpalTreeList__selection-control")){var n=this._dataTreeListItemValueFieldName,o=this._dataTreeListItemTextFieldName,i=this.viewModel,r=this._viewModelItemValueFieldName,a=this._viewModelItemTextFieldName,l=c.closestComponent(e.parentComponent,d.OpalTreeListItem).params.$context.$item;if(e.selected){for(var s;(s=l.parent)&&s.children.every(function(t){return t==l||!!i.find(function(e){return e[r]==t[n]})});)l=s;l.children.forEach(function t(e){var o=i.findIndex(function(t){return t[r]==e[n]});-1!=o&&i.removeAt(o),e.children.forEach(t)}),i.add((f={},f[r]=l[n],f[a]=l[o],f))}else{var p=i.findIndex(function(t){return t[r]==l[n]});if(-1!=p)i.removeAt(p);else for(var u=l.parent;;){var h=i.findIndex(function(t){return t[r]==u[n]});if(i.addRange(u.children.filter(function(t){return t!=l}).map(function(t){return e={},e[r]=t[n],e[a]=t[o],e;var e})),-1!=h){i.removeAt(h);break}u=(l=u).parent}}}var f},e.defaultDataTreeListItemSchema=f,e.defaultViewModelItemSchema=m,r([l.computed],e.prototype,"filteredDataTreeList",null),r([l.observable],e.prototype,"viewModel",void 0),e=r([s.Component.Config({elementIs:"OpalTreeList",params:{dataTreeList:{type:Object},dataTreeListKeypath:{type:String,readonly:!0},dataTreeListItemSchema:{type:eval,default:f,readonly:!0},viewModel:{type:Object},viewModelItemSchema:{type:eval,default:m,readonly:!0},query:String},template:h.default})],e)}(s.Component);e.OpalTreeList=_,_.prototype._getListItemContext=u.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(110);e.closestComponent=o.default;var i=n(5);e.isFocusable=i.default},function(t,e,n){"use strict";function o(t,e,n,o){do{if(e.find(function(e){return e[o]==t[n]}))return!0}while(t=t.parent);return!1}function i(t,e,n,r){return!!t.children.length&&!o(t,e,n,r)&&t.children.some(function(t){return!!e.find(function(e){return e[r]==t[n]})||i(t,e,n,r)})}Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),a=n(2);e.default=function(t,e){var n=e.params.$context.$item;return a.define(r.mixin(Object.create(t),e.params.$context,["$component"]),{$selected:new a.Cell(function(){return this.dataTreeList,o(n.$original||n,this.viewModel,this._dataTreeListItemValueFieldName,this._viewModelItemValueFieldName)},{context:this}),$indeterminate:new a.Cell(function(){return this.dataTreeList,i(n.$original||n,this.viewModel,this._dataTreeListItemValueFieldName,this._viewModelItemValueFieldName)},{context:this})})}},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),a=n(0),l=n(14);n(112);var s=n(113),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"dataTreeList",{get:function(){return this.params.dataTreeList},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewModel",{get:function(){return this.params.viewModel},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var t=this.params;this.dataTreeListItem=t.filteredDataTreeList.get(t.indexpath),this._dataTreeListItemValueFieldName=t.dataTreeListItemValueFieldName,this._dataTreeListItemTextFieldName=t.dataTreeListItemTextFieldName,this._viewModelItemValueFieldName=t.viewModelItemValueFieldName,this._viewModelItemTextFieldName=t.viewModelItemTextFieldName},i([r.computed],e.prototype,"dataTreeList",null),i([r.computed],e.prototype,"viewModel",null),e=i([a.Component.Config({elementIs:"OpalTreeListItem",params:{dataTreeList:{type:Object,required:!0},filteredDataTreeList:{type:Object,required:!0},dataTreeListItemValueFieldName:{type:String,required:!0,readonly:!0},dataTreeListItemTextFieldName:{type:String,required:!0,readonly:!0},viewModel:{type:Object,required:!0},viewModelItemValueFieldName:{type:String,required:!0,readonly:!0},viewModelItemTextFieldName:{type:String,required:!0,readonly:!0},indexpath:{type:eval,required:!0,readonly:!0},query:String,opened:!1},template:s.default,events:{"btn-toggle-children":{change:function(t){this.params.opened=t.target.checked}}}})],e)}(a.Component);e.OpalTreeListItem=p,p.prototype._getListItemContext=l.default},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),a=n(2),l=n(1),s=n(0);n(124);var p=n(125),c=Object.freeze({value:"id",text:"name",disabled:"disabled"}),u=Object.freeze({value:"id",text:"name",disabled:"disabled"}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"value",{get:function(){var t=this;return this.viewModel.map(function(e){return e[t._viewModelItemValueFieldName]})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPlaceholderShown",{get:function(){return!!this.params.placeholder&&!this.viewModel.length},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var t=this.params;t.dataListKeypath||t.$specified.has("dataList")?(a.define(this,"dataList",t.dataListKeypath?new a.Cell(Function("return this."+t.dataListKeypath+";"),{context:this.ownerComponent||window}):function(){return t.dataList}),this.dataProvider=null,this._dataListKeypathParam="dataList"):(this.dataList=null,this.dataProvider=t.dataProvider,this._dataListKeypathParam=null);var e=t.dataListItemSchema;this._dataListItemValueFieldName=e.value||c.value,this._dataListItemTextFieldName=e.text||c.text,this._dataListItemDisabledFieldName=e.disabled||c.disabled,this.viewModel=t.viewModel||new a.ObservableList;var n=t.viewModelItemSchema,o=this.constructor.defaultViewModelItemSchema;this._viewModelItemValueFieldName=n.value||o.value,this._viewModelItemTextFieldName=n.text||o.text,this._viewModelItemDisabledFieldName=n.disabled||o.disabled},e.prototype.elementAttached=function(){this.listenTo(this,"param-view-model-change",this._onParamViewModelChange),this.listenTo("control","click",this._onControlClick),this.listenTo("select",{input:this._onSelectInput,change:this._onSelectChange,select:this._onSelectSelect,deselect:this._onSelectDeselect})},e.prototype._onParamViewModelChange=function(t){if(t.data.value!=this.viewModel)throw new TypeError('Parameter "viewModel" is readonly')},e.prototype._onControlClick=function(t){var e=this.$("select"),n=e.element,o=t.target;if(o!=n){var i=this.$("control");do{if(o==i){e.toggle();break}o=o.parentNode}while(o!=n)}},e.prototype._onSelectInput=function(){return this.$("select").close(),this.emit("input"),!1},e.prototype._onSelectChange=function(){return this.emit("change"),!1},e.prototype._onSelectSelect=function(){return this.$("select").close(),!1},e.prototype._onSelectDeselect=function(){return this.$("select").close(),!1},e.prototype._isItemDisabled=function(t){return this.params.disabled||t[this._viewModelItemDisabledFieldName]},e.defaultDataListItemSchema=c,e.defaultViewModelItemSchema=u,i([l.observable],e.prototype,"viewModel",void 0),i([l.computed],e.prototype,"value",null),i([l.computed],e.prototype,"isPlaceholderShown",null),e=i([s.Component.Config({elementIs:"OpalTagSelect",params:{viewType:String,dataList:{type:Object},dataListKeypath:{type:String,readonly:!0},dataListItemSchema:{type:eval,default:c,readonly:!0},dataProvider:{type:Object,readonly:!0},value:eval,viewModel:{type:Object},viewModelItemSchema:{type:eval,default:u,readonly:!0},addNewItem:{type:Object,readonly:!0},placeholder:r.getText.t("Не выбрано"),popoverPosition:"bottom",tabIndex:0,focused:!1,disabled:!1},template:p.default,domEvents:{"btn-remove-tag":{click:function(t,e){var n=this._viewModelItemValueFieldName,o=e.dataset.tagValue;this.viewModel.removeAt(this.viewModel.findIndex(function(t){return t[n]==o})),this.emit("change")}}}})],e)}(s.Component);e.OpalTagSelect=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.SIMPLE=0]="SIMPLE",t[t.OPTIONAL=1]="OPTIONAL",t[t.INSERT=2]="INSERT"}(e.PathNodeType||(e.PathNodeType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(19),n(20),n(21),n(22),n(23),n(24),n(25);var o=n(8);e.ObservableTreeList=o.ObservableTreeList;var i=n(27);e.OpalButton=i.OpalButton;var r=n(29);e.OpalSignButton=r.OpalSignButton;var a=n(32);e.OpalTextInput=a.OpalTextInput;var l=n(35);e.OpalEditableText=l.OpalEditableText;var s=n(38);e.OpalInputMaskDefinition=s.OpalInputMaskDefinition,e.OpalInputMask=s.OpalInputMask;var p=n(42);e.OpalGroup=p.OpalGroup;var c=n(45);e.OpalCheckbox=c.OpalCheckbox;var u=n(48);e.OpalRadioButton=u.OpalRadioButton,e.OpalRadioGroup=u.OpalRadioGroup;var d=n(52);e.OpalSwitch=d.OpalSwitch;var h=n(55);e.OpalSlider=h.OpalSlider;var f=n(58);e.OpalSwitchMenu=f.OpalSwitchMenu;var m=n(61);e.OpalTab=m.OpalTab,e.OpalTabList=m.OpalTabList,e.OpalTabPanel=m.OpalTabPanel,e.OpalTabs=m.OpalTabs;var _=n(72);e.OpalDropdown=_.OpalDropdown;var b=n(75);e.OpalPopover=b.OpalPopover;var g=n(78);e.OpalModal=g.OpalModal;var y=n(81);e.OpalNotification=y.OpalNotification;var v=n(6);e.OpalInputValidatorRule=v.OpalInputValidatorRule,e.OpalInputValidator=v.OpalInputValidator;var O=n(90);e.OpalTextInputValidatorRule=O.OpalTextInputValidatorRule,e.OpalTextInputValidator=O.OpalTextInputValidator;var x=n(93);e.OpalCalendar=x.OpalCalendar;var w=n(97);e.OpalDateInput=w.OpalDateInput;var k=n(101);e.OpalLoader=k.OpalLoader;var T=n(103);e.OpalLoadedList=T.OpalLoadedList;var P=n(106);e.OpalFilteredList=P.OpalFilteredList;var C=n(12);e.OpalTreeListItem=C.OpalTreeListItem,e.OpalTreeList=C.OpalTreeList;var S=n(7);e.OpalSelectOption=S.OpalSelectOption,e.OpalSelect=S.OpalSelect;var I=n(121);e.OpalMultiselect=I.OpalMultiselect;var L=n(16);e.OpalTagSelect=L.OpalTagSelect;var j=n(126);e.OpalTreeSelect=j.OpalTreeSelect;var M=n(129);e.OpalTreeTagSelect=M.OpalTreeTagSelect;var R=n(131);e.OpalSelectValidatorRule=R.OpalSelectValidatorRule,e.OpalSelectValidator=R.OpalSelectValidator;var D=n(134);e.OpalAutosuggest=D.OpalAutosuggest;var F=n(137);e.OpalMultirowRow=F.OpalMultirowRow,e.OpalMultirow=F.OpalMultirow;var B=n(144);e.OpalRoute=B.OpalRoute,e.OpalRouter=B.OpalRouter;var N=n(13);e.Utils=N.default},function(t,e){!function t(){document.body?document.body.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol viewBox="0 0 32 32" id="opal-components__icon-calendar"><path d="M2 6v24h28V6zm0 9h28M7 3v6m6-6v6m6-6v6m6-6v6" xmlns="http://www.w3.org/2000/svg"/></symbol></svg>'):setTimeout(t,100)}()},function(t,e){!function t(){document.body?document.body.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol viewBox="0 0 32 32" id="opal-components__icon-checkmark"><path d="M2 20l10 8L30 4" xmlns="http://www.w3.org/2000/svg"/></symbol></svg>'):setTimeout(t,100)}()},function(t,e){!function t(){document.body?document.body.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol viewBox="0 0 32 32" id="opal-components__icon-chevron-bottom"><path d="M30 12L16 24 2 12" xmlns="http://www.w3.org/2000/svg"/></symbol></svg>'):setTimeout(t,100)}()},function(t,e){!function t(){document.body?document.body.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol viewBox="0 0 32 32" id="opal-components__icon-chevron-left"><path d="M20 30L8 16 20 2" xmlns="http://www.w3.org/2000/svg"/></symbol></svg>'):setTimeout(t,100)}()},function(t,e){!function t(){document.body?document.body.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol viewBox="0 0 32 32" id="opal-components__icon-close"><path d="M2 30L30 2m0 28L2 2" xmlns="http://www.w3.org/2000/svg"/></symbol></svg>'):setTimeout(t,100)}()},function(t,e){!function t(){document.body?document.body.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol viewBox="0 0 32 32" id="opal-components__icon-compose"><path d="M27 15v15H2V5h15m13 1l-4-4L9 19l-2 6 6-2zm-8 0l4 4zM9 19l4 4z" xmlns="http://www.w3.org/2000/svg"/></symbol></svg>'):setTimeout(t,100)}()},function(t,e){!function t(){document.body?document.body.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol viewBox="0 0 32 32" id="opal-components__icon-search"><circle cx="14" cy="14" r="12" xmlns="http://www.w3.org/2000/svg"/><path d="M23 23l7 7"/></symbol></svg>'):setTimeout(t,100)}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t,e){for(var n in e)t[n]=e[n];return t};e.assign=o},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),a=n(1),l=n(0);n(28);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"_tabIndex",{get:function(){return this.params.disabled?-1:this.params.tabIndex},enumerable:!0,configurable:!0}),e.prototype.ready=function(){this.params.focused&&(this.element.tabIndex=this._tabIndex,this.focus())},e.prototype.elementAttached=function(){this.listenTo(this,{"param-focused-change":this._onParamFocusedChange,"change:_tabIndex":this._onTabIndexChange}),this.listenTo(this.element,{focus:this._onElementFocus,blur:this._onElementBlur,click:this._onElementClick}),this.element.tabIndex=this._tabIndex},e.prototype._onParamFocusedChange=function(t){t.data.value?this.focus():this.blur()},e.prototype._onTabIndexChange=function(){this.element.tabIndex=this._tabIndex},e.prototype._onElementFocus=function(t){var e=this;r.nextTick(function(){document.activeElement==e.element&&(-1!=e.element.tagName.indexOf("-",1)&&(e._documentKeyDownListening=e.listenTo(document,"keydown",e._onDocumentKeyDown)),e.params.focused=!0,e.emit("focus"))})},e.prototype._onElementBlur=function(){this._documentKeyDownListening&&this._documentKeyDownListening.stop(),this.params.focused=!1,this.emit("blur")},e.prototype._onElementClick=function(){this.params.disabled||this.click()},e.prototype._onDocumentKeyDown=function(t){13==t.which&&(t.preventDefault(),this.params.disabled||this.click())},e.prototype.click=function(){return this.params.checkable&&(this.emit(this.toggle()?"check":"uncheck"),this.emit("change")),this.emit("click"),this},Object.defineProperty(e.prototype,"checked",{get:function(){return this.params.checked},set:function(t){this.params.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this.checked},set:function(t){this.checked=t},enumerable:!0,configurable:!0}),e.prototype.check=function(){return!this.params.checked&&(this.params.checked=!0,!0)},e.prototype.uncheck=function(){return!!this.params.checked&&(this.params.checked=!1,!0)},e.prototype.toggle=function(t){return this.params.checked=void 0===t?!this.params.checked:t},e.prototype.focus=function(){return this.element.focus(),this},e.prototype.blur=function(){return this.element.blur(),this},e.prototype.enable=function(){return this.params.disabled=!1,this},e.prototype.disable=function(){return this.params.disabled=!0,this},i([a.computed],e.prototype,"_tabIndex",null),e=i([l.Component.Config({elementIs:"OpalButton",params:{viewType:"default",size:"m",checkable:!1,checked:!1,loading:!1,tabIndex:0,focused:!1,disabled:!1}})],e)}(l.Component);e.OpalButton=s},function(t,e){t.exports=function(t){var e=t.head||t.getElementsByTagName("head")[0];if(e){var n=t.createElement("style");return n.type="text/css",n.textContent=".OpalButton{padding:0;border:0;background:0 0;color:inherit;font:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.OpalButton:not([view-type=clean]){position:relative;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;padding:7px 23px;border-radius:3px;background:#546778;color:#fff;vertical-align:middle;text-align:center;text-decoration:none;text-shadow:none;font:16px/24px Verdana,Geneva,sans-serif;font-weight:400;-webkit-transition:background .1s linear;-o-transition:background .1s linear;transition:background .1s linear;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}.OpalButton:not([view-type=clean])::-moz-focus-inner{padding:0;border:0}.OpalButton:not([view-type=clean])[size=s]{padding:4px 13px;font-size:14px;line-height:21px}.OpalButton:not([view-type=clean]):hover{background:#597791}.OpalButton:not([view-type=clean]):focus{outline:0}body:not(._no-focus-highlight) .OpalButton:not([view-type=clean]):focus::after{position:absolute;top:2px;right:2px;bottom:2px;left:2px;border:1px solid rgba(255,255,255,.8);border-radius:inherit;content:'';pointer-events:none}.OpalButton:not([view-type=clean]):active,.OpalButton:not([view-type=clean])[checked]{background:#43484c}.OpalButton:not([view-type=clean])[loading]{background-image:-o-linear-gradient(315deg,rgba(255,255,255,.35) 0,rgba(255,255,255,.35) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.35) 50%,rgba(255,255,255,.35) 75%,transparent 75%,transparent 100%);background-image:linear-gradient(135deg,rgba(255,255,255,.35) 0,rgba(255,255,255,.35) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.35) 50%,rgba(255,255,255,.35) 75%,transparent 75%,transparent 100%);background-size:30px 30px;-webkit-animation:OpalButton__loading-animation 3s linear infinite;animation:OpalButton__loading-animation 3s linear infinite}.OpalButton:not([view-type=clean])[disabled]{opacity:.5;pointer-events:none}.OpalGroup .OpalGroup__content-slot>.OpalButton:not([view-type=clean]):not(:first-child),.OpalGroup .OpalGroup__content-slot>:not(:first-child) .OpalButton:not([view-type=clean]){border-top-left-radius:0;border-bottom-left-radius:0;-webkit-box-shadow:inset 1px 0 rgba(0,0,0,.4);box-shadow:inset 1px 0 rgba(0,0,0,.4)}.OpalGroup .OpalGroup__content-slot>.OpalButton:not([view-type=clean]):not(:last-child),.OpalGroup .OpalGroup__content-slot>:not(:last-child) .OpalButton:not([view-type=clean]){border-top-right-radius:0;border-bottom-right-radius:0}.OpalSwitchMenu .OpalButton:not([view-type=clean]):not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;-webkit-box-shadow:inset 1px 0 rgba(0,0,0,.4);box-shadow:inset 1px 0 rgba(0,0,0,.4)}.OpalSwitchMenu .OpalButton:not([view-type=clean]):not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.OpalButton[view-type=primary]{background:#1b91f8}.OpalButton[view-type=primary]:hover{background-color:#33a0ff}.OpalButton[view-type=primary]:active,.OpalButton[view-type=primary][checked]{background-color:#1371c3}.OpalButton[view-type=danger]{background:#f63159}.OpalButton[view-type=danger]:hover{background-color:#fd496d}.OpalButton[view-type=danger]:active,.OpalButton[view-type=danger][checked]{background-color:#d3173d}@-webkit-keyframes OpalButton__loading-animation{0%{background-position:0 0}to{background-position:60px 0}}@keyframes OpalButton__loading-animation{0%{background-position:0 0}to{background-position:60px 0}}",e.appendChild(n),n}return null}(document)},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),a=n(1),l=n(0);n(30);var s=n(31),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"_tabIndex",{get:function(){return this.params.disabled?-1:this.params.tabIndex},enumerable:!0,configurable:!0}),e.prototype.elementAttached=function(){this.listenTo(this,"param-focused-change",this._onParamFocusedChange),this.listenTo("control",{focus:this._onControlFocus,blur:this._onControlBlur,click:this._onControlClick})},e.prototype.ready=function(){this.params.focused&&this.focus()},e.prototype._onParamFocusedChange=function(t){t.data.value?this.focus():this.blur()},e.prototype._onControlFocus=function(t){var e=this;r.nextTick(function(){document.activeElement==t.target&&(e.params.focused=!0,e.emit("focus"))})},e.prototype._onControlBlur=function(){this.params.focused=!1,this.emit("blur")},e.prototype._onControlClick=function(t){t.preventDefault(),this.params.disabled||this.click()},e.prototype.click=function(){return this.params.checkable&&this.emit(this.toggle()?"check":"uncheck"),this.emit("click"),this},Object.defineProperty(e.prototype,"checked",{get:function(){return this.params.checked},set:function(t){this.params.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this.checked},set:function(t){this.checked=t},enumerable:!0,configurable:!0}),e.prototype.check=function(){return!this.params.checked&&(this.params.checked=!0,!0)},e.prototype.uncheck=function(){return!!this.params.checked&&(this.params.checked=!1,!0)},e.prototype.toggle=function(t){return this.params.checked=void 0===t?!this.params.checked:t},e.prototype.focus=function(){return this.$("control").focus(),this},e.prototype.blur=function(){return this.$("control").blur(),this},e.prototype.enable=function(){return this.params.disabled=!1,this},e.prototype.disable=function(){return this.params.disabled=!0,this},i([a.computed],e.prototype,"_tabIndex",null),e=i([l.Component.Config({elementIs:"OpalSignButton",params:{sign:{type:String,required:!0},checkable:!1,checked:!1,tabIndex:0,focused:!1,disabled:!1},template:s.default})],e)}(l.Component);e.OpalSignButton=p},function(t,e){t.exports=function(t){var e=t.head||t.getElementsByTagName("head")[0];if(e){var n=t.createElement("style");return n.type="text/css",n.textContent=".OpalSignButton{display:inline-block;line-height:0}.OpalSignButton .OpalSignButton__control{position:relative;padding:0;border:0;background:0 0;color:inherit;white-space:nowrap;font:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.OpalSignButton .OpalSignButton__control:focus{outline:0}body:not(._no-focus-highlight) .OpalSignButton .OpalSignButton__control:focus::after{position:absolute;top:-1px;right:0;bottom:1px;left:0;border:1px solid #1b91f8;border-radius:3px;content:'';pointer-events:none}.OpalSignButton .OpalSignButton__control:active{top:1px}.OpalSignButton .OpalSignButton__sign{position:relative;top:-1px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;margin:3px;width:28px;height:28px;border:2px solid;border-radius:50%;vertical-align:middle;-webkit-transition:border-color .1s linear;-o-transition:border-color .1s linear;transition:border-color .1s linear}.OpalSignButton .OpalSignButton__sign::before,.OpalSignButton .OpalSignButton__sign::after{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;width:12px;height:2px;-webkit-transition:background .1s linear;-o-transition:background .1s linear;transition:background .1s linear}.OpalSignButton .OpalSignButton__sign::after{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.OpalSignButton[sign=plus] .OpalSignButton__control:hover .OpalSignButton__sign,.OpalSignButton[sign=plus] .OpalSignButton__control:active .OpalSignButton__sign{border-color:#33a0ff}.OpalSignButton[sign=plus] .OpalSignButton__control:hover .OpalSignButton__sign::before,.OpalSignButton[sign=plus] .OpalSignButton__control:hover .OpalSignButton__sign::after,.OpalSignButton[sign=plus] .OpalSignButton__control:active .OpalSignButton__sign::before,.OpalSignButton[sign=plus] .OpalSignButton__control:active .OpalSignButton__sign::after{background:#33a0ff}.OpalSignButton[sign=plus] .OpalSignButton__sign{border-color:#107cda}.OpalSignButton[sign=plus] .OpalSignButton__sign::before,.OpalSignButton[sign=plus] .OpalSignButton__sign::after{background:#107cda;content:''}.OpalSignButton[sign=minus] .OpalSignButton__control:hover .OpalSignButton__sign,.OpalSignButton[sign=minus] .OpalSignButton__control:active .OpalSignButton__sign{border-color:#fd496d}.OpalSignButton[sign=minus] .OpalSignButton__control:hover .OpalSignButton__sign::before,.OpalSignButton[sign=minus] .OpalSignButton__control:hover .OpalSignButton__sign::after,.OpalSignButton[sign=minus] .OpalSignButton__control:active .OpalSignButton__sign::before,.OpalSignButton[sign=minus] .OpalSignButton__control:active .OpalSignButton__sign::after{background:#fd496d}.OpalSignButton[sign=minus] .OpalSignButton__sign{border-color:#eb143f}.OpalSignButton[sign=minus] .OpalSignButton__sign::before{background:#eb143f;content:''}.OpalSignButton[checked] .OpalSignButton__control{top:1px}.OpalSignButton[disabled]{opacity:.5;pointer-eve