@gadgetinc/ggt 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/add-VYOF3CRL.js +78 -0
- package/dist/add-VYOF3CRL.js.map +7 -0
- package/dist/{chunk-FLXIAZND.js → chunk-3B5DKR5D.js} +2 -2
- package/dist/{chunk-FLXIAZND.js.map → chunk-3B5DKR5D.js.map} +4 -4
- package/dist/chunk-3V7YWBUK.js +2 -0
- package/dist/{chunk-BSCZOMV4.js.map → chunk-3V7YWBUK.js.map} +1 -1
- package/dist/chunk-B6XQEEUK.js +2 -0
- package/dist/chunk-B6XQEEUK.js.map +7 -0
- package/dist/chunk-CQH5IRAO.js +50 -0
- package/dist/chunk-CQH5IRAO.js.map +7 -0
- package/dist/{chunk-5ONACLO6.js → chunk-ENT5WEIR.js} +2 -2
- package/dist/chunk-FQ2LR3BI.js +6 -0
- package/dist/chunk-FQ2LR3BI.js.map +7 -0
- package/dist/chunk-J5XIQ6N4.js +187 -0
- package/dist/chunk-J5XIQ6N4.js.map +7 -0
- package/dist/chunk-JU6IEBE5.js +65 -0
- package/dist/chunk-JU6IEBE5.js.map +7 -0
- package/dist/{chunk-TRHAPK2F.js → chunk-LQDBD3BI.js} +4 -4
- package/dist/{chunk-TRHAPK2F.js.map → chunk-LQDBD3BI.js.map} +2 -2
- package/dist/chunk-P5OUQ5XQ.js +2 -0
- package/dist/chunk-SGMPMYEU.js +2 -0
- package/dist/chunk-SGMPMYEU.js.map +7 -0
- package/dist/chunk-VE2URKOG.js +117 -0
- package/dist/chunk-VE2URKOG.js.map +7 -0
- package/dist/{chunk-JKDJXJKF.js → chunk-WBESFPTY.js} +2 -2
- package/dist/chunk-YQO2R55C.js +18 -0
- package/dist/{chunk-M2OJZLL7.js.map → chunk-YQO2R55C.js.map} +3 -3
- package/dist/chunk-ZHG3WLFU.js +2 -0
- package/dist/chunk-ZHG3WLFU.js.map +7 -0
- package/dist/deploy-EEJCK2MG.js +25 -0
- package/dist/deploy-EEJCK2MG.js.map +7 -0
- package/dist/dev-G77WSGIC.js +58 -0
- package/dist/{dev-5UFCKF4X.js.map → dev-G77WSGIC.js.map} +4 -4
- package/dist/esm-3OYJEC4Z.js +36 -0
- package/dist/esm-3OYJEC4Z.js.map +7 -0
- package/dist/list-3AI2FD3F.js +11 -0
- package/dist/list-3AI2FD3F.js.map +7 -0
- package/dist/login-UGTNK3B3.js +2 -0
- package/dist/logout-CN5DL7Z2.js +7 -0
- package/dist/{logout-YXDH5ZZI.js.map → logout-CN5DL7Z2.js.map} +1 -1
- package/dist/main.js +10 -10
- package/dist/main.js.map +3 -3
- package/dist/open-PM56SR6Z.js +74 -0
- package/dist/open-PM56SR6Z.js.map +7 -0
- package/dist/{pull-UAKKKJJP.js → pull-TAW6KHZO.js} +4 -4
- package/dist/{pull-UAKKKJJP.js.map → pull-TAW6KHZO.js.map} +2 -2
- package/dist/push-2NCJSDGS.js +2 -0
- package/dist/status-WDYI4EOU.js +14 -0
- package/dist/status-WDYI4EOU.js.map +7 -0
- package/dist/{version-VE55GG37.js → version-3FBGIVXT.js} +2 -2
- package/dist/{version-VE55GG37.js.map → version-3FBGIVXT.js.map} +1 -1
- package/dist/whoami-UALRX2FT.js +7 -0
- package/dist/{whoami-OAH55L4M.js.map → whoami-UALRX2FT.js.map} +1 -1
- package/package.json +19 -18
- package/dist/add-RDTHYTCK.js +0 -78
- package/dist/add-RDTHYTCK.js.map +0 -7
- package/dist/build-4BGA4IZE.js +0 -3
- package/dist/build-4BGA4IZE.js.map +0 -7
- package/dist/chunk-3Q3GPB6Z.js +0 -2
- package/dist/chunk-3Q3GPB6Z.js.map +0 -7
- package/dist/chunk-457GEPUN.js +0 -9
- package/dist/chunk-457GEPUN.js.map +0 -7
- package/dist/chunk-57XALM2W.js +0 -2
- package/dist/chunk-57XALM2W.js.map +0 -7
- package/dist/chunk-5WC5D4WL.js +0 -2
- package/dist/chunk-5WC5D4WL.js.map +0 -7
- package/dist/chunk-BSCZOMV4.js +0 -2
- package/dist/chunk-CQLM5U6T.js +0 -67
- package/dist/chunk-CQLM5U6T.js.map +0 -7
- package/dist/chunk-D2K5XPNJ.js +0 -2
- package/dist/chunk-D2K5XPNJ.js.map +0 -7
- package/dist/chunk-F3EZ4KS3.js +0 -2
- package/dist/chunk-F3EZ4KS3.js.map +0 -7
- package/dist/chunk-GOBNB5VT.js +0 -2
- package/dist/chunk-GOBNB5VT.js.map +0 -7
- package/dist/chunk-HKBXEZNF.js +0 -2
- package/dist/chunk-LWW4E6P5.js +0 -173
- package/dist/chunk-LWW4E6P5.js.map +0 -7
- package/dist/chunk-M2OJZLL7.js +0 -18
- package/dist/chunk-M4PNFOA5.js +0 -6
- package/dist/chunk-M4PNFOA5.js.map +0 -7
- package/dist/chunk-NGTOMLDS.js +0 -33
- package/dist/chunk-NGTOMLDS.js.map +0 -7
- package/dist/chunk-RYQWS5BH.js +0 -117
- package/dist/chunk-RYQWS5BH.js.map +0 -7
- package/dist/chunk-VICN6LTV.js +0 -12
- package/dist/chunk-VICN6LTV.js.map +0 -7
- package/dist/context-GN36UFJL.js +0 -2
- package/dist/deploy-BAMMI3ZA.js +0 -24
- package/dist/deploy-BAMMI3ZA.js.map +0 -7
- package/dist/dev-5UFCKF4X.js +0 -55
- package/dist/esm-GJ7RK6IC.js +0 -34
- package/dist/esm-GJ7RK6IC.js.map +0 -7
- package/dist/list-WGRXHV2B.js +0 -11
- package/dist/list-WGRXHV2B.js.map +0 -7
- package/dist/login-5YZOB4XB.js +0 -2
- package/dist/logout-YXDH5ZZI.js +0 -7
- package/dist/open-EOH3Q5KP.js +0 -74
- package/dist/open-EOH3Q5KP.js.map +0 -7
- package/dist/push-7X4P2364.js +0 -2
- package/dist/push-7X4P2364.js.map +0 -7
- package/dist/status-UJUGP24U.js +0 -14
- package/dist/status-UJUGP24U.js.map +0 -7
- package/dist/user-B2RIDVTH.js +0 -2
- package/dist/user-B2RIDVTH.js.map +0 -7
- package/dist/whoami-OAH55L4M.js +0 -7
- /package/dist/{chunk-5ONACLO6.js.map → chunk-ENT5WEIR.js.map} +0 -0
- /package/dist/{chunk-HKBXEZNF.js.map → chunk-P5OUQ5XQ.js.map} +0 -0
- /package/dist/{chunk-JKDJXJKF.js.map → chunk-WBESFPTY.js.map} +0 -0
- /package/dist/{context-GN36UFJL.js.map → login-UGTNK3B3.js.map} +0 -0
- /package/dist/{login-5YZOB4XB.js.map → push-2NCJSDGS.js.map} +0 -0
package/dist/dev-5UFCKF4X.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import{a as it}from"./chunk-HKBXEZNF.js";import{a as gn}from"./chunk-BSCZOMV4.js";import{a as rt,b as En,k as B,l as er,m as nr}from"./chunk-LWW4E6P5.js";import{f as Xt,l as Zt,m as tr,n as rr,o as ir}from"./chunk-RYQWS5BH.js";import"./chunk-5ONACLO6.js";import"./chunk-NGTOMLDS.js";import{b as Qt}from"./chunk-JKDJXJKF.js";import"./chunk-D2K5XPNJ.js";import"./chunk-M4PNFOA5.js";import"./chunk-3Q3GPB6Z.js";import"./chunk-M2OJZLL7.js";import"./chunk-457GEPUN.js";import"./chunk-FLXIAZND.js";import{a as yn,c as wn,d as Jt,f as Yt,i as Vt}from"./chunk-VICN6LTV.js";import{$ as zt,M as Ge,V as tt,Z as W,_ as Kt,b as Bt,o as Ht,y as $t}from"./chunk-CQLM5U6T.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import{a as g,b,c as C,d as mn,e as We,f as pn,g as a}from"./chunk-5WC5D4WL.js";var Dr=C(ge=>{"use strict";a();Object.defineProperty(ge,"__esModule",{value:!0});ge.sync=ge.isexe=void 0;var Cn=g("fs"),Tn=g("fs/promises"),Rn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ir(await(0,Tn.stat)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.isexe=Rn;var kn=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ir((0,Cn.statSync)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.sync=kn;var Ir=(e,t)=>e.isFile()&&bn(e,t),bn=(e,t)=>{let r=t.uid??process.getuid?.(),i=t.groups??process.getgroups?.()??[],n=t.gid??process.getgid?.()??i[0];if(r===void 0||n===void 0)throw new Error("cannot get uid or gid");let s=new Set([n,...i]),o=e.mode,c=e.uid,f=e.gid,l=parseInt("100",8),d=parseInt("010",8),u=parseInt("001",8),h=l|d;return!!(o&u||o&d&&s.has(f)||o&l&&c===r||o&h&&r===0)}});var Cr=C(Ee=>{"use strict";a();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.sync=Ee.isexe=void 0;var Ln=g("fs"),On=g("fs/promises"),qn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ar(await(0,On.stat)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.isexe=qn;var Fn=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ar((0,Ln.statSync)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.sync=Fn;var Pn=(e,t)=>{let{pathExt:r=process.env.PATHEXT||""}=t,i=r.split(";");if(i.indexOf("")!==-1)return!0;for(let n=0;n<i.length;n++){let s=i[n].toLowerCase(),o=e.substring(e.length-s.length).toLowerCase();if(s&&o===s)return!0}return!1},Ar=(e,t,r)=>e.isFile()&&Pn(t,r)});var Rr=C(Tr=>{"use strict";a();Object.defineProperty(Tr,"__esModule",{value:!0})});var Fr=C(A=>{"use strict";a();var kr=A&&A.__createBinding||(Object.create?function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]}),Un=A&&A.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),br=A&&A.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kr(t,e,r);return Un(t,e),t},Mn=A&&A.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&kr(t,e,r)};Object.defineProperty(A,"__esModule",{value:!0});A.sync=A.isexe=A.posix=A.win32=void 0;var Lr=br(Dr());A.posix=Lr;var Or=br(Cr());A.win32=Or;Mn(Rr(),A);var Wn=process.env._ISEXE_TEST_PLATFORM_||process.platform,qr=Wn==="win32"?Or:Lr;A.isexe=qr.isexe;A.sync=qr.sync});var Kr=C((Nc,$r)=>{a();var{isexe:Gn,sync:jn}=Fr(),{join:Bn,delimiter:Hn,sep:Pr,posix:Ur}=g("path"),Mr=process.platform==="win32",Wr=new RegExp(`[${Ur.sep}${Pr===Ur.sep?"":Pr}]`.replace(/(\\)/g,"\\$1")),$n=new RegExp(`^\\.${Wr.source}`),Gr=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),jr=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:i=Hn})=>{let n=e.match(Wr)?[""]:[...Mr?[process.cwd()]:[],...(t||"").split(i)];if(Mr){let s=r||[".EXE",".CMD",".BAT",".COM"].join(i),o=s.split(i).flatMap(c=>[c,c.toLowerCase()]);return e.includes(".")&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:s}}return{pathEnv:n,pathExt:[""]}},Br=(e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&$n.test(t)?t.slice(0,2):"")+Bn(r,t)},Hr=async(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Br(o,e);for(let f of i){let l=c+f;if(await Gn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Gr(e)},Kn=(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Br(o,e);for(let f of i){let l=c+f;if(jn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Gr(e)};$r.exports=Hr;Hr.sync=Kn});var zr=C(He=>{a();(function(){var e;e=function(t,r,i){var n,s;for(s="";t.length>0;)n=t.match(r),n?(s+=t.slice(0,n.index),s+=i(n),t=t.slice(n.index+n[0].length)):(s+=t,t="");return s},He.split=function(t){var r,i;return t==null&&(t=""),i=[],r="",e(t,/\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/,function(n){var s,o,c,f,l,d,u;if(f=n[0],u=n[1],d=n[2],s=n[3],o=n[4],c=n[5],l=n[6],c!=null)throw new Error("Unmatched quote");if(r+=u||(d||s||o).replace(/\\(?=.)/,""),l!=null)return i.push(r),r=""}),r&&i.push(r),i},He.escape=function(t){return t==null&&(t=""),t==null?"''":t.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g,"\\$1").replace(/\n/g,`'
|
|
2
|
-
'`)}}).call(He)});var Vr=C((Tc,Yr)=>{"use strict";a();var Jr=g("fs"),vt;function zn(){try{return Jr.statSync("/.dockerenv"),!0}catch{return!1}}function Jn(){try{return Jr.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Yr.exports=()=>(vt===void 0&&(vt=zn()||Jn()),vt)});var Qr=C((kc,Nt)=>{"use strict";a();var Yn=g("os"),Vn=g("fs"),Xr=Vr(),Zr=()=>{if(process.platform!=="linux")return!1;if(Yn.release().toLowerCase().includes("microsoft"))return!Xr();try{return Vn.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Xr():!1}catch{return!1}};process.env.__IS_WSL_TEST__?Nt.exports=Zr:Nt.exports=Zr()});var he=C((Lc,I)=>{a();var Xn=zr(),$e=g("child_process"),St=gn(),Zn=Qr(),Qn=g("path"),es=g("url"),ue=g("os"),_t=g("fs"),ts=g("net"),rs=1024;function ii(e){return JSON.parse(JSON.stringify(e))}I.exports.clone=ii;var is=function(e){return typeof e=="string"?e.replace(/(["$`\\])/g,"\\$1"):e},ns=function(e,t){return e.indexOf(t)!==-1},ei={u:"urgency",urgency:"urgency",t:"expire-time",time:"expire-time",timeout:"expire-time",e:"expire-time",expire:"expire-time","expire-time":"expire-time",i:"icon",icon:"icon",c:"category",category:"category",subtitle:"category",h:"hint",hint:"hint",a:"app-name","app-name":"app-name"};I.exports.command=function(e,t,r){return e=Xn.escape(e),process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (command):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.exec(e+" "+t.join(" "),function(i,n,s){if(i)return r(i);r(s,n)})};I.exports.fileCommand=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommand):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,s){if(i)return r(i,n);r(s,n)})};I.exports.fileCommandJson=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommandJson):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,s){if(i)return r(i,n);if(!n)return r(i,{});try{let o=JSON.parse(n);r(s||null,o)}catch(o){r(o,n)}})};I.exports.immediateFileCommand=function(e,t,r){process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (notifier):"),console.info("[notifier path]",e)),ss(e,function(i,n){if(!n)return r(new Error("Notifier ("+e+") not found on system."));$e.execFile(e,t),r()})};function ss(e,t){return _t.stat(e,function(r,i){return r?Qn.extname(e)?t(r,!1):_t.stat(e+".exe",function(n,s){if(n)return t(n,!1);t(n,s.isFile())}):t(r,i.isFile())})}var Ke=function(e){return e.appIcon&&(e.icon=e.appIcon,delete e.appIcon),e},Ie=function(e){return e.text&&(e.message=e.text,delete e.text),e},ni=function(e){return e.i&&(e.icon=e.i,delete e.i),e};I.exports.mapToNotifySend=function(e){e=Ke(e),e=Ie(e),e.timeout===!1&&delete e.timeout,e.wait===!0&&(e["expire-time"]=5);for(let t in e)t==="message"||t==="title"||e.hasOwnProperty(t)&&ei[t]!==t&&(e[ei[t]]=e[t],delete e[t]);return typeof e["expire-time"]>"u"?e["expire-time"]=10*1e3:typeof e["expire-time"]=="number"&&(e["expire-time"]=e["expire-time"]*1e3),e};I.exports.mapToGrowl=function(e){if(e=Ke(e),e=ni(e),e=Ie(e),e.icon&&!Buffer.isBuffer(e.icon))try{e.icon=_t.readFileSync(e.icon)}catch{}return e};I.exports.mapToMac=function(e){return e=ni(e),e=Ie(e),e.icon&&(e.appIcon=e.icon,delete e.icon),e.sound===!0&&(e.sound="Bottle"),e.sound===!1&&delete e.sound,e.sound&&e.sound.indexOf("Notification.")===0&&(e.sound="Bottle"),e.wait===!0&&(e.timeout||(e.timeout=5),delete e.wait),!e.wait&&!e.timeout&&(e.timeout===!1?delete e.timeout:e.timeout=10),e.json=!0,e};function xt(e){return Object.prototype.toString.call(e)==="[object Array]"}I.exports.isArray=xt;function os(){}I.exports.actionJackerDecorator=function(e,t,r,i){if(t=ii(t),r=r||os,typeof r!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof r);return function(n,s){let o=s,c={};if(o&&typeof o=="object"&&(c=o,o=o.activationType),o&&(o=o.toLowerCase().trim(),o.match(/^activate|clicked$/)&&(o="activate"),o.match(/^timedout$/)&&(o="timeout")),r.apply(e,[n,o,c]),!i||!o)return;let f=i(o);f&&e.emit(f,e,t,c)}};I.exports.constructArgumentList=function(e,t){let r=[];t=t||{};let i=t.initial||[],n=t.keyExtra||"",s=t.allowedArguments||[],o=t.noEscape!==void 0,c=t.allowedArguments!==void 0,f=!!t.explicitTrue,l=!!t.keepNewlines,d=t.wrapper===void 0?'"':t.wrapper,u=function h(_){return xt(_)?ti(_.map(h).join(",")):(o||(_=is(_)),typeof _=="string"&&!l&&(_=ti(_)),d+_+d)};i.forEach(function(h){r.push(u(h))});for(let h in e)if(e.hasOwnProperty(h)&&(!c||ns(s,h)))if(f&&e[h]===!0)r.push("-"+n+h);else{if(f&&e[h]===!1)continue;r.push("-"+n+h,u(e[h]))}return r};function ti(e){let t=process.platform==="win32"?"\\r\\n":"\\n";return e.replace(/\r?\n/g,t)}var as=["t","m","b","tb","p","id","s","silent","appID","pid","pipeName","close","install"],cs="Notification.",ri="Notification.Default";I.exports.mapToWin8=function(e){e=Ke(e),e=Ie(e),e.icon&&(/^file:\/+/.test(e.icon)?e.p=new es.URL(e.icon).pathname.replace(/^\/(\w:\/)/,"$1").replace(/\//g,"\\"):e.p=e.icon,delete e.icon),e.message&&(e.m=e.message.replace(/\x1b/g,""),delete e.message),e.title&&(e.t=e.title,delete e.title),e.appName&&(e.appID=e.appName,delete e.appName),typeof e.remove<"u"&&(e.close=e.remove,delete e.remove),(e.quiet||e.silent)&&(e.silent=e.quiet||e.silent,delete e.quiet),typeof e.sound<"u"&&(e.s=e.sound,delete e.sound),e.s===!1&&(e.silent=!0,delete e.s),e.s&&e.silent&&delete e.s,e.s===!0&&(e.s=ri),e.s&&e.s.indexOf(cs)!==0&&(e.s=ri),e.actions&&xt(e.actions)&&(e.b=e.actions.join(";"),delete e.actions);for(let t in e)e.hasOwnProperty(t)&&as.indexOf(t)===-1&&delete e[t];return e};I.exports.mapToNotifu=function(e){return e=Ke(e),e=Ie(e),e.icon&&(e.i=e.icon,delete e.icon),e.message&&(e.m=e.message,delete e.message),e.title&&(e.p=e.title,delete e.title),e.time&&(e.d=e.time,delete e.time),e.q!==!1?e.q=!0:delete e.q,e.quiet===!1&&(delete e.q,delete e.quiet),e.sound&&(delete e.q,delete e.sound),e.t&&(e.d=e.t,delete e.t),e.type&&(e.t=fs(e.type),delete e.type),e};I.exports.isMac=function(){return ue.type()==="Darwin"};I.exports.isMountainLion=function(){return ue.type()==="Darwin"&&St.satisfies(It(ue.release()),">=12.0.0")};I.exports.isWin8=function(){return ue.type()==="Windows_NT"&&St.satisfies(It(ue.release()),">=6.2.9200")};I.exports.isWSL=function(){return Zn};I.exports.isLessThanWin8=function(){return ue.type()==="Windows_NT"&&St.satisfies(It(ue.release()),"<6.2.9200")};function It(e){return e.split(".").length===2&&(e+=".0"),e}function fs(e){if(typeof e=="string"||e instanceof String){if(e.toLowerCase()==="info")return"info";if(e.toLowerCase()==="warn")return"warn";if(e.toLowerCase()==="error")return"error"}return"info"}I.exports.createNamedPipe=e=>{let t=Buffer.alloc(rs);return new Promise(r=>{e.instance=ts.createServer(i=>{i.on("data",n=>{t.write(n.toString())}),i.on("end",()=>{e.instance.close()})}),e.instance.listen(e.namedPipe,()=>{r(t)})})}});var li=C((qc,fi)=>{a();var si=g("os"),ls=En(),De=he(),ai=g("events").EventEmitter,us=g("util"),ci="notify-send",ze;fi.exports=Ae;function Ae(e){if(e=De.clone(e||{}),!(this instanceof Ae))return new Ae(e);this.options=e,ai.call(this)}us.inherits(Ae,ai);function hs(){}function ds(e,t){if(e=De.clone(e||{}),t=t||hs,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof t);if(typeof e=="string"&&(e={title:"node-notifier",message:e}),!e.message)return t(new Error("Message is required.")),this;if(si.type()!=="Linux"&&!si.type().match(/BSD$/))return t(new Error("Only supported on Linux and *BSD systems")),this;if(ze===!1)return t(new Error("notify-send must be installed on the system.")),this;if(ze||this.options.suppressOsdCheck)return oi(e,t),this;try{ze=!!ls.sync(ci),oi(e,t)}catch(r){return ze=!1,t(r)}return this}Object.defineProperty(Ae.prototype,"notify",{get:function(){return this._notify||(this._notify=ds.bind(this)),this._notify}});var ms=["urgency","expire-time","icon","category","hint","app-name"];function oi(e,t){e=De.mapToNotifySend(e),e.title=e.title||"Node Notification:";let r=[e.title,e.message];delete e.title,delete e.message;let i=De.constructArgumentList(e,{initial:r,keyExtra:"-",allowedArguments:ms});De.command(ci,i,t)}});var Dt=C((Pc,hi)=>{a();var ps=g("net"),ui=!1;hi.exports=function(e,t){if(typeof t>"u"&&(t=e,e={}),ui)return t(null,ui);let r=e.port||23053,i=e.host||"localhost",n=ps.connect(r,i);n.setTimeout(100),n.once("connect",function(){n.end(),t(null,!0)}),n.once("error",function(){n.end(),t(null,!1)})}});var pi=C((Mc,mi)=>{a();var ys=g("net"),ws=g("crypto"),di=g("util").format,gs=g("fs"),P=`\r
|
|
3
|
-
`;function de(e,t){t=t||{},this.type=e,this.host=t.host||"localhost",this.port=t.port||23053,this.request="GNTP/1.0 "+e+" NONE"+P,this.resources=[],this.attempts=0,this.maxAttempts=5}de.prototype.parseResp=function(e){var t={},r,i;return e=e.slice(0,e.indexOf(P+P)).split(P),r=e[0],i=e.slice(1),t.state=r.match(/-(OK|ERROR|CALLBACK)/)[0].slice(1),i.forEach(function(n){n=n.split(": "),t[n[0]]=n[1]}),t};de.prototype.retry=function(){var e=this,t=arguments;setTimeout(function(){e.send.apply(e,t)},750)};de.prototype.addResource=function(e){var t=ws.createHash("md5").update(e).digest("hex"),r="Identifier: "+t+P+"Length: "+e.length+P+P;return this.resources.push({header:r,file:e}),"x-growl-resource://"+t};de.prototype.add=function(e,t){t!==void 0&&(/-Icon/.test(e)&&!/^https?:\/\//.test(t)&&(/\.(png|gif|jpe?g)$/.test(t)?t=this.addResource(gs.readFileSync(t)):t instanceof Buffer&&(t=this.addResource(t))),this.request+=e+": "+t+P)};de.prototype.newline=function(){this.request+=P};de.prototype.send=function(e){var t=this,r=ys.connect(this.port,this.host),i="";e=e||function(){},this.attempts+=1,r.on("connect",function(){r.write(t.request),t.resources.forEach(function(n){r.write(n.header),r.write(n.file),r.write(P+P)})}),r.on("data",function(n){i+=n.toString(),i.slice(i.length-4)===P+P&&(i=t.parseResp(i),i.state==="ERROR"||i.state==="CALLBACK"?r.end():i="")}),r.on("end",function(){if(["200","401","402"].indexOf(i["Error-Code"])>=0)if(t.attempts<=t.maxAttempts)t.retry(e);else{var n='GNTP request to "%s:%d" failed with error code %s (%s)';e(new Error(di(n,t.host,t.port,i["Error-Code"],i["Error-Description"])))}else e(void 0,i)}),r.on("error",function(){e(new Error(di('Error while sending GNTP request to "%s:%d"',t.host,t.port))),r.destroy()})};mi.exports=de});var gi=C((Gc,wi)=>{a();var yi=pi();function Ce(){this.appname="Growly",this.notifications=void 0,this.labels=void 0,this.count=0,this.registered=!1,this.host=void 0,this.port=void 0}Ce.prototype.getLabels=function(){return this.notifications.map(function(e){return e.label})};Ce.prototype.setHost=function(e,t){this.host=e,this.port=t};Ce.prototype.register=function(e,t,r,i){var n;typeof t=="object"&&(r=t,t=void 0),(r===void 0||!r.length)&&(r=[{label:"default",dispname:"Default Notification",enabled:!0}]),typeof arguments[arguments.length-1]=="function"?i=arguments[arguments.length-1]:i=function(){},this.appname=e,this.notifications=r,this.labels=this.getLabels(),this.registered=!0,n=new yi("REGISTER",{host:this.host,port:this.port}),n.add("Application-Name",e),n.add("Application-Icon",t),n.add("Notifications-Count",r.length),n.newline(),r.forEach(function(s){s.enabled===void 0&&(s.enabled=!0),n.add("Notification-Name",s.label),n.add("Notification-Display-Name",s.dispname),n.add("Notification-Enabled",s.enabled?"True":"False"),n.add("Notification-Icon",s.icon),n.newline()}),n.send(i)};Ce.prototype.notify=function(e,t,r){var i=this,n;if(!this.registered){this.register(this.appname,function(s){s&&console.log(s),i.notify.call(i,e,t,r)});return}t=t||{},typeof t=="function"&&(r=t,t={}),n=new yi("NOTIFY",{host:this.host,port:this.port}),n.add("Application-Name",this.appname),n.add("Notification-Name",t.label||this.labels[0]),n.add("Notification-ID",++this.count),n.add("Notification-Title",t.title),n.add("Notification-Text",e),n.add("Notification-Sticky",t.sticky?"True":"False"),n.add("Notification-Priority",t.priority),n.add("Notification-Icon",t.icon),n.add("Notification-Coalescing-ID",t.coalescingId||void 0),n.add("Notification-Callback-Context",r?"context":void 0),n.add("Notification-Callback-Context-Type",r?"string":void 0),n.add("Notification-Callback-Target",void 0),n.newline(),n.send(function(s,o){r&&s?r(s):r&&o.state==="CALLBACK"&&r(void 0,o["Notification-Callback-Result"].toLowerCase())})};wi.exports=new Ce});var Ye=C((Bc,Ni)=>{a();var Es=Dt(),Je=he(),Te=gi(),vi=g("events").EventEmitter,vs=g("util"),Ns="Couldn't connect to growl (might be used as a fallback). Make sure it is running";Ni.exports=Re;var Ei;function Re(e){if(e=Je.clone(e||{}),!(this instanceof Re))return new Re(e);Te.appname=e.name||"Node",this.options=e,vi.call(this)}vs.inherits(Re,vi);function _s(e,t){if(Te.setHost(this.options.host,this.options.port),e=Je.clone(e||{}),typeof e=="string"&&(e={title:"node-notifier",message:e}),t=Je.actionJackerDecorator(this,e,t,function(r){return r==="click"?"click":r==="timedout"?"timeout":!1}),e=Je.mapToGrowl(e),!e.message)return t(new Error("Message is required.")),this;if(e.title=e.title||"Node Notification:",Ei||e.wait){let r=e.wait?t:Ss;return Te.notify(e.message,e,r),e.wait||t(),this}return Es(Te,function(r,i){if(Ei=i,!i)return t(new Error(Ns));Te.notify(e.message,e),t()}),this}Object.defineProperty(Re.prototype,"notify",{get:function(){return this._notify||(this._notify=_s.bind(this)),this._notify}});function Ss(){}});var Ii=C(($c,xi)=>{a();var me=he(),xs=Ye(),Is=g("path"),Ds=Is.join(__dirname,"../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier"),Si=g("events").EventEmitter,As=g("util"),Cs="You need Mac OS X 10.8 or above to use NotificationCenter, or use Growl fallback with constructor option {withFallback: true}.";xi.exports=ke;function ke(e){if(e=me.clone(e||{}),!(this instanceof ke))return new ke(e);this.options=e,Si.call(this)}As.inherits(ke,Si);var _i=null;function Ts(){}function Rs(e,t){let r,i=ks();if(e=me.clone(e||{}),_i=i,typeof e=="string"&&(e={title:"node-notifier",message:e}),t=t||Ts,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let n=me.actionJackerDecorator(this,e,t,function(o){return _i!==i?!1:o==="activate"?"click":o==="timeout"?"timeout":o==="replied"?"replied":!1});if(e=me.mapToMac(e),!e.message&&!e.group&&!e.list&&!e.remove)return t(new Error("Message, group, remove or list property is required.")),this;let s=me.constructArgumentList(e);return me.isMountainLion()?(me.fileCommandJson(this.options.customPath||Ds,s,n),this):r||this.options.withFallback?(r=r||new xs(this.options),r.notify(e,t)):(t(new Error(Cs)),this)}Object.defineProperty(ke.prototype,"notify",{get:function(){return this._notify||(this._notify=Rs.bind(this)),this._notify}});function ks(){return{_ref:"val"}}});var At=C((zc,Ti)=>{a();var bs=g("path"),Ls=bs.resolve(__dirname,"../vendor/notifu/notifu"),Os=Dt(),Q=he(),qs=Ct(),Di=Ye(),Fs=g("os"),Ci=g("events").EventEmitter,Ps=g("util"),Ve;Ti.exports=be;function be(e){if(e=Q.clone(e||{}),!(this instanceof be))return new be(e);this.options=e,Ci.call(this)}Ps.inherits(be,Ci);function Us(){}function Ms(e,t){let r,i=this.options;e=Q.clone(e||{}),t=t||Us,typeof e=="string"&&(e={title:"node-notifier",message:e});let n=Q.actionJackerDecorator(this,e,t,function(s){return s==="activate"?"click":s==="timeout"?"timeout":!1});return this.options.withFallback&&Q.isWin8()?(r=r||new qs(i),r.notify(e,t)):this.options.withFallback&&(!Q.isLessThanWin8()||Ve===!0)?(r=r||new Di(i),r.notify(e,t)):!this.options.withFallback||Ve===!1?(Ai(e,i,n),this):(Os(i,function(s,o){if(Ve=o,Ve)return r=r||new Di(i),r.notify(e,t);Ai(e,i,n)}),this)}Object.defineProperty(be.prototype,"notify",{get:function(){return this._notify||(this._notify=Ms.bind(this)),this._notify}});var Ws=["t","d","p","m","i","e","q","w","xp"];function Ai(e,t,r){let i=Fs.arch()==="x64";e=e||{},e=Q.mapToNotifu(e),e.p=e.p||"Node Notification:";let n=Ls+(i?"64":"")+".exe",s=t.customPath||n;if(!e.m)return r(new Error("Message is required.")),this;let o=Q.constructArgumentList(e,{wrapper:"",noEscape:!0,explicitTrue:!0,allowedArguments:Ws});if(e.wait)return Q.fileCommand(s,o,function(c,f){let l=Gs(c.code);return l==="error"?r(c,f):r(null,l)});Q.immediateFileCommand(s,o,r)}function Gs(e){switch(e){case 2:return"timeout";case 3:case 6:case 7:return"activate";case 4:return"close";default:return"error"}}});import js from"crypto";function Le(){return Xe>Ze.length-16&&(js.randomFillSync(Ze),Xe=0),Ze.slice(Xe,Xe+=16)}var Ze,Xe,Tt=b(()=>{a();Ze=new Uint8Array(256),Xe=Ze.length});var Ri,ki=b(()=>{a();Ri=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function Bs(e){return typeof e=="string"&&Ri.test(e)}var se,Oe=b(()=>{a();ki();se=Bs});function Hs(e,t=0){let r=(R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+"-"+R[e[t+4]]+R[e[t+5]]+"-"+R[e[t+6]]+R[e[t+7]]+"-"+R[e[t+8]]+R[e[t+9]]+"-"+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]).toLowerCase();if(!se(r))throw TypeError("Stringified UUID is invalid");return r}var R,oe,qe=b(()=>{a();Oe();R=[];for(let e=0;e<256;++e)R.push((e+256).toString(16).substr(1));oe=Hs});function $s(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let s=e.node||bi,o=e.clockseq!==void 0?e.clockseq:Rt;if(s==null||o==null){let h=e.random||(e.rng||Le)();s==null&&(s=bi=[h[0]|1,h[1],h[2],h[3],h[4],h[5]]),o==null&&(o=Rt=(h[6]<<8|h[7])&16383)}let c=e.msecs!==void 0?e.msecs:Date.now(),f=e.nsecs!==void 0?e.nsecs:bt+1,l=c-kt+(f-bt)/1e4;if(l<0&&e.clockseq===void 0&&(o=o+1&16383),(l<0||c>kt)&&e.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");kt=c,bt=f,Rt=o,c+=122192928e5;let d=((c&268435455)*1e4+f)%4294967296;n[i++]=d>>>24&255,n[i++]=d>>>16&255,n[i++]=d>>>8&255,n[i++]=d&255;let u=c/4294967296*1e4&268435455;n[i++]=u>>>8&255,n[i++]=u&255,n[i++]=u>>>24&15|16,n[i++]=u>>>16&255,n[i++]=o>>>8|128,n[i++]=o&255;for(let h=0;h<6;++h)n[i+h]=s[h];return t||oe(n)}var bi,Rt,kt,bt,Li,Oi=b(()=>{a();Tt();qe();kt=0,bt=0;Li=$s});function Ks(e){if(!se(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var Qe,Lt=b(()=>{a();Oe();Qe=Ks});function zs(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function et(e,t,r){function i(n,s,o,c){if(typeof n=="string"&&(n=zs(n)),typeof s=="string"&&(s=Qe(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+n.length);if(f.set(s),f.set(n,s.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,o){c=c||0;for(let l=0;l<16;++l)o[c+l]=f[l];return o}return oe(f)}try{i.name=e}catch{}return i.DNS=Js,i.URL=Ys,i}var Js,Ys,Ot=b(()=>{a();qe();Lt();Js="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ys="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});import Vs from"crypto";function Xs(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Vs.createHash("md5").update(e).digest()}var qi,Fi=b(()=>{a();qi=Xs});var Zs,Pi,Ui=b(()=>{a();Ot();Fi();Zs=et("v3",48,qi),Pi=Zs});function Qs(e,t,r){e=e||{};let i=e.random||(e.rng||Le)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return oe(i)}var Mi,Wi=b(()=>{a();Tt();qe();Mi=Qs});import eo from"crypto";function to(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),eo.createHash("sha1").update(e).digest()}var Gi,ji=b(()=>{a();Gi=to});var ro,Bi,Hi=b(()=>{a();Ot();ji();ro=et("v5",80,Gi),Bi=ro});var $i,Ki=b(()=>{a();$i="00000000-0000-0000-0000-000000000000"});function io(e){if(!se(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var zi,Ji=b(()=>{a();Oe();zi=io});var Yi={};mn(Yi,{NIL:()=>$i,parse:()=>Qe,stringify:()=>oe,v1:()=>Li,v3:()=>Pi,v4:()=>Mi,v5:()=>Bi,validate:()=>se,version:()=>zi});var Vi=b(()=>{a();Oi();Ui();Wi();Hi();Ki();Ji();Oe();qe();Lt()});var Ct=C((Xf,Zi)=>{a();var no=g("path"),so=no.resolve(__dirname,"../vendor/snoreToast/snoretoast"),J=he(),oo=At(),ao=g("os"),{v4:co}=(Vi(),pn(Yi)),Xi=g("events").EventEmitter,fo=g("util"),qt,lo="notifierPipe",uo="\\\\.\\pipe\\",ho="/tmp/";Zi.exports=Fe;function Fe(e){if(e=J.clone(e||{}),!(this instanceof Fe))return new Fe(e);this.options=e,Xi.call(this)}fo.inherits(Fe,Xi);function mo(){}function po(e){return e?e.split(";").reduce((t,r)=>{let i=r.split("=");return i&&i.length===2&&(t[i[0]]=i[1]),t},{}):{}}function yo(){return`${J.isWSL()?ho:uo}${lo}-${co()}`}function wo(e,t){e=J.clone(e||{}),t=t||mo;let r=ao.arch()==="x64",i,n={namedPipe:yo()};if(typeof e=="string"&&(e={title:"node-notifier",message:e}),typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let s=(c,f)=>{let l=po(i&&i.toString("utf16le"));l.action==="buttonClicked"&&l.button?l.activationType=l.button:l.action&&(l.activationType=l.action),c&&c.code===-1&&f(c,l),f(null,l),n.instance&&n.instance.close()},o=c=>s(c,J.actionJackerDecorator(this,e,t,f=>f==="activate"?"click":f||!1));return e.title=e.title||"Node Notification:",typeof e.message>"u"&&typeof e.close>"u"?(t(new Error("Message or ID to close is required.")),this):!J.isWin8()&&!J.isWSL()&&this.options.withFallback?(qt=qt||new oo(this.options),qt.notify(e,t)):(J.createNamedPipe(n).then(c=>{i=c,e.pipeName=n.namedPipe;let f=e.customPath||this.options.customPath||so+"-x"+(r?"64":"86")+".exe";e=J.mapToWin8(e);let l=J.constructArgumentList(e,{explicitTrue:!0,wrapper:"",keepNewlines:!0,noEscape:!0});J.fileCommand(f,l,o)}),this)}Object.defineProperty(Fe.prototype,"notify",{get:function(){return this._notify||(this._notify=wo.bind(this)),this._notify}})});var tn=C((Qf,D)=>{a();var Qi=g("os"),en=he(),Pe=li(),Ft=Ii(),Ue=Ct(),Pt=Ye(),Ut=At(),pe={withFallback:!0},go=en.isWSL()?"WSL":Qi.type();switch(go){case"Linux":D.exports=new Pe(pe),D.exports.Notification=Pe;break;case"Darwin":D.exports=new Ft(pe),D.exports.Notification=Ft;break;case"Windows_NT":en.isLessThanWin8()?(D.exports=new Ut(pe),D.exports.Notification=Ut):(D.exports=new Ue(pe),D.exports.Notification=Ue);break;case"WSL":D.exports=new Ue(pe),D.exports.Notification=Ue;break;default:Qi.type().match(/BSD$/)?(D.exports=new Pe(pe),D.exports.Notification=Pe):(D.exports=new Pt(pe),D.exports.Notification=Pt)}D.exports.NotifySend=Pe;D.exports.NotificationCenter=Ft;D.exports.WindowsToaster=Ue;D.exports.WindowsBalloon=Ut;D.exports.Growl=Pt});a();var on=We(wn(),1),ae=We(yn(),1);import sn from"node:path";a();import{EventEmitter as An}from"node:events";import wt from"node:fs";import we from"node:path";a();import vn from"node:os";var sr=300,ie=20,ve=1e7,or=vn.platform();var Nn=or==="darwin",nt=or==="win32",ne=Nn||nt,ar=3e3,cr=2e4,st=1250;a();var $;(function(e){e[e.DIR=1]="DIR",e[e.FILE=2]="FILE"})($||($={}));var le;(function(e){e.CHANGE="change",e.RENAME="rename"})(le||(le={}));var Ne;(function(e){e.CHANGE="change",e.ERROR="error"})(Ne||(Ne={}));var m;(function(e){e.ADD="add",e.ADD_DIR="addDir",e.CHANGE="change",e.RENAME="rename",e.RENAME_DIR="renameDir",e.UNLINK="unlink",e.UNLINK_DIR="unlinkDir"})(m||(m={}));var L;(function(e){e.ALL="all",e.CLOSE="close",e.ERROR="error",e.READY="ready"})(L||(L={}));a();a();a();var _n=(e,t=1,r)=>{t=Math.max(1,t);let i=r?.leading??!1,n=r?.trailing??!0,s=Math.max(r?.maxWait??1/0,t),o,c,f=0,l=0,d=()=>{let N=Date.now(),F=N-f,re=N-l,fe=F>=t||re>=s;return[N,fe]},u=N=>{if(l=N,!o)return;let F=o;o=void 0,e.apply(void 0,F)},h=()=>{te(0)},_=()=>{c&&(h(),u(Date.now()))},T=N=>{if(l=N,i)return u(N)},U=N=>{if(n&&o)return u(N);o=void 0},M=()=>{c=void 0;let[N,F]=d();return F?U(N):ee(N)},ee=N=>{let F=N-f,re=N-l,fe=t-F,Me=s-re,G=Math.min(fe,Me);return te(G)},te=N=>{c&&clearTimeout(c),!(N<=0)&&(c=setTimeout(M,N))},ce=(...N)=>{let[F,re]=d(),fe=!!c;if(o=N,f=F,(re||!c)&&te(t),re)return fe?u(F):T(F)};return ce.cancel=h,ce.flush=_,ce},je=_n;a();import vr from"node:fs";import ft from"node:path";a();import v from"node:fs";import{promisify as k}from"node:util";a();var V=(e,t)=>function(...i){return e.apply(void 0,i).catch(t)},K=(e,t)=>function(...i){try{return e.apply(void 0,i)}catch(n){return t(n)}};a();import fr from"node:process";var lr=fr.getuid?!fr.getuid():!1,ur=1e4,q=()=>{};a();var _e={isChangeErrorOk:e=>{if(!_e.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!lr&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!_e.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!_e.isNodeError(e))throw e;if(!_e.isChangeErrorOk(e))throw e}},x=_e;a();a();var ot=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=ur,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=()=>this.remove(i),i=()=>t(r);this.add(i)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},hr=new ot;var X=(e,t)=>function(i){return function n(...s){return hr.schedule().then(o=>{let c=l=>(o(),l),f=l=>{if(o(),Date.now()>=i)throw l;if(t(l)){let d=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,d)).then(()=>n.apply(void 0,s))}throw l};return e.apply(void 0,s).then(c,f)})}},Z=(e,t)=>function(i){return function n(...s){try{return e.apply(void 0,s)}catch(o){if(Date.now()>i)throw o;if(t(o))return n.apply(void 0,s);throw o}}};var Sn={attempt:{chmod:V(k(v.chmod),x.onChangeError),chown:V(k(v.chown),x.onChangeError),close:V(k(v.close),q),fsync:V(k(v.fsync),q),mkdir:V(k(v.mkdir),q),realpath:V(k(v.realpath),q),stat:V(k(v.stat),q),unlink:V(k(v.unlink),q),chmodSync:K(v.chmodSync,x.onChangeError),chownSync:K(v.chownSync,x.onChangeError),closeSync:K(v.closeSync,q),existsSync:K(v.existsSync,q),fsyncSync:K(v.fsync,q),mkdirSync:K(v.mkdirSync,q),realpathSync:K(v.realpathSync,q),statSync:K(v.statSync,q),unlinkSync:K(v.unlinkSync,q)},retry:{close:X(k(v.close),x.isRetriableError),fsync:X(k(v.fsync),x.isRetriableError),open:X(k(v.open),x.isRetriableError),readFile:X(k(v.readFile),x.isRetriableError),rename:X(k(v.rename),x.isRetriableError),stat:X(k(v.stat),x.isRetriableError),write:X(k(v.write),x.isRetriableError),writeFile:X(k(v.writeFile),x.isRetriableError),closeSync:Z(v.closeSync,x.isRetriableError),fsyncSync:Z(v.fsyncSync,x.isRetriableError),openSync:Z(v.openSync,x.isRetriableError),readFileSync:Z(v.readFileSync,x.isRetriableError),renameSync:Z(v.renameSync,x.isRetriableError),statSync:Z(v.statSync,x.isRetriableError),writeSync:Z(v.writeSync,x.isRetriableError),writeFileSync:Z(v.writeFileSync,x.isRetriableError)}},dr=Sn;a();import ct from"node:fs";import Be from"node:path";a();a();a();var at=()=>{};var xn=()=>{let e=at,t=at,r=!1,i=!1;return{promise:new Promise((f,l)=>{e=d=>(r=!0,f(d)),t=d=>(i=!0,l(d))}),resolve:e,reject:t,isPending:()=>!r&&!i,isResolved:()=>r,isRejected:()=>i}},mr=xn;var In=()=>{let{promise:e,resolve:t,isPending:r}=mr(),i=0,n=()=>{i+=1},s=()=>{i-=1,!i&&t()};return(()=>{n(),queueMicrotask(s)})(),{promise:e,isPending:r,increment:n,decrement:s}},pr=In;a();var yr={then:e=>{e()}};a();var wr=e=>Array.isArray(e)?e:[e],gr=e=>typeof e=="function";var Dn=(e,t)=>{let r=t?.followSymlinks??!1,i=t?.depth??1/0,n=t?.limit??1/0,s=t?.ignore??[],o=wr(s).map(w=>gr(w)?w:y=>w.test(y)),c=w=>o.some(y=>y(w)),f=t?.signal??{aborted:!1},l=t?.onDirents||(()=>{}),d=[],u=new Set,h={},_=[],T=new Set,U={},M=[],ee=new Set,te={},ce={},N=new Set,F={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{},map:{}},re={directories:d,directoriesNames:u,directoriesNamesToPaths:h,files:_,filesNames:T,filesNamesToPaths:U,symlinks:M,symlinksNames:ee,symlinksNamesToPaths:te,map:ce},{promise:fe,increment:Me,decrement:G}=pr(),Y=0,Mt=(w,y,E,S)=>{N.has(y)||Y>=n||(Y+=1,w.directories.push(y),w.directoriesNames.add(E),d.push(y),u.add(E),h.propertyIsEnumerable(E)||(h[E]=[]),h[E].push(y),N.add(y),!(S>=i)&&(Y>=n||jt(y,S+1)))},Wt=(w,y,E)=>{N.has(y)||Y>=n||(Y+=1,w.files.push(y),w.filesNames.add(E),_.push(y),T.add(E),U.propertyIsEnumerable(E)||(U[E]=[]),U[E].push(y),N.add(y))},Gt=(w,y,E,S)=>{N.has(y)||Y>=n||(Y+=1,w.symlinks.push(y),w.symlinksNames.add(E),M.push(y),ee.add(E),te.propertyIsEnumerable(E)||(te[E]=[]),te[E].push(y),N.add(y),r&&(S>=i||Y>=n||hn(y,S+1)))},cn=(w,y,E,S,j)=>{f.aborted||c(y)||(S.isDirectory()?Mt(w,y,E,j):S.isFile()?Wt(w,y,E):S.isSymbolicLink()&&Gt(w,y,E,j))},ln=(w,y,E,S)=>{if(f.aborted)return;let j=y===Be.sep?"":Be.sep,H=E.name,ye=`${y}${j}${H}`;c(ye)||(E.isDirectory()?Mt(w,ye,H,S):E.isFile()?Wt(w,ye,H):E.isSymbolicLink()&&Gt(w,ye,H,S))},un=(w,y,E,S)=>{for(let j=0,H=E.length;j<H;j++)ln(w,y,E[j],S)},jt=(w,y)=>{f.aborted||y>i||Y>=n||(Me(),ct.readdir(w,{withFileTypes:!0},(E,S)=>{if(E||f.aborted||!S.length)return G();(l(S)||yr).then(()=>{let H=ce[w]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};un(H,w,S,y),G()})}))},hn=(w,y)=>{Me(),ct.realpath(w,(E,S)=>{if(E||f.aborted)return G();ct.stat(S,(j,H)=>{if(j||f.aborted)return G();let ye=Be.basename(S),dn=ce[w]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};cn(dn,S,ye,H,y),G()})})};return(async(w,y=1)=>(w=Be.normalize(w),N.add(w),jt(w,y),await fe,f.aborted?F:re))(e)},Er=Dn;var z={lang:{debounce:je,attempt:e=>{try{return e()}catch(t){return z.lang.castError(t)}},castArray:e=>z.lang.isArray(e)?e:[e],castError:e=>z.lang.isError(e)?e:z.lang.isString(e)?new Error(e):new Error("Unknown error"),defer:e=>setTimeout(e,0),isArray:e=>Array.isArray(e),isError:e=>e instanceof Error,isFunction:e=>typeof e=="function",isNaN:e=>Number.isNaN(e),isNumber:e=>typeof e=="number",isPrimitive:e=>{if(e===null)return!0;let t=typeof e;return t!=="object"&&t!=="function"},isShallowEqual:(e,t)=>{if(e===t)return!0;if(z.lang.isNaN(e))return z.lang.isNaN(t);if(z.lang.isPrimitive(e)||z.lang.isPrimitive(t))return e===t;for(let r in e)if(!(r in t))return!1;for(let r in t)if(e[r]!==t[r])return!1;return!0},isSet:e=>e instanceof Set,isString:e=>typeof e=="string",isUndefined:e=>e===void 0,noop:()=>{},uniq:e=>e.length<2?e:Array.from(new Set(e))},fs:{getDepth:e=>Math.max(0,e.split(ft.sep).length-1),getRealPath:(e,t)=>{try{return t?vr.realpathSync.native(e):vr.realpathSync(e)}catch{return}},isSubPath:(e,t)=>t.startsWith(e)&&t[e.length]===ft.sep&&t.length-e.length>ft.sep.length,poll:(e,t=cr)=>dr.retry.stat(t)(e,{bigint:!0}).catch(z.lang.noop),readdir:async(e,t,r=1/0,i=1/0,n,s)=>{if(s&&r===1&&e in s){let o=s[e];return[o.directories,o.files]}else{let o=await Er(e,{depth:r,limit:i,ignore:t,signal:n});return[o.directories,o.files]}}}},p=z;a();import lt from"node:path";var ut=class{constructor(t,r,i){this.base=i,this.watcher=t,this.handler=r.handler,this.fswatcher=r.watcher,this.options=r.options,this.folderPath=r.folderPath,this.filePath=r.filePath,this.handlerBatched=this.base?this.base.onWatcherEvent.bind(this.base):this._makeHandlerBatched(this.options.debounce)}_isSubRoot(t){return this.filePath?t===this.filePath:t===this.folderPath||p.fs.isSubPath(this.folderPath,t)}_makeHandlerBatched(t=sr){return(()=>{let r=this.watcher._readyWait,i=[],n=new Set,s=async(c,f)=>{let l=this.options.ignoreInitial?[]:c,d=await this.eventsPopulate([...f]),u=this.eventsDeduplicate([...l,...d]);this.onTargetEvents(u)},o=p.lang.debounce(()=>{this.watcher.isClosed()||(r=s(i,n),i=[],n=new Set)},t);return async(c,f="",l=!1)=>{l?await this.eventsPopulate([f],i,!0):n.add(f),r.then(o)}})()}eventsDeduplicate(t){if(t.length<2)return t;let r={};return t.reduce((i,n)=>{let[s,o]=n,c=r[o];return s===c||s===m.CHANGE&&c===m.ADD||(r[o]=s,i.push(n)),i},[])}async eventsPopulate(t,r=[],i=!1){return await Promise.all(t.map(async n=>{let s=await this.watcher._poller.update(n,this.options.pollingTimeout);await Promise.all(s.map(async o=>{r.push([o,n]),o===m.ADD_DIR?await this.eventsPopulateAddDir(t,n,r,i):o===m.UNLINK_DIR&&await this.eventsPopulateUnlinkDir(t,n,r,i)}))})),r}async eventsPopulateAddDir(t,r,i=[],n=!1){if(n)return i;let s=this.options.recursive?this.options.depth??ie:Math.min(1,this.options.depth??ie),o=this.options.limit??ve,[c,f]=await p.fs.readdir(r,this.options.ignore,s,o,this.watcher._closeSignal),l=[...c,...f];return await Promise.all(l.map(d=>{if(!this.watcher.isIgnored(d,this.options.ignore)&&!t.includes(d))return this.eventsPopulate([d],i,!0)})),i}async eventsPopulateUnlinkDir(t,r,i=[],n=!1){if(n)return i;for(let s of this.watcher._poller.stats.keys())p.fs.isSubPath(r,s)&&(t.includes(s)||await this.eventsPopulate([s],i,!0));return i}onTargetAdd(t){this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAdd(t,this.options.renameTimeout):this.watcher.event(m.ADD,t))}onTargetAddDir(t){t!==this.folderPath&&this.options.recursive&&!ne&&this.options.native!==!1&&this.watcher.watchDirectory(t,this.options,this.handler,void 0,this.base||this),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAddDir(t,this.options.renameTimeout):this.watcher.event(m.ADD_DIR,t))}onTargetChange(t){this._isSubRoot(t)&&this.watcher.event(m.CHANGE,t)}onTargetUnlink(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlink(t,this.options.renameTimeout):this.watcher.event(m.UNLINK,t))}onTargetUnlinkDir(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this.watcher.watchersClose(t),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlinkDir(t,this.options.renameTimeout):this.watcher.event(m.UNLINK_DIR,t))}onTargetEvent(t){let[r,i]=t;r===m.ADD?this.onTargetAdd(i):r===m.ADD_DIR?this.onTargetAddDir(i):r===m.CHANGE?this.onTargetChange(i):r===m.UNLINK?this.onTargetUnlink(i):r===m.UNLINK_DIR&&this.onTargetUnlinkDir(i)}onTargetEvents(t){for(let r of t)this.onTargetEvent(r)}onWatcherEvent(t,r,i=!1){return this.handlerBatched(t,r,i)}onWatcherChange(t=le.CHANGE,r){if(this.watcher.isClosed())return;let i=lt.resolve(this.folderPath,r||"");this.filePath&&i!==this.folderPath&&i!==this.filePath||this.watcher.isIgnored(i,this.options.ignore)||this.onWatcherEvent(t,i)}onWatcherError(t){nt&&t.code==="EPERM"?this.onWatcherChange(le.CHANGE,""):this.watcher.error(t)}async init(){await this.initWatcherEvents(),await this.initInitialEvents()}async initWatcherEvents(){let t=this.onWatcherChange.bind(this);this.fswatcher.on(Ne.CHANGE,t);let r=this.onWatcherError.bind(this);this.fswatcher.on(Ne.ERROR,r)}async initInitialEvents(){let t=!this.watcher.isReady();if(this.filePath){if(this.watcher._poller.stats.has(this.filePath))return;await this.onWatcherEvent(le.CHANGE,this.filePath,t)}else{let r=this.options.recursive&&ne&&this.options.native!==!1?this.options.depth??ie:Math.min(1,this.options.depth??ie),i=this.options.limit??ve,[n,s]=await p.fs.readdir(this.folderPath,this.options.ignore,r,i,this.watcher._closeSignal,this.options.readdirMap),o=[this.folderPath,...n,...s];await Promise.all(o.map(c=>{if(!this.watcher._poller.stats.has(c)&&!this.watcher.isIgnored(c,this.options.ignore))return this.onWatcherEvent(le.CHANGE,c,t)}))}}},Nr=ut;a();a();var O={interval:100,intervalId:void 0,fns:new Map,init:()=>{O.intervalId||(O.intervalId=setInterval(O.resolve,O.interval))},reset:()=>{O.intervalId&&(clearInterval(O.intervalId),delete O.intervalId)},add:(e,t)=>{O.fns.set(e,Date.now()+t),O.init()},remove:e=>{O.fns.delete(e)},resolve:()=>{if(!O.fns.size)return O.reset();let e=Date.now();for(let[t,r]of O.fns)r>=e||(O.remove(t),t())}},Se=O;var xe=class e{constructor(t){this._watcher=t,this.reset()}getLockAdd(t,r=st){let{ino:i,targetPath:n,events:s,locks:o}=t,c=()=>{let u=this._watcher._poller.paths.find(i||-1,h=>h!==n);if(u&&u!==n){if(p.fs.getRealPath(n,!0)===u)return;this._watcher.event(s.rename,u,n)}else this._watcher.event(s.add,n)};if(!i)return c();let f=()=>{o.add.delete(i),Se.remove(l)},l=()=>{f(),c()};Se.add(l,r);let d=()=>{let u=o.unlink.get(i);if(!u)return;f();let h=u();n===h?s.change&&this._watcher._poller.stats.has(n)&&this._watcher.event(s.change,n):this._watcher.event(s.rename,h,n)};o.add.set(i,d),d()}getLockUnlink(t,r=st){let{ino:i,targetPath:n,events:s,locks:o}=t,c=()=>{this._watcher.event(s.unlink,n)};if(!i)return c();let f=()=>{o.unlink.delete(i),Se.remove(l)},l=()=>{f(),c()};Se.add(l,r);let d=()=>(f(),n);o.unlink.set(i,d),o.add.get(i)?.()}getLockTargetAdd(t,r){let i=this._watcher._poller.getIno(t,m.ADD,$.FILE);return this.getLockAdd({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetAddDir(t,r){let i=this._watcher._poller.getIno(t,m.ADD_DIR,$.DIR);return this.getLockAdd({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}getLockTargetUnlink(t,r){let i=this._watcher._poller.getIno(t,m.UNLINK,$.FILE);return this.getLockUnlink({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetUnlinkDir(t,r){let i=this._watcher._poller.getIno(t,m.UNLINK_DIR,$.DIR);return this.getLockUnlink({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}reset(){this._locksAdd=new Map,this._locksAddDir=new Map,this._locksUnlink=new Map,this._locksUnlinkDir=new Map,this._locksDir={add:this._locksAddDir,unlink:this._locksUnlinkDir},this._locksFile={add:this._locksAdd,unlink:this._locksUnlink}}};xe.DIR_EVENTS={add:m.ADD_DIR,rename:m.RENAME_DIR,unlink:m.UNLINK_DIR};xe.FILE_EVENTS={add:m.ADD,change:m.CHANGE,rename:m.RENAME,unlink:m.UNLINK};var _r=xe;a();a();var ht=class{constructor(){this.map=new Map}clear(){this.map.clear()}delete(t,r){if(p.lang.isUndefined(r))return this.map.delete(t);if(this.map.has(t)){let i=this.map.get(t);if(p.lang.isSet(i)){let n=i.delete(r);return i.size||this.map.delete(t),n}else if(i===r)return this.map.delete(t),!0}return!1}find(t,r){if(this.map.has(t)){let i=this.map.get(t);if(p.lang.isSet(i))return Array.from(i).find(r);if(r(i))return i}}get(t){return this.map.get(t)}has(t,r){if(p.lang.isUndefined(r))return this.map.has(t);if(this.map.has(t)){let i=this.map.get(t);return p.lang.isSet(i)?i.has(r):i===r}return!1}set(t,r){if(this.map.has(t)){let i=this.map.get(t);p.lang.isSet(i)?i.add(r):i!==r&&this.map.set(t,new Set([i,r]))}else this.map.set(t,r);return this}},dt=ht;a();var mt=class{constructor(t){this.ino=t.ino<=Number.MAX_SAFE_INTEGER?Number(t.ino):t.ino,this.size=Number(t.size),this.atimeMs=Number(t.atimeMs),this.mtimeMs=Number(t.mtimeMs),this.ctimeMs=Number(t.ctimeMs),this.birthtimeMs=Number(t.birthtimeMs),this._isFile=t.isFile(),this._isDirectory=t.isDirectory(),this._isSymbolicLink=t.isSymbolicLink()}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}},Sr=mt;var pt=class{constructor(){this.inos={},this.paths=new dt,this.stats=new Map}getIno(t,r,i){let n=this.inos[r];if(!n)return;let s=n[t];if(s&&!(i&&s[1]!==i))return s[0]}getStats(t){return this.stats.get(t)}async poll(t,r){let i=await p.fs.poll(t,r);if(!(!i||!(i.isFile()||i.isDirectory())))return new Sr(i)}reset(){this.inos={},this.paths=new dt,this.stats=new Map}async update(t,r){let i=this.getStats(t),n=await this.poll(t,r);if(this.updateStats(t,n),!i&&n){if(n.isFile())return this.updateIno(t,m.ADD,n),[m.ADD];if(n.isDirectory())return this.updateIno(t,m.ADD_DIR,n),[m.ADD_DIR]}else if(i&&!n){if(i.isFile())return this.updateIno(t,m.UNLINK,i),[m.UNLINK];if(i.isDirectory())return this.updateIno(t,m.UNLINK_DIR,i),[m.UNLINK_DIR]}else if(i&&n){if(i.isFile()){if(n.isFile())return i.ino===n.ino&&!i.size&&!n.size?[]:(this.updateIno(t,m.CHANGE,n),[m.CHANGE]);if(n.isDirectory())return this.updateIno(t,m.UNLINK,i),this.updateIno(t,m.ADD_DIR,n),[m.UNLINK,m.ADD_DIR]}else if(i.isDirectory()){if(n.isFile())return this.updateIno(t,m.UNLINK_DIR,i),this.updateIno(t,m.ADD,n),[m.UNLINK_DIR,m.ADD];if(n.isDirectory())return i.ino===n.ino?[]:(this.updateIno(t,m.UNLINK_DIR,i),this.updateIno(t,m.ADD_DIR,n),[m.UNLINK_DIR,m.ADD_DIR])}}return[]}updateIno(t,r,i){let n=this.inos[r]=this.inos[r]||(this.inos[r]={}),s=i.isFile()?$.FILE:$.DIR;n[t]=[i.ino,s]}updateStats(t,r){if(r)this.paths.set(r.ino,t),this.stats.set(t,r);else{let i=this.stats.get(t)?.ino||-1;this.paths.delete(i,t),this.stats.delete(t)}}},yt=pt;var gt=class e extends An{constructor(t,r,i){super(),this._closed=!1,this._ready=!1,this._closeAborter=new AbortController,this._closeSignal=this._closeAborter.signal,this.on(L.CLOSE,()=>this._closeAborter.abort()),this._closeWait=new Promise(n=>this.on(L.CLOSE,n)),this._readyWait=new Promise(n=>this.on(L.READY,n)),this._locker=new _r(this),this._roots=new Set,this._poller=new yt,this._pollers=new Set,this._subwatchers=new Set,this._watchers={},this._watchersLock=Promise.resolve(),this._watchersRestorable={},this.watch(t,r,i)}isClosed(){return this._closed}isIgnored(t,r){return!!r&&(p.lang.isFunction(r)?!!r(t):r.test(t))}isReady(){return this._ready}close(){return this._locker.reset(),this._poller.reset(),this._roots.clear(),this.watchersClose(),this.isClosed()?!1:(this._closed=!0,this.emit(L.CLOSE))}error(t){if(this.isClosed())return!1;let r=p.lang.castError(t);return this.emit(L.ERROR,r)}event(t,r,i){return this.isClosed()?!1:(this.emit(L.ALL,t,r,i),this.emit(t,r,i))}ready(){return this.isClosed()||this.isReady()?!1:(this._ready=!0,this.emit(L.READY))}pollerExists(t,r){for(let i of this._pollers)if(i.targetPath===t&&p.lang.isShallowEqual(i.options,r))return!0;return!1}subwatcherExists(t,r){for(let i of this._subwatchers)if(i.targetPath===t&&p.lang.isShallowEqual(i.options,r))return!0;return!1}watchersClose(t,r,i=!0){if(t){let n=this._watchers[t];if(n)for(let s of[...n])r&&s.filePath!==r||this.watcherClose(s);if(i)for(let s in this._watchers)p.fs.isSubPath(t,s)&&this.watchersClose(s,r,!1)}else for(let n in this._watchers)this.watchersClose(n,r,!1)}watchersLock(t){return this._watchersLock.then(()=>this._watchersLock=new Promise(async r=>{await t(),r()}))}watchersRestore(){delete this._watchersRestoreTimeout;let t=Object.entries(this._watchersRestorable);this._watchersRestorable={};for(let[r,i]of t)this.watchPath(r,i.options,i.handler)}async watcherAdd(t,r){let{folderPath:i}=t;(this._watchers[i]=this._watchers[i]||[]).push(t);let s=new Nr(this,t,r);return await s.init(),s}watcherClose(t){t.watcher.close();let r=this._watchers[t.folderPath];if(r){let s=r.indexOf(t);r.splice(s,1),r.length||delete this._watchers[t.folderPath]}let i=t.filePath||t.folderPath;this._roots.has(i)&&(this._watchersRestorable[i]=t,this._watchersRestoreTimeout||(this._watchersRestoreTimeout=p.lang.defer(()=>this.watchersRestore())))}watcherExists(t,r,i,n){if(this._watchers[t]?.find(c=>c.handler===i&&(!c.filePath||c.filePath===n)&&c.options.ignore===r.ignore&&!!c.options.native==!!r.native&&(!r.recursive||c.options.recursive)))return!0;let o=we.dirname(t);for(let c=1;c<1/0;c++){if(this._watchers[o]?.find(d=>(c===1||d.options.recursive&&c<=(d.options.depth??ie))&&d.handler===i&&(!d.filePath||d.filePath===n)&&d.options.ignore===r.ignore&&!!d.options.native==!!r.native&&(!r.recursive||d.options.recursive&&ne&&d.options.native!==!1)))return!0;if(!ne)break;let l=we.dirname(t);if(o===l)break;o=l}return!1}async watchDirectories(t,r,i,n,s){if(this.isClosed())return;t=p.lang.uniq(t).sort();let o;for(let c of t)if(!this.isIgnored(c,r.ignore)&&!this.watcherExists(c,r,i,n))try{let f=!r.recursive||ne&&r.native!==!1?r:{...r,recursive:!1},d={watcher:wt.watch(c,f),handler:i,options:r,folderPath:c,filePath:n},u=o=await this.watcherAdd(d,s);if(this._roots.has(n||c)){let _={...r,ignoreInitial:!0,recursive:!1},T=we.dirname(c),U=c;await this.watchDirectories([T],_,i,U,u)}}catch(f){this.error(f)}return o}async watchDirectory(t,r,i,n,s){if(!this.isClosed()&&!this.isIgnored(t,r.ignore)){if(!r.recursive||ne&&r.native!==!1)return this.watchersLock(()=>this.watchDirectories([t],r,i,n,s));{r={...r,recursive:!0};let o=r.depth??ie,c=r.limit??ve,[f]=await p.fs.readdir(t,r.ignore,o,c,this._closeSignal,r.readdirMap);return this.watchersLock(async()=>{let l=await this.watchDirectories([t],r,i,n,s);if(f.length){let d=p.fs.getDepth(t);for(let u of f){let h=p.fs.getDepth(u),_=Math.max(0,o-(h-d)),T={...r,depth:_};await this.watchDirectories([u],T,i,n,s||l)}}})}}}async watchFileOnce(t,r,i){if(this.isClosed()||(r={...r,ignoreInitial:!1},this.subwatcherExists(t,r)))return;let n={targetPath:t,options:r},s=(l,d)=>{d===t&&(f(),i())},o=new e(s),c=()=>{this._subwatchers.add(n),this.on(L.CLOSE,f),o.watchFile(t,r,s)},f=()=>{this._subwatchers.delete(n),this.removeListener(L.CLOSE,f),o.close()};return c()}async watchFile(t,r,i){if(this.isClosed()||this.isIgnored(t,r.ignore))return;r={...r,recursive:!1};let n=we.dirname(t);return this.watchDirectory(n,r,i,t)}async watchPollingOnce(t,r,i){if(this.isClosed())return;let n=!1,s=new yt,o=await this.watchPolling(t,r,async()=>{n||!(await s.update(t,r.pollingTimeout)).length||n||(n=!0,o(),i())})}async watchPolling(t,r,i){if(this.isClosed())return p.lang.noop;if(this.pollerExists(t,r))return p.lang.noop;let n={...r,interval:r.pollingInterval??ar},s={targetPath:t,options:r},o=()=>{this._pollers.add(s),this.on(L.CLOSE,c),wt.watchFile(t,n,i)},c=()=>{this._pollers.delete(s),this.removeListener(L.CLOSE,c),wt.unwatchFile(t,i)};return p.lang.attempt(o),()=>p.lang.attempt(c)}async watchUnknownChild(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchFileOnce(t,r,n)}async watchUnknownTarget(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchPollingOnce(t,r,n)}async watchPaths(t,r,i){if(this.isClosed())return;if(t=p.lang.uniq(t).sort(),t.every((s,o)=>t.every((c,f)=>f===o||!p.fs.isSubPath(s,c))))await Promise.all(t.map(s=>this.watchPath(s,r,i)));else for(let s of t)await this.watchPath(s,r,i)}async watchPath(t,r,i){if(this.isClosed()||(t=we.resolve(t),this.isIgnored(t,r.ignore)))return;let n=await p.fs.poll(t,r.pollingTimeout);if(n){if(n.isFile())return this.watchFile(t,r,i);if(n.isDirectory())return this.watchDirectory(t,r,i);this.error(`"${t}" is not supported`)}else{let s=we.dirname(t);return(await p.fs.poll(s,r.pollingTimeout))?.isDirectory()?this.watchUnknownChild(t,r,i):this.watchUnknownTarget(t,r,i)}}async watch(t,r,i=p.lang.noop){if(p.lang.isFunction(t))return this.watch([],{},t);if(p.lang.isUndefined(t))return this.watch([],r,i);if(p.lang.isFunction(r))return this.watch(t,{},r);if(p.lang.isUndefined(r))return this.watch(t,{},i);if(this.isClosed())return;this.isReady()&&(r.readdirMap=void 0);let n=p.lang.castArray(t);n.forEach(s=>this._roots.add(s)),await this.watchPaths(n,r,i),!this.isClosed()&&(i!==p.lang.noop&&this.on(L.ALL,i),r.readdirMap=void 0,this.ready())}},xr=gt;var an=We(Kr(),1);a();var Et=(e,...t)=>{let r=Kt(e,...t);Ge.isInteractive?Ge.updateFooter(r):Ge.writeStdout(r)};a();var rn=We(tn(),1);var nn=(e,t)=>{e.log.info("notifying user",{notification:t}),rn.default.notify({title:"Gadget",contentImage:tt("favicon-128@4x.png"),icon:tt("favicon-128@4x.png"),sound:!0,timeout:!1,...t},r=>{r&&e.log.warn("error notifying user",{notification:t})})};var xl={...tr,"--prefer":er,"--file-push-delay":{type:Number,default:(0,ae.default)("100ms")},"--file-watch-debounce":{type:Number,default:(0,ae.default)("300ms")},"--file-watch-poll-interval":{type:Number,default:(0,ae.default)("3s")},"--file-watch-poll-timeout":{type:Number,default:(0,ae.default)("20s")},"--file-watch-rename-timeout":{type:Number,default:(0,ae.default)("1.25s")}},Il=e=>W`
|
|
4
|
-
Clones your Gadget environment's files to your local machine and keeps it in sync, in order to
|
|
5
|
-
enable local development with your text editor and source code with Git.
|
|
6
|
-
|
|
7
|
-
If your app's local directory already exists, this command first performs a sync to ensure
|
|
8
|
-
that your local and environment directories match, changes are tracked since last sync. If any
|
|
9
|
-
conflicts are detected, they must be resolved before development starts.
|
|
10
|
-
|
|
11
|
-
{gray Usage}
|
|
12
|
-
$ ggt dev [DIRECTORY] [options]
|
|
13
|
-
|
|
14
|
-
DIRECTORY: The directory to sync files to (default: the current directory)
|
|
15
|
-
|
|
16
|
-
{gray Options}
|
|
17
|
-
-a, --app <app_name> Selects the app to sync files with. Default set on ".gadget/sync.json"
|
|
18
|
-
-e, --env <env_name> Selects the environment to sync files with. Default set on ".gadget/sync.json"
|
|
19
|
-
--prefer <source> Auto-select changes from 'local' or 'environment' source on conflict
|
|
20
|
-
--allow-unknown-directory Syncs to any local directory with existing files, even if the ".gadget/sync.json" file is missing
|
|
21
|
-
--allow-different-app Syncs with a different app using the --app command, instead of the one specified in the .gadget/sync.json file
|
|
22
|
-
|
|
23
|
-
{gray Ignoring files}
|
|
24
|
-
ggt dev uses a .ignore file, similar to .gitignore, to exclude specific files and
|
|
25
|
-
folders from syncing. These files are always ignored:
|
|
26
|
-
|
|
27
|
-
• .DS_Store
|
|
28
|
-
• .gadget
|
|
29
|
-
• .git
|
|
30
|
-
• node_modules
|
|
31
|
-
|
|
32
|
-
{gray Notes}
|
|
33
|
-
• "ggt dev" only works with development environments
|
|
34
|
-
• "ggt dev" only supports "yarn" v1 for installing dependencies
|
|
35
|
-
• Avoid deleting or moving all of your files while "ggt dev" is running
|
|
36
|
-
|
|
37
|
-
{gray Examples}
|
|
38
|
-
sync an app in a custom path
|
|
39
|
-
{cyanBright $ ggt dev ~/myGadgetApps/myBlog --app myBlogApp}
|
|
40
|
-
|
|
41
|
-
sync with a specific environment and preselect all local changes on conflicts
|
|
42
|
-
{cyanBright $ ggt dev --env main --prefer local}
|
|
43
|
-
|
|
44
|
-
sync a custom path with a specific app, environment and preselect all changes from local on conflicts
|
|
45
|
-
{cyanBright $ ggt dev ~/gadget/example --app=example --env=development --prefer=local}
|
|
46
|
-
`,Dl=async e=>{if(!await(0,an.default)("yarn",{nothrow:!0}))throw new Xt;let t=await ir(e.args._[0]||process.cwd()),r=await rr.loadOrInit(e,{directory:t});Et({ensureEmptyLineAbove:!0,content:r.sprint()});let i=new nr(r),n=await i.hashes(e);if(!n.inSync)if(!r.previousEnvironment||n.localChangesToPush.size===0&&n.onlyDotGadgetFilesChanged)await i.merge(e,{hashes:n,printLocalChangesOptions:{limit:5},printEnvironmentChangesOptions:{limit:5}});else{await i.print(e,{hashes:n});let u=Object.values(B);switch(await Zt({ensureEmptyLineAbove:!0,choices:n.bothChanged?u:u.filter(_=>_!==B.MERGE),content:Bt.bold("What do you want to do?"),formatChoice:_=>{switch(_){case B.CANCEL:return W`Cancel (Ctrl+C)`;case B.MERGE:return W`Merge local and environment's changes`;case B.PUSH:switch(!0){case n.bothChanged:return W`Push local changes and {underline discard environment's} changes`;case n.localChanges.size>0:return W`Push local changes`;case n.environmentChanges.size>0:return W`Discard environment's changes`;default:return it("no changes to push or discard")}case B.PULL:switch(!0){case n.bothChanged:return W`Pull environment's changes and {underline discard local} changes`;case n.localChanges.size>0:return W`Discard local changes`;case n.environmentChanges.size>0:return W`Pull environment's changes`;default:return it("no changes to pull or discard")}}}})){case B.CANCEL:process.exit(0);break;case B.MERGE:await i.merge(e,{hashes:n});break;case B.PUSH:await i.push(e,{hashes:n,force:!0});break;case B.PULL:await i.pull(e,{hashes:n,force:!0});break}}let s=new Map,o=setInterval(()=>{for(let[u,h]of s)(0,on.default)().isAfter(h+(0,ae.default)("5s"))&&s.delete(u)},(0,ae.default)("1s")).unref(),c=i.subscribeToEnvironmentChanges(e,{onError:u=>e.abort(u),beforeChanges:({changed:u,deleted:h})=>{for(let _ of[...u,...h]){s.set(_,Date.now());let T=sn.dirname(_);for(;T!==".";)s.set(T+"/",Date.now()),T=sn.dirname(T)}}}),f=new rt,l=$t(e.args["--file-push-delay"],async()=>{try{let u=r.gitBranch;if(await r.loadGitBranch(),u!==r.gitBranch){zt({ensureEmptyLineAbove:!0,content:W`
|
|
47
|
-
Your git branch changed.
|
|
48
|
-
|
|
49
|
-
${u} → ${r.gitBranch}
|
|
50
|
-
`});let _=Qt({ensureEmptyLineAbove:!0,content:"Waiting for file changes to settle."});await Yt("3s"),_.succeed()}let h=new rt(f.entries());f.clear(),await i.mergeChangesWithEnvironment(e,{changes:h})}catch(u){e.log.error("error sending changes to gadget",{error:u}),e.abort(u)}});e.log.debug("watching",{path:r.directory.path});let d=new xr(r.directory.path,{ignoreInitial:!0,recursive:!0,ignore:u=>r.directory.relative(u).startsWith(".gadget")||r.directory.ignores(u),renameDetection:!0,renameTimeout:e.args["--file-watch-rename-timeout"],debounce:e.args["--file-watch-debounce"]},(u,h,_)=>{let T=u==="rename"||u==="renameDir"?_:h,U=u==="renameDir"||u==="addDir"||u==="unlinkDir",M=r.directory.normalize(T,U);if(e.log.trace("file event",{event:u,isDirectory:U,path:M}),T===r.directory.absolute(".ignore"))r.directory.loadIgnoreFile().catch(ee=>e.abort(ee));else if(r.directory.ignores(T))return;if(s.delete(M)){e.log.trace("ignoring event because we caused it",{event:u,path:M});return}switch(u){case"add":case"addDir":f.set(M,{type:"create"});break;case"rename":case"renameDir":{let ee=r.directory.normalize(h,U);f.set(M,{type:"create",oldPath:ee});break}case"change":{f.set(M,{type:"update"});break}case"unlink":case"unlinkDir":{f.set(M,{type:"delete"});break}}l()}).once("error",u=>e.abort(u));e.onAbort(async u=>{e.log.info("stopping",{reason:u}),c.unsubscribe(),d.close(),clearInterval(o),await l.flush();try{await i.idle()}catch(h){e.log.error("error while waiting for idle",{error:h})}Ht(u)||(nn(e,{subtitle:"Uh oh!",message:"An error occurred while syncing files"}),await Vt(e,u))}),Et({ensureEmptyLineAbove:!0,content:W`
|
|
51
|
-
${r.sprint({indent:4})}
|
|
52
|
-
|
|
53
|
-
Waiting for file changes${Jt.ellipsis} {gray Press Ctrl+C to stop}
|
|
54
|
-
`})};export{xl as args,Dl as run,Il as usage};
|
|
55
|
-
//# sourceMappingURL=dev-5UFCKF4X.js.map
|