dojo.hostenv.findModule("xg.index.actionicons",!1)||(dojo.provide("xg.index.actionicons"),dojo.provide("xg.index.actionicons.PromotionLink"),dojo.widget.defineWidget("xg.index.actionicons.PromotionLink",dojo.widget.HtmlWidget,{_action:"\x3crequired\x3e",_id:"\x3crequired\x3e",_dialogClass:"dialog",_type:"item",_afterAction:"",_url:"",_xgSourceParam:void 0,fillInTemplate:function(d,b){this.link=this.getFragNodeRef(b);this.link.promotionlink||(this.link.promotionlink=!0,dojo.event.connect(this.link,
"onclick",dojo.lang.hitch(this,function(c){dojo.event.browser.stopEvent(c);this.link.className="desc working disabled";this.url=""==this._url?xg.global.requestBase+"/main/promotion/"+this._action+"?src\x3dlink\x26xn_out\x3djson":this._url+"/"+this._action+"/?xn_out\x3djson";"undefined"!=typeof this._xgSourceParam&&(this.url=this.url+"\x26xg_source\x3d"+this._xgSourceParam);dojo.io.bind({url:this.url,method:"post",mimetype:"text/json",content:{id:this._id,type:this._type},preventCache:!0,encoding:"utf-8",
load:dojo.lang.hitch(this,function(e,a,f){dojo.lfx.html.highlight(this.link,"#ffee7d",1E3,null,dojo.lang.hitch(this,function(){this.link.style.backgroundImage=this.link.style.backgroundColor=""})).play();this._action="promote"==this._action?"remove":"promote";a.linkText&&a.linkClass&&(dojo.html.setClass(this.link,"xg_sprite "+a.linkClass),this.link.title=a.linkText,this.link.innerHTML=a.linkText);this._afterAction.length&&eval(this._afterAction)})})})))}}));dojo.hostenv.findModule("xg.index.util.ScrollIntoView",!1)||(dojo.provide("xg.index.util.ScrollIntoView"),xg.index.util.ScrollIntoView={scrollIntoView:function(a){a=x$(a);var b=a.css("padding-top"),c=a.css("padding-bottom");b=b&&-1<b.indexOf("px")?parseInt(b,10):0;var d=c&&-1<c.indexOf("px")?parseInt(c,10):0;c=a.offset().top+b;a=a.offset().top+a.height()+d;b=x$(window).scrollTop();d=x$(window).scrollTop()+x$(window).height();var e;c<b?e=c:a>d&&(e=Math.min(c,b+(a-d)));e&&x$("html,body").animate({scrollTop:e},
100)}});dojo.hostenv.findModule("xg.shared.RecaptchaV2Popup",!1)||(dojo.provide("xg.shared.RecaptchaV2Popup"),xg.shared.RecaptchaV2Popup=function(d){d={};var a={open:!1,initialize:function(){}};d.showIfNeeded=function(b,c){a.open&&(a.hide(),a.onCancel());a.onSuccess=b;a.onCancel=c||function(){};xg.captcha.shouldShow?(b=xg.shared.util.alert({customDisplayClass:"xg_recaptcha_popup",bodyHtmlRaw:'\x3cdiv class\x3d"rp-recaptcha"\x3e\x3c/div\x3e\x3cp\x3e\x3ca href\x3d"#" class\x3d"rp-cancel"\x3e'+xg.shared.nls.html("cancel")+
"\x3c/a\x3e\x3c/p\x3e",noButtons:!0}),x$(b).find(".rp-cancel").click(function(e){e.preventDefault();a.hide();a.onCancel()}),a.renderRecaptcha(x$(b).find(".rp-recaptcha")),a.open=!0):(a.hide(),a.onSuccess(""))};a.renderRecaptcha=function(b){a.onRecaptchaReady(function(){var c=grecaptcha.render(b[0],{sitekey:xg.captcha.siteKey,callback:function(){var e=grecaptcha.getResponse(c);a.hide();a.onSuccess(e)}})})};a.onRecaptchaReady=function(b){if(window.grecaptcha)b();else var c=setInterval(function(){window.grecaptcha&&
(clearInterval(c),b())},1E3)};a.hide=function(){a.open&&(dojo.dom.removeNode(dojo.byId("xg_lightbox_alert")),xg.shared.util.hideOverlay(),a.open=!1)};xg.addOnRequire(a.initialize);return d}());dojo.hostenv.findModule("xg.shared.editors.PlainEditor",!1)||(dojo.provide("xg.shared.editors.PlainEditor"),xg.shared.editors.PlainEditor=function(a){var b={setMaxLength:function(c){xg.shared.util.setAdvisableMaxLength(a[0],c)},updateBackgroundColor:function(){},val:function(){if(arguments.length)a.val(arguments[0]);else return a.val()},valWithLineBreakAdjustments:function(){return b.val()},adjustLineBreaks:function(){},unadjustLineBreaks:function(){},initializeAfterPageLoad:function(){return b},
uninitialize:function(){return b},focus:function(){a[0].focus()},moveCursorToStart:function(){xg.shared.editors.Editor.moveCursorToStart(a[0])},updateTextarea:function(){},setEnabled:function(c){c?a.removeClass("disabled").prop("disabled",!1):a.addClass("disabled").prop("disabled",!0)},getTextarea:function(){return a}};return b});dojo.hostenv.findModule("xg.shared.editors.tinymce.WordpressLineBreakRules",!1)||(dojo.provide("xg.shared.editors.tinymce.WordpressLineBreakRules"),xg.shared.editors.tinymce.WordpressLineBreakRules=function(e){return{adjustLineBreaksEnteredInHtmlMode:function(a){if(a.match(/<script\b|<p\b|<br\b/i))return a;var b=[];for(a=a.replace(/<form\b[\s\S]*?<\/form>/gi,function(c){b.push(c);return"\x3cform\x3e"+(b.length-1)+"\x3c/form\x3e"});;){var d=a.replace(RegExp("(\x3c[^\\s](?:[^\x3e\\n\"']|'([^'\\n]|\\\\')*'|\"([^\"\\n]|\\\\\")*\")*)\\n+",
"g"),"$1 ");if(a==d)break;a=d}a=a.replace(/<p>\s*<\/p>/g,"\x3cp\x3e\x26nbsp;\x3c/p\x3e");a=a.replace(/<div>\s*<\/div>/g,"\x3cdiv\x3e\x26nbsp;\x3c/div\x3e");a=a.replace(/\r\n/g,"\n");a=a.replace(RegExp("\x3cBR\\s*/?\x3e\\n","gi"),"\x3cbr /\x3e");a=a.replace(RegExp("\x3c/?P\\s*\x3e\\n?","gi"),"\n\n");a=a.replace(/(^[\n\s]*)|([\n\s]*$)/g,"");a=a.replace(RegExp("[\\n\\s]*(\x3c/?(?:OBJECT|EMBED|PARAM|APPLET|IFRAME|SCRIPT|BR|ADDRESS|BLOCKQUOTE|CENTER|DIR|DIV|DL|FIELDSET|FORM|H1|H2|H3|H4|H5|H6|HR|ISINDEX|MENU|NOFRAMES|NOSCRIPT|OL|P|PRE|TABLE|UL|DD|DT|FRAMESET|LI|TBODY|TD|TFOOT|TH|THEAD|TR)\\b)",
"gi"),"$1");a=a.replace(/\n\s*(\n\s*)+/g,"\x3cp\x3e");a=a.replace(/\n/g,"\x3cbr /\x3e");a=a.replace(RegExp("^\\s*(?!\x3c/?(OBJECT|EMBED|PARAM|APPLET|IFRAME|SCRIPT|BR|ADDRESS|BLOCKQUOTE|CENTER|DIR|DIV|DL|FIELDSET|FORM|H1|H2|H3|H4|H5|H6|HR|ISINDEX|MENU|NOFRAMES|NOSCRIPT|OL|P|PRE|TABLE|UL|DD|DT|FRAMESET|LI|TBODY|TD|TFOOT|TH|THEAD|TR)\\b)","i"),"\x3cp\x3e");x$.each(b,function(c,f){a=a.replace("\x3cform\x3e"+c+"\x3c/form\x3e",b[c])});return a},adjustLineBreaksEnteredInVisualMode:function(a){return a=a.replace(RegExp("\x3cBR\\s*/?\x3e(?!\\n)",
"gi"),"\x3cbr /\x3e\n")}}}(x$));dojo.hostenv.findModule("xg.shared.editors.tinymce.Utilities",!1)||(dojo.provide("xg.shared.editors.tinymce.Utilities"),xg.shared.editors.tinymce.Utilities=function(p){var c={},k={},g,e,m=[["mce_code"],["mce_link"],["mce_image"],["mce_file"],["mce_bold"],["mce_italic"],["mce_underline"],["mce_bullist"],["mce_numlist"],["mce_media"],["mce_removeformat"],["mce_justifyleft","mce_justifycenter","mce_justifyright"],["mce_strikethrough"],["mce_pastetext"],["mce_blockquote"],["mce_tinyautosave"]],n=0;k.initialize=
function(){};c.addIdIfNecessary=function(a){a.attr("id")||a.attr("id","xj_mce_"+n++)};c.getEditor=function(a){return window.tinymce?tinymce.get("mce_fullscreen")||tinymce.get(a.attr("id")):null};c.updateLiquidLayout=function(a){var b=c.getEditor(a)?x$(".mceToolbar:first",c.getEditor(a).getContainer()):a.data("xj_html_toolbar").getElement().find("table:first"),d=b.find(".mceToolbarRow1:first").find("td");if(a.parent().hasClass("ultracompact-editor"))if(d.addClass("dy-displaynone"),a.parent().removeClass("uninitialized-liquid-layout"),
a.data("xj_html_toolbar").updateWidth(),a.data("xj_html_dragbar").updateWidth(),a=b.width())for(b=0;b<m.length;b++){var f=m[b];if(7*d.filter(":visible").find(".mceSeparator").length+9+27*d.filter(":visible").find(".mceButton").length+27*f.length>a)break;for(var h=0;h<f.length;h++)d.find("."+f[h]).parent().removeClass("dy-displaynone");var l=!0;d.each(function(){x$(this).find(".mceSeparator").length?(l?x$(this).addClass("dy-displaynone"):x$(this).removeClass("dy-displaynone"),l=!0):x$(this).find(".mceButton").length&&
x$(this).is(":visible")&&(l=!1)})}else d.find(".mce_code, .mce_link, .mce_image, .mce_bold, .mce_italic").parent().removeClass("dy-displaynone"),d.find(".mce_bold, .mce_code").parent().prev().removeClass("dy-displaynone");else d.removeClass("dy-displaynone"),a.parent().removeClass("uninitialized-liquid-layout"),a.data("xj_html_toolbar").updateWidth(),a.data("xj_html_dragbar").updateWidth()};c.updateBackgroundColor=function(a,b){b.getDoc()&&(b=x$(b.getDoc().body),(a=0<xg.shared.util.closest(a,".error").length)&&
!b.hasClass("error")?b.addClass("error").css("background-color","#FFF4F2"):!a&&b.hasClass("error")&&b.removeClass("error").css("background-color","#FFFFFF"))};c.saveSelection=function(a){e=g=void 0;var b=c.getEditor(a);return b?(contentWindow=b.getWin(),contentWindow.focus(),contentWindow.document.selection&&(g=contentWindow.document.selection.createRange()),b.selection.getContent({format:"text"})):document.selection?(a.focus(),g=document.selection.createRange(),g.text):a[0].selectionStart||"0"==
a[0].selectionStart?(e={start:a[0].selectionStart,end:a[0].selectionEnd},a[0].value.substring(e.start,e.end)):""};c.overwriteSelection=function(a,b,d){c.restoreSelection(a);var f=c.getEditor(a);if(f)d&&f.selection.collapse(!1),tinyMCE.execCommand("mceInsertContent",!1,b);else if(g)g.text=b,d&&g.collapse();else if(e){f=a[0];e.end>a.val().length&&(e.end=a.val().length);var h=f.scrollTop;a.val(a.val().slice(0,e.start)+b+a.val().slice(e.end));f.scrollTop=h;f.selectionStart=e.start;f.selectionEnd=e.end=
e.start+b.length;d&&(f.selectionStart=e.start=e.end)}else a[0].value+=b};c.restoreSelection=function(a){var b=c.getEditor(a);b?(contentWindow=b.getWin(),g&&g.select(),contentWindow.focus()):a.focus()};c.getDefaultTargetForUrl=function(a){if(0===a.indexOf(ning.CurrentApp.url))return"_self";for(var b=0;b<ning.CurrentApp.domains.length;b++)if(0===a.indexOf("http://"+ning.CurrentApp.domains[b]))return"_self";return-1!=a.indexOf("api.ning.com")?"_self":"_blank"};c.isMaxFileUploadCountReached=function(a){var b=
parseInt(a.attr("_maxFileLimit"),10);return b?k.countUploadedFiles(a)>=b:!1};k.countUploadedFiles=function(a){a=(c.getEditor(a)?c.getEditor(a).getContent():a.val()).match(/https?:\/\/api\.(xn.\.ningops\.net|ning\.com)(:[0-9]+)?\/[^"'\s?]+/gi)||[];var b={},d=0;x$.each(a,function(f,h){b[h]||(b[h]=h,d++)});return d};c.adjustLineBreaksEnteredInHtmlMode=function(a){return!a.parents(".texteditor:first").find(".html_editor_toolbar table").is(":visible")||a.val().match(/<script/i)?a.val():xg.shared.editors.tinymce.WordpressLineBreakRules.adjustLineBreaksEnteredInHtmlMode(a.val())};
c.adjustLineBreaksEnteredInVisualMode=function(a){return xg.shared.editors.tinymce.WordpressLineBreakRules.adjustLineBreaksEnteredInVisualMode(a.val())};c.removeCdataTags=function(a){return a.replace(/\/\/ ?<!\[CDATA\[\n?/g,"").replace(/\/\/ ?\]\]>\n?/g,"")};xg.addOnRequire(function(){k.initialize()});return c}(x$));dojo.hostenv.findModule("xg.shared.editors.tinymce.LinkDialog",!1)||(dojo.provide("xg.shared.editors.tinymce.LinkDialog"),xg.shared.editors.tinymce.LinkDialog=function(f,d){var k={},g={},e=xg.shared.editors.tinymce.Utilities.getEditor(f),l={heading:xg.index.nls.text("addLink"),targetSectionVisible:!1,getTarget:function(b,a){return xg.shared.editors.tinymce.Utilities.getDefaultTargetForUrl(b)},initializeForm:function(b){var a=xg.shared.editors.tinymce.Utilities.saveSelection(f);b.find("input[name\x3dtext]").val(a);
b.find("input[name\x3durl]").val("http://")},onOk:function(b){xg.shared.editors.tinymce.Utilities.overwriteSelection(f,b)}},m={heading:xg.index.nls.text("editLink"),targetSectionVisible:!0,getTarget:function(b,a){return a.find("input[name\x3dtarget]:checked").val()},initializeForm:function(b){xg.shared.editors.tinymce.Utilities.saveSelection(f);b.find("input[name\x3dtext]").val(d.text());b.find("input[name\x3durl]").val(d.attr("href"));d.attr("target")&&"_blank"===d.attr("target").toLowerCase()?b.find("input[value\x3d_blank]").prop("checked",
!0):b.find("input[value\x3d_self]").prop("checked",!0)},onOk:function(b){var a=e?e.getDoc():null;e.dom.replace(x$(b,a)[0],d[0]);e.undoManager.add()}},h;g.initialize=function(){d||=g.findLink();h=d?m:l};g.findLink=function(){if(!e||!e.selection.getNode())return null;$node=x$(e.selection.getNode());return"A"===$node[0].nodeName?$node:null};k.show=function(){var b=g.createDialog({onOk:function(a){var c=x$("form",a)[0];if((a=x$.trim(c.url.value))&&"http://"!==a){var n=x$.trim(c.text.value)||a;0>a.indexOf(":")&&
(a="http://"+a);c=h.getTarget(a,x$(c));h.onOk('\x3ca href\x3d"'+a+'" target\x3d"'+c+'"\x3e'+xg.qh(n)+"\x3c/a\x3e")}else xg.shared.editors.tinymce.Utilities.restoreSelection(f)},onCancel:function(a){xg.shared.editors.tinymce.Utilities.restoreSelection(f)}});xg.shared.util.showOverlay();x$(b).show();$form=x$("form",b);h.initializeForm($form);$form.find("input[name\x3durl]")[0].select();$form.find("input[name\x3durl]").focus()};g.createDialog=function(b){var a=x$('             \x3cdiv class\x3d"xg_theme xg_floating_module" style\x3d"display:none; z-index: 300000"\x3e     \x3cdiv class\x3d"xg_floating_container xg_tinymce_dialog xg_floating_container_wide xg_module xg_lightborder"\x3e         \x3cdiv class\x3d"xg_module_head"\x3e             \x3ch2\x3e'+
xg.qh(h.heading)+'\x3c/h2\x3e             \x3ca class\x3d"xg_icon xg_icon-close cancel5" href\x3d"#" \x3e'+xg.index.nls.html("close")+'\x3c/a\x3e         \x3c/div\x3e         \x3cdiv class\x3d"xg_module_body"\x3e             \x3cform\x3e                 \x3cfieldset class\x3d"dy-form-2"\x3e                     \x3cdl\x3e                         \x3cdt\x3e\x3clabel for\x3d"xj_link_text" class\x3d"dy-label"\x3e'+xg.index.nls.html("linkText")+'\x3c/label\x3e\x3c/dt\x3e                         \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"text" id\x3d"xj_link_text" class\x3d"dy-input-text dy-input-medium"/\x3e\x3c/dd\x3e                     \x3c/dl\x3e                     \x3cdl\x3e                         \x3cdt\x3e\x3clabel for\x3d"xj_link_url" class\x3d"dy-label"\x3e'+
xg.shared.nls.html("linkUrl")+'\x3c/label\x3e\x3c/dt\x3e                         \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"url" id\x3d"xj_link_url" class\x3d"dy-input-text dy-input-medium"/\x3e\x3c/dd\x3e                     \x3c/dl\x3e                     \x3cdl class\x3d"target_section"\x3e                         \x3cdt\x3e\x3clabel class\x3d"dy-label"\x3e'+xg.index.nls.html("openInColon")+'\x3c/label\x3e\x3c/dt\x3e                         \x3cdd\x3e\x3cinput type\x3d"radio" name\x3d"target" value\x3d"_self" id\x3d"xg_link_self" /\x3e \x3clabel for\x3d"xg_link_self"\x3e'+
xg.index.nls.html("sameWindow")+'\x3c/label\x3e\x3c/dd\x3e                         \x3cdd\x3e\x3cinput type\x3d"radio" name\x3d"target" value\x3d"_blank" id\x3d"xg_link_blank" /\x3e \x3clabel for\x3d"xg_link_blank"\x3e'+xg.index.nls.html("newWindow")+'\x3c/label\x3e\x3c/dd\x3e                     \x3c/dl\x3e                 \x3c/fieldset\x3e                     \x3cfieldset class\x3d"dy-form-2"\x3e\x3cdl\x3e\x3cdt\x3e\x3c/dt\x3e                        \x3cdd\x3e\x3cinput type\x3d"submit" class\x3d"button" value\x3d"'+
xg.index.nls.html("ok")+'" /\x3e                         \x3ca class\x3d"cancel5 dy-action-secondary" href\x3d"#" \x3e'+xg.index.nls.html("cancel")+"\x3c/a\x3e\x3c/dd\x3e\x3c/dl\x3e\x3c/fieldset\x3e             \x3c/form\x3e         \x3c/div\x3e     \x3c/div\x3e \x3c/div\x3e").appendTo("body")[0];x$("form",a).submit(function(c){c.preventDefault();xg.shared.util.hideOverlay();x$(a).remove();b.onOk(a)});x$("a.cancel5",a).click(function(c){c.preventDefault();xg.shared.util.hideOverlay();x$(a).remove();
b.onCancel(a)});x$(a).keydown(function(c){27==c.keyCode&&(c.preventDefault(),xg.shared.util.hideOverlay(),x$(a).remove(),b.onCancel(a))});h.targetSectionVisible||x$(a).find(".target_section").hide();return a};g.initialize();return k});dojo.hostenv.findModule("xg.shared.StorageUploader",!1)||(dojo.provide("xg.shared.StorageUploader"),xg.shared.StorageUploader={uploadFile:function(a,g,d,b,h){h=!1!==h;var c=function(){"function"==typeof b&&b();h&&xg.shared.util.alert(xg.shared.nls.text("THERE_HAS_BEEN_AN_ERROR"));return!1},f={token:atob(window.ning.CurrentProfile.t)};return fetch(a+"/?t\x3d"+Math.random(),{method:"PUT",headers:f}).then(function(e){!0!==e.ok&&c();return e.json()}).then(function(e){if(e.status&&e.location){e=e.location;
var k=new FormData;k.append("file",g);return fetch(e,{method:"POST",body:k,headers:f})}}).then(function(e){!0!==e.ok&&c();return e.json()}).then(function(e){return{storageId:e.id,index:d}}).catch(c)},processFormUploading:function(a,g,d,b,h,c,f){if(!(d instanceof File))return xg.shared.util.alert(xg.shared.nls.text("THERE_HAS_BEEN_AN_ERROR")),!1;xg.shared.StorageUploader.uploadFile(g,d,null,function(){"function"==typeof c&&c()},f).then(function(e){x$(a).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name",
"nfiles["+b+"][id]").attr("value",e.storageId));x$(a).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name","nfiles["+b+"][name]").attr("value",d.name));x$(a).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name","nfiles["+b+"][size]").attr("value",d.size));x$(a).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name","nfiles["+b+"][type]").attr("value",d.type));"function"==typeof h&&h(e.id)})},uploadFiles:function(a,g,d,b,h){if(!g)return b("Upload path not found!"),!1;x$(d).attr("files_cnt",
a.length);xg.shared.StorageUploader.initUploadedEvent(d,b,h);for(b=0;b<a.length;b++)xg.shared.StorageUploader.uploadFile(g,a[b].files?a[b].files[0]:a[b],b).then(function(c){var f=a[c.index].files?a[c.index].files[0]:a[c.index];x$(d).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name","nfiles["+(c.index+1)+"][id]").attr("value",c.storageId));x$(d).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name","nfiles["+(c.index+1)+"][name]").attr("value",f.name));x$(d).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name",
"nfiles["+(c.index+1)+"][size]").attr("value",f.size));x$(d).append(x$('\x3cinput type\x3d"hidden"/\x3e').attr("name","nfiles["+(c.index+1)+"][type]").attr("value",f.type));x$(d).change()})},initUploadedEvent:function(a,g,d){x$(a).change(function(){var b=x$(a).attr("files_cnt"),h=x$(a).find('input:hidden[name^\x3d"nfiles"]').length;if(h&&b&&h/4==b){var c={};x$(a).find("input:hidden").each(function(f,e){c[e.name]=e.value});x$.post(x$(a).attr("action"),c,function(f){"shouldShowCaptcha"in f&&(xg.captcha.shouldShow=
f.shouldShowCaptcha);xg.shared.StorageUploader.clenupForm(a);!0!==f.success?g(f.errorMessage):d(f)},"json")}})},clenupForm:function(a){x$(a).find('input:hidden[name^\x3d"nfiles"]').remove();x$(a).off("change")},validateFilesBySize:function(a,g,d){for(var b=[],h=[],c=0;c<a.length;c++)g&&!xg.shared.StorageUploader.isValidateSize(a[c].size,g)?b.push(a[c].name.split(/\\|\//).pop()):h.push(a[c]);0<b.length&&d(xg.shared.nls.html("FILE_IS_BIGGER_THAN_LIMIT","\n"+b.join(", \x3cbr\x3e"),g));return h},isValidateSize:function(a,
g){return a<=1048576*g}});dojo.hostenv.findModule("xg.shared.editors.tinymce.FilePanel",!1)||(dojo.provide("xg.shared.editors.tinymce.FilePanel"),xg.shared.editors.tinymce.FilePanel=function(d){var e={},c={},a,h=d.url||"",k="",l,g=!1;c.initialize=function(){};e.getElements=function(b){a||(a=x$(' \x3cform method\x3d"post" enctype\x3d"multipart/form-data" data-jsonContainsHtml\x3d"1"\x3e     \x3cdiv class\x3d"dy-error-msg" style\x3d"display:none"\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e     \x3cinput type\x3d"hidden" name\x3d"pageUrl" value\x3d"'+
xg.qh(window.location.href)+'" \x3e     \x3cfieldset class\x3d"dy-form-2"\x3e         \x3cdl\x3e             \x3cdt\x3e\x3clabel for\x3d"xj_upload_file" class\x3d"dy-label"\x3e'+xg.shared.nls.html("file")+'\x3c/label\x3e\x3c/dt\x3e             \x3cdd\x3e                 \x3cinput type\x3d"file" class\x3d"file" name\x3d"file" id\x3d"xj_upload_file" /\x3e                 \x3cimg class\x3d"xj_spinner" width\x3d"20" height\x3d"20" alt\x3d"'+xg.shared.nls.html("loading")+'" src\x3d"'+xg.shared.util.cdn("/xn_resources/widgets/index/gfx/spinner.gif")+
'" style\x3d"position:relative;top:5px;display:none;"/\x3e                 \x3cp class\x3d"xj_filename dy-small" style\x3d"display:none"\x3e\x3c/p\x3e                 \x3cp class\x3d"dy-small xj_limit"\x3e\x3c/p\x3e             \x3c/dd\x3e         \x3c/dl\x3e     \x3c/fieldset\x3e \x3c/form\x3e'),d.maxFileUploadSize?a.find(".xj_limit").text(xg.shared.nls.html("fileSizeLimit",d.maxFileUploadSize)):a.find(".xj_limit").remove(),a.append(xg.shared.util.createCsrfTokenHiddenInput()),a.find("input[name\x3dfile]").change(function(f){f.preventDefault();
c.onFileChanged()}),a.submit(function(f){f.preventDefault();c.onFileChanged()}),d.forImage&&a.append('\x3cinput type\x3d"hidden" name\x3d"image" value\x3d"1"/\x3e'));return a};c.onFileChanged=function(){if(!g&&0!==a.find("input[name\x3dfile]").val().length&&a.find("input[name\x3dfile]").val()!==l)if(d.forImage)if(a.find("input[name\x3dfile]").val().match(/\.(jpeg|jpg|jpe|gif|png|bmp)$/i))c.onFileChangedProper();else if(confirm(xg.shared.nls.text("fileDoesNotSeem")))c.onFileChangedProper();else a.find("input[name\x3dfile]").val("");
else c.onFileChangedProper()};c.onFileChangedProper=function(){c.setErrorMessageHtml(null);a.find(".xj_spinner").show();g=!0;l=a.find("input[name\x3dfile]").val();el=a.find("input[name\x3dfile]")[0].files[0];xg.shared.StorageUploader.processFormUploading(a,d.storageUploadPath,el,0,function(){a.find("input[name\x3dfile]").remove();xg.index.util.FormHelper.save(a[0],function(b){"xml"==typeof b&&b.toXMLString&&-1!=b.toXMLString().indexOf("\x3ch1\x3e413:")?d.maxFileUploadSize?c.setErrorMessageHtml(xg.shared.nls.html("fileNeedsToBeUnderX",
d.maxFileUploadSize)):c.setErrorMessageHtml(xg.shared.nls.html("fileTooLarge")):b.error?c.setErrorMessageHtml(b.errorHtml):(x$.browser.safari||a.find(".xj_filename").text(decodeURIComponent(b.filename)).show(),k=b.filename||"",h=x$.trim(decodeURIComponent(b.url)),d.onChange(b.imageWidth));a.find(".xj_spinner").hide();g=!1},"/profiles/blog/upload/.txt?xn_out\x3djson")})};c.setErrorMessageHtml=function(b){null===b?a.find(".dy-error-msg").hide():(a.find(".dy-error-msg p").html(b),a.find(".dy-error-msg").show())};
e.getUrl=function(){return h};e.getFilename=function(){return k};e.onSelect=function(){a.find("input[name\x3dfile]").focus()};e.validate=function(b,f){b()};c.initialize();return e});dojo.hostenv.findModule("xg.shared.editors.tinymce.ImageUrlPanel",!1)||(dojo.provide("xg.shared.editors.tinymce.ImageUrlPanel"),xg.shared.editors.tinymce.ImageUrlPanel=function(g){var c={},d={},a;d.initialize=function(){};c.getElements=function(b){a||(a=x$(' \x3cform\x3e     \x3cdiv class\x3d"dy-error-msg" style\x3d"display:none"\x3e\x3cp\x3e\x3c/p\x3e\x3c/div\x3e     \x3cfieldset class\x3d"dy-form-2"\x3e         \x3cdl\x3e             \x3cdt\x3e\x3clabel for\x3d"xj_image_url" class\x3d"dy-label"\x3e'+
xg.shared.nls.html("url")+'\x3c/label\x3e\x3c/dt\x3e             \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"url" id\x3d"xj_image_url" class\x3d"dy-input-text dy-input-medium" maxlength\x3d"1000"/\x3e\x3c/dd\x3e         \x3c/dl\x3e     \x3c/fieldset\x3e \x3c/form\x3e'),a.submit(function(e){e.preventDefault();g.onSubmit()}),a.find("input[name\x3durl]").val(g.url||"http://"),a.find("input[name\x3durl]").bind("keyup keypress blur cut paste change",function(e){g.onChange(null)}));return a};c.getUrl=function(){var b=
x$.trim(a.find("input[name\x3durl]").val());return"http://"===b?"":b};c.onSelect=function(){a.find("input[name\x3durl]")[0].select();a.find("input[name\x3durl]").focus()};d.setErrorMessageHtml=function(b){null===b?a.find(".dy-error-msg").hide():(a.find(".dy-error-msg p").html(b),a.find(".dy-error-msg").show())};c.validate=function(b,e){d.setErrorMessageHtml(null);var f=new Image;f.onload=function(){b()};f.onerror=f.onabort=function(){d.setErrorMessageHtml(xg.shared.nls.html("noFileAtUrl"));e()};f.src=
c.getUrl()};d.initialize();return c});dojo.hostenv.findModule("xg.shared.editors.tinymce.ImagePropertiesPanel",!1)||(dojo.provide("xg.shared.editors.tinymce.ImagePropertiesPanel"),xg.shared.editors.tinymce.ImagePropertiesPanel=function(c){var e={},d={},b,g=null,h=c.link&&c.link!=c.imageUrl;d.initialize=function(){};e.getElements=function(a){b||(b=x$(' \x3cdl\x3e     \x3cdt\x3e\x3clabel class\x3d"dy-label"\x3e'+xg.shared.nls.html("layout")+'\x3c/label\x3e\x3c/dt\x3e     \x3cdd\x3e         \x3cul class\x3d"mce-image-layouts dy-clearfix"\x3e             \x3cli\x3e\x3cspan class\x3d"thumb thumb-left"\x3e\x3c/span\x3e \x3cinput type\x3d"radio" name\x3d"layout" value\x3d"left" id\x3d"xj_layout_left"/\x3e \x3clabel class\x3d"name" for\x3d"xj_layout_left"\x3e'+
xg.shared.nls.html("left")+'\x3c/label\x3e\x3c/li\x3e             \x3cli\x3e\x3cspan class\x3d"thumb thumb-center"\x3e\x3c/span\x3e \x3cinput type\x3d"radio" name\x3d"layout" value\x3d"center" id\x3d"xj_layout_center"/\x3e \x3clabel class\x3d"name" for\x3d"xj_layout_center"\x3e'+xg.shared.nls.html("center")+'\x3c/label\x3e\x3c/li\x3e             \x3cli\x3e\x3cspan class\x3d"thumb thumb-right"\x3e\x3c/span\x3e \x3cinput type\x3d"radio" name\x3d"layout" value\x3d"right" id\x3d"xj_layout_right"/\x3e \x3clabel class\x3d"name" for\x3d"xj_layout_right"\x3e'+
xg.shared.nls.html("right")+'\x3c/label\x3e\x3c/li\x3e             \x3cli\x3e\x3cspan class\x3d"thumb thumb-full"\x3e\x3c/span\x3e \x3cinput type\x3d"radio" name\x3d"layout" value\x3d"full" id\x3d"xj_layout_full"/\x3e \x3clabel class\x3d"name" for\x3d"xj_layout_full"\x3e'+xg.shared.nls.html("full")+'\x3c/label\x3e\x3c/li\x3e         \x3c/ul\x3e     \x3c/dd\x3e \x3c/dl\x3e \x3cdl\x3e     \x3cdt\x3e\x3clabel for\x3d"xj_image_padding" class\x3d"dy-label"\x3e'+xg.shared.nls.html("padding")+'\x3c/label\x3e\x3c/dt\x3e     \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"padding" id\x3d"xj_image_padding" class\x3d"dy-input-text dy-input-single" maxlength\x3d"3"/\x3e '+
xg.shared.nls.html("pixels")+'\x3c/dd\x3e \x3c/dl\x3e \x3cdl\x3e     \x3cdt\x3e\x3clabel for\x3d"xj_image_link" class\x3d"dy-label"\x3e'+xg.shared.nls.html("link")+'\x3c/label\x3e\x3c/dt\x3e     \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"link" id\x3d"xj_image_link" class\x3d"dy-input-text dy-input-medium" maxlength\x3d"1000"/\x3e\x3c/dd\x3e \x3c/dl\x3e \x3cdl\x3e     \x3cdt\x3e\x3clabel for\x3d"xj_image_width" class\x3d"dy-label"\x3e'+xg.shared.nls.html("width")+'\x3c/label\x3e\x3c/dt\x3e     \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"width" id\x3d"xj_image_width" class\x3d"dy-input-text dy-input-narrow" maxlength\x3d"4"/\x3e '+
xg.shared.nls.html("pixels")+"\x3c/dd\x3e \x3c/dl\x3e"),c.allowCenterAlignment||b.find("#xj_layout_center").parents("li:first").hide(),c.layout&&b.find("input[value\x3d"+c.layout+"]").prop("checked",!0),b.find("input[name\x3dpadding]").val(c.padding),b.find("input[name\x3dlink]").val(c.link),b.find("input[name\x3dwidth]").val(c.width),b.find("span.thumb").click(function(f){x$(this).next("input[type\x3dradio]").click()}),b.find("input[name\x3dlink]").bind("cut paste change",function(f){h=!0}),d.addInputValidation(b));
return b};e.setEnabled=function(a){b.find("input").prop("disabled",!a);b.toggleClass("dy-disabled",!a)};e.setLink=function(a){b.find("input[name\x3dlink]").val(a)};e.didUserChangeLink=function(){return h};e.getProperties=function(){var a={layout:b.find("input[name\x3dlayout]:checked").val(),padding:x$.trim(b.find("input[name\x3dpadding]").val()),link:x$.trim(b.find("input[name\x3dlink]").val()),width:x$.trim(b.find("input[name\x3dwidth]").val()),originalWidth:g};a.padding=a.padding?parseInt(a.padding,
10):0;a.width=a.width&&0<parseInt(a.width,10)?parseInt(a.width,10):null;a.link?0>a.link.indexOf(":")&&(a.link="http://"+a.link):a.link=null;return a};e.setOriginalImageWidth=function(a){(g=a)&&b.find("input[name\x3dwidth]").val(Math.min(g,d.getMaxWidth()))};d.addInputValidation=function(a){a.find("input[name\x3dpadding], input[name\x3dwidth]").keyup(function(f){f=this.value.replace(/[^0-9]/,"");this.value!=f&&(this.value=f)});a.find("input[name\x3dwidth]").keyup(function(f){parseInt(this.value,10)>
d.getMaxWidth()&&(this.value=d.getMaxWidth())})};d.getMaxWidth=function(){var a=c.maxWidth;g&&(a=Math.min(a,g));return a};d.initialize();return e});dojo.hostenv.findModule("xg.shared.editors.tinymce.ImageDialog",!1)||(dojo.provide("xg.shared.editors.tinymce.ImageDialog"),xg.shared.editors.tinymce.ImageDialog=function(f,g,u){var v={},b={},l=xg.shared.editors.tinymce.Utilities.getEditor(f),w={heading:xg.shared.nls.text("addImage"),getInitialUrl:function(){return""},getInitialProperties:function(){return{layout:"full",padding:0,link:null,width:null,imageUrl:this.getInitialUrl()}},selectInitialTab:function(a,c,d){u?b.selectTab(a.find(".xj_from_url"),
d,c):b.selectTab(a.find(".xj_from_computer"),c,d)},onOk:function(a){xg.shared.editors.tinymce.Utilities.overwriteSelection(f,a)}},x={heading:xg.shared.nls.text("editImage"),getInitialUrl:function(){return g.attr("src")},getInitialProperties:function(){var a={};a.layout=f.data("htmlCapability").getAlignment(g);a.padding=parseInt(g.css("padding"),10)||0;g.parent("a").length&&(a.link=g.parent("a").attr("href"));var c=parseInt(g.attr("width"),10);c&&(a.width=c);a.imageUrl=this.getInitialUrl();return a},
selectInitialTab:function(a,c,d){b.selectTab(a.find(".xj_from_url"),d,c)},onOk:function(a){var c=g.parent("a")[0];c||=g[0];var d=l?l.getDoc():null;l.dom.replace(x$(a,d)[0],c);l.undoManager.add()}},m,h,q,n,k,e,t=!1;b.initialize=function(){g||=b.findImage();m=g?x:w;h=xg.shared.editors.tinymce.ImagePropertiesPanel(x$.extend({allowCenterAlignment:f.data("htmlCapability").supportsCenterAlignment(),maxWidth:parseInt(f.attr("_maxImageWidth"),10)},m.getInitialProperties()));q=xg.shared.editors.tinymce.FilePanel({onChange:b.onChange,
forImage:!0,storageUploadPath:f.attr("_storageUploadPath"),url:m.getInitialUrl()});n=xg.shared.editors.tinymce.ImageUrlPanel({onChange:b.onChange,onSubmit:b.onSubmit,url:m.getInitialUrl()})};b.findImage=function(){if(!l||!l.selection.getNode())return null;$node=x$(l.selection.getNode());return"IMG"===$node[0].nodeName?$node:$node.filter("a:has(img)").length?$node.find("img:first"):null};b.onChange=function(a){b.updateEnabledState();h.setOriginalImageWidth(a);!h.didUserChangeLink()&&f.data("htmlCapability").shouldLinkImagesByDefault()&&
h.setLink(k.getUrl())};v.show=function(){b.createDialog();b.showDialog(e)};b.createDialog=function(a){e=x$(' \x3cdiv tabindex\x3d"0" class\x3d"xg_theme xg_floating_module xg_tinymce_dialog xg_image_dialog" style\x3d"display:none; z-index:300000; outline:0;"\x3e     \x3cdiv class\x3d"xg_floating_container xg_floating_container_wide xg_module xg_lightborder"\x3e         \x3cdiv class\x3d"xg_module_head"\x3e             \x3ch2\x3e'+xg.qh(m.heading)+'\x3c/h2\x3e             \x3ca class\x3d"xg_icon xg_icon-close cancel5" href\x3d"#" \x3e'+
xg.index.nls.html("close")+'\x3c/a\x3e         \x3c/div\x3e         \x3cdiv class\x3d"xg_module_body"\x3e             \x3cul class\x3d"page_tabs"\x3e                 \x3cli class\x3d"xj_from_computer this"\x3e'+xg.shared.nls.html("fromMyComputer")+'\x3c/li\x3e                 \x3cli class\x3d"xj_from_url"\x3e'+xg.shared.nls.html("fromUrl")+'\x3c/li\x3e             \x3c/ul\x3e             \x3cdiv class\x3d"clear_no_height"\x3e\x3c/div\x3e             \x3cform class\x3d"xj_main_form"\x3e                 \x3cfieldset class\x3d"dy-form-2"\x3e                 \x3c/fieldset\x3e                 \x3cfieldset class\x3d"dy-form-2"\x3e                     \x3cdl\x3e                         \x3cdt\x3e\x3c/dt\x3e                         \x3cdd\x3e                             \x3cinput type\x3d"submit" class\x3d"button" value\x3d"'+
xg.index.nls.html("ok")+'" /\x3e                             \x3ca class\x3d"cancel5 dy-action-secondary" href\x3d"#" \x3e'+xg.index.nls.html("cancel")+'\x3c/a\x3e                             \x3cimg class\x3d"xj_spinner" width\x3d"20" height\x3d"20" alt\x3d"'+xg.shared.nls.html("loading")+'" src\x3d"'+xg.shared.util.cdn("/xn_resources/widgets/index/gfx/spinner.gif")+'" style\x3d"position:relative;top:5px;left:10px;display:none;"/\x3e                         \x3c/dd\x3e                     \x3c/dl\x3e                 \x3c/fieldset\x3e            \x3c/form\x3e         \x3c/div\x3e     \x3c/div\x3e \x3c/div\x3e').appendTo("body");
xg.shared.editors.tinymce.Utilities.saveSelection(f);a=x$("form.xj_main_form",e);a.submit(function(c){c.preventDefault();b.onSubmit()});x$("a.cancel5",e).click(function(c){c.preventDefault();b.hideDialog(e);xg.shared.editors.tinymce.Utilities.restoreSelection(f)});e.keydown(function(c){27==c.keyCode&&(c.preventDefault(),b.hideDialog(e),xg.shared.editors.tinymce.Utilities.restoreSelection(f))});q.getElements().insertBefore(a);n.getElements().insertBefore(a);h.getElements().appendTo(a.find("fieldset:first"));
u&&e.find(".page_tabs").css("display","none");m.selectInitialTab(e,q,n);return e};b.onSubmit=function(){if(!t){var a=x$("form.xj_main_form",e);a.find("input[type\x3dsubmit]").prop("disabled")||(k.getUrl()?(t=!0,a.find(".xj_spinner").show(),k.validate(function(){t=!1;a.find(".xj_spinner").hide();b.hideDialog(e);var c=x$("\x3cdiv\x3e\x3c/div\x3e").append(b.createLinkedImageElement());m.onOk(c.html())},function(){t=!1;a.find(".xj_spinner").hide()})):(b.hideDialog(e),xg.shared.editors.tinymce.Utilities.restoreSelection(f)))}};
b.createLinkedImageElement=function(){var a=x$("\x3ca\x3e\x3cimg/\x3e\x3c/a\x3e"),c=a.find("img:first"),d=h.getProperties(),p=xg.shared.util.addParameter(k.getUrl(),"profile","RESIZE_710x");c.attr("src",p);c.removeAttr("style");d.width&&d.width!==d.originalWidth&&c.attr("width",d.width);d.padding&&c.css("padding",d.padding+"px");if(!d.link)return c;a.attr("href",d.link);a.attr("target",xg.shared.editors.tinymce.Utilities.getDefaultTargetForUrl(d.link));f.data("htmlCapability").setAlignment(c,d.layout);
return a};b.selectTab=function(a,c,d){c.getElements().show();d.getElements().css("display","none");k=c;k.onSelect();b.updateEnabledState();!h.didUserChangeLink()&&f.data("htmlCapability").shouldLinkImagesByDefault()&&h.setLink(k.getUrl());$ul=a.parent();$ul.find("li").removeClass("this");a.addClass("this");$ul.find("li").each(function(p,r){r===a[0]?x$(r).html('\x3cspan class\x3d"xg_tabs"\x3e'+xg.qh(x$(r).text())+"\x3c/span\x3e"):x$(r).html('\x3ca href\x3d"#"\x3e'+xg.qh(x$(r).text())+"\x3c/a\x3e")});
$ul.find(".xj_from_computer a").click(function(p){p.preventDefault();b.selectTab($ul.find(".xj_from_computer"),q,n)});$ul.find(".xj_from_url a").click(function(p){p.preventDefault();b.selectTab($ul.find(".xj_from_url"),n,q)})};b.updateEnabledState=function(){var a=0<k.getUrl().length;h.setEnabled(a||n===k);e.find("input[type\x3dsubmit]").prop("disabled",!a).toggleClass("dy-disabled",!a)};b.showDialog=function(a){xg.shared.util.showOverlay();a.show();a.focus()};b.hideDialog=function(a){xg.shared.util.hideOverlay();
a.remove()};b.initialize();return v});dojo.hostenv.findModule("xg.shared.editors.tinymce.MediaDialog",!1)||(dojo.provide("xg.shared.editors.tinymce.MediaDialog"),xg.shared.editors.tinymce.MediaDialog=function(d){var f={},e={initialize:function(){}};f.show=function(){var b=e.createDialog({onOk:function(a){a=x$("form",a)[0];a=x$.trim(a.embedCode.value);xg.shared.editors.tinymce.Utilities.overwriteSelection(d,a)},onCancel:function(a){xg.shared.editors.tinymce.Utilities.restoreSelection(d)}});xg.shared.util.showOverlay();x$(b).show();$form=
x$("form",b);xg.shared.editors.tinymce.Utilities.saveSelection(d);$form.find("[name\x3dembedCode]").focus()};e.createDialog=function(b){var a=x$(' \x3cdiv class\x3d"xg_theme xg_floating_module" style\x3d"display:none; z-index: 300000"\x3e     \x3cdiv class\x3d"xg_floating_container xg_tinymce_dialog xg_floating_container_wide xg_module xg_lightborder"\x3e         \x3cdiv class\x3d"xg_module_head"\x3e             \x3ch2\x3e'+xg.index.nls.html("addMedia")+'\x3c/h2\x3e             \x3ca class\x3d"xg_icon xg_icon-close cancel5" href\x3d"#" \x3e'+
xg.index.nls.html("close")+'\x3c/a\x3e         \x3c/div\x3e         \x3cdiv class\x3d"xg_module_body"\x3e             \x3cform\x3e                 \x3cfieldset class\x3d"dy-form-1"\x3e \x3cdl\x3e\x3cdt\x3e                    \x3clabel for\x3d"embedCode" class\x3d"dy-label"\x3e'+xg.index.nls.html("pasteEmbedCodeFrom")+'\x3c/label\x3e                         \x3c/dt\x3e                         \x3cdd\x3e\x3ctextarea name\x3d"embedCode" id\x3d"embedCode" rows\x3d"8" cols\x3d"60"\x3e\x3c/textarea\x3e\x3c/dd\x3e                     \x3c/dl\x3e                 \x3c/fieldset\x3e                    \x3cfieldset class\x3d"dy-form-1"\x3e\x3cdl\x3e\x3cdt\x3e\x3c/dt\x3e                         \x3cdd\x3e\x3cinput type\x3d"submit" class\x3d"button" value\x3d"'+
xg.index.nls.html("ok")+'" /\x3e                         \x3ca class\x3d"cancel5 dy-action-secondary" href\x3d"#" \x3e'+xg.index.nls.html("cancel")+"\x3c/a\x3e\x3c/dd\x3e\x3c/dl\x3e\x3c/fieldset\x3e             \x3c/form\x3e         \x3c/div\x3e     \x3c/div\x3e \x3c/div\x3e").appendTo("body")[0];x$("form",a).submit(function(c){c.preventDefault();xg.shared.util.hideOverlay();x$(a).remove();b.onOk(a)});x$("a.cancel5",a).click(function(c){c.preventDefault();xg.shared.util.hideOverlay();x$(a).remove();
b.onCancel(a)});x$(a).keydown(function(c){27==c.keyCode&&(c.preventDefault(),xg.shared.util.hideOverlay(),x$(a).remove(),b.onCancel(a))});return a};e.initialize();return f});dojo.hostenv.findModule("xg.shared.editors.tinymce.PasteTextDialog",!1)||(dojo.provide("xg.shared.editors.tinymce.PasteTextDialog"),xg.shared.editors.tinymce.PasteTextDialog=function(e){var f={},d={initialize:function(){}};f.show=function(){var b=d.createDialog({onOk:function(a){a=x$("form",a)[0];a=xg.qh(x$.trim(a.embedCode.value));a=xg.shared.editors.tinymce.WordpressLineBreakRules.adjustLineBreaksEnteredInHtmlMode(a);a=xg.shared.editors.tinymce.WordpressLineBreakRules.adjustLineBreaksEnteredInVisualMode(a);
xg.shared.editors.tinymce.Utilities.overwriteSelection(e,a);d.cleanMarkup(e)},onCancel:function(a){xg.shared.editors.tinymce.Utilities.restoreSelection(e)}});xg.shared.util.showOverlay();x$(b).show();$form=x$("form",b);xg.shared.editors.tinymce.Utilities.saveSelection(e);$form.find("[name\x3dembedCode]").focus()};d.createDialog=function(b){var a=x$(' \x3cdiv class\x3d"xg_theme xg_floating_module" style\x3d"display:none; z-index: 300000"\x3e     \x3cdiv class\x3d"xg_floating_container xg_tinymce_dialog xg_floating_container_wide xg_module xg_lightborder"\x3e         \x3cdiv class\x3d"xg_module_head"\x3e             \x3ch2\x3e'+
xg.index.nls.html("insertPlainText")+'\x3c/h2\x3e             \x3ca class\x3d"xg_icon xg_icon-close cancel5" href\x3d"#" \x3e'+xg.index.nls.html("close")+'\x3c/a\x3e         \x3c/div\x3e         \x3cdiv class\x3d"xg_module_body"\x3e             \x3cform\x3e                 \x3cfieldset class\x3d"dy-form-1"\x3e                     \x3cdl\x3e                         \x3cdt\x3e\x3clabel for\x3d"embedCode" class\x3d"dy-label"\x3e'+xg.index.nls.html("pasteTextFromWord")+'\x3c/label\x3e\x3c/dt\x3e                         \x3cdd\x3e\x3ctextarea name\x3d"embedCode" id\x3d"embedCode" rows\x3d"8" cols\x3d"60"\x3e\x3c/textarea\x3e\x3c/dd\x3e                     \x3c/dl\x3e                 \x3c/fieldset\x3e                 \x3cfieldset class\x3d"dy-form-1"\x3e                     \x3cdl\x3e                         \x3cdt\x3e\x3c/dt\x3e                         \x3cdd\x3e\x3cinput type\x3d"submit" class\x3d"button" value\x3d"'+
xg.index.nls.html("ok")+'" /\x3e                         \x3ca class\x3d"cancel5 dy-action-secondary" href\x3d"#" \x3e'+xg.index.nls.html("cancel")+"\x3c/a\x3e\x3c/dd\x3e                     \x3c/dl\x3e                 \x3c/fieldset\x3e             \x3c/form\x3e         \x3c/div\x3e     \x3c/div\x3e \x3c/div\x3e").appendTo("body")[0];x$("form",a).submit(function(c){c.preventDefault();xg.shared.util.hideOverlay();x$(a).remove();b.onOk(a)});x$("a.cancel5",a).click(function(c){c.preventDefault();xg.shared.util.hideOverlay();
x$(a).remove();b.onCancel(a)});x$(a).keydown(function(c){27==c.keyCode&&(c.preventDefault(),xg.shared.util.hideOverlay(),x$(a).remove(),b.onCancel(a))});return a};d.cleanMarkup=function(b){var a=xg.shared.editors.tinymce.Utilities.getEditor(b);a?(a.selection.select(a.getBody(),!0),tinyMCE.execCommand("mceCleanup",!1),a.selection.collapse(!1)):b[0].value=x$("\x3cdiv\x3e\x3c/div\x3e").append(b[0].value).html()};d.initialize();return f});dojo.hostenv.findModule("xg.shared.editors.tinymce.FilePropertiesPanel",!1)||(dojo.provide("xg.shared.editors.tinymce.FilePropertiesPanel"),xg.shared.editors.tinymce.FilePropertiesPanel=function(){var c={},d={},b;d.initialize=function(){};c.getElements=function(a){b||=x$(' \x3cdl\x3e     \x3cdt\x3e\x3clabel for\x3d"xj_file_url" class\x3d"dy-label"\x3e'+xg.shared.nls.html("linkUrl")+'\x3c/label\x3e\x3c/dt\x3e     \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"url" id\x3d"xj_file_url" class\x3d"dy-input-text dy-input-medium" maxlength\x3d"1000"/\x3e\x3c/dd\x3e \x3c/dl\x3e \x3cdl\x3e     \x3cdt\x3e\x3clabel for\x3d"xj_file_title" class\x3d"dy-label"\x3e'+
xg.shared.nls.html("title")+'\x3c/label\x3e\x3c/dt\x3e     \x3cdd\x3e\x3cinput type\x3d"text" name\x3d"title" id\x3d"xj_file_title" class\x3d"dy-input-text dy-input-medium" maxlength\x3d"1000"/\x3e\x3c/dd\x3e \x3c/dl\x3e');return b};c.setEnabled=function(a){b.find("input").prop("disabled",!a);b.toggleClass("dy-disabled",!a)};c.setUrl=function(a){b.find("input[name\x3durl]").val(a)};c.getUrl=function(){var a=b.find("input[name\x3durl]").val();0>a.indexOf(":")&&(a="http://"+a);return x$.trim(a)};c.setTitle=
function(a){b.find("input[name\x3dtitle]").val(a)};c.getTitle=function(){return x$.trim(b.find("input[name\x3dtitle]").val())};d.initialize();return c});dojo.hostenv.findModule("xg.shared.editors.tinymce.FileDialog",!1)||(dojo.provide("xg.shared.editors.tinymce.FileDialog"),xg.shared.editors.tinymce.FileDialog=function(g,k){var n={},b={},h=xg.shared.editors.tinymce.Utilities.getEditor(g),p={heading:xg.shared.nls.text("uploadFile"),getInitialUrl:function(){return""},initializeForm:function(a){var d=xg.shared.editors.tinymce.Utilities.saveSelection(g);a.setTitle(d)},onOk:function(a){xg.shared.editors.tinymce.Utilities.overwriteSelection(g,a)}},q={heading:xg.shared.nls.text("uploadFile"),
getInitialUrl:function(){return k.attr("href")},initializeForm:function(a){xg.shared.editors.tinymce.Utilities.saveSelection(g);a.setTitle(k.text());a.setUrl(k.attr("href"))},onOk:function(a){var d=h?h.getDoc():null;h.dom.replace(x$(a,d)[0],k[0]);h.undoManager.add()}},l,e=xg.shared.editors.tinymce.FilePropertiesPanel(),m="",f,c;b.initialize=function(){k||=b.findLink();l=k?q:p;f=xg.shared.editors.tinymce.FilePanel({url:l.getInitialUrl(),maxFileUploadSize:ning.maxFileUploadSize||null,forImage:!1,storageUploadPath:g.attr("_storageUploadPath"),
onChange:function(){b.updateEnabledState();f.getUrl()&&(e.setUrl(f.getUrl()),e.getTitle()&&e.getTitle()!==m||(e.setTitle(f.getFilename()||f.getUrl()),m=e.getTitle()))}})};b.findLink=function(){if(!h||!h.selection.getNode())return null;$node=x$(h.selection.getNode());return"A"===$node[0].nodeName?$node:null};n.show=function(){b.createDialog();b.showDialog(c)};b.createDialog=function(a){c=x$(' \x3cdiv class\x3d"xg_theme xg_floating_module xg_tinymce_dialog xg_file_dialog" style\x3d"display:none; z-index:300000;"\x3e     \x3cdiv class\x3d"xg_floating_container xg_floating_container_wide xg_module xg_lightborder"\x3e         \x3cdiv class\x3d"xg_module_head"\x3e             \x3ch2\x3e'+
xg.qh(l.heading)+'\x3c/h2\x3e             \x3ca class\x3d"xg_icon xg_icon-close cancel5" href\x3d"#" \x3e'+xg.index.nls.html("close")+'\x3c/a\x3e         \x3c/div\x3e         \x3cdiv class\x3d"xg_module_body"\x3e             \x3cp\x3e'+xg.shared.nls.html("uploadFileAnyType")+'\x3c/p\x3e             \x3cform class\x3d"xj_main_form"\x3e                 \x3cfieldset class\x3d"dy-form-2"\x3e                 \x3c/fieldset\x3e                      \x3cfieldset class\x3d"dy-form-2"\x3e                     \x3cdl\x3e\x3cdt\x3e\x3c/dt\x3e                        \x3cdd\x3e\x3cinput type\x3d"submit" class\x3d"button" value\x3d"'+
xg.index.nls.html("ok")+'" /\x3e                     \x3ca class\x3d"cancel5 dy-action-secondary" href\x3d"#" \x3e'+xg.index.nls.html("cancel")+"\x3c/a\x3e\x3c/dd\x3e\x3c/dl\x3e\x3c/fieldset\x3e             \x3c/form\x3e         \x3c/div\x3e     \x3c/div\x3e \x3c/div\x3e").appendTo("body");a=x$("form.xj_main_form",c);a.submit(b.onSubmit);x$("a.cancel5",c).click(function(d){d.preventDefault();b.hideDialog(c);xg.shared.editors.tinymce.Utilities.restoreSelection(g)});c.keydown(function(d){27==d.keyCode&&
(d.preventDefault(),b.hideDialog(c),xg.shared.editors.tinymce.Utilities.restoreSelection(g))});f.getElements().insertBefore(a);e.getElements().appendTo(a.find("fieldset:first"));l.initializeForm(e);m=e.getTitle();b.updateEnabledState();return c};b.onSubmit=function(a){a.preventDefault();if(!x$("form.xj_main_form",c).find("input[type\x3dsubmit]").prop("disabled"))if(a=e.getUrl()||f.getUrl()){var d=e.getTitle();d||=f.getFilename()||a;$link=x$("\x3ca\x3e\x3c/a\x3e").attr("href",a).attr("target",xg.shared.editors.tinymce.Utilities.getDefaultTargetForUrl(a)).text(d);
a=x$("\x3cdiv\x3e\x3c/div\x3e").append($link).html();b.hideDialog(c);l.onOk(a)}else b.hideDialog(c),xg.shared.editors.tinymce.Utilities.restoreSelection(g)};b.showError=function(a){c.find(".dy-error-msg p").text(a);c.find(".dy-error-msg").show()};b.updateEnabledState=function(){var a=0<f.getUrl().length;e.setEnabled(a);c.find("input[type\x3dsubmit]").prop("disabled",!a).toggleClass("dy-disabled",!a)};b.showDialog=function(a){xg.shared.util.showOverlay();a.show();f.onSelect()};b.hideDialog=function(a){xg.shared.util.hideOverlay();
a.remove()};b.initialize();return n});dojo.hostenv.findModule("xg.shared.editors.tinymce.InlineToolbar",!1)||(dojo.provide("xg.shared.editors.tinymce.InlineToolbar"),xg.shared.editors.tinymce.InlineToolbar=function(f){var h={},b={},e=void 0,g=-1;b.initialize=function(){};h.addTo=function(a){x$(a.getDoc()).delegate(f.selector,"click",function(){$element=x$(this);b.removeToolbar();e=x$(' \x3cdiv class\x3d"dy-tooltip dy-tooltip-plain" style\x3d"position:absolute; z-index: 300000"\x3e     \x3cdiv class\x3d"dy-arrow"\x3e\x3c/div\x3e     \x3cdiv class\x3d"dy-content"\x3e     \x3c/div\x3e \x3c/div\x3e').appendTo("body");
$dyContent=e.find(".dy-content");x$.each(f.links,function(d,k){0<d&&$dyContent.append(" | ");$dyContent.append(x$('\x3ca href\x3d"#"\x3e\x3c/a\x3e').html(k.text).click(function(l){l.preventDefault();b.removeToolbar();k.onClick($element)}))});e.bind("mouseenter",function(d){clearTimeout(g)});e.bind("mouseleave",function(d){b.removeToolbar()});var c=b.getToolbarCoordinates(a,$element);e.css("left",c.left+"px");e.css("top",c.top+"px");if(f.onShow)f.onShow($element,e)});x$(a.getDoc()).delegate(f.selector,
"mouseleave",function(){g=setTimeout(b.removeToolbar,500)});a.onKeyUp.add(b.removeToolbar);a.onPaste.add(b.removeToolbar);a.onChange.add(b.removeToolbar)};b.getToolbarCoordinates=function(a,c){var d=b.getScrollCoordinates(a);$iframe=x$(a.getContainer()).find("iframe");a=$iframe.offset().left+c.offset().left-d.left;c=$iframe.offset().top+c.offset().top+c.height()-d.top;return{left:Math.min($iframe.offset().left+$iframe.width(),Math.max($iframe.offset().left,a)),top:Math.min($iframe.offset().top+$iframe.height(),
Math.max($iframe.offset().top,c))}};b.getScrollCoordinates=function(a){return{left:b.getSmallestNonZeroValue([a.getWin().pageXOffset?a.getWin().pageXOffset:0,a.getDoc().documentElement?a.getDoc().documentElement.scrollLeft:0,a.getDoc().body?a.getDoc().body.scrollLeft:0]),top:b.getSmallestNonZeroValue([a.getWin().pageYOffset?a.getWin().pageYOffset:0,a.getDoc().documentElement?a.getDoc().documentElement.scrollTop:0,a.getDoc().body?a.getDoc().body.scrollTop:0])}};b.getSmallestNonZeroValue=function(a){for(var c=
0,d=0;d<a.length;d++)if(!c||a[d]&&a[d]<c)c=a[d];return c};b.removeToolbar=function(){0<=g&&clearTimeout(g);e&&(e.remove(),e=void 0)};b.initialize();return h});dojo.hostenv.findModule("xg.index.util.toBlob",!1)||(dojo.provide("xg.index.util.toBlob"),xg.index.util.toBlob=function(a){var c=atob(a.split(",")[1]);a=a.split(",")[0].split(":")[1].split(";")[0];for(var d=new ArrayBuffer(c.length),e=new Uint8Array(d),b=0;b<c.length;b++)e[b]=c.charCodeAt(b);return new Blob([d],{type:a})});dojo.hostenv.findModule("xg.shared.RotateImage",!1)||(dojo.provide("xg.shared.RotateImage"),xg.shared.RotateImage={base64Images:{},put:function(a,b){this.base64Images[a]=b},get:function(a){return this.base64Images[a]},toDataURL:function(a){return fetch(a,{method:"GET"}).then(function(b){if(!b.ok)throw Error();return b.blob()}).then(this.blobToBase64).then(function(b){var c="R"===b.slice(22,23);return{base64:b,isGif:c}})},blobToBase64:function(a){return new Promise(function(b){var c=new FileReader;
c.onloadend=function(){return b(c.result)};return c.readAsDataURL(a)})},rotate:function(a,b){a=document.createElement("canvas");var c=a.getContext("2d"),d=b.naturalWidth,e=b.naturalHeight;a.width=e;a.height=d;c.clearRect(0,0,a.width,a.height);c.save();c.translate(a.width/2,a.height/2);c.rotate(Math.PI/180*90);c.drawImage(b,-d/2,-e/2);c.restore();return a.toDataURL()},base64toUrl:function(a,b,c){var d=b.find("#"+a.index);c=c+a.storageId+"?profile\x3doriginal";d.attr("src",c);d.parent("a").attr("href",
c);d.attr("data-base64_encoded","0");d=d[0].outerHTML;b.find("#"+a.index).replaceWith(d);return b[0].outerHTML},setUpRotate:function(a){a.getAttribute("data-src")||(a.setAttribute("data-src",a.src),a.setAttribute("id","img"+Math.floor(999999*Math.random())))},urlToBase64:function(a){if("1"===a.getAttribute("data-base64_encoded"))return new Promise(function(c){return c(a)});var b=a.getAttribute("data-src");b=b.slice(0,b.indexOf("?"));b=xg.shared.util.addParameter(b,"profile","original");return xg.shared.RotateImage.toDataURL(b).then(function(c){a.src=
c.base64;a.setAttribute("data-base64_encoded","1");return a})},savePictures:function(a,b){var c=[];a.each(function(){function d(f){console.error("e \x3e\x3e",f)}var e=xg.shared.RotateImage.get(this.id);e&&c.push(xg.shared.StorageUploader.uploadFile(b,xg.index.util.toBlob(e),x$(this).parent().find("img").attr("id"),d))});return c}});dojo.hostenv.findModule("xg.shared.editors.tinymce.WysiwygEditorConfig",!1)||(dojo.provide("xg.shared.editors.tinymce.WysiwygEditorConfig"),xg.shared.editors.tinymce.WysiwygEditorConfig=function(p,l,m,n,q){var h={},d={},g=xg.shared.editors.tinymce.Utilities;h.initializeTextareas=function(){window.tinyMCE&&(d.createTinyMCELabelClass(),d.initializeI18nStrings(),d.convertTextAreasToTinyMCEEditors())};d.initializeI18nStrings=function(){tinyMCE.addI18n("en.advanced",{fontdefault:xg.shared.nls.text("font"),
toolbar_focus:" ",font_size:xg.shared.nls.text("size"),forecolor_desc:xg.shared.nls.text("color"),bold_desc:xg.shared.nls.text("bold"),italic_desc:xg.shared.nls.text("italic"),striketrough_desc:xg.shared.nls.text("strikethrough"),underline_desc:xg.shared.nls.text("underline"),justifyleft_desc:xg.shared.nls.text("left"),justifycenter_desc:xg.shared.nls.text("center"),justifyright_desc:xg.shared.nls.text("right"),blockquote_desc:xg.shared.nls.text("blockquote"),bullist_desc:xg.shared.nls.text("unorderedList"),
numlist_desc:xg.shared.nls.text("orderedList"),removeformat_desc:xg.shared.nls.text("removeFormatting")});tinyMCE.addI18n("en.fullscreen",{desc:xg.shared.nls.text("fullscreen")});tinyMCE.addI18n("en.tinyautosave",{restore_content:xg.shared.nls.text("restoreContent"),no_content:xg.shared.nls.text("noAutoSaveContent"),warning_message:xg.shared.nls.text("ifRestoreSavedContent")})};d.convertTextAreasToTinyMCEEditors=function(){tinyMCE.init({editor_css:xg.shared.util.cdn("/xn_resources/widgets/shared/css/editors/tinymce/ui.css",
!0),content_css:xg.shared.util.cdn("/xn_resources/widgets/shared/css/editors/tinymce/content.css",!0),entity_encoding:"named",entities:"160,nbsp",verify_html:!1,fix_list_elements:!0,mode:"specific_textareas",plugins:"paste,autosave,lists",autosave_ask_before_unload:!1,editor_selector:"wysiwyg-mce-editor",language:null,relative_urls:!1,gecko_spellcheck:!0,theme_advanced_path:!1,theme_advanced_resizing:!0,theme_advanced_resize_horizontal:!1,theme_advanced_resizing_use_cookie:!1,theme:"modern",menubar:!1,
toolbar:["customlink customimage custommedia custompastetext customfile","fontsizeselect | bold italic strikethrough underline | alignleft aligncenter alignright | bullist numlist | removeformat"],branding:!1,onpageload:function(){},setup:d.setup,convert_urls:!1,cleanup_callback:function(b,a){return"string"==typeof a?xg.shared.editors.tinymce.Utilities.removeCdataTags(a):a},setupcontent_callback:d.afterSetup,extended_valid_elements:"*[*],script[charset|defer|language|src|type]",valid_children:"+body[style]",
media_strict:!1,forced_root_block:"p",cleanup_on_startup:!1,trim_span_elements:!1,remove_linebreaks:!1,convert_fonts_to_spans:!1,paste_preprocess:function(b,a){a.content=a.content.replace(/\r*\n/g," ");x$.browser.msie&&(a.content=a.content.replace(/<A href="[^"]+[<>][^"]+">(.*?)<\/A>/g,"$1").replace(/<A href='[^']+[<>][^']+'>(.*?)<\/A>/g,"$1"))},paste_auto_cleanup_on_paste:!0})};d.setupRegularEditorOrFullScreenEditor=function(b,a){d.setupDefaultFont(b,a);d.setupTheme(b,a);d.monitorFileUploadCount(b,
a);d.setupIndentAndOutdent(b,a);d.handlePastingEmbedCode(b,a);d.setupJustifyCommands(b,a);d.addOnInitHandler(a,function(){b.data("htmlCapability").configureAlignmentFormats(a)})};d.addOnInitHandler=function(b,a){b.initialized?a():b.onInit.add(a)};d.setupJustifyCommands=function(b,a){var c=function(e){b.data("htmlCapability").beforeAlign(a);x$.each(["left","center","right","full"],function(f,k){e!=k&&a.formatter.remove("align"+k)});a.formatter.toggle("align"+e)};a.addCommand("alignLeft",function(){c("left")});
a.addCommand("alignCenter",function(){c("center")});a.addCommand("alignRight",function(){c("right")})};d.setup=function(b){if("mce_fullscreen"===b.id)b.settings.theme_advanced_resize_horizontal=!0;else{var a=x$(b.getElement());a.data("width",a.width());a.data("height",a.height());a.data("htmlCapability").setupFontSizes(b.settings);a.parent().hasClass("full-editor")&&d.addFullScreenPlugin(a,b);b.settings.theme_advanced_buttons1=a.data("buttons");d.preventSpuriousJqueryAttributes(b);d.setupRegularEditorOrFullScreenEditor(a,
b);b.addButton("customlink",{title:xg.shared.nls.text("link"),"class":"mce_link",onclick:function(){b.focus();xg.shared.editors.tinymce.LinkDialog(a).show()}});b.addButton("customimage",{title:xg.shared.nls.text("image"),"class":"mce_image",onclick:function(){b.focus();xg.shared.editors.tinymce.ImageDialog(a,null,xg.uploadsDisabled||g.isMaxFileUploadCountReached(a)).show()}});b.addButton("custommedia",{title:xg.shared.nls.text("media"),"class":"mce_media",onclick:function(){b.focus();xg.shared.editors.tinymce.MediaDialog(a).show()}});
b.addButton("custompastetext",{title:xg.shared.nls.text("pasteText"),"class":"mce_pastetext",onclick:function(){b.focus();xg.shared.editors.tinymce.PasteTextDialog(a).show()}});b.addButton("customfile",{title:xg.shared.nls.text("file"),"class":"mce_file",onclick:function(){b.focus();xg.shared.editors.tinymce.FileDialog(a).show()}});b.addButton("customcode",{title:xg.shared.nls.text("htmlEditor"),"class":"mce_code",onclick:function(){b.focus();l(a)}});b.onPostRender.add(function(c,e){d.addLinkToolbar(a,
c);d.addImageToolbar(a,c)});a.data("resized")||(b.onLoadContent.add(function(c,e){c=x$(g.getEditor(a).getContainer()).find("iframe").contents().find("body").height();c=Math.max(c,x$(g.getEditor(a).getContainer()).find("iframe").height());x$(g.getEditor(a).getContainer()).find("iframe").height(Math.min(c,600))}),a.data("resized",!0));a.parent().hasClass("disabled")&&(b.settings.readonly=!0)}};d.setupTinyAutoSave=function(b,a){!(b=b.attr("_tinyAutoSaveKey"))||x$.browser.msie&&7>=parseInt(x$.browser.version,
10)||"mce_fullscreen"===a.id||(a.settings.plugins+=",tinyautosave",a.settings.fullscreen_settings={plugins:a.settings.plugins.replace(/,tinyautosave/g,"")},a.settings.tinyautosave_key=b,a.settings.tinyautosave_showsaveprogress=!1,a.onPostRender.add(function(c,e){c.plugins.tinyautosave.hasSavedContent()&&(e=x$('\x3ca href\x3d"#" class\x3d"autoRecover" tabindex\x3d"99999" title\x3d"'+xg.shared.nls.html("ifYouAccidentally")+'"\x3e'+xg.shared.nls.html("autoRecover")+"\x3c/a\x3e").click(function(f){f.preventDefault();
c.execCommand("mceTinyAutoSaveRestore")}),x$(c.getContainer()).find(".mceStatusbar:first div:first").html(e))}))};d.preventSpuriousJqueryAttributes=function(b){b.onGetContent.add(function(a,c){c.content=c.content.replace(/\s*jquery\d+="[^"]*"/g,"")})};d.afterSetup=function(b){if("mce_fullscreen"!==b){var a=tinymce.getInstanceById(b),c=x$(a.getElement());setTimeout(function(){d.fixIframeWidth(c,a);g.updateLiquidLayout(c);g.updateBackgroundColor(c,a);d.updateTinyMCEEditorHeight(c,a)},0)}};d.updateTinyMCEEditorHeight=
function(b,a){x$(a.getContainer()).find("iframe").height(b.data("height"))};d.fixIframeWidth=function(b,a){a=x$("iframe",a.getContainer());b.data("width")&&a.width()>20+b.data("width")&&a.width(b.data("width"))};d.handlePastingEmbedCode=function(b,a){a.onPaste.add(function(c,e){setTimeout(function(){var f=c.getContent();f.match(/&lt;(object|embed)/)&&(f=f.replace(/&lt;object.*?&lt;\/object&gt;/g,d.decodeHtmlEntitiesInEmbedCode).replace(/&lt;embed.*?&lt;\/embed&gt;/g,d.decodeHtmlEntitiesInEmbedCode),
c.setContent(f))},0)})};d.decodeHtmlEntitiesInEmbedCode=function(b){b=b.replace(/<.*?>/g,"");return tinymce.DOM.decode(b)};d.addFullScreenPlugin=function(b,a){a.settings.plugins+=",fullscreen";a.onExecCommand.add(function(c,e){"mceFullScreen"===e&&(x$("#mce_fullscreen_parent a.mce_fullscreen").attr("title",xg.shared.nls.text("returnToNormalSize")),x$("#mce_fullscreen_toolbar1 .mceToolbarStart.mceFirst").after(x$("\x3ctd/\x3e").append(n(b))),c=tinymce.get("mce_fullscreen"),d.addLinkToolbar(b,c),d.addImageToolbar(b,
c),d.setupRegularEditorOrFullScreenEditor(b,c))})};d.addLinkToolbar=function(b,a){xg.shared.editors.tinymce.InlineToolbar({selector:"a:not(:has(img))",links:[{text:xg.shared.nls.text("edit"),onClick:function(c){xg.shared.editors.tinymce.LinkDialog(b,c).show()}},{text:xg.shared.nls.text("delete"),onClick:function(c){a.dom.remove(c[0]);a.undoManager.add();a.getWin().focus()}}],onShow:function(c,e){c=xg.shared.nls.text("linkColon")+" "+d.excerpt(c.attr("href"),20);e.find(".dy-content").prepend(xg.qh(c))}}).addTo(a)};
d.addImageToolbar=function(b,a){xg.shared.editors.tinymce.InlineToolbar({selector:"img:not(.mceItemFlash)",links:[{text:xg.shared.nls.text("edit"),onClick:function(c){xg.shared.editors.tinymce.ImageDialog(b,c,xg.uploadsDisabled||g.isMaxFileUploadCountReached(b)).show()}},{text:xg.shared.nls.text("delete"),onClick:function(c){c.parent("a").length?a.dom.remove(c.parent("a")[0]):a.dom.remove(c[0]);a.undoManager.add();a.getWin().focus()}},{text:xg.shared.nls.text("ROTATE"),onClick:function(c){xg.shared.RotateImage.setUpRotate(c[0]);
xg.shared.RotateImage.urlToBase64(c[0]).then(function(e){e.src=xg.shared.RotateImage.rotate("",e);xg.shared.RotateImage.put(e.id,e.src);h.$img=x$(e)})}}],onShow:function(c,e){c=xg.shared.nls.text("imageColon");e.find(".dy-content").prepend(xg.qh(c)+" ")}}).addTo(a)};d.urlToBase64=function(b){if("1"===b.getAttribute("data-base64_encoded"))return new Promise(function(c){return c(b)});var a=b.getAttribute("data-src");a=a.slice(0,a.indexOf("?"));a=xg.shared.util.addParameter(a,"profile","original");return xg.shared.RotateImage.toDataURL(a).then(function(c){b.src=
c.base64;b.setAttribute("data-base64_encoded","1");return b})};d.excerpt=function(b,a){return b&&b.length>a?b.substring(0,a-1)+"\u2026":b};d.addControls=function(b,a){b.onBeforeRenderUI.add(function(c){c.controlManager=new tinymce.ControlManager(c);var e=c.controlManager.createControl;c.controlManager.createControl=function(f){return a[f]?a[f]:e.call(c.controlManager,f)}})};d.createTinyMCELabelClass=function(){tinymce.create("xg.shared.editors.tinymce.TinyMCELabel:tinymce.ui.Control",{TinyMCELabel:function(b,
a){this.parent(b,a)},renderHTML:function(){return'\x3cspan class\x3d"xg_label"\x3e'+xg.qh(this.settings.text)+"\x3c/span\x3e"}})};d.setupTheme=function(b,a){d.addOnInitHandler(a,function(){x$(a.getDoc()).find("body").addClass(b.attr("_themeType"))})};d.setupDefaultFont=function(b,a){try{var c=x$("\x3cp\x3e\x3c/p\x3e").insertAfter(b),e="font-size: "+b.attr("_fontSize")+" !important;";c.css("font-family")&&(e+="font-family:"+c.css("font-family")+" !important;");c.remove();d.addOnInitHandler(a,function(){x$(a.getDoc()).find("head").append('\x3cstyle type\x3d"text/css"\x3ebody, td, pre {'+
e+"} p, ol, ul, dl, blockquote, table, h1, h2, h3, h4, h5, h6 { margin-bottom: "+b.attr("_pMarginBottom")+"; } p { margin-top: 0; }\x3c/style\x3e")});a.onPostRender.add(function(f,k){x$(f.getContainer()).find(".mceColorPreview").css("background-color","#000000")})}catch(f){}};d.setupIndentAndOutdent=function(b,a){a.onKeyDown.add(function(c,e){if(($node=x$(a.selection.getNode()))&&0!=xg.shared.util.closest($node,"li").length&&(e.keyCode?code=e.keyCode:e.which&&(code=e.which),9==code&&!e.altKey&&!e.ctrlKey))return e.shiftKey?
c.execCommand("Outdent"):c.execCommand("Indent"),e.preventDefault&&e.preventDefault(),!1})};d.monitorFileUploadCount=function(b,a){var c=xg.shared.util.createQuiescenceTimer(1E3,function(){d.checkFileUploadCount(b)});a.onKeyUp.add(c.trigger);a.onPaste.add(c.trigger);a.onChange.add(c.trigger);d.addOnInitHandler(a,function(){d.checkFileUploadCount(b)})};d.checkFileUploadCount=function(b){var a=g.isMaxFileUploadCountReached(b),c=g.getEditor(b);c&&(c.controlManager.setDisabled("customfile",a),a?x$(c.getContainer()).find("a.icon-file").addClass("disabled"):
x$(c.getContainer()).find("a.icon-file").removeClass("disabled"));m(!a,b)};return h});dojo.hostenv.findModule("xg.shared.editors.tinymce.HtmlToolbar",!1)||(dojo.provide("xg.shared.editors.tinymce.HtmlToolbar"),xg.shared.editors.tinymce.HtmlToolbar=function(m){var l={},b={},h,g=m.textarea,n;b.initialize=function(){window.tinyMCE&&tinyMCE.onAddEditor.add(function(a,c){b.closeAllDropDowns()})};l.getElement=function(a){h||(h=b.createElement(),n=h.find(".mceToolbarEnd"),l.updateWidth(),b.addButtons(m.buttons.split(",")));return h};l.updateWidth=function(){g.is(":visible")&&g.width()?h.find(".mceLayout").width(g.width()+
4):h.find(".mceLayout").css("width","100%")};l.setColor=function(a){h.find(".mceColorPreview").css("background-color",a)};l.setFileButtonEnabled=function(a){a?h.find(".mce_file").addClass("mceButtonEnabled").removeClass("mceButtonDisabled"):h.find(".mce_file").addClass("mceButtonDisabled").removeClass("mceButtonEnabled")};b.createElement=function(){return x$(' \x3cspan class\x3d"html_editor_toolbar defaultSkin" style\x3d"display:none"\x3e     \x3ctable cellspacing\x3d"0" cellpadding\x3d"0" class\x3d"mceLayout"\x3e         \x3ctbody\x3e             \x3ctr class\x3d"mceFirst mceLast"\x3e                 \x3ctd class\x3d"mceToolbar mceLeft mceFirst mceLast"\x3e                     \x3ctable cellspacing\x3d"0" cellpadding\x3d"0" align\x3d"" class\x3d"mceToolbar mceToolbarRow1 Enabled"\x3e                         \x3ctbody\x3e                             \x3ctr\x3e                                 \x3ctd class\x3d"mceToolbarStart mceToolbarStartListBox mceFirst"\x3e\x3cspan\x3e\x3c!-- IE --\x3e\x3c/span\x3e\x3c/td\x3e                                 \x3ctd class\x3d"mceToolbarEnd mceToolbarEndButton mceLast"\x3e\x3cspan\x3e\x3c!-- IE --\x3e\x3c/span\x3e\x3c/td\x3e                             \x3c/tr\x3e                         \x3c/tbody\x3e                     \x3c/table\x3e                 \x3c/td\x3e             \x3c/tr\x3e         \x3c/tbody\x3e     \x3c/table\x3e \x3c/span\x3e')};
b.addButton=function(a){var c=x$('\x3ca href\x3d"#" class\x3d"mceButton mceButtonEnabled"/\x3e').attr("title",a.tooltip).addClass(a["class"]),d=x$('\x3cspan class\x3d"mceIcon"/\x3e').addClass(a["class"]);c.click(function(k){k.preventDefault();c.hasClass("mceButtonDisabled")||(a.onClick(c,xg.shared.editors.tinymce.Utilities.saveSelection(g)),g.focus())});n.before(x$("\x3ctd/\x3e").append(c.append(d)))};b.addFontDropDown=function(){b.addDropDown({tooltip:xg.shared.nls.text("font"),onSelect:function(a,
c,d){b.overwriteSelection('\x3cspan style\x3d"font-family: '+xg.qh(c)+';"\x3e'+a+"\x3c/span\x3e");b.excludeOuterTagsFromSelection()},dropDownClass:"mceListBox mceListBoxEnabled mce_fontselect",dropDownFirstLink:x$('\x3ca class\x3d"mceText mceTitle" href\x3d"#"\x3e'+xg.shared.nls.html("font")+"\x3c/a\x3e"),dropDownSecondLink:x$('\x3ca class\x3d"mceOpen" href\x3d"#"\x3e\x3cspan\x3e\x3c/span\x3e\x3c/a\x3e'),dropDownSelectedClass:"mceListBoxSelected",listClass:"mceListBoxMenu mceNoIcons defaultSkin",
listDivClass:"mceMenu mceListBoxMenu mceNoIcons defaultSkin",listTableClass:"",listTableRows:x$(x$.map(m.fonts.split(";"),function(a){a=a.split("\x3d");return x$('\x3ctr class\x3d"mceMenuItem mceMenuItemEnabled"\x3e\x3ctd\x3e\x3ca href\x3d"#" _value\x3d"'+xg.qh(a[1])+'"\x3e\x3cspan class\x3d"mceIcon"\x3e\x3c/span\x3e\x3cspan class\x3d"mceText" title\x3d"'+xg.qh(a[0])+'" style\x3d"font-family: '+xg.qh(a[1])+';"\x3e'+xg.qh(a[0])+"\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e")[0]})),listWidth:120,listHeight:150})};
b.addFontSizeDropDown=function(){b.addDropDown({tooltip:xg.shared.nls.text("size"),onSelect:function(a,c,d){c=g.data("htmlCapability").getAttributeForFontSize(c);b.overwriteSelection("\x3cspan "+c[0]+'\x3d"'+c[1]+'"\x3e'+a+"\x3c/span\x3e");b.excludeOuterTagsFromSelection()},dropDownClass:"mceListBox mceListBoxEnabled mce_fontsizeselect",dropDownFirstLink:x$('\x3ca class\x3d"mceText mceTitle" href\x3d"#"\x3e'+xg.shared.nls.html("size")+"\x3c/a\x3e"),dropDownSecondLink:x$('\x3ca class\x3d"mceOpen" href\x3d"#"\x3e\x3cspan\x3e\x3c/span\x3e\x3c/a\x3e'),
dropDownSelectedClass:"mceListBoxSelected",listClass:"mceListBoxMenu mceNoIcons defaultSkin",listDivClass:"mceMenu mceListBoxMenu mceNoIcons defaultSkin",listTableClass:"",listTableRows:x$(x$.map([["1 (8pt)","1"],["2 (10pt)","2"],["3 (12pt)","3"],["4 (14pt)","4"],["5 (16pt)","5"],["6 (20pt)","6"],["7 (24pt)","7"]],function(a){return x$('\x3ctr class\x3d"mceMenuItem mceMenuItemEnabled"\x3e\x3ctd\x3e\x3ca href\x3d"#" _value\x3d"'+xg.qh(a[1])+'"\x3e\x3cspan class\x3d"mceIcon"\x3e\x3c/span\x3e\x3cspan class\x3d"mceText font-size-'+
a[1]+'" title\x3d"'+xg.qh(a[0])+'"\x3e'+xg.qh(a[0])+"\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e")[0]})),listWidth:150,listHeight:150})};b.addFontColorDropDown=function(){b.addDropDown({tooltip:xg.shared.nls.text("color"),onSelect:function(a,c,d){b.overwriteSelection('\x3cspan style\x3d"color: '+xg.qh(c)+';"\x3e'+a+"\x3c/span\x3e");b.excludeOuterTagsFromSelection();d.find(".mceColorPreview").css("background-color",c)},dropDownClass:"mceSplitButton mceSplitButtonEnabled mce_forecolor",dropDownFirstLink:x$('\x3ca class\x3d"mceAction mce_forecolor" href\x3d"#" title\x3d"'+
xg.shared.nls.html("color")+'"\x3e\x3cspan class\x3d"mceAction mce_forecolor"\x3e\x3c/span\x3e\x3cdiv class\x3d"mceColorPreview" style\x3d"background-color: #000000;"\x3e\x3c/div\x3e\x3c/a\x3e'),dropDownSecondLink:x$('\x3ca class\x3d"mceOpen mce_forecolor" href\x3d"#" title\x3d"'+xg.shared.nls.html("color")+'"\x3e\x3cspan class\x3d"mceOpen mce_forecolor"\x3e\x3c/span\x3e\x3c/a\x3e'),dropDownSelectedClass:"mceSplitButtonSelected",listClass:"defaultSkin mce_forecolor",listDivClass:"mce_forecolor mceSplitButtonMenu mceColorSplitMenu",
listTableClass:"mceColorSplitMenu",listTableRows:x$(x$.map(["000000 993300 333300 003300 003366 000080 333399 333333".split(" "),"800000 FF6600 808000 008000 008080 0000FF 666699 808080".split(" "),"FF0000 FF9900 99CC00 339966 33CCCC 3366FF 800080 999999".split(" "),"FF00FF FFCC00 FFFF00 00FF00 00FFFF 00CCFF 993366 C0C0C0".split(" "),"FF99CC FFCC99 FFFF99 CCFFCC CCFFFF 99CCFF CC99FF FFFFFF".split(" ")],function(a){return x$("\x3ctr\x3e"+x$.map(a,function(c){return'\x3ctd\x3e\x3ca href\x3d"#" style\x3d"background-color: #'+
c+';" _value\x3d"#'+c+'"\x3e\x3c/a\x3e\x3c/td\x3e'}).join("")+"\x3c/tr\x3e")[0]}))})};b.addDropDown=function(a){var c=x$(' \x3ctd\x3e     \x3ctable cellspacing\x3d"0" cellpadding\x3d"0" class\x3d"'+a.dropDownClass+'" title\x3d"'+xg.qh(a.tooltip)+'"\x3e         \x3ctbody\x3e             \x3ctr\x3e                 \x3ctd class\x3d"mceFirst"\x3e\x3c/td\x3e                 \x3ctd class\x3d"mceLast"\x3e\x3c/td\x3e             \x3c/tr\x3e         \x3c/tbody\x3e     \x3c/table\x3e \x3c/td\x3e');c.find(".mceFirst").append(a.dropDownFirstLink);
c.find(".mceLast").append(a.dropDownSecondLink);var d=x$(' \x3cdiv class\x3d"xj_drop_down_list '+a.listClass+'" style\x3d"position: absolute; z-index: 200000;"\x3e     \x3cdiv class\x3d"'+a.listDivClass+'"\x3e         \x3cspan class\x3d"mceMenuLine"\x3e\x3c/span\x3e         \x3ctable class\x3d"'+a.listTableClass+'" cellspacing\x3d"0" cellpadding\x3d"0" border\x3d"0"\x3e             \x3ctbody\x3e             \x3c/tbody\x3e         \x3c/table\x3e     \x3c/div\x3e \x3c/div\x3e');a.listWidth&&d.add(d.children()).css("width",
a.listWidth+"px");a.listHeight&&d.add(d.children()).css("height",a.listHeight+"px");d.find("tbody").append(a.listTableRows);var k=!1;c.find("a").click(function(e){e.preventDefault();if(c.find("table").hasClass(a.dropDownSelectedClass))b.closeAllDropDowns();else{c.find("table").addClass(a.dropDownSelectedClass);k||(d.appendTo(document.body),k=!0);d.show();e=d.offset();var f=c.offset(),p=d.position();d.css("left",p.left+f.left-e.left+"px");d.css("top",p.top+f.top-e.top+c.height()+"px")}});d.find("a").click(function(e){e.preventDefault();
e=xg.shared.editors.tinymce.Utilities.saveSelection(g);a.onSelect(e,x$(this).attr("_value"),c);b.closeAllDropDowns();g.focus()});g.click(function(e){b.closeAllDropDowns()});n.before(c)};b.closeAllDropDowns=function(){h.find(".mceListBoxSelected").removeClass("mceListBoxSelected");h.find(".mceSplitButtonSelected").removeClass("mceSplitButtonSelected");x$(".xj_drop_down_list").hide()};b.addSeparator=function(){n.before('\x3ctd\x3e\x3cspan class\x3d"mceSeparator"\x3e\x3c/span\x3e\x3c/td\x3e')};b.addButtons=
function(a){var c="|";x$.each(a,function(d,k){if(k!==c){d=!0;switch(k){case "|":b.addSeparator();break;case "customlink":b.addButton({tooltip:xg.shared.nls.text("link"),"class":"mce_link",onClick:function(e,f){xg.shared.editors.tinymce.LinkDialog(g).show()}});break;case "customimage":b.addButton({tooltip:xg.shared.nls.text("image"),"class":"mce_image",onClick:function(e,f){xg.shared.editors.tinymce.ImageDialog(g).show()}});break;case "custommedia":b.addButton({tooltip:xg.shared.nls.text("media"),
"class":"mce_media",onClick:function(e,f){xg.shared.editors.tinymce.MediaDialog(g).show()}});break;case "custompastetext":b.addButton({tooltip:xg.shared.nls.text("pasteText"),"class":"mce_pastetext",onClick:function(e,f){xg.shared.editors.tinymce.PasteTextDialog(g).show()}});break;case "customfile":b.addButton({tooltip:xg.shared.nls.text("file"),"class":"mce_file",onClick:function(e,f){xg.shared.editors.tinymce.FileDialog(g).show()}});break;case "fontselect":b.addFontDropDown();break;case "fontsizeselect":b.addFontSizeDropDown();
break;case "forecolor":b.addFontColorDropDown();break;case "bold":b.addButton({tooltip:xg.shared.nls.text("bold"),"class":"mce_bold",onClick:function(e,f){b.onClickTagButton(e,f,"\x3cstrong\x3e","\x3c/strong\x3e")}});break;case "italic":b.addButton({tooltip:xg.shared.nls.text("italic"),"class":"mce_italic",onClick:function(e,f){b.onClickTagButton(e,f,"\x3cem\x3e","\x3c/em\x3e")}});break;case "strikethrough":b.addButton({tooltip:xg.shared.nls.text("strikethrough"),"class":"mce_strikethrough",onClick:function(e,
f){b.onClickTagButton(e,f,'\x3cspan style\x3d"text-decoration: line-through;"\x3e',"\x3c/span\x3e")}});break;case "underline":b.addButton({tooltip:xg.shared.nls.text("underline"),"class":"mce_underline",onClick:function(e,f){b.onClickTagButton(e,f,'\x3cspan style\x3d"text-decoration: underline;"\x3e',"\x3c/span\x3e")}});break;case "justifyleft":b.addButton({tooltip:xg.shared.nls.text("left"),"class":"mce_justifyleft",onClick:function(e,f){b.onClickTagButton(e,f,g.data("htmlCapability").startParagraph("left"),
"\x3c/p\x3e\n")}});break;case "justifycenter":b.addButton({tooltip:xg.shared.nls.text("center"),"class":"mce_justifycenter",onClick:function(e,f){b.onClickTagButton(e,f,g.data("htmlCapability").startParagraph("center"),"\x3c/p\x3e\n")}});break;case "justifyright":b.addButton({tooltip:xg.shared.nls.text("right"),"class":"mce_justifyright",onClick:function(e,f){b.onClickTagButton(e,f,g.data("htmlCapability").startParagraph("right"),"\x3c/p\x3e\n")}});break;case "blockquote":b.addButton({tooltip:xg.shared.nls.text("blockquote"),
"class":"mce_blockquote",onClick:function(e,f){b.onClickTagButton(e,f,"\x3cblockquote\x3e","\x3c/blockquote\x3e\n")}});break;case "bullist":b.addButton({tooltip:xg.shared.nls.text("unorderedList"),"class":"mce_bullist",onClick:function(e,f){b.onClickTagButton(e,f,"\x3cul\x3e\n\x3cli\x3e","\x3c/li\x3e\n\x3c/ul\x3e\n")}});break;case "numlist":b.addButton({tooltip:xg.shared.nls.text("orderedList"),"class":"mce_numlist",onClick:function(e,f){b.onClickTagButton(e,f,"\x3col\x3e\n\x3cli\x3e","\x3c/li\x3e\n\x3c/ol\x3e\n")}});
break;case "removeformat":b.addButton({tooltip:xg.shared.nls.text("removeFormatting"),"class":"mce_removeformat",onClick:function(e,f){f&&b.overwriteSelection(f.replace(/<[^<]*>/g,""))}});break;case "customcode":b.addButton({tooltip:xg.shared.nls.text("returnToVisualMode"),"class":"mce_code mceButtonActive",onClick:function(){h.find(".mceButtonActive:not(.mce_code)").removeClass("mceButtonActive");m.onClickHtmlButton()}});break;default:d=!1}d&&(c=k)}});h.find("a.mceButton").click(function(d){d.preventDefault();
b.closeAllDropDowns()})};b.onClickTagButton=function(a,c,d,k){b.overwriteSelection(d+c+k);b.excludeOuterTagsFromSelection()};b.overwriteSelection=function(a,c){xg.shared.editors.tinymce.Utilities.overwriteSelection(g,a,c)};b.excludeOuterTagsFromSelection=function(){var a=xg.shared.editors.tinymce.Utilities.saveSelection(g);document.selection&&(a=a.replace(/\r/g,""));var c=a.indexOf("\x3e");a=a.lastIndexOf("\x3c");if(!(-1===c||-1===a||c>a))try{var d=b.getSelectionIndices();if(document.selection){var k=
g[0].value.substring(0,d.start).replace(/[^\r]/g,"").length;d.start-=k}d.end=d.start+a;d.start=d.start+c+1;d.start>d.end||b.setSelectionIndices(d)}catch(e){}};b.getSelectionIndices=function(){if(document.selection){var a=document.selection.createRange().duplicate(),c=a.duplicate();c.moveToElementText(g[0]);c.setEndPoint("EndToEnd",a);return{start:c.text.length-a.text.length,end:c.text.length}}return{start:g[0].selectionStart,end:g[0].selectionEnd}};b.setSelectionIndices=function(a){if(document.selection){var c=
g[0].createTextRange();c.collapse(!0);c.moveStart("character",a.start);c.moveEnd("character",a.end-a.start);c.select()}else g[0].selectionStart=a.start,g[0].selectionEnd=a.end};b.initialize();return l});dojo.hostenv.findModule("xg.shared.editors.tinymce.HtmlDragbar",!1)||(dojo.provide("xg.shared.editors.tinymce.HtmlDragbar"),xg.shared.editors.tinymce.HtmlDragbar=function(k){var e={},a={},c,f,d=k.textarea,g=0;e.getElement=function(b){c||(c=a.createElement(),e.updateWidth());return c};e.updateWidth=function(){d.is(":visible")&&d.width()?c.find(".mceLayout").width(d.width()+4):c.find(".mceLayout").css("width","100%")};a.createElement=function(){var b=x$(' \x3cspan class\x3d"html_editor_dragbar defaultSkin" style\x3d"display:none"\x3e     \x3ctable cellspacing\x3d"0" cellpadding\x3d"0" class\x3d"mceLayout"\x3e         \x3ctbody\x3e             \x3ctr class\x3d"mceLast"\x3e                 \x3ctd class\x3d"mceStatusbar mceFirst mceLast"\x3e                     \x3cdiv\x3e                         \x26nbsp;\x3ca href\x3d"#" accesskey\x3d"x"\x3e\x3c/a\x3e                     \x3c/div\x3e                     \x3ca href\x3d"javascript:;" onclick\x3d"return false;" class\x3d"mceResize"\x3e\x3c/a\x3e                 \x3c/td\x3e             \x3c/tr\x3e         \x3c/tbody\x3e     \x3c/table\x3e \x3c/span\x3e');
f=b.find(".mceResize");f.bind("mousedown",function(h){h.preventDefault();g=h.pageY-f.offset().top;x$("body").bind("mousemove",a.drag);x$("body").bind("mouseup",a.release)});return b};a.drag=function(b){b=b.pageY-f.offset().top-g;d.height(Math.max(100,d.height()+b))};a.release=function(b){x$("body").unbind("mousemove",a.drag);x$("body").unbind("mouseup",a.release)};return e});dojo.hostenv.findModule("xg.shared.editors.tinymce.HtmlEditorConfig",!1)||(dojo.provide("xg.shared.editors.tinymce.HtmlEditorConfig"),xg.shared.editors.tinymce.HtmlEditorConfig=function(e,f,g,l){var d={},c={},h=xg.shared.editors.tinymce.Utilities;d.initializeTextareas=function(){x$("textarea.wysiwyg-mce-editor, textarea.html-mce-editor").each(function(a,b){d.initializeTextareaIfNecessary(x$(b))});window.tinyMCE&&tinyMCE.DOM.loadCSS(tinyMCE.baseURI.toAbsolute(xg.shared.util.cdn("/xn_resources/widgets/shared/css/editors/tinymce/ui.css",
!0)))};d.initializeTextareaIfNecessary=function(a){a.data("xj_html_editor_config_initialized")||(c.addHtmlEditorToolbar(a,a.data("buttons"),e),c.addHtmlEditorDragbar(a),c.monitorFileUploadCount(a),a.data("xj_html_editor_config_initialized",!0))};c.addHtmlEditorToolbar=function(a,b,k){b=xg.shared.editors.tinymce.HtmlToolbar({textarea:a,onClickHtmlButton:function(){f(a)},buttons:b,fonts:k});a.before(b.getElement());a.data("xj_html_toolbar",b)};c.addHtmlEditorDragbar=function(a){var b=xg.shared.editors.tinymce.HtmlDragbar({textarea:a});
a.after(b.getElement());a.data("xj_html_dragbar",b)};c.monitorFileUploadCount=function(a){var b=xg.shared.util.createQuiescenceTimer(1E3,function(){c.checkFileUploadCount(a)});a.bind("keypress cut paste change",b.trigger)};c.checkFileUploadCount=function(a){var b=h.isMaxFileUploadCountReached(a);a.data("xj_html_toolbar").setFileButtonEnabled(!b);g(!b,a)};return d});dojo.hostenv.findModule("xg.shared.editors.tinymce.EmailHtmlCapability",!1)||(dojo.provide("xg.shared.editors.tinymce.EmailHtmlCapability"),xg.shared.editors.tinymce.EmailHtmlCapability=function(){var b={},c={initialize:function(){}};b.configureAlignmentFormats=function(a){a.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,img",attributes:{align:"left"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,img",attributes:{align:"right"}}]})};b.beforeAlign=
function(a){};b.supportsCenterAlignment=function(){return!1};b.getAlignment=function(a){return"left"===a.attr("align").toLowerCase()?"left":"right"===a.attr("align").toLowerCase()?"right":"full"};b.setAlignment=function(a,d){switch(d){case "left":a.attr("align","left");break;case "right":a.attr("align","right")}};b.startParagraph=function(a){switch(a){case "left":return'\x3cp align\x3d"left"\x3e';case "center":return'\x3cp align\x3d"center"\x3e';case "right":return'\x3cp align\x3d"right"\x3e';default:return"\x3cp\x3e"}};
b.setupFontSizes=function(a){a.theme_advanced_font_sizes={"1 (8pt)":{fontSize:"8pt"},"2 (10pt)":{fontSize:"10pt"},"3 (12pt)":{fontSize:"12pt"},"4 (14pt)":{fontSize:"14pt"},"5 (16pt)":{fontSize:"16pt"},"6 (20pt)":{fontSize:"20pt"},"7 (24pt)":{fontSize:"24pt"}}};b.getAttributeForFontSize=function(a){return["style","font-size:"+{1:"8pt",2:"10pt",3:"12pt",4:"14pt",5:"16pt",6:"20pt",7:"24pt"}[a]]};b.shouldLinkImagesByDefault=function(){return!1};xg.addOnRequire(function(){c.initialize()});return b}());dojo.hostenv.findModule("xg.shared.editors.tinymce.StandardHtmlCapability",!1)||(dojo.provide("xg.shared.editors.tinymce.StandardHtmlCapability"),xg.shared.editors.tinymce.StandardHtmlCapability=function(){var b={},c={initialize:function(){}};b.configureAlignmentFormats=function(a){a.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img",classes:"align-full"},{selector:"table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",
styles:{textAlign:"center"}},{selector:"img",classes:"align-center"},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img",classes:"align-right"},{selector:"table",styles:{"float":"right"}}]})};b.beforeAlign=function(a){a.formatter.remove("alignleftproper")};b.supportsCenterAlignment=function(){return!0};b.getAlignment=function(a){return a.hasClass("align-left")?"left":a.hasClass("align-center")?
"center":a.hasClass("align-right")?"right":"full"};b.setAlignment=function(a,d){switch(d){case "left":a.addClass("align-left");break;case "center":a.addClass("align-center");break;case "right":a.addClass("align-right");break;default:a.addClass("align-full")}};b.startParagraph=function(a){switch(a){case "left":return'\x3cp style\x3d"text-align: left;"\x3e';case "center":return'\x3cp style\x3d"text-align: center;"\x3e';case "right":return'\x3cp style\x3d"text-align: right;"\x3e';default:return"\x3cp\x3e"}};
b.setupFontSizes=function(a){a.theme_advanced_font_sizes={"1 (8pt)":{fontSize:"8pt","class":"font-size-1"},"2 (10pt)":{fontSize:"10pt","class":"font-size-2"},"3 (12pt)":{fontSize:"12pt","class":"font-size-3"},"4 (14pt)":{fontSize:"14pt","class":"font-size-4"},"5 (16pt)":{fontSize:"16pt","class":"font-size-5"},"6 (20pt)":{fontSize:"20pt","class":"font-size-6"},"7 (24pt)":{fontSize:"24pt","class":"font-size-7"}}};b.getAttributeForFontSize=function(a){return["class","font-size-"+a]};b.shouldLinkImagesByDefault=
function(){return!0};xg.addOnRequire(function(){c.initialize()});return b}());dojo.hostenv.findModule("xg.shared.EventRegistry",!1)||(dojo.provide("xg.shared.EventRegistry"),xg.shared.EventRegistry=function(){var e={};var d={};e.fire=function(a,c){if(a=d[a]){var b=[];x$.each(a,function(f,g){b.push(g(c))});return b}};e.listen=function(a,c){d[a]||(d[a]=[]);d[a].push(c)};e.listenMultiple=function(a){x$.each(a,function(c,b){e.listen(c,b)})};e.unlisten=function(a,c){var b=d[a];b&&(d[a]=x$.grep(b,function(f,g){return f!==c}))};e.listenOnce=function(a,c){if(d[a])for(var b=0;b<d[a].length;b++)if(d[a][b]+
""===c+"")return;e.listen(a,c)};return e}());dojo.hostenv.findModule("xg.shared.editors.tinymce.TinyMCE",!1)||(dojo.provide("xg.shared.editors.tinymce.TinyMCE"),xg.shared.editors.tinymce.TinyMCE=function(h){var e={},c={},f=xg.shared.editors.tinymce.Utilities,g,k;c.initialize=function(){x$("head").append("\x3cstyle type\x3d'text/css'\x3e.mceToolbar {display: none}\x3c/style\x3e");c.cancelTinyMceIfTinyMceNotLoaded();g=xg.shared.editors.tinymce.HtmlEditorConfig("Andale Mono\x3dandale mono,times;Arial\x3darial,helvetica,sans-serif;Arial Black\x3darial black,avant garde;Book Antiqua\x3dbook antiqua,palatino;Comic Sans MS\x3dcomic sans ms,sans-serif;Courier New\x3dcourier new,courier;Georgia\x3dgeorgia,palatino;Helvetica\x3dhelvetica;Impact\x3dimpact,chicago;Tahoma\x3dtahoma,arial,helvetica,sans-serif;Terminal\x3dterminal,monaco;Times New Roman\x3dtimes new roman,times;Trebuchet MS\x3dtrebuchet ms,geneva;Verdana\x3dverdana,geneva",
e.showWysiwygEditor,c.setFileButtonEnabled,h);k=xg.shared.editors.tinymce.WysiwygEditorConfig("Andale Mono\x3dandale mono,times;Arial\x3darial,helvetica,sans-serif;Arial Black\x3darial black,avant garde;Book Antiqua\x3dbook antiqua,palatino;Comic Sans MS\x3dcomic sans ms,sans-serif;Courier New\x3dcourier new,courier;Georgia\x3dgeorgia,palatino;Helvetica\x3dhelvetica;Impact\x3dimpact,chicago;Tahoma\x3dtahoma,arial,helvetica,sans-serif;Terminal\x3dterminal,monaco;Times New Roman\x3dtimes new roman,times;Trebuchet MS\x3dtrebuchet ms,geneva;Verdana\x3dverdana,geneva",
e.showHtmlEditor,c.setFileButtonEnabled,c.createIconBar,h);c.initializeTextareas();g.initializeTextareas();k.initializeTextareas();x$("textarea.html-mce-editor").each(function(a,b){e.showHtmlEditor(x$(b))})};c.cancelTinyMceIfTinyMceNotLoaded=function(){window.tinymce||(x$("textarea.wysiwyg-mce-editor").each(function(a,b){x$(b).removeClass("wysiwyg-mce-editor").addClass("html-mce-editor")}),x$("textarea.wysiwyg-mce-editor").each(function(a,b){x$(b).removeClass("deferred-wysiwyg-mce-editor").addClass("deferred-html-mce-editor")}))};
e.reinitialize=function(){x$("textarea.wysiwyg-mce-editor, textarea.html-mce-editor").each(function(a,b){$textarea=x$(b);parentDiv=$textarea.parent();console.log();parentDiv.attr("backup")&&parentDiv.html(parentDiv.attr("backup"))});c.initialize()};c.initializeTextareas=function(){x$("textarea.wysiwyg-mce-editor, textarea.html-mce-editor").each(function(a,b){a=x$(b);b=a.parent();b.attr("backup")||b.attr("backup",b.html());c.initializeTextareaIfNecessary(a)})};c.initializeTextareaIfNecessary=function(a){a.data("xj_tinymce_prerequisites_initialized")||
(a.data("htmlCapability",a.attr("_forEmail")?xg.shared.editors.tinymce.EmailHtmlCapability:xg.shared.editors.tinymce.StandardHtmlCapability),a.data("buttons",c.determineButtons(a,a.data("htmlCapability"))),f.addIdIfNecessary(a),a.parent().hasClass("full-editor")&&(c.addUpperTabs(a),c.addUpperIconBar(a)),a.data("xj_tinymce_prerequisites_initialized",!0))};c.addUpperTabs=function(a){var b=x$('\x3cul class\x3d"mce-tabs" style\x3d"display:none"\x3e\x3cli\x3e\x3ca href\x3d"#"\x3e'+xg.shared.nls.text("visualMode")+
'\x3c/a\x3e\x3c/li\x3e\x3cli\x3e\x3ca href\x3d"#"\x3e'+xg.shared.nls.text("htmlEditor")+'\x3c/a\x3e\x3c/li\x3e\x3c/ul\x3e\x3cdiv class\x3d"mce-icon-row-empty"\x3e\x26nbsp;\x3c/div\x3e');a.hasClass("html-mce-editor")||a.hasClass("deferred-html-mce-editor")?b.find("li:nth(1)").addClass("this"):b.find("li:nth(0)").addClass("this");b.find("a:nth(0)").click(function(d){d.preventDefault();a.parent().hasClass("disabled")||(b.find("li:nth(1)").removeClass("this"),b.find("li:nth(0)").addClass("this"),e.showWysiwygEditor(a))});
b.find("a:nth(1)").click(function(d){d.preventDefault();a.parent().hasClass("disabled")||(b.find("li:nth(0)").removeClass("this"),b.find("li:nth(1)").addClass("this"),e.showHtmlEditor(a))});"0"===a.attr("_wysiwygModeEnabled")&&b.css("visibility","hidden");a.before(b)};e.showWysiwygEditor=function(a){a.removeClass("deferred-wysiwyg-mce-editor html-mce-editor deferred-html-mce-editor").addClass("wysiwyg-mce-editor");c.initializeTextareaIfNecessary(a);g.initializeTextareaIfNecessary(a);f.getEditor(a)||
(c.hideToolbarIfLiquidLayout(a),a.val(f.adjustLineBreaksEnteredInHtmlMode(a)),tinyMCE.execCommand("mceAddEditor",!1,a.attr("id")));a.parents(".texteditor:first").find(".html_editor_toolbar").hide();a.parents(".texteditor:first").find(".html_editor_dragbar").hide();a.parents(".texteditor:first").find("span.mce-icon-row").hide();a.parents(".texteditor:first").find("div.mce-icon-row-empty").show();xg.shared.EventRegistry.fire("xg.shared.editors.tinymce.TinyMCE.wysiwygEditorShown")};e.showHtmlEditor=
function(a){a.removeClass("wysiwyg-mce-editor deferred-wysiwyg-mce-editor deferred-html-mce-editor").addClass("html-mce-editor");c.initializeTextareaIfNecessary(a);g.initializeTextareaIfNecessary(a);f.getEditor(a)&&(c.updateHtmlEditorHeight(a),tinyMCE.execCommand("mceRemoveEditor",!1,a.attr("id")),a.focus(),a.val(f.adjustLineBreaksEnteredInVisualMode(a)));a.parents(".texteditor:first").find(".html_editor_toolbar").show();a.parents(".texteditor:first").find(".html_editor_dragbar").show();a.parents(".texteditor:first").find("span.mce-icon-row").show();
a.parents(".texteditor:first").find("div.mce-icon-row-empty").hide();f.updateLiquidLayout(a);xg.shared.EventRegistry.fire("xg.shared.editors.tinymce.TinyMCE.htmlEditorShown")};c.hideToolbarIfLiquidLayout=function(a){a.parent().hasClass("ultracompact-editor")&&a.parent().addClass("uninitialized-liquid-layout")};c.determineButtons=function(a,b){var d=a.parent().hasClass("full-editor")?",fontsizeselect,|,bold,italic,strikethrough,underline,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,removeformat,|,fullscreen":
",customlink,customimage,custommedia,custompastetext,customfile,|,bold,italic,strikethrough,underline,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,customcode";if(xg.uploadsDisabled||a.attr("_hideFileUploadButton"))d=d.replace(/,customfile/,"");b.supportsCenterAlignment()||(d=d.replace(/,justifycenter/,""));"0"===a.attr("_wysiwygModeEnabled")&&(d=d.replace(/,customcode/,""));"0"===a.attr("_showFormattingDropDowns")&&(d=d.replace(/,(fontselect|fontsizeselect|forecolor)/g,""));"0"===
a.attr("_showFormattingButtons")&&(d=d.replace(/,(bold|italic|strikethrough|underline|justifyleft|justifycenter|justifyright|blockquote|bullist|numlist|removeformat)/g,""));return d=d.replace(/(,\|)+/g,",|").replace(/^,|,$/g,"").replace(/^\||\|$/g,"")};c.addUpperIconBar=function(a){$iconBar=c.createIconBar(a);a.before($iconBar);a.data("xj_upper_icon_bar",$iconBar)};c.createIconBar=function(a){var b=x$('\x3cspan class\x3d"mce-icon-row" style\x3d"display:none"\x3e'+xg.shared.nls.html("addColon")+' \x3ca href\x3d"#" class\x3d"icon-link" title\x3d"'+
xg.shared.nls.html("link")+'"\x3e'+xg.shared.nls.html("link")+'\x3c/a\x3e \x3ca href\x3d"#" class\x3d"icon-image" title\x3d"'+xg.shared.nls.html("image")+'"\x3e'+xg.shared.nls.html("image")+'\x3c/a\x3e \x3ca href\x3d"#" class\x3d"icon-media" title\x3d"'+xg.shared.nls.html("media")+'"\x3e'+xg.shared.nls.html("media")+'\x3c/a\x3e \x3ca href\x3d"#" class\x3d"icon-pastetext" title\x3d"'+xg.shared.nls.html("pasteText")+'"\x3e'+xg.shared.nls.html("pasteText")+'\x3c/a\x3e \x3ca href\x3d"#" class\x3d"icon-file" title\x3d"'+
xg.shared.nls.html("file")+'"\x3e'+xg.shared.nls.html("file")+"\x3c/a\x3e\x3c/span\x3e");b.find("a.icon-link").click(function(d){d.preventDefault();a.parent().hasClass("disabled")||xg.shared.editors.tinymce.LinkDialog(a).show()});b.find("a.icon-image").click(function(d){d.preventDefault();a.parent().hasClass("disabled")||xg.shared.editors.tinymce.ImageDialog(a,null,xg.uploadsDisabled||f.isMaxFileUploadCountReached(a)).show()});b.find("a.icon-media").click(function(d){d.preventDefault();a.parent().hasClass("disabled")||
xg.shared.editors.tinymce.MediaDialog(a).show()});b.find("a.icon-pastetext").click(function(d){d.preventDefault();a.parent().hasClass("disabled")||xg.shared.editors.tinymce.PasteTextDialog(a).show()});b.find("a.icon-file").click(function(d){d.preventDefault();a.parent().hasClass("disabled")||x$(this).hasClass("disabled")||xg.shared.editors.tinymce.FileDialog(a).show()});(xg.uploadsDisabled||a.attr("_hideFileUploadButton"))&&b.find("a.icon-file").remove();return b};c.updateHtmlEditorHeight=function(a){a.height(x$(f.getEditor(a).getContainer()).find("iframe").height())};
c.setFileButtonEnabled=function(a,b){b.data("xj_upper_icon_bar")&&(a?b.data("xj_upper_icon_bar").find("a.icon-file").removeClass("disabled"):b.data("xj_upper_icon_bar").find("a.icon-file").addClass("disabled"))};xg.addOnRequire(function(){c.initialize()});return e}(x$));dojo.hostenv.findModule("xg.shared.editors.TinyMCEEditor",!1)||(dojo.provide("xg.shared.editors.TinyMCEEditor"),xg.shared.editors.TinyMCEEditor=function(a){var c={},d={},e;d.initialize=function(){if(window.tinymce){xg.shared.editors.tinymce.Utilities.addIdIfNecessary(a);var b=a.attr("id");(e=tinymce.get(b))&&d.addEventHandlers();tinyMCE.onAddEditor.add(function(f,g){g.id==b&&(e=g,d.addEventHandlers())})}};d.addEventHandlers=function(){e.onKeyUp.add(d.onChange);e.onPaste.add(d.onChange)};d.onChange=
function(){d.checkMaxLength();c.updateBackgroundColor()};d.checkMaxLength=function(){};c.setMaxLength=function(b){var f=f=x$("\x3csmall\x3e\x3c/small\x3e").insertAfter(a.parents("div.texteditor:first"))[0];d.checkMaxLength=xg.shared.util.setAdvisableMaxLength(a[0],b,null,c.val,f,750)};d.isInHtmlMode=function(){return!e||!e.getDoc()};c.updateBackgroundColor=function(){d.isInHtmlMode()||xg.shared.editors.tinymce.Utilities.updateBackgroundColor(a,e)};c.val=function(){if(d.isInHtmlMode()){if(arguments.length){a.val(arguments[0]);
return}return a.val()}if(arguments.length)e.setContent(arguments[0]);else return e.getContent()};c.valWithLineBreakAdjustments=function(){if(d.isInHtmlMode()){var b=c.val();b=xg.shared.editors.tinymce.WordpressLineBreakRules.adjustLineBreaksEnteredInHtmlMode(b);b=xg.shared.editors.tinymce.WordpressLineBreakRules.adjustLineBreaksEnteredInVisualMode(b);return d.cleanHtml(b)}return c.val()};d.cleanHtml=function(b){return b.match(/<script\b/i)?b:x$("\x3cdiv\x3e\x3c/div\x3e").append(b).html()};c.adjustLineBreaks=
function(){if(d.isInHtmlMode()){var b=a.attr("name");a.data("xj_original_name",b);a.attr("name",b+"WithoutLineBreakAdjustments");b=x$('\x3cinput type\x3d"hidden" /\x3e').attr("name",b).val(c.valWithLineBreakAdjustments());a.after(b);a.data("xj_hidden_input",b)}};c.unadjustLineBreaks=function(){d.isInHtmlMode()&&(a.data("xj_hidden_input").remove(),a.attr("name",a.data("xj_original_name")))};c.initializeAfterPageLoad=function(){a.val().match(/<script|<object|<embed|<iframe/i)?xg.shared.editors.tinymce.TinyMCE.showHtmlEditor(a):
a.hasClass("deferred-html-mce-editor")||a.hasClass("html-mce-editor")?xg.shared.editors.tinymce.TinyMCE.showHtmlEditor(a):xg.shared.editors.tinymce.TinyMCE.showWysiwygEditor(a);return c};c.uninitialize=function(){tinyMCE.execCommand("mceRemoveControl",!1,a.attr("id"));return c};c.focus=function(){d.isInHtmlMode()?a.focus():e.focus()};c.moveCursorToStart=function(){d.isInHtmlMode()?xg.shared.editors.Editor.moveCursorToStart(a[0]):c.focus()};c.updateTextarea=function(){d.isInHtmlMode()||e.save()};c.setEnabled=
function(b){b?(a.parent().removeClass("disabled"),a.prop("disabled",!1),e.setMode("design")):(a.parent().addClass("disabled"),a.prop("disabled",!0),e.setMode("readonly"))};c.getTextarea=function(){return a};xg.addOnRequire(function(){d.initialize()});return c});dojo.hostenv.findModule("xg.components.shared.dialogAdapter",!1)||(dojo.provide("xg.components.shared.dialogAdapter"),xg.components.shared.dialogAdapter=function(){var c={alert:function(a,b){return xg.shared.util.alert(a,b)},hideDialog:function(a){c.hideOverlay(a);a.hide()},confirm:function(a){return xg.shared.util.confirm(a)},busy:function(a,b){return xg.shared.util.progressDialog({bodyHtml:xg.qh(a),classes:b})},showOverlay:function(a){return xg.shared.util.showOverlay()},hideOverlay:function(a){return xg.shared.util.hideOverlay()}};
return c}());dojo.hostenv.findModule("xg.shared.editors.Editor",!1)||(dojo.provide("xg.shared.editors.Editor"),xg.shared.editors.Editor=function(p){var c={},k={},g={},m=1;k.getID=function(a){a=x$(a);a.data("xj_editor_id")||a.data("xj_editor_id",m++);return a.data("xj_editor_id")};c.get=function(a){var b=k.getID(a);g[b]||(a=x$(a),a.hasClass("wysiwyg-mce-editor")||a.hasClass("deferred-wysiwyg-mce-editor")||a.hasClass("html-mce-editor")||a.hasClass("deferred-html-mce-editor")?g[b]=xg.shared.editors.TinyMCEEditor(a):
g[b]=xg.shared.editors.PlainEditor(a));return g[b]};c.moveCursorToStart=function(a){if(a.setSelectionRange)try{a.setSelectionRange(0,0)}catch(b){}else a.createTextRange&&(a=a.createTextRange(),a.collapse(!0),a.moveEnd("character",0),a.moveStart("character",0),a.select())};c.warnOnLostChanges=function(a,b){var e=c.get(a),d=e.val();window.unloadaction=function(){if(e.val().replace(/<.*?>|&nbsp;/g,"")!=d.replace(/<.*?>|&nbsp;/g,""))return b?b:xg.shared.nls.text("unsavedChanges")};window.onbeforeunload=
function(){return window.unloadaction()};xg.shared.util.closest(x$(a),"form").submit(function(){window.onbeforeunload&&(window.onbeforeunload=null)});var h=dojo.event.browser.stopEvent;dojo.event.browser.stopEvent=function(f){h(f);if("submit"==f.type||"onsubmit"==f.type)window.onbeforeunload=function(){return window.unloadaction()}}};c.processRotatedImages=function(a,b){return new Promise(function(e){b.updateTextarea();try{var d=x$(b.val()).find('img[data-base64_encoded\x3d"1"]')}catch(l){return e()}var h=
xg.components.shared.dialogAdapter.busy(xg.shared.nls.text("UPLOADING_LABEL")),f=a.find("textarea").attr("_storageuploadpath");d=xg.shared.RotateImage.savePictures(d,f);d.forEach(function(l){l.then(function(n){b.updateTextarea();b.val(xg.shared.RotateImage.base64toUrl(n,x$("\x3cdiv\x3e\x3c/div\x3e").append(x$(b.val())),a.find("textarea").attr("_storagegetpath")))})});return Promise.all(d).then(function(){h.hide();b.updateTextarea();return e()})})};return c}(x$));dojo.hostenv.findModule("xg.forum.topic.CommentEditor",!1)||(dojo.provide("xg.forum.topic.CommentEditor"),xg.forum.topic.CommentEditor=function(d){var a={},m=!1,l=x$("#link_"+d.attr("id")),c=d.next("form"),h=d.attr("_value"),k=!0,e;a.initialize=function(){a.setDisplayHtml(h);l.click(function(b){b.preventDefault();a.showForm()})};a.showForm=function(){k&&(l.hide(),d.hide(),c.show(),a.initializeIfNecessary(),e.val(h),e.focus(),xg.index.util.ScrollIntoView.scrollIntoView(c[0]))};a.hideForm=function(){c.hide();
d.show();l.show()};a.initializeIfNecessary=function(){m||(m=!0,c.find(".cancellink").click(function(b){b.preventDefault();a.setDisplayHtml(h);a.clearErrors();a.hideForm()}),e=xg.shared.editors.Editor.get(c.find("textarea")),e.initializeAfterPageLoad(),e.setMaxLength(c.find("textarea").attr("_maxlength")),c.submit(function(b){b.preventDefault();k&&xg.shared.editors.Editor.processRotatedImages(c,e).then(function(){var f=a.validate();a.clearErrors();f?(c.prepend('\x3cdiv class\x3d"dy-error-msg"\x3e'+
f+"\x3c/div\x3e"),c.addClass("error"),e.updateBackgroundColor()):xg.shared.RecaptchaV2Popup.showIfNeeded(function(n){k=!1;d.html('\x3cspan class\x3d"instruction"\x3e'+xg.shared.nls.html("saving")+"\x3c/span\x3e");a.hideForm();xg.post(d.attr("_setValueUrl"),{value:e.valWithLineBreakAdjustments(),"g-recaptcha-response":n},function(p,g){g=dj_eval(g);a.setDisplayHtml(g.html);k=!0;"shouldShowCaptcha"in g&&(xg.captcha.shouldShow=g.shouldShowCaptcha)})})})}))};a.clearErrors=function(){c.find(".dy-error-msg").remove();
c.removeClass("error");e.updateBackgroundColor()};a.setDisplayHtml=function(b){h=b;b=x$.trim(b);d.html(b);d.find("a").click(function(f){f.stopPropagation();return!0})};a.validate=function(){var b=dojo.string.trim(e.valWithLineBreakAdjustments()),f=c.find("textarea").attr("_maxlength");return b.length>f?xg.forum.nls.html("numberOfCharactersExceedsMaximum",b.length,f):0==b.length?((b=d.attr("_emptyDescriptionErrorMessage"))||(b=xg.shared.nls.html("pleaseEnterAComment")),dojo.string.escape("html",b)):
null};a.initialize();return{}});dojo.hostenv.findModule("xg.shared.comment",!1)||(dojo.provide("xg.shared.comment"),xg.shared.comment={numComments:null,commentContainer:null,initialize:function(){var a;dojo.lang.forEach(xg.$$("div"),function(d){"comments"==d.id&&(a=d)});if(void 0!==a){this.initializeCommentEdit();this.commentContainer=a;this.numComments=parseInt(this.commentContainer.getAttribute("_numComments"),10);dojo.lang.forEach(dojo.html.getElementsByClass("comment",this.commentContainer,"dl"),dojo.lang.hitch(this,this.initializeDl));
var b=this.commentContainer.getAttribute("_scrollTo");b&&(b=document.getElementById(b))&&(b.scrollIntoView?b.scrollIntoView(!0):xg.index.util.ScrollIntoView.scrollIntoView(b))}},initializeCommentEdit:function(){x$(".xj_comment_editor").each(function(a,b){a=x$(b);a.data("xj_initialized")||(xg.forum.topic.CommentEditor(a),a.data("xj_initialized",!0))})},initializeDl:function(a){dojo.lang.forEach(dojo.html.getElementsByClass("delete_link",a,"a"),dojo.lang.hitch(this,function(b){var d=!1;dojo.event.connect(b,
"onclick",dojo.lang.hitch(this,function(g){dojo.event.browser.stopEvent(g);d||(d=!0,dojo.io.bind({url:b.getAttribute("_url"),method:"post",mimetype:"text/javascript",preventCache:!0,encoding:"utf-8",content:{id:a.getAttribute("_id")},load:dojo.lang.hitch(this,function(l,h,m){h.success&&dojo.lfx.html.fadeOut(a,500,null,dojo.lang.hitch(this,function(){var e=dojo.html.hasClass(a,"last-child")?dojo.dom.prevElement(a,"dl"):null;a.parentNode.removeChild(a);e&&dojo.html.addClass(e,"last-child");if(0==this.commentContainer.getElementsByTagName("dl").length){var c=
window.location.href;c=c.split("#",2);e=c[1]?"#"+c[1]:"";c=c[0];var k="page",f=xg.shared.util.getParameter(c,"page");f||(f=xg.shared.util.getParameter(c,"commentPage"),k="commentPage");f&&0<f?(f=parseInt(f)-1,0<=f&&(c=xg.shared.util.removeParameter(c,k),c=xg.shared.util.addParameter(c,k,f),window.location.href=c+e)):window.location.reload()}})).play()})}))}))}));dojo.lang.forEach(dojo.html.getElementsByClass("approve_link",a,"a"),dojo.lang.hitch(this,function(b){var d=!1;dojo.event.connect(b,"onclick",
dojo.lang.hitch(this,function(g){dojo.event.browser.stopEvent(g);d||(d=!0,dojo.io.bind({url:b.getAttribute("_url"),method:"post",mimetype:"text/javascript",preventCache:!0,encoding:"utf-8",content:{id:a.getAttribute("_id")},load:dojo.lang.hitch(this,function(l,h,m){if(h.success){var e=dojo.dom.getAncestorsByTag(b,"div",!0);dojo.lfx.html.fadeOut(e,500,null,dojo.lang.hitch(this,function(){e.parentNode.removeChild(e)})).play()}})}))}))}))},addDl:function(a,b){dojo.style.setOpacity(a,0);dojo.html.show(this.commentContainer);
b?x$(this.commentContainer).prepend(a):this.commentContainer.appendChild(a);this.initializeCommentEdit();this.initializeDl(a);dojo.lfx.fadeIn(a,500,dojo.lfx.easeIn).play();dojo.style.show(dojo.html.getElementsByClass("xg_module_foot",this.commentContainer.parentNode,"div")[0]);this.styleComments()},styleComments:function(){dojo.lang.forEach(this.commentContainer.getElementsByTagName("dl"),dojo.lang.hitch(this,function(b){dojo.html.removeClass(b,"last-child")}));var a=x$("dl:last",this.commentContainer);
a&&dojo.html.addClass(a,"last-child")}},xg.addOnRequire(function(){xg.shared.comment.initialize()}));dojo.hostenv.findModule("xg.shared.FollowLink",!1)||(dojo.provide("xg.shared.FollowLink"),dojo.widget.defineWidget("xg.shared.FollowLink",dojo.widget.HtmlWidget,{_addUrl:"",_removeUrl:"",_addLinkText:"",_removeLinkText:"",_addDescription:"",_removeDescription:"",_isFollowed:"",_joinPromptText:"",_signUpUrl:"",_isPending:!1,fillInTemplate:function(c,a){this._addLinkText=this._addLinkText?this._addLinkText:xg.shared.nls.text("follow");this._removeLinkText=this._removeLinkText?this._removeLinkText:xg.shared.nls.text("stopFollowing");
this.a=this.getFragNodeRef(a);this.span=document.createElement("span");this.span.className="xj_follow_description";dojo.dom.insertAfter(this.span,this.a);this.updateText(this.a);dojo.event.connect(this.a,"onclick",dojo.lang.hitch(this,function(b){dojo.event.browser.stopEvent(b);this._joinPromptText.length||this._isPending?xg.shared.util.promptToJoin(this._joinPromptText,this._isPending,dojo.lang.hitch(this,function(){window.location=this._signUpUrl})):(this.a.className="desc working disabled",this.posting||
this.post())}))},post:function(){this.posting=!0;url=0==this._isFollowed?this._addUrl:this._removeUrl;dojo.io.bind({url,method:"post",encoding:"utf-8",preventCache:!0,load:dojo.lang.hitch(this,function(c,a,b){this._isFollowed=0==this._isFollowed?1:0;this.updateText(this.a);dojo.lfx.html.highlight(this.a,"#ffee7d",1E3).play();this.posting=!1})})},updateText:function(){0==this._isFollowed?(this.a.className="xg_sprite xg_sprite-follow-add",this.a.innerHTML=dojo.string.escape("html",this._addLinkText),
this._addDescription.length&&(dojo.dom.nextElement(this.a,"span").innerHTML=" \x26ndash; "+dojo.string.escape("html",this._addDescription))):(this.a.className="xg_sprite xg_sprite-follow-remove",this.a.innerHTML=dojo.string.escape("html",this._removeLinkText),this._removeDescription.length&&(dojo.dom.nextElement(this.a,"span").innerHTML=" \x26ndash; "+dojo.string.escape("html",this._removeDescription)))},showFollowing:function(){this._isFollowed=1;this.updateText()},showNotFollowing:function(){this._isFollowed=
0;this.updateText()}}));dojo.hostenv.findModule("xg.shared.FavoriteLink",!1)||(dojo.provide("xg.shared.FavoriteLink"),dojo.widget.defineWidget("xg.shared.FavoriteLink",dojo.widget.HtmlWidget,{_addurl:"",_removeUrl:"",_hasFavorite:"",fillInTemplate:function(b,c){var a=this.getFragNodeRef(c);0==this._hasFavorite?(a.className="xg_sprite xg_sprite-favorite-add",a.innerHTML=xg.shared.nls.text("addToFavorites")):(a.className="xg_sprite xg_sprite-favorite-remove",a.innerHTML=xg.shared.nls.text("removeFromFavorites"));dojo.event.connect(a,
"onclick",dojo.lang.hitch(this,function(d){dojo.event.browser.stopEvent(d);a.className="desc working disabled";this.posting||this.post(a)}))},post:function(b){this.posting=!0;url=0==this._hasFavorite?this._addurl:this._removeUrl;dojo.io.bind({url,method:"post",encoding:"utf-8",mimetype:"text/javascript",preventCache:!0,load:dojo.lang.hitch(this,function(c,a,d){0==this._hasFavorite?(b.className="xg_sprite xg_sprite-favorite-remove",b.innerHTML=xg.shared.nls.text("removeFromFavorites"),this._hasFavorite=
1):(b.className="xg_sprite xg_sprite-favorite-add",b.innerHTML=xg.shared.nls.text("addToFavorites"),this._hasFavorite=0);dojo.lfx.html.highlight(b,"#ffee7d",1E3).play();this.posting=!1})})}}));dojo.hostenv.findModule("xg.shared.TagLink",!1)||(dojo.provide("xg.shared.TagLink"),dojo.widget.defineWidget("xg.shared.TagLink",dojo.widget.HtmlWidget,{_actionUrl:"\x3crequired\x3e",_tags:"",_allowEmptySubmission:!0,_emptySubmissionMessage:"",_maxlength:0,_updateId:"tagsList",_addKey:"addTags",_editKey:"editYourTags",_popOver:!1,killTagBox:function(c){dojo.event.browser.stopEvent(c);dojo.html.hide(formblock)},fillInTemplate:function(c,f){c=this.getFragNodeRef(f);f=this._maxlength?'maxlength\x3d"'+
this._maxlength+'"':"";var a=dojo.html.createNodesFromText(dojo.string.trim('         \x3cdiv class\x3d"desc" style\x3d"display: none;"\x3e             \x3cform\x3e                 \x3cinput class\x3d"textfield" type\x3d"text" style\x3d"width: 95%;" '+f+' /\x3e                 \x3cdiv class\x3d"align-right pad5"\x3e                     \x3cinput class\x3d"button small" type\x3d"submit" value\x3d"'+xg.shared.nls.html("save")+'"/\x3e                     \x3ca id\x3d"cancelTags" class\x3d"action-secondary small" href\x3d"#" \x3e'+
xg.shared.nls.html("cancel")+"\x3c/a\x3e                 \x3c/div\x3e             \x3c/form\x3e         \x3c/div\x3e"))[0];this._popOver&&(a=dojo.html.createNodesFromText(dojo.string.trim('             \x3csmall class\x3d"showembed" style\x3d"display:none;"\x3e                 \x3cform\x3e                     \x3cinput class\x3d"textfield" type\x3d"text" style\x3d"width: 160px;" '+f+' /\x3e                     \x3cdiv class\x3d"align-right pad5"\x3e                         \x3cinput class\x3d"button small" type\x3d"submit" value\x3d"'+
xg.shared.nls.html("save")+'"/\x3e                         \x3ca id\x3d"cancelTags" class\x3d"action-secondary small" href\x3d"#" \x3e'+xg.shared.nls.html("cancel")+"\x3c/a\x3e                     \x3c/div\x3e                 \x3c/form\x3e             \x3c/small\x3e"))[0]);dojo.html.insertAfter(a,c);var b=c.getElementsByTagName("a")[0];dojo.event.connect(b,"onclick",dojo.lang.hitch(this,function(d){dojo.event.browser.stopEvent(d);dojo.style.isShowing(a)?dojo.html.hide(a):dojo.html.show(a)}));x$("#cancelTags",
a).click(dojo.lang.hitch(this,function(d){dojo.event.browser.stopEvent(d);dojo.html.hide(a)}));var g=a.getElementsByTagName("input")[0];g.value=this._tags;dojo.event.connect(a.getElementsByTagName("form")[0],"onsubmit",dojo.lang.hitch(this,function(d){dojo.event.browser.stopEvent(d);0==this._allowEmptySubmission&&0==g.value.length?xg.shared.util.alert(this._emptySubmissionMessage):(b.className="desc working",dojo.io.bind({url:this._actionUrl,method:"post",content:{tags:g.value},encoding:"utf-8",preventCache:!0,
mimetype:"text/javascript",load:dojo.lang.hitch(this,function(e,h,k){g.value.length?(b.className="xg_sprite xg_sprite-edit",b.innerHTML=xg.shared.nls.html(this._editKey)):(b.className="xg_sprite xg_sprite-add",b.innerHTML=xg.shared.nls.html(this._addKey));dojo.html.hide(a);"undefined"!=typeof h.html&&(e=dojo.byId(this._updateId))&&((e.innerHTML=h.html)&&""!=h.html?(x$(e).show(),xg.shared.util.parseWidgets(e)):x$(e).hide())})}))}))}}));dojo.hostenv.findModule("xg.shared.StarRater",!1)||(dojo.provide("xg.shared.StarRater"),xg.shared.StarRater=function(a){var e={},f={},g=0,c="",h=!1,k=!1,d="";f.initialize=function(){g=a.attr("_rating");c=a.attr("_setRatingUrl");k="true"==a.attr("_isPending");h="true"==a.attr("_isSignedIn");d=a.attr("_setRatingId");h&&(a.find("a").click(function(b){b.preventDefault();k?xg.shared.util.promptIsPending():e.updateRating(x$(this).attr("class").charAt(5))}),a.bind("mouseenter",function(){a.find(".current").hide()}),
a.bind("mouseleave",function(){a.find(".current").show()}))};e.updateRating=function(b){a.find(".current").removeClass("public").addClass("mine");a.find(".current").css("width",13*b+"px");c?xg.post(c,{rating:b}):d&&$("#"+d).value(g)};f.initialize()},xg.addOnRequire(function(){x$(".star-rater").each(function(){xg.shared.StarRater(x$(this))})}));dojo.hostenv.findModule("xg.shared.MoreLink",!1)||(dojo.provide("xg.shared.MoreLink"),dojo.widget.defineWidget("xg.shared.MoreLink",dojo.widget.HtmlWidget,{fillInTemplate:function(d,b){var a=this.getFragNodeRef(b);dojo.event.connect(a,"onclick",dojo.lang.hitch(this,function(c){dojo.event.browser.stopEvent(c);dojo.style.show(dojo.dom.nextElement(a));dojo.style.hide(a)}))}}));dojo.hostenv.findModule("xg.shared.EngagementUtil",!1)||(dojo.provide("xg.shared.EngagementUtil"),xg.shared.EngagementUtil={addEngagementContextToParams:function(c,a){var b=x$(a).attr("data-page-type");b&&(c.pageType=b,("main"==b||"profile"==b||"group"==b)&&(a=(a=xg.shared.util.getModule(a))?xg.shared.util.extractModuleName(a):"")&&(c.moduleName=a));return c}});dojo.hostenv.findModule("xg.shared.CommentForm",!1)||(dojo.provide("xg.shared.CommentForm"),xg.shared.CommentForm={ajax:null,addAtTop:null,submitting:!1,editor:null,initialize:function(){var a=dojo.byId("comment_form");if(a&&(this.editor=xg.shared.editors.Editor.get(x$(a.comment)),this.editor.setMaxLength(x$(a.comment).attr("_maxLength")),!(1>x$("input.xj_submit",a).length))){this.ajax="true"==a.getAttribute("_ajax");this.addAtTop="true"==a.getAttribute("_addAtTop");this.submitting=!1;var b=dojo.html.createNodesFromText('\x3cimg src\x3d"'+
xg.shared.util.cdn("/xn_resources/widgets/index/gfx/spinner.gif")+'" alt\x3d"'+xg.shared.nls.html("loading")+'" style\x3d"width:16px; height:16px; margin-right:3px; display: none;" /\x3e')[0];dojo.dom.insertBefore(b,dojo.html.getElementsByClass("button",a)[0]);dojo.event.connect(a,"onsubmit",dojo.lang.hitch(this,function(c){dojo.event.browser.stopEvent(c);if(!this.submitting){var d=this;xg.shared.editors.Editor.processRotatedImages(x$(a),xg.shared.CommentForm.editor).then(function(){xg.index.util.FormHelper.runValidation(a,
dojo.lang.hitch(d,d.validate))&&(d.isBlockedFromCreatingComments()?(xg.index.util.FormHelper.showErrorMessages(a,{error:xg.index.nls.html("softBlockMessagingForComments")}),xg.post("/main/index/logPostAttempt?xn_out\x3djson",null,function(){})):xg.shared.RecaptchaV2Popup.showIfNeeded(dojo.lang.hitch(d,d.onVerify)))})}}));xg.index.util.FormHelper.setTokenData()}},onVerify:function(a){var b=dojo.byId("comment_form");if(b){this.ajax="true"==b.getAttribute("_ajax");this.addAtTop="true"==b.getAttribute("_addAtTop");
this.submitting=!1;if(!this.ajax)return this.editor.adjustLineBreaks(),b.submit();this.submitting=!0;var c=dojo.html.createNodesFromText('\x3cimg src\x3d"'+xg.shared.util.cdn("/xn_resources/widgets/index/gfx/spinner.gif")+'" alt\x3d"'+xg.shared.nls.html("loading")+'" style\x3d"width:16px; height:16px; margin-right:3px; display: none;" /\x3e')[0];dojo.style.show(c);dojo.dom.removeNode(dojo.html.getElementsByClass("notification",b,"div")[0]);var d=0<x$(".xj_gnfst").length?x$(".xj_gnfst").val():"",f=
0<x$(".xj_gnfstTs").length?x$(".xj_gnfstTs").val():"",g=0<x$(".xj_gnfstId").length?x$(".xj_gnfstId").val():"";a={comment:xg.shared.CommentForm.editor.valWithLineBreakAdjustments(),"g-recaptcha-response":a,gnfst:d,gnfstTs:f,gnfstId:g};a=xg.shared.EngagementUtil.addEngagementContextToParams(a,b);dojo.io.bind({url:b.action+"\x26xn_out\x3djson",method:"post",preventCache:!0,encoding:"utf-8",mimetype:"text/javascript",content:a,load:dojo.lang.hitch(this,function(h,e,k){dojo.style.hide(c);this.submitting=
!1;xg.shared.CommentForm.onSuccess(e);"shouldShowCaptcha"in e&&(xg.captcha.shouldShow=e.shouldShowCaptcha)})})}},isBlockedFromCreatingComments:function(){var a=x$("input#xj_canCreateContent");return 0<a.length&&"1"!=a.val()?!0:!1},validate:function(a){var b={},c=x$.trim(this.editor.valWithLineBreakAdjustments());0===c.length&&(b.comment=xg.shared.nls.html("pleaseEnterAComment"));a=x$(a.comment).attr("_maxLength");c.length>a&&(b.comment=xg.shared.nls.html("numberOfCharactersExceedsMaximum",c.length,
a));return b},onSuccess:function(a){if(1==a.error||"undefined"!==typeof a.errorMessages)xg.index.util.FormHelper.showErrorMessages(dojo.byId("comment_form"),{error:a.errorMessages});else if(a.html){a.userIsNowFollowing&&dojo.lang.forEach(dojo.widget.manager.getWidgetsByType("FollowLink"),function(d){d.showFollowing()});var b=document.createElement("div");b.innerHTML=a.html;var c=dojo.dom.firstElement(b);b=dojo.byId("comment_form");this.editor.val("");!1===a.approved?(a=dojo.html.getElementsByClass("notification",
b,"div")[0],a||(a=dojo.html.createNodesFromText('\x3cdiv class\x3d"notification" style\x3d"margin-bottom:1em"\x3e\x3cp class\x3d"last-child"\x3e'+xg.shared.nls.html("yourCommentMustBeApproved")+"\x3c/p\x3e\x3c/div\x3e")[0],dojo.dom.insertAtPosition(a,b,"first")),xg.index.util.ScrollIntoView.scrollIntoView(b)):(xg.shared.comment.addDl(c,this.addAtTop),dojo.style.show("xj_comments_footer"))}}},xg.addOnRequire(function(){xg.shared.CommentForm.initialize()}));dojo.hostenv.findModule("xg.shared.InPlaceEditor",!1)||(dojo.provide("xg.shared.InPlaceEditor"),dojo.widget.defineWidget("xg.shared.InPlaceEditor",dojo.widget.HtmlWidget,{_instruction:"\x3crequired\x3e",_maxLength:"\x3crequired\x3e",_setValueUrl:"\x3crequired\x3e",_getValueUrl:"",_value:"",_controlAttributes:"",_endRegexToIgnore:"",_allowEmpty:"",_html:!1,_joinPromptText:"",disabled:!1,initialized:!1,showForm:function(){this.showingEditor=!0;x$(".inplace_edit_content",this.displayNode).hide();x$(this.displayNode).removeClass("editable_hover");
x$(this.form).show();setTimeout(dojo.lang.hitch(this,function(){this.textControl.value=this._value.replace(this.end,"").replace(/<span><\/span>/gi,"");this.stripTags(this.textControl.value)==this.stripTags(this.instruction())&&(this.textControl.value="");this.textControl.value=this._html?this.textControl.value.replace(/<br ?.?>\r?\n/gi,"\n"):this.stripTags(this.textControl.value)}),0);this.textControl.focus();xg.index.util.ScrollIntoView.scrollIntoView(this.form)},hideForm:function(){x$(this.form).hide();
x$(".inplace_edit_content",this.displayNode).show();this.editLink&&x$(this.editLink).hide();x$(this.displayNode).hover(function(a){x$(self.displayNode).toggleClass("editable_hover","mouseenter"===a.type)});this.showingEditor=!1},stripTags:function(a){return dojo.html.renderedTextContent(dojo.html.createNodesFromText("\x3cdiv\x3e"+a+"\x3c/div\x3e")[0])},fillInTemplate:function(a,b){this.showingEditor=!1;this.displayNode=this.getFragNodeRef(b);this.displayNode.title=xg.shared.nls.text("clickToEdit");
this.editLink=dojo.byId("link_"+this.displayNode.id);this._value=dojo.string.trim(this._value?this._value:this.displayNode.innerHTML);this.end=(a=(new RegExp(this._endRegexToIgnore,"i")).exec(this._value))?a[0]:"";this.setDisplayHtml(this._value,0<this._value.length);var c=this;x$(this.displayNode).hover(function(d){c.showingEditor||x$(c.displayNode).toggleClass("editable_hover","mouseenter"===d.type)});x$(this.displayNode).on("click",function(){c.showEditor()});if(this.editLink)x$(this.editLink).on("click",
function(d){dojo.event.browser.stopEvent(d);c.showEditor()})},showEditor:function(){this.showingEditor||xg.shared.util.promptToJoin(this._joinPromptText,dojo.lang.hitch(this,function(){this.initializeIfNecessary();this.editLink&&dojo.html.hide(this.editLink);this.disabled||(this._getValueUrl?(this.disabled=!0,this.displayNode.innerHTML='\x3cspan class\x3d"instruction"\x3e'+xg.shared.nls.html("loading")+"\x3c/span\x3e",dojo.io.bind({url:this._getValueUrl,preventCache:!0,encoding:"utf-8",mimetype:"text/javascript",
load:dojo.lang.hitch(this,function(a,b,c){this.setDisplayHtml(b.html);this.showForm();this.disabled=!1})})):this.showForm())}))},initializeIfNecessary:function(){if(!this.initialized){this.initialized=!0;this.form=x$(dojo.string.trim('                 \x3cform class\x3d"inplace_edit" style\x3d"display:none;"\x3e                     \x3cdiv class\x3d"texteditor"\x3e                         \x3cinput type\x3d"text" '+this._controlAttributes+' maxLength\x3d"'+this._maxLength+'" /\x3e                     \x3c/div\x3e                     \x3cp class\x3d"buttongroup"\x3e                         \x3cinput type\x3d"submit" class\x3d"button action-primary submit" value\x3d"'+
xg.shared.nls.html("save")+'" /\x3e                         \x3ca class\x3d"cancellink action-secondary" href\x3d"javascript:void(0)"\x3e'+xg.shared.nls.html("cancel")+"\x3c/a\x3e                     \x3c/p\x3e                 \x3c/form\x3e")).get(0);x$(this.displayNode).html('\x3cdiv class\x3d"inplace_edit_content"\x3e'+x$(this.displayNode).html()+"\x3c/div\x3e");x$(this.displayNode).append(this.form);this.textControl=x$(".textfield",this.form).get(0);this.cancelButton=x$(".cancellink",this.form).get(0);
var a=this;x$(this.cancelButton).on("click",function(b){dojo.event.browser.stopEvent(b);a.hideForm()});if(!this._allowEmpty)x$('input[type\x3d"text"]',this.form).on("change keyup cut paste keypress",function(){var b=!x$.trim(x$(this).val());x$(".submit",this.form).prop("disabled",b).toggleClass("dy-disabled",b)});x$(this.form).on("submit",function(b){dojo.event.browser.stopEvent(b);a.disabled||(a.disabled=!0,a.displayNode.innerHTML='\x3cspan class\x3d"instruction"\x3e'+xg.shared.nls.html("saving")+
"\x3c/a\x3e",a.hideForm(),b=xg.shared.util.parseUrlParameters(a._setValueUrl),b.value=a.textControl.value,dojo.io.bind({url:a._setValueUrl,content:b,method:"post",encoding:"utf-8",preventCache:!0,mimetype:"text/javascript",encoding:"utf-8",load:dojo.lang.hitch(a,function(c,d,e){a.setDisplayHtml(d.html);a.disabled=!1;a._getValueUrl=""})}))})}},setDisplayHtml:function(a,b){this.initialized=this.showingEditor=!1;this._value=a;a=dojo.string.trim(a.replace(this.end,""));0==a.length&&(a=this.instruction());
b||(this.displayNode.innerHTML="\x3cspan\x3e\x3c/span\x3e"+xg.shared.util.nl2br(a)+this.end);dojo.lang.forEach(this.displayNode.getElementsByTagName("a"),dojo.lang.hitch(this,function(c){c.onclick=dojo.lang.hitch(this,function(){this.disabled=!0;window.setTimeout(dojo.lang.hitch(this,function(){this.disabled=!1}),1E3)})}))},instruction:function(){return 0<dojo.string.trim(this._instruction).length?'\x3cspan class\x3d"instruction"\x3e['+dojo.string.escape("html",this._instruction)+"] \x3c/span\x3e":
'\x3cspan class\x3d"instruction"\x3e\x3c/span\x3e'}}));