Current Directory: /home/astoriaah/www/media/com_widgetkit/js
Viewing File: /home/astoriaah/www/media/com_widgetkit/js/joomla.js
"use strict";!function(t,e){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var y=n(t),o=n(e);var i="object"==typeof global&&global&&global.Object===Object&&global,r="object"==typeof self&&self&&self.Object===Object&&self,a=i||r||Function("return this")(),l=a.Symbol,c=Object.prototype,u=c.hasOwnProperty,s=c.toString,d=l?l.toStringTag:void 0;var f=Object.prototype.toString;var p="[object Null]",m="[object Undefined]",h=l?l.toStringTag:void 0;function g(t){return null==t?void 0===t?m:p:h&&h in Object(t)?function(t){var e=u.call(t,d),n=t[d];try{var o=!(t[d]=void 0)}catch(t){}var i=s.call(t);return o&&(e?t[d]=n:delete t[d]),i}(t):(e=t,f.call(e));var e}function v(t){return null!=t&&"object"==typeof t}var b=Array.isArray;function w(t){return t}var j="[object AsyncFunction]",x="[object Function]",k="[object GeneratorFunction]",S="[object Proxy]";function $(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t}var A=9007199254740991,E=/^(?:0|[1-9]\d*)$/;var C=9007199254740991;function O(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=C}function F(t){return null!=t&&O(t.length)&&!function(t){if(n=typeof(e=t),null!=e&&("object"==n||"function"==n)){var e,n,o=g(t);return o==x||o==k||o==j||o==S}}(t)}var T=Object.prototype;function U(t){return v(t)&&"[object Arguments]"==g(t)}var q=Object.prototype,P=q.hasOwnProperty,M=q.propertyIsEnumerable,R=U(function(){return arguments}())?U:function(t){return v(t)&&P.call(t,"callee")&&!M.call(t,"callee")};var V="object"==typeof exports&&exports&&!exports.nodeType&&exports,I=V&&"object"==typeof module&&module&&!module.nodeType&&module,_=I&&I.exports===V?a.Buffer:void 0,B=(_?_.isBuffer:void 0)||function(){return!1},z={};z["[object Float32Array]"]=z["[object Float64Array]"]=z["[object Int8Array]"]=z["[object Int16Array]"]=z["[object Int32Array]"]=z["[object Uint8Array]"]=z["[object Uint8ClampedArray]"]=z["[object Uint16Array]"]=z["[object Uint32Array]"]=!0,z["[object Arguments]"]=z["[object Array]"]=z["[object ArrayBuffer]"]=z["[object Boolean]"]=z["[object DataView]"]=z["[object Date]"]=z["[object Error]"]=z["[object Function]"]=z["[object Map]"]=z["[object Number]"]=z["[object Object]"]=z["[object RegExp]"]=z["[object Set]"]=z["[object String]"]=z["[object WeakMap]"]=!1;var J,L="object"==typeof exports&&exports&&!exports.nodeType&&exports,N=L&&"object"==typeof module&&module&&!module.nodeType&&module,W=N&&N.exports===L&&i.process,D=function(){try{var t=N&&N.require&&N.require("util").types;return t?t:W&&W.binding&&W.binding("util")}catch(t){}}(),H=D&&D.isTypedArray,K=H?(J=H,function(t){return J(t)}):function(t){return v(t)&&O(t.length)&&!!z[g(t)]},G=Object.prototype.hasOwnProperty;function Q(t,e){var n,o,i,r=b(t),a=!r&&R(t),l=!r&&!a&&B(t),c=!r&&!a&&!l&&K(t),u=r||a||l||c,s=u?function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}(t.length,String):[],d=s.length;for(var f in t)!e&&!G.call(t,f)||u&&("length"==f||l&&("offset"==f||"parent"==f)||c&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||(i=typeof(n=f),(o=null==(o=d)?A:o)&&("number"==i||"symbol"!=i&&E.test(n))&&-1<n&&n%1==0&&n<o))||s.push(f);return s}var X,Y,Z=(X=Object.keys,Y=Object,function(t){return X(Y(t))}),tt=Object.prototype.hasOwnProperty;function et(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||T))return Z(t);var e,n,o=[];for(var i in Object(t))tt.call(t,i)&&"constructor"!=i&&o.push(i);return o}function nt(t){return(F(t)?Q:et)(t)}var ot,it=function(t,e,n){for(var o=-1,i=Object(t),r=n(t),a=r.length;a--;){var l=r[ot?a:++o];if(!1===e(i[l],l,i))break}return t};var rt,at,lt=(rt=function(t,e){return t&&it(t,e,nt)},function(t,e){if(null==t)return t;if(!F(t))return rt(t,e);for(var n=t.length,o=at?n:-1,i=Object(t);(at?o--:++o<n)&&!1!==e(i[o],o,i););return t});function ct(t,e){var n;return(b(t)?$:lt)(t,"function"==typeof(n=e)?n:w)}var ut=["name"];function st(r){return{restrict:"EA",require:"?ngModel",template:'<div><textarea class="uk-textarea" name="{{id}}" id="{{id}}"></textarea></div>',link:function(t,e,n,p){function o(){i.create({width:"100%",height:350,resize:!0,menubar:!1,valid_elements:"*[*]",setup:function(t){var e,n,a,l,o,i,c,u,r,s,d,f;e=t,n=p,["change","input"].forEach(function(t){return e.on(t,function(){return n.$setViewValue(e.getContent())})}),a=t,l=p,o=m.editor,i=o.title,c=o.iframe,a.addButton("editor",{icon:"fullscreen",tooltip:i,onclick:function(){var t=window,e=t.innerWidth,n=t.innerHeight,r=a.windowManager.open({title:i,html:'<iframe src="'+c+'" onload="tinyMCE.activeEditor.fire(\'JEditor\', this)"></iframe>',width:.9*e,height:.9*n-100,buttons:[{text:"Ok",subtype:"primary",onclick:function(){return r.fire("update")}},{text:"Cancel",onclick:"close"}]});a.once("JEditor",function(t){var e=t.contentWindow.Joomla,n=t.contentDocument,o=a.getContent(),i=n.getElementById("content");i&&(i.value=o),e.editors.instances.content&&e.editors.instances.content.setValue(o),r.on("update",function(){a.setContent(e.editors.instances.content.getValue()),l.$setViewValue(a.getContent()),r.close()})})}}),a.settings.toolbar1+=" editor",u=t,r=m.editor,s=r.id,d=r.buttons,(f=y.default.map(d,function(t){var a=t.text,l=t.link,e=t.options,c=void 0===e?{}:e;return{text:a,name:"insert_"+a.toLowerCase(),context:"insert",onclick:function(){var t,e=window,n=e.Joomla,o=e.innerWidth,i=e.innerHeight,r=u.windowManager.open((t={title:a,html:'<iframe src="'+l.replace(s,u.id)+'"></iframe>',width:.8*o,height:.8*i-100,buttons:[{text:"Close",onclick:"close"}]},function(t){var e=t.buttons,i=c.confirmCallback,n=c.confirmText;i&&e.unshift({text:n,subtype:"primary",onclick:function(t){var e=t.target,n=document.getElementById(r._id),o="return "+i.replace(s,u.id);n.classList.add("modal-content"),Promise.resolve(new Function(o).call(e)).then(function(){return r.close()})}})}(t),t));n.current=r.on("close",function(){return n.current=null}),n.current.querySelector=function(){return null}}}})).forEach(function(t){var e=t.name,n=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],0<=e.indexOf(n)||(i[n]=t[n]);return i}(t,ut);return u.addMenuItem(e,n)}),u.settings.insert_button_items+=" | "+f.map(function(t){return t.name}).join(" "),t.on("init",function(){ct(t.schema.elements,function(t){return t.attributePatterns=(t.attributePatterns||[]).concat([{pattern:/^uk-.*$/}])}),t.setContent(p.$viewValue||"")})}}),p.$render=function(){try{i.instance.setContent(p.$viewValue||""),y.default("#"+i.id).val(p.$viewValue||"")}catch(t){}},p.$render()}var m=window.widgetkit.config,i=function(n){void 0===n&&(n={});var t=window,o=t.Joomla,i=t.tinyMCE;return{id:"mce_"+Math.random().toString(36).substr(2,8),instance:null,create:function(t){var e=this;void 0===t&&(t={}),this.instance=new i.Editor(this.id,y.default.extend({},n.settings,t),i.EditorManager),this.instance.render(),o.editors.instances[this.id]={getValue:function(){return e.instance.getContent()},setValue:function(t){return e.instance.setContent(t)},getSelection:function(){return e.instance.selection.getContent()},replaceSelection:function(t){return e.instance.execCommand("mceInsertContent",!1,t)}}},destroy:function(){this.instance.destroy(),this.instance=null,delete o.editors.instances[this.id]}}}(m.editor);t.id=i.id,t.$on("$destroy",function(){return i.destroy()}),r(function(){return setTimeout(o)})}}}var dt,ft,pt,mt,ht=window.widgetkit.config;if(o.default.module("widgetkit").run(["$rootScope","$rootElement","$timeout","$filter",function(t,n,o,e){window.parent.document.updateUploader=window.parent.document.updateUploader||function(){};var i=y.default("body.com_widgetkit"),r=i.find(".header .container-title").append('<h1 class="page-title"><span class="icon-widgetkit"></span>Widgetkit: <span></span></h1>').find(".page-title span").eq(1),a=i.find(".subhead .btn-toolbar"),l='<div class="btn-wrapper btn-group" id="toolbar-create"><button class="btn btn-small btn-success"><span class="icon-new icon-white"></span></span> '+e("trans")("New")+"</button></div>",c='<div class="btn-wrapper btn-group" id="toolbar-apply"><button class="btn btn-small btn-success"><span class="icon-apply icon-white"></span> '+e("trans")("Save")+'</button></div> <div class="btn-wrapper btn-group" id="toolbar-save"><button class="btn btn-small"><span class="icon-save"></span> '+e("trans")("Save & Close")+'</button></div> <div class="btn-wrapper btn-group" id="toolbar-cancel"><button class="btn btn-small"><span class="icon-cancel"></span> '+e("trans")("Close")+"</button></div>",u='<div class="btn-wrapper btn-group ms-auto" id="toolbar-options"><button class="btn btn-small"><span class="icon-options"></span> '+e("trans")("Options")+"</button></div>";function s(){a.find("#toolbar-apply button, #toolbar-save button").prop("disabled",n.find("form.ng-invalid").length)}a.on("click","#toolbar-create button",function(){n.scope().vm.createContent()}).on("click","#toolbar-apply",function(){n.scope().vm.saveContent()}).on("click","#toolbar-save",function(){var t=n.scope();t.vm.saveContent().$promise.then(function(){t.vm.setView("content")})}).on("click","#toolbar-cancel",function(){var t=n.scope();t.vm.setView("content"),t.$apply()}).on("click","#toolbar-options",function(){location.href="index.php?option=com_config&view=component&component=com_widgetkit"}),i.on("keyup",'[ng-model="content.name"]',s),t.$on("wk.change.view",function(t,e){o(function(){r.text(n.find("h2.js-header").text()),a.empty().html("content"===e?l:"contentEdit"===e?c:"").append(u),s()})})}]),dt=o.default,ft=window.Joomla,dt.module("Fields").directive("fieldWysiwygeditor",["$timeout","mediaPicker",st]),window.jModalClose=function(){window.tinyMCE.activeEditor.windowManager.close()},window.jInsertEditorText=function(t,e){ft.editors.instances[e].replaceSelection(t)},window.SqueezeBox=window.SqueezeBox||{close:window.jModalClose},ht.platform.version.match(/3\.*./)){var gt=window.MooTools;if((mt=o.default).module("widgetkit").service("mediaPicker",["$templateCache","$compile","$q","$rootScope","$rootElement","filterFilter","UIkit","mediaRequest","Application",function(e,n,o,i,r,t,a,u,s){var l,c,d,f,p,m,h=/\.(jpe?g|a?png|gif|webp|avif|svg|mp3|ogg|wav|mp4|wmv|ogv|webm)$/i,g=!1,v={init:function(t){return t&&t.allowedFiletypes&&(g=t.allowedFiletypes),this.options=mt.extend({multiple:!1},t),p=o.defer(),c=y.default(e.get("media")),d=c.data("media-path"),(f=n(c)(i).scope()).vm=this,f.selectItem=function(t,e){if(e.shiftKey&&m){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty();for(var n,o=y.default(e.target).closest("li"),i=o.parent().children(),r=o.index()>m.index()?1:-1,a=1==r?m.index():o.index(),l=1==r?o.index():m.index(),c=a;c<=l;c++)(n=i.eq(c).scope())[n.folder?"folder":"file"].selected=!0}else t.selected=!t.selected;m=y.default(e.target).closest("li")},this.open("").then(function(){v.modal=a.modal(y.default('<div class="uk-modal uk-modal-container">').append(c),{container:r[0],stack:!0}),v.modal.show(),v.close=function(){v.modal.hide()},v.initUpload()}),p.promise},initUpload:function(){var e=y.default("progress",c)[0],t={name:"Filedata[]",multiple:!0,params:{"Content-Type":"multipart/form-data"},allow:"*.(jpeg|jpg|gif|apng|png|svg|webp|avif|mp3|ogg|wav|mp4|wmv|ogv|webm)",beforeAll:function(t){t.url=u.url({task:"file.upload",tmpl:"component",format:"html",folder:l},!0)},loadStart:function(t){e.max=t.total,e.value=t.loaded,e.hidden=!1},progress:function(t){e.max=t.total,e.value=t.loaded},loadEnd:function(t){e.max=t.total,e.value=t.loaded},error:function(t){a.notification({message:t.message,status:"danger",container:r}),e.hidden=!0},fail:function(t){a.notification({message:t,status:"danger",container:r})},completeAll:function(){v.open(l).then(function(){e.hidden=!0})}};a.upload(c,t)},open:function(r){return u.get({view:"mediaList",tmpl:"component",folder:r,layout:"details"}).then(function(t){m=null,f.media=[],f.breadcrumbs=[];var e=y.default(t.data).find("tbody tr");".."===e.first().find(".description").text().trim()&&(e=e.not(e[0])),e.each(function(){var t=y.default(this),e=t.find("td:first a").length?t.find("td:first a"):t.find("td:nth-child(2) a"),n=t.find("td :checkbox").val(),o=t.find("td.dimensions").text().trim().split(" x "),i=(r?r+"/":"")+n;f.media.push({title:n,path:i,url:(d?d+"/":"")+i,href:s.baseUrl()+"/"+(d?d+"/":"")+i,type:e.is("[target]")?"folder":"file",media:Boolean(i.match(h)),width:o[0],height:o[1],size:t.find("td.filesize").text().trim()})});for(var n=((l=r)?"/"+l:"").split("/");f.breadcrumbs.unshift({path:n.join("/").substr(1),title:n.pop()}),n.length;);f.breadcrumbs[0].title="home"})},select:function(){function l(t){return t.replace(/[_-]/g," ").replace(/\.[^.]+$/,"").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1)})}var t=this.options,e=v.getSelected(),n=[],c=[];if(e.forEach(function(t){t.media||g&&!t.path.match(g)?(t.title=l(t.title),c.push(t)):n.push(t)}),n.length){var o=[];n.forEach(function(a){o.push(u.get({view:"mediaList",tmpl:"component",folder:a.title,layout:"details"}).then(function(t){var e=y.default(t.data).find("tbody tr");".."===e.first().find(".description").text().trim()&&(e=e.not(e[0])),e.each(function(){var t=y.default(this),e=t.find("td:first a"),n=t.find("td :checkbox").val(),o=t.find("td.dimensions").text().trim().split(" x "),i=(a.title?a.title+"/":"")+n;if(i.match(h)){var r={title:l(n),path:i,url:(d?d+"/":"")+i,href:s.baseUrl()+"/"+(d?d+"/":"")+i,type:e.is("[target]")?"folder":"file",media:Boolean(i.match(h)),width:o[0],height:o[1],size:t.find("td.filesize").text().trim()};c.push(r)}})}))}),Promise.all(o).then(function(){p.resolve(t.multiple||!c.length?c:c[0]),v.close()})}else p.resolve(this.options.multiple||!c.length?c:c[0]),v.close()},addFolder:function(){var t=prompt("Folder Name");t&&u.post({task:"folder.create",foldername:t,folderbase:l}).then(function(){v.open(l)})},remove:function(){window.confirm("Are you sure?")&&u.post({task:"folder.delete",folder:l,rm:v.getSelected().map(function(t){return t.title})}).then(function(){v.open(l)})},getSelected:function(){return t(f.media,{selected:!0})}};return{select:function(t){return v.init(t)}}}]).service("mediaRequest",["$q","$http","Application",function(t,e,n){var o="index.php?option=com_media";return{get:function(t){return e.get(this.url(t))},post:function(t){return t[n.config.token]=1,e.post(o,y.default.param(t),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},url:function(t,e){return e&&(t[n.config.token]=1),o+"&"+y.default.param(t)}}}]),gt){var vt=Element.prototype.hide;Element.prototype.hide=function(){return y.default(this).is('[class*="uk-"]')?this:vt.apply(this,[])}}}else{var bt,wt=y.default('link[href*="atum/css/template"]')[0];if((pt=o.default).module("widgetkit").service("mediaPicker",["$templateCache","$compile","$q","$rootScope","$rootElement","filterFilter","UIkit","mediaRequest","Application",function(e,n,o,i,r,t,a,l,c){var u,s,d,f,p,m,h=!1,g={init:function(t){return t&&t.allowedFiletypes&&(h=t.allowedFiletypes),this.options=pt.extend({multiple:!1},t),p=o.defer(),s=y.default(e.get("media")),d=s.data("media-path"),(f=n(s)(i).scope()).vm=this,f.selectItem=function(t,e){if(e.shiftKey&&m){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty();for(var n,o=y.default(e.target).closest("li"),i=o.parent().children(),r=o.index()>m.index()?1:-1,a=1==r?m.index():o.index(),l=1==r?o.index():m.index(),c=a;c<=l;c++)(n=i.eq(c).scope())[n.folder?"folder":"file"].selected=!0}else t.selected=!t.selected;m=y.default(e.target).closest("li")},this.open("").then(function(){g.modal=a.modal(y.default('<div class="uk-modal uk-modal-container">').append(s),{container:r[0],stack:!0}),g.modal.show(),g.close=function(){g.modal.hide()},g.initUpload()}),p.promise},initUpload:function(){var e=y.default("progress",s)[0],t={name:"Filedata[]",multiple:!0,params:{"Content-Type":"multipart/form-data"},allow:"*.(jpeg|jpg|gif|apng|png|svg|webp|avif|mp3|ogg|wav|mp4|wmv|ogv|webm)",beforeAll:function(t){t.url=l.url({path:v(u)},!0),t.beforeSend=function(n){var o,i=n.data.get("Filedata[]");return o=i,new Promise(function(e){var t=new FileReader;t.onload=function(t){return e(t.target.result)},t.readAsDataURL(o)}).then(function(t){var e;return pt.extend(n,{headers:{"Content-Type":"application/json"},responseType:"json",data:JSON.stringify(((e={override:!0,name:i.name})[c.config.token]="1",e.content=t.slice(t.indexOf("base64")+7),e))})})}},loadStart:function(t){e.max=t.total,e.value=t.loaded,e.hidden=!1},progress:function(t){e.max=t.total,e.value=t.loaded},loadEnd:function(t){e.max=t.total,e.value=t.loaded},error:function(t){a.notification({message:t.message,status:"danger",container:r}),e.hidden=!0},fail:function(t){a.notification({message:t,status:"danger",container:r})},completeAll:function(){g.open(u).then(function(){e.hidden=!0})}};a.upload(s,t)},open:function(n){return w(n).then(function(t){m=null,f.media=[],f.breadcrumbs=[],t.forEach(function(t){f.media.push(t)});for(var e=((u=n)?"/"+u:"").split("/");f.breadcrumbs.unshift({path:e.join("/").substr(1),title:e.pop()}),e.length;);f.breadcrumbs[0].title="home"})},select:function(){var t=this.options,e=g.getSelected(),n=[],o=[];if(e.forEach(function(t){t.media||h&&!t.path.match(h)?(t.title=t.title.replace(/[_-]/g," ").replace(/\.[^.]+$/,"").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1)}),o.push(t)):n.push(t)}),n.length){var i=[];n.forEach(function(t){i.push(w(t.path,!0).then(function(t){t.forEach(function(t){o.push(t)})}))}),Promise.all(i).then(function(){p.resolve(t.multiple||!o.length?o:o[0]),g.close()})}else p.resolve(this.options.multiple||!o.length?o:o[0]),g.close()},addFolder:function(){var t=prompt("Folder Name");t&&l.post({path:v(u)},{name:t}).then(function(){g.open(u)})},remove:function(){if(window.confirm("Are you sure?")){var t=g.getSelected().map(function(t){return t.path});Promise.all(t.map(function(t){return l.delete({path:v(t)})})).then(function(){g.open(u)})}},getSelected:function(){return t(f.media,{selected:!0})}};function v(t){return"local-images:/"+(t||"").replace(/^\/+/g,"")}var b=/\.(jpe?g|a?png|gif|webp|avif|svg|mp3|ogg|wav|mp4|wmv|ogv|webm)$/i;function w(n,o){return l.get({path:v(n)}).then(function(t){return t.data.data.map(function(t){var e=(n?n+"/":"")+t.name;if(!o||e.match(b))return{title:t.name,path:e,url:(d?d+"/":"")+e,href:c.baseUrl()+"/"+(d?d+"/":"")+e,type:"dir"===t.type?"folder":"file",media:Boolean(e.match(b)),width:t.width,height:t.height,size:t.size}}).filter(function(t){return t})})}return{select:function(t){return g.init(t)}}}]).service("mediaRequest",["$q","$http","Application",function(t,o,i){function e(n){return function(t,e){return(e=e||{})[i.config.token]=1,o({url:this.url(t),method:n,noMethodOverride:!0,data:JSON.stringify(e)})}}return{get:function(t){return o.get(this.url(t))},delete:e("DELETE"),post:e("POST"),put:e("PUT"),url:function(t,e){return e&&(t[i.config.token]=1),"index.php?option=com_media&task=api.files&format=json"+(t?"&"+y.default.param(t):"")}}}]),null!=wt&&null!=(bt=wt.sheet)&&bt.cssRules)for(var yt=0;yt<wt.sheet.cssRules.length;yt++){var jt;null!=(jt=wt.sheet.cssRules[yt].selectorText)&&jt.startsWith(".container-main .mce")&&wt.sheet.deleteRule(yt)}}}(jQuery,angular);