@simosphere/tokenizer-speedup 0.9.0 → 0.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.
Files changed (49) hide show
  1. package/dist/cli/analyze.js +1 -1
  2. package/dist/cli/config-cmd.js +1 -1
  3. package/dist/cli/index.js +1 -1
  4. package/dist/cli/init-cmd.js +1 -1
  5. package/dist/cli/setup-cmd.js +1 -1
  6. package/dist/cloud/stripe-checkout.js +1 -1
  7. package/dist/cloud/stripe-config.js +1 -1
  8. package/dist/cloud/stripe-usage.js +1 -1
  9. package/dist/cloud/stripe-webhooks.js +1 -1
  10. package/dist/cloud/subscription-store.js +1 -1
  11. package/dist/manifest.json +49 -45
  12. package/dist/mcp/index.js +1 -1
  13. package/dist/mcp/resources.js +1 -1
  14. package/dist/mcp/session.js +1 -1
  15. package/dist/mcp/tools.js +1 -1
  16. package/dist/plugin/cli.js +1 -1
  17. package/dist/plugin/compression/anonymize.js +1 -0
  18. package/dist/plugin/compression/cache.js +1 -0
  19. package/dist/plugin/compression/chunked.js +1 -1
  20. package/dist/plugin/compression/dedup.js +1 -0
  21. package/dist/plugin/compression/format-optimizer.js +1 -0
  22. package/dist/plugin/compression/index.js +1 -1
  23. package/dist/plugin/compression/pipeline.js +1 -1
  24. package/dist/plugin/compression/quality.js +1 -1
  25. package/dist/plugin/compression/rule-based.js +1 -1
  26. package/dist/plugin/compression/structural.js +1 -1
  27. package/dist/plugin/compression/text-utils.js +1 -1
  28. package/dist/plugin/compression/token-budget.js +1 -1
  29. package/dist/plugin/config-loader.js +1 -1
  30. package/dist/plugin/context-compressor.js +1 -1
  31. package/dist/plugin/hook-dispatcher.js +1 -1
  32. package/dist/plugin/metering-client.js +1 -1
  33. package/dist/plugin/metrics-collector.js +1 -1
  34. package/dist/plugin/onboarding.js +1 -1
  35. package/dist/plugin/precompact-handler.js +1 -1
  36. package/dist/plugin/report.js +1 -1
  37. package/dist/plugin/rule-analytics-store.js +1 -1
  38. package/dist/plugin/rule-analytics.js +1 -1
  39. package/dist/plugin/rule-engine.js +1 -1
  40. package/dist/plugin/rule-sharing.js +1 -1
  41. package/dist/plugin/rule-suggest.js +1 -1
  42. package/dist/plugin/session-start.js +1 -1
  43. package/dist/plugin/smart-context.js +1 -1
  44. package/dist/shared/license.js +1 -1
  45. package/dist/shared/providers/claude-provider.js +1 -1
  46. package/dist/shared/providers/openai-provider.js +1 -1
  47. package/dist/shared/token-counter.js +1 -1
  48. package/dist/shared/token-provider.js +1 -1
  49. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ function _0x5f12(_0x44f92c,_0x4e3a00){_0x44f92c=_0x44f92c-0x1e2;const _0x4c1f3=_0x4c1f();let _0x5f1253=_0x4c1f3[_0x44f92c];return _0x5f1253;}const _0x3c87e1=_0x5f12;(function(_0x372a8f,_0x2d2aef){const _0x10976f=_0x5f12,_0x2dc375=_0x372a8f();while(!![]){try{const _0x661e69=-parseInt(_0x10976f(0x1ef))/0x1*(-parseInt(_0x10976f(0x1ff))/0x2)+-parseInt(_0x10976f(0x1e3))/0x3+-parseInt(_0x10976f(0x1ee))/0x4*(parseInt(_0x10976f(0x1fc))/0x5)+parseInt(_0x10976f(0x1fd))/0x6*(parseInt(_0x10976f(0x1f4))/0x7)+parseInt(_0x10976f(0x1f1))/0x8*(parseInt(_0x10976f(0x1f5))/0x9)+-parseInt(_0x10976f(0x1fb))/0xa+parseInt(_0x10976f(0x1fe))/0xb*(-parseInt(_0x10976f(0x1e4))/0xc);if(_0x661e69===_0x2d2aef)break;else _0x2dc375['push'](_0x2dc375['shift']());}catch(_0x244c38){_0x2dc375['push'](_0x2dc375['shift']());}}}(_0x4c1f,0xdb34e));import{countTokens}from'../../shared/token-counter.js';function _0x4c1f(){const _0x31c1fd=['pii-anonymize','sort','10974866aRXwps','8307FhDIyY','set','Anonymstr.\x201,\x2000000\x20Anon-','0.0.0.','customerId','add','1167430viyTBa','2113620pSsIjG','6kSaAXJ','121GzsBdu','64AZQcEy','match','jjXiW','join','fVseP','split','4893072RRcuZq','1603164ULrZWS','+49-ANON-','01.01.1970-','iban','pii-anonymize\x20(','slice','length','XMLaA','address','regex','4bVlxIZ','49492EeeUXf','phone','12016KECyVU'];_0x4c1f=function(){return _0x31c1fd;};return _0x4c1f();}function simpleHash(_0x2e7892){const _0x4f2315=_0x5f12,_0x455795={'vvVIw':function(_0xd86d0c,_0x2778f8){return _0xd86d0c+_0x2778f8;},'uKwmJ':function(_0x2ee96b,_0x39163f){return _0x2ee96b-_0x39163f;}};let _0x11dedd=0x0;for(let _0x3aef43=0x0;_0x3aef43<_0x2e7892[_0x4f2315(0x1ea)];_0x3aef43++)_0x11dedd=_0x455795['vvVIw'](_0x455795['uKwmJ'](_0x11dedd<<0x5,_0x11dedd),_0x2e7892['charCodeAt'](_0x3aef43))|0x0;return Math['abs'](_0x11dedd)['toString'](0x10)[_0x4f2315(0x1e9)](0x0,0x4)['toUpperCase']()['padStart'](0x4,'0');}const PII_PATTERNS=[{'type':'email','regex':/[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/g,'buildPseudonym':_0x3d2290=>'user_'+_0x3d2290+'@example.redacted'},{'type':_0x3c87e1(0x1e7),'regex':/\bDE\d{2}\s?\d{4}\s?\d{4}\s?\d{4}\s?\d{4}\s?\d{2}\b/g,'buildPseudonym':_0x1c3e67=>'DE00-ANON-'+_0x1c3e67},{'type':_0x3c87e1(0x1f0),'regex':/(?:\+\d{1,3}[\s\-]?)?(?:\(?\d{2,5}\)?[\s\-]?)?\d{3,}[\s\-]?\d{2,}/g,'buildPseudonym':_0x59ff75=>_0x3c87e1(0x1e5)+_0x59ff75},{'type':_0x3c87e1(0x1f9),'regex':/\b(?:KD|KDN|ORD)-[A-Z0-9\-]{4,12}\b/g,'buildPseudonym':_0x2ab46d=>'KD-ANON-'+_0x2ab46d},{'type':'dateOfBirth','regex':/\b(?:\d{2}\.\d{2}\.\d{4}|\d{4}-\d{2}-\d{2})\b/g,'buildPseudonym':_0x5b9fd9=>_0x3c87e1(0x1e6)+_0x5b9fd9},{'type':'ipv4','regex':/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,'buildPseudonym':_0x4235d7=>_0x3c87e1(0x1f8)+_0x4235d7},{'type':_0x3c87e1(0x1ec),'regex':/[A-ZÄÖÜ][a-zäöüß]+(?:str\.|straße|stra(?:ss|ß)e|weg|gasse|platz|allee|ring|damm)\s+\d{1,4}\s*[a-z]?\s*,\s*\d{5}\s+[A-ZÄÖÜ][a-zäöüß\-]+/g,'buildPseudonym':_0xba9b04=>_0x3c87e1(0x1f7)+_0xba9b04}];export function anonymizeText(_0x6f9afb){const _0x16f36a=_0x3c87e1,_0x1da833={'XMLaA':function(_0x199915,_0x584b5e){return _0x199915(_0x584b5e);}},_0x361366=new Map(),_0x1961d9=new Set(),_0x297a9b=new Map();let _0x4bd8b7=_0x6f9afb;for(const _0x2dcfd of PII_PATTERNS){const _0x2ece19=new RegExp(_0x2dcfd[_0x16f36a(0x1ed)]['source'],_0x2dcfd['regex']['flags']),_0x54cbcd=_0x4bd8b7[_0x16f36a(0x200)](_0x2ece19);if(!_0x54cbcd)continue;const _0x2f5484=[...new Set(_0x54cbcd)][_0x16f36a(0x1f3)]((_0x1d7820,_0x295e2a)=>_0x295e2a[_0x16f36a(0x1ea)]-_0x1d7820['length']);for(const _0x5e4d0d of _0x2f5484){if(_0x297a9b['has'](_0x5e4d0d))continue;const _0x3d67e8=_0x1da833[_0x16f36a(0x1eb)](simpleHash,_0x5e4d0d),_0x3bc411=_0x2dcfd['buildPseudonym'](_0x3d67e8);_0x297a9b[_0x16f36a(0x1f6)](_0x5e4d0d,_0x3bc411),_0x361366[_0x16f36a(0x1f6)](_0x3bc411,_0x5e4d0d),_0x1961d9[_0x16f36a(0x1fa)](_0x2dcfd['type']),_0x4bd8b7=_0x4bd8b7[_0x16f36a(0x1e2)](_0x5e4d0d)[_0x16f36a(0x202)](_0x3bc411);}}return{'text':_0x4bd8b7,'map':{'replacements':_0x361366,'piiTypesFound':[..._0x1961d9]}};}export function deanonymizeText(_0x384f84,_0x15b43b){const _0x39c915=_0x3c87e1;let _0xa52861=_0x384f84;const _0x2816fc=[..._0x15b43b['replacements']['entries']()]['sort'](([_0x500bbc],[_0x563ee6])=>_0x563ee6[_0x39c915(0x1ea)]-_0x500bbc['length']);for(const [_0x163dfa,_0x12a877]of _0x2816fc)_0xa52861=_0xa52861['split'](_0x163dfa)['join'](_0x12a877);return _0xa52861;}export const anonymizeStrategy={'name':_0x3c87e1(0x1f2),'compress'(_0x58fc8b,_0x4b5e7e){const _0x50055d=_0x3c87e1,_0x3e560e={'fVseP':function(_0x1b45ae,_0x83edae){return _0x1b45ae(_0x83edae);},'QDrdU':function(_0x2859b5,_0x459851){return _0x2859b5(_0x459851);},'jjXiW':function(_0x32d173,_0x12bbb3){return _0x32d173-_0x12bbb3;},'BRbLO':function(_0x4319ff,_0x493ca9){return _0x4319ff/_0x493ca9;}},_0x1525e5=_0x3e560e[_0x50055d(0x203)](countTokens,_0x58fc8b),{text:_0x320326,map:_0x243450}=_0x3e560e['QDrdU'](anonymizeText,_0x58fc8b),_0x4b72e3=countTokens(_0x320326);return{'text':_0x320326,'originalTokens':_0x1525e5,'compressedTokens':_0x4b72e3,'compressionRatio':_0x1525e5>0x0?_0x3e560e[_0x50055d(0x201)](0x1,_0x3e560e['BRbLO'](_0x4b72e3,_0x1525e5)):0x0,'strategyUsed':_0x50055d(0x1e8)+_0x243450['piiTypesFound'][_0x50055d(0x202)](',\x20')+')','qualityEstimate':0x1,'wasTruncated':!0x1};}};
@@ -0,0 +1 @@
1
+ function _0x3d00(){const _0x3d4da7=['996JaIpKH','entries','stats','22vkHmcz','ttlMs','keys','get','Hkwvf','jjBrH','size','5521929dMzKKz','OWSwj','now','181959wSecJE','toString','74076QLgtSO','8IJIHgA','678572FovnMr','76wUfjzs','9415gsizJo','value','wmEEj','5426930UJeMQJ','missCount','toLowerCase','AxDlF','clear','has','thDNS','iksRf','expiresAt','compress','abs','set','NgQTM','result','safrE','delete','maxEntries','11099196JnXlUO','hitCount'];_0x3d00=function(){return _0x3d4da7;};return _0x3d00();}const _0x2729c8=_0xa12d;(function(_0x15e1b8,_0x39d07c){const _0xba2d2f=_0xa12d,_0x22141c=_0x15e1b8();while(!![]){try{const _0x38c539=parseInt(_0xba2d2f(0x100))/0x1+parseInt(_0xba2d2f(0x105))/0x2*(-parseInt(_0xba2d2f(0x102))/0x3)+parseInt(_0xba2d2f(0x104))/0x4+-parseInt(_0xba2d2f(0x106))/0x5*(parseInt(_0xba2d2f(0x11c))/0x6)+-parseInt(_0xba2d2f(0x126))/0x7*(parseInt(_0xba2d2f(0x103))/0x8)+parseInt(_0xba2d2f(0x11a))/0x9+parseInt(_0xba2d2f(0x109))/0xa*(parseInt(_0xba2d2f(0x11f))/0xb);if(_0x38c539===_0x39d07c)break;else _0x22141c['push'](_0x22141c['shift']());}catch(_0x423984){_0x22141c['push'](_0x22141c['shift']());}}}(_0x3d00,0x99eef));function contentHash(_0x21269e){const _0x47ba62=_0xa12d,_0x2fc507={'iksRf':function(_0x37fc49,_0x4fa95a){return _0x37fc49+_0x4fa95a;},'jjBrH':function(_0x55a8c1,_0x533144){return _0x55a8c1-_0x533144;},'thDNS':function(_0x445ed8,_0x46ffd2){return _0x445ed8<<_0x46ffd2;}},_0x739445=_0x21269e['replace'](/\s+/g,'\x20')['trim']()[_0x47ba62(0x10b)]();let _0x1deb58=0x0;for(let _0x3cef34=0x0;_0x3cef34<_0x739445['length'];_0x3cef34++)_0x1deb58=_0x2fc507[_0x47ba62(0x110)](_0x2fc507[_0x47ba62(0x124)](_0x2fc507[_0x47ba62(0x10f)](_0x1deb58,0x5),_0x1deb58),_0x739445['charCodeAt'](_0x3cef34))|0x0;return Math[_0x47ba62(0x113)](_0x1deb58)[_0x47ba62(0x101)](0x24);}export class CompressionCache{[_0x2729c8(0x119)];['ttlMs'];['entries'];[_0x2729c8(0x11b)]=0x0;['missCount']=0x0;constructor(_0x493a7b){const _0x4b71ae=_0x2729c8;this['maxEntries']=_0x493a7b?.['maxEntries']??0x64,this[_0x4b71ae(0x120)]=_0x493a7b?.['ttlMs']??0x493e0,this['entries']=new Map();}[_0x2729c8(0x122)](_0x1a5df1){const _0x1a2c02=_0x2729c8,_0x26ff6d={'wmEEj':function(_0x4cd15c,_0x37f893){return _0x4cd15c>_0x37f893;}},_0x11a12c=contentHash(_0x1a5df1),_0x2a9c5c=this['entries'][_0x1a2c02(0x122)](_0x11a12c);if(_0x2a9c5c)return _0x26ff6d[_0x1a2c02(0x108)](Date['now'](),_0x2a9c5c['expiresAt'])?(this['entries'][_0x1a2c02(0x118)](_0x11a12c),void this['missCount']++):(this[_0x1a2c02(0x11d)][_0x1a2c02(0x118)](_0x11a12c),this[_0x1a2c02(0x11d)][_0x1a2c02(0x114)](_0x11a12c,_0x2a9c5c),this['hitCount']++,_0x2a9c5c[_0x1a2c02(0x116)]);this['missCount']++;}[_0x2729c8(0x114)](_0x245756,_0xdef437){const _0x4e6d51=_0x2729c8,_0x29f43d={'Hkwvf':function(_0xcb32ba,_0x17e64e){return _0xcb32ba(_0x17e64e);},'AxDlF':function(_0x19607e,_0x2ab34b){return _0x19607e!==_0x2ab34b;}},_0x4f5302=_0x29f43d[_0x4e6d51(0x123)](contentHash,_0x245756);if(this['entries'][_0x4e6d51(0x10e)](_0x4f5302)&&this[_0x4e6d51(0x11d)][_0x4e6d51(0x118)](_0x4f5302),this[_0x4e6d51(0x11d)]['size']>=this[_0x4e6d51(0x119)]){const _0x39c68e=this[_0x4e6d51(0x11d)][_0x4e6d51(0x121)]()['next']()[_0x4e6d51(0x107)];_0x29f43d[_0x4e6d51(0x10c)](void 0x0,_0x39c68e)&&this[_0x4e6d51(0x11d)]['delete'](_0x39c68e);}this[_0x4e6d51(0x11d)]['set'](_0x4f5302,{'result':_0xdef437,'expiresAt':Date['now']()+this['ttlMs']});}['has'](_0x5d3345){const _0x1bbafa=_0x2729c8,_0xdc36a1={'NgQTM':function(_0x5e8f9d,_0x4655ce){return _0x5e8f9d>_0x4655ce;}},_0x574da1=contentHash(_0x5d3345),_0x1f8ad3=this['entries'][_0x1bbafa(0x122)](_0x574da1);return!!_0x1f8ad3&&(!_0xdc36a1[_0x1bbafa(0x115)](Date[_0x1bbafa(0xff)](),_0x1f8ad3[_0x1bbafa(0x111)])||(this['entries']['delete'](_0x574da1),!0x1));}['clear'](){const _0x42f0ce=_0x2729c8;this[_0x42f0ce(0x11d)][_0x42f0ce(0x10d)](),this['hitCount']=0x0,this['missCount']=0x0;}get['size'](){const _0x30872a=_0x2729c8;return this[_0x30872a(0x11d)][_0x30872a(0x125)];}get[_0x2729c8(0x11e)](){const _0x58bf08=_0x2729c8,_0xbc8f5c={'OWSwj':function(_0x8d3844,_0x36765b){return _0x8d3844===_0x36765b;},'safrE':function(_0x5a595d,_0xb2f639){return _0x5a595d/_0xb2f639;}},_0x1f12bc=this['hitCount']+this['missCount'];return{'hits':this['hitCount'],'misses':this[_0x58bf08(0x10a)],'entries':this[_0x58bf08(0x11d)]['size'],'hitRate':_0xbc8f5c[_0x58bf08(0x127)](0x0,_0x1f12bc)?0x0:_0xbc8f5c[_0x58bf08(0x117)](this['hitCount'],_0x1f12bc)};}}function _0xa12d(_0x57ae99,_0x50f5f3){_0x57ae99=_0x57ae99-0xff;const _0x3d00e9=_0x3d00();let _0xa12d59=_0x3d00e9[_0x57ae99];return _0xa12d59;}export function createCachedPipeline(_0x586f84,_0x1df07e){const _0x4ad3ea=new CompressionCache(_0x1df07e);return{'compress':function(_0x3f9891,_0xbbd14d){const _0x41d30d=_0xa12d,_0x50ae00=_0x4ad3ea[_0x41d30d(0x122)](_0x3f9891);if(void 0x0!==_0x50ae00)return _0x50ae00;const _0x23e982=_0x586f84[_0x41d30d(0x112)](_0x3f9891,_0xbbd14d);return _0x4ad3ea['set'](_0x3f9891,_0x23e982),_0x23e982;},'cache':_0x4ad3ea};}
@@ -1 +1 @@
1
- (function(_0x4b4ee3,_0x374c15){const _0x32ad79=_0x2836,_0x10de05=_0x4b4ee3();while(!![]){try{const _0xe43f51=parseInt(_0x32ad79(0x13c))/0x1*(-parseInt(_0x32ad79(0x13d))/0x2)+-parseInt(_0x32ad79(0x136))/0x3*(-parseInt(_0x32ad79(0x13b))/0x4)+-parseInt(_0x32ad79(0x137))/0x5*(parseInt(_0x32ad79(0x12f))/0x6)+parseInt(_0x32ad79(0x13f))/0x7+parseInt(_0x32ad79(0x141))/0x8*(-parseInt(_0x32ad79(0x130))/0x9)+-parseInt(_0x32ad79(0x13a))/0xa*(parseInt(_0x32ad79(0x12b))/0xb)+-parseInt(_0x32ad79(0x12d))/0xc*(-parseInt(_0x32ad79(0x12e))/0xd);if(_0xe43f51===_0x374c15)break;else _0x10de05['push'](_0x10de05['shift']());}catch(_0x3946c7){_0x10de05['push'](_0x10de05['shift']());}}}(_0x27ec,0x5625e));import{encode,decode}from'gpt-tokenizer';import{countTokens}from'../../shared/token-counter.js';import{splitSentences}from'./text-utils.js';function _0x27ec(){const _0x482a84=['1134CCPows','9mEsQwZ','whINJ','slice','ePayS','wWoQM','sunhs','101823eGYwQI','70OQNhfS','trim','join','410OUcDXo','20lSTkMc','1LtyCMC','299778inrOoz','sentencesPerChunk','3982181evaeSp','length','3544144AUmFdX','34309mtElzL','push','24yoqgVD','2195089ZgaDvs'];_0x27ec=function(){return _0x482a84;};return _0x27ec();}const DEFAULT_CHUNK_SIZE=0xc8,DEFAULT_OVERLAP=0x1e,DEFAULT_SENTENCES_PER_CHUNK=0x3,BASE_QUALITY_ESTIMATE=0.88,QUALITY_VARIANCE_WEIGHT=0.12;function splitIntoOverlappingChunks(_0x215d2d,_0x534398,_0x2b85a4){const _0x11f9a5=_0x2836,_0x19f419={'ePayS':function(_0x4cdd6f,_0x3691eb){return _0x4cdd6f+_0x3691eb;},'NWCaq':function(_0x15de97,_0x12dbe9){return _0x15de97(_0x12dbe9);},'PHCIw':function(_0x583618,_0x575e30){return _0x583618===_0x575e30;}},_0x27bb26=[];let _0x1aea24=0x0;for(;_0x1aea24<_0x215d2d['length'];){const _0x1160cc=Math['min'](_0x19f419[_0x11f9a5(0x133)](_0x1aea24,_0x534398),_0x215d2d[_0x11f9a5(0x140)]),_0x423088=_0x215d2d['slice'](_0x1aea24,_0x1160cc);if(_0x27bb26[_0x11f9a5(0x12c)](_0x19f419['NWCaq'](decode,_0x423088)),_0x1aea24+=_0x534398-_0x2b85a4,_0x19f419['PHCIw'](_0x1160cc,_0x215d2d[_0x11f9a5(0x140)]))break;}return _0x27bb26;}function summarizeChunk(_0x2de81c,_0x5a4caa){const _0x5ccfcb=_0x2836,_0x463fb1={'whINJ':function(_0x3f7917,_0x1e9fca){return _0x3f7917(_0x1e9fca);},'Wrtvc':function(_0x3d095d,_0x3779f8){return _0x3d095d===_0x3779f8;}},_0x10916a=_0x463fb1[_0x5ccfcb(0x131)](splitSentences,_0x2de81c);if(_0x10916a['length']<=_0x5a4caa)return _0x2de81c;if(_0x463fb1['Wrtvc'](0x1,_0x5a4caa))return _0x10916a[0x0];return[..._0x10916a[_0x5ccfcb(0x132)](0x0,0x1),..._0x10916a['slice'](-(_0x5a4caa-0x1))]['join']('.\x20');}function _0x2836(_0x203a4c,_0x5e5954){_0x203a4c=_0x203a4c-0x12b;const _0x27ecb9=_0x27ec();let _0x2836a2=_0x27ecb9[_0x203a4c];return _0x2836a2;}export function compressChunked(_0x4036c7,_0x3f246a={}){const _0x18e5f5=_0x2836,_0x2012ee={'JFEIY':'chunked','wWoQM':function(_0x4091ad,_0x24e2a1){return _0x4091ad<=_0x24e2a1;},'zSkgR':function(_0x16b777,_0x4f21e){return _0x16b777(_0x4f21e);},'sunhs':function(_0x57a103,_0x5801ab){return _0x57a103/_0x5801ab;},'AGzbQ':function(_0x40413a,_0x480b88){return _0x40413a+_0x480b88;},'gmZLd':function(_0x808d2,_0x3014e9){return _0x808d2*_0x3014e9;}};if(!_0x4036c7||!_0x4036c7[_0x18e5f5(0x138)]())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x2012ee['JFEIY'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x217a47=countTokens(_0x4036c7),_0x36583a=_0x3f246a['chunkSize']??0xc8,_0x210d1e=_0x3f246a['overlap']??0x1e,_0x3b05a2=_0x3f246a[_0x18e5f5(0x13e)]??0x3;if(_0x2012ee[_0x18e5f5(0x134)](_0x217a47,_0x36583a))return{'text':_0x4036c7,'originalTokens':_0x217a47,'compressedTokens':_0x217a47,'compressionRatio':0x1,'strategyUsed':_0x2012ee['JFEIY'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x3f6ceb=splitIntoOverlappingChunks(_0x2012ee['zSkgR'](encode,_0x4036c7),_0x36583a,_0x210d1e),_0x168d9d=_0x3f6ceb['map']((_0x597bf8,_0x4ad8a3)=>{const _0x4bb5ad=_0x18e5f5,_0x4852b5=summarizeChunk(_0x597bf8,_0x3b05a2);return'['+(_0x4ad8a3+0x1)+'/'+_0x3f6ceb[_0x4bb5ad(0x140)]+']\x20'+_0x4852b5;})[_0x18e5f5(0x139)]('\x0a\x0a'),_0x19d901=_0x2012ee['zSkgR'](countTokens,_0x168d9d);return{'text':_0x168d9d,'originalTokens':_0x217a47,'compressedTokens':_0x19d901,'compressionRatio':_0x19d901>0x0?_0x2012ee[_0x18e5f5(0x135)](_0x217a47,_0x19d901):0x1,'strategyUsed':'chunked','qualityEstimate':Math['min'](0x1,_0x2012ee['AGzbQ'](0.88,_0x2012ee['gmZLd'](_0x2012ee[_0x18e5f5(0x135)](_0x19d901,_0x217a47),0.12))),'wasTruncated':!0x0};}export const chunkedStrategy={'name':'chunked','compress':(_0xa4f9ba,_0x593926)=>compressChunked(_0xa4f9ba,_0x593926)};
1
+ (function(_0x59d4ad,_0x3e5ce9){const _0x761dd4=_0x1ffc,_0x436ee0=_0x59d4ad();while(!![]){try{const _0x21423c=parseInt(_0x761dd4(0x1cc))/0x1+parseInt(_0x761dd4(0x1da))/0x2+parseInt(_0x761dd4(0x1d2))/0x3*(parseInt(_0x761dd4(0x1c9))/0x4)+-parseInt(_0x761dd4(0x1dd))/0x5*(-parseInt(_0x761dd4(0x1d4))/0x6)+-parseInt(_0x761dd4(0x1d3))/0x7*(-parseInt(_0x761dd4(0x1c8))/0x8)+-parseInt(_0x761dd4(0x1d9))/0x9*(-parseInt(_0x761dd4(0x1db))/0xa)+-parseInt(_0x761dd4(0x1c7))/0xb;if(_0x21423c===_0x3e5ce9)break;else _0x436ee0['push'](_0x436ee0['shift']());}catch(_0x17ffce){_0x436ee0['push'](_0x436ee0['shift']());}}}(_0x4ec8,0xf130e));import{encode,decode}from'gpt-tokenizer';import{countTokens}from'../../shared/token-counter.js';import{splitSentences}from'./text-utils.js';const DEFAULT_CHUNK_SIZE=0xc8,DEFAULT_OVERLAP=0x1e,DEFAULT_SENTENCES_PER_CHUNK=0x3,BASE_QUALITY_ESTIMATE=0.88,QUALITY_VARIANCE_WEIGHT=0.12;function splitIntoOverlappingChunks(_0x3f4850,_0x2505b4,_0x6ce262){const _0x207bf6=_0x1ffc,_0x13e4ab={'hLhYr':function(_0x7c0f75,_0x458cfb){return _0x7c0f75-_0x458cfb;},'thtJI':function(_0x1a4119,_0x2478e1){return _0x1a4119<_0x2478e1;},'wWIDI':function(_0x52a80a,_0x5b9854){return _0x52a80a===_0x5b9854;}},_0x566a2e=Math[_0x207bf6(0x1cb)](_0x6ce262,_0x2505b4-0x1),_0x3f966e=Math[_0x207bf6(0x1d8)](0x1,_0x13e4ab[_0x207bf6(0x1d0)](_0x2505b4,_0x566a2e)),_0x2f416a=[];let _0x18ebf4=0x0;for(;_0x13e4ab['thtJI'](_0x18ebf4,_0x3f4850['length']);){const _0x2a5052=Math[_0x207bf6(0x1cb)](_0x18ebf4+_0x2505b4,_0x3f4850['length']),_0x688aca=_0x3f4850[_0x207bf6(0x1c5)](_0x18ebf4,_0x2a5052);if(_0x2f416a['push'](decode(_0x688aca)),_0x13e4ab[_0x207bf6(0x1de)](_0x2a5052,_0x3f4850[_0x207bf6(0x1d5)]))break;_0x18ebf4+=_0x3f966e;}return _0x2f416a;}function _0x1ffc(_0x3a2e8e,_0x396600){_0x3a2e8e=_0x3a2e8e-0x1c5;const _0x4ec8fc=_0x4ec8();let _0x1ffcd8=_0x4ec8fc[_0x3a2e8e];return _0x1ffcd8;}function summarizeChunk(_0x34f7a2,_0x1ddfc){const _0x316d5e=_0x1ffc,_0x553e0d={'olbTw':function(_0x52e9e2,_0x38e2e5){return _0x52e9e2<=_0x38e2e5;},'ohuqu':function(_0x5ef1c2,_0x39b23f){return _0x5ef1c2-_0x39b23f;}},_0x533c64=splitSentences(_0x34f7a2);if(_0x553e0d[_0x316d5e(0x1ce)](_0x533c64['length'],_0x1ddfc))return _0x34f7a2;if(0x1===_0x1ddfc)return _0x533c64[0x0];return[..._0x533c64['slice'](0x0,0x1),..._0x533c64['slice'](-_0x553e0d[_0x316d5e(0x1cd)](_0x1ddfc,0x1))]['join']('.\x20');}export function compressChunked(_0x3eeefa,_0x580db4={}){const _0x20f595=_0x1ffc,_0x500343={'abVlK':function(_0x1d8e2c,_0x28a4ab,_0x4e606a){return _0x1d8e2c(_0x28a4ab,_0x4e606a);},'pCJvR':'chunked','IUnlE':function(_0x3267d0,_0x1a5721){return _0x3267d0(_0x1a5721);},'JriLY':function(_0x304239,_0xb35aa1,_0x157f81,_0x141555){return _0x304239(_0xb35aa1,_0x157f81,_0x141555);},'gcZfj':function(_0x2961e1,_0x50c683){return _0x2961e1>_0x50c683;},'HWBrE':function(_0x2dfff5,_0x56dfa6){return _0x2dfff5+_0x56dfa6;},'lWvfj':function(_0x1722c7,_0x15be11){return _0x1722c7*_0x15be11;},'weQLW':function(_0x17f025,_0x307ffd){return _0x17f025/_0x307ffd;}};if(!_0x3eeefa||!_0x3eeefa['trim']())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x500343['pCJvR'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x436c10=_0x500343['IUnlE'](countTokens,_0x3eeefa),_0x445b75=_0x580db4[_0x20f595(0x1dc)]??0xc8,_0x502e16=_0x580db4['overlap']??0x1e,_0x55bc41=_0x580db4['sentencesPerChunk']??0x3;if(_0x436c10<=_0x445b75)return{'text':_0x3eeefa,'originalTokens':_0x436c10,'compressedTokens':_0x436c10,'compressionRatio':0x1,'strategyUsed':_0x20f595(0x1d1),'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x351537=_0x500343[_0x20f595(0x1cf)](splitIntoOverlappingChunks,encode(_0x3eeefa),_0x445b75,_0x502e16),_0x59717c=_0x351537['map']((_0x4c5846,_0x20c87b)=>{const _0x585ff7=_0x20f595,_0x2ffd43=_0x500343[_0x585ff7(0x1d7)](summarizeChunk,_0x4c5846,_0x55bc41);return'['+(_0x20c87b+0x1)+'/'+_0x351537[_0x585ff7(0x1d5)]+']\x20'+_0x2ffd43;})[_0x20f595(0x1d6)]('\x0a\x0a'),_0x549bc7=countTokens(_0x59717c);return{'text':_0x59717c,'originalTokens':_0x436c10,'compressedTokens':_0x549bc7,'compressionRatio':_0x500343['gcZfj'](_0x549bc7,0x0)?_0x436c10/_0x549bc7:0x1,'strategyUsed':_0x500343['pCJvR'],'qualityEstimate':Math['min'](0x1,_0x500343[_0x20f595(0x1ca)](0.88,_0x500343['lWvfj'](_0x500343[_0x20f595(0x1c6)](_0x549bc7,_0x436c10),0.12))),'wasTruncated':!0x0};}export const chunkedStrategy={'name':'chunked','compress':(_0x49e94c,_0x3de92e)=>compressChunked(_0x49e94c,_0x3de92e)};function _0x4ec8(){const _0x77f3fb=['JriLY','hLhYr','chunked','433263nZZmXU','289793YEwBVL','12jpCqan','length','join','abVlK','max','9uhhunB','2297884lubwqU','15835270LAVDTb','chunkSize','1691930JiowGw','wWIDI','slice','weQLW','60605380GpKXTo','72WdAGrp','52fBgfCE','HWBrE','min','838193DdyYsr','ohuqu','olbTw'];_0x4ec8=function(){return _0x77f3fb;};return _0x4ec8();}
@@ -0,0 +1 @@
1
+ const _0x4f16e7=_0x314c;(function(_0x4abf48,_0x13ef61){const _0x42c632=_0x314c,_0x4dc6cb=_0x4abf48();while(!![]){try{const _0x1e36ab=-parseInt(_0x42c632(0xd5))/0x1+parseInt(_0x42c632(0xca))/0x2*(-parseInt(_0x42c632(0xd2))/0x3)+-parseInt(_0x42c632(0xcd))/0x4+-parseInt(_0x42c632(0xcc))/0x5*(-parseInt(_0x42c632(0xd4))/0x6)+-parseInt(_0x42c632(0xbe))/0x7*(parseInt(_0x42c632(0xc0))/0x8)+-parseInt(_0x42c632(0xbf))/0x9+-parseInt(_0x42c632(0xbc))/0xa*(-parseInt(_0x42c632(0xcf))/0xb);if(_0x1e36ab===_0x13ef61)break;else _0x4dc6cb['push'](_0x4dc6cb['shift']());}catch(_0x14e5fb){_0x4dc6cb['push'](_0x4dc6cb['shift']());}}}(_0x46a1,0x31946));import{countTokens}from'../../shared/token-counter.js';import{extractContentWords,STOPWORDS}from'./text-utils.js';const DEFAULT_SIMILARITY_THRESHOLD=0.7,MIN_WORDS_FOR_DEDUP=0x5,CODE_FENCE_PATTERN=/^```/,HEADING_PATTERN=/^#/,BASE_QUALITY_ESTIMATE=0.95;function _0x314c(_0x1292a9,_0xd60322){_0x1292a9=_0x1292a9-0xba;const _0x46a170=_0x46a1();let _0x314c28=_0x46a170[_0x1292a9];return _0x314c28;}function isInsideCodeFence(_0x31da9a,_0x19fcf0){const _0x3d8f0d=_0x314c;let _0x1e0188=!0x1;for(let _0x4d7edf=0x0;_0x4d7edf<_0x19fcf0;_0x4d7edf++){const _0x41a232=_0x31da9a[_0x4d7edf]['split']('\x0a');for(const _0x682f01 of _0x41a232)CODE_FENCE_PATTERN['test'](_0x682f01[_0x3d8f0d(0xd1)]())&&(_0x1e0188=!_0x1e0188);}return _0x1e0188;}function hasCodeFence(_0x4e7cf3){const _0x5e980e=_0x314c;return _0x4e7cf3['split']('\x0a')['some'](_0x556472=>CODE_FENCE_PATTERN['test'](_0x556472[_0x5e980e(0xd1)]()));}function isHeading(_0x3e20bb){const _0x27d904=_0x314c;return HEADING_PATTERN['test'](_0x3e20bb[_0x27d904(0xd1)]());}function isTooShort(_0x6a8bec){const _0x49fcf1={'oGsRy':function(_0x2e8ff8,_0x478ce2){return _0x2e8ff8<_0x478ce2;}};return _0x49fcf1['oGsRy'](_0x6a8bec['trim']()['split'](/\s+/)['length'],0x5);}function computeFingerprint(_0x20e572){const _0x5e6613=_0x314c,_0x107e83=extractContentWords(_0x20e572)[_0x5e6613(0xd3)](_0x2019ae=>!STOPWORDS['has'](_0x2019ae));return new Set(_0x107e83['sort']());}function computeJaccardSimilarity(_0xaad06b,_0xcd4d1f){const _0x2cb14d=_0x314c,_0x29fd98={'RDtBW':function(_0x3cfbff,_0x3351d0){return _0x3cfbff===_0x3351d0;},'WjDwQ':function(_0x2c0edc,_0x24a6ca){return _0x2c0edc===_0x24a6ca;},'MhpAR':function(_0x4567ed,_0x428ac8){return _0x4567ed<=_0x428ac8;},'jVZhi':function(_0x18c932,_0x453c5e){return _0x18c932-_0x453c5e;},'uGhqX':function(_0x9597c1,_0x4f1ef8){return _0x9597c1+_0x4f1ef8;}};if(_0x29fd98['RDtBW'](0x0,_0xaad06b[_0x2cb14d(0xcb)])&&_0x29fd98['WjDwQ'](0x0,_0xcd4d1f[_0x2cb14d(0xcb)]))return 0x0;let _0xa1a151=0x0;const _0xaed88c=_0x29fd98[_0x2cb14d(0xc2)](_0xaad06b[_0x2cb14d(0xcb)],_0xcd4d1f[_0x2cb14d(0xcb)])?_0xaad06b:_0xcd4d1f,_0x511459=_0x29fd98['MhpAR'](_0xaad06b['size'],_0xcd4d1f[_0x2cb14d(0xcb)])?_0xcd4d1f:_0xaad06b;for(const _0xb3a17f of _0xaed88c)_0x511459['has'](_0xb3a17f)&&_0xa1a151++;const _0x3a2ea5=_0x29fd98['jVZhi'](_0x29fd98[_0x2cb14d(0xc8)](_0xaad06b[_0x2cb14d(0xcb)],_0xcd4d1f['size']),_0xa1a151);return _0x3a2ea5>0x0?_0xa1a151/_0x3a2ea5:0x0;}function _0x46a1(){const _0x52c395=['1720JLVaxD','similarityThreshold','1393BdpdyQ','3385026kKKCkw','3728uFANlh','maxTokens','MhpAR','length','min','qAHcE','fingerprint','dedup','uGhqX','MbDFO','35852nagJlK','size','95swtInd','1337640jswhOk','split','96217MNPevP','rHVBe','trim','60rQRxRq','filter','35886PvllGv','253267eefDNt','add','text'];_0x46a1=function(){return _0x52c395;};return _0x46a1();}function splitParagraphs(_0x212a99){const _0x3a28f8=_0x314c;return _0x212a99[_0x3a28f8(0xce)](/\n\n+/);}function buildParagraphEntries(_0x300814){const _0x2cc66a={'cZdEe':function(_0x14f44b,_0x13255e){return _0x14f44b(_0x13255e);}};return _0x300814['map']((_0x1c4ebf,_0x3a159f)=>{const _0x17d885=isTooShort(_0x1c4ebf)||isHeading(_0x1c4ebf)||hasCodeFence(_0x1c4ebf)||isInsideCodeFence(_0x300814,_0x3a159f);return{'index':_0x3a159f,'text':_0x1c4ebf,'fingerprint':_0x17d885?new Set():_0x2cc66a['cZdEe'](computeFingerprint,_0x1c4ebf),'isProtected':_0x17d885};});}function findDuplicates(_0x4d929d,_0x1e41fc){const _0xdb8031=_0x314c,_0x9dd6c0={'MbDFO':function(_0x301ac7,_0x47b39b){return _0x301ac7+_0x47b39b;},'qAHcE':function(_0x59b199,_0x1682ea){return _0x59b199<_0x1682ea;},'ogNgf':function(_0x51a5b6,_0x337097){return _0x51a5b6>=_0x337097;}},_0x2a2bf7=new Set();let _0x284745=0x0;for(let _0x34c192=0x0;_0x34c192<_0x4d929d[_0xdb8031(0xc3)];_0x34c192++){const _0x3b5478=_0x4d929d[_0x34c192];if(_0x3b5478['isProtected']||_0x2a2bf7['has'](_0x34c192))continue;let _0x267ff3=!0x1;for(let _0x4785c6=_0x9dd6c0[_0xdb8031(0xc9)](_0x34c192,0x1);_0x9dd6c0[_0xdb8031(0xc5)](_0x4785c6,_0x4d929d['length']);_0x4785c6++){const _0x7f3047=_0x4d929d[_0x4785c6];if(_0x7f3047['isProtected']||_0x2a2bf7['has'](_0x4785c6))continue;_0x9dd6c0['ogNgf'](computeJaccardSimilarity(_0x3b5478[_0xdb8031(0xc6)],_0x7f3047[_0xdb8031(0xc6)]),_0x1e41fc)&&(_0x2a2bf7[_0xdb8031(0xba)](_0x4785c6),_0x267ff3=!0x0);}_0x267ff3&&_0x284745++;}const _0x50e715=new Set();for(let _0x4ea424=0x0;_0x4ea424<_0x4d929d[_0xdb8031(0xc3)];_0x4ea424++)_0x2a2bf7['has'](_0x4ea424)||_0x50e715['add'](_0x4ea424);return{'keptIndices':_0x50e715,'removedIndices':_0x2a2bf7,'groupCount':_0x284745};}export function deduplicateText(_0x2d9f14,_0x5e39c9){const _0x5a83fe=_0x314c;if(!_0x2d9f14||!_0x2d9f14[_0x5a83fe(0xd1)]())return{'text':'','originalParagraphs':0x0,'keptParagraphs':0x0,'removedParagraphs':0x0,'duplicateGroups':0x0};const _0x102438=_0x5e39c9?.[_0x5a83fe(0xbd)]??0.7,_0x257563=splitParagraphs(_0x2d9f14),_0x4e3a92=buildParagraphEntries(_0x257563),{keptIndices:_0x3feb22,removedIndices:_0x32447d,groupCount:_0x37f5ff}=findDuplicates(_0x4e3a92,_0x102438),_0x3a39a2=_0x4e3a92[_0x5a83fe(0xd3)](_0xa11682=>_0x3feb22['has'](_0xa11682['index']))['map'](_0x1abf73=>_0x1abf73[_0x5a83fe(0xbb)]);return{'text':_0x3a39a2['join']('\x0a\x0a'),'originalParagraphs':_0x257563[_0x5a83fe(0xc3)],'keptParagraphs':_0x3a39a2['length'],'removedParagraphs':_0x32447d['size'],'duplicateGroups':_0x37f5ff};}export function compressDedup(_0x21261a,_0x3c63ef={}){const _0x399ac8=_0x314c,_0x2b9091={'Krgyn':_0x399ac8(0xc7),'ZoVrb':function(_0x5f2c93,_0x415d16){return _0x5f2c93(_0x415d16);},'rHVBe':function(_0x312e45,_0x440d53){return _0x312e45(_0x440d53);},'QMzgB':function(_0x4478a3,_0x56eca0){return _0x4478a3/_0x56eca0;},'xWOTS':function(_0x1e2652,_0x139ea1){return _0x1e2652>_0x139ea1;},'wgExI':function(_0x3a382f,_0x30513e){return _0x3a382f<=_0x30513e;}};if(!_0x21261a||!_0x21261a['trim']())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x2b9091['Krgyn'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x563c3e=_0x2b9091['ZoVrb'](countTokens,_0x21261a),_0xbeab31=_0x2b9091[_0x399ac8(0xd0)](deduplicateText,_0x21261a),_0x447111=countTokens(_0xbeab31[_0x399ac8(0xbb)]),_0x4a5e9c=_0xbeab31['removedParagraphs']>0x0?Math[_0x399ac8(0xc4)](0x1,0.95+_0x2b9091['QMzgB'](_0x447111,_0x563c3e)*(0x1-0.95)):0x1;let _0x878f3e=_0xbeab31[_0x399ac8(0xbb)],_0x509764=!0x1;if(_0x3c63ef[_0x399ac8(0xc1)]&&_0x2b9091['xWOTS'](_0x447111,_0x3c63ef['maxTokens'])){const _0x421ac9=splitParagraphs(_0x878f3e),_0x265a7d=[];let _0x16bf10=0x0;for(const _0x5a33ec of _0x421ac9){const _0x519a45=countTokens(_0x5a33ec);if(!_0x2b9091['wgExI'](_0x16bf10+_0x519a45,_0x3c63ef['maxTokens'])){_0x509764=!0x0;break;}_0x265a7d['push'](_0x5a33ec),_0x16bf10+=_0x519a45;}_0x878f3e=_0x265a7d['join']('\x0a\x0a');}const _0x5b1737=_0x509764?_0x2b9091['rHVBe'](countTokens,_0x878f3e):_0x447111;return{'text':_0x878f3e,'originalTokens':_0x563c3e,'compressedTokens':_0x5b1737,'compressionRatio':_0x5b1737>0x0?_0x563c3e/_0x5b1737:0x1,'strategyUsed':_0x2b9091['Krgyn'],'qualityEstimate':_0x4a5e9c,'wasTruncated':_0x509764};}export const dedupStrategy={'name':_0x4f16e7(0xc7),'compress':compressDedup};
@@ -0,0 +1 @@
1
+ const _0x10acd5=_0x48bb;(function(_0x32d5b4,_0x51fa68){const _0x8cf7fd=_0x48bb,_0x35b8fc=_0x32d5b4();while(!![]){try{const _0x58e9ad=parseInt(_0x8cf7fd(0x1f9))/0x1*(-parseInt(_0x8cf7fd(0x204))/0x2)+parseInt(_0x8cf7fd(0x1f2))/0x3+-parseInt(_0x8cf7fd(0x1ea))/0x4+-parseInt(_0x8cf7fd(0x1e1))/0x5*(-parseInt(_0x8cf7fd(0x201))/0x6)+parseInt(_0x8cf7fd(0x1fe))/0x7*(-parseInt(_0x8cf7fd(0x1ec))/0x8)+-parseInt(_0x8cf7fd(0x1f8))/0x9*(parseInt(_0x8cf7fd(0x1f7))/0xa)+parseInt(_0x8cf7fd(0x1ee))/0xb;if(_0x58e9ad===_0x51fa68)break;else _0x35b8fc['push'](_0x35b8fc['shift']());}catch(_0x11ea22){_0x35b8fc['push'](_0x35b8fc['shift']());}}}(_0x4f25,0xbbc50));function _0x4f25(){const _0x5a39e9=['startsWith','map','object','1013160svgTdv','format-optimizer','cBYjr','string','jsonBlocksConverted','1517330MoMIzg','63icGvyi','8SyZrFd','split','join','every','pMOSK','2605379BhBEyj','nWYbi','SQCEU','144viPeVI','fiSFY','count','228428LtQpDX','length','KoesB','ZvhjJ','1|2|5|0|4|3','bKyDU','null','ycJHj','push','QtJVj','stringify','some','isArray','qIfio','replace','307120mKMIaS','markdownCleaned','JDixq','values','SWtFw','parse','Uzybp','\x20\x20$2\x20','SOVtJ','792272JDRBtP','NVonx','24jdvzRf','text','24724810rabwuP'];_0x4f25=function(){return _0x5a39e9;};return _0x4f25();}import{countTokens}from'../../shared/token-counter.js';const FENCED_JSON_BLOCK=/```(?:json)?\s*\n([\s\S]*?)```/g,INLINE_JSON_OBJECT=/(?<![\\:a-zA-Z0-9_"'])(\{[\s\S]*?\})(?![\\a-zA-Z0-9_])/g,INLINE_JSON_ARRAY=/(?<![\\:a-zA-Z0-9_"'])(\[[\s\S]*?\])(?![\\a-zA-Z0-9_])/g,CONSECUTIVE_BLANK_LINES=/\n{3,}/g,EXCESSIVE_LIST_INDENT=/^( {4,}|\t{2,})([*\-+]|\d+\.)\s/gm,BOLD_WHOLE_PARAGRAPH=/^\*\*([^*\n]+)\*\*$/gm,ITALIC_WHOLE_PARAGRAPH=/^_([^_\n]+)_$/gm,MAX_FLATTEN_DEPTH=0x2;function isJsonLike(_0xbd5ade){const _0x48c015=_0x48bb,_0x3b68cf=_0xbd5ade['trim']();return _0x3b68cf[_0x48c015(0x1ef)]('{')&&_0x3b68cf['endsWith']('}')||_0x3b68cf['startsWith']('[')&&_0x3b68cf['endsWith'](']');}function tryParseJson(_0x329b74){const _0x51672d=_0x48bb;try{return JSON[_0x51672d(0x1e6)](_0x329b74);}catch{return null;}}function flattenObject(_0x3548b5,_0x35fb84,_0x416752){const _0x44ac31=_0x48bb,_0x4521b3={'PzQGy':function(_0xba2dd0,_0x5df925){return _0xba2dd0!==_0x5df925;},'QtJVj':function(_0x2f2614,_0x27aa47){return _0x2f2614==_0x27aa47;},'MEBmA':_0x44ac31(0x1f1)},_0x428aa8=[];for(const [_0x54b3bd,_0x12223b]of Object['entries'](_0x3548b5)){const _0x4d1566=_0x35fb84?_0x35fb84+'.'+_0x54b3bd:_0x54b3bd;_0x4521b3['PzQGy'](null,_0x12223b)&&_0x4521b3[_0x44ac31(0x1db)](_0x4521b3['MEBmA'],typeof _0x12223b)&&!Array[_0x44ac31(0x1de)](_0x12223b)&&_0x416752<0x2?_0x428aa8['push'](...flattenObject(_0x12223b,_0x4d1566,_0x416752+0x1)):_0x428aa8[_0x44ac31(0x1da)]([_0x4d1566,_0x12223b]);}return _0x428aa8;}function formatValue(_0x16fdd2){const _0x24f6b1=_0x48bb,_0xfb00de={'KoesB':_0x24f6b1(0x208),'gAWCr':function(_0x2df880,_0xe6e4f7){return _0x2df880==_0xe6e4f7;},'Uzybp':'number','THYkp':'boolean','BoeLc':_0x24f6b1(0x1d8),'tVBYQ':function(_0x3502d3,_0x5e154f){return _0x3502d3===_0x5e154f;},'pMOSK':_0x24f6b1(0x1f5)},_0x571b05=_0xfb00de[_0x24f6b1(0x206)][_0x24f6b1(0x1fa)]('|');let _0x113e53=0x0;while(!![]){switch(_0x571b05[_0x113e53++]){case'0':if(_0xfb00de['gAWCr'](_0xfb00de[_0x24f6b1(0x1e7)],typeof _0x16fdd2)||_0xfb00de['THYkp']==typeof _0x16fdd2)return String(_0x16fdd2);continue;case'1':if(null===_0x16fdd2)return _0xfb00de['BoeLc'];continue;case'2':if(_0xfb00de['tVBYQ'](void 0x0,_0x16fdd2))return'undefined';continue;case'3':return JSON['stringify'](_0x16fdd2);case'4':if(Array['isArray'](_0x16fdd2))return'['+_0x16fdd2[_0x24f6b1(0x1f0)](_0x2868c9=>'object'==typeof _0x2868c9&&null!==_0x2868c9?JSON[_0x24f6b1(0x1dc)](_0x2868c9):formatValue(_0x2868c9))[_0x24f6b1(0x1fb)](',\x20')+']';continue;case'5':if(_0xfb00de['gAWCr'](_0xfb00de[_0x24f6b1(0x1fd)],typeof _0x16fdd2))return _0x16fdd2;continue;}break;}}function hasDeepNesting(_0x2c9d97,_0x599fb4){const _0x300da0=_0x48bb,_0x5b5675={'SOVtJ':function(_0x10920a,_0x16a72e){return _0x10920a>_0x16a72e;},'ycJHj':'object'};return _0x5b5675[_0x300da0(0x1e9)](_0x599fb4,0x2)||_0x5b5675[_0x300da0(0x1d9)]==typeof _0x2c9d97&&null!==_0x2c9d97&&(Array[_0x300da0(0x1de)](_0x2c9d97)?_0x2c9d97[_0x300da0(0x1dd)](_0x533cab=>hasDeepNesting(_0x533cab,_0x599fb4+0x1)):Object[_0x300da0(0x1e4)](_0x2c9d97)[_0x300da0(0x1dd)](_0x3bc9a7=>hasDeepNesting(_0x3bc9a7,_0x599fb4+0x1)));}function convertJsonToCompact(_0x4665a1){const _0x32a1b5=_0x48bb,_0x3619d7={'qIfio':function(_0x1c3ce2,_0x2ef2da,_0x487fc7){return _0x1c3ce2(_0x2ef2da,_0x487fc7);},'SQCEU':function(_0x3fcc85,_0x51ec3e){return _0x3fcc85(_0x51ec3e);},'zwBfK':function(_0x38c841,_0x5a1ca4){return _0x38c841(_0x5a1ca4);}};if(Array[_0x32a1b5(0x1de)](_0x4665a1))return _0x4665a1[_0x32a1b5(0x1fc)](_0x41806a=>_0x32a1b5(0x1f1)!=typeof _0x41806a||null===_0x41806a)?'['+_0x4665a1[_0x32a1b5(0x1f0)](formatValue)['join'](',\x20')+']':_0x3619d7[_0x32a1b5(0x1df)](hasDeepNesting,_0x4665a1,0x0)?JSON[_0x32a1b5(0x1dc)](_0x4665a1):_0x4665a1['map'](_0x1c8815=>'object'!=typeof _0x1c8815||null===_0x1c8815||Array['isArray'](_0x1c8815)?formatValue(_0x1c8815):convertObjectToCompact(_0x1c8815))[_0x32a1b5(0x1fb)]('\x0a');if(_0x32a1b5(0x1f1)==typeof _0x4665a1&&null!==_0x4665a1){if(_0x3619d7[_0x32a1b5(0x1df)](hasDeepNesting,_0x4665a1,0x0)){const _0x4f192a=_0x4665a1;if(!Object[_0x32a1b5(0x1e4)](_0x4f192a)[_0x32a1b5(0x1dd)](_0x49a9f4=>'object'!=typeof _0x49a9f4||null===_0x49a9f4))return JSON['stringify'](_0x4665a1);}return _0x3619d7[_0x32a1b5(0x200)](convertObjectToCompact,_0x4665a1);}return _0x3619d7['zwBfK'](formatValue,_0x4665a1);}function convertObjectToCompact(_0xaaef09){const _0x3f863c=_0x48bb,_0x4b3321={'bKyDU':function(_0xd3e93,_0x158bce,_0x2f390a,_0x474337){return _0xd3e93(_0x158bce,_0x2f390a,_0x474337);},'SWtFw':function(_0x54a363,_0x36ff85){return _0x54a363<=_0x36ff85;}},_0x4d5ccd=_0x4b3321[_0x3f863c(0x209)](flattenObject,_0xaaef09,'',0x0)['map'](([_0x5b3683,_0x412e26])=>'object'==typeof _0x412e26&&null!==_0x412e26?_0x5b3683+':\x20'+JSON[_0x3f863c(0x1dc)](_0x412e26):_0x5b3683+':\x20'+formatValue(_0x412e26));return _0x4b3321[_0x3f863c(0x1e5)](_0x4d5ccd[_0x3f863c(0x205)],0x4)&&_0x4d5ccd[_0x3f863c(0x1fc)](_0x15306b=>_0x15306b[_0x3f863c(0x205)]<0x3c)?_0x4d5ccd['join'](',\x20'):_0x4d5ccd[_0x3f863c(0x1fb)]('\x0a');}function replaceJsonBlocks(_0x5cfc59){const _0x47aec8=_0x48bb,_0x2f1436={'cBYjr':function(_0x1baa66,_0x4fbd74){return _0x1baa66(_0x4fbd74);},'LUhIq':function(_0x3e9349,_0x5c711c){return _0x3e9349===_0x5c711c;},'wDWhZ':function(_0xd4e50e,_0x53cc6f){return _0xd4e50e(_0x53cc6f);},'RRkIQ':function(_0x245321,_0x47a6ce){return _0x245321(_0x47a6ce);}};let _0x191ac0=0x0,_0x3cc497=_0x5cfc59;return _0x3cc497=_0x3cc497['replace'](FENCED_JSON_BLOCK,(_0xa0e972,_0x479877)=>{const _0xfa1693=_0x479877['trim']();if(!_0x2f1436['cBYjr'](isJsonLike,_0xfa1693))return _0xa0e972;const _0x1d5934=tryParseJson(_0xfa1693);return null===_0x1d5934?_0xa0e972:(_0x191ac0++,convertJsonToCompact(_0x1d5934));}),_0x3cc497=_0x3cc497['replace'](INLINE_JSON_OBJECT,(_0x5c318a,_0x3e284f)=>{const _0x6ed197=_0x48bb,_0x56e74d=_0x2f1436[_0x6ed197(0x1f4)](tryParseJson,_0x3e284f);return _0x2f1436['LUhIq'](null,_0x56e74d)||_0x6ed197(0x1f1)!=typeof _0x56e74d||Array[_0x6ed197(0x1de)](_0x56e74d)?_0x5c318a:(_0x191ac0++,_0x2f1436['wDWhZ'](convertJsonToCompact,_0x56e74d));}),_0x3cc497=_0x3cc497[_0x47aec8(0x1e0)](INLINE_JSON_ARRAY,(_0x1d28d8,_0x179c7e)=>{const _0x208a9c=_0x47aec8,_0x586394=tryParseJson(_0x179c7e);return null!==_0x586394&&Array[_0x208a9c(0x1de)](_0x586394)?_0x2f1436['LUhIq'](0x0,_0x586394['length'])?_0x1d28d8:(_0x191ac0++,_0x2f1436['RRkIQ'](convertJsonToCompact,_0x586394)):_0x1d28d8;}),{'text':_0x3cc497,'count':_0x191ac0};}function cleanMarkdown(_0x13b3eb){const _0x8959d5=_0x48bb,_0x3d2928={'NVonx':_0x8959d5(0x1e8)};let _0x59c78d=!0x1,_0x43016e=_0x13b3eb;const _0x151f42=_0x43016e;_0x43016e=_0x43016e[_0x8959d5(0x1e0)](CONSECUTIVE_BLANK_LINES,'\x0a\x0a'),_0x43016e!==_0x151f42&&(_0x59c78d=!0x0);const _0x284ee3=_0x43016e;_0x43016e=_0x43016e['replace'](EXCESSIVE_LIST_INDENT,_0x3d2928[_0x8959d5(0x1eb)]),_0x43016e!==_0x284ee3&&(_0x59c78d=!0x0);const _0x1849b=_0x43016e;_0x43016e=_0x43016e['replace'](BOLD_WHOLE_PARAGRAPH,'$1'),_0x43016e!==_0x1849b&&(_0x59c78d=!0x0);const _0x4e0540=_0x43016e;return _0x43016e=_0x43016e['replace'](ITALIC_WHOLE_PARAGRAPH,'$1'),_0x43016e!==_0x4e0540&&(_0x59c78d=!0x0),{'text':_0x43016e,'cleaned':_0x59c78d};}export function optimizeFormat(_0x4223f6){const _0x393ce0=_0x48bb,_0x29ac70={'ZvhjJ':function(_0x30710c,_0x22091d){return _0x30710c(_0x22091d);}};if(!_0x4223f6||!_0x4223f6['trim']())return{'text':'','jsonBlocksConverted':0x0,'markdownCleaned':!0x1};const _0x327686=_0x29ac70[_0x393ce0(0x207)](replaceJsonBlocks,_0x4223f6),_0x41a17e=cleanMarkdown(_0x327686[_0x393ce0(0x1ed)]);return{'text':_0x41a17e[_0x393ce0(0x1ed)],'jsonBlocksConverted':_0x327686[_0x393ce0(0x203)],'markdownCleaned':_0x41a17e['cleaned']};}function _0x48bb(_0x1a7a53,_0x67e083){_0x1a7a53=_0x1a7a53-0x1d8;const _0x4f2508=_0x4f25();let _0x48bbd8=_0x4f2508[_0x1a7a53];return _0x48bbd8;}export const formatOptimizerStrategy={'name':_0x10acd5(0x1f3),'compress'(_0x4986e6,_0x205d05={}){const _0x1dcba7=_0x10acd5,_0x12b655={'nWYbi':_0x1dcba7(0x1f3),'JDixq':function(_0x2115c4,_0x597d39){return _0x2115c4(_0x597d39);},'UWvXy':function(_0x20faec,_0x431b0a){return _0x20faec(_0x431b0a);},'fiSFY':function(_0x344494,_0x186303){return _0x344494>_0x186303;}};if(!_0x4986e6||!_0x4986e6['trim']())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x12b655['nWYbi'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x216bbc=countTokens(_0x4986e6),_0x350aaa=_0x12b655[_0x1dcba7(0x1e3)](optimizeFormat,_0x4986e6),_0x49c67f=_0x12b655['UWvXy'](countTokens,_0x350aaa['text']),_0x1fcfdc=_0x12b655['fiSFY'](_0x49c67f,0x0)?_0x216bbc/_0x49c67f:0x1,_0x29a6c8=_0x12b655[_0x1dcba7(0x202)](_0x350aaa[_0x1dcba7(0x1f6)],0x0)?0.92:_0x350aaa[_0x1dcba7(0x1e2)]?0.98:0x1;return{'text':_0x350aaa[_0x1dcba7(0x1ed)],'originalTokens':_0x216bbc,'compressedTokens':_0x49c67f,'compressionRatio':_0x1fcfdc,'strategyUsed':_0x12b655[_0x1dcba7(0x1ff)],'qualityEstimate':_0x29a6c8,'wasTruncated':!0x1};}};
@@ -1 +1 @@
1
- (function(_0x22b088,_0x48fdbc){var _0x311ee4=_0x3ee8,_0x11fa6b=_0x22b088();while(!![]){try{var _0x587158=-parseInt(_0x311ee4(0xcb))/0x1+parseInt(_0x311ee4(0xc8))/0x2+parseInt(_0x311ee4(0xc6))/0x3+-parseInt(_0x311ee4(0xc9))/0x4+parseInt(_0x311ee4(0xc7))/0x5+-parseInt(_0x311ee4(0xc5))/0x6+parseInt(_0x311ee4(0xca))/0x7;if(_0x587158===_0x48fdbc)break;else _0x11fa6b['push'](_0x11fa6b['shift']());}catch(_0x37d6c4){_0x11fa6b['push'](_0x11fa6b['shift']());}}}(_0x5421,0x26a25));export{splitSentences,extractContentWords,STOPWORDS,isStopword}from'./text-utils.js';export{compressRuleBased,ruleBasedStrategy}from'./rule-based.js';export{compressStructural,structuralStrategy}from'./structural.js';export{compressTokenBudget,tokenBudgetStrategy}from'./token-budget.js';function _0x3ee8(_0x3d1dce,_0x4de569){_0x3d1dce=_0x3d1dce-0xc5;var _0x54212a=_0x5421();var _0x3ee8c7=_0x54212a[_0x3d1dce];return _0x3ee8c7;}export{compressChunked,chunkedStrategy}from'./chunked.js';export{estimateQuality,quickQualityScore}from'./quality.js';export{CompressionPipeline,createDefaultPipeline}from'./pipeline.js';function _0x5421(){var _0x54fcb1=['1433580RoipRs','263040dJbEoX','467680dryLap','416706ZzPfeA','876580PGoxgD','3242764tiDvPP','236501gOMQOx'];_0x5421=function(){return _0x54fcb1;};return _0x5421();}
1
+ (function(_0x526e68,_0x50f8a6){var _0x2e5edc=_0x338e,_0xdbf2ac=_0x526e68();while(!![]){try{var _0x2e7d62=parseInt(_0x2e5edc(0x1b4))/0x1*(-parseInt(_0x2e5edc(0x1af))/0x2)+parseInt(_0x2e5edc(0x1b5))/0x3*(parseInt(_0x2e5edc(0x1b7))/0x4)+parseInt(_0x2e5edc(0x1ae))/0x5*(parseInt(_0x2e5edc(0x1b0))/0x6)+-parseInt(_0x2e5edc(0x1ad))/0x7+-parseInt(_0x2e5edc(0x1b2))/0x8*(parseInt(_0x2e5edc(0x1ac))/0x9)+-parseInt(_0x2e5edc(0x1b1))/0xa*(parseInt(_0x2e5edc(0x1b3))/0xb)+parseInt(_0x2e5edc(0x1b6))/0xc;if(_0x2e7d62===_0x50f8a6)break;else _0xdbf2ac['push'](_0xdbf2ac['shift']());}catch(_0x180ee8){_0xdbf2ac['push'](_0xdbf2ac['shift']());}}}(_0x348b,0xa68f3));export{splitSentences,extractContentWords,STOPWORDS,isStopword}from'./text-utils.js';function _0x338e(_0x20ca28,_0x447e24){_0x20ca28=_0x20ca28-0x1ac;var _0x348bf3=_0x348b();var _0x338e48=_0x348bf3[_0x20ca28];return _0x338e48;}export{compressRuleBased,ruleBasedStrategy}from'./rule-based.js';export{compressStructural,structuralStrategy}from'./structural.js';export{compressTokenBudget,tokenBudgetStrategy}from'./token-budget.js';export{compressChunked,chunkedStrategy}from'./chunked.js';export{estimateQuality,quickQualityScore}from'./quality.js';export{CompressionPipeline,createDefaultPipeline}from'./pipeline.js';export{anonymizeText,deanonymizeText,anonymizeStrategy}from'./anonymize.js';export{deduplicateText,dedupStrategy}from'./dedup.js';export{CompressionCache,createCachedPipeline}from'./cache.js';function _0x348b(){var _0x887f3=['640088okudND','584837McvqOa','13WpZHKu','9HwKkml','35728356dCHpkf','496556Yjghsa','9GGolPp','4387775GpqEAK','1215oJhojc','164534EhdpiC','5562OuopND','210RnvphC'];_0x348b=function(){return _0x887f3;};return _0x348b();}export{optimizeFormat,formatOptimizerStrategy}from'./format-optimizer.js';
@@ -1 +1 @@
1
- const _0x203ebb=_0x36c4;function _0x36c4(_0x4ed81a,_0x4bf065){_0x4ed81a=_0x4ed81a-0x19f;const _0x1c7b29=_0x1c7b();let _0x36c456=_0x1c7b29[_0x4ed81a];return _0x36c456;}(function(_0x1956ea,_0x2351ab){const _0xae4127=_0x36c4,_0x21af6a=_0x1956ea();while(!![]){try{const _0x6b20d4=-parseInt(_0xae4127(0x1b9))/0x1+parseInt(_0xae4127(0x1ac))/0x2+parseInt(_0xae4127(0x1a8))/0x3+parseInt(_0xae4127(0x1bc))/0x4+-parseInt(_0xae4127(0x1ae))/0x5+-parseInt(_0xae4127(0x1a0))/0x6*(-parseInt(_0xae4127(0x1af))/0x7)+-parseInt(_0xae4127(0x1a5))/0x8*(parseInt(_0xae4127(0x1b7))/0x9);if(_0x6b20d4===_0x2351ab)break;else _0x21af6a['push'](_0x21af6a['shift']());}catch(_0x6c1187){_0x21af6a['push'](_0x21af6a['shift']());}}}(_0x1c7b,0x56a2e));import{countTokens}from'../../shared/token-counter.js';import{ruleBasedStrategy}from'./rule-based.js';import{structuralStrategy}from'./structural.js';import{tokenBudgetStrategy}from'./token-budget.js';import{quickQualityScore}from'./quality.js';const DEFAULT_TARGET_TOKENS=0x1f4,DEFAULT_MIN_QUALITY=0.8;function buildEmptyPipelineResult(){return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':'pipeline','qualityEstimate':0x1,'wasTruncated':!0x1,'stages':[],'qualityReport':{'overallScore':0x1,'informationRetention':0x1,'structuralIntegrity':0x1,'keyTermPreservation':0x1},'targetMet':!0x0};}function _0x1c7b(){const _0x54007a=['buildFinalResult','compress','wasTruncated','minQuality','push','oCiCM','450BXCgEh','strategies','161748hnXKmQ','now','map','2289448MxncTZ','jsStn','126SpJhZV','targetTokens','JBkco','strategyName','VOzHE','239808HmOhPv','join','xSOtn','1032507HHWJXI','stopOnTarget','text','length','1186774UGhSAl','EZKOu','713155wrOOJY','216041TaffqZ','executeStage'];_0x1c7b=function(){return _0x54007a;};return _0x1c7b();}function buildPassthroughResult(_0x4c0254,_0x27f939){const _0x344ff9={'LEkPl':'pipeline'};return{'text':_0x4c0254,'originalTokens':_0x27f939,'compressedTokens':_0x27f939,'compressionRatio':0x1,'strategyUsed':_0x344ff9['LEkPl'],'qualityEstimate':0x1,'wasTruncated':!0x1,'stages':[],'qualityReport':{'overallScore':0x1,'informationRetention':0x1,'structuralIntegrity':0x1,'keyTermPreservation':0x1},'targetMet':!0x0};}export class CompressionPipeline{['strategies'];[_0x203ebb(0x1a1)];[_0x203ebb(0x1b4)];['stopOnTarget'];constructor(_0x1eb630){const _0x5de4a0=_0x203ebb;this['strategies']=_0x1eb630[_0x5de4a0(0x1b8)],this[_0x5de4a0(0x1a1)]=_0x1eb630['targetTokens']??0x1f4,this[_0x5de4a0(0x1b4)]=_0x1eb630['minQuality']??0.8,this[_0x5de4a0(0x1a9)]=_0x1eb630['stopOnTarget']??!0x0;}[_0x203ebb(0x1b2)](_0x598e77,_0x271e9d){const _0x3a2fe4=_0x203ebb,_0x56ffeb={'iYUbO':function(_0x111530,_0x28f64a){return _0x111530(_0x28f64a);}},_0x2e5fcd=_0x271e9d??this['targetTokens'];if(!_0x598e77||!_0x598e77['trim']())return buildEmptyPipelineResult();const _0x14f74e=_0x598e77,_0x26a84a=_0x56ffeb['iYUbO'](countTokens,_0x598e77);if(_0x26a84a<=_0x2e5fcd)return buildPassthroughResult(_0x598e77,_0x26a84a);const {compressedText:_0x3feb71,stages:_0x3eaa50,wasTruncated:_0x2ea2e1}=this['runStages'](_0x14f74e,_0x26a84a,_0x2e5fcd);return this[_0x3a2fe4(0x1b1)](_0x14f74e,_0x26a84a,_0x3feb71,_0x3eaa50,_0x2ea2e1,_0x2e5fcd);}['runStages'](_0x25e12b,_0x540f6b,_0x407ba6){const _0x2ea761=_0x203ebb,_0x43db77={'oCiCM':function(_0x417bb7,_0xd57b71){return _0x417bb7<=_0xd57b71;},'VOzHE':function(_0x5c6647,_0x577bfb){return _0x5c6647<_0x577bfb;},'EZKOu':function(_0x570609,_0x43a2fa,_0x44d071){return _0x570609(_0x43a2fa,_0x44d071);},'uWgab':function(_0x1206d9,_0x30f8ba){return _0x1206d9>_0x30f8ba;}};let _0x4d6f41=_0x25e12b;const _0xcc9348=[];let _0x86063a=!0x1;for(const _0x1f1ff0 of this[_0x2ea761(0x1b8)]){const _0x2aa601=countTokens(_0x4d6f41);if(this['stopOnTarget']&&_0x43db77[_0x2ea761(0x1b6)](_0x2aa601,_0x407ba6))break;const _0x2d4bd4=this['executeStage'](_0x1f1ff0,_0x4d6f41,_0x407ba6,_0x540f6b);if(_0x43db77[_0x2ea761(0x1a4)](_0x43db77[_0x2ea761(0x1ad)](quickQualityScore,_0x25e12b,_0x2d4bd4['text']),this['minQuality'])&&_0x43db77['uWgab'](_0xcc9348[_0x2ea761(0x1ab)],0x0))break;_0xcc9348[_0x2ea761(0x1b5)](_0x2d4bd4['stageMetrics']),_0x4d6f41=_0x2d4bd4['text'],_0x2d4bd4[_0x2ea761(0x1b3)]&&(_0x86063a=!0x0);}return{'compressedText':_0x4d6f41,'stages':_0xcc9348,'wasTruncated':_0x86063a};}[_0x203ebb(0x1b0)](_0x3b2e7d,_0x135c91,_0x50877a,_0x2c555f){const _0x2705ff=_0x203ebb,_0x35e254={'jsStn':function(_0x14fba8,_0x199572){return _0x14fba8/_0x199572;},'vsQIY':function(_0x1eacba,_0x51796d){return _0x1eacba-_0x51796d;},'EBCDA':function(_0x3f9b42,_0x3016e0){return _0x3f9b42>_0x3016e0;},'JBkco':function(_0x435473,_0x2c59b6){return _0x435473/_0x2c59b6;}},_0x48cce6=countTokens(_0x135c91),_0x195968=performance[_0x2705ff(0x1ba)](),_0x14f402={'maxTokens':_0x50877a,'targetRatio':_0x35e254[_0x2705ff(0x19f)](_0x50877a,_0x2c555f)},_0x40debb=_0x3b2e7d['compress'](_0x135c91,_0x14f402),_0x303f7e=_0x35e254['vsQIY'](performance[_0x2705ff(0x1ba)](),_0x195968);return{'text':_0x40debb[_0x2705ff(0x1aa)],'wasTruncated':_0x40debb[_0x2705ff(0x1b3)],'stageMetrics':{'strategyName':_0x3b2e7d['name'],'inputTokens':_0x48cce6,'outputTokens':_0x40debb['compressedTokens'],'savingsRatio':_0x35e254['EBCDA'](_0x48cce6,0x0)?0x1-_0x35e254[_0x2705ff(0x1a2)](_0x40debb['compressedTokens'],_0x48cce6):0x0,'durationMs':_0x303f7e}};}[_0x203ebb(0x1b1)](_0x15ac1c,_0x58b6e2,_0x598b44,_0x19a283,_0x2a61db,_0x19bfef){const _0x7dda8d=_0x203ebb,_0x1d947a={'xSOtn':function(_0x20658b,_0x18779b){return _0x20658b(_0x18779b);},'miWiJ':function(_0xecd847,_0x347759,_0x51a50d){return _0xecd847(_0x347759,_0x51a50d);},'wBQFD':function(_0x2b9428,_0x256282){return _0x2b9428<=_0x256282;}},_0x2bc096=_0x1d947a[_0x7dda8d(0x1a7)](countTokens,_0x598b44),_0x483ad4=_0x1d947a['miWiJ'](quickQualityScore,_0x15ac1c,_0x598b44);return{'text':_0x598b44,'originalTokens':_0x58b6e2,'compressedTokens':_0x2bc096,'compressionRatio':_0x2bc096>0x0?_0x58b6e2/_0x2bc096:0x1,'strategyUsed':_0x19a283[_0x7dda8d(0x1bb)](_0x3d0f22=>_0x3d0f22[_0x7dda8d(0x1a3)])[_0x7dda8d(0x1a6)]('+'),'qualityEstimate':_0x483ad4,'wasTruncated':_0x2a61db,'stages':_0x19a283,'qualityReport':{'overallScore':_0x483ad4,'informationRetention':_0x483ad4,'structuralIntegrity':_0x483ad4,'keyTermPreservation':_0x483ad4},'targetMet':_0x1d947a['wBQFD'](_0x2bc096,_0x19bfef)};}}export function createDefaultPipeline(_0x377a7e){return new CompressionPipeline({'strategies':[ruleBasedStrategy,structuralStrategy,tokenBudgetStrategy],'targetTokens':_0x377a7e,'minQuality':0.8,'stopOnTarget':!0x0});}
1
+ function _0x31db(_0x2dcf43,_0xa2f0c6){_0x2dcf43=_0x2dcf43-0x157;const _0x113c05=_0x113c();let _0x31db70=_0x113c05[_0x2dcf43];return _0x31db70;}const _0x5386a7=_0x31db;(function(_0x2d93b7,_0xe1be7f){const _0x1d3062=_0x31db,_0x525634=_0x2d93b7();while(!![]){try{const _0x4d23d1=-parseInt(_0x1d3062(0x166))/0x1+parseInt(_0x1d3062(0x16f))/0x2+-parseInt(_0x1d3062(0x16a))/0x3*(-parseInt(_0x1d3062(0x177))/0x4)+parseInt(_0x1d3062(0x160))/0x5*(-parseInt(_0x1d3062(0x161))/0x6)+-parseInt(_0x1d3062(0x15a))/0x7+parseInt(_0x1d3062(0x159))/0x8*(parseInt(_0x1d3062(0x15d))/0x9)+parseInt(_0x1d3062(0x174))/0xa;if(_0x4d23d1===_0xe1be7f)break;else _0x525634['push'](_0x525634['shift']());}catch(_0x5b3f5c){_0x525634['push'](_0x525634['shift']());}}}(_0x113c,0x69f39));import{countTokens}from'../../shared/token-counter.js';import{ruleBasedStrategy}from'./rule-based.js';import{structuralStrategy}from'./structural.js';import{tokenBudgetStrategy}from'./token-budget.js';function _0x113c(){const _0x41e93e=['jWyuf','pipeline','wasTruncated','637605TBIhot','targetTokens','text','YcrlX','213YIAPgQ','name','minQuality','stopOnTarget','push','433530vzvSeE','strategyName','now','zNZSb','map','1335780DPOleA','RKdrS','strategies','10668zQFJsl','compressedTokens','length','stageMetrics','38896fAvjLg','751303gQteik','WBbBu','runStages','1395IlYRcX','LuDWD','ygOKZ','135mutiys','25422BXmioZ','trim'];_0x113c=function(){return _0x41e93e;};return _0x113c();}import{quickQualityScore}from'./quality.js';const DEFAULT_TARGET_TOKENS=0x1f4,DEFAULT_MIN_QUALITY=0.8;function buildEmptyPipelineResult(){const _0x35c668=_0x31db,_0x156940={'RKdrS':_0x35c668(0x164)};return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x156940[_0x35c668(0x175)],'qualityEstimate':0x1,'wasTruncated':!0x1,'stages':[],'qualityReport':{'overallScore':0x1,'informationRetention':0x1,'structuralIntegrity':0x1,'keyTermPreservation':0x1},'targetMet':!0x0};}function buildPassthroughResult(_0x4c5d1f,_0x2f0eff){return{'text':_0x4c5d1f,'originalTokens':_0x2f0eff,'compressedTokens':_0x2f0eff,'compressionRatio':0x1,'strategyUsed':'pipeline','qualityEstimate':0x1,'wasTruncated':!0x1,'stages':[],'qualityReport':{'overallScore':0x1,'informationRetention':0x1,'structuralIntegrity':0x1,'keyTermPreservation':0x1},'targetMet':!0x0};}export class CompressionPipeline{[_0x5386a7(0x176)];[_0x5386a7(0x167)];['minQuality'];['stopOnTarget'];constructor(_0x59b9dd){const _0x83e9ef=_0x5386a7;this[_0x83e9ef(0x176)]=_0x59b9dd[_0x83e9ef(0x176)],this['targetTokens']=_0x59b9dd['targetTokens']??0x1f4,this['minQuality']=_0x59b9dd[_0x83e9ef(0x16c)]??0.8,this[_0x83e9ef(0x16d)]=_0x59b9dd[_0x83e9ef(0x16d)]??!0x0;}['compress'](_0x4a36b6,_0x47d66a){const _0x368b97=_0x5386a7,_0x4713b2={'WBbBu':function(_0x42f60b){return _0x42f60b();}},_0x5dae95=_0x47d66a??this['targetTokens'];if(!_0x4a36b6||!_0x4a36b6[_0x368b97(0x162)]())return _0x4713b2[_0x368b97(0x15b)](buildEmptyPipelineResult);const _0x108c2e=_0x4a36b6,_0x544297=countTokens(_0x4a36b6);if(_0x544297<=_0x5dae95)return buildPassthroughResult(_0x4a36b6,_0x544297);const {compressedText:_0x2979a7,stages:_0x3eb7b8,wasTruncated:_0x477893}=this[_0x368b97(0x15c)](_0x108c2e,_0x544297,_0x5dae95);return this['buildFinalResult'](_0x108c2e,_0x544297,_0x2979a7,_0x3eb7b8,_0x477893,_0x5dae95);}[_0x5386a7(0x15c)](_0x137b70,_0x50e4b5,_0x4462b4){const _0x48ea91=_0x5386a7,_0x44eca8={'lRYyc':function(_0x38585a,_0x2fd702){return _0x38585a<_0x2fd702;},'YcrlX':function(_0x189ed0,_0x366af6,_0x1133a4){return _0x189ed0(_0x366af6,_0x1133a4);},'ygOKZ':function(_0x120414,_0x26d851){return _0x120414>_0x26d851;}};let _0xd742ef=_0x137b70;const _0x150a23=[];let _0x36774c=!0x1;for(const _0x186ae9 of this[_0x48ea91(0x176)]){const _0x1cf7d1=countTokens(_0xd742ef);if(this['stopOnTarget']&&_0x1cf7d1<=_0x4462b4)break;const _0x299138=this['executeStage'](_0x186ae9,_0xd742ef,_0x4462b4,_0x50e4b5);if(_0x44eca8['lRYyc'](_0x44eca8[_0x48ea91(0x169)](quickQualityScore,_0x137b70,_0x299138['text']),this['minQuality'])&&_0x44eca8[_0x48ea91(0x15f)](_0x150a23[_0x48ea91(0x157)],0x0))break;_0x150a23[_0x48ea91(0x16e)](_0x299138[_0x48ea91(0x158)]),_0xd742ef=_0x299138[_0x48ea91(0x168)],_0x299138[_0x48ea91(0x165)]&&(_0x36774c=!0x0);}return{'compressedText':_0xd742ef,'stages':_0x150a23,'wasTruncated':_0x36774c};}['executeStage'](_0x5e3d58,_0x18a49d,_0x19620a,_0x42e2db){const _0x1b8474=_0x5386a7,_0x1346c4={'LuDWD':function(_0x319456,_0x4faf71){return _0x319456/_0x4faf71;}},_0x45e356=countTokens(_0x18a49d),_0x265944=performance[_0x1b8474(0x171)](),_0x8e0fd4={'maxTokens':_0x19620a,'targetRatio':_0x19620a/_0x42e2db},_0x24bc9f=_0x5e3d58['compress'](_0x18a49d,_0x8e0fd4),_0x2c94f9=performance[_0x1b8474(0x171)]()-_0x265944;return{'text':_0x24bc9f[_0x1b8474(0x168)],'wasTruncated':_0x24bc9f[_0x1b8474(0x165)],'stageMetrics':{'strategyName':_0x5e3d58[_0x1b8474(0x16b)],'inputTokens':_0x45e356,'outputTokens':_0x24bc9f[_0x1b8474(0x178)],'savingsRatio':_0x45e356>0x0?0x1-_0x1346c4[_0x1b8474(0x15e)](_0x24bc9f['compressedTokens'],_0x45e356):0x0,'durationMs':_0x2c94f9}};}['buildFinalResult'](_0x4e28a4,_0x435b47,_0x3f79fa,_0x550eb6,_0x36d0c8,_0x772399){const _0x3cf6d0=_0x5386a7,_0x641b53={'jWyuf':function(_0x3ae86a,_0x5c0ba8,_0x598456){return _0x3ae86a(_0x5c0ba8,_0x598456);},'LtTQB':function(_0x3c0fd2,_0xdcb27){return _0x3c0fd2/_0xdcb27;},'zNZSb':function(_0xa058c2,_0x43bb42){return _0xa058c2<=_0x43bb42;}},_0x443fdb=countTokens(_0x3f79fa),_0x263479=_0x641b53[_0x3cf6d0(0x163)](quickQualityScore,_0x4e28a4,_0x3f79fa);return{'text':_0x3f79fa,'originalTokens':_0x435b47,'compressedTokens':_0x443fdb,'compressionRatio':_0x443fdb>0x0?_0x641b53['LtTQB'](_0x435b47,_0x443fdb):0x1,'strategyUsed':_0x550eb6[_0x3cf6d0(0x173)](_0x1f0328=>_0x1f0328[_0x3cf6d0(0x170)])['join']('+'),'qualityEstimate':_0x263479,'wasTruncated':_0x36d0c8,'stages':_0x550eb6,'qualityReport':{'overallScore':_0x263479,'informationRetention':_0x263479,'structuralIntegrity':_0x263479,'keyTermPreservation':_0x263479},'targetMet':_0x641b53[_0x3cf6d0(0x172)](_0x443fdb,_0x772399)};}}export function createDefaultPipeline(_0x1a85f2){return new CompressionPipeline({'strategies':[ruleBasedStrategy,structuralStrategy,tokenBudgetStrategy],'targetTokens':_0x1a85f2,'minQuality':0.8,'stopOnTarget':!0x0});}
@@ -1 +1 @@
1
- (function(_0x4f6a6a,_0x1e7f74){const _0x481c6d=_0x5971,_0x3a515f=_0x4f6a6a();while(!![]){try{const _0x50b976=-parseInt(_0x481c6d(0x1a3))/0x1+parseInt(_0x481c6d(0x1b8))/0x2+parseInt(_0x481c6d(0x1af))/0x3*(parseInt(_0x481c6d(0x1b3))/0x4)+-parseInt(_0x481c6d(0x1b9))/0x5+parseInt(_0x481c6d(0x1a2))/0x6+parseInt(_0x481c6d(0x1bc))/0x7*(-parseInt(_0x481c6d(0x1bb))/0x8)+-parseInt(_0x481c6d(0x1ad))/0x9*(parseInt(_0x481c6d(0x1b5))/0xa);if(_0x50b976===_0x1e7f74)break;else _0x3a515f['push'](_0x3a515f['shift']());}catch(_0x13eb95){_0x3a515f['push'](_0x3a515f['shift']());}}}(_0x235d,0xb68cc));import{extractContentWords,STOPWORDS}from'./text-utils.js';const INFORMATION_RETENTION_WEIGHT=0.4,STRUCTURAL_INTEGRITY_WEIGHT=0.3,KEY_TERM_PRESERVATION_WEIGHT=0.3,MAX_KEY_TERMS=0xa,STRUCTURAL_MARKERS=[{'pattern':/\n\n/g,'weight':0x1},{'pattern':/^[-*]\s/gm,'weight':0x1},{'pattern':/^#{1,6}\s/gm,'weight':0x1},{'pattern':/```/g,'weight':0x1},{'pattern':/\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/g,'weight':0x2},{'pattern':/\d+[.,]?\d*\s*[€$%]/g,'weight':0x2},{'pattern':/\b\d{3,}\b/g,'weight':1.5}];function _0x5971(_0x4df4df,_0x43ae43){_0x4df4df=_0x4df4df-0x1a2;const _0x235d31=_0x235d();let _0x5971d1=_0x235d31[_0x4df4df];return _0x5971d1;}function getContentTerms(_0x5db3b6){const _0x498766=_0x5971,_0x425949={'ECMYb':function(_0x2e24de,_0x2960e4){return _0x2e24de(_0x2960e4);}};return new Set(_0x425949[_0x498766(0x1ab)](extractContentWords,_0x5db3b6)['filter'](_0x3fe649=>!STOPWORDS[_0x498766(0x1bd)](_0x3fe649)));}function measureInformationRetention(_0x5eadaa,_0x3ca664){const _0x50bd8d=_0x5971,_0x2c7765={'alXMX':function(_0x3a32c1,_0x1c36b5){return _0x3a32c1(_0x1c36b5);},'KlNfo':function(_0x4d118a,_0x586dfb){return _0x4d118a(_0x586dfb);},'IZHMX':function(_0x3119c8,_0x447cbe){return _0x3119c8/_0x447cbe;}},_0x253de3=_0x2c7765['alXMX'](getContentTerms,_0x5eadaa);if(0x0===_0x253de3['size'])return 0x1;const _0x3f2347=_0x2c7765['KlNfo'](getContentTerms,_0x3ca664);let _0x339aae=0x0;for(const _0x190ac6 of _0x253de3)_0x3f2347['has'](_0x190ac6)&&_0x339aae++;return _0x2c7765[_0x50bd8d(0x1aa)](_0x339aae,_0x253de3[_0x50bd8d(0x1b4)]);}function measureStructuralIntegrity(_0x38de25,_0x2aaeb3){const _0x4324a9=_0x5971,_0xab3d8={'GDlnQ':function(_0x3d1048,_0x58eb12){return _0x3d1048*_0x58eb12;},'BmJTR':function(_0x488ed2,_0x33a3d7){return _0x488ed2/_0x33a3d7;},'WMCyC':function(_0x139c72,_0x23a66c){return _0x139c72>_0x23a66c;}};let _0x502075=0x0,_0x5b631a=0x0;for(const {pattern:_0x5b7a6d,weight:_0x2bb07b}of STRUCTURAL_MARKERS){const _0x238a94=_0x38de25[_0x4324a9(0x1a9)](_0x5b7a6d),_0x47935c=_0x2aaeb3[_0x4324a9(0x1a9)](_0x5b7a6d);if(_0x238a94&&_0x238a94[_0x4324a9(0x1a5)]>0x0){const _0x35acd1=_0x238a94['length'],_0x3accf1=_0x47935c?.['length']??0x0;_0x502075+=_0x2bb07b,_0x5b631a+=_0xab3d8['GDlnQ'](_0x2bb07b,Math[_0x4324a9(0x1b7)](0x1,_0xab3d8['BmJTR'](_0x3accf1,_0x35acd1)));}}return _0xab3d8['WMCyC'](_0x502075,0x0)?_0x5b631a/_0x502075:0x1;}function measureKeyTermPreservation(_0x1ed89a,_0x2c340a){const _0x45541e=_0x5971,_0x232036={'KeJfR':function(_0x44faed,_0x3226ba){return _0x44faed(_0x3226ba);},'SwXyi':function(_0x2428d0,_0x18c75f){return _0x2428d0===_0x18c75f;},'GgQEm':function(_0xf67c9d,_0x40c21e){return _0xf67c9d+_0x40c21e;},'xoIMZ':function(_0x3bf653,_0x56f0b9){return _0x3bf653===_0x56f0b9;},'OqCdd':function(_0x4922e4,_0x3a4b3e){return _0x4922e4/_0x3a4b3e;}},_0x18237d=_0x232036['KeJfR'](extractContentWords,_0x1ed89a)[_0x45541e(0x1b2)](_0x461dcd=>!STOPWORDS['has'](_0x461dcd));if(_0x232036[_0x45541e(0x1b1)](0x0,_0x18237d['length']))return 0x1;const _0x5503a0={};for(const _0x4cd027 of _0x18237d)_0x5503a0[_0x4cd027]=_0x232036['GgQEm'](_0x5503a0[_0x4cd027]||0x0,0x1);const _0x1920fb=Object['entries'](_0x5503a0)['sort']((_0x38c293,_0x50368a)=>_0x50368a[0x1]-_0x38c293[0x1])[_0x45541e(0x1b0)](0x0,0xa)[_0x45541e(0x1a8)](([_0x41d9c1])=>_0x41d9c1);if(_0x232036['xoIMZ'](0x0,_0x1920fb[_0x45541e(0x1a5)]))return 0x1;const _0x45c859=_0x2c340a[_0x45541e(0x1a6)]();let _0x4f81d1=0x0;for(const _0x274849 of _0x1920fb)_0x45c859[_0x45541e(0x1a4)](_0x274849)&&_0x4f81d1++;return _0x232036['OqCdd'](_0x4f81d1,_0x1920fb['length']);}function _0x235d(){const _0xd3d72d=['209020lDelap','kJbXV','21880LRuBFz','2618tQOLVR','has','6454866bZxSsk','331723zNUWxP','includes','length','toLowerCase','overallScore','map','match','IZHMX','ECMYb','afQWq','21438JTHpoA','nEHuQ','269307cxmOCK','slice','SwXyi','filter','28VbOnwk','size','3510qOxaCN','AQPdN','min','2552058AibItT'];_0x235d=function(){return _0xd3d72d;};return _0x235d();}export function estimateQuality(_0x5ceaf4,_0x37fb1b){const _0x9078c9=_0x5971,_0x3bfcda={'afQWq':function(_0x2df1b3,_0x7f5c7f,_0x314f5f){return _0x2df1b3(_0x7f5c7f,_0x314f5f);},'AQPdN':function(_0x4855aa,_0x4e18e1){return _0x4855aa+_0x4e18e1;},'nYDhM':function(_0x3b25aa,_0x84f3ed){return _0x3b25aa*_0x84f3ed;},'kJbXV':function(_0x596084,_0x3da9a6){return _0x596084*_0x3da9a6;}},_0x56a640=_0x3bfcda[_0x9078c9(0x1ac)](measureInformationRetention,_0x5ceaf4,_0x37fb1b),_0x17fa3f=_0x3bfcda[_0x9078c9(0x1ac)](measureStructuralIntegrity,_0x5ceaf4,_0x37fb1b),_0xa56ce0=measureKeyTermPreservation(_0x5ceaf4,_0x37fb1b);return{'overallScore':_0x3bfcda['AQPdN'](_0x3bfcda[_0x9078c9(0x1b6)](_0x3bfcda['nYDhM'](0.4,_0x56a640),_0x3bfcda[_0x9078c9(0x1ba)](0.3,_0x17fa3f)),0.3*_0xa56ce0),'informationRetention':_0x56a640,'structuralIntegrity':_0x17fa3f,'keyTermPreservation':_0xa56ce0};}export function quickQualityScore(_0x3ac0ed,_0xadc444){const _0x1d0d43=_0x5971,_0x3d1d7d={'nEHuQ':function(_0x552b05,_0x16185c,_0x358ac4){return _0x552b05(_0x16185c,_0x358ac4);}};return _0x3d1d7d[_0x1d0d43(0x1ae)](estimateQuality,_0x3ac0ed,_0xadc444)[_0x1d0d43(0x1a7)];}
1
+ (function(_0x1528bb,_0xa46dc4){const _0x40eac9=_0x100c,_0x49a2ba=_0x1528bb();while(!![]){try{const _0x404aab=-parseInt(_0x40eac9(0x132))/0x1+parseInt(_0x40eac9(0x128))/0x2+-parseInt(_0x40eac9(0x11e))/0x3+parseInt(_0x40eac9(0x131))/0x4+-parseInt(_0x40eac9(0x11c))/0x5+-parseInt(_0x40eac9(0x122))/0x6+-parseInt(_0x40eac9(0x11a))/0x7*(-parseInt(_0x40eac9(0x12b))/0x8);if(_0x404aab===_0xa46dc4)break;else _0x49a2ba['push'](_0x49a2ba['shift']());}catch(_0x5ec1f2){_0x49a2ba['push'](_0x49a2ba['shift']());}}}(_0x468a,0xed43d));import{extractContentWords,STOPWORDS}from'./text-utils.js';const INFORMATION_RETENTION_WEIGHT=0.4,STRUCTURAL_INTEGRITY_WEIGHT=0.3,KEY_TERM_PRESERVATION_WEIGHT=0.3,MAX_KEY_TERMS=0xa,STRUCTURAL_MARKERS=[{'pattern':/\n\n/g,'weight':0x1},{'pattern':/^[-*]\s/gm,'weight':0x1},{'pattern':/^#{1,6}\s/gm,'weight':0x1},{'pattern':/```/g,'weight':0x1},{'pattern':/\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/g,'weight':0x2},{'pattern':/\d+[.,]?\d*\s*[€$%]/g,'weight':0x2},{'pattern':/\b\d{3,}\b/g,'weight':1.5}];function getContentTerms(_0x1fc745){const _0xa97091=_0x100c,_0x18f51a={'mYFQo':function(_0x4ecff7,_0x5efc3e){return _0x4ecff7(_0x5efc3e);}};return new Set(_0x18f51a[_0xa97091(0x130)](extractContentWords,_0x1fc745)['filter'](_0x3235b9=>!STOPWORDS[_0xa97091(0x11f)](_0x3235b9)));}function measureInformationRetention(_0x34128c,_0x1d1ea5){const _0xcb1c47=_0x100c,_0x3fee2a={'HTxst':function(_0x53f8f5,_0xade641){return _0x53f8f5(_0xade641);},'hzhkH':function(_0x55b480,_0x3c4f4d){return _0x55b480/_0x3c4f4d;}},_0x5496bb=_0x3fee2a[_0xcb1c47(0x12d)](getContentTerms,_0x34128c);if(0x0===_0x5496bb['size'])return 0x1;const _0x13a089=_0x3fee2a['HTxst'](getContentTerms,_0x1d1ea5);let _0x153243=0x0;for(const _0x502a48 of _0x5496bb)_0x13a089['has'](_0x502a48)&&_0x153243++;return _0x3fee2a['hzhkH'](_0x153243,_0x5496bb[_0xcb1c47(0x127)]);}function measureStructuralIntegrity(_0x15cd69,_0x119bac){const _0xc3a81a=_0x100c,_0x433b39={'BJsue':function(_0x324703,_0x15b4bf){return _0x324703>_0x15b4bf;},'dCRiP':function(_0x4415f0,_0x15497c){return _0x4415f0*_0x15497c;}};let _0x25b463=0x0,_0x192f48=0x0;for(const {pattern:_0x6832f2,weight:_0x20ec38}of STRUCTURAL_MARKERS){const _0x29b3a7=_0x15cd69['match'](_0x6832f2),_0xe172e1=_0x119bac[_0xc3a81a(0x12e)](_0x6832f2);if(_0x29b3a7&&_0x433b39[_0xc3a81a(0x124)](_0x29b3a7['length'],0x0)){const _0x104562=_0x29b3a7['length'],_0x3f77de=_0xe172e1?.['length']??0x0;_0x25b463+=_0x20ec38,_0x192f48+=_0x433b39['dCRiP'](_0x20ec38,Math['min'](0x1,_0x3f77de/_0x104562));}}return _0x25b463>0x0?_0x192f48/_0x25b463:0x1;}function _0x468a(){const _0x553a62=['HTxst','match','entries','mYFQo','1397860OEwExE','1484710zQlmJF','182rJrmHQ','rFepx','3593310ylfGcU','filter','5695740oBrckQ','has','length','RlmNa','6111204sTunSt','NFgtn','BJsue','includes','slice','size','3167120UDPhsC','map','MHHEs','1279784lTsYkJ','overallScore'];_0x468a=function(){return _0x553a62;};return _0x468a();}function _0x100c(_0x4dde2f,_0x14280b){_0x4dde2f=_0x4dde2f-0x11a;const _0x468ada=_0x468a();let _0x100c83=_0x468ada[_0x4dde2f];return _0x100c83;}function measureKeyTermPreservation(_0x2516e3,_0x447094){const _0x63f194=_0x100c,_0x1a7c4c={'MHHEs':function(_0x2e9ffe,_0x1f0985){return _0x2e9ffe(_0x1f0985);},'RlmNa':function(_0x40265e,_0x4cf444){return _0x40265e===_0x4cf444;}},_0x34865b=_0x1a7c4c[_0x63f194(0x12a)](extractContentWords,_0x2516e3)[_0x63f194(0x11d)](_0x5d05f1=>!STOPWORDS['has'](_0x5d05f1));if(_0x1a7c4c[_0x63f194(0x121)](0x0,_0x34865b[_0x63f194(0x120)]))return 0x1;const _0x1191ec={};for(const _0x370a32 of _0x34865b)_0x1191ec[_0x370a32]=(_0x1191ec[_0x370a32]||0x0)+0x1;const _0x490a82=Object[_0x63f194(0x12f)](_0x1191ec)['sort']((_0x4f4fed,_0x2002f8)=>_0x2002f8[0x1]-_0x4f4fed[0x1])[_0x63f194(0x126)](0x0,0xa)[_0x63f194(0x129)](([_0x1555b5])=>_0x1555b5);if(_0x1a7c4c[_0x63f194(0x121)](0x0,_0x490a82[_0x63f194(0x120)]))return 0x1;const _0x3bf632=_0x447094['toLowerCase']();let _0x519fb9=0x0;for(const _0x12b5d3 of _0x490a82)_0x3bf632[_0x63f194(0x125)](_0x12b5d3)&&_0x519fb9++;return _0x519fb9/_0x490a82['length'];}export function estimateQuality(_0x4b24d6,_0x6a0f7f){const _0x29201e=_0x100c,_0x159884={'rFepx':function(_0x23820a,_0x5d963d){return _0x23820a+_0x5d963d;},'NFgtn':function(_0xccb274,_0x2aedd1){return _0xccb274*_0x2aedd1;}},_0xf3b1a5=measureInformationRetention(_0x4b24d6,_0x6a0f7f),_0x4db17f=measureStructuralIntegrity(_0x4b24d6,_0x6a0f7f),_0x3e03c2=measureKeyTermPreservation(_0x4b24d6,_0x6a0f7f);return{'overallScore':_0x159884[_0x29201e(0x11b)](_0x159884[_0x29201e(0x123)](0.4,_0xf3b1a5)+0.3*_0x4db17f,_0x159884[_0x29201e(0x123)](0.3,_0x3e03c2)),'informationRetention':_0xf3b1a5,'structuralIntegrity':_0x4db17f,'keyTermPreservation':_0x3e03c2};}export function quickQualityScore(_0x3e4150,_0x4e8121){const _0x51e6eb=_0x100c;return estimateQuality(_0x3e4150,_0x4e8121)[_0x51e6eb(0x12c)];}
@@ -1 +1 @@
1
- const _0x1316f7=_0x2db6;(function(_0x5ac8b8,_0x2f6a86){const _0x371b98=_0x2db6,_0x82cdb2=_0x5ac8b8();while(!![]){try{const _0x10e19=-parseInt(_0x371b98(0x1fb))/0x1*(parseInt(_0x371b98(0x1f5))/0x2)+parseInt(_0x371b98(0x1f7))/0x3+parseInt(_0x371b98(0x201))/0x4*(-parseInt(_0x371b98(0x1f6))/0x5)+parseInt(_0x371b98(0x200))/0x6*(-parseInt(_0x371b98(0x1ee))/0x7)+-parseInt(_0x371b98(0x1ef))/0x8*(parseInt(_0x371b98(0x1ff))/0x9)+-parseInt(_0x371b98(0x1f4))/0xa+parseInt(_0x371b98(0x1f8))/0xb*(parseInt(_0x371b98(0x1ed))/0xc);if(_0x10e19===_0x2f6a86)break;else _0x82cdb2['push'](_0x82cdb2['shift']());}catch(_0x4a8246){_0x82cdb2['push'](_0x82cdb2['shift']());}}}(_0x44db,0xeb310));import{countTokens}from'../../shared/token-counter.js';import{isStopword}from'./text-utils.js';const MIN_WORDS_FOR_STOPWORD_REMOVAL=0x1e,BASE_QUALITY_ESTIMATE=0.95,QUALITY_VARIANCE_WEIGHT=0.05,GREETING_START=/^(Sehr\s+geehrte\s+(?:Damen\s+und\s+Herren|Frau|Herr)[^,]*,?\s*|Dear\s+(?:Sir|Madam|Mr|Mrs|Ms)[^,]*,?\s*|Hi\s*,?\s*|Hallo\s*,?\s*|Guten\s+Tag\s*,?\s*|Hello\s*,?\s*)/i,GREETING_END=/\s*(Mit\s+freundlichen\s+Grüßen|Freundliche\s+Grüße|Viele\s+Grüße|Best\s+regards|Kind\s+regards|Sincerely|Regards|Yours\s+(?:truly|faithfully))\s*[.,\s]*$/i,CONTACT_BLOCK=/\n\s*(?:Telefon|Tel\.?|Phone|Fax|Email|E-Mail|Kundennummer|Kd\.?-?Nr\.?):\s*[^\n]+/gi;function stripBoilerplate(_0x4bdf04){const _0x2fc4d9=_0x2db6;let _0x29bd67=_0x4bdf04;return _0x29bd67=_0x29bd67[_0x2fc4d9(0x1fd)](GREETING_START,''),_0x29bd67=_0x29bd67['replace'](GREETING_END,''),_0x29bd67=_0x29bd67[_0x2fc4d9(0x1fd)](CONTACT_BLOCK,''),_0x29bd67;}function _0x44db(){const _0x50c260=['17878850aMstEI','2kjtriF','272105ZZGMvD','1295022DcFhPZ','143jDnwRk','join','removeStopwords','1178579lXRDgl','min','replace','filter','160119ZzYMnT','132aUfLoo','92awxdbo','rule-based','5176428roGWtM','239029zpRcCY','48OhJwhm','split','length','ZQpJb','trim'];_0x44db=function(){return _0x50c260;};return _0x44db();}function normalizeWhitespace(_0x5812b8){let _0x4c13b6=_0x5812b8;return _0x4c13b6=_0x4c13b6['replace'](/ {2,}/g,'\x20'),_0x4c13b6=_0x4c13b6['replace'](/\n{3,}/g,'\x0a\x0a'),_0x4c13b6=_0x4c13b6['replace'](/[ \t]+$/gm,''),_0x4c13b6['trim']();}function removeStopwordsFromText(_0x581314){const _0x34279f=_0x2db6,_0xbb1e8b=_0x581314[_0x34279f(0x1f0)](/\s+/);if(_0xbb1e8b[_0x34279f(0x1f1)]<=0x1e)return _0x581314;return _0xbb1e8b[_0x34279f(0x1fe)](_0x243fc4=>!isStopword(_0x243fc4))[_0x34279f(0x1f9)]('\x20');}function _0x2db6(_0x73ce6d,_0x2f0569){_0x73ce6d=_0x73ce6d-0x1ed;const _0x44dbec=_0x44db();let _0x2db677=_0x44dbec[_0x73ce6d];return _0x2db677;}export function compressRuleBased(_0x188a08,_0x3e6ebe={}){const _0xcf8774=_0x2db6,_0x5540f9={'ZQpJb':function(_0x282e65,_0x4d7201){return _0x282e65(_0x4d7201);},'SeqxW':function(_0x4d1068,_0x514582){return _0x4d1068*_0x514582;}};if(!_0x188a08||!_0x188a08[_0xcf8774(0x1f3)]())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':'rule-based','qualityEstimate':0x1,'wasTruncated':!0x1};const _0x180018=countTokens(_0x188a08);let _0x20f003=stripBoilerplate(_0x188a08[_0xcf8774(0x1f3)]());_0x20f003=_0x5540f9['ZQpJb'](normalizeWhitespace,_0x20f003),(_0x3e6ebe[_0xcf8774(0x1fa)]??!0x0)&&(_0x20f003=_0x5540f9[_0xcf8774(0x1f2)](removeStopwordsFromText,_0x20f003));const _0x12d577=countTokens(_0x20f003);return{'text':_0x20f003,'originalTokens':_0x180018,'compressedTokens':_0x12d577,'compressionRatio':_0x12d577>0x0?_0x180018/_0x12d577:0x1,'strategyUsed':_0xcf8774(0x202),'qualityEstimate':Math[_0xcf8774(0x1fc)](0x1,0.95+_0x5540f9['SeqxW'](_0x12d577/_0x180018,0.05)),'wasTruncated':!0x1};}export const ruleBasedStrategy={'name':_0x1316f7(0x202),'compress':compressRuleBased};
1
+ (function(_0x4645aa,_0x43b2cb){const _0x46bf4c=_0x4d0f,_0x2a57b4=_0x4645aa();while(!![]){try{const _0x44af2f=-parseInt(_0x46bf4c(0xa3))/0x1+-parseInt(_0x46bf4c(0xab))/0x2*(parseInt(_0x46bf4c(0x9c))/0x3)+parseInt(_0x46bf4c(0x9e))/0x4+parseInt(_0x46bf4c(0xac))/0x5+-parseInt(_0x46bf4c(0x9f))/0x6+-parseInt(_0x46bf4c(0xa7))/0x7+parseInt(_0x46bf4c(0xa1))/0x8*(parseInt(_0x46bf4c(0x99))/0x9);if(_0x44af2f===_0x43b2cb)break;else _0x2a57b4['push'](_0x2a57b4['shift']());}catch(_0x44b170){_0x2a57b4['push'](_0x2a57b4['shift']());}}}(_0x4281,0xbbd86));import{countTokens}from'../../shared/token-counter.js';import{isStopword}from'./text-utils.js';const MIN_WORDS_FOR_STOPWORD_REMOVAL=0x1e,BASE_QUALITY_ESTIMATE=0.95,QUALITY_VARIANCE_WEIGHT=0.05,GREETING_START=/^(Sehr\s+geehrte\s+(?:Damen\s+und\s+Herren|Frau|Herr)[^,]*,?\s*|Dear\s+(?:Sir|Madam|Mr|Mrs|Ms)[^,]*,?\s*|Hi\s*,?\s*|Hallo\s*,?\s*|Guten\s+Tag\s*,?\s*|Hello\s*,?\s*)/i,GREETING_END=/\s*(Mit\s+freundlichen\s+Grüßen|Freundliche\s+Grüße|Viele\s+Grüße|Best\s+regards|Kind\s+regards|Sincerely|Regards|Yours\s+(?:truly|faithfully))\s*[.,\s]*$/i,CONTACT_BLOCK=/\n\s*(?:Telefon|Tel\.?|Phone|Fax|Email|E-Mail|Kundennummer|Kd\.?-?Nr\.?):\s*[^\n]+/gi;function stripBoilerplate(_0x1a677d){const _0x28d452=_0x4d0f;let _0x33c35b=_0x1a677d;return _0x33c35b=_0x33c35b[_0x28d452(0xa6)](GREETING_START,''),_0x33c35b=_0x33c35b[_0x28d452(0xa6)](GREETING_END,''),_0x33c35b=_0x33c35b[_0x28d452(0xa6)](CONTACT_BLOCK,''),_0x33c35b;}function _0x4d0f(_0x9b1f6,_0x1626b2){_0x9b1f6=_0x9b1f6-0x99;const _0x428151=_0x4281();let _0x4d0f9a=_0x428151[_0x9b1f6];return _0x4d0f9a;}function normalizeWhitespace(_0x3c2f3a){const _0x2c5573=_0x4d0f;let _0x49b4d8=_0x3c2f3a;return _0x49b4d8=_0x49b4d8[_0x2c5573(0xa6)](/ {2,}/g,'\x20'),_0x49b4d8=_0x49b4d8[_0x2c5573(0xa6)](/\n{3,}/g,'\x0a\x0a'),_0x49b4d8=_0x49b4d8['replace'](/[ \t]+$/gm,''),_0x49b4d8['trim']();}function removeStopwordsFromText(_0x5edb6a){const _0xf5f59e=_0x4d0f,_0xfaa07d={'Wyjwg':function(_0xee6fe4,_0x49eeb1){return _0xee6fe4<=_0x49eeb1;}},_0x262326=_0x5edb6a[_0xf5f59e(0xa2)](/\s+/);if(_0xfaa07d[_0xf5f59e(0xaa)](_0x262326[_0xf5f59e(0x9a)],0x1e))return _0x5edb6a;return _0x262326['filter'](_0x44d6de=>!isStopword(_0x44d6de))[_0xf5f59e(0x9d)]('\x20');}function _0x4281(){const _0x37e9d6=['min','Wyjwg','17392kUtBbl','1677150BIVmwp','3708891nIcNdm','length','rule-based','69JPeKZs','join','5514232fOvqGd','8668608QjiglP','NmbXf','40BZITbx','split','745812wgZJYY','cQyeu','trim','replace','4301367HojvRl','hGDcK'];_0x4281=function(){return _0x37e9d6;};return _0x4281();}export function compressRuleBased(_0x5b804f,_0x23f214={}){const _0x4d3b73=_0x4d0f,_0xd75256={'fNAhE':_0x4d3b73(0x9b),'NmbXf':function(_0x100219,_0x3c6344){return _0x100219(_0x3c6344);},'GFFbB':function(_0x570d11,_0x4d6f64){return _0x570d11(_0x4d6f64);},'HBldF':function(_0x440032,_0xf9fcfb){return _0x440032>_0xf9fcfb;},'hGDcK':function(_0x179bdd,_0x514d7a){return _0x179bdd+_0x514d7a;},'cQyeu':function(_0x5f5324,_0x3cd243){return _0x5f5324/_0x3cd243;}};if(!_0x5b804f||!_0x5b804f[_0x4d3b73(0xa5)]())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0xd75256['fNAhE'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x3547ce=countTokens(_0x5b804f);let _0x9f76b0=_0xd75256[_0x4d3b73(0xa0)](stripBoilerplate,_0x5b804f[_0x4d3b73(0xa5)]());_0x9f76b0=normalizeWhitespace(_0x9f76b0),(_0x23f214['removeStopwords']??!0x0)&&(_0x9f76b0=removeStopwordsFromText(_0x9f76b0));const _0x34067a=_0xd75256['GFFbB'](countTokens,_0x9f76b0);return{'text':_0x9f76b0,'originalTokens':_0x3547ce,'compressedTokens':_0x34067a,'compressionRatio':_0xd75256['HBldF'](_0x34067a,0x0)?_0x3547ce/_0x34067a:0x1,'strategyUsed':'rule-based','qualityEstimate':Math[_0x4d3b73(0xa9)](0x1,_0xd75256[_0x4d3b73(0xa8)](0.95,_0xd75256[_0x4d3b73(0xa4)](_0x34067a,_0x3547ce)*0.05)),'wasTruncated':!0x1};}export const ruleBasedStrategy={'name':'rule-based','compress':compressRuleBased};
@@ -1 +1 @@
1
- (function(_0x2dbc53,_0x326849){const _0x18aacc=_0x5281,_0x3e5114=_0x2dbc53();while(!![]){try{const _0x4549ae=parseInt(_0x18aacc(0x197))/0x1+-parseInt(_0x18aacc(0x1a0))/0x2*(-parseInt(_0x18aacc(0x1a4))/0x3)+parseInt(_0x18aacc(0x18d))/0x4*(-parseInt(_0x18aacc(0x198))/0x5)+-parseInt(_0x18aacc(0x1ac))/0x6*(parseInt(_0x18aacc(0x1ab))/0x7)+-parseInt(_0x18aacc(0x1af))/0x8*(-parseInt(_0x18aacc(0x1a5))/0x9)+-parseInt(_0x18aacc(0x19a))/0xa*(parseInt(_0x18aacc(0x18e))/0xb)+-parseInt(_0x18aacc(0x199))/0xc*(-parseInt(_0x18aacc(0x1a3))/0xd);if(_0x4549ae===_0x326849)break;else _0x3e5114['push'](_0x3e5114['shift']());}catch(_0x4f7093){_0x3e5114['push'](_0x3e5114['shift']());}}}(_0xdb98,0x9aa67));import{countTokens}from'../../shared/token-counter.js';import{splitSentences,extractContentWords,STOPWORDS}from'./text-utils.js';const DEFAULT_TARGET_RATIO=0.45,MIN_EXTRACTIVE_SENTENCES=0x2,MIN_TARGET_TOKENS=0x32,BASE_QUALITY_ESTIMATE=0.85,QUALITY_VARIANCE_WEIGHT=0.15;function computeDocumentFrequency(_0x5d5583){const _0x2f087f=_0x5281,_0x1ae519={'REPpB':function(_0x3996c6,_0x481f5f){return _0x3996c6+_0x481f5f;}},_0x301f25={};for(const _0x97fc0b of _0x5d5583){const _0x171167=new Set(_0x97fc0b);for(const _0x161557 of _0x171167)STOPWORDS[_0x2f087f(0x194)](_0x161557)||(_0x301f25[_0x161557]=_0x1ae519['REPpB'](_0x301f25[_0x161557]||0x0,0x1));}return _0x301f25;}function computeTermFrequency(_0xce800d){const _0x13c963=_0x5281,_0x2fc6e6={'BOxvO':function(_0x5be15c,_0x8ef284){return _0x5be15c+_0x8ef284;}},_0x2bf984={};for(const _0x2a2195 of _0xce800d)STOPWORDS[_0x13c963(0x194)](_0x2a2195)||(_0x2bf984[_0x2a2195]=_0x2fc6e6['BOxvO'](_0x2bf984[_0x2a2195]||0x0,0x1));return _0x2bf984;}function buildTfIdfVector(_0x14b78f,_0x5de799,_0x57d655){const _0x5d6f7f=_0x5281,_0x5b972e={'ClNAY':function(_0x74630d,_0x578a75){return _0x74630d/_0x578a75;},'YbjyT':function(_0x20c7fd,_0x2323e7){return _0x20c7fd*_0x2323e7;}},_0x4fd5d2={};for(const [_0x3151b9,_0x497573]of Object['entries'](_0x14b78f)){const _0x58c032=Math['log'](_0x5b972e['ClNAY'](_0x57d655+0x1,(_0x5de799[_0x3151b9]||0x0)+0x1));_0x4fd5d2[_0x3151b9]=_0x5b972e[_0x5d6f7f(0x1b0)](_0x497573,_0x58c032);}return _0x4fd5d2;}function buildTfIdf(_0x34ca6a){const _0x45db3e=_0x5281,_0x12af1c={'iMVsH':function(_0x10d723,_0x133013){return _0x10d723(_0x133013);}},_0x31c839=_0x34ca6a['length'],_0xdc6b7e=_0x34ca6a[_0x45db3e(0x1a2)](extractContentWords),_0x186dc2=_0x12af1c[_0x45db3e(0x18f)](computeDocumentFrequency,_0xdc6b7e);return _0xdc6b7e[_0x45db3e(0x1a2)](_0x39cb1e=>buildTfIdfVector(computeTermFrequency(_0x39cb1e),_0x186dc2,_0x31c839));}function computeCentroid(_0x53ef5c){const _0x62aa17=_0x5281,_0x1095d8={'wceRt':function(_0x542440,_0x593cf8){return _0x542440+_0x593cf8;},'kcqCn':function(_0x315ac6,_0x2cdea3){return _0x315ac6/_0x2cdea3;}},_0x4e7030={},_0x3d59b4=_0x53ef5c[_0x62aa17(0x190)];for(const _0x2119ed of _0x53ef5c)for(const [_0x594e81,_0x375c69]of Object[_0x62aa17(0x1ae)](_0x2119ed))_0x4e7030[_0x594e81]=_0x1095d8['wceRt'](_0x4e7030[_0x594e81]||0x0,_0x1095d8['kcqCn'](_0x375c69,_0x3d59b4));return _0x4e7030;}function cosineSimilarity(_0x254c09,_0x177e6b){const _0x2d4044=_0x5281,_0x245477={'Szyax':function(_0x3f1f86,_0x4759e2){return _0x3f1f86*_0x4759e2;},'MYHiq':function(_0x4a8e06,_0x46f4cb){return _0x4a8e06/_0x46f4cb;}},_0x363ff7=new Set([...Object['keys'](_0x254c09),...Object[_0x2d4044(0x19b)](_0x177e6b)]);let _0x4b7cf6=0x0,_0x108289=0x0,_0x202bdf=0x0;for(const _0x1978ff of _0x363ff7){const _0xcf695b=_0x254c09[_0x1978ff]||0x0,_0x54cb4c=_0x177e6b[_0x1978ff]||0x0;_0x4b7cf6+=_0xcf695b*_0x54cb4c,_0x108289+=_0x245477[_0x2d4044(0x19e)](_0xcf695b,_0xcf695b),_0x202bdf+=_0x54cb4c*_0x54cb4c;}const _0x396fa9=_0x245477[_0x2d4044(0x19e)](Math[_0x2d4044(0x19f)](_0x108289),Math['sqrt'](_0x202bdf));return _0x396fa9>0x0?_0x245477[_0x2d4044(0x1a7)](_0x4b7cf6,_0x396fa9):0x0;}function selectTopSentences(_0xea2051,_0x211301){const _0x38ef14=_0x5281,_0x23b592=[];let _0x38d579=0x0;for(const _0x449753 of _0xea2051){const _0x19a080=countTokens(_0x449753[_0x38ef14(0x1a9)]);if(!(_0x38d579+_0x19a080<=_0x211301||_0x23b592[_0x38ef14(0x190)]<0x2))break;_0x23b592[_0x38ef14(0x192)]({'index':_0x449753[_0x38ef14(0x195)],'sentence':_0x449753['sentence']}),_0x38d579+=_0x19a080+0x1;}return _0x23b592;}function buildEmptyResult(_0x219ebb){return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x219ebb,'qualityEstimate':0x1,'wasTruncated':!0x1};}function _0x5281(_0x5762b2,_0x2bfd1d){_0x5762b2=_0x5762b2-0x18d;const _0xdb9844=_0xdb98();let _0x5281cb=_0xdb9844[_0x5762b2];return _0x5281cb;}export function compressStructural(_0x4aee55,_0x36f7b4={}){const _0x5d875c=_0x5281,_0x4797ef={'WZNpj':_0x5d875c(0x19d),'zYkKw':function(_0x4a60bf,_0x5e6597){return _0x4a60bf*_0x5e6597;},'SLAcC':function(_0x4f4425,_0x5f0ad2){return _0x4f4425(_0x5f0ad2);},'WfsCk':function(_0x2c12a9,_0x2b506c){return _0x2c12a9+_0x2b506c;},'zOWQN':function(_0x4b04f4,_0x4fb771){return _0x4b04f4/_0x4fb771;}};if(!_0x4aee55||!_0x4aee55[_0x5d875c(0x1a8)]())return buildEmptyResult(_0x4797ef['WZNpj']);const _0xfc999d=countTokens(_0x4aee55),_0x3f02d5=_0x36f7b4['targetRatio']??0.45,_0x3e5a1b=splitSentences(_0x4aee55);if(_0x3e5a1b['length']<=0x2)return{'text':_0x4aee55,'originalTokens':_0xfc999d,'compressedTokens':_0xfc999d,'compressionRatio':0x1,'strategyUsed':_0x4797ef[_0x5d875c(0x196)],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x22e3db=buildTfIdf(_0x3e5a1b),_0x352598=computeCentroid(_0x22e3db),_0x34058d=_0x3e5a1b['map']((_0x16f39e,_0x5291b2)=>({'index':_0x5291b2,'sentence':_0x16f39e,'score':cosineSimilarity(_0x22e3db[_0x5291b2],_0x352598)}));_0x34058d['sort']((_0x3f3c4d,_0x189c43)=>_0x189c43[_0x5d875c(0x193)]-_0x3f3c4d[_0x5d875c(0x193)]);const _0x3b4251=selectTopSentences(_0x34058d,_0x36f7b4['maxTokens']?Math['min'](_0x36f7b4[_0x5d875c(0x191)],Math['floor'](_0x4797ef[_0x5d875c(0x1aa)](_0xfc999d,_0x3f02d5))):Math['max'](0x32,Math[_0x5d875c(0x19c)](_0x4797ef['zYkKw'](_0xfc999d,_0x3f02d5))));_0x3b4251['sort']((_0x3bce51,_0x14ed8a)=>_0x3bce51[_0x5d875c(0x195)]-_0x14ed8a[_0x5d875c(0x195)]);const _0x5cb3cc=_0x3b4251['map'](_0x269550=>_0x269550['sentence'])[_0x5d875c(0x1ad)]('.\x20'),_0x27cacb=_0x4797ef[_0x5d875c(0x1a1)](countTokens,_0x5cb3cc);return{'text':_0x5cb3cc,'originalTokens':_0xfc999d,'compressedTokens':_0x27cacb,'compressionRatio':_0x27cacb>0x0?_0xfc999d/_0x27cacb:0x1,'strategyUsed':_0x4797ef[_0x5d875c(0x196)],'qualityEstimate':Math[_0x5d875c(0x1a6)](0x1,_0x4797ef['WfsCk'](0.85,_0x4797ef[_0x5d875c(0x1aa)](_0x4797ef['zOWQN'](_0x27cacb,_0xfc999d),0.15))),'wasTruncated':!0x0};}export const structuralStrategy={'name':'structural','compress':compressStructural};function _0xdb98(){const _0x3237b7=['Szyax','sqrt','2qVvPNA','SLAcC','map','13rjcpSH','2485452jCpNZG','9ErGvRC','min','MYHiq','trim','sentence','zYkKw','30674aFhFiv','1092ZoFdbS','join','entries','9940760iCaKVA','YbjyT','592tMByrS','1525315TIZPAT','iMVsH','length','maxTokens','push','score','has','index','WZNpj','423794Zngcaq','16325SdZiji','1351716SrxCby','50PGoIMd','keys','floor','structural'];_0xdb98=function(){return _0x3237b7;};return _0xdb98();}
1
+ const _0x25bd93=_0x38a8;(function(_0x27d60a,_0x41c1cb){const _0x1edb68=_0x38a8,_0x4bd41d=_0x27d60a();while(!![]){try{const _0x33638f=parseInt(_0x1edb68(0x1a3))/0x1+-parseInt(_0x1edb68(0x19f))/0x2+-parseInt(_0x1edb68(0x197))/0x3*(parseInt(_0x1edb68(0x1a6))/0x4)+-parseInt(_0x1edb68(0x199))/0x5+parseInt(_0x1edb68(0x1ad))/0x6+parseInt(_0x1edb68(0x194))/0x7+parseInt(_0x1edb68(0x1a8))/0x8;if(_0x33638f===_0x41c1cb)break;else _0x4bd41d['push'](_0x4bd41d['shift']());}catch(_0x141d71){_0x4bd41d['push'](_0x4bd41d['shift']());}}}(_0x4fc3,0x674f6));import{countTokens}from'../../shared/token-counter.js';import{splitSentences,extractContentWords,STOPWORDS}from'./text-utils.js';const DEFAULT_TARGET_RATIO=0.45,MIN_EXTRACTIVE_SENTENCES=0x2,MIN_TARGET_TOKENS=0x32,BASE_QUALITY_ESTIMATE=0.85,QUALITY_VARIANCE_WEIGHT=0.15;function computeDocumentFrequency(_0x35d12b){const _0x260a19={'YSMKi':function(_0x1926cc,_0x1db19b){return _0x1926cc+_0x1db19b;}},_0x2ddd24={};for(const _0x1e94df of _0x35d12b){const _0x5cf33e=new Set(_0x1e94df);for(const _0x563faf of _0x5cf33e)STOPWORDS['has'](_0x563faf)||(_0x2ddd24[_0x563faf]=_0x260a19['YSMKi'](_0x2ddd24[_0x563faf]||0x0,0x1));}return _0x2ddd24;}function computeTermFrequency(_0x27b3bf){const _0x39e615={};for(const _0x166175 of _0x27b3bf)STOPWORDS['has'](_0x166175)||(_0x39e615[_0x166175]=(_0x39e615[_0x166175]||0x0)+0x1);return _0x39e615;}function buildTfIdfVector(_0x361406,_0x45cad2,_0x81b5e7){const _0x292207=_0x38a8,_0x2acd9a={'biSuN':function(_0x5506e4,_0x14269c){return _0x5506e4+_0x14269c;}},_0x517fdf={};for(const [_0x4644e4,_0x4a436b]of Object[_0x292207(0x1a5)](_0x361406)){const _0x76a49c=Math[_0x292207(0x19c)](_0x2acd9a[_0x292207(0x198)](_0x81b5e7,0x1)/((_0x45cad2[_0x4644e4]||0x0)+0x1));_0x517fdf[_0x4644e4]=_0x4a436b*_0x76a49c;}return _0x517fdf;}function _0x38a8(_0x220e89,_0x52c70e){_0x220e89=_0x220e89-0x18c;const _0x4fc375=_0x4fc3();let _0x38a849=_0x4fc375[_0x220e89];return _0x38a849;}function buildTfIdf(_0x3c7a1e){const _0x18205f=_0x38a8,_0x3f8537={'RKYrD':function(_0x269709,_0xdc72c6){return _0x269709(_0xdc72c6);}},_0x21bcba=_0x3c7a1e['length'],_0x1ea6b5=_0x3c7a1e['map'](extractContentWords),_0x331321=_0x3f8537[_0x18205f(0x193)](computeDocumentFrequency,_0x1ea6b5);return _0x1ea6b5[_0x18205f(0x1a2)](_0x49326c=>buildTfIdfVector(computeTermFrequency(_0x49326c),_0x331321,_0x21bcba));}function computeCentroid(_0x36edda){const _0x29f1ec=_0x38a8,_0x49d4ad={'wHshW':function(_0x381cf9,_0x376760){return _0x381cf9/_0x376760;}},_0x1d1def={},_0x653a02=_0x36edda[_0x29f1ec(0x1ac)];for(const _0x79cdee of _0x36edda)for(const [_0x96805b,_0x57df8a]of Object['entries'](_0x79cdee))_0x1d1def[_0x96805b]=(_0x1d1def[_0x96805b]||0x0)+_0x49d4ad['wHshW'](_0x57df8a,_0x653a02);return _0x1d1def;}function cosineSimilarity(_0xfbe740,_0x55afa9){const _0x50e522=_0x38a8,_0x38a199={'mqCon':function(_0x327ab0,_0x29a6ac){return _0x327ab0*_0x29a6ac;},'LPNCD':function(_0x8dab1f,_0x25ebcb){return _0x8dab1f*_0x25ebcb;}},_0x24713a=new Set([...Object['keys'](_0xfbe740),...Object['keys'](_0x55afa9)]);let _0x4015e0=0x0,_0x1e3361=0x0,_0x298444=0x0;for(const _0x12ad00 of _0x24713a){const _0x4e68e1=_0xfbe740[_0x12ad00]||0x0,_0xe6d218=_0x55afa9[_0x12ad00]||0x0;_0x4015e0+=_0x38a199[_0x50e522(0x18e)](_0x4e68e1,_0xe6d218),_0x1e3361+=_0x4e68e1*_0x4e68e1,_0x298444+=_0x38a199[_0x50e522(0x190)](_0xe6d218,_0xe6d218);}const _0x52e5d9=Math[_0x50e522(0x19e)](_0x1e3361)*Math[_0x50e522(0x19e)](_0x298444);return _0x52e5d9>0x0?_0x4015e0/_0x52e5d9:0x0;}function selectTopSentences(_0xa47751,_0x3990b9){const _0x243bfb=_0x38a8,_0x281344={'Zpgqv':function(_0x594dc7,_0x282707){return _0x594dc7(_0x282707);},'YCgRL':function(_0x600ea8,_0x471219){return _0x600ea8<=_0x471219;},'uRxCa':function(_0x4ae2ea,_0x35a540){return _0x4ae2ea+_0x35a540;}},_0x57ca69=[];let _0x7b47b7=0x0;for(const _0x3a4911 of _0xa47751){const _0x32d41c=_0x281344['Zpgqv'](countTokens,_0x3a4911[_0x243bfb(0x18d)]);if(!(_0x281344['YCgRL'](_0x281344[_0x243bfb(0x1a0)](_0x7b47b7,_0x32d41c),_0x3990b9)||_0x57ca69['length']<0x2))break;_0x57ca69[_0x243bfb(0x18f)]({'index':_0x3a4911['index'],'sentence':_0x3a4911[_0x243bfb(0x18d)]}),_0x7b47b7+=_0x281344[_0x243bfb(0x1a0)](_0x32d41c,0x1);}return _0x57ca69;}function _0x4fc3(){const _0x5c0a9f=['index','map','8643RFkaPD','zpAit','entries','4684NCkmgu','score','11359008SnODFF','join','maxTokens','twcYu','length','1043322pYbdkX','sort','sentence','mqCon','push','LPNCD','targetRatio','max','RKYrD','3610341HeQuIE','structural','floor','1959ERuMNF','biSuN','1809840tyViSq','trim','xKyNH','log','min','sqrt','1136760lcsXGL','uRxCa'];_0x4fc3=function(){return _0x5c0a9f;};return _0x4fc3();}function buildEmptyResult(_0x54d795){return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x54d795,'qualityEstimate':0x1,'wasTruncated':!0x1};}export function compressStructural(_0x35c354,_0x1aa03a={}){const _0x10c100=_0x38a8,_0x1beba7={'vEhwc':function(_0x3d6629,_0xe15543){return _0x3d6629<=_0xe15543;},'zpAit':'structural','xKyNH':function(_0x1d727f,_0x23be1c){return _0x1d727f(_0x23be1c);},'twcYu':function(_0x403d7d,_0x43fe42,_0x5f204f){return _0x403d7d(_0x43fe42,_0x5f204f);},'tpMIf':function(_0x26983e,_0x40779d){return _0x26983e(_0x40779d);},'qcBxx':function(_0x3fe971,_0xb1f691){return _0x3fe971+_0xb1f691;}};if(!_0x35c354||!_0x35c354[_0x10c100(0x19a)]())return buildEmptyResult(_0x10c100(0x195));const _0x30f811=countTokens(_0x35c354),_0x3f13a7=_0x1aa03a[_0x10c100(0x191)]??0.45,_0x20fa04=splitSentences(_0x35c354);if(_0x1beba7['vEhwc'](_0x20fa04['length'],0x2))return{'text':_0x35c354,'originalTokens':_0x30f811,'compressedTokens':_0x30f811,'compressionRatio':0x1,'strategyUsed':_0x1beba7[_0x10c100(0x1a4)],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x104a5d=_0x1beba7[_0x10c100(0x19b)](buildTfIdf,_0x20fa04),_0x110aa7=_0x1beba7[_0x10c100(0x19b)](computeCentroid,_0x104a5d),_0x312f58=_0x20fa04['map']((_0xb3a559,_0x3bee6f)=>({'index':_0x3bee6f,'sentence':_0xb3a559,'score':cosineSimilarity(_0x104a5d[_0x3bee6f],_0x110aa7)}));_0x312f58[_0x10c100(0x18c)]((_0x3f53fd,_0x4ebe0a)=>_0x4ebe0a['score']-_0x3f53fd[_0x10c100(0x1a7)]);const _0x42faa7=_0x1beba7[_0x10c100(0x1ab)](selectTopSentences,_0x312f58,_0x1aa03a[_0x10c100(0x1aa)]?Math[_0x10c100(0x19d)](_0x1aa03a[_0x10c100(0x1aa)],Math[_0x10c100(0x196)](_0x30f811*_0x3f13a7)):Math[_0x10c100(0x192)](0x32,Math[_0x10c100(0x196)](_0x30f811*_0x3f13a7)));_0x42faa7['sort']((_0x27c5e7,_0x186ccd)=>_0x27c5e7['index']-_0x186ccd[_0x10c100(0x1a1)]);const _0x1ebe2c=_0x42faa7[_0x10c100(0x1a2)](_0x290940=>_0x290940[_0x10c100(0x18d)])[_0x10c100(0x1a9)]('.\x20'),_0x39b803=_0x1beba7['tpMIf'](countTokens,_0x1ebe2c);return{'text':_0x1ebe2c,'originalTokens':_0x30f811,'compressedTokens':_0x39b803,'compressionRatio':_0x39b803>0x0?_0x30f811/_0x39b803:0x1,'strategyUsed':_0x1beba7[_0x10c100(0x1a4)],'qualityEstimate':Math['min'](0x1,_0x1beba7['qcBxx'](0.85,_0x39b803/_0x30f811*0.15)),'wasTruncated':!0x0};}export const structuralStrategy={'name':_0x25bd93(0x195),'compress':compressStructural};
@@ -1 +1 @@
1
- function _0x4a39(){const _0x31c2f2=['auch','their','can','has','dass','den','ca.','did','about','vs.','u.U.','das','will','trim','not','may','had','50270ikTzEO','muss','length','sind','36898PBdvCj','1022Uypqbs','d.h.','56Azjtbk','ich','were','4576vbdqjt','aber','have','been','should','wird','hat','replaceAll','its','how','Mrs.','mit','45XyqmgZ','whom','hatte','16230mmanUc','der','wir','z.B.','and','eine','evtl.','nicht','165Nmwomq','nur','eines','einer','they','\x00PUNKT\x00','u.a.','filter','oder','haben','und','into','526128LRUJVj','from','35346JSevCi','toLowerCase','bei','Prof.','254243MSbWxk','than','348HZRBVP','here','waren','might','there','werden','dem','replace','for'];_0x4a39=function(){return _0x31c2f2;};return _0x4a39();}function _0x58a9(_0x3e088b,_0x56618b){_0x3e088b=_0x3e088b-0x175;const _0x4a3933=_0x4a39();let _0x58a98b=_0x4a3933[_0x3e088b];return _0x58a98b;}const _0x573050=_0x58a9;(function(_0x3d8d4b,_0x7645f9){const _0xdddfbd=_0x58a9,_0x5b0dac=_0x3d8d4b();while(!![]){try{const _0x874e94=parseInt(_0xdddfbd(0x193))/0x1+-parseInt(_0xdddfbd(0x196))/0x2*(parseInt(_0xdddfbd(0x1a8))/0x3)+-parseInt(_0xdddfbd(0x1bc))/0x4+parseInt(_0xdddfbd(0x1b0))/0x5*(-parseInt(_0xdddfbd(0x1be))/0x6)+parseInt(_0xdddfbd(0x194))/0x7*(-parseInt(_0xdddfbd(0x199))/0x8)+parseInt(_0xdddfbd(0x1a5))/0x9*(parseInt(_0xdddfbd(0x18f))/0xa)+parseInt(_0xdddfbd(0x1c2))/0xb*(parseInt(_0xdddfbd(0x175))/0xc);if(_0x874e94===_0x7645f9)break;else _0x5b0dac['push'](_0x5b0dac['shift']());}catch(_0x528324){_0x5b0dac['push'](_0x5b0dac['shift']());}}}(_0x4a39,0x29d77));const ABBREVIATIONS=['Nr.',_0x573050(0x1ab),'bzw.',_0x573050(0x1b6),'etc.',_0x573050(0x1ae),'Dr.',_0x573050(0x1c1),_0x573050(0x184),'ggf.','inkl.','i.d.R.','o.ä.',_0x573050(0x188),'v.a.',_0x573050(0x195),'e.g.','i.e.',_0x573050(0x187),'Mr.',_0x573050(0x1a3),'Ms.','Jr.','Sr.'],PLACEHOLDER=_0x573050(0x1b5);export function splitSentences(_0xc6676d){const _0x387e05=_0x573050;let _0x12120e=_0xc6676d[_0x387e05(0x17c)](/\s+/g,'\x20')['trim']();for(const _0x11799f of ABBREVIATIONS)_0x12120e=_0x12120e['replaceAll'](_0x11799f,_0x11799f['replaceAll']('.',_0x387e05(0x1b5)));return _0x12120e['split'](/[.!?]\s+|\n+/)['map'](_0xa2a95e=>_0xa2a95e[_0x387e05(0x1a0)](_0x387e05(0x1b5),'.')[_0x387e05(0x18b)]())[_0x387e05(0x1b7)](_0x4efa53=>_0x4efa53[_0x387e05(0x191)]>0x0);}export function extractContentWords(_0x19711e){const _0x28f201=_0x573050;return _0x19711e[_0x28f201(0x1bf)]()['replace'](/[^a-zäöüß\s]/g,'')['split'](/\s+/)[_0x28f201(0x1b7)](_0x3a547b=>_0x3a547b[_0x28f201(0x191)]>=0x3);}export const STOPWORDS=new Set([_0x573050(0x1a9),'die',_0x573050(0x189),_0x573050(0x183),_0x573050(0x17b),'des','ein',_0x573050(0x1ad),_0x573050(0x1b3),_0x573050(0x1b2),_0x573050(0x1ba),_0x573050(0x1b8),_0x573050(0x19a),_0x573050(0x182),'ist',_0x573050(0x192),'war',_0x573050(0x177),_0x573050(0x19e),_0x573050(0x17a),'für','von',_0x573050(0x1a4),_0x573050(0x1c0),'nach','aus','auf','über','unter',_0x573050(0x197),_0x573050(0x1aa),'sie','man',_0x573050(0x1b9),_0x573050(0x19f),_0x573050(0x1a7),'kann',_0x573050(0x190),'können','müssen','sollen','wollen',_0x573050(0x1af),_0x573050(0x17e),_0x573050(0x1b1),'noch','the',_0x573050(0x1ac),_0x573050(0x17d),'are','was',_0x573050(0x198),_0x573050(0x19c),'being',_0x573050(0x19b),_0x573050(0x181),_0x573050(0x18e),'does',_0x573050(0x185),_0x573050(0x18a),'would','could',_0x573050(0x19d),_0x573050(0x18d),_0x573050(0x178),'shall',_0x573050(0x180),'this','that','these','those','with',_0x573050(0x1bd),_0x573050(0x1bb),_0x573050(0x186),_0x573050(0x1c3),'then','them',_0x573050(0x1b4),_0x573050(0x17f),_0x573050(0x179),_0x573050(0x176),'what','which','when','where','who',_0x573050(0x1a6),_0x573050(0x1a2),_0x573050(0x18c),'but',_0x573050(0x1a1)]);export function isStopword(_0x7c2bb){const _0x4e3d3f=_0x573050;return STOPWORDS[_0x4e3d3f(0x181)](_0x7c2bb['toLowerCase']()[_0x4e3d3f(0x17c)](/[.,;:!?()'"'-]/g,''));}
1
+ const _0x28d4bc=_0x490a;(function(_0x4af767,_0xdac122){const _0x48d41c=_0x490a,_0x2e24a9=_0x4af767();while(!![]){try{const _0x169f0c=parseInt(_0x48d41c(0x112))/0x1*(-parseInt(_0x48d41c(0x118))/0x2)+parseInt(_0x48d41c(0xf0))/0x3*(-parseInt(_0x48d41c(0xef))/0x4)+-parseInt(_0x48d41c(0xcf))/0x5+-parseInt(_0x48d41c(0xe5))/0x6*(-parseInt(_0x48d41c(0xe0))/0x7)+parseInt(_0x48d41c(0x10f))/0x8*(parseInt(_0x48d41c(0xfe))/0x9)+-parseInt(_0x48d41c(0xd5))/0xa*(-parseInt(_0x48d41c(0x102))/0xb)+-parseInt(_0x48d41c(0xcd))/0xc*(-parseInt(_0x48d41c(0xd3))/0xd);if(_0x169f0c===_0xdac122)break;else _0x2e24a9['push'](_0x2e24a9['shift']());}catch(_0x531bfc){_0x2e24a9['push'](_0x2e24a9['shift']());}}}(_0x5bcf,0x817a1));const ABBREVIATIONS=['Nr.','z.B.',_0x28d4bc(0x11d),'u.a.','etc.',_0x28d4bc(0x116),_0x28d4bc(0xe7),_0x28d4bc(0x10e),_0x28d4bc(0xe2),'ggf.',_0x28d4bc(0xea),_0x28d4bc(0xf2),'o.ä.',_0x28d4bc(0xe4),'v.a.',_0x28d4bc(0xd1),_0x28d4bc(0x111),'i.e.','vs.','Mr.',_0x28d4bc(0x119),'Ms.',_0x28d4bc(0xce),_0x28d4bc(0xfa)],PLACEHOLDER='\x00PUNKT\x00';function _0x490a(_0xc6d5e6,_0x3d701c){_0xc6d5e6=_0xc6d5e6-0xca;const _0x5bcf57=_0x5bcf();let _0x490aa2=_0x5bcf57[_0xc6d5e6];return _0x490aa2;}export function splitSentences(_0x3d8c33){const _0x2cfa0b=_0x28d4bc,_0x48a6f9={'mBOYw':'\x00PUNKT\x00'};let _0x5bd45c=_0x3d8c33['replace'](/\s+/g,'\x20')['trim']();for(const _0x123286 of ABBREVIATIONS)_0x5bd45c=_0x5bd45c[_0x2cfa0b(0xe1)](_0x123286,_0x123286['replaceAll']('.',_0x48a6f9['mBOYw']));return _0x5bd45c['split'](/[.!?]\s+|\n+/)['map'](_0x383b52=>_0x383b52['replaceAll'](_0x2cfa0b(0xcb),'.')['trim']())[_0x2cfa0b(0xe6)](_0x39d61c=>_0x39d61c['length']>0x0);}export function extractContentWords(_0x3fc83b){return _0x3fc83b['toLowerCase']()['replace'](/[^a-zäöüß\s]/g,'')['split'](/\s+/)['filter'](_0x17069c=>_0x17069c['length']>=0x3);}export const STOPWORDS=new Set([_0x28d4bc(0xfc),_0x28d4bc(0xcc),_0x28d4bc(0x108),_0x28d4bc(0x110),_0x28d4bc(0xed),_0x28d4bc(0xe3),_0x28d4bc(0xe9),_0x28d4bc(0x11c),_0x28d4bc(0xf5),'eines',_0x28d4bc(0xd8),'oder',_0x28d4bc(0xd0),_0x28d4bc(0x107),'ist',_0x28d4bc(0x10c),'war','waren','wird','werden',_0x28d4bc(0xe8),_0x28d4bc(0xdc),_0x28d4bc(0x114),_0x28d4bc(0xf4),_0x28d4bc(0x104),'aus','auf',_0x28d4bc(0x100),_0x28d4bc(0xf6),'ich',_0x28d4bc(0x106),'sie','man','haben','hat','hatte','kann',_0x28d4bc(0x10b),_0x28d4bc(0x105),_0x28d4bc(0x109),'sollen','wollen',_0x28d4bc(0xff),_0x28d4bc(0x11b),'nur',_0x28d4bc(0xd4),'the',_0x28d4bc(0xeb),'for',_0x28d4bc(0x113),'was','were',_0x28d4bc(0xda),'being',_0x28d4bc(0xd7),_0x28d4bc(0x10a),_0x28d4bc(0xf7),'does',_0x28d4bc(0xf3),'will',_0x28d4bc(0xee),_0x28d4bc(0xdf),_0x28d4bc(0x101),_0x28d4bc(0x103),_0x28d4bc(0xdd),_0x28d4bc(0xf1),'can',_0x28d4bc(0x117),'that',_0x28d4bc(0xd2),'those','with',_0x28d4bc(0xfb),_0x28d4bc(0xec),_0x28d4bc(0xdb),_0x28d4bc(0x115),'then','them',_0x28d4bc(0x10d),_0x28d4bc(0x11a),'there',_0x28d4bc(0xca),_0x28d4bc(0xd9),'which',_0x28d4bc(0xfd),_0x28d4bc(0xf9),'who','whom','how',_0x28d4bc(0xde),'but',_0x28d4bc(0xf8)]);function _0x5bcf(){const _0x5ca5cc=['have','und','what','been','about','von','might','not','could','14wpPZqJ','replaceAll','ca.','des','u.U.','643686JGvHQw','filter','Dr.','für','ein','inkl.','and','into','dem','would','4BlehJN','32793VODuFw','shall','i.d.R.','did','bei','einer','unter','had','its','where','Sr.','from','der','when','9XbAJso','nicht','über','should','708158ywsRMe','may','nach','können','wir','dass','das','müssen','has','muss','sind','they','Prof.','1176184FhuaAN','den','e.g.','1RGEHWJ','are','mit','than','evtl.','this','410932iJvYfd','Mrs.','their','auch','eine','bzw.','here','\x00PUNKT\x00','die','875820yjTDFj','Jr.','3589420VMpwwA','aber','d.h.','these','13uSXVCA','noch','160iqZAiF','replace'];_0x5bcf=function(){return _0x5ca5cc;};return _0x5bcf();}export function isStopword(_0x17ff7b){const _0x265058=_0x28d4bc;return STOPWORDS[_0x265058(0x10a)](_0x17ff7b['toLowerCase']()[_0x265058(0xd6)](/[.,;:!?()'"'-]/g,''));}
@@ -1 +1 @@
1
- const _0x56e43f=_0x3b57;(function(_0x134ebb,_0x8560c2){const _0x206fa4=_0x3b57,_0x496a8f=_0x134ebb();while(!![]){try{const _0x3ad99e=parseInt(_0x206fa4(0x1fb))/0x1*(parseInt(_0x206fa4(0x1e7))/0x2)+-parseInt(_0x206fa4(0x1e0))/0x3*(-parseInt(_0x206fa4(0x1f6))/0x4)+-parseInt(_0x206fa4(0x1f1))/0x5*(-parseInt(_0x206fa4(0x1e3))/0x6)+-parseInt(_0x206fa4(0x1df))/0x7*(-parseInt(_0x206fa4(0x1fa))/0x8)+parseInt(_0x206fa4(0x1ea))/0x9*(parseInt(_0x206fa4(0x1f4))/0xa)+parseInt(_0x206fa4(0x1f7))/0xb+-parseInt(_0x206fa4(0x1e9))/0xc*(parseInt(_0x206fa4(0x1f2))/0xd);if(_0x3ad99e===_0x8560c2)break;else _0x496a8f['push'](_0x496a8f['shift']());}catch(_0x210933){_0x496a8f['push'](_0x496a8f['shift']());}}}(_0x168f,0x27150));import{countTokens}from'../../shared/token-counter.js';import{splitSentences}from'./text-utils.js';const DEFAULT_TARGET_TOKENS=0x64,MIN_QUALITY_FLOOR=0.5,QUALITY_POSITION_BONUS=0.3;function computeUCurveScore(_0x46fa11,_0x563a64){const _0x302056=_0x3b57,_0x33719b={'qCNhL':function(_0x585f2c,_0x21e4e1){return _0x585f2c/_0x21e4e1;},'gyXUS':function(_0x4333d1,_0x2e619c){return _0x4333d1+_0x2e619c;}};if(_0x563a64<=0x1)return 0x1;const _0x2f36c8=_0x33719b[_0x302056(0x1e8)](_0x33719b[_0x302056(0x1ee)](_0x46fa11,0x1),_0x563a64);return 0x2*Math['max'](_0x2f36c8,0x1-_0x2f36c8);}function truncateSingleSentence(_0x165c74,_0x16c78f,_0x21c40d){const _0x5d6f96=_0x3b57,_0x30888d={'xvcWM':function(_0x1ea4a1,_0x5ae027){return _0x1ea4a1+_0x5ae027;},'Gvdbo':function(_0x51ef6a,_0x542504){return _0x51ef6a>_0x542504;},'fbudH':function(_0x432a13,_0x319616){return _0x432a13/_0x319616;}},_0x165c68=_0x165c74['split'](/\s+/);let _0x5ab7d0='';for(const _0x139984 of _0x165c68){const _0xfb3d06=_0x5ab7d0?_0x30888d[_0x5d6f96(0x1e4)](_0x5ab7d0,'\x20')+_0x139984:_0x139984;if(_0x30888d['Gvdbo'](countTokens(_0xfb3d06),_0x21c40d))break;_0x5ab7d0=_0xfb3d06;}const _0x308715=countTokens(_0x5ab7d0);return{'text':_0x5ab7d0,'originalTokens':_0x16c78f,'compressedTokens':_0x308715,'compressionRatio':_0x308715>0x0?_0x30888d[_0x5d6f96(0x1e1)](_0x16c78f,_0x308715):0x1,'strategyUsed':'token-budget','qualityEstimate':_0x308715/_0x16c78f,'wasTruncated':!0x0};}function _0x3b57(_0x54f70f,_0x9c7d39){_0x54f70f=_0x54f70f-0x1df;const _0x168f53=_0x168f();let _0x3b57bc=_0x168f53[_0x54f70f];return _0x3b57bc;}function _0x168f(){const _0x29c240=['max','382000aCMuJh','2rrFpeP','7qCfxar','129bvdPax','fbudH','score','298938aQEoVc','xvcWM','join','length','57158WxZagY','qCNhL','888txmrEQ','162wxeDMi','maxTokens','tokens','FbdWG','gyXUS','map','sort','15SiDjNg','117663TlBiyJ','sentence','172610dBVzqU','token-budget','4228MLZkLV','2412608fLqJQa','index'];_0x168f=function(){return _0x29c240;};return _0x168f();}function selectSentencesByBudget(_0x284cbb,_0x45aba8){const _0x3215ac=_0x3b57,_0x193c02={'dMObi':function(_0x5d0f02,_0x285132){return _0x5d0f02+_0x285132;}},_0x46519c=[];let _0x5240b0=0x0;for(const _0x1eb155 of _0x284cbb)(_0x193c02['dMObi'](_0x5240b0,_0x1eb155['tokens'])<=_0x45aba8||0x0===_0x46519c[_0x3215ac(0x1e6)])&&(_0x46519c['push']({'index':_0x1eb155[_0x3215ac(0x1f8)],'sentence':_0x1eb155['sentence']}),_0x5240b0+=_0x193c02['dMObi'](_0x1eb155[_0x3215ac(0x1ec)],0x1));return _0x46519c;}export function compressTokenBudget(_0x2674e1,_0x3419fd={}){const _0x50e985=_0x3b57,_0x22c558={'jsYRh':_0x50e985(0x1f5),'HmdrA':function(_0x503c74,_0x5f0a2c){return _0x503c74(_0x5f0a2c);},'FbdWG':function(_0x396e9c,_0x4e1540){return _0x396e9c>_0x4e1540;},'jxnLx':function(_0x2d24e9,_0xff4aeb){return _0x2d24e9/_0xff4aeb;}};if(!_0x2674e1||!_0x2674e1['trim']())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x22c558['jsYRh'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x7195e7=countTokens(_0x2674e1),_0x2f8d4e=_0x3419fd[_0x50e985(0x1eb)]??0x64;if(_0x7195e7<=_0x2f8d4e)return{'text':_0x2674e1,'originalTokens':_0x7195e7,'compressedTokens':_0x7195e7,'compressionRatio':0x1,'strategyUsed':_0x22c558['jsYRh'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x253de1=splitSentences(_0x2674e1);if(_0x253de1[_0x50e985(0x1e6)]<=0x1)return truncateSingleSentence(_0x2674e1,_0x7195e7,_0x2f8d4e);const _0x1bf74c=!0x1!==_0x3419fd['preserveStructure'],_0x19acd7=_0x253de1['length'],_0x2c1596=_0x253de1[_0x50e985(0x1ef)]((_0x41e41c,_0x71c759)=>({'index':_0x71c759,'sentence':_0x41e41c,'tokens':countTokens(_0x41e41c),'score':_0x1bf74c?computeUCurveScore(_0x71c759,_0x19acd7):0x1}));_0x2c1596[_0x50e985(0x1f0)]((_0x56f494,_0x463bca)=>_0x463bca['score']-_0x56f494[_0x50e985(0x1e2)]);const _0x3e046a=selectSentencesByBudget(_0x2c1596,_0x2f8d4e);_0x3e046a[_0x50e985(0x1f0)]((_0x559b59,_0x1f530c)=>_0x559b59[_0x50e985(0x1f8)]-_0x1f530c['index']);const _0x3c8337=_0x3e046a[_0x50e985(0x1ef)](_0xe34fcd=>_0xe34fcd[_0x50e985(0x1f3)])[_0x50e985(0x1e5)]('.\x20'),_0x298aab=_0x22c558['HmdrA'](countTokens,_0x3c8337);return{'text':_0x3c8337,'originalTokens':_0x7195e7,'compressedTokens':_0x298aab,'compressionRatio':_0x22c558[_0x50e985(0x1ed)](_0x298aab,0x0)?_0x7195e7/_0x298aab:0x1,'strategyUsed':_0x22c558['jsYRh'],'qualityEstimate':Math[_0x50e985(0x1f9)](0.5,Math['min'](0x1,_0x22c558['jxnLx'](_0x298aab,_0x7195e7)+0.3)),'wasTruncated':!0x0};}export const tokenBudgetStrategy={'name':_0x56e43f(0x1f5),'compress':compressTokenBudget};
1
+ function _0x1d71(){const _0x487984=['niMvS','8yDQrmo','length','2000ZsorGj','1908696VWAkWw','split','min','max','21593493iKRUGP','trim','365745NMBuFW','AuxcQ','tptVq','push','39088KTLiCP','26022sxccuW','GHqvP','token-budget','apPBo','score','hgQRg','Zieqa','map','izpQp','6772400BHAHMj','tokens','474295bODJRx','inHso','vgmKt','index','sort'];_0x1d71=function(){return _0x487984;};return _0x1d71();}(function(_0x27d0e0,_0x81e61a){const _0x2a0616=_0x29bd,_0x144674=_0x27d0e0();while(!![]){try{const _0x3d7aa0=-parseInt(_0x2a0616(0x183))/0x1+-parseInt(_0x2a0616(0x16d))/0x2+-parseInt(_0x2a0616(0x173))/0x3+-parseInt(_0x2a0616(0x181))/0x4+-parseInt(_0x2a0616(0x18b))/0x5*(-parseInt(_0x2a0616(0x178))/0x6)+parseInt(_0x2a0616(0x177))/0x7+parseInt(_0x2a0616(0x189))/0x8*(parseInt(_0x2a0616(0x171))/0x9);if(_0x3d7aa0===_0x81e61a)break;else _0x144674['push'](_0x144674['shift']());}catch(_0x4af798){_0x144674['push'](_0x144674['shift']());}}}(_0x1d71,0xdac03));import{countTokens}from'../../shared/token-counter.js';import{splitSentences}from'./text-utils.js';const DEFAULT_TARGET_TOKENS=0x64,MIN_QUALITY_FLOOR=0.5,QUALITY_POSITION_BONUS=0.3;function computeUCurveScore(_0x8c5bf1,_0x17aaa4){const _0x3dd817=_0x29bd,_0x2fa98b={'hgQRg':function(_0x69ab65,_0x1c9828){return _0x69ab65<=_0x1c9828;},'vgmKt':function(_0x178ffb,_0x2f9ca8){return _0x178ffb-_0x2f9ca8;}};if(_0x2fa98b[_0x3dd817(0x17d)](_0x17aaa4,0x1))return 0x1;const _0x2fbe03=(_0x8c5bf1+0x1)/_0x17aaa4;return 0x2*Math['max'](_0x2fbe03,_0x2fa98b[_0x3dd817(0x185)](0x1,_0x2fbe03));}function truncateSingleSentence(_0x51d919,_0x1b7ff1,_0x3ac1c0){const _0x5acf22=_0x29bd,_0xd78177={'vZDkm':function(_0x2520f8,_0x40d222){return _0x2520f8>_0x40d222;},'apPBo':function(_0x2a3b5e,_0x399d9c){return _0x2a3b5e(_0x399d9c);},'niMvS':function(_0x241704,_0x4c66e3){return _0x241704/_0x4c66e3;},'Xbfut':_0x5acf22(0x17a)},_0x5e06ab=_0x51d919[_0x5acf22(0x16e)](/\s+/);let _0x5ce4ac='';for(const _0x22f324 of _0x5e06ab){const _0x369066=_0x5ce4ac?_0x5ce4ac+'\x20'+_0x22f324:_0x22f324;if(_0xd78177['vZDkm'](_0xd78177[_0x5acf22(0x17b)](countTokens,_0x369066),_0x3ac1c0))break;_0x5ce4ac=_0x369066;}const _0x22f8c8=_0xd78177['apPBo'](countTokens,_0x5ce4ac);return{'text':_0x5ce4ac,'originalTokens':_0x1b7ff1,'compressedTokens':_0x22f8c8,'compressionRatio':_0x22f8c8>0x0?_0xd78177[_0x5acf22(0x188)](_0x1b7ff1,_0x22f8c8):0x1,'strategyUsed':_0xd78177['Xbfut'],'qualityEstimate':_0x22f8c8/_0x1b7ff1,'wasTruncated':!0x0};}function selectSentencesByBudget(_0x4ee43b,_0x44c02d){const _0x590166=_0x29bd,_0x18b70f={'Zieqa':function(_0x3ad4e8,_0x28153f){return _0x3ad4e8+_0x28153f;}},_0x42ac79=[];let _0x25fc81=0x0;for(const _0xa5dddd of _0x4ee43b)(_0x18b70f['Zieqa'](_0x25fc81,_0xa5dddd[_0x590166(0x182)])<=_0x44c02d||0x0===_0x42ac79[_0x590166(0x18a)])&&(_0x42ac79[_0x590166(0x176)]({'index':_0xa5dddd['index'],'sentence':_0xa5dddd['sentence']}),_0x25fc81+=_0x18b70f[_0x590166(0x17e)](_0xa5dddd[_0x590166(0x182)],0x1));return _0x42ac79;}export function compressTokenBudget(_0x54c94c,_0xf19c5f={}){const _0x3b1f18=_0x29bd,_0x213879={'GHqvP':function(_0x2ab167,_0xb5fa82){return _0x2ab167(_0xb5fa82);},'AuxcQ':function(_0x823de8,_0x5bac63){return _0x823de8<=_0x5bac63;},'izpQp':'token-budget','yqxNF':function(_0x43db3a,_0x246d33){return _0x43db3a!==_0x246d33;},'ggstt':function(_0xf0dc73,_0x3a0a7b){return _0xf0dc73(_0x3a0a7b);},'inHso':function(_0x2a63a8,_0x320da2){return _0x2a63a8>_0x320da2;},'tptVq':function(_0x5d01ba,_0x10ae92){return _0x5d01ba/_0x10ae92;}};if(!_0x54c94c||!_0x54c94c[_0x3b1f18(0x172)]())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x3b1f18(0x17a),'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x16121c=_0x213879['GHqvP'](countTokens,_0x54c94c),_0x12ece8=_0xf19c5f['maxTokens']??0x64;if(_0x213879[_0x3b1f18(0x174)](_0x16121c,_0x12ece8))return{'text':_0x54c94c,'originalTokens':_0x16121c,'compressedTokens':_0x16121c,'compressionRatio':0x1,'strategyUsed':_0x213879[_0x3b1f18(0x180)],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x2842e8=_0x213879[_0x3b1f18(0x179)](splitSentences,_0x54c94c);if(_0x2842e8[_0x3b1f18(0x18a)]<=0x1)return truncateSingleSentence(_0x54c94c,_0x16121c,_0x12ece8);const _0x5ece78=_0x213879['yqxNF'](!0x1,_0xf19c5f['preserveStructure']),_0x20e5ed=_0x2842e8['length'],_0x89d649=_0x2842e8[_0x3b1f18(0x17f)]((_0x47a1ec,_0xb10900)=>({'index':_0xb10900,'sentence':_0x47a1ec,'tokens':countTokens(_0x47a1ec),'score':_0x5ece78?computeUCurveScore(_0xb10900,_0x20e5ed):0x1}));_0x89d649[_0x3b1f18(0x187)]((_0x153326,_0x1357c4)=>_0x1357c4[_0x3b1f18(0x17c)]-_0x153326['score']);const _0x35b368=selectSentencesByBudget(_0x89d649,_0x12ece8);_0x35b368['sort']((_0x5c8869,_0x50d09e)=>_0x5c8869[_0x3b1f18(0x186)]-_0x50d09e[_0x3b1f18(0x186)]);const _0x5e3b7d=_0x35b368['map'](_0x11b34a=>_0x11b34a['sentence'])['join']('.\x20'),_0x1a411b=_0x213879['ggstt'](countTokens,_0x5e3b7d);return{'text':_0x5e3b7d,'originalTokens':_0x16121c,'compressedTokens':_0x1a411b,'compressionRatio':_0x213879[_0x3b1f18(0x184)](_0x1a411b,0x0)?_0x16121c/_0x1a411b:0x1,'strategyUsed':_0x3b1f18(0x17a),'qualityEstimate':Math[_0x3b1f18(0x170)](0.5,Math[_0x3b1f18(0x16f)](0x1,_0x213879[_0x3b1f18(0x175)](_0x1a411b,_0x16121c)+0.3)),'wasTruncated':!0x0};}function _0x29bd(_0x460c17,_0x1a7cfd){_0x460c17=_0x460c17-0x16d;const _0x1d7184=_0x1d71();let _0x29bd5e=_0x1d7184[_0x460c17];return _0x29bd5e;}export const tokenBudgetStrategy={'name':'token-budget','compress':compressTokenBudget};
@@ -1 +1 @@
1
- function _0x5829(){const _0x1785b1=['gpt-4o','model','rules','1030195vQkGxa','9gEanEC','provider','claude-sonnet-4-20250514','2230488RDFVoW','includes','https://api.simosphere.ai/v1/meter','qRCko','15443400JKYDVU','3259016FoFalK','10fMImRP','version','join','5116405GwsVoE','tokenizer-speedup.yaml','1600227CwKrOn','4920636jhOKeY','2JvEzLz'];_0x5829=function(){return _0x1785b1;};return _0x5829();}const _0x36d15e=_0x52e4;(function(_0x3b4033,_0x150917){const _0x1a18ca=_0x52e4,_0x2426d8=_0x3b4033();while(!![]){try{const _0x37a54b=-parseInt(_0x1a18ca(0xc3))/0x1*(parseInt(_0x1a18ca(0xbf))/0x2)+-parseInt(_0x1a18ca(0xbd))/0x3+parseInt(_0x1a18ca(0xc7))/0x4*(parseInt(_0x1a18ca(0xb8))/0x5)+-parseInt(_0x1a18ca(0xbe))/0x6+parseInt(_0x1a18ca(0xbb))/0x7+-parseInt(_0x1a18ca(0xb7))/0x8+parseInt(_0x1a18ca(0xc4))/0x9*(parseInt(_0x1a18ca(0xb6))/0xa);if(_0x37a54b===_0x150917)break;else _0x2426d8['push'](_0x2426d8['shift']());}catch(_0x3e18fa){_0x2426d8['push'](_0x2426d8['shift']());}}}(_0x5829,0x92574));import{readFileSync}from'node:fs';import{join}from'node:path';import _0x33afb7 from'js-yaml';import'../shared/providers/claude-provider.js';function _0x52e4(_0xae2ec1,_0xbbdf99){_0xae2ec1=_0xae2ec1-0xb5;const _0x58294d=_0x5829();let _0x52e4cb=_0x58294d[_0xae2ec1];return _0x52e4cb;}import'../shared/providers/openai-provider.js';import{listProviders}from'../shared/token-provider.js';const CONFIG_FILENAME=_0x36d15e(0xbc);export const DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320};export const DEFAULT_METERING={'endpoint':_0x36d15e(0xc9),'batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x3a8392){const _0x3b79a7=_0x36d15e,_0x10d8f0={'xfmYg':'number','xPZXd':'claude','qRCko':function(_0x4c0164){return _0x4c0164();}},_0x48c75c=_0x33afb7['load'](_0x3a8392);if(!_0x48c75c||_0x10d8f0['xfmYg']!=typeof _0x48c75c[_0x3b79a7(0xb9)])throw new Error('Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field');const _0x322cbc=_0x48c75c[_0x3b79a7(0xc5)]??'claude',_0x5cd8b3=_0x48c75c[_0x3b79a7(0xc1)]??(_0x10d8f0['xPZXd']===_0x322cbc?_0x3b79a7(0xc6):_0x3b79a7(0xc0)),_0x473972=_0x10d8f0[_0x3b79a7(0xb5)](listProviders);if(!_0x473972[_0x3b79a7(0xc8)](_0x322cbc))throw new Error('Unknown\x20provider:\x20'+_0x322cbc+'.\x20Known:\x20'+_0x473972[_0x3b79a7(0xba)](',\x20'));const _0x564cdf=Array['isArray'](_0x48c75c[_0x3b79a7(0xc2)])?_0x48c75c[_0x3b79a7(0xc2)]:[],_0x2eb753=_0x48c75c['context_limits']??DEFAULT_LIMITS,_0xfe8d21=_0x48c75c['metering']??DEFAULT_METERING;return{'version':_0x48c75c[_0x3b79a7(0xb9)],'provider':_0x322cbc,'model':_0x5cd8b3,'rules':_0x564cdf,'context_limits':_0x2eb753,'metering':_0xfe8d21};}export function loadConfigFromString(_0x3299ef){return parseConfig(_0x3299ef);}export function loadConfig(_0x394d43){const _0x39adda={'fFSyX':function(_0x222f43,_0x10de37,_0x59a252){return _0x222f43(_0x10de37,_0x59a252);},'YwfIw':'utf-8'},_0x203e3b=join(_0x394d43,CONFIG_FILENAME);return parseConfig(_0x39adda['fFSyX'](readFileSync,_0x203e3b,_0x39adda['YwfIw']));}
1
+ (function(_0x3df4b6,_0x1cddb6){const _0x21c3d7=_0x5987,_0x2cfae5=_0x3df4b6();while(!![]){try{const _0xda5b96=-parseInt(_0x21c3d7(0x14c))/0x1*(-parseInt(_0x21c3d7(0x13f))/0x2)+parseInt(_0x21c3d7(0x147))/0x3*(parseInt(_0x21c3d7(0x149))/0x4)+parseInt(_0x21c3d7(0x142))/0x5*(parseInt(_0x21c3d7(0x145))/0x6)+-parseInt(_0x21c3d7(0x14d))/0x7*(-parseInt(_0x21c3d7(0x14a))/0x8)+parseInt(_0x21c3d7(0x13e))/0x9+-parseInt(_0x21c3d7(0x13d))/0xa+-parseInt(_0x21c3d7(0x13b))/0xb*(parseInt(_0x21c3d7(0x144))/0xc);if(_0xda5b96===_0x1cddb6)break;else _0x2cfae5['push'](_0x2cfae5['shift']());}catch(_0x409275){_0x2cfae5['push'](_0x2cfae5['shift']());}}}(_0x3d75,0x8dbf0));function _0x3d75(){const _0x22eb2e=['1997600PLtKtp','9983709erqdUp','14UoajHR','Unknown\x20provider:\x20','Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field','4260955ozgGde','version','42343296jXWRGI','6fotQgr','model','339lPWQiA','number','39736opGPpz','16CXpXFf','claude','126326ncMDMZ','1192254CnXSDM','11MExpWI','join'];_0x3d75=function(){return _0x22eb2e;};return _0x3d75();}import{readFileSync}from'node:fs';import{join}from'node:path';import _0x5ec031 from'js-yaml';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{listProviders}from'../shared/token-provider.js';const CONFIG_FILENAME='tokenizer-speedup.yaml';export const DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320};export const DEFAULT_METERING={'endpoint':'https://api.simosphere.ai/v1/meter','batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x568f2f){const _0x39c175=_0x5987,_0x19de0b={'UjvdM':function(_0x2704ef,_0x23614e){return _0x2704ef!=_0x23614e;},'TvVAA':'claude-sonnet-4-20250514'},_0x4e2308=_0x5ec031['load'](_0x568f2f);if(!_0x4e2308||_0x19de0b['UjvdM'](_0x39c175(0x148),typeof _0x4e2308['version']))throw new Error(_0x39c175(0x141));const _0x474c2c=_0x4e2308['provider']??'claude',_0x3b8150=_0x4e2308[_0x39c175(0x146)]??(_0x39c175(0x14b)===_0x474c2c?_0x19de0b['TvVAA']:'gpt-4o'),_0x356a6f=listProviders();if(!_0x356a6f['includes'](_0x474c2c))throw new Error(_0x39c175(0x140)+_0x474c2c+'.\x20Known:\x20'+_0x356a6f[_0x39c175(0x13c)](',\x20'));const _0x3eeb2a=Array['isArray'](_0x4e2308['rules'])?_0x4e2308['rules']:[],_0x7191c9=_0x4e2308['context_limits']??DEFAULT_LIMITS,_0x4506e1=_0x4e2308['metering']??DEFAULT_METERING;return{'version':_0x4e2308[_0x39c175(0x143)],'provider':_0x474c2c,'model':_0x3b8150,'rules':_0x3eeb2a,'context_limits':_0x7191c9,'metering':_0x4506e1};}export function loadConfigFromString(_0x9af088){return parseConfig(_0x9af088);}function _0x5987(_0x355e18,_0xfbaa52){_0x355e18=_0x355e18-0x13b;const _0x3d751b=_0x3d75();let _0x5987c2=_0x3d751b[_0x355e18];return _0x5987c2;}export function loadConfig(_0x193bb7){const _0x4d8f4f=join(_0x193bb7,CONFIG_FILENAME);return parseConfig(readFileSync(_0x4d8f4f,'utf-8'));}
@@ -1 +1 @@
1
- function _0x3a68(){const _0x25d589=['24351ZjqZOZ','3260360nKgdSC','8037378CExSCk','\x0a\x0a[...\x20gekuerzt,\x20','16jaYdBC','wasTruncated','2596407xjnkcx','4249152jwKrFj','originalTokens','686000EAZLqd','6586657lUPhww','compress','compressedTokens','ziegY','length','floor','\x20Token]','pydrA','PsKKI','50YEOeYq'];_0x3a68=function(){return _0x25d589;};return _0x3a68();}function _0x5af7(_0x4b1b8e,_0x3afa0c){_0x4b1b8e=_0x4b1b8e-0x1df;const _0x3a6817=_0x3a68();let _0x5af7f4=_0x3a6817[_0x4b1b8e];return _0x5af7f4;}(function(_0x3ec39b,_0x8af587){const _0x150501=_0x5af7,_0x3144d0=_0x3ec39b();while(!![]){try{const _0xf8aec3=-parseInt(_0x150501(0x1f1))/0x1*(-parseInt(_0x150501(0x1f0))/0x2)+-parseInt(_0x150501(0x1e3))/0x3+-parseInt(_0x150501(0x1e6))/0x4+-parseInt(_0x150501(0x1f2))/0x5+parseInt(_0x150501(0x1e4))/0x6+-parseInt(_0x150501(0x1e7))/0x7+parseInt(_0x150501(0x1e1))/0x8*(parseInt(_0x150501(0x1df))/0x9);if(_0xf8aec3===_0x8af587)break;else _0x3144d0['push'](_0x3144d0['shift']());}catch(_0x5566f1){_0x3144d0['push'](_0x3144d0['shift']());}}}(_0x3a68,0x737e3));import{countTokens}from'../shared/token-counter.js';import{createDefaultPipeline}from'./compression/index.js';export function compressContext(_0xbe8c4d,_0x31ce1c){const _0x1a5462=_0x5af7,_0x3c1e35={'RUjrq':function(_0x14c72e,_0x259796){return _0x14c72e(_0x259796);},'pydrA':function(_0x3613b7,_0x554156){return _0x3613b7<=_0x554156;},'ziegY':function(_0x1ec2cb,_0x3a7d1b){return _0x1ec2cb(_0x3a7d1b);},'OJBIT':function(_0x52b509,_0x20b927){return _0x52b509+_0x20b927;},'QOSPu':function(_0x2c5942,_0x20494e){return _0x2c5942+_0x20494e;},'PsKKI':function(_0x38eb07,_0xf7d23d){return _0x38eb07(_0xf7d23d);}};if(!_0xbe8c4d)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x2ec8c6=_0x3c1e35['RUjrq'](countTokens,_0xbe8c4d);if(_0x3c1e35[_0x1a5462(0x1ee)](_0x2ec8c6,_0x31ce1c))return{'text':_0xbe8c4d,'originalTokens':_0x2ec8c6,'compressedTokens':_0x2ec8c6,'wasTruncated':!0x1};const _0x4ffb7f=_0x3c1e35['ziegY'](createDefaultPipeline,_0x31ce1c)[_0x1a5462(0x1e8)](_0xbe8c4d,_0x31ce1c);if(_0x4ffb7f[_0x1a5462(0x1e9)]<=_0x31ce1c)return{'text':_0x4ffb7f['text'],'originalTokens':_0x4ffb7f[_0x1a5462(0x1e5)],'compressedTokens':_0x4ffb7f[_0x1a5462(0x1e9)],'wasTruncated':_0x4ffb7f[_0x1a5462(0x1e2)]};const _0x35eff5=_0x4ffb7f['text']['split'](/\s+/);let _0x273261='';for(const _0x5ac34c of _0x35eff5){const _0x25a645=_0x273261?_0x3c1e35['OJBIT'](_0x273261,'\x20')+_0x5ac34c:_0x5ac34c;if(_0x3c1e35['ziegY'](countTokens,_0x25a645)>_0x31ce1c-0xa)break;_0x273261=_0x25a645;}const _0xa0d38=_0x3c1e35['QOSPu'](_0x273261,_0x1a5462(0x1e0)+_0x2ec8c6+'\x20→\x20'+_0x3c1e35[_0x1a5462(0x1ea)](countTokens,_0x273261)+_0x1a5462(0x1ed));return{'text':_0xa0d38,'originalTokens':_0x2ec8c6,'compressedTokens':_0x3c1e35[_0x1a5462(0x1ef)](countTokens,_0xa0d38),'wasTruncated':!0x0};}export function compressContextBudget(_0x3cbc39,_0xc6748d){const _0x1ef7f4=_0x5af7,_0xa53710={'ymJJv':function(_0x5ea25e,_0x163f21){return _0x5ea25e/_0x163f21;}},_0x4fc1c1=Math[_0x1ef7f4(0x1ec)](_0xa53710['ymJJv'](_0xc6748d,Math['max'](_0x3cbc39[_0x1ef7f4(0x1eb)],0x1)));return _0x3cbc39['map'](({label:_0x3b1275,text:_0xa7eef9})=>({'label':_0x3b1275,'result':compressContext(_0xa7eef9,_0x4fc1c1)}));}
1
+ (function(_0x482695,_0x3c2e33){const _0x3c546c=_0x1cb0,_0x206b01=_0x482695();while(!![]){try{const _0x30cd48=parseInt(_0x3c546c(0x85))/0x1*(parseInt(_0x3c546c(0x8c))/0x2)+-parseInt(_0x3c546c(0x8a))/0x3+-parseInt(_0x3c546c(0x83))/0x4*(-parseInt(_0x3c546c(0x82))/0x5)+parseInt(_0x3c546c(0x84))/0x6+parseInt(_0x3c546c(0x89))/0x7+parseInt(_0x3c546c(0x8d))/0x8+-parseInt(_0x3c546c(0x7f))/0x9;if(_0x30cd48===_0x3c2e33)break;else _0x206b01['push'](_0x206b01['shift']());}catch(_0x55decc){_0x206b01['push'](_0x206b01['shift']());}}}(_0x109c,0xc1b55));function _0x1cb0(_0x3ec697,_0x2dfc67){_0x3ec697=_0x3ec697-0x7e;const _0x109c0c=_0x109c();let _0x1cb0ce=_0x109c0c[_0x3ec697];return _0x1cb0ce;}function _0x109c(){const _0x1dfd2b=['\x20Token]','6448897bIGQBZ','249699KkSOVR','map','848sAjCFU','4008024FXemkY','split','max','lvdwv','compressedTokens','21335508DQxVmO','text','rjajL','35KwGNFV','376488XtmPwd','1712988IBFEHv','2077pykinm','lqqYi','QPJHY'];_0x109c=function(){return _0x1dfd2b;};return _0x109c();}import{countTokens}from'../shared/token-counter.js';import{createDefaultPipeline}from'./compression/index.js';export function compressContext(_0x1fe64a,_0xef19a0){const _0x56fd5f=_0x1cb0,_0x8c840a={'lvdwv':function(_0x2df6da,_0x4c0b3e){return _0x2df6da<=_0x4c0b3e;},'lqqYi':function(_0x336635,_0x3f7c90){return _0x336635<=_0x3f7c90;},'QPJHY':function(_0x5193d7,_0x121e3a){return _0x5193d7+_0x121e3a;},'ZpCjd':function(_0x43bb57,_0x10a951){return _0x43bb57(_0x10a951);},'rjajL':function(_0x50e504,_0x5e9347){return _0x50e504+_0x5e9347;}};if(!_0x1fe64a)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x40d318=countTokens(_0x1fe64a);if(_0x8c840a[_0x56fd5f(0x90)](_0x40d318,_0xef19a0))return{'text':_0x1fe64a,'originalTokens':_0x40d318,'compressedTokens':_0x40d318,'wasTruncated':!0x1};const _0x2bd3ca=createDefaultPipeline(_0xef19a0)['compress'](_0x1fe64a,_0xef19a0);if(_0x8c840a[_0x56fd5f(0x86)](_0x2bd3ca['compressedTokens'],_0xef19a0))return{'text':_0x2bd3ca[_0x56fd5f(0x80)],'originalTokens':_0x2bd3ca['originalTokens'],'compressedTokens':_0x2bd3ca[_0x56fd5f(0x7e)],'wasTruncated':_0x2bd3ca['wasTruncated']};const _0x46b1e7=_0x2bd3ca[_0x56fd5f(0x80)][_0x56fd5f(0x8e)](/\s+/);let _0x5c6b62='';for(const _0x161dfa of _0x46b1e7){const _0x36453d=_0x5c6b62?_0x8c840a[_0x56fd5f(0x87)](_0x8c840a['QPJHY'](_0x5c6b62,'\x20'),_0x161dfa):_0x161dfa;if(_0x8c840a['ZpCjd'](countTokens,_0x36453d)>_0xef19a0-0xa)break;_0x5c6b62=_0x36453d;}const _0x15a697=_0x8c840a[_0x56fd5f(0x81)](_0x5c6b62,'\x0a\x0a[...\x20gekuerzt,\x20'+_0x40d318+'\x20→\x20'+countTokens(_0x5c6b62)+_0x56fd5f(0x88));return{'text':_0x15a697,'originalTokens':_0x40d318,'compressedTokens':countTokens(_0x15a697),'wasTruncated':!0x0};}export function compressContextBudget(_0x179d79,_0x2f38d8){const _0x5c2474=_0x1cb0,_0xb4c4e5=Math['floor'](_0x2f38d8/Math[_0x5c2474(0x8f)](_0x179d79['length'],0x1));return _0x179d79[_0x5c2474(0x8b)](({label:_0x11ccda,text:_0x1763fd})=>({'label':_0x11ccda,'result':compressContext(_0x1763fd,_0xb4c4e5)}));}
@@ -1 +1 @@
1
- const _0x23ff09=_0x2702;function _0x5399(){const _0xf01b60=['compress_above','engine','hook_event_name','458898DWtpcK','rqFxy','projectRoot','\x20laden.','1585QQmLYK','min','2271daFoKV','8024DFQoAj','4543960UItpjf','handlePreCompact','record','\x20(max\x20','max_tokens','session-','match','IbFky','max_file_tokens','prompt','6320709BbNUXI','max_injected_tokens','trigger','collector','push','flush','limits','join','261458nMfyhL','878FNpksQ','WaLUy','getSummary','prioritized','38731azBkoe'];_0x5399=function(){return _0xf01b60;};return _0x5399();}(function(_0x38d193,_0x3ba5fd){const _0x4017b3=_0x2702,_0x5d6411=_0x38d193();while(!![]){try{const _0x5b0f8a=parseInt(_0x4017b3(0x95))/0x1+parseInt(_0x4017b3(0x96))/0x2*(-parseInt(_0x4017b3(0x81))/0x3)+parseInt(_0x4017b3(0x82))/0x4*(parseInt(_0x4017b3(0x7f))/0x5)+parseInt(_0x4017b3(0x9e))/0x6+parseInt(_0x4017b3(0x9a))/0x7+parseInt(_0x4017b3(0x83))/0x8+-parseInt(_0x4017b3(0x8d))/0x9;if(_0x5b0f8a===_0x3ba5fd)break;else _0x5d6411['push'](_0x5d6411['shift']());}catch(_0xfceeb){_0x5d6411['push'](_0x5d6411['shift']());}}}(_0x5399,0x7d2eb));import{RuleEngine}from'./rule-engine.js';import{MetricsCollector}from'./metrics-collector.js';function _0x2702(_0x305479,_0x1e8910){_0x305479=_0x305479-0x7f;const _0x539971=_0x5399();let _0x27024d=_0x539971[_0x305479];return _0x27024d;}import{compressContext}from'./context-compressor.js';import{prioritizeContext}from'./precompact-handler.js';import{countTokens}from'../shared/token-counter.js';export class HookDispatcher{['engine'];['collector'];['projectRoot'];constructor(_0x3c1f63,_0x18e5ad,_0x238c32){const _0x19baa2=_0x2702;this[_0x19baa2(0x9c)]=new RuleEngine(_0x3c1f63),this[_0x19baa2(0xa0)]=_0x18e5ad,this['collector']=new MetricsCollector(_0x18e5ad,_0x238c32||_0x19baa2(0x88)+Date['now']());}['handleUserPromptSubmit'](_0x2af6d8){const _0x1ea507=_0x2702,_0x54b7dd={'daFtB':function(_0x1e9171,_0x1004d1){return _0x1e9171===_0x1004d1;},'WaLUy':function(_0x44c7a9,_0x1d2b26){return _0x44c7a9(_0x1d2b26);},'IbFky':function(_0x10b931,_0x25a3ab,_0x205735){return _0x10b931(_0x25a3ab,_0x205735);},'rqFxy':function(_0x525f39,_0x226ce4){return _0x525f39(_0x226ce4);},'LNVjB':function(_0x2eeeea,_0x211ae2){return _0x2eeeea+_0x211ae2;}},_0x251174=_0x2af6d8['prompt']||'',_0x3f9d32=this[_0x1ea507(0x9c)][_0x1ea507(0x89)](_0x251174);if(_0x54b7dd['daFtB'](0x0,_0x3f9d32['length'])){const _0x31107b=_0x54b7dd[_0x1ea507(0x97)](countTokens,_0x251174);return this['collector']['record']({'hook_event':_0x2af6d8[_0x1ea507(0x9d)],'baseline_tokens':_0x31107b,'optimized_tokens':_0x31107b,'rule_matched':null}),{};}const _0x7b28f2=[],_0xac6265=[];for(const _0x1202d6 of _0x3f9d32)_0xac6265['push'](_0x1202d6['trigger'][0x0]),_0x1202d6['summary_only']?_0x7b28f2[_0x1ea507(0x91)]('['+_0x1202d6[_0x1ea507(0x8f)][0x0]+']\x20Fuer\x20Details:\x20'+_0x1202d6['load']+_0x1ea507(0xa1)):_0x7b28f2['push']('['+_0x1202d6[_0x1ea507(0x8f)][0x0]+']\x20Relevanter\x20Kontext:\x20'+_0x1202d6['load']+_0x1ea507(0x86)+(_0x1202d6[_0x1ea507(0x87)]||this['engine']['limits'][_0x1ea507(0x8b)])+'\x20Token)');let _0x12e32b=_0x7b28f2[_0x1ea507(0x94)]('\x0a');const _0x49d86c=this['engine'][_0x1ea507(0x93)][_0x1ea507(0x9b)];_0x49d86c>0x0&&(_0x12e32b=_0x54b7dd[_0x1ea507(0x8a)](compressContext,_0x12e32b,_0x49d86c)['text']);const _0xdc7a91=_0x54b7dd[_0x1ea507(0x9f)](countTokens,_0x251174),_0x281f02=_0x54b7dd['WaLUy'](countTokens,_0x12e32b),_0x53d61e=_0xdc7a91+this['engine']['limits'][_0x1ea507(0x8e)],_0x35eda4=_0x54b7dd['LNVjB'](_0xdc7a91,Math[_0x1ea507(0x80)](_0x281f02,this['engine'][_0x1ea507(0x93)]['max_injected_tokens']));return this['collector']['record']({'hook_event':_0x2af6d8['hook_event_name'],'baseline_tokens':_0x53d61e,'optimized_tokens':_0x35eda4,'rule_matched':_0xac6265['join']('+')}),{'additionalContext':_0x12e32b};}[_0x23ff09(0x84)](_0x3a679d){const _0x479809=_0x23ff09,_0xb85bb3={'hvlXs':'user'},_0x1ec80d=[];if(_0x3a679d['prompt']&&_0x1ec80d['push']({'role':_0xb85bb3['hvlXs'],'content':_0x3a679d[_0x479809(0x8c)],'turnIndex':0x0}),0x0===_0x1ec80d['length'])return{};const _0x580639=prioritizeContext(_0x1ec80d,this[_0x479809(0x9c)][_0x479809(0x93)]),_0x30593a=_0x580639[_0x479809(0x99)]['map'](_0x59595d=>_0x59595d['content'])[_0x479809(0x94)]('\x0a\x0a');return this[_0x479809(0x90)][_0x479809(0x85)]({'hook_event':_0x3a679d['hook_event_name'],'baseline_tokens':_0x580639['totalOriginalTokens'],'optimized_tokens':_0x580639['totalCompressedTokens'],'rule_matched':null}),{'additionalContext':_0x30593a};}['handleSessionStop'](){const _0x46ca4d=_0x23ff09;return this[_0x46ca4d(0x90)][_0x46ca4d(0x92)](),this[_0x46ca4d(0x90)]['getSummary']();}['getSessionSummary'](){const _0xc2ef06=_0x23ff09;return this[_0xc2ef06(0x90)][_0xc2ef06(0x98)]();}}
1
+ const _0x2a25f0=_0x474e;(function(_0x2ae086,_0x591635){const _0xfd1106=_0x474e,_0x18918e=_0x2ae086();while(!![]){try{const _0x593307=parseInt(_0xfd1106(0x1cb))/0x1+-parseInt(_0xfd1106(0x1c6))/0x2*(parseInt(_0xfd1106(0x1c7))/0x3)+parseInt(_0xfd1106(0x1cf))/0x4+-parseInt(_0xfd1106(0x1c4))/0x5+parseInt(_0xfd1106(0x1d1))/0x6+-parseInt(_0xfd1106(0x1d4))/0x7*(-parseInt(_0xfd1106(0x1e4))/0x8)+-parseInt(_0xfd1106(0x1e5))/0x9*(parseInt(_0xfd1106(0x1cd))/0xa);if(_0x593307===_0x591635)break;else _0x18918e['push'](_0x18918e['shift']());}catch(_0x4c3dcf){_0x18918e['push'](_0x18918e['shift']());}}}(_0x52f9,0x4a592));import{RuleEngine}from'./rule-engine.js';import{MetricsCollector}from'./metrics-collector.js';import{compressContext}from'./context-compressor.js';import{prioritizeContext}from'./precompact-handler.js';function _0x474e(_0x14a7c2,_0x39c1aa){_0x14a7c2=_0x14a7c2-0x1c4;const _0x52f994=_0x52f9();let _0x474e4e=_0x52f994[_0x14a7c2];return _0x474e4e;}import{countTokens}from'../shared/token-counter.js';function _0x52f9(){const _0x330912=['flush','647240pURKpy','totalCompressedTokens','2XGqmvZ','1275564bxMiqV','push','join','session-','477694GSBgXV','record','24140TdlFUE','prompt','262424ERunpC','now','2923428PKzPEC','handleSessionStop','getSummary','281659VdXBpw','engine','summary_only','handleUserPromptSubmit','compress_above','match','limits','handlePreCompact','getSessionSummary','content','max_file_tokens','\x20(max\x20','text',']\x20Fuer\x20Details:\x20','collector','length','48gYssMT','1539wqdpKy','trigger'];_0x52f9=function(){return _0x330912;};return _0x52f9();}export class HookDispatcher{['engine'];[_0x2a25f0(0x1e2)];['projectRoot'];constructor(_0x59be25,_0x16bfc7,_0x7f6286){const _0x31aa4e=_0x2a25f0;this[_0x31aa4e(0x1d5)]=new RuleEngine(_0x59be25),this['projectRoot']=_0x16bfc7,this[_0x31aa4e(0x1e2)]=new MetricsCollector(_0x16bfc7,_0x7f6286||_0x31aa4e(0x1ca)+Date[_0x31aa4e(0x1d0)]());}[_0x2a25f0(0x1d7)](_0x275a70){const _0x2467f9=_0x2a25f0,_0x55cb70={'fEHxz':function(_0x6cb41d,_0x393ed1){return _0x6cb41d(_0x393ed1);},'EnIMw':function(_0x345360,_0x6ddbaf){return _0x345360>_0x6ddbaf;},'WSBBD':function(_0x4661e9,_0x1621b7){return _0x4661e9+_0x1621b7;}},_0x1fc151=_0x275a70[_0x2467f9(0x1ce)]||'',_0xded5e6=this[_0x2467f9(0x1d5)][_0x2467f9(0x1d9)](_0x1fc151);if(0x0===_0xded5e6[_0x2467f9(0x1e3)]){const _0x54854d=_0x55cb70['fEHxz'](countTokens,_0x1fc151);return this['collector'][_0x2467f9(0x1cc)]({'hook_event':_0x275a70['hook_event_name'],'baseline_tokens':_0x54854d,'optimized_tokens':_0x54854d,'rule_matched':null}),{};}const _0xec7f4f=[],_0x1a2833=[];for(const _0x2db20a of _0xded5e6)_0x1a2833[_0x2467f9(0x1c8)](_0x2db20a[_0x2467f9(0x1e6)][0x0]),_0x2db20a[_0x2467f9(0x1d6)]?_0xec7f4f['push']('['+_0x2db20a[_0x2467f9(0x1e6)][0x0]+_0x2467f9(0x1e1)+_0x2db20a['load']+'\x20laden.'):_0xec7f4f[_0x2467f9(0x1c8)]('['+_0x2db20a[_0x2467f9(0x1e6)][0x0]+']\x20Relevanter\x20Kontext:\x20'+_0x2db20a['load']+_0x2467f9(0x1df)+(_0x2db20a['max_tokens']||this['engine'][_0x2467f9(0x1da)][_0x2467f9(0x1de)])+'\x20Token)');let _0x4ab5e5=_0xec7f4f[_0x2467f9(0x1c9)]('\x0a');const _0xa56e9c=this['engine'][_0x2467f9(0x1da)][_0x2467f9(0x1d8)];_0x55cb70['EnIMw'](_0xa56e9c,0x0)&&(_0x4ab5e5=compressContext(_0x4ab5e5,_0xa56e9c)[_0x2467f9(0x1e0)]);const _0x21c541=_0x55cb70['fEHxz'](countTokens,_0x1fc151),_0x1dc37a=countTokens(_0x4ab5e5),_0x30dd80=_0x55cb70['WSBBD'](_0x21c541,this[_0x2467f9(0x1d5)][_0x2467f9(0x1da)]['max_injected_tokens']),_0x3b109a=_0x21c541+Math['min'](_0x1dc37a,this[_0x2467f9(0x1d5)]['limits']['max_injected_tokens']);return this[_0x2467f9(0x1e2)][_0x2467f9(0x1cc)]({'hook_event':_0x275a70['hook_event_name'],'baseline_tokens':_0x30dd80,'optimized_tokens':_0x3b109a,'rule_matched':_0x1a2833['join']('+')}),{'additionalContext':_0x4ab5e5};}[_0x2a25f0(0x1db)](_0x29bd73){const _0x180e1f=_0x2a25f0,_0xfa1a12={'iMPlh':function(_0x43b3d1,_0x35a353){return _0x43b3d1===_0x35a353;}},_0x3aa681=[];if(_0x29bd73['prompt']&&_0x3aa681['push']({'role':'user','content':_0x29bd73[_0x180e1f(0x1ce)],'turnIndex':0x0}),_0xfa1a12['iMPlh'](0x0,_0x3aa681['length']))return{};const _0x27e683=prioritizeContext(_0x3aa681,this[_0x180e1f(0x1d5)][_0x180e1f(0x1da)]),_0x13ec38=_0x27e683['prioritized']['map'](_0x3cee0e=>_0x3cee0e[_0x180e1f(0x1dd)])[_0x180e1f(0x1c9)]('\x0a\x0a');return this['collector']['record']({'hook_event':_0x29bd73['hook_event_name'],'baseline_tokens':_0x27e683['totalOriginalTokens'],'optimized_tokens':_0x27e683[_0x180e1f(0x1c5)],'rule_matched':null}),{'additionalContext':_0x13ec38};}[_0x2a25f0(0x1d2)](){const _0x328e2c=_0x2a25f0;return this[_0x328e2c(0x1e2)][_0x328e2c(0x1e7)](),this[_0x328e2c(0x1e2)]['getSummary']();}[_0x2a25f0(0x1dc)](){const _0x46c88c=_0x2a25f0;return this[_0x46c88c(0x1e2)][_0x46c88c(0x1d3)]();}}
@@ -1 +1 @@
1
- const _0x3a0c2a=_0x5904;(function(_0x2fca00,_0x272b88){const _0xbe6738=_0x5904,_0x12057f=_0x2fca00();while(!![]){try{const _0x29ff6d=-parseInt(_0xbe6738(0x9e))/0x1+parseInt(_0xbe6738(0xa9))/0x2*(parseInt(_0xbe6738(0xab))/0x3)+-parseInt(_0xbe6738(0xa1))/0x4+parseInt(_0xbe6738(0xaf))/0x5+-parseInt(_0xbe6738(0xa4))/0x6*(-parseInt(_0xbe6738(0xaa))/0x7)+-parseInt(_0xbe6738(0x9f))/0x8+parseInt(_0xbe6738(0xa6))/0x9*(parseInt(_0xbe6738(0xb1))/0xa);if(_0x29ff6d===_0x272b88)break;else _0x12057f['push'](_0x12057f['shift']());}catch(_0x453f10){_0x12057f['push'](_0x12057f['shift']());}}}(_0x10fe,0x4950e));function _0x5904(_0x4910d8,_0x5e27e2){_0x4910d8=_0x4910d8-0x9e;const _0x10fe3f=_0x10fe();let _0x5904d9=_0x10fe3f[_0x4910d8];return _0x5904d9;}export function buildMeterPayload(_0x1d68f6,_0x1c57a9){const _0x4d72b9=_0x5904;return{'session_id':_0x1d68f6['session_id'],'tokens_saved':_0x1d68f6[_0x4d72b9(0xac)],'baseline_tokens':_0x1d68f6['total_baseline'],'optimized_tokens':_0x1d68f6[_0x4d72b9(0xa0)],'hook_event':_0x4d72b9(0xb2),'provider':_0x1c57a9['provider'],'model':_0x1c57a9[_0x4d72b9(0xb0)],'team_id':_0x1c57a9['team_id']??''};}function _0x10fe(){const _0x2d04c4=['Bearer\x20','status','579999LvMmMa','4631480IIKCoO','total_optimized','478412wlbtRg','network_error','send','6996FskLNh','endpoint','135UzBKGR','VVlLp','TRIbF','4ljGdOS','3157HwzWir','258234GEiFEW','total_delta','timeout','http_','2336935QEByxC','model','275620YulfrO','Stop','POST'];_0x10fe=function(){return _0x2d04c4;};return _0x10fe();}export class MeteringClient{['endpoint'];constructor(_0x4587ee){const _0x49a380=_0x5904;this[_0x49a380(0xa5)]=_0x4587ee;}async[_0x3a0c2a(0xa3)](_0x3e03df){const _0x48ce66=_0x3a0c2a,_0x33286c={'TRIbF':'no_endpoint','VVlLp':_0x48ce66(0xb3),'uDpdC':'application/json'};if(!this[_0x48ce66(0xa5)])return{'sent':!0x1,'reason':_0x33286c[_0x48ce66(0xa8)]};try{const _0x3a2779=await fetch(this['endpoint'],{'method':_0x33286c[_0x48ce66(0xa7)],'headers':{'Content-Type':_0x33286c['uDpdC'],'Authorization':_0x48ce66(0xb4)+(process.env.TOKENIZER_API_KEY||'')},'body':JSON['stringify'](_0x3e03df),'signal':AbortSignal[_0x48ce66(0xad)](0x1388)});return _0x3a2779['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x48ce66(0xae)+_0x3a2779[_0x48ce66(0xb5)]};}catch{return{'sent':!0x1,'reason':_0x48ce66(0xa2)};}}}
1
+ function _0x2d3f(){const _0x609b39=['1864626ucITGR','Bearer\x20','16990nyuwGJ','endpoint','7mECuBm','35HkGdvp','CzLNh','137332pjnErx','kLyHn','Stop','3tOgyWt','PuQkO','team_id','5364DgzmDQ','total_baseline','2094442kjKoYW','223236XeAzsF','2311496SviXqp','1279480eCDbGP','application/json','timeout','http_'];_0x2d3f=function(){return _0x609b39;};return _0x2d3f();}function _0x438f(_0x10fe15,_0x559b89){_0x10fe15=_0x10fe15-0x1c4;const _0x2d3f37=_0x2d3f();let _0x438fc0=_0x2d3f37[_0x10fe15];return _0x438fc0;}(function(_0x256601,_0x4c3915){const _0x3febb5=_0x438f,_0x45591d=_0x256601();while(!![]){try{const _0x1c1559=-parseInt(_0x3febb5(0x1c7))/0x1+-parseInt(_0x3febb5(0x1cf))/0x2*(-parseInt(_0x3febb5(0x1ca))/0x3)+parseInt(_0x3febb5(0x1d0))/0x4*(parseInt(_0x3febb5(0x1c5))/0x5)+parseInt(_0x3febb5(0x1d6))/0x6+-parseInt(_0x3febb5(0x1c4))/0x7*(parseInt(_0x3febb5(0x1d2))/0x8)+-parseInt(_0x3febb5(0x1cd))/0x9*(parseInt(_0x3febb5(0x1d8))/0xa)+parseInt(_0x3febb5(0x1d1))/0xb;if(_0x1c1559===_0x4c3915)break;else _0x45591d['push'](_0x45591d['shift']());}catch(_0x36097d){_0x45591d['push'](_0x45591d['shift']());}}}(_0x2d3f,0x9e6d8));export function buildMeterPayload(_0x3d8413,_0x6b6799){const _0x36aa3c=_0x438f,_0x5bc0aa={'PuQkO':_0x36aa3c(0x1c9)};return{'session_id':_0x3d8413['session_id'],'tokens_saved':_0x3d8413['total_delta'],'baseline_tokens':_0x3d8413[_0x36aa3c(0x1ce)],'optimized_tokens':_0x3d8413['total_optimized'],'hook_event':_0x5bc0aa[_0x36aa3c(0x1cb)],'provider':_0x6b6799['provider'],'model':_0x6b6799['model'],'team_id':_0x6b6799[_0x36aa3c(0x1cc)]??''};}export class MeteringClient{['endpoint'];constructor(_0xbaf74e){const _0x10f66c=_0x438f;this[_0x10f66c(0x1d9)]=_0xbaf74e;}async['send'](_0x954ce9){const _0x501e99=_0x438f,_0x8e487e={'maaZc':function(_0x2eb960,_0x30450d,_0x3c5d9f){return _0x2eb960(_0x30450d,_0x3c5d9f);},'iTaYw':'POST','CzLNh':_0x501e99(0x1d3),'kLyHn':'network_error'};if(!this[_0x501e99(0x1d9)])return{'sent':!0x1,'reason':'no_endpoint'};try{const _0x1674ef=await _0x8e487e['maaZc'](fetch,this[_0x501e99(0x1d9)],{'method':_0x8e487e['iTaYw'],'headers':{'Content-Type':_0x8e487e[_0x501e99(0x1c6)],'Authorization':_0x501e99(0x1d7)+(process.env.TOKENIZER_API_KEY||'')},'body':JSON['stringify'](_0x954ce9),'signal':AbortSignal[_0x501e99(0x1d4)](0x1388)});return _0x1674ef['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x501e99(0x1d5)+_0x1674ef['status']};}catch{return{'sent':!0x1,'reason':_0x8e487e[_0x501e99(0x1c8)]};}}}
@@ -1 +1 @@
1
- const _0x5be448=_0x3eb4;function _0x3eb4(_0x378b0f,_0x1b9c8a){_0x378b0f=_0x378b0f-0x175;const _0x27e7b7=_0x27e7();let _0x3eb458=_0x27e7b7[_0x378b0f];return _0x3eb458;}(function(_0x507887,_0x88b8bd){const _0x4cdd69=_0x3eb4,_0x4dd9a4=_0x507887();while(!![]){try{const _0x562489=-parseInt(_0x4cdd69(0x176))/0x1*(parseInt(_0x4cdd69(0x17e))/0x2)+-parseInt(_0x4cdd69(0x186))/0x3*(parseInt(_0x4cdd69(0x191))/0x4)+-parseInt(_0x4cdd69(0x189))/0x5+parseInt(_0x4cdd69(0x177))/0x6*(-parseInt(_0x4cdd69(0x18e))/0x7)+parseInt(_0x4cdd69(0x17c))/0x8*(-parseInt(_0x4cdd69(0x181))/0x9)+parseInt(_0x4cdd69(0x175))/0xa+-parseInt(_0x4cdd69(0x18b))/0xb*(-parseInt(_0x4cdd69(0x17a))/0xc);if(_0x562489===_0x88b8bd)break;else _0x4dd9a4['push'](_0x4dd9a4['shift']());}catch(_0x2e4191){_0x4dd9a4['push'](_0x4dd9a4['shift']());}}}(_0x27e7,0x26084));import{mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path';const METRICS_DIR=_0x5be448(0x17b);export class MetricsCollector{[_0x5be448(0x18d)]=[];['sessionId'];[_0x5be448(0x182)];[_0x5be448(0x180)];constructor(_0x5799dd,_0x2fa237){const _0x56495b=_0x5be448;this[_0x56495b(0x182)]=_0x5799dd,this[_0x56495b(0x18f)]=_0x2fa237,this['startedAt']=new Date()['toISOString']();}[_0x5be448(0x17d)](_0x2e5ced){const _0x2f1332=_0x5be448;this['metrics']['push']({'session_id':this['sessionId'],'timestamp':new Date()[_0x2f1332(0x183)](),'hook_event':_0x2e5ced[_0x2f1332(0x187)],'baseline_tokens':_0x2e5ced['baseline_tokens'],'optimized_tokens':_0x2e5ced[_0x2f1332(0x18c)],'delta':_0x2e5ced[_0x2f1332(0x190)]-_0x2e5ced[_0x2f1332(0x18c)],'rule_matched':_0x2e5ced['rule_matched']});}['getMetrics'](){return[...this['metrics']];}[_0x5be448(0x179)](){const _0x2a2cca=_0x5be448,_0x6c11cf={'qJXAx':function(_0x5ae572,_0x3f56f0){return _0x5ae572-_0x3f56f0;}},_0x43969f=this['metrics'][_0x2a2cca(0x188)]((_0x833031,_0x195b2e)=>_0x833031+_0x195b2e['baseline_tokens'],0x0),_0x7aa636=this[_0x2a2cca(0x18d)][_0x2a2cca(0x188)]((_0x144156,_0x91bc5d)=>_0x144156+_0x91bc5d['optimized_tokens'],0x0),_0x1fa8ac=_0x6c11cf['qJXAx'](_0x43969f,_0x7aa636),_0x31b670={};for(const _0x22f93e of this[_0x2a2cca(0x18d)])_0x22f93e['rule_matched']&&(_0x31b670[_0x22f93e['rule_matched']]=(_0x31b670[_0x22f93e[_0x2a2cca(0x178)]]||0x0)+0x1);return{'session_id':this[_0x2a2cca(0x18f)],'started_at':this['startedAt'],'ended_at':new Date()[_0x2a2cca(0x183)](),'total_baseline':_0x43969f,'total_optimized':_0x7aa636,'total_delta':_0x1fa8ac,'savings_percent':_0x43969f>0x0?_0x1fa8ac/_0x43969f*0x64:0x0,'prompts_count':this['metrics'][_0x2a2cca(0x17f)],'rules_triggered':_0x31b670};}['flush'](){const _0x1dcb71=_0x5be448,_0x4b65da={'jMWYu':function(_0x4c9ced,_0x35efc6,_0x1f52ec){return _0x4c9ced(_0x35efc6,_0x1f52ec);},'Wgfqx':_0x1dcb71(0x184)},_0xa84d7=join(this['projectRoot'],METRICS_DIR);_0x4b65da[_0x1dcb71(0x192)](mkdirSync,_0xa84d7,{'recursive':!0x0});const _0x229d2b={'metrics':this['metrics'],'summary':this[_0x1dcb71(0x179)]()};writeFileSync(join(_0xa84d7,this['sessionId']+_0x1dcb71(0x185)),JSON['stringify'](_0x229d2b,null,0x2),_0x4b65da[_0x1dcb71(0x18a)]);}}function _0x27e7(){const _0x340c06=['utf-8','.json','59337BCuVNW','hook_event','reduce','106100FTQlpK','Wgfqx','1261821LLhhtv','optimized_tokens','metrics','259GBuALx','sessionId','baseline_tokens','12Qilglp','jMWYu','1879150HkgbkS','32892TvtEBU','28770NCHGXN','rule_matched','getSummary','48TQRary','.tokenizer-speedup','24HeWWaH','record','2xSBnjf','length','startedAt','600345cCwANL','projectRoot','toISOString'];_0x27e7=function(){return _0x340c06;};return _0x27e7();}
1
+ function _0x1265(_0x1a4594,_0x38b265){_0x1a4594=_0x1a4594-0xec;const _0x243052=_0x2430();let _0x12656e=_0x243052[_0x1a4594];return _0x12656e;}const _0x46b703=_0x1265;(function(_0x46c550,_0x2ebf07){const _0x4dd684=_0x1265,_0x1a3aa0=_0x46c550();while(!![]){try{const _0x1217f5=-parseInt(_0x4dd684(0xf3))/0x1*(-parseInt(_0x4dd684(0xfb))/0x2)+-parseInt(_0x4dd684(0xfa))/0x3*(-parseInt(_0x4dd684(0x108))/0x4)+-parseInt(_0x4dd684(0x10b))/0x5+parseInt(_0x4dd684(0xfe))/0x6*(-parseInt(_0x4dd684(0xee))/0x7)+parseInt(_0x4dd684(0xf7))/0x8*(-parseInt(_0x4dd684(0xf1))/0x9)+parseInt(_0x4dd684(0xfc))/0xa*(parseInt(_0x4dd684(0x107))/0xb)+parseInt(_0x4dd684(0x10a))/0xc*(parseInt(_0x4dd684(0x103))/0xd);if(_0x1217f5===_0x2ebf07)break;else _0x1a3aa0['push'](_0x1a3aa0['shift']());}catch(_0x180e2b){_0x1a3aa0['push'](_0x1a3aa0['shift']());}}}(_0x2430,0xbd4f7));function _0x2430(){const _0x474538=['1191600LxkCdd','JJOEQ','ZiCio','GKRux','bikcB','64701HITVqC','baseline_tokens','YCnci','projectRoot','11WwgYcm','218476AfEZwb','rule_matched','7212UQUYrc','5604385anvVXj','utf-8','.json','sessionId','35vITRad','record','optimized_tokens','136962JutJQv','toISOString','216203OQBYCN','metrics','dqlzH','getSummary','760QqoSfz','reduce','startedAt','15RuyAho','4bCckSw','6383240FGiaFQ','flush'];_0x2430=function(){return _0x474538;};return _0x2430();}import{mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path';const METRICS_DIR='.tokenizer-speedup';export class MetricsCollector{['metrics']=[];['sessionId'];['projectRoot'];['startedAt'];constructor(_0x420be9,_0x1952fe){const _0x4b4370=_0x1265;this[_0x4b4370(0x106)]=_0x420be9,this[_0x4b4370(0xed)]=_0x1952fe,this[_0x4b4370(0xf9)]=new Date()[_0x4b4370(0xf2)]();}[_0x46b703(0xef)](_0x589ac2){const _0x7cb335=_0x46b703;this[_0x7cb335(0xf4)]['push']({'session_id':this['sessionId'],'timestamp':new Date()['toISOString'](),'hook_event':_0x589ac2['hook_event'],'baseline_tokens':_0x589ac2['baseline_tokens'],'optimized_tokens':_0x589ac2[_0x7cb335(0xf0)],'delta':_0x589ac2[_0x7cb335(0x104)]-_0x589ac2[_0x7cb335(0xf0)],'rule_matched':_0x589ac2[_0x7cb335(0x109)]});}['getMetrics'](){return[...this['metrics']];}['getSummary'](){const _0x485a72=_0x46b703,_0x21436a={'dqlzH':function(_0x26151c,_0x4b0cc6){return _0x26151c-_0x4b0cc6;},'ZiCio':function(_0x415f2d,_0x346349){return _0x415f2d>_0x346349;},'GKRux':function(_0x133a7f,_0x1e9546){return _0x133a7f/_0x1e9546;}},_0x4f48d2=this['metrics'][_0x485a72(0xf8)]((_0x145901,_0x5ab43b)=>_0x145901+_0x5ab43b[_0x485a72(0x104)],0x0),_0x1cb6ea=this['metrics']['reduce']((_0x16e27a,_0x442953)=>_0x16e27a+_0x442953['optimized_tokens'],0x0),_0x238b61=_0x21436a[_0x485a72(0xf5)](_0x4f48d2,_0x1cb6ea),_0x2b9da9={};for(const _0x18bf9c of this['metrics'])_0x18bf9c['rule_matched']&&(_0x2b9da9[_0x18bf9c[_0x485a72(0x109)]]=(_0x2b9da9[_0x18bf9c[_0x485a72(0x109)]]||0x0)+0x1);return{'session_id':this['sessionId'],'started_at':this['startedAt'],'ended_at':new Date()[_0x485a72(0xf2)](),'total_baseline':_0x4f48d2,'total_optimized':_0x1cb6ea,'total_delta':_0x238b61,'savings_percent':_0x21436a[_0x485a72(0x100)](_0x4f48d2,0x0)?_0x21436a[_0x485a72(0x101)](_0x238b61,_0x4f48d2)*0x64:0x0,'prompts_count':this[_0x485a72(0xf4)]['length'],'rules_triggered':_0x2b9da9};}[_0x46b703(0xfd)](){const _0x5589d5=_0x46b703,_0x67054f={'YCnci':function(_0x3f04c4,_0x43de0e,_0x49a887){return _0x3f04c4(_0x43de0e,_0x49a887);},'bikcB':function(_0x1e6e3f,_0x361926,_0x5266f4,_0x16ae21){return _0x1e6e3f(_0x361926,_0x5266f4,_0x16ae21);},'JJOEQ':_0x5589d5(0x10c)},_0x482d24=join(this['projectRoot'],METRICS_DIR);_0x67054f[_0x5589d5(0x105)](mkdirSync,_0x482d24,{'recursive':!0x0});const _0x47aaf6={'metrics':this['metrics'],'summary':this[_0x5589d5(0xf6)]()};_0x67054f[_0x5589d5(0x102)](writeFileSync,_0x67054f[_0x5589d5(0x105)](join,_0x482d24,this['sessionId']+_0x5589d5(0xec)),JSON['stringify'](_0x47aaf6,null,0x2),_0x67054f[_0x5589d5(0xff)]);}}