text: /**
   * osjs-apps-settings - 
   * @author 
   * @version v1.0.0
   * @link 
   * @license 
   */
  define(function(){"use strict";const n=OSjs.require("core/package-manager"),e=OSjs.require("core/locales"),t=OSjs.require("core/dialog"),o=OSjs.require("core/theme"),i=OSjs.require("utils/misc");let l,a=[],s=[],c=0;function d(n,e){let t=!0;try{t=!0===s[l.items[e].name].HasOptions}catch(n){}n._find("PanelButtonOptions").set("disabled",e<0||!t),n._find("PanelButtonRemove").set("disabled",e<0),n._find("PanelButtonUp").set("disabled",e<=0),n._find("PanelButtonDown").set("disabled",e<0||e>=c)}function u(n,e){const t=[];a.forEach(function(n,e){const l=n.name;s[l]&&t.push({value:e,columns:[{icon:o.getIcon(s[l].Icon),label:i.format("{0} ({1})",s[l].Name,s[l].Description)}]})}),c=a.length-1;const l=n._find("PanelItems");l.clear(),l.add(t),void 0!==e?(l.set("selected",e),d(n,e)):d(n,-1)}function f(n,e,t){const o=a[e],i=e+t;a.splice(e,1),a.splice(i,0,o),u(n,i)}function p(n,e,o){n._toggleDisabled(!0),t.create("Color",{color:e},function(e,t,i){n._toggleDisabled(!1),"ok"===t&&i&&o(i.hex)},n)}return{group:"personal",name:"Panel",label:"LBL_PANELS",icon:"apps/gnome-panel.png",watch:["CoreWM"],init:function(){},update:function(e,t,o,i){let c=85;"number"==typeof(l=o.panels[0]).options.opacity&&(c=l.options.opacity),e._find("PanelPosition").set("value",l.options.position),e._find("PanelAutoHide").set("value",l.options.autohide),e._find("PanelOntop").set("value",l.options.ontop),e._find("PanelBackgroundColor").set("value",l.options.background||"#101010"),e._find("PanelForegroundColor").set("value",l.options.foreground||"#ffffff"),e._find("PanelOpacity").set("value",c),s=n.getPackage("CoreWM").panelItems,a=l.items||[],u(e)},render:function(n,t,l,c,r){n._find("PanelPosition").add([{value:"top",label:e._("LBL_TOP")},{value:"bottom",label:e._("LBL_BOTTOM")}]),n._find("PanelBackgroundColor").on("open",function(e){p(n,e.detail,function(e){n._find("PanelBackgroundColor").set("value",e)})}),n._find("PanelForegroundColor").on("open",function(e){p(n,e.detail,function(e){n._find("PanelForegroundColor").set("value",e)})}),n._find("PanelItems").on("select",function(e){e&&e.detail&&e.detail.entries&&e.detail.entries.length&&d(n,e.detail.entries[0].index)}),n._find("PanelButtonAdd").on("click",function(){n._toggleDisabled(!0),function(n,e,t){if(e){const l=n._app,a=new OSjs.Applications.ApplicationSettings.SettingsItemDialog(l,l.__metadata,e,t);a._on("inited",function(n){a._find("List").clear().add(Object.keys(s).map(function(n,e){return{value:n,columns:[{icon:o.getIcon(s[n].Icon),label:i.format("{0} ({1})",s[n].Name,s[n].Description)}]}})),a._setTitle("Panel Items",!0)}),n._addChild(a,!0,!0)}}(n,t,function(e,t){n._toggleDisabled(!1),t&&(a.push({name:t.data}),u(n))})}),n._find("PanelButtonRemove").on("click",function(){const e=n._find("PanelItems").get("selected");e.length&&(a.splice(e[0].index,1),u(n))}),n._find("PanelButtonUp").on("click",function(){const e=n._find("PanelItems").get("selected");e.length&&f(n,e[0].index,-1)}),n._find("PanelButtonDown").on("click",function(){const e=n._find("PanelItems").get("selected");e.length&&f(n,e[0].index,1)}),n._find("PanelButtonReset").on("click",function(){const e=r.getDefaultSetting("panels");a=e[0].items,u(n)}),n._find("PanelButtonOptions").on("click",function(){const e=n._find("PanelItems").get("selected");e.length&&function(n,e){try{n.panels[0]._items[e].openSettings()}catch(n){}}(r,e[0].index)})},save:function(n,e,t,o){t.panels=t.panels||[{}],t.panels[0].options=t.panels[0].options||{},t.panels[0].options.position=n._find("PanelPosition").get("value"),t.panels[0].options.autohide=n._find("PanelAutoHide").get("value"),t.panels[0].options.ontop=n._find("PanelOntop").get("value"),t.panels[0].options.background=n._find("PanelBackgroundColor").get("value")||"#101010",t.panels[0].options.foreground=n._find("PanelForegroundColor").get("value")||"#ffffff",t.panels[0].options.opacity=n._find("PanelOpacity").get("value"),t.panels[0].items=a}}});
  //# sourceMappingURL=sourcemaps/module-panel.js.map
  