1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[937],{73937:function(e,a,t){t.d(a,{offchainLookup:function(){return g},offchainLookupSignature:function(){return b}});var r=t(98057),n=t(91778),s=t(25358),o=t(32891);class c extends s.G{constructor({callbackSelector:e,cause:a,data:t,extraData:r,sender:n,urls:s}){var c;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(null===(c=a.metaMessages)||void 0===c?void 0:c.length)?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(e=>" ".concat((0,o.Gr)(e)))]," Sender: ".concat(n)," Data: ".concat(t)," Callback selector: ".concat(e)," Extra data: ".concat(r)].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class i extends s.G{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:["Gateway URL: ".concat((0,o.Gr)(a)),"Response: ".concat((0,n.P)(e))]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class u extends s.G{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:["Contract address: ".concat(a),"OffchainLookup sender address: ".concat(e)]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}var l=t(31008),d=t(4588),f=t(5871),h=t(73825),p=t(55268),w=t(41281),y=t(87268);let b="0x556f1830",m={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function g(e,a){let{blockNumber:t,blockTag:n,data:s,to:o}=a,{args:i}=(0,d.p)({data:s,abi:[m]}),[l,y,b,g,k]=i;try{if(!function(e,a){if(!(0,p.U)(e))throw new h.b({address:e});if(!(0,p.U)(a))throw new h.b({address:a});return e.toLowerCase()===a.toLowerCase()}(o,l))throw new u({sender:l,to:o});let a=await v({data:b,sender:l,urls:y}),{data:s}=await (0,r.RE)(e,{blockNumber:t,blockTag:n,data:(0,w.zo)([g,(0,f.E)([{type:"bytes"},{type:"bytes"}],[a,k])]),to:o});return s}catch(e){throw new c({callbackSelector:g,cause:e,data:s,extraData:k,sender:l,urls:y})}}async function v(e){let{data:a,sender:t,urls:r}=e,s=Error("An unknown error occurred.");for(let e=0;e<r.length;e++){let c=r[e],u=c.includes("{data}")?"GET":"POST",d="POST"===u?{data:a,sender:t}:void 0;try{var o;let e;let r=await fetch(c.replace("{sender}",t).replace("{data}",a),{body:JSON.stringify(d),method:u});if(e=(null===(o=r.headers.get("Content-Type"))||void 0===o?void 0:o.startsWith("application/json"))?(await r.json()).data:await r.text(),!r.ok){s=new l.Gg({body:d,details:(null==e?void 0:e.error)?(0,n.P)(e.error):r.statusText,headers:r.headers,status:r.status,url:c});continue}if(!(0,y.v)(e)){s=new i({result:e,url:c});continue}return e}catch(e){s=new l.Gg({body:d,details:e.message,url:c})}}throw s}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.