]*>([\s\S]*)<\/div>/gmi,e),a="\n"+c.trim(a)+"\n");return a}return""},a=c.isUnd(a)?!0:!!a,b=this.toHtmlString().replace(/[\s]+/gm," ").replace(/
/gmi,"\n").replace(/<\/h\d>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,
+"\n").replace(/<\/tr>/gi,"\n").replace(/
]*>/gmi,"\n_______________________________\n\n").replace(/
]*>/gmi,"").replace(/]*>([\s\S]*)<\/div>/gmi,e).replace(/
]*>/gmi,"\n__bq__start__\n").replace(/<\/blockquote>/gmi,"\n__bq__end__\n").replace(/]*>([\s\S]*?)<\/a>/gmi,function(){return arguments&&1]*>/gm,"").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&").replace(/&\w{2,6};/gi,
+"");return(a?c.splitPlainText(b):b).replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/__bq__start__([\s\S]*)__bq__end__/gm,d).replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")};q.prototype.getHtmlFromText=function(){return c.convertPlainTextToHtml(this.textarea.val())};q.prototype.switchToggle=function(){this.isHtml()?this.switchToPlain():this.switchToHtml()};q.prototype.switchToPlain=function(a){var a=c.isUnd(a)?!0:a,b=this.getTextFromHtml(),d=i.bind(function(a){a&&(this.toolbar.addClass("editorHideToolbar"),
+j(".editorSwitcher",this.toolbar).text(this.switcherLinkText(!1)),this.textarea.val(b),this.textarea.show(),this.htmlarea.hide(),this.fOnSwitch&&this.fOnSwitch(!1))},this);!a||0===c.trim(b).length?d(!0):d(h.confirm(this.oOptions.LangSwitcherConferm))};q.prototype.switcherLinkText=function(a){return a?this.oOptions.LangSwitcherTextLabel:this.oOptions.LangSwitcherHtmlLabel};q.prototype.switchToHtml=function(){this.toolbar.removeClass("editorHideToolbar");j(".editorSwitcher",this.toolbar).text(this.switcherLinkText(!0));
+this.textarea.val(this.getHtmlFromText());this.updateHtmlArea();this.textarea.hide();this.htmlarea.show();this.fOnSwitch&&this.fOnSwitch(!0)};q.prototype.addButton=function(a,b){var d=this;j("").addClass("editorToolbarButtom").append(j('').addClass(a)).attr("title",b).click(function(b){c.isUnd(q.htmlFunctions[a])?h.alert(a):q.htmlFunctions[a].apply(d,[j(this),b])}).appendTo(this.toolbar)};q.htmlInitToolbar=function(){if(!this.bOnlyPlain){this.addButton("bold",
"Bold");this.addButton("italic","Italic");this.addButton("underline","Underline");this.addButton("strikethrough","Strikethrough");this.addButton("removeformat","removeformat");this.addButton("justifyleft","justifyleft");this.addButton("justifycenter","justifycenter");this.addButton("justifyright","justifyright");this.addButton("horizontalrule","horizontalrule");this.addButton("orderedlist","orderedlist");this.addButton("unorderedlist","unorderedlist");this.addButton("indent","indent");this.addButton("outdent",
-"outdent");this.addButton("forecolor","forecolor");var a=this;j("").addClass("editorSwitcher").text(a.switcherLinkText(!0)).click(function(){a.switchToggle()}).appendTo(a.toolbar)}};n.htmlInitEditor=function(){this.editor=this.htmlarea[0];this.editor.innerHTML=this.textarea.val()};n.htmlAttachEditorEvents=function(){};for(var jb=n,oa=[],$a=[],W=0,Ga=0,Ha=0,Ia=0,Ja="",W=0;256>W;W+=85)Ja=W.toString(16),oa.push(1===Ja.length?"0"+Ja:Ja);Ia=oa.length;for(W=0;W
'),cb=pa.find(".editorFpFonts"),db=function(){};j.each("Arial;Arial Black;Courier New;Tahoma;Times New Roman;Verdana".split(";"),function(a,b){cb.append(j(''+b+"").click(function(){db(b)}));
-cb.append("
")});pa.hide();kb.htmlFontPicker=function(a,b,d){bb||(pa.appendTo(d),bb=!0);db=b;ab.unbind("click.fpNamespace");h.setTimeout(function(){ab.one("click.fpNamespace",function(){pa.hide()})},500);b=j(a).position();pa.css("top",5+b.top+j(a).height()+"px").css("left",b.left+"px").show()};var lb=n,eb=j(h.document),fb=!1,qa=j(''),gb=qa.find(".editorCpColors"),hb=function(){};j.each(n.htmlColorPickerColors,
-function(a,b){gb.append('')});qa.hide();j(".editorCpColor",gb).click(function(a){var b=1,d="#000000",a=j(a.target).css("background-color"),d=a.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(null!==d){for(delete d[0];3>=b;++b)d[b]=c.pInt(d[b]).toString(16),1===d[b].length&&(d[b]="0"+d[b]);d="#"+d.join("")}else d=a;hb(d)});lb.htmlColorPicker=function(a,b,d){fb||(qa.appendTo(d),fb=!0);d=j(a).position();
-hb=b;eb.unbind("click.cpNamespace");h.setTimeout(function(){eb.one("click.cpNamespace",function(){qa.hide()})},100);qa.css("top",5+d.top+j(a).height()+"px").css("left",d.left+"px").show()};n.htmlFunctions={bold:function(){this.ec("bold")},italic:function(){this.ec("italic")},underline:function(){this.ec("underline")},strikethrough:function(){this.ec("strikethrough")},indent:function(){this.ec("indent")},outdent:function(){this.ec("outdent")},justifyleft:function(){this.ec("justifyLeft")},justifycenter:function(){this.ec("justifyCenter")},
-justifyright:function(){this.ec("justifyRight")},horizontalrule:function(){this.ec("insertHorizontalRule",!1,"ht")},removeformat:function(){this.ec("removeFormat")},orderedlist:function(){this.ec("insertorderedlist")},unorderedlist:function(){this.ec("insertunorderedlist")},forecolor:function(a){n.htmlColorPicker(a,i.bind(function(a){this.setcolor("forecolor",a)},this),this.toolbar)},backcolor:function(a){n.htmlColorPicker(a,i.bind(function(a){this.setcolor("backcolor",a)},this),this.toolbar)},fontname:function(a){n.htmlFontPicker(a,
-i.bind(function(a){this.ec("fontname",!1,a)},this),this.toolbar)}};K.prototype.selectItemCallbacks=function(a){(this.oCallbacks.onItemSelect||this.emptyFunction)(a)};K.prototype.init=function(a,b){this.oContentVisible=a;this.oContentScrollable=b;if(this.oContentVisible&&this.oContentScrollable){var d=this;j(this.oContentVisible).on("click",this.sItemSelector,function(a){d.actionClick(f.dataFor(this),a)}).on("click",this.sItemCheckedSelector,function(a){var b=f.dataFor(this);b&&(a&&a.shiftKey?d.actionClick(b,
-a):(d.sLastUid=d.getItemUid(b),b.selected()?(b.checked(!1),d.selectedItem(null)):b.checked(!b.checked())))});j(h.document).on("keydown",function(a){var b=!0;if(a&&d.bUseKeyboard&&!c.inFocus())if(-1c?0:c;w=k[c];break}}else if(g.EventKeyCode.Down===a||g.EventKeyCode.Insert===a||g.EventKeyCode.Home===a||g.EventKeyCode.PageUp===a)w=k[0];else if(g.EventKeyCode.Up===a||g.EventKeyCode.End===a||g.EventKeyCode.PageDown===a)w=k[k.length-1];w?(o&&(b?(g.EventKeyCode.Up===a||g.EventKeyCode.Down===a)&&o.checked(!o.checked()):g.EventKeyCode.Insert===a&&o.checked(!o.checked())),this.throttleSelection=!0,this.selectedItem(w),
-this.throttleSelection=!0,0!==this.iSelectTimer?(h.clearTimeout(this.iSelectTimer),this.iSelectTimer=h.setTimeout(function(){d.iSelectTimer=0;d.actionClick(w)},1E3)):(this.iSelectTimer=h.setTimeout(function(){d.iSelectTimer=0},200),this.actionClick(w)),this.scrollToSelected()):o&&(b&&(g.EventKeyCode.Up===a||g.EventKeyCode.Down===a)?o.checked(!o.checked()):g.EventKeyCode.Insert===a&&o.checked(!o.checked()))};K.prototype.scrollToSelected=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;
-var a=j(this.sItemSelectedSelector,this.oContentScrollable),b=a.position(),d=this.oContentVisible.height(),a=a.outerHeight();return b&&(0>b.top||b.top+a>d)?(0>b.top?this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+b.top-20):this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+b.top-d+a+20),!0):!1};K.prototype.eventClickFunction=function(a,b){var d=this.getItemUid(a),c=0,e=0,f=null,g="",k=!1,i=!1,h=[],j=!1;if(b&&b.shiftKey&&""!==d&&""!==this.sLastUid&&d!==this.sLastUid){h=
-this.list();j=a.checked();c=0;for(e=h.length;c").addClass("rl-view-model").addClass("RL-"+d.viewModelTemplate()).hide().attr("data-bind",'template: {name: "'+d.viewModelTemplate()+'"}, i18nInit: true'),s.appendTo(g),d.viewModelDom=s,a.__dom=s,"Popups"===l&&(d.cancelCommand=d.closeCommand=c.createCommand(d,
-function(){r.hideScreenPopup(a)})),x.runHook("view-model-pre-build",[a.__name,d,s]),f.applyBindings(d,s[0]),this.delegateRun(d,"onBuild",[s]),x.runHook("view-model-post-build",[a.__name,d,s])):c.log("Cannot find view model position: "+l)}return a?a.__vm:null};E.prototype.applyExternal=function(a,b){a&&b&&f.applyBindings(a,b)};E.prototype.hideScreenPopup=function(a){a&&(a.__vm&&a.__dom)&&(a.__dom.hide(),a.__vm.modalVisibility(!1),this.delegateRun(a.__vm,"onHide"),this.popupVisibility(!1),i.defer(function(){a.__dom.find(".ko-select2").select2("close")}))};
-E.prototype.showScreenPopup=function(a,b){a&&(this.buildViewModel(a),a.__vm&&a.__dom&&(a.__dom.show(),a.__vm.modalVisibility(!0),this.delegateRun(a.__vm,"onShow",b||[]),this.popupVisibility(!0),x.runHook("view-model-on-show",[a.__name,a.__vm,b||[]])))};E.prototype.screenOnRoute=function(a,b){var d=this,e=null,f=null;""===c.pString(a)&&(a=this.sDefaultScreenName);if(""!==a){e=this.screen(a);if(!e&&(e=this.screen(this.sDefaultScreenName)))b=a+"/"+b,a=this.sDefaultScreenName;e&&e.__started&&(e.__builded||
-(e.__builded=!0,c.isNonEmptyArray(e.viewModels())&&i.each(e.viewModels(),function(a){this.buildViewModel(a,e)},this),this.delegateRun(e,"onBuild")),i.defer(function(){if(d.oCurrentScreen){d.delegateRun(d.oCurrentScreen,"onHide");c.isNonEmptyArray(d.oCurrentScreen.viewModels())&&i.each(d.oCurrentScreen.viewModels(),function(a){if(a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()){a.__dom.hide();a.__vm.viewModelVisibility(false);d.delegateRun(a.__vm,"onHide")}})}d.oCurrentScreen=e;if(d.oCurrentScreen){d.delegateRun(d.oCurrentScreen,
-"onShow");x.runHook("screen-on-show",[d.oCurrentScreen.screenName(),d.oCurrentScreen]);c.isNonEmptyArray(d.oCurrentScreen.viewModels())&&i.each(d.oCurrentScreen.viewModels(),function(a){if(a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()){a.__dom.show();a.__vm.viewModelVisibility(true);d.delegateRun(a.__vm,"onShow");x.runHook("view-model-on-show",[a.__name,a.__vm])}},d)}(f=e.__cross())&&f.parse(b)}))}};E.prototype.startScreens=function(a){i.each(a,function(a){var d=(a=new a)?a.screenName():
-"";a&&""!==d&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=d),this.oScreens[d]=a)},this);i.each(this.oScreens,function(a){a&&(!a.__started&&a.__start)&&(a.__started=!0,a.__start(),x.runHook("screen-pre-start",[a.screenName(),a]),this.delegateRun(a,"onStart"),x.runHook("screen-post-start",[a.screenName(),a]))},this);a=Ta.create();a.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this));Q.initialized.add(a.parse,a);Q.changed.add(a.parse,a);Q.init()};E.prototype.setHash=function(a,
-b){a="#"===a.substr(0,1)?a.substr(1):a;a="/"===a.substr(0,1)?a.substr(1):a;(c.isUnd(b)?0:b)?(Q.changed.active=!1,Q.setHash(a),Q.changed.active=!0):(Q.changed.active=!0,Q.setHash(a))};E.prototype.bootstart=function(){this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart();return this};r=new E;F.newInstanceFromJson=function(a){var b=new F;return b.initByJson(a)?b:null};F.prototype.name="";F.prototype.email="";F.prototype.privateType=null;F.prototype.validate=function(){return""!==this.name||""!==this.email};
-F.prototype.hash=function(a){return"#"+(a?"":this.name)+"#"+this.email+"#"};F.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")};F.prototype.type=function(){if(null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=g.EmailType.Facebook),null===this.privateType))this.privateType=g.EmailType.Default;return this.privateType};F.prototype.search=function(a){return-1<(this.name+" "+this.email).toLowerCase().indexOf(a.toLowerCase())};
-F.prototype.parse=function(a){var a=c.trim(a),b=/(?:"([^"]+)")? ?(.*?@[^>,]+)>?,? ?/g.exec(a);b?(this.name=b[1]||"",this.email=b[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(a)&&(this.name="",this.email=a)};F.prototype.initByJson=function(a){var b=!1;a&&"Object/Email"===a["@Object"]&&(this.name=c.trim(a.Name),this.email=c.trim(a.Email),b=""!==this.email,this.clearDuplicateName());return b};F.prototype.toLine=function(a,b){var d="";""!==this.email&&(b=c.isUnd(b)?!1:!!b,a&&""!==this.name?
-d=b?'")+'" target="_blank" tabindex="-1">'+c.encodeHtml(this.name)+"":this.name:(d=this.email,""!==this.name?d=b?c.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+c.encodeHtml(d)+""+c.encodeHtml(">"):'"'+this.name+'" <'+d+">":b&&(d=''+c.encodeHtml(this.email)+"")));
-return d};F.prototype.select2Result=function(){var a="",b=e.cache().getUserPic(this.email),a=""!==b?a+('
'):a+('
');g.EmailType.Facebook===this.type()?(a+=""+(0'):a+=""+(0('+this.name+")":
-this.email);return a+""};F.prototype.select2Selection=function(a){var b="";if(g.EmailType.Facebook===this.type()){if(b=0").text(b).appendTo(a),a.append(''),null}else b=0+$/,""),b=!0);return b};D.prototype.isImage=function(){return"image/"===this.mimeType.substr(0,6)};D.prototype.isText=function(){return"text/"===this.mimeType.substr(0,5)};D.prototype.linkDownload=function(){return e.link().attachmentDownload(this.download)};
-D.prototype.linkPreview=function(){return e.link().attachmentPreview(this.download)};D.prototype.linkPreviewAsPlain=function(){return e.link().attachmentPreviewAsPlain(this.download)};D.prototype.generateTransferDownloadUrl=function(){var a=this.linkDownload();"http"!==a.substr(0,4)&&(a=h.location.protocol+"//"+h.location.host+h.location.pathname+a);return this.mimeType+":"+this.fileName+":"+a};D.prototype.eventDragStart=function(a,b){var d=b.originalEvent||b;a&&(d&&d.dataTransfer&&d.dataTransfer.setData)&&
-d.dataTransfer.setData("DownloadURL",this.generateTransferDownloadUrl());return!0};D.prototype.iconClass=function(){var a=this.mimeType.toLocaleString().split("/"),b="icon-file";a&&a[1]&&("image"===a[0]?b="icon-image":"text"===a[0]?b="icon-file-xml":"audio"===a[0]?b="icon-music":"video"===a[0]?b="icon-film":-1").addClass("editorSwitcher").text(a.switcherLinkText(!0)).click(function(){a.switchToggle()}).appendTo(a.toolbar)}};q.htmlInitEditor=function(){this.editor=this.htmlarea[0];this.editor.innerHTML=this.textarea.val()};q.htmlAttachEditorEvents=function(){var a=this,b=function(b){if(b=(b&&b.originalEvent?b.originalEvent:b)||h.event){b.stopPropagation();b.preventDefault();var d=null,c=null;if((b=b.files||(b.dataTransfer?b.dataTransfer.files:
+null))&&1===b.length&&b[0]&&b[0].type&&0===b[0].type.indexOf("image/")){var c=b[0],d=new h.FileReader,e=c;d.onload=function(b){a.insertImage(b.target.result,e.name)};d.readAsDataURL(c)}}a.htmlarea.removeClass("editorDragOver")},d=function(){a.htmlarea.removeClass("editorDragOver")},c=function(b){b.stopPropagation();b.preventDefault();a.htmlarea.addClass("editorDragOver")},e=function(b){(b=b&&b.clipboardData?b.clipboardData:b&&b.originalEvent&&b.originalEvent.clipboardData?b.originalEvent.clipboardData:
+null)&&b.items&&i.each(b.items,function(b){if(b&&(b.type&&0===b.type.indexOf("image/"))&&b.getAsFile){var d=null,c=b.getAsFile();c&&(d=new h.FileReader,d.onload=function(b){a.insertImage(b.target.result,c.name)},d.readAsDataURL(c))}})};!this.bOnlyPlain&&(h.File&&h.FileReader&&h.FileList)&&(this.htmlarea.bind("dragover",c),this.htmlarea.bind("dragleave",d),this.htmlarea.bind("drop",b),this.htmlarea.bind("paste",e))};for(var jb=q,oa=[],$a=[],V=0,Ga=0,Ha=0,Ia=0,Ja="",V=0;256>V;V+=85)Ja=V.toString(16),
+oa.push(1===Ja.length?"0"+Ja:Ja);Ia=oa.length;for(V=0;V