{
  "snapId": "npm:@metamask/preinstalled-example-snap",
  "manifest": {
    "version": "0.8.1",
    "description": "MetaMask example snap demonstrating preinstalled Snaps.",
    "proposedName": "Preinstalled Example Snap",
    "repository": {
      "type": "git",
      "url": "https://github.com/MetaMask/snaps.git"
    },
    "source": {
      "shasum": "NFAEoPMpWTYUKmBjRZ/wrHAfGsb512DI0BTyNhgVzkA=",
      "location": {
        "npm": {
          "filePath": "dist/bundle.js",
          "packageName": "@metamask/preinstalled-example-snap",
          "registry": "https://registry.npmjs.org/"
        }
      }
    },
    "initialConnections": {
      "https://metamask.github.io": {}
    },
    "initialPermissions": {
      "endowment:rpc": {
        "dapps": true
      },
      "snap_dialog": {},
      "endowment:page-settings": {},
      "snap_manageState": {},
      "endowment:messenger": {
        "actions": [
          "PhishingController:testOrigin"
        ]
      }
    },
    "platformVersion": "11.2.0",
    "manifestVersion": "0.1"
  },
  "files": [
    {
      "path": "dist/bundle.js",
      "value": "(()=>{var e={836:e=>{e.exports=s,s.default=s,s.stable=d,s.stableStringify=d;var t=\"[...]\",n=\"[Circular]\",r=[],a=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,n,s){var i;void 0===s&&(s=o()),c(e,\"\",0,[],void 0,0,s);try{i=0===a.length?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return i}function i(e,t,n,o){var s=Object.getOwnPropertyDescriptor(o,n);void 0!==s.get?s.configurable?(Object.defineProperty(o,n,{value:e}),r.push([o,n,t,s])):a.push([t,n,e]):(o[n]=e,r.push([o,n,t]))}function c(e,r,a,o,s,u,d){var l;if(u+=1,\"object\"==typeof e&&null!==e){for(l=0;l<o.length;l++)if(o[l]===e)return void i(n,e,r,s);if(void 0!==d.depthLimit&&u>d.depthLimit)return void i(t,e,r,s);if(void 0!==d.edgesLimit&&a+1>d.edgesLimit)return void i(t,e,r,s);if(o.push(e),Array.isArray(e))for(l=0;l<e.length;l++)c(e[l],l,l,o,e,u,d);else{var p=Object.keys(e);for(l=0;l<p.length;l++){var f=p[l];c(e[f],f,l,o,e,u,d)}}o.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function d(e,t,n,s){void 0===s&&(s=o());var i,c=l(e,\"\",0,[],void 0,0,s)||e;try{i=0===a.length?JSON.stringify(c,t,n):JSON.stringify(c,p(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return i}function l(e,a,o,s,c,d,p){var f;if(d+=1,\"object\"==typeof e&&null!==e){for(f=0;f<s.length;f++)if(s[f]===e)return void i(n,e,a,c);try{if(\"function\"==typeof e.toJSON)return}catch(e){return}if(void 0!==p.depthLimit&&d>p.depthLimit)return void i(t,e,a,c);if(void 0!==p.edgesLimit&&o+1>p.edgesLimit)return void i(t,e,a,c);if(s.push(e),Array.isArray(e))for(f=0;f<e.length;f++)l(e[f],f,f,s,e,d,p);else{var m={},h=Object.keys(e).sort(u);for(f=0;f<h.length;f++){var y=h[f];l(e[y],y,f,s,e,d,p),m[y]=e[y]}if(void 0===c)return m;r.push([c,a,e]),c[a]=m}s.pop()}}function p(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(a.length>0)for(var r=0;r<a.length;r++){var o=a[r];if(o[1]===t&&o[0]===n){n=o[2],a.splice(r,1);break}}return e.call(this,t,n)}}}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var r={};(()=>{\"use strict\";function e(e,t,n){if(\"string\"==typeof e)throw new Error(`An HTML element (\"${String(e)}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error(\"A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.\");return e({...t,key:n})}function t(t,n,r){return e(t,n,r)}n.r(r),n.d(r,{onRpcRequest:()=>St,onSettingsPage:()=>wt,onUserInput:()=>At});class a extends TypeError{constructor(e,t){let n;const{message:r,explanation:a,...o}=e,{path:s}=e,i=0===s.length?r:`At path: ${s.join(\".\")} -- ${r}`;super(a??i),null!=a&&(this.cause=i),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function o(e){return\"object\"==typeof e&&null!==e}function s(e){return\"symbol\"==typeof e?e.toString():\"string\"==typeof e?JSON.stringify(e):`${e}`}function i(e,t,n,r){if(!0===e)return;!1===e?e={}:\"string\"==typeof e&&(e={message:e});const{path:a,branch:o}=t,{type:i}=n,{refinement:c,message:u=`Expected a value of type \\`${i}\\`${c?` with refinement \\`${c}\\``:\"\"}, but received: \\`${s(r)}\\``}=e;return{value:r,type:i,refinement:c,key:a[a.length-1],path:a,branch:o,...e,message:u}}function*c(e,t,n,r){(function(e){return o(e)&&\"function\"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const a of e){const e=i(a,t,n,r);e&&(yield e)}}function*u(e,t,n={}){const{path:r=[],branch:a=[e],coerce:s=!1,mask:i=!1}=n,c={path:r,branch:a};if(s&&(e=t.coercer(e,c),i&&\"type\"!==t.type&&o(t.schema)&&o(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let d=\"valid\";for(const r of t.validator(e,c))r.explanation=n.message,d=\"not_valid\",yield[r,void 0];for(let[l,p,f]of t.entries(e,c)){const t=u(p,f,{path:void 0===l?r:[...r,l],branch:void 0===l?a:[...a,p],coerce:s,mask:i,message:n.message});for(const n of t)n[0]?(d=null===n[0].refinement||void 0===n[0].refinement?\"not_valid\":\"not_refined\",yield[n[0],void 0]):s&&(p=n[1],void 0===l?e=p:e instanceof Map?e.set(l,p):e instanceof Set?e.add(p):o(e)&&(void 0!==p||l in e)&&(e[l]=p))}if(\"not_valid\"!==d)for(const r of t.refiner(e,c))r.explanation=n.message,d=\"not_refined\",yield[r,void 0];\"valid\"===d&&(yield[void 0,e])}class d{constructor(e){const{type:t,schema:n,validator:r,refiner:a,coercer:o=e=>e,entries:s=function*(){}}=e;this.type=t,this.schema=n,this.entries=s,this.coercer=o,this.validator=r?(e,t)=>c(r(e,t),t,this,e):()=>[],this.refiner=a?(e,t)=>c(a(e,t),t,this,e):()=>[]}assert(e,t){return function(e,t,n){const r=h(e,t,{message:n});if(r[0])throw r[0]}(e,this,t)}create(e,t){return f(e,this,t)}is(e){return m(e,this)}mask(e,t){return function(e,t,n){const r=h(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}validate(e,t={}){return h(e,this,t)}}const l=\"EXACT_OPTIONAL\";class p extends d{constructor(e){super({...e,type:`exact optional ${e.type}`}),this.brand=l}static isExactOptional(e){return o(e)&&\"brand\"in e&&e.brand===l}}function f(e,t,n){const r=h(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function m(e,t){return!h(e,t)[0]}function h(e,t,n={}){const r=u(e,t,n),o=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(o[0]){return[new a(o[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function y(...e){const t=\"type\"===e[0]?.type,n=e.map((({schema:e})=>e)),r=Object.assign({},...n);return t?function(e){const t=Object.keys(e);return new d({type:\"type\",schema:e,*entries(n){if(o(n))for(const r of t)p.isExactOptional(e[r])&&!Object.prototype.hasOwnProperty.call(n,r)||(yield[r,n[r],e[r]])},validator:e=>o(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>o(e)?{...e}:e})}(r):A(r)}function g(e,t){return new d({type:e,schema:null,validator:t})}function v(e){return new d({type:\"array\",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${s(e)}`})}function b(){return g(\"boolean\",(e=>\"boolean\"==typeof e))}function E(e){const t=s(e),n=typeof e;return new d({type:\"literal\",schema:\"string\"===n||\"number\"===n||\"boolean\"===n?e:null,validator:n=>n===e||`Expected the literal \\`${t}\\`, but received: ${s(n)}`})}function O(){return g(\"never\",(()=>!1))}function S(e){return new d({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function w(){return g(\"number\",(e=>\"number\"==typeof e&&!isNaN(e)||`Expected a number, but received: ${s(e)}`))}function A(e){const t=e?Object.keys(e):[],n=O();return new d({type:\"object\",schema:e??null,*entries(r){if(e&&o(r)){const a=new Set(Object.keys(r));for(const n of t){a.delete(n);const t=e[n];p.isExactOptional(t)&&!Object.prototype.hasOwnProperty.call(r,n)||(yield[n,r[n],e[n]])}for(const e of a)yield[e,r[e],n]}},validator:e=>o(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>o(e)?{...e}:e})}function j(e){return new d({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function N(e,t){return new d({type:\"record\",schema:null,*entries(n){if(o(n))for(const r in n){const a=n[r];yield[r,r,e],yield[r,a,t]}},validator:e=>o(e)||`Expected an object, but received: ${s(e)}`})}function k(){return g(\"string\",(e=>\"string\"==typeof e||`Expected a string, but received: ${s(e)}`))}function I(e){const t=e.map((e=>e.type)).join(\" | \");return new d({type:\"union\",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){const a=[];for(const t of e){const[...e]=u(n,t,r),[o]=e;if(!o?.[0])return[];for(const[t]of e)t&&a.push(t)}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${s(n)}`,...a]}})}function x(e,t,n){return new d({...e,coercer:(r,a)=>m(r,t)?e.coercer(n(r,a),a):e.coercer(r,a)})}function C(e,t,n){return new d({...e,*refiner(r,a){yield*e.refiner(r,a);const o=c(n(r,a),a,e,r);for(const e of o)yield{...e,refinement:t}}})}function T(e){return Boolean(e)&&\"object\"==typeof e&&!Array.isArray(e)}const P=(e,t)=>Object.hasOwnProperty.call(e,t);var _;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(_=_||(_={}));const z=e=>A(e);function $({path:e,branch:t}){const n=e[e.length-1];return P(t[t.length-2],n)}function R(e){return new d({...e,type:`optional ${e.type}`,validator:(t,n)=>!$(n)||e.validator(t,n),refiner:(t,n)=>!$(n)||e.refiner(t,n)})}function J(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!J(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!J(n[e][1])){t=!1;break}return t}return!1}const q=g(\"JSON\",(e=>J(e))),F=x(q,C(g(\"any\",(()=>!0)),\"JSON\",(e=>m(e,q))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})))));function Z(e){try{return function(e){f(e,F)}(e),!0}catch{return!1}}const L=E(\"2.0\"),M=S(I([w(),k()])),U=z({code:g(\"integer\",(e=>\"number\"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${s(e)}`)),message:k(),data:R(F),stack:R(k())}),D=I([N(k(),F),v(F)]);z({id:M,jsonrpc:L,method:k(),params:R(D)}),z({jsonrpc:L,method:k(),params:R(D)});A({id:M,jsonrpc:L,result:j(g(\"unknown\",(()=>!0))),error:j(U)});const B=z({id:M,jsonrpc:L,result:F}),X=z({id:M,jsonrpc:L,error:U});I([B,X]);function G(e,t,n=null){return T(e)&&P(e,t)?e[t]:n}function W(e,t,n=String(e)){const r=G(e,t);return\"string\"==typeof r?r:n}function H(e){return W(e,\"message\")}function Q(e){return W(e,\"stack\",null)}function K(e){return W(e,\"name\",e instanceof Error?e.name:\"Error\")}function V(e){const t=G(e,\"data\");return null!==t&&Z(t)&&!Array.isArray(t)?t:{}}class Y extends Error{#e;#t;#n;#r;constructor(e,t={}){const n=H(e);super(n),this.#t=n,this.#e=function(e){const t=G(e,\"code\");return\"number\"==typeof t&&Number.isInteger(t)?t:-32603}(e);const r={...V(e),...t};Object.keys(r).length>0&&(this.#n=r),this.#r=super.stack}get name(){return\"SnapError\"}get code(){return this.#e}get message(){return this.#t}get data(){return this.#n}get stack(){return this.#r}toJSON(){return{code:-31002,message:\"Snap Error\",data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function ee(e){if(\"string\"==typeof e)return{name:\"Error\",message:e,stack:null,cause:null};if(m(e,U))return{name:\"JsonRpcError\",message:H(e),stack:Q(e)??Q(e.data)??null,cause:null};const t=function(e){return G(e,\"cause\")}(e);return{name:K(e),message:H(e),stack:Q(e)??null,cause:null===t?null:ee(t)}}var te=n(836);const ne={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},re={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},ae={\"-32700\":{standard:\"JSON RPC 2.0\",message:\"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.\"},\"-32600\":{standard:\"JSON RPC 2.0\",message:\"The JSON sent is not a valid Request object.\"},\"-32601\":{standard:\"JSON RPC 2.0\",message:\"The method does not exist / is not available.\"},\"-32602\":{standard:\"JSON RPC 2.0\",message:\"Invalid method parameter(s).\"},\"-32603\":{standard:\"JSON RPC 2.0\",message:\"Internal JSON-RPC error.\"},\"-32000\":{standard:\"EIP-1474\",message:\"Invalid input.\"},\"-32001\":{standard:\"EIP-1474\",message:\"Resource not found.\"},\"-32002\":{standard:\"EIP-1474\",message:\"Resource unavailable.\"},\"-32003\":{standard:\"EIP-1474\",message:\"Transaction rejected.\"},\"-32004\":{standard:\"EIP-1474\",message:\"Method not supported.\"},\"-32005\":{standard:\"EIP-1474\",message:\"Request limit exceeded.\"},4001:{standard:\"EIP-1193\",message:\"User rejected the request.\"},4100:{standard:\"EIP-1193\",message:\"The requested account and/or method has not been authorized by the user.\"},4200:{standard:\"EIP-1193\",message:\"The requested method is not supported by this Ethereum provider.\"},4900:{standard:\"EIP-1193\",message:\"The provider is disconnected from all chains.\"},4901:{standard:\"EIP-1193\",message:\"The provider is disconnected from the specified chain.\"}},oe=ne.internal,se=(ie(oe),\"Unspecified server error.\");function ie(e,t=\"Unspecified error message. This is a bug, please report it.\"){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(P(ae,t))return ae[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return se}return t}function ce(e){return Array.isArray(e)?e.map((e=>Z(e)?e:T(e)?ue(e):null)):T(e)?ue(e):Z(e)?e:null}function ue(e){return Object.getOwnPropertyNames(e).reduce(((t,n)=>{const r=e[n];return Z(r)&&(t[n]=r),t}),{})}const de=function(e){return e?.__esModule?e.default:e}(te);class le extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('\"code\" must be an integer.');if(!t||\"string\"!=typeof t)throw new Error('\"message\" must be a non-empty string.');!function(e){return T(e)&&P(e,\"cause\")&&T(e.cause)}(n)?super(t):(super(t,{cause:n.cause}),P(this,\"cause\")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if(\"object\"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=ce(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return de(this.serialize(),fe,2)}}class pe extends le{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('\"code\" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}function fe(e,t){if(\"[Circular]\"!==t)return t}const me=e=>xe(ne.parse,e),he=e=>xe(ne.invalidRequest,e),ye=e=>xe(ne.invalidParams,e),ge=e=>xe(ne.methodNotFound,e),ve=e=>xe(ne.invalidInput,e),be=e=>xe(ne.resourceNotFound,e),Ee=e=>xe(ne.resourceUnavailable,e),Oe=e=>xe(ne.transactionRejected,e),Se=e=>xe(ne.methodNotSupported,e),we=e=>xe(ne.limitExceeded,e),Ae=e=>Ce(re.userRejectedRequest,e),je=e=>Ce(re.unauthorized,e),Ne=e=>Ce(re.unsupportedMethod,e),ke=e=>Ce(re.disconnected,e),Ie=e=>Ce(re.chainDisconnected,e);function xe(e,t){const[n,r]=Te(t);return new le(e,n??ie(e),r)}function Ce(e,t){const[n,r]=Te(t);return new pe(e,n??ie(e),r)}function Te(e){if(e){if(\"string\"==typeof e)return[e];if(\"object\"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&\"string\"!=typeof t)throw new Error(\"Must specify string message.\");return[t??void 0,n]}}return[]}function Pe(e){return class extends Y{constructor(t,n){if(\"object\"==typeof t){const n=e();return void super({code:n.code,message:n.message,data:t})}const r=e(t);super({code:r.code,message:r.message,data:n})}}}Pe((e=>xe(ne.internal,e))),Pe(ve),Pe(ye),Pe(he),Pe(we);const _e=Pe(ge);Pe(Se),Pe(me),Pe(be),Pe(Ee),Pe(Oe),Pe(Ie),Pe(ke),Pe(je),Pe(Ne),Pe(Ae);function ze(e,t){return g(e,(e=>\"string\"==typeof e&&t.test(e)))}const $e=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,Re=/^[-a-z0-9]{3,8}$/u,Je=/^[-_a-zA-Z0-9]{1,32}$/u,qe=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,Fe=/^[-.%a-zA-Z0-9]{1,128}$/u,Ze=/^[-a-z0-9]{3,8}$/u,Le=/^[-.%a-zA-Z0-9]{1,128}$/u,Me=/^[-.%a-zA-Z0-9]{1,78}$/u,Ue=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,De=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u,Be=(ze(\"CaipChainId\",$e),ze(\"CaipNamespace\",Re),ze(\"CaipReference\",Je),ze(\"CaipAccountId\",qe)),Xe=(ze(\"CaipAccountAddress\",Fe),ze(\"CaipAssetNamespace\",Ze),ze(\"CaipAssetReference\",Le),ze(\"CaipTokenId\",Me),ze(\"CaipAssetType\",Ue));ze(\"CaipAssetId\",De),ze(\"CaipAssetTypeOrId\",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u);var Ge,We;function He(e){return g(JSON.stringify(e),E(e).validator)}!function(e){e.Bip122=\"bip122\",e.Solana=\"solana\",e.Stellar=\"stellar\",e.Tron=\"tron\",e.Eip155=\"eip155\",e.Wallet=\"wallet\"}(Ge=Ge||(Ge={})),function(e){e.ButtonClickEvent=\"ButtonClickEvent\",e.FormSubmitEvent=\"FormSubmitEvent\",e.InputChangeEvent=\"InputChangeEvent\",e.FileUploadEvent=\"FileUploadEvent\"}(We||(We={}));const Qe=A({type:k(),name:j(k())}),Ke=y(Qe,A({type:He(We.ButtonClickEvent),name:j(k())})),Ve=A({accountId:k(),addresses:v(Be)}),Ye=A({name:k(),size:w(),contentType:k(),contents:k()}),et=A({asset:Xe,name:k(),symbol:k()});!function(e){const t=e.map((e=>\"union\"===e.type&&Array.isArray(e.schema)?e.schema:e)).flat(1/0),n=t.map((({schema:e})=>e.type.type)),r=t.reduce(((e,t)=>(e[JSON.parse(t.schema.type.type)]=t,e)),{});new d({type:\"union\",schema:t,*entries(e,t){if(!T(e)||!P(e,\"type\")||\"string\"!=typeof e.type)return;const{type:n}=e,a=r[n];if(a)for(const n of a.entries(e,t))yield n},coercer(e,t){if(!T(e)||!P(e,\"type\")||\"string\"!=typeof e.type)return e;const{type:n}=e,a=r[n];return a?a.coercer(e,t):e},*refiner(e,t){const n=r[e.type];yield*n.refiner(e,t)},validator(e,t){if(!T(e)||!P(e,\"type\")||\"string\"!=typeof e.type)return`Expected type to be one of: ${n.join(\", \")}, but received: undefined`;const{type:a}=e,o=r[a];return o?o.validator(e,t):`Expected type to be one of: ${n.join(\", \")}, but received: \"${a}\"`}})}([Ke,y(Qe,A({type:He(We.FormSubmitEvent),value:N(k(),S(I([k(),Ye,b(),Ve,et]))),name:k()})),y(Qe,A({type:He(We.InputChangeEvent),name:k(),value:S(I([k(),b(),Ve,et]))})),y(Qe,A({type:He(We.FileUploadEvent),name:k(),file:S(Ye)}))]);function tt(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function nt(e){return t=>{const{key:n=null,...r}=t;return{type:e,props:tt(r),key:n}}}const rt=nt(\"Container\"),at=nt(\"Box\"),ot=nt(\"Heading\"),st=nt(\"Text\"),it=nt(\"Form\"),ct=nt(\"Field\"),ut=nt(\"Input\"),dt=nt(\"Footer\"),lt=nt(\"Button\"),pt=()=>t(rt,{children:[t(at,{children:[e(ot,{children:\"Custom Dialog\"}),e(st,{children:\"This is a custom dialog. It has a custom footer and can be resolved to any value.\"}),e(it,{name:\"form\",children:e(ct,{label:\"Field\",children:e(ut,{name:\"custom-input\",placeholder:\"Enter something...\"})})})]}),t(dt,{children:[e(lt,{name:\"cancel\",children:\"Cancel\"}),e(lt,{name:\"confirm\",type:\"submit\",form:\"form\",children:\"Confirm\"})]})]}),ft=nt(\"Section\"),mt=nt(\"Checkbox\"),ht=nt(\"RadioGroup\"),yt=nt(\"Radio\"),gt=nt(\"Dropdown\"),vt=nt(\"Option\"),bt=({setting1:n,setting2:r,setting3:a})=>t(at,{children:[t(ft,{children:[e(st,{children:\"Setting 1\"}),e(st,{color:\"alternative\",children:\"This is the first setting\"}),e(mt,{name:\"setting1\",variant:\"toggle\",checked:n})]}),t(ft,{children:[e(st,{children:\"Setting 2\"}),e(st,{color:\"alternative\",children:\"This is the second setting\"}),t(ht,{name:\"setting2\",value:r,children:[e(yt,{value:\"option1\",children:\"Option 1\"}),e(yt,{value:\"option2\",children:\"Option 2\"})]})]}),t(ft,{children:[e(st,{children:\"Setting 3\"}),e(st,{color:\"alternative\",children:\"This is the third setting\"}),t(gt,{name:\"setting3\",value:a,children:[e(vt,{value:\"option1\",children:\"Option 1\"}),e(vt,{value:\"option2\",children:\"Option 2\"})]})]})]}),Et=nt(\"Copyable\"),Ot=({value:n})=>t(rt,{children:[t(at,{children:[e(ot,{children:\"Custom Dialog\"}),e(st,{children:\"The form was submitted with the following value:\"}),e(Et,{value:n})]}),e(dt,{children:e(lt,{name:\"ok\",children:\"Ok\"})})]}),St=async({request:t})=>{switch(t.method){case\"showDialog\":return await snap.request({method:\"snap_dialog\",params:{content:e(pt,{})}});case\"getSettings\":return await snap.request({method:\"snap_manageState\",params:{operation:\"get\",encrypted:!1}});case\"trackError\":{const e=new Error(\"This is a test error.\");return e.name=\"TestError\",await snap.request({method:\"snap_trackError\",params:{error:ee(e)}})}case\"trackEvent\":return await snap.request({method:\"snap_trackEvent\",params:{event:{event:\"Test Event\",properties:{test_property:\"test value\"}}}});case\"startTrace\":return await snap.request({method:\"snap_startTrace\",params:{name:\"Test Snap Trace\"}});case\"endTrace\":return await snap.request({method:\"snap_endTrace\",params:{name:\"Test Snap Trace\"}});case\"messengerCall\":{const e={call:async(e,...t)=>snap.request({method:\"snap_messengerCall\",params:{action:e,params:t}})},{result:t}=await e.call(\"PhishingController:testOrigin\",\"https://metamask.io\");return t}default:throw new _e({method:t.method})}},wt=async()=>{const t=await snap.request({method:\"snap_manageState\",params:{operation:\"get\",encrypted:!1}});return{content:e(bt,{setting1:t?.setting1,setting2:t?.setting2,setting3:t?.setting3})}},At=async({event:t,id:n,context:r})=>{if(t.type===We.ButtonClickEvent&&(\"cancel\"===t.name&&await snap.request({method:\"snap_resolveInterface\",params:{id:n,value:null}}),\"ok\"===t.name&&await snap.request({method:\"snap_resolveInterface\",params:{id:n,value:String(r?.value)}})),t.type===We.FormSubmitEvent&&\"form\"===t.name){const r=String(t.value[\"custom-input\"]);await snap.request({method:\"snap_updateInterface\",params:{id:n,ui:e(Ot,{value:r}),context:{value:r}}})}t.type!==We.InputChangeEvent||\"setting1\"!==t.name&&\"setting2\"!==t.name&&\"setting3\"!==t.name||await snap.request({method:\"snap_setState\",params:{encrypted:!1,key:t.name,value:t.value}})}})(),module.exports=r})();"
    }
  ],
  "hideSnapBranding": true,
  "hidden": true,
  "removable": false
}