diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a55d64..8dbdc785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,13 @@ 1. [](#bugfix) * Fixed admin caching issues +# v1.9.9 +## 08/21/2019 + +1. [](#bugfix) + * Fixed regression with files in admin not allowing types other than images [#1737](https://github.com/getgrav/grav-plugin-admin/issues/1737) + * Fixed preview link for non-images files in **Page Media** [#1727](https://github.com/getgrav/grav-plugin-admin/issues/1727) + # v1.9.8 ## 08/11/2019 diff --git a/themes/grav/app/forms/fields/files.js b/themes/grav/app/forms/fields/files.js index aaad38af..1c61c1b7 100644 --- a/themes/grav/app/forms/fields/files.js +++ b/themes/grav/app/forms/fields/files.js @@ -79,7 +79,9 @@ const ACCEPT_FUNC = function(file, done, settings) { const reader = new FileReader(); let error = ''; - if (resolution.min || (!(settings.resizeWidth || settings.resizeHeight) && resolution.max)) { + const hasMin = (resolution.min && (resolution.min.width || resolution.min.height)); + const hasMax = (resolution.max && (resolution.max.width || resolution.max.height)); + if (hasMin || (!(settings.resizeWidth || settings.resizeHeight) && hasMax)) { reader.onload = function(event) { const image = new Image(); image.src = event.target.result; @@ -102,13 +104,13 @@ const ACCEPT_FUNC = function(file, done, settings) { } } - done(error); + return error ? done(error) : done(); }; }; reader.readAsDataURL(file); } else { - return done(error); + return error ? done(error) : done(); } }; diff --git a/themes/grav/app/pages/page/media.js b/themes/grav/app/pages/page/media.js index 87d8ebe4..1a814ac1 100644 --- a/themes/grav/app/pages/page/media.js +++ b/themes/grav/app/pages/page/media.js @@ -139,7 +139,9 @@ export default class PageMedia extends FilesField { let file = target.parent('.dz-preview').find('.dz-filename'); let filename = encodeURI(file.text()); let URL = target.closest('[data-media-path]').data('media-path'); - let original = this.dropzone.files.filter((file) => encodeURIComponent(file.name) === filename).shift().extras.original; + let original = this.dropzone.files.filter((file) => encodeURIComponent(file.name) === filename).shift(); + + original = original.extras.original || encodeURIComponent(original.name); target.attr('href', `${URL}/${original}`); }); diff --git a/themes/grav/js/admin.min.js b/themes/grav/js/admin.min.js index b3d83fe9..b22f9f37 100644 --- a/themes/grav/js/admin.min.js +++ b/themes/grav/js/admin.min.js @@ -3,8 +3,8 @@ var r=n(12);r(r.S+r.F*!n(10),"Object",{defineProperties:n(50)})},function(e,t,n) r.call(this);try{e(c(R,this,1),c(F,this,1))}catch(e){F.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(219)(A.prototype,{then:function(e,t){var n=T(v(this,A));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?C.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&D(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new r;this.promise=e,this.resolve=c(R,e,1),this.reject=c(F,e,1)},_.f=T=function(e){return e===A||e===o?new a(e):i(e)}),f(f.G+f.W+f.F*!P,{Promise:A}),n(29)(A,k),n(197)(k),o=n(13)[k],f(f.S+f.F*!P,k,{reject:function(e){var t=T(this),n=t.reject;return n(e),t.promise}}),f(f.S+f.F*(s||!P),k,{resolve:function(e){return x(s&&this===o?A:this,e)}}),f(f.S+f.F*!(P&&n(170)(function(e){A.all(e).catch(M)})),k,{all:function(e){var t=this,n=T(t),r=n.resolve,i=n.reject,a=b(function(){var n=[],a=0,o=1;m(e,!1,function(e){var s=a++,l=!1;n.push(void 0),o++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--o||r(n))},i)}),--o||r(n)});return a.e&&i(a.v),n.promise},race:function(e){var t=this,n=T(t),r=n.reject,i=b(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(24),i=n(166),a=n(167),o=n(16),s=n(41),l=n(169),c={},u={},t=e.exports=function(e,t,n,f,d){var h,p,m,v,g=d?function(){return e}:l(e),y=r(n,f,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(a(g)){for(h=s(e.length);h>_;_++)if(v=t?y(o(p=e[_])[0],p[1]):y(e[_]),v===c||v===u)return v}else for(m=g.call(e);!(p=m.next()).done;)if(v=i(m,y,p.value,t),v===c||v===u)return v};t.BREAK=c,t.RETURN=u},function(e,t,n){var r=n(16),i=n(25),a=n(30)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||void 0==(n=r(o)[a])?t:i(n)}},function(e,t,n){var r,i,a,o=n(24),s=n(81),l=n(51),c=n(19),u=n(8),f=u.process,d=u.setImmediate,h=u.clearImmediate,p=u.MessageChannel,m=u.Dispatch,v=0,g={},y="onreadystatechange",_=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){_.call(e.data)};d&&h||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(38)(f)?r=function(e){f.nextTick(o(_,e,1))}:m&&m.now?r=function(e){m.now(o(_,e,1))}:p?(i=new p,a=i.port2,i.port1.onmessage=b,r=o(a.postMessage,a,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(r=function(e){u.postMessage(e+"","*")},u.addEventListener("message",b,!1)):r=y in c("script")?function(e){l.appendChild(c("script"))[y]=function(){l.removeChild(this),_.call(e)}}:function(e){setTimeout(o(_,e,1),0)}),e.exports={set:d,clear:h}},function(e,t,n){var r=n(8),i=n(213).set,a=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,l="process"==n(38)(o);e.exports=function(){var e,t,n,c=function(){var r,i;for(l&&(r=o.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){o.nextTick(c)};else if(!a||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(c)}}else n=function(){i.call(r,c)};else{var f=!0,d=document.createTextNode("");new a(c).observe(d,{characterData:!0}),n=function(){d.data=f=!f}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(25);e.exports.f=function(e){return new r(e)}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(8),i=r.navigator;e.exports=i&&i.userAgent||""},function(e,t,n){var r=n(16),i=n(17),a=n(215);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e),o=n.resolve;return o(t),n.promise}},function(e,t,n){var r=n(22);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var r=n(221),i=n(222),a="Map";e.exports=n(223)(a,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(i(this,a),e);return t&&t.v},set:function(e,t){return r.def(i(this,a),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(15).f,i=n(49),a=n(219),o=n(24),s=n(210),l=n(211),c=n(132),u=n(199),f=n(197),d=n(10),h=n(26).fastKey,p=n(222),m=d?"_s":"size",v=function(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var u=e(function(e,r){s(e,u,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=r&&l(r,n,e[c],e)});return a(u.prototype,{clear:function(){for(var e=p(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=p(this,t),r=v(n,e);if(r){var i=r.n,a=r.p;delete n._i[r.i],r.r=!0,a&&(a.n=i),i&&(i.p=a),n._f==r&&(n._f=i),n._l==r&&(n._l=a),n[m]--}return!!r},forEach:function(e){p(this,t);for(var n,r=o(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!v(p(this,t),e)}}),d&&r(u.prototype,"size",{get:function(){return p(this,t)[m]}}),u},def:function(e,t,n){var r,i,a=v(e,t);return a?a.v=n:(e._l=a={i:i=h(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[m]++,"F"!==i&&(e._i[i]=a)),e},getEntry:v,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=p(e,t),this._k=n,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?u(0,n.k):"values"==t?u(0,n.v):u(0,[n.k,n.v]):(e._t=void 0,u(1))},n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){var r=n(17);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var r=n(8),i=n(12),a=n(22),o=n(219),s=n(26),l=n(211),c=n(210),u=n(17),f=n(11),d=n(170),h=n(29),p=n(91);e.exports=function(e,t,n,m,v,g){var y=r[e],_=y,b=v?"set":"add",w=_&&_.prototype,x={},k=function(e){var t=w[e];a(w,e,"delete"==e?function(e){return!(g&&!u(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!u(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof _&&(g||w.forEach&&!f(function(){(new _).entries().next()}))){var S=new _,C=S[b](g?{}:-0,1)!=S,E=f(function(){S.has(1)}),I=d(function(e){new _(e)}),A=!g&&f(function(){for(var e=new _,t=5;t--;)e[b](t,t);return!e.has(-0)});I||(_=t(function(t,n){c(t,_,e);var r=p(new y,t,_);return void 0!=n&&l(n,v,r[b],r),r}),_.prototype=w,w.constructor=_),(E||A)&&(k("delete"),k("has"),v&&k("get")),(A||C)&&k(b),g&&w.clear&&delete w.clear}else _=m.getConstructor(t,e,v,b),o(_.prototype,n),s.NEED=!0;return h(_,e),x[e]=_,i(i.G+i.W+i.F*(_!=y),x),g||m.setStrong(_,e,v),_}},function(e,t,n){"use strict";var r=n(221),i=n(222),a="Set";e.exports=n(223)(a,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,a),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,i=n(177)(0),a=n(22),o=n(26),s=n(72),l=n(226),c=n(17),u=n(11),f=n(222),d="WeakMap",h=o.getWeak,p=Object.isExtensible,m=l.ufstore,v={},g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(c(e)){var t=h(e);return t===!0?m(f(this,d)).get(e):t?t[this._i]:void 0}},set:function(e,t){return l.def(f(this,d),e,t)}},_=e.exports=n(223)(d,g,y,l,!0,!0);u(function(){return 7!=(new _).set((Object.freeze||Object)(v),7).get(v)})&&(r=l.getConstructor(g,d),s(r.prototype,y),o.NEED=!0,i(["delete","has","get","set"],function(e){var t=_.prototype,n=t[e];a(t,e,function(t,i){if(c(t)&&!p(t)){this._f||(this._f=new r);var a=this._f[e](t,i);return"set"==e?this:a}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r=n(219),i=n(26).getWeak,a=n(16),o=n(17),s=n(210),l=n(211),c=n(177),u=n(9),f=n(222),d=c(5),h=c(6),p=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return d(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,a){var c=e(function(e,r){s(e,c,t,"_i"),e._t=t,e._i=p++,e._l=void 0,void 0!=r&&l(r,n,e[a],e)});return r(c.prototype,{delete:function(e){if(!o(e))return!1;var n=i(e);return n===!0?m(f(this,t)).delete(e):n&&u(n,this._i)&&delete n[this._i]},has:function(e){if(!o(e))return!1;var n=i(e);return n===!0?m(f(this,t)).has(e):n&&u(n,this._i)}}),c},def:function(e,t,n){var r=i(a(t),!0);return r===!0?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){"use strict";var r=n(226),i=n(222),a="WeakSet";n(223)(a,function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,a),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(12),i=n(229),a=n(230),o=n(16),s=n(43),l=n(41),c=n(17),u=n(8).ArrayBuffer,f=n(212),d=a.ArrayBuffer,h=a.DataView,p=i.ABV&&u.isView,m=d.prototype.slice,v=i.VIEW,g="ArrayBuffer";r(r.G+r.W+r.F*(u!==d),{ArrayBuffer:d}),r(r.S+r.F*!i.CONSTR,g,{isView:function(e){return p&&p(e)||c(e)&&v in e}}),r(r.P+r.U+r.F*n(11)(function(){return!new d(2).slice(1,void 0).byteLength}),g,{slice:function(e,t){if(void 0!==m&&void 0===t)return m.call(o(this),e);for(var n=o(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),a=new(f(this,d))(l(i-r)),c=new h(this),u=new h(a),p=0;r>1,u=23===t?U(2,-24)-U(2,-77):0,f=0,d=e<0||0===e&&1/e<0?1:0;for(e=q(e),e!=e||e===F?(i=e!=e?1:0,r=l):(r=V(B(e)/G),e*(a=U(2,-r))<1&&(r--,a*=2),e+=r+c>=1?u/a:u*U(2,1-c),e*a>=2&&(r++,a/=2),r+c>=l?(i=0,r=l):r+c>=1?(i=(e*a-1)*U(2,t),r+=c):(i=e*U(2,c-1)*U(2,t),r=0));t>=8;o[f++]=255&i,i/=256,t-=8);for(r=r<0;o[f++]=255&r,r/=256,s-=8);return o[--f]|=128*d,o}function i(e,t,n){var r,i=8*n-t-1,a=(1<>1,s=i-7,l=n-1,c=e[l--],u=127&c;for(c>>=7;s>0;u=256*u+e[l],l--,s-=8);for(r=u&(1<<-s)-1,u>>=-s,s+=t;s>0;r=256*r+e[l],l--,s-=8);if(0===u)u=1-o;else{if(u===a)return r?NaN:c?-F:F;r+=U(2,t),u-=o}return(c?-1:1)*r*U(2,u-t)}function a(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function o(e){return[255&e]}function s(e){return[255&e,e>>8&255]}function l(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function c(e){return r(e,52,8)}function u(e){return r(e,23,4)}function f(e,t,n){E(e[T],t,{get:function(){return this[n]}})}function d(e,t,n,r){var i=+n,a=S(i);if(a+t>e[Y])throw z(j);var o=e[W]._b,s=a+e[J],l=o.slice(s,s+t);return r?l:l.reverse()}function h(e,t,n,r,i,a){var o=+n,s=S(o);if(s+t>e[Y])throw z(j);for(var l=e[W]._b,c=s+e[J],u=r(+i),f=0;fee;)(X=Z[ee++])in D||y(D,X,R[X]);v||(Q.constructor=D)}var te=new L(new D(2)),ne=L[T].setInt8;te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||_(L[T],{setInt8:function(e,t){ne.call(this,e,t<<24>>24)},setUint8:function(e,t){ne.call(this,e,t<<24>>24)}},!0)}else D=function(e){w(this,D,O);var t=S(e);this._b=I.call(new Array(t),0),this[Y]=t},L=function(e,t,n){w(this,L,M),w(e,D,M);var r=e[Y],i=x(t);if(i<0||i>r)throw z("Wrong offset!");if(n=void 0===n?r-i:k(n),i+n>r)throw z(P);this[W]=e,this[J]=i,this[Y]=n},m&&(f(D,H,"_l"),f(L,$,"_b"),f(L,H,"_l"),f(L,K,"_o")),_(L[T],{getInt8:function(e){return d(this,1,e)[0]<<24>>24},getUint8:function(e){return d(this,1,e)[0]},getInt16:function(e){var t=d(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=d(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return a(d(this,4,e,arguments[1]))},getUint32:function(e){return a(d(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return i(d(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return i(d(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){h(this,1,e,o,t)},setUint8:function(e,t){h(this,1,e,o,t)},setInt16:function(e,t){h(this,2,e,s,t,arguments[2])},setUint16:function(e,t){h(this,2,e,s,t,arguments[2])},setInt32:function(e,t){h(this,4,e,l,t,arguments[2])},setUint32:function(e,t){h(this,4,e,l,t,arguments[2])},setFloat32:function(e,t){h(this,4,e,u,t,arguments[2])},setFloat64:function(e,t){h(this,8,e,c,t,arguments[2])}});A(D,O),A(L,M),y(L[T],g.VIEW,!0),t[O]=D,t[M]=L},function(e,t,n){var r=n(42),i=n(41);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(12);r(r.G+r.W+r.F*!n(229).ABV,{DataView:n(230).DataView})},function(e,t,n){n(234)("Int8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){"use strict";if(n(10)){var r=n(28),i=n(8),a=n(11),o=n(12),s=n(229),l=n(230),c=n(24),u=n(210),f=n(21),d=n(14),h=n(219),p=n(42),m=n(41),v=n(231),g=n(43),y=n(20),_=n(9),b=n(78),w=n(17),x=n(61),k=n(167),S=n(49),C=n(62),E=n(53).f,I=n(169),A=n(23),O=n(30),M=n(177),T=n(40),P=n(212),j=n(198),D=n(133),L=n(170),N=n(197),z=n(193),F=n(190),R=n(15),q=n(54),U=R.f,V=q.f,B=i.RangeError,G=i.TypeError,$=i.Uint8Array,H="ArrayBuffer",K="Shared"+H,W="BYTES_PER_ELEMENT",Y="prototype",J=Array[Y],X=l.ArrayBuffer,Q=l.DataView,Z=M(0),ee=M(2),te=M(3),ne=M(4),re=M(5),ie=M(6),ae=T(!0),oe=T(!1),se=j.values,le=j.keys,ce=j.entries,ue=J.lastIndexOf,fe=J.reduce,de=J.reduceRight,he=J.join,pe=J.sort,me=J.slice,ve=J.toString,ge=J.toLocaleString,ye=O("iterator"),_e=O("toStringTag"),be=A("typed_constructor"),we=A("def_constructor"),xe=s.CONSTR,ke=s.TYPED,Se=s.VIEW,Ce="Wrong length!",Ee=M(1,function(e,t){return Te(P(e,e[we]),t)}),Ie=a(function(){return 1===new $(new Uint16Array([1]).buffer)[0]}),Ae=!!$&&!!$[Y].set&&a(function(){new $(1).set({})}),Oe=function(e,t){var n=p(e);if(n<0||n%t)throw B("Wrong offset!");return n},Me=function(e){if(w(e)&&ke in e)return e;throw G(e+" is not a typed array!")},Te=function(e,t){if(!(w(e)&&be in e))throw G("It is not a typed array constructor!");return new e(t)},Pe=function(e,t){return je(P(e,e[we]),t)},je=function(e,t){for(var n=0,r=t.length,i=Te(e,r);r>n;)i[n]=t[n++];return i},De=function(e,t,n){U(e,t,{get:function(){return this._d[n]}})},Le=function(e){var t,n,r,i,a,o,s=x(e),l=arguments.length,u=l>1?arguments[1]:void 0,f=void 0!==u,d=I(s);if(void 0!=d&&!k(d)){for(o=d.call(s),r=[],t=0;!(a=o.next()).done;t++)r.push(a.value);s=r}for(f&&l>2&&(u=c(u,arguments[2],2)),t=0,n=m(s.length),i=Te(this,n);n>t;t++)i[t]=f?u(s[t],t):s[t];return i},Ne=function(){for(var e=0,t=arguments.length,n=Te(this,t);t>e;)n[e]=arguments[e++];return n},ze=!!$&&a(function(){ge.call(new $(1))}),Fe=function(){return ge.apply(ze?me.call(Me(this)):Me(this),arguments)},Re={copyWithin:function(e,t){return F.call(Me(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return ne(Me(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return z.apply(Me(this),arguments)},filter:function(e){return Pe(this,ee(Me(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return re(Me(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ie(Me(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Z(Me(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return oe(Me(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return ae(Me(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return he.apply(Me(this),arguments)},lastIndexOf:function(e){return ue.apply(Me(this),arguments)},map:function(e){return Ee(Me(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return fe.apply(Me(this),arguments)},reduceRight:function(e){return de.apply(Me(this),arguments)},reverse:function(){for(var e,t=this,n=Me(t).length,r=Math.floor(n/2),i=0;i1?arguments[1]:void 0)},sort:function(e){return pe.call(Me(this),e)},subarray:function(e,t){var n=Me(this),r=n.length,i=g(e,r);return new(P(n,n[we]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,m((void 0===t?r:g(t,r))-i))}},qe=function(e,t){return Pe(this,me.call(Me(this),e,t))},Ue=function(e){Me(this);var t=Oe(arguments[1],1),n=this.length,r=x(e),i=m(r.length),a=0;if(i+t>n)throw B(Ce);for(;a255?255:255&r),i.v[h](n*t+i.o,r,Ie)},O=function(e,t){U(e,t,{get:function(){return I(this,t)},set:function(e){return A(this,t,e)},enumerable:!0})};_?(p=n(function(e,n,r,i){u(e,p,c,"_d");var a,o,s,l,f=0,h=0;if(w(n)){if(!(n instanceof X||(l=b(n))==H||l==K))return ke in n?je(p,n):Le.call(p,n);a=n,h=Oe(r,t);var g=n.byteLength;if(void 0===i){if(g%t)throw B(Ce);if(o=g-h,o<0)throw B(Ce)}else if(o=m(i)*t,o+h>g)throw B(Ce);s=o/t}else s=v(n),o=s*t,a=new X(o);for(d(e,"_d",{b:a,o:h,l:o,e:s,v:new Q(a)});f=n.length)return{value:void 0,done:!0};while(!((e=n[t._i++])in t._t));return{value:e,done:!1}}),r(r.S,"Reflect",{enumerate:function(e){return new a(e)}})},function(e,t,n){function r(e,t){var n,s,u=arguments.length<3?e:arguments[2];return c(e)===u?e[t]:(n=i.f(e,t))?o(n,"value")?n.value:void 0!==n.get?n.get.call(u):void 0:l(s=a(e))?r(s,t,u):void 0}var i=n(54),a=n(62),o=n(9),s=n(12),l=n(17),c=n(16);s(s.S,"Reflect",{get:r})},function(e,t,n){var r=n(54),i=n(12),a=n(16);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(a(e),t)}})},function(e,t,n){var r=n(12),i=n(62),a=n(16);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(a(e))}})},function(e,t,n){var r=n(12);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(12),i=n(16),a=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!a||a(e)}})},function(e,t,n){var r=n(12);r(r.S,"Reflect",{ownKeys:n(254)})},function(e,t,n){var r=n(53),i=n(46),a=n(16),o=n(8).Reflect;e.exports=o&&o.ownKeys||function(e){var t=r.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(12),i=n(16),a=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return a&&a(e),!0}catch(e){return!1}}})},function(e,t,n){function r(e,t,n){var l,d,h=arguments.length<4?e:arguments[3],p=a.f(u(e),t);if(!p){if(f(d=o(e)))return r(d,t,n,h);p=c(0)}if(s(p,"value")){if(p.writable===!1||!f(h))return!1;if(l=a.f(h,t)){if(l.get||l.set||l.writable===!1)return!1;l.value=n,i.f(h,t,l)}else i.f(h,t,c(0,n));return!0}return void 0!==p.set&&(p.set.call(h,n),!0)}var i=n(15),a=n(54),o=n(62),s=n(9),l=n(12),c=n(21),u=n(16),f=n(17);l(l.S,"Reflect",{set:r})},function(e,t,n){var r=n(12),i=n(76);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){"use strict";var r=n(12),i=n(40)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(191)("includes")},function(e,t,n){"use strict";var r=n(12),i=n(260),a=n(61),o=n(41),s=n(25),l=n(178);r(r.P,"Array",{flatMap:function(e){var t,n,r=a(this);return s(e),t=o(r.length),n=l(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(191)("flatMap")},function(e,t,n){"use strict";function r(e,t,n,c,u,f,d,h){for(var p,m,v=u,g=0,y=!!d&&s(d,h,3);g0)v=r(e,t,p,o(p.length),v,f-1)-1;else{if(v>=9007199254740991)throw TypeError();e[v]=p}v++}g++}return v}var i=n(48),a=n(17),o=n(41),s=n(24),l=n(30)("isConcatSpreadable");e.exports=r},function(e,t,n){"use strict";var r=n(12),i=n(260),a=n(61),o=n(41),s=n(42),l=n(178);r(r.P,"Array",{flatten:function(){var e=arguments[0],t=a(this),n=o(t.length),r=l(t,0);return i(r,t,t,n,0,void 0===e?1:s(e)),r}}),n(191)("flatten")},function(e,t,n){"use strict";var r=n(12),i=n(131)(!0);r(r.P,"String",{at:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(12),i=n(264),a=n(217);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(a),"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){var r=n(41),i=n(94),a=n(39);e.exports=function(e,t,n,o){var s=String(a(e)),l=s.length,c=void 0===n?" ":String(n),u=r(t);if(u<=l||""==c)return s;var f=u-l,d=i.call(c,Math.ceil(f/c.length));return d.length>f&&(d=d.slice(0,f)),o?d+s:s+d}},function(e,t,n){"use strict";var r=n(12),i=n(264),a=n(217);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(a),"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){"use strict";n(86)("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},function(e,t,n){"use strict";n(86)("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},function(e,t,n){"use strict";var r=n(12),i=n(39),a=n(41),o=n(138),s=n(201),l=RegExp.prototype,c=function(e,t){this._r=e,this._s=t};n(134)(c,"RegExp String",function(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),r(r.P,"String",{matchAll:function(e){if(i(this),!o(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in l?String(e.flags):s.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=a(e.lastIndex),new c(r,t)}})},function(e,t,n){n(32)("asyncIterator")},function(e,t,n){n(32)("observable")},function(e,t,n){var r=n(12),i=n(254),a=n(36),o=n(54),s=n(168);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),l=o.f,c=i(r),u={},f=0;c.length>f;)n=l(r,t=c[f++]),void 0!==n&&s(u,t,n);return u}})},function(e,t,n){var r=n(12),i=n(273)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){var r=n(34),i=n(36),a=n(47).f;e.exports=function(e){return function(t){for(var n,o=i(t),s=r(o),l=s.length,c=0,u=[];l>c;)a.call(o,n=s[c++])&&u.push(e?[n,o[n]]:o[n]);return u}}},function(e,t,n){var r=n(12),i=n(273)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){"use strict";var r=n(12),i=n(61),a=n(25),o=n(15);n(10)&&r(r.P+n(276),"Object",{__defineGetter__:function(e,t){o.f(i(this),e,{get:a(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";e.exports=n(28)||!n(11)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete n(8)[e]})},function(e,t,n){"use strict";var r=n(12),i=n(61),a=n(25),o=n(15);n(10)&&r(r.P+n(276),"Object",{__defineSetter__:function(e,t){o.f(i(this),e,{set:a(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(12),i=n(61),a=n(20),o=n(62),s=n(54).f;n(10)&&r(r.P+n(276),"Object",{__lookupGetter__:function(e){var t,n=i(this),r=a(e,!0);do if(t=s(n,r))return t.get;while(n=o(n))}})},function(e,t,n){"use strict";var r=n(12),i=n(61),a=n(20),o=n(62),s=n(54).f;n(10)&&r(r.P+n(276),"Object",{__lookupSetter__:function(e){var t,n=i(this),r=a(e,!0);do if(t=s(n,r))return t.set;while(n=o(n))}})},function(e,t,n){var r=n(12);r(r.P+r.R,"Map",{toJSON:n(281)("Map")})},function(e,t,n){var r=n(78),i=n(282);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){var r=n(211);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){var r=n(12);r(r.P+r.R,"Set",{toJSON:n(281)("Set")})},function(e,t,n){n(285)("Map")},function(e,t,n){"use strict";var r=n(12);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){n(285)("Set")},function(e,t,n){n(285)("WeakMap")},function(e,t,n){n(285)("WeakSet")},function(e,t,n){n(290)("Map")},function(e,t,n){"use strict";var r=n(12),i=n(25),a=n(24),o=n(211);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,l=arguments[1];return i(this),t=void 0!==l,t&&i(l),void 0==e?new this:(n=[],t?(r=0,s=a(l,arguments[2],2),o(e,!1,function(e){n.push(s(e,r++))})):o(e,!1,n.push,n),new this(n))}})}},function(e,t,n){n(290)("Set")},function(e,t,n){n(290)("WeakMap")},function(e,t,n){n(290)("WeakSet")},function(e,t,n){var r=n(12);r(r.G,{global:n(8)})},function(e,t,n){var r=n(12);r(r.S,"System",{global:n(8)})},function(e,t,n){var r=n(12),i=n(38);r(r.S,"Error",{isError:function(e){return"Error"===i(e)}})},function(e,t,n){var r=n(12);r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},function(e,t,n){var r=n(12);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(e,t,n){var r=n(12),i=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*i}})},function(e,t,n){var r=n(12),i=n(301),a=n(117);r(r.S,"Math",{fscale:function(e,t,n,r,o){return a(i(e,t,n,r,o))}})},function(e,t){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-(1/0)?e:(e-t)*(i-r)/(n-t)+r}},function(e,t,n){var r=n(12);r(r.S,"Math",{iaddh:function(e,t,n,r){var i=e>>>0,a=t>>>0,o=n>>>0;return a+(r>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(e,t,n){var r=n(12);r(r.S,"Math",{isubh:function(e,t,n,r){var i=e>>>0,a=t>>>0,o=n>>>0;return a-(r>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(e,t,n){var r=n(12);r(r.S,"Math",{imulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>16,l=i>>16,c=(s*o>>>0)+(a*o>>>16);return s*l+(c>>16)+((a*l>>>0)+(c&n)>>16)}})},function(e,t,n){var r=n(12);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(12),i=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*i}})},function(e,t,n){var r=n(12);r(r.S,"Math",{scale:n(301)})},function(e,t,n){var r=n(12);r(r.S,"Math",{umulh:function(e,t){var n=65535,r=+e,i=+t,a=r&n,o=i&n,s=r>>>16,l=i>>>16,c=(s*o>>>0)+(a*o>>>16);return s*l+(c>>>16)+((a*l>>>0)+(c&n)>>>16)}})},function(e,t,n){var r=n(12);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},function(e,t,n){"use strict";var r=n(12),i=n(13),a=n(8),o=n(212),s=n(218);r(r.P+r.R,"Promise",{finally:function(e){var t=o(this,i.Promise||a.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(12),i=n(215),a=n(216);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=a(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}}); },function(e,t,n){var r=n(313),i=n(16),a=r.key,o=r.set;r.exp({defineMetadata:function(e,t,n,r){o(e,t,i(n),a(r))}})},function(e,t,n){var r=n(220),i=n(12),a=n(27)("metadata"),o=a.store||(a.store=new(n(225))),s=function(e,t,n){var i=o.get(e);if(!i){if(!n)return;o.set(e,i=new r)}var a=i.get(t);if(!a){if(!n)return;i.set(t,a=new r)}return a},l=function(e,t,n){var r=s(t,n,!1);return void 0!==r&&r.has(e)},c=function(e,t,n){var r=s(t,n,!1);return void 0===r?void 0:r.get(e)},u=function(e,t,n,r){s(n,r,!0).set(e,t)},f=function(e,t){var n=s(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},d=function(e){return void 0===e||"symbol"==typeof e?e:String(e)},h=function(e){i(i.S,"Reflect",e)};e.exports={store:o,map:s,has:l,get:c,set:u,keys:f,key:d,exp:h}},function(e,t,n){var r=n(313),i=n(16),a=r.key,o=r.map,s=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:a(arguments[2]),r=o(i(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var l=s.get(t);return l.delete(n),!!l.size||s.delete(t)}})},function(e,t,n){var r=n(313),i=n(16),a=n(62),o=r.has,s=r.get,l=r.key,c=function(e,t,n){var r=o(e,t,n);if(r)return s(e,t,n);var i=a(t);return null!==i?c(e,i,n):void 0};r.exp({getMetadata:function(e,t){return c(e,i(t),arguments.length<3?void 0:l(arguments[2]))}})},function(e,t,n){var r=n(224),i=n(282),a=n(313),o=n(16),s=n(62),l=a.keys,c=a.key,u=function(e,t){var n=l(e,t),a=s(e);if(null===a)return n;var o=u(a,t);return o.length?n.length?i(new r(n.concat(o))):o:n};a.exp({getMetadataKeys:function(e){return u(o(e),arguments.length<2?void 0:c(arguments[1]))}})},function(e,t,n){var r=n(313),i=n(16),a=r.get,o=r.key;r.exp({getOwnMetadata:function(e,t){return a(e,i(t),arguments.length<3?void 0:o(arguments[2]))}})},function(e,t,n){var r=n(313),i=n(16),a=r.keys,o=r.key;r.exp({getOwnMetadataKeys:function(e){return a(i(e),arguments.length<2?void 0:o(arguments[1]))}})},function(e,t,n){var r=n(313),i=n(16),a=n(62),o=r.has,s=r.key,l=function(e,t,n){var r=o(e,t,n);if(r)return!0;var i=a(t);return null!==i&&l(e,i,n)};r.exp({hasMetadata:function(e,t){return l(e,i(t),arguments.length<3?void 0:s(arguments[2]))}})},function(e,t,n){var r=n(313),i=n(16),a=r.has,o=r.key;r.exp({hasOwnMetadata:function(e,t){return a(e,i(t),arguments.length<3?void 0:o(arguments[2]))}})},function(e,t,n){var r=n(313),i=n(16),a=n(25),o=r.key,s=r.set;r.exp({metadata:function(e,t){return function(n,r){s(e,t,(void 0!==r?i:a)(n),o(r))}}})},function(e,t,n){var r=n(12),i=n(214)(),a=n(8).process,o="process"==n(38)(a);r(r.G,{asap:function(e){var t=o&&a.domain;i(t?t.bind(e):e)}})},function(e,t,n){"use strict";var r=n(12),i=n(8),a=n(13),o=n(214)(),s=n(30)("observable"),l=n(25),c=n(16),u=n(210),f=n(219),d=n(14),h=n(211),p=h.RETURN,m=function(e){return null==e?void 0:l(e)},v=function(e){var t=e._c;t&&(e._c=void 0,t())},g=function(e){return void 0===e._o},y=function(e){g(e)||(e._o=void 0,v(e))},_=function(e,t){c(e),this._c=void 0,this._o=e,e=new b(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:l(n),this._c=n)}catch(t){return void e.error(t)}g(this)&&v(this)};_.prototype=f({},{unsubscribe:function(){y(this)}});var b=function(e){this._s=e};b.prototype=f({},{next:function(e){var t=this._s;if(!g(t)){var n=t._o;try{var r=m(n.next);if(r)return r.call(n,e)}catch(e){try{y(t)}finally{throw e}}}},error:function(e){var t=this._s;if(g(t))throw e;var n=t._o;t._o=void 0;try{var r=m(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{v(t)}finally{throw e}}return v(t),e},complete:function(e){var t=this._s;if(!g(t)){var n=t._o;t._o=void 0;try{var r=m(n.complete);e=r?r.call(n,e):void 0}catch(e){try{v(t)}finally{throw e}}return v(t),e}}});var w=function(e){u(this,w,"Observable","_f")._f=l(e)};f(w.prototype,{subscribe:function(e){return new _(e,this._f)},forEach:function(e){var t=this;return new(a.Promise||i.Promise)(function(n,r){l(e);var i=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n})})}}),f(w,{from:function(e){var t="function"==typeof this?this:w,n=m(c(e)[s]);if(n){var r=c(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}return new t(function(t){var n=!1;return o(function(){if(!n){try{if(h(e,!1,function(e){if(t.next(e),n)return p})===p)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e2,i=!!r&&o.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},function(e,t,n){var r=n(12),i=n(213);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,n){for(var r=n(198),i=n(34),a=n(22),o=n(8),s=n(14),l=n(133),c=n(30),u=c("iterator"),f=c("toStringTag"),d=l.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(h),m=0;m=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=_.call(i,"catchLoc"),s=_.call(i,"finallyLoc");if(o&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&_.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),h(n),M}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;h(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:m(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=g),M}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,function(){return this}(),n(5))},function(e,t,n){n(329),e.exports=n(13).RegExp.escape},function(e,t,n){var r=n(12),i=n(330)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return i(e)}})},function(e,t){e.exports=function(e,t){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,n)}}},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return e}function a(e){return e.text().then(function(e){var t=e;try{t=JSON.parse(e)}catch(t){var n=document.createElement("div");n.innerHTML=e;var r=new Error;throw r.stack=(0,v.default)(n.innerText),r}return t})}function o(e){if(g)return!0;var t=e.status||(e.error?"error":""),n=e.message||(e.error?e.error.message:null),r=e.toastr||null,i=void 0;switch(t){case"unauthenticated":throw document.location.href=p.config.base_url_relative,y("Logged out");case"unauthorized":t="error",n=n||"Unauthorized.";break;case"error":t="error",n=n||"Unknown error.";break;case"success":t="success",n=n||"";break;default:t="error",n=n||"Invalid AJAX response."}return r&&(i=Object.assign({},f.default.options),Object.keys(r).forEach(function(e){f.default.options[e]=r[e]})),n&&(h.default||!h.default&&"error"!==t)&&f.default["success"===t?"success":"error"](n),r&&(f.default.options=i),e}function s(e){if(g)return!0;var t=e.stack?"
"+e.stack+"
":"";f.default.error("Fetch Failed:
"+e.message+" "+t),console.error(e.message+" at "+e.stack)}Object.defineProperty(t,"__esModule",{value:!0}),t.parseStatus=i,t.parseJSON=a,t.userFeedback=o,t.userFeedbackError=s;var l=n(1),c=r(l),u=n(332),f=r(u),d=n(335),h=r(d),p=n(336),m=n(337),v=r(m),g=!1,y=function e(t){var e=new Error(t.statusText||t||"");return e.response=t,e};(0,c.default)(e).on("beforeunload._ajax",function(){g=!0})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(333),a=r(i);a.default.options.positionClass="toast-top-right",a.default.options.preventDuplicates=!0,t.default=a.default},,,function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i),o=n(335),s=r(o),l=(0,a.default)("#offline-status");(0,a.default)(window).on("offline",function(){l.slideDown()}),(0,a.default)(window).on("online",function(){l.slideUp()}),(0,a.default)(document).ready(function(){s.default||l.slideDown()}),t.default="undefined"==typeof e.navigator.onLine||e.navigator.onLine}).call(t,function(){return this}())},function(e,t){e.exports=GravAdmin},function(e,t,n){function r(e,t){return e=i(e),t=t||a,o(s(e,t),t)}var i=n(338),a=n(339),o=n(340),s=n(341);e.exports=r},function(e,t){function n(e){return null==e?"":e.toString()}e.exports=n},function(e,t){e.exports=[" ","\n","\r","\t","\f","\v"," "," ","᠎"," "," "," "," "," "," "," "," "," "," "," ","\u2028","\u2029"," "," "," "]},function(e,t,n){function r(e,t){e=i(e),t=t||a;for(var n,r,o=0,s=e.length,l=t.length,c=!0;c&&o=s?"":e.substr(o,s)}var i=n(338),a=n(339);e.exports=r},function(e,t,n){function r(e,t){e=i(e),t=t||a;for(var n,r,o=e.length-1,s=t.length,l=!0;l&&o>=0;)for(l=!1,n=-1,r=e.charAt(o);++n=0?e.substring(0,o+1):""}var i=n(338),a=n(339);e.exports=r},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,l,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(n=this._events[e],o(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(a(n))for(s=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,l=0;l0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,o,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){(function(e){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.setPayload(t),this.task="task"+u.config.param_sep}return a(e,[{key:"setPayload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.payload=e,this}},{key:"fetch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return h.Instance.fetch(function(t){return e.setPayload(t)},t),this}},{key:"maintenance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"hide",t=(0,s.default)("#updates [data-update-packages]");return t["show"===e?"fadeIn":"fadeOut"](),"hide"===e&&(0,s.default)(".badges.with-updates").removeClass("with-updates").find(".badge.updates").remove(),this}},{key:"grav",value:function(){var e=this.payload.grav;if(e&&e.isUpdatable){var t=this.task,n="";n+=e.isSymlink?'':'",n+="\n Grav v"+e.available+" "+u.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+'! ('+u.translations.PLUGIN_ADMIN.CURRENT+" v"+e.version+")\n ";var r=(0,s.default)("[data-gpm-grav]").removeClass("hidden");r.is(":empty")&&r.hide(),r.addClass("grav").html(""+n).slideDown(150).parent("#messages").addClass("default-box-shadow")}return(0,s.default)("#grav-update-button").on("click",function(){(0,s.default)(this).html(u.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,d.default)(e.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload||!this.payload.resources||!this.payload.resources.total)return this.maintenance("hide");var e=!0,t=["plugins","themes"],n=["plugin","theme"],r=this.payload.resources,i=r.plugins,a=r.themes;return this.payload.resources.total?([i,a].forEach(function(r,i){if(r&&!Array.isArray(r)){var a=Object.keys(r).length,o=t[i];(0,s.default)('#admin-menu a[href$="/'+t[i]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(a);var l="";l="plugins"===o?u.translations.PLUGIN_ADMIN.PLUGINS:u.translations.PLUGIN_ADMIN.THEMES;var f=(0,s.default)(".grav-update."+o);f.css("display","block").html('\n

\n '+u.translations.PLUGIN_ADMIN.UPDATE+" "+u.translations.PLUGIN_ADMIN.ALL+" "+l+'\n \n '+a+" "+u.translations.PLUGIN_ADMIN.OF_YOUR+" "+l.toLowerCase()+" "+u.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+"\n

\n ");var d=(0,s.default)("[data-update-packages]").attr("data-packages-slugs")||"";d=d?d.split(","):[];var h=(0,c.default)(d.concat(Object.keys(r))).join();(0,s.default)("[data-update-packages]").attr("data-packages-slugs",""+h),Object.keys(r).forEach(function(t){var a=(0,s.default)("[data-gpm-"+n[i]+'="'+t+'"]'),l=a.find(".gpm-name"),c=l.find("a"),f=a.parents(".content-wrapper");if("plugins"!==o||l.find(".badge.update").length?"themes"===o&&(l.append('"),f.addClass("has-updates")):(l.append(''+u.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!"),f.addClass("has-updates")),a.length){var d=(0,s.default)(".grav-update."+n[i]);if(d.length){var h="testing"===r[t].type?'test release':"";d.html('\n

\n '+u.translations.PLUGIN_ADMIN.UPDATE+" "+(n[i].charAt(0).toUpperCase()+n[i].substr(1).toLowerCase())+'\n \n v'+r[t].available+" "+h+" "+u.translations.PLUGIN_ADMIN.OF_THIS+" "+n[i]+" "+u.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+"!\n

\n ").css("display","block"),e=!1}}}),(0,s.default)("[data-update-packages]").removeClass("hidden")}}),(0,s.default)(".content-wrapper").addClass("updates-checked"),void(e||(0,s.default)(".warning-reinstall-not-latest-release").removeClass("hidden"))):this}}]),e}();t.default=y;var _=new y;t.Instance=_,t.Notifications=m.default,t.Feed=g.default,h.Instance.on("fetched",function(e,t){_.setPayload(e.payload||{}),_.grav().resources()}),"1"===u.config.enable_auto_updates_check&&h.Instance.fetch()},function(e,t,n){function r(e,t){return t=t||i,a(e,function(e,n,r){for(var i=r.length;++n0&&void 0!==arguments[0]?arguments[0]:{},n=t.filter,r=void 0===n?d():n,i=t.refresh,a=void 0!==i&&i;if(!f())return!1;var o=(0,s.default)("#notifications"),c=o.find(".widget-loader"),h=o.find(".widget-content > ul");c.find("div").remove(),c.find(".fa-warning").removeClass("fa-warning").addClass("fa-refresh fa-spin"),c.show(),h.hide();var p=function(t){var n=t.notifications;(0,s.default)("#notifications").find(".widget-content > ul").empty(),n&&Object.keys(n).forEach(function(t){return e.processLocation(t,n[t])})};(0,u.default)(l.config.base_url_relative+"/task"+l.config.param_sep+"getNotifications",{method:"post",body:{refresh:a,filter:r}},function(e){p(e)}).catch(function(){var e=(0,s.default)("#notifications .widget-content");e.find(".widget-loader").find("div").remove(),e.find(".widget-loader").append("
Failed to retrieve notifications
").find(".fa-spin").removeClass("fa-spin fa-refresh").addClass("fa-warning")})}}],[{key:"addShowAllInFeed",value:function(){(0,s.default)("#notifications ul").append('
  • Show all
  • ')}},{key:"showNotificationInFeed",value:function(t){var n=(0,s.default)("#notifications").removeClass("hidden"),r=n.find(".widget-loader").hide(),i=n.find(".widget-content > ul").show();r.find("div").remove(),r.find(".fa-warning").removeClass("fa-warning").addClass("fa-refresh fa-spin"),i.append(t).find("li:nth-child(n+11)").addClass("hidden"),i.find("li.hidden").length&&e.addShowAllInFeed()}},{key:"showNotificationInTop",value:function(e){var t=(0,s.default)(".top-notifications-container"),n=(0,s.default)("
    ").html(e);t.removeClass("hidden").append(n.children()),n.children().slideDown(150)}},{key:"showNotificationInDashboard",value:function(e){var t=(0,s.default)(".dashboard-notifications-container"),n=(0,s.default)("
    ").html(e);t.removeClass("hidden").append(n.children()),n.children().slideDown(150)}},{key:"showNotificationInPlugins",value:function(e){var t=(0,s.default)(".plugins-notifications-container"),n=(0,s.default)("
    ").html(e);t.removeClass("hidden").append(n.children()),n.children().slideDown(150)}},{key:"showNotificationInThemes",value:function(e){var t=(0,s.default)(".themes-notifications-container"),n=(0,s.default)("
    ").html(e);t.removeClass("hidden").append(n.children()),n.children().slideDown(150)}},{key:"processLocation",value:function(t,n){switch(t){case"feed":e.showNotificationInFeed(n);break;case"top":n.read||e.showNotificationInTop(n);break;case"dashboard":n.read||e.showNotificationInDashboard(n);break;case"plugins":n.read||e.showNotificationInPlugins(n);break;case"themes": n.read||e.showNotificationInThemes(n)}}}]),e}(),p=new h;t.default=p,f()&&(p.fetch(),(0,s.default)(document).on("click",'[data-notification-action="hide-notification"]',function(e){var t=(0,s.default)(e.currentTarget),n=t.parent();n.slideUp(function(){return n.remove()})}),(0,s.default)(document).on("click",'[data-notification-action="show-all-notifications"]',function(e){(0,s.default)("#notifications .show-all").hide(),(0,s.default)("#notifications .hidden").removeClass("hidden")}),(0,s.default)(document).on("click",'[data-refresh="notifications"]',function(e){e.preventDefault(),p.fetch({filter:["feed"],refresh:!0})}))},function(e,t,n){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(331),i=n(336),a=void 0,o=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("function"==typeof n&&(o=n,n={}),n.method&&"post"===n.method){var s=new FormData;n.body=Object.assign({"admin-nonce":i.config.admin_nonce},n.body||{}),Object.keys(n.body).map(function(e){return s.append(e,n.body[e])}),n.body=s}return n=Object.assign({credentials:"same-origin",headers:{Accept:"application/json"}},n),e(t,n).then(function(e){return a=e,e}).then(r.parseStatus).then(r.parseJSON).then(r.userFeedback).then(function(e){return o(e,a)}).catch(r.userFeedbackError)};t.default=o}).call(t,n(4))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};(0,u.default)(f,{method:"post",body:{refresh:t}},function(t){e.data=t,n(t)})}},{key:"refresh",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,s.default)("#news-feed .widget-content");if(t.length){var n=t.find(".widget-loader");n.find("div").remove(),n.find(".fa-warning").removeClass("fa-warning").addClass("fa-refresh fa-spin"),n.show(),t.find("> ul").hide(),!this.data||this.data.error||e?this.fetch(e,this.updateContent.bind(this)):this.updateContent()}}},{key:"updateContent",value:function(){var e=(0,s.default)("#news-feed .widget-content");if(e.length){var t=e.find(".widget-loader").hide(),n=e.find("> ul").empty().show();return this.data.error||"error"===this.data.status?(t.show().find("div").remove(),t.find(".fa-refresh").removeClass("fa-refresh fa-spin").addClass("fa-warning"),void t.append("
    "+(this.data.error?this.data.error.message:this.data.message||"Unable to download news feed")+"
    ")):void(this.data&&this.data.feed_data&&n.append(this.data.feed_data))}}}]),e}(),h=new d;(0,s.default)(document).ready(function(){return h.refresh()}),(0,s.default)(document).on("click",'[data-refresh="feed"]',function(e){e.preventDefault(),h.refresh(!0)}),t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(3),s=n(336),l=n(332),c=r(l);(0,a.default)("[data-gpm-checkupdates]").on("click",function(){var e=(0,a.default)(this);e.find("i").addClass("fa-spin"),o.Instance.fetch(function(t){e.find("i").removeClass("fa-spin");var n=t.payload;if(n)if(n.grav.isUpdatable||n.resources.total){var r=n.grav.isUpdatable?"Grav v"+n.grav.available:"",i=n.resources.total?n.resources.total+" "+s.translations.PLUGIN_ADMIN.UPDATES_ARE_AVAILABLE:"";i||(r+=" "+s.translations.PLUGIN_ADMIN.IS_AVAILABLE_FOR_UPDATE),c.default.info(r+(r&&i?" "+s.translations.PLUGIN_ADMIN.AND+" ":"")+i)}else c.default.success(s.translations.PLUGIN_ADMIN.EVERYTHING_UP_TO_DATE)},!0)})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(359),s=r(o);(0,a.default)("body").on("click","[data-maintenance-update]",function(){var e=(0,a.default)(this),t=e.data("maintenanceUpdate");e.attr("disabled","disabled").find("> .fa").removeClass("fa-cloud-download").addClass("fa-refresh fa-spin"),(0,s.default)(t,function(t){"updategrav"===t.type&&((0,a.default)("[data-gpm-grav]").remove(),(0,a.default)("#footer .grav-version").html(t.version)),e.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-cloud-download")})})},function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var r=n(1),i=t(r),a=n(359),o=t(a),s=(0,i.default)('input[type="radio"][name="channel-switch"]');s&&s.on("change",function(t){var n=(0,i.default)(t.target),r=""+n.parent("[data-url]").data("url");(0,o.default)(r,{method:"post",body:{task:"gpmRelease",release:n.val()}},function(t){t.reload&&e.location.reload()})})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(365),a=r(i),o=n(367);n(368),t.default={Chart:{Chart:a.default,UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:o.Instance}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=t.UpdatesChart=t.defaults=void 0;var s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},l=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(o(this,e),this.element=(0,u.default)(t)||[],this.element[0]){var a=(this.element.data("chart-type")||"pie").toLowerCase();this.type=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase(),r=Object.assign({},v.options[this.type],r),i=Object.assign({},v.data,i),Object.assign(this,{options:r,data:i}),this.chart=d.default[this.type](this.element.find(".ct-chart").empty()[0],this.data,this.options),this.chart.on("created",function(){n.element.find(".hidden").removeClass("hidden"),n.element.find(".ct-label").each(function(e,t){t=(0,u.default)(t);var n=t.html().replace("<","<").replace(">",">");t.html(n)})})}}return l(e,[{key:"updateData",value:function(e){Object.assign(this.data,e),this.chart.update(this.data)}}]),e}();t.default=g;var y=t.UpdatesChart=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return a.chart.on("draw",function(e){return a.draw(e)}),p.Instance.on("fetched",function(e){if(e.payload){var t=e.payload.grav,n=100*(e.payload.resources.total+(t.isUpdatable?1:0))/(e.payload.installed+(t.isUpdatable?1:0)),r=100-n;a.updateData({series:[r,n]}),e.payload.resources.total&&m.Instance.maintenance("show")}}),a}return a(t,e),l(t,[{key:"draw",value:function(e){if(!e.index){var t=h.translations.PLUGIN_ADMIN[100===e.value?"FULLY_UPDATED":"UPDATES_AVAILABLE"];this.element.find(".numeric span").text(Math.round(e.value)+"%"),this.element.find(".js__updates-available-description").html(t),this.element.find(".hidden").removeClass("hidden")}}},{key:"updateData",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateData",this).call(this,e),this.data.series[0]<100&&this.element.closest("#updates").find("[data-update-packages]").fadeIn()}}]),t}(g),_={};(0,u.default)("[data-chart-name]").each(function(){var e=(0,u.default)(this),t=e.data("chart-name")||"",n=e.data("chart-options")||{},r=e.data("chart-data")||{};"updates"===t?_[t]=new y(e,n,r):_[t]=new g(e,n,r)});t.Instances=_},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return e&&(e="cleartype:"+e+"/"),l.config.base_url_relative+"/cache.json/task"+l.config.param_sep+"clearCache/"+e+"admin-nonce"+l.config.param_sep+l.config.admin_nonce},d=function(){function e(){var t=this;i(this,e),this.element=(0,s.default)("[data-clear-cache]"),(0,s.default)("body").on("click","[data-clear-cache]",function(e){return t.clear(e,e.target)})}return a(e,[{key:"clear",value:function(e,t){var n=this,r="";e&&e.preventDefault&&e.preventDefault(),"string"==typeof e&&(r=e),t=t?(0,s.default)(t):(0,s.default)('[data-clear-cache-type="'+r+'"]'),r=r||(0,s.default)(t).data("clear-cache-type")||"";var i=t.data("clearCache")||f(r);this.disable(),(0,u.default)(i,function(){return n.enable()})}},{key:"enable",value:function(){this.element.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-trash")}},{key:"disable",value:function(){this.element.attr("disabled","disabled").find("> .fa").removeClass("fa-trash").addClass("fa-refresh fa-spin")}}]),e}();t.default=d;var h=new d;t.Instance=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(336),s=n(359),l=r(s),c=n(365);(0,a.default)('[data-backup][data-ajax*="backup/"]').on("click",function(){var e=(0,a.default)(this),t=e.data("ajax"),n=e.closest(".dropdown-menu");(n.length?n:e).closest(".button-group").find("> button:first").attr("disabled","disabled").find("> .fa").removeClass("fa-life-ring").addClass("fa-spin fa-refresh"),(0,l.default)(t,function(){c.Instances&&c.Instances.backups&&(c.Instances.backups.updateData({series:[0,100]}),c.Instances.backups.element.find(".numeric").html("0 "+o.translations.PLUGIN_ADMIN.DAYS.toLowerCase()+"")),(n.length?n:e).closest(".button-group").find("> button:first").removeAttr("disabled").find("> .fa").removeClass("fa-spin fa-refresh").addClass("fa-life-ring")})}),(0,a.default)('[data-backup][data-ajax*="backupDelete"]').on("click",function(){var e=(0,a.default)(this),t=e.data("ajax"),n=e.closest("tr");n.addClass("deleting"),(0,l.default)(t,function(e){"success"===e.status?n.remove():n.removeClass("deleting")})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i),o=n(370),s=r(o),l=n(371),c=r(l),u=n(379),f=r(u),d=function(e,t){return("000"+e).substr(-t)},h=null,p=(0,a.default)("#ordering");p.length&&(h=new s.default(p.get(0),{filter:".ignore",onUpdate:function(){var e=[],t=p.children(),n=(t.length+"").split("").length;t.each(function(t,r){r=(0,a.default)(r),e.push(r.data("id")),r.find(".page-order").text(d(t+1,n)+".")}),(0,a.default)("[data-order]").val(e.join(","))}}),(0,a.default)(document).on("input",'[name="data[folder]"]',function(e){var t=(0,a.default)(e.currentTarget),n=(0,a.default)("[data-id][data-active-id]");n.data("id",t.val()),h.options.onUpdate()})),t.default={Ordering:h,Page:f.default,PageFilters:{PageFilters:c.default,Instance:l.Instance}}},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n=0?i=setTimeout(r,t-c):(i=null,n||(l=e.apply(o,a),o=a=null))}var i,a,o,s,l;null==t&&(t=100);var c=function(){o=this,a=arguments,s=Date.now();var c=n&&!i;return i||(i=setTimeout(r,t)),c&&(l=e.apply(o,a),o=a=null),l};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(l=e.apply(o,a),o=a=null,clearTimeout(i),i=null)},c}n.debounce=n,e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,e),this.query=t,this.elements=(0,s.default)(void 0!==r?r:this.query),this.session=JSON.parse(sessionStorage.getItem(l)||"{}"),this.elements.length&&(this.restore(),this.elements.find(".page-icon").on("click",function(e){return n.toggle(e.target)}),this.elements.data("tree_init",1),(0,s.default)("[data-page-toggleall]").on("click",function(e){var t=(0,s.default)(e.target).closest("[data-page-toggleall]"),r=t.data("page-toggleall");n[r]()}))}return a(e,[{key:"reload",value:function(){var e=(0,s.default)(this.query).filter(function(e,t){return!(0,s.default)(t).data("tree_init")});e.length&&this.constructor(this.query,e)}},{key:"toggle",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&(e=(0,s.default)('[data-nav-id="'+e+'"]').find('[data-toggle="children"]')),e=(0,s.default)(e||this.elements),e.each(function(e,r){r=(0,s.default)(r);var i=t.getState(r.closest('[data-toggle="children"]'));t[i.isOpen?"collapse":"expand"](i.id,n)})}},{key:"collapse",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&(e=(0,s.default)('[data-nav-id="'+e+'"]').find('[data-toggle="children"]')),e=(0,s.default)(e||this.elements),e.each(function(e,r){r=(0,s.default)(r);var i=t.getState(r);i.isOpen&&(i.children.hide(),i.icon.removeClass("children-open").addClass("children-closed"),n||delete t.session[i.id])});var r=e.closest(".mediapicker-scroll");r.length&&r.data("scrollbar")&&r.data("scrollbar").update(),n||this.save()}},{key:"expand",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"==typeof e){var r=(0,s.default)('[data-nav-id="'+e+'"]'),i=r.parents("[data-nav-id]");if(i.length)return i=i.find('[data-toggle="children"]:first'),i=i.add(r.find('[data-toggle="children"]:first')),this.expand(i,n);e=r.find('[data-toggle="children"]:first')}e=(0,s.default)(e||this.elements),e.each(function(e,r){r=(0,s.default)(r);var i=t.getState(r);i.isOpen||(i.children.show(),i.icon.removeClass("children-closed").addClass("children-open"),n||(t.session[i.id]=1))});var a=e.closest(".mediapicker-scroll");a.length&&a.data("scrollbar")&&a.data("scrollbar").update(),n||this.save()}},{key:"restore",value:function(){var e=this;this.collapse(null,!0),Object.keys(this.session).forEach(function(t){e.expand(t,"no-store")})}},{key:"save",value:function(){return sessionStorage.setItem(l,JSON.stringify(this.session))}},{key:"getState",value:function(e){return e=(0,s.default)(e),{id:e.closest("[data-nav-id]").data("nav-id"),children:e.closest("li.page-item").find("ul:first"),icon:e.find(".page-icon"),get isOpen(){return this.icon.hasClass("children-open")}}}}]),e}();t.default=c;var u=new c('[data-toggle="children"]');t.Instance=u},function(e,t){"use strict";!function(){function e(){var e="localStoragePollyfill";try{return localStorage.setItem(e,e),localStorage.removeItem(e),sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}if(!e())try{Storage.prototype._data={},Storage.prototype.setItem=function(e,t){return this._data[e]=String(t),this._data[e]},Storage.prototype.getItem=function(e){return this._data.hasOwnProperty(e)?this._data[e]:void 0},Storage.prototype.removeItem=function(e){return delete this._data[e]},Storage.prototype.clear=function(){return this._data={},this._data}}catch(e){console.error("localStorage pollyfill error: ",e)}}()},,,,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(375),a=r(i);a.default.define("required-fix",function(e){var t=this;this.refreshValidityState=function(){if(!t.isRequired)return!1;var e=!t.items.length;t.isInvalid=e,e?(t.$control_input.attr("required",""),t.$input.removeAttr("required")):(t.$control_input.removeAttr("required"),t.$input.attr("required"))}})},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=r(i);n(380),n(383),n(384),n(385),n(386);var o=n(387),s=r(o);n(457);var l=(0,a.default)('input[type="radio"][name="mode-switch"]');if(l){var c=l.closest(":checked").data("leave-url"),u=(0,a.default)('');l.parent().append(u),l.siblings("label").on("mousedown touchdown",function(t){t.preventDefault();var n=(0,a.default)('[data-remodal-id="changes"] [data-leave-action="continue"]');n.one("click",function(){(0,a.default)(e).on("beforeunload._grav"),u.off("click._grav"),(0,a.default)(t.target).trigger("click")}),u.trigger("click._grav")}),l.on("change",function(e){var t=(0,a.default)(e.target);c=t.data("leave-url"),setTimeout(function(){return u.attr("href",c).get(0).click()},5)})}t.default={Media:{PageMedia:s.default,PageMediaInstances:o.Instance}}}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);n(381);var o=n(359),s=r(o),l=n(336),c=!1,u=(0,a.default)('[data-remodal-id="modal"] input[name="data[folder]"], [data-remodal-id="modular"] input[name="data[folder]"]'),f=(0,a.default)('[data-remodal-id="modal"] input[name="data[title]"], [data-remodal-id="modular"] input[name="data[title]"]'),d=function(e,t){t=(0,a.default)(t);var n='[data-remodal-id="'+t.closest("[data-remodal-id]").data("remodal-id")+'"]';return{title:"title"===e?(0,a.default)(t):(0,a.default)(n+' input[name="data[title]"]'),folder:"folder"===e?(0,a.default)(t):(0,a.default)(n+' input[name="data[folder]"]')}};f.on("input focus blur",function(e){if(c)return!0;var t=d("title",e.currentTarget),n=a.default.slugify(t.title.val(),{custom:{"'":""}});t.folder.val(n)}),u.on("input",function(e){var t=d("folder",e.currentTarget),n=t.folder.get(0),r=t.folder.val(),i={start:n.selectionStart,end:n.selectionEnd};r=r.toLowerCase().replace(/\s/g,"-").replace(/[^a-z0-9_\-]/g,""),t.folder.val(r),c=!!r,n.setSelectionRange(i.start,i.end)}),u.on("focus blur",function(e){return d("title",e.currentTarget).title.trigger("input")}),(0,a.default)(document).on("change",'[name="data[route]"]',function(e){var t=(0,a.default)(e.currentTarget).val(),n=(0,a.default)('[name="data[name]"]'),r=l.config.base_url_relative+"/ajax.json/task"+l.config.param_sep+"getChildTypes";0!==n.length&&(0,s.default)(r,{method:"post",body:{rawroute:t}},function(e){var t=e.child_type;""!==t&&"default"!==t&&(n.val(t),n.data("selectize").setValue(t))})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(382),s=r(o);a.default.expr[":"].noparents=a.default.expr.createPseudo(function(e){return function(t){return(0,a.default)(t).parents(e).length<1}}),a.default.fn.slugify=function(e,t){return(void 0).each(function(e){var n=(0,a.default)(e),r=(0,a.default)(r);n.on("keyup change",function(){n.data("locked",""!==n.val()&&void 0!==n.val())}),r.on("keyup change",function(){if(n.data("locked")===!0)return!0;var e=n.is("input")||n.is("textarea");n[e?"val":"text"](a.default.slugify(r.val(),t))})})},a.default.slugify=function(e,t){return t=a.default.extend({},a.default.slugify.options,t),t.lang=t.lang||(0,a.default)("html").prop("lang"),"function"==typeof t.preSlug&&(e=t.preSlug(e)),e=t.slugFunc(e,t),"function"==typeof t.postSlug&&(e=t.postSlug(e)),e},a.default.slugify.options={preSlug:null,postSlug:null,slugFunc:function(e,t){return(0,s.default)(e,t)}}},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);(0,a.default)(document).on("click",'[data-page-move] button[name="task"][value="save"]',function(e){var t=(0,a.default)(e.currentTarget).closest("[data-remodal-id]"),n=t.data("parents"),r=n.finder,i=n.field,o=n.parentLabel,s=n.parentName,l=r.findLastActive().item[0],c=l._item[r.config.valueKey],u=l._item[r.config.labelKey];i.val(c),o.text(c),s.text(u),r.config.defaultPath=c,(0,a.default)("
    ").css({backgroundColor:"rgba(255, 255, 255, 0.1)",position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:15e3}).appendTo((0,a.default)("body"))})},function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var r=n(1),i=t(r);(0,i.default)(document).on("click",'[data-remodal-target="delete"]',function(){var e=(0,i.default)('[data-remodal-id="delete"] [data-delete-action]'),t=(0,i.default)(this).data("delete-url");e.data("delete-action",t)}),(0,i.default)(document).on("click","[data-delete-action]",function(){var t=i.default.remodal.lookup[(0,i.default)('[data-remodal-id="delete"]').data("remodal")];e.location.href=(0,i.default)(this).data("delete-action"),t.close()})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);(0,a.default)(document).on("click",".dz-unset",function(){var e=(0,a.default)(this).closest(".files-upload");(0,a.default)(this).closest(".dz-image-preview").remove();var t=(0,a.default)(this).closest(".dz-image-preview").find("[data-dz-name]").text().trim(),n=JSON.parse(e.find('input[data-grav-field="hidden"]').val())||{},r={};a.default.each(n,function(e,n){e.endsWith(t)||(r[e]=n)}),e.find('input[data-grav-field="hidden"]').val(JSON.stringify(r))})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);(0,a.default)(".disable-after-click").on("click",function(){(0,a.default)(this).addClass("pointer-events-disabled")})},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var s=function(){function e(e,t){for(var n=0;n\n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    '+m.translations.PLUGIN_ADMIN.DELETE+'\n \n '+m.translations.PLUGIN_ADMIN.VIEW+'\n '+m.translations.PLUGIN_ADMIN.INSERT+"\n
    ").trim(),b=function(t){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.container,r=void 0===t?"#grav-dropzone":t,o=e.options,s=void 0===o?{}:o;i(this,n),s=Object.assign(s,{previewTemplate:_});var l=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,{container:r,options:s}));if(!l.container.length)return a(l);l.urls={fetch:l.container.data("media-url")+"/task"+m.config.param_sep+"listmedia",add:l.container.data("media-url")+"/task"+m.config.param_sep+"addmedia",delete:l.container.data("media-url")+"/task"+m.config.param_sep+"delmedia"},l.dropzone.options.url=l.urls.add,("undefined"==typeof l.options.fetchMedia||l.options.fetchMedia)&&l.fetchMedia(),("undefined"==typeof l.options.attachDragDrop||l.options.attachDragDrop)&&l.attachDragDrop();var c=(0,u.default)('[name="'+l.container.data("dropzone-field")+'"]');return c.length&&(l.sortable=new y.default(l.container.get(0),{animation:150,setData:function(e,t){t=(0,u.default)(t);var n=encodeURI(t.find(".dz-filename").text()),r=(0,h.UriToMarkdown)(n);l.dropzone.disable(),t.addClass("hide-backface"),e.effectAllowed="copy",e.setData("text",r)},onSort:function(){var e=[];l.container.find("[data-dz-name]").each(function(t,n){n=(0,u.default)(n);var r=n.text().trim();e.push(r)}),c.val(e.join(","))}})),l}return o(n,t),s(n,[{key:"fetchMedia",value:function(){var e=this,t=this.container.closest(".form-field").find('[name="data[header][media_order]"]').val(),n={uri:this.getURI(),order:t},r=this.urls.fetch;(0,d.default)(r,{method:"post",body:n},function(t){var n=t.results;Object.keys(n).forEach(function(t){var r=n[t],i={name:t,size:r.size,accepted:!0,extras:r};e.dropzone.files.push(i),e.dropzone.options.addedfile.call(e.dropzone,i),e.dropzone.options.thumbnail.call(e.dropzone,i,r.url)}),e.container.find(".dz-preview").prop("draggable","true")})}},{key:"onDropzoneSending",value:function(e,t,n){n.append("name",this.options.dotNotation||e.name),n.append("admin-nonce",m.config.admin_nonce), -n.append("uri",this.getURI())}},{key:"onDropzoneComplete",value:function(e){l(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"onDropzoneComplete",this).call(this,e),this.sortable.options.onSort(),(0,u.default)(".dz-preview").prop("draggable","true")}},{key:"onDropzoneRemovedFile",value:function(e){for(var t,r=arguments.length,i=Array(r>1?r-1:0),a=1;a');var c=s.find(".meta-content").html("
      ").find("ul");Object.keys(o.metadata).forEach(function(e){c.append("
    • "+(e?e+":":"")+" "+o.metadata[e]+"
    • ")}),l.open()}),this.container.delegate(".dz-preview","dragstart",function(e){var n=(0,u.default)(e.currentTarget),r=encodeURI(n.find(".dz-filename").text()),i=(0,h.UriToMarkdown)(r);t.dropzone.disable(),n.addClass("hide-backface"),e.originalEvent.dataTransfer.effectAllowed="copy",e.originalEvent.dataTransfer.setData("text",i)}),this.container.delegate(".dz-preview","dragend",function(e){var n=(0,u.default)(e.currentTarget);t.dropzone.enable(),n.removeClass("hide-backface")})}}]),n}(p.default);t.default=b;t.Instance=new b}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return e=e.replace(/@3x|@2x|@1x/,""),e=e.replace(/\(/g,"%28"),e=e.replace(/\)/g,"%29"),e.match(/\.(jpe?g|png|gif|svg|mp4|webm|ogv|mov)$/i)?"![]("+e+")":"["+decodeURI(e)+"]("+e+")"}Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=void 0;var o=function(){function e(e,t){for(var n=0;n"),dictRemoveFileConfirmation:"[placeholder]",previewTemplate:('\n ").trim()};e.EXIF=d.default;var y=function(e,t,n){var r=n.resolution;if(!r)return t();var i=new FileReader,a="";return r.min||!n.resizeWidth&&!n.resizeHeight&&r.max?(i.onload=function(e){var i=new Image;i.src=e.target.result,i.onload=function(){var e=this;r.min&&Object.keys(r.min).forEach(function(t){r.min[t]&&e[t]r.max[t]&&(a+=m.translations.PLUGIN_FORM.RESOLUTION_MAX.replace(/{{attr}}/g,t).replace(/{{max}}/g,r.max[t]))}),t(a)}},void i.readAsDataURL(e)):t(a)},_=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.container,a=void 0===r?".dropzone.files-upload":r,o=n.options,s=void 0===o?{}:o;i(this,t),this.container=(0,l.default)(a),this.container.length&&(this.urls={},this.customPost=this.container.data("filePostAdd")||{},this.options=Object.assign({},v,g,{klass:this,url:this.container.data("file-url-add")||m.config.current_url,acceptedFiles:this.container.data("media-types"),init:this.initDropzone},this.container.data("dropzone-options"),s),this.options=Object.assign({},this.options,{accept:function(e,t){y(e,t,this.options)}}),this.dropzone=new u.default(a,this.options),this.dropzone.on("complete",this.onDropzoneComplete.bind(this)),this.dropzone.on("success",this.onDropzoneSuccess.bind(this)),this.dropzone.on("removedfile",this.onDropzoneRemovedFile.bind(this)),this.dropzone.on("sending",this.onDropzoneSending.bind(this)),this.dropzone.on("error",this.onDropzoneError.bind(this)),this.container.on("mouseenter","[data-dz-view]",function(t){var n=JSON.parse(e.container.find('[name][type="hidden"]').val()||"{}"),r=(0,l.default)(t.currentTarget),i=r.parent(".dz-preview").find(".dz-filename"),a=encodeURI(i.text()),o=Object.keys(n).filter(function(e){return n[e].name===a}).shift();r.attr("href",m.config.base_url_simple+"/"+o)}))}return o(t,[{key:"initDropzone",value:function(){var e=this,t=this.options.klass.container.find("[data-file]"),n=this;t.length&&t.each(function(t,r){r=(0,l.default)(r);var i=r.data("file"),a={name:i.name,size:i.size,type:i.type,status:u.default.ADDED,accepted:!0,url:e.options.url,removeUrl:i.remove};n.files.push(a),n.options.addedfile.call(n,a),a.type.match(/^image\//)&&(n.options.thumbnail.call(n,a,i.path),n.createThumbnailFromUrl(a,i.path)),r.remove()})}},{key:"getURI",value:function(){return this.container.data("mediaUri")||""}},{key:"onDropzoneSending",value:function(e,t,n){var r=this;Object.keys(this.customPost).length?Object.keys(this.customPost).forEach(function(e){n.append(e,r.customPost[e])}):(n.append("name",this.options.dotNotation),n.append("task","filesupload"),n.append("uri",this.getURI())),n.append("admin-nonce",m.config.admin_nonce)}},{key:"onDropzoneSuccess",value:function(t,n,r){if(n="string"==typeof n?JSON.parse(n):n,this.options.reloadPage&&e.location.reload(),n.session){t.sessionParams=n.session,t.removeUrl=this.options.url;var i=this.container.find('[name][type="hidden"]'),a=i.val();i.val(a+" ")}return this.handleError({file:t,data:n,mode:"removeFile",msg:"

      "+m.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+t.name+"

      \n
      "+n.message+"
      "})}},{key:"onDropzoneComplete",value:function(t){if(!t.accepted&&!t.rejected){var n={status:"error",message:m.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+t.name.match(/\..+/).join("")};return this.handleError({file:t,data:n,mode:"removeFile",msg:"

      "+m.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+t.name+"

      \n
      "+n.message+"
      "})}this.options.reloadPage&&e.location.reload()}},{key:"b64_to_utf8",value:function(e){return e=e.replace(/\s/g,""),decodeURIComponent(escape(window.atob(e)))}},{key:"onDropzoneRemovedFile",value:function(e){var t=this;if(e.accepted&&!e.rejected){var n=e.removeUrl||this.urls.delete||this.options.url,r=(n||"").match(/path:(.*)\//),i={filename:e.name,uri:this.getURI()};e.sessionParams&&(i.task="filessessionremove",i.session=e.sessionParams);var a=this.container.data("filePostRemove")||{};Object.keys(a).length&&(i={},Object.keys(a).forEach(function(e){i[e]=a[e]})),i.filename=e.name,i["admin-nonce"]=m.config.admin_nonce,(0,p.default)(n,{method:"post",body:i},function(){if(r){r=t.b64_to_utf8(r[1]);var e=t.container.find('[name][type="hidden"]'),n=JSON.parse(e.val()||"{}");delete n[r],e.val(JSON.stringify(n))}})}}},{key:"onDropzoneError",value:function(e,t,n){var r=n?t.error.message:t;return(0,l.default)(e.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:e,data:{status:"error"},msg:"
      "+r+"
      "})}},{key:"handleError",value:function(e){var t=e.file,n=e.data,r=e.mode,i=e.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":t instanceof File?this.dropzone.addFile.call(this.dropzone,t):(this.dropzone.files.push(t),this.dropzone.options.addedfile.call(this.dropzone,t),this.dropzone.options.thumbnail.call(this.dropzone,t,t.extras.url));break;case"removeFile":default:~this.dropzone.files.indexOf(t)&&(t.rejected=!0,this.dropzone.removeFile.call(this.dropzone,t,{silent:!0}))}var a=(0,l.default)('[data-remodal-id="generic"]');a.find(".error-content").html(i),l.default.remodal.lookup[a.data("remodal")].open()}}}]),t}();t.default=_;var b=[],w=(0,l.default)(),x=function(e,t){var n=(0,l.default)(t).find(".dropzone.files-upload");n.length&&n.each(function(e,t){t=(0,l.default)(t),~w.index(t)||k(t)})},k=function(e){e=(0,l.default)(e);var t=e.find('input[type="file"]'),n=e.data("grav-file-settings")||{};n.accept&&~n.accept.indexOf("*")&&(n.accept=[""]);var r={url:e.data("file-url-add")||(e.closest("form").attr("action")||m.config.current_url)+".json",paramName:n.paramName||"file",dotNotation:n.name||"file",acceptedFiles:n.accept?n.accept.join(","):t.attr("accept")||e.data("media-types"),maxFilesize:"undefined"!=typeof n.filesize?n.filesize:256,maxFiles:n.limit||null,resizeWidth:n.resizeWidth||null,resizeHeight:n.resizeHeight||null,resizeQuality:n.resizeQuality||null,accept:function(e,t){y(e,t,n)}};w=w.add(e),e=e[0],b.push(new _({container:e,options:r}))};t.Instances=function(){return(0,l.default)(".dropzone.files-upload").each(function(e,t){return k(t)}),(0,l.default)("body").on("mutation._grav",x),b}()}).call(t,function(){return this}())},,,function(e,t,r){var i,a;(function(){function r(e){return!!e.exifdata}function o(e,t){t=t||e.match(/^data\:([^\;]+)\;base64,/im)[1]||"",e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var n=atob(e),r=n.length,i=new ArrayBuffer(r),a=new Uint8Array(i),o=0;o4?h:t+8,o=[],l=0;l4?h:t+8,v(e,a,d-1);case 3:if(1==d)return e.getUint16(t+8,!i);for(a=d>2?h:t+8,o=[],l=0;le.byteLength)return{};var a=d(e,t,t+i,E,r);if(a.Compression)switch(a.Compression){case 6:if(a.JpegIFOffset&&a.JpegIFByteCount){var o=t+a.JpegIFOffset,s=a.JpegIFByteCount;a.blob=new Blob([new Uint8Array(e.buffer,o,s)],{type:"image/jpeg"})}break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",a.Compression)}else 2==a.PhotometricInterpretation&&console.log("Thumbnail image format is RGB, which is not implemented.");return a}function v(e,t,r){var i="";for(n=t;n")+8;s=s.substring(s.indexOf("0){t["@attributes"]={};for(var n=0;n0)for(var n=0;n').attr("href",r))}"yaml"===t.mode&&Object.assign(t.extraKeys,{Tab:function(e){e.replaceSelection(" ","end")}});var i=f.default.fromTextArea(e.get(0),t);e.data("codemirror",i),e.data("toolbar",new _(e)),e.addClass("code-mirrored"),t.toolbar===!1&&e.data("toolbar").ui.navigation.addClass("grav-editor-hide-toolbar"),i.on("change",function(){return i.save()})}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find("[data-grav-editor]");r.length&&r.each(function(e,t){t=(0,s.default)(t),~n.editors.index(t)||n.addEditor(t)})}}]),e}();t.default=y;var _=t.Toolbar=function(){function e(t){i(this,e),this.editor=(0,s.default)(t),this.codemirror=this.editor.data("codemirror"),this.buttons=c.default.navigation,this.ui={navigation:(0,s.default)(e.templates().navigation)},this.editor.parent(".grav-editor-content").before(this.ui.navigation).after(this.ui.states),this.renderButtons()}return a(e,null,[{key:"templates",value:function(){return{navigation:'\n
      \n
      \n
      \n
      \n '}}}]),a(e,[{key:"renderButtons",value:function(){var e=this,t={actions:"navigation",modes:"states"};["actions","modes"].forEach(function(n){e.ui.navigation.find(".grav-editor-"+n).empty().append("
        "),c.default[t[n]].forEach(function(t){return e.renderButton(t,n)})})}},{key:"renderButton",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Object.keys(e).forEach(function(i){var a=e[i];if(a.modes||(a.modes=[]),!~n.codemirror.options.ignore.indexOf(i)&&(!a.modes.length||a.modes.indexOf(n.codemirror.options.mode)>-1)){var o=a.title?'data-hint="'+a.title+'"':"",l=(0,s.default)('
      • "+a.label+"
      • "); -if((r||n.ui.navigation.find(".grav-editor-"+t+" ul:not(.dropdown-menu)")).append(l),a.shortcut&&n.addShortcut(a.identifier,a.shortcut,l),a.action&&a.action.call(a.action,{codemirror:n.codemirror,button:l,textarea:n.editor,ui:n.ui}),a.children){var c=(0,s.default)('