2 lines
136 KiB
JavaScript
2 lines
136 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Debugger",[],t):"object"==typeof exports?exports.Debugger=t():e.Debugger=t()}(global,(()=>(()=>{var e={138:(e,t,n)=>{var r={};e.exports=r,r.themes={};var i=n(837),a=r.styles=n(951),s=Object.defineProperties,o=new RegExp(/[\r\n]+/g);r.supportsColor=n(613).supportsColor,void 0===r.enabled&&(r.enabled=!1!==r.supportsColor()),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")},r.stylize=function(e,t){if(!r.enabled)return e+"";var n=a[t];return!n&&t in r?r[t](e):n.open+e+n.close};var c=/[|\\{}()[\]^$+*?.]/g;function l(e){var t=function e(){return f.apply(e,arguments)};return t._styles=e,t.__proto__=p,t}var u,d=(u={},a.grey=a.gray,Object.keys(a).forEach((function(e){a[e].closeRe=new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(c,"\\$&")}(a[e].close),"g"),u[e]={get:function(){return l(this._styles.concat(e))}}})),u),p=s((function(){}),d);function f(){var e=Array.prototype.slice.call(arguments).map((function(e){return null!=e&&e.constructor===String?e:i.inspect(e)})).join(" ");if(!r.enabled||!e)return e;for(var t=-1!=e.indexOf("\n"),n=this._styles,s=n.length;s--;){var c=a[n[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,t&&(e=e.replace(o,(function(e){return c.close+e+c.open})))}return e}r.setTheme=function(e){if("string"!=typeof e)for(var t in e)!function(t){r[t]=function(n){if("object"==typeof e[t]){var i=n;for(var a in e[t])i=r[e[t][a]](i);return i}return r[e[t]](n)}}(t);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var y=function(e,t){var n=t.split("");return(n=n.map(e)).join("")};for(var g in r.trap=n(571),r.zalgo=n(561),r.maps={},r.maps.america=n(393)(r),r.maps.zebra=n(35)(r),r.maps.rainbow=n(374)(r),r.maps.random=n(987)(r),r.maps)!function(e){r[e]=function(t){return y(r.maps[e],t)}}(g);s(r,function(){var e={};return Object.keys(d).forEach((function(t){e[t]={get:function(){return l([t])}}})),e}())},571:e=>{e.exports=function(e,t){var n="";e=(e=e||"Run the trap, drop the bass").split("");var r={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return e.forEach((function(e){e=e.toLowerCase();var t=r[e]||[" "],i=Math.floor(Math.random()*t.length);n+=void 0!==r[e]?r[e][i]:e})),n}},561:e=>{e.exports=function(e,t){e=e||" he is here ";var n={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},r=[].concat(n.up,n.down,n.mid);function i(e){return Math.floor(Math.random()*e)}function a(e){var t=!1;return r.filter((function(n){t=n===e})),t}return function(e,t){var r,s,o="";for(s in(t=t||{}).up=void 0===t.up||t.up,t.mid=void 0===t.mid||t.mid,t.down=void 0===t.down||t.down,t.size=void 0!==t.size?t.size:"maxi",e=e.split(""))if(!a(s)){switch(o+=e[s],r={up:0,down:0,mid:0},t.size){case"mini":r.up=i(8),r.mid=i(2),r.down=i(8);break;case"maxi":r.up=i(16)+3,r.mid=i(4)+1,r.down=i(64)+3;break;default:r.up=i(8)+1,r.mid=i(6)/2,r.down=i(8)+1}var c=["up","mid","down"];for(var l in c)for(var u=c[l],d=0;d<=r[u];d++)t[u]&&(o+=n[u][i(n[u].length)])}return o}(e,t)}},218:(e,t,n)=>{var r=n(138);e.exports=function(){var e=function(e,t){String.prototype.__defineGetter__(e,t)};e("strip",(function(){return r.strip(this)})),e("stripColors",(function(){return r.strip(this)})),e("trap",(function(){return r.trap(this)})),e("zalgo",(function(){return r.zalgo(this)})),e("zebra",(function(){return r.zebra(this)})),e("rainbow",(function(){return r.rainbow(this)})),e("random",(function(){return r.random(this)})),e("america",(function(){return r.america(this)})),Object.keys(r.styles).forEach((function(t){e(t,(function(){return r.stylize(this,t)}))})),r.setTheme=function(t){"string"!=typeof t?function(t){var n=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","charAt","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","charCodeAt","indexOf","lastIndexOf","length","localeCompare","match","repeat","replace","search","slice","split","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimLeft","trimRight"];Object.keys(t).forEach((function(i){if(-1!==n.indexOf(i))console.log("warn: ".red+("String.prototype"+i).magenta+" is probably something you don't want to override. Ignoring style name");else if("string"==typeof t[i])r[i]=r[t[i]],e(i,(function(){return r[i](this)}));else{var a=function(e){for(var n=e||this,a=0;a<t[i].length;a++)n=r[t[i][a]](n);return n};e(i,a),r[i]=function(e){return a(e)}}}))}(t):console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")}}},785:(e,t,n)=>{var r=n(138);e.exports=r,n(218)()},393:e=>{e.exports=function(e){return function(t,n,r){if(" "===t)return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}},374:e=>{e.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(n,r,i){return" "===n?n:e[t[r++%t.length]](n)}}},987:e=>{e.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(n,r,i){return" "===n?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}},35:e=>{e.exports=function(e){return function(t,n,r){return n%2==0?t:e.inverse(t)}}},951:e=>{var t={};e.exports=t;var n={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(n).forEach((function(e){var r=n[e],i=t[e]=[];i.open="["+r[0]+"m",i.close="["+r[1]+"m"}))},946:e=>{"use strict";e.exports=function(e,t){var n=(t=t||process.argv).indexOf("--"),r=/^-{1,2}/.test(e)?"":"--",i=t.indexOf(r+e);return-1!==i&&(-1===n||i<n)}},613:(e,t,n)=>{"use strict";var r=n(37),i=n(946),a=process.env,s=void 0;function o(e){var t=function(e){if(!1===s)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!e.isTTY&&!0!==s)return 0;var t=s?1:0;if("win32"===process.platform){var n=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in a)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((function(e){return e in a}))||"codeship"===a.CI_NAME?1:t;if("TEAMCITY_VERSION"in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in a){var o=parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||"COLORTERM"in a?1:(a.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}i("no-color")||i("no-colors")||i("color=false")?s=!1:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(s=!0),"FORCE_COLOR"in a&&(s=0===a.FORCE_COLOR.length||0!==parseInt(a.FORCE_COLOR,10)),e.exports={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}},794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emptyWorkflowCompileResult=t.promoteCompileResult=void 0,t.promoteCompileResult=function(e){const{compilations:t}=e,n=t.flatMap((e=>e.contracts));return{compilations:t,contracts:n}},t.emptyWorkflowCompileResult=function(){return{compilations:[],contracts:[]}}},919:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompileError=void 0;const i=r(n(785)),a=r(n(346));class s extends a.default{constructor(e){var t=e.trim()+"\n\n"+i.default.red("Compilation failed. See above.");super(e.trim()),this.message=t}}t.CompileError=s},583:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Compilations=t.Errors=t.Sources=t.Shims=void 0,t.Shims=a(n(467)),t.Sources=a(n(239)),t.Errors=a(n(919)),t.Compilations=a(n(794)),s(n(748),t)},99:(e,t)=>{"use strict";function n(e){const{contractName:t,contract_name:n,sourcePath:i,source:a,sourceMap:s,deployedSourceMap:o,legacyAST:c,ast:l,abi:u,metadata:d,bytecode:p,deployedBytecode:f,compiler:y,devdoc:g,userdoc:m,immutableReferences:b,generatedSources:h,deployedGeneratedSources:v,db:L}=e;return{contractName:n||t,sourcePath:i,source:a,sourceMap:s,deployedSourceMap:o,legacyAST:c,ast:l,abi:u,metadata:d,bytecode:p?r(p):void 0,deployedBytecode:f?r(f):void 0,compiler:y,devdoc:g,userdoc:m,immutableReferences:b,generatedSources:h,deployedGeneratedSources:v,db:L}}function r(e){if("object"==typeof e)return e;const t=[];return{bytes:e.slice(2).replace(/__[^_]+_*/g,((e,n)=>{const r=e.match(/__([^_]+)_*/);if(null===r)throw new Error("Could not extract link reference name");const i=r[1],a=e.length,s=n/2,o=a/2;return t.push({offsets:[s],name:i,length:o}),"0".repeat(a)})),linkReferences:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.forBytecode=t.forContract=t.forContracts=void 0,t.forContracts=function(e){return Object.values(e).map(n)},t.forContract=n,t.forBytecode=r},749:(e,t)=>{"use strict";function n(e){if(!e)return e;if("string"==typeof e)return e;let{bytes:t,linkReferences:n}=e;return n=n||[],t=n.map((({offsets:e,length:t,name:n})=>e.map((e=>({offset:e,length:t,name:n}))))).reduce(((e,t)=>[...e,...t]),[]).reduce(((e,{offset:t,name:n,length:r})=>{const i=2*r;let a=`__${n.slice(0,i-2)}`;for(;a.length<i;)a+="_";const s=2*t;return`${e.substring(0,s)}${a}${e.substring(s+i)}`}),t),`0x${t}`}Object.defineProperty(t,"__esModule",{value:!0}),t.forBytecode=t.forContract=void 0,t.forContract=function(e){const{contractName:t,sourcePath:r,source:i,sourceMap:a,deployedSourceMap:s,legacyAST:o,ast:c,abi:l,metadata:u,bytecode:d,deployedBytecode:p,compiler:f,devdoc:y,userdoc:g,immutableReferences:m,generatedSources:b,deployedGeneratedSources:h,db:v}=e;return{contract_name:t,sourcePath:r,source:i,sourceMap:a,deployedSourceMap:s,legacyAST:o,ast:c,abi:l,metadata:u,bytecode:n(d),deployedBytecode:n(p),unlinked_binary:n(d),compiler:f,devdoc:y,userdoc:g,immutableReferences:m,generatedSources:b,deployedGeneratedSources:h,db:v}},t.forBytecode=n},467:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NewToLegacy=t.LegacyToNew=void 0,t.LegacyToNew=a(n(99)),t.NewToLegacy=a(n(749))},239:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.collectSources=void 0;const s=a(n(17));function o(e){let t=e;return"\\"===s.sep&&(t=e.replace(/\\/g,"/")),t.length>=2&&":"===t[1]&&(t="/"+t,t=t.replace(":","")),t}function c(e,t,n){return t.endsWith(s.sep)||(t+=s.sep),e.startsWith(t)?n+e.slice(t.length):e}t.collectSources=function(e,t=[],n="",r="/"){return Object.entries(e).filter((([e,t])=>!s.isAbsolute(e)||e.startsWith(n))).map((([e,t])=>({originalSourcePath:e,contents:t,sourcePath:o(c(e,n,r))}))).map((({originalSourcePath:e,sourcePath:n,contents:r})=>({sources:{[n]:r},targets:t.includes(e)?[n]:[],originalSourcePaths:{[n]:e}}))).reduce(((e,t)=>({sources:Object.assign({},e.sources,t.sources),targets:[...e.targets,...t.targets],originalSourcePaths:Object.assign({},e.originalSourcePaths,t.originalSourcePaths)})),{sources:{},targets:[],originalSourcePaths:{}})}},748:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},529:(e,t,n)=>{var r=n(65).Z;e.exports=r},65:(e,t,n)=>{"use strict";n.d(t,{Z:()=>as});var r={};n.r(r),n.d(r,{default:()=>gn,ensResolve:()=>sn,init:()=>fn,inspectTransaction:()=>Jt,obtainBinaries:()=>Qt,obtainStorage:()=>ln,reverseEnsResolve:()=>nn,saga:()=>yn});var i={};n.r(i),n.d(i,{addAffectedInstance:()=>Zn,addContext:()=>Kn,addInstance:()=>Yn,begin:()=>Jn,callstackAndCodexSaga:()=>er,default:()=>ar,recordStorage:()=>$n,refreshInstances:()=>Xn,requestCode:()=>qn,requestStorage:()=>zn,reset:()=>tr,saga:()=>ir,setStorageLookup:()=>rr,unload:()=>nr});var a={};n.r(a),n.d(a,{addContracts:()=>Ar,declare:()=>ur,decode:()=>vr,decodeCall:()=>xr,decodeLog:()=>Cr,decodeReturnValue:()=>Lr,default:()=>Rr,defineTaggedOutput:()=>yr,defineType:()=>fr,recordAllocations:()=>Ir,reset:()=>Sr,saga:()=>Er,scope:()=>lr,yulDeclare:()=>pr,yulScope:()=>dr});var s={};n.r(s),n.d(s,{begin:()=>Jr,default:()=>ei,reset:()=>Zr,saga:()=>Qr,unload:()=>Xr});var o={};n.r(o),n.d(o,{addSources:()=>ui,begin:()=>yi,default:()=>mi,reset:()=>pi,saga:()=>gi,unload:()=>fi});var c={};n.r(c),n.d(c,{begin:()=>wi,default:()=>ki,reset:()=>Ti,saga:()=>_i,unload:()=>Oi});var l={};n.r(l),n.d(l,{default:()=>Vi,reset:()=>Ki,saga:()=>Bi});const u=require("debug");var d=n.n(u);const p=require("@truffle/abi-utils"),f=require("@truffle/codec"),y=require("json-stable-stringify");var g=n.n(y);function m(e){return"FunctionCall"===e.nodeType&&"typeConversion"===e.kind?e.arguments[0]:"UnaryOperation"===e.nodeType&&"+"===e.operator?e.subExpression:"FunctionCall"===e.nodeType&&"functionCall"===e.kind&&["wrap","unwrap"].includes(f.Ast.Utils.functionClass(e.expression))?e.arguments[0]:null}function b(e){return["ContractDefinition","VariableDeclaration","YulVariableDeclaration","YulBlock"].includes(e.nodeType)}const h=["SourceUnit","YulObject"];function v(e){return h.includes(e.nodeType)}function L(e,t){return Object.defineProperty(t,"name",{value:`${e}.${t.name}`,configurable:!0}),t}function x(e,t){return`${e}:${t}`}function C(e,t,n){let r=e.slice();for(;t>0&&r.length>0;)n(r[r.length-1])&&t--,r.pop();return r}function S(...e){return f.Conversion.toHexString(f.Evm.Utils.keccak256(...e),f.Evm.Utils.WORD_SIZE)}function I(e){return S({type:"string",value:g()(e)})}function A(e,t){let n=I(e);return{...e,id:n,ref:t}}function E(e){return["CALL","DELEGATECALL","STATICCALL","CALLCODE"].includes(e)}function R(e){return["CREATE","CREATE2"].includes(e)}function T(e){return["SELFDESTRUCT","SUICIDE"].includes(e)}const O=require("redux"),w=require("redux-saga");var _=n.n(w);d()("debugger:store:common");const k="CONTROLLER_ADVANCE",D="CONTROLLER_STEP_NEXT",N="CONTROLLER_STEP_OVER",P="CONTROLLER_STEP_INTO",j="CONTROLLER_STEP_OUT",F="CONTROLLER_INTERRUPT",M="CONTROLLER_RUN_TO_END",U="CONTROLLER_CONTINUE",B="CONTROLLER_ADD_BREAKPOINT",V="CONTROLLER_REMOVE_BREAKPOINT",G="CONTROLLER_REMOVE_ALL_BREAKPOINTS",H="CONTROLLER_SET_INTERNAL_STEPPING",W="CONTROLLER_START_STEPPING",K="CONTROLLER_DONE_STEPPING",Y="SESSION_START",$="SESSION_LOAD_TRANSACTION",q="SESSION_INTERRUPT",z="SESSION_UNLOAD_TRANSACTION",Z="SESSION_READY";function X(){return{type:Z}}const J="SESSION_WAIT",Q="SESSION_ERROR",ee="SESSION_RECORD_CONTRACTS",te="SESSION_SAVE_TRANSACTION",ne="SESSION_SAVE_RECEIPT",re="SESSION_SAVE_BLOCK",ie="SESSION_SET_LIGHT_MODE",ae="SESSION_SET_FULL_MODE",se="SESSION_START_FULL_MODE",oe="SESSION_ADD_COMPILATIONS",ce=require("reselect-tree"),le=require("json-pointer");var ue=n.n(le);const de=require("lodash/merge");var pe=n.n(de);const fe=require("semver");var ye=n.n(fe);const ge={depth:-1,error:"",gas:0,memory:[],stack:[],storage:{},gasCost:0,op:"STOP",pc:-1};const me=(0,ce.createSelectorTree)({index:e=>e.trace.proc.index,loaded:(0,ce.createLeaf)(["/steps"],(e=>null!==e)),finished:e=>e.trace.proc.finished,finishedOrUnloaded:(0,ce.createLeaf)(["/finished","/loaded"],((e,t)=>e||!t)),steps:e=>e.trace.transaction.steps,stepsRemaining:(0,ce.createLeaf)(["./steps","./index"],((e,t)=>e.length-t)),step:(0,ce.createLeaf)(["./steps","./index"],((e,t)=>e?e.length>0?e[t]:ge:null)),next:(0,ce.createLeaf)(["./steps","./index"],((e,t)=>t<e.length-1?e[t+1]:ge)),nextOfSameDepth:(0,ce.createLeaf)(["./steps","./index"],((e,t)=>{let n=e[t].depth;for(let r of e.slice(t+1)){if(r.depth===n)return r;if(r.depth<n)return}})),application:{submoduleCount:e=>e.trace.application.submoduleCount}}),be=require("bn.js");var he=n.n(be);d()("debugger:evm:selectors");const ve="00".repeat(f.Evm.Utils.WORD_SIZE);function Le({address:e,binary:t},n,r,i){let a,s=Boolean(t);if(e)({context:a,binary:t}=n[e]);else{if(!s)return null;a=r(t)}return null!=a?{...i[a],binary:t}:{binary:t,isConstructor:s}}function xe(e,t=null){let n={trace:(0,ce.createLeaf)([e],(e=>{if(!e)return null;let{gasCost:t,op:n,pc:r}=e;return{gasCost:t,op:n,pc:r}})),programCounter:(0,ce.createLeaf)(["./trace"],(e=>e?e.pc:null)),isCall:(0,ce.createLeaf)(["./trace"],(e=>E(e.op))),isShortCall:(0,ce.createLeaf)(["./trace"],(e=>{return t=e.op,["DELEGATECALL","STATICCALL"].includes(t);var t})),isDelegateCallBroad:(0,ce.createLeaf)(["./trace"],(e=>{return t=e.op,["DELEGATECALL","CALLCODE"].includes(t);var t})),isDelegateCallStrict:(0,ce.createLeaf)(["./trace"],(e=>{return t=e.op,["DELEGATECALL"].includes(t);var t})),isStaticCall:(0,ce.createLeaf)(["./trace"],(e=>{return t=e.op,["STATICCALL"].includes(t);var t})),isCreate:(0,ce.createLeaf)(["./trace"],(e=>R(e.op))),isSelfDestruct:(0,ce.createLeaf)(["./trace"],(e=>T(e.op))),isCreate2:(0,ce.createLeaf)(["./trace"],(e=>"CREATE2"===e.op)),isStore:(0,ce.createLeaf)(["./trace"],(e=>"SSTORE"===e.op)),isLoad:(0,ce.createLeaf)(["./trace"],(e=>"SLOAD"===e.op)),touchesStorage:(0,ce.createLeaf)(["./isStore","isLoad"],((e,t)=>e||t)),isPop:(0,ce.createLeaf)(["./trace"],(e=>"POP"===e.op)),isLog:(0,ce.createLeaf)(["./topicCount"],(e=>null!==e)),topicCount:(0,ce.createLeaf)(["./trace"],(e=>{if(!e.op)return null;const t=e.op.match(/LOG(\d+)/);return t?Number(t[1]):null}))};var r;return t&&("string"==typeof(r=t)&&(r.startsWith("./")||r.startsWith("../"))&&(t=`../${t}`),Object.assign(n,{isJump:(0,ce.createLeaf)(["./trace",t],((e,{stack:t})=>"JUMP"===e.op||"JUMPI"===e.op&&t[t.length-2]!==ve)),valueStored:(0,ce.createLeaf)(["./isStore",t],((e,{stack:t})=>e?t[t.length-2]:null)),callAddress:(0,ce.createLeaf)(["./isCall",t],((e,{stack:t})=>{if(!e)return null;let n=t[t.length-2];return f.Evm.Utils.toAddress(n)})),createBinary:(0,ce.createLeaf)(["./isCreate",t],((e,{stack:t,memory:n})=>{if(!e)return null;const r=2*parseInt(t[t.length-2],16),i=2*parseInt(t[t.length-3],16);return"0x"+n.join("").substring(r,r+i).padEnd(i,"00")})),callData:(0,ce.createLeaf)(["./isCall","./isShortCall","./isCreate",t],((e,t,n,{stack:r,memory:i})=>{if(!e)return n?"0x":null;let a=t?1:0;const s=2*parseInt(r[r.length-4+a],16),o=2*parseInt(r[r.length-5+a],16);return"0x"+i.join("").substring(s,s+o).padEnd(o,"00")})),callValue:(0,ce.createLeaf)(["./isCall","./isDelegateCallStrict","./isStaticCall",t],((e,t,n,{stack:r})=>{if(!e||t)return null;if(n)return new(he())(0);let i=r[r.length-3];return f.Conversion.toBN(i)})),createValue:(0,ce.createLeaf)(["./isCreate",t],((e,{stack:t})=>{if(!e)return null;let n=t[t.length-1];return f.Conversion.toBN(n)})),storageAffected:(0,ce.createLeaf)(["./touchesStorage",t],((e,{stack:t})=>e?t[t.length-1]:null)),salt:(0,ce.createLeaf)(["./isCreate2",t],((e,{stack:t})=>e?"0x"+t[t.length-4]:null)),callContext:(0,ce.createLeaf)(["./callAddress","./createBinary","/current/codex/instances","/info/binaries/search","/info/contexts"],((e,t,n,r,i)=>Le({address:e,binary:t},n,r,i))),logData:(0,ce.createLeaf)(["./isLog",t],((e,{stack:t,memory:n})=>{if(!e)return null;const r=2*parseInt(t[t.length-1],16),i=2*parseInt(t[t.length-2],16);return"0x"+n.join("").substring(r,r+i).padEnd(i,"00")})),logTopics:(0,ce.createLeaf)(["./isLog","./topicCount",t],((e,t,{stack:n})=>e?n.slice(-2-t,-2).reverse().map((e=>"0x"+e)):null))})),n}const Ce=(0,ce.createSelectorTree)({state:e=>e.evm,application:{storageLookup:(0,ce.createLeaf)(["/state"],(e=>e.application.storageLookup)),storageLookupSupported:(0,ce.createLeaf)(["/state"],(e=>e.application.storageLookupSupported))},info:{contexts:(0,ce.createLeaf)(["/state"],(e=>e.info.contexts.byContext)),binaries:{search:(0,ce.createLeaf)(["/info/contexts"],(e=>t=>(f.Contexts.Utils.findContext(e,t)||{context:null}).context))}},transaction:{globals:{tx:(0,ce.createLeaf)(["/state"],(e=>e.transaction.globals.tx)),block:(0,ce.createLeaf)(["/state"],(e=>e.transaction.globals.block))},blockHash:(0,ce.createLeaf)(["/state"],(e=>e.transaction.txIdentification.blockHash)),txIndex:(0,ce.createLeaf)(["/state"],(e=>e.transaction.txIdentification.txIndex)),status:(0,ce.createLeaf)(["/state"],(e=>e.transaction.status)),initialCall:(0,ce.createLeaf)(["/state"],(e=>e.transaction.initialCall)),startingContext:(0,ce.createLeaf)(["/current/callstack","/current/codex/instances","/info/binaries/search","/info/contexts"],((e,t,n,r)=>e.length>0?Le(e[0],t,n,r):null)),affectedInstances:(0,ce.createLeaf)(["/state"],(e=>e.transaction.affectedInstances.byAddress))},current:{callstack:e=>e.evm.proc.callstack,call:(0,ce.createLeaf)(["./callstack"],(e=>e.length?e[e.length-1]:{})),context:(0,ce.createLeaf)(["./call","./codex/instances","/info/binaries/search","/info/contexts"],Le),isIR:(0,ce.createLeaf)(["./context"],(e=>!!e.settings&&Boolean(e.settings.viaIR))),state:Object.assign({},...["depth","error","gas","memory","stack"].map((e=>({[e]:(0,ce.createLeaf)([me.step],(t=>t[e]))})))),step:{...xe(me.step,"./state"),createdAddress:(0,ce.createLeaf)(["./isCreate","/nextOfSameDepth/state/stack","./isCreate2","./create2Address"],((e,t,n,r)=>{if(!e)return null;let i=t?f.Evm.Utils.toAddress(t[t.length-1]):f.Evm.Utils.ZERO_ADDRESS;return i===f.Evm.Utils.ZERO_ADDRESS&&n?r:i})),create2Address:(0,ce.createLeaf)(["./isCreate2","./createBinary","../call","../state/stack"],((e,t,{storageAddress:n},r)=>e?f.Evm.Utils.toAddress("0x"+S({type:"bytes",value:"0xff"+n.slice(2)+r[r.length-4]+S({type:"bytes",value:t}).slice(2)}).slice(2+2*(f.Evm.Utils.WORD_SIZE-f.Evm.Utils.ADDRESS_SIZE))):null)),isInstantCallOrCreate:(0,ce.createLeaf)(["./isCall","./isCreate","./isContextChange"],((e,t,n)=>(e||t)&&!n)),isContextChange:(0,ce.createLeaf)(["/current/state/depth","/next/state/depth"],((e,t)=>e!==t)),isNormalHalting:(0,ce.createLeaf)(["./isHalting","./returnStatus"],((e,t)=>e&&t)),isHalting:(0,ce.createLeaf)(["/current/state/depth","/next/state/depth",me.stepsRemaining],((e,t,n)=>t<e||0===n)),isExceptionalHalting:(0,ce.createLeaf)(["./isHalting","./returnStatus"],((e,t)=>e&&!t)),returnStatus:(0,ce.createLeaf)(["./isHalting","./isInstantCallOrCreate","/next/state",me.stepsRemaining,"/transaction/status"],((e,t,{stack:n},r,i)=>e||t?r<=1?i:n[n.length-1]!==ve:null)),returnValue:(0,ce.createLeaf)(["./trace","./isExceptionalHalting","../state"],((e,t,{stack:n,memory:r})=>{if("RETURN"!==e.op&&"REVERT"!==e.op)return"0x";if(t&&"REVERT"!==e.op)return"0x";const i=2*parseInt(n[n.length-1],16),a=2*parseInt(n[n.length-2],16);return"0x"+r.join("").substring(i,i+a).padEnd(a,"00")})),valueLoaded:(0,ce.createLeaf)(["./isLoad","/next/state"],((e,{stack:t})=>e?t[t.length-1]:null)),beneficiary:(0,ce.createLeaf)(["./isSelfDestruct","../state","../call"],((e,{stack:t},{storageAddress:n})=>{if(!e)return null;const r=f.Evm.Utils.toAddress(t[t.length-1]);return r!==n?r:null}))},codex:{_:(0,ce.createLeaf)(["/state"],(e=>e.proc.codex)),storage:(0,ce.createLeaf)(["./_","../call"],((e,{storageAddress:t})=>e[e.length-1].accounts[t].storage)),instances:(0,ce.createLeaf)(["./_"],(e=>Object.assign({},...Object.entries(e[e.length-1].accounts).map((([e,{code:t,context:n}])=>({[e]:{address:e,binary:t,context:n}}))))))}},next:{state:Object.assign({},...["depth","error","gas","memory","stack","storage"].map((e=>({[e]:(0,ce.createLeaf)([me.next],(t=>t[e]))})))),step:xe(me.next,"./state")},nextOfSameDepth:{state:Object.assign({},...["depth","error","gas","memory","stack","storage"].map((e=>({[e]:(0,ce.createLeaf)([me.nextOfSameDepth],(t=>t?t[e]:null))}))))}}),Se=require("@truffle/source-map-utils");var Ie=n.n(Se);const Ae=d()("debugger:sourcemapping:selectors");function Ee(e,t){Ae("context: %O",e),Ae("data: %O",t);const n=t.slice(0,2+2*f.Evm.Utils.SELECTOR_SIZE).padEnd(2+2*f.Evm.Utils.SELECTOR_SIZE,"00"),r=(e.abi||[]).some((e=>"fallback"===e.type||"receive"===e.type));return"Solidity"===e.primaryLanguage&&void 0!==e.compiler&&"solc"===e.compiler.name&&ye().satisfies(e.compiler.version,">=0.5.1",{includePrerelease:!0})&&!e.isConstructor&&(!r||(e.abi||[]).some((e=>"function"===e.type&&f.AbiData.Utils.abiSelector(e)===n)))}function Re(e){return{instruction:(0,ce.createLeaf)(["/current/instructionAtProgramCounter",e.programCounter],((e,t)=>e[t]||{})),modifierDepth:(0,ce.createLeaf)(["./instruction"],(e=>e.modifierDepth)),source:(0,ce.createLeaf)(["/current/sources","./instruction"],((e,{file:t})=>e&&e[t]||{})),findOverlappingRange:(0,ce.createLeaf)(["./source","/current/overlapFunctions"],(({index:e},t)=>(t||{})[e])),sourceRange:(0,ce.createLeaf)(["./instruction"],Ie().getSourceRange),pointerAndNode:(0,ce.createLeaf)(["./findOverlappingRange","./sourceRange"],((e,t)=>e?Ie().findRange(e,t.start,t.length):null)),pointer:(0,ce.createLeaf)(["./pointerAndNode"],(e=>e?e.pointer:null)),node:(0,ce.createLeaf)(["./source","./pointerAndNode"],(({ast:e},t)=>t?t.node:e)),contractNode:(0,ce.createLeaf)(["./source","./pointer"],(({ast:e},t)=>t?ue().get(e,t.replace(/\/nodes\/\d+$/,"")):e))}}let Te=(0,ce.createSelectorTree)({state:e=>e.sourcemapping,info:{sources:(0,ce.createLeaf)(["/state"],(e=>e.info.sources))},transaction:{bottomStackframeRequiresPhantomFrame:(0,ce.createLeaf)([Ce.transaction.startingContext,Ce.current.callstack],((e,t)=>Ee(e,t[0].data)))},current:{sourceIds:(0,ce.createLeaf)(["/info/sources",Ce.current.context],((e,t)=>{if(!t)return Ae("no context"),null;const{compilationId:n,context:r}=t;Ae("compilationId: %o",n);let i=[],a=[];return n&&e.byCompilationId[n]&&(i=e.byCompilationId[n].byIndex),e.byContext[r]&&(a=e.byContext[r].byIndex),Object.assign([],i,a)})),sources:(0,ce.createLeaf)(["/views/sources","/current/sourceIds"],((e,t)=>t?t.map((t=>e[t])):null)),sourceMap:(0,ce.createLeaf)([Ce.current.context],(e=>e?e.sourceMap:null)),humanReadableSourceMap:(0,ce.createLeaf)(["./sourceMap"],(e=>e?Ie().getHumanReadableSourceMap(e):null)),functionDepthStack:e=>e.sourcemapping.proc.functionDepthStack,nextFrameIsPhantom:e=>e.sourcemapping.proc.nextFrameIsPhantom,functionDepth:(0,ce.createLeaf)(["./functionDepthStack"],(e=>e[e.length-1])),callRequiresPhantomFrame:(0,ce.createLeaf)([Ce.current.step.callContext,Ce.current.step.callData],Ee),instructions:(0,ce.createLeaf)(["./sources",Ce.current.context,"./humanReadableSourceMap"],((e,t,n)=>t?(Ae("sources before processing: %O",e),Ie().getProcessedInstructionsForBinary((e||[]).map((e=>e?e.source:void 0)),t.binary,n)):[])),instructionAtProgramCounter:(0,ce.createLeaf)(["./instructions"],(e=>Object.assign({},...e.map((e=>({[e.pc]:e})))))),...Re(Ce.current.step),isSourceRangeFinalRaw:(0,ce.createLeaf)(["./instructionAtProgramCounter",Ce.current.step.programCounter,Ce.next.step.programCounter,Ce.current.step.isContextChange],((e,t,n,r)=>!(!r&&e[n])||(t=e[t],n=e[n],t.start!=n.start||t.length!=n.length||t.file!=n.file))),isSourceRangeFinal:(0,ce.createLeaf)(["./isSourceRangeFinalRaw","./source","/next/source",Ce.current.step.isContextChange],((e,t,n,r)=>r||e&&(t.internal||!n.internal))),functionsByProgramCounter:(0,ce.createLeaf)(["./instructions","./sources","./overlapFunctions",Ce.current.context],((e,t,n,{compilationId:r})=>Ie().getFunctionsByProgramCounter(e,t.map((({ast:e})=>e)),n,r))),isMultiline:(0,ce.createLeaf)(["./sourceRange"],(({lines:e})=>e.start.line!=e.end.line)),onYulFunctionDefinitionWhileEntering:(0,ce.createLeaf)(["./node","./pointer","../next/pointer"],((e,t,n)=>e&&"YulFunctionDefinition"===e.nodeType&&null!==n&&(n.startsWith(`${t}/body/`)||n.startsWith(`${t}/returnVariables`)))),willJump:(0,ce.createLeaf)([Ce.current.step.isJump],(e=>e)),jumpDirection:(0,ce.createLeaf)(["./instruction"],((e={})=>e.jump||"-")),willCall:(0,ce.createLeaf)([Ce.current.step.isCall,Ce.current.step.isCreate,Ce.current.step.isInstantCallOrCreate],((e,t,n)=>(e||t)&&!n)),willReturn:(0,ce.createLeaf)([Ce.current.step.isHalting],(e=>e)),nextUserStep:(0,ce.createLeaf)(["./instructionAtProgramCounter","/current/sources",me.steps,me.index],((e,t,n,r)=>n.slice(r+1).find((({pc:n})=>e[n]&&-1!==e[n].file&&!(t[e[n].file]&&t[e[n].file].internal))))),overlapFunctions:(0,ce.createLeaf)(["/views/overlapFunctions","/current/sourceIds"],((e,t)=>t?t.map((t=>e[t])):null))},next:Re(Ce.next.step),views:{sources:(0,ce.createLeaf)(["/info/sources"],(e=>e.byId)),overlapFunctions:(0,ce.createLeaf)(["/views/sources"],(e=>Object.assign({},...Object.entries(e).map((([e,{ast:t}])=>({[e]:Ie().makeOverlapFunction(t)}))))))}});const Oe=Te,we=require("lodash/zipWith");var _e=n.n(we);const ke=d()("debugger:stacktrace:selectors"),De=e=>e;function Ne(e,t,n,r){let i=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.combineWithNextInternal&&t<e.length-1&&"internal"===e[t+1].type&&!e[t+1].sourceIsInternal){const r={...e[t+1],calledFromLocation:n.calledFromLocation};i.push(r),t++}else i.push(n)}ke("callstack: %O",i);let a=i.map((e=>e.calledFromLocation));a.shift(),a.push(t),ke("locations: %O",a);const s=i.map((({functionName:e,contractName:t,address:n,isConstructor:r,type:i})=>({functionName:e,contractName:t,address:n,isConstructor:r,type:i})));ke("names: %O",s);let o=_e()(a,s,((e,t)=>({...t,location:e})));return null!==n&&(o[o.length-1].status=n),void 0!==r&&(void 0!==r.Error?o[0].message=r.Error:void 0!==r.Panic?o[0].panic=r.Panic:void 0!==r.custom&&(o[0].custom=r.custom)),o}function Pe(e){return{location:{source:(0,ce.createLeaf)([e.source],De),sourceRange:(0,ce.createLeaf)([e.sourceRange],De),node:(0,ce.createLeaf)([e.node],De),pointer:(0,ce.createLeaf)([e.pointer],De)},sourceIsInternal:(0,ce.createLeaf)(["./location/source"],(e=>void 0===e.id||e.internal)),sourceIsGenerated:(0,ce.createLeaf)(["./location/source"],(e=>e.internal)),strippedLocation:(0,ce.createLeaf)(["./location/source","./location/sourceRange","./location/node"],(({id:e,sourcePath:t,internal:n},r,i)=>({source:{id:e,sourcePath:t,internal:n},sourceRange:r,node:i?{id:i.id}:null}))),contractNode:(0,ce.createLeaf)([e.contractNode],De)}}let je=(0,ce.createSelectorTree)({state:e=>e.stacktrace,transaction:{initialCallCombinesWithNextJumpIn:(0,ce.createLeaf)([Oe.transaction.bottomStackframeRequiresPhantomFrame],De)},current:{callstack:{_:(0,ce.createLeaf)(["/state"],(e=>e.proc.callstack)),preupdated:(0,ce.createLeaf)(["./_","/current/returnCounter"],((e,t)=>C(e,t,(e=>"external"===e.type))))},returnCounter:(0,ce.createLeaf)(["/state"],(e=>e.proc.returnCounter)),lastPosition:(0,ce.createLeaf)(["/state"],(e=>e.proc.lastPosition)),innerReturnPosition:(0,ce.createLeaf)(["/state"],(e=>e.proc.innerReturnPosition)),innerReturnStatus:(0,ce.createLeaf)(["/state"],(e=>e.proc.innerReturnStatus)),innerErrorIndex:(0,ce.createLeaf)(["/state"],(e=>e.proc.innerErrorIndex)),...Pe(Oe.current),index:(0,ce.createLeaf)([me.index],De),updateIndex:(0,ce.createLeaf)(["./returnCounter",me.stepsRemaining,"./returnStatus"],((e,t,n)=>0===e&&t>1&&!n)),willJumpIn:(0,ce.createLeaf)([Oe.current.willJump,Oe.current.jumpDirection],((e,t)=>e&&"i"===t)),willJumpOut:(0,ce.createLeaf)([Oe.current.willJump,Oe.current.jumpDirection],((e,t)=>e&&"o"===t)),willCall:(0,ce.createLeaf)([Oe.current.willCall],De),context:(0,ce.createLeaf)([Ce.current.context],De),callContext:(0,ce.createLeaf)([Ce.current.step.callContext],De),callCombinesWithNextJumpIn:(0,ce.createLeaf)([Oe.current.callRequiresPhantomFrame],De),willReturn:(0,ce.createLeaf)([Oe.current.willReturn],De),returnStatus:(0,ce.createLeaf)([Ce.current.step.returnStatus],De),address:(0,ce.createLeaf)([Ce.current.call],(e=>e.storageAddress)),callAddress:(0,ce.createLeaf)([Ce.current.step.isCall,Ce.current.step.isCreate,Ce.current.step.callAddress,Ce.current.step.createdAddress],((e,t,n,r)=>e?n:t?r!==f.Evm.Utils.ZERO_ADDRESS?r:void 0:null)),revertString:(0,ce.createLeaf)([Ce.current.step.returnValue],(e=>{let t=f.decodeRevert(f.Conversion.toBytes(e));if(1!==t.length||"revert"!==t[0].kind)return 0===t.length?{custom:!0}:void 0;{const e=t[0];switch(e.abi.name){case"Error":const t=e.arguments[0].value.value;return{Error:f.Export.stringValueInfoToStringLossy(t)};case"Panic":return{Panic:e.arguments[0].value.value.asBN};default:return}}})),positionWillChange:(0,ce.createLeaf)(["/next/location","/current/location","./lastPosition"],((e,t,n)=>{let r=void 0===t.source.id||t.source.internal?n:t;return Boolean(r)&&Boolean(e.source)&&void 0!==e.source.id&&!e.source.internal&&(e.source.id!==r.source.id||e.sourceRange.start!==r.sourceRange.start||e.sourceRange.length!==r.sourceRange.length)})),finalReport:(0,ce.createLeaf)(["./callstack","./innerReturnPosition","./innerReturnStatus","./revertString"],Ne),report:(0,ce.createLeaf)(["./callstack/preupdated","./returnCounter","./lastPosition","/current/strippedLocation"],((e,t,n,r)=>Ne(e,r||n,null,void 0)))},next:{...Pe(Oe.next)}});const Fe=je,Me=d()("debugger:data:selectors"),Ue=e=>e;function Be(e,t,n,r=null,i=null){for(;e&&!t.includes(e.nodeType);)if(void 0!==e.id)e=n[n[e.id].parentId].definition;else{if(null===r||null===i||""===r)return null;r=r.replace(/\/[^/]*$/,""),e=ue().get(i,r)}return e}function Ve(e,t){let n;switch(e.nodeType){case"ModifierInvocation":n=e.modifierName.referencedDeclaration;break;case"InheritanceSpecifier":n=e.baseName.referencedDeclaration;break;default:Me("bad invocation node")}let r=t[n].definition;switch(r.nodeType){case"ModifierDefinition":return r;case"ContractDefinition":return r.nodes.find((e=>"FunctionDefinition"===e.nodeType&&"constructor"===f.Ast.Utils.functionKind(e)));default:return}}function Ge(e){let{context:t,contractName:n,binary:r,contractId:i,contractKind:a,isConstructor:s,abi:o,payable:c,compiler:l,compilationId:u}=e;return{context:t,contractName:n,binary:r,contractId:i,contractKind:a,isConstructor:s,abi:f.AbiData.Utils.computeSelectors(o),fallbackAbi:{fallback:(o||[]).find((e=>"fallback"===e.type))||null,receive:(o||[]).find((e=>"receive"===e.type))||null},payable:c,compiler:l,compilationId:u}}const He={id:-1,src:"0:0:-1",name:"now",nodeType:"VariableDeclaration",typeDescriptions:{typeIdentifier:"t_uint256",typeString:"uint256"}},We={id:-1,src:"0:0:-1",name:"msg",nodeType:"VariableDeclaration",typeDescriptions:{typeIdentifier:"t_magic_message",typeString:"msg"}},Ke={id:-1,src:"0:0:-1",name:"tx",nodeType:"VariableDeclaration",typeDescriptions:{typeIdentifier:"t_magic_transaction",typeString:"tx"}},Ye={id:-1,src:"0:0:-1",name:"block",nodeType:"VariableDeclaration",typeDescriptions:{typeIdentifier:"t_magic_block",typeString:"block"}},$e=(0,ce.createSelectorTree)({state:e=>e.data,views:{atLastInstructionForSourceRange:(0,ce.createLeaf)([Oe.current.isSourceRangeFinal],(e=>e)),scopes:{_:(0,ce.createLeaf)(["/info/scopes"],(e=>Object.assign({},...Object.entries(e).map((([e,{byAstRef:t}])=>({[e]:t})))))),inlined:(0,ce.createLeaf)(["./_",Oe.views.sources],((e,t)=>Object.assign({},...Object.entries(e).map((([e,n])=>({[e]:Object.assign({},...Object.entries(n).map((([e,n])=>({[e]:{...n,definition:ue().get(t[n.sourceId].ast,n.pointer)}}))))}))))))},userDefinedTypesByCompilation:(0,ce.createLeaf)(["/info/userDefinedTypes","./referenceDeclarations","./scopes/inlined",Oe.views.sources],((e,t,n,r)=>{let i={};for(const{sourceId:a,id:s}of e){const e=n[a][s].definition,{compilationId:o,compiler:c,internal:l}=r[a];if(l)continue;const u=f.Ast.Import.definitionToStoredType(e,o,c,t[o]);i[o]||(i[o]={compiler:c,types:{}}),i[o].types[u.id]=u}return i})),userDefinedTypes:(0,ce.createLeaf)(["./userDefinedTypesByCompilation"],f.Format.Types.forgetCompilations),contractAllocationInfo:(0,ce.createLeaf)(["/info/userDefinedTypes","/views/scopes/inlined","/info/contracts",Oe.views.sources,Ce.info.contexts],((e,t,n,r,i)=>Object.values(e).filter((({sourceId:e,id:n})=>!r[e].internal&&"ContractDefinition"===t[e][n].definition.nodeType)).map((({sourceId:e,id:a})=>{Me("id: %O",a);const s=r[e].compilationId;Me("compilationId: %O",s);const o=n[s].byAstId[a],c=i[o.deployedContext],l=i[o.constructorContext],u=(c||{}).immutableReferences;return{contractNode:t[e][a].definition,compilationId:s,immutableReferences:u,compiler:r[e].compiler,abi:o.abi,deployedContext:c,constructorContext:l}})))),referenceDeclarations:(0,ce.createLeaf)(["./scopes/inlined","/info/userDefinedTypes","/info/taggedOutputs",Oe.views.sources],((e,t,n,r)=>pe()({},...t.concat(n).map((({id:t,sourceId:n})=>{const i=r[n];return i.internal?{}:{[i.compilationId]:{[t]:e[n][t].definition}}}))))),mappingKeys:(0,ce.createLeaf)(["/proc/mappedPaths","/current/address"],((e,t)=>[].concat(...Object.values((e.byAddress[t]||{byType:{}}).byType).map((({bySlotAddress:e})=>Object.values(e)))).filter((e=>void 0!==e.key)))),blockNumber:(0,ce.createLeaf)([Ce.transaction.globals.block],(e=>e.number.toString())),blockHash:(0,ce.createLeaf)([Ce.transaction.blockHash],Ue),txIndex:(0,ce.createLeaf)([Ce.transaction.txIndex],Ue),instances:(0,ce.createLeaf)([Ce.current.codex.instances],(e=>Object.assign({},...Object.entries(e).map((([e,{binary:t}])=>({[e]:f.Conversion.toBytes(t)})))))),contexts:(0,ce.createLeaf)([Ce.info.contexts],(e=>Object.assign({},...Object.values(e).map((e=>({[e.context]:Ge(e)}))))))},info:{scopes:(0,ce.createLeaf)(["/state"],(e=>e.info.scopes.bySourceId)),contracts:(0,ce.createLeaf)(["/state"],(e=>e.info.contracts.byCompilationId)),allocations:{storage:(0,ce.createLeaf)(["/state"],(e=>e.info.allocations.storage)),state:(0,ce.createLeaf)(["/state"],(e=>e.info.allocations.state)),memory:(0,ce.createLeaf)(["/state"],(e=>e.info.allocations.memory)),abi:(0,ce.createLeaf)(["/state"],(e=>e.info.allocations.abi)),calldata:(0,ce.createLeaf)(["/state"],(e=>e.info.allocations.calldata)),returndata:(0,ce.createLeaf)(["/state"],(e=>e.info.allocations.returndata)),event:(0,ce.createLeaf)(["/state"],(e=>e.info.allocations.event))},userDefinedTypes:(0,ce.createLeaf)(["/state"],(e=>e.info.userDefinedTypes)),taggedOutputs:(0,ce.createLeaf)(["/state"],(e=>e.info.taggedOutputs))},proc:{assignments:(0,ce.createLeaf)(["/state"],(e=>e.proc.assignments.byId)),mappedPaths:(0,ce.createLeaf)(["/state"],(e=>e.proc.mappedPaths))},current:{state:{stack:(0,ce.createLeaf)([Ce.current.state.stack],(e=>(e||[]).map((e=>f.Conversion.toBytes(e))))),memory:(0,ce.createLeaf)([Ce.current.state.memory],(e=>f.Conversion.toBytes(e.join("")))),code:(0,ce.createLeaf)([Ce.current.context],(({binary:e})=>f.Conversion.toBytes(e))),calldata:(0,ce.createLeaf)([Ce.current.call],(({data:e})=>f.Conversion.toBytes(e))),eventdata:(0,ce.createLeaf)([Ce.current.step.logData],(e=>null!==e?f.Conversion.toBytes(e):void 0)),eventtopics:(0,ce.createLeaf)([Ce.current.step.logTopics],(e=>null!==e?e.map((e=>f.Conversion.toBytes(e))):void 0)),storage:(0,ce.createLeaf)([Ce.current.codex.storage],(e=>Object.assign({},...Object.entries(e).map((([e,t])=>({[`0x${e}`]:f.Conversion.toBytes(t)})))))),specials:(0,ce.createLeaf)(["/current/address",Ce.current.call,Ce.transaction.globals],((e,{sender:t,value:n},{tx:r,block:i})=>({this:f.Conversion.toBytes(e),sender:f.Conversion.toBytes(t),value:f.Conversion.toBytes(n),...Object.assign({},...Object.entries(r).map((([e,t])=>({[e]:f.Conversion.toBytes(t)})))),...Object.assign({},...Object.entries(i).map((([e,t])=>({[e]:f.Conversion.toBytes(t)}))))})))},compilationId:(0,ce.createLeaf)([Ce.current.context],(e=>e?.compilationId)),sourceIndex:(0,ce.createLeaf)([Oe.current.source],(({index:e})=>e)),language:(0,ce.createLeaf)([Oe.current.source],(({language:e})=>e)),internalSourceFor:(0,ce.createLeaf)([Oe.current.source],(({internalFor:e})=>e||null)),root:(0,ce.createLeaf)([Oe.current.source],(({ast:e})=>e)),scopes:{_:(0,ce.createLeaf)(["./raw","./inlined/raw"],((e,t)=>e&&t?Object.assign({},...Object.entries(e).map((([n,r])=>{let i=t[n].definition;if("ContractDefinition"===i.nodeType){Me("contract id %d",n);let a={...r};const s=i.linearizedBaseContracts.slice().reverse();return s.pop(),a.variables=[].concat(...s.map((t=>e[t].variables||[]))).filter((e=>"private"!==t[e.astRef].definition.visibility)).concat(e[n].variables||[]).filter((e=>{Me("variable %O",e);const n=t[e.astRef].definition;return!(n.constant||"constant"===n.mutability)||f.Ast.Utils.isSimpleConstant(n.value)})),{[n]:a}}if("SourceUnit"===i.nodeType){let e={...r};return e.variables=Object.values(i.exportedSymbols).map((e=>e[0])).filter((e=>{const n=t[e].definition;return"VariableDeclaration"===n.nodeType&&(n.constant||"constant"===n.mutability)&&f.Ast.Utils.isSimpleConstant(n.value)})).map((e=>({astRef:e,name:t[e].definition.name,sourceId:t[e].sourceId}))),{[n]:e}}return{[n]:r}}))):null)),raw:(0,ce.createLeaf)(["/views/scopes",Oe.current.sourceIds],((e,t)=>t?Object.assign({},...t.map((t=>e[t]))):null)),inlined:{_:(0,ce.createLeaf)(["./raw","../_"],((e,t)=>e?Object.assign({},...Object.entries(e).map((([e,n])=>({[e]:{...n,variables:t[e].variables}})))):null)),raw:(0,ce.createLeaf)(["/views/scopes/inlined",Oe.current.sourceIds],((e,t)=>t?Object.assign({},...t.map((t=>e[t]))):null))}},referenceDeclarations:(0,ce.createLeaf)(["/views/referenceDeclarations","./compilationId"],((e,t)=>e[t])),allocations:{state:(0,ce.createLeaf)(["/info/allocations/state","../compilationId",Ce.current.context],((e,t,{isConstructor:n})=>{Me("compilationId: %s",t),Me("allAllocations: %o",e);const r=t?e[t]:{};let i=Object.assign({},...Object.entries(r).map((([e,t])=>({[e]:{members:t.members.map((e=>({...e})))}}))));if(n)for(const e in i){const t=i[e];let n=4*f.Evm.Utils.WORD_SIZE;for(const e of t.members)"code"!==e.pointer.location&&"nowhere"!==e.pointer.location||(e.pointer={location:"memory",start:n,length:f.Evm.Utils.WORD_SIZE},n+=f.Evm.Utils.WORD_SIZE)}return Object.assign({},...Object.entries(i).map((([e,t])=>({[e]:{members:Object.assign({},...t.members.map((e=>({[e.definition.id]:e}))))}}))))}))},compiler:(0,ce.createLeaf)([Ce.current.context],(e=>e?.compiler)),bareLetsInYulAreHit:(0,ce.createLeaf)(["./compiler"],(e=>void 0!==e&&"solc"===e.name&&ye().satisfies(e.version,">=0.6.8",{includePrerelease:!0}))),node:(0,ce.createLeaf)([Oe.current.node],Ue),pointer:(0,ce.createLeaf)([Oe.current.pointer],Ue),astRef:(0,ce.createLeaf)([Oe.current.node,Oe.current.pointer,"./sourceIndex"],((e,t,n)=>e?void 0!==e.id?e.id:x(n,t):null)),scope:(0,ce.createLeaf)(["./node"],Ue),contract:(0,ce.createLeaf)(["./node","./scopes/inlined","./pointer","./root"],((e,t,n,r)=>Be(e,["ContractDefinition",...h],t,n,r))),contractForBytecode:(0,ce.createLeaf)([Ce.current.context,"./scopes/inlined"],(({contractId:e},t)=>(t[e]||{definition:null}).definition)),fallbackOutputForContext:(0,ce.createLeaf)(["./contractForBytecode"],(e=>{if(!e)return null;const t=e.nodes.find((e=>"FunctionDefinition"===e.nodeType&&"fallback"===f.Ast.Utils.functionKind(e)));return t&&t.returnParameters.parameters[0]||null})),function:(0,ce.createLeaf)(["./node","./scopes/inlined","./pointer","./root"],((e,t,n,r)=>Be(e,["FunctionDefinition","ModifierDefinition","ContractDefinition",...h],t,n,r))),inModifier:(0,ce.createLeaf)(["./function"],(e=>e&&"ModifierDefinition"===e.nodeType)),inFunctionOrModifier:(0,ce.createLeaf)(["./function"],(e=>e&&("FunctionDefinition"===e.nodeType||"ModifierDefinition"===e.nodeType))),functionDepth:(0,ce.createLeaf)([Oe.current.functionDepth],Ue),modifierDepth:(0,ce.createLeaf)([Oe.current.modifierDepth],Ue),address:(0,ce.createLeaf)([Ce.current.call],(e=>e.storageAddress)),functionsByProgramCounter:(0,ce.createLeaf)([Oe.current.functionsByProgramCounter],(e=>e)),internalFunctionsTable:(0,ce.createLeaf)([Ce.current.isIR,"./functionsByProgramCounter","./functionsByIndex"],((e,t,n)=>e?n:t)),internalFunctionsTableKind:(0,ce.createLeaf)([Ce.current.isIR],(e=>e?"index":"pcpair")),functionsByIndex:(0,ce.createLeaf)([Ce.current.context,"./scopes/inlined"],(({compilationId:e,contractId:t},n)=>{if(void 0===t)return;const r=n[t].definition;return r.internalFunctionIDs?Object.assign([{isDesignatedInvalid:!0}],...Object.entries(r.internalFunctionIDs).map((([t,r])=>{t=Number(t);let{definition:i,pointer:a,parentId:s}=n[t],{definition:o,pointer:c}=n[s];return"ContractDefinition"!==o.nodeType&&(o=null,s=null,c=null),{[r]:{isDesignatedInvalid:!1,sourceIndex:Number(i.src.split(":")[2]),compilationId:e,pointer:a,node:i,name:i.name,id:t,mutability:f.Ast.Utils.mutability(i),contractPointer:c,contractNode:o,contractName:o?o.name:null,contractId:s,contractKind:o?o.contractKind:null,contractPayable:o?f.Ast.Utils.isContractPayable(o):null}}}))):void 0})),context:(0,ce.createLeaf)([Ce.current.context],Ge),fallbackBase:(0,ce.createLeaf)(["./context"],(({abi:e})=>Object.keys(e).length>0?1:0)),errorLocation:(0,ce.createLeaf)([Fe.current.innerReturnPosition,Fe.current.lastPosition],((e,t)=>e||t||{})),errorNode:(0,ce.createLeaf)(["./errorLocation","/views/scopes/inlined"],((e,t)=>{const n=(e.source||{}).id,r=(e.node||{}).id;return void 0!==n&&void 0!==r?t[n][r].definition:null})),errorId:(0,ce.createLeaf)(["./errorNode","./compilationId"],((e,t)=>{if(null!==e)switch(e.nodeType){case"RevertStatement":e=e.errorCall;case"FunctionCall":if("error"!==f.Ast.Utils.functionClass(e.expression))return;const n=e.expression.referencedDeclaration;return f.Contexts.Import.makeTypeId(n,t);default:return}})),eventId:(0,ce.createLeaf)(["./node","./compilationId"],((e,t)=>{if(e)switch(e.nodeType){case"EmitStatement":e=e.eventCall;case"FunctionCall":if("event"!==f.Ast.Utils.functionClass(e.expression))return;const n=e.expression.referencedDeclaration;return f.Contexts.Import.makeTypeId(n,t);default:return}})),aboutToModify:(0,ce.createLeaf)(["./node","./modifierInvocation","./modifierArgumentIndex","/next/node","/next/modifierInvocation",Ce.current.step.isContextChange],((e,t,n,r,i,a)=>{if(a||!e||void 0===e.id||!r||void 0===r.id||!t||void 0===t.id||!i||void 0===i.id)return!1;if(v(t))return!1;if("FunctionDefinition"===r.nodeType||"ModifierDefinition"===r.nodeType)return!1;if(!v(i)&&i.id===t.id)return!1;if(void 0===n)return!1;let s=t.arguments[n];do{if(e.id===s.id)return!0}while(s=m(s));return!1})),modifierInvocation:(0,ce.createLeaf)(["./node","./scopes/inlined"],((e,t)=>Be(e,["ModifierInvocation","InheritanceSpecifier",...h],t))),modifierArgumentIndex:(0,ce.createLeaf)(["./scopes","./node","./modifierInvocation"],((e,t,n)=>{if(!n||v(n))return;let r=e[t.id].pointer,i=e[n.id].pointer,a=r.slice(i.length);Me("difference %s",a);let s=a.match(/^\/arguments\/(\d+)/);return Me("rawIndex %o",s),null!==s?parseInt(s[1]):void 0})),modifierBeingInvoked:(0,ce.createLeaf)(["./modifierInvocation","./scopes/inlined"],((e,t)=>{if(e&&!v(e))return Ve(e,t)})),onYulFunctionDefinitionWhileEntering:(0,ce.createLeaf)([Oe.current.onYulFunctionDefinitionWhileEntering],Ue),identifiers:{_:(0,ce.createLeaf)(["/current/scopes/inlined","/current/node","/current/pointer","/current/sourceIndex","/current/language"],((e,t,n,r,i)=>{let a={};if(void 0!==t){let i=void 0!==t.id?t.id:x(r,n);for(;null!==i&&e[i]&&(Me("cur: %o",i),Me("scopes[cur]: %o",e[i]),a=Object.assign(a,...(e[i].variables||[]).filter((e=>""!==e.name)).filter((e=>null==a[e.name])).map((e=>({[e.name]:{astRef:e.astRef}})))),"YulFunctionDefinition"!==e[i].definition.nodeType);)i=void 0!==e[i].parentId?e[i].parentId:i.replace(/\/[^/]*(\/\d+)?$/,"")}return"Solidity"!==i||t&&(t.nodeType.startsWith("Yul")||"InlineAssembly"===t.nodeType)?a:{msg:{builtin:"msg"},tx:{builtin:"tx"},block:{builtin:"block"},this:{builtin:"this"},now:{builtin:"now"},...a}})),definitions:{_:(0,ce.createLeaf)(["/current/scopes/inlined","../_","./this","/current/compiler"],((e,t,n,r)=>{Me("identifiers: %O",t);let i=Object.assign({},...Object.entries(t).map((([t,n])=>{if(void 0!==n.astRef){let{definition:r}=e[n.astRef];return{[t]:r}}return{}}))),a={msg:We,tx:Ke,block:Ye};return n&&(a.this=n),function(e){return e&&"solc"===e.name&&ye().satisfies(e.version,"~0.7 || >=0.7.0",{includePrerelease:!0})}(r)||(Me("adding now"),a.now=He),{...a,...i}})),this:(0,ce.createLeaf)(["/current/contract"],(e=>{return e&&"ContractDefinition"===e.nodeType?(t=e.name,n=e.id,r=e.contractKind,{id:-1,src:"0:0:-1",name:"this",nodeType:"VariableDeclaration",typeDescriptions:{typeIdentifier:"t_contract$_"+t.replace(/\$/g,"$$".repeat(3))+"_$"+n,typeString:r+" "+t}}):null;var t,n,r}))},sections:(0,ce.createLeaf)(["./definitions","./refs","/current/scopes/inlined"],((e,t,n)=>{let r={builtin:[],global:[],contract:[],local:[]};if(!n)return r;for(const[i,a]of Object.entries(t))if(i in e)switch(a.location){case"special":r.builtin.push(i);break;case"stack":r.local.push(i);break;case"storage":case"code":case"nowhere":case"memory":r.contract.push(i);break;case"definition":const t=n[e[i].scope].definition;"SourceUnit"===t.nodeType?r.global.push(i):"ContractDefinition"===t.nodeType&&r.contract.push(i)}return r})),refs:(0,ce.createLeaf)(["/proc/assignments","./_","./definitions","/current/scopes/inlined","/current/compilationId","/current/internalSourceFor","/current/functionDepth","/current/modifierDepth","/current/inModifier"],((e,t,n,r,i,a,s,o,c)=>Object.assign({},...Object.entries(t).map((([t,{astRef:l,builtin:u}])=>{let d;if(Me("astRef: %o",l),Me("builtin: %s",u),void 0!==l){if(d=I({astRef:l,compilationId:i,internalFor:a}),d in e||(d=I({astRef:l,compilationId:i,internalFor:a,stackframe:s,modifierDepth:c?o:null})),Me("id after local: %s",d),!(d in e)){const e=n[t];if(!(Me("global definition: %o",e),void 0===e.scope||"SourceUnit"!==r[e.scope].definition.nodeType||!0!==e.constant&&"constant"!==e.mutability))return{[t]:{location:"definition",definition:e.value}}}}else d=I({builtin:u});Me("id: %s",d);let{ref:p}=e[d]||{};return p?{[t]:p}:{}})))))},returnStatus:(0,ce.createLeaf)([Ce.current.step.returnStatus],(e=>null===e?void 0:e)),returnAllocation:(0,ce.createLeaf)([Ce.current.call,"/current/context","/info/allocations/calldata","./fallbackOutputForContext"],(({data:e},{context:t,isConstructor:n,fallbackAbi:r},{constructorAllocations:i,functionAllocations:a},s)=>{if(n){let e=i[t];return e?e.output:null}{let n=e.slice(0,10);Me("selector: %s",n),Me("bySelector: %o",a[t]);let i=(a[t]||{})[n];return i?i.output:"0x"===e&&null!==r.receive||null===r.fallback||!s?null:f.AbiData.Allocate.FallbackOutputAllocation}})),isCall:(0,ce.createLeaf)([Ce.current.step.isCall],Ue),isCreate:(0,ce.createLeaf)([Ce.current.step.isCreate],Ue),currentCallIsCreate:(0,ce.createLeaf)([Ce.current.call],(e=>void 0!==e.binary)),callContext:(0,ce.createLeaf)([Ce.current.step.callContext],Ge),isPop:(0,ce.createLeaf)([Ce.current.step.isPop],Ue)},next:{state:{stack:(0,ce.createLeaf)([Ce.next.state.stack],(e=>(e||[]).map((e=>f.Conversion.toBytes(e))))),returndata:(0,ce.createLeaf)([Ce.current.step.returnValue],(e=>f.Conversion.toBytes(e))),calldata:(0,ce.createLeaf)([Ce.current.step.isCall,Ce.current.step.isCreate,Ce.current.step.callData,Ce.current.step.createBinary],((e,t,n,r)=>e||t?f.Conversion.toBytes(e?n:r):null))},node:(0,ce.createLeaf)([Oe.next.node],Ue),pointer:(0,ce.createLeaf)([Oe.next.pointer],Ue),modifierInvocation:(0,ce.createLeaf)(["./node","/current/scopes/inlined",Ce.current.step.isContextChange],((e,t,n)=>{if(!n)return Be(e,["ModifierInvocation","InheritanceSpecifier",...h],t)})),modifierBeingInvoked:(0,ce.createLeaf)(["./modifierInvocation","/current/scopes/inlined",Ce.current.step.isContextChange],((e,t,n)=>{if(!n&&e&&!v(e))return Ve(e,t)}))},nextUserStep:{state:{stack:(0,ce.createLeaf)([Oe.current.nextUserStep],(e=>((e||{}).stack||[]).map((e=>f.Conversion.toBytes(e)))))}},nextOfSameDepth:{state:{stack:(0,ce.createLeaf)([me.nextOfSameDepth],(e=>e?(e.stack||[]).map((e=>f.Conversion.toBytes(e))):null))}}}),qe=$e,ze=(d()("debugger:txlog:selectors"),e=>e);function Ze(e){return{source:(0,ce.createLeaf)([e.source],ze),astNode:(0,ce.createLeaf)([e.node],ze),inInternalSourceOrYul:(0,ce.createLeaf)(["./source","./astNode"],((e,t)=>!t||e.internal||t.nodeType.startsWith("Yul")||"ContractDefinition"===t.nodeType))}}let Xe=(0,ce.createSelectorTree)({state:e=>e.txlog,proc:{transactionLog:(0,ce.createLeaf)(["/state"],(e=>e.proc.transactionLog.byPointer))},transaction:{origin:(0,ce.createLeaf)([Ce.transaction.globals.tx],(e=>e.origin)),initialCall:(0,ce.createLeaf)(["/state"],(e=>e.transaction.initialCall)),absorbFirstInternalCall:(0,ce.createLeaf)([Oe.transaction.bottomStackframeRequiresPhantomFrame],ze)},current:{...Ze(Oe.current),state:(0,ce.createLeaf)([Ce.current.state],ze),pointer:(0,ce.createLeaf)(["/state"],(e=>e.proc.currentNodePointer)),pointerStack:(0,ce.createLeaf)(["/state"],(e=>e.proc.pointerStack)),node:(0,ce.createLeaf)(["./pointer","/proc/transactionLog"],((e,t)=>t[e])),step:(0,ce.createLeaf)([me.index,me.steps],((e,t)=>0===t.length?-1:e)),waitingForFunctionDefinition:(0,ce.createLeaf)(["./node"],(e=>("callinternal"===e.type||"callexternal"===e.type)&&e.waitingForFunctionDefinition)),waitingForInternalCallToAbsorb:(0,ce.createLeaf)(["./node"],(e=>"callexternal"===e.type&&e.absorbNextInternalCall)),nextActionPointer:(0,ce.createLeaf)(["./pointer","./node"],((e,t)=>`${e}/actions/${t.actions.length}`)),internalReturnPointer:(0,ce.createLeaf)(["./pointer","./node"],((e,t)=>"callinternal"===t.type?e.replace(/\/actions\/\d+$/,""):e)),externalReturnPointer:(0,ce.createLeaf)(["./pointerStack"],(e=>e[e.length-1].replace(/\/actions\/\d+$/,""))),context:(0,ce.createLeaf)([qe.current.context],ze),call:(0,ce.createLeaf)([Ce.current.call],ze),contract:(0,ce.createLeaf)([qe.current.contract],ze),isSourceRangeFinal:(0,ce.createLeaf)([Oe.current.isSourceRangeFinal],ze),onFunctionDefinition:(0,ce.createLeaf)(["./astNode","./isSourceRangeFinal","/next/inInternalSourceOrYul",me.stepsRemaining],((e,t,n,r)=>(t||r<=2)&&e&&"FunctionDefinition"===e.nodeType&&!n)),currentFunctionIsAsExpected:(0,ce.createLeaf)(["./node",qe.current.function,qe.current.contract],((e,t,n)=>t&&("ContractDefinition"===t.nodeType||"ModifierDefinition"===t.nodeType||"FunctionDefinition"===t.nodeType&&t.name===e.functionName&&("callexternal"===e.kind||n&&n.name===e.contractName)))),compilationId:(0,ce.createLeaf)([qe.current.compilationId],ze),isJump:(0,ce.createLeaf)([Ce.current.step.isJump],ze),jumpDirection:(0,ce.createLeaf)([Oe.current.jumpDirection],ze),isLog:(0,ce.createLeaf)([Ce.current.step.isLog],ze),isStore:(0,ce.createLeaf)([Ce.current.step.isStore],ze),rawStorageSlot:(0,ce.createLeaf)([Ce.current.step.isStore,Ce.current.step.storageAffected],((e,t)=>e?"0x"+t:null)),rawStorageValue:(0,ce.createLeaf)([Ce.current.step.valueStored],(e=>null!==e?"0x"+e:null)),rawEventInfo:{topics:(0,ce.createLeaf)([Ce.current.step.logTopics],ze),data:(0,ce.createLeaf)([Ce.current.step.logData],ze)},isCall:(0,ce.createLeaf)([Ce.current.step.isCall],ze),isDelegateCallBroad:(0,ce.createLeaf)([Ce.current.step.isDelegateCallBroad],ze),isCreate:(0,ce.createLeaf)([Ce.current.step.isCreate],ze),isInstantCallOrCreate:(0,ce.createLeaf)([Ce.current.step.isInstantCallOrCreate],ze),isHalting:(0,ce.createLeaf)([Ce.current.step.isHalting],ze),returnStatus:(0,ce.createLeaf)([Ce.current.step.returnStatus],ze),callValue:(0,ce.createLeaf)([Ce.current.step.callValue],ze),callAddress:(0,ce.createLeaf)([Ce.current.step.callAddress],ze),callContext:(0,ce.createLeaf)([qe.current.callContext],ze),absorbNextInternalCall:(0,ce.createLeaf)([Oe.current.callRequiresPhantomFrame],ze),callData:(0,ce.createLeaf)([Ce.current.step.callData],ze),createBinary:(0,ce.createLeaf)([Ce.current.step.createBinary],ze),createValue:(0,ce.createLeaf)([Ce.current.step.createValue],ze),createdAddress:(0,ce.createLeaf)([Ce.current.step.createdAddress],ze),salt:(0,ce.createLeaf)([Ce.current.step.salt],ze),isSelfDestruct:(0,ce.createLeaf)([Ce.current.step.isSelfDestruct],ze),beneficiary:(0,ce.createLeaf)([Ce.current.step.beneficiary],ze),returnData:(0,ce.createLeaf)([Ce.current.step.returnValue],ze),inputParameterAllocations:(0,ce.createLeaf)(["./astNode","./state"],((e,{stack:t})=>e&&"FunctionDefinition"===e.nodeType?Je(e.parameters.parameters,t.length-1):null)),outputParameterAllocations:(0,ce.createLeaf)(["./astNode","./state"],((e,{stack:t})=>e&&"FunctionDefinition"===e.nodeType?Je(e.returnParameters.parameters,t.length-2):null))},next:{...Ze(Oe.next)},views:{transactionLog:(0,ce.createLeaf)(["/proc/transactionLog"],(e=>{const t=n=>n.actions?{...n,actions:n.actions.map((n=>t(e[n])))}:n;return t(e[""])})),flattedEvents:(0,ce.createLeaf)(["./transactionLog"],(e=>{const t=e=>{switch(e.returnKind){case"revert":return!1;case"unwind":const n=e.actions[e.actions.length-1];return t(n);default:return!0}},n=(e,r,i,a)=>{switch(e.type){case"transaction":return e.actions.flatMap((t=>n(t,e.origin,e.origin,a)));case"callexternal":const s=t(e);return e.actions.flatMap((t=>n(t,e.isDelegate?r:e.address,e.address,a&&s)));case"callinternal":return e.actions.flatMap((e=>n(e,r,i,a)));case"event":return[{decoding:e.decoding,raw:e.raw,step:e.step,address:r,codeAddress:i,status:a}];default:return[]}};return n(e,null,null,!0)}))}});function Je(e,t){const n=e.slice().reverse();let r=[],i=t;for(let e of n){const t=f.Ast.Utils.stackSize(e),n={location:"stack",from:i-t+1,to:i};r.unshift({name:e.name?e.name:void 0,definition:e,pointer:n}),i-=t}return r}const Qe=Xe,et=d()("debugger:session:selectors"),tt=(0,ce.createSelectorTree)({state:e=>e.session,info:{affectedInstances:(0,ce.createLeaf)([Ce.transaction.affectedInstances,Ce.info.contexts,Oe.info.sources],((e,t,n)=>Object.assign({},...Object.entries(e).map((([r,{context:i,binary:a,creationBinary:s,creationContext:o}])=>{et("instances %O",e),et("contexts %O",t);let c=t[i];if(!c)return{[r]:{binary:a}};let{contractName:l,compilationId:u,primarySource:d}=c;et("primarySource: %o",d),et("compilationId: %s",u),et("sources: %o",n);let p,f=void 0!==d?n.byCompilationId[u].byIndex[d]:void 0;if(void 0!==s){let e=t[o];e&&(p=s.slice(e.binary.length))}return{[r]:{contractName:l,source:f,binary:a,constructorArgs:p}}})))))},transaction:{_:(0,ce.createLeaf)(["/state"],(e=>e.transaction)),receipt:(0,ce.createLeaf)(["/state"],(e=>e.receipt)),block:(0,ce.createLeaf)(["/state"],(e=>e.block))},status:{readyOrError:(0,ce.createLeaf)(["/state"],(e=>e.ready)),ready:(0,ce.createLeaf)(["./readyOrError","./isError"],((e,t)=>e&&!t)),waiting:(0,ce.createLeaf)(["/state"],(e=>!e.ready)),error:(0,ce.createLeaf)(["/state"],(e=>e.lastLoadingError)),isError:(0,ce.createLeaf)(["./error"],(e=>null!==e)),success:(0,ce.createLeaf)(["./error"],(e=>null===e)),errored:(0,ce.createLeaf)(["./readyOrError","./isError"],((e,t)=>e&&t)),loaded:(0,ce.createLeaf)([me.loaded],(e=>e)),lightMode:(0,ce.createLeaf)(["/state"],(e=>e.lightMode))}}),nt=require("redux-saga/effects"),rt="TRACE_SAVE_STEPS",it="TRACE_TICK",at="TRACE_TOCK",st="TRACE_ADVANCE",ot="TRACE_EOT",ct="TRACE_RESET",lt="TRACE_UNLOAD_TRANSACTION",ut="TRACE_SET_SUBMODULE_COUNT";function dt(e){return{type:ut,count:e}}const pt="DATA_SCOPE";function ft(e,t,n,r,i){return{type:pt,id:e,pointer:t,parentId:n,sourceIndex:r,sourceId:i}}const yt="DATA_DECLARE_VARIABLE";function gt(e,t,n,r){return{type:yt,name:e,astRef:t,scopeAstRef:n,sourceId:r}}const mt="DATA_ASSIGN";function bt(e){return{type:mt,assignments:e}}const ht="DATA_MAP_PATH_AND_ASSIGN";function vt(e,t,n,r,i){return{type:ht,address:e,slot:t,assignments:n,typeIdentifier:r,parentType:i}}const Lt="DATA_RESET",xt="DATA_DEFINE_TYPE",Ct="DATA_DEFINE_TAGGED_OUTPUT",St="DATA_ADD_CONTRACTS",It="DATA_ALLOCATE",At="ENS_RECORD",Et="INIT_WEB3",Rt="WEB3_READY",Tt="INSPECT_TRANSACTION",Ot="FETCH_BINARY",wt="FETCH_STORAGE",_t="REVERSE_ENS_RESOLVE",kt="ENS_RESOLVE",Dt="RECEIVE_BINARY",Nt="RECEIVE_STORAGE",Pt="RECEIVE_STORAGE_FAIL",jt="RECEIVE_ENS_NAME",Ft="RECEIVE_ENS_ADDRESS",Mt="RECEIVE_TRACE",Ut="RECEIVE_CALL";function Bt({address:e,binary:t,data:n,storageAddress:r,status:i,sender:a,value:s,gasprice:o,block:c,blockHash:l,txIndex:u}){return{type:Ut,address:e,binary:t,data:n,storageAddress:r,status:i,sender:a,value:s,gasprice:o,block:c,blockHash:l,txIndex:u}}const Vt="ERROR_WEB3",Gt=require("web3");var Ht=n.n(Gt);const Wt=require("@ensdomains/ensjs");var Kt=n.n(Wt),Yt=n(837);const $t=d()("debugger:web3:adapter");class qt{constructor(e,t){this.web3=new(Ht())(e),this.ensRegistryAddress=t.registryAddress}async init(){if($t("initting; registry = %o",this.ensRegistryAddress),void 0===this.ensRegistryAddress){const e=await this.web3.eth.net.getId();this.ensRegistryAddress=(0,Wt.getEnsAddress)(e)}this.ensRegistryAddress&&($t("setting up"),this.ens=new(Kt())({provider:this.web3.currentProvider,ensAddress:this.ensRegistryAddress}))}async getTrace(e){const t=this.web3.currentProvider,n=await(0,Yt.promisify)(t.send.bind(t))({jsonrpc:"2.0",method:"debug_traceTransaction",id:Date.now(),params:[e,{enableMemory:!0,disableStorage:!0}]});if(n.result)return n.result.structLogs;throw new Error(n.error.message)}async getTransaction(e){return await this.web3.eth.getTransaction(e)}async getReceipt(e){return await this.web3.eth.getTransactionReceipt(e)}async getBlock(e){return await this.web3.eth.getBlock(e)}async getChainId(){return await this.web3.eth.getChainId()}async getExistingStorage(e,t,n,r){$t("slot: %O",t);const i=this.web3.currentProvider,a=Ht().utils.soliditySha3({type:"bytes",value:t}),s=await(0,Yt.promisify)(i.send.bind(i))({jsonrpc:"2.0",method:"debug_storageRangeAt",id:Date.now(),params:[n,r,e,a,1]});if(s.result){const e=s.result.storage;return $t("hashedSlot: %O",a),$t("storage: %O",e),$t("found? %O",a in e),a in e?e[a].value:"0x"+"00".repeat(f.Evm.Utils.WORD_SIZE)}throw new Error(s.error.message)}async getDeployedCode(e,t){$t("getting deployed code for %s",e);let n=await this.web3.eth.getCode(e,t);return"0x0"===n?"0x":n}async reverseEnsResolve(e){if(!this.ens)return $t("no ens you fool!"),null;try{return $t("addr: %s",e),(await this.ens.getName(e)).name}catch{return null}}async ensResolve(e){if(!this.ens)return null;try{return await this.ens.name(e).getAddress()}catch{return null}}}const zt=d()("debugger:web3:sagas");function Zt(e){return e.startsWith("0x")?e.slice(2).padStart(2*f.Evm.Utils.WORD_SIZE,"0"):e}function*Xt(e,{txHash:t}){var n,r;zt("inspecting transaction");try{n=yield(0,nt.apply)(e,e.getTrace,[t])}catch(e){return zt("putting error"),void(yield(0,nt.put)((r=e,{type:Vt,error:r})))}zt("got trace"),n=n.map((e=>({...e,stack:e.stack.map(Zt),memory:e.memory.map(Zt)}))),yield(0,nt.put)(function(e){return{type:Mt,trace:e}}(n));const i=yield(0,nt.apply)(e,e.getTransaction,[t]);zt("tx %O",i);const a=yield(0,nt.apply)(e,e.getReceipt,[t]);zt("receipt %O",a);const s=yield(0,nt.apply)(e,e.getBlock,[i.blockNumber]);zt("block %O",s);const o=yield(0,nt.apply)(e,e.getChainId);let c;yield(0,nt.put)(function(e){return{type:te,transaction:e}}(i)),yield(0,nt.put)(function(e){return{type:ne,receipt:e}}(a)),yield(0,nt.put)(function(e){return{type:re,block:e}}(s));const l=s.prevRandao||s.mixHash,u=new(he())(l.slice(2),16);c=u.isZero()?new(he())(s.difficulty):u;const d={coinbase:s.miner,difficulty:c,gaslimit:new(he())(s.gasLimit),number:new(he())(s.number),timestamp:new(he())(s.timestamp),chainid:new(he())(o),basefee:new(he())(parseInt(s.baseFeePerGas))};if(null!=i.to)yield(0,nt.put)(Bt({address:i.to,data:i.input,storageAddress:i.to,status:a.status,sender:i.from,value:new(he())(i.value),gasprice:new(he())(i.gasPrice),block:d,blockHash:s.hash,txIndex:i.transactionIndex}));else{const e=Ht().utils.isAddress(a.contractAddress)?a.contractAddress:f.Evm.Utils.ZERO_ADDRESS;yield(0,nt.put)(Bt({binary:i.input,storageAddress:e,status:a.status,sender:i.from,value:new(he())(i.value),gasprice:new(he())(i.gasPrice),block:d,blockHash:s.hash,txIndex:i.transactionIndex}))}}function*Jt(e){zt("putting"),yield(0,nt.put)(function(e){return{type:Tt,txHash:e}}(e)),zt("waiting");let t=yield(0,nt.take)([Mt,Vt]);var n;if(zt("action %o",t),t.type!=Mt)return{error:t.error};n=t.trace,zt("received trace");let{address:r,binary:i,data:a,storageAddress:s,status:o,sender:c,value:l,gasprice:u,block:d,blockHash:p,txIndex:f}=yield(0,nt.take)(Ut);return zt("received call"),{trace:n,address:r,binary:i,data:a,storageAddress:s,status:o,sender:c,value:l,gasprice:u,block:d,blockHash:p,txIndex:f}}function*Qt(e,t){let n=yield(0,nt.all)(e.map((e=>(0,nt.fork)(tn,e))));zt("requesting binaries"),yield(0,nt.all)(e.map((e=>(0,nt.put)(function(e,t){return{type:Ot,address:e,block:t}}(e,t)))));let r=[];return r=yield(0,nt.join)(n),zt("binaries %o",r),r}function*en(e,{address:t,block:n}){zt("fetching binary for %s",t);let r=yield(0,nt.apply)(e,e.getDeployedCode,[t,n]);zt("received binary for %s",t),yield(0,nt.put)(function(e,t){return{type:Dt,address:e,binary:t}}(t,r))}function*tn(e){let{binary:t}=yield(0,nt.take)((t=>t.type==Dt&&t.address==e));return zt("got binary for %s",e),t}function*nn(e){zt("forking receive name for %s",e);const t=yield(0,nt.fork)(an,e);return zt("putting the action to kick things off"),yield(0,nt.put)(function(e){return{type:_t,address:e}}(e)),zt("waiting (outer)"),yield(0,nt.join)(t)}function*rn(e,{address:t}){zt("got reverse action; address = %s",t);const n=yield(0,nt.apply)(e,e.reverseEnsResolve,[t]);zt("got name = %o, passing it on",n),yield(0,nt.put)(function(e,t){return{type:jt,address:e,name:t}}(t,n))}function*an(e){zt("waiting (inner)");const{name:t}=yield(0,nt.take)((t=>t.type==jt&&t.address==e));return zt("received name = %s, returning",t),t}function*sn(e){const t=yield(0,nt.fork)(cn,e);return yield(0,nt.put)(function(e){return{type:kt,name:e}}(e)),yield(0,nt.join)(t)}function*on(e,{name:t}){const n=yield(0,nt.apply)(e,e.ensResolve,[t]);yield(0,nt.put)(function(e,t){return{type:Ft,address:t,name:e}}(t,n))}function*cn(e){const{address:t}=yield(0,nt.take)((t=>t.type==Ft&&t.name==e));return t}function*ln(e,t,n,r){zt("forking");const i=yield(0,nt.fork)((function*(){return yield(0,nt.race)({success:(0,nt.call)(dn,e,t),failure:(0,nt.call)(pn)})}));yield(0,nt.put)(function(e,t,n,r){return{type:wt,address:e,slot:t,blockHash:n,txIndex:r}}(e,t,n,r)),zt("joining");const a=yield(0,nt.join)(i);if(zt("result: %O",a),a.failure)throw a.failure;return a.success}function*un(e,{address:t,slot:n,blockHash:r,txIndex:i}){const a=f.Conversion.toHexString(n,f.Evm.Utils.WORD_SIZE);try{const s=yield(0,nt.apply)(e,e.getExistingStorage,[t,a,r,i]);yield(0,nt.put)(function(e,t,n){return{type:Nt,address:e,slot:t,word:n}}(t,n,s))}catch(e){yield(0,nt.put)(function(e){return{type:Pt,error:e}}(e))}}function*dn(e,t){const{word:n}=yield(0,nt.take)((n=>n.type==Nt&&n.address==e&&n.slot.eq(t)));return n}function*pn(){const{error:e}=yield(0,nt.take)(Pt);return e}function*fn(e,t){yield(0,nt.put)(function(e,t){return{type:Et,provider:e,ensOptions:t}}(e,t)),yield(0,nt.take)(Rt)}function*yn(){const{provider:e,ensOptions:t}=yield(0,nt.take)(Et);let n=new qt(e,t);yield(0,nt.apply)(n,n.init),yield(0,nt.takeEvery)(Tt,Xt,n),yield(0,nt.takeEvery)(Ot,en,n),yield(0,nt.takeEvery)(wt,un,n),yield(0,nt.takeEvery)(_t,rn,n),yield(0,nt.takeEvery)(kt,on,n),yield(0,nt.put)({type:Rt})}const gn=L("web3",yn),mn=(d()("debugger:ens:selectors"),(0,ce.createSelectorTree)({state:e=>e.ens,current:{cache:(0,ce.createLeaf)(["/state"],(e=>e.proc.cache))}})),bn=d()("debugger:ens:sagas");function*hn(e){const t=yield*function*(e){bn("reverse resolving %s",e);const t=yield(0,nt.select)(mn.current.cache);if(e in t)return bn("got cached %o",t[e]),t[e];{let t=yield*nn(e);if(bn("got name %o",t),null!==t){bn("forward resolving %s",t);const n=yield*function*(e){return yield*sn(e)}(t);bn("got check address %o",n),n!==e&&(t=null)}return yield(0,nt.put)(function(e,t){return{type:At,address:e,name:t}}(e,t)),bn("returning %o",t),t}}(e);return null===t?null:f.Conversion.stringToBytes(t)}const vn="EVM_ADD_CONTEXT",Ln="EVM_ADD_INSTANCE";function xn(e,t,n){return{type:Ln,address:e,context:t,binary:n}}const Cn="EVM_ADD_AFFECTED_INSTANCE";function Sn(e,t,n,r,i){return{type:Cn,address:e,context:t,binary:n,creationBinary:r,creationContext:i}}const In="EVM_SAVE_GLOBALS",An="EVM_SAVE_TX_IDENTIFICATION",En="EVM_SAVE_STATUS",Rn="EVM_CALL";function Tn(e,t,n,r,i){return{type:Rn,address:e,data:t,storageAddress:n,sender:r,value:i}}const On="EVM_CREATE";function wn(e,t,n,r){return{type:On,binary:e,storageAddress:t,sender:n,value:r}}const _n="EVM_RETURN_CALL",kn="EVM_RETURN_CREATE",Dn="EVM_FAIL",Nn="EVM_STORE",Pn="EVM_LOAD";function jn(e,t,n){return{type:Pn,address:e,slot:t,value:n}}const Fn="EVM_RESET",Mn="EVM_UNLOAD_TRANSACTION",Un="EVM_SET_STORAGE_LOOKUP",Bn="EVM_SET_STORAGE_LOOKUP_SUPPORT",Vn=d()("debugger:trace:sagas");function*Gn(){let e=yield(0,nt.select)(me.stepsRemaining);Vn("remaining: %o",e);let t=yield(0,nt.select)(me.steps);Vn("total steps: %o",t.length);let n=0;if(e>0){for(n=yield(0,nt.select)(me.application.submoduleCount),yield(0,nt.put)({type:it});n>0;)yield(0,nt.take)(at),n--;e--}e?yield(0,nt.put)({type:st}):yield(0,nt.put)({type:ot})}function*Hn(){yield(0,nt.put)({type:at})}const Wn=d()("debugger:evm:sagas");function*Kn(e){const t=e.context||S({type:"string",value:e.binary});return Wn("context %O",e),yield(0,nt.put)(function(e){return{...e,type:vn}}({...e,context:t})),t}function*Yn(e,t){const n=(yield(0,nt.select)(Ce.info.binaries.search))(t);return yield(0,nt.put)(xn(e,n,t)),n}function*$n(e,t,n){const r=f.Conversion.toHexString(t,f.Evm.Utils.WORD_SIZE).slice(2);yield(0,nt.put)(jn(e,r,n))}function*qn(e){const t=(yield(0,nt.select)(Ce.transaction.globals.block)).number.toString(),n=yield(0,nt.select)(Ce.current.codex.instances);if(e in n)return f.Conversion.toBytes(n[e].binary);{Wn("fetching binary");let n=(yield*Qt([e],t))[0];return Wn("adding instance"),yield*Yn(e,n),f.Conversion.toBytes(n)}}function*zn(e){const t=yield(0,nt.select)(Ce.current.codex.storage),n=f.Conversion.toHexString(e).slice(2);if(n in t)return f.Conversion.toBytes(t[n]);if(yield(0,nt.select)(Ce.application.storageLookup)){const t=(yield(0,nt.select)(Ce.current.call)).storageAddress,n=yield(0,nt.select)(Ce.transaction.blockHash),r=yield(0,nt.select)(Ce.transaction.txIndex),i=yield*ln(t,e,n,r);return yield*$n(t,e,i),f.Conversion.toBytes(i)}return null}function*Zn(e,t,n){const r=yield(0,nt.select)(Ce.info.binaries.search),i=r(t),a=n?r(n):null;return yield(0,nt.put)(Sn(e,i,t,n,a)),i}function*Xn(){const e=yield(0,nt.select)(Ce.current.codex.instances),t=yield(0,nt.select)(Ce.transaction.affectedInstances);for(let[t,{binary:n}]of Object.entries(e)){const e=(yield(0,nt.select)(Ce.info.binaries.search))(n);yield(0,nt.put)(xn(t,e,n))}for(let[e,{binary:n,creationBinary:r}]of Object.entries(t)){const t=yield(0,nt.select)(Ce.info.binaries.search),i=t(n),a=r?t(r):null;yield(0,nt.put)(Sn(e,i,n,r,a))}}function*Jn({address:e,binary:t,data:n,storageAddress:r,status:i,sender:a,value:s,gasprice:o,block:c,blockHash:l,txIndex:u}){yield(0,nt.put)(function(e,t,n){return{type:In,origin:e,gasprice:t,block:n}}(a,o,c)),yield(0,nt.put)(function(e){return{type:En,status:e}}(i)),yield(0,nt.put)(function(e,t){return{type:An,blockHash:e,txIndex:t}}(l,u)),e?yield(0,nt.put)(Tn(e,n,r,a,s)):yield(0,nt.put)(wn(t,r,a,s))}function*Qn(){Wn("got TICK"),yield*er(),yield*Hn()}function*er(){if(yield(0,nt.select)(Ce.current.step.isExceptionalHalting))Wn("exceptional halt!"),yield(0,nt.put)({type:Dn});else if(yield(0,nt.select)(Ce.current.step.isInstantCallOrCreate));else if(yield(0,nt.select)(Ce.current.step.isCall)){Wn("got call");let e=yield(0,nt.select)(Ce.current.step.callAddress),t=yield(0,nt.select)(Ce.current.step.callData);if(Wn("calling address %s",e),yield(0,nt.select)(Ce.current.step.isDelegateCallStrict)){let{storageAddress:n,sender:r,value:i}=yield(0,nt.select)(Ce.current.call);yield(0,nt.put)(Tn(e,t,n,r,i))}else{let n=yield(0,nt.select)(Ce.current.call),r=(yield(0,nt.select)(Ce.current.step.isDelegateCallBroad))?n.storageAddress:e,i=n.storageAddress,a=yield(0,nt.select)(Ce.current.step.callValue);yield(0,nt.put)(Tn(e,t,r,i,a))}}else if(yield(0,nt.select)(Ce.current.step.isCreate)){Wn("got create");let e=yield(0,nt.select)(Ce.current.step.createBinary),t=yield(0,nt.select)(Ce.current.step.createdAddress),n=yield(0,nt.select)(Ce.current.step.createValue),r=(yield(0,nt.select)(Ce.current.call)).storageAddress;yield(0,nt.put)(wn(e,t,r,n))}else if(yield(0,nt.select)(Ce.current.step.isNormalHalting)){Wn("got return");let{binary:r,storageAddress:i}=yield(0,nt.select)(Ce.current.call);if(r){let r=yield(0,nt.select)(Ce.current.step.returnValue),a=(yield(0,nt.select)(Ce.info.binaries.search))(r);yield(0,nt.put)((e=i,t=r,n=a,{type:kn,address:e,code:t,context:n}))}else yield(0,nt.put)({type:_n})}else if(yield(0,nt.select)(Ce.current.step.isStore)){let e=(yield(0,nt.select)(Ce.current.call)).storageAddress,t=yield(0,nt.select)(Ce.current.step.storageAffected),n=yield(0,nt.select)(Ce.current.step.valueStored);yield(0,nt.put)(function(e,t,n){return{type:Nn,address:e,slot:t,value:n}}(e,t,n))}else if(yield(0,nt.select)(Ce.current.step.isLoad)){let e=(yield(0,nt.select)(Ce.current.call)).storageAddress,t=yield(0,nt.select)(Ce.current.step.storageAffected),n=yield(0,nt.select)(Ce.current.step.valueLoaded);yield(0,nt.put)(jn(e,t,n))}var e,t,n}function*tr(){const e=yield(0,nt.select)(Ce.transaction.initialCall);yield(0,nt.put)({type:Fn,storageAddress:undefined}),yield(0,nt.put)(e)}function*nr(){yield(0,nt.put)({type:Mn})}function*rr(e){const t=yield*function*(){const e=yield(0,nt.select)(Ce.application.storageLookupSupported);if(null!==e)return e;const t=yield(0,nt.select)(Ce.transaction.blockHash);let n;try{yield*ln(f.Evm.Utils.ZERO_ADDRESS,new(he())(0),t,0),n=!0}catch{n=!1}return yield(0,nt.put)(function(e){return{type:Bn,status:e}}(n)),n}();if(e&&!t)throw new Error("The storageLookup option was passed, but the debug_storageRangeAt method is not available on this client.");yield(0,nt.put)(function(e){return{type:Un,status:e}}(e))}function*ir(){yield(0,nt.takeEvery)(it,Qn)}const ar=L("evm",ir),sr=require("lodash/sum");var or=n.n(sr);const cr=d()("debugger:data:sagas");function*lr(e,t,n,r,i){yield(0,nt.put)(ft(e,t,n,r,i))}function*ur(e,t){yield(0,nt.put)(gt(e.name,e.id,e.scope,t))}function*dr(e,t,n,r){yield(0,nt.put)(ft(void 0,e,r,t,n))}function*pr(e,t,n,r,i){yield(0,nt.put)(gt(e.name,x(r,t),x(r,n),i))}function*fr(e,t){yield(0,nt.put)(function(e,t){return{type:xt,node:e,sourceId:t}}(e,t))}function*yr(e,t){yield(0,nt.put)(function(e,t){return{type:Ct,node:e,sourceId:t}}(e,t))}function*gr(){yield*function*(){if(!(yield(0,nt.select)(qe.views.atLastInstructionForSourceRange)))return;let e,t=yield(0,nt.select)(qe.current.node);if(!t)return;switch(t.nodeType){case"IndexAccess":case"MemberAccess":e=yield(0,nt.select)(qe.nextUserStep.state.stack);break;case"YulFunctionCall":e=yield(0,nt.select)(qe.nextOfSameDepth.state.stack);break;default:e=yield(0,nt.select)(qe.next.state.stack)}if(!e)return;const n=e.length-1;let r=yield(0,nt.select)(qe.current.pointer);const i=yield(0,nt.select)(qe.current.functionDepth),a=yield(0,nt.select)(qe.current.modifierDepth),s=yield(0,nt.select)(qe.current.inModifier),o=yield(0,nt.select)(qe.current.address),c=yield(0,nt.select)(qe.current.compilationId),l=yield(0,nt.select)(qe.current.internalSourceFor);let u,d;if(yield(0,nt.select)(qe.current.aboutToModify)){const e=yield(0,nt.select)(qe.current.modifierBeingInvoked),t=yield(0,nt.select)(qe.current.modifierArgumentIndex);cr("currentIndex %d",t);const r=e.parameters.parameters,s=r.slice(t+1),o=or()(s.map(f.Ast.Utils.stackSize));cr("adjustment %d",o),d=br(c,l,r,n+o,i,a,"ModifierDefinition"===e.nodeType)}else d={};switch(t.nodeType){case"FunctionDefinition":case"ModifierDefinition":if(yield(0,nt.select)(qe.current.isPop))break;const p=yield(0,nt.select)(qe.next.modifierBeingInvoked);if(p&&p.id===t.id)break;u=br(c,l,t.parameters.parameters,n,i,a,s),cr("Function definition case"),cr("assignments %O",u),yield(0,nt.put)(bt(u));break;case"YulFunctionDefinition":{const e=yield(0,nt.select)(qe.next.pointer);if(!(yield(0,nt.select)(qe.current.onYulFunctionDefinitionWhileEntering)))break;let o=[];e.startsWith(`${r}/body/`)&&(o=(t.returnVariables||[]).map(((e,t,n)=>"/returnVariables/"+(n.length-1-t))));const d=(t.parameters||[]).map(((e,t)=>`/parameters/${t}`));let p=[];if(!(yield(0,nt.select)(qe.current.bareLetsInYulAreHit))){let e=0;for(const n of t.body.statements){if("YulVariableDeclaration"!==n.nodeType||null!=n.value)break;for(let t=0;t<n.variables.length;t++)p.unshift(`/body/statements/${e}/variables/${t}`);e++}}const f=p.concat(o,d);cr("suffixes: %O",f),u={};let y=n;const g=yield(0,nt.select)(qe.current.sourceIndex);for(const e of f){const t=A({compilationId:c,internalFor:l,astRef:x(g,r+e),stackframe:i,modifierDepth:s?a:null},{location:"stack",from:y,to:y});u[t.id]=t,y--}yield(0,nt.put)(bt(u));break}case"ContractDefinition":{const e=yield(0,nt.select)(qe.current.allocations.state),n=e[t.id];cr("Contract definition case"),cr("allocations %O",e),cr("allocation %O",n),u={};for(let e in n.members){e=Number(e);const t=A({compilationId:c,internalFor:l,astRef:e},n.members[e].pointer);u[t.id]=t}const r=t.nodes.find((e=>"FunctionDefinition"===e.nodeType&&"fallback"===f.Ast.Utils.functionKind(e)));if(r){const e=r.parameters.parameters[0];if(e){const t=yield(0,nt.select)(qe.current.fallbackBase),n={location:"stack",from:t,to:t+f.Ast.Utils.stackSize(e)-1},r=A({compilationId:c,internalFor:l,astRef:e.id,stackframe:i,modifierDepth:null},n);u[r.id]=r}}cr("assignments %O",u),yield(0,nt.put)(bt(u));break}case"FunctionTypeName":{const e=yield(0,nt.select)(qe.current.scopes.inlined);if(t=e[e[t.id].parentId].definition,"VariableDeclaration"!==t.nodeType)break}case"VariableDeclaration":{const e=t.id;if(cr("Variable declaration case"),cr("currentDepth %d varId %d",i,e),!(yield(0,nt.select)(qe.current.inFunctionOrModifier))){cr("already a contract variable!");break}const r=A({compilationId:c,internalFor:l,astRef:e,stackframe:i,modifierDepth:s?a:null},{location:"stack",from:n-f.Ast.Utils.stackSize(t)+1,to:n});u={[r.id]:r},cr("assignments: %O",u),yield(0,nt.put)(bt(u));break}case"YulFunctionCall":{const e=yield(0,nt.select)(qe.next.pointer);if(null!==e&&e.startsWith(r))break}case"YulLiteral":case"YulIdentifier":const y=r.replace(/\/[^/]*$/,""),g=yield(0,nt.select)(qe.current.root),b=ue().get(g,y);if(r!==`${y}/value`||"YulVariableDeclaration"!==b.nodeType)break;t=b,r=y;case"YulVariableDeclaration":{const e=x(yield(0,nt.select)(qe.current.sourceIndex),r);cr("sourceAndPointer: %s",e),u={};let o=n;for(let n=t.variables.length-1;n>=0;n--){const t=A({compilationId:c,internalFor:l,astRef:`${e}/variables/${n}`,stackframe:i,modifierDepth:s?a:null},{location:"stack",from:o,to:o});u[t.id]=t,o--}yield(0,nt.put)(bt(u));break}case"YulTypedName":{const e=A({compilationId:c,internalFor:l,astRef:x(yield(0,nt.select)(qe.current.sourceIndex),r),stackframe:i,modifierDepth:s?a:null},{location:"stack",from:n,to:n});yield(0,nt.put)(bt({[e.id]:e}));break}case"IndexAccess":{cr("Index access case"),u={...d,...mr(c,l,t,e,i,a,s)};const n=t.baseExpression;if("bytes"===f.Ast.Utils.typeClass(n)||"array"===f.Ast.Utils.typeClass(n)&&(f.Ast.Utils.isReference(t)?"storage"!==f.Ast.Utils.referenceType(n):!f.Ast.Utils.isMapping(t))){cr("Index case bailed out early"),cr("typeClass %s",f.Ast.Utils.typeClass(n)),cr("referenceType %s",f.Ast.Utils.referenceType(n)),cr("isReference(node) %o",f.Ast.Utils.isReference(t)),yield(0,nt.put)(bt(u));break}const r=yield(0,nt.select)(qe.current.allocations.state),p=hr(c,l,n,yield(0,nt.select)(qe.proc.assignments),r,i,a,s);if(null===p){cr("bailed out due to failed path"),yield(0,nt.put)(bt(u));break}const y=yield(0,nt.select)(qe.current.scopes.inlined);let g=f.Ast.Utils.keyDefinition(n,y),b=yield*function*(e,t){let n=yield*function*(e,t){const n=yield(0,nt.select)(qe.current.scopes.inlined),r=yield(0,nt.select)(qe.current.compilationId),i=yield(0,nt.select)(qe.current.internalSourceFor),a=yield(0,nt.select)(qe.proc.assignments),s=yield(0,nt.select)(qe.current.functionDepth),o=yield(0,nt.select)(qe.current.modifierDepth),c=yield(0,nt.select)(qe.current.inModifier);let l;for(;;){const u=(a[I({compilationId:r,internalFor:i,astRef:e.id,stackframe:s,modifierDepth:c?o:null})]||{}).ref;if(cr("indexDefinition.nodeType: %o",e.nodeType),cr("indexDefinition.kind: %o",e.kind),f.Ast.Utils.isSimpleConstant(e))return cr("about to decode simple literal"),yield*vr(t,{location:"definition",definition:e},r);if(u){let n;return n=f.Ast.Utils.isReference(e)?f.Ast.Utils.spliceLocation(t,f.Ast.Utils.referenceType(e)):t,cr("about to decode"),yield*vr(n,u,r)}if(e.referencedDeclaration&&n[e.referencedDeclaration]){cr("referencedDeclaration %d",e.referencedDeclaration);let i=n[e.referencedDeclaration].definition;if(cr("indexConstantDeclaration %O",i),i.constant){let e=i.value;return f.Ast.Utils.isSimpleConstant(e)?(cr("about to decode simple constant"),yield*vr(t,{location:"definition",definition:i.value},r)):null}return null}if(!(l=m(e)))return cr("we failed"),null;e=l,cr("retrying")}}(e,t);if(!n)return n;switch(n=f.Conversion.cleanBool(n),n.kind){case"value":return n;case"error":return null}return n?f.Conversion.cleanBool(n):n}(t.indexExpression,g);if(cr("index value %O",b),cr("keyDefinition %o",g),null!=b&&b.value){let e={path:p};switch(f.Ast.Utils.typeClass(n)){case"array":const r=yield(0,nt.select)(qe.current.compiler),i=yield(0,nt.select)(qe.info.allocations.storage),a=yield(0,nt.select)(qe.views.userDefinedTypes);e.hashPath=f.Ast.Utils.isDynamicArray(n),e.offset=b.value.asBN.muln(f.Storage.Allocate.storageSize(f.Ast.Import.definitionToType(t,c,r),a,i).words);break;case"mapping":e.key=b,e.offset=new(he())(0);break;default:cr("unrecognized index access!")}cr("slot %O",e),yield(0,nt.put)(vt(o,e,u,f.Ast.Utils.typeIdentifier(t),f.Ast.Utils.typeIdentifier(n)))}else cr("failed to decode, just assigning"),yield(0,nt.put)(bt(u));break}case"MemberAccess":{u={...d,...mr(c,l,t,e,i,a,s)},cr("Member access case");const n=t.expression;if("struct"!==f.Ast.Utils.typeClass(n)||(f.Ast.Utils.isReference(t)?"storage"!==f.Ast.Utils.referenceType(n):!f.Ast.Utils.isMapping(t))){cr("Member case bailed out early"),yield(0,nt.put)(bt(u));break}const r=yield(0,nt.select)(qe.current.allocations.state),p=hr(c,l,n,yield(0,nt.select)(qe.proc.assignments),r,i,a,s);if(null===p){cr("bailed out due to failed path"),yield(0,nt.put)(bt(u));break}let y={path:p};const g=yield(0,nt.select)(qe.current.compiler),m=f.Ast.Import.definitionToType(n,c,g),b=(yield(0,nt.select)(qe.info.allocations.storage))[m.id].members,h=(yield(0,nt.select)(qe.current.scopes.inlined))[t.referencedDeclaration].definition.name,v=b.find((e=>e.name===h));y.offset=v.pointer.range.from.slot.offset.clone(),cr("slot %o",y),yield(0,nt.put)(vt(o,y,u,f.Ast.Utils.typeIdentifier(t),f.Ast.Utils.typeIdentifier(n)));break}default:if(void 0===t.id||null==t.typeDescriptions)break;cr("decoding expression value %O",t.typeDescriptions),cr("default case"),cr("currentDepth %d node.id %d",i,t.id),u={...d,...mr(c,l,t,e,i,a,s)},yield(0,nt.put)(bt(u))}}(),yield*Hn()}function mr(e,t,n,r,i,a,s){let o,c=r.length-1;try{o=f.Stack.Read.readStack({location:"stack",from:c-f.Ast.Utils.stackSize(n)+1,to:c},{stack:r,storage:{}})}catch(e){o=void 0}let l=A({compilationId:e,internalFor:t,astRef:n.id,stackframe:i,modifierDepth:s?a:null},{location:"stackliteral",literal:o});return{[l.id]:l}}function br(e,t,n,r,i,a=0,s=!1){let o=n.slice().reverse();cr("reverseParameters %o",n);let c=r,l={};for(let n of o){let r=f.Ast.Utils.stackSize(n),o={location:"stack",from:c-r+1,to:c},u=A({compilationId:e,internalFor:t,astRef:n.id,stackframe:i,modifierDepth:s?a:null},o);l[u.id]=u,c-=r}return l}function hr(e,t,n,r,i,a,s,o){const c=I({compilationId:e,internalFor:t,astRef:n.id,stackframe:a,modifierDepth:o?s:null});cr("astId: %d",n.id),cr("stackframe: %d",a),cr("fullId: %s",c),cr("currentAssignments: %O",r);const l=r[c];if(l)return{offset:f.Conversion.toBN(l.ref.literal)};const u=n.referencedDeclaration;if(null!=u){const e=i[u];if(e&&"storage"===e.pointer.location)return e.pointer.range.from.slot}return null}function*vr(e,t,n){const r=yield(0,nt.select)(qe.views.userDefinedTypes),i=yield(0,nt.select)(qe.current.state),a=yield(0,nt.select)(qe.views.mappingKeys),s=yield(0,nt.select)(qe.info.allocations),o=yield(0,nt.select)(qe.views.contexts),c=yield(0,nt.select)(qe.current.context),l=yield(0,nt.select)(qe.current.internalFunctionsTable),u=yield(0,nt.select)(qe.current.internalFunctionsTableKind);cr("definition: %o"),cr("ref: %o"),cr("compilationId: %s",n);const d=f.decodeVariable(e,t,{userDefinedTypes:r,state:i,mappingKeys:a,allocations:s,contexts:o,currentContext:c,internalFunctionsTable:l,internalFunctionsTableKind:u},n);cr("beginning decoding");let p=d.next();for(;!p.done;){cr("request received");let e,t=p.value;switch(t.type){case"storage":e=yield*zn(t.slot);break;case"code":e=yield*qn(t.address);break;case"ens-primary-name":e=yield*hn(t.address);default:cr("unrecognized request type!")}cr("sending response"),cr("response: %O",e),p=d.next(e)}return cr("done decoding"),cr("decoded value: %O",p.value),p.value}function*Lr(){const e=yield(0,nt.select)(qe.views.userDefinedTypes),t=yield(0,nt.select)(qe.next.state),n=yield(0,nt.select)(qe.info.allocations),r=yield(0,nt.select)(qe.views.contexts),i=yield(0,nt.select)(qe.current.context),a=yield(0,nt.select)(qe.current.returnStatus),s=yield(0,nt.select)(qe.current.returnAllocation),o=yield(0,nt.select)(qe.current.errorId),c=yield(0,nt.select)(qe.current.internalFunctionsTable),l=yield(0,nt.select)(qe.current.internalFunctionsTableKind);cr("returnAllocation: %O",s);const u=f.decodeReturndata({userDefinedTypes:e,state:t,allocations:n,contexts:r,currentContext:i,internalFunctionsTable:c,internalFunctionsTableKind:l},s,a,o);cr("beginning decoding");let d=u.next();for(;!d.done;){cr("request received");let e,t=d.value;switch(t.type){case"code":e=yield*qn(t.address);break;case"ens-primary-name":e=yield*hn(t.address);default:cr("unrecognized request type!")}cr("sending response"),d=u.next(e)}return cr("done decoding"),cr("decoded value: %O",d.value),d.value}function*xr(e=!1){const t=yield(0,nt.select)(qe.current.isCall),n=yield(0,nt.select)(qe.current.isCreate);if(!t&&!n&&!e)return null;const r=yield(0,nt.select)(qe.current.currentCallIsCreate),i=yield(0,nt.select)(qe.views.userDefinedTypes);let a=e?yield(0,nt.select)(qe.current.state):yield(0,nt.select)(qe.next.state);e&&r&&(a={...a,calldata:a.code});const s=yield(0,nt.select)(qe.info.allocations);cr("allocations: %O",s);const o=yield(0,nt.select)(qe.views.contexts),c=e?yield(0,nt.select)(qe.current.context):yield(0,nt.select)(qe.current.callContext),l=e?yield(0,nt.select)(qe.current.currentCallIsCreate):n,u=f.decodeCalldata({state:a,userDefinedTypes:i,allocations:s,contexts:o,currentContext:c},l);cr("beginning decoding");let d=u.next();for(;!d.done;){cr("request received");let e,t=d.value;switch(t.type){case"code":e=yield*qn(t.address);break;case"ens-primary-name":e=yield*hn(t.address);default:cr("unrecognized request type!")}cr("sending response"),d=u.next(e)}return cr("done decoding"),d.value}function*Cr(){const e=yield(0,nt.select)(qe.views.userDefinedTypes),t=yield(0,nt.select)(qe.current.state),n=yield(0,nt.select)(qe.info.allocations),r=yield(0,nt.select)(qe.views.contexts),i=yield(0,nt.select)(qe.current.context),a=yield(0,nt.select)(qe.current.eventId),s=yield(0,nt.select)(qe.current.internalFunctionsTable),o=yield(0,nt.select)(qe.current.internalFunctionsTableKind),c=f.decodeEvent({userDefinedTypes:e,state:t,allocations:n,contexts:r,currentContext:i,internalFunctionsTable:s,internalFunctionsTableKind:o},null,{id:a});cr("beginning decoding");let l=c.next();for(;!l.done;){cr("request received");let e,t=l.value;switch(t.type){case"code":e=yield*qn(t.address);break;case"ens-primary-name":e=yield*hn(t.address);default:cr("unrecognized request type!")}cr("sending response"),l=c.next(e)}return cr("done decoding"),cr("decoded value: %O",l.value),l.value}function*Sr(){yield(0,nt.put)({type:Lt})}function*Ir(){const e=yield(0,nt.select)(qe.views.contractAllocationInfo),t=yield(0,nt.select)(qe.views.referenceDeclarations),n=yield(0,nt.select)(qe.views.userDefinedTypesByCompilation),r=yield(0,nt.select)(qe.views.userDefinedTypes),i=f.Storage.Allocate.getStorageAllocations(n),a=f.Memory.Allocate.getMemoryAllocations(r),s=f.AbiData.Allocate.getAbiAllocations(r),o=f.AbiData.Allocate.getCalldataAllocations(e,t,r,s),c=f.AbiData.Allocate.getReturndataAllocations(e,t,r,s),l=f.AbiData.Allocate.getEventAllocations(e,t,r,s,!0),u=f.Storage.Allocate.getStateAllocations(e,t,r,i);var d,p,y,g,m,b,h;yield(0,nt.put)((d=i,p=a,y=s,g=o,m=c,b=l,h=u,{type:It,storage:d,memory:p,abi:y,calldata:g,returndata:m,event:b,state:h}))}function*Ar(e){yield(0,nt.put)(function(e){return{type:St,contracts:e}}(e))}function*Er(){yield(0,nt.takeEvery)(it,gr)}const Rr=L("data",Er),Tr="TXLOG_INTERNAL_CALL",Or="TXLOG_ABSORBED_CALL",wr="TXLOG_INTERNAL_RETURN";function _r(e,t,n,r){return{type:wr,pointer:e,newPointer:t,step:n,variables:r}}const kr="TXLOG_EXTERNAL_CALL";function Dr(e,t,n,r,i,a,s,o,c,l,u){return{type:kr,pointer:e,newPointer:t,step:n,address:r,context:i,value:a,isDelegate:s,kind:o,decoding:c,calldata:l,absorbNextInternalCall:u}}const Nr="TXLOG_INSTANT_EXTERNAL_CALL",Pr="TXLOG_CREATE";function jr(e,t,n,r,i,a,s,o,c){return{type:Pr,pointer:e,newPointer:t,step:n,address:r,context:i,value:a,salt:s,decoding:o,binary:c}}const Fr="TXLOG_INSTANT_CREATE",Mr="TXLOG_EXTERNAL_RETURN",Ur="TXLOG_SELFDESTRUCT",Br="TXLOG_REVERT",Vr="TXLOG_IDENTIFY_FUNCTION_CALL",Gr="TXLOG_LOG_EVENT",Hr="TXLOG_STORE",Wr="TXLOG_RECORD_ORIGIN",Kr="TXLOG_RESET",Yr="TXLOG_UNLOAD_TRANSACTION",$r=d()("debugger:txlog:sagas");function*qr(){yield*function*(){const e=yield(0,nt.select)(Qe.current.pointer),t=yield(0,nt.select)(Qe.current.step);if(yield(0,nt.select)(Qe.current.isHalting)){const n=yield(0,nt.select)(Qe.current.externalReturnPointer);if(yield(0,nt.select)(Qe.current.returnStatus))if(yield(0,nt.select)(Qe.current.isSelfDestruct)){const r=yield(0,nt.select)(Qe.current.beneficiary);$r("sd: %o %o",e,n),yield(0,nt.put)(function(e,t,n,r){return{type:Ur,pointer:e,newPointer:t,step:n,beneficiary:r}}(e,n,t,r))}else{const r=yield*Lr(),i=yield(0,nt.select)(Qe.current.returnData);$r("external return: %o %o",e,n),yield(0,nt.put)(function(e,t,n,r,i){return{type:Mr,pointer:e,newPointer:t,step:n,decodings:r,returnData:i}}(e,n,t,r,i))}else{const r=(yield*Lr())[0];$r("revert: %o %o",e,n),yield(0,nt.put)(function(e,t,n,r){return{type:Br,pointer:e,newPointer:t,step:n,error:r}}(e,n,t,r))}}else if(yield(0,nt.select)(Qe.current.isJump)){const n=yield(0,nt.select)(Qe.current.jumpDirection);if("i"===n){if(!(yield(0,nt.select)(Qe.next.inInternalSourceOrYul)))if(yield(0,nt.select)(Qe.current.waitingForInternalCallToAbsorb))$r("absorbed call: %o",e),yield(0,nt.put)(function(e){return{type:Or,pointer:e}}(e));else{const n=yield(0,nt.select)(Qe.current.nextActionPointer);$r("internal call: %o %o",e,n),yield(0,nt.put)(function(e,t,n){return{type:Tr,pointer:e,newPointer:t,step:n}}(e,n,t))}}else if("o"===n){const n=yield(0,nt.select)(Qe.current.inInternalSourceOrYul),r=yield(0,nt.select)(Qe.current.currentFunctionIsAsExpected);if(!n&&r){const n=yield(0,nt.select)(Qe.current.internalReturnPointer),r=yield(0,nt.select)(Qe.current.outputParameterAllocations);if(r){const i=yield(0,nt.select)(Qe.current.compilationId);let a=[];for(let{name:e,definition:t,pointer:n}of r){e=e||void 0;const r=yield*vr(t,n,i);a.push({name:e,value:r})}$r("internal return: %o %o",e,n),yield(0,nt.put)(_r(e,n,t,a))}else $r("internal return: %o %o",e,n),yield(0,nt.put)(_r(e,n,t,void 0))}}}else if(yield(0,nt.select)(Qe.current.isCall)){const n=yield(0,nt.select)(Qe.current.nextActionPointer),r=yield(0,nt.select)(Qe.current.callAddress),i=yield(0,nt.select)(Qe.current.callValue),a=yield(0,nt.select)(Qe.current.isDelegateCallBroad),s=yield(0,nt.select)(Qe.current.callContext),o=yield(0,nt.select)(Qe.current.callData),c=yield(0,nt.select)(Qe.current.isInstantCallOrCreate),l=zr(s,o,c),u=yield(0,nt.select)(Qe.current.absorbNextInternalCall),d=yield*xr();if(c){const c=yield(0,nt.select)(Qe.current.returnStatus);$r("instacall: %o %o",e,n),yield(0,nt.put)(function(e,t,n,r,i,a,s,o,c,l,u,d){return{type:Nr,pointer:e,newPointer:t,step:n,address:r,context:i,value:a,isDelegate:s,kind:o,decoding:c,calldata:l,absorbNextInternalCall:u,status:d}}(e,n,t,r,s,i,a,l,d,o,u,c))}else $r("external call: %o %o",e,n),yield(0,nt.put)(Dr(e,n,t,r,s,i,a,l,d,o,u))}else if(yield(0,nt.select)(Qe.current.isCreate)){const n=yield(0,nt.select)(Qe.current.nextActionPointer),r=yield(0,nt.select)(Qe.current.createdAddress),i=yield(0,nt.select)(Qe.current.callContext),a=yield(0,nt.select)(Qe.current.createValue),s=yield(0,nt.select)(Qe.current.salt),o=yield(0,nt.select)(Qe.current.isInstantCallOrCreate),c=yield(0,nt.select)(Qe.current.createBinary),l=yield*xr();if(o){const o=yield(0,nt.select)(Qe.current.returnStatus);$r("instacreate: %o %o",e,n),yield(0,nt.put)(function(e,t,n,r,i,a,s,o,c,l){return{type:Fr,pointer:e,newPointer:t,step:n,address:r,context:i,value:a,salt:s,decoding:o,binary:c,status:l}}(e,n,t,r,i,a,s,l,c,o))}else $r("create: %o %o",e,n),yield(0,nt.put)(jr(e,n,t,r,i,a,s,l,c))}else if(yield(0,nt.select)(Qe.current.isLog)){const n=(yield*Cr())[0],r=yield(0,nt.select)(Qe.current.rawEventInfo),i=yield(0,nt.select)(Qe.current.nextActionPointer);yield(0,nt.put)(function(e,t,n,r,i){return{type:Gr,pointer:e,newPointer:t,step:n,decoding:r,rawEventInfo:i}}(e,i,t,n,r))}else if(yield(0,nt.select)(Qe.current.isStore)){const n=yield(0,nt.select)(Qe.current.nextActionPointer),r=yield(0,nt.select)(Qe.current.rawStorageSlot),i=yield(0,nt.select)(Qe.current.rawStorageValue);yield(0,nt.put)(function(e,t,n,r,i){return{type:Hr,pointer:e,newPointer:t,step:n,rawSlot:r,rawValue:i}}(e,n,t,r,i))}else if((yield(0,nt.select)(Qe.current.onFunctionDefinition))&&(yield(0,nt.select)(Qe.current.waitingForFunctionDefinition))){$r("identifying");const t=yield(0,nt.select)(Qe.current.inputParameterAllocations);if($r("inputAllocations: %O",t),t){const n=yield(0,nt.select)(Qe.current.astNode),r=yield(0,nt.select)(Qe.current.contract),i=yield(0,nt.select)(Qe.current.compilationId);let a=[];for(let{name:e,definition:n,pointer:r}of t){const t=yield*vr(n,r,i);a.push({name:e,value:t})}$r("identify: %o",e),yield(0,nt.put)(function(e,t,n,r){return{type:Vr,pointer:e,functionNode:t,contractNode:n,variables:r}}(e,n,r,a))}}}(),yield*Hn()}function zr(e,t,n){if(e){if("library"===e.contractKind)return n?"message":"library";{const n=e.abi,r=t.slice(0,2+2*f.Evm.Utils.SELECTOR_SIZE).padEnd("00",2+2*f.Evm.Utils.SELECTOR_SIZE);if($r("selector: %s",r),n&&r in n)return"function"}}return"message"}function*Zr(){const e=yield(0,nt.select)(Qe.transaction.initialCall);yield(0,nt.put)({type:Kr}),e&&(yield(0,nt.put)(e))}function*Xr(){yield(0,nt.put)({type:Yr})}function*Jr(){const e=yield(0,nt.select)(Qe.current.pointer),t=yield(0,nt.select)(Qe.current.nextActionPointer),n=yield(0,nt.select)(Qe.transaction.origin);$r("origin: %o",e),yield(0,nt.put)(function(e,t){return{type:Wr,pointer:e,address:t}}(e,n));const{address:r,binary:i,storageAddress:a,value:s,data:o}=yield(0,nt.select)(Qe.current.call),c=yield(0,nt.select)(Qe.current.context),l=yield*xr(!0);if(r){const n=zr(c,o,!1),i=yield(0,nt.select)(Qe.transaction.absorbFirstInternalCall);$r("initial call: %o %o",e,t),yield(0,nt.put)(Dr(e,t,-1,r,c,s,!1,n,l,o,i))}else $r("initial create: %o %o",e,t),yield(0,nt.put)(jr(e,t,-1,a,c,s,null,l,i))}function*Qr(){yield(0,nt.takeEvery)(it,qr)}const ei=L("txlog",Qr),ti="SOURCEMAPPING_ADD_SOURCES",ni="SOURCEMAPPING_JUMP",ri="SOURCEMAPPING_EXTERNAL_CALL";function ii(e){return{type:ri,guard:e}}const ai="SOURCEMAPPING_EXTERNAL_RETURN",si="SOURCEMAPPING_CLEAR_PHANTOM_GUARD",oi="SOURCEMAPPING_RESET",ci="SOURCEMAPPING_UNLOAD_TRANSACTION",li=d()("debugger:sourcemapping:sagas");function*ui(e){yield(0,nt.put)(function(e){return{type:ti,sources:e}}(e))}function*di(){li("got TICK"),yield*function*(){if(yield(0,nt.select)(Oe.current.willReturn))yield(0,nt.put)({type:ai});else if(yield(0,nt.select)(Oe.current.willJump)){let e=yield(0,nt.select)(Oe.current.jumpDirection);li("checking guard");let t=yield(0,nt.select)(Oe.current.nextFrameIsPhantom),n=yield(0,nt.select)(Oe.next.source);"i"===e&&t&&void 0!==n.id&&!n.internal?yield(0,nt.put)({type:si}):yield(0,nt.put)(function(e){return{type:ni,jumpDirection:e}}(e))}else if(yield(0,nt.select)(Oe.current.willCall)){li("checking if guard needed");let e=yield(0,nt.select)(Oe.current.callRequiresPhantomFrame);yield(0,nt.put)(ii(e))}}(),li("instruction: %O",yield(0,nt.select)(Oe.current.instruction)),yield*Hn()}function*pi(){let e=yield(0,nt.select)(Oe.transaction.bottomStackframeRequiresPhantomFrame);yield(0,nt.put)(function(e){return{type:oi,guard:e}}(e))}function*fi(){yield(0,nt.put)({type:ci})}function*yi(){let e=yield(0,nt.select)(Oe.transaction.bottomStackframeRequiresPhantomFrame);yield(0,nt.put)(ii(e))}function*gi(){yield(0,nt.takeEvery)(it,di)}const mi=L("sourcemapping",gi),bi="STACKTRACE_JUMP_IN",hi="STACKTRACE_JUMP_OUT",vi="STACKTRACE_EXTERNAL_CALL";function Li(e,t,n,r){return{type:vi,location:e,context:t,address:n,combineWithNextInternal:r}}const xi="STACKTRACE_EXTERNAL_RETURN",Ci="STACKTRACE_EXECUTE_RETURN",Si="STACKTRACE_UPDATE_POSITION",Ii="STACKTRACE_RESET",Ai="STACKTRACE_UNLOAD_TRANSACTION",Ei=d()("debugger:stacktrace:sagas");function*Ri(){yield*function*(){const e=yield(0,nt.select)(Fe.current.strippedLocation),t=yield(0,nt.select)(Fe.current.lastPosition),n=yield(0,nt.select)(Fe.current.returnCounter);let r=!1;if(yield(0,nt.select)(Fe.current.willReturn)){const n=yield(0,nt.select)(Fe.current.returnStatus),i=yield(0,nt.select)(Fe.current.index),a=yield(0,nt.select)(Fe.current.updateIndex);Ei("returning!"),yield(0,nt.put)(function(e,t,n,r){return{type:xi,from:e,status:t,location:n,index:r}}(t,n,e,a?i:null)),r=!0}else n>0&&(yield(0,nt.select)(Fe.current.positionWillChange))&&(Ei("executing!"),Ei("location: %o",yield(0,nt.select)(Fe.next.location)),Ei("marked: %o",t),yield(0,nt.put)((i=n,a=e,{type:Ci,counter:i,location:a})),r=!0);var i,a;if((yield(0,nt.select)(Fe.current.willJumpIn))&&0===n){const t=yield(0,nt.select)(Fe.next.location),n=yield(0,nt.select)(Fe.next.contractNode),i=yield(0,nt.select)(Fe.next.sourceIsInternal),a=yield(0,nt.select)(Fe.next.sourceIsGenerated);yield(0,nt.put)(function(e,t,n,r,i){return{type:bi,location:e,functionNode:t,contractNode:n,sourceIsInternal:r,sourceIsGenerated:i}}(e,t.node,n,i,a)),r=!0}else if((yield(0,nt.select)(Fe.current.willJumpOut))&&0===n)yield(0,nt.put)(function(e){return{type:hi,location:e}}(e)),r=!0;else if(yield(0,nt.select)(Fe.current.willCall)){const t=yield(0,nt.select)(Fe.current.callContext),n=yield(0,nt.select)(Fe.current.callAddress),i=yield(0,nt.select)(Fe.current.callCombinesWithNextJumpIn);yield(0,nt.put)(Li(e,t,n,i)),r=!0}r||(yield(0,nt.put)(function(e){return{type:Si,location:e}}(e)))}(),yield*Hn()}function*Ti(){yield(0,nt.put)({type:Ii})}function*Oi(){yield(0,nt.put)({type:Ai})}function*wi(){const e=yield(0,nt.select)(Fe.current.context),t=yield(0,nt.select)(Fe.current.address),n=yield(0,nt.select)(Fe.transaction.initialCallCombinesWithNextJumpIn);yield(0,nt.put)(Li(null,e,t,n))}function*_i(){yield(0,nt.takeEvery)(it,Ri)}const ki=L("stacktrace",_i),Di=d()("debugger:controller:selectors"),Ni=e=>e;function Pi(e,t,n,r){let i=n+r;return e(n,r).some((({range:e,node:t})=>function(e){return"InlineAssembly"===e.nodeType&&!e.AST}(t)||n<=e[0]&&e[0]<i&&!function(e){return b(e)||["VariableDeclarationStatement","Mapping","Block","InlineAssembly","YulTypedName"].includes(e.nodeType)||e.nodeType.includes("TypeName")||void 0!==e.typeDescriptions&&"stringliteral"===f.Ast.Utils.typeClass(e)}(t)))}const ji=(0,ce.createSelectorTree)({state:e=>e.controller,current:{functionDepth:(0,ce.createLeaf)([Oe.current.functionDepth],Ni),executionContext:(0,ce.createLeaf)([Ce.current.call],Ni),willJump:(0,ce.createLeaf)([Ce.current.step.isJump],Ni),onBaseConstructorDefinition:(0,ce.createLeaf)(["./location/node",Ce.current.context,Oe.current.contractNode],((e,t,n)=>e&&"FunctionDefinition"===e.nodeType&&"constructor"===f.Ast.Utils.functionKind(e)&&t.contractId!==n.id)),onYulFunctionDefinitionWhileEntering:(0,ce.createLeaf)([Oe.current.onYulFunctionDefinitionWhileEntering],Ni),location:{sourceRange:(0,ce.createLeaf)([Oe.current.sourceRange,"/current/trace/loaded"],((e,t)=>t?e:null)),source:(0,ce.createLeaf)([Oe.current.source,"/current/trace/loaded"],((e,t)=>t?e:null)),node:(0,ce.createLeaf)([Oe.current.node,"/current/trace/loaded"],((e,t)=>t?e:null)),astRef:(0,ce.createLeaf)([qe.current.astRef],Ni),isMultiline:(0,ce.createLeaf)([Oe.current.isMultiline,"/current/trace/loaded"],((e,t)=>!!t&&e))},callstack:(0,ce.createLeaf)([Fe.current.callstack.preupdated],Ni),isAnyFrameGenerated:(0,ce.createLeaf)(["./callstack"],(e=>e.some((e=>e.sourceIsGenerated)))),trace:{finished:(0,ce.createLeaf)([me.finished],Ni),loaded:(0,ce.createLeaf)([me.loaded],Ni)}},breakpoints:{_:(0,ce.createLeaf)(["/state"],(e=>e.breakpoints)),resolver:(0,ce.createLeaf)([Oe.views.sources,Oe.views.overlapFunctions],((e,t)=>n=>{let r;if(void 0===n.node){let i=n.line;i<0&&(i=0);const{sourceId:a}=n;Di("breakpoint: %O",n),Di("sources: %o",e);const{source:s,ast:o}=e[a];if(!o)return n;const c=t[a],l=s.split("\n").map((e=>e.length));let u=[0];for(let e of l)u.push(u[u.length-1]+e+1);for(Di("line: %s",s.slice(u[i],u[i]+l[i]));i<l.length&&!Pi(c,0,u[i],l[i]);)Di("incrementing"),i++;r=i>=l.length?null:{...n,line:i}}else Di("node-based breakpoint"),r=n;return r}))},finished:(0,ce.createLeaf)(["/current/trace/finished"],(e=>e)),isStepping:(0,ce.createLeaf)(["./state"],(e=>e.isStepping)),stepIntoInternalSources:(0,ce.createLeaf)(["./state"],(e=>e.stepIntoInternalSources))}),Fi=ji,Mi=d()("debugger:controller:sagas"),Ui={[k]:Gi,[D]:Hi,[N]:function*(){const e=yield(0,nt.select)(Fi.current.functionDepth),t=yield(0,nt.select)(Fi.current.location),n=yield(0,nt.select)(Fi.current.location.node);let r,i,a;if(n&&("FunctionDefinition"===n.nodeType&&!(yield(0,nt.select)(Fi.current.onBaseConstructorDefinition))||(yield(0,nt.select)(Fi.current.onYulFunctionDefinitionWhileEntering))))yield*Wi();else do{yield*Hi(),r=yield(0,nt.select)(Fi.current.functionDepth),i=yield(0,nt.select)(Fi.current.location),a=yield(0,nt.select)(Fi.current.trace.finished)}while(!a&&r>=e&&(r>e||i.source.id===t.source.id&&i.sourceRange.lines.start.line===t.sourceRange.lines.start.line))},[P]:function*(){const e=yield(0,nt.select)(Fi.current.functionDepth),t=yield(0,nt.select)(Fi.current.location);let n,r,i;Mi("startingDepth: %d",e),Mi("starting source range: %O",(t||{}).sourceRange);do{yield*Hi(),n=yield(0,nt.select)(Fi.current.functionDepth),r=yield(0,nt.select)(Fi.current.location),i=yield(0,nt.select)(Fi.current.trace.finished),Mi("currentDepth: %d",n),Mi("current source range: %O",(r||{}).sourceRange),Mi("finished: %o",i)}while(!i&&n<=e&&r.source.id===t.source.id&&r.sourceRange.lines.start.line===t.sourceRange.lines.start.line)},[j]:Wi,[U]:function*(e){let t=void 0!==e&&void 0!==e.breakpoints?e.breakpoints:yield(0,nt.select)(Fi.breakpoints),n=!1,r=yield(0,nt.select)(Fi.current.location),i=r.source.id,a=r.sourceRange.lines.start.line,s=r.sourceRange.start,o=r.sourceRange.start;const c=!(yield(0,nt.select)(Fi.stepIntoInternalSources))&&void 0!==r.source.id&&!r.source.internal;let l=i,u=a,d=s,p=o;do{yield*Gi();let e=a,f=s,y=o,g=i;if(r.source.internal||(l=i,u=a,d=s,p=o),r=yield(0,nt.select)(Fi.current.location),yield(0,nt.select)(Fi.current.trace.finished))break;i=r.source.id,void 0!==i&&(a=r.sourceRange.lines.start.line,s=r.sourceRange.start,o=r.sourceRange.length,n=t.filter((({sourceId:t,line:n,start:r,length:m})=>void 0!==r&&void 0!==m?!(t!==i||r!==s||m!==o||i===g&&s===f&&o===y||c&&i===l&&s===d&&o===p):!(t!==i||n!==a||i===g&&a===e||c&&i===l&&a===u))).length>0)}while(!n)},[M]:function*(){let e;do{yield*Gi(),e=yield(0,nt.select)(Fi.current.trace.finished)}while(!e)}};function*Bi(){for(;;){Mi("waiting for control action");let e=yield(0,nt.take)(Object.keys(Ui));if(!(yield(0,nt.select)(Fi.current.trace.loaded)))continue;Mi("got control action");let t=Ui[e.type];yield(0,nt.put)({type:W}),yield(0,nt.race)({exec:(0,nt.call)(t,e),interrupt:(0,nt.take)(F)}),yield(0,nt.put)({type:K})}}const Vi=L("controller",Bi);function*Gi(e){let t=void 0!==e&&void 0!==e.count?e.count:1;for(let e=0;e<t&&!(yield(0,nt.select)(Fi.current.trace.finished));e++)yield*Gn()}function*Hi(){const e=yield(0,nt.select)(Fi.current.location),t=yield(0,nt.select)(Fi.current.isAnyFrameGenerated),n=yield(0,nt.select)(Fi.stepIntoInternalSources);let r,i,a;do{yield*Gi(),r=yield(0,nt.select)(Fi.current.location),a=yield(0,nt.select)(Fi.current.isAnyFrameGenerated),i=yield(0,nt.select)(Fi.current.trace.finished)}while(!i&&(!r||!n&&(r.source.internal||a)&&!e.source.internal&&!t||0===r.sourceRange.length||void 0===r.source.id||r.node&&b(r.node)||r.sourceRange.start===e.sourceRange.start&&r.sourceRange.length===e.sourceRange.length&&r.source.id===e.source.id))}function*Wi(){const e=yield(0,nt.select)(Fi.current.functionDepth);let t,n;do{yield*Hi(),t=yield(0,nt.select)(Fi.current.functionDepth),n=yield(0,nt.select)(Fi.current.trace.finished)}while(!n&&t>=e)}function*Ki(){yield*Sr(),yield*tr(),yield*pi(),yield*function*(){yield(0,nt.put)({type:ct})}(),yield*Ti(),yield*Zr()}d()("debugger:ast:selectors");const Yi=(0,ce.createSelectorTree)({views:{sources:(0,ce.createLeaf)([Oe.views.sources],(e=>Object.values(e)))}}),$i=d()("debugger:ast:sagas");function*qi(e,t,n,r="",i=null){if($i("walking %s %o %o",e,r,n),yield*function*(e,t,n,r,i){if($i("entering %s %s",e,r),n instanceof Object)switch(void 0!==n.id&&($i("%s recording scope %s",r,n.id),yield*lr(n.id,r,i,t,e)),n.nodeType){case"VariableDeclaration":$i("%s recording variable %o",r,n),yield*ur(n,e);break;case"ContractDefinition":case"StructDefinition":case"EnumDefinition":case"UserDefinedValueTypeDefinition":$i("%s recording type %o",r,n),yield*fr(n,e);break;case"EventDefinition":case"ErrorDefinition":$i("%s recording type %o",r,n),yield*yr(n,e)}}(e,t,n,r,i),Array.isArray(n))for(let[a,s]of n.entries())yield*qi(e,t,s,`${r}/${a}`,i);else if(n&&n.nodeType&&n.nodeType.startsWith("Yul"))yield*function*(e,t,n,r,i){yield*Zi(e,t,n,r,n,r,i)}(e,t,n,r,i);else if(n instanceof Object)for(let[i,a]of Object.entries(n))yield*qi(e,t,a,`${r}/${i}`,n.id);yield*function*(e,t,n,r){$i("exiting %s %s",e,r)}(e,0,0,r)}function*zi(){const e=yield(0,nt.select)(Yi.views.sources);yield(0,nt.all)(e.filter((({ast:e})=>e)).map((({ast:e,id:t,index:n})=>(0,nt.call)(qi,t,n,e)))),$i("done visiting")}function*Zi(e,t,n,r,i,a,s=void 0){if(yield*function*(e,t,n,r,i,a,s){if($i("entering %s %s",e,r),n&&(void 0!==n.src&&($i("scoping!"),yield*dr(r,t,e,s)),"YulTypedName"===n.nodeType)){let s=Xi(n,r,i,a);yield*pr(n,r,s,t,e)}}(e,t,n,r,i,a,s),Array.isArray(n))for(let[s,o]of n.entries())yield*Zi(e,t,o,`${r}/${s}`,i,a);else if(n instanceof Object)for(let[s,o]of Object.entries(n))yield*Zi(e,t,o,`${r}/${s}`,i,a);yield*function*(e,t,n,r,i,a,s){$i("exiting %s %s",e,r)}(e,0,0,r)}function Xi(e,t,n,r){$i("pointer: %s",t),$i("basePointer: %s",r);let i=t.slice(r.length);$i("relativePointer: %s",i);let a=i.replace(/\/[^/]*$/,""),s=r+a;$i("parentPointer: %s",s);let o=ue().get(n,a);return"YulBlock"===e.nodeType?"YulForLoop"===o.nodeType&&t===`${s}/pre`?s:t:"YulFunctionDefinition"===e.nodeType?t:Xi(o,s,n,r)}const Ji=d()("debugger:session:sagas"),Qi={[$]:function*({txHash:e,options:t}){yield*ta(e,t)},[oe]:function*({sources:e,contexts:t,contracts:n}){Ji("recording contract binaries"),yield*ra(t),Ji("recording contract sources"),yield*ia(e),Ji("recording other contract info"),yield*aa(n),Ji("refreshing instances"),yield*Xn()},[se]:function*(){Ji("session: %O",tt);if(!(yield(0,nt.select)(tt.status.lightMode)))return;Ji("turning on data & txlog listeners");const e=[Er,Qr];for(const t of e)yield(0,nt.fork)(t);Ji("visiting ASTs"),yield*zi(),Ji("saving allocation table"),yield*Ir(),yield*function*(e=1){let t=yield(0,nt.select)(me.application.submoduleCount);yield(0,nt.put)(dt(t+e))}(e.length),(yield(0,nt.select)(tt.status.loaded))&&(yield*Jr()),yield(0,nt.put)({type:ae})}};function*ea(){for(;;){let e=yield(0,nt.take)(Object.keys(Qi)),t=Qi[e.type];yield(0,nt.put)({type:J}),yield(0,nt.race)({exec:(0,nt.call)(t,e),interrupt:(0,nt.take)(q)}),yield(0,nt.put)(X())}}function*ta(e,t){Ji("fetching transaction info");let n=yield*function*(e,t){let n=yield*Jt(e);if(Ji("result %o",n),n.error)return n.error;Ji("processing trace for addresses");let{calls:r,creations:i,selfdestructs:a}=yield*function*(e){yield(0,nt.put)(function(e){return{type:rt,steps:e}}(e));let t=new Set,n=new Set,r={};for(let i=0;i<e.length;i++){const{op:a,depth:s,stack:o,memory:c}=e[i];if(E(a))t.add(f.Evm.Utils.toAddress(o[o.length-2]));else if(R(a)){const t=e.slice(i+1).find((e=>e.depth===s));if(t){const e=t.stack,n=f.Evm.Utils.toAddress(e[e.length-1]);if(n!==f.Evm.Utils.ZERO_ADDRESS){const e=2*parseInt(o[o.length-2],16),t=2*parseInt(o[o.length-3],16),i="0x"+c.join("").substring(e,e+t).padEnd(t,"00");r[n]=i}}}else T(a)&&n.add(f.Evm.Utils.toAddress(o[o.length-1]))}return{calls:[...t],selfdestructs:[...n],creations:r}}(n.trace);n.address&&!r.includes(n.address)&&r.push(n.address),n.binary&&n.status&&!(n.storageAddress in i)&&(i[n.storageAddress]=n.binary);let s=n.block.number.toString(),o=[...r,...a,...Object.keys(i)],c=r.length;Ji("obtaining binaries");let l=yield*Qt(o,s);Ji("recording instances"),yield(0,nt.all)(o.map(((e,t)=>(0,nt.call)(sa,e,l[t],t>=c,i[e])))),Ji("sending initial call"),yield*Jn(n),yield*yi(),yield*wi(),(yield(0,nt.select)(tt.status.lightMode))||(yield*Jr());try{yield*rr(t.storageLookup)}catch(e){return e}}(e,t);n&&(Ji("error %o",n),yield*function*(e){var t;yield(0,nt.put)((t=e,{type:Q,error:t}))}(n))}const na=L("session",(function*(e){Ji("starting listeners"),yield*function*(e){yield(0,nt.fork)(ea);let t=[i,o,c];e.lightMode||(t.push(a),t.push(s));let n=[l,r];const u=t.length,d=t.concat(n);return yield*function*(e){yield(0,nt.put)(dt(e))}(u),yield(0,nt.all)(d.map((e=>(0,nt.fork)(e.saga))))}(e),Ji("waiting for contract information");const{contexts:t,sources:n,contracts:u}=yield(0,nt.take)(ee);Ji("recording contract binaries"),yield*ra(t),Ji("recording contract sources"),yield*ia(n),Ji("recording other contract info"),yield*aa(u),Ji("waiting for start");const{txHash:d,provider:p,ensOptions:f}=yield(0,nt.take)(Y);Ji("starting"),e.lightMode?(Ji("setting light mode"),yield(0,nt.put)({type:ie})):(Ji("visiting ASTs"),yield*zi(),Ji("saving allocation table"),yield*Ir()),Ji("initializing adapter"),yield*fn(p,f),void 0!==d&&(yield*ta(d,e)),Ji("readying"),yield*function*(){yield(0,nt.put)(X())}()}));function*ra(e){for(const t of Object.values(e))yield*Kn(t)}function*ia(e){yield*ui(e)}function*aa(e){yield*Ar(e)}function*sa(e,t,n,r){yield*Zn(e,t,r),n||(yield*Yn(e,t))}function*oa(){Ji("unloading"),yield*Sr(),yield*fi(),yield*nr(),yield*function*(){yield(0,nt.put)({type:lt})}(),yield*Oi(),yield*Xr(),yield(0,nt.put)({type:z})}const ca=d()("debugger:data:reducers"),la={bySourceId:{}},ua={storage:{},memory:{},abi:{},calldata:{},returndata:{},event:{},state:{}},da={byCompilationId:{}},pa=(0,O.combineReducers)({scopes:function(e=la,t){switch(t.type){case pt:{const{sourceId:n,id:r,sourceIndex:i,parentId:a,pointer:s}=t,o=void 0!==r?r:x(i,s);return{bySourceId:{...e.bySourceId,[n]:{byAstRef:{...(e.bySourceId[n]||{}).byAstRef,[o]:{...(e.bySourceId[n]||{byAstRef:{}}).byAstRef[o],id:r,parentId:a,sourceIndex:i,pointer:s,sourceId:n}}}}}}case yt:{let{sourceId:n,name:r,astRef:i,scopeAstRef:a}=t,s=e.bySourceId[n].byAstRef[a],o=s.variables||[];return{bySourceId:{...e.bySourceId,[n]:{byAstRef:{...e.bySourceId[n].byAstRef,[a]:{...s,variables:[...o,{name:r,astRef:i,sourceId:n}]}}}}}}default:return e}},contracts:function(e=da,t){return t.type===St?{byCompilationId:{...e.byCompilationId,...Object.assign({},...Object.entries(t.contracts).map((([e,t])=>({[e]:{byAstId:t}}))))}}:e},userDefinedTypes:function(e=[],t){return t.type===xt?(ca("action: %O",t),[...e,{id:t.node.id,sourceId:t.sourceId}]):e},taggedOutputs:function(e=[],t){return t.type===Ct?[...e,{id:t.node.id,sourceId:t.sourceId}]:e},allocations:function(e=ua,t){return t.type===It?(ca("action: %O",t),{storage:t.storage,memory:t.memory,abi:t.abi,calldata:t.calldata,returndata:t.returndata,event:t.event,state:t.state}):e}}),fa=[[{builtin:"msg"},{location:"special",special:"msg"}],[{builtin:"tx"},{location:"special",special:"tx"}],[{builtin:"block"},{location:"special",special:"block"}],[{builtin:"this"},{location:"special",special:"this"}],[{builtin:"now"},{location:"special",special:"timestamp"}]].map((([e,t])=>A(e,t))),ya={byId:Object.assign({},...fa.map((e=>({[e.id]:e}))))},ga={byAddress:{}},ma=(0,O.combineReducers)({assignments:function(e=ya,t){switch(t.type){case mt:case ht:return ca("action.type %O",t.type),ca("action.assignments %O",t.assignments),{byId:{...e.byId,...t.assignments}};case Lt:return ya;default:return e}},mappedPaths:function(e=ga,t){switch(t.type){case ht:let{address:n,slot:r,typeIdentifier:i,parentType:a}=t;ca("typeIdentifier %s",i),i=f.Ast.Utils.regularizeTypeIdentifier(i),a=f.Ast.Utils.regularizeTypeIdentifier(a),ca("slot %o",r);let s=f.Conversion.toHexString(f.Storage.Utils.slotAddress(r),f.Evm.Utils.WORD_SIZE),o=r.path?f.Conversion.toHexString(f.Storage.Utils.slotAddress(r.path),f.Evm.Utils.WORD_SIZE):void 0,c={...e,byAddress:{...e.byAddress,[n]:{byType:{...(e.byAddress[n]||{byType:{}}).byType}}}};if(c.byAddress[n].byType={...c.byAddress[n].byType,[i]:{bySlotAddress:{...(c.byAddress[n].byType[i]||{bySlotAddress:{}}).bySlotAddress}}},void 0===c.byAddress[n].byType[i].bySlotAddress[s]){let e;ca("parentAddress %o",o),e=void 0!==o&&c.byAddress[n].byType[a]&&c.byAddress[n].byType[a].bySlotAddress[o]?{...r,path:c.byAddress[n].byType[a].bySlotAddress[o]}:r,c.byAddress[n].byType[i].bySlotAddress[s]=e}return c;case Lt:return ga;default:return e}}}),ba=(0,O.combineReducers)({info:pa,proc:ma}),ha=d()("debugger:evm:reducers"),va={byContext:{}},La=(0,O.combineReducers)({contexts:function(e=va,t){if(t.type===vn){let n={...t};return delete n.type,n.payable=f.AbiData.Utils.abiHasPayableFallback(n.abi),{...e,byContext:{...e.byContext,[n.context]:n}}}return e}}),xa={gasprice:new(he())(0),origin:f.Evm.Utils.ZERO_ADDRESS},Ca={coinbase:f.Evm.Utils.ZERO_ADDRESS,difficulty:new(he())(0),gaslimit:new(he())(0),number:new(he())(0),timestamp:new(he())(0),chainid:new(he())(0),basefee:new(he())(0)},Sa=(0,O.combineReducers)({tx:function(e=xa,t){switch(t.type){case In:let{gasprice:n,origin:r}=t;return{gasprice:n,origin:r};case Mn:return xa;default:return e}},block:function(e=Ca,t){switch(t.type){case In:return t.block;case Mn:return Ca;default:return e}}}),Ia=(0,O.combineReducers)({blockHash:function(e=null,t){switch(t.type){case An:return t.blockHash;case Mn:return null;default:return e}},txIndex:function(e=null,t){switch(t.type){case An:return t.txIndex;case Mn:return null;default:return e}}}),Aa={byAddress:{}},Ea=(0,O.combineReducers)({globals:Sa,txIdentification:Ia,status:function(e=null,t){switch(t.type){case En:return t.status;case Mn:return null;default:return e}},initialCall:function(e=null,t){switch(t.type){case Rn:case On:return null!==e?e:t;case Mn:return null;default:return e}},affectedInstances:function(e=Aa,t){switch(t.type){case Cn:const{address:n,binary:r,context:i,creationBinary:a,creationContext:s}=t;return{byAddress:{...e.byAddress,[n]:{address:n,binary:r,context:i,creationBinary:a,creationContext:s}}};case Mn:return Aa;default:return e}}}),Ra={code:"0x",context:null,storage:{}},Ta=[{accounts:{[f.Evm.Utils.ZERO_ADDRESS]:Ra}}],Oa=(0,O.combineReducers)({callstack:function(e=[],t){switch(t.type){case Rn:{const{address:n,data:r,storageAddress:i,sender:a,value:s}=t;return e.concat([{address:n,data:r,storageAddress:i,sender:a,value:s}])}case On:{const{binary:n,storageAddress:r,sender:i,value:a}=t;return e.concat([{binary:n,data:"0x",storageAddress:r,sender:i,value:a}])}case _n:case kn:case Dn:return e.length>1?e.slice(0,-1):e;case Fn:case Mn:return[];default:return e}},codex:function(e=Ta,t){let n,r,i;const a=(e,t,n,r)=>({...e,accounts:{...e.accounts,[t]:{code:"0x",context:null,...e.accounts[t],storage:{...(e.accounts[t]||{}).storage,[n]:r}}}}),s=(e,t,n,r)=>{let i=e.accounts[t]||{storage:{}};return{...e,accounts:{...e.accounts,[t]:{...i,code:n,context:r}}}},o=e=>({accounts:{...e.accounts,[f.Evm.Utils.ZERO_ADDRESS]:Ra}}),c=e=>e.length>2?e.slice(0,-2).concat([e[e.length-1]]):e;switch(t.type){case Rn:return ha("call action"),ha("codex: %O",e),r=e[e.length-1],i=o(r),[...e,i];case On:return ha("create action"),r=e[e.length-1],i=o(r),n=[...e,i],void 0!==r.accounts[t.storageAddress]||(n[n.length-1]={...r,accounts:{...r.accounts,[t.storageAddress]:Ra}}),n;case Nn:{ha("store action");const{address:i,slot:s,value:o}=t;return n=e.slice(),r=n[n.length-1],n[n.length-1]=a(r,i,s,o),n}case Pn:{ha("load action");const{address:n,slot:i,value:s}=t;return n===f.Evm.Utils.ZERO_ADDRESS?e:(r=e[e.length-1],void 0!==r.accounts[n].storage[i]?e:e.map((e=>a(e,n,i,s))))}case _n:return ha("return from call"),c(e);case kn:{ha("return from create");const{address:r,code:i,context:a}=t;return n=e.slice(),n[n.length-1]=s(n[n.length-1],r,i,a),ha("newState: %O",n),c(n)}case Dn:return ha("fail action"),(l=e).length>2?l.slice(0,-1):l;case Fn:return ha("reset action"),[e[0]];case Mn:return ha("unload action"),Ta;case Ln:{ha("adding instance");const{address:n,binary:r,context:i}=t;return e.map((e=>s(e,n,r,i)))}default:return e}var l}}),wa=(0,O.combineReducers)({storageLookupSupported:function(e=null,t){return t.type===Bn?t.status:e},storageLookup:function(e=null,t){return t.type===Un?Boolean(t.status):e}}),_a=(0,O.combineReducers)({info:La,transaction:Ea,proc:Oa,application:wa});d()("debugger:ens:reducers");const ka=(0,O.combineReducers)({cache:function(e={},t){return t.type===At?{...e,[t.address]:t.name}:e}}),Da=(0,O.combineReducers)({proc:ka}),Na=(d()("debugger:sourcemapping:reducers"),{byCompilationId:{},byContext:{}}),Pa=(0,O.combineReducers)({sources:function(e=Na,t){return t.type===ti?{byCompilationId:{...e.byCompilationId,...Object.assign({},...Object.entries(t.sources.user).map((([e,t])=>({[e]:{byIndex:t.map((e=>e.id))}}))))},byContext:{...e.byContext,...Object.assign({},...Object.entries(t.sources.internal).map((([e,t])=>({[e]:{byIndex:t.map((e=>e.id))}}))))},byId:{...e.byId,...Object.assign({},...Object.values(t.sources.user).concat(Object.values(t.sources.internal)).flat().map((e=>e?{[e.id]:e}:{})))}}:e}}),ja=(0,O.combineReducers)({functionDepthStack:function(e=[],t){switch(t.type){case ni:let r=e.slice();const i="i"===(n=t.jumpDirection)?1:"o"===n?-1:0;let a=r[r.length-1],s=r.length>1?r[r.length-2]:-1;return r[r.length-1]=Math.max(a+i,s+1),r;case oi:return[0];case ci:return[];case ri:return 0===e.length?[0]:[...e,e[e.length-1]+1];case ai:return e.length>1?e.slice(0,-1):e;default:return e}var n},nextFrameIsPhantom:function(e=null,t){switch(t.type){case si:case ai:return!1;case ri:case oi:return t.guard;case ci:return null;default:return e}}}),Fa=(0,O.combineReducers)({info:Pa,proc:ja}),Ma=d()("debugger:trace:reducers"),Ua=(0,O.combineReducers)({steps:function(e=null,t){switch(t.type){case rt:return t.steps;case lt:return Ma("unloading"),null;default:return e}}}),Ba=(0,O.combineReducers)({index:function(e=0,t){switch(t.type){case st:return e+1;case ct:case lt:return 0;default:return e}},finished:function(e=!1,t){switch(t.type){case ot:return!0;case ct:case lt:return!1;default:return e}}}),Va=(0,O.combineReducers)({submoduleCount:function(e=0,t){return t.type===ut?t.count:e}}),Ga=(0,O.combineReducers)({transaction:Ua,proc:Ba,application:Va}),Ha=d()("debugger:controller:reducers"),Wa=(0,O.combineReducers)({breakpoints:function(e=[],t){switch(t.type){case B:return e.filter((e=>e.sourceId===t.breakpoint.sourceId&&e.line===t.breakpoint.line&&e.node===t.breakpoint.node)).length>0?e:e.concat([t.breakpoint]);case V:return e.filter((e=>e.sourceId!==t.breakpoint.sourceId||e.line!==t.breakpoint.line||e.node!==t.breakpoint.node));case G:return[];default:return e}},stepIntoInternalSources:function(e=!1,t){return t.type===H?t.status:e},isStepping:function(e=!1,t){switch(t.type){case W:return Ha("got step start action"),!0;case K:return Ha("got step stop action"),!1;default:return e}}});d()("debugger:stacktrace:reducers");const Ka=(0,O.combineReducers)({callstack:function(e=[],t){let n;switch(t.type){case bi:const{location:r,functionNode:i,contractNode:a,sourceIsInternal:s,sourceIsGenerated:o}=t;return n={type:"internal",calledFromLocation:r,address:e[e.length-1].address,isConstructor:e[e.length-1].isConstructor,functionName:!i||"FunctionDefinition"!==i.nodeType&&"YulFunctionDefinition"!==i.nodeType?void 0:i.name,contractName:a&&"ContractDefinition"===a.nodeType?a.name:void 0,combineWithNextInternal:!1,sourceIsInternal:s,sourceIsGenerated:o},[...e,n];case hi:let c=e[e.length-1];return c&&"internal"===c.type?e.slice(0,-1):e;case vi:return n={type:"external",address:t.address,calledFromLocation:t.location,functionName:void 0,contractName:t.context.contractName,isConstructor:t.context.isConstructor,combineWithNextInternal:t.combineWithNextInternal},[...e,n];case Ci:return C(e,t.counter,(e=>"external"===e.type));case Ii:return[e[0]];case Ai:return[];default:return e}},returnCounter:function(e=0,t){switch(t.type){case xi:return e+1;case Ci:case Ii:case Ai:return 0;default:return e}},lastPosition:function(e=null,t){switch(t.type){case bi:case hi:case vi:case xi:case Si:case Ci:const{location:n}=t;return null===n||void 0===n.source.id||n.source.internal?e:n;case Ii:case Ai:return null;default:return e}},innerReturnPosition:function(e=null,t){switch(t.type){case xi:return e||t.from;case Ci:case Ii:case Ai:return null;default:return e}},innerReturnStatus:function(e=null,t){switch(t.type){case xi:return null===e?t.status:e;case Ci:case Ii:case Ai:return null;default:return e}},innerErrorIndex:function(e=null,t){switch(t.type){case xi:return null!==t.index?t.index:e;case Ii:case Ai:return null;default:return e}}}),Ya=(0,O.combineReducers)({proc:Ka}),$a=d()("debugger:txlog:reducers"),qa={byPointer:{"":{type:"transaction",actions:[]}}},za=(0,O.combineReducers)({transactionLog:function(e=qa,t){const{pointer:n,newPointer:r,step:i}=t,a=e.byPointer[n];switch(t.type){case Wr:return"transaction"===a.type?{byPointer:{...e.byPointer,[n]:{...a,origin:t.address}}}:($a("attempt to set origin of bad node type!"),e);case Gr:return{byPointer:{...e.byPointer,[n]:{...a,actions:[...a.actions,r]},[r]:{type:"event",decoding:t.decoding,raw:t.rawEventInfo,step:i}}};case Hr:return{byPointer:{...e.byPointer,[n]:{...a,actions:[...a.actions,r]},[r]:{type:"write",raw:{[t.rawSlot]:t.rawValue},steps:{[t.rawSlot]:i}}}};case Tr:return{byPointer:{...e.byPointer,[n]:{...a,actions:[...a.actions,r]},[r]:{type:"callinternal",actions:[],beginStep:i,waitingForFunctionDefinition:!0}}};case Or:return{byPointer:{...e.byPointer,[n]:{...a,absorbNextInternalCall:!1}}};case wr:const s={...a};return"callinternal"===s.type?(s.returnKind="return",s.returnValues=t.variables,delete s.waitingForFunctionDefinition):"callexternal"===s.type?"function"===s.kind&&(s.returnValues=t.variables):$a("returninternal once tx done!"),s.endStep=i,{byPointer:{...e.byPointer,[n]:s}};case Nr:case kr:case Fr:case Pr:{const s=t.type===Nr||t.type===Fr;let o={...a,actions:[...a.actions,r]};"callexternal"===o.type&&"library"===o.kind&&(o.kind="message");const{address:c,binary:l,context:u,value:d,salt:p,isDelegate:f,decoding:y,calldata:g,status:m}=t;let b;b=t.type===Pr||t.type===Fr?u?"constructor":"unknowncreate":t.kind;const h=u?u.contractName:void 0;let v,L;"function"!==y.kind&&"constructor"!==y.kind||(v=y.abi.name,L=y.arguments);let x={type:"callexternal",address:c,contextHash:u.context||null,value:d,kind:b,isDelegate:f,functionName:v,contractName:h,arguments:L,actions:[],beginStep:i};return"message"===b||"library"===b?x.data=g:"unknowncreate"===b&&(x.binary=l),"constructor"!==b&&"unknowncreate"!==b||(x.salt=p),s?(x.returnKind=m?"return":"revert",x.endStep=i):(x.waitingForFunctionDefinition="message"!==b,x.absorbNextInternalCall=("function"===b||"library"===b)&&t.absorbNextInternalCall),x.raw={},g&&(x.raw.calldata=g),l&&(x.raw.binary=l),{byPointer:{...e.byPointer,[n]:o,[r]:x}}}case Mr:case Br:case Ur:{let s={...a};switch("callexternal"===s.type&&"library"===s.kind&&(s.kind="message"),t.type){case Mr:s.returnKind||(s.returnKind="return");break;case Br:s.returnKind="revert",s.error=t.error;break;case Ur:s.returnKind="selfdestruct",s.beneficiary=t.beneficiary}s.endStep=i;let o,c={byPointer:{...e.byPointer,[n]:s}};for(o=n;o.replace(/\/actions\/\d+$/,"")!==r;o=o.replace(/\/actions\/\d+$/,"")){$a("currentNode!");let e={...c.byPointer[o]};e.returnKind||(e.returnKind="unwind",e.endStep=i),delete e.waitingForFunctionDefinition,$a("set currentNode!"),c.byPointer[o]=e}$a("finalNode!");let l={...c.byPointer[o]};if(l.returnKind||(l.returnKind="unwind"),"function"===l.kind&&t.type===Mr&&t.decodings){const e=t.decodings.find((e=>"return"===e.kind));e&&(l.returnValues=e.arguments)}if("message"===l.kind&&t.type===Mr&&(l.returnData=t.returnData),"constructor"===l.kind&&t.type===Mr&&t.decodings){const e=t.decodings.find((e=>"bytecode"===e.kind));e&&e.immutables&&(l.returnImmutables=e.immutables)}return l.endStep=i,delete l.waitingForFunctionDefinition,delete l.absorbNextInternalCall,$a("set finalNode!"),c.byPointer[o]=l,c}case Vr:{const{functionNode:r,contractNode:i,variables:s}=t,o=r.name||void 0,c=i&&"ContractDefinition"===i.nodeType?i.name:null;let l={...a,waitingForFunctionDefinition:!1};return l.functionName||(l.functionName=o),l.contractName||(l.contractName=c),l.arguments||(l.arguments=s),"callexternal"===l.type&&"library"===l.kind&&(l.kind="function",delete l.data),{byPointer:{...e.byPointer,[n]:l}}}case Kr:return{byPointer:{"":{type:"transaction",origin:e.byPointer[""].origin,actions:[]}}};case Yr:return qa;default:return e}},currentNodePointer:function(e="",t){switch(t.type){case Tr:case kr:case Pr:case wr:case Mr:case Br:case Ur:return t.newPointer;case Kr:case Yr:return"";default:return e}},pointerStack:function(e=[],t){switch(t.type){case kr:case Pr:return[...e,t.newPointer];case Mr:case Br:case Ur:return e.slice(0,-1);case Kr:case Yr:return[];default:return e}}}),Za=(0,O.combineReducers)({initialCall:function(e=null,t){switch(t.type){case kr:case Pr:return null!==e?e:t;case Yr:return null;default:return e}}}),Xa=(0,O.combineReducers)({proc:za,transaction:Za}),Ja=d()("debugger:session:reducers"),Qa=(0,O.combineReducers)({ready:function(e=!1,t){switch(t.type){case Z:return Ja("readying"),!0;case J:return!1;default:return e}},lastLoadingError:function(e=null,t){switch(t.type){case Q:return Ja("error: %o",t.error),t.error;case J:return null;default:return e}},transaction:function(e={},t){switch(t.type){case te:return t.transaction;case z:return{};default:return e}},receipt:function(e={},t){switch(t.type){case ne:return t.receipt;case z:return{};default:return e}},block:function(e={},t){switch(t.type){case re:return t.block;case z:return{};default:return e}},lightMode:function(e=!1,t){switch(t.type){case ie:return!0;case ae:return!1;default:return e}}}),es=(0,O.combineReducers)({session:Qa,data:ba,ens:Da,txlog:Xa,evm:_a,sourcemapping:Fa,stacktrace:Ya,trace:Ga,controller:Wa});var ts=n(583);const ns=d()("debugger:session");class rs{constructor(e,t,n,r){const{store:i,sagaMiddleware:a}=function(e,t,n,r,i){const a=_()();i||(i=O.compose);let s=(0,O.createStore)(e,r,i((0,O.applyMiddleware)(a)));return a.run(t,...n),{store:s,sagaMiddleware:a}}(es,na,[n]);this._store=i,this._sagaMiddleware=a;const{contexts:s,sources:o,contracts:c}=rs.normalize(e);this._store.dispatch(function(e,t,n){return{type:ee,contexts:e,sources:t,contracts:n}}(s,o,c)),this._ready=new Promise(((e,t)=>{const n=this._store.subscribe((()=>{this.view(tt.status.ready)?(ns("ready!"),n(),e()):this.view(tt.status.errored)&&(ns("error!"),n(),t(this.view(tt.status.error)))}))}));const l=n?.ens?.registryAddress;if(l&&!Gt.utils.isAddress(l))throw new Error(`Error: Invalid address ${l}`);this._store.dispatch(function(e,t,n={}){return{type:Y,provider:e,txHash:t,ensOptions:n}}(t,r,n.ens))}async ready(){await this._ready}async readyAgainAfterLoading(e){return new Promise(((t,n)=>{let r=!1;ns("reready listener set up");const i=this._store.subscribe((()=>{ns("reready?"),r?this.view(tt.status.ready)?(ns("reready!"),i(),t(!0)):this.view(tt.status.errored)&&(i(),ns("error!"),n(this.view(tt.status.error))):this.view(tt.status.waiting)&&(ns("started waiting"),r=!0)}));this.dispatch(e)}))}static normalize(e){let t=[],n={user:{},internal:{}},r={};const i=(e,t,n)=>I({compilationId:e,contextHash:t,index:n});for(const a of e){if(a.unreliableSourceOrder)throw new Error(`Error: Compilation ${a.id} has unreliable source order.`);const e=a.compiler,s=a.settings;n.user[a.id]=[],r[a.id]={};for(let t in a.sources){t=Number(t);let r=a.sources[t];if(!r)continue;let o=r.ast;o&&!o.nodeType&&(o=void 0),n.user[a.id][t]={...r,ast:o,compiler:r.compiler||e,settings:r.settings||s,compilationId:a.id,index:t,id:i(a.id,null,t),internal:!1}}for(let e of a.contracts){let s,o,{contractName:c,bytecode:l,sourceMap:u,deployedBytecode:d,deployedSourceMap:y,immutableReferences:g,abi:m,compiler:b,settings:h,primarySourceId:v,generatedSources:L,deployedGeneratedSources:x}=e;ns("contractName: %s",c),"object"==typeof l&&(l=ts.Shims.NewToLegacy.forBytecode(l)),"object"==typeof d&&(d=ts.Shims.NewToLegacy.forBytecode(d)),void 0!==v&&(s=a.sources.findIndex((e=>e&&e.id===v))),void 0!==s&&(o=a.sources[s].language);const C=f.Compilations.Utils.getContractNode(e,a),I=C?C.id:void 0,A=C?C.contractKind:void 0,E=C?C.linearizedBaseContracts:void 0;if(m=p.normalize(m),ns("contractName %s",c),ns("sourceMap %o",u),ns("compiler %o",b),ns("abi %o",m),I&&(r[a.id][I]={compilationId:a.id,contractId:I,abi:m,deployedContext:null,constructorContext:null}),u=f.Compilations.Utils.simpleShimSourceMap(u),y=f.Compilations.Utils.simpleShimSourceMap(y),l&&"0x"!=l){const e=S({type:"string",value:l});if(t.push({context:e,contractName:c,binary:l,sourceMap:u,primarySource:s,abi:m,compiler:b,settings:h,compilationId:a.id,contractId:I,contractKind:A,linearizedBaseContracts:E,primaryLanguage:o,isConstructor:!0}),L){n.internal[e]=[];for(let t in L){t=Number(t);const r=L[t];r&&(n.internal[e][t]={...r,compiler:r.compiler||b,settings:r.settings||h,compilationId:a.id,index:t,id:i(a.id,e,t),internal:!0,internalFor:e})}}I&&(r[a.id][I].constructorContext=e)}if(d&&"0x"!=d){const e=S({type:"string",value:d});if(t.push({context:e,contractName:c,binary:d,sourceMap:y,primarySource:s,immutableReferences:g,abi:m,compiler:b,settings:h,compilationId:a.id,contractId:I,contractKind:A,linearizedBaseContracts:E,primaryLanguage:o,isConstructor:!1}),x){n.internal[e]=[];for(let t in x){t=Number(t);const r=x[t];r&&(n.internal[e][t]={...r,compiler:r.compiler||b,settings:r.settings||h,compilationId:a.id,index:t,id:i(a.id,e,t),internal:!0,internalFor:e})}}I&&(r[a.id][I].deployedContext=e)}}}return t=Object.assign({},...t.map((e=>({[e.context]:{...e}})))),t=f.Contexts.Utils.normalizeContexts(t),{contexts:t,sources:n,contracts:r}}get state(){return this._store.getState()}view(e){return e(this.state)}async dispatch(e){return this._store.dispatch(e),!0}async _runSaga(e,...t){return await this._sagaMiddleware.run(e,...t).toPromise()}async interrupt(){await this.dispatch({type:q}),await this.dispatch({type:F})}async doneStepping(e){return new Promise((t=>{let n=!1;const r=this._store.subscribe((()=>{const e=this.view(Fi.isStepping);!e||n?!e&&n&&(r(),t(!0)):n=!0}));this.dispatch(e)}))}async load(e,t={}){return!this.view(tt.status.loaded)&&await this.readyAgainAfterLoading(function(e,t){return{type:$,txHash:e,options:t}}(e,t))}async unload(){return!!this.view(tt.status.loaded)&&(ns("unloading"),await this._runSaga(oa),!0)}async advance(e){return await this.doneStepping(function(e){return{type:k,count:e}}(e))}async stepNext(){return await this.doneStepping({type:D})}async stepOver(){return await this.doneStepping({type:N})}async stepInto(){return await this.doneStepping({type:P})}async stepOut(){return await this.doneStepping({type:j})}async reset(){if(this.view(tt.status.loaded))return await this._runSaga(Ki)}async runToEnd(){return await this.dispatch({type:M})}async continueUntilBreakpoint(e){return await this.doneStepping(function(e){return{type:U,breakpoints:e}}(e))}async addBreakpoint(e){return await this.dispatch(function(e){return{type:B,breakpoint:e}}(e))}async removeBreakpoint(e){return await this.dispatch(function(e){return{type:V,breakpoint:e}}(e))}async removeAllBreakpoints(){return await this.dispatch({type:G})}async setInternalStepping(e){return await this.dispatch((t=e,{type:H,status:t}));var t}async decodeReady(){return!0}async variable(e){const t=this.view(qe.current.identifiers.definitions),n=this.view(qe.current.identifiers.refs),r=this.view(qe.current.compilationId);return ns("name: %s",e),ns("refs: %O",n),ns("definitions: %o",t),await this._runSaga(vr,t[e],n[e],r)}async variables(){if(!this.view(tt.status.loaded))return{};let e=this.view(qe.current.identifiers.definitions),t=this.view(qe.current.identifiers.refs),n=this.view(qe.current.compilationId),r={};for(let[i,a]of Object.entries(t))i in e&&(r[i]=await this._runSaga(vr,e[i],a,n));return r}async returnValue(){return this.view(tt.status.loaded)&&this.view(Ce.current.step.isHalting)?await this._runSaga(Lr):null}callstack(){return this.view(tt.status.loaded)?this.view(Fe.current.report):null}stacktrace(){return this.view(tt.status.loaded)?this.view(Fe.current.finalReport):null}connect(){return this}async addExternalCompilations(e){const{contexts:t,sources:n,contracts:r}=rs.normalize(e);return await this.dispatch(function(e,t,n){return{type:oe,sources:e,contexts:t,contracts:n}}(n,t,r))}async startFullMode(){return await this.dispatch({type:se})}get selectors(){return(0,ce.createNestedSelector)({ast:Yi,data:qe,ens:mn,txlog:Qe,trace:me,evm:Ce,sourcemapping:Oe,stacktrace:Fe,session:tt,controller:Fi})}}d()("debugger");const is={forTx:async function(e,t={}){const{contracts:n,files:r,provider:i,compilations:a,lightMode:s,storageLookup:o,ens:c}=t;a||(a=f.Compilations.Utils.shimArtifacts(n,r));let l=new rs(a,i,{lightMode:s,storageLookup:o,ens:c},e);return await l.ready(),l},forProject:async function(e={}){const{contracts:t,files:n,provider:r,compilations:i,lightMode:a,ens:s}=e;i||(i=f.Compilations.Utils.shimArtifacts(t,n));let o=new rs(i,r,{lightMode:a,ens:s});return await o.ready(),o},get selectors(){return(0,ce.createNestedSelector)({ast:Yi,data:qe,ens:mn,txlog:Qe,trace:me,evm:Ce,sourcemapping:Oe,stacktrace:Fe,session:tt,controller:Fi})}},as=is},346:e=>{"use strict";class t extends Error{constructor(e){super(e),this.name=this.constructor.name,this.stack=""}}e.exports=t},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},837:e=>{"use strict";e.exports=require("util")}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(529)})()));
|
||
//# sourceMappingURL=debugger.js.map
|