rakis / _next /static /chunks /672-4b868305a56bb5d8.js
hrishioa's picture
Upload 77 files
7c89823 verified
raw
history blame contribute delete
No virus
10 kB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[672],{49354:function(e,n,o){o.d(n,{cn:function(){return i}});var t=o(44839),r=o(96164);function i(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return(0,r.m6)((0,t.W)(n))}},89028:function(e,n,o){o.d(n,{ri:function(){return i},wK:function(){return d},zQ:function(){return c}});let t="rakisSettings",r=null;function i(){let e={};try{window.localStorage&&window.localStorage&&window.localStorage.getItem(t)&&(r=e=JSON.parse(window.localStorage.getItem(t)))}catch(n){console.error("Error loading settings from localStorage, loading saved settings if we have them",r),r&&(console.log("Using last loaded settings - ",r),e=r)}return e.packetDBSettings={...s,...e.packetDBSettings},e.p2pSettings={...l,...e.p2pSettings},e.chainConnectionSettings={...u,...e.chainConnectionSettings},e.loggerSettings={...g,...e.loggerSettings},e.theDomainSettings={...f,...e.theDomainSettings},e.quorumSettings={...w,...e.quorumSettings},e.llmEngineSettings={...m,...e.llmEngineSettings},e.workerSettings={...a,...e.workerSettings},e}function c(e){{let n={};try{n=JSON.parse(window.localStorage.getItem(t))}catch(e){console.error("Error parsing existing settings",e)}window.localStorage.setItem(t,JSON.stringify({...n,...e}))}}let a={initialLLMWorkers:[{modelName:"gemma-2b-it-q4f16_1",count:2}],initialEmbeddingWorkers:[{modelName:"nomic-ai/nomic-embed-text-v1.5",count:1}]},s={maxReceivedPacketQueueSize:100,receivePacketQueueDebounceMs:100,peerHeartLimit:20,peerCommunicationCount:40,maxPacketDBSize:5e3},l={topic:"rakis1",maxTransmissionErrorsBeforeRestart:5},u={dAppName:"Rakis",url:"https://rakis.ai"},d="encSynthientId",g={maxLogsInMemory:1e3,loggersToSkipForInMemoryLog:["P2P: NKN","P2P: PewPewDB","P2P: nostr (trystero)","P2P: torrent (trystero)","PacketDB"],newLogEventDebounceMs:150},f={enabledP2PNetworks:["nostr","gun","torrent","nkn"],waitForP2PBootupMs:5e3,inferencePollingIntervalMs:5e3,inferenceRequestQueueDebounceMs:1e3,embeddingsQueueDebounceMs:100,requestSimilarityTimeWindowMs:2e3},w={quorumRevealRequestIssueTimeoutMs:1e4,quorumRevealTimeoutMs:2e4,quorumConsensusWindowMs:3e4,bEmbeddingThreshold:0},m={engineLogLimit:2e3,debounceLoadingProgressEventMs:50}},28580:function(e,n,o){o.d(n,{C:function(){return t}});class t{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}},62052:function(e,n,o){o.d(n,{$5:function(){return a},HQ:function(){return l},hu:function(){return u}});var t=o(36393),r=o(22170),i=o.n(r);let c=(0,o(89028).ri)().loggerSettings,a={llmEngine:{main:"background: #f0f8ff; color: #1e90ff; font-weight: bold;",worker:"background: #f0f8ff; color: #87cefa;"},embeddingEngine:{main:"background: #f0fff0; color: #2e8b57; font-weight: bold;",worker:"background: #f0fff0; color: #90ee90;"},theDomain:"background: #fff0f5; color: #ff69b4; font-weight: bold;",consensusCore:"background: #f5f5f5; color: #4682b4; font-weight: bold;",databases:{inferenceDB:"background: #f5f5f5; color: #a9a9a9;",packetDB:"background: #f5f5f5; color: #708090;",peerDB:"background: #f5f5f5; color: #778899;",quorumDB:"background: #f5f5f5; color: #696969;"},p2pNetworks:{nkn:"background: #fffacd; color: #ffa500;",torrent:"background: #fffacd; color: #ff8c00;",pewpewdb:"background: #fffacd; color: #ff7f50;",nostr:"background: #fffacd; color: #ff6347;"}},s=0;class l extends t.Z{static getInstance(){return l.instance||(l.instance=new l),l.instance}static addLog(e,n,o){l.getInstance().logs.push({at:new Date,logger:e,type:n,id:s++,message:o}),l.getInstance().logs=l.getInstance().logs.slice(-c.maxLogsInMemory).sort((e,n)=>n.at.getTime()-e.at.getTime()),l.getInstance().emitNewLogs()}constructor(){super(),this.logs=[],this.emitNewLogs=i()(()=>{this.emit("newLog")},c.newLogEventDebounceMs)}}function u(e,n){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!o&&window&&(window.blockedLogLevels=localStorage.getItem("blockedLogLevels")||[],window.blockedLoggers=localStorage.getItem("blockedLoggers")||[]),{trace:function(t){for(var r,i,c,a,s=arguments.length,l=Array(s>1?s-1:0),u=1;u<s;u++)l[u-1]=arguments[u];!o&&((null===(i=window)||void 0===i?void 0:null===(r=i.blockedLogLevels)||void 0===r?void 0:r.includes("trace"))||(null===(a=window)||void 0===a?void 0:null===(c=a.blockedLoggers)||void 0===c?void 0:c.includes(e)))||console.log("%c[T] ".concat(e,":"),n,t,...l)},debug:function(t){for(var r,i,a,s,u=arguments.length,d=Array(u>1?u-1:0),g=1;g<u;g++)d[g-1]=arguments[g];!o&&((null===(i=window)||void 0===i?void 0:null===(r=i.blockedLogLevels)||void 0===r?void 0:r.includes("debug"))||(null===(s=window)||void 0===s?void 0:null===(a=s.blockedLoggers)||void 0===a?void 0:a.includes(e)))||(c.loggersToSkipForInMemoryLog.includes(e)||l.addLog(e,"debug",t),console.log("%c[D] ".concat(e,":"),n,t,...d))},info:function(t){for(var r,i,a,s,u=arguments.length,d=Array(u>1?u-1:0),g=1;g<u;g++)d[g-1]=arguments[g];!o&&((null===(i=window)||void 0===i?void 0:null===(r=i.blockedLogLevels)||void 0===r?void 0:r.includes("info"))||(null===(s=window)||void 0===s?void 0:null===(a=s.blockedLoggers)||void 0===a?void 0:a.includes(e)))||(c.loggersToSkipForInMemoryLog.includes(e)||l.addLog(e,"info",t),console.log("%c[I] ".concat(e,":"),n,t,...d))},warn:function(t){for(var r,i,a,s,u=arguments.length,d=Array(u>1?u-1:0),g=1;g<u;g++)d[g-1]=arguments[g];!o&&((null===(i=window)||void 0===i?void 0:null===(r=i.blockedLogLevels)||void 0===r?void 0:r.includes("warn"))||(null===(s=window)||void 0===s?void 0:null===(a=s.blockedLoggers)||void 0===a?void 0:a.includes(e)))||(c.loggersToSkipForInMemoryLog.includes(e)||l.addLog(e,"warn",t),console.warn("%c[W] ".concat(e,":"),n,t,...d))},error:function(t){for(var r,i,a,s,u=arguments.length,d=Array(u>1?u-1:0),g=1;g<u;g++)d[g-1]=arguments[g];!o&&((null===(i=window)||void 0===i?void 0:null===(r=i.blockedLogLevels)||void 0===r?void 0:r.includes("error"))||(null===(s=window)||void 0===s?void 0:null===(a=s.blockedLoggers)||void 0===a?void 0:a.includes(e)))||(c.loggersToSkipForInMemoryLog.includes(e)||l.addLog(e,"error",t),console.error("%c[ERROR] ".concat(e,":"),n,t,...d))}}}},3682:function(e,n,o){o.d(n,{K4:function(){return f},N1:function(){return s},TU:function(){return u},Wu:function(){return d},YK:function(){return l},ow:function(){return m},q6:function(){return w},yj:function(){return g}});var t=o(9109),r=o(69893),i=o(78967),c=o(25645),a=o(2342);async function s(e,n){try{let o=await l(e,n);if(!o)return!1;return await (0,c.n)({address:o,message:e,signature:n})}catch(e){return console.error("Could not verify signature",e),!1}}async function l(e,n){try{return await (0,a.k)({message:e,signature:n})}catch(e){return console.error("Could not recover address from signature",e),null}}async function u(e,n){let o=new Uint8Array(e),t=new TextEncoder().encode(n);var r=new Uint8Array(o.length+t.length);return r.set(o),r.set(t,o.length),Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",r))).map(e=>e.toString(16).padStart(2,"0")).join("")}async function d(e){let n=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",n))).map(e=>e.toString(16).padStart(2,"0")).join("")}function g(e,n,o){let t=JSON.stringify(o),i=new Uint8Array(new TextEncoder().encode(t));return r.T(n,i,e)}function f(e,n){let o=JSON.stringify(n),t=new Uint8Array(new TextEncoder().encode(o)),i=r.Xx(t,e);return r.UG.bytesToHex(i)}async function w(e,n){console.time("Encrypting info for storage");let o=new TextEncoder,r=o.encode(n),i=crypto.getRandomValues(new Uint8Array(16)),c=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.importKey("raw",r,{name:"PBKDF2"},!1,["deriveKey"]),s=await crypto.subtle.deriveKey({name:"PBKDF2",salt:i,iterations:1e5,hash:"SHA-256"},a,{name:"AES-GCM",length:256},!1,["encrypt"]),l=o.encode(JSON.stringify(e)),u=await crypto.subtle.encrypt({name:"AES-GCM",iv:c},s,l),d=t.Buffer.from(u).toString("base64"),g=t.Buffer.from(c).toString("hex"),f=t.Buffer.from(i).toString("hex");return console.timeEnd("Encrypting info for storage"),"".concat(d,".").concat(g,".").concat(f)}async function m(e,n){console.time("Decrypting info from storage");let[o,r,i]=e.split("."),c=t.Buffer.from(o,"base64"),a=t.Buffer.from(r,"hex"),s=t.Buffer.from(i,"hex"),l=new TextEncoder().encode(n),u=await crypto.subtle.importKey("raw",l,{name:"PBKDF2"},!1,["deriveKey"]),d=await crypto.subtle.deriveKey({name:"PBKDF2",salt:s,iterations:1e5,hash:"SHA-256"},u,{name:"AES-GCM",length:256},!1,["decrypt"]),g=await crypto.subtle.decrypt({name:"AES-GCM",iv:a},d,c),f=new TextDecoder().decode(g);return console.timeEnd("Decrypting info from storage"),JSON.parse(f)}r.UG.sha512Sync=function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return(0,i.o)(r.UG.concatBytes(...n))}},13201:function(e,n,o){function t(e){let n=new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString(),o=e.getTimezoneOffset(),t=Math.floor(Math.abs(o/60)).toString().padStart(2,"0"),r=Math.abs(o%60).toString().padStart(2,"0");return"".concat(n.slice(0,-1)).concat(o>0?"-":"+").concat(t,":").concat(r)}function r(){return"undefined"==typeof navigator||"undefined"==typeof screen?"not-client":window.disableAnalytics?"disabled-analytics":Object.values({userAgent:navigator.userAgent,browserVersion:navigator.appVersion,platform:navigator.platform,language:navigator.language,screenWidth:screen.width,screenHeight:screen.height,colorDepth:screen.colorDepth,timezoneOffset:new Date().getTimezoneOffset(),cpuCores:navigator.hardwareConcurrency,touchSupport:"ontouchstart"in window}).map(e=>"".concat(e)).join("#")}async function i(e){return new Promise(n=>{setTimeout(()=>n("timeout"),e)})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",o="";for(let t=0;t<e;t++)o+=n.charAt(Math.floor(Math.random()*n.length));return o}o.d(n,{GR:function(){return i},MQ:function(){return t},dz:function(){return r},zs:function(){return c}})}}]);