diff --git a/administrator/components/com_media/resources/components/browser/items/image.vue b/administrator/components/com_media/resources/components/browser/items/image.vue index 6e3b05fc69abc..545883e16f918 100644 --- a/administrator/components/com_media/resources/components/browser/items/image.vue +++ b/administrator/components/com_media/resources/components/browser/items/image.vue @@ -19,9 +19,10 @@ computed: { /* Get the item url */ itemUrl() { - const filePath = Joomla.getOptions('com_media').filePath || 'images'; + // TODO should we use relative urls here? + const fileBaseUrl = Joomla.getOptions('com_media').fileBaseUrl || '/images'; - return '/' + filePath + this.item.path; + return fileBaseUrl + this.item.path; } } } diff --git a/administrator/components/com_media/views/media/tmpl/default.php b/administrator/components/com_media/views/media/tmpl/default.php index f29004631405a..26cc3ea8bc960 100644 --- a/administrator/components/com_media/views/media/tmpl/default.php +++ b/administrator/components/com_media/views/media/tmpl/default.php @@ -18,6 +18,7 @@ $config = array( 'apiBaseUrl' => JUri::root() . 'administrator/index.php?option=com_media&format=json', 'filePath' => $params->get('file_path', 'images'), + 'fileBaseUrl' => JUri::root() . $params->get('file_path', 'images'), 'allowedUploadExtensions' => $params->get('upload_extensions', ''), 'maxUploadSizeMb' => $params->get('upload_maxsize', 10), ); diff --git a/media/com_media/js/mediamanager.js b/media/com_media/js/mediamanager.js index 5451e3163ea4e..599e1ba5a1d1e 100644 --- a/media/com_media/js/mediamanager.js +++ b/media/com_media/js/mediamanager.js @@ -1,4 +1,4 @@ -!function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,o="/"===a.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+n||"."},n.normalize=function(e){var o=n.isAbsolute(e),i="/"===a(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var o=r(e.split("/")),i=r(t.split("/")),a=Math.min(o.length,i.length),s=a,c=0;c1)for(var n=1;n-1)return e.splice(n,1)}}function s(e,t){return $n.call(e,t)}function c(e){return"string"==typeof e||"number"==typeof e}function u(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}function l(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function d(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function f(e,t){for(var n in t)e[n]=t[n];return e}function p(e){return null!==e&&"object"==typeof e}function v(e){return Tn.call(e)===Mn}function h(e){for(var t={},n=0;n1?d(n):n;for(var r=d(arguments,1),o=0,i=n.length;oRn._maxUpdateCount)){Zn("You may have an infinite update loop "+(t.user?'in watcher with expression "'+t.expression+'"':"in a component render function."),t.vm);break}for(Tr=kr.length;Tr--;)t=kr[Tr],r=t.vm,r._watcher===t&&r._isMounted&&ke(r,"updated");Kn&&Rn.devtools&&Kn.emit("flush"),De()}function Se(e){var t=e.id;if(null==Dr[t]){if(Dr[t]=!0,jr){for(var n=kr.length-1;n>=0&&kr[n].id>e.id;)n--;kr.splice(Math.max(n,Tr)+1,0,e)}else kr.push(e);Sr||(Sr=!0,Wn(Ne))}}function je(e){Pr.clear(),Te(e,Pr)}function Te(e,t){var n,r,o=Array.isArray(e);if((o||p(e))&&Object.isExtensible(e)){if(e.__ob__){var i=e.__ob__.dep.id;if(t.has(i))return;t.add(i)}if(o)for(n=e.length;n--;)Te(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)Te(e[r[n]],t)}}function Me(e){e._watchers=[];var t=e.$options;t.props&&Ie(e,t.props),t.methods&&Le(e,t.methods),t.data?Pe(e):k(e._data={},!0),t.computed&&Re(e,t.computed),t.watch&&Fe(e,t.watch)}function Ie(t,n){var r=t.$options.propsData||{},o=t.$options._propKeys=Object.keys(n),i=!t.$parent;ar.shouldConvert=i;for(var a=function(i){var a=o[i];"production"!==e.env.NODE_ENV?(Rr[a]&&Zn('"'+a+'" is a reserved attribute and cannot be used as component prop.',t),D(t,a,U(a,n,r,t),function(){t.$parent&&!ar.isSettingProps&&Zn("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+a+'"',t)})):D(t,a,U(a,n,r,t))},s=0;s-1:e.test(t)}function et(e,t){for(var n in e){var r=e[n];if(r){var o=Qe(r.componentOptions);o&&!t(o)&&(tt(r),e[n]=null)}}}function tt(e){e&&(e.componentInstance._inactive||ke(e.componentInstance,"deactivated"),e.componentInstance.$destroy())}function nt(t){var n={};n.get=function(){return Rn},"production"!==e.env.NODE_ENV&&(n.set=function(){Zn("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(t,"config",n),t.util=dr,t.set=N,t.delete=S,t.nextTick=Wn,t.options=Object.create(null),Rn._assetTypes.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,f(t.options.components,Hr),Ke(t),We(t),Je(t),Ze(t)}function rt(e){for(var t=e.data,n=e,r=e;r.componentInstance;)r=r.componentInstance._vnode,r.data&&(t=ot(r.data,t));for(;n=n.parent;)n.data&&(t=ot(t,n.data));return it(t)}function ot(e,t){return{staticClass:at(e.staticClass,t.staticClass),class:e.class?[e.class,t.class]:t.class}}function it(e){var t=e.class,n=e.staticClass;return n||t?at(n,st(t)):""}function at(e,t){return e?t?e+" "+t:e:t||""}function st(e){var t="";if(!e)return t;if("string"==typeof e)return e;if(Array.isArray(e)){for(var n,r=0,o=e.length;r-1?ro[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ro[e]=/HTMLUnknownElement/.test(t.toString())}function lt(t){if("string"==typeof t){var n=t;if(t=document.querySelector(t),!t)return"production"!==e.env.NODE_ENV&&Zn("Cannot find element: "+n),document.createElement("div")}return t}function dt(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&"multiple"in t.data.attrs&&n.setAttribute("multiple","multiple"),n)}function ft(e,t){return document.createElementNS(Xr[e],t)}function pt(e){return document.createTextNode(e)}function vt(e){return document.createComment(e)}function ht(e,t,n){e.insertBefore(t,n)}function mt(e,t){e.removeChild(t)}function _t(e,t){e.appendChild(t)}function yt(e){return e.parentNode}function gt(e){return e.nextSibling}function bt(e){return e.tagName}function wt(e,t){e.textContent=t}function Ct(e,t,n){e.setAttribute(t,n)}function Et(e,t){var n=e.data.ref;if(n){var r=e.context,o=e.componentInstance||e.elm,i=r.$refs;t?Array.isArray(i[n])?a(i[n],o):i[n]===o&&(i[n]=void 0):e.data.refInFor?Array.isArray(i[n])&&i[n].indexOf(o)<0?i[n].push(o):i[n]=[o]:i[n]=o}}function Ot(e){return null==e}function xt(e){return null!=e}function At(e,t){return e.key===t.key&&e.tag===t.tag&&e.isComment===t.isComment&&!e.data==!t.data}function $t(e,t,n){var r,o,i={};for(r=t;r<=n;++r)o=e[r].key,xt(o)&&(i[o]=r);return i}function kt(t){function n(e){return new yr(D.tagName(e).toLowerCase(),{},[],void 0,e)}function r(e,t){function n(){0===--n.listeners&&o(e)}return n.listeners=t,n}function o(e){var t=D.parentNode(e);t&&D.removeChild(t,e)}function a(t,n,r,o,i){if(t.isRootInsert=!i,!s(t,n,r,o)){var a=t.data,c=t.children,u=t.tag;xt(u)?("production"!==e.env.NODE_ENV&&(a&&a.pre&&N++,N||t.ns||Rn.ignoredElements.length&&Rn.ignoredElements.indexOf(u)>-1||!Rn.isUnknownElement(u)||Zn("Unknown custom element: <"+u+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',t.context)), -t.elm=t.ns?D.createElementNS(t.ns,u):D.createElement(u,t),h(t),f(t,c,n),xt(a)&&v(t,n),d(r,t.elm,o),"production"!==e.env.NODE_ENV&&a&&a.pre&&N--):t.isComment?(t.elm=D.createComment(t.text),d(r,t.elm,o)):(t.elm=D.createTextNode(t.text),d(r,t.elm,o))}}function s(e,t,n,r){var o=e.data;if(xt(o)){var i=xt(e.componentInstance)&&o.keepAlive;if(xt(o=o.hook)&&xt(o=o.init)&&o(e,!1,n,r),xt(e.componentInstance))return u(e,t),i&&l(e,t,n,r),!0}}function u(e,t){e.data.pendingInsert&&t.push.apply(t,e.data.pendingInsert),e.elm=e.componentInstance.$el,p(e)?(v(e,t),h(e)):(Et(e),t.push(e))}function l(e,t,n,r){for(var o,i=e;i.componentInstance;)if(i=i.componentInstance._vnode,xt(o=i.data)&&xt(o=o.transition)){for(o=0;o<$.activate.length;++o)$.activate[o](ao,i);t.push(i);break}d(n,e.elm,r)}function d(e,t,n){e&&(n?D.insertBefore(e,t,n):D.appendChild(e,t))}function f(e,t,n){if(Array.isArray(t))for(var r=0;rp?(l=Ot(r[_+1])?null:r[_+1].elm,m(t,l,r,f,_,o)):f>_&&y(t,n,d,p)}function w(e,t,n,r){if(e!==t){if(t.isStatic&&e.isStatic&&t.key===e.key&&(t.isCloned||t.isOnce))return t.elm=e.elm,void(t.componentInstance=e.componentInstance);var o,i=t.data,a=xt(i);a&&xt(o=i.hook)&&xt(o=o.prepatch)&&o(e,t);var s=t.elm=e.elm,c=e.children,u=t.children;if(a&&p(t)){for(o=0;o<$.update.length;++o)$.update[o](e,t);xt(o=i.hook)&&xt(o=o.update)&&o(e,t)}Ot(t.text)?xt(c)&&xt(u)?c!==u&&b(s,c,u,n,r):xt(u)?(xt(e.text)&&D.setTextContent(s,""),m(s,null,u,0,u.length-1,n)):xt(c)?y(s,c,0,c.length-1):xt(e.text)&&D.setTextContent(s,""):e.text!==t.text&&D.setTextContent(s,t.text),a&&xt(o=i.hook)&&xt(o=o.postpatch)&&o(e,t)}}function C(e,t,n){if(n&&e.parent)e.parent.data.pendingInsert=t;else for(var r=0;r, or missing . Bailing hydration and performing full client-side render.")}t=n(t)}var f=t.elm,v=D.parentNode(f);if(a(r,l,f._leaveCb?null:v,D.nextSibling(f)),r.parent){for(var h=r.parent;h;)h.elm=r.elm,h=h.parent;if(p(r))for(var m=0;m<$.create.length;++m)$.create[m](ao,r.parent)}null!==v?y(v,[t],0,0):xt(t.tag)&&_(t)}}else u=!0,a(r,l,s,c);return C(r,l,u),r.elm}}function Dt(e,t){(e.data.directives||t.data.directives)&&Nt(e,t)}function Nt(e,t){var n,r,o,i=e===ao,a=t===ao,s=St(e.data.directives,e.context),c=St(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],o=c[n],r?(o.oldValue=r.value,Tt(o,"update",t,e),o.def&&o.def.componentUpdated&&l.push(o)):(Tt(o,"bind",t,e),o.def&&o.def.inserted&&u.push(o));if(u.length){var d=function(){for(var n=0;n-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+e.getAttribute("class")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Wt(e,t){if(t&&t.trim())if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t);else{for(var n=" "+e.getAttribute("class")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");e.setAttribute("class",n.trim())}}function Jt(e){No(function(){No(e)})}function Zt(e,t){(e._transitionClasses||(e._transitionClasses=[])).push(t),Kt(e,t)}function Qt(e,t){e._transitionClasses&&a(e._transitionClasses,t),Wt(e,t)}function Xt(e,t,n){var r=en(e,t),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===Oo?$o:Do,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=Oo,l=a,d=i.length):t===xo?u>0&&(n=xo,l=u,d=c.length):(l=Math.max(a,u),n=l>0?a>u?Oo:xo:null,d=n?n===Oo?i.length:c.length:0);var f=n===Oo&&So.test(r[Ao+"Property"]);return{type:n,timeout:l,propCount:d,hasTransform:f}}function tn(e,t){for(;e.length1,j=n._enterCb=sn(function(){N&&(Qt(n,x),Qt(n,O)),j.cancelled?(N&&Qt(n,E),D&&D(n)):k&&k(n),n._enterCb=null});e.data.show||ce(e.data.hook||(e.data.hook={}),"insert",function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),$&&$(n,j)},"transition-insert"),A&&A(n),N&&(Zt(n,E),Zt(n,O),Jt(function(){Zt(n,x),Qt(n,E),j.cancelled||S||Xt(n,i,j)})),e.data.show&&(t&&t(),$&&$(n,j)),N||S||j()}}}function on(e,t){function n(){_.cancelled||(e.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[e.key]=e),l&&l(r),h&&(Zt(r,s),Zt(r,u),Jt(function(){Zt(r,c),Qt(r,s),_.cancelled||m||Xt(r,a,_)})),d&&d(r,_),h||m||_())}var r=e.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var o=an(e.data.transition);if(!o)return t();if(!r._leaveCb&&1===r.nodeType){var i=o.css,a=o.type,s=o.leaveClass,c=o.leaveToClass,u=o.leaveActiveClass,l=o.beforeLeave,d=o.leave,f=o.afterLeave,p=o.leaveCancelled,v=o.delayLeave,h=i!==!1&&!zn,m=d&&(d._length||d.length)>1,_=r._leaveCb=sn(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[e.key]=null),h&&(Qt(r,c),Qt(r,u)),_.cancelled?(h&&Qt(r,s),p&&p(r)):(t(),f&&f(r)),r._leaveCb=null});v?v(n):n()}}function an(e){if(e){if("object"==typeof e){var t={};return e.css!==!1&&f(t,jo(e.name||"v")),f(t,e),t}return"string"==typeof e?jo(e):void 0}}function sn(e){var t=!1;return function(){t||(t=!0,e())}}function cn(e,t){t.data.show||rn(t)}function un(t,n,r){var o=n.value,i=t.multiple;if(i&&!Array.isArray(o))return void("production"!==e.env.NODE_ENV&&Zn(' expects an Array value for its binding, but got '+Object.prototype.toString.call(o).slice(8,-1),r));for(var a,s,c=0,u=t.options.length;c-1,s.selected!==a&&(s.selected=a);else if(y(un(s),o))return void(t.selectedIndex!==c&&(t.selectedIndex=c));i||(t.selectedIndex=-1)}function cn(e,t){for(var n=0,r=t.length;n0,Hn=Fn&&Fn.indexOf("edge/")>0,zn=Fn&&Fn.indexOf("android")>0,Bn=Fn&&/iphone|ipad|ipod|ios/.test(Fn),qn=function(){return void 0===Cn&&(Cn=!Ln&&"undefined"!=typeof n&&"server"===n.process.env.VUE_ENV),Cn},Gn=Ln&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Yn=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t":"anonymous component")+(e._isVue&&e.$options.__file?" at "+e.$options.__file:"")};var Zn=function(e){return"anonymous component"===e&&(e+=' - use the "name" option for better debugging messages.'),"\n(found in "+e+")"}}var Qn=0,Xn=function(){this.id=Qn++,this.subs=[]};Xn.prototype.addSub=function(e){this.subs.push(e)},Xn.prototype.removeSub=function(e){a(this.subs,e)},Xn.prototype.depend=function(){Xn.target&&Xn.target.addDep(this)},Xn.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t1&&(t[n[0].trim()]=n[1].trim())}}),t}),po=/^--/,vo=/\s*!important$/,ho=function(e,t,n){po.test(t)?e.style.setProperty(t,n):vo.test(n)?e.style.setProperty(t,n.replace(vo,""),"important"):e.style[_o(t)]=n},mo=["Webkit","Moz","ms"],_o=u(function(e){if(Ir=Ir||document.createElement("div"),e=$n(e),"filter"!==e&&e in Ir.style)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n. If you are working with contenteditable, it's recommended to wrap a library dedicated for that purpose inside a custom component.",r.context)),"select"===r.tag){var o=function(){sn(t,n,r.context)};o(),(In||Hn)&&setTimeout(o,0)}else"textarea"!==r.tag&&"text"!==t.type||(t._vModifiers=n.modifiers,n.modifiers.lazy||(zn||(t.addEventListener("compositionstart",ln),t.addEventListener("compositionend",dn)),Un&&(t.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){sn(e,t,n.context);var r=e.multiple?t.value.some(function(t){return cn(t,e.options)}):t.value!==t.oldValue&&cn(t.value,e.options);r&&fn(e,"change")}}},Po={bind:function(e,t,n){var r=t.value;n=pn(n);var o=n.data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&o&&!Un?(n.data.show=!0,tn(n,function(){e.style.display=i})):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value,o=t.oldValue;if(r!==o){n=pn(n);var i=n.data&&n.data.transition;i&&!Un?(n.data.show=!0,r?tn(n,function(){e.style.display=e.__vOriginalDisplay}):nn(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none"}},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}},Ro={model:Mo,show:Po},Vo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String},Lo={name:"transition",props:Vo,abstract:!0,render:function(t){var n=this,r=this.$slots.default;if(r&&(r=r.filter(function(e){return e.tag}),r.length)){"production"!==e.env.NODE_ENV&&r.length>1&&Wn(" can only be used on a single element. Use for lists.",this.$parent);var o=this.mode;"production"!==e.env.NODE_ENV&&o&&"in-out"!==o&&"out-in"!==o&&Wn("invalid mode: "+o,this.$parent);var i=r[0];if(_n(this.$vnode))return i;var a=vn(i);if(!a)return i;if(this._leaving)return mn(t,i);var s=a.key=null==a.key||a.isStatic?"__v"+(a.tag+this._uid)+"__":a.key,c=(a.data||(a.data={})).transition=hn(this),u=this._vnode,l=vn(u);if(a.data.directives&&a.data.directives.some(function(e){return"show"===e.name})&&(a.data.show=!0),l&&l.data&&!yn(a,l)){var d=l&&(l.data.transition=f({},c));if("out-in"===o)return this._leaving=!0,de(d,"afterLeave",function(){n._leaving=!1,n.$forceUpdate()},s),mn(t,i);if("in-out"===o){var p,v=function(){p()};de(c,"afterEnter",v,s),de(c,"enterCancelled",v,s),de(d,"delayLeave",function(e){p=e},s)}}return i}}},Fo=f({tag:String,moveClass:String},Vo); +delete Fo.mode;var Io={props:Fo,render:function(t){for(var n=this.tag||this.$vnode.data.tag||"span",r=Object.create(null),o=this.prevChildren=this.children,i=this.$slots.default||[],a=this.children=[],s=hn(this),c=0;c children must be keyed: <"+d+">")}}if(o){for(var f=[],p=[],v=0;v=2){var r=e.config._lifecycleHooks.indexOf("init")>-1;e.mixin(r?{init:t}:{beforeCreate:t})}else{var o=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[t].concat(e.init):t,o.call(this,e)}}},E=n(function(e,n){var o={};return t(n).forEach(function(t){var n=t.key,i=t.val;o[n]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var o=r(this.$store,"mapState",e);if(!o)return;t=o.context.state,n=o.context.getters}return"function"==typeof i?i.call(this,t,n):t[i]}}),o}),O=n(function(e,n){var o={};return t(n).forEach(function(t){var n=t.key,i=t.val;i=e+i,o[n]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(!e||r(this.$store,"mapMutations",e))return this.$store.commit.apply(this.$store,[i].concat(t))}}),o}),x=n(function(e,n){var o={};return t(n).forEach(function(t){var n=t.key,i=t.val;i=e+i,o[n]=function(){if(!e||r(this.$store,"mapGetters",e))return i in this.$store.getters?this.$store.getters[i]:void console.error("[vuex] unknown getter: "+i)}}),o}),A=n(function(e,n){var o={};return t(n).forEach(function(t){var n=t.key,i=t.val;i=e+i,o[n]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(!e||r(this.$store,"mapActions",e))return this.$store.dispatch.apply(this.$store,[i].concat(t))}}),o}),$=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e},k={state:{},namespaced:{}};k.state.get=function(){return this._rawModule.state||{}},k.namespaced.get=function(){return!!this._rawModule.namespaced},$.prototype.addChild=function(e,t){this._children[e]=t},$.prototype.removeChild=function(e){delete this._children[e]},$.prototype.getChild=function(e){return this._children[e]},$.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},$.prototype.forEachChild=function(e){o(this._children,e)},$.prototype.forEachGetter=function(e){this._rawModule.getters&&o(this._rawModule.getters,e)},$.prototype.forEachAction=function(e){this._rawModule.actions&&o(this._rawModule.actions,e)},$.prototype.forEachMutation=function(e){this._rawModule.mutations&&o(this._rawModule.mutations,e)},Object.defineProperties($.prototype,k);var D=function(e){var t=this;this.root=new $(e,!1),e.modules&&o(e.modules,function(e,n){t.register([n],e,!1)})};D.prototype.get=function(e){return e.reduce(function(e,t){return e.getChild(t)},this.root)},D.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(e,n){return t=t.getChild(n),e+(t.namespaced?n+"/":"")},"")},D.prototype.update=function(e){c(this.root,e)},D.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var i=this.get(e.slice(0,-1)),a=new $(t,n);i.addChild(e[e.length-1],a),t.modules&&o(t.modules,function(t,o){r.register(e.concat(o),t,n)})},D.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];t.getChild(n).runtime&&t.removeChild(n)};var N,S=function(t){var n=this;void 0===t&&(t={}),s(N,"must call Vue.use(Vuex) before creating a store instance."),s("undefined"!=typeof Promise,"vuex requires a Promise polyfill in this browser.");var r=t.state;void 0===r&&(r={});var o=t.plugins;void 0===o&&(o=[]);var i=t.strict;void 0===i&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new D(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new N;var a=this,c=this,u=c.dispatch,f=c.commit;this.dispatch=function(e,t){return u.call(a,e,t)},this.commit=function(e,t,n){return f.call(a,e,t,n)},this.strict=i,d(this,r,[],this._modules.root),l(this,r),o.concat(e).forEach(function(e){return e(n)})},T={state:{}};T.state.get=function(){return this._vm.$data.state},T.state.set=function(e){s(!1,"Use store.replaceState() to explicit replace store state.")},S.prototype.commit=function(e,t,n){var r=this,o=g(e,t,n),i=o.type,a=o.payload,s=o.options,c={type:i,payload:a},u=this._mutations[i];return u?(this._withCommit(function(){u.forEach(function(e){e(a)})}),this._subscribers.forEach(function(e){return e(c,r.state)}),void(s&&s.silent&&console.warn("[vuex] mutation type: "+i+". Silent option has been removed. Use the filter functionality in the vue-devtools"))):void console.error("[vuex] unknown mutation type: "+i)},S.prototype.dispatch=function(e,t){var n=g(e,t),r=n.type,o=n.payload,i=this._actions[r];return i?i.length>1?Promise.all(i.map(function(e){return e(o)})):i[0](o):void console.error("[vuex] unknown action type: "+r)},S.prototype.subscribe=function(e){var t=this._subscribers;return t.indexOf(e)<0&&t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}},S.prototype.watch=function(e,t,n){var r=this;return s("function"==typeof e,"store.watch only accepts a function."),this._watcherVM.$watch(function(){return e(r.state,r.getters)},t,n)},S.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._vm.state=e})},S.prototype.registerModule=function(e,t){"string"==typeof e&&(e=[e]),s(Array.isArray(e),"module path must be a string or an Array."),this._modules.register(e,t),d(this,this.state,e,this._modules.get(e)),l(this,this.state)},S.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),s(Array.isArray(e),"module path must be a string or an Array."),this._modules.unregister(e),this._withCommit(function(){var n=y(t.state,e.slice(0,-1));N.delete(n,e[e.length-1])}),u(this)},S.prototype.hotUpdate=function(e){this._modules.update(e),u(this,!0)},S.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(S.prototype,T),"undefined"!=typeof window&&window.Vue&&b(window.Vue);var j={Store:S,install:b,version:"2.1.2",mapState:E,mapMutations:O,mapGetters:x,mapActions:A};return j})},{}],7:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n0}},methods:{toggleItem:function(){this.$store.dispatch("getContents",this.item.path)}}}}(),t.exports.__esModule&&(t.exports=t.exports.default);var r="function"==typeof t.exports?t.exports.options:t.exports;r.functional&&console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions."),r.render=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"media-tree-item",class:{active:e.isActive}},[n("a",{style:{paddingLeft:15*e.level+"px"},on:{click:function(t){t.stopPropagation(),t.preventDefault(),e.toggleItem()}}},[n("span",{staticClass:"item-icon material-icons"},[e._v("folder")]),e._v(" "),n("span",{staticClass:"item-name"},[e._v(e._s(e.item.name))])]),e._v(" "),n("transition",{attrs:{name:"slide-fade"}},[e.hasChildren?n("media-tree",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],attrs:{root:e.item.path}}):e._e()],1)],1)},r.staticRenderFns=[],t.hot&&!function(){var n=e("vue-hot-reload-api");n.install(e("vue"),!0),n.compatible&&(t.hot.accept(),t.hot.data?n.reload("data-v-dd99ecde",r):n.createRecord("data-v-dd99ecde",r))}()},{vue:4,"vue-hot-reload-api":3}],19:[function(e,t,n){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default={name:"media-tree",props:["root"],computed:{directories:function(){var e=this;return this.$store.state.directories.filter(function(t){return t.directory===e.root})}}}}(),t.exports.__esModule&&(t.exports=t.exports.default);var r="function"==typeof t.exports?t.exports.options:t.exports;r.functional&&console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions."), +r.render=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{staticClass:"media-tree"},e._l(e.directories,function(e){return n("media-tree-item",{attrs:{item:e}})}))},r.staticRenderFns=[],t.hot&&!function(){var n=e("vue-hot-reload-api");n.install(e("vue"),!0),n.compatible&&(t.hot.accept(),t.hot.data?n.reload("data-v-c4ba76c8",r):n.createRecord("data-v-c4ba76c8",r))}()},{vue:4,"vue-hot-reload-api":3}],20:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=e("vue"),i=r(o),a=e("./components/app.vue"),s=r(a),c=e("./components/tree/tree.vue"),u=r(c),l=e("./components/tree/item.vue"),d=r(l),f=e("./components/toolbar/toolbar.vue"),p=r(f),v=e("./components/breadcrumb/breadcrumb.vue"),h=r(v),m=e("./components/browser/browser.vue"),_=r(m),y=e("./components/browser/items/item"),g=r(y),b=e("./components/modals/modal.vue"),w=r(b),C=e("./components/modals/create-folder-modal.vue"),E=r(C),O=e("./store/store"),x=r(O);i.default.component("media-tree",u.default),i.default.component("media-tree-item",d.default),i.default.component("media-toolbar",p.default),i.default.component("media-breadcrumb",h.default),i.default.component("media-browser",_.default),i.default.component("media-browser-item",g.default),i.default.component("media-modal",w.default),i.default.component("create-folder-modal",E.default),document.addEventListener("DOMContentLoaded",function(e){return new i.default({el:"#com-media",store:x.default,render:function(e){return e(s.default)}})})},{"./components/app.vue":8,"./components/breadcrumb/breadcrumb.vue":9,"./components/browser/browser.vue":10,"./components/browser/items/item":14,"./components/modals/create-folder-modal.vue":15,"./components/modals/modal.vue":16,"./components/toolbar/toolbar.vue":17,"./components/tree/item.vue":18,"./components/tree/tree.vue":19,"./store/store":26,vue:4}],21:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(n,"__esModule",{value:!0}),n.createDirectory=n.getContents=void 0;var o=e("../app/Api"),i=e("./mutation-types"),a=r(i);n.getContents=function(e,t){var n=e.commit;o.api.getContents(t).then(function(e){n(a.LOAD_CONTENTS_SUCCESS,e),n(a.SELECT_DIRECTORY,t)}).catch(function(e){console.log("error",e)})},n.createDirectory=function(e,t){var n=e.commit;o.api.createDirectory(t.name,t.parent).then(function(e){n(a.CREATE_DIRECTORY_SUCCESS,e),n(a.HIDE_CREATE_FOLDER_MODAL)}).catch(function(e){console.log("error",e)})}},{"../app/Api":7,"./mutation-types":23}],22:[function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o,a=n.map(function(e){return e.path}),s=e.directories.find(function(e){return e.path===n[0].directory}),c=e.directories.indexOf(s);(o=e.directories).push.apply(o,i(n)),e.directories.splice(c,1,Object.assign({},s,{directories:[].concat(i(s.directories),i(a))}))}if(r.length>0){var u,l=r.map(function(e){return e.path}),d=e.directories.find(function(e){return e.path===r[0].directory}),f=e.directories.indexOf(d);(u=e.files).push.apply(u,i(r)),e.directories.splice(f,1,Object.assign({},d,{files:[].concat(i(d.files),i(l))}))}}),o(a,c.CREATE_DIRECTORY_SUCCESS,function(e,t){var n=t,r=!e.directories.some(function(e){return e.path===n.path});if(r){var o=e.directories.find(function(e){return e.path===n.directory}),a=e.directories.indexOf(o);e.directories.push(n),e.directories.splice(a,1,Object.assign({},o,{directories:[].concat(i(o.directories),[n.path])}))}}),o(a,c.SHOW_CREATE_FOLDER_MODAL,function(e){e.showCreateFolderModal=!0}),o(a,c.HIDE_CREATE_FOLDER_MODAL,function(e){e.showCreateFolderModal=!1}),a)},{"./mutation-types":23}],25:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default={selectedDirectory:"/",directories:[{path:"/",directories:[],files:[],directory:null}],files:[],showCreateFolderModal:!1}},{}],26:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("vue"),a=o(i),s=e("vuex"),c=o(s),u=e("./state"),l=o(u),d=e("./getters"),f=r(d),p=e("./actions"),v=r(p),h=e("./mutations"),m=o(h);a.default.use(c.default),n.default=new c.default.Store({state:l.default,getters:f,actions:v,mutations:m.default,strict:!0})},{"./actions":21,"./getters":22,"./mutations":24,"./state":25,vue:4,vuex:6}]},{},[20]);