Loco Translate - Version 2.0.9

Version Description

  • Bumped minimum WordPress version to 4.1
  • Some optimisation of transient caching
  • Fixed hash table settings bug
Download this release

Release Info

Developer timwhitlock
Plugin Icon 128x128 Loco Translate
Version 2.0.9
Comparing to
See all releases

Code changes from version 2.0.8 to 2.0.9

languages/loco.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: PACKAGE VERSION\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2016-10-21 12:03+0000\n"
7
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: \n"
@@ -201,7 +201,7 @@ msgid "Other"
201
  msgstr ""
202
 
203
  #. Shows total string count at top of editor
204
- #: src/gettext/Metadata.php:191 src/js/Strings.php:35
205
  #, php-format
206
  msgid "1 string"
207
  msgid_plural "%s strings"
@@ -209,19 +209,19 @@ msgstr[0] ""
209
  msgstr[1] ""
210
 
211
  #. Shows percentage translated at top of editor
212
- #: src/gettext/Metadata.php:201 src/js/Strings.php:38
213
  #, php-format
214
  msgid "%s%% translated"
215
  msgstr ""
216
 
217
  #. Shows number of fuzzy strings at top of editor
218
- #: src/gettext/Metadata.php:203 src/js/Strings.php:41
219
  #, php-format
220
  msgid "%s fuzzy"
221
  msgstr ""
222
 
223
  #. Shows number of untranslated strings at top of editor
224
- #: src/gettext/Metadata.php:206 src/js/Strings.php:44
225
  #, php-format
226
  msgid "%s untranslated"
227
  msgstr ""
3
  msgstr ""
4
  "Project-Id-Version: PACKAGE VERSION\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2016-10-23 09:48+0000\n"
7
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: \n"
201
  msgstr ""
202
 
203
  #. Shows total string count at top of editor
204
+ #: src/gettext/Metadata.php:188 src/js/Strings.php:35
205
  #, php-format
206
  msgid "1 string"
207
  msgid_plural "%s strings"
209
  msgstr[1] ""
210
 
211
  #. Shows percentage translated at top of editor
212
+ #: src/gettext/Metadata.php:198 src/js/Strings.php:38
213
  #, php-format
214
  msgid "%s%% translated"
215
  msgstr ""
216
 
217
  #. Shows number of fuzzy strings at top of editor
218
+ #: src/gettext/Metadata.php:200 src/js/Strings.php:41
219
  #, php-format
220
  msgid "%s fuzzy"
221
  msgstr ""
222
 
223
  #. Shows number of untranslated strings at top of editor
224
+ #: src/gettext/Metadata.php:203 src/js/Strings.php:44
225
  #, php-format
226
  msgid "%s untranslated"
227
  msgstr ""
loco.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Loco Translate
4
  Plugin URI: https://wordpress.org/plugins/loco-translate/
5
  Description: Translate themes and plugins directly in WordPress
6
  Author: Tim Whitlock
7
- Version: 2.0.8
8
  Author URI: https://localise.biz/wordpress/plugin
9
  Text Domain: loco
10
  Domain Path: /languages/
@@ -45,7 +45,7 @@ function loco_plugin_file(){
45
  * @return string
46
  */
47
  function loco_plugin_version(){
48
- return '2.0.8';
49
  }
50
 
51
 
4
  Plugin URI: https://wordpress.org/plugins/loco-translate/
5
  Description: Translate themes and plugins directly in WordPress
6
  Author: Tim Whitlock
7
+ Version: 2.0.9
8
  Author URI: https://localise.biz/wordpress/plugin
9
  Text Domain: loco
10
  Domain Path: /languages/
45
  * @return string
46
  */
47
  function loco_plugin_version(){
48
+ return '2.0.9';
49
  }
50
 
51
 
pub/js/min/admin.js CHANGED
@@ -1,41 +1,41 @@
1
- (function(p,w,h,U){var n=function(){var f={};return{register:function(c,h){f[c]=h},require:function(c,h){var l=f[c];if(!l)throw Error('CommonJS error: failed to require("'+h+'")');return l}}}();n.register("$1",function(f,c,h){function l(b){var g=typeof b;if("string"===g)if(/[^ <>!=()%^&|?:n0-9]/.test(b))console.error("Invalid plural: "+b);else return new Function("n","return "+b);"function"!==g&&(b=function(a){return 1!=a});return b}f.init=function(b){function g(d,e,b){return(d=a[d])&&d[b]?d[b]:e||
2
- ""}b=l(b);var a={};return{_:function(a){return g(a,a,0)},_x:function(a,e){return g(e+"\u0004"+a,a,0)},_n:function(a,e,k){k=Number(b(k));isNaN(k)&&(k=0);return g(a,i?e:a,k)},load:function(d){a=d||{};return this},pluraleq:function(a){b=l(a);return this}}};return f}({},p,w));n.register("$2",function(f,c,h){Array.prototype.indexOf||(Array.prototype.indexOf=function(c){if(null==this)throw new TypeError;var b,g=Object(this),a=g.length>>>0;if(0===a)return-1;b=0;1<arguments.length&&(b=Number(arguments[1]),
3
- b!=b?b=0:0!=b&&Infinity!=b&&-Infinity!=b&&(b=(0<b||-1)*Math.floor(Math.abs(b))));if(b>=a)return-1;for(b=0<=b?b:Math.max(a-Math.abs(b),0);b<a;b++)if(b in g&&g[b]===c)return b;return-1});return f}({},p,w));n.register("$3",function(f,c,h){f.trim=function(c,b){for(b||(b=" \n");c&&-1!==b.indexOf(c.substr(0,1));)c=c.substr(1);for(;c&&-1!==b.indexOf(c.substr(-1));)c=c.substr(0,c.length-1);return c};f.sprintf=function(c){var b=0,g,a=[].slice.call(arguments,1);return c.replace(/%(s|u|%)/g,function(d,e){if("%"===
4
- e)return"%";g=a[b++];return String(g)||""})};return f}({},p,w));n.register("$34",function(f,c,h){function l(d){a||c._gat&&(a=_gat._createTracker(b,"loco"));if(a){var e=d.shift();a[e].apply(a,d)}else g&&g.push(d);return f}var b,g,a;f._init=function(a){if(b=a.code){g=c._gaq||(c._gaq=[]);g.push(["_setAccount",b]);g.push(["_trackPageview"]);g.push(["_setDomainName",a.host]);a=h.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"==h.location.protocol?"https://ssl":"http://www")+
5
- ".google-analytics.com/ga.js";var e=h.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}return f};f.event=function(a,e,b,g){return l(["_trackEvent",a||"",e||"",b||"",g||0])};f.page=function(a,e){return l(["_trackPageview",{page:a||location.pathname+location.hash,title:e||h.title}])};return f}({},p,w));n.register("$35",function(f,c,h){function l(a,d){if(b)b[a](d);else c.ga&&ga(a,d);return f}var b,g;f._init=function(a){a.code&&(function(a,e,b,g,c,m,r){a.GoogleAnalyticsObject=c;a[c]=a[c]||
6
- function(){(a[c].q=a[c].q||[]).push(arguments)};a[c].l=1*new Date;m=e.createElement(b);r=e.getElementsByTagName(b)[0];m.async=1;m.src=g;r.parentNode.insertBefore(m,r)}(c,h,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",a.code,{alwaysSendReferrer:!0,userId:a.user}),a.custom&&l("set",a.custom),f.page(),ga(function(a){b=a}));return f};f.event=function(a,d,e,b){return l("send",{hitType:"event",eventCategory:a||"",eventAction:d||"",eventLabel:e||"",eventValue:Number(b||0)})};f.page=
7
- function(a,d){var e={hitType:"pageview",page:a||location.pathname+location.hash,title:d||h.title};e.location=location.protocol+"//"+location.hostname+e.page;g&&l("set",{referrer:g});g=e.location;return l("send",e)};f.reset=function(){g=location.href;l("set",{page:location.pathname+location.hash,title:h.title,location:g});return f};return f}({},p,w));n.register("$28",function(f,c,M){function l(a,e){h(a).click(function(a){b&&b.event(e,"click",this.getAttribute("href")||"");return!0});a=null;return f}
8
- var b,g=location.hostname,a="/help"===location.pathname.substr(0,5);f.init=function(a){!b&&a&&(g=a.host||(a.host=g),b=a.legacy?n.require("$34","legacy.js"):n.require("$35","universal.js"),b._init(a));return f};f.link=function(d){for(var e=d.getAttribute("href");e&&"#"!==e;){if(0===e.indexOf("#"))return l(d,"anchor");if("/help"===e.substr(0,5)&&!a)d.setAttribute("target","_blank");else if(0===e.indexOf("http")||0===e.indexOf("//")){if(-1!==e.indexOf(g)&&/^(https?:)*\/\/([^\/]+)/.exec(e)&&g===RegExp.$2)break;
9
- d.setAttribute("target","_blank");l(d,"external")}break}return f};f.page=function(){b&&b.page.apply(b,arguments);return f};f.event=function(){b&&b.event.apply(b,arguments);return f};f.reset=function(){b&&b.reset&&b.reset();return f};return f}({},p,w));n.register("$31",function(f,c,n){function l(a,d,e,b,c){function s(){t&&clearTimeout(t);q&&q.fadeOut(400,function(){h(this).remove();q=null});return!1}function m(){r();-1!==b&&(t=setTimeout(s,b||2E3));q.off("mouseleave").on("mouseenter",r)}function r(){t&&
10
- clearTimeout(t);t=null;q.off("mouseenter").on("mouseleave",m)}var t;g||(g=n.createElement("div"),g.id="growls",n.body.appendChild(g));var q=h('<div class="growl growl-'+e+'"><div><a class="close" href="#"><span>X</span></a><span class="badge"></span><p class="message"></p><small class="caption"></small></div></div>');q.find("p").text(a||"Empty message");d?q.find("small").text(d):q.find("small").remove();if(c.length){c.push({label:"Cancel",callback:s,css:"cancel"});var u,B=h('<form action="#" class="dialog"></form>');
11
- d=function(a,d){u=h('<input type="button" value="'+d.label+'" class="butt '+(d.css||"")+'" />');u.click(function(a){"function"===typeof d.callback&&d.callback(a,{close:s})});B.append(u);return u};for(a=0;a<c.length;a++)d(a,c[a]);q.append(B)}h(g).prepend(q.hide().fadeIn(400));q.find("a").click(s);m()}var b,g;f.init=function(){if(!b)return b=c.alert,c.alert=function(a){a=String(a).split("\n");var d=a[1]&&a.slice(1).join("\n");f.alert(a[0],d)},f};f.debug=function(a){b(a);return f};f.alert=function(a,
12
- d,e,k,g){try{return l(a,d||"",e||"alert",k||4E3,g||[]),!0}catch(s){return a+="\n\n--\n"+(s.message||s),b.call(c,a),!1}};f.success=function(a,d,e){return f.alert(a,d,"success",e||2E3)};f.dialog=function(a,d,e,b){return f.alert(a,d,b||"alert",-1,e)};f.login=function(a,d,e,b){f.dialog(d||"You're not logged in",e||"Please log in to continue",[{label:b||"Log in",callback:function(d,e){location.assign(a||"/session/auth/login?r="+encodeURIComponent(location.href))}}])};return f}({},p,w));n.register("$36",
13
- function(f,c,n){function l(a){return 27===a.keyCode&&q&&u?(F(),a.preventDefault(),!1):!0}function b(a){if(q){a=c.innerWidth;var d=c.innerHeight;a!==C&&(C=a,G(v));d!==y&&(y=d,t&&g())}return!0}function g(){var a=e.outerHeight(!0)-t.clientHeight;t.style.maxHeight=String(y-a)+"px"}function a(a){a?(s.show(),k.addClass("has-title")):(s.hide(),k.removeClass("has-title"))}var d,e,k,z,s,m,r,t,q=!1,u=!1,B=!1,D,E,C,v,y,A=f.init=function(){if(!d){d=h('<div id="overlay"></div>');e=h('<div class="overlay-frame"></div>');
14
- k=h('<div class="overlay-container"></div>');s=h('<div class="overlay-title"><span class="icon"></span><span class="title">Untitled</span></div>');m=h("<nav></nav>");r=h('<a class="overlay-close" href="#"><span>x</span></a>');z=h('<div class="overlay-bg"></div>');d.append(e.append(k)).append(z).prependTo(n.body);h(n).on("keydown",l);h(c).resize(b);C=c.innerWidth;y=c.innerHeight;E=k.outerWidth(!0)-k.width()+(e.innerWidth()-e.width());D=parseInt(k.css("width"));if(!D||isNaN(D))D=k.width();m.hide().prependTo(e);
15
- s.append(r.hide()).hide().prependTo(e);d.hide()}return d},G=f.width=function(a){var d=A();if(null===a)e.css("width",""),k.css("width","");else{a=a||D||640;x=a+E;v=a;var b=C;x>b?(x=b,a=x-E,d.addClass("spill")):d.removeClass("spill");e.css("width",x+"px");k.css("width",a+"px")}return f};f.autoSize=function(){var a=A(),d=D||0;k.children().each(function(a,e){d=Math.max(d,h(e).outerWidth(!0))});G(d);if(t=a.find("div.overlay-scroll")[0])y=c.innerHeight,g();return f};f.css=function(a){A().attr("class",a);
16
- return f};f.html=function(a){A();c.innerShiv&&(a=innerShiv(a,!1));return k.html(a)};f.append=function(a){A();a instanceof jQuery||(a=h(a));k.append(a);return f};var F=f.close=function(a){if(q){var e=function(){A().hide();h(n.body).removeClass("has-overlay");q=!1;k.html("");q=null;d.trigger("overlayClosed",[f])};null==a&&(a=300);d.trigger("overlayClosing",[f]);a?d.fadeOut(a,e):e()}return f};f.title=function(d,e){A();var b="",q=s.find("span");e&&/^lang lang-(\w+)/.exec(e)&&(b=RegExp.$1);q.eq(0).attr("class",
17
- e||"icon").attr("lang",b);B=d||"";q.eq(1).text(B);null!=d?a(!0):u||a(!1);return f};f.enableClose=function(){A();u=!0;r.off("click").on("click",function(a){F();return!1});a(!0);r.show();return f};f.disableClose=function(){A();u=!1;r.hide();q&&B||a(!1);return f};f.enableNav=function(a){m.append(a);m.show();return f};f.disableNav=function(){m.html("").hide();return f};f.open=function(){A();k.html("");G(D);d.attr("class","");h(n.body).addClass("has-overlay");A().show();q=!0;f.title(null);u&&a(!0);d.trigger("overlayOpened",
18
- [f]);return f};f.listen=function(a){A().on("overlayClosed",a);return f};f.unlisten=function(a){A().off("overlayClosed",a);return f};return f}({},p,w));n.register("$20",function(f,c,n){function l(a,d){this.$element=h(a);this.options=d;this.enabled=!0;this.fixTitle()}f.init=function(a,d){var e={fade:!0,offset:5,delayIn:b,delayOut:g,anchor:a.attr("data-anchor"),gravity:a.attr("data-gravity")||"s"};d&&(e=h.extend({},e,d));a.tipsy(e)};f.delays=function(a,d){b=a||150;g=d||100};f.kill=function(){h("div.tipsy").remove()};
19
- f.text=function(a,d){d.data("tipsy").setTitle(a)};var b,g;f.delays();h(n.body).on("overlayOpened overlayClosing",function(a){f.kill();return!0});l.prototype={show:function(){var a=this.getTitle();if(a&&this.enabled){var d=this.tip();d.find(".tipsy-inner")[this.options.html?"html":"text"](a);d[0].className="tipsy";d.remove().css({top:0,left:0}).prependTo(n.body);var a=(a=this.options.anchor)?this.$element.find(a):this.$element,a=h.extend({},a.offset(),{width:a[0].offsetWidth,height:a[0].offsetHeight}),
20
- e=d[0].offsetWidth,b=d[0].offsetHeight,g="function"==typeof this.options.gravity?this.options.gravity.call(this.$element[0]):this.options.gravity,c;switch(g.charAt(0)){case "n":c={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-e/2};break;case "s":c={top:a.top-b-this.options.offset,left:a.left+a.width/2-e/2};break;case "e":c={top:a.top+a.height/2-b/2,left:a.left-e-this.options.offset};break;case "w":c={top:a.top+a.height/2-b/2,left:a.left+a.width+this.options.offset}}2==g.length&&("w"==
21
- g.charAt(1)?c.left=a.left+a.width/2-15:c.left=a.left+a.width/2-e+15);d.css(c).addClass("tipsy-"+g);d.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+g.charAt(0);this.options.className&&d.addClass("function"==typeof this.options.className?this.options.className.call(this.$element[0]):this.options.className);d.addClass("in")}},hide:function(){this.tip().remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("original-title"))&&a.attr("original-title",
22
- a.attr("title")||"").removeAttr("title")},getTitle:function(){var a,d=this.$element,e=this.options;this.fixTitle();e=this.options;"string"==typeof e.title?a=d.attr("title"==e.title?"original-title":e.title):"function"==typeof e.title&&(a=e.title.call(d[0]));return(a=(""+a).replace(/(^\s*|\s*$)/,""))||e.fallback},setTitle:function(a){var d=this.$element;d.attr("default-title")||d.attr("default-title",this.getTitle());null==a&&(a=d.attr("default-title")||this.getTitle());d.attr("original-title",a);
23
  if(this.$tip)this.$tip.find(".tipsy-inner")[this.options.html?"html":"text"](a)},tip:function(){this.$tip||(this.$tip=h('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0]));return this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.options=this.$element=null)},enable:function(){this.enabled=!0},disable:function(){this.hide();this.enabled=!1},toggleEnabled:function(){this.enabled=
24
- !this.enabled}};h.fn.tipsy=function(a){function d(d){var e=h.data(d,"tipsy");e||(e=new l(d,h.fn.tipsy.elementOptions(d,a)),h.data(d,"tipsy",e));return e}function e(){var e=d(this),b=a.delayIn;e.hoverState="in";0==b?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},b))}function b(){var e=d(this),k=a.delayOut;e.hoverState="out";0==k?e.hide():(e.tip().removeClass("in"),setTimeout(function(){"out"==e.hoverState&&e.hide()},k))}a=h.extend({},h.fn.tipsy.defaults,a);a.live||this.each(function(){d(this)});
25
- if("manual"!=a.trigger){var g=a.live?"live":"bind",c="hover"==a.trigger?"mouseleave":"blur";this[g]("hover"==a.trigger?"mouseenter":"focus",e)[g](c,b)}return this};h.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:0.8,title:"title",trigger:"hover",anchor:null};h.fn.tipsy.revalidate=function(){h(".tipsy").each(function(){var a=h.data(this,"tipsy-pointee"),d;if(!(d=!a)){a:{for(;a=a.parentNode;)if(a==n){a=!0;break a}a=!1}d=!a}d&&
26
- h(this).remove()})};h.fn.tipsy.elementOptions=function(a,d){return h.metadata?h.extend({},d,h(a).metadata()):d};h.fn.tipsy.autoNS=function(){return h(this).offset().top>h(n).scrollTop()+h(c).height()/2?"s":"n"};h.fn.tipsy.autoWE=function(){return h(this).offset().left>h(n).scrollLeft()+h(c).width()/2?"e":"w"};h.fn.tipsy.autoBounds=function(a,d){return function(){var e=d[0],b=1<d.length?d[1]:!1,g=h(n).scrollTop()+a,f=h(n).scrollLeft()+a,m=h(this);m.offset().top<g&&(e="n");m.offset().left<f&&(b="w");
27
- h(c).width()+h(n).scrollLeft()-m.offset().left<a&&(b="e");h(c).height()+h(n).scrollTop()-m.offset().top<a&&(e="s");return e+(b?b:"")}};return f}({},p,w));n.register("$21",function(f,c,M){var l={401:"You've been logged out",422:"Invalid data sent to server",404:"Not Found",500:"Server Error",502:"Bad Gateway",503:"Service unavailable",504:"Gateway timeout"};f.getErrors=function(){return l};f.jsonLink=function(b){if(!b)return"";b=b.split("?");b[0]=b[0].replace(/(\.[a-z0-9]{1,4})?$/i,".json");return b.join("?")};
28
- f.errorData=function(b,g,a){var d,e;a=b.responseText;g=b.status;if(!a&&0===g)return null;try{d=h.parseJSON(a)||{}}catch(k){d={},e=l[b.status]||k.message||k}d.error=e||d.error||d.statusText||b.statusText||l[g]||"Unknown Error";return d};f.ajax=function(b,g,a,d){function e(){a&&a()}function k(a){a.alert&&alert(a.alert);var b=a.success;b&&n.require("$31","growl.js").success.apply(this,b.push?b:[b]);b=d||h(M.body);b.trigger("locoAjaxSuccess",[a]);var k=a.events;if(k&&k.length)for(var g,q=n.require("$28",
29
- "ga.js");g=k.shift();)b.trigger(g,[a]),q.event("ajax",g);if(b=a.download)c.location.assign(b);else if(b=a.redirect)if(0===b.indexOf("/modal/"))a.modal={url:b};else return c.location.assign(b),!1;else if(a.reload)return c.location.reload(),!1;(b=a.modal)&&n.require("$29","modal.js").replace(b);e();return!0}function z(a,d,b){if("abort"!==d){var t=a.status,q;if(401===t)n.require("$31","growl.js").login(),g&&!1===g(null,l[t],t,a)&&e();else{if("parsererror"===d)c.console&&console.error&&console.error(t,
30
- a.responseText),q=404===t?"Ajax service not found":/^\s+Fatal error/.test(a.responseText)?"Fatal server error from Ajax request":"Bad Ajax response";else{var u=f.errorData(a,d,b);u&&u.error&&(q=u.error)}"function"===typeof g&&!1===g(null,q,t,a)?e():u&&u.data&&!k(u.data)||(alert(q||"Unknown Ajax error"),e())}}}(b.headers||(b.headers={}))["X-Loco-Csrf"]=c.loco&&H.csrf||"";b.error=z;b.success=function(a,d,b){if(!a||"object"!==typeof a)return z(b,"unknown");(a.status||a.error)&&alert(a.error||a.statusText||
31
- b.statusText||l[a.status]||"Unknown Error");"function"===typeof g&&!1===g(a&&a.data?a.data:a,null,d,b)?e():a&&a.data?k(a.data):e()};-1!==b.url.indexOf(".json")&&(b.dataType="json");return h.ajax(b)};return f}({},p,w));n.register("$29",function(f,c,M){function l(a){a.stopPropagation();a.preventDefault();return!1}function b(){k||(k=n.require("$36","overlay.js"),k.listen(d));return k}function g(){var a=m.length-1,d=m[a],e=h('<a class="has-icon icon-back" data-gravity="w">Back</a>').attr("href",d[0]).attr("title",
32
- d[1]).click(function(e){if(m[a]===d&&u())return l(e)});k.enableNav(e);n.require("$20","tooltip.js").init(e)}function a(a,d){b().autoSize();var e=k.init();n.require("$16","html.js").init(e);m.length&&g();e.find("[data-script]").each(function(a,e){e=h(e);for(var b=-1,q,k=e.attr("data-script").split(" ");++b<k.length;)q=k[b],s[q]?s[q](e,d||{}):alert("Unknown script "+q)});e.trigger("locoModalLoaded",[k,a||"",d||{}]);var q,c=e.find("form")[0],r;if(c)a:for(e=0;e<c.elements.length;e++)switch(q=c.elements[e],
33
- q.type){case "text":case "email":case "textarea":r=Number(q.getAttribute("tabindex"));if(isNaN(r)||100>r)continue a;h(q).focus();break a}}function d(){r=null;m=[];return!0}function e(a){var d=h(a.currentTarget),e=d.attr("data-modal");if("back"===e){if(u())return l(a);e="close"}if("close"===e){q();var b=d.attr("href");if(b&&-1!==b.indexOf("#!"))return!0}else{var k="submit"===a.type,g=d.attr("title")||d.attr("data-title"),b=d.attr("href")||d.attr("action"),c=k?d.serialize():"",d=k?d.attr("method"):
34
- "get";e||(e=b.split("/").slice(1,4).join("-"));t(b,g,d,c,"modal "+e)}return l(a)}var k,z=n.require("$28","ga.js"),s={},m=[],r,t=f.load=function(d,e,q,g,c){var u=r;r=[].slice.call(arguments);u&&d!==u[0]&&(m.push(u),d+=-1===d.indexOf("?")?"?":"&",d+="r="+encodeURIComponent(u[0]));b().open().title("Loading ..").disableClose().disableNav().css("modal").html('<div class="loading"></div>');c&&k.width(null).css(c).autoSize();var u=d.split("#"),s=u[1];s&&(d=u[0]);var u=n.require("$21","http.js"),l={type:q||
35
- "get",data:g||"",url:u.jsonLink(d)};u.ajax(l,function(b,u,f){var y=b&&b.html;if(!y)return b&&b.redirect?(r=m.pop()||null,t(b.redirect,e,q,g,c)):(b=h('<h3 class="error"></h3>').text(u||"Unknown error"),k.enableClose().title("Error "+f||"?").html("").append(b)),!1;e=b.title||e||"Untitled";r&&(r[1]=e);k.enableClose().title(e,b.icon).html(y);f=b.js||{};s&&(f["#"]=s);a(d,f);z.page(d,e);k.init().one("overlayClosed",function(){z.reset()});return!0});return f},q=f.close=function(){b().close();return f},u=
36
- f.back=function(){if(previous=m.pop())return r=m[m.length-2],t.apply(null,previous),!0};f.reload=function(){r&&t.apply(null,r)};f.initLink=function(a){a.click(e)};f.initForm=function(a){h(a).submit(e)};f.replace=function(d){b();var e=d&&d.html,q=d&&d.url,g=d&&d.title,c=d&&d.action;if(q)d=d&&d.css||q.split("/").slice(1,4).join("-"),t(q,g,"","",d);else if(e)k.open().html(e),g&&k.enableClose().title(g),a("",d&&d.js);else if("function"===typeof f[c])f[c]()};f.find=function(a){return b().init().find(a)};
37
- f.script=function(a,d){if(d){if("function"!==typeof d.run)throw Error(a+" macro has no run function");s[a]=d.run;return f}return s[a]};return f}({},p,w));n.register("$8",function(f,c,n){f.listen=function(f,b){function g(){t[k?"show":"hide"]()}function a(a){r&&f.setAttribute("size",a.length||1);k=a;g();return a}function d(){z=null;b(k)}function e(){var e=f.value;m&&e===m&&(e="");e!==k&&(z&&clearTimeout(z),a(e),s?z=setTimeout(d,s):d())}var k,z;f=f instanceof jQuery?f[0]:f;var s=150,m=c.attachEvent&&
38
- f.getAttribute("placeholder"),r=1===Number(f.size),t=h('<a href="#clear" tabindex="-1" class="icon clear"><span>clear</span></a>').click(function(a){f.value="";e();return!1});a(f.value);h(f).on("input blur focus",function(){e();return!0}).after(t);g();return{delay:function(a){s=a},ping:function(b){b?(z&&clearTimeout(z),b=f.value,m&&b===m&&(b=""),a(b),d(),b=void 0):b=e();return b},val:function(d){if(null==d)return k;z&&clearTimeout(z);f.value=a(d);g()},el:function(){return f},blur:function(a){return h(f).on("blur",
39
  a)}}};return f}({},p,w));n.register("$19",{"\u00e1":"a","\u00e0":"a","\u0103":"a","\u1eaf":"a","\u1eb1":"a","\u1eb5":"a","\u1eb3":"a","\u00e2":"a","\u1ea5":"a","\u1ea7":"a","\u1eab":"a","\u1ea9":"a","\u01ce":"a","\u00e5":"a","\u01fb":"a","\u00e4":"a","\u01df":"a","\u00e3":"a","\u0227":"a","\u01e1":"a","\u0105":"a","\u0101":"a","\u1ea3":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1eb7":"a","\u1ead":"a","\u1e01":"a","\u01fd":"\u00e6","\u01e3":"\u00e6","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0107":"c",
40
  "\u0109":"c","\u010d":"c","\u010b":"c","\u00e7":"c","\u1e09":"c","\u010f":"d","\u1e0b":"d","\u1e11":"d","\u0111":"d","\u1e0d":"d","\u1e13":"d","\u1e0f":"d","\u00f0":"d","\ua77a":"d","\u01c6":"\u01f3","\u00e9":"e","\u00e8":"e","\u0115":"e","\u00ea":"e","\u1ebf":"e","\u1ec1":"e","\u1ec5":"e","\u1ec3":"e","\u011b":"e","\u00eb":"e","\u1ebd":"e","\u0117":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u0113":"e","\u1e17":"e","\u1e15":"e","\u1ebb":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u1e19":"e",
41
  "\u1e1b":"e","\u1e1f":"f","\ua77c":"f","\u01f5":"g","\u011f":"g","\u011d":"g","\u01e7":"g","\u0121":"g","\u0123":"g","\u1e21":"g","\ua7a1":"g","\u1d79":"g","\u0125":"h","\u021f":"h","\u1e27":"h","\u1e23":"h","\u1e29":"h","\u0127":"h","\u210f":"h","\u1e25":"h","\u1e2b":"h","\u1e96":"h","\u00ed":"i","\u00ec":"i","\u012d":"i","\u00ee":"i","\u01d0":"i","\u00ef":"i","\u1e2f":"i","\u0129":"i","\u012f":"i","\u012b":"i","\u1ec9":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u1e2d":"i","\u0135":"j","\u01f0":"j",
@@ -48,149 +48,153 @@ a)}}};return f}({},p,w));n.register("$19",{"\u00e1":"a","\u00e0":"a","\u0103":"a
48
  "\u1fc2":"\u03b7","\u1fc6":"\u03b7","\u1fc7":"\u03b7","\u1fc3":"\u03b7","\u1f30":"\u03b9","\u1f34":"\u03b9","\u1f32":"\u03b9","\u1f36":"\u03b9","\u1f31":"\u03b9","\u1f35":"\u03b9","\u1f33":"\u03b9","\u1f37":"\u03b9","\u03af":"\u03b9","\u1f77":"\u03b9","\u1f76":"\u03b9","\u1fd0":"\u03b9","\u1fd6":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u1fd3":"\u03b9","\u1fd2":"\u03b9","\u1fd7":"\u03b9","\u1fd1":"\u03b9","\u1f40":"\u03bf","\u1f44":"\u03bf","\u1f42":"\u03bf","\u1f41":"\u03bf","\u1f45":"\u03bf",
49
  "\u1f43":"\u03bf","\u03cc":"\u03bf","\u1f79":"\u03bf","\u1f78":"\u03bf","\u1fe4":"\u03c1","\u1fe5":"\u03c1","\u1f50":"\u03c5","\u1f54":"\u03c5","\u1f52":"\u03c5","\u1f56":"\u03c5","\u1f51":"\u03c5","\u1f55":"\u03c5","\u1f53":"\u03c5","\u1f57":"\u03c5","\u03cd":"\u03c5","\u1f7b":"\u03c5","\u1f7a":"\u03c5","\u1fe0":"\u03c5","\u1fe6":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u1fe3":"\u03c5","\u1fe2":"\u03c5","\u1fe7":"\u03c5","\u1fe1":"\u03c5","\u1f60":"\u03c9","\u1f64":"\u03c9","\u1fa4":"\u03c9",
50
  "\u1f62":"\u03c9","\u1fa2":"\u03c9","\u1f66":"\u03c9","\u1fa6":"\u03c9","\u1fa0":"\u03c9","\u1f61":"\u03c9","\u1f65":"\u03c9","\u1fa5":"\u03c9","\u1f63":"\u03c9","\u1fa3":"\u03c9","\u1f67":"\u03c9","\u1fa7":"\u03c9","\u1fa1":"\u03c9","\u03ce":"\u03c9","\u1f7d":"\u03c9","\u1ff4":"\u03c9","\u1f7c":"\u03c9","\u1ff2":"\u03c9","\u1ff6":"\u03c9","\u1ff7":"\u03c9","\u1ff3":"\u03c9","\u0491":"\u0433","\u0450":"\u0435","\u0451":"\u0435","\u04c2":"\u0436","\u045d":"\u0438","\u04e3":"\u0438","\u04ef":"\u0443"});
51
- n.register("$7",function(f,c,h){f.init=function(){function c(a){return f[a]||a}function b(a){return String(a||"").toLowerCase().replace(e,c)}function g(a,d,e){for(var b=a.split(k),q=b.length;0!==q--;)(a=b[q])&&null==e[a]&&(d.push(a),e[a]=!0);return d}function a(a,e){for(var k=[],c={},q,u=e.length;0!==u--;)(q=e[u])&&g(b(q),k,c);d[a]=k}var d=[],e=/[^a-z0-9]/g,k=/[\-_\s.?!;:,*^+=~`"(){}<>\[\]\/\\\u00a0\u1680\u180e\u2000-\u206f\u2e00-\u2e7f\u3000-\u303f]+/,f=n.require("$19","flatten.json");return{find:function(a,
52
- e){var k=[],c=-1,q=d,u=q.length,f,z,h,l,n,y,A=g(b(a),[],{}),G=A.length,F=e?!0:!1;a:for(;++c<u;)if(h=q[c],null!=h&&(l=h.length)){n=0;b:for(;n<G;n++){y=A[n];for(f=0;f<l;f++)if(z=h[f],0===z.indexOf(y))continue b;continue a}k.push(F?e[c]:c)}return k},add:function(a,e){d[a]=g(b(e),[],{})},push:function(e){a(d.length,e)},index:function(d,e){a(d,e)},size:function(){return d.length},clear:function(){d=[]},remove:function(a){d[a]=null}}};return f}({},p,w));n.register("$22",function(f,c,h){f.create=function(){var c=
53
- [],b=n.require("$7","fulltext.js").init();return{add:function(g,a){b.add(c.length,a);c.push(g);return this},find:function(g){return b.find(g,c)},clear:function(){c=[];b.clear();return this}}};return f}({},p,w));n.register("$10",function(f,c,p){function l(b){-1===b.indexOf("?")&&(b="/auto/"+b+".json?q=");this.url=b;this.dead={}}function b(){this.dict=n.require("$22","dict.js").create()}f.init=function(g){function a(){if("hint"!==G){var a=y.val()&&!(I&&I.val())&&null==C&&!B;V[a?"addClass":"removeClass"]("error")}}
54
- function d(a){I&&I.val(a)}function e(){p.show();var a=y.outerWidth(!1),d=y.outerHeight(!1),e=y.css("margin-top");e&&(e=parseInt(e),isNaN(e)||(d+=e));a-=2;p.css("top",d+"px").css("width",a+"px");B=!0}function k(){p.hide();B=!1}function c(){p.html("");k();u=0;v=C=null}function f(d){c();var b;for(b=0;b<d.length;b++){var q=b,k=d[b],g=k.value,t=k.lang||g.lang,y=h('<span class="label"></span>').text(k.label),B=h('<div class="auto-comp-result"></div>'),s=void 0,A=void 0;if(A=k.icon)s=h("<span></span>").attr("class",
55
- A).appendTo(B),t?(s.attr("lang",t),k.lang=t):-1!==A.indexOf("lang-"+g)&&(s.attr("lang",g),k.lang=g);for(A in k)B.data(A,k[A]);B.append(y);m(q,B)}(u=d.length)?(D&&e(),r(0)):(r(null),a(),V.trigger("locoAutonone",[]))}function m(a,d){p.append(d);d.click(function(e){e.stopPropagation();r(a,d);q();return!1});return d}function r(a,e){v&&(v.removeClass("selected"),v=null);C=null;null==a?d(""):(e||(e=p.find("div.auto-comp-result").eq(a)),e.length&&(e.addClass("selected"),C=a,v=e))}function t(a){if(u){var d=
56
- u-1;null==C?a=0<a?0:d:(a=C+a,0>a?a=d:a>d&&(a=0));return r(a)}}function q(){if(null==C)w.val(""),d("");else{var e=p.find("div.auto-comp-result").eq(C),b=e.data()||{label:"Error"},q=b.value,g=b.label;d(q);w.val(g);k();e=e.clone();e.data(b);c();m(0,e);u=1;r(0,e);a();e.trigger("locoAutocomp",[q,g,e])}}var u=0,B=!1,D=!1,E=g.form,C=null,v=null,y=h(g),A=y.attr("name"),G=y.attr("data-mode"),F=y.attr("data-provider"),I="hint"!==G&&h('<input type="hidden" value="" name="'+A+'" />').appendTo(E),V=h('<div class="auto-comp-wrap"></div>').replaceAll(y),
57
- p=h('<div class="auto-comp-drop"></div>');F&&(F=new l(F));I&&y.attr("name","_"+A);y.attr("autocomplete")||y.attr("autocomplete","off");V.append(y).append(p);k();y.focus(function(a){D=!0;1<u&&e()}).blur(function(d){D=!1;a()}).keydown(function(a){function d(){a.preventDefault();a.stopPropagation();return!1}switch(a.keyCode){case 27:B&&(a.stopPropagation(),k(),y.blur());break;case 40:u&&(B?t(1):e());break;case 38:B&&t(-1);break;case 13:if(B)return q(),d();if(!C&&"hint"!==G)return d()}return!0});var w=
58
- n.require("$8","LocoTextListener.js").listen(y,function(a){F&&F.fetch(a,f)});(E=y.attr("data-pre"))&&(E=h.parseJSON(E))&&E.value&&E.label?(f([E]),q()):!g.value||I&&I.val()||!F||F.fetch(g.value,function(a){f(a);q()});return{$:y,val:function(){return I&&I.val()},clear:c,reset:function(){c();y.val("");d("");w.ping()},force:function(a,e){c();d(e||"");w.val(a)},preload:function(a){u&&c();F=new b;var d,e;for(d in a)e=a[d],F.add(e)},mode:function(a){G=a},provide:function(a){F=new l(a)}}};l.prototype.fetch=
59
- function(b,a){if(!b)return a&&a([]),this.dead={},this;var d,e=this.dead;for(d in e)if(0===b.indexOf(d))return a&&a([]),this;d={dataType:"json",url:this.url+encodeURIComponent(b)};n.require("$21","http.js").ajax(d,function(d){var c=d&&d.results;c&&(a&&d.query&&d.query===b&&a(d.results),c.length||(e[b]=0));return!0});return this};b.prototype.add=function(b){var a=b.fulltext||b.label||b.value;a&&this.dict.add(b,a)};b.prototype.fetch=function(b,a){var d=b?this.dict.find(b):[];a&&a(d);return this};return f}({},
60
- p,w));n.register("$9",function(f,c,p){function l(a){a.stopPropagation();a.preventDefault();return!1}function b(a,d,e){if(e=e||a.getElement(d))e.off().mouseup(function(e){e.stopPropagation();a.selectIndex(d,!0);return!1}).mouseover(function(){h(this).addClass("over");a.hover=d;return!0}).mouseout(function(){h(this).removeClass("over");a.hover=-1;return!0}),e=null;return a}function g(a){if(a){var d,e=a[0],b=e.id,c=e.title,g=[],f=[],r=-1,t=e.options.length,q,u=this.selectedIcon||"";this.id=b||"";this.name=
61
- e.name||"";this.prefix=e.getAttribute("data-prefix");for(this.defaultIcon=e.getAttribute("data-icon")||"icon no-icon";++r<t;)d=e.options[r],q=d.disabled,d.selected&&g.push(r),d=h(d),f.push([d.val(),d.text(),d.attr("data-icon")||u,q,d.attr("lang")]);this.hidden||(this.hidden=h('<input type="hidden" name="'+this.name+'" value="" />').appendTo(e.form));this.list=h('<ul class="clearfix"></ul>');this.icon=h('<span class="icon"> </span>');this.selection=h('<span class="label"></span>');this.handle=h('<a class="handle" href="#"></a>').attr("tabindex",
62
- a.attr("tabindex")||"").append(this.icon).append(this.selection);d=h('<div class="selector"></div>').addClass(e.className).append(this.handle).append(this.list).replaceAll(e);b&&d.attr("id",b);c&&a.hasClass("hastip")&&(d.attr("title",c),n.require("$20","tooltip.js").init(d,{gravity:a.attr("data-gravity")||"s",anchor:a.attr("data-anchor")}));this.wrapper=d;for(this.clearOptions();d=f.shift();)this.addOption.apply(this,d);this.enable();this.close();if(t=g.length)for(r=0;r<t;r++)this.selectIndex(g[r]);
63
- else r=e.selectedIndex,null!=r&&0<=r&&this.selectIndex(r)}}f.create=function(a){return new g(a)};f.extend=function(a){a.parent=g;a.prototype=new g};c=g.prototype;c.enable=function(){var a=this;a.handle.click(function(a){a.preventDefault();return!1}).mouseover(function(d){return a.onRollover(d)}).mouseout(function(d){return a.onRollout(d)}).mousedown(function(d){return a.onPress(d)}).keydown(function(d){return a.onKeydown(d)});h(p).mouseup(function(d){return a.onRelease(d)}).keydown(function(d){return a.onGlobalKeydown(d)})};
64
- c.onRollover=function(a){return this.over=!0};c.onRollout=function(a){this.over=!1;return!0};c.onPress=function(a){return this.active?this.over?(this.close(),a.stopPropagation(),a.preventDefault(),!1):!0:(this.open(),a.stopPropagation(),a.preventDefault(),this.handle.focus(),!1)};c.onRelease=function(a){this.active&&!this.over&&this.close();return!0};c.onGlobalKeydown=function(a){if(this.active)switch(a.keyCode){case 27:return this.close(),l(a);case 40:return this.hoverNext(1),l(a);case 38:return this.hoverNext(-1),
65
- l(a);case 13:if(-1!=this.hover)return this.selectIndex(this.hover,!0),this.hoverItem(-1),this.close(),l(a)}return!0};c.onKeydown=function(a){return this.active||40!==a.keyCode?!0:(this.open(),l(a))};c.open=function(){var a=this.list,d=this.wrapper,e=d.data("tipsy"),b=this.handle,c=b.outerHeight()||0;this.active=!0;this.hover=-1;d.addClass("active");a.show().css("top",c+"px");e&&e.disable();d=b.outerWidth()||0;e=a.outerWidth()||0;d>e&&(e-=a.width(),a.css("min-width",String(d-e)+"px"))};c.close=function(){var a=
66
- this.wrapper,d=a.data("tipsy");this.list.hide();this.active=!1;-1!==this.hover&&(this.getElement(this.hover).removeClass("over"),this.hover=-1);a.removeClass("active");d&&d.enable()};c.hoverItem=function(a,d){-1!==this.hover&&this.getElement(this.hover).removeClass("over");this.hover=a;-1!==a&&(d=d||this.getElement(a),d.addClass("over"))};c.hoverNext=function(a){var d=this.options.length;if(d){d-=1;if(-1==this.hover)a=0<a?0:d;else{a=this.hover+a;if(0>a){this.close();return}a>d&&(a=0)}this.hoverItem(a)}};
67
- c.enableChange=function(a){this.eventName=a;this.eventData=[].slice.call(arguments,1);return this};c.enableConfirm=function(a){this.confirm=a;return this};c.clearOptions=function(){this.index={};this.length=0;this.options=[];this.list.html("");this.hidden.val("");this.idx=this.hover=-1;return this};c.destroy=function(){this.clearOptions();this.hidden.remove()};c.addOption=function(a,d,e,k,c){var g=this.options.length,f=h("<span></span>").addClass(e||"icon no-icon"),r=h('<span class="label"></span>').text(d||
68
- a),r=h("<li></li>").append(f).append(r).appendTo(this.list);c?c=c.split("-").shift():e&&-1!==e.indexOf("lang-"+a)&&(c=a);c&&f.attr("lang",c);r.attr("data-option",g);this.options[g]={value:a,text:d,lang:c||"",icon:e};this.index[a]=g;this.length=g+1;k?this.disableIndex(g):b(this,g,r);return g};c.disableOption=function(a){return this.disableIndex(this.index[a])};c.disableIndex=function(a){(a=this.getElement(a))&&a.addClass("disabled").off();return this};c.enableOption=function(a){return this.enableIndex(this.index[a])};
69
- c.enableIndex=function(a){return b(this,a)};c.reIndex=function(){this.index={};this.length=0;for(var a=this.options.length;0!==a--;)this.index[this.options[a].value]=a,this.length++};c.selectValue=function(a,d){return this.selectIndex(this.index[a],d)};c.selectIndex=function(a,d){var e=this.options[a];if(e){var b=this,c=b.idx,g=e.value,f=e.icon||b.defaultIcon,r=function(){null!=c&&b.getElement(c).removeClass("active");b.getElement(a).addClass("active");b.setLabel(e.text).setIcon(f,e.lang);b.hidden.val(g);
70
- b.idx=a;d&&b.change()};c===a?b.hidden.val(g):d?"function"===typeof b.confirm?b.confirm.call(null,e,function(a){a&&r()}):b.beforeChange(g)&&r():r();b.active&&b.close()}return this};c.setLabel=function(a){this.selection.text(a);this.prefix&&this.selection.prepend(h('<span class="prefix"></span>').text(this.prefix));return this};c.setIcon=function(a,d){this.icon.attr("class",a).attr("lang",d||"");return this};c.val=function(){var a=this.options[this.idx];return a&&a.value};c.change=function(){var a=
71
- this.val(),d=this.save,e=this.eventName||"change",b=[a].concat(this.eventData||[]);this.wrapper.trigger(e,b);d&&d(a);return this};c.beforeChange=function(a){var d=h.Event("locoBeforeSelect");this.wrapper.trigger(d,[a]);return!d.isDefaultPrevented()};c.renameOption=function(a,d){var e=this.index[a],b=this.options[e];b&&(b.text=d,this.getElement(e).find("span.label").text(d),e===this.idx&&this.setLabel(d));return this};c.removeOption=function(a){var d=this.index[a],e=this.options[d];e&&(a=this.val(),
72
- this.getElement(d).remove(),this.options.splice(d,1),this.reIndex(),a===e.value?this.selectIndex(0,!0):this.selectValue(a,!1))};c.getElement=function(a){return this.list.find("li").eq(a)};c.persist=function(a){var d=this.id||this.name,e=a.fetch(d);null!=e&&this.selectValue(e,!0);this.save=function(e){a.store(d,e)};return this};c.listen=function(a){return this.on(this.eventName||"change",a)};c.on=function(a,d){this.wrapper.on(a,d);return this};c=null;return f}({},p,w));n.register("$30",function(f,
73
- c,p){function l(b){var c=[],a=h([]);this.hidden=a;this.selected=c;this.selectedIcon="icon icon-checkbox";this.constructor.call(this,b);this.wrapper.addClass("multi");for(var d,e,k,f=h('<input type="checkbox" name="'+this.name+'[]" />')[0],s=this.options,m=s.length,r=-1;++r<m;)d=this.getElement(r)[0],k=f.cloneNode(!0),c[r]&&(k.checked=!0),k.setAttribute("value",s[r].value),a.push(d.appendChild(k));(e=this.defaultIcon)&&this.setIcon(e);(e=b.attr("title"))?this.setLabel(e):this.wrapper.addClass("no-title")}
74
- f.create=function(b){return new l(b)};n.require("$9","LocoSelector.js").extend(l);c=l.prototype;c.selectIndex=function(b,c){return this.setIndexState(b,!this.selected[b],c)};c.setIndexState=function(b,c,a){var d=this.options[b],e=this.getElement(b),k=this.hidden[b],f=this.selected;d&&c!==f[b]&&(f[b]=c,e[c?"addClass":"removeClass"]("checked"),k&&(k.checked=c),a&&this.change());return this};c.selectValue=function(b,c){if(null==b.pop)return l.parent.prototype.selectValue.call(this,b,c);for(var a=this.selected.slice(),
75
- d=this.options.length,e=!1,k=-1,f=-1;++k<d;)a[k]&&(e=!0),a[k]=!1;if(d=b.length)for(;++f<d;)k=this.index[b[f]],!1===a[k]&&(e=a[k]=!0);if(e){for(k in a)this.setIndexState(k,a[k]);c&&this.change()}return this};c.val=function(){for(var b=[],c=this.options,a=this.selected,d=a.length,e=-1;++e<d;)a[e]&&b.push(c[e].value);return b};c=null;return f}({},p,w));n.register("$16",function(f,c,p){var l=c.ieVersion;f.ie=function(b){return b?l<=b:l};var b=f.init=function(c){c?c instanceof jQuery||(c=h(c)):c=h(p.body);
76
- var a=n.require("$28","ga.js"),d=n.require("$17","forms.js"),e=n.require("$29","modal.js"),k=n.require("$10","LocoAutoComplete.js"),z=n.require("$9","LocoSelector.js"),s=n.require("$30","LocoMultiSelector.js"),m=n.require("$20","tooltip.js");c.find("form").each(function(a,b){var q=h(b);l&&10>l&&d.placeholders(q);b.getAttribute("data-modal")?e.initForm(b):b.action&&0!==q.attr("action").indexOf("#")&&!b.target&&d.jsonify(b);q.hasClass("hasreveal")&&d.revealify(q);q.find("input.auto-comp").each(function(a,
77
- d){k.init(d)});q.find("select.selector").each(function(a,d){d.hasAttribute("multiple")?s.create(h(d)):z.create(h(d))});q.find("button.hastip").each(function(a,d){m.init(h(d))})});c.find("a").each(function(d,c){-1!==c.className.indexOf("hastip")&&m.init(h(c));if(-1!==c.href.indexOf("/modal/")||c.getAttribute("data-modal"))e.initLink(h(c));else{a.link(c);var q=c.getAttribute("data-ajax-target");q&&(q=h("#"+q),h(c).click(function(a){a.preventDefault();q.addClass("loading");h.get(c.href,function(a){a=
78
- f.$(a).replaceAll(q);b(a);a.trigger("locoAhah")});return!1}))}});d=e=k=c=null;return f};f.$=function(b){return h(c.innerShiv?innerShiv(b,!1):b)};h.fn._html=function(g){return null!=g?(g=this.html(c.innerShiv?innerShiv(g,!1):g),b(this),g):j.html()};h.fn.macro=function(b,a){if("function"!==typeof b.run)throw Error("macro has no run function");b.run(this,a||{});return this};f.el=function(b,a){var d=p.createElement(b||"div");a&&(d.className=a);return d};f.txt=function(b){return p.createTextNode(b||"")};
79
- f.h=function(){function b(){e=/[<>&]/g;c=/(\r\n|\n|\r)/g;f=/(?:https?):\/\/([a-zA-Z0-9\-_\.\?%~&;=\/]+(?:#.*)?)/g;b=null}function a(a){return"&#"+a.charCodeAt(0)+";"}function d(a,d){return'<a href="'+a+'">'+d+"</a>"}var e,c,f;return function(h,m){b&&b();var r=h.replace(e,a);m&&(r=r.replace(c,"<br />").replace(f,d));return r}}();f.noop=function(b){b.preventDefault();b.stopPropagation();return!1};return f}({},p,w));n.register("$17",function(f,c,p){function l(a){function d(){a.value===c&&(a.value="",
80
- b.removeClass("placeheld"));return!0}function e(){""===a.value&&(a.value=c,b.addClass("placeheld"));return!0}var b=h(a);if(!b.hasClass("auto-comp")){var c=b.attr("placeholder");if(c)return b.focus(d).blur(e),e(),{kill:function(){d();b.off("focus",d).off("blur",e)}}}}var b=f.enable=function(a){function d(a,d){d.getAttribute("data-was-disabled")||(d.disabled=!1)}a.find(".button").removeClass("loading");a.find("button").each(d);a.find("input").each(d);a.find("select").each(d);a.find("textarea").each(d);
81
- c.attachEvent&&a.hasClass("has-placeholders")&&f.placeholders(a);delete a._disabled},g=f.disable=function(a){function d(a,d){d.disabled?d.setAttribute("data-was-disabled","true"):d.disabled=!0}a._disabled||(a.find(".button").addClass("loading"),a.find("button").each(d),a.find("input").each(d),a.find("select").each(d),a.find("textarea").each(d),a._disabled=!0)};f.jsonify=function(a,d,e){a instanceof jQuery||(a=h(a));a.disable||(h.fn.disable=function(){g(this);return this},h.fn.enable=function(){b(this);
82
- this.placehold&&this.placehold();return this});var k="";a.find('[type="submit"]').click(function(a){a&&a.target&&a.target.name&&(k=encodeURIComponent(a.target.name)+"="+encodeURIComponent(a.target.value));return!0});a.submit(function(b){if(b&&b.isDefaultPrevented&&b.isDefaultPrevented()||e&&!1===e(b))return!1;var f=c.tinyMCE;f&&a.find("textarea.editor").each(function(a,d){var b=f.get(d.id);b&&b.save()});var g=a.serialize(),g=g.replace(/%0D%0A/g,"%0A");k&&(g&&(g+="&"),g+=k,k="");a.disable();var q=
83
- n.require("$21","http.js"),g={url:q.jsonLink(a.attr("action")),type:a.attr("method"),data:g};q.ajax(g,d,function(){a.enable()},a);b.preventDefault();b.stopPropagation();return!1});if(a.hasClass("autopost")){var f,s=Number(a.attr("data-autopost-delay")||500);a.find('input[type="checkbox"]').change(function(){f&&clearTimeout(f);f=setTimeout(function(){a.submit()},s);return!0})}};f.revealify=function(a){a=a.closest("form");a.find("div[data-reveal-if]").each(function(d,b){function c(a){var d;B=B||a.target;
84
- if("."===q)d=Boolean(B&&B[u]),r&&(d=!d);else{var b,e=h(B.form).serializeArray();for(b in e)e[b].name===t&&(d=e[b].value);d=r?u!==d:u===d}if(d!==m)if(m=d,a)f[m?"slideDown":"slideUp"](200);else f[m?"show":"hide"]();return!0}var f=h(b),g=/^(\!?)([_\w\-\[\]]+)(\.|!?=)(.*)$/.exec(f.attr("data-reveal-if"));if(g){var m,r=g[1],t=g[2],q=g[3],u=g[4],g=a[0][t];if(g.type||null==g.length)g=[g];d=g.length;for(var B;0!==d--;)B=g[d],c(),h(B).change(c).removeClass("jshide");g=g=B=null}});a=null};f.linkify=function(a){var d=
85
- a.getAttribute("data-icon");if(d){var b=h(a),c=h("<a> </a>");c.attr("href",a.form.action);c.attr("class",b.attr("class"));c.attr("tabindex",b.attr("tabindex"));b.attr("tabindex","-1");c.text(b.val());d&&h("<span></span>").prependTo(c).addClass(d);b.hide().after(c);c.click(function(a){b.click();return!1})}};f.placeholders=function(a){var d,b=[];a.find("input[placeholder]").each(function(a,c){"password"!==c.type&&(d=l(c))&&b.push(d)});b.length&&(a.submit(function(){for(var a in b)b[a].kill()}),a.addClass("has-placeholders"),
86
- d=i=null)};return f}({},p,w));n.register("$4",function(f,c,p){function l(a,d,b){function e(){c();k=setTimeout(d,b)}function c(){k&&clearTimeout(k);k=null}var k;e();h(a).mouseenter(c).mouseleave(e);return{die:function(){c();h(a).off("mouseenter mouseleave")}}}function b(a,d){a.fadeTo(d,0,function(){a.slideUp(d,function(){a.remove();h(c).triggerHandler("resize")})})}function g(a,d){function e(d){k[f]=null;b(h(a),250);g&&g.die();var c;if(c=d)d.stopPropagation(),d.preventDefault(),c=!1;return c}var g,
87
- f;h('<button type="button" class="notice-dismiss" href="#"> </a>').prependTo(a).click(e);h(c).triggerHandler("resize");z();f=k.length;k.push(e);d&&(g=l(a,e,d))}function a(a,d,b){var e=n.require("$16","html.js");a=h('<div class="notice notice-'+a+'" loco-notice inline></div>').prependTo(h("#loco-notices"));var c=h(e.el("p"));b=h(e.el("span")).text(b);d=h(e.el("strong","has-icon")).text(d+": ");c.append(d).append(b).appendTo(a);return a}function d(d,b,e,k){d=a(e,b,d).hide().fadeIn(500);h(c).triggerHandler("resize");
88
- g(d,k);return f}function e(){h("#loco-notices").find("div.notice").each(function(a,d){g(d,!1)})}var k=[],z=Date.now||function(){return(new Date).getTime()},s,m,r,t;f.error=function(a){return d(a,s,"error")};f.warning=function(a){return d(a,m,"warning")};f.info=function(a){return d(a,r,"info")};f.success=function(a){return d(a,t,"success",5E3)};f.log=function(){c.console&&console.log&&console.log.apply(console,arguments)};f.debug=function(a,d){c.console&&console.error&&(console.error("Loco Error: "+
89
- a),d&&console.debug&&console.debug(d))};f.clear=function(){for(var a=-1,d,b=k,e=b.length;++a<e;)(d=b[a])&&d();k=[];return f};f.create=a;f.raise=function(a){var d=f;(d[a.type]||d.error).call(d,a.message)};f.init=function(a){s=a._("Error");m=a._("Warning");r=a._("Notice");t=a._("OK");setTimeout(e,1E3);return f};return f}({},p,w));n.register("$5",function(f,c,p){function l(d,b,c,f){function m(a,b,k){var f=g||{_:function(a){return a}},m=a.responseText,s=h("<pre>"+m+"</pre>").text();s&&(s=s.replace(/(^\s+|\s+$)/g,
90
- ""));s||(s=m);r.debug("Ajax failure for "+d,{status:a.status,error:b,message:k,output:m});r.log(f._("Provide the following text when reporting a problem")+":\n--8<--\n",s,"\n------");"parsererror"===b?(m=f._("Check console output for debugging information"),(s=s.split(/[\r\n]/)[0])?(s=s.replace(/ +in +\S+ on line \d+/,""),s=s.replace(/^[()! ]+Fatal error:\s*/,""),r.error(s+".\n"+m)):r.error(f._("Server returned invalid data")+". "+m)):r.error(k||f._("Unknown error"));c&&c(a,b,k)}f.url=a;f.dataType=
91
- "json";f.error=m;f.success=function(a,d,e){var c=a&&a.data,f=a&&a.notices,g=f&&f.length;for(!c||a.error?m(e,d,a&&a.error&&a.error.message):b&&b(c,d,e);g--;)r.raise(f[g])};var r=n.require("$4","notices.js").clear();return h.ajax(f)}var b={},g,a=c.ajaxurl||"/wp-admin/admin-ajax.php",d=c.encodeURIComponent;f.init=function(a){b=a.nonces||b;return f};f.localise=function(a){g=a;return f};f.submit=function(a,d,b){function c(){f.removeClass("loading");n.require("$17","forms.js").enable(f)}var f=h(a),g=f.serialize();
92
- f.addClass("loading");n.require("$17","forms.js").disable(f);return l(a.route.value,function(a,b,e){c();d&&d(a,b,e)},function(a,d,e){c();b&&b(a,d,e)},{type:a.method,data:g})};f.post=function(a,f,g,s){var m;(m=b[a])||(c.console&&console.debug&&console.debug('No nonce for "'+a+'"'),m="");m="action=loco_json&route="+d(a)+"&loco-nonce="+d(m);(f=f?h.param(f):"")&&(m+="&"+f);return l(a,g,s,{type:"post",data:m})};f.setNonce=function(a,d){b[a]=d;return f};return f}({},p,w));n.register("$18",{arab:1,aran:1,
93
- hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});n.register("$6",function(f,c,h){function l(){}var b,g,a=n.require("$18","rtl.json");f.init=function(){return new l};f.cast=function(a){return a instanceof l?a:"string"===typeof a?f.parse(a):f.clone(a)};f.clone=function(a){var b,c=new l;for(b in a)c[b]=a[b];return c};f.parse=function(a){b||
94
- (g=/[-_+]/,b=/^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?(?:-([0-9][a-z0-9]{3,8}|[a-z0-9]{5,8}))?(?:-([a-z]-[-a-z]+))?$/i);a=String(a).split(g).join("-");if(!b.exec(a))return null;var e=new l;e.lang=RegExp.$1.toLowerCase();if(a=RegExp.$2)e.script=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();if(a=RegExp.$3)e.region=a.toUpperCase();if(a=RegExp.$4)e.variant=a.toLowerCase();if(a=RegExp.$5)e.extension=a;return e};c=l.prototype;c.isValid=function(){return!!this.lang};c.isKnown=function(){var a=
95
- this.lang;return!(!a||"zxx"===a)};c.toString=function(a){a=a||"-";var b,c=this.lang||"zxx";if(b=this.script)c+=a+b;if(b=this.region)c+=a+b;if(b=this.variant)c+=a+b;if(b=this.extension)c+=a+b;return c};c.getIcon=function(){for(var a=4,b,c,f=["variant","region","script","lang"],g=[];0!==a--;)if(b=f[a],c=this[b])1===a&&3===c.length?g.push("region-m49"):g=g.concat([b,b+"-"+c.toLowerCase()]);return g.join(" ")};c.isRTL=function(){return!!a[String(this.script||this.lang).toLowerCase()]};c=null;return f}({},
96
- p,w));n.register("$32",function(f,c,h){function l(a){c.console&&console.error&&console.error(a)}function b(){l("Method not implemented")}function g(){}function a(a){}g.prototype.toString=function(){return"[Undefined]"};a.prototype._validate=function(a){var e,c,f=!0;for(e in this)c=this[e],c===b?(l(a+"."+e+"() must be implemented"),f=!1):c instanceof g&&(l(a+"."+e+" must be defined"),f=!1);return f};f.init=function(d,e){var c,f=new a;if(d)for(c=d.length;0!==c--;)f[d[c]]=b;if(e)for(c=e.length;0!==c--;)f[e[c]]=
97
- new g;return f};f.validate=function(a){var b=/function (\w+)\(/.exec(a.toString())?RegExp.$1:"";a.prototype._validate(b||"Object")};return f}({},p,w));n.register("$40",function(f,c,h){var l=c.requestAnimationFrame,b=c.cancelAnimationFrame,g=0;if(!l||!b)for(var a in{ms:1,moz:1,webkit:1,o:1})if(l=c[a+"RequestAnimationFrame"])if(b=c[a+"CancelAnimationFrame"]||c[a+"CancelRequestAnimationFrame"])break;l&&b||(l=function(a){var b=d();timeToCall=Math.max(0,16-(b-g));nextTime=b+timeToCall;timerId=c.setTimeout(function(){a(nextTime)},
98
- timeToCall);g=nextTime;return timerId},b=function(a){clearTimeout(a)});var d=Date.now||function(){return(new Date).getTime()};f.loop=function(a,d){function c(){g=l(c,d);a(f++)}var f=0,g;c();return{stop:function(){g&&b(g);g=null}}};return f}({},p,w));n.register("$37",function(f,c,h){function l(b,d,e,c){if(a){var f=e;e=function(a){if((a.MSPOINTER_TYPE_TOUCH||"touch")===a.pointerType)return f(a)}}b.addEventListener(d,e,c);return{unbind:function(){b.removeEventListener(d,e,c)}}}function b(a){a.preventDefault();
99
- a.stopPropagation();return!1}var g,a=!!c.navigator.msPointerEnabled,d=a?"MSPointerDown":"touchstart",e=a?"MSPointerMove":"touchmove",k=a?"MSPointerUp":"touchend";f.ok=function(a){null==g&&(g="function"===typeof h.body.addEventListener);g&&a&&a(f);return g};f.ms=function(){return a};f.dragger=function(a,c){function f(b){a.addEventListener(b,g[b],!1)}function q(b){a.removeEventListener(b,g[b],!1)}var g={};g[d]=function(a){z(a,function(b,e){e.type=d;c(a,e,h)});f(e);f(k);return!0};g[k]=function(a){q(e);
100
- q(k);z(a,function(b,d){d.type=k;c(a,d,h)});return!0};g[e]=function(a){z(a,function(b,d){d.type=e;c(a,d,h)});return b(a)};f(d);var h={kill:function(){q(d);q(e);q(k);a=h=c=null}};return h};f.swiper=function(c,f,g){function q(a){c.addEventListener(a,v[a],!1)}function u(a){c.removeEventListener(a,v[a],!1)}function h(){D&&D.stop();D=null}var D,l,C,v={},y=[],A=[],G=[];v[d]=function(a){l=!1;h();var b=s();z(a,function(a,d){y[a]=b;A[a]=d.clientX;G[a]=d.clientY});C=c.scrollLeft;return!0};v[k]=function(a){z(a,
101
- function(a,b){var d=s()-y[a],e=A[a]-b.clientX,d=Math.abs(e)/d;f(d,e?0>e?-1:1:0)});C=null;return!0};v[e]=function(a){var d,e;null==C||z(a,function(a,b){d=A[a]-b.clientX;e=G[a]-b.clientY});if(e&&Math.abs(e)>Math.abs(d))return l=!0;d&&(l=!0,c.scrollLeft=Math.max(0,C+d));return b(a)};if(!a||g)q(d),q(e),q(k),a&&(c.className+=" mstouch");return{kill:function(){u(d);u(e);u(k);h()},swiped:function(){return l},ms:function(){return a},snap:function(b){a&&!g&&(c.style["-ms-scroll-snap-points-x"]="snapInterval(0px,"+
102
- b+"px)",c.style["-ms-scroll-snap-type"]="mandatory",c.style["-ms-scroll-chaining"]="none")},scroll:function(a,b,d){h();var e=c.scrollLeft,f=a>e?1:-1,g=Math[1===f?"min":"max"],q=Math.round(16*b*f);return D=n.require("$40","fps.js").loop(function(b){b&&(e=Math.max(0,g(a,e+q)),c.scrollLeft=e,a===e&&(h(),d&&d(e)))},c)}}};f.start=function(a,b){return l(a,d,b,!1)};f.move=function(a,b){return l(a,e,b,!1)};f.end=function(a,b){return l(a,k,b,!1)};var z=f.each=function(b,d){if(a)(b.MSPOINTER_TYPE_TOUCH||"touch")===
103
- b.pointerType&&d(0,b);else for(var e=-1,c=(b.originalEvent||b).changedTouches||[];++e<c.length;)d(e,c[e])},s=Date.now||function(){return(new Date).getTime()};return f}({},p,w));n.register("$41",function(f,c,n){f.init=function(c){function b(){e.style.top=String(-c.scrollTop)+"px";return!0}function f(){var b=e;b.textContent=c.value;b.innerHTML=b.innerHTML.replace(/[ \t]/g,a).split(/(?:\r\n|\r|\n)/).join('<span class="eol crlf"></span>\r\n')+'<span class="eol eof"></span>';return!0}function a(a,b){return'<span class="x'+
104
- a.charCodeAt(0).toString(16)+'">'+a+"</span>"}var d=c.parentNode,e=d.insertBefore(n.createElement("div"),c);h(c).on("input",f).on("scroll",b);h(d).addClass("has-mirror");e.className="ta-mirror";var k=c.offsetWidth-c.clientWidth;2<k&&(e.style.marginRight=String(k-2)+"px");f();b();return{kill:function(){h(c).off("input",f).off("scroll",b);d.removeChild(e);e=null;h(d).removeClass("has-mirror")}}};return f}({},p,w));n.register("$43",function(f,c,h){function l(a,d){for(var e=0,f=-1,g=d&&c[d],h=b[a]||[],
105
- m=h.length;++f<m;)callback=h[f],"function"===typeof callback&&(callback(g),e++);return e}var b={},g;f.load=function(a,d,e){function f(){m&&(clearTimeout(m),m=null);r&&(r.onreadystatechange=null,r=r=r.onload=null);a&&(delete b[a],a=null)}function g(b,d){var c=r&&r.readyState;if(d||!c||"loaded"===c||"complete"===c)d||l(a,e),f()}function s(){if(0===l(a))throw Error('Failed to load "'+(e||a)+'"');f()}if(e&&c[e])"function"===typeof d&&d(c[e]);else if(null!=b[a])b[a].push(d);else{b[a]=[d];var m=setTimeout(s,
106
- 4E3),r=h.createElement("script");r.setAttribute("src",a);r.setAttribute("async","true");r.onreadystatechange=g;r.onload=g;r.onerror=s;r.onabort=f;h.getElementsByTagName("head")[0].appendChild(r)}};f.stat=function(a){var b;if(!(b=g)){for(var e,c,f=h.getElementsByTagName("script"),s=-1,m=f.length;++s<m;)if(b=f[s].getAttribute("src"))if(e=b.indexOf("/static/"),-1!==e){c=b.substr(0,e+7);break}b=g=c||"/static"}return b+a};return f}({},p,w));n.register("$42",function(f,c,p){function l(a,b){a.setReadOnly(!1);
107
- a.on("change",function(a,d){return b.val(d.getValue())});a.on("focus",function(a,d){return b.focus()});a.on("blur",function(a,d){return b.blur()})}function b(a){a.off("change");a.off("focus");a.off("blur")}function g(a){b(a);a.setReadOnly(!0);a.setHighlightGutterLine(!1);a.setHighlightActiveLine(!1)}function a(a){function b(){this.$rules={start:[{token:"empty_line",regex:"^$"},{token:"constant.language",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"printf",regex:"%(?:\\d+\\$)?[-+]?(?:'.)?[ 0]*-?\\d*(?:\\.d+)?[bcdeEfFgGosuxX%]"},
108
- {token:"printf",regex:"%(?:\\d+\\$)?[-,'+#0 (]*\\d*(?:\\.\\d+|\\.\\*)?[sScCuidoxXfFeEgGaAbBpn%@]"},{defaultToken:"text"}]}}function c(){this.HighlightRules=b}a=a.require;var f=a("ace/lib/oop");f.inherits(b,a("ace/mode/text_highlight_rules").TextHighlightRules);f.inherits(c,a("ace/mode/text").Mode);return new c}f.init=function(d,e){var c,f=!1,s=d.parentNode,m=s.appendChild(p.createElement("div"));n.require("$43","remote.js").load("https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js",function(b){if(m){if(!b)throw Error("Failed to load code editor");
109
- c=b.edit(m);var t=c.session,q=c.renderer;c.$blockScrolling=Infinity;c.setShowInvisibles(f);c.setWrapBehavioursEnabled(!1);c.setBehavioursEnabled(!1);c.setHighlightActiveLine(!1);t.setUseSoftTabs(!1);q.setShowGutter(!0);q.setPadding(10);q.setScrollMargin(8);t.setMode(a(b));h(s).addClass("has-proxy has-ace");c.setValue(d.value,-1);t.setUseWrapMode(!0);e?l(c,e):g(c)}},"ace");return{kill:function(){c&&(b(c),c.destroy(),c=null);m&&(s.removeChild(m),h(s).removeClass("has-proxy has-ace"),m=null);return this},
110
- disable:function(){c&&g(c);e=null;return this},enable:function(a){e=a;c&&l(c,a);return this},resize:function(){c&&c.resize();return this},val:function(a){c&&c.setValue(a,-1);return this},invs:function(a){a=a||!1;f!==a&&(f=a,c&&c.setShowInvisibles(a));return this}}};return f}({},p,w));n.register("$38",function(f,c,p){function l(a){function b(){s&&m.off("input",e);s=!1;return!0}function e(){var b=a.value;b!==t&&(m.trigger("changing",[b,t]),t=b)}function c(){g=a;q=t;s||m.on("input",e);s=!0;m.trigger("editFocus");
111
- r.addClass("has-focus");return!0}function f(){g===a&&(g=null);m.trigger("editBlur");r.removeClass("has-focus");b();e();q!==t&&m.trigger("changed",[t]);return!0}var s=!1,m=h(a),r=h(a.parentNode),t=a.value,q;m.blur(f).focus(c);return{val:function(b){t!==b&&(a.value=b,m.triggerHandler("input"),t=b);return!0},kill:function(){b();m.off("blur",f).off("focus",c)},fire:function(){t=null;e()},ping:e,blur:f,focus:c}}function b(a){this.e=a}var g;f.init=function(a){var d=new b(a);a.disabled?d.disable():d.enable();
112
- return d};TextAreaPrototype=b.prototype;TextAreaPrototype.destroy=function(){this.unlisten();this.e=null};TextAreaPrototype.reload=function(a,b){b?this.l||this.enable():this.l&&this.disable();return this.val(a||"")};TextAreaPrototype.val=function(a){var b=this.e;if(null==a)return b.value;var e=this.p||this.l;e?e.val(a):b.value!==a&&(b.value=a,h(b).triggerHandler("input"));return this};TextAreaPrototype.fire=function(){this.l&&this.l.fire();return this};TextAreaPrototype.focus=function(){return h(this.e).focus()};
113
- TextAreaPrototype.focused=function(){return g&&g===this.el};TextAreaPrototype.parent=function(){return this.e.parentNode};TextAreaPrototype.attr=function(a,b){var e=this.e;if(1===arguments.length)return e.getAttribute(a);null==b?e.removeAttribute(a):e.setAttribute(a,b);return this};TextAreaPrototype.editable=function(){return!!this.l};TextAreaPrototype.enable=function(){var a=this.p;this.e.removeAttribute("disabled");this.listen();a&&a.enable&&a.enable(this.l);return this};TextAreaPrototype.disable=
114
- function(){var a=this.p;this.e.setAttribute("disabled",!0);this.unlisten();a&&a.disable&&a.disable();return this};TextAreaPrototype.listen=function(){var a=this.l;a&&a.kill();this.l=l(this.e);return this};TextAreaPrototype.unlisten=function(){this.l&&this.l.kill();this.l=null;return this};TextAreaPrototype.setInvs=function(a,b){var e=this.i||!1;if(b||e!==a)this._i&&(this._i.kill(),delete this._i),(e=this.p)?e.invs&&e.invs(a):a&&(this._i=n.require("$41","mirror.js").init(this.e)),this.i=a;return this};
115
- TextAreaPrototype.getInvs=function(){return this.i||!1};TextAreaPrototype.setMode=function(a){var b=this.p;a!==(this.m||"")&&(this.m=a,b&&b.kill(),this.p=b="code"===a?n.require("$42","ace.js").init(this.e,this.l):null,this.setInvs(this.i,!0));return this};TextAreaPrototype.redraw=function(a){var b=this.p;b&&b.resize&&!a&&b.resize()};TextAreaPrototype=null;return f}({},p,w));n.register("$39",function(f,c,n){function l(a){var b=c.console;b&&b.error&&b.error(a)}function b(a){var b=n.createElement("div");
116
- a&&b.setAttribute("class",a);return b}function g(a){return function(){a.resize();return this}}function a(a){return function(b){var d=b.target.$r;if(null==d)return!0;a.select(d);b.stopPropagation();b.preventDefault();return!1}}function d(a){return function(){a.redrawDirty()&&a.redraw();return!0}}function e(a){return function(b){var d;d=b.keyCode;if(40===d)d=1;else if(38===d)d=-1;else return!0;if(b.shiftKey||b.ctrlKey||b.metaKey||b.altKey)return!0;a.selectNext(d);b.stopPropagation();b.preventDefault();
117
- return!1}}function k(a){this.w=a}function z(a,b,d){var e=n.createElement("div");e.className=d||"";this._=e;this.d=b;this.i=a;this.length=b.length}function s(a){this.live=a;this.rows=[]}f.create=function(a){return new k(a)};var m=k.prototype;m.init=function(c){var f=this.w,q=f.id,k=f.splity(q+"-thead",q+"-tbody"),m=k[0],k=k[1],D=[],s=[];m.css.push("wg-thead");k.css.push("wg-tbody");c.eachCol(function(a,b){D.push(q+"-col"+a);s.push(b)});for(var l=b(),n=-1,y=D.length,A=b("wg-cols"),G=m.splitx.apply(m,
118
- D);++n<y;)G[n].header(s[n]),A.appendChild(l.cloneNode(!1));var F=[];c.eachRow(function(a,b,d){F[a]=new z(a,b,d)});c=k.body;this.rows=F;this.cols=A;this.root=c;m.redraw=g(this);m=k.fixed=G[0].bodyY()||20;f.lock().resize(m,k);f.css.push("is-table");f.restyle();this.redrawDirty();this.render();h(c).attr("tabindex","-1").on("keydown",e(this)).on("mousedown",a(this)).on("scroll",d(this));return this};m.clear=function(){for(var a=this.pages||[],b=a.length;0!==b--;)a[b].destroy();this.pages=[];this.sy=this.mx=
119
- this.mn=this.vh=null;void 0;return this};m.render=function(){for(var a,b,d=[],e=-1,c=this.rows||[],f=this.f,g=f?!0:!1,k=g?f.length:c.length,h=this.r,y=this._r,m=this.root,G=this.cols;++e<k;)0===e%100&&(b=G.cloneNode(!0),b=new s(b),b.h=2200,b.insert(m),d.push(b)),a=g?f[e]:e,a=c[a],a.page=b,b.rows.push(a);b&&100!==b.size()&&b.sleepH(22);this.pages=d;this.mx=this.mn=null;this.redrawDirty();this.redraw();null==h?null!=y&&(a=c[y])&&a.page&&(delete this._r,this.select(y,!0)):(a=c[h])&&a.page?this.select(h,
120
- !0):(this.deselect(),this._r=h);return this};m.resize=function(){var a=-1,b=this.ww||(this.ww=[]),d=this.w,e=d.cells[0],c=e.body.childNodes,f=c.length,g=this.pages||[],k=g.length;for(d.redraw.call(e);++a<f;)b[a]=c[a].style.width;if(k){d=this.mx;for(a=this.mn;a<=d;a++)g[a].widths(b);this.redrawDirty()&&this.redraw()}};m.redrawDirty=function(){var a=!1,b=this.root,d=b.scrollTop,b=b.clientHeight;this.sy!==d&&(a=!0,this.sy=d);this.vh!==b&&(a=!0,this.vh=b);return a};m.redraw=function(){for(var a=0,b=-1,
121
- d=null,e=null,c=this.ww,f=this.sy,g=this.vh,k=this.mn,h=this.mx,y=Math.max(0,f-100),f=g+f+100,m=this.pages||[],s=m.length;++b<s&&!(a>f);)g=m[b],a+=g.height(),a<y||(null===d&&(d=b),e=b,g.rendered||g.render(c));if(k!==d){if(null!==k&&d>k)for(b=k;b<d;b++){g=m[b];if(!g)throw Error("Shit!");g.rendered&&g.sleep()}this.mn=d}if(h!==e){if(null!==h&&e<h)for(b=h;b>e;b--)g=m[b],g.rendered&&g.sleep();this.mx=e}};m.selected=function(){return this.r};m.thead=function(){return this.w.cells[0]};m.tbody=function(){return this.w.cells[1]};
122
- m.tr=function(a){return(a=this.rows[a])?a.cells():[]};m.td=function(a,b){return this.tr(a)[b]};m.next=function(a,b,d){null==d&&(d=this.r);for(var e,c=this.rows,f=d,g=c.length;d!==(f+=a);)if(0<=f&&g>f){if(e=c[f],e.page)break}else if(b&&g)f=1===a?-1:g,b=!1;else{f=null;break}return f};m.selectNext=function(a,b,d){a=this.next(a,b);null!=a&&this.r!==a&&this.select(a,d);return this};m.deselect=function(a){var b=this.r;null!=b&&(this.r=null,h(this.tr(b)).removeClass("selected"),this.w.fire("wgRowDeselect",
123
- [b,a]));return this};m.select=function(a,b){var d=this.rows[a],e=d&&d.page;if(!e)return this.deselect(!1),l("Row is filtered out"),this;this.deselect(!0);var c,f=this.w.cells[1];e.rendered||(c=e.top(),f.scrollY(c),this.redrawDirty()&&this.redraw());if(!d.rendered)return e.rendered||l("Failed to render page"),l("Row ["+a+"] not rendered"),this;e=d.cells();h(e).addClass("selected");this.r=a;b||(c=f.scrollY(),h(this.root).focus(),c!==f.scrollY()&&f.scrollY(c));f.scrollTo(e[0],!0);this.w.fire("wgRowSelect",
124
- [a,d.data()]);return this};m.unfilter=function(){this.f&&(this.f=null,this.clear().render());return this};m.filter=function(a){this.f=a;return this.clear().render()};m=null;m=z.prototype;m.render=function(a){var b,d=[],e=this._,c=this.d,f=this.length,g=this.i;if(e){for(;0!==f--;)d[f]=b=e.cloneNode(!1),b.textContent=c[f]||"\u00a0",b.$r=g,a[f].appendChild(b);this._=null;this.c=d}else for(d=this.c;0!==f--;)a[f].appendChild(d[f]);this.rendered=!0;return this};m.cells=function(){return this.c||[]};m.data=
125
- function(){return this.d||[]};m.destroy=function(){this.page=null;this.rendered=!1};m=null;m=s.prototype;m.size=function(){return this.rows.length};m.insert=function(a){var d=this.h,e=b("wg-dead");e.style.height=String(d)+"px";a.appendChild(e);return this.dead=e};m.top=function(){return(this.rendered?this.live:this.dead).offsetTop};m.height=function(){var a=this.h;null==a&&(this.h=a=this.rendered?this.live.firstChild.offsetHeight:this.dead.offsetHight);a||l("row has zero height");return a};m.render=
126
- function(a){for(var b,d=-1,e=this.rows,c=e.length,f=this.dead,g=this.live,k=g.childNodes;++d<c;)b=e[d],b.rendered||b.render(k);c=a.length;for(d=0;d<c;d++)k[d].style.width=a[d];f.parentNode.replaceChild(g,f);this.rendered=!0;this.h=null;return this};m.sleep=function(){var a=this.height(),b=this.live,d=this.dead;d.style.height=String(a)+"px";b.parentNode.replaceChild(d,b);this.rendered=!1;this.h=a;return this};m.sleepH=function(a){a*=this.rows.length;var b=this.dead;b&&(b.style.height=String(a)+"px");
127
- this.rendered||(this.h=a);return this};m.widths=function(a){for(var b=this.live.childNodes,d=a.length;0!==d--;)b[d].style.width=a[d];return this};m.destroy=function(){var a=this.rendered?this.live:this.dead,b=this.rows,d=b.length;for(a.parentNode.removeChild(a);0!==d--;)b[d].destroy()};m=null;return f}({},p,w));n.register("$33",function(f,c,p){function l(a,b){var c=a.id,f=c&&r[c],g=f&&f.parent();if(!f||!g)return null;var k=g.dir===m,c=k?"X":"Y",h="page"+c,k=k?d:e,y=k(g.el),c=b["offset"+c],A=g.el,
128
- s=A.className;null==c&&(c=b[h]-k(a));c&&(y+=c);A.className=s+" is-resizing";return{done:function(){A.className=s},move:function(a){g.resize(a[h]-y,f);return!0}}}function b(b,d){function e(){h(p).off("mousemove",c);t&&(t.done(),t=null);return!0}function c(a){t?t.move(a):e();return!0}if(t)return!0;t=l(b.target,b);if(!t)return!0;h(p).one("mouseup",e).on("mousemove",c);return a(b)}function g(a,b){var d=b.type;"touchmove"===d?t&&t.move(b):"touchstart"===d?t=l(a.target,b):"touchend"===d&&t&&(t.done(),t=
129
- null)}function a(a){a.stopPropagation();a.preventDefault();return!1}function d(a,b){b||(b=p.body);for(var d=a.offsetLeft||0;(a=a.offsetParent)&&a!==b;)d+=a.offsetLeft||0;return d}function e(a,b){b||(b=p.body);for(var d=a.offsetTop||0;(a=a.offsetParent)&&a!==b;)d+=a.offsetTop||0;return d}function k(a,b){var d=h(b).on("editFocus",function(b){d.trigger("wgFocus",[a])}).on("editBlur",function(a){d.trigger("wgBlur")})}function z(a){var b=this.id=a.id;this.el=a;this.pos=this.index=0;this.css=["wg-cell"];
130
- r[b]=this;this.clear()}var s=n.require("$16","html.js"),m=1,r={},t=!1;f.init=function(a){var d=new z(a);d.css.push("wg-root");d.redraw();n.require("$37","touch.js").ok(function(b){b.dragger(a,g)});h(a).mousedown(b);return d};c=z.prototype;c.fire=function(a,b){var d=h.Event(a);d.cell=this;h(this.el).trigger(d,b);return this};c.each=function(a){for(var b=-1,d=this.cells,e=d.length;++b<e;)a(d[b],b);return this};c.on=function(){return this.$("on",arguments)};c.off=function(){return this.$("off",arguments)};
131
- c.find=function(a){return h(this.el).find(a)};c.$=function(a,b){h.fn[a].apply(h(this.el),b);return this};c.parent=function(){return this.pid&&r[this.pid]};c.splitx=function(){return this._split(m,arguments)};c.splity=function(){return this._split(2,arguments)};c._split=function(a,b){(this.length||this.field)&&this.clear();for(var d=-1,e,c=b.length,f=1/c,g=0;++d<c;){e=s.el();this.body.appendChild(e);for(var k=e,h=b[d],m=h,l=1;r[h];)h=m+"-"+ ++l;k.id=h;e=new z(e);e.index=d;e.pid=this.id;e.pos=g;g+=
132
- f;this.cells.push(e);this.length++}this.dir=a;this.redraw();return this.cells};c.destroy=function(){this.clear();delete r[this.id];var a=this.el;a.innerHTML="";h(a).off();return this};c.exists=function(){return this===r[this.id]};c.clear=function(){for(var a=this.el,b=this.cells,d=this.field,e=this.body,c=this.nav,f=this.length||0;0!==f--;)delete r[b[f].destroy().id];this.cells=[];this.length=0;c&&(a.removeChild(c),this.nav=null);e&&(d&&(s.ie()&&h(e).triggerHandler("blur"),d.destroy(),this.field=
133
- null),this.table&&(this.table=null),a.removeChild(e));this.body=a.appendChild(s.el("","wg-body"));return this};c.resize=function(a,b){if(!b&&(b=this.cells[1],!b))return;var d=b.index,e=this.cells;this.parent();var c=h(this.el)[this.dir===m?"width":"height"](),f=e[d+1],d=e[d-1];pad=(b.body||b.el.firstChild).offsetTop||0;max=(f?f.pos*c:c)-pad;min=d?d.pos*c:0;b.pos=Math.min(max,Math.max(min,a))/c;this.redraw();return this};c.distribute=function(a){for(var b,d=0,e=this.cells,c=a.length;d<c;)b=a[d],e[++d].pos=
134
- Math.max(0,Math.min(1,b));this.redraw();return this};c.distribution=function(){for(var a=[],b=0,d=this.cells,e=d.length-1;b<e;)a[b]=d[++b].pos;return a};c.restyle=function(){var a=this.css.concat();0===this.index?a.push("first"):a.push("not-first");this.dir&&(a.push("wg-split"),2===this.dir?a.push("wg-split-y"):a.push("wg-split-x"));this.t&&a.push("has-title");this.nav&&a.push("has-nav");this.field&&(a.push("is-field"),this.field.editable()?a.push("is-editable"):a.push("is-readonly"));a=a.join(" ");
135
- a!==this._css&&(this._css=this.el.className=a);return this};c.redraw=function(a){this.restyle();var b=this.el,d=this.body,e=this.field;if(d){var c=b.clientHeight||0,f=d.offsetTop||0;f<c&&(c-=f);d.style.height=String(c)+"px";e&&e.redraw(a)}for(var d=this.length,f=1,g=this.nav,k=2===this.dir?"height":"width";0!==d--;)e=this.cells[d],g?c=1:(e.fixed&&(e.pos=e.fixed/h(b)[k]()),c=f-e.pos,f=e.pos),e.el.style[k]=String(100*c)+"%",e.redraw(a);return this};c.contents=function(a){var b=this.el,d=this.body;if(null==
136
- a)return d.innerHTML;this.length?this.clear():d&&(b.removeChild(d),d=null);d||(this.body=d=b.appendChild(s.el("","wg-content")),(b=this.lang)&&this._locale(b,this.rtl,!0));"string"===typeof a?h(d)._html(a):a&&this.append(a);this.redraw();return this};c.textarea=function(a,b){var d=this.field;if(d){var e=d.editable();d.reload(a,b);e!==b&&this.restyle()}else this.length&&this.clear(),e=s.el("textarea","wg-field"),e.setAttribute("wrap","virtual"),e.disabled=!b,e.value=a,e.name=this.id,this.contents(e),
137
- d=n.require("$38","field.js").init(e),k(this,e),this.field=d,this.restyle();this.lang||this.locale("en");return d};c.locale=function(a){a=n.require("$6","locale.js").cast(a);return this._locale(String(a),a.isRTL())};c._locale=function(a,b,d){var e=this.body;if(d||a!==this.lang)this.lang=a,e&&e.setAttribute("lang",a);if(d||b!==this.rtl)this.rtl=b,e&&e.setAttribute("dir",b?"RTL":"LTR");return this};c.editable=function(){var a=this.field;if(!a||!a.editable())for(var b=-1,d=this.length;++b<d&&!(a=this.cells[b].editable()););
138
- return a};c.eachTextarea=function(a){var b=this.field;b?a(b):this.each(function(b){b.eachTextarea(a)});return this};c.append=function(a){a&&(a.nodeType?s.init(this.body.appendChild(a)):s.init(h(a).appendTo(this.body)));return this};c.prepend=function(a){var b=this.body;if(a.nodeType){var d=b.firstChild;s.init(d?b.insertBefore(a,d):b.appendChild(a))}else s.init(h(a).prependTo(b));return this};c.header=function(a,b){if(null==a&&null==b)return this.el.getElementsByTagName("h2")[0];var d=["wg-title"];
139
- b&&d.push(b);this.t=s.txt(a||"");this.el.insertBefore(s.el("h2",d.join(" ")),this.body).appendChild(this.t);this.redraw();return this};c.title=function(a){var b=this.t;if(b)return b.nodeValue=a||"",b;this.header(a);return this.t};c.titled=function(){var a=this.t;return a&&a.nodeValue};c.bodyY=function(){return e(this.body,this.el)};c.scrollY=function(a){if(U===a)return this.body.scrollTop;this.body.scrollTop=a};c.tabulate=function(a){return this.table=n.require("$39","wgtable.js").create(this).init(a)};
140
- c.lock=function(){this.body.className+=" locked";return this};c.scrollTo=function(a,b){var d,c=this.body;d=c.scrollTop;var f=e(a,c);if(d>f)d=f;else{var g=c.clientHeight,f=f+h(a).outerHeight();if(g+d<f)d=f-g;else return}b?c.scrollTop=d:h(c).stop(!0).animate({scrollTop:d},250)};c.navigize=function(b,d){function e(a){var b=f[a],d=y[a],c=h(b.el).show();d.addClass("active");k=a;m.data("idx",a);b.fire("wgTabSelect",[a]);return c}var c=this,f=c.cells,g=c.nav,k,y=[];g&&c.el.removeChild(g);var g=c.nav=c.el.insertBefore(s.el("nav",
141
- "wg-tabs"),c.body),m=h(g).on("click",function(b){var d=h(b.target).data("idx");if(null==d)return!0;if(null!=k){var g=y[k];h(f[k].el).hide();g.removeClass("active")}e(d);c.redraw();return a(b)});null==d&&(d=m.data("idx")||0);c.each(function(a,d){y[d]=h('<a href="#'+a.id+'"></a>').data("idx",d).text(b[d]).appendTo(m);a.pos=0;h(a.el).hide()});e(f[d]?d:0);c.lock();c.redraw();return c};c.navigated=function(){var a=this.nav;if(a)return h(a).data("idx")};c=null;return f}({},p,w));n.register("$24",function(f,
142
- c,h){function l(b){this.reIndex([]);if(b)for(var c in b)this.add(c,b[c])}f.init=function(b){return new l(b)};c=l.prototype;c.reIndex=function(b){for(var c={},a=-1,d=b.length;++a<d;)c[b[a]]=a;this.keys=b;this.length=a;this.ords=c};c.key=function(b,c){if(null==c)return this.keys[b];var a=this.keys[b],d=this.ords[c];if(c!==a){if(null!=d)throw Error("Clash with item at ["+d+"]");this.keys[b]=c;delete this.ords[a];this.ords[c]=b}return b};c.indexOf=function(b){b=this.ords[b];return null==b?-1:b};c.add=
143
- function(b,c){var a=this.ords[b];null==a&&(this.keys[this.length]=b,a=this.ords[b]=this.length++);this[a]=c;return a};c.get=function(b){return this[this.ords[b]]};c.has=function(b){return null!=this.ords[b]};c.del=function(b){this.cut(this.ords[b],1)};c.cut=function(b,c){c=c||1;var a=[].splice.call(this,b,c);this.keys.splice(b,c);this.reIndex(this.keys);return a};c.each=function(b){for(var c=-1,a=this.keys,d=this.length;++c<d;)b(a[c],this[c],c);return this};c.sort=function(b){for(var c=-1,a=this.length,
144
- d,e=this.keys,f=this.ords,h=[];++c<a;)h[c]=[this[c],e[c]];h.sort(function(a,d){return b(a[0],d[0])});for(c=0;c<a;c++)d=h[c],this[c]=d[0],d=d[1],e[c]=d,f[d]=c;return this};c=null;return f}({},p,w));n.register("$23",function(f,c,p){function l(a){var b=[];a&&(a.saved()||b.push("po-unsaved"),a.fuzzy()?b.push("po-fuzzy"):a.flagged()&&(b.push("po-flagged"),b.push("po-flag-"+a.flags().join(" po-flag-"))),a.translation()||b.push("po-empty"),a.comment()&&b.push("po-comment"));return b.join(" ")}function b(a,
145
- b,d){b=h(a.title(b).parentNode);var e=b.find("span.lang");d?(d=n.require("$6","locale.js").cast(d),e.length||(e=h("<span></span>").prependTo(b)),e.attr("lang",d.lang).attr("class",d.getIcon()||"lang region region-"+(d.region||"zz").toLowerCase())):(e.remove(),d="en");a.locale(d);return b}function g(){this.dirty=0}var a="poUpdate",d="changing",e="changed",k=0,z=1,s=2,m=3,r=4,t=5,q=/^[ \t\n\r]/,u,B,w=n.require("$3","string.js").sprintf,E=n.require("$16","html.js");f.extend=function(a){return a.prototype=
146
- new g};f.localise=function(a){B=a;return f};var C=function(){var a=p.createElement("p");return function(b){a.innerHTML=b;return a.textContent}}(),v=g.prototype=n.require("$32","abstract.js").init(["getListColumns","getListHeadings","getListEntry"],["editable","t"]);v.init=function(){this.localise();this.editable={source:!0,target:!0};this.ide=this._ide="";return this};v.localise=function(a){a||(a=B||n.require("$1","t.js").init());var b=[];b[k]=a._x("Source text","Editor")+":";b[m]=a._x("%s translation",
147
- "Editor")+":";b[r]=a._x("Context","Editor")+":";b[t]=a._x("Comments","Editor")+":";b[z]=a._x("Single","Editor")+":";b[s]=a._x("Plural","Editor")+":";this.labels=b;this.t=a;return this};v.setRootCell=function(a){function b(a){d.redraw(!0,a);return!0}var d=n.require("$33","wingrid.js").init(a);h(c).on("resize",b);this.redraw=b;h(a).on("wgFocus wgBlur",function(a,b){u=b});this.destroy=function(){d.destroy();h(c).off("resize",b)};this.rootDiv=a;return d};g.prototype.$=function(){return h(this.rootDiv)};
148
- v.on=function(a,b){return h(this.rootDiv).on(a,b)};v.setListCell=function(a){var b=this;b.listCell=a;a.on("wgRowSelect",function(a,d){b.loadMessage(b.po.row(d));return!0}).on("wgRowDeselect",function(a,d,e){e||b.loadNothing();return!0})};v.setSourceCell=function(a){this.sourceCell=a;var b=a.find("p.notes");b.length||(b=h('<p class="notes"></p>').insertAfter(a.header()).hide());this.notesPara=b};v.setTargetCell=function(a){this.targetCell=a};v.next=function(a,b,d){for(var e=this.listTable,c=e.selected(),
149
- f=c,g,k=this.po;null!=(c=e.next(a,d,c));){if(f===c){c=null;break}if(b&&(g=k.row(c),g.translated(0)))continue;break}null!=c&&e.select(c,!0);return c};v.current=function(a){var b=this.active;if("undefined"===typeof a)return b;a?a.is(b)?this.pasteMessage(a):this.loadMessage(a):this.unloadActive();return this};v.getTargetEditable=function(){return this.editable.target&&this.targetCell&&this.targetCell.editable()};v.getSourceEditable=function(){return this.editable.source&&this.sourceCell&&this.sourceCell.editable()};
150
- v.getContextEditable=function(){return this.editable.context&&this.contextCell&&this.contextCell.editable()};v.getFirstEditable=function(){return this.getTargetEditable()||this.getSourceEditable()||this.getContextEditable()};v.searchable=function(a){a&&(this.dict=a,this.po&&this.rebuildSearch());return this.dict&&!0};v.rebuildSearch=function(){var a=-1,b=this.po.rows,d=b.length,e=this.dict;for(e.clear();++a<d;)e.add(a,b[a].toText());this.lastSearch="";this.lastFound=d};v.filtered=function(){return this.lastSearch||
151
- ""};v.filter=function(a,b){var d,e=this.listTable,c=this.lastFound,f=this.lastSearch;if(a){if(f===a)return c||0;if(f&&!c&&0===a.indexOf(f))return 0;d=this.dict.find(a)}f=this.lastSearch=a;c=this.lastFound=d?d.length:this.po.length;d?e.filter(d):e.unfilter();b||this.fire("poFilter",[f,c]);return c};v.unsave=function(a,b){var d=!1;if(a=a||self.active){if(d=a.saved(b))this.dirty++,a.unsave(b),this.fire("poUnsaved",[a,b]);this.markUnsaved(a)}return d};v.markUnsaved=function(a){var b=this.po.indexOf(a),
152
- b=this.listTable.tr(b),d=b[0].className;changedStyle=d.replace(/(?:^| +)po-[a-z]+/g,"")+" "+l(a);changedStyle!==d&&h(b).attr("class",changedStyle)};v.save=function(a){var b=this.po;if(this.dirty||a)b.each(function(a,b){b.save()}),this.listCell.find("div.po-unsaved").removeClass("po-unsaved"),this.dirty=0,this.fire("poSave");return b};v.fire=function(a,b){var d=this.on;if(d&&d[a]&&(d=d[a].apply(this,b||[]),!1===d))return!1;d=h.Event(a);h(this.rootDiv).trigger(d,b);return!d.isDefaultPrevented()};v.reload=
153
- function(){var a=this,b,d=a.listCell,e=a.listTable,c=a.po,f=c&&c.locale(),g=f&&f.isRTL(),k=c&&c.length||0;if(c&&c.row)return a.lastSearch&&(a.lastSearch="",a.lastFound=k,a.fire("poFilter",[a.lastSearch,a.lastFound])),e&&(b=e.thead().distribution()),e=a.listTable=d.tabulate({length:k,getRow:function(b){return a.getListEntry(c.row(b))},getCss:function(b){return a.getListEntry(c.row(b))},eachCol:function(b){for(var d=-1,e=a.getListHeadings(),c=e.length;++d<c;)b(d,e[d])},eachRow:function(b){var d=0;c.each(function(e,
154
- c){b(d++,a.getListEntry(c),l(c))})}}),b&&e.thead().distribute(b),e.tbody().$(g?"addClass":"removeClass",["is-rtl"]),a.targetLocale=f,a.fire("poLoad"),!!c.length;d&&d.clear().header("Error").contents("Invalid messages list")};v.load=function(a,b){this.po=a;this.dict&&this.rebuildSearch();this.reload()&&(-1!==b?this.listTable.select(b||0):this.active&&this.unloadActive())};v.pasteMessage=function(a){var b,d=0;if(b=this.sourceCell)b.eachTextarea(function(b){b.val(a.source(null,d++))}),this.updateListCell(a,
155
- "source");(b=this.contextCell)&&b.eachTextarea(function(b){b.val(a.context())});if(b=this.targetCell)d=0,b.eachTextarea(function(b){b.val(a.translation(d++))}),this.updateListCell(a,"target");return this};v.loadMessage=function(c){function f(g){var h,m=g,l=g.id,m=!1;h=L[k];g.off();O&&(R?(R=E.h(R,!0),O.html(R).show(),E.init(O),m=!0):O.text()&&(m=!0,O.text("").hide()));g.titled()!==h&&b(g,h,p.sourceLocale||"en");m&&g.clear();S?(h=g.splity(l+"-singular",l+"-plural"),m=h[0],h=h[1],m.header(L[z]).textarea(Y,
156
- T).setMode(v).setInvs(B),h.header(L[s]).textarea(S,T).setMode(v).setInvs(B),g.lock()):g.textarea(Y,T).setMode(v).setInvs(B);T&&g.on(d,function(a,b){S&&a.target.name===l+"-plural"?c.plural(b):(c.source(b),p.updateListCell(c,"source"));p.unsave(c,N)}).on(e,function(b){S&&b.target.name===l+"-plural"||p.po.reIndex(c);p.dict&&p.rebuildSearch();p.fire(a,[c])})}function g(f,k,h){f.off();var s=k.isKnown()&&k.label||"Target",s=w(L[m],s);f.titled()!==s&&b(f,s,k);if(c.pluralized()){var l=[],z=k.plurals||["One",
157
- "Other"],q=n.require("$24","collection.js").init();for(c.each(function(a,b,d){if(d||z[a])l.push(z[a]||"Form "+a),q.add("plural-"+a,d)});(s=l.length)<k.nplurals;)l.push(z[s]||"Form "+q.length),q.add("plural-"+s,c.translation(s));children=f.splitx.apply(f,q.keys);f.each(function(a,b){var d=K&&!c.disabled(b);a.textarea(q[b],d).setMode(v).setInvs(B)});f.navigize(l,h||null).on("wgTabSelect",function(a,b){var d=K&&a.cell.editable();d&&d.focus();h=b;p.fire("poTab",[b])})}else h=0,K=K&&!c.disabled(0),f.textarea(c.translation(),
158
- K).setMode(v).setInvs(B);K&&f.on(d,function(a,b,d){c.translate(b,h);0===h&&p.updateListCell(c,"target");c.fuzzy(h)?p.fuzzy(!1,c,h):p.unsave(c,h);""===b?p.fire("poEmpty",[!0,c,h]):""===d&&p.fire("poEmpty",[!1,c,h])}).on(e,function(b){p.dict&&p.rebuildSearch();p.fire(a,[c])})}function l(f){f.off();b(f,L[r]);f.textarea(c.context(),!0).setMode(v).setInvs(B);U&&f.on(d,function(a,b){c.context(b);p.updateListCell(c,"source");p.unsave(c,N)}).on(e,function(){p.po.reIndex(c);p.dict&&p.rebuildSearch();p.fire(a,
159
- [c])})}function q(a){var e=L[t];a.titled()!==e&&b(a,e);a.off().on(d,function(a,b){c.comment(b);p.fire("poComment",[c,b]);p.unsave(c,N)}).textarea(c.comment(),!0)}var p=this,v=p.ide||"",B=p.inv||!1,C=this.fmt||null,H=c.format()||null,M=c.is(p.active),N=0,J=p.sourceCell,W=p.targetCell,Q=p.contextCell,X=p.commentCell,O=p.notesPara,K=p.editable.target,T=p.editable.source,U=p.editable.context,Y=c.source()||"",S=c.plural()||"",R=c.notes(),P=u,Z=p.targetLocale,L=p.labels;p.active=c;J&&f(J);Q&&l(Q);W&&Z&&
160
- (N=W.navigated()||0,g(W,Z,N));X&&q(X);P&&(P.exists()||(P=P.parent()),(J=P.editable())&&J.focus());C!==H&&(J=h(p.rootDiv),H&&J.addClass(H+"-format"),C&&J.removeClass(C+"-format"),this.fmt=H);M||p.fire("poSelected",[c])};v.unloadActive=function(){var a;(a=this.notesPara)&&a.text("").hide();(a=this.sourceCell)&&a.off().clear();(a=this.contextCell)&&a.off().clear();(a=this.targetCell)&&a.off().clear();(a=this.commentCell)&&a.off();this.active&&(this.fire("poDeselected",[this.active]),this.active=null);
161
- return this};v.loadNothing=function(){var a,b=this.t,d=this.ide||"",c=this.inv||!1;this.unloadActive();(a=this.commentCell)&&a.textarea("",!1);if(a=this.sourceCell)a.textarea("",!1).setMode(d).setInvs(c),a.title(b._x("Source text not loaded","Editor")+":");if(a=this.contextCell)a.textarea("",!1).setMode(d).setInvs(c),a.title(b._x("Context not loaded","Editor")+":");if(a=this.targetCell)a.textarea("",!1).setMode(d).setInvs(c),a.title(b._x("Translation not loaded","Editor")+":");this.fire("poSelected",
162
- [null])};v.updateListCell=function(a,b){var d=this.getListColumns()[b],c=this.getListEntry(a)[d||0],e=this.po.indexOf(a);if(d=this.listTable.td(e,d))d.textContent=c};v.cellText=function(a){if(-1!==a.indexOf("<")||-1!==a.indexOf("&"))a=C(a);""===a?a="\u00a0":q.test(a)&&(a="\u00a0"+a);return a};v.fuzzy=function(b,d,c){if(!d){d=this.active;if(!d)return null;null==c&&(c=this.targetCell&&this.targetCell.navigated()||0)}var e=d.fuzzy(c);null==b||e==b||b&&!d.translated(c)||!this.fire("poFuzzy",[d,b,c])||
163
- (d.fuzzy(c,b),this.fire(a,[d])&&this.unsave(d,c));return e};v.add=function(b,d){var c,e=this.po.get(b,d);e?c=this.po.indexOf(e):(c=this.po.length,e=this.po.add(b,d),this.load(this.po,-1),this.fire("poAdd",[e]),this.fire(a,[e]));this.lastSearch&&this.filter("");this.listTable.select(c);return e};v.del=function(b){if(b=b||this.active){var d=this.lastSearch,c=this.po.del(b);null!=c&&(this.unsave(b),this.fire("poDel",[b]),this.fire(a,[b]),this.reload(),this.dict&&this.rebuildSearch(),this.active&&this.active.equals(b)&&
164
- this.unloadActive(),this.po.length&&(d&&this.filter(d),this.active||(c=Math.min(c,this.po.length-1),this.listTable.select(c))))}};v.setMode=function(a){var b=a?"code":this._ide;this.ide!==b&&(this.ide=b,this.callTextareas(function(a){a.setMode(b)}));return this};v.getMode=function(){return"code"===this.ide};v.setInvs=function(a){(this.inv||!1)!==a&&(this.inv=a,this.callTextareas(function(b){b.setInvs(a)}),this.fire("poInvs",[a]));return this};v.getInvs=function(){return this.inv||!1};v.callTextareas=
165
- function(a){var b=this.targetCell;b&&b.eachTextarea(a);(b=this.contextCell)&&b.eachTextarea(a);(b=this.sourceCell)&&b.eachTextarea(a);return this};v=null;return f}({},p,w));n.register("$11",function(f,c,h){function l(){this.init()._validate();this.sourceLocale={lang:"en",label:"English",plurals:["One","Other"]}}c=n.require("$23","base.js");f.init=function(b){var c=new l;b=c.setRootCell(b);var a=b.splity("po-list","po-edit"),d=a[0],e=a[1],a=e.splitx("po-trans","po-comment"),f=a[0],h=a[1].header("Loading.."),
166
- a=f.splity("po-source","po-target"),f=a[0].header("Loading.."),a=a[1].header("Loading..");b.distribute([0.34]);e.distribute([0.8]);c.setListCell(d);c.setSourceCell(f);c.setTargetCell(a);c.commentCell=h;c.editable.source=!1;return c};c=l.prototype=c.extend(l);c.getListHeadings=function(){var b=this.t||{_x:function(b){return b}};return[b._x("Source text","Editor"),b._x("Translation","Editor")]};c.getListColumns=function(){return{source:0,target:1}};c.getListEntry=function(b){if(!b)return["",""];var c=
167
- this.cellText,a=[c(b.id||b.source()||""),c(b.translation()||"")];if(b=b.context())a[0]+=" [ "+c(b)+" ]";return a};c.stats=function(){var b=this.po.length,c=0,a=0,d=0;this.po.each(function(b,f){f.translation()?f.fuzzy()?d++:c++:a++});return{t:b,p:String(c?Math.round(100*(c/b)):0)+"%",f:d,u:a}};c.unlock=function(){this._unlocked||(this._unlocked=this.targetLocale,delete this.targetLocale,this.po&&this.po.unlock(),this.editable={source:!0,context:!0,target:!1},this.contextCell=this.targetCell,delete this.targetCell,
168
- this.fire("poLock",[!1]),this.active&&this.loadMessage(this.active))};c.lock=function(){var b;this._unlocked&&(b=this.targetLocale=this._unlocked,delete this._unlocked,this.po&&this.po.lock(b),this.editable={source:!1,context:!1,target:!0},this.targetCell=this.contextCell,delete this.contextCell,this.fire("poLock",[!0,b]),this.active&&this.loadMessage(this.active))};c.locked=function(){return!this._unlocked};return f}({},p,w));n.register("$12",function(f,c,n){var l={copy:66,clear:75,save:83,fuzzy:85,
169
- next:40,prev:38,enter:13,invis:73},b={38:!0,40:!0,73:!0},g={66:function(a,b){var c=b.current();c&&(c.normalize(),b.pasteMessage(c))},75:function(a,b){var c=b.current();c&&(c.untranslate(),b.pasteMessage(c))},85:function(a,b){b.fuzzy(!b.fuzzy())},13:function(a,b){b.getFirstEditable()&&b.next(1,!0,!0)},40:function(a,b){var c=a.shiftKey;b.next(1,c,c)},38:function(a,b){var c=a.shiftKey;b.next(-1,c,c)},73:function(a,b){if(!a.shiftKey)return!1;b.setInvs(!b.getInvs())}};f.init=function(a,d){function e(d){if(d.isPropagationStopped()||
170
- !d.metaKey&&!d.ctrlKey)return!0;var c=d.which;if(!f[c])return!0;var e=g[c];if(!e)throw Error("No such command");if(d.altKey||d.shiftKey&&!b[c]||!1===e(d,a))return!0;d.preventDefault();return!1}var f={};h(d||c).on("keydown",e);return{add:function(a,b){g[l[a]]=b;return this},enable:function(){var a,b;for(b in arguments)a=l[arguments[b]],f[a]=!0;return this},disable:function(){h(d||c).off("keydown",e);a=d=f=null}}};return f}({},p,w));n.register("$25",function(f,c,h){function l(b,c){var a=RegExp("^.{0,"+
171
- (b-1)+"}["+c+"]"),d=RegExp("^[^"+c+"]+");return function(c,f){for(var g=c.length,h;g>b;){h=a.exec(c)||d.exec(c);if(null==h)break;h=h[0];f.push(h);h=h.length;g-=h;c=c.substr(h)}0!==g&&f.push(c);return f}}f.create=function(b){function c(a){return s[a]||"\\"+a}var a,d,e=/(?:\r\n|[\r\n\v\f\u2028\u2029])/g,f=/[ \r\n]+/g,h=/[\t\v\f\x07\x08\\\"]/g,s={"\t":"\\t","\v":"\\v","\f":"\\f","\u0007":"\\a","\b":"\\b"};null==b&&(b=79);0!==b&&(a=l(b-3," "),d=l(b-2,"-\u2013 \\.,:;\\?!\\)\\]\\}\\>"));return{pair:function(a,
172
- f){if(!f)return a+' ""';f=f.replace(h,c);var k=0;f=f.replace(e,function(){k++;return"\\n\n"});if(!(k||b&&b<f.length+a.length+3))return a+' "'+f+'"';var l=[a+' "'],s=f.split("\n");if(d)for(var n=-1,p=s.length;++n<p;)d(s[n],l);else l=l.concat(s);return l.join('"\n"')+'"'},prefix:function(a,b){var d=a.split(e);return b+d.join("\n"+b)},refs:function(b){b=b.replace(f," ",b);a&&(b=a(b,[]).join("\n#: "));return"#: "+b}}};return f}({},p,w));n.register("$26",function(f,c,h){function l(){}f.extend=function(b){return b.prototype=
173
- new l};c=l.prototype=n.require("$32","abstract.js").init(["add","load"]);c.row=function(b){return this.rows[b]};c.lock=function(b){return this.locale(b||{lang:"zxx",label:"Unknown",nplurals:1,pluraleq:"n!=1"})};c.unlock=function(){var b=this.loc;this.loc=null;return b};c.locale=function(b){var c=n.require("$6","locale.js");null==b?b=this.loc:this.loc=b=c.cast(b);return b};c.each=function(b){this.rows.each(b);return this};c.indexOf=function(b){"object"!==typeof b&&(b=this.get(b));if(!b)return-1;null==
174
- b.idx&&(b.idx=this.rows.indexOf(b.hash()));return b.idx};c.get=function(b){return this.rows&&this.rows.get(b)};c.del=function(b){b=this.indexOf(b);if(-1!==b){var c=this.rows.cut(b,1);if(c&&c.length)return this.length=this.rows.length,this.rows.each(function(a,b,c){b.idx=c}),b}};c.reIndex=function(b,c){var a=this.indexOf(b),d=b.hash(),e=this.rows.indexOf(d);return e===a?a:-1!==e?(c=(c||0)+1,b.source("Error, duplicate "+String(c)+": "+b.source()),this.reIndex(b,c)):this.rows.key(a,d)};c=null;return f}({},
175
- p,w));n.register("$27",function(f,c,h){function l(){this.id=this._id=this.ref=this.cmt=this.xcmt=""}f.extend=function(b){return b.prototype=new l};c=l.prototype;c.flag=function(b,c){var a=this.flg||(this.flg=[]);if(null!=c)a[c]=b;else for(var d=Math.max(a.length,this.src.length,this.msg.length);0!==d--;)a[d]=b;return this};c.flagged=function(b){var c=this.flg||[];if(null!=b)return c[b]||0;for(b=c.length;0!==b--;)if(c[b])return!0;return!1};c.flags=function(){for(var b,c={},a=[],d=this.flg||[],e=d.length;0!==
176
- e--;)b=d[e],c[b]||(c[b]=!0,a.push(b));return a};c.flaggedAs=function(b,c){var a=this.flg||[];if(null!=c)return b===a[c]||0;for(var d=a.length;0!==d--;)if(a[d]===b)return!0;return!1};c.fuzzy=function(b,c){var a=this.flaggedAs(4,b);null!=c&&this.flag(c?4:0,b);return a};c.source=function(b,c){if(null==b)return this.src[c||0]||"";this.src[c||0]=b;return this};c.plural=function(b,c){if(null==b)return this.src[c||1]||"";this.src[c||1]=b||"";return this};c.each=function(b){for(var c=-1,a=this.src,d=this.msg,
177
- e=Math.max(a.length,d.length);++c<e;)b(c,a[c],d[c]);return this};c.pluralized=function(){return 1<this.src.length||1<this.msg.length};c.translate=function(b,c){this.msg[c||0]=b||"";return this};c.untranslate=function(b){null!=b&&(this.msg[b]="");for(b=0;b<this.msg.length;b++)this.msg[b]="";return this};c.translation=function(b){return this.msg[b||0]||""};c.translated=function(b){if(null!=b)return!!this.translation(b);var c=this.msg.length;for(b=0;b<c;b++)if(!this.msg[b])return!1;return!0};c.comment=
178
- function(b){if(null==b)return this.cmt;this.cmt=b||"";return this};c.notes=function(b){if(null==b)return this.xcmt;this.xcmt=b||"";return this};c.refs=function(b){if(null==b)return this.ref;this.ref=b||"";return this};c.format=function(b){if(null==b)return this.fmt;this.fmt=b;return this};c.context=function(b){if(null==b)return this.ctx||"";this.ctx=b||"";return this};c.toString=c.toText=function(){return this.src.concat(this.msg,[this.id,this.ctx]).join(" ")};c.weight=function(){var b=0;this.translation()||
179
- (b+=2);this.fuzzy()&&(b+=1);return b};c.equals=function(b){return this===b||this.hash()===b.hash()};c.hash=function(){return this.id};c.normalize=function(){for(var b=this.msg.length;0!==b--;)this.msg[b]=this.src[b]||""};c.disabled=function(b){return!!(this.lck||[])[b||0]};c.disable=function(b){(this.lck||(this.lck=[]))[b||0]=!0;return this};c.saved=function(b){var c=this.drt;if(!c)return!0;if(null!=b)return!c[b];for(b=c.length;0!==b--;)if(c[b])return!1;return!0};c.unsave=function(b){(this.drt||(this.drt=
180
- []))[b||0]=!0;return this};c.save=function(b){var c=this.drt;null==b?this.drt=null:c[b]=!1;return this};c.is=function(b){return b&&(b===this||b.idx===this.idx)};c=null;return f}({},p,w));n.register("$13",function(f,c,h){function l(a){return{"Project-Id-Version":"PACKAGE VERSION","Report-Msgid-Bugs-To":"","POT-Creation-Date":a||"","PO-Revision-Date":a||"","Last-Translator":"","Language-Team":"",Language:"","Plural-Forms":"","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit"}}
181
- function b(a,b){var d=a||"";b&&(d+="\x00"+b);return d}function g(){return n.require("$24","collection.js").init()}function a(a){this.locale(a);this.length=0;this.rows=g();this.head=l(this.now())}function d(a,b){this.src=[a||""];this.msg=[b||""]}f.create=function(b){return new a(b)};c=n.require("$26","messages.js").extend(a);c.now=function(){function a(b,d){for(var c=String(b);c.length<d;)c="0"+c;return c}var b=new Date,d=b.getUTCFullYear(),c=b.getUTCMonth()+1,f=b.getUTCDate(),g=b.getUTCHours(),b=
182
- b.getUTCMinutes();return a(d,4)+"-"+a(c,2)+"-"+a(f,2)+" "+a(g,2)+":"+a(b,2)+"+0000"};c.header=function(a,b){var d=this.head||(this.head={});if(null==b)return this.headers()[a]||"";d[a]=b||"";return this};c.headers=function(a){var b,d=this.now(),c=this.head||(this.head=l(d));if(null!=a){for(b in a)c[b]=a[b];return this}var f=this.locale();a={};for(b in c)a[b]=String(c[b]);f?(a.Language=String(f)||"zxx",a["Language-Team"]=f.label||a.Language,a["Plural-Forms"]="nplurals="+(f.nplurals||"2")+"; plural="+
183
- (f.pluraleq||"n!=1"),a["PO-Revision-Date"]=d):(a.Language="",a["Plural-Forms"]="nplurals=INTEGER; plural=EXPRESSION",a["POT-Creation-Date"]=d,a["PO-Revision-Date"]="YEAR-MO-DA HO:MI+ZONE");a["X-Generator"]="Loco - https://localise.biz/";return a};c.get=function(a,d){var c=b(a,d);return this.rows.get(c)};c.add=function(a,b){a instanceof d||(a=new d(a));b&&a.context(b);var c=a.hash();if(this.rows.get(c))throw Error("Duplicate message at index "+this.indexOf(a));a.idx=this.rows.add(c,a);this.length=
184
- this.rows.length;return a};c.load=function(a){for(var b=-1,c,f,g,h,l,n,p=[],B=[],w=[],E=[];++b<a.length;)c=a[b],null==c.parent?(f=c.source||c.id,g=c.target||"",h=c.context,f||h?(l=new d(f,g),l._id=c._id,h&&l.context(h),c.flag&&l.flag(c.flag,0),c.comment&&l.comment(c.comment),c.notes&&l.notes(c.notes),c.refs&&l.refs(c.refs),null!==c.format&&l.format(c.format),c.message=l,l.translation()?l.fuzzy()?w.push(l):B.push(l):E.push(l)):0===b&&"object"===typeof g&&(this.head=g)):p.push(c);for(b=-1;++b<p.length;)try{c=
185
- p[b];f=c.source||c.id;l=a[c.parent]&&a[c.parent].message;if(!l)throw Error("parent missing for plural "+f);n=c.plural;1===n&&l.plural(f);c.flag&&l.flag(c.flag,n);l.translate(c.target||"",n);c.format&&!l.format()&&l.format(c.format)}catch(C){}return this._add(E,w,B)};c._add=function(a,b,c){c=[a,b,c];for(i=0;3>i;i++)for(b=c[i],a=-1;++a<b.length;)try{this.add(b[a])}catch(d){}return this};c.merge=function(a){var b,c=a.header("POT-Creation-Date"),d=this.rows,f=[],h=[],l=[],n=[],p=[];a=a.rows;this.rows.each(function(b,
186
- c){null==a.get(b)&&p.push(c)});a.each(function(a,c){try{(b=d.get(a))?(b.ref=c.ref,b.fmt=c.fmt):(b=c,n.push(b)),b.translation()?b.fuzzy()?h.push(b):l.push(b):f.push(b)}catch(e){}});this.rows=g();this._add(f,h,l);c&&this.header("POT-Creation-Date",c);return{add:n,del:p}};c.toString=function(){var a,b=[],c=[],f=this.headers(),g=!this.loc,h=n.require("$25","format.js").create(void 0);for(a in f)c.push(a+": "+f[a]);c=new d("",c.join("\n"));g&&c.fuzzy(0,!0);b.push(c.toString());b.push("");this.rows.each(function(a,
187
- c){a&&(b.push(c.cat(h,g)),b.push(""))});return b.join("\n")};c=n.require("$27","message.js").extend(d);c.hash=function(){return b(this.source(),this.context())};c.source=function(a,b){if(null==a)return this.src[0];this.src[0]=a;null!=b&&this.plural(b);return this};c.toString=function(){return this.cat(n.require("$25","format.js").create(void 0))};c.cat=function(a,b){var c,d=[],f;(f=this.cmt)&&d.push(a.prefix(f,"# "));(f=this.xcmt)&&d.push(a.prefix(f,"#. "));c=this.ref;if(f=this._id)c+=(c?" ":"")+
188
- "loco:"+f;c&&/\S/.test(c)&&d.push(a.refs(c));!b&&this.fuzzy()&&d.push("#, fuzzy");(f=this.fmt)?d.push("#, "+f+"-format"):null!=f&&d.push("#, no-c-format");(f=this.ctx)&&d.push(a.pair("msgctxt",f));d.push(a.pair("msgid",this.src[0]));if(null==this.src[1])d.push(a.pair("msgstr",b?"":this.msg[0]));else for(c=-1,d.push(a.pair("msgid_plural",this.src[1]));++c<this.msg.length;)d.push(a.pair("msgstr["+c+"]",b?"":this.msg[c]));return d.join("\n")};c.compare=function(a,b){var c=this.weight(),d=a.weight();
189
- if(c>d)return 1;if(c<d)return-1;if(b){c=this.hash().toLowerCase();d=a.hash().toLowerCase();if(c<d)return 1;if(c>d)return-1}return 0};c=c=null;return f}({},p,w));n.register("$14",function(f,c,n){f.init=function(f){function b(){A&&A.dialog("close");h(f).find('input[type="submit"]').attr("disabled",!1);h(q).addClass("jshide");t&&t(!0)}function g(){h(f).find('input[type="submit"]').attr("disabled",!0);t&&t(!1)}function a(a){var b,c;for(b in r)c=r[b],a[b]?a[b].value=c:h('<input type="hidden" />').attr("name",
190
- b).appendTo(a).val(c)}function d(a){a.preventDefault();a=h(a.target).serializeArray();m(a);w=!0;return!1}function e(a){a.preventDefault();A.dialog("close");return!1}function k(a){a.preventDefault();A.dialog("open");return!1}function n(c){r=c.authed&&c.creds;u=c.method;if(r)"direct"!==u&&(a(f),w&&c.success&&E.notices.success(c.success)),D=!0,b();else if(D=!1,c.reason)E.notices.info(c.reason);else if(c=c.prompt){var g;A||(h(q).find("button.button-small").click(k),A=h('<div id="loco-fs-creds"></div>').dialog({dialogClass:"request-filesystem-credentials-dialog loco-modal",
191
- minWidth:480,modal:!0,autoOpen:!1,closeOnEscape:!0}));g=A;g.html(c).find("form").submit(d);g.dialog("option","title",g.find("h2").remove().text());g.find("button.cancel-button").show().click(e);g.find('input[type="submit"]').addClass("button-primary");h(q).removeClass("jshide")}else E.notices.error("Server didn't return credentials, nor a prompt for credentials")}function p(){b()}function m(a){w=!1;a.path=C;a.auth=v;E.ajax.setNonce("fsConnect",y).post("fsConnect",a,n,p);return a}var r,t,q=f,u=null,
192
- w=!1,D=!1,E=c.locoScope,C=f.path.value,v=f.auth.value,y=f["loco-nonce"].value,A;f.connection_type?(r={},r.connection_type=f.connection_type.value,D=!0):C&&v&&(g(),m({}));return{applyCreds:function(b){if(b.nodeType)a(b);else{var c,d=r||{};for(c in d)b[c]=d[c]}return this},setForm:function(b){f=b;D||g();a(b);return this},connect:function(){var a=h(f).serializeArray();C=a.path;v=a.auth;m(a);return this},listen:function(a){t=a;D&&a(!0);return this}}};return f}({},p,w));n.register("$15",function(f,c,n){function l(a,
193
- b){return function(c){a.apply(c,b);return c}}function b(a){return function(b,c){var f=b&&b[a]||0,g=c&&c[a]||0;return f===g?0:f>g?1:-1}}function g(a){return function(b,c){return(b&&b[a]||"").localeCompare(c&&c[a]||"")}}function a(a){return function(b,c){return-1*a(b,c)}}f.sort=function(c){var e=[],f=[],n,p=0,m=c.getElementsByTagName("tbody")[0];if((c=c.getElementsByTagName("thead")[0])&&m){var r=0;h("th",c).each(function(c,d){var u=d.getAttribute("data-sort-type");u&&(c=r,h(d).addClass("loco-sort").click(function(d){d.preventDefault();
194
- var q=c;d=-1;var r=f[q],u=r.type,v=!(r.desc=!r.desc),w=e,q="n"===u?b(q):g(q);v&&(q=a(q));e=l([].sort,[q])(w);for(h("tr",m).remove();++d<p;)m.appendChild(e[d].$);n&&n.removeClass("loco-desc loco-asc");n=h(r.$).addClass(v?"loco-desc":"loco-asc").removeClass(v?"loco-asc":"loco-desc");return!1}),f[r]={$:d,type:u});d.hasAttribute("colspan")?r+=Number(d.getAttribute("colspan")):r++});h("tr",m).each(function(a,b){var c,d,g={_:a,$:b},h=b.getElementsByTagName("td");for(d in f){c=h[d];c=c.hasAttribute("data-sort-value")?
195
- c.getAttribute("data-sort-value"):c.textContent.replace(/(^\s+|\s+$)/g,"");switch(f[d].type){case "n":c=Number(c)}g[d]=c}e[a]=g});p=e.length}};return f}({},p,w));var H=p.locoScope||(p.locoScope={});p=p.locoConf||(p.locoConf={});w=n.require("$1","t.js").init();var Q=p.wplang;n.require("$2","array.js");H.l10n=w;w.load(p.wpl10n);Q&&w.pluraleq(Q.pluraleq);H.string=n.require("$3","string.js");H.notices=n.require("$4","notices.js").init(w);H.ajax=n.require("$5","ajax.js").init(p).localise(w);H.locale=n.require("$6",
196
- "locale.js");H.fulltext=n.require("$7","fulltext.js");H.watchtext=n.require("$8","LocoTextListener.js").listen;H.selector=n.require("$9","LocoSelector.js").create;H.autocomp=n.require("$10","LocoAutoComplete.js").init;H.po={ed:n.require("$11","poedit.js"),kbd:n.require("$12","hotkeys.js"),init:n.require("$13","po.js").create};H.fs=n.require("$14","fsconn.js");h("#loco.wrap table.wp-list-table").each(function(f,c){n.require("$15","tables.js").sort(c)})})(window,document,window.jQuery);
 
 
 
 
1
+ (function(p,w,h,U){var n=function(){var f={};return{register:function(d,h){f[d]=h},require:function(d,h){var l=f[d];if(!l)throw Error('CommonJS error: failed to require("'+h+'")');return l}}}();n.register("$1",function(f,d,h){function l(b){var g=typeof b;if("string"===g)if(/[^ <>!=()%^&|?:n0-9]/.test(b))console.error("Invalid plural: "+b);else return new Function("n","return "+b);"function"!==g&&(b=function(a){return 1!=a});return b}f.init=function(b){function g(c,e,b){return(c=a[c])&&c[b]?c[b]:e||
2
+ ""}b=l(b);var a={};return{_:function(a){return g(a,a,0)},_x:function(a,e){return g(e+"\u0004"+a,a,0)},_n:function(a,e,k){k=Number(b(k));isNaN(k)&&(k=0);return g(a,i?e:a,k)},load:function(c){a=c||{};return this},pluraleq:function(a){b=l(a);return this}}};return f}({},p,w));n.register("$2",function(f,d,h){Array.prototype.indexOf||(Array.prototype.indexOf=function(d){if(null==this)throw new TypeError;var b,g=Object(this),a=g.length>>>0;if(0===a)return-1;b=0;1<arguments.length&&(b=Number(arguments[1]),
3
+ b!=b?b=0:0!=b&&Infinity!=b&&-Infinity!=b&&(b=(0<b||-1)*Math.floor(Math.abs(b))));if(b>=a)return-1;for(b=0<=b?b:Math.max(a-Math.abs(b),0);b<a;b++)if(b in g&&g[b]===d)return b;return-1});return f}({},p,w));n.register("$3",function(f,d,h){f.trim=function(d,b){for(b||(b=" \n");d&&-1!==b.indexOf(d.substr(0,1));)d=d.substr(1);for(;d&&-1!==b.indexOf(d.substr(-1));)d=d.substr(0,d.length-1);return d};f.sprintf=function(d){var b=0,g,a=[].slice.call(arguments,1);return d.replace(/%(s|u|%)/g,function(c,e){if("%"===
4
+ e)return"%";g=a[b++];return String(g)||""})};return f}({},p,w));n.register("$34",function(f,d,h){function l(c){a||d._gat&&(a=_gat._createTracker(b,"loco"));if(a){var e=c.shift();a[e].apply(a,c)}else g&&g.push(c);return f}var b,g,a;f._init=function(a){if(b=a.code){g=d._gaq||(d._gaq=[]);g.push(["_setAccount",b]);g.push(["_trackPageview"]);g.push(["_setDomainName",a.host]);a=h.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"==h.location.protocol?"https://ssl":"http://www")+
5
+ ".google-analytics.com/ga.js";var e=h.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}return f};f.event=function(a,e,b,g){return l(["_trackEvent",a||"",e||"",b||"",g||0])};f.page=function(a,e){return l(["_trackPageview",{page:a||location.pathname+location.hash,title:e||h.title}])};return f}({},p,w));n.register("$35",function(f,d,h){function l(a,c){if(b)b[a](c);else d.ga&&ga(a,c);return f}var b,g;f._init=function(a){a.code&&(function(a,e,b,g,q,m,r){a.GoogleAnalyticsObject=q;a[q]=a[q]||
6
+ function(){(a[q].q=a[q].q||[]).push(arguments)};a[q].l=1*new Date;m=e.createElement(b);r=e.getElementsByTagName(b)[0];m.async=1;m.src=g;r.parentNode.insertBefore(m,r)}(d,h,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",a.code,{alwaysSendReferrer:!0,userId:a.user}),a.custom&&l("set",a.custom),f.page(),ga(function(a){b=a}));return f};f.event=function(a,c,e,b){return l("send",{hitType:"event",eventCategory:a||"",eventAction:c||"",eventLabel:e||"",eventValue:Number(b||0)})};f.page=
7
+ function(a,c){var e={hitType:"pageview",page:a||location.pathname+location.hash,title:c||h.title};e.location=location.protocol+"//"+location.hostname+e.page;g&&l("set",{referrer:g});g=e.location;return l("send",e)};f.reset=function(){g=location.href;l("set",{page:location.pathname+location.hash,title:h.title,location:g});return f};return f}({},p,w));n.register("$28",function(f,d,M){function l(a,e){h(a).click(function(a){b&&b.event(e,"click",this.getAttribute("href")||"");return!0});a=null;return f}
8
+ var b,g=location.hostname,a="/help"===location.pathname.substr(0,5);f.init=function(a){!b&&a&&(g=a.host||(a.host=g),b=a.legacy?n.require("$34","legacy.js"):n.require("$35","universal.js"),b._init(a));return f};f.link=function(c){for(var e=c.getAttribute("href");e&&"#"!==e;){if(0===e.indexOf("#"))return l(c,"anchor");if("/help"===e.substr(0,5)&&!a)c.setAttribute("target","_blank");else if(0===e.indexOf("http")||0===e.indexOf("//")){if(-1!==e.indexOf(g)&&/^(https?:)*\/\/([^\/]+)/.exec(e)&&g===RegExp.$2)break;
9
+ c.setAttribute("target","_blank");l(c,"external")}break}return f};f.page=function(){b&&b.page.apply(b,arguments);return f};f.event=function(){b&&b.event.apply(b,arguments);return f};f.reset=function(){b&&b.reset&&b.reset();return f};return f}({},p,w));n.register("$31",function(f,d,n){function l(a,c,e,b,d){function q(){t&&clearTimeout(t);s&&s.fadeOut(400,function(){h(this).remove();s=null});return!1}function m(){r();-1!==b&&(t=setTimeout(q,b||2E3));s.off("mouseleave").on("mouseenter",r)}function r(){t&&
10
+ clearTimeout(t);t=null;s.off("mouseenter").on("mouseleave",m)}var t;g||(g=n.createElement("div"),g.id="growls",n.body.appendChild(g));var s=h('<div class="growl growl-'+e+'"><div><a class="close" href="#"><span>X</span></a><span class="badge"></span><p class="message"></p><small class="caption"></small></div></div>');s.find("p").text(a||"Empty message");c?s.find("small").text(c):s.find("small").remove();if(d.length){d.push({label:"Cancel",callback:q,css:"cancel"});var v,A=h('<form action="#" class="dialog"></form>');
11
+ c=function(a,c){v=h('<input type="button" value="'+c.label+'" class="butt '+(c.css||"")+'" />');v.click(function(a){"function"===typeof c.callback&&c.callback(a,{close:q})});A.append(v);return v};for(a=0;a<d.length;a++)c(a,d[a]);s.append(A)}h(g).prepend(s.hide().fadeIn(400));s.find("a").click(q);m()}var b,g;f.init=function(){if(!b)return b=d.alert,d.alert=function(a){a=String(a).split("\n");var c=a[1]&&a.slice(1).join("\n");f.alert(a[0],c)},f};f.debug=function(a){b(a);return f};f.alert=function(a,
12
+ c,e,k,g){try{return l(a,c||"",e||"alert",k||4E3,g||[]),!0}catch(q){return a+="\n\n--\n"+(q.message||q),b.call(d,a),!1}};f.success=function(a,c,e){return f.alert(a,c,"success",e||2E3)};f.dialog=function(a,c,e,b){return f.alert(a,c,b||"alert",-1,e)};f.login=function(a,c,e,b){f.dialog(c||"You're not logged in",e||"Please log in to continue",[{label:b||"Log in",callback:function(c,e){location.assign(a||"/session/auth/login?r="+encodeURIComponent(location.href))}}])};return f}({},p,w));n.register("$36",
13
+ function(f,d,n){function l(a){return 27===a.keyCode&&s&&v?(F(),a.preventDefault(),!1):!0}function b(a){if(s){a=d.innerWidth;var c=d.innerHeight;a!==C&&(C=a,H(u));c!==z&&(z=c,t&&g())}return!0}function g(){var a=e.outerHeight(!0)-t.clientHeight;t.style.maxHeight=String(z-a)+"px"}function a(a){a?(q.show(),k.addClass("has-title")):(q.hide(),k.removeClass("has-title"))}var c,e,k,y,q,m,r,t,s=!1,v=!1,A=!1,D,E,C,u,z,B=f.init=function(){if(!c){c=h('<div id="overlay"></div>');e=h('<div class="overlay-frame"></div>');
14
+ k=h('<div class="overlay-container"></div>');q=h('<div class="overlay-title"><span class="icon"></span><span class="title">Untitled</span></div>');m=h("<nav></nav>");r=h('<a class="overlay-close" href="#"><span>x</span></a>');y=h('<div class="overlay-bg"></div>');c.append(e.append(k)).append(y).prependTo(n.body);h(n).on("keydown",l);h(d).resize(b);C=d.innerWidth;z=d.innerHeight;E=k.outerWidth(!0)-k.width()+(e.innerWidth()-e.width());D=parseInt(k.css("width"));if(!D||isNaN(D))D=k.width();m.hide().prependTo(e);
15
+ q.append(r.hide()).hide().prependTo(e);c.hide()}return c},H=f.width=function(a){var c=B();if(null===a)e.css("width",""),k.css("width","");else{a=a||D||640;x=a+E;u=a;var b=C;x>b?(x=b,a=x-E,c.addClass("spill")):c.removeClass("spill");e.css("width",x+"px");k.css("width",a+"px")}return f};f.autoSize=function(){var a=B(),c=D||0;k.children().each(function(a,e){c=Math.max(c,h(e).outerWidth(!0))});H(c);if(t=a.find("div.overlay-scroll")[0])z=d.innerHeight,g();return f};f.css=function(a){B().attr("class",a);
16
+ return f};f.html=function(a){B();d.innerShiv&&(a=innerShiv(a,!1));return k.html(a)};f.append=function(a){B();a instanceof jQuery||(a=h(a));k.append(a);return f};var F=f.close=function(a){if(s){var e=function(){B().hide();h(n.body).removeClass("has-overlay");s=!1;k.html("");s=null;c.trigger("overlayClosed",[f])};null==a&&(a=300);c.trigger("overlayClosing",[f]);a?c.fadeOut(a,e):e()}return f};f.title=function(c,e){B();var b="",s=q.find("span");e&&/^lang lang-(\w+)/.exec(e)&&(b=RegExp.$1);s.eq(0).attr("class",
17
+ e||"icon").attr("lang",b);A=c||"";s.eq(1).text(A);null!=c?a(!0):v||a(!1);return f};f.enableClose=function(){B();v=!0;r.off("click").on("click",function(a){F();return!1});a(!0);r.show();return f};f.disableClose=function(){B();v=!1;r.hide();s&&A||a(!1);return f};f.enableNav=function(a){m.append(a);m.show();return f};f.disableNav=function(){m.html("").hide();return f};f.open=function(){B();k.html("");H(D);c.attr("class","");h(n.body).addClass("has-overlay");B().show();s=!0;f.title(null);v&&a(!0);c.trigger("overlayOpened",
18
+ [f]);return f};f.listen=function(a){B().on("overlayClosed",a);return f};f.unlisten=function(a){B().off("overlayClosed",a);return f};return f}({},p,w));n.register("$20",function(f,d,n){function l(a,c){this.$element=h(a);this.options=c;this.enabled=!0;this.fixTitle()}f.init=function(a,c){var e={fade:!0,offset:5,delayIn:b,delayOut:g,anchor:a.attr("data-anchor"),gravity:a.attr("data-gravity")||"s"};c&&(e=h.extend({},e,c));a.tipsy(e)};f.delays=function(a,c){b=a||150;g=c||100};f.kill=function(){h("div.tipsy").remove()};
19
+ f.text=function(a,c){c.data("tipsy").setTitle(a)};var b,g;f.delays();h(n.body).on("overlayOpened overlayClosing",function(a){f.kill();return!0});l.prototype={show:function(){var a=this.getTitle();if(a&&this.enabled){var c=this.tip();c.find(".tipsy-inner")[this.options.html?"html":"text"](a);c[0].className="tipsy";c.remove().css({top:0,left:0}).prependTo(n.body);var a=(a=this.options.anchor)?this.$element.find(a):this.$element,a=h.extend({},a.offset(),{width:a[0].offsetWidth,height:a[0].offsetHeight}),
20
+ e=c[0].offsetWidth,b=c[0].offsetHeight,g="function"==typeof this.options.gravity?this.options.gravity.call(this.$element[0]):this.options.gravity,q;switch(g.charAt(0)){case "n":q={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-e/2};break;case "s":q={top:a.top-b-this.options.offset,left:a.left+a.width/2-e/2};break;case "e":q={top:a.top+a.height/2-b/2,left:a.left-e-this.options.offset};break;case "w":q={top:a.top+a.height/2-b/2,left:a.left+a.width+this.options.offset}}2==g.length&&("w"==
21
+ g.charAt(1)?q.left=a.left+a.width/2-15:q.left=a.left+a.width/2-e+15);c.css(q).addClass("tipsy-"+g);c.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+g.charAt(0);this.options.className&&c.addClass("function"==typeof this.options.className?this.options.className.call(this.$element[0]):this.options.className);c.addClass("in")}},hide:function(){this.tip().remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("original-title"))&&a.attr("original-title",
22
+ a.attr("title")||"").removeAttr("title")},getTitle:function(){var a,c=this.$element,e=this.options;this.fixTitle();e=this.options;"string"==typeof e.title?a=c.attr("title"==e.title?"original-title":e.title):"function"==typeof e.title&&(a=e.title.call(c[0]));return(a=(""+a).replace(/(^\s*|\s*$)/,""))||e.fallback},setTitle:function(a){var c=this.$element;c.attr("default-title")||c.attr("default-title",this.getTitle());null==a&&(a=c.attr("default-title")||this.getTitle());c.attr("original-title",a);
23
  if(this.$tip)this.$tip.find(".tipsy-inner")[this.options.html?"html":"text"](a)},tip:function(){this.$tip||(this.$tip=h('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0]));return this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.options=this.$element=null)},enable:function(){this.enabled=!0},disable:function(){this.hide();this.enabled=!1},toggleEnabled:function(){this.enabled=
24
+ !this.enabled}};h.fn.tipsy=function(a){function c(c){var e=h.data(c,"tipsy");e||(e=new l(c,h.fn.tipsy.elementOptions(c,a)),h.data(c,"tipsy",e));return e}function e(){var e=c(this),b=a.delayIn;e.hoverState="in";0==b?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},b))}function b(){var e=c(this),k=a.delayOut;e.hoverState="out";0==k?e.hide():(e.tip().removeClass("in"),setTimeout(function(){"out"==e.hoverState&&e.hide()},k))}a=h.extend({},h.fn.tipsy.defaults,a);a.live||this.each(function(){c(this)});
25
+ if("manual"!=a.trigger){var g=a.live?"live":"bind",q="hover"==a.trigger?"mouseleave":"blur";this[g]("hover"==a.trigger?"mouseenter":"focus",e)[g](q,b)}return this};h.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:0.8,title:"title",trigger:"hover",anchor:null};h.fn.tipsy.revalidate=function(){h(".tipsy").each(function(){var a=h.data(this,"tipsy-pointee"),c;if(!(c=!a)){a:{for(;a=a.parentNode;)if(a==n){a=!0;break a}a=!1}c=!a}c&&
26
+ h(this).remove()})};h.fn.tipsy.elementOptions=function(a,c){return h.metadata?h.extend({},c,h(a).metadata()):c};h.fn.tipsy.autoNS=function(){return h(this).offset().top>h(n).scrollTop()+h(d).height()/2?"s":"n"};h.fn.tipsy.autoWE=function(){return h(this).offset().left>h(n).scrollLeft()+h(d).width()/2?"e":"w"};h.fn.tipsy.autoBounds=function(a,c){return function(){var e=c[0],b=1<c.length?c[1]:!1,g=h(n).scrollTop()+a,q=h(n).scrollLeft()+a,m=h(this);m.offset().top<g&&(e="n");m.offset().left<q&&(b="w");
27
+ h(d).width()+h(n).scrollLeft()-m.offset().left<a&&(b="e");h(d).height()+h(n).scrollTop()-m.offset().top<a&&(e="s");return e+(b?b:"")}};return f}({},p,w));n.register("$21",function(f,d,M){var l={401:"You've been logged out",422:"Invalid data sent to server",404:"Not Found",500:"Server Error",502:"Bad Gateway",503:"Service unavailable",504:"Gateway timeout"};f.getErrors=function(){return l};f.jsonLink=function(b){if(!b)return"";b=b.split("?");b[0]=b[0].replace(/(\.[a-z0-9]{1,4})?$/i,".json");return b.join("?")};
28
+ f.errorData=function(b,g,a){var c,e;a=b.responseText;g=b.status;if(!a&&0===g)return null;try{c=h.parseJSON(a)||{}}catch(k){c={},e=l[b.status]||k.message||k}c.error=e||c.error||c.statusText||b.statusText||l[g]||"Unknown Error";return c};f.ajax=function(b,g,a,c){function e(){a&&a()}function k(a){a.alert&&alert(a.alert);var b=a.success;b&&n.require("$31","growl.js").success.apply(this,b.push?b:[b]);b=c||h(M.body);b.trigger("locoAjaxSuccess",[a]);var k=a.events;if(k&&k.length)for(var g,s=n.require("$28",
29
+ "ga.js");g=k.shift();)b.trigger(g,[a]),s.event("ajax",g);if(b=a.download)d.location.assign(b);else if(b=a.redirect)if(0===b.indexOf("/modal/"))a.modal={url:b};else return d.location.assign(b),!1;else if(a.reload)return d.location.reload(),!1;(b=a.modal)&&n.require("$29","modal.js").replace(b);e();return!0}function y(a,c,b){if("abort"!==c){var t=a.status,s;if(401===t)n.require("$31","growl.js").login(),g&&!1===g(null,l[t],t,a)&&e();else{if("parsererror"===c)d.console&&console.error&&console.error(t,
30
+ a.responseText),s=404===t?"Ajax service not found":/^\s+Fatal error/.test(a.responseText)?"Fatal server error from Ajax request":"Bad Ajax response";else{var v=f.errorData(a,c,b);v&&v.error&&(s=v.error)}"function"===typeof g&&!1===g(null,s,t,a)?e():v&&v.data&&!k(v.data)||(alert(s||"Unknown Ajax error"),e())}}}(b.headers||(b.headers={}))["X-Loco-Csrf"]=d.loco&&G.csrf||"";b.error=y;b.success=function(a,c,b){if(!a||"object"!==typeof a)return y(b,"unknown");(a.status||a.error)&&alert(a.error||a.statusText||
31
+ b.statusText||l[a.status]||"Unknown Error");"function"===typeof g&&!1===g(a&&a.data?a.data:a,null,c,b)?e():a&&a.data?k(a.data):e()};-1!==b.url.indexOf(".json")&&(b.dataType="json");return h.ajax(b)};return f}({},p,w));n.register("$29",function(f,d,M){function l(a){a.stopPropagation();a.preventDefault();return!1}function b(){k||(k=n.require("$36","overlay.js"),k.listen(c));return k}function g(){var a=m.length-1,c=m[a],e=h('<a class="has-icon icon-back" data-gravity="w">Back</a>').attr("href",c[0]).attr("title",
32
+ c[1]).click(function(e){if(m[a]===c&&v())return l(e)});k.enableNav(e);n.require("$20","tooltip.js").init(e)}function a(a,c){b().autoSize();var e=k.init();n.require("$16","html.js").init(e);m.length&&g();e.find("[data-script]").each(function(a,e){e=h(e);for(var b=-1,s,k=e.attr("data-script").split(" ");++b<k.length;)s=k[b],q[s]?q[s](e,c||{}):alert("Unknown script "+s)});e.trigger("locoModalLoaded",[k,a||"",c||{}]);var s,r=e.find("form")[0],d;if(r)a:for(e=0;e<r.elements.length;e++)switch(s=r.elements[e],
33
+ s.type){case "text":case "email":case "textarea":d=Number(s.getAttribute("tabindex"));if(isNaN(d)||100>d)continue a;h(s).focus();break a}}function c(){r=null;m=[];return!0}function e(a){var c=h(a.currentTarget),e=c.attr("data-modal");if("back"===e){if(v())return l(a);e="close"}if("close"===e){s();var b=c.attr("href");if(b&&-1!==b.indexOf("#!"))return!0}else{var k="submit"===a.type,g=c.attr("title")||c.attr("data-title"),b=c.attr("href")||c.attr("action"),r=k?c.serialize():"",c=k?c.attr("method"):
34
+ "get";e||(e=b.split("/").slice(1,4).join("-"));t(b,g,c,r,"modal "+e)}return l(a)}var k,y=n.require("$28","ga.js"),q={},m=[],r,t=f.load=function(c,e,s,g,d){var v=r;r=[].slice.call(arguments);v&&c!==v[0]&&(m.push(v),c+=-1===c.indexOf("?")?"?":"&",c+="r="+encodeURIComponent(v[0]));b().open().title("Loading ..").disableClose().disableNav().css("modal").html('<div class="loading"></div>');d&&k.width(null).css(d).autoSize();var v=c.split("#"),q=v[1];q&&(c=v[0]);var v=n.require("$21","http.js"),l={type:s||
35
+ "get",data:g||"",url:v.jsonLink(c)};v.ajax(l,function(b,v,f){var z=b&&b.html;if(!z)return b&&b.redirect?(r=m.pop()||null,t(b.redirect,e,s,g,d)):(b=h('<h3 class="error"></h3>').text(v||"Unknown error"),k.enableClose().title("Error "+f||"?").html("").append(b)),!1;e=b.title||e||"Untitled";r&&(r[1]=e);k.enableClose().title(e,b.icon).html(z);f=b.js||{};q&&(f["#"]=q);a(c,f);y.page(c,e);k.init().one("overlayClosed",function(){y.reset()});return!0});return f},s=f.close=function(){b().close();return f},v=
36
+ f.back=function(){if(previous=m.pop())return r=m[m.length-2],t.apply(null,previous),!0};f.reload=function(){r&&t.apply(null,r)};f.initLink=function(a){a.click(e)};f.initForm=function(a){h(a).submit(e)};f.replace=function(c){b();var e=c&&c.html,s=c&&c.url,g=c&&c.title,r=c&&c.action;if(s)c=c&&c.css||s.split("/").slice(1,4).join("-"),t(s,g,"","",c);else if(e)k.open().html(e),g&&k.enableClose().title(g),a("",c&&c.js);else if("function"===typeof f[r])f[r]()};f.find=function(a){return b().init().find(a)};
37
+ f.script=function(a,c){if(c){if("function"!==typeof c.run)throw Error(a+" macro has no run function");q[a]=c.run;return f}return q[a]};return f}({},p,w));n.register("$8",function(f,d,n){f.listen=function(f,b){function g(){t[k?"show":"hide"]()}function a(a){r&&f.setAttribute("size",a.length||1);k=a;g();return a}function c(){y=null;b(k)}function e(){var e=f.value;m&&e===m&&(e="");e!==k&&(y&&clearTimeout(y),a(e),q?y=setTimeout(c,q):c())}var k,y;f=f instanceof jQuery?f[0]:f;var q=150,m=d.attachEvent&&
38
+ f.getAttribute("placeholder"),r=1===Number(f.size),t=h('<a href="#clear" tabindex="-1" class="icon clear"><span>clear</span></a>').click(function(a){f.value="";e();return!1});a(f.value);h(f).on("input blur focus",function(){e();return!0}).after(t);g();return{delay:function(a){q=a},ping:function(b){b?(y&&clearTimeout(y),b=f.value,m&&b===m&&(b=""),a(b),c(),b=void 0):b=e();return b},val:function(c){if(null==c)return k;y&&clearTimeout(y);f.value=a(c);g()},el:function(){return f},blur:function(a){return h(f).on("blur",
39
  a)}}};return f}({},p,w));n.register("$19",{"\u00e1":"a","\u00e0":"a","\u0103":"a","\u1eaf":"a","\u1eb1":"a","\u1eb5":"a","\u1eb3":"a","\u00e2":"a","\u1ea5":"a","\u1ea7":"a","\u1eab":"a","\u1ea9":"a","\u01ce":"a","\u00e5":"a","\u01fb":"a","\u00e4":"a","\u01df":"a","\u00e3":"a","\u0227":"a","\u01e1":"a","\u0105":"a","\u0101":"a","\u1ea3":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1eb7":"a","\u1ead":"a","\u1e01":"a","\u01fd":"\u00e6","\u01e3":"\u00e6","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0107":"c",
40
  "\u0109":"c","\u010d":"c","\u010b":"c","\u00e7":"c","\u1e09":"c","\u010f":"d","\u1e0b":"d","\u1e11":"d","\u0111":"d","\u1e0d":"d","\u1e13":"d","\u1e0f":"d","\u00f0":"d","\ua77a":"d","\u01c6":"\u01f3","\u00e9":"e","\u00e8":"e","\u0115":"e","\u00ea":"e","\u1ebf":"e","\u1ec1":"e","\u1ec5":"e","\u1ec3":"e","\u011b":"e","\u00eb":"e","\u1ebd":"e","\u0117":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u0113":"e","\u1e17":"e","\u1e15":"e","\u1ebb":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u1e19":"e",
41
  "\u1e1b":"e","\u1e1f":"f","\ua77c":"f","\u01f5":"g","\u011f":"g","\u011d":"g","\u01e7":"g","\u0121":"g","\u0123":"g","\u1e21":"g","\ua7a1":"g","\u1d79":"g","\u0125":"h","\u021f":"h","\u1e27":"h","\u1e23":"h","\u1e29":"h","\u0127":"h","\u210f":"h","\u1e25":"h","\u1e2b":"h","\u1e96":"h","\u00ed":"i","\u00ec":"i","\u012d":"i","\u00ee":"i","\u01d0":"i","\u00ef":"i","\u1e2f":"i","\u0129":"i","\u012f":"i","\u012b":"i","\u1ec9":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u1e2d":"i","\u0135":"j","\u01f0":"j",
48
  "\u1fc2":"\u03b7","\u1fc6":"\u03b7","\u1fc7":"\u03b7","\u1fc3":"\u03b7","\u1f30":"\u03b9","\u1f34":"\u03b9","\u1f32":"\u03b9","\u1f36":"\u03b9","\u1f31":"\u03b9","\u1f35":"\u03b9","\u1f33":"\u03b9","\u1f37":"\u03b9","\u03af":"\u03b9","\u1f77":"\u03b9","\u1f76":"\u03b9","\u1fd0":"\u03b9","\u1fd6":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u1fd3":"\u03b9","\u1fd2":"\u03b9","\u1fd7":"\u03b9","\u1fd1":"\u03b9","\u1f40":"\u03bf","\u1f44":"\u03bf","\u1f42":"\u03bf","\u1f41":"\u03bf","\u1f45":"\u03bf",
49
  "\u1f43":"\u03bf","\u03cc":"\u03bf","\u1f79":"\u03bf","\u1f78":"\u03bf","\u1fe4":"\u03c1","\u1fe5":"\u03c1","\u1f50":"\u03c5","\u1f54":"\u03c5","\u1f52":"\u03c5","\u1f56":"\u03c5","\u1f51":"\u03c5","\u1f55":"\u03c5","\u1f53":"\u03c5","\u1f57":"\u03c5","\u03cd":"\u03c5","\u1f7b":"\u03c5","\u1f7a":"\u03c5","\u1fe0":"\u03c5","\u1fe6":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u1fe3":"\u03c5","\u1fe2":"\u03c5","\u1fe7":"\u03c5","\u1fe1":"\u03c5","\u1f60":"\u03c9","\u1f64":"\u03c9","\u1fa4":"\u03c9",
50
  "\u1f62":"\u03c9","\u1fa2":"\u03c9","\u1f66":"\u03c9","\u1fa6":"\u03c9","\u1fa0":"\u03c9","\u1f61":"\u03c9","\u1f65":"\u03c9","\u1fa5":"\u03c9","\u1f63":"\u03c9","\u1fa3":"\u03c9","\u1f67":"\u03c9","\u1fa7":"\u03c9","\u1fa1":"\u03c9","\u03ce":"\u03c9","\u1f7d":"\u03c9","\u1ff4":"\u03c9","\u1f7c":"\u03c9","\u1ff2":"\u03c9","\u1ff6":"\u03c9","\u1ff7":"\u03c9","\u1ff3":"\u03c9","\u0491":"\u0433","\u0450":"\u0435","\u0451":"\u0435","\u04c2":"\u0436","\u045d":"\u0438","\u04e3":"\u0438","\u04ef":"\u0443"});
51
+ n.register("$7",function(f,d,h){f.init=function(){function d(a){return f[a]||a}function b(a){return String(a||"").toLowerCase().replace(e,d)}function g(a,c,e){for(var b=a.split(k),s=b.length;0!==s--;)(a=b[s])&&null==e[a]&&(c.push(a),e[a]=!0);return c}function a(a,e){for(var k=[],d={},s,f=e.length;0!==f--;)(s=e[f])&&g(b(s),k,d);c[a]=k}var c=[],e=/[^a-z0-9]/g,k=/[\-_\s.?!;:,*^+=~`"(){}<>\[\]\/\\\u00a0\u1680\u180e\u2000-\u206f\u2e00-\u2e7f\u3000-\u303f]+/,f=n.require("$19","flatten.json");return{find:function(a,
52
+ e){var k=[],d=-1,s=c,f=s.length,y,h,l,n,u,z,B=g(b(a),[],{}),H=B.length,F=e?!0:!1;a:for(;++d<f;)if(l=s[d],null!=l&&(n=l.length)){u=0;b:for(;u<H;u++){z=B[u];for(y=0;y<n;y++)if(h=l[y],0===h.indexOf(z))continue b;continue a}k.push(F?e[d]:d)}return k},add:function(a,e){c[a]=g(b(e),[],{})},push:function(e){a(c.length,e)},index:function(c,e){a(c,e)},size:function(){return c.length},clear:function(){c=[]},remove:function(a){c[a]=null}}};return f}({},p,w));n.register("$22",function(f,d,h){f.create=function(){var d=
53
+ [],b=n.require("$7","fulltext.js").init();return{add:function(g,a){b.add(d.length,a);d.push(g);return this},find:function(g){return b.find(g,d)},clear:function(){d=[];b.clear();return this}}};return f}({},p,w));n.register("$10",function(f,d,p){function l(b){-1===b.indexOf("?")&&(b="/auto/"+b+".json?q=");this.url=b;this.dead={}}function b(){this.dict=n.require("$22","dict.js").create()}f.init=function(g){function a(){if("hint"!==H){var a=z.val()&&!(I&&I.val())&&null==C&&!A;V[a?"addClass":"removeClass"]("error")}}
54
+ function c(a){I&&I.val(a)}function e(){p.show();var a=z.outerWidth(!1),c=z.outerHeight(!1),e=z.css("margin-top");e&&(e=parseInt(e),isNaN(e)||(c+=e));a-=2;p.css("top",c+"px").css("width",a+"px");A=!0}function k(){p.hide();A=!1}function d(){p.html("");k();v=0;u=C=null}function f(c){d();var b;for(b=0;b<c.length;b++){var s=b,k=c[b],g=k.value,t=k.lang||g.lang,z=h('<span class="label"></span>').text(k.label),A=h('<div class="auto-comp-result"></div>'),q=void 0,B=void 0;if(B=k.icon)q=h("<span></span>").attr("class",
55
+ B).appendTo(A),t?(q.attr("lang",t),k.lang=t):-1!==B.indexOf("lang-"+g)&&(q.attr("lang",g),k.lang=g);for(B in k)A.data(B,k[B]);A.append(z);m(s,A)}(v=c.length)?(D&&e(),r(0)):(r(null),a(),V.trigger("locoAutonone",[]))}function m(a,c){p.append(c);c.click(function(e){e.stopPropagation();r(a,c);s();return!1});return c}function r(a,e){u&&(u.removeClass("selected"),u=null);C=null;null==a?c(""):(e||(e=p.find("div.auto-comp-result").eq(a)),e.length&&(e.addClass("selected"),C=a,u=e))}function t(a){if(v){var c=
56
+ v-1;null==C?a=0<a?0:c:(a=C+a,0>a?a=c:a>c&&(a=0));return r(a)}}function s(){if(null==C)w.val(""),c("");else{var e=p.find("div.auto-comp-result").eq(C),b=e.data()||{label:"Error"},s=b.value,g=b.label;c(s);w.val(g);k();e=e.clone();e.data(b);d();m(0,e);v=1;r(0,e);a();e.trigger("locoAutocomp",[s,g,e])}}var v=0,A=!1,D=!1,E=g.form,C=null,u=null,z=h(g),B=z.attr("name"),H=z.attr("data-mode"),F=z.attr("data-provider"),I="hint"!==H&&h('<input type="hidden" value="" name="'+B+'" />').appendTo(E),V=h('<div class="auto-comp-wrap"></div>').replaceAll(z),
57
+ p=h('<div class="auto-comp-drop"></div>');F&&(F=new l(F));I&&z.attr("name","_"+B);z.attr("autocomplete")||z.attr("autocomplete","off");V.append(z).append(p);k();z.focus(function(a){D=!0;1<v&&e()}).blur(function(c){D=!1;a()}).keydown(function(a){function c(){a.preventDefault();a.stopPropagation();return!1}switch(a.keyCode){case 27:A&&(a.stopPropagation(),k(),z.blur());break;case 40:v&&(A?t(1):e());break;case 38:A&&t(-1);break;case 13:if(A)return s(),c();if(!C&&"hint"!==H)return c()}return!0});var w=
58
+ n.require("$8","LocoTextListener.js").listen(z,function(a){F&&F.fetch(a,f)});(E=z.attr("data-pre"))&&(E=h.parseJSON(E))&&E.value&&E.label?(f([E]),s()):!g.value||I&&I.val()||!F||F.fetch(g.value,function(a){f(a);s()});return{$:z,val:function(){return I&&I.val()},clear:d,reset:function(){d();z.val("");c("");w.ping()},force:function(a,e){d();c(e||"");w.val(a)},preload:function(a){v&&d();F=new b;var c,e;for(c in a)e=a[c],F.add(e)},mode:function(a){H=a},provide:function(a){F=new l(a)}}};l.prototype.fetch=
59
+ function(b,a){if(!b)return a&&a([]),this.dead={},this;var c,e=this.dead;for(c in e)if(0===b.indexOf(c))return a&&a([]),this;c={dataType:"json",url:this.url+encodeURIComponent(b)};n.require("$21","http.js").ajax(c,function(c){var d=c&&c.results;d&&(a&&c.query&&c.query===b&&a(c.results),d.length||(e[b]=0));return!0});return this};b.prototype.add=function(b){var a=b.fulltext||b.label||b.value;a&&this.dict.add(b,a)};b.prototype.fetch=function(b,a){var c=b?this.dict.find(b):[];a&&a(c);return this};return f}({},
60
+ p,w));n.register("$9",function(f,d,p){function l(a){a.stopPropagation();a.preventDefault();return!1}function b(a,c,e){if(e=e||a.getElement(c))e.off().mouseup(function(e){e.stopPropagation();a.selectIndex(c,!0);return!1}).mouseover(function(){h(this).addClass("over");a.hover=c;return!0}).mouseout(function(){h(this).removeClass("over");a.hover=-1;return!0}),e=null;return a}function g(a){if(a){var c,e=a[0],b=e.id,g=e.title,d=[],f=[],r=-1,t=e.options.length,s,v=this.selectedIcon||"";this.id=b||"";this.name=
61
+ e.name||"";this.prefix=e.getAttribute("data-prefix");for(this.defaultIcon=e.getAttribute("data-icon")||"icon no-icon";++r<t;)c=e.options[r],s=c.disabled,c.selected&&d.push(r),c=h(c),f.push([c.val(),c.text(),c.attr("data-icon")||v,s,c.attr("lang")]);this.hidden||(this.hidden=h('<input type="hidden" name="'+this.name+'" value="" />').appendTo(e.form));this.list=h('<ul class="clearfix"></ul>');this.icon=h('<span class="icon"> </span>');this.selection=h('<span class="label"></span>');this.handle=h('<a class="handle" href="#"></a>').attr("tabindex",
62
+ a.attr("tabindex")||"").append(this.icon).append(this.selection);c=h('<div class="selector"></div>').addClass(e.className).append(this.handle).append(this.list).replaceAll(e);b&&c.attr("id",b);g&&a.hasClass("hastip")&&(c.attr("title",g),n.require("$20","tooltip.js").init(c,{gravity:a.attr("data-gravity")||"s",anchor:a.attr("data-anchor")}));this.wrapper=c;for(this.clearOptions();c=f.shift();)this.addOption.apply(this,c);this.enable();this.close();if(t=d.length)for(r=0;r<t;r++)this.selectIndex(d[r]);
63
+ else r=e.selectedIndex,null!=r&&0<=r&&this.selectIndex(r)}}f.create=function(a){return new g(a)};f.extend=function(a){a.parent=g;a.prototype=new g};d=g.prototype;d.enable=function(){var a=this;a.handle.click(function(a){a.preventDefault();return!1}).mouseover(function(c){return a.onRollover(c)}).mouseout(function(c){return a.onRollout(c)}).mousedown(function(c){return a.onPress(c)}).keydown(function(c){return a.onKeydown(c)});h(p).mouseup(function(c){return a.onRelease(c)}).keydown(function(c){return a.onGlobalKeydown(c)})};
64
+ d.onRollover=function(a){return this.over=!0};d.onRollout=function(a){this.over=!1;return!0};d.onPress=function(a){return this.active?this.over?(this.close(),a.stopPropagation(),a.preventDefault(),!1):!0:(this.open(),a.stopPropagation(),a.preventDefault(),this.handle.focus(),!1)};d.onRelease=function(a){this.active&&!this.over&&this.close();return!0};d.onGlobalKeydown=function(a){if(this.active)switch(a.keyCode){case 27:return this.close(),l(a);case 40:return this.hoverNext(1),l(a);case 38:return this.hoverNext(-1),
65
+ l(a);case 13:if(-1!=this.hover)return this.selectIndex(this.hover,!0),this.hoverItem(-1),this.close(),l(a)}return!0};d.onKeydown=function(a){return this.active||40!==a.keyCode?!0:(this.open(),l(a))};d.open=function(){var a=this.list,c=this.wrapper,e=c.data("tipsy"),b=this.handle,g=b.outerHeight()||0;this.active=!0;this.hover=-1;c.addClass("active");a.show().css("top",g+"px");e&&e.disable();c=b.outerWidth()||0;e=a.outerWidth()||0;c>e&&(e-=a.width(),a.css("min-width",String(c-e)+"px"))};d.close=function(){var a=
66
+ this.wrapper,c=a.data("tipsy");this.list.hide();this.active=!1;-1!==this.hover&&(this.getElement(this.hover).removeClass("over"),this.hover=-1);a.removeClass("active");c&&c.enable()};d.hoverItem=function(a,c){-1!==this.hover&&this.getElement(this.hover).removeClass("over");this.hover=a;-1!==a&&(c=c||this.getElement(a),c.addClass("over"))};d.hoverNext=function(a){var c=this.options.length;if(c){c-=1;if(-1==this.hover)a=0<a?0:c;else{a=this.hover+a;if(0>a){this.close();return}a>c&&(a=0)}this.hoverItem(a)}};
67
+ d.enableChange=function(a){this.eventName=a;this.eventData=[].slice.call(arguments,1);return this};d.enableConfirm=function(a){this.confirm=a;return this};d.clearOptions=function(){this.index={};this.length=0;this.options=[];this.list.html("");this.hidden.val("");this.idx=this.hover=-1;return this};d.destroy=function(){this.clearOptions();this.hidden.remove()};d.addOption=function(a,c,e,k,g){var d=this.options.length,f=h("<span></span>").addClass(e||"icon no-icon"),r=h('<span class="label"></span>').text(c||
68
+ a),r=h("<li></li>").append(f).append(r).appendTo(this.list);g?g=g.split("-").shift():e&&-1!==e.indexOf("lang-"+a)&&(g=a);g&&f.attr("lang",g);r.attr("data-option",d);this.options[d]={value:a,text:c,lang:g||"",icon:e};this.index[a]=d;this.length=d+1;k?this.disableIndex(d):b(this,d,r);return d};d.disableOption=function(a){return this.disableIndex(this.index[a])};d.disableIndex=function(a){(a=this.getElement(a))&&a.addClass("disabled").off();return this};d.enableOption=function(a){return this.enableIndex(this.index[a])};
69
+ d.enableIndex=function(a){return b(this,a)};d.reIndex=function(){this.index={};this.length=0;for(var a=this.options.length;0!==a--;)this.index[this.options[a].value]=a,this.length++};d.selectValue=function(a,c){return this.selectIndex(this.index[a],c)};d.selectIndex=function(a,c){var e=this.options[a];if(e){var b=this,g=b.idx,d=e.value,f=e.icon||b.defaultIcon,r=function(){null!=g&&b.getElement(g).removeClass("active");b.getElement(a).addClass("active");b.setLabel(e.text).setIcon(f,e.lang);b.hidden.val(d);
70
+ b.idx=a;c&&b.change()};g===a?b.hidden.val(d):c?"function"===typeof b.confirm?b.confirm.call(null,e,function(a){a&&r()}):b.beforeChange(d)&&r():r();b.active&&b.close()}return this};d.setLabel=function(a){this.selection.text(a);this.prefix&&this.selection.prepend(h('<span class="prefix"></span>').text(this.prefix));return this};d.setIcon=function(a,c){this.icon.attr("class",a).attr("lang",c||"");return this};d.val=function(){var a=this.options[this.idx];return a&&a.value};d.change=function(){var a=
71
+ this.val(),c=this.save,e=this.eventName||"change",b=[a].concat(this.eventData||[]);this.wrapper.trigger(e,b);c&&c(a);return this};d.beforeChange=function(a){var c=h.Event("locoBeforeSelect");this.wrapper.trigger(c,[a]);return!c.isDefaultPrevented()};d.renameOption=function(a,c){var e=this.index[a],b=this.options[e];b&&(b.text=c,this.getElement(e).find("span.label").text(c),e===this.idx&&this.setLabel(c));return this};d.removeOption=function(a){var c=this.index[a],e=this.options[c];e&&(a=this.val(),
72
+ this.getElement(c).remove(),this.options.splice(c,1),this.reIndex(),a===e.value?this.selectIndex(0,!0):this.selectValue(a,!1))};d.getElement=function(a){return this.list.find("li").eq(a)};d.persist=function(a){var c=this.id||this.name,e=a.fetch(c);null!=e&&this.selectValue(e,!0);this.save=function(e){a.store(c,e)};return this};d.listen=function(a){return this.on(this.eventName||"change",a)};d.on=function(a,c){this.wrapper.on(a,c);return this};d=null;return f}({},p,w));n.register("$30",function(f,
73
+ d,p){function l(b){var g=[],a=h([]);this.hidden=a;this.selected=g;this.selectedIcon="icon icon-checkbox";this.constructor.call(this,b);this.wrapper.addClass("multi");for(var c,e,k,d=h('<input type="checkbox" name="'+this.name+'[]" />')[0],f=this.options,m=f.length,r=-1;++r<m;)c=this.getElement(r)[0],k=d.cloneNode(!0),g[r]&&(k.checked=!0),k.setAttribute("value",f[r].value),a.push(c.appendChild(k));(e=this.defaultIcon)&&this.setIcon(e);(e=b.attr("title"))?this.setLabel(e):this.wrapper.addClass("no-title")}
74
+ f.create=function(b){return new l(b)};n.require("$9","LocoSelector.js").extend(l);d=l.prototype;d.selectIndex=function(b,g){return this.setIndexState(b,!this.selected[b],g)};d.setIndexState=function(b,g,a){var c=this.options[b],e=this.getElement(b),k=this.hidden[b],d=this.selected;c&&g!==d[b]&&(d[b]=g,e[g?"addClass":"removeClass"]("checked"),k&&(k.checked=g),a&&this.change());return this};d.selectValue=function(b,g){if(null==b.pop)return l.parent.prototype.selectValue.call(this,b,g);for(var a=this.selected.slice(),
75
+ c=this.options.length,e=!1,k=-1,d=-1;++k<c;)a[k]&&(e=!0),a[k]=!1;if(c=b.length)for(;++d<c;)k=this.index[b[d]],!1===a[k]&&(e=a[k]=!0);if(e){for(k in a)this.setIndexState(k,a[k]);g&&this.change()}return this};d.val=function(){for(var b=[],g=this.options,a=this.selected,c=a.length,e=-1;++e<c;)a[e]&&b.push(g[e].value);return b};d=null;return f}({},p,w));n.register("$16",function(f,d,p){var l=d.ieVersion;f.ie=function(b){return b?l<=b:l};var b=f.init=function(g){g?g instanceof jQuery||(g=h(g)):g=h(p.body);
76
+ var a=n.require("$28","ga.js"),c=n.require("$17","forms.js"),e=n.require("$29","modal.js"),k=n.require("$10","LocoAutoComplete.js"),d=n.require("$9","LocoSelector.js"),q=n.require("$30","LocoMultiSelector.js"),m=n.require("$20","tooltip.js");g.find("form").each(function(a,b){var s=h(b);l&&10>l&&c.placeholders(s);b.getAttribute("data-modal")?e.initForm(b):b.action&&0!==s.attr("action").indexOf("#")&&!b.target&&c.jsonify(b);s.hasClass("hasreveal")&&c.revealify(s);s.find("input.auto-comp").each(function(a,
77
+ c){k.init(c)});s.find("select.selector").each(function(a,c){c.hasAttribute("multiple")?q.create(h(c)):d.create(h(c))});s.find("button.hastip").each(function(a,c){m.init(h(c))})});g.find("a").each(function(c,k){-1!==k.className.indexOf("hastip")&&m.init(h(k));if(-1!==k.href.indexOf("/modal/")||k.getAttribute("data-modal"))e.initLink(h(k));else{a.link(k);var s=k.getAttribute("data-ajax-target");s&&(s=h("#"+s),h(k).click(function(a){a.preventDefault();s.addClass("loading");h.get(k.href,function(a){a=
78
+ f.$(a).replaceAll(s);b(a);a.trigger("locoAhah")});return!1}))}});c=e=k=g=null;return f};f.$=function(b){return h(d.innerShiv?innerShiv(b,!1):b)};h.fn._html=function(g){return null!=g?(g=this.html(d.innerShiv?innerShiv(g,!1):g),b(this),g):j.html()};h.fn.macro=function(b,a){if("function"!==typeof b.run)throw Error("macro has no run function");b.run(this,a||{});return this};f.el=function(b,a){var c=p.createElement(b||"div");a&&(c.className=a);return c};f.txt=function(b){return p.createTextNode(b||"")};
79
+ f.h=function(){function b(){e=/[<>&]/g;k=/(\r\n|\n|\r)/g;d=/(?:https?):\/\/([a-zA-Z0-9\-_\.\?%~&;=\/]+(?:#.*)?)/g;b=null}function a(a){return"&#"+a.charCodeAt(0)+";"}function c(a,c){return'<a href="'+a+'">'+c+"</a>"}var e,k,d;return function(f,m){b&&b();var r=f.replace(e,a);m&&(r=r.replace(k,"<br />").replace(d,c));return r}}();f.noop=function(b){b.preventDefault();b.stopPropagation();return!1};return f}({},p,w));n.register("$17",function(f,d,p){function l(a){function c(){a.value===d&&(a.value="",
80
+ b.removeClass("placeheld"));return!0}function e(){""===a.value&&(a.value=d,b.addClass("placeheld"));return!0}var b=h(a);if(!b.hasClass("auto-comp")){var d=b.attr("placeholder");if(d)return b.focus(c).blur(e),e(),{kill:function(){c();b.off("focus",c).off("blur",e)}}}}var b=f.enable=function(a){function c(a,c){c.getAttribute("data-was-disabled")||(c.disabled=!1)}a.find(".button").removeClass("loading");a.find("button").each(c);a.find("input").each(c);a.find("select").each(c);a.find("textarea").each(c);
81
+ d.attachEvent&&a.hasClass("has-placeholders")&&f.placeholders(a);delete a._disabled},g=f.disable=function(a){function c(a,c){c.disabled?c.setAttribute("data-was-disabled","true"):c.disabled=!0}a._disabled||(a.find(".button").addClass("loading"),a.find("button").each(c),a.find("input").each(c),a.find("select").each(c),a.find("textarea").each(c),a._disabled=!0)};f.jsonify=function(a,c,e){a instanceof jQuery||(a=h(a));a.disable||(h.fn.disable=function(){g(this);return this},h.fn.enable=function(){b(this);
82
+ this.placehold&&this.placehold();return this});var k="";a.find('[type="submit"]').click(function(a){a&&a.target&&a.target.name&&(k=encodeURIComponent(a.target.name)+"="+encodeURIComponent(a.target.value));return!0});a.submit(function(b){if(b&&b.isDefaultPrevented&&b.isDefaultPrevented()||e&&!1===e(b))return!1;var g=d.tinyMCE;g&&a.find("textarea.editor").each(function(a,c){var e=g.get(c.id);e&&e.save()});var f=a.serialize(),f=f.replace(/%0D%0A/g,"%0A");k&&(f&&(f+="&"),f+=k,k="");a.disable();var s=
83
+ n.require("$21","http.js"),f={url:s.jsonLink(a.attr("action")),type:a.attr("method"),data:f};s.ajax(f,c,function(){a.enable()},a);b.preventDefault();b.stopPropagation();return!1});if(a.hasClass("autopost")){var f,q=Number(a.attr("data-autopost-delay")||500);a.find('input[type="checkbox"]').change(function(){f&&clearTimeout(f);f=setTimeout(function(){a.submit()},q);return!0})}};f.revealify=function(a){a=a.closest("form");a.find("div[data-reveal-if]").each(function(c,e){function b(a){var c;A=A||a.target;
84
+ if("."===s)c=Boolean(A&&A[v]),r&&(c=!c);else{var e,k=h(A.form).serializeArray();for(e in k)k[e].name===t&&(c=k[e].value);c=r?v!==c:v===c}if(c!==f)if(f=c,a)d[f?"slideDown":"slideUp"](200);else d[f?"show":"hide"]();return!0}var d=h(e),g=/^(\!?)([_\w\-\[\]]+)(\.|!?=)(.*)$/.exec(d.attr("data-reveal-if"));if(g){var f,r=g[1],t=g[2],s=g[3],v=g[4],g=a[0][t];if(g.type||null==g.length)g=[g];c=g.length;for(var A;0!==c--;)A=g[c],b(),h(A).change(b).removeClass("jshide");g=g=A=null}});a=null};f.linkify=function(a){var c=
85
+ a.getAttribute("data-icon");if(c){var e=h(a),b=h("<a> </a>");b.attr("href",a.form.action);b.attr("class",e.attr("class"));b.attr("tabindex",e.attr("tabindex"));e.attr("tabindex","-1");b.text(e.val());c&&h("<span></span>").prependTo(b).addClass(c);e.hide().after(b);b.click(function(a){e.click();return!1})}};f.placeholders=function(a){var c,b=[];a.find("input[placeholder]").each(function(a,d){"password"!==d.type&&(c=l(d))&&b.push(c)});b.length&&(a.submit(function(){for(var a in b)b[a].kill()}),a.addClass("has-placeholders"),
86
+ c=i=null)};return f}({},p,w));n.register("$4",function(f,d,p){function l(a,c,b){function e(){d();g=setTimeout(c,b)}function d(){g&&clearTimeout(g);g=null}var g;e();h(a).mouseenter(d).mouseleave(e);return{die:function(){d();h(a).off("mouseenter mouseleave")}}}function b(a,c){a.fadeTo(c,0,function(){a.slideUp(c,function(){a.remove();h(d).triggerHandler("resize")})})}function g(a,c){function e(c){k[f]=null;b(h(a),250);g&&g.die();var d;if(d=c)c.stopPropagation(),c.preventDefault(),d=!1;return d}var g,
87
+ f;h('<button type="button" class="notice-dismiss" href="#"> </a>').prependTo(a).click(e);h(d).triggerHandler("resize");y();f=k.length;k.push(e);c&&(g=l(a,e,c))}function a(a,c,b){var e=n.require("$16","html.js");a=h('<div class="notice notice-'+a+'" loco-notice inline></div>').prependTo(h("#loco-notices"));var d=h(e.el("p"));b=h(e.el("span")).text(b);c=h(e.el("strong","has-icon")).text(c+": ");d.append(c).append(b).appendTo(a);return a}function c(c,b,e,k){c=a(e,b,c).hide().fadeIn(500);h(d).triggerHandler("resize");
88
+ g(c,k);return f}function e(){h("#loco-notices").find("div.notice").each(function(a,c){g(c,!1)})}var k=[],y=Date.now||function(){return(new Date).getTime()},q,m,r,t;f.error=function(a){return c(a,q,"error")};f.warning=function(a){return c(a,m,"warning")};f.info=function(a){return c(a,r,"info")};f.success=function(a){return c(a,t,"success",5E3)};f.log=function(){d.console&&console.log&&console.log.apply(console,arguments)};f.debug=function(a,c){d.console&&console.error&&(console.error("Loco Error: "+
89
+ a),c&&console.debug&&console.debug(c))};f.clear=function(){for(var a=-1,c,b=k,e=b.length;++a<e;)(c=b[a])&&c();k=[];return f};f.create=a;f.raise=function(a){var c=f;(c[a.type]||c.error).call(c,a.message)};f.init=function(a){q=a._("Error");m=a._("Warning");r=a._("Notice");t=a._("OK");setTimeout(e,1E3);return f};return f}({},p,w));n.register("$5",function(f,d,p){function l(c,b,d,f){function m(a,b,k){var f=g||{_:function(a){return a}},m=a.responseText,q=h("<pre>"+m+"</pre>").text();q&&(q=q.replace(/(^\s+|\s+$)/g,
90
+ ""));q||(q=m);r.debug("Ajax failure for "+c,{status:a.status,error:b,message:k,output:m});r.log(f._("Provide the following text when reporting a problem")+":\n--8<--\n",q,"\n------");"parsererror"===b?(m=f._("Check console output for debugging information"),(q=q.split(/[\r\n]/)[0])?(q=q.replace(/ +in +\S+ on line \d+/,""),q=q.replace(/^[()! ]+Fatal error:\s*/,""),r.error(q+".\n"+m)):r.error(f._("Server returned invalid data")+". "+m)):r.error(k||f._("Unknown error"));d&&d(a,b,k)}f.url=a;f.dataType=
91
+ "json";f.error=m;f.success=function(a,c,e){var d=a&&a.data,g=a&&a.notices,f=g&&g.length;for(!d||a.error?m(e,c,a&&a.error&&a.error.message):b&&b(d,c,e);f--;)r.raise(g[f])};var r=n.require("$4","notices.js").clear();return h.ajax(f)}var b={},g,a=d.ajaxurl||"/wp-admin/admin-ajax.php",c=d.encodeURIComponent;f.init=function(a){b=a.nonces||b;return f};f.localise=function(a){g=a;return f};f.submit=function(a,c,b){function d(){g.removeClass("loading");n.require("$17","forms.js").enable(g)}var g=h(a),f=g.serialize();
92
+ g.addClass("loading");n.require("$17","forms.js").disable(g);return l(a.route.value,function(a,b,e){d();c&&c(a,b,e)},function(a,c,e){d();b&&b(a,c,e)},{type:a.method,data:f})};f.post=function(a,g,f,q){var m;(m=b[a])||(d.console&&console.debug&&console.debug('No nonce for "'+a+'"'),m="");m="action=loco_json&route="+c(a)+"&loco-nonce="+c(m);(g=g?h.param(g):"")&&(m+="&"+g);return l(a,f,q,{type:"post",data:m})};f.setNonce=function(a,c){b[a]=c;return f};return f}({},p,w));n.register("$18",{arab:1,aran:1,
93
+ hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});n.register("$6",function(f,d,h){function l(){}var b,g,a=n.require("$18","rtl.json");f.init=function(){return new l};f.cast=function(a){return a instanceof l?a:"string"===typeof a?f.parse(a):f.clone(a)};f.clone=function(a){var b,g=new l;for(b in a)g[b]=a[b];return g};f.parse=function(a){b||
94
+ (g=/[-_+]/,b=/^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?(?:-([0-9][a-z0-9]{3,8}|[a-z0-9]{5,8}))?(?:-([a-z]-[-a-z]+))?$/i);a=String(a).split(g).join("-");if(!b.exec(a))return null;var e=new l;e.lang=RegExp.$1.toLowerCase();if(a=RegExp.$2)e.script=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();if(a=RegExp.$3)e.region=a.toUpperCase();if(a=RegExp.$4)e.variant=a.toLowerCase();if(a=RegExp.$5)e.extension=a;return e};d=l.prototype;d.isValid=function(){return!!this.lang};d.isKnown=function(){var a=
95
+ this.lang;return!(!a||"zxx"===a)};d.toString=function(a){a=a||"-";var b,g=this.lang||"zxx";if(b=this.script)g+=a+b;if(b=this.region)g+=a+b;if(b=this.variant)g+=a+b;if(b=this.extension)g+=a+b;return g};d.getIcon=function(){for(var a=4,b,g,d=["variant","region","script","lang"],f=[];0!==a--;)if(b=d[a],g=this[b])1===a&&3===g.length?f.push("region-m49"):f=f.concat([b,b+"-"+g.toLowerCase()]);return f.join(" ")};d.isRTL=function(){return!!a[String(this.script||this.lang).toLowerCase()]};d=null;return f}({},
96
+ p,w));n.register("$32",function(f,d,h){function l(a){d.console&&console.error&&console.error(a)}function b(){l("Method not implemented")}function g(){}function a(a){}g.prototype.toString=function(){return"[Undefined]"};a.prototype._validate=function(a){var e,d,f=!0;for(e in this)d=this[e],d===b?(l(a+"."+e+"() must be implemented"),f=!1):d instanceof g&&(l(a+"."+e+" must be defined"),f=!1);return f};f.init=function(c,e){var d,f=new a;if(c)for(d=c.length;0!==d--;)f[c[d]]=b;if(e)for(d=e.length;0!==d--;)f[e[d]]=
97
+ new g;return f};f.validate=function(a){var b=/function (\w+)\(/.exec(a.toString())?RegExp.$1:"";a.prototype._validate(b||"Object")};return f}({},p,w));n.register("$40",function(f,d,h){var l=d.requestAnimationFrame,b=d.cancelAnimationFrame,g=0;if(!l||!b)for(var a in{ms:1,moz:1,webkit:1,o:1})if(l=d[a+"RequestAnimationFrame"])if(b=d[a+"CancelAnimationFrame"]||d[a+"CancelRequestAnimationFrame"])break;l&&b||(l=function(a){var b=c();timeToCall=Math.max(0,16-(b-g));nextTime=b+timeToCall;timerId=d.setTimeout(function(){a(nextTime)},
98
+ timeToCall);g=nextTime;return timerId},b=function(a){clearTimeout(a)});var c=Date.now||function(){return(new Date).getTime()};f.loop=function(a,c){function g(){f=l(g,c);a(d++)}var d=0,f;g();return{stop:function(){f&&b(f);f=null}}};return f}({},p,w));n.register("$37",function(f,d,h){function l(b,c,e,g){if(a){var d=e;e=function(a){if((a.MSPOINTER_TYPE_TOUCH||"touch")===a.pointerType)return d(a)}}b.addEventListener(c,e,g);return{unbind:function(){b.removeEventListener(c,e,g)}}}function b(a){a.preventDefault();
99
+ a.stopPropagation();return!1}var g,a=!!d.navigator.msPointerEnabled,c=a?"MSPointerDown":"touchstart",e=a?"MSPointerMove":"touchmove",k=a?"MSPointerUp":"touchend";f.ok=function(a){null==g&&(g="function"===typeof h.body.addEventListener);g&&a&&a(f);return g};f.ms=function(){return a};f.dragger=function(a,g){function d(b){a.addEventListener(b,v[b],!1)}function f(b){a.removeEventListener(b,v[b],!1)}var v={};v[c]=function(a){y(a,function(b,e){e.type=c;g(a,e,h)});d(e);d(k);return!0};v[k]=function(a){f(e);
100
+ f(k);y(a,function(b,c){c.type=k;g(a,c,h)});return!0};v[e]=function(a){y(a,function(b,c){c.type=e;g(a,c,h)});return b(a)};d(c);var h={kill:function(){f(c);f(e);f(k);a=h=g=null}};return h};f.swiper=function(g,d,f){function s(a){g.addEventListener(a,u[a],!1)}function v(a){g.removeEventListener(a,u[a],!1)}function h(){D&&D.stop();D=null}var D,l,p,u={},z=[],B=[],H=[];u[c]=function(a){l=!1;h();var b=q();y(a,function(a,c){z[a]=b;B[a]=c.clientX;H[a]=c.clientY});p=g.scrollLeft;return!0};u[k]=function(a){y(a,
101
+ function(a,b){var c=q()-z[a],e=B[a]-b.clientX,c=Math.abs(e)/c;d(c,e?0>e?-1:1:0)});p=null;return!0};u[e]=function(a){var c,e;null==p||y(a,function(a,b){c=B[a]-b.clientX;e=H[a]-b.clientY});if(e&&Math.abs(e)>Math.abs(c))return l=!0;c&&(l=!0,g.scrollLeft=Math.max(0,p+c));return b(a)};if(!a||f)s(c),s(e),s(k),a&&(g.className+=" mstouch");return{kill:function(){v(c);v(e);v(k);h()},swiped:function(){return l},ms:function(){return a},snap:function(b){a&&!f&&(g.style["-ms-scroll-snap-points-x"]="snapInterval(0px,"+
102
+ b+"px)",g.style["-ms-scroll-snap-type"]="mandatory",g.style["-ms-scroll-chaining"]="none")},scroll:function(a,b,c){h();var e=g.scrollLeft,d=a>e?1:-1,f=Math[1===d?"min":"max"],s=Math.round(16*b*d);return D=n.require("$40","fps.js").loop(function(b){b&&(e=Math.max(0,f(a,e+s)),g.scrollLeft=e,a===e&&(h(),c&&c(e)))},g)}}};f.start=function(a,b){return l(a,c,b,!1)};f.move=function(a,b){return l(a,e,b,!1)};f.end=function(a,b){return l(a,k,b,!1)};var y=f.each=function(b,c){if(a)(b.MSPOINTER_TYPE_TOUCH||"touch")===
103
+ b.pointerType&&c(0,b);else for(var e=-1,g=(b.originalEvent||b).changedTouches||[];++e<g.length;)c(e,g[e])},q=Date.now||function(){return(new Date).getTime()};return f}({},p,w));n.register("$41",function(f,d,n){f.init=function(d){function b(){e.style.top=String(-d.scrollTop)+"px";return!0}function g(){var b=e;b.textContent=d.value;b.innerHTML=b.innerHTML.replace(/[ \t]/g,a).split(/(?:\r\n|\r|\n)/).join('<span class="eol crlf"></span>\r\n')+'<span class="eol eof"></span>';return!0}function a(a,b){return'<span class="x'+
104
+ a.charCodeAt(0).toString(16)+'">'+a+"</span>"}var c=d.parentNode,e=c.insertBefore(n.createElement("div"),d);h(d).on("input",g).on("scroll",b);h(c).addClass("has-mirror");e.className="ta-mirror";var f=d.offsetWidth-d.clientWidth;2<f&&(e.style.marginRight=String(f-2)+"px");g();b();return{kill:function(){h(d).off("input",g).off("scroll",b);c.removeChild(e);e=null;h(c).removeClass("has-mirror")}}};return f}({},p,w));n.register("$44",function(f,d,h){function l(a,c){for(var e=0,g=-1,f=c&&d[c],h=b[a]||[],
105
+ m=h.length;++g<m;)callback=h[g],"function"===typeof callback&&(callback(f),e++);return e}var b={},g;f.load=function(a,c,e){function g(){m&&(clearTimeout(m),m=null);r&&(r.onreadystatechange=null,r=r=r.onload=null);a&&(delete b[a],a=null)}function f(b,c){var d=r&&r.readyState;if(c||!d||"loaded"===d||"complete"===d)c||l(a,e),g()}function q(){if(0===l(a))throw Error('Failed to load "'+(e||a)+'"');g()}if(e&&d[e])"function"===typeof c&&c(d[e]);else if(null!=b[a])b[a].push(c);else{b[a]=[c];var m=setTimeout(q,
106
+ 4E3),r=h.createElement("script");r.setAttribute("src",a);r.setAttribute("async","true");r.onreadystatechange=f;r.onload=f;r.onerror=q;r.onabort=g;h.getElementsByTagName("head")[0].appendChild(r)}};f.stat=function(a){var b;if(!(b=g)){for(var e,d,f=h.getElementsByTagName("script"),q=-1,m=f.length;++q<m;)if(b=f[q].getAttribute("src"))if(e=b.indexOf("/static/"),-1!==e){d=b.substr(0,e+7);break}b=g=d||"/static"}return b+a};return f}({},p,w));n.register("$42",function(f,d,p){function l(a,b){a.setReadOnly(!1);
107
+ a.on("change",function(a,c){return b.val(c.getValue())});a.on("focus",function(a,c){return b.focus()});a.on("blur",function(a,c){return b.blur()})}function b(a){a.off("change");a.off("focus");a.off("blur")}function g(a){b(a);a.setReadOnly(!0);a.setHighlightGutterLine(!1);a.setHighlightActiveLine(!1)}function a(a){function b(){this.$rules={start:[{token:"empty_line",regex:"^$"},{token:"constant.language",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"printf",regex:"%(?:\\d+\\$)?[-+]?(?:'.)?[ 0]*-?\\d*(?:\\.d+)?[bcdeEfFgGosuxX%]"},
108
+ {token:"printf",regex:"%(?:\\d+\\$)?[-,'+#0 (]*\\d*(?:\\.\\d+|\\.\\*)?[sScCuidoxXfFeEgGaAbBpn%@]"},{defaultToken:"text"}]}}function g(){this.HighlightRules=b}a=a.require;var d=a("ace/lib/oop");d.inherits(b,a("ace/mode/text_highlight_rules").TextHighlightRules);d.inherits(g,a("ace/mode/text").Mode);return new g}f.init=function(c,e){var d,f=!1,q=c.parentNode,m=q.appendChild(p.createElement("div"));n.require("$44","remote.js").load("https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js",function(b){if(m){if(!b)throw Error("Failed to load code editor");
109
+ d=b.edit(m);var t=d.session,s=d.renderer;d.$blockScrolling=Infinity;d.setShowInvisibles(f);d.setWrapBehavioursEnabled(!1);d.setBehavioursEnabled(!1);d.setHighlightActiveLine(!1);t.setUseSoftTabs(!1);s.setShowGutter(!0);s.setPadding(10);s.setScrollMargin(8);t.setMode(a(b));h(q).addClass("has-proxy has-ace");d.setValue(c.value,-1);t.setUseWrapMode(!0);e?l(d,e):g(d)}},"ace");return{kill:function(){d&&(b(d),d.destroy(),d=null);m&&(q.removeChild(m),h(q).removeClass("has-proxy has-ace"),m=null);return this},
110
+ disable:function(){d&&g(d);e=null;return this},enable:function(a){e=a;d&&l(d,a);return this},resize:function(){d&&d.resize();return this},val:function(a){d&&d.setValue(a,-1);return this},invs:function(a){a=a||!1;f!==a&&(f=a,d&&d.setShowInvisibles(a));return this}}};return f}({},p,w));n.register("$43",function(f,d,p){function l(b,a){b.on("change",function(c){return a.val(b.getContent())});b.on("focus",function(b){return a.focus()});b.on("blur",function(b){return a.blur()});b.setMode("design")}function b(b){b.off("change");
111
+ b.off("focus");b.off("blur")}f.load=function(b){var a=n.require("$44","remote.js");a.load(a.stat("/lib/tinymce/tinymce.min.js"),b,"tinymce");return f};f.init=function(d,a){function c(c){e=c;a?l(c,a):(b(c),c.setMode("readonly"))}var e,k=d.parentNode,y=k.appendChild(p.createElement("div"));h(k).addClass("has-proxy has-mce");y.innerHTML=d.value;f.load(function(a){if(!a)throw Error("Failed to load HTML editor");y&&a.init({inline:!0,target:y,hidden_input:!1,theme:"modern",skin:"loco",plugins:"link",browser_spellcheck:!0,
112
+ toolbar:"formatselect | bold italic link unlink | bullist numlist outdent indent",block_formats:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h4;Heading 4=h4;Heading 5=h5;Heading 6=h6;",forced_root_block:"p",relative_urls:!1,convert_urls:!1,remove_script_host:!1,document_base_url:"",allow_script_urls:!1,formats:{alignleft:{classes:"alignleft"},alignright:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"alignright"},aligncenter:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"aligncenter"},
113
+ strikethrough:{inline:"del"}},fix_list_elements:!0,entities:"38,amp,60,lt,62,gt",entity_encoding:"raw",keep_styles:!1,setup:c})},"tinymce");return{val:function(a){e&&e.setContent(a);return this},kill:function(){e&&(e.destroy(),b(e),e=null);y&&(k.removeChild(y),h(k).removeClass("has-proxy has-mce"),y=null);return this},enable:function(b){a=b;e.setMode("design");l(e,b);return this},disable:function(){if(e){var c=e;b(c);c.setMode("readonly")}a=null;return this}}};return f}({},p,w));n.register("$38",
114
+ function(f,d,p){function l(a){function b(){q&&m.off("input",e);q=!1;return!0}function e(){var b=a.value;b!==t&&(m.trigger("changing",[b,t]),t=b)}function d(){g=a;s=t;q||m.on("input",e);q=!0;m.trigger("editFocus");r.addClass("has-focus");return!0}function f(){g===a&&(g=null);m.trigger("editBlur");r.removeClass("has-focus");b();e();s!==t&&m.trigger("changed",[t]);return!0}var q=!1,m=h(a),r=h(a.parentNode),t=a.value,s;m.blur(f).focus(d);return{val:function(b){t!==b&&(a.value=b,m.triggerHandler("input"),
115
+ t=b);return!0},kill:function(){b();m.off("blur",f).off("focus",d)},fire:function(){t=null;e()},ping:e,blur:f,focus:d}}function b(a){this.e=a}var g;f.init=function(a){var c=new b(a);a.disabled?c.disable():c.enable();return c};TextAreaPrototype=b.prototype;TextAreaPrototype.destroy=function(){this.unlisten();this.e=null};TextAreaPrototype.reload=function(a,b){b?this.l||this.enable():this.l&&this.disable();return this.val(a||"")};TextAreaPrototype.val=function(a){var b=this.e;if(null==a)return b.value;
116
+ var e=this.p||this.l;e?e.val(a):b.value!==a&&(b.value=a,h(b).triggerHandler("input"));return this};TextAreaPrototype.fire=function(){this.l&&this.l.fire();return this};TextAreaPrototype.focus=function(){return h(this.e).focus()};TextAreaPrototype.focused=function(){return g&&g===this.el};TextAreaPrototype.parent=function(){return this.e.parentNode};TextAreaPrototype.attr=function(a,b){var e=this.e;if(1===arguments.length)return e.getAttribute(a);null==b?e.removeAttribute(a):e.setAttribute(a,b);return this};
117
+ TextAreaPrototype.editable=function(){return!!this.l};TextAreaPrototype.enable=function(){var a=this.p;this.e.removeAttribute("disabled");this.listen();a&&a.enable&&a.enable(this.l);return this};TextAreaPrototype.disable=function(){var a=this.p;this.e.setAttribute("disabled",!0);this.unlisten();a&&a.disable&&a.disable();return this};TextAreaPrototype.listen=function(){var a=this.l;a&&a.kill();this.l=l(this.e);return this};TextAreaPrototype.unlisten=function(){this.l&&this.l.kill();this.l=null;return this};
118
+ TextAreaPrototype.setInvs=function(a,b){var e=this.i||!1;if(b||e!==a)this._i&&(this._i.kill(),delete this._i),(e=this.p)?e.invs&&e.invs(a):a&&(this._i=n.require("$41","mirror.js").init(this.e)),this.i=a;return this};TextAreaPrototype.getInvs=function(){return this.i||!1};TextAreaPrototype.setMode=function(a){var b=this.p;a!==(this.m||"")&&(this.m=a,b&&b.kill(),this.p=b="code"===a?n.require("$42","ace.js").init(this.e,this.l):"html"===a?n.require("$43","mce.js").init(this.e,this.l):null,this.setInvs(this.i,
119
+ !0));return this};TextAreaPrototype.redraw=function(a){var b=this.p;b&&b.resize&&!a&&b.resize()};TextAreaPrototype=null;return f}({},p,w));n.register("$39",function(f,d,n){function l(a){var b=d.console;b&&b.error&&b.error(a)}function b(a){var b=n.createElement("div");a&&b.setAttribute("class",a);return b}function g(a){return function(){a.resize();return this}}function a(a){return function(b){var c=b.target.$r;if(null==c)return!0;a.select(c);b.stopPropagation();b.preventDefault();return!1}}function c(a){return function(){a.redrawDirty()&&
120
+ a.redraw();return!0}}function e(a){return function(b){var c;c=b.keyCode;if(40===c)c=1;else if(38===c)c=-1;else return!0;if(b.shiftKey||b.ctrlKey||b.metaKey||b.altKey)return!0;a.selectNext(c);b.stopPropagation();b.preventDefault();return!1}}function k(a){this.w=a}function y(a,b,c){var e=n.createElement("div");e.className=c||"";this._=e;this.d=b;this.i=a;this.length=b.length}function q(a){this.live=a;this.rows=[]}f.create=function(a){return new k(a)};var m=k.prototype;m.init=function(d){var f=this.w,
121
+ s=f.id,k=f.splity(s+"-thead",s+"-tbody"),m=k[0],k=k[1],q=[],l=[];m.css.push("wg-thead");k.css.push("wg-tbody");d.eachCol(function(a,b){q.push(s+"-col"+a);l.push(b)});for(var n=b(),u=-1,z=q.length,B=b("wg-cols"),H=m.splitx.apply(m,q);++u<z;)H[u].header(l[u]),B.appendChild(n.cloneNode(!1));var F=[];d.eachRow(function(a,b,c){F[a]=new y(a,b,c)});d=k.body;this.rows=F;this.cols=B;this.root=d;m.redraw=g(this);m=k.fixed=H[0].bodyY()||20;f.lock().resize(m,k);f.css.push("is-table");f.restyle();this.redrawDirty();
122
+ this.render();h(d).attr("tabindex","-1").on("keydown",e(this)).on("mousedown",a(this)).on("scroll",c(this));return this};m.clear=function(){for(var a=this.pages||[],b=a.length;0!==b--;)a[b].destroy();this.pages=[];this.sy=this.mx=this.mn=this.vh=null;void 0;return this};m.render=function(){for(var a,b,c=[],e=-1,d=this.rows||[],g=this.f,f=g?!0:!1,k=f?g.length:d.length,h=this.r,z=this._r,m=this.root,y=this.cols;++e<k;)0===e%100&&(b=y.cloneNode(!0),b=new q(b),b.h=2200,b.insert(m),c.push(b)),a=f?g[e]:
123
+ e,a=d[a],a.page=b,b.rows.push(a);b&&100!==b.size()&&b.sleepH(22);this.pages=c;this.mx=this.mn=null;this.redrawDirty();this.redraw();null==h?null!=z&&(a=d[z])&&a.page&&(delete this._r,this.select(z,!0)):(a=d[h])&&a.page?this.select(h,!0):(this.deselect(),this._r=h);return this};m.resize=function(){var a=-1,b=this.ww||(this.ww=[]),c=this.w,e=c.cells[0],d=e.body.childNodes,g=d.length,f=this.pages||[],k=f.length;for(c.redraw.call(e);++a<g;)b[a]=d[a].style.width;if(k){c=this.mx;for(a=this.mn;a<=c;a++)f[a].widths(b);
124
+ this.redrawDirty()&&this.redraw()}};m.redrawDirty=function(){var a=!1,b=this.root,c=b.scrollTop,b=b.clientHeight;this.sy!==c&&(a=!0,this.sy=c);this.vh!==b&&(a=!0,this.vh=b);return a};m.redraw=function(){for(var a=0,b=-1,c=null,e=null,d=this.ww,g=this.sy,f=this.vh,k=this.mn,h=this.mx,z=Math.max(0,g-100),g=f+g+100,m=this.pages||[],q=m.length;++b<q&&!(a>g);)f=m[b],a+=f.height(),a<z||(null===c&&(c=b),e=b,f.rendered||f.render(d));if(k!==c){if(null!==k&&c>k)for(b=k;b<c;b++){f=m[b];if(!f)throw Error("Shit!");
125
+ f.rendered&&f.sleep()}this.mn=c}if(h!==e){if(null!==h&&e<h)for(b=h;b>e;b--)f=m[b],f.rendered&&f.sleep();this.mx=e}};m.selected=function(){return this.r};m.thead=function(){return this.w.cells[0]};m.tbody=function(){return this.w.cells[1]};m.tr=function(a){return(a=this.rows[a])?a.cells():[]};m.td=function(a,b){return this.tr(a)[b]};m.next=function(a,b,c){null==c&&(c=this.r);for(var e,d=this.rows,g=c,f=d.length;c!==(g+=a);)if(0<=g&&f>g){if(e=d[g],e.page)break}else if(b&&f)g=1===a?-1:f,b=!1;else{g=
126
+ null;break}return g};m.selectNext=function(a,b,c){a=this.next(a,b);null!=a&&this.r!==a&&this.select(a,c);return this};m.deselect=function(a){var b=this.r;null!=b&&(this.r=null,h(this.tr(b)).removeClass("selected"),this.w.fire("wgRowDeselect",[b,a]));return this};m.select=function(a,b){var c=this.rows[a],e=c&&c.page;if(!e)return this.deselect(!1),l("Row is filtered out"),this;this.deselect(!0);var d,g=this.w.cells[1];e.rendered||(d=e.top(),g.scrollY(d),this.redrawDirty()&&this.redraw());if(!c.rendered)return e.rendered||
127
+ l("Failed to render page"),l("Row ["+a+"] not rendered"),this;e=c.cells();h(e).addClass("selected");this.r=a;b||(d=g.scrollY(),h(this.root).focus(),d!==g.scrollY()&&g.scrollY(d));g.scrollTo(e[0],!0);this.w.fire("wgRowSelect",[a,c.data()]);return this};m.unfilter=function(){this.f&&(this.f=null,this.clear().render());return this};m.filter=function(a){this.f=a;return this.clear().render()};m=null;m=y.prototype;m.render=function(a){var b,c=[],e=this._,d=this.d,g=this.length,f=this.i;if(e){for(;0!==g--;)c[g]=
128
+ b=e.cloneNode(!1),b.textContent=d[g]||"\u00a0",b.$r=f,a[g].appendChild(b);this._=null;this.c=c}else for(c=this.c;0!==g--;)a[g].appendChild(c[g]);this.rendered=!0;return this};m.cells=function(){return this.c||[]};m.data=function(){return this.d||[]};m.destroy=function(){this.page=null;this.rendered=!1};m=null;m=q.prototype;m.size=function(){return this.rows.length};m.insert=function(a){var c=this.h,e=b("wg-dead");e.style.height=String(c)+"px";a.appendChild(e);return this.dead=e};m.top=function(){return(this.rendered?
129
+ this.live:this.dead).offsetTop};m.height=function(){var a=this.h;null==a&&(this.h=a=this.rendered?this.live.firstChild.offsetHeight:this.dead.offsetHight);a||l("row has zero height");return a};m.render=function(a){for(var b,c=-1,e=this.rows,d=e.length,g=this.dead,f=this.live,k=f.childNodes;++c<d;)b=e[c],b.rendered||b.render(k);d=a.length;for(c=0;c<d;c++)k[c].style.width=a[c];g.parentNode.replaceChild(f,g);this.rendered=!0;this.h=null;return this};m.sleep=function(){var a=this.height(),b=this.live,
130
+ c=this.dead;c.style.height=String(a)+"px";b.parentNode.replaceChild(c,b);this.rendered=!1;this.h=a;return this};m.sleepH=function(a){a*=this.rows.length;var b=this.dead;b&&(b.style.height=String(a)+"px");this.rendered||(this.h=a);return this};m.widths=function(a){for(var b=this.live.childNodes,c=a.length;0!==c--;)b[c].style.width=a[c];return this};m.destroy=function(){var a=this.rendered?this.live:this.dead,b=this.rows,c=b.length;for(a.parentNode.removeChild(a);0!==c--;)b[c].destroy()};m=null;return f}({},
131
+ p,w));n.register("$33",function(f,d,p){function l(a,b){var d=a.id,g=d&&r[d],f=g&&g.parent();if(!g||!f)return null;var k=f.dir===m,d=k?"X":"Y",h="page"+d,k=k?c:e,z=k(f.el),d=b["offset"+d],q=f.el,y=q.className;null==d&&(d=b[h]-k(a));d&&(z+=d);q.className=y+" is-resizing";return{done:function(){q.className=y},move:function(a){f.resize(a[h]-z,g);return!0}}}function b(b,c){function e(){h(p).off("mousemove",d);t&&(t.done(),t=null);return!0}function d(a){t?t.move(a):e();return!0}if(t)return!0;t=l(b.target,
132
+ b);if(!t)return!0;h(p).one("mouseup",e).on("mousemove",d);return a(b)}function g(a,b){var c=b.type;"touchmove"===c?t&&t.move(b):"touchstart"===c?t=l(a.target,b):"touchend"===c&&t&&(t.done(),t=null)}function a(a){a.stopPropagation();a.preventDefault();return!1}function c(a,b){b||(b=p.body);for(var c=a.offsetLeft||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetLeft||0;return c}function e(a,b){b||(b=p.body);for(var c=a.offsetTop||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetTop||0;return c}function k(a,b){var c=
133
+ h(b).on("editFocus",function(b){c.trigger("wgFocus",[a])}).on("editBlur",function(a){c.trigger("wgBlur")})}function y(a){var b=this.id=a.id;this.el=a;this.pos=this.index=0;this.css=["wg-cell"];r[b]=this;this.clear()}var q=n.require("$16","html.js"),m=1,r={},t=!1;f.init=function(a){var c=new y(a);c.css.push("wg-root");c.redraw();n.require("$37","touch.js").ok(function(b){b.dragger(a,g)});h(a).mousedown(b);return c};d=y.prototype;d.fire=function(a,b){var c=h.Event(a);c.cell=this;h(this.el).trigger(c,
134
+ b);return this};d.each=function(a){for(var b=-1,c=this.cells,e=c.length;++b<e;)a(c[b],b);return this};d.on=function(){return this.$("on",arguments)};d.off=function(){return this.$("off",arguments)};d.find=function(a){return h(this.el).find(a)};d.$=function(a,b){h.fn[a].apply(h(this.el),b);return this};d.parent=function(){return this.pid&&r[this.pid]};d.splitx=function(){return this._split(m,arguments)};d.splity=function(){return this._split(2,arguments)};d._split=function(a,b){(this.length||this.field)&&
135
+ this.clear();for(var c=-1,e,d=b.length,g=1/d,f=0;++c<d;){e=q.el();this.body.appendChild(e);for(var k=e,h=b[c],m=h,l=1;r[h];)h=m+"-"+ ++l;k.id=h;e=new y(e);e.index=c;e.pid=this.id;e.pos=f;f+=g;this.cells.push(e);this.length++}this.dir=a;this.redraw();return this.cells};d.destroy=function(){this.clear();delete r[this.id];var a=this.el;a.innerHTML="";h(a).off();return this};d.exists=function(){return this===r[this.id]};d.clear=function(){for(var a=this.el,b=this.cells,c=this.field,e=this.body,d=this.nav,
136
+ g=this.length||0;0!==g--;)delete r[b[g].destroy().id];this.cells=[];this.length=0;d&&(a.removeChild(d),this.nav=null);e&&(c&&(q.ie()&&h(e).triggerHandler("blur"),c.destroy(),this.field=null),this.table&&(this.table=null),a.removeChild(e));this.body=a.appendChild(q.el("","wg-body"));return this};d.resize=function(a,b){if(!b&&(b=this.cells[1],!b))return;var c=b.index,e=this.cells;this.parent();var d=h(this.el)[this.dir===m?"width":"height"](),g=e[c+1],c=e[c-1];pad=(b.body||b.el.firstChild).offsetTop||
137
+ 0;max=(g?g.pos*d:d)-pad;min=c?c.pos*d:0;b.pos=Math.min(max,Math.max(min,a))/d;this.redraw();return this};d.distribute=function(a){for(var b,c=0,e=this.cells,d=a.length;c<d;)b=a[c],e[++c].pos=Math.max(0,Math.min(1,b));this.redraw();return this};d.distribution=function(){for(var a=[],b=0,c=this.cells,e=c.length-1;b<e;)a[b]=c[++b].pos;return a};d.restyle=function(){var a=this.css.concat();0===this.index?a.push("first"):a.push("not-first");this.dir&&(a.push("wg-split"),2===this.dir?a.push("wg-split-y"):
138
+ a.push("wg-split-x"));this.t&&a.push("has-title");this.nav&&a.push("has-nav");this.field&&(a.push("is-field"),this.field.editable()?a.push("is-editable"):a.push("is-readonly"));a=a.join(" ");a!==this._css&&(this._css=this.el.className=a);return this};d.redraw=function(a){this.restyle();var b=this.el,c=this.body,e=this.field;if(c){var d=b.clientHeight||0,g=c.offsetTop||0;g<d&&(d-=g);c.style.height=String(d)+"px";e&&e.redraw(a)}for(var c=this.length,g=1,f=this.nav,k=2===this.dir?"height":"width";0!==
139
+ c--;)e=this.cells[c],f?d=1:(e.fixed&&(e.pos=e.fixed/h(b)[k]()),d=g-e.pos,g=e.pos),e.el.style[k]=String(100*d)+"%",e.redraw(a);return this};d.contents=function(a){var b=this.el,c=this.body;if(null==a)return c.innerHTML;this.length?this.clear():c&&(b.removeChild(c),c=null);c||(this.body=c=b.appendChild(q.el("","wg-content")),(b=this.lang)&&this._locale(b,this.rtl,!0));"string"===typeof a?h(c)._html(a):a&&this.append(a);this.redraw();return this};d.textarea=function(a,b){var c=this.field;if(c){var e=
140
+ c.editable();c.reload(a,b);e!==b&&this.restyle()}else this.length&&this.clear(),e=q.el("textarea","wg-field"),e.setAttribute("wrap","virtual"),e.disabled=!b,e.value=a,e.name=this.id,this.contents(e),c=n.require("$38","field.js").init(e),k(this,e),this.field=c,this.restyle();this.lang||this.locale("en");return c};d.locale=function(a){a=n.require("$6","locale.js").cast(a);return this._locale(String(a),a.isRTL())};d._locale=function(a,b,c){var e=this.body;if(c||a!==this.lang)this.lang=a,e&&e.setAttribute("lang",
141
+ a);if(c||b!==this.rtl)this.rtl=b,e&&e.setAttribute("dir",b?"RTL":"LTR");return this};d.editable=function(){var a=this.field;if(!a||!a.editable())for(var b=-1,c=this.length;++b<c&&!(a=this.cells[b].editable()););return a};d.eachTextarea=function(a){var b=this.field;b?a(b):this.each(function(b){b.eachTextarea(a)});return this};d.append=function(a){a&&(a.nodeType?q.init(this.body.appendChild(a)):q.init(h(a).appendTo(this.body)));return this};d.prepend=function(a){var b=this.body;if(a.nodeType){var c=
142
+ b.firstChild;q.init(c?b.insertBefore(a,c):b.appendChild(a))}else q.init(h(a).prependTo(b));return this};d.header=function(a,b){if(null==a&&null==b)return this.el.getElementsByTagName("h2")[0];var c=["wg-title"];b&&c.push(b);this.t=q.txt(a||"");this.el.insertBefore(q.el("h2",c.join(" ")),this.body).appendChild(this.t);this.redraw();return this};d.title=function(a){var b=this.t;if(b)return b.nodeValue=a||"",b;this.header(a);return this.t};d.titled=function(){var a=this.t;return a&&a.nodeValue};d.bodyY=
143
+ function(){return e(this.body,this.el)};d.scrollY=function(a){if(U===a)return this.body.scrollTop;this.body.scrollTop=a};d.tabulate=function(a){return this.table=n.require("$39","wgtable.js").create(this).init(a)};d.lock=function(){this.body.className+=" locked";return this};d.scrollTo=function(a,b){var c,d=this.body;c=d.scrollTop;var g=e(a,d);if(c>g)c=g;else{var f=d.clientHeight,g=g+h(a).outerHeight();if(f+c<g)c=g-f;else return}b?d.scrollTop=c:h(d).stop(!0).animate({scrollTop:c},250)};d.navigize=
144
+ function(b,c){function e(a){var b=g[a],c=z[a],d=h(b.el).show();c.addClass("active");k=a;m.data("idx",a);b.fire("wgTabSelect",[a]);return d}var d=this,g=d.cells,f=d.nav,k,z=[];f&&d.el.removeChild(f);var f=d.nav=d.el.insertBefore(q.el("nav","wg-tabs"),d.body),m=h(f).on("click",function(b){var c=h(b.target).data("idx");if(null==c)return!0;if(null!=k){var f=z[k];h(g[k].el).hide();f.removeClass("active")}e(c);d.redraw();return a(b)});null==c&&(c=m.data("idx")||0);d.each(function(a,c){z[c]=h('<a href="#'+
145
+ a.id+'"></a>').data("idx",c).text(b[c]).appendTo(m);a.pos=0;h(a.el).hide()});e(g[c]?c:0);d.lock();d.redraw();return d};d.navigated=function(){var a=this.nav;if(a)return h(a).data("idx")};d=null;return f}({},p,w));n.register("$24",function(f,d,h){function l(b){this.reIndex([]);if(b)for(var d in b)this.add(d,b[d])}f.init=function(b){return new l(b)};d=l.prototype;d.reIndex=function(b){for(var d={},a=-1,c=b.length;++a<c;)d[b[a]]=a;this.keys=b;this.length=a;this.ords=d};d.key=function(b,d){if(null==d)return this.keys[b];
146
+ var a=this.keys[b],c=this.ords[d];if(d!==a){if(null!=c)throw Error("Clash with item at ["+c+"]");this.keys[b]=d;delete this.ords[a];this.ords[d]=b}return b};d.indexOf=function(b){b=this.ords[b];return null==b?-1:b};d.add=function(b,d){var a=this.ords[b];null==a&&(this.keys[this.length]=b,a=this.ords[b]=this.length++);this[a]=d;return a};d.get=function(b){return this[this.ords[b]]};d.has=function(b){return null!=this.ords[b]};d.del=function(b){this.cut(this.ords[b],1)};d.cut=function(b,d){d=d||1;var a=
147
+ [].splice.call(this,b,d);this.keys.splice(b,d);this.reIndex(this.keys);return a};d.each=function(b){for(var d=-1,a=this.keys,c=this.length;++d<c;)b(a[d],this[d],d);return this};d.sort=function(b){for(var d=-1,a=this.length,c,e=this.keys,f=this.ords,h=[];++d<a;)h[d]=[this[d],e[d]];h.sort(function(a,c){return b(a[0],c[0])});for(d=0;d<a;d++)c=h[d],this[d]=c[0],c=c[1],e[d]=c,f[c]=d;return this};d=null;return f}({},p,w));n.register("$23",function(f,d,p){function l(a){var b=[];a&&(a.saved()||b.push("po-unsaved"),
148
+ a.fuzzy()?b.push("po-fuzzy"):a.flagged()&&(b.push("po-flagged"),b.push("po-flag-"+a.flags().join(" po-flag-"))),a.translation()||b.push("po-empty"),a.comment()&&b.push("po-comment"));return b.join(" ")}function b(a,b,c){b=h(a.title(b).parentNode);var e=b.find("span.lang");c?(c=n.require("$6","locale.js").cast(c),e.length||(e=h("<span></span>").prependTo(b)),e.attr("lang",c.lang).attr("class",c.getIcon()||"lang region region-"+(c.region||"zz").toLowerCase())):(e.remove(),c="en");a.locale(c);return b}
149
+ function g(){this.dirty=0}var a="poUpdate",c="changing",e="changed",k=0,y=1,q=2,m=3,r=4,t=5,s=/^[ \t\n\r]/,v,A,w=n.require("$3","string.js").sprintf,E=n.require("$16","html.js");f.extend=function(a){return a.prototype=new g};f.localise=function(a){A=a;return f};var C=function(){var a=p.createElement("p");return function(b){a.innerHTML=b;return a.textContent}}(),u=g.prototype=n.require("$32","abstract.js").init(["getListColumns","getListHeadings","getListEntry"],["editable","t"]);u.init=function(){this.localise();
150
+ this.editable={source:!0,target:!0};this.ide=this._ide="";return this};u.localise=function(a){a||(a=A||n.require("$1","t.js").init());var b=[];b[k]=a._x("Source text","Editor")+":";b[m]=a._x("%s translation","Editor")+":";b[r]=a._x("Context","Editor")+":";b[t]=a._x("Comments","Editor")+":";b[y]=a._x("Single","Editor")+":";b[q]=a._x("Plural","Editor")+":";this.labels=b;this.t=a;return this};u.setRootCell=function(a){function b(a){c.redraw(!0,a);return!0}var c=n.require("$33","wingrid.js").init(a);
151
+ h(d).on("resize",b);this.redraw=b;h(a).on("wgFocus wgBlur",function(a,b){v=b});this.destroy=function(){c.destroy();h(d).off("resize",b)};this.rootDiv=a;return c};g.prototype.$=function(){return h(this.rootDiv)};u.on=function(a,b){return h(this.rootDiv).on(a,b)};u.setListCell=function(a){var b=this;b.listCell=a;a.on("wgRowSelect",function(a,c){b.loadMessage(b.po.row(c));return!0}).on("wgRowDeselect",function(a,c,e){e||b.loadNothing();return!0})};u.setSourceCell=function(a){this.sourceCell=a;var b=
152
+ a.find("p.notes");b.length||(b=h('<p class="notes"></p>').insertAfter(a.header()).hide());this.notesPara=b};u.setTargetCell=function(a){this.targetCell=a};u.next=function(a,b,c){for(var e=this.listTable,d=e.selected(),f=d,g,k=this.po;null!=(d=e.next(a,c,d));){if(f===d){d=null;break}if(b&&(g=k.row(d),g.translated(0)))continue;break}null!=d&&e.select(d,!0);return d};u.current=function(a){var b=this.active;if("undefined"===typeof a)return b;a?a.is(b)?this.pasteMessage(a):this.loadMessage(a):this.unloadActive();
153
+ return this};u.getTargetEditable=function(){return this.editable.target&&this.targetCell&&this.targetCell.editable()};u.getSourceEditable=function(){return this.editable.source&&this.sourceCell&&this.sourceCell.editable()};u.getContextEditable=function(){return this.editable.context&&this.contextCell&&this.contextCell.editable()};u.getFirstEditable=function(){return this.getTargetEditable()||this.getSourceEditable()||this.getContextEditable()};u.searchable=function(a){a&&(this.dict=a,this.po&&this.rebuildSearch());
154
+ return this.dict&&!0};u.rebuildSearch=function(){var a=-1,b=this.po.rows,c=b.length,e=this.dict;for(e.clear();++a<c;)e.add(a,b[a].toText());this.lastSearch="";this.lastFound=c};u.filtered=function(){return this.lastSearch||""};u.filter=function(a,b){var c,e=this.listTable,d=this.lastFound,f=this.lastSearch;if(a){if(f===a)return d||0;if(f&&!d&&0===a.indexOf(f))return 0;c=this.dict.find(a)}f=this.lastSearch=a;d=this.lastFound=c?c.length:this.po.length;c?e.filter(c):e.unfilter();b||this.fire("poFilter",
155
+ [f,d]);return d};u.unsave=function(a,b){var c=!1;if(a=a||self.active){if(c=a.saved(b))this.dirty++,a.unsave(b),this.fire("poUnsaved",[a,b]);this.markUnsaved(a)}return c};u.markUnsaved=function(a){var b=this.po.indexOf(a),b=this.listTable.tr(b),c=b[0].className;changedStyle=c.replace(/(?:^| +)po-[a-z]+/g,"")+" "+l(a);changedStyle!==c&&h(b).attr("class",changedStyle)};u.save=function(a){var b=this.po;if(this.dirty||a)b.each(function(a,b){b.save()}),this.listCell.find("div.po-unsaved").removeClass("po-unsaved"),
156
+ this.dirty=0,this.fire("poSave");return b};u.fire=function(a,b){var c=this.on;if(c&&c[a]&&(c=c[a].apply(this,b||[]),!1===c))return!1;c=h.Event(a);h(this.rootDiv).trigger(c,b);return!c.isDefaultPrevented()};u.reload=function(){var a=this,b,c=a.listCell,e=a.listTable,d=a.po,f=d&&d.locale(),g=f&&f.isRTL(),k=d&&d.length||0;if(d&&d.row)return a.lastSearch&&(a.lastSearch="",a.lastFound=k,a.fire("poFilter",[a.lastSearch,a.lastFound])),e&&(b=e.thead().distribution()),e=a.listTable=c.tabulate({length:k,getRow:function(b){return a.getListEntry(d.row(b))},
157
+ getCss:function(b){return a.getListEntry(d.row(b))},eachCol:function(b){for(var c=-1,e=a.getListHeadings(),d=e.length;++c<d;)b(c,e[c])},eachRow:function(b){var c=0;d.each(function(e,d){b(c++,a.getListEntry(d),l(d))})}}),b&&e.thead().distribute(b),e.tbody().$(g?"addClass":"removeClass",["is-rtl"]),a.targetLocale=f,a.fire("poLoad"),!!d.length;c&&c.clear().header("Error").contents("Invalid messages list")};u.load=function(a,b){this.po=a;this.dict&&this.rebuildSearch();this.reload()&&(-1!==b?this.listTable.select(b||
158
+ 0):this.active&&this.unloadActive())};u.pasteMessage=function(a){var b,c=0;if(b=this.sourceCell)b.eachTextarea(function(b){b.val(a.source(null,c++))}),this.updateListCell(a,"source");(b=this.contextCell)&&b.eachTextarea(function(b){b.val(a.context())});if(b=this.targetCell)c=0,b.eachTextarea(function(b){b.val(a.translation(c++))}),this.updateListCell(a,"target");return this};u.loadMessage=function(d){function f(g){var h,m=g,l=g.id,m=!1;h=L[k];g.off();O&&(R?(R=E.h(R,!0),O.html(R).show(),E.init(O),
159
+ m=!0):O.text()&&(m=!0,O.text("").hide()));g.titled()!==h&&b(g,h,p.sourceLocale||"en");m&&g.clear();S?(h=g.splity(l+"-singular",l+"-plural"),m=h[0],h=h[1],m.header(L[y]).textarea(Y,T).setMode(u).setInvs(A),h.header(L[q]).textarea(S,T).setMode(u).setInvs(A),g.lock()):g.textarea(Y,T).setMode(u).setInvs(A);T&&g.on(c,function(a,b){S&&a.target.name===l+"-plural"?d.plural(b):(d.source(b),p.updateListCell(d,"source"));p.unsave(d,N)}).on(e,function(b){S&&b.target.name===l+"-plural"||p.po.reIndex(d);p.dict&&
160
+ p.rebuildSearch();p.fire(a,[d])})}function g(f,k,h){f.off();var q=k.isKnown()&&k.label||"Target",q=w(L[m],q);f.titled()!==q&&b(f,q,k);if(d.pluralized()){var y=[],l=k.plurals||["One","Other"],r=n.require("$24","collection.js").init();for(d.each(function(a,b,c){if(c||l[a])y.push(l[a]||"Form "+a),r.add("plural-"+a,c)});(q=y.length)<k.nplurals;)y.push(l[q]||"Form "+r.length),r.add("plural-"+q,d.translation(q));children=f.splitx.apply(f,r.keys);f.each(function(a,b){var c=K&&!d.disabled(b);a.textarea(r[b],
161
+ c).setMode(u).setInvs(A)});f.navigize(y,h||null).on("wgTabSelect",function(a,b){var c=K&&a.cell.editable();c&&c.focus();h=b;p.fire("poTab",[b])})}else h=0,K=K&&!d.disabled(0),f.textarea(d.translation(),K).setMode(u).setInvs(A);K&&f.on(c,function(a,b,c){d.translate(b,h);0===h&&p.updateListCell(d,"target");d.fuzzy(h)?p.fuzzy(!1,d,h):p.unsave(d,h);""===b?p.fire("poEmpty",[!0,d,h]):""===c&&p.fire("poEmpty",[!1,d,h])}).on(e,function(b){p.dict&&p.rebuildSearch();p.fire(a,[d])})}function l(f){f.off();b(f,
162
+ L[r]);f.textarea(d.context(),!0).setMode(u).setInvs(A);U&&f.on(c,function(a,b){d.context(b);p.updateListCell(d,"source");p.unsave(d,N)}).on(e,function(){p.po.reIndex(d);p.dict&&p.rebuildSearch();p.fire(a,[d])})}function s(a){var e=L[t];a.titled()!==e&&b(a,e);a.off().on(c,function(a,b){d.comment(b);p.fire("poComment",[d,b]);p.unsave(d,N)}).textarea(d.comment(),!0)}var p=this,u=p.ide||"",A=p.inv||!1,C=this.fmt||null,G=d.format()||null,M=d.is(p.active),N=0,J=p.sourceCell,W=p.targetCell,Q=p.contextCell,
163
+ X=p.commentCell,O=p.notesPara,K=p.editable.target,T=p.editable.source,U=p.editable.context,Y=d.source()||"",S=d.plural()||"",R=d.notes(),P=v,Z=p.targetLocale,L=p.labels;p.active=d;J&&f(J);Q&&l(Q);W&&Z&&(N=W.navigated()||0,g(W,Z,N));X&&s(X);P&&(P.exists()||(P=P.parent()),(J=P.editable())&&J.focus());C!==G&&(J=h(p.rootDiv),G&&J.addClass(G+"-format"),C&&J.removeClass(C+"-format"),this.fmt=G);M||p.fire("poSelected",[d])};u.unloadActive=function(){var a;(a=this.notesPara)&&a.text("").hide();(a=this.sourceCell)&&
164
+ a.off().clear();(a=this.contextCell)&&a.off().clear();(a=this.targetCell)&&a.off().clear();(a=this.commentCell)&&a.off();this.active&&(this.fire("poDeselected",[this.active]),this.active=null);return this};u.loadNothing=function(){var a,b=this.t,c=this.ide||"",e=this.inv||!1;this.unloadActive();(a=this.commentCell)&&a.textarea("",!1);if(a=this.sourceCell)a.textarea("",!1).setMode(c).setInvs(e),a.title(b._x("Source text not loaded","Editor")+":");if(a=this.contextCell)a.textarea("",!1).setMode(c).setInvs(e),
165
+ a.title(b._x("Context not loaded","Editor")+":");if(a=this.targetCell)a.textarea("",!1).setMode(c).setInvs(e),a.title(b._x("Translation not loaded","Editor")+":");this.fire("poSelected",[null])};u.updateListCell=function(a,b){var c=this.getListColumns()[b],e=this.getListEntry(a)[c||0],d=this.po.indexOf(a);if(c=this.listTable.td(d,c))c.textContent=e};u.cellText=function(a){if(-1!==a.indexOf("<")||-1!==a.indexOf("&"))a=C(a);""===a?a="\u00a0":s.test(a)&&(a="\u00a0"+a);return a};u.fuzzy=function(b,c,
166
+ e){if(!c){c=this.active;if(!c)return null;null==e&&(e=this.targetCell&&this.targetCell.navigated()||0)}var d=c.fuzzy(e);null==b||d==b||b&&!c.translated(e)||!this.fire("poFuzzy",[c,b,e])||(c.fuzzy(e,b),this.fire(a,[c])&&this.unsave(c,e));return d};u.add=function(b,c){var e,d=this.po.get(b,c);d?e=this.po.indexOf(d):(e=this.po.length,d=this.po.add(b,c),this.load(this.po,-1),this.fire("poAdd",[d]),this.fire(a,[d]));this.lastSearch&&this.filter("");this.listTable.select(e);return d};u.del=function(b){if(b=
167
+ b||this.active){var c=this.lastSearch,e=this.po.del(b);null!=e&&(this.unsave(b),this.fire("poDel",[b]),this.fire(a,[b]),this.reload(),this.dict&&this.rebuildSearch(),this.active&&this.active.equals(b)&&this.unloadActive(),this.po.length&&(c&&this.filter(c),this.active||(e=Math.min(e,this.po.length-1),this.listTable.select(e))))}};u.setMode=function(a){var b=a?"code":this._ide;this.ide!==b&&(this.ide=b,this.callTextareas(function(a){a.setMode(b)}));return this};u.getMode=function(){return"code"===
168
+ this.ide};u.setInvs=function(a){(this.inv||!1)!==a&&(this.inv=a,this.callTextareas(function(b){b.setInvs(a)}),this.fire("poInvs",[a]));return this};u.getInvs=function(){return this.inv||!1};u.callTextareas=function(a){var b=this.targetCell;b&&b.eachTextarea(a);(b=this.contextCell)&&b.eachTextarea(a);(b=this.sourceCell)&&b.eachTextarea(a);return this};u=null;return f}({},p,w));n.register("$11",function(f,d,h){function l(){this.init()._validate();this.sourceLocale={lang:"en",label:"English",plurals:["One",
169
+ "Other"]}}d=n.require("$23","base.js");f.init=function(b){var d=new l;b=d.setRootCell(b);var a=b.splity("po-list","po-edit"),c=a[0],e=a[1],a=e.splitx("po-trans","po-comment"),f=a[0],h=a[1].header("Loading.."),a=f.splity("po-source","po-target"),f=a[0].header("Loading.."),a=a[1].header("Loading..");b.distribute([0.34]);e.distribute([0.8]);d.setListCell(c);d.setSourceCell(f);d.setTargetCell(a);d.commentCell=h;d.editable.source=!1;return d};d=l.prototype=d.extend(l);d.getListHeadings=function(){var b=
170
+ this.t||{_x:function(b){return b}};return[b._x("Source text","Editor"),b._x("Translation","Editor")]};d.getListColumns=function(){return{source:0,target:1}};d.getListEntry=function(b){if(!b)return["",""];var d=this.cellText,a=[d(b.id||b.source()||""),d(b.translation()||"")];if(b=b.context())a[0]+=" [ "+d(b)+" ]";return a};d.stats=function(){var b=this.po.length,d=0,a=0,c=0;this.po.each(function(b,f){f.translation()?f.fuzzy()?c++:d++:a++});return{t:b,p:String(d?Math.round(100*(d/b)):0)+"%",f:c,u:a}};
171
+ d.unlock=function(){this._unlocked||(this._unlocked=this.targetLocale,delete this.targetLocale,this.po&&this.po.unlock(),this.editable={source:!0,context:!0,target:!1},this.contextCell=this.targetCell,delete this.targetCell,this.fire("poLock",[!1]),this.active&&this.loadMessage(this.active))};d.lock=function(){var b;this._unlocked&&(b=this.targetLocale=this._unlocked,delete this._unlocked,this.po&&this.po.lock(b),this.editable={source:!1,context:!1,target:!0},this.targetCell=this.contextCell,delete this.contextCell,
172
+ this.fire("poLock",[!0,b]),this.active&&this.loadMessage(this.active))};d.locked=function(){return!this._unlocked};return f}({},p,w));n.register("$12",function(f,d,n){var l={copy:66,clear:75,save:83,fuzzy:85,next:40,prev:38,enter:13,invis:73},b={38:!0,40:!0,73:!0},g={66:function(a,b){var e=b.current();e&&(e.normalize(),b.pasteMessage(e))},75:function(a,b){var e=b.current();e&&(e.untranslate(),b.pasteMessage(e))},85:function(a,b){b.fuzzy(!b.fuzzy())},13:function(a,b){b.getFirstEditable()&&b.next(1,
173
+ !0,!0)},40:function(a,b){var e=a.shiftKey;b.next(1,e,e)},38:function(a,b){var e=a.shiftKey;b.next(-1,e,e)},73:function(a,b){if(!a.shiftKey)return!1;b.setInvs(!b.getInvs())}};f.init=function(a,c){function e(c){if(c.isPropagationStopped()||!c.metaKey&&!c.ctrlKey)return!0;var e=c.which;if(!f[e])return!0;var d=g[e];if(!d)throw Error("No such command");if(c.altKey||c.shiftKey&&!b[e]||!1===d(c,a))return!0;c.preventDefault();return!1}var f={};h(c||d).on("keydown",e);return{add:function(a,b){g[l[a]]=b;return this},
174
+ enable:function(){var a,b;for(b in arguments)a=l[arguments[b]],f[a]=!0;return this},disable:function(){h(c||d).off("keydown",e);a=c=f=null}}};return f}({},p,w));n.register("$25",function(f,d,h){function l(b,d){var a=RegExp("^.{0,"+(b-1)+"}["+d+"]"),c=RegExp("^[^"+d+"]+");return function(e,d){for(var f=e.length,g;f>b;){g=a.exec(e)||c.exec(e);if(null==g)break;g=g[0];d.push(g);g=g.length;f-=g;e=e.substr(g)}0!==f&&d.push(e);return d}}f.create=function(b){function d(a){return q[a]||"\\"+a}var a,c,e=/(?:\r\n|[\r\n\v\f\u2028\u2029])/g,
175
+ f=/[ \r\n]+/g,h=/[\t\v\f\x07\x08\\\"]/g,q={"\t":"\\t","\v":"\\v","\f":"\\f","\u0007":"\\a","\b":"\\b"};null==b&&(b=79);0!==b&&(a=l(b-3," "),c=l(b-2,"-\u2013 \\.,:;\\?!\\)\\]\\}\\>"));return{pair:function(a,f){if(!f)return a+' ""';f=f.replace(h,d);var k=0;f=f.replace(e,function(){k++;return"\\n\n"});if(!(k||b&&b<f.length+a.length+3))return a+' "'+f+'"';var q=[a+' "'],l=f.split("\n");if(c)for(var n=-1,p=l.length;++n<p;)c(l[n],q);else q=q.concat(l);return q.join('"\n"')+'"'},prefix:function(a,b){var c=
176
+ a.split(e);return b+c.join("\n"+b)},refs:function(b){b=b.replace(f," ",b);a&&(b=a(b,[]).join("\n#: "));return"#: "+b}}};return f}({},p,w));n.register("$26",function(f,d,h){function l(){}f.extend=function(b){return b.prototype=new l};d=l.prototype=n.require("$32","abstract.js").init(["add","load"]);d.row=function(b){return this.rows[b]};d.lock=function(b){return this.locale(b||{lang:"zxx",label:"Unknown",nplurals:1,pluraleq:"n!=1"})};d.unlock=function(){var b=this.loc;this.loc=null;return b};d.locale=
177
+ function(b){var d=n.require("$6","locale.js");null==b?b=this.loc:this.loc=b=d.cast(b);return b};d.each=function(b){this.rows.each(b);return this};d.indexOf=function(b){"object"!==typeof b&&(b=this.get(b));if(!b)return-1;null==b.idx&&(b.idx=this.rows.indexOf(b.hash()));return b.idx};d.get=function(b){return this.rows&&this.rows.get(b)};d.del=function(b){b=this.indexOf(b);if(-1!==b){var d=this.rows.cut(b,1);if(d&&d.length)return this.length=this.rows.length,this.rows.each(function(a,b,e){b.idx=e}),
178
+ b}};d.reIndex=function(b,d){var a=this.indexOf(b),c=b.hash(),e=this.rows.indexOf(c);return e===a?a:-1!==e?(d=(d||0)+1,b.source("Error, duplicate "+String(d)+": "+b.source()),this.reIndex(b,d)):this.rows.key(a,c)};d=null;return f}({},p,w));n.register("$27",function(f,d,h){function l(){this.id=this._id=this.ref=this.cmt=this.xcmt=""}f.extend=function(b){return b.prototype=new l};d=l.prototype;d.flag=function(b,d){var a=this.flg||(this.flg=[]);if(null!=d)a[d]=b;else for(var c=Math.max(a.length,this.src.length,
179
+ this.msg.length);0!==c--;)a[c]=b;return this};d.flagged=function(b){var d=this.flg||[];if(null!=b)return d[b]||0;for(b=d.length;0!==b--;)if(d[b])return!0;return!1};d.flags=function(){for(var b,d={},a=[],c=this.flg||[],e=c.length;0!==e--;)b=c[e],d[b]||(d[b]=!0,a.push(b));return a};d.flaggedAs=function(b,d){var a=this.flg||[];if(null!=d)return b===a[d]||0;for(var c=a.length;0!==c--;)if(a[c]===b)return!0;return!1};d.fuzzy=function(b,d){var a=this.flaggedAs(4,b);null!=d&&this.flag(d?4:0,b);return a};
180
+ d.source=function(b,d){if(null==b)return this.src[d||0]||"";this.src[d||0]=b;return this};d.plural=function(b,d){if(null==b)return this.src[d||1]||"";this.src[d||1]=b||"";return this};d.each=function(b){for(var d=-1,a=this.src,c=this.msg,e=Math.max(a.length,c.length);++d<e;)b(d,a[d],c[d]);return this};d.pluralized=function(){return 1<this.src.length||1<this.msg.length};d.translate=function(b,d){this.msg[d||0]=b||"";return this};d.untranslate=function(b){null!=b&&(this.msg[b]="");for(b=0;b<this.msg.length;b++)this.msg[b]=
181
+ "";return this};d.translation=function(b){return this.msg[b||0]||""};d.translated=function(b){if(null!=b)return!!this.translation(b);var d=this.msg.length;for(b=0;b<d;b++)if(!this.msg[b])return!1;return!0};d.comment=function(b){if(null==b)return this.cmt;this.cmt=b||"";return this};d.notes=function(b){if(null==b)return this.xcmt;this.xcmt=b||"";return this};d.refs=function(b){if(null==b)return this.ref;this.ref=b||"";return this};d.format=function(b){if(null==b)return this.fmt;this.fmt=b;return this};
182
+ d.context=function(b){if(null==b)return this.ctx||"";this.ctx=b||"";return this};d.toString=d.toText=function(){return this.src.concat(this.msg,[this.id,this.ctx]).join(" ")};d.weight=function(){var b=0;this.translation()||(b+=2);this.fuzzy()&&(b+=1);return b};d.equals=function(b){return this===b||this.hash()===b.hash()};d.hash=function(){return this.id};d.normalize=function(){for(var b=this.msg.length;0!==b--;)this.msg[b]=this.src[b]||""};d.disabled=function(b){return!!(this.lck||[])[b||0]};d.disable=
183
+ function(b){(this.lck||(this.lck=[]))[b||0]=!0;return this};d.saved=function(b){var d=this.drt;if(!d)return!0;if(null!=b)return!d[b];for(b=d.length;0!==b--;)if(d[b])return!1;return!0};d.unsave=function(b){(this.drt||(this.drt=[]))[b||0]=!0;return this};d.save=function(b){var d=this.drt;null==b?this.drt=null:d[b]=!1;return this};d.is=function(b){return b&&(b===this||b.idx===this.idx)};d=null;return f}({},p,w));n.register("$13",function(f,d,h){function l(a){return{"Project-Id-Version":"PACKAGE VERSION",
184
+ "Report-Msgid-Bugs-To":"","POT-Creation-Date":a||"","PO-Revision-Date":a||"","Last-Translator":"","Language-Team":"",Language:"","Plural-Forms":"","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit"}}function b(a,b){var c=a||"";b&&(c+="\x00"+b);return c}function g(){return n.require("$24","collection.js").init()}function a(a){this.locale(a);this.length=0;this.rows=g();this.head=l(this.now())}function c(a,b){this.src=[a||""];this.msg=[b||""]}f.create=
185
+ function(b){return new a(b)};d=n.require("$26","messages.js").extend(a);d.now=function(){function a(b,c){for(var d=String(b);d.length<c;)d="0"+d;return d}var b=new Date,c=b.getUTCFullYear(),d=b.getUTCMonth()+1,f=b.getUTCDate(),g=b.getUTCHours(),b=b.getUTCMinutes();return a(c,4)+"-"+a(d,2)+"-"+a(f,2)+" "+a(g,2)+":"+a(b,2)+"+0000"};d.header=function(a,b){var c=this.head||(this.head={});if(null==b)return this.headers()[a]||"";c[a]=b||"";return this};d.headers=function(a){var b,c=this.now(),d=this.head||
186
+ (this.head=l(c));if(null!=a){for(b in a)d[b]=a[b];return this}var f=this.locale();a={};for(b in d)a[b]=String(d[b]);f?(a.Language=String(f)||"zxx",a["Language-Team"]=f.label||a.Language,a["Plural-Forms"]="nplurals="+(f.nplurals||"2")+"; plural="+(f.pluraleq||"n!=1"),a["PO-Revision-Date"]=c):(a.Language="",a["Plural-Forms"]="nplurals=INTEGER; plural=EXPRESSION",a["POT-Creation-Date"]=c,a["PO-Revision-Date"]="YEAR-MO-DA HO:MI+ZONE");a["X-Generator"]="Loco - https://localise.biz/";return a};d.get=function(a,
187
+ c){var d=b(a,c);return this.rows.get(d)};d.add=function(a,b){a instanceof c||(a=new c(a));b&&a.context(b);var d=a.hash();if(this.rows.get(d))throw Error("Duplicate message at index "+this.indexOf(a));a.idx=this.rows.add(d,a);this.length=this.rows.length;return a};d.load=function(a){for(var b=-1,d,f,g,h,l,n,p=[],A=[],w=[],E=[];++b<a.length;)d=a[b],null==d.parent?(f=d.source||d.id,g=d.target||"",h=d.context,f||h?(l=new c(f,g),l._id=d._id,h&&l.context(h),d.flag&&l.flag(d.flag,0),d.comment&&l.comment(d.comment),
188
+ d.notes&&l.notes(d.notes),d.refs&&l.refs(d.refs),null!==d.format&&l.format(d.format),d.message=l,l.translation()?l.fuzzy()?w.push(l):A.push(l):E.push(l)):0===b&&"object"===typeof g&&(this.head=g)):p.push(d);for(b=-1;++b<p.length;)try{d=p[b];f=d.source||d.id;l=a[d.parent]&&a[d.parent].message;if(!l)throw Error("parent missing for plural "+f);n=d.plural;1===n&&l.plural(f);d.flag&&l.flag(d.flag,n);l.translate(d.target||"",n);d.format&&!l.format()&&l.format(d.format)}catch(C){}return this._add(E,w,A)};
189
+ d._add=function(a,b,c){c=[a,b,c];for(i=0;3>i;i++)for(b=c[i],a=-1;++a<b.length;)try{this.add(b[a])}catch(d){}return this};d.merge=function(a){var b,c=a.header("POT-Creation-Date"),d=this.rows,f=[],h=[],l=[],n=[],p=[];a=a.rows;this.rows.each(function(b,c){null==a.get(b)&&p.push(c)});a.each(function(a,c){try{(b=d.get(a))?(b.ref=c.ref,b.fmt=c.fmt):(b=c,n.push(b)),b.translation()?b.fuzzy()?h.push(b):l.push(b):f.push(b)}catch(e){}});this.rows=g();this._add(f,h,l);c&&this.header("POT-Creation-Date",c);return{add:n,
190
+ del:p}};d.toString=function(){var a,b=[],d=[],f=this.headers(),g=!this.loc,h=n.require("$25","format.js").create(void 0);for(a in f)d.push(a+": "+f[a]);d=new c("",d.join("\n"));g&&d.fuzzy(0,!0);b.push(d.toString());b.push("");this.rows.each(function(a,c){a&&(b.push(c.cat(h,g)),b.push(""))});return b.join("\n")};d=n.require("$27","message.js").extend(c);d.hash=function(){return b(this.source(),this.context())};d.source=function(a,b){if(null==a)return this.src[0];this.src[0]=a;null!=b&&this.plural(b);
191
+ return this};d.toString=function(){return this.cat(n.require("$25","format.js").create(void 0))};d.cat=function(a,b){var c,d=[],f;(f=this.cmt)&&d.push(a.prefix(f,"# "));(f=this.xcmt)&&d.push(a.prefix(f,"#. "));c=this.ref;if(f=this._id)c+=(c?" ":"")+"loco:"+f;c&&/\S/.test(c)&&d.push(a.refs(c));!b&&this.fuzzy()&&d.push("#, fuzzy");(f=this.fmt)?d.push("#, "+f+"-format"):null!=f&&d.push("#, no-c-format");(f=this.ctx)&&d.push(a.pair("msgctxt",f));d.push(a.pair("msgid",this.src[0]));if(null==this.src[1])d.push(a.pair("msgstr",
192
+ b?"":this.msg[0]));else for(c=-1,d.push(a.pair("msgid_plural",this.src[1]));++c<this.msg.length;)d.push(a.pair("msgstr["+c+"]",b?"":this.msg[c]));return d.join("\n")};d.compare=function(a,b){var c=this.weight(),d=a.weight();if(c>d)return 1;if(c<d)return-1;if(b){c=this.hash().toLowerCase();d=a.hash().toLowerCase();if(c<d)return 1;if(c>d)return-1}return 0};d=d=null;return f}({},p,w));n.register("$14",function(f,d,n){f.init=function(f){function b(){B&&B.dialog("close");h(f).find('input[type="submit"]').attr("disabled",
193
+ !1);h(s).addClass("jshide");t&&t(!0)}function g(){h(f).find('input[type="submit"]').attr("disabled",!0);t&&t(!1)}function a(a){var b,c;for(b in p)c=p[b],a[b]?a[b].value=c:h('<input type="hidden" />').attr("name",b).appendTo(a).val(c)}function c(a){a.preventDefault();a=h(a.target).serializeArray();m(a);w=!0;return!1}function e(a){a.preventDefault();B.dialog("close");return!1}function k(a){a.preventDefault();B.dialog("open");return!1}function n(d){p=d.authed&&d.creds;v=d.method;if(p)"direct"!==v&&(a(f),
194
+ w&&d.success&&E.notices.success(d.success)),D=!0,b();else if(D=!1,d.reason)E.notices.info(d.reason);else if(d=d.prompt){var g;B||(h(s).find("button.button-small").click(k),B=h('<div id="loco-fs-creds"></div>').dialog({dialogClass:"request-filesystem-credentials-dialog loco-modal",minWidth:480,modal:!0,autoOpen:!1,closeOnEscape:!0}));g=B;g.html(d).find("form").submit(c);g.dialog("option","title",g.find("h2").remove().text());g.find("button.cancel-button").show().click(e);g.find('input[type="submit"]').addClass("button-primary");
195
+ h(s).removeClass("jshide")}else E.notices.error("Server didn't return credentials, nor a prompt for credentials")}function q(){b()}function m(a){w=!1;a.path=C;a.auth=u;E.ajax.setNonce("fsConnect",z).post("fsConnect",a,n,q);return a}var p,t,s=f,v=null,w=!1,D=!1,E=d.locoScope,C=f.path.value,u=f.auth.value,z=f["loco-nonce"].value,B;f.connection_type?(p={},p.connection_type=f.connection_type.value,D=!0):C&&u&&(g(),m({}));return{applyCreds:function(b){if(b.nodeType)a(b);else{var c,d=p||{};for(c in d)b[c]=
196
+ d[c]}return this},setForm:function(b){f=b;D||g();a(b);return this},connect:function(){var a=h(f).serializeArray();C=a.path;u=a.auth;m(a);return this},listen:function(a){t=a;D&&a(!0);return this}}};return f}({},p,w));n.register("$15",function(f,d,n){function l(a,b){return function(d){a.apply(d,b);return d}}function b(a){return function(b,d){var f=b&&b[a]||0,g=d&&d[a]||0;return f===g?0:f>g?1:-1}}function g(a){return function(b,d){return(b&&b[a]||"").localeCompare(d&&d[a]||"")}}function a(a){return function(b,
197
+ d){return-1*a(b,d)}}f.sort=function(c){var d=[],f=[],n,p=0,m=c.getElementsByTagName("tbody")[0];if((c=c.getElementsByTagName("thead")[0])&&m){var r=0;h("th",c).each(function(c,s){var v=s.getAttribute("data-sort-type");v&&(c=r,h(s).addClass("loco-sort").click(function(r){r.preventDefault();var s=c;r=-1;var v=f[s],w=v.type,u=!(v.desc=!v.desc),z=d,s="n"===w?b(s):g(s);u&&(s=a(s));d=l([].sort,[s])(z);for(h("tr",m).remove();++r<p;)m.appendChild(d[r].$);n&&n.removeClass("loco-desc loco-asc");n=h(v.$).addClass(u?
198
+ "loco-desc":"loco-asc").removeClass(u?"loco-asc":"loco-desc");return!1}),f[r]={$:s,type:v});s.hasAttribute("colspan")?r+=Number(s.getAttribute("colspan")):r++});h("tr",m).each(function(a,b){var c,g,h={_:a,$:b},l=b.getElementsByTagName("td");for(g in f){c=l[g];c=c.hasAttribute("data-sort-value")?c.getAttribute("data-sort-value"):c.textContent.replace(/(^\s+|\s+$)/g,"");switch(f[g].type){case "n":c=Number(c)}h[g]=c}d[a]=h});p=d.length}};return f}({},p,w));var G=p.locoScope||(p.locoScope={});p=p.locoConf||
199
+ (p.locoConf={});w=n.require("$1","t.js").init();var Q=p.wplang;n.require("$2","array.js");G.l10n=w;w.load(p.wpl10n);Q&&w.pluraleq(Q.pluraleq);G.string=n.require("$3","string.js");G.notices=n.require("$4","notices.js").init(w);G.ajax=n.require("$5","ajax.js").init(p).localise(w);G.locale=n.require("$6","locale.js");G.fulltext=n.require("$7","fulltext.js");G.watchtext=n.require("$8","LocoTextListener.js").listen;G.selector=n.require("$9","LocoSelector.js").create;G.autocomp=n.require("$10","LocoAutoComplete.js").init;
200
+ G.po={ed:n.require("$11","poedit.js"),kbd:n.require("$12","hotkeys.js"),init:n.require("$13","po.js").create};G.fs=n.require("$14","fsconn.js");h("#loco.wrap table.wp-list-table").each(function(f,d){n.require("$15","tables.js").sort(d)})})(window,document,window.jQuery);
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Plugin Name ===
2
  Contributors: timwhitlock
3
  Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity
4
- Requires at least: 4.0
5
  Tested up to: 4.6.1
6
- Stable tag: 2.0.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -85,6 +85,11 @@ Help is provided via the [plugin support forum](https://wordpress.org/support/pl
85
 
86
  == Changelog ==
87
 
 
 
 
 
 
88
  = 2.0.8 =
89
  * Source refs fix for files in unknown subsets
90
  * Downgrades PO formatting exceptions to PHP warnings
1
  === Plugin Name ===
2
  Contributors: timwhitlock
3
  Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity
4
+ Requires at least: 4.1
5
  Tested up to: 4.6.1
6
+ Stable tag: 2.0.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
85
 
86
  == Changelog ==
87
 
88
+ = 2.0.9 =
89
+ * Bumped minimum WordPress version to 4.1
90
+ * Some optimisation of transient caching
91
+ * Fixed hash table settings bug
92
+
93
  = 2.0.8 =
94
  * Source refs fix for files in unknown subsets
95
  * Downgrades PO formatting exceptions to PHP warnings
src/admin/bundle/ViewController.php CHANGED
@@ -79,7 +79,7 @@ class Loco_admin_bundle_ViewController extends Loco_admin_bundle_BaseController
79
  // POT template file
80
  $file = $project->getPot();
81
  if( $file && $file->exists() ){
82
- $meta = Loco_gettext_Metadata::load($file)->persist( 0, true );
83
  $p['pot'] = new Loco_mvc_ViewParams( array(
84
  // POT info
85
  'name' => $file->basename(),
@@ -112,7 +112,7 @@ class Loco_admin_bundle_ViewController extends Loco_admin_bundle_BaseController
112
  $pot = $project->getPot();
113
  if( $pot && $pot->exists() ){
114
  $p['pot'] = $pot;
115
- $meta = Loco_gettext_Metadata::load($pot)->persist( 0, true );
116
  $p['nav'][] = new Loco_mvc_ViewParams( array(
117
  'href' => $this->getResourceLink('file-edit', $project, $meta ),
118
  'name' => __('Edit template','loco'),
@@ -206,7 +206,7 @@ class Loco_admin_bundle_ViewController extends Loco_admin_bundle_BaseController
206
  private function createFileParams( Loco_package_Project $project, Loco_fs_File $file, Loco_Locale $locale = null ){
207
  // Pull Gettext meta data from cache if possible
208
  // TODO save write when cached version was used
209
- $meta = Loco_gettext_Metadata::load($file)->persist( 0, true );
210
  // Establish whether translations are official or otherwise
211
  $dir = new Loco_fs_LocaleDirectory( $file->dirname() );
212
  // Retuen data required for PO table row
79
  // POT template file
80
  $file = $project->getPot();
81
  if( $file && $file->exists() ){
82
+ $meta = Loco_gettext_Metadata::load($file)->persistIfDirty( 0, true );
83
  $p['pot'] = new Loco_mvc_ViewParams( array(
84
  // POT info
85
  'name' => $file->basename(),
112
  $pot = $project->getPot();
113
  if( $pot && $pot->exists() ){
114
  $p['pot'] = $pot;
115
+ $meta = Loco_gettext_Metadata::load($pot)->persistIfDirty( 0, true );
116
  $p['nav'][] = new Loco_mvc_ViewParams( array(
117
  'href' => $this->getResourceLink('file-edit', $project, $meta ),
118
  'name' => __('Edit template','loco'),
206
  private function createFileParams( Loco_package_Project $project, Loco_fs_File $file, Loco_Locale $locale = null ){
207
  // Pull Gettext meta data from cache if possible
208
  // TODO save write when cached version was used
209
+ $meta = Loco_gettext_Metadata::load($file)->persistIfDirty( 0, true );
210
  // Establish whether translations are official or otherwise
211
  $dir = new Loco_fs_LocaleDirectory( $file->dirname() );
212
  // Retuen data required for PO table row
src/config/CustomSaved.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- *
4
  */
5
  class Loco_config_CustomSaved extends Loco_data_Option {
6
 
1
  <?php
2
  /**
3
+ * Bundle configuration saved as a WordPress site option.
4
  */
5
  class Loco_config_CustomSaved extends Loco_data_Option {
6
 
src/data/Serializable.php CHANGED
@@ -4,13 +4,17 @@
4
  */
5
  abstract class Loco_data_Serializable extends ArrayObject {
6
 
7
-
8
  /**
9
  * Object version, can be used for validation and migrations.
10
  * @var string|int|float
11
  */
12
  private $v = 0;
13
 
 
 
 
 
 
14
  /**
15
  * Commit serialized data to WordPress storage
16
  * @return mixed
@@ -19,18 +23,68 @@ abstract class Loco_data_Serializable extends ArrayObject {
19
 
20
 
21
  /**
22
- * Alias property getter through ArrayObject implementation
 
 
 
 
 
 
 
 
 
 
 
23
  */
24
- public function __get( $prop ){
25
- return $this[$prop];
26
  }
27
 
28
 
29
  /**
30
- * Alias property setter through ArrayObject implementation
 
31
  */
32
- public function __set( $prop, $value ){
33
- $this[$prop] = $value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
 
36
 
@@ -38,7 +92,10 @@ abstract class Loco_data_Serializable extends ArrayObject {
38
  * @return Loco_data_Serializable
39
  */
40
  public function setVersion( $version ){
41
- $this->v = $version;
 
 
 
42
  return $this;
43
  }
44
 
@@ -84,6 +141,9 @@ abstract class Loco_data_Serializable extends ArrayObject {
84
 
85
  // ok to populate ArrayObject
86
  $this->exchangeArray( $data['d'] );
 
 
 
87
 
88
  return $this;
89
  }
4
  */
5
  abstract class Loco_data_Serializable extends ArrayObject {
6
 
 
7
  /**
8
  * Object version, can be used for validation and migrations.
9
  * @var string|int|float
10
  */
11
  private $v = 0;
12
 
13
+ /**
14
+ * @var bool
15
+ */
16
+ private $dirty;
17
+
18
  /**
19
  * Commit serialized data to WordPress storage
20
  * @return mixed
23
 
24
 
25
  /**
26
+ * {@inheritdoc}
27
+ */
28
+ public function __construct( array $data = array() ){
29
+ $this->setFlags( ArrayObject::ARRAY_AS_PROPS );
30
+ parent::__construct( $data );
31
+ $this->dirty = (bool) $data;
32
+ }
33
+
34
+
35
+ /**
36
+ * Check if object's properties have change since last clean
37
+ * @return bool
38
  */
39
+ public function isDirty(){
40
+ return $this->dirty;
41
  }
42
 
43
 
44
  /**
45
+ * Make not dirty
46
+ * @return Loco_data_Serializable
47
  */
48
+ protected function clean(){
49
+ $this->dirty = false;
50
+ return $this;
51
+ }
52
+
53
+
54
+
55
+ /**
56
+ * Call persist method only if has changed since last clean
57
+ * @return Loco_data_Serializable
58
+ */
59
+ public function persistIfDirty(){
60
+ if( $this->isDirty() ){
61
+ $params = func_get_args();
62
+ call_user_func_array( array($this,'persist'), $params );
63
+ }
64
+ return $this;
65
+ }
66
+
67
+
68
+
69
+ /**
70
+ * @override so we can set dirty flag
71
+ */
72
+ public function offsetSet( $prop, $value ){
73
+ if( ! isset($this[$prop]) || $value !== $this[$prop] ){
74
+ parent::offsetSet( $prop, $value );
75
+ $this->dirty = true;
76
+ }
77
+ }
78
+
79
+
80
+ /**
81
+ * @override so we can set dirty flag
82
+ */
83
+ public function offsetUnset( $prop ){
84
+ if( isset($this[$prop]) ){
85
+ parent::offsetUnset($prop);
86
+ $this->dirty = true;
87
+ }
88
  }
89
 
90
 
92
  * @return Loco_data_Serializable
93
  */
94
  public function setVersion( $version ){
95
+ if( $version !== $this->v ){
96
+ $this->v = $version;
97
+ $this->dirty = true;
98
+ }
99
  return $this;
100
  }
101
 
141
 
142
  // ok to populate ArrayObject
143
  $this->exchangeArray( $data['d'] );
144
+
145
+ // because object is being restored, probably from disk. this make it clean now
146
+ $this->dirty = false;
147
 
148
  return $this;
149
  }
src/data/Settings.php CHANGED
@@ -125,6 +125,7 @@ class Loco_data_Settings extends Loco_data_Serializable {
125
  */
126
  public function persist(){
127
  $this->version = loco_plugin_version();
 
128
  return update_option('loco_settings', $this->getSerializable() );
129
  }
130
 
@@ -144,6 +145,7 @@ class Loco_data_Settings extends Loco_data_Serializable {
144
  // could ensure redundant keys are removed, but no need currently
145
  // $data = array_intersect_key( $data, self::$defaults );
146
  $this->exchangeArray( $data );
 
147
  return true;
148
  }
149
  return false;
@@ -157,11 +159,13 @@ class Loco_data_Settings extends Loco_data_Serializable {
157
  */
158
  public function migrate(){
159
  $existed = (bool) get_option('loco_settings');
160
- // Populate new format from legacy 1.x options
161
- $this->gen_hash = get_option('loco-translate-gen_hash','0');
162
- $this->use_fuzzy = get_option('loco-translate-use_fuzzy', '1' );
163
- $this->num_backups = get_option('loco-translate-num_backups','1');
164
- $this->persist();
 
 
165
  // currently the only upgrade could be 1.x => 2.0
166
  // deliberately keeping the old options due to legacy switching feature
167
  return ! $existed;
125
  */
126
  public function persist(){
127
  $this->version = loco_plugin_version();
128
+ $this->clean();
129
  return update_option('loco_settings', $this->getSerializable() );
130
  }
131
 
145
  // could ensure redundant keys are removed, but no need currently
146
  // $data = array_intersect_key( $data, self::$defaults );
147
  $this->exchangeArray( $data );
148
+ $this->clean();
149
  return true;
150
  }
151
  return false;
159
  */
160
  public function migrate(){
161
  $existed = (bool) get_option('loco_settings');
162
+ // Populate new format from legacy 1.x options, but only on first run
163
+ if( ! $existed ){
164
+ $this->gen_hash = get_option('loco-translate-gen_hash','0');
165
+ $this->use_fuzzy = get_option('loco-translate-use_fuzzy', '1' );
166
+ $this->num_backups = get_option('loco-translate-num_backups','1');
167
+ $this->persist();
168
+ }
169
  // currently the only upgrade could be 1.x => 2.0
170
  // deliberately keeping the old options due to legacy switching feature
171
  return ! $existed;
src/data/Transient.php CHANGED
@@ -28,6 +28,7 @@ abstract class Loco_data_Transient extends Loco_data_Serializable {
28
  $data = $this->getSerializable();
29
  set_transient( $key, $data, $ttl );
30
  $this->lazy = null;
 
31
  }
32
  else {
33
  $this->lazy = $ttl;
@@ -37,13 +38,12 @@ abstract class Loco_data_Transient extends Loco_data_Serializable {
37
  }
38
 
39
 
40
-
41
  /**
42
  * Commit to transient cache on object destruction
43
  */
44
  final public function __destruct(){
45
  if( is_int($this->lazy) ){
46
- $this->persist( $this->lazy, true );
47
  }
48
  }
49
 
28
  $data = $this->getSerializable();
29
  set_transient( $key, $data, $ttl );
30
  $this->lazy = null;
31
+ $this->clean();
32
  }
33
  else {
34
  $this->lazy = $ttl;
38
  }
39
 
40
 
 
41
  /**
42
  * Commit to transient cache on object destruction
43
  */
44
  final public function __destruct(){
45
  if( is_int($this->lazy) ){
46
+ $this->persistIfDirty( $this->lazy, true );
47
  }
48
  }
49
 
src/gettext/Metadata.php CHANGED
@@ -62,7 +62,6 @@ class Loco_gettext_Metadata extends Loco_data_Transient {
62
  'rpath' => $po->getRelativePath( loco_constant('WP_CONTENT_DIR') ),
63
  ) );
64
  // pull from cache if exists and has not been modified
65
- // TODO cache enabled filter / debug mode switch
66
  if( $nocache || ! $meta->fetch() || $bytes !== $meta['bytes'] || $mtime !== $meta['mtime'] ){
67
  // not available from cache, or cache is invalidated
68
  $meta['bytes'] = $bytes;
@@ -77,12 +76,10 @@ class Loco_gettext_Metadata extends Loco_data_Transient {
77
  catch( Exception $e ){
78
  $meta['valid'] = false;
79
  }
80
- // TODO set flag so we know whether uncached data needs caching again
81
- /*if( ! $nocache ){
82
- ...
83
- }*/
84
  }
85
-
 
 
86
  return $meta;
87
  }
88
 
62
  'rpath' => $po->getRelativePath( loco_constant('WP_CONTENT_DIR') ),
63
  ) );
64
  // pull from cache if exists and has not been modified
 
65
  if( $nocache || ! $meta->fetch() || $bytes !== $meta['bytes'] || $mtime !== $meta['mtime'] ){
66
  // not available from cache, or cache is invalidated
67
  $meta['bytes'] = $bytes;
76
  catch( Exception $e ){
77
  $meta['valid'] = false;
78
  }
 
 
 
 
79
  }
80
+ /*/ debug cache status after fetching transient: dirty means a miss and will require call to persist.
81
+ Loco_error_AdminNotices::debug( sprintf('%s for %s', $meta->isDirty() ? 'MISS' : 'HIT', $meta['rpath'] ) );*/
82
+
83
  return $meta;
84
  }
85
 
src/test/DummyFtpConnect.php CHANGED
@@ -22,6 +22,12 @@ class WP_Filesystem_Debug extends WP_Filesystem_Base {
22
 
23
  private $authed;
24
 
 
 
 
 
 
 
25
  public function __construct( array $opt ) {
26
  $this->options = $opt;
27
  $this->method = 'ftp';
22
 
23
  private $authed;
24
 
25
+ /**
26
+ * @var WP_Error
27
+ */
28
+ public $errors;
29
+
30
+
31
  public function __construct( array $opt ) {
32
  $this->options = $opt;
33
  $this->method = 'ftp';