LavaPack.loadBundle([["/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/app/dist/esm/index.esm2017.js",{"@firebase/component":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/component/dist/esm/index.esm2017.js","@firebase/logger":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/logger/dist/index.cjs.js","@firebase/util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/util/dist/index.esm2017.js",idb:"/home/runner/work/metamask-extension/metamask-extension/node_modules/idb/build/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"FirebaseError",{enumerable:!0,get:function(){return a.FirebaseError}}),s._DEFAULT_ENTRY_NAME=s.SDK_VERSION=void 0,s._addComponent=G,s._addOrOverwriteComponent=function(e,t){e.container.addOrOverwriteComponent(t)},s._apps=void 0,s._clearComponents=function(){U.clear()}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s._components=void 0,s._getProvider=$,s._isFirebaseApp=W,s._isFirebaseServerApp=function(e){return e.settings!==undefined},s._registerComponent=q,s._removeServiceInstance=function(e,t,s=N){$(e,t).clearInstance(s)},s._serverApps=void 0,s.deleteApp=X,s.getApp=function(e=N){const t=L.get(e);if(!t&&e===N&&(0,a.getDefaultAppConfig)())return Y();if(!t)throw V.create("no-app",{appName:e});return t},s.getApps=function(){return Array.from(L.values())},s.initializeApp=Y,s.initializeServerApp=function(e,t){if((0,a.isBrowser)()&&!(0,a.isWebWorker)())throw V.create("invalid-server-app-environment");t.automaticDataCollectionEnabled===undefined&&(t.automaticDataCollectionEnabled=!1);let s;s=W(e)?e.options:e;const r=Object.assign(Object.assign({},t),s);r.releaseOnDeref!==undefined&&delete r.releaseOnDeref;if(t.releaseOnDeref!==undefined&&"undefined"==typeof FinalizationRegistry)throw V.create("finalization-registry-not-supported",{});const o=""+(c=JSON.stringify(r),[...c].reduce((e,t)=>Math.imul(31,e)+t.charCodeAt(0)|0,0)),i=H.get(o);var c;if(i)return i.incRefCount(t.releaseOnDeref),i;const l=new n.ComponentContainer(o);for(const e of U.values())l.addComponent(e);const d=new J(s,t,o,l);return H.set(o,d),d},s.onLog=function(e,t){if(null!==e&&"function"!=typeof e)throw V.create("invalid-log-argument");(0,r.setUserLogHandler)(e,t)},s.registerVersion=Q,s.setLogLevel=function(e){(0,r.setLogLevel)(e)}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */;var n=e("@firebase/component"),r=e("@firebase/logger"),a=e("@firebase/util"),o=e("idb");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class i{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const c="@firebase/app",l="0.10.18",d=new r.Logger("@firebase/app"),m="@firebase/app-compat",u="@firebase/analytics-compat",p="@firebase/analytics",h="@firebase/app-check-compat",f="@firebase/app-check",g="@firebase/auth",k="@firebase/auth-compat",w="@firebase/database",y="@firebase/data-connect",b="@firebase/database-compat",v="@firebase/functions",_="@firebase/functions-compat",x="@firebase/installations",E="@firebase/installations-compat",S="@firebase/messaging",T="@firebase/messaging-compat",j="@firebase/performance",C="@firebase/performance-compat",A="@firebase/remote-config",I="@firebase/remote-config-compat",P="@firebase/storage",O="@firebase/storage-compat",D="@firebase/firestore",M="@firebase/vertexai",B="@firebase/firestore-compat",R="firebase",N=s._DEFAULT_ENTRY_NAME="[DEFAULT]",F={[c]:"fire-core",[m]:"fire-core-compat",[p]:"fire-analytics",[u]:"fire-analytics-compat",[f]:"fire-app-check",[h]:"fire-app-check-compat",[g]:"fire-auth",[k]:"fire-auth-compat",[w]:"fire-rtdb",[y]:"fire-data-connect",[b]:"fire-rtdb-compat",[v]:"fire-fn",[_]:"fire-fn-compat",[x]:"fire-iid",[E]:"fire-iid-compat",[S]:"fire-fcm",[T]:"fire-fcm-compat",[j]:"fire-perf",[C]:"fire-perf-compat",[A]:"fire-rc",[I]:"fire-rc-compat",[P]:"fire-gcs",[O]:"fire-gcs-compat",[D]:"fire-fst",[B]:"fire-fst-compat",[M]:"fire-vertex","fire-js":"fire-js",[R]:"fire-js-all"},L=s._apps=new Map,H=s._serverApps=new Map,U=s._components=new Map;function G(e,t){try{e.container.addComponent(t)}catch(s){d.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,s)}}function q(e){const t=e.name;if(U.has(t))return d.debug(`There were multiple attempts to register component ${t}.`),!1;U.set(t,e);for(const t of L.values())G(t,e);for(const t of H.values())G(t,e);return!0}function $(e,t){const s=e.container.getProvider("heartbeat").getImmediate({optional:!0});return s&&s.triggerHeartbeat(),e.container.getProvider(t)}function W(e){return e.options!==undefined}const z={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},V=new a.ErrorFactory("app","Firebase",z);
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class K{constructor(e,t,s){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=s,this.container.addComponent(new n.Component("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw V.create("app-deleted",{appName:this._name})}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class J extends K{constructor(e,t,s,n){const r=t.automaticDataCollectionEnabled!==undefined&&t.automaticDataCollectionEnabled,a={name:s,automaticDataCollectionEnabled:r};if(e.apiKey!==undefined)super(e,a,n);else{super(e.options,a,n)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:r},t),this._finalizationRegistry=null,"undefined"!=typeof FinalizationRegistry&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=undefined,t.releaseOnDeref=undefined,Q(c,l,"serverapp")}toJSON(){return undefined}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==undefined&&null!==this._finalizationRegistry&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){X(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw V.create("server-app-deleted")}}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */s.SDK_VERSION="11.2.0";function Y(e,t={}){let s=e;if("object"!=typeof t){t={name:t}}const r=Object.assign({name:N,automaticDataCollectionEnabled:!1},t),o=r.name;if("string"!=typeof o||!o)throw V.create("bad-app-name",{appName:String(o)});if(s||(s=(0,a.getDefaultAppConfig)()),!s)throw V.create("no-options");const i=L.get(o);if(i){if((0,a.deepEqual)(s,i.options)&&(0,a.deepEqual)(r,i.config))return i;throw V.create("duplicate-app",{appName:o})}const c=new n.ComponentContainer(o);for(const e of U.values())c.addComponent(e);const l=new K(s,r,c);return L.set(o,l),l}async function X(e){let t=!1;const s=e.name;if(L.has(s))t=!0,L.delete(s);else if(H.has(s)){e.decRefCount()<=0&&(H.delete(s),t=!0)}t&&(await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function Q(e,t,s){var r;let a=null!==(r=F[e])&&void 0!==r?r:e;s&&(a+=`-${s}`);const o=a.match(/\s|\//),i=t.match(/\s|\//);if(o||i){const e=[`Unable to register library "${a}" with version "${t}":`];return o&&e.push(`library name "${a}" contains illegal characters (whitespace or "/")`),o&&i&&e.push("and"),i&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void d.warn(e.join(" "))}q(new n.Component(`${a}-version`,()=>({library:a,version:t}),"VERSION"))}const Z="firebase-heartbeat-store";let ee=null;function te(){return ee||(ee=(0,o.openDB)("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(Z)}catch(e){console.warn(e)}}}).catch(e=>{throw V.create("idb-open",{originalErrorMessage:e.message})})),ee}async function se(e,t){try{const s=(await te()).transaction(Z,"readwrite"),n=s.objectStore(Z);await n.put(t,ne(e)),await s.done}catch(e){if(e instanceof a.FirebaseError)d.warn(e.message);else{const t=V.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});d.warn(t.message)}}}function ne(e){return`${e.name}!${e.options.appId}`}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class re{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new oe(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=ae();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some(e=>e.date===n))return;return this._heartbeatsCache.heartbeats.push({date:n,agent:s}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache)}catch(e){d.warn(e)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=ae(),{heartbeatsToSend:s,unsentEntries:n}=function(e,t=1024){const s=[];let n=e.slice();for(const r of e){const e=s.find(e=>e.agent===r.agent);if(e){if(e.dates.push(r.date),ie(s)>t){e.dates.pop();break}}else if(s.push({agent:r.agent,dates:[r.date]}),ie(s)>t){s.pop();break}n=n.slice(1)}return{heartbeatsToSend:s,unsentEntries:n}}(this._heartbeatsCache.heartbeats),r=(0,a.base64urlEncodeWithoutPadding)(JSON.stringify({version:2,heartbeats:s}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(e){return d.warn(e),""}}}function ae(){return(new Date).toISOString().substring(0,10)}class oe{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,a.isIndexedDBAvailable)()&&(0,a.validateIndexedDBOpenable)().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await te()).transaction(Z),s=await t.objectStore(Z).get(ne(e));return await t.done,s}catch(e){if(e instanceof a.FirebaseError)d.warn(e.message);else{const t=V.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});d.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const s=await this.read();return se(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const s=await this.read();return se(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}}}function ie(e){return(0,a.base64urlEncodeWithoutPadding)(JSON.stringify({version:2,heartbeats:e})).length}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var ce;ce="",q(new n.Component("platform-logger",e=>new i(e),"PRIVATE")),q(new n.Component("heartbeat",e=>new re(e),"PRIVATE")),Q(c,l,ce),Q(c,l,"esm2017"),Q("fire-js","")}}},{package:"@metamask/notification-services-controller>firebase>@firebase/app",file:"node_modules/@firebase/app/dist/esm/index.esm2017.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/component/dist/esm/index.esm2017.js",{"@firebase/util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/util/dist/index.esm2017.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.Provider=s.ComponentContainer=s.Component=void 0;var n=e("@firebase/util");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
s.Component=class{constructor(e,t,s){this.name=e,this.instanceFactory=t,this.type=s,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};const r="[DEFAULT]";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new n.Deferred;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:t});s&&e.resolve(s)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const s=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(s)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:s})}catch(e){if(n)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e))try{this.getOrInitializeService({instanceIdentifier:r})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:s});t.resolve(e)}catch(e){}}}}clearInstance(e=r){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=r){return this.instances.has(e)}getOptions(e=r){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,s=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(s))throw Error(`${this.name}(${s}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const n=this.getOrInitializeService({instanceIdentifier:s,options:t});for(const[e,t]of this.instancesDeferred.entries()){s===this.normalizeInstanceIdentifier(e)&&t.resolve(n)}return n}onInit(e,t){var s;const n=this.normalizeInstanceIdentifier(t),r=null!==(s=this.onInitCallbacks.get(n))&&void 0!==s?s:new Set;r.add(e),this.onInitCallbacks.set(n,r);const a=this.instances.get(n);return a&&e(a,n),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const s=this.onInitCallbacks.get(t);if(s)for(const n of s)try{n(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let s=this.instances.get(e);if(!s&&this.component&&(s=this.component.instanceFactory(this.container,{instanceIdentifier:(n=e,n===r?undefined:n),options:t}),this.instances.set(e,s),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(s,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,s)}catch(e){}var n;return s||null}normalizeInstanceIdentifier(e=r){return this.component?this.component.multipleInstances?e:r:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}s.Provider=a;s.ComponentContainer=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new a(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}}}},{package:"@metamask/notification-services-controller>firebase>@firebase/app>@firebase/component",file:"node_modules/@firebase/component/dist/esm/index.esm2017.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/installations/dist/esm/index.esm2017.js",{"@firebase/app":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/app/dist/esm/index.esm2017.js","@firebase/component":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/component/dist/esm/index.esm2017.js","@firebase/util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/util/dist/index.esm2017.js",idb:"/home/runner/work/metamask-extension/metamask-extension/node_modules/idb/build/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.deleteInstallations=
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function(e){const{appConfig:t}=e,s=await U(t,e=>e&&0===e.registrationStatus?undefined:e);if(s){if(1===s.registrationStatus)throw f.create("delete-pending-registration");if(2===s.registrationStatus){if(!navigator.onLine)throw f.create("app-offline");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
await async function(e,t){const s=function(e,{fid:t}){return`${k(e)}/${t}`}(e,t),n=v(e,t),r={method:"DELETE",headers:n},a=await _(()=>fetch(s,r));if(!a.ok)throw await y("Delete Installation",a)}(t,s),await H(t)}}}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.getId=Y,s.getInstallations=
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e=(0,n.getApp)()){return(0,n._getProvider)(e,"installations").getImmediate()}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.getToken=X,s.onIdChange=function(e,t){const{appConfig:s}=e;return function(e,t){O();const s=j(e);let n=C.get(s);n||(n=new Set,C.set(s,n));n.add(t)}(s,t),()=>{!function(e,t){const s=j(e),n=C.get(s);if(!n)return;n.delete(t),0===n.size&&C.delete(s);D()}(s,t)}};var n=e("@firebase/app"),r=e("@firebase/component"),a=e("@firebase/util"),o=e("idb");const i="@firebase/installations",c="0.6.12",l=1e4,d=`w:${c}`,m="FIS_v2",u="https://firebaseinstallations.googleapis.com/v1",p=36e5,h={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},f=new a.ErrorFactory("installations","Installations",h);function g(e){return e instanceof a.FirebaseError&&e.code.includes("request-failed")}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function k({projectId:e}){return`${u}/projects/${e}/installations`}function w(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function y(e,t){const s=(await t.json()).error;return f.create("request-failed",{requestName:e,serverCode:s.code,serverMessage:s.message,serverStatus:s.status})}function b({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function v(e,{refreshToken:t}){const s=b(e);return s.append("Authorization",function(e){return`${m} ${e}`}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t)),s}async function _(e){const t=await e();return t.status>=500&&t.status<600?e():t}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function x(e){return new Promise(t=>{setTimeout(t,e)})}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const E=/^[cdef][\w-]{21}$/,S="";function T(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=(s=e,btoa(String.fromCharCode(...s)).replace(/\+/g,"-").replace(/\//g,"_"));var s;return t.substr(0,22)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e);return E.test(t)?t:S}catch(e){return S}}function j(e){return`${e.appName}!${e.appId}`}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const C=new Map;function A(e,t){const s=j(e);I(s,t),function(e,t){const s=O();s&&s.postMessage({key:e,fid:t});D()}(s,t)}function I(e,t){const s=C.get(e);if(s)for(const e of s)e(t)}let P=null;function O(){return!P&&"BroadcastChannel"in self&&(P=new BroadcastChannel("[Firebase] FID Change"),P.onmessage=e=>{I(e.data.key,e.data.fid)}),P}function D(){0===C.size&&P&&(P.close(),P=null)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const M="firebase-installations-database",B=1,R="firebase-installations-store";let N=null;function F(){return N||(N=(0,o.openDB)(M,B,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(R)}})),N}async function L(e,t){const s=j(e),n=(await F()).transaction(R,"readwrite"),r=n.objectStore(R),a=await r.get(s);return await r.put(t,s),await n.done,a&&a.fid===t.fid||A(e,t.fid),t}async function H(e){const t=j(e),s=(await F()).transaction(R,"readwrite");await s.objectStore(R).delete(t),await s.done}async function U(e,t){const s=j(e),n=(await F()).transaction(R,"readwrite"),r=n.objectStore(R),a=await r.get(s),o=t(a);return o===undefined?await r.delete(s):await r.put(o,s),await n.done,!o||a&&a.fid===o.fid||A(e,o.fid),o}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function G(e){let t;const s=await U(e.appConfig,s=>{const n=function(e){const t=e||{fid:T(),registrationStatus:0};return W(t)}(s),r=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(f.create("app-offline"))}}const s={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(e,t){try{const s=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:s}){const n=k(e),r=b(e),a=t.getImmediate({optional:!0});if(a){const e=await a.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const o={fid:s,authVersion:m,appId:e.appId,sdkVersion:d},i={method:"POST",headers:r,body:JSON.stringify(o)},c=await _(()=>fetch(n,i));if(c.ok){const e=await c.json();return{fid:e.fid||s,registrationStatus:2,refreshToken:e.refreshToken,authToken:w(e.authToken)}}throw await y("Create Installation",c)}(e,t);return L(e.appConfig,s)}catch(s){throw g(s)&&409===s.customData.serverCode?await H(e.appConfig):await L(e.appConfig,{fid:t.fid,registrationStatus:0}),s}}(e,s);return{installationEntry:s,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:q(e)}:{installationEntry:t}}(e,n);return t=r.registrationPromise,r.installationEntry});return s.fid===S?{installationEntry:await t}:{installationEntry:s,registrationPromise:t}}async function q(e){let t=await $(e.appConfig);for(;1===t.registrationStatus;)await x(100),t=await $(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:s}=await G(e);return s||t}return t}function $(e){return U(e,e=>{if(!e)throw f.create("installation-not-found");return W(e)})}function W(e){return 1===(t=e).registrationStatus&&t.registrationTime+l<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */}async function z({appConfig:e,heartbeatServiceProvider:t},s){const n=function(e,{fid:t}){return`${k(e)}/${t}/authTokens:generate`}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e,s),r=v(e,s),a=t.getImmediate({optional:!0});if(a){const e=await a.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const o={installation:{sdkVersion:d,appId:e.appId}},i={method:"POST",headers:r,body:JSON.stringify(o)},c=await _(()=>fetch(n,i));if(c.ok){return w(await c.json())}throw await y("Generate Auth Token",c)}async function V(e,t=!1){let s;const n=await U(e.appConfig,n=>{if(!J(n))throw f.create("not-registered");const r=n.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+p}(e)}(r))return n;if(1===r.requestStatus)return s=async function(e,t){let s=await K(e.appConfig);for(;1===s.authToken.requestStatus;)await x(100),s=await K(e.appConfig);const n=s.authToken;return 0===n.requestStatus?V(e,t):n}(e,t),n;{if(!navigator.onLine)throw f.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(n);return s=async function(e,t){try{const s=await z(e,t),n=Object.assign(Object.assign({},t),{authToken:s});return await L(e.appConfig,n),s}catch(s){if(!g(s)||401!==s.customData.serverCode&&404!==s.customData.serverCode){const s=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await L(e.appConfig,s)}else await H(e.appConfig);throw s}}(e,t),t}});return s?await s:n.authToken}function K(e){return U(e,e=>{if(!J(e))throw f.create("not-registered");const t=e.authToken;return 1===(s=t).requestStatus&&s.requestTime+l<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var s;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */})}function J(e){return e!==undefined&&2===e.registrationStatus}async function Y(e){const t=e,{installationEntry:s,registrationPromise:n}=await G(t);return n?n.catch(console.error):V(t).catch(console.error),s.fid}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function X(e,t=!1){const s=e;await async function(e){const{registrationPromise:t}=await G(e);t&&await t}(s);return(await V(s,t)).token}function Q(e){return f.create("missing-app-config-values",{valueName:e})}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Z="installations",ee=e=>{const t=e.getProvider("app").getImmediate(),s=function(e){if(!e||!e.options)throw Q("App Configuration");if(!e.name)throw Q("App Name");const t=["projectId","apiKey","appId"];for(const s of t)if(!e.options[s])throw Q(s);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:s,heartbeatServiceProvider:(0,n._getProvider)(t,"heartbeat"),_delete:()=>Promise.resolve()}},te=e=>{const t=e.getProvider("app").getImmediate(),s=(0,n._getProvider)(t,Z).getImmediate();return{getId:()=>Y(s),getToken:e=>X(s,e)}};(0,n._registerComponent)(new r.Component(Z,ee,"PUBLIC")),(0,n._registerComponent)(new r.Component("installations-internal",te,"PRIVATE")),(0,n.registerVersion)(i,c),(0,n.registerVersion)(i,c,"esm2017")}}},{package:"@metamask/notification-services-controller>firebase>@firebase/installations",file:"node_modules/@firebase/installations/dist/esm/index.esm2017.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/logger/dist/index.cjs.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0});
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const n=[];var r;s.LogLevel=void 0,(r=s.LogLevel||(s.LogLevel={}))[r.DEBUG=0]="DEBUG",r[r.VERBOSE=1]="VERBOSE",r[r.INFO=2]="INFO",r[r.WARN=3]="WARN",r[r.ERROR=4]="ERROR",r[r.SILENT=5]="SILENT";const a={debug:s.LogLevel.DEBUG,verbose:s.LogLevel.VERBOSE,info:s.LogLevel.INFO,warn:s.LogLevel.WARN,error:s.LogLevel.ERROR,silent:s.LogLevel.SILENT},o=s.LogLevel.INFO,i={[s.LogLevel.DEBUG]:"log",[s.LogLevel.VERBOSE]:"log",[s.LogLevel.INFO]:"info",[s.LogLevel.WARN]:"warn",[s.LogLevel.ERROR]:"error"},c=(e,t,...s)=>{if(t<e.logLevel)return;const n=(new Date).toISOString(),r=i[t];if(!r)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[r](`[${n}]  ${e.name}:`,...s)};s.Logger=class{constructor(e){this.name=e,this._logLevel=o,this._logHandler=c,this._userLogHandler=null,n.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in s.LogLevel))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?a[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,s.LogLevel.DEBUG,...e),this._logHandler(this,s.LogLevel.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,s.LogLevel.VERBOSE,...e),this._logHandler(this,s.LogLevel.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,s.LogLevel.INFO,...e),this._logHandler(this,s.LogLevel.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,s.LogLevel.WARN,...e),this._logHandler(this,s.LogLevel.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,s.LogLevel.ERROR,...e),this._logHandler(this,s.LogLevel.ERROR,...e)}},s.setLogLevel=function(e){n.forEach(t=>{t.setLogLevel(e)})},s.setUserLogHandler=function(e,t){for(const r of n){let n=null;t&&t.level&&(n=a[t.level]),r.userLogHandler=null===e?null:(t,r,...a)=>{const o=a.map(e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(e=>e).join(" ");r>=(null!=n?n:t.logLevel)&&e({level:s.LogLevel[r].toLowerCase(),message:o,args:a,type:t.name})}}}}}},{package:"@metamask/notification-services-controller>firebase>@firebase/app>@firebase/logger",file:"node_modules/@firebase/logger/dist/index.cjs.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/messaging/dist/esm/index.esm2017.js",{"@firebase/app":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/app/dist/esm/index.esm2017.js","@firebase/component":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/component/dist/esm/index.esm2017.js","@firebase/installations":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/installations/dist/esm/index.esm2017.js","@firebase/util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/util/dist/index.esm2017.js",idb:"/home/runner/work/metamask-extension/metamask-extension/node_modules/idb/build/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.deleteToken=function(e){
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return async function(e){if(!navigator)throw A.create("only-available-in-window");e.swRegistration||await H(e);return async function(e){const t=await S(e.firebaseDependencies);t&&(await I(e.firebaseDependencies,t.token),await async function(e){const t=j(e),s=(await E()).transaction(_,"readwrite");await s.objectStore(_).delete(t),await s.done}(e.firebaseDependencies));const s=await e.swRegistration.pushManager.getSubscription();if(s)return s.unsubscribe();return!0}(e)}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e=(0,a.getModularInstance)(e))},s.getMessaging=
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e=(0,o.getApp)()){return K().then(e=>{if(!e)throw A.create("unsupported-browser")},e=>{throw A.create("indexed-db-unsupported")}),(0,o._getProvider)((0,a.getModularInstance)(e),"messaging").getImmediate()},s.getToken=async function(e,t){return U(e=(0,a.getModularInstance)(e),t)},s.isSupported=K,s.onMessage=function(e,t){return function(e,t){if(!navigator)throw A.create("only-available-in-window");return e.onMessageHandler=t,()=>{e.onMessageHandler=null}}(e=(0,a.getModularInstance)(e),t)},e("@firebase/installations");var n=e("@firebase/component"),r=e("idb"),a=e("@firebase/util"),o=e("@firebase/app");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const i="/firebase-messaging-sw.js",c="/firebase-cloud-messaging-push-scope",l="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",d="https://fcmregistrations.googleapis.com/v1",m="google.c.a.c_id",u=1e4;var p,h;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function f(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function g(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),s=atob(t),n=new Uint8Array(s.length);for(let e=0;e<s.length;++e)n[e]=s.charCodeAt(e);return n}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(p||(p={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(h||(h={}));const k="fcm_token_details_db",w=5,y="fcm_token_object_Store";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const b="firebase-messaging-database",v=1,_="firebase-messaging-store";let x=null;function E(){return x||(x=(0,r.openDB)(b,v,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(_)}})),x}async function S(e){const t=j(e),s=await E(),n=await s.transaction(_).objectStore(_).get(t);if(n)return n;{const t=await async function(e){if("databases"in indexedDB){const e=(await indexedDB.databases()).map(e=>e.name);if(!e.includes(k))return null}let t=null;return(await(0,r.openDB)(k,w,{upgrade:async(s,n,r,a)=>{var o;if(n<2)return;if(!s.objectStoreNames.contains(y))return;const i=a.objectStore(y),c=await i.index("fcmSenderId").get(e);if(await i.clear(),c)if(2===n){const e=c;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(o=e.createTime)&&void 0!==o?o:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:f(e.vapidKey)}}}else if(3===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:f(e.auth),p256dh:f(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:f(e.vapidKey)}}}else if(4===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:f(e.auth),p256dh:f(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:f(e.vapidKey)}}}}})).close(),await(0,r.deleteDB)(k),await(0,r.deleteDB)("fcm_vapid_details_db"),await(0,r.deleteDB)("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await T(e,t),t}}async function T(e,t){const s=j(e),n=(await E()).transaction(_,"readwrite");return await n.objectStore(_).put(t,s),await n.done,t}function j({appConfig:e}){return e.appId}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const C={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},A=new a.ErrorFactory("messaging","Messaging",C);async function I(e,t){const s={method:"DELETE",headers:await O(e)};try{const n=await fetch(`${P(e.appConfig)}/${t}`,s),r=await n.json();if(r.error){const e=r.error.message;throw A.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw A.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}function P({projectId:e}){return`${d}/projects/${e}/registrations`}async function O({appConfig:e,installations:t}){const s=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${s}`})}function D({p256dh:e,auth:t,endpoint:s,vapidKey:n}){const r={web:{endpoint:s,auth:t,p256dh:e}};return n!==l&&(r.web.applicationPubKey=n),r}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const M=6048e5;async function B(e){const t=await async function(e,t){const s=await e.pushManager.getSubscription();if(s)return s;return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:g(t)})}(e.swRegistration,e.vapidKey),s={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:f(t.getKey("auth")),p256dh:f(t.getKey("p256dh"))},n=await S(e.firebaseDependencies);if(n){if(function(e,t){const s=t.vapidKey===e.vapidKey,n=t.endpoint===e.endpoint,r=t.auth===e.auth,a=t.p256dh===e.p256dh;return s&&n&&r&&a}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(n.subscriptionOptions,s))return Date.now()>=n.createTime+M?async function(e,t){try{const s=await async function(e,t){const s=await O(e),n=D(t.subscriptionOptions),r={method:"PATCH",headers:s,body:JSON.stringify(n)};let a;try{const s=await fetch(`${P(e.appConfig)}/${t.token}`,r);a=await s.json()}catch(e){throw A.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw A.create("token-update-failed",{errorInfo:e})}if(!a.token)throw A.create("token-update-no-token");return a.token}(e.firebaseDependencies,t),n=Object.assign(Object.assign({},t),{token:s,createTime:Date.now()});return await T(e.firebaseDependencies,n),s}catch(e){throw e}}(e,{token:n.token,createTime:Date.now(),subscriptionOptions:s}):n.token;try{await I(e.firebaseDependencies,n.token)}catch(e){console.warn(e)}return R(e.firebaseDependencies,s)}return R(e.firebaseDependencies,s)}async function R(e,t){const s=
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */await async function(e,t){const s=await O(e),n=D(t),r={method:"POST",headers:s,body:JSON.stringify(n)};let a;try{const t=await fetch(P(e.appConfig),r);a=await t.json()}catch(e){throw A.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw A.create("token-subscribe-failed",{errorInfo:e})}if(!a.token)throw A.create("token-subscribe-no-token");return a.token}(e,t),n={token:s,createTime:Date.now(),subscriptionOptions:t};return await T(e,n),n.token}function N(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const s=t.notification.title;s&&(e.notification.title=s);const n=t.notification.body;n&&(e.notification.body=n);const r=t.notification.image;r&&(e.notification.image=r);const a=t.notification.icon;a&&(e.notification.icon=a)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){var s,n,r,a,o;if(!t.fcmOptions&&!(null===(s=t.notification)||void 0===s?void 0:s.click_action))return;e.fcmOptions={};const i=null!==(r=null===(n=t.fcmOptions)||void 0===n?void 0:n.link)&&void 0!==r?r:null===(a=t.notification)||void 0===a?void 0:a.click_action;i&&(e.fcmOptions.link=i);const c=null===(o=t.fcmOptions)||void 0===o?void 0:o.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t,e),t}function F(e){return A.create("missing-app-config-values",{valueName:e})}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
!function(e,t){const s=[];for(let n=0;n<e.length;n++)s.push(e.charAt(n)),n<t.length&&s.push(t.charAt(n));s.join("")}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class L{constructor(e,t,s){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const n=function(e){if(!e||!e.options)throw F("App Configuration Object");if(!e.name)throw F("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:s}=e;for(const e of t)if(!s[e])throw F(e);return{appName:e.name,projectId:s.projectId,apiKey:s.apiKey,appId:s.appId,senderId:s.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:n,installations:t,analyticsProvider:s}}_delete(){return Promise.resolve()}}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function H(e){try{e.swRegistration=await navigator.serviceWorker.register(i,{scope:c}),e.swRegistration.update().catch(()=>{}),await async function(e){return new Promise((t,s)=>{const n=setTimeout(()=>s(new Error(`Service worker not registered after ${u} ms`)),u),r=e.installing||e.waiting;e.active?(clearTimeout(n),t()):r?r.onstatechange=e=>{var s;"activated"===(null===(s=e.target)||void 0===s?void 0:s.state)&&(r.onstatechange=null,clearTimeout(n),t())}:(clearTimeout(n),s(new Error("No incoming service worker found.")))})}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e.swRegistration)}catch(e){throw A.create("failed-service-worker-registration",{browserErrorMessage:null==e?void 0:e.message})}}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function U(e,t){if(!navigator)throw A.create("only-available-in-window");if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw A.create("permission-blocked");
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return await async function(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=l)}(e,null==t?void 0:t.vapidKey),await async function(e,t){if(t||e.swRegistration||await H(e),t||!e.swRegistration){if(!(t instanceof ServiceWorkerRegistration))throw A.create("invalid-sw-registration");e.swRegistration=t}}(e,null==t?void 0:t.serviceWorkerRegistration),B(e)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function G(e,t,s){const n=function(e){switch(e){case h.NOTIFICATION_CLICKED:return"notification_open";case h.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(n,{message_id:s[m],message_name:s["google.c.a.c_l"],message_time:s["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)})}async function q(e,t){const s=t.data;if(!s.isFirebaseMessaging)return;e.onMessageHandler&&s.messageType===h.PUSH_RECEIVED&&("function"==typeof e.onMessageHandler?e.onMessageHandler(N(s)):e.onMessageHandler.next(N(s)));const n=s.data;var r;"object"==typeof(r=n)&&r&&m in r&&"1"===n["google.c.a.e"]&&await G(e,s.messageType,n)}const $="@firebase/messaging",W="0.12.16",z=e=>{const t=new L(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",e=>q(t,e)),t},V=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:e=>U(t,e)}};
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function K(){try{await(0,a.validateIndexedDBOpenable)()}catch(e){return!1}return"undefined"!=typeof window&&(0,a.isIndexedDBAvailable)()&&(0,a.areCookiesEnabled)()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}(0,o._registerComponent)(new n.Component("messaging",z,"PUBLIC")),(0,o._registerComponent)(new n.Component("messaging-internal",V,"PRIVATE")),(0,o.registerVersion)($,W),(0,o.registerVersion)($,W,"esm2017")}}},{package:"@metamask/notification-services-controller>firebase>@firebase/messaging",file:"node_modules/@firebase/messaging/dist/esm/index.esm2017.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/messaging/dist/index.sw.cjs",{"@firebase/app":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/app/dist/esm/index.esm2017.js","@firebase/component":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/component/dist/esm/index.esm2017.js","@firebase/installations":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/installations/dist/esm/index.esm2017.js","@firebase/util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/util/dist/index.esm2017.js",idb:"/home/runner/work/metamask-extension/metamask-extension/node_modules/idb/build/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),e("@firebase/installations");var n=e("@firebase/component"),r=e("idb"),a=e("@firebase/util"),o=e("@firebase/app");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const i="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",c="FCM_MSG";var l,d;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function m(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),s=atob(t),n=new Uint8Array(s.length);for(let e=0;e<s.length;++e)n[e]=s.charCodeAt(e);return n}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(l||(l={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(d||(d={}));const p="fcm_token_details_db",h="fcm_token_object_Store";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const f="firebase-messaging-store";let g=null;function k(){return g||(g=r.openDB("firebase-messaging-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(f)}})),g}async function w(e){const t=b(e),s=await k(),n=await s.transaction(f).objectStore(f).get(t);if(n)return n;{const t=await async function(e){if("databases"in indexedDB){const e=(await indexedDB.databases()).map(e=>e.name);if(!e.includes(p))return null}let t=null;return(await r.openDB(p,5,{upgrade:async(s,n,r,a)=>{var o;if(n<2)return;if(!s.objectStoreNames.contains(h))return;const i=a.objectStore(h),c=await i.index("fcmSenderId").get(e);if(await i.clear(),c)if(2===n){const e=c;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(o=e.createTime)&&void 0!==o?o:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:m(e.vapidKey)}}}else if(3===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:m(e.auth),p256dh:m(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:m(e.vapidKey)}}}else if(4===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:m(e.auth),p256dh:m(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:m(e.vapidKey)}}}}})).close(),await r.deleteDB(p),await r.deleteDB("fcm_vapid_details_db"),await r.deleteDB("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await y(e,t),t}}async function y(e,t){const s=b(e),n=(await k()).transaction(f,"readwrite");return await n.objectStore(f).put(t,s),await n.done,t}function b({appConfig:e}){return e.appId}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const v={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},_=new a.ErrorFactory("messaging","Messaging",v);async function x(e,t){const s={method:"DELETE",headers:await S(e)};try{const n=await fetch(`${E(e.appConfig)}/${t}`,s),r=await n.json();if(r.error){const e=r.error.message;throw _.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw _.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}function E({projectId:e}){return`https://fcmregistrations.googleapis.com/v1/projects/${e}/registrations`}async function S({appConfig:e,installations:t}){const s=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${s}`})}function T({p256dh:e,auth:t,endpoint:s,vapidKey:n}){const r={web:{endpoint:s,auth:t,p256dh:e}};return n!==i&&(r.web.applicationPubKey=n),r}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function j(e){const t=await async function(e,t){const s=await e.pushManager.getSubscription();if(s)return s;return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:u(t)})}(e.swRegistration,e.vapidKey),s={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:m(t.getKey("auth")),p256dh:m(t.getKey("p256dh"))},n=await w(e.firebaseDependencies);if(n){if(function(e,t){const s=t.vapidKey===e.vapidKey,n=t.endpoint===e.endpoint,r=t.auth===e.auth,a=t.p256dh===e.p256dh;return s&&n&&r&&a}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(n.subscriptionOptions,s))return Date.now()>=n.createTime+6048e5?async function(e,t){try{const s=await async function(e,t){const s=await S(e),n=T(t.subscriptionOptions),r={method:"PATCH",headers:s,body:JSON.stringify(n)};let a;try{const s=await fetch(`${E(e.appConfig)}/${t.token}`,r);a=await s.json()}catch(e){throw _.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw _.create("token-update-failed",{errorInfo:e})}if(!a.token)throw _.create("token-update-no-token");return a.token}(e.firebaseDependencies,t),n=Object.assign(Object.assign({},t),{token:s,createTime:Date.now()});return await y(e.firebaseDependencies,n),s}catch(e){throw e}}(e,{token:n.token,createTime:Date.now(),subscriptionOptions:s}):n.token;try{await x(e.firebaseDependencies,n.token)}catch(e){console.warn(e)}return A(e.firebaseDependencies,s)}return A(e.firebaseDependencies,s)}async function C(e){const t=await w(e.firebaseDependencies);t&&(await x(e.firebaseDependencies,t.token),await async function(e){const t=b(e),s=(await k()).transaction(f,"readwrite");await s.objectStore(f).delete(t),await s.done}(e.firebaseDependencies));const s=await e.swRegistration.pushManager.getSubscription();return!s||s.unsubscribe()}async function A(e,t){const s=
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */await async function(e,t){const s=await S(e),n=T(t),r={method:"POST",headers:s,body:JSON.stringify(n)};let a;try{const t=await fetch(E(e.appConfig),r);a=await t.json()}catch(e){throw _.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw _.create("token-subscribe-failed",{errorInfo:e})}if(!a.token)throw _.create("token-subscribe-no-token");return a.token}(e,t),n={token:s,createTime:Date.now(),subscriptionOptions:t};return await y(e,n),n.token}async function I(e,t){const s=function(e,t){var s,n;const r={};e.from&&(r.project_number=e.from);e.fcmMessageId&&(r.message_id=e.fcmMessageId);r.instance_id=t,e.notification?r.message_type=l.DISPLAY_NOTIFICATION.toString():r.message_type=l.DATA_MESSAGE.toString();r.sdk_platform=3..toString(),r.package_name=self.origin.replace(/(^\w+:|^)\/\//,""),!e.collapse_key||(r.collapse_key=e.collapse_key);r.event=1..toString(),!(null===(s=e.fcmOptions)||void 0===s?void 0:s.analytics_label)||(r.analytics_label=null===(n=e.fcmOptions)||void 0===n?void 0:n.analytics_label);return r}(t,await e.firebaseDependencies.installations.getId());!function(e,t,s){const n={};n.event_time_ms=Math.floor(Date.now()).toString(),n.source_extension_json_proto3=JSON.stringify({messaging_client_event:t}),!s||(n.compliance_data=function(e){const t={privacy_context:{prequest:{origin_associated_product_id:e}}};return t}(s));e.logEvents.push(n)}(e,s,t.productId)}async function P(e,t){const s=function({data:e}){if(!e)return null;try{return e.json()}catch(e){return null}}(e);if(!s)return;t.deliveryMetricsExportedToBigQueryEnabled&&await I(t,s);const n=await D();if(function(e){return e.some(e=>"visible"===e.visibilityState&&!e.url.startsWith("chrome-extension://"))}(n))return function(e,t){t.isFirebaseMessaging=!0,t.messageType=d.PUSH_RECEIVED;for(const s of e)s.postMessage(t)}(n,s);if(s.notification&&await function(e){var t;const{actions:s}=e,{maxActions:n}=Notification;s&&n&&s.length>n&&console.warn(`This browser only supports ${n} actions. The remaining actions will not be displayed.`);return self.registration.showNotification(null!==(t=e.title)&&void 0!==t?t:"",e)}(function(e){const t=Object.assign({},e.notification);return t.data={[c]:e},t}(s)),t&&t.onBackgroundMessageHandler){const e=function(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const s=t.notification.title;s&&(e.notification.title=s);const n=t.notification.body;n&&(e.notification.body=n);const r=t.notification.image;r&&(e.notification.image=r);const a=t.notification.icon;a&&(e.notification.icon=a)}(t,e),function(e,t){t.data&&(e.data=t.data)}(t,e),function(e,t){var s,n,r,a,o;if(!t.fcmOptions&&!(null===(s=t.notification)||void 0===s?void 0:s.click_action))return;e.fcmOptions={};const i=null!==(r=null===(n=t.fcmOptions)||void 0===n?void 0:n.link)&&void 0!==r?r:null===(a=t.notification)||void 0===a?void 0:a.click_action;i&&(e.fcmOptions.link=i);const c=null===(o=t.fcmOptions)||void 0===o?void 0:o.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t,e),t}(s);"function"==typeof t.onBackgroundMessageHandler?await t.onBackgroundMessageHandler(e):t.onBackgroundMessageHandler.next(e)}}async function O(e){var t,s;const n=null===(s=null===(t=e.notification)||void 0===t?void 0:t.data)||void 0===s?void 0:s[c];if(!n)return;if(e.action)return;e.stopImmediatePropagation(),e.notification.close();const r=function(e){var t,s,n;const r=null!==(s=null===(t=e.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==s?s:null===(n=e.notification)||void 0===n?void 0:n.click_action;if(r)return r;return a=e.data,"object"==typeof a&&a&&"google.c.a.c_id"in a?self.location.origin:null;var a;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(n);if(!r)return;const a=new URL(r,self.location.href),o=new URL(self.location.origin);if(a.host!==o.host)return;let i=await async function(e){const t=await D();for(const s of t){const t=new URL(s.url,self.location.href);if(e.host===t.host)return s}return null}(a);var l;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */return i?i=await i.focus():(i=await self.clients.openWindow(r),await(l=3e3,new Promise(e=>{setTimeout(e,l)}))),i?(n.messageType=d.NOTIFICATION_CLICKED,n.isFirebaseMessaging=!0,i.postMessage(n)):void 0}function D(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function M(e){return _.create("missing-app-config-values",{valueName:e})}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e,t){const s=[];for(let n=0;n<e.length;n++)s.push(e.charAt(n)),n<t.length&&s.push(t.charAt(n));s.join("")}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class B{constructor(e,t,s){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const n=function(e){if(!e||!e.options)throw M("App Configuration Object");if(!e.name)throw M("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:s}=e;for(const e of t)if(!s[e])throw M(e);return{appName:e.name,projectId:s.projectId,apiKey:s.apiKey,appId:s.appId,senderId:s.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:n,installations:t,analyticsProvider:s}}_delete(){return Promise.resolve()}}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const R=e=>{const t=new B(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return self.addEventListener("push",e=>{e.waitUntil(P(e,t))}),self.addEventListener("pushsubscriptionchange",e=>{e.waitUntil(async function(e,t){var s,n;const{newSubscription:r}=e;if(!r)return void await C(t);const a=await w(t.firebaseDependencies);await C(t),t.vapidKey=null!==(n=null===(s=null==a?void 0:a.subscriptionOptions)||void 0===s?void 0:s.vapidKey)&&void 0!==n?n:i,await j(t)}(e,t))}),self.addEventListener("notificationclick",e=>{e.waitUntil(O(e))}),t};
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function N(){return a.isIndexedDBAvailable()&&await a.validateIndexedDBOpenable()&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */o._registerComponent(new n.Component("messaging-sw",R,"PUBLIC")),s.experimentalSetDeliveryMetricsExportedToBigQueryEnabled=function(e,t){
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return function(e,t){e.deliveryMetricsExportedToBigQueryEnabled=t}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e=a.getModularInstance(e),t)}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.getMessaging=function(e=o.getApp()){return N().then(e=>{if(!e)throw _.create("unsupported-browser")},e=>{throw _.create("indexed-db-unsupported")}),o._getProvider(a.getModularInstance(e),"messaging-sw").getImmediate()},s.isSupported=N,s.onBackgroundMessage=function(e,t){return function(e,t){if(self.document!==undefined)throw _.create("only-available-in-sw");return e.onBackgroundMessageHandler=t,()=>{e.onBackgroundMessageHandler=null}}(e=a.getModularInstance(e),t)}}}},{package:"@metamask/notification-services-controller>firebase>@firebase/messaging",file:"node_modules/@firebase/messaging/dist/index.sw.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@firebase/util/dist/index.esm2017.js",{_process:"/home/runner/work/metamask-extension/metamask-extension/node_modules/process/browser.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){(function(e){(function(){Object.defineProperty(s,"__esModule",{value:!0}),s.Sha1=s.RANDOM_FACTOR=s.MAX_VALUE_MILLIS=s.FirebaseError=s.ErrorFactory=s.Deferred=s.DecodeBase64StringError=s.CONSTANTS=void 0,s.areCookiesEnabled=function(){if("undefined"==typeof navigator||!navigator.cookieEnabled)return!1;return!0}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.assertionError=s.assert=void 0,s.async=function(e,t){return(...s)=>{Promise.resolve(!0).then(()=>{e(...s)}).catch(e=>{t&&t(e)})}},s.base64urlEncodeWithoutPadding=s.base64Encode=s.base64Decode=s.base64=void 0,s.calculateBackoffMillis=function(e,t=A,s=I){const n=t*Math.pow(s,e),r=Math.round(O*n*(Math.random()-.5)*2);return Math.min(P,n+r)}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.createMockUserToken=function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const s=t||"demo-project",n=e.iat||0,r=e.sub||e.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a=Object.assign({iss:`https://securetoken.google.com/${s}`,aud:s,iat:n,exp:n+3600,auth_time:n,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},e);return[l(JSON.stringify({alg:"none",type:"JWT"})),l(JSON.stringify(a)),""].join(".")}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.createSubscribe=function(e,t){const s=new T(e,t);return s.subscribe.bind(s)},s.decode=void 0,s.deepCopy=function(e){return m(undefined,e)},s.deepEqual=function e(t,s){if(t===s)return!0;const n=Object.keys(t),r=Object.keys(s);for(const a of n){if(!r.includes(a))return!1;const n=t[a],o=s[a];if(S(n)&&S(o)){if(!e(n,o))return!1}else if(n!==o)return!1}for(const e of r)if(!n.includes(e))return!1;return!0},s.deepExtend=m,s.errorPrefix=C,s.extractQuerystring=function(e){const t=e.indexOf("?");if(!t)return"";const s=e.indexOf("#",t);return e.substring(t,s>0?s:undefined)}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.getExperimentalSetting=s.getDefaults=s.getDefaultEmulatorHostnameAndPort=s.getDefaultEmulatorHost=s.getDefaultAppConfig=void 0,s.getGlobal=p,s.getModularInstance=
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e){return e&&e._delegate?e._delegate:e},s.getUA=k,s.isAdmin=void 0,s.isBrowser=function(){return"undefined"!=typeof window||y()},s.isBrowserExtension=function(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:undefined;return"object"==typeof e&&e.id!==undefined},s.isCloudflareWorker=function(){return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent},s.isElectron=function(){return k().indexOf("Electron/")>=0},s.isEmpty=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},s.isIE=function(){const e=k();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},s.isIndexedDBAvailable=function(){try{return"object"==typeof indexedDB}catch(e){return!1}},s.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(k())},s.isNode=w,s.isNodeSdk=function(){return!0===t.NODE_CLIENT||!0===t.NODE_ADMIN},s.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},s.isSafari=function(){return!w()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},s.isUWP=function(){return k().indexOf("MSAppHost/")>=0},s.isValidTimestamp=s.isValidFormat=void 0,s.isWebWorker=y,s.issuedAtTime=void 0,s.jsonEval=x,s.map=function(e,t,s){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=t.call(s,e[r],r,e));return n},s.ordinal=function(e){if(!Number.isFinite(e))return`${e}`;return e+function(e){e=Math.abs(e);const t=e%100;if(t>=10&&t<=20)return"th";const s=e%10;if(1===s)return"st";if(2===s)return"nd";if(3===s)return"rd";return"th"}(e)},s.promiseWithTimeout=
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e,t=2e3){const s=new g;return setTimeout(()=>s.reject("timeout!"),t),e.then(s.resolve,s.reject),s.promise}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.querystring=function(e){const t=[];for(const[s,n]of Object.entries(e))Array.isArray(n)?n.forEach(e=>{t.push(encodeURIComponent(s)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(s)+"="+encodeURIComponent(n));return t.length?"&"+t.join("&"):""},s.querystringDecode=function(e){const t={},s=e.replace(/^\?/,"").split("&");return s.forEach(e=>{if(e){const[s,n]=e.split("=");t[decodeURIComponent(s)]=decodeURIComponent(n)}}),t},s.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:undefined},s.stringToByteArray=s.stringLength=void 0,s.stringify=function(e){return JSON.stringify(e)}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.validateArgCount=void 0,s.validateCallback=function(e,t,s,n){if(n&&!s)return;if("function"!=typeof s)throw new Error(C(e,t)+"must be a valid function.")},s.validateContextObject=function(e,t,s,n){if(n&&!s)return;if("object"!=typeof s||null===s)throw new Error(C(e,t)+"must be a valid context object.")}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,s.validateIndexedDBOpenable=function(){return new Promise((e,t)=>{try{let s=!0;const n="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(n);r.onsuccess=()=>{r.result.close(),s||self.indexedDB.deleteDatabase(n),e(!0)},r.onupgradeneeded=()=>{s=!1},r.onerror=()=>{var e;t((null===(e=r.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})},s.validateNamespace=function(e,t,s){if(s&&!t)return;if("string"!=typeof t)throw new Error(C(e,"namespace")+"must be a valid firebase namespace.")};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const t=s.CONSTANTS={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},n=function(e,t){if(!e)throw r(t)};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */s.assert=n;const r=function(e){return new Error("Firebase Database ("+t.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */s.assertionError=r;const a=function(e){const t=[];let s=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t[s++]=r:r<2048?(t[s++]=r>>6|192,t[s++]=63&r|128):55296==(64512&r)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n)),t[s++]=r>>18|240,t[s++]=r>>12&63|128,t[s++]=r>>6&63|128,t[s++]=63&r|128):(t[s++]=r>>12|224,t[s++]=r>>6&63|128,t[s++]=63&r|128)}return t},o=s.base64={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const s=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let t=0;t<e.length;t+=3){const r=e[t],a=t+1<e.length,o=a?e[t+1]:0,i=t+2<e.length,c=i?e[t+2]:0,l=r>>2,d=(3&r)<<4|o>>4;let m=(15&o)<<2|c>>6,u=63&c;i||(u=64,a||(m=64)),n.push(s[l],s[d],s[m],s[u])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(a(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let s=0,n=0;for(;s<e.length;){const r=e[s++];if(r<128)t[n++]=String.fromCharCode(r);else if(r>191&&r<224){const a=e[s++];t[n++]=String.fromCharCode((31&r)<<6|63&a)}else if(r>239&&r<365){const a=((7&r)<<18|(63&e[s++])<<12|(63&e[s++])<<6|63&e[s++])-65536;t[n++]=String.fromCharCode(55296+(a>>10)),t[n++]=String.fromCharCode(56320+(1023&a))}else{const a=e[s++],o=e[s++];t[n++]=String.fromCharCode((15&r)<<12|(63&a)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const s=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let t=0;t<e.length;){const r=s[e.charAt(t++)],a=t<e.length?s[e.charAt(t)]:0;++t;const o=t<e.length?s[e.charAt(t)]:64;++t;const c=t<e.length?s[e.charAt(t)]:64;if(++t,null==r||null==a||null==o||null==c)throw new i;const l=r<<2|a>>4;if(n.push(l),64!==o){const e=a<<4&240|o>>2;if(n.push(e),64!==c){const e=o<<6&192|c;n.push(e)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class i extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}s.DecodeBase64StringError=i;const c=function(e){const t=a(e);return o.encodeByteArray(t,!0)};s.base64Encode=c;const l=function(e){return c(e).replace(/\./g,"")};s.base64urlEncodeWithoutPadding=l;const d=function(e){try{return o.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function m(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:e===undefined&&(e={});break;case Array:e=[];break;default:return t}for(const s in t)t.hasOwnProperty(s)&&u(s)&&(e[s]=m(e[s],t[s]));return e}function u(e){return"__proto__"!==e}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function p(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */s.base64Decode=d;const h=()=>{try{return p().__FIREBASE_DEFAULTS__||(()=>{if(void 0===e||void 0===e.env)return})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&d(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}};s.getDefaults=h;const f=e=>{var t,s;return null===(s=null===(t=h())||void 0===t?void 0:t.emulatorHosts)||void 0===s?void 0:s[e]};s.getDefaultEmulatorHost=f;s.getDefaultEmulatorHostnameAndPort=e=>{const t=f(e);if(!t)return undefined;const s=t.lastIndexOf(":");if(s<=0||s+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const n=parseInt(t.substring(s+1),10);return"["===t[0]?[t.substring(1,s-1),n]:[t.substring(0,s),n]};s.getDefaultAppConfig=()=>{var e;return null===(e=h())||void 0===e?void 0:e.config};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
s.getExperimentalSetting=e=>{var t;return null===(t=h())||void 0===t?void 0:t[`_${e}`]};class g{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,s)=>{t?this.reject(t):this.resolve(s),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,s))}}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function k(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function w(){var e;const t=null===(e=h())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}}function y(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}s.Deferred=g;class b extends Error{constructor(e,t,s){super(t),this.code=e,this.customData=s,this.name="FirebaseError",Object.setPrototypeOf(this,b.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,v.prototype.create)}}s.FirebaseError=b;class v{constructor(e,t,s){this.service=e,this.serviceName=t,this.errors=s}create(e,...t){const s=t[0]||{},n=`${this.service}/${e}`,r=this.errors[e],a=r?function(e,t){return e.replace(_,(e,s)=>{const n=t[s];return null!=n?String(n):`<${s}?>`})}(r,s):"Error",o=`${this.serviceName}: ${a} (${n}).`;return new b(n,o,s)}}s.ErrorFactory=v;const _=/\{\$([^}]+)}/g;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function x(e){return JSON.parse(e)}const E=function(e){let t={},s={},n={},r="";try{const a=e.split(".");t=x(d(a[0])||""),s=x(d(a[1])||""),r=a[2],n=s.d||{},delete s.d}catch(e){}return{header:t,claims:s,data:n,signature:r}};s.decode=E;s.isValidTimestamp=function(e){const t=E(e).claims,s=Math.floor((new Date).getTime()/1e3);let n=0,r=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?n=t.nbf:t.hasOwnProperty("iat")&&(n=t.iat),r=t.hasOwnProperty("exp")?t.exp:n+86400),!!s&&!!n&&!!r&&s>=n&&s<=r};s.issuedAtTime=function(e){const t=E(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null};s.isValidFormat=function(e){const t=E(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")};function S(e){return null!==e&&"object"==typeof e}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
s.isAdmin=function(e){const t=E(e).claims;return"object"==typeof t&&!0===t.admin};s.Sha1=class{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const s=this.W_;if("string"==typeof e)for(let n=0;n<16;n++)s[n]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let n=0;n<16;n++)s[n]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){const t=s[e-3]^s[e-8]^s[e-14]^s[e-16];s[e]=4294967295&(t<<1|t>>>31)}let n,r,a=this.chain_[0],o=this.chain_[1],i=this.chain_[2],c=this.chain_[3],l=this.chain_[4];for(let e=0;e<80;e++){e<40?e<20?(n=c^o&(i^c),r=1518500249):(n=o^i^c,r=1859775393):e<60?(n=o&i|c&(o|i),r=2400959708):(n=o^i^c,r=3395469782);const t=(a<<5|a>>>27)+n+l+r+s[e]&4294967295;l=c,c=i,i=4294967295&(o<<30|o>>>2),o=a,a=t}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+o&4294967295,this.chain_[2]=this.chain_[2]+i&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295}update(e,t){if(null==e)return;t===undefined&&(t=e.length);const s=t-this.blockSize;let n=0;const r=this.buf_;let a=this.inbuf_;for(;n<t;){if(0===a)for(;n<=s;)this.compress_(e,n),n+=this.blockSize;if("string"==typeof e){for(;n<t;)if(r[a]=e.charCodeAt(n),++a,++n,a===this.blockSize){this.compress_(r),a=0;break}}else for(;n<t;)if(r[a]=e[n],++a,++n,a===this.blockSize){this.compress_(r),a=0;break}}this.inbuf_=a,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=255&t,t/=256;this.compress_(this.buf_);let s=0;for(let t=0;t<5;t++)for(let n=24;n>=0;n-=8)e[s]=this.chain_[t]>>n&255,++s;return e}};class T{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,s){let n;if(e===undefined&&t===undefined&&s===undefined)throw new Error("Missing Observer.");n=function(e,t){if("object"!=typeof e||null===e)return!1;for(const s of t)if(s in e&&"function"==typeof e[s])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:s},n.next===undefined&&(n.next=j),n.error===undefined&&(n.error=j),n.complete===undefined&&(n.complete=j);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?n.error(this.finalError):n.complete()}catch(e){}}),this.observers.push(n),r}unsubscribeOne(e){this.observers!==undefined&&this.observers[e]!==undefined&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&this.onNoObservers!==undefined&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==undefined&&this.observers[e]!==undefined)try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,e!==undefined&&(this.finalError=e),this.task.then(()=>{this.observers=undefined,this.onNoObservers=undefined}))}}function j(){}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function C(e,t){return`${e} failed: ${t} argument `}s.validateArgCount=function(e,t,s,n){let r;if(n<t?r="at least "+t:n>s&&(r=0===s?"none":"no more than "+s),r){throw new Error(e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+r+".")}};s.stringToByteArray=function(e){const t=[];let s=0;for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);if(a>=55296&&a<=56319){const t=a-55296;r++,n(r<e.length,"Surrogate pair missing trail surrogate.");a=65536+(t<<10)+(e.charCodeAt(r)-56320)}a<128?t[s++]=a:a<2048?(t[s++]=a>>6|192,t[s++]=63&a|128):a<65536?(t[s++]=a>>12|224,t[s++]=a>>6&63|128,t[s++]=63&a|128):(t[s++]=a>>18|240,t[s++]=a>>12&63|128,t[s++]=a>>6&63|128,t[s++]=63&a|128)}return t};
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
s.stringLength=function(e){let t=0;for(let s=0;s<e.length;s++){const n=e.charCodeAt(s);n<128?t++:n<2048?t+=2:n>=55296&&n<=56319?(t+=4,s++):t+=3}return t};const A=1e3,I=2,P=s.MAX_VALUE_MILLIS=144e5,O=s.RANDOM_FACTOR=.5}).call(this)}).call(this,e("_process"))}}},{package:"@metamask/notification-services-controller>firebase>@firebase/util",file:"node_modules/@firebase/util/dist/index.esm2017.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-spec/json-pointer/lib/index.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0});class n{static parse(e){if(""===e)return new n([]);if(!e.startsWith("/"))throw new r(e);const[,...t]=e.split("/");return new n(t.map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")))}constructor(e){this.tokens=e}toString(){if(0===this.tokens.length)return"";return`/${this.tokens.map(e=>e.replace(/~/g,"~0").replace(/\//g,"~1")).join("/")}`}shmeval(e){for(const t of this.tokens){if(!e.hasOwnProperty(t))throw new a(e,t);e=e[t]}return e}}s.default=n;class r extends Error{constructor(e){super(`Invalid JSON Pointer: ${e}`),this.ptr=e}}s.InvalidPtrError=r;class a extends Error{constructor(e,t){super(`Error evaluating JSON Pointer: no attribute ${t} on ${e}`),this.instance=e,this.token=t}}s.EvalError=a}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver>@json-schema-spec/json-pointer",file:"node_modules/@json-schema-spec/json-pointer/lib/index.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/dereferencer/build/dereferencer.js",{"@json-schema-tools/reference-resolver":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/index-web.js","@json-schema-tools/traverse":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/traverse/build/index.js","fast-safe-stringify":"/home/runner/work/metamask-extension/metamask-extension/node_modules/fast-safe-stringify/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var r in t=arguments[s])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,s,n){return new(s||(s=Promise))(function(r,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(o,i)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var s,n,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(c){return function(i){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)try{if(s=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(6===i[0]&&o.label<r[1]){o.label=r[1],r=i;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(i);break}r[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{s=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.NonStringRefError=void 0;var i=o(e("@json-schema-tools/traverse")),c=o(e("@json-schema-tools/reference-resolver")),l=o(e("fast-safe-stringify")),d=function(e){this.name="NonStringRefError",this.message=["NonStringRefError","Found an improperly formatted $ref in schema. $ref must be a string","schema in question: ".concat((0,l.default)(e))].join("\n")};s.NonStringRefError=d;var m=function(e,t){if(e.$ref!==undefined&&Object.keys(e).length>1&&!0!==t&&!1!==t){var s=n(n({},t),e);return delete s.$ref,s}return t},u=function(){function e(e,t){var s;if(void 0===t&&(t={}),this.options=t,this.refCache={},s=!0===this.options.mutate||!0===e||!1===e?e:n({},e),this.options.recursive===undefined&&(this.options.recursive=!0),this.options.rootSchema===undefined&&(this.options.rootSchema=s),!0!==e&&!1!==e&&e.$id&&(this.options.rootSchema=s),this.options.refCache&&(this.refCache=this.options.refCache),this.options.protocolHandlerMap)for(var r=0,a=Object.keys(this.options.protocolHandlerMap);r<a.length;r++){var o=a[r];c.default.protocolHandlerMap[o]=this.options.protocolHandlerMap[o]}this.schema=s,this.refs=this.collectRefs()}return e.prototype.resolve=function(){return r(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this._resolve()];case 1:return e.sent(),delete this.schema.definitions,delete this.schema.components,[2,this.schema]}})})},e.prototype._resolve=function(){return r(this,void 0,void 0,function(){var t,s,r,o,l,d,u,p,h,f,g,k=this;return a(this,function(a){switch(a.label){case 0:if(!0===this.schema||!1===this.schema)return[2,Promise.resolve(this.schema)];if(0===this.refs.length)return[2,Promise.resolve(this.schema)];t=this.refs.filter(function(e){return k.refCache[e]===undefined}),s=[],r=0,o=t,a.label=1;case 1:return r<o.length?(l=o[r],d=void 0,this.refCache[l]===undefined?[3,2]:(d=this.refCache[l],[3,5])):[3,11];case 2:if("#"!==l)return[3,3];if(this.options.rootSchema===undefined)throw new Error("options.rootSchema was not provided, but one of the schemas references '#'");return d=this.options.rootSchema,[3,5];case 3:return u=c.default.resolve(l,this.options.rootSchema),s.push(u),[4,u];case 4:d=a.sent(),a.label=5;case 5:return!0!==this.options.recursive||!0===d||!1===d||"#"===l?[3,9]:(p=n(n({},this.options),{refCache:this.refCache}),0===(h=new e(d,p)).refs.length?[3,7]:(f=h._resolve(),s.push(f),[4,f]));case 6:return g=a.sent(),this.refCache[l]=m(d,g),[3,8];case 7:this.refCache[l]=d,a.label=8;case 8:return[3,10];case 9:this.refCache[l]=d,a.label=10;case 10:return r++,[3,1];case 11:return this.schema.$ref!==undefined?this.schema=m(this.schema,this.refCache[this.schema.$ref]):(0,i.default)(this.schema,function(e){if(!0===e||!1===e)return e;if(e.$ref!==undefined){var t=k.refCache[e.$ref];return m(e,t)}return e},{mutable:!0}),[4,Promise.all(s)];case 12:return a.sent(),[2,this.schema]}})})},e.prototype.collectRefs=function(){var e=[];return(0,i.default)(this.schema,function(t){if(!0===t||!1===t)return t;if(t.$ref&&-1===e.indexOf(t.$ref)){if("string"!=typeof t.$ref)throw new d(t);e.push(t.$ref)}return t}),e},e}();s.default=u}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/dereferencer",file:"node_modules/@json-schema-tools/dereferencer/build/dereferencer.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/dereferencer/build/index.js",{"./dereferencer":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/dereferencer/build/dereferencer.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.NonStringRefError=void 0;var r=n(e("./dereferencer")),a=e("./dereferencer");Object.defineProperty(s,"NonStringRefError",{enumerable:!0,get:function(){return a.NonStringRefError}}),s.default=r.default}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/dereferencer",file:"node_modules/@json-schema-tools/dereferencer/build/index.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/meta-schema/index.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.jsonSchema=void 0,s.jsonSchema={$schema:"https://meta.json-schema.tools/",$id:"https://meta.json-schema.tools/",title:"JSONSchema",default:{},oneOf:[{$ref:"#/definitions/JSONSchemaObject"},{$ref:"#/definitions/JSONSchemaBoolean"}],definitions:{JSONSchemaBoolean:{title:"JSONSchemaBoolean",description:"Always valid if true. Never valid if false. Is constant.",type:"boolean"},JSONSchemaObject:{title:"JSONSchemaObject",type:"object",properties:{$id:{title:"$id",type:"string",format:"uri-reference"},$schema:{title:"$schema",type:"string",format:"uri"},$ref:{title:"$ref",type:"string",format:"uri-reference"},$comment:{title:"$comment",type:"string"},title:{title:"title",type:"string"},description:{title:"description",type:"string"},default:!0,readOnly:{title:"readOnly",type:"boolean",default:!1},examples:{title:"examples",type:"array",items:!0},multipleOf:{title:"multipleOf",type:"number",exclusiveMinimum:0},maximum:{title:"maximum",type:"number"},exclusiveMaximum:{title:"exclusiveMaximum",type:"number"},minimum:{title:"minimum",type:"number"},exclusiveMinimum:{title:"exclusiveMinimum",type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{title:"pattern",type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{title:"items",anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{title:"uniqueItems",type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{title:"definitions",type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{title:"properties",type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{title:"patternProperties",type:"object",additionalProperties:{$ref:"#"},propertyNames:{title:"propertyNames",format:"regex"},default:{}},dependencies:{title:"dependencies",type:"object",additionalProperties:{title:"dependenciesSet",anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{title:"enum",type:"array",items:!0,minItems:1,uniqueItems:!0},type:{title:"type",anyOf:[{$ref:"#/definitions/simpleTypes"},{title:"arrayOfSimpleTypes",type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{title:"format",type:"string"},contentMediaType:{title:"contentMediaType",type:"string"},contentEncoding:{title:"contentEncoding",type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}}},schemaArray:{title:"schemaArray",type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{title:"nonNegativeInteger",type:"integer",minimum:0},nonNegativeIntegerDefault0:{title:"nonNegativeIntegerDefaultZero",type:"integer",minimum:0,default:0},simpleTypes:{title:"simpleTypes",type:"string",enum:["array","boolean","integer","null","number","object","string"]},stringArray:{title:"stringArray",type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}},s.default=s.jsonSchema}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/meta-schema",file:"node_modules/@json-schema-tools/meta-schema/index.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/default-protocol-handler-map.js",{"./errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/errors.js","isomorphic-fetch":"/home/runner/work/metamask-extension/metamask-extension/node_modules/isomorphic-fetch/fetch-npm-browserify.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__awaiter||function(e,t,s,n){return new(s||(s=Promise))(function(r,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(o,i)}c((n=n.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var s,n,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(c){return function(i){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)try{if(s=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(6===i[0]&&o.label<r[1]){o.label=r[1],r=i;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(i);break}r[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{s=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});var o=e("./errors"),i=a(e("isomorphic-fetch")),c=function(e){return n(void 0,void 0,void 0,function(){var t,s;return r(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,i.default)(e)];case 1:return t=n.sent(),[3,3];case 2:throw n.sent(),new o.InvalidRemoteURLError(e);case 3:return n.trys.push([3,5,,6]),[4,t.json()];case 4:return[2,n.sent()];case 5:throw s=n.sent(),new o.NonJsonRefError({$ref:e},s.message);case 6:return[2]}})})};s.default={https:c,http:c}}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/default-protocol-handler-map.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/errors.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.InvalidFileSystemPathError=s.InvalidRemoteURLError=s.NotResolvableError=s.NonJsonRefError=void 0;var n=function(e,t){this.name="NonJsonRefError",this.message=["NonJsonRefError","The resolved value at the reference: ".concat(e.$ref," was not JSON.parse 'able"),"The non-json content in question: ".concat(t)].join("\n")};s.NonJsonRefError=n;var r=function(e){this.name="NotResolvableError",this.message=["NotResolvableError","Could not resolve the reference: ".concat(e),"No protocol handler was found, and it was not found to be an internal reference"].join("\n")};s.NotResolvableError=r;var a=function(e){this.name="InvalidRemoteURLError",this.message=["InvalidRemoteURLError","The url was not resolvable: ".concat(e)].join("\n")};s.InvalidRemoteURLError=a;var o=function(e){this.name="InvalidFileSystemPathError",this.message=["InvalidFileSystemPathError","The path was not resolvable: ".concat(e)].join("\n")};s.InvalidFileSystemPathError=o}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/errors.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/index-web.js",{"./default-protocol-handler-map":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/default-protocol-handler-map.js","./reference-resolver":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/reference-resolver.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var r in t=arguments[s])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,s,n){return new(s||(s=Promise))(function(r,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(o,i)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var s,n,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(c){return function(i){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)try{if(s=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(6===i[0]&&o.label<r[1]){o.label=r[1],r=i;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(i);break}r[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{s=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});var i=o(e("./default-protocol-handler-map")),c=o(e("./reference-resolver")),l=n(n({},i.default),{file:function(){return r(void 0,void 0,void 0,function(){return a(this,function(e){return[2,undefined]})})}});s.default=new c.default(l)}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/index-web.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/reference-resolver.js",{"./errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/errors.js","./resolve-pointer":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/resolve-pointer.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__awaiter||function(e,t,s,n){return new(s||(s=Promise))(function(r,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(o,i)}c((n=n.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var s,n,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(c){return function(i){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)try{if(s=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(6===i[0]&&o.label<r[1]){o.label=r[1],r=i;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(i);break}r[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{s=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0});var o=e("./errors"),i=a(e("./resolve-pointer")),c=function(){function e(e){this.protocolHandlerMap=e}return e.prototype.resolve=function(e){return n(this,arguments,void 0,function(e,t){var s,n,a,c,l,d,m,u,p,h;return void 0===t&&(t={}),r(this,function(r){switch(r.label){case 0:if("#"===e[0])return[2,Promise.resolve((0,i.default)(e,t))];(s=e.split("#")).length>1&&(n=s[s.length-1]),a=s[0],r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.protocolHandlerMap.file(a,t)];case 2:return c=r.sent(),[3,4];case 3:throw l=r.sent(),new o.NonJsonRefError({$ref:e},l.message);case 4:if(c!==undefined)return h=c,n&&(h=(0,i.default)(n,h)),[2,h];if(!1===e.includes("://"))throw new o.InvalidFileSystemPathError(e);d=0,m=Object.keys(this.protocolHandlerMap),r.label=5;case 5:return d<m.length?(u=m[d],a.startsWith(u)?[4,this.protocolHandlerMap[u](a,t)]:[3,7]):[3,8];case 6:if((p=r.sent())!==undefined)return h=p,n&&(h=(0,i.default)(n,h)),[2,h];r.label=7;case 7:return d++,[3,5];case 8:throw new o.NotResolvableError(e)}})})},e}();s.default=c}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/reference-resolver.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/reference-resolver/build/resolve-pointer.js",{"@json-schema-spec/json-pointer":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-spec/json-pointer/lib/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.InvalidJsonPointerRefError=void 0;var r=n(e("@json-schema-spec/json-pointer")),a=function(e,t){this.name="InvalidJsonPointerRefError",this.message=["InvalidJsonPointerRefError","The provided RFC6901 JSON Pointer is invalid: ".concat(e),"","addition info: ",t].join("\n")};s.InvalidJsonPointerRefError=a,s.default=function(e,t){try{var s=e.replace("#","");return r.default.parse(s).shmeval(t)}catch(t){throw new a(e,t.message)}}}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/resolve-pointer.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@json-schema-tools/traverse/build/index.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var r in t=arguments[s])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__spreadArray||function(e,t,s){if(s||2===arguments.length)for(var n,r=0,a=t.length;r<a;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(s,"__esModule",{value:!0}),s.defaultOptions=void 0,s.defaultOptions={skipFirstMutation:!1,mutable:!1,bfs:!1};var a=function(e){return e.map(function(e){return""===e?"$":".".concat(e)}).join("")},o=function(e,t){var s=t.find(function(t){return t===e});return s||!1},i=function(e,t){return void 0===t&&(t=1),e[e.length-t]};s.default=function e(t,c,l,d,m,u,p,h,f){void 0===l&&(l=s.defaultOptions),void 0===d&&(d=0),void 0===m&&(m=[]),void 0===u&&(u=[]),void 0===p&&(p=[]),void 0===h&&(h=[]),void 0===f&&(f=[]);var g=n(n({},s.defaultOptions),l);if(0===d&&(p=[""]),"boolean"==typeof t||t instanceof Boolean)return!0===g.skipFirstMutation&&0===d?t:c(t,!1,a(p),i(u));var k=t;!1===g.mutable&&(k=n({},t)),u.push(k),!0===g.bfs&&(!1!==g.skipFirstMutation&&0===d||(k=c(k,!1,a(p),i(u,2)))),m.push(t),h.push([t,k]);var w=function(t,s){var n=o(t,m);return n?(f.push(n),!0===g.skipFirstMutation&&n===m[0]?c(t,!0,a(s),i(u)):h.find(function(e){var t=e[0];return n===t})[1]):e(t,c,l,d+1,m,u,s,h,f)};if(t.anyOf)k.anyOf=t.anyOf.map(function(e,t){return w(e,r(r([],p,!0),["anyOf[".concat(t,"]")],!1))});else if(t.allOf)k.allOf=t.allOf.map(function(e,t){return w(e,r(r([],p,!0),["allOf[".concat(t,"]")],!1))});else if(t.oneOf)k.oneOf=t.oneOf.map(function(e,t){return w(e,r(r([],p,!0),["oneOf[".concat(t,"]")],!1))});else{if(t.items)if(t.items instanceof Array)k.items=t.items.map(function(e,t){return w(e,r(r([],p,!0),["items[".concat(t,"]")],!1))});else{var y=o(t.items,m);if(y)if(f.push(y),!0===g.skipFirstMutation&&y===m[0])k.items=c(t.items,!0,a(p),i(u));else{var b=h.find(function(e){var t=e[0];return y===t})[1];k.items=b}else k.items=e(t.items,c,l,d+1,m,u,r(r([],p,!0),["items"],!1),h,f)}if(t.additionalItems!==undefined&&(k.additionalItems=w(t.additionalItems,r(r([],p,!0),["additionalItems"],!1))),t.properties!==undefined){var v=t.properties,_={};Object.keys(t.properties).forEach(function(e){_[e]=w(v[e],r(r([],p,!0),["properties",e.toString()],!1))}),k.properties=_}if(t.patternProperties!==undefined){var x=t.patternProperties,E={};Object.keys(t.patternProperties).forEach(function(e){E[e]=w(x[e],r(r([],p,!0),["patternProperties",e.toString()],!1))}),k.patternProperties=E}t.additionalProperties!==undefined&&!0==!!t.additionalProperties&&(k.additionalProperties=w(t.additionalProperties,r(r([],p,!0),["additionalProperties"],!1)))}if(!0===g.skipFirstMutation&&0===d)return k;if(!0===g.bfs)return u.pop(),k;var S=-1!==f.indexOf(t);return u.pop(),c(k,S,a(p),i(u))}}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/dereferencer>@json-schema-tools/traverse",file:"node_modules/@json-schema-tools/traverse/build/index.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/address-book-controller/dist/AddressBookController.cjs",{"@metamask/base-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/base-controller/dist/index.cjs","@metamask/controller-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/controller-utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.AddressBookController=s.getDefaultAddressBookControllerState=s.controllerName=s.AddressType=void 0;const o=e("@metamask/base-controller"),i=e("@metamask/controller-utils");var c;!function(e){e.externallyOwnedAccounts="EXTERNALLY_OWNED_ACCOUNTS",e.contractAccounts="CONTRACT_ACCOUNTS",e.nonAccounts="NON_ACCOUNTS"}(c||(s.AddressType=c={})),s.controllerName="AddressBookController";const l={addressBook:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0}};s.getDefaultAddressBookControllerState=()=>({addressBook:{}});class d extends o.BaseController{constructor({messenger:e,state:t}){const o={...(0,s.getDefaultAddressBookControllerState)(),...t};super({messenger:e,metadata:l,name:s.controllerName,state:o}),n.add(this),a(this,n,"m",r).call(this)}list(){const{addressBook:e}=this.state;return Object.keys(e).reduce((t,s)=>{const n=s;return[...t,...Object.values(e[n])]},[])}clear(){this.update(e=>{e.addressBook={}})}delete(e,t){if(t=(0,i.toChecksumHexAddress)(t),!([e,t].every(e=>(0,i.isSafeDynamicKey)(e))&&(0,i.isValidHexAddress)(t)&&this.state.addressBook[e]&&this.state.addressBook[e][t]))return!1;const s={...this.state.addressBook[e][t]};return this.update(s=>{const n=s.addressBook[e];n?.[t]&&(delete n[t],0===Object.keys(n).length&&delete s.addressBook[e])}),"*"!==String(e)&&this.messenger.publish("AddressBookController:contactDeleted",s),!0}set(e,t,s=(0,i.toHex)(1),n="",r){if(e=(0,i.toChecksumHexAddress)(e),!(0,i.isValidHexAddress)(e))return!1;const a={address:e,chainId:s,isEns:!1,memo:n,name:t,addressType:r,lastUpdatedAt:Date.now()},o=(0,i.normalizeEnsName)(t);return o&&(a.name=o,a.isEns=!0),this.update(t=>{t.addressBook={...this.state.addressBook,[s]:{...this.state.addressBook[s],[e]:a}}}),"*"!==String(s)&&this.messenger.publish("AddressBookController:contactUpdated",a),!0}}s.AddressBookController=d,n=new WeakSet,r=function(){this.messenger.registerActionHandler(`${s.controllerName}:list`,this.list.bind(this)),this.messenger.registerActionHandler(`${s.controllerName}:set`,this.set.bind(this)),this.messenger.registerActionHandler(`${s.controllerName}:delete`,this.delete.bind(this))},s.default=d}}},{package:"@metamask/address-book-controller",file:"node_modules/@metamask/address-book-controller/dist/AddressBookController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/address-book-controller/dist/index.cjs",{"./AddressBookController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/address-book-controller/dist/AddressBookController.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.AddressBookController=s.getDefaultAddressBookControllerState=void 0;var n=e("./AddressBookController.cjs");Object.defineProperty(s,"getDefaultAddressBookControllerState",{enumerable:!0,get:function(){return n.getDefaultAddressBookControllerState}}),Object.defineProperty(s,"AddressBookController",{enumerable:!0,get:function(){return n.AddressBookController}})}}},{package:"@metamask/address-book-controller",file:"node_modules/@metamask/address-book-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/announcement-controller/dist/AnnouncementController.cjs",{"@metamask/base-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/base-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.AnnouncementController=void 0;const o=e("@metamask/base-controller"),i={announcements:{}},c={announcements:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!0,usedInUi:!0}};class l extends o.BaseController{constructor({messenger:e,state:t,allAnnouncements:s}){const o={...i,...t};super({messenger:e,metadata:c,name:"AnnouncementController",state:o}),n.add(this),a(this,n,"m",r).call(this,s)}resetViewed(){this.update(({announcements:e})=>{for(const t of Object.values(e))t.isShown=!1})}updateViewed(e){this.update(({announcements:t})=>{for(const s of Object.keys(e).map(Number))t[s].isShown=e[s]})}}s.AnnouncementController=l,n=new WeakSet,r=function(e){this.update(t=>{Object.values(e).forEach(e=>{t.announcements[e.id]=t.announcements[e.id]??{...e,isShown:!1}})})}}}},{package:"@metamask/announcement-controller",file:"node_modules/@metamask/announcement-controller/dist/AnnouncementController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/announcement-controller/dist/index.cjs",{"./AnnouncementController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/announcement-controller/dist/AnnouncementController.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.AnnouncementController=void 0;var n=e("./AnnouncementController.cjs");Object.defineProperty(s,"AnnouncementController",{enumerable:!0,get:function(){return n.AnnouncementController}})}}},{package:"@metamask/announcement-controller",file:"node_modules/@metamask/announcement-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/bridge-status-controller.cjs",{"./bridge-status-controller.intent.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/bridge-status-controller.intent.cjs","./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/constants.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/types.cjs","./utils/bridge-status.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/bridge-status.cjs","./utils/gas.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/gas.cjs","./utils/intent-api.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/intent-api.cjs","./utils/metrics.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/metrics.cjs","./utils/transaction.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs","@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","@metamask/controller-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/controller-utils/dist/index.cjs","@metamask/keyring-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/keyring-controller/dist/index.cjs","@metamask/polling-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/polling-controller/dist/index.cjs","@metamask/transaction-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/transaction-controller/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c,l,d,m,u,p,h,f,g,k,w,y,b,v,_,x,E,S,T,j,C,A,I,P,O,D,M,B,R=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},N=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.BridgeStatusController=void 0;const F=e("@metamask/bridge-controller"),L=e("@metamask/controller-utils"),H=e("@metamask/keyring-controller"),U=e("@metamask/polling-controller"),G=e("@metamask/transaction-controller"),q=e("@metamask/utils"),$=e("./bridge-status-controller.intent.cjs"),W=e("./constants.cjs"),z=e("./types.cjs"),V=e("./utils/bridge-status.cjs"),K=e("./utils/gas.cjs"),J=e("./utils/intent-api.cjs"),Y=e("./utils/metrics.cjs"),X=e("./utils/transaction.cjs"),Q={txHistory:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0}};class Z extends((0,U.StaticIntervalPollingController)()){constructor({messenger:e,state:t,clientId:s,fetchFn:U,addTransactionFn:Z,addTransactionBatchFn:ee,updateTransactionFn:te,estimateGasFeeFn:se,config:ne,traceFn:re}){super({name:W.BRIDGE_STATUS_CONTROLLER_NAME,metadata:Q,messenger:e,state:{...W.DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE,...t}}),n.add(this),r.set(this,{}),a.set(this,void 0),o.set(this,void 0),i.set(this,void 0),c.set(this,void 0),l.set(this,void 0),d.set(this,void 0),m.set(this,void 0),u.set(this,void 0),p.set(this,void 0),h.set(this,({id:e,actionId:t})=>{let s=this.state.txHistory[e]?e:undefined;if(!s&&t&&this.state.txHistory[t]&&(s=t),s??(s=Object.keys(this.state.txHistory).find(t=>this.state.txHistory[t].approvalTxId===e)),!s)return;const n=s;this.update(e=>{e.txHistory[n].status.status=F.StatusTypes.FAILED})}),this.resetState=()=>{this.update(e=>{e.txHistory=W.DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE.txHistory})},this.wipeBridgeStatus=({address:e,ignoreNetwork:t})=>{if(t)this.update(e=>{e.txHistory=W.DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE.txHistory});else{const{selectedNetworkClientId:t}=this.messenger.call("NetworkController:getState"),s=this.messenger.call("NetworkController:getNetworkClientById",t).configuration.chainId;N(this,T,"f").call(this,e,s)}},this.restartPollingForFailedAttempts=e=>{const{txMetaId:t,txHash:s}=e;if(!t&&!s)throw new Error("Either txMetaId or txHash must be provided");let n;if(t?this.state.txHistory[t]&&(n=t):s&&(n=Object.keys(this.state.txHistory).find(e=>this.state.txHistory[e].status.srcChain.txHash===s)),!n)throw new Error("No bridge transaction history found for "+(t?`txMetaId: ${t}`:`txHash: ${s}`));const a=this.state.txHistory[n],o=a.attempts?.counter??0;if(this.update(e=>{n&&(e.txHistory[n].attempts=undefined)}),N(this,y,"f").call(this,a)){if(!N(this,r,"f")[n]&&(N(this,w,"f").call(this,n),!a.featureId)){const e=this.messenger.call("AccountsController:getAccountByAddress",a.account),t=(0,Y.getRequestParamFromHistory)(a),s=(0,Y.getRequestMetadataFromHistory)(a,e),{security_warnings:r,...i}=s;N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.PollingStatusUpdated,n,{...(0,Y.getTradeDataFromHistory)(a),...(0,Y.getPriceImpactFromQuote)(a.quote),...i,chain_id_source:t.chain_id_source,chain_id_destination:t.chain_id_destination,token_symbol_source:t.token_symbol_source,token_symbol_destination:t.token_symbol_destination,action_type:F.MetricsActionType.SWAPBRIDGE_V1,polling_status:F.PollingStatus.ManuallyRestarted,retry_attempts:o})}}},this.getBridgeHistoryItemByTxMetaId=e=>this.state.txHistory[e],f.set(this,()=>{const{txHistory:e}=this.state;Object.values(e).filter(e=>e.status.status===F.StatusTypes.PENDING||e.status.status===F.StatusTypes.UNKNOWN).filter(e=>Boolean(e.txMetaId)).filter(e=>!N(this,r,"f")[e.txMetaId]).filter(e=>N(this,y,"f").call(this,e)).forEach(e=>{const t=e.txMetaId;(0,V.shouldSkipFetchDueToFetchFailures)(e.attempts)||N(this,w,"f").call(this,t)})}),g.set(this,(e,t)=>{const{bridgeTxMeta:s,statusRequest:n,quoteResponse:r,startTime:a,slippagePercentage:o,initialDestAssetBalance:i,targetContractAddress:c,approvalTxId:l,isStxEnabled:d,location:m,abTests:u,accountAddress:p}=e,h=(0,X.getHistoryKey)(t,s?.id),f={txMetaId:s?.id,actionId:t,originalTransactionId:s?.originalTransactionId||s?.id,batchId:s?.batchId,quote:r.quote,startTime:a,estimatedProcessingTimeInSeconds:r.estimatedProcessingTimeInSeconds,slippagePercentage:o,pricingData:{amountSent:r.sentAmount?.amount??"0",amountSentInUsd:r.sentAmount?.usd??undefined,quotedGasInUsd:r.gasFee?.effective?.usd??undefined,quotedReturnInUsd:r.toTokenAmount?.usd??undefined,quotedGasAmount:r.gasFee?.effective?.amount??undefined},initialDestAssetBalance:i,targetContractAddress:c,account:p,status:{status:F.StatusTypes.PENDING,srcChain:{chainId:n.srcChainId,txHash:n.srcTxHash}},hasApprovalTx:Boolean(r.approval),approvalTxId:l,isStxEnabled:d??!1,featureId:r.featureId,location:m,...u&&{abTests:u}};this.update(e=>{e.txHistory[h]=f})}),k.set(this,(e,t)=>{this.update(s=>{(0,X.rekeyHistoryItemInState)(s,e,t)})}),w.set(this,e=>{const t=N(this,r,"f")[e];t&&this.stopPollingByPollingToken(t);const s=this.state.txHistory[e];s&&N(this,y,"f").call(this,s)&&(N(this,r,"f")[e]=this.startPolling({bridgeTxMetaId:e}))}),y.set(this,e=>{const t=Boolean(e?.quote?.intent);return[(0,F.isCrossChain)(e.quote.srcChainId,e.quote.destChainId),t,(0,F.isTronChainId)(e.quote.srcChainId)].some(Boolean)}),this.startPollingForBridgeTxStatus=e=>{const{bridgeTxMeta:t}=e;if(!t?.id)throw new Error("Cannot start polling: bridgeTxMeta.id is required for polling");N(this,g,"f").call(this,e),N(this,w,"f").call(this,t.id)},this._executePoll=async e=>{await N(this,_,"f").call(this,e)},v.set(this,e=>{const{attempts:t}=this.state.txHistory[e],s=t?{counter:t.counter+1,lastAttemptTime:Date.now()}:{counter:1,lastAttemptTime:Date.now()},n=N(this,r,"f")[e];if(s.counter>=W.MAX_ATTEMPTS&&n){this.stopPollingByPollingToken(n),delete N(this,r,"f")[e];const t=this.state.txHistory[e];if(t&&!t.featureId){const n=this.messenger.call("AccountsController:getAccountByAddress",t.account),r=(0,Y.getRequestParamFromHistory)(t),a=(0,Y.getRequestMetadataFromHistory)(t,n),{security_warnings:o,...i}=a;N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.PollingStatusUpdated,e,{...(0,Y.getTradeDataFromHistory)(t),...(0,Y.getPriceImpactFromQuote)(t.quote),...i,chain_id_source:r.chain_id_source,chain_id_destination:r.chain_id_destination,token_symbol_source:r.token_symbol_source,token_symbol_destination:r.token_symbol_destination,action_type:F.MetricsActionType.SWAPBRIDGE_V1,polling_status:F.PollingStatus.MaxPollingReached,retry_attempts:s.counter})}}this.update(t=>{t.txHistory[e].attempts=s})}),_.set(this,async({bridgeTxMetaId:e})=>{const{txHistory:t}=this.state,s=t[e];if(s&&!(0,V.shouldSkipFetchDueToFetchFailures)(s.attempts))try{let t,n=[];const l=Boolean(s.quote.intent);if(l){const n=await N(this,a,"f").getIntentTransactionStatus(e,s,N(this,o,"f"));if(null===n?.bridgeStatus||n?.bridgeStatus===undefined)return;t=n.bridgeStatus.status}else{const r=N(this,E,"f").call(this,e);if(!r)return;N(this,S,"f").call(this,e,r);const a=(0,V.getStatusRequestWithSrcTxHash)(s.quote,r),l=await(0,V.fetchBridgeTxStatus)(a,N(this,o,"f"),await N(this,x,"f").call(this),N(this,i,"f"),N(this,c,"f").customBridgeApiBaseUrl);t=l.status,n=l.validationFailures}if(n.length>0)throw N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.StatusValidationFailed,e,{failures:n,refresh_count:s.attempts?.counter??0}),new Error(`Bridge status validation failed: ${n.join(", ")}`);const d={...s,status:t,completionTime:t.status===F.StatusTypes.COMPLETE||t.status===F.StatusTypes.FAILED?Date.now():undefined,attempts:undefined};this.update(t=>{t.txHistory[e]=d}),l&&N(this,a,"f").syncTransactionFromIntentStatus(e,s);const m=N(this,r,"f")[e];if((t.status===F.StatusTypes.COMPLETE||t.status===F.StatusTypes.FAILED)&&m){if(this.stopPollingByPollingToken(m),delete N(this,r,"f")[e],s.featureId)return;t.status===F.StatusTypes.COMPLETE&&(N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Completed,e),this.messenger.publish("BridgeStatusController:destinationTransactionCompleted",s.quote.destAsset.assetId)),t.status===F.StatusTypes.FAILED&&N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Failed,e)}}catch(t){console.warn("Failed to fetch bridge tx status",t),N(this,v,"f").call(this,e)}}),x.set(this,async()=>{try{return await this.messenger.call("AuthenticationController:getBearerToken")}catch(e){return console.error("Error getting JWT token for bridge-api request",e),undefined}}),E.set(this,e=>{const{txHistory:t}=this.state,s=t[e].status.srcChain.txHash;if(s)return s;const n=this.messenger.call("TransactionController:getState").transactions.find(t=>t.id===e);return n?.hash}),S.set(this,(e,t)=>{const{txHistory:s}=this.state;s[e].status.srcChain.txHash||this.update(s=>{s.txHistory[e].status.srcChain.txHash=t})}),T.set(this,(e,t)=>{const s=Object.keys(this.state.txHistory).filter(s=>{const n=this.state.txHistory[s],r=(0,q.numberToHex)(n.quote.srcChainId);return n.account===e&&r===t});s.forEach(e=>{N(this,r,"f")[e]&&this.stopPollingByPollingToken(N(this,r,"f")[e])}),this.update(e=>{e.txHistory=s.reduce((e,t)=>(delete e[t],e),e.txHistory)})}),j.set(this,async(e,t,s)=>{if(!s.metadata?.snap?.id)throw new Error("Failed to submit cross-chain swap transaction: undefined snap id");const n=(0,X.getClientRequest)(e,t.quote.srcChainId,s),r=await this.messenger.call("SnapController:handleRequest",n),a={...t,trade:e};return(0,X.handleNonEvmTxResponse)(r,a,s)}),C.set(this,async e=>{const t=await e,s=this.messenger.call("TransactionController:getState").transactions.find(e=>e.hash===t);if(!s)throw new Error("Failed to submit cross-chain swap tx: txMeta for txHash was not found");return s}),A.set(this,async(e,{timeoutMs:t=3e5,pollMs:s=3e3}={})=>await(0,X.waitForTxConfirmation)(this.messenger,e,{timeoutMs:t,pollMs:s})),I.set(this,async(e,t,s,n,r)=>{if(s){const a=async()=>{await N(this,O,"f").call(this,n);const a=await N(this,P,"f").call(this,{transactionType:e?G.TransactionType.bridgeApproval:G.TransactionType.swapApproval,trade:s,requireApproval:r});return await(0,X.handleApprovalDelay)(t),a};return await N(this,p,"f").call(this,{name:e?W.TraceName.BridgeTransactionApprovalCompleted:W.TraceName.SwapTransactionApprovalCompleted,data:{srcChainId:(0,F.formatChainIdToCaip)(t),stxEnabled:!1}},a)}return undefined}),P.set(this,async({transactionType:e,trade:t,requireApproval:s=!1,txFee:n,actionId:r})=>{const a=r??(0,X.generateActionId)().toString();if(!this.messenger.call("AccountsController:getAccountByAddress",t.from))throw new Error("Failed to submit cross-chain swap transaction: unknown account in trade data");const o=(0,F.formatChainIdToHex)(t.chainId),i=this.messenger.call("NetworkController:findNetworkClientIdByChainId",o),c={actionId:a,networkClientId:i,requireApproval:s,type:e,origin:"metamask"},{gasLimit:d,...m}=t,u={...m,chainId:o,...d&&0!==d&&{gasLimit:d.toString(),gas:d.toString()}},p={...u,...await N(this,D,"f").call(this,u,i,o,n)},{result:h}=await N(this,l,"f").call(this,p,c);return await N(this,C,"f").call(this,h)}),O.set(this,async e=>{e&&await N(this,P,"f").call(this,{transactionType:G.TransactionType.bridgeApproval,trade:e})}),D.set(this,async(e,t,s,n)=>{const{gas:r}=e;if(n)return{maxFeePerGas:(0,L.toHex)(n.maxFeePerGas??0),maxPriorityFeePerGas:(0,L.toHex)(n.maxPriorityFeePerGas??0),gas:r?(0,L.toHex)(r):undefined};const{gasFeeEstimates:a}=this.messenger.call("GasFeeController:getState"),{estimates:o}=await N(this,u,"f").call(this,{transactionParams:e,chainId:s,networkClientId:t}),{maxFeePerGas:i,maxPriorityFeePerGas:c}=(0,K.getTxGasEstimates)({networkGasFeeEstimates:a,txGasFeeEstimates:o});return{maxFeePerGas:i,maxPriorityFeePerGas:c,gas:r?(0,L.toHex)(r):undefined}}),M.set(this,async e=>{const t=await(0,X.getAddTransactionBatchParams)({messenger:this.messenger,estimateGasFeeFn:N(this,u,"f"),...e}),s={[G.TransactionType.bridgeApproval]:t.transactions.find(({type:e})=>e===G.TransactionType.bridgeApproval)?.params.data,[G.TransactionType.swapApproval]:t.transactions.find(({type:e})=>e===G.TransactionType.swapApproval)?.params.data,[G.TransactionType.bridge]:t.transactions.find(({type:e})=>e===G.TransactionType.bridge)?.params.data,[G.TransactionType.swap]:t.transactions.find(({type:e})=>e===G.TransactionType.swap)?.params.data},{batchId:n}=await N(this,d,"f").call(this,t),{approvalMeta:r,tradeMeta:a}=(0,X.findAndUpdateTransactionsInBatch)({messenger:this.messenger,updateTransactionFn:N(this,m,"f"),batchId:n,txDataByType:s});if(!a)throw new Error("Failed to update cross-chain swap transaction batch: tradeMeta not found");return{approvalMeta:r,tradeMeta:a}}),this.submitTx=async(e,t,s,r,a=F.MetaMetricsSwapsEventSource.MainView,i)=>{this.messenger.call("BridgeController:stopPollingForQuotes",F.AbortReason.TransactionSubmitted,t.featureId?undefined:r);const c=N(this,n,"m",b).call(this,e);if(!c)throw new Error("Failed to submit cross-chain swap transaction: undefined multichain account");const l=(0,F.isHardwareWallet)(c),d=(0,Y.getPreConfirmationPropertiesFromQuote)(t,s,l,a,i);let m,u;!t.featureId&&N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Submitted,undefined,d);const h=Date.now(),f=(0,F.isCrossChain)(t.quote.srcChainId,t.quote.destChainId),y=(0,F.isTronChainId)(t.quote.srcChainId);if((0,F.isNonEvmChainId)(t.quote.srcChainId)){if(t.approval&&(0,F.isTronTrade)(t.approval)){const e=await N(this,p,"f").call(this,{name:f?W.TraceName.BridgeTransactionApprovalCompleted:W.TraceName.SwapTransactionApprovalCompleted,data:{srcChainId:(0,F.formatChainIdToCaip)(t.quote.srcChainId),stxEnabled:!1}},async()=>{try{return t.approval&&(0,F.isTronTrade)(t.approval)?await N(this,j,"f").call(this,t.approval,t,c):undefined}catch(e){throw!t.featureId&&N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Failed,undefined,{error_message:e?.message,...d}),e}});u=e?.id,await(0,X.handleApprovalDelay)(t.quote.srcChainId)}m=await N(this,p,"f").call(this,{name:f?W.TraceName.BridgeTransactionCompleted:W.TraceName.SwapTransactionCompleted,data:{srcChainId:(0,F.formatChainIdToCaip)(t.quote.srcChainId),stxEnabled:!1}},async()=>{try{if(!(0,F.isTronTrade)(t.trade)&&!(0,F.isBitcoinTrade)(t.trade)&&"string"!=typeof t.trade)throw new Error("Failed to submit cross-chain swap transaction: trade is not a non-EVM transaction");return await N(this,j,"f").call(this,t.trade,t,c)}catch(e){throw!t.featureId&&N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Failed,m?.id,{error_message:e?.message,...d}),e}})}else{const e=N(this,o,"f")===z.BridgeClientId.MOBILE&&l;m=await N(this,p,"f").call(this,{name:f?W.TraceName.BridgeTransactionCompleted:W.TraceName.SwapTransactionCompleted,data:{srcChainId:(0,F.formatChainIdToCaip)(t.quote.srcChainId),stxEnabled:s}},async()=>{if(!(0,F.isEvmTxData)(t.trade))throw new Error("Failed to submit cross-chain swap transaction: trade is not an EVM transaction");if(s||t.quote.gasIncluded7702){const{tradeMeta:s,approvalMeta:n}=await N(this,M,"f").call(this,{isBridgeTx:f,resetApproval:t.resetApproval,approval:t.approval&&(0,F.isEvmTxData)(t.approval)?t.approval:undefined,trade:t.trade,quoteResponse:t,requireApproval:e});return u=n?.id,s}const n=await N(this,I,"f").call(this,f,t.quote.srcChainId,t.approval&&(0,F.isEvmTxData)(t.approval)?t.approval:undefined,t.resetApproval,e);u=n?.id,await(0,X.handleMobileHardwareWalletDelay)(e);const r=(0,X.generateActionId)().toString();N(this,g,"f").call(this,{accountAddress:c.address,statusRequest:{...(0,X.getStatusRequestParams)(t),srcTxHash:""},quoteResponse:t,slippagePercentage:0,isStxEnabled:s,startTime:h,approvalTxId:u,location:a,abTests:i},r);const o=await N(this,P,"f").call(this,{transactionType:f?G.TransactionType.bridge:G.TransactionType.swap,trade:t.trade,requireApproval:e,txFee:t.quote.gasIncluded?t.quote.feeData.txFee:undefined,actionId:r});return N(this,k,"f").call(this,r,o),o})}try{!(0,F.isNonEvmChainId)(t.quote.srcChainId)&&!s&&!t.quote.gasIncluded7702||N(this,g,"f").call(this,{accountAddress:c.address,bridgeTxMeta:m,statusRequest:{...(0,X.getStatusRequestParams)(t),srcTxHash:m.hash},quoteResponse:t,slippagePercentage:0,isStxEnabled:s,startTime:h,approvalTxId:u,location:a,abTests:i}),(0,F.isNonEvmChainId)(t.quote.srcChainId)&&(N(this,w,"f").call(this,m.id),f||y||N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Completed,m.id))}catch{}return m},this.submitIntent=async e=>{const{quoteResponse:t,accountAddress:s,location:r,abTests:i}=e;this.messenger.call("BridgeController:stopPollingForQuotes",F.AbortReason.TransactionSubmitted);const c=N(this,n,"m",b).call(this,s),d=Boolean(c)&&(0,F.isHardwareWallet)(c),m=(0,Y.getPreConfirmationPropertiesFromQuote)(t,!1,d,r,i);try{const e=(0,X.getIntentFromQuote)(t);let n;if(t.approval){const e=(0,F.isCrossChain)(t.quote.srcChainId,t.quote.destChainId),s=await N(this,I,"f").call(this,e,t.quote.srcChainId,t.approval&&(0,F.isEvmTxData)(t.approval)?t.approval:undefined,t.resetApproval,!1);n=s?.id,n&&await N(this,A,"f").call(this,n)}const{srcChainId:c,requestId:d}=t.quote,m=await this.messenger.call("KeyringController:signTypedMessage",{from:s,data:e.typedData},H.SignTypedDataVersion.V4),u={srcChainId:c.toString(),quoteId:d,signature:m,order:e.order,userAddress:s,aggregatorId:e.protocol},p=await N(this,a,"f").submitIntent(u,N(this,o,"f")),h=p.id,f=(0,F.isCrossChain)(t.quote.srcChainId,t.quote.destChainId),k=f?G.TransactionType.bridge:G.TransactionType.swap,y=this.messenger.call("NetworkController:findNetworkClientIdByChainId",(0,F.formatChainIdToHex)(c)),b={chainId:(0,F.formatChainIdToHex)(c),from:s,to:e.settlementContract??"0x9008D19f58AAbd9eD0D60971565AA8510560ab41",data:`0x${h.slice(-8)}`,value:"0x0",gas:"0x5208",gasPrice:"0x3b9aca00"},{transactionMeta:v}=await N(this,l,"f").call(this,b,{origin:"metamask",actionId:(0,X.generateActionId)(),requireApproval:!1,isStateOnly:!0,networkClientId:y,type:k}),_=v,x=(0,J.mapIntentOrderStatusToTransactionStatus)(p.status),E={...{..._,status:x},isIntentTx:!0,orderUid:h,intentType:f?"bridge":"swap"};try{const e=h,a={...E,id:e,originalTransactionId:E.id},o=Date.now();N(this,g,"f").call(this,{accountAddress:s,bridgeTxMeta:a,statusRequest:{...(0,X.getStatusRequestParams)(t),srcTxHash:E.hash??""},quoteResponse:t,slippagePercentage:0,isStxEnabled:!1,approvalTxId:n,startTime:o,location:r,abTests:i}),N(this,w,"f").call(this,e)}catch(e){console.error("📝 [submitIntent] Failed to add to bridge history",e)}return E}catch(e){throw N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Failed,undefined,{error_message:e?.message,...m}),e}},B.set(this,(e,t,s)=>{const{ab_tests:n}=s??{},r=t?this.state.txHistory?.[t]?.abTests:undefined,a=n??r??undefined,o={action_type:F.MetricsActionType.SWAPBRIDGE_V1,location:s?.location??(t?this.state.txHistory?.[t]?.location:undefined)??F.MetaMetricsSwapsEventSource.MainView,...s??{},...a&&Object.keys(a).length>0&&{ab_tests:a}};if(!t)return void this.messenger.call("BridgeController:trackUnifiedSwapBridgeEvent",e,o);const i=this.state.txHistory[t];if(!i)return void this.messenger.call("BridgeController:trackUnifiedSwapBridgeEvent",e,o);const c=(0,Y.getRequestParamFromHistory)(i);if(e===F.UnifiedSwapBridgeEventName.StatusValidationFailed)return void this.messenger.call("BridgeController:trackUnifiedSwapBridgeEvent",e,{...o,chain_id_source:c.chain_id_source,chain_id_destination:c.chain_id_destination,token_address_source:c.token_address_source,token_address_destination:c.token_address_destination,refresh_count:i.attempts?.counter??0});if(i.featureId)return;const l=this.messenger.call("AccountsController:getAccountByAddress",i.account),{transactions:d}=this.messenger.call("TransactionController:getState"),m=d?.find(e=>e.id===t),u=d?.find(e=>e.id===i.approvalTxId),p={...o,...c,...(0,Y.getRequestMetadataFromHistory)(i,l),...(0,Y.getTradeDataFromHistory)(i),...(0,Y.getTxStatusesFromHistory)(i),...(0,Y.getFinalizedTxProperties)(i,m,u),...(0,Y.getPriceImpactFromQuote)(i.quote)};this.messenger.call("BridgeController:trackUnifiedSwapBridgeEvent",e,p)}),R(this,o,s,"f"),R(this,i,U,"f"),R(this,l,Z,"f"),R(this,d,ee,"f"),R(this,m,te,"f"),R(this,u,se,"f"),R(this,c,{customBridgeApiBaseUrl:ne?.customBridgeApiBaseUrl??W.BRIDGE_PROD_API_BASE_URL},"f"),R(this,p,re??((e,t)=>t?.()),"f"),R(this,a,new $.IntentManager({messenger:this.messenger,updateTransactionFn:N(this,m,"f"),customBridgeApiBaseUrl:N(this,c,"f").customBridgeApiBaseUrl,fetchFn:N(this,i,"f"),getJwt:N(this,x,"f")}),"f"),this.messenger.registerActionHandler(`${W.BRIDGE_STATUS_CONTROLLER_NAME}:startPollingForBridgeTxStatus`,this.startPollingForBridgeTxStatus.bind(this)),this.messenger.registerActionHandler(`${W.BRIDGE_STATUS_CONTROLLER_NAME}:wipeBridgeStatus`,this.wipeBridgeStatus.bind(this)),this.messenger.registerActionHandler(`${W.BRIDGE_STATUS_CONTROLLER_NAME}:resetState`,this.resetState.bind(this)),this.messenger.registerActionHandler(`${W.BRIDGE_STATUS_CONTROLLER_NAME}:submitTx`,this.submitTx.bind(this)),this.messenger.registerActionHandler(`${W.BRIDGE_STATUS_CONTROLLER_NAME}:submitIntent`,this.submitIntent.bind(this)),this.messenger.registerActionHandler(`${W.BRIDGE_STATUS_CONTROLLER_NAME}:restartPollingForFailedAttempts`,this.restartPollingForFailedAttempts.bind(this)),this.messenger.registerActionHandler(`${W.BRIDGE_STATUS_CONTROLLER_NAME}:getBridgeHistoryItemByTxMetaId`,this.getBridgeHistoryItemByTxMetaId.bind(this)),this.setIntervalLength(W.REFRESH_INTERVAL_MS),this.messenger.subscribe("TransactionController:transactionFailed",({transactionMeta:e})=>{const{type:t,status:s,id:n,actionId:r}=e;if(t&&[G.TransactionType.bridge,G.TransactionType.swap,G.TransactionType.bridgeApproval,G.TransactionType.swapApproval].includes(t)&&[G.TransactionStatus.failed,G.TransactionStatus.dropped,G.TransactionStatus.rejected].includes(s)&&(N(this,h,"f").call(this,e),s!==G.TransactionStatus.rejected)){let t;this.state.txHistory[n]?t=n:r&&this.state.txHistory[r]&&(t=r),N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Failed,t??n,(0,Y.getEVMTxPropertiesFromTransactionMeta)(e))}}),this.messenger.subscribe("TransactionController:transactionConfirmed",e=>{const{type:t,id:s,chainId:n}=e;t===G.TransactionType.swap&&N(this,B,"f").call(this,F.UnifiedSwapBridgeEventName.Completed,s),t!==G.TransactionType.bridge||(0,F.isNonEvmChainId)(n)||N(this,w,"f").call(this,s)}),N(this,f,"f").call(this)}}s.BridgeStatusController=Z,r=new WeakMap,a=new WeakMap,o=new WeakMap,i=new WeakMap,c=new WeakMap,l=new WeakMap,d=new WeakMap,m=new WeakMap,u=new WeakMap,p=new WeakMap,h=new WeakMap,f=new WeakMap,g=new WeakMap,k=new WeakMap,w=new WeakMap,y=new WeakMap,v=new WeakMap,_=new WeakMap,x=new WeakMap,E=new WeakMap,S=new WeakMap,T=new WeakMap,j=new WeakMap,C=new WeakMap,A=new WeakMap,I=new WeakMap,P=new WeakMap,O=new WeakMap,D=new WeakMap,M=new WeakMap,B=new WeakMap,n=new WeakSet,b=function(e){return this.messenger.call("AccountsController:getAccountByAddress",e)}}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/bridge-status-controller.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/bridge-status-controller.intent.cjs",{"./utils/intent-api.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/intent-api.cjs","./utils/validators.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/validators.cjs","@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},l=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.IntentManager=void 0;const d=e("@metamask/bridge-controller"),m=e("./utils/intent-api.cjs");e("./utils/validators.cjs");s.IntentManager=class{constructor({messenger:e,updateTransactionFn:t,customBridgeApiBaseUrl:s,fetchFn:u,getJwt:p}){n.add(this),r.set(this,void 0),a.set(this,void 0),o.set(this,new Map),this.getIntentTransactionStatus=async(e,t,s)=>{const{status:r,quote:{srcChainId:a,intent:o}}=t,c=r?.srcChain?.txHash??"",d=o?.protocol??"";try{const t=await this.intentApi.getOrderStatus(e,d,a.toString(),s);return l(this,n,"m",i).call(this,e,t,a,c.toString())}catch(e){if(e instanceof Error)throw new Error(`[Intent polling] Failed to get intent order status from API: ${e.message}`);return undefined}},this.syncTransactionFromIntentStatus=(e,t)=>{const s=t.originalTransactionId??t.txMetaId;if(!s)return;const n=l(this,o,"f").get(e);if(n)try{const{transactions:t}=l(this,r,"f").call("TransactionController:getState"),i=t.find(e=>e.id===s);if(!i)return void console.warn("[Intent polling] Skipping update, transaction not found",{originalTxId:s,bridgeHistoryKey:e});const{bridgeStatus:c,orderStatus:m}=n,u=c?.txHash,p=c?.status.status===d.StatusTypes.COMPLETE,h=c?.status.status===d.StatusTypes.COMPLETE||c?.status.status===d.StatusTypes.FAILED,f=i.txReceipt,g=u?{txReceipt:{...f,transactionHash:u,status:p?"0x1":"0x0"}}:{},k={...i,status:c?.transactionStatus,...u?{hash:u}:{},...g};l(this,a,"f").call(this,k,`BridgeStatusController - Intent order status updated: ${m}`),h&&l(this,o,"f").delete(e)}catch(t){console.error("[Intent polling] Failed to update transaction status",{originalTxId:s,bridgeHistoryKey:e,error:t})}},this.submitIntent=async(e,t)=>this.intentApi.submitIntent(e,t),c(this,r,e,"f"),c(this,a,t,"f"),this.intentApi=new m.IntentApiImpl(s,u,p)}},r=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakSet,i=function(e,t,s,n){const r=(0,m.translateIntentOrderToBridgeStatus)(t,s,n.toString()),a={orderStatus:t.status,bridgeStatus:r};return l(this,o,"f").set(e,a),a}}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/bridge-status-controller.intent.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/constants.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n;Object.defineProperty(s,"__esModule",{value:!0}),s.TraceName=s.APPROVAL_DELAY_MS=s.BRIDGE_PROD_API_BASE_URL=s.DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE=s.BRIDGE_STATUS_CONTROLLER_NAME=s.MAX_ATTEMPTS=s.REFRESH_INTERVAL_MS=void 0,s.REFRESH_INTERVAL_MS=1e4,s.MAX_ATTEMPTS=7,s.BRIDGE_STATUS_CONTROLLER_NAME="BridgeStatusController",s.DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE={txHistory:{}},s.BRIDGE_PROD_API_BASE_URL="https://bridge.api.cx.metamask.io",s.APPROVAL_DELAY_MS=5e3,function(e){e.BridgeTransactionApprovalCompleted="Bridge Transaction Approval Completed",e.BridgeTransactionCompleted="Bridge Transaction Completed",e.SwapTransactionApprovalCompleted="Swap Transaction Approval Completed",e.SwapTransactionCompleted="Swap Transaction Completed"}(n||(s.TraceName=n={}))}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/constants.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/index.cjs",{"./bridge-status-controller.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/bridge-status-controller.cjs","./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/constants.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/types.cjs","./utils/transaction.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getTxMetaFields=s.BridgeStatusController=s.BridgeStatusAction=s.BridgeId=s.MAX_ATTEMPTS=s.BRIDGE_STATUS_CONTROLLER_NAME=s.DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE=s.REFRESH_INTERVAL_MS=void 0;var n=e("./constants.cjs");Object.defineProperty(s,"REFRESH_INTERVAL_MS",{enumerable:!0,get:function(){return n.REFRESH_INTERVAL_MS}}),Object.defineProperty(s,"DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE",{enumerable:!0,get:function(){return n.DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE}}),Object.defineProperty(s,"BRIDGE_STATUS_CONTROLLER_NAME",{enumerable:!0,get:function(){return n.BRIDGE_STATUS_CONTROLLER_NAME}}),Object.defineProperty(s,"MAX_ATTEMPTS",{enumerable:!0,get:function(){return n.MAX_ATTEMPTS}});var r=e("./types.cjs");Object.defineProperty(s,"BridgeId",{enumerable:!0,get:function(){return r.BridgeId}}),Object.defineProperty(s,"BridgeStatusAction",{enumerable:!0,get:function(){return r.BridgeStatusAction}});var a=e("./bridge-status-controller.cjs");Object.defineProperty(s,"BridgeStatusController",{enumerable:!0,get:function(){return a.BridgeStatusController}});var o=e("./utils/transaction.cjs");Object.defineProperty(s,"getTxMetaFields",{enumerable:!0,get:function(){return o.getTxMetaFields}})}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/types.cjs",{"./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/constants.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.BridgeStatusAction=s.BridgeId=s.BridgeClientId=void 0;e("./constants.cjs");var n,r,a;!function(e){e.EXTENSION="extension",e.MOBILE="mobile"}(n||(s.BridgeClientId=n={})),function(e){e.HOP="hop",e.CELER="celer",e.CELERCIRCLE="celercircle",e.CONNEXT="connext",e.POLYGON="polygon",e.AVALANCHE="avalanche",e.MULTICHAIN="multichain",e.AXELAR="axelar",e.ACROSS="across",e.STARGATE="stargate",e.RELAY="relay",e.MAYAN="mayan"}(r||(s.BridgeId=r={})),function(e){e.StartPollingForBridgeTxStatus="StartPollingForBridgeTxStatus",e.WipeBridgeStatus="WipeBridgeStatus",e.GetState="GetState",e.ResetState="ResetState",e.SubmitTx="SubmitTx",e.SubmitIntent="SubmitIntent",e.RestartPollingForFailedAttempts="RestartPollingForFailedAttempts",e.GetBridgeHistoryItemByTxMetaId="GetBridgeHistoryItemByTxMetaId"}(a||(s.BridgeStatusAction=a={}))}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/types.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/bridge-status.cjs",{"../constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/constants.cjs","./validators.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/validators.cjs","@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.shouldSkipFetchDueToFetchFailures=s.getStatusRequestWithSrcTxHash=s.fetchBridgeTxStatus=s.getStatusRequestDto=s.getBridgeStatusUrl=void 0;const n=e("@metamask/bridge-controller"),r=e("@metamask/superstruct"),a=e("./validators.cjs"),o=e("../constants.cjs");s.getBridgeStatusUrl=e=>`${e}/getTxStatus`;s.getStatusRequestDto=e=>{const{quote:t,...s}=e;return{...Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.toString()])),...t?.requestId?{requestId:t.requestId}:{}}};s.fetchBridgeTxStatus=async(e,t,o,i,c)=>{const l=(0,s.getStatusRequestDto)(e),d=new URLSearchParams(l),m=`${(0,s.getBridgeStatusUrl)(c)}?${d.toString()}`,u=await i(m,{headers:(0,n.getClientHeaders)({clientId:t,jwt:o})}),p=[];try{(0,a.validateBridgeStatusResponse)(u)}catch(t){t instanceof r.StructError&&t.failures().forEach(({branch:t,path:s})=>{const n=t?.[0]?.quote?.bridgeId??t?.[0]?.quote?.bridges?.[0]??u?.bridge??(e.bridge||e.bridgeId)??"unknown",r=s?.join(".")||"unknown";p.push([n,r].join("|"))})}return{status:u,validationFailures:p}};s.getStatusRequestWithSrcTxHash=(e,t)=>{const{bridgeId:s,bridges:n,srcChainId:r,destChainId:a,refuel:o}=e;return{bridgeId:s,srcTxHash:t,bridge:n[0],srcChainId:r,destChainId:a,quote:e,refuel:Boolean(o)}};s.shouldSkipFetchDueToFetchFailures=e=>{if(e){const t=o.REFRESH_INTERVAL_MS*Math.pow(2,e.counter-1);if(Date.now()-e.lastAttemptTime<t)return!0}return!1}}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/bridge-status.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/gas.cjs",{"@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","@metamask/controller-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/controller-utils/dist/index.cjs","bignumber.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/node_modules/bignumber.js/bignumber.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.calcActualGasUsed=s.calculateGasFees=s.getTxGasEstimates=void 0;const n=e("@metamask/bridge-controller"),r=e("@metamask/controller-utils"),a=e("bignumber.js");s.getTxGasEstimates=({txGasFeeEstimates:e,networkGasFeeEstimates:t})=>{const{estimatedBaseFee:s="0"}=t;return((e,t)=>{const{maxFeePerGas:s,maxPriorityFeePerGas:r}=e?.[n.BRIDGE_PREFERRED_GAS_ESTIMATE]??{};return{baseAndPriorityFeePerGas:r?new a.BigNumber(t,10).times(10**9).plus(r,16):undefined,maxFeePerGas:s,maxPriorityFeePerGas:r}})(e,s)};s.calculateGasFees=async(e,t,n,{chainId:a,gasLimit:o,...i},c,l,d)=>{if(!e)return{};if(d)return{...d,gas:o?.toString()};const m={...i,gas:o?.toString(),data:i.data,to:i.to,value:i.value},{gasFeeEstimates:u}=t.call("GasFeeController:getState"),{estimates:p}=await n({transactionParams:m,chainId:l,networkClientId:c}),{maxFeePerGas:h,maxPriorityFeePerGas:f}=(0,s.getTxGasEstimates)({networkGasFeeEstimates:u,txGasFeeEstimates:p});return{maxFeePerGas:h,maxPriorityFeePerGas:f,gas:(0,r.toHex)(m.gas??0)}};const o=(e,t)=>e&&t?new a.BigNumber(e,16).times(new a.BigNumber(t,16)):null;s.calcActualGasUsed=({pricingData:e},t,s)=>{const n=e?.quotedGasInUsd&&e?.quotedGasAmount?new a.BigNumber(e?.quotedGasInUsd).div(e.quotedGasAmount):null,r=o(t?.gasUsed,t?.effectiveGasPrice)?.plus(o(s?.gasUsed,s?.effectiveGasPrice)??0),i=r?.div(new a.BigNumber(10).pow(18)).toString(10);return r&&i?{amount:r.toString(10),usd:n?.multipliedBy(i).toString(10)??null}:null}}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/gas.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/intent-api.cjs",{"./validators.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/validators.cjs","@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","@metamask/transaction-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/transaction-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},i=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.mapIntentOrderStatusToTransactionStatus=s.translateIntentOrderToBridgeStatus=s.IntentApiImpl=void 0;const c=e("@metamask/bridge-controller"),l=e("@metamask/transaction-controller"),d=e("./validators.cjs");s.IntentApiImpl=class{constructor(e,t,s){n.set(this,void 0),r.set(this,void 0),a.set(this,void 0),o(this,n,e,"f"),o(this,r,t,"f"),o(this,a,s,"f")}async submitIntent(e,t){const s=`${i(this,n,"f")}/submitOrder`;try{const n=await i(this,a,"f").call(this),o=await i(this,r,"f").call(this,s,{method:"POST",headers:{"Content-Type":"application/json",...(0,c.getClientHeaders)({clientId:t,jwt:n})},body:JSON.stringify(e)});if(!(0,d.validateIntentOrderResponse)(o))throw new Error("Invalid submitOrder response");return o}catch(e){if(e instanceof Error)throw new Error(`Failed to submit intent: ${e.message}`);throw new Error("Failed to submit intent")}}async getOrderStatus(e,t,s,o){const l=`${i(this,n,"f")}/getOrderStatus?orderId=${e}&aggregatorId=${encodeURIComponent(t)}&srcChainId=${s}`;try{const e=await i(this,a,"f").call(this),t=await i(this,r,"f").call(this,l,{method:"GET",headers:(0,c.getClientHeaders)({clientId:o,jwt:e})});if(!(0,d.validateIntentOrderResponse)(t))throw new Error("Invalid getOrderStatus response");return t}catch(e){if(e instanceof Error)throw new Error(`Failed to get order status: ${e.message}`);throw new Error("Failed to get order status")}}},n=new WeakMap,r=new WeakMap,a=new WeakMap;function m(e){switch(e){case d.IntentOrderStatus.PENDING:case d.IntentOrderStatus.SUBMITTED:return l.TransactionStatus.submitted;case d.IntentOrderStatus.CONFIRMED:case d.IntentOrderStatus.COMPLETED:return l.TransactionStatus.confirmed;case d.IntentOrderStatus.FAILED:case d.IntentOrderStatus.EXPIRED:case d.IntentOrderStatus.CANCELLED:return l.TransactionStatus.failed;default:return l.TransactionStatus.submitted}}s.translateIntentOrderToBridgeStatus=(e,t,s)=>{let n;switch(e.status){case d.IntentOrderStatus.CONFIRMED:case d.IntentOrderStatus.COMPLETED:n=c.StatusTypes.COMPLETE;break;case d.IntentOrderStatus.FAILED:case d.IntentOrderStatus.EXPIRED:case d.IntentOrderStatus.CANCELLED:n=c.StatusTypes.FAILED;break;case d.IntentOrderStatus.PENDING:n=c.StatusTypes.PENDING;break;case d.IntentOrderStatus.SUBMITTED:n=c.StatusTypes.SUBMITTED;break;default:n=c.StatusTypes.UNKNOWN}const r=e.txHash??s??"";return{status:{status:n,srcChain:{chainId:t,txHash:r}},txHash:r,transactionStatus:m(e.status)}},s.mapIntentOrderStatusToTransactionStatus=m}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/intent-api.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/metrics.cjs",{"./gas.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/gas.cjs","./swap-received-amount.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/swap-received-amount.cjs","@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","@metamask/transaction-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/transaction-controller/dist/index.cjs","bignumber.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/node_modules/bignumber.js/bignumber.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getEVMTxPropertiesFromTransactionMeta=s.getRequestMetadataFromHistory=s.getTradeDataFromHistory=s.getPreConfirmationPropertiesFromQuote=s.getPriceImpactFromQuote=s.getTradeDataFromQuote=s.getRequestParamFromHistory=s.getFinalizedTxProperties=s.getTxStatusesFromHistory=void 0;const n=e("@metamask/bridge-controller"),r=e("@metamask/transaction-controller"),a=e("bignumber.js"),o=e("./gas.cjs"),i=e("./swap-received-amount.cjs");s.getTxStatusesFromHistory=({status:e,hasApprovalTx:t,approvalTxId:s,quote:r})=>{const a=e.srcChain.txHash?n.StatusTypes.COMPLETE:n.StatusTypes.PENDING,o=e.destChain?.txHash?e.status:n.StatusTypes.PENDING,i=(0,n.formatChainIdToHex)(r.srcChainId),c=(0,n.isEthUsdt)(i,r.srcAsset.address),l=e.srcChain.txHash?n.StatusTypes.COMPLETE:undefined,d=e.srcChain.txHash?n.StatusTypes.COMPLETE:n.StatusTypes.PENDING;return{allowance_reset_transaction:c?l:undefined,approval_transaction:t||s?d:undefined,source_transaction:a,destination_transaction:e.status===n.StatusTypes.FAILED?n.StatusTypes.FAILED:o}};s.getFinalizedTxProperties=(e,t,s)=>{const n=s?.submittedTime??t?.submittedTime??e.startTime,c=t?.type===r.TransactionType.swap?t?.time:e.completionTime,l=(0,o.calcActualGasUsed)(e,t?.txReceipt,s?.txReceipt),d=t?.type===r.TransactionType.swap?(0,i.getActualSwapReceivedAmount)(e,l,t):(0,i.getActualBridgeReceivedAmount)(e),m=e.pricingData?.quotedGasAmount&&l?.amount?new a.BigNumber(e.pricingData.quotedGasAmount).multipliedBy(new a.BigNumber(10).pow(18)).div(l.amount).toNumber():0,u=e.pricingData?.quotedReturnInUsd&&d?.usd?new a.BigNumber(e.pricingData.quotedReturnInUsd).div(d.usd).toNumber():0;return{actual_time_minutes:c&&n?(c-n)/6e4:0,usd_actual_return:Number(d?.usd??0),usd_actual_gas:l?.usd??0,quote_vs_execution_ratio:u,quoted_vs_used_gas_ratio:m}};s.getRequestParamFromHistory=e=>({chain_id_source:(0,n.formatChainIdToCaip)(e.quote.srcChainId),token_symbol_source:e.quote.srcAsset.symbol,token_address_source:e.quote.srcAsset.assetId,chain_id_destination:(0,n.formatChainIdToCaip)(e.quote.destChainId),token_symbol_destination:e.quote.destAsset.symbol,token_address_destination:e.quote.destAsset.assetId});s.getTradeDataFromQuote=e=>({usd_quoted_gas:Number(e.gasFee?.effective?.usd??0),gas_included:e.quote.gasIncluded??!1,gas_included_7702:e.quote.gasIncluded7702??!1,provider:(0,n.formatProviderLabel)(e.quote),quoted_time_minutes:Number(e.estimatedProcessingTimeInSeconds/60),usd_quoted_return:Number(e.adjustedReturn?.usd??0)});s.getPriceImpactFromQuote=e=>({price_impact:Number(e.priceData?.priceImpact??"0")});s.getPreConfirmationPropertiesFromQuote=(e,t,r,a=n.MetaMetricsSwapsEventSource.MainView,o)=>{const{quote:i}=e;return{...(0,s.getPriceImpactFromQuote)(i),...(0,s.getTradeDataFromQuote)(e),chain_id_source:(0,n.formatChainIdToCaip)(i.srcChainId),token_symbol_source:i.srcAsset.symbol,chain_id_destination:(0,n.formatChainIdToCaip)(i.destChainId),token_symbol_destination:i.destAsset.symbol,is_hardware_wallet:r,swap_type:(0,n.getSwapType)(e.quote.srcChainId,e.quote.destChainId),usd_amount_source:Number(e.sentAmount?.usd??0),stx_enabled:t,action_type:n.MetricsActionType.SWAPBRIDGE_V1,custom_slippage:!1,location:a,...o&&Object.keys(o).length>0&&{ab_tests:o}}};s.getTradeDataFromHistory=e=>({usd_quoted_gas:Number(e.pricingData?.quotedGasInUsd??0),gas_included:e.quote.gasIncluded??!1,gas_included_7702:e.quote.gasIncluded7702??!1,provider:(0,n.formatProviderLabel)(e.quote),quoted_time_minutes:Number(e.estimatedProcessingTimeInSeconds/60),usd_quoted_return:Number(e.pricingData?.quotedReturnInUsd??0)});s.getRequestMetadataFromHistory=(e,t)=>{const{quote:s,slippagePercentage:r,isStxEnabled:a}=e;return{slippage_limit:r,custom_slippage:(0,n.isCustomSlippage)(r),usd_amount_source:Number(e.pricingData?.amountSentInUsd??0),swap_type:(0,n.getSwapType)(s.srcChainId,s.destChainId),is_hardware_wallet:(0,n.isHardwareWallet)(t),stx_enabled:a??!1,security_warnings:[]}};s.getEVMTxPropertiesFromTransactionMeta=e=>({source_transaction:[r.TransactionStatus.failed,r.TransactionStatus.dropped,r.TransactionStatus.rejected].includes(e.status)?n.StatusTypes.FAILED:n.StatusTypes.COMPLETE,error_message:e.error?.message??"",chain_id_source:(0,n.formatChainIdToCaip)(e.chainId),chain_id_destination:(0,n.formatChainIdToCaip)(e.chainId),token_symbol_source:e.sourceTokenSymbol??"",token_symbol_destination:e.destinationTokenSymbol??"",usd_amount_source:0,stx_enabled:!1,token_address_source:(0,n.formatAddressToAssetId)(e.sourceTokenAddress??"",e.chainId)??"",token_address_destination:(0,n.formatAddressToAssetId)(e.destinationTokenAddress??"",e.chainId)??"",custom_slippage:!1,is_hardware_wallet:!1,swap_type:e.type&&[r.TransactionType.swap,r.TransactionType.swapApproval].includes(e.type)?n.MetricsSwapType.SINGLE:n.MetricsSwapType.CROSSCHAIN,security_warnings:[],price_impact:0,usd_quoted_gas:0,gas_included:!1,gas_included_7702:!1,quoted_time_minutes:0,usd_quoted_return:0,provider:"",actual_time_minutes:0,quote_vs_execution_ratio:0,quoted_vs_used_gas_ratio:0,usd_actual_return:0,usd_actual_gas:0,action_type:n.MetricsActionType.SWAPBRIDGE_V1})}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/metrics.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/snaps.cjs",{uuid:"/home/runner/work/metamask-extension/metamask-extension/node_modules/uuid/dist/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.createClientTransactionRequest=void 0;const n=e("uuid");s.createClientTransactionRequest=(e,t,s,r,a)=>({snapId:e,origin:"metamask",handler:"onClientRequest",request:{id:(0,n.v4)(),jsonrpc:"2.0",method:"signAndSendTransaction",params:{transaction:t,scope:s,accountId:r,...a&&{options:a}}}})}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/snaps.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/swap-received-amount.cjs",{"@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","bignumber.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/node_modules/bignumber.js/bignumber.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getActualBridgeReceivedAmount=s.getActualSwapReceivedAmount=void 0;const n=e("@metamask/bridge-controller"),r=e("bignumber.js");s.getActualSwapReceivedAmount=(e,t,s)=>{const{pricingData:a}=e,o=e.quote.destTokenAmount;if(!s?.txReceipt)return null;const i=(0,n.isNativeAddress)(e.quote.destAsset.address)?((e,t,s)=>{const{preTxBalance:n,postTxBalance:a}=s;return n&&a&&n!==a?t&&a&&n?new r.BigNumber(a,16).minus(n,16).minus(t.amount).div(10**e.quote.destAsset.decimals):null:new r.BigNumber(e.quote.destTokenAmount).div(new r.BigNumber(10).pow(e.quote.destAsset.decimals)).toString(10)})(e,t,s):((e,t)=>{const{txReceipt:s}=t;if(!s?.logs||"0x0"===s.status)return null;const{account:n,quote:a}=e,o=s.logs.find(e=>{const t=e.topics?.[0]?.startsWith("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"),s=e.address?.toLowerCase()===a.destAsset.address?.toLowerCase(),r=e.topics?.[2]&&(e.topics[2]===n||e.topics[2].match(n?.slice(2)));return t&&s&&r});return o?.data?new r.BigNumber(o.data,16).div(new r.BigNumber(10).pow(a.destAsset.decimals)):null})(e,s),c=a?.quotedReturnInUsd&&o?new r.BigNumber(a.quotedReturnInUsd).div(o).multipliedBy(10**e.quote.destAsset.decimals):null;return{amount:i,usd:i&&c?c.multipliedBy(i):null}};s.getActualBridgeReceivedAmount=e=>{const{quote:t,pricingData:s,status:n}=e,a=s?.quotedReturnInUsd?new r.BigNumber(s.quotedReturnInUsd).div(t.destTokenAmount):null,o=n.destChain?.amount;return o&&a?{amount:o,usd:a.multipliedBy(o).toString(10)}:null}}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/swap-received-amount.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs",{"../constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/constants.cjs","./gas.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/gas.cjs","./snaps.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/snaps.cjs","@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","@metamask/controller-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/controller-utils/dist/index.cjs","@metamask/transaction-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/transaction-controller/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs",uuid:"/home/runner/work/metamask-extension/metamask-extension/node_modules/uuid/dist/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getIntentFromQuote=s.getHistoryKey=s.findAndUpdateTransactionsInBatch=s.getAddTransactionBatchParams=s.toBatchTxParams=s.rekeyHistoryItemInState=s.waitForTxConfirmation=s.getClientRequest=s.handleMobileHardwareWalletDelay=s.handleApprovalDelay=s.handleNonEvmTxResponse=s.getTxMetaFields=s.getStatusRequestParams=s.generateActionId=void 0;const n=e("@metamask/bridge-controller"),r=e("@metamask/controller-utils"),a=e("@metamask/transaction-controller"),o=e("@metamask/utils"),i=e("uuid"),c=e("./gas.cjs"),l=e("./snaps.cjs"),d=e("../constants.cjs");s.generateActionId=()=>(Date.now()+Math.random()).toString();s.getStatusRequestParams=e=>({bridgeId:e.quote.bridgeId,bridge:e.quote.bridges[0],srcChainId:e.quote.srcChainId,destChainId:e.quote.destChainId,quote:e.quote,refuel:Boolean(e.quote.refuel)});s.getTxMetaFields=(e,t)=>{let s;try{s=(0,n.formatChainIdToHex)(e.quote.destChainId)}catch{s="0x1"}return{destinationChainId:s,sourceTokenAmount:e.quote.srcTokenAmount,sourceTokenSymbol:e.quote.srcAsset.symbol,sourceTokenDecimals:e.quote.srcAsset.decimals,sourceTokenAddress:e.quote.srcAsset.address,destinationTokenAmount:e.quote.destTokenAmount,destinationTokenSymbol:e.quote.destAsset.symbol,destinationTokenDecimals:e.quote.destAsset.decimals,destinationTokenAddress:e.quote.destAsset.address,approvalTxId:t,swapTokenValue:e.sentAmount.amount}};s.handleNonEvmTxResponse=(e,t,r)=>{const o=r.address,c=r.metadata.snap?.id;let l;"string"==typeof e?l=e:e&&"object"==typeof e&&("transactionId"in e&&e.transactionId?l=e.transactionId:"result"in e&&e.result&&"object"==typeof e.result?l=e.result.signature||e.result.txid||e.result.hash||e.result.txHash:"signature"in e&&e.signature&&"string"==typeof e.signature&&(l=e.signature));const d=(0,n.isCrossChain)(t.quote.srcChainId,t.quote.destChainId);let m;try{m=(0,n.formatChainIdToHex)(t.quote.srcChainId)}catch{m="0x1"}const u=(0,n.extractTradeData)(t.trade);return{...(0,s.getTxMetaFields)(t),time:Date.now(),id:l??(0,i.v4)(),chainId:m,networkClientId:c??m,txParams:{from:o,data:u},type:d?a.TransactionType.bridge:a.TransactionType.swap,status:a.TransactionStatus.submitted,hash:l,origin:c,isSolana:!0,isBridgeTx:d}};s.handleApprovalDelay=async e=>{if([n.ChainId.LINEA,n.ChainId.BASE].includes(e)){(0,o.createProjectLogger)("bridge")("Delaying submitting bridge tx to make Linea and Base confirmation more likely");const e=new Promise(e=>setTimeout(e,d.APPROVAL_DELAY_MS));await e}};s.handleMobileHardwareWalletDelay=async e=>{if(e){const e=new Promise(e=>setTimeout(e,1e3));await e}};s.getClientRequest=(e,t,s)=>{const r=(0,n.formatChainIdToCaip)(t),a=(0,n.extractTradeData)(e),o=(0,n.isTronTrade)(e)?{visible:e.visible,type:e.raw_data?.contract?.[0]?.type}:undefined;return(0,l.createClientTransactionRequest)(s.metadata.snap?.id,a,r,s.id,o)};s.waitForTxConfirmation=async(e,t,{timeoutMs:s=3e5,pollMs:n=3e3}={})=>{const r=Date.now();for(;;){const{transactions:o}=e.call("TransactionController:getState"),i=o.find(e=>e.id===t);if(i){if(i.status===a.TransactionStatus.confirmed)return i;if(i.status===a.TransactionStatus.failed||i.status===a.TransactionStatus.dropped||i.status===a.TransactionStatus.rejected)throw new Error("Approval transaction did not confirm")}if(Date.now()-r>s)throw new Error("Timed out waiting for approval confirmation");await new Promise(e=>setTimeout(e,n))}};s.rekeyHistoryItemInState=(e,t,s)=>{const n=e.txHistory[t];return!!n&&(e.txHistory[s.id]={...n,txMetaId:s.id,originalTransactionId:n.originalTransactionId??s.id,status:{...n.status,srcChain:{...n.status.srcChain,txHash:s.hash??n.status.srcChain?.txHash}}},delete e.txHistory[t],!0)};s.toBatchTxParams=(e,{chainId:t,gasLimit:s,...n},{maxFeePerGas:a,maxPriorityFeePerGas:o,gas:i})=>{const c={...n,data:n.data,to:n.to,value:n.value};return e?{...c,gas:(0,r.toHex)(i??0),maxFeePerGas:(0,r.toHex)(a??0),maxPriorityFeePerGas:(0,r.toHex)(o??0)}:c};s.getAddTransactionBatchParams=async({messenger:e,isBridgeTx:t,approval:r,resetApproval:o,trade:i,quoteResponse:{quote:{feeData:{txFee:l},gasIncluded:d,gasIncluded7702:m,gasSponsored:u},sentAmount:p,toTokenAmount:h},requireApproval:f=!1,estimateGasFeeFn:g})=>{const k=d||m;if(!e.call("AccountsController:getAccountByAddress",i.from))throw new Error("Failed to submit cross-chain swap batch transaction: unknown account in trade data");const w=(0,n.formatChainIdToHex)(i.chainId),y=e.call("NetworkController:findNetworkClientIdByChainId",w),b=!0!==m,v=[];if(o){const n=await(0,c.calculateGasFees)(b,e,g,o,y,w,k?l:undefined);v.push({type:t?a.TransactionType.bridgeApproval:a.TransactionType.swapApproval,params:(0,s.toBatchTxParams)(b,o,n)})}if(r){const n=await(0,c.calculateGasFees)(b,e,g,r,y,w,k?l:undefined);v.push({type:t?a.TransactionType.bridgeApproval:a.TransactionType.swapApproval,params:(0,s.toBatchTxParams)(b,r,n)})}const _=await(0,c.calculateGasFees)(b,e,g,i,y,w,k?l:undefined);v.push({type:t?a.TransactionType.bridge:a.TransactionType.swap,params:(0,s.toBatchTxParams)(b,i,_),assetsFiatValues:{sending:p?.valueInCurrency?.toString(),receiving:h?.valueInCurrency?.toString()}});return{disable7702:b,isGasFeeIncluded:Boolean(m),isGasFeeSponsored:Boolean(u),networkClientId:y,requireApproval:f,origin:"metamask",from:i.from,transactions:v}};s.findAndUpdateTransactionsInBatch=({messenger:e,updateTransactionFn:t,batchId:s,txDataByType:n})=>{const r=e.call("TransactionController:getState").transactions,o={approvalMeta:undefined,tradeMeta:undefined};return Object.entries(n).forEach(([e,n])=>{const i=r.find(t=>{if(t.batchId!==s)return!1;if(Array.isArray(t.txParams.authorizationList)&&t.txParams.authorizationList.length>0||Boolean(t.delegationAddress)){if(e===a.TransactionType.swap&&t.type===a.TransactionType.batch)return!0;if(e===a.TransactionType.swapApproval&&t.txParams.data===n)return!0}return t.txParams.data===n});if(i){const s={...i,type:e};t(s,`Update tx type to ${e}`),o[[a.TransactionType.bridgeApproval,a.TransactionType.swapApproval].includes(e)?"approvalMeta":"tradeMeta"]=s}}),o},s.getHistoryKey=function(e,t){const s=e??t;if(!s)throw new Error("Cannot add tx to history: either actionId or bridgeTxMeta.id must be provided");return s},s.getIntentFromQuote=function(e){const{intent:t}=e.quote;if(!t)throw new Error("submitIntent: missing intent data");return t}}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/dist/utils/validators.cjs",{"@metamask/bridge-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-controller/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.validateIntentOrderResponse=s.IntentOrderResponseSchema=s.IntentOrderStatus=s.validateBridgeStatusResponse=s.StatusResponseSchema=void 0;const n=e("@metamask/bridge-controller"),r=e("@metamask/superstruct"),a=(0,r.number)(),o=(0,r.type)({}),i=(0,r.type)({chainId:a,txHash:(0,r.optional)((0,r.string)()),amount:(0,r.optional)((0,r.string)()),token:(0,r.optional)((0,r.union)([o,n.BridgeAssetSchema]))}),c=(0,r.type)({chainId:a,txHash:(0,r.optional)((0,r.string)()),amount:(0,r.optional)((0,r.string)()),token:(0,r.optional)((0,r.union)([o,n.BridgeAssetSchema]))}),l=(0,r.type)({});s.StatusResponseSchema=(0,r.type)({status:(0,r.enums)(Object.values(n.StatusTypes)),srcChain:i,destChain:(0,r.optional)(c),bridge:(0,r.optional)((0,r.string)()),isExpectedToken:(0,r.optional)((0,r.boolean)()),isUnrecognizedRouterAddress:(0,r.optional)((0,r.boolean)()),refuel:(0,r.optional)(l)});var d;s.validateBridgeStatusResponse=e=>((0,r.assert)(e,s.StatusResponseSchema),!0),function(e){e.PENDING="pending",e.SUBMITTED="submitted",e.CONFIRMED="confirmed",e.COMPLETED="completed",e.FAILED="failed",e.CANCELLED="cancelled",e.EXPIRED="expired"}(d||(s.IntentOrderStatus=d={})),s.IntentOrderResponseSchema=(0,r.type)({id:(0,r.string)(),status:(0,r.enums)(Object.values(d)),txHash:(0,r.optional)((0,r.string)()),metadata:(0,r.type)({txHashes:(0,r.optional)((0,r.union)([(0,r.array)((0,r.string)()),(0,r.string)()]))})});s.validateIntentOrderResponse=e=>(0,r.is)(e,s.IntentOrderResponseSchema)}}},{package:"@metamask/bridge-status-controller",file:"node_modules/@metamask/bridge-status-controller/dist/utils/validators.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/bridge-status-controller/node_modules/bignumber.js/bignumber.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){!function(e){var s,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r=Math.ceil,a=Math.floor,o="[BigNumber Error] ",i=o+"Number primitive has more than 15 significant digits: ",c=1e14,l=14,d=9007199254740991,m=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],u=1e7,p=1e9;function h(e){var t=0|e;return e>0||e===t?t:t-1}function f(e){for(var t,s,n=1,r=e.length,a=e[0]+"";n<r;){for(t=e[n++]+"",s=l-t.length;s--;t="0"+t);a+=t}for(r=a.length;48===a.charCodeAt(--r););return a.slice(0,r+1||1)}function g(e,t){var s,n,r=e.c,a=t.c,o=e.s,i=t.s,c=e.e,l=t.e;if(!o||!i)return null;if(s=r&&!r[0],n=a&&!a[0],s||n)return s?n?0:-i:o;if(o!=i)return o;if(s=o<0,n=c==l,!r||!a)return n?0:!r^s?1:-1;if(!n)return c>l^s?1:-1;for(i=(c=r.length)<(l=a.length)?c:l,o=0;o<i;o++)if(r[o]!=a[o])return r[o]>a[o]^s?1:-1;return c==l?0:c>l^s?1:-1}function k(e,t,s,n){if(e<t||e>s||e!==a(e))throw Error(o+(n||"Argument")+("number"==typeof e?e<t||e>s?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function y(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function b(e,t,s){var n,r;if(t<0){for(r=s+".";++t;r+=s);e=r+e}else if(++t>(n=e.length)){for(r=s,t-=n;--t;r+=s);e+=r}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}s=function e(t){var s,v,_,x,E,S,T,j,C,A,I=$.prototype={constructor:$,toString:null,valueOf:null},P=new $(1),O=20,D=4,M=-7,B=21,R=-1e7,N=1e7,F=!1,L=1,H=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},G="0123456789abcdefghijklmnopqrstuvwxyz",q=!0;function $(e,t){var s,r,o,c,m,u,p,h,f=this;if(!(f instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>N?f.c=f.e=null:e.e<R?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((u="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,m=e;m>=10;m/=10,c++);return void(c>N?f.c=f.e=null:(f.e=c,f.c=[e]))}h=String(e)}else{if(!n.test(h=String(e)))return _(f,h,u);f.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(c=h.indexOf("."))>-1&&(h=h.replace(".","")),(m=h.search(/e/i))>0?(c<0&&(c=m),c+=+h.slice(m+1),h=h.substring(0,m)):c<0&&(c=h.length)}else{if(k(t,2,G.length,"Base"),10==t&&q)return K(f=new $(e),O+f.e+1,D);if(h=String(e),u="number"==typeof e){if(0*e!=0)return _(f,h,u,t);if(f.s=1/e<0?(h=h.slice(1),-1):1,$.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(i+e)}else f.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(s=G.slice(0,t),c=m=0,p=h.length;m<p;m++)if(s.indexOf(r=h.charAt(m))<0){if("."==r){if(m>c){c=p;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=!0,m=-1,c=0;continue}return _(f,String(e),u,t)}u=!1,(c=(h=v(h,t,10,f.s)).indexOf("."))>-1?h=h.replace(".",""):c=h.length}for(m=0;48===h.charCodeAt(m);m++);for(p=h.length;48===h.charCodeAt(--p););if(h=h.slice(m,++p)){if(p-=m,u&&$.DEBUG&&p>15&&(e>d||e!==a(e)))throw Error(i+f.s*e);if((c=c-m-1)>N)f.c=f.e=null;else if(c<R)f.c=[f.e=0];else{if(f.e=c,f.c=[],m=(c+1)%l,c<0&&(m+=l),m<p){for(m&&f.c.push(+h.slice(0,m)),p-=l;m<p;)f.c.push(+h.slice(m,m+=l));m=l-(h=h.slice(m)).length}else m-=p;for(;m--;h+="0");f.c.push(+h)}}else f.c=[f.e=0]}function W(e,t,s,n){var r,a,o,i,c;if(null==s?s=D:k(s,0,8),!e.c)return e.toString();if(r=e.c[0],o=e.e,null==t)c=f(e.c),c=1==n||2==n&&(o<=M||o>=B)?y(c,o):b(c,o,"0");else if(a=(e=K(new $(e),t,s)).e,i=(c=f(e.c)).length,1==n||2==n&&(t<=a||a<=M)){for(;i<t;c+="0",i++);c=y(c,a)}else if(t-=o+(2===n&&a>o),c=b(c,a,"0"),a+1>i){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-i)>0)for(a+1==i&&(c+=".");t--;c+="0");return e.s<0&&r?"-"+c:c}function z(e,t){for(var s,n,r=1,a=new $(e[0]);r<e.length;r++)(!(n=new $(e[r])).s||(s=g(a,n))===t||0===s&&a.s===t)&&(a=n);return a}function V(e,t,s){for(var n=1,r=t.length;!t[--r];t.pop());for(r=t[0];r>=10;r/=10,n++);return(s=n+s*l-1)>N?e.c=e.e=null:s<R?e.c=[e.e=0]:(e.e=s,e.c=t),e}function K(e,t,s,n){var o,i,d,u,p,h,f,g=e.c,k=m;if(g){e:{for(o=1,u=g[0];u>=10;u/=10,o++);if((i=t-o)<0)i+=l,d=t,p=g[h=0],f=a(p/k[o-d-1]%10);else if((h=r((i+1)/l))>=g.length){if(!n)break e;for(;g.length<=h;g.push(0));p=f=0,o=1,d=(i%=l)-l+1}else{for(p=u=g[h],o=1;u>=10;u/=10,o++);f=(d=(i%=l)-l+o)<0?0:a(p/k[o-d-1]%10)}if(n=n||t<0||null!=g[h+1]||(d<0?p:p%k[o-d-1]),n=s<4?(f||n)&&(0==s||s==(e.s<0?3:2)):f>5||5==f&&(4==s||n||6==s&&(i>0?d>0?p/k[o-d]:0:g[h-1])%10&1||s==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=k[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(0==i?(g.length=h,u=1,h--):(g.length=h+1,u=k[l-i],g[h]=d>0?a(p/k[o-d]%k[d])*u:0),n)for(;;){if(0==h){for(i=1,d=g[0];d>=10;d/=10,i++);for(d=g[0]+=u,u=1;d>=10;d/=10,u++);i!=u&&(e.e++,g[0]==c&&(g[0]=1));break}if(g[h]+=u,g[h]!=c)break;g[h--]=0,u=1}for(i=g.length;0===g[--i];g.pop());}e.e>N?e.c=e.e=null:e.e<R&&(e.c=[e.e=0])}return e}function J(e){var t,s=e.e;return null===s?e.toString():(t=f(e.c),t=s<=M||s>=B?y(t,s):b(t,s,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,s;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(k(s=e[t],0,p,t),O=s),e.hasOwnProperty(t="ROUNDING_MODE")&&(k(s=e[t],0,8,t),D=s),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((s=e[t])&&s.pop?(k(s[0],-p,0,t),k(s[1],0,p,t),M=s[0],B=s[1]):(k(s,-p,p,t),M=-(B=s<0?-s:s))),e.hasOwnProperty(t="RANGE"))if((s=e[t])&&s.pop)k(s[0],-p,-1,t),k(s[1],1,p,t),R=s[0],N=s[1];else{if(k(s,-p,p,t),!s)throw Error(o+t+" cannot be zero: "+s);R=-(N=s<0?-s:s)}if(e.hasOwnProperty(t="CRYPTO")){if((s=e[t])!==!!s)throw Error(o+t+" not true or false: "+s);if(s){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw F=!s,Error(o+"crypto unavailable");F=s}else F=s}if(e.hasOwnProperty(t="MODULO_MODE")&&(k(s=e[t],0,9,t),L=s),e.hasOwnProperty(t="POW_PRECISION")&&(k(s=e[t],0,p,t),H=s),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(s=e[t]))throw Error(o+t+" not an object: "+s);U=s}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(s=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(s))throw Error(o+t+" invalid: "+s);q="0123456789"==s.slice(0,10),G=s}}return{DECIMAL_PLACES:O,ROUNDING_MODE:D,EXPONENTIAL_AT:[M,B],RANGE:[R,N],CRYPTO:F,MODULO_MODE:L,POW_PRECISION:H,FORMAT:U,ALPHABET:G}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,s,n=e.c,r=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&r>=-p&&r<=p&&r===a(r)){if(0===n[0]){if(0===r&&1===n.length)return!0;break e}if((t=(r+1)%l)<1&&(t+=l),String(n[0]).length==t){for(t=0;t<n.length;t++)if((s=n[t])<0||s>=c||s!==a(s))break e;if(0!==s)return!0}}}else if(null===n&&null===r&&(null===i||1===i||-1===i))return!0;throw Error(o+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,-1)},$.minimum=$.min=function(){return z(arguments,1)},$.random=(x=9007199254740992,E=Math.random()*x&2097151?function(){return a(Math.random()*x)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,s,n,i,c,d=0,u=[],h=new $(P);if(null==e?e=O:k(e,0,p),i=r(e/l),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));d<i;)(c=131072*t[d]+(t[d+1]>>>11))>=9e15?(s=crypto.getRandomValues(new Uint32Array(2)),t[d]=s[0],t[d+1]=s[1]):(u.push(c%1e14),d+=2);d=i/2}else{if(!crypto.randomBytes)throw F=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(i*=7);d<i;)(c=281474976710656*(31&t[d])+1099511627776*t[d+1]+4294967296*t[d+2]+16777216*t[d+3]+(t[d+4]<<16)+(t[d+5]<<8)+t[d+6])>=9e15?crypto.randomBytes(7).copy(t,d):(u.push(c%1e14),d+=7);d=i/7}if(!F)for(;d<i;)(c=E())<9e15&&(u[d++]=c%1e14);for(i=u[--d],e%=l,i&&e&&(c=m[l-e],u[d]=a(i/c)*c);0===u[d];u.pop(),d--);if(d<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=l);for(d=1,c=u[0];c>=10;c/=10,d++);d<l&&(n-=l-d)}return h.e=n,h.c=u,h}),$.sum=function(){for(var e=1,t=arguments,s=new $(t[0]);e<t.length;)s=s.plus(t[e++]);return s},v=function(){var e="0123456789";function t(e,t,s,n){for(var r,a,o=[0],i=0,c=e.length;i<c;){for(a=o.length;a--;o[a]*=t);for(o[0]+=n.indexOf(e.charAt(i++)),r=0;r<o.length;r++)o[r]>s-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/s|0,o[r]%=s)}return o.reverse()}return function(n,r,a,o,i){var c,l,d,m,u,p,h,g,k=n.indexOf("."),w=O,y=D;for(k>=0&&(m=H,H=0,n=n.replace(".",""),p=(g=new $(r)).pow(n.length-k),H=m,g.c=t(b(f(p.c),p.e,"0"),10,a,e),g.e=g.c.length),d=m=(h=t(n,r,a,i?(c=G,e):(c=e,G))).length;0==h[--m];h.pop());if(!h[0])return c.charAt(0);if(k<0?--d:(p.c=h,p.e=d,p.s=o,h=(p=s(p,g,w,y,a)).c,u=p.r,d=p.e),k=h[l=d+w+1],m=a/2,u=u||l<0||null!=h[l+1],u=y<4?(null!=k||u)&&(0==y||y==(p.s<0?3:2)):k>m||k==m&&(4==y||u||6==y&&1&h[l-1]||y==(p.s<0?8:7)),l<1||!h[0])n=u?b(c.charAt(1),-w,c.charAt(0)):c.charAt(0);else{if(h.length=l,u)for(--a;++h[--l]>a;)h[l]=0,l||(++d,h=[1].concat(h));for(m=h.length;!h[--m];);for(k=0,n="";k<=m;n+=c.charAt(h[k++]));n=b(n,d,c.charAt(0))}return n}}(),s=function(){function e(e,t,s){var n,r,a,o,i=0,c=e.length,l=t%u,d=t/u|0;for(e=e.slice();c--;)i=((r=l*(a=e[c]%u)+(n=d*a+(o=e[c]/u|0)*l)%u*u+i)/s|0)+(n/u|0)+d*o,e[c]=r%s;return i&&(e=[i].concat(e)),e}function t(e,t,s,n){var r,a;if(s!=n)a=s>n?1:-1;else for(r=a=0;r<s;r++)if(e[r]!=t[r]){a=e[r]>t[r]?1:-1;break}return a}function s(e,t,s,n){for(var r=0;s--;)e[s]-=r,r=e[s]<t[s]?1:0,e[s]=r*n+e[s]-t[s];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,r,o,i,d){var m,u,p,f,g,k,w,y,b,v,_,x,E,S,T,j,C,A=n.s==r.s?1:-1,I=n.c,P=r.c;if(!(I&&I[0]&&P&&P[0]))return new $(n.s&&r.s&&(I?!P||I[0]!=P[0]:P)?I&&0==I[0]||!P?0*A:A/0:NaN);for(b=(y=new $(A)).c=[],A=o+(u=n.e-r.e)+1,d||(d=c,u=h(n.e/l)-h(r.e/l),A=A/l|0),p=0;P[p]==(I[p]||0);p++);if(P[p]>(I[p]||0)&&u--,A<0)b.push(1),f=!0;else{for(S=I.length,j=P.length,p=0,A+=2,(g=a(d/(P[0]+1)))>1&&(P=e(P,g,d),I=e(I,g,d),j=P.length,S=I.length),E=j,_=(v=I.slice(0,j)).length;_<j;v[_++]=0);C=P.slice(),C=[0].concat(C),T=P[0],P[1]>=d/2&&T++;do{if(g=0,(m=t(P,v,j,_))<0){if(x=v[0],j!=_&&(x=x*d+(v[1]||0)),(g=a(x/T))>1)for(g>=d&&(g=d-1),w=(k=e(P,g,d)).length,_=v.length;1==t(k,v,w,_);)g--,s(k,j<w?C:P,w,d),w=k.length,m=1;else 0==g&&(m=g=1),w=(k=P.slice()).length;if(w<_&&(k=[0].concat(k)),s(v,k,_,d),_=v.length,-1==m)for(;t(P,v,j,_)<1;)g++,s(v,j<_?C:P,_,d),_=v.length}else 0===m&&(g++,v=[0]);b[p++]=g,v[0]?v[_++]=I[E]||0:(v=[I[E]],_=1)}while((E++<S||null!=v[0])&&A--);f=null!=v[0],b[0]||b.splice(0,1)}if(d==c){for(p=1,A=b[0];A>=10;A/=10,p++);K(y,o+(y.e=p+u*l-1)+1,i,f)}else y.e=u,y.r=+f;return y}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,j=/^\.([^.]+)$/,C=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g,_=function(e,t,s,n){var r,a=s?t:t.replace(A,"");if(C.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!s&&(a=a.replace(S,function(e,t,s){return r="x"==(s=s.toLowerCase())?16:"b"==s?2:8,n&&n!=r?e:t}),n&&(r=n,a=a.replace(T,"$1").replace(j,"0.$1")),t!=a))return new $(a,r);if($.DEBUG)throw Error(o+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},I.absoluteValue=I.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},I.comparedTo=function(e,t){return g(this,new $(e,t))},I.decimalPlaces=I.dp=function(e,t){var s,n,r,a=this;if(null!=e)return k(e,0,p),null==t?t=D:k(t,0,8),K(new $(a),e+a.e+1,t);if(!(s=a.c))return null;if(n=((r=s.length-1)-h(this.e/l))*l,r=s[r])for(;r%10==0;r/=10,n--);return n<0&&(n=0),n},I.dividedBy=I.div=function(e,t){return s(this,new $(e,t),O,D)},I.dividedToIntegerBy=I.idiv=function(e,t){return s(this,new $(e,t),0,1)},I.exponentiatedBy=I.pow=function(e,t){var s,n,i,c,d,m,u,p,h=this;if((e=new $(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+J(e));if(null!=t&&(t=new $(t)),d=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new $(Math.pow(+J(h),d?e.s*(2-w(e)):+J(e))),t?p.mod(t):p;if(m=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!m&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&w(e)?-0:0,h.e>-1&&(c=1/c),new $(m?1/c:c);H&&(c=r(H/l+2))}for(d?(s=new $(.5),m&&(e.s=1),u=w(e)):u=(i=Math.abs(+J(e)))%2,p=new $(P);;){if(u){if(!(p=p.times(h)).c)break;c?p.c.length>c&&(p.c.length=c):n&&(p=p.mod(t))}if(i){if(0===(i=a(i/2)))break;u=i%2}else if(K(e=e.times(s),e.e+1,1),e.e>14)u=w(e);else{if(0===(i=+J(e)))break;u=i%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):n&&(h=h.mod(t))}return n?p:(m&&(p=P.div(p)),t?p.mod(t):c?K(p,H,D,undefined):p)},I.integerValue=function(e){var t=new $(this);return null==e?e=D:k(e,0,8),K(t,t.e+1,e)},I.isEqualTo=I.eq=function(e,t){return 0===g(this,new $(e,t))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(e,t){return g(this,new $(e,t))>0},I.isGreaterThanOrEqualTo=I.gte=function(e,t){return 1===(t=g(this,new $(e,t)))||0===t},I.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},I.isLessThan=I.lt=function(e,t){return g(this,new $(e,t))<0},I.isLessThanOrEqualTo=I.lte=function(e,t){return-1===(t=g(this,new $(e,t)))||0===t},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(e,t){var s,n,r,a,o=this,i=o.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,o.plus(e);var d=o.e/l,m=e.e/l,u=o.c,p=e.c;if(!d||!m){if(!u||!p)return u?(e.s=-t,e):new $(p?o:NaN);if(!u[0]||!p[0])return p[0]?(e.s=-t,e):new $(u[0]?o:3==D?-0:0)}if(d=h(d),m=h(m),u=u.slice(),i=d-m){for((a=i<0)?(i=-i,r=u):(m=d,r=p),r.reverse(),t=i;t--;r.push(0));r.reverse()}else for(n=(a=(i=u.length)<(t=p.length))?i:t,i=t=0;t<n;t++)if(u[t]!=p[t]){a=u[t]<p[t];break}if(a&&(r=u,u=p,p=r,e.s=-e.s),(t=(n=p.length)-(s=u.length))>0)for(;t--;u[s++]=0);for(t=c-1;n>i;){if(u[--n]<p[n]){for(s=n;s&&!u[--s];u[s]=t);--u[s],u[n]+=c}u[n]-=p[n]}for(;0==u[0];u.splice(0,1),--m);return u[0]?V(e,u,m):(e.s=3==D?-1:1,e.c=[e.e=0],e)},I.modulo=I.mod=function(e,t){var n,r,a=this;return e=new $(e,t),!a.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||a.c&&!a.c[0]?new $(a):(9==L?(r=e.s,e.s=1,n=s(a,e,0,3),e.s=r,n.s*=r):n=s(a,e,0,L),(e=a.minus(n.times(e))).c[0]||1!=L||(e.s=a.s),e)},I.multipliedBy=I.times=function(e,t){var s,n,r,a,o,i,d,m,p,f,g,k,w,y,b,v=this,_=v.c,x=(e=new $(e,t)).c;if(!(_&&x&&_[0]&&x[0]))return!v.s||!e.s||_&&!_[0]&&!x||x&&!x[0]&&!_?e.c=e.e=e.s=null:(e.s*=v.s,_&&x?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=h(v.e/l)+h(e.e/l),e.s*=v.s,(d=_.length)<(f=x.length)&&(w=_,_=x,x=w,r=d,d=f,f=r),r=d+f,w=[];r--;w.push(0));for(y=c,b=u,r=f;--r>=0;){for(s=0,g=x[r]%b,k=x[r]/b|0,a=r+(o=d);a>r;)s=((m=g*(m=_[--o]%b)+(i=k*m+(p=_[o]/b|0)*g)%b*b+w[a]+s)/y|0)+(i/b|0)+k*p,w[a--]=m%y;w[a]=s}return s?++n:w.splice(0,1),V(e,w,n)},I.negated=function(){var e=new $(this);return e.s=-e.s||null,e},I.plus=function(e,t){var s,n=this,r=n.s;if(t=(e=new $(e,t)).s,!r||!t)return new $(NaN);if(r!=t)return e.s=-t,n.minus(e);var a=n.e/l,o=e.e/l,i=n.c,d=e.c;if(!a||!o){if(!i||!d)return new $(r/0);if(!i[0]||!d[0])return d[0]?e:new $(i[0]?n:0*r)}if(a=h(a),o=h(o),i=i.slice(),r=a-o){for(r>0?(o=a,s=d):(r=-r,s=i),s.reverse();r--;s.push(0));s.reverse()}for((r=i.length)-(t=d.length)<0&&(s=d,d=i,i=s,t=r),r=0;t;)r=(i[--t]=i[t]+d[t]+r)/c|0,i[t]=c===i[t]?0:i[t]%c;return r&&(i=[r].concat(i),++o),V(e,i,o)},I.precision=I.sd=function(e,t){var s,n,r,a=this;if(null!=e&&e!==!!e)return k(e,1,p),null==t?t=D:k(t,0,8),K(new $(a),e,t);if(!(s=a.c))return null;if(n=(r=s.length-1)*l+1,r=s[r]){for(;r%10==0;r/=10,n--);for(r=s[0];r>=10;r/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},I.shiftedBy=function(e){return k(e,-9007199254740991,d),this.times("1e"+e)},I.squareRoot=I.sqrt=function(){var e,t,n,r,a,o=this,i=o.c,c=o.s,l=o.e,d=O+4,m=new $("0.5");if(1!==c||!i||!i[0])return new $(!c||c<0&&(!i||i[0])?NaN:i?o:1/0);if(0==(c=Math.sqrt(+J(o)))||c==1/0?(((t=f(i)).length+l)%2==0&&(t+="0"),c=Math.sqrt(+t),l=h((l+1)/2)-(l<0||l%2),n=new $(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new $(c+""),n.c[0])for((c=(l=n.e)+d)<3&&(c=0);;)if(a=n,n=m.times(a.plus(s(o,a,d,1))),f(a.c).slice(0,c)===(t=f(n.c)).slice(0,c)){if(n.e<l&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+O+2,1),e=!n.times(n).eq(o));break}if(!r&&(K(a,a.e+O+2,0),a.times(a).eq(o))){n=a;break}d+=4,c+=4,r=1}return K(n,n.e+O+1,D,e)},I.toExponential=function(e,t){return null!=e&&(k(e,0,p),e++),W(this,e,t,1)},I.toFixed=function(e,t){return null!=e&&(k(e,0,p),e=e+this.e+1),W(this,e,t)},I.toFormat=function(e,t,s){var n,r=this;if(null==s)null!=e&&t&&"object"==typeof t?(s=t,t=null):e&&"object"==typeof e?(s=e,e=t=null):s=U;else if("object"!=typeof s)throw Error(o+"Argument not an object: "+s);if(n=r.toFixed(e,t),r.c){var a,i=n.split("."),c=+s.groupSize,l=+s.secondaryGroupSize,d=s.groupSeparator||"",m=i[0],u=i[1],p=r.s<0,h=p?m.slice(1):m,f=h.length;if(l&&(a=c,c=l,l=a,f-=a),c>0&&f>0){for(a=f%c||c,m=h.substr(0,a);a<f;a+=c)m+=d+h.substr(a,c);l>0&&(m+=d+h.slice(a)),p&&(m="-"+m)}n=u?m+(s.decimalSeparator||"")+((l=+s.fractionGroupSize)?u.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(s.fractionGroupSeparator||"")):u):m}return(s.prefix||"")+n+(s.suffix||"")},I.toFraction=function(e){var t,n,r,a,i,c,d,u,p,h,g,k,w=this,y=w.c;if(null!=e&&(!(d=new $(e)).isInteger()&&(d.c||1!==d.s)||d.lt(P)))throw Error(o+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+J(d));if(!y)return new $(w);for(t=new $(P),p=n=new $(P),r=u=new $(P),k=f(y),i=t.e=k.length-w.e-1,t.c[0]=m[(c=i%l)<0?l+c:c],e=!e||d.comparedTo(t)>0?i>0?t:p:d,c=N,N=1/0,d=new $(k),u.c[0]=0;h=s(d,t,0,1),1!=(a=n.plus(h.times(r))).comparedTo(e);)n=r,r=a,p=u.plus(h.times(a=p)),u=a,t=d.minus(h.times(a=t)),d=a;return a=s(e.minus(n),r,0,1),u=u.plus(a.times(p)),n=n.plus(a.times(r)),u.s=p.s=w.s,g=s(p,r,i*=2,D).minus(w).abs().comparedTo(s(u,n,i,D).minus(w).abs())<1?[p,r]:[u,n],N=c,g},I.toNumber=function(){return+J(this)},I.toPrecision=function(e,t){return null!=e&&k(e,1,p),W(this,e,t,2)},I.toString=function(e){var t,s=this,n=s.s,r=s.e;return null===r?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=r<=M||r>=B?y(f(s.c),r):b(f(s.c),r,"0"):10===e&&q?t=b(f((s=K(new $(s),O+r+1,D)).c),s.e,"0"):(k(e,2,G.length,"Base"),t=v(b(f(s.c),r,"0"),10,e,n,!0)),n<0&&s.c[0]&&(t="-"+t)),t},I.valueOf=I.toJSON=function(){return J(this)},I._isBigNumber=!0,null!=t&&$.set(t),$}(),s.default=s.BigNumber=s,"function"==typeof define&&define.amd?define(function(){return s}):void 0!==t&&t.exports?t.exports=s:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=s)}(this)}}},{package:"@metamask/bridge-status-controller>bignumber.js",file:"node_modules/@metamask/bridge-status-controller/node_modules/bignumber.js/bignumber.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/browser-passworder/dist/index.js",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs",buffer:"/home/runner/work/metamask-extension/metamask-extension/node_modules/browserify/node_modules/buffer/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){(function(t){(function(){Object.defineProperty(s,"__esModule",{value:!0}),s.isVaultUpdated=s.updateVaultWithDetail=s.updateVault=s.generateSalt=s.serializeBufferForStorage=s.serializeBufferFromStorage=s.keyFromPassword=s.exportKey=s.importKey=s.decryptWithKey=s.decryptWithDetail=s.decrypt=s.encryptWithKey=s.encryptWithDetail=s.encrypt=void 0;const n=e("@metamask/utils"),r="jwk",a="AES-GCM",o="utf-8",i={algorithm:"PBKDF2",params:{iterations:1e4}},c={algorithm:"PBKDF2",params:{iterations:9e5}};async function l(e,t,s,n=g(),r=c){const a=s||await f(e,n,!1,r),o=await m(a,t);return o.salt=n,JSON.stringify(o)}async function d(e,t,s=g(),n=c){const r=await f(e,s,!0,n),a=await h(r);return{vault:await l(e,t,r,s),exportedKeyString:a}}async function m(e,s){const n=JSON.stringify(s),r=t.from(n,o),i=globalThis.crypto.getRandomValues(new Uint8Array(16)),c=y(e),l=await globalThis.crypto.subtle.encrypt({name:a,iv:i},c,r),d=new Uint8Array(l),m=t.from(i).toString("base64"),u={data:t.from(d).toString("base64"),iv:m};return k(e)&&(u.keyMetadata=e.derivationOptions),u}async function u(e,t,s){const n=JSON.parse(t),{salt:r,keyMetadata:a}=n,o=y(s||await f(e,r,!1,a));return await p(o,n)}async function p(e,s){const n=t.from(s.data,"base64"),r=t.from(s.iv,"base64"),i=y(e);let c;try{const e=await crypto.subtle.decrypt({name:a,iv:r},i,n),s=new Uint8Array(e),l=t.from(s).toString(o);c=JSON.parse(l)}catch(e){throw new Error("Incorrect password")}return c}async function h(e){return k(e)?JSON.stringify({key:await globalThis.crypto.subtle.exportKey(r,e.key),derivationOptions:e.derivationOptions}):JSON.stringify(await globalThis.crypto.subtle.exportKey(r,e))}async function f(e,s,n=!1,r=i){const c=t.from(e,o),l=t.from(s,"base64"),d=await globalThis.crypto.subtle.importKey("raw",c,{name:"PBKDF2"},!1,["deriveBits","deriveKey"]),m=await globalThis.crypto.subtle.deriveKey({name:"PBKDF2",salt:l,iterations:r.params.iterations,hash:"SHA-256"},d,{name:a,length:256},n,["encrypt","decrypt"]);return r?{key:m,derivationOptions:r}:m}function g(e=32){const t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);return btoa(String.fromCharCode.apply(null,t))}function k(e){return(0,n.isPlainObject)(e)&&(0,n.hasProperty)(e,"key")&&(0,n.hasProperty)(e,"derivationOptions")&&e.key instanceof CryptoKey&&w(e.derivationOptions)}function w(e){return(0,n.isPlainObject)(e)&&(0,n.hasProperty)(e,"algorithm")&&(0,n.hasProperty)(e,"params")}function y(e){return k(e)?e.key:e}function b(e,t=c){const{keyMetadata:s}=JSON.parse(e);return w(s)&&s.algorithm===t.algorithm&&s.params.iterations===t.params.iterations}s.encrypt=l,s.encryptWithDetail=d,s.encryptWithKey=m,s.decrypt=u,s.decryptWithDetail=async function(e,t){const s=JSON.parse(t),{salt:n,keyMetadata:r}=s,a=await f(e,n,!0,r);return{exportedKeyString:await h(a),vault:await u(e,t,a),salt:n}},s.decryptWithKey=p,s.importKey=async function(e){const t=JSON.parse(e);return s=t,(0,n.isPlainObject)(s)&&(0,n.hasProperty)(s,"key")&&(0,n.hasProperty)(s,"derivationOptions")&&w(s.derivationOptions)?{key:await globalThis.crypto.subtle.importKey(r,t.key,a,!0,["encrypt","decrypt"]),derivationOptions:t.derivationOptions}:await globalThis.crypto.subtle.importKey(r,t,a,!0,["encrypt","decrypt"]);var s},s.exportKey=h,s.keyFromPassword=f,s.serializeBufferFromStorage=function(e){const t="0x"===e.slice(0,2)?e.slice(2):e,s=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2){const n=t.substr(e,2);s[e/2]=parseInt(n,16)}return s},s.serializeBufferForStorage=function(e){let t="0x";return e.forEach(e=>{t+=function(e){let t=e.toString(16);for(;t.length<2;)t=`0${t}`;return t}(e)}),t},s.generateSalt=g,s.updateVault=async function(e,t,s=c){return b(e,s)?e:l(t,await u(t,e),undefined,undefined,s)},s.updateVaultWithDetail=async function(e,t,s=c){return b(e.vault,s)?e:d(t,await u(t,e.vault),undefined,s)},s.isVaultUpdated=b}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/browser-passworder",file:"node_modules/@metamask/browser-passworder/dist/index.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/DelegationController.cjs",{"./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/constants.cjs","./utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/utils.cjs","@metamask/base-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/base-controller/dist/index.cjs","@metamask/keyring-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/keyring-controller/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},o=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.DelegationController=s.controllerName=void 0;const i=e("@metamask/base-controller"),c=e("@metamask/keyring-controller"),l=e("@metamask/utils"),d=e("./constants.cjs"),m=e("./utils.cjs");s.controllerName="DelegationController";const u={delegations:{includeInStateLogs:!1,persist:!0,includeInDebugSnapshot:!1,usedInUi:!1}};class p extends i.BaseController{constructor({messenger:e,state:t,hashDelegation:o,getDelegationEnvironment:i}){super({messenger:e,metadata:u,name:s.controllerName,state:{delegations:{},...t}}),n.set(this,void 0),r.set(this,void 0),a(this,n,o,"f"),a(this,r,i,"f")}async signDelegation(e){const{delegation:t,chainId:s}=e,{DelegationManager:n}=o(this,r,"f").call(this,s),a=(0,m.createTypedMessageParams)({chainId:(0,l.hexToNumber)(s),from:t.delegator,delegation:{...t,signature:"0x"},verifyingContract:n});return await this.messenger.call("KeyringController:signTypedMessage",a,c.SignTypedDataVersion.V4)}store(e){const{entry:t}=e,s=o(this,n,"f").call(this,t.delegation);if(!(0,m.isHexEqual)(t.delegation.authority,d.ROOT_AUTHORITY)&&!this.state.delegations[t.delegation.authority])throw new Error("Invalid authority");this.update(e=>{e.delegations[s]=t})}list(e){const t=this.messenger.call("AccountsController:getSelectedAccount").address;let s=Object.values(this.state.delegations);e?.from&&(s=s.filter(t=>(0,m.isHexEqual)(t.delegation.delegator,e.from))),(!e?.from||e?.from&&!(0,m.isHexEqual)(e.from,t))&&(s=s.filter(e=>(0,m.isHexEqual)(e.delegation.delegate,t)));const n=e?.chainId;n&&(s=s.filter(e=>(0,m.isHexEqual)(e.chainId,n)));const r=e?.tags;return r&&r.length>0&&(s=s.filter(e=>r.every(t=>e.tags.includes(t)))),s}retrieve(e){return this.state.delegations[e]??null}chain(e){const t=[],s=this.retrieve(e);if(!s)return null;t.push(s);for(let e=s.delegation.authority;e!==d.ROOT_AUTHORITY;){const s=this.retrieve(e);if(!s)throw new Error("Invalid delegation chain");t.push(s),e=s.delegation.authority}return t}delete(e){if(!this.retrieve(e))return 0;const t=Object.entries(this.state.delegations),s=[e],n=[];for(;s.length>0;){const e=s.pop();t.filter(([t,s])=>s.delegation.authority===e).forEach(([e])=>{s.push(e)}),n.push(e)}return this.update(e=>{n.forEach(t=>{delete e.delegations[t]})}),n.length}}s.DelegationController=p,n=new WeakMap,r=new WeakMap}}},{package:"@metamask/delegation-controller",file:"node_modules/@metamask/delegation-controller/dist/DelegationController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/constants.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.SIGNABLE_DELEGATION_TYPED_DATA=s.ROOT_AUTHORITY=void 0,s.ROOT_AUTHORITY="0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";s.SIGNABLE_DELEGATION_TYPED_DATA={EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Caveat:[{name:"enforcer",type:"address"},{name:"terms",type:"bytes"}],Delegation:[{name:"delegate",type:"address"},{name:"delegator",type:"address"},{name:"authority",type:"bytes32"},{name:"caveats",type:"Caveat[]"},{name:"salt",type:"uint256"}]}}}},{package:"@metamask/delegation-controller",file:"node_modules/@metamask/delegation-controller/dist/constants.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/index.cjs",{"./DelegationController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/DelegationController.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.DelegationController=void 0;var n=e("./DelegationController.cjs");Object.defineProperty(s,"DelegationController",{enumerable:!0,get:function(){return n.DelegationController}})}}},{package:"@metamask/delegation-controller",file:"node_modules/@metamask/delegation-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/utils.cjs",{"./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-controller/dist/constants.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.createTypedMessageParams=s.toDelegationStruct=s.isHexEqual=void 0;const n=e("@metamask/utils"),r=e("./constants.cjs");s.isHexEqual=function(e,t){return e.toLowerCase()===t.toLowerCase()};s.toDelegationStruct=e=>{const t=e.caveats.map(e=>({enforcer:(0,n.getChecksumAddress)(e.enforcer),terms:e.terms,args:e.args})),s="0x"===e.salt?0n:BigInt(e.salt);return{delegate:(0,n.getChecksumAddress)(e.delegate),delegator:(0,n.getChecksumAddress)(e.delegator),authority:e.authority,caveats:t,salt:s,signature:e.signature}},s.createTypedMessageParams=function(e){const{chainId:t,from:n,delegation:a,verifyingContract:o}=e;return{data:{types:r.SIGNABLE_DELEGATION_TYPED_DATA,primaryType:"Delegation",domain:{chainId:t,name:"DelegationManager",version:"1",verifyingContract:o},message:(0,s.toDelegationStruct)(a)},from:n}}}}},{package:"@metamask/delegation-controller",file:"node_modules/@metamask/delegation-controller/dist/utils.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-deployments/dist/index.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0});var n={DelegationManager:"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3",EntryPoint:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",SimpleFactory:"0x69Aa2f9fe1572F1B640E1bbc512f5c3a734fc77c",MultiSigDeleGatorImpl:"0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7",HybridDeleGatorImpl:"0x48dBe696A4D990079e039489bA2053B36E8FFEC4",EIP7702StatelessDeleGatorImpl:"0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B",AllowedCalldataEnforcer:"0xc2b0d624c1c4319760C96503BA27C347F3260f55",AllowedMethodsEnforcer:"0x2c21fD0Cb9DC8445CB3fb0DC5E7Bb0Aca01842B5",AllowedTargetsEnforcer:"0x7F20f61b1f09b08D970938F6fa563634d65c4EeB",BlockNumberEnforcer:"0x5d9818dF0AE3f66e9c3D0c5029DAF99d1823ca6c",DeployedEnforcer:"0x24ff2AA430D53a8CD6788018E902E098083dcCd2",ERC20BalanceChangeEnforcer:"0xcdF6aB796408598Cea671d79506d7D48E97a5437",ERC20TransferAmountEnforcer:"0xf100b0819427117EcF76Ed94B358B1A5b5C6D2Fc",ERC20PeriodTransferEnforcer:"0x474e3Ae7E169e940607cC624Da8A15Eb120139aB",ERC20StreamingEnforcer:"0x56c97aE02f233B29fa03502Ecc0457266d9be00e",ERC721BalanceChangeEnforcer:"0x8aFdf96eDBbe7e1eD3f5Cd89C7E084841e12A09e",ERC721TransferEnforcer:"0x3790e6B7233f779b09DA74C72b6e94813925b9aF",ERC1155BalanceChangeEnforcer:"0x63c322732695cAFbbD488Fc6937A0A7B66fC001A",ExactCalldataBatchEnforcer:"0x982FD5C86BBF425d7d1451f974192d4525113DfD",ExactCalldataEnforcer:"0x99F2e9bF15ce5eC84685604836F71aB835DBBdED",ExactExecutionBatchEnforcer:"0x1e141e455d08721Dd5BCDA1BaA6Ea5633Afd5017",ExactExecutionEnforcer:"0x146713078D39eCC1F5338309c28405ccf85Abfbb",IdEnforcer:"0xC8B5D93463c893401094cc70e66A206fb5987997",LimitedCallsEnforcer:"0x04658B29F6b82ed55274221a06Fc97D318E25416",NativeBalanceChangeEnforcer:"0xbD7B277507723490Cd50b12EaaFe87C616be6880",ArgsEqualityCheckEnforcer:"0x44B8C6ae3C304213c3e298495e12497Ed3E56E41",NativeTokenPaymentEnforcer:"0x4803a326ddED6dDBc60e659e5ed12d85c7582811",NativeTokenTransferAmountEnforcer:"0xF71af580b9c3078fbc2BBF16FbB8EEd82b330320",NativeTokenStreamingEnforcer:"0xD10b97905a320b13a0608f7E9cC506b56747df19",NativeTokenPeriodTransferEnforcer:"0x9BC0FAf4Aca5AE429F4c06aEEaC517520CB16BD9",NonceEnforcer:"0xDE4f2FAC4B3D87A1d9953Ca5FC09FCa7F366254f",OwnershipTransferEnforcer:"0x7EEf9734E7092032B5C56310Eb9BbD1f4A524681",RedeemerEnforcer:"0xE144b0b2618071B4E56f746313528a669c7E65c5",SpecificActionERC20TransferBatchEnforcer:"0x6649b61c873F6F9686A1E1ae9ee98aC380c7bA13",TimestampEnforcer:"0x1046bb45C8d673d4ea75321280DB34899413c069",ValueLteEnforcer:"0x92Bf12322527cAA612fd31a0e810472BBB106A8F",MultiTokenPeriodEnforcer:"0xFB2f1a9BD76d3701B730E5d69C3219D42D80eBb7"},r={DelegationManager:"0x56D56e07e3d6Ee5a24e30203A37a0a460f42D7A3",EntryPoint:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",SimpleFactory:"0x6ff518884f21168c30c58CB21184D6AdBC18Ad90",MultiSigDeleGatorImpl:"0xd1f421EDbA5e3FA9efe3874827114b20C5BEC40C",HybridDeleGatorImpl:"0x941f3a016F8726d5643Ce62452d0D78492D42b42",AllowedCalldataEnforcer:"0xff71d60f3208469cBCE0859717B5198042DCB3F3",AllowedMethodsEnforcer:"0xe32C2561792e8446Abe73B9f557B881C13906186",AllowedTargetsEnforcer:"0x06aaE4c67EEA95277c46Bf79b1583d4a01772D22",BlockNumberEnforcer:"0x8E470D2Ae278457b42d2405E0B8Cd4BE21Ed9045",DeployedEnforcer:"0xf9088f013dBD9ebb7Cebd66fEB48253c6Ac5a820",ERC20BalanceGteEnforcer:"0xB7B6f32ec6343261D814e55Ed8C5925d91Cab861",ERC20TransferAmountEnforcer:"0x9A069b18032B31429A363AeCFb1B6A0564b44471",IdEnforcer:"0x91015c3b9D9523966eD2399885e5Df7A567f916c",LimitedCallsEnforcer:"0xe694bFfffEA3E85923b1210b37e6a0175e910863",NonceEnforcer:"0xE83BCFD8bBE672A96747e831050a91cf44F4F87A",TimestampEnforcer:"0x550FdD13eEBC1f22ea2a2480024BacBF0Ad7e5CE",ValueLteEnforcer:"0xBE32a6DB7471F63BB168C088c57Db01AfAe87967",NativeTokenTransferAmountEnforcer:"0x5eD3833d7B957A8DB8A461c3AF2d668Ec25382E0",NativeBalanceGteEnforcer:"0x376a98860E210DdEda3689fb39565592c563cB0A",ArgsEqualityCheckEnforcer:"0x7378dE585998d3E18Ce147867C335C25B3dB8Ee5",NativeTokenPaymentEnforcer:"0x87Fe18EbF99e42fcE8A03a25F1d20E119407f8e7",RedeemerEnforcer:"0x926672b130D1EF60A9d6b11D2048d121b30f40C1"},a={DelegationManager:"0xbe4138886cb096bdc1b930f2f0ca7892aa234d78",EntryPoint:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",SimpleFactory:"0x6ff518884f21168c30c58CB21184D6AdBC18Ad90",MultiSigDeleGatorImpl:"0x11f555af5844d85bfcf5d61d2a22866527eb585a",HybridDeleGatorImpl:"0xd6edd1256deccb2b06bdecef92dc16bcf26e531b",AllowedCalldataEnforcer:"0x48db3835a873d64a4af2c09f014052407c003bd7",AllowedMethodsEnforcer:"0xfd731951bf1c52afccee3e6f14ab656475b76dd4",AllowedTargetsEnforcer:"0xbc8673c0afa52d86d991c06881e55b2966920564",BlockNumberEnforcer:"0xc15faffa0d879b9263c15a46ce31eacfa2e0e8ae",DeployedEnforcer:"0x5accb9559b56a6c1e3f90e342c85c42d93720d43",ERC20BalanceGteEnforcer:"0xb5d6b1ec6d868a3bae5b7f48178eaa2686a7a087",ERC20TransferAmountEnforcer:"0x92ac423b9c111962179a6242e1adb58d02c103be",IdEnforcer:"0x34152d9f3f8f74338d50703e780389e829b4abac",LimitedCallsEnforcer:"0x4b3adad4a328bee8ba17b86074d92fe7372180cd",NonceEnforcer:"0x2f32ff3fc3086d7f63f16fe8d0065390d460b40d",TimestampEnforcer:"0x78e05f779490c24bf3bfa135b4112e7003b321cd",ValueLteEnforcer:"0xfc20ede0a1132e839fbda9d7ed3904ff3c89540f"},o={arbitrum:42161,arbitrumNova:42170,base:8453,berachain:80094,bsc:56,gnosis:100,ink:57073,linea:59144,mainnet:1,monad:143,optimism:10,polygon:137,sei:1329,sonic:146,unichain:130,bscTestnet:97,arbitrumSepolia:421614,baseSepolia:84532,berachainBepolia:80069,chiado:10200,citreaTestnet:5115,hoodiTestnet:560048,inkSepolia:763373,lineaSepolia:59141,megaEthTestnet:6342,monadTestnet:10143,optimismSepolia:11155420,polygonAmoy:80002,seiTestnet:1328,sepolia:11155111,sonicTestnet:14601,unichainSepolia:1301,lineaGoerli:59140},i={"1.0.0":{[o.optimism]:a,[o.polygon]:a,[o.base]:a,[o.arbitrum]:a,[o.linea]:a,[o.sepolia]:{...a,HybridDeleGatorImpl:"0x5989F5D13DF8fc818EdA65e417AED90459fD67F7"},[o.lineaSepolia]:{...a,HybridDeleGatorImpl:"0x5989F5D13DF8fc818EdA65e417AED90459fD67F7"}},"1.1.0":{[o.arbitrum]:r,[o.base]:r,[o.linea]:r,[o.optimism]:r,[o.polygon]:r,[o.sepolia]:r,[o.lineaSepolia]:r,[o.baseSepolia]:{...r,SimpleFactory:"0xE8eA1DE8D6AfE400B7C8C1A81B7C29B7876b4d02"}},"1.3.0":{[o.mainnet]:n,[o.polygon]:n,[o.bsc]:n,[o.optimism]:n,[o.arbitrum]:n,[o.ink]:n,[o.linea]:n,[o.base]:n,[o.gnosis]:n,[o.berachain]:n,[o.unichain]:n,[o.arbitrumNova]:n,[o.sei]:n,[o.sonic]:n,[o.monad]:n,[o.bscTestnet]:n,[o.citreaTestnet]:n,[o.megaEthTestnet]:n,[o.chiado]:n,[o.lineaSepolia]:n,[o.berachainBepolia]:n,[o.baseSepolia]:n,[o.arbitrumSepolia]:n,[o.sepolia]:n,[o.optimismSepolia]:n,[o.unichainSepolia]:n,[o.polygonAmoy]:n,[o.inkSepolia]:n,[o.monadTestnet]:n,[o.seiTestnet]:n,[o.sonicTestnet]:n,[o.hoodiTestnet]:n}};s.CHAIN_ID=o,s.DELEGATOR_CONTRACTS=i}}},{package:"@metamask/delegation-deployments",file:"node_modules/@metamask/delegation-deployments/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/constants.cjs",{"@metamask/keyring-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/keyring-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.GetCallsStatusCode=s.EIP7682ErrorCode=s.EIP5792ErrorCode=s.SupportedCapabilities=s.MessageType=s.KEYRING_TYPES_SUPPORTING_7702=s.VERSION=void 0;const n=e("@metamask/keyring-controller");var r,a,o,i,c;s.VERSION="2.0.0",s.KEYRING_TYPES_SUPPORTING_7702=[n.KeyringTypes.hd,n.KeyringTypes.simple],function(e){e.SendTransaction="eth_sendTransaction"}(r||(s.MessageType=r={})),function(e){e.AuxiliaryFunds="auxiliaryFunds"}(a||(s.SupportedCapabilities=a={})),function(e){e[e.UnsupportedNonOptionalCapability=5700]="UnsupportedNonOptionalCapability",e[e.UnsupportedChainId=5710]="UnsupportedChainId",e[e.UnknownBundleId=5730]="UnknownBundleId",e[e.RejectedUpgrade=5750]="RejectedUpgrade"}(o||(s.EIP5792ErrorCode=o={})),function(e){e[e.UnsupportedAsset=5771]="UnsupportedAsset",e[e.UnsupportedChain=5772]="UnsupportedChain",e[e.MalformedRequiredAssets=5773]="MalformedRequiredAssets"}(i||(s.EIP7682ErrorCode=i={})),function(e){e[e.PENDING=100]="PENDING",e[e.CONFIRMED=200]="CONFIRMED",e[e.FAILED_OFFCHAIN=400]="FAILED_OFFCHAIN",e[e.REVERTED=500]="REVERTED",e[e.REVERTED_PARTIAL=600]="REVERTED_PARTIAL"}(c||(s.GetCallsStatusCode=c={}))}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/constants.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/hooks/getCallsStatus.cjs",{"../constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/constants.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs","@metamask/transaction-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/transaction-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getCallsStatus=void 0;const n=e("@metamask/rpc-errors"),r=e("@metamask/transaction-controller"),a=e("../constants.cjs");s.getCallsStatus=function(e,t){const s=e.call("TransactionController:getState").transactions.filter(e=>e.batchId===t);if(!s?.length)throw new n.JsonRpcError(a.EIP5792ErrorCode.UnknownBundleId,"No matching bundle found");const o=s[0],{chainId:i,txReceipt:c}=o,l=function(e){const{hash:t,status:s}=e;if(s===r.TransactionStatus.confirmed)return a.GetCallsStatusCode.CONFIRMED;if(s===r.TransactionStatus.failed)return t?a.GetCallsStatusCode.REVERTED:a.GetCallsStatusCode.FAILED_OFFCHAIN;if(s===r.TransactionStatus.dropped)return a.GetCallsStatusCode.REVERTED;return a.GetCallsStatusCode.PENDING}(o),d=c,m=d?.logs??[],u=d&&[{blockHash:d.blockHash,blockNumber:d.blockNumber,gasUsed:d.gasUsed,logs:m.map(e=>({address:e.address,data:e.data,topics:e.topics})),status:d.status,transactionHash:d.transactionHash}];return{version:a.VERSION,id:t,chainId:i,atomic:!0,status:l,receipts:u}}}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/hooks/getCallsStatus.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/hooks/getCapabilities.cjs",{"../constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/constants.cjs","../utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/utils.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getCapabilities=void 0;const n=e("../constants.cjs"),r=e("../utils.cjs");s.getCapabilities=async function(e,t,s,a){const{getDismissSmartAccountSuggestionEnabled:o,getIsSmartTransaction:i,isAtomicBatchSupported:c,isRelaySupported:l,getSendBundleSupportedChains:d,isAuxiliaryFundsSupported:m}=e;let u=a?.map(e=>e.toLowerCase());if(!u?.length){const e=t.call("NetworkController:getState").networkConfigurationsByChainId;u=Object.keys(e)}const p=await c({address:s,chainIds:u}),h=await async function(e,t,s,n,r,a){const o=a.call("PreferencesController:getState").useTransactionSimulations,i=await Promise.all(t.map(({chainId:e})=>e).map(e=>n(e))),c=await r(e),l=t.map((e,t)=>({...e,relaySupportedForChain:i[t]}));return e.reduce((e,t)=>{const n=l.find(({chainId:e})=>e===t)??{},{isSupported:r=!1,relaySupportedForChain:a}=n,i=s(t),d=c[t]??!1;return o&&(i&&d||r&&a)&&(e[t]={alternateGasFees:{supported:!0}}),e},{})}(u,p,i,l,d,t);return u.reduce((e,a)=>{const i=p.find(({chainId:e})=>e===a)??{},{delegationAddress:c,isSupported:l,upgradeContractAddress:d}=i,u=o();let h=!1;try{const e=(0,r.getAccountKeyringType)(s,t);h=n.KEYRING_TYPES_SUPPORTING_7702.includes(e)}catch{}if(!l&&!(!u&&d&&!c&&h))return e;const f=l?"supported":"ready",g=a;return e[g]===undefined&&(e[g]={}),e[g].atomic={status:f},h&&m(a)&&(e[g].auxiliaryFunds={supported:!0}),e},h)}}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/hooks/getCapabilities.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/hooks/processSendCalls.cjs",{"../constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/constants.cjs","../utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/utils.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs","@metamask/transaction-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/transaction-controller/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs",lodash:"/home/runner/work/metamask-extension/metamask-extension/node_modules/lodash/lodash.js",uuid:"/home/runner/work/metamask-extension/metamask-extension/node_modules/uuid/dist/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.processSendCalls=void 0;const n=e("@metamask/rpc-errors"),r=e("@metamask/transaction-controller"),a=e("@metamask/utils"),o=e("lodash"),i=e("uuid"),c=e("../constants.cjs"),l=e("../utils.cjs");function d(e){const{version:t}=e;if(t!==c.VERSION)throw n.rpcErrors.invalidInput(`Version not supported: Got ${t}, expected ${c.VERSION}`)}function m(e,t){const{chainId:s}=e;if(s&&s.toLowerCase()!==t.toLowerCase())throw n.rpcErrors.invalidParams(`Chain ID must match the dApp selected network: Got ${s}, expected ${t}`)}function u(e,t,s){const{calls:r,capabilities:a,chainId:o}=e,i=[...Object.keys(a??{}).filter(e=>e!==c.SupportedCapabilities.AuxiliaryFunds.toString()&&!0!==a?.[e].optional),...r.flatMap(e=>Object.keys(e.capabilities??{}).filter(t=>t!==c.SupportedCapabilities.AuxiliaryFunds.toString()&&!0!==e.capabilities?.[t].optional))];if(i?.length)throw new n.JsonRpcError(c.EIP5792ErrorCode.UnsupportedNonOptionalCapability,`Unsupported non-optional capabilities: ${i.join(", ")}`);a?.auxiliaryFunds&&p({auxiliaryFunds:a.auxiliaryFunds,chainId:o,keyringType:t,isAuxiliaryFundsSupported:s});for(const e of r)e.capabilities?.auxiliaryFunds&&p({auxiliaryFunds:e.capabilities.auxiliaryFunds,chainId:o,keyringType:t,isAuxiliaryFundsSupported:s})}function p({auxiliaryFunds:e,chainId:t,keyringType:s,isAuxiliaryFundsSupported:r}){if(e.optional)return;if(!c.KEYRING_TYPES_SUPPORTING_7702.includes(s))throw new n.JsonRpcError(c.EIP5792ErrorCode.UnsupportedNonOptionalCapability,`Unsupported non-optional capability: ${c.SupportedCapabilities.AuxiliaryFunds}`);if(!r(t))throw new n.JsonRpcError(c.EIP7682ErrorCode.UnsupportedChain,`The wallet no longer supports auxiliary funds on the requested chain: ${t}`);if(e?.requiredAssets)for(const t of e.requiredAssets)if("erc20"!==t.standard)throw new n.JsonRpcError(c.EIP7682ErrorCode.UnsupportedAsset,`The requested asset ${t.address} is not available through the wallet’s auxiliary fund system: unsupported token standard ${t.standard}`)}function h(e){const t=[...e.capabilities?.auxiliaryFunds?.requiredAssets??[],...e.calls.flatMap(e=>e.capabilities?.auxiliaryFunds?.requiredAssets??[])];if(0===t.length)return undefined;const s=(0,o.groupBy)(t,e=>`${e.address.toLowerCase()}-${e.standard}`);return Object.values(s).map(e=>{if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+BigInt(t.amount),0n);return{...e[0],amount:(0,a.add0x)(t.toString(16))}})}s.processSendCalls=async function(e,t,s,o){const{addTransactionBatch:p,addTransaction:f,getDismissSmartAccountSuggestionEnabled:g,isAtomicBatchSupported:k,validateSecurity:w,getPermittedAccountsForOrigin:y,isAuxiliaryFundsSupported:b}=e,{calls:v,from:_}=s,{networkClientId:x,origin:E}=o,S=v.map(e=>({params:e})),{chainId:T}=t.call("NetworkController:getNetworkClientById",x).configuration,[j]=await y(),C=_??j;if(!C)throw n.providerErrors.unauthorized();const A=(0,i.v4)(),I=w.bind(null,A),P=o.id?String(o.id):"";let O;return O=1===Object.keys(S).length?await async function({addTransaction:e,chainId:t,from:s,messenger:n,networkClientId:o,origin:p,requestId:f,securityAlertId:g,sendCalls:k,transactions:w,validateSecurity:y,isAuxiliaryFundsSupported:b}){const v=(0,l.getAccountKeyringType)(s,n);!function(e,t,s,n){d(e),u(e,s,n),m(e,t)}(k,t,v,b);const _={from:s,...w[0].params,type:r.TransactionEnvelopeType.feeMarket},x={method:c.MessageType.SendTransaction,params:[_],origin:p};y(x,t);const E=h(k),S=function(){const e=(0,i.v4)(),t=new Uint8Array((0,i.parse)(e));return(0,a.bytesToHex)(t)}();return await e(_,{batchId:S,networkClientId:o,origin:p,requestId:f,requiredAssets:E,securityAlertResponse:{securityAlertId:g}}),S}({addTransaction:f,chainId:T,from:C,messenger:t,networkClientId:x,origin:E,requestId:P,securityAlertId:A,sendCalls:s,transactions:S,validateSecurity:I,isAuxiliaryFundsSupported:b}):await async function({addTransactionBatch:e,isAtomicBatchSupported:t,chainId:s,from:r,getDismissSmartAccountSuggestionEnabled:a,networkClientId:o,messenger:i,origin:p,requestId:f,sendCalls:g,securityAlertId:k,transactions:w,validateSecurity:y,isAuxiliaryFundsSupported:b}){const v=await t({address:r,chainIds:[s]}),_=v?.[0],x=(0,l.getAccountKeyringType)(r,i),E=a();!function(e,t,s,r,a,o){d(e),function(e,t,s){if(m(e,t),!s)throw new n.JsonRpcError(c.EIP5792ErrorCode.UnsupportedChainId,`EIP-7702 not supported on chain: ${t}`)}(e,t,r),u(e,a,o),function(e,t,s){if(t?.delegationAddress)return;if(e)throw new n.JsonRpcError(c.EIP5792ErrorCode.RejectedUpgrade,"EIP-7702 upgrade disabled by the user");if(!c.KEYRING_TYPES_SUPPORTING_7702.includes(s))throw new n.JsonRpcError(c.EIP5792ErrorCode.RejectedUpgrade,"EIP-7702 upgrade not supported on account")}(s,r,a)}(g,s,E,_,x,b);const S=h(g),T=await e({from:r,networkClientId:o,origin:p,requestId:f,requiredAssets:S,securityAlertId:k,transactions:w,validateSecurity:y});return T.batchId}({addTransactionBatch:p,isAtomicBatchSupported:k,chainId:T,from:C,getDismissSmartAccountSuggestionEnabled:g,messenger:t,networkClientId:x,origin:E,requestId:P,sendCalls:s,securityAlertId:A,transactions:S,validateSecurity:I,isAuxiliaryFundsSupported:b}),{id:O}}}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/hooks/processSendCalls.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/index.cjs",{"./hooks/getCallsStatus.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/hooks/getCallsStatus.cjs","./hooks/getCapabilities.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/hooks/getCapabilities.cjs","./hooks/processSendCalls.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/hooks/processSendCalls.cjs","./methods/wallet_getCallsStatus.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_getCallsStatus.cjs","./methods/wallet_getCapabilities.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_getCapabilities.cjs","./methods/wallet_sendCalls.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_sendCalls.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.walletGetCapabilities=s.walletGetCallsStatus=s.walletSendCalls=s.getCapabilities=s.getCallsStatus=s.processSendCalls=void 0;var n=e("./hooks/processSendCalls.cjs");Object.defineProperty(s,"processSendCalls",{enumerable:!0,get:function(){return n.processSendCalls}});var r=e("./hooks/getCallsStatus.cjs");Object.defineProperty(s,"getCallsStatus",{enumerable:!0,get:function(){return r.getCallsStatus}});var a=e("./hooks/getCapabilities.cjs");Object.defineProperty(s,"getCapabilities",{enumerable:!0,get:function(){return a.getCapabilities}});var o=e("./methods/wallet_sendCalls.cjs");Object.defineProperty(s,"walletSendCalls",{enumerable:!0,get:function(){return o.walletSendCalls}});var i=e("./methods/wallet_getCallsStatus.cjs");Object.defineProperty(s,"walletGetCallsStatus",{enumerable:!0,get:function(){return i.walletGetCallsStatus}});var c=e("./methods/wallet_getCapabilities.cjs");Object.defineProperty(s,"walletGetCapabilities",{enumerable:!0,get:function(){return c.walletGetCapabilities}})}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_getCallsStatus.cjs",{"../types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/types.cjs","../utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/utils.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.walletGetCallsStatus=void 0;const n=e("@metamask/rpc-errors"),r=e("../types.cjs"),a=e("../utils.cjs");s.walletGetCallsStatus=async function(e,t,{getCallsStatus:s}){if(!s)throw n.rpcErrors.methodNotSupported();(0,a.validateParams)(e.params,r.GetCallsStatusStruct);const o=e.params[0];t.result=await s(o,e)}}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_getCallsStatus.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_getCapabilities.cjs",{"../types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/types.cjs","../utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/utils.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.walletGetCapabilities=void 0;const n=e("@metamask/rpc-errors"),r=e("../types.cjs"),a=e("../utils.cjs");s.walletGetCapabilities=async function(e,t,{getPermittedAccountsForOrigin:s,getCapabilities:o}){if(!o)throw n.rpcErrors.methodNotSupported();(0,a.validateParams)(e.params,r.GetCapabilitiesStruct);const i=e.params[0],c=e.params[1];await(0,a.validateAndNormalizeKeyholder)(i,{getPermittedAccountsForOrigin:s});const l=await o(i,c,e);t.result=l}}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_getCapabilities.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_sendCalls.cjs",{"../types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/types.cjs","../utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/utils.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.walletSendCalls=void 0;const n=e("@metamask/rpc-errors"),r=e("../types.cjs"),a=e("../utils.cjs");s.walletSendCalls=async function(e,t,{getPermittedAccountsForOrigin:s,processSendCalls:o}){if(!o)throw n.rpcErrors.methodNotSupported();(0,a.validateParams)(e.params,r.SendCallsStruct);const i=e.params[0],c=i.from?await(0,a.validateAndNormalizeKeyholder)(i.from,{getPermittedAccountsForOrigin:s}):undefined,l={...i,from:c};t.result=await o(l,e)}}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/methods/wallet_sendCalls.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/types.cjs",{"@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.SendCallsStruct=s.CapabilitiesStruct=s.GetCapabilitiesStruct=s.GetCallsStatusStruct=void 0;const n=e("@metamask/superstruct"),r=e("@metamask/utils");s.GetCallsStatusStruct=(0,n.tuple)([r.StrictHexStruct]),s.GetCapabilitiesStruct=(0,n.tuple)([r.HexChecksumAddressStruct,(0,n.optional)((0,n.array)(r.StrictHexStruct))]);const a=(0,n.type)({address:(0,n.nonempty)(r.HexChecksumAddressStruct),amount:(0,n.nonempty)(r.StrictHexStruct),standard:(0,n.nonempty)((0,n.string)())});s.CapabilitiesStruct=(0,n.record)((0,n.string)(),(0,n.type)({optional:(0,n.optional)((0,n.boolean)()),requiredAssets:(0,n.optional)((0,n.array)(a))})),s.SendCallsStruct=(0,n.tuple)([(0,n.object)({version:(0,n.nonempty)((0,n.string)()),id:(0,n.optional)(r.StrictHexStruct),from:(0,n.optional)(r.HexChecksumAddressStruct),chainId:r.StrictHexStruct,atomicRequired:(0,n.boolean)(),calls:(0,n.array)((0,n.object)({to:(0,n.optional)(r.HexChecksumAddressStruct),data:(0,n.optional)(r.StrictHexStruct),value:(0,n.optional)(r.StrictHexStruct),capabilities:(0,n.optional)(s.CapabilitiesStruct)})),capabilities:(0,n.optional)(s.CapabilitiesStruct)})])}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/types.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/utils.cjs",{"./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-5792-middleware/dist/constants.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.resemblesAddress=s.validateParams=s.validateAndNormalizeKeyholder=s.getAccountKeyringType=void 0;const n=e("@metamask/rpc-errors"),r=e("@metamask/superstruct"),a=e("./constants.cjs");function o(e){return 42===e.length}s.getAccountKeyringType=function(e,t){const{accounts:s}=t.call("AccountsController:getState").internalAccounts,r=Object.values(s).find(t=>t.address.toLowerCase()===e.toLowerCase()),o=r?.metadata?.keyring?.type;if(!o)throw new n.JsonRpcError(a.EIP5792ErrorCode.RejectedUpgrade,"EIP-7702 upgrade not supported as account type is unknown");return o},s.validateAndNormalizeKeyholder=async function(e,{getPermittedAccountsForOrigin:t}){if("string"==typeof e&&e.length>0&&o(e)){const s=(await t()).map(e=>e.toLowerCase()),r=e.toLowerCase();if(s.includes(r))return r;throw n.providerErrors.unauthorized()}throw n.rpcErrors.invalidParams({message:"Invalid parameters: must provide an Ethereum address."})},s.validateParams=function(e,t){const[s]=(0,r.validate)(e,t);if(s)throw n.rpcErrors.invalidParams(function(e,t){return`${t}\n\n${e.failures().map(e=>`${e.path.join(" > ")}${e.path.length?" - ":""}${e.message}`).join("\n")}`}(s,"Invalid params"))},s.resemblesAddress=o}}},{package:"@metamask/eip-5792-middleware",file:"node_modules/@metamask/eip-5792-middleware/dist/utils.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/constants.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.DELEGATION_INDICATOR_PREFIX=s.METHOD_NAMES=void 0,s.METHOD_NAMES={UPGRADE_ACCOUNT:"wallet_upgradeAccount",GET_ACCOUNT_UPGRADE_STATUS:"wallet_getAccountUpgradeStatus"},s.DELEGATION_INDICATOR_PREFIX="0xef0100"}}},{package:"@metamask/eip-7702-internal-rpc-middleware",file:"node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/constants.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/index.cjs",{"./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/constants.cjs","./utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/utils.cjs","./wallet_getAccountUpgradeStatus.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/wallet_getAccountUpgradeStatus.cjs","./wallet_upgradeAccount.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/wallet_upgradeAccount.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.METHOD_NAMES=s.validateAndNormalizeAddress=s.validateParams=s.walletGetAccountUpgradeStatus=s.walletUpgradeAccount=void 0;var n=e("./wallet_upgradeAccount.cjs");Object.defineProperty(s,"walletUpgradeAccount",{enumerable:!0,get:function(){return n.walletUpgradeAccount}});var r=e("./wallet_getAccountUpgradeStatus.cjs");Object.defineProperty(s,"walletGetAccountUpgradeStatus",{enumerable:!0,get:function(){return r.walletGetAccountUpgradeStatus}});var a=e("./utils.cjs");Object.defineProperty(s,"validateParams",{enumerable:!0,get:function(){return a.validateParams}}),Object.defineProperty(s,"validateAndNormalizeAddress",{enumerable:!0,get:function(){return a.validateAndNormalizeAddress}});var o=e("./constants.cjs");Object.defineProperty(s,"METHOD_NAMES",{enumerable:!0,get:function(){return o.METHOD_NAMES}})}}},{package:"@metamask/eip-7702-internal-rpc-middleware",file:"node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/types.cjs",{"@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.GetAccountUpgradeStatusParamsStruct=s.UpgradeAccountParamsStruct=void 0;const n=e("@metamask/superstruct"),r=e("@metamask/utils");s.UpgradeAccountParamsStruct=(0,n.object)({account:r.HexChecksumAddressStruct,chainId:(0,n.optional)(r.StrictHexStruct)}),s.GetAccountUpgradeStatusParamsStruct=(0,n.object)({account:r.HexChecksumAddressStruct,chainId:(0,n.optional)(r.StrictHexStruct)})}}},{package:"@metamask/eip-7702-internal-rpc-middleware",file:"node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/types.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/utils.cjs",{"@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.validateParams=s.validateAndNormalizeAddress=void 0;const n=e("@metamask/rpc-errors"),r=e("@metamask/superstruct"),a=e("@metamask/utils");s.validateAndNormalizeAddress=async function(e,t,s){if("string"!=typeof e||0===e.length||!(0,a.isHexAddress)(e))throw n.rpcErrors.invalidParams({message:"Invalid parameters: must provide an EVM address."});if(!(await s(t)).map(e=>e.toLowerCase()).includes(e.toLowerCase()))throw n.providerErrors.unauthorized();return e},s.validateParams=function(e,t){const[s]=(0,r.validate)(e,t);if(s)throw n.rpcErrors.invalidParams(function(e,t){return`${t}\n\n${e.failures().map(e=>`${e.path.join(" > ")}${e.path.length?" - ":""}${e.message}`).join("\n")}`}(s,"Invalid parameters"))}}}},{package:"@metamask/eip-7702-internal-rpc-middleware",file:"node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/utils.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/wallet_getAccountUpgradeStatus.cjs",{"./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/constants.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/types.cjs","./utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/utils.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.walletGetAccountUpgradeStatus=void 0;const n=e("@metamask/rpc-errors"),r=e("@metamask/utils"),a=e("./constants.cjs"),o=e("./types.cjs"),i=e("./utils.cjs");s.walletGetAccountUpgradeStatus=async function(e,t,s){const{params:c,origin:l}=e;(0,i.validateParams)(c,o.GetAccountUpgradeStatusParamsStruct);const{account:d,chainId:m}=c,u=await(0,i.validateAndNormalizeAddress)(d,l,s.getPermittedAccountsForOrigin);let p;if(m!==undefined)p=m;else{const e=s.getCurrentChainIdForDomain(l);if(!e)throw n.rpcErrors.invalidParams({message:`Could not determine current chain ID for origin: ${l}`});p=e}const{isSupported:h}=await s.isEip7702Supported({address:u,chainId:p});if(h)try{const e=p,r=s.getSelectedNetworkClientIdForChain(e);if(!r)throw n.rpcErrors.invalidParams({message:`Network client ID not found for chain ID ${p}`});const{isUpgraded:o,upgradedAddress:i}=await(async(e,t,s)=>{const n=await s(e,t);if(!n||"0x"===n||n.length<=2)return{isUpgraded:!1,upgradedAddress:null};if(!n.startsWith(a.DELEGATION_INDICATOR_PREFIX))return{isUpgraded:!1,upgradedAddress:null};const r=a.DELEGATION_INDICATOR_PREFIX.length+40;return n.length!==r?{isUpgraded:!1,upgradedAddress:null}:{isUpgraded:!0,upgradedAddress:`0x${n.slice(8,48)}`}})(u,r,s.getCode);t.result={isSupported:h,account:u,isUpgraded:o,upgradedAddress:i,chainId:p}}catch(e){if(e instanceof n.JsonRpcError)throw e;throw n.rpcErrors.internal({message:`Failed to get account upgrade status: ${(0,r.getErrorMessage)(e)}`})}else t.result={isSupported:h,account:u,isUpgraded:!1,upgradedAddress:null,chainId:p}}}}},{package:"@metamask/eip-7702-internal-rpc-middleware",file:"node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/wallet_getAccountUpgradeStatus.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/wallet_upgradeAccount.cjs",{"./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/types.cjs","./utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/utils.cjs","@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.walletUpgradeAccount=void 0;const n=e("@metamask/rpc-errors"),r=e("./types.cjs"),a=e("./utils.cjs");s.walletUpgradeAccount=async function(e,t,s){const{params:o,origin:i}=e;(0,a.validateParams)(o,r.UpgradeAccountParamsStruct);const{account:c,chainId:l}=o,d=await(0,a.validateAndNormalizeAddress)(c,i,s.getPermittedAccountsForOrigin);let m;if(l!==undefined)m=l;else{const e=s.getCurrentChainIdForDomain(i);if(!e)throw n.rpcErrors.invalidParams({message:`No network configuration found for origin: ${i}`});m=e}try{const e=m,{isSupported:r,upgradeContractAddress:a}=await s.isEip7702Supported({address:d,chainId:e});if(!r)throw n.rpcErrors.invalidParams({message:`Account upgrade not supported on chain ID ${m}`});if(!a)throw n.rpcErrors.invalidParams({message:`No upgrade contract address available for chain ID ${m}`});const o=await s.upgradeAccount(d,a,m);t.result={transactionHash:o.transactionHash,upgradedAccount:d,delegatedTo:o.delegatedTo}}catch(e){if(e instanceof n.JsonRpcError)throw e;throw n.rpcErrors.internal({message:`Failed to upgrade account: ${e instanceof Error?e.message:String(e)}`})}}}}},{package:"@metamask/eip-7702-internal-rpc-middleware",file:"node_modules/@metamask/eip-7702-internal-rpc-middleware/dist/wallet_upgradeAccount.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/ens-controller/dist/EnsController.cjs",{"@ethersproject/providers":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ethersproject/providers/lib/index.js","@metamask/base-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/base-controller/dist/index.cjs","@metamask/controller-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/controller-utils/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs","punycode/punycode.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/punycode/punycode.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)},l=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s};Object.defineProperty(s,"__esModule",{value:!0}),s.EnsController=s.DEFAULT_ENS_NETWORK_MAP=void 0;const d=e("@ethersproject/providers"),m=e("@metamask/base-controller"),u=e("@metamask/controller-utils"),p=e("@metamask/utils"),h=e("punycode/punycode.js"),f=(0,p.createProjectLogger)("ens-controller");s.DEFAULT_ENS_NETWORK_MAP={1:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",3:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",4:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",5:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",17e3:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",11155111:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"};const g={ensEntries:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0},ensResolutionsByAddress:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0}},k={ensEntries:{},ensResolutionsByAddress:{}};class w extends m.BaseController{constructor({registriesByChainId:e=s.DEFAULT_ENS_NETWORK_MAP,messenger:t,state:i={},onNetworkDidChange:l}){super({name:"EnsController",metadata:g,messenger:t,state:{...k,ensEntries:Object.fromEntries(Object.entries(e).map(([e,t])=>[(0,u.toHex)(e),{".":{address:t,chainId:(0,u.toHex)(e),ensName:"."}}])),...i}}),n.add(this),r.set(this,null),c(this,n,"m",a).call(this,e),l&&l(({selectedNetworkClientId:t})=>{this.resetState(),c(this,n,"m",o).call(this,t,e)})}resetState(){this.update(e=>{e.ensResolutionsByAddress={}})}clear(){this.update(e=>{e.ensEntries={}})}delete(e,t){const s=(0,u.normalizeEnsName)(t);return!!((0,u.isSafeDynamicKey)(e)&&s&&this.state.ensEntries[e]&&this.state.ensEntries[e][s])&&(this.update(t=>{delete t.ensEntries[e][s],0===Object.keys(t.ensEntries[e]).length&&delete t.ensEntries[e]}),!0)}get(e,t){const s=(0,u.normalizeEnsName)(t);return s&&this.state.ensEntries[e]&&this.state.ensEntries[e][s]||null}set(e,t,s){if(!Number.isInteger(Number.parseInt(e,10))||!t||"string"!=typeof t||s&&!(0,u.isValidHexAddress)(s))throw new Error(`Invalid ENS entry: { chainId:${e}, ensName:${t}, address:${s}}`);const n=(0,u.normalizeEnsName)(t);if(!n)throw new Error(`Invalid ENS name: ${t}`);const r=s?(0,u.toChecksumHexAddress)(s):null,a=this.state.ensEntries[e];return(!a?.[n]||a[n].address!==r)&&(this.update(t=>{t.ensEntries={...this.state.ensEntries,[e]:{...this.state.ensEntries[e],[n]:{address:r,chainId:e,ensName:n}}}}),!0)}async reverseResolveAddress(e){if(!c(this,r,"f"))return undefined;const t=(0,u.toChecksumHexAddress)(e);if(this.state.ensResolutionsByAddress[t])return this.state.ensResolutionsByAddress[t];let s,n;try{s=await c(this,r,"f").lookupAddress(t)}catch(e){return f(e),undefined}if(!s)return undefined;try{n=await c(this,r,"f").resolveName(s)}catch(e){return f(e),undefined}return n?"0x0000000000000000000000000000000000000000"===n||"0x"===n||(0,u.toChecksumHexAddress)(n)!==t?undefined:(this.update(e=>{e.ensResolutionsByAddress[t]=(0,h.toASCII)(s)}),s):undefined}}s.EnsController=w,r=new WeakMap,n=new WeakSet,a=function(e){const{selectedNetworkClientId:t}=this.messenger.call("NetworkController:getState");c(this,n,"m",o).call(this,t,e)},o=function(e,t){const{configuration:{chainId:s},provider:a}=this.messenger.call("NetworkController:getNetworkClientById",e);t&&t[parseInt(s,16)]&&c(this,n,"m",i).call(this,s)?l(this,r,new d.Web3Provider(a,{chainId:(0,u.convertHexToDecimal)(s),name:u.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP[s],ensAddress:t[parseInt(s,16)]}),"f"):l(this,r,null,"f")},i=function(e){return Boolean(this.state.ensEntries[e])},s.default=w}}},{package:"@metamask/ens-controller",file:"node_modules/@metamask/ens-controller/dist/EnsController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/ens-controller/dist/index.cjs",{"./EnsController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/ens-controller/dist/EnsController.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]}),r=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./EnsController.cjs"),s)}}},{package:"@metamask/ens-controller",file:"node_modules/@metamask/ens-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/error-reporting-service/dist/error-reporting-service.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},o=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.ErrorReportingService=void 0;s.ErrorReportingService=class{constructor({messenger:e,captureException:t}){this.name="ErrorReportingService",this.state=null,n.set(this,void 0),r.set(this,void 0),a(this,r,e,"f"),a(this,n,t,"f"),o(this,r,"f").registerActionHandler("ErrorReportingService:captureException",o(this,n,"f").bind(this))}captureException(e){o(this,n,"f").call(this,e)}},n=new WeakMap,r=new WeakMap}}},{package:"@metamask/error-reporting-service",file:"node_modules/@metamask/error-reporting-service/dist/error-reporting-service.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/error-reporting-service/dist/index.cjs",{"./error-reporting-service.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/error-reporting-service/dist/error-reporting-service.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.ErrorReportingService=void 0;var n=e("./error-reporting-service.cjs");Object.defineProperty(s,"ErrorReportingService",{enumerable:!0,get:function(){return n.ErrorReportingService}})}}},{package:"@metamask/error-reporting-service",file:"node_modules/@metamask/error-reporting-service/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/base-filter-history.js",{"./base-filter":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/base-filter.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){const n=e("./base-filter");t.exports=class extends n{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/base-filter-history.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/base-filter.js",{"@metamask/safe-event-emitter":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/safe-event-emitter/dist/cjs/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){const n=e("@metamask/safe-event-emitter").default;t.exports=class extends n{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(e=>this.emit("update",e))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/base-filter.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/block-filter.js",{"./base-filter":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/base-filter.js","./getBlocksForRange":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/getBlocksForRange.js","./hexUtils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/hexUtils.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){const n=e("./base-filter"),r=e("./getBlocksForRange"),{incrementHexInt:a}=e("./hexUtils");t.exports=class extends n{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){const s=t,n=a(e),o=(await r({provider:this.provider,fromBlock:n,toBlock:s})).map(e=>e.hash);this.addResults(o)}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/block-filter.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/getBlocksForRange.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){function n(e){return e===undefined||null===e?e:Number.parseInt(e,16)}function r(e){if(e===undefined||null===e)return e;return"0x"+e.toString(16)}t.exports=async function({provider:e,fromBlock:t,toBlock:s}){t||(t=s);const a=n(t),o=n(s),i=Array(o-a+1).fill().map((e,t)=>a+t).map(r);let c=await Promise.all(i.map(t=>async function(e,t,s){for(let n=0;n<3;n++)try{return e.request({id:1,jsonrpc:"2.0",method:t,params:s})}catch(e){console.error(`provider.request failed: ${e.stack||e.message||e}`)}return null}(e,"eth_getBlockByNumber",[t,!1])));return c=c.filter(e=>null!==e),c}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/getBlocksForRange.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/hexUtils.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){function n(e){return e.sort((e,t)=>"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:r(e)-r(t))}function r(e){return e===undefined||null===e?e:Number.parseInt(e,16)}function a(e){if(e===undefined||null===e)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function o(){return Math.floor(16*Math.random()).toString(16)}t.exports={minBlockRef:function(...e){return n(e)[0]},maxBlockRef:function(...e){const t=n(e);return t[t.length-1]},sortBlockRefs:n,bnToHex:function(e){return"0x"+e.toString(16)},blockRefIsNumber:function(e){return e&&!["earliest","latest","pending"].includes(e)},hexToInt:r,incrementHexInt:function(e){if(e===undefined||null===e)return e;return a(r(e)+1)},intToHex:a,unsafeRandomBytes:function(e){let t="0x";for(let s=0;s<e;s++)t+=o(),t+=o();return t}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/hexUtils.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/index.js",{"./block-filter.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/block-filter.js","./hexUtils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/hexUtils.js","./log-filter.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/log-filter.js","./tx-filter.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/tx-filter.js","@metamask/json-rpc-engine":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/json-rpc-engine/dist/index.cjs","async-mutex":"/home/runner/work/metamask-extension/metamask-extension/node_modules/async-mutex/lib/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){const n=e("async-mutex").Mutex,{createAsyncMiddleware:r,createScaffoldMiddleware:a}=e("@metamask/json-rpc-engine"),o=e("./log-filter.js"),i=e("./block-filter.js"),c=e("./tx-filter.js"),{intToHex:l,hexToInt:d}=e("./hexUtils");function m(e){return u(async(...t)=>{const s=await e(...t);return l(s.id)})}function u(e){return r(async(t,s)=>{const n=await e.apply(null,t.params);s.result=n})}function p(e,t){const s=[];for(let t in e)s.push(e[t]);return s}t.exports=function({blockTracker:e,provider:t}){let s=0,r={};const h=new n,f=function({mutex:e}){return t=>async(s,n,r,a)=>{(await e.acquire())(),t(s,n,r,a)}}({mutex:h}),g=a({eth_newFilter:f(m(w)),eth_newBlockFilter:f(m(y)),eth_newPendingTransactionFilter:f(m(b)),eth_uninstallFilter:f(u(x)),eth_getFilterChanges:f(u(v)),eth_getFilterLogs:f(u(_))}),k=async({oldBlock:e,newBlock:t})=>{if(0===r.length)return;const s=await h.acquire();try{await Promise.all(p(r).map(async s=>{try{await s.update({oldBlock:e,newBlock:t})}catch(e){console.error(e)}}))}catch(e){console.error(e)}s()};return g.newLogFilter=w,g.newBlockFilter=y,g.newPendingTransactionFilter=b,g.uninstallFilter=x,g.getFilterChanges=v,g.getFilterLogs=_,g.destroy=()=>{!async function(){const e=p(r).length;r={},S({prevFilterCount:e,newFilterCount:0})}()},g;async function w(e){const s=new o({provider:t,params:e});await E(s);return s}async function y(){const e=new i({provider:t});await E(e);return e}async function b(){const e=new c({provider:t});await E(e);return e}async function v(e){const t=d(e),s=r[t];if(!s)throw new Error(`No filter for index "${t}"`);return s.getChangesAndClear()}async function _(e){const t=d(e),s=r[t];if(!s)throw new Error(`No filter for index "${t}"`);let n=[];return"log"===s.type&&(n=s.getAllResults()),n}async function x(e){const t=d(e),s=r[t],n=Boolean(s);return n&&await async function(e){const t=p(r).length;delete r[e];const s=p(r).length;S({prevFilterCount:t,newFilterCount:s})}(t),n}async function E(t){const n=p(r).length,a=await e.getLatestBlock();await t.initialize({currentBlock:a}),s++,r[s]=t,t.id=s,t.idHex=l(s);return S({prevFilterCount:n,newFilterCount:p(r).length}),s}function S({prevFilterCount:t,newFilterCount:s}){0===t&&s>0?e.on("sync",k):t>0&&0===s&&e.removeListener("sync",k)}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/index.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/log-filter.js",{"./base-filter-history":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/base-filter-history.js","./hexUtils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/hexUtils.js","@metamask/eth-query":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-query/index.js",pify:"/home/runner/work/metamask-extension/metamask-extension/node_modules/pify/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){const n=e("@metamask/eth-query"),r=e("pify"),a=e("./base-filter-history"),{bnToHex:o,hexToInt:i,incrementHexInt:c,minBlockRef:l,blockRefIsNumber:d}=e("./hexUtils");t.exports=class extends a{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new n(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:undefined,topics:[]},t),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(e=>e.toLowerCase()))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;const s=l(this.params.toBlock,e),n=Object.assign({},this.params,{toBlock:s}),r=await this._fetchLogs(n);this.addInitialResults(r)}async update({oldBlock:e,newBlock:t}){const s=t;let n;n=e?c(e):t;const r=Object.assign({},this.params,{fromBlock:n,toBlock:s}),a=(await this._fetchLogs(r)).filter(e=>this.matchLog(e));this.addResults(a)}async _fetchLogs(e){return await r(t=>this.ethQuery.getLogs(e,t))()}matchLog(e){if(i(this.params.fromBlock)>=i(e.blockNumber))return!1;if(d(this.params.toBlock)&&i(this.params.toBlock)<=i(e.blockNumber))return!1;const t=e.address&&e.address.toLowerCase();if(this.params.address&&t&&!this.params.address.includes(t))return!1;return this.params.topics.every((t,s)=>{let n=e.topics[s];if(!n)return!1;n=n.toLowerCase();let r=Array.isArray(t)?t:[t];if(r.includes(null))return!0;r=r.map(e=>e.toLowerCase());return r.includes(n)})}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/log-filter.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/subscriptionManager.js",{"./getBlocksForRange.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/getBlocksForRange.js","./hexUtils.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/hexUtils.js","./index.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/index.js","@metamask/json-rpc-engine":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/json-rpc-engine/dist/index.cjs","@metamask/safe-event-emitter":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/safe-event-emitter/dist/cjs/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){const n=e("@metamask/safe-event-emitter").default,{createAsyncMiddleware:r,createScaffoldMiddleware:a}=e("@metamask/json-rpc-engine"),o=e("./index.js"),{unsafeRandomBytes:i,incrementHexInt:c}=e("./hexUtils.js"),l=e("./getBlocksForRange.js");function d(e){return null===e||e===undefined?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}t.exports=function({blockTracker:e,provider:t}){const s={},m=o({blockTracker:e,provider:t});let u=!1;const p=new n,h=a({eth_subscribe:r(async function(n,r){if(u)throw new Error("SubscriptionManager - attempting to use after destroying");const a=n.params[0],o=i(16);let p;switch(a){case"newHeads":p=h({subId:o});break;case"logs":const e=n.params[1];p=g({subId:o,filter:await m.newLogFilter(e)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${a}"`)}return s[o]=p,void(r.result=o);function h({subId:s}){const n={type:a,destroy:async()=>{e.removeListener("sync",n.update)},update:async({oldBlock:e,newBlock:n})=>{const r=n,a=c(e);(await l({provider:t,fromBlock:a,toBlock:r})).map(d).filter(e=>null!==e).forEach(e=>{f(s,e)})}};return e.on("sync",n.update),n}function g({subId:e,filter:t}){t.on("update",t=>f(e,t));return{type:a,destroy:async()=>await m.uninstallFilter(t.idHex)}}}),eth_unsubscribe:r(async function(e,t){if(u)throw new Error("SubscriptionManager - attempting to use after destroying");const n=e.params[0],r=s[n];if(!r)return void(t.result=!1);delete s[n],await r.destroy(),t.result=!0})});return h.destroy=function(){p.removeAllListeners();for(const e in s)s[e].destroy(),delete s[e];u=!0},{events:p,middleware:h};function f(e,t){p.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/subscriptionManager.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/tx-filter.js",{"./base-filter":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/base-filter.js","./getBlocksForRange":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/getBlocksForRange.js","./hexUtils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-json-rpc-filters/hexUtils.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){const n=e("./base-filter"),r=e("./getBlocksForRange"),{incrementHexInt:a}=e("./hexUtils");t.exports=class extends n{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const t=e,s=a(e),n=await r({provider:this.provider,fromBlock:s,toBlock:t}),o=[];for(const e of n)o.push(...e.transactions);this.addResults(o)}}}}},{package:"@metamask/eth-json-rpc-filters",file:"node_modules/@metamask/eth-json-rpc-filters/tx-filter.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/errors.cjs",{"@metamask/hw-wallet-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.createLedgerError=function(e,t){const s=r(e);if(s){const e=t?`${s.message} (${t})`:s.message;return new n.HardwareWalletError(e,{code:s.code,severity:s.severity,category:s.category,userMessage:s.userMessage??e})}const a=t?`Unknown Ledger error: ${e} (${t})`:`Unknown Ledger error: ${e}`;return new n.HardwareWalletError(a,{code:n.ErrorCode.Unknown,severity:n.Severity.Err,category:n.Category.Unknown,userMessage:a})},s.isKnownLedgerError=function(e){return e in n.LEDGER_ERROR_MAPPINGS},s.getLedgerErrorMapping=r;const n=e("@metamask/hw-wallet-sdk");function r(e){return n.LEDGER_ERROR_MAPPINGS[e]}}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/errors.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/index.cjs",{"./errors.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/errors.cjs","./ledger-error-handler.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-error-handler.cjs","./ledger-hw-app.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-hw-app.cjs","./ledger-iframe-bridge.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-iframe-bridge.cjs","./ledger-keyring-v2.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-keyring-v2.cjs","./ledger-keyring.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-keyring.cjs","./ledger-mobile-bridge.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-mobile-bridge.cjs","./ledger-transport-middleware.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-transport-middleware.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]}),r=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./ledger-keyring.cjs"),s),r(e("./ledger-keyring-v2.cjs"),s),r(e("./ledger-iframe-bridge.cjs"),s),r(e("./ledger-mobile-bridge.cjs"),s),r(e("./ledger-transport-middleware.cjs"),s),r(e("./ledger-hw-app.cjs"),s),r(e("./errors.cjs"),s),r(e("./ledger-error-handler.cjs"),s)}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-error-handler.cjs",{"./errors.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/errors.cjs","@ledgerhq/hw-transport":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ledgerhq/hw-transport/lib/Transport.js","@metamask/hw-wallet-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.handleLedgerTransportError=function(e,t){if(e instanceof n.TransportStatusError){const t=`0x${e.statusCode.toString(16)}`;if((0,a.isKnownLedgerError)(t)){const e=(0,a.createLedgerError)(t);throw i.has(t)&&(e.message=(s=e.message).startsWith(o)?s:`${o}${s}`),e}throw new r.HardwareWalletError(e.message,{code:r.ErrorCode.Unknown,severity:r.Severity.Err,category:r.Category.Unknown,userMessage:e.message,cause:e})}var s;if(e instanceof r.HardwareWalletError)throw e;if(e instanceof Error)throw new r.HardwareWalletError(e.message,{code:r.ErrorCode.Unknown,severity:r.Severity.Err,category:r.Category.Unknown,userMessage:e.message,cause:e});throw new r.HardwareWalletError(t,{code:r.ErrorCode.Unknown,severity:r.Severity.Err,category:r.Category.Unknown,userMessage:t})};const n=e("@ledgerhq/hw-transport"),r=e("@metamask/hw-wallet-sdk"),a=e("./errors.cjs"),o="Ledger: ",i=new Set(["0x6985","0x6a80","0x5515","0x650f"])}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-error-handler.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-hw-app.cjs",{"@ledgerhq/hw-app-eth":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ledgerhq/hw-app-eth/lib/Eth.js",buffer:"/home/runner/work/metamask-extension/metamask-extension/node_modules/browserify/node_modules/buffer/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.MetaMaskLedgerHwAppEth=void 0;const r=n(e("@ledgerhq/hw-app-eth")),a=e("buffer");class o extends r.default{constructor(){super(...arguments),this.mainAppName="BOLOS",this.ethAppName="Ethereum",this.transportEncoding="ascii"}async openEthApp(){await this.transport.send(224,216,0,0,a.Buffer.from(this.ethAppName,this.transportEncoding))}async closeApps(){await this.transport.send(176,167,0,0)}async getAppNameAndVersion(){const e=await this.transport.send(176,1,0,0);if(1!==e[0])throw new Error("Incorrect format return from getAppNameAndVersion.");let t=1;const s=e[t]??0;t+=1;const n=e.slice(t,t+=s).toString(this.transportEncoding),r=e[t]??0;t+=1;return{appName:n,version:e.slice(t,t+=r).toString(this.transportEncoding)}}}s.MetaMaskLedgerHwAppEth=o}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-hw-app.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-iframe-bridge.cjs",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c,l,d,m,u=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)},p=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s};Object.defineProperty(s,"__esModule",{value:!0}),s.LedgerIframeBridge=s.IFrameMessageAction=void 0;const h=e("@metamask/utils");var f;!function(e){e.LedgerIsIframeReady="ledger-is-iframe-ready",e.LedgerConnectionChange="ledger-connection-change",e.LedgerUnlock="ledger-unlock",e.LedgerMakeApp="ledger-make-app",e.LedgerUpdateTransport="ledger-update-transport",e.LedgerSignTransaction="ledger-sign-transaction",e.LedgerSignPersonalMessage="ledger-sign-personal-message",e.LedgerSignTypedData="ledger-sign-typed-data",e.LedgerGetAppNameAndVersion="ledger-get-app-name-and-version",e.LedgerGetAppConfiguration="ledger-get-app-configuration"}(f||(s.IFrameMessageAction=f={}));s.LedgerIframeBridge=class{constructor(e={bridgeUrl:"https://metamask.github.io/eth-ledger-bridge-keyring"}){n.add(this),this.iframeLoaded=!1,r.set(this,void 0),this.isDeviceConnected=!1,this.currentMessageId=0,a.set(this,new Map),u(this,n,"m",m).call(this,e),p(this,r,{bridgeUrl:e?.bridgeUrl},"f")}async init(){await u(this,n,"m",i).call(this,u(this,r,"f").bridgeUrl),this.eventListener=u(this,n,"m",l).bind(this,u(this,r,"f").bridgeUrl),window.addEventListener("message",this.eventListener)}async destroy(){this.eventListener&&window.removeEventListener("message",this.eventListener)}async getOptions(){return u(this,r,"f")}async setOptions(e){u(this,n,"m",m).call(this,e),u(this,r,"f")?.bridgeUrl!==e.bridgeUrl&&(u(this,r,"f").bridgeUrl=e.bridgeUrl,await this.destroy(),await this.init())}async attemptMakeApp(){const e=await u(this,n,"m",d).call(this,{action:f.LedgerMakeApp},{timeout:8e3});if("success"in e&&e.success)return!0;throw"error"in e?e.error:new Error("Unknown error occurred")}async updateTransportMethod(e){if(!this.iframeLoaded)throw new Error("The iframe is not loaded yet");const t=await u(this,n,"m",d).call(this,{action:f.LedgerUpdateTransport,params:{transportType:e}},{timeout:8e3});if("success"in t&&t.success)return!0;throw new Error("Ledger transport could not be updated")}async getPublicKey(e){return u(this,n,"m",o).call(this,f.LedgerUnlock,e)}async deviceSignTransaction(e){return u(this,n,"m",o).call(this,f.LedgerSignTransaction,e)}async deviceSignMessage(e){return u(this,n,"m",o).call(this,f.LedgerSignPersonalMessage,e)}async deviceSignTypedData(e){return u(this,n,"m",o).call(this,f.LedgerSignTypedData,e)}async getAppNameAndVersion(){return u(this,n,"m",o).call(this,f.LedgerGetAppNameAndVersion,{})}async getAppConfiguration(){return u(this,n,"m",o).call(this,f.LedgerGetAppConfiguration,{})}},r=new WeakMap,a=new WeakMap,n=new WeakSet,o=async function(...[e,t]){const s=await u(this,n,"m",d).call(this,{action:e,params:t});if("payload"in s&&s.payload){if("success"in s&&s.success)return s.payload;if("error"in s.payload)throw s.payload.error}throw new Error("Unknown error occurred")},i=async function(e){return new Promise(t=>{this.iframe=document.createElement("iframe"),this.iframe.src=e,this.iframe.allow="hid 'src'",this.iframe.onload=async()=>{this.iframeLoaded=!0,t()},document.head.appendChild(this.iframe)})},c=function(e){const t=e.split("/");return t.splice(-1,1),t.join("/")},l=function(e,t){const{origin:s,data:r}=t;if(s===u(this,n,"m",c).call(this,e)&&r){const e=u(this,a,"f").get(r.messageId);e?(e.resolve(r),u(this,a,"f").delete(r.messageId)):r.action===f.LedgerConnectionChange&&(this.isDeviceConnected=r.payload.connected)}},d=async function(e,{timeout:t}={}){this.currentMessageId+=1;const s={...e,messageId:this.currentMessageId,target:"LEDGER-IFRAME"},n=(0,h.createDeferredPromise)();if(u(this,a,"f").set(this.currentMessageId,n),!this.iframeLoaded||!this.iframe?.contentWindow)throw new Error("The iframe is not loaded yet");return t&&setTimeout(()=>{u(this,a,"f").has(s.messageId)&&(u(this,a,"f").delete(s.messageId),n.reject(new Error("Ledger iframe message timeout")))},t),this.iframe.contentWindow.postMessage(s,"*"),n.promise},m=function(e){if("string"!=typeof e.bridgeUrl||0===e.bridgeUrl.length)throw new Error("bridgeURL is not a valid URL")}}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-iframe-bridge.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-keyring-v2.cjs",{"@metamask/keyring-api":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/keyring-api/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.LedgerKeyringV2=void 0;const l=e("@metamask/keyring-api"),d=e("@metamask/utils"),m=[l.EthMethod.SignTransaction,l.EthMethod.PersonalSign,l.EthMethod.SignTypedDataV4],u={scopes:[l.EthScope.Eoa],bip44:{deriveIndex:!0,derivePath:!0}},p=/^m\/44'\/60'\/(\d+)'\/0\/0$/u,h=/^(m\/44'\/60'(?:\/\d+'?)*)\/(\d+)$/u;class f extends l.EthKeyringWrapper{constructor(e){super({type:l.KeyringType.Ledger,inner:e.legacyKeyring,capabilities:u}),n.add(this),this.entropySource=e.entropySource}async getAccounts(){const e=await this.inner.getAccounts();return 0===e.length?[]:e.map(e=>{const t=this.registry.getAccountId(e);if(t){const e=this.registry.get(t);if(e)return e}const s=c(this,n,"m",o).call(this,e);return c(this,n,"m",i).call(this,e,s)})}async createAccounts(e){return this.withLock(async()=>{if("bip44:derive-path"!==e.type&&"bip44:derive-index"!==e.type)throw new Error(`Unsupported account creation type for LedgerKeyring: ${String(e.type)}`);if(e.entropySource!==this.entropySource)throw new Error(`Entropy source mismatch: expected '${this.entropySource}', got '${e.entropySource}'`);const t=await this.getAccounts();let s,r,o;if("bip44:derive-path"===e.type){const t=c(this,n,"m",a).call(this,e.derivationPath);s=t.index,r=t.basePath,o=e.derivationPath}else s=e.groupIndex,r="m/44'/60'/0'/0",o=`${r}/${s}`;const l=t.find(e=>e.options.entropy.groupIndex===s&&e.options.entropy.derivationPath===o);if(l)return[l];this.inner.setHdPath(r),this.inner.setAccountToUnlock(s);const[d]=await this.inner.addAccounts(1);if(!d)throw new Error("Failed to create new account");return[c(this,n,"m",i).call(this,d,s)]})}async deleteAccount(e){await this.withLock(async()=>{const{address:t}=await this.getAccount(e),s=this.toHexAddress(t);this.inner.removeAccount(s),this.registry.delete(e)})}}s.LedgerKeyringV2=f,n=new WeakSet,r=function(e){return(0,d.getChecksumAddress)((0,d.add0x)(e))},a=function(e){const t=e.match(p);if(t?.[1])return{basePath:"m/44'/60'/0'/0/0",index:parseInt(t[1],10)};const s=e.match(h);if(s)return{basePath:s[1],index:parseInt(s[2],10)};throw new Error(`Invalid derivation path format: ${e}. Expected Ledger Live (m/44'/60'/{index}'/0/0) or index-at-end (m/44'/60'/.../{index}) format.`)},o=function(e){const t=c(this,n,"m",r).call(this,e),s=this.inner.accountDetails[t];if(!s)throw new Error(`Address ${t} not found in account details`);const{hdPath:a}=s;if(!a)throw new Error(`No HD path found for address ${t}`);if(s.bip44){const e=a.match(p);if(e?.[1])return parseInt(e[1],10)}else{const e=a.match(h);if(e?.[2])return parseInt(e[2],10)}throw new Error(`Could not extract index from HD path: ${a}`)},i=function(e,t){const s=this.registry.register(e),a=c(this,n,"m",r).call(this,e),o=this.inner.accountDetails[a];if(!o?.hdPath)throw new Error(`No HD path found for address ${a}. Cannot create account.`);const i={id:s,type:l.EthAccountType.Eoa,address:e,scopes:[...this.capabilities.scopes],methods:[...m],options:{entropy:{type:l.KeyringAccountEntropyTypeOption.Mnemonic,id:this.entropySource,groupIndex:t,derivationPath:o.hdPath}}};return this.registry.set(i),i}}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-keyring-v2.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-keyring.cjs",{"./ledger-error-handler.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-error-handler.cjs","@ethereumjs/rlp":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ethereumjs/rlp/dist/cjs/index.js","@ethereumjs/tx":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ethereumjs/tx/dist/cjs/index.js","@ethereumjs/util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ethereumjs/util/dist/cjs/index.js","@metamask/eth-sig-util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-sig-util/dist/index.js","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs",buffer:"/home/runner/work/metamask-extension/metamask-extension/node_modules/browserify/node_modules/buffer/index.js",hdkey:"/home/runner/work/metamask-extension/metamask-extension/node_modules/hdkey/lib/hdkey.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c,l,d,m,u,p,h,f,g,k,w=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)},y=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.LedgerKeyring=void 0;const b=e("@ethereumjs/rlp"),v=e("@ethereumjs/tx"),_=e("@ethereumjs/util"),x=e("@metamask/eth-sig-util"),E=e("@metamask/utils"),S=e("buffer"),T=y(e("hdkey")),j=e("./ledger-error-handler.cjs"),C="m",A=`${C}/44'/60'/0'`,I="Ledger Hardware";var P;!function(e){e.Ropsten="https://api-ropsten.etherscan.io",e.Kovan="https://api-kovan.etherscan.io",e.Rinkeby="https://api-rinkeby.etherscan.io",e.Mainnet="https://api.etherscan.io"}(P||(P={}));class O{constructor({bridge:e}){if(n.add(this),this.deviceId="",this.type=I,this.page=0,this.perPage=5,this.unlockedAccount=0,this.accounts=[],this.accountDetails={},this.hdk=new T.default,this.hdPath=A,this.paths={},this.network=P.Mainnet,this.implementFullBIP44=!1,!e)throw new Error("Bridge is a required dependency for the keyring");this.bridge=e}async init(){return this.bridge.init()}async destroy(){return this.bridge.destroy()}async serialize(){return{hdPath:this.hdPath,accounts:this.accounts.slice(),deviceId:this.deviceId,accountDetails:this.accountDetails,implementFullBIP44:!1}}async deserialize(e){this.hdPath=e.hdPath??A,this.accounts=e.accounts??[],this.deviceId=e.deviceId??"",this.accountDetails=e.accountDetails??{},e.accountDetails||w(this,n,"m",r).call(this,e),this.implementFullBIP44=e.implementFullBIP44??!1;const t=new Set(Object.keys(this.accountDetails));return this.accounts=this.accounts.filter(e=>t.has(w(this,n,"m",g).call(this,e))),Promise.resolve()}setDeviceId(e){this.deviceId=e}getDeviceId(){return this.deviceId}isUnlocked(){return Boolean(this.hdk.publicKey)}isConnected(){return this.bridge.isDeviceConnected}setAccountToUnlock(e){this.unlockedAccount=e}setHdPath(e){this.hdPath!==e&&(this.hdk=new T.default),this.hdPath=e}async unlock(e,t=!0){if(this.isUnlocked()&&!e)return w(this,n,"m",g).call(this,(0,E.bytesToHex)((0,_.publicToAddress)(this.hdk.publicKey,!0)));const s=e?w(this,n,"m",p).call(this,e):this.hdPath;let r;try{r=await this.bridge.getPublicKey({hdPath:s})}catch(e){(0,j.handleLedgerTransportError)(e,"Ledger: Unknown error while unlocking account")}return t&&r.chainCode&&(this.hdk.publicKey=S.Buffer.from(r.publicKey,"hex"),this.hdk.chainCode=S.Buffer.from(r.chainCode,"hex")),(0,E.add0x)(r.address)}async addAccounts(e){return new Promise((t,s)=>{this.unlock().then(async s=>{const r=this.unlockedAccount,a=r+e,o=[];for(let e=r;e<a;e++){const t=w(this,n,"m",m).call(this,e);let s;s=w(this,n,"m",u).call(this)?await this.unlock(t):w(this,n,"m",l).call(this,C,e),this.accountDetails[w(this,n,"m",g).call(this,s)]={bip44:w(this,n,"m",u).call(this),hdPath:t},this.accounts.includes(s)||(this.accounts=[...this.accounts,s],o.push(s)),this.page=0}t(o)}).catch(s)})}getName(){return I}async getFirstPage(){return this.page=0,w(this,n,"m",o).call(this,1)}async getNextPage(){return w(this,n,"m",o).call(this,1)}async getPreviousPage(){return w(this,n,"m",o).call(this,-1)}async getAccounts(){return Promise.resolve(this.accounts.slice())}removeAccount(e){const t=this.accounts.filter(t=>t.toLowerCase()!==e.toLowerCase());if(t.length===this.accounts.length)throw new Error(`Address ${e} not found in this keyring`);this.accounts=t,delete this.accountDetails[w(this,n,"m",g).call(this,e)]}async attemptMakeApp(){return this.bridge.attemptMakeApp()}async updateTransportMethod(e){return this.bridge.updateTransportMethod(e)}async getAppNameAndVersion(){try{return await this.bridge.getAppNameAndVersion()}catch(e){return(0,j.handleLedgerTransportError)(e,"Ledger: Unknown error while getting app name and version")}}async getAppConfiguration(){try{return await this.bridge.getAppConfiguration()}catch(e){return(0,j.handleLedgerTransportError)(e,"Ledger: Unknown error while getting app configuration")}}async signTransaction(e,t){let s;if(function(e){return"getChainId"in e&&"function"==typeof e.getChainId}(t))return t.v=t.getChainId(),t.r="0x00",t.s="0x00",s=t.serialize().toString("hex"),w(this,n,"m",a).call(this,e,s,e=>(t.v=S.Buffer.from(e.v,"hex"),t.r=S.Buffer.from(e.r,"hex"),t.s=S.Buffer.from(e.s,"hex"),t));const r=t.getMessageToSign();return s=Array.isArray(r)?S.Buffer.from(b.RLP.encode(r)).toString("hex"):(0,E.bytesToHex)(r),w(this,n,"m",a).call(this,e,s,e=>{const s=t.toJSON();return s.type=t.type,s.v=(0,E.add0x)(e.v),s.r=(0,E.add0x)(e.r),s.s=(0,E.add0x)(e.s),v.TransactionFactory.fromTxData(s,{common:t.common,freeze:Object.isFrozen(t)})})}async signMessage(e,t){return this.signPersonalMessage(e,t)}async signPersonalMessage(e,t){const s=await this.unlockAccountByAddress(e);if(!s)throw new Error("Ledger: Unknown error while signing message");let r;try{r=await this.bridge.deviceSignMessage({hdPath:s,message:(0,E.remove0x)(t)})}catch(e){(0,j.handleLedgerTransportError)(e,"Ledger: Unknown error while signing message")}const a=w(this,n,"m",k).call(this,parseInt(String(r.v),10)),o=`0x${r.r}${r.s}${a}`,i=(0,x.recoverPersonalSignature)({data:t,signature:o});if(w(this,n,"m",g).call(this,i)!==w(this,n,"m",g).call(this,e))throw new Error("Ledger: The signature doesnt match the right address");return o}async unlockAccountByAddress(e){const t=w(this,n,"m",g).call(this,e),s=this.accountDetails[t];if(!s)throw new Error(`Ledger: Account for address '${t}' not found`);const{hdPath:r}=s;if((await this.unlock(r,!1)).toLowerCase()!==e.toLowerCase())throw new Error(`Ledger: Account ${e} does not belong to the connected device`);return r}async signTypedData(e,t,s){const{version:r}=s??{};if(!("V4"===r))throw new Error("Ledger: Only version 4 of typed data signing is supported");const{domain:a,types:o,primaryType:i,message:c}=x.TypedDataUtils.sanitizeData(t),l=await this.unlockAccountByAddress(e);if(!l)throw new Error("Ledger: Unknown error while signing message");let d;try{d=await this.bridge.deviceSignTypedData({hdPath:l,message:{domain:{name:a.name,chainId:a.chainId,version:a.version,verifyingContract:a.verifyingContract,salt:a.salt instanceof ArrayBuffer?S.Buffer.from(a.salt).toString("hex"):a.salt},types:o,primaryType:i.toString(),message:c}})}catch(e){(0,j.handleLedgerTransportError)(e,"Ledger: Unknown error while signing message")}const m=w(this,n,"m",k).call(this,parseInt(String(d.v),10)),u=`0x${d.r}${d.s}${m}`,p=(0,x.recoverTypedSignature)({data:t,signature:u,version:x.SignTypedDataVersion.V4});if(w(this,n,"m",g).call(this,p)!==w(this,n,"m",g).call(this,e))throw new Error("Ledger: The signature doesnt match the right address");return u}forgetDevice(){this.deviceId="",this.accounts=[],this.page=0,this.unlockedAccount=0,this.paths={},this.accountDetails={},this.hdk=new T.default}}s.LedgerKeyring=O,n=new WeakSet,r=function(e){if(w(this,n,"m",u).call(this)&&e.accountIndexes)for(const[t,s]of Object.entries(e.accountIndexes))this.accountDetails[t]={bip44:!0,hdPath:w(this,n,"m",m).call(this,s)};const t=new Set(Object.keys(this.accountDetails));w(this,n,"m",u).call(this)||this.accounts.forEach(e=>{const s=w(this,n,"m",g).call(this,e);t.has(s)||(this.accountDetails[s]={bip44:!1,hdPath:w(this,n,"m",d).call(this,e)})})},a=async function(e,t,s){const n=await this.unlockAccountByAddress(e);if(!n)throw new Error("Ledger: hdPath is empty while signing transaction");let r;try{r=await this.bridge.deviceSignTransaction({tx:(0,E.remove0x)(t),hdPath:n})}catch(e){(0,j.handleLedgerTransportError)(e,"Ledger: Unknown error while signing transaction")}const a=s(r);if(a.verifySignature())return a;throw new Error("Ledger: The transaction signature is not valid")},o=async function(e){this.page+=e,this.page<=0&&(this.page=1);const t=(this.page-1)*this.perPage,s=t+this.perPage;let r;return await this.unlock(),r=w(this,n,"m",u).call(this)?await w(this,n,"m",i).call(this,t,s):w(this,n,"m",c).call(this,t,s),r},i=async function(e,t){const s=[];for(let r=e;r<t;r++){const e=w(this,n,"m",m).call(this,r),t=await this.unlock(e),a=!this.implementFullBIP44||await w(this,n,"m",h).call(this,t);if(s.push({address:t,balance:null,index:r}),!a)break}return s},c=function(e,t){const s=[];for(let r=e;r<t;r++){const e=w(this,n,"m",l).call(this,C,r);s.push({address:e,balance:null,index:r}),this.paths[w(this,n,"m",g).call(this,e)]=r}return s},l=function(e,t){const s=this.hdk.derive(`${e}/${t}`),r=(0,E.bytesToHex)((0,_.publicToAddress)(s.publicKey,!0));return w(this,n,"m",g).call(this,r)},d=function(e){const t=w(this,n,"m",g).call(this,e);let s=this.paths[t];if(void 0===s)for(let e=0;e<1e3;e++)if(t===w(this,n,"m",l).call(this,C,e)){s=e;break}if(void 0===s)throw new Error("Unknown address");return w(this,n,"m",m).call(this,s)},m=function(e){return w(this,n,"m",u).call(this)?`m/44'/60'/${e}'/0/0`:`${this.hdPath}/${e}`},u=function(){return"m/44'/60'/0'/0/0"===this.hdPath},p=function(e){return e.toString().replace("m/","")},h=async function(e){const t=w(this,n,"m",f).call(this),s=await window.fetch(`${t}/api?module=account&action=txlist&address=${e}&tag=latest&page=1&offset=1`),r=await s.json();return"0"!==r.status&&r.result.length>0},f=function(){return this.network},g=function(e){return(0,E.getChecksumAddress)((0,E.add0x)(e))},k=function(e){return 0===e||1===e?(e+27).toString(16):e.toString(16)},O.type=I}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-keyring.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-mobile-bridge.cjs",{"./ledger-hw-app.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-hw-app.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},l=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.LedgerMobileBridge=void 0;e("./ledger-hw-app.cjs");s.LedgerMobileBridge=class{constructor(e,t={}){n.add(this),r.set(this,void 0),a.set(this,void 0),this.isDeviceConnected=!1,c(this,a,t,"f"),c(this,r,e,"f")}async init(){return Promise.resolve()}async destroy(){try{await l(this,n,"m",o).call(this).dispose()}catch(e){console.error(e)}this.isDeviceConnected=!1}async deviceSignMessage({hdPath:e,message:t}){return l(this,n,"m",i).call(this).signPersonalMessage(e,t)}async deviceSignTypedData({hdPath:e,message:t}){return l(this,n,"m",i).call(this).signEIP712Message(e,t)}async deviceSignTransaction({tx:e,hdPath:t}){return l(this,n,"m",i).call(this).clearSignTransaction(t,e,{externalPlugins:!0,erc20:!0,nft:!0})}async getPublicKey({hdPath:e}){return await l(this,n,"m",i).call(this).getAddress(e,!1,!0)}async getOptions(){return l(this,a,"f")}async setOptions(e){c(this,a,e,"f")}async updateTransportMethod(e){if(!e.deviceModel)throw new Error("Property `deviceModel` is not defined in `transport`.");if(!e.deviceModel.id)throw new Error("Property `deviceModel.id` is not defined in `transport`.");return l(this,n,"m",o).call(this).setTransport(e),this.isDeviceConnected=!0,Promise.resolve(!0)}async attemptMakeApp(){throw new Error("Method not supported.")}async openEthApp(){await l(this,n,"m",i).call(this).openEthApp()}async closeApps(){await l(this,n,"m",i).call(this).closeApps()}async getAppNameAndVersion(){return l(this,n,"m",i).call(this).getAppNameAndVersion()}async getAppConfiguration(){return l(this,n,"m",i).call(this).getAppConfiguration()}},r=new WeakMap,a=new WeakMap,n=new WeakSet,o=function(){if(l(this,r,"f"))return l(this,r,"f");throw new Error("Instance `transportMiddleware` is not initialized.")},i=function(){return l(this,n,"m",o).call(this).getEthApp()}}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-mobile-bridge.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-transport-middleware.cjs",{"./ledger-hw-app.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-hw-app.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},a=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.LedgerTransportMiddleware=void 0;const o=e("./ledger-hw-app.cjs");s.LedgerTransportMiddleware=class{constructor(){this.mainAppName="BOLOS",this.ethAppName="Ethereum",this.transportEncoding="ascii",n.set(this,void 0)}async dispose(){const e=this.getTransport();await e.close()}setTransport(e){r(this,n,e,"f")}getTransport(){if(!a(this,n,"f"))throw new Error("Instance `transport` is not initialized.");return a(this,n,"f")}getEthApp(){return new o.MetaMaskLedgerHwAppEth(this.getTransport())}},n=new WeakMap}}},{package:"@metamask/eth-ledger-bridge-keyring",file:"node_modules/@metamask/eth-ledger-bridge-keyring/dist/ledger-transport-middleware.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-error-mappings.cjs",{"./hardware-errors-enums.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-errors-enums.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.MOBILE_ERROR_MAPPINGS=s.BLE_ERROR_MAPPINGS=s.LEDGER_ERROR_MAPPINGS=void 0;const n=e("./hardware-errors-enums.cjs");s.LEDGER_ERROR_MAPPINGS={"0x9000":{code:n.ErrorCode.Success,message:"Operation successful",severity:n.Severity.Info,category:n.Category.Success},"0x6300":{code:n.ErrorCode.AuthenticationFailed,message:"Authentication failed",severity:n.Severity.Err,category:n.Category.Authentication,userMessage:"Authentication failed. Please verify your credentials."},"0x63c0":{code:n.ErrorCode.AuthenticationPinAttemptsRemaining,message:"PIN attempts remaining",severity:n.Severity.Warning,category:n.Category.Authentication,userMessage:"Incorrect PIN. Please try again."},"0x6982":{code:n.ErrorCode.AuthenticationSecurityCondition,message:"Security conditions not satisfied",severity:n.Severity.Err,category:n.Category.Authentication,userMessage:"Device is locked or access rights are insufficient. Please unlock your device."},"0x6985":{code:n.ErrorCode.UserRejected,message:"User rejected action on device",severity:n.Severity.Warning,category:n.Category.UserAction,userMessage:"Transaction was rejected. Please approve on your device to continue."},"0x9804":{code:n.ErrorCode.AuthenticationSecurityCondition,message:"App update required",severity:n.Severity.Err,category:n.Category.Authentication,userMessage:"Please update your Ledger app to continue."},"0x9808":{code:n.ErrorCode.AuthenticationFailed,message:"Contradiction in secret code status",severity:n.Severity.Err,category:n.Category.Authentication},"0x9840":{code:n.ErrorCode.AuthenticationDeviceBlocked,message:"Code blocked",severity:n.Severity.Critical,category:n.Category.Authentication,userMessage:"Your device is blocked due to too many failed attempts. Please follow device recovery procedures."},"0x650f":{code:n.ErrorCode.ConnectionClosed,message:"App closed or connection issue",severity:n.Severity.Err,category:n.Category.Connection,userMessage:"Connection lost or app closed. Please open the corresponding app on your Ledger device."},"0x5515":{code:n.ErrorCode.AuthenticationDeviceLocked,message:"Device is locked",severity:n.Severity.Err,category:n.Category.Authentication,userMessage:"Please unlock your Ledger device to continue."},"0x5501":{code:n.ErrorCode.UserRejected,message:"User refused on device",severity:n.Severity.Warning,category:n.Category.UserAction,userMessage:"Operation was rejected. Please approve on your device to continue."},"0x6a80":{code:n.ErrorCode.DeviceStateBlindSignNotSupported,message:"Blind signing not supported",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"Blind signing is not supported on this device."},"0x6d00":{code:n.ErrorCode.DeviceStateOnlyV4Supported,message:"Ledger Only V4 supported",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"Only V4 is supported on this device."},"0x6e00":{code:n.ErrorCode.DeviceStateEthAppClosed,message:"Ethereum app closed",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"Ethereum app is closed. Please open it to continue."},"0x6501":{code:n.ErrorCode.DeviceStateEthAppOutOfDate,message:"Ethereum app out of date",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"Ethereum app is out of date. Please update it to continue."},"0x6f00":{code:n.ErrorCode.DeviceUnresponsive,message:"Device unresponsive",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"Your device is not responding. Please disconnect and reconnect your device."},"0x6b0c":{code:n.ErrorCode.AuthenticationDeviceLocked,message:"Device locked",severity:n.Severity.Err,category:n.Category.Authentication,userMessage:"Please unlock your Ledger device to continue."},"0x6a15":{code:n.ErrorCode.DeviceStateEthAppClosed,message:"Ethereum app closed",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"Ethereum app is closed. Please open it to continue."},"0x6511":{code:n.ErrorCode.DeviceStateEthAppClosed,message:"Ethereum app closed",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"Ethereum app is closed. Please open it to continue."}},s.BLE_ERROR_MAPPINGS={BLUETOOTH_PERMISSION_DENIED:{code:n.ErrorCode.PermissionBluetoothDenied,message:"Bluetooth permission denied",severity:n.Severity.Err,category:n.Category.Configuration,userMessage:"Bluetooth permission is required to connect to your hardware wallet. Please enable it in your device settings."},LOCATION_PERMISSION_DENIED:{code:n.ErrorCode.PermissionLocationDenied,message:"Location permission denied",severity:n.Severity.Err,category:n.Category.Configuration,userMessage:"Location permission is required for Bluetooth scanning on Android. Please enable it in your device settings."},NEARBY_DEVICES_PERMISSION_DENIED:{code:n.ErrorCode.PermissionNearbyDevicesDenied,message:"Nearby devices permission denied",severity:n.Severity.Err,category:n.Category.Configuration,userMessage:"Nearby devices permission is required to scan for your hardware wallet. Please enable it in your device settings."},BLUETOOTH_DISABLED:{code:n.ErrorCode.BluetoothDisabled,message:"Bluetooth is turned off",severity:n.Severity.Warning,category:n.Category.Connection,userMessage:"Bluetooth is turned off. Please enable Bluetooth to connect to your hardware wallet."},BLUETOOTH_SCAN_FAILED:{code:n.ErrorCode.BluetoothScanFailed,message:"Bluetooth scanning failed",severity:n.Severity.Err,category:n.Category.Connection,userMessage:"Unable to scan for Bluetooth devices. Please try again."},BLUETOOTH_CONNECTION_FAILED:{code:n.ErrorCode.BluetoothConnectionFailed,message:"Bluetooth connection failed",severity:n.Severity.Err,category:n.Category.Connection,userMessage:"Failed to connect via Bluetooth. Please make sure your device is nearby and try again."}},s.MOBILE_ERROR_MAPPINGS={NOT_SUPPORTED:{code:n.ErrorCode.MobileNotSupported,message:"Operation not supported on mobile",severity:n.Severity.Err,category:n.Category.DeviceState,userMessage:"This operation is not supported on mobile devices."}}}}},{package:"@metamask/eth-ledger-bridge-keyring>@metamask/hw-wallet-sdk",file:"node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-error-mappings.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-error.cjs",{"./hardware-errors-enums.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-errors-enums.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.HardwareWalletError=void 0;const o=e("./hardware-errors-enums.cjs");class i extends Error{constructor(e,t){super(e),n.add(this),this.name="HardwareWalletError",this.id=`err_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,9)}`,this.code=t.code,this.severity=t.severity,this.category=t.category,this.userMessage=t.userMessage,this.timestamp=new Date,this.metadata=t.metadata,this.cause=t.cause}isCritical(){return this.severity===o.Severity.Critical}isWarning(){return this.severity===o.Severity.Warning}withMetadata(e){const t={code:this.code,severity:this.severity,category:this.category,userMessage:this.userMessage,metadata:{...this.metadata??{},...e}};return this.cause!==undefined&&(t.cause=this.cause),new i(this.message,t)}toJSON(){const e={id:this.id,name:this.name,message:this.message,code:this.code,severity:this.severity,category:this.category,userMessage:this.userMessage,timestamp:this.timestamp.toISOString(),metadata:this.metadata};return this.cause!==undefined&&(e.cause={name:this.cause.name,message:this.cause.message}),e}toString(){return`${a(this,n,"m",r).call(this)}: ${this.message}`}toDetailedString(){const e=[this.toString(),`User Message: ${this.userMessage}`,`Severity: ${this.severity}`,`Category: ${this.category}`,`Timestamp: ${this.timestamp.toISOString()}`];return this.metadata&&Object.keys(this.metadata).length>0&&e.push(`Metadata: ${JSON.stringify(this.metadata,null,2)}`),this.cause!==undefined&&e.push(`Caused by: ${this.cause.message}`),e.join("\n")}static isHardwareWalletError(e){return e instanceof i}}s.HardwareWalletError=i,n=new WeakSet,r=function(){const e=(t=this.code,o.ErrorCode[t]??o.ErrorCode[o.ErrorCode.Unknown]);var t;return`${this.name} [${e}:${this.code}]`}}}},{package:"@metamask/eth-ledger-bridge-keyring>@metamask/hw-wallet-sdk",file:"node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-error.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-errors-enums.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a;Object.defineProperty(s,"__esModule",{value:!0}),s.Category=s.Severity=s.ErrorCode=void 0,function(e){e[e.Success=0]="Success",e[e.AuthenticationFailed=1e3]="AuthenticationFailed",e[e.AuthenticationIncorrectPin=1001]="AuthenticationIncorrectPin",e[e.AuthenticationPinAttemptsRemaining=1002]="AuthenticationPinAttemptsRemaining",e[e.AuthenticationPinCancelled=1003]="AuthenticationPinCancelled",e[e.AuthenticationDeviceLocked=1100]="AuthenticationDeviceLocked",e[e.AuthenticationDeviceBlocked=1101]="AuthenticationDeviceBlocked",e[e.AuthenticationSecurityCondition=1200]="AuthenticationSecurityCondition",e[e.AuthenticationWipeCodeMismatch=1300]="AuthenticationWipeCodeMismatch",e[e.UserRejected=2e3]="UserRejected",e[e.UserCancelled=2001]="UserCancelled",e[e.UserConfirmationRequired=2002]="UserConfirmationRequired",e[e.UserInputRequired=2003]="UserInputRequired",e[e.DeviceNotReady=3e3]="DeviceNotReady",e[e.DeviceInvalidSession=3001]="DeviceInvalidSession",e[e.DeviceDisconnected=3003]="DeviceDisconnected",e[e.DeviceUsedElsewhere=3004]="DeviceUsedElsewhere",e[e.DeviceCallInProgress=3005]="DeviceCallInProgress",e[e.DeviceUnresponsive=3006]="DeviceUnresponsive",e[e.DeviceNotFound=3010]="DeviceNotFound",e[e.DeviceMultipleConnected=3011]="DeviceMultipleConnected",e[e.DeviceMissingCapability=3020]="DeviceMissingCapability",e[e.DeviceBtcOnlyFirmware=3021]="DeviceBtcOnlyFirmware",e[e.DeviceIncompatibleMode=3030]="DeviceIncompatibleMode",e[e.ConnectionTransportMissing=4e3]="ConnectionTransportMissing",e[e.ConnectionClosed=4001]="ConnectionClosed",e[e.ConnectionTimeout=4002]="ConnectionTimeout",e[e.ConnectionBlocked=4003]="ConnectionBlocked",e[e.ProtocolUnexpectedMessage=5e3]="ProtocolUnexpectedMessage",e[e.ProtocolCommandError=5001]="ProtocolCommandError",e[e.ProtocolMessageError=5002]="ProtocolMessageError",e[e.DeviceStateBlindSignNotSupported=6001]="DeviceStateBlindSignNotSupported",e[e.DeviceStateOnlyV4Supported=6002]="DeviceStateOnlyV4Supported",e[e.DeviceStateEthAppClosed=6003]="DeviceStateEthAppClosed",e[e.DeviceStateEthAppOutOfDate=6004]="DeviceStateEthAppOutOfDate",e[e.PermissionBluetoothDenied=7e3]="PermissionBluetoothDenied",e[e.PermissionLocationDenied=7001]="PermissionLocationDenied",e[e.PermissionNearbyDevicesDenied=7002]="PermissionNearbyDevicesDenied",e[e.BluetoothDisabled=7100]="BluetoothDisabled",e[e.BluetoothScanFailed=7101]="BluetoothScanFailed",e[e.BluetoothConnectionFailed=7102]="BluetoothConnectionFailed",e[e.MobileNotSupported=7300]="MobileNotSupported",e[e.TxInsufficientFunds=1e4]="TxInsufficientFunds",e[e.Unknown=99999]="Unknown"}(n||(s.ErrorCode=n={})),function(e){e.Info="Info",e.Err="Error",e.Warning="Warning",e.Critical="Critical"}(r||(s.Severity=r={})),function(e){e.Success="Success",e.Authentication="Authentication",e.Protocol="Protocol",e.Connection="Connection",e.UserAction="UserAction",e.DeviceState="DeviceState",e.Unknown="Unknown",e.Configuration="Configuration"}(a||(s.Category=a={}))}}},{package:"@metamask/eth-ledger-bridge-keyring>@metamask/hw-wallet-sdk",file:"node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-errors-enums.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/index.cjs",{"./hardware-error-mappings.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-error-mappings.cjs","./hardware-error.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-error.cjs","./hardware-errors-enums.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/hardware-errors-enums.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/types.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]}),r=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./hardware-errors-enums.cjs"),s),r(e("./hardware-error-mappings.cjs"),s),r(e("./hardware-error.cjs"),s),r(e("./types.cjs"),s)}}},{package:"@metamask/eth-ledger-bridge-keyring>@metamask/hw-wallet-sdk",file:"node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/types.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a;Object.defineProperty(s,"__esModule",{value:!0}),s.DeviceEvent=s.ConnectionStatus=s.HardwareWalletType=void 0,function(e){e.Ledger="ledger",e.Trezor="trezor",e.OneKey="onekey",e.Lattice="lattice",e.Qr="qr",e.Unknown="unknown"}(n||(s.HardwareWalletType=n={})),function(e){e.Disconnected="disconnected",e.Scanning="scanning",e.Connecting="connecting",e.Connected="connected",e.Ready="ready",e.AwaitingApp="awaiting_app",e.AwaitingConfirmation="awaiting_confirmation",e.ErrorState="error"}(r||(s.ConnectionStatus=r={})),function(e){e.Connected="connected",e.Disconnected="disconnected",e.ConnectionFailed="connection_failed",e.DeviceLocked="device_locked",e.AppOpened="app_opened",e.AppNotOpen="app_not_open",e.AppChanged="app_changed",e.ConfirmationRequired="confirmation_required",e.ConfirmationReceived="confirmation_received",e.ConfirmationRejected="confirmation_rejected",e.OperationTimeout="operation_timeout",e.PermissionChanged="permission_changed"}(a||(s.DeviceEvent=a={}))}}},{package:"@metamask/eth-ledger-bridge-keyring>@metamask/hw-wallet-sdk",file:"node_modules/@metamask/eth-ledger-bridge-keyring/node_modules/@metamask/hw-wallet-sdk/dist/types.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/index.cjs",{"./onekey-keyring.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/onekey-keyring.cjs","./trezor-connect-bridge.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/trezor-connect-bridge.cjs","./trezor-keyring.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/trezor-keyring.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]}),r=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./trezor-keyring.cjs"),s),r(e("./onekey-keyring.cjs"),s),r(e("./trezor-connect-bridge.cjs"),s)}}},{package:"@metamask/eth-trezor-keyring",file:"node_modules/@metamask/eth-trezor-keyring/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/onekey-keyring.cjs",{"./trezor-keyring.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/trezor-keyring.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OneKeyKeyring=void 0;const n=e("./trezor-keyring.cjs"),r="OneKey Hardware";class a extends n.TrezorKeyring{constructor(){super(...arguments),this.type=r}}s.OneKeyKeyring=a,a.type=r}}},{package:"@metamask/eth-trezor-keyring",file:"node_modules/@metamask/eth-trezor-keyring/dist/onekey-keyring.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/trezor-connect-bridge.cjs",{"@trezor/connect-web":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@trezor/connect-web/lib/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]}),r=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 s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&n(t,e,s);return r(t,e),t};Object.defineProperty(s,"__esModule",{value:!0}),s.TrezorConnectBridge=void 0;const o=a(e("@trezor/connect-web"));s.TrezorConnectBridge=class{constructor(){this.trezorConnectInitiated=!1}async init(e){o.default.on(o.DEVICE_EVENT,e=>{var t;e.type===o.DEVICE.CONNECT&&(this.model=null===(t=e.payload.features)||void 0===t?void 0:t.model)}),this.trezorConnectInitiated||(await o.default.init(e),this.trezorConnectInitiated=!0)}async dispose(){return o.default.dispose(),Promise.resolve()}getPublicKey(e){return o.default.getPublicKey(e)}ethereumSignTransaction(e){return o.default.ethereumSignTransaction(e)}ethereumSignMessage(e){return o.default.ethereumSignMessage(e)}ethereumSignTypedData(e){return o.default.ethereumSignTypedData(e)}}}}},{package:"@metamask/eth-trezor-keyring",file:"node_modules/@metamask/eth-trezor-keyring/dist/trezor-connect-bridge.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-trezor-keyring/dist/trezor-keyring.cjs",{"@ethereumjs/tx":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ethereumjs/tx/dist/cjs/index.js","@ethereumjs/util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@ethereumjs/util/dist/cjs/index.js","@metamask/eth-sig-util":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-sig-util/dist/index.js","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs","@trezor/connect-plugin-ethereum":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@trezor/connect-plugin-ethereum/lib/index.js",buffer:"/home/runner/work/metamask-extension/metamask-extension/node_modules/browserify/node_modules/buffer/index.js",hdkey:"/home/runner/work/metamask-extension/metamask-extension/node_modules/hdkey/lib/hdkey.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){(function(t){(function(){var n,r,a,o,i,c,l=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.TrezorKeyring=s.TREZOR_CONNECT_MANIFEST=void 0;const m=e("@ethereumjs/tx"),u=e("@ethereumjs/util"),p=e("@metamask/eth-sig-util"),h=e("@metamask/utils"),f=e("@trezor/connect-plugin-ethereum"),g=d(e("hdkey")),k="m/44'/60'/0'/0",w="m/44'/1'/0'/0",y="m/44'/60'/0'",b={[k]:!0,[y]:!0,[w]:!0},v="Trezor Hardware",_=1e3;async function x(e){return new Promise(t=>setTimeout(t,e))}function E(e){return"function"==typeof e.getChainId}s.TREZOR_CONNECT_MANIFEST={appName:"MetaMask",email:"support@metamask.io",appUrl:"https://metamask.io"};class S{constructor({bridge:e}){if(n.add(this),this.type=v,this.accounts=[],this.hdk=new g.default,this.hdPath=k,this.page=0,this.perPage=5,this.unlockedAccount=0,this.paths={},!e)throw new Error("Bridge is a required dependency for the keyring");this.bridge=e}getModel(){return this.bridge.model}async init(){return this.bridge.init({manifest:s.TREZOR_CONNECT_MANIFEST,lazyLoad:!0})}async destroy(){return this.bridge.dispose()}async serialize(){return Promise.resolve({hdPath:this.hdPath,accounts:this.accounts.slice(),page:this.page,paths:this.paths,perPage:this.perPage,unlockedAccount:this.unlockedAccount})}async deserialize(e){var t,s,n,r;return this.hdPath=null!==(t=e.hdPath)&&void 0!==t?t:k,this.accounts=null!==(s=e.accounts)&&void 0!==s?s:[],this.page=null!==(n=e.page)&&void 0!==n?n:0,this.perPage=null!==(r=e.perPage)&&void 0!==r?r:5,Promise.resolve()}isUnlocked(){var e;return Boolean(null===(e=this.hdk)||void 0===e?void 0:e.publicKey)}async unlock(){return this.isUnlocked()?Promise.resolve("already unlocked"):new Promise((e,s)=>{this.bridge.getPublicKey({path:this.hdPath,coin:"ETH"}).then(n=>{var r;n.success?(this.hdk.publicKey=t.from(n.payload.publicKey,"hex"),this.hdk.chainCode=t.from(n.payload.chainCode,"hex"),e("just unlocked")):s(new Error((null===(r=n.payload)||void 0===r?void 0:r.error)||"Unknown error"))}).catch(e=>{s(new Error((null==e?void 0:e.toString())||"Unknown error"))})})}setAccountToUnlock(e){this.unlockedAccount=parseInt(String(e),10)}async addAccounts(e){return new Promise((t,s)=>{this.unlock().then(s=>{const r=this.unlockedAccount,a=r+e,o=[];for(let e=r;e<a;e++){const t=l(this,n,"m",i).call(this,"m",e);this.accounts.includes(t)||(this.accounts=[...this.accounts,t],o.push(t)),this.page=0}t(o)}).catch(e=>{s(e)})})}async getFirstPage(){return this.page=0,l(this,n,"m",r).call(this,1)}async getNextPage(){return l(this,n,"m",r).call(this,1)}async getPreviousPage(){return l(this,n,"m",r).call(this,-1)}async getAccounts(){return Promise.resolve(this.accounts.slice())}removeAccount(e){if(!this.accounts.map(e=>e.toLowerCase()).includes(e.toLowerCase()))throw new Error(`Address ${e} not found in this keyring`);this.accounts=this.accounts.filter(t=>t.toLowerCase()!==e.toLowerCase())}async signTransaction(e,s){return E(s)?l(this,n,"m",a).call(this,e,s.getChainId(),s,e=>(s.v=t.from(e.v,"hex"),s.r=t.from(e.r,"hex"),s.s=t.from(e.s,"hex"),s)):l(this,n,"m",a).call(this,e,Number(s.common.chainId()),s,e=>{const t=s.toJSON();return t.type=s.type,t.v=(0,h.add0x)(e.v),t.r=(0,h.add0x)(e.r),t.s=(0,h.add0x)(e.s),m.TransactionFactory.fromTxData(t,{common:s.common,freeze:Object.isFrozen(s)})})}async signMessage(e,t){return this.signPersonalMessage(e,t)}async signPersonalMessage(e,t){return new Promise((s,r)=>{this.unlock().then(a=>{setTimeout(()=>{this.bridge.ethereumSignMessage({path:l(this,n,"m",c).call(this,e),message:(0,h.remove0x)(t),hex:!0}).then(t=>{var n;if(t.success){t.payload.address!==(0,h.getChecksumAddress)(e)&&r(new Error("signature doesnt match the right address"));const n=`0x${t.payload.signature}`;s(n)}else r(new Error((null===(n=t.payload)||void 0===n?void 0:n.error)||"Unknown error"))}).catch(e=>{r(new Error((null==e?void 0:e.toString())||"Unknown error"))})},"just unlocked"===a?_:0)}).catch(e=>{r(new Error((null==e?void 0:e.toString())||"Unknown error"))})})}async signTypedData(e,t,s){var r,a;const{version:o}=null!=s?s:{version:p.SignTypedDataVersion.V4},i=(0,f.transformTypedData)(t,o===p.SignTypedDataVersion.V4),{types:d,message:m={},domain:u={},primaryType:g,domain_separator_hash:k,message_hash:w}=i,y=await this.unlock();await x("just unlocked"===y?_:0);const b=await this.bridge.ethereumSignTypedData({path:l(this,n,"m",c).call(this,e),data:{types:Object.assign(Object.assign({},d),{EIP712Domain:null!==(r=d.EIP712Domain)&&void 0!==r?r:[]}),message:m,domain:u,primaryType:g},metamask_v4_compat:!0,domain_separator_hash:k,message_hash:null!=w?w:""});if(b.success){if((0,h.getChecksumAddress)(e)!==b.payload.address)throw new Error("signature doesnt match the right address");return b.payload.signature}throw new Error((null===(a=b.payload)||void 0===a?void 0:a.error)||"Unknown error")}forgetDevice(){this.accounts=[],this.hdk=new g.default,this.page=0,this.unlockedAccount=0,this.paths={}}setHdPath(e){if(!b[e])throw new Error(`The setHdPath method does not support setting HD Path to ${e}`);this.hdPath!==e&&(this.hdk=new g.default,this.accounts=[],this.page=0,this.perPage=5,this.unlockedAccount=0,this.paths={}),this.hdPath=e}}s.TrezorKeyring=S,n=new WeakSet,r=async function(e){return this.page+=e,this.page<=0&&(this.page=1),new Promise((e,t)=>{this.unlock().then(t=>{const s=(this.page-1)*this.perPage,r=s+this.perPage,a=[];for(let e=s;e<r;e++){const t=l(this,n,"m",i).call(this,"m",e);a.push({address:t,balance:null,index:e}),this.paths[(0,h.getChecksumAddress)(t)]=e}e(a)}).catch(e=>{t(e)})})},a=async function(e,s,r,a){var i,d,m,u;let p;p=E(r)?{to:l(this,n,"m",o).call(this,r.to),value:l(this,n,"m",o).call(this,r.value),data:l(this,n,"m",o).call(this,r.data),chainId:s,nonce:l(this,n,"m",o).call(this,r.nonce),gasLimit:l(this,n,"m",o).call(this,r.gasLimit),gasPrice:l(this,n,"m",o).call(this,r.gasPrice)}:Object.assign(Object.assign({},r.toJSON()),{chainId:s,to:l(this,n,"m",o).call(this,t.from(null!==(d=null===(i=r.to)||void 0===i?void 0:i.bytes)&&void 0!==d?d:[]))});try{const t=await this.unlock();await x("just unlocked"===t?_:0);const s=await this.bridge.ethereumSignTransaction({path:l(this,n,"m",c).call(this,e),transaction:p});if(s.success){const t=a(s.payload),n=(0,h.getChecksumAddress)((0,h.add0x)(t.getSenderAddress().toString("hex")));if(n!==(0,h.getChecksumAddress)(e))throw new Error("signature doesn't match the right address");return t}throw new Error((null===(m=s.payload)||void 0===m?void 0:m.error)||"Unknown error")}catch(e){throw new Error(null!==(u=null==e?void 0:e.toString())&&void 0!==u?u:"Unknown error")}},o=function(e){return(0,h.bytesToHex)(e)},i=function(e,t){const s=this.hdk.derive(`${e}/${t}`),n=(0,h.bytesToHex)((0,u.publicToAddress)(s.publicKey,!0));return(0,u.toChecksumAddress)(n)},c=function(e){const t=(0,h.getChecksumAddress)(e);let s=this.paths[t];if(void 0===s)for(let e=0;e<1e3;e++)if(t===l(this,n,"m",i).call(this,"m",e)){s=e;break}if(void 0===s)throw new Error("Unknown address");return`${this.hdPath}/${s}`},S.type=v}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/eth-trezor-keyring",file:"node_modules/@metamask/eth-trezor-keyring/dist/trezor-keyring.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/GasFeeController.cjs",{"./determineGasFeeCalculations.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/determineGasFeeCalculations.cjs","./gas-util.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/gas-util.cjs","@metamask/controller-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/controller-utils/dist/index.cjs","@metamask/eth-query":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/eth-query/index.js","@metamask/polling-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/index.cjs",uuid:"/home/runner/work/metamask-extension/metamask-extension/node_modules/uuid/dist/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},i=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.GasFeeController=s.GAS_ESTIMATE_TYPES=s.LEGACY_GAS_PRICES_API_URL=void 0;const l=e("@metamask/controller-utils"),d=c(e("@metamask/eth-query")),m=e("@metamask/polling-controller"),u=e("uuid"),p=c(e("./determineGasFeeCalculations.cjs")),h=e("./gas-util.cjs");s.LEGACY_GAS_PRICES_API_URL="https://api.metaswap.codefi.network/gasPrices",s.GAS_ESTIMATE_TYPES={FEE_MARKET:"fee-market",LEGACY:"legacy",ETH_GASPRICE:"eth_gasPrice",NONE:"none"};const f={gasFeeEstimatesByChainId:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0},gasFeeEstimates:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0},estimatedGasFeeTimeBounds:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0},gasEstimateType:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0},nonRPCGasFeeApisDisabled:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!1}},g={gasFeeEstimatesByChainId:{},gasFeeEstimates:{},estimatedGasFeeTimeBounds:{},gasEstimateType:s.GAS_ESTIMATE_TYPES.NONE,nonRPCGasFeeApisDisabled:!1};class k extends((0,m.StaticIntervalPollingController)()){constructor({interval:e=15e3,messenger:t,state:c,getCurrentNetworkEIP1559Compatibility:l,getCurrentAccountEIP1559Compatibility:m,getChainId:u,getCurrentNetworkLegacyGasAPICompatibility:p,getProvider:h,onNetworkDidChange:k,legacyAPIEndpoint:w=s.LEGACY_GAS_PRICES_API_URL,EIP1559APIEndpoint:y,clientId:b}){if(super({name:"GasFeeController",metadata:f,messenger:t,state:{...g,...c}}),n.add(this),r.set(this,void 0),this.intervalDelay=e,this.setIntervalLength(e),this.pollTokens=new Set,this.getCurrentNetworkEIP1559Compatibility=l,this.getCurrentNetworkLegacyGasAPICompatibility=p,this.getCurrentAccountEIP1559Compatibility=m,o(this,r,h,"f"),this.EIP1559APIEndpoint=y,this.legacyAPIEndpoint=w,this.clientId=b,this.ethQuery=new d.default(i(this,r,"f").call(this)),k&&u)this.currentChainId=u(),k(async e=>{await i(this,n,"m",a).call(this,e)});else{const{selectedNetworkClientId:e}=this.messenger.call("NetworkController:getState");this.currentChainId=this.messenger.call("NetworkController:getNetworkClientById",e).configuration.chainId,this.messenger.subscribe("NetworkController:networkDidChange",async e=>{await i(this,n,"m",a).call(this,e)})}}async resetPolling(){if(0!==this.pollTokens.size){const e=Array.from(this.pollTokens);this.stopPolling(),await this.getGasFeeEstimatesAndStartPolling(e[0]),e.slice(1).forEach(e=>{this.pollTokens.add(e)})}}async fetchGasFeeEstimates(e){return await this._fetchGasFeeEstimateData(e)}async getGasFeeEstimatesAndStartPolling(e){const t=e||(0,u.v1)();return this.pollTokens.add(t),1===this.pollTokens.size&&(await this._fetchGasFeeEstimateData(),this._poll()),t}async _fetchGasFeeEstimateData(e={}){const{shouldUpdateState:t=!0,networkClientId:s}=e;let n,r,a,o;if(s!==undefined){const e=this.messenger.call("NetworkController:getNetworkClientById",s);a="0x38"===e.configuration.chainId,o=(0,l.convertHexToDecimal)(e.configuration.chainId);try{r=await this.messenger.call("NetworkController:getEIP1559Compatibility",s)||!1}catch{r=!1}n=new d.default(e.provider)}n??(n=this.ethQuery),a??(a=this.getCurrentNetworkLegacyGasAPICompatibility()),o??(o=(0,l.convertHexToDecimal)(this.currentChainId));try{r??(r=await this.getEIP1559Compatibility())}catch(e){console.error(e),r??(r=!1)}const i=await(0,p.default)({isEIP1559Compatible:r,isLegacyGasAPICompatible:a,fetchGasEstimates:h.fetchGasEstimates,fetchGasEstimatesUrl:this.EIP1559APIEndpoint.replace("<chain_id>",`${o}`),fetchLegacyGasPriceEstimates:h.fetchLegacyGasPriceEstimates,fetchLegacyGasPriceEstimatesUrl:this.legacyAPIEndpoint.replace("<chain_id>",`${o}`),fetchEthGasPriceEstimate:h.fetchEthGasPriceEstimate,calculateTimeEstimate:h.calculateTimeEstimate,clientId:this.clientId,ethQuery:n,nonRPCGasFeeApisDisabled:this.state.nonRPCGasFeeApisDisabled});if(t){const e=(0,l.toHex)(o);this.update(t=>{this.currentChainId===e&&(t.gasFeeEstimates=i.gasFeeEstimates,t.estimatedGasFeeTimeBounds=i.estimatedGasFeeTimeBounds,t.gasEstimateType=i.gasEstimateType),t.gasFeeEstimatesByChainId??(t.gasFeeEstimatesByChainId={}),t.gasFeeEstimatesByChainId[e]={gasFeeEstimates:i.gasFeeEstimates,estimatedGasFeeTimeBounds:i.estimatedGasFeeTimeBounds,gasEstimateType:i.gasEstimateType}})}return i}disconnectPoller(e){this.pollTokens.delete(e),0===this.pollTokens.size&&this.stopPolling()}stopPolling(){this.intervalId&&clearInterval(this.intervalId),this.pollTokens.clear(),this.resetState()}destroy(){super.destroy(),this.stopPolling()}_poll(){this.intervalId&&clearInterval(this.intervalId),this.intervalId=setInterval(async()=>{await(0,l.safelyExecute)(()=>this._fetchGasFeeEstimateData())},this.intervalDelay)}async _executePoll({networkClientId:e}){await this._fetchGasFeeEstimateData({networkClientId:e})}resetState(){this.update(()=>g)}async getEIP1559Compatibility(){const e=await this.getCurrentNetworkEIP1559Compatibility(),t=this.getCurrentAccountEIP1559Compatibility?.()??!0;return e&&t}getTimeEstimate(e,t){return this.state.gasFeeEstimates&&this.state.gasEstimateType===s.GAS_ESTIMATE_TYPES.FEE_MARKET?(0,h.calculateTimeEstimate)(e,t,this.state.gasFeeEstimates):{}}enableNonRPCGasFeeApis(){this.update(e=>{e.nonRPCGasFeeApisDisabled=!1})}disableNonRPCGasFeeApis(){this.update(e=>{e.nonRPCGasFeeApisDisabled=!0})}}s.GasFeeController=k,r=new WeakMap,n=new WeakSet,a=async function({selectedNetworkClientId:e}){const t=this.messenger.call("NetworkController:getNetworkClientById",e).configuration.chainId;t!==this.currentChainId&&(this.ethQuery=new d.default(i(this,r,"f").call(this)),await this.resetPolling(),this.currentChainId=t)},s.default=k}}},{package:"@metamask/gas-fee-controller",file:"node_modules/@metamask/gas-fee-controller/dist/GasFeeController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/determineGasFeeCalculations.cjs",{"./GasFeeController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/GasFeeController.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0});const n=e("./GasFeeController.cjs");s.default=async function(e){try{return await async function(e){const{isEIP1559Compatible:t,isLegacyGasAPICompatible:s,nonRPCGasFeeApisDisabled:r}=e;try{if(t&&!r)return await async function(e){const{fetchGasEstimates:t,fetchGasEstimatesUrl:s,clientId:r,calculateTimeEstimate:a}=e,o=await t(s,r),{suggestedMaxPriorityFeePerGas:i,suggestedMaxFeePerGas:c}=o.medium,l=a(i,c,o);return{gasFeeEstimates:o,estimatedGasFeeTimeBounds:l,gasEstimateType:n.GAS_ESTIMATE_TYPES.FEE_MARKET}}(e);if(s&&!r)return await async function(e){const{fetchLegacyGasPriceEstimates:t,fetchLegacyGasPriceEstimatesUrl:s,clientId:r}=e;return{gasFeeEstimates:await t(s,r),estimatedGasFeeTimeBounds:{},gasEstimateType:n.GAS_ESTIMATE_TYPES.LEGACY}}(e);throw new Error("Main gas fee/price estimation failed. Use fallback")}catch{return await async function(e){const{ethQuery:t,fetchEthGasPriceEstimate:s}=e;return{gasFeeEstimates:await s(t),estimatedGasFeeTimeBounds:{},gasEstimateType:n.GAS_ESTIMATE_TYPES.ETH_GASPRICE}}(e)}}(e)}catch(e){if(e instanceof Error)throw new Error(`Gas fee/price estimation failed. Message: ${e.message}`);throw e}}}}},{package:"@metamask/gas-fee-controller",file:"node_modules/@metamask/gas-fee-controller/dist/determineGasFeeCalculations.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/gas-util.cjs",{"@metamask/controller-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/controller-utils/dist/index.cjs","bn.js":"/home/runner/work/metamask-extension/metamask-extension/node_modules/bn.js/lib/bn.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.calculateTimeEstimate=s.fetchEthGasPriceEstimate=s.fetchLegacyGasPriceEstimates=s.fetchGasEstimates=s.normalizeGWEIDecimalNumbers=void 0;const r=e("@metamask/controller-utils"),a=n(e("bn.js")),o=e=>({"X-Client-Id":e});function i(e){const t=(0,r.gweiDecToWEIBN)(e).toString(16);return(0,r.weiHexToGweiDec)(t)}s.normalizeGWEIDecimalNumbers=i,s.fetchGasEstimates=async function(e,t){const s=await(0,r.handleFetch)(e,t?{headers:o(t)}:undefined);return{low:{...s.low,suggestedMaxPriorityFeePerGas:i(s.low.suggestedMaxPriorityFeePerGas),suggestedMaxFeePerGas:i(s.low.suggestedMaxFeePerGas)},medium:{...s.medium,suggestedMaxPriorityFeePerGas:i(s.medium.suggestedMaxPriorityFeePerGas),suggestedMaxFeePerGas:i(s.medium.suggestedMaxFeePerGas)},high:{...s.high,suggestedMaxPriorityFeePerGas:i(s.high.suggestedMaxPriorityFeePerGas),suggestedMaxFeePerGas:i(s.high.suggestedMaxFeePerGas)},estimatedBaseFee:i(s.estimatedBaseFee),historicalBaseFeeRange:s.historicalBaseFeeRange,baseFeeTrend:s.baseFeeTrend,latestPriorityFeeRange:s.latestPriorityFeeRange,historicalPriorityFeeRange:s.historicalPriorityFeeRange,priorityFeeTrend:s.priorityFeeTrend,networkCongestion:s.networkCongestion}},s.fetchLegacyGasPriceEstimates=async function(e,t){const s=await(0,r.handleFetch)(e,{referrer:e,referrerPolicy:"no-referrer-when-downgrade",method:"GET",mode:"cors",headers:{"Content-Type":"application/json",...t&&o(t)}});return{low:s.SafeGasPrice,medium:s.ProposeGasPrice,high:s.FastGasPrice}},s.fetchEthGasPriceEstimate=async function(e){const t=await(0,r.query)(e,"gasPrice");return{gasPrice:(0,r.weiHexToGweiDec)(t).toString()}},s.calculateTimeEstimate=function(e,t,s){const{low:n,medium:o,high:i,estimatedBaseFee:c}=s,l=(0,r.gweiDecToWEIBN)(e),d=(0,r.gweiDecToWEIBN)(t),m=(0,r.gweiDecToWEIBN)(c),u=a.default.min(l,d.sub(m)),p=(0,r.gweiDecToWEIBN)(n.suggestedMaxPriorityFeePerGas),h=(0,r.gweiDecToWEIBN)(o.suggestedMaxPriorityFeePerGas),f=(0,r.gweiDecToWEIBN)(i.suggestedMaxPriorityFeePerGas);let g,k;return u.lt(p)?(g=null,k="unknown"):u.gte(p)&&u.lt(h)?(g=n.minWaitTimeEstimate,k=n.maxWaitTimeEstimate):u.gte(h)&&u.lt(f)?(g=o.minWaitTimeEstimate,k=o.maxWaitTimeEstimate):u.eq(f)?(g=i.minWaitTimeEstimate,k=i.maxWaitTimeEstimate):(g=0,k=i.maxWaitTimeEstimate),{lowerTimeBound:g,upperTimeBound:k}}}}},{package:"@metamask/gas-fee-controller",file:"node_modules/@metamask/gas-fee-controller/dist/gas-util.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/index.cjs",{"./GasFeeController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/dist/GasFeeController.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]}),r=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./GasFeeController.cjs"),s)}}},{package:"@metamask/gas-fee-controller",file:"node_modules/@metamask/gas-fee-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/AbstractPollingController.cjs",{"fast-json-stable-stringify":"/home/runner/work/metamask-extension/metamask-extension/node_modules/fast-json-stable-stringify/index.js",uuid:"/home/runner/work/metamask-extension/metamask-extension/node_modules/uuid/dist/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.AbstractPollingControllerBaseMixin=s.getKey=void 0;const a=r(e("fast-json-stable-stringify")),o=e("uuid");s.getKey=e=>(0,a.default)(e),s.AbstractPollingControllerBaseMixin=function(e){var t,r;return t=new WeakMap,r=new WeakMap,class extends e{constructor(){super(...arguments),t.set(this,new Map),r.set(this,new Map)}startPolling(e){const r=(0,o.v4)(),a=(0,s.getKey)(e),i=n(this,t,"f").get(a)??new Set;return i.add(r),n(this,t,"f").set(a,i),1===i.size&&this._startPolling(e),r}stopAllPolling(){n(this,t,"f").forEach((e,t)=>{e.forEach(e=>{this.stopPollingByPollingToken(e)})})}stopPollingByPollingToken(e){if(!e)throw new Error("pollingToken required");let s=null;for(const[r,a]of n(this,t,"f"))if(a.delete(e)){0===a.size&&(s=r);break}if(s){this._stopPollingByPollingTokenSetId(s),n(this,t,"f").delete(s);const e=n(this,r,"f").get(s);if(e){for(const t of e)t(JSON.parse(s));e.clear()}}}onPollingComplete(e,t){const a=(0,s.getKey)(e),o=n(this,r,"f").get(a)??new Set;o.add(t),n(this,r,"f").set(a,o)}}}}}},{package:"@metamask/gas-fee-controller>@metamask/polling-controller",file:"node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/AbstractPollingController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/BlockTrackerPollingController.cjs",{"./AbstractPollingController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/AbstractPollingController.cjs","@metamask/base-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/base-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.BlockTrackerPollingController=s.BlockTrackerPollingControllerOnly=void 0;const r=e("@metamask/base-controller"),a=e("./AbstractPollingController.cjs");function o(e){var t;class s extends((0,a.AbstractPollingControllerBaseMixin)(e)){constructor(){super(...arguments),t.set(this,{})}_startPolling(e){const s=(0,a.getKey)(e);if(n(this,t,"f")[s])return;const r=this._getNetworkClientById(e.networkClientId);if(!r)throw new Error(`Unable to retrieve blockTracker for networkClientId ${e.networkClientId}`);{const a=this._executePoll.bind(this,e);r.blockTracker.addListener("latest",a),n(this,t,"f")[s]=a}}_stopPollingByPollingTokenSetId(e){const{networkClientId:s}=JSON.parse(e),r=this._getNetworkClientById(s);if(r&&n(this,t,"f")[e]){const s=n(this,t,"f")[e];s&&(r.blockTracker.removeListener("latest",s),delete n(this,t,"f")[e])}}}return t=new WeakMap,s}class i{}s.BlockTrackerPollingControllerOnly=()=>o(i);s.BlockTrackerPollingController=()=>o(r.BaseController)}}},{package:"@metamask/gas-fee-controller>@metamask/polling-controller",file:"node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/BlockTrackerPollingController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/StaticIntervalPollingController.cjs",{"./AbstractPollingController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/AbstractPollingController.cjs","@metamask/base-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/base-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s},r=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)};Object.defineProperty(s,"__esModule",{value:!0}),s.StaticIntervalPollingController=s.StaticIntervalPollingControllerOnly=void 0;const a=e("@metamask/base-controller"),o=e("./AbstractPollingController.cjs");function i(e){var t,s;class a extends((0,o.AbstractPollingControllerBaseMixin)(e)){constructor(){super(...arguments),t.set(this,{}),s.set(this,1e3)}setIntervalLength(e){n(this,s,e,"f")}getIntervalLength(){return r(this,s,"f")}_startPolling(e){if(!r(this,s,"f"))throw new Error("intervalLength must be defined and greater than 0");const n=(0,o.getKey)(e),a=r(this,t,"f")[n];this._stopPollingByPollingTokenSetId(n);const i=r(this,t,"f")[n]=setTimeout(async()=>{try{await this._executePoll(e)}catch(e){console.error(e)}i===r(this,t,"f")[n]&&this._startPolling(e)},a?r(this,s,"f"):0)}_stopPollingByPollingTokenSetId(e){const s=r(this,t,"f")[e];s&&(clearTimeout(s),delete r(this,t,"f")[e])}}return t=new WeakMap,s=new WeakMap,a}class c{}s.StaticIntervalPollingControllerOnly=()=>i(c);s.StaticIntervalPollingController=()=>i(a.BaseController)}}},{package:"@metamask/gas-fee-controller>@metamask/polling-controller",file:"node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/StaticIntervalPollingController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/index.cjs",{"./BlockTrackerPollingController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/BlockTrackerPollingController.cjs","./StaticIntervalPollingController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/StaticIntervalPollingController.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.StaticIntervalPollingController=s.StaticIntervalPollingControllerOnly=s.BlockTrackerPollingController=s.BlockTrackerPollingControllerOnly=void 0;var n=e("./BlockTrackerPollingController.cjs");Object.defineProperty(s,"BlockTrackerPollingControllerOnly",{enumerable:!0,get:function(){return n.BlockTrackerPollingControllerOnly}}),Object.defineProperty(s,"BlockTrackerPollingController",{enumerable:!0,get:function(){return n.BlockTrackerPollingController}});var r=e("./StaticIntervalPollingController.cjs");Object.defineProperty(s,"StaticIntervalPollingControllerOnly",{enumerable:!0,get:function(){return r.StaticIntervalPollingControllerOnly}}),Object.defineProperty(s,"StaticIntervalPollingController",{enumerable:!0,get:function(){return r.StaticIntervalPollingController}})}}},{package:"@metamask/gas-fee-controller>@metamask/polling-controller",file:"node_modules/@metamask/gas-fee-controller/node_modules/@metamask/polling-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/GatorPermissionsController.cjs",{"./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/constants.cjs","./decodePermission/index.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/decodePermission/index.cjs","./errors.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/errors.cjs","./logger.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/logger.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/types.cjs","./utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/utils.cjs","@metamask/base-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/base-controller/dist/index.cjs","@metamask/delegation-deployments":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/delegation-deployments/dist/index.js","@metamask/snaps-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/index.cjs","@metamask/transaction-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/transaction-controller/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r,a,o,i,c,l,d,m,u,p,h,f=this&&this.__classPrivateFieldGet||function(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)},g=this&&this.__classPrivateFieldSet||function(e,t,s,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,s):r?r.value=s:t.set(e,s),s};Object.defineProperty(s,"__esModule",{value:!0});const k=e("@metamask/base-controller"),w=e("@metamask/delegation-deployments"),y=e("@metamask/snaps-utils"),b=e("@metamask/transaction-controller"),v=e("./constants.cjs"),_=e("./decodePermission/index.cjs"),x=e("./errors.cjs"),E=e("./logger.cjs"),S=e("./types.cjs"),T=e("./utils.cjs"),j="GatorPermissionsController",C=w.DELEGATOR_CONTRACTS[v.DELEGATION_FRAMEWORK_VERSION],A={grantedPermissions:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!0},isFetchingGatorPermissions:{includeInStateLogs:!0,persist:!1,includeInDebugSnapshot:!1,usedInUi:!0},pendingRevocations:{includeInStateLogs:!0,persist:!1,includeInDebugSnapshot:!1,usedInUi:!0},lastSyncedTimestamp:{includeInStateLogs:!0,persist:!0,includeInDebugSnapshot:!1,usedInUi:!1}};class I extends k.BaseController{get gatorPermissionsProviderSnapId(){return f(this,a,"f")}constructor({messenger:e,config:t,state:s}){const c=function(e){return{grantedPermissions:[],pendingRevocations:[],lastSyncedTimestamp:-1,...e,isFetchingGatorPermissions:!1}}(s);super({name:j,metadata:A,messenger:e,state:c}),n.add(this),r.set(this,void 0),a.set(this,void 0),o.set(this,void 0),i.set(this,null),g(this,r,t.supportedPermissionTypes,"f"),g(this,a,t.gatorPermissionsProviderSnapId??"npm:@metamask/gator-permissions-snap","f"),g(this,o,t.maxSyncIntervalMs??2592e6,"f"),f(this,n,"m",u).call(this)}get supportedPermissionTypes(){return f(this,r,"f")}fetchAndUpdateGatorPermissions(){if(null!==f(this,i,"f"))return f(this,i,"f");return g(this,i,(async()=>{try{f(this,n,"m",c).call(this,!0);const e={isRevoked:!1},t=await(0,T.executeSnapRpc)({messenger:this.messenger,snapId:f(this,a,"f"),method:S.GatorPermissionsSnapRpcMethod.PermissionProviderGetGrantedPermissions,params:e}),s=f(this,n,"m",h).call(this,t);this.update(e=>{e.grantedPermissions=s,e.lastSyncedTimestamp=Date.now()})}catch(e){throw(0,E.controllerLog)("Failed to fetch gator permissions",e),new x.GatorPermissionsFetchError({message:"Failed to fetch gator permissions",cause:e})}finally{f(this,n,"m",c).call(this,!1),g(this,i,null,"f")}})(),"f"),f(this,i,"f")}async initialize(){const e=Date.now()-this.state.lastSyncedTimestamp;(-1===this.state.lastSyncedTimestamp||e>f(this,o,"f"))&&await this.fetchAndUpdateGatorPermissions()}decodePermissionFromPermissionContextForOrigin({origin:e,chainId:t,delegation:{caveats:s,delegator:n,delegate:r,authority:o},metadata:{justification:i,origin:c}}){if(e!==f(this,a,"f"))throw new x.OriginNotAllowedError({origin:e});const l=C[t];if(!l)throw new Error(`Contracts not found for chainId: ${t}`);try{const e=s.map(e=>e.enforcer),a=(0,_.identifyPermissionByEnforcers)({enforcers:e,contracts:l}),{expiry:d,data:m}=(0,_.getPermissionDataAndExpiry)({contracts:l,caveats:s,permissionType:a});return(0,_.reconstructDecodedPermission)({chainId:t,permissionType:a,delegator:n,delegate:r,authority:o,expiry:d,data:m,justification:i,specifiedOrigin:c})}catch(e){throw new x.PermissionDecodingError({cause:e})}}async submitRevocation(e){(0,E.controllerLog)("submitRevocation method called",{permissionContext:e.permissionContext});const t={snapId:f(this,a,"f"),origin:"metamask",handler:y.HandlerType.OnRpcRequest,request:{jsonrpc:"2.0",method:S.GatorPermissionsSnapRpcMethod.PermissionProviderSubmitRevocation,params:e}};try{const s=await this.messenger.call("SnapController:handleRequest",t);await this.fetchAndUpdateGatorPermissions(),(0,E.controllerLog)("Successfully submitted revocation",{permissionContext:e.permissionContext,result:s})}catch(t){if(t instanceof x.GatorPermissionsFetchError)throw(0,E.controllerLog)("Revocation submitted successfully but failed to refresh permissions list",{error:t,permissionContext:e.permissionContext}),new x.GatorPermissionsFetchError({message:"Failed to refresh permissions list after successful revocation",cause:t});throw(0,E.controllerLog)("Failed to submit revocation",{error:t,permissionContext:e.permissionContext}),new x.GatorPermissionsProviderError({method:S.GatorPermissionsSnapRpcMethod.PermissionProviderSubmitRevocation,cause:t})}finally{f(this,n,"m",m).call(this,e.permissionContext)}}async addPendingRevocation(e){const{txId:t,permissionContext:s}=e;(0,E.controllerLog)("addPendingRevocation method called",{txId:t,permissionContext:s});const r={approved:undefined,rejected:undefined,confirmed:undefined,failed:undefined,dropped:undefined,timeoutId:undefined},a=e=>{this.fetchAndUpdateGatorPermissions().catch(n=>{(0,E.controllerLog)(`Failed to refresh permissions after ${e}`,{txId:t,permissionContext:s,error:n})})},o=()=>{r.approved&&(this.messenger.unsubscribe("TransactionController:transactionApproved",r.approved),r.approved=undefined),r.rejected&&(this.messenger.unsubscribe("TransactionController:transactionRejected",r.rejected),r.rejected=undefined)},i=(e,t=!0)=>{o(),r.confirmed&&this.messenger.unsubscribe("TransactionController:transactionConfirmed",r.confirmed),r.failed&&this.messenger.unsubscribe("TransactionController:transactionFailed",r.failed),r.dropped&&this.messenger.unsubscribe("TransactionController:transactionDropped",r.dropped),r.timeoutId!==undefined&&clearTimeout(r.timeoutId),t&&f(this,n,"m",d).call(this,e)};r.approved=e=>{e.transactionMeta.id===t&&((0,E.controllerLog)("Transaction approved by user, adding to pending revocations",{txId:t,permissionContext:s}),f(this,n,"m",l).call(this,t,s),o())},r.rejected=e=>{e.transactionMeta.id===t&&((0,E.controllerLog)("Transaction rejected by user, cleaning up listeners",{txId:t,permissionContext:s}),i(e.transactionMeta.id,!1))},r.confirmed=e=>{if(e.id===t){if((0,E.controllerLog)("Transaction confirmed, submitting revocation",{txId:t,permissionContext:s,txHash:e.hash}),e.status!==b.TransactionStatus.confirmed)return(0,E.controllerLog)("Transaction not confirmed, skipping revocation",{txId:t,permissionContext:s,status:e.status}),i(e.id),void a("transaction not confirmed");const n=e.hash;n===undefined&&(0,E.controllerLog)("Failed to resolve transaction hash after revocation transaction confirmed",{txId:t,permissionContext:s,error:new Error("Confirmed transaction is missing transaction hash")}),this.submitRevocation({permissionContext:s,txHash:n}).catch(e=>{(0,E.controllerLog)("Failed to submit revocation after transaction confirmed",{txId:t,permissionContext:s,error:e})}).finally(()=>a("transaction confirmed")),i(e.id)}},r.failed=e=>{e.transactionMeta.id===t&&((0,E.controllerLog)("Transaction failed, cleaning up revocation listener",{txId:t,permissionContext:s,error:e.error}),i(e.transactionMeta.id),a("transaction failed"))},r.dropped=e=>{e.transactionMeta.id===t&&((0,E.controllerLog)("Transaction dropped, cleaning up revocation listener",{txId:t,permissionContext:s}),i(e.transactionMeta.id),a("transaction dropped"))},this.messenger.subscribe("TransactionController:transactionApproved",r.approved),this.messenger.subscribe("TransactionController:transactionRejected",r.rejected),this.messenger.subscribe("TransactionController:transactionConfirmed",r.confirmed),this.messenger.subscribe("TransactionController:transactionFailed",r.failed),this.messenger.subscribe("TransactionController:transactionDropped",r.dropped),r.timeoutId=setTimeout(()=>{(0,E.controllerLog)("Pending revocation timed out, cleaning up listeners",{txId:t,permissionContext:s}),i(t)},72e5)}async submitDirectRevocation(e){const t=`no-tx-${e.permissionContext}`;f(this,n,"m",l).call(this,t,e.permissionContext),await this.submitRevocation(e)}isPendingRevocation(e){const t=e.toLowerCase();return this.state.pendingRevocations.some(e=>e.permissionContext.toLowerCase()===t)}}r=new WeakMap,a=new WeakMap,o=new WeakMap,i=new WeakMap,n=new WeakSet,c=function(e){this.update(t=>{t.isFetchingGatorPermissions=e})},l=function(e,t){this.update(s=>{s.pendingRevocations=[...s.pendingRevocations,{txId:e,permissionContext:t}]})},d=function(e){this.update(t=>{t.pendingRevocations=t.pendingRevocations.filter(t=>t.txId!==e)})},m=function(e){this.update(t=>{t.pendingRevocations=t.pendingRevocations.filter(t=>t.permissionContext.toLowerCase()!==e.toLowerCase())})},u=function(){this.messenger.registerActionHandler(`${j}:fetchAndUpdateGatorPermissions`,this.fetchAndUpdateGatorPermissions.bind(this)),this.messenger.registerActionHandler(`${j}:decodePermissionFromPermissionContextForOrigin`,this.decodePermissionFromPermissionContextForOrigin.bind(this));const e=`${j}:submitRevocation`;this.messenger.registerActionHandler(e,this.submitRevocation.bind(this)),this.messenger.registerActionHandler(`${j}:addPendingRevocation`,this.addPendingRevocation.bind(this)),this.messenger.registerActionHandler(`${j}:submitDirectRevocation`,this.submitDirectRevocation.bind(this)),this.messenger.registerActionHandler(`${j}:isPendingRevocation`,this.isPendingRevocation.bind(this))},p=function(e){const{permissionResponse:t}=e,{dependencies:s,to:n,...r}=t;return{...e,permissionResponse:r}},h=function(e){return e?e.map(e=>f(this,n,"m",p).call(this,e)):[]},s.default=I}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/GatorPermissionsController.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/constants.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.DELEGATION_FRAMEWORK_VERSION=void 0,s.DELEGATION_FRAMEWORK_VERSION="1.3.0"}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/constants.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/decodePermission/decodePermission.cjs",{"./utils.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/decodePermission/utils.cjs","@metamask/delegation-core":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/delegation-core/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.reconstructDecodedPermission=s.getPermissionDataAndExpiry=s.identifyPermissionByEnforcers=void 0;const n=e("@metamask/delegation-core"),r=e("@metamask/utils"),a=e("./utils.cjs");s.identifyPermissionByEnforcers=({enforcers:e,contracts:t})=>{const s=new Map;for(const t of e.map(r.getChecksumAddress))s.set(t,(s.get(t)??0)+1);const n=new Set(s.keys()),o=(0,a.createPermissionRulesForChainId)(t);let i=null;for(const{optionalEnforcers:e,requiredEnforcers:t,permissionType:r}of o){const a=new Set([...e,...t.keys()]);let o=!1;for(const e of n)if(!a.has(e)){o=!0;break}let c=!0;for(const[e,n]of t.entries())if((s.get(e)??0)!==n){c=!1;break}if(c&&!o){if(i)throw new Error("Multiple permission types match");i=r}}if(!i)throw new Error("Unable to identify permission type");return i};s.getPermissionDataAndExpiry=({contracts:e,caveats:t,permissionType:s})=>{const n=t.map(e=>({...e,enforcer:(0,r.getChecksumAddress)(e.enforcer)})),{erc20StreamingEnforcer:o,erc20PeriodicEnforcer:i,nativeTokenStreamingEnforcer:c,nativeTokenPeriodicEnforcer:l,timestampEnforcer:d,allowedCalldataEnforcer:m,valueLteEnforcer:u}=(0,a.getChecksumEnforcersByChainId)(e),p=(0,a.getTermsByEnforcer)({caveats:n,enforcer:d,throwIfNotFound:!1});let h,f=null;switch(p&&(f=(e=>{if(66!==e.length)throw new Error(`Invalid TimestampEnforcer terms length: expected 66 characters (0x + 64 hex), got ${e.length}`);const[t,s]=(0,a.splitHex)(e,[16,16]);if(0!==(0,r.hexToNumber)(t))throw new Error("Invalid expiry: timestampAfterThreshold must be 0");const n=(0,r.hexToNumber)(s);if(0===n)throw new Error("Invalid expiry: timestampBeforeThreshold must be greater than 0");return n})(p)),s){case"erc20-token-stream":{const e=(0,a.getTermsByEnforcer)({caveats:n,enforcer:o}),[t,s,i,c,l]=(0,a.splitHex)(e,[20,32,32,32,32]);h={tokenAddress:t,initialAmount:s,maxAmount:i,amountPerSecond:c,startTime:(0,r.hexToNumber)(l)};break}case"erc20-token-periodic":{const e=(0,a.getTermsByEnforcer)({caveats:n,enforcer:i}),[t,s,o,c]=(0,a.splitHex)(e,[20,32,32,32]);h={tokenAddress:t,periodAmount:s,periodDuration:(0,r.hexToNumber)(o),startTime:(0,r.hexToNumber)(c)};break}case"native-token-stream":{const e=(0,a.getTermsByEnforcer)({caveats:n,enforcer:c}),[t,s,o,i]=(0,a.splitHex)(e,[32,32,32,32]);h={initialAmount:t,maxAmount:s,amountPerSecond:o,startTime:(0,r.hexToNumber)(i)};break}case"native-token-periodic":{const e=(0,a.getTermsByEnforcer)({caveats:n,enforcer:l}),[t,s,o]=(0,a.splitHex)(e,[32,32,32]);h={periodAmount:t,periodDuration:(0,r.hexToNumber)(s),startTime:(0,r.hexToNumber)(o)};break}case"erc20-token-revocation":{const e="0x0000000000000000000000000000000000000000000000000000000000000000",t="0x0000000000000000000000000000000000000000000000000000000000000000095ea7b3",s="0x00000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000000",r=n.filter(e=>e.enforcer===m).map(e=>e.terms.toLowerCase()),o=r.includes(t),i=r.includes(s);if(!o||!i)throw new Error("Invalid erc20-token-revocation terms: expected approve selector and zero amount constraints");if((0,a.getTermsByEnforcer)({caveats:n,enforcer:u})!==e)throw new Error("Invalid ValueLteEnforcer terms: maxValue must be 0");h={};break}default:throw new Error("Invalid permission type")}return{expiry:f,data:h}};s.reconstructDecodedPermission=({chainId:e,permissionType:t,delegator:s,delegate:a,authority:o,expiry:i,data:c,justification:l,specifiedOrigin:d})=>{if(o!==n.ROOT_AUTHORITY)throw new Error("Invalid authority");return{chainId:(0,r.numberToHex)(e),from:s,to:a,permission:{type:t,data:c,justification:l},expiry:i,origin:d}}}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/decodePermission/decodePermission.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/decodePermission/index.cjs",{"./decodePermission.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/decodePermission/decodePermission.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.reconstructDecodedPermission=s.getPermissionDataAndExpiry=s.identifyPermissionByEnforcers=void 0;var n=e("./decodePermission.cjs");Object.defineProperty(s,"identifyPermissionByEnforcers",{enumerable:!0,get:function(){return n.identifyPermissionByEnforcers}}),Object.defineProperty(s,"getPermissionDataAndExpiry",{enumerable:!0,get:function(){return n.getPermissionDataAndExpiry}}),Object.defineProperty(s,"reconstructDecodedPermission",{enumerable:!0,get:function(){return n.reconstructDecodedPermission}})}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/decodePermission/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/decodePermission/utils.cjs",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.splitHex=s.getTermsByEnforcer=s.isSubset=s.createPermissionRulesForChainId=s.getChecksumEnforcersByChainId=void 0;const n=e("@metamask/utils"),r="ERC20PeriodTransferEnforcer",a="ERC20StreamingEnforcer",o="ExactCalldataEnforcer",i="NativeTokenPeriodTransferEnforcer",c="NativeTokenStreamingEnforcer",l="TimestampEnforcer",d="ValueLteEnforcer",m="NonceEnforcer",u="AllowedCalldataEnforcer";s.getChecksumEnforcersByChainId=e=>{const t=t=>{const s=e[t];if(!s)throw new Error(`Contract not found: ${t}`);return(0,n.getChecksumAddress)(s)};return{erc20StreamingEnforcer:t(a),erc20PeriodicEnforcer:t(r),nativeTokenStreamingEnforcer:t(c),nativeTokenPeriodicEnforcer:t(i),exactCalldataEnforcer:t(o),valueLteEnforcer:t(d),timestampEnforcer:t(l),nonceEnforcer:t(m),allowedCalldataEnforcer:t(u)}};s.createPermissionRulesForChainId=e=>{const{erc20StreamingEnforcer:t,erc20PeriodicEnforcer:n,nativeTokenStreamingEnforcer:r,nativeTokenPeriodicEnforcer:a,exactCalldataEnforcer:o,valueLteEnforcer:i,timestampEnforcer:c,nonceEnforcer:l,allowedCalldataEnforcer:d}=(0,s.getChecksumEnforcersByChainId)(e),m=new Set([c]);return[{requiredEnforcers:new Map([[r,1],[o,1],[l,1]]),optionalEnforcers:m,permissionType:"native-token-stream"},{requiredEnforcers:new Map([[a,1],[o,1],[l,1]]),optionalEnforcers:m,permissionType:"native-token-periodic"},{requiredEnforcers:new Map([[t,1],[i,1],[l,1]]),optionalEnforcers:m,permissionType:"erc20-token-stream"},{requiredEnforcers:new Map([[n,1],[i,1],[l,1]]),optionalEnforcers:m,permissionType:"erc20-token-periodic"},{requiredEnforcers:new Map([[d,2],[i,1],[l,1]]),optionalEnforcers:m,permissionType:"erc20-token-revocation"}]};s.isSubset=(e,t)=>{for(const s of e)if(!t.has(s))return!1;return!0},s.getTermsByEnforcer=function({caveats:e,enforcer:t,throwIfNotFound:s}){const n=e.filter(e=>e.enforcer===t);if(0===n.length){if(s??1)throw new Error("Invalid caveats");return null}if(n.length>1)throw new Error("Invalid caveats");return n[0].terms},s.splitHex=function(e,t){let s=2;const n=[];for(const r of t){const t=2*r,a=e.slice(s,s+t);s+=t,n.push(`0x${a}`)}return n}}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/decodePermission/utils.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/errors.cjs",{"./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/types.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.PermissionDecodingError=s.OriginNotAllowedError=s.GatorPermissionsProviderError=s.GatorPermissionsFetchError=s.GatorPermissionsControllerError=void 0;const n=e("./types.cjs");class r extends Error{constructor({cause:e,message:t,code:s}){super(t),this.cause=e,this.code=s}}s.GatorPermissionsControllerError=r;s.GatorPermissionsFetchError=class extends r{constructor({cause:e,message:t}){super({cause:e,message:t,code:n.GatorPermissionsControllerErrorCode.GatorPermissionsFetchError})}};s.GatorPermissionsProviderError=class extends r{constructor({cause:e,method:t}){super({cause:e,message:`Failed to handle snap request to gator permissions provider for method ${t}`,code:n.GatorPermissionsControllerErrorCode.GatorPermissionsProviderError})}};s.OriginNotAllowedError=class extends r{constructor({origin:e}){const t=`Origin ${e} not allowed`;super({cause:new Error(t),message:t,code:n.GatorPermissionsControllerErrorCode.OriginNotAllowedError})}};s.PermissionDecodingError=class extends r{constructor({cause:e}){super({cause:e,message:"Failed to decode permission",code:n.GatorPermissionsControllerErrorCode.PermissionDecodingError})}}}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/errors.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/index.cjs",{"./GatorPermissionsController.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/GatorPermissionsController.cjs","./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/constants.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.DELEGATION_FRAMEWORK_VERSION=s.GatorPermissionsController=void 0;var r=e("./GatorPermissionsController.cjs");Object.defineProperty(s,"GatorPermissionsController",{enumerable:!0,get:function(){return n(r).default}});var a=e("./constants.cjs");Object.defineProperty(s,"DELEGATION_FRAMEWORK_VERSION",{enumerable:!0,get:function(){return a.DELEGATION_FRAMEWORK_VERSION}})}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/logger.cjs",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.createModuleLogger=s.utilsLog=s.controllerLog=s.projectLogger=void 0;const n=e("@metamask/utils");Object.defineProperty(s,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),s.projectLogger=(0,n.createProjectLogger)("gator-permissions-controller"),s.controllerLog=(0,n.createModuleLogger)(s.projectLogger,"GatorPermissionsController"),s.utilsLog=(0,n.createModuleLogger)(s.projectLogger,"utils")}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/logger.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/types.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n,r;Object.defineProperty(s,"__esModule",{value:!0}),s.GatorPermissionsSnapRpcMethod=s.GatorPermissionsControllerErrorCode=void 0,function(e){e.GatorPermissionsFetchError="gator-permissions-fetch-error",e.GatorPermissionsProviderError="gator-permissions-provider-error",e.PermissionDecodingError="permission-decoding-error",e.OriginNotAllowedError="origin-not-allowed-error"}(n||(s.GatorPermissionsControllerErrorCode=n={})),function(e){e.PermissionProviderGetGrantedPermissions="permissionsProvider_getGrantedPermissions",e.PermissionProviderSubmitRevocation="permissionsProvider_submitRevocation"}(r||(s.GatorPermissionsSnapRpcMethod=r={}))}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/types.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/utils.cjs",{"./errors.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/errors.cjs","./logger.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/dist/logger.cjs","@metamask/snaps-utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.executeSnapRpc=void 0;const n=e("@metamask/snaps-utils"),r=e("./errors.cjs"),a=e("./logger.cjs");s.executeSnapRpc=async function({messenger:e,snapId:t,method:s,params:o}){try{return await e.call("SnapController:handleRequest",{snapId:t,origin:"metamask",handler:n.HandlerType.OnRpcRequest,request:{jsonrpc:"2.0",method:s,...o!==undefined&&{params:o}}})}catch(e){throw(0,a.utilsLog)("Snap RPC request failed",{method:s,error:e}),new r.GatorPermissionsProviderError({method:s,cause:e})}}}}},{package:"@metamask/gator-permissions-controller",file:"node_modules/@metamask/gator-permissions-controller/dist/utils.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/delegation-deployments/dist/index.js",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0});var n={DelegationManager:"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3",EntryPoint:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",SimpleFactory:"0x69Aa2f9fe1572F1B640E1bbc512f5c3a734fc77c",MultiSigDeleGatorImpl:"0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7",HybridDeleGatorImpl:"0x48dBe696A4D990079e039489bA2053B36E8FFEC4",EIP7702StatelessDeleGatorImpl:"0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B",AllowedCalldataEnforcer:"0xc2b0d624c1c4319760C96503BA27C347F3260f55",AllowedMethodsEnforcer:"0x2c21fD0Cb9DC8445CB3fb0DC5E7Bb0Aca01842B5",AllowedTargetsEnforcer:"0x7F20f61b1f09b08D970938F6fa563634d65c4EeB",BlockNumberEnforcer:"0x5d9818dF0AE3f66e9c3D0c5029DAF99d1823ca6c",DeployedEnforcer:"0x24ff2AA430D53a8CD6788018E902E098083dcCd2",ERC20BalanceChangeEnforcer:"0xcdF6aB796408598Cea671d79506d7D48E97a5437",ERC20TransferAmountEnforcer:"0xf100b0819427117EcF76Ed94B358B1A5b5C6D2Fc",ERC20PeriodTransferEnforcer:"0x474e3Ae7E169e940607cC624Da8A15Eb120139aB",ERC20StreamingEnforcer:"0x56c97aE02f233B29fa03502Ecc0457266d9be00e",ERC721BalanceChangeEnforcer:"0x8aFdf96eDBbe7e1eD3f5Cd89C7E084841e12A09e",ERC721TransferEnforcer:"0x3790e6B7233f779b09DA74C72b6e94813925b9aF",ERC1155BalanceChangeEnforcer:"0x63c322732695cAFbbD488Fc6937A0A7B66fC001A",ExactCalldataBatchEnforcer:"0x982FD5C86BBF425d7d1451f974192d4525113DfD",ExactCalldataEnforcer:"0x99F2e9bF15ce5eC84685604836F71aB835DBBdED",ExactExecutionBatchEnforcer:"0x1e141e455d08721Dd5BCDA1BaA6Ea5633Afd5017",ExactExecutionEnforcer:"0x146713078D39eCC1F5338309c28405ccf85Abfbb",IdEnforcer:"0xC8B5D93463c893401094cc70e66A206fb5987997",LimitedCallsEnforcer:"0x04658B29F6b82ed55274221a06Fc97D318E25416",NativeBalanceChangeEnforcer:"0xbD7B277507723490Cd50b12EaaFe87C616be6880",ArgsEqualityCheckEnforcer:"0x44B8C6ae3C304213c3e298495e12497Ed3E56E41",NativeTokenPaymentEnforcer:"0x4803a326ddED6dDBc60e659e5ed12d85c7582811",NativeTokenTransferAmountEnforcer:"0xF71af580b9c3078fbc2BBF16FbB8EEd82b330320",NativeTokenStreamingEnforcer:"0xD10b97905a320b13a0608f7E9cC506b56747df19",NativeTokenPeriodTransferEnforcer:"0x9BC0FAf4Aca5AE429F4c06aEEaC517520CB16BD9",NonceEnforcer:"0xDE4f2FAC4B3D87A1d9953Ca5FC09FCa7F366254f",OwnershipTransferEnforcer:"0x7EEf9734E7092032B5C56310Eb9BbD1f4A524681",RedeemerEnforcer:"0xE144b0b2618071B4E56f746313528a669c7E65c5",SpecificActionERC20TransferBatchEnforcer:"0x00e0251aaA263dfE3B3541B758A82D1CBA1c3B6D",TimestampEnforcer:"0x1046bb45C8d673d4ea75321280DB34899413c069",ValueLteEnforcer:"0x92Bf12322527cAA612fd31a0e810472BBB106A8F",MultiTokenPeriodEnforcer:"0xFB2f1a9BD76d3701B730E5d69C3219D42D80eBb7"},r={DelegationManager:"0x56D56e07e3d6Ee5a24e30203A37a0a460f42D7A3",EntryPoint:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",SimpleFactory:"0x6ff518884f21168c30c58CB21184D6AdBC18Ad90",MultiSigDeleGatorImpl:"0xd1f421EDbA5e3FA9efe3874827114b20C5BEC40C",HybridDeleGatorImpl:"0x941f3a016F8726d5643Ce62452d0D78492D42b42",AllowedCalldataEnforcer:"0xff71d60f3208469cBCE0859717B5198042DCB3F3",AllowedMethodsEnforcer:"0xe32C2561792e8446Abe73B9f557B881C13906186",AllowedTargetsEnforcer:"0x06aaE4c67EEA95277c46Bf79b1583d4a01772D22",BlockNumberEnforcer:"0x8E470D2Ae278457b42d2405E0B8Cd4BE21Ed9045",DeployedEnforcer:"0xf9088f013dBD9ebb7Cebd66fEB48253c6Ac5a820",ERC20BalanceGteEnforcer:"0xB7B6f32ec6343261D814e55Ed8C5925d91Cab861",ERC20TransferAmountEnforcer:"0x9A069b18032B31429A363AeCFb1B6A0564b44471",IdEnforcer:"0x91015c3b9D9523966eD2399885e5Df7A567f916c",LimitedCallsEnforcer:"0xe694bFfffEA3E85923b1210b37e6a0175e910863",NonceEnforcer:"0xE83BCFD8bBE672A96747e831050a91cf44F4F87A",TimestampEnforcer:"0x550FdD13eEBC1f22ea2a2480024BacBF0Ad7e5CE",ValueLteEnforcer:"0xBE32a6DB7471F63BB168C088c57Db01AfAe87967",NativeTokenTransferAmountEnforcer:"0x5eD3833d7B957A8DB8A461c3AF2d668Ec25382E0",NativeBalanceGteEnforcer:"0x376a98860E210DdEda3689fb39565592c563cB0A",ArgsEqualityCheckEnforcer:"0x7378dE585998d3E18Ce147867C335C25B3dB8Ee5",NativeTokenPaymentEnforcer:"0x87Fe18EbF99e42fcE8A03a25F1d20E119407f8e7",RedeemerEnforcer:"0x926672b130D1EF60A9d6b11D2048d121b30f40C1"},a={DelegationManager:"0xbe4138886cb096bdc1b930f2f0ca7892aa234d78",EntryPoint:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",SimpleFactory:"0x6ff518884f21168c30c58CB21184D6AdBC18Ad90",MultiSigDeleGatorImpl:"0x11f555af5844d85bfcf5d61d2a22866527eb585a",HybridDeleGatorImpl:"0xd6edd1256deccb2b06bdecef92dc16bcf26e531b",AllowedCalldataEnforcer:"0x48db3835a873d64a4af2c09f014052407c003bd7",AllowedMethodsEnforcer:"0xfd731951bf1c52afccee3e6f14ab656475b76dd4",AllowedTargetsEnforcer:"0xbc8673c0afa52d86d991c06881e55b2966920564",BlockNumberEnforcer:"0xc15faffa0d879b9263c15a46ce31eacfa2e0e8ae",DeployedEnforcer:"0x5accb9559b56a6c1e3f90e342c85c42d93720d43",ERC20BalanceGteEnforcer:"0xb5d6b1ec6d868a3bae5b7f48178eaa2686a7a087",ERC20TransferAmountEnforcer:"0x92ac423b9c111962179a6242e1adb58d02c103be",IdEnforcer:"0x34152d9f3f8f74338d50703e780389e829b4abac",LimitedCallsEnforcer:"0x4b3adad4a328bee8ba17b86074d92fe7372180cd",NonceEnforcer:"0x2f32ff3fc3086d7f63f16fe8d0065390d460b40d",TimestampEnforcer:"0x78e05f779490c24bf3bfa135b4112e7003b321cd",ValueLteEnforcer:"0xfc20ede0a1132e839fbda9d7ed3904ff3c89540f"},o={mainnet:1,optimism:10,bsc:56,gnosis:100,polygon:137,base:8453,arbitrum:42161,linea:59144,berachain:80094,unichain:130,arbitrumNova:42170,bscTestnet:97,megaEthTestnet:6342,chiado:10200,lineaSepolia:59141,berachainBepolia:80069,baseSepolia:84532,arbitrumSepolia:421614,sepolia:11155111,optimismSepolia:11155420,unichainSepolia:1301,polygonAmoy:80002,monadTestnet:10143,lineaGoerli:59140},i={"1.0.0":{[o.optimism]:a,[o.polygon]:a,[o.base]:a,[o.arbitrum]:a,[o.linea]:a,[o.sepolia]:{...a,HybridDeleGatorImpl:"0x5989F5D13DF8fc818EdA65e417AED90459fD67F7"},[o.lineaSepolia]:{...a,HybridDeleGatorImpl:"0x5989F5D13DF8fc818EdA65e417AED90459fD67F7"}},"1.1.0":{[o.arbitrum]:r,[o.base]:r,[o.linea]:r,[o.optimism]:r,[o.polygon]:r,[o.sepolia]:r,[o.lineaSepolia]:r,[o.baseSepolia]:{...r,SimpleFactory:"0xE8eA1DE8D6AfE400B7C8C1A81B7C29B7876b4d02"}},"1.3.0":{[o.mainnet]:n,[o.polygon]:n,[o.bsc]:n,[o.optimism]:n,[o.arbitrum]:n,[o.linea]:n,[o.base]:n,[o.gnosis]:n,[o.berachain]:n,[o.unichain]:n,[o.arbitrumNova]:n,[o.sepolia]:n,[o.lineaSepolia]:n,[o.baseSepolia]:n,[o.megaEthTestnet]:n,[o.chiado]:n,[o.bscTestnet]:n,[o.optimismSepolia]:n,[o.arbitrumSepolia]:n,[o.berachainBepolia]:n,[o.unichainSepolia]:n,[o.polygonAmoy]:n,[o.monadTestnet]:n}};s.CHAIN_ID=o,s.DELEGATOR_CONTRACTS=i}}},{package:"@metamask/gator-permissions-controller>@metamask/delegation-deployments",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/delegation-deployments/dist/index.js"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/account.cjs",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.snapOwnsAccount=s.createChainIdList=s.createAccountList=void 0;const n=e("@metamask/utils");s.createAccountList=function(e,t){return t.map(t=>`${t}:${e}`)},s.createChainIdList=function(e,t){return t&&0!==t.length?e.reduce((e,s)=>{if("eip155:0"===s){const s=t.filter(e=>{const{namespace:t}=(0,n.parseCaipChainId)(e);return t===n.KnownCaipNamespace.Eip155});e.push(...s)}else t.includes(s)&&e.push(s);return e},[]):e},s.snapOwnsAccount=function(e,t){var s;return(null===(s=t.metadata.snap)||void 0===s?void 0:s.id)===e}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/account.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/array.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.isEqual=void 0,s.isEqual=function(e,t){return e.length===t.length&&e.every((e,s)=>e===t[s])}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/array.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/auxiliary-files.cjs",{"./base64.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/base64.cjs","./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/constants.cjs","@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.validateAuxiliaryFiles=s.encodeAuxiliaryFile=void 0;const n=e("@metamask/snaps-sdk"),r=e("@metamask/utils"),a=e("./base64.cjs"),o=e("./constants.cjs");s.encodeAuxiliaryFile=async function(e,t){if(t===n.AuxiliaryFileEncoding.Base64)return e;const s=await(0,a.decodeBase64)(e);return t===n.AuxiliaryFileEncoding.Utf8?(0,r.bytesToString)(s):(0,r.bytesToHex)(s)},s.validateAuxiliaryFiles=function(e){for(const t of e)(0,r.assert)(t.size<o.MAX_FILE_SIZE,"Static files required by the Snap must be smaller than 64 MB.")}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/auxiliary-files.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/base64.cjs",{"./bytes.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/bytes.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.decodeBase64=s.encodeBase64=void 0;const n=e("@metamask/utils"),r=e("./bytes.cjs");s.encodeBase64=async function(e){const t=(0,r.getBytes)(e),s="undefined"!=typeof navigator&&"ReactNative"===navigator.product;return"FileReader"in globalThis&&!s?await new Promise((e,s)=>{const n=Object.assign(new FileReader,{onload:()=>e(n.result.replace("data:application/octet-stream;base64,","")),onerror:()=>s(n.error)});n.readAsDataURL(new File([t],"",{type:"application/octet-stream"}))}):(0,n.bytesToBase64)(t)},s.decodeBase64=async function(e){const t=await fetch(`data:application/octet-stream;base64,${e}`);return new Uint8Array(await t.arrayBuffer())}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/base64.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/bytes.cjs",{"./virtual-file/VirtualFile.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/virtual-file/VirtualFile.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getBytes=void 0;const n=e("@metamask/utils"),r=e("./virtual-file/VirtualFile.cjs");s.getBytes=function(e){const t=e instanceof r.VirtualFile?e.value:e;return"string"==typeof t?(0,n.stringToBytes)(t):t}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/bytes.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/caveats.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n;Object.defineProperty(s,"__esModule",{value:!0}),s.SnapCaveatType=void 0,function(e){e.PermittedDerivationPaths="permittedDerivationPaths",e.PermittedCoinTypes="permittedCoinTypes",e.SnapCronjob="snapCronjob",e.TransactionOrigin="transactionOrigin",e.SignatureOrigin="signatureOrigin",e.RpcOrigin="rpcOrigin",e.KeyringOrigin="keyringOrigin",e.SnapIds="snapIds",e.ChainIds="chainIds",e.LookupMatchers="lookupMatchers",e.MaxRequestTime="maxRequestTime",e.ProtocolSnapScopes="protocolSnapScopes"}(n||(s.SnapCaveatType=n={}))}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/caveats.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/checksum.cjs",{"./bytes.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/bytes.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.checksumFiles=s.checksum=void 0;const n=e("@metamask/utils"),r=e("./bytes.cjs");async function a(e){return await(0,n.sha256)((0,r.getBytes)(e))}s.checksum=a,s.checksumFiles=async function(e){const t=await Promise.all([...e].sort((e,t)=>((0,n.assert)(e.path!==t.path,"Tried to sort files with non-unique paths."),e.path<t.path?-1:1)).map(async e=>a(e)));return a((0,n.concatBytes)(t))}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/checksum.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/constants.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.MAX_FILE_SIZE=void 0,s.MAX_FILE_SIZE=64e6}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/constants.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/cronjob.cjs",{"./time.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/time.cjs","@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs","cron-parser":"/home/runner/work/metamask-extension/metamask-extension/node_modules/cron-parser/lib/parser.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.isCronjobSpecificationArray=s.CronjobSpecificationArrayStruct=s.isCronjobSpecification=s.CronjobSpecificationStruct=s.CronExpressionStruct=s.CronjobRpcRequestStruct=void 0;const n=e("@metamask/snaps-sdk"),r=e("@metamask/superstruct"),a=e("@metamask/utils"),o=e("cron-parser"),i=e("./time.cjs");s.CronjobRpcRequestStruct=(0,r.object)({jsonrpc:(0,r.optional)(a.JsonRpcVersionStruct),id:(0,r.optional)(a.JsonRpcIdStruct),method:(0,r.string)(),params:(0,r.optional)(a.JsonRpcParamsStruct)}),s.CronExpressionStruct=(0,r.refine)((0,r.string)(),"cronjob expression",e=>{try{return(0,o.parseExpression)(e),!0}catch{return`Expected a cronjob expression, but received: "${e}"`}});const c=(0,r.object)({expression:s.CronExpressionStruct,request:s.CronjobRpcRequestStruct}),l=(0,r.object)({duration:i.ISO8601DurationStruct,request:s.CronjobRpcRequestStruct});s.CronjobSpecificationStruct=(0,n.selectiveUnion)(e=>(0,a.isObject)(e)&&(0,a.hasProperty)(e,"duration")?l:c),s.isCronjobSpecification=function(e){try{return(0,r.create)(e,s.CronjobSpecificationStruct),!0}catch{return!1}},s.CronjobSpecificationArrayStruct=(0,r.array)(s.CronjobSpecificationStruct),s.isCronjobSpecificationArray=function(e){try{return(0,r.create)(e,s.CronjobSpecificationArrayStruct),!0}catch{return!1}}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/cronjob.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/currency.cjs",{"@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.currency=void 0;const n=e("@metamask/superstruct");s.currency=function(e){const t=e.toLowerCase();return(0,n.coerce)((0,n.literal)(t),(0,n.literal)(e.toUpperCase()),e=>(0,n.create)(e.toLowerCase(),(0,n.literal)(t)))}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/currency.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/deep-clone.cjs",{rfdc:"/home/runner/work/metamask-extension/metamask-extension/node_modules/rfdc/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.deepClone=void 0;const r=n(e("rfdc"));s.deepClone=(0,r.default)({proto:!1,circles:!1})}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/deep-clone.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/default-endowments.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_ENDOWMENTS=void 0,s.DEFAULT_ENDOWMENTS=Object.freeze(["atob","btoa","BigInt","console","crypto","Date","Math","setTimeout","clearTimeout","SubtleCrypto","TextDecoder","TextEncoder","URL","URLSearchParams","setInterval","clearInterval","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","isSecureContext","Intl","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView","ArrayBuffer","AbortController","AbortSignal"])}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/default-endowments.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/derivation-paths.cjs",{"./array.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/array.cjs","@metamask/slip44":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/slip44/slip44.json"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.getSlip44ProtocolName=s.getSnapDerivationPathName=s.SNAPS_DERIVATION_PATHS=void 0;const r=n(e("@metamask/slip44")),a=e("./array.cjs");function o(e){var t;return"1"===String(e)?"Test Networks":(null===(t=r.default[e])||void 0===t?void 0:t.name)??null}s.SNAPS_DERIVATION_PATHS=[{path:["m","44'","0'"],curve:"ed25519",name:"Test BIP-32 Path (ed25519)"},{path:["m","44'","1'"],curve:"secp256k1",name:"Testnet"},{path:["m","44'","0'"],curve:"secp256k1",name:"Bitcoin Legacy"},{path:["m","49'","0'"],curve:"secp256k1",name:"Bitcoin Nested SegWit"},{path:["m","49'","1'"],curve:"secp256k1",name:"Bitcoin Testnet Nested SegWit"},{path:["m","84'","0'"],curve:"secp256k1",name:"Bitcoin Native SegWit"},{path:["m","84'","1'"],curve:"secp256k1",name:"Bitcoin Testnet Native SegWit"},{path:["m","86'","0'"],curve:"secp256k1",name:"Bitcoin Taproot"},{path:["m","86'","1'"],curve:"secp256k1",name:"Bitcoin Testnet Taproot"},{path:["m","44'","501'"],curve:"ed25519",name:"Solana"},{path:["m","44'","501'","0'","0'"],curve:"ed25519",name:"Solana"},{path:["m","44'","2'"],curve:"secp256k1",name:"Litecoin"},{path:["m","44'","3'"],curve:"secp256k1",name:"Dogecoin"},{path:["m","44'","60'"],curve:"secp256k1",name:"Ethereum"},{path:["m","44'","118'"],curve:"secp256k1",name:"Atom"},{path:["m","44'","145'"],curve:"secp256k1",name:"Bitcoin Cash"},{path:["m","44'","637'"],curve:"ed25519",name:"Aptos"},{path:["m","44'","714'"],curve:"secp256k1",name:"Binance (BNB)"},{path:["m","44'","784'"],curve:"ed25519",name:"Sui"},{path:["m","44'","931'"],curve:"secp256k1",name:"THORChain (RUNE)"},{path:["m","44'","330'"],curve:"secp256k1",name:"Terra (LUNA)"},{path:["m","44'","459'"],curve:"secp256k1",name:"Kava"},{path:["m","44'","529'"],curve:"secp256k1",name:"Secret Network"},{path:["m","44'","397'","0'"],curve:"ed25519",name:"NEAR Protocol"},{path:["m","44'","1'","0'"],curve:"ed25519",name:"Testnet"},{path:["m","44'","472'"],curve:"ed25519",name:"Arweave"},{path:["m","44'","12586'"],curve:"secp256k1",name:"Mina"},{path:["m","44'","242'"],curve:"ed25519",name:"Nimiq"},{path:["m","44'","1729'","0'","0'"],curve:"ed25519",name:"Tezos"},{path:["m","1789'","0'"],curve:"ed25519",name:"Vega"},{path:["m","1852'","1815'"],curve:"ed25519Bip32",name:"Cardano"},{path:["m","44'","508'","0'","0'","0'"],curve:"ed25519",name:"MultiversX"},{path:["m","44'","709'"],curve:"secp256k1",name:"Avail"},{path:["m","44'","626'"],curve:"ed25519",name:"Kadena"},{path:["m","44'","632'"],curve:"ed25519",name:"Massa"},{path:["m","44'","4218'"],curve:"ed25519",name:"IOTA"}],s.getSnapDerivationPathName=function(e,t){const n=s.SNAPS_DERIVATION_PATHS.find(s=>s.curve===t&&(0,a.isEqual)(s.path,e));if(n)return n.name;if("secp256k1"===t&&"m"===e[0]&&"44'"===e[1]&&e[2].endsWith("'")){return o(e[2].slice(0,-1))??null}return null},s.getSlip44ProtocolName=o}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/derivation-paths.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/entropy.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.STATE_ENCRYPTION_MAGIC_VALUE=s.SIP_6_MAGIC_VALUE=void 0,s.SIP_6_MAGIC_VALUE="1399742832'",s.STATE_ENCRYPTION_MAGIC_VALUE="572232532'"}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/entropy.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/errors.cjs",{"@metamask/rpc-errors":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/rpc-errors/dist/index.cjs","@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){function n(e,t,s){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,s)}function r(e,t){return e.get(o(e,t))}function a(e,t,s){return e.set(o(e,t),s),s}function o(e,t,s){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:s;throw new TypeError("Private element is not present on this object")}Object.defineProperty(s,"__esModule",{value:!0}),s.TrackableErrorStruct=s.unwrapError=s.isWrappedSnapError=s.isSerializedSnapError=s.isSnapError=s.WrappedSnapError=s.SNAP_ERROR_WRAPPER_MESSAGE=s.SNAP_ERROR_WRAPPER_CODE=void 0;const i=e("@metamask/rpc-errors"),c=e("@metamask/snaps-sdk"),l=e("@metamask/superstruct"),d=e("@metamask/utils");s.SNAP_ERROR_WRAPPER_CODE=-31001,s.SNAP_ERROR_WRAPPER_MESSAGE="Wrapped Snap Error";var m=new WeakMap,u=new WeakMap,p=new WeakMap;class h extends Error{constructor(e){const t=(0,c.getErrorMessage)(e);super(t),n(this,m,void 0),n(this,u,void 0),n(this,p,void 0),a(m,this,e),a(u,this,t),a(p,this,(0,c.getErrorStack)(e)??undefined)}get name(){return"WrappedSnapError"}get message(){return r(u,this)}get stack(){return r(p,this)}toJSON(){const e=f(r(m,this))?r(m,this).serialize():(0,i.serializeCause)(r(m,this));return{code:s.SNAP_ERROR_WRAPPER_CODE,message:s.SNAP_ERROR_WRAPPER_MESSAGE,data:{cause:e}}}serialize(){return this.toJSON()}}function f(e){if((0,d.isObject)(e)&&"serialize"in e&&"function"==typeof e.serialize){const t=e.serialize();return(0,d.isJsonRpcError)(t)&&g(t)}return!1}function g(e){return e.code===c.SNAP_ERROR_CODE&&e.message===c.SNAP_ERROR_MESSAGE}function k(e){return(0,d.isJsonRpcError)(e)&&e.code===s.SNAP_ERROR_WRAPPER_CODE&&e.message===s.SNAP_ERROR_WRAPPER_MESSAGE}function w(e,t,s,n){const r=new i.JsonRpcError(e,t,n);return r.stack=s??undefined,r}s.WrappedSnapError=h,s.isSnapError=f,s.isSerializedSnapError=g,s.isWrappedSnapError=k,s.unwrapError=function(e){if(k(e)){if((0,d.isJsonRpcError)(e.data.cause)){if(g(e.data.cause)){const{code:t,message:s,stack:n,data:r}=e.data.cause.data.cause;return[w(t,s,n,r),!0]}if((0,d.isObject)(e.data.cause.data)&&(0,d.isObject)(e.data.cause.data.cause)&&e.data.cause.message===e.data.cause.data.cause.message){const t=e.data.cause.data.cause,{code:s,message:n}=e.data.cause;return[w(s,n,(0,c.getErrorStack)(t)),!1]}const{code:t,message:s,stack:n,data:r}=e.data.cause;return[w(t,s,n,r),!1]}return[w(i.errorCodes.rpc.internal,(0,c.getErrorMessage)(e.data.cause),(0,c.getErrorStack)(e.data.cause)),!1]}if((0,d.isJsonRpcError)(e)){const{code:t,message:s,stack:n,data:r}=e;return[w(t,s,n,r),!1]}return[w(i.errorCodes.rpc.internal,(0,c.getErrorMessage)(e),(0,c.getErrorStack)(e)),!1]},s.TrackableErrorStruct=(0,l.object)({name:(0,l.string)(),message:(0,l.string)(),stack:(0,l.nullable)((0,l.string)()),cause:(0,l.nullable)((0,l.lazy)(()=>s.TrackableErrorStruct))})}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/errors.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/asset-historical-price.cjs",{"../time.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/time.cjs","@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnAssetHistoricalPriceResponseStruct=s.AssetHistoricalPriceStruct=s.HistoricalPriceStruct=void 0;const n=e("@metamask/snaps-sdk"),r=e("@metamask/superstruct"),a=e("../time.cjs");s.HistoricalPriceStruct=(0,n.nonEmptyRecord)((0,r.union)([(0,r.literal)("all"),a.ISO8601DurationStruct]),(0,r.array)((0,r.tuple)([(0,r.number)(),(0,r.string)()]))),s.AssetHistoricalPriceStruct=(0,r.nullable)((0,r.object)({intervals:s.HistoricalPriceStruct,updateTime:(0,r.number)(),expirationTime:(0,r.optional)((0,r.number)())})),s.OnAssetHistoricalPriceResponseStruct=(0,r.object)({historicalPrice:s.AssetHistoricalPriceStruct})}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/asset-historical-price.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/assets-conversion.cjs",{"@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnAssetsConversionResponseStruct=s.AssetConversionStruct=void 0;const n=e("@metamask/superstruct"),r=e("@metamask/utils");s.AssetConversionStruct=(0,n.object)({rate:(0,n.string)(),conversionTime:(0,n.number)(),expirationTime:(0,n.optional)((0,n.number)())}),s.OnAssetsConversionResponseStruct=(0,n.object)({conversionRates:(0,n.record)(r.CaipAssetTypeStruct,(0,n.record)(r.CaipAssetTypeStruct,(0,n.nullable)(s.AssetConversionStruct)))})}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/assets-conversion.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/assets-market-data.cjs",{"../time.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/time.cjs","@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnAssetsMarketDataResponseStruct=s.AssetMarketDataStruct=s.NonFungibleAssetMarketDataStruct=s.AssetValueStruct=s.FungibleAssetMarketDataStruct=s.PricePercentChangeStruct=void 0;const n=e("@metamask/snaps-sdk"),r=e("@metamask/superstruct"),a=e("@metamask/utils"),o=e("../time.cjs");s.PricePercentChangeStruct=(0,n.nonEmptyRecord)((0,r.union)([(0,r.literal)("all"),o.ISO8601DurationStruct]),(0,r.number)()),s.FungibleAssetMarketDataStruct=(0,r.object)({fungible:(0,r.literal)(!0),marketCap:(0,r.optional)((0,r.string)()),totalVolume:(0,r.optional)((0,r.string)()),circulatingSupply:(0,r.optional)((0,r.string)()),allTimeHigh:(0,r.optional)((0,r.string)()),allTimeLow:(0,r.optional)((0,r.string)()),pricePercentChange:(0,r.optional)(s.PricePercentChangeStruct)}),s.AssetValueStruct=(0,r.object)({asset:a.CaipAssetTypeOrIdStruct,amount:(0,r.string)()}),s.NonFungibleAssetMarketDataStruct=(0,r.object)({fungible:(0,r.literal)(!1),lastSale:(0,r.optional)(s.AssetValueStruct),topBid:(0,r.optional)(s.AssetValueStruct),floorPrice:(0,r.optional)(s.AssetValueStruct),rarity:(0,r.optional)((0,r.object)({ranking:(0,r.optional)((0,r.object)({source:(0,r.string)(),rank:(0,r.number)()})),metadata:(0,r.optional)((0,r.record)((0,r.string)(),(0,r.number)()))}))}),s.AssetMarketDataStruct=(0,n.selectiveUnion)(e=>(0,a.isObject)(e)&&e.fungible?s.FungibleAssetMarketDataStruct:s.NonFungibleAssetMarketDataStruct),s.OnAssetsMarketDataResponseStruct=(0,r.object)({marketData:(0,r.record)(a.CaipAssetTypeOrIdStruct,(0,r.record)(a.CaipAssetTypeStruct,(0,r.nullable)(s.AssetMarketDataStruct)))})}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/assets-market-data.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/exports.cjs",{"./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/types.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.SNAP_EXPORT_NAMES=s.SNAP_EXPORTS=void 0;const n=e("./types.cjs");s.SNAP_EXPORTS={[n.HandlerType.OnRpcRequest]:{type:n.HandlerType.OnRpcRequest,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnTransaction]:{type:n.HandlerType.OnTransaction,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnCronjob]:{type:n.HandlerType.OnCronjob,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnNameLookup]:{type:n.HandlerType.OnNameLookup,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnInstall]:{type:n.HandlerType.OnInstall,required:!1,validator:e=>"function"==typeof e},[n.HandlerType.OnUpdate]:{type:n.HandlerType.OnUpdate,required:!1,validator:e=>"function"==typeof e},[n.HandlerType.OnStart]:{type:n.HandlerType.OnStart,required:!1,validator:e=>"function"==typeof e},[n.HandlerType.OnActive]:{type:n.HandlerType.OnActive,required:!1,validator:e=>"function"==typeof e},[n.HandlerType.OnInactive]:{type:n.HandlerType.OnInactive,required:!1,validator:e=>"function"==typeof e},[n.HandlerType.OnKeyringRequest]:{type:n.HandlerType.OnKeyringRequest,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnHomePage]:{type:n.HandlerType.OnHomePage,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnSettingsPage]:{type:n.HandlerType.OnSettingsPage,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnSignature]:{type:n.HandlerType.OnSignature,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnUserInput]:{type:n.HandlerType.OnUserInput,required:!1,validator:e=>"function"==typeof e},[n.HandlerType.OnAssetHistoricalPrice]:{type:n.HandlerType.OnAssetHistoricalPrice,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnAssetsLookup]:{type:n.HandlerType.OnAssetsLookup,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnAssetsConversion]:{type:n.HandlerType.OnAssetsConversion,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnAssetsMarketData]:{type:n.HandlerType.OnAssetsMarketData,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnProtocolRequest]:{type:n.HandlerType.OnProtocolRequest,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnClientRequest]:{type:n.HandlerType.OnClientRequest,required:!0,validator:e=>"function"==typeof e},[n.HandlerType.OnWebSocketEvent]:{type:n.HandlerType.OnWebSocketEvent,required:!0,validator:e=>"function"==typeof e}},s.SNAP_EXPORT_NAMES=Object.values(n.HandlerType)}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/exports.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/home-page.cjs",{"@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnHomePageResponseStruct=s.OnHomePageResponseWithIdStruct=s.OnHomePageResponseWithContentStruct=void 0;const n=e("@metamask/snaps-sdk"),r=e("@metamask/superstruct");s.OnHomePageResponseWithContentStruct=(0,r.object)({content:n.ComponentOrElementStruct}),s.OnHomePageResponseWithIdStruct=(0,r.object)({id:(0,r.string)()}),s.OnHomePageResponseStruct=(0,r.union)([s.OnHomePageResponseWithContentStruct,s.OnHomePageResponseWithIdStruct])}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/home-page.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/index.cjs",{"./asset-historical-price.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/asset-historical-price.cjs","./assets-conversion.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/assets-conversion.cjs","./assets-market-data.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/assets-market-data.cjs","./exports.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/exports.cjs","./home-page.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/home-page.cjs","./name-lookup.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/name-lookup.cjs","./settings-page.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/settings-page.cjs","./signature.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/signature.cjs","./transaction.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/transaction.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/types.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]},r=function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./asset-historical-price.cjs"),s),r(e("./assets-conversion.cjs"),s),r(e("./assets-market-data.cjs"),s),r(e("./exports.cjs"),s),r(e("./home-page.cjs"),s),r(e("./name-lookup.cjs"),s),r(e("./settings-page.cjs"),s),r(e("./signature.cjs"),s),r(e("./transaction.cjs"),s),r(e("./types.cjs"),s)}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/name-lookup.cjs",{"@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnNameLookupResponseStruct=s.DomainResolutionResponseStruct=s.AddressResolutionResponseStruct=s.DomainResolutionStruct=s.AddressResolutionStruct=void 0;const n=e("@metamask/superstruct");s.AddressResolutionStruct=(0,n.object)({protocol:(0,n.string)(),resolvedDomain:(0,n.string)()}),s.DomainResolutionStruct=(0,n.object)({protocol:(0,n.string)(),resolvedAddress:(0,n.string)(),domainName:(0,n.string)()}),s.AddressResolutionResponseStruct=(0,n.object)({resolvedDomains:(0,n.size)((0,n.array)(s.AddressResolutionStruct),1,Infinity)}),s.DomainResolutionResponseStruct=(0,n.object)({resolvedAddresses:(0,n.size)((0,n.array)(s.DomainResolutionStruct),1,Infinity)}),s.OnNameLookupResponseStruct=(0,n.nullable)((0,n.union)([s.AddressResolutionResponseStruct,s.DomainResolutionResponseStruct]))}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/name-lookup.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/settings-page.cjs",{"./home-page.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/home-page.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnSettingsPageResponseStruct=void 0;const n=e("./home-page.cjs");s.OnSettingsPageResponseStruct=n.OnHomePageResponseStruct}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/settings-page.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/signature.cjs",{"./transaction.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/transaction.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnSignatureResponseStruct=void 0;const n=e("./transaction.cjs");s.OnSignatureResponseStruct=n.OnTransactionResponseStruct}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/signature.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/transaction.cjs",{"@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.OnTransactionResponseStruct=s.OnTransactionResponseWithContentStruct=s.OnTransactionResponseWithIdStruct=s.OnTransactionSeverityResponseStruct=void 0;const n=e("@metamask/snaps-sdk"),r=e("@metamask/superstruct");s.OnTransactionSeverityResponseStruct=(0,r.object)({severity:(0,r.optional)((0,r.literal)(n.SeverityLevel.Critical))}),s.OnTransactionResponseWithIdStruct=(0,r.assign)(s.OnTransactionSeverityResponseStruct,(0,r.object)({id:(0,r.string)()})),s.OnTransactionResponseWithContentStruct=(0,r.assign)(s.OnTransactionSeverityResponseStruct,(0,r.object)({content:n.ComponentOrElementStruct})),s.OnTransactionResponseStruct=(0,r.nullable)((0,r.union)([s.OnTransactionResponseWithContentStruct,s.OnTransactionResponseWithIdStruct]))}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/transaction.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/types.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n;Object.defineProperty(s,"__esModule",{value:!0}),s.HandlerType=void 0,function(e){e.OnRpcRequest="onRpcRequest",e.OnSignature="onSignature",e.OnTransaction="onTransaction",e.OnCronjob="onCronjob",e.OnInstall="onInstall",e.OnUpdate="onUpdate",e.OnStart="onStart",e.OnActive="onActive",e.OnInactive="onInactive",e.OnNameLookup="onNameLookup",e.OnKeyringRequest="onKeyringRequest",e.OnHomePage="onHomePage",e.OnSettingsPage="onSettingsPage",e.OnUserInput="onUserInput",e.OnAssetsLookup="onAssetsLookup",e.OnAssetsConversion="onAssetsConversion",e.OnAssetHistoricalPrice="onAssetHistoricalPrice",e.OnAssetsMarketData="onAssetsMarketData",e.OnProtocolRequest="onProtocolRequest",e.OnClientRequest="onClientRequest",e.OnWebSocketEvent="onWebSocketEvent"}(n||(s.HandlerType=n={}))}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/types.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/icon.cjs",{"./svg.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/svg.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getSvgDimensions=s.assertIsSnapIcon=s.SVG_MAX_BYTE_SIZE_TEXT=s.SVG_MAX_BYTE_SIZE=void 0;const n=e("@metamask/utils"),r=e("./svg.cjs");s.SVG_MAX_BYTE_SIZE=1e5,s.SVG_MAX_BYTE_SIZE_TEXT=`${Math.floor(s.SVG_MAX_BYTE_SIZE/1e3)}kb`,s.assertIsSnapIcon=function(e){(0,n.assert)(e.path.endsWith(".svg"),'Expected snap icon to end in ".svg".');const t="string"==typeof e.value?(0,n.stringToBytes)(e.value).byteLength:e.value.byteLength;(0,n.assert)(t<=s.SVG_MAX_BYTE_SIZE,`The specified SVG icon exceeds the maximum size of ${s.SVG_MAX_BYTE_SIZE_TEXT}.`),(0,n.assert)((0,r.isSvg)(e.toString()),"Snap icon must be a valid SVG.")},s.getSvgDimensions=function(e){try{const t=(0,r.parseSvg)(e),s=t["@_height"],a=t["@_width"];if(s&&a)return{height:s,width:a};const o=t["@_viewBox"];if(o){const[e,t,s,r]=o.split(" ");if(s&&r){const e=parseInt(s,10),t=parseInt(r,10);return(0,n.assert)(Number.isInteger(e)&&e>0),(0,n.assert)(Number.isInteger(t)&&t>0),{width:e,height:t}}}}catch{throw new Error("Snap icon must be a valid SVG.")}return null}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/icon.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/iframe.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.createWindow=void 0,s.createWindow=async function({uri:e,id:t,sandbox:s=!0,testId:n="snaps-iframe"}){return await new Promise((r,a)=>{const o=document.createElement("iframe");o.setAttribute("id",t),o.setAttribute("data-testid",n),s&&o.setAttribute("sandbox","allow-scripts"),o.setAttribute("src",e),document.body.appendChild(o),o.addEventListener("load",()=>{o.contentWindow?r(o.contentWindow):a(new Error(`iframe.contentWindow not present on load for job "${t}".`))},{once:!0})})}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/iframe.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/index.cjs",{"./account.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/account.cjs","./array.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/array.cjs","./auxiliary-files.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/auxiliary-files.cjs","./base64.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/base64.cjs","./bytes.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/bytes.cjs","./caveats.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/caveats.cjs","./checksum.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/checksum.cjs","./constants.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/constants.cjs","./cronjob.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/cronjob.cjs","./currency.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/currency.cjs","./deep-clone.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/deep-clone.cjs","./default-endowments.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/default-endowments.cjs","./derivation-paths.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/derivation-paths.cjs","./entropy.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/entropy.cjs","./errors.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/errors.cjs","./handlers/index.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/handlers/index.cjs","./iframe.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/iframe.cjs","./json-rpc.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json-rpc.cjs","./json.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json.cjs","./localization.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/localization.cjs","./logging.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/logging.cjs","./manifest/index.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/manifest/index.cjs","./path.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/path.cjs","./platform-version.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/platform-version.cjs","./snaps.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/snaps.cjs","./strings.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/strings.cjs","./structs.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/structs.cjs","./time.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/time.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/types.cjs","./ui.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/ui.cjs","./url.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/url.cjs","./validation.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/validation.cjs","./versions.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/versions.cjs","./virtual-file/index.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/virtual-file/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]},r=function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./account.cjs"),s),r(e("./array.cjs"),s),r(e("./auxiliary-files.cjs"),s),r(e("./base64.cjs"),s),r(e("./bytes.cjs"),s),r(e("./caveats.cjs"),s),r(e("./checksum.cjs"),s),r(e("./constants.cjs"),s),r(e("./cronjob.cjs"),s),r(e("./currency.cjs"),s),r(e("./deep-clone.cjs"),s),r(e("./default-endowments.cjs"),s),r(e("./derivation-paths.cjs"),s),r(e("./entropy.cjs"),s),r(e("./errors.cjs"),s),r(e("./handlers/index.cjs"),s),r(e("./iframe.cjs"),s),r(e("./json.cjs"),s),r(e("./json-rpc.cjs"),s),r(e("./localization.cjs"),s),r(e("./logging.cjs"),s),r(e("./manifest/index.cjs"),s),r(e("./path.cjs"),s),r(e("./platform-version.cjs"),s),r(e("./snaps.cjs"),s),r(e("./strings.cjs"),s),r(e("./structs.cjs"),s),r(e("./time.cjs"),s),r(e("./types.cjs"),s),r(e("./ui.cjs"),s),r(e("./url.cjs"),s),r(e("./validation.cjs"),s),r(e("./versions.cjs"),s),r(e("./virtual-file/index.cjs"),s)}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json-rpc.cjs",{"@metamask/permission-controller":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/permission-controller/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.assertIsJsonRpcSuccess=s.isOriginAllowed=s.assertIsKeyringOrigins=s.KeyringOriginsStruct=s.assertIsRpcOrigins=s.RpcOriginsStruct=void 0;const n=e("@metamask/permission-controller"),r=e("@metamask/superstruct"),a=e("@metamask/utils"),o=(0,r.array)((0,r.refine)((0,r.string)(),"Allowed origin",e=>!(e.split("*").length-1>2)||'No more than two wildcards ("*") are allowed in an origin specifier.'));function i(e,t){if("*"===e||e===t)return!0;const s=function(e){const t=e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&").replace(/\\\*/gu,".*");return RegExp(`^${t}$`,"u")}(e);return s.test(t)}s.RpcOriginsStruct=(0,r.refine)((0,r.object)({dapps:(0,r.optional)((0,r.boolean)()),snaps:(0,r.optional)((0,r.boolean)()),allowedOrigins:(0,r.optional)(o)}),"RPC origins",e=>!!Boolean(!0===e.snaps||!0===e.dapps||e.allowedOrigins&&e.allowedOrigins.length>0)||"Must specify at least one JSON-RPC origin."),s.assertIsRpcOrigins=function(e,t){(0,a.assertStruct)(e,s.RpcOriginsStruct,"Invalid JSON-RPC origins",t)},s.KeyringOriginsStruct=(0,r.object)({allowedOrigins:(0,r.optional)(o)}),s.assertIsKeyringOrigins=function(e,t){(0,a.assertStruct)(e,s.KeyringOriginsStruct,"Invalid keyring origins",t)},s.isOriginAllowed=function(e,t,s){var r;return"metamask"===s||(!(null===(r=e.allowedOrigins)||void 0===r||!r.some(e=>i(e,s)))||(!(t!==n.SubjectType.Website||!e.dapps)||Boolean(t===n.SubjectType.Snap&&e.snaps)))},s.assertIsJsonRpcSuccess=function(e){if(!(0,a.isJsonRpcSuccess)(e)){if((0,a.isJsonRpcFailure)(e))throw new Error(`JSON-RPC request failed: ${e.error.message}`);throw new Error("Invalid JSON-RPC response.")}}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json-rpc.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json.cjs",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.getJsonSizeUnsafe=s.parseJson=void 0;const n=e("@metamask/utils");s.parseJson=function(e){return(0,n.getSafeJson)(JSON.parse(e))},s.getJsonSizeUnsafe=function(e,t=!1){const s=JSON.stringify(e);return t?(new TextEncoder).encode(s).byteLength:s.length}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/localization.cjs",{"./json.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json.cjs","@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.validateSnapManifestLocalizations=s.getLocalizedSnapManifest=s.translate=s.TRANSLATION_REGEX=s.getLocalizationFile=s.getValidatedLocalizationFiles=s.LocalizationFileStruct=s.LOCALIZABLE_FIELDS=void 0;const n=e("@metamask/snaps-sdk"),r=e("@metamask/superstruct"),a=e("./json.cjs");function o(e,t){const s=t.find(t=>t.locale===e);return s||t.find(e=>"en"===e.locale)}function i(e,t){const n=e.matchAll(s.TRANSLATION_REGEX);return Array.from(n).reduce((s,[n,r])=>{if(!t)throw new Error(`Failed to translate "${e}": No localization file found.`);const a=t.messages[r.trim()];if(!a)throw new Error(`Failed to translate "${e}": No translation found for "${r.trim()}" in "${t.locale}" file.`);return s.replace(n,a.message)},e)}function c(e,t,n){const r=o(t,n);return s.LOCALIZABLE_FIELDS.reduce((e,t)=>{const s=i(e[t],r);return{...e,[t]:s}},e)}s.LOCALIZABLE_FIELDS=["description","proposedName"],s.LocalizationFileStruct=(0,r.object)({locale:(0,r.string)(),messages:(0,r.record)((0,r.string)(),(0,r.object)({message:(0,r.string)(),description:(0,r.optional)((0,r.string)())}))}),s.getValidatedLocalizationFiles=function(e){for(const t of e)try{t.result=(0,r.create)((0,a.parseJson)(t.toString()),s.LocalizationFileStruct)}catch(e){if(e instanceof r.StructError)throw new Error(`Failed to validate localization file "${t.path}": ${e.message}.`);if(e instanceof SyntaxError)throw new Error(`Failed to parse localization file "${t.path}" as JSON.`);throw e}return e},s.getLocalizationFile=o,s.TRANSLATION_REGEX=/\{\{\s?([a-zA-Z0-9-_\s]+)\s?\}\}/gu,s.translate=i,s.getLocalizedSnapManifest=c,s.validateSnapManifestLocalizations=function(e,t){try{t.filter(e=>"en"!==e.locale).forEach(s=>{c(e,s.locale,t)}),c(e,"en",t)}catch(e){throw new Error(`Failed to localize Snap manifest: ${(0,n.getErrorMessage)(e)}`)}}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/localization.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/logging.cjs",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.logWarning=s.logError=s.logInfo=s.snapsLogger=void 0;const n=e("@metamask/utils");s.snapsLogger=(0,n.createProjectLogger)("snaps"),s.logInfo=function(e,...t){console.log(e,...t)},s.logError=function(e,...t){console.error(e,...t)},s.logWarning=function(e,...t){console.warn(e,...t)}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/logging.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/manifest/index.cjs",{"./validation.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/manifest/validation.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=Object.create?function(e,t,s,n){n===undefined&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){n===undefined&&(n=s),e[n]=t[s]},r=function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(s,"__esModule",{value:!0}),r(e("./validation.cjs"),s)}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/manifest/index.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/manifest/validation.cjs",{"../array.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/array.cjs","../cronjob.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/cronjob.cjs","../entropy.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/entropy.cjs","../json-rpc.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/json-rpc.cjs","../snaps.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/snaps.cjs","../structs.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/structs.cjs","../types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/types.cjs","@metamask/key-tree":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/key-tree/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.createSnapManifest=s.assertIsSnapManifest=s.isSnapManifest=s.SnapManifestStruct=s.InitialConnectionsStruct=s.SnapAuxilaryFilesStruct=s.SnapAuxiliaryFilesStruct=s.PermissionsStruct=s.EmptyObjectStruct=s.HandlerCaveatsStruct=s.ProtocolScopesStruct=s.MaxRequestTimeStruct=s.MAXIMUM_REQUEST_TIMEOUT=s.MINIMUM_REQUEST_TIMEOUT=s.LookupMatchersStruct=s.ChainIdsStruct=s.SnapIdsStruct=s.SemVerRangeStruct=s.SnapGetBip32EntropyPermissionsStruct=s.Bip32EntropyStruct=s.CurveStruct=s.bip32entropy=s.Bip32PathStruct=s.FORBIDDEN_COIN_TYPES=void 0;const n=e("@metamask/key-tree"),r=e("@metamask/superstruct"),a=e("@metamask/utils"),o=e("../array.cjs"),i=e("../cronjob.cjs"),c=e("../entropy.cjs"),l=e("../json-rpc.cjs"),d=e("../snaps.cjs"),m=e("../structs.cjs"),u=e("../types.cjs"),p=[c.SIP_6_MAGIC_VALUE,c.STATE_ENCRYPTION_MAGIC_VALUE];s.FORBIDDEN_COIN_TYPES=[60];const h=s.FORBIDDEN_COIN_TYPES.map(e=>["m","44'",`${e}'`]);s.Bip32PathStruct=(0,r.refine)((0,r.array)((0,r.string)()),"BIP-32 path",e=>0===e.length?"Path must be a non-empty BIP-32 derivation path array":"m"!==e[0]?'Path must start with "m".':e.length<3?"Paths must have a length of at least three.":e.slice(1).some(e=>!(0,n.isValidBIP32PathSegment)(e))?"Path must be a valid BIP-32 derivation path array.":p.includes(e[1])?`The purpose "${e[1]}" is not allowed for entropy derivation.`:!h.some(t=>(0,o.isEqual)(e.slice(0,t.length),t))||`The path "${e.join("/")}" is not allowed for entropy derivation.`);s.bip32entropy=e=>(0,r.refine)(e,"BIP-32 entropy",e=>"ed25519"!==e.curve||!e.path.slice(1).some(e=>!e.endsWith("'"))||"Ed25519 does not support unhardened paths."),s.CurveStruct=(0,r.enums)(["ed25519","secp256k1","ed25519Bip32"]),s.Bip32EntropyStruct=(0,s.bip32entropy)((0,r.type)({path:s.Bip32PathStruct,curve:s.CurveStruct})),s.SnapGetBip32EntropyPermissionsStruct=(0,r.size)((0,r.array)(s.Bip32EntropyStruct),1,Infinity),s.SemVerRangeStruct=(0,r.refine)((0,r.string)(),"SemVer range",e=>!!(0,a.isValidSemVerRange)(e)||"Expected a valid SemVer range."),s.SnapIdsStruct=(0,r.refine)((0,r.record)(d.SnapIdStruct,(0,r.object)({version:(0,r.optional)(s.SemVerRangeStruct)})),"SnapIds",e=>0!==Object.keys(e).length),s.ChainIdsStruct=(0,r.size)((0,r.array)(a.CaipChainIdStruct),1,Infinity),s.LookupMatchersStruct=(0,r.union)([(0,r.object)({tlds:(0,r.size)((0,r.array)((0,r.string)()),1,Infinity)}),(0,r.object)({schemes:(0,r.size)((0,r.array)((0,r.string)()),1,Infinity)}),(0,r.object)({tlds:(0,r.size)((0,r.array)((0,r.string)()),1,Infinity),schemes:(0,r.size)((0,r.array)((0,r.string)()),1,Infinity)})]),s.MINIMUM_REQUEST_TIMEOUT=(0,a.inMilliseconds)(5,a.Duration.Second),s.MAXIMUM_REQUEST_TIMEOUT=(0,a.inMilliseconds)(3,a.Duration.Minute),s.MaxRequestTimeStruct=(0,r.size)((0,r.integer)(),s.MINIMUM_REQUEST_TIMEOUT,s.MAXIMUM_REQUEST_TIMEOUT),s.ProtocolScopesStruct=(0,r.record)(a.CaipChainIdStruct,(0,r.object)({methods:(0,r.array)((0,r.string)())})),s.HandlerCaveatsStruct=(0,r.object)({maxRequestTime:(0,r.optional)(s.MaxRequestTimeStruct)}),s.EmptyObjectStruct=(0,r.object)({}),s.PermissionsStruct=(0,r.type)({"endowment:assets":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,(0,r.object)({scopes:s.ChainIdsStruct}))),"endowment:cronjob":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,(0,r.object)({jobs:(0,r.optional)(i.CronjobSpecificationArrayStruct)}))),"endowment:ethereum-provider":(0,r.optional)(s.EmptyObjectStruct),"endowment:keyring":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,l.KeyringOriginsStruct)),"endowment:protocol":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,(0,r.object)({scopes:s.ProtocolScopesStruct}))),"endowment:lifecycle-hooks":(0,r.optional)(s.HandlerCaveatsStruct),"endowment:name-lookup":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,(0,r.object)({chains:(0,r.optional)(s.ChainIdsStruct),matchers:(0,r.optional)(s.LookupMatchersStruct)}))),"endowment:network-access":(0,r.optional)(s.EmptyObjectStruct),"endowment:page-home":(0,r.optional)(s.HandlerCaveatsStruct),"endowment:rpc":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,l.RpcOriginsStruct)),"endowment:signature-insight":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,(0,r.object)({allowSignatureOrigin:(0,r.optional)((0,r.boolean)())}))),"endowment:transaction-insight":(0,r.optional)((0,m.mergeStructs)(s.HandlerCaveatsStruct,(0,r.object)({allowTransactionOrigin:(0,r.optional)((0,r.boolean)())}))),"endowment:webassembly":(0,r.optional)(s.EmptyObjectStruct),snap_dialog:(0,r.optional)(s.EmptyObjectStruct),snap_manageState:(0,r.optional)(s.EmptyObjectStruct),snap_manageAccounts:(0,r.optional)(s.EmptyObjectStruct),snap_notify:(0,r.optional)(s.EmptyObjectStruct),snap_getBip32Entropy:(0,r.optional)(s.SnapGetBip32EntropyPermissionsStruct),snap_getBip32PublicKey:(0,r.optional)(s.SnapGetBip32EntropyPermissionsStruct),snap_getBip44Entropy:(0,r.optional)((0,r.size)((0,r.array)((0,r.object)({coinType:(0,r.size)((0,r.integer)(),0,2**32-1)})),1,Infinity)),snap_getEntropy:(0,r.optional)(s.EmptyObjectStruct),snap_getLocale:(0,r.optional)(s.EmptyObjectStruct),wallet_snap:(0,r.optional)(s.SnapIdsStruct)}),s.SnapAuxiliaryFilesStruct=(0,r.array)((0,r.string)()),s.SnapAuxilaryFilesStruct=s.SnapAuxiliaryFilesStruct,s.InitialConnectionsStruct=(0,r.record)((0,r.intersection)([(0,r.string)(),(0,u.uri)()]),(0,r.object)({})),s.SnapManifestStruct=(0,r.object)({version:a.VersionStruct,description:(0,r.size)((0,r.string)(),1,280),proposedName:(0,r.size)((0,r.string)(),1,214),repository:(0,r.optional)((0,r.type)({type:(0,r.size)((0,r.string)(),1,Infinity),url:(0,r.size)((0,r.string)(),1,Infinity)})),source:(0,r.object)({shasum:a.ChecksumStruct,location:(0,r.object)({npm:(0,r.object)({filePath:(0,r.size)((0,r.string)(),1,Infinity),iconPath:(0,r.optional)((0,r.size)((0,r.string)(),1,Infinity)),packageName:u.NameStruct,registry:(0,r.union)([(0,r.literal)("https://registry.npmjs.org"),(0,r.literal)("https://registry.npmjs.org/")])})}),files:(0,r.optional)(s.SnapAuxiliaryFilesStruct),locales:(0,r.optional)(s.SnapAuxiliaryFilesStruct)}),initialConnections:(0,r.optional)(s.InitialConnectionsStruct),initialPermissions:s.PermissionsStruct,manifestVersion:(0,r.literal)("0.1"),platformVersion:(0,r.optional)(a.VersionStruct),$schema:(0,r.optional)((0,r.string)())}),s.isSnapManifest=function(e){return(0,r.is)(e,s.SnapManifestStruct)},s.assertIsSnapManifest=function(e){(0,a.assertStruct)(e,s.SnapManifestStruct,`"${u.NpmSnapFileNames.Manifest}" is invalid`)},s.createSnapManifest=function(e){return(0,r.create)(e,s.SnapManifestStruct)}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/manifest/validation.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/path.cjs",{"@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.normalizeRelative=void 0;const n=e("@metamask/utils");s.normalizeRelative=function(e){return(0,n.assert)(!e.startsWith("/")),(0,n.assert)(-1===e.search(/:|\/\//u),`Path "${e}" potentially an URI instead of local relative`),e.startsWith("./")?e.slice(2):e}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/path.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/platform-version.cjs",{"@metamask/snaps-sdk/package.json":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/package.json"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.getPlatformVersion=void 0;const r=n(e("@metamask/snaps-sdk/package.json"));s.getPlatformVersion=function(){return r.default.version}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/platform-version.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/snaps.cjs",{"./caveats.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/caveats.cjs","./checksum.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/checksum.cjs","./types.cjs":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/types.cjs","@metamask/snaps-sdk":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/snaps-sdk/dist/index.cjs","@metamask/superstruct":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/superstruct/dist/index.cjs","@metamask/utils":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/utils/dist/index.cjs","@scure/base":"/home/runner/work/metamask-extension/metamask-extension/node_modules/@scure/base/lib/index.js","fast-json-stable-stringify":"/home/runner/work/metamask-extension/metamask-extension/node_modules/fast-json-stable-stringify/index.js","validate-npm-package-name":"/home/runner/work/metamask-extension/metamask-extension/node_modules/validate-npm-package-name/lib/index.js"},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){var n=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.verifyRequestedSnapPermissions=s.isSnapPermitted=s.assertIsValidSnapId=s.isSnapId=s.stripSnapPrefix=s.getSnapPrefix=s.SnapIdStruct=s.SnapIdPrefixStruct=s.HttpSnapIdStruct=s.NpmSnapIdStruct=s.LocalSnapIdStruct=s.BaseSnapIdStruct=s.LOCALHOST_HOSTNAMES=s.validateSnapShasum=s.getSnapChecksum=s.SnapStatusEvents=s.SnapStatus=s.PROPOSED_NAME_REGEX=void 0;const r=e("@metamask/snaps-sdk"),a=e("@metamask/superstruct"),o=e("@metamask/utils"),i=e("@scure/base"),c=n(e("fast-json-stable-stringify")),l=n(e("validate-npm-package-name")),d=e("./caveats.cjs"),m=e("./checksum.cjs"),u=e("./types.cjs");var p,h;function f(e){const t=e.clone();return delete t.result.source.shasum,t.value=(0,c.default)(t.result),t}async function g(e){const{manifest:t,sourceCode:s,svgIcon:n,auxiliaryFiles:r,localizationFiles:a}=e,o=[f(t),s,n,...r,...a].filter(e=>e!==undefined);return i.base64.encode(await(0,m.checksumFiles)(o))}s.PROPOSED_NAME_REGEX=/^(?:[A-Za-z0-9-_]+( [A-Za-z0-9-_]+)*)|(?:(?:@[A-Za-z0-9-*~][A-Za-z0-9-*._~]*\/)?[A-Za-z0-9-~][A-Za-z0-9-._~]*)$/u,function(e){e.Installing="installing",e.Updating="updating",e.Running="running",e.Stopped="stopped",e.Crashed="crashed"}(p||(s.SnapStatus=p={})),function(e){e.Start="START",e.Stop="STOP",e.Crash="CRASH",e.Update="UPDATE"}(h||(s.SnapStatusEvents=h={})),s.getSnapChecksum=g,s.validateSnapShasum=async function(e,t="Invalid Snap manifest: manifest shasum does not match computed shasum."){if(e.manifest.result.source.shasum!==await g(e))throw new Error(t)},s.LOCALHOST_HOSTNAMES=["localhost","127.0.0.1","[::1]"],s.BaseSnapIdStruct=(0,o.definePattern)("Base Snap Id",/^[\x21-\x7E]*$/u);const k=(0,u.uri)({protocol:(0,a.enums)(["http:","https:"]),hostname:(0,a.enums)(s.LOCALHOST_HOSTNAMES),hash:(0,a.empty)((0,a.string)()),search:(0,a.empty)((0,a.string)())});function w(e){const t=Object.values(u.SnapIdPrefixes).find(t=>e.startsWith(t));if(t!==undefined)return t;throw new Error(`Invalid or no prefix found for "${e}"`)}s.LocalSnapIdStruct=(0,a.refine)(s.BaseSnapIdStruct,"local Snap Id",e=>{if(!e.startsWith(u.SnapIdPrefixes.local))return`Expected local snap ID, got "${e}".`;const[t]=(0,a.validate)(e.slice(u.SnapIdPrefixes.local.length),k);return t??!0}),s.NpmSnapIdStruct=(0,a.intersection)([s.BaseSnapIdStruct,(0,u.uri)({protocol:(0,a.literal)(u.SnapIdPrefixes.npm),pathname:(0,a.refine)((0,a.string)(),"package name",function*(e){const t=e.startsWith("/")?e.slice(1):e,{errors:s,validForNewPackages:n,warnings:r}=(0,l.default)(t);return n||(s===undefined?((0,o.assert)(r!==undefined),yield*r):yield*s),!0}),search:(0,a.empty)((0,a.string)()),hash:(0,a.empty)((0,a.string)())})]),s.HttpSnapIdStruct=(0,a.intersection)([s.BaseSnapIdStruct,(0,u.uri)({protocol:(0,a.enums)(["http:","https:"]),search:(0,a.empty)((0,a.string)()),hash:(0,a.empty)((0,a.string)())})]),s.SnapIdPrefixStruct=(0,a.refine)((0,a.string)(),"Snap ID prefix",e=>{if(Object.values(u.SnapIdPrefixes).some(t=>e.startsWith(t)))return!0;return`Invalid or no prefix found. Expected Snap ID to start with one of: ${Object.values(u.SnapIdPrefixes).map(e=>`"${e}"`).join(", ")}, but received: "${e}"`}),s.SnapIdStruct=(0,r.selectiveUnion)(e=>"string"==typeof e&&e.startsWith(u.SnapIdPrefixes.npm)?s.NpmSnapIdStruct:"string"==typeof e&&e.startsWith(u.SnapIdPrefixes.local)?s.LocalSnapIdStruct:s.SnapIdPrefixStruct),s.getSnapPrefix=w,s.stripSnapPrefix=function(e){return e.replace(w(e),"")},s.isSnapId=function(e){return(0,a.is)(e,s.SnapIdStruct)},s.assertIsValidSnapId=function(e){(0,o.assertStruct)(e,s.SnapIdStruct,"Invalid snap ID")},s.isSnapPermitted=function(e,t){var s,n;return Boolean(null===(s=((null==e||null===(n=e.wallet_snap)||void 0===n||null===(n=n.caveats)||void 0===n?void 0:n.find(e=>e.type===d.SnapCaveatType.SnapIds))??{}).value)||void 0===s?void 0:s[t])},s.verifyRequestedSnapPermissions=function(e){(0,o.assert)((0,o.isObject)(e),"Requested permissions must be an object.");const{wallet_snap:t}=e;(0,o.assert)((0,o.isObject)(t),"wallet_snap is missing from the requested permissions.");const{caveats:s}=t;(0,o.assert)(Array.isArray(s)&&1===s.length,"wallet_snap must have a caveat property with a single-item array value.");const[n]=s;(0,o.assert)((0,o.isObject)(n)&&n.type===d.SnapCaveatType.SnapIds&&(0,o.isObject)(n.value),`The requested permissions do not have a valid ${d.SnapCaveatType.SnapIds} caveat.`)}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/snaps.cjs"}],["/home/runner/work/metamask-extension/metamask-extension/node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/strings.cjs",{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.indent=void 0,s.indent=function(e,t=2){return e.replace(/^/gmu," ".repeat(t))}}}},{package:"@metamask/gator-permissions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/gator-permissions-controller/node_modules/@metamask/snaps-utils/dist/strings.cjs"}]],[],{});