From 782e14e3eb19e34a56811a7203db6bb35bc2bdd9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sun, 5 May 2024 18:51:11 +0000 Subject: [PATCH] 2.8.1 - Update dist/ --- dist/assets/{About-5ae5d6f2.js => About-6fffd64e.js} | 2 +- .../{AdvancedTable-147b64b8.js => AdvancedTable-e51651be.js} | 2 +- dist/assets/{AgentEdit-59ca8276.js => AgentEdit-c34c5f67.js} | 2 +- ...ecuteModule-859d030e.js => AgentExecuteModule-e502a55e.js} | 2 +- ...{AgentTasksList-2ea9239f.js => AgentTasksList-f6ba31e5.js} | 2 +- dist/assets/{Agents-c9cedcef.js => Agents-aaf6c77f.js} | 2 +- .../assets/{BypassEdit-0344b1a5.js => BypassEdit-fec6b0fa.js} | 2 +- dist/assets/{Bypasses-717aa9bf.js => Bypasses-22c36891.js} | 2 +- ...{CredentialEdit-be5ab6a9.js => CredentialEdit-577ee483.js} | 2 +- .../{Credentials-4df467c0.js => Credentials-d1aefd59.js} | 2 +- ...ateTimeDisplay-e5665873.js => DateTimeDisplay-951c60c5.js} | 2 +- dist/assets/{Downloads-58de5b41.js => Downloads-5f65309f.js} | 2 +- .../{EditPageTop-4e0a4ef6.js => EditPageTop-0ed1194e.js} | 2 +- ...rrorStateAlert-44af51cd.js => ErrorStateAlert-3d45e0aa.js} | 2 +- ...nelFilter-33a56e95.js => ExpansionPanelFilter-010a2264.js} | 2 +- ...nelSearch-155a732a.js => ExpansionPanelSearch-94b8e3ac.js} | 2 +- .../{GeneralForm-ad50630d.js => GeneralForm-e1472145.js} | 2 +- .../assets/{InfoViewer-a26545d4.js => InfoViewer-98b37678.js} | 2 +- .../{ListPageTop-5130be67.js => ListPageTop-78cbc2f3.js} | 2 +- .../{ListenerEdit-bf632b6f.js => ListenerEdit-ab50e922.js} | 2 +- dist/assets/{Listeners-0f3a3f0e.js => Listeners-ab1b83c8.js} | 2 +- ...ofileEdit-5d06b59a.js => MalleableProfileEdit-120c7dd8.js} | 2 +- .../{ModuleExecute-3ce5fb41.js => ModuleExecute-e6251f6d.js} | 2 +- dist/assets/{Modules-dd018638.js => Modules-8e2f6cb8.js} | 2 +- .../{Notifications-fa0444df.js => Notifications-52a21eef.js} | 2 +- .../{Obfuscation-a94e0f56.js => Obfuscation-2147baab.js} | 2 +- .../assets/{PluginEdit-d9ffd065.js => PluginEdit-758bce52.js} | 2 +- ...luginTasksList-5b08e12c.js => PluginTasksList-9cde5ac1.js} | 4 ++-- dist/assets/{Plugins-8fb73a0c.js => Plugins-693fa884.js} | 2 +- dist/assets/{Settings-f3026d52.js => Settings-fd4b553f.js} | 2 +- .../assets/{StagerEdit-8dcfcf7e.js => StagerEdit-a930136e.js} | 2 +- dist/assets/{Stagers-85d35917.js => Stagers-2ac7ec4a.js} | 2 +- dist/assets/{TagViewer-357f9253.js => TagViewer-81c3b950.js} | 2 +- ...{TechniqueChips-8d3b8349.js => TechniqueChips-3c9db4c5.js} | 2 +- .../{TooltipButton-ef876422.js => TooltipButton-f53c45a7.js} | 2 +- dist/assets/{UserEdit-19cb593f.js => UserEdit-88d17ced.js} | 2 +- dist/assets/{Users-644a9966.js => Users-9e8fdec8.js} | 2 +- .../assets/{VDataTable-f3602581.js => VDataTable-dab2ebf1.js} | 2 +- ...elHeader-a9447b85.js => VExpansionPanelHeader-69136628.js} | 2 +- ...pansionPanels-26c41551.js => VExpansionPanels-cacfd68a.js} | 2 +- .../assets/{VItemGroup-e39c2c83.js => VItemGroup-3637266a.js} | 2 +- .../{VPagination-48f2bf47.js => VPagination-4794e169.js} | 2 +- dist/assets/{VSelect-f55906da.js => VSelect-22e7980f.js} | 2 +- dist/assets/{VSwitch-2cfffd69.js => VSwitch-3f004360.js} | 2 +- dist/assets/{VTabItem-e0010b3a.js => VTabItem-01f057dc.js} | 2 +- dist/assets/{VTextarea-9eb75b3d.js => VTextarea-14e342fc.js} | 2 +- dist/assets/{VTooltip-0015e28c.js => VTooltip-7c0b187f.js} | 2 +- dist/assets/{ansi_up-b91c3d1d.js => ansi_up-7c0d87a9.js} | 2 +- .../assets/{bypass-api-80f88682.js => bypass-api-6126dc83.js} | 2 +- .../{bypass-module-9d0c5e38.js => bypass-module-4e86a448.js} | 2 +- ...ntial-module-512a6f9e.js => credential-module-93372e4e.js} | 2 +- dist/assets/{index-e8f29bb9.js => index-e409ba63.js} | 4 ++-- dist/assets/{index-eabf96b4.js => index-e87896eb.js} | 2 +- .../{malleable-api-d0b35547.js => malleable-api-09135b63.js} | 2 +- ...leable-module-cb1f5265.js => malleable-module-2a911c2d.js} | 2 +- .../assets/{module-api-3f2776ef.js => module-api-04d2f26d.js} | 2 +- dist/assets/module-module-a5a9a575.js | 1 - dist/assets/module-module-e75169e8.js | 1 + .../{stager-module-494f3496.js => stager-module-0df99767.js} | 2 +- dist/assets/{tag-api-c942253a.js => tag-api-d7e45ad4.js} | 2 +- dist/index.html | 2 +- 61 files changed, 62 insertions(+), 62 deletions(-) rename dist/assets/{About-5ae5d6f2.js => About-6fffd64e.js} (80%) rename dist/assets/{AdvancedTable-147b64b8.js => AdvancedTable-e51651be.js} (78%) rename dist/assets/{AgentEdit-59ca8276.js => AgentEdit-c34c5f67.js} (99%) rename dist/assets/{AgentExecuteModule-859d030e.js => AgentExecuteModule-e502a55e.js} (92%) rename dist/assets/{AgentTasksList-2ea9239f.js => AgentTasksList-f6ba31e5.js} (95%) rename dist/assets/{Agents-c9cedcef.js => Agents-aaf6c77f.js} (92%) rename dist/assets/{BypassEdit-0344b1a5.js => BypassEdit-fec6b0fa.js} (89%) rename dist/assets/{Bypasses-717aa9bf.js => Bypasses-22c36891.js} (86%) rename dist/assets/{CredentialEdit-be5ab6a9.js => CredentialEdit-577ee483.js} (85%) rename dist/assets/{Credentials-4df467c0.js => Credentials-d1aefd59.js} (88%) rename dist/assets/{DateTimeDisplay-e5665873.js => DateTimeDisplay-951c60c5.js} (89%) rename dist/assets/{Downloads-58de5b41.js => Downloads-5f65309f.js} (87%) rename dist/assets/{EditPageTop-4e0a4ef6.js => EditPageTop-0ed1194e.js} (89%) rename dist/assets/{ErrorStateAlert-44af51cd.js => ErrorStateAlert-3d45e0aa.js} (99%) rename dist/assets/{ExpansionPanelFilter-33a56e95.js => ExpansionPanelFilter-010a2264.js} (91%) rename dist/assets/{ExpansionPanelSearch-155a732a.js => ExpansionPanelSearch-94b8e3ac.js} (83%) rename dist/assets/{GeneralForm-ad50630d.js => GeneralForm-e1472145.js} (98%) rename dist/assets/{InfoViewer-a26545d4.js => InfoViewer-98b37678.js} (83%) rename dist/assets/{ListPageTop-5130be67.js => ListPageTop-78cbc2f3.js} (96%) rename dist/assets/{ListenerEdit-bf632b6f.js => ListenerEdit-ab50e922.js} (89%) rename dist/assets/{Listeners-0f3a3f0e.js => Listeners-ab1b83c8.js} (93%) rename dist/assets/{MalleableProfileEdit-5d06b59a.js => MalleableProfileEdit-120c7dd8.js} (90%) rename dist/assets/{ModuleExecute-3ce5fb41.js => ModuleExecute-e6251f6d.js} (62%) rename dist/assets/{Modules-dd018638.js => Modules-8e2f6cb8.js} (89%) rename dist/assets/{Notifications-fa0444df.js => Notifications-52a21eef.js} (86%) rename dist/assets/{Obfuscation-a94e0f56.js => Obfuscation-2147baab.js} (96%) rename dist/assets/{PluginEdit-d9ffd065.js => PluginEdit-758bce52.js} (69%) rename dist/assets/{PluginTasksList-5b08e12c.js => PluginTasksList-9cde5ac1.js} (59%) rename dist/assets/{Plugins-8fb73a0c.js => Plugins-693fa884.js} (71%) rename dist/assets/{Settings-f3026d52.js => Settings-fd4b553f.js} (95%) rename dist/assets/{StagerEdit-8dcfcf7e.js => StagerEdit-a930136e.js} (86%) rename dist/assets/{Stagers-85d35917.js => Stagers-2ac7ec4a.js} (90%) rename dist/assets/{TagViewer-357f9253.js => TagViewer-81c3b950.js} (99%) rename dist/assets/{TechniqueChips-8d3b8349.js => TechniqueChips-3c9db4c5.js} (85%) rename dist/assets/{TooltipButton-ef876422.js => TooltipButton-f53c45a7.js} (87%) rename dist/assets/{UserEdit-19cb593f.js => UserEdit-88d17ced.js} (91%) rename dist/assets/{Users-644a9966.js => Users-9e8fdec8.js} (82%) rename dist/assets/{VDataTable-f3602581.js => VDataTable-dab2ebf1.js} (99%) rename dist/assets/{VExpansionPanelHeader-a9447b85.js => VExpansionPanelHeader-69136628.js} (98%) rename dist/assets/{VExpansionPanels-26c41551.js => VExpansionPanels-cacfd68a.js} (88%) rename dist/assets/{VItemGroup-e39c2c83.js => VItemGroup-3637266a.js} (95%) rename dist/assets/{VPagination-48f2bf47.js => VPagination-4794e169.js} (96%) rename dist/assets/{VSelect-f55906da.js => VSelect-22e7980f.js} (99%) rename dist/assets/{VSwitch-2cfffd69.js => VSwitch-3f004360.js} (96%) rename dist/assets/{VTabItem-e0010b3a.js => VTabItem-01f057dc.js} (99%) rename dist/assets/{VTextarea-9eb75b3d.js => VTextarea-14e342fc.js} (95%) rename dist/assets/{VTooltip-0015e28c.js => VTooltip-7c0b187f.js} (98%) rename dist/assets/{ansi_up-b91c3d1d.js => ansi_up-7c0d87a9.js} (99%) rename dist/assets/{bypass-api-80f88682.js => bypass-api-6126dc83.js} (92%) rename dist/assets/{bypass-module-9d0c5e38.js => bypass-module-4e86a448.js} (66%) rename dist/assets/{credential-module-512a6f9e.js => credential-module-93372e4e.js} (95%) rename dist/assets/{index-e8f29bb9.js => index-e409ba63.js} (97%) rename dist/assets/{index-eabf96b4.js => index-e87896eb.js} (96%) rename dist/assets/{malleable-api-d0b35547.js => malleable-api-09135b63.js} (92%) rename dist/assets/{malleable-module-cb1f5265.js => malleable-module-2a911c2d.js} (72%) rename dist/assets/{module-api-3f2776ef.js => module-api-04d2f26d.js} (89%) delete mode 100644 dist/assets/module-module-a5a9a575.js create mode 100644 dist/assets/module-module-e75169e8.js rename dist/assets/{stager-module-494f3496.js => stager-module-0df99767.js} (95%) rename dist/assets/{tag-api-c942253a.js => tag-api-d7e45ad4.js} (82%) diff --git a/dist/assets/About-5ae5d6f2.js b/dist/assets/About-6fffd64e.js similarity index 80% rename from dist/assets/About-5ae5d6f2.js rename to dist/assets/About-6fffd64e.js index db67bbd..6cc1c36 100644 --- a/dist/assets/About-5ae5d6f2.js +++ b/dist/assets/About-6fffd64e.js @@ -1 +1 @@ -import{_}from"./ListPageTop-5130be67.js";import{n as a,_ as o}from"./index-e8f29bb9.js";import"./VTooltip-0015e28c.js";import"./VItemGroup-e39c2c83.js";const s={components:{ListPageTop:_},data(){return{breads:[{text:"About",disabled:!0,href:"/about"}]}},methods:{}};var n=function(){var t=this,r=t._self._c;return r("div",[r(_,{attrs:{breads:t.breads}}),t._m(0)],1)},i=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"about"},[t("img",{staticStyle:{"padding-bottom":"20px"},attrs:{alt:"Starkiller",width:"200px",src:o}}),t("span",[e._v("Starkiller is developed by "),t("a",{attrs:{href:"https://bc-security.org/blog",target:"_blank",rel:"noopener noreferrer"}},[e._v("BC Security")]),e._v(".")]),t("span",[e._v("If you would like to contribute please visit our "),t("a",{attrs:{href:"https://github.com/BC-SECURITY/Starkiller",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub")]),e._v(". ")])])}],l=a(s,n,i,!1,null,"ca353d84",null,null);const m=l.exports;export{m as default}; +import{_}from"./ListPageTop-78cbc2f3.js";import{n as a,_ as o}from"./index-e409ba63.js";import"./VTooltip-7c0b187f.js";import"./VItemGroup-3637266a.js";const s={components:{ListPageTop:_},data(){return{breads:[{text:"About",disabled:!0,href:"/about"}]}},methods:{}};var n=function(){var t=this,r=t._self._c;return r("div",[r(_,{attrs:{breads:t.breads}}),t._m(0)],1)},i=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"about"},[t("img",{staticStyle:{"padding-bottom":"20px"},attrs:{alt:"Starkiller",width:"200px",src:o}}),t("span",[e._v("Starkiller is developed by "),t("a",{attrs:{href:"https://bc-security.org/blog",target:"_blank",rel:"noopener noreferrer"}},[e._v("BC Security")]),e._v(".")]),t("span",[e._v("If you would like to contribute please visit our "),t("a",{attrs:{href:"https://github.com/BC-SECURITY/Starkiller",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub")]),e._v(". ")])])}],l=a(s,n,i,!1,null,"ca353d84",null,null);const m=l.exports;export{m as default}; diff --git a/dist/assets/AdvancedTable-147b64b8.js b/dist/assets/AdvancedTable-e51651be.js similarity index 78% rename from dist/assets/AdvancedTable-147b64b8.js rename to dist/assets/AdvancedTable-e51651be.js index 01bdc79..2316b4d 100644 --- a/dist/assets/AdvancedTable-147b64b8.js +++ b/dist/assets/AdvancedTable-e51651be.js @@ -1 +1 @@ -import{n as l,c as n}from"./index-e8f29bb9.js";import{_}from"./VExpansionPanels-26c41551.js";const a={name:"AdvancedTable"};var s=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(n,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(_,{staticClass:"mb-6",attrs:{multiple:""}},[e._t("filters")],2)],1),t(n,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[e._t("table")],2)],1)},i=[],o=l(a,s,i,!1,null,null,null,null);const m=o.exports;export{m as _}; +import{n as l,c as n}from"./index-e409ba63.js";import{_}from"./VExpansionPanels-cacfd68a.js";const a={name:"AdvancedTable"};var s=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(n,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(_,{staticClass:"mb-6",attrs:{multiple:""}},[e._t("filters")],2)],1),t(n,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[e._t("table")],2)],1)},i=[],o=l(a,s,i,!1,null,null,null,null);const m=o.exports;export{m as _}; diff --git a/dist/assets/AgentEdit-59ca8276.js b/dist/assets/AgentEdit-c34c5f67.js similarity index 99% rename from dist/assets/AgentEdit-59ca8276.js rename to dist/assets/AgentEdit-c34c5f67.js index 488b2d1..764ab62 100644 --- a/dist/assets/AgentEdit-59ca8276.js +++ b/dist/assets/AgentEdit-c34c5f67.js @@ -1,4 +1,4 @@ -import{I as Pe,J as K,K as ie,L as Bi,b as W,T as pe,a as J,M as Pi,N as Ai,O as bn,P as bt,Q as vn,R as Ti,S as Gt,U as Cn,W as Mi,X as R,Y as ji,Z as Ri,$ as Oi,a0 as Zt,a1 as Li,u as Ii,n as Z,k as _n,j as he,a2 as le,C as wn,l as zi,D as Ni,E as Vi,F as qi,a3 as Hi,a4 as Wi,a5 as Ui,a6 as vt,a7 as Oe,a8 as Le,c as ee,a9 as Ie,aa as fe,ab as ze,ac as ut,ad as Fn,ae as Yi,af as kn,d as Ji,e as Ki,V as Gi,ag as I,ah as Zi,ai as Be,G as Ae,aj as Xi,ak as $t,H as Xt,al as Qi,am as er,an as tr,ao as nr,i as ir}from"./index-e8f29bb9.js";import{h as Ct}from"./moment-fbc5633a.js";import{b as me,c as ne,a as En,_ as $n}from"./ErrorStateAlert-44af51cd.js";import{_ as Te,a as rr}from"./VTooltip-0015e28c.js";import{a as sr,b as Sn,f as ar,c as or}from"./GeneralForm-ad50630d.js";import{_ as xn}from"./TagViewer-357f9253.js";import{_ as Bn}from"./AgentTasksList-2ea9239f.js";import{_ as Ne}from"./AgentExecuteModule-859d030e.js";import{d as lr}from"./index-eabf96b4.js";import{e as Ee}from"./module-api-3f2776ef.js";import{A as ur}from"./ansi_up-b91c3d1d.js";import{u as cr}from"./module-module-a5a9a575.js";import{_ as G}from"./TooltipButton-ef876422.js";import{a as Pn}from"./ListPageTop-5130be67.js";import{_ as Qt,a as re,b as en,c as se}from"./VTabItem-e0010b3a.js";import{a as dr}from"./VSelect-f55906da.js";import"./VSwitch-2cfffd69.js";import"./bypass-module-9d0c5e38.js";import"./bypass-api-80f88682.js";import"./credential-module-512a6f9e.js";import"./malleable-module-cb1f5265.js";import"./malleable-api-d0b35547.js";import"./DateTimeDisplay-e5665873.js";import"./download-stager-ae353708.js";import"./VPagination-48f2bf47.js";import"./VDataTable-f3602581.js";import"./ExpansionPanelFilter-33a56e95.js";import"./VExpansionPanelHeader-a9447b85.js";import"./ExpansionPanelSearch-155a732a.js";import"./AdvancedTable-147b64b8.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";import"./tag-api-c942253a.js";import"./TechniqueChips-8d3b8349.js";import"./InfoViewer-a26545d4.js";const Ve=Pe.extend({name:"localable",props:{locale:String},computed:{currentLocale(){return this.locale||this.$vuetify.lang.current}}});function hr(e,t=0,n=1){let r;return e<100&&e>=0?(r=new Date(Date.UTC(e,t,n)),isFinite(r.getUTCFullYear())&&r.setUTCFullYear(e)):r=new Date(Date.UTC(e,t,n)),r}function _t(e,t,n){const r=7+t-n;return-((7+hr(e,0,r).getUTCDay()-t)%7)+r-1}function pr(e,t,n,r){let i=[0,31,59,90,120,151,181,212,243,273,304,334][t];return t>1&&St(e)&&i++,i+n}function ct(e,t,n){const r=_t(e,t,n),i=_t(e+1,t,n);return((St(e)?366:365)-r+i)/7}function fr(e,t,n,r,i){const a=_t(e,r,i),o=Math.ceil((pr(e,t,n)-a)/7);return o<1?o+ct(e-1,r,i):o>ct(e,r,i)?o-ct(e,r,i):o}function St(e){return e%4===0&&e%100!==0||e%400===0}const mr=[0,31,28,31,30,31,30,31,31,30,31,30,31],Dr=[0,31,29,31,30,31,30,31,31,30,31,30,31];function gr(e,t){return St(e)?Dr[t]:mr[t]}const yr=K(ie).extend({methods:{genPickerButton(e,t,n,r=!1,i=""){const a=this[e]===t,o=u=>{u.stopPropagation(),this.$emit(`update:${Bi(e)}`,t)};return this.$createElement("div",{staticClass:`v-picker__title__btn ${i}`.trim(),class:{"v-picker__title__btn--active":a,"v-picker__title__btn--readonly":r},on:a||r?void 0:{click:o}},Array.isArray(n)?n:[n])}}}),br=K(yr).extend({name:"v-date-picker-title",props:{date:{type:String,default:""},disabled:Boolean,readonly:Boolean,selectingYear:Boolean,value:{type:String},year:{type:[Number,String],default:""},yearIcon:{type:String}},data:()=>({isReversing:!1}),computed:{computedTransition(){return this.isReversing?"picker-reverse-transition":"picker-transition"}},watch:{value(e,t){this.isReversing=e(i.endsWith(t)&&(r[i.slice(0,-t.length)]=a=>e.$emit(i,n,a)),r),{})}function dt(e,t){return Object.keys(e.$listeners).reduce((n,r)=>(r.endsWith(t)&&(n[r]=e.$listeners[r]),n),{})}const vr=(e,t,n)=>(t=t>>0,e=String(e),n=String(n),e.length>t?String(e):(t=t-e.length,t>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+String(e))),L=(e,t=2)=>vr(e,t,"0");function te(e,t,n={start:0,length:0}){const r=i=>{const[a,o,u]=i.trim().split(" ")[0].split("-");return[L(a,4),L(o||1),L(u||1)].join("-")};try{const i=new Intl.DateTimeFormat(e||void 0,t);return a=>i.format(new Date(`${r(a)}T00:00:00+00:00`))}catch{return n.start||n.length?a=>r(a).substr(n.start||0,n.length):void 0}}const Tn=(e,t)=>{const[n,r]=e.split("-").map(Number);return r+t===0?`${n-1}-12`:r+t===13?`${n+1}-01`:`${n}-${L(r+t)}`},U=(e,t)=>{const[n,r=1,i=1]=e.split("-");return`${n}-${L(r)}-${L(i)}`.substr(0,{date:10,month:7,year:4}[t])},Cr=K(ie,Ve,pe).extend({name:"v-date-picker-header",props:{disabled:Boolean,format:Function,min:String,max:String,nextAriaLabel:String,nextIcon:{type:String,default:"$next"},prevAriaLabel:String,prevIcon:{type:String,default:"$prev"},readonly:Boolean,value:{type:[Number,String],required:!0}},data(){return{isReversing:!1}},computed:{formatter(){return this.format?this.format:String(this.value).split("-")[1]?te(this.currentLocale,{month:"long",year:"numeric",timeZone:"UTC"},{length:7}):te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},watch:{value(e,t){this.isReversing=e0?this.nextAriaLabel:this.prevAriaLabel,n=t?this.$vuetify.lang.t(t):void 0,r=this.disabled||e<0&&this.min&&this.calculateChange(e)0&&this.max&&this.calculateChange(e)>this.max;return this.$createElement(J,{attrs:{"aria-label":n},props:{dark:this.dark,disabled:r,icon:!0,light:this.light},on:{click:i=>{i.stopPropagation(),this.$emit("input",this.calculateChange(e))}}},[this.$createElement(W,e<0==!this.$vuetify.rtl?this.prevIcon:this.nextIcon)])},calculateChange(e){const[t,n]=String(this.value).split("-").map(Number);return n==null?`${t+e}`:Tn(String(this.value),e)},genHeader(){const e=!this.disabled&&(this.color||"accent"),t=this.$createElement("div",this.setTextColor(e,{key:String(this.value)}),[this.$createElement("button",{attrs:{type:"button"},on:{click:()=>this.$emit("toggle")}},[this.$slots.default||this.formatter(String(this.value))])]),n=this.$createElement("transition",{props:{name:this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"}},[t]);return this.$createElement("div",{staticClass:"v-date-picker-header__value",class:{"v-date-picker-header__value--disabled":this.disabled}},[n])}},render(){return this.$createElement("div",{staticClass:"v-date-picker-header",class:{"v-date-picker-header--disabled":this.disabled,...this.themeClasses}},[this.genBtn(-1),this.genHeader(),this.genBtn(1)])}});function Mn(e,t,n,r){return(!r||r(e))&&(!t||e>=t.substr(0,10))&&(!n||e<=n)}const jn=K(ie,Ve,pe).extend({directives:{Touch:Pi},props:{allowedDates:Function,current:String,disabled:Boolean,format:Function,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},min:String,max:String,range:Boolean,readonly:Boolean,scrollable:Boolean,tableDate:{type:String,required:!0},value:[String,Array]},data:()=>({isReversing:!1,wheelThrottle:null}),computed:{computedTransition(){return this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"},displayedMonth(){return Number(this.tableDate.split("-")[1])-1},displayedYear(){return Number(this.tableDate.split("-")[0])}},watch:{tableDate(e,t){this.isReversing=e{t&&!this.readonly&&this.$emit("input",e)}},An(this,`:${n}`,e))},genButton(e,t,n,r,i=!1){const a=Mn(e,this.min,this.max,this.allowedDates),o=this.isSelected(e)&&a,u=e===this.current,c=o?this.setBackgroundColor:this.setTextColor,d=(o||u)&&(this.color||"accent");let p=!1,f=!1;return this.range&&this.value&&Array.isArray(this.value)&&(p=e===this.value[0],f=e===this.value[this.value.length-1]),this.$createElement("button",c(d,{staticClass:"v-btn",class:this.genButtonClasses(a&&!i,t,o,u,p,f),attrs:{type:"button"},domProps:{disabled:this.disabled||!a||i},on:this.genButtonEvents(e,a,n)}),[this.$createElement("div",{staticClass:"v-btn__content"},[r(e)]),this.genEvents(e)])},getEventColors(e){const t=i=>Array.isArray(i)?i:[i];let n,r=[];if(Array.isArray(this.events)?n=this.events.includes(e):this.events instanceof Function?n=this.events(e)||!1:this.events?n=this.events[e]||!1:n=!1,n)n!==!0?r=t(n):typeof this.eventColor=="string"?r=[this.eventColor]:typeof this.eventColor=="function"?r=t(this.eventColor(e)):Array.isArray(this.eventColor)?r=this.eventColor:r=t(this.eventColor[e]);else return[];return r.filter(i=>i)},genEvents(e){const t=this.getEventColors(e);return t.length?this.$createElement("div",{staticClass:"v-date-picker-table__events"},t.map(n=>this.$createElement("div",this.setBackgroundColor(n)))):null},isValidScroll(e,t){const n=t(e),r=n.split("-").length===1?"year":"month";return e<0&&(this.min?n>=U(this.min,r):!0)||e>0&&(this.max?n<=U(this.max,r):!0)},wheel(e,t){this.$emit("update:table-date",t(e.deltaY))},touch(e,t){this.$emit("update:table-date",t(e))},genTable(e,t,n){const r=this.$createElement("transition",{props:{name:this.computedTransition}},[this.$createElement("table",{key:this.tableDate},t)]),i={name:"touch",value:{left:a=>a.offsetX<-15&&this.isValidScroll(1,n)&&this.touch(1,n),right:a=>a.offsetX>15&&this.isValidScroll(-1,n)&&this.touch(-1,n)}};return this.$createElement("div",{staticClass:e,class:{"v-date-picker-table--disabled":this.disabled,...this.themeClasses},on:!this.disabled&&this.scrollable?{wheel:a=>{a.preventDefault(),this.isValidScroll(a.deltaY,n)&&this.wheelThrottle(a,n)}}:void 0,directives:[i]},[r])},isSelected(e){if(Array.isArray(this.value))if(this.range&&this.value.length===2){const[t,n]=[...this.value].sort();return t<=e&&e<=n}else return this.value.indexOf(e)!==-1;return e===this.value}}}),_r=K(jn).extend({name:"v-date-picker-date-table",props:{firstDayOfWeek:{type:[String,Number],default:0},localeFirstDayOfYear:{type:[String,Number],default:0},showAdjacentMonths:Boolean,showWeek:Boolean,weekdayFormat:Function},computed:{formatter(){return this.format||te(this.currentLocale,{day:"numeric",timeZone:"UTC"},{start:8,length:2})},weekdayFormatter(){return this.weekdayFormat||te(this.currentLocale,{weekday:"narrow",timeZone:"UTC"})},weekDays(){const e=parseInt(this.firstDayOfWeek,10);return this.weekdayFormatter?bt(7).map(t=>this.weekdayFormatter(`2017-01-${e+t+15}`)):bt(7).map(t=>["S","M","T","W","T","F","S"][(t+e)%7])}},methods:{calculateTableDate(e){return Tn(this.tableDate,Math.sign(e||1))},genTHead(){const e=this.weekDays.map(t=>this.$createElement("th",t));return this.showWeek&&e.unshift(this.$createElement("th")),this.$createElement("thead",this.genTR(e))},weekDaysBeforeFirstDayOfTheMonth(){return(new Date(`${this.displayedYear}-${L(this.displayedMonth+1)}-01T00:00:00+00:00`).getUTCDay()-parseInt(this.firstDayOfWeek)+7)%7},getWeekNumber(e){return fr(this.displayedYear,this.displayedMonth,e,parseInt(this.firstDayOfWeek),parseInt(this.localeFirstDayOfYear))},genWeekNumber(e){return this.$createElement("td",[this.$createElement("small",{staticClass:"v-date-picker-table--date__week"},String(e).padStart(2,"0"))])},genTBody(){const e=[],t=new Date(this.displayedYear,this.displayedMonth+1,0).getDate();let n=[],r=this.weekDaysBeforeFirstDayOfTheMonth();this.showWeek&&n.push(this.genWeekNumber(this.getWeekNumber(1)));const i=this.displayedMonth?this.displayedYear:this.displayedYear-1,a=(this.displayedMonth+11)%12,o=new Date(this.displayedYear,this.displayedMonth,0).getDate(),u=this.showWeek?8:7;for(;r--;){const f=`${i}-${L(a+1)}-${L(o-r)}`;n.push(this.$createElement("td",this.showAdjacentMonths?[this.genButton(f,!0,"date",this.formatter,!0)]:[]))}for(r=1;r<=t;r++){const f=`${this.displayedYear}-${L(this.displayedMonth+1)}-${L(r)}`;n.push(this.$createElement("td",[this.genButton(f,!0,"date",this.formatter)])),n.length%u===0&&(e.push(this.genTR(n)),n=[],this.showWeek&&(r{const u=r*t.length+o,c=`${this.displayedYear}-${L(u+1)}`;return this.$createElement("td",{key:u},[this.genButton(c,!1,"month",this.formatter)])});e.push(this.$createElement("tr",{key:r},i))}return this.$createElement("tbody",e)}},render(){return this.genTable("v-date-picker-table v-date-picker-table--month",[this.genTBody()],this.calculateTableDate)}});const Fr=K(ie,Ve).extend({name:"v-date-picker-years",props:{format:Function,min:[Number,String],max:[Number,String],readonly:Boolean,value:[Number,String]},data(){return{defaultColor:"primary"}},computed:{formatter(){return this.format||te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},mounted(){setTimeout(()=>{const e=this.$el.getElementsByClassName("active")[0];e?this.$el.scrollTop=e.offsetTop-this.$el.offsetHeight/2+e.offsetHeight/2:this.min&&!this.max?this.$el.scrollTop=this.$el.scrollHeight:!this.min&&this.max?this.$el.scrollTop=0:this.$el.scrollTop=this.$el.scrollHeight/2-this.$el.offsetHeight/2})},methods:{genYearItem(e){const t=this.formatter(`${e}`),n=parseInt(this.value,10)===e,r=n&&(this.color||"primary");return this.$createElement("li",this.setTextColor(r,{key:e,class:{active:n},on:bn({click:()=>this.$emit("input",e)},An(this,":year",e))}),t)},genYearItems(){const e=[],t=this.value?parseInt(this.value,10):new Date().getFullYear(),n=this.max?parseInt(this.max,10):t+100,r=Math.min(n,this.min?parseInt(this.min,10):t-100);for(let i=n;i>=r;i--)e.push(this.genYearItem(i));return e}},render(){return this.$createElement("ul",{staticClass:"v-date-picker-years",ref:"years"},this.genYearItems())}});const kr=K(ie,vn,pe).extend({name:"v-picker",props:{flat:Boolean,fullWidth:Boolean,landscape:Boolean,noTitle:Boolean,transition:{type:String,default:"fade-transition"},width:{type:[Number,String],default:290}},computed:{computedTitleColor(){const e=this.isDark?!1:this.color||"primary";return this.color||e}},methods:{genTitle(){return this.$createElement("div",this.setBackgroundColor(this.computedTitleColor,{staticClass:"v-picker__title",class:{"v-picker__title--landscape":this.landscape}}),this.$slots.title)},genBodyTransition(){return this.$createElement("transition",{props:{name:this.transition}},this.$slots.default)},genBody(){return this.$createElement("div",{staticClass:"v-picker__body",class:{"v-picker__body--no-title":this.noTitle,...this.themeClasses},style:this.fullWidth?void 0:{width:Ti(this.width)}},[this.genBodyTransition()])},genActions(){return this.$createElement("div",{staticClass:"v-picker__actions v-card__actions",class:{"v-picker__actions--no-title":this.noTitle}},this.$slots.actions)}},render(e){return e("div",{staticClass:"v-picker v-card",class:{"v-picker--flat":this.flat,"v-picker--landscape":this.landscape,"v-picker--full-width":this.fullWidth,...this.themeClasses,...this.elevationClasses}},[this.$slots.title?this.genTitle():null,this.genBody(),this.$slots.actions?this.genActions():null])}}),Er=K(ie,vn,pe).extend({name:"picker",props:{flat:Boolean,fullWidth:Boolean,headerColor:String,landscape:Boolean,noTitle:Boolean,width:{type:[Number,String],default:290}},methods:{genPickerTitle(){return null},genPickerBody(){return null},genPickerActionsSlot(){return this.$scopedSlots.default?this.$scopedSlots.default({save:this.save,cancel:this.cancel}):this.$slots.default},genPicker(e){const t=[];if(!this.noTitle){const r=this.genPickerTitle();r&&t.push(r)}const n=this.genPickerBody();return n&&t.push(n),t.push(this.$createElement("template",{slot:"actions"},[this.genPickerActionsSlot()])),this.$createElement(kr,{staticClass:e,props:{color:this.headerColor||this.color,dark:this.dark,elevation:this.elevation,flat:this.flat,fullWidth:this.fullWidth,landscape:this.landscape,light:this.light,width:this.width,noTitle:this.noTitle}},t)}}}),$r=K(Ve,Er).extend({name:"v-date-picker",props:{activePicker:String,allowedDates:Function,dayFormat:Function,disabled:Boolean,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},firstDayOfWeek:{type:[String,Number],default:0},headerDateFormat:Function,localeFirstDayOfYear:{type:[String,Number],default:0},max:String,min:String,monthFormat:Function,multiple:Boolean,nextIcon:{type:String,default:"$next"},nextMonthAriaLabel:{type:String,default:"$vuetify.datePicker.nextMonthAriaLabel"},nextYearAriaLabel:{type:String,default:"$vuetify.datePicker.nextYearAriaLabel"},pickerDate:String,prevIcon:{type:String,default:"$prev"},prevMonthAriaLabel:{type:String,default:"$vuetify.datePicker.prevMonthAriaLabel"},prevYearAriaLabel:{type:String,default:"$vuetify.datePicker.prevYearAriaLabel"},range:Boolean,reactive:Boolean,readonly:Boolean,scrollable:Boolean,showCurrent:{type:[Boolean,String],default:!0},selectedItemsText:{type:String,default:"$vuetify.datePicker.itemsSelected"},showAdjacentMonths:Boolean,showWeek:Boolean,titleDateFormat:Function,type:{type:String,default:"date",validator:e=>["date","month"].includes(e)},value:[Array,String],weekdayFormat:Function,yearFormat:Function,yearIcon:String},data(){const e=new Date;return{internalActivePicker:this.type.toUpperCase(),inputDay:null,inputMonth:null,inputYear:null,isReversing:!1,now:e,tableDate:(()=>{if(this.pickerDate)return this.pickerDate;const t=Gt(this.value),n=t[t.length-1]||(typeof this.showCurrent=="string"?this.showCurrent:`${e.getFullYear()}-${e.getMonth()+1}`);return U(n,this.type==="date"?"month":"year")})()}},computed:{multipleValue(){return Gt(this.value)},isMultiple(){return this.multiple||this.range},lastValue(){return this.isMultiple?this.multipleValue[this.multipleValue.length-1]:this.value},selectedMonths(){return!this.value||this.type==="month"?this.value:this.isMultiple?this.multipleValue.map(e=>e.substr(0,7)):this.value.substr(0,7)},current(){return this.showCurrent===!0?U(`${this.now.getFullYear()}-${this.now.getMonth()+1}-${this.now.getDate()}`,this.type):this.showCurrent||null},inputDate(){return this.type==="date"?`${this.inputYear}-${L(this.inputMonth+1)}-${L(this.inputDay)}`:`${this.inputYear}-${L(this.inputMonth+1)}`},tableMonth(){return Number((this.pickerDate||this.tableDate).split("-")[1])-1},tableYear(){return Number((this.pickerDate||this.tableDate).split("-")[0])},minMonth(){return this.min?U(this.min,"month"):null},maxMonth(){return this.max?U(this.max,"month"):null},minYear(){return this.min?U(this.min,"year"):null},maxYear(){return this.max?U(this.max,"year"):null},formatters(){return{year:this.yearFormat||te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4}),titleDate:this.titleDateFormat||(this.isMultiple?this.defaultTitleMultipleDateFormatter:this.defaultTitleDateFormatter)}},defaultTitleMultipleDateFormatter(){return e=>e.length?e.length===1?this.defaultTitleDateFormatter(e[0]):this.$vuetify.lang.t(this.selectedItemsText,e.length):"-"},defaultTitleDateFormatter(){const e={year:{year:"numeric",timeZone:"UTC"},month:{month:"long",timeZone:"UTC"},date:{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}},t=te(this.currentLocale,e[this.type],{start:0,length:{date:10,month:7,year:4}[this.type]}),n=r=>t(r).replace(/([^\d\s])([\d])/g,(i,a,o)=>`${a} ${o}`).replace(", ",",
");return this.landscape?n:t}},watch:{internalActivePicker:{immediate:!0,handler(e){this.$emit("update:active-picker",e)}},activePicker(e){this.internalActivePicker=e},tableDate(e,t){const n=this.type==="month"?"year":"month";this.isReversing=U(e,n)U(n,e)).filter(this.isDateAllowed);this.$emit("input",this.isMultiple?t:t[0])}}},created(){this.checkMultipleProp(),this.pickerDate!==this.tableDate&&this.$emit("update:picker-date",this.tableDate),this.setInputDate()},methods:{emitInput(e){if(this.range){if(this.multipleValue.length!==1)this.$emit("input",[e]);else{const n=[this.multipleValue[0],e];this.$emit("input",n),this.$emit("change",n)}return}const t=this.multiple?this.multipleValue.indexOf(e)===-1?this.multipleValue.concat([e]):this.multipleValue.filter(n=>n!==e):e;this.$emit("input",t),this.multiple||this.$emit("change",e)},checkMultipleProp(){if(this.value==null)return;const e=this.value.constructor.name,t=this.isMultiple?"Array":"String";e!==t&&Cn(`Value must be ${this.isMultiple?"an":"a"} ${t}, got ${e}`,this)},isDateAllowed(e){return Mn(e,this.min,this.max,this.allowedDates)},yearClick(e){this.inputYear=e,this.type==="month"?this.tableDate=`${e}`:this.tableDate=`${e}-${L((this.tableMonth||0)+1)}`,this.internalActivePicker="MONTH",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)},monthClick(e){const[t,n]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(n,10)-1,this.type==="date"?(this.inputDay&&(this.inputDay=Math.min(this.inputDay,gr(this.inputYear,this.inputMonth+1))),this.tableDate=e,this.internalActivePicker="DATE",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)):this.emitInput(this.inputDate)},dateClick(e){const[t,n,r]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(n,10)-1,this.inputDay=parseInt(r,10),this.emitInput(this.inputDate)},genPickerTitle(){return this.$createElement(br,{props:{date:this.value?this.formatters.titleDate(this.isMultiple?this.multipleValue:this.value):"",disabled:this.disabled,readonly:this.readonly,selectingYear:this.internalActivePicker==="YEAR",year:this.formatters.year(this.multipleValue.length?`${this.inputYear}`:this.tableDate),yearIcon:this.yearIcon,value:this.multipleValue[0]},slot:"title",on:{"update:selecting-year":e=>this.internalActivePicker=e?"YEAR":this.type.toUpperCase()}})},genTableHeader(){return this.$createElement(Cr,{props:{nextIcon:this.nextIcon,color:this.color,dark:this.dark,disabled:this.disabled,format:this.headerDateFormat,light:this.light,locale:this.locale,min:this.internalActivePicker==="DATE"?this.minMonth:this.minYear,max:this.internalActivePicker==="DATE"?this.maxMonth:this.maxYear,nextAriaLabel:this.internalActivePicker==="DATE"?this.nextMonthAriaLabel:this.nextYearAriaLabel,prevAriaLabel:this.internalActivePicker==="DATE"?this.prevMonthAriaLabel:this.prevYearAriaLabel,prevIcon:this.prevIcon,readonly:this.readonly,value:this.internalActivePicker==="DATE"?`${L(this.tableYear,4)}-${L(this.tableMonth+1)}`:`${L(this.tableYear,4)}`},on:{toggle:()=>this.internalActivePicker=this.internalActivePicker==="DATE"?"MONTH":"YEAR",input:e=>this.tableDate=e}})},genDateTable(){return this.$createElement(_r,{props:{allowedDates:this.allowedDates,color:this.color,current:this.current,dark:this.dark,disabled:this.disabled,events:this.events,eventColor:this.eventColor,firstDayOfWeek:this.firstDayOfWeek,format:this.dayFormat,light:this.light,locale:this.locale,localeFirstDayOfYear:this.localeFirstDayOfYear,min:this.min,max:this.max,range:this.range,readonly:this.readonly,scrollable:this.scrollable,showAdjacentMonths:this.showAdjacentMonths,showWeek:this.showWeek,tableDate:`${L(this.tableYear,4)}-${L(this.tableMonth+1)}`,value:this.value,weekdayFormat:this.weekdayFormat},ref:"table",on:{input:this.dateClick,"update:table-date":e=>this.tableDate=e,...dt(this,":date")}})},genMonthTable(){return this.$createElement(wr,{props:{allowedDates:this.type==="month"?this.allowedDates:null,color:this.color,current:this.current?U(this.current,"month"):null,dark:this.dark,disabled:this.disabled,events:this.type==="month"?this.events:null,eventColor:this.type==="month"?this.eventColor:null,format:this.monthFormat,light:this.light,locale:this.locale,min:this.minMonth,max:this.maxMonth,range:this.range,readonly:this.readonly&&this.type==="month",scrollable:this.scrollable,value:this.selectedMonths,tableDate:`${L(this.tableYear,4)}`},ref:"table",on:{input:this.monthClick,"update:table-date":e=>this.tableDate=e,...dt(this,":month")}})},genYears(){return this.$createElement(Fr,{props:{color:this.color,format:this.yearFormat,locale:this.locale,min:this.minYear,max:this.maxYear,value:this.tableYear},on:{input:this.yearClick,...dt(this,":year")}})},genPickerBody(){const e=this.internalActivePicker==="YEAR"?[this.genYears()]:[this.genTableHeader(),this.internalActivePicker==="DATE"?this.genDateTable():this.genMonthTable()];return this.$createElement("div",{key:this.internalActivePicker},e)},setInputDate(){if(this.lastValue){const e=this.lastValue.split("-");this.inputYear=parseInt(e[0],10),this.inputMonth=parseInt(e[1],10)-1,this.type==="date"&&(this.inputDay=parseInt(e[2],10))}else this.inputYear=this.inputYear||this.now.getFullYear(),this.inputMonth=this.inputMonth==null?this.inputMonth:this.now.getMonth(),this.inputDay=this.inputDay||this.now.getDate()}},render(){return this.genPicker("v-picker--date")}});const Sr=K(ie,Mi("treeview")),Rn={activatable:Boolean,activeClass:{type:String,default:"v-treeview-node--active"},color:{type:String,default:"primary"},disablePerNode:Boolean,expandIcon:{type:String,default:"$subgroup"},indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},itemChildren:{type:String,default:"children"},itemDisabled:{type:String,default:"disabled"},itemKey:{type:String,default:"id"},itemText:{type:String,default:"name"},loadChildren:Function,loadingIcon:{type:String,default:"$loading"},offIcon:{type:String,default:"$checkboxOff"},onIcon:{type:String,default:"$checkboxOn"},openOnClick:Boolean,rounded:Boolean,selectable:Boolean,selectedColor:{type:String,default:"accent"},shaped:Boolean,transition:Boolean,selectionType:{type:String,default:"leaf",validator:e=>["leaf","independent"].includes(e)}},On=Sr.extend().extend({name:"v-treeview-node",inject:{treeview:{default:null}},props:{level:Number,item:{type:Object,default:()=>null},parentIsDisabled:Boolean,...Rn},data:()=>({hasLoaded:!1,isActive:!1,isIndeterminate:!1,isLoading:!1,isOpen:!1,isSelected:!1}),computed:{disabled(){return R(this.item,this.itemDisabled)||!this.disablePerNode&&this.parentIsDisabled&&this.selectionType==="leaf"},key(){return R(this.item,this.itemKey)},children(){const e=R(this.item,this.itemChildren);return e&&e.filter(t=>!this.treeview.isExcluded(R(t,this.itemKey)))},text(){return R(this.item,this.itemText)},scopedProps(){return{item:this.item,leaf:!this.children,selected:this.isSelected,indeterminate:this.isIndeterminate,active:this.isActive,open:this.isOpen}},computedIcon(){return this.isIndeterminate?this.indeterminateIcon:this.isSelected?this.onIcon:this.offIcon},hasChildren(){return!!this.children&&(!!this.children.length||!!this.loadChildren)}},created(){this.treeview.register(this)},beforeDestroy(){this.treeview.unregister(this)},methods:{checkChildren(){return new Promise(e=>{if(!this.children||this.children.length||!this.loadChildren||this.hasLoaded)return e();this.isLoading=!0,e(this.loadChildren(this.item))}).then(()=>{this.isLoading=!1,this.hasLoaded=!0})},open(){this.isOpen=!this.isOpen,this.treeview.updateOpen(this.key,this.isOpen),this.treeview.emitOpen()},genLabel(){const e=[];return this.$scopedSlots.label?e.push(this.$scopedSlots.label(this.scopedProps)):e.push(this.text),this.$createElement("div",{slot:"label",staticClass:"v-treeview-node__label"},e)},genPrependSlot(){return this.$scopedSlots.prepend?this.$createElement("div",{staticClass:"v-treeview-node__prepend"},this.$scopedSlots.prepend(this.scopedProps)):null},genAppendSlot(){return this.$scopedSlots.append?this.$createElement("div",{staticClass:"v-treeview-node__append"},this.$scopedSlots.append(this.scopedProps)):null},genContent(){const e=[this.genPrependSlot(),this.genLabel(),this.genAppendSlot()];return this.$createElement("div",{staticClass:"v-treeview-node__content"},e)},genToggle(){return this.$createElement(W,{staticClass:"v-treeview-node__toggle",class:{"v-treeview-node__toggle--open":this.isOpen,"v-treeview-node__toggle--loading":this.isLoading},slot:"prepend",on:{click:e=>{e.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>this.open())}}},[this.isLoading?this.loadingIcon:this.expandIcon])},genCheckbox(){return this.$createElement(W,{staticClass:"v-treeview-node__checkbox",props:{color:this.isSelected||this.isIndeterminate?this.selectedColor:void 0,disabled:this.disabled},on:{click:e=>{e.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>{this.$nextTick(()=>{this.isSelected=!this.isSelected,this.isIndeterminate=!1,this.treeview.updateSelected(this.key,this.isSelected),this.treeview.emitSelected()})})}}},[this.computedIcon])},genLevel(e){return bt(e).map(()=>this.$createElement("div",{staticClass:"v-treeview-node__level"}))},genNode(){const e=[this.genContent()];return this.selectable&&e.unshift(this.genCheckbox()),this.hasChildren?e.unshift(this.genToggle()):e.unshift(...this.genLevel(1)),e.unshift(...this.genLevel(this.level)),this.$createElement("div",this.setTextColor(this.isActive&&this.color,{staticClass:"v-treeview-node__root",class:{[this.activeClass]:this.isActive},on:{click:()=>{this.openOnClick&&this.hasChildren?this.checkChildren().then(this.open):this.activatable&&!this.disabled&&(this.isActive=!this.isActive,this.treeview.updateActive(this.key,this.isActive),this.treeview.emitActive())}}}),e)},genChild(e,t){return this.$createElement(On,{key:R(e,this.itemKey),props:{activatable:this.activatable,activeClass:this.activeClass,item:e,selectable:this.selectable,selectedColor:this.selectedColor,color:this.color,disablePerNode:this.disablePerNode,expandIcon:this.expandIcon,indeterminateIcon:this.indeterminateIcon,offIcon:this.offIcon,onIcon:this.onIcon,loadingIcon:this.loadingIcon,itemKey:this.itemKey,itemText:this.itemText,itemDisabled:this.itemDisabled,itemChildren:this.itemChildren,loadChildren:this.loadChildren,transition:this.transition,openOnClick:this.openOnClick,rounded:this.rounded,shaped:this.shaped,level:this.level+1,selectionType:this.selectionType,parentIsDisabled:t},scopedSlots:this.$scopedSlots})},genChildrenWrapper(){if(!this.isOpen||!this.children)return null;const e=[this.children.map(t=>this.genChild(t,this.disabled))];return this.$createElement("div",{staticClass:"v-treeview-node__children"},e)},genTransition(){return this.$createElement(ji,[this.genChildrenWrapper()])}},render(e){const t=[this.genNode()];return this.transition?t.push(this.genTransition()):t.push(this.genChildrenWrapper()),e("div",{staticClass:"v-treeview-node",class:{"v-treeview-node--leaf":!this.hasChildren,"v-treeview-node--click":this.openOnClick,"v-treeview-node--disabled":this.disabled,"v-treeview-node--rounded":this.rounded,"v-treeview-node--shaped":this.shaped,"v-treeview-node--selected":this.isSelected},attrs:{"aria-expanded":String(this.isOpen)}},t)}}),xr=On;function Br(e,t,n){return R(e,n).toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1}function Ln(e,t,n,r,i,a,o){if(e(t,n,i))return!0;const u=R(t,a);if(u){let c=!1;for(let d=0;d[]},dense:Boolean,disabled:Boolean,filter:Function,hoverable:Boolean,items:{type:Array,default:()=>[]},multipleActive:Boolean,open:{type:Array,default:()=>[]},openAll:Boolean,returnObject:{type:Boolean,default:!1},search:String,value:{type:Array,default:()=>[]},...Rn},data:()=>({level:-1,activeCache:new Set,nodes:{},openCache:new Set,selectedCache:new Set}),computed:{excludedItems(){const e=new Set;if(!this.search)return e;for(let t=0;tR(this.nodes[i].item,this.itemKey)),t=this.getKeys(this.items),n=Oi(t,e);if(!n.length&&t.lengthdelete this.nodes[i]);const r=[...this.selectedCache];this.selectedCache=new Set,this.activeCache=new Set,this.openCache=new Set,this.buildTree(this.items),Zt(r,[...this.selectedCache])||this.emitSelected()},deep:!0},active(e){this.handleNodeCacheWatcher(e,this.activeCache,this.updateActive,this.emitActive)},value(e){this.handleNodeCacheWatcher(e,this.selectedCache,this.updateSelected,this.emitSelected)},open(e){this.handleNodeCacheWatcher(e,this.openCache,this.updateOpen,this.emitOpen)}},created(){const e=t=>this.returnObject?R(t,this.itemKey):t;this.buildTree(this.items);for(const t of this.value.map(e))this.updateSelected(t,!0,!0);for(const t of this.active.map(e))this.updateActive(t,!0)},mounted(){(this.$slots.prepend||this.$slots.append)&&Cn("The prepend and append slots require a slot-scope attribute",this),this.openAll?this.updateAll(!0):(this.open.forEach(e=>this.updateOpen(this.returnObject?R(e,this.itemKey):e,!0)),this.emitOpen())},methods:{updateAll(e){Object.keys(this.nodes).forEach(t=>this.updateOpen(R(this.nodes[t].item,this.itemKey),e)),this.emitOpen()},getKeys(e,t=[]){for(let n=0;nR(d,this.itemKey)),item:i};if(this.buildTree(o,a),this.selectionType!=="independent"&&t!==null&&!this.nodes.hasOwnProperty(a)&&this.nodes.hasOwnProperty(t)?c.isSelected=this.nodes[t].isSelected:(c.isSelected=u.isSelected,c.isIndeterminate=u.isIndeterminate),c.isActive=u.isActive,c.isOpen=u.isOpen,this.nodes[a]=c,o.length&&this.selectionType!=="independent"){const{isSelected:d,isIndeterminate:p}=this.calculateState(a,this.nodes);c.isSelected=d,c.isIndeterminate=p}this.nodes[a].isSelected&&(this.selectionType==="independent"||c.children.length===0)&&this.selectedCache.add(a),this.nodes[a].isActive&&this.activeCache.add(a),this.nodes[a].isOpen&&this.openCache.add(a),this.updateVnodeState(a)}},calculateState(e,t){const n=t[e].children,r=n.reduce((o,u)=>(o[0]+=+!!t[u].isSelected,o[1]+=+!!t[u].isIndeterminate,o),[0,0]),i=!!n.length&&r[0]===n.length,a=!i&&(r[0]>0||r[1]>0);return{isSelected:i,isIndeterminate:a}},emitOpen(){this.emitNodeCache("update:open",this.openCache)},emitSelected(){this.emitNodeCache("input",this.selectedCache)},emitActive(){this.emitNodeCache("update:active",this.activeCache)},emitNodeCache(e,t){this.$emit(e,this.returnObject?[...t].map(n=>this.nodes[n].item):[...t])},handleNodeCacheWatcher(e,t,n,r){e=this.returnObject?e.map(a=>R(a,this.itemKey)):e;const i=[...t];Zt(i,e)||(i.forEach(a=>n(a,!1)),e.forEach(a=>n(a,!0)),r())},getDescendants(e,t=[]){const n=this.nodes[e].children;t.push(...n);for(let r=0;r{this.nodes[r].isActive=!1,this.updateVnodeState(r),this.activeCache.delete(r)});const n=this.nodes[e];n&&(t?this.activeCache.add(e):this.activeCache.delete(e),n.isActive=t,this.updateVnodeState(e))},updateSelected(e,t,n=!1){if(!this.nodes.hasOwnProperty(e))return;const r=new Map;if(this.selectionType!=="independent"){for(const a of this.getDescendants(e))(!R(this.nodes[a].item,this.itemDisabled)||n)&&(this.nodes[a].isSelected=t,this.nodes[a].isIndeterminate=!1,r.set(a,t));const i=this.calculateState(e,this.nodes);this.nodes[e].isSelected=t,this.nodes[e].isIndeterminate=i.isIndeterminate,r.set(e,t);for(const a of this.getParents(e)){const o=this.calculateState(a,this.nodes);this.nodes[a].isSelected=o.isSelected,this.nodes[a].isIndeterminate=o.isIndeterminate,r.set(a,o.isSelected)}}else this.nodes[e].isSelected=t,this.nodes[e].isIndeterminate=!1,r.set(e,t);for(const[i,a]of r.entries())this.updateVnodeState(i),!(this.selectionType==="leaf"&&this.isParent(i))&&(a===!0?this.selectedCache.add(i):this.selectedCache.delete(i))},updateOpen(e,t){if(!this.nodes.hasOwnProperty(e))return;const n=this.nodes[e],r=R(n.item,this.itemChildren);r&&!r.length&&n.vnode&&!n.vnode.hasLoaded?n.vnode.checkChildren().then(()=>this.updateOpen(e,t)):r&&r.length&&(n.isOpen=t,n.isOpen?this.openCache.add(e):this.openCache.delete(e),this.updateVnodeState(e))},updateVnodeState(e){const t=this.nodes[e];t&&t.vnode&&(t.vnode.isSelected=t.isSelected,t.vnode.isIndeterminate=t.isIndeterminate,t.vnode.isActive=t.isActive,t.vnode.isOpen=t.isOpen)},isExcluded(e){return!!this.search&&this.excludedItems.has(e)}},render(e){const t=this.items.length?this.items.filter(n=>!this.isExcluded(R(n,this.itemKey))).map(n=>xr.options.methods.genChild.bind(this)(n,this.disabled||R(n,this.itemDisabled))):this.$slots.default;return e("div",{staticClass:"v-treeview",class:{"v-treeview--hoverable":this.hoverable,"v-treeview--dense":this.dense,...this.themeClasses}},t)}});const Ar={components:{},props:{editable:{type:Boolean,default:!0},label:{type:String,required:!0},value:{type:[String,Number],default:""},infoText:{type:String,default:""},dataType:{type:String,default:"string"},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},rules:{type:Array,default:()=>[]}},data(){return{internalValue:this.value,editing:!1,menu:!1,original:"",moment:Ct}},computed:{dirty(){return this.original!==this.internalValue},...Li(Ii,["darkMode"])},watch:{internalValue(e){this.$emit("input",e)}},mounted(){this.original=this.value},methods:{clicked(){this.editable&&(this.editing=!0,this.$nextTick(()=>{this.dataType==="date"||this.dataType==="date-range"?this.menu=!0:this.$refs.field.focus()}))},async update(){this.$refs.field.validate&&this.$refs.field.validate()===!1||(this.label==="Delay"?this.internalValue=Math.floor(this.internalValue):this.label==="Jitter"&&(this.internalValue=Math.floor(this.internalValue*10)/10),await this.$nextTick(),this.editing=!1,this.$emit("update"))},revert(){this.editing=!1,this.internalValue=this.original},async clear(){this.internalValue="",await this.$nextTick(),this.editing=!1,this.$emit("update")},getColClass(){return this.editing===!1&&this.editable===!0?this.darkMode?"column-not-editing-dark":"column-not-editing":""}}};var Tr=function(){var t=this,n=t._self._c;return n(me,{staticClass:"pb-5"},[n(ne,{staticClass:"d-flex align-center justify-start",attrs:{cols:"4"}},[n("span",{staticClass:"text--bold"},[t._v(t._s(t.label))]),t.infoText?n(Te,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:r,attrs:i}){return[n(W,t._g(t._b({staticClass:"ml-2",attrs:{small:""}},"v-icon",i,!1),r),[t._v(" mdi-information-outline ")])]}}],null,!1,3230721012)},[n("span",[t._v(t._s(t.infoText))])]):t._e()],1),n(ne,{class:t.getColClass(),attrs:{cols:"6"},on:{click:t.clicked}},[t.editing&&t.editable?[t.suggestedValues.length>0&&t.strict?n(sr,{ref:"field",attrs:{items:t.suggestedValues,label:t.label,outlined:"",dense:""},on:{blur:t.update,keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}}):t.dataType==="date"||t.dataType==="date-range"?n(_n,{ref:"menu",attrs:{"close-on-content-click":!1,transition:"scale-transition","offset-y":"","min-width":"auto"},scopedSlots:t._u([{key:"activator",fn:function({on:r,attrs:i}){return[n(he,t._g(t._b({ref:"field",attrs:{label:"Picker in menu","prepend-icon":"mdi-calendar",readonly:"",clearable:""},on:{"click:clear":t.clear},model:{value:t.internalValue,callback:function(a){t.internalValue=a},expression:"internalValue"}},"v-text-field",i,!1),r))]}}],null,!1,2992141911),model:{value:t.menu,callback:function(r){t.menu=r},expression:"menu"}},[n($r,{attrs:{outlined:"",dense:"",range:t.dataType==="date-range",min:t.moment().format("YYYY-MM-DD")},on:{blur:t.update,keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}},[n(le),n(J,{attrs:{text:"",color:"primary"},on:{click:function(r){t.menu=!1,t.editing=!1,t.revert()}}},[t._v(" Cancel ")]),n(J,{attrs:{text:"",color:"primary"},on:{click:function(r){t.menu=!1,t.update()}}},[t._v(" OK ")])],1)],1):t.dataType==="string"||t.dataType==="number"?n(he,{ref:"field",staticStyle:{"margin-bottom":"-45px"},attrs:{rules:t.rules,label:t.label,type:t.dataType==="string"?"text":"number",step:t.label==="Jitter"?"0.1":"1",max:t.label==="Jitter"?"1":"",min:"0",outlined:"",dense:"",required:""},on:{blur:t.update},nativeOn:{keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}}):t._e()]:n("span",{staticClass:"ml-3"},[t._v(" "+t._s(t.internalValue)+" ")])],2)],1)},Mr=[],jr=Z(Ar,Tr,Mr,!1,null,null,null,null);const z=jr.exports;const Rr={components:{TagViewer:xn,ClickToEdit:z},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{valid:!0,nameLoading:!1,loading:!1,labelPosition:"left",rules:{},form:{},moment:Ct,workingHoursRules:[e=>/^[0-9]{1,2}:[0-5][0-9]-[0-9]{1,2}:[0-5][0-9]$/.test(e)||"Must be in the format 00:00-24:00"],nameRules:[e=>!!e||"Name is required",e=>!!e&&e.length>2||"Name must be at least 3 characters"],jitterRules:[e=>!Number.isNaN(e)||"Jitter must be a number",e=>e>=0&&e<=1||"Jitter must be between 0 and 1"],delayRules:[e=>!Number.isNaN(e)||"Delay must be a number",e=>e>=0||"Delay must be a positive number"]}},computed:{agentStore(){return wn()},listenerStore(){return zi()},listeners(){return this.listenerStore.listeners},fields(){return Object.keys(this.agent).map(e=>({name:e,Value:typeof this.agent[e]=="boolean"?`${this.agent[e]}`:this.agent[e]}))},requiredFields(){return this.fields.filter(e=>["name"].indexOf(e.name)<0)}},watch:{fields:{immediate:!0,handler(e){const t=e.reduce((n,r)=>{if(r.name==="kill_date"&&r.Value&&r.Value.length>0){const i=r.Value.split("/"),a=i[2],o=i[0],u=i[1];n[r.name]=`${a}-${o}-${u}`}else n[r.name]=r.Value;return n},{});Pe.set(this,"form",t)}}},mounted(){this.listenerStore.getListeners()},methods:{deleteTag(e){Ni(this.agent.session_id,e.id).then(()=>{this.$emit("refresh-agent")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(e){Vi(this.agent.session_id,e).then(()=>{this.$emit("refresh-agent"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(e){qi(this.agent.session_id,e).then(()=>{this.$emit("refresh-agent")}).catch(t=>this.$snack.error(`Error: ${t}`))},async updateName(){if(this.agent.name!==this.form.name){try{await this.agentStore.rename({sessionId:this.agent.session_id,newName:this.form.name})}catch(e){this.$snack.error(`Update agent listener failed: ${e}`);return}this.$snack.info(`Agent ${this.agent.name} name updated`),this.$emit("refresh-agent")}},async updateListener(){if(this.agent.listener!==this.form.listener){try{const e=this.listeners.filter(t=>t.name===this.form.listener)[0].id;await Hi(this.agent.session_id,e)}catch(e){this.$snack.error(`Update agent listener failed: ${e}`);return}this.$snack.info(`Tasked agent to change listener to: ${this.form.listener}`),this.$emit("refresh-agent")}},async updateKillDate(){let e="";if(this.form.kill_date&&this.form.kill_date.length>0&&(e=Ct(this.form.kill_date).format("MM/DD/YYYY")),this.agent.kill_date!==e){try{await Wi(this.agent.session_id,e)}catch(t){this.$snack.error(`Update agent kill date failed: ${t}`);return}this.$snack.info(`Tasked agent to change kill date to: ${e}`),this.$emit("refresh-agent")}},async updateWorkingHours(){if(this.agent.working_hours!==this.form.working_hours){try{await Ui(this.agent.session_id,this.form.working_hours)}catch(e){this.$snack.error(`Update agent working hours failed: ${e}`);return}this.$snack.info(`Tasked agent to change working hours to: ${this.form.working_hours}`),this.$emit("refresh-agent")}},async updateDelay(){if(this.agent.delay!==this.form.delay){try{await vt(this.agent.session_id,this.form.delay,this.form.jitter)}catch(e){this.$snack.error(`Update agent delay failed: ${e}`);return}this.$snack.info(`Tasked agent to change delay to: ${this.form.delay}`),this.$emit("refresh-agent")}},async updateJitter(){if(this.agent.jitter!==this.form.jitter){try{await vt(this.agent.session_id,this.form.delay,this.form.jitter)}catch(e){this.$snack.error(`Update agent delay failed: ${e}`);return}this.$snack.info(`Tasked agent to change jitter to: ${this.form.jitter}`),this.$emit("refresh-agent")}},fieldExists(e){return this.fields.filter(t=>t.name===e).length>0}}};var Or=function(){var t=this,n=t._self._c;return n("div",{staticStyle:{padding:"10px"}},[n(xn,{attrs:{tags:t.agent.tags},on:{"update-tag":t.updateTag,"delete-tag":t.deleteTag,"new-tag":t.addTag}}),t.agent.session_id?n(Oe,{ref:"form",model:{value:t.valid,callback:function(r){t.valid=r},expression:"valid"}},[n(z,{attrs:{label:"Session ID",editable:!1,value:t.form.session_id}}),n(z,{attrs:{label:"Name",rules:t.nameRules,editable:!t.readOnly},on:{update:t.updateName},model:{value:t.form.name,callback:function(r){t.$set(t.form,"name",r)},expression:"form.name"}}),n(z,{attrs:{label:"External IP",value:t.form.external_ip,editable:!1}}),n(z,{attrs:{label:"Internal IP",value:t.form.internal_ip,editable:!1}}),n(z,{attrs:{label:"Host Name",value:t.form.hostname,editable:!1}}),n(z,{attrs:{label:"Username",value:t.form.username,editable:!1}}),n(z,{attrs:{label:"Listener","info-text":"The listener to task the agent to use","data-type":"string","suggested-values":t.listeners.map(r=>r.name),strict:!0,editable:!t.readOnly},on:{update:t.updateListener},model:{value:t.form.listener,callback:function(r){t.$set(t.form,"listener",r)},expression:"form.listener"}}),n(z,{attrs:{label:"Kill Date","data-type":"date","info-text":"Date format: YYYY-MM-DD",editable:!t.readOnly},on:{update:t.updateKillDate},model:{value:t.form.kill_date,callback:function(r){t.$set(t.form,"kill_date",r)},expression:"form.kill_date"}}),n(z,{attrs:{label:"Working Hours","info-text":"Format: 00:00-24:00",rules:t.workingHoursRules,editable:!t.readOnly},on:{update:t.updateWorkingHours},model:{value:t.form.working_hours,callback:function(r){t.$set(t.form,"working_hours",r)},expression:"form.working_hours"}}),n(z,{attrs:{label:"Check In Time",value:t.moment(t.form.checkin_time).fromNow(),editable:!1}}),n(z,{attrs:{label:"Last Seen Time",value:t.moment(t.form.lastseen_time).fromNow(),editable:!1}}),n(z,{attrs:{label:"Delay","info-text":"Delay in seconds before the agent checks in","data-type":"number",rules:t.delayRules,editable:!t.readOnly},on:{update:t.updateDelay},model:{value:t.form.delay,callback:function(r){t.$set(t.form,"delay",r)},expression:"form.delay"}}),n(z,{attrs:{label:"Jitter","info-text":"Randomness in delay as a decimal between 0 and 1","data-type":"number",rules:t.jitterRules,editable:!t.readOnly},on:{update:t.updateJitter},model:{value:t.form.jitter,callback:function(r){t.$set(t.form,"jitter",r)},expression:"form.jitter"}}),n(z,{attrs:{label:"Lost Limit","data-type":"number",editable:!1},model:{value:t.form.lost_limit,callback:function(r){t.$set(t.form,"lost_limit",r)},expression:"form.lost_limit"}}),n(z,{attrs:{label:"OS Details",value:t.form.os_details,editable:!1}}),n(z,{attrs:{label:"Architecture",value:t.form.architecture,editable:!1}}),n(z,{attrs:{label:"Process ID",value:t.form.process_id,editable:!1}}),n(z,{attrs:{label:"Process Name",value:t.form.process_name,editable:!1}}),n(z,{attrs:{label:"Language",value:t.form.language,editable:!1}}),n(z,{attrs:{label:"Language Version",value:t.form.language_version,editable:!1}}),n(z,{attrs:{label:"Profile",value:t.form.profile,editable:!1}})],1):t._e()],1)},Lr=[],Ir=Z(Rr,Or,Lr,!1,null,"3e179fb2",null,null);const In=Ir.exports,zr={components:{AgentExecuteModule:Ne},props:{value:Boolean,loading:{type:Boolean,default:!1},agent:{type:String,required:!0},moduleName:{type:String,required:!0},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{async submit(){this.$refs.executeform.validate()&&(this.$refs.executeform.create(),this.show=!1)}}};var Nr=function(){var t=this,n=t._self._c;return n(Le,{ref:"downloadDialog",attrs:{"max-width":"800px"},model:{value:t.show,callback:function(r){t.show=r},expression:"show"}},[n(ee,[n(Ie,[n("span",{staticClass:"headline"})]),n(fe,[t.show?n(Ne,{ref:"executeform",attrs:{agents:[t.agent],"module-name":t.moduleName,"module-option-defaults":t.moduleOptionDefaults,"show-submit":!1},on:{submitted:t.submit}}):t._e()],1),n(ze,[n(le),n(J,{attrs:{color:"error",text:""},on:{click:function(r){r.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),n(J,{attrs:{color:"primary",loading:t.loading},on:{click:t.submit}},[t._v(" Submit ")])],1)],1)],1)},Vr=[],qr=Z(zr,Nr,Vr,!1,null,null,null,null);const zn=qr.exports;async function wt(e=1e3){return new Promise(t=>setTimeout(t,e))}const Hr={components:{ExecuteModuleDialog:zn},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{files:{html:"mdi-language-html5",js:"mdi-nodejs",json:"mdi-json",md:"mdi-markdown",pdf:"mdi-file-pdf",png:"mdi-file-image",txt:"mdi-file-document-outline",xls:"mdi-file-excel",xlsx:"mdi-file-excel",ppt:"mdi-file-powerpoint",pptx:"mdi-file-powerpoint",jpg:"mdi-file-image",jpeg:"mdi-file-image",gif:"mdi-file-image",doc:"mdi-file-word",docx:"mdi-file-word"},tree:[],open:[],showMenu:!1,menuPosition:{x:0,y:0},selected:{},force:{},currentlyLoading:{},loading:!1,debouncedLoadChildren:null,executeDialog:!1,moduleName:"",moduleOptionDefaults:{}}},computed:{menuItems(){return[{id:"close",name:"Close",fileOption:!1,folderOption:!0},{id:"open",name:"Open",fileOption:!1,folderOption:!0},{id:"refresh",name:"Refresh",fileOption:!1,folderOption:!0},{id:"download",name:"Download to Empire",fileOption:!0,folderOption:!1},{id:"zip",name:"Zip Folder",fileOption:!1,folderOption:!0},{id:"upload",name:"Upload",folderOption:!0,fileOption:!1}].filter(e=>this.selected.file?e.fileOption===!0:e.folderOption===!0).filter(e=>!(e.id==="zip"&&this.agent.language!=="powershell")).filter(e=>{if(e.id==="open"){if(this.open.find(t=>t===this.selected.id))return!1}else if((e.id==="close"||e.id==="refresh")&&!this.open.find(t=>t===this.selected.id))return!1;return!0})}},watch:{agent:{handler(){this.initialize()}}},async mounted(){this.agent&&this.initialize()},methods:{async initialize(){this.debouncedLoadChildren=lr(this.loadChildren,500,{leading:!0}),this.loading=!0;try{const e=await ut(this.agent.session_id,"/");e.sort(this.sortFiles),this.tree=e.map(t=>this.transform(t))}catch{if(this.readOnly){this.loading=!1;return}const t=await this.scrapeDirectory("/");let n=0,r=0;for(;n<10;){if(await wt(6e3),await this.checkTaskComplete(t.id)){r=!0;break}n++}r||this.$snack.error("Agent didn't respond in time. Please try again later.");const i=await ut(this.agent.session_id,"/");i.sort(this.sortFiles),this.tree=i.map(a=>this.transform(a))}this.loading=!1},async clickAction(e){if(e==="open")this.open.push(this.selected.id);else if(e==="close")this.open.splice(this.open.findIndex(t=>t===this.selected.id),1);else if(e==="refresh"){this.selected.children=[];const t=this.$refs.treeview.nodes[this.selected.id];this.open.splice(this.open.findIndex(n=>n===this.selected.id),1),await Pe.nextTick(),t.vnode.hasLoaded=!1,this.force[this.selected.id]=!0,await Pe.nextTick(),this.open.push(this.selected.id)}else e==="download"?(Fn(this.agent.session_id,this.selected.path),this.$snack.success(`Tasked ${this.agent.session_id} for download ${this.selected.path}`)):e==="zip"?this.prepareZip():e==="upload"&&this.$emit("openUploadDialog",{pathToFile:this.selected.path})},prepareZip(){const e={agent:this.agent.session_id,Folder:this.selected.path,ZipFileName:`${this.selected.path}\\${this.selected.path.split("\\").pop()}.zip`};this.moduleName="powershell/management/zipfolder",this.moduleOptionDefaults=e,this.executeDialog=!0},show(e,t){t.preventDefault(),this.showMenu=!1,this.menuPosition.x=t.clientX,this.menuPosition.y=t.clientY,this.selected=e,this.$nextTick(()=>{this.showMenu=!0})},transform(e){return{file:e.is_file===!0?e.name.split(".").pop():!1,...e,children:e.is_file===!1?[]:void 0}},async loadChildren(e,{stopTrying:t}={}){if(this.currentlyLoading[e.id])return Promise.resolve();this.currentlyLoading[e.id]=!0;const n=await ut(this.agent.session_id,e.id);if(n.sort(this.sortFiles),!this.force[e.id]&&n.length>0)return this.removeFromCurrentlyLoading(e.id),e.children=n.map(r=>this.transform(r)),Promise.resolve();if(!t&&!this.readOnly){console.log(t,this.readOnly),this.$snack.success(`Attempting to retrieve directory: ${e.path} with id ${e.id}`);const r=await this.scrapeDirectory(e.path);let i=0,a=!1;for(;i<10;){if(await wt(6e3),await this.checkTaskComplete(r.id)){console.log("task complete",r.id),a=!0;break}i++}return a||this.$snack.error("Agent didn't respond in time. Please try again later."),this.removeFromForce(e.id),this.removeFromCurrentlyLoading(e.id),Promise.resolve(this.loadChildren(e,{stopTrying:!0}))}return this.removeFromForce(e.id),this.removeFromCurrentlyLoading(e.id),Promise.resolve()},removeFromForce(e){this.force[e]&&delete this.force[e]},removeFromCurrentlyLoading(e){this.currentlyLoading[e]&&delete this.currentlyLoading[e]},async scrapeDirectory(e){return Yi(this.agent.session_id,e)},async checkTaskComplete(e){try{return!!(await kn(this.agent.session_id,e)).output}catch{return!1}},sortFiles(e,t){const n=e.name.toLowerCase(),r=t.name.toLowerCase();return nr?1:0}}};var Wr=function(){var t=this,n=t._self._c;return t.agent.language==="ironpython"?n("div",[n(En,{attrs:{prominent:"",type:"error"}},[n(me,{attrs:{align:"center"}},[n(ne,{staticClass:"grow"},[t._v(" The File Browser is not yet implemented for this agent language. ")])],1)],1)],1):n("div",[n(zn,{attrs:{agent:t.agent.session_id,"module-name":t.moduleName,"module-option-defaults":t.moduleOptionDefaults},model:{value:t.executeDialog,callback:function(r){t.executeDialog=r},expression:"executeDialog"}}),t.loading?n(W,{staticClass:"fa-3x fas fa-spinner fa-spin",staticStyle:{width:"50px"}}):t._e(),n(Pr,{ref:"treeview",attrs:{dense:"",hoverable:"","open-on-click":"","item-key":"id","load-children":t.debouncedLoadChildren,open:t.open,items:t.tree},on:{"update:open":function(r){t.open=r}},scopedSlots:t._u([{key:"label",fn:function({item:r,open:i}){return[n(J,{staticClass:"text-left",staticStyle:{"margin-left":"-15px",width:"100%"},attrs:{text:""},on:{contextmenu:function(a){return t.show(r,a)}}},[n("div",{staticStyle:{display:"flex","justify-content":"fle -start"}},[r.file?n(W,[t._v(" "+t._s(t.files[r.file]||"mdi-file")+" ")]):n(W,[t._v(" "+t._s(i?"mdi-folder-open":"mdi-folder")+" ")]),n("span",{staticClass:"ml-2"},[t._v(t._s(r.name))])],1)])]}}])}),n(_n,{attrs:{"position-x":t.menuPosition.x,"position-y":t.menuPosition.y,"close-on-content-click":"",absolute:"","offset-y":""},model:{value:t.showMenu,callback:function(r){t.showMenu=r},expression:"showMenu"}},[n(Ji,t._l(t.menuItems,function(r){return n(Ki,{key:r.id,on:{click:function(i){return t.clickAction(r.id)}}},[n(Gi,[t._v(t._s(r.name))])],1)}),1)],1)],1)},Ur=[],Yr=Z(Hr,Wr,Ur,!1,null,null,null,null);const Nn=Yr.exports;var Ft={},qe={},De={},ge={},xt={exports:{}},Jr=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")};const Kr=Jr;var Bt=e=>typeof e=="string"?e.replace(Kr(),""):e,Pt={exports:{}};const Vn=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);Pt.exports=Vn;Pt.exports.default=Vn;var qn=Pt.exports,Gr=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const Zr=Bt,Xr=qn,Qr=Gr,Hn=e=>{if(typeof e!="string"||e.length===0||(e=Zr(e),e.length===0))return 0;e=e.replace(Qr()," ");let t=0;for(let n=0;n=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,t+=Xr(r)?2:1)}return t};xt.exports=Hn;xt.exports.default=Hn;var ye=xt.exports,q={};const tn="[\uD800-\uDBFF][\uDC00-\uDFFF]",es=e=>e&&e.exact?new RegExp(`^${tn}$`):new RegExp(tn,"g");var ts=es,At={exports:{}},ht,nn;function ns(){return nn||(nn=1,ht={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),ht}var pt,rn;function Wn(){if(rn)return pt;rn=1;const e=ns(),t={};for(const i of Object.keys(e))t[e[i]]=i;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};pt=n;for(const i of Object.keys(n)){if(!("channels"in n[i]))throw new Error("missing channels property: "+i);if(!("labels"in n[i]))throw new Error("missing channel labels property: "+i);if(n[i].labels.length!==n[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:a,labels:o}=n[i];delete n[i].channels,delete n[i].labels,Object.defineProperty(n[i],"channels",{value:a}),Object.defineProperty(n[i],"labels",{value:o})}n.rgb.hsl=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.min(a,o,u),d=Math.max(a,o,u),p=d-c;let f,g;d===c?f=0:a===d?f=(o-u)/p:o===d?f=2+(u-a)/p:u===d&&(f=4+(a-o)/p),f=Math.min(f*60,360),f<0&&(f+=360);const b=(c+d)/2;return d===c?g=0:b<=.5?g=p/(d+c):g=p/(2-d-c),[f,g*100,b*100]},n.rgb.hsv=function(i){let a,o,u,c,d;const p=i[0]/255,f=i[1]/255,g=i[2]/255,b=Math.max(p,f,g),w=b-Math.min(p,f,g),S=function(B){return(b-B)/6/w+1/2};return w===0?(c=0,d=0):(d=w/b,a=S(p),o=S(f),u=S(g),p===b?c=u-o:f===b?c=1/3+a-u:g===b&&(c=2/3+o-a),c<0?c+=1:c>1&&(c-=1)),[c*360,d*100,b*100]},n.rgb.hwb=function(i){const a=i[0],o=i[1];let u=i[2];const c=n.rgb.hsl(i)[0],d=1/255*Math.min(a,Math.min(o,u));return u=1-1/255*Math.max(a,Math.max(o,u)),[c,d*100,u*100]},n.rgb.cmyk=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.min(1-a,1-o,1-u),d=(1-a-c)/(1-c)||0,p=(1-o-c)/(1-c)||0,f=(1-u-c)/(1-c)||0;return[d*100,p*100,f*100,c*100]};function r(i,a){return(i[0]-a[0])**2+(i[1]-a[1])**2+(i[2]-a[2])**2}return n.rgb.keyword=function(i){const a=t[i];if(a)return a;let o=1/0,u;for(const c of Object.keys(e)){const d=e[c],p=r(i,d);p.04045?((a+.055)/1.055)**2.4:a/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,u=u>.04045?((u+.055)/1.055)**2.4:u/12.92;const c=a*.4124+o*.3576+u*.1805,d=a*.2126+o*.7152+u*.0722,p=a*.0193+o*.1192+u*.9505;return[c*100,d*100,p*100]},n.rgb.lab=function(i){const a=n.rgb.xyz(i);let o=a[0],u=a[1],c=a[2];o/=95.047,u/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const d=116*u-16,p=500*(o-u),f=200*(u-c);return[d,p,f]},n.hsl.rgb=function(i){const a=i[0]/360,o=i[1]/100,u=i[2]/100;let c,d,p;if(o===0)return p=u*255,[p,p,p];u<.5?c=u*(1+o):c=u+o-u*o;const f=2*u-c,g=[0,0,0];for(let b=0;b<3;b++)d=a+1/3*-(b-1),d<0&&d++,d>1&&d--,6*d<1?p=f+(c-f)*6*d:2*d<1?p=c:3*d<2?p=f+(c-f)*(2/3-d)*6:p=f,g[b]=p*255;return g},n.hsl.hsv=function(i){const a=i[0];let o=i[1]/100,u=i[2]/100,c=o;const d=Math.max(u,.01);u*=2,o*=u<=1?u:2-u,c*=d<=1?d:2-d;const p=(u+o)/2,f=u===0?2*c/(d+c):2*o/(u+o);return[a,f*100,p*100]},n.hsv.rgb=function(i){const a=i[0]/60,o=i[1]/100;let u=i[2]/100;const c=Math.floor(a)%6,d=a-Math.floor(a),p=255*u*(1-o),f=255*u*(1-o*d),g=255*u*(1-o*(1-d));switch(u*=255,c){case 0:return[u,g,p];case 1:return[f,u,p];case 2:return[p,u,g];case 3:return[p,f,u];case 4:return[g,p,u];case 5:return[u,p,f]}},n.hsv.hsl=function(i){const a=i[0],o=i[1]/100,u=i[2]/100,c=Math.max(u,.01);let d,p;p=(2-o)*u;const f=(2-o)*c;return d=o*c,d/=f<=1?f:2-f,d=d||0,p/=2,[a,d*100,p*100]},n.hwb.rgb=function(i){const a=i[0]/360;let o=i[1]/100,u=i[2]/100;const c=o+u;let d;c>1&&(o/=c,u/=c);const p=Math.floor(6*a),f=1-u;d=6*a-p,p&1&&(d=1-d);const g=o+d*(f-o);let b,w,S;switch(p){default:case 6:case 0:b=f,w=g,S=o;break;case 1:b=g,w=f,S=o;break;case 2:b=o,w=f,S=g;break;case 3:b=o,w=g,S=f;break;case 4:b=g,w=o,S=f;break;case 5:b=f,w=o,S=g;break}return[b*255,w*255,S*255]},n.cmyk.rgb=function(i){const a=i[0]/100,o=i[1]/100,u=i[2]/100,c=i[3]/100,d=1-Math.min(1,a*(1-c)+c),p=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,u*(1-c)+c);return[d*255,p*255,f*255]},n.xyz.rgb=function(i){const a=i[0]/100,o=i[1]/100,u=i[2]/100;let c,d,p;return c=a*3.2406+o*-1.5372+u*-.4986,d=a*-.9689+o*1.8758+u*.0415,p=a*.0557+o*-.204+u*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,c=Math.min(Math.max(0,c),1),d=Math.min(Math.max(0,d),1),p=Math.min(Math.max(0,p),1),[c*255,d*255,p*255]},n.xyz.lab=function(i){let a=i[0],o=i[1],u=i[2];a/=95.047,o/=100,u/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;const c=116*o-16,d=500*(a-o),p=200*(o-u);return[c,d,p]},n.lab.xyz=function(i){const a=i[0],o=i[1],u=i[2];let c,d,p;d=(a+16)/116,c=o/500+d,p=d-u/200;const f=d**3,g=c**3,b=p**3;return d=f>.008856?f:(d-16/116)/7.787,c=g>.008856?g:(c-16/116)/7.787,p=b>.008856?b:(p-16/116)/7.787,c*=95.047,d*=100,p*=108.883,[c,d,p]},n.lab.lch=function(i){const a=i[0],o=i[1],u=i[2];let c;c=Math.atan2(u,o)*360/2/Math.PI,c<0&&(c+=360);const p=Math.sqrt(o*o+u*u);return[a,p,c]},n.lch.lab=function(i){const a=i[0],o=i[1],c=i[2]/360*2*Math.PI,d=o*Math.cos(c),p=o*Math.sin(c);return[a,d,p]},n.rgb.ansi16=function(i,a=null){const[o,u,c]=i;let d=a===null?n.rgb.hsv(i)[2]:a;if(d=Math.round(d/50),d===0)return 30;let p=30+(Math.round(c/255)<<2|Math.round(u/255)<<1|Math.round(o/255));return d===2&&(p+=60),p},n.hsv.ansi16=function(i){return n.rgb.ansi16(n.hsv.rgb(i),i[2])},n.rgb.ansi256=function(i){const a=i[0],o=i[1],u=i[2];return a===o&&o===u?a<8?16:a>248?231:Math.round((a-8)/247*24)+232:16+36*Math.round(a/255*5)+6*Math.round(o/255*5)+Math.round(u/255*5)},n.ansi16.rgb=function(i){let a=i%10;if(a===0||a===7)return i>50&&(a+=3.5),a=a/10.5*255,[a,a,a];const o=(~~(i>50)+1)*.5,u=(a&1)*o*255,c=(a>>1&1)*o*255,d=(a>>2&1)*o*255;return[u,c,d]},n.ansi256.rgb=function(i){if(i>=232){const d=(i-232)*10+8;return[d,d,d]}i-=16;let a;const o=Math.floor(i/36)/5*255,u=Math.floor((a=i%36)/6)/5*255,c=a%6/5*255;return[o,u,c]},n.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},n.hex.rgb=function(i){const a=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let o=a[0];a[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const u=parseInt(o,16),c=u>>16&255,d=u>>8&255,p=u&255;return[c,d,p]},n.rgb.hcg=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.max(Math.max(a,o),u),d=Math.min(Math.min(a,o),u),p=c-d;let f,g;return p<1?f=d/(1-p):f=0,p<=0?g=0:c===a?g=(o-u)/p%6:c===o?g=2+(u-a)/p:g=4+(a-o)/p,g/=6,g%=1,[g*360,p*100,f*100]},n.hsl.hcg=function(i){const a=i[1]/100,o=i[2]/100,u=o<.5?2*a*o:2*a*(1-o);let c=0;return u<1&&(c=(o-.5*u)/(1-u)),[i[0],u*100,c*100]},n.hsv.hcg=function(i){const a=i[1]/100,o=i[2]/100,u=a*o;let c=0;return u<1&&(c=(o-u)/(1-u)),[i[0],u*100,c*100]},n.hcg.rgb=function(i){const a=i[0]/360,o=i[1]/100,u=i[2]/100;if(o===0)return[u*255,u*255,u*255];const c=[0,0,0],d=a%1*6,p=d%1,f=1-p;let g=0;switch(Math.floor(d)){case 0:c[0]=1,c[1]=p,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=p;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=p,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return g=(1-o)*u,[(o*c[0]+g)*255,(o*c[1]+g)*255,(o*c[2]+g)*255]},n.hcg.hsv=function(i){const a=i[1]/100,o=i[2]/100,u=a+o*(1-a);let c=0;return u>0&&(c=a/u),[i[0],c*100,u*100]},n.hcg.hsl=function(i){const a=i[1]/100,u=i[2]/100*(1-a)+.5*a;let c=0;return u>0&&u<.5?c=a/(2*u):u>=.5&&u<1&&(c=a/(2*(1-u))),[i[0],c*100,u*100]},n.hcg.hwb=function(i){const a=i[1]/100,o=i[2]/100,u=a+o*(1-a);return[i[0],(u-a)*100,(1-u)*100]},n.hwb.hcg=function(i){const a=i[1]/100,u=1-i[2]/100,c=u-a;let d=0;return c<1&&(d=(u-c)/(1-c)),[i[0],c*100,d*100]},n.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},n.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},n.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},n.gray.hsl=function(i){return[0,0,i[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(i){return[0,100,i[0]]},n.gray.cmyk=function(i){return[0,0,0,i[0]]},n.gray.lab=function(i){return[i[0],0,0]},n.gray.hex=function(i){const a=Math.round(i[0]/100*255)&255,u=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(u.length)+u},n.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},pt}var ft,sn;function is(){if(sn)return ft;sn=1;const e=Wn();function t(){const a={},o=Object.keys(e);for(let u=o.length,c=0;c1&&(c=d),o(c))};return"conversion"in o&&(u.conversion=o.conversion),u}function a(o){const u=function(...c){const d=c[0];if(d==null)return d;d.length>1&&(c=d);const p=o(c);if(typeof p=="object")for(let f=p.length,g=0;g{n[o]={},Object.defineProperty(n[o],"channels",{value:e[o].channels}),Object.defineProperty(n[o],"labels",{value:e[o].labels});const u=t(o);Object.keys(u).forEach(d=>{const p=u[d];n[o][d]=a(p),n[o][d].raw=i(p)})}),mt=n,mt}At.exports;(function(e){const t=(p,f)=>(...g)=>`\x1B[${p(...g)+f}m`,n=(p,f)=>(...g)=>{const b=p(...g);return`\x1B[${38+f};5;${b}m`},r=(p,f)=>(...g)=>{const b=p(...g);return`\x1B[${38+f};2;${b[0]};${b[1]};${b[2]}m`},i=p=>p,a=(p,f,g)=>[p,f,g],o=(p,f,g)=>{Object.defineProperty(p,f,{get:()=>{const b=g();return Object.defineProperty(p,f,{value:b,enumerable:!0,configurable:!0}),b},enumerable:!0,configurable:!0})};let u;const c=(p,f,g,b)=>{u===void 0&&(u=rs());const w=b?10:0,S={};for(const[B,M]of Object.entries(u)){const j=B==="ansi16"?"ansi":B;B===f?S[j]=p(g,w):typeof M=="object"&&(S[j]=p(M[f],w))}return S};function d(){const p=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[g,b]of Object.entries(f)){for(const[w,S]of Object.entries(b))f[w]={open:`\x1B[${S[0]}m`,close:`\x1B[${S[1]}m`},b[w]=f[w],p.set(S[0],S[1]);Object.defineProperty(f,g,{value:b,enumerable:!1})}return Object.defineProperty(f,"codes",{value:p,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(t,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(n,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(r,"rgb",a,!1)),o(f.bgColor,"ansi",()=>c(t,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(n,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(r,"rgb",a,!0)),f}Object.defineProperty(e,"exports",{enumerable:!0,get:d})})(At);var ss=At.exports;const as=qn,os=ts,on=ss,Un=["\x1B","›"],$e=e=>`${Un[0]}[${e}m`,ln=(e,t,n)=>{let r=[];e=[...e];for(let i of e){const a=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");const o=on.codes.get(Number.parseInt(i,10));if(o){const u=e.indexOf(o.toString());u===-1?r.push($e(t?o:a)):e.splice(u,1)}else if(t){r.push($e(0));break}else r.push($e(a))}if(t&&(r=r.filter((i,a)=>r.indexOf(i)===a),n!==void 0)){const i=$e(on.codes.get(Number.parseInt(n,10)));r=r.reduce((a,o)=>o===i?[o,...a]:[...a,o],[])}return r.join("")};var Tt=(e,t,n)=>{const r=[...e],i=[];let a=typeof n=="number"?n:r.length,o=!1,u,c=0,d="";for(const[p,f]of r.entries()){let g=!1;if(Un.includes(f)){const b=/\d[^m]*/.exec(e.slice(p,p+18));u=b&&b.length>0?b[0]:void 0,ct&&c<=a)d+=f;else if(c===t&&!o&&u!==void 0)d=ln(i);else if(c>=a){d+=ln(i,!0,u);break}}return d},be={};Object.defineProperty(be,"__esModule",{value:!0});be.getBorderCharacters=void 0;const ls=e=>{if(e==="honeywell")return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if(e==="norc")return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if(e==="ramac")return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"};if(e==="void")return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""};throw new Error('Unknown border template "'+e+'".')};be.getBorderCharacters=ls;(function(e){var t=I&&I.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.isCellInRange=e.areCellEqual=e.calculateRangeCoordinate=e.findOriginalRowIndex=e.flatten=e.extractTruncates=e.sumArray=e.sequence=e.distributeUnevenly=e.countSpaceSequence=e.groupBySizes=e.makeBorderConfig=e.splitAnsi=e.normalizeString=void 0;const n=t(Tt),r=t(ye),i=t(Bt),a=be,o=F=>F.replace(/\r\n/g,` +import{I as Pe,J as K,K as ie,L as Bi,b as W,T as pe,a as J,M as Pi,N as Ai,O as bn,P as bt,Q as vn,R as Ti,S as Gt,U as Cn,W as Mi,X as R,Y as ji,Z as Ri,$ as Oi,a0 as Zt,a1 as Li,u as Ii,n as Z,k as _n,j as he,a2 as le,C as wn,l as zi,D as Ni,E as Vi,F as qi,a3 as Hi,a4 as Wi,a5 as Ui,a6 as vt,a7 as Oe,a8 as Le,c as ee,a9 as Ie,aa as fe,ab as ze,ac as ut,ad as Fn,ae as Yi,af as kn,d as Ji,e as Ki,V as Gi,ag as I,ah as Zi,ai as Be,G as Ae,aj as Xi,ak as $t,H as Xt,al as Qi,am as er,an as tr,ao as nr,i as ir}from"./index-e409ba63.js";import{h as Ct}from"./moment-fbc5633a.js";import{b as me,c as ne,a as En,_ as $n}from"./ErrorStateAlert-3d45e0aa.js";import{_ as Te,a as rr}from"./VTooltip-7c0b187f.js";import{a as sr,b as Sn,f as ar,c as or}from"./GeneralForm-e1472145.js";import{_ as xn}from"./TagViewer-81c3b950.js";import{_ as Bn}from"./AgentTasksList-f6ba31e5.js";import{_ as Ne}from"./AgentExecuteModule-e502a55e.js";import{d as lr}from"./index-e87896eb.js";import{e as Ee}from"./module-api-04d2f26d.js";import{A as ur}from"./ansi_up-7c0d87a9.js";import{u as cr}from"./module-module-e75169e8.js";import{_ as G}from"./TooltipButton-f53c45a7.js";import{a as Pn}from"./ListPageTop-78cbc2f3.js";import{_ as Qt,a as re,b as en,c as se}from"./VTabItem-01f057dc.js";import{a as dr}from"./VSelect-22e7980f.js";import"./VSwitch-3f004360.js";import"./bypass-module-4e86a448.js";import"./bypass-api-6126dc83.js";import"./credential-module-93372e4e.js";import"./malleable-module-2a911c2d.js";import"./malleable-api-09135b63.js";import"./DateTimeDisplay-951c60c5.js";import"./download-stager-ae353708.js";import"./VPagination-4794e169.js";import"./VDataTable-dab2ebf1.js";import"./ExpansionPanelFilter-010a2264.js";import"./VExpansionPanelHeader-69136628.js";import"./ExpansionPanelSearch-94b8e3ac.js";import"./AdvancedTable-e51651be.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";import"./tag-api-d7e45ad4.js";import"./TechniqueChips-3c9db4c5.js";import"./InfoViewer-98b37678.js";const Ve=Pe.extend({name:"localable",props:{locale:String},computed:{currentLocale(){return this.locale||this.$vuetify.lang.current}}});function hr(e,t=0,n=1){let r;return e<100&&e>=0?(r=new Date(Date.UTC(e,t,n)),isFinite(r.getUTCFullYear())&&r.setUTCFullYear(e)):r=new Date(Date.UTC(e,t,n)),r}function _t(e,t,n){const r=7+t-n;return-((7+hr(e,0,r).getUTCDay()-t)%7)+r-1}function pr(e,t,n,r){let i=[0,31,59,90,120,151,181,212,243,273,304,334][t];return t>1&&St(e)&&i++,i+n}function ct(e,t,n){const r=_t(e,t,n),i=_t(e+1,t,n);return((St(e)?366:365)-r+i)/7}function fr(e,t,n,r,i){const a=_t(e,r,i),o=Math.ceil((pr(e,t,n)-a)/7);return o<1?o+ct(e-1,r,i):o>ct(e,r,i)?o-ct(e,r,i):o}function St(e){return e%4===0&&e%100!==0||e%400===0}const mr=[0,31,28,31,30,31,30,31,31,30,31,30,31],Dr=[0,31,29,31,30,31,30,31,31,30,31,30,31];function gr(e,t){return St(e)?Dr[t]:mr[t]}const yr=K(ie).extend({methods:{genPickerButton(e,t,n,r=!1,i=""){const a=this[e]===t,o=u=>{u.stopPropagation(),this.$emit(`update:${Bi(e)}`,t)};return this.$createElement("div",{staticClass:`v-picker__title__btn ${i}`.trim(),class:{"v-picker__title__btn--active":a,"v-picker__title__btn--readonly":r},on:a||r?void 0:{click:o}},Array.isArray(n)?n:[n])}}}),br=K(yr).extend({name:"v-date-picker-title",props:{date:{type:String,default:""},disabled:Boolean,readonly:Boolean,selectingYear:Boolean,value:{type:String},year:{type:[Number,String],default:""},yearIcon:{type:String}},data:()=>({isReversing:!1}),computed:{computedTransition(){return this.isReversing?"picker-reverse-transition":"picker-transition"}},watch:{value(e,t){this.isReversing=e(i.endsWith(t)&&(r[i.slice(0,-t.length)]=a=>e.$emit(i,n,a)),r),{})}function dt(e,t){return Object.keys(e.$listeners).reduce((n,r)=>(r.endsWith(t)&&(n[r]=e.$listeners[r]),n),{})}const vr=(e,t,n)=>(t=t>>0,e=String(e),n=String(n),e.length>t?String(e):(t=t-e.length,t>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+String(e))),L=(e,t=2)=>vr(e,t,"0");function te(e,t,n={start:0,length:0}){const r=i=>{const[a,o,u]=i.trim().split(" ")[0].split("-");return[L(a,4),L(o||1),L(u||1)].join("-")};try{const i=new Intl.DateTimeFormat(e||void 0,t);return a=>i.format(new Date(`${r(a)}T00:00:00+00:00`))}catch{return n.start||n.length?a=>r(a).substr(n.start||0,n.length):void 0}}const Tn=(e,t)=>{const[n,r]=e.split("-").map(Number);return r+t===0?`${n-1}-12`:r+t===13?`${n+1}-01`:`${n}-${L(r+t)}`},U=(e,t)=>{const[n,r=1,i=1]=e.split("-");return`${n}-${L(r)}-${L(i)}`.substr(0,{date:10,month:7,year:4}[t])},Cr=K(ie,Ve,pe).extend({name:"v-date-picker-header",props:{disabled:Boolean,format:Function,min:String,max:String,nextAriaLabel:String,nextIcon:{type:String,default:"$next"},prevAriaLabel:String,prevIcon:{type:String,default:"$prev"},readonly:Boolean,value:{type:[Number,String],required:!0}},data(){return{isReversing:!1}},computed:{formatter(){return this.format?this.format:String(this.value).split("-")[1]?te(this.currentLocale,{month:"long",year:"numeric",timeZone:"UTC"},{length:7}):te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},watch:{value(e,t){this.isReversing=e0?this.nextAriaLabel:this.prevAriaLabel,n=t?this.$vuetify.lang.t(t):void 0,r=this.disabled||e<0&&this.min&&this.calculateChange(e)0&&this.max&&this.calculateChange(e)>this.max;return this.$createElement(J,{attrs:{"aria-label":n},props:{dark:this.dark,disabled:r,icon:!0,light:this.light},on:{click:i=>{i.stopPropagation(),this.$emit("input",this.calculateChange(e))}}},[this.$createElement(W,e<0==!this.$vuetify.rtl?this.prevIcon:this.nextIcon)])},calculateChange(e){const[t,n]=String(this.value).split("-").map(Number);return n==null?`${t+e}`:Tn(String(this.value),e)},genHeader(){const e=!this.disabled&&(this.color||"accent"),t=this.$createElement("div",this.setTextColor(e,{key:String(this.value)}),[this.$createElement("button",{attrs:{type:"button"},on:{click:()=>this.$emit("toggle")}},[this.$slots.default||this.formatter(String(this.value))])]),n=this.$createElement("transition",{props:{name:this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"}},[t]);return this.$createElement("div",{staticClass:"v-date-picker-header__value",class:{"v-date-picker-header__value--disabled":this.disabled}},[n])}},render(){return this.$createElement("div",{staticClass:"v-date-picker-header",class:{"v-date-picker-header--disabled":this.disabled,...this.themeClasses}},[this.genBtn(-1),this.genHeader(),this.genBtn(1)])}});function Mn(e,t,n,r){return(!r||r(e))&&(!t||e>=t.substr(0,10))&&(!n||e<=n)}const jn=K(ie,Ve,pe).extend({directives:{Touch:Pi},props:{allowedDates:Function,current:String,disabled:Boolean,format:Function,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},min:String,max:String,range:Boolean,readonly:Boolean,scrollable:Boolean,tableDate:{type:String,required:!0},value:[String,Array]},data:()=>({isReversing:!1,wheelThrottle:null}),computed:{computedTransition(){return this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"},displayedMonth(){return Number(this.tableDate.split("-")[1])-1},displayedYear(){return Number(this.tableDate.split("-")[0])}},watch:{tableDate(e,t){this.isReversing=e{t&&!this.readonly&&this.$emit("input",e)}},An(this,`:${n}`,e))},genButton(e,t,n,r,i=!1){const a=Mn(e,this.min,this.max,this.allowedDates),o=this.isSelected(e)&&a,u=e===this.current,c=o?this.setBackgroundColor:this.setTextColor,d=(o||u)&&(this.color||"accent");let p=!1,f=!1;return this.range&&this.value&&Array.isArray(this.value)&&(p=e===this.value[0],f=e===this.value[this.value.length-1]),this.$createElement("button",c(d,{staticClass:"v-btn",class:this.genButtonClasses(a&&!i,t,o,u,p,f),attrs:{type:"button"},domProps:{disabled:this.disabled||!a||i},on:this.genButtonEvents(e,a,n)}),[this.$createElement("div",{staticClass:"v-btn__content"},[r(e)]),this.genEvents(e)])},getEventColors(e){const t=i=>Array.isArray(i)?i:[i];let n,r=[];if(Array.isArray(this.events)?n=this.events.includes(e):this.events instanceof Function?n=this.events(e)||!1:this.events?n=this.events[e]||!1:n=!1,n)n!==!0?r=t(n):typeof this.eventColor=="string"?r=[this.eventColor]:typeof this.eventColor=="function"?r=t(this.eventColor(e)):Array.isArray(this.eventColor)?r=this.eventColor:r=t(this.eventColor[e]);else return[];return r.filter(i=>i)},genEvents(e){const t=this.getEventColors(e);return t.length?this.$createElement("div",{staticClass:"v-date-picker-table__events"},t.map(n=>this.$createElement("div",this.setBackgroundColor(n)))):null},isValidScroll(e,t){const n=t(e),r=n.split("-").length===1?"year":"month";return e<0&&(this.min?n>=U(this.min,r):!0)||e>0&&(this.max?n<=U(this.max,r):!0)},wheel(e,t){this.$emit("update:table-date",t(e.deltaY))},touch(e,t){this.$emit("update:table-date",t(e))},genTable(e,t,n){const r=this.$createElement("transition",{props:{name:this.computedTransition}},[this.$createElement("table",{key:this.tableDate},t)]),i={name:"touch",value:{left:a=>a.offsetX<-15&&this.isValidScroll(1,n)&&this.touch(1,n),right:a=>a.offsetX>15&&this.isValidScroll(-1,n)&&this.touch(-1,n)}};return this.$createElement("div",{staticClass:e,class:{"v-date-picker-table--disabled":this.disabled,...this.themeClasses},on:!this.disabled&&this.scrollable?{wheel:a=>{a.preventDefault(),this.isValidScroll(a.deltaY,n)&&this.wheelThrottle(a,n)}}:void 0,directives:[i]},[r])},isSelected(e){if(Array.isArray(this.value))if(this.range&&this.value.length===2){const[t,n]=[...this.value].sort();return t<=e&&e<=n}else return this.value.indexOf(e)!==-1;return e===this.value}}}),_r=K(jn).extend({name:"v-date-picker-date-table",props:{firstDayOfWeek:{type:[String,Number],default:0},localeFirstDayOfYear:{type:[String,Number],default:0},showAdjacentMonths:Boolean,showWeek:Boolean,weekdayFormat:Function},computed:{formatter(){return this.format||te(this.currentLocale,{day:"numeric",timeZone:"UTC"},{start:8,length:2})},weekdayFormatter(){return this.weekdayFormat||te(this.currentLocale,{weekday:"narrow",timeZone:"UTC"})},weekDays(){const e=parseInt(this.firstDayOfWeek,10);return this.weekdayFormatter?bt(7).map(t=>this.weekdayFormatter(`2017-01-${e+t+15}`)):bt(7).map(t=>["S","M","T","W","T","F","S"][(t+e)%7])}},methods:{calculateTableDate(e){return Tn(this.tableDate,Math.sign(e||1))},genTHead(){const e=this.weekDays.map(t=>this.$createElement("th",t));return this.showWeek&&e.unshift(this.$createElement("th")),this.$createElement("thead",this.genTR(e))},weekDaysBeforeFirstDayOfTheMonth(){return(new Date(`${this.displayedYear}-${L(this.displayedMonth+1)}-01T00:00:00+00:00`).getUTCDay()-parseInt(this.firstDayOfWeek)+7)%7},getWeekNumber(e){return fr(this.displayedYear,this.displayedMonth,e,parseInt(this.firstDayOfWeek),parseInt(this.localeFirstDayOfYear))},genWeekNumber(e){return this.$createElement("td",[this.$createElement("small",{staticClass:"v-date-picker-table--date__week"},String(e).padStart(2,"0"))])},genTBody(){const e=[],t=new Date(this.displayedYear,this.displayedMonth+1,0).getDate();let n=[],r=this.weekDaysBeforeFirstDayOfTheMonth();this.showWeek&&n.push(this.genWeekNumber(this.getWeekNumber(1)));const i=this.displayedMonth?this.displayedYear:this.displayedYear-1,a=(this.displayedMonth+11)%12,o=new Date(this.displayedYear,this.displayedMonth,0).getDate(),u=this.showWeek?8:7;for(;r--;){const f=`${i}-${L(a+1)}-${L(o-r)}`;n.push(this.$createElement("td",this.showAdjacentMonths?[this.genButton(f,!0,"date",this.formatter,!0)]:[]))}for(r=1;r<=t;r++){const f=`${this.displayedYear}-${L(this.displayedMonth+1)}-${L(r)}`;n.push(this.$createElement("td",[this.genButton(f,!0,"date",this.formatter)])),n.length%u===0&&(e.push(this.genTR(n)),n=[],this.showWeek&&(r{const u=r*t.length+o,c=`${this.displayedYear}-${L(u+1)}`;return this.$createElement("td",{key:u},[this.genButton(c,!1,"month",this.formatter)])});e.push(this.$createElement("tr",{key:r},i))}return this.$createElement("tbody",e)}},render(){return this.genTable("v-date-picker-table v-date-picker-table--month",[this.genTBody()],this.calculateTableDate)}});const Fr=K(ie,Ve).extend({name:"v-date-picker-years",props:{format:Function,min:[Number,String],max:[Number,String],readonly:Boolean,value:[Number,String]},data(){return{defaultColor:"primary"}},computed:{formatter(){return this.format||te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},mounted(){setTimeout(()=>{const e=this.$el.getElementsByClassName("active")[0];e?this.$el.scrollTop=e.offsetTop-this.$el.offsetHeight/2+e.offsetHeight/2:this.min&&!this.max?this.$el.scrollTop=this.$el.scrollHeight:!this.min&&this.max?this.$el.scrollTop=0:this.$el.scrollTop=this.$el.scrollHeight/2-this.$el.offsetHeight/2})},methods:{genYearItem(e){const t=this.formatter(`${e}`),n=parseInt(this.value,10)===e,r=n&&(this.color||"primary");return this.$createElement("li",this.setTextColor(r,{key:e,class:{active:n},on:bn({click:()=>this.$emit("input",e)},An(this,":year",e))}),t)},genYearItems(){const e=[],t=this.value?parseInt(this.value,10):new Date().getFullYear(),n=this.max?parseInt(this.max,10):t+100,r=Math.min(n,this.min?parseInt(this.min,10):t-100);for(let i=n;i>=r;i--)e.push(this.genYearItem(i));return e}},render(){return this.$createElement("ul",{staticClass:"v-date-picker-years",ref:"years"},this.genYearItems())}});const kr=K(ie,vn,pe).extend({name:"v-picker",props:{flat:Boolean,fullWidth:Boolean,landscape:Boolean,noTitle:Boolean,transition:{type:String,default:"fade-transition"},width:{type:[Number,String],default:290}},computed:{computedTitleColor(){const e=this.isDark?!1:this.color||"primary";return this.color||e}},methods:{genTitle(){return this.$createElement("div",this.setBackgroundColor(this.computedTitleColor,{staticClass:"v-picker__title",class:{"v-picker__title--landscape":this.landscape}}),this.$slots.title)},genBodyTransition(){return this.$createElement("transition",{props:{name:this.transition}},this.$slots.default)},genBody(){return this.$createElement("div",{staticClass:"v-picker__body",class:{"v-picker__body--no-title":this.noTitle,...this.themeClasses},style:this.fullWidth?void 0:{width:Ti(this.width)}},[this.genBodyTransition()])},genActions(){return this.$createElement("div",{staticClass:"v-picker__actions v-card__actions",class:{"v-picker__actions--no-title":this.noTitle}},this.$slots.actions)}},render(e){return e("div",{staticClass:"v-picker v-card",class:{"v-picker--flat":this.flat,"v-picker--landscape":this.landscape,"v-picker--full-width":this.fullWidth,...this.themeClasses,...this.elevationClasses}},[this.$slots.title?this.genTitle():null,this.genBody(),this.$slots.actions?this.genActions():null])}}),Er=K(ie,vn,pe).extend({name:"picker",props:{flat:Boolean,fullWidth:Boolean,headerColor:String,landscape:Boolean,noTitle:Boolean,width:{type:[Number,String],default:290}},methods:{genPickerTitle(){return null},genPickerBody(){return null},genPickerActionsSlot(){return this.$scopedSlots.default?this.$scopedSlots.default({save:this.save,cancel:this.cancel}):this.$slots.default},genPicker(e){const t=[];if(!this.noTitle){const r=this.genPickerTitle();r&&t.push(r)}const n=this.genPickerBody();return n&&t.push(n),t.push(this.$createElement("template",{slot:"actions"},[this.genPickerActionsSlot()])),this.$createElement(kr,{staticClass:e,props:{color:this.headerColor||this.color,dark:this.dark,elevation:this.elevation,flat:this.flat,fullWidth:this.fullWidth,landscape:this.landscape,light:this.light,width:this.width,noTitle:this.noTitle}},t)}}}),$r=K(Ve,Er).extend({name:"v-date-picker",props:{activePicker:String,allowedDates:Function,dayFormat:Function,disabled:Boolean,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},firstDayOfWeek:{type:[String,Number],default:0},headerDateFormat:Function,localeFirstDayOfYear:{type:[String,Number],default:0},max:String,min:String,monthFormat:Function,multiple:Boolean,nextIcon:{type:String,default:"$next"},nextMonthAriaLabel:{type:String,default:"$vuetify.datePicker.nextMonthAriaLabel"},nextYearAriaLabel:{type:String,default:"$vuetify.datePicker.nextYearAriaLabel"},pickerDate:String,prevIcon:{type:String,default:"$prev"},prevMonthAriaLabel:{type:String,default:"$vuetify.datePicker.prevMonthAriaLabel"},prevYearAriaLabel:{type:String,default:"$vuetify.datePicker.prevYearAriaLabel"},range:Boolean,reactive:Boolean,readonly:Boolean,scrollable:Boolean,showCurrent:{type:[Boolean,String],default:!0},selectedItemsText:{type:String,default:"$vuetify.datePicker.itemsSelected"},showAdjacentMonths:Boolean,showWeek:Boolean,titleDateFormat:Function,type:{type:String,default:"date",validator:e=>["date","month"].includes(e)},value:[Array,String],weekdayFormat:Function,yearFormat:Function,yearIcon:String},data(){const e=new Date;return{internalActivePicker:this.type.toUpperCase(),inputDay:null,inputMonth:null,inputYear:null,isReversing:!1,now:e,tableDate:(()=>{if(this.pickerDate)return this.pickerDate;const t=Gt(this.value),n=t[t.length-1]||(typeof this.showCurrent=="string"?this.showCurrent:`${e.getFullYear()}-${e.getMonth()+1}`);return U(n,this.type==="date"?"month":"year")})()}},computed:{multipleValue(){return Gt(this.value)},isMultiple(){return this.multiple||this.range},lastValue(){return this.isMultiple?this.multipleValue[this.multipleValue.length-1]:this.value},selectedMonths(){return!this.value||this.type==="month"?this.value:this.isMultiple?this.multipleValue.map(e=>e.substr(0,7)):this.value.substr(0,7)},current(){return this.showCurrent===!0?U(`${this.now.getFullYear()}-${this.now.getMonth()+1}-${this.now.getDate()}`,this.type):this.showCurrent||null},inputDate(){return this.type==="date"?`${this.inputYear}-${L(this.inputMonth+1)}-${L(this.inputDay)}`:`${this.inputYear}-${L(this.inputMonth+1)}`},tableMonth(){return Number((this.pickerDate||this.tableDate).split("-")[1])-1},tableYear(){return Number((this.pickerDate||this.tableDate).split("-")[0])},minMonth(){return this.min?U(this.min,"month"):null},maxMonth(){return this.max?U(this.max,"month"):null},minYear(){return this.min?U(this.min,"year"):null},maxYear(){return this.max?U(this.max,"year"):null},formatters(){return{year:this.yearFormat||te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4}),titleDate:this.titleDateFormat||(this.isMultiple?this.defaultTitleMultipleDateFormatter:this.defaultTitleDateFormatter)}},defaultTitleMultipleDateFormatter(){return e=>e.length?e.length===1?this.defaultTitleDateFormatter(e[0]):this.$vuetify.lang.t(this.selectedItemsText,e.length):"-"},defaultTitleDateFormatter(){const e={year:{year:"numeric",timeZone:"UTC"},month:{month:"long",timeZone:"UTC"},date:{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}},t=te(this.currentLocale,e[this.type],{start:0,length:{date:10,month:7,year:4}[this.type]}),n=r=>t(r).replace(/([^\d\s])([\d])/g,(i,a,o)=>`${a} ${o}`).replace(", ",",
");return this.landscape?n:t}},watch:{internalActivePicker:{immediate:!0,handler(e){this.$emit("update:active-picker",e)}},activePicker(e){this.internalActivePicker=e},tableDate(e,t){const n=this.type==="month"?"year":"month";this.isReversing=U(e,n)U(n,e)).filter(this.isDateAllowed);this.$emit("input",this.isMultiple?t:t[0])}}},created(){this.checkMultipleProp(),this.pickerDate!==this.tableDate&&this.$emit("update:picker-date",this.tableDate),this.setInputDate()},methods:{emitInput(e){if(this.range){if(this.multipleValue.length!==1)this.$emit("input",[e]);else{const n=[this.multipleValue[0],e];this.$emit("input",n),this.$emit("change",n)}return}const t=this.multiple?this.multipleValue.indexOf(e)===-1?this.multipleValue.concat([e]):this.multipleValue.filter(n=>n!==e):e;this.$emit("input",t),this.multiple||this.$emit("change",e)},checkMultipleProp(){if(this.value==null)return;const e=this.value.constructor.name,t=this.isMultiple?"Array":"String";e!==t&&Cn(`Value must be ${this.isMultiple?"an":"a"} ${t}, got ${e}`,this)},isDateAllowed(e){return Mn(e,this.min,this.max,this.allowedDates)},yearClick(e){this.inputYear=e,this.type==="month"?this.tableDate=`${e}`:this.tableDate=`${e}-${L((this.tableMonth||0)+1)}`,this.internalActivePicker="MONTH",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)},monthClick(e){const[t,n]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(n,10)-1,this.type==="date"?(this.inputDay&&(this.inputDay=Math.min(this.inputDay,gr(this.inputYear,this.inputMonth+1))),this.tableDate=e,this.internalActivePicker="DATE",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)):this.emitInput(this.inputDate)},dateClick(e){const[t,n,r]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(n,10)-1,this.inputDay=parseInt(r,10),this.emitInput(this.inputDate)},genPickerTitle(){return this.$createElement(br,{props:{date:this.value?this.formatters.titleDate(this.isMultiple?this.multipleValue:this.value):"",disabled:this.disabled,readonly:this.readonly,selectingYear:this.internalActivePicker==="YEAR",year:this.formatters.year(this.multipleValue.length?`${this.inputYear}`:this.tableDate),yearIcon:this.yearIcon,value:this.multipleValue[0]},slot:"title",on:{"update:selecting-year":e=>this.internalActivePicker=e?"YEAR":this.type.toUpperCase()}})},genTableHeader(){return this.$createElement(Cr,{props:{nextIcon:this.nextIcon,color:this.color,dark:this.dark,disabled:this.disabled,format:this.headerDateFormat,light:this.light,locale:this.locale,min:this.internalActivePicker==="DATE"?this.minMonth:this.minYear,max:this.internalActivePicker==="DATE"?this.maxMonth:this.maxYear,nextAriaLabel:this.internalActivePicker==="DATE"?this.nextMonthAriaLabel:this.nextYearAriaLabel,prevAriaLabel:this.internalActivePicker==="DATE"?this.prevMonthAriaLabel:this.prevYearAriaLabel,prevIcon:this.prevIcon,readonly:this.readonly,value:this.internalActivePicker==="DATE"?`${L(this.tableYear,4)}-${L(this.tableMonth+1)}`:`${L(this.tableYear,4)}`},on:{toggle:()=>this.internalActivePicker=this.internalActivePicker==="DATE"?"MONTH":"YEAR",input:e=>this.tableDate=e}})},genDateTable(){return this.$createElement(_r,{props:{allowedDates:this.allowedDates,color:this.color,current:this.current,dark:this.dark,disabled:this.disabled,events:this.events,eventColor:this.eventColor,firstDayOfWeek:this.firstDayOfWeek,format:this.dayFormat,light:this.light,locale:this.locale,localeFirstDayOfYear:this.localeFirstDayOfYear,min:this.min,max:this.max,range:this.range,readonly:this.readonly,scrollable:this.scrollable,showAdjacentMonths:this.showAdjacentMonths,showWeek:this.showWeek,tableDate:`${L(this.tableYear,4)}-${L(this.tableMonth+1)}`,value:this.value,weekdayFormat:this.weekdayFormat},ref:"table",on:{input:this.dateClick,"update:table-date":e=>this.tableDate=e,...dt(this,":date")}})},genMonthTable(){return this.$createElement(wr,{props:{allowedDates:this.type==="month"?this.allowedDates:null,color:this.color,current:this.current?U(this.current,"month"):null,dark:this.dark,disabled:this.disabled,events:this.type==="month"?this.events:null,eventColor:this.type==="month"?this.eventColor:null,format:this.monthFormat,light:this.light,locale:this.locale,min:this.minMonth,max:this.maxMonth,range:this.range,readonly:this.readonly&&this.type==="month",scrollable:this.scrollable,value:this.selectedMonths,tableDate:`${L(this.tableYear,4)}`},ref:"table",on:{input:this.monthClick,"update:table-date":e=>this.tableDate=e,...dt(this,":month")}})},genYears(){return this.$createElement(Fr,{props:{color:this.color,format:this.yearFormat,locale:this.locale,min:this.minYear,max:this.maxYear,value:this.tableYear},on:{input:this.yearClick,...dt(this,":year")}})},genPickerBody(){const e=this.internalActivePicker==="YEAR"?[this.genYears()]:[this.genTableHeader(),this.internalActivePicker==="DATE"?this.genDateTable():this.genMonthTable()];return this.$createElement("div",{key:this.internalActivePicker},e)},setInputDate(){if(this.lastValue){const e=this.lastValue.split("-");this.inputYear=parseInt(e[0],10),this.inputMonth=parseInt(e[1],10)-1,this.type==="date"&&(this.inputDay=parseInt(e[2],10))}else this.inputYear=this.inputYear||this.now.getFullYear(),this.inputMonth=this.inputMonth==null?this.inputMonth:this.now.getMonth(),this.inputDay=this.inputDay||this.now.getDate()}},render(){return this.genPicker("v-picker--date")}});const Sr=K(ie,Mi("treeview")),Rn={activatable:Boolean,activeClass:{type:String,default:"v-treeview-node--active"},color:{type:String,default:"primary"},disablePerNode:Boolean,expandIcon:{type:String,default:"$subgroup"},indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},itemChildren:{type:String,default:"children"},itemDisabled:{type:String,default:"disabled"},itemKey:{type:String,default:"id"},itemText:{type:String,default:"name"},loadChildren:Function,loadingIcon:{type:String,default:"$loading"},offIcon:{type:String,default:"$checkboxOff"},onIcon:{type:String,default:"$checkboxOn"},openOnClick:Boolean,rounded:Boolean,selectable:Boolean,selectedColor:{type:String,default:"accent"},shaped:Boolean,transition:Boolean,selectionType:{type:String,default:"leaf",validator:e=>["leaf","independent"].includes(e)}},On=Sr.extend().extend({name:"v-treeview-node",inject:{treeview:{default:null}},props:{level:Number,item:{type:Object,default:()=>null},parentIsDisabled:Boolean,...Rn},data:()=>({hasLoaded:!1,isActive:!1,isIndeterminate:!1,isLoading:!1,isOpen:!1,isSelected:!1}),computed:{disabled(){return R(this.item,this.itemDisabled)||!this.disablePerNode&&this.parentIsDisabled&&this.selectionType==="leaf"},key(){return R(this.item,this.itemKey)},children(){const e=R(this.item,this.itemChildren);return e&&e.filter(t=>!this.treeview.isExcluded(R(t,this.itemKey)))},text(){return R(this.item,this.itemText)},scopedProps(){return{item:this.item,leaf:!this.children,selected:this.isSelected,indeterminate:this.isIndeterminate,active:this.isActive,open:this.isOpen}},computedIcon(){return this.isIndeterminate?this.indeterminateIcon:this.isSelected?this.onIcon:this.offIcon},hasChildren(){return!!this.children&&(!!this.children.length||!!this.loadChildren)}},created(){this.treeview.register(this)},beforeDestroy(){this.treeview.unregister(this)},methods:{checkChildren(){return new Promise(e=>{if(!this.children||this.children.length||!this.loadChildren||this.hasLoaded)return e();this.isLoading=!0,e(this.loadChildren(this.item))}).then(()=>{this.isLoading=!1,this.hasLoaded=!0})},open(){this.isOpen=!this.isOpen,this.treeview.updateOpen(this.key,this.isOpen),this.treeview.emitOpen()},genLabel(){const e=[];return this.$scopedSlots.label?e.push(this.$scopedSlots.label(this.scopedProps)):e.push(this.text),this.$createElement("div",{slot:"label",staticClass:"v-treeview-node__label"},e)},genPrependSlot(){return this.$scopedSlots.prepend?this.$createElement("div",{staticClass:"v-treeview-node__prepend"},this.$scopedSlots.prepend(this.scopedProps)):null},genAppendSlot(){return this.$scopedSlots.append?this.$createElement("div",{staticClass:"v-treeview-node__append"},this.$scopedSlots.append(this.scopedProps)):null},genContent(){const e=[this.genPrependSlot(),this.genLabel(),this.genAppendSlot()];return this.$createElement("div",{staticClass:"v-treeview-node__content"},e)},genToggle(){return this.$createElement(W,{staticClass:"v-treeview-node__toggle",class:{"v-treeview-node__toggle--open":this.isOpen,"v-treeview-node__toggle--loading":this.isLoading},slot:"prepend",on:{click:e=>{e.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>this.open())}}},[this.isLoading?this.loadingIcon:this.expandIcon])},genCheckbox(){return this.$createElement(W,{staticClass:"v-treeview-node__checkbox",props:{color:this.isSelected||this.isIndeterminate?this.selectedColor:void 0,disabled:this.disabled},on:{click:e=>{e.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>{this.$nextTick(()=>{this.isSelected=!this.isSelected,this.isIndeterminate=!1,this.treeview.updateSelected(this.key,this.isSelected),this.treeview.emitSelected()})})}}},[this.computedIcon])},genLevel(e){return bt(e).map(()=>this.$createElement("div",{staticClass:"v-treeview-node__level"}))},genNode(){const e=[this.genContent()];return this.selectable&&e.unshift(this.genCheckbox()),this.hasChildren?e.unshift(this.genToggle()):e.unshift(...this.genLevel(1)),e.unshift(...this.genLevel(this.level)),this.$createElement("div",this.setTextColor(this.isActive&&this.color,{staticClass:"v-treeview-node__root",class:{[this.activeClass]:this.isActive},on:{click:()=>{this.openOnClick&&this.hasChildren?this.checkChildren().then(this.open):this.activatable&&!this.disabled&&(this.isActive=!this.isActive,this.treeview.updateActive(this.key,this.isActive),this.treeview.emitActive())}}}),e)},genChild(e,t){return this.$createElement(On,{key:R(e,this.itemKey),props:{activatable:this.activatable,activeClass:this.activeClass,item:e,selectable:this.selectable,selectedColor:this.selectedColor,color:this.color,disablePerNode:this.disablePerNode,expandIcon:this.expandIcon,indeterminateIcon:this.indeterminateIcon,offIcon:this.offIcon,onIcon:this.onIcon,loadingIcon:this.loadingIcon,itemKey:this.itemKey,itemText:this.itemText,itemDisabled:this.itemDisabled,itemChildren:this.itemChildren,loadChildren:this.loadChildren,transition:this.transition,openOnClick:this.openOnClick,rounded:this.rounded,shaped:this.shaped,level:this.level+1,selectionType:this.selectionType,parentIsDisabled:t},scopedSlots:this.$scopedSlots})},genChildrenWrapper(){if(!this.isOpen||!this.children)return null;const e=[this.children.map(t=>this.genChild(t,this.disabled))];return this.$createElement("div",{staticClass:"v-treeview-node__children"},e)},genTransition(){return this.$createElement(ji,[this.genChildrenWrapper()])}},render(e){const t=[this.genNode()];return this.transition?t.push(this.genTransition()):t.push(this.genChildrenWrapper()),e("div",{staticClass:"v-treeview-node",class:{"v-treeview-node--leaf":!this.hasChildren,"v-treeview-node--click":this.openOnClick,"v-treeview-node--disabled":this.disabled,"v-treeview-node--rounded":this.rounded,"v-treeview-node--shaped":this.shaped,"v-treeview-node--selected":this.isSelected},attrs:{"aria-expanded":String(this.isOpen)}},t)}}),xr=On;function Br(e,t,n){return R(e,n).toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1}function Ln(e,t,n,r,i,a,o){if(e(t,n,i))return!0;const u=R(t,a);if(u){let c=!1;for(let d=0;d[]},dense:Boolean,disabled:Boolean,filter:Function,hoverable:Boolean,items:{type:Array,default:()=>[]},multipleActive:Boolean,open:{type:Array,default:()=>[]},openAll:Boolean,returnObject:{type:Boolean,default:!1},search:String,value:{type:Array,default:()=>[]},...Rn},data:()=>({level:-1,activeCache:new Set,nodes:{},openCache:new Set,selectedCache:new Set}),computed:{excludedItems(){const e=new Set;if(!this.search)return e;for(let t=0;tR(this.nodes[i].item,this.itemKey)),t=this.getKeys(this.items),n=Oi(t,e);if(!n.length&&t.lengthdelete this.nodes[i]);const r=[...this.selectedCache];this.selectedCache=new Set,this.activeCache=new Set,this.openCache=new Set,this.buildTree(this.items),Zt(r,[...this.selectedCache])||this.emitSelected()},deep:!0},active(e){this.handleNodeCacheWatcher(e,this.activeCache,this.updateActive,this.emitActive)},value(e){this.handleNodeCacheWatcher(e,this.selectedCache,this.updateSelected,this.emitSelected)},open(e){this.handleNodeCacheWatcher(e,this.openCache,this.updateOpen,this.emitOpen)}},created(){const e=t=>this.returnObject?R(t,this.itemKey):t;this.buildTree(this.items);for(const t of this.value.map(e))this.updateSelected(t,!0,!0);for(const t of this.active.map(e))this.updateActive(t,!0)},mounted(){(this.$slots.prepend||this.$slots.append)&&Cn("The prepend and append slots require a slot-scope attribute",this),this.openAll?this.updateAll(!0):(this.open.forEach(e=>this.updateOpen(this.returnObject?R(e,this.itemKey):e,!0)),this.emitOpen())},methods:{updateAll(e){Object.keys(this.nodes).forEach(t=>this.updateOpen(R(this.nodes[t].item,this.itemKey),e)),this.emitOpen()},getKeys(e,t=[]){for(let n=0;nR(d,this.itemKey)),item:i};if(this.buildTree(o,a),this.selectionType!=="independent"&&t!==null&&!this.nodes.hasOwnProperty(a)&&this.nodes.hasOwnProperty(t)?c.isSelected=this.nodes[t].isSelected:(c.isSelected=u.isSelected,c.isIndeterminate=u.isIndeterminate),c.isActive=u.isActive,c.isOpen=u.isOpen,this.nodes[a]=c,o.length&&this.selectionType!=="independent"){const{isSelected:d,isIndeterminate:p}=this.calculateState(a,this.nodes);c.isSelected=d,c.isIndeterminate=p}this.nodes[a].isSelected&&(this.selectionType==="independent"||c.children.length===0)&&this.selectedCache.add(a),this.nodes[a].isActive&&this.activeCache.add(a),this.nodes[a].isOpen&&this.openCache.add(a),this.updateVnodeState(a)}},calculateState(e,t){const n=t[e].children,r=n.reduce((o,u)=>(o[0]+=+!!t[u].isSelected,o[1]+=+!!t[u].isIndeterminate,o),[0,0]),i=!!n.length&&r[0]===n.length,a=!i&&(r[0]>0||r[1]>0);return{isSelected:i,isIndeterminate:a}},emitOpen(){this.emitNodeCache("update:open",this.openCache)},emitSelected(){this.emitNodeCache("input",this.selectedCache)},emitActive(){this.emitNodeCache("update:active",this.activeCache)},emitNodeCache(e,t){this.$emit(e,this.returnObject?[...t].map(n=>this.nodes[n].item):[...t])},handleNodeCacheWatcher(e,t,n,r){e=this.returnObject?e.map(a=>R(a,this.itemKey)):e;const i=[...t];Zt(i,e)||(i.forEach(a=>n(a,!1)),e.forEach(a=>n(a,!0)),r())},getDescendants(e,t=[]){const n=this.nodes[e].children;t.push(...n);for(let r=0;r{this.nodes[r].isActive=!1,this.updateVnodeState(r),this.activeCache.delete(r)});const n=this.nodes[e];n&&(t?this.activeCache.add(e):this.activeCache.delete(e),n.isActive=t,this.updateVnodeState(e))},updateSelected(e,t,n=!1){if(!this.nodes.hasOwnProperty(e))return;const r=new Map;if(this.selectionType!=="independent"){for(const a of this.getDescendants(e))(!R(this.nodes[a].item,this.itemDisabled)||n)&&(this.nodes[a].isSelected=t,this.nodes[a].isIndeterminate=!1,r.set(a,t));const i=this.calculateState(e,this.nodes);this.nodes[e].isSelected=t,this.nodes[e].isIndeterminate=i.isIndeterminate,r.set(e,t);for(const a of this.getParents(e)){const o=this.calculateState(a,this.nodes);this.nodes[a].isSelected=o.isSelected,this.nodes[a].isIndeterminate=o.isIndeterminate,r.set(a,o.isSelected)}}else this.nodes[e].isSelected=t,this.nodes[e].isIndeterminate=!1,r.set(e,t);for(const[i,a]of r.entries())this.updateVnodeState(i),!(this.selectionType==="leaf"&&this.isParent(i))&&(a===!0?this.selectedCache.add(i):this.selectedCache.delete(i))},updateOpen(e,t){if(!this.nodes.hasOwnProperty(e))return;const n=this.nodes[e],r=R(n.item,this.itemChildren);r&&!r.length&&n.vnode&&!n.vnode.hasLoaded?n.vnode.checkChildren().then(()=>this.updateOpen(e,t)):r&&r.length&&(n.isOpen=t,n.isOpen?this.openCache.add(e):this.openCache.delete(e),this.updateVnodeState(e))},updateVnodeState(e){const t=this.nodes[e];t&&t.vnode&&(t.vnode.isSelected=t.isSelected,t.vnode.isIndeterminate=t.isIndeterminate,t.vnode.isActive=t.isActive,t.vnode.isOpen=t.isOpen)},isExcluded(e){return!!this.search&&this.excludedItems.has(e)}},render(e){const t=this.items.length?this.items.filter(n=>!this.isExcluded(R(n,this.itemKey))).map(n=>xr.options.methods.genChild.bind(this)(n,this.disabled||R(n,this.itemDisabled))):this.$slots.default;return e("div",{staticClass:"v-treeview",class:{"v-treeview--hoverable":this.hoverable,"v-treeview--dense":this.dense,...this.themeClasses}},t)}});const Ar={components:{},props:{editable:{type:Boolean,default:!0},label:{type:String,required:!0},value:{type:[String,Number],default:""},infoText:{type:String,default:""},dataType:{type:String,default:"string"},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},rules:{type:Array,default:()=>[]}},data(){return{internalValue:this.value,editing:!1,menu:!1,original:"",moment:Ct}},computed:{dirty(){return this.original!==this.internalValue},...Li(Ii,["darkMode"])},watch:{internalValue(e){this.$emit("input",e)}},mounted(){this.original=this.value},methods:{clicked(){this.editable&&(this.editing=!0,this.$nextTick(()=>{this.dataType==="date"||this.dataType==="date-range"?this.menu=!0:this.$refs.field.focus()}))},async update(){this.$refs.field.validate&&this.$refs.field.validate()===!1||(this.label==="Delay"?this.internalValue=Math.floor(this.internalValue):this.label==="Jitter"&&(this.internalValue=Math.floor(this.internalValue*10)/10),await this.$nextTick(),this.editing=!1,this.$emit("update"))},revert(){this.editing=!1,this.internalValue=this.original},async clear(){this.internalValue="",await this.$nextTick(),this.editing=!1,this.$emit("update")},getColClass(){return this.editing===!1&&this.editable===!0?this.darkMode?"column-not-editing-dark":"column-not-editing":""}}};var Tr=function(){var t=this,n=t._self._c;return n(me,{staticClass:"pb-5"},[n(ne,{staticClass:"d-flex align-center justify-start",attrs:{cols:"4"}},[n("span",{staticClass:"text--bold"},[t._v(t._s(t.label))]),t.infoText?n(Te,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:r,attrs:i}){return[n(W,t._g(t._b({staticClass:"ml-2",attrs:{small:""}},"v-icon",i,!1),r),[t._v(" mdi-information-outline ")])]}}],null,!1,3230721012)},[n("span",[t._v(t._s(t.infoText))])]):t._e()],1),n(ne,{class:t.getColClass(),attrs:{cols:"6"},on:{click:t.clicked}},[t.editing&&t.editable?[t.suggestedValues.length>0&&t.strict?n(sr,{ref:"field",attrs:{items:t.suggestedValues,label:t.label,outlined:"",dense:""},on:{blur:t.update,keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}}):t.dataType==="date"||t.dataType==="date-range"?n(_n,{ref:"menu",attrs:{"close-on-content-click":!1,transition:"scale-transition","offset-y":"","min-width":"auto"},scopedSlots:t._u([{key:"activator",fn:function({on:r,attrs:i}){return[n(he,t._g(t._b({ref:"field",attrs:{label:"Picker in menu","prepend-icon":"mdi-calendar",readonly:"",clearable:""},on:{"click:clear":t.clear},model:{value:t.internalValue,callback:function(a){t.internalValue=a},expression:"internalValue"}},"v-text-field",i,!1),r))]}}],null,!1,2992141911),model:{value:t.menu,callback:function(r){t.menu=r},expression:"menu"}},[n($r,{attrs:{outlined:"",dense:"",range:t.dataType==="date-range",min:t.moment().format("YYYY-MM-DD")},on:{blur:t.update,keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}},[n(le),n(J,{attrs:{text:"",color:"primary"},on:{click:function(r){t.menu=!1,t.editing=!1,t.revert()}}},[t._v(" Cancel ")]),n(J,{attrs:{text:"",color:"primary"},on:{click:function(r){t.menu=!1,t.update()}}},[t._v(" OK ")])],1)],1):t.dataType==="string"||t.dataType==="number"?n(he,{ref:"field",staticStyle:{"margin-bottom":"-45px"},attrs:{rules:t.rules,label:t.label,type:t.dataType==="string"?"text":"number",step:t.label==="Jitter"?"0.1":"1",max:t.label==="Jitter"?"1":"",min:"0",outlined:"",dense:"",required:""},on:{blur:t.update},nativeOn:{keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}}):t._e()]:n("span",{staticClass:"ml-3"},[t._v(" "+t._s(t.internalValue)+" ")])],2)],1)},Mr=[],jr=Z(Ar,Tr,Mr,!1,null,null,null,null);const z=jr.exports;const Rr={components:{TagViewer:xn,ClickToEdit:z},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{valid:!0,nameLoading:!1,loading:!1,labelPosition:"left",rules:{},form:{},moment:Ct,workingHoursRules:[e=>/^[0-9]{1,2}:[0-5][0-9]-[0-9]{1,2}:[0-5][0-9]$/.test(e)||"Must be in the format 00:00-24:00"],nameRules:[e=>!!e||"Name is required",e=>!!e&&e.length>2||"Name must be at least 3 characters"],jitterRules:[e=>!Number.isNaN(e)||"Jitter must be a number",e=>e>=0&&e<=1||"Jitter must be between 0 and 1"],delayRules:[e=>!Number.isNaN(e)||"Delay must be a number",e=>e>=0||"Delay must be a positive number"]}},computed:{agentStore(){return wn()},listenerStore(){return zi()},listeners(){return this.listenerStore.listeners},fields(){return Object.keys(this.agent).map(e=>({name:e,Value:typeof this.agent[e]=="boolean"?`${this.agent[e]}`:this.agent[e]}))},requiredFields(){return this.fields.filter(e=>["name"].indexOf(e.name)<0)}},watch:{fields:{immediate:!0,handler(e){const t=e.reduce((n,r)=>{if(r.name==="kill_date"&&r.Value&&r.Value.length>0){const i=r.Value.split("/"),a=i[2],o=i[0],u=i[1];n[r.name]=`${a}-${o}-${u}`}else n[r.name]=r.Value;return n},{});Pe.set(this,"form",t)}}},mounted(){this.listenerStore.getListeners()},methods:{deleteTag(e){Ni(this.agent.session_id,e.id).then(()=>{this.$emit("refresh-agent")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(e){Vi(this.agent.session_id,e).then(()=>{this.$emit("refresh-agent"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(e){qi(this.agent.session_id,e).then(()=>{this.$emit("refresh-agent")}).catch(t=>this.$snack.error(`Error: ${t}`))},async updateName(){if(this.agent.name!==this.form.name){try{await this.agentStore.rename({sessionId:this.agent.session_id,newName:this.form.name})}catch(e){this.$snack.error(`Update agent listener failed: ${e}`);return}this.$snack.info(`Agent ${this.agent.name} name updated`),this.$emit("refresh-agent")}},async updateListener(){if(this.agent.listener!==this.form.listener){try{const e=this.listeners.filter(t=>t.name===this.form.listener)[0].id;await Hi(this.agent.session_id,e)}catch(e){this.$snack.error(`Update agent listener failed: ${e}`);return}this.$snack.info(`Tasked agent to change listener to: ${this.form.listener}`),this.$emit("refresh-agent")}},async updateKillDate(){let e="";if(this.form.kill_date&&this.form.kill_date.length>0&&(e=Ct(this.form.kill_date).format("MM/DD/YYYY")),this.agent.kill_date!==e){try{await Wi(this.agent.session_id,e)}catch(t){this.$snack.error(`Update agent kill date failed: ${t}`);return}this.$snack.info(`Tasked agent to change kill date to: ${e}`),this.$emit("refresh-agent")}},async updateWorkingHours(){if(this.agent.working_hours!==this.form.working_hours){try{await Ui(this.agent.session_id,this.form.working_hours)}catch(e){this.$snack.error(`Update agent working hours failed: ${e}`);return}this.$snack.info(`Tasked agent to change working hours to: ${this.form.working_hours}`),this.$emit("refresh-agent")}},async updateDelay(){if(this.agent.delay!==this.form.delay){try{await vt(this.agent.session_id,this.form.delay,this.form.jitter)}catch(e){this.$snack.error(`Update agent delay failed: ${e}`);return}this.$snack.info(`Tasked agent to change delay to: ${this.form.delay}`),this.$emit("refresh-agent")}},async updateJitter(){if(this.agent.jitter!==this.form.jitter){try{await vt(this.agent.session_id,this.form.delay,this.form.jitter)}catch(e){this.$snack.error(`Update agent delay failed: ${e}`);return}this.$snack.info(`Tasked agent to change jitter to: ${this.form.jitter}`),this.$emit("refresh-agent")}},fieldExists(e){return this.fields.filter(t=>t.name===e).length>0}}};var Or=function(){var t=this,n=t._self._c;return n("div",{staticStyle:{padding:"10px"}},[n(xn,{attrs:{tags:t.agent.tags},on:{"update-tag":t.updateTag,"delete-tag":t.deleteTag,"new-tag":t.addTag}}),t.agent.session_id?n(Oe,{ref:"form",model:{value:t.valid,callback:function(r){t.valid=r},expression:"valid"}},[n(z,{attrs:{label:"Session ID",editable:!1,value:t.form.session_id}}),n(z,{attrs:{label:"Name",rules:t.nameRules,editable:!t.readOnly},on:{update:t.updateName},model:{value:t.form.name,callback:function(r){t.$set(t.form,"name",r)},expression:"form.name"}}),n(z,{attrs:{label:"External IP",value:t.form.external_ip,editable:!1}}),n(z,{attrs:{label:"Internal IP",value:t.form.internal_ip,editable:!1}}),n(z,{attrs:{label:"Host Name",value:t.form.hostname,editable:!1}}),n(z,{attrs:{label:"Username",value:t.form.username,editable:!1}}),n(z,{attrs:{label:"Listener","info-text":"The listener to task the agent to use","data-type":"string","suggested-values":t.listeners.map(r=>r.name),strict:!0,editable:!t.readOnly},on:{update:t.updateListener},model:{value:t.form.listener,callback:function(r){t.$set(t.form,"listener",r)},expression:"form.listener"}}),n(z,{attrs:{label:"Kill Date","data-type":"date","info-text":"Date format: YYYY-MM-DD",editable:!t.readOnly},on:{update:t.updateKillDate},model:{value:t.form.kill_date,callback:function(r){t.$set(t.form,"kill_date",r)},expression:"form.kill_date"}}),n(z,{attrs:{label:"Working Hours","info-text":"Format: 00:00-24:00",rules:t.workingHoursRules,editable:!t.readOnly},on:{update:t.updateWorkingHours},model:{value:t.form.working_hours,callback:function(r){t.$set(t.form,"working_hours",r)},expression:"form.working_hours"}}),n(z,{attrs:{label:"Check In Time",value:t.moment(t.form.checkin_time).fromNow(),editable:!1}}),n(z,{attrs:{label:"Last Seen Time",value:t.moment(t.form.lastseen_time).fromNow(),editable:!1}}),n(z,{attrs:{label:"Delay","info-text":"Delay in seconds before the agent checks in","data-type":"number",rules:t.delayRules,editable:!t.readOnly},on:{update:t.updateDelay},model:{value:t.form.delay,callback:function(r){t.$set(t.form,"delay",r)},expression:"form.delay"}}),n(z,{attrs:{label:"Jitter","info-text":"Randomness in delay as a decimal between 0 and 1","data-type":"number",rules:t.jitterRules,editable:!t.readOnly},on:{update:t.updateJitter},model:{value:t.form.jitter,callback:function(r){t.$set(t.form,"jitter",r)},expression:"form.jitter"}}),n(z,{attrs:{label:"Lost Limit","data-type":"number",editable:!1},model:{value:t.form.lost_limit,callback:function(r){t.$set(t.form,"lost_limit",r)},expression:"form.lost_limit"}}),n(z,{attrs:{label:"OS Details",value:t.form.os_details,editable:!1}}),n(z,{attrs:{label:"Architecture",value:t.form.architecture,editable:!1}}),n(z,{attrs:{label:"Process ID",value:t.form.process_id,editable:!1}}),n(z,{attrs:{label:"Process Name",value:t.form.process_name,editable:!1}}),n(z,{attrs:{label:"Language",value:t.form.language,editable:!1}}),n(z,{attrs:{label:"Language Version",value:t.form.language_version,editable:!1}}),n(z,{attrs:{label:"Profile",value:t.form.profile,editable:!1}})],1):t._e()],1)},Lr=[],Ir=Z(Rr,Or,Lr,!1,null,"3e179fb2",null,null);const In=Ir.exports,zr={components:{AgentExecuteModule:Ne},props:{value:Boolean,loading:{type:Boolean,default:!1},agent:{type:String,required:!0},moduleName:{type:String,required:!0},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{async submit(){this.$refs.executeform.validate()&&(this.$refs.executeform.create(),this.show=!1)}}};var Nr=function(){var t=this,n=t._self._c;return n(Le,{ref:"downloadDialog",attrs:{"max-width":"800px"},model:{value:t.show,callback:function(r){t.show=r},expression:"show"}},[n(ee,[n(Ie,[n("span",{staticClass:"headline"})]),n(fe,[t.show?n(Ne,{ref:"executeform",attrs:{agents:[t.agent],"module-name":t.moduleName,"module-option-defaults":t.moduleOptionDefaults,"show-submit":!1},on:{submitted:t.submit}}):t._e()],1),n(ze,[n(le),n(J,{attrs:{color:"error",text:""},on:{click:function(r){r.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),n(J,{attrs:{color:"primary",loading:t.loading},on:{click:t.submit}},[t._v(" Submit ")])],1)],1)],1)},Vr=[],qr=Z(zr,Nr,Vr,!1,null,null,null,null);const zn=qr.exports;async function wt(e=1e3){return new Promise(t=>setTimeout(t,e))}const Hr={components:{ExecuteModuleDialog:zn},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{files:{html:"mdi-language-html5",js:"mdi-nodejs",json:"mdi-json",md:"mdi-markdown",pdf:"mdi-file-pdf",png:"mdi-file-image",txt:"mdi-file-document-outline",xls:"mdi-file-excel",xlsx:"mdi-file-excel",ppt:"mdi-file-powerpoint",pptx:"mdi-file-powerpoint",jpg:"mdi-file-image",jpeg:"mdi-file-image",gif:"mdi-file-image",doc:"mdi-file-word",docx:"mdi-file-word"},tree:[],open:[],showMenu:!1,menuPosition:{x:0,y:0},selected:{},force:{},currentlyLoading:{},loading:!1,debouncedLoadChildren:null,executeDialog:!1,moduleName:"",moduleOptionDefaults:{}}},computed:{menuItems(){return[{id:"close",name:"Close",fileOption:!1,folderOption:!0},{id:"open",name:"Open",fileOption:!1,folderOption:!0},{id:"refresh",name:"Refresh",fileOption:!1,folderOption:!0},{id:"download",name:"Download to Empire",fileOption:!0,folderOption:!1},{id:"zip",name:"Zip Folder",fileOption:!1,folderOption:!0},{id:"upload",name:"Upload",folderOption:!0,fileOption:!1}].filter(e=>this.selected.file?e.fileOption===!0:e.folderOption===!0).filter(e=>!(e.id==="zip"&&this.agent.language!=="powershell")).filter(e=>{if(e.id==="open"){if(this.open.find(t=>t===this.selected.id))return!1}else if((e.id==="close"||e.id==="refresh")&&!this.open.find(t=>t===this.selected.id))return!1;return!0})}},watch:{agent:{handler(){this.initialize()}}},async mounted(){this.agent&&this.initialize()},methods:{async initialize(){this.debouncedLoadChildren=lr(this.loadChildren,500,{leading:!0}),this.loading=!0;try{const e=await ut(this.agent.session_id,"/");e.sort(this.sortFiles),this.tree=e.map(t=>this.transform(t))}catch{if(this.readOnly){this.loading=!1;return}const t=await this.scrapeDirectory("/");let n=0,r=0;for(;n<10;){if(await wt(6e3),await this.checkTaskComplete(t.id)){r=!0;break}n++}r||this.$snack.error("Agent didn't respond in time. Please try again later.");const i=await ut(this.agent.session_id,"/");i.sort(this.sortFiles),this.tree=i.map(a=>this.transform(a))}this.loading=!1},async clickAction(e){if(e==="open")this.open.push(this.selected.id);else if(e==="close")this.open.splice(this.open.findIndex(t=>t===this.selected.id),1);else if(e==="refresh"){this.selected.children=[];const t=this.$refs.treeview.nodes[this.selected.id];this.open.splice(this.open.findIndex(n=>n===this.selected.id),1),await Pe.nextTick(),t.vnode.hasLoaded=!1,this.force[this.selected.id]=!0,await Pe.nextTick(),this.open.push(this.selected.id)}else e==="download"?(Fn(this.agent.session_id,this.selected.path),this.$snack.success(`Tasked ${this.agent.session_id} for download ${this.selected.path}`)):e==="zip"?this.prepareZip():e==="upload"&&this.$emit("openUploadDialog",{pathToFile:this.selected.path})},prepareZip(){const e={agent:this.agent.session_id,Folder:this.selected.path,ZipFileName:`${this.selected.path}\\${this.selected.path.split("\\").pop()}.zip`};this.moduleName="powershell/management/zipfolder",this.moduleOptionDefaults=e,this.executeDialog=!0},show(e,t){t.preventDefault(),this.showMenu=!1,this.menuPosition.x=t.clientX,this.menuPosition.y=t.clientY,this.selected=e,this.$nextTick(()=>{this.showMenu=!0})},transform(e){return{file:e.is_file===!0?e.name.split(".").pop():!1,...e,children:e.is_file===!1?[]:void 0}},async loadChildren(e,{stopTrying:t}={}){if(this.currentlyLoading[e.id])return Promise.resolve();this.currentlyLoading[e.id]=!0;const n=await ut(this.agent.session_id,e.id);if(n.sort(this.sortFiles),!this.force[e.id]&&n.length>0)return this.removeFromCurrentlyLoading(e.id),e.children=n.map(r=>this.transform(r)),Promise.resolve();if(!t&&!this.readOnly){console.log(t,this.readOnly),this.$snack.success(`Attempting to retrieve directory: ${e.path} with id ${e.id}`);const r=await this.scrapeDirectory(e.path);let i=0,a=!1;for(;i<10;){if(await wt(6e3),await this.checkTaskComplete(r.id)){console.log("task complete",r.id),a=!0;break}i++}return a||this.$snack.error("Agent didn't respond in time. Please try again later."),this.removeFromForce(e.id),this.removeFromCurrentlyLoading(e.id),Promise.resolve(this.loadChildren(e,{stopTrying:!0}))}return this.removeFromForce(e.id),this.removeFromCurrentlyLoading(e.id),Promise.resolve()},removeFromForce(e){this.force[e]&&delete this.force[e]},removeFromCurrentlyLoading(e){this.currentlyLoading[e]&&delete this.currentlyLoading[e]},async scrapeDirectory(e){return Yi(this.agent.session_id,e)},async checkTaskComplete(e){try{return!!(await kn(this.agent.session_id,e)).output}catch{return!1}},sortFiles(e,t){const n=e.name.toLowerCase(),r=t.name.toLowerCase();return nr?1:0}}};var Wr=function(){var t=this,n=t._self._c;return t.agent.language==="ironpython"?n("div",[n(En,{attrs:{prominent:"",type:"error"}},[n(me,{attrs:{align:"center"}},[n(ne,{staticClass:"grow"},[t._v(" The File Browser is not yet implemented for this agent language. ")])],1)],1)],1):n("div",[n(zn,{attrs:{agent:t.agent.session_id,"module-name":t.moduleName,"module-option-defaults":t.moduleOptionDefaults},model:{value:t.executeDialog,callback:function(r){t.executeDialog=r},expression:"executeDialog"}}),t.loading?n(W,{staticClass:"fa-3x fas fa-spinner fa-spin",staticStyle:{width:"50px"}}):t._e(),n(Pr,{ref:"treeview",attrs:{dense:"",hoverable:"","open-on-click":"","item-key":"id","load-children":t.debouncedLoadChildren,open:t.open,items:t.tree},on:{"update:open":function(r){t.open=r}},scopedSlots:t._u([{key:"label",fn:function({item:r,open:i}){return[n(J,{staticClass:"text-left",staticStyle:{"margin-left":"-15px",width:"100%"},attrs:{text:""},on:{contextmenu:function(a){return t.show(r,a)}}},[n("div",{staticStyle:{display:"flex","justify-content":"fle -start"}},[r.file?n(W,[t._v(" "+t._s(t.files[r.file]||"mdi-file")+" ")]):n(W,[t._v(" "+t._s(i?"mdi-folder-open":"mdi-folder")+" ")]),n("span",{staticClass:"ml-2"},[t._v(t._s(r.name))])],1)])]}}])}),n(_n,{attrs:{"position-x":t.menuPosition.x,"position-y":t.menuPosition.y,"close-on-content-click":"",absolute:"","offset-y":""},model:{value:t.showMenu,callback:function(r){t.showMenu=r},expression:"showMenu"}},[n(Ji,t._l(t.menuItems,function(r){return n(Ki,{key:r.id,on:{click:function(i){return t.clickAction(r.id)}}},[n(Gi,[t._v(t._s(r.name))])],1)}),1)],1)],1)},Ur=[],Yr=Z(Hr,Wr,Ur,!1,null,null,null,null);const Nn=Yr.exports;var Ft={},qe={},De={},ge={},xt={exports:{}},Jr=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")};const Kr=Jr;var Bt=e=>typeof e=="string"?e.replace(Kr(),""):e,Pt={exports:{}};const Vn=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);Pt.exports=Vn;Pt.exports.default=Vn;var qn=Pt.exports,Gr=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const Zr=Bt,Xr=qn,Qr=Gr,Hn=e=>{if(typeof e!="string"||e.length===0||(e=Zr(e),e.length===0))return 0;e=e.replace(Qr()," ");let t=0;for(let n=0;n=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,t+=Xr(r)?2:1)}return t};xt.exports=Hn;xt.exports.default=Hn;var ye=xt.exports,q={};const tn="[\uD800-\uDBFF][\uDC00-\uDFFF]",es=e=>e&&e.exact?new RegExp(`^${tn}$`):new RegExp(tn,"g");var ts=es,At={exports:{}},ht,nn;function ns(){return nn||(nn=1,ht={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),ht}var pt,rn;function Wn(){if(rn)return pt;rn=1;const e=ns(),t={};for(const i of Object.keys(e))t[e[i]]=i;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};pt=n;for(const i of Object.keys(n)){if(!("channels"in n[i]))throw new Error("missing channels property: "+i);if(!("labels"in n[i]))throw new Error("missing channel labels property: "+i);if(n[i].labels.length!==n[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:a,labels:o}=n[i];delete n[i].channels,delete n[i].labels,Object.defineProperty(n[i],"channels",{value:a}),Object.defineProperty(n[i],"labels",{value:o})}n.rgb.hsl=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.min(a,o,u),d=Math.max(a,o,u),p=d-c;let f,g;d===c?f=0:a===d?f=(o-u)/p:o===d?f=2+(u-a)/p:u===d&&(f=4+(a-o)/p),f=Math.min(f*60,360),f<0&&(f+=360);const b=(c+d)/2;return d===c?g=0:b<=.5?g=p/(d+c):g=p/(2-d-c),[f,g*100,b*100]},n.rgb.hsv=function(i){let a,o,u,c,d;const p=i[0]/255,f=i[1]/255,g=i[2]/255,b=Math.max(p,f,g),w=b-Math.min(p,f,g),S=function(B){return(b-B)/6/w+1/2};return w===0?(c=0,d=0):(d=w/b,a=S(p),o=S(f),u=S(g),p===b?c=u-o:f===b?c=1/3+a-u:g===b&&(c=2/3+o-a),c<0?c+=1:c>1&&(c-=1)),[c*360,d*100,b*100]},n.rgb.hwb=function(i){const a=i[0],o=i[1];let u=i[2];const c=n.rgb.hsl(i)[0],d=1/255*Math.min(a,Math.min(o,u));return u=1-1/255*Math.max(a,Math.max(o,u)),[c,d*100,u*100]},n.rgb.cmyk=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.min(1-a,1-o,1-u),d=(1-a-c)/(1-c)||0,p=(1-o-c)/(1-c)||0,f=(1-u-c)/(1-c)||0;return[d*100,p*100,f*100,c*100]};function r(i,a){return(i[0]-a[0])**2+(i[1]-a[1])**2+(i[2]-a[2])**2}return n.rgb.keyword=function(i){const a=t[i];if(a)return a;let o=1/0,u;for(const c of Object.keys(e)){const d=e[c],p=r(i,d);p.04045?((a+.055)/1.055)**2.4:a/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,u=u>.04045?((u+.055)/1.055)**2.4:u/12.92;const c=a*.4124+o*.3576+u*.1805,d=a*.2126+o*.7152+u*.0722,p=a*.0193+o*.1192+u*.9505;return[c*100,d*100,p*100]},n.rgb.lab=function(i){const a=n.rgb.xyz(i);let o=a[0],u=a[1],c=a[2];o/=95.047,u/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const d=116*u-16,p=500*(o-u),f=200*(u-c);return[d,p,f]},n.hsl.rgb=function(i){const a=i[0]/360,o=i[1]/100,u=i[2]/100;let c,d,p;if(o===0)return p=u*255,[p,p,p];u<.5?c=u*(1+o):c=u+o-u*o;const f=2*u-c,g=[0,0,0];for(let b=0;b<3;b++)d=a+1/3*-(b-1),d<0&&d++,d>1&&d--,6*d<1?p=f+(c-f)*6*d:2*d<1?p=c:3*d<2?p=f+(c-f)*(2/3-d)*6:p=f,g[b]=p*255;return g},n.hsl.hsv=function(i){const a=i[0];let o=i[1]/100,u=i[2]/100,c=o;const d=Math.max(u,.01);u*=2,o*=u<=1?u:2-u,c*=d<=1?d:2-d;const p=(u+o)/2,f=u===0?2*c/(d+c):2*o/(u+o);return[a,f*100,p*100]},n.hsv.rgb=function(i){const a=i[0]/60,o=i[1]/100;let u=i[2]/100;const c=Math.floor(a)%6,d=a-Math.floor(a),p=255*u*(1-o),f=255*u*(1-o*d),g=255*u*(1-o*(1-d));switch(u*=255,c){case 0:return[u,g,p];case 1:return[f,u,p];case 2:return[p,u,g];case 3:return[p,f,u];case 4:return[g,p,u];case 5:return[u,p,f]}},n.hsv.hsl=function(i){const a=i[0],o=i[1]/100,u=i[2]/100,c=Math.max(u,.01);let d,p;p=(2-o)*u;const f=(2-o)*c;return d=o*c,d/=f<=1?f:2-f,d=d||0,p/=2,[a,d*100,p*100]},n.hwb.rgb=function(i){const a=i[0]/360;let o=i[1]/100,u=i[2]/100;const c=o+u;let d;c>1&&(o/=c,u/=c);const p=Math.floor(6*a),f=1-u;d=6*a-p,p&1&&(d=1-d);const g=o+d*(f-o);let b,w,S;switch(p){default:case 6:case 0:b=f,w=g,S=o;break;case 1:b=g,w=f,S=o;break;case 2:b=o,w=f,S=g;break;case 3:b=o,w=g,S=f;break;case 4:b=g,w=o,S=f;break;case 5:b=f,w=o,S=g;break}return[b*255,w*255,S*255]},n.cmyk.rgb=function(i){const a=i[0]/100,o=i[1]/100,u=i[2]/100,c=i[3]/100,d=1-Math.min(1,a*(1-c)+c),p=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,u*(1-c)+c);return[d*255,p*255,f*255]},n.xyz.rgb=function(i){const a=i[0]/100,o=i[1]/100,u=i[2]/100;let c,d,p;return c=a*3.2406+o*-1.5372+u*-.4986,d=a*-.9689+o*1.8758+u*.0415,p=a*.0557+o*-.204+u*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,c=Math.min(Math.max(0,c),1),d=Math.min(Math.max(0,d),1),p=Math.min(Math.max(0,p),1),[c*255,d*255,p*255]},n.xyz.lab=function(i){let a=i[0],o=i[1],u=i[2];a/=95.047,o/=100,u/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;const c=116*o-16,d=500*(a-o),p=200*(o-u);return[c,d,p]},n.lab.xyz=function(i){const a=i[0],o=i[1],u=i[2];let c,d,p;d=(a+16)/116,c=o/500+d,p=d-u/200;const f=d**3,g=c**3,b=p**3;return d=f>.008856?f:(d-16/116)/7.787,c=g>.008856?g:(c-16/116)/7.787,p=b>.008856?b:(p-16/116)/7.787,c*=95.047,d*=100,p*=108.883,[c,d,p]},n.lab.lch=function(i){const a=i[0],o=i[1],u=i[2];let c;c=Math.atan2(u,o)*360/2/Math.PI,c<0&&(c+=360);const p=Math.sqrt(o*o+u*u);return[a,p,c]},n.lch.lab=function(i){const a=i[0],o=i[1],c=i[2]/360*2*Math.PI,d=o*Math.cos(c),p=o*Math.sin(c);return[a,d,p]},n.rgb.ansi16=function(i,a=null){const[o,u,c]=i;let d=a===null?n.rgb.hsv(i)[2]:a;if(d=Math.round(d/50),d===0)return 30;let p=30+(Math.round(c/255)<<2|Math.round(u/255)<<1|Math.round(o/255));return d===2&&(p+=60),p},n.hsv.ansi16=function(i){return n.rgb.ansi16(n.hsv.rgb(i),i[2])},n.rgb.ansi256=function(i){const a=i[0],o=i[1],u=i[2];return a===o&&o===u?a<8?16:a>248?231:Math.round((a-8)/247*24)+232:16+36*Math.round(a/255*5)+6*Math.round(o/255*5)+Math.round(u/255*5)},n.ansi16.rgb=function(i){let a=i%10;if(a===0||a===7)return i>50&&(a+=3.5),a=a/10.5*255,[a,a,a];const o=(~~(i>50)+1)*.5,u=(a&1)*o*255,c=(a>>1&1)*o*255,d=(a>>2&1)*o*255;return[u,c,d]},n.ansi256.rgb=function(i){if(i>=232){const d=(i-232)*10+8;return[d,d,d]}i-=16;let a;const o=Math.floor(i/36)/5*255,u=Math.floor((a=i%36)/6)/5*255,c=a%6/5*255;return[o,u,c]},n.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},n.hex.rgb=function(i){const a=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let o=a[0];a[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const u=parseInt(o,16),c=u>>16&255,d=u>>8&255,p=u&255;return[c,d,p]},n.rgb.hcg=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.max(Math.max(a,o),u),d=Math.min(Math.min(a,o),u),p=c-d;let f,g;return p<1?f=d/(1-p):f=0,p<=0?g=0:c===a?g=(o-u)/p%6:c===o?g=2+(u-a)/p:g=4+(a-o)/p,g/=6,g%=1,[g*360,p*100,f*100]},n.hsl.hcg=function(i){const a=i[1]/100,o=i[2]/100,u=o<.5?2*a*o:2*a*(1-o);let c=0;return u<1&&(c=(o-.5*u)/(1-u)),[i[0],u*100,c*100]},n.hsv.hcg=function(i){const a=i[1]/100,o=i[2]/100,u=a*o;let c=0;return u<1&&(c=(o-u)/(1-u)),[i[0],u*100,c*100]},n.hcg.rgb=function(i){const a=i[0]/360,o=i[1]/100,u=i[2]/100;if(o===0)return[u*255,u*255,u*255];const c=[0,0,0],d=a%1*6,p=d%1,f=1-p;let g=0;switch(Math.floor(d)){case 0:c[0]=1,c[1]=p,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=p;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=p,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return g=(1-o)*u,[(o*c[0]+g)*255,(o*c[1]+g)*255,(o*c[2]+g)*255]},n.hcg.hsv=function(i){const a=i[1]/100,o=i[2]/100,u=a+o*(1-a);let c=0;return u>0&&(c=a/u),[i[0],c*100,u*100]},n.hcg.hsl=function(i){const a=i[1]/100,u=i[2]/100*(1-a)+.5*a;let c=0;return u>0&&u<.5?c=a/(2*u):u>=.5&&u<1&&(c=a/(2*(1-u))),[i[0],c*100,u*100]},n.hcg.hwb=function(i){const a=i[1]/100,o=i[2]/100,u=a+o*(1-a);return[i[0],(u-a)*100,(1-u)*100]},n.hwb.hcg=function(i){const a=i[1]/100,u=1-i[2]/100,c=u-a;let d=0;return c<1&&(d=(u-c)/(1-c)),[i[0],c*100,d*100]},n.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},n.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},n.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},n.gray.hsl=function(i){return[0,0,i[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(i){return[0,100,i[0]]},n.gray.cmyk=function(i){return[0,0,0,i[0]]},n.gray.lab=function(i){return[i[0],0,0]},n.gray.hex=function(i){const a=Math.round(i[0]/100*255)&255,u=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(u.length)+u},n.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},pt}var ft,sn;function is(){if(sn)return ft;sn=1;const e=Wn();function t(){const a={},o=Object.keys(e);for(let u=o.length,c=0;c1&&(c=d),o(c))};return"conversion"in o&&(u.conversion=o.conversion),u}function a(o){const u=function(...c){const d=c[0];if(d==null)return d;d.length>1&&(c=d);const p=o(c);if(typeof p=="object")for(let f=p.length,g=0;g{n[o]={},Object.defineProperty(n[o],"channels",{value:e[o].channels}),Object.defineProperty(n[o],"labels",{value:e[o].labels});const u=t(o);Object.keys(u).forEach(d=>{const p=u[d];n[o][d]=a(p),n[o][d].raw=i(p)})}),mt=n,mt}At.exports;(function(e){const t=(p,f)=>(...g)=>`\x1B[${p(...g)+f}m`,n=(p,f)=>(...g)=>{const b=p(...g);return`\x1B[${38+f};5;${b}m`},r=(p,f)=>(...g)=>{const b=p(...g);return`\x1B[${38+f};2;${b[0]};${b[1]};${b[2]}m`},i=p=>p,a=(p,f,g)=>[p,f,g],o=(p,f,g)=>{Object.defineProperty(p,f,{get:()=>{const b=g();return Object.defineProperty(p,f,{value:b,enumerable:!0,configurable:!0}),b},enumerable:!0,configurable:!0})};let u;const c=(p,f,g,b)=>{u===void 0&&(u=rs());const w=b?10:0,S={};for(const[B,M]of Object.entries(u)){const j=B==="ansi16"?"ansi":B;B===f?S[j]=p(g,w):typeof M=="object"&&(S[j]=p(M[f],w))}return S};function d(){const p=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[g,b]of Object.entries(f)){for(const[w,S]of Object.entries(b))f[w]={open:`\x1B[${S[0]}m`,close:`\x1B[${S[1]}m`},b[w]=f[w],p.set(S[0],S[1]);Object.defineProperty(f,g,{value:b,enumerable:!1})}return Object.defineProperty(f,"codes",{value:p,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(t,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(n,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(r,"rgb",a,!1)),o(f.bgColor,"ansi",()=>c(t,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(n,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(r,"rgb",a,!0)),f}Object.defineProperty(e,"exports",{enumerable:!0,get:d})})(At);var ss=At.exports;const as=qn,os=ts,on=ss,Un=["\x1B","›"],$e=e=>`${Un[0]}[${e}m`,ln=(e,t,n)=>{let r=[];e=[...e];for(let i of e){const a=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");const o=on.codes.get(Number.parseInt(i,10));if(o){const u=e.indexOf(o.toString());u===-1?r.push($e(t?o:a)):e.splice(u,1)}else if(t){r.push($e(0));break}else r.push($e(a))}if(t&&(r=r.filter((i,a)=>r.indexOf(i)===a),n!==void 0)){const i=$e(on.codes.get(Number.parseInt(n,10)));r=r.reduce((a,o)=>o===i?[o,...a]:[...a,o],[])}return r.join("")};var Tt=(e,t,n)=>{const r=[...e],i=[];let a=typeof n=="number"?n:r.length,o=!1,u,c=0,d="";for(const[p,f]of r.entries()){let g=!1;if(Un.includes(f)){const b=/\d[^m]*/.exec(e.slice(p,p+18));u=b&&b.length>0?b[0]:void 0,ct&&c<=a)d+=f;else if(c===t&&!o&&u!==void 0)d=ln(i);else if(c>=a){d+=ln(i,!0,u);break}}return d},be={};Object.defineProperty(be,"__esModule",{value:!0});be.getBorderCharacters=void 0;const ls=e=>{if(e==="honeywell")return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if(e==="norc")return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if(e==="ramac")return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"};if(e==="void")return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""};throw new Error('Unknown border template "'+e+'".')};be.getBorderCharacters=ls;(function(e){var t=I&&I.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.isCellInRange=e.areCellEqual=e.calculateRangeCoordinate=e.findOriginalRowIndex=e.flatten=e.extractTruncates=e.sumArray=e.sequence=e.distributeUnevenly=e.countSpaceSequence=e.groupBySizes=e.makeBorderConfig=e.splitAnsi=e.normalizeString=void 0;const n=t(Tt),r=t(ye),i=t(Bt),a=be,o=F=>F.replace(/\r\n/g,` `);e.normalizeString=o;const u=F=>{const l=(0,i.default)(F).split(` `).map(r.default),m=[];let A=0;return l.forEach(T=>{m.push(T===0?"":(0,n.default)(F,A,A+T)),A+=T+1}),m};e.splitAnsi=u;const c=F=>({...(0,a.getBorderCharacters)("honeywell"),...F});e.makeBorderConfig=c;const d=(F,l)=>{let m=0;return l.map(A=>{const T=F.slice(m,m+A);return m+=A,T})};e.groupBySizes=d;const p=F=>{var l,m;return(m=(l=F.match(/\s+/g))===null||l===void 0?void 0:l.length)!==null&&m!==void 0?m:0};e.countSpaceSequence=p;const f=(F,l)=>Array.from({length:l}).fill(Math.floor(F/l)).map((A,T)=>A+(TArray.from({length:l-F+1},(m,A)=>A+F);e.sequence=g;const b=F=>F.reduce((l,m)=>l+m,0);e.sumArray=b;const w=F=>F.columns.map(({truncate:l})=>l);e.extractTruncates=w;const S=F=>[].concat(...F);e.flatten=S;const B=(F,l)=>(0,e.flatten)(F.map((A,T)=>Array.from({length:A},()=>T)))[l];e.findOriginalRowIndex=B;const M=F=>{const{row:l,col:m,colSpan:A=1,rowSpan:T=1}=F;return{bottomRight:{col:m+A-1,row:l+T-1},topLeft:{col:m,row:l}}};e.calculateRangeCoordinate=M;const j=(F,l)=>F.row===l.row&&F.col===l.col;e.areCellEqual=j;const H=(F,{topLeft:l,bottomRight:m})=>l.row<=F.row&&F.row<=m.row&&l.col<=F.col&&F.col<=m.col;e.isCellInRange=H})(q);var us=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ge,"__esModule",{value:!0});ge.alignString=void 0;const cs=us(ye),un=q,kt=(e,t)=>e+" ".repeat(t),ds=(e,t)=>" ".repeat(t)+e,hs=(e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2)),ps=(e,t)=>{const n=(0,un.countSpaceSequence)(e);if(n===0)return kt(e,t);const r=(0,un.distributeUnevenly)(t,n);if(Math.max(...r)>3)return kt(e,t);let i=0;return e.replace(/\s+/g,a=>a+" ".repeat(r[i++]))},fs=(e,t,n)=>{const r=(0,cs.default)(e);if(r===t)return e;if(r>t)throw new Error("Subject parameter value width cannot be greater than the container width.");if(r===0)return" ".repeat(t);const i=t-r;return n==="left"?kt(e,i):n==="right"?ds(e,i):n==="justify"?ps(e,i):hs(e,i)};ge.alignString=fs;Object.defineProperty(De,"__esModule",{value:!0});De.alignTableData=void 0;const ms=ge,Ds=(e,t)=>e.map((n,r)=>n.map((i,a)=>{var o;const{width:u,alignment:c}=t.columns[a];return((o=t.spanningCellManager)===null||o===void 0?void 0:o.getContainingRange({col:a,row:r},{mapped:!0}))?i:(0,ms.alignString)(i,u,c)}));De.alignTableData=Ds;var ve={},He={},ue={},We={},Yn=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(We,"__esModule",{value:!0});We.wrapString=void 0;const cn=Yn(Tt),gs=Yn(ye),ys=(e,t)=>{let n=e;const r=[];do r.push((0,cn.default)(n,0,t)),n=(0,cn.default)(n,t).trim();while((0,gs.default)(n));return r};We.wrapString=ys;var Ue={},Jn=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.wrapWord=void 0;const bs=Jn(Tt),vs=Jn(Bt),Cs=(e,t)=>{let n=(0,vs.default)(e);const r=[],i=new RegExp("(^.{1,"+String(Math.max(t,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(t-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let a;const o=i.exec(n);if(o){a=o[0],n=n.slice(a.length);const u=a.trim().length,c=a.length-u;r.push([u,c])}else a=n.slice(0,t),n=n.slice(t),r.push([a.length,0])}while(n.length);return r},_s=(e,t)=>{const n=[];let r=0;return Cs(e,t).forEach(([i,a])=>{n.push((0,bs.default)(e,r,r+i)),r+=i+a}),n};Ue.wrapWord=_s;Object.defineProperty(ue,"__esModule",{value:!0});ue.wrapCell=void 0;const ws=q,Fs=We,ks=Ue,Es=(e,t,n)=>{const r=(0,ws.splitAnsi)(e);for(let i=0;i(0,$s.wrapCell)(e,t,n).length;He.calculateCellHeight=Ss;Object.defineProperty(ve,"__esModule",{value:!0});ve.calculateRowHeights=void 0;const xs=He,dn=q,Bs=(e,t)=>{const n=[];for(const[r,i]of e.entries()){let a=1;i.forEach((o,u)=>{var c;const d=(c=t.spanningCellManager)===null||c===void 0?void 0:c.getContainingRange({col:u,row:r});if(!d){const b=(0,xs.calculateCellHeight)(o,t.columns[u].width,t.columns[u].wrapWord);a=Math.max(a,b);return}const{topLeft:p,bottomRight:f,height:g}=d;if(r===f.row){const b=(0,dn.sumArray)(n.slice(p.row)),w=f.row-p.row,S=(0,dn.sequence)(p.row+1,f.row).filter(M=>{var j;return!(!((j=t.drawHorizontalLine)===null||j===void 0)&&j.call(t,M,e.length))}).length,B=g-b-w+S;a=Math.max(a,B)}}),n.push(a)}return n};ve.calculateRowHeights=Bs;var Mt={},ce={};Object.defineProperty(ce,"__esModule",{value:!0});ce.drawContent=void 0;const Ps=e=>{const{contents:t,separatorGetter:n,drawSeparator:r,spanningCellManager:i,rowIndex:a,elementType:o}=e,u=t.length,c=[];return r(0,u)&&c.push(n(0,u)),t.forEach((d,p)=>{if((!o||o==="border"||o==="row")&&c.push(d),o==="cell"&&a===void 0&&c.push(d),o==="cell"&&a!==void 0){const f=i==null?void 0:i.getContainingRange({col:p,row:a});(!f||p===f.topLeft.col)&&c.push(d)}if(p+1{const{separator:f,horizontalBorderIndex:g,spanningCellManager:b}=p;return d.map((w,S)=>{const B=f.body.repeat(w);if(g===void 0)return B;const M=b==null?void 0:b.getContainingRange({col:S,row:g});if(!M)return B;const{topLeft:j}=M;return g===j.row?B:S!==j.col?"":M.extractBorderContent(g)})};e.drawBorderSegments=n;const r=d=>{const{separator:p,spanningCellManager:f,horizontalBorderIndex:g,rowCount:b}=d;return(w,S)=>{const B=f==null?void 0:f.inSameRange;if(g!==void 0&&B){const M={col:w,row:g-1},j={col:w-1,row:g},H={col:w-1,row:g-1},F={col:w,row:g},l=[[H,M],[M,F],[F,j],[j,H]];if(w===0)return B(F,M)&&p.bodyJoinOuter?p.bodyJoinOuter:p.left;if(w===S)return B(H,j)&&p.bodyJoinOuter?p.bodyJoinOuter:p.right;if(g===0)return B(F,j)?p.body:p.join;if(g===b)return B(M,H)?p.body:p.join;const m=l.map(A=>B(...A)).filter(Boolean).length;if(m===0)return p.join;if(m===4)return"";if(m===2)return B(...l[1])&&B(...l[3])&&p.bodyJoinInner?p.bodyJoinInner:p.body;if(m===1){if(!p.joinRight||!p.joinLeft||!p.joinUp||!p.joinDown)throw new Error(`Can not get border separator for position [${g}, ${w}]`);return B(...l[0])?p.joinDown:B(...l[1])?p.joinLeft:B(...l[2])?p.joinUp:p.joinRight}throw new Error("Invalid case")}return w===0?p.left:w===S?p.right:p.join}};e.createSeparatorGetter=r;const i=(d,p)=>{const f=(0,e.drawBorderSegments)(d,p),{drawVerticalLine:g,horizontalBorderIndex:b,spanningCellManager:w}=p;return(0,t.drawContent)({contents:f,drawSeparator:g,elementType:"border",rowIndex:b,separatorGetter:(0,e.createSeparatorGetter)(p),spanningCellManager:w})+` `};e.drawBorder=i;const a=(d,p)=>{const{border:f}=p,g=(0,e.drawBorder)(d,{...p,separator:{body:f.topBody,join:f.topJoin,left:f.topLeft,right:f.topRight}});return g===` diff --git a/dist/assets/AgentExecuteModule-859d030e.js b/dist/assets/AgentExecuteModule-e502a55e.js similarity index 92% rename from dist/assets/AgentExecuteModule-859d030e.js rename to dist/assets/AgentExecuteModule-e502a55e.js index 5fbb6c8..0bb7775 100644 --- a/dist/assets/AgentExecuteModule-859d030e.js +++ b/dist/assets/AgentExecuteModule-e502a55e.js @@ -1 +1 @@ -import{_ as l,a as c}from"./GeneralForm-ad50630d.js";import{_ as r}from"./TechniqueChips-8d3b8349.js";import{_ as i}from"./InfoViewer-a26545d4.js";import{_ as u,a as d,b as m,c as h}from"./ErrorStateAlert-44af51cd.js";import{e as _}from"./module-api-3f2776ef.js";import{u as g}from"./module-module-a5a9a575.js";import{n as p,H as a,a as o,a8 as f,c as v,a9 as k,aa as y,ab as x,a2 as C}from"./index-e8f29bb9.js";import{_ as b}from"./VDataTable-f3602581.js";const S={components:{InfoViewer:i,GeneralForm:l,TechniqueChips:r,ErrorStateAlert:u},props:{agents:{type:Array,default:()=>[]},showSubmit:{type:Boolean,default:!0},moduleName:{type:String,default:""},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{loading:!1,selectedModule:"",selectedItem:{},results:[],reset:!0,headers:[{text:"Agent",value:"agent"},{text:"Result",value:"result"}],showDialog:!1,form:{},errorState:!1,ignoreAdminCheck:!1,ignoreLanguageCheck:!1}},computed:{moduleStore(){return g()},modules(){return this.moduleStore.modules.filter(s=>s.enabled===!0)},selectOptions(){return this.modules.map(s=>s.id)},moduleOptions(){let{options:s}=this.selectedItem;return s=s||{},s&&s.Agent&&delete s.Agent,Object.keys(this.moduleOptionDefaults||{}).forEach(e=>{s[e]&&(s[e].value=this.moduleOptionDefaults[e])}),s},moduleInfo(){return Object.keys(this.selectedItem).length===0?{}:{authors:this.selectedItem.authors,description:this.selectedItem.description,comments:this.selectedItem.comments,extraDetails:[{key:"Language",value:this.selectedItem.language},{key:"MinLanguageVersion",value:this.selectedItem.min_language_version},{key:"Background",value:this.selectedItem.background},{key:"OpsecSafe",value:this.selectedItem.opsec_safe},{key:"NeedsAdmin",value:this.selectedItem.needs_admin},{key:"OutputExtensions",value:this.selectedItem.output_extensions}]}},errorStateMessage(){return`The resource 'module/${this.moduleName}' Not Found or is Disabled.`}},watch:{modules(s){s.length>0&&this.handleSelect(this.moduleName)},selectedModule(s){this.emitModuleChange(s)},moduleName:{immediate:!0,handler(s){this.selectedModule=s,this.handleSelect(s)}}},async mounted(){await this.moduleStore.getModules()},methods:{async handleSelect(s){if(this.errorState=!1,s===""||s==null){this.reset=!1,this.selectedItem={},setTimeout(()=>{this.reset=!0},500);return}const e=this.modules.find(t=>t.id===s);this.reset=!1,this.selectedItem=e||{},Object.keys(this.selectedItem).length===0&&(this.errorState=!0),setTimeout(()=>{this.reset=!0},500)},rowClass(s){return s.status==="rejected"?"red":""},emitModuleChange(s){this.$emit("moduleChange",s)},validate(){return this.$refs.generalform.$refs.form.validate()},async create(){if(this.agents.length<1||this.loading||!this.validate())return;this.loading=!0;const s=await Promise.allSettled(this.agents.map(e=>_(this.selectedModule,{...this.form,Agent:e},this.ignoreAdminCheck,this.ignoreLanguageCheck)));if(s.some(e=>e.status==="rejected")){const e=s.reduce((t,n)=>(t[n.status].push(n),t),{rejected:[],fulfilled:[]});this.agents.length>1?(this.$snack.warn(`Module failed to execute for ${e.rejected.length} out of ${this.agents.length} agents.`),this.results=s,this.showDialog=!0):this.$snack.error(`Error: ${s[0].reason.error}`)}else{const e=this.agents.length>1?`${this.agents.length} agents.`:`${this.agents[0]}.`;this.$snack.info(`Module execution queued for ${e}`),this.selectedItem={},this.selectedModule="",this.$emit("submitted")}this.loading=!1}}};var I=function(){var e=this,t=e._self._c;return t("div",[e.errorState?t(u,{attrs:{"resource-id":e.moduleName,"resource-type":"module",message:e.errorStateMessage}}):t("div",{staticStyle:{padding:"0 10px 10px 10px"}},[t(i,{staticClass:"info-viewer",attrs:{info:e.moduleInfo}}),t("span",{staticClass:"mr-2 mb-4"},[e._v("Executing on Agents: "+e._s(e.agents.join(", ")))]),t(r,{attrs:{techniques:e.selectedItem.techniques}}),t(c,{attrs:{items:e.selectOptions,loading:!e.reset,placeholder:"Please enter a module name",outlined:"",dense:"",clearable:""},on:{change:e.handleSelect},model:{value:e.selectedModule,callback:function(n){e.selectedModule=n},expression:"selectedModule"}}),e.selectedItem.opsec_safe===!1?t(d,{attrs:{type:"warning"}},[t(m,{attrs:{align:"center"}},[t(h,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" This module is not opsec safe. ")])],1)],1):e._e(),Object.keys(e.selectedItem).length>0?t("div",{staticStyle:{display:"flex","flex-direction":"row"}},[t(a,{staticClass:"pa-1",attrs:{label:"Ignore Admin Check",color:"primary"},model:{value:e.ignoreAdminCheck,callback:function(n){e.ignoreAdminCheck=n},expression:"ignoreAdminCheck"}}),t(a,{staticClass:"pa-1",attrs:{label:"Ignore Language Version Check",color:"primary"},model:{value:e.ignoreLanguageCheck,callback:function(n){e.ignoreLanguageCheck=n},expression:"ignoreLanguageCheck"}})],1):e._e(),e.reset?t(l,{ref:"generalform",attrs:{options:e.moduleOptions},model:{value:e.form,callback:function(n){e.form=n},expression:"form"}}):e._e(),e.showSubmit?t(o,{attrs:{loading:e.loading,color:"primary"},on:{click:e.create}},[e._v(" Submit ")]):e._e(),t(f,{ref:"nameDialog",attrs:{"max-width":"900px"},model:{value:e.showDialog,callback:function(n){e.showDialog=n},expression:"showDialog"}},[t(v,[t(k,[t("span",{staticClass:"headline"},[e._v("Execution Result")])]),t(y,[t(b,{attrs:{dense:"",items:e.results,headers:e.headers,"item-class":e.rowClass},scopedSlots:e._u([{key:"item.agent",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.agent))])]:[t("span",[e._v(e._s(n.value.agent))])]],2)]}},{key:"item.result",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.error))])]:[t("span",[e._v(e._s(n.value.message))])]],2)]}}])})],1),t(x,[t(C),t(o,{attrs:{color:"blue darken-1",text:""},on:{click:function(n){e.showDialog=!1}}},[e._v(" Okay ")])],1)],1)],1)],1)],1)},w=[],M=p(S,I,w,!1,null,"0121eb31",null,null);const T=M.exports;export{T as _}; +import{_ as l,a as c}from"./GeneralForm-e1472145.js";import{_ as r}from"./TechniqueChips-3c9db4c5.js";import{_ as i}from"./InfoViewer-98b37678.js";import{_ as u,a as d,b as m,c as h}from"./ErrorStateAlert-3d45e0aa.js";import{e as _}from"./module-api-04d2f26d.js";import{u as g}from"./module-module-e75169e8.js";import{n as p,H as a,a as o,a8 as f,c as v,a9 as k,aa as y,ab as x,a2 as C}from"./index-e409ba63.js";import{_ as b}from"./VDataTable-dab2ebf1.js";const S={components:{InfoViewer:i,GeneralForm:l,TechniqueChips:r,ErrorStateAlert:u},props:{agents:{type:Array,default:()=>[]},showSubmit:{type:Boolean,default:!0},moduleName:{type:String,default:""},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{loading:!1,selectedModule:"",selectedItem:{},results:[],reset:!0,headers:[{text:"Agent",value:"agent"},{text:"Result",value:"result"}],showDialog:!1,form:{},errorState:!1,ignoreAdminCheck:!1,ignoreLanguageCheck:!1}},computed:{moduleStore(){return g()},modules(){return this.moduleStore.modules.filter(s=>s.enabled===!0)},selectOptions(){return this.modules.map(s=>s.id)},moduleOptions(){let{options:s}=this.selectedItem;return s=s||{},s&&s.Agent&&delete s.Agent,Object.keys(this.moduleOptionDefaults||{}).forEach(e=>{s[e]&&(s[e].value=this.moduleOptionDefaults[e])}),s},moduleInfo(){return Object.keys(this.selectedItem).length===0?{}:{authors:this.selectedItem.authors,description:this.selectedItem.description,comments:this.selectedItem.comments,extraDetails:[{key:"Language",value:this.selectedItem.language},{key:"MinLanguageVersion",value:this.selectedItem.min_language_version},{key:"Background",value:this.selectedItem.background},{key:"OpsecSafe",value:this.selectedItem.opsec_safe},{key:"NeedsAdmin",value:this.selectedItem.needs_admin},{key:"OutputExtensions",value:this.selectedItem.output_extensions}]}},errorStateMessage(){return`The resource 'module/${this.moduleName}' Not Found or is Disabled.`}},watch:{modules(s){s.length>0&&this.handleSelect(this.moduleName)},selectedModule(s){this.emitModuleChange(s)},moduleName:{immediate:!0,handler(s){this.selectedModule=s,this.handleSelect(s)}}},async mounted(){await this.moduleStore.getModules()},methods:{async handleSelect(s){if(this.errorState=!1,s===""||s==null){this.reset=!1,this.selectedItem={},setTimeout(()=>{this.reset=!0},500);return}const e=this.modules.find(t=>t.id===s);this.reset=!1,this.selectedItem=e||{},Object.keys(this.selectedItem).length===0&&(this.errorState=!0),setTimeout(()=>{this.reset=!0},500)},rowClass(s){return s.status==="rejected"?"red":""},emitModuleChange(s){this.$emit("moduleChange",s)},validate(){return this.$refs.generalform.$refs.form.validate()},async create(){if(this.agents.length<1||this.loading||!this.validate())return;this.loading=!0;const s=await Promise.allSettled(this.agents.map(e=>_(this.selectedModule,{...this.form,Agent:e},this.ignoreAdminCheck,this.ignoreLanguageCheck)));if(s.some(e=>e.status==="rejected")){const e=s.reduce((t,n)=>(t[n.status].push(n),t),{rejected:[],fulfilled:[]});this.agents.length>1?(this.$snack.warn(`Module failed to execute for ${e.rejected.length} out of ${this.agents.length} agents.`),this.results=s,this.showDialog=!0):this.$snack.error(`Error: ${s[0].reason.error}`)}else{const e=this.agents.length>1?`${this.agents.length} agents.`:`${this.agents[0]}.`;this.$snack.info(`Module execution queued for ${e}`),this.selectedItem={},this.selectedModule="",this.$emit("submitted")}this.loading=!1}}};var I=function(){var e=this,t=e._self._c;return t("div",[e.errorState?t(u,{attrs:{"resource-id":e.moduleName,"resource-type":"module",message:e.errorStateMessage}}):t("div",{staticStyle:{padding:"0 10px 10px 10px"}},[t(i,{staticClass:"info-viewer",attrs:{info:e.moduleInfo}}),t("span",{staticClass:"mr-2 mb-4"},[e._v("Executing on Agents: "+e._s(e.agents.join(", ")))]),t(r,{attrs:{techniques:e.selectedItem.techniques}}),t(c,{attrs:{items:e.selectOptions,loading:!e.reset,placeholder:"Please enter a module name",outlined:"",dense:"",clearable:""},on:{change:e.handleSelect},model:{value:e.selectedModule,callback:function(n){e.selectedModule=n},expression:"selectedModule"}}),e.selectedItem.opsec_safe===!1?t(d,{attrs:{type:"warning"}},[t(m,{attrs:{align:"center"}},[t(h,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" This module is not opsec safe. ")])],1)],1):e._e(),Object.keys(e.selectedItem).length>0?t("div",{staticStyle:{display:"flex","flex-direction":"row"}},[t(a,{staticClass:"pa-1",attrs:{label:"Ignore Admin Check",color:"primary"},model:{value:e.ignoreAdminCheck,callback:function(n){e.ignoreAdminCheck=n},expression:"ignoreAdminCheck"}}),t(a,{staticClass:"pa-1",attrs:{label:"Ignore Language Version Check",color:"primary"},model:{value:e.ignoreLanguageCheck,callback:function(n){e.ignoreLanguageCheck=n},expression:"ignoreLanguageCheck"}})],1):e._e(),e.reset?t(l,{ref:"generalform",attrs:{options:e.moduleOptions},model:{value:e.form,callback:function(n){e.form=n},expression:"form"}}):e._e(),e.showSubmit?t(o,{attrs:{loading:e.loading,color:"primary"},on:{click:e.create}},[e._v(" Submit ")]):e._e(),t(f,{ref:"nameDialog",attrs:{"max-width":"900px"},model:{value:e.showDialog,callback:function(n){e.showDialog=n},expression:"showDialog"}},[t(v,[t(k,[t("span",{staticClass:"headline"},[e._v("Execution Result")])]),t(y,[t(b,{attrs:{dense:"",items:e.results,headers:e.headers,"item-class":e.rowClass},scopedSlots:e._u([{key:"item.agent",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.agent))])]:[t("span",[e._v(e._s(n.value.agent))])]],2)]}},{key:"item.result",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.error))])]:[t("span",[e._v(e._s(n.value.message))])]],2)]}}])})],1),t(x,[t(C),t(o,{attrs:{color:"blue darken-1",text:""},on:{click:function(n){e.showDialog=!1}}},[e._v(" Okay ")])],1)],1)],1)],1)],1)},w=[],M=p(S,I,w,!1,null,"0121eb31",null,null);const T=M.exports;export{T as _}; diff --git a/dist/assets/AgentTasksList-2ea9239f.js b/dist/assets/AgentTasksList-f6ba31e5.js similarity index 95% rename from dist/assets/AgentTasksList-2ea9239f.js rename to dist/assets/AgentTasksList-f6ba31e5.js index df1070e..e48d128 100644 --- a/dist/assets/AgentTasksList-2ea9239f.js +++ b/dist/assets/AgentTasksList-f6ba31e5.js @@ -1,3 +1,3 @@ -import{_ as h}from"./TagViewer-357f9253.js";import{_ as f}from"./DateTimeDisplay-e5665873.js";import{_}from"./TooltipButton-ef876422.js";import{n as m,ap as I,aq as w,ar as q,I as c,x as $,af as d,as as P,an as A,a as p,at as C,b as o,k as S,d as O,e as u,f as i,a2 as D,C as g,au as B,a1 as U}from"./index-e8f29bb9.js";import{h as T}from"./moment-fbc5633a.js";import{d as F}from"./index-eabf96b4.js";import{A as G}from"./ansi_up-b91c3d1d.js";import{D as k}from"./download-stager-ae353708.js";import{_ as H}from"./VPagination-48f2bf47.js";import{_ as R}from"./VDataTable-f3602581.js";import{_ as L}from"./VSwitch-2cfffd69.js";import{_ as l}from"./ExpansionPanelFilter-33a56e95.js";import{_ as x}from"./ExpansionPanelSearch-155a732a.js";import{_ as b}from"./AdvancedTable-147b64b8.js";import{_ as v}from"./ListPageTop-5130be67.js";import{g as j}from"./tag-api-c942253a.js";const E={name:"AgentTasksTable",components:{DateTimeDisplay:f,TagViewer:h,TooltipButton:_},mixins:[k],props:{agent:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedAgents:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:T,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:F(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Agent",value:"agent_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},agent(){this.debouncedGetTasks()},selectedAgents(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new G().ansi_to_html(t)},deleteTag(t,e){I(t.agent_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.agent_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addBlankLines(t){return` +import{_ as h}from"./TagViewer-81c3b950.js";import{_ as f}from"./DateTimeDisplay-951c60c5.js";import{_}from"./TooltipButton-f53c45a7.js";import{n as m,ap as I,aq as w,ar as q,I as c,x as $,af as d,as as P,an as A,a as p,at as C,b as o,k as S,d as O,e as u,f as i,a2 as D,C as g,au as B,a1 as U}from"./index-e409ba63.js";import{h as T}from"./moment-fbc5633a.js";import{d as F}from"./index-e87896eb.js";import{A as G}from"./ansi_up-7c0d87a9.js";import{D as k}from"./download-stager-ae353708.js";import{_ as H}from"./VPagination-4794e169.js";import{_ as R}from"./VDataTable-dab2ebf1.js";import{_ as L}from"./VSwitch-3f004360.js";import{_ as l}from"./ExpansionPanelFilter-010a2264.js";import{_ as x}from"./ExpansionPanelSearch-94b8e3ac.js";import{_ as b}from"./AdvancedTable-e51651be.js";import{_ as v}from"./ListPageTop-78cbc2f3.js";import{g as j}from"./tag-api-d7e45ad4.js";const E={name:"AgentTasksTable",components:{DateTimeDisplay:f,TagViewer:h,TooltipButton:_},mixins:[k],props:{agent:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedAgents:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:T,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:F(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Agent",value:"agent_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},agent(){this.debouncedGetTasks()},selectedAgents(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new G().ansi_to_html(t)},deleteTag(t,e){I(t.agent_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.agent_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addBlankLines(t){return` ${t} `},addTag(t,e){q(t.agent_id,t.id,e).then(s=>{this.$set(t,"tags",[...t.tags,s]),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},truncateMessage(t){return t?t.length>30?`${t.substr(0,30)}...`:t:""},updateTaskBackgroundColor(t){t.backgroundColor==="black"?t.backgroundColor="white":t.backgroundColor="black",this.expandedTasks[t.uniqueId].backgroundColor=t.backgroundColor,c.set(this.tasks,this.tasks.indexOf(t),t)},isDownload(t){return t.downloads&&t.downloads.length>0},downloadFile(t){$(t.id)},hasOutput(t){return!!t.output},async downloadInput(t){var e;if(t.input){if(!((e=this.expandedTasks[t.uniqueId])!=null&&e.full_input)){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}this.downloadText(this.expandedTasks[t.uniqueId].full_input,`${t.uniqueId}-input.txt`)}},downloadOutput(t){t.output&&this.downloadText(t.output,`${t.uniqueId}-output.txt`)},async copyInput(t){var e;if(t.input){if(!((e=this.expandedTasks[t.uniqueId])!=null&&e.full_input)){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}try{navigator.clipboard.writeText(this.expandedTasks[t.uniqueId].full_input)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}},copyOutput(t){if(t.output)try{navigator.clipboard.writeText(t.output)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}},imageData(t,e){var n;const s=(n=this.expandedTasks[t.uniqueId])==null?void 0:n.downloads;if(s){const a=s.find(r=>r.id===e.id);if(a)return a.image}return null},async getImagesForTask(t){var e;if(!this.expandedTasks[t.uniqueId].imagesRetrieved){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s},this.expandedTasks[t.uniqueId].imagesRetrieved=!0}for(let s=0;s0?(this.sortBy=t.sortBy[0],this.sortDesc=t.sortDesc[0]):(this.sortBy="id",this.sortDesc=!0),this.debouncedGetTasks()},async getTasks(){if(!this.noFilters&&(this.selectedAgents.length===0||this.selectedUsers.length===0)){this.tasks=[],this.currentPage=1,this.totalPages=1,this.totalItems=0;return}this.loading=!0;let t=null;this.selectedAgents.length>0&&(t=this.selectedAgents);const e=await A(t,{page:this.currentPage,limit:this.itemsPerPage,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",users:this.selectedUsers,tags:this.selectedTags,search:this.search});this.currentPage=e.page,this.totalPages=e.total_pages,this.totalItems=e.total,this.tasks=e.records.map(s=>(s.uniqueId=`${s.agent_id}-${s.id}`,this.expandedTasks[s.uniqueId]||(this.expandedTasks[s.uniqueId]={}),this.expandedTasks[s.uniqueId].expandedInput&&(s.expandedInput=!0),this.expandedTasks[s.uniqueId].backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor||"black",s.backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor,this.isAnsi(s.output||"")&&(this.expandedTasks[s.uniqueId].htmlOutput=this.ansiToHtml(s.output)),s)),this.tasks=e.records,this.loading=!1}}};var M=function(){var e=this,s=e._self._c;return s("div",[s(H,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(n){e.currentPage=n},expression:"currentPage"}}),s(R,{attrs:{headers:e.headers,items:e.tasks,"item-key":"uniqueId","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage,"show-expand":""},on:{"update:itemsPerPage":function(n){e.itemsPerPage=n},"update:items-per-page":function(n){e.itemsPerPage=n},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"expanded-item",fn:function({headers:n,item:a}){return[s("td",{attrs:{colspan:n.length}},[s("div",[s("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[s("div",[s(_,{attrs:{icon:a.expandedInput?"fa-minus":"fa-plus",text:"See Full Input","x-small":""},on:{click:function(r){return e.toggleSeeFullInput(a)}}}),a.expandedInput?s("span",[e._v("Showing full input")]):e._e()],1),s(L,{attrs:{"false-value":"white","true-value":"black",label:"Dark Background"},on:{change:function(r){return e.updateTaskBackgroundColor(a)}},model:{value:e.expandedTasks[a.uniqueId].backgroundColor,callback:function(r){e.$set(e.expandedTasks[a.uniqueId],"backgroundColor",r)},expression:"expandedTasks[item.uniqueId].backgroundColor"}})],1),s("p",[s("b",[e._v("Task Input:")])]),s("p",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e._v(" "+e._s(e.addBlankLines(a.expandedInput?e.expandedTasks[a.uniqueId].full_input:a.input))+" ")]),s("p",[s("b",[e._v("Task Output:")])]),a.downloads.length>0&&a.downloads.some(r=>r.filename.match(/[^/]+(jpg|jpeg|png|gif)$/))?s("div",[s(p,{attrs:{text:"","x-small":""},on:{click:function(r){return e.getImagesForTask(a)}}},[e._v(" View Images ")]),s("div",e._l(a.downloads,function(r){return s(C,{key:r.id,attrs:{src:e.imageData(a,r),alt:r.filename,"max-width":700,contain:""}})}),1)],1):e._e(),s("div",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e.expandedTasks[a.uniqueId].htmlOutput?s("div",{domProps:{innerHTML:e._s(e.expandedTasks[a.uniqueId].htmlOutput)}}):s("div",[e._v(" "+e._s(e.addBlankLines(a.output))+" ")])])])])]}},{key:"item.status",fn:function({item:n}){return[n.status==="pulled"?s(o,{attrs:{color:"blue",small:""}},[e._v(" fa-check-square ")]):n.status==="queued"?s(o,{attrs:{color:"orange",small:""}},[e._v(" fa-clock ")]):n.status==="completed"?s(o,{attrs:{color:"green",small:""}},[e._v(" fa-check-circle ")]):n.status==="error"?s(o,{attrs:{color:"red",small:""}},[e._v(" fa-times-circle ")]):n.status==="continuous"?s(o,{attrs:{color:"purple",small:""}},[e._v(" fa-infinity ")]):e._e()]}},e.agent?null:{key:"item.agent_id",fn:function({item:n}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:n.agent_id}}}},[e._v(" "+e._s(n.agent_id)+" ")])]}},{key:"item.input",fn:function({item:n}){return[s("span",[e._v(e._s(e.truncateMessage(n.input)))])]}},{key:"item.task_name",fn:function({item:n}){return[s("span",[e._v(e._s(n.module_name==null?n.task_name:n.module_name))])]}},{key:"item.updated_at",fn:function({item:n}){return[s(f,{attrs:{timestamp:n.updated_at}})]}},{key:"item.tags",fn:function({item:n}){return[s(h,{attrs:{tags:n.tags},on:{"update-tag":function(a){return e.updateTag(n,...arguments)},"delete-tag":function(a){return e.deleteTag(n,...arguments)},"new-tag":function(a){return e.addTag(n,...arguments)}}})]}},{key:"item.actions",fn:function({item:n}){return[s(S,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:r}){return[s(p,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",r,!1),a),[s(o,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(O,{staticClass:"ml-2 mr-2"},[s(u,{key:"downloadInput",attrs:{link:""},on:{click:function(a){return e.downloadInput(n)}}},[s(i,[s(o,[e._v("fa-download")]),e._v(" Download Input ")],1)],1),e.hasOutput(n)?s(u,{key:"downloadOutput",attrs:{link:""},on:{click:function(a){return e.downloadOutput(n)}}},[s(i,[s(o,[e._v("fa-download")]),e._v(" Download Output ")],1)],1):e._e(),s(u,{key:"clipboardInput",attrs:{link:""},on:{click:function(a){return e.copyInput(n)}}},[s(i,[s(o,[e._v("fa-paperclip")]),e._v(" Copy Input to Clipboard ")],1)],1),e.hasOutput(n)?s(u,{key:"clipboardOutput",attrs:{link:""},on:{click:function(a){return e.copyOutput(n)}}},[s(i,[s(o,[e._v("fa-paperclip")]),e._v(" Copy Output to Clipboard ")],1)],1):e._e(),s(D),e._l(n.downloads,function(a){return s(u,{key:"download-"+a.id,attrs:{link:""},on:{click:function(r){return e.downloadFile(a)}}},[s(i,[s(o,[e._v("fa-download")]),e._v(" Download "+e._s(a.filename)+" ")],1)],1)})],2)],1)]}}],null,!0)})],1)},V=[],N=m(E,M,V,!1,null,null,null,null);const y=N.exports;const Y={name:"AgentTasksList",components:{AdvancedTable:b,ExpansionPanelFilter:l,ExpansionPanelSearch:x,AgentTasksTable:y,ListPageTop:v},mixins:[k],props:{agent:{type:Object,required:!1,default:null},useHeader:{type:Boolean,default:!1},refreshTasks:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Agents",disabled:!0,href:"/agents"},{text:"Tasks",disabled:!0,href:"/agents?tab=tasks"}],tasks:[],search:"",loading:!1,moment:T,selectedAgents:[],selectedUsers:[],selectedTags:[],tags:[],autoRefresh:!0}},computed:{agentStore(){return g()},userStore(){return B()},users(){return[...this.userStore.users,{id:0,username:"Non-User"}]},...U(g,["agents"])},watch:{agent:{handler(t){t&&(this.selectedAgents=[t.session_id])},immediate:!0}},async mounted(){await Promise.all([this.agentStore.getAgents(),this.userStore.getUsers(),this.getTags()])},methods:{async getTags(){const t=await j({page:1,limit:-1,sources:"agent_task"}),e=[];t.records.forEach(s=>{e.find(a=>a.name===s.name&&a.value===s.value)||e.push(s)}),this.tags=e},getTasks(){this.$refs.agentTasksTable.debouncedGetTasks()}}};var z=function(){var e=this,s=e._self._c;return s("div",[e.active&&e.useHeader?s(v,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1,"is-auto-refresh":!0,"auto-refresh":e.useHeader?e.autoRefresh:e.refreshTasks,"refresh-text":"Auto-refresh Tasks"},on:{"update:auto-refresh":function(n){e.autoRefresh=n},refresh:e.getTasks}}):e._e(),s(b,{scopedSlots:e._u([{key:"filters",fn:function(){return[s(x,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),e.agent?e._e():s(l,{attrs:{title:"Agents",label:"name","item-key":"session_id","item-value":"session_id",items:e.agents},model:{value:e.selectedAgents,callback:function(n){e.selectedAgents=n},expression:"selectedAgents"}}),s(l,{attrs:{title:"Users",label:"username","item-key":"id","item-value":"id",items:e.users},model:{value:e.selectedUsers,callback:function(n){e.selectedUsers=n},expression:"selectedUsers"}}),s(l,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(n){e.selectedTags=n},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[s(y,{ref:"agentTasksTable",attrs:{agent:e.agent,"refresh-tasks":e.useHeader?e.autoRefresh:e.refreshTasks,"hide-columns":["id","task_name"],"selected-agents":e.selectedAgents,"selected-users":e.selectedUsers,"selected-tags":e.selectedTags,search:e.search},on:{"refresh-tags":e.getTags}})]},proxy:!0}])})],1)},Z=[],J=m(Y,z,Z,!1,null,null,null,null);const pe=J.exports;export{pe as _}; diff --git a/dist/assets/Agents-c9cedcef.js b/dist/assets/Agents-aaf6c77f.js similarity index 92% rename from dist/assets/Agents-c9cedcef.js rename to dist/assets/Agents-aaf6c77f.js index 04e2f05..b2589cf 100644 --- a/dist/assets/Agents-c9cedcef.js +++ b/dist/assets/Agents-aaf6c77f.js @@ -1 +1 @@ -import{_ as y}from"./AgentTasksList-2ea9239f.js";import{_ as A}from"./TagViewer-357f9253.js";import{_ as d}from"./DateTimeDisplay-e5665873.js";import{h as x}from"./moment-fbc5633a.js";import{n as g,C as S,u as b,D as C,E,F,G as L,k as p,a as l,b as r,d as h,e as i,H as f,i as u,c as _,f as o}from"./index-e8f29bb9.js";import{_ as D}from"./VDataTable-f3602581.js";import{_ as P}from"./VTooltip-0015e28c.js";import{_ as T}from"./ExpansionPanelFilter-33a56e95.js";import{_ as $}from"./AdvancedTable-147b64b8.js";import{_ as w}from"./ListPageTop-5130be67.js";import{g as M}from"./tag-api-c942253a.js";import{_ as m}from"./VSwitch-2cfffd69.js";import{_ as R,a as v,b as q,c as k}from"./VTabItem-e0010b3a.js";import"./TooltipButton-ef876422.js";import"./index-eabf96b4.js";import"./ansi_up-b91c3d1d.js";import"./download-stager-ae353708.js";import"./VPagination-48f2bf47.js";import"./ExpansionPanelSearch-155a732a.js";import"./VExpansionPanelHeader-a9447b85.js";import"./VSelect-f55906da.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";const K={name:"AgentsTable",components:{DateTimeDisplay:d,TagViewer:A},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},hideStaleAgents:{type:Boolean,required:!0},hideArchivedAgents:{type:Boolean,required:!0},refreshAgents:{type:Boolean,default:!1}},data(){return{loading:!1,headersFull:[{text:"Name",value:"name",defaultHeader:!0,alwaysShow:!0,order:1},{text:"Last Seen",value:"lastseen_time",defaultHeader:!0,alwaysShow:!0,order:2},{text:"First Seen",value:"checkin_time",defaultHeader:!0,alwaysShow:!0,order:3},{text:"Listener",value:"listener",order:4},{text:"Hostname",value:"hostname",defaultHeader:!0,order:5},{text:"Process",value:"process_name",defaultHeader:!0,order:6},{text:"Process ID",value:"process_id",order:7},{text:"Architecture",value:"architecture",order:8},{text:"Language",value:"language",defaultHeader:!0,order:9},{text:"Language Version",value:"language_version",order:10},{text:"Username",value:"username",defaultHeader:!0,order:11},{text:"Working Hours",value:"working_hours",order:12},{text:"External IP",value:"external_ip",order:13},{text:"Internal IP",value:"internal_ip",defaultHeader:!0,order:14},{text:"Delay",value:"delay",order:15},{text:"Jitter",value:"jitter",order:16},{text:"Tags",value:"tags",order:17},{text:"Actions",value:"actions",defaultHeader:!0,alwaysShow:!0,order:18}],selectedHeadersTemp:[],selected:[],showHeaderMenu:!1,refreshInterval:null,moment:x}},computed:{agentStore(){return S()},applicationStore(){return b()},agents(){return this.agentStore.agents},agentsStatus(){return this.agentStore.status},selectedAll:{set(s){this.selectedHeadersTemp=[...this.staticHeaders],s&&this.headersFull.forEach(e=>{this.selectedHeadersTemp.push(e)})},get(){return this.selectedHeadersTemp.length===this.count}},headers(){return this.headersFull.filter(s=>this.applicationStore.agentHeaders.findIndex(e=>e.text===s.text)>-1).sort((s,e)=>s.order-e.order)},selectableHeaders(){return this.headersFull.filter(s=>!s.alwaysShow)},staticHeaders(){return this.headersFull.filter(s=>s.alwaysShow)},sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>e.checkin_time.localeCompare(t.checkin_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s}},watch:{selectedTags(){this.getAgents()},selected(s){this.$emit("input",s)},refreshAgents:{handler(s){s?(this.getAgents(),this.refreshInterval=setInterval(()=>{this.getAgents()},8e3)):(console.log("Clearing interval"),clearInterval(this.refreshInterval))},immediate:!0}},beforeDestroy(){clearInterval(this.refreshInterval)},async mounted(){this.getAgents(),this.applicationStore.agentHeaders.length===0&&(this.applicationStore.agentHeaders=this.headersFull.filter(s=>s.defaultHeader===!0)),this.selectedHeadersTemp=[...this.applicationStore.agentHeaders]},methods:{deleteTag(s,e){C(s.session_id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){E(s.session_id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){F(s.session_id,e).then(t=>{s.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},submitHeaderForm(){this.applicationStore.agentHeaders=[...this.selectedHeadersTemp],this.showHeaderMenu=!1},getAgents(){this.agentStore.getAgents()},async reloadSysInfo(s){try{await L(s.session_id),this.$snack.success(`SysInfo reload queued for ${s.name}`)}catch(e){this.$snack.error(`Error reloading SysInfo for ${s.name}: ${e.message}`)}},async killAgent(s){this.$emit("kill-agent",s)},popout(s){window.open(`${window.location.href}/${s.name}?hideSideBar=true`,"popup","width=600,height=600")},truncateMessage(s){return s?s.length>30?`${s.substr(0,30)}...`:s:""},rowClass(s){return s.stale?"warning-row":""}}};var B=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"ml-3 mr-3 align-center",staticStyle:{display:"flex","flex-direction":"row-reverse"}},[t("div",{staticStyle:{height:"40px"}}),t(p,{attrs:{"offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:n}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",n,!1),a),[t(r,[e._v("mdi-format-columns")])],1)]}}]),model:{value:e.showHeaderMenu,callback:function(a){e.showHeaderMenu=a},expression:"showHeaderMenu"}},[t(h,{staticStyle:{"overflow-y":"auto"},attrs:{"max-height":"400px"}},[t(i,[t(f,{attrs:{label:"Select All"},model:{value:e.selectedAll,callback:function(a){e.selectedAll=a},expression:"selectedAll"}})],1),t(u,{staticClass:"pb-4"}),e._l(e.selectableHeaders,function(a,n){return t(i,{key:n},[t(f,{attrs:{label:a.text,value:a},model:{value:e.selectedHeadersTemp,callback:function(c){e.selectedHeadersTemp=c},expression:"selectedHeadersTemp"}})],1)})],2),t(_,{staticClass:"pt-4"},[t(l,{staticClass:"mb-4",attrs:{text:""},on:{click:function(a){e.showHeaderMenu=!1}}},[e._v(" Cancel ")]),t(l,{staticClass:"ml-4 mb-4",attrs:{text:""},on:{click:e.submitHeaderForm}},[e._v(" Save ")])],1)],1)],1),t(D,{attrs:{loading:e.agentsStatus==="loading","item-class":e.rowClass,headers:e.headers,items:e.sortedAgents,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"session_id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:a}){return[t(P,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:n}){return[a.high_integrity?t(r,e._g({attrs:{small:""}},n),[e._v(" fa-user-cog ")]):e._e()]}}],null,!0)},[t("span",[e._v("Elevated Process")])]),t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[e._v(" "+e._s(a.name)+" ")])]}},{key:"item.lastseen_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.lastseen_time}})]}},{key:"item.checkin_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.checkin_time}})]}},{key:"item.listener",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:a.listener}}}},[e._v(" "+e._s(a.listener)+" ")])]}},{key:"item.process_name",fn:function({item:a}){return[t("span",[e._v(e._s(e.truncateMessage(a.process_name)))])]}},{key:"item.tags",fn:function({item:a}){return[t(A,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(p,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:c}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",c,!1),n),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(h,{staticClass:"ml-2 mr-2"},[t(i,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[t(o,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(i,{key:"popout",attrs:{link:""},on:{click:function(n){return e.popout(a)}}},[t(o,[t(r,[e._v(" fa-external-link-alt ")]),e._v(" Popout ")],1)],1),t(u,{staticClass:"pb-4"}),t(i,{on:{click:function(n){return e.reloadSysInfo(a)}}},[t(o,[t(r,[e._v("fa-sync")]),e._v(" Reload SysInfo ")],1)],1),t(u,{staticClass:"pb-4"}),t(i,{key:"delete",attrs:{link:""},on:{click:function(n){return e.killAgent(a)}}},[t(o,[t(r,[e._v("fa-trash-alt")]),e._v(" Kill ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)},V=[],X=g(K,B,V,!1,null,"b55092d8",null,null);const H=X.exports;const j={name:"AgentsList",components:{AdvancedTable:$,ExpansionPanelFilter:T,AgentsTable:H,ListPageTop:w},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Agents",disabled:!0,href:"/agents"},{text:"List",disabled:!0,href:"/agents?tab=list-view"}],selected:[],selectedTags:[],tags:[],moment:x,autoRefresh:!0}},computed:{agentStore(){return S()},applicationStore(){return b()},agents(){return this.agentStore.agents},sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>-e.lastseen_time.localeCompare(t.lastseen_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s},showDelete(){return this.selected.length>0}},async mounted(){this.getTags()},methods:{async getTags(){const s=await M({page:1,limit:-1,sources:"agent"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},async killAgents(){await this.$root.$confirm("Kill Agent",`Do you want to kill ${this.selected.length} agents?`,{color:"red"})&&(this.selected.forEach(s=>{this.agentStore.killAgent({sessionId:s.session_id})}),this.$snack.success(`${this.selected.length} agents tasked to run TASK_EXIT.`),this.selected=[])},getAgents(){this.$refs.agentsTable.getAgents()},async killAgent(s){await this.$root.$confirm("Kill Agent",`Do you want to kill agent ${s.name}?`,{color:"red"})&&(this.agentStore.killAgent({sessionId:s.session_id}),this.$snack.success(`Agent ${s.name} tasked to run TASK_EXIT.`))}}};var z=function(){var e=this,t=e._self._c;return t("div",[e.active?t(w,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":e.showDelete,"is-auto-refresh":!0,"auto-refresh":e.autoRefresh,"refresh-text":"Auto-refresh Agents","delete-text":"Kill"},on:{"update:auto-refresh":function(a){e.autoRefresh=a},delete:e.killAgents,refresh:e.getAgents}}):e._e(),t($,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(m,{attrs:{label:"Hide Stale Agents"},model:{value:e.applicationStore.hideStaleAgents,callback:function(a){e.$set(e.applicationStore,"hideStaleAgents",a)},expression:"applicationStore.hideStaleAgents"}}),t(m,{staticClass:"pl-4",attrs:{label:"Hide Archived Agents"},model:{value:e.applicationStore.hideArchivedAgents,callback:function(a){e.$set(e.applicationStore,"hideArchivedAgents",a)},expression:"applicationStore.hideArchivedAgents"}}),t(T,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(H,{ref:"agentsTable",attrs:{"hide-stale-agents":e.applicationStore.hideStaleAgents,"hide-archived-agents":e.applicationStore.hideArchivedAgents,"selected-tags":e.selectedTags,"refresh-agents":e.autoRefresh},on:{"refresh-tags":e.getTags,"kill-agent":e.killAgent},model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})]},proxy:!0}])})],1)},G=[],J=g(j,z,G,!1,null,"dd532cc3",null,null);const I=J.exports;const N={name:"Agents",components:{AgentsList:I,AgentTasksList:y},data(){return{}},computed:{tab:{set(s){this.$router.replace({query:{...this.$route.query,tab:s}})},get(){return this.$route.query.tab||"list-view"}}}};var O=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(R,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(v,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(v,{key:"tasks",attrs:{href:"#tasks"}},[e._v(" Tasks "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-sticky-note ")])],1)],1)],1)]),t(q,{model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(k,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(_,{attrs:{flat:""}},[t(I,{attrs:{active:e.tab==="list-view"}})],1)],1),t(k,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[t(_,{attrs:{flat:""}},[t(y,{attrs:{active:e.tab==="tasks","use-header":!0}})],1)],1)],1)],1)},U=[],W=g(N,O,U,!1,null,null,null,null);const ye=W.exports;export{ye as default}; +import{_ as y}from"./AgentTasksList-f6ba31e5.js";import{_ as A}from"./TagViewer-81c3b950.js";import{_ as d}from"./DateTimeDisplay-951c60c5.js";import{h as x}from"./moment-fbc5633a.js";import{n as g,C as S,u as b,D as C,E,F,G as L,k as p,a as l,b as r,d as h,e as i,H as f,i as u,c as _,f as o}from"./index-e409ba63.js";import{_ as D}from"./VDataTable-dab2ebf1.js";import{_ as P}from"./VTooltip-7c0b187f.js";import{_ as T}from"./ExpansionPanelFilter-010a2264.js";import{_ as $}from"./AdvancedTable-e51651be.js";import{_ as w}from"./ListPageTop-78cbc2f3.js";import{g as M}from"./tag-api-d7e45ad4.js";import{_ as m}from"./VSwitch-3f004360.js";import{_ as R,a as v,b as q,c as k}from"./VTabItem-01f057dc.js";import"./TooltipButton-f53c45a7.js";import"./index-e87896eb.js";import"./ansi_up-7c0d87a9.js";import"./download-stager-ae353708.js";import"./VPagination-4794e169.js";import"./ExpansionPanelSearch-94b8e3ac.js";import"./VExpansionPanelHeader-69136628.js";import"./VSelect-22e7980f.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";const K={name:"AgentsTable",components:{DateTimeDisplay:d,TagViewer:A},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},hideStaleAgents:{type:Boolean,required:!0},hideArchivedAgents:{type:Boolean,required:!0},refreshAgents:{type:Boolean,default:!1}},data(){return{loading:!1,headersFull:[{text:"Name",value:"name",defaultHeader:!0,alwaysShow:!0,order:1},{text:"Last Seen",value:"lastseen_time",defaultHeader:!0,alwaysShow:!0,order:2},{text:"First Seen",value:"checkin_time",defaultHeader:!0,alwaysShow:!0,order:3},{text:"Listener",value:"listener",order:4},{text:"Hostname",value:"hostname",defaultHeader:!0,order:5},{text:"Process",value:"process_name",defaultHeader:!0,order:6},{text:"Process ID",value:"process_id",order:7},{text:"Architecture",value:"architecture",order:8},{text:"Language",value:"language",defaultHeader:!0,order:9},{text:"Language Version",value:"language_version",order:10},{text:"Username",value:"username",defaultHeader:!0,order:11},{text:"Working Hours",value:"working_hours",order:12},{text:"External IP",value:"external_ip",order:13},{text:"Internal IP",value:"internal_ip",defaultHeader:!0,order:14},{text:"Delay",value:"delay",order:15},{text:"Jitter",value:"jitter",order:16},{text:"Tags",value:"tags",order:17},{text:"Actions",value:"actions",defaultHeader:!0,alwaysShow:!0,order:18}],selectedHeadersTemp:[],selected:[],showHeaderMenu:!1,refreshInterval:null,moment:x}},computed:{agentStore(){return S()},applicationStore(){return b()},agents(){return this.agentStore.agents},agentsStatus(){return this.agentStore.status},selectedAll:{set(s){this.selectedHeadersTemp=[...this.staticHeaders],s&&this.headersFull.forEach(e=>{this.selectedHeadersTemp.push(e)})},get(){return this.selectedHeadersTemp.length===this.count}},headers(){return this.headersFull.filter(s=>this.applicationStore.agentHeaders.findIndex(e=>e.text===s.text)>-1).sort((s,e)=>s.order-e.order)},selectableHeaders(){return this.headersFull.filter(s=>!s.alwaysShow)},staticHeaders(){return this.headersFull.filter(s=>s.alwaysShow)},sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>e.checkin_time.localeCompare(t.checkin_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s}},watch:{selectedTags(){this.getAgents()},selected(s){this.$emit("input",s)},refreshAgents:{handler(s){s?(this.getAgents(),this.refreshInterval=setInterval(()=>{this.getAgents()},8e3)):(console.log("Clearing interval"),clearInterval(this.refreshInterval))},immediate:!0}},beforeDestroy(){clearInterval(this.refreshInterval)},async mounted(){this.getAgents(),this.applicationStore.agentHeaders.length===0&&(this.applicationStore.agentHeaders=this.headersFull.filter(s=>s.defaultHeader===!0)),this.selectedHeadersTemp=[...this.applicationStore.agentHeaders]},methods:{deleteTag(s,e){C(s.session_id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){E(s.session_id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){F(s.session_id,e).then(t=>{s.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},submitHeaderForm(){this.applicationStore.agentHeaders=[...this.selectedHeadersTemp],this.showHeaderMenu=!1},getAgents(){this.agentStore.getAgents()},async reloadSysInfo(s){try{await L(s.session_id),this.$snack.success(`SysInfo reload queued for ${s.name}`)}catch(e){this.$snack.error(`Error reloading SysInfo for ${s.name}: ${e.message}`)}},async killAgent(s){this.$emit("kill-agent",s)},popout(s){window.open(`${window.location.href}/${s.name}?hideSideBar=true`,"popup","width=600,height=600")},truncateMessage(s){return s?s.length>30?`${s.substr(0,30)}...`:s:""},rowClass(s){return s.stale?"warning-row":""}}};var B=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"ml-3 mr-3 align-center",staticStyle:{display:"flex","flex-direction":"row-reverse"}},[t("div",{staticStyle:{height:"40px"}}),t(p,{attrs:{"offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:n}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",n,!1),a),[t(r,[e._v("mdi-format-columns")])],1)]}}]),model:{value:e.showHeaderMenu,callback:function(a){e.showHeaderMenu=a},expression:"showHeaderMenu"}},[t(h,{staticStyle:{"overflow-y":"auto"},attrs:{"max-height":"400px"}},[t(i,[t(f,{attrs:{label:"Select All"},model:{value:e.selectedAll,callback:function(a){e.selectedAll=a},expression:"selectedAll"}})],1),t(u,{staticClass:"pb-4"}),e._l(e.selectableHeaders,function(a,n){return t(i,{key:n},[t(f,{attrs:{label:a.text,value:a},model:{value:e.selectedHeadersTemp,callback:function(c){e.selectedHeadersTemp=c},expression:"selectedHeadersTemp"}})],1)})],2),t(_,{staticClass:"pt-4"},[t(l,{staticClass:"mb-4",attrs:{text:""},on:{click:function(a){e.showHeaderMenu=!1}}},[e._v(" Cancel ")]),t(l,{staticClass:"ml-4 mb-4",attrs:{text:""},on:{click:e.submitHeaderForm}},[e._v(" Save ")])],1)],1)],1),t(D,{attrs:{loading:e.agentsStatus==="loading","item-class":e.rowClass,headers:e.headers,items:e.sortedAgents,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"session_id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:a}){return[t(P,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:n}){return[a.high_integrity?t(r,e._g({attrs:{small:""}},n),[e._v(" fa-user-cog ")]):e._e()]}}],null,!0)},[t("span",[e._v("Elevated Process")])]),t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[e._v(" "+e._s(a.name)+" ")])]}},{key:"item.lastseen_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.lastseen_time}})]}},{key:"item.checkin_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.checkin_time}})]}},{key:"item.listener",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:a.listener}}}},[e._v(" "+e._s(a.listener)+" ")])]}},{key:"item.process_name",fn:function({item:a}){return[t("span",[e._v(e._s(e.truncateMessage(a.process_name)))])]}},{key:"item.tags",fn:function({item:a}){return[t(A,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(p,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:c}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",c,!1),n),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(h,{staticClass:"ml-2 mr-2"},[t(i,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[t(o,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(i,{key:"popout",attrs:{link:""},on:{click:function(n){return e.popout(a)}}},[t(o,[t(r,[e._v(" fa-external-link-alt ")]),e._v(" Popout ")],1)],1),t(u,{staticClass:"pb-4"}),t(i,{on:{click:function(n){return e.reloadSysInfo(a)}}},[t(o,[t(r,[e._v("fa-sync")]),e._v(" Reload SysInfo ")],1)],1),t(u,{staticClass:"pb-4"}),t(i,{key:"delete",attrs:{link:""},on:{click:function(n){return e.killAgent(a)}}},[t(o,[t(r,[e._v("fa-trash-alt")]),e._v(" Kill ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)},V=[],X=g(K,B,V,!1,null,"b55092d8",null,null);const H=X.exports;const j={name:"AgentsList",components:{AdvancedTable:$,ExpansionPanelFilter:T,AgentsTable:H,ListPageTop:w},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Agents",disabled:!0,href:"/agents"},{text:"List",disabled:!0,href:"/agents?tab=list-view"}],selected:[],selectedTags:[],tags:[],moment:x,autoRefresh:!0}},computed:{agentStore(){return S()},applicationStore(){return b()},agents(){return this.agentStore.agents},sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>-e.lastseen_time.localeCompare(t.lastseen_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s},showDelete(){return this.selected.length>0}},async mounted(){this.getTags()},methods:{async getTags(){const s=await M({page:1,limit:-1,sources:"agent"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},async killAgents(){await this.$root.$confirm("Kill Agent",`Do you want to kill ${this.selected.length} agents?`,{color:"red"})&&(this.selected.forEach(s=>{this.agentStore.killAgent({sessionId:s.session_id})}),this.$snack.success(`${this.selected.length} agents tasked to run TASK_EXIT.`),this.selected=[])},getAgents(){this.$refs.agentsTable.getAgents()},async killAgent(s){await this.$root.$confirm("Kill Agent",`Do you want to kill agent ${s.name}?`,{color:"red"})&&(this.agentStore.killAgent({sessionId:s.session_id}),this.$snack.success(`Agent ${s.name} tasked to run TASK_EXIT.`))}}};var z=function(){var e=this,t=e._self._c;return t("div",[e.active?t(w,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":e.showDelete,"is-auto-refresh":!0,"auto-refresh":e.autoRefresh,"refresh-text":"Auto-refresh Agents","delete-text":"Kill"},on:{"update:auto-refresh":function(a){e.autoRefresh=a},delete:e.killAgents,refresh:e.getAgents}}):e._e(),t($,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(m,{attrs:{label:"Hide Stale Agents"},model:{value:e.applicationStore.hideStaleAgents,callback:function(a){e.$set(e.applicationStore,"hideStaleAgents",a)},expression:"applicationStore.hideStaleAgents"}}),t(m,{staticClass:"pl-4",attrs:{label:"Hide Archived Agents"},model:{value:e.applicationStore.hideArchivedAgents,callback:function(a){e.$set(e.applicationStore,"hideArchivedAgents",a)},expression:"applicationStore.hideArchivedAgents"}}),t(T,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(H,{ref:"agentsTable",attrs:{"hide-stale-agents":e.applicationStore.hideStaleAgents,"hide-archived-agents":e.applicationStore.hideArchivedAgents,"selected-tags":e.selectedTags,"refresh-agents":e.autoRefresh},on:{"refresh-tags":e.getTags,"kill-agent":e.killAgent},model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})]},proxy:!0}])})],1)},G=[],J=g(j,z,G,!1,null,"dd532cc3",null,null);const I=J.exports;const N={name:"Agents",components:{AgentsList:I,AgentTasksList:y},data(){return{}},computed:{tab:{set(s){this.$router.replace({query:{...this.$route.query,tab:s}})},get(){return this.$route.query.tab||"list-view"}}}};var O=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(R,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(v,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(v,{key:"tasks",attrs:{href:"#tasks"}},[e._v(" Tasks "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-sticky-note ")])],1)],1)],1)]),t(q,{model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(k,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(_,{attrs:{flat:""}},[t(I,{attrs:{active:e.tab==="list-view"}})],1)],1),t(k,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[t(_,{attrs:{flat:""}},[t(y,{attrs:{active:e.tab==="tasks","use-header":!0}})],1)],1)],1)],1)},U=[],W=g(N,O,U,!1,null,null,null,null);const ye=W.exports;export{ye as default}; diff --git a/dist/assets/BypassEdit-0344b1a5.js b/dist/assets/BypassEdit-fec6b0fa.js similarity index 89% rename from dist/assets/BypassEdit-0344b1a5.js rename to dist/assets/BypassEdit-fec6b0fa.js index 5769611..3c8cc50 100644 --- a/dist/assets/BypassEdit-0344b1a5.js +++ b/dist/assets/BypassEdit-fec6b0fa.js @@ -1 +1 @@ -import{_ as i}from"./ErrorStateAlert-44af51cd.js";import{_ as o}from"./EditPageTop-4e0a4ef6.js";import{n,I as u,c as l,a7 as d,j as r}from"./index-e8f29bb9.js";import{u as m,c as p,g as c}from"./bypass-api-80f88682.js";import{u as h}from"./bypass-module-9d0c5e38.js";import{_ as f}from"./VTextarea-9eb75b3d.js";import"./TooltipButton-ef876422.js";import"./VTooltip-0015e28c.js";const y={name:"BypassEdit",components:{ErrorStateAlert:i,EditPageTop:o},data(){return{form:{},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>2||"Name must be larger than 2 characters"],language:[s=>!!s||"Language is required",s=>!!s&&s.length>2||"Language must be larger than 2 characters"],code:[s=>!!s||"Code is required"]},bypass:{},valid:!0,loading:!1,errorState:!1}},computed:{bypassStore(){return h()},isNew(){return this.$route.name==="bypassNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"bypassNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Bypasses",disabled:!1,to:"/bypasses",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/bypasses-edit"}]},breadcrumbName(){return this.isCopy?"New":this.form.name?this.form.name:this.id?this.id:"New"}},watch:{id(s){s&&this.getBypass(s)}},mounted(){!this.isNew||this.isCopy?this.getBypass(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?m(this.form.id,this.form.name,this.form.code,this.form.language).then(()=>{this.$snack.success("Bypass updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):p(this.form.name,this.form.code,this.form.language).then(({id:s})=>{this.$snack.success("Bypass created"),this.loading=!1,this.$router.push({name:"bypassEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},async deleteBypass(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${this.form.name}?`,{color:"red"}))try{this.bypassStore.deleteBypass(this.form.id),this.$router.push({name:"bypasses"})}catch(s){this.$snack.error(`Error: ${s}`)}},getBypass(s){c(s).then(e=>{this.bypass={...e},this.initialLoad=!0,u.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var _=function(){var e=this,t=e._self._c;return t("div",[t(o,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteBypass}}),t("div",{staticClass:"headers"},[t("h3",[e._v(e._s(e.mode)+" Bypass")])]),e.errorState?t(i,{attrs:{"resource-id":e.id,"resource-type":"bypass"}}):t(l,{staticStyle:{padding:"10px"}},[t(d,{ref:"form",nativeOn:{submit:function(a){return a.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(a){e.valid=a},expression:"valid"}},[t(r,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(a){e.$set(e.form,"name",a)},expression:"form.name"}}),t(r,{attrs:{rules:e.rules.language,label:"language",outlined:"",dense:"",required:""},model:{value:e.form.language,callback:function(a){e.$set(e.form,"language",a)},expression:"form.language"}}),t(f,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.code,callback:function(a){e.$set(e.form,"code",a)},expression:"form.code"}})],1)],1)],1)},g=[],b=n(y,_,g,!1,null,null,null,null);const L=b.exports;export{L as default}; +import{_ as i}from"./ErrorStateAlert-3d45e0aa.js";import{_ as o}from"./EditPageTop-0ed1194e.js";import{n,I as u,c as l,a7 as d,j as r}from"./index-e409ba63.js";import{u as m,c as p,g as c}from"./bypass-api-6126dc83.js";import{u as h}from"./bypass-module-4e86a448.js";import{_ as f}from"./VTextarea-14e342fc.js";import"./TooltipButton-f53c45a7.js";import"./VTooltip-7c0b187f.js";const y={name:"BypassEdit",components:{ErrorStateAlert:i,EditPageTop:o},data(){return{form:{},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>2||"Name must be larger than 2 characters"],language:[s=>!!s||"Language is required",s=>!!s&&s.length>2||"Language must be larger than 2 characters"],code:[s=>!!s||"Code is required"]},bypass:{},valid:!0,loading:!1,errorState:!1}},computed:{bypassStore(){return h()},isNew(){return this.$route.name==="bypassNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"bypassNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Bypasses",disabled:!1,to:"/bypasses",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/bypasses-edit"}]},breadcrumbName(){return this.isCopy?"New":this.form.name?this.form.name:this.id?this.id:"New"}},watch:{id(s){s&&this.getBypass(s)}},mounted(){!this.isNew||this.isCopy?this.getBypass(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?m(this.form.id,this.form.name,this.form.code,this.form.language).then(()=>{this.$snack.success("Bypass updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):p(this.form.name,this.form.code,this.form.language).then(({id:s})=>{this.$snack.success("Bypass created"),this.loading=!1,this.$router.push({name:"bypassEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},async deleteBypass(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${this.form.name}?`,{color:"red"}))try{this.bypassStore.deleteBypass(this.form.id),this.$router.push({name:"bypasses"})}catch(s){this.$snack.error(`Error: ${s}`)}},getBypass(s){c(s).then(e=>{this.bypass={...e},this.initialLoad=!0,u.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var _=function(){var e=this,t=e._self._c;return t("div",[t(o,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteBypass}}),t("div",{staticClass:"headers"},[t("h3",[e._v(e._s(e.mode)+" Bypass")])]),e.errorState?t(i,{attrs:{"resource-id":e.id,"resource-type":"bypass"}}):t(l,{staticStyle:{padding:"10px"}},[t(d,{ref:"form",nativeOn:{submit:function(a){return a.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(a){e.valid=a},expression:"valid"}},[t(r,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(a){e.$set(e.form,"name",a)},expression:"form.name"}}),t(r,{attrs:{rules:e.rules.language,label:"language",outlined:"",dense:"",required:""},model:{value:e.form.language,callback:function(a){e.$set(e.form,"language",a)},expression:"form.language"}}),t(f,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.code,callback:function(a){e.$set(e.form,"code",a)},expression:"form.code"}})],1)],1)],1)},g=[],b=n(y,_,g,!1,null,null,null,null);const L=b.exports;export{L as default}; diff --git a/dist/assets/Bypasses-717aa9bf.js b/dist/assets/Bypasses-22c36891.js similarity index 86% rename from dist/assets/Bypasses-717aa9bf.js rename to dist/assets/Bypasses-22c36891.js index 7a8648f..7b1b136 100644 --- a/dist/assets/Bypasses-717aa9bf.js +++ b/dist/assets/Bypasses-22c36891.js @@ -1 +1 @@ -import{_ as l}from"./DateTimeDisplay-e5665873.js";import{_ as c}from"./ListPageTop-5130be67.js";import{h as _}from"./moment-fbc5633a.js";import{u as p}from"./bypass-module-9d0c5e38.js";import{a1 as d,n as m,k as y,a as f,b as o,d as h,e as n,f as r,i as b}from"./index-e8f29bb9.js";import{_ as v}from"./VDataTable-f3602581.js";import"./VTooltip-0015e28c.js";import"./VItemGroup-e39c2c83.js";import"./bypass-api-80f88682.js";import"./VSelect-f55906da.js";const g={name:"Bypasses",components:{DateTimeDisplay:l,ListPageTop:c},data(){return{breads:[{text:"Bypasses",disabled:!0,href:"/bypasses"}],headers:[{text:"Name",value:"name"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:_,selected:[]}},computed:{bypassStore(){return p()},...d(p,["bypasses"]),showDelete(){return this.selected.length>0}},mounted(){this.getBypasses()},methods:{getBypasses(){this.bypassStore.getBypasses()},create(){this.$router.push({name:"bypassNew"})},view(a){this.$router.push({name:"bypassEdit",params:{id:a.id}})},async deleteBypass(a){await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${a.name}?`,{color:"red"})&&await this.bypassStore.deleteBypass(a.id)},async deleteBypasses(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} bypasses?`,{color:"red"})&&this.selected.forEach(a=>{this.bypassStore.deleteBypass(a.id)})}}};var B=function(){var e=this,t=e._self._c;return t("div",[t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteBypasses,refresh:e.getBypasses}}),t(v,{attrs:{headers:e.headers,items:e.bypasses,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(s){e.sortBy=s},"update:sort-by":function(s){e.sortBy=s},"update:sortDesc":function(s){e.sortDesc=s},"update:sort-desc":function(s){e.sortDesc=s}},scopedSlots:e._u([{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.updated_at",fn:function({item:s}){return[t(l,{attrs:{timestamp:s.updated_at}})]}},{key:"item.actions",fn:function({item:s}){return[t(y,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:u}){return[t(f,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",u,!1),i),[t(o,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(h,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:s.id}}}},[t(r,[t(o,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"bypassNew",params:{copy:!0,id:s.id}},link:""}},[t(r,[t(o,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(i){return e.deleteBypass(s)}}},[t(r,[t(o,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},k=[],w=m(g,B,k,!1,null,null,null,null);const L=w.exports;export{L as default}; +import{_ as l}from"./DateTimeDisplay-951c60c5.js";import{_ as c}from"./ListPageTop-78cbc2f3.js";import{h as _}from"./moment-fbc5633a.js";import{u as p}from"./bypass-module-4e86a448.js";import{a1 as d,n as m,k as y,a as f,b as o,d as h,e as n,f as r,i as b}from"./index-e409ba63.js";import{_ as v}from"./VDataTable-dab2ebf1.js";import"./VTooltip-7c0b187f.js";import"./VItemGroup-3637266a.js";import"./bypass-api-6126dc83.js";import"./VSelect-22e7980f.js";const g={name:"Bypasses",components:{DateTimeDisplay:l,ListPageTop:c},data(){return{breads:[{text:"Bypasses",disabled:!0,href:"/bypasses"}],headers:[{text:"Name",value:"name"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:_,selected:[]}},computed:{bypassStore(){return p()},...d(p,["bypasses"]),showDelete(){return this.selected.length>0}},mounted(){this.getBypasses()},methods:{getBypasses(){this.bypassStore.getBypasses()},create(){this.$router.push({name:"bypassNew"})},view(a){this.$router.push({name:"bypassEdit",params:{id:a.id}})},async deleteBypass(a){await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${a.name}?`,{color:"red"})&&await this.bypassStore.deleteBypass(a.id)},async deleteBypasses(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} bypasses?`,{color:"red"})&&this.selected.forEach(a=>{this.bypassStore.deleteBypass(a.id)})}}};var B=function(){var e=this,t=e._self._c;return t("div",[t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteBypasses,refresh:e.getBypasses}}),t(v,{attrs:{headers:e.headers,items:e.bypasses,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(s){e.sortBy=s},"update:sort-by":function(s){e.sortBy=s},"update:sortDesc":function(s){e.sortDesc=s},"update:sort-desc":function(s){e.sortDesc=s}},scopedSlots:e._u([{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.updated_at",fn:function({item:s}){return[t(l,{attrs:{timestamp:s.updated_at}})]}},{key:"item.actions",fn:function({item:s}){return[t(y,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:u}){return[t(f,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",u,!1),i),[t(o,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(h,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:s.id}}}},[t(r,[t(o,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"bypassNew",params:{copy:!0,id:s.id}},link:""}},[t(r,[t(o,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(i){return e.deleteBypass(s)}}},[t(r,[t(o,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},k=[],w=m(g,B,k,!1,null,null,null,null);const L=w.exports;export{L as default}; diff --git a/dist/assets/CredentialEdit-be5ab6a9.js b/dist/assets/CredentialEdit-577ee483.js similarity index 85% rename from dist/assets/CredentialEdit-be5ab6a9.js rename to dist/assets/CredentialEdit-577ee483.js index 27bad61..55b58d4 100644 --- a/dist/assets/CredentialEdit-be5ab6a9.js +++ b/dist/assets/CredentialEdit-577ee483.js @@ -1 +1 @@ -import{_ as a}from"./GeneralForm-ad50630d.js";import{_ as s}from"./ErrorStateAlert-44af51cd.js";import{_ as n}from"./TagViewer-357f9253.js";import{_ as d}from"./EditPageTop-4e0a4ef6.js";import{u as o,d as l,a as u,b as c,c as h,e as p,f as m}from"./credential-module-512a6f9e.js";import{n as f,c as _}from"./index-e8f29bb9.js";import"./VSelect-f55906da.js";import"./VSwitch-2cfffd69.js";import"./bypass-module-9d0c5e38.js";import"./bypass-api-80f88682.js";import"./malleable-module-cb1f5265.js";import"./malleable-api-d0b35547.js";import"./TooltipButton-ef876422.js";import"./VTooltip-0015e28c.js";const g={name:"CredentialEdit",components:{TagViewer:n,GeneralForm:a,ErrorStateAlert:s,EditPageTop:d},data(){return{reset:!0,loading:!1,initialLoad:!1,credential:{},form:{},errorState:!1}},computed:{breads(){return[{text:"Credentials",disabled:!1,to:"/credentials",exact:!0},{text:this.id&&!this.isCopy?`${this.id}`:"New",disabled:!0,to:"/credential-edit"}]},credentialStore(){return o()},isNew(){return this.$route.name==="credentialNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"Edit"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"credentialNew",params:{copy:!0,id:this.id}}:{}},options(){const t={credtype:{required:!0,strict:!0,suggested_values:["plaintext","hash"]},domain:{required:!0},username:{required:!0},password:{required:!0},host:{required:!0},os:{required:!1},sid:{required:!1},notes:{required:!1}};return Object.keys(this.credential).forEach(e=>{e!=="id"&&t[e]&&(t[e].value=this.credential[e])}),t}},watch:{id(t){t&&this.getCredential(t)}},mounted(){!this.isNew||this.isCopy?this.getCredential(this.$route.params.id):this.initialLoad=!0},methods:{deleteTag(t){l(this.credential.id,t.id).then(()=>{this.credential.tags=this.credential.tags.filter(e=>e!==t)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){u(this.credential.id,t).then(e=>{const r=this.credential.tags.findIndex(i=>i.id===e.id);this.credential.tags.splice(r,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){c(this.credential.id,t).then(e=>{this.credential.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?h(this.id,this.form).then(()=>{this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):p(this.form).then(({id:t})=>{this.loading=!1,this.$router.push({name:"credentialEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}),this.loading=!1)},async deleteCredential(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${this.id}?`,{color:"red"}))try{this.credentialStore.deleteCredential(this.id),this.$router.push({name:"credentials"})}catch(t){this.$snack.error(`Error: ${t}`)}},getCredential(t){m(t).then(e=>{this.reset=!1,this.credential=e,this.initialLoad=!0,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var $=function(){var e=this,r=e._self._c;return r("div",[r(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteCredential}}),r("h3",[e._v(e._s(e.mode)+" Credential")]),e.isNew?e._e():r(n,{attrs:{tags:e.credential.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?r(s,{attrs:{"resource-id":e.id,"resource-type":"credential"}}):r(_,{staticStyle:{padding:"10px"}},[e.reset?r(a,{ref:"generalform",attrs:{options:e.options,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},y=[],C=f(g,$,y,!1,null,null,null,null);const z=C.exports;export{z as default}; +import{_ as a}from"./GeneralForm-e1472145.js";import{_ as s}from"./ErrorStateAlert-3d45e0aa.js";import{_ as n}from"./TagViewer-81c3b950.js";import{_ as d}from"./EditPageTop-0ed1194e.js";import{u as o,d as l,a as u,b as c,c as h,e as p,f as m}from"./credential-module-93372e4e.js";import{n as f,c as _}from"./index-e409ba63.js";import"./VSelect-22e7980f.js";import"./VSwitch-3f004360.js";import"./bypass-module-4e86a448.js";import"./bypass-api-6126dc83.js";import"./malleable-module-2a911c2d.js";import"./malleable-api-09135b63.js";import"./TooltipButton-f53c45a7.js";import"./VTooltip-7c0b187f.js";const g={name:"CredentialEdit",components:{TagViewer:n,GeneralForm:a,ErrorStateAlert:s,EditPageTop:d},data(){return{reset:!0,loading:!1,initialLoad:!1,credential:{},form:{},errorState:!1}},computed:{breads(){return[{text:"Credentials",disabled:!1,to:"/credentials",exact:!0},{text:this.id&&!this.isCopy?`${this.id}`:"New",disabled:!0,to:"/credential-edit"}]},credentialStore(){return o()},isNew(){return this.$route.name==="credentialNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"Edit"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"credentialNew",params:{copy:!0,id:this.id}}:{}},options(){const t={credtype:{required:!0,strict:!0,suggested_values:["plaintext","hash"]},domain:{required:!0},username:{required:!0},password:{required:!0},host:{required:!0},os:{required:!1},sid:{required:!1},notes:{required:!1}};return Object.keys(this.credential).forEach(e=>{e!=="id"&&t[e]&&(t[e].value=this.credential[e])}),t}},watch:{id(t){t&&this.getCredential(t)}},mounted(){!this.isNew||this.isCopy?this.getCredential(this.$route.params.id):this.initialLoad=!0},methods:{deleteTag(t){l(this.credential.id,t.id).then(()=>{this.credential.tags=this.credential.tags.filter(e=>e!==t)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){u(this.credential.id,t).then(e=>{const r=this.credential.tags.findIndex(i=>i.id===e.id);this.credential.tags.splice(r,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){c(this.credential.id,t).then(e=>{this.credential.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?h(this.id,this.form).then(()=>{this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):p(this.form).then(({id:t})=>{this.loading=!1,this.$router.push({name:"credentialEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}),this.loading=!1)},async deleteCredential(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${this.id}?`,{color:"red"}))try{this.credentialStore.deleteCredential(this.id),this.$router.push({name:"credentials"})}catch(t){this.$snack.error(`Error: ${t}`)}},getCredential(t){m(t).then(e=>{this.reset=!1,this.credential=e,this.initialLoad=!0,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var $=function(){var e=this,r=e._self._c;return r("div",[r(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteCredential}}),r("h3",[e._v(e._s(e.mode)+" Credential")]),e.isNew?e._e():r(n,{attrs:{tags:e.credential.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?r(s,{attrs:{"resource-id":e.id,"resource-type":"credential"}}):r(_,{staticStyle:{padding:"10px"}},[e.reset?r(a,{ref:"generalform",attrs:{options:e.options,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},y=[],C=f(g,$,y,!1,null,null,null,null);const z=C.exports;export{z as default}; diff --git a/dist/assets/Credentials-4df467c0.js b/dist/assets/Credentials-d1aefd59.js similarity index 88% rename from dist/assets/Credentials-4df467c0.js rename to dist/assets/Credentials-d1aefd59.js index 5684ed9..770df6e 100644 --- a/dist/assets/Credentials-4df467c0.js +++ b/dist/assets/Credentials-d1aefd59.js @@ -1 +1 @@ -import{_ as c}from"./TagViewer-357f9253.js";import{_ as d}from"./ExpansionPanelFilter-33a56e95.js";import{_ as u}from"./ExpansionPanelSearch-155a732a.js";import{_ as p}from"./ListPageTop-5130be67.js";import{d as g}from"./index-eabf96b4.js";import{g as m}from"./tag-api-c942253a.js";import{u as h,d as f,a as v,b as y,g as C}from"./credential-module-512a6f9e.js";import{n as T,c as l,k as b,a as w,b as i,d as x,e as r,f as o,i as k}from"./index-e8f29bb9.js";import{_ as $}from"./VExpansionPanels-26c41551.js";import{_ as S}from"./VDataTable-f3602581.js";import"./VSelect-f55906da.js";import"./VExpansionPanelHeader-a9447b85.js";import"./VTooltip-0015e28c.js";import"./VItemGroup-e39c2c83.js";const E={name:"Credentials",components:{ExpansionPanelFilter:d,ExpansionPanelSearch:u,TagViewer:c,ListPageTop:p},data(){return{breads:[{text:"Credentials",disabled:!0,href:"/credentials"}],headers:[{text:"id",value:"id"},{text:"CredType",value:"credtype"},{text:"Username",value:"username"},{text:"Password",value:"password"},{text:"Domain",value:"domain"},{text:"Host",value:"host"},{text:"Tags",value:"tags",width:300},{text:"Actions",value:"actions",sortable:!1}],selected:[],selectedTags:[],tags:[],search:"",credentials:[],debouncedGetCredentials:g(this.getCredentials,500),loading:!1}},computed:{credentialStore(){return h()},showDelete(){return this.selected.length>0}},watch:{search(){this.debouncedGetCredentials()},selectedTags(){this.debouncedGetCredentials()}},mounted(){this.getCredentials(),this.getTags()},methods:{async getTags(){const s=await m({page:1,limit:-1,sources:"credential"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){f(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){v(s.id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){y(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getCredentials(){this.loading=!0;try{this.credentials=await C({search:this.search,tags:this.selectedTags})}finally{this.loading=!1}},create(){this.$router.push({name:"credentialNew"})},async deleteCredential(s){await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${s.id}?`,{color:"red"})&&(await this.credentialStore.deleteCredential(s.id),this.debouncedGetCredentials())},async deleteCredentials(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} credentials?`,{color:"red"})&&(this.selected.map(async s=>{await this.credentialStore.deleteCredential(s.id)}),this.debouncedGetCredentials())},async copyToClipboard(s){try{await navigator.clipboard.writeText(s),this.$snack.success("Output copied to clipboard")}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}}};var D=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteCredentials,refresh:e.getCredentials}}),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t($,{staticClass:"mb-6",attrs:{multiple:""}},[t(u,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t(S,{attrs:{loading:e.loading,headers:e.headers,items:e.credentials,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.id",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[e._v(" "+e._s(a.id)+" ")])]}},{key:"item.username",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.username)}}},[e._v(" "+e._s(a.username)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.password",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.password)}}},[e._v(" "+e._s(a.password)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.tags",fn:function({item:a}){return[t(c,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(b,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:_}){return[t(w,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",_,!1),n),[t(i,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(x,{staticClass:"ml-2 mr-2"},[t(r,{key:"edit",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[t(o,[t(i,[e._v("fa-pencil-alt")]),e._v(" Edit ")],1)],1)],1),t(r,{key:"copy",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialNew",params:{copy:!0,id:a.id}}}},[t(o,[t(i,[e._v("fa-clone")]),e._v(" Copy ")],1)],1)],1),t(k,{staticClass:"pb-4"}),t(r,{key:"delete",attrs:{link:""},on:{click:function(n){return e.deleteCredential(a)}}},[t(o,[t(i,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)],1)],1)},G=[],P=T(E,D,G,!1,null,null,null,null);const B=P.exports;export{B as default}; +import{_ as c}from"./TagViewer-81c3b950.js";import{_ as d}from"./ExpansionPanelFilter-010a2264.js";import{_ as u}from"./ExpansionPanelSearch-94b8e3ac.js";import{_ as p}from"./ListPageTop-78cbc2f3.js";import{d as g}from"./index-e87896eb.js";import{g as m}from"./tag-api-d7e45ad4.js";import{u as h,d as f,a as v,b as y,g as C}from"./credential-module-93372e4e.js";import{n as T,c as l,k as b,a as w,b as i,d as x,e as r,f as o,i as k}from"./index-e409ba63.js";import{_ as $}from"./VExpansionPanels-cacfd68a.js";import{_ as S}from"./VDataTable-dab2ebf1.js";import"./VSelect-22e7980f.js";import"./VExpansionPanelHeader-69136628.js";import"./VTooltip-7c0b187f.js";import"./VItemGroup-3637266a.js";const E={name:"Credentials",components:{ExpansionPanelFilter:d,ExpansionPanelSearch:u,TagViewer:c,ListPageTop:p},data(){return{breads:[{text:"Credentials",disabled:!0,href:"/credentials"}],headers:[{text:"id",value:"id"},{text:"CredType",value:"credtype"},{text:"Username",value:"username"},{text:"Password",value:"password"},{text:"Domain",value:"domain"},{text:"Host",value:"host"},{text:"Tags",value:"tags",width:300},{text:"Actions",value:"actions",sortable:!1}],selected:[],selectedTags:[],tags:[],search:"",credentials:[],debouncedGetCredentials:g(this.getCredentials,500),loading:!1}},computed:{credentialStore(){return h()},showDelete(){return this.selected.length>0}},watch:{search(){this.debouncedGetCredentials()},selectedTags(){this.debouncedGetCredentials()}},mounted(){this.getCredentials(),this.getTags()},methods:{async getTags(){const s=await m({page:1,limit:-1,sources:"credential"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){f(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){v(s.id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){y(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getCredentials(){this.loading=!0;try{this.credentials=await C({search:this.search,tags:this.selectedTags})}finally{this.loading=!1}},create(){this.$router.push({name:"credentialNew"})},async deleteCredential(s){await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${s.id}?`,{color:"red"})&&(await this.credentialStore.deleteCredential(s.id),this.debouncedGetCredentials())},async deleteCredentials(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} credentials?`,{color:"red"})&&(this.selected.map(async s=>{await this.credentialStore.deleteCredential(s.id)}),this.debouncedGetCredentials())},async copyToClipboard(s){try{await navigator.clipboard.writeText(s),this.$snack.success("Output copied to clipboard")}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}}};var D=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteCredentials,refresh:e.getCredentials}}),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t($,{staticClass:"mb-6",attrs:{multiple:""}},[t(u,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t(S,{attrs:{loading:e.loading,headers:e.headers,items:e.credentials,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.id",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[e._v(" "+e._s(a.id)+" ")])]}},{key:"item.username",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.username)}}},[e._v(" "+e._s(a.username)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.password",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.password)}}},[e._v(" "+e._s(a.password)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.tags",fn:function({item:a}){return[t(c,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(b,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:_}){return[t(w,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",_,!1),n),[t(i,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(x,{staticClass:"ml-2 mr-2"},[t(r,{key:"edit",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[t(o,[t(i,[e._v("fa-pencil-alt")]),e._v(" Edit ")],1)],1)],1),t(r,{key:"copy",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialNew",params:{copy:!0,id:a.id}}}},[t(o,[t(i,[e._v("fa-clone")]),e._v(" Copy ")],1)],1)],1),t(k,{staticClass:"pb-4"}),t(r,{key:"delete",attrs:{link:""},on:{click:function(n){return e.deleteCredential(a)}}},[t(o,[t(i,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)],1)],1)},G=[],P=T(E,D,G,!1,null,null,null,null);const B=P.exports;export{B as default}; diff --git a/dist/assets/DateTimeDisplay-e5665873.js b/dist/assets/DateTimeDisplay-951c60c5.js similarity index 89% rename from dist/assets/DateTimeDisplay-e5665873.js rename to dist/assets/DateTimeDisplay-951c60c5.js index 56914a0..29f5725 100644 --- a/dist/assets/DateTimeDisplay-e5665873.js +++ b/dist/assets/DateTimeDisplay-951c60c5.js @@ -1 +1 @@ -import{h as _}from"./moment-fbc5633a.js";import{n as o}from"./index-e8f29bb9.js";import{_ as s}from"./VTooltip-0015e28c.js";const r={name:"DateTimeDisplay",props:{timestamp:{type:String,required:!0}},data(){return{moment:_}}};var m=function(){var t=this,n=t._self._c;return n(s,{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function({on:e}){return[n("span",t._g({},e),[t._v(t._s(t.moment(t.timestamp).fromNow()))])]}}])},[n("span",[t._v(t._s(t.moment(t.timestamp).format("MMM D YYYY, h:mm:ss a")))])])},a=[],p=o(r,m,a,!1,null,null,null,null);const f=p.exports;export{f as _}; +import{h as _}from"./moment-fbc5633a.js";import{n as o}from"./index-e409ba63.js";import{_ as s}from"./VTooltip-7c0b187f.js";const r={name:"DateTimeDisplay",props:{timestamp:{type:String,required:!0}},data(){return{moment:_}}};var m=function(){var t=this,n=t._self._c;return n(s,{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function({on:e}){return[n("span",t._g({},e),[t._v(t._s(t.moment(t.timestamp).fromNow()))])]}}])},[n("span",[t._v(t._s(t.moment(t.timestamp).format("MMM D YYYY, h:mm:ss a")))])])},a=[],p=o(r,m,a,!1,null,null,null,null);const f=p.exports;export{f as _}; diff --git a/dist/assets/Downloads-58de5b41.js b/dist/assets/Downloads-5f65309f.js similarity index 87% rename from dist/assets/Downloads-58de5b41.js rename to dist/assets/Downloads-5f65309f.js index 7f52058..3f1c22f 100644 --- a/dist/assets/Downloads-58de5b41.js +++ b/dist/assets/Downloads-5f65309f.js @@ -1 +1 @@ -import{_ as d}from"./TagViewer-357f9253.js";import{_ as r}from"./DateTimeDisplay-e5665873.js";import{_ as i}from"./ExpansionPanelFilter-33a56e95.js";import{_ as u}from"./ExpansionPanelSearch-155a732a.js";import{_ as g}from"./TooltipButton-ef876422.js";import{_ as p}from"./ListPageTop-5130be67.js";import{n as m,ay as _,az as h,aA as f,aB as v,x as b,aC as w,c as l,k as y,a as x,b as c,d as P,a2 as T,e as D,f as k}from"./index-e8f29bb9.js";import{d as B}from"./index-eabf96b4.js";import{h as S}from"./moment-fbc5633a.js";import{g as $}from"./tag-api-c942253a.js";import{_ as F}from"./VExpansionPanels-26c41551.js";import{_ as C}from"./VPagination-48f2bf47.js";import{_ as G}from"./VDataTable-f3602581.js";import"./VSelect-f55906da.js";import"./VTooltip-0015e28c.js";import"./VExpansionPanelHeader-a9447b85.js";import"./VItemGroup-e39c2c83.js";const E={name:"Downloads",components:{DateTimeDisplay:r,ExpansionPanelSearch:u,ExpansionPanelFilter:i,TagViewer:d,ListPageTop:p,TooltipButton:g},data(){return{moment:S,items:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,sortBy:"updated_at",sortDesc:!0,loading:!1,search:"",breads:[{text:"Downloads",disabled:!0,href:"/downloads"}],headers:[{text:"Id",value:"id",sortable:!1},{text:"Filename",value:"filename",sortable:!0},{text:"Location",value:"location",sortable:!0},{text:"Size",value:"size",sortable:!0},{text:"Created At",value:"created_at",sortable:!0},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],isSelecting:!1,selectedFile:null,selectedSources:[],sources:[{label:"Upload",value:"upload"},{label:"Agent Task",value:"agent_task"},{label:"Agent File",value:"agent_file"},{label:"Stager",value:"stager"}],selectedTags:[],tags:[],debouncedGetDownloads:B(this.getDownloads,500)}},watch:{search(){this.debouncedGetDownloads()},selectedSources(){this.debouncedGetDownloads()},selectedTags(){this.debouncedGetDownloads()}},async mounted(){this.selectedSources=this.sources.map(s=>s.value),this.getTags(),this.getDownloads()},methods:{async getTags(){const s=await $({page:1,limit:-1,sources:"download"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){_(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){h(s.id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){f(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getDownloads(){this.loading=!0;const s=await v({page:this.currentPage,limit:this.itemsPerPage,query:this.search,sources:this.selectedSources,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",tags:this.selectedTags});this.items=s.records,this.currentPage=s.page,this.totalPages=s.total_pages,this.totalItems=s.total,this.loading=!1},downloadFile(s){b(s.id)},async refreshDownloads(){this.debouncedGetDownloads()},handleFileImport(){this.isSelecting=!0,window.addEventListener("focus",()=>{this.isSelecting=!1},{once:!0}),this.$refs.uploader.click()},async onFileChanged(s){this.selectedFile=s.target.files[0];const e=new FormData;e.append("file",this.selectedFile),await w(e),this.$snack.success("Upload complete"),this.debouncedGetDownloads()},handlePageChange(s){this.currentPage=s,this.debouncedGetDownloads()},handleOptionsChange(s){this.currentPage=s.page,this.itemsPerPage=s.itemsPerPage,s.sortBy.length>0?(this.sortBy=s.sortBy[0],this.sortDesc=s.sortDesc[0]):(this.sortBy="updated_at",this.sortDesc=!0),this.debouncedGetDownloads()},formatBytes(s,e){if(s===0)return"0 Bytes";const t=1024,a=e||2,n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(s)/Math.log(t));return`${parseFloat((s/t**o).toFixed(a))} ${n[o]}`}}};var I=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refreshDownloads}},[t("template",{slot:"extra-stuff"},[t(g,{attrs:{icon:"fa-upload",text:"Upload"},on:{click:e.handleFileImport}}),t("input",{ref:"uploader",staticClass:"d-none",attrs:{type:"file","aria-label":"uploader"},on:{change:e.onFileChanged}})],1)],2),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(F,{staticClass:"mb-6",attrs:{multiple:""}},[t(u,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(i,{attrs:{title:"Source",label:"label","item-key":"value","item-value":"value",items:e.sources},model:{value:e.selectedSources,callback:function(a){e.selectedSources=a},expression:"selectedSources"}}),t(i,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t(C,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(a){e.currentPage=a},expression:"currentPage"}}),t(G,{attrs:{headers:e.headers,items:e.items,"item-key":"id","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage},on:{"update:itemsPerPage":function(a){e.itemsPerPage=a},"update:items-per-page":function(a){e.itemsPerPage=a},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"item.updated_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.updated_at}})]}},{key:"item.created_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.created_at}})]}},{key:"item.size",fn:function({item:a}){return[t("span",[e._v(e._s(e.formatBytes(a.size)))])]}},{key:"item.tags",fn:function({item:a}){return[t(d,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(y,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:o}){return[t(x,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),n),[t(c,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(P,{staticClass:"ml-2 mr-2"},[t(T),t(D,{attrs:{link:""},on:{click:function(n){return e.downloadFile(a)}}},[t(k,[t(c,[e._v("fa-download")]),e._v(" Download ")],1)],1)],1)],1)]}}])})],1)],1)],1)},z=[],A=m(E,I,z,!1,null,null,null,null);const ee=A.exports;export{ee as default}; +import{_ as d}from"./TagViewer-81c3b950.js";import{_ as r}from"./DateTimeDisplay-951c60c5.js";import{_ as i}from"./ExpansionPanelFilter-010a2264.js";import{_ as u}from"./ExpansionPanelSearch-94b8e3ac.js";import{_ as g}from"./TooltipButton-f53c45a7.js";import{_ as p}from"./ListPageTop-78cbc2f3.js";import{n as m,ay as _,az as h,aA as f,aB as v,x as b,aC as w,c as l,k as y,a as x,b as c,d as P,a2 as T,e as D,f as k}from"./index-e409ba63.js";import{d as B}from"./index-e87896eb.js";import{h as S}from"./moment-fbc5633a.js";import{g as $}from"./tag-api-d7e45ad4.js";import{_ as F}from"./VExpansionPanels-cacfd68a.js";import{_ as C}from"./VPagination-4794e169.js";import{_ as G}from"./VDataTable-dab2ebf1.js";import"./VSelect-22e7980f.js";import"./VTooltip-7c0b187f.js";import"./VExpansionPanelHeader-69136628.js";import"./VItemGroup-3637266a.js";const E={name:"Downloads",components:{DateTimeDisplay:r,ExpansionPanelSearch:u,ExpansionPanelFilter:i,TagViewer:d,ListPageTop:p,TooltipButton:g},data(){return{moment:S,items:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,sortBy:"updated_at",sortDesc:!0,loading:!1,search:"",breads:[{text:"Downloads",disabled:!0,href:"/downloads"}],headers:[{text:"Id",value:"id",sortable:!1},{text:"Filename",value:"filename",sortable:!0},{text:"Location",value:"location",sortable:!0},{text:"Size",value:"size",sortable:!0},{text:"Created At",value:"created_at",sortable:!0},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],isSelecting:!1,selectedFile:null,selectedSources:[],sources:[{label:"Upload",value:"upload"},{label:"Agent Task",value:"agent_task"},{label:"Agent File",value:"agent_file"},{label:"Stager",value:"stager"}],selectedTags:[],tags:[],debouncedGetDownloads:B(this.getDownloads,500)}},watch:{search(){this.debouncedGetDownloads()},selectedSources(){this.debouncedGetDownloads()},selectedTags(){this.debouncedGetDownloads()}},async mounted(){this.selectedSources=this.sources.map(s=>s.value),this.getTags(),this.getDownloads()},methods:{async getTags(){const s=await $({page:1,limit:-1,sources:"download"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){_(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){h(s.id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){f(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getDownloads(){this.loading=!0;const s=await v({page:this.currentPage,limit:this.itemsPerPage,query:this.search,sources:this.selectedSources,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",tags:this.selectedTags});this.items=s.records,this.currentPage=s.page,this.totalPages=s.total_pages,this.totalItems=s.total,this.loading=!1},downloadFile(s){b(s.id)},async refreshDownloads(){this.debouncedGetDownloads()},handleFileImport(){this.isSelecting=!0,window.addEventListener("focus",()=>{this.isSelecting=!1},{once:!0}),this.$refs.uploader.click()},async onFileChanged(s){this.selectedFile=s.target.files[0];const e=new FormData;e.append("file",this.selectedFile),await w(e),this.$snack.success("Upload complete"),this.debouncedGetDownloads()},handlePageChange(s){this.currentPage=s,this.debouncedGetDownloads()},handleOptionsChange(s){this.currentPage=s.page,this.itemsPerPage=s.itemsPerPage,s.sortBy.length>0?(this.sortBy=s.sortBy[0],this.sortDesc=s.sortDesc[0]):(this.sortBy="updated_at",this.sortDesc=!0),this.debouncedGetDownloads()},formatBytes(s,e){if(s===0)return"0 Bytes";const t=1024,a=e||2,n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(s)/Math.log(t));return`${parseFloat((s/t**o).toFixed(a))} ${n[o]}`}}};var I=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refreshDownloads}},[t("template",{slot:"extra-stuff"},[t(g,{attrs:{icon:"fa-upload",text:"Upload"},on:{click:e.handleFileImport}}),t("input",{ref:"uploader",staticClass:"d-none",attrs:{type:"file","aria-label":"uploader"},on:{change:e.onFileChanged}})],1)],2),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(F,{staticClass:"mb-6",attrs:{multiple:""}},[t(u,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(i,{attrs:{title:"Source",label:"label","item-key":"value","item-value":"value",items:e.sources},model:{value:e.selectedSources,callback:function(a){e.selectedSources=a},expression:"selectedSources"}}),t(i,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t(C,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(a){e.currentPage=a},expression:"currentPage"}}),t(G,{attrs:{headers:e.headers,items:e.items,"item-key":"id","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage},on:{"update:itemsPerPage":function(a){e.itemsPerPage=a},"update:items-per-page":function(a){e.itemsPerPage=a},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"item.updated_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.updated_at}})]}},{key:"item.created_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.created_at}})]}},{key:"item.size",fn:function({item:a}){return[t("span",[e._v(e._s(e.formatBytes(a.size)))])]}},{key:"item.tags",fn:function({item:a}){return[t(d,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(y,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:o}){return[t(x,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),n),[t(c,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(P,{staticClass:"ml-2 mr-2"},[t(T),t(D,{attrs:{link:""},on:{click:function(n){return e.downloadFile(a)}}},[t(k,[t(c,[e._v("fa-download")]),e._v(" Download ")],1)],1)],1)],1)]}}])})],1)],1)],1)},z=[],A=m(E,I,z,!1,null,null,null,null);const ee=A.exports;export{ee as default}; diff --git a/dist/assets/EditPageTop-4e0a4ef6.js b/dist/assets/EditPageTop-0ed1194e.js similarity index 89% rename from dist/assets/EditPageTop-4e0a4ef6.js rename to dist/assets/EditPageTop-0ed1194e.js index ff0e5c8..5f2ad63 100644 --- a/dist/assets/EditPageTop-4e0a4ef6.js +++ b/dist/assets/EditPageTop-0ed1194e.js @@ -1 +1 @@ -import{_ as a}from"./TooltipButton-ef876422.js";import{n,a2 as i,a as o,b as l}from"./index-e8f29bb9.js";import{a as r}from"./VTooltip-0015e28c.js";const p={name:"ListPageTop",components:{TooltipButton:a},props:{deleteText:{type:String,default:"Delete"},copyText:{type:String,default:"Copy"},submitText:{type:String,default:"Submit"},showDelete:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},showSubmit:{type:Boolean,default:!1},disableSubmit:{type:Boolean},submitLoading:{type:Boolean,default:!1},copyLink:{type:Object,default:()=>{}},smallCopy:{type:Boolean,default:!1},smallDelete:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}}};var _=function(){var t=this,e=t._self._c;return e("portal",{attrs:{to:"app-bar"}},[e("div",{staticClass:"v-toolbar__content pt-2",staticStyle:{width:"100%"}},[e(r,{attrs:{items:t.breads}}),e(i),e("div",{staticClass:"pt-2"},[t._t("extra-stuff")],2),t.showDelete&&!t.smallDelete?e(o,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(s){return t.$emit("delete")}}},[t._v(" "+t._s(t.deleteText)+" "),e(l,{attrs:{right:""}},[t._v(" fa-trash-alt ")])],1):t.showDelete&&t.smallDelete?e(a,{attrs:{icon:"fa-trash-alt",color:"error",text:t.deleteText},on:{click:function(s){return t.$emit("delete")}}}):t._e(),t.showCopy&&Object.keys(t.copyLink).length>0&&!t.smallCopy?e(o,{staticClass:"mr-2",attrs:{color:"primary",text:"",to:t.copyLink}},[t._v(" "+t._s(t.copyText)+" "),e(l,{attrs:{right:""}},[t._v(" fa-copy ")])],1):t.showCopy&&Object.keys(t.copyLink).length>0&&t.smallCopy?e(a,{attrs:{icon:"fa-copy",text:t.copyText,to:t.copyLink}}):t._e(),t.showSubmit?e(o,{staticClass:"primary",attrs:{disabled:t.disableSubmit,type:"submit",loading:t.submitLoading},on:{click:function(s){return t.$emit("submit")}}},[t._v(" "+t._s(t.submitText)+" ")]):t._e()],1)])},c=[],u=n(p,_,c,!1,null,null,null,null);const b=u.exports;export{b as _}; +import{_ as a}from"./TooltipButton-f53c45a7.js";import{n,a2 as i,a as o,b as l}from"./index-e409ba63.js";import{a as r}from"./VTooltip-7c0b187f.js";const p={name:"ListPageTop",components:{TooltipButton:a},props:{deleteText:{type:String,default:"Delete"},copyText:{type:String,default:"Copy"},submitText:{type:String,default:"Submit"},showDelete:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},showSubmit:{type:Boolean,default:!1},disableSubmit:{type:Boolean},submitLoading:{type:Boolean,default:!1},copyLink:{type:Object,default:()=>{}},smallCopy:{type:Boolean,default:!1},smallDelete:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}}};var _=function(){var t=this,e=t._self._c;return e("portal",{attrs:{to:"app-bar"}},[e("div",{staticClass:"v-toolbar__content pt-2",staticStyle:{width:"100%"}},[e(r,{attrs:{items:t.breads}}),e(i),e("div",{staticClass:"pt-2"},[t._t("extra-stuff")],2),t.showDelete&&!t.smallDelete?e(o,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(s){return t.$emit("delete")}}},[t._v(" "+t._s(t.deleteText)+" "),e(l,{attrs:{right:""}},[t._v(" fa-trash-alt ")])],1):t.showDelete&&t.smallDelete?e(a,{attrs:{icon:"fa-trash-alt",color:"error",text:t.deleteText},on:{click:function(s){return t.$emit("delete")}}}):t._e(),t.showCopy&&Object.keys(t.copyLink).length>0&&!t.smallCopy?e(o,{staticClass:"mr-2",attrs:{color:"primary",text:"",to:t.copyLink}},[t._v(" "+t._s(t.copyText)+" "),e(l,{attrs:{right:""}},[t._v(" fa-copy ")])],1):t.showCopy&&Object.keys(t.copyLink).length>0&&t.smallCopy?e(a,{attrs:{icon:"fa-copy",text:t.copyText,to:t.copyLink}}):t._e(),t.showSubmit?e(o,{staticClass:"primary",attrs:{disabled:t.disableSubmit,type:"submit",loading:t.submitLoading},on:{click:function(s){return t.$emit("submit")}}},[t._v(" "+t._s(t.submitText)+" ")]):t._e()],1)])},c=[],u=n(p,_,c,!1,null,null,null,null);const b=u.exports;export{b as _}; diff --git a/dist/assets/ErrorStateAlert-44af51cd.js b/dist/assets/ErrorStateAlert-3d45e0aa.js similarity index 99% rename from dist/assets/ErrorStateAlert-44af51cd.js rename to dist/assets/ErrorStateAlert-3d45e0aa.js index 3e0ecd7..68ab669 100644 --- a/dist/assets/ErrorStateAlert-44af51cd.js +++ b/dist/assets/ErrorStateAlert-3d45e0aa.js @@ -1 +1 @@ -import{J as L,aN as O,aO as M,aP as p,a as $,b as _,T as V,aQ as D,I as S,aI as k,aR as u,n as G}from"./index-e8f29bb9.js";const F=L(p,M,O).extend({name:"v-alert",props:{border:{type:String,validator(e){return["top","right","bottom","left"].includes(e)}},closeLabel:{type:String,default:"$vuetify.close"},coloredBorder:Boolean,dense:Boolean,dismissible:Boolean,closeIcon:{type:String,default:"$cancel"},icon:{default:"",type:[Boolean,String],validator(e){return typeof e=="string"||e===!1}},outlined:Boolean,prominent:Boolean,text:Boolean,type:{type:String,validator(e){return["info","error","success","warning"].includes(e)}},value:{type:Boolean,default:!0}},computed:{__cachedBorder(){if(!this.border)return null;let e={staticClass:"v-alert__border",class:{[`v-alert__border--${this.border}`]:!0}};return this.coloredBorder&&(e=this.setBackgroundColor(this.computedColor,e),e.class["v-alert__border--has-color"]=!0),this.$createElement("div",e)},__cachedDismissible(){if(!this.dismissible)return null;const e=this.iconColor;return this.$createElement($,{staticClass:"v-alert__dismissible",props:{color:e,icon:!0,small:!0},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:()=>this.isActive=!1}},[this.$createElement(_,{props:{color:e}},this.closeIcon)])},__cachedIcon(){return this.computedIcon?this.$createElement(_,{staticClass:"v-alert__icon",props:{color:this.iconColor}},this.computedIcon):null},classes(){const e={...p.options.computed.classes.call(this),"v-alert--border":!!this.border,"v-alert--dense":this.dense,"v-alert--outlined":this.outlined,"v-alert--prominent":this.prominent,"v-alert--text":this.text};return this.border&&(e[`v-alert--border-${this.border}`]=!0),e},computedColor(){return this.color||this.type},computedIcon(){return this.icon===!1?!1:typeof this.icon=="string"&&this.icon?this.icon:["error","info","success","warning"].includes(this.type)?`$${this.type}`:!1},hasColoredIcon(){return this.hasText||!!this.border&&this.coloredBorder},hasText(){return this.text||this.outlined},iconColor(){return this.hasColoredIcon?this.computedColor:void 0},isDark(){return this.type&&!this.coloredBorder&&!this.outlined?!0:V.options.computed.isDark.call(this)}},created(){this.$attrs.hasOwnProperty("outline")&&D("outline","outlined",this)},methods:{genWrapper(){const e=[this.$slots.prepend||this.__cachedIcon,this.genContent(),this.__cachedBorder,this.$slots.append,this.$scopedSlots.close?this.$scopedSlots.close({toggle:this.toggle}):this.__cachedDismissible],t={staticClass:"v-alert__wrapper"};return this.$createElement("div",t,e)},genContent(){return this.$createElement("div",{staticClass:"v-alert__content"},this.$slots.default)},genAlert(){let e={staticClass:"v-alert",attrs:{role:"alert"},on:this.listeners$,class:this.classes,style:this.styles,directives:[{name:"show",value:this.isActive}]};return this.coloredBorder||(e=(this.hasText?this.setTextColor:this.setBackgroundColor)(this.computedColor,e)),this.$createElement("div",e,[this.genWrapper()])},toggle(){this.isActive=!this.isActive}},render(e){const t=this.genAlert();return this.transition?e("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[t]):t}}),d=["sm","md","lg","xl"],B=(()=>d.reduce((e,t)=>(e[t]={type:[Boolean,String,Number],default:!1},e),{}))(),x=(()=>d.reduce((e,t)=>(e["offset"+u(t)]={type:[String,Number],default:null},e),{}))(),j=(()=>d.reduce((e,t)=>(e["order"+u(t)]={type:[String,Number],default:null},e),{}))(),m={col:Object.keys(B),offset:Object.keys(x),order:Object.keys(j)};function W(e,t,n){let s=e;if(!(n==null||n===!1)){if(t){const i=t.replace(e,"");s+=`-${i}`}return e==="col"&&(n===""||n===!0)||(s+=`-${n}`),s.toLowerCase()}}const y=new Map,b=S.extend({name:"v-col",functional:!0,props:{cols:{type:[Boolean,String,Number],default:!1},...B,offset:{type:[String,Number],default:null},...x,order:{type:[String,Number],default:null},...j,alignSelf:{type:String,default:null,validator:e=>["auto","start","end","center","baseline","stretch"].includes(e)},tag:{type:String,default:"div"}},render(e,{props:t,data:n,children:s,parent:i}){let o="";for(const l in t)o+=String(t[l]);let r=y.get(o);if(!r){r=[];let l;for(l in m)m[l].forEach(a=>{const P=t[a],g=W(l,a,P);g&&r.push(g)});const c=r.some(a=>a.startsWith("col-"));r.push({col:!c||!t.cols,[`col-${t.cols}`]:t.cols,[`offset-${t.offset}`]:t.offset,[`order-${t.order}`]:t.order,[`align-self-${t.alignSelf}`]:t.alignSelf}),y.set(o,r)}return e(t.tag,k(n,{class:r}),s)}}),q=["sm","md","lg","xl"],h=["start","end","center"];function f(e,t){return q.reduce((n,s)=>(n[e+u(s)]=t(),n),{})}const w=e=>[...h,"baseline","stretch"].includes(e),N=f("align",()=>({type:String,default:null,validator:w})),I=e=>[...h,"space-between","space-around"].includes(e),E=f("justify",()=>({type:String,default:null,validator:I})),T=e=>[...h,"space-between","space-around","stretch"].includes(e),A=f("alignContent",()=>({type:String,default:null,validator:T})),v={align:Object.keys(N),justify:Object.keys(E),alignContent:Object.keys(A)},K={align:"align",justify:"justify",alignContent:"align-content"};function R(e,t,n){let s=K[e];if(n!=null){if(t){const i=t.replace(e,"");s+=`-${i}`}return s+=`-${n}`,s.toLowerCase()}}const C=new Map,z=S.extend({name:"v-row",functional:!0,props:{tag:{type:String,default:"div"},dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:w},...N,justify:{type:String,default:null,validator:I},...E,alignContent:{type:String,default:null,validator:T},...A},render(e,{props:t,data:n,children:s}){let i="";for(const r in t)i+=String(t[r]);let o=C.get(i);if(!o){o=[];let r;for(r in v)v[r].forEach(l=>{const c=t[l],a=R(r,l,c);a&&o.push(a)});o.push({"no-gutters":t.noGutters,"row--dense":t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),C.set(i,o)}return e(t.tag,k(n,{staticClass:"row",class:o}),s)}});const J={name:"ErrorStateAlert",props:{resourceType:{type:String,required:!0},resourceId:{type:[String,Number],required:!0},message:{type:String,default(){return`The resource '${this.resourceType}/${this.resourceId}' Not Found.`}}}};var Q=function(){var t=this,n=t._self._c;return n(F,{attrs:{prominent:"",type:"error"}},[n(z,{attrs:{align:"center"}},[n(b,{staticClass:"grow"},[t._v(" "+t._s(t.message)+" ")]),n(b,{staticClass:"shrink"},[n($,{on:{click:function(s){return t.$router.go(-1)}}},[t._v(" Go back ")])],1)],1)],1)},H=[],U=G(J,Q,H,!1,null,null,null,null);const Y=U.exports;export{Y as _,F as a,z as b,b as c}; +import{J as L,aN as O,aO as M,aP as p,a as $,b as _,T as V,aQ as D,I as S,aI as k,aR as u,n as G}from"./index-e409ba63.js";const F=L(p,M,O).extend({name:"v-alert",props:{border:{type:String,validator(e){return["top","right","bottom","left"].includes(e)}},closeLabel:{type:String,default:"$vuetify.close"},coloredBorder:Boolean,dense:Boolean,dismissible:Boolean,closeIcon:{type:String,default:"$cancel"},icon:{default:"",type:[Boolean,String],validator(e){return typeof e=="string"||e===!1}},outlined:Boolean,prominent:Boolean,text:Boolean,type:{type:String,validator(e){return["info","error","success","warning"].includes(e)}},value:{type:Boolean,default:!0}},computed:{__cachedBorder(){if(!this.border)return null;let e={staticClass:"v-alert__border",class:{[`v-alert__border--${this.border}`]:!0}};return this.coloredBorder&&(e=this.setBackgroundColor(this.computedColor,e),e.class["v-alert__border--has-color"]=!0),this.$createElement("div",e)},__cachedDismissible(){if(!this.dismissible)return null;const e=this.iconColor;return this.$createElement($,{staticClass:"v-alert__dismissible",props:{color:e,icon:!0,small:!0},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:()=>this.isActive=!1}},[this.$createElement(_,{props:{color:e}},this.closeIcon)])},__cachedIcon(){return this.computedIcon?this.$createElement(_,{staticClass:"v-alert__icon",props:{color:this.iconColor}},this.computedIcon):null},classes(){const e={...p.options.computed.classes.call(this),"v-alert--border":!!this.border,"v-alert--dense":this.dense,"v-alert--outlined":this.outlined,"v-alert--prominent":this.prominent,"v-alert--text":this.text};return this.border&&(e[`v-alert--border-${this.border}`]=!0),e},computedColor(){return this.color||this.type},computedIcon(){return this.icon===!1?!1:typeof this.icon=="string"&&this.icon?this.icon:["error","info","success","warning"].includes(this.type)?`$${this.type}`:!1},hasColoredIcon(){return this.hasText||!!this.border&&this.coloredBorder},hasText(){return this.text||this.outlined},iconColor(){return this.hasColoredIcon?this.computedColor:void 0},isDark(){return this.type&&!this.coloredBorder&&!this.outlined?!0:V.options.computed.isDark.call(this)}},created(){this.$attrs.hasOwnProperty("outline")&&D("outline","outlined",this)},methods:{genWrapper(){const e=[this.$slots.prepend||this.__cachedIcon,this.genContent(),this.__cachedBorder,this.$slots.append,this.$scopedSlots.close?this.$scopedSlots.close({toggle:this.toggle}):this.__cachedDismissible],t={staticClass:"v-alert__wrapper"};return this.$createElement("div",t,e)},genContent(){return this.$createElement("div",{staticClass:"v-alert__content"},this.$slots.default)},genAlert(){let e={staticClass:"v-alert",attrs:{role:"alert"},on:this.listeners$,class:this.classes,style:this.styles,directives:[{name:"show",value:this.isActive}]};return this.coloredBorder||(e=(this.hasText?this.setTextColor:this.setBackgroundColor)(this.computedColor,e)),this.$createElement("div",e,[this.genWrapper()])},toggle(){this.isActive=!this.isActive}},render(e){const t=this.genAlert();return this.transition?e("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[t]):t}}),d=["sm","md","lg","xl"],B=(()=>d.reduce((e,t)=>(e[t]={type:[Boolean,String,Number],default:!1},e),{}))(),x=(()=>d.reduce((e,t)=>(e["offset"+u(t)]={type:[String,Number],default:null},e),{}))(),j=(()=>d.reduce((e,t)=>(e["order"+u(t)]={type:[String,Number],default:null},e),{}))(),m={col:Object.keys(B),offset:Object.keys(x),order:Object.keys(j)};function W(e,t,n){let s=e;if(!(n==null||n===!1)){if(t){const i=t.replace(e,"");s+=`-${i}`}return e==="col"&&(n===""||n===!0)||(s+=`-${n}`),s.toLowerCase()}}const y=new Map,b=S.extend({name:"v-col",functional:!0,props:{cols:{type:[Boolean,String,Number],default:!1},...B,offset:{type:[String,Number],default:null},...x,order:{type:[String,Number],default:null},...j,alignSelf:{type:String,default:null,validator:e=>["auto","start","end","center","baseline","stretch"].includes(e)},tag:{type:String,default:"div"}},render(e,{props:t,data:n,children:s,parent:i}){let o="";for(const l in t)o+=String(t[l]);let r=y.get(o);if(!r){r=[];let l;for(l in m)m[l].forEach(a=>{const P=t[a],g=W(l,a,P);g&&r.push(g)});const c=r.some(a=>a.startsWith("col-"));r.push({col:!c||!t.cols,[`col-${t.cols}`]:t.cols,[`offset-${t.offset}`]:t.offset,[`order-${t.order}`]:t.order,[`align-self-${t.alignSelf}`]:t.alignSelf}),y.set(o,r)}return e(t.tag,k(n,{class:r}),s)}}),q=["sm","md","lg","xl"],h=["start","end","center"];function f(e,t){return q.reduce((n,s)=>(n[e+u(s)]=t(),n),{})}const w=e=>[...h,"baseline","stretch"].includes(e),N=f("align",()=>({type:String,default:null,validator:w})),I=e=>[...h,"space-between","space-around"].includes(e),E=f("justify",()=>({type:String,default:null,validator:I})),T=e=>[...h,"space-between","space-around","stretch"].includes(e),A=f("alignContent",()=>({type:String,default:null,validator:T})),v={align:Object.keys(N),justify:Object.keys(E),alignContent:Object.keys(A)},K={align:"align",justify:"justify",alignContent:"align-content"};function R(e,t,n){let s=K[e];if(n!=null){if(t){const i=t.replace(e,"");s+=`-${i}`}return s+=`-${n}`,s.toLowerCase()}}const C=new Map,z=S.extend({name:"v-row",functional:!0,props:{tag:{type:String,default:"div"},dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:w},...N,justify:{type:String,default:null,validator:I},...E,alignContent:{type:String,default:null,validator:T},...A},render(e,{props:t,data:n,children:s}){let i="";for(const r in t)i+=String(t[r]);let o=C.get(i);if(!o){o=[];let r;for(r in v)v[r].forEach(l=>{const c=t[l],a=R(r,l,c);a&&o.push(a)});o.push({"no-gutters":t.noGutters,"row--dense":t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),C.set(i,o)}return e(t.tag,k(n,{staticClass:"row",class:o}),s)}});const J={name:"ErrorStateAlert",props:{resourceType:{type:String,required:!0},resourceId:{type:[String,Number],required:!0},message:{type:String,default(){return`The resource '${this.resourceType}/${this.resourceId}' Not Found.`}}}};var Q=function(){var t=this,n=t._self._c;return n(F,{attrs:{prominent:"",type:"error"}},[n(z,{attrs:{align:"center"}},[n(b,{staticClass:"grow"},[t._v(" "+t._s(t.message)+" ")]),n(b,{staticClass:"shrink"},[n($,{on:{click:function(s){return t.$router.go(-1)}}},[t._v(" Go back ")])],1)],1)],1)},H=[],U=G(J,Q,H,!1,null,null,null,null);const Y=U.exports;export{Y as _,F as a,z as b,b as c}; diff --git a/dist/assets/ExpansionPanelFilter-33a56e95.js b/dist/assets/ExpansionPanelFilter-010a2264.js similarity index 91% rename from dist/assets/ExpansionPanelFilter-33a56e95.js rename to dist/assets/ExpansionPanelFilter-010a2264.js index 7f55fa3..4c9cf32 100644 --- a/dist/assets/ExpansionPanelFilter-33a56e95.js +++ b/dist/assets/ExpansionPanelFilter-010a2264.js @@ -1 +1 @@ -import{n as a,H as n,i as r}from"./index-e8f29bb9.js";import{_ as m,a as u,b as _}from"./VExpansionPanelHeader-a9447b85.js";const c={name:"ExpansionPanelFilter",props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},items:{type:Array,required:!0},itemValue:{type:String,required:!0},itemKey:{type:String,required:!0},label:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[]}},computed:{selectedAll:{set(t){t?this.selectedItems=this.items.map(e=>e[this.itemValue]):this.selectedItems=[]},get(){return this.selectedItems.length===this.items.length}}},watch:{selectedItems:{handler(t){this.$emit("input",t)}},items:{handler(t){this.emptyDefault?this.selectedItems=[]:this.selectedItems=t.map(e=>e[this.itemValue])}}},mounted(){this.emptyDefault?this.selectedItems=[]:this.selectedItems=this.items.map(t=>t[this.itemValue])}};var o=function(){var e=this,s=e._self._c;return s(m,[s(u,{attrs:{"expand-icon":"mdi-menu-down"}},[e._v(" "+e._s(e.title)+" ")]),s(_,[s(n,{attrs:{"x-small":"",dense:"",label:"Select All"},model:{value:e.selectedAll,callback:function(l){e.selectedAll=l},expression:"selectedAll"}}),s(r,{staticClass:"pb-4"}),e._l(e.items,function(l){return s(n,{key:l[e.itemKey],attrs:{value:l[e.itemValue],"x-small":"",dense:"",label:l[e.label]},model:{value:e.selectedItems,callback:function(i){e.selectedItems=i},expression:"selectedItems"}})})],2)],1)},p=[],d=a(c,o,p,!1,null,null,null,null);const y=d.exports;export{y as _}; +import{n as a,H as n,i as r}from"./index-e409ba63.js";import{_ as m,a as u,b as _}from"./VExpansionPanelHeader-69136628.js";const c={name:"ExpansionPanelFilter",props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},items:{type:Array,required:!0},itemValue:{type:String,required:!0},itemKey:{type:String,required:!0},label:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[]}},computed:{selectedAll:{set(t){t?this.selectedItems=this.items.map(e=>e[this.itemValue]):this.selectedItems=[]},get(){return this.selectedItems.length===this.items.length}}},watch:{selectedItems:{handler(t){this.$emit("input",t)}},items:{handler(t){this.emptyDefault?this.selectedItems=[]:this.selectedItems=t.map(e=>e[this.itemValue])}}},mounted(){this.emptyDefault?this.selectedItems=[]:this.selectedItems=this.items.map(t=>t[this.itemValue])}};var o=function(){var e=this,s=e._self._c;return s(m,[s(u,{attrs:{"expand-icon":"mdi-menu-down"}},[e._v(" "+e._s(e.title)+" ")]),s(_,[s(n,{attrs:{"x-small":"",dense:"",label:"Select All"},model:{value:e.selectedAll,callback:function(l){e.selectedAll=l},expression:"selectedAll"}}),s(r,{staticClass:"pb-4"}),e._l(e.items,function(l){return s(n,{key:l[e.itemKey],attrs:{value:l[e.itemValue],"x-small":"",dense:"",label:l[e.label]},model:{value:e.selectedItems,callback:function(i){e.selectedItems=i},expression:"selectedItems"}})})],2)],1)},p=[],d=a(c,o,p,!1,null,null,null,null);const y=d.exports;export{y as _}; diff --git a/dist/assets/ExpansionPanelSearch-155a732a.js b/dist/assets/ExpansionPanelSearch-94b8e3ac.js similarity index 83% rename from dist/assets/ExpansionPanelSearch-155a732a.js rename to dist/assets/ExpansionPanelSearch-94b8e3ac.js index 9c4a85e..0ad10ae 100644 --- a/dist/assets/ExpansionPanelSearch-155a732a.js +++ b/dist/assets/ExpansionPanelSearch-94b8e3ac.js @@ -1 +1 @@ -import{n as l,j as r}from"./index-e8f29bb9.js";import{_,a as i,b as u}from"./VExpansionPanelHeader-a9447b85.js";const s={name:"ExpansionPanelSearch",props:{value:{type:String,required:!0},label:{type:String,required:!0},title:{type:String,required:!0}},data(){return{internalValue:""}},watch:{internalValue:{handler(t){this.$emit("input",t)}}},mounted(){this.internalValue=this.value}};var o=function(){var n=this,e=n._self._c;return e(_,[e(i,{attrs:{"expand-icon":"mdi-menu-down"}},[n._v(" "+n._s(n.title)+" ")]),e(u,[e(r,{attrs:{label:n.label,outlined:"",dense:"",required:""},model:{value:n.internalValue,callback:function(a){n.internalValue=a},expression:"internalValue"}})],1)],1)},p=[],c=l(s,o,p,!1,null,null,null,null);const v=c.exports;export{v as _}; +import{n as l,j as r}from"./index-e409ba63.js";import{_,a as i,b as u}from"./VExpansionPanelHeader-69136628.js";const s={name:"ExpansionPanelSearch",props:{value:{type:String,required:!0},label:{type:String,required:!0},title:{type:String,required:!0}},data(){return{internalValue:""}},watch:{internalValue:{handler(t){this.$emit("input",t)}}},mounted(){this.internalValue=this.value}};var o=function(){var n=this,e=n._self._c;return e(_,[e(i,{attrs:{"expand-icon":"mdi-menu-down"}},[n._v(" "+n._s(n.title)+" ")]),e(u,[e(r,{attrs:{label:n.label,outlined:"",dense:"",required:""},model:{value:n.internalValue,callback:function(a){n.internalValue=a},expression:"internalValue"}})],1)],1)},p=[],c=l(s,o,p,!1,null,null,null,null);const v=c.exports;export{v as _}; diff --git a/dist/assets/GeneralForm-ad50630d.js b/dist/assets/GeneralForm-e1472145.js similarity index 98% rename from dist/assets/GeneralForm-ad50630d.js rename to dist/assets/GeneralForm-e1472145.js index d27e8e7..1939737 100644 --- a/dist/assets/GeneralForm-ad50630d.js +++ b/dist/assets/GeneralForm-e1472145.js @@ -1 +1 @@ -import{aG as V,aH as a,j as o,aI as $,X as f,S as g,aJ as _,aK as D,a0 as C,aL as F,n as h,aC as w,a8 as T,c as k,a9 as B,aa as L,a7 as v,ak as A,ab as z,a2 as P,a as y,aB as M,V as E,f as O,g as N,C as q,l as K,I as U,i as j}from"./index-e8f29bb9.js";import{b as p,c as u}from"./ErrorStateAlert-44af51cd.js";import{V as i,d as R,a as G,_ as d}from"./VSelect-f55906da.js";import{_ as Y}from"./VSwitch-2cfffd69.js";import{u as H}from"./bypass-module-9d0c5e38.js";import{u as J}from"./credential-module-512a6f9e.js";import{u as W}from"./malleable-module-cb1f5265.js";const I={...R,offsetY:!0,offsetOverflow:!0,transition:!1},r=i.extend({name:"v-autocomplete",props:{autoSelectFirst:{type:Boolean,default:!1},filter:{type:Function,default:(e,t,s)=>s.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1},hideNoData:Boolean,menuProps:{type:i.options.props.menuProps.type,default:()=>I},noFilter:Boolean,searchInput:{type:String}},data(){return{lazySearch:this.searchInput}},computed:{classes(){return{...i.options.computed.classes.call(this),"v-autocomplete":!0,"v-autocomplete--is-selecting-index":this.selectedIndex>-1}},computedItems(){return this.filteredItems},selectedValues(){return this.selectedItems.map(e=>this.getValue(e))},hasDisplayedItems(){return this.hideSelected?this.filteredItems.some(e=>!this.hasItem(e)):this.filteredItems.length>0},currentRange(){return this.selectedItem==null?0:String(this.getText(this.selectedItem)).length},filteredItems(){return!this.isSearching||this.noFilter||this.internalSearch==null?this.allItems:this.allItems.filter(e=>{const t=V(e,this.itemText),s=t!=null?String(t):"";return this.filter(e,String(this.internalSearch),s)})},internalSearch:{get(){return this.lazySearch},set(e){this.lazySearch!==e&&(this.lazySearch=e,this.$emit("update:search-input",e))}},isAnyValueAllowed(){return!1},isDirty(){return this.searchIsDirty||this.selectedItems.length>0},isSearching(){return this.multiple&&this.searchIsDirty||this.searchIsDirty&&this.internalSearch!==this.getText(this.selectedItem)},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!this.hideNoData:!1},$_menuProps(){const e=i.options.computed.$_menuProps.call(this);return e.contentClass=`v-autocomplete__content ${e.contentClass||""}`.trim(),{...I,...e}},searchIsDirty(){return this.internalSearch!=null&&this.internalSearch!==""},selectedItem(){return this.multiple?null:this.selectedItems.find(e=>this.valueComparator(this.getValue(e),this.getValue(this.internalValue)))},listData(){const e=i.options.computed.listData.call(this);return e.props={...e.props,items:this.virtualizedItems,noFilter:this.noFilter||!this.isSearching||!this.filteredItems.length,searchInput:this.internalSearch},e}},watch:{filteredItems:"onFilteredItemsChanged",internalValue:"setSearch",isFocused(e){e?(document.addEventListener("copy",this.onCopy),this.$refs.input&&this.$refs.input.select()):(document.removeEventListener("copy",this.onCopy),this.blur(),this.updateSelf())},isMenuActive(e){e||!this.hasSlot||(this.lazySearch=null)},items(e,t){!(t&&t.length)&&this.hideNoData&&this.isFocused&&!this.isMenuActive&&e.length&&this.activateMenu()},searchInput(e){this.lazySearch=e},internalSearch:"onInternalSearchChanged",itemText:"updateSelf"},created(){this.setSearch()},destroyed(){document.removeEventListener("copy",this.onCopy)},methods:{onFilteredItemsChanged(e,t){if(e!==t){if(!this.autoSelectFirst){const s=t[this.$refs.menu.listIndex];s?this.setMenuIndex(e.findIndex(n=>n===s)):this.setMenuIndex(-1),this.$emit("update:list-index",this.$refs.menu.listIndex)}this.$nextTick(()=>{!this.internalSearch||e.length!==1&&!this.autoSelectFirst||(this.$refs.menu.getTiles(),this.autoSelectFirst&&e.length&&(this.setMenuIndex(0),this.$emit("update:list-index",this.$refs.menu.listIndex)))})}},onInternalSearchChanged(){this.updateMenuDimensions()},updateMenuDimensions(){this.isMenuActive&&this.$refs.menu&&this.$refs.menu.updateDimensions()},changeSelectedIndex(e){this.searchIsDirty||(this.multiple&&e===a.left?this.selectedIndex===-1?this.selectedIndex=this.selectedItems.length-1:this.selectedIndex--:this.multiple&&e===a.right?this.selectedIndex>=this.selectedItems.length-1?this.selectedIndex=-1:this.selectedIndex++:(e===a.backspace||e===a.delete)&&this.deleteCurrentItem())},deleteCurrentItem(){const e=this.selectedIndex,t=this.selectedItems[e];if(!this.isInteractive||this.getDisabled(t))return;const s=this.selectedItems.length-1;if(this.selectedIndex===-1&&s!==0){this.selectedIndex=s;return}const n=this.selectedItems.length,l=e!==n-1?e:e-1;this.selectedItems[l]?this.selectItem(t):this.setValue(this.multiple?[]:null),this.selectedIndex=l},clearableCallback(){this.internalSearch=null,i.options.methods.clearableCallback.call(this)},genInput(){const e=o.options.methods.genInput.call(this);return e.data=$(e.data,{attrs:{"aria-activedescendant":f(this.$refs.menu,"activeTile.id"),autocomplete:f(e.data,"attrs.autocomplete","off")},domProps:{value:this.internalSearch}}),e},genInputSlot(){const e=i.options.methods.genInputSlot.call(this);return e.data.attrs.role="combobox",e},genSelections(){return this.hasSlot||this.multiple?i.options.methods.genSelections.call(this):[]},onClick(e){this.isInteractive&&(this.selectedIndex>-1?this.selectedIndex=-1:this.onFocus(),this.isAppendInner(e.target)||this.activateMenu())},onInput(e){if(this.selectedIndex>-1||!e.target)return;const t=e.target,s=t.value;t.value&&this.activateMenu(),!this.multiple&&s===""&&this.deleteCurrentItem(),this.internalSearch=s,this.badInput=t.validity&&t.validity.badInput},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&i.options.methods.onKeyDown.call(this,e),this.changeSelectedIndex(t)},onSpaceDown(e){},onTabDown(e){i.options.methods.onTabDown.call(this,e),this.updateSelf()},onUpDown(e){e.preventDefault(),this.activateMenu()},selectItem(e){i.options.methods.selectItem.call(this,e),this.setSearch()},setSelectedItems(){i.options.methods.setSelectedItems.call(this),this.isFocused||this.setSearch()},setSearch(){this.$nextTick(()=>{(!this.multiple||!this.internalSearch||!this.isMenuActive)&&(this.internalSearch=!this.selectedItems.length||this.multiple||this.hasSlot?null:this.getText(this.selectedItem))})},updateSelf(){!this.searchIsDirty&&!this.internalValue||!this.multiple&&!this.valueComparator(this.internalSearch,this.getValue(this.internalValue))&&this.setSearch()},hasItem(e){return this.selectedValues.indexOf(this.getValue(e))>-1},onCopy(e){var t,s;if(this.selectedIndex===-1)return;const n=this.selectedItems[this.selectedIndex],l=this.getText(n);(t=e.clipboardData)===null||t===void 0||t.setData("text/plain",l),(s=e.clipboardData)===null||s===void 0||s.setData("text/vnd.vuetify.autocomplete.item+plain",l),e.preventDefault()}}}),X=r.extend({name:"v-combobox",props:{delimiters:{type:Array,default:()=>[]},returnObject:{type:Boolean,default:!0}},data:()=>({editingIndex:-1}),computed:{computedCounterValue(){return this.multiple?this.selectedItems.length:(this.internalSearch||"").toString().length},hasSlot(){return i.options.computed.hasSlot.call(this)||this.multiple},isAnyValueAllowed(){return!0},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!!this.$slots["no-data"]&&!this.hideNoData:!1},searchIsDirty(){return this.internalSearch!=null}},methods:{onInternalSearchChanged(e){if(e&&this.multiple&&this.delimiters.length){const t=this.delimiters.find(s=>e.endsWith(s));t!=null&&(this.internalSearch=e.slice(0,e.length-t.length),this.updateTags())}this.updateMenuDimensions()},genInput(){const e=r.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data.on.paste=this.onPaste,e},genChipSelection(e,t){const s=i.options.methods.genChipSelection.call(this,e,t);return this.multiple&&(s.componentOptions.listeners={...s.componentOptions.listeners,dblclick:()=>{this.editingIndex=t,this.internalSearch=this.getText(e),this.selectedIndex=-1}}),s},onChipInput(e){i.options.methods.onChipInput.call(this,e),this.editingIndex=-1},onEnterDown(e){e.preventDefault(),!(this.getMenuIndex()>-1)&&this.$nextTick(this.updateSelf)},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&i.options.methods.onKeyDown.call(this,e),this.multiple&&t===a.left&&this.$refs.input.selectionStart===0?this.updateSelf():t===a.enter&&this.onEnterDown(e),this.changeSelectedIndex(t)},onTabDown(e){if(this.multiple&&this.internalSearch&&this.getMenuIndex()===-1)return e.preventDefault(),e.stopPropagation(),this.updateTags();r.options.methods.onTabDown.call(this,e)},selectItem(e){this.editingIndex>-1?this.updateEditing():(r.options.methods.selectItem.call(this,e),this.internalSearch&&this.multiple&&this.getText(e).toLocaleLowerCase().includes(this.internalSearch.toLocaleLowerCase())&&(this.internalSearch=null))},setSelectedItems(){this.internalValue==null||this.internalValue===""?this.selectedItems=[]:this.selectedItems=this.multiple?this.internalValue:[this.internalValue]},setValue(e){i.options.methods.setValue.call(this,e===void 0?this.internalSearch:e)},updateEditing(){const e=this.internalValue.slice(),t=this.selectedItems.findIndex(s=>this.getText(s)===this.internalSearch);if(t>-1){const s=typeof e[t]=="object"?Object.assign({},e[t]):e[t];e.splice(t,1),e.push(s)}else e[this.editingIndex]=this.internalSearch;this.setValue(e),this.editingIndex=-1,this.internalSearch=null},updateCombobox(){if(!this.searchIsDirty)return;this.internalSearch!==this.getText(this.internalValue)&&this.setValue(),(!!this.$scopedSlots.selection||this.hasChips)&&(this.internalSearch=null)},updateSelf(){this.multiple?this.updateTags():this.updateCombobox()},updateTags(){const e=this.getMenuIndex();if(e<0&&!this.searchIsDirty||!this.internalSearch)return;if(this.editingIndex>-1)return this.updateEditing();const t=this.selectedItems.findIndex(n=>this.internalSearch===this.getText(n)),s=t>-1&&typeof this.selectedItems[t]=="object"?Object.assign({},this.selectedItems[t]):this.internalSearch;if(t>-1){const n=this.internalValue.slice();n.splice(t,1),this.setValue(n)}if(e>-1)return this.internalSearch=null;this.selectItem(s),this.internalSearch=null},onPaste(e){var t;if(this.$emit("paste",e),!this.multiple||this.searchIsDirty)return;const s=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/vnd.vuetify.autocomplete.item+plain");s&&this.findExistingIndex(s)===-1&&(e.preventDefault(),i.options.methods.selectItem.call(this,s))},clearableCallback(){this.editingIndex=-1,r.options.methods.clearableCallback.call(this)}}});const Z=o.extend({name:"v-file-input",model:{prop:"value",event:"change"},props:{chips:Boolean,clearable:{type:Boolean,default:!0},counterSizeString:{type:String,default:"$vuetify.fileInput.counterSize"},counterString:{type:String,default:"$vuetify.fileInput.counter"},hideInput:Boolean,multiple:Boolean,placeholder:String,prependIcon:{type:String,default:"$file"},readonly:{type:Boolean,default:!1},showSize:{type:[Boolean,Number],default:!1,validator:e=>typeof e=="boolean"||[1e3,1024].includes(e)},smallChips:Boolean,truncateLength:{type:[Number,String],default:22},type:{type:String,default:"file"},value:{default:void 0,validator:e=>g(e).every(t=>t!=null&&typeof t=="object")}},computed:{classes(){return{...o.options.computed.classes.call(this),"v-file-input":!0}},computedCounterValue(){const e=this.multiple&&this.lazyValue?this.lazyValue.length:this.lazyValue instanceof File?1:0;if(!this.showSize)return this.$vuetify.lang.t(this.counterString,e);const t=this.internalArrayValue.reduce((s,{size:n=0})=>s+n,0);return this.$vuetify.lang.t(this.counterSizeString,e,_(t,this.base===1024))},internalArrayValue(){return g(this.internalValue)},internalValue:{get(){return this.lazyValue},set(e){this.lazyValue=e,this.$emit("change",this.lazyValue)}},isDirty(){return this.internalArrayValue.length>0},isLabelActive(){return this.isDirty},text(){return!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?[this.placeholder]:this.internalArrayValue.map(e=>{const{name:t="",size:s=0}=e,n=this.truncateText(t);return this.showSize?`${n} (${_(s,this.base===1024)})`:n})},base(){return typeof this.showSize!="boolean"?this.showSize:void 0},hasChips(){return this.chips||this.smallChips}},watch:{readonly:{handler(e){e===!0&&D("readonly is not supported on ",this)},immediate:!0},value(e){const t=this.multiple?e:e?[e]:[];C(t,this.$refs.input.files)||(this.$refs.input.value="")}},methods:{clearableCallback(){this.internalValue=this.multiple?[]:null,this.$refs.input.value=""},genChips(){return this.isDirty?this.text.map((e,t)=>this.$createElement(G,{props:{small:this.smallChips},on:{"click:close":()=>{const s=this.internalValue;s.splice(t,1),this.internalValue=s}}},[e])):[]},genControl(){const e=o.options.methods.genControl.call(this);return this.hideInput&&(e.data.style=F(e.data.style,{display:"none"})),e},genInput(){const e=o.options.methods.genInput.call(this);return e.data.attrs.multiple=this.multiple,delete e.data.domProps.value,delete e.data.on.input,e.data.on.change=this.onInput,[this.genSelections(),e]},genPrependSlot(){if(!this.prependIcon)return null;const e=this.genIcon("prepend",()=>{this.$refs.input.click()});return this.genSlot("prepend","outer",[e])},genSelectionText(){const e=this.text.length;return e<2?this.text:this.showSize&&!this.counter?[this.computedCounterValue]:[this.$vuetify.lang.t(this.counterString,e)]},genSelections(){const e=[];return this.isDirty&&this.$scopedSlots.selection?this.internalArrayValue.forEach((t,s)=>{this.$scopedSlots.selection&&e.push(this.$scopedSlots.selection({text:this.text[s],file:t,index:s}))}):e.push(this.hasChips&&this.isDirty?this.genChips():this.genSelectionText()),this.$createElement("div",{staticClass:"v-file-input__text",class:{"v-file-input__text--placeholder":this.placeholder&&!this.isDirty,"v-file-input__text--chips":this.hasChips&&!this.$scopedSlots.selection}},e)},genTextFieldSlot(){const e=o.options.methods.genTextFieldSlot.call(this);return e.data.on={...e.data.on||{},click:t=>{t.target&&t.target.nodeName==="LABEL"||this.$refs.input.click()}},e},onInput(e){const t=[...e.target.files||[]];this.internalValue=this.multiple?t:t[0],this.initialValue=this.internalValue},onKeyDown(e){this.$emit("keydown",e)},truncateText(e){if(e.length[]}},data(){return{loading:!1,file:null}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{async submit(){if(!this.$refs.form.validate())return;const e=new FormData;e.append("file",this.file);const t=await w(e);this.$emit("submit",{file:t.data})}}};var ee=function(){var t=this,s=t._self._c;return s(T,{ref:"uploadDialog",attrs:{"max-width":"750px"},model:{value:t.show,callback:function(n){t.show=n},expression:"show"}},[s(k,[s(B,[s("span",{staticClass:"headline"},[t._v("Upload To Empire Server")])]),s(L,[s(v,{ref:"form",attrs:{"on-submit":"return false;"},on:{submit:function(n){n.preventDefault()}}},[s(A,[s(p,[s(u,{attrs:{cols:"12"}},[s(Z,{ref:"fileInput",attrs:{accept:"*/*",rules:t.rules,outlined:"",dense:""},model:{value:t.file,callback:function(n){t.file=n},expression:"file"}})],1)],1)],1)],1)],1),s(z,[s(P),s(y,{attrs:{color:"blue darken-1",text:""},on:{click:function(n){n.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),s(y,{attrs:{color:"blue darken-1",text:"",loading:t.loading},on:{click:t.submit}},[t._v(" Upload ")])],1)],1)],1)},te=[],se=h(Q,ee,te,!1,null,null,null,null);const x=se.exports;function S(e,t){if(e===0)return"0 Bytes";const s=1024,n=t||2,l=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/s**c).toFixed(n))} ${l[c]}`}const ne={components:{FileUploadDialog:x},props:{value:{type:[String,Array,Number],required:!0},label:{type:String,default:"Server Files"},rules:{type:Array,default:()=>[]},maximumFileSize:{type:Number,required:!1,default:-1},returnObject:{type:Boolean,required:!1,default:!1}},data(){return{internalValue:this.value,isLoading:!1,count:0,entries:[],search:null,showDialog:!1}},computed:{fileItems(){return this.entries.map(e=>{const t=e.location.length>this.descriptionLimit?`(${S(e.size)}) ${e.location.slice(0,this.descriptionLimit)}...`:`(${S(e.size)}) ${e.location}`;return{...e,description:t}})}},watch:{internalValue(e){this.$emit("input",e)},value(e){this.internalValue=e},search(){this.doSearch()}},mounted(){this.doSearch()},methods:{doSearch(e=!0){!e&&this.fileItems.length>0||this.isLoading||(this.isLoading=!0,M({page:1,limit:-1}).then(t=>{const{records:s}=t;this.maximumFileSize>0?this.entries=s.filter(n=>n.size<=this.maximumFileSize):this.entries=s,this.count=this.entries.length}).catch(t=>{console.log(t)}).finally(()=>{this.isLoading=!1}))},fileUploaded({file:e}){this.showDialog=!1,this.doSearch(!0),this.returnObject?this.internalValue=e:this.internalValue=e.id}}};var ie=function(){var t=this,s=t._self._c;return s("div",[s(x,{attrs:{rules:t.rules},on:{submit:t.fileUploaded},model:{value:t.showDialog,callback:function(n){t.showDialog=n},expression:"showDialog"}}),s(r,{attrs:{items:t.fileItems,loading:t.isLoading,"search-input":t.search,"hide-no-data":"","hide-selected":"",clearable:"","cache-items":"","item-text":"description","item-value":"id",label:t.label,placeholder:"Start typing to Search","prepend-icon":"fa-upload",outlined:"",dense:"","return-object":t.returnObject},on:{"update:searchInput":function(n){t.search=n},"update:search-input":function(n){t.search=n},"click:prepend":function(n){t.showDialog=!0}},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}})],1)},le=[],ae=h(ne,ie,le,!1,null,null,null,null);const b=ae.exports;const re={components:{FileInput:b},props:{value:{type:[String,Array,Number],required:!0},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},name:{type:String,required:!0},rules:{type:Array,default:()=>[]},type:{type:String,default:"text"}},data(){return{internalValue:this.value}},watch:{internalValue(e){this.$emit("input",e)}},methods:{truncate(e){return e?e.length>80?`${e.substr(0,80)}...`:e:""}}};var oe=function(){var t=this,s=t._self._c;return s("div",[t.suggestedValues.length>0&&t.strict&&t.suggestedValues.includes("True")&&t.suggestedValues.includes("False")?s(Y,{attrs:{"false-value":"False","true-value":"True",label:t.name},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.name==="Bypasses"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",multiple:"",chips:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.type==="file"?s(b,{attrs:{label:t.name},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.name==="Agent"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:"","item-value":"session_id","item-text":"name"},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.name==="CredID"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:"","item-value":"id","item-text":"id"},scopedSlots:t._u([{key:"item",fn:function(n){return[s(E,[s(O,{domProps:{textContent:t._s(t.truncate(`${n.item.username}, ${n.item.domain}, ${n.item.password}`))}}),s(N,{domProps:{textContent:t._s(t.truncate(`id: ${n.item.id}, notes: ${n.item.notes}`))}})],1)]}}]),model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.suggestedValues.length>0&&!t.strict?s(X,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.suggestedValues.length>0&&t.strict?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):s(o,{attrs:{rules:t.rules,label:t.name,type:t.type==="string"?"text":"number",outlined:"",dense:"",required:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}})],1)},ue=[],he=h(re,oe,ue,!1,null,null,null,null);const m=he.exports;const ce={components:{DynamicFormInput:m},props:{options:{type:Object,required:!0},readonly:{type:Boolean,default:!1},priority:{type:Array,default:()=>[]}},data(){return{form:{},valid:!0}},computed:{agentStore(){return q()},listenerStore(){return K()},bypassStore(){return H()},credentialStore(){return J()},malleableProfileStore(){return W()},agents(){return this.agentStore.agents},listeners(){return this.listenerStore.listenerNames},bypasses(){return this.bypassStore.bypassNames},credentials(){return this.credentialStore.credentials},malleableProfiles(){return this.malleableProfileStore.profileNames},optionalFields(){return this.fields.filter(e=>e.required===!1).map(e=>({...e,type:this.fieldType(e)}))},requiredFields(){return this.fields.filter(e=>e.required===!0).map(e=>({...e,type:this.fieldType(e)}))},fields(){const e=Object.keys(this.options).map(t=>({name:t,...this.options[t]}));return this.priority.slice().reverse().forEach(t=>{const s=e.findIndex(n=>n.name===t);if(s>-1){const n=e.splice(s,1)[0];e.unshift(n)}}),e},rules(){return this.fields.reduce((e,t)=>(e[t.name]=[],t.required===!0&&e[t.name].push(s=>!!s||s===0||`${t.name} is required`),e),{})}},watch:{form:{handler(e){const t={...e};t.Bypasses&&(t.Bypasses=t.Bypasses.join(" ")),this.$emit("input",t)},deep:!0},fields:{immediate:!0,handler(e){const t=e.reduce((s,n)=>(n.name==="Bypasses"&&!Array.isArray(n.value)?s[n.name]=n.value.split(" ")||[]:s[n.name]=n.value==null?"":n.value,s),{});U.set(this,"form",t)}}},mounted(){this.agentStore.getAgents(),this.listenerStore.getListeners(),this.bypassStore.getBypasses(),this.malleableProfileStore.getMalleableProfiles(),this.credentialStore.getCredentials()},methods:{suggestedValuesForField(e){return e.name==="Agent"?this.agents:["Listener","RedirectListener"].includes(e.name)?this.listeners:e.name==="Bypasses"?this.bypasses:e.name==="Profile"?this.malleableProfiles:e.name==="CredID"?this.credentials:e.suggested_values},strictForField(e){return e.name==="Listener"||e.name==="Bypasses"||e.name==="Profile"||e.name==="CredID"?!0:e.strict},fieldExists(e){return this.fields.find(t=>t.name===e)},fieldType(e){return e.value_type==="INTEGER"?"number":e.value_type==="FLOAT"?"float":e.value_type==="BOOLEAN"?"boolean":e.value_type==="STRING"?"string":e.value_type==="FILE"?"file":"string"}}};var de=function(){var t=this,s=t._self._c;return s(v,{ref:"form",attrs:{readonly:t.readonly},nativeOn:{submit:function(n){return n.preventDefault(),t.submit.apply(null,arguments)}},model:{value:t.valid,callback:function(n){t.valid=n},expression:"valid"}},[t._l(t.requiredFields,function(n){return s(p,{key:n.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(n),strict:t.strictForField(n),name:n.name,rules:t.rules[n.name],type:n.type},model:{value:t.form[n.name],callback:function(l){t.$set(t.form,n.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(n.description)+" ")])],1)],1)}),t.optionalFields.length>0?s(d,[t._v(" Optional Fields ")]):t._e(),t.optionalFields.length>0?s(j,{staticClass:"mb-8"}):t._e(),t._l(t.optionalFields,function(n){return s(p,{key:n.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(n),strict:t.strictForField(n),name:n.name,rules:t.rules[n.name],type:n.type},model:{value:t.form[n.name],callback:function(l){t.$set(t.form,n.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(n.description)+" ")])],1)],1)})],2)},pe=[],me=h(ce,de,pe,!1,null,null,null,null);const xe=me.exports;export{xe as _,r as a,b,Z as c,S as f}; +import{aG as V,aH as a,j as o,aI as $,X as f,S as g,aJ as _,aK as D,a0 as C,aL as F,n as h,aC as w,a8 as T,c as k,a9 as B,aa as L,a7 as v,ak as A,ab as z,a2 as P,a as y,aB as M,V as E,f as O,g as N,C as q,l as K,I as U,i as j}from"./index-e409ba63.js";import{b as p,c as u}from"./ErrorStateAlert-3d45e0aa.js";import{V as i,d as R,a as G,_ as d}from"./VSelect-22e7980f.js";import{_ as Y}from"./VSwitch-3f004360.js";import{u as H}from"./bypass-module-4e86a448.js";import{u as J}from"./credential-module-93372e4e.js";import{u as W}from"./malleable-module-2a911c2d.js";const I={...R,offsetY:!0,offsetOverflow:!0,transition:!1},r=i.extend({name:"v-autocomplete",props:{autoSelectFirst:{type:Boolean,default:!1},filter:{type:Function,default:(e,t,s)=>s.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1},hideNoData:Boolean,menuProps:{type:i.options.props.menuProps.type,default:()=>I},noFilter:Boolean,searchInput:{type:String}},data(){return{lazySearch:this.searchInput}},computed:{classes(){return{...i.options.computed.classes.call(this),"v-autocomplete":!0,"v-autocomplete--is-selecting-index":this.selectedIndex>-1}},computedItems(){return this.filteredItems},selectedValues(){return this.selectedItems.map(e=>this.getValue(e))},hasDisplayedItems(){return this.hideSelected?this.filteredItems.some(e=>!this.hasItem(e)):this.filteredItems.length>0},currentRange(){return this.selectedItem==null?0:String(this.getText(this.selectedItem)).length},filteredItems(){return!this.isSearching||this.noFilter||this.internalSearch==null?this.allItems:this.allItems.filter(e=>{const t=V(e,this.itemText),s=t!=null?String(t):"";return this.filter(e,String(this.internalSearch),s)})},internalSearch:{get(){return this.lazySearch},set(e){this.lazySearch!==e&&(this.lazySearch=e,this.$emit("update:search-input",e))}},isAnyValueAllowed(){return!1},isDirty(){return this.searchIsDirty||this.selectedItems.length>0},isSearching(){return this.multiple&&this.searchIsDirty||this.searchIsDirty&&this.internalSearch!==this.getText(this.selectedItem)},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!this.hideNoData:!1},$_menuProps(){const e=i.options.computed.$_menuProps.call(this);return e.contentClass=`v-autocomplete__content ${e.contentClass||""}`.trim(),{...I,...e}},searchIsDirty(){return this.internalSearch!=null&&this.internalSearch!==""},selectedItem(){return this.multiple?null:this.selectedItems.find(e=>this.valueComparator(this.getValue(e),this.getValue(this.internalValue)))},listData(){const e=i.options.computed.listData.call(this);return e.props={...e.props,items:this.virtualizedItems,noFilter:this.noFilter||!this.isSearching||!this.filteredItems.length,searchInput:this.internalSearch},e}},watch:{filteredItems:"onFilteredItemsChanged",internalValue:"setSearch",isFocused(e){e?(document.addEventListener("copy",this.onCopy),this.$refs.input&&this.$refs.input.select()):(document.removeEventListener("copy",this.onCopy),this.blur(),this.updateSelf())},isMenuActive(e){e||!this.hasSlot||(this.lazySearch=null)},items(e,t){!(t&&t.length)&&this.hideNoData&&this.isFocused&&!this.isMenuActive&&e.length&&this.activateMenu()},searchInput(e){this.lazySearch=e},internalSearch:"onInternalSearchChanged",itemText:"updateSelf"},created(){this.setSearch()},destroyed(){document.removeEventListener("copy",this.onCopy)},methods:{onFilteredItemsChanged(e,t){if(e!==t){if(!this.autoSelectFirst){const s=t[this.$refs.menu.listIndex];s?this.setMenuIndex(e.findIndex(n=>n===s)):this.setMenuIndex(-1),this.$emit("update:list-index",this.$refs.menu.listIndex)}this.$nextTick(()=>{!this.internalSearch||e.length!==1&&!this.autoSelectFirst||(this.$refs.menu.getTiles(),this.autoSelectFirst&&e.length&&(this.setMenuIndex(0),this.$emit("update:list-index",this.$refs.menu.listIndex)))})}},onInternalSearchChanged(){this.updateMenuDimensions()},updateMenuDimensions(){this.isMenuActive&&this.$refs.menu&&this.$refs.menu.updateDimensions()},changeSelectedIndex(e){this.searchIsDirty||(this.multiple&&e===a.left?this.selectedIndex===-1?this.selectedIndex=this.selectedItems.length-1:this.selectedIndex--:this.multiple&&e===a.right?this.selectedIndex>=this.selectedItems.length-1?this.selectedIndex=-1:this.selectedIndex++:(e===a.backspace||e===a.delete)&&this.deleteCurrentItem())},deleteCurrentItem(){const e=this.selectedIndex,t=this.selectedItems[e];if(!this.isInteractive||this.getDisabled(t))return;const s=this.selectedItems.length-1;if(this.selectedIndex===-1&&s!==0){this.selectedIndex=s;return}const n=this.selectedItems.length,l=e!==n-1?e:e-1;this.selectedItems[l]?this.selectItem(t):this.setValue(this.multiple?[]:null),this.selectedIndex=l},clearableCallback(){this.internalSearch=null,i.options.methods.clearableCallback.call(this)},genInput(){const e=o.options.methods.genInput.call(this);return e.data=$(e.data,{attrs:{"aria-activedescendant":f(this.$refs.menu,"activeTile.id"),autocomplete:f(e.data,"attrs.autocomplete","off")},domProps:{value:this.internalSearch}}),e},genInputSlot(){const e=i.options.methods.genInputSlot.call(this);return e.data.attrs.role="combobox",e},genSelections(){return this.hasSlot||this.multiple?i.options.methods.genSelections.call(this):[]},onClick(e){this.isInteractive&&(this.selectedIndex>-1?this.selectedIndex=-1:this.onFocus(),this.isAppendInner(e.target)||this.activateMenu())},onInput(e){if(this.selectedIndex>-1||!e.target)return;const t=e.target,s=t.value;t.value&&this.activateMenu(),!this.multiple&&s===""&&this.deleteCurrentItem(),this.internalSearch=s,this.badInput=t.validity&&t.validity.badInput},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&i.options.methods.onKeyDown.call(this,e),this.changeSelectedIndex(t)},onSpaceDown(e){},onTabDown(e){i.options.methods.onTabDown.call(this,e),this.updateSelf()},onUpDown(e){e.preventDefault(),this.activateMenu()},selectItem(e){i.options.methods.selectItem.call(this,e),this.setSearch()},setSelectedItems(){i.options.methods.setSelectedItems.call(this),this.isFocused||this.setSearch()},setSearch(){this.$nextTick(()=>{(!this.multiple||!this.internalSearch||!this.isMenuActive)&&(this.internalSearch=!this.selectedItems.length||this.multiple||this.hasSlot?null:this.getText(this.selectedItem))})},updateSelf(){!this.searchIsDirty&&!this.internalValue||!this.multiple&&!this.valueComparator(this.internalSearch,this.getValue(this.internalValue))&&this.setSearch()},hasItem(e){return this.selectedValues.indexOf(this.getValue(e))>-1},onCopy(e){var t,s;if(this.selectedIndex===-1)return;const n=this.selectedItems[this.selectedIndex],l=this.getText(n);(t=e.clipboardData)===null||t===void 0||t.setData("text/plain",l),(s=e.clipboardData)===null||s===void 0||s.setData("text/vnd.vuetify.autocomplete.item+plain",l),e.preventDefault()}}}),X=r.extend({name:"v-combobox",props:{delimiters:{type:Array,default:()=>[]},returnObject:{type:Boolean,default:!0}},data:()=>({editingIndex:-1}),computed:{computedCounterValue(){return this.multiple?this.selectedItems.length:(this.internalSearch||"").toString().length},hasSlot(){return i.options.computed.hasSlot.call(this)||this.multiple},isAnyValueAllowed(){return!0},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!!this.$slots["no-data"]&&!this.hideNoData:!1},searchIsDirty(){return this.internalSearch!=null}},methods:{onInternalSearchChanged(e){if(e&&this.multiple&&this.delimiters.length){const t=this.delimiters.find(s=>e.endsWith(s));t!=null&&(this.internalSearch=e.slice(0,e.length-t.length),this.updateTags())}this.updateMenuDimensions()},genInput(){const e=r.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data.on.paste=this.onPaste,e},genChipSelection(e,t){const s=i.options.methods.genChipSelection.call(this,e,t);return this.multiple&&(s.componentOptions.listeners={...s.componentOptions.listeners,dblclick:()=>{this.editingIndex=t,this.internalSearch=this.getText(e),this.selectedIndex=-1}}),s},onChipInput(e){i.options.methods.onChipInput.call(this,e),this.editingIndex=-1},onEnterDown(e){e.preventDefault(),!(this.getMenuIndex()>-1)&&this.$nextTick(this.updateSelf)},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&i.options.methods.onKeyDown.call(this,e),this.multiple&&t===a.left&&this.$refs.input.selectionStart===0?this.updateSelf():t===a.enter&&this.onEnterDown(e),this.changeSelectedIndex(t)},onTabDown(e){if(this.multiple&&this.internalSearch&&this.getMenuIndex()===-1)return e.preventDefault(),e.stopPropagation(),this.updateTags();r.options.methods.onTabDown.call(this,e)},selectItem(e){this.editingIndex>-1?this.updateEditing():(r.options.methods.selectItem.call(this,e),this.internalSearch&&this.multiple&&this.getText(e).toLocaleLowerCase().includes(this.internalSearch.toLocaleLowerCase())&&(this.internalSearch=null))},setSelectedItems(){this.internalValue==null||this.internalValue===""?this.selectedItems=[]:this.selectedItems=this.multiple?this.internalValue:[this.internalValue]},setValue(e){i.options.methods.setValue.call(this,e===void 0?this.internalSearch:e)},updateEditing(){const e=this.internalValue.slice(),t=this.selectedItems.findIndex(s=>this.getText(s)===this.internalSearch);if(t>-1){const s=typeof e[t]=="object"?Object.assign({},e[t]):e[t];e.splice(t,1),e.push(s)}else e[this.editingIndex]=this.internalSearch;this.setValue(e),this.editingIndex=-1,this.internalSearch=null},updateCombobox(){if(!this.searchIsDirty)return;this.internalSearch!==this.getText(this.internalValue)&&this.setValue(),(!!this.$scopedSlots.selection||this.hasChips)&&(this.internalSearch=null)},updateSelf(){this.multiple?this.updateTags():this.updateCombobox()},updateTags(){const e=this.getMenuIndex();if(e<0&&!this.searchIsDirty||!this.internalSearch)return;if(this.editingIndex>-1)return this.updateEditing();const t=this.selectedItems.findIndex(n=>this.internalSearch===this.getText(n)),s=t>-1&&typeof this.selectedItems[t]=="object"?Object.assign({},this.selectedItems[t]):this.internalSearch;if(t>-1){const n=this.internalValue.slice();n.splice(t,1),this.setValue(n)}if(e>-1)return this.internalSearch=null;this.selectItem(s),this.internalSearch=null},onPaste(e){var t;if(this.$emit("paste",e),!this.multiple||this.searchIsDirty)return;const s=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/vnd.vuetify.autocomplete.item+plain");s&&this.findExistingIndex(s)===-1&&(e.preventDefault(),i.options.methods.selectItem.call(this,s))},clearableCallback(){this.editingIndex=-1,r.options.methods.clearableCallback.call(this)}}});const Z=o.extend({name:"v-file-input",model:{prop:"value",event:"change"},props:{chips:Boolean,clearable:{type:Boolean,default:!0},counterSizeString:{type:String,default:"$vuetify.fileInput.counterSize"},counterString:{type:String,default:"$vuetify.fileInput.counter"},hideInput:Boolean,multiple:Boolean,placeholder:String,prependIcon:{type:String,default:"$file"},readonly:{type:Boolean,default:!1},showSize:{type:[Boolean,Number],default:!1,validator:e=>typeof e=="boolean"||[1e3,1024].includes(e)},smallChips:Boolean,truncateLength:{type:[Number,String],default:22},type:{type:String,default:"file"},value:{default:void 0,validator:e=>g(e).every(t=>t!=null&&typeof t=="object")}},computed:{classes(){return{...o.options.computed.classes.call(this),"v-file-input":!0}},computedCounterValue(){const e=this.multiple&&this.lazyValue?this.lazyValue.length:this.lazyValue instanceof File?1:0;if(!this.showSize)return this.$vuetify.lang.t(this.counterString,e);const t=this.internalArrayValue.reduce((s,{size:n=0})=>s+n,0);return this.$vuetify.lang.t(this.counterSizeString,e,_(t,this.base===1024))},internalArrayValue(){return g(this.internalValue)},internalValue:{get(){return this.lazyValue},set(e){this.lazyValue=e,this.$emit("change",this.lazyValue)}},isDirty(){return this.internalArrayValue.length>0},isLabelActive(){return this.isDirty},text(){return!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?[this.placeholder]:this.internalArrayValue.map(e=>{const{name:t="",size:s=0}=e,n=this.truncateText(t);return this.showSize?`${n} (${_(s,this.base===1024)})`:n})},base(){return typeof this.showSize!="boolean"?this.showSize:void 0},hasChips(){return this.chips||this.smallChips}},watch:{readonly:{handler(e){e===!0&&D("readonly is not supported on ",this)},immediate:!0},value(e){const t=this.multiple?e:e?[e]:[];C(t,this.$refs.input.files)||(this.$refs.input.value="")}},methods:{clearableCallback(){this.internalValue=this.multiple?[]:null,this.$refs.input.value=""},genChips(){return this.isDirty?this.text.map((e,t)=>this.$createElement(G,{props:{small:this.smallChips},on:{"click:close":()=>{const s=this.internalValue;s.splice(t,1),this.internalValue=s}}},[e])):[]},genControl(){const e=o.options.methods.genControl.call(this);return this.hideInput&&(e.data.style=F(e.data.style,{display:"none"})),e},genInput(){const e=o.options.methods.genInput.call(this);return e.data.attrs.multiple=this.multiple,delete e.data.domProps.value,delete e.data.on.input,e.data.on.change=this.onInput,[this.genSelections(),e]},genPrependSlot(){if(!this.prependIcon)return null;const e=this.genIcon("prepend",()=>{this.$refs.input.click()});return this.genSlot("prepend","outer",[e])},genSelectionText(){const e=this.text.length;return e<2?this.text:this.showSize&&!this.counter?[this.computedCounterValue]:[this.$vuetify.lang.t(this.counterString,e)]},genSelections(){const e=[];return this.isDirty&&this.$scopedSlots.selection?this.internalArrayValue.forEach((t,s)=>{this.$scopedSlots.selection&&e.push(this.$scopedSlots.selection({text:this.text[s],file:t,index:s}))}):e.push(this.hasChips&&this.isDirty?this.genChips():this.genSelectionText()),this.$createElement("div",{staticClass:"v-file-input__text",class:{"v-file-input__text--placeholder":this.placeholder&&!this.isDirty,"v-file-input__text--chips":this.hasChips&&!this.$scopedSlots.selection}},e)},genTextFieldSlot(){const e=o.options.methods.genTextFieldSlot.call(this);return e.data.on={...e.data.on||{},click:t=>{t.target&&t.target.nodeName==="LABEL"||this.$refs.input.click()}},e},onInput(e){const t=[...e.target.files||[]];this.internalValue=this.multiple?t:t[0],this.initialValue=this.internalValue},onKeyDown(e){this.$emit("keydown",e)},truncateText(e){if(e.length[]}},data(){return{loading:!1,file:null}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{async submit(){if(!this.$refs.form.validate())return;const e=new FormData;e.append("file",this.file);const t=await w(e);this.$emit("submit",{file:t.data})}}};var ee=function(){var t=this,s=t._self._c;return s(T,{ref:"uploadDialog",attrs:{"max-width":"750px"},model:{value:t.show,callback:function(n){t.show=n},expression:"show"}},[s(k,[s(B,[s("span",{staticClass:"headline"},[t._v("Upload To Empire Server")])]),s(L,[s(v,{ref:"form",attrs:{"on-submit":"return false;"},on:{submit:function(n){n.preventDefault()}}},[s(A,[s(p,[s(u,{attrs:{cols:"12"}},[s(Z,{ref:"fileInput",attrs:{accept:"*/*",rules:t.rules,outlined:"",dense:""},model:{value:t.file,callback:function(n){t.file=n},expression:"file"}})],1)],1)],1)],1)],1),s(z,[s(P),s(y,{attrs:{color:"blue darken-1",text:""},on:{click:function(n){n.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),s(y,{attrs:{color:"blue darken-1",text:"",loading:t.loading},on:{click:t.submit}},[t._v(" Upload ")])],1)],1)],1)},te=[],se=h(Q,ee,te,!1,null,null,null,null);const x=se.exports;function S(e,t){if(e===0)return"0 Bytes";const s=1024,n=t||2,l=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/s**c).toFixed(n))} ${l[c]}`}const ne={components:{FileUploadDialog:x},props:{value:{type:[String,Array,Number],required:!0},label:{type:String,default:"Server Files"},rules:{type:Array,default:()=>[]},maximumFileSize:{type:Number,required:!1,default:-1},returnObject:{type:Boolean,required:!1,default:!1}},data(){return{internalValue:this.value,isLoading:!1,count:0,entries:[],search:null,showDialog:!1}},computed:{fileItems(){return this.entries.map(e=>{const t=e.location.length>this.descriptionLimit?`(${S(e.size)}) ${e.location.slice(0,this.descriptionLimit)}...`:`(${S(e.size)}) ${e.location}`;return{...e,description:t}})}},watch:{internalValue(e){this.$emit("input",e)},value(e){this.internalValue=e},search(){this.doSearch()}},mounted(){this.doSearch()},methods:{doSearch(e=!0){!e&&this.fileItems.length>0||this.isLoading||(this.isLoading=!0,M({page:1,limit:-1}).then(t=>{const{records:s}=t;this.maximumFileSize>0?this.entries=s.filter(n=>n.size<=this.maximumFileSize):this.entries=s,this.count=this.entries.length}).catch(t=>{console.log(t)}).finally(()=>{this.isLoading=!1}))},fileUploaded({file:e}){this.showDialog=!1,this.doSearch(!0),this.returnObject?this.internalValue=e:this.internalValue=e.id}}};var ie=function(){var t=this,s=t._self._c;return s("div",[s(x,{attrs:{rules:t.rules},on:{submit:t.fileUploaded},model:{value:t.showDialog,callback:function(n){t.showDialog=n},expression:"showDialog"}}),s(r,{attrs:{items:t.fileItems,loading:t.isLoading,"search-input":t.search,"hide-no-data":"","hide-selected":"",clearable:"","cache-items":"","item-text":"description","item-value":"id",label:t.label,placeholder:"Start typing to Search","prepend-icon":"fa-upload",outlined:"",dense:"","return-object":t.returnObject},on:{"update:searchInput":function(n){t.search=n},"update:search-input":function(n){t.search=n},"click:prepend":function(n){t.showDialog=!0}},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}})],1)},le=[],ae=h(ne,ie,le,!1,null,null,null,null);const b=ae.exports;const re={components:{FileInput:b},props:{value:{type:[String,Array,Number],required:!0},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},name:{type:String,required:!0},rules:{type:Array,default:()=>[]},type:{type:String,default:"text"}},data(){return{internalValue:this.value}},watch:{internalValue(e){this.$emit("input",e)}},methods:{truncate(e){return e?e.length>80?`${e.substr(0,80)}...`:e:""}}};var oe=function(){var t=this,s=t._self._c;return s("div",[t.suggestedValues.length>0&&t.strict&&t.suggestedValues.includes("True")&&t.suggestedValues.includes("False")?s(Y,{attrs:{"false-value":"False","true-value":"True",label:t.name},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.name==="Bypasses"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",multiple:"",chips:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.type==="file"?s(b,{attrs:{label:t.name},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.name==="Agent"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:"","item-value":"session_id","item-text":"name"},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.name==="CredID"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:"","item-value":"id","item-text":"id"},scopedSlots:t._u([{key:"item",fn:function(n){return[s(E,[s(O,{domProps:{textContent:t._s(t.truncate(`${n.item.username}, ${n.item.domain}, ${n.item.password}`))}}),s(N,{domProps:{textContent:t._s(t.truncate(`id: ${n.item.id}, notes: ${n.item.notes}`))}})],1)]}}]),model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.suggestedValues.length>0&&!t.strict?s(X,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):t.suggestedValues.length>0&&t.strict?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}}):s(o,{attrs:{rules:t.rules,label:t.name,type:t.type==="string"?"text":"number",outlined:"",dense:"",required:""},model:{value:t.internalValue,callback:function(n){t.internalValue=n},expression:"internalValue"}})],1)},ue=[],he=h(re,oe,ue,!1,null,null,null,null);const m=he.exports;const ce={components:{DynamicFormInput:m},props:{options:{type:Object,required:!0},readonly:{type:Boolean,default:!1},priority:{type:Array,default:()=>[]}},data(){return{form:{},valid:!0}},computed:{agentStore(){return q()},listenerStore(){return K()},bypassStore(){return H()},credentialStore(){return J()},malleableProfileStore(){return W()},agents(){return this.agentStore.agents},listeners(){return this.listenerStore.listenerNames},bypasses(){return this.bypassStore.bypassNames},credentials(){return this.credentialStore.credentials},malleableProfiles(){return this.malleableProfileStore.profileNames},optionalFields(){return this.fields.filter(e=>e.required===!1).map(e=>({...e,type:this.fieldType(e)}))},requiredFields(){return this.fields.filter(e=>e.required===!0).map(e=>({...e,type:this.fieldType(e)}))},fields(){const e=Object.keys(this.options).map(t=>({name:t,...this.options[t]}));return this.priority.slice().reverse().forEach(t=>{const s=e.findIndex(n=>n.name===t);if(s>-1){const n=e.splice(s,1)[0];e.unshift(n)}}),e},rules(){return this.fields.reduce((e,t)=>(e[t.name]=[],t.required===!0&&e[t.name].push(s=>!!s||s===0||`${t.name} is required`),e),{})}},watch:{form:{handler(e){const t={...e};t.Bypasses&&(t.Bypasses=t.Bypasses.join(" ")),this.$emit("input",t)},deep:!0},fields:{immediate:!0,handler(e){const t=e.reduce((s,n)=>(n.name==="Bypasses"&&!Array.isArray(n.value)?s[n.name]=n.value.split(" ")||[]:s[n.name]=n.value==null?"":n.value,s),{});U.set(this,"form",t)}}},mounted(){this.agentStore.getAgents(),this.listenerStore.getListeners(),this.bypassStore.getBypasses(),this.malleableProfileStore.getMalleableProfiles(),this.credentialStore.getCredentials()},methods:{suggestedValuesForField(e){return e.name==="Agent"?this.agents:["Listener","RedirectListener"].includes(e.name)?this.listeners:e.name==="Bypasses"?this.bypasses:e.name==="Profile"?this.malleableProfiles:e.name==="CredID"?this.credentials:e.suggested_values},strictForField(e){return e.name==="Listener"||e.name==="Bypasses"||e.name==="Profile"||e.name==="CredID"?!0:e.strict},fieldExists(e){return this.fields.find(t=>t.name===e)},fieldType(e){return e.value_type==="INTEGER"?"number":e.value_type==="FLOAT"?"float":e.value_type==="BOOLEAN"?"boolean":e.value_type==="STRING"?"string":e.value_type==="FILE"?"file":"string"}}};var de=function(){var t=this,s=t._self._c;return s(v,{ref:"form",attrs:{readonly:t.readonly},nativeOn:{submit:function(n){return n.preventDefault(),t.submit.apply(null,arguments)}},model:{value:t.valid,callback:function(n){t.valid=n},expression:"valid"}},[t._l(t.requiredFields,function(n){return s(p,{key:n.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(n),strict:t.strictForField(n),name:n.name,rules:t.rules[n.name],type:n.type},model:{value:t.form[n.name],callback:function(l){t.$set(t.form,n.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(n.description)+" ")])],1)],1)}),t.optionalFields.length>0?s(d,[t._v(" Optional Fields ")]):t._e(),t.optionalFields.length>0?s(j,{staticClass:"mb-8"}):t._e(),t._l(t.optionalFields,function(n){return s(p,{key:n.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(n),strict:t.strictForField(n),name:n.name,rules:t.rules[n.name],type:n.type},model:{value:t.form[n.name],callback:function(l){t.$set(t.form,n.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(n.description)+" ")])],1)],1)})],2)},pe=[],me=h(ce,de,pe,!1,null,null,null,null);const xe=me.exports;export{xe as _,r as a,b,Z as c,S as f}; diff --git a/dist/assets/InfoViewer-a26545d4.js b/dist/assets/InfoViewer-98b37678.js similarity index 83% rename from dist/assets/InfoViewer-a26545d4.js rename to dist/assets/InfoViewer-98b37678.js index f7cd906..8165e0f 100644 --- a/dist/assets/InfoViewer-a26545d4.js +++ b/dist/assets/InfoViewer-98b37678.js @@ -1 +1 @@ -import{n as a}from"./index-e8f29bb9.js";import{_ as o}from"./VExpansionPanels-26c41551.js";import{_ as r,a as l,b as m}from"./VExpansionPanelHeader-a9447b85.js";import{a as i}from"./VSelect-f55906da.js";const c={props:{info:{type:Object,default:()=>{}}},methods:{formatDisplayName(s){return s.name&&s.handle?`${s.name} (${s.handle})`:s.name?s.name:s.handle?s.handle:""}}};var p=function(){var n=this,e=n._self._c;return e("div",[e(o,{staticClass:"collapse",attrs:{disabled:Object.keys(n.info).length<1}},[e(r,[Object.keys(n.info).length>0?e(l,[n._v(" "+n._s(n.info.description)+" ")]):n._e(),e(m,[e("div",{staticStyle:{"text-align":"left"}},[e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Authors:")]),n._l(n.info.authors,function(t,_){return[t.link?e(i,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",href:t.link}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")]):e(i,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",target:"_blank",rel:"noopener noreferrer"}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")])]})],2)]),e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Comments:")]),e("ul",n._l(n.info.comments,function(t,_){return e("li",{key:_},[n._v(" "+n._s(t)+" ")])}),0)])])]),n._l(n.info.extraDetails,function(t){return e("div",{key:t.key,staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",[n._v(n._s(t.key)+":")]),n._v(" "+n._s(t.value)+" ")])])})],2)],1)],1)],1)},f=[],u=a(c,p,f,!1,null,"d9b76c32",null,null);const g=u.exports;export{g as _}; +import{n as a}from"./index-e409ba63.js";import{_ as o}from"./VExpansionPanels-cacfd68a.js";import{_ as r,a as l,b as m}from"./VExpansionPanelHeader-69136628.js";import{a as i}from"./VSelect-22e7980f.js";const c={props:{info:{type:Object,default:()=>{}}},methods:{formatDisplayName(s){return s.name&&s.handle?`${s.name} (${s.handle})`:s.name?s.name:s.handle?s.handle:""}}};var p=function(){var n=this,e=n._self._c;return e("div",[e(o,{staticClass:"collapse",attrs:{disabled:Object.keys(n.info).length<1}},[e(r,[Object.keys(n.info).length>0?e(l,[n._v(" "+n._s(n.info.description)+" ")]):n._e(),e(m,[e("div",{staticStyle:{"text-align":"left"}},[e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Authors:")]),n._l(n.info.authors,function(t,_){return[t.link?e(i,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",href:t.link}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")]):e(i,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",target:"_blank",rel:"noopener noreferrer"}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")])]})],2)]),e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Comments:")]),e("ul",n._l(n.info.comments,function(t,_){return e("li",{key:_},[n._v(" "+n._s(t)+" ")])}),0)])])]),n._l(n.info.extraDetails,function(t){return e("div",{key:t.key,staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",[n._v(n._s(t.key)+":")]),n._v(" "+n._s(t.value)+" ")])])})],2)],1)],1)],1)},f=[],u=a(c,p,f,!1,null,"d9b76c32",null,null);const g=u.exports;export{g as _}; diff --git a/dist/assets/ListPageTop-5130be67.js b/dist/assets/ListPageTop-78cbc2f3.js similarity index 96% rename from dist/assets/ListPageTop-5130be67.js rename to dist/assets/ListPageTop-78cbc2f3.js index 5ab65c6..adfd725 100644 --- a/dist/assets/ListPageTop-5130be67.js +++ b/dist/assets/ListPageTop-78cbc2f3.js @@ -1 +1 @@ -import{J as p,K as c,n as u,a as o,b as a,a2 as d}from"./index-e8f29bb9.js";import{_ as f,a as h}from"./VTooltip-0015e28c.js";import{B as r}from"./VItemGroup-e39c2c83.js";const l=r.extend({name:"button-group",provide(){return{btnToggle:this}},computed:{classes(){return r.options.computed.classes.call(this)}},methods:{genData:r.options.methods.genData}});const g=p(l,c).extend({name:"v-btn-toggle",props:{backgroundColor:String,borderless:Boolean,dense:Boolean,group:Boolean,rounded:Boolean,shaped:Boolean,tile:Boolean},computed:{classes(){return{...l.options.computed.classes.call(this),"v-btn-toggle":!0,"v-btn-toggle--borderless":this.borderless,"v-btn-toggle--dense":this.dense,"v-btn-toggle--group":this.group,"v-btn-toggle--rounded":this.rounded,"v-btn-toggle--shaped":this.shaped,"v-btn-toggle--tile":this.tile,...this.themeClasses}}},methods:{genData(){const n=this.setTextColor(this.color,{...l.options.methods.genData.call(this)});return this.group?n:this.setBackgroundColor(this.backgroundColor,n)}}});const m={name:"TooltipButtonToggle",props:{value:{type:Boolean,default:!1},icon:{type:String,required:!0},buttonText:{type:String,default:""},text:{type:String,required:!0}},data(){return{internalValue:!1}},watch:{value:{immediate:!0,handler(n){this.internalValue=n}},internalValue:{handler(n){this.$emit("input",n)}}}};var v=function(){var e=this,t=e._self._c;return t(f,{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[t(g,{staticClass:"mr-5",model:{value:e.internalValue,callback:function(_){e.internalValue=_},expression:"internalValue"}},[t(o,e._g({attrs:{value:!0}},s),[t(a,{attrs:{left:""}},[e._v(" "+e._s(e.icon)+" ")]),t("span",[e._v(e._s(e.buttonText))])],1)],1)]}}])},[t("span",[e._v(e._s(e.text))])])},b=[],x=u(m,v,b,!1,null,null,null,null);const i=x.exports;const y={name:"ListPageTop",components:{TooltipButtonToggle:i},props:{deleteText:{type:String,default:"Delete"},refreshText:{type:String,default:"Refresh"},createText:{type:String,default:"Create"},showDelete:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},showCreate:{type:Boolean,default:!1},refreshLoading:{type:Boolean,default:!1},isAutoRefresh:{type:Boolean,default:!1},autoRefresh:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}},data(){return{autoRefreshInternal:!1}},watch:{autoRefresh:{immediate:!0,handler(n){this.autoRefreshInternal=n}},autoRefreshInternal:{handler(n){this.$emit("update:auto-refresh",n)}}}};var B=function(){var e=this,t=e._self._c;return t("portal",{attrs:{to:"app-bar"}},[t("div",{staticClass:"v-toolbar__content pt-2",staticStyle:{width:"100%"}},[t(h,{attrs:{items:e.breads}}),t(d),t("div",{staticClass:"pt-2"},[e._t("extra-stuff")],2),t("div",[e.showDelete?t(o,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(s){return e.$emit("delete")}}},[e._v(" "+e._s(e.deleteText)+" "),t(a,{attrs:{right:""}},[e._v(" fa-trash-alt ")])],1):e._e(),e.showRefresh&&!e.isAutoRefresh?t(o,{staticClass:"mr-2",attrs:{disabled:e.refreshLoading,color:"primary",text:""},on:{click:function(s){return e.$emit("refresh")}}},[e._v(" "+e._s(e.refreshText)+" "),t(a,{attrs:{right:""}},[e._v(" fa-redo "+e._s(e.refreshLoading?"fa-spin":"")+" ")])],1):e._e(),e.showRefresh&&e.isAutoRefresh?t(i,{attrs:{icon:"fa-redo","button-text":e.autoRefreshInternal?"On":"Off",text:e.refreshText},model:{value:e.autoRefreshInternal,callback:function(s){e.autoRefreshInternal=s},expression:"autoRefreshInternal"}}):e._e(),e.showCreate?t(o,{staticClass:"mr-2",attrs:{color:"primary",rounded:""},on:{click:function(s){return e.$emit("create")}}},[e._v(" "+e._s(e.createText)+" "),t(a,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1):e._e()],1)],1)])},T=[],R=u(y,B,T,!1,null,null,null,null);const k=R.exports;export{k as _,i as a}; +import{J as p,K as c,n as u,a as o,b as a,a2 as d}from"./index-e409ba63.js";import{_ as f,a as h}from"./VTooltip-7c0b187f.js";import{B as r}from"./VItemGroup-3637266a.js";const l=r.extend({name:"button-group",provide(){return{btnToggle:this}},computed:{classes(){return r.options.computed.classes.call(this)}},methods:{genData:r.options.methods.genData}});const g=p(l,c).extend({name:"v-btn-toggle",props:{backgroundColor:String,borderless:Boolean,dense:Boolean,group:Boolean,rounded:Boolean,shaped:Boolean,tile:Boolean},computed:{classes(){return{...l.options.computed.classes.call(this),"v-btn-toggle":!0,"v-btn-toggle--borderless":this.borderless,"v-btn-toggle--dense":this.dense,"v-btn-toggle--group":this.group,"v-btn-toggle--rounded":this.rounded,"v-btn-toggle--shaped":this.shaped,"v-btn-toggle--tile":this.tile,...this.themeClasses}}},methods:{genData(){const n=this.setTextColor(this.color,{...l.options.methods.genData.call(this)});return this.group?n:this.setBackgroundColor(this.backgroundColor,n)}}});const m={name:"TooltipButtonToggle",props:{value:{type:Boolean,default:!1},icon:{type:String,required:!0},buttonText:{type:String,default:""},text:{type:String,required:!0}},data(){return{internalValue:!1}},watch:{value:{immediate:!0,handler(n){this.internalValue=n}},internalValue:{handler(n){this.$emit("input",n)}}}};var v=function(){var e=this,t=e._self._c;return t(f,{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[t(g,{staticClass:"mr-5",model:{value:e.internalValue,callback:function(_){e.internalValue=_},expression:"internalValue"}},[t(o,e._g({attrs:{value:!0}},s),[t(a,{attrs:{left:""}},[e._v(" "+e._s(e.icon)+" ")]),t("span",[e._v(e._s(e.buttonText))])],1)],1)]}}])},[t("span",[e._v(e._s(e.text))])])},b=[],x=u(m,v,b,!1,null,null,null,null);const i=x.exports;const y={name:"ListPageTop",components:{TooltipButtonToggle:i},props:{deleteText:{type:String,default:"Delete"},refreshText:{type:String,default:"Refresh"},createText:{type:String,default:"Create"},showDelete:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},showCreate:{type:Boolean,default:!1},refreshLoading:{type:Boolean,default:!1},isAutoRefresh:{type:Boolean,default:!1},autoRefresh:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}},data(){return{autoRefreshInternal:!1}},watch:{autoRefresh:{immediate:!0,handler(n){this.autoRefreshInternal=n}},autoRefreshInternal:{handler(n){this.$emit("update:auto-refresh",n)}}}};var B=function(){var e=this,t=e._self._c;return t("portal",{attrs:{to:"app-bar"}},[t("div",{staticClass:"v-toolbar__content pt-2",staticStyle:{width:"100%"}},[t(h,{attrs:{items:e.breads}}),t(d),t("div",{staticClass:"pt-2"},[e._t("extra-stuff")],2),t("div",[e.showDelete?t(o,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(s){return e.$emit("delete")}}},[e._v(" "+e._s(e.deleteText)+" "),t(a,{attrs:{right:""}},[e._v(" fa-trash-alt ")])],1):e._e(),e.showRefresh&&!e.isAutoRefresh?t(o,{staticClass:"mr-2",attrs:{disabled:e.refreshLoading,color:"primary",text:""},on:{click:function(s){return e.$emit("refresh")}}},[e._v(" "+e._s(e.refreshText)+" "),t(a,{attrs:{right:""}},[e._v(" fa-redo "+e._s(e.refreshLoading?"fa-spin":"")+" ")])],1):e._e(),e.showRefresh&&e.isAutoRefresh?t(i,{attrs:{icon:"fa-redo","button-text":e.autoRefreshInternal?"On":"Off",text:e.refreshText},model:{value:e.autoRefreshInternal,callback:function(s){e.autoRefreshInternal=s},expression:"autoRefreshInternal"}}):e._e(),e.showCreate?t(o,{staticClass:"mr-2",attrs:{color:"primary",rounded:""},on:{click:function(s){return e.$emit("create")}}},[e._v(" "+e._s(e.createText)+" "),t(a,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1):e._e()],1)],1)])},T=[],R=u(y,B,T,!1,null,null,null,null);const k=R.exports;export{k as _,i as a}; diff --git a/dist/assets/ListenerEdit-bf632b6f.js b/dist/assets/ListenerEdit-ab50e922.js similarity index 89% rename from dist/assets/ListenerEdit-bf632b6f.js rename to dist/assets/ListenerEdit-ab50e922.js index e0fe155..d3b6116 100644 --- a/dist/assets/ListenerEdit-bf632b6f.js +++ b/dist/assets/ListenerEdit-ab50e922.js @@ -1 +1 @@ -import{_ as l,a as m}from"./GeneralForm-ad50630d.js";import{_ as c}from"./InfoViewer-a26545d4.js";import{_ as d,a as h,b as _,c as f}from"./ErrorStateAlert-44af51cd.js";import{_ as p}from"./TagViewer-357f9253.js";import{_ as u}from"./EditPageTop-4e0a4ef6.js";import{n as g,l as w,r as y,m as b,o as $,p as T,s as n,t as v,v as L,k,a as E,b as x,d as N,e as a,f as o,i as C,c as S}from"./index-e8f29bb9.js";import{_ as I}from"./VSwitch-2cfffd69.js";import"./VSelect-f55906da.js";import"./bypass-module-9d0c5e38.js";import"./bypass-api-80f88682.js";import"./credential-module-512a6f9e.js";import"./malleable-module-cb1f5265.js";import"./malleable-api-d0b35547.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";import"./VExpansionPanelHeader-a9447b85.js";import"./TooltipButton-ef876422.js";import"./VTooltip-0015e28c.js";const M={name:"ListenerEdit",components:{TagViewer:p,InfoViewer:c,GeneralForm:l,ErrorStateAlert:d,EditPageTop:u},data(){return{listener:{options:{}},listenerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Name","Host","Port"],errorState:!1,validationMessage:null,initialLoad:!1,commonStagers:["multi_launcher","multi_macro","windows_csharp_exe","windows_dll","windows_shellcode"]}},computed:{listenerStore(){return w()},listenerTemplateIds(){return this.listenerStore.templateIds},isNew(){return this.$route.name==="listenerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return this.isNew||!this.listener.enabled},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"listenerNew",params:{copy:!0,id:this.id}}:{}},listenerInfo(){if(!this.listenerTemplate)return{};const t=this.listenerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},listenerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.listener.options).forEach(s=>{e[s]={...this.listenerTemplate.options[s]},e[s].value=this.listener.options[s]}),e}const{options:t}=this.listenerTemplate;return t||{}},breads(){return[{text:"Listeners",disabled:!1,to:"/listeners",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/listeners-edit"}]},breadcrumbName(){return this.isCopy?"New":this.listener.name?this.listener.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await y(t).catch(s=>this.$snack.error(`Error: ${s}`));e&&(this.reset=!1,this.listenerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getListener(t)}},mounted(){this.listenerStore.getListenerTemplates(),(!this.isNew||this.isCopy)&&this.getListener(this.$route.params.id)},methods:{deleteTag(t){b(this.listener.id,t.id).then(()=>{this.listener.tags=this.listener.tags.filter(e=>e.id!==t.id)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){$(this.listener.id,t).then(e=>{const s=this.listener.tags.findIndex(i=>i.id===e.id);this.listener.tags.splice(s,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){T(this.listener.id,t).then(e=>{this.listener.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},async submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?n({...this.listener,options:this.form}).then(()=>{this.$snack.success("Listener updated"),this.loading=!1}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}):v(this.selectedTemplate,this.form).then(({id:t})=>{this.$snack.success("Listener created"),this.loading=!1,this.$router.push({name:"listenerEdit",params:{id:t}})}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}))},async kill(){if(await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${this.form.Name}?`,{color:"red"}))try{await this.listenerStore.killListener(this.id),this.$router.push({name:"listeners"})}catch(t){this.$snack.error(`Error: ${t}`)}},getListener(t){L(t).then(e=>{this.listener=e,this.listener.tags.forEach(s=>{s.color=s.color||"#0E0CDA"}),this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},async toggleEnabled(t){if(this.listener.enabled=t,t===!0&&!await this.$root.$confirm("","Re-enabling the listener will also save any unsaved option changes.",{color:"yellow"})){this.listener.enabled=!t;return}try{const e=await n({...this.listener,options:this.form});this.listener=e}catch(e){this.listener.enabled=!t,this.$snack.error(`Error: ${e}`)}}}};var O=function(){var e=this,s=e._self._c;return s("div",[s(u,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.kill},scopedSlots:e._u([{key:"extra-stuff",fn:function(){return[s("div",{staticClass:"pt-2",staticStyle:{display:"flex","flex-direction":"row"}},[!e.isNew&&e.initialLoad?s(I,{staticClass:"mr-2",attrs:{color:"green",label:"Enabled"},on:{change:e.toggleEnabled},model:{value:e.listener.enabled,callback:function(i){e.$set(e.listener,"enabled",i)},expression:"listener.enabled"}}):e._e(),!e.isNew&&e.initialLoad?s(k,{attrs:{"offset-y":"","open-on-hover":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:r}){return[s(E,e._g(e._b({staticClass:"mr-5",attrs:{text:"",icon:"",small:""}},"v-btn",r,!1),i),[s(x,[e._v("fa-suitcase-rolling")])],1)]}}],null,!1,265209208)},[s(N,{staticClass:"ml-2 mr-2"},[e._l(e.commonStagers,function(i,r){return s(a,{key:r,attrs:{link:"",to:{name:"stagerNew",query:{template:i,listener:e.listener.name}}}},[s(o,[e._v(" "+e._s(i)+" ")])],1)}),s(C),s(a,{attrs:{link:"",to:{name:"stagerNew"}}},[s(o,[e._v(" Other ")])],1)],2)],1):e._e()],1)]},proxy:!0}])}),s("div",{staticClass:"headers"},[s("h3",[e._v(e._s(e.mode)+" Listener")])]),e.isNew?e._e():s(p,{attrs:{tags:e.listener.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?s(d,{attrs:{"resource-id":e.id,"resource-type":"listener"}}):s(S,{staticStyle:{padding:"10px"}},[s(c,{staticClass:"info-viewer",attrs:{info:e.listenerInfo}}),s(m,{attrs:{items:e.listenerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(i){e.selectedTemplate=i},expression:"selectedTemplate"}}),e.validationMessage?s(h,{attrs:{prominent:"",type:"warning"}},[s(_,{attrs:{align:"center"}},[s(f,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" "+e._s(e.validationMessage)+" ")])],1)],1):e._e(),e.reset?s(l,{ref:"generalform",attrs:{options:e.listenerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},P=[],V=g(M,O,P,!1,null,null,null,null);const ee=V.exports;export{ee as default}; +import{_ as l,a as m}from"./GeneralForm-e1472145.js";import{_ as c}from"./InfoViewer-98b37678.js";import{_ as d,a as h,b as _,c as f}from"./ErrorStateAlert-3d45e0aa.js";import{_ as p}from"./TagViewer-81c3b950.js";import{_ as u}from"./EditPageTop-0ed1194e.js";import{n as g,l as w,r as y,m as b,o as $,p as T,s as n,t as v,v as L,k,a as E,b as x,d as N,e as a,f as o,i as C,c as S}from"./index-e409ba63.js";import{_ as I}from"./VSwitch-3f004360.js";import"./VSelect-22e7980f.js";import"./bypass-module-4e86a448.js";import"./bypass-api-6126dc83.js";import"./credential-module-93372e4e.js";import"./malleable-module-2a911c2d.js";import"./malleable-api-09135b63.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";import"./VExpansionPanelHeader-69136628.js";import"./TooltipButton-f53c45a7.js";import"./VTooltip-7c0b187f.js";const M={name:"ListenerEdit",components:{TagViewer:p,InfoViewer:c,GeneralForm:l,ErrorStateAlert:d,EditPageTop:u},data(){return{listener:{options:{}},listenerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Name","Host","Port"],errorState:!1,validationMessage:null,initialLoad:!1,commonStagers:["multi_launcher","multi_macro","windows_csharp_exe","windows_dll","windows_shellcode"]}},computed:{listenerStore(){return w()},listenerTemplateIds(){return this.listenerStore.templateIds},isNew(){return this.$route.name==="listenerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return this.isNew||!this.listener.enabled},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"listenerNew",params:{copy:!0,id:this.id}}:{}},listenerInfo(){if(!this.listenerTemplate)return{};const t=this.listenerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},listenerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.listener.options).forEach(s=>{e[s]={...this.listenerTemplate.options[s]},e[s].value=this.listener.options[s]}),e}const{options:t}=this.listenerTemplate;return t||{}},breads(){return[{text:"Listeners",disabled:!1,to:"/listeners",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/listeners-edit"}]},breadcrumbName(){return this.isCopy?"New":this.listener.name?this.listener.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await y(t).catch(s=>this.$snack.error(`Error: ${s}`));e&&(this.reset=!1,this.listenerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getListener(t)}},mounted(){this.listenerStore.getListenerTemplates(),(!this.isNew||this.isCopy)&&this.getListener(this.$route.params.id)},methods:{deleteTag(t){b(this.listener.id,t.id).then(()=>{this.listener.tags=this.listener.tags.filter(e=>e.id!==t.id)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){$(this.listener.id,t).then(e=>{const s=this.listener.tags.findIndex(i=>i.id===e.id);this.listener.tags.splice(s,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){T(this.listener.id,t).then(e=>{this.listener.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},async submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?n({...this.listener,options:this.form}).then(()=>{this.$snack.success("Listener updated"),this.loading=!1}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}):v(this.selectedTemplate,this.form).then(({id:t})=>{this.$snack.success("Listener created"),this.loading=!1,this.$router.push({name:"listenerEdit",params:{id:t}})}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}))},async kill(){if(await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${this.form.Name}?`,{color:"red"}))try{await this.listenerStore.killListener(this.id),this.$router.push({name:"listeners"})}catch(t){this.$snack.error(`Error: ${t}`)}},getListener(t){L(t).then(e=>{this.listener=e,this.listener.tags.forEach(s=>{s.color=s.color||"#0E0CDA"}),this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},async toggleEnabled(t){if(this.listener.enabled=t,t===!0&&!await this.$root.$confirm("","Re-enabling the listener will also save any unsaved option changes.",{color:"yellow"})){this.listener.enabled=!t;return}try{const e=await n({...this.listener,options:this.form});this.listener=e}catch(e){this.listener.enabled=!t,this.$snack.error(`Error: ${e}`)}}}};var O=function(){var e=this,s=e._self._c;return s("div",[s(u,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.kill},scopedSlots:e._u([{key:"extra-stuff",fn:function(){return[s("div",{staticClass:"pt-2",staticStyle:{display:"flex","flex-direction":"row"}},[!e.isNew&&e.initialLoad?s(I,{staticClass:"mr-2",attrs:{color:"green",label:"Enabled"},on:{change:e.toggleEnabled},model:{value:e.listener.enabled,callback:function(i){e.$set(e.listener,"enabled",i)},expression:"listener.enabled"}}):e._e(),!e.isNew&&e.initialLoad?s(k,{attrs:{"offset-y":"","open-on-hover":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:r}){return[s(E,e._g(e._b({staticClass:"mr-5",attrs:{text:"",icon:"",small:""}},"v-btn",r,!1),i),[s(x,[e._v("fa-suitcase-rolling")])],1)]}}],null,!1,265209208)},[s(N,{staticClass:"ml-2 mr-2"},[e._l(e.commonStagers,function(i,r){return s(a,{key:r,attrs:{link:"",to:{name:"stagerNew",query:{template:i,listener:e.listener.name}}}},[s(o,[e._v(" "+e._s(i)+" ")])],1)}),s(C),s(a,{attrs:{link:"",to:{name:"stagerNew"}}},[s(o,[e._v(" Other ")])],1)],2)],1):e._e()],1)]},proxy:!0}])}),s("div",{staticClass:"headers"},[s("h3",[e._v(e._s(e.mode)+" Listener")])]),e.isNew?e._e():s(p,{attrs:{tags:e.listener.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?s(d,{attrs:{"resource-id":e.id,"resource-type":"listener"}}):s(S,{staticStyle:{padding:"10px"}},[s(c,{staticClass:"info-viewer",attrs:{info:e.listenerInfo}}),s(m,{attrs:{items:e.listenerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(i){e.selectedTemplate=i},expression:"selectedTemplate"}}),e.validationMessage?s(h,{attrs:{prominent:"",type:"warning"}},[s(_,{attrs:{align:"center"}},[s(f,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" "+e._s(e.validationMessage)+" ")])],1)],1):e._e(),e.reset?s(l,{ref:"generalform",attrs:{options:e.listenerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},P=[],V=g(M,O,P,!1,null,null,null,null);const ee=V.exports;export{ee as default}; diff --git a/dist/assets/Listeners-0f3a3f0e.js b/dist/assets/Listeners-ab1b83c8.js similarity index 93% rename from dist/assets/Listeners-0f3a3f0e.js rename to dist/assets/Listeners-ab1b83c8.js index d23ee20..4f5aa75 100644 --- a/dist/assets/Listeners-0f3a3f0e.js +++ b/dist/assets/Listeners-ab1b83c8.js @@ -1 +1 @@ -import{_ as o}from"./DateTimeDisplay-e5665873.js";import{_ as c}from"./ListPageTop-5130be67.js";import{h as _}from"./moment-fbc5633a.js";import{u as S}from"./malleable-module-cb1f5265.js";import{n as u,j as D,k as g,a as h,b as r,d as v,e as n,f as i,i as b,l as y,m as M,o as C,p as E,q as A,c as m}from"./index-e8f29bb9.js";import{_ as k}from"./VDataTable-f3602581.js";import{_ as x}from"./TagViewer-357f9253.js";import{_ as $}from"./ExpansionPanelFilter-33a56e95.js";import{_ as w}from"./AdvancedTable-147b64b8.js";import{g as B}from"./tag-api-c942253a.js";import{_ as N,a as f,b as F,c as p}from"./VTabItem-e0010b3a.js";import"./VTooltip-0015e28c.js";import"./VItemGroup-e39c2c83.js";import"./malleable-api-d0b35547.js";import"./VSelect-f55906da.js";import"./VExpansionPanelHeader-a9447b85.js";import"./VExpansionPanels-26c41551.js";const q={name:"MalleableProfiles",components:{DateTimeDisplay:o,ListPageTop:c},props:{active:{type:Boolean,default:!0}},data(){return{breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"Malleable Profiles",disabled:!0,href:"/malleable-profiles"}],headers:[{text:"Name",value:"name"},{text:"Category",value:"category"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:_,filter:"",selected:[]}},computed:{malleableProfileStore(){return S()},malleableProfiles(){return this.malleableProfileStore.malleableProfiles},showDelete(){return this.selected.length>0}},mounted(){this.getMalleableProfiles()},methods:{getMalleableProfiles(){this.malleableProfileStore.getMalleableProfiles()},create(){this.$router.push({name:"malleableProfileNew"})},view(a){this.$router.push({name:"malleableProfileEdit",params:{id:a.id}})},async deleteMalleableProfile(a){await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${a.name}?`,{color:"red"})&&await this.malleableProfileStore.deleteMalleableProfile(a.id)},async deleteMalleableProfiles(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} profiles?`,{color:"red"})&&(this.selected.forEach(a=>{this.malleableProfileStore.deleteMalleableProfile(a.id)}),this.selected=[])}}};var R=function(){var e=this,t=e._self._c;return t("div",[e.active?t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteMalleableProfiles,refresh:e.getMalleableProfiles}},[t("template",{slot:"extra-stuff"},[t(D,{staticStyle:{"max-width":"250px","padding-top":"25px"},attrs:{"append-icon":"mdi-magnify",outlined:"",dense:"",label:"Search"},model:{value:e.filter,callback:function(s){e.filter=s},expression:"filter"}})],1)],2):e._e(),t(k,{attrs:{headers:e.headers,items:e.malleableProfiles,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",search:e.filter,dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(s){e.sortBy=s},"update:sort-by":function(s){e.sortBy=s},"update:sortDesc":function(s){e.sortDesc=s},"update:sort-desc":function(s){e.sortDesc=s}},scopedSlots:e._u([{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.updated_at",fn:function({item:s}){return[t(o,{attrs:{timestamp:s.updated_at}})]}},{key:"item.actions",fn:function({item:s}){return[t(g,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:d}){return[t(h,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",d,!1),l),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(v,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:s.id}}}},[t(i,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"malleableProfileNew",params:{copy:!0,id:s.id}},link:""}},[t(i,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(l){return e.deleteMalleableProfile(s)}}},[t(i,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},V=[],H=u(q,R,V,!1,null,null,null,null);const T=H.exports;const I={name:"ListenersTable",components:{DateTimeDisplay:o,TagViewer:x},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]}},data(){return{moment:_,headers:[{text:"",align:"start",sortable:!1,width:"5px",value:"enabled"},{text:"Name",value:"name"},{text:"Template",value:"template"},{text:"Host",value:"options.Host"},{text:"Port",value:"options.Port"},{text:"Created At",value:"created_at"},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{listenerStore(){return y()},listenersStatus(){return this.listenerStore.status},sortedListeners(){let a=this.listenerStore.listeners.slice();return this.selectedTags.length===0||(a=a.filter(e=>e.tags.map(s=>`${s.name}:${s.value}`).some(s=>this.selectedTags.includes(s)))),a}},watch:{selectedTags(){this.getListeners()},selected(a){this.$emit("input",a)}},mounted(){this.getListeners()},methods:{deleteTag(a,e){M(a.id,e.id).then(()=>{a.tags=a.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(a,e){C(a.id,e).then(t=>{const s=a.tags.findIndex(l=>l.id===t.id);a.tags.splice(s,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(a,e){E(a.id,e).then(t=>{a.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},async killListener(a){this.$emit("kill-listener",a)},getListeners(){this.listenerStore.getListeners()}}};var O=function(){var e=this,t=e._self._c;return t("div",[t(k,{attrs:{loading:e.listenersStatus==="loading",headers:e.headers,items:e.sortedListeners,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.enabled",fn:function({item:s}){return[t(A,{attrs:{dot:"",color:s.enabled===!0?"green":"red"}})]}},{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.created_at",fn:function({item:s}){return[t(o,{attrs:{timestamp:s.created_at}})]}},{key:"item.tags",fn:function({item:s}){return[t(x,{attrs:{tags:s.tags},on:{"update-tag":function(l){return e.updateTag(s,...arguments)},"delete-tag":function(l){return e.deleteTag(s,...arguments)},"new-tag":function(l){return e.addTag(s,...arguments)}}})]}},{key:"item.actions",fn:function({item:s}){return[t(g,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:d}){return[t(h,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",d,!1),l),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(v,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:s.id}}}},[t(i,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"listenerNew",params:{copy:!0,id:s.id}},link:""}},[t(i,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(l){return e.killListener(s)}}},[t(i,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},j=[],z=u(I,O,j,!1,null,null,null,null);const L=z.exports;const U={name:"Listeners",components:{AdvancedTable:w,ListenersTable:L,ExpansionPanelFilter:$,ListPageTop:c},props:{active:{type:Boolean,default:!0}},data(){return{moment:_,breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"List",disabled:!0,href:"/listeners?tab=list-view"}],selected:[],tags:[],selectedTags:[]}},computed:{listenerStore(){return y()},listenersStatus(){return this.listenerStore.status},showDelete(){return this.selected.length>0}},mounted(){this.getListeners(),this.getTags()},methods:{async getTags(){const a=await B({page:1,limit:-1,sources:"listener"}),e=[];a.records.forEach(t=>{e.find(l=>l.name===t.name&&l.value===t.value)||e.push(t)}),this.tags=e},create(){this.$router.push({name:"listenerNew"})},async killListener(a){await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${a.name}?`,{color:"red"})&&await this.listenerStore.killListener(a.id)},async killListeners(){await this.$root.$confirm("Delete",`Are you sure you want to kill ${this.selected.length} listeners?`,{color:"red"})&&(this.selected.forEach(a=>{this.listenerStore.killListener(a.id)}),this.selected=[])},getListeners(){this.$refs.listenersTable.getListeners()}}};var G=function(){var e=this,t=e._self._c;return t("div",{},[e.active?t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"refresh-loading":e.listenersStatus==="loading","show-delete":e.showDelete},on:{create:e.create,delete:e.killListeners,refresh:e.getListeners}}):e._e(),t(w,{scopedSlots:e._u([{key:"filters",fn:function(){return[t($,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(s){e.selectedTags=s},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(L,{ref:"listenersTable",attrs:{"selected-tags":e.selectedTags},on:{"kill-listener":e.killListener},model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})]},proxy:!0}])})],1)},J=[],K=u(U,G,J,!1,null,null,null,null);const P=K.exports;const Q={name:"Listeners",components:{ListenersList:P,MalleableProfilesList:T},data(){return{}},computed:{tab:{set(a){this.$router.replace({query:{...this.$route.query,tab:a}})},get(){return this.$route.query.tab||"list-view"}}}};var W=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(N,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[t(f,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(f,{key:"malleable-profiles",attrs:{href:"#malleable-profiles"}},[e._v(" Malleable Profiles "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-random ")])],1)],1)],1)]),t(F,{model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[t(p,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(m,{attrs:{flat:""}},[t(P,{attrs:{active:e.tab==="list-view"}})],1)],1),t(p,{key:"malleable-profiles",attrs:{value:"malleable-profiles",transition:!1,"reverse-transition":!1}},[t(m,{attrs:{flat:""}},[t(T,{attrs:{active:e.tab==="malleable-profiles"}})],1)],1)],1)],1)},X=[],Y=u(Q,W,X,!1,null,null,null,null);const ge=Y.exports;export{ge as default}; +import{_ as o}from"./DateTimeDisplay-951c60c5.js";import{_ as c}from"./ListPageTop-78cbc2f3.js";import{h as _}from"./moment-fbc5633a.js";import{u as S}from"./malleable-module-2a911c2d.js";import{n as u,j as D,k as g,a as h,b as r,d as v,e as n,f as i,i as b,l as y,m as M,o as C,p as E,q as A,c as m}from"./index-e409ba63.js";import{_ as k}from"./VDataTable-dab2ebf1.js";import{_ as x}from"./TagViewer-81c3b950.js";import{_ as $}from"./ExpansionPanelFilter-010a2264.js";import{_ as w}from"./AdvancedTable-e51651be.js";import{g as B}from"./tag-api-d7e45ad4.js";import{_ as N,a as f,b as F,c as p}from"./VTabItem-01f057dc.js";import"./VTooltip-7c0b187f.js";import"./VItemGroup-3637266a.js";import"./malleable-api-09135b63.js";import"./VSelect-22e7980f.js";import"./VExpansionPanelHeader-69136628.js";import"./VExpansionPanels-cacfd68a.js";const q={name:"MalleableProfiles",components:{DateTimeDisplay:o,ListPageTop:c},props:{active:{type:Boolean,default:!0}},data(){return{breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"Malleable Profiles",disabled:!0,href:"/malleable-profiles"}],headers:[{text:"Name",value:"name"},{text:"Category",value:"category"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:_,filter:"",selected:[]}},computed:{malleableProfileStore(){return S()},malleableProfiles(){return this.malleableProfileStore.malleableProfiles},showDelete(){return this.selected.length>0}},mounted(){this.getMalleableProfiles()},methods:{getMalleableProfiles(){this.malleableProfileStore.getMalleableProfiles()},create(){this.$router.push({name:"malleableProfileNew"})},view(a){this.$router.push({name:"malleableProfileEdit",params:{id:a.id}})},async deleteMalleableProfile(a){await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${a.name}?`,{color:"red"})&&await this.malleableProfileStore.deleteMalleableProfile(a.id)},async deleteMalleableProfiles(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} profiles?`,{color:"red"})&&(this.selected.forEach(a=>{this.malleableProfileStore.deleteMalleableProfile(a.id)}),this.selected=[])}}};var R=function(){var e=this,t=e._self._c;return t("div",[e.active?t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteMalleableProfiles,refresh:e.getMalleableProfiles}},[t("template",{slot:"extra-stuff"},[t(D,{staticStyle:{"max-width":"250px","padding-top":"25px"},attrs:{"append-icon":"mdi-magnify",outlined:"",dense:"",label:"Search"},model:{value:e.filter,callback:function(s){e.filter=s},expression:"filter"}})],1)],2):e._e(),t(k,{attrs:{headers:e.headers,items:e.malleableProfiles,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",search:e.filter,dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(s){e.sortBy=s},"update:sort-by":function(s){e.sortBy=s},"update:sortDesc":function(s){e.sortDesc=s},"update:sort-desc":function(s){e.sortDesc=s}},scopedSlots:e._u([{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.updated_at",fn:function({item:s}){return[t(o,{attrs:{timestamp:s.updated_at}})]}},{key:"item.actions",fn:function({item:s}){return[t(g,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:d}){return[t(h,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",d,!1),l),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(v,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:s.id}}}},[t(i,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"malleableProfileNew",params:{copy:!0,id:s.id}},link:""}},[t(i,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(l){return e.deleteMalleableProfile(s)}}},[t(i,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},V=[],H=u(q,R,V,!1,null,null,null,null);const T=H.exports;const I={name:"ListenersTable",components:{DateTimeDisplay:o,TagViewer:x},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]}},data(){return{moment:_,headers:[{text:"",align:"start",sortable:!1,width:"5px",value:"enabled"},{text:"Name",value:"name"},{text:"Template",value:"template"},{text:"Host",value:"options.Host"},{text:"Port",value:"options.Port"},{text:"Created At",value:"created_at"},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{listenerStore(){return y()},listenersStatus(){return this.listenerStore.status},sortedListeners(){let a=this.listenerStore.listeners.slice();return this.selectedTags.length===0||(a=a.filter(e=>e.tags.map(s=>`${s.name}:${s.value}`).some(s=>this.selectedTags.includes(s)))),a}},watch:{selectedTags(){this.getListeners()},selected(a){this.$emit("input",a)}},mounted(){this.getListeners()},methods:{deleteTag(a,e){M(a.id,e.id).then(()=>{a.tags=a.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(a,e){C(a.id,e).then(t=>{const s=a.tags.findIndex(l=>l.id===t.id);a.tags.splice(s,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(a,e){E(a.id,e).then(t=>{a.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},async killListener(a){this.$emit("kill-listener",a)},getListeners(){this.listenerStore.getListeners()}}};var O=function(){var e=this,t=e._self._c;return t("div",[t(k,{attrs:{loading:e.listenersStatus==="loading",headers:e.headers,items:e.sortedListeners,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.enabled",fn:function({item:s}){return[t(A,{attrs:{dot:"",color:s.enabled===!0?"green":"red"}})]}},{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.created_at",fn:function({item:s}){return[t(o,{attrs:{timestamp:s.created_at}})]}},{key:"item.tags",fn:function({item:s}){return[t(x,{attrs:{tags:s.tags},on:{"update-tag":function(l){return e.updateTag(s,...arguments)},"delete-tag":function(l){return e.deleteTag(s,...arguments)},"new-tag":function(l){return e.addTag(s,...arguments)}}})]}},{key:"item.actions",fn:function({item:s}){return[t(g,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:d}){return[t(h,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",d,!1),l),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(v,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:s.id}}}},[t(i,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"listenerNew",params:{copy:!0,id:s.id}},link:""}},[t(i,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(l){return e.killListener(s)}}},[t(i,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},j=[],z=u(I,O,j,!1,null,null,null,null);const L=z.exports;const U={name:"Listeners",components:{AdvancedTable:w,ListenersTable:L,ExpansionPanelFilter:$,ListPageTop:c},props:{active:{type:Boolean,default:!0}},data(){return{moment:_,breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"List",disabled:!0,href:"/listeners?tab=list-view"}],selected:[],tags:[],selectedTags:[]}},computed:{listenerStore(){return y()},listenersStatus(){return this.listenerStore.status},showDelete(){return this.selected.length>0}},mounted(){this.getListeners(),this.getTags()},methods:{async getTags(){const a=await B({page:1,limit:-1,sources:"listener"}),e=[];a.records.forEach(t=>{e.find(l=>l.name===t.name&&l.value===t.value)||e.push(t)}),this.tags=e},create(){this.$router.push({name:"listenerNew"})},async killListener(a){await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${a.name}?`,{color:"red"})&&await this.listenerStore.killListener(a.id)},async killListeners(){await this.$root.$confirm("Delete",`Are you sure you want to kill ${this.selected.length} listeners?`,{color:"red"})&&(this.selected.forEach(a=>{this.listenerStore.killListener(a.id)}),this.selected=[])},getListeners(){this.$refs.listenersTable.getListeners()}}};var G=function(){var e=this,t=e._self._c;return t("div",{},[e.active?t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"refresh-loading":e.listenersStatus==="loading","show-delete":e.showDelete},on:{create:e.create,delete:e.killListeners,refresh:e.getListeners}}):e._e(),t(w,{scopedSlots:e._u([{key:"filters",fn:function(){return[t($,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(s){e.selectedTags=s},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(L,{ref:"listenersTable",attrs:{"selected-tags":e.selectedTags},on:{"kill-listener":e.killListener},model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})]},proxy:!0}])})],1)},J=[],K=u(U,G,J,!1,null,null,null,null);const P=K.exports;const Q={name:"Listeners",components:{ListenersList:P,MalleableProfilesList:T},data(){return{}},computed:{tab:{set(a){this.$router.replace({query:{...this.$route.query,tab:a}})},get(){return this.$route.query.tab||"list-view"}}}};var W=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(N,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[t(f,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(f,{key:"malleable-profiles",attrs:{href:"#malleable-profiles"}},[e._v(" Malleable Profiles "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-random ")])],1)],1)],1)]),t(F,{model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[t(p,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(m,{attrs:{flat:""}},[t(P,{attrs:{active:e.tab==="list-view"}})],1)],1),t(p,{key:"malleable-profiles",attrs:{value:"malleable-profiles",transition:!1,"reverse-transition":!1}},[t(m,{attrs:{flat:""}},[t(T,{attrs:{active:e.tab==="malleable-profiles"}})],1)],1)],1)],1)},X=[],Y=u(Q,W,X,!1,null,null,null,null);const ge=Y.exports;export{ge as default}; diff --git a/dist/assets/MalleableProfileEdit-5d06b59a.js b/dist/assets/MalleableProfileEdit-120c7dd8.js similarity index 90% rename from dist/assets/MalleableProfileEdit-5d06b59a.js rename to dist/assets/MalleableProfileEdit-120c7dd8.js index bd95feb..2cee7b4 100644 --- a/dist/assets/MalleableProfileEdit-5d06b59a.js +++ b/dist/assets/MalleableProfileEdit-120c7dd8.js @@ -1 +1 @@ -import{_ as i}from"./ErrorStateAlert-44af51cd.js";import{_ as s}from"./EditPageTop-4e0a4ef6.js";import{n as o,I as n,c as u,a7 as d,j as l}from"./index-e8f29bb9.js";import{u as m,c as f,g as c}from"./malleable-api-d0b35547.js";import{u as h}from"./malleable-module-cb1f5265.js";import{_ as p}from"./VTextarea-9eb75b3d.js";import"./TooltipButton-ef876422.js";import"./VTooltip-0015e28c.js";const b={name:"MalleableProfileEdit",components:{ErrorStateAlert:i,EditPageTop:s},data(){return{form:{},rules:{name:[t=>!!t||"Name is required",t=>!!t&&t.length>3||"Name must be larger than 3 characters"],category:[t=>!!t||"Category is required"],code:[t=>!!t||"Code is required"]},malleableProfile:{},valid:!0,loading:!1,errorState:!1,initialLoad:!1}},computed:{malleableProfileStore(){return h()},isNew(){return this.$route.name==="malleableProfileNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"malleableProfileNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Listeners",disabled:!0,to:"/listeners",exact:!0},{text:"Malleable Profiles",disabled:!1,to:"/listeners?tab=malleable-profiles",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/malleable-profiles-edit"}]},breadcrumbName(){return this.isCopy?"New":this.malleableProfile.name?this.malleableProfile.name:this.id?this.id:"New"}},watch:{id(t){t&&this.getMalleableProfile(t)}},mounted(){!this.isNew||this.isCopy?this.getMalleableProfile(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?m(this.id,this.form.data).then(()=>{this.$snack.success("Malleable Profile updated"),this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):f(this.form.name,this.form.category,this.form.data).then(({id:t})=>{this.$snack.success("Malleable Profile created"),this.loading=!1,this.$router.push({name:"malleableProfileEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteMalleableProfile(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${this.form.name}?`,{color:"red"}))try{await this.malleableProfileStore.deleteMalleableProfile(this.id),this.$router.push({name:"listeners",query:{tab:"malleable-profiles"}})}catch(t){this.$snack.error(`Error: ${t}`)}},getMalleableProfile(t){c(t).then(e=>{this.malleableProfile=e,this.initialLoad=!0,n.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var _=function(){var e=this,a=e._self._c;return a("div",[a(s,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteMalleableProfile}}),a("div",{staticClass:"headers"},[a("h3",[e._v(e._s(e.mode)+" Malleable Profile")])]),e.errorState?a(i,{attrs:{"resource-id":e.id,"resource-type":"malleableProfile"}}):a(u,{staticStyle:{padding:"10px"}},[a(d,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[a(l,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}}),a(l,{attrs:{rules:e.rules.category,label:"category",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.category,callback:function(r){e.$set(e.form,"category",r)},expression:"form.category"}}),a(p,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.data,callback:function(r){e.$set(e.form,"data",r)},expression:"form.data"}})],1)],1)],1)},g=[],y=o(b,_,g,!1,null,null,null,null);const E=y.exports;export{E as default}; +import{_ as i}from"./ErrorStateAlert-3d45e0aa.js";import{_ as s}from"./EditPageTop-0ed1194e.js";import{n as o,I as n,c as u,a7 as d,j as l}from"./index-e409ba63.js";import{u as m,c as f,g as c}from"./malleable-api-09135b63.js";import{u as h}from"./malleable-module-2a911c2d.js";import{_ as p}from"./VTextarea-14e342fc.js";import"./TooltipButton-f53c45a7.js";import"./VTooltip-7c0b187f.js";const b={name:"MalleableProfileEdit",components:{ErrorStateAlert:i,EditPageTop:s},data(){return{form:{},rules:{name:[t=>!!t||"Name is required",t=>!!t&&t.length>3||"Name must be larger than 3 characters"],category:[t=>!!t||"Category is required"],code:[t=>!!t||"Code is required"]},malleableProfile:{},valid:!0,loading:!1,errorState:!1,initialLoad:!1}},computed:{malleableProfileStore(){return h()},isNew(){return this.$route.name==="malleableProfileNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"malleableProfileNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Listeners",disabled:!0,to:"/listeners",exact:!0},{text:"Malleable Profiles",disabled:!1,to:"/listeners?tab=malleable-profiles",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/malleable-profiles-edit"}]},breadcrumbName(){return this.isCopy?"New":this.malleableProfile.name?this.malleableProfile.name:this.id?this.id:"New"}},watch:{id(t){t&&this.getMalleableProfile(t)}},mounted(){!this.isNew||this.isCopy?this.getMalleableProfile(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?m(this.id,this.form.data).then(()=>{this.$snack.success("Malleable Profile updated"),this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):f(this.form.name,this.form.category,this.form.data).then(({id:t})=>{this.$snack.success("Malleable Profile created"),this.loading=!1,this.$router.push({name:"malleableProfileEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteMalleableProfile(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${this.form.name}?`,{color:"red"}))try{await this.malleableProfileStore.deleteMalleableProfile(this.id),this.$router.push({name:"listeners",query:{tab:"malleable-profiles"}})}catch(t){this.$snack.error(`Error: ${t}`)}},getMalleableProfile(t){c(t).then(e=>{this.malleableProfile=e,this.initialLoad=!0,n.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var _=function(){var e=this,a=e._self._c;return a("div",[a(s,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteMalleableProfile}}),a("div",{staticClass:"headers"},[a("h3",[e._v(e._s(e.mode)+" Malleable Profile")])]),e.errorState?a(i,{attrs:{"resource-id":e.id,"resource-type":"malleableProfile"}}):a(u,{staticStyle:{padding:"10px"}},[a(d,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[a(l,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}}),a(l,{attrs:{rules:e.rules.category,label:"category",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.category,callback:function(r){e.$set(e.form,"category",r)},expression:"form.category"}}),a(p,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.data,callback:function(r){e.$set(e.form,"data",r)},expression:"form.data"}})],1)],1)],1)},g=[],y=o(b,_,g,!1,null,null,null,null);const E=y.exports;export{E as default}; diff --git a/dist/assets/ModuleExecute-3ce5fb41.js b/dist/assets/ModuleExecute-e6251f6d.js similarity index 62% rename from dist/assets/ModuleExecute-3ce5fb41.js rename to dist/assets/ModuleExecute-e6251f6d.js index ea7e7c0..4f94dd2 100644 --- a/dist/assets/ModuleExecute-3ce5fb41.js +++ b/dist/assets/ModuleExecute-e6251f6d.js @@ -1 +1 @@ -import{_ as o}from"./AgentExecuteModule-859d030e.js";import{_ as n}from"./EditPageTop-4e0a4ef6.js";import{n as m,C as a,c as i}from"./index-e8f29bb9.js";import{a as u}from"./GeneralForm-ad50630d.js";import"./TechniqueChips-8d3b8349.js";import"./VSelect-f55906da.js";import"./InfoViewer-a26545d4.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";import"./VExpansionPanelHeader-a9447b85.js";import"./ErrorStateAlert-44af51cd.js";import"./module-api-3f2776ef.js";import"./module-module-a5a9a575.js";import"./VDataTable-f3602581.js";import"./TooltipButton-ef876422.js";import"./VTooltip-0015e28c.js";import"./VSwitch-2cfffd69.js";import"./bypass-module-9d0c5e38.js";import"./bypass-api-80f88682.js";import"./credential-module-512a6f9e.js";import"./malleable-module-cb1f5265.js";import"./malleable-api-d0b35547.js";const l={name:"ModuleExecute",components:{AgentExecuteModule:o,EditPageTop:n},data(){return{selectedAgents:[],moduleName:""}},computed:{agentStore(){return a()},agents(){return this.agentStore.agents.filter(t=>t.archived===!1&&t.stale===!1)},breads(){return[{text:"Modules",disabled:!1,to:"/modules",exact:!0},{text:`${this.moduleName}`,disabled:!0,to:"/modules/execute"}]}},mounted(){this.getAgents(),this.moduleName=this.$route.params.id},methods:{submit(){this.$refs.executeform.create()},moduleChange(t){this.moduleName=t,this.$router.push({name:"moduleExecute",params:{id:t}})},getAgents(){this.agentStore.getAgents()},clearAgents(){this.selectedAgents=[]}}};var d=function(){var e=this,s=e._self._c;return s("div",{staticClass:"p4"},[s(n,{attrs:{breads:e.breads,"show-submit":!0},on:{submit:e.submit}}),s("h4",{staticClass:"pl-4 pb-4"},[e._v("Execute Module")]),s(u,{attrs:{dense:"",outlined:"",chips:"",multiple:"",placeholder:"Agents",items:e.agents,"item-text":"name","item-value":"session_id"},model:{value:e.selectedAgents,callback:function(r){e.selectedAgents=r},expression:"selectedAgents"}}),s(i,[s(o,{ref:"executeform",attrs:{"module-name":e.moduleName,agents:e.selectedAgents,"show-submit":!1},on:{moduleChange:e.moduleChange,submitted:e.clearAgents}})],1)],1)},p=[],c=m(l,d,p,!1,null,null,null,null);const j=c.exports;export{j as default}; +import{_ as o}from"./AgentExecuteModule-e502a55e.js";import{_ as n}from"./EditPageTop-0ed1194e.js";import{n as m,C as a,c as i}from"./index-e409ba63.js";import{a as u}from"./GeneralForm-e1472145.js";import"./TechniqueChips-3c9db4c5.js";import"./VSelect-22e7980f.js";import"./InfoViewer-98b37678.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";import"./VExpansionPanelHeader-69136628.js";import"./ErrorStateAlert-3d45e0aa.js";import"./module-api-04d2f26d.js";import"./module-module-e75169e8.js";import"./VDataTable-dab2ebf1.js";import"./TooltipButton-f53c45a7.js";import"./VTooltip-7c0b187f.js";import"./VSwitch-3f004360.js";import"./bypass-module-4e86a448.js";import"./bypass-api-6126dc83.js";import"./credential-module-93372e4e.js";import"./malleable-module-2a911c2d.js";import"./malleable-api-09135b63.js";const l={name:"ModuleExecute",components:{AgentExecuteModule:o,EditPageTop:n},data(){return{selectedAgents:[],moduleName:""}},computed:{agentStore(){return a()},agents(){return this.agentStore.agents.filter(t=>t.archived===!1&&t.stale===!1)},breads(){return[{text:"Modules",disabled:!1,to:"/modules",exact:!0},{text:`${this.moduleName}`,disabled:!0,to:"/modules/execute"}]}},mounted(){this.getAgents(),this.moduleName=this.$route.params.id},methods:{submit(){this.$refs.executeform.create()},moduleChange(t){this.moduleName=t,this.$router.push({name:"moduleExecute",params:{id:t}})},getAgents(){this.agentStore.getAgents()},clearAgents(){this.selectedAgents=[]}}};var d=function(){var e=this,s=e._self._c;return s("div",{staticClass:"p4"},[s(n,{attrs:{breads:e.breads,"show-submit":!0},on:{submit:e.submit}}),s("h4",{staticClass:"pl-4 pb-4"},[e._v("Execute Module")]),s(u,{attrs:{dense:"",outlined:"",chips:"",multiple:"",placeholder:"Agents",items:e.agents,"item-text":"name","item-value":"session_id"},model:{value:e.selectedAgents,callback:function(r){e.selectedAgents=r},expression:"selectedAgents"}}),s(i,[s(o,{ref:"executeform",attrs:{"module-name":e.moduleName,agents:e.selectedAgents,"show-submit":!1},on:{moduleChange:e.moduleChange,submitted:e.clearAgents}})],1)],1)},p=[],c=m(l,d,p,!1,null,null,null,null);const j=c.exports;export{j as default}; diff --git a/dist/assets/Modules-dd018638.js b/dist/assets/Modules-8e2f6cb8.js similarity index 89% rename from dist/assets/Modules-dd018638.js rename to dist/assets/Modules-8e2f6cb8.js index 0824336..11e8238 100644 --- a/dist/assets/Modules-dd018638.js +++ b/dist/assets/Modules-8e2f6cb8.js @@ -1 +1 @@ -import{_ as i}from"./TechniqueChips-8d3b8349.js";import{u as p}from"./module-module-a5a9a575.js";import{n as u}from"./index-e8f29bb9.js";import{b as r}from"./VSelect-f55906da.js";import{_ as f}from"./VDataTable-f3602581.js";import{_ as o}from"./ExpansionPanelFilter-33a56e95.js";import{_ as d}from"./ExpansionPanelSearch-155a732a.js";import{_ as c}from"./AdvancedTable-147b64b8.js";import{_}from"./ListPageTop-5130be67.js";import{_ as g}from"./VSwitch-2cfffd69.js";import"./module-api-3f2776ef.js";import"./VExpansionPanelHeader-a9447b85.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";import"./VTooltip-0015e28c.js";const h={name:"ModulesTable",components:{TechniqueChips:i},props:{showIds:{type:Boolean,default:!1},search:{type:String,default:""},needsAdmin:{type:Array,default:()=>[]},opsecSafe:{type:Array,default:()=>[]},background:{type:Array,default:()=>[]},selectedLanguages:{type:Array,default:()=>[]}},data(){return{}},computed:{moduleStore(){return p()},modules(){return this.moduleStore.modules},languagesUnique(){return[...new Set(this.modules.map(s=>s.language.toLowerCase()))]},headers(){const s=[{text:"Name",value:"name"},{text:"Language",value:"language",sort:this.sortLanguage},{text:"Needs Admin",value:"needs_admin",width:"75px"},{text:"Opsec Safe",value:"opsec_safe",width:"75px"},{text:"Background",value:"background",width:"75px"},{text:"Techniques",value:"techniques",width:"300px",sortable:!1}];return this.showIds&&s.unshift({text:"id",align:"start",value:"id"}),s},filteredModules(){let s=this.modules;return this.search&&(s=s.filter(e=>{const n=this.search.toLowerCase();return e.name.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)||e.language.toLowerCase().includes(n)||e.description.toLowerCase().includes(n)})),s=s.filter(e=>this.needsAdmin.includes(e.needs_admin)).filter(e=>this.opsecSafe.includes(e.opsec_safe)).filter(e=>this.background.includes(e.background)).filter(e=>this.selectedLanguages.includes(e.language.toLowerCase())),s}},watch:{languagesUnique(s){this.$emit("languages-changed",s)}},mounted(){this.moduleStore.getModules()},methods:{sortLanguage(s,e){return s==null?-1:e==null?1:s.toLowerCase().localeCompare(e.toLowerCase())}}};var v=function(){var e=this,n=e._self._c;return n("div",[n(f,{attrs:{headers:e.headers,items:e.filteredModules,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id","show-expand":"",dense:""},scopedSlots:e._u([{key:"item.id",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.id)+" ")])]}},{key:"item.name",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.name)+" ")])]}},{key:"item.techniques",fn:function({item:t}){return[n(i,{attrs:{techniques:t.techniques,"show-title":!1}})]}},{key:"item.needs_admin",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.needs_admin,callback:function(a){e.$set(t,"needs_admin",a)},expression:"item.needs_admin"}})]}},{key:"item.opsec_safe",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.opsec_safe,callback:function(a){e.$set(t,"opsec_safe",a)},expression:"item.opsec_safe"}})]}},{key:"item.background",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.background,callback:function(a){e.$set(t,"background",a)},expression:"item.background"}})]}},{key:"expanded-item",fn:function({headers:t,item:a}){return[n("td",{attrs:{colspan:t.length}},[n("div",{staticClass:"d-flex flex-column"},[n("b",[e._v("Description:")]),e._v(" "+e._s(a.description)+" ")])])]}}])})],1)},b=[],x=u(h,v,b,!1,null,null,null,null);const m=x.exports;const k={name:"ExpansionPanelBoolean",components:{ExpansionPanelFilter:o},props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[],items:[{value:!0,label:"True"},{value:!1,label:"False"}]}},watch:{selectedItems:{handler(s){this.$emit("input",s)}}}};var y=function(){var e=this,n=e._self._c;return n(o,{attrs:{title:e.title,label:"label","item-key":"value","item-value":"value",items:e.items,"empty-default":e.emptyDefault},model:{value:e.selectedItems,callback:function(t){e.selectedItems=t},expression:"selectedItems"}})},w=[],S=u(k,y,w,!1,null,null,null,null);const l=S.exports;const L={name:"Modules",components:{ExpansionPanelSearch:d,ExpansionPanelBoolean:l,ExpansionPanelFilter:o,AdvancedTable:c,ModulesTable:m,ListPageTop:_},data(){return{search:"",breads:[{text:"Modules",disabled:!0,href:"/modules"}],showIds:!1,needsAdmin:[],opsecSafe:[],background:[],languages:[],languageOptions:[]}},methods:{languagesChanged(s){this.languageOptions=s.map(e=>({label:e,value:e}))}}};var A=function(){var e=this,n=e._self._c;return n("div",[n(_,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!1,"show-delete":!1}}),n(c,{scopedSlots:e._u([{key:"filters",fn:function(){return[n(g,{attrs:{label:"Show IDs"},model:{value:e.showIds,callback:function(t){e.showIds=t},expression:"showIds"}}),n(d,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),n(l,{attrs:{title:"Needs Admin"},model:{value:e.needsAdmin,callback:function(t){e.needsAdmin=t},expression:"needsAdmin"}}),n(l,{attrs:{title:"Opsec Safe"},model:{value:e.opsecSafe,callback:function(t){e.opsecSafe=t},expression:"opsecSafe"}}),n(l,{attrs:{title:"Background"},model:{value:e.background,callback:function(t){e.background=t},expression:"background"}}),n(o,{attrs:{title:"Language",label:"label","item-key":"value","item-value":"value",items:e.languageOptions},model:{value:e.languages,callback:function(t){e.languages=t},expression:"languages"}})]},proxy:!0},{key:"table",fn:function(){return[n(m,{attrs:{search:e.search,"show-ids":e.showIds,"needs-admin":e.needsAdmin,"opsec-safe":e.opsecSafe,background:e.background,"selected-languages":e.languages},on:{"languages-changed":e.languagesChanged}})]},proxy:!0}])})],1)},C=[],$=u(L,A,C,!1,null,null,null,null);const G=$.exports;export{G as default}; +import{_ as i}from"./TechniqueChips-3c9db4c5.js";import{u as p}from"./module-module-e75169e8.js";import{n as u}from"./index-e409ba63.js";import{b as r}from"./VSelect-22e7980f.js";import{_ as f}from"./VDataTable-dab2ebf1.js";import{_ as o}from"./ExpansionPanelFilter-010a2264.js";import{_ as d}from"./ExpansionPanelSearch-94b8e3ac.js";import{_ as c}from"./AdvancedTable-e51651be.js";import{_}from"./ListPageTop-78cbc2f3.js";import{_ as g}from"./VSwitch-3f004360.js";import"./module-api-04d2f26d.js";import"./VExpansionPanelHeader-69136628.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";import"./VTooltip-7c0b187f.js";const h={name:"ModulesTable",components:{TechniqueChips:i},props:{showIds:{type:Boolean,default:!1},search:{type:String,default:""},needsAdmin:{type:Array,default:()=>[]},opsecSafe:{type:Array,default:()=>[]},background:{type:Array,default:()=>[]},selectedLanguages:{type:Array,default:()=>[]}},data(){return{}},computed:{moduleStore(){return p()},modules(){return this.moduleStore.modules},languagesUnique(){return[...new Set(this.modules.map(s=>s.language.toLowerCase()))]},headers(){const s=[{text:"Name",value:"name"},{text:"Language",value:"language",sort:this.sortLanguage},{text:"Needs Admin",value:"needs_admin",width:"75px"},{text:"Opsec Safe",value:"opsec_safe",width:"75px"},{text:"Background",value:"background",width:"75px"},{text:"Techniques",value:"techniques",width:"300px",sortable:!1}];return this.showIds&&s.unshift({text:"id",align:"start",value:"id"}),s},filteredModules(){let s=this.modules;return this.search&&(s=s.filter(e=>{const n=this.search.toLowerCase();return e.name.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)||e.language.toLowerCase().includes(n)||e.description.toLowerCase().includes(n)})),s=s.filter(e=>this.needsAdmin.includes(e.needs_admin)).filter(e=>this.opsecSafe.includes(e.opsec_safe)).filter(e=>this.background.includes(e.background)).filter(e=>this.selectedLanguages.includes(e.language.toLowerCase())),s}},watch:{languagesUnique(s){this.$emit("languages-changed",s)}},mounted(){this.moduleStore.getModules()},methods:{sortLanguage(s,e){return s==null?-1:e==null?1:s.toLowerCase().localeCompare(e.toLowerCase())}}};var v=function(){var e=this,n=e._self._c;return n("div",[n(f,{attrs:{headers:e.headers,items:e.filteredModules,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id","show-expand":"",dense:""},scopedSlots:e._u([{key:"item.id",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.id)+" ")])]}},{key:"item.name",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.name)+" ")])]}},{key:"item.techniques",fn:function({item:t}){return[n(i,{attrs:{techniques:t.techniques,"show-title":!1}})]}},{key:"item.needs_admin",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.needs_admin,callback:function(a){e.$set(t,"needs_admin",a)},expression:"item.needs_admin"}})]}},{key:"item.opsec_safe",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.opsec_safe,callback:function(a){e.$set(t,"opsec_safe",a)},expression:"item.opsec_safe"}})]}},{key:"item.background",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.background,callback:function(a){e.$set(t,"background",a)},expression:"item.background"}})]}},{key:"expanded-item",fn:function({headers:t,item:a}){return[n("td",{attrs:{colspan:t.length}},[n("div",{staticClass:"d-flex flex-column"},[n("b",[e._v("Description:")]),e._v(" "+e._s(a.description)+" ")])])]}}])})],1)},b=[],x=u(h,v,b,!1,null,null,null,null);const m=x.exports;const k={name:"ExpansionPanelBoolean",components:{ExpansionPanelFilter:o},props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[],items:[{value:!0,label:"True"},{value:!1,label:"False"}]}},watch:{selectedItems:{handler(s){this.$emit("input",s)}}}};var y=function(){var e=this,n=e._self._c;return n(o,{attrs:{title:e.title,label:"label","item-key":"value","item-value":"value",items:e.items,"empty-default":e.emptyDefault},model:{value:e.selectedItems,callback:function(t){e.selectedItems=t},expression:"selectedItems"}})},w=[],S=u(k,y,w,!1,null,null,null,null);const l=S.exports;const L={name:"Modules",components:{ExpansionPanelSearch:d,ExpansionPanelBoolean:l,ExpansionPanelFilter:o,AdvancedTable:c,ModulesTable:m,ListPageTop:_},data(){return{search:"",breads:[{text:"Modules",disabled:!0,href:"/modules"}],showIds:!1,needsAdmin:[],opsecSafe:[],background:[],languages:[],languageOptions:[]}},methods:{languagesChanged(s){this.languageOptions=s.map(e=>({label:e,value:e}))}}};var A=function(){var e=this,n=e._self._c;return n("div",[n(_,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!1,"show-delete":!1}}),n(c,{scopedSlots:e._u([{key:"filters",fn:function(){return[n(g,{attrs:{label:"Show IDs"},model:{value:e.showIds,callback:function(t){e.showIds=t},expression:"showIds"}}),n(d,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),n(l,{attrs:{title:"Needs Admin"},model:{value:e.needsAdmin,callback:function(t){e.needsAdmin=t},expression:"needsAdmin"}}),n(l,{attrs:{title:"Opsec Safe"},model:{value:e.opsecSafe,callback:function(t){e.opsecSafe=t},expression:"opsecSafe"}}),n(l,{attrs:{title:"Background"},model:{value:e.background,callback:function(t){e.background=t},expression:"background"}}),n(o,{attrs:{title:"Language",label:"label","item-key":"value","item-value":"value",items:e.languageOptions},model:{value:e.languages,callback:function(t){e.languages=t},expression:"languages"}})]},proxy:!0},{key:"table",fn:function(){return[n(m,{attrs:{search:e.search,"show-ids":e.showIds,"needs-admin":e.needsAdmin,"opsec-safe":e.opsecSafe,background:e.background,"selected-languages":e.languages},on:{"languages-changed":e.languagesChanged}})]},proxy:!0}])})],1)},C=[],$=u(L,A,C,!1,null,null,null,null);const G=$.exports;export{G as default}; diff --git a/dist/assets/Notifications-fa0444df.js b/dist/assets/Notifications-52a21eef.js similarity index 86% rename from dist/assets/Notifications-fa0444df.js rename to dist/assets/Notifications-52a21eef.js index 453b007..8502308 100644 --- a/dist/assets/Notifications-fa0444df.js +++ b/dist/assets/Notifications-52a21eef.js @@ -1 +1 @@ -import{_ as s}from"./ListPageTop-5130be67.js";import{n as a,u as r,a as e,b as _,c,d as l,e as u,V as p,f,g as m,h as d,i as v}from"./index-e8f29bb9.js";import"./VTooltip-0015e28c.js";import"./VItemGroup-e39c2c83.js";const g={name:"Notifications",components:{ListPageTop:s},computed:{applicationStore(){return r()},notifications(){return this.applicationStore.notifications}},beforeDestroy(){this.applicationStore.markAllNotificationsAsRead()},methods:{clearNotifications(){this.applicationStore.clearNotifications()}}};var x=function(){var t=this,o=t._self._c;return o("div",[o(s,{attrs:{breads:[{text:"Notifications",disabled:!0,to:"/notifications"}]},scopedSlots:t._u([{key:"extra-stuff",fn:function(){return[o(e,{attrs:{color:"primary",text:""},on:{click:t.clearNotifications}},[t._v(" Clear "),o(_,{attrs:{right:""}},[t._v(" mdi-delete ")])],1)]},proxy:!0}])}),o(c,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[o(l,[t._l(t.notifications,function(n,i){return[o(u,{key:`list-'${i}`,style:n.read?"":"background-color: rgba(118, 127, 134, 0.5);",attrs:{to:n.route,link:""}},[o(p,[o(f,[t._v(" "+t._s(n.title)+" ")]),o(m,[t._v(" "+t._s(n.text)+" ")])],1),o(d,[n.route?o(e,{attrs:{color:"primary",text:"",to:n.route}},[t._v(" "+t._s(n.buttonText)+" ")]):t._e()],1)],1),o(v,{key:`divider-${i}`})]})],2)],1)],1)},y=[],b=a(g,x,y,!1,null,null,null,null);const L=b.exports;export{L as default}; +import{_ as s}from"./ListPageTop-78cbc2f3.js";import{n as a,u as r,a as e,b as _,c,d as l,e as u,V as p,f,g as m,h as d,i as v}from"./index-e409ba63.js";import"./VTooltip-7c0b187f.js";import"./VItemGroup-3637266a.js";const g={name:"Notifications",components:{ListPageTop:s},computed:{applicationStore(){return r()},notifications(){return this.applicationStore.notifications}},beforeDestroy(){this.applicationStore.markAllNotificationsAsRead()},methods:{clearNotifications(){this.applicationStore.clearNotifications()}}};var x=function(){var t=this,o=t._self._c;return o("div",[o(s,{attrs:{breads:[{text:"Notifications",disabled:!0,to:"/notifications"}]},scopedSlots:t._u([{key:"extra-stuff",fn:function(){return[o(e,{attrs:{color:"primary",text:""},on:{click:t.clearNotifications}},[t._v(" Clear "),o(_,{attrs:{right:""}},[t._v(" mdi-delete ")])],1)]},proxy:!0}])}),o(c,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[o(l,[t._l(t.notifications,function(n,i){return[o(u,{key:`list-'${i}`,style:n.read?"":"background-color: rgba(118, 127, 134, 0.5);",attrs:{to:n.route,link:""}},[o(p,[o(f,[t._v(" "+t._s(n.title)+" ")]),o(m,[t._v(" "+t._s(n.text)+" ")])],1),o(d,[n.route?o(e,{attrs:{color:"primary",text:"",to:n.route}},[t._v(" "+t._s(n.buttonText)+" ")]):t._e()],1)],1),o(v,{key:`divider-${i}`})]})],2)],1)],1)},y=[],b=a(g,x,y,!1,null,null,null,null);const L=b.exports;export{L as default}; diff --git a/dist/assets/Obfuscation-a94e0f56.js b/dist/assets/Obfuscation-2147baab.js similarity index 96% rename from dist/assets/Obfuscation-a94e0f56.js rename to dist/assets/Obfuscation-2147baab.js index 4a4b5ed..3bc6440 100644 --- a/dist/assets/Obfuscation-a94e0f56.js +++ b/dist/assets/Obfuscation-2147baab.js @@ -1 +1 @@ -import{_ as K}from"./ListPageTop-5130be67.js";import{z as n,A as i,B as x,a1 as $,n as C,a8 as _,c,a9 as d,aa as u,ak as y,a7 as m,j as p,a as r,ab as b,a2 as h,H as D,b as f,k as P,d as S,i as T,e as w,f as g,bv as j}from"./index-e8f29bb9.js";import{_ as R}from"./VDataTable-f3602581.js";import{_ as O}from"./VSwitch-2cfffd69.js";import"./VTooltip-0015e28c.js";import"./VItemGroup-e39c2c83.js";import"./VSelect-f55906da.js";function M(){return n.get("/obfuscation/keywords").then(({data:a})=>a.records).catch(a=>Promise.reject(i(a)))}function q(a){return n.post("/obfuscation/keywords",a).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function A(a){return n.put(`/obfuscation/keywords/${a.id}`,a).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function E(a){return n.delete(`/obfuscation/keywords/${a}`).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function V(){return n.get("/obfuscation/global").then(({data:a})=>a.records).catch(a=>Promise.reject(i(a)))}function k(a){return n.put(`/obfuscation/global/${a.language}`,a).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function I(a="powershell",e=!1){return n.post(`/obfuscation/global/${a}/preobfuscate`,{},{params:{reobfuscate:e}}).catch(t=>Promise.reject(i(t)))}function U(a="powershell"){return n.delete(`/obfuscation/global/${a}/preobfuscate`).catch(e=>Promise.reject(i(e)))}const v=x("obfuscation",{state:()=>({keywords:[],configs:[]}),actions:{async getKeywords(){const a=await M();this.keywords=a},async deleteKeyword(a){await E(a);const e=this.keywords.findIndex(t=>t.id===a);e>-1&&this.keywords.splice(e,1)},async getConfigs(){const a=await V();this.configs=a}},getters:{}});const z={components:{ListPageTop:K},data(){return{valid:!0,keywordDialog:!1,keywordDialogTitle:"",editedKeyword:{},preobfuscateDialog:!1,editedPreobfuscate:{},reobfuscate:!1,breads:[{text:"Obfuscation",disabled:!0,href:"/obfuscation"}],command:"",readonly:!1,headers:[{text:"Keyword",value:"keyword"},{text:"Replacement",value:"replacement"},{text:"Actions",value:"actions",sortable:!1,width:15}],rules:{keyword:[a=>!!a||"Keyword is required",a=>a.length>=3||"Keyword must be at least 3 characters"],replacement:[a=>!!a||"Replacement is required",a=>a.length>=3||"Replacement must be at least 3 characters"]}}},computed:{obfuscationStore(){return v()},...$(v,["keywords","configs"])},mounted(){this.refresh()},methods:{refresh(){this.refreshKeywords(),this.refreshConfigs()},refreshKeywords(){this.obfuscationStore.getKeywords()},refreshConfigs(){this.obfuscationStore.getConfigs()},toggleEditing(a){console.log("editing"),this.$set(a,"editing",!a.editing)},editKeyword(a){this.editedKeyword={...a},this.keywordDialogTitle="Edit Keyword",this.keywordDialog=!0},createKeyword(){this.editedKeyword={keyword:"",replacement:""},this.keywordDialogTitle="New Keyword",this.keywordDialog=!0},generateRandom(){this.editedKeyword.replacement=Math.random().toString(36).substring(2,8)},async saveKeyword(){if(this.$refs.form.validate())try{this.editedKeyword.id?await A(this.editedKeyword):await q(this.editedKeyword),this.refreshKeywords(),this.keywordDialog=!1}catch(a){this.$snack.error(`${a}`)}},async deleteKeyword(a){await this.$root.$confirm("Delete",`Are you sure you want to delete keyword ${a.keyword}?`,{color:"red"})&&await this.obfuscationStore.deleteKeyword(a.id)},async editConfig(a){try{await k(a),a.preobfuscatable?this.$snack.success('Updated config. Use "preobfuscate" to re-apply obfuscation.'):this.$snack.success("Updated config.")}catch(e){this.$snack.error(`${e}`)}},openPreobfuscateDialog(a){this.editedPreobfuscate={...a},this.reobfuscate=!1,this.preobfuscateDialog=!0},async preobfuscateModules(){try{await k(this.editedPreobfuscate),await I(this.editedPreobfuscate.language,this.reobfuscate),this.$snack.info("Preobfuscation started in the background. This will take a few minutes.")}catch(a){this.$snack.error(`${a}`)}this.preobfuscateDialog=!1},async deletePreobfuscatedModules(a){if(await this.$root.$confirm("","Are you sure? This will delete all preobfuscated modules.",{color:"red",width:500}))try{await U(a.language),this.$snack.success("Preobfuscated modules deleted.")}catch(e){this.$snack.error(`${e}`)}}}};var L=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mr-6"},[t(K,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refresh}}),t(_,{attrs:{"max-width":"500px"},model:{value:e.keywordDialog,callback:function(s){e.keywordDialog=s},expression:"keywordDialog"}},[t(c,[t(d,[t("span",{staticClass:"text-h5"},[e._v(e._s(e.keywordDialogTitle))])]),t(u,[t(y,[t(m,{ref:"form",nativeOn:{submit:function(s){return s.preventDefault(),e.saveKeyword.apply(null,arguments)}},model:{value:e.valid,callback:function(s){e.valid=s},expression:"valid"}},[t(p,{attrs:{rules:e.rules.keyword,dense:"",outlined:"",required:"",label:"Keyword"},model:{value:e.editedKeyword.keyword,callback:function(s){e.$set(e.editedKeyword,"keyword",s)},expression:"editedKeyword.keyword"}}),t(p,{attrs:{rules:e.rules.replacement,dense:"",outlined:"",required:"",label:"Replacement"},model:{value:e.editedKeyword.replacement,callback:function(s){e.$set(e.editedKeyword,"replacement",s)},expression:"editedKeyword.replacement"}}),t(r,{on:{click:e.generateRandom}},[e._v(" Random ")])],1)],1)],1),t(b,[t(h),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(s){e.keywordDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.saveKeyword}},[e._v(" Save ")])],1)],1)],1),t(_,{attrs:{"max-width":"500px"},model:{value:e.preobfuscateDialog,callback:function(s){e.preobfuscateDialog=s},expression:"preobfuscateDialog"}},[t(c,[t(d,[t("span",{staticClass:"text-h5"})]),t(u,[t("p",[e._v(' Are you sure? This will preobfuscate every module and will take a few minutes. Check "reobfuscate" if you need to force all modules to be reobfuscated after changing the global obfuscation configuration. ')]),t(y,[t(D,{attrs:{label:"Reobfuscate"},model:{value:e.reobfuscate,callback:function(s){e.reobfuscate=s},expression:"reobfuscate"}})],1)],1),t(b,[t(h),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(s){e.preobfuscateDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.preobfuscateModules}},[e._v(" Save ")])],1)],1)],1),t("div",{staticStyle:{display:"flex","flex-direction":"row","align-items":"flex-start"}},[t(c,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(d,[t("span",{staticStyle:{display:"flex","justify-content":"space-between",width:"100%"}},[t("span",{staticClass:"headline"},[e._v("Keyword Obfuscation")]),t(r,{attrs:{color:"primary"},on:{click:e.createKeyword}},[e._v(" Create "),t(f,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1)],1)]),t(R,{attrs:{headers:e.headers,items:e.keywords},scopedSlots:e._u([{key:"item.actions",fn:function({item:s}){return[t(P,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:o}){return[t(r,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),l),[t(f,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(S,{staticClass:"ml-2 mr-2"},[t(T,{staticClass:"pb-4"}),t(w,{key:"edit",attrs:{link:""},on:{click:function(l){return e.editKeyword(s)}}},[t(g,[t(f,[e._v("fa-edit")]),e._v(" Edit ")],1)],1),t(w,{key:"delete",attrs:{link:""},on:{click:function(l){return e.deleteKeyword(s)}}},[t(g,[t(f,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}])})],1),t(c,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(d,[t("span",[t("span",{staticClass:"headline"},[e._v("Global Obfuscation")])])]),t(u,e._l(e.configs,function(s,l){return t(c,{key:l,staticClass:"ma-2 pa-2",attrs:{outlined:""}},[t(j,[e._v(e._s(s.language))]),t(u,[t(m,[t(O,{attrs:{label:"Enabled",readonly:e.readonly},model:{value:s.enabled,callback:function(o){e.$set(s,"enabled",o)},expression:"config.enabled"}}),t(p,{attrs:{label:"Command",rules:s.language!=="csharp"?[o=>!!o||"Command is required"]:[],dense:"",outlined:"",readonly:e.readonly},model:{value:s.command,callback:function(o){e.$set(s,"command",o)},expression:"config.command"}})],1)],1),t(b,[t(r,{attrs:{color:"primary"},on:{click:function(o){return e.editConfig(s)}}},[e._v(" Save ")]),t(r,{attrs:{disabled:!s.preobfuscatable,text:"",color:"primary"},on:{click:function(o){return e.openPreobfuscateDialog(s)}}},[e._v(" Preobfuscate ")]),t(r,{attrs:{disabled:!s.preobfuscatable,text:"",color:"error"},on:{click:function(o){return e.deletePreobfuscatedModules(s)}}},[e._v(" Remove preobfuscated modules ")])],1)],1)}),1)],1)],1)],1)},B=[],F=C(z,L,B,!1,null,null,null,null);const Y=F.exports;export{Y as default}; +import{_ as K}from"./ListPageTop-78cbc2f3.js";import{z as n,A as i,B as x,a1 as $,n as C,a8 as _,c,a9 as d,aa as u,ak as y,a7 as m,j as p,a as r,ab as b,a2 as h,H as D,b as f,k as P,d as S,i as T,e as w,f as g,bv as j}from"./index-e409ba63.js";import{_ as R}from"./VDataTable-dab2ebf1.js";import{_ as O}from"./VSwitch-3f004360.js";import"./VTooltip-7c0b187f.js";import"./VItemGroup-3637266a.js";import"./VSelect-22e7980f.js";function M(){return n.get("/obfuscation/keywords").then(({data:a})=>a.records).catch(a=>Promise.reject(i(a)))}function q(a){return n.post("/obfuscation/keywords",a).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function A(a){return n.put(`/obfuscation/keywords/${a.id}`,a).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function E(a){return n.delete(`/obfuscation/keywords/${a}`).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function V(){return n.get("/obfuscation/global").then(({data:a})=>a.records).catch(a=>Promise.reject(i(a)))}function k(a){return n.put(`/obfuscation/global/${a.language}`,a).then(({data:e})=>e).catch(e=>Promise.reject(i(e)))}function I(a="powershell",e=!1){return n.post(`/obfuscation/global/${a}/preobfuscate`,{},{params:{reobfuscate:e}}).catch(t=>Promise.reject(i(t)))}function U(a="powershell"){return n.delete(`/obfuscation/global/${a}/preobfuscate`).catch(e=>Promise.reject(i(e)))}const v=x("obfuscation",{state:()=>({keywords:[],configs:[]}),actions:{async getKeywords(){const a=await M();this.keywords=a},async deleteKeyword(a){await E(a);const e=this.keywords.findIndex(t=>t.id===a);e>-1&&this.keywords.splice(e,1)},async getConfigs(){const a=await V();this.configs=a}},getters:{}});const z={components:{ListPageTop:K},data(){return{valid:!0,keywordDialog:!1,keywordDialogTitle:"",editedKeyword:{},preobfuscateDialog:!1,editedPreobfuscate:{},reobfuscate:!1,breads:[{text:"Obfuscation",disabled:!0,href:"/obfuscation"}],command:"",readonly:!1,headers:[{text:"Keyword",value:"keyword"},{text:"Replacement",value:"replacement"},{text:"Actions",value:"actions",sortable:!1,width:15}],rules:{keyword:[a=>!!a||"Keyword is required",a=>a.length>=3||"Keyword must be at least 3 characters"],replacement:[a=>!!a||"Replacement is required",a=>a.length>=3||"Replacement must be at least 3 characters"]}}},computed:{obfuscationStore(){return v()},...$(v,["keywords","configs"])},mounted(){this.refresh()},methods:{refresh(){this.refreshKeywords(),this.refreshConfigs()},refreshKeywords(){this.obfuscationStore.getKeywords()},refreshConfigs(){this.obfuscationStore.getConfigs()},toggleEditing(a){console.log("editing"),this.$set(a,"editing",!a.editing)},editKeyword(a){this.editedKeyword={...a},this.keywordDialogTitle="Edit Keyword",this.keywordDialog=!0},createKeyword(){this.editedKeyword={keyword:"",replacement:""},this.keywordDialogTitle="New Keyword",this.keywordDialog=!0},generateRandom(){this.editedKeyword.replacement=Math.random().toString(36).substring(2,8)},async saveKeyword(){if(this.$refs.form.validate())try{this.editedKeyword.id?await A(this.editedKeyword):await q(this.editedKeyword),this.refreshKeywords(),this.keywordDialog=!1}catch(a){this.$snack.error(`${a}`)}},async deleteKeyword(a){await this.$root.$confirm("Delete",`Are you sure you want to delete keyword ${a.keyword}?`,{color:"red"})&&await this.obfuscationStore.deleteKeyword(a.id)},async editConfig(a){try{await k(a),a.preobfuscatable?this.$snack.success('Updated config. Use "preobfuscate" to re-apply obfuscation.'):this.$snack.success("Updated config.")}catch(e){this.$snack.error(`${e}`)}},openPreobfuscateDialog(a){this.editedPreobfuscate={...a},this.reobfuscate=!1,this.preobfuscateDialog=!0},async preobfuscateModules(){try{await k(this.editedPreobfuscate),await I(this.editedPreobfuscate.language,this.reobfuscate),this.$snack.info("Preobfuscation started in the background. This will take a few minutes.")}catch(a){this.$snack.error(`${a}`)}this.preobfuscateDialog=!1},async deletePreobfuscatedModules(a){if(await this.$root.$confirm("","Are you sure? This will delete all preobfuscated modules.",{color:"red",width:500}))try{await U(a.language),this.$snack.success("Preobfuscated modules deleted.")}catch(e){this.$snack.error(`${e}`)}}}};var L=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mr-6"},[t(K,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refresh}}),t(_,{attrs:{"max-width":"500px"},model:{value:e.keywordDialog,callback:function(s){e.keywordDialog=s},expression:"keywordDialog"}},[t(c,[t(d,[t("span",{staticClass:"text-h5"},[e._v(e._s(e.keywordDialogTitle))])]),t(u,[t(y,[t(m,{ref:"form",nativeOn:{submit:function(s){return s.preventDefault(),e.saveKeyword.apply(null,arguments)}},model:{value:e.valid,callback:function(s){e.valid=s},expression:"valid"}},[t(p,{attrs:{rules:e.rules.keyword,dense:"",outlined:"",required:"",label:"Keyword"},model:{value:e.editedKeyword.keyword,callback:function(s){e.$set(e.editedKeyword,"keyword",s)},expression:"editedKeyword.keyword"}}),t(p,{attrs:{rules:e.rules.replacement,dense:"",outlined:"",required:"",label:"Replacement"},model:{value:e.editedKeyword.replacement,callback:function(s){e.$set(e.editedKeyword,"replacement",s)},expression:"editedKeyword.replacement"}}),t(r,{on:{click:e.generateRandom}},[e._v(" Random ")])],1)],1)],1),t(b,[t(h),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(s){e.keywordDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.saveKeyword}},[e._v(" Save ")])],1)],1)],1),t(_,{attrs:{"max-width":"500px"},model:{value:e.preobfuscateDialog,callback:function(s){e.preobfuscateDialog=s},expression:"preobfuscateDialog"}},[t(c,[t(d,[t("span",{staticClass:"text-h5"})]),t(u,[t("p",[e._v(' Are you sure? This will preobfuscate every module and will take a few minutes. Check "reobfuscate" if you need to force all modules to be reobfuscated after changing the global obfuscation configuration. ')]),t(y,[t(D,{attrs:{label:"Reobfuscate"},model:{value:e.reobfuscate,callback:function(s){e.reobfuscate=s},expression:"reobfuscate"}})],1)],1),t(b,[t(h),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(s){e.preobfuscateDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.preobfuscateModules}},[e._v(" Save ")])],1)],1)],1),t("div",{staticStyle:{display:"flex","flex-direction":"row","align-items":"flex-start"}},[t(c,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(d,[t("span",{staticStyle:{display:"flex","justify-content":"space-between",width:"100%"}},[t("span",{staticClass:"headline"},[e._v("Keyword Obfuscation")]),t(r,{attrs:{color:"primary"},on:{click:e.createKeyword}},[e._v(" Create "),t(f,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1)],1)]),t(R,{attrs:{headers:e.headers,items:e.keywords},scopedSlots:e._u([{key:"item.actions",fn:function({item:s}){return[t(P,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:o}){return[t(r,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),l),[t(f,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(S,{staticClass:"ml-2 mr-2"},[t(T,{staticClass:"pb-4"}),t(w,{key:"edit",attrs:{link:""},on:{click:function(l){return e.editKeyword(s)}}},[t(g,[t(f,[e._v("fa-edit")]),e._v(" Edit ")],1)],1),t(w,{key:"delete",attrs:{link:""},on:{click:function(l){return e.deleteKeyword(s)}}},[t(g,[t(f,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}])})],1),t(c,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(d,[t("span",[t("span",{staticClass:"headline"},[e._v("Global Obfuscation")])])]),t(u,e._l(e.configs,function(s,l){return t(c,{key:l,staticClass:"ma-2 pa-2",attrs:{outlined:""}},[t(j,[e._v(e._s(s.language))]),t(u,[t(m,[t(O,{attrs:{label:"Enabled",readonly:e.readonly},model:{value:s.enabled,callback:function(o){e.$set(s,"enabled",o)},expression:"config.enabled"}}),t(p,{attrs:{label:"Command",rules:s.language!=="csharp"?[o=>!!o||"Command is required"]:[],dense:"",outlined:"",readonly:e.readonly},model:{value:s.command,callback:function(o){e.$set(s,"command",o)},expression:"config.command"}})],1)],1),t(b,[t(r,{attrs:{color:"primary"},on:{click:function(o){return e.editConfig(s)}}},[e._v(" Save ")]),t(r,{attrs:{disabled:!s.preobfuscatable,text:"",color:"primary"},on:{click:function(o){return e.openPreobfuscateDialog(s)}}},[e._v(" Preobfuscate ")]),t(r,{attrs:{disabled:!s.preobfuscatable,text:"",color:"error"},on:{click:function(o){return e.deletePreobfuscatedModules(s)}}},[e._v(" Remove preobfuscated modules ")])],1)],1)}),1)],1)],1)],1)},B=[],F=C(z,L,B,!1,null,null,null,null);const Y=F.exports;export{Y as default}; diff --git a/dist/assets/PluginEdit-d9ffd065.js b/dist/assets/PluginEdit-758bce52.js similarity index 69% rename from dist/assets/PluginEdit-d9ffd065.js rename to dist/assets/PluginEdit-758bce52.js index 5299d68..d5f8a63 100644 --- a/dist/assets/PluginEdit-d9ffd065.js +++ b/dist/assets/PluginEdit-758bce52.js @@ -1 +1 @@ -import{_ as l}from"./PluginTasksList-5b08e12c.js";import{_ as u}from"./GeneralForm-ad50630d.js";import{_ as p}from"./TechniqueChips-8d3b8349.js";import{_ as m}from"./InfoViewer-a26545d4.js";import{_}from"./ErrorStateAlert-44af51cd.js";import{a as c}from"./ListPageTop-5130be67.js";import{_ as f}from"./EditPageTop-4e0a4ef6.js";import{n as g,aE as h,aF as d,b as r,c as n,a as b}from"./index-e8f29bb9.js";import{_ as k,a,b as v,c as o}from"./VTabItem-e0010b3a.js";import"./TagViewer-357f9253.js";import"./VSelect-f55906da.js";import"./DateTimeDisplay-e5665873.js";import"./moment-fbc5633a.js";import"./VTooltip-0015e28c.js";import"./TooltipButton-ef876422.js";import"./index-eabf96b4.js";import"./ansi_up-b91c3d1d.js";import"./download-stager-ae353708.js";import"./VPagination-48f2bf47.js";import"./VDataTable-f3602581.js";import"./VSwitch-2cfffd69.js";import"./ExpansionPanelFilter-33a56e95.js";import"./VExpansionPanelHeader-a9447b85.js";import"./ExpansionPanelSearch-155a732a.js";import"./AdvancedTable-147b64b8.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";import"./tag-api-c942253a.js";import"./bypass-module-9d0c5e38.js";import"./bypass-api-80f88682.js";import"./credential-module-512a6f9e.js";import"./malleable-module-cb1f5265.js";import"./malleable-api-d0b35547.js";const x={name:"PluginEdit",components:{InfoViewer:m,GeneralForm:u,TechniqueChips:p,EditPageTop:f,PluginTasksList:l,TooltipButtonToggle:c,ErrorStateAlert:_},data(){return{reset:!0,loading:!1,isRefreshTasks:!1,form:{},plugin:{options:{}},errorState:!1}},computed:{breads(){return[{text:"Plugins",disabled:!1,to:"/plugins",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/plugins/edit"}]},breadcrumbName(){return this.plugin.name?this.plugin.name:this.id?this.id:""},pluginInfo(){return Object.keys(this.plugin).length<1?{}:{authors:this.plugin.authors,description:this.plugin.description,comments:this.plugin.comments}},pluginOptions(){const{options:e}=this.plugin;return e||{}},id(){return this.$route.params.id},tab:{set(e){this.$router.replace({query:{...this.$route.query,tab:e}})},get(){return this.$route.query.tab||"interact"}}},mounted(){this.getPlugin(this.id)},methods:{async submit(){if(!(this.loading||!this.$refs.generalform.$refs.form.validate())){this.loading=!0;try{const e=await h(this.plugin.name,this.form);this.$snack.success(`${e.detail}`)}catch(e){this.$snack.error(`Error: ${e}`)}this.loading=!1}},getPlugin(e){d(e).then(t=>{this.reset=!1,this.plugin=t,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var y=function(){var t=this,s=t._self._c;return s("div",{staticClass:"p4"},[s("portal",{attrs:{to:"app-bar-extension"}},[s("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[s(k,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(a,{key:"interact",attrs:{href:"#interact"}},[t._v(" Interact "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-terminal ")])],1),s(a,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),s(f,{attrs:{breads:t.breads,"show-submit":!1,"show-copy":!1,"show-delete":!1,"submit-loading":t.loading},on:{submit:t.submit}},[s("template",{slot:"extra-stuff"},[s(c,{attrs:{icon:"fa-redo","button-text":t.isRefreshTasks?"On":"Off",text:"Auto-refresh Tasks"},model:{value:t.isRefreshTasks,callback:function(i){t.isRefreshTasks=i},expression:"isRefreshTasks"}})],1)],2),t.errorState?s(_,{attrs:{"resource-id":t.id,"resource-type":"plugin"}}):s(v,{staticClass:"scrollable-pane",model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(o,{key:"interact",attrs:{value:"interact",transition:!1,"reverse-transition":!1}},[s("h4",{staticClass:"pl-4 pb-4"},[t._v("Execute Plugin")]),s(n,{staticStyle:{padding:"10px"}},[s(m,{staticClass:"info-viewer",attrs:{info:t.pluginInfo}}),s(p,{attrs:{techniques:t.plugin.TechniqueChips}}),t.reset?s(u,{ref:"generalform",attrs:{options:t.plugin.options},model:{value:t.form,callback:function(i){t.form=i},expression:"form"}}):t._e(),s(b,{attrs:{loading:t.loading,color:"primary"},on:{click:t.submit}},[t._v(" Submit ")])],1)],1),s(o,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[s(n,{attrs:{flat:""}},[s(l,{attrs:{plugin:t.plugin,"refresh-tasks":t.isRefreshTasks}})],1)],1)],1)],1)},T=[],P=g(x,y,T,!1,null,null,null,null);const rt=P.exports;export{rt as default}; +import{_ as l}from"./PluginTasksList-9cde5ac1.js";import{_ as u}from"./GeneralForm-e1472145.js";import{_ as p}from"./TechniqueChips-3c9db4c5.js";import{_ as m}from"./InfoViewer-98b37678.js";import{_}from"./ErrorStateAlert-3d45e0aa.js";import{a as c}from"./ListPageTop-78cbc2f3.js";import{_ as f}from"./EditPageTop-0ed1194e.js";import{n as g,aE as h,aF as d,b as r,c as n,a as b}from"./index-e409ba63.js";import{_ as k,a,b as v,c as o}from"./VTabItem-01f057dc.js";import"./TagViewer-81c3b950.js";import"./VSelect-22e7980f.js";import"./DateTimeDisplay-951c60c5.js";import"./moment-fbc5633a.js";import"./VTooltip-7c0b187f.js";import"./TooltipButton-f53c45a7.js";import"./index-e87896eb.js";import"./ansi_up-7c0d87a9.js";import"./download-stager-ae353708.js";import"./VPagination-4794e169.js";import"./VDataTable-dab2ebf1.js";import"./VSwitch-3f004360.js";import"./ExpansionPanelFilter-010a2264.js";import"./VExpansionPanelHeader-69136628.js";import"./ExpansionPanelSearch-94b8e3ac.js";import"./AdvancedTable-e51651be.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";import"./tag-api-d7e45ad4.js";import"./bypass-module-4e86a448.js";import"./bypass-api-6126dc83.js";import"./credential-module-93372e4e.js";import"./malleable-module-2a911c2d.js";import"./malleable-api-09135b63.js";const x={name:"PluginEdit",components:{InfoViewer:m,GeneralForm:u,TechniqueChips:p,EditPageTop:f,PluginTasksList:l,TooltipButtonToggle:c,ErrorStateAlert:_},data(){return{reset:!0,loading:!1,isRefreshTasks:!1,form:{},plugin:{options:{}},errorState:!1}},computed:{breads(){return[{text:"Plugins",disabled:!1,to:"/plugins",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/plugins/edit"}]},breadcrumbName(){return this.plugin.name?this.plugin.name:this.id?this.id:""},pluginInfo(){return Object.keys(this.plugin).length<1?{}:{authors:this.plugin.authors,description:this.plugin.description,comments:this.plugin.comments}},pluginOptions(){const{options:e}=this.plugin;return e||{}},id(){return this.$route.params.id},tab:{set(e){this.$router.replace({query:{...this.$route.query,tab:e}})},get(){return this.$route.query.tab||"interact"}}},mounted(){this.getPlugin(this.id)},methods:{async submit(){if(!(this.loading||!this.$refs.generalform.$refs.form.validate())){this.loading=!0;try{const e=await h(this.plugin.name,this.form);this.$snack.success(`${e.detail}`)}catch(e){this.$snack.error(`Error: ${e}`)}this.loading=!1}},getPlugin(e){d(e).then(t=>{this.reset=!1,this.plugin=t,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var y=function(){var t=this,s=t._self._c;return s("div",{staticClass:"p4"},[s("portal",{attrs:{to:"app-bar-extension"}},[s("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[s(k,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(a,{key:"interact",attrs:{href:"#interact"}},[t._v(" Interact "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-terminal ")])],1),s(a,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),s(f,{attrs:{breads:t.breads,"show-submit":!1,"show-copy":!1,"show-delete":!1,"submit-loading":t.loading},on:{submit:t.submit}},[s("template",{slot:"extra-stuff"},[s(c,{attrs:{icon:"fa-redo","button-text":t.isRefreshTasks?"On":"Off",text:"Auto-refresh Tasks"},model:{value:t.isRefreshTasks,callback:function(i){t.isRefreshTasks=i},expression:"isRefreshTasks"}})],1)],2),t.errorState?s(_,{attrs:{"resource-id":t.id,"resource-type":"plugin"}}):s(v,{staticClass:"scrollable-pane",model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(o,{key:"interact",attrs:{value:"interact",transition:!1,"reverse-transition":!1}},[s("h4",{staticClass:"pl-4 pb-4"},[t._v("Execute Plugin")]),s(n,{staticStyle:{padding:"10px"}},[s(m,{staticClass:"info-viewer",attrs:{info:t.pluginInfo}}),s(p,{attrs:{techniques:t.plugin.TechniqueChips}}),t.reset?s(u,{ref:"generalform",attrs:{options:t.plugin.options},model:{value:t.form,callback:function(i){t.form=i},expression:"form"}}):t._e(),s(b,{attrs:{loading:t.loading,color:"primary"},on:{click:t.submit}},[t._v(" Submit ")])],1)],1),s(o,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[s(n,{attrs:{flat:""}},[s(l,{attrs:{plugin:t.plugin,"refresh-tasks":t.isRefreshTasks}})],1)],1)],1)],1)},T=[],P=g(x,y,T,!1,null,null,null,null);const rt=P.exports;export{rt as default}; diff --git a/dist/assets/PluginTasksList-5b08e12c.js b/dist/assets/PluginTasksList-9cde5ac1.js similarity index 59% rename from dist/assets/PluginTasksList-5b08e12c.js rename to dist/assets/PluginTasksList-9cde5ac1.js index 1a8b532..47dbe6c 100644 --- a/dist/assets/PluginTasksList-5b08e12c.js +++ b/dist/assets/PluginTasksList-9cde5ac1.js @@ -1,3 +1,3 @@ -import{_ as h}from"./TagViewer-357f9253.js";import{_ as f}from"./DateTimeDisplay-e5665873.js";import{_}from"./TooltipButton-ef876422.js";import{n as m,aS as I,aT as w,aU as P,I as c,x as q,aV as l,as as $,aW as C,a as p,at as S,b as r,k as D,d as O,e as i,f as o,a2 as B,aD as g,au as U,a1 as A}from"./index-e8f29bb9.js";import{h as T}from"./moment-fbc5633a.js";import{d as F}from"./index-eabf96b4.js";import{A as G}from"./ansi_up-b91c3d1d.js";import{D as k}from"./download-stager-ae353708.js";import{_ as H}from"./VPagination-48f2bf47.js";import{_ as L}from"./VDataTable-f3602581.js";import{_ as j}from"./VSwitch-2cfffd69.js";import{_ as d}from"./ExpansionPanelFilter-33a56e95.js";import{_ as b}from"./ExpansionPanelSearch-155a732a.js";import{_ as x}from"./AdvancedTable-147b64b8.js";import{_ as v}from"./ListPageTop-5130be67.js";import{g as R}from"./tag-api-c942253a.js";const E={name:"PluginTasksTable",components:{DateTimeDisplay:f,TagViewer:h,TooltipButton:_},mixins:[k],props:{plugin:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedPlugins:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:T,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:F(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Plugin",value:"plugin_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},plugin(){this.debouncedGetTasks()},selectedPlugins(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new G().ansi_to_html(t)},addBlankLines(t){return` +import{_ as h}from"./TagViewer-81c3b950.js";import{_ as f}from"./DateTimeDisplay-951c60c5.js";import{_}from"./TooltipButton-f53c45a7.js";import{n as m,aS as I,aT as w,aU as P,I as c,x as q,aV as l,as as $,aW as C,a as p,at as S,b as r,k as D,d as O,e as i,f as o,a2 as B,aD as g,au as U,a1 as A}from"./index-e409ba63.js";import{h as T}from"./moment-fbc5633a.js";import{d as F}from"./index-e87896eb.js";import{A as G}from"./ansi_up-7c0d87a9.js";import{D as k}from"./download-stager-ae353708.js";import{_ as H}from"./VPagination-4794e169.js";import{_ as L}from"./VDataTable-dab2ebf1.js";import{_ as j}from"./VSwitch-3f004360.js";import{_ as d}from"./ExpansionPanelFilter-010a2264.js";import{_ as b}from"./ExpansionPanelSearch-94b8e3ac.js";import{_ as x}from"./AdvancedTable-e51651be.js";import{_ as v}from"./ListPageTop-78cbc2f3.js";import{g as R}from"./tag-api-d7e45ad4.js";const E={name:"PluginTasksTable",components:{DateTimeDisplay:f,TagViewer:h,TooltipButton:_},mixins:[k],props:{plugin:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedPlugins:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:T,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:F(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Plugin",value:"plugin_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},plugin(){this.debouncedGetTasks()},selectedPlugins(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new G().ansi_to_html(t)},addBlankLines(t){return` ${t} -`},deleteTag(t,e){I(t.plugin_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.plugin_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addTag(t,e){P(t.plugin_id,t.id,e).then(s=>{this.$set(t,"tags",[...t.tags,s]),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},truncateMessage(t){return t?t.length>30?`${t.substr(0,30)}...`:t:""},updateTaskBackgroundColor(t){t.backgroundColor==="black"?t.backgroundColor="white":t.backgroundColor="black",this.expandedTasks[t.uniqueId].backgroundColor=t.backgroundColor,c.set(this.tasks,this.tasks.indexOf(t),t)},isDownload(t){return t.downloads&&t.downloads.length>0},downloadFile(t){q(t.id)},hasOutput(t){return!!t.output},async downloadInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.agent_id,t.id);this.expandedTasks[t.uniqueId]=e}this.downloadText(this.expandedTasks[t.uniqueId].full_input,`${t.uniqueId}-input.txt`)}},downloadOutput(t){t.output&&this.downloadText(t.output,`${t.uniqueId}-output.txt`)},async copyInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]=e}try{navigator.clipboard.writeText(this.expandedTasks[t.uniqueId].full_input)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}},copyOutput(t){if(t.output)try{navigator.clipboard.writeText(t.output)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}},imageData(t,e){var n;const s=(n=this.expandedTasks[t.uniqueId])==null?void 0:n.downloads;if(s){const a=s.find(u=>u.id===e.id);if(a)return a.image}return null},async getImagesForTask(t){var e;if(!this.expandedTasks[t.uniqueId]){const s=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}for(let s=0;s0?(this.sortBy=t.sortBy[0],this.sortDesc=t.sortDesc[0]):(this.sortBy="id",this.sortDesc=!0),this.debouncedGetTasks()},async getTasks(){if(!this.noFilters&&(this.selectedPlugins.length===0||this.selectedUsers.length===0)){this.tasks=[],this.currentPage=1,this.totalPages=1,this.totalItems=0;return}this.loading=!0;let t=null;this.selectedPlugins.length>0&&(t=this.selectedPlugins);const e=await C(t,{page:this.currentPage,limit:this.itemsPerPage,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",users:this.selectedUsers,tags:this.selectedTags,search:this.search});this.currentPage=e.page,this.totalPages=e.total_pages,this.totalItems=e.total,this.tasks=e.records.map(s=>(s.uniqueId=`${s.plugin_id}-${s.id}`,this.expandedTasks[s.uniqueId]||(this.expandedTasks[s.uniqueId]={}),this.expandedTasks[s.uniqueId].expandedInput&&(s.expandedInput=!0),this.expandedTasks[s.uniqueId].backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor||"black",s.backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor,this.isAnsi(s.output||"")&&(this.expandedTasks[s.uniqueId].htmlOutput=this.ansiToHtml(s.output)),s)),this.tasks=e.records,this.loading=!1}}};var V=function(){var e=this,s=e._self._c;return s("div",[s(H,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(n){e.currentPage=n},expression:"currentPage"}}),s(L,{attrs:{headers:e.headers,items:e.tasks,"item-key":"uniqueId","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage,"show-expand":""},on:{"update:itemsPerPage":function(n){e.itemsPerPage=n},"update:items-per-page":function(n){e.itemsPerPage=n},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"expanded-item",fn:function({headers:n,item:a}){return[s("td",{attrs:{colspan:n.length}},[s("div",[s("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[s("div",[s(_,{attrs:{icon:a.expandedInput?"fa-minus":"fa-plus",text:"See Full Input","x-small":""},on:{click:function(u){return e.toggleSeeFullInput(a)}}}),a.expandedInput?s("span",[e._v("Showing full input")]):e._e()],1),s(j,{attrs:{"false-value":"white","true-value":"black",label:"Dark Background"},on:{change:function(u){return e.updateTaskBackgroundColor(a)}},model:{value:e.expandedTasks[a.uniqueId].backgroundColor,callback:function(u){e.$set(e.expandedTasks[a.uniqueId],"backgroundColor",u)},expression:"expandedTasks[item.uniqueId].backgroundColor"}})],1),s("p",[s("b",[e._v("Task Input:")])]),s("p",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e._v(" "+e._s(e.addBlankLines(a.expandedInput?e.expandedTasks[a.uniqueId].full_input:a.input))+" ")]),s("p",[s("b",[e._v("Task Output:")])]),a.downloads.length>0&&a.downloads.some(u=>u.filename.match(/[^/]+(jpg|jpeg|png|gif)$/))?s("div",[s(p,{attrs:{text:"","x-small":""},on:{click:function(u){return e.getImagesForTask(a)}}},[e._v(" View Images ")]),s("div",e._l(a.downloads,function(u){return s(S,{key:u.id,attrs:{src:e.imageData(a,u),alt:u.filename,"max-width":700,contain:""}})}),1)],1):e._e(),s("div",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e.expandedTasks[a.uniqueId].htmlOutput?s("div",{domProps:{innerHTML:e._s(e.expandedTasks[a.uniqueId].htmlOutput)}}):s("div",[e._v("addBlankLines(item.output)")])])])])]}},{key:"item.status",fn:function({item:n}){return[n.status==="started"?s(r,{attrs:{color:"blue",small:""}},[e._v(" fa-check-square ")]):n.status==="queued"?s(r,{attrs:{color:"orange",small:""}},[e._v(" fa-clock ")]):n.status==="completed"?s(r,{attrs:{color:"green",small:""}},[e._v(" fa-check-circle ")]):n.status==="error"?s(r,{attrs:{color:"red",small:""}},[e._v(" fa-times-circle ")]):n.status==="continuous"?s(r,{attrs:{color:"purple",small:""}},[e._v(" fa-infinity ")]):e._e()]}},{key:"item.input",fn:function({item:n}){return[s("span",[e._v(e._s(e.truncateMessage(n.input)))])]}},{key:"item.task_name",fn:function({item:n}){return[s("span",[e._v(e._s(n.module_name==null?n.task_name:n.module_name))])]}},{key:"item.updated_at",fn:function({item:n}){return[s(f,{attrs:{timestamp:n.updated_at}})]}},{key:"item.tags",fn:function({item:n}){return[s(h,{attrs:{tags:n.tags},on:{"update-tag":function(a){return e.updateTag(n,...arguments)},"delete-tag":function(a){return e.deleteTag(n,...arguments)},"new-tag":function(a){return e.addTag(n,...arguments)}}})]}},{key:"item.actions",fn:function({item:n}){return[s(D,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:u}){return[s(p,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",u,!1),a),[s(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(O,{staticClass:"ml-2 mr-2"},[s(i,{key:"downloadInput",attrs:{link:""},on:{click:function(a){return e.downloadInput(n)}}},[s(o,[s(r,[e._v("fa-download")]),e._v(" Download Input ")],1)],1),e.hasOutput(n)?s(i,{key:"downloadOutput",attrs:{link:""},on:{click:function(a){return e.downloadOutput(n)}}},[s(o,[s(r,[e._v("fa-download")]),e._v(" Download Output ")],1)],1):e._e(),s(i,{key:"clipboardInput",attrs:{link:""},on:{click:function(a){return e.copyInput(n)}}},[s(o,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Input to Clipboard ")],1)],1),e.hasOutput(n)?s(i,{key:"clipboardOutput",attrs:{link:""},on:{click:function(a){return e.copyOutput(n)}}},[s(o,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Output to Clipboard ")],1)],1):e._e(),s(B),e._l(n.downloads,function(a){return s(i,{key:"download-"+a.id,attrs:{link:""},on:{click:function(u){return e.downloadFile(a)}}},[s(o,[s(r,[e._v("fa-download")]),e._v(" Download "+e._s(a.filename)+" ")],1)],1)})],2)],1)]}}])})],1)},M=[],N=m(E,V,M,!1,null,null,null,null);const y=N.exports;const Y={name:"PluginTasksList",components:{AdvancedTable:x,ExpansionPanelFilter:d,ExpansionPanelSearch:b,PluginTasksTable:y,ListPageTop:v},mixins:[k],props:{plugin:{type:Object,required:!1,default:null},useHeader:{type:Boolean,default:!1},refreshTasks:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"Tasks",disabled:!0,href:"/plugins?tab=tasks"}],tasks:[],search:"",loading:!1,moment:T,selectedPlugins:[],selectedUsers:[],selectedTags:[],tags:[],autoRefresh:!0}},computed:{pluginStore(){return g()},userStore(){return U()},users(){return[...this.userStore.users,{id:0,username:"Non-User"}]},...A(g,["plugins"])},watch:{plugin:{handler(t){t&&(this.selectedPlugins=[t.session_id])},immediate:!0}},async mounted(){await Promise.all([this.pluginStore.getPlugins(),this.userStore.getUsers(),this.getTags()])},methods:{async getTags(){const t=await R({page:1,limit:-1,sources:"plugin_task"}),e=[];t.records.forEach(s=>{e.find(a=>a.name===s.name&&a.value===s.value)||e.push(s)}),this.tags=e},getTasks(){this.$refs.pluginTaskTable.debouncedGetTasks()}}};var z=function(){var e=this,s=e._self._c;return s("div",[e.active&&e.useHeader?s(v,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1,"is-auto-refresh":!0,"auto-refresh":e.useHeader?e.autoRefresh:e.refreshTasks,"refresh-text":"Auto-refresh Tasks"},on:{"update:auto-refresh":function(n){e.autoRefresh=n},refresh:e.getTasks}}):e._e(),s(x,{scopedSlots:e._u([{key:"filters",fn:function(){return[s(b,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),e.plugin?e._e():s(d,{attrs:{title:"Plugins",label:"name","item-key":"id","item-value":"id",items:e.plugins},model:{value:e.selectedPlugins,callback:function(n){e.selectedPlugins=n},expression:"selectedPlugins"}}),s(d,{attrs:{title:"Users",label:"username","item-key":"id","item-value":"id",items:e.users},model:{value:e.selectedUsers,callback:function(n){e.selectedUsers=n},expression:"selectedUsers"}}),s(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(n){e.selectedTags=n},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[s(y,{ref:"pluginTaskTable",attrs:{plugin:e.plugin,"refresh-tasks":e.useHeader?e.autoRefresh:e.refreshTasks,"hide-columns":["id","task_name"],"selected-plugins":e.selectedPlugins,"selected-users":e.selectedUsers,"selected-tags":e.selectedTags,search:e.search},on:{"refresh-tags":e.getTags}})]},proxy:!0}])})],1)},W=[],Z=m(Y,z,W,!1,null,null,null,null);const pe=Z.exports;export{pe as _}; +`},deleteTag(t,e){I(t.plugin_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.plugin_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addTag(t,e){P(t.plugin_id,t.id,e).then(s=>{this.$set(t,"tags",[...t.tags,s]),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},truncateMessage(t){return t?t.length>30?`${t.substr(0,30)}...`:t:""},updateTaskBackgroundColor(t){t.backgroundColor==="black"?t.backgroundColor="white":t.backgroundColor="black",this.expandedTasks[t.uniqueId].backgroundColor=t.backgroundColor,c.set(this.tasks,this.tasks.indexOf(t),t)},isDownload(t){return t.downloads&&t.downloads.length>0},downloadFile(t){q(t.id)},hasOutput(t){return!!t.output},async downloadInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.agent_id,t.id);this.expandedTasks[t.uniqueId]=e}this.downloadText(this.expandedTasks[t.uniqueId].full_input,`${t.uniqueId}-input.txt`)}},downloadOutput(t){t.output&&this.downloadText(t.output,`${t.uniqueId}-output.txt`)},async copyInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]=e}try{navigator.clipboard.writeText(this.expandedTasks[t.uniqueId].full_input)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}},copyOutput(t){if(t.output)try{navigator.clipboard.writeText(t.output)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}},imageData(t,e){var n;const s=(n=this.expandedTasks[t.uniqueId])==null?void 0:n.downloads;if(s){const a=s.find(u=>u.id===e.id);if(a)return a.image}return null},async getImagesForTask(t){var e;if(!this.expandedTasks[t.uniqueId]){const s=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}for(let s=0;s0?(this.sortBy=t.sortBy[0],this.sortDesc=t.sortDesc[0]):(this.sortBy="id",this.sortDesc=!0),this.debouncedGetTasks()},async getTasks(){if(!this.noFilters&&(this.selectedPlugins.length===0||this.selectedUsers.length===0)){this.tasks=[],this.currentPage=1,this.totalPages=1,this.totalItems=0;return}this.loading=!0;let t=null;this.selectedPlugins.length>0&&(t=this.selectedPlugins);const e=await C(t,{page:this.currentPage,limit:this.itemsPerPage,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",users:this.selectedUsers,tags:this.selectedTags,search:this.search});this.currentPage=e.page,this.totalPages=e.total_pages,this.totalItems=e.total,this.tasks=e.records.map(s=>(s.uniqueId=`${s.plugin_id}-${s.id}`,this.expandedTasks[s.uniqueId]||(this.expandedTasks[s.uniqueId]={}),this.expandedTasks[s.uniqueId].expandedInput&&(s.expandedInput=!0),this.expandedTasks[s.uniqueId].backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor||"black",s.backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor,this.isAnsi(s.output||"")&&(this.expandedTasks[s.uniqueId].htmlOutput=this.ansiToHtml(s.output)),s)),this.tasks=e.records,this.loading=!1}}};var V=function(){var e=this,s=e._self._c;return s("div",[s(H,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(n){e.currentPage=n},expression:"currentPage"}}),s(L,{attrs:{headers:e.headers,items:e.tasks,"item-key":"uniqueId","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage,"show-expand":""},on:{"update:itemsPerPage":function(n){e.itemsPerPage=n},"update:items-per-page":function(n){e.itemsPerPage=n},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"expanded-item",fn:function({headers:n,item:a}){return[s("td",{attrs:{colspan:n.length}},[s("div",[s("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[s("div",[s(_,{attrs:{icon:a.expandedInput?"fa-minus":"fa-plus",text:"See Full Input","x-small":""},on:{click:function(u){return e.toggleSeeFullInput(a)}}}),a.expandedInput?s("span",[e._v("Showing full input")]):e._e()],1),s(j,{attrs:{"false-value":"white","true-value":"black",label:"Dark Background"},on:{change:function(u){return e.updateTaskBackgroundColor(a)}},model:{value:e.expandedTasks[a.uniqueId].backgroundColor,callback:function(u){e.$set(e.expandedTasks[a.uniqueId],"backgroundColor",u)},expression:"expandedTasks[item.uniqueId].backgroundColor"}})],1),s("p",[s("b",[e._v("Task Input:")])]),s("p",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e._v(" "+e._s(e.addBlankLines(a.expandedInput?e.expandedTasks[a.uniqueId].full_input:a.input))+" ")]),s("p",[s("b",[e._v("Task Output:")])]),a.downloads.length>0&&a.downloads.some(u=>u.filename.match(/[^/]+(jpg|jpeg|png|gif)$/))?s("div",[s(p,{attrs:{text:"","x-small":""},on:{click:function(u){return e.getImagesForTask(a)}}},[e._v(" View Images ")]),s("div",e._l(a.downloads,function(u){return s(S,{key:u.id,attrs:{src:e.imageData(a,u),alt:u.filename,"max-width":700,contain:""}})}),1)],1):e._e(),s("div",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e.expandedTasks[a.uniqueId].htmlOutput?s("div",{domProps:{innerHTML:e._s(e.expandedTasks[a.uniqueId].htmlOutput)}}):s("div",[e._v(" "+e._s(e.addBlankLines(a.output))+" ")])])])])]}},{key:"item.status",fn:function({item:n}){return[n.status==="started"?s(r,{attrs:{color:"blue",small:""}},[e._v(" fa-check-square ")]):n.status==="queued"?s(r,{attrs:{color:"orange",small:""}},[e._v(" fa-clock ")]):n.status==="completed"?s(r,{attrs:{color:"green",small:""}},[e._v(" fa-check-circle ")]):n.status==="error"?s(r,{attrs:{color:"red",small:""}},[e._v(" fa-times-circle ")]):n.status==="continuous"?s(r,{attrs:{color:"purple",small:""}},[e._v(" fa-infinity ")]):e._e()]}},{key:"item.input",fn:function({item:n}){return[s("span",[e._v(e._s(e.truncateMessage(n.input)))])]}},{key:"item.task_name",fn:function({item:n}){return[s("span",[e._v(e._s(n.module_name==null?n.task_name:n.module_name))])]}},{key:"item.updated_at",fn:function({item:n}){return[s(f,{attrs:{timestamp:n.updated_at}})]}},{key:"item.tags",fn:function({item:n}){return[s(h,{attrs:{tags:n.tags},on:{"update-tag":function(a){return e.updateTag(n,...arguments)},"delete-tag":function(a){return e.deleteTag(n,...arguments)},"new-tag":function(a){return e.addTag(n,...arguments)}}})]}},{key:"item.actions",fn:function({item:n}){return[s(D,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:u}){return[s(p,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",u,!1),a),[s(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(O,{staticClass:"ml-2 mr-2"},[s(i,{key:"downloadInput",attrs:{link:""},on:{click:function(a){return e.downloadInput(n)}}},[s(o,[s(r,[e._v("fa-download")]),e._v(" Download Input ")],1)],1),e.hasOutput(n)?s(i,{key:"downloadOutput",attrs:{link:""},on:{click:function(a){return e.downloadOutput(n)}}},[s(o,[s(r,[e._v("fa-download")]),e._v(" Download Output ")],1)],1):e._e(),s(i,{key:"clipboardInput",attrs:{link:""},on:{click:function(a){return e.copyInput(n)}}},[s(o,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Input to Clipboard ")],1)],1),e.hasOutput(n)?s(i,{key:"clipboardOutput",attrs:{link:""},on:{click:function(a){return e.copyOutput(n)}}},[s(o,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Output to Clipboard ")],1)],1):e._e(),s(B),e._l(n.downloads,function(a){return s(i,{key:"download-"+a.id,attrs:{link:""},on:{click:function(u){return e.downloadFile(a)}}},[s(o,[s(r,[e._v("fa-download")]),e._v(" Download "+e._s(a.filename)+" ")],1)],1)})],2)],1)]}}])})],1)},M=[],N=m(E,V,M,!1,null,null,null,null);const y=N.exports;const Y={name:"PluginTasksList",components:{AdvancedTable:x,ExpansionPanelFilter:d,ExpansionPanelSearch:b,PluginTasksTable:y,ListPageTop:v},mixins:[k],props:{plugin:{type:Object,required:!1,default:null},useHeader:{type:Boolean,default:!1},refreshTasks:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"Tasks",disabled:!0,href:"/plugins?tab=tasks"}],tasks:[],search:"",loading:!1,moment:T,selectedPlugins:[],selectedUsers:[],selectedTags:[],tags:[],autoRefresh:!0}},computed:{pluginStore(){return g()},userStore(){return U()},users(){return[...this.userStore.users,{id:0,username:"Non-User"}]},...A(g,["plugins"])},watch:{plugin:{handler(t){t&&(this.selectedPlugins=[t.session_id])},immediate:!0}},async mounted(){await Promise.all([this.pluginStore.getPlugins(),this.userStore.getUsers(),this.getTags()])},methods:{async getTags(){const t=await R({page:1,limit:-1,sources:"plugin_task"}),e=[];t.records.forEach(s=>{e.find(a=>a.name===s.name&&a.value===s.value)||e.push(s)}),this.tags=e},getTasks(){this.$refs.pluginTaskTable.debouncedGetTasks()}}};var z=function(){var e=this,s=e._self._c;return s("div",[e.active&&e.useHeader?s(v,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1,"is-auto-refresh":!0,"auto-refresh":e.useHeader?e.autoRefresh:e.refreshTasks,"refresh-text":"Auto-refresh Tasks"},on:{"update:auto-refresh":function(n){e.autoRefresh=n},refresh:e.getTasks}}):e._e(),s(x,{scopedSlots:e._u([{key:"filters",fn:function(){return[s(b,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),e.plugin?e._e():s(d,{attrs:{title:"Plugins",label:"name","item-key":"id","item-value":"id",items:e.plugins},model:{value:e.selectedPlugins,callback:function(n){e.selectedPlugins=n},expression:"selectedPlugins"}}),s(d,{attrs:{title:"Users",label:"username","item-key":"id","item-value":"id",items:e.users},model:{value:e.selectedUsers,callback:function(n){e.selectedUsers=n},expression:"selectedUsers"}}),s(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(n){e.selectedTags=n},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[s(y,{ref:"pluginTaskTable",attrs:{plugin:e.plugin,"refresh-tasks":e.useHeader?e.autoRefresh:e.refreshTasks,"hide-columns":["id","task_name"],"selected-plugins":e.selectedPlugins,"selected-users":e.selectedUsers,"selected-tags":e.selectedTags,search:e.search},on:{"refresh-tags":e.getTags}})]},proxy:!0}])})],1)},W=[],Z=m(Y,z,W,!1,null,null,null,null);const pe=Z.exports;export{pe as _}; diff --git a/dist/assets/Plugins-8fb73a0c.js b/dist/assets/Plugins-693fa884.js similarity index 71% rename from dist/assets/Plugins-8fb73a0c.js rename to dist/assets/Plugins-693fa884.js index 4cfc643..602981e 100644 --- a/dist/assets/Plugins-8fb73a0c.js +++ b/dist/assets/Plugins-693fa884.js @@ -1 +1 @@ -import{_ as l}from"./PluginTasksList-5b08e12c.js";import{_}from"./ListPageTop-5130be67.js";import{n as u,aD as m,b as i,c as r}from"./index-e8f29bb9.js";import{_ as c}from"./VDataTable-f3602581.js";import{_ as d,a,b as f,c as o}from"./VTabItem-e0010b3a.js";import"./TagViewer-357f9253.js";import"./VSelect-f55906da.js";import"./DateTimeDisplay-e5665873.js";import"./moment-fbc5633a.js";import"./VTooltip-0015e28c.js";import"./TooltipButton-ef876422.js";import"./index-eabf96b4.js";import"./ansi_up-b91c3d1d.js";import"./download-stager-ae353708.js";import"./VPagination-48f2bf47.js";import"./VSwitch-2cfffd69.js";import"./ExpansionPanelFilter-33a56e95.js";import"./VExpansionPanelHeader-a9447b85.js";import"./ExpansionPanelSearch-155a732a.js";import"./AdvancedTable-147b64b8.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";import"./tag-api-c942253a.js";const g={name:"PluginsList",components:{ListPageTop:_},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"List",disabled:!0,href:"/plugins?tab=list-view"}],headers:[{text:"Name",value:"name"},{text:"Description",value:"description"}]}},computed:{pluginStore(){return m()},plugins(){return this.pluginStore.plugins}},mounted(){this.getPlugins()},methods:{getPlugins(){this.pluginStore.getPlugins()}}};var v=function(){var t=this,e=t._self._c;return e("div",[t.active?e(_,{attrs:{breads:t.breads,"show-create":!1,"show-delete":!1,"show-refresh":!0},on:{refresh:t.getPlugins}}):t._e(),e(c,{attrs:{headers:t.headers,items:t.plugins,dense:""},scopedSlots:t._u([{key:"item.name",fn:function({item:s}){return[e("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"pluginEdit",params:{id:s.id}}}},[t._v(" "+t._s(s.name)+" ")])]}}])})],1)},h=[],b=u(g,v,h,!1,null,null,null,null);const p=b.exports;const y={name:"Plugins",components:{PluginsList:p,PluginTasksList:l},data(){return{}},computed:{tab:{set(n){this.$router.replace({query:{...this.$route.query,tab:n}})},get(){return this.$route.query.tab||"list-view"}}}};var k=function(){var t=this,e=t._self._c;return e("div",[e("portal",{attrs:{to:"app-bar-extension"}},[e("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[e(d,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(a,{key:"list-view",attrs:{href:"#list-view"}},[t._v(" List "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-list ")])],1),e(a,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),e(f,{model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(o,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[e(r,{attrs:{flat:""}},[e(p,{attrs:{active:t.tab==="list-view"}})],1)],1),e(o,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[e(r,{attrs:{flat:""}},[e(l,{attrs:{active:t.tab==="tasks","use-header":!0}})],1)],1)],1)],1)},x=[],P=u(y,k,x,!1,null,null,null,null);const Q=P.exports;export{Q as default}; +import{_ as l}from"./PluginTasksList-9cde5ac1.js";import{_}from"./ListPageTop-78cbc2f3.js";import{n as u,aD as m,b as i,c as r}from"./index-e409ba63.js";import{_ as c}from"./VDataTable-dab2ebf1.js";import{_ as d,a,b as f,c as o}from"./VTabItem-01f057dc.js";import"./TagViewer-81c3b950.js";import"./VSelect-22e7980f.js";import"./DateTimeDisplay-951c60c5.js";import"./moment-fbc5633a.js";import"./VTooltip-7c0b187f.js";import"./TooltipButton-f53c45a7.js";import"./index-e87896eb.js";import"./ansi_up-7c0d87a9.js";import"./download-stager-ae353708.js";import"./VPagination-4794e169.js";import"./VSwitch-3f004360.js";import"./ExpansionPanelFilter-010a2264.js";import"./VExpansionPanelHeader-69136628.js";import"./ExpansionPanelSearch-94b8e3ac.js";import"./AdvancedTable-e51651be.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";import"./tag-api-d7e45ad4.js";const g={name:"PluginsList",components:{ListPageTop:_},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"List",disabled:!0,href:"/plugins?tab=list-view"}],headers:[{text:"Name",value:"name"},{text:"Description",value:"description"}]}},computed:{pluginStore(){return m()},plugins(){return this.pluginStore.plugins}},mounted(){this.getPlugins()},methods:{getPlugins(){this.pluginStore.getPlugins()}}};var v=function(){var t=this,e=t._self._c;return e("div",[t.active?e(_,{attrs:{breads:t.breads,"show-create":!1,"show-delete":!1,"show-refresh":!0},on:{refresh:t.getPlugins}}):t._e(),e(c,{attrs:{headers:t.headers,items:t.plugins,dense:""},scopedSlots:t._u([{key:"item.name",fn:function({item:s}){return[e("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"pluginEdit",params:{id:s.id}}}},[t._v(" "+t._s(s.name)+" ")])]}}])})],1)},h=[],b=u(g,v,h,!1,null,null,null,null);const p=b.exports;const y={name:"Plugins",components:{PluginsList:p,PluginTasksList:l},data(){return{}},computed:{tab:{set(n){this.$router.replace({query:{...this.$route.query,tab:n}})},get(){return this.$route.query.tab||"list-view"}}}};var k=function(){var t=this,e=t._self._c;return e("div",[e("portal",{attrs:{to:"app-bar-extension"}},[e("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[e(d,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(a,{key:"list-view",attrs:{href:"#list-view"}},[t._v(" List "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-list ")])],1),e(a,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),e(f,{model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(o,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[e(r,{attrs:{flat:""}},[e(p,{attrs:{active:t.tab==="list-view"}})],1)],1),e(o,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[e(r,{attrs:{flat:""}},[e(l,{attrs:{active:t.tab==="tasks","use-header":!0}})],1)],1)],1)],1)},x=[],P=u(y,k,x,!1,null,null,null,null);const Q=P.exports;export{Q as default}; diff --git a/dist/assets/Settings-f3026d52.js b/dist/assets/Settings-fd4b553f.js similarity index 95% rename from dist/assets/Settings-f3026d52.js rename to dist/assets/Settings-fd4b553f.js index 7a3ad27..ee1bec7 100644 --- a/dist/assets/Settings-f3026d52.js +++ b/dist/assets/Settings-fd4b553f.js @@ -1 +1 @@ -import{_ as d}from"./ListPageTop-5130be67.js";import{r as u,b as p}from"./bypass-api-80f88682.js";import{r as f,a as m}from"./module-api-3f2776ef.js";import{r as h,b as _}from"./malleable-api-d0b35547.js";import{a1 as g,u as i,C as v,as as w,br as b,bs as y,bt as k,n as $,bu as C,at as n,a2 as P,a as r,i as o,a7 as S,j as c}from"./index-e8f29bb9.js";import{_ as l}from"./VSwitch-2cfffd69.js";import"./VTooltip-0015e28c.js";import"./VItemGroup-e39c2c83.js";const x={components:{ListPageTop:d},data(){return{password:{form:{},loading:!1},rules:{password:[a=>!!a||"Password is required",a=>!!a&&a.length>5||"Password must be larger than 5 characters"],confirmPassword:[a=>!!a||"Confirmation is required",a=>a===this.password.form.password||"Password must match"]},modules:{loading:!1},bypasses:{loading:!1},profiles:{loading:!1},plugins:{loading:!1},showPassword:!1,showConfirm:!1,valid:!1,breads:[{text:"Settings",disabled:!0,href:"/settings"}],avatarUrl:""}},computed:{...g(i,["user"]),applicationStore(){return i()},agentStore(){return v()},userId(){return this.user.id}},watch:{"user.avatar":{async handler(){this.user.avatar&&(this.avatarUrl=await this.getDownloadUrl(this.user.avatar))},immediate:!0}},methods:{async getDownloadUrl(a){return await w(a.id)},handleFileImport(){this.isSelecting=!0,window.addEventListener("focus",()=>{this.isSelecting=!1},{once:!0}),this.$refs.uploader.click()},async onFileChanged(a){const s=a.target.files[0],e=new FormData;e.append("file",s),await b(this.userId,e),this.applicationStore.refreshMe(),this.$snack.success("Upload complete")},async logout(){await this.$root.$confirm("","Are you sure you want to logout?",{color:"green"})&&this.applicationStore.logout()},clearState(){this.applicationStore.clear(),this.agentStore.clear()},submit(){this.password.loading||!this.$refs.form.validate()||(this.password.loading=!0,y(this.user.id,this.password.form.password).then(()=>{this.$snack.success("Password updated"),this.password.form={},this.$refs.form.resetValidation()}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.password.loading=!1}))},resetProfiles(){this.profiles.loading=!0,h().then(()=>{this.$snack.success("Profiles reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadProfiles(){this.profiles.loading=!0,_().then(()=>{this.$snack.success("Profiles reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadModules(){this.modules.loading=!0,f().then(()=>{this.$snack.success("Module reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},resetModules(){this.modules.loading=!0,m().then(()=>{this.$snack.success("Module reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},reloadBypasses(){this.bypasses.loading=!0,u().then(()=>{this.$snack.success("Bypass reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},resetBypasses(){this.bypasses.loading=!0,p().then(()=>{this.$snack.success("Bypass reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},reloadPlugins(){this.plugins.loading=!0,k().then(()=>{this.$snack.success("Plugin reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.plugins.loading=!1})}}};var R=function(){var s=this,e=s._self._c;return e("div",[e(d,{attrs:{breads:s.breads}}),e("div",{staticClass:"page"},[e("div",{staticClass:"first-part point",staticStyle:{display:"flex","flex-direction":"row","align-items":"center"}},[e(C,{staticClass:"ma-2",on:{click:s.handleFileImport}},[s.user.avatar?e(n,{attrs:{src:s.avatarUrl}}):e(n,{attrs:{src:`https://ui-avatars.com/api/?background=random&name=${s.user.username}`}})],1),e("input",{ref:"uploader",staticClass:"d-none",attrs:{type:"file","aria-label":"uploader"},on:{change:s.onFileChanged}}),e("span",{staticClass:"ma-2"},[s._v(s._s(s.user.username))]),e(P),e(r,{attrs:{color:"primary",text:""},on:{click:s.logout}},[s._v(" Logout ")])],1),e(o),e("div",{staticStyle:{display:"flex","flex-direction":"row"}},[e(l,{attrs:{label:"Dark Mode"},model:{value:s.applicationStore.darkMode,callback:function(t){s.$set(s.applicationStore,"darkMode",t)},expression:"applicationStore.darkMode"}}),e(l,{staticClass:"pl-8",attrs:{label:"Chat Widget"},model:{value:s.applicationStore.chatWidget,callback:function(t){s.$set(s.applicationStore,"chatWidget",t)},expression:"applicationStore.chatWidget"}})],1),e(o),s._m(0),e(S,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(t){return t.preventDefault(),s.submit.apply(null,arguments)}},model:{value:s.valid,callback:function(t){s.valid=t},expression:"valid"}},[e(c,{attrs:{type:s.showPassword?"text":"password","append-icon":s.showPassword?"fa-eye":"fa-eye-slash",rules:s.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showPassword=!s.showPassword}},model:{value:s.password.form.password,callback:function(t){s.$set(s.password.form,"password",t)},expression:"password.form.password"}}),e(c,{attrs:{type:s.showConfirm?"text":"password","append-icon":s.showConfirm?"fa-eye":"fa-eye-slash",rules:s.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showConfirm=!s.showConfirm}},model:{value:s.password.form.confirmPassword,callback:function(t){s.$set(s.password.form,"confirmPassword",t)},expression:"password.form.confirmPassword"}}),e(r,{staticClass:"mt-4 mb-4 primary",attrs:{type:"submit",loading:s.password.loading}},[s._v(" submit ")])],1),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(1),e(l,{attrs:{color:"primary"},model:{value:s.applicationStore.autoSubscribeAgents,callback:function(t){s.$set(s.applicationStore,"autoSubscribeAgents",t)},expression:"applicationStore.autoSubscribeAgents"}})],1),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(2),e(r,{attrs:{color:"error"},on:{click:s.clearState}},[s._v(" Clear ")])],1),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(3),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.profiles.loading,color:"primary"},on:{click:s.reloadProfiles}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.profiles.loading,color:"error"},on:{click:s.resetProfiles}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(4),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.modules.loading,color:"primary"},on:{click:s.reloadModules}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.modules.loading,color:"error"},on:{click:s.resetModules}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(5),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.bypasses.loading,color:"primary"},on:{click:s.reloadBypasses}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.bypasses.loading,color:"error"},on:{click:s.resetBypasses}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(6),e(r,{attrs:{loading:s.plugins.loading,color:"error"},on:{click:s.reloadPlugins}},[s._v(" Reload ")])],1)],1)],1)},M=[function(){var a=this,s=a._self._c;return s("div",{staticClass:"headers pl-0 mt-2"},[s("h4",[a._v("Update Password")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Auto-Subscribe to Agents")]),s("span",[a._v(" This will automatically subscribe to agent notifications."),s("br"),a._v(" Turning this off will require you to manually subscribe to agents. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Clear Application State")]),s("span",[a._v(" This will clear UI preferences and other localstorage data.")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Malleable Profiles")]),s("span",[a._v(" Reload will check for and load new profile configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Modules")]),s("span",[a._v(" Reload will check for and load new module configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Bypasses")]),s("span",[a._v(" Reload will check for and load new bypass configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Plugins")]),s("span",[a._v("Reload will check for and load new plugins.")])])}],A=$(x,R,M,!1,null,null,null,null);const T=A.exports;export{T as default}; +import{_ as d}from"./ListPageTop-78cbc2f3.js";import{r as u,b as p}from"./bypass-api-6126dc83.js";import{r as f,a as m}from"./module-api-04d2f26d.js";import{r as h,b as _}from"./malleable-api-09135b63.js";import{a1 as g,u as i,C as v,as as w,br as b,bs as y,bt as k,n as $,bu as C,at as n,a2 as P,a as r,i as o,a7 as S,j as c}from"./index-e409ba63.js";import{_ as l}from"./VSwitch-3f004360.js";import"./VTooltip-7c0b187f.js";import"./VItemGroup-3637266a.js";const x={components:{ListPageTop:d},data(){return{password:{form:{},loading:!1},rules:{password:[a=>!!a||"Password is required",a=>!!a&&a.length>5||"Password must be larger than 5 characters"],confirmPassword:[a=>!!a||"Confirmation is required",a=>a===this.password.form.password||"Password must match"]},modules:{loading:!1},bypasses:{loading:!1},profiles:{loading:!1},plugins:{loading:!1},showPassword:!1,showConfirm:!1,valid:!1,breads:[{text:"Settings",disabled:!0,href:"/settings"}],avatarUrl:""}},computed:{...g(i,["user"]),applicationStore(){return i()},agentStore(){return v()},userId(){return this.user.id}},watch:{"user.avatar":{async handler(){this.user.avatar&&(this.avatarUrl=await this.getDownloadUrl(this.user.avatar))},immediate:!0}},methods:{async getDownloadUrl(a){return await w(a.id)},handleFileImport(){this.isSelecting=!0,window.addEventListener("focus",()=>{this.isSelecting=!1},{once:!0}),this.$refs.uploader.click()},async onFileChanged(a){const s=a.target.files[0],e=new FormData;e.append("file",s),await b(this.userId,e),this.applicationStore.refreshMe(),this.$snack.success("Upload complete")},async logout(){await this.$root.$confirm("","Are you sure you want to logout?",{color:"green"})&&this.applicationStore.logout()},clearState(){this.applicationStore.clear(),this.agentStore.clear()},submit(){this.password.loading||!this.$refs.form.validate()||(this.password.loading=!0,y(this.user.id,this.password.form.password).then(()=>{this.$snack.success("Password updated"),this.password.form={},this.$refs.form.resetValidation()}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.password.loading=!1}))},resetProfiles(){this.profiles.loading=!0,h().then(()=>{this.$snack.success("Profiles reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadProfiles(){this.profiles.loading=!0,_().then(()=>{this.$snack.success("Profiles reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadModules(){this.modules.loading=!0,f().then(()=>{this.$snack.success("Module reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},resetModules(){this.modules.loading=!0,m().then(()=>{this.$snack.success("Module reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},reloadBypasses(){this.bypasses.loading=!0,u().then(()=>{this.$snack.success("Bypass reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},resetBypasses(){this.bypasses.loading=!0,p().then(()=>{this.$snack.success("Bypass reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},reloadPlugins(){this.plugins.loading=!0,k().then(()=>{this.$snack.success("Plugin reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.plugins.loading=!1})}}};var R=function(){var s=this,e=s._self._c;return e("div",[e(d,{attrs:{breads:s.breads}}),e("div",{staticClass:"page"},[e("div",{staticClass:"first-part point",staticStyle:{display:"flex","flex-direction":"row","align-items":"center"}},[e(C,{staticClass:"ma-2",on:{click:s.handleFileImport}},[s.user.avatar?e(n,{attrs:{src:s.avatarUrl}}):e(n,{attrs:{src:`https://ui-avatars.com/api/?background=random&name=${s.user.username}`}})],1),e("input",{ref:"uploader",staticClass:"d-none",attrs:{type:"file","aria-label":"uploader"},on:{change:s.onFileChanged}}),e("span",{staticClass:"ma-2"},[s._v(s._s(s.user.username))]),e(P),e(r,{attrs:{color:"primary",text:""},on:{click:s.logout}},[s._v(" Logout ")])],1),e(o),e("div",{staticStyle:{display:"flex","flex-direction":"row"}},[e(l,{attrs:{label:"Dark Mode"},model:{value:s.applicationStore.darkMode,callback:function(t){s.$set(s.applicationStore,"darkMode",t)},expression:"applicationStore.darkMode"}}),e(l,{staticClass:"pl-8",attrs:{label:"Chat Widget"},model:{value:s.applicationStore.chatWidget,callback:function(t){s.$set(s.applicationStore,"chatWidget",t)},expression:"applicationStore.chatWidget"}})],1),e(o),s._m(0),e(S,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(t){return t.preventDefault(),s.submit.apply(null,arguments)}},model:{value:s.valid,callback:function(t){s.valid=t},expression:"valid"}},[e(c,{attrs:{type:s.showPassword?"text":"password","append-icon":s.showPassword?"fa-eye":"fa-eye-slash",rules:s.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showPassword=!s.showPassword}},model:{value:s.password.form.password,callback:function(t){s.$set(s.password.form,"password",t)},expression:"password.form.password"}}),e(c,{attrs:{type:s.showConfirm?"text":"password","append-icon":s.showConfirm?"fa-eye":"fa-eye-slash",rules:s.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showConfirm=!s.showConfirm}},model:{value:s.password.form.confirmPassword,callback:function(t){s.$set(s.password.form,"confirmPassword",t)},expression:"password.form.confirmPassword"}}),e(r,{staticClass:"mt-4 mb-4 primary",attrs:{type:"submit",loading:s.password.loading}},[s._v(" submit ")])],1),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(1),e(l,{attrs:{color:"primary"},model:{value:s.applicationStore.autoSubscribeAgents,callback:function(t){s.$set(s.applicationStore,"autoSubscribeAgents",t)},expression:"applicationStore.autoSubscribeAgents"}})],1),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(2),e(r,{attrs:{color:"error"},on:{click:s.clearState}},[s._v(" Clear ")])],1),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(3),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.profiles.loading,color:"primary"},on:{click:s.reloadProfiles}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.profiles.loading,color:"error"},on:{click:s.resetProfiles}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(4),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.modules.loading,color:"primary"},on:{click:s.reloadModules}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.modules.loading,color:"error"},on:{click:s.resetModules}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(5),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.bypasses.loading,color:"primary"},on:{click:s.reloadBypasses}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.bypasses.loading,color:"error"},on:{click:s.resetBypasses}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(6),e(r,{attrs:{loading:s.plugins.loading,color:"error"},on:{click:s.reloadPlugins}},[s._v(" Reload ")])],1)],1)],1)},M=[function(){var a=this,s=a._self._c;return s("div",{staticClass:"headers pl-0 mt-2"},[s("h4",[a._v("Update Password")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Auto-Subscribe to Agents")]),s("span",[a._v(" This will automatically subscribe to agent notifications."),s("br"),a._v(" Turning this off will require you to manually subscribe to agents. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Clear Application State")]),s("span",[a._v(" This will clear UI preferences and other localstorage data.")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Malleable Profiles")]),s("span",[a._v(" Reload will check for and load new profile configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Modules")]),s("span",[a._v(" Reload will check for and load new module configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Bypasses")]),s("span",[a._v(" Reload will check for and load new bypass configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Plugins")]),s("span",[a._v("Reload will check for and load new plugins.")])])}],A=$(x,R,M,!1,null,null,null,null);const T=A.exports;export{T as default}; diff --git a/dist/assets/StagerEdit-8dcfcf7e.js b/dist/assets/StagerEdit-a930136e.js similarity index 86% rename from dist/assets/StagerEdit-8dcfcf7e.js rename to dist/assets/StagerEdit-a930136e.js index 5088bbb..a8be608 100644 --- a/dist/assets/StagerEdit-8dcfcf7e.js +++ b/dist/assets/StagerEdit-a930136e.js @@ -1 +1 @@ -import{_ as o,a as u}from"./GeneralForm-ad50630d.js";import{_ as n}from"./InfoViewer-a26545d4.js";import{_ as l,b as m,c as i}from"./ErrorStateAlert-44af51cd.js";import{_ as a}from"./TooltipButton-ef876422.js";import{_ as d}from"./EditPageTop-4e0a4ef6.js";import{n as c,w as p,x as g,c as h,j as _}from"./index-e8f29bb9.js";import{C as f,u as y,g as w,a as S,c as $,b}from"./stager-module-494f3496.js";import{_ as T}from"./VSelect-f55906da.js";import"./VSwitch-2cfffd69.js";import"./bypass-module-9d0c5e38.js";import"./bypass-api-80f88682.js";import"./credential-module-512a6f9e.js";import"./malleable-module-cb1f5265.js";import"./malleable-api-d0b35547.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";import"./VExpansionPanelHeader-a9447b85.js";import"./VTooltip-0015e28c.js";const x={name:"StagerEdit",components:{InfoViewer:n,GeneralForm:o,ErrorStateAlert:l,EditPageTop:d,TooltipButton:a},mixins:[f],data(){return{stager:{options:{}},stagerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Listener","Language"],errorState:!1,initialLoad:!1}},computed:{stagerStore(){return y()},stagerTemplateIds(){return this.stagerStore.templateIds},isNew(){return this.$route.name==="stagerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"stagerNew",params:{copy:!0,id:this.id}}:{}},stagerInfo(){if(!this.stagerTemplate)return{};const t=this.stagerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},stagerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.stager.options).forEach(r=>{e[r]={...this.stagerTemplate.options[r]},e[r].value=this.stager.options[r]}),e}const{options:t}=this.stagerTemplate;return t?(this.$route.query.listener&&(t.Listener.value=this.$route.query.listener),t):{}},breads(){return[{text:"Stagers",disabled:!1,to:"/stagers",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/stagers-edit"}]},breadcrumbName(){return this.isCopy?"New":this.stager.name?this.stager.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await w(t).catch(r=>this.$snack.error(`Error: ${r}`));e&&(this.reset=!1,this.stagerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getStager(t)}},mounted(){this.stagerStore.getStagerTemplates(),(!this.isNew||this.isCopy)&&this.getStager(this.$route.params.id),this.$route.query.template&&(this.selectedTemplate=this.$route.query.template)},methods:{submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?S(this.id,{name:this.stager.name,options:this.form}).then(()=>{this.$snack.success("Stager updated"),this.loading=!1}).then(()=>{this.getStager(this.id)}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):$(this.selectedTemplate,this.stager.name||this.randomName(),this.form).then(({id:t})=>{this.$snack.success("Stager created"),this.loading=!1,this.$router.push({name:"stagerEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteStager(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete stager ${this.form.StarkillerName}?`,{color:"red"}))try{await this.stagerStore.deleteStager(this.id),this.$router.push({name:"stagers"})}catch(t){this.$snack.error(`Error: ${t}`)}},getStager(t){b(t).then(e=>{this.stager=e,this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},randomName(){return(Math.random()+1).toString(36).substring(7)},isDownload(t){return t.downloads&&t.downloads.length>0},isOneLiner(t){return t.one_liner},async copy(t){const e=t.downloads.length-1;return this.copyStager(await p(t.downloads[e].id))},async download(t){const e=t.downloads.length-1;return g(t.downloads[e].id)}}};var v=function(){var e=this,r=e._self._c;return r("div",[r(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteStager},scopedSlots:e._u([{key:"extra-stuff",fn:function(){return[e.id>0&&e.initialLoad&&e.isDownload(e.stager)?r(a,{attrs:{color:"success",icon:"fa-download",text:"Download"},on:{click:function(s){return e.download(e.stager)}}}):e._e(),e.id>0&&e.initialLoad&&e.isOneLiner(e.stager)?r(a,{attrs:{color:"success",icon:"fa-paperclip",text:"Copy To Clipboard"},on:{click:function(s){return e.copy(e.stager)}}}):e._e()]},proxy:!0}])}),r("div",{staticClass:"headers"},[r("h3",[e._v(e._s(e.mode)+" Stager")])]),e.errorState?r(l,{attrs:{"resource-id":e.id,"resource-type":"stager"}}):r(h,{staticStyle:{padding:"10px"}},[r(n,{staticClass:"info-viewer",attrs:{info:e.stagerInfo}}),r(u,{attrs:{items:e.stagerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(s){e.selectedTemplate=s},expression:"selectedTemplate"}}),e.selectedTemplate?r(m,[r(i,{attrs:{cols:"6"}},[r(_,{attrs:{outlined:"",dense:"",label:"Name",readonly:!e.canEdit},model:{value:e.stager.name,callback:function(s){e.$set(e.stager,"name",s)},expression:"stager.name"}})],1),r(i,{attrs:{cols:"6"}},[r(T,[e._v(" A name for the stager. Leave blank for an autogenerated name. ")])],1)],1):e._e(),e.reset?r(o,{ref:"generalform",attrs:{options:e.stagerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(s){e.form=s},expression:"form"}}):e._e()],1)],1)},L=[],k=c(x,v,L,!1,null,null,null,null);const J=k.exports;export{J as default}; +import{_ as o,a as u}from"./GeneralForm-e1472145.js";import{_ as n}from"./InfoViewer-98b37678.js";import{_ as l,b as m,c as i}from"./ErrorStateAlert-3d45e0aa.js";import{_ as a}from"./TooltipButton-f53c45a7.js";import{_ as d}from"./EditPageTop-0ed1194e.js";import{n as c,w as p,x as g,c as h,j as _}from"./index-e409ba63.js";import{C as f,u as y,g as w,a as S,c as $,b}from"./stager-module-0df99767.js";import{_ as T}from"./VSelect-22e7980f.js";import"./VSwitch-3f004360.js";import"./bypass-module-4e86a448.js";import"./bypass-api-6126dc83.js";import"./credential-module-93372e4e.js";import"./malleable-module-2a911c2d.js";import"./malleable-api-09135b63.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";import"./VExpansionPanelHeader-69136628.js";import"./VTooltip-7c0b187f.js";const x={name:"StagerEdit",components:{InfoViewer:n,GeneralForm:o,ErrorStateAlert:l,EditPageTop:d,TooltipButton:a},mixins:[f],data(){return{stager:{options:{}},stagerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Listener","Language"],errorState:!1,initialLoad:!1}},computed:{stagerStore(){return y()},stagerTemplateIds(){return this.stagerStore.templateIds},isNew(){return this.$route.name==="stagerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"stagerNew",params:{copy:!0,id:this.id}}:{}},stagerInfo(){if(!this.stagerTemplate)return{};const t=this.stagerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},stagerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.stager.options).forEach(r=>{e[r]={...this.stagerTemplate.options[r]},e[r].value=this.stager.options[r]}),e}const{options:t}=this.stagerTemplate;return t?(this.$route.query.listener&&(t.Listener.value=this.$route.query.listener),t):{}},breads(){return[{text:"Stagers",disabled:!1,to:"/stagers",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/stagers-edit"}]},breadcrumbName(){return this.isCopy?"New":this.stager.name?this.stager.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await w(t).catch(r=>this.$snack.error(`Error: ${r}`));e&&(this.reset=!1,this.stagerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getStager(t)}},mounted(){this.stagerStore.getStagerTemplates(),(!this.isNew||this.isCopy)&&this.getStager(this.$route.params.id),this.$route.query.template&&(this.selectedTemplate=this.$route.query.template)},methods:{submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?S(this.id,{name:this.stager.name,options:this.form}).then(()=>{this.$snack.success("Stager updated"),this.loading=!1}).then(()=>{this.getStager(this.id)}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):$(this.selectedTemplate,this.stager.name||this.randomName(),this.form).then(({id:t})=>{this.$snack.success("Stager created"),this.loading=!1,this.$router.push({name:"stagerEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteStager(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete stager ${this.form.StarkillerName}?`,{color:"red"}))try{await this.stagerStore.deleteStager(this.id),this.$router.push({name:"stagers"})}catch(t){this.$snack.error(`Error: ${t}`)}},getStager(t){b(t).then(e=>{this.stager=e,this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},randomName(){return(Math.random()+1).toString(36).substring(7)},isDownload(t){return t.downloads&&t.downloads.length>0},isOneLiner(t){return t.one_liner},async copy(t){const e=t.downloads.length-1;return this.copyStager(await p(t.downloads[e].id))},async download(t){const e=t.downloads.length-1;return g(t.downloads[e].id)}}};var v=function(){var e=this,r=e._self._c;return r("div",[r(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteStager},scopedSlots:e._u([{key:"extra-stuff",fn:function(){return[e.id>0&&e.initialLoad&&e.isDownload(e.stager)?r(a,{attrs:{color:"success",icon:"fa-download",text:"Download"},on:{click:function(s){return e.download(e.stager)}}}):e._e(),e.id>0&&e.initialLoad&&e.isOneLiner(e.stager)?r(a,{attrs:{color:"success",icon:"fa-paperclip",text:"Copy To Clipboard"},on:{click:function(s){return e.copy(e.stager)}}}):e._e()]},proxy:!0}])}),r("div",{staticClass:"headers"},[r("h3",[e._v(e._s(e.mode)+" Stager")])]),e.errorState?r(l,{attrs:{"resource-id":e.id,"resource-type":"stager"}}):r(h,{staticStyle:{padding:"10px"}},[r(n,{staticClass:"info-viewer",attrs:{info:e.stagerInfo}}),r(u,{attrs:{items:e.stagerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(s){e.selectedTemplate=s},expression:"selectedTemplate"}}),e.selectedTemplate?r(m,[r(i,{attrs:{cols:"6"}},[r(_,{attrs:{outlined:"",dense:"",label:"Name",readonly:!e.canEdit},model:{value:e.stager.name,callback:function(s){e.$set(e.stager,"name",s)},expression:"stager.name"}})],1),r(i,{attrs:{cols:"6"}},[r(T,[e._v(" A name for the stager. Leave blank for an autogenerated name. ")])],1)],1):e._e(),e.reset?r(o,{ref:"generalform",attrs:{options:e.stagerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(s){e.form=s},expression:"form"}}):e._e()],1)],1)},L=[],k=c(x,v,L,!1,null,null,null,null);const J=k.exports;export{J as default}; diff --git a/dist/assets/Stagers-85d35917.js b/dist/assets/Stagers-2ac7ec4a.js similarity index 90% rename from dist/assets/Stagers-85d35917.js rename to dist/assets/Stagers-2ac7ec4a.js index dffee56..24d53cc 100644 --- a/dist/assets/Stagers-85d35917.js +++ b/dist/assets/Stagers-2ac7ec4a.js @@ -1 +1 @@ -import{_ as i}from"./DateTimeDisplay-e5665873.js";import{h as u}from"./moment-fbc5633a.js";import{D as c}from"./download-stager-ae353708.js";import{C as d,u as _}from"./stager-module-494f3496.js";import{n as p,u as g,w as h,x as v,k as w,a as x,b as n,d as k,e as o,f as l,i as b,y as $}from"./index-e8f29bb9.js";import{_ as D}from"./VDataTable-f3602581.js";import{_ as m}from"./AdvancedTable-147b64b8.js";import{_ as f}from"./ListPageTop-5130be67.js";import{_ as T}from"./VSwitch-2cfffd69.js";import"./VTooltip-0015e28c.js";import"./VSelect-f55906da.js";import"./VExpansionPanels-26c41551.js";import"./VItemGroup-e39c2c83.js";const L={name:"StagersTable",components:{DateTimeDisplay:i},mixins:[c,d],props:{onlyMyStagers:{type:Boolean,default:!1},input:{type:Array,default:()=>[]}},data(){return{moment:u,headers:[{text:"Name",value:"name"},{text:"Listener",value:"options.Listener"},{text:"Type",value:"template"},{text:"Language",value:"options.Language"},{text:"Created At",value:"created_at"},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{stagerStore(){return _()},applicationStore(){return g()},stagers(){return this.stagerStore.stagers},stagersStatus(){return this.stagerStore.status},userId(){return this.applicationStore.user.id},filteredStagers(){return this.onlyMyStagers?this.stagers.filter(s=>s.user_id===this.userId):this.stagers}},watch:{selected(s){this.$emit("input",s)}},mounted(){this.getStagers()},methods:{isDownload(s){return s.downloads&&s.downloads.length>0},isOneLiner(s){return s.one_liner},async copy(s){const e=s.downloads.length-1;return this.copyStager(await h(s.downloads[e].id))},async download(s){const e=s.downloads.length-1;return v(s.downloads[e].id)},async deleteStager(s){this.$emit("delete-stager",s)},getStagers(){this.stagerStore.getStagers()}}};var C=function(){var e=this,t=e._self._c;return t("div",[t(D,{attrs:{headers:e.headers,items:e.filteredStagers,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,loading:e.stagersStatus==="loading","item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:r}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"stagerEdit",params:{id:r.id}}}},[e._v(" "+e._s(r.name)+" ")])]}},{key:"item.options.Listener",fn:function({item:r}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:r.id}}}},[e._v(" "+e._s(r.options.Listener)+" ")])]}},{key:"item.created_at",fn:function({item:r}){return[t(i,{attrs:{timestamp:r.created_at}})]}},{key:"item.actions",fn:function({item:r}){return[t(w,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:S}){return[t(x,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",S,!1),a),[t(n,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(k,{staticClass:"ml-2 mr-2"},[e.isDownload(r)?t(o,{key:"download",attrs:{link:""},on:{click:function(a){return e.download(r)}}},[t(l,[t(n,[e._v("fa-download")]),e._v(" Download ")],1)],1):e._e(),e.isOneLiner(r)?t(o,{key:"clipboard",attrs:{link:""},on:{click:function(a){return e.copy(r)}}},[t(l,[t(n,[e._v("fa-paperclip")]),e._v(" Copy to Clipboard ")],1)],1):e._e(),t(o,{key:"copy",attrs:{to:{name:"stagerNew",params:{copy:!0,id:r.id}},link:""}},[t(l,[t(n,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(o,{key:"delete",attrs:{link:""},on:{click:function(a){return e.deleteStager(r)}}},[t(l,[t(n,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(r){e.selected=r},expression:"selected"}})],1)},M=[],A=p(L,C,M,!1,null,null,null,null);const y=A.exports;const O={name:"Stagers",components:{AdvancedTable:m,ListPageTop:f,StagersTable:y},mixins:[c,d],data(){return{moment:u,breads:[{text:"Stagers",disabled:!0,href:"/stagers"}],selected:[]}},computed:{app(){return $},stagerStore(){return _()},applicationStore(){return g()},showDelete(){return this.selected.length>0}},methods:{create(){this.$router.push({name:"stagerNew"})},async deleteStager(s){await this.$root.$confirm("Delete","Are you sure you want to delete this stager?",{color:"red"})&&await this.stagerStore.deleteStager(s.id)},async deleteStagers(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} stagers?`,{color:"red"})&&(this.selected.forEach(s=>{this.stagerStore.deleteStager(s.id)}),this.selected=[])},getStagers(){this.$refs.stagersTable.getStagers()}}};var I=function(){var e=this,t=e._self._c;return t("div",[t(f,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,refresh:e.getStagers,delete:e.deleteStagers}}),t(m,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(T,{attrs:{label:"Only My Stagers"},model:{value:e.applicationStore.filterOnlyMyStagers,callback:function(r){e.$set(e.applicationStore,"filterOnlyMyStagers",r)},expression:"applicationStore.filterOnlyMyStagers"}})]},proxy:!0},{key:"table",fn:function(){return[t(y,{ref:"stagersTable",attrs:{"only-my-stagers":e.applicationStore.filterOnlyMyStagers},on:{"delete-stager":e.deleteStager},model:{value:e.selected,callback:function(r){e.selected=r},expression:"selected"}})]},proxy:!0}])})],1)},E=[],N=p(O,I,E,!1,null,null,null,null);const U=N.exports;export{U as default}; +import{_ as i}from"./DateTimeDisplay-951c60c5.js";import{h as u}from"./moment-fbc5633a.js";import{D as c}from"./download-stager-ae353708.js";import{C as d,u as _}from"./stager-module-0df99767.js";import{n as p,u as g,w as h,x as v,k as w,a as x,b as n,d as k,e as o,f as l,i as b,y as $}from"./index-e409ba63.js";import{_ as D}from"./VDataTable-dab2ebf1.js";import{_ as m}from"./AdvancedTable-e51651be.js";import{_ as f}from"./ListPageTop-78cbc2f3.js";import{_ as T}from"./VSwitch-3f004360.js";import"./VTooltip-7c0b187f.js";import"./VSelect-22e7980f.js";import"./VExpansionPanels-cacfd68a.js";import"./VItemGroup-3637266a.js";const L={name:"StagersTable",components:{DateTimeDisplay:i},mixins:[c,d],props:{onlyMyStagers:{type:Boolean,default:!1},input:{type:Array,default:()=>[]}},data(){return{moment:u,headers:[{text:"Name",value:"name"},{text:"Listener",value:"options.Listener"},{text:"Type",value:"template"},{text:"Language",value:"options.Language"},{text:"Created At",value:"created_at"},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{stagerStore(){return _()},applicationStore(){return g()},stagers(){return this.stagerStore.stagers},stagersStatus(){return this.stagerStore.status},userId(){return this.applicationStore.user.id},filteredStagers(){return this.onlyMyStagers?this.stagers.filter(s=>s.user_id===this.userId):this.stagers}},watch:{selected(s){this.$emit("input",s)}},mounted(){this.getStagers()},methods:{isDownload(s){return s.downloads&&s.downloads.length>0},isOneLiner(s){return s.one_liner},async copy(s){const e=s.downloads.length-1;return this.copyStager(await h(s.downloads[e].id))},async download(s){const e=s.downloads.length-1;return v(s.downloads[e].id)},async deleteStager(s){this.$emit("delete-stager",s)},getStagers(){this.stagerStore.getStagers()}}};var C=function(){var e=this,t=e._self._c;return t("div",[t(D,{attrs:{headers:e.headers,items:e.filteredStagers,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,loading:e.stagersStatus==="loading","item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:r}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"stagerEdit",params:{id:r.id}}}},[e._v(" "+e._s(r.name)+" ")])]}},{key:"item.options.Listener",fn:function({item:r}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:r.id}}}},[e._v(" "+e._s(r.options.Listener)+" ")])]}},{key:"item.created_at",fn:function({item:r}){return[t(i,{attrs:{timestamp:r.created_at}})]}},{key:"item.actions",fn:function({item:r}){return[t(w,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:S}){return[t(x,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",S,!1),a),[t(n,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(k,{staticClass:"ml-2 mr-2"},[e.isDownload(r)?t(o,{key:"download",attrs:{link:""},on:{click:function(a){return e.download(r)}}},[t(l,[t(n,[e._v("fa-download")]),e._v(" Download ")],1)],1):e._e(),e.isOneLiner(r)?t(o,{key:"clipboard",attrs:{link:""},on:{click:function(a){return e.copy(r)}}},[t(l,[t(n,[e._v("fa-paperclip")]),e._v(" Copy to Clipboard ")],1)],1):e._e(),t(o,{key:"copy",attrs:{to:{name:"stagerNew",params:{copy:!0,id:r.id}},link:""}},[t(l,[t(n,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(b,{staticClass:"pb-4"}),t(o,{key:"delete",attrs:{link:""},on:{click:function(a){return e.deleteStager(r)}}},[t(l,[t(n,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(r){e.selected=r},expression:"selected"}})],1)},M=[],A=p(L,C,M,!1,null,null,null,null);const y=A.exports;const O={name:"Stagers",components:{AdvancedTable:m,ListPageTop:f,StagersTable:y},mixins:[c,d],data(){return{moment:u,breads:[{text:"Stagers",disabled:!0,href:"/stagers"}],selected:[]}},computed:{app(){return $},stagerStore(){return _()},applicationStore(){return g()},showDelete(){return this.selected.length>0}},methods:{create(){this.$router.push({name:"stagerNew"})},async deleteStager(s){await this.$root.$confirm("Delete","Are you sure you want to delete this stager?",{color:"red"})&&await this.stagerStore.deleteStager(s.id)},async deleteStagers(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} stagers?`,{color:"red"})&&(this.selected.forEach(s=>{this.stagerStore.deleteStager(s.id)}),this.selected=[])},getStagers(){this.$refs.stagersTable.getStagers()}}};var I=function(){var e=this,t=e._self._c;return t("div",[t(f,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,refresh:e.getStagers,delete:e.deleteStagers}}),t(m,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(T,{attrs:{label:"Only My Stagers"},model:{value:e.applicationStore.filterOnlyMyStagers,callback:function(r){e.$set(e.applicationStore,"filterOnlyMyStagers",r)},expression:"applicationStore.filterOnlyMyStagers"}})]},proxy:!0},{key:"table",fn:function(){return[t(y,{ref:"stagersTable",attrs:{"only-my-stagers":e.applicationStore.filterOnlyMyStagers},on:{"delete-stager":e.deleteStager},model:{value:e.selected,callback:function(r){e.selected=r},expression:"selected"}})]},proxy:!0}])})],1)},E=[],N=p(O,I,E,!1,null,null,null,null);const U=N.exports;export{U as default}; diff --git a/dist/assets/TagViewer-357f9253.js b/dist/assets/TagViewer-81c3b950.js similarity index 99% rename from dist/assets/TagViewer-357f9253.js rename to dist/assets/TagViewer-81c3b950.js index a886b73..fecb896 100644 --- a/dist/assets/TagViewer-357f9253.js +++ b/dist/assets/TagViewer-81c3b950.js @@ -1 +1 @@ -import{J as w,b8 as A,b9 as F,ba as j,U as W,P as G,R as o,bb as U,bc as Y,a0 as $,bd as f,aH as q,be as N,bf as y,bg as S,bh as K,bi as X,bj as x,bk as J,bl as Q,I as V,bm as Z,bn as tt,bo as B,a as _,b as p,T as P,bp as D,bq as et,Q as it,aP as st,n as H,k as at,c as nt,a7 as rt,aa as lt,j as L,ab as ot,a2 as ht}from"./index-e8f29bb9.js";import{a as ct}from"./VSelect-f55906da.js";const ut=w(F,A).extend({name:"v-slider",directives:{ClickOutside:j},mixins:[A],props:{disabled:Boolean,inverseLabel:Boolean,max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:1},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:t=>typeof t=="boolean"||t==="always"},thumbSize:{type:[Number,String],default:32},tickLabels:{type:Array,default:()=>[]},ticks:{type:[Boolean,String],default:!1,validator:t=>typeof t=="boolean"||t==="always"},tickSize:{type:[Number,String],default:2},trackColor:String,trackFillColor:String,value:[Number,String],vertical:Boolean},data:()=>({app:null,oldValue:null,thumbPressed:!1,mouseTimeout:-1,isFocused:!1,isActive:!1,noClick:!1,startOffset:0}),computed:{classes(){return{...F.options.computed.classes.call(this),"v-input__slider":!0,"v-input__slider--vertical":this.vertical,"v-input__slider--inverse-label":this.inverseLabel}},internalValue:{get(){return this.lazyValue},set(t){t=isNaN(t)?this.minValue:t;const e=this.roundValue(Math.min(Math.max(t,this.minValue),this.maxValue));e!==this.lazyValue&&(this.lazyValue=e,this.$emit("input",e))}},trackTransition(){return this.thumbPressed?this.showTicks||this.stepNumeric?"0.1s cubic-bezier(0.25, 0.8, 0.5, 1)":"none":""},minValue(){return parseFloat(this.min)},maxValue(){return parseFloat(this.max)},stepNumeric(){return this.step>0?parseFloat(this.step):0},inputWidth(){const t=(this.roundValue(this.internalValue)-this.minValue)/(this.maxValue-this.minValue)*100;return isNaN(t)?0:t},trackFillStyles(){const t=this.vertical?"bottom":"left",e=this.vertical?"top":"right",i=this.vertical?"height":"width",s=this.$vuetify.rtl?"auto":"0",n=this.$vuetify.rtl?"0":"auto",a=this.isDisabled?`calc(${this.inputWidth}% - 10px)`:`${this.inputWidth}%`;return{transition:this.trackTransition,[t]:s,[e]:n,[i]:a}},trackStyles(){const t=this.vertical?this.$vuetify.rtl?"bottom":"top":this.$vuetify.rtl?"left":"right",e=this.vertical?"height":"width",i="0px",s=this.isDisabled?`calc(${100-this.inputWidth}% - 10px)`:`calc(${100-this.inputWidth}%)`;return{transition:this.trackTransition,[t]:i,[e]:s}},showTicks(){return this.tickLabels.length>0||!!(!this.isDisabled&&this.stepNumeric&&this.ticks)},numTicks(){return Math.ceil((this.maxValue-this.minValue)/this.stepNumeric)},showThumbLabel(){return!this.isDisabled&&!!(this.thumbLabel||this.$scopedSlots["thumb-label"])},computedTrackColor(){if(!this.isDisabled)return this.trackColor?this.trackColor:this.isDark?this.validationState:this.validationState||"primary lighten-3"},computedTrackFillColor(){if(!this.isDisabled)return this.trackFillColor?this.trackFillColor:this.validationState||this.computedColor},computedThumbColor(){return this.thumbColor?this.thumbColor:this.validationState||this.computedColor}},watch:{min(t){const e=parseFloat(t);e>this.internalValue&&this.$emit("input",e)},max(t){const e=parseFloat(t);e{const l=[];this.tickLabels[a]&&l.push(this.$createElement("div",{staticClass:"v-slider__tick-label"},this.tickLabels[a]));const r=a*(100/this.numTicks),c=this.$vuetify.rtl?100-this.inputWidth0}},n)},genThumbContainer(t,e,i,s,n,a,l="thumb"){const r=[this.genThumb()],c=this.genThumbLabelContent(t);return this.showThumbLabel&&r.push(this.genThumbLabel(c)),this.$createElement("div",this.setTextColor(this.computedThumbColor,{ref:l,key:l,staticClass:"v-slider__thumb-container",class:{"v-slider__thumb-container--active":i,"v-slider__thumb-container--focused":s,"v-slider__thumb-container--show-label":this.showThumbLabel},style:this.getThumbContainerStyles(e),attrs:{role:"slider",tabindex:this.isDisabled?-1:this.$attrs.tabindex?this.$attrs.tabindex:0,"aria-label":this.$attrs["aria-label"]||this.label,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.internalValue,"aria-readonly":String(this.isReadonly),"aria-orientation":this.vertical?"vertical":"horizontal"},on:{focus:n,blur:a,keydown:this.onKeyDown}}),r)},genThumbLabelContent(t){return this.$scopedSlots["thumb-label"]?this.$scopedSlots["thumb-label"]({value:t}):[this.$createElement("span",[String(t)])]},genThumbLabel(t){const e=o(this.thumbSize),i=this.vertical?`translateY(20%) translateY(${Number(this.thumbSize)/3-1}px) translateX(55%) rotate(135deg)`:"translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";return this.$createElement(U,{props:{origin:"bottom center"}},[this.$createElement("div",{staticClass:"v-slider__thumb-label-container",directives:[{name:"show",value:this.isFocused||this.isActive||this.thumbLabel==="always"}]},[this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb-label",style:{height:e,width:e,transform:i}}),[this.$createElement("div",t)])])])},genThumb(){return this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb"}))},getThumbContainerStyles(t){const e=this.vertical?"top":"left";let i=this.$vuetify.rtl?100-t:t;return i=this.vertical?100-i:i,{transition:this.trackTransition,[e]:`${i}%`}},onSliderMouseDown(t){var e;if(t.preventDefault(),this.oldValue=this.internalValue,this.isActive=!0,!((e=t.target)===null||e===void 0)&&e.matches(".v-slider__thumb-container, .v-slider__thumb-container *")){this.thumbPressed=!0;const a=t.target.getBoundingClientRect(),l="touches"in t?t.touches[0]:t;this.startOffset=this.vertical?l.clientY-(a.top+a.height/2):l.clientX-(a.left+a.width/2)}else this.startOffset=0,window.clearTimeout(this.mouseTimeout),this.mouseTimeout=window.setTimeout(()=>{this.thumbPressed=!0},300);const i=f?{passive:!0,capture:!0}:!0,s=f?{passive:!0}:!1,n="touches"in t;this.onMouseMove(t),this.app.addEventListener(n?"touchmove":"mousemove",this.onMouseMove,s),Y(this.app,n?"touchend":"mouseup",this.onSliderMouseUp,i),this.$emit("start",this.internalValue)},onSliderMouseUp(t){t.stopPropagation(),window.clearTimeout(this.mouseTimeout),this.thumbPressed=!1;const e=f?{passive:!0}:!1;this.app.removeEventListener("touchmove",this.onMouseMove,e),this.app.removeEventListener("mousemove",this.onMouseMove,e),this.$emit("mouseup",t),this.$emit("end",this.internalValue),$(this.oldValue,this.internalValue)||(this.$emit("change",this.internalValue),this.noClick=!0),this.isActive=!1},onMouseMove(t){t.type==="mousemove"&&(this.thumbPressed=!0),this.internalValue=this.parseMouseMove(t)},onKeyDown(t){if(!this.isInteractive)return;const e=this.parseKeyDown(t,this.internalValue);e==null||ethis.maxValue||(this.internalValue=e,this.$emit("change",e))},onSliderClick(t){if(this.noClick){this.noClick=!1;return}this.$refs.thumb.focus(),this.onMouseMove(t),this.$emit("change",this.internalValue)},onBlur(t){this.isFocused=!1,this.$emit("blur",t)},onFocus(t){this.isFocused=!0,this.$emit("focus",t)},parseMouseMove(t){const e=this.vertical?"top":"left",i=this.vertical?"height":"width",s=this.vertical?"clientY":"clientX",{[e]:n,[i]:a}=this.$refs.track.getBoundingClientRect(),l="touches"in t?t.touches[0][s]:t[s];let r=Math.min(Math.max((l-n-this.startOffset)/a,0),1)||0;return this.vertical&&(r=1-r),this.$vuetify.rtl&&(r=1-r),parseFloat(this.min)+r*(this.maxValue-this.minValue)},parseKeyDown(t,e){if(!this.isInteractive)return;const{pageup:i,pagedown:s,end:n,home:a,left:l,right:r,down:c,up:d}=q;if(![i,s,n,a,l,r,c,d].includes(t.keyCode))return;t.preventDefault();const v=this.stepNumeric||1,M=(this.maxValue-this.minValue)/v;if([l,r,c,d].includes(t.keyCode)){const I=(this.$vuetify.rtl?[l,d]:[r,d]).includes(t.keyCode)?1:-1,z=t.shiftKey?3:t.ctrlKey?2:1;e=e+I*v*z}else if(t.keyCode===a)e=this.minValue;else if(t.keyCode===n)e=this.maxValue;else{const E=t.keyCode===s?1:-1;e=e-E*v*(M>100?M/10:10)}return e},roundValue(t){if(!this.stepNumeric)return t;const e=this.step.toString().trim(),i=e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0,s=this.minValue%this.stepNumeric,n=Math.round((t-s)/this.stepNumeric)*this.stepNumeric+s;return parseFloat(Math.min(n,this.maxValue).toFixed(i))}}});function m(t){t={...t};const e=N(t),i=y(t),s=S(t);return{alpha:t.a,hex:e.substr(0,7),hexa:e,hsla:i,hsva:t,hue:t.h,rgba:s}}function O(t){const e=J(t),i=N(e),s=S(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:t,hsva:e,hue:e.h,rgba:s}}function u(t){const e=K(t),i=X(t),s=y(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:s,hsva:e,hue:e.h,rgba:t}}function g(t){const e=Q(t),i=y(e),s=S(e);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:i,hsva:e,hue:e.h,rgba:s}}function T(t){return g(x(t))}function h(t,e){return e.every(i=>t.hasOwnProperty(i))}function R(t,e){if(!t)return u({r:255,g:0,b:0,a:1});if(typeof t=="string"){if(t==="transparent")return g("#00000000");const i=x(t);return e&&i===e.hexa?e:g(i)}if(typeof t=="object"){if(t.hasOwnProperty("alpha"))return t;const i=t.hasOwnProperty("a")?parseFloat(t.a):1;if(h(t,["r","g","b"]))return e&&t===e.rgba?e:u({...t,a:i});if(h(t,["h","s","l"]))return e&&t===e.hsla?e:O({...t,a:i});if(h(t,["h","s","v"]))return e&&t===e.hsva?e:m({...t,a:i})}return u({r:255,g:0,b:0,a:1})}function b(t,e){if(e){const{a:i,...s}=t;return s}return t}function dt(t,e){if(e==null)return t;if(typeof e=="string")return e.length===7?t.hex:t.hexa;if(typeof e=="object"){const i=typeof e.a=="number"&&e.a===0?!!e.a:!e.a;if(h(e,["r","g","b"]))return b(t.rgba,i);if(h(e,["h","s","l"]))return b(t.hsla,i);if(h(e,["h","s","v"]))return b(t.hsva,i)}return t}function pt(t){return t?typeof t=="string"?t.length>7:typeof t=="object"?h(t,["a"])||h(t,["alpha"]):!1:!1}const mt=V.extend({name:"v-color-picker-preview",props:{color:Object,disabled:Boolean,hideAlpha:Boolean},methods:{genAlpha(){return this.genTrack({staticClass:"v-color-picker__alpha",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.alpha,step:0,min:0,max:1},style:{backgroundImage:this.disabled?void 0:`linear-gradient(to ${this.$vuetify.rtl?"left":"right"}, transparent, ${Z(this.color.rgba)})`},on:{input:t=>this.color.alpha!==t&&this.$emit("update:color",m({...this.color.hsva,a:t}))}})},genSliders(){return this.$createElement("div",{staticClass:"v-color-picker__sliders"},[this.genHue(),!this.hideAlpha&&this.genAlpha()])},genDot(){return this.$createElement("div",{staticClass:"v-color-picker__dot"},[this.$createElement("div",{style:{background:tt(this.color.rgba)}})])},genHue(){return this.genTrack({staticClass:"v-color-picker__hue",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.hue,step:0,min:0,max:360},on:{input:t=>this.color.hue!==t&&this.$emit("update:color",m({...this.color.hsva,h:t}))}})},genTrack(t){return this.$createElement(ut,{class:"v-color-picker__track",...t,props:{disabled:this.disabled,...t.props}})}},render(t){return t("div",{staticClass:"v-color-picker__preview",class:{"v-color-picker__preview--hide-alpha":this.hideAlpha}},[this.genDot(),this.genSliders()])}});const gt=V.extend({name:"v-color-picker-canvas",props:{color:{type:Object,default:()=>u({r:255,g:0,b:0,a:1})},disabled:Boolean,dotSize:{type:[Number,String],default:10},height:{type:[Number,String],default:150},width:{type:[Number,String],default:300}},data(){return{boundingRect:{width:0,height:0,left:0,top:0}}},computed:{dot(){return this.color?{x:this.color.hsva.s*parseInt(this.width,10),y:(1-this.color.hsva.v)*parseInt(this.height,10)}:{x:0,y:0}}},watch:{"color.hue":"updateCanvas"},mounted(){this.updateCanvas()},methods:{emitColor(t,e){const{left:i,top:s,width:n,height:a}=this.boundingRect;this.$emit("update:color",m({h:this.color.hue,s:B(t-i,0,n)/n,v:1-B(e-s,0,a)/a,a:this.color.alpha}))},updateCanvas(){if(!this.color)return;const t=this.$refs.canvas,e=t.getContext("2d");if(!e)return;const i=e.createLinearGradient(0,0,t.width,0);i.addColorStop(0,"hsla(0, 0%, 100%, 1)"),i.addColorStop(1,`hsla(${this.color.hue}, 100%, 50%, 1)`),e.fillStyle=i,e.fillRect(0,0,t.width,t.height);const s=e.createLinearGradient(0,0,0,t.height);s.addColorStop(0,"hsla(0, 0%, 100%, 0)"),s.addColorStop(1,"hsla(0, 0%, 0%, 1)"),e.fillStyle=s,e.fillRect(0,0,t.width,t.height)},handleClick(t){this.disabled||(this.boundingRect=this.$el.getBoundingClientRect(),this.emitColor(t.clientX,t.clientY))},handleMouseDown(t){t.preventDefault(),!this.disabled&&(this.boundingRect=this.$el.getBoundingClientRect(),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp))},handleMouseMove(t){this.disabled||this.emitColor(t.clientX,t.clientY)},handleMouseUp(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)},genCanvas(){return this.$createElement("canvas",{ref:"canvas",attrs:{width:this.width,height:this.height}})},genDot(){const t=parseInt(this.dotSize,10)/2,e=o(this.dot.x-t),i=o(this.dot.y-t);return this.$createElement("div",{staticClass:"v-color-picker__canvas-dot",class:{"v-color-picker__canvas-dot--disabled":this.disabled},style:{width:o(this.dotSize),height:o(this.dotSize),transform:`translate(${e}, ${i})`}})}},render(t){return t("div",{staticClass:"v-color-picker__canvas",style:{width:o(this.width),height:o(this.height)},on:{click:this.handleClick,mousedown:this.handleMouseDown}},[this.genCanvas(),this.genDot()])}});const k={rgba:{inputs:[["r",255,"int"],["g",255,"int"],["b",255,"int"],["a",1,"float"]],from:u},hsla:{inputs:[["h",360,"int"],["s",1,"float"],["l",1,"float"],["a",1,"float"]],from:O},hexa:{from:g}},vt=V.extend({name:"v-color-picker-edit",props:{color:Object,disabled:Boolean,hideAlpha:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)}},data(){return{modes:k,internalMode:this.mode}},computed:{currentMode(){return this.modes[this.internalMode]}},watch:{mode(t){this.internalMode=t}},created(){this.internalMode=this.mode},methods:{getValue(t,e){return e==="float"?Math.round(t*100)/100:e==="int"?Math.round(t):0},parseValue(t,e){return e==="float"?parseFloat(t):e==="int"&&parseInt(t,10)||0},changeMode(){const t=Object.keys(this.modes),e=t.indexOf(this.internalMode),i=t[(e+1)%t.length];this.internalMode=i,this.$emit("update:mode",i)},genInput(t,e,i,s){return this.$createElement("div",{staticClass:"v-color-picker__input"},[this.$createElement("input",{key:t,attrs:e,domProps:{value:i},on:s}),this.$createElement("span",t.toUpperCase())])},genInputs(){if(this.internalMode==="hexa"){const t=this.color.hexa,e=this.hideAlpha&&t.endsWith("FF")?t.substr(0,7):t;return this.genInput("hex",{maxlength:this.hideAlpha?7:9,disabled:this.disabled},e,{change:i=>{const s=i.target;this.$emit("update:color",this.currentMode.from(x(s.value)))}})}else return(this.hideAlpha?this.currentMode.inputs.slice(0,-1):this.currentMode.inputs).map(([e,i,s])=>{const n=this.color[this.internalMode];return this.genInput(e,{type:"number",min:0,max:i,step:s==="float"?"0.01":s==="int"?"1":void 0,disabled:this.disabled},this.getValue(n[e],s),{input:a=>{const l=a.target,r=this.parseValue(l.value||"0",s);this.$emit("update:color",this.currentMode.from(Object.assign({},n,{[e]:r}),this.color.alpha))}})})},genSwitch(){return this.$createElement(_,{props:{small:!0,icon:!0,disabled:this.disabled},on:{click:this.changeMode}},[this.$createElement(p,"$unfold")])}},render(t){return t("div",{staticClass:"v-color-picker__edit"},[this.genInputs(),!this.hideModeSwitch&&this.genSwitch()])}});function ft(t){return Object.keys(t).map(e=>{const i=t[e];return i.base?[i.base,i.darken4,i.darken3,i.darken2,i.darken1,i.lighten1,i.lighten2,i.lighten3,i.lighten4,i.lighten5]:[i.black,i.white,i.transparent]})}const bt=T("#FFFFFF").rgba,_t=T("#000000").rgba,kt=w(P).extend({name:"v-color-picker-swatches",props:{swatches:{type:Array,default:()=>ft(et)},disabled:Boolean,color:Object,maxWidth:[Number,String],maxHeight:[Number,String]},methods:{genColor(t){const e=this.$createElement("div",{style:{background:t}},[$(this.color,R(t,null))&&this.$createElement(p,{props:{small:!0,dark:D(this.color.rgba,bt)>2&&this.color.alpha>.5,light:D(this.color.rgba,_t)>2&&this.color.alpha>.5}},"$success")]);return this.$createElement("div",{staticClass:"v-color-picker__color",on:{click:()=>this.disabled||this.$emit("update:color",T(t==="transparent"?"#00000000":t))}},[e])},genSwatches(){return this.swatches.map(t=>{const e=t.map(this.genColor);return this.$createElement("div",{staticClass:"v-color-picker__swatch"},e)})}},render(t){return t("div",{staticClass:"v-color-picker__swatches",style:{maxWidth:o(this.maxWidth),maxHeight:o(this.maxHeight)}},[this.$createElement("div",this.genSwatches())])}}),Ct=w(it,P).extend({name:"v-color-picker",props:{canvasHeight:{type:[String,Number],default:150},disabled:Boolean,dotSize:{type:[Number,String],default:10},flat:Boolean,hideCanvas:Boolean,hideSliders:Boolean,hideInputs:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)},showSwatches:Boolean,swatches:Array,swatchesMaxHeight:{type:[Number,String],default:150},value:{type:[Object,String]},width:{type:[Number,String],default:300}},data:()=>({internalValue:u({r:255,g:0,b:0,a:1})}),computed:{hideAlpha(){return this.value?!pt(this.value):!1}},watch:{value:{handler(t){this.updateColor(R(t,this.internalValue))},immediate:!0}},methods:{updateColor(t){this.internalValue=t;const e=dt(this.internalValue,this.value);$(e,this.value)||(this.$emit("input",e),this.$emit("update:color",this.internalValue))},genCanvas(){return this.$createElement(gt,{props:{color:this.internalValue,disabled:this.disabled,dotSize:this.dotSize,width:this.width,height:this.canvasHeight},on:{"update:color":this.updateColor}})},genControls(){return this.$createElement("div",{staticClass:"v-color-picker__controls"},[!this.hideSliders&&this.genPreview(),!this.hideInputs&&this.genEdit()])},genEdit(){return this.$createElement(vt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha,hideModeSwitch:this.hideModeSwitch,mode:this.mode},on:{"update:color":this.updateColor,"update:mode":t=>this.$emit("update:mode",t)}})},genPreview(){return this.$createElement(mt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha},on:{"update:color":this.updateColor}})},genSwatches(){return this.$createElement(kt,{props:{dark:this.dark,light:this.light,disabled:this.disabled,swatches:this.swatches,color:this.internalValue,maxHeight:this.swatchesMaxHeight},on:{"update:color":this.updateColor}})}},render(t){return t(st,{staticClass:"v-color-picker",class:{"v-color-picker--flat":this.flat,...this.themeClasses,...this.elevationClasses},props:{maxWidth:this.width}},[!this.hideCanvas&&this.genCanvas(),(!this.hideSliders||!this.hideInputs)&&this.genControls(),this.showSwatches&&this.genSwatches()])}});const wt={name:"TagChip",props:{isNew:{type:Boolean,default:!1},tag:{type:Object,default:()=>({name:"New Tag",value:"",color:"#2196F3"})},close:{type:Boolean,default:!0},customIcon:{type:String,default:null}},data(){return{menu:!1,internalTag:this.tag,rules:{noColon:[t=>!!t||"Required.",t=>!t.includes(":")||"Cannot contain a colon."]}}},watch:{menu(t){t?(this.isNew&&(this.internalTag={name:"",value:"",color:"#2196F3"}),this.$nextTick(()=>{this.$refs.form.resetValidation(),setTimeout(()=>{this.$refs.nameField.focus()},500)})):this.internalTag=this.tag}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){this.$refs.form.validate()&&(this.$emit("update-tag",t),this.menu=!1,this.$refs.form.resetValidation())}}};var $t=function(){var e=this,i=e._self._c;return i(at,{attrs:{"close-on-content-click":!1,"close-on-click":!1,bottom:"",right:"",transition:"scale-transition",origin:"top left"},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[i(ct,e._g({staticClass:"mt-4 mr-1 ml-1 mb-4",attrs:{color:e.internalTag.color,"text-color":"white",close:e.close},on:{"click:close":function(n){return e.deleteTag(e.internalTag)}}},s),[e._v(" "+e._s(`${e.tag.name}:${e.tag.value}`)+" "),e.customIcon?i(p,{attrs:{right:""}},[e._v(" "+e._s(e.customIcon)+" ")]):e._e()],1)]}}]),model:{value:e.menu,callback:function(s){e.menu=s},expression:"menu"}},[i(nt,{staticStyle:{display:"flex","flex-direction":"row-reverse"},attrs:{width:"400"}},[i(_,{staticClass:"mt-2 mr-2",attrs:{icon:""},on:{click:function(s){e.menu=!1}}},[i(p,[e._v("mdi-close-circle")])],1),i(rt,{ref:"form"},[i(lt,[i(L,{ref:"nameField",attrs:{outlined:"",dense:"",label:"Name",rules:e.rules.noColon,required:""},model:{value:e.internalTag.name,callback:function(s){e.$set(e.internalTag,"name",s)},expression:"internalTag.name"}}),i(L,{attrs:{outlined:"",dense:"",label:"Value",rules:e.rules.noColon,required:""},model:{value:e.internalTag.value,callback:function(s){e.$set(e.internalTag,"value",s)},expression:"internalTag.value"}}),i(Ct,{attrs:{"hide-inputs":"","dot-size":"16",mode:"hexa","swatches-max-height":"100"},model:{value:e.internalTag.color,callback:function(s){e.$set(e.internalTag,"color",s)},expression:"internalTag.color"}})],1),i(ot,[i(ht),i(_,{attrs:{color:"green",text:""},on:{click:function(s){return e.updateTag(e.internalTag)}}},[e._v(" Update ")])],1)],1)],1)],1)},yt=[],St=H(wt,$t,yt,!1,null,null,null,null);const C=St.exports;const xt={name:"TagViewer",components:{TagChip:C},props:{tags:{type:Array,default:()=>[]}},data(){return{menu:{}}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){this.$emit("update-tag",t)},newTag(t){this.$emit("new-tag",t)}}};var Vt=function(){var e=this,i=e._self._c;return i("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[i("div",e._l(e.tags,function(s){return i(C,{key:s.id,attrs:{tag:s},on:{"delete-tag":e.deleteTag,"update-tag":e.updateTag}})}),1),i("div",[i(C,{attrs:{"is-new":!0,close:!1,"custom-icon":"mdi-plus-circle"},on:{"update-tag":e.newTag}})],1)])},Tt=[],Mt=H(xt,Vt,Tt,!1,null,null,null,null);const Ft=Mt.exports;export{Ft as _}; +import{J as w,b8 as A,b9 as F,ba as j,U as W,P as G,R as o,bb as U,bc as Y,a0 as $,bd as f,aH as q,be as N,bf as y,bg as S,bh as K,bi as X,bj as x,bk as J,bl as Q,I as V,bm as Z,bn as tt,bo as B,a as _,b as p,T as P,bp as D,bq as et,Q as it,aP as st,n as H,k as at,c as nt,a7 as rt,aa as lt,j as L,ab as ot,a2 as ht}from"./index-e409ba63.js";import{a as ct}from"./VSelect-22e7980f.js";const ut=w(F,A).extend({name:"v-slider",directives:{ClickOutside:j},mixins:[A],props:{disabled:Boolean,inverseLabel:Boolean,max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:1},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:t=>typeof t=="boolean"||t==="always"},thumbSize:{type:[Number,String],default:32},tickLabels:{type:Array,default:()=>[]},ticks:{type:[Boolean,String],default:!1,validator:t=>typeof t=="boolean"||t==="always"},tickSize:{type:[Number,String],default:2},trackColor:String,trackFillColor:String,value:[Number,String],vertical:Boolean},data:()=>({app:null,oldValue:null,thumbPressed:!1,mouseTimeout:-1,isFocused:!1,isActive:!1,noClick:!1,startOffset:0}),computed:{classes(){return{...F.options.computed.classes.call(this),"v-input__slider":!0,"v-input__slider--vertical":this.vertical,"v-input__slider--inverse-label":this.inverseLabel}},internalValue:{get(){return this.lazyValue},set(t){t=isNaN(t)?this.minValue:t;const e=this.roundValue(Math.min(Math.max(t,this.minValue),this.maxValue));e!==this.lazyValue&&(this.lazyValue=e,this.$emit("input",e))}},trackTransition(){return this.thumbPressed?this.showTicks||this.stepNumeric?"0.1s cubic-bezier(0.25, 0.8, 0.5, 1)":"none":""},minValue(){return parseFloat(this.min)},maxValue(){return parseFloat(this.max)},stepNumeric(){return this.step>0?parseFloat(this.step):0},inputWidth(){const t=(this.roundValue(this.internalValue)-this.minValue)/(this.maxValue-this.minValue)*100;return isNaN(t)?0:t},trackFillStyles(){const t=this.vertical?"bottom":"left",e=this.vertical?"top":"right",i=this.vertical?"height":"width",s=this.$vuetify.rtl?"auto":"0",n=this.$vuetify.rtl?"0":"auto",a=this.isDisabled?`calc(${this.inputWidth}% - 10px)`:`${this.inputWidth}%`;return{transition:this.trackTransition,[t]:s,[e]:n,[i]:a}},trackStyles(){const t=this.vertical?this.$vuetify.rtl?"bottom":"top":this.$vuetify.rtl?"left":"right",e=this.vertical?"height":"width",i="0px",s=this.isDisabled?`calc(${100-this.inputWidth}% - 10px)`:`calc(${100-this.inputWidth}%)`;return{transition:this.trackTransition,[t]:i,[e]:s}},showTicks(){return this.tickLabels.length>0||!!(!this.isDisabled&&this.stepNumeric&&this.ticks)},numTicks(){return Math.ceil((this.maxValue-this.minValue)/this.stepNumeric)},showThumbLabel(){return!this.isDisabled&&!!(this.thumbLabel||this.$scopedSlots["thumb-label"])},computedTrackColor(){if(!this.isDisabled)return this.trackColor?this.trackColor:this.isDark?this.validationState:this.validationState||"primary lighten-3"},computedTrackFillColor(){if(!this.isDisabled)return this.trackFillColor?this.trackFillColor:this.validationState||this.computedColor},computedThumbColor(){return this.thumbColor?this.thumbColor:this.validationState||this.computedColor}},watch:{min(t){const e=parseFloat(t);e>this.internalValue&&this.$emit("input",e)},max(t){const e=parseFloat(t);e{const l=[];this.tickLabels[a]&&l.push(this.$createElement("div",{staticClass:"v-slider__tick-label"},this.tickLabels[a]));const r=a*(100/this.numTicks),c=this.$vuetify.rtl?100-this.inputWidth0}},n)},genThumbContainer(t,e,i,s,n,a,l="thumb"){const r=[this.genThumb()],c=this.genThumbLabelContent(t);return this.showThumbLabel&&r.push(this.genThumbLabel(c)),this.$createElement("div",this.setTextColor(this.computedThumbColor,{ref:l,key:l,staticClass:"v-slider__thumb-container",class:{"v-slider__thumb-container--active":i,"v-slider__thumb-container--focused":s,"v-slider__thumb-container--show-label":this.showThumbLabel},style:this.getThumbContainerStyles(e),attrs:{role:"slider",tabindex:this.isDisabled?-1:this.$attrs.tabindex?this.$attrs.tabindex:0,"aria-label":this.$attrs["aria-label"]||this.label,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.internalValue,"aria-readonly":String(this.isReadonly),"aria-orientation":this.vertical?"vertical":"horizontal"},on:{focus:n,blur:a,keydown:this.onKeyDown}}),r)},genThumbLabelContent(t){return this.$scopedSlots["thumb-label"]?this.$scopedSlots["thumb-label"]({value:t}):[this.$createElement("span",[String(t)])]},genThumbLabel(t){const e=o(this.thumbSize),i=this.vertical?`translateY(20%) translateY(${Number(this.thumbSize)/3-1}px) translateX(55%) rotate(135deg)`:"translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";return this.$createElement(U,{props:{origin:"bottom center"}},[this.$createElement("div",{staticClass:"v-slider__thumb-label-container",directives:[{name:"show",value:this.isFocused||this.isActive||this.thumbLabel==="always"}]},[this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb-label",style:{height:e,width:e,transform:i}}),[this.$createElement("div",t)])])])},genThumb(){return this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb"}))},getThumbContainerStyles(t){const e=this.vertical?"top":"left";let i=this.$vuetify.rtl?100-t:t;return i=this.vertical?100-i:i,{transition:this.trackTransition,[e]:`${i}%`}},onSliderMouseDown(t){var e;if(t.preventDefault(),this.oldValue=this.internalValue,this.isActive=!0,!((e=t.target)===null||e===void 0)&&e.matches(".v-slider__thumb-container, .v-slider__thumb-container *")){this.thumbPressed=!0;const a=t.target.getBoundingClientRect(),l="touches"in t?t.touches[0]:t;this.startOffset=this.vertical?l.clientY-(a.top+a.height/2):l.clientX-(a.left+a.width/2)}else this.startOffset=0,window.clearTimeout(this.mouseTimeout),this.mouseTimeout=window.setTimeout(()=>{this.thumbPressed=!0},300);const i=f?{passive:!0,capture:!0}:!0,s=f?{passive:!0}:!1,n="touches"in t;this.onMouseMove(t),this.app.addEventListener(n?"touchmove":"mousemove",this.onMouseMove,s),Y(this.app,n?"touchend":"mouseup",this.onSliderMouseUp,i),this.$emit("start",this.internalValue)},onSliderMouseUp(t){t.stopPropagation(),window.clearTimeout(this.mouseTimeout),this.thumbPressed=!1;const e=f?{passive:!0}:!1;this.app.removeEventListener("touchmove",this.onMouseMove,e),this.app.removeEventListener("mousemove",this.onMouseMove,e),this.$emit("mouseup",t),this.$emit("end",this.internalValue),$(this.oldValue,this.internalValue)||(this.$emit("change",this.internalValue),this.noClick=!0),this.isActive=!1},onMouseMove(t){t.type==="mousemove"&&(this.thumbPressed=!0),this.internalValue=this.parseMouseMove(t)},onKeyDown(t){if(!this.isInteractive)return;const e=this.parseKeyDown(t,this.internalValue);e==null||ethis.maxValue||(this.internalValue=e,this.$emit("change",e))},onSliderClick(t){if(this.noClick){this.noClick=!1;return}this.$refs.thumb.focus(),this.onMouseMove(t),this.$emit("change",this.internalValue)},onBlur(t){this.isFocused=!1,this.$emit("blur",t)},onFocus(t){this.isFocused=!0,this.$emit("focus",t)},parseMouseMove(t){const e=this.vertical?"top":"left",i=this.vertical?"height":"width",s=this.vertical?"clientY":"clientX",{[e]:n,[i]:a}=this.$refs.track.getBoundingClientRect(),l="touches"in t?t.touches[0][s]:t[s];let r=Math.min(Math.max((l-n-this.startOffset)/a,0),1)||0;return this.vertical&&(r=1-r),this.$vuetify.rtl&&(r=1-r),parseFloat(this.min)+r*(this.maxValue-this.minValue)},parseKeyDown(t,e){if(!this.isInteractive)return;const{pageup:i,pagedown:s,end:n,home:a,left:l,right:r,down:c,up:d}=q;if(![i,s,n,a,l,r,c,d].includes(t.keyCode))return;t.preventDefault();const v=this.stepNumeric||1,M=(this.maxValue-this.minValue)/v;if([l,r,c,d].includes(t.keyCode)){const I=(this.$vuetify.rtl?[l,d]:[r,d]).includes(t.keyCode)?1:-1,z=t.shiftKey?3:t.ctrlKey?2:1;e=e+I*v*z}else if(t.keyCode===a)e=this.minValue;else if(t.keyCode===n)e=this.maxValue;else{const E=t.keyCode===s?1:-1;e=e-E*v*(M>100?M/10:10)}return e},roundValue(t){if(!this.stepNumeric)return t;const e=this.step.toString().trim(),i=e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0,s=this.minValue%this.stepNumeric,n=Math.round((t-s)/this.stepNumeric)*this.stepNumeric+s;return parseFloat(Math.min(n,this.maxValue).toFixed(i))}}});function m(t){t={...t};const e=N(t),i=y(t),s=S(t);return{alpha:t.a,hex:e.substr(0,7),hexa:e,hsla:i,hsva:t,hue:t.h,rgba:s}}function O(t){const e=J(t),i=N(e),s=S(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:t,hsva:e,hue:e.h,rgba:s}}function u(t){const e=K(t),i=X(t),s=y(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:s,hsva:e,hue:e.h,rgba:t}}function g(t){const e=Q(t),i=y(e),s=S(e);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:i,hsva:e,hue:e.h,rgba:s}}function T(t){return g(x(t))}function h(t,e){return e.every(i=>t.hasOwnProperty(i))}function R(t,e){if(!t)return u({r:255,g:0,b:0,a:1});if(typeof t=="string"){if(t==="transparent")return g("#00000000");const i=x(t);return e&&i===e.hexa?e:g(i)}if(typeof t=="object"){if(t.hasOwnProperty("alpha"))return t;const i=t.hasOwnProperty("a")?parseFloat(t.a):1;if(h(t,["r","g","b"]))return e&&t===e.rgba?e:u({...t,a:i});if(h(t,["h","s","l"]))return e&&t===e.hsla?e:O({...t,a:i});if(h(t,["h","s","v"]))return e&&t===e.hsva?e:m({...t,a:i})}return u({r:255,g:0,b:0,a:1})}function b(t,e){if(e){const{a:i,...s}=t;return s}return t}function dt(t,e){if(e==null)return t;if(typeof e=="string")return e.length===7?t.hex:t.hexa;if(typeof e=="object"){const i=typeof e.a=="number"&&e.a===0?!!e.a:!e.a;if(h(e,["r","g","b"]))return b(t.rgba,i);if(h(e,["h","s","l"]))return b(t.hsla,i);if(h(e,["h","s","v"]))return b(t.hsva,i)}return t}function pt(t){return t?typeof t=="string"?t.length>7:typeof t=="object"?h(t,["a"])||h(t,["alpha"]):!1:!1}const mt=V.extend({name:"v-color-picker-preview",props:{color:Object,disabled:Boolean,hideAlpha:Boolean},methods:{genAlpha(){return this.genTrack({staticClass:"v-color-picker__alpha",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.alpha,step:0,min:0,max:1},style:{backgroundImage:this.disabled?void 0:`linear-gradient(to ${this.$vuetify.rtl?"left":"right"}, transparent, ${Z(this.color.rgba)})`},on:{input:t=>this.color.alpha!==t&&this.$emit("update:color",m({...this.color.hsva,a:t}))}})},genSliders(){return this.$createElement("div",{staticClass:"v-color-picker__sliders"},[this.genHue(),!this.hideAlpha&&this.genAlpha()])},genDot(){return this.$createElement("div",{staticClass:"v-color-picker__dot"},[this.$createElement("div",{style:{background:tt(this.color.rgba)}})])},genHue(){return this.genTrack({staticClass:"v-color-picker__hue",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.hue,step:0,min:0,max:360},on:{input:t=>this.color.hue!==t&&this.$emit("update:color",m({...this.color.hsva,h:t}))}})},genTrack(t){return this.$createElement(ut,{class:"v-color-picker__track",...t,props:{disabled:this.disabled,...t.props}})}},render(t){return t("div",{staticClass:"v-color-picker__preview",class:{"v-color-picker__preview--hide-alpha":this.hideAlpha}},[this.genDot(),this.genSliders()])}});const gt=V.extend({name:"v-color-picker-canvas",props:{color:{type:Object,default:()=>u({r:255,g:0,b:0,a:1})},disabled:Boolean,dotSize:{type:[Number,String],default:10},height:{type:[Number,String],default:150},width:{type:[Number,String],default:300}},data(){return{boundingRect:{width:0,height:0,left:0,top:0}}},computed:{dot(){return this.color?{x:this.color.hsva.s*parseInt(this.width,10),y:(1-this.color.hsva.v)*parseInt(this.height,10)}:{x:0,y:0}}},watch:{"color.hue":"updateCanvas"},mounted(){this.updateCanvas()},methods:{emitColor(t,e){const{left:i,top:s,width:n,height:a}=this.boundingRect;this.$emit("update:color",m({h:this.color.hue,s:B(t-i,0,n)/n,v:1-B(e-s,0,a)/a,a:this.color.alpha}))},updateCanvas(){if(!this.color)return;const t=this.$refs.canvas,e=t.getContext("2d");if(!e)return;const i=e.createLinearGradient(0,0,t.width,0);i.addColorStop(0,"hsla(0, 0%, 100%, 1)"),i.addColorStop(1,`hsla(${this.color.hue}, 100%, 50%, 1)`),e.fillStyle=i,e.fillRect(0,0,t.width,t.height);const s=e.createLinearGradient(0,0,0,t.height);s.addColorStop(0,"hsla(0, 0%, 100%, 0)"),s.addColorStop(1,"hsla(0, 0%, 0%, 1)"),e.fillStyle=s,e.fillRect(0,0,t.width,t.height)},handleClick(t){this.disabled||(this.boundingRect=this.$el.getBoundingClientRect(),this.emitColor(t.clientX,t.clientY))},handleMouseDown(t){t.preventDefault(),!this.disabled&&(this.boundingRect=this.$el.getBoundingClientRect(),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp))},handleMouseMove(t){this.disabled||this.emitColor(t.clientX,t.clientY)},handleMouseUp(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)},genCanvas(){return this.$createElement("canvas",{ref:"canvas",attrs:{width:this.width,height:this.height}})},genDot(){const t=parseInt(this.dotSize,10)/2,e=o(this.dot.x-t),i=o(this.dot.y-t);return this.$createElement("div",{staticClass:"v-color-picker__canvas-dot",class:{"v-color-picker__canvas-dot--disabled":this.disabled},style:{width:o(this.dotSize),height:o(this.dotSize),transform:`translate(${e}, ${i})`}})}},render(t){return t("div",{staticClass:"v-color-picker__canvas",style:{width:o(this.width),height:o(this.height)},on:{click:this.handleClick,mousedown:this.handleMouseDown}},[this.genCanvas(),this.genDot()])}});const k={rgba:{inputs:[["r",255,"int"],["g",255,"int"],["b",255,"int"],["a",1,"float"]],from:u},hsla:{inputs:[["h",360,"int"],["s",1,"float"],["l",1,"float"],["a",1,"float"]],from:O},hexa:{from:g}},vt=V.extend({name:"v-color-picker-edit",props:{color:Object,disabled:Boolean,hideAlpha:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)}},data(){return{modes:k,internalMode:this.mode}},computed:{currentMode(){return this.modes[this.internalMode]}},watch:{mode(t){this.internalMode=t}},created(){this.internalMode=this.mode},methods:{getValue(t,e){return e==="float"?Math.round(t*100)/100:e==="int"?Math.round(t):0},parseValue(t,e){return e==="float"?parseFloat(t):e==="int"&&parseInt(t,10)||0},changeMode(){const t=Object.keys(this.modes),e=t.indexOf(this.internalMode),i=t[(e+1)%t.length];this.internalMode=i,this.$emit("update:mode",i)},genInput(t,e,i,s){return this.$createElement("div",{staticClass:"v-color-picker__input"},[this.$createElement("input",{key:t,attrs:e,domProps:{value:i},on:s}),this.$createElement("span",t.toUpperCase())])},genInputs(){if(this.internalMode==="hexa"){const t=this.color.hexa,e=this.hideAlpha&&t.endsWith("FF")?t.substr(0,7):t;return this.genInput("hex",{maxlength:this.hideAlpha?7:9,disabled:this.disabled},e,{change:i=>{const s=i.target;this.$emit("update:color",this.currentMode.from(x(s.value)))}})}else return(this.hideAlpha?this.currentMode.inputs.slice(0,-1):this.currentMode.inputs).map(([e,i,s])=>{const n=this.color[this.internalMode];return this.genInput(e,{type:"number",min:0,max:i,step:s==="float"?"0.01":s==="int"?"1":void 0,disabled:this.disabled},this.getValue(n[e],s),{input:a=>{const l=a.target,r=this.parseValue(l.value||"0",s);this.$emit("update:color",this.currentMode.from(Object.assign({},n,{[e]:r}),this.color.alpha))}})})},genSwitch(){return this.$createElement(_,{props:{small:!0,icon:!0,disabled:this.disabled},on:{click:this.changeMode}},[this.$createElement(p,"$unfold")])}},render(t){return t("div",{staticClass:"v-color-picker__edit"},[this.genInputs(),!this.hideModeSwitch&&this.genSwitch()])}});function ft(t){return Object.keys(t).map(e=>{const i=t[e];return i.base?[i.base,i.darken4,i.darken3,i.darken2,i.darken1,i.lighten1,i.lighten2,i.lighten3,i.lighten4,i.lighten5]:[i.black,i.white,i.transparent]})}const bt=T("#FFFFFF").rgba,_t=T("#000000").rgba,kt=w(P).extend({name:"v-color-picker-swatches",props:{swatches:{type:Array,default:()=>ft(et)},disabled:Boolean,color:Object,maxWidth:[Number,String],maxHeight:[Number,String]},methods:{genColor(t){const e=this.$createElement("div",{style:{background:t}},[$(this.color,R(t,null))&&this.$createElement(p,{props:{small:!0,dark:D(this.color.rgba,bt)>2&&this.color.alpha>.5,light:D(this.color.rgba,_t)>2&&this.color.alpha>.5}},"$success")]);return this.$createElement("div",{staticClass:"v-color-picker__color",on:{click:()=>this.disabled||this.$emit("update:color",T(t==="transparent"?"#00000000":t))}},[e])},genSwatches(){return this.swatches.map(t=>{const e=t.map(this.genColor);return this.$createElement("div",{staticClass:"v-color-picker__swatch"},e)})}},render(t){return t("div",{staticClass:"v-color-picker__swatches",style:{maxWidth:o(this.maxWidth),maxHeight:o(this.maxHeight)}},[this.$createElement("div",this.genSwatches())])}}),Ct=w(it,P).extend({name:"v-color-picker",props:{canvasHeight:{type:[String,Number],default:150},disabled:Boolean,dotSize:{type:[Number,String],default:10},flat:Boolean,hideCanvas:Boolean,hideSliders:Boolean,hideInputs:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)},showSwatches:Boolean,swatches:Array,swatchesMaxHeight:{type:[Number,String],default:150},value:{type:[Object,String]},width:{type:[Number,String],default:300}},data:()=>({internalValue:u({r:255,g:0,b:0,a:1})}),computed:{hideAlpha(){return this.value?!pt(this.value):!1}},watch:{value:{handler(t){this.updateColor(R(t,this.internalValue))},immediate:!0}},methods:{updateColor(t){this.internalValue=t;const e=dt(this.internalValue,this.value);$(e,this.value)||(this.$emit("input",e),this.$emit("update:color",this.internalValue))},genCanvas(){return this.$createElement(gt,{props:{color:this.internalValue,disabled:this.disabled,dotSize:this.dotSize,width:this.width,height:this.canvasHeight},on:{"update:color":this.updateColor}})},genControls(){return this.$createElement("div",{staticClass:"v-color-picker__controls"},[!this.hideSliders&&this.genPreview(),!this.hideInputs&&this.genEdit()])},genEdit(){return this.$createElement(vt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha,hideModeSwitch:this.hideModeSwitch,mode:this.mode},on:{"update:color":this.updateColor,"update:mode":t=>this.$emit("update:mode",t)}})},genPreview(){return this.$createElement(mt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha},on:{"update:color":this.updateColor}})},genSwatches(){return this.$createElement(kt,{props:{dark:this.dark,light:this.light,disabled:this.disabled,swatches:this.swatches,color:this.internalValue,maxHeight:this.swatchesMaxHeight},on:{"update:color":this.updateColor}})}},render(t){return t(st,{staticClass:"v-color-picker",class:{"v-color-picker--flat":this.flat,...this.themeClasses,...this.elevationClasses},props:{maxWidth:this.width}},[!this.hideCanvas&&this.genCanvas(),(!this.hideSliders||!this.hideInputs)&&this.genControls(),this.showSwatches&&this.genSwatches()])}});const wt={name:"TagChip",props:{isNew:{type:Boolean,default:!1},tag:{type:Object,default:()=>({name:"New Tag",value:"",color:"#2196F3"})},close:{type:Boolean,default:!0},customIcon:{type:String,default:null}},data(){return{menu:!1,internalTag:this.tag,rules:{noColon:[t=>!!t||"Required.",t=>!t.includes(":")||"Cannot contain a colon."]}}},watch:{menu(t){t?(this.isNew&&(this.internalTag={name:"",value:"",color:"#2196F3"}),this.$nextTick(()=>{this.$refs.form.resetValidation(),setTimeout(()=>{this.$refs.nameField.focus()},500)})):this.internalTag=this.tag}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){this.$refs.form.validate()&&(this.$emit("update-tag",t),this.menu=!1,this.$refs.form.resetValidation())}}};var $t=function(){var e=this,i=e._self._c;return i(at,{attrs:{"close-on-content-click":!1,"close-on-click":!1,bottom:"",right:"",transition:"scale-transition",origin:"top left"},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[i(ct,e._g({staticClass:"mt-4 mr-1 ml-1 mb-4",attrs:{color:e.internalTag.color,"text-color":"white",close:e.close},on:{"click:close":function(n){return e.deleteTag(e.internalTag)}}},s),[e._v(" "+e._s(`${e.tag.name}:${e.tag.value}`)+" "),e.customIcon?i(p,{attrs:{right:""}},[e._v(" "+e._s(e.customIcon)+" ")]):e._e()],1)]}}]),model:{value:e.menu,callback:function(s){e.menu=s},expression:"menu"}},[i(nt,{staticStyle:{display:"flex","flex-direction":"row-reverse"},attrs:{width:"400"}},[i(_,{staticClass:"mt-2 mr-2",attrs:{icon:""},on:{click:function(s){e.menu=!1}}},[i(p,[e._v("mdi-close-circle")])],1),i(rt,{ref:"form"},[i(lt,[i(L,{ref:"nameField",attrs:{outlined:"",dense:"",label:"Name",rules:e.rules.noColon,required:""},model:{value:e.internalTag.name,callback:function(s){e.$set(e.internalTag,"name",s)},expression:"internalTag.name"}}),i(L,{attrs:{outlined:"",dense:"",label:"Value",rules:e.rules.noColon,required:""},model:{value:e.internalTag.value,callback:function(s){e.$set(e.internalTag,"value",s)},expression:"internalTag.value"}}),i(Ct,{attrs:{"hide-inputs":"","dot-size":"16",mode:"hexa","swatches-max-height":"100"},model:{value:e.internalTag.color,callback:function(s){e.$set(e.internalTag,"color",s)},expression:"internalTag.color"}})],1),i(ot,[i(ht),i(_,{attrs:{color:"green",text:""},on:{click:function(s){return e.updateTag(e.internalTag)}}},[e._v(" Update ")])],1)],1)],1)],1)},yt=[],St=H(wt,$t,yt,!1,null,null,null,null);const C=St.exports;const xt={name:"TagViewer",components:{TagChip:C},props:{tags:{type:Array,default:()=>[]}},data(){return{menu:{}}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){this.$emit("update-tag",t)},newTag(t){this.$emit("new-tag",t)}}};var Vt=function(){var e=this,i=e._self._c;return i("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[i("div",e._l(e.tags,function(s){return i(C,{key:s.id,attrs:{tag:s},on:{"delete-tag":e.deleteTag,"update-tag":e.updateTag}})}),1),i("div",[i(C,{attrs:{"is-new":!0,close:!1,"custom-icon":"mdi-plus-circle"},on:{"update-tag":e.newTag}})],1)])},Tt=[],Mt=H(xt,Vt,Tt,!1,null,null,null,null);const Ft=Mt.exports;export{Ft as _}; diff --git a/dist/assets/TechniqueChips-8d3b8349.js b/dist/assets/TechniqueChips-3c9db4c5.js similarity index 85% rename from dist/assets/TechniqueChips-8d3b8349.js rename to dist/assets/TechniqueChips-3c9db4c5.js index 0b1ffeb..4469e5a 100644 --- a/dist/assets/TechniqueChips-8d3b8349.js +++ b/dist/assets/TechniqueChips-3c9db4c5.js @@ -1 +1 @@ -import{n as s}from"./index-e8f29bb9.js";import{a as l}from"./VSelect-f55906da.js";const _={name:"TechniqueChips",props:{techniques:{type:Array,default:()=>[]},showTitle:{type:Boolean,default:!0}},methods:{getTechniqueUrl(r){if(r.includes(".")){const[e,n]=r.split(".");return`https://attack.mitre.org/techniques/${e}/${n}`}return`https://attack.mitre.org/techniques/${r}`}}};var i=function(){var e=this,n=e._self._c;return e.techniques.length>0?n("div",{staticClass:"flex flex-row flex-wrap mb-2"},[e.showTitle?n("span",{staticClass:"mr-2"},[e._v("Techniques:")]):e._e(),e._l(e.techniques.filter(t=>t!==""),function(t){return n(l,{key:t,staticClass:"mr-1 mb-1",attrs:{small:"",href:e.getTechniqueUrl(t),target:"_blank",rel:"noopener noreferrer",color:"green"}},[e._v(" "+e._s(t)+" ")])})],2):e._e()},a=[],o=s(_,i,a,!1,null,null,null,null);const p=o.exports;export{p as _}; +import{n as s}from"./index-e409ba63.js";import{a as l}from"./VSelect-22e7980f.js";const _={name:"TechniqueChips",props:{techniques:{type:Array,default:()=>[]},showTitle:{type:Boolean,default:!0}},methods:{getTechniqueUrl(r){if(r.includes(".")){const[e,n]=r.split(".");return`https://attack.mitre.org/techniques/${e}/${n}`}return`https://attack.mitre.org/techniques/${r}`}}};var i=function(){var e=this,n=e._self._c;return e.techniques.length>0?n("div",{staticClass:"flex flex-row flex-wrap mb-2"},[e.showTitle?n("span",{staticClass:"mr-2"},[e._v("Techniques:")]):e._e(),e._l(e.techniques.filter(t=>t!==""),function(t){return n(l,{key:t,staticClass:"mr-1 mb-1",attrs:{small:"",href:e.getTechniqueUrl(t),target:"_blank",rel:"noopener noreferrer",color:"green"}},[e._v(" "+e._s(t)+" ")])})],2):e._e()},a=[],o=s(_,i,a,!1,null,null,null,null);const p=o.exports;export{p as _}; diff --git a/dist/assets/TooltipButton-ef876422.js b/dist/assets/TooltipButton-f53c45a7.js similarity index 87% rename from dist/assets/TooltipButton-ef876422.js rename to dist/assets/TooltipButton-f53c45a7.js index 4a0c55e..535aae5 100644 --- a/dist/assets/TooltipButton-ef876422.js +++ b/dist/assets/TooltipButton-f53c45a7.js @@ -1 +1 @@ -import{n as l,a as o,b as a}from"./index-e8f29bb9.js";import{_ as s}from"./VTooltip-0015e28c.js";const _={name:"TooltipButton",props:{icon:{type:String,required:!0},text:{type:String,required:!0},padLeft:{type:Number,default:0},color:{type:String,default:""},flat:{type:Boolean,default:!1},to:{type:Object,default:null},xSmall:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:Boolean,default:!1}},methods:{style(){return this.padLeft!==0?`padding-left: ${this.padLeft}px`:""}}};var r=function(){var t=this,e=t._self._c;return e(s,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:n}){return[e(o,t._g({staticClass:"mr-5",attrs:{color:t.flat?"":t.color,to:t.to,disabled:t.disabled,icon:"",small:!t.xSmall,"x-small":t.xSmall},on:{click:function(f){return t.$emit("click")}}},n),[e(a,{style:t.padLeft!==0?`padding-left: ${t.padLeft}px`:""},[t._v(" "+t._s(t.icon)+" "+t._s(t.rotate?"fa-spin":"")+" ")])],1)]}}])},[e("span",[t._v(t._s(t.text))])])},p=[],i=l(_,r,p,!1,null,null,null,null);const m=i.exports;export{m as _}; +import{n as l,a as o,b as a}from"./index-e409ba63.js";import{_ as s}from"./VTooltip-7c0b187f.js";const _={name:"TooltipButton",props:{icon:{type:String,required:!0},text:{type:String,required:!0},padLeft:{type:Number,default:0},color:{type:String,default:""},flat:{type:Boolean,default:!1},to:{type:Object,default:null},xSmall:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:Boolean,default:!1}},methods:{style(){return this.padLeft!==0?`padding-left: ${this.padLeft}px`:""}}};var r=function(){var t=this,e=t._self._c;return e(s,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:n}){return[e(o,t._g({staticClass:"mr-5",attrs:{color:t.flat?"":t.color,to:t.to,disabled:t.disabled,icon:"",small:!t.xSmall,"x-small":t.xSmall},on:{click:function(f){return t.$emit("click")}}},n),[e(a,{style:t.padLeft!==0?`padding-left: ${t.padLeft}px`:""},[t._v(" "+t._s(t.icon)+" "+t._s(t.rotate?"fa-spin":"")+" ")])],1)]}}])},[e("span",[t._v(t._s(t.text))])])},p=[],i=l(_,r,p,!1,null,null,null,null);const m=i.exports;export{m as _}; diff --git a/dist/assets/UserEdit-19cb593f.js b/dist/assets/UserEdit-88d17ced.js similarity index 91% rename from dist/assets/UserEdit-19cb593f.js rename to dist/assets/UserEdit-88d17ced.js index 4be49c0..93d6c1c 100644 --- a/dist/assets/UserEdit-19cb593f.js +++ b/dist/assets/UserEdit-88d17ced.js @@ -1 +1 @@ -import{_ as i}from"./ErrorStateAlert-44af51cd.js";import{_ as n}from"./EditPageTop-4e0a4ef6.js";import{a1 as l,u as d,av as u,aw as m,ax as c,n as f,c as p,a7 as h,j as t}from"./index-e8f29bb9.js";import{_ as o}from"./VSwitch-2cfffd69.js";import"./TooltipButton-ef876422.js";import"./VTooltip-0015e28c.js";const _={name:"UserEdit",components:{ErrorStateAlert:i,EditPageTop:n},data(){return{form:{username:"",password:"",confirm_password:"",is_admin:!1},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>3||"Name must be larger than 3 characters"],password:[s=>!!s||"Password is required",s=>!!s&&s.length>5||"Password must be larger than 5 characters"],confirmPassword:[s=>!!s||"Confirmation is required",s=>s===this.form.password||"Password must match"]},user:{},valid:!0,loading:!1,showPassword:!1,showConfirm:!1,errorState:!1}},computed:{...l(d,["isAdmin"]),breads(){return[{text:"Users",disabled:!1,to:"/users",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/users-edit"}]},breadcrumbName(){return this.user.username?this.user.username:this.id?this.id:"New"},isNew(){return this.$route.name==="userNew"},id(){return this.$route.params.id}},mounted(){this.isNew||this.getUser(this.id)},methods:{submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?u(this.form).then(()=>{this.$snack.success("User updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):m(this.form).then(({id:s})=>{this.$snack.success("User created"),this.loading=!1,this.$router.push({name:"userEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},getUser(s){c(s).then(e=>{this.user=e,this.form=e}).catch(()=>{this.errorState=!0})}}};var w=function(){var e=this,a=e._self._c;return a("div",[a(n,{attrs:{breads:e.breads,"show-submit":!0,"show-copy":!1,"show-delete":!1,"submit-loading":e.loading},on:{submit:e.submit}}),a("h3",[e._v(e._s(e.id?"Edit":"New")+" User")]),e.errorState?a(i,{attrs:{"resource-id":e.id,"resource-type":"user"}}):a(p,{staticStyle:{padding:"10px"}},[a(h,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[a(t,{attrs:{rules:e.rules.name,label:"Username",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.username,callback:function(r){e.$set(e.form,"username",r)},expression:"form.username"}}),e.isNew?a(t,{attrs:{type:e.showPassword?"text":"password","append-icon":e.showPassword?"fa-eye":"fa-eye-slash",rules:e.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showPassword=!e.showPassword}},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}):e._e(),e.isNew?a(t,{attrs:{type:e.showConfirm?"text":"password","append-icon":e.showConfirm?"fa-eye":"fa-eye-slash",rules:e.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showConfirm=!e.showConfirm}},model:{value:e.form.confirm_password,callback:function(r){e.$set(e.form,"confirm_password",r)},expression:"form.confirm_password"}}):e._e(),e.isAdmin?a(o,{attrs:{label:"Admin"},model:{value:e.form.is_admin,callback:function(r){e.$set(e.form,"is_admin",r)},expression:"form.is_admin"}}):e._e(),e.isNew?e._e():a(o,{attrs:{label:"Enabled"},model:{value:e.form.enabled,callback:function(r){e.$set(e.form,"enabled",r)},expression:"form.enabled"}})],1)],1)],1)},b=[],g=f(_,w,b,!1,null,null,null,null);const U=g.exports;export{U as default}; +import{_ as i}from"./ErrorStateAlert-3d45e0aa.js";import{_ as n}from"./EditPageTop-0ed1194e.js";import{a1 as l,u as d,av as u,aw as m,ax as c,n as f,c as p,a7 as h,j as t}from"./index-e409ba63.js";import{_ as o}from"./VSwitch-3f004360.js";import"./TooltipButton-f53c45a7.js";import"./VTooltip-7c0b187f.js";const _={name:"UserEdit",components:{ErrorStateAlert:i,EditPageTop:n},data(){return{form:{username:"",password:"",confirm_password:"",is_admin:!1},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>3||"Name must be larger than 3 characters"],password:[s=>!!s||"Password is required",s=>!!s&&s.length>5||"Password must be larger than 5 characters"],confirmPassword:[s=>!!s||"Confirmation is required",s=>s===this.form.password||"Password must match"]},user:{},valid:!0,loading:!1,showPassword:!1,showConfirm:!1,errorState:!1}},computed:{...l(d,["isAdmin"]),breads(){return[{text:"Users",disabled:!1,to:"/users",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/users-edit"}]},breadcrumbName(){return this.user.username?this.user.username:this.id?this.id:"New"},isNew(){return this.$route.name==="userNew"},id(){return this.$route.params.id}},mounted(){this.isNew||this.getUser(this.id)},methods:{submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?u(this.form).then(()=>{this.$snack.success("User updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):m(this.form).then(({id:s})=>{this.$snack.success("User created"),this.loading=!1,this.$router.push({name:"userEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},getUser(s){c(s).then(e=>{this.user=e,this.form=e}).catch(()=>{this.errorState=!0})}}};var w=function(){var e=this,a=e._self._c;return a("div",[a(n,{attrs:{breads:e.breads,"show-submit":!0,"show-copy":!1,"show-delete":!1,"submit-loading":e.loading},on:{submit:e.submit}}),a("h3",[e._v(e._s(e.id?"Edit":"New")+" User")]),e.errorState?a(i,{attrs:{"resource-id":e.id,"resource-type":"user"}}):a(p,{staticStyle:{padding:"10px"}},[a(h,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[a(t,{attrs:{rules:e.rules.name,label:"Username",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.username,callback:function(r){e.$set(e.form,"username",r)},expression:"form.username"}}),e.isNew?a(t,{attrs:{type:e.showPassword?"text":"password","append-icon":e.showPassword?"fa-eye":"fa-eye-slash",rules:e.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showPassword=!e.showPassword}},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}):e._e(),e.isNew?a(t,{attrs:{type:e.showConfirm?"text":"password","append-icon":e.showConfirm?"fa-eye":"fa-eye-slash",rules:e.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showConfirm=!e.showConfirm}},model:{value:e.form.confirm_password,callback:function(r){e.$set(e.form,"confirm_password",r)},expression:"form.confirm_password"}}):e._e(),e.isAdmin?a(o,{attrs:{label:"Admin"},model:{value:e.form.is_admin,callback:function(r){e.$set(e.form,"is_admin",r)},expression:"form.is_admin"}}):e._e(),e.isNew?e._e():a(o,{attrs:{label:"Enabled"},model:{value:e.form.enabled,callback:function(r){e.$set(e.form,"enabled",r)},expression:"form.enabled"}})],1)],1)],1)},b=[],g=f(_,w,b,!1,null,null,null,null);const U=g.exports;export{U as default}; diff --git a/dist/assets/Users-644a9966.js b/dist/assets/Users-9e8fdec8.js similarity index 82% rename from dist/assets/Users-644a9966.js rename to dist/assets/Users-9e8fdec8.js index 1776c17..086c5d8 100644 --- a/dist/assets/Users-644a9966.js +++ b/dist/assets/Users-9e8fdec8.js @@ -1 +1 @@ -import{_ as o}from"./ListPageTop-5130be67.js";import{au as i,a1 as u,u as _,av as d,n as l}from"./index-e8f29bb9.js";import{h as m}from"./moment-fbc5633a.js";import{_ as c}from"./VDataTable-f3602581.js";import{b as p}from"./VSelect-f55906da.js";import{_ as f}from"./VTooltip-0015e28c.js";import{_ as h}from"./VSwitch-2cfffd69.js";import"./VItemGroup-e39c2c83.js";const b={name:"Users",components:{ListPageTop:o},data(){return{moment:m,breads:[{text:"Users",disabled:!0,href:"/users"}],headers:[{text:"Name",value:"username"},{text:"Is Admin",value:"is_admin"},{text:"Actions",value:"actions",sortable:!1}]}},computed:{userStore(){return i()},users(){return this.userStore.users},...u(_,["isAdmin"])},mounted(){this.getUsers()},methods:{create(){this.$router.push({name:"userNew"})},async disableUser(n){d(n).catch(e=>{this.$snack.error(`Error: ${e}`),n.enabled=!n.enabled})},getUsers(){this.userStore.getUsers()}}};var v=function(){var e=this,t=e._self._c;return t("div",[t(o,{attrs:{breads:e.breads,"show-create":e.isAdmin,"show-refresh":!0,"show-delete":!1},on:{create:e.create,refresh:e.getUsers}}),t(c,{attrs:{headers:e.headers,items:e.users,dense:""},scopedSlots:e._u([{key:"item.username",fn:function({item:s}){return[e.isAdmin?t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"userEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.username)+" ")]):t("span",[e._v(e._s(s.username))])]}},{key:"item.is_admin",fn:function({item:s}){return[t(p,{attrs:{disabled:""},model:{value:s.is_admin,callback:function(r){e.$set(s,"is_admin",r)},expression:"item.is_admin"}})]}},{key:"item.actions",fn:function({item:s}){return[e.isAdmin?t(f,{attrs:{disabled:!s.admin,top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r}){return[t("div",e._g({staticStyle:{"max-width":"120px"}},r),[t(h,e._g({attrs:{disabled:s.admin,label:"Enabled"},on:{change:function(a){return e.disableUser(s)}},model:{value:s.enabled,callback:function(a){e.$set(s,"enabled",a)},expression:"item.enabled"}},r))],1)]}}],null,!0)},[t("span",[e._v("Cannot disable admin user")])]):e._e()]}}])})],1)},g=[],U=l(b,v,g,!1,null,null,null,null);const C=U.exports;export{C as default}; +import{_ as o}from"./ListPageTop-78cbc2f3.js";import{au as i,a1 as u,u as _,av as d,n as l}from"./index-e409ba63.js";import{h as m}from"./moment-fbc5633a.js";import{_ as c}from"./VDataTable-dab2ebf1.js";import{b as p}from"./VSelect-22e7980f.js";import{_ as f}from"./VTooltip-7c0b187f.js";import{_ as h}from"./VSwitch-3f004360.js";import"./VItemGroup-3637266a.js";const b={name:"Users",components:{ListPageTop:o},data(){return{moment:m,breads:[{text:"Users",disabled:!0,href:"/users"}],headers:[{text:"Name",value:"username"},{text:"Is Admin",value:"is_admin"},{text:"Actions",value:"actions",sortable:!1}]}},computed:{userStore(){return i()},users(){return this.userStore.users},...u(_,["isAdmin"])},mounted(){this.getUsers()},methods:{create(){this.$router.push({name:"userNew"})},async disableUser(n){d(n).catch(e=>{this.$snack.error(`Error: ${e}`),n.enabled=!n.enabled})},getUsers(){this.userStore.getUsers()}}};var v=function(){var e=this,t=e._self._c;return t("div",[t(o,{attrs:{breads:e.breads,"show-create":e.isAdmin,"show-refresh":!0,"show-delete":!1},on:{create:e.create,refresh:e.getUsers}}),t(c,{attrs:{headers:e.headers,items:e.users,dense:""},scopedSlots:e._u([{key:"item.username",fn:function({item:s}){return[e.isAdmin?t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"userEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.username)+" ")]):t("span",[e._v(e._s(s.username))])]}},{key:"item.is_admin",fn:function({item:s}){return[t(p,{attrs:{disabled:""},model:{value:s.is_admin,callback:function(r){e.$set(s,"is_admin",r)},expression:"item.is_admin"}})]}},{key:"item.actions",fn:function({item:s}){return[e.isAdmin?t(f,{attrs:{disabled:!s.admin,top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r}){return[t("div",e._g({staticStyle:{"max-width":"120px"}},r),[t(h,e._g({attrs:{disabled:s.admin,label:"Enabled"},on:{change:function(a){return e.disableUser(s)}},model:{value:s.enabled,callback:function(a){e.$set(s,"enabled",a)},expression:"item.enabled"}},r))],1)]}}],null,!0)},[t("span",[e._v("Cannot disable admin user")])]):e._e()]}}])})],1)},g=[],U=l(b,v,g,!1,null,null,null,null);const C=U.exports;export{C as default}; diff --git a/dist/assets/VDataTable-f3602581.js b/dist/assets/VDataTable-dab2ebf1.js similarity index 99% rename from dist/assets/VDataTable-f3602581.js rename to dist/assets/VDataTable-dab2ebf1.js index de63937..50c483a 100644 --- a/dist/assets/VDataTable-f3602581.js +++ b/dist/assets/VDataTable-dab2ebf1.js @@ -1 +1 @@ -import{I as g,bw as R,bx as j,by as W,S as c,bz as w,a0 as p,a as v,b,b6 as u,J as f,T as A,a_ as E,bA as F,X as h,aQ as k,bB as G,aH as _,bC as $,b7 as L,R as P,aI as N,b8 as V,bD as T,bE as z,aG as U}from"./index-e8f29bb9.js";import{V as H,b as M,a as q}from"./VSelect-f55906da.js";const x=g.extend({name:"v-data",inheritAttrs:!1,props:{items:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})},sortBy:{type:[String,Array]},sortDesc:{type:[Boolean,Array]},customSort:{type:Function,default:R},mustSort:Boolean,multiSort:Boolean,page:{type:Number,default:1},itemsPerPage:{type:Number,default:10},groupBy:{type:[String,Array],default:()=>[]},groupDesc:{type:[Boolean,Array],default:()=>[]},customGroup:{type:Function,default:j},locale:{type:String,default:"en-US"},disableSort:Boolean,disablePagination:Boolean,disableFiltering:Boolean,search:String,customFilter:{type:Function,default:W},serverItemsLength:{type:Number,default:-1}},data(){let t={page:this.page,itemsPerPage:this.itemsPerPage,sortBy:c(this.sortBy),sortDesc:c(this.sortDesc),groupBy:c(this.groupBy),groupDesc:c(this.groupDesc),mustSort:this.mustSort,multiSort:this.multiSort};this.options&&(t=Object.assign(t,this.options));const{sortBy:e,sortDesc:s,groupBy:i,groupDesc:a}=t,n=e.length-s.length,o=i.length-a.length;return n>0&&t.sortDesc.push(...w(n,!1)),o>0&&t.groupDesc.push(...w(o,!1)),{internalOptions:t}},computed:{itemsLength(){return this.serverItemsLength>=0?this.serverItemsLength:this.filteredItems.length},pageCount(){return this.internalOptions.itemsPerPage<=0?1:Math.ceil(this.itemsLength/this.internalOptions.itemsPerPage)},pageStart(){return this.internalOptions.itemsPerPage===-1||!this.items.length?0:(this.internalOptions.page-1)*this.internalOptions.itemsPerPage},pageStop(){return this.internalOptions.itemsPerPage===-1?this.itemsLength:this.items.length?Math.min(this.itemsLength,this.internalOptions.page*this.internalOptions.itemsPerPage):0},isGrouped(){return!!this.internalOptions.groupBy.length},pagination(){return{page:this.internalOptions.page,itemsPerPage:this.internalOptions.itemsPerPage,pageStart:this.pageStart,pageStop:this.pageStop,pageCount:this.pageCount,itemsLength:this.itemsLength}},filteredItems(){let t=this.items.slice();return!this.disableFiltering&&this.serverItemsLength<=0&&(t=this.customFilter(t,this.search)),t},computedItems(){let t=this.filteredItems.slice();return(!this.disableSort||this.internalOptions.groupBy.length)&&this.serverItemsLength<=0&&(t=this.sortItems(t)),!this.disablePagination&&this.serverItemsLength<=0&&(t=this.paginateItems(t)),t},groupedItems(){return this.isGrouped?this.groupItems(this.computedItems):null},scopedProps(){return{sort:this.sort,sortArray:this.sortArray,group:this.group,items:this.computedItems,options:this.internalOptions,updateOptions:this.updateOptions,pagination:this.pagination,groupedItems:this.groupedItems,originalItemsLength:this.items.length}},computedOptions(){return{...this.options}}},watch:{computedOptions:{handler(t,e){p(t,e)||this.updateOptions(t)},deep:!0,immediate:!0},internalOptions:{handler(t,e){p(t,e)||this.$emit("update:options",t)},deep:!0,immediate:!0},page(t){this.updateOptions({page:t})},"internalOptions.page"(t){this.$emit("update:page",t)},itemsPerPage(t){this.updateOptions({itemsPerPage:t})},"internalOptions.itemsPerPage"(t){this.$emit("update:items-per-page",t)},sortBy(t){this.updateOptions({sortBy:c(t)})},"internalOptions.sortBy"(t,e){!p(t,e)&&this.$emit("update:sort-by",Array.isArray(this.sortBy)?t:t[0])},sortDesc(t){this.updateOptions({sortDesc:c(t)})},"internalOptions.sortDesc"(t,e){!p(t,e)&&this.$emit("update:sort-desc",Array.isArray(this.sortDesc)?t:t[0])},groupBy(t){this.updateOptions({groupBy:c(t)})},"internalOptions.groupBy"(t,e){!p(t,e)&&this.$emit("update:group-by",Array.isArray(this.groupBy)?t:t[0])},groupDesc(t){this.updateOptions({groupDesc:c(t)})},"internalOptions.groupDesc"(t,e){!p(t,e)&&this.$emit("update:group-desc",Array.isArray(this.groupDesc)?t:t[0])},multiSort(t){this.updateOptions({multiSort:t})},"internalOptions.multiSort"(t){this.$emit("update:multi-sort",t)},mustSort(t){this.updateOptions({mustSort:t})},"internalOptions.mustSort"(t){this.$emit("update:must-sort",t)},pageCount:{handler(t){this.$emit("page-count",t)},immediate:!0},computedItems:{handler(t){this.$emit("current-items",t)},immediate:!0},pagination:{handler(t,e){p(t,e)||this.$emit("pagination",this.pagination)},immediate:!0}},methods:{toggle(t,e,s,i,a,n){let o=e.slice(),r=s.slice();const l=o.findIndex(d=>d===t);return l<0?(n||(o=[],r=[]),o.push(t),r.push(!1)):l>=0&&!r[l]?r[l]=!0:a?r[l]=!1:(o.splice(l,1),r.splice(l,1)),(!p(o,e)||!p(r,s))&&(i=1),{by:o,desc:r,page:i}},group(t){const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.groupBy,this.internalOptions.groupDesc,this.internalOptions.page,!0,!1);this.updateOptions({groupBy:e,groupDesc:s,page:i})},sort(t){if(Array.isArray(t))return this.sortArray(t);const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.sortBy,this.internalOptions.sortDesc,this.internalOptions.page,this.internalOptions.mustSort,this.internalOptions.multiSort);this.updateOptions({sortBy:e,sortDesc:s,page:i})},sortArray(t){const e=t.map(s=>{const i=this.internalOptions.sortBy.findIndex(a=>a===s);return i>-1?this.internalOptions.sortDesc[i]:!1});this.updateOptions({sortBy:t,sortDesc:e})},updateOptions(t){this.internalOptions={...this.internalOptions,...t,page:this.serverItemsLength<0?Math.max(1,Math.min(t.page||this.internalOptions.page,this.pageCount)):t.page||this.internalOptions.page}},sortItems(t){let e=[],s=[];return this.disableSort||(e=this.internalOptions.sortBy,s=this.internalOptions.sortDesc),this.internalOptions.groupBy.length&&(e=[...this.internalOptions.groupBy,...e],s=[...this.internalOptions.groupDesc,...s]),this.customSort(t,e,s,this.locale)},groupItems(t){return this.customGroup(t,this.internalOptions.groupBy,this.internalOptions.groupDesc)},paginateItems(t){return this.serverItemsLength===-1&&t.length<=this.pageStart&&(this.internalOptions.page=Math.max(1,Math.ceil(t.length/this.internalOptions.itemsPerPage))||1),t.slice(this.pageStart,this.pageStop)}},render(){return this.$scopedSlots.default&&this.$scopedSlots.default(this.scopedProps)}});const K=g.extend({name:"v-data-footer",props:{options:{type:Object,required:!0},pagination:{type:Object,required:!0},itemsPerPageOptions:{type:Array,default:()=>[5,10,15,-1]},prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},itemsPerPageAllText:{type:String,default:"$vuetify.dataFooter.itemsPerPageAll"},showFirstLastPage:Boolean,showCurrentPage:Boolean,disablePagination:Boolean,disableItemsPerPage:Boolean,pageText:{type:String,default:"$vuetify.dataFooter.pageText"}},computed:{disableNextPageIcon(){return this.options.itemsPerPage<=0||this.options.page*this.options.itemsPerPage>=this.pagination.itemsLength||this.pagination.pageStop<0},computedDataItemsPerPageOptions(){return this.itemsPerPageOptions.map(t=>typeof t=="object"?t:this.genDataItemsPerPageOption(t))}},methods:{updateOptions(t){this.$emit("update:options",Object.assign({},this.options,t))},onFirstPage(){this.updateOptions({page:1})},onPreviousPage(){this.updateOptions({page:this.options.page-1})},onNextPage(){this.updateOptions({page:this.options.page+1})},onLastPage(){this.updateOptions({page:this.pagination.pageCount})},onChangeItemsPerPage(t){this.updateOptions({itemsPerPage:t,page:1})},genDataItemsPerPageOption(t){return{text:t===-1?this.$vuetify.lang.t(this.itemsPerPageAllText):String(t),value:t}},genItemsPerPageSelect(){let t=this.options.itemsPerPage;const e=this.computedDataItemsPerPageOptions;return e.length<=1?null:(e.find(s=>s.value===t)||(t=e[0]),this.$createElement("div",{staticClass:"v-data-footer__select"},[this.$vuetify.lang.t(this.itemsPerPageText),this.$createElement(H,{attrs:{"aria-label":this.$vuetify.lang.t(this.itemsPerPageText)},props:{disabled:this.disableItemsPerPage,items:e,value:t,hideDetails:!0,auto:!0,minWidth:"75px"},on:{input:this.onChangeItemsPerPage}})]))},genPaginationInfo(){let t=["–"];const e=this.pagination.itemsLength;let s=this.pagination.pageStart,i=this.pagination.pageStop;return this.pagination.itemsLength&&this.pagination.itemsPerPage?(s=this.pagination.pageStart+1,i=e=this.pagination.pageCount||this.options.itemsPerPage===-1,this.$vuetify.lang.t("$vuetify.dataFooter.lastPage"),this.$vuetify.rtl?this.firstIcon:this.lastIcon))),[this.$createElement("div",{staticClass:"v-data-footer__icons-before"},t),this.showCurrentPage&&this.$createElement("span",[this.options.page.toString()]),this.$createElement("div",{staticClass:"v-data-footer__icons-after"},e)]}},render(){return this.$createElement("div",{staticClass:"v-data-footer"},[u(this,"prepend"),this.genItemsPerPageSelect(),this.genPaginationInfo(),this.genIcons()])}}),B=f(E,A).extend({name:"v-data-iterator",props:{...x.options.props,itemKey:{type:String,default:"id"},value:{type:Array,default:()=>[]},singleSelect:Boolean,expanded:{type:Array,default:()=>[]},mobileBreakpoint:{...E.options.props.mobileBreakpoint,default:600},singleExpand:Boolean,loading:[Boolean,String],noResultsText:{type:String,default:"$vuetify.dataIterator.noResultsText"},noDataText:{type:String,default:"$vuetify.noDataText"},loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideDefaultFooter:Boolean,footerProps:Object,selectableKey:{type:String,default:"isSelectable"}},data:()=>({selection:{},expansion:{},internalCurrentItems:[],shiftKeyDown:!1,lastEntry:-1}),computed:{everyItem(){return!!this.selectableItems.length&&this.selectableItems.every(t=>this.isSelected(t))},someItems(){return this.selectableItems.some(t=>this.isSelected(t))},sanitizedFooterProps(){return F(this.footerProps)},selectableItems(){return this.internalCurrentItems.filter(t=>this.isSelectable(t))}},watch:{value:{handler(t){this.selection=t.reduce((e,s)=>(e[h(s,this.itemKey)]=s,e),{})},immediate:!0},selection(t,e){p(Object.keys(t),Object.keys(e))||this.$emit("input",Object.values(t))},expanded:{handler(t){this.expansion=t.reduce((e,s)=>(e[h(s,this.itemKey)]=!0,e),{})},immediate:!0},expansion(t,e){if(p(t,e))return;const s=Object.keys(t).filter(a=>t[a]),i=s.length?this.items.filter(a=>s.includes(String(h(a,this.itemKey)))):[];this.$emit("update:expanded",i)}},created(){[["disable-initial-sort","sort-by"],["filter","custom-filter"],["pagination","options"],["total-items","server-items-length"],["hide-actions","hide-default-footer"],["rows-per-page-items","footer-props.items-per-page-options"],["rows-per-page-text","footer-props.items-per-page-text"],["prev-icon","footer-props.prev-icon"],["next-icon","footer-props.next-icon"]].forEach(([s,i])=>{this.$attrs.hasOwnProperty(s)&&k(s,i,this)}),["expand","content-class","content-props","content-tag"].forEach(s=>{this.$attrs.hasOwnProperty(s)&&G(s)})},mounted(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},beforeDestroy(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},methods:{onKeyDown(t){this.shiftKeyDown=t.keyCode===_.shift||t.shiftKey},onKeyUp(t){(t.keyCode===_.shift||!t.shiftKey)&&(this.shiftKeyDown=!1)},toggleSelectAll(t){const e=Object.assign({},this.selection);for(let s=0;sh(o,this.itemKey)===a);if(this.lastEntry===-1)this.lastEntry=n;else if(this.shiftKeyDown&&!this.singleSelect&&s){const o=h(this.selectableItems[this.lastEntry],this.itemKey),r=Object.keys(this.selection).includes(String(o));this.multipleSelect(r,s,i,n)}if(this.lastEntry=n,this.singleSelect&&s){const o=Object.keys(this.selection),r=o.length&&h(this.selection[o[0]],this.itemKey);r&&r!==a&&this.$emit("item-selected",{item:this.selection[r],value:!1})}this.selection=i,s&&this.$emit("item-selected",{item:t,value:e})},multipleSelect(t=!0,e=!0,s,i){const a=ithis.select(t,s),isSelected:this.isSelected(t),expand:s=>this.expand(t,s),isExpanded:this.isExpanded(t),isMobile:this.isMobile}},genEmptyWrapper(t){return this.$createElement("div",t)},genEmpty(t,e){if(t===0&&this.loading){const s=this.$slots.loading||this.$vuetify.lang.t(this.loadingText);return this.genEmptyWrapper(s)}else if(t===0){const s=this.$slots["no-data"]||this.$vuetify.lang.t(this.noDataText);return this.genEmptyWrapper(s)}else if(e===0){const s=this.$slots["no-results"]||this.$vuetify.lang.t(this.noResultsText);return this.genEmptyWrapper(s)}return null},genItems(t){const e=this.genEmpty(t.originalItemsLength,t.pagination.itemsLength);return e?[e]:this.$scopedSlots.default?this.$scopedSlots.default({...t,isSelected:this.isSelected,select:this.select,isExpanded:this.isExpanded,isMobile:this.isMobile,expand:this.expand}):this.$scopedSlots.item?t.items.map((s,i)=>this.$scopedSlots.item(this.createItemProps(s,i))):[]},genFooter(t){if(this.hideDefaultFooter)return null;const e={props:{...this.sanitizedFooterProps,options:t.options,pagination:t.pagination},on:{"update:options":i=>t.updateOptions(i)}},s=$("footer.",this.$scopedSlots);return this.$createElement(K,{scopedSlots:s,...e})},genDefaultScopedSlot(t){const e={...t,someItems:this.someItems,everyItem:this.everyItem,toggleSelectAll:this.toggleSelectAll};return this.$createElement("div",{staticClass:"v-data-iterator"},[u(this,"header",e,!0),this.genItems(t),this.genFooter(t),u(this,"footer",e,!0)])}},render(){return this.$createElement(x,{props:this.$props,on:{"update:options":(t,e)=>!p(t,e)&&this.$emit("update:options",t),"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});const I=f().extend({directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},options:{type:Object,default:()=>({page:1,itemsPerPage:10,sortBy:[],sortDesc:[],groupBy:[],groupDesc:[],multiSort:!1,mustSort:!1})},checkboxColor:String,sortIcon:{type:String,default:"$sort"},everyItem:Boolean,someItems:Boolean,showGroupBy:Boolean,singleSelect:Boolean,disableSort:Boolean},methods:{genSelectAll(){var t;const e={props:{value:this.everyItem,indeterminate:!this.everyItem&&this.someItems,color:(t=this.checkboxColor)!==null&&t!==void 0?t:""},on:{input:s=>this.$emit("toggle-select-all",s)}};return this.$scopedSlots["data-table-select"]?this.$scopedSlots["data-table-select"](e):this.$createElement(M,{staticClass:"v-data-table__checkbox",...e})},genSortIcon(){return this.$createElement(b,{staticClass:"v-data-table-header__icon",props:{size:18}},[this.sortIcon])}}}),J=f(I).extend({name:"v-data-table-header-mobile",props:{sortByText:{type:String,default:"$vuetify.dataTable.sortBy"}},methods:{genSortChip(t){const e=[t.item.text],s=this.options.sortBy.findIndex(n=>n===t.item.value),i=s>=0,a=this.options.sortDesc[s];return e.push(this.$createElement("div",{staticClass:"v-chip__close",class:{sortable:!0,active:i,asc:i&&!a,desc:i&&a}},[this.genSortIcon()])),this.$createElement(q,{staticClass:"sortable",on:{click:n=>{n.stopPropagation(),this.$emit("sort",t.item.value)}}},e)},genSortSelect(t){return this.$createElement(H,{props:{label:this.$vuetify.lang.t(this.sortByText),items:t,hideDetails:!0,multiple:this.options.multiSort,value:this.options.multiSort?this.options.sortBy:this.options.sortBy[0],menuProps:{closeOnContentClick:!0}},on:{change:e=>this.$emit("sort",e)},scopedSlots:{selection:e=>this.genSortChip(e)}})}},render(t){const e=[],s=this.headers.find(o=>o.value==="data-table-select");s&&!this.singleSelect&&e.push(this.$createElement("div",{class:["v-data-table-header-mobile__select",...c(s.class)],attrs:{width:s.width}},[this.genSelectAll()]));const i=this.headers.filter(o=>o.sortable!==!1&&o.value!=="data-table-select").map(o=>({text:o.text,value:o.value}));!this.disableSort&&i.length&&e.push(this.genSortSelect(i));const a=e.length?t("th",[t("div",{staticClass:"v-data-table-header-mobile__wrapper"},e)]):void 0,n=t("tr",[a]);return t("thead",{staticClass:"v-data-table-header v-data-table-header-mobile"},[n])}}),Q=f(I).extend({name:"v-data-table-header-desktop",methods:{genGroupByToggle(t){return this.$createElement("span",{on:{click:e=>{e.stopPropagation(),this.$emit("group",t.value)}}},["group"])},getAria(t,e){const s=n=>this.$vuetify.lang.t(`$vuetify.dataTable.ariaLabel.${n}`);let i="none",a=[s("sortNone"),s("activateAscending")];return t?(e?(i="descending",a=[s("sortDescending"),s(this.options.mustSort?"activateAscending":"activateNone")]):(i="ascending",a=[s("sortAscending"),s("activateDescending")]),{ariaSort:i,ariaLabel:a.join(" ")}):{ariaSort:i,ariaLabel:a.join(" ")}},genHeader(t){const e={attrs:{role:"columnheader",scope:"col","aria-label":t.text||""},style:{width:P(t.width),minWidth:P(t.width)},class:[`text-${t.align||"start"}`,...c(t.class),t.divider&&"v-data-table__divider"],on:{}},s=[];if(t.value==="data-table-select"&&!this.singleSelect)return this.$createElement("th",e,[this.genSelectAll()]);if(s.push(this.$scopedSlots.hasOwnProperty(t.value)?this.$scopedSlots[t.value]({header:t}):this.$createElement("span",[t.text])),!this.disableSort&&(t.sortable||!t.hasOwnProperty("sortable"))){e.on.click=()=>this.$emit("sort",t.value);const i=this.options.sortBy.findIndex(l=>l===t.value),a=i>=0,n=this.options.sortDesc[i];e.class.push("sortable");const{ariaLabel:o,ariaSort:r}=this.getAria(a,n);e.attrs["aria-label"]+=`${t.text?": ":""}${o}`,e.attrs["aria-sort"]=r,a&&(e.class.push("active"),e.class.push(n?"desc":"asc")),t.align==="end"?s.unshift(this.genSortIcon()):s.push(this.genSortIcon()),this.options.multiSort&&a&&s.push(this.$createElement("span",{class:"v-data-table-header__sort-badge"},[String(i+1)]))}return this.showGroupBy&&t.groupable!==!1&&s.push(this.genGroupByToggle(t)),this.$createElement("th",e,s)}},render(){return this.$createElement("thead",{staticClass:"v-data-table-header"},[this.$createElement("tr",this.headers.map(t=>this.genHeader(t)))])}});function X(t){if(t.model&&t.on&&t.on.input)if(Array.isArray(t.on.input)){const e=t.on.input.indexOf(t.model.callback);e>-1&&t.on.input.splice(e,1)}else delete t.on.input}function Y(t,e){const s=[];for(const i in t)t.hasOwnProperty(i)&&s.push(e("template",{slot:i},t[i]));return s}const Z=g.extend({name:"v-data-table-header",functional:!0,props:{...I.options.props,mobile:Boolean},render(t,{props:e,data:s,slots:i}){X(s);const a=Y(i(),t);return s=N(s,{props:e}),e.mobile?t(J,s,a):t(Q,s,a)}});function tt(t){var e;return t.length!==1||!["td","th"].includes((e=t[0])===null||e===void 0?void 0:e.tag)}const et=g.extend({name:"row",functional:!0,props:{headers:Array,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r=[],l=h(e.item,o.value),d=o.value,m=i.scopedSlots&&i.scopedSlots.hasOwnProperty(d)&&i.scopedSlots[d],y=a.hasOwnProperty(d)&&a[d];m?r.push(...c(m({item:e.item,isMobile:!1,header:o,index:e.index,value:l}))):y?r.push(...c(y)):r.push(l==null?l:String(l));const S=`text-${o.align||"start"}`;return tt(r)?t("td",{class:[S,o.cellClass,{"v-data-table__divider":o.divider}]},r):r});return t("tr",i,n)}}),D=g.extend({name:"row-group",functional:!0,props:{value:{type:Boolean,default:!0},headerClass:{type:String,default:"v-row-group__header"},contentClass:String,summaryClass:{type:String,default:"v-row-group__summary"}},render(t,{slots:e,props:s}){const i=e(),a=[];return i["column.header"]?a.push(t("tr",{staticClass:s.headerClass},i["column.header"])):i["row.header"]&&a.push(...i["row.header"]),i["row.content"]&&s.value&&a.push(...i["row.content"]),i["column.summary"]?a.push(t("tr",{staticClass:s.summaryClass},i["column.summary"])):i["row.summary"]&&a.push(...i["row.summary"]),a}});const st=f(A).extend({name:"v-simple-table",props:{dense:Boolean,fixedHeader:Boolean,height:[Number,String]},computed:{classes(){return{"v-data-table--dense":this.dense,"v-data-table--fixed-height":!!this.height&&!this.fixedHeader,"v-data-table--fixed-header":this.fixedHeader,"v-data-table--has-top":!!this.$slots.top,"v-data-table--has-bottom":!!this.$slots.bottom,...this.themeClasses}}},methods:{genWrapper(){return this.$slots.wrapper||this.$createElement("div",{staticClass:"v-data-table__wrapper",style:{height:P(this.height)}},[this.$createElement("table",this.$slots.default)])}},render(t){return t("div",{staticClass:"v-data-table",class:this.classes},[this.$slots.top,this.genWrapper(),this.$slots.bottom])}}),it=g.extend({name:"row",functional:!0,props:{headers:Array,hideDefaultHeader:Boolean,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r={"v-data-table__mobile-row":!0},l=[],d=h(e.item,o.value),m=o.value,y=i.scopedSlots&&i.scopedSlots.hasOwnProperty(m)&&i.scopedSlots[m],S=a.hasOwnProperty(m)&&a[m];y?l.push(y({item:e.item,isMobile:!0,header:o,index:e.index,value:d})):S?l.push(S):l.push(d==null?d:String(d));const O=[t("div",{staticClass:"v-data-table__mobile-row__cell"},l)];return o.value!=="dataTableSelect"&&!e.hideDefaultHeader&&O.unshift(t("div",{staticClass:"v-data-table__mobile-row__header"},[o.text])),t("td",{class:r},O)});return t("tr",{...i,staticClass:"v-data-table__mobile-table-row"},n)}});function C(t,e,s){return i=>{const a=h(t,i.value);return i.filter?i.filter(a,e,t):s(a,e,t)}}function at(t,e,s,i,a){return e=typeof e=="string"?e.trim():null,t.filter(n=>{const o=s.every(C(n,e,T)),r=!e||i.some(C(n,e,a));return o&&r})}const rt=f(B,V).extend({name:"v-data-table",directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},showSelect:Boolean,checkboxColor:String,showExpand:Boolean,showGroupBy:Boolean,height:[Number,String],hideDefaultHeader:Boolean,caption:String,dense:Boolean,headerProps:Object,calculateWidths:Boolean,fixedHeader:Boolean,headersLength:Number,expandIcon:{type:String,default:"$expand"},customFilter:{type:Function,default:T},itemClass:{type:[String,Function],default:()=>""},loaderHeight:{type:[Number,String],default:4}},data(){return{internalGroupBy:[],openCache:{},widths:[]}},computed:{computedHeaders(){if(!this.headers)return[];const t=this.headers.filter(s=>s.value===void 0||!this.internalGroupBy.find(i=>i===s.value)),e={text:"",sortable:!1,width:"1px"};if(this.showSelect){const s=t.findIndex(i=>i.value==="data-table-select");s<0?t.unshift({...e,value:"data-table-select"}):t.splice(s,1,{...e,...t[s]})}if(this.showExpand){const s=t.findIndex(i=>i.value==="data-table-expand");s<0?t.unshift({...e,value:"data-table-expand"}):t.splice(s,1,{...e,...t[s]})}return t},colspanAttrs(){return this.isMobile?void 0:{colspan:this.headersLength||this.computedHeaders.length}},columnSorters(){return this.computedHeaders.reduce((t,e)=>(e.sort&&(t[e.value]=e.sort),t),{})},headersWithCustomFilters(){return this.headers.filter(t=>t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},headersWithoutCustomFilters(){return this.headers.filter(t=>!t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},sanitizedHeaderProps(){return F(this.headerProps)},computedItemsPerPage(){const t=this.options&&this.options.itemsPerPage?this.options.itemsPerPage:this.itemsPerPage,e=this.sanitizedFooterProps.itemsPerPageOptions;if(e&&!e.find(s=>typeof s=="number"?s===t:s.value===t)){const s=e[0];return typeof s=="object"?s.value:s}return t},groupByText(){var t,e,s;return(s=(e=(t=this.headers)===null||t===void 0?void 0:t.find(i=>{var a;return i.value===((a=this.internalGroupBy)===null||a===void 0?void 0:a[0])}))===null||e===void 0?void 0:e.text)!==null&&s!==void 0?s:""}},created(){[["sort-icon","header-props.sort-icon"],["hide-headers","hide-default-header"],["select-all","show-select"]].forEach(([e,s])=>{this.$attrs.hasOwnProperty(e)&&k(e,s,this)})},mounted(){this.calculateWidths&&(window.addEventListener("resize",this.calcWidths),this.calcWidths())},beforeDestroy(){this.calculateWidths&&window.removeEventListener("resize",this.calcWidths)},methods:{calcWidths(){this.widths=Array.from(this.$el.querySelectorAll("th")).map(t=>t.clientWidth)},customFilterWithColumns(t,e){return at(t,e,this.headersWithCustomFilters,this.headersWithoutCustomFilters,this.customFilter)},customSortWithHeaders(t,e,s,i){return this.customSort(t,e,s,i,this.columnSorters)},createItemProps(t,e){const s=B.options.methods.createItemProps.call(this,t,e);return Object.assign(s,{headers:this.computedHeaders})},genCaption(t){return this.caption?[this.$createElement("caption",[this.caption])]:u(this,"caption",t,!0)},genColgroup(t){return this.$createElement("colgroup",this.computedHeaders.map(e=>this.$createElement("col",{class:{divider:e.divider}})))},genLoading(){const t=this.$createElement("th",{staticClass:"column",attrs:this.colspanAttrs},[this.genProgress()]),e=this.$createElement("tr",{staticClass:"v-data-table__progress"},[t]);return this.$createElement("thead",[e])},genHeaders(t){const e={props:{...this.sanitizedHeaderProps,headers:this.computedHeaders,options:t.options,mobile:this.isMobile,showGroupBy:this.showGroupBy,checkboxColor:this.checkboxColor,someItems:this.someItems,everyItem:this.everyItem,singleSelect:this.singleSelect,disableSort:this.disableSort},on:{sort:t.sort,group:t.group,"toggle-select-all":this.toggleSelectAll}},s=[u(this,"header",{...e,isMobile:this.isMobile})];if(!this.hideDefaultHeader){const i=$("header.",this.$scopedSlots);s.push(this.$createElement(Z,{...e,scopedSlots:i}))}return this.loading&&s.push(this.genLoading()),s},genEmptyWrapper(t){return this.$createElement("tr",{staticClass:"v-data-table__empty-wrapper"},[this.$createElement("td",{attrs:this.colspanAttrs},t)])},genItems(t,e){const s=this.genEmpty(e.originalItemsLength,e.pagination.itemsLength);return s?[s]:e.groupedItems?this.genGroupedRows(e.groupedItems,e):this.genRows(t,e)},genGroupedRows(t,e){return t.map(s=>(this.openCache.hasOwnProperty(s.name)||this.$set(this.openCache,s.name,!0),this.$scopedSlots.group?this.$scopedSlots.group({group:s.name,options:e.options,isMobile:this.isMobile,items:s.items,headers:this.computedHeaders}):this.genDefaultGroupedRow(s.name,s.items,e)))},genDefaultGroupedRow(t,e,s){const i=!!this.openCache[t],a=[this.$createElement("template",{slot:"row.content"},this.genRows(e,s))],n=()=>this.$set(this.openCache,t,!this.openCache[t]),o=()=>s.updateOptions({groupBy:[],groupDesc:[]});if(this.$scopedSlots["group.header"])a.unshift(this.$createElement("template",{slot:"column.header"},[this.$scopedSlots["group.header"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n,remove:o})]));else{const r=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:n}},[this.$createElement(b,[i?"$minus":"$plus"])]),l=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:o}},[this.$createElement(b,["$close"])]),d=this.$createElement("td",{staticClass:"text-start",attrs:this.colspanAttrs},[r,`${this.groupByText}: ${t}`,l]);a.unshift(this.$createElement("template",{slot:"column.header"},[d]))}return this.$scopedSlots["group.summary"]&&a.push(this.$createElement("template",{slot:"column.summary"},[this.$scopedSlots["group.summary"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n})])),this.$createElement(D,{key:t,props:{value:i}},a)},genRows(t,e){return this.$scopedSlots.item?this.genScopedRows(t,e):this.genDefaultRows(t,e)},genScopedRows(t,e){const s=[];for(let i=0;ithis.genDefaultExpandedRow(s,i)):t.map((s,i)=>this.genDefaultSimpleRow(s,i))},genDefaultExpandedRow(t,e){const s=this.isExpanded(t),i={"v-data-table__expanded v-data-table__expanded__row":s},a=this.genDefaultSimpleRow(t,e,i),n=this.$createElement("tr",{staticClass:"v-data-table__expanded v-data-table__expanded__content"},[this.$scopedSlots["expanded-item"]({headers:this.computedHeaders,isMobile:this.isMobile,item:t})]);return this.$createElement(D,{props:{value:s}},[this.$createElement("template",{slot:"row.header"},[a]),this.$createElement("template",{slot:"row.content"},[n])])},genDefaultSimpleRow(t,e,s={}){const i=$("item.",this.$scopedSlots),a=this.createItemProps(t,e);if(this.showSelect){const n=i["data-table-select"];i["data-table-select"]=n?()=>n({...a,isMobile:this.isMobile}):()=>{var o;return this.$createElement(M,{staticClass:"v-data-table__checkbox",props:{value:a.isSelected,disabled:!this.isSelectable(t),color:(o=this.checkboxColor)!==null&&o!==void 0?o:""},on:{input:r=>a.select(r)}})}}if(this.showExpand){const n=i["data-table-expand"];i["data-table-expand"]=n?()=>n(a):()=>this.$createElement(b,{staticClass:"v-data-table__expand-icon",class:{"v-data-table__expand-icon--active":a.isExpanded},on:{click:o=>{o.stopPropagation(),a.expand(!a.isExpanded)}}},[this.expandIcon])}return this.$createElement(this.isMobile?it:et,{key:h(t,this.itemKey),class:z({...s,"v-data-table__selected":a.isSelected},U(t,this.itemClass)),props:{headers:this.computedHeaders,hideDefaultHeader:this.hideDefaultHeader,index:e,item:t,rtl:this.$vuetify.rtl},scopedSlots:i,on:{click:n=>this.$emit("click:row",t,a,n),contextmenu:n=>this.$emit("contextmenu:row",n,a),dblclick:n=>this.$emit("dblclick:row",n,a)}})},genBody(t){const e={...t,expand:this.expand,headers:this.computedHeaders,isExpanded:this.isExpanded,isMobile:this.isMobile,isSelected:this.isSelected,select:this.select};return this.$scopedSlots.body?this.$scopedSlots.body(e):this.$createElement("tbody",[u(this,"body.prepend",e,!0),this.genItems(t.items,t),u(this,"body.append",e,!0)])},genFoot(t){var e,s;return(s=(e=this.$scopedSlots).foot)===null||s===void 0?void 0:s.call(e,t)},genFooters(t){const e={props:{options:t.options,pagination:t.pagination,itemsPerPageText:"$vuetify.dataTable.itemsPerPageText",...this.sanitizedFooterProps},on:{"update:options":i=>t.updateOptions(i)},widths:this.widths,headers:this.computedHeaders},s=[u(this,"footer",e,!0)];return this.hideDefaultFooter||s.push(this.$createElement(K,{...e,scopedSlots:$("footer.",this.$scopedSlots)})),s},genDefaultScopedSlot(t){const e={height:this.height,fixedHeader:this.fixedHeader,dense:this.dense};return this.$createElement(st,{props:e,class:{"v-data-table--mobile":this.isMobile}},[this.proxySlot("top",u(this,"top",{...t,isMobile:this.isMobile},!0)),this.genCaption(t),this.genColgroup(t),this.genHeaders(t),this.genBody(t),this.genFoot(t),this.proxySlot("bottom",this.genFooters(t))])},proxySlot(t,e){return this.$createElement("template",{slot:t},e)}},render(){return this.$createElement(x,{props:{...this.$props,customFilter:this.customFilterWithColumns,customSort:this.customSortWithHeaders,itemsPerPage:this.computedItemsPerPage},on:{"update:options":(t,e)=>{this.internalGroupBy=t.groupBy||[],!p(t,e)&&this.$emit("update:options",t)},"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});export{rt as _}; +import{I as g,bw as R,bx as j,by as W,S as c,bz as w,a0 as p,a as v,b,b6 as u,J as f,T as A,a_ as E,bA as F,X as h,aQ as k,bB as G,aH as _,bC as $,b7 as L,R as P,aI as N,b8 as V,bD as T,bE as z,aG as U}from"./index-e409ba63.js";import{V as H,b as M,a as q}from"./VSelect-22e7980f.js";const x=g.extend({name:"v-data",inheritAttrs:!1,props:{items:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})},sortBy:{type:[String,Array]},sortDesc:{type:[Boolean,Array]},customSort:{type:Function,default:R},mustSort:Boolean,multiSort:Boolean,page:{type:Number,default:1},itemsPerPage:{type:Number,default:10},groupBy:{type:[String,Array],default:()=>[]},groupDesc:{type:[Boolean,Array],default:()=>[]},customGroup:{type:Function,default:j},locale:{type:String,default:"en-US"},disableSort:Boolean,disablePagination:Boolean,disableFiltering:Boolean,search:String,customFilter:{type:Function,default:W},serverItemsLength:{type:Number,default:-1}},data(){let t={page:this.page,itemsPerPage:this.itemsPerPage,sortBy:c(this.sortBy),sortDesc:c(this.sortDesc),groupBy:c(this.groupBy),groupDesc:c(this.groupDesc),mustSort:this.mustSort,multiSort:this.multiSort};this.options&&(t=Object.assign(t,this.options));const{sortBy:e,sortDesc:s,groupBy:i,groupDesc:a}=t,n=e.length-s.length,o=i.length-a.length;return n>0&&t.sortDesc.push(...w(n,!1)),o>0&&t.groupDesc.push(...w(o,!1)),{internalOptions:t}},computed:{itemsLength(){return this.serverItemsLength>=0?this.serverItemsLength:this.filteredItems.length},pageCount(){return this.internalOptions.itemsPerPage<=0?1:Math.ceil(this.itemsLength/this.internalOptions.itemsPerPage)},pageStart(){return this.internalOptions.itemsPerPage===-1||!this.items.length?0:(this.internalOptions.page-1)*this.internalOptions.itemsPerPage},pageStop(){return this.internalOptions.itemsPerPage===-1?this.itemsLength:this.items.length?Math.min(this.itemsLength,this.internalOptions.page*this.internalOptions.itemsPerPage):0},isGrouped(){return!!this.internalOptions.groupBy.length},pagination(){return{page:this.internalOptions.page,itemsPerPage:this.internalOptions.itemsPerPage,pageStart:this.pageStart,pageStop:this.pageStop,pageCount:this.pageCount,itemsLength:this.itemsLength}},filteredItems(){let t=this.items.slice();return!this.disableFiltering&&this.serverItemsLength<=0&&(t=this.customFilter(t,this.search)),t},computedItems(){let t=this.filteredItems.slice();return(!this.disableSort||this.internalOptions.groupBy.length)&&this.serverItemsLength<=0&&(t=this.sortItems(t)),!this.disablePagination&&this.serverItemsLength<=0&&(t=this.paginateItems(t)),t},groupedItems(){return this.isGrouped?this.groupItems(this.computedItems):null},scopedProps(){return{sort:this.sort,sortArray:this.sortArray,group:this.group,items:this.computedItems,options:this.internalOptions,updateOptions:this.updateOptions,pagination:this.pagination,groupedItems:this.groupedItems,originalItemsLength:this.items.length}},computedOptions(){return{...this.options}}},watch:{computedOptions:{handler(t,e){p(t,e)||this.updateOptions(t)},deep:!0,immediate:!0},internalOptions:{handler(t,e){p(t,e)||this.$emit("update:options",t)},deep:!0,immediate:!0},page(t){this.updateOptions({page:t})},"internalOptions.page"(t){this.$emit("update:page",t)},itemsPerPage(t){this.updateOptions({itemsPerPage:t})},"internalOptions.itemsPerPage"(t){this.$emit("update:items-per-page",t)},sortBy(t){this.updateOptions({sortBy:c(t)})},"internalOptions.sortBy"(t,e){!p(t,e)&&this.$emit("update:sort-by",Array.isArray(this.sortBy)?t:t[0])},sortDesc(t){this.updateOptions({sortDesc:c(t)})},"internalOptions.sortDesc"(t,e){!p(t,e)&&this.$emit("update:sort-desc",Array.isArray(this.sortDesc)?t:t[0])},groupBy(t){this.updateOptions({groupBy:c(t)})},"internalOptions.groupBy"(t,e){!p(t,e)&&this.$emit("update:group-by",Array.isArray(this.groupBy)?t:t[0])},groupDesc(t){this.updateOptions({groupDesc:c(t)})},"internalOptions.groupDesc"(t,e){!p(t,e)&&this.$emit("update:group-desc",Array.isArray(this.groupDesc)?t:t[0])},multiSort(t){this.updateOptions({multiSort:t})},"internalOptions.multiSort"(t){this.$emit("update:multi-sort",t)},mustSort(t){this.updateOptions({mustSort:t})},"internalOptions.mustSort"(t){this.$emit("update:must-sort",t)},pageCount:{handler(t){this.$emit("page-count",t)},immediate:!0},computedItems:{handler(t){this.$emit("current-items",t)},immediate:!0},pagination:{handler(t,e){p(t,e)||this.$emit("pagination",this.pagination)},immediate:!0}},methods:{toggle(t,e,s,i,a,n){let o=e.slice(),r=s.slice();const l=o.findIndex(d=>d===t);return l<0?(n||(o=[],r=[]),o.push(t),r.push(!1)):l>=0&&!r[l]?r[l]=!0:a?r[l]=!1:(o.splice(l,1),r.splice(l,1)),(!p(o,e)||!p(r,s))&&(i=1),{by:o,desc:r,page:i}},group(t){const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.groupBy,this.internalOptions.groupDesc,this.internalOptions.page,!0,!1);this.updateOptions({groupBy:e,groupDesc:s,page:i})},sort(t){if(Array.isArray(t))return this.sortArray(t);const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.sortBy,this.internalOptions.sortDesc,this.internalOptions.page,this.internalOptions.mustSort,this.internalOptions.multiSort);this.updateOptions({sortBy:e,sortDesc:s,page:i})},sortArray(t){const e=t.map(s=>{const i=this.internalOptions.sortBy.findIndex(a=>a===s);return i>-1?this.internalOptions.sortDesc[i]:!1});this.updateOptions({sortBy:t,sortDesc:e})},updateOptions(t){this.internalOptions={...this.internalOptions,...t,page:this.serverItemsLength<0?Math.max(1,Math.min(t.page||this.internalOptions.page,this.pageCount)):t.page||this.internalOptions.page}},sortItems(t){let e=[],s=[];return this.disableSort||(e=this.internalOptions.sortBy,s=this.internalOptions.sortDesc),this.internalOptions.groupBy.length&&(e=[...this.internalOptions.groupBy,...e],s=[...this.internalOptions.groupDesc,...s]),this.customSort(t,e,s,this.locale)},groupItems(t){return this.customGroup(t,this.internalOptions.groupBy,this.internalOptions.groupDesc)},paginateItems(t){return this.serverItemsLength===-1&&t.length<=this.pageStart&&(this.internalOptions.page=Math.max(1,Math.ceil(t.length/this.internalOptions.itemsPerPage))||1),t.slice(this.pageStart,this.pageStop)}},render(){return this.$scopedSlots.default&&this.$scopedSlots.default(this.scopedProps)}});const K=g.extend({name:"v-data-footer",props:{options:{type:Object,required:!0},pagination:{type:Object,required:!0},itemsPerPageOptions:{type:Array,default:()=>[5,10,15,-1]},prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},itemsPerPageAllText:{type:String,default:"$vuetify.dataFooter.itemsPerPageAll"},showFirstLastPage:Boolean,showCurrentPage:Boolean,disablePagination:Boolean,disableItemsPerPage:Boolean,pageText:{type:String,default:"$vuetify.dataFooter.pageText"}},computed:{disableNextPageIcon(){return this.options.itemsPerPage<=0||this.options.page*this.options.itemsPerPage>=this.pagination.itemsLength||this.pagination.pageStop<0},computedDataItemsPerPageOptions(){return this.itemsPerPageOptions.map(t=>typeof t=="object"?t:this.genDataItemsPerPageOption(t))}},methods:{updateOptions(t){this.$emit("update:options",Object.assign({},this.options,t))},onFirstPage(){this.updateOptions({page:1})},onPreviousPage(){this.updateOptions({page:this.options.page-1})},onNextPage(){this.updateOptions({page:this.options.page+1})},onLastPage(){this.updateOptions({page:this.pagination.pageCount})},onChangeItemsPerPage(t){this.updateOptions({itemsPerPage:t,page:1})},genDataItemsPerPageOption(t){return{text:t===-1?this.$vuetify.lang.t(this.itemsPerPageAllText):String(t),value:t}},genItemsPerPageSelect(){let t=this.options.itemsPerPage;const e=this.computedDataItemsPerPageOptions;return e.length<=1?null:(e.find(s=>s.value===t)||(t=e[0]),this.$createElement("div",{staticClass:"v-data-footer__select"},[this.$vuetify.lang.t(this.itemsPerPageText),this.$createElement(H,{attrs:{"aria-label":this.$vuetify.lang.t(this.itemsPerPageText)},props:{disabled:this.disableItemsPerPage,items:e,value:t,hideDetails:!0,auto:!0,minWidth:"75px"},on:{input:this.onChangeItemsPerPage}})]))},genPaginationInfo(){let t=["–"];const e=this.pagination.itemsLength;let s=this.pagination.pageStart,i=this.pagination.pageStop;return this.pagination.itemsLength&&this.pagination.itemsPerPage?(s=this.pagination.pageStart+1,i=e=this.pagination.pageCount||this.options.itemsPerPage===-1,this.$vuetify.lang.t("$vuetify.dataFooter.lastPage"),this.$vuetify.rtl?this.firstIcon:this.lastIcon))),[this.$createElement("div",{staticClass:"v-data-footer__icons-before"},t),this.showCurrentPage&&this.$createElement("span",[this.options.page.toString()]),this.$createElement("div",{staticClass:"v-data-footer__icons-after"},e)]}},render(){return this.$createElement("div",{staticClass:"v-data-footer"},[u(this,"prepend"),this.genItemsPerPageSelect(),this.genPaginationInfo(),this.genIcons()])}}),B=f(E,A).extend({name:"v-data-iterator",props:{...x.options.props,itemKey:{type:String,default:"id"},value:{type:Array,default:()=>[]},singleSelect:Boolean,expanded:{type:Array,default:()=>[]},mobileBreakpoint:{...E.options.props.mobileBreakpoint,default:600},singleExpand:Boolean,loading:[Boolean,String],noResultsText:{type:String,default:"$vuetify.dataIterator.noResultsText"},noDataText:{type:String,default:"$vuetify.noDataText"},loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideDefaultFooter:Boolean,footerProps:Object,selectableKey:{type:String,default:"isSelectable"}},data:()=>({selection:{},expansion:{},internalCurrentItems:[],shiftKeyDown:!1,lastEntry:-1}),computed:{everyItem(){return!!this.selectableItems.length&&this.selectableItems.every(t=>this.isSelected(t))},someItems(){return this.selectableItems.some(t=>this.isSelected(t))},sanitizedFooterProps(){return F(this.footerProps)},selectableItems(){return this.internalCurrentItems.filter(t=>this.isSelectable(t))}},watch:{value:{handler(t){this.selection=t.reduce((e,s)=>(e[h(s,this.itemKey)]=s,e),{})},immediate:!0},selection(t,e){p(Object.keys(t),Object.keys(e))||this.$emit("input",Object.values(t))},expanded:{handler(t){this.expansion=t.reduce((e,s)=>(e[h(s,this.itemKey)]=!0,e),{})},immediate:!0},expansion(t,e){if(p(t,e))return;const s=Object.keys(t).filter(a=>t[a]),i=s.length?this.items.filter(a=>s.includes(String(h(a,this.itemKey)))):[];this.$emit("update:expanded",i)}},created(){[["disable-initial-sort","sort-by"],["filter","custom-filter"],["pagination","options"],["total-items","server-items-length"],["hide-actions","hide-default-footer"],["rows-per-page-items","footer-props.items-per-page-options"],["rows-per-page-text","footer-props.items-per-page-text"],["prev-icon","footer-props.prev-icon"],["next-icon","footer-props.next-icon"]].forEach(([s,i])=>{this.$attrs.hasOwnProperty(s)&&k(s,i,this)}),["expand","content-class","content-props","content-tag"].forEach(s=>{this.$attrs.hasOwnProperty(s)&&G(s)})},mounted(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},beforeDestroy(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},methods:{onKeyDown(t){this.shiftKeyDown=t.keyCode===_.shift||t.shiftKey},onKeyUp(t){(t.keyCode===_.shift||!t.shiftKey)&&(this.shiftKeyDown=!1)},toggleSelectAll(t){const e=Object.assign({},this.selection);for(let s=0;sh(o,this.itemKey)===a);if(this.lastEntry===-1)this.lastEntry=n;else if(this.shiftKeyDown&&!this.singleSelect&&s){const o=h(this.selectableItems[this.lastEntry],this.itemKey),r=Object.keys(this.selection).includes(String(o));this.multipleSelect(r,s,i,n)}if(this.lastEntry=n,this.singleSelect&&s){const o=Object.keys(this.selection),r=o.length&&h(this.selection[o[0]],this.itemKey);r&&r!==a&&this.$emit("item-selected",{item:this.selection[r],value:!1})}this.selection=i,s&&this.$emit("item-selected",{item:t,value:e})},multipleSelect(t=!0,e=!0,s,i){const a=ithis.select(t,s),isSelected:this.isSelected(t),expand:s=>this.expand(t,s),isExpanded:this.isExpanded(t),isMobile:this.isMobile}},genEmptyWrapper(t){return this.$createElement("div",t)},genEmpty(t,e){if(t===0&&this.loading){const s=this.$slots.loading||this.$vuetify.lang.t(this.loadingText);return this.genEmptyWrapper(s)}else if(t===0){const s=this.$slots["no-data"]||this.$vuetify.lang.t(this.noDataText);return this.genEmptyWrapper(s)}else if(e===0){const s=this.$slots["no-results"]||this.$vuetify.lang.t(this.noResultsText);return this.genEmptyWrapper(s)}return null},genItems(t){const e=this.genEmpty(t.originalItemsLength,t.pagination.itemsLength);return e?[e]:this.$scopedSlots.default?this.$scopedSlots.default({...t,isSelected:this.isSelected,select:this.select,isExpanded:this.isExpanded,isMobile:this.isMobile,expand:this.expand}):this.$scopedSlots.item?t.items.map((s,i)=>this.$scopedSlots.item(this.createItemProps(s,i))):[]},genFooter(t){if(this.hideDefaultFooter)return null;const e={props:{...this.sanitizedFooterProps,options:t.options,pagination:t.pagination},on:{"update:options":i=>t.updateOptions(i)}},s=$("footer.",this.$scopedSlots);return this.$createElement(K,{scopedSlots:s,...e})},genDefaultScopedSlot(t){const e={...t,someItems:this.someItems,everyItem:this.everyItem,toggleSelectAll:this.toggleSelectAll};return this.$createElement("div",{staticClass:"v-data-iterator"},[u(this,"header",e,!0),this.genItems(t),this.genFooter(t),u(this,"footer",e,!0)])}},render(){return this.$createElement(x,{props:this.$props,on:{"update:options":(t,e)=>!p(t,e)&&this.$emit("update:options",t),"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});const I=f().extend({directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},options:{type:Object,default:()=>({page:1,itemsPerPage:10,sortBy:[],sortDesc:[],groupBy:[],groupDesc:[],multiSort:!1,mustSort:!1})},checkboxColor:String,sortIcon:{type:String,default:"$sort"},everyItem:Boolean,someItems:Boolean,showGroupBy:Boolean,singleSelect:Boolean,disableSort:Boolean},methods:{genSelectAll(){var t;const e={props:{value:this.everyItem,indeterminate:!this.everyItem&&this.someItems,color:(t=this.checkboxColor)!==null&&t!==void 0?t:""},on:{input:s=>this.$emit("toggle-select-all",s)}};return this.$scopedSlots["data-table-select"]?this.$scopedSlots["data-table-select"](e):this.$createElement(M,{staticClass:"v-data-table__checkbox",...e})},genSortIcon(){return this.$createElement(b,{staticClass:"v-data-table-header__icon",props:{size:18}},[this.sortIcon])}}}),J=f(I).extend({name:"v-data-table-header-mobile",props:{sortByText:{type:String,default:"$vuetify.dataTable.sortBy"}},methods:{genSortChip(t){const e=[t.item.text],s=this.options.sortBy.findIndex(n=>n===t.item.value),i=s>=0,a=this.options.sortDesc[s];return e.push(this.$createElement("div",{staticClass:"v-chip__close",class:{sortable:!0,active:i,asc:i&&!a,desc:i&&a}},[this.genSortIcon()])),this.$createElement(q,{staticClass:"sortable",on:{click:n=>{n.stopPropagation(),this.$emit("sort",t.item.value)}}},e)},genSortSelect(t){return this.$createElement(H,{props:{label:this.$vuetify.lang.t(this.sortByText),items:t,hideDetails:!0,multiple:this.options.multiSort,value:this.options.multiSort?this.options.sortBy:this.options.sortBy[0],menuProps:{closeOnContentClick:!0}},on:{change:e=>this.$emit("sort",e)},scopedSlots:{selection:e=>this.genSortChip(e)}})}},render(t){const e=[],s=this.headers.find(o=>o.value==="data-table-select");s&&!this.singleSelect&&e.push(this.$createElement("div",{class:["v-data-table-header-mobile__select",...c(s.class)],attrs:{width:s.width}},[this.genSelectAll()]));const i=this.headers.filter(o=>o.sortable!==!1&&o.value!=="data-table-select").map(o=>({text:o.text,value:o.value}));!this.disableSort&&i.length&&e.push(this.genSortSelect(i));const a=e.length?t("th",[t("div",{staticClass:"v-data-table-header-mobile__wrapper"},e)]):void 0,n=t("tr",[a]);return t("thead",{staticClass:"v-data-table-header v-data-table-header-mobile"},[n])}}),Q=f(I).extend({name:"v-data-table-header-desktop",methods:{genGroupByToggle(t){return this.$createElement("span",{on:{click:e=>{e.stopPropagation(),this.$emit("group",t.value)}}},["group"])},getAria(t,e){const s=n=>this.$vuetify.lang.t(`$vuetify.dataTable.ariaLabel.${n}`);let i="none",a=[s("sortNone"),s("activateAscending")];return t?(e?(i="descending",a=[s("sortDescending"),s(this.options.mustSort?"activateAscending":"activateNone")]):(i="ascending",a=[s("sortAscending"),s("activateDescending")]),{ariaSort:i,ariaLabel:a.join(" ")}):{ariaSort:i,ariaLabel:a.join(" ")}},genHeader(t){const e={attrs:{role:"columnheader",scope:"col","aria-label":t.text||""},style:{width:P(t.width),minWidth:P(t.width)},class:[`text-${t.align||"start"}`,...c(t.class),t.divider&&"v-data-table__divider"],on:{}},s=[];if(t.value==="data-table-select"&&!this.singleSelect)return this.$createElement("th",e,[this.genSelectAll()]);if(s.push(this.$scopedSlots.hasOwnProperty(t.value)?this.$scopedSlots[t.value]({header:t}):this.$createElement("span",[t.text])),!this.disableSort&&(t.sortable||!t.hasOwnProperty("sortable"))){e.on.click=()=>this.$emit("sort",t.value);const i=this.options.sortBy.findIndex(l=>l===t.value),a=i>=0,n=this.options.sortDesc[i];e.class.push("sortable");const{ariaLabel:o,ariaSort:r}=this.getAria(a,n);e.attrs["aria-label"]+=`${t.text?": ":""}${o}`,e.attrs["aria-sort"]=r,a&&(e.class.push("active"),e.class.push(n?"desc":"asc")),t.align==="end"?s.unshift(this.genSortIcon()):s.push(this.genSortIcon()),this.options.multiSort&&a&&s.push(this.$createElement("span",{class:"v-data-table-header__sort-badge"},[String(i+1)]))}return this.showGroupBy&&t.groupable!==!1&&s.push(this.genGroupByToggle(t)),this.$createElement("th",e,s)}},render(){return this.$createElement("thead",{staticClass:"v-data-table-header"},[this.$createElement("tr",this.headers.map(t=>this.genHeader(t)))])}});function X(t){if(t.model&&t.on&&t.on.input)if(Array.isArray(t.on.input)){const e=t.on.input.indexOf(t.model.callback);e>-1&&t.on.input.splice(e,1)}else delete t.on.input}function Y(t,e){const s=[];for(const i in t)t.hasOwnProperty(i)&&s.push(e("template",{slot:i},t[i]));return s}const Z=g.extend({name:"v-data-table-header",functional:!0,props:{...I.options.props,mobile:Boolean},render(t,{props:e,data:s,slots:i}){X(s);const a=Y(i(),t);return s=N(s,{props:e}),e.mobile?t(J,s,a):t(Q,s,a)}});function tt(t){var e;return t.length!==1||!["td","th"].includes((e=t[0])===null||e===void 0?void 0:e.tag)}const et=g.extend({name:"row",functional:!0,props:{headers:Array,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r=[],l=h(e.item,o.value),d=o.value,m=i.scopedSlots&&i.scopedSlots.hasOwnProperty(d)&&i.scopedSlots[d],y=a.hasOwnProperty(d)&&a[d];m?r.push(...c(m({item:e.item,isMobile:!1,header:o,index:e.index,value:l}))):y?r.push(...c(y)):r.push(l==null?l:String(l));const S=`text-${o.align||"start"}`;return tt(r)?t("td",{class:[S,o.cellClass,{"v-data-table__divider":o.divider}]},r):r});return t("tr",i,n)}}),D=g.extend({name:"row-group",functional:!0,props:{value:{type:Boolean,default:!0},headerClass:{type:String,default:"v-row-group__header"},contentClass:String,summaryClass:{type:String,default:"v-row-group__summary"}},render(t,{slots:e,props:s}){const i=e(),a=[];return i["column.header"]?a.push(t("tr",{staticClass:s.headerClass},i["column.header"])):i["row.header"]&&a.push(...i["row.header"]),i["row.content"]&&s.value&&a.push(...i["row.content"]),i["column.summary"]?a.push(t("tr",{staticClass:s.summaryClass},i["column.summary"])):i["row.summary"]&&a.push(...i["row.summary"]),a}});const st=f(A).extend({name:"v-simple-table",props:{dense:Boolean,fixedHeader:Boolean,height:[Number,String]},computed:{classes(){return{"v-data-table--dense":this.dense,"v-data-table--fixed-height":!!this.height&&!this.fixedHeader,"v-data-table--fixed-header":this.fixedHeader,"v-data-table--has-top":!!this.$slots.top,"v-data-table--has-bottom":!!this.$slots.bottom,...this.themeClasses}}},methods:{genWrapper(){return this.$slots.wrapper||this.$createElement("div",{staticClass:"v-data-table__wrapper",style:{height:P(this.height)}},[this.$createElement("table",this.$slots.default)])}},render(t){return t("div",{staticClass:"v-data-table",class:this.classes},[this.$slots.top,this.genWrapper(),this.$slots.bottom])}}),it=g.extend({name:"row",functional:!0,props:{headers:Array,hideDefaultHeader:Boolean,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r={"v-data-table__mobile-row":!0},l=[],d=h(e.item,o.value),m=o.value,y=i.scopedSlots&&i.scopedSlots.hasOwnProperty(m)&&i.scopedSlots[m],S=a.hasOwnProperty(m)&&a[m];y?l.push(y({item:e.item,isMobile:!0,header:o,index:e.index,value:d})):S?l.push(S):l.push(d==null?d:String(d));const O=[t("div",{staticClass:"v-data-table__mobile-row__cell"},l)];return o.value!=="dataTableSelect"&&!e.hideDefaultHeader&&O.unshift(t("div",{staticClass:"v-data-table__mobile-row__header"},[o.text])),t("td",{class:r},O)});return t("tr",{...i,staticClass:"v-data-table__mobile-table-row"},n)}});function C(t,e,s){return i=>{const a=h(t,i.value);return i.filter?i.filter(a,e,t):s(a,e,t)}}function at(t,e,s,i,a){return e=typeof e=="string"?e.trim():null,t.filter(n=>{const o=s.every(C(n,e,T)),r=!e||i.some(C(n,e,a));return o&&r})}const rt=f(B,V).extend({name:"v-data-table",directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},showSelect:Boolean,checkboxColor:String,showExpand:Boolean,showGroupBy:Boolean,height:[Number,String],hideDefaultHeader:Boolean,caption:String,dense:Boolean,headerProps:Object,calculateWidths:Boolean,fixedHeader:Boolean,headersLength:Number,expandIcon:{type:String,default:"$expand"},customFilter:{type:Function,default:T},itemClass:{type:[String,Function],default:()=>""},loaderHeight:{type:[Number,String],default:4}},data(){return{internalGroupBy:[],openCache:{},widths:[]}},computed:{computedHeaders(){if(!this.headers)return[];const t=this.headers.filter(s=>s.value===void 0||!this.internalGroupBy.find(i=>i===s.value)),e={text:"",sortable:!1,width:"1px"};if(this.showSelect){const s=t.findIndex(i=>i.value==="data-table-select");s<0?t.unshift({...e,value:"data-table-select"}):t.splice(s,1,{...e,...t[s]})}if(this.showExpand){const s=t.findIndex(i=>i.value==="data-table-expand");s<0?t.unshift({...e,value:"data-table-expand"}):t.splice(s,1,{...e,...t[s]})}return t},colspanAttrs(){return this.isMobile?void 0:{colspan:this.headersLength||this.computedHeaders.length}},columnSorters(){return this.computedHeaders.reduce((t,e)=>(e.sort&&(t[e.value]=e.sort),t),{})},headersWithCustomFilters(){return this.headers.filter(t=>t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},headersWithoutCustomFilters(){return this.headers.filter(t=>!t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},sanitizedHeaderProps(){return F(this.headerProps)},computedItemsPerPage(){const t=this.options&&this.options.itemsPerPage?this.options.itemsPerPage:this.itemsPerPage,e=this.sanitizedFooterProps.itemsPerPageOptions;if(e&&!e.find(s=>typeof s=="number"?s===t:s.value===t)){const s=e[0];return typeof s=="object"?s.value:s}return t},groupByText(){var t,e,s;return(s=(e=(t=this.headers)===null||t===void 0?void 0:t.find(i=>{var a;return i.value===((a=this.internalGroupBy)===null||a===void 0?void 0:a[0])}))===null||e===void 0?void 0:e.text)!==null&&s!==void 0?s:""}},created(){[["sort-icon","header-props.sort-icon"],["hide-headers","hide-default-header"],["select-all","show-select"]].forEach(([e,s])=>{this.$attrs.hasOwnProperty(e)&&k(e,s,this)})},mounted(){this.calculateWidths&&(window.addEventListener("resize",this.calcWidths),this.calcWidths())},beforeDestroy(){this.calculateWidths&&window.removeEventListener("resize",this.calcWidths)},methods:{calcWidths(){this.widths=Array.from(this.$el.querySelectorAll("th")).map(t=>t.clientWidth)},customFilterWithColumns(t,e){return at(t,e,this.headersWithCustomFilters,this.headersWithoutCustomFilters,this.customFilter)},customSortWithHeaders(t,e,s,i){return this.customSort(t,e,s,i,this.columnSorters)},createItemProps(t,e){const s=B.options.methods.createItemProps.call(this,t,e);return Object.assign(s,{headers:this.computedHeaders})},genCaption(t){return this.caption?[this.$createElement("caption",[this.caption])]:u(this,"caption",t,!0)},genColgroup(t){return this.$createElement("colgroup",this.computedHeaders.map(e=>this.$createElement("col",{class:{divider:e.divider}})))},genLoading(){const t=this.$createElement("th",{staticClass:"column",attrs:this.colspanAttrs},[this.genProgress()]),e=this.$createElement("tr",{staticClass:"v-data-table__progress"},[t]);return this.$createElement("thead",[e])},genHeaders(t){const e={props:{...this.sanitizedHeaderProps,headers:this.computedHeaders,options:t.options,mobile:this.isMobile,showGroupBy:this.showGroupBy,checkboxColor:this.checkboxColor,someItems:this.someItems,everyItem:this.everyItem,singleSelect:this.singleSelect,disableSort:this.disableSort},on:{sort:t.sort,group:t.group,"toggle-select-all":this.toggleSelectAll}},s=[u(this,"header",{...e,isMobile:this.isMobile})];if(!this.hideDefaultHeader){const i=$("header.",this.$scopedSlots);s.push(this.$createElement(Z,{...e,scopedSlots:i}))}return this.loading&&s.push(this.genLoading()),s},genEmptyWrapper(t){return this.$createElement("tr",{staticClass:"v-data-table__empty-wrapper"},[this.$createElement("td",{attrs:this.colspanAttrs},t)])},genItems(t,e){const s=this.genEmpty(e.originalItemsLength,e.pagination.itemsLength);return s?[s]:e.groupedItems?this.genGroupedRows(e.groupedItems,e):this.genRows(t,e)},genGroupedRows(t,e){return t.map(s=>(this.openCache.hasOwnProperty(s.name)||this.$set(this.openCache,s.name,!0),this.$scopedSlots.group?this.$scopedSlots.group({group:s.name,options:e.options,isMobile:this.isMobile,items:s.items,headers:this.computedHeaders}):this.genDefaultGroupedRow(s.name,s.items,e)))},genDefaultGroupedRow(t,e,s){const i=!!this.openCache[t],a=[this.$createElement("template",{slot:"row.content"},this.genRows(e,s))],n=()=>this.$set(this.openCache,t,!this.openCache[t]),o=()=>s.updateOptions({groupBy:[],groupDesc:[]});if(this.$scopedSlots["group.header"])a.unshift(this.$createElement("template",{slot:"column.header"},[this.$scopedSlots["group.header"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n,remove:o})]));else{const r=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:n}},[this.$createElement(b,[i?"$minus":"$plus"])]),l=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:o}},[this.$createElement(b,["$close"])]),d=this.$createElement("td",{staticClass:"text-start",attrs:this.colspanAttrs},[r,`${this.groupByText}: ${t}`,l]);a.unshift(this.$createElement("template",{slot:"column.header"},[d]))}return this.$scopedSlots["group.summary"]&&a.push(this.$createElement("template",{slot:"column.summary"},[this.$scopedSlots["group.summary"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n})])),this.$createElement(D,{key:t,props:{value:i}},a)},genRows(t,e){return this.$scopedSlots.item?this.genScopedRows(t,e):this.genDefaultRows(t,e)},genScopedRows(t,e){const s=[];for(let i=0;ithis.genDefaultExpandedRow(s,i)):t.map((s,i)=>this.genDefaultSimpleRow(s,i))},genDefaultExpandedRow(t,e){const s=this.isExpanded(t),i={"v-data-table__expanded v-data-table__expanded__row":s},a=this.genDefaultSimpleRow(t,e,i),n=this.$createElement("tr",{staticClass:"v-data-table__expanded v-data-table__expanded__content"},[this.$scopedSlots["expanded-item"]({headers:this.computedHeaders,isMobile:this.isMobile,item:t})]);return this.$createElement(D,{props:{value:s}},[this.$createElement("template",{slot:"row.header"},[a]),this.$createElement("template",{slot:"row.content"},[n])])},genDefaultSimpleRow(t,e,s={}){const i=$("item.",this.$scopedSlots),a=this.createItemProps(t,e);if(this.showSelect){const n=i["data-table-select"];i["data-table-select"]=n?()=>n({...a,isMobile:this.isMobile}):()=>{var o;return this.$createElement(M,{staticClass:"v-data-table__checkbox",props:{value:a.isSelected,disabled:!this.isSelectable(t),color:(o=this.checkboxColor)!==null&&o!==void 0?o:""},on:{input:r=>a.select(r)}})}}if(this.showExpand){const n=i["data-table-expand"];i["data-table-expand"]=n?()=>n(a):()=>this.$createElement(b,{staticClass:"v-data-table__expand-icon",class:{"v-data-table__expand-icon--active":a.isExpanded},on:{click:o=>{o.stopPropagation(),a.expand(!a.isExpanded)}}},[this.expandIcon])}return this.$createElement(this.isMobile?it:et,{key:h(t,this.itemKey),class:z({...s,"v-data-table__selected":a.isSelected},U(t,this.itemClass)),props:{headers:this.computedHeaders,hideDefaultHeader:this.hideDefaultHeader,index:e,item:t,rtl:this.$vuetify.rtl},scopedSlots:i,on:{click:n=>this.$emit("click:row",t,a,n),contextmenu:n=>this.$emit("contextmenu:row",n,a),dblclick:n=>this.$emit("dblclick:row",n,a)}})},genBody(t){const e={...t,expand:this.expand,headers:this.computedHeaders,isExpanded:this.isExpanded,isMobile:this.isMobile,isSelected:this.isSelected,select:this.select};return this.$scopedSlots.body?this.$scopedSlots.body(e):this.$createElement("tbody",[u(this,"body.prepend",e,!0),this.genItems(t.items,t),u(this,"body.append",e,!0)])},genFoot(t){var e,s;return(s=(e=this.$scopedSlots).foot)===null||s===void 0?void 0:s.call(e,t)},genFooters(t){const e={props:{options:t.options,pagination:t.pagination,itemsPerPageText:"$vuetify.dataTable.itemsPerPageText",...this.sanitizedFooterProps},on:{"update:options":i=>t.updateOptions(i)},widths:this.widths,headers:this.computedHeaders},s=[u(this,"footer",e,!0)];return this.hideDefaultFooter||s.push(this.$createElement(K,{...e,scopedSlots:$("footer.",this.$scopedSlots)})),s},genDefaultScopedSlot(t){const e={height:this.height,fixedHeader:this.fixedHeader,dense:this.dense};return this.$createElement(st,{props:e,class:{"v-data-table--mobile":this.isMobile}},[this.proxySlot("top",u(this,"top",{...t,isMobile:this.isMobile},!0)),this.genCaption(t),this.genColgroup(t),this.genHeaders(t),this.genBody(t),this.genFoot(t),this.proxySlot("bottom",this.genFooters(t))])},proxySlot(t,e){return this.$createElement("template",{slot:t},e)}},render(){return this.$createElement(x,{props:{...this.$props,customFilter:this.customFilterWithColumns,customSort:this.customSortWithHeaders,itemsPerPage:this.computedItemsPerPage},on:{"update:options":(t,e)=>{this.internalGroupBy=t.groupBy||[],!p(t,e)&&this.$emit("update:options",t)},"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});export{rt as _}; diff --git a/dist/assets/VExpansionPanelHeader-a9447b85.js b/dist/assets/VExpansionPanelHeader-69136628.js similarity index 98% rename from dist/assets/VExpansionPanelHeader-a9447b85.js rename to dist/assets/VExpansionPanelHeader-69136628.js index 1ba87fe..f4f3bcb 100644 --- a/dist/assets/VExpansionPanelHeader-a9447b85.js +++ b/dist/assets/VExpansionPanelHeader-69136628.js @@ -1 +1 @@ -import{J as n,Z as o,aY as l,b6 as s,Y as r,W as i,K as t,aZ as c,b7 as p,b as d,b1 as h}from"./index-e8f29bb9.js";const b=n(l("expansionPanels","v-expansion-panel","v-expansion-panels"),o("expansionPanel",!0)).extend({name:"v-expansion-panel",props:{disabled:Boolean,readonly:Boolean},data(){return{content:null,header:null,nextIsActive:!1}},computed:{classes(){return{"v-expansion-panel--active":this.isActive,"v-expansion-panel--next-active":this.nextIsActive,"v-expansion-panel--disabled":this.isDisabled,...this.groupClasses}},isDisabled(){return this.expansionPanels.disabled||this.disabled},isReadonly(){return this.expansionPanels.readonly||this.readonly}},methods:{registerContent(e){this.content=e},unregisterContent(){this.content=null},registerHeader(e){this.header=e,e.$on("click",this.onClick)},unregisterHeader(){this.header=null},onClick(e){e.detail&&this.header.$el.blur(),this.$emit("click",e),this.isReadonly||this.isDisabled||this.toggle()},toggle(){this.$nextTick(()=>this.$emit("change"))}},render(e){return e("div",{staticClass:"v-expansion-panel",class:this.classes,attrs:{"aria-expanded":String(this.isActive)}},s(this))}}),u=n(c,t,i("expansionPanel","v-expansion-panel-content","v-expansion-panel")),m=u.extend().extend({name:"v-expansion-panel-content",data:()=>({isActive:!1}),computed:{parentIsActive(){return this.expansionPanel.isActive}},watch:{parentIsActive:{immediate:!0,handler(e,a){e&&(this.isBooted=!0),a==null?this.isActive=e:this.$nextTick(()=>this.isActive=e)}}},created(){this.expansionPanel.registerContent(this)},beforeDestroy(){this.expansionPanel.unregisterContent()},render(e){return e(r,this.showLazyContent(()=>[e("div",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-content",directives:[{name:"show",value:this.isActive}]}),[e("div",{class:"v-expansion-panel-content__wrap"},s(this))])]))}}),x=n(t,i("expansionPanel","v-expansion-panel-header","v-expansion-panel")),g=x.extend().extend({name:"v-expansion-panel-header",directives:{ripple:p},props:{disableIconRotate:Boolean,expandIcon:{type:String,default:"$expand"},hideActions:Boolean,ripple:{type:[Boolean,Object],default:!1}},data:()=>({hasMousedown:!1}),computed:{classes(){return{"v-expansion-panel-header--active":this.isActive,"v-expansion-panel-header--mousedown":this.hasMousedown}},isActive(){return this.expansionPanel.isActive},isDisabled(){return this.expansionPanel.isDisabled},isReadonly(){return this.expansionPanel.isReadonly}},created(){this.expansionPanel.registerHeader(this)},beforeDestroy(){this.expansionPanel.unregisterHeader()},methods:{onClick(e){this.$emit("click",e)},genIcon(){const e=s(this,"actions")||[this.$createElement(d,this.expandIcon)];return this.$createElement(h,[this.$createElement("div",{staticClass:"v-expansion-panel-header__icon",class:{"v-expansion-panel-header__icon--disable-rotate":this.disableIconRotate},directives:[{name:"show",value:!this.isDisabled}]},e)])}},render(e){return e("button",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-header",class:this.classes,attrs:{tabindex:this.isDisabled?-1:null,type:"button","aria-expanded":this.isActive},directives:[{name:"ripple",value:this.ripple}],on:{...this.$listeners,click:this.onClick,mousedown:()=>this.hasMousedown=!0,mouseup:()=>this.hasMousedown=!1}}),[s(this,"default",{open:this.isActive},!0),this.hideActions||this.genIcon()])}});export{b as _,g as a,m as b}; +import{J as n,Z as o,aY as l,b6 as s,Y as r,W as i,K as t,aZ as c,b7 as p,b as d,b1 as h}from"./index-e409ba63.js";const b=n(l("expansionPanels","v-expansion-panel","v-expansion-panels"),o("expansionPanel",!0)).extend({name:"v-expansion-panel",props:{disabled:Boolean,readonly:Boolean},data(){return{content:null,header:null,nextIsActive:!1}},computed:{classes(){return{"v-expansion-panel--active":this.isActive,"v-expansion-panel--next-active":this.nextIsActive,"v-expansion-panel--disabled":this.isDisabled,...this.groupClasses}},isDisabled(){return this.expansionPanels.disabled||this.disabled},isReadonly(){return this.expansionPanels.readonly||this.readonly}},methods:{registerContent(e){this.content=e},unregisterContent(){this.content=null},registerHeader(e){this.header=e,e.$on("click",this.onClick)},unregisterHeader(){this.header=null},onClick(e){e.detail&&this.header.$el.blur(),this.$emit("click",e),this.isReadonly||this.isDisabled||this.toggle()},toggle(){this.$nextTick(()=>this.$emit("change"))}},render(e){return e("div",{staticClass:"v-expansion-panel",class:this.classes,attrs:{"aria-expanded":String(this.isActive)}},s(this))}}),u=n(c,t,i("expansionPanel","v-expansion-panel-content","v-expansion-panel")),m=u.extend().extend({name:"v-expansion-panel-content",data:()=>({isActive:!1}),computed:{parentIsActive(){return this.expansionPanel.isActive}},watch:{parentIsActive:{immediate:!0,handler(e,a){e&&(this.isBooted=!0),a==null?this.isActive=e:this.$nextTick(()=>this.isActive=e)}}},created(){this.expansionPanel.registerContent(this)},beforeDestroy(){this.expansionPanel.unregisterContent()},render(e){return e(r,this.showLazyContent(()=>[e("div",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-content",directives:[{name:"show",value:this.isActive}]}),[e("div",{class:"v-expansion-panel-content__wrap"},s(this))])]))}}),x=n(t,i("expansionPanel","v-expansion-panel-header","v-expansion-panel")),g=x.extend().extend({name:"v-expansion-panel-header",directives:{ripple:p},props:{disableIconRotate:Boolean,expandIcon:{type:String,default:"$expand"},hideActions:Boolean,ripple:{type:[Boolean,Object],default:!1}},data:()=>({hasMousedown:!1}),computed:{classes(){return{"v-expansion-panel-header--active":this.isActive,"v-expansion-panel-header--mousedown":this.hasMousedown}},isActive(){return this.expansionPanel.isActive},isDisabled(){return this.expansionPanel.isDisabled},isReadonly(){return this.expansionPanel.isReadonly}},created(){this.expansionPanel.registerHeader(this)},beforeDestroy(){this.expansionPanel.unregisterHeader()},methods:{onClick(e){this.$emit("click",e)},genIcon(){const e=s(this,"actions")||[this.$createElement(d,this.expandIcon)];return this.$createElement(h,[this.$createElement("div",{staticClass:"v-expansion-panel-header__icon",class:{"v-expansion-panel-header__icon--disable-rotate":this.disableIconRotate},directives:[{name:"show",value:!this.isDisabled}]},e)])}},render(e){return e("button",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-header",class:this.classes,attrs:{tabindex:this.isDisabled?-1:null,type:"button","aria-expanded":this.isActive},directives:[{name:"ripple",value:this.ripple}],on:{...this.$listeners,click:this.onClick,mousedown:()=>this.hasMousedown=!0,mouseup:()=>this.hasMousedown=!1}}),[s(this,"default",{open:this.isActive},!0),this.hideActions||this.genIcon()])}});export{b as _,g as a,m as b}; diff --git a/dist/assets/VExpansionPanels-26c41551.js b/dist/assets/VExpansionPanels-cacfd68a.js similarity index 88% rename from dist/assets/VExpansionPanels-26c41551.js rename to dist/assets/VExpansionPanels-cacfd68a.js index 2bbaec9..13d4dcc 100644 --- a/dist/assets/VExpansionPanels-26c41551.js +++ b/dist/assets/VExpansionPanels-cacfd68a.js @@ -1 +1 @@ -import{B as a}from"./VItemGroup-e39c2c83.js";import{aQ as s}from"./index-e8f29bb9.js";const p=a.extend({name:"v-expansion-panels",provide(){return{expansionPanels:this}},props:{accordion:Boolean,disabled:Boolean,flat:Boolean,hover:Boolean,focusable:Boolean,inset:Boolean,popout:Boolean,readonly:Boolean,tile:Boolean},computed:{classes(){return{...a.options.computed.classes.call(this),"v-expansion-panels":!0,"v-expansion-panels--accordion":this.accordion,"v-expansion-panels--flat":this.flat,"v-expansion-panels--hover":this.hover,"v-expansion-panels--focusable":this.focusable,"v-expansion-panels--inset":this.inset,"v-expansion-panels--popout":this.popout,"v-expansion-panels--tile":this.tile}}},created(){this.$attrs.hasOwnProperty("expand")&&s("expand","multiple",this),Array.isArray(this.value)&&this.value.length>0&&typeof this.value[0]=="boolean"&&s(':value="[true, false, true]"',':value="[0, 2]"',this)},methods:{updateItem(e,o){const n=this.getValue(e,o),t=this.getValue(e,o+1);e.isActive=this.toggleMethod(n),e.nextIsActive=this.toggleMethod(t)}}});export{p as _}; +import{B as a}from"./VItemGroup-3637266a.js";import{aQ as s}from"./index-e409ba63.js";const p=a.extend({name:"v-expansion-panels",provide(){return{expansionPanels:this}},props:{accordion:Boolean,disabled:Boolean,flat:Boolean,hover:Boolean,focusable:Boolean,inset:Boolean,popout:Boolean,readonly:Boolean,tile:Boolean},computed:{classes(){return{...a.options.computed.classes.call(this),"v-expansion-panels":!0,"v-expansion-panels--accordion":this.accordion,"v-expansion-panels--flat":this.flat,"v-expansion-panels--hover":this.hover,"v-expansion-panels--focusable":this.focusable,"v-expansion-panels--inset":this.inset,"v-expansion-panels--popout":this.popout,"v-expansion-panels--tile":this.tile}}},created(){this.$attrs.hasOwnProperty("expand")&&s("expand","multiple",this),Array.isArray(this.value)&&this.value.length>0&&typeof this.value[0]=="boolean"&&s(':value="[true, false, true]"',':value="[0, 2]"',this)},methods:{updateItem(e,o){const n=this.getValue(e,o),t=this.getValue(e,o+1);e.isActive=this.toggleMethod(n),e.nextIsActive=this.toggleMethod(t)}}});export{p as _}; diff --git a/dist/assets/VItemGroup-e39c2c83.js b/dist/assets/VItemGroup-3637266a.js similarity index 95% rename from dist/assets/VItemGroup-e39c2c83.js rename to dist/assets/VItemGroup-3637266a.js index fde62c9..86ab530 100644 --- a/dist/assets/VItemGroup-e39c2c83.js +++ b/dist/assets/VItemGroup-3637266a.js @@ -1 +1 @@ -import{J as n,T as r,b3 as l,bJ as u,U as h}from"./index-e8f29bb9.js";const d=n(u,l,r).extend({name:"base-item-group",props:{activeClass:{type:String,default:"v-item--active"},mandatory:Boolean,max:{type:[Number,String],default:null},multiple:Boolean,tag:{type:String,default:"div"}},data(){return{internalLazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,items:[]}},computed:{classes(){return{"v-item-group":!0,...this.themeClasses}},selectedIndex(){return this.selectedItem&&this.items.indexOf(this.selectedItem)||-1},selectedItem(){if(!this.multiple)return this.selectedItems[0]},selectedItems(){return this.items.filter((e,t)=>this.toggleMethod(this.getValue(e,t)))},selectedValues(){return this.internalValue==null?[]:Array.isArray(this.internalValue)?this.internalValue:[this.internalValue]},toggleMethod(){if(!this.multiple)return t=>this.valueComparator(this.internalValue,t);const e=this.internalValue;return Array.isArray(e)?t=>e.some(i=>this.valueComparator(i,t)):()=>!1}},watch:{internalValue:"updateItemsState",items:"updateItemsState"},created(){this.multiple&&!Array.isArray(this.internalValue)&&h("Model must be bound to an array if the multiple property is true.",this)},methods:{genData(){return{class:this.classes}},getValue(e,t){return e.value===void 0?t:e.value},onClick(e){this.updateInternalValue(this.getValue(e,this.items.indexOf(e)))},register(e){const t=this.items.push(e)-1;e.$on("change",()=>this.onClick(e)),this.mandatory&&!this.selectedValues.length&&this.updateMandatory(),this.updateItem(e,t)},unregister(e){if(this._isDestroyed)return;const t=this.items.indexOf(e),i=this.getValue(e,t);if(this.items.splice(t,1),!(this.selectedValues.indexOf(i)<0)){if(!this.mandatory)return this.updateInternalValue(i);this.multiple&&Array.isArray(this.internalValue)?this.internalValue=this.internalValue.filter(s=>s!==i):this.internalValue=void 0,this.selectedItems.length||this.updateMandatory(!0)}},updateItem(e,t){const i=this.getValue(e,t);e.isActive=this.toggleMethod(i)},updateItemsState(){this.$nextTick(()=>{if(this.mandatory&&!this.selectedItems.length)return this.updateMandatory();this.items.forEach(this.updateItem)})},updateInternalValue(e){this.multiple?this.updateMultiple(e):this.updateSingle(e)},updateMandatory(e){if(!this.items.length)return;const t=this.items.slice();e&&t.reverse();const i=t.find(s=>!s.disabled);if(!i)return;const a=this.items.indexOf(i);this.updateInternalValue(this.getValue(i,a))},updateMultiple(e){const i=(Array.isArray(this.internalValue)?this.internalValue:[]).slice(),a=i.findIndex(s=>this.valueComparator(s,e));this.mandatory&&a>-1&&i.length-1<1||this.max!=null&&a<0&&i.length+1>this.max||(a>-1?i.splice(a,1):i.push(e),this.internalValue=i)},updateSingle(e){const t=this.valueComparator(this.internalValue,e);this.mandatory&&t||(this.internalValue=t?void 0:e)}},render(e){return e(this.tag,this.genData(),this.$slots.default)}});d.extend({name:"v-item-group",provide(){return{itemGroup:this}}});export{d as B}; +import{J as n,T as r,b3 as l,bJ as u,U as h}from"./index-e409ba63.js";const d=n(u,l,r).extend({name:"base-item-group",props:{activeClass:{type:String,default:"v-item--active"},mandatory:Boolean,max:{type:[Number,String],default:null},multiple:Boolean,tag:{type:String,default:"div"}},data(){return{internalLazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,items:[]}},computed:{classes(){return{"v-item-group":!0,...this.themeClasses}},selectedIndex(){return this.selectedItem&&this.items.indexOf(this.selectedItem)||-1},selectedItem(){if(!this.multiple)return this.selectedItems[0]},selectedItems(){return this.items.filter((e,t)=>this.toggleMethod(this.getValue(e,t)))},selectedValues(){return this.internalValue==null?[]:Array.isArray(this.internalValue)?this.internalValue:[this.internalValue]},toggleMethod(){if(!this.multiple)return t=>this.valueComparator(this.internalValue,t);const e=this.internalValue;return Array.isArray(e)?t=>e.some(i=>this.valueComparator(i,t)):()=>!1}},watch:{internalValue:"updateItemsState",items:"updateItemsState"},created(){this.multiple&&!Array.isArray(this.internalValue)&&h("Model must be bound to an array if the multiple property is true.",this)},methods:{genData(){return{class:this.classes}},getValue(e,t){return e.value===void 0?t:e.value},onClick(e){this.updateInternalValue(this.getValue(e,this.items.indexOf(e)))},register(e){const t=this.items.push(e)-1;e.$on("change",()=>this.onClick(e)),this.mandatory&&!this.selectedValues.length&&this.updateMandatory(),this.updateItem(e,t)},unregister(e){if(this._isDestroyed)return;const t=this.items.indexOf(e),i=this.getValue(e,t);if(this.items.splice(t,1),!(this.selectedValues.indexOf(i)<0)){if(!this.mandatory)return this.updateInternalValue(i);this.multiple&&Array.isArray(this.internalValue)?this.internalValue=this.internalValue.filter(s=>s!==i):this.internalValue=void 0,this.selectedItems.length||this.updateMandatory(!0)}},updateItem(e,t){const i=this.getValue(e,t);e.isActive=this.toggleMethod(i)},updateItemsState(){this.$nextTick(()=>{if(this.mandatory&&!this.selectedItems.length)return this.updateMandatory();this.items.forEach(this.updateItem)})},updateInternalValue(e){this.multiple?this.updateMultiple(e):this.updateSingle(e)},updateMandatory(e){if(!this.items.length)return;const t=this.items.slice();e&&t.reverse();const i=t.find(s=>!s.disabled);if(!i)return;const a=this.items.indexOf(i);this.updateInternalValue(this.getValue(i,a))},updateMultiple(e){const i=(Array.isArray(this.internalValue)?this.internalValue:[]).slice(),a=i.findIndex(s=>this.valueComparator(s,e));this.mandatory&&a>-1&&i.length-1<1||this.max!=null&&a<0&&i.length+1>this.max||(a>-1?i.splice(a,1):i.push(e),this.internalValue=i)},updateSingle(e){const t=this.valueComparator(this.internalValue,e);this.mandatory&&t||(this.internalValue=t?void 0:e)}},render(e){return e(this.tag,this.genData(),this.$slots.default)}});d.extend({name:"v-item-group",provide(){return{itemGroup:this}}});export{d as B}; diff --git a/dist/assets/VPagination-48f2bf47.js b/dist/assets/VPagination-4794e169.js similarity index 96% rename from dist/assets/VPagination-48f2bf47.js rename to dist/assets/VPagination-4794e169.js index f8e5eef..a3b7212 100644 --- a/dist/assets/VPagination-48f2bf47.js +++ b/dist/assets/VPagination-4794e169.js @@ -1 +1 @@ -import{J as g,T as c,b5 as p,K as v,a$ as m,b}from"./index-e8f29bb9.js";const f=g(v,p({onVisible:["init"]}),c).extend({name:"v-pagination",directives:{Resize:m},props:{circle:Boolean,disabled:Boolean,length:{type:Number,default:0,validator:t=>t%1===0},nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},totalVisible:[Number,String],value:{type:Number,default:0},pageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.page"},currentPageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.currentPage"},previousAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.previous"},nextAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.next"},wrapperAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.wrapper"}},data(){return{maxButtons:0,selected:null}},computed:{classes(){return{"v-pagination":!0,"v-pagination--circle":this.circle,"v-pagination--disabled":this.disabled,...this.themeClasses}},items(){const t=parseInt(this.totalVisible,10);if(t===0||isNaN(this.length)||this.length>Number.MAX_SAFE_INTEGER)return[];const e=Math.min(Math.max(0,t)||this.length,Math.max(0,this.maxButtons)||this.length,this.length);if(this.length<=e)return this.range(1,this.length);const n=e%2===0?1:0,i=Math.floor(e/2),a=this.length-i+1+n;if(this.value>i&&this.valuethis.selected=this.value,100)},onResize(){const t=this.$el&&this.$el.parentElement?this.$el.parentElement.clientWidth:window.innerWidth;this.maxButtons=Math.floor((t-96)/42)},next(t){t.preventDefault(),this.$emit("input",this.value+1),this.$emit("next")},previous(t){t.preventDefault(),this.$emit("input",this.value-1),this.$emit("previous")},range(t,e){const n=[];t=t>0?t:1;for(let i=t;i<=e;i++)n.push(i);return n},genIcon(t,e,n,i,a){return t("li",[t("button",{staticClass:"v-pagination__navigation",class:{"v-pagination__navigation--disabled":n},attrs:{disabled:n,type:"button","aria-label":a},on:n?{}:{click:i}},[t(b,[e])])])},genItem(t,e){const n=e===this.value&&(this.color||"primary"),i=e===this.value,a=i?this.currentPageAriaLabel:this.pageAriaLabel;return t("button",this.setBackgroundColor(n,{staticClass:"v-pagination__item",class:{"v-pagination__item--active":e===this.value},attrs:{type:"button","aria-current":i,"aria-label":this.$vuetify.lang.t(a,e)},on:{click:()=>this.$emit("input",e)}}),[e.toString()])},genItems(t){return this.items.map((e,n)=>t("li",{key:n},[isNaN(Number(e))?t("span",{class:"v-pagination__more"},[e.toString()]):this.genItem(t,e)]))},genList(t,e){return t("ul",{directives:[{modifiers:{quiet:!0},name:"resize",value:this.onResize}],class:this.classes},e)}},render(t){const e=[this.genIcon(t,this.$vuetify.rtl?this.nextIcon:this.prevIcon,this.value<=1,this.previous,this.$vuetify.lang.t(this.previousAriaLabel)),this.genItems(t),this.genIcon(t,this.$vuetify.rtl?this.prevIcon:this.nextIcon,this.value>=this.length,this.next,this.$vuetify.lang.t(this.nextAriaLabel))];return t("nav",{attrs:{role:"navigation","aria-label":this.$vuetify.lang.t(this.wrapperAriaLabel)}},[this.genList(t,e)])}});export{f as _}; +import{J as g,T as c,b5 as p,K as v,a$ as m,b}from"./index-e409ba63.js";const f=g(v,p({onVisible:["init"]}),c).extend({name:"v-pagination",directives:{Resize:m},props:{circle:Boolean,disabled:Boolean,length:{type:Number,default:0,validator:t=>t%1===0},nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},totalVisible:[Number,String],value:{type:Number,default:0},pageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.page"},currentPageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.currentPage"},previousAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.previous"},nextAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.next"},wrapperAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.wrapper"}},data(){return{maxButtons:0,selected:null}},computed:{classes(){return{"v-pagination":!0,"v-pagination--circle":this.circle,"v-pagination--disabled":this.disabled,...this.themeClasses}},items(){const t=parseInt(this.totalVisible,10);if(t===0||isNaN(this.length)||this.length>Number.MAX_SAFE_INTEGER)return[];const e=Math.min(Math.max(0,t)||this.length,Math.max(0,this.maxButtons)||this.length,this.length);if(this.length<=e)return this.range(1,this.length);const n=e%2===0?1:0,i=Math.floor(e/2),a=this.length-i+1+n;if(this.value>i&&this.valuethis.selected=this.value,100)},onResize(){const t=this.$el&&this.$el.parentElement?this.$el.parentElement.clientWidth:window.innerWidth;this.maxButtons=Math.floor((t-96)/42)},next(t){t.preventDefault(),this.$emit("input",this.value+1),this.$emit("next")},previous(t){t.preventDefault(),this.$emit("input",this.value-1),this.$emit("previous")},range(t,e){const n=[];t=t>0?t:1;for(let i=t;i<=e;i++)n.push(i);return n},genIcon(t,e,n,i,a){return t("li",[t("button",{staticClass:"v-pagination__navigation",class:{"v-pagination__navigation--disabled":n},attrs:{disabled:n,type:"button","aria-label":a},on:n?{}:{click:i}},[t(b,[e])])])},genItem(t,e){const n=e===this.value&&(this.color||"primary"),i=e===this.value,a=i?this.currentPageAriaLabel:this.pageAriaLabel;return t("button",this.setBackgroundColor(n,{staticClass:"v-pagination__item",class:{"v-pagination__item--active":e===this.value},attrs:{type:"button","aria-current":i,"aria-label":this.$vuetify.lang.t(a,e)},on:{click:()=>this.$emit("input",e)}}),[e.toString()])},genItems(t){return this.items.map((e,n)=>t("li",{key:n},[isNaN(Number(e))?t("span",{class:"v-pagination__more"},[e.toString()]):this.genItem(t,e)]))},genList(t,e){return t("ul",{directives:[{modifiers:{quiet:!0},name:"resize",value:this.onResize}],class:this.classes},e)}},render(t){const e=[this.genIcon(t,this.$vuetify.rtl?this.nextIcon:this.prevIcon,this.value<=1,this.previous,this.$vuetify.lang.t(this.previousAriaLabel)),this.genItems(t),this.genIcon(t,this.$vuetify.rtl?this.prevIcon:this.nextIcon,this.value>=this.length,this.next,this.$vuetify.lang.t(this.nextAriaLabel))];return t("nav",{attrs:{role:"navigation","aria-label":this.$vuetify.lang.t(this.wrapperAriaLabel)}},[this.genList(t,e)])}});export{f as _}; diff --git a/dist/assets/VSelect-f55906da.js b/dist/assets/VSelect-22e7980f.js similarity index 99% rename from dist/assets/VSelect-f55906da.js rename to dist/assets/VSelect-22e7980f.js index 6461e8f..9f6791e 100644 --- a/dist/assets/VSelect-f55906da.js +++ b/dist/assets/VSelect-22e7980f.js @@ -1 +1 @@ -import{J as d,bF as y,aY as k,T as p,b4 as m,bG as S,K as c,aQ as _,b as g,bH as T,I as C,b7 as v,aI as I,S as V,e as f,h as D,i as A,V as M,f as w,aG as h,d as B,ba as L,j as r,aK as E,b9 as O,X as b,k as P,aH as l,bI as F,bJ as H}from"./index-e8f29bb9.js";const K=d(c,S,m,p,k("chipGroup"),y("inputValue")).extend({name:"v-chip",props:{active:{type:Boolean,default:!0},activeClass:{type:String,default(){return this.chipGroup?this.chipGroup.activeClass:""}},close:Boolean,closeIcon:{type:String,default:"$delete"},closeLabel:{type:String,default:"$vuetify.close"},disabled:Boolean,draggable:Boolean,filter:Boolean,filterIcon:{type:String,default:"$complete"},label:Boolean,link:Boolean,outlined:Boolean,pill:Boolean,tag:{type:String,default:"span"},textColor:String,value:null},data:()=>({proxyClass:"v-chip--active"}),computed:{classes(){return{"v-chip":!0,...m.options.computed.classes.call(this),"v-chip--clickable":this.isClickable,"v-chip--disabled":this.disabled,"v-chip--draggable":this.draggable,"v-chip--label":this.label,"v-chip--link":this.isLink,"v-chip--no-color":!this.color,"v-chip--outlined":this.outlined,"v-chip--pill":this.pill,"v-chip--removable":this.hasClose,...this.themeClasses,...this.sizeableClasses,...this.groupClasses}},hasClose(){return!!this.close},isClickable(){return!!(m.options.computed.isClickable.call(this)||this.chipGroup)}},created(){[["outline","outlined"],["selected","input-value"],["value","active"],["@input","@active.sync"]].forEach(([t,s])=>{this.$attrs.hasOwnProperty(t)&&_(t,s,this)})},methods:{click(e){this.$emit("click",e),this.chipGroup&&this.toggle()},genFilter(){const e=[];return this.isActive&&e.push(this.$createElement(g,{staticClass:"v-chip__filter",props:{left:!0}},this.filterIcon)),this.$createElement(T,e)},genClose(){return this.$createElement(g,{staticClass:"v-chip__close",props:{right:!0,size:18},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:e=>{e.stopPropagation(),e.preventDefault(),this.$emit("click:close"),this.$emit("update:active",!1)}}},this.closeIcon)},genContent(){return this.$createElement("span",{staticClass:"v-chip__content"},[this.filter&&this.genFilter(),this.$slots.default,this.hasClose&&this.genClose()])}},render(e){const t=[this.genContent()];let{tag:s,data:i}=this.generateRouteLink();i.attrs={...i.attrs,draggable:this.draggable?"true":void 0,tabindex:this.chipGroup&&!this.disabled?0:i.attrs.tabindex},i.directives.push({name:"show",value:this.active}),i=this.setBackgroundColor(this.color,i);const n=this.textColor||this.outlined&&this.color;return e(s,this.setTextColor(n,i),t)}});const j=C.extend({name:"v-simple-checkbox",functional:!0,directives:{Ripple:v},props:{...c.options.props,...p.options.props,disabled:Boolean,ripple:{type:Boolean,default:!0},value:Boolean,indeterminate:Boolean,indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},onIcon:{type:String,default:"$checkboxOn"},offIcon:{type:String,default:"$checkboxOff"}},render(e,{props:t,data:s,listeners:i}){const n=[];let o=t.offIcon;if(t.indeterminate?o=t.indeterminateIcon:t.value&&(o=t.onIcon),n.push(e(g,c.options.methods.setTextColor(t.value&&t.color,{props:{disabled:t.disabled,dark:t.dark,light:t.light}}),o)),t.ripple&&!t.disabled){const a=e("div",c.options.methods.setTextColor(t.color,{staticClass:"v-input--selection-controls__ripple",directives:[{def:v,name:"ripple",value:{center:!0}}]}));n.push(a)}return e("div",I(s,{class:{"v-simple-checkbox":!0,"v-simple-checkbox--disabled":t.disabled},on:{click:a=>{a.stopPropagation(),s.on&&s.on.input&&!t.disabled&&V(s.on.input).forEach(u=>u(!t.value))}}}),[e("div",{staticClass:"v-input--selection-controls__input"},n)])}});const G=d(p).extend({name:"v-subheader",props:{inset:Boolean},render(e){return e("div",{staticClass:"v-subheader",class:{"v-subheader--inset":this.inset,...this.themeClasses},attrs:this.$attrs,on:this.$listeners},this.$slots.default)}}),$=d(c,p).extend({name:"v-select-list",directives:{ripple:v},props:{action:Boolean,dense:Boolean,hideSelected:Boolean,items:{type:Array,default:()=>[]},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},noDataText:String,noFilter:Boolean,searchInput:null,selectedItems:{type:Array,default:()=>[]}},computed:{parsedItems(){return this.selectedItems.map(e=>this.getValue(e))},tileActiveClass(){return Object.keys(this.setTextColor(this.color).class||{}).join(" ")},staticNoDataTile(){const e={attrs:{role:void 0},on:{mousedown:t=>t.preventDefault()}};return this.$createElement(f,e,[this.genTileContent(this.noDataText)])}},methods:{genAction(e,t){return this.$createElement(D,[this.$createElement(j,{props:{color:this.color,value:t,ripple:!1},on:{input:()=>this.$emit("select",e)}})])},genDivider(e){return this.$createElement(A,{props:e})},genFilteredText(e){if(e=e||"",!this.searchInput||this.noFilter)return e;const{start:t,middle:s,end:i}=this.getMaskedCharacters(e);return[t,this.genHighlight(s),i]},genHeader(e){return this.$createElement(G,{props:e},e.header)},genHighlight(e){return this.$createElement("span",{staticClass:"v-list-item__mask"},e)},getMaskedCharacters(e){const t=(this.searchInput||"").toString().toLocaleLowerCase(),s=e.toLocaleLowerCase().indexOf(t);if(s<0)return{start:e,middle:"",end:""};const i=e.slice(0,s),n=e.slice(s,s+t.length),o=e.slice(s+t.length);return{start:i,middle:n,end:o}},genTile({item:e,index:t,disabled:s=null,value:i=!1}){i||(i=this.hasItem(e)),e===Object(e)&&(s=s!==null?s:this.getDisabled(e));const n={attrs:{"aria-selected":String(i),id:`list-item-${this._uid}-${t}`,role:"option"},on:{mousedown:u=>{u.preventDefault()},click:()=>s||this.$emit("select",e)},props:{activeClass:this.tileActiveClass,disabled:s,ripple:!0,inputValue:i}};if(!this.$scopedSlots.item)return this.$createElement(f,n,[this.action&&!this.hideSelected&&this.items.length>0?this.genAction(e,i):null,this.genTileContent(e,t)]);const o=this,a=this.$scopedSlots.item({parent:o,item:e,attrs:{...n.attrs,...n.props},on:n.on});return this.needsTile(a)?this.$createElement(f,n,a):a},genTileContent(e,t=0){return this.$createElement(M,[this.$createElement(w,[this.genFilteredText(this.getText(e))])])},hasItem(e){return this.parsedItems.indexOf(this.getValue(e))>-1},needsTile(e){return e.length!==1||e[0].componentOptions==null||e[0].componentOptions.Ctor.options.name!=="v-list-item"},getDisabled(e){return!!h(e,this.itemDisabled,!1)},getText(e){return String(h(e,this.itemText,e))},getValue(e){return h(e,this.itemValue,this.getText(e))}},render(){const e=[],t=this.items.length;for(let s=0;s[]},itemColor:{type:String,default:"primary"},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},menuProps:{type:[String,Array,Object],default:()=>x},multiple:Boolean,openOnClear:Boolean,returnObject:Boolean,smallChips:Boolean},data(){return{cachedItems:this.cacheItems?this.items:[],menuIsBooted:!1,isMenuActive:!1,lastItem:20,lazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,selectedIndex:-1,selectedItems:[],keyboardLookupPrefix:"",keyboardLookupLastTime:0}},computed:{allItems(){return this.filterDuplicates(this.cachedItems.concat(this.items))},classes(){return{...r.options.computed.classes.call(this),"v-select":!0,"v-select--chips":this.hasChips,"v-select--chips--small":this.smallChips,"v-select--is-menu-active":this.isMenuActive,"v-select--is-multi":this.multiple}},computedItems(){return this.allItems},computedOwns(){return`list-${this._uid}`},computedCounterValue(){var e;const t=this.multiple?this.selectedItems:((e=this.getText(this.selectedItems[0]))!==null&&e!==void 0?e:"").toString();return typeof this.counterValue=="function"?this.counterValue(t):t.length},directives(){return this.isFocused?[{name:"click-outside",value:{handler:this.blur,closeConditional:this.closeConditional,include:()=>this.getOpenDependentElements()}}]:void 0},dynamicHeight(){return"auto"},hasChips(){return this.chips||this.smallChips},hasSlot(){return!!(this.hasChips||this.$scopedSlots.selection)},isDirty(){return this.selectedItems.length>0},listData(){const e=this.$vnode&&this.$vnode.context.$options._scopeId;return{attrs:{...e?{[e]:!0}:{},id:this.computedOwns},props:{action:this.multiple,color:this.itemColor,dense:this.dense,hideSelected:this.hideSelected,items:this.virtualizedItems,itemDisabled:this.itemDisabled,itemText:this.itemText,itemValue:this.itemValue,noDataText:this.$vuetify.lang.t(this.noDataText),selectedItems:this.selectedItems},on:{select:this.selectItem},scopedSlots:{item:this.$scopedSlots.item}}},staticList(){return(this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"])&&E("assert: staticList should not be called if slots are used"),this.$createElement($,this.listData)},virtualizedItems(){return this.$_menuProps.auto?this.computedItems:this.computedItems.slice(0,this.lastItem)},menuCanShow:()=>!0,$_menuProps(){let e=typeof this.menuProps=="string"?this.menuProps.split(","):this.menuProps;return Array.isArray(e)&&(e=e.reduce((t,s)=>(t[s.trim()]=!0,t),{})),{...x,eager:this.eager,value:this.menuCanShow&&this.isMenuActive,nudgeBottom:e.offsetY?1:0,...e}}},watch:{internalValue(e){this.initialValue=e,this.setSelectedItems(),this.multiple&&this.$nextTick(()=>{var t;(t=this.$refs.menu)===null||t===void 0||t.updateDimensions()})},isMenuActive(e){window.setTimeout(()=>this.onMenuActiveChange(e))},items:{immediate:!0,handler(e){this.cacheItems&&this.$nextTick(()=>{this.cachedItems=this.filterDuplicates(this.cachedItems.concat(e))}),this.setSelectedItems()}}},methods:{blur(e){r.options.methods.blur.call(this,e),this.isMenuActive=!1,this.isFocused=!1,this.selectedIndex=-1,this.setMenuIndex(-1)},activateMenu(){!this.isInteractive||this.isMenuActive||(this.isMenuActive=!0)},clearableCallback(){this.setValue(this.multiple?[]:null),this.setMenuIndex(-1),this.$nextTick(()=>this.$refs.input&&this.$refs.input.focus()),this.openOnClear&&(this.isMenuActive=!0)},closeConditional(e){return this.isMenuActive?!this._isDestroyed&&(!this.getContent()||!this.getContent().contains(e.target))&&this.$el&&!this.$el.contains(e.target)&&e.target!==this.$el:!0},filterDuplicates(e){const t=new Map;for(let s=0;sthis.valueComparator(this.getValue(s),t))},getContent(){return this.$refs.menu&&this.$refs.menu.$refs.content},genChipSelection(e,t){const s=this.isDisabled||this.getDisabled(e),i=!s&&this.isInteractive;return this.$createElement(K,{staticClass:"v-chip--select",attrs:{tabindex:-1},props:{close:this.deletableChips&&i,disabled:s,inputValue:t===this.selectedIndex,small:this.smallChips},on:{click:n=>{i&&(n.stopPropagation(),this.selectedIndex=t)},"click:close":()=>this.onChipInput(e)},key:JSON.stringify(this.getValue(e))},this.getText(e))},genCommaSelection(e,t,s){const i=t===this.selectedIndex&&this.computedColor,n=this.isDisabled||this.getDisabled(e);return this.$createElement("div",this.setTextColor(i,{staticClass:"v-select__selection v-select__selection--comma",class:{"v-select__selection--disabled":n},key:JSON.stringify(this.getValue(e))}),`${this.getText(e)}${s?"":", "}`)},genDefaultSlot(){const e=this.genSelections(),t=this.genInput();return Array.isArray(e)?e.push(t):(e.children=e.children||[],e.children.push(t)),[this.genFieldset(),this.$createElement("div",{staticClass:"v-select__slot",directives:this.directives},[this.genLabel(),this.prefix?this.genAffix("prefix"):null,e,this.suffix?this.genAffix("suffix"):null,this.genClearIcon(),this.genIconSlot(),this.genHiddenInput()]),this.genMenu(),this.genProgress()]},genIcon(e,t,s){const i=O.options.methods.genIcon.call(this,e,t,s);return e==="append"&&(i.children[0].data=I(i.children[0].data,{attrs:{tabindex:i.children[0].componentOptions.listeners&&"-1","aria-hidden":"true","aria-label":void 0}})),i},genInput(){const e=r.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data=I(e.data,{domProps:{value:null},attrs:{readonly:!0,type:"text","aria-readonly":String(this.isReadonly),"aria-activedescendant":b(this.$refs.menu,"activeTile.id"),autocomplete:b(e.data,"attrs.autocomplete","off"),placeholder:!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?this.placeholder:void 0},on:{keypress:this.onKeyPress}}),e},genHiddenInput(){return this.$createElement("input",{domProps:{value:this.lazyValue},attrs:{type:"hidden",name:this.attrs$.name}})},genInputSlot(){const e=r.options.methods.genInputSlot.call(this);return e.data.attrs={...e.data.attrs,role:"button","aria-haspopup":"listbox","aria-expanded":String(this.isMenuActive),"aria-owns":this.computedOwns},e},genList(){return this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"]?this.genListWithSlot():this.staticList},genListWithSlot(){const e=["prepend-item","no-data","append-item"].filter(t=>this.$slots[t]).map(t=>this.$createElement("template",{slot:t},this.$slots[t]));return this.$createElement($,{...this.listData},e)},genMenu(){const e=this.$_menuProps;return e.activator=this.$refs["input-slot"],this.attach===""||this.attach===!0||this.attach==="attach"?e.attach=this.$el:e.attach=this.attach,this.$createElement(P,{attrs:{role:void 0},props:e,on:{input:t=>{this.isMenuActive=t,this.isFocused=t},scroll:this.onScroll},ref:"menu"},[this.genList()])},genSelections(){let e=this.selectedItems.length;const t=new Array(e);let s;for(this.$scopedSlots.selection?s=this.genSlotSelection:this.hasChips?s=this.genChipSelection:s=this.genCommaSelection;e--;)t[e]=s(this.selectedItems[e],e,e===t.length-1);return this.$createElement("div",{staticClass:"v-select__selections"},t)},genSlotSelection(e,t){return this.$scopedSlots.selection({attrs:{class:"v-chip--select"},parent:this,item:e,index:t,select:s=>{s.stopPropagation(),this.selectedIndex=t},selected:t===this.selectedIndex,disabled:!this.isInteractive})},getMenuIndex(){return this.$refs.menu?this.$refs.menu.listIndex:-1},getDisabled(e){return h(e,this.itemDisabled,!1)},getText(e){return h(e,this.itemText,e)},getValue(e){return h(e,this.itemValue,this.getText(e))},onBlur(e){e&&this.$emit("blur",e)},onChipInput(e){this.multiple?this.selectItem(e):this.setValue(null),this.selectedItems.length===0?this.isMenuActive=!0:this.isMenuActive=!1,this.selectedIndex=-1},onClick(e){this.isInteractive&&(this.isAppendInner(e.target)||(this.isMenuActive=!0),this.isFocused||(this.isFocused=!0,this.$emit("focus")),this.$emit("click",e))},onEscDown(e){e.preventDefault(),this.isMenuActive&&(e.stopPropagation(),this.isMenuActive=!1)},onKeyPress(e){if(this.multiple||!this.isInteractive||this.disableLookup||e.key.length>1||e.ctrlKey||e.metaKey||e.altKey)return;const t=1e3,s=performance.now();s-this.keyboardLookupLastTime>t&&(this.keyboardLookupPrefix=""),this.keyboardLookupPrefix+=e.key.toLowerCase(),this.keyboardLookupLastTime=s;const i=this.allItems.findIndex(o=>{var a;return((a=this.getText(o))!==null&&a!==void 0?a:"").toString().toLowerCase().startsWith(this.keyboardLookupPrefix)}),n=this.allItems[i];i!==-1&&(this.lastItem=Math.max(this.lastItem,i+5),this.setValue(this.returnObject?n:this.getValue(n)),this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))},onKeyDown(e){if(this.isReadonly&&e.keyCode!==l.tab)return;const t=e.keyCode,s=this.$refs.menu;if(this.$emit("keydown",e),!!s){if(this.isMenuActive&&[l.up,l.down,l.home,l.end,l.enter].includes(t)&&this.$nextTick(()=>{s.changeListIndex(e),this.$emit("update:list-index",s.listIndex)}),[l.enter,l.space].includes(t)&&this.activateMenu(),!this.isMenuActive&&[l.up,l.down,l.home,l.end].includes(t))return this.onUpDown(e);if(t===l.esc)return this.onEscDown(e);if(t===l.tab)return this.onTabDown(e);if(t===l.space)return this.onSpaceDown(e)}},onMenuActiveChange(e){if(this.multiple&&!e||this.getMenuIndex()>-1)return;const t=this.$refs.menu;if(!(!t||!this.isDirty)){this.$refs.menu.getTiles();for(let s=0;sthis.isMenuActive=!this.isMenuActive),r.options.methods.onMouseUp.call(this,e)},onScroll(){if(!this.isMenuActive)requestAnimationFrame(()=>this.getContent().scrollTop=0);else{if(this.lastItem>this.computedItems.length)return;this.getContent().scrollHeight-(this.getContent().scrollTop+this.getContent().clientHeight)<200&&(this.lastItem+=20)}},onSpaceDown(e){e.preventDefault()},onTabDown(e){const t=this.$refs.menu;if(!t)return;const s=t.activeTile;!this.multiple&&s&&this.isMenuActive?(e.preventDefault(),e.stopPropagation(),s.click()):this.blur(e)},onUpDown(e){const t=this.$refs.menu;if(!t)return;if(e.preventDefault(),this.multiple)return this.activateMenu();const s=e.keyCode;t.isBooted=!0,window.requestAnimationFrame(()=>{if(t.getTiles(),!t.hasClickableTiles)return this.activateMenu();switch(s){case l.up:t.prevTile();break;case l.down:t.nextTile();break;case l.home:t.firstTile();break;case l.end:t.lastTile();break}this.selectItem(this.allItems[this.getMenuIndex()])})},selectItem(e){if(!this.multiple)this.setValue(this.returnObject?e:this.getValue(e)),this.isMenuActive=!1;else{const t=(this.internalValue||[]).slice(),s=this.findExistingIndex(e);if(s!==-1?t.splice(s,1):t.push(e),this.setValue(t.map(i=>this.returnObject?i:this.getValue(i))),this.hideSelected)this.setMenuIndex(-1);else{const i=this.allItems.indexOf(e);~i&&(this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))}}},setMenuIndex(e){this.$refs.menu&&(this.$refs.menu.listIndex=e)},setSelectedItems(){const e=[],t=!this.multiple||!Array.isArray(this.internalValue)?[this.internalValue]:this.internalValue;for(const s of t){const i=this.allItems.findIndex(n=>this.valueComparator(this.getValue(n),this.getValue(s)));i>-1&&e.push(this.allItems[i])}this.selectedItems=e},setValue(e){this.valueComparator(e,this.internalValue)||(this.internalValue=e,this.$emit("change",e))},isAppendInner(e){const t=this.$refs["append-inner"];return t&&(t===e||t.contains(e))}}});export{J as V,G as _,K as a,j as b,x as d}; +import{J as d,bF as y,aY as k,T as p,b4 as m,bG as S,K as c,aQ as _,b as g,bH as T,I as C,b7 as v,aI as I,S as V,e as f,h as D,i as A,V as M,f as w,aG as h,d as B,ba as L,j as r,aK as E,b9 as O,X as b,k as P,aH as l,bI as F,bJ as H}from"./index-e409ba63.js";const K=d(c,S,m,p,k("chipGroup"),y("inputValue")).extend({name:"v-chip",props:{active:{type:Boolean,default:!0},activeClass:{type:String,default(){return this.chipGroup?this.chipGroup.activeClass:""}},close:Boolean,closeIcon:{type:String,default:"$delete"},closeLabel:{type:String,default:"$vuetify.close"},disabled:Boolean,draggable:Boolean,filter:Boolean,filterIcon:{type:String,default:"$complete"},label:Boolean,link:Boolean,outlined:Boolean,pill:Boolean,tag:{type:String,default:"span"},textColor:String,value:null},data:()=>({proxyClass:"v-chip--active"}),computed:{classes(){return{"v-chip":!0,...m.options.computed.classes.call(this),"v-chip--clickable":this.isClickable,"v-chip--disabled":this.disabled,"v-chip--draggable":this.draggable,"v-chip--label":this.label,"v-chip--link":this.isLink,"v-chip--no-color":!this.color,"v-chip--outlined":this.outlined,"v-chip--pill":this.pill,"v-chip--removable":this.hasClose,...this.themeClasses,...this.sizeableClasses,...this.groupClasses}},hasClose(){return!!this.close},isClickable(){return!!(m.options.computed.isClickable.call(this)||this.chipGroup)}},created(){[["outline","outlined"],["selected","input-value"],["value","active"],["@input","@active.sync"]].forEach(([t,s])=>{this.$attrs.hasOwnProperty(t)&&_(t,s,this)})},methods:{click(e){this.$emit("click",e),this.chipGroup&&this.toggle()},genFilter(){const e=[];return this.isActive&&e.push(this.$createElement(g,{staticClass:"v-chip__filter",props:{left:!0}},this.filterIcon)),this.$createElement(T,e)},genClose(){return this.$createElement(g,{staticClass:"v-chip__close",props:{right:!0,size:18},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:e=>{e.stopPropagation(),e.preventDefault(),this.$emit("click:close"),this.$emit("update:active",!1)}}},this.closeIcon)},genContent(){return this.$createElement("span",{staticClass:"v-chip__content"},[this.filter&&this.genFilter(),this.$slots.default,this.hasClose&&this.genClose()])}},render(e){const t=[this.genContent()];let{tag:s,data:i}=this.generateRouteLink();i.attrs={...i.attrs,draggable:this.draggable?"true":void 0,tabindex:this.chipGroup&&!this.disabled?0:i.attrs.tabindex},i.directives.push({name:"show",value:this.active}),i=this.setBackgroundColor(this.color,i);const n=this.textColor||this.outlined&&this.color;return e(s,this.setTextColor(n,i),t)}});const j=C.extend({name:"v-simple-checkbox",functional:!0,directives:{Ripple:v},props:{...c.options.props,...p.options.props,disabled:Boolean,ripple:{type:Boolean,default:!0},value:Boolean,indeterminate:Boolean,indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},onIcon:{type:String,default:"$checkboxOn"},offIcon:{type:String,default:"$checkboxOff"}},render(e,{props:t,data:s,listeners:i}){const n=[];let o=t.offIcon;if(t.indeterminate?o=t.indeterminateIcon:t.value&&(o=t.onIcon),n.push(e(g,c.options.methods.setTextColor(t.value&&t.color,{props:{disabled:t.disabled,dark:t.dark,light:t.light}}),o)),t.ripple&&!t.disabled){const a=e("div",c.options.methods.setTextColor(t.color,{staticClass:"v-input--selection-controls__ripple",directives:[{def:v,name:"ripple",value:{center:!0}}]}));n.push(a)}return e("div",I(s,{class:{"v-simple-checkbox":!0,"v-simple-checkbox--disabled":t.disabled},on:{click:a=>{a.stopPropagation(),s.on&&s.on.input&&!t.disabled&&V(s.on.input).forEach(u=>u(!t.value))}}}),[e("div",{staticClass:"v-input--selection-controls__input"},n)])}});const G=d(p).extend({name:"v-subheader",props:{inset:Boolean},render(e){return e("div",{staticClass:"v-subheader",class:{"v-subheader--inset":this.inset,...this.themeClasses},attrs:this.$attrs,on:this.$listeners},this.$slots.default)}}),$=d(c,p).extend({name:"v-select-list",directives:{ripple:v},props:{action:Boolean,dense:Boolean,hideSelected:Boolean,items:{type:Array,default:()=>[]},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},noDataText:String,noFilter:Boolean,searchInput:null,selectedItems:{type:Array,default:()=>[]}},computed:{parsedItems(){return this.selectedItems.map(e=>this.getValue(e))},tileActiveClass(){return Object.keys(this.setTextColor(this.color).class||{}).join(" ")},staticNoDataTile(){const e={attrs:{role:void 0},on:{mousedown:t=>t.preventDefault()}};return this.$createElement(f,e,[this.genTileContent(this.noDataText)])}},methods:{genAction(e,t){return this.$createElement(D,[this.$createElement(j,{props:{color:this.color,value:t,ripple:!1},on:{input:()=>this.$emit("select",e)}})])},genDivider(e){return this.$createElement(A,{props:e})},genFilteredText(e){if(e=e||"",!this.searchInput||this.noFilter)return e;const{start:t,middle:s,end:i}=this.getMaskedCharacters(e);return[t,this.genHighlight(s),i]},genHeader(e){return this.$createElement(G,{props:e},e.header)},genHighlight(e){return this.$createElement("span",{staticClass:"v-list-item__mask"},e)},getMaskedCharacters(e){const t=(this.searchInput||"").toString().toLocaleLowerCase(),s=e.toLocaleLowerCase().indexOf(t);if(s<0)return{start:e,middle:"",end:""};const i=e.slice(0,s),n=e.slice(s,s+t.length),o=e.slice(s+t.length);return{start:i,middle:n,end:o}},genTile({item:e,index:t,disabled:s=null,value:i=!1}){i||(i=this.hasItem(e)),e===Object(e)&&(s=s!==null?s:this.getDisabled(e));const n={attrs:{"aria-selected":String(i),id:`list-item-${this._uid}-${t}`,role:"option"},on:{mousedown:u=>{u.preventDefault()},click:()=>s||this.$emit("select",e)},props:{activeClass:this.tileActiveClass,disabled:s,ripple:!0,inputValue:i}};if(!this.$scopedSlots.item)return this.$createElement(f,n,[this.action&&!this.hideSelected&&this.items.length>0?this.genAction(e,i):null,this.genTileContent(e,t)]);const o=this,a=this.$scopedSlots.item({parent:o,item:e,attrs:{...n.attrs,...n.props},on:n.on});return this.needsTile(a)?this.$createElement(f,n,a):a},genTileContent(e,t=0){return this.$createElement(M,[this.$createElement(w,[this.genFilteredText(this.getText(e))])])},hasItem(e){return this.parsedItems.indexOf(this.getValue(e))>-1},needsTile(e){return e.length!==1||e[0].componentOptions==null||e[0].componentOptions.Ctor.options.name!=="v-list-item"},getDisabled(e){return!!h(e,this.itemDisabled,!1)},getText(e){return String(h(e,this.itemText,e))},getValue(e){return h(e,this.itemValue,this.getText(e))}},render(){const e=[],t=this.items.length;for(let s=0;s[]},itemColor:{type:String,default:"primary"},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},menuProps:{type:[String,Array,Object],default:()=>x},multiple:Boolean,openOnClear:Boolean,returnObject:Boolean,smallChips:Boolean},data(){return{cachedItems:this.cacheItems?this.items:[],menuIsBooted:!1,isMenuActive:!1,lastItem:20,lazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,selectedIndex:-1,selectedItems:[],keyboardLookupPrefix:"",keyboardLookupLastTime:0}},computed:{allItems(){return this.filterDuplicates(this.cachedItems.concat(this.items))},classes(){return{...r.options.computed.classes.call(this),"v-select":!0,"v-select--chips":this.hasChips,"v-select--chips--small":this.smallChips,"v-select--is-menu-active":this.isMenuActive,"v-select--is-multi":this.multiple}},computedItems(){return this.allItems},computedOwns(){return`list-${this._uid}`},computedCounterValue(){var e;const t=this.multiple?this.selectedItems:((e=this.getText(this.selectedItems[0]))!==null&&e!==void 0?e:"").toString();return typeof this.counterValue=="function"?this.counterValue(t):t.length},directives(){return this.isFocused?[{name:"click-outside",value:{handler:this.blur,closeConditional:this.closeConditional,include:()=>this.getOpenDependentElements()}}]:void 0},dynamicHeight(){return"auto"},hasChips(){return this.chips||this.smallChips},hasSlot(){return!!(this.hasChips||this.$scopedSlots.selection)},isDirty(){return this.selectedItems.length>0},listData(){const e=this.$vnode&&this.$vnode.context.$options._scopeId;return{attrs:{...e?{[e]:!0}:{},id:this.computedOwns},props:{action:this.multiple,color:this.itemColor,dense:this.dense,hideSelected:this.hideSelected,items:this.virtualizedItems,itemDisabled:this.itemDisabled,itemText:this.itemText,itemValue:this.itemValue,noDataText:this.$vuetify.lang.t(this.noDataText),selectedItems:this.selectedItems},on:{select:this.selectItem},scopedSlots:{item:this.$scopedSlots.item}}},staticList(){return(this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"])&&E("assert: staticList should not be called if slots are used"),this.$createElement($,this.listData)},virtualizedItems(){return this.$_menuProps.auto?this.computedItems:this.computedItems.slice(0,this.lastItem)},menuCanShow:()=>!0,$_menuProps(){let e=typeof this.menuProps=="string"?this.menuProps.split(","):this.menuProps;return Array.isArray(e)&&(e=e.reduce((t,s)=>(t[s.trim()]=!0,t),{})),{...x,eager:this.eager,value:this.menuCanShow&&this.isMenuActive,nudgeBottom:e.offsetY?1:0,...e}}},watch:{internalValue(e){this.initialValue=e,this.setSelectedItems(),this.multiple&&this.$nextTick(()=>{var t;(t=this.$refs.menu)===null||t===void 0||t.updateDimensions()})},isMenuActive(e){window.setTimeout(()=>this.onMenuActiveChange(e))},items:{immediate:!0,handler(e){this.cacheItems&&this.$nextTick(()=>{this.cachedItems=this.filterDuplicates(this.cachedItems.concat(e))}),this.setSelectedItems()}}},methods:{blur(e){r.options.methods.blur.call(this,e),this.isMenuActive=!1,this.isFocused=!1,this.selectedIndex=-1,this.setMenuIndex(-1)},activateMenu(){!this.isInteractive||this.isMenuActive||(this.isMenuActive=!0)},clearableCallback(){this.setValue(this.multiple?[]:null),this.setMenuIndex(-1),this.$nextTick(()=>this.$refs.input&&this.$refs.input.focus()),this.openOnClear&&(this.isMenuActive=!0)},closeConditional(e){return this.isMenuActive?!this._isDestroyed&&(!this.getContent()||!this.getContent().contains(e.target))&&this.$el&&!this.$el.contains(e.target)&&e.target!==this.$el:!0},filterDuplicates(e){const t=new Map;for(let s=0;sthis.valueComparator(this.getValue(s),t))},getContent(){return this.$refs.menu&&this.$refs.menu.$refs.content},genChipSelection(e,t){const s=this.isDisabled||this.getDisabled(e),i=!s&&this.isInteractive;return this.$createElement(K,{staticClass:"v-chip--select",attrs:{tabindex:-1},props:{close:this.deletableChips&&i,disabled:s,inputValue:t===this.selectedIndex,small:this.smallChips},on:{click:n=>{i&&(n.stopPropagation(),this.selectedIndex=t)},"click:close":()=>this.onChipInput(e)},key:JSON.stringify(this.getValue(e))},this.getText(e))},genCommaSelection(e,t,s){const i=t===this.selectedIndex&&this.computedColor,n=this.isDisabled||this.getDisabled(e);return this.$createElement("div",this.setTextColor(i,{staticClass:"v-select__selection v-select__selection--comma",class:{"v-select__selection--disabled":n},key:JSON.stringify(this.getValue(e))}),`${this.getText(e)}${s?"":", "}`)},genDefaultSlot(){const e=this.genSelections(),t=this.genInput();return Array.isArray(e)?e.push(t):(e.children=e.children||[],e.children.push(t)),[this.genFieldset(),this.$createElement("div",{staticClass:"v-select__slot",directives:this.directives},[this.genLabel(),this.prefix?this.genAffix("prefix"):null,e,this.suffix?this.genAffix("suffix"):null,this.genClearIcon(),this.genIconSlot(),this.genHiddenInput()]),this.genMenu(),this.genProgress()]},genIcon(e,t,s){const i=O.options.methods.genIcon.call(this,e,t,s);return e==="append"&&(i.children[0].data=I(i.children[0].data,{attrs:{tabindex:i.children[0].componentOptions.listeners&&"-1","aria-hidden":"true","aria-label":void 0}})),i},genInput(){const e=r.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data=I(e.data,{domProps:{value:null},attrs:{readonly:!0,type:"text","aria-readonly":String(this.isReadonly),"aria-activedescendant":b(this.$refs.menu,"activeTile.id"),autocomplete:b(e.data,"attrs.autocomplete","off"),placeholder:!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?this.placeholder:void 0},on:{keypress:this.onKeyPress}}),e},genHiddenInput(){return this.$createElement("input",{domProps:{value:this.lazyValue},attrs:{type:"hidden",name:this.attrs$.name}})},genInputSlot(){const e=r.options.methods.genInputSlot.call(this);return e.data.attrs={...e.data.attrs,role:"button","aria-haspopup":"listbox","aria-expanded":String(this.isMenuActive),"aria-owns":this.computedOwns},e},genList(){return this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"]?this.genListWithSlot():this.staticList},genListWithSlot(){const e=["prepend-item","no-data","append-item"].filter(t=>this.$slots[t]).map(t=>this.$createElement("template",{slot:t},this.$slots[t]));return this.$createElement($,{...this.listData},e)},genMenu(){const e=this.$_menuProps;return e.activator=this.$refs["input-slot"],this.attach===""||this.attach===!0||this.attach==="attach"?e.attach=this.$el:e.attach=this.attach,this.$createElement(P,{attrs:{role:void 0},props:e,on:{input:t=>{this.isMenuActive=t,this.isFocused=t},scroll:this.onScroll},ref:"menu"},[this.genList()])},genSelections(){let e=this.selectedItems.length;const t=new Array(e);let s;for(this.$scopedSlots.selection?s=this.genSlotSelection:this.hasChips?s=this.genChipSelection:s=this.genCommaSelection;e--;)t[e]=s(this.selectedItems[e],e,e===t.length-1);return this.$createElement("div",{staticClass:"v-select__selections"},t)},genSlotSelection(e,t){return this.$scopedSlots.selection({attrs:{class:"v-chip--select"},parent:this,item:e,index:t,select:s=>{s.stopPropagation(),this.selectedIndex=t},selected:t===this.selectedIndex,disabled:!this.isInteractive})},getMenuIndex(){return this.$refs.menu?this.$refs.menu.listIndex:-1},getDisabled(e){return h(e,this.itemDisabled,!1)},getText(e){return h(e,this.itemText,e)},getValue(e){return h(e,this.itemValue,this.getText(e))},onBlur(e){e&&this.$emit("blur",e)},onChipInput(e){this.multiple?this.selectItem(e):this.setValue(null),this.selectedItems.length===0?this.isMenuActive=!0:this.isMenuActive=!1,this.selectedIndex=-1},onClick(e){this.isInteractive&&(this.isAppendInner(e.target)||(this.isMenuActive=!0),this.isFocused||(this.isFocused=!0,this.$emit("focus")),this.$emit("click",e))},onEscDown(e){e.preventDefault(),this.isMenuActive&&(e.stopPropagation(),this.isMenuActive=!1)},onKeyPress(e){if(this.multiple||!this.isInteractive||this.disableLookup||e.key.length>1||e.ctrlKey||e.metaKey||e.altKey)return;const t=1e3,s=performance.now();s-this.keyboardLookupLastTime>t&&(this.keyboardLookupPrefix=""),this.keyboardLookupPrefix+=e.key.toLowerCase(),this.keyboardLookupLastTime=s;const i=this.allItems.findIndex(o=>{var a;return((a=this.getText(o))!==null&&a!==void 0?a:"").toString().toLowerCase().startsWith(this.keyboardLookupPrefix)}),n=this.allItems[i];i!==-1&&(this.lastItem=Math.max(this.lastItem,i+5),this.setValue(this.returnObject?n:this.getValue(n)),this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))},onKeyDown(e){if(this.isReadonly&&e.keyCode!==l.tab)return;const t=e.keyCode,s=this.$refs.menu;if(this.$emit("keydown",e),!!s){if(this.isMenuActive&&[l.up,l.down,l.home,l.end,l.enter].includes(t)&&this.$nextTick(()=>{s.changeListIndex(e),this.$emit("update:list-index",s.listIndex)}),[l.enter,l.space].includes(t)&&this.activateMenu(),!this.isMenuActive&&[l.up,l.down,l.home,l.end].includes(t))return this.onUpDown(e);if(t===l.esc)return this.onEscDown(e);if(t===l.tab)return this.onTabDown(e);if(t===l.space)return this.onSpaceDown(e)}},onMenuActiveChange(e){if(this.multiple&&!e||this.getMenuIndex()>-1)return;const t=this.$refs.menu;if(!(!t||!this.isDirty)){this.$refs.menu.getTiles();for(let s=0;sthis.isMenuActive=!this.isMenuActive),r.options.methods.onMouseUp.call(this,e)},onScroll(){if(!this.isMenuActive)requestAnimationFrame(()=>this.getContent().scrollTop=0);else{if(this.lastItem>this.computedItems.length)return;this.getContent().scrollHeight-(this.getContent().scrollTop+this.getContent().clientHeight)<200&&(this.lastItem+=20)}},onSpaceDown(e){e.preventDefault()},onTabDown(e){const t=this.$refs.menu;if(!t)return;const s=t.activeTile;!this.multiple&&s&&this.isMenuActive?(e.preventDefault(),e.stopPropagation(),s.click()):this.blur(e)},onUpDown(e){const t=this.$refs.menu;if(!t)return;if(e.preventDefault(),this.multiple)return this.activateMenu();const s=e.keyCode;t.isBooted=!0,window.requestAnimationFrame(()=>{if(t.getTiles(),!t.hasClickableTiles)return this.activateMenu();switch(s){case l.up:t.prevTile();break;case l.down:t.nextTile();break;case l.home:t.firstTile();break;case l.end:t.lastTile();break}this.selectItem(this.allItems[this.getMenuIndex()])})},selectItem(e){if(!this.multiple)this.setValue(this.returnObject?e:this.getValue(e)),this.isMenuActive=!1;else{const t=(this.internalValue||[]).slice(),s=this.findExistingIndex(e);if(s!==-1?t.splice(s,1):t.push(e),this.setValue(t.map(i=>this.returnObject?i:this.getValue(i))),this.hideSelected)this.setMenuIndex(-1);else{const i=this.allItems.indexOf(e);~i&&(this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))}}},setMenuIndex(e){this.$refs.menu&&(this.$refs.menu.listIndex=e)},setSelectedItems(){const e=[],t=!this.multiple||!Array.isArray(this.internalValue)?[this.internalValue]:this.internalValue;for(const s of t){const i=this.allItems.findIndex(n=>this.valueComparator(this.getValue(n),this.getValue(s)));i>-1&&e.push(this.allItems[i])}this.selectedItems=e},setValue(e){this.valueComparator(e,this.internalValue)||(this.internalValue=e,this.$emit("change",e))},isAppendInner(e){const t=this.$refs["append-inner"];return t&&(t===e||t.contains(e))}}});export{J as V,G as _,K as a,j as b,x as d}; diff --git a/dist/assets/VSwitch-2cfffd69.js b/dist/assets/VSwitch-3f004360.js similarity index 96% rename from dist/assets/VSwitch-2cfffd69.js rename to dist/assets/VSwitch-3f004360.js index d07d130..36bd7dd 100644 --- a/dist/assets/VSwitch-2cfffd69.js +++ b/dist/assets/VSwitch-3f004360.js @@ -1 +1 @@ -import{bK as e,M as n,b9 as a,bL as h,bM as r,aH as i}from"./index-e8f29bb9.js";const l=e.extend({name:"v-switch",directives:{Touch:n},props:{inset:Boolean,loading:{type:[Boolean,String],default:!1},flat:{type:Boolean,default:!1}},computed:{classes(){return{...a.options.computed.classes.call(this),"v-input--selection-controls v-input--switch":!0,"v-input--switch--flat":this.flat,"v-input--switch--inset":this.inset}},attrs(){return{"aria-checked":String(this.isActive),"aria-disabled":String(this.isDisabled),role:"switch"}},validationState(){if(this.hasError&&this.shouldValidate)return"error";if(this.hasSuccess)return"success";if(this.hasColor!==null)return this.computedColor},switchData(){return this.setTextColor(this.loading?void 0:this.validationState,{class:this.themeClasses})}},methods:{genDefaultSlot(){return[this.genSwitch(),this.genLabel()]},genSwitch(){const{title:t,...s}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.genInput("checkbox",{...this.attrs,...s}),this.genRipple(this.setTextColor(this.validationState,{directives:[{name:"touch",value:{left:this.onSwipeLeft,right:this.onSwipeRight}}]})),this.$createElement("div",{staticClass:"v-input--switch__track",...this.switchData}),this.$createElement("div",{staticClass:"v-input--switch__thumb",...this.switchData},[this.genProgress()])])},genProgress(){return this.$createElement(h,{},[this.loading===!1?null:this.$slots.progress||this.$createElement(r,{props:{color:this.loading===!0||this.loading===""?this.color||"primary":this.loading,size:16,width:2,indeterminate:!0}})])},onSwipeLeft(){this.isActive&&this.onChange()},onSwipeRight(){this.isActive||this.onChange()},onKeydown(t){(t.keyCode===i.left&&this.isActive||t.keyCode===i.right&&!this.isActive)&&this.onChange()}}});export{l as _}; +import{bK as e,M as n,b9 as a,bL as h,bM as r,aH as i}from"./index-e409ba63.js";const l=e.extend({name:"v-switch",directives:{Touch:n},props:{inset:Boolean,loading:{type:[Boolean,String],default:!1},flat:{type:Boolean,default:!1}},computed:{classes(){return{...a.options.computed.classes.call(this),"v-input--selection-controls v-input--switch":!0,"v-input--switch--flat":this.flat,"v-input--switch--inset":this.inset}},attrs(){return{"aria-checked":String(this.isActive),"aria-disabled":String(this.isDisabled),role:"switch"}},validationState(){if(this.hasError&&this.shouldValidate)return"error";if(this.hasSuccess)return"success";if(this.hasColor!==null)return this.computedColor},switchData(){return this.setTextColor(this.loading?void 0:this.validationState,{class:this.themeClasses})}},methods:{genDefaultSlot(){return[this.genSwitch(),this.genLabel()]},genSwitch(){const{title:t,...s}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.genInput("checkbox",{...this.attrs,...s}),this.genRipple(this.setTextColor(this.validationState,{directives:[{name:"touch",value:{left:this.onSwipeLeft,right:this.onSwipeRight}}]})),this.$createElement("div",{staticClass:"v-input--switch__track",...this.switchData}),this.$createElement("div",{staticClass:"v-input--switch__thumb",...this.switchData},[this.genProgress()])])},genProgress(){return this.$createElement(h,{},[this.loading===!1?null:this.$slots.progress||this.$createElement(r,{props:{color:this.loading===!0||this.loading===""?this.color||"primary":this.loading,size:16,width:2,indeterminate:!0}})])},onSwipeLeft(){this.isActive&&this.onChange()},onSwipeRight(){this.isActive||this.onChange()},onKeydown(t){(t.keyCode===i.left&&this.isActive||t.keyCode===i.right&&!this.isActive)&&this.onChange()}}});export{l as _}; diff --git a/dist/assets/VTabItem-e0010b3a.js b/dist/assets/VTabItem-01f057dc.js similarity index 99% rename from dist/assets/VTabItem-e0010b3a.js rename to dist/assets/VTabItem-01f057dc.js index 57ba79d..ca7ffee 100644 --- a/dist/assets/VTabItem-e0010b3a.js +++ b/dist/assets/VTabItem-01f057dc.js @@ -1 +1 @@ -import{M as f,a as I,b,R as l,J as h,aY as x,aZ as S,a_ as _,a$ as $,b0 as B,b1 as O,T as p,b2 as k,K as y,b3 as A,b4 as C,aH as R}from"./index-e8f29bb9.js";import{B as d}from"./VItemGroup-e39c2c83.js";const v=d.extend({name:"v-window",directives:{Touch:f},provide(){return{windowGroup:this}},props:{activeClass:{type:String,default:"v-window-item--active"},continuous:Boolean,mandatory:{type:Boolean,default:!0},nextIcon:{type:[Boolean,String],default:"$next"},prevIcon:{type:[Boolean,String],default:"$prev"},reverse:Boolean,showArrows:Boolean,showArrowsOnHover:Boolean,touch:Object,touchless:Boolean,value:{required:!1},vertical:Boolean},data(){return{changedByDelimiters:!1,internalHeight:void 0,transitionHeight:void 0,transitionCount:0,isBooted:!1,isReverse:!1}},computed:{isActive(){return this.transitionCount>0},classes(){return{...d.options.computed.classes.call(this),"v-window--show-arrows-on-hover":this.showArrowsOnHover}},computedTransition(){if(!this.isBooted)return"";const t=this.vertical?"y":"x",s=(this.internalReverse?!this.isReverse:this.isReverse)?"-reverse":"";return`v-window-${t}${s}-transition`},hasActiveItems(){return!!this.items.find(t=>!t.disabled)},hasNext(){return this.continuous||this.internalIndex0},internalIndex(){return this.items.findIndex((t,e)=>this.internalValue===this.getValue(t,e))},internalReverse(){return this.$vuetify.rtl?!this.reverse:this.reverse}},watch:{internalIndex(t,e){this.isReverse=this.updateReverse(t,e)}},mounted(){window.requestAnimationFrame(()=>this.isBooted=!0)},methods:{genDefaultSlot(){return this.$slots.default},genContainer(){const t=[this.genDefaultSlot()];return this.showArrows&&t.push(this.genControlIcons()),this.$createElement("div",{staticClass:"v-window__container",class:{"v-window__container--is-active":this.isActive},style:{height:this.internalHeight||this.transitionHeight}},t)},genIcon(t,e,s){var i,n,r;const a={click:T=>{T.stopPropagation(),this.changedByDelimiters=!0,s()}},o={"aria-label":this.$vuetify.lang.t(`$vuetify.carousel.${t}`)},u=(r=(n=(i=this.$scopedSlots)[t])===null||n===void 0?void 0:n.call(i,{on:a,attrs:o}))!==null&&r!==void 0?r:[this.$createElement(I,{props:{icon:!0},attrs:o,on:a},[this.$createElement(b,{props:{large:!0}},e)])];return this.$createElement("div",{staticClass:`v-window__${t}`},u)},genControlIcons(){const t=[],e=this.$vuetify.rtl?this.nextIcon:this.prevIcon;if(this.hasPrev&&e&&typeof e=="string"){const i=this.genIcon("prev",e,this.prev);i&&t.push(i)}const s=this.$vuetify.rtl?this.prevIcon:this.nextIcon;if(this.hasNext&&s&&typeof s=="string"){const i=this.genIcon("next",s,this.next);i&&t.push(i)}return t},getNextIndex(t){const e=(t+1)%this.items.length;return this.items[e].disabled?this.getNextIndex(e):e},getPrevIndex(t){const e=(t+this.items.length-1)%this.items.length;return this.items[e].disabled?this.getPrevIndex(e):e},next(){if(!this.hasActiveItems||!this.hasNext)return;const t=this.getNextIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},prev(){if(!this.hasActiveItems||!this.hasPrev)return;const t=this.getPrevIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},updateReverse(t,e){const s=this.items.length,i=s-1;return s<=2?t{this.$vuetify.rtl?this.prev():this.next()},right:()=>{this.$vuetify.rtl?this.next():this.prev()},end:i=>{i.stopPropagation()},start:i=>{i.stopPropagation()}};e.directives.push({name:"touch",value:s})}return t("div",e,[this.genContainer()])}}),P=h(S,x("windowGroup","v-window-item","v-window")),m=P.extend().extend().extend({name:"v-window-item",directives:{Touch:f},props:{disabled:Boolean,reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},value:{required:!1}},data(){return{isActive:!1,inTransition:!1}},computed:{classes(){return this.groupClasses},computedTransition(){return this.windowGroup.internalReverse?typeof this.reverseTransition<"u"?this.reverseTransition||"":this.windowGroup.computedTransition:typeof this.transition<"u"?this.transition||"":this.windowGroup.computedTransition}},methods:{genDefaultSlot(){return this.$slots.default},genWindowItem(){return this.$createElement("div",{staticClass:"v-window-item",class:this.classes,directives:[{name:"show",value:this.isActive}],on:this.$listeners},this.genDefaultSlot())},onAfterTransition(){this.inTransition&&(this.inTransition=!1,this.windowGroup.transitionCount>0&&(this.windowGroup.transitionCount--,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=void 0)))},onBeforeTransition(){this.inTransition||(this.inTransition=!0,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=l(this.windowGroup.$el.clientHeight)),this.windowGroup.transitionCount++)},onTransitionCancelled(){this.onAfterTransition()},onEnter(t){this.inTransition&&this.$nextTick(()=>{!this.computedTransition||!this.inTransition||(this.windowGroup.transitionHeight=l(t.clientHeight))})}},render(t){return t("transition",{props:{name:this.computedTransition},on:{beforeEnter:this.onBeforeTransition,afterEnter:this.onAfterTransition,enterCancelled:this.onTransitionCancelled,beforeLeave:this.onBeforeTransition,afterLeave:this.onAfterTransition,leaveCancelled:this.onTransitionCancelled,enter:this.onEnter}},this.showLazyContent(()=>[this.genWindowItem()]))}});function g(t){const s=Math.abs(t);return Math.sign(t)*(s/((1/.501-2)*(1-s)+1))}function w(t,e,s,i){const n=t.clientWidth,r=s?e.content-t.offsetLeft-n:t.offsetLeft;s&&(i=-i);const a=e.wrapper+i,o=n+r,u=n*.4;return r<=i?i=Math.max(r-u,0):a<=o&&(i=Math.min(i-(a-o-u),e.content-e.wrapper)),s?-i:i}function W(t,e,s){const{offsetLeft:i,clientWidth:n}=t;if(s){const r=e.content-i-n/2-e.wrapper/2;return-Math.min(e.content-e.wrapper,Math.max(0,r))}else{const r=i+n/2-e.wrapper/2;return Math.min(e.content-e.wrapper,Math.max(0,r))}}const c=h(d,_).extend({name:"base-slide-group",directives:{Resize:$,Touch:f},props:{activeClass:{type:String,default:"v-slide-item--active"},centerActive:Boolean,nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},showArrows:{type:[Boolean,String],validator:t=>typeof t=="boolean"||["always","desktop","mobile"].includes(t)}},data:()=>({isOverflowing:!1,resizeTimeout:0,startX:0,isSwipingHorizontal:!1,isSwiping:!1,scrollOffset:0,widths:{content:0,wrapper:0}}),computed:{canTouch(){return typeof window<"u"},__cachedNext(){return this.genTransition("next")},__cachedPrev(){return this.genTransition("prev")},classes(){return{...d.options.computed.classes.call(this),"v-slide-group":!0,"v-slide-group--has-affixes":this.hasAffixes,"v-slide-group--is-overflowing":this.isOverflowing}},hasAffixes(){switch(this.showArrows){case"always":return!0;case"desktop":return!this.isMobile;case!0:return this.isOverflowing||Math.abs(this.scrollOffset)>0;case"mobile":return this.isMobile||this.isOverflowing||Math.abs(this.scrollOffset)>0;default:return!this.isMobile&&(this.isOverflowing||Math.abs(this.scrollOffset)>0)}},hasNext(){if(!this.hasAffixes)return!1;const{content:t,wrapper:e}=this.widths;return t>Math.abs(this.scrollOffset)+e},hasPrev(){return this.hasAffixes&&this.scrollOffset!==0}},watch:{internalValue:"setWidths",isOverflowing:"setWidths",scrollOffset(t){this.$vuetify.rtl&&(t=-t);let e=t<=0?g(-t):t>this.widths.content-this.widths.wrapper?-(this.widths.content-this.widths.wrapper)+g(this.widths.content-this.widths.wrapper-t):-t;this.$vuetify.rtl&&(e=-e),this.$refs.content.style.transform=`translateX(${e}px)`}},mounted(){if(typeof ResizeObserver<"u"){const t=new ResizeObserver(()=>{this.onResize()});t.observe(this.$el),t.observe(this.$refs.content),this.$on("hook:destroyed",()=>{t.disconnect()})}else{let t=0;this.$on("hook:beforeUpdate",()=>{var e;t=(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length}),this.$on("hook:updated",()=>{var e;t!==(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length&&this.setWidths()})}},methods:{onScroll(){this.$refs.wrapper.scrollLeft=0},onFocusin(t){if(this.isOverflowing){for(const e of B(t))for(const s of this.items)if(s.$el===e){this.scrollOffset=w(s.$el,this.widths,this.$vuetify.rtl,this.scrollOffset);return}}},genNext(){const t=this.$scopedSlots.next?this.$scopedSlots.next({}):this.$slots.next||this.__cachedNext;return this.$createElement("div",{staticClass:"v-slide-group__next",class:{"v-slide-group__next--disabled":!this.hasNext},on:{click:()=>this.onAffixClick("next")},key:"next"},[t])},genContent(){return this.$createElement("div",{staticClass:"v-slide-group__content",ref:"content",on:{focusin:this.onFocusin}},this.$slots.default)},genData(){return{class:this.classes,directives:[{name:"resize",value:this.onResize}]}},genIcon(t){let e=t;this.$vuetify.rtl&&t==="prev"?e="next":this.$vuetify.rtl&&t==="next"&&(e="prev");const s=`${t[0].toUpperCase()}${t.slice(1)}`,i=this[`has${s}`];return!this.showArrows&&!i?null:this.$createElement(b,{props:{disabled:!i}},this[`${e}Icon`])},genPrev(){const t=this.$scopedSlots.prev?this.$scopedSlots.prev({}):this.$slots.prev||this.__cachedPrev;return this.$createElement("div",{staticClass:"v-slide-group__prev",class:{"v-slide-group__prev--disabled":!this.hasPrev},on:{click:()=>this.onAffixClick("prev")},key:"prev"},[t])},genTransition(t){return this.$createElement(O,[this.genIcon(t)])},genWrapper(){return this.$createElement("div",{staticClass:"v-slide-group__wrapper",directives:[{name:"touch",value:{start:t=>this.overflowCheck(t,this.onTouchStart),move:t=>this.overflowCheck(t,this.onTouchMove),end:t=>this.overflowCheck(t,this.onTouchEnd)}}],ref:"wrapper",on:{scroll:this.onScroll}},[this.genContent()])},calculateNewOffset(t,e,s,i){const n=s?-1:1,r=n*i+(t==="prev"?-1:1)*e.wrapper;return n*Math.max(Math.min(r,e.content-e.wrapper),0)},onAffixClick(t){this.$emit(`click:${t}`),this.scrollTo(t)},onResize(){this._isDestroyed||this.setWidths()},onTouchStart(t){const{content:e}=this.$refs;this.startX=this.scrollOffset+t.touchstartX,e.style.setProperty("transition","none"),e.style.setProperty("willChange","transform")},onTouchMove(t){if(this.canTouch){if(!this.isSwiping){const e=t.touchmoveX-t.touchstartX,s=t.touchmoveY-t.touchstartY;this.isSwipingHorizontal=Math.abs(e)>Math.abs(s),this.isSwiping=!0}this.isSwipingHorizontal&&(this.scrollOffset=this.startX-t.touchmoveX,document.documentElement.style.overflowY="hidden")}},onTouchEnd(){if(!this.canTouch)return;const{content:t,wrapper:e}=this.$refs,s=t.clientWidth-e.clientWidth;t.style.setProperty("transition",null),t.style.setProperty("willChange",null),this.$vuetify.rtl?this.scrollOffset>0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset<=-s&&(this.scrollOffset=-s):this.scrollOffset<0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset>=s&&(this.scrollOffset=s),this.isSwiping=!1,document.documentElement.style.removeProperty("overflow-y")},overflowCheck(t,e){t.stopPropagation(),this.isOverflowing&&e(t)},scrollIntoView(){if(!this.selectedItem&&this.items.length){const t=this.items[this.items.length-1].$el.getBoundingClientRect(),e=this.$refs.wrapper.getBoundingClientRect();(this.$vuetify.rtl&&e.rightt.left)&&this.scrollTo("prev")}this.selectedItem&&(this.selectedIndex===0||!this.centerActive&&!this.isOverflowing?this.scrollOffset=0:this.centerActive?this.scrollOffset=W(this.selectedItem.$el,this.widths,this.$vuetify.rtl):this.isOverflowing&&(this.scrollOffset=w(this.selectedItem.$el,this.widths,this.$vuetify.rtl,this.scrollOffset)))},scrollTo(t){this.scrollOffset=this.calculateNewOffset(t,{content:this.$refs.content?this.$refs.content.clientWidth:0,wrapper:this.$refs.wrapper?this.$refs.wrapper.clientWidth:0},this.$vuetify.rtl,this.scrollOffset)},setWidths(){window.requestAnimationFrame(()=>{if(this._isDestroyed)return;const{content:t,wrapper:e}=this.$refs;this.widths={content:t?t.clientWidth:0,wrapper:e?e.clientWidth:0},this.isOverflowing=this.widths.wrapper+1{this.onResize()});t.observe(this.$el),this.$on("hook:destroyed",()=>{t.disconnect()})}this.$nextTick(()=>{window.setTimeout(this.callSlider,30)})},methods:{callSlider(){return this.hideSlider||!this.$refs.items||!this.$refs.items.selectedItems.length?(this.slider.width=0,!1):(this.$nextTick(()=>{const t=this.$refs.items.selectedItems[0];if(!t||!t.$el){this.slider.width=0,this.slider.left=0;return}const e=t.$el;this.slider={height:this.vertical?e.scrollHeight:Number(this.sliderSize),left:this.vertical?0:e.offsetLeft,right:this.vertical?0:e.offsetLeft+e.offsetWidth,top:e.offsetTop,width:this.vertical?Number(this.sliderSize):e.scrollWidth}}),!0)},genBar(t,e){const s={style:{height:l(this.height)},props:{activeClass:this.activeClass,centerActive:this.centerActive,dark:this.dark,light:this.light,mandatory:!this.optional,mobileBreakpoint:this.mobileBreakpoint,nextIcon:this.nextIcon,prevIcon:this.prevIcon,showArrows:this.showArrows,value:this.internalValue},on:{"call:slider":this.callSlider,change:i=>{this.internalValue=i}},ref:"items"};return this.setTextColor(this.computedColor,s),this.setBackgroundColor(this.backgroundColor,s),this.$createElement(z,s,[this.genSlider(e),t])},genItems(t,e){return t||(e.length?this.$createElement(M,{props:{value:this.internalValue},on:{change:s=>{this.internalValue=s}}},e):null)},genSlider(t){return this.hideSlider?null:(t||(t=this.$createElement(N,{props:{color:this.sliderColor}})),this.$createElement("div",{staticClass:"v-tabs-slider-wrapper",style:this.sliderStyles},[t]))},onResize(){this._isDestroyed||(clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.callSlider,0))},parseNodes(){let t=null,e=null;const s=[],i=[],n=this.$slots.default||[],r=n.length;for(let a=0;a({proxyClass:"v-tab--active"}),computed:{classes(){return{"v-tab":!0,...C.options.computed.classes.call(this),"v-tab--disabled":this.disabled,...this.groupClasses}},value(){let t=this.to||this.href;return t==null?t:(this.$router&&this.to===Object(this.to)&&(t=this.$router.resolve(this.to,this.$route,this.append).href),t.replace("#",""))}},methods:{click(t){if(this.disabled){t.preventDefault();return}this.href&&this.href.indexOf("#")>-1&&t.preventDefault(),t.detail&&this.$el.blur(),this.$emit("click",t),this.to||this.toggle()},toggle(){(!this.isActive||!this.tabsBar.mandatory&&!this.to)&&this.$emit("change")}},render(t){const{tag:e,data:s}=this.generateRouteLink();return s.attrs={...s.attrs,"aria-selected":String(this.isActive),role:"tab",tabindex:this.disabled?-1:0},s.on={...s.on,keydown:i=>{i.keyCode===R.enter&&this.click(i),this.$emit("keydown",i)}},t(e,s,this.$slots.default)}}),X=m.extend({name:"v-tab-item",props:{id:String},methods:{genWindowItem(){const t=m.options.methods.genWindowItem.call(this);return t.data.domProps=t.data.domProps||{},t.data.domProps.id=this.id||this.value,t}}});export{H as _,L as a,M as b,X as c}; +import{M as f,a as I,b,R as l,J as h,aY as x,aZ as S,a_ as _,a$ as $,b0 as B,b1 as O,T as p,b2 as k,K as y,b3 as A,b4 as C,aH as R}from"./index-e409ba63.js";import{B as d}from"./VItemGroup-3637266a.js";const v=d.extend({name:"v-window",directives:{Touch:f},provide(){return{windowGroup:this}},props:{activeClass:{type:String,default:"v-window-item--active"},continuous:Boolean,mandatory:{type:Boolean,default:!0},nextIcon:{type:[Boolean,String],default:"$next"},prevIcon:{type:[Boolean,String],default:"$prev"},reverse:Boolean,showArrows:Boolean,showArrowsOnHover:Boolean,touch:Object,touchless:Boolean,value:{required:!1},vertical:Boolean},data(){return{changedByDelimiters:!1,internalHeight:void 0,transitionHeight:void 0,transitionCount:0,isBooted:!1,isReverse:!1}},computed:{isActive(){return this.transitionCount>0},classes(){return{...d.options.computed.classes.call(this),"v-window--show-arrows-on-hover":this.showArrowsOnHover}},computedTransition(){if(!this.isBooted)return"";const t=this.vertical?"y":"x",s=(this.internalReverse?!this.isReverse:this.isReverse)?"-reverse":"";return`v-window-${t}${s}-transition`},hasActiveItems(){return!!this.items.find(t=>!t.disabled)},hasNext(){return this.continuous||this.internalIndex0},internalIndex(){return this.items.findIndex((t,e)=>this.internalValue===this.getValue(t,e))},internalReverse(){return this.$vuetify.rtl?!this.reverse:this.reverse}},watch:{internalIndex(t,e){this.isReverse=this.updateReverse(t,e)}},mounted(){window.requestAnimationFrame(()=>this.isBooted=!0)},methods:{genDefaultSlot(){return this.$slots.default},genContainer(){const t=[this.genDefaultSlot()];return this.showArrows&&t.push(this.genControlIcons()),this.$createElement("div",{staticClass:"v-window__container",class:{"v-window__container--is-active":this.isActive},style:{height:this.internalHeight||this.transitionHeight}},t)},genIcon(t,e,s){var i,n,r;const a={click:T=>{T.stopPropagation(),this.changedByDelimiters=!0,s()}},o={"aria-label":this.$vuetify.lang.t(`$vuetify.carousel.${t}`)},u=(r=(n=(i=this.$scopedSlots)[t])===null||n===void 0?void 0:n.call(i,{on:a,attrs:o}))!==null&&r!==void 0?r:[this.$createElement(I,{props:{icon:!0},attrs:o,on:a},[this.$createElement(b,{props:{large:!0}},e)])];return this.$createElement("div",{staticClass:`v-window__${t}`},u)},genControlIcons(){const t=[],e=this.$vuetify.rtl?this.nextIcon:this.prevIcon;if(this.hasPrev&&e&&typeof e=="string"){const i=this.genIcon("prev",e,this.prev);i&&t.push(i)}const s=this.$vuetify.rtl?this.prevIcon:this.nextIcon;if(this.hasNext&&s&&typeof s=="string"){const i=this.genIcon("next",s,this.next);i&&t.push(i)}return t},getNextIndex(t){const e=(t+1)%this.items.length;return this.items[e].disabled?this.getNextIndex(e):e},getPrevIndex(t){const e=(t+this.items.length-1)%this.items.length;return this.items[e].disabled?this.getPrevIndex(e):e},next(){if(!this.hasActiveItems||!this.hasNext)return;const t=this.getNextIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},prev(){if(!this.hasActiveItems||!this.hasPrev)return;const t=this.getPrevIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},updateReverse(t,e){const s=this.items.length,i=s-1;return s<=2?t{this.$vuetify.rtl?this.prev():this.next()},right:()=>{this.$vuetify.rtl?this.next():this.prev()},end:i=>{i.stopPropagation()},start:i=>{i.stopPropagation()}};e.directives.push({name:"touch",value:s})}return t("div",e,[this.genContainer()])}}),P=h(S,x("windowGroup","v-window-item","v-window")),m=P.extend().extend().extend({name:"v-window-item",directives:{Touch:f},props:{disabled:Boolean,reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},value:{required:!1}},data(){return{isActive:!1,inTransition:!1}},computed:{classes(){return this.groupClasses},computedTransition(){return this.windowGroup.internalReverse?typeof this.reverseTransition<"u"?this.reverseTransition||"":this.windowGroup.computedTransition:typeof this.transition<"u"?this.transition||"":this.windowGroup.computedTransition}},methods:{genDefaultSlot(){return this.$slots.default},genWindowItem(){return this.$createElement("div",{staticClass:"v-window-item",class:this.classes,directives:[{name:"show",value:this.isActive}],on:this.$listeners},this.genDefaultSlot())},onAfterTransition(){this.inTransition&&(this.inTransition=!1,this.windowGroup.transitionCount>0&&(this.windowGroup.transitionCount--,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=void 0)))},onBeforeTransition(){this.inTransition||(this.inTransition=!0,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=l(this.windowGroup.$el.clientHeight)),this.windowGroup.transitionCount++)},onTransitionCancelled(){this.onAfterTransition()},onEnter(t){this.inTransition&&this.$nextTick(()=>{!this.computedTransition||!this.inTransition||(this.windowGroup.transitionHeight=l(t.clientHeight))})}},render(t){return t("transition",{props:{name:this.computedTransition},on:{beforeEnter:this.onBeforeTransition,afterEnter:this.onAfterTransition,enterCancelled:this.onTransitionCancelled,beforeLeave:this.onBeforeTransition,afterLeave:this.onAfterTransition,leaveCancelled:this.onTransitionCancelled,enter:this.onEnter}},this.showLazyContent(()=>[this.genWindowItem()]))}});function g(t){const s=Math.abs(t);return Math.sign(t)*(s/((1/.501-2)*(1-s)+1))}function w(t,e,s,i){const n=t.clientWidth,r=s?e.content-t.offsetLeft-n:t.offsetLeft;s&&(i=-i);const a=e.wrapper+i,o=n+r,u=n*.4;return r<=i?i=Math.max(r-u,0):a<=o&&(i=Math.min(i-(a-o-u),e.content-e.wrapper)),s?-i:i}function W(t,e,s){const{offsetLeft:i,clientWidth:n}=t;if(s){const r=e.content-i-n/2-e.wrapper/2;return-Math.min(e.content-e.wrapper,Math.max(0,r))}else{const r=i+n/2-e.wrapper/2;return Math.min(e.content-e.wrapper,Math.max(0,r))}}const c=h(d,_).extend({name:"base-slide-group",directives:{Resize:$,Touch:f},props:{activeClass:{type:String,default:"v-slide-item--active"},centerActive:Boolean,nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},showArrows:{type:[Boolean,String],validator:t=>typeof t=="boolean"||["always","desktop","mobile"].includes(t)}},data:()=>({isOverflowing:!1,resizeTimeout:0,startX:0,isSwipingHorizontal:!1,isSwiping:!1,scrollOffset:0,widths:{content:0,wrapper:0}}),computed:{canTouch(){return typeof window<"u"},__cachedNext(){return this.genTransition("next")},__cachedPrev(){return this.genTransition("prev")},classes(){return{...d.options.computed.classes.call(this),"v-slide-group":!0,"v-slide-group--has-affixes":this.hasAffixes,"v-slide-group--is-overflowing":this.isOverflowing}},hasAffixes(){switch(this.showArrows){case"always":return!0;case"desktop":return!this.isMobile;case!0:return this.isOverflowing||Math.abs(this.scrollOffset)>0;case"mobile":return this.isMobile||this.isOverflowing||Math.abs(this.scrollOffset)>0;default:return!this.isMobile&&(this.isOverflowing||Math.abs(this.scrollOffset)>0)}},hasNext(){if(!this.hasAffixes)return!1;const{content:t,wrapper:e}=this.widths;return t>Math.abs(this.scrollOffset)+e},hasPrev(){return this.hasAffixes&&this.scrollOffset!==0}},watch:{internalValue:"setWidths",isOverflowing:"setWidths",scrollOffset(t){this.$vuetify.rtl&&(t=-t);let e=t<=0?g(-t):t>this.widths.content-this.widths.wrapper?-(this.widths.content-this.widths.wrapper)+g(this.widths.content-this.widths.wrapper-t):-t;this.$vuetify.rtl&&(e=-e),this.$refs.content.style.transform=`translateX(${e}px)`}},mounted(){if(typeof ResizeObserver<"u"){const t=new ResizeObserver(()=>{this.onResize()});t.observe(this.$el),t.observe(this.$refs.content),this.$on("hook:destroyed",()=>{t.disconnect()})}else{let t=0;this.$on("hook:beforeUpdate",()=>{var e;t=(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length}),this.$on("hook:updated",()=>{var e;t!==(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length&&this.setWidths()})}},methods:{onScroll(){this.$refs.wrapper.scrollLeft=0},onFocusin(t){if(this.isOverflowing){for(const e of B(t))for(const s of this.items)if(s.$el===e){this.scrollOffset=w(s.$el,this.widths,this.$vuetify.rtl,this.scrollOffset);return}}},genNext(){const t=this.$scopedSlots.next?this.$scopedSlots.next({}):this.$slots.next||this.__cachedNext;return this.$createElement("div",{staticClass:"v-slide-group__next",class:{"v-slide-group__next--disabled":!this.hasNext},on:{click:()=>this.onAffixClick("next")},key:"next"},[t])},genContent(){return this.$createElement("div",{staticClass:"v-slide-group__content",ref:"content",on:{focusin:this.onFocusin}},this.$slots.default)},genData(){return{class:this.classes,directives:[{name:"resize",value:this.onResize}]}},genIcon(t){let e=t;this.$vuetify.rtl&&t==="prev"?e="next":this.$vuetify.rtl&&t==="next"&&(e="prev");const s=`${t[0].toUpperCase()}${t.slice(1)}`,i=this[`has${s}`];return!this.showArrows&&!i?null:this.$createElement(b,{props:{disabled:!i}},this[`${e}Icon`])},genPrev(){const t=this.$scopedSlots.prev?this.$scopedSlots.prev({}):this.$slots.prev||this.__cachedPrev;return this.$createElement("div",{staticClass:"v-slide-group__prev",class:{"v-slide-group__prev--disabled":!this.hasPrev},on:{click:()=>this.onAffixClick("prev")},key:"prev"},[t])},genTransition(t){return this.$createElement(O,[this.genIcon(t)])},genWrapper(){return this.$createElement("div",{staticClass:"v-slide-group__wrapper",directives:[{name:"touch",value:{start:t=>this.overflowCheck(t,this.onTouchStart),move:t=>this.overflowCheck(t,this.onTouchMove),end:t=>this.overflowCheck(t,this.onTouchEnd)}}],ref:"wrapper",on:{scroll:this.onScroll}},[this.genContent()])},calculateNewOffset(t,e,s,i){const n=s?-1:1,r=n*i+(t==="prev"?-1:1)*e.wrapper;return n*Math.max(Math.min(r,e.content-e.wrapper),0)},onAffixClick(t){this.$emit(`click:${t}`),this.scrollTo(t)},onResize(){this._isDestroyed||this.setWidths()},onTouchStart(t){const{content:e}=this.$refs;this.startX=this.scrollOffset+t.touchstartX,e.style.setProperty("transition","none"),e.style.setProperty("willChange","transform")},onTouchMove(t){if(this.canTouch){if(!this.isSwiping){const e=t.touchmoveX-t.touchstartX,s=t.touchmoveY-t.touchstartY;this.isSwipingHorizontal=Math.abs(e)>Math.abs(s),this.isSwiping=!0}this.isSwipingHorizontal&&(this.scrollOffset=this.startX-t.touchmoveX,document.documentElement.style.overflowY="hidden")}},onTouchEnd(){if(!this.canTouch)return;const{content:t,wrapper:e}=this.$refs,s=t.clientWidth-e.clientWidth;t.style.setProperty("transition",null),t.style.setProperty("willChange",null),this.$vuetify.rtl?this.scrollOffset>0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset<=-s&&(this.scrollOffset=-s):this.scrollOffset<0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset>=s&&(this.scrollOffset=s),this.isSwiping=!1,document.documentElement.style.removeProperty("overflow-y")},overflowCheck(t,e){t.stopPropagation(),this.isOverflowing&&e(t)},scrollIntoView(){if(!this.selectedItem&&this.items.length){const t=this.items[this.items.length-1].$el.getBoundingClientRect(),e=this.$refs.wrapper.getBoundingClientRect();(this.$vuetify.rtl&&e.rightt.left)&&this.scrollTo("prev")}this.selectedItem&&(this.selectedIndex===0||!this.centerActive&&!this.isOverflowing?this.scrollOffset=0:this.centerActive?this.scrollOffset=W(this.selectedItem.$el,this.widths,this.$vuetify.rtl):this.isOverflowing&&(this.scrollOffset=w(this.selectedItem.$el,this.widths,this.$vuetify.rtl,this.scrollOffset)))},scrollTo(t){this.scrollOffset=this.calculateNewOffset(t,{content:this.$refs.content?this.$refs.content.clientWidth:0,wrapper:this.$refs.wrapper?this.$refs.wrapper.clientWidth:0},this.$vuetify.rtl,this.scrollOffset)},setWidths(){window.requestAnimationFrame(()=>{if(this._isDestroyed)return;const{content:t,wrapper:e}=this.$refs;this.widths={content:t?t.clientWidth:0,wrapper:e?e.clientWidth:0},this.isOverflowing=this.widths.wrapper+1{this.onResize()});t.observe(this.$el),this.$on("hook:destroyed",()=>{t.disconnect()})}this.$nextTick(()=>{window.setTimeout(this.callSlider,30)})},methods:{callSlider(){return this.hideSlider||!this.$refs.items||!this.$refs.items.selectedItems.length?(this.slider.width=0,!1):(this.$nextTick(()=>{const t=this.$refs.items.selectedItems[0];if(!t||!t.$el){this.slider.width=0,this.slider.left=0;return}const e=t.$el;this.slider={height:this.vertical?e.scrollHeight:Number(this.sliderSize),left:this.vertical?0:e.offsetLeft,right:this.vertical?0:e.offsetLeft+e.offsetWidth,top:e.offsetTop,width:this.vertical?Number(this.sliderSize):e.scrollWidth}}),!0)},genBar(t,e){const s={style:{height:l(this.height)},props:{activeClass:this.activeClass,centerActive:this.centerActive,dark:this.dark,light:this.light,mandatory:!this.optional,mobileBreakpoint:this.mobileBreakpoint,nextIcon:this.nextIcon,prevIcon:this.prevIcon,showArrows:this.showArrows,value:this.internalValue},on:{"call:slider":this.callSlider,change:i=>{this.internalValue=i}},ref:"items"};return this.setTextColor(this.computedColor,s),this.setBackgroundColor(this.backgroundColor,s),this.$createElement(z,s,[this.genSlider(e),t])},genItems(t,e){return t||(e.length?this.$createElement(M,{props:{value:this.internalValue},on:{change:s=>{this.internalValue=s}}},e):null)},genSlider(t){return this.hideSlider?null:(t||(t=this.$createElement(N,{props:{color:this.sliderColor}})),this.$createElement("div",{staticClass:"v-tabs-slider-wrapper",style:this.sliderStyles},[t]))},onResize(){this._isDestroyed||(clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.callSlider,0))},parseNodes(){let t=null,e=null;const s=[],i=[],n=this.$slots.default||[],r=n.length;for(let a=0;a({proxyClass:"v-tab--active"}),computed:{classes(){return{"v-tab":!0,...C.options.computed.classes.call(this),"v-tab--disabled":this.disabled,...this.groupClasses}},value(){let t=this.to||this.href;return t==null?t:(this.$router&&this.to===Object(this.to)&&(t=this.$router.resolve(this.to,this.$route,this.append).href),t.replace("#",""))}},methods:{click(t){if(this.disabled){t.preventDefault();return}this.href&&this.href.indexOf("#")>-1&&t.preventDefault(),t.detail&&this.$el.blur(),this.$emit("click",t),this.to||this.toggle()},toggle(){(!this.isActive||!this.tabsBar.mandatory&&!this.to)&&this.$emit("change")}},render(t){const{tag:e,data:s}=this.generateRouteLink();return s.attrs={...s.attrs,"aria-selected":String(this.isActive),role:"tab",tabindex:this.disabled?-1:0},s.on={...s.on,keydown:i=>{i.keyCode===R.enter&&this.click(i),this.$emit("keydown",i)}},t(e,s,this.$slots.default)}}),X=m.extend({name:"v-tab-item",props:{id:String},methods:{genWindowItem(){const t=m.options.methods.genWindowItem.call(this);return t.data.domProps=t.data.domProps||{},t.data.domProps.id=this.id||this.value,t}}});export{H as _,L as a,M as b,X as c}; diff --git a/dist/assets/VTextarea-9eb75b3d.js b/dist/assets/VTextarea-14e342fc.js similarity index 95% rename from dist/assets/VTextarea-9eb75b3d.js rename to dist/assets/VTextarea-14e342fc.js index 78727c2..b5b7fdd 100644 --- a/dist/assets/VTextarea-9eb75b3d.js +++ b/dist/assets/VTextarea-14e342fc.js @@ -1 +1 @@ -import{j as o,J as i}from"./index-e8f29bb9.js";const a=i(o),r=a.extend({name:"v-textarea",props:{autoGrow:Boolean,noResize:Boolean,rowHeight:{type:[Number,String],default:24,validator:t=>!isNaN(parseFloat(t))},rows:{type:[Number,String],default:5,validator:t=>!isNaN(parseInt(t,10))}},computed:{classes(){return{"v-textarea":!0,"v-textarea--auto-grow":this.autoGrow,"v-textarea--no-resize":this.noResizeHandle,...o.options.computed.classes.call(this)}},noResizeHandle(){return this.noResize||this.autoGrow}},watch:{autoGrow(t){this.$nextTick(()=>{var e;t?this.calculateInputHeight():(e=this.$refs.input)===null||e===void 0||e.style.removeProperty("height")})},lazyValue(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)},rowHeight(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)}},mounted(){setTimeout(()=>{this.autoGrow&&this.calculateInputHeight()},0)},methods:{calculateInputHeight(){const t=this.$refs.input;if(!t)return;t.style.height="0";const e=t.scrollHeight,s=parseInt(this.rows,10)*parseFloat(this.rowHeight);t.style.height=Math.max(s,e)+"px"},genInput(){const t=o.options.methods.genInput.call(this);return t.tag="textarea",delete t.data.attrs.type,t.data.attrs.rows=this.rows,t},onInput(t){o.options.methods.onInput.call(this,t),this.autoGrow&&this.calculateInputHeight()},onKeyDown(t){this.isFocused&&t.keyCode===13&&t.stopPropagation(),this.$emit("keydown",t)}}});export{r as _}; +import{j as o,J as i}from"./index-e409ba63.js";const a=i(o),r=a.extend({name:"v-textarea",props:{autoGrow:Boolean,noResize:Boolean,rowHeight:{type:[Number,String],default:24,validator:t=>!isNaN(parseFloat(t))},rows:{type:[Number,String],default:5,validator:t=>!isNaN(parseInt(t,10))}},computed:{classes(){return{"v-textarea":!0,"v-textarea--auto-grow":this.autoGrow,"v-textarea--no-resize":this.noResizeHandle,...o.options.computed.classes.call(this)}},noResizeHandle(){return this.noResize||this.autoGrow}},watch:{autoGrow(t){this.$nextTick(()=>{var e;t?this.calculateInputHeight():(e=this.$refs.input)===null||e===void 0||e.style.removeProperty("height")})},lazyValue(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)},rowHeight(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)}},mounted(){setTimeout(()=>{this.autoGrow&&this.calculateInputHeight()},0)},methods:{calculateInputHeight(){const t=this.$refs.input;if(!t)return;t.style.height="0";const e=t.scrollHeight,s=parseInt(this.rows,10)*parseFloat(this.rowHeight);t.style.height=Math.max(s,e)+"px"},genInput(){const t=o.options.methods.genInput.call(this);return t.tag="textarea",delete t.data.attrs.type,t.data.attrs.rows=this.rows,t},onInput(t){o.options.methods.onInput.call(this,t),this.autoGrow&&this.calculateInputHeight()},onKeyDown(t){this.isFocused&&t.keyCode===13&&t.stopPropagation(),this.$emit("keydown",t)}}});export{r as _}; diff --git a/dist/assets/VTooltip-0015e28c.js b/dist/assets/VTooltip-7c0b187f.js similarity index 98% rename from dist/assets/VTooltip-0015e28c.js rename to dist/assets/VTooltip-7c0b187f.js index 09b258c..bcc5ebf 100644 --- a/dist/assets/VTooltip-0015e28c.js +++ b/dist/assets/VTooltip-7c0b187f.js @@ -1 +1 @@ -import{J as a,b4 as r,bN as h,T as l,bO as c,bI as d,bP as u,K as p,R as n,bQ as m,aK as f,bR as v,aH as g}from"./index-e8f29bb9.js";const b=a(r).extend({name:"v-breadcrumbs-item",props:{activeClass:{type:String,default:"v-breadcrumbs__item--disabled"},ripple:{type:[Boolean,Object],default:!1}},computed:{classes(){return{"v-breadcrumbs__item":!0,[this.activeClass]:this.disabled}}},render(t){const{tag:e,data:i}=this.generateRouteLink();return t("li",[t(e,{...i,attrs:{...i.attrs,"aria-current":this.isActive&&this.isLink?"page":void 0}},this.$slots.default)])}}),y=h("v-breadcrumbs__divider","li"),x=a(l).extend({name:"v-breadcrumbs",props:{divider:{type:String,default:"/"},items:{type:Array,default:()=>[]},large:Boolean},computed:{classes(){return{"v-breadcrumbs--large":this.large,...this.themeClasses}}},methods:{genDivider(){return this.$createElement(y,this.$slots.divider?this.$slots.divider:this.divider)},genItems(){const t=[],e=!!this.$scopedSlots.item,i=[];for(let s=0;s({calculatedMinWidth:0,closeDependents:!1}),computed:{calculatedLeft(){const{activator:t,content:e}=this.dimensions,i=!this.bottom&&!this.left&&!this.top&&!this.right,s=this.attach!==!1?t.offsetLeft:t.left;let o=0;return this.top||this.bottom||i?o=s+t.width/2-e.width/2:(this.left||this.right)&&(o=s+(this.right?t.width:-e.width)+(this.right?10:-10)),this.nudgeLeft&&(o-=parseInt(this.nudgeLeft)),this.nudgeRight&&(o+=parseInt(this.nudgeRight)),`${this.calcXOverflow(o,this.dimensions.content.width)}px`},calculatedTop(){const{activator:t,content:e}=this.dimensions,i=this.attach!==!1?t.offsetTop:t.top;let s=0;return this.top||this.bottom?s=i+(this.bottom?t.height:-e.height)+(this.bottom?10:-10):(this.left||this.right)&&(s=i+t.height/2-e.height/2),this.nudgeTop&&(s-=parseInt(this.nudgeTop)),this.nudgeBottom&&(s+=parseInt(this.nudgeBottom)),this.attach===!1&&(s+=this.pageYOffset),`${this.calcYOverflow(s)}px`},classes(){return{"v-tooltip--top":this.top,"v-tooltip--right":this.right,"v-tooltip--bottom":this.bottom,"v-tooltip--left":this.left,"v-tooltip--attached":this.attach===""||this.attach===!0||this.attach==="attach"}},computedTransition(){return this.transition?this.transition:this.isActive?"scale-transition":"fade-transition"},offsetY(){return this.top||this.bottom},offsetX(){return this.left||this.right},styles(){return{left:this.calculatedLeft,maxWidth:n(this.maxWidth),minWidth:n(this.minWidth),top:this.calculatedTop,zIndex:this.zIndex||this.activeZIndex}}},beforeMount(){this.$nextTick(()=>{this.value&&this.callActivate()})},mounted(){m(this,"activator",!0)==="v-slot"&&f(`v-tooltip's activator slot must be bound, try '