Site Reviews - Version 5.1.4

Version Description

(2020-10-25) =

  • Added "ORDER BY" to migration SQL queries; this will make migrations run a little slower but fix a potential problem where database migrations may not complete successfully
  • Fixed addons notice styling and placement
  • Fixed plugin file paths on IIS Windows servers
  • Fixed plugin migrations to work better with caching plugins
  • Fixed strict standard notices in PHP 5.6
Download this release

Release Info

Developer geminilabs
Plugin Icon 128x128 Site Reviews
Version 5.1.4
Comparing to
See all releases

Code changes from version 5.1.3 to 5.1.4

assets/scripts/site-reviews-admin.js CHANGED
@@ -1,2 +1,2 @@
1
  /*! For license information please see site-reviews-admin.js.LICENSE.txt */
2
- !function(t){var i={};function n(e){if(i[e])return i[e].exports;var s=i[e]={i:e,l:!1,exports:{}};return t[e].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=i,n.d=function(t,i,e){n.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,i){if(1&i&&(t=n(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var s in t)n.d(e,s,function(i){return t[i]}.bind(null,s));return e},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,"a",i),i},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},n.p="/",n(n.s=8)}([,function(t,i){function n(i){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(i)}t.exports=n},function(t,i,n){var e;!function(n,s,r){"use strict";var o=function(t,i){var n={}.toString.call(t);this.selects="[object String]"===n?s.querySelectorAll(t):"[object NodeList]"===n?t:[t],this.destroy=function(){this.widgets.forEach((function(t){t.u()}))},this.rebuild=function(){this.widgets.forEach((function(t){t.h()}))},this.widgets=[];for(var e=0;e<this.selects.length;e++)if("SELECT"===this.selects[e].tagName&&!this.selects[e]["star-rating"]){var r=new a(this.selects[e],i);void 0!==r.direction&&this.widgets.push(r)}},a=function(t,i){this.el=t,this.v=this.g({},this._,i||{},JSON.parse(t.getAttribute("data-options"))),this.j(),this.stars<1||this.stars>this.v.maxStars||this.h()};a.prototype={_:{classname:"gl-star-rating",clearable:!0,initialText:"Select a Rating",maxStars:10,showText:!0},k:function(){this.S(),this.current=this.selected=this.F(),this.P(),this.A(),this.R(),this.$(this.current),this.L("add"),this.el["star-rating"]=!0},C:function(){this.v.showText&&(this.textEl=this.G(this.widgetEl,{class:this.v.classname+"-text"},!0))},A:function(){var t=this.T(),i=this.G(this.el,{class:this.v.classname+"-stars"},!0);for(var n in t){var e=this.O({"data-value":n,"data-text":t[n]});i.innerHTML+=e.outerHTML}this.widgetEl=i,this.C()},D:function(t){(t<0||isNaN(t))&&(t=0),t>this.stars&&(t=this.stars),this.widgetEl.classList.remove("s"+10*this.current),this.widgetEl.classList.add("s"+10*t),this.v.showText&&(this.textEl.textContent=t<1?this.v.initialText:this.widgetEl.childNodes[t-1].dataset.text),this.current=t},O:function(t){var i=s.createElement("span");for(var n in t=t||{})i.setAttribute(n,t[n]);return i},u:function(){this.L("remove");var t=this.el.parentNode;t.parentNode.replaceChild(this.el,t),delete this.el["star-rating"]},I:function(t,i,n,e){e=e||!1,n.forEach(function(n){this.events&&t[i+"EventListener"](n,this.events[n],e)}.bind(this))},g:function(){var t=[].slice.call(arguments),i=t[0],n=t.slice(1);return Object.keys(n).forEach((function(t){for(var e in n[t])n[t].hasOwnProperty(e)&&(i[e]=n[t][e])})),i},N:function(){var t=!1;try{var i=Object.defineProperty({},"passive",{get:function(){t={passive:!1}}});n.addEventListener("test",null,i)}catch(t){}return t},M:function(t){var i={},n=t.pageX||t.changedTouches[0].pageX,e=this.widgetEl.offsetWidth;return i.ltr=Math.max(n-this.offsetLeft,1),i.rtl=e-i.ltr,Math.min(Math.ceil(i[this.direction]/Math.round(e/this.stars)),this.stars)},T:function(){for(var t=this.el,i={},n={},e=0;e<t.length;e++)this.V(t[e])||(i[t[e].value]=t[e].text);return Object.keys(i).sort().forEach((function(t){n[t]=i[t]})),n},F:function(){return parseInt(this.el.options[Math.max(this.el.selectedIndex,0)].value)||0},L:function(t){var i=this.el.closest("form");i&&"FORM"===i.tagName&&this.I(i,t,["reset"]),"add"===t&&this.el.disabled||(this.I(this.el,t,["change","keydown"]),this.I(this.widgetEl,t,["mousedown","mouseleave","mousemove","mouseover","touchend","touchmove","touchstart"],this.N()))},S:function(){this.events={change:this.Z.bind(this),keydown:this.W.bind(this),mousedown:this.q.bind(this),mouseleave:this.B.bind(this),mousemove:this.H.bind(this),mouseover:this.K.bind(this),reset:this.U.bind(this),touchend:this.q.bind(this),touchmove:this.H.bind(this),touchstart:this.K.bind(this)}},G:function(t,i,n){var e=this.O(i);return t.parentNode.insertBefore(e,!0===n?t.nextSibling:t),e},V:function(t){return null===t.getAttribute("value")||""===t.value},Z:function(){this.D(this.F())},W:function(t){if(~["ArrowLeft","ArrowRight"].indexOf(t.key)){var i="ArrowLeft"===t.key?-1:1;"rtl"===this.direction&&(i*=-1),this.$(Math.min(Math.max(this.F()+i,0),this.stars)),this.J()}},q:function(t){t.preventDefault();var i=this.M(t);0!==this.current&&parseFloat(this.selected)===i&&this.v.clearable&&(i=0),this.$(i),this.J()},B:function(t){t.preventDefault(),this.D(this.selected)},H:function(t){t.preventDefault(),this.D(this.M(t))},K:function(t){t.preventDefault();var i=this.widgetEl.getBoundingClientRect();this.offsetLeft=i.left+s.body.scrollLeft},U:function(){var t=this.el.querySelector("[selected]"),i=t?t.value:"";this.el.value=i,this.selected=parseInt(i)||0,this.D(i)},h:function(){this.el.parentNode.classList.contains(this.v.classname)&&this.u(),this.k()},R:function(){var t=this.el.parentNode;this.direction=n.getComputedStyle(t,null).getPropertyValue("direction"),t.classList.add(this.v.classname+"-"+this.direction)},$:function(t){this.el.value=this.selected=t,this.D(t)},j:function(){var t=this.el;this.stars=0;for(var i=0;i<t.length;i++)if(!this.V(t[i])){if(isNaN(parseFloat(t[i].value))||!isFinite(t[i].value))return void(this.stars=0);this.stars++}},J:function(){this.el.dispatchEvent(new Event("change"))},P:function(){this.G(this.el,{class:this.v.classname,"data-star-rating":""}).appendChild(this.el)}},void 0===(e=function(){return o}.apply(i,[]))||(t.exports=e)}(window,document)},function(t,i,n){(function(i){var n=function(t){var i=/\blang(?:uage)?-([\w-]+)\b/i,n=0,e={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function t(i){return i instanceof s?new s(i.type,t(i.content),i.alias):Array.isArray(i)?i.map(t):i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++n}),t.__id},clone:function t(i,n){var s,r;switch(n=n||{},e.util.type(i)){case"Object":if(r=e.util.objId(i),n[r])return n[r];for(var o in s={},n[r]=s,i)i.hasOwnProperty(o)&&(s[o]=t(i[o],n));return s;case"Array":return r=e.util.objId(i),n[r]?n[r]:(s=[],n[r]=s,i.forEach((function(i,e){s[e]=t(i,n)})),s);default:return i}},getLanguage:function(t){for(;t&&!i.test(t.className);)t=t.parentElement;return t?(t.className.match(i)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(e){var t=(/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(e.stack)||[])[1];if(t){var i=document.getElementsByTagName("script");for(var n in i)if(i[n].src==t)return i[n]}return null}},isActive:function(t,i,n){for(var e="no-"+i;t;){var s=t.classList;if(s.contains(i))return!0;if(s.contains(e))return!1;t=t.parentElement}return!!n}},languages:{extend:function(t,i){var n=e.util.clone(e.languages[t]);for(var s in i)n[s]=i[s];return n},insertBefore:function(t,i,n,s){var r=(s=s||e.languages)[t],o={};for(var a in r)if(r.hasOwnProperty(a)){if(a==i)for(var u in n)n.hasOwnProperty(u)&&(o[u]=n[u]);n.hasOwnProperty(a)||(o[a]=r[a])}var c=s[t];return s[t]=o,e.languages.DFS(e.languages,(function(i,n){n===c&&i!=t&&(this[i]=o)})),o},DFS:function t(i,n,s,r){r=r||{};var o=e.util.objId;for(var a in i)if(i.hasOwnProperty(a)){n.call(i,a,i[a],s||a);var u=i[a],c=e.util.type(u);"Object"!==c||r[o(u)]?"Array"!==c||r[o(u)]||(r[o(u)]=!0,t(u,n,a,r)):(r[o(u)]=!0,t(u,n,null,r))}}},plugins:{},highlightAll:function(t,i){e.highlightAllUnder(document,t,i)},highlightAllUnder:function(t,i,n){var s={callback:n,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};e.hooks.run("before-highlightall",s),s.elements=Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)),e.hooks.run("before-all-elements-highlight",s);for(var r,o=0;r=s.elements[o++];)e.highlightElement(r,!0===i,s.callback)},highlightElement:function(n,s,r){var o=e.util.getLanguage(n),a=e.languages[o];n.className=n.className.replace(i,"").replace(/\s+/g," ")+" language-"+o;var u=n.parentElement;u&&"pre"===u.nodeName.toLowerCase()&&(u.className=u.className.replace(i,"").replace(/\s+/g," ")+" language-"+o);var c={element:n,language:o,grammar:a,code:n.textContent};function h(t){c.highlightedCode=t,e.hooks.run("before-insert",c),c.element.innerHTML=c.highlightedCode,e.hooks.run("after-highlight",c),e.hooks.run("complete",c),r&&r.call(c.element)}if(e.hooks.run("before-sanity-check",c),!c.code)return e.hooks.run("complete",c),void(r&&r.call(c.element));if(e.hooks.run("before-highlight",c),c.grammar)if(s&&t.Worker){var l=new Worker(e.filename);l.onmessage=function(t){h(t.data)},l.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else h(e.highlight(c.code,c.grammar,c.language));else h(e.util.encode(c.code))},highlight:function(t,i,n){var r={code:t,grammar:i,language:n};return e.hooks.run("before-tokenize",r),r.tokens=e.tokenize(r.code,r.grammar),e.hooks.run("after-tokenize",r),s.stringify(e.util.encode(r.tokens),r.language)},tokenize:function(t,i){var n=i.rest;if(n){for(var u in n)i[u]=n[u];delete i.rest}var c=new r;return o(c,c.head,t),function t(i,n,r,u,c,h){for(var l in r)if(r.hasOwnProperty(l)&&r[l]){var f=r[l];f=Array.isArray(f)?f:[f];for(var d=0;d<f.length;++d){if(h&&h.cause==l+","+d)return;var p=f[d],v=p.inside,g=!!p.lookbehind,m=!!p.greedy,y=0,b=p.alias;if(m&&!p.pattern.global){var w=p.pattern.toString().match(/[imsuy]*$/)[0];p.pattern=RegExp(p.pattern.source,w+"g")}for(var _=p.pattern||p,j=u.next,k=c;j!==n.tail&&!(h&&k>=h.reach);k+=j.value.length,j=j.next){var S=j.value;if(n.length>i.length)return;if(!(S instanceof s)){var Q=1;if(m&&j!=n.tail.prev){if(_.lastIndex=k,!(R=_.exec(i)))break;var x=R.index+(g&&R[1]?R[1].length:0),F=R.index+R[0].length,P=k;for(P+=j.value.length;x>=P;)j=j.next,P+=j.value.length;if(P-=j.value.length,k=P,j.value instanceof s)continue;for(var A=j;A!==n.tail&&(P<F||"string"==typeof A.value);A=A.next)Q++,P+=A.value.length;Q--,S=i.slice(k,P),R.index-=k}else{_.lastIndex=0;var R=_.exec(S)}if(R){g&&(y=R[1]?R[1].length:0);x=R.index+y;var $=R[0].slice(y),L=(F=x+$.length,S.slice(0,x)),C=S.slice(F),z=k+S.length;h&&z>h.reach&&(h.reach=z);var E=j.prev;L&&(E=o(n,E,L),k+=L.length),a(n,E,Q);var G=new s(l,v?e.tokenize($,v):$,b,$);j=o(n,E,G),C&&o(n,j,C),Q>1&&t(i,n,r,j.prev,k,{cause:l+","+d,reach:z})}}}}}}(t,c,i,c.head,0),function(t){var i=[],n=t.head.next;for(;n!==t.tail;)i.push(n.value),n=n.next;return i}(c)},hooks:{all:{},add:function(t,i){var n=e.hooks.all;n[t]=n[t]||[],n[t].push(i)},run:function(t,i){var n=e.hooks.all[t];if(n&&n.length)for(var s,r=0;s=n[r++];)s(i)}},Token:s};function s(t,i,n,e){this.type=t,this.content=i,this.alias=n,this.length=0|(e||"").length}function r(){var t={value:null,prev:null,next:null},i={value:null,prev:t,next:null};t.next=i,this.head=t,this.tail=i,this.length=0}function o(t,i,n){var e=i.next,s={value:n,prev:i,next:e};return i.next=s,e.prev=s,t.length++,s}function a(t,i,n){for(var e=i.next,s=0;s<n&&e!==t.tail;s++)e=e.next;i.next=e,e.prev=i,t.length-=s}if(t.Prism=e,s.stringify=function t(i,n){if("string"==typeof i)return i;if(Array.isArray(i)){var s="";return i.forEach((function(i){s+=t(i,n)})),s}var r={type:i.type,content:t(i.content,n),tag:"span",classes:["token",i.type],attributes:{},language:n},o=i.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(r.classes,o):r.classes.push(o)),e.hooks.run("wrap",r);var a="";for(var u in r.attributes)a+=" "+u+'="'+(r.attributes[u]||"").replace(/"/g,"&quot;")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+a+">"+r.content+"</"+r.tag+">"},!t.document)return t.addEventListener?(e.disableWorkerMessageHandler||t.addEventListener("message",(function(i){var n=JSON.parse(i.data),s=n.language,r=n.code,o=n.immediateClose;t.postMessage(e.highlight(r,e.languages[s],s)),o&&t.close()}),!1),e):e;var u=e.util.currentScript();function c(){e.manual||e.highlightAll()}if(u&&(e.filename=u.src,u.hasAttribute("data-manual")&&(e.manual=!0)),!e.manual){var h=document.readyState;"loading"===h||"interactive"===h&&u&&u.defer?document.addEventListener("DOMContentLoaded",c):window.requestAnimationFrame?window.requestAnimationFrame(c):window.setTimeout(c,16)}return e}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});t.exports&&(t.exports=n),void 0!==i&&(i.Prism=n)}).call(this,n(9))},,,,,function(t,i,n){t.exports=n(26)},function(t,i){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,i){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},function(t,i){Prism.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,i){var n={};n["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[i]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var e={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};e["language-"+i]={pattern:/[\s\S]+/,inside:Prism.languages[i]};var s={};s[t]={pattern:RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:e},Prism.languages.insertBefore("markup","cdata",s)}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},function(t,i){Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript},function(t,i){!function(t){function i(t,i){return"___"+t.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,e,s,r){if(n.language===e){var o=n.tokenStack=[];n.code=n.code.replace(s,(function(t){if("function"==typeof r&&!r(t))return t;for(var s,a=o.length;-1!==n.code.indexOf(s=i(e,a));)++a;return o[a]=t,s})),n.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(n,e){if(n.language===e&&n.tokenStack){n.grammar=t.languages[e];var s=0,r=Object.keys(n.tokenStack);!function o(a){for(var u=0;u<a.length&&!(s>=r.length);u++){var c=a[u];if("string"==typeof c||c.content&&"string"==typeof c.content){var h=r[s],l=n.tokenStack[h],f="string"==typeof c?c:c.content,d=i(e,h),p=f.indexOf(d);if(p>-1){++s;var v=f.substring(0,p),g=new t.Token(e,t.tokenize(l,n.grammar),"language-"+e,l),m=f.substring(p+d.length),y=[];v&&y.push.apply(y,o([v])),y.push(g),m&&y.push.apply(y,o([m])),"string"==typeof c?a.splice.apply(a,[u,1].concat(y)):c.content=y}}else c.content&&o(c.content)}return a}(n.tokens)}}}})}(Prism)},function(t,i){!function(t){t.languages.php=t.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),t.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),t.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),t.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),t.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var i={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:t.languages.php};t.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:i}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:i}}}),delete t.languages.php.string,t.hooks.add("before-tokenize",(function(i){if(/<\?/.test(i.code)){t.languages["markup-templating"].buildPlaceholders(i,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}})),t.hooks.add("after-tokenize",(function(i){t.languages["markup-templating"].tokenizePlaceholders(i,"php")}))}(Prism)},function(t,i){!function(t){var i=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+i.source+")*?(?=\\s*\\{)"),string:{pattern:i,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),t.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:n.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:t.languages.css}},alias:"language-css"}},n.tag))}(Prism)},function(t,i){!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var t=/\n(?!$)/g,i=Prism.plugins.lineNumbers={getLine:function(t,i){if("PRE"===t.tagName&&t.classList.contains("line-numbers")){var n=t.querySelector(".line-numbers-rows"),e=parseInt(t.getAttribute("data-start"),10)||1,s=e+(n.children.length-1);i<e&&(i=e),i>s&&(i=s);var r=i-e;return n.children[r]}},resize:function(t){s([t])},assumeViewportIndependence:!0},n=function(t){return t?window.getComputedStyle?getComputedStyle(t):t.currentStyle||null:null},e=void 0;window.addEventListener("resize",(function(){i.assumeViewportIndependence&&e===window.innerWidth||(e=window.innerWidth,s(Array.prototype.slice.call(document.querySelectorAll("pre.line-numbers"))))})),Prism.hooks.add("complete",(function(i){if(i.code){var n=i.element,e=n.parentNode;if(e&&/pre/i.test(e.nodeName)&&!n.querySelector(".line-numbers-rows")&&Prism.util.isActive(n,"line-numbers")){n.classList.remove("line-numbers"),e.classList.add("line-numbers");var r,o=i.code.match(t),a=o?o.length+1:1,u=new Array(a+1).join("<span></span>");(r=document.createElement("span")).setAttribute("aria-hidden","true"),r.className="line-numbers-rows",r.innerHTML=u,e.hasAttribute("data-start")&&(e.style.counterReset="linenumber "+(parseInt(e.getAttribute("data-start"),10)-1)),i.element.appendChild(r),s([e]),Prism.hooks.run("line-numbers",i)}}})),Prism.hooks.add("line-numbers",(function(t){t.plugins=t.plugins||{},t.plugins.lineNumbers=!0}))}function s(i){if(0!=(i=i.filter((function(t){var i=n(t)["white-space"];return"pre-wrap"===i||"pre-line"===i}))).length){var e=i.map((function(i){var n=i.querySelector("code"),e=i.querySelector(".line-numbers-rows");if(n&&e){var s=i.querySelector(".line-numbers-sizer"),r=n.textContent.split(t);s||((s=document.createElement("span")).className="line-numbers-sizer",n.appendChild(s)),s.innerHTML="0",s.style.display="block";var o=s.getBoundingClientRect().height;return s.innerHTML="",{element:i,lines:r,lineHeights:[],oneLinerHeight:o,sizer:s}}})).filter(Boolean);e.forEach((function(t){var i=t.sizer,n=t.lines,e=t.lineHeights,s=t.oneLinerHeight;e[n.length-1]=void 0,n.forEach((function(t,n){if(t&&t.length>1){var r=i.appendChild(document.createElement("span"));r.style.display="block",r.textContent=t}else e[n]=s}))})),e.forEach((function(t){for(var i=t.sizer,n=t.lineHeights,e=0,s=0;s<n.length;s++)void 0===n[s]&&(n[s]=i.children[e++].getBoundingClientRect().height)})),e.forEach((function(t){var i=t.sizer,n=t.element.querySelector(".line-numbers-rows");i.style.display="none",i.innerHTML="",t.lineHeights.forEach((function(t,i){n.children[i].style.height=t+"px"}))}))}}}()},,,,,,,,,,function(t,i,n){"use strict";n.r(i);var e=function(t){return this.data={},this.form=jQuery(t),this.pushes={},this.init()};e.prototype={patterns:{validate:/^[a-z_-][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_-]+)\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,named:/^[a-z0-9_-]+$/i,push:/^$/,fixed:/^\d+$/},addPair:function(t){this.patterns.validate.test(t.name)&&(this.data=jQuery.extend(!0,this.data,this.makeObject(t.name,this.encode(t))))},build:function(t,i,n){return t[i]=n,t},encode:function(t){switch(jQuery('[name="'+t.name+'"]',this.form).attr("type")){case"checkbox":return"on"===t.value||t.value;default:return t.value}},incrementPush:function(t){return void 0===this.pushes[t]&&(this.pushes[t]=0),this.pushes[t]++},init:function(){var t=this.form.serializeArray();if(jQuery.isArray(t))for(var i=0,n=t.length;i<n;i++)this.addPair(t[i]);return this.data},makeObject:function(t,i){for(var n,e=t.match(this.patterns.key);void 0!==(n=e.pop());)if(this.patterns.push.test(n)){var s=this.incrementPush(t.replace(/\[\]$/,""));i=this.build([],s,i)}else this.patterns.fixed.test(n)?i=this.build([],n,i):this.patterns.named.test(n)&&(i=this.build({},n,i));return i}};var s=e,r=function(t,i,n){this.event=i||null,this.form=n||null,this.notice=null,this.request=t||{}};r.prototype={post:function(t){this.event?this.Y(t):this.X(t)},tt:function(t){var i={action:GLSR.action,_ajax_request:!0};if(this.form){var n=new s(this.form);n[GLSR.nameprefix]&&(this.request=n[GLSR.nameprefix])}return this.it(t),i[GLSR.nameprefix]=this.request,i},it:function(t){this.request._nonce||(GLSR.nonce[this.request._action]?this.request._nonce=GLSR.nonce[this.request._action]:t&&(this.request._nonce=t.closest("form").find("#_wpnonce").val()))},X:function(t,i){jQuery.post(GLSR.ajaxurl,this.tt(i)).done((function(n){"function"==typeof t&&t(n.data,n.success),i&&i.prop("disabled",!1)})).always((function(t){t.data?t.data.notices&&GLSR.notices.add(t.data.notices):GLSR.notices.add('<div class="notice notice-error inline is-dismissible"><p>Unknown error.</p></div>')}))},Y:function(t){this.event.preventDefault();var i=jQuery(this.event.currentTarget);i.is(":disabled")||(i.prop("disabled",!0),this.X(t,i))}};var o=r,a=n(1),u=n.n(a),c=function(){"object"===u()(jQuery.wp)&&"function"==typeof jQuery.wp.wpColorPicker&&jQuery(document).find("input[type=text].color-picker-hex").each((function(){jQuery(this).wpColorPicker(jQuery(this).data("colorpicker")||{})}))},h=function(t){this.el=document.querySelector(t),this.el&&(this.depends=this.el.querySelectorAll("[data-depends]"),this.depends.length&&this.k())};h.prototype={nt:function(t){var i=t.getAttribute("data-depends");if(i)try{return JSON.parse(i)}catch(t){return}},k:function(){for(var t=this.el.elements,i=0;i<t.length;i++)~["INPUT","SELECT"].indexOf(t[i].nodeName)&&t[i].addEventListener("change",this.Z.bind(this))},et:function(t,i){var n=!1;i=[].concat(i);var e=this.el.querySelectorAll('[name="'+t+'"]');return[].map.call(e,function(t){var e=~this.st(i).indexOf(this.rt(t.value));~["checkbox","radio"].indexOf(t.type)?t.checked&&e&&(n=!0):e&&(n=!0)}.bind(this)),n},rt:function(t){return!!~["true","on","yes","1"].indexOf(t)||!~["false","off","no","0"].indexOf(t)&&t},st:function(t){return t.map(this.rt)},Z:function(t){this.depends.forEach(function(i){var n=this.nt(i);if(n&&~n.map((function(t){return t.name})).indexOf(t.currentTarget.name)){var e=!0;n.forEach(function(t){this.et(t.name,t.value)||(e=!1)}.bind(this)),this.ot(i,e)}}.bind(this))},ot:function(t,i){var n=t.closest(".glsr-setting-field");n&&n.classList[i?"remove":"add"]("hidden")}};var l=h,f=function(){jQuery(".glsr-metabox-field .glsr-toggle__input").on("change",this.at.bind(this)),jQuery(".glsr-metabox-field input[type=url]").on("change",this.ut.bind(this))};f.prototype={ut:function(t){var i=jQuery(t.currentTarget);this.ct(i.parent().find("img"),i.val())},at:function(t){var i=t.currentTarget.checked;jQuery(".glsr-input-value").each(function(t,n){if(i)jQuery(n).data("value",n.value);else{if(n.value=jQuery(n).data("value"),"url"!==n.type)return;this.ct(jQuery(n).parent().find("img"),n.value)}}.bind(this)),jQuery(".glsr-input-value").prop("disabled",!i),GLSR.stars.rebuild()},ct:function(t,i){if(t){var n=new Image;n.src=i,n.onerror=function(){t.attr("src",t.data("fallback"))},n.onload=function(){t.attr("src",n.src)}}}};var d=f,p=function(){this.k()};p.prototype={add:function(t){t&&(jQuery("#glsr-notices").length||(jQuery("#message.notice").remove(),jQuery("hr.wp-header-end").after('<div id="glsr-notices" />')),jQuery("#glsr-notices").html(t),jQuery(document).trigger("wp-updates-notice-added"))},k:function(){jQuery(".glsr-notice[data-dismiss]").on("click.wp-dismiss-notice",this.ht.bind(this))},ht:function(t){var i={};i[GLSR.nameprefix]={_action:"dismiss-notice",notice:jQuery(t.currentTarget).data("dismiss")},wp.ajax.post(GLSR.action,i)}};var v=p,g=function(){this.el=jQuery("#pinned-status-select"),this.el&&(this.cancel=jQuery("a.cancel-pinned-status"),this.cancel.on("click",this.lt.bind(this)),this.edit=jQuery("a.edit-pinned-status"),this.edit.on("click",this.ft.bind(this)),this.save=jQuery("a.save-pinned-status"),this.save.on("click",this.dt.bind(this))),jQuery("td.column-is_pinned i.pin-review").on("click",this.pt.bind(this))};g.prototype={vt:function(){this.el.slideUp("fast"),this.edit.show().focus()},lt:function(t){t.preventDefault(),this.vt(),this.el.find("select").val("0"===jQuery("#hidden-pinned-status").val()?1:0)},ft:function(t){t.preventDefault(),this.el.is(":hidden")&&(this.el.slideDown("fast",function(){this.el.find("select").focus()}.bind(this)),this.edit.hide())},dt:function(t){t.preventDefault(),this.vt(),this.target=t.currentTarget;var i={_action:"toggle-pinned",id:jQuery("#post_ID").val(),pinned:jQuery("#pinned-status").val()};new o(i).post(this.gt.bind(this))},pt:function(t){t.preventDefault(),this.target=t.currentTarget;var i={_action:"toggle-pinned",id:t.currentTarget.getAttribute("data-id")};jQuery(this.target).addClass("spinner is-active").removeClass("dashicons-sticky"),new o(i).post(this.yt.bind(this))},gt:function(t){jQuery("#pinned-status").val(0|!t.pinned),jQuery("#hidden-pinned-status").val(0|t.pinned),jQuery("#pinned-status-text").text(t.pinned?this.target.dataset.yes:this.target.dataset.no),GLSR.notices.add(t.notices)},yt:function(t){this.target.classList[t.pinned?"add":"remove"]("pinned"),jQuery(this.target).removeClass("spinner is-active").addClass("dashicons-sticky")}};var m=g,y=function(){jQuery.each(GLSR.pointers,function(t,i){this.k(i)}.bind(this))};y.prototype={bt:function(t){jQuery.post(GLSR.ajaxurl,{action:"dismiss-wp-pointer",pointer:t})},k:function(t){jQuery(t.target).pointer({content:t.options.content,position:t.options.position,close:this.bt.bind(null,t.id)}).pointer("open").pointer("sendToTop"),jQuery(document).on("wp-window-resized",(function(){jQuery(t.target).pointer("reposition")}))}};var b=y,w=n(3),j=n.n(w),k=(n(10),n(11),n(12),n(13),n(14),n(15),n(16),function(t,i){this.el=jQuery(t),this.options=i,this.searchTerm=null,this.k()});k.prototype={defaults:{action:null,exclude:[],onInit:null,onResultClick:null,results:{},selected:-1,selectedClass:"glsr-selected-result",selectorEntries:".glsr-strings-table tbody",selectorResults:".glsr-search-results",selectorSearch:".glsr-search-input"},k:function(){this.options=jQuery.extend({},this.defaults,this.options),this.el.length&&(this.options.entriesEl=this.el.parent().find(this.options.selectorEntries),this.options.resultsEl=this.el.find(this.options.selectorResults),this.options.searchEl=this.el.find(this.options.selectorSearch),this.options.searchEl.attr("aria-describedby","live-search-desc"),"function"==typeof this.options.onInit&&this.options.onInit.call(this),this.S())},S:function(){this.options.searchEl.on("input",_.debounce(this.wt.bind(this),500)),this.options.searchEl.on("keyup",this._t.bind(this)),this.options.searchEl.on("keydown keypress",(function(t){GLSR.keys.ENTER===t.which&&t.preventDefault()})),jQuery(document).on("click",this.jt.bind(this)),jQuery(document).on("keydown",this.kt.bind(this))},St:function(){void 0!==this.searchRequest&&this.searchRequest.abort()},Qt:function(){this.St(),this.options.resultsEl.empty(),this.options.resultsEl.removeClass("is-active"),this.el.removeClass("is-active"),jQuery("body").removeClass("glsr-focus")},xt:function(t){var i=this.options.entriesEl.children("tr").eq(t),n=this;i.find("td").css({backgroundColor:"#faafaa"}),i.fadeOut(350,(function(){jQuery(this).remove(),n.options.results={},n.Ft(),n.Pt()}))},At:function(t){jQuery("body").addClass("glsr-focus"),this.options.resultsEl.append(t),this.options.resultsEl.children("span").on("click",this.Rt.bind(this))},$t:function(){this.options.entriesEl.on("click","a.delete",this.Lt.bind(this)),this.options.entriesEl.sortable({items:"tr",tolerance:"pointer",start:function(t,i){i.placeholder.height(i.helper[0].scrollHeight)},sort:function(t,i){var n=t.pageY-jQuery(this).offsetParent().offset().top-i.helper.outerHeight(!0)/2;i.helper.css({top:n+"px"})}})},Ct:function(t){this.options.selected+=t,this.options.results.removeClass(this.options.selectedClass),this.options.selected<0&&(this.options.selected=-1,this.options.searchEl.focus()),this.options.selected>=this.options.results.length&&(this.options.selected=this.options.results.length-1),this.options.selected>=0&&this.options.results.eq(this.options.selected).addClass(this.options.selectedClass).focus()},jt:function(t){jQuery(t.target).find(this.el).length&&jQuery("body").hasClass("glsr-focus")&&this.Qt()},kt:function(t){if(!jQuery.isEmptyObject(this.options.results)){if(GLSR.keys.ESC===t.which&&this.Qt(),GLSR.keys.ENTER===t.which||GLSR.keys.SPACE===t.which){var i=this.options.resultsEl.find("."+this.options.selectedClass);i&&i.trigger("click")}GLSR.keys.UP===t.which&&(t.preventDefault(),this.Ct(-1)),GLSR.keys.DOWN===t.which&&(t.preventDefault(),this.Ct(1))}},Lt:function(t){t.preventDefault(),this.xt(jQuery(t.currentTarget).closest("tr").index())},Rt:function(t){t.preventDefault(),"function"==typeof this.options.onResultClick&&this.options.onResultClick.call(this,t),this.Qt()},wt:function(t){if(this.St(),this.searchTerm===t.currentTarget.value&&this.options.results.length)return this.At(this.options.results);if(this.options.resultsEl.empty(),this.options.selected=-1,this.searchTerm=t.currentTarget.value,""===this.searchTerm)return this.zt();this.el.addClass("is-active");var i={};i[GLSR.nameprefix]={_action:this.options.action,_nonce:this.el.find("#_search_nonce").val(),exclude:this.options.exclude,search:this.searchTerm},this.searchRequest=wp.ajax.post(GLSR.action,i).done(function(t){this.el.removeClass("is-active"),this.At(t.items?t.items:t.empty),this.options.results=this.options.resultsEl.children(),this.options.resultsEl.addClass("is-active"),delete this.searchRequest}.bind(this))},_t:function(t){GLSR.keys.ESC===t.which&&this.zt(),GLSR.keys.ENTER===t.which&&(this.wt(t),t.preventDefault())},Et:function(t){t.preventDefault();var i=jQuery(t.currentTarget).closest(".glsr-assigned-entry");i.find("a").css({color:"#c00"}),i.fadeOut("fast",(function(){i.remove()}))},Ft:function(){var t=this;this.options.exclude=[],this.options.entriesEl.children("tr").each((function(i){jQuery(this).find(".glsr-string-td2").children().filter(":input").each((function(){var n=jQuery(this),e=n.attr("name").replace(/\[\d+\]/i,"["+i+"]");n.attr("name",e),n.is("[data-id]")&&t.options.exclude.push({id:n.val()})}))}))},zt:function(){this.Qt(),this.options.results={},this.options.searchEl.val("")},Pt:function(){var t=this.options.entriesEl.children().length>0?"remove":"add";this.options.entriesEl.parent()[t+"Class"]("glsr-hidden")}};var S=k,Q=function(t){this.current=null,this.editor=null,this.create=function(t){if(this.editor=tinymce.get(t),this.editor){var i={_action:"mce-shortcode",shortcode:this.current};new o(i).post(this.Gt.bind(this))}};var i=document.querySelectorAll(t);i.length&&i.forEach(function(t){var i=t.querySelector("button"),n=t.querySelectorAll(".mce-menu-item");i&&n.length&&this.k(t,i,n)}.bind(this))};Q.prototype={Tt:{},Ot:[],k:function(t,i,n){document.addEventListener("click",this.Dt.bind(this,t,i)),i.addEventListener("click",this.It.bind(this,t,i)),n.forEach(function(n){n.addEventListener("click",this.Nt.bind(this,t,i))}.bind(this))},Mt:function(){tinymce.execCommand("GLSR_Shortcode")},Vt:function(){jQuery("#scTemp").length?this.Mt():(jQuery("body").append('<textarea id="scTemp" style="display:none!important;"/>'),tinymce.init({elements:"scTemp",external_plugins:GLSR.tinymce,mode:"exact",plugins:["glsr_shortcode","wplink"]}),setTimeout(function(){this.Mt()}.bind(this),200))},bt:function(t,i){jQuery(i).removeClass("active"),jQuery(t).find(".glsr-mce-menu").hide()},u:function(){var t=jQuery("#scTemp");t.length&&(tinymce.get("scTemp").remove(),t.remove()),this.Tt={},this.Ot=[]},Gt:function(t){if(t){if(0===t.body.length)return window.send_to_editor("["+t.shortcode+"]"),void this.u();var i=this.Zt(t);t.ok.constructor===Array&&(i.buttons[0].text=t.ok[0],i.buttons[0].onclick="close",delete i.buttons[1]),this.editor.windowManager.open(i)}},Wt:function(t){for(var i in this.Tt=t,this.Ot=[],t)t.hasOwnProperty(i)&&(this.qt(i),this.Bt(i),this.Ht(i));this.Tt.hide=this.Ot.join(",")},qt:function(t){"display"!==t||jQuery.isNumeric(this.Tt[t])||(this.Tt[t]="")},Bt:function(t){if(GLSR.hideoptions.hasOwnProperty(this.current)){var i=t.substring("hide_".length);-1!==Object.keys(GLSR.hideoptions[this.current]).indexOf(i)&&(this.Tt[t]&&this.Ot.push(i),delete this.Tt[t])}},Ht:function(t){"id"===t&&(this.Tt[t]=(+new Date).toString(36))},Dt:function(t,i,n){jQuery(n.target).closest(jQuery(t)).length||this.bt(t,i)},It:function(t,i,n){n.preventDefault(),n.currentTarget.classList.contains("active")?this.bt(t,i):this.Kt(t,i)},Nt:function(t,i,n){n.preventDefault(),this.current=n.currentTarget.dataset.shortcode,this.current&&(tinymce.get(window.wpActiveEditor)?this.Mt():this.Vt(),setTimeout(function(){this.bt(t,i)}.bind(this),100))},Kt:function(t,i){jQuery(i).addClass("active"),jQuery(t).find(".glsr-mce-menu").show()},Ut:function(t){return[{classes:"btn glsr-btn primary",onclick:this.Jt.bind(this),text:t.ok},{onclick:"close",text:t.close}]},Zt:function(t){return{title:t.title,body:t.body,classes:"glsr-mce-popup",minWidth:320,buttons:this.Ut(t),onsubmit:this.Yt.bind(this,t),onclose:this.u.bind(this)}},Yt:function(t,i){var n="";for(var e in this.Wt(i.data),this.Tt)this.Tt.hasOwnProperty(e)&&""!==this.Tt[e]&&(n+=" "+e+'="'+this.Tt[e]+'"');window.send_to_editor("["+t.shortcode+n+"]")},Jt:function(){var t=this.editor.windowManager.getWindows()[0];this.Xt(t)&&t.submit()},Xt:function(t){var i,n=!0,e=GLSR.shortcodes[this.current];for(var s in e)if(e.hasOwnProperty(s)&&void 0!==(i=t.find("#"+s)[0])&&""===i.state.data.value){n=!1,alert(e[s]);break}return n}};var x=Q,F=n(2),P=n.n(F),A=function(t){var i=document.querySelectorAll(t);i.length&&i.forEach(function(t){t.addEventListener("click",this.ht)}.bind(this))};A.prototype={ht:function(t){var i=t.currentTarget.href.match(/post=([0-9]+)/),n=t.currentTarget.href.match(/action=([a-z]+)/);if(null!==i&&null!==n){var e={_action:"toggle-status",_nonce:GLSR.nonce["toggle-status"],post_id:i[1],status:n[1]};new o(e,t).post((function(i){if(i.class){var n=jQuery(t.target);n.closest("tr").removeClass("status-pending status-publish").addClass(i.class),n.closest("td.column-title").find("strong").html(i.link),i.counts&&(n.closest(".wrap").find("ul.subsubsub").html(i.counts),jQuery("#menu-posts-site-review").find(".awaiting-mod").removeClass().addClass("awaiting-mod count-"+i.pending).find(".unapproved-count").html(i.pending))}}))}}};var R=A,$=function(){this.button=jQuery("button#sync-reviews"),this.progressbar=jQuery(".glsr-progress"),this.service=null,jQuery("form.glsr-form-sync").on("click","#sync-reviews",this.ti.bind(this)),jQuery(document).on("wp-window-resized",this.ii),jQuery(window).on("hashchange",this.ii),this.ii()};$.prototype={ni:function(t){jQuery(".service-"+this.service+" td.column-last_sync").text(t.last_sync),jQuery(".service-"+this.service+" td.column-total_fetched a").text(t.total),this.ei(!1)},ti:function(t){t.preventDefault(),this.service=jQuery('[name="'+GLSR.nameprefix+'[service]"]').val(),this.service&&(this.ei(!0),this.si())},ii:function(){var t=jQuery(".glsr-progress").width();t&&jQuery(".glsr-progress span").width(t)},si:function(){var t={_action:"sync-reviews",service:this.service,stage:"fetch"};new o(t).post(this.ri.bind(this))},ri:function(t){var i={_action:"sync-reviews",job_id:t.job_id,service:this.service,stage:"progress"},n=t.finished?this.oi.bind(this,t):this.ri.bind(this);this.ai(t.message),this.ui(t.percent),setTimeout((function(){new o(i).post(n)}),1500)},oi:function(t){var i=0;try{i=t.meta.pagination.current_page}catch(t){}var n={_action:"sync-reviews",page:i+1,service:this.service,stage:"reviews"};this.ai(t.message),t.percent_synced&&t.percent_synced>=100?this.ni(t):new o(n).post(this.oi.bind(this))},ai:function(t){jQuery(".glsr-progress-status",this.progressbar).text(t)},ui:function(t){t=(t||0)+"%",jQuery(".glsr-progress-bar",this.progressbar).outerWidth(t)},ei:function(t){if(!0===t&&(this.ai(this.progressbar.data("active-text")),this.ui(),this.button.prop("disabled",!0),window.requestAnimationFrame(function(){this.progressbar.addClass("active")}.bind(this))),!1===t)return this.service=null,this.button.prop("disabled",!1),void this.progressbar.removeClass("active");window.requestAnimationFrame(this.ei.bind(this))}};var L=$,C=function(t){this.options=jQuery.extend({},this.defaults,t),this.active=document.querySelector("input[name=_active_tab]"),this.referrer=document.querySelector("input[name=_wp_http_referer]"),this.tabs=document.querySelectorAll(this.options.tabSelector),this.views=document.querySelectorAll(this.options.viewSelector),this.active&&this.referrer&&this.tabs&&this.views&&this.k()};C.prototype={defaults:{tabSelector:".glsr-nav-tab",viewSelector:".glsr-nav-view"},k:function(){var t=this;jQuery(window).on("hashchange",t.ci.bind(t)),[].forEach.call(t.tabs,function(i,n){(location.hash?i.getAttribute("href").slice(1)===location.hash.slice(5):0===n)&&t.hi(i),i.addEventListener("click",t.ht.bind(t)),i.addEventListener("touchend",t.ht.bind(t))}.bind(t)),jQuery(t.options.viewSelector).on("click","a",(function(){var i=jQuery(this).data("expand");localStorage.setItem("glsr-expand",i),t.li(jQuery(i))})),jQuery(window).on("load",(function(){t.li(jQuery(localStorage.getItem("glsr-expand")))}))},fi:function(t){return t?"add":"remove"},ht:function(t){t.preventDefault();var i=t.currentTarget;i.blur(),this.di(i),this.hi(i),location.hash="tab-"+i.getAttribute("href").slice(1)},ci:function(){for(var t=location.hash.split("#tab-")[1],i=0;i<this.views.length;i++)if(t===this.views[i].id){this.hi(this.tabs[i]);break}},li:function(t){if(t.length){var i=t.parent().parent();i.removeClass("collapsed"),this.pi(i),i.removeClass("collapsed"),t.parent().removeClass("closed").find(".glsr-accordion-trigger").attr("aria-expanded",!0),window.setTimeout((function(){t.parent()[0].scrollIntoView({behavior:"smooth",block:"center"}),localStorage.removeItem("glsr-expand")}),10)}},vi:function(t){var i=this.referrer.value.split("#")[0]+"#tab-"+this.views[t].id;this.referrer.value=i},hi:function(t){[].forEach.call(this.tabs,function(i,n){var e=this.fi(i===t);"add"===e&&(this.active.value=this.views[n].id,this.vi(n),this.gi(n)),i.classList[e]("nav-tab-active")}.bind(this))},gi:function(t){[].forEach.call(this.views,function(i,n){var e=this.fi(n!==t);i.classList[e]("ui-tabs-hide")}.bind(this))},pi:function(t){var i=t.hasClass("collapsed")?"remove":"add";t[i+"Class"]("collapsed").find(".glsr-card.postbox")[i+"Class"]("closed").find(".glsr-accordion-trigger").attr("aria-expanded","add"!==i)},di:function(t){if(t.classList.contains("nav-tab-active")){var i=jQuery(t.getAttribute("href"));this.pi(i)}}};var z=C,E=function(){var t=document.querySelector("#contentdiv > textarea");t&&(this.mi(t),jQuery(document).on("wp-window-resized.editor-expand",function(){this.mi(t)}.bind(this)))};E.prototype={mi:function(t){var i=t.scrollHeight>320?t.scrollHeight:320;t.style.height="auto",t.style.height=i+"px"}};var G=E,T=function(){jQuery("form").on("click","#clear-console",this.yi,this.ht.bind(this)),jQuery("form").on("click","#fetch-console",this.yi,this.ht.bind(this)),jQuery("form").on("click","[data-ajax-click]",this.ht.bind(this));var t=jQuery("input[data-alt]");t.length&&(jQuery(document).on("keydown",this.bi.bind(this,t)),jQuery(document).on("keyup",this.wi.bind(this,t)))};T.prototype={yi:function(t,i){i&&jQuery("#log-file").val(t.console)},ht:function(t){new o({},t,t.currentTarget.closest("form")).post((function(i,n){"function"==typeof t.data&&t.data(i,n),jQuery("html, body").animate({scrollTop:0},500),jQuery("#glsr-notices").on("click","a",(function(){localStorage.setItem("glsr-expand",jQuery(this).data("expand"))})),jQuery('.glsr-notice[data-notice="'+jQuery(t.currentTarget).data("remove-notice")+'"]').remove()}))},bi:function(t,i){GLSR.keys.ALT!==i.keyCode||i.repeat||(t.closest("form").find("[data-alt-text]").addClass("alt"),t.val(1))},wi:function(t,i){GLSR.keys.ALT===i.keyCode&&(t.closest("form").find("[data-alt-text]").removeClass("alt"),t.val(0))}};var O=T;GLSR.keys={ALT:18,DOWN:40,ENTER:13,ESC:27,SPACE:32,UP:38},jQuery((function(t){j.a.highlightAll(),GLSR.notices=new v,GLSR.shortcode=new x(".glsr-mce"),GLSR.stars=new P.a(document.querySelectorAll("select.glsr-star-rating"),{showText:!1}),c(),new l("form.glsr-form"),new d,new m,new b,new S("#glsr-search-posts",{action:"search-posts",onInit:function(){this.el.find(".glsr-remove-button").on("click",this.Et.bind(this))},onResultClick:function(i){var n=t(i.currentTarget),e=wp.template("glsr-assigned-posts"),s={id:n.data("id"),name:"post_ids[]",url:n.data("url"),title:n.text()};if(e){var r=t(e(s));r.find(".glsr-remove-button").on("click",this.Et.bind(this)),this.el.find(".glsr-selected-entries").append(r),this.zt()}this.options.searchEl.focus()}}),new S("#glsr-search-users",{action:"search-users",onInit:function(){this.el.find(".glsr-remove-button").on("click",this.Et.bind(this))},onResultClick:function(i){var n=t(i.currentTarget),e=wp.template("glsr-assigned-users"),s={id:n.data("id"),name:"user_ids[]",url:n.data("url"),title:n.text()};if(e){var r=t(e(s));r.find(".glsr-remove-button").on("click",this.Et.bind(this)),this.el.find(".glsr-selected-entries").append(r),this.zt()}this.options.searchEl.focus()}}),new S("#glsr-search-translations",{action:"search-translations",onInit:function(){this.$t()},onResultClick:function(i){var n=t(i.currentTarget),e=n.data("entry"),s=wp.template("glsr-string-"+(e.p1?"plural":"single"));e.index=this.options.entriesEl.children().length,e.prefix=this.options.resultsEl.data("prefix"),s&&(this.options.entriesEl.append(s(e)),this.options.exclude.push({id:e.id}),this.options.results=this.options.results.filter((function(t,i){return i!==n.get(0)}))),this.Pt()}}),new R("a.glsr-toggle-status"),new z,new G,new O,new L;var i=function(){this.dataset.glsrTrack=this.value};t("select[data-glsr-track]").each(i),t("select[data-glsr-track]").on("change",i),t(".glsr-card.postbox:not(.open)").addClass("closed").find(".glsr-accordion-trigger").attr("aria-expanded",!1).closest(".glsr-nav-view").addClass("collapsed"),t(".glsr-support-step").not(":checked").length<1&&t(".glsr-card-result").removeClass("hidden"),t(".glsr-support-step").on("change",(function(){var i=t(".glsr-support-step").not(":checked").length>0?"add":"remove";t(".glsr-card-result")[i+"Class"]("hidden")})),t(".glsr-card.postbox .glsr-card-heading").on("click",(function(){var i=t(this).parent(),n=i.closest(".glsr-nav-view"),e=i.hasClass("closed")?"remove":"add";i[e+"Class"]("closed").find(".glsr-accordion-trigger").attr("aria-expanded","add"!==e),e=n.find(".glsr-card.postbox").not(".closed").length>0?"remove":"add",n[e+"Class"]("collapsed")}))}))}]);
1
  /*! For license information please see site-reviews-admin.js.LICENSE.txt */
2
+ !function(t){var i={};function n(e){if(i[e])return i[e].exports;var s=i[e]={i:e,l:!1,exports:{}};return t[e].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=i,n.d=function(t,i,e){n.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,i){if(1&i&&(t=n(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var s in t)n.d(e,s,function(i){return t[i]}.bind(null,s));return e},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,"a",i),i},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},n.p="/",n(n.s=8)}([,function(t,i){function n(i){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(i)}t.exports=n},function(t,i,n){var e;!function(n,s,r){"use strict";var o=function(t,i){var n={}.toString.call(t);this.selects="[object String]"===n?s.querySelectorAll(t):"[object NodeList]"===n?t:[t],this.destroy=function(){this.widgets.forEach((function(t){t.u()}))},this.rebuild=function(){this.widgets.forEach((function(t){t.h()}))},this.widgets=[];for(var e=0;e<this.selects.length;e++)if("SELECT"===this.selects[e].tagName&&!this.selects[e]["star-rating"]){var r=new a(this.selects[e],i);void 0!==r.direction&&this.widgets.push(r)}},a=function(t,i){this.el=t,this.v=this.g({},this._,i||{},JSON.parse(t.getAttribute("data-options"))),this.j(),this.stars<1||this.stars>this.v.maxStars||this.h()};a.prototype={_:{classname:"gl-star-rating",clearable:!0,initialText:"Select a Rating",maxStars:10,showText:!0},k:function(){this.S(),this.current=this.selected=this.F(),this.P(),this.A(),this.R(),this.$(this.current),this.L("add"),this.el["star-rating"]=!0},C:function(){this.v.showText&&(this.textEl=this.G(this.widgetEl,{class:this.v.classname+"-text"},!0))},A:function(){var t=this.T(),i=this.G(this.el,{class:this.v.classname+"-stars"},!0);for(var n in t){var e=this.O({"data-value":n,"data-text":t[n]});i.innerHTML+=e.outerHTML}this.widgetEl=i,this.C()},D:function(t){(t<0||isNaN(t))&&(t=0),t>this.stars&&(t=this.stars),this.widgetEl.classList.remove("s"+10*this.current),this.widgetEl.classList.add("s"+10*t),this.v.showText&&(this.textEl.textContent=t<1?this.v.initialText:this.widgetEl.childNodes[t-1].dataset.text),this.current=t},O:function(t){var i=s.createElement("span");for(var n in t=t||{})i.setAttribute(n,t[n]);return i},u:function(){this.L("remove");var t=this.el.parentNode;t.parentNode.replaceChild(this.el,t),delete this.el["star-rating"]},I:function(t,i,n,e){e=e||!1,n.forEach(function(n){this.events&&t[i+"EventListener"](n,this.events[n],e)}.bind(this))},g:function(){var t=[].slice.call(arguments),i=t[0],n=t.slice(1);return Object.keys(n).forEach((function(t){for(var e in n[t])n[t].hasOwnProperty(e)&&(i[e]=n[t][e])})),i},N:function(){var t=!1;try{var i=Object.defineProperty({},"passive",{get:function(){t={passive:!1}}});n.addEventListener("test",null,i)}catch(t){}return t},M:function(t){var i={},n=t.pageX||t.changedTouches[0].pageX,e=this.widgetEl.offsetWidth;return i.ltr=Math.max(n-this.offsetLeft,1),i.rtl=e-i.ltr,Math.min(Math.ceil(i[this.direction]/Math.round(e/this.stars)),this.stars)},T:function(){for(var t=this.el,i={},n={},e=0;e<t.length;e++)this.V(t[e])||(i[t[e].value]=t[e].text);return Object.keys(i).sort().forEach((function(t){n[t]=i[t]})),n},F:function(){return parseInt(this.el.options[Math.max(this.el.selectedIndex,0)].value)||0},L:function(t){var i=this.el.closest("form");i&&"FORM"===i.tagName&&this.I(i,t,["reset"]),"add"===t&&this.el.disabled||(this.I(this.el,t,["change","keydown"]),this.I(this.widgetEl,t,["mousedown","mouseleave","mousemove","mouseover","touchend","touchmove","touchstart"],this.N()))},S:function(){this.events={change:this.Z.bind(this),keydown:this.W.bind(this),mousedown:this.q.bind(this),mouseleave:this.B.bind(this),mousemove:this.H.bind(this),mouseover:this.K.bind(this),reset:this.U.bind(this),touchend:this.q.bind(this),touchmove:this.H.bind(this),touchstart:this.K.bind(this)}},G:function(t,i,n){var e=this.O(i);return t.parentNode.insertBefore(e,!0===n?t.nextSibling:t),e},V:function(t){return null===t.getAttribute("value")||""===t.value},Z:function(){this.D(this.F())},W:function(t){if(~["ArrowLeft","ArrowRight"].indexOf(t.key)){var i="ArrowLeft"===t.key?-1:1;"rtl"===this.direction&&(i*=-1),this.$(Math.min(Math.max(this.F()+i,0),this.stars)),this.J()}},q:function(t){t.preventDefault();var i=this.M(t);0!==this.current&&parseFloat(this.selected)===i&&this.v.clearable&&(i=0),this.$(i),this.J()},B:function(t){t.preventDefault(),this.D(this.selected)},H:function(t){t.preventDefault(),this.D(this.M(t))},K:function(t){t.preventDefault();var i=this.widgetEl.getBoundingClientRect();this.offsetLeft=i.left+s.body.scrollLeft},U:function(){var t=this.el.querySelector("[selected]"),i=t?t.value:"";this.el.value=i,this.selected=parseInt(i)||0,this.D(i)},h:function(){this.el.parentNode.classList.contains(this.v.classname)&&this.u(),this.k()},R:function(){var t=this.el.parentNode;this.direction=n.getComputedStyle(t,null).getPropertyValue("direction"),t.classList.add(this.v.classname+"-"+this.direction)},$:function(t){this.el.value=this.selected=t,this.D(t)},j:function(){var t=this.el;this.stars=0;for(var i=0;i<t.length;i++)if(!this.V(t[i])){if(isNaN(parseFloat(t[i].value))||!isFinite(t[i].value))return void(this.stars=0);this.stars++}},J:function(){this.el.dispatchEvent(new Event("change"))},P:function(){this.G(this.el,{class:this.v.classname,"data-star-rating":""}).appendChild(this.el)}},void 0===(e=function(){return o}.apply(i,[]))||(t.exports=e)}(window,document)},function(t,i,n){(function(i){var n=function(t){var i=/\blang(?:uage)?-([\w-]+)\b/i,n=0,e={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function t(i){return i instanceof s?new s(i.type,t(i.content),i.alias):Array.isArray(i)?i.map(t):i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++n}),t.__id},clone:function t(i,n){var s,r;switch(n=n||{},e.util.type(i)){case"Object":if(r=e.util.objId(i),n[r])return n[r];for(var o in s={},n[r]=s,i)i.hasOwnProperty(o)&&(s[o]=t(i[o],n));return s;case"Array":return r=e.util.objId(i),n[r]?n[r]:(s=[],n[r]=s,i.forEach((function(i,e){s[e]=t(i,n)})),s);default:return i}},getLanguage:function(t){for(;t&&!i.test(t.className);)t=t.parentElement;return t?(t.className.match(i)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(e){var t=(/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(e.stack)||[])[1];if(t){var i=document.getElementsByTagName("script");for(var n in i)if(i[n].src==t)return i[n]}return null}},isActive:function(t,i,n){for(var e="no-"+i;t;){var s=t.classList;if(s.contains(i))return!0;if(s.contains(e))return!1;t=t.parentElement}return!!n}},languages:{extend:function(t,i){var n=e.util.clone(e.languages[t]);for(var s in i)n[s]=i[s];return n},insertBefore:function(t,i,n,s){var r=(s=s||e.languages)[t],o={};for(var a in r)if(r.hasOwnProperty(a)){if(a==i)for(var u in n)n.hasOwnProperty(u)&&(o[u]=n[u]);n.hasOwnProperty(a)||(o[a]=r[a])}var c=s[t];return s[t]=o,e.languages.DFS(e.languages,(function(i,n){n===c&&i!=t&&(this[i]=o)})),o},DFS:function t(i,n,s,r){r=r||{};var o=e.util.objId;for(var a in i)if(i.hasOwnProperty(a)){n.call(i,a,i[a],s||a);var u=i[a],c=e.util.type(u);"Object"!==c||r[o(u)]?"Array"!==c||r[o(u)]||(r[o(u)]=!0,t(u,n,a,r)):(r[o(u)]=!0,t(u,n,null,r))}}},plugins:{},highlightAll:function(t,i){e.highlightAllUnder(document,t,i)},highlightAllUnder:function(t,i,n){var s={callback:n,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};e.hooks.run("before-highlightall",s),s.elements=Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)),e.hooks.run("before-all-elements-highlight",s);for(var r,o=0;r=s.elements[o++];)e.highlightElement(r,!0===i,s.callback)},highlightElement:function(n,s,r){var o=e.util.getLanguage(n),a=e.languages[o];n.className=n.className.replace(i,"").replace(/\s+/g," ")+" language-"+o;var u=n.parentElement;u&&"pre"===u.nodeName.toLowerCase()&&(u.className=u.className.replace(i,"").replace(/\s+/g," ")+" language-"+o);var c={element:n,language:o,grammar:a,code:n.textContent};function h(t){c.highlightedCode=t,e.hooks.run("before-insert",c),c.element.innerHTML=c.highlightedCode,e.hooks.run("after-highlight",c),e.hooks.run("complete",c),r&&r.call(c.element)}if(e.hooks.run("before-sanity-check",c),!c.code)return e.hooks.run("complete",c),void(r&&r.call(c.element));if(e.hooks.run("before-highlight",c),c.grammar)if(s&&t.Worker){var l=new Worker(e.filename);l.onmessage=function(t){h(t.data)},l.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else h(e.highlight(c.code,c.grammar,c.language));else h(e.util.encode(c.code))},highlight:function(t,i,n){var r={code:t,grammar:i,language:n};return e.hooks.run("before-tokenize",r),r.tokens=e.tokenize(r.code,r.grammar),e.hooks.run("after-tokenize",r),s.stringify(e.util.encode(r.tokens),r.language)},tokenize:function(t,i){var n=i.rest;if(n){for(var u in n)i[u]=n[u];delete i.rest}var c=new r;return o(c,c.head,t),function t(i,n,r,u,c,h){for(var l in r)if(r.hasOwnProperty(l)&&r[l]){var d=r[l];d=Array.isArray(d)?d:[d];for(var f=0;f<d.length;++f){if(h&&h.cause==l+","+f)return;var p=d[f],v=p.inside,g=!!p.lookbehind,m=!!p.greedy,y=0,b=p.alias;if(m&&!p.pattern.global){var w=p.pattern.toString().match(/[imsuy]*$/)[0];p.pattern=RegExp(p.pattern.source,w+"g")}for(var _=p.pattern||p,j=u.next,k=c;j!==n.tail&&!(h&&k>=h.reach);k+=j.value.length,j=j.next){var S=j.value;if(n.length>i.length)return;if(!(S instanceof s)){var Q=1;if(m&&j!=n.tail.prev){if(_.lastIndex=k,!(R=_.exec(i)))break;var x=R.index+(g&&R[1]?R[1].length:0),F=R.index+R[0].length,P=k;for(P+=j.value.length;x>=P;)j=j.next,P+=j.value.length;if(P-=j.value.length,k=P,j.value instanceof s)continue;for(var A=j;A!==n.tail&&(P<F||"string"==typeof A.value);A=A.next)Q++,P+=A.value.length;Q--,S=i.slice(k,P),R.index-=k}else{_.lastIndex=0;var R=_.exec(S)}if(R){g&&(y=R[1]?R[1].length:0);x=R.index+y;var $=R[0].slice(y),L=(F=x+$.length,S.slice(0,x)),C=S.slice(F),z=k+S.length;h&&z>h.reach&&(h.reach=z);var E=j.prev;L&&(E=o(n,E,L),k+=L.length),a(n,E,Q);var G=new s(l,v?e.tokenize($,v):$,b,$);j=o(n,E,G),C&&o(n,j,C),Q>1&&t(i,n,r,j.prev,k,{cause:l+","+f,reach:z})}}}}}}(t,c,i,c.head,0),function(t){var i=[],n=t.head.next;for(;n!==t.tail;)i.push(n.value),n=n.next;return i}(c)},hooks:{all:{},add:function(t,i){var n=e.hooks.all;n[t]=n[t]||[],n[t].push(i)},run:function(t,i){var n=e.hooks.all[t];if(n&&n.length)for(var s,r=0;s=n[r++];)s(i)}},Token:s};function s(t,i,n,e){this.type=t,this.content=i,this.alias=n,this.length=0|(e||"").length}function r(){var t={value:null,prev:null,next:null},i={value:null,prev:t,next:null};t.next=i,this.head=t,this.tail=i,this.length=0}function o(t,i,n){var e=i.next,s={value:n,prev:i,next:e};return i.next=s,e.prev=s,t.length++,s}function a(t,i,n){for(var e=i.next,s=0;s<n&&e!==t.tail;s++)e=e.next;i.next=e,e.prev=i,t.length-=s}if(t.Prism=e,s.stringify=function t(i,n){if("string"==typeof i)return i;if(Array.isArray(i)){var s="";return i.forEach((function(i){s+=t(i,n)})),s}var r={type:i.type,content:t(i.content,n),tag:"span",classes:["token",i.type],attributes:{},language:n},o=i.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(r.classes,o):r.classes.push(o)),e.hooks.run("wrap",r);var a="";for(var u in r.attributes)a+=" "+u+'="'+(r.attributes[u]||"").replace(/"/g,"&quot;")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+a+">"+r.content+"</"+r.tag+">"},!t.document)return t.addEventListener?(e.disableWorkerMessageHandler||t.addEventListener("message",(function(i){var n=JSON.parse(i.data),s=n.language,r=n.code,o=n.immediateClose;t.postMessage(e.highlight(r,e.languages[s],s)),o&&t.close()}),!1),e):e;var u=e.util.currentScript();function c(){e.manual||e.highlightAll()}if(u&&(e.filename=u.src,u.hasAttribute("data-manual")&&(e.manual=!0)),!e.manual){var h=document.readyState;"loading"===h||"interactive"===h&&u&&u.defer?document.addEventListener("DOMContentLoaded",c):window.requestAnimationFrame?window.requestAnimationFrame(c):window.setTimeout(c,16)}return e}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});t.exports&&(t.exports=n),void 0!==i&&(i.Prism=n)}).call(this,n(9))},,,,,function(t,i,n){t.exports=n(26)},function(t,i){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,i){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},function(t,i){Prism.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,i){var n={};n["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[i]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var e={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};e["language-"+i]={pattern:/[\s\S]+/,inside:Prism.languages[i]};var s={};s[t]={pattern:RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return t})),"i"),lookbehind:!0,greedy:!0,inside:e},Prism.languages.insertBefore("markup","cdata",s)}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},function(t,i){Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript},function(t,i){!function(t){function i(t,i){return"___"+t.toUpperCase()+i+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,e,s,r){if(n.language===e){var o=n.tokenStack=[];n.code=n.code.replace(s,(function(t){if("function"==typeof r&&!r(t))return t;for(var s,a=o.length;-1!==n.code.indexOf(s=i(e,a));)++a;return o[a]=t,s})),n.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(n,e){if(n.language===e&&n.tokenStack){n.grammar=t.languages[e];var s=0,r=Object.keys(n.tokenStack);!function o(a){for(var u=0;u<a.length&&!(s>=r.length);u++){var c=a[u];if("string"==typeof c||c.content&&"string"==typeof c.content){var h=r[s],l=n.tokenStack[h],d="string"==typeof c?c:c.content,f=i(e,h),p=d.indexOf(f);if(p>-1){++s;var v=d.substring(0,p),g=new t.Token(e,t.tokenize(l,n.grammar),"language-"+e,l),m=d.substring(p+f.length),y=[];v&&y.push.apply(y,o([v])),y.push(g),m&&y.push.apply(y,o([m])),"string"==typeof c?a.splice.apply(a,[u,1].concat(y)):c.content=y}}else c.content&&o(c.content)}return a}(n.tokens)}}}})}(Prism)},function(t,i){!function(t){t.languages.php=t.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),t.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),t.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),t.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),t.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var i={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:t.languages.php};t.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:i}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:i}}}),delete t.languages.php.string,t.hooks.add("before-tokenize",(function(i){if(/<\?/.test(i.code)){t.languages["markup-templating"].buildPlaceholders(i,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}})),t.hooks.add("after-tokenize",(function(i){t.languages["markup-templating"].tokenizePlaceholders(i,"php")}))}(Prism)},function(t,i){!function(t){var i=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+i.source+")*?(?=\\s*\\{)"),string:{pattern:i,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),t.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:n.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:t.languages.css}},alias:"language-css"}},n.tag))}(Prism)},function(t,i){!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var t=/\n(?!$)/g,i=Prism.plugins.lineNumbers={getLine:function(t,i){if("PRE"===t.tagName&&t.classList.contains("line-numbers")){var n=t.querySelector(".line-numbers-rows"),e=parseInt(t.getAttribute("data-start"),10)||1,s=e+(n.children.length-1);i<e&&(i=e),i>s&&(i=s);var r=i-e;return n.children[r]}},resize:function(t){s([t])},assumeViewportIndependence:!0},n=function(t){return t?window.getComputedStyle?getComputedStyle(t):t.currentStyle||null:null},e=void 0;window.addEventListener("resize",(function(){i.assumeViewportIndependence&&e===window.innerWidth||(e=window.innerWidth,s(Array.prototype.slice.call(document.querySelectorAll("pre.line-numbers"))))})),Prism.hooks.add("complete",(function(i){if(i.code){var n=i.element,e=n.parentNode;if(e&&/pre/i.test(e.nodeName)&&!n.querySelector(".line-numbers-rows")&&Prism.util.isActive(n,"line-numbers")){n.classList.remove("line-numbers"),e.classList.add("line-numbers");var r,o=i.code.match(t),a=o?o.length+1:1,u=new Array(a+1).join("<span></span>");(r=document.createElement("span")).setAttribute("aria-hidden","true"),r.className="line-numbers-rows",r.innerHTML=u,e.hasAttribute("data-start")&&(e.style.counterReset="linenumber "+(parseInt(e.getAttribute("data-start"),10)-1)),i.element.appendChild(r),s([e]),Prism.hooks.run("line-numbers",i)}}})),Prism.hooks.add("line-numbers",(function(t){t.plugins=t.plugins||{},t.plugins.lineNumbers=!0}))}function s(i){if(0!=(i=i.filter((function(t){var i=n(t)["white-space"];return"pre-wrap"===i||"pre-line"===i}))).length){var e=i.map((function(i){var n=i.querySelector("code"),e=i.querySelector(".line-numbers-rows");if(n&&e){var s=i.querySelector(".line-numbers-sizer"),r=n.textContent.split(t);s||((s=document.createElement("span")).className="line-numbers-sizer",n.appendChild(s)),s.innerHTML="0",s.style.display="block";var o=s.getBoundingClientRect().height;return s.innerHTML="",{element:i,lines:r,lineHeights:[],oneLinerHeight:o,sizer:s}}})).filter(Boolean);e.forEach((function(t){var i=t.sizer,n=t.lines,e=t.lineHeights,s=t.oneLinerHeight;e[n.length-1]=void 0,n.forEach((function(t,n){if(t&&t.length>1){var r=i.appendChild(document.createElement("span"));r.style.display="block",r.textContent=t}else e[n]=s}))})),e.forEach((function(t){for(var i=t.sizer,n=t.lineHeights,e=0,s=0;s<n.length;s++)void 0===n[s]&&(n[s]=i.children[e++].getBoundingClientRect().height)})),e.forEach((function(t){var i=t.sizer,n=t.element.querySelector(".line-numbers-rows");i.style.display="none",i.innerHTML="",t.lineHeights.forEach((function(t,i){n.children[i].style.height=t+"px"}))}))}}}()},,,,,,,,,,function(t,i,n){"use strict";n.r(i);var e=function(t){return this.data={},this.form=jQuery(t),this.pushes={},this.init()};e.prototype={patterns:{validate:/^[a-z_-][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_-]+)\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,named:/^[a-z0-9_-]+$/i,push:/^$/,fixed:/^\d+$/},addPair:function(t){this.patterns.validate.test(t.name)&&(this.data=jQuery.extend(!0,this.data,this.makeObject(t.name,this.encode(t))))},build:function(t,i,n){return t[i]=n,t},encode:function(t){switch(jQuery('[name="'+t.name+'"]',this.form).attr("type")){case"checkbox":return"on"===t.value||t.value;default:return t.value}},incrementPush:function(t){return void 0===this.pushes[t]&&(this.pushes[t]=0),this.pushes[t]++},init:function(){var t=this.form.serializeArray();if(jQuery.isArray(t))for(var i=0,n=t.length;i<n;i++)this.addPair(t[i]);return this.data},makeObject:function(t,i){for(var n,e=t.match(this.patterns.key);void 0!==(n=e.pop());)if(this.patterns.push.test(n)){var s=this.incrementPush(t.replace(/\[\]$/,""));i=this.build([],s,i)}else this.patterns.fixed.test(n)?i=this.build([],n,i):this.patterns.named.test(n)&&(i=this.build({},n,i));return i}};var s=e,r=function(t,i,n){this.event=i||null,this.form=n||null,this.notice=null,this.request=t||{}};r.prototype={post:function(t){this.event?this.Y(t):this.X(t)},tt:function(t){var i={action:GLSR.action,_ajax_request:!0};if(this.form){var n=new s(this.form);n[GLSR.nameprefix]&&(this.request=n[GLSR.nameprefix])}return this.it(t),i[GLSR.nameprefix]=this.request,i},it:function(t){this.request._nonce||(GLSR.nonce[this.request._action]?this.request._nonce=GLSR.nonce[this.request._action]:t&&(this.request._nonce=t.closest("form").find("#_wpnonce").val()))},X:function(t,i){jQuery.post(GLSR.ajaxurl,this.tt(i)).done((function(n){"function"==typeof t&&t(n.data,n.success),i&&i.prop("disabled",!1)})).always((function(t){t.data?t.data.notices&&GLSR.notices.add(t.data.notices):GLSR.notices.add('<div class="notice notice-error inline is-dismissible"><p>Unknown error.</p></div>')}))},Y:function(t){this.event.preventDefault();var i=jQuery(this.event.currentTarget);i.is(":disabled")||(i.prop("disabled",!0),this.X(t,i))}};var o=r,a=n(1),u=n.n(a),c=function(){"object"===u()(jQuery.wp)&&"function"==typeof jQuery.wp.wpColorPicker&&jQuery(document).find("input[type=text].color-picker-hex").each((function(){jQuery(this).wpColorPicker(jQuery(this).data("colorpicker")||{})}))},h=function(t){this.el=document.querySelector(t),this.el&&(this.depends=this.el.querySelectorAll("[data-depends]"),this.depends.length&&this.k())};h.prototype={nt:function(t){var i=t.getAttribute("data-depends");if(i)try{return JSON.parse(i)}catch(t){return}},k:function(){for(var t=this.el.elements,i=0;i<t.length;i++)~["INPUT","SELECT"].indexOf(t[i].nodeName)&&t[i].addEventListener("change",this.Z.bind(this))},et:function(t,i){var n=!1;i=[].concat(i);var e=this.el.querySelectorAll('[name="'+t+'"]');return[].map.call(e,function(t){var e=~this.st(i).indexOf(this.rt(t.value));~["checkbox","radio"].indexOf(t.type)?t.checked&&e&&(n=!0):e&&(n=!0)}.bind(this)),n},rt:function(t){return!!~["true","on","yes","1"].indexOf(t)||!~["false","off","no","0"].indexOf(t)&&t},st:function(t){return t.map(this.rt)},Z:function(t){this.depends.forEach(function(i){var n=this.nt(i);if(n&&~n.map((function(t){return t.name})).indexOf(t.currentTarget.name)){var e=!0;n.forEach(function(t){this.et(t.name,t.value)||(e=!1)}.bind(this)),this.ot(i,e)}}.bind(this))},ot:function(t,i){var n=t.closest(".glsr-setting-field");n&&n.classList[i?"remove":"add"]("hidden")}};var l=h,d=function(){jQuery(".glsr-metabox-field .glsr-toggle__input").on("change",this.at.bind(this)),jQuery(".glsr-metabox-field input[type=url]").on("change",this.ut.bind(this))};d.prototype={ut:function(t){var i=jQuery(t.currentTarget);this.ct(i.parent().find("img"),i.val())},at:function(t){var i=t.currentTarget.checked;jQuery(".glsr-input-value").each(function(t,n){if(i)jQuery(n).data("value",n.value);else{if(n.value=jQuery(n).data("value"),"url"!==n.type)return;this.ct(jQuery(n).parent().find("img"),n.value)}}.bind(this)),jQuery(".glsr-input-value").prop("disabled",!i),GLSR.stars.rebuild()},ct:function(t,i){if(t){var n=new Image;n.src=i,n.onerror=function(){t.attr("src",t.data("fallback"))},n.onload=function(){t.attr("src",n.src)}}}};var f=d,p=function(){this.k()};p.prototype={add:function(t){t&&(jQuery("#glsr-notices").length||(jQuery("#message.notice").remove(),jQuery("hr.wp-header-end").after('<div id="glsr-notices" />')),jQuery("#glsr-notices").html(t),jQuery(document).trigger("wp-updates-notice-added"))},k:function(){jQuery(".glsr-notice[data-dismiss]").on("click.wp-dismiss-notice",this.ht.bind(this))},ht:function(t){var i={};i[GLSR.nameprefix]={_action:"dismiss-notice",notice:jQuery(t.currentTarget).data("dismiss")},wp.ajax.post(GLSR.action,i)}};var v=p,g=function(){this.el=jQuery("#pinned-status-select"),this.el&&(this.cancel=jQuery("a.cancel-pinned-status"),this.cancel.on("click",this.lt.bind(this)),this.edit=jQuery("a.edit-pinned-status"),this.edit.on("click",this.dt.bind(this)),this.save=jQuery("a.save-pinned-status"),this.save.on("click",this.ft.bind(this))),jQuery("td.column-is_pinned i.pin-review").on("click",this.pt.bind(this))};g.prototype={vt:function(){this.el.slideUp("fast"),this.edit.show().focus()},lt:function(t){t.preventDefault(),this.vt(),this.el.find("select").val("0"===jQuery("#hidden-pinned-status").val()?1:0)},dt:function(t){t.preventDefault(),this.el.is(":hidden")&&(this.el.slideDown("fast",function(){this.el.find("select").focus()}.bind(this)),this.edit.hide())},ft:function(t){t.preventDefault(),this.vt(),this.target=t.currentTarget;var i={_action:"toggle-pinned",id:jQuery("#post_ID").val(),pinned:jQuery("#pinned-status").val()};new o(i).post(this.gt.bind(this))},pt:function(t){t.preventDefault(),this.target=t.currentTarget;var i={_action:"toggle-pinned",id:t.currentTarget.getAttribute("data-id")};jQuery(this.target).addClass("spinner is-active").removeClass("dashicons-sticky"),new o(i).post(this.yt.bind(this))},gt:function(t){jQuery("#pinned-status").val(0|!t.pinned),jQuery("#hidden-pinned-status").val(0|t.pinned),jQuery("#pinned-status-text").text(t.pinned?this.target.dataset.yes:this.target.dataset.no),GLSR.notices.add(t.notices)},yt:function(t){this.target.classList[t.pinned?"add":"remove"]("pinned"),jQuery(this.target).removeClass("spinner is-active").addClass("dashicons-sticky")}};var m=g,y=function(){jQuery.each(GLSR.pointers,function(t,i){this.k(i)}.bind(this))};y.prototype={bt:function(t){jQuery.post(GLSR.ajaxurl,{action:"dismiss-wp-pointer",pointer:t})},k:function(t){jQuery(t.target).pointer({content:t.options.content,position:t.options.position,close:this.bt.bind(null,t.id)}).pointer("open").pointer("sendToTop"),jQuery(document).on("wp-window-resized",(function(){jQuery(t.target).pointer("reposition")}))}};var b=y,w=n(3),j=n.n(w),k=(n(10),n(11),n(12),n(13),n(14),n(15),n(16),function(t,i){this.el=jQuery(t),this.options=i,this.searchTerm=null,this.k()});k.prototype={defaults:{action:null,exclude:[],onInit:null,onResultClick:null,results:{},selected:-1,selectedClass:"glsr-selected-result",selectorEntries:".glsr-strings-table tbody",selectorResults:".glsr-search-results",selectorSearch:".glsr-search-input"},k:function(){this.options=jQuery.extend({},this.defaults,this.options),this.el.length&&(this.options.entriesEl=this.el.parent().find(this.options.selectorEntries),this.options.resultsEl=this.el.find(this.options.selectorResults),this.options.searchEl=this.el.find(this.options.selectorSearch),this.options.searchEl.attr("aria-describedby","live-search-desc"),"function"==typeof this.options.onInit&&this.options.onInit.call(this),this.S())},S:function(){this.options.searchEl.on("input",_.debounce(this.wt.bind(this),500)),this.options.searchEl.on("keyup",this._t.bind(this)),this.options.searchEl.on("keydown keypress",(function(t){GLSR.keys.ENTER===t.which&&t.preventDefault()})),jQuery(document).on("click",this.jt.bind(this)),jQuery(document).on("keydown",this.kt.bind(this))},St:function(){void 0!==this.searchRequest&&this.searchRequest.abort()},Qt:function(){this.St(),this.options.resultsEl.empty(),this.options.resultsEl.removeClass("is-active"),this.el.removeClass("is-active"),jQuery("body").removeClass("glsr-focus")},xt:function(t){var i=this.options.entriesEl.children("tr").eq(t),n=this;i.find("td").css({backgroundColor:"#faafaa"}),i.fadeOut(350,(function(){jQuery(this).remove(),n.options.results={},n.Ft(),n.Pt()}))},At:function(t){jQuery("body").addClass("glsr-focus"),this.options.resultsEl.append(t),this.options.resultsEl.children("span").on("click",this.Rt.bind(this))},$t:function(){this.options.entriesEl.on("click","a.delete",this.Lt.bind(this)),this.options.entriesEl.sortable({items:"tr",tolerance:"pointer",start:function(t,i){i.placeholder.height(i.helper[0].scrollHeight)},sort:function(t,i){var n=t.pageY-jQuery(this).offsetParent().offset().top-i.helper.outerHeight(!0)/2;i.helper.css({top:n+"px"})}})},Ct:function(t){this.options.selected+=t,this.options.results.removeClass(this.options.selectedClass),this.options.selected<0&&(this.options.selected=-1,this.options.searchEl.focus()),this.options.selected>=this.options.results.length&&(this.options.selected=this.options.results.length-1),this.options.selected>=0&&this.options.results.eq(this.options.selected).addClass(this.options.selectedClass).focus()},jt:function(t){jQuery(t.target).find(this.el).length&&jQuery("body").hasClass("glsr-focus")&&this.Qt()},kt:function(t){if(!jQuery.isEmptyObject(this.options.results)){if(GLSR.keys.ESC===t.which&&this.Qt(),GLSR.keys.ENTER===t.which||GLSR.keys.SPACE===t.which){var i=this.options.resultsEl.find("."+this.options.selectedClass);i&&i.trigger("click")}GLSR.keys.UP===t.which&&(t.preventDefault(),this.Ct(-1)),GLSR.keys.DOWN===t.which&&(t.preventDefault(),this.Ct(1))}},Lt:function(t){t.preventDefault(),this.xt(jQuery(t.currentTarget).closest("tr").index())},Rt:function(t){t.preventDefault(),"function"==typeof this.options.onResultClick&&this.options.onResultClick.call(this,t),this.Qt()},wt:function(t){if(this.St(),this.searchTerm===t.currentTarget.value&&this.options.results.length)return this.At(this.options.results);if(this.options.resultsEl.empty(),this.options.selected=-1,this.searchTerm=t.currentTarget.value,""===this.searchTerm)return this.zt();this.el.addClass("is-active");var i={};i[GLSR.nameprefix]={_action:this.options.action,_nonce:this.el.find("#_search_nonce").val(),exclude:this.options.exclude,search:this.searchTerm},this.searchRequest=wp.ajax.post(GLSR.action,i).done(function(t){this.el.removeClass("is-active"),this.At(t.items?t.items:t.empty),this.options.results=this.options.resultsEl.children(),this.options.resultsEl.addClass("is-active"),delete this.searchRequest}.bind(this))},_t:function(t){GLSR.keys.ESC===t.which&&this.zt(),GLSR.keys.ENTER===t.which&&(this.wt(t),t.preventDefault())},Et:function(t){t.preventDefault();var i=jQuery(t.currentTarget).closest(".glsr-assigned-entry");i.find("a").css({color:"#c00"}),i.fadeOut("fast",(function(){i.remove()}))},Ft:function(){var t=this;this.options.exclude=[],this.options.entriesEl.children("tr").each((function(i){jQuery(this).find(".glsr-string-td2").children().filter(":input").each((function(){var n=jQuery(this),e=n.attr("name").replace(/\[\d+\]/i,"["+i+"]");n.attr("name",e),n.is("[data-id]")&&t.options.exclude.push({id:n.val()})}))}))},zt:function(){this.Qt(),this.options.results={},this.options.searchEl.val("")},Pt:function(){var t=this.options.entriesEl.children().length>0?"remove":"add";this.options.entriesEl.parent()[t+"Class"]("glsr-hidden")}};var S=k,Q=function(t){this.current=null,this.editor=null,this.create=function(t){if(this.editor=tinymce.get(t),this.editor){var i={_action:"mce-shortcode",shortcode:this.current};new o(i).post(this.Gt.bind(this))}};var i=document.querySelectorAll(t);i.length&&i.forEach(function(t){var i=t.querySelector("button"),n=t.querySelectorAll(".mce-menu-item");i&&n.length&&this.k(t,i,n)}.bind(this))};Q.prototype={Tt:{},Ot:[],k:function(t,i,n){document.addEventListener("click",this.Dt.bind(this,t,i)),i.addEventListener("click",this.It.bind(this,t,i)),n.forEach(function(n){n.addEventListener("click",this.Nt.bind(this,t,i))}.bind(this))},Mt:function(){tinymce.execCommand("GLSR_Shortcode")},Vt:function(){jQuery("#scTemp").length?this.Mt():(jQuery("body").append('<textarea id="scTemp" style="display:none!important;"/>'),tinymce.init({elements:"scTemp",external_plugins:GLSR.tinymce,mode:"exact",plugins:["glsr_shortcode","wplink"]}),setTimeout(function(){this.Mt()}.bind(this),200))},bt:function(t,i){jQuery(i).removeClass("active"),jQuery(t).find(".glsr-mce-menu").hide()},u:function(){var t=jQuery("#scTemp");t.length&&(tinymce.get("scTemp").remove(),t.remove()),this.Tt={},this.Ot=[]},Gt:function(t){if(t){if(0===t.body.length)return window.send_to_editor("["+t.shortcode+"]"),void this.u();var i=this.Zt(t);t.ok.constructor===Array&&(i.buttons[0].text=t.ok[0],i.buttons[0].onclick="close",delete i.buttons[1]),this.editor.windowManager.open(i)}},Wt:function(t){for(var i in this.Tt=t,this.Ot=[],t)t.hasOwnProperty(i)&&(this.qt(i),this.Bt(i),this.Ht(i));this.Tt.hide=this.Ot.join(",")},qt:function(t){"display"!==t||jQuery.isNumeric(this.Tt[t])||(this.Tt[t]="")},Bt:function(t){if(GLSR.hideoptions.hasOwnProperty(this.current)){var i=t.substring("hide_".length);-1!==Object.keys(GLSR.hideoptions[this.current]).indexOf(i)&&(this.Tt[t]&&this.Ot.push(i),delete this.Tt[t])}},Ht:function(t){"id"===t&&(this.Tt[t]=(+new Date).toString(36))},Dt:function(t,i,n){jQuery(n.target).closest(jQuery(t)).length||this.bt(t,i)},It:function(t,i,n){n.preventDefault(),n.currentTarget.classList.contains("active")?this.bt(t,i):this.Kt(t,i)},Nt:function(t,i,n){n.preventDefault(),this.current=n.currentTarget.dataset.shortcode,this.current&&(tinymce.get(window.wpActiveEditor)?this.Mt():this.Vt(),setTimeout(function(){this.bt(t,i)}.bind(this),100))},Kt:function(t,i){jQuery(i).addClass("active"),jQuery(t).find(".glsr-mce-menu").show()},Ut:function(t){return[{classes:"btn glsr-btn primary",onclick:this.Jt.bind(this),text:t.ok},{onclick:"close",text:t.close}]},Zt:function(t){return{title:t.title,body:t.body,classes:"glsr-mce-popup",minWidth:320,buttons:this.Ut(t),onsubmit:this.Yt.bind(this,t),onclose:this.u.bind(this)}},Yt:function(t,i){var n="";for(var e in this.Wt(i.data),this.Tt)this.Tt.hasOwnProperty(e)&&""!==this.Tt[e]&&(n+=" "+e+'="'+this.Tt[e]+'"');window.send_to_editor("["+t.shortcode+n+"]")},Jt:function(){var t=this.editor.windowManager.getWindows()[0];this.Xt(t)&&t.submit()},Xt:function(t){var i,n=!0,e=GLSR.shortcodes[this.current];for(var s in e)if(e.hasOwnProperty(s)&&void 0!==(i=t.find("#"+s)[0])&&""===i.state.data.value){n=!1,alert(e[s]);break}return n}};var x=Q,F=n(2),P=n.n(F),A=function(t){var i=document.querySelectorAll(t);i.length&&i.forEach(function(t){t.addEventListener("click",this.ht)}.bind(this))};A.prototype={ht:function(t){var i=t.currentTarget.href.match(/post=([0-9]+)/),n=t.currentTarget.href.match(/action=([a-z]+)/);if(null!==i&&null!==n){var e={_action:"toggle-status",_nonce:GLSR.nonce["toggle-status"],post_id:i[1],status:n[1]};new o(e,t).post((function(i){if(i.class){var n=jQuery(t.target);n.closest("tr").removeClass("status-pending status-publish").addClass(i.class),n.closest("td.column-title").find("strong").html(i.link),i.counts&&(n.closest(".wrap").find("ul.subsubsub").html(i.counts),jQuery("#menu-posts-site-review").find(".awaiting-mod").removeClass().addClass("awaiting-mod count-"+i.pending).find(".unapproved-count").html(i.pending))}}))}}};var R=A,$=function(){this.button=jQuery("button#sync-reviews"),this.progressbar=jQuery(".glsr-progress"),this.service=null,jQuery("form.glsr-form-sync").on("click","#sync-reviews",this.ti.bind(this)),jQuery(document).on("wp-window-resized",this.ii),jQuery(window).on("hashchange",this.ii),this.ii()};$.prototype={ni:function(t){jQuery(".service-"+this.service+" td.column-last_sync").text(t.last_sync),jQuery(".service-"+this.service+" td.column-total_fetched a").text(t.total),this.ei(!1)},ti:function(t){t.preventDefault(),this.service=jQuery('[name="'+GLSR.nameprefix+'[service]"]').val(),this.service&&(this.ei(!0),this.si())},ii:function(){var t=jQuery(".glsr-progress").width();t&&jQuery(".glsr-progress span").width(t)},si:function(){var t={_action:"sync-reviews",service:this.service,stage:"fetch"};new o(t).post(this.ri.bind(this))},ri:function(t){var i={_action:"sync-reviews",job_id:t.job_id,service:this.service,stage:"progress"},n=t.finished?this.oi.bind(this,t):this.ri.bind(this);this.ai(t.message),this.ui(t.percent),setTimeout((function(){new o(i).post(n)}),1500)},oi:function(t){var i=0;try{i=t.meta.pagination.current_page}catch(t){}var n={_action:"sync-reviews",page:i+1,service:this.service,stage:"reviews"};this.ai(t.message),t.percent_synced&&t.percent_synced>=100?this.ni(t):new o(n).post(this.oi.bind(this))},ai:function(t){jQuery(".glsr-progress-status",this.progressbar).text(t)},ui:function(t){t=(t||0)+"%",jQuery(".glsr-progress-bar",this.progressbar).outerWidth(t)},ei:function(t){if(!0===t&&(this.ai(this.progressbar.data("active-text")),this.ui(),this.button.prop("disabled",!0),window.requestAnimationFrame(function(){this.progressbar.addClass("active")}.bind(this))),!1===t)return this.service=null,this.button.prop("disabled",!1),void this.progressbar.removeClass("active");window.requestAnimationFrame(this.ei.bind(this))}};var L=$,C=function(t){this.options=jQuery.extend({},this.defaults,t),this.active=document.querySelector("input[name=_active_tab]"),this.referrer=document.querySelector("input[name=_wp_http_referer]"),this.tabs=document.querySelectorAll(this.options.tabSelector),this.views=document.querySelectorAll(this.options.viewSelector),this.active&&this.referrer&&this.tabs&&this.views&&this.k()};C.prototype={defaults:{expandSelectors:".glsr-nav-view, .glsr-notice",tabSelector:".glsr-nav-tab",viewSelector:".glsr-nav-view"},k:function(){var t=this;jQuery(window).on("hashchange",t.ci.bind(t)),[].forEach.call(t.tabs,function(i,n){(location.hash?i.getAttribute("href").slice(1)===location.hash.slice(5):0===n)&&t.hi(i),i.addEventListener("click",t.ht.bind(t)),i.addEventListener("touchend",t.ht.bind(t))}.bind(t)),jQuery(t.options.expandSelectors).on("click","a",(function(){var i=jQuery(this).data("expand");localStorage.setItem("glsr-expand",i),t.li(jQuery(i))})),jQuery(window).on("load",(function(){t.li(jQuery(localStorage.getItem("glsr-expand")))}))},di:function(t){return t?"add":"remove"},ht:function(t){t.preventDefault();var i=t.currentTarget;i.blur(),this.fi(i),this.hi(i),location.hash="tab-"+i.getAttribute("href").slice(1)},ci:function(){for(var t=location.hash.split("#tab-")[1],i=0;i<this.views.length;i++)if(t===this.views[i].id){this.hi(this.tabs[i]);break}},li:function(t){if(t.length){var i=t.parent().parent();i.removeClass("collapsed"),this.pi(i),i.removeClass("collapsed"),t.parent().removeClass("closed").find(".glsr-accordion-trigger").attr("aria-expanded",!0),window.setTimeout((function(){t.parent()[0].scrollIntoView({behavior:"smooth",block:"center"}),localStorage.removeItem("glsr-expand")}),10)}},vi:function(t){var i=this.referrer.value.split("#")[0]+"#tab-"+this.views[t].id;this.referrer.value=i},hi:function(t){[].forEach.call(this.tabs,function(i,n){var e=this.di(i===t);"add"===e&&(this.active.value=this.views[n].id,this.vi(n),this.gi(n)),i.classList[e]("nav-tab-active")}.bind(this))},gi:function(t){[].forEach.call(this.views,function(i,n){var e=this.di(n!==t);i.classList[e]("ui-tabs-hide")}.bind(this))},pi:function(t){var i=t.hasClass("collapsed")?"remove":"add";t[i+"Class"]("collapsed").find(".glsr-card.postbox")[i+"Class"]("closed").find(".glsr-accordion-trigger").attr("aria-expanded","add"!==i)},fi:function(t){if(t.classList.contains("nav-tab-active")){var i=jQuery(t.getAttribute("href"));this.pi(i)}}};var z=C,E=function(){var t=document.querySelector("#contentdiv > textarea");t&&(this.mi(t),jQuery(document).on("wp-window-resized.editor-expand",function(){this.mi(t)}.bind(this)))};E.prototype={mi:function(t){var i=t.scrollHeight>320?t.scrollHeight:320;t.style.height="auto",t.style.height=i+"px"}};var G=E,T=function(){jQuery("form").on("click","#clear-console",this.yi,this.ht.bind(this)),jQuery("form").on("click","#fetch-console",this.yi,this.ht.bind(this)),jQuery("form").on("click","[data-ajax-click]",this.ht.bind(this));var t=jQuery("input[data-alt]");t.length&&(jQuery(document).on("keydown",this.bi.bind(this,t)),jQuery(document).on("keyup",this.wi.bind(this,t)))};T.prototype={yi:function(t,i){i&&jQuery("#log-file").val(t.console)},ht:function(t){new o({},t,t.currentTarget.closest("form")).post((function(i,n){"function"==typeof t.data&&t.data(i,n),jQuery("html, body").animate({scrollTop:0},500),jQuery("#glsr-notices").on("click","a",(function(){localStorage.setItem("glsr-expand",jQuery(this).data("expand"))})),jQuery('.glsr-notice[data-notice="'+jQuery(t.currentTarget).data("remove-notice")+'"]').remove()}))},bi:function(t,i){GLSR.keys.ALT!==i.keyCode||i.repeat||(t.closest("form").find("[data-alt-text]").addClass("alt"),t.val(1))},wi:function(t,i){GLSR.keys.ALT===i.keyCode&&(t.closest("form").find("[data-alt-text]").removeClass("alt"),t.val(0))}};var O=T;GLSR.keys={ALT:18,DOWN:40,ENTER:13,ESC:27,SPACE:32,UP:38},jQuery((function(t){j.a.highlightAll(),GLSR.notices=new v,GLSR.shortcode=new x(".glsr-mce"),GLSR.stars=new P.a(document.querySelectorAll("select.glsr-star-rating"),{showText:!1}),c(),new l("form.glsr-form"),new f,new m,new b,new S("#glsr-search-posts",{action:"search-posts",onInit:function(){this.el.find(".glsr-remove-button").on("click",this.Et.bind(this))},onResultClick:function(i){var n=t(i.currentTarget),e=wp.template("glsr-assigned-posts"),s={id:n.data("id"),name:"post_ids[]",url:n.data("url"),title:n.text()};if(e){var r=t(e(s));r.find(".glsr-remove-button").on("click",this.Et.bind(this)),this.el.find(".glsr-selected-entries").append(r),this.zt()}this.options.searchEl.focus()}}),new S("#glsr-search-users",{action:"search-users",onInit:function(){this.el.find(".glsr-remove-button").on("click",this.Et.bind(this))},onResultClick:function(i){var n=t(i.currentTarget),e=wp.template("glsr-assigned-users"),s={id:n.data("id"),name:"user_ids[]",url:n.data("url"),title:n.text()};if(e){var r=t(e(s));r.find(".glsr-remove-button").on("click",this.Et.bind(this)),this.el.find(".glsr-selected-entries").append(r),this.zt()}this.options.searchEl.focus()}}),new S("#glsr-search-translations",{action:"search-translations",onInit:function(){this.$t()},onResultClick:function(i){var n=t(i.currentTarget),e=n.data("entry"),s=wp.template("glsr-string-"+(e.p1?"plural":"single"));e.index=this.options.entriesEl.children().length,e.prefix=this.options.resultsEl.data("prefix"),s&&(this.options.entriesEl.append(s(e)),this.options.exclude.push({id:e.id}),this.options.results=this.options.results.filter((function(t,i){return i!==n.get(0)}))),this.Pt()}}),new R("a.glsr-toggle-status"),new z,new G,new O,new L;var i=function(){this.dataset.glsrTrack=this.value};t("select[data-glsr-track]").each(i),t("select[data-glsr-track]").on("change",i),t(".glsr-card.postbox:not(.open)").addClass("closed").find(".glsr-accordion-trigger").attr("aria-expanded",!1).closest(".glsr-nav-view").addClass("collapsed"),t(".glsr-support-step").not(":checked").length<1&&t(".glsr-card-result").removeClass("hidden"),t(".glsr-support-step").on("change",(function(){var i=t(".glsr-support-step").not(":checked").length>0?"add":"remove";t(".glsr-card-result")[i+"Class"]("hidden")})),t(".glsr-card.postbox .glsr-card-heading").on("click",(function(){var i=t(this).parent(),n=i.closest(".glsr-nav-view"),e=i.hasClass("closed")?"remove":"add";i[e+"Class"]("closed").find(".glsr-accordion-trigger").attr("aria-expanded","add"!==e),e=n.find(".glsr-card.postbox").not(".closed").length>0?"remove":"add",n[e+"Class"]("collapsed")}))}))}]);
compatibility.php CHANGED
@@ -124,6 +124,20 @@ add_action('site-reviews/customize/ninja_forms', function () {
124
  }
125
  });
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  /**
128
  * Purge the WP-Super-Cache plugin cache after a review has been created.
129
  * @param \GeminiLabs\SiteReviews\Review $review
124
  }
125
  });
126
 
127
+ /**
128
+ * Purge the W3 Total Cache database and object caches after plugin migrations.
129
+ * @return void
130
+ * @see https://wordpress.org/plugins/w3-total-cache/
131
+ */
132
+ add_action('site-reviews/migration/end', function () {
133
+ if (function_exists('w3tc_dbcache_flush')) {
134
+ w3tc_dbcache_flush();
135
+ }
136
+ if (function_exists('w3tc_objectcache_flush')) {
137
+ w3tc_objectcache_flush();
138
+ }
139
+ });
140
+
141
  /**
142
  * Purge the WP-Super-Cache plugin cache after a review has been created.
143
  * @param \GeminiLabs\SiteReviews\Review $review
languages/site-reviews-en_US.mo CHANGED
Binary file
languages/site-reviews-en_US.po CHANGED
@@ -1354,7 +1354,7 @@ msgctxt "admin-text"
1354
  msgid "Local Review"
1355
  msgstr "Local Review"
1356
 
1357
- #: plugin/Deprecated.php:21
1358
  msgctxt "admin-text"
1359
  msgid ""
1360
  "The [%s] method has been deprecated and will be soon be removed, please use "
@@ -1363,7 +1363,7 @@ msgstr ""
1363
  "The [%s] method has been deprecated and will be soon be removed, please use "
1364
  "the [%s] method instead."
1365
 
1366
- #: plugin/Review.php:268, plugin/Controllers/ListTableColumns/ColumnValueAuthorName.php:20
1367
  msgctxt "admin-text"
1368
  msgid "Unknown"
1369
  msgstr "Unknown"
@@ -1684,17 +1684,17 @@ msgctxt "admin-text"
1684
  msgid "Yes"
1685
  msgstr "Yes"
1686
 
1687
- #: plugin/Controllers/NoticeController.php:118
1688
  msgctxt "admin-text"
1689
- msgid "Import Third Party Reviews"
1690
- msgstr "Import Third Party Reviews"
1691
 
1692
- #: plugin/Controllers/NoticeController.php:133
1693
  msgctxt "admin-text"
1694
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1695
  msgstr "Thanks for installing Site Reviews v%s, we hope you love it!"
1696
 
1697
- #: plugin/Controllers/NoticeController.php:134
1698
  msgctxt "admin-text"
1699
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1700
  msgstr "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
@@ -2788,14 +2788,12 @@ msgstr "Database Update Required"
2788
  msgctxt "admin-text"
2789
  msgid ""
2790
  "Site Reviews needs to update the database and your reviews to the newest "
2791
- "version. If this notice keeps appearing, you may have 3rd-party reviews "
2792
- "that were not imported correctly. To fix this, please delete the invalid "
2793
- "reviews and use the %s tool to re-import them."
2794
  msgstr ""
2795
  "Site Reviews needs to update the database and your reviews to the newest "
2796
- "version. If this notice keeps appearing, you may have 3rd-party reviews "
2797
- "that were not imported correctly. To fix this, please delete the invalid "
2798
- "reviews and use the %s tool to re-import them."
2799
 
2800
  #: views/partials/notices/migrate.php:10
2801
  msgctxt "admin-text"
1354
  msgid "Local Review"
1355
  msgstr "Local Review"
1356
 
1357
+ #: plugin/Deprecated.php:24
1358
  msgctxt "admin-text"
1359
  msgid ""
1360
  "The [%s] method has been deprecated and will be soon be removed, please use "
1363
  "The [%s] method has been deprecated and will be soon be removed, please use "
1364
  "the [%s] method instead."
1365
 
1366
+ #: plugin/Review.php:264, plugin/Controllers/ListTableColumns/ColumnValueAuthorName.php:20
1367
  msgctxt "admin-text"
1368
  msgid "Unknown"
1369
  msgstr "Unknown"
1684
  msgid "Yes"
1685
  msgstr "Yes"
1686
 
1687
+ #: plugin/Controllers/NoticeController.php:119
1688
  msgctxt "admin-text"
1689
+ msgid "Common Problems and Solutions"
1690
+ msgstr "Common Problems and Solutions"
1691
 
1692
+ #: plugin/Controllers/NoticeController.php:134
1693
  msgctxt "admin-text"
1694
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1695
  msgstr "Thanks for installing Site Reviews v%s, we hope you love it!"
1696
 
1697
+ #: plugin/Controllers/NoticeController.php:135
1698
  msgctxt "admin-text"
1699
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1700
  msgstr "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
2788
  msgctxt "admin-text"
2789
  msgid ""
2790
  "Site Reviews needs to update the database and your reviews to the newest "
2791
+ "version. If this notice keeps appearing, please read the %s section on the "
2792
+ "Help page."
 
2793
  msgstr ""
2794
  "Site Reviews needs to update the database and your reviews to the newest "
2795
+ "version. If this notice keeps appearing, please read the %s section on the "
2796
+ "Help page."
 
2797
 
2798
  #: views/partials/notices/migrate.php:10
2799
  msgctxt "admin-text"
languages/site-reviews.pot CHANGED
@@ -947,12 +947,12 @@ msgctxt "admin-text"
947
  msgid "Local Review"
948
  msgstr ""
949
 
950
- #: plugin/Deprecated.php:21
951
  msgctxt "admin-text"
952
  msgid "The [%s] method has been deprecated and will be soon be removed, please use the [%s] method instead."
953
  msgstr ""
954
 
955
- #: plugin/Review.php:268, plugin/Controllers/ListTableColumns/ColumnValueAuthorName.php:20
956
  msgctxt "admin-text"
957
  msgid "Unknown"
958
  msgstr ""
@@ -1334,17 +1334,17 @@ msgctxt "admin-text"
1334
  msgid "Yes"
1335
  msgstr ""
1336
 
1337
- #: plugin/Controllers/NoticeController.php:118
1338
  msgctxt "admin-text"
1339
- msgid "Import Third Party Reviews"
1340
  msgstr ""
1341
 
1342
- #: plugin/Controllers/NoticeController.php:133
1343
  msgctxt "admin-text"
1344
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1345
  msgstr ""
1346
 
1347
- #: plugin/Controllers/NoticeController.php:134
1348
  msgctxt "admin-text"
1349
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1350
  msgstr ""
@@ -2592,7 +2592,7 @@ msgstr ""
2592
 
2593
  #: views/partials/notices/migrate.php:7
2594
  msgctxt "admin-text"
2595
- msgid "Site Reviews needs to update the database and your reviews to the newest version. If this notice keeps appearing, you may have 3rd-party reviews that were not imported correctly. To fix this, please delete the invalid reviews and use the %s tool to re-import them."
2596
  msgstr ""
2597
 
2598
  #: views/partials/notices/migrate.php:10
947
  msgid "Local Review"
948
  msgstr ""
949
 
950
+ #: plugin/Deprecated.php:24
951
  msgctxt "admin-text"
952
  msgid "The [%s] method has been deprecated and will be soon be removed, please use the [%s] method instead."
953
  msgstr ""
954
 
955
+ #: plugin/Review.php:264, plugin/Controllers/ListTableColumns/ColumnValueAuthorName.php:20
956
  msgctxt "admin-text"
957
  msgid "Unknown"
958
  msgstr ""
1334
  msgid "Yes"
1335
  msgstr ""
1336
 
1337
+ #: plugin/Controllers/NoticeController.php:119
1338
  msgctxt "admin-text"
1339
+ msgid "Common Problems and Solutions"
1340
  msgstr ""
1341
 
1342
+ #: plugin/Controllers/NoticeController.php:134
1343
  msgctxt "admin-text"
1344
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1345
  msgstr ""
1346
 
1347
+ #: plugin/Controllers/NoticeController.php:135
1348
  msgctxt "admin-text"
1349
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1350
  msgstr ""
2592
 
2593
  #: views/partials/notices/migrate.php:7
2594
  msgctxt "admin-text"
2595
+ msgid "Site Reviews needs to update the database and your reviews to the newest version. If this notice keeps appearing, please read the %s section on the Help page."
2596
  msgstr ""
2597
 
2598
  #: views/partials/notices/migrate.php:10
plugin/Application.php CHANGED
@@ -24,8 +24,11 @@ use ReflectionClass;
24
  * @property string $post_type
25
  * @property string $prefix
26
  * @property array $reviewTypes
 
 
27
  * @property string $taxonomy
28
  * @property string $version
 
29
  */
30
  final class Application extends Container
31
  {
@@ -44,11 +47,8 @@ final class Application extends Container
44
 
45
  protected $addons = [];
46
  protected $defaults;
47
- protected $file;
48
- protected $languages;
49
  protected $name;
50
  protected $reviewTypes;
51
- protected $version;
52
 
53
  /**
54
  * @return void
24
  * @property string $post_type
25
  * @property string $prefix
26
  * @property array $reviewTypes
27
+ * @property array $session
28
+ * @property \GeminiLabs\SiteReviews\Arguments $storage
29
  * @property string $taxonomy
30
  * @property string $version
31
+ * @property string $testedTo;
32
  */
33
  final class Application extends Container
34
  {
47
 
48
  protected $addons = [];
49
  protected $defaults;
 
 
50
  protected $name;
51
  protected $reviewTypes;
 
52
 
53
  /**
54
  * @return void
plugin/Controllers/NoticeController.php CHANGED
@@ -114,8 +114,9 @@ class NoticeController extends Controller
114
  && (glsr(Migrate::class)->isMigrationNeeded() || glsr(Database::class)->isMigrationNeeded())) {
115
  glsr()->render('partials/notices/migrate', [
116
  'action' => glsr(Builder::class)->a([
117
- 'href' => admin_url('edit.php?post_type='.glsr()->post_type.'&page=tools#tab-general'),
118
- 'text' => _x('Import Third Party Reviews', 'admin-text', 'site-reviews'),
 
119
  ]),
120
  ]);
121
  }
114
  && (glsr(Migrate::class)->isMigrationNeeded() || glsr(Database::class)->isMigrationNeeded())) {
115
  glsr()->render('partials/notices/migrate', [
116
  'action' => glsr(Builder::class)->a([
117
+ 'data-expand' => '#support-common-problems-and-solutions',
118
+ 'href' => admin_url('edit.php?post_type='.glsr()->post_type.'&page=documentation#tab-support'),
119
+ 'text' => _x('Common Problems and Solutions', 'admin-text', 'site-reviews'),
120
  ]),
121
  ]);
122
  }
plugin/Database.php CHANGED
@@ -10,12 +10,14 @@ use GeminiLabs\SiteReviews\Helpers\Str;
10
  use WP_Query;
11
  use WP_User_Query;
12
 
 
 
 
13
  class Database
14
  {
15
  use Deprecated;
16
 
17
  protected $db;
18
- protected $mappedDeprecatedMethods;
19
 
20
  public function __construct()
21
  {
10
  use WP_Query;
11
  use WP_User_Query;
12
 
13
+ /**
14
+ * @property array $mappedDeprecatedMethods
15
+ */
16
  class Database
17
  {
18
  use Deprecated;
19
 
20
  protected $db;
 
21
 
22
  public function __construct()
23
  {
plugin/Database/Query.php CHANGED
@@ -9,13 +9,14 @@ use GeminiLabs\SiteReviews\Helpers\Cast;
9
  use GeminiLabs\SiteReviews\Modules\Rating;
10
  use GeminiLabs\SiteReviews\Review;
11
 
 
 
 
 
12
  class Query
13
  {
14
  use Sql;
15
 
16
- public $args;
17
- public $db;
18
-
19
  public function __construct()
20
  {
21
  global $wpdb;
9
  use GeminiLabs\SiteReviews\Modules\Rating;
10
  use GeminiLabs\SiteReviews\Review;
11
 
12
+ /**
13
+ * @property array $args
14
+ * @property \wpdb $db
15
+ */
16
  class Query
17
  {
18
  use Sql;
19
 
 
 
 
20
  public function __construct()
21
  {
22
  global $wpdb;
plugin/Database/Sql.php CHANGED
@@ -8,7 +8,14 @@ use GeminiLabs\SiteReviews\Helpers\Str;
8
 
9
  trait Sql
10
  {
 
 
 
11
  public $args;
 
 
 
 
12
  public $db;
13
 
14
  /**
8
 
9
  trait Sql
10
  {
11
+ /**
12
+ * @var array
13
+ */
14
  public $args;
15
+
16
+ /**
17
+ * @var \wpdb
18
+ */
19
  public $db;
20
 
21
  /**
plugin/Deprecated.php CHANGED
@@ -8,6 +8,9 @@ use ReflectionClass;
8
 
9
  trait Deprecated
10
  {
 
 
 
11
  protected $mappedDeprecatedMethods;
12
 
13
  public function __call($oldMethod, $args)
8
 
9
  trait Deprecated
10
  {
11
+ /**
12
+ * @var array
13
+ */
14
  protected $mappedDeprecatedMethods;
15
 
16
  public function __call($oldMethod, $args)
plugin/Modules/Html/Fields/Field.php CHANGED
@@ -3,8 +3,6 @@
3
  namespace GeminiLabs\SiteReviews\Modules\Html\Fields;
4
 
5
  use GeminiLabs\SiteReviews\Helpers\Arr;
6
- use GeminiLabs\SiteReviews\Helpers\Str;
7
- use ReflectionClass;
8
 
9
  abstract class Field
10
  {
@@ -27,7 +25,7 @@ abstract class Field
27
  }
28
 
29
  /**
30
- * This is used to build a custom Field type
31
  * @return string|void
32
  */
33
  public function build()
3
  namespace GeminiLabs\SiteReviews\Modules\Html\Fields;
4
 
5
  use GeminiLabs\SiteReviews\Helpers\Arr;
 
 
6
 
7
  abstract class Field
8
  {
25
  }
26
 
27
  /**
28
+ * This is used to build a custom Field type.
29
  * @return string|void
30
  */
31
  public function build()
plugin/Modules/Migrate.php CHANGED
@@ -23,13 +23,13 @@ class Migrate
23
  /**
24
  * @var string
25
  */
26
- public $transientKey;
27
 
28
  public function __construct()
29
  {
30
  $this->currentVersion = $this->currentVersion();
31
- $this->migrations = $this->migrations();
32
- $this->transientKey = glsr()->prefix.'migrations';
33
  }
34
 
35
  /**
@@ -52,7 +52,7 @@ class Migrate
52
  */
53
  public function reset()
54
  {
55
- delete_transient($this->transientKey);
56
  }
57
 
58
  /**
@@ -79,13 +79,32 @@ class Migrate
79
  /**
80
  * @return array
81
  */
82
- protected function createTransient()
83
  {
84
- $transient = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  foreach ($this->migrations as $migration) {
86
- $transient[$migration] = false;
87
  }
88
- return $transient;
89
  }
90
 
91
  /**
@@ -105,34 +124,15 @@ class Migrate
105
  return $fallback;
106
  }
107
 
108
- /**
109
- * @return array
110
- */
111
- protected function migrations()
112
- {
113
- $migrations = [];
114
- $dir = glsr()->path('plugin/Modules/Migrations');
115
- if (is_dir($dir)) {
116
- $iterator = new DirectoryIterator($dir);
117
- foreach ($iterator as $fileinfo) {
118
- if ($fileinfo->isFile()) {
119
- $migrations[] = str_replace('.php', '', $fileinfo->getFilename());
120
- }
121
- }
122
- natsort($migrations);
123
- }
124
- return Arr::reindex($migrations);
125
- }
126
-
127
  /**
128
  * @return string[]
129
  */
130
- protected function pendingMigrations(array $transient = [])
131
  {
132
- if (empty($transient)) {
133
- $transient = $this->transient();
134
  }
135
- return array_keys(array_filter($transient, function ($hasRun) {
136
  return !$hasRun;
137
  }));
138
  }
@@ -143,44 +143,46 @@ class Migrate
143
  protected function runMigrations()
144
  {
145
  wp_raise_memory_limit('admin');
146
- $transient = $this->transient();
147
- foreach ($this->pendingMigrations($transient) as $migration) {
 
148
  if (class_exists($classname = __NAMESPACE__.'\Migrations\\'.$migration)) {
149
  glsr($classname)->run();
150
- $transient[$migration] = true;
151
  glsr_log()->debug("[$migration] has run successfully.");
152
  }
153
  }
154
- $this->storeTransient($transient);
155
  if ($this->currentVersion !== glsr()->version) {
156
  $this->updateVersionFrom($this->currentVersion);
157
  }
158
  glsr(OptionManager::class)->set('last_migration_run', current_time('timestamp'));
 
159
  }
160
 
161
  /**
162
  * @return void
163
  */
164
- protected function storeTransient(array $transient)
165
  {
166
- set_transient($this->transientKey, $transient);
167
  }
168
 
169
  /**
170
  * @return array
171
  */
172
- protected function transient()
173
  {
174
- $transient = Arr::consolidate(get_transient($this->transientKey));
175
- if (!Arr::compare(array_keys($transient), array_values($this->migrations))) {
176
- $newTransient = $this->createTransient();
177
- foreach ($newTransient as $migration => &$hasRun) {
178
- $hasRun = Arr::get($transient, $migration, false);
179
  }
180
- $transient = $newTransient;
181
- $this->storeTransient($transient);
182
  }
183
- return array_map('wp_validate_boolean', $transient);
184
  }
185
 
186
  /**
23
  /**
24
  * @var string
25
  */
26
+ public $migrationsKey;
27
 
28
  public function __construct()
29
  {
30
  $this->currentVersion = $this->currentVersion();
31
+ $this->migrations = $this->availableMigrations();
32
+ $this->migrationsKey = glsr()->prefix.'migrations';
33
  }
34
 
35
  /**
52
  */
53
  public function reset()
54
  {
55
+ delete_option($this->migrationsKey);
56
  }
57
 
58
  /**
79
  /**
80
  * @return array
81
  */
82
+ protected function availableMigrations()
83
  {
84
+ $migrations = [];
85
+ $dir = glsr()->path('plugin/Modules/Migrations');
86
+ if (is_dir($dir)) {
87
+ $iterator = new DirectoryIterator($dir);
88
+ foreach ($iterator as $fileinfo) {
89
+ if ($fileinfo->isFile()) {
90
+ $migrations[] = str_replace('.php', '', $fileinfo->getFilename());
91
+ }
92
+ }
93
+ natsort($migrations);
94
+ }
95
+ return Arr::reindex($migrations);
96
+ }
97
+
98
+ /**
99
+ * @return array
100
+ */
101
+ protected function createMigrations()
102
+ {
103
+ $migrations = [];
104
  foreach ($this->migrations as $migration) {
105
+ $migrations[$migration] = false;
106
  }
107
+ return $migrations;
108
  }
109
 
110
  /**
124
  return $fallback;
125
  }
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  /**
128
  * @return string[]
129
  */
130
+ protected function pendingMigrations(array $migrations = [])
131
  {
132
+ if (empty($migrations)) {
133
+ $migrations = $this->storedMigrations();
134
  }
135
+ return array_keys(array_filter($migrations, function ($hasRun) {
136
  return !$hasRun;
137
  }));
138
  }
143
  protected function runMigrations()
144
  {
145
  wp_raise_memory_limit('admin');
146
+ $migrations = $this->storedMigrations();
147
+ glsr()->action('migration/start', $migrations);
148
+ foreach ($this->pendingMigrations($migrations) as $migration) {
149
  if (class_exists($classname = __NAMESPACE__.'\Migrations\\'.$migration)) {
150
  glsr($classname)->run();
151
+ $migrations[$migration] = true;
152
  glsr_log()->debug("[$migration] has run successfully.");
153
  }
154
  }
155
+ $this->storeMigrations($migrations);
156
  if ($this->currentVersion !== glsr()->version) {
157
  $this->updateVersionFrom($this->currentVersion);
158
  }
159
  glsr(OptionManager::class)->set('last_migration_run', current_time('timestamp'));
160
+ glsr()->action('migration/end', $migrations);
161
  }
162
 
163
  /**
164
  * @return void
165
  */
166
+ protected function storeMigrations(array $migrations)
167
  {
168
+ update_option($this->migrationsKey, $migrations);
169
  }
170
 
171
  /**
172
  * @return array
173
  */
174
+ protected function storedMigrations()
175
  {
176
+ $migrations = Arr::consolidate(get_option($this->migrationsKey));
177
+ if (!Arr::compare(array_keys($migrations), array_values($this->migrations))) {
178
+ $newMigrations = $this->createMigrations();
179
+ foreach ($newMigrations as $migration => &$hasRun) {
180
+ $hasRun = Arr::get($migrations, $migration, false);
181
  }
182
+ $migrations = $newMigrations;
183
+ $this->storeMigrations($migrations);
184
  }
185
+ return array_map('wp_validate_boolean', $migrations);
186
  }
187
 
188
  /**
plugin/Plugin.php CHANGED
@@ -9,12 +9,8 @@ use GeminiLabs\SiteReviews\Helpers\Str;
9
  use ReflectionClass;
10
 
11
  /**
12
- * @property string $file
13
  * @property string $id
14
- * @property string $languages
15
  * @property string $name
16
- * @property string $testedTo
17
- * @property string $version
18
  * @method array filterArray($hook, ...$args)
19
  * @method bool filterBool($hook, ...$args)
20
  * @method float filterFloat($hook, ...$args)
@@ -47,7 +43,8 @@ trait Plugin
47
 
48
  public function __construct()
49
  {
50
- $this->file = str_replace('plugin/Application', $this->id, (new ReflectionClass($this))->getFileName());
 
51
  $plugin = get_file_data($this->file, [
52
  'languages' => 'Domain Path',
53
  'name' => 'Plugin Name',
9
  use ReflectionClass;
10
 
11
  /**
 
12
  * @property string $id
 
13
  * @property string $name
 
 
14
  * @method array filterArray($hook, ...$args)
15
  * @method bool filterBool($hook, ...$args)
16
  * @method float filterFloat($hook, ...$args)
43
 
44
  public function __construct()
45
  {
46
+ $file = wp_normalize_path((new ReflectionClass($this))->getFileName());
47
+ $this->file = str_replace('plugin/Application', $this->id, $file);
48
  $plugin = get_file_data($this->file, [
49
  'languages' => 'Domain Path',
50
  'name' => 'Plugin Name',
plugin/Review.php CHANGED
@@ -2,17 +2,12 @@
2
 
3
  namespace GeminiLabs\SiteReviews;
4
 
5
- use GeminiLabs\SiteReviews\Database\OptionManager;
6
  use GeminiLabs\SiteReviews\Database\Query;
7
- use GeminiLabs\SiteReviews\Defaults\CreateReviewDefaults;
8
  use GeminiLabs\SiteReviews\Defaults\ReviewDefaults;
9
- use GeminiLabs\SiteReviews\Defaults\SiteReviewsDefaults;
10
  use GeminiLabs\SiteReviews\Helpers\Arr;
11
  use GeminiLabs\SiteReviews\Helpers\Cast;
12
  use GeminiLabs\SiteReviews\Helpers\Str;
13
  use GeminiLabs\SiteReviews\Modules\Avatar;
14
- use GeminiLabs\SiteReviews\Modules\Html\Builder;
15
- use GeminiLabs\SiteReviews\Modules\Html\Partials\SiteReviews as SiteReviewsPartial;
16
  use GeminiLabs\SiteReviews\Modules\Html\ReviewHtml;
17
 
18
  /**
@@ -25,6 +20,7 @@ use GeminiLabs\SiteReviews\Modules\Html\ReviewHtml;
25
  * @property string $content
26
  * @property Arguments $custom
27
  * @property string $date
 
28
  * @property string $email
29
  * @property int $ID
30
  * @property string $ip_address
2
 
3
  namespace GeminiLabs\SiteReviews;
4
 
 
5
  use GeminiLabs\SiteReviews\Database\Query;
 
6
  use GeminiLabs\SiteReviews\Defaults\ReviewDefaults;
 
7
  use GeminiLabs\SiteReviews\Helpers\Arr;
8
  use GeminiLabs\SiteReviews\Helpers\Cast;
9
  use GeminiLabs\SiteReviews\Helpers\Str;
10
  use GeminiLabs\SiteReviews\Modules\Avatar;
 
 
11
  use GeminiLabs\SiteReviews\Modules\Html\ReviewHtml;
12
 
13
  /**
20
  * @property string $content
21
  * @property Arguments $custom
22
  * @property string $date
23
+ * @property string $name This property is mapped to $author
24
  * @property string $email
25
  * @property int $ID
26
  * @property string $ip_address
plugin/Session.php CHANGED
@@ -4,7 +4,7 @@ namespace GeminiLabs\SiteReviews;
4
 
5
  use GeminiLabs\SiteReviews\Helpers\Arr;
6
 
7
- Trait Session
8
  {
9
  /**
10
  * @var array
4
 
5
  use GeminiLabs\SiteReviews\Helpers\Arr;
6
 
7
+ trait Session
8
  {
9
  /**
10
  * @var array
plugin/Storage.php CHANGED
@@ -4,7 +4,7 @@ namespace GeminiLabs\SiteReviews;
4
 
5
  use GeminiLabs\SiteReviews\Helpers\Arr;
6
 
7
- Trait Storage
8
  {
9
  /**
10
  * @var Arguments
4
 
5
  use GeminiLabs\SiteReviews\Helpers\Arr;
6
 
7
+ trait Storage
8
  {
9
  /**
10
  * @var Arguments
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: reviews, ratings, testimonials, business reviews, product reviews, stars,
5
  Tested up to: 5.5
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 5.1.3
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -113,10 +113,13 @@ All documentation can be found in the "Help" page of the plugin. If your questio
113
 
114
  == Changelog ==
115
 
116
- = 5.1.3 (2020-10-25) =
117
 
118
- - Add "ORDER BY" in migration SQL queries. This will make it a little slower, but hopefully fix the problem where the database migration notice is shown multiple times.
119
  - Fixed addons notice styling and placement
 
 
 
120
 
121
  = 5.1.0 (2020-10-24) =
122
 
5
  Tested up to: 5.5
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 5.1.4
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
113
 
114
  == Changelog ==
115
 
116
+ = 5.1.4 (2020-10-25) =
117
 
118
+ - Added "ORDER BY" to migration SQL queries; this will make migrations run a little slower but fix a potential problem where database migrations may not complete successfully
119
  - Fixed addons notice styling and placement
120
+ - Fixed plugin file paths on IIS Windows servers
121
+ - Fixed plugin migrations to work better with caching plugins
122
+ - Fixed strict standard notices in PHP 5.6
123
 
124
  = 5.1.0 (2020-10-24) =
125
 
site-reviews.php CHANGED
@@ -7,7 +7,7 @@
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
- * Version: 5.1.3
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
+ * Version: 5.1.4
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2
views/pages/documentation/support/common-problems-and-solutions.php CHANGED
@@ -10,6 +10,16 @@
10
  <p>Site Reviews uses the standard WordPress mail functions to send email. However, this does not guarantee that emails will send successfully if your WordPress settings and server configuration are incorrect.</p>
11
  <p>To make sure that emails notifications are sent, please verify that you are sending from an email address that uses the same domain as your website. For example, if your website is <code>https://reviews.com</code>, then the email address you are sending from should end with <code>@reviews.com</code>. You can change the email address that notifications are sent from in the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">settings</a></code>. If the "Send Emails From" email address you have saved in the settings does not share the same domain as your website, you will likely experience issues sending email.</p>
12
  <p>If your email notifications are still not sending, I recommend that you install the <a href="https://wordpress.org/plugins/check-email/">Check Email</a> plugin to verify that your website is able to correctly send email. See also, <a href="https://www.butlerblog.com/2013/12/12/easy-smtp-email-wordpress-wp_mail/">Easy SMTP email settings for WordPress</a>.</p>
 
 
 
 
 
 
 
 
 
 
13
  <h3>The review form is not working, the submit button just spins.</h3>
14
  <ol>
15
  <li>
10
  <p>Site Reviews uses the standard WordPress mail functions to send email. However, this does not guarantee that emails will send successfully if your WordPress settings and server configuration are incorrect.</p>
11
  <p>To make sure that emails notifications are sent, please verify that you are sending from an email address that uses the same domain as your website. For example, if your website is <code>https://reviews.com</code>, then the email address you are sending from should end with <code>@reviews.com</code>. You can change the email address that notifications are sent from in the <code><a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=settings#tab-general'); ?>">settings</a></code>. If the "Send Emails From" email address you have saved in the settings does not share the same domain as your website, you will likely experience issues sending email.</p>
12
  <p>If your email notifications are still not sending, I recommend that you install the <a href="https://wordpress.org/plugins/check-email/">Check Email</a> plugin to verify that your website is able to correctly send email. See also, <a href="https://www.butlerblog.com/2013/12/12/easy-smtp-email-wordpress-wp_mail/">Easy SMTP email settings for WordPress</a>.</p>
13
+ <h3>The "Database Update Required" notice keeps appearing.</h3>
14
+ <p>This notice may appear after updating Site Reviews. If it does, please click the "Update Database" button to run it. If it continues to appear after reloading your pages:</p>
15
+ <ol>
16
+ <li>
17
+ <p>You may be using a caching plugin which is caching the database and preventing Site Reviews from storing the migration status. To fix this, you will need to flush your database cache and/or object cache and then try again.</p>
18
+ </li>
19
+ <li>
20
+ <p>You may have 3rd-party reviews that were not imported correctly. You can verify this by looking for reviews on the <a href="<?= admin_url('edit.php?post_type='.glsr()->post_type); ?>">All Reviews</a> page that do not have any stars. Clicking on these reviews will show a read-only editor and a notice alerting you that the review is an, "Unsupported Review Type". To fix this, please delete the invalid reviews and use the provided <a href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=tools#tab-general'); ?>">Import Third Party Reviews</a> tool to re-import them.</p>
21
+ </li>
22
+ </ol>
23
  <h3>The review form is not working, the submit button just spins.</h3>
24
  <ol>
25
  <li>
views/partials/notices/migrate.php CHANGED
@@ -4,7 +4,7 @@
4
  <input type="hidden" name="<?= glsr()->id; ?>[alt]" value="0" data-alt>
5
  <?php wp_nonce_field('migrate-plugin'); ?>
6
  <p><strong><?= _x('Database Update Required', 'admin-text', 'site-reviews'); ?></strong></p>
7
- <p><?= sprintf(_x('Site Reviews needs to update the database and your reviews to the newest version. If this notice keeps appearing, you may have 3rd-party reviews that were not imported correctly. To fix this, please delete the invalid reviews and use the %s tool to re-import them.', 'admin-text', 'site-reviews'), $action); ?></p>
8
  <p>
9
  <button type="submit" class="components-button is-secondary glsr-button" name="migrate-plugin" id="migrate-plugin" data-ajax-click data-remove-notice="migrate">
10
  <span data-alt-text="<?= esc_attr_x('Run All Migrations', 'admin-text', 'site-reviews'); ?>" data-loading="<?= esc_attr_x('Updating, please wait...', 'admin-text', 'site-reviews'); ?>"><?= _x('Update Database', 'admin-text', 'site-reviews'); ?></span>
4
  <input type="hidden" name="<?= glsr()->id; ?>[alt]" value="0" data-alt>
5
  <?php wp_nonce_field('migrate-plugin'); ?>
6
  <p><strong><?= _x('Database Update Required', 'admin-text', 'site-reviews'); ?></strong></p>
7
+ <p><?= sprintf(_x('Site Reviews needs to update the database and your reviews to the newest version. If this notice keeps appearing, please read the %s section on the Help page.', 'admin-text', 'site-reviews'), $action); ?></p>
8
  <p>
9
  <button type="submit" class="components-button is-secondary glsr-button" name="migrate-plugin" id="migrate-plugin" data-ajax-click data-remove-notice="migrate">
10
  <span data-alt-text="<?= esc_attr_x('Run All Migrations', 'admin-text', 'site-reviews'); ?>" data-loading="<?= esc_attr_x('Updating, please wait...', 'admin-text', 'site-reviews'); ?>"><?= _x('Update Database', 'admin-text', 'site-reviews'); ?></span>