@telsystems/common
Version:
Common package
1 lines • 67 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@telsystems/design"),require("@telsystems/helpers"),require("@telsystems/inputs"),require("classnames"),require("lodash/cloneDeep"),require("prop-types")):"function"==typeof define&&define.amd?define(["@telsystems/design","@telsystems/helpers","@telsystems/inputs","classnames","lodash/cloneDeep","prop-types"],e):"object"==typeof exports?exports.main=e(require("@telsystems/design"),require("@telsystems/helpers"),require("@telsystems/inputs"),require("classnames"),require("lodash/cloneDeep"),require("prop-types")):t.main=e(t["@telsystems/design"],t["@telsystems/helpers"],t["@telsystems/inputs"],t.classnames,t["lodash/cloneDeep"],t["prop-types"])}(this,function(t,e,r,n,o,i){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=24)}([function(t,e,r){t.exports=r(6)(2)},function(e,r){e.exports=t},function(t,e,r){t.exports=r(6)(74)},function(t,e,r){t.exports=r(6)(615)},function(t,r){t.exports=e},function(t,e){t.exports=r},function(t,e){t.exports=vendor},function(t,e){t.exports=n},function(t,e,r){t.exports=r(6)(278)},function(t,e,r){t.exports=r(6)(128)},function(t,e,r){"use strict";t.exports=function(t){return null!==t&&"object"==typeof t}},function(t,e,r){t.exports=r(6)(469)},function(t,e,r){t.exports=r(6)(467)},function(t){t.exports={domain:{objects:{sipuser:"Учетные записи SIP",provider:"Операторы SIP телефонии",route:"Маршрутизация. Выбор вектора",vectorrule:"Маршрутизация. Внутри вектора",featurecode:"Коды абонентских функций",redirect_rule:"Переадресация. Правила",redirect_activity:"Переадресация. Активность",group:"Групповые номера",provider_callerid:"Нормализация CallerID внешних линий",representative:"Нормализация CallerID между ТД",svcscript:"Служебные сценарии",svctask:"Cron запуска служебных сценариев",ivrscript:"IVR сценарии",chatbotscript:"ICR сценарии",chatcampaign:"ICR кампания",user:"Пользователь",hunt:"Очереди",addressbook:"Адресная книга",workday:"Рабочее расписание",domain:"Дочерние КД",settings:"Настройки",report:"Система отчетности",dbproc:"Сбор данных для отчетности",project:"Проекты сценариев",domain_user:"Пользователи дочерних КД"},route:{"dir___*":"*",dir___inner:"Внутренние SIP абоненты",dir___outer:"Внешние SIP операторы",dir___cross:"Другие КД"},vectorrule:{action___denied:"Запретить вызов",action___external:"На внешнего SIP оператора",action___internal:"На внутреннего SIP абонента",action___internalpbx:"На абонента за IP-АТС",action___crossdomain:"В другой КД",action___featurecode:"Код абонентских функций","dir___*":"*",dir___inner:"Внутренние SIP абоненты",dir___outer:"Внешние SIP операторы",dir___cross:"Другие КД"},featurecode:{type___conference:"Конференция",type___pickup:"Перехват звонка",type___grouppickup:"Перехват звонка по групповым номерам",type___ivr:"Сценарий IVR",type___voicemail:"Голосовая почта",type___voicemail_send:"Отправка голосовой почты",type___parking:"Парковка",type___parking_get:"Взятие с парковки",type___intercom:"Интерком",type___barge:"Вторжение"},redirect_activity:{type___absolute:"Безусловная",type___unregistered:"Нет регистрации",type___busy:"Занято",type___timeout:"Нет ответа",type___decline:"Отклонено",type___dnd:"Режим DND",type___error:"Ошибка вызова",type___other:"Другая причина"},provider_callerid:{dir___inner:"Исходящий на внешнюю линию",dir___outer:"Входящий с внешней линии"},representative:{"dir___*":"*",dir___inner:"Исходящий из текущего КД",dir___global:"Скрыть",dir___cross:"Входящий в текущий КД"}},masterDomain:{objects:{sipuser:"Учетные записи SIP",provider:"Операторы SIP телефонии",route:"Маршрутизация. Выбор вектора",vectorrule:"Маршрутизация. Внутри вектора",featurecode:"Коды абонентских функций",redirect_rule:"Переадресация. Правила",redirect_activity:"Переадресация. Активность",group:"Групповые номера",provider_callerid:"Нормализация CallerID внешних линий",representative:"Нормализация CallerID между ТД",svcscript:"Служебные сценарии",svctask:"Cron запуска служебных сценариев",ivrscript:"IVR сценарии",chatbotscript:"ICR сценарии",chatcampaign:"ICR кампания",user:"Системные учетные записи",hunt:"Очереди",addressbook:"Адресная книга",workday:"Рабочее расписание",domain:"КД уровня L1",settings:"Общие настройки",borderrule:"Правила пограничного контроля (SBC)",report:"Система отчетности",dbproc:"Сбор данных для отчетности",domain_user:"Пользователи дочерних КД"}}}},function(t,e,r){t.exports=r(6)(466)},function(t,e,r){var n;"undefined"!=typeof window?n=window:"undefined"!=typeof self?n=self:(console.warn("Using browser-only version of superagent in non-browser environment"),n=this);var o=r(23),i=r(22),s=r(10),a=r(21),u=r(19);function c(){}var l=e=t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1==arguments.length?new e.Request("GET",t):new e.Request(t,r)};e.Request=m,l.getXHR=function(){if(!(!n.XMLHttpRequest||n.location&&"file:"==n.location.protocol&&n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function f(t){if(!s(t))return t;var e=[];for(var r in t)d(e,r,t[r]);return e.join("&")}function d(t,e,r){if(null!=r)if(Array.isArray(r))r.forEach(function(r){d(t,e,r)});else if(s(r))for(var n in r)d(t,e+"["+n+"]",r[n]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(r));else null===r&&t.push(encodeURIComponent(e))}function h(t){for(var e,r,n={},o=t.split("&"),i=0,s=o.length;i<s;++i)-1==(r=(e=o[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function y(t){return/[\/+]json($|[^-\w])/.test(t)}function _(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.header=this.headers=function(t){for(var e,r,n,o,i=t.split(/\r?\n/),s={},a=0,u=i.length;a<u;++a)-1!==(e=(r=i[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),o=p(r.slice(e+1)),s[n]=o);return s}(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function m(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",function(){var t,e=null,n=null;try{n=new _(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)})}function g(t,e,r){var n=l("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}l.serializeObject=f,l.parseString=h,l.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},l.serialize={"application/x-www-form-urlencoded":f,"application/json":JSON.stringify},l.parse={"application/x-www-form-urlencoded":h,"application/json":JSON.parse},a(_.prototype),_.prototype._parseBody=function(t){var e=l.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&y(this.type)&&(e=l.parse["application/json"]),e&&t&&(t.length||t instanceof Object)?e(t):null)},_.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot "+e+" "+r+" ("+this.status+")",o=new Error(n);return o.status=this.status,o.method=e,o.url=r,o},l.Response=_,o(m.prototype),i(m.prototype),m.prototype.type=function(t){return this.set("Content-Type",l.types[t]||t),this},m.prototype.accept=function(t){return this.set("Accept",l.types[t]||t),this},m.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"==typeof e&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});return this._auth(t,e,r,function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")})},m.prototype.query=function(t){return"string"!=typeof t&&(t=f(t)),t&&this._query.push(t),this},m.prototype.attach=function(t,e,r){if(e){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},m.prototype._getFormData=function(){return this._formData||(this._formData=new n.FormData),this._formData},m.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},m.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},m.prototype.buffer=m.prototype.ca=m.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},m.prototype.pipe=m.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},m.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},m.prototype.end=function(t){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||c,this._finalizeQueryString(),this._end()},m.prototype._end=function(){var t=this,e=this.xhr=l.getXHR(),r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4==r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.onprogress=n.bind(null,"download"),e.upload&&(e.upload.onprogress=n.bind(null,"upload"))}catch(t){}try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||l.serialize[o?o.split(";")[0]:""];!i&&y(o)&&(i=l.serialize["application/json"]),i&&(r=i(r))}for(var s in this.header)null!=this.header[s]&&this.header.hasOwnProperty(s)&&e.setRequestHeader(s,this.header[s]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==r?r:null),this},l.agent=function(){return new u},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){u.prototype[t.toLowerCase()]=function(e,r){var n=new l.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}}),u.prototype.del=u.prototype.delete,l.get=function(t,e,r){var n=l("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},l.head=function(t,e,r){var n=l("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},l.options=function(t,e,r){var n=l("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.del=g,l.delete=g,l.patch=function(t,e,r){var n=l("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.post=function(t,e,r){var n=l("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.put=function(t,e,r){var n=l("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e){t.exports=o},function(t,e,r){"use strict";r.r(e);var n=r(3),o=r.n(n),i=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),s=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r},a=function(t){function e(e,r){void 0===r&&(r={});var n=t.call(this,e,r)||this,o=n.cleanExtraProps(n.getState());return n.update(o),n}return i(e,t),e.prototype.cleanExtraProps=function(t){t.__waiting,t.__failed;return s(t,["__waiting","__failed"])},e}(o.a.Model),u=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e}(a),l=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.Model=c,e}(o.a.Collection),f=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),d=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},h=function(t){function e(e,r,n){var o,i,s=t.call(this,e,r,n)||this,a=s.storeKey;if(e){if(!a){var u="storeKey must be defined to use model in "+s.constructor.name;throw console.error(u),new Error(u)}s.model=new e(r[a]),s.currentProps=d({},r,((o={})[a]=e.defaults,o)),s.nextProps=d({},r,((i={})[a]=e.defaults,i))}return s}return f(e,t),e.prototype.componentWillReceiveProps=function(t,e){var r=this.storeKey;this.currentProps=t,this.nextProps=e,this.model&&this.model.updateProps(t[r],e[r])},e}(o.a.Controller),y=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e}(a),m=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.getUserInfo=function(){var t=this.getState();return{login:t.login,name:t.name,name_login:t.name_login}},e}(a),v=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),b=function(t){function e(r,n){void 0===n&&(n={});var o=t.call(this,r,n)||this;return o.update(Object.assign(e.defaults,r)),o}return v(e,t),e.prototype.saveExtProp=function(t,e,r){var n=this.getState().ext;n[t]=n[t]||{},n[t][e]=r,this.update({ext:n})},e.prototype.getExtProp=function(t){return this.getState().ext[t]},e.prototype.savePreset=function(t){var e=this.getState().ext;e.presets||(e.presets=[]),e.presets.push(t),this.update({ext:e})},e.prototype.deletePreset=function(t){var e=this.getState().ext;if(e.presets){var r=e.presets.findIndex(function(e){return e.name===t});r>-1&&(e.presets.splice(r,1),this.update({ext:e}))}},e.prototype.getPresets=function(){var t=this.getState().ext;return t.presets?t.presets:[]},e.prototype.isAdmin=function(){return this.getState().rights.includes("admin")},e.defaults={login:"",name:"",ext:{},id:"",opts:{chat_dlg_limit:1,chat_dlg_mode:0,chat_full_limit:0,comment:"",tags:[]},pwd:"",rights:"",timezone:""},e}(a),O=r(16),w=r.n(O),E=r(4),P=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function T(t,e,r){return P({},r,{value:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=t.data,i=t.resultcode,s=t.resultmsg,a={result:o,error:0!==i?{code:i,message:s}:null};return r.value.apply(this,[a].concat(e))}})}r(15);var j=r(2),S=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},x="ERROR@ERROR_HANDLER",R={statusCode:null,statusText:null,body:null,showErrorModal:!1};Object(j.applyReducer)("errors",function(t,e){void 0===t&&(t=R);var r=e.statusCode,n=e.type,o=e.statusText,i=e.body;switch(n){case x:return S({},t,{statusCode:r,statusText:o,body:i,showErrorModal:!0});case"ERROR@CLOSE_ERROR_MODAL":return S({},t,{showErrorModal:!1});default:return t}});var D=function(t){var e=t.body,r=t.statusText,n=t.statusCode;return{type:x,body:e,statusCode:n,statusText:r}},A=r(9),C=r(14);function k(t){var e=t.data,r=t.requestHelper,n=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||A.compose,o=[Object(j.middleware)(r)],i=Object(j.combine)({routing:C.routerReducer});return n(A.applyMiddleware.apply(void 0,o))(A.createStore)(i,e)}var I=r(13),N=function(){function t(){this.isMasertDomain=!1}return t.prototype.translateSideBar=function(t){var e=this.getDictionary().objects;return e&&e[t]?e[t]:this.getOriginalId(t)},t.prototype.translateFormField=function(t){var e=this.getDictionary()[this.objectName];return e&&e[t]?e[t]:this.getOriginalId(t)},t.prototype.setIsMasterDomain=function(t){this.isMasertDomain=t,this.setDictionary(I[t?"masterDomain":"domain"])},t.prototype.setObjectName=function(t){this.objectName=t},t.prototype.setDictionary=function(t){this.dictionary=t},t.prototype.getDictionary=function(){return this.dictionary},t.prototype.getOriginalId=function(t){return t.split("___").slice(-1)[0]},t}(),L=new N;function W(t){if(0===t.resultcode)return t;throw t}function U(t){var e=t.resultcode,r=t.resultmsg;return 1407===e&&r.includes("Session not found")}function F(t){return"/api/"+t}function M(){var t=document.getElementById("root");t&&t.classList.remove("invisible")}function q(){var t=document.getElementById("initial-display-rule");t&&t.remove()}function K(t,e){return F(e?t+"&td=foobar.webdev.rostell.ru&login=admin5&pwd=admin5":t+"?td=foobar.webdev.rostell.ru&login=admin5&pwd=admin5")}function H(t){var e=t;return t instanceof Error&&(e={message:t.message,stack:t.stack}),Object.assign({},{timestamp:(new Date).getTime(),responseTimestamp:void 0,message:"",meta:"",stack:"",type:void 0,details:""},e)}var z,B=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function G(t){this.message=t.toString(),this.name="Promise unhandled error",this.stack=t.stack}G.prototype.toString=function(){return this.message};var X=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function V(t,e,r){return X({},r,{value:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=function(t){var e={statusCode:t&&t.status?t.status:0,statusText:t.error||"Error",body:t.message||JSON.stringify(t)};if(t.errorDetails&&t.errorDetails.detail&&t.errorDetails.status&&t.errorDetails.title&&(e.statusCode=t.errorDetails.status,e.statusText=t.errorDetails.title,e.body=t.errorDetails.detail,t.errorMessages&&t.errorMessages.length)){var r=t.errorMessages.map(function(t){return t.field+": "+t.message}).join("; ");e.body+=": "+r}return t instanceof Error&&(e.statusText=t.message,e.body=t.stack||""),X({},e)}(t);return function(t){setTimeout(function(){z.dispatch(D(B({},t)))},1)}(o),r.value.apply(this,[{error:o,origError:t}].concat(e))}})}var $=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),J=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Q=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Z=function(t){function e(e,r){var n=t.call(this,e,r)||this,o=n.getState();return n.updateProps(o,o),n}return $(e,t),e.prototype.createDefaults=function(){var t={};return this.constructor.defaults&&(t=Object.assign({},t,this.constructor.defaults)),Object.assign({},this.getState(),t)},e.prototype.resetWaiting=function(t){return void 0===t&&(t=this.currentAction),this.set("__waiting."+t,!1),this},e.prototype.reset=function(t){return this.state=Object.assign({},{__waiting:{},__failed:{}},w()(t)),this},e.prototype.isWaiting=function(t){var e=!1;return e=t?!!this.getState().__waiting[t]:!!Object.entries(this.getState().__waiting).find(function(t){t[0];return!0===t[1]}),!this.isActionFulfilled(t)&&e},e.prototype.isFailed=function(t){var e=!1;return e=t?!!this.getState().__failed[t]:!!Object.entries(this.getState().__failed).find(function(t){t[0];return!0===t[1]}),this.isActionFulfilled(t)&&e},e.prototype.updateProps=function(t,e){this.lastProps=t,this.currentProps=e,this.reset(e)},e.prototype.diff=function(t){return t?E.common.diff(this.lastProps[t],this.currentProps[t]):E.common.diff(this.lastProps,this.currentProps)},e.prototype.isEqual=function(t){return Object.keys(this.diff(t)).length>0},e.prototype.getLastProp=function(t){return this.lastProps[t]},e.prototype.isActionFulfilled=function(t){var e=!1,r=!1;if(t)e=this.getLastProp("__waiting")[t],r=this.getWaiting(t);else{var n=this.getLastProp("__waiting"),o=this.getWaiting();e=!!Object.keys(n).find(function(t){return n[t]}),r=!!Object.keys(o).find(function(t){return o[t]})}return e&&!r},e.prototype.setActionToWaiting=function(t,e){return void 0===t&&(t=this.currentAction),void 0===e&&(e={}),this.setWaiting(t).update(J({error:null},e)).resetFailed(t).getState()},e.prototype.setActionToFailed=function(t,e){var r=t.error;t.origError;return void 0===e&&(e=this.currentAction),this.resetWaiting(e).update({error:r}).setFailed(e).getState()},e.prototype.onInit=function(){return this.currentAction=this.options.action,this},Q([V],e.prototype,"setActionToFailed",null),e}(o.a.Model),Y=r(0),tt=r(7),et=r.n(tt),rt=r(41),nt=r.n(rt),ot=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ot(e,t),e.prototype.render=function(){var t=this.props,e=t.children,r=t.className;return Y.createElement("div",{className:et()(nt.a.container,r)},e)},e}(Y.PureComponent),st=r(36),at=r.n(st),ut=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ut(e,t),e.prototype.render=function(){var t=this.props,e=t.children,r=t.horizontal,n=t.vertical,o=t.className,i=r?at.a.horizontal:"",s=n?at.a.vertical:"";return Y.createElement("div",{className:et()(at.a.centered,i,s,o)},e)},e.defaultProps={children:Y.createElement("div",null),vertical:!0,horizontal:!0},e}(Y.Component),lt=(r(18),"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0);function pt(t,e,r){t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent&&t.attachEvent("on"+e,function(){r(window.event)})}function ft(t,e){for(var r=e.slice(0,e.length-1),n=0;n<r.length;n++)r[n]=t[r[n].toLowerCase()];return r}function dt(t){t||(t="");for(var e=(t=t.replace(/\s/g,"")).split(","),r=e.lastIndexOf("");r>=0;)e[r-1]+=",",e.splice(r,1),r=e.lastIndexOf("");return e}function ht(t,e){for(var r=t.length>=e.length?t:e,n=t.length>=e.length?e:t,o=!0,i=0;i<r.length;i++)-1===n.indexOf(r[i])&&(o=!1);return o}for(var yt={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,"⇪":20,",":188,".":190,"/":191,"`":192,"-":lt?173:189,"=":lt?61:187,";":lt?59:186,"'":222,"[":219,"]":221,"\\":220},_t={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":lt?224:91,cmd:lt?224:91,command:lt?224:91},mt=[],gt={16:"shiftKey",18:"altKey",17:"ctrlKey"},vt={16:!1,18:!1,17:!1},bt={},Ot=1;Ot<20;Ot++)yt["f"+Ot]=111+Ot;gt[lt?224:91]="metaKey",vt[lt?224:91]=!1;var wt="all",Et=!1,Pt=function(t){return yt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Tt(t){wt=t||"all"}function jt(){return wt||"all"}function St(t,e,r){var n=void 0;if(e.scope===r||"all"===e.scope){for(var o in n=e.mods.length>0,vt)Object.prototype.hasOwnProperty.call(vt,o)&&(!vt[o]&&e.mods.indexOf(+o)>-1||vt[o]&&-1===e.mods.indexOf(+o))&&(n=!1);(0!==e.mods.length||vt[16]||vt[18]||vt[17]||vt[91])&&!n&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function xt(t,e,r){var n=dt(t),o=[],i="all",s=document,a=0;for(void 0===r&&"function"==typeof e&&(r=e),"[object Object]"===Object.prototype.toString.call(e)&&(e.scope&&(i=e.scope),e.element&&(s=e.element)),"string"==typeof e&&(i=e);a<n.length;a++)o=[],(t=n[a].split("+")).length>1&&(o=ft(_t,t)),(t="*"===(t=t[t.length-1])?"*":Pt(t))in bt||(bt[t]=[]),bt[t].push({scope:i,mods:o,shortcut:n[a],method:r,key:n[a]});void 0===s||Et||(Et=!0,pt(s,"keydown",function(t){!function(t){var e=bt["*"],r=t.keyCode||t.which||t.charCode;if(-1===mt.indexOf(r)&&mt.push(r),93!==r&&224!==r||(r=91),r in vt){for(var n in vt[r]=!0,_t)_t[n]===r&&(xt[n]=!0);if(!e)return}for(var o in vt)Object.prototype.hasOwnProperty.call(vt,o)&&(vt[o]=t[gt[o]]);if(xt.filter.call(this,t)){var i=jt();if(e)for(var s=0;s<e.length;s++)e[s].scope===i&&St(t,e[s],i);if(r in bt)for(var a=0;a<bt[r].length;a++)St(t,bt[r][a],i)}}(t)}),pt(s,"keyup",function(t){!function(t){var e=t.keyCode||t.which||t.charCode,r=mt.indexOf(e);if(r>=0&&mt.splice(r,1),93!==e&&224!==e||(e=91),e in vt)for(var n in vt[e]=!1,_t)_t[n]===e&&(xt[n]=!1)}(t)}))}var Rt={setScope:Tt,getScope:jt,deleteScope:function(t,e){var r=void 0,n=void 0;for(var o in t||(t=jt()),bt)if(Object.prototype.hasOwnProperty.call(bt,o))for(r=bt[o],n=0;n<r.length;)r[n].scope===t?r.splice(n,1):n++;jt()===t&&Tt(e||"all")},getPressedKeyCodes:function(){return mt.slice(0)},isPressed:function(t){return"string"==typeof t&&(t=Pt(t)),-1!==mt.indexOf(t)},filter:function(t){var e=t.target.tagName||t.srcElement.tagName;return!("INPUT"===e||"SELECT"===e||"TEXTAREA"===e)},unbind:function(t,e){for(var r=dt(t),n=void 0,o=[],i=void 0,s=0;s<r.length;s++){if((n=r[s].split("+")).length>1&&(o=ft(_t,n)),t="*"===(t=n[n.length-1])?"*":Pt(t),e||(e=jt()),!bt[t])return;for(var a=0;a<bt[t].length;a++)(i=bt[t][a]).scope===e&&ht(i.mods,o)&&(bt[t][a]={})}}};for(var Dt in Rt)Object.prototype.hasOwnProperty.call(Rt,Dt)&&(xt[Dt]=Rt[Dt]);if("undefined"!=typeof window){var At=window.hotkeys;xt.noConflict=function(t){return t&&window.hotkeys===xt&&(window.hotkeys=At),xt},window.hotkeys=xt}var Ct=xt;Ct.filter=function(t){var e=(t.target||t.srcElement).tagName;return Ct.setScope(/^(INPUT|TEXTAREA|SELECT)$/.test(e)?"input":"other"),!0};var kt=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return n.onKeyDown=n.onKeyDown.bind(n),n.onKeyUp=n.onKeyUp.bind(n),n.handleKeyUpEvent=n.handleKeyUpEvent.bind(n),n.isKeyDown=!1,n.handle={},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){Ct.unbind(this.props.keyName),Ct(this.props.keyName,this.onKeyDown),document.addEventListener("keyup",this.handleKeyUpEvent)},e.prototype.componentWillUnmount=function(){Ct.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document.removeEventListener("keyup",this.handleKeyUpEvent)},e.prototype.onKeyUp=function(t,e){var r=this.props.onKeyUp;r(e.shortcut,t,e)},e.prototype.onKeyDown=function(t,e){var r=this.props.onKeyDown;this.isKeyDown||(this.isKeyDown=!0,this.handle=e,r(e.shortcut,t,e))},e.prototype.handleKeyUpEvent=function(t){this.isKeyDown&&(this.isKeyDown=!1,this.props.keyName.indexOf(this.handle.shortcut)<0||(this.onKeyUp(t,this.handle),this.handle={}))},e.prototype.render=function(){return this.props.children||null},e}(Y.Component);kt.propTypes={},kt.defaultProps={onKeyUp:function(){},onKeyDown:function(){}};var It,Nt,Lt=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Lt(e,t),e.prototype.render=function(){var t=this.props,e=t.onKeyDown,r=t.onKeyUp,n=t.keyName,o=t.children;return Y.createElement(kt,{keyName:n,onKeyDown:e,onKeyUp:r},o)},e}(Y.Component),Ut=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ft=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ut(e,t),e.prototype.onLoadSuccess=function(t){var e=t.result;return this.update({data:e}).getState()},e.defaults={data:[],isWaiting:!1,error:null},Ft([T],e.prototype,"onLoadSuccess",null),e}(Z),qt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Kt="domains",Ht=Object.assign({},Mt.defaults),zt=Kt+"@@LOAD",Bt=Kt+"@@CHANGE_DOMAIN",Gt=Object(j.createActions)({storeKey:Kt,initialState:Ht,actions:(It={},It[zt]={action:function(){return{promise:function(t){return t(F("auth/v1/domains")).get({})}}},handlers:{onWait:function(t){return new Mt(t,{currentAction:zt}).setActionToWaiting()},onFail:function(t,e){var r=e.error;return new Mt(t,{currentAction:zt}).setActionToFailed(r)},onSuccess:function(t,e){var r=e.result;return new Mt(t,{currentAction:zt}).onLoadSuccess(r)}}},It[Bt]={action:function(t){return{promise:function(e){return e(F("auth/v1/chdom?domain="+t)).post({data:{domain:t}})}}},handlers:{onWait:function(t){return new Mt(t,{currentAction:Bt}).setActionToWaiting()},onFail:function(t,e){var r=e.error;return new Mt(t,{currentAction:Bt}).setActionToFailed(r)},onSuccess:function(t){return qt({},t,{isWaiting:!1})}}},It)}),Xt=Gt[zt],Vt=Gt[Bt],$t=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $t(e,t),e.prototype.updateState=function(t){return this.update(Jt({},t,{isModified:!0})).getState()},e.defaults={isWaiting:!1,error:null,data:null,isAuthorized:!1},e}(Z),Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Yt={data:null,error:null,isWaiting:!1,isAuthorized:!1},te="auth/v1/info";var ee=((Nt={})["user@@LOGIN"]={action:function(t){return{promise:function(e){return e(F("auth/v1/login")).get({params:t})}}},handlers:{onWait:function(t){return Zt({},t,{isWaiting:!0,error:null,data:null})},onFail:function(t,e){var r=e.error;return Zt({},t,{isWaiting:!1,error:r})},onSuccess:function(t,e){var r=e.result,n=r.resultcode,o=r.resultmsg,i=r.data;return Zt({},t,0!==n?{error:{code:n,message:o},isWaiting:!1}:{isWaiting:!1,data:i})}}},Nt["user@@LOGOUT"]={action:function(){return{promise:function(t){return t(F("auth/v1/logout")).get({})}}},handlers:{onWait:function(t){return t},onFail:function(t,e){e.error;return t},onSuccess:function(t){return Zt({},t,{isAuthorized:!1})}}},Nt["user@@FETCH"]={action:function(){return{promise:function(t){return function(t){return new Promise(function(e,r){t(F(te)).get({params:{user:!0}}).then(function(n){if(1407===n.resultcode)return r(n);t(F(ne(n.data.id))).get({}).then(function(t){return e({info:n,userData:t})})})})}(t)}}},handlers:{onWait:function(t){return Zt({},t,{error:null,isAuthorized:!1,isWaiting:!0,data:null})},onFail:function(t,e){var r=e.error;return Zt({},t,{isWaiting:!1,error:r,isAuthorized:!U(r)})},onSuccess:function(t,e){var r=e.result,n=r.userData,o=n.data,i=n.resultcode,s=(n.resultmsg,r.info),a=s.data,u=s.resultcode;s.resultmsg;if(1407===i||1407===u)return Zt({},t,{isWaiting:!1});new g(a);var c=new b(o[0]);return Zt({},t,{isWaiting:!1,isAuthorized:!0,data:c.getState()})}}},Nt["user@@SAVE_PROFILE_SETTINGS"]={action:function(t,e){return{promise:function(r){return r(F(oe(t.id,e))).post({data:{data:t}})}}},handlers:{onWait:function(t){return new Qt(t).updateState({error:null,isWaiting:!0})},onFail:function(t,e){var r=e.error;return new Qt(t).updateState({isWaiting:!1,error:r})},onSuccess:function(t,e){e.result;return new Qt(t).updateState({isWaiting:!1,error:null})}}},Nt),re=Object(j.createActions)({storeKey:"user",initialState:Yt,actions:ee});function ne(t){return'admin/v1/user/read/?filter={"id":"'+t+'"}'}function oe(t,e){return"admin/v1/user/"+(e?"create":"update")+'?filter={"id": "'+t+'"}'}var ie,se=re["user@@FETCH"],ae=re["user@@LOGIN"],ue=re["user@@LOGOUT"],ce=re["user@@SAVE_PROFILE_SETTINGS"],le=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pe="info",fe=pe+"@@LOAD",de=Object(j.createActions)({storeKey:pe,initialState:{data:null,error:null,isWaiting:!1},actions:(ie={},ie[fe]={action:function(){return{promise:function(t){return t(F("auth/v1/info")).get({})}}},handlers:{onWait:function(t){return t},onFail:function(t){return le({},t,{isWaiting:!1,error:"something wrong"})},onSuccess:function(t,e){var r=e.result,n=new g(r.data);return L.setIsMasterDomain(n.getState().td_is_master),le({},t,{data:n.getState(),isWaiting:!1,isFailed:!1})}}},ie)}),he=de[fe],ye=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_e=function(t){function e(e,r){var n=t.call(this,Mt,e,r)||this;return n.changeDomain=function(t){n.action(Vt,t.title).then(function(){E.common.reloadPage(!0)})},n.getSelectedDomain=function(){return n.nextProps[pe]&&n.nextProps[pe].data?n.nextProps[pe].data.td:""},n.getDomainsObject=function(){return me(n.nextProps[Kt].data).reduce(function(t,e){return t.push({content:{title:e}}),t},[])},n.action(Xt),n}return ye(e,t),e.storeKey=Kt,e.Model=Mt,e.connectedState=[Kt,pe],e}(h);function me(t){var e=ge(t.filter(function(t){return t.is_master})),r=ge(t.filter(function(t){return!t.is_master}));return e.concat(r)}function ge(t){return t.map(function(t){return t.domain.split(".").reverse()}).sort().map(function(t){return t.reverse().join(".")})}var ve,be,Oe=r(5),we=r(34),Ee=r.n(we),Pe=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Te=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},je=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.onDropdownOpen=function(){n.setState({dropdownOpened:!0})},n.onDropdownClose=function(){n.setState({dropdownOpened:!1})},n.state={dropdownOpened:!1},n}return Pe(e,t),e.prototype.componentWillReceiveProps=function(){},e.prototype.render=function(){var t=this.props,e=t.userInfo,r=t.className,n=this.state.dropdownOpened?Ee.a.panel:"";return Y.createElement("div",{className:et()(Ee.a.selector,r)},Y.createElement("div",null,Y.createElement("span",{className:Ee.a.login},e?e.name:""," "),Y.createElement(Oe.DropDown,{position:Oe.DROPDOWN_POSITION_LEFT,items:this.controller.getDomainsObject(),onItemClick:this.controller.changeDomain,className:Ee.a.dropdown,showDropIcon:!0,panelWidth:Oe.DROPDOWN_PANEL_WIDTH.AUTOSIZE,itemsPanelClassName:n,onOpen:this.onDropdownOpen,onClose:this.onDropdownClose},Y.createElement("span",{className:Ee.a.domain},"@",this.controller.getSelectedDomain()))),Y.createElement("div",{className:Ee.a.avatar},e?e.name.charAt(0):"a"))},e=Te([o.a.withController(_e)],e)}(Y.PureComponent),Se=r(8),xe=r(1),Re=r(32),De=r.n(Re),Ae=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ce=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ae(e,t),e.prototype.render=function(){var t=this.props,e=t.userInfo,r=t.withBreadCrumps,n=void 0===r||r,o=t.className,i=t.logout,s=t.children,a=t.breadcrumbsTitle;return Y.createElement(xe.Header,null,Y.createElement(xe.Row,{type:"flex"},Y.createElement(xe.Col,{span:46,offset:1},Y.createElement("div",{className:et()(De.a.header,o)},Y.createElement("div",{className:De.a["left-side"]},Y.createElement("a",{href:"/"},Y.createElement(xe.Icon,{id:"logo_oktell_r2",className:De.a.logo})),n?Y.createElement("div",{className:De.a.breadcrumbs},Y.createElement(xe.Icon,{id:"breadcrumbs",className:De.a["breadcrumbs-icon"]}),a&&Y.createElement("span",{className:De.a["breadcrumbs-title"]},a)):null),Y.createElement("div",{className:De.a["right-side"]},Y.createElement(je,{userInfo:e,className:De.a.login}),Y.createElement("span",{className:De.a.link,onClick:i},"Выйти"),s?Y.createElement("div",{className:De.a.icons},s):null)))))},e=Ce([Object(Se.connect)(function(t){return t},{logout:ue})],e)}(Y.PureComponent),Ie=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ne=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ie(e,t),e.prototype.updateState=function(t){this.update(t);var e=this.getState().data,r=e.td,n=e.login,o=e.pwd,i=this.getState().validation.errors,s={isValid:!!r&&!!n&&!!o,errors:i};return t.data&&Object.keys(s.errors).length&&(s.errors[Object.keys(t.data)[0]]=""),this.update({validation:s}).getState()},e.prototype.handleLoginErrors=function(t,e){if(this.resetWaiting(),1407===t)this.update({error:e});else if(1401===t){this.update({validation:{isValid:!1,errors:{td:"Проверьте значение",login:"Проверьте значение",pwd:"Проверьте значение"}}})}return this.getState()},e.defaults={data:{login:"",pwd:"",td:""},validation:{isValid:!1,errors:{}},error:null,isWaiting:!1},e}(Z),Le=Object.assign({},Ne.defaults),We=Object(j.createActions)({storeKey:"loginForm",initialState:Le,actions:(ve={},ve["loginForm@@UPDATE"]={action:function(t){return{updates:t}},handler:function(t,e){var r=e.updates;return new Ne(t).updateState(r)}},ve["loginForm@@HANDLE_LOGIN_ERRORS"]={action:function(t,e){return{errorCode:t,errorMessage:e}},handler:function(t,e){var r=e.errorCode,n=e.errorMessage;return new Ne(t).handleLoginErrors(r,n)}},ve)}),Ue=We["loginForm@@UPDATE"],Fe=We["loginForm@@HANDLE_LOGIN_ERRORS"],Me=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){t[t.PROGRESS=0]="PROGRESS",t[t.DONE=1]="DONE"}(be||(be={}));var qe=function(t){function e(e,r){var n=t.call(this,Ne,e,r)||this;return n.onInputChange=function(t){return function(e){var r;n.action(Ue,{data:(r={},r[t]=e,r)})}},n.submit=function(t){return t.preventDefault(),n.loginStatus={prev:null,current:be.PROGRESS},n.action(ae,n.model.getState().data).then(function(){n.loginStatus={prev:be.PROGRESS,current:be.DONE}})},n.isLoginFulfilled=function(){var t=n.currentProps.user.isWaiting,e=n.nextProps.user.isWaiting,r=n.loginStatus.current;return t&&!e&&r===be.PROGRESS},n.isFailed=function(){return null!==n.nextProps.user.error},n.handleErrors=function(){var t=n.nextProps.user.error,e=t.code,r=t.message;n.action(Fe,e,r)},n.isUserLoggedIn=function(){return n.nextProps.user.isAuthorized},n.loginStatus={current:null,prev:null},n}return Me(e,t),e.actions={},e.connectedState=["loginForm","user"],e.storeKey="loginForm",e.Model=Ne,e}(h),Ke=r(30),He=r.n(Ke),ze=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Be=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Ge=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.onSubmit=function(t){n.setState({isWaiting:!0}),n.controller.submit(t).then(function(){n.setState({isWaiting:!1})})},n.state={isWaiting:!1},n}return ze(e,t),e.prototype.componentDidMount=function(){!function(){var t=document.getElementById("login-page");t&&t.classList.add("invisible")}()},e.prototype.componentWillReceiveProps=function(t){var e=this.controller,r=e.isLoginFulfilled,n=e.isFailed,o=e.handleErrors,i=e.isUserLoggedIn;if(r()&&(n()?o():this.setState({redirectAfterLogin:or})),i())return this.setState({redirectAfterLogin:or})},e.prototype.render=function(){var t=this.props.loginForm,e=t.data,r=e.td,n=e.login,o=e.pwd,i=t.validation,s=i.isValid,a=i.errors,u=this.state,c=u.isWaiting,l=u.redirectAfterLogin,p=c||!s;return Y.createElement(sr,{needLogin:!1},Y.createElement(Ze,{redirectTo:l},Y.createElement(ct,{className:He.a.background},Y.createElement("div",{className:He.a.form},Y.createElement(xe.Layout,null,Y.createElement(xe.Header,{className:He.a.header},Y.createElement(xe.Icon,{className:He.a.logo,id:"logo_oktell_r2"}),Y.createElement("div",{className:He.a.title},"Войдите",Y.createElement("br",null),"в свой аккаунт")),Y.createElement(xe.Content,{className:He.a.content},Y.createElement("form",{onSubmit:this.onSubmit,autoComplete:"on"},Y.createElement(xe.Row,null,Y.createElement(xe.Label,{text:"Доменное имя",className:He.a["form-label"]},Y.createElement(Oe.TextInput,{errorText:a.td,placeholder:"Введите доменное имя",fullWidth:!0,name:"domain",value:r,onChange:this.controller.onInputChange("td"),className:He.a["form-item"]}))),Y.createElement(xe.Row,null,Y.createElement(xe.Label,{text:"Имя пользователя",className:He.a["form-label"]},Y.createElement(Oe.TextInput,{errorText:a.login,placeholder:"Введите имя пользователя",fullWidth:!0,name:"username",value:n,onChange:this.controller.onInputChange("login"),className:He.a["form-input"]}))),Y.createElement(xe.Row,null,Y.createElement(xe.Label,{text:"Пароль",className:He.a["form-label"]},Y.createElement(Oe.TextInput,{errorText:a.pwd,placeholder:"Введите пароль",isPassword:!0,fullWidth:!0,name:"password",value:o,onChange:this.controller.onInputChange("pwd"),className:He.a["form-input"]}))),Y.createElement(xe.Row,null,Y.createElement(Oe.Button,{onClick:this.onSubmit,isWaiting:c,disabled:p,className:He.a["form-btn"]},"Войти")))),Y.createElement(xe.Footer,{className:He.a.footer},Y.createElement("a",{href:"#"},"Восстановить пароль")))))))},e=Be([o.a.withController(qe)],e)}(Y.Component);var Xe,Ve,$e,Je=r(12),Qe=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ze=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Qe(e,t),e.prototype.render=function(){var t=this.props,e=t.children,r=t.redirectTo,n=t.className;return r?Y.createElement(Je.Redirect,{to:r}):Y.createElement("div",{className:n},e)},e}(Y.PureComponent),Ye=r(11),tr=r(28),er=r.n(tr),rr=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r