zen-code 4.10.0 → 4.10.1
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/dist/app.js +2615 -157
- package/dist/cli.js +3116 -1
- package/dist/nonInteractive.js +1950 -180
- package/dist/zen-keyboard.js +358 -3
- package/package.json +1 -1
- package/dist/chunk-075hks9v.js +0 -1
- package/dist/chunk-0fj768k4.js +0 -112
- package/dist/chunk-19mf2aa7.js +0 -1
- package/dist/chunk-1mq2jmfy.js +0 -2
- package/dist/chunk-1v863afn.js +0 -278
- package/dist/chunk-1vn8d8b8.js +0 -1
- package/dist/chunk-1w19w1bm.js +0 -2
- package/dist/chunk-3dnayvgx.js +0 -224
- package/dist/chunk-4hg13vwj.js +0 -1
- package/dist/chunk-4scrkcqv.js +0 -1
- package/dist/chunk-54cdhhqm.js +0 -1
- package/dist/chunk-5m4yb9av.js +0 -91
- package/dist/chunk-5yd4ntp6.js +0 -8
- package/dist/chunk-6scjjkn3.js +0 -23
- package/dist/chunk-7jatn15w.js +0 -2
- package/dist/chunk-7w9y11hj.js +0 -88
- package/dist/chunk-7yzv6385.js +0 -1
- package/dist/chunk-875hayaj.js +0 -3
- package/dist/chunk-8bs8r50r.js +0 -1
- package/dist/chunk-8waww0j9.js +0 -6
- package/dist/chunk-8ysg0rga.js +0 -1
- package/dist/chunk-9czhw5k6.js +0 -4
- package/dist/chunk-9tgp14v7.js +0 -16
- package/dist/chunk-a239dn0b.js +0 -1
- package/dist/chunk-arv4h3h1.js +0 -2
- package/dist/chunk-b2551zfb.js +0 -2
- package/dist/chunk-b9emn03n.js +0 -1
- package/dist/chunk-bm7578sn.js +0 -1
- package/dist/chunk-bytq4kd1.js +0 -176
- package/dist/chunk-c2wfgbj6.js +0 -1
- package/dist/chunk-cef4vbtb.js +0 -26
- package/dist/chunk-cnzhxgn5.js +0 -4
- package/dist/chunk-d2770b2z.js +0 -1
- package/dist/chunk-d72063sm.js +0 -2
- package/dist/chunk-d988tv30.js +0 -1
- package/dist/chunk-dx9k6sdd.js +0 -7
- package/dist/chunk-e6ggkg36.js +0 -2
- package/dist/chunk-fjqtrakn.js +0 -1
- package/dist/chunk-gbfpab0j.js +0 -1
- package/dist/chunk-gkvx829z.js +0 -1
- package/dist/chunk-gwf8b14k.js +0 -3
- package/dist/chunk-gz7fz9fg.js +0 -1
- package/dist/chunk-h0q3dvnv.js +0 -5
- package/dist/chunk-h0qb9jk1.js +0 -1
- package/dist/chunk-h9y136h8.js +0 -1
- package/dist/chunk-hrcxdj3c.js +0 -54
- package/dist/chunk-hz9yw7cs.js +0 -166
- package/dist/chunk-j4y5rjne.js +0 -79
- package/dist/chunk-k12y05c3.js +0 -3
- package/dist/chunk-k6fxqssr.js +0 -18
- package/dist/chunk-kmxdq21k.js +0 -2
- package/dist/chunk-mcb8rewr.js +0 -213
- package/dist/chunk-mm9w91rj.js +0 -4
- package/dist/chunk-mv0xzmq8.js +0 -2
- package/dist/chunk-n849zsd3.js +0 -1
- package/dist/chunk-nm253hhf.js +0 -81
- package/dist/chunk-prg6489q.js +0 -1
- package/dist/chunk-pxdgy0vr.js +0 -2
- package/dist/chunk-qhzm2qw9.js +0 -2
- package/dist/chunk-qmxtys9q.js +0 -2
- package/dist/chunk-r0cfe5c1.js +0 -294
- package/dist/chunk-rtjytfhh.js +0 -1
- package/dist/chunk-s7ttf0pm.js +0 -2
- package/dist/chunk-t01t72t2.js +0 -140
- package/dist/chunk-t0f66x64.js +0 -1
- package/dist/chunk-tn356gwf.js +0 -93
- package/dist/chunk-vd8kwzra.js +0 -41
- package/dist/chunk-vhn13anh.js +0 -233
- package/dist/chunk-vnewbtjy.js +0 -1
- package/dist/chunk-wbm7rn9w.js +0 -2
- package/dist/chunk-wd3gkd45.js +0 -3
- package/dist/chunk-whdf0vbb.js +0 -1
- package/dist/chunk-ws232ksq.js +0 -2
- package/dist/chunk-yerf10k7.js +0 -6
- package/dist/chunk-yzv3n8mw.js +0 -2
- package/dist/chunk-z3e4c424.js +0 -2
- package/dist/chunk-znw7fpep.js +0 -6
- package/dist/chunk-zq2g4rfd.js +0 -1
package/dist/chunk-k12y05c3.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{wl as We}from"./chunk-qhzm2qw9.js";import{Dl as Oh,El as Mh,xl as ou}from"./chunk-arv4h3h1.js";import{Fl as Vh,Gl as Ch,Hl as L,Kl as _}from"./chunk-z3e4c424.js";var wu=L((qu)=>{(function(){var u=function(e,h,r){var f,q;q="";while(e.length>0)if(f=e.match(h),f)q+=e.slice(0,f.index),q+=r(f),e=e.slice(f.index+f[0].length);else q+=e,e="";return q};qu.split=function(e){var h,r;if(e==null)e="";if(r=[],h="",u(e,/\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/,function(f){var q,w,E,M,O,V,F;if(M=f[0],F=f[1],V=f[2],q=f[3],w=f[4],E=f[5],O=f[6],E!=null)throw Error("Unmatched quote");if(h+=F||(V||q||w).replace(/\\(?=.)/,""),O!=null)return r.push(h),h=""}),h)r.push(h);return r},qu.escape=function(e){if(e==null)e="";if(e==null)return"''";return e.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g,"\\$1").replace(/\n/g,`'
|
|
2
|
-
'`)}}).call(qu)});var yu=L((Th,Eu)=>{var _u=_("fs"),k;function nu(){try{return _u.statSync("/.dockerenv"),!0}catch(u){return!1}}function tu(){try{return _u.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(u){return!1}}Eu.exports=()=>{if(k===void 0)k=nu()||tu();return k}});var Mu=L((zh,b)=>{var su=_("os"),pu=_("fs"),Cu=yu(),Ou=()=>{if(process.platform!=="linux")return!1;if(su.release().toLowerCase().includes("microsoft")){if(Cu())return!1;return!0}try{return pu.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Cu():!1}catch(u){return!1}};if(process.env.__IS_WSL_TEST__)b.exports=Ou;else b.exports=Ou()});var K=L((Me,y)=>{var ue=wu(),g=_("child_process"),a=ou(),ee=Mu(),he=_("path"),fe=_("url"),X=_("os"),l=_("fs"),re=_("net");function ju(u){return JSON.parse(JSON.stringify(u))}Me.clone=ju;var qe=function(u){if(typeof u==="string")return u.replace(/(["$`\\])/g,"\\$1");else return u},we=function(u,e){return u.indexOf(e)!==-1},Lu={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"};Me.command=function(u,e,h){if(u=ue.escape(u),process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (command):"),console.info("[notifier path]",u),console.info("[notifier options]",e.join(" "));return g.exec(u+" "+e.join(" "),function(r,f,q){if(r)return h(r);h(q,f)})};Me.fileCommand=function(u,e,h){if(process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (fileCommand):"),console.info("[notifier path]",u),console.info("[notifier options]",e.join(" "));return g.execFile(u,e,function(r,f,q){if(r)return h(r,f);h(q,f)})};Me.fileCommandJson=function(u,e,h){if(process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (fileCommandJson):"),console.info("[notifier path]",u),console.info("[notifier options]",e.join(" "));return g.execFile(u,e,function(r,f,q){if(r)return h(r,f);if(!f)return h(r,{});try{let w=JSON.parse(f);h(!q?null:q,w)}catch(w){h(w,f)}})};Me.immediateFileCommand=function(u,e,h){if(process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (notifier):"),console.info("[notifier path]",u);_e(u,function(r,f){if(!f)return h(Error("Notifier ("+u+") not found on system."));g.execFile(u,e),h()})};function _e(u,e){return l.stat(u,function(h,r){if(!h)return e(h,r.isFile());if(he.extname(u))return e(h,!1);return l.stat(u+".exe",function(f,q){if(f)return e(f,!1);e(f,q.isFile())})})}var m=function(u){if(u.appIcon)u.icon=u.appIcon,delete u.appIcon;return u},N=function(u){if(u.text)u.message=u.text,delete u.text;return u},Yu=function(u){if(u.i)u.icon=u.i,delete u.i;return u};Me.mapToNotifySend=function(u){if(u=m(u),u=N(u),u.timeout===!1)delete u.timeout;if(u.wait===!0)u["expire-time"]=5;for(let e in u){if(e==="message"||e==="title")continue;if(u.hasOwnProperty(e)&&Lu[e]!==e)u[Lu[e]]=u[e],delete u[e]}if(typeof u["expire-time"]>"u")u["expire-time"]=1e4;else if(typeof u["expire-time"]==="number")u["expire-time"]=u["expire-time"]*1000;return u};Me.mapToGrowl=function(u){if(u=m(u),u=Yu(u),u=N(u),u.icon&&!Buffer.isBuffer(u.icon))try{u.icon=l.readFileSync(u.icon)}catch(e){}return u};Me.mapToMac=function(u){if(u=Yu(u),u=N(u),u.icon)u.appIcon=u.icon,delete u.icon;if(u.sound===!0)u.sound="Bottle";if(u.sound===!1)delete u.sound;if(u.sound&&u.sound.indexOf("Notification.")===0)u.sound="Bottle";if(u.wait===!0){if(!u.timeout)u.timeout=5;delete u.wait}if(!u.wait&&!u.timeout)if(u.timeout===!1)delete u.timeout;else u.timeout=10;return u.json=!0,u};function i(u){return Object.prototype.toString.call(u)==="[object Array]"}Me.isArray=i;function Ee(){}Me.actionJackerDecorator=function(u,e,h,r){if(e=ju(e),h=h||Ee,typeof h!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof h);return function(f,q){let w=q,E={};if(w&&typeof w==="object")E=w,w=w.activationType;if(w){if(w=w.toLowerCase().trim(),w.match(/^activate|clicked$/))w="activate";if(w.match(/^timedout$/))w="timeout"}if(h.apply(u,[f,w,E]),!r||!w)return;let M=r(w);if(!M)return;u.emit(M,u,e,E)}};Me.constructArgumentList=function(u,e){let h=[];e=e||{};let r=e.initial||[],f=e.keyExtra||"",q=e.allowedArguments||[],w=e.noEscape!==void 0,E=e.allowedArguments!==void 0,M=!!e.explicitTrue,O=!!e.keepNewlines,V=e.wrapper===void 0?'"':e.wrapper,F=function U($){if(i($))return Ju($.map(U).join(","));if(!w)$=qe($);if(typeof $==="string"&&!O)$=Ju($);return V+$+V};r.forEach(function(U){h.push(F(U))});for(let U in u)if(u.hasOwnProperty(U)&&(!E||we(q,U)))if(M&&u[U]===!0)h.push("-"+f+U);else if(M&&u[U]===!1)continue;else h.push("-"+f+U,F(u[U]));return h};function Ju(u){let e=process.platform==="win32"?"\\r\\n":"\\n";return u.replace(/\r?\n/g,e)}var ye=["t","m","b","tb","p","id","s","silent","appID","pid","pipeName","close","install"],Ce="Notification.",Uu="Notification.Default";Me.mapToWin8=function(u){if(u=m(u),u=N(u),u.icon){if(/^file:\/+/.test(u.icon))u.p=new fe.URL(u.icon).pathname.replace(/^\/(\w:\/)/,"$1").replace(/\//g,"\\");else u.p=u.icon;delete u.icon}if(u.message)u.m=u.message.replace(/\x1b/g,""),delete u.message;if(u.title)u.t=u.title,delete u.title;if(u.appName)u.appID=u.appName,delete u.appName;if(typeof u.remove<"u")u.close=u.remove,delete u.remove;if(u.quiet||u.silent)u.silent=u.quiet||u.silent,delete u.quiet;if(typeof u.sound<"u")u.s=u.sound,delete u.sound;if(u.s===!1)u.silent=!0,delete u.s;if(u.s&&u.silent)delete u.s;if(u.s===!0)u.s=Uu;if(u.s&&u.s.indexOf(Ce)!==0)u.s=Uu;if(u.actions&&i(u.actions))u.b=u.actions.join(";"),delete u.actions;for(let e in u)if(u.hasOwnProperty(e)&&ye.indexOf(e)===-1)delete u[e];return u};Me.mapToNotifu=function(u){if(u=m(u),u=N(u),u.icon)u.i=u.icon,delete u.icon;if(u.message)u.m=u.message,delete u.message;if(u.title)u.p=u.title,delete u.title;if(u.time)u.d=u.time,delete u.time;if(u.q!==!1)u.q=!0;else delete u.q;if(u.quiet===!1)delete u.q,delete u.quiet;if(u.sound)delete u.q,delete u.sound;if(u.t)u.d=u.t,delete u.t;if(u.type)u.t=Oe(u.type),delete u.type;return u};Me.isMac=function(){return X.type()==="Darwin"};Me.isMountainLion=function(){return X.type()==="Darwin"&&a.satisfies(n(X.release()),">=12.0.0")};Me.isWin8=function(){return X.type()==="Windows_NT"&&a.satisfies(n(X.release()),">=6.2.9200")};Me.isWSL=function(){return ee};Me.isLessThanWin8=function(){return X.type()==="Windows_NT"&&a.satisfies(n(X.release()),"<6.2.9200")};function n(u){if(u.split(".").length===2)u+=".0";return u}function Oe(u){if(typeof u==="string"||u instanceof String){if(u.toLowerCase()==="info")return"info";if(u.toLowerCase()==="warn")return"warn";if(u.toLowerCase()==="error")return"error"}return"info"}Me.createNamedPipe=(u)=>{let e=Buffer.alloc(1024);return new Promise((h)=>{u.instance=re.createServer((r)=>{r.on("data",(f)=>{e.write(f.toString())}),r.on("end",()=>{u.instance.close()})}),u.instance.listen(u.namedPipe,()=>{h(e)})})}});var Hu=L((Bh,Zu)=>{var $u=_("os"),Te=We(),Q=K(),Ku=_("events").EventEmitter,ze=_("util"),v;Zu.exports=A;function A(u){if(u=Q.clone(u||{}),!(this instanceof A))return new A(u);this.options=u,Ku.call(this)}ze.inherits(A,Ku);function Be(){}function ce(u,e){if(u=Q.clone(u||{}),e=e||Be,typeof e!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof e);if(typeof u==="string")u={title:"node-notifier",message:u};if(!u.message)return e(Error("Message is required.")),this;if($u.type()!=="Linux"&&!$u.type().match(/BSD$/))return e(Error("Only supported on Linux and *BSD systems")),this;if(v===!1)return e(Error("notify-send must be installed on the system.")),this;if(v||!!this.options.suppressOsdCheck)return Xu(u,e),this;try{v=!!Te.sync("notify-send"),Xu(u,e)}catch(h){return v=!1,e(h)}return this}Object.defineProperty(A.prototype,"notify",{get:function(){if(!this._notify)this._notify=ce.bind(this);return this._notify}});var De=["urgency","expire-time","icon","category","hint","app-name"];function Xu(u,e){u=Q.mapToNotifySend(u),u.title=u.title||"Node Notification:";let h=[u.title,u.message];delete u.title,delete u.message;let r=Q.constructArgumentList(u,{initial:h,keyExtra:"-",allowedArguments:De});Q.command("notify-send",r,e)}});var t=L((ch,Ru)=>{var ge=_("net");Ru.exports=function(u,e){if(typeof e>"u")e=u,u={};let h=u.port||23053,r=u.host||"localhost",f=ge.connect(h,r);f.setTimeout(100),f.once("connect",function(){f.end(),e(null,!0)}),f.once("error",function(){f.end(),e(null,!1)})}});var Nu=L((Dh,Fu)=>{var me=_("net"),ve=_("crypto"),Vu=_("util").format,xe=_("fs"),J=`\r
|
|
3
|
-
`;function Z(u,e){e=e||{},this.type=u,this.host=e.host||"localhost",this.port=e.port||23053,this.request="GNTP/1.0 "+u+" NONE"+J,this.resources=[],this.attempts=0,this.maxAttempts=5}Z.prototype.parseResp=function(u){var e={},h,r;return u=u.slice(0,u.indexOf(J+J)).split(J),h=u[0],r=u.slice(1),e.state=h.match(/-(OK|ERROR|CALLBACK)/)[0].slice(1),r.forEach(function(f){f=f.split(": "),e[f[0]]=f[1]}),e};Z.prototype.retry=function(){var u=this,e=arguments;setTimeout(function(){u.send.apply(u,e)},750)};Z.prototype.addResource=function(u){var e=ve.createHash("md5").update(u).digest("hex"),h="Identifier: "+e+J+"Length: "+u.length+J+J;return this.resources.push({header:h,file:u}),"x-growl-resource://"+e};Z.prototype.add=function(u,e){if(e===void 0)return;if(/-Icon/.test(u)&&!/^https?:\/\//.test(e)){if(/\.(png|gif|jpe?g)$/.test(e))e=this.addResource(xe.readFileSync(e));else if(e instanceof Buffer)e=this.addResource(e)}this.request+=u+": "+e+J};Z.prototype.newline=function(){this.request+=J};Z.prototype.send=function(u){var e=this,h=me.connect(this.port,this.host),r="";u=u||function(){},this.attempts+=1,h.on("connect",function(){h.write(e.request),e.resources.forEach(function(f){h.write(f.header),h.write(f.file),h.write(J+J)})}),h.on("data",function(f){if(r+=f.toString(),r.slice(r.length-4)!==J+J)return;if(r=e.parseResp(r),r.state==="ERROR"||r.state==="CALLBACK")h.end();else r=""}),h.on("end",function(){if(["200","401","402"].indexOf(r["Error-Code"])>=0)if(e.attempts<=e.maxAttempts)e.retry(u);else{var f='GNTP request to "%s:%d" failed with error code %s (%s)';u(Error(Vu(f,e.host,e.port,r["Error-Code"],r["Error-Description"])))}else u(void 0,r)}),h.on("error",function(){u(Error(Vu('Error while sending GNTP request to "%s:%d"',e.host,e.port))),h.destroy()})};Fu.exports=Z});var Su=L((gh,Au)=>{var Qu=Nu();function S(){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}S.prototype.getLabels=function(){return this.notifications.map(function(u){return u.label})};S.prototype.setHost=function(u,e){this.host=u,this.port=e};S.prototype.register=function(u,e,h,r){var f;if(typeof e==="object")h=e,e=void 0;if(h===void 0||!h.length)h=[{label:"default",dispname:"Default Notification",enabled:!0}];if(typeof arguments[arguments.length-1]==="function")r=arguments[arguments.length-1];else r=function(){};this.appname=u,this.notifications=h,this.labels=this.getLabels(),this.registered=!0,f=new Qu("REGISTER",{host:this.host,port:this.port}),f.add("Application-Name",u),f.add("Application-Icon",e),f.add("Notifications-Count",h.length),f.newline(),h.forEach(function(q){if(q.enabled===void 0)q.enabled=!0;f.add("Notification-Name",q.label),f.add("Notification-Display-Name",q.dispname),f.add("Notification-Enabled",q.enabled?"True":"False"),f.add("Notification-Icon",q.icon),f.newline()}),f.send(r)};S.prototype.notify=function(u,e,h){var r=this,f;if(!this.registered){this.register(this.appname,function(q){if(q)console.log(q);r.notify.call(r,u,e,h)});return}if(e=e||{},typeof e==="function")h=e,e={};f=new Qu("NOTIFY",{host:this.host,port:this.port}),f.add("Application-Name",this.appname),f.add("Notification-Name",e.label||this.labels[0]),f.add("Notification-ID",++this.count),f.add("Notification-Title",e.title),f.add("Notification-Text",u),f.add("Notification-Sticky",e.sticky?"True":"False"),f.add("Notification-Priority",e.priority),f.add("Notification-Icon",e.icon),f.add("Notification-Coalescing-ID",e.coalescingId||void 0),f.add("Notification-Callback-Context",h?"context":void 0),f.add("Notification-Callback-Context-Type",h?"string":void 0),f.add("Notification-Callback-Target",void 0),f.newline(),f.send(function(q,w){if(h&&q)h(q);else if(h&&w.state==="CALLBACK")h(void 0,w["Notification-Callback-Result"].toLowerCase())})};Au.exports=new S});var P=L((mh,Wu)=>{var Pe=t(),x=K(),G=Su(),Iu=_("events").EventEmitter,de=_("util");Wu.exports=I;var Gu;function I(u){if(u=x.clone(u||{}),!(this instanceof I))return new I(u);G.appname=u.name||"Node",this.options=u,Iu.call(this)}de.inherits(I,Iu);function ke(u,e){if(G.setHost(this.options.host,this.options.port),u=x.clone(u||{}),typeof u==="string")u={title:"node-notifier",message:u};if(e=x.actionJackerDecorator(this,u,e,function(h){if(h==="click")return"click";if(h==="timedout")return"timeout";return!1}),u=x.mapToGrowl(u),!u.message)return e(Error("Message is required.")),this;if(u.title=u.title||"Node Notification:",Gu||!!u.wait){let h=u.wait?e:be;if(G.notify(u.message,u,h),!u.wait)e();return this}return Pe(G,function(h,r){if(Gu=r,!r)return e(Error("Couldn't connect to growl (might be used as a fallback). Make sure it is running"));G.notify(u.message,u),e()}),this}Object.defineProperty(I.prototype,"notify",{get:function(){if(!this._notify)this._notify=ke.bind(this);return this._notify}});function be(){}});var cu=L((vh,Bu)=>{var __dirname="/Users/konghayao/code/ai/code-graph/node_modules/.bun/node-notifier@10.0.1/node_modules/node-notifier/notifiers",H=K(),le=P(),ae=_("path"),ie=ae.join(__dirname,"../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier"),zu=_("events").EventEmitter,ne=_("util"),te="You need Mac OS X 10.8 or above to use NotificationCenter, or use Growl fallback with constructor option {withFallback: true}.";Bu.exports=W;function W(u){if(u=H.clone(u||{}),!(this instanceof W))return new W(u);this.options=u,zu.call(this)}ne.inherits(W,zu);var Tu=null;function se(){}function pe(u,e){let h,r=oe();if(u=H.clone(u||{}),Tu=r,typeof u==="string")u={title:"node-notifier",message:u};if(e=e||se,typeof e!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof fn);let f=H.actionJackerDecorator(this,u,e,function(w){if(Tu!==r)return!1;if(w==="activate")return"click";if(w==="timeout")return"timeout";if(w==="replied")return"replied";return!1});if(u=H.mapToMac(u),!u.message&&!u.group&&!u.list&&!u.remove)return e(Error("Message, group, remove or list property is required.")),this;let q=H.constructArgumentList(u);if(H.isMountainLion())return H.fileCommandJson(this.options.customPath||ie,q,f),this;if(h||!!this.options.withFallback)return h=h||new le(this.options),h.notify(u,e);return e(Error(te)),this}Object.defineProperty(W.prototype,"notify",{get:function(){if(!this._notify)this._notify=pe.bind(this);return this._notify}});function oe(){return{_ref:"val"}}});var s=L((xh,vu)=>{var __dirname="/Users/konghayao/code/ai/code-graph/node_modules/.bun/node-notifier@10.0.1/node_modules/node-notifier/notifiers",uh=_("path"),eh=uh.resolve(__dirname,"../vendor/notifu/notifu"),hh=t(),Y=K(),fh=p(),Du=P(),rh=_("os"),mu=_("events").EventEmitter,qh=_("util"),d;vu.exports=T;function T(u){if(u=Y.clone(u||{}),!(this instanceof T))return new T(u);this.options=u,mu.call(this)}qh.inherits(T,mu);function wh(){}function _h(u,e){let h,r=this.options;if(u=Y.clone(u||{}),e=e||wh,typeof u==="string")u={title:"node-notifier",message:u};let f=Y.actionJackerDecorator(this,u,e,function(q){if(q==="activate")return"click";if(q==="timeout")return"timeout";return!1});if(!!this.options.withFallback&&Y.isWin8())return h=h||new fh(r),h.notify(u,e);if(!!this.options.withFallback&&(!Y.isLessThanWin8()||d===!0))return h=h||new Du(r),h.notify(u,e);if(!this.options.withFallback||d===!1)return gu(u,r,f),this;return hh(r,function(q,w){if(d=w,d)return h=h||new Du(r),h.notify(u,e);gu(u,r,f)}),this}Object.defineProperty(T.prototype,"notify",{get:function(){if(!this._notify)this._notify=_h.bind(this);return this._notify}});var Eh=["t","d","p","m","i","e","q","w","xp"];function gu(u,e,h){let r=rh.arch()==="x64";u=u||{},u=Y.mapToNotifu(u),u.p=u.p||"Node Notification:";let f=eh+(r?"64":"")+".exe",q=e.customPath||f;if(!u.m)return h(Error("Message is required.")),this;let w=Y.constructArgumentList(u,{wrapper:"",noEscape:!0,explicitTrue:!0,allowedArguments:Eh});if(u.wait)return Y.fileCommand(q,w,function(E,M){let O=yh(E.code);if(O==="error")return h(E,M);return h(null,O)});Y.immediateFileCommand(q,w,h)}function yh(u){switch(u){case 2:return"timeout";case 3:case 6:case 7:return"activate";case 4:return"close";default:return"error"}}});var p=L((Ph,Pu)=>{var __dirname="/Users/konghayao/code/ai/code-graph/node_modules/.bun/node-notifier@10.0.1/node_modules/node-notifier/notifiers",Lh=_("path"),Jh=Lh.resolve(__dirname,"../vendor/snoreToast/snoretoast"),j=K(),Uh=s(),jh=_("os"),{v4:Yh}=(Mh(),Ch(Oh)),xu=_("events").EventEmitter,$h=_("util"),o;Pu.exports=z;function z(u){if(u=j.clone(u||{}),!(this instanceof z))return new z(u);this.options=u,xu.call(this)}$h.inherits(z,xu);function Xh(){}function Kh(u){if(!u)return{};return u.split(";").reduce((e,h)=>{let r=h.split("=");if(r&&r.length===2)e[r[0]]=r[1];return e},{})}function Zh(){return`${j.isWSL()?"/tmp/":"\\\\.\\pipe\\"}notifierPipe-${Yh()}`}function Hh(u,e){u=j.clone(u||{}),e=e||Xh;let h=jh.arch()==="x64",r,f={namedPipe:Zh()};if(typeof u==="string")u={title:"node-notifier",message:u};if(typeof e!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof fn);let q=(E,M)=>{let O=Kh(r&&r.toString("utf16le"));if(O.action==="buttonClicked"&&O.button)O.activationType=O.button;else if(O.action)O.activationType=O.action;if(E&&E.code===-1)M(E,O);M(null,O),f.instance&&f.instance.close()},w=(E)=>q(E,j.actionJackerDecorator(this,u,e,(M)=>M==="activate"?"click":M||!1));if(u.title=u.title||"Node Notification:",typeof u.message>"u"&&typeof u.close>"u")return e(Error("Message or ID to close is required.")),this;if(!j.isWin8()&&!j.isWSL()&&!!this.options.withFallback)return o=o||new Uh(this.options),o.notify(u,e);return j.createNamedPipe(f).then((E)=>{r=E,u.pipeName=f.namedPipe;let M=u.customPath||this.options.customPath||Jh+"-x"+(h?"64":"86")+".exe";u=j.mapToWin8(u);let O=j.constructArgumentList(u,{explicitTrue:!0,wrapper:"",keepNewlines:!0,noEscape:!0});j.fileCommand(M,O,w)}),this}Object.defineProperty(z.prototype,"notify",{get:function(){if(!this._notify)this._notify=Hh.bind(this);return this._notify}})});var bu=L((dh,C)=>{var du=_("os"),ku=K(),B=Hu(),uu=cu(),c=p(),eu=P(),hu=s(),R={withFallback:!0},Rh=ku.isWSL()?"WSL":du.type();switch(Rh){case"Linux":C.exports=new B(R),C.exports.Notification=B;break;case"Darwin":C.exports=new uu(R),C.exports.Notification=uu;break;case"Windows_NT":if(ku.isLessThanWin8())C.exports=new hu(R),C.exports.Notification=hu;else C.exports=new c(R),C.exports.Notification=c;break;case"WSL":C.exports=new c(R),C.exports.Notification=c;break;default:if(du.type().match(/BSD$/))C.exports=new B(R),C.exports.Notification=B;else C.exports=new eu(R),C.exports.Notification=eu}C.exports.NotifySend=B;C.exports.NotificationCenter=uu;C.exports.WindowsToaster=c;C.exports.WindowsBalloon=hu;C.exports.Growl=eu});import ru from"node:path";import lu from"node:os";import D from"node:fs";function au(u){let e=u.replace(/^~/,lu.homedir()),h=ru.resolve(e),r=ru.dirname(h);if(!D.existsSync(r))D.mkdirSync(r,{recursive:!0});return h}function iu(u,e){if(!D.existsSync(u)){process.env.DATABASE_INIT="true";return}let h=process.env.SQLITE_MAX_SIZE_MB?parseInt(process.env.SQLITE_MAX_SIZE_MB,10)*1024*1024:void 0,r=e??h??314572800,q=D.statSync(u).size,w=q/1048576;if(q>r){let E=r/1048576;console.trace(`⚠️ Database file is large: ${w.toFixed(2)}MB (limit: ${E.toFixed(2)}MB)`),console.trace(` Path: ${u}`),console.trace(" Set SQLITE_MAX_SIZE_MB to adjust limit")}}function Ah(u){let e=au(u);return process.env.SQLITE_DATABASE_URI=e,iu(e),e}var fu=Vh(bu(),1);function kh(u){if(typeof u==="string")fu.default.notify({title:"Notification",message:u});else fu.default.notify({title:u.title||"Notification",message:u.message,icon:u.icon,sound:u.sound??!0})}var lh={path:process.cwd()};export{Ah as ve,kh as we,lh as xe};
|
package/dist/chunk-k6fxqssr.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{vl as h}from"./chunk-vd8kwzra.js";import{Fl as yw,Hl as d,Kl as t}from"./chunk-z3e4c424.js";var G0=d((n1)=>{n1.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};n1.find=($,w)=>$.nodes.find((q)=>q.type===w);n1.exceedsLimit=($,w,q=1,J)=>{if(J===!1)return!1;if(!n1.isInteger($)||!n1.isInteger(w))return!1;return(Number(w)-Number($))/Number(q)>=J};n1.escapeNode=($,w=0,q)=>{let J=$.nodes[w];if(!J)return;if(q&&J.type===q||J.type==="open"||J.type==="close"){if(J.escaped!==!0)J.value="\\"+J.value,J.escaped=!0}};n1.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};n1.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};n1.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};n1.reduce=($)=>$.reduce((w,q)=>{if(q.type==="text")w.push(q.value);if(q.type==="range")q.type="text";return w},[]);n1.flatten=(...$)=>{let w=[],q=(J)=>{for(let f=0;f<J.length;f++){let Z=J[f];if(Array.isArray(Z)){q(Z);continue}if(Z!==void 0)w.push(Z)}return w};return q($),w}});var M0=d((jw,v0)=>{var d0=G0();v0.exports=($,w={})=>{let q=(J,f={})=>{let Z=w.escapeInvalid&&d0.isInvalidBrace(f),V=J.invalid===!0&&w.escapeInvalid===!0,F="";if(J.value){if((Z||V)&&d0.isOpenOrClose(J))return"\\"+J.value;return J.value}if(J.value)return J.value;if(J.nodes)for(let N of J.nodes)F+=q(N);return F};return q($)}});var l0=d((zw,m0)=>{/*!
|
|
2
|
-
* is-number <https://github.com/jonschlinkert/is-number>
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
5
|
-
* Released under the MIT License.
|
|
6
|
-
*/m0.exports=function($){if(typeof $==="number")return $-$===0;if(typeof $==="string"&&$.trim()!=="")return Number.isFinite?Number.isFinite(+$):isFinite(+$);return!1}});var e0=d((Iw,s0)=>{/*!
|
|
7
|
-
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
10
|
-
* Released under the MIT License.
|
|
11
|
-
*/var u0=l0(),q0=($,w,q)=>{if(u0($)===!1)throw TypeError("toRegexRange: expected the first argument to be a number");if(w===void 0||$===w)return String($);if(u0(w)===!1)throw TypeError("toRegexRange: expected the second argument to be a number.");let J={relaxZeros:!0,...q};if(typeof J.strictZeros==="boolean")J.relaxZeros=J.strictZeros===!1;let f=String(J.relaxZeros),Z=String(J.shorthand),V=String(J.capture),F=String(J.wrap),N=$+":"+w+"="+f+Z+V+F;if(q0.cache.hasOwnProperty(N))return q0.cache[N].result;let K=Math.min($,w),B=Math.max($,w);if(Math.abs(K-B)===1){let M=$+"|"+w;if(J.capture)return`(${M})`;if(J.wrap===!1)return M;return`(?:${M})`}let j=a0($)||a0(w),X={min:$,max:w,a:K,b:B},H=[],y=[];if(j)X.isPadded=j,X.maxLen=String(X.max).length;if(K<0){let M=B<0?Math.abs(B):1;y=c0(M,Math.abs(K),X,J),K=X.a=0}if(B>=0)H=c0(K,B,X,J);if(X.negatives=y,X.positives=H,X.result=q$(y,H,J),J.capture===!0)X.result=`(${X.result})`;else if(J.wrap!==!1&&H.length+y.length>1)X.result=`(?:${X.result})`;return q0.cache[N]=X,X.result};function q$($,w,q){let J=P0($,w,"-",!1,q)||[],f=P0(w,$,"",!1,q)||[],Z=P0($,w,"-?",!0,q)||[];return J.concat(Z).concat(f).join("|")}function J$($,w){let q=1,J=1,f=i0($,q),Z=new Set([w]);while($<=f&&f<=w)Z.add(f),q+=1,f=i0($,q);f=n0(w+1,J)-1;while($<f&&f<=w)Z.add(f),J+=1,f=n0(w+1,J)-1;return Z=[...Z],Z.sort(Z$),Z}function f$($,w,q){if($===w)return{pattern:$,count:[],digits:0};let J=V$($,w),f=J.length,Z="",V=0;for(let F=0;F<f;F++){let[N,K]=J[F];if(N===K)Z+=N;else if(N!=="0"||K!=="9")Z+=Y$(N,K,q);else V++}if(V)Z+=q.shorthand===!0?"\\d":"[0-9]";return{pattern:Z,count:[V],digits:f}}function c0($,w,q,J){let f=J$($,w),Z=[],V=$,F;for(let N=0;N<f.length;N++){let K=f[N],B=f$(String(V),String(K),J),j="";if(!q.isPadded&&F&&F.pattern===B.pattern){if(F.count.length>1)F.count.pop();F.count.push(B.count[0]),F.string=F.pattern+p0(F.count),V=K+1;continue}if(q.isPadded)j=W$(K,q,J);B.string=j+B.pattern+p0(B.count),Z.push(B),V=K+1,F=B}return Z}function P0($,w,q,J,f){let Z=[];for(let V of $){let{string:F}=V;if(!J&&!r0(w,"string",F))Z.push(q+F);if(J&&r0(w,"string",F))Z.push(q+F)}return Z}function V$($,w){let q=[];for(let J=0;J<$.length;J++)q.push([$[J],w[J]]);return q}function Z$($,w){return $>w?1:w>$?-1:0}function r0($,w,q){return $.some((J)=>J[w]===q)}function i0($,w){return Number(String($).slice(0,-w)+"9".repeat(w))}function n0($,w){return $-$%Math.pow(10,w)}function p0($){let[w=0,q=""]=$;if(q||w>1)return`{${w+(q?","+q:"")}}`;return""}function Y$($,w,q){return`[${$}${w-$===1?"":"-"}${w}]`}function a0($){return/^-?(0+)\d/.test($)}function W$($,w,q){if(!w.isPadded)return $;let J=Math.abs(w.maxLen-String($).length),f=q.relaxZeros!==!1;switch(J){case 0:return"";case 1:return f?"0?":"0";case 2:return f?"0{0,2}":"00";default:return f?`0{0,${J}}`:`0{${J}}`}}q0.cache={};q0.clearCache=()=>q0.cache={};s0.exports=q0});var E0=d((Cw,f1)=>{/*!
|
|
12
|
-
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
15
|
-
* Licensed under the MIT License.
|
|
16
|
-
*/var F$=t("util"),t0=e0(),o0=($)=>$!==null&&typeof $==="object"&&!Array.isArray($),U$=($)=>{return(w)=>$===!0?Number(w):String(w)},L0=($)=>{return typeof $==="number"||typeof $==="string"&&$!==""},Y0=($)=>Number.isInteger(+$),O0=($)=>{let w=`${$}`,q=-1;if(w[0]==="-")w=w.slice(1);if(w==="0")return!1;while(w[++q]==="0");return q>0},X$=($,w,q)=>{if(typeof $==="string"||typeof w==="string")return!0;return q.stringify===!0},Q$=($,w,q)=>{if(w>0){let J=$[0]==="-"?"-":"";if(J)$=$.slice(1);$=J+$.padStart(J?w-1:w,"0")}if(q===!1)return String($);return $},K0=($,w)=>{let q=$[0]==="-"?"-":"";if(q)$=$.slice(1),w--;while($.length<w)$="0"+$;return q?"-"+$:$},B$=($,w,q)=>{$.negatives.sort((F,N)=>F<N?-1:F>N?1:0),$.positives.sort((F,N)=>F<N?-1:F>N?1:0);let J=w.capture?"":"?:",f="",Z="",V;if($.positives.length)f=$.positives.map((F)=>K0(String(F),q)).join("|");if($.negatives.length)Z=`-(${J}${$.negatives.map((F)=>K0(String(F),q)).join("|")})`;if(f&&Z)V=`${f}|${Z}`;else V=f||Z;if(w.wrap)return`(${J}${V})`;return V},$1=($,w,q,J)=>{if(q)return t0($,w,{wrap:!1,...J});let f=String.fromCharCode($);if($===w)return f;let Z=String.fromCharCode(w);return`[${f}-${Z}]`},w1=($,w,q)=>{if(Array.isArray($)){let J=q.wrap===!0,f=q.capture?"":"?:";return J?`(${f}${$.join("|")})`:$.join("|")}return t0($,w,q)},q1=(...$)=>{return RangeError("Invalid range arguments: "+F$.inspect(...$))},J1=($,w,q)=>{if(q.strictRanges===!0)throw q1([$,w]);return[]},N$=($,w)=>{if(w.strictRanges===!0)throw TypeError(`Expected step "${$}" to be a number`);return[]},G$=($,w,q=1,J={})=>{let f=Number($),Z=Number(w);if(!Number.isInteger(f)||!Number.isInteger(Z)){if(J.strictRanges===!0)throw q1([$,w]);return[]}if(f===0)f=0;if(Z===0)Z=0;let V=f>Z,F=String($),N=String(w),K=String(q);q=Math.max(Math.abs(q),1);let B=O0(F)||O0(N)||O0(K),j=B?Math.max(F.length,N.length,K.length):0,X=B===!1&&X$($,w,J)===!1,H=J.transform||U$(X);if(J.toRegex&&q===1)return $1(K0($,j),K0(w,j),!0,J);let y={negatives:[],positives:[]},M=(u)=>y[u<0?"negatives":"positives"].push(Math.abs(u)),L=[],A=0;while(V?f>=Z:f<=Z){if(J.toRegex===!0&&q>1)M(f);else L.push(Q$(H(f,A),j,X));f=V?f-q:f+q,A++}if(J.toRegex===!0)return q>1?B$(y,J,j):w1(L,null,{wrap:!1,...J});return L},M$=($,w,q=1,J={})=>{if(!Y0($)&&$.length>1||!Y0(w)&&w.length>1)return J1($,w,J);let f=J.transform||((X)=>String.fromCharCode(X)),Z=`${$}`.charCodeAt(0),V=`${w}`.charCodeAt(0),F=Z>V,N=Math.min(Z,V),K=Math.max(Z,V);if(J.toRegex&&q===1)return $1(N,K,!1,J);let B=[],j=0;while(F?Z>=V:Z<=V)B.push(f(Z,j)),Z=F?Z-q:Z+q,j++;if(J.toRegex===!0)return w1(B,null,{wrap:!1,options:J});return B},y0=($,w,q,J={})=>{if(w==null&&L0($))return[$];if(!L0($)||!L0(w))return J1($,w,J);if(typeof q==="function")return y0($,w,1,{transform:q});if(o0(q))return y0($,w,0,q);let f={...J};if(f.capture===!0)f.wrap=!0;if(q=q||f.step||1,!Y0(q)){if(q!=null&&!o0(q))return N$(q,f);return y0($,w,1,q)}if(Y0($)&&Y0(w))return G$($,w,q,f);return M$($,w,Math.max(Math.abs(q),1),f)};f1.exports=y0});var Y1=d((Dw,Z1)=>{var y$=E0(),V1=G0(),K$=($,w={})=>{let q=(J,f={})=>{let Z=V1.isInvalidBrace(f),V=J.invalid===!0&&w.escapeInvalid===!0,F=Z===!0||V===!0,N=w.escapeInvalid===!0?"\\":"",K="";if(J.isOpen===!0)return N+J.value;if(J.isClose===!0)return console.log("node.isClose",N,J.value),N+J.value;if(J.type==="open")return F?N+J.value:"(";if(J.type==="close")return F?N+J.value:")";if(J.type==="comma")return J.prev.type==="comma"?"":F?J.value:"|";if(J.value)return J.value;if(J.nodes&&J.ranges>0){let B=V1.reduce(J.nodes),j=y$(...B,{...w,wrap:!1,toRegex:!0,strictZeros:!0});if(j.length!==0)return B.length>1&&j.length>1?`(${j})`:j}if(J.nodes)for(let B of J.nodes)K+=q(B,J);return K};return q($)};Z1.exports=K$});var U1=d((Hw,F1)=>{var j$=E0(),W1=M0(),V0=G0(),J0=($="",w="",q=!1)=>{let J=[];if($=[].concat($),w=[].concat(w),!w.length)return $;if(!$.length)return q?V0.flatten(w).map((f)=>`{${f}}`):w;for(let f of $)if(Array.isArray(f))for(let Z of f)J.push(J0(Z,w,q));else for(let Z of w){if(q===!0&&typeof Z==="string")Z=`{${Z}}`;J.push(Array.isArray(Z)?J0(f,Z,q):f+Z)}return V0.flatten(J)},z$=($,w={})=>{let q=w.rangeLimit===void 0?1000:w.rangeLimit,J=(f,Z={})=>{f.queue=[];let V=Z,F=Z.queue;while(V.type!=="brace"&&V.type!=="root"&&V.parent)V=V.parent,F=V.queue;if(f.invalid||f.dollar){F.push(J0(F.pop(),W1(f,w)));return}if(f.type==="brace"&&f.invalid!==!0&&f.nodes.length===2){F.push(J0(F.pop(),["{}"]));return}if(f.nodes&&f.ranges>0){let j=V0.reduce(f.nodes);if(V0.exceedsLimit(...j,w.step,q))throw RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let X=j$(...j,w);if(X.length===0)X=W1(f,w);F.push(J0(F.pop(),X)),f.nodes=[];return}let N=V0.encloseBrace(f),K=f.queue,B=f;while(B.type!=="brace"&&B.type!=="root"&&B.parent)B=B.parent,K=B.queue;for(let j=0;j<f.nodes.length;j++){let X=f.nodes[j];if(X.type==="comma"&&f.type==="brace"){if(j===1)K.push("");K.push("");continue}if(X.type==="close"){F.push(J0(F.pop(),K,N));continue}if(X.value&&X.type!=="open"){K.push(J0(K.pop(),X.value));continue}if(X.nodes)J(X,f)}return K};return V0.flatten(J($))};F1.exports=z$});var Q1=d((Pw,X1)=>{X1.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
17
|
-
`,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var y1=d((Lw,M1)=>{var I$=M0(),{MAX_LENGTH:B1,CHAR_BACKSLASH:R0,CHAR_BACKTICK:C$,CHAR_COMMA:D$,CHAR_DOT:H$,CHAR_LEFT_PARENTHESES:P$,CHAR_RIGHT_PARENTHESES:L$,CHAR_LEFT_CURLY_BRACE:O$,CHAR_RIGHT_CURLY_BRACE:E$,CHAR_LEFT_SQUARE_BRACKET:N1,CHAR_RIGHT_SQUARE_BRACKET:G1,CHAR_DOUBLE_QUOTE:R$,CHAR_SINGLE_QUOTE:_$,CHAR_NO_BREAK_SPACE:T$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A$}=Q1(),S$=($,w={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let q=w||{},J=typeof q.maxLength==="number"?Math.min(B1,q.maxLength):B1;if($.length>J)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${J})`);let f={type:"root",input:$,nodes:[]},Z=[f],V=f,F=f,N=0,K=$.length,B=0,j=0,X,H=()=>$[B++],y=(M)=>{if(M.type==="text"&&F.type==="dot")F.type="text";if(F&&F.type==="text"&&M.type==="text"){F.value+=M.value;return}return V.nodes.push(M),M.parent=V,M.prev=F,F=M,M};y({type:"bos"});while(B<K){if(V=Z[Z.length-1],X=H(),X===A$||X===T$)continue;if(X===R0){y({type:"text",value:(w.keepEscaping?X:"")+H()});continue}if(X===G1){y({type:"text",value:"\\"+X});continue}if(X===N1){N++;let M;while(B<K&&(M=H())){if(X+=M,M===N1){N++;continue}if(M===R0){X+=H();continue}if(M===G1){if(N--,N===0)break}}y({type:"text",value:X});continue}if(X===P$){V=y({type:"paren",nodes:[]}),Z.push(V),y({type:"text",value:X});continue}if(X===L$){if(V.type!=="paren"){y({type:"text",value:X});continue}V=Z.pop(),y({type:"text",value:X}),V=Z[Z.length-1];continue}if(X===R$||X===_$||X===C$){let M=X,L;if(w.keepQuotes!==!0)X="";while(B<K&&(L=H())){if(L===R0){X+=L+H();continue}if(L===M){if(w.keepQuotes===!0)X+=L;break}X+=L}y({type:"text",value:X});continue}if(X===O$){j++;let L={type:"brace",open:!0,close:!1,dollar:F.value&&F.value.slice(-1)==="$"||V.dollar===!0,depth:j,commas:0,ranges:0,nodes:[]};V=y(L),Z.push(V),y({type:"open",value:X});continue}if(X===E$){if(V.type!=="brace"){y({type:"text",value:X});continue}let M="close";V=Z.pop(),V.close=!0,y({type:M,value:X}),j--,V=Z[Z.length-1];continue}if(X===D$&&j>0){if(V.ranges>0){V.ranges=0;let M=V.nodes.shift();V.nodes=[M,{type:"text",value:I$(V)}]}y({type:"comma",value:X}),V.commas++;continue}if(X===H$&&j>0&&V.commas===0){let M=V.nodes;if(j===0||M.length===0){y({type:"text",value:X});continue}if(F.type==="dot"){if(V.range=[],F.value+=X,F.type="range",V.nodes.length!==3&&V.nodes.length!==5){V.invalid=!0,V.ranges=0,F.type="text";continue}V.ranges++,V.args=[];continue}if(F.type==="range"){M.pop();let L=M[M.length-1];L.value+=F.value+X,F=L,V.ranges--;continue}y({type:"dot",value:X});continue}y({type:"text",value:X})}do if(V=Z.pop(),V.type!=="root"){V.nodes.forEach((A)=>{if(!A.nodes){if(A.type==="open")A.isOpen=!0;if(A.type==="close")A.isClose=!0;if(!A.nodes)A.type="text";A.invalid=!0}});let M=Z[Z.length-1],L=M.nodes.indexOf(V);M.nodes.splice(L,1,...V.nodes)}while(Z.length>0);return y({type:"eos"}),f};M1.exports=S$});var z1=d((Ow,j1)=>{var K1=M0(),x$=Y1(),g$=U1(),h$=y1(),r=($,w={})=>{let q=[];if(Array.isArray($))for(let J of $){let f=r.create(J,w);if(Array.isArray(f))q.push(...f);else q.push(f)}else q=[].concat(r.create($,w));if(w&&w.expand===!0&&w.nodupes===!0)q=[...new Set(q)];return q};r.parse=($,w={})=>h$($,w);r.stringify=($,w={})=>{if(typeof $==="string")return K1(r.parse($,w),w);return K1($,w)};r.compile=($,w={})=>{if(typeof $==="string")$=r.parse($,w);return x$($,w)};r.expand=($,w={})=>{if(typeof $==="string")$=r.parse($,w);let q=g$($,w);if(w.noempty===!0)q=q.filter(Boolean);if(w.nodupes===!0)q=[...new Set(q)];return q};r.create=($,w={})=>{if($===""||$.length<3)return[$];return w.expand!==!0?r.compile($,w):r.expand($,w)};j1.exports=r});var W0=d((Ew,C1)=>{var k$=t("path"),I1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},b$={...I1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},d$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};C1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:d$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:k$.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?b$:I1}}});var F0=d((i$)=>{var v$=t("path"),m$=process.platform==="win32",{REGEX_BACKSLASH:l$,REGEX_REMOVE_BACKSLASH:u$,REGEX_SPECIAL_CHARS:c$,REGEX_SPECIAL_CHARS_GLOBAL:r$}=W0();i$.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);i$.hasRegexChars=($)=>c$.test($);i$.isRegexChar=($)=>$.length===1&&i$.hasRegexChars($);i$.escapeRegex=($)=>$.replace(r$,"\\$1");i$.toPosixSlashes=($)=>$.replace(l$,"/");i$.removeBackslashes=($)=>{return $.replace(u$,(w)=>{return w==="\\"?"":w})};i$.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};i$.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return m$===!0||v$.sep==="\\"};i$.escapeLast=($,w,q)=>{let J=$.lastIndexOf(w,q);if(J===-1)return $;if($[J-1]==="\\")return i$.escapeLast($,w,J-1);return`${$.slice(0,J)}\\${$.slice(J)}`};i$.removePrefix=($,w={})=>{let q=$;if(q.startsWith("./"))q=q.slice(2),w.prefix="./";return q};i$.wrapOutput=($,w={},q={})=>{let J=q.contains?"":"^",f=q.contains?"":"$",Z=`${J}(?:${$})${f}`;if(w.negated===!0)Z=`(?:^(?!${Z}).*$)`;return Z}});var A1=d((_w,T1)=>{var P1=F0(),{CHAR_ASTERISK:_0,CHAR_AT:qw,CHAR_BACKWARD_SLASH:U0,CHAR_COMMA:Jw,CHAR_DOT:T0,CHAR_EXCLAMATION_MARK:A0,CHAR_FORWARD_SLASH:_1,CHAR_LEFT_CURLY_BRACE:S0,CHAR_LEFT_PARENTHESES:x0,CHAR_LEFT_SQUARE_BRACKET:fw,CHAR_PLUS:Vw,CHAR_QUESTION_MARK:L1,CHAR_RIGHT_CURLY_BRACE:Zw,CHAR_RIGHT_PARENTHESES:O1,CHAR_RIGHT_SQUARE_BRACKET:Yw}=W0(),E1=($)=>{return $===_1||$===U0},R1=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},Ww=($,w)=>{let q=w||{},J=$.length-1,f=q.parts===!0||q.scanToEnd===!0,Z=[],V=[],F=[],N=$,K=-1,B=0,j=0,X=!1,H=!1,y=!1,M=!1,L=!1,A=!1,u=!1,S=!1,n=!1,b=!1,e=0,v,z,P={value:"",depth:0,isGlob:!1},k=()=>K>=J,U=()=>N.charCodeAt(K+1),_=()=>{return v=z,N.charCodeAt(++K)};while(K<J){z=_();let m;if(z===U0){if(u=P.backslashes=!0,z=_(),z===S0)A=!0;continue}if(A===!0||z===S0){e++;while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,_();continue}if(z===S0){e++;continue}if(A!==!0&&z===T0&&(z=_())===T0){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(A!==!0&&z===Jw){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===Zw){if(e--,e===0){A=!1,X=P.isBrace=!0,b=!0;break}}}if(f===!0)continue;break}if(z===_1){if(Z.push(K),V.push(P),P={value:"",depth:0,isGlob:!1},b===!0)continue;if(v===T0&&K===B+1){B+=2;continue}j=K+1;continue}if(q.noext!==!0){if((z===Vw||z===qw||z===_0||z===L1||z===A0)===!0&&U()===x0){if(y=P.isGlob=!0,M=P.isExtglob=!0,b=!0,z===A0&&K===B)n=!0;if(f===!0){while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,z=_();continue}if(z===O1){y=P.isGlob=!0,b=!0;break}}continue}break}}if(z===_0){if(v===_0)L=P.isGlobstar=!0;if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===L1){if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===fw){while(k()!==!0&&(m=_())){if(m===U0){u=P.backslashes=!0,_();continue}if(m===Yw){H=P.isBracket=!0,y=P.isGlob=!0,b=!0;break}}if(f===!0)continue;break}if(q.nonegate!==!0&&z===A0&&K===B){S=P.negated=!0,B++;continue}if(q.noparen!==!0&&z===x0){if(y=P.isGlob=!0,f===!0){while(k()!==!0&&(z=_())){if(z===x0){u=P.backslashes=!0,z=_();continue}if(z===O1){b=!0;break}}continue}break}if(y===!0){if(b=!0,f===!0)continue;break}}if(q.noext===!0)M=!1,y=!1;let O=N,o="",Y="";if(B>0)o=N.slice(0,B),N=N.slice(B),j-=B;if(O&&y===!0&&j>0)O=N.slice(0,j),Y=N.slice(j);else if(y===!0)O="",Y=N;else O=N;if(O&&O!==""&&O!=="/"&&O!==N){if(E1(O.charCodeAt(O.length-1)))O=O.slice(0,-1)}if(q.unescape===!0){if(Y)Y=P1.removeBackslashes(Y);if(O&&u===!0)O=P1.removeBackslashes(O)}let W={prefix:o,input:$,start:B,base:O,glob:Y,isBrace:X,isBracket:H,isGlob:y,isExtglob:M,isGlobstar:L,negated:S,negatedExtglob:n};if(q.tokens===!0){if(W.maxDepth=0,!E1(z))V.push(P);W.tokens=V}if(q.parts===!0||q.tokens===!0){let m;for(let D=0;D<Z.length;D++){let p=m?m+1:B,a=Z[D],c=$.slice(p,a);if(q.tokens){if(D===0&&B!==0)V[D].isPrefix=!0,V[D].value=o;else V[D].value=c;R1(V[D]),W.maxDepth+=V[D].depth}if(D!==0||c!=="")F.push(c);m=a}if(m&&m+1<$.length){let D=$.slice(m+1);if(F.push(D),q.tokens)V[V.length-1].value=D,R1(V[V.length-1]),W.maxDepth+=V[V.length-1].depth}W.slashes=Z,W.parts=F}return W};T1.exports=Ww});var g1=d((Tw,x1)=>{var j0=W0(),i=F0(),{MAX_LENGTH:z0,POSIX_REGEX_SOURCE:Fw,REGEX_NON_SPECIAL_CHARS:Uw,REGEX_SPECIAL_CHARS_BACKREF:Xw,REPLACEMENTS:S1}=j0,Qw=($,w)=>{if(typeof w.expandRange==="function")return w.expandRange(...$,w);$.sort();let q=`[${$.join("-")}]`;try{new RegExp(q)}catch(J){return $.map((f)=>i.escapeRegex(f)).join("..")}return q},Z0=($,w)=>{return`Missing ${$}: "${w}" - use "\\\\${w}" to match literal characters`},g0=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=S1[$]||$;let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);let Z={type:"bos",value:"",output:q.prepend||""},V=[Z],F=q.capture?"":"?:",N=i.isWindows(w),K=j0.globChars(N),B=j0.extglobChars(K),{DOT_LITERAL:j,PLUS_LITERAL:X,SLASH_LITERAL:H,ONE_CHAR:y,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:A,NO_DOTS_SLASH:u,QMARK:S,QMARK_NO_DOT:n,STAR:b,START_ANCHOR:e}=K,v=(G)=>{return`(${F}(?:(?!${e}${G.dot?M:j}).)*?)`},z=q.dot?"":L,P=q.dot?S:n,k=q.bash===!0?v(q):b;if(q.capture)k=`(${k})`;if(typeof q.noext==="boolean")q.noextglob=q.noext;let U={input:$,index:-1,start:0,dot:q.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};$=i.removePrefix($,U),f=$.length;let _=[],O=[],o=[],Y=Z,W,m=()=>U.index===f-1,D=U.peek=(G=1)=>$[U.index+G],p=U.advance=()=>$[++U.index]||"",a=()=>$.slice(U.index+1),c=(G="",E=0)=>{U.consumed+=G,U.index+=E},X0=(G)=>{U.output+=G.output!=null?G.output:G.value,c(G.value)},r1=()=>{let G=1;while(D()==="!"&&(D(2)!=="("||D(3)==="?"))p(),U.start++,G++;if(G%2===0)return!1;return U.negated=!0,U.start++,!0},Q0=(G)=>{U[G]++,o.push(G)},w0=(G)=>{U[G]--,o.pop()},C=(G)=>{if(Y.type==="globstar"){let E=U.braces>0&&(G.type==="comma"||G.type==="brace"),Q=G.extglob===!0||_.length&&(G.type==="pipe"||G.type==="paren");if(G.type!=="slash"&&G.type!=="paren"&&!E&&!Q)U.output=U.output.slice(0,-Y.output.length),Y.type="star",Y.value="*",Y.output=k,U.output+=Y.output}if(_.length&&G.type!=="paren")_[_.length-1].inner+=G.value;if(G.value||G.output)X0(G);if(Y&&Y.type==="text"&&G.type==="text"){Y.value+=G.value,Y.output=(Y.output||"")+G.value;return}G.prev=Y,V.push(G),Y=G},B0=(G,E)=>{let Q={...B[E],conditions:1,inner:""};Q.prev=Y,Q.parens=U.parens,Q.output=U.output;let I=(q.capture?"(":"")+Q.open;Q0("parens"),C({type:G,value:E,output:U.output?"":y}),C({type:"paren",extglob:!0,value:p(),output:I}),_.push(Q)},i1=(G)=>{let E=G.close+(q.capture?")":""),Q;if(G.type==="negate"){let I=k;if(G.inner&&G.inner.length>1&&G.inner.includes("/"))I=v(q);if(I!==k||m()||/^\)+$/.test(a()))E=G.close=`)$))${I}`;if(G.inner.includes("*")&&(Q=a())&&/^\.[^\\/.]+$/.test(Q)){let T=g0(Q,{...w,fastpaths:!1}).output;E=G.close=`)${T})${I})`}if(G.prev.type==="bos")U.negatedExtglob=!0}C({type:"paren",extglob:!0,value:W,output:E}),w0("parens")};if(q.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let G=!1,E=$.replace(Xw,(Q,I,T,l,g,D0)=>{if(l==="\\")return G=!0,Q;if(l==="?"){if(I)return I+l+(g?S.repeat(g.length):"");if(D0===0)return P+(g?S.repeat(g.length):"");return S.repeat(T.length)}if(l===".")return j.repeat(T.length);if(l==="*"){if(I)return I+l+(g?k:"");return k}return I?Q:`\\${Q}`});if(G===!0)if(q.unescape===!0)E=E.replace(/\\/g,"");else E=E.replace(/\\+/g,(Q)=>{return Q.length%2===0?"\\\\":Q?"\\":""});if(E===$&&q.contains===!0)return U.output=$,U;return U.output=i.wrapOutput(E,U,w),U}while(!m()){if(W=p(),W==="\x00")continue;if(W==="\\"){let Q=D();if(Q==="/"&&q.bash!==!0)continue;if(Q==="."||Q===";")continue;if(!Q){W+="\\",C({type:"text",value:W});continue}let I=/^\\+/.exec(a()),T=0;if(I&&I[0].length>2){if(T=I[0].length,U.index+=T,T%2!==0)W+="\\"}if(q.unescape===!0)W=p();else W+=p();if(U.brackets===0){C({type:"text",value:W});continue}}if(U.brackets>0&&(W!=="]"||Y.value==="["||Y.value==="[^")){if(q.posix!==!1&&W===":"){let Q=Y.value.slice(1);if(Q.includes("[")){if(Y.posix=!0,Q.includes(":")){let I=Y.value.lastIndexOf("["),T=Y.value.slice(0,I),l=Y.value.slice(I+2),g=Fw[l];if(g){if(Y.value=T+g,U.backtrack=!0,p(),!Z.output&&V.indexOf(Y)===1)Z.output=y;continue}}}}if(W==="["&&D()!==":"||W==="-"&&D()==="]")W=`\\${W}`;if(W==="]"&&(Y.value==="["||Y.value==="[^"))W=`\\${W}`;if(q.posix===!0&&W==="!"&&Y.value==="[")W="^";Y.value+=W,X0({value:W});continue}if(U.quotes===1&&W!=='"'){W=i.escapeRegex(W),Y.value+=W,X0({value:W});continue}if(W==='"'){if(U.quotes=U.quotes===1?0:1,q.keepQuotes===!0)C({type:"text",value:W});continue}if(W==="("){Q0("parens"),C({type:"paren",value:W});continue}if(W===")"){if(U.parens===0&&q.strictBrackets===!0)throw SyntaxError(Z0("opening","("));let Q=_[_.length-1];if(Q&&U.parens===Q.parens+1){i1(_.pop());continue}C({type:"paren",value:W,output:U.parens?")":"\\)"}),w0("parens");continue}if(W==="["){if(q.nobracket===!0||!a().includes("]")){if(q.nobracket!==!0&&q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));W=`\\${W}`}else Q0("brackets");C({type:"bracket",value:W});continue}if(W==="]"){if(q.nobracket===!0||Y&&Y.type==="bracket"&&Y.value.length===1){C({type:"text",value:W,output:`\\${W}`});continue}if(U.brackets===0){if(q.strictBrackets===!0)throw SyntaxError(Z0("opening","["));C({type:"text",value:W,output:`\\${W}`});continue}w0("brackets");let Q=Y.value.slice(1);if(Y.posix!==!0&&Q[0]==="^"&&!Q.includes("/"))W=`/${W}`;if(Y.value+=W,X0({value:W}),q.literalBrackets===!1||i.hasRegexChars(Q))continue;let I=i.escapeRegex(Y.value);if(U.output=U.output.slice(0,-Y.value.length),q.literalBrackets===!0){U.output+=I,Y.value=I;continue}Y.value=`(${F}${I}|${Y.value})`,U.output+=Y.value;continue}if(W==="{"&&q.nobrace!==!0){Q0("braces");let Q={type:"brace",value:W,output:"(",outputIndex:U.output.length,tokensIndex:U.tokens.length};O.push(Q),C(Q);continue}if(W==="}"){let Q=O[O.length-1];if(q.nobrace===!0||!Q){C({type:"text",value:W,output:W});continue}let I=")";if(Q.dots===!0){let T=V.slice(),l=[];for(let g=T.length-1;g>=0;g--){if(V.pop(),T[g].type==="brace")break;if(T[g].type!=="dots")l.unshift(T[g].value)}I=Qw(l,q),U.backtrack=!0}if(Q.comma!==!0&&Q.dots!==!0){let T=U.output.slice(0,Q.outputIndex),l=U.tokens.slice(Q.tokensIndex);Q.value=Q.output="\\{",W=I="\\}",U.output=T;for(let g of l)U.output+=g.output||g.value}C({type:"brace",value:W,output:I}),w0("braces"),O.pop();continue}if(W==="|"){if(_.length>0)_[_.length-1].conditions++;C({type:"text",value:W});continue}if(W===","){let Q=W,I=O[O.length-1];if(I&&o[o.length-1]==="braces")I.comma=!0,Q="|";C({type:"comma",value:W,output:Q});continue}if(W==="/"){if(Y.type==="dot"&&U.index===U.start+1){U.start=U.index+1,U.consumed="",U.output="",V.pop(),Y=Z;continue}C({type:"slash",value:W,output:H});continue}if(W==="."){if(U.braces>0&&Y.type==="dot"){if(Y.value===".")Y.output=j;let Q=O[O.length-1];Y.type="dots",Y.output+=W,Y.value+=W,Q.dots=!0;continue}if(U.braces+U.parens===0&&Y.type!=="bos"&&Y.type!=="slash"){C({type:"text",value:W,output:j});continue}C({type:"dot",value:W,output:j});continue}if(W==="?"){if(!(Y&&Y.value==="(")&&q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("qmark",W);continue}if(Y&&Y.type==="paren"){let I=D(),T=W;if(I==="<"&&!i.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(Y.value==="("&&!/[!=<:]/.test(I)||I==="<"&&!/<([!=]|\w+>)/.test(a()))T=`\\${W}`;C({type:"text",value:W,output:T});continue}if(q.dot!==!0&&(Y.type==="slash"||Y.type==="bos")){C({type:"qmark",value:W,output:n});continue}C({type:"qmark",value:W,output:S});continue}if(W==="!"){if(q.noextglob!==!0&&D()==="("){if(D(2)!=="?"||!/[!=<:]/.test(D(3))){B0("negate",W);continue}}if(q.nonegate!==!0&&U.index===0){r1();continue}}if(W==="+"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("plus",W);continue}if(Y&&Y.value==="("||q.regex===!1){C({type:"plus",value:W,output:X});continue}if(Y&&(Y.type==="bracket"||Y.type==="paren"||Y.type==="brace")||U.parens>0){C({type:"plus",value:W});continue}C({type:"plus",value:X});continue}if(W==="@"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){C({type:"at",extglob:!0,value:W,output:""});continue}C({type:"text",value:W});continue}if(W!=="*"){if(W==="$"||W==="^")W=`\\${W}`;let Q=Uw.exec(a());if(Q)W+=Q[0],U.index+=Q[0].length;C({type:"text",value:W});continue}if(Y&&(Y.type==="globstar"||Y.star===!0)){Y.type="star",Y.star=!0,Y.value+=W,Y.output=k,U.backtrack=!0,U.globstar=!0,c(W);continue}let G=a();if(q.noextglob!==!0&&/^\([^?]/.test(G)){B0("star",W);continue}if(Y.type==="star"){if(q.noglobstar===!0){c(W);continue}let Q=Y.prev,I=Q.prev,T=Q.type==="slash"||Q.type==="bos",l=I&&(I.type==="star"||I.type==="globstar");if(q.bash===!0&&(!T||G[0]&&G[0]!=="/")){C({type:"star",value:W,output:""});continue}let g=U.braces>0&&(Q.type==="comma"||Q.type==="brace"),D0=_.length&&(Q.type==="pipe"||Q.type==="paren");if(!T&&Q.type!=="paren"&&!g&&!D0){C({type:"star",value:W,output:""});continue}while(G.slice(0,3)==="/**"){let N0=$[U.index+4];if(N0&&N0!=="/")break;G=G.slice(3),c("/**",3)}if(Q.type==="bos"&&m()){Y.type="globstar",Y.value+=W,Y.output=v(q),U.output=Y.output,U.globstar=!0,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&!l&&m()){U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=v(q)+(q.strictSlashes?")":"|$)"),Y.value+=W,U.globstar=!0,U.output+=Q.output+Y.output,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&G[0]==="/"){let N0=G[1]!==void 0?"|$":"";U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=`${v(q)}${H}|${H}${N0})`,Y.value+=W,U.output+=Q.output+Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}if(Q.type==="bos"&&G[0]==="/"){Y.type="globstar",Y.value+=W,Y.output=`(?:^|${H}|${v(q)}${H})`,U.output=Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}U.output=U.output.slice(0,-Y.output.length),Y.type="globstar",Y.output=v(q),Y.value+=W,U.output+=Y.output,U.globstar=!0,c(W);continue}let E={type:"star",value:W,output:k};if(q.bash===!0){if(E.output=".*?",Y.type==="bos"||Y.type==="slash")E.output=z+E.output;C(E);continue}if(Y&&(Y.type==="bracket"||Y.type==="paren")&&q.regex===!0){E.output=W,C(E);continue}if(U.index===U.start||Y.type==="slash"||Y.type==="dot"){if(Y.type==="dot")U.output+=A,Y.output+=A;else if(q.dot===!0)U.output+=u,Y.output+=u;else U.output+=z,Y.output+=z;if(D()!=="*")U.output+=y,Y.output+=y}C(E)}while(U.brackets>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));U.output=i.escapeLast(U.output,"["),w0("brackets")}while(U.parens>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing",")"));U.output=i.escapeLast(U.output,"("),w0("parens")}while(U.braces>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","}"));U.output=i.escapeLast(U.output,"{"),w0("braces")}if(q.strictSlashes!==!0&&(Y.type==="star"||Y.type==="bracket"))C({type:"maybe_slash",value:"",output:`${H}?`});if(U.backtrack===!0){U.output="";for(let G of U.tokens)if(U.output+=G.output!=null?G.output:G.value,G.suffix)U.output+=G.suffix}return U};g0.fastpaths=($,w)=>{let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);$=S1[$]||$;let Z=i.isWindows(w),{DOT_LITERAL:V,SLASH_LITERAL:F,ONE_CHAR:N,DOTS_SLASH:K,NO_DOT:B,NO_DOTS:j,NO_DOTS_SLASH:X,STAR:H,START_ANCHOR:y}=j0.globChars(Z),M=q.dot?j:B,L=q.dot?X:B,A=q.capture?"":"?:",u={negated:!1,prefix:""},S=q.bash===!0?".*?":H;if(q.capture)S=`(${S})`;let n=(z)=>{if(z.noglobstar===!0)return S;return`(${A}(?:(?!${y}${z.dot?K:V}).)*?)`},b=(z)=>{switch(z){case"*":return`${M}${N}${S}`;case".*":return`${V}${N}${S}`;case"*.*":return`${M}${S}${V}${N}${S}`;case"*/*":return`${M}${S}${F}${N}${L}${S}`;case"**":return M+n(q);case"**/*":return`(?:${M}${n(q)}${F})?${L}${N}${S}`;case"**/*.*":return`(?:${M}${n(q)}${F})?${L}${S}${V}${N}${S}`;case"**/.*":return`(?:${M}${n(q)}${F})?${V}${N}${S}`;default:{let P=/^(.*?)\.(\w+)$/.exec(z);if(!P)return;let k=b(P[1]);if(!k)return;return k+V+P[2]}}},e=i.removePrefix($,u),v=b(e);if(v&&q.strictSlashes!==!0)v+=`${F}?`;return v};x1.exports=g0});var k1=d((Aw,h1)=>{var Bw=t("path"),Nw=A1(),h0=g1(),k0=F0(),Gw=W0(),Mw=($)=>$&&typeof $==="object"&&!Array.isArray($),x=($,w,q=!1)=>{if(Array.isArray($)){let B=$.map((X)=>x(X,w,q));return(X)=>{for(let H of B){let y=H(X);if(y)return y}return!1}}let J=Mw($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!J)throw TypeError("Expected pattern to be a non-empty string");let f=w||{},Z=k0.isWindows(w),V=J?x.compileRe($,w):x.makeRe($,w,!1,!0),F=V.state;delete V.state;let N=()=>!1;if(f.ignore){let B={...w,ignore:null,onMatch:null,onResult:null};N=x(f.ignore,B,q)}let K=(B,j=!1)=>{let{isMatch:X,match:H,output:y}=x.test(B,V,w,{glob:$,posix:Z}),M={glob:$,state:F,regex:V,posix:Z,input:B,output:y,match:H,isMatch:X};if(typeof f.onResult==="function")f.onResult(M);if(X===!1)return M.isMatch=!1,j?M:!1;if(N(B)){if(typeof f.onIgnore==="function")f.onIgnore(M);return M.isMatch=!1,j?M:!1}if(typeof f.onMatch==="function")f.onMatch(M);return j?M:!0};if(q)K.state=F;return K};x.test=($,w,q,{glob:J,posix:f}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let Z=q||{},V=Z.format||(f?k0.toPosixSlashes:null),F=$===J,N=F&&V?V($):$;if(F===!1)N=V?V($):$,F=N===J;if(F===!1||Z.capture===!0)if(Z.matchBase===!0||Z.basename===!0)F=x.matchBase($,w,q,f);else F=w.exec(N);return{isMatch:Boolean(F),match:F,output:N}};x.matchBase=($,w,q,J=k0.isWindows(q))=>{return(w instanceof RegExp?w:x.makeRe(w,q)).test(Bw.basename($))};x.isMatch=($,w,q)=>x(w,q)($);x.parse=($,w)=>{if(Array.isArray($))return $.map((q)=>x.parse(q,w));return h0($,{...w,fastpaths:!1})};x.scan=($,w)=>Nw($,w);x.compileRe=($,w,q=!1,J=!1)=>{if(q===!0)return $.output;let f=w||{},Z=f.contains?"":"^",V=f.contains?"":"$",F=`${Z}(?:${$.output})${V}`;if($&&$.negated===!0)F=`^(?!${F}).*$`;let N=x.toRegex(F,w);if(J===!0)N.state=$;return N};x.makeRe=($,w={},q=!1,J=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};if(w.fastpaths!==!1&&($[0]==="."||$[0]==="*"))f.output=h0.fastpaths($,w);if(!f.output)f=h0($,w);return x.compileRe(f,w,q,J)};x.toRegex=($,w)=>{try{let q=w||{};return new RegExp($,q.flags||(q.nocase?"i":""))}catch(q){if(w&&w.debug===!0)throw q;return/$^/}};x.constants=Gw;h1.exports=x});var u1=d((Sw,l1)=>{var d1=t("util"),v1=z1(),s=k1(),b0=F0(),b1=($)=>$===""||$==="./",m1=($)=>{let w=$.indexOf("{");return w>-1&&$.indexOf("}",w)>-1},R=($,w,q)=>{w=[].concat(w),$=[].concat($);let J=new Set,f=new Set,Z=new Set,V=0,F=(B)=>{if(Z.add(B.output),q&&q.onResult)q.onResult(B)};for(let B=0;B<w.length;B++){let j=s(String(w[B]),{...q,onResult:F},!0),X=j.state.negated||j.state.negatedExtglob;if(X)V++;for(let H of $){let y=j(H,!0);if(!(X?!y.isMatch:y.isMatch))continue;if(X)J.add(y.output);else J.delete(y.output),f.add(y.output)}}let K=(V===w.length?[...Z]:[...f]).filter((B)=>!J.has(B));if(q&&K.length===0){if(q.failglob===!0)throw Error(`No matches found for "${w.join(", ")}"`);if(q.nonull===!0||q.nullglob===!0)return q.unescape?w.map((B)=>B.replace(/\\/g,"")):w}return K};R.match=R;R.matcher=($,w)=>s($,w);R.isMatch=($,w,q)=>s(w,q)($);R.any=R.isMatch;R.not=($,w,q={})=>{w=[].concat(w).map(String);let J=new Set,f=[],V=new Set(R($,w,{...q,onResult:(F)=>{if(q.onResult)q.onResult(F);f.push(F.output)}}));for(let F of f)if(!V.has(F))J.add(F);return[...J]};R.contains=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);if(Array.isArray(w))return w.some((J)=>R.contains($,J,q));if(typeof w==="string"){if(b1($)||b1(w))return!1;if($.includes(w)||$.startsWith("./")&&$.slice(2).includes(w))return!0}return R.isMatch($,w,{...q,contains:!0})};R.matchKeys=($,w,q)=>{if(!b0.isObject($))throw TypeError("Expected the first argument to be an object");let J=R(Object.keys($),w,q),f={};for(let Z of J)f[Z]=$[Z];return f};R.some=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(J.some((V)=>Z(V)))return!0}return!1};R.every=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(!J.every((V)=>Z(V)))return!1}return!0};R.all=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);return[].concat(w).every((J)=>s(J,q)($))};R.capture=($,w,q)=>{let J=b0.isWindows(q),Z=s.makeRe(String($),{...q,capture:!0}).exec(J?b0.toPosixSlashes(w):w);if(Z)return Z.slice(1).map((V)=>V===void 0?"":V)};R.makeRe=(...$)=>s.makeRe(...$);R.scan=(...$)=>s.scan(...$);R.parse=($,w)=>{let q=[];for(let J of[].concat($||[]))for(let f of v1(String(J),w))q.push(s.parse(f,w));return q};R.braces=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(w&&w.nobrace===!0||!m1($))return[$];return v1($,w)};R.braceExpand=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");return R.braces($,{...w,expand:!0})};R.hasBraces=m1;l1.exports=R});var c1=yw(u1(),1);var I0;((J)=>{J.ALLOW="allow";J.ASK="ask";J.DENY="deny"})(I0||={});var gw=h.object({tool:h.string(),specifier:h.string().optional(),action:h.nativeEnum(I0)}),hw=h.object({allow:h.array(h.string()).optional(),ask:h.array(h.string()).optional(),deny:h.array(h.string()).optional(),defaultMode:h.nativeEnum(I0).optional()}),kw=h.object({name:h.string(),args:h.record(h.string(),h.any())});class f0{rules;defaultMode;patternCache=new Map;constructor($){this.rules=$.rules,this.defaultMode=$.defaultMode||"ask",this.rules.sort((w,q)=>{let J={deny:0,ask:1,allow:2},f=J[w.action]-J[q.action];if(f!==0)return f;let Z=w.specifier==null?1:0,V=q.specifier==null?1:0;return Z-V})}checkPermission($){for(let w of this.rules)if(this.matchRule(w,$))return{allowed:w.action==="allow"||w.action==="ask",requiresApproval:w.action==="ask",matchedRule:w,reason:this.getReason(w)};return{allowed:this.defaultMode==="allow"||this.defaultMode==="ask",requiresApproval:this.defaultMode==="ask",reason:`No matching rule, using default mode: ${this.defaultMode}`}}matchRule($,w){if($.tool!==w.name)return!1;if(!$.specifier)return!0;let q=this.argsToString(w.args);if(w.name==="Bash")return this.matchBashCommand($.specifier,q);if($.specifier.endsWith(" ")&&!/[*?[\\]/.test($.specifier))return q.startsWith($.specifier);return this.matchGlob($.specifier,q)}matchBashCommand($,w){if(/[;&|]/.test(w))return!1;let J=/[<>()]/;if(J.test(w)){let f=w.split(J)[0].trim();return this.matchBashPattern($,f)}return this.matchBashPattern($,w)}matchBashPattern($,w){if($.endsWith(" "))return w.startsWith($);return this.matchGlob($,w)}matchGlob($,w){try{let q=$.replace(/^\.\//,""),J=w.replace(/^\.\//,""),f=`${$}::${w}`,Z=this.patternCache.get(f);if(Z!==void 0)return Z;let V=c1.default.isMatch(J,q,{nocase:!1,dot:!0});return this.cacheResult(f,V),V}catch(q){return w===$}}cacheResult($,w){if(this.patternCache.size>1000){let q=this.patternCache.keys().next().value;if(q)this.patternCache.delete(q)}this.patternCache.set($,w)}argsToString($){if(typeof $==="object"&&$!==null){if("command"in $&&$.command)return String($.command);if("file_path"in $&&$.file_path)return String($.file_path);return Object.values($).flat().join(" ")}return String($)}getReason($){let w=$.action.toUpperCase(),q=$.tool,J=$.specifier?`(${$.specifier})`:"";return`${w} rule matched: ${q}${J}`}static parseRule($,w){let q=$.match(/^(\w+)(?:\((.*)\))?$/);if(!q)throw Error(`Invalid permission rule format: ${$}`);let[,J,f]=q;return{tool:J,specifier:f,action:w}}static fromConfig($){let w=[];for(let q of $.allow||[])w.push(f0.parseRule(q,"allow"));for(let q of $.ask||[])w.push(f0.parseRule(q,"ask"));for(let q of $.deny||[])w.push(f0.parseRule(q,"deny"));return new f0({rules:w,defaultMode:$.defaultMode||"ask"})}clearCache(){this.patternCache.clear()}getCacheSize(){return this.patternCache.size}}class $0{configStore;toolNameMapper={};constructor($){this.configStore=$}static instance=null;static getInstance($){if(!$0.instance){if(!$)throw Error("PermissionStore not initialized. Provide configStore on first call.");$0.instance=new $0($)}return $0.instance}static resetInstance(){$0.instance=null}async getPermissions(){let $=await this.configStore.getConfig();if($.permissions)return f0.fromConfig($.permissions);return}async checkBashPermission($,w){return(await this.getPermissions())?.checkPermission({name:"Bash",args:{command:$,cwd:w}})}async checkReadPermission($){return(await this.getPermissions())?.checkPermission({name:"Read",args:{file_path:$}})}async checkWritePermission($){return(await this.getPermissions())?.checkPermission({name:"Write",args:{file_path:$}})}}class C0{configStore;skillStore;pluginStore;remoteStore;permissionStore;_initialized=!1;constructor($,w,q,J){this.configStore=$,this.skillStore=w,this.pluginStore=q,this.remoteStore=J,this.permissionStore=$0.getInstance($)}async initialize(){if(this._initialized)return;if("initialize"in this.configStore&&typeof this.configStore.initialize==="function")await this.configStore.initialize();if("initialize"in this.skillStore&&typeof this.skillStore.initialize==="function")await this.skillStore.initialize();if("initialize"in this.pluginStore&&typeof this.pluginStore.initialize==="function")await this.pluginStore.initialize();this._initialized=!0}async ensureInitialized(){if(!this._initialized)throw Error("ConfigManager not initialized. Call await manager.initialize() first.")}async getConfig(){return await this.ensureInitialized(),await this.configStore.getConfig()}async updateConfig($){return await this.ensureInitialized(),await this.configStore.updateConfig($)}async listSkills(){return await this.ensureInitialized(),await this.skillStore.listSkills()}async getSkill($){return await this.ensureInitialized(),await this.skillStore.getSkill($)}async saveSkill($,w){return await this.ensureInitialized(),await this.skillStore.saveSkill($,w)}async deleteSkill($){return await this.ensureInitialized(),await this.skillStore.deleteSkill($)}async syncSkillsFromRemote(){if(await this.ensureInitialized(),!this.remoteStore)throw Error("Remote store not configured");return await this.skillStore.syncFromRemote(this.remoteStore)}async listPlugins(){return await this.ensureInitialized(),await this.pluginStore.listPlugins()}async getPluginConfig($){return await this.ensureInitialized(),await this.pluginStore.getPluginConfig($)}async updatePluginConfig($,w){return await this.ensureInitialized(),await this.pluginStore.updatePluginConfig($,w)}async installPlugin($,w){return await this.ensureInitialized(),await this.pluginStore.installPlugin($,w)}async uninstallPlugin($){return await this.ensureInitialized(),await this.pluginStore.uninstallPlugin($)}async checkBashPermission($,w){return await this.ensureInitialized(),await this.permissionStore.checkBashPermission($,w)}async checkReadPermission($){return await this.ensureInitialized(),await this.permissionStore.checkReadPermission($)}async checkWritePermission($){return await this.ensureInitialized(),await this.permissionStore.checkWritePermission($)}async getPermissionMatcher(){return await this.ensureInitialized(),await this.permissionStore.getPermissions()}getConfigPath(){return this.configStore?.dbPath}}async function ow(){let{FileSystemConfigStore:$}=await import("./chunk-b9emn03n.js"),{FileSystemSkillStore:w}=await import("./chunk-gkvx829z.js"),{FileSystemPluginStore:q}=await import("./chunk-h0qb9jk1.js"),J=new $,f=new w,Z=new q,V=new C0(J,f,Z);return await V.initialize(),V}async function tw($){let{configStore:w,skillStore:q,pluginStore:J,remoteStore:f}=$,Z=new C0(w,q,J,f);return await Z.initialize(),Z}
|
|
18
|
-
export{ow as kf,tw as lf};
|
package/dist/chunk-kmxdq21k.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ye as JJ}from"./chunk-1v863afn.js";import{Fl as g,Hl as y}from"./chunk-z3e4c424.js";var C=y((XJ,E)=>{var f="Expected a function",w=NaN,V="[object Symbol]",S=/^\s+|\s+$/g,v=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt,r=typeof global=="object"&&global&&global.Object===Object&&global,u=typeof self=="object"&&self&&self.Object===Object&&self,o=r||u||Function("return this")(),s=Object.prototype,n=s.toString,l=Math.max,i=Math.min,N=function(){return o.Date.now()};function a(J,Z,$){var Y,j,G,B,Q,P,q=0,F=!1,U=!1,W=!0;if(typeof J!="function")throw TypeError(f);if(Z=I(Z)||0,L($))F=!!$.leading,U="maxWait"in $,G=U?l(I($.maxWait)||0,Z):G,W="trailing"in $?!!$.trailing:W;function _(K){var H=Y,A=j;return Y=j=void 0,q=K,B=J.apply(A,H),B}function h(K){return q=K,Q=setTimeout(D,Z),F?_(K):B}function b(K){var H=K-P,A=K-q,R=Z-H;return U?i(R,G-A):R}function T(K){var H=K-P,A=K-q;return P===void 0||H>=Z||H<0||U&&A>=G}function D(){var K=N();if(T(K))return z(K);Q=setTimeout(D,b(K))}function z(K){if(Q=void 0,W&&Y)return _(K);return Y=j=void 0,B}function m(){if(Q!==void 0)clearTimeout(Q);q=0,Y=P=j=Q=void 0}function k(){return Q===void 0?B:z(N())}function O(){var K=N(),H=T(K);if(Y=arguments,j=this,P=K,H){if(Q===void 0)return h(P);if(U)return Q=setTimeout(D,Z),_(P)}if(Q===void 0)Q=setTimeout(D,Z);return B}return O.cancel=m,O.flush=k,O}function L(J){var Z=typeof J;return!!J&&(Z=="object"||Z=="function")}function t(J){return!!J&&typeof J=="object"}function e(J){return typeof J=="symbol"||t(J)&&n.call(J)==V}function I(J){if(typeof J=="number")return J;if(e(J))return w;if(L(J)){var Z=typeof J.valueOf=="function"?J.valueOf():J;J=L(Z)?Z+"":Z}if(typeof J!="string")return J===0?J:+J;J=J.replace(S,"");var $=p.test(J);return $||d.test(J)?c(J.slice(2),$?2:8):v.test(J)?w:+J}E.exports=a});var X=g(JJ(),1),M=g(C(),1);function YJ(J=!1){if(typeof J!=="boolean")throw Error("defaultValue must be `true` or `false`");let[Z,$]=X.useState(J),Y=X.useCallback(()=>{$(!0)},[]),j=X.useCallback(()=>{$(!1)},[]),G=X.useCallback(()=>{$((B)=>!B)},[]);return{value:Z,setValue:$,setTrue:Y,setFalse:j,toggle:G}}var x=typeof window<"u"?X.useLayoutEffect:X.useEffect;function KJ(J,Z){let $=X.useRef(J);x(()=>{$.current=J},[J]),X.useEffect(()=>{if(Z===null)return;let Y=setInterval(()=>{$.current()},Z);return()=>{clearInterval(Y)}},[Z])}function QJ(J){let Z=X.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return x(()=>{Z.current=J},[J]),X.useCallback((...$)=>{var Y;return(Y=Z.current)==null?void 0:Y.call(Z,...$)},[Z])}function ZJ(J){let Z=X.useRef(J);Z.current=J,X.useEffect(()=>()=>{Z.current()},[])}function $J(J,Z=500,$){let Y=X.useRef();ZJ(()=>{if(Y.current)Y.current.cancel()});let j=X.useMemo(()=>{let G=M.default(J,Z,$),B=(...Q)=>{return G(...Q)};return B.cancel=()=>{G.cancel()},B.isPending=()=>{return!!Y.current},B.flush=()=>{return G.flush()},B},[J,Z,$]);return X.useEffect(()=>{Y.current=M.default(J,Z,$)},[J,Z,$]),j}function jJ(J,Z,$){let Y=($==null?void 0:$.equalityFn)??((q,F)=>q===F),j=J instanceof Function?J():J,[G,B]=X.useState(j),Q=X.useRef(j),P=$J(B,Z,$);if(!Y(Q.current,j))P(j),Q.current=j;return[G,P]}function BJ(){let J=X.useRef(!1);return X.useEffect(()=>{return J.current=!0,()=>{J.current=!1}},[]),X.useCallback(()=>J.current,[])}function GJ(J,Z){let $=X.useRef(J);x(()=>{$.current=J},[J]),X.useEffect(()=>{if(!Z&&Z!==0)return;let Y=setTimeout(()=>{$.current()},Z);return()=>{clearTimeout(Y)}},[Z])}
|
|
2
|
-
export{YJ as L,KJ as M,QJ as N,ZJ as O,jJ as P,BJ as Q,GJ as R};
|