Lines 1-21javascript
1'use strict';var aa=require('baileys'),we=require('node:fs/promises'),url=require('node:url'),os$1=require('node:os'),We=require('node:path'),child_process=require('node:child_process'),jimp=require('jimp'),Qs=require('node-webpmux'),crypto=require('node:crypto'),fs=require('node:fs');require('node:stream');var io=require('qrcode-terminal'),co=require('pino'),events=require('node:events');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var aa__default=/*#__PURE__*/_interopDefault(aa);var we__default=/*#__PURE__*/_interopDefault(we);var We__default=/*#__PURE__*/_interopDefault( ...
2`;)i++;s(n.slice(a,i),5);continue}if(o==='"'||o==="'"||o==="`"){let a=i,c=o;for(i++;i<n.length;)if(n[i]==="\\"&&i+1<n.length)i+=2;else if(n[i]===c){i++;break}else i++;s(n.slice(a,i),3);continue}if(/[0-9]/.test(o)){let a=i;for(;i<n.length&&/[0-9.]/.test(n[i]);)i++;s(n.slice(a,i),4);continue}if(/[a-zA-Z_$]/.test(o)){let a=i;for(;i<n.length&&/[a-zA-Z0-9_$]/.test(n[i]);)i++;let c=n.slice(a,i),d=0;if(t.has(c))d=1;else {let l=i;for(;l<n.length&&/\s/.test(n[l]);)l++;n[l]==="("&&(d=2);}s(c,d);continue}s(o,0),i++;}return r},D=(n,e)=>({view_model:{[Array.isArray(e)?"primitives":"primitive"]:e,__typename ...
HighChild Process
Package source references child process execution.
dist/index.cjsView on unpkg · L1 HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/index.cjsView on unpkg · L1 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/index.cjsView on unpkg · L1 MediumDynamic Require
Package source references dynamic require/import behavior.
3`)}:null;if(n==="image")return t.length>0?{type:"image",url:t.length===1?t[0]:t}:null;if(n==="video"){if(t.length===0)return null;let r=t.map(o=>at(o)[0]??"").filter(o=>o.length>0);if(r.length===0)return null;let s=te(at(t[0])[1]),i={type:"video",url:r.length===1?r[0]:r};return s!==void 0&&(i.duration=s),i}if(n==="product"){let r=t.map(gi).filter(s=>s!==null);return r.length>0?{type:"product",products:r.length===1?r[0]:r}:null}if(n==="reels"){let r=t.map(fi);return r.length>0?{type:"reels",reels:r}:null}if(n==="post"){let r=t.map(hi);return r.length>0?{type:"post",posts:r}:null}return null},Jn ...
5`),t=[],r=[],s=()=>{let o=r.join(`
6`).trim();o.length>0&&t.push({type:"text",text:o}),r=[];},i=0;for(;i<e.length;){let o=e[i],a=ui.exec(o);if(a){s();let u=[];for(i++;i<e.length&&!pi.test(e[i]);)u.push(e[i]),i++;i++;let w=yi
7`)}:{type:"code",content:u.join(`
8`)});continue}let d=e[i+1];if(o.includes("|")&&d!==void 0&&d.includes("|")&&mi.test(d)){s();let u=[qn(o)];for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim().
10`:""}${n.body}`};return n.footer!==void 0&&(t.footer=n.footer),it(n.buttons,t)};var ct=n=>{if(typeof n!="string"||n.trim().length===0)throw new g("EMPTY_CONTENT","text() requires a non-empty string");return {text:n}};var or=(n
11`||n==="\r",ki=n=>{let e=[],t="",r=null,s=false,i=false,o=true;for(let a=0;a<n.length;a+=1){let c=n[a];if(s){t+=c,s=false,i=true
12${re} ${Vi}`:t}case "disconnect":return n.willReconnect?null:`${re} Disconnected (${n.reason}).`;default:return null}}var mr=false,Hi=["Closing session:","Closing open session","Closing stale open session","Opening session:","Removing old closed session","Migrating session to:","Session already closed","Decrypted message with closed session","Failed to decrypt message with any known session","Session error:"],zi=n=>typeof n[0]=="string"&&Hi.some(e=>n[0].startsWith(e));function fr(){if(mr)return;mr=true;let n=e=>{let t=console[e].bind(console);console[e]=(...r)=>{zi(r)||t(...r);};};n("info"),n( ...
13`);}var me={enabled:true,maxAttempts:Number.POSITIVE_INFINITY,initialDelayMs:3e3,maxDelayMs:6e4,jitterFactor:.2,rateLimitedDelayMs:3e5};function Pr(n,e){let t=n?.enabled??me.enabled,r=n?.maxAttempts??me.maxAttempts,s=n?.initialDelayMs??me.initialDelayMs,i=n?.maxDelayMs??me.maxDelayMs,o=n?.jitterFactor??me.jitterFactor,a=n?.rateLimitedDelayMs??
14`).trim();return i.length>0?i:null},Wo=n=>{let e=h(n.templateMessage),t=h(e?.hydratedTemplate)??h(e?.hydratedFourRowTemplate);return M(t?.hydratedContentText)},jo=n=>z(h(n.pollCreationMessage)?.name,h(n.pollCreationMessageV2)?.name,h(n.pollCreationMessageV3)?.name),Uo=n=>{let e=h(n.locationMessage)??h(n.liveLocationMessage);if(e==null)return null;let t=z(e.name,e.address);if(t!=null){let i=M(e.name),o=M(e.address);return i!=null&&o!=null&&i!==o?`${i} \u2014 ${o}`:t}let r=e.degreesLatitude,s=e.degreesLongitude;return typeof r=="number"&&typeof s=="number"?`${r}, ${s}`:null},qo=n=>{let e=M(h(n.c ...
15`)}return ""},ta=n=>Array.isArray(n)?n.map(e=>Buffer.from(e).toString("hex")):[],hs=(n,e)=>{let t=n?.reaction,r=t?.key;if(!r)return null;let s
16`);}resolveMe(){let e=this._socket?.user;if(e&&typeof e.id=="string"&&e.id.length>0)return e;let t=this.creds?.me;return t&&typeof t.id=="string"&&t.id.length>0?t:{id:""}}get state(){return this.machine.state}get socket(){return this._socket}get group(){return this._group??=new Ce(()=>this._socket,this.operationGuard)}get privacy(){return this._privacy??=new Ee(()=>this._socket)}get newsletter(){return this._newsletter??=new be(()=>this._socket,this.operationGuard)}get community(){return this._community??=new ke(()=>this._socket,this.operationGuard)}get profile(){return this._profile??=new Te( ...
17 CREATE TABLE IF NOT EXISTS auth_signal (type TEXT NOT NULL, id TEXT NOT NULL, data BLOB NOT NULL, PRIMARY KEY(type, id)) WITHOUT ROWID;`);}catch(r){throw t.close(),new f("STORE_CONNECTION_FAILED","failed to migrate sqlite schema",{cause:r})}this.db=t,this.prepared={readCreds:t.prepare("SELECT data FROM auth_creds WHERE id = ?"),writeCreds:t.prepare("INSERT INTO auth_creds(id, data) VALUES(?, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data"),deleteCreds:t.prepare("DELETE FROM auth_creds WHERE id = ?"),writeSignal:t.prepare("INSERT INTO auth_signal(type, id, data) VALUES(?, ?, ?) ...
19 SELECT rowid, ROW_NUMBER() OVER (PARTITION BY remote_jid ORDER BY timestamp DESC) AS rn
Long lines were clipped for display.