{"dependencies":[{"name":"@babel/runtime/helpers/slicedToArray","data":{"asyncType":null,"isESMImport":false,"locs":[],"key":"5y7e5+zC7teYEEC6niD9f5zII1M=","exportNames":["*"],"imports":1}},{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":15,"index":203},"end":{"line":6,"column":40,"index":228}}],"key":"u0mzEw2nilnHoUWtEdZl0JKHutA=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n var _slicedToArray = require(_dependencyMap[0], \"@babel/runtime/helpers/slicedToArray\").default;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.decodeU8a = decodeU8a;\n exports.decodeU8aStruct = decodeU8aStruct;\n exports.decodeU8aVec = decodeU8aVec;\n var util_1 = require(_dependencyMap[1], \"@polkadot/util\");\n var MAX_DEPTH = 1024;\n /** @internal */\n function isComplexType(Type) {\n var typeName = Type.name?.toLowerCase() || '';\n return ['enum', 'hashmap', 'linkage', 'null', 'option', 'range', 'rangeinclusive', 'result', 'struct', 'tuple', 'vec', 'vecfixed'].includes(typeName);\n }\n /** @internal */\n function formatFailure(registry, fn, _result, _ref, u8a, i, count, Type, key) {\n var message = _ref.message;\n var type = '';\n try {\n type = `: ${new Type(registry).toRawType()}`;\n } catch {\n // ignore\n }\n // This is extra debugging info (we most-probably want this in in some way, shape or form,\n // but at this point not quite sure how to include and format it (it can be quite massive)\n // console.error(JSON.stringify(result, null, 2));\n return `${fn}: failed at ${(0, util_1.u8aToHex)(u8a.subarray(0, 16))}…${key ? ` on ${key}` : ''} (index ${i + 1}/${count})${type}:: ${message}`;\n }\n /**\n * @internal\n *\n * Given an u8a, and an array of Type constructors, decode the u8a against the\n * types, and return an array of decoded values.\n *\n * @param u8a - The u8a to decode.\n * @param result - The result array (will be returned with values pushed)\n * @param types - The array of CodecClass to decode the U8a against.\n */\n function decodeU8a(registry, result, u8a, _ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n Types = _ref3[0],\n keys = _ref3[1];\n var count = result.length;\n var offset = 0;\n var i = 0;\n try {\n while (i < count) {\n var value = new Types[i](registry, u8a.subarray(offset));\n offset += value.initialU8aLength || value.encodedLength;\n result[i] = value;\n i++;\n }\n } catch (error) {\n throw new Error(formatFailure(registry, 'decodeU8a', result, error, u8a.subarray(offset), i, count, Types[i], keys[i]));\n }\n return [result, offset];\n }\n /**\n * @internal\n *\n * Split from decodeU8a since this is specialized to zip returns ... while we duplicate, this\n * is all on the hot-path, so it is not great, however there is (some) method behind the madness\n */\n function decodeU8aStruct(registry, result, u8a, _ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n Types = _ref5[0],\n keys = _ref5[1];\n var count = result.length;\n var offset = 0;\n var i = 0;\n if (count > MAX_DEPTH && isComplexType(Types[i])) {\n throw new Error(`decodeU8aStruct: Maximum depth exceeded, received ${count} elements, limit ${MAX_DEPTH}`);\n }\n try {\n while (i < count) {\n var value = new Types[i](registry, u8a.subarray(offset));\n offset += value.initialU8aLength || value.encodedLength;\n result[i] = [keys[i], value];\n i++;\n }\n } catch (error) {\n throw new Error(formatFailure(registry, 'decodeU8aStruct', result, error, u8a.subarray(offset), i, count, Types[i], keys[i]));\n }\n return [result, offset];\n }\n /**\n * @internal\n *\n * Split from decodeU8a since this is specialized to 1 instance ... while we duplicate, this\n * is all on the hot-path, so it is not great, however there is (some) method behind the madness\n */\n function decodeU8aVec(registry, result, u8a, startAt, Type) {\n var count = result.length;\n if (count > MAX_DEPTH && isComplexType(Type)) {\n throw new Error(`decodeU8aVec: Maximum depth exceeded, received ${count} elements, limit ${MAX_DEPTH}`);\n }\n var offset = startAt;\n var i = 0;\n try {\n while (i < count) {\n var value = new Type(registry, u8a.subarray(offset));\n offset += value.initialU8aLength || value.encodedLength;\n result[i] = value;\n i++;\n }\n } catch (error) {\n throw new Error(formatFailure(registry, 'decodeU8aVec', result, error, u8a.subarray(offset), i, count, Type));\n }\n return [offset, offset - startAt];\n }\n});","lineCount":114,"map":[[2,2,1,0],[2,14,1,12],[4,2,1,13],[4,6,1,13,"_slicedToArray"],[4,20,1,13],[4,23,1,13,"require"],[4,30,1,13],[4,31,1,13,"_dependencyMap"],[4,45,1,13],[4,90,1,13,"default"],[4,97,1,13],[5,2,2,0,"Object"],[5,8,2,6],[5,9,2,7,"defineProperty"],[5,23,2,21],[5,24,2,22,"exports"],[5,31,2,29],[5,33,2,31],[5,45,2,43],[5,47,2,45],[6,4,2,47,"value"],[6,9,2,52],[6,11,2,54],[7,2,2,59],[7,3,2,60],[7,4,2,61],[8,2,3,0,"exports"],[8,9,3,7],[8,10,3,8,"decodeU8a"],[8,19,3,17],[8,22,3,20,"decodeU8a"],[8,31,3,29],[9,2,4,0,"exports"],[9,9,4,7],[9,10,4,8,"decodeU8aStruct"],[9,25,4,23],[9,28,4,26,"decodeU8aStruct"],[9,43,4,41],[10,2,5,0,"exports"],[10,9,5,7],[10,10,5,8,"decodeU8aVec"],[10,22,5,20],[10,25,5,23,"decodeU8aVec"],[10,37,5,35],[11,2,6,0],[11,6,6,6,"util_1"],[11,12,6,12],[11,15,6,15,"require"],[11,22,6,22],[11,23,6,22,"_dependencyMap"],[11,37,6,22],[11,58,6,39],[11,59,6,40],[12,2,7,0],[12,6,7,6,"MAX_DEPTH"],[12,15,7,15],[12,18,7,18],[12,22,7,22],[13,2,8,0],[14,2,9,0],[14,11,9,9,"isComplexType"],[14,24,9,22,"isComplexType"],[14,25,9,23,"Type"],[14,29,9,27],[14,31,9,29],[15,4,10,4],[15,8,10,10,"typeName"],[15,16,10,18],[15,19,10,21,"Type"],[15,23,10,25],[15,24,10,26,"name"],[15,28,10,30],[15,30,10,32,"toLowerCase"],[15,41,10,43],[15,42,10,44],[15,43,10,45],[15,47,10,49],[15,49,10,51],[16,4,11,4],[16,11,11,11],[16,12,11,12],[16,18,11,18],[16,20,11,20],[16,29,11,29],[16,31,11,31],[16,40,11,40],[16,42,11,42],[16,48,11,48],[16,50,11,50],[16,58,11,58],[16,60,11,60],[16,67,11,67],[16,69,11,69],[16,85,11,85],[16,87,11,87],[16,95,11,95],[16,97,11,97],[16,105,11,105],[16,107,11,107],[16,114,11,114],[16,116,11,116],[16,121,11,121],[16,123,11,123],[16,133,11,133],[16,134,11,134],[16,135,11,135,"includes"],[16,143,11,143],[16,144,11,144,"typeName"],[16,152,11,152],[16,153,11,153],[17,2,12,0],[18,2,13,0],[19,2,14,0],[19,11,14,9,"formatFailure"],[19,24,14,22,"formatFailure"],[19,25,14,23,"registry"],[19,33,14,31],[19,35,14,33,"fn"],[19,37,14,35],[19,39,14,37,"_result"],[19,46,14,44],[19,48,14,44,"_ref"],[19,52,14,44],[19,54,14,59,"u8a"],[19,57,14,62],[19,59,14,64,"i"],[19,60,14,65],[19,62,14,67,"count"],[19,67,14,72],[19,69,14,74,"Type"],[19,73,14,78],[19,75,14,80,"key"],[19,78,14,83],[19,80,14,85],[20,4,14,85],[20,8,14,48,"message"],[20,15,14,55],[20,18,14,55,"_ref"],[20,22,14,55],[20,23,14,48,"message"],[20,30,14,55],[21,4,15,4],[21,8,15,8,"type"],[21,12,15,12],[21,15,15,15],[21,17,15,17],[22,4,16,4],[22,8,16,8],[23,6,17,8,"type"],[23,10,17,12],[23,13,17,15],[23,18,17,20],[23,22,17,24,"Type"],[23,26,17,28],[23,27,17,29,"registry"],[23,35,17,37],[23,36,17,38],[23,37,17,39,"toRawType"],[23,46,17,48],[23,47,17,49],[23,48,17,50],[23,50,17,52],[24,4,18,4],[24,5,18,5],[24,6,19,4],[24,12,19,10],[25,6,20,8],[26,4,20,8],[27,4,22,4],[28,4,23,4],[29,4,24,4],[30,4,25,4],[30,11,25,11],[30,14,25,14,"fn"],[30,16,25,16],[30,31,25,31],[30,32,25,32],[30,33,25,33],[30,35,25,35,"util_1"],[30,41,25,41],[30,42,25,42,"u8aToHex"],[30,50,25,50],[30,52,25,52,"u8a"],[30,55,25,55],[30,56,25,56,"subarray"],[30,64,25,64],[30,65,25,65],[30,66,25,66],[30,68,25,68],[30,70,25,70],[30,71,25,71],[30,72,25,72],[30,76,25,76,"key"],[30,79,25,79],[30,82,25,82],[30,89,25,89,"key"],[30,92,25,92],[30,94,25,94],[30,97,25,97],[30,99,25,99],[30,110,25,110,"i"],[30,111,25,111],[30,114,25,114],[30,115,25,115],[30,119,25,119,"count"],[30,124,25,124],[30,128,25,128,"type"],[30,132,25,132],[30,138,25,138,"message"],[30,145,25,145],[30,147,25,147],[31,2,26,0],[32,2,27,0],[33,0,28,0],[34,0,29,0],[35,0,30,0],[36,0,31,0],[37,0,32,0],[38,0,33,0],[39,0,34,0],[40,0,35,0],[41,0,36,0],[42,2,37,0],[42,11,37,9,"decodeU8a"],[42,20,37,18,"decodeU8a"],[42,21,37,19,"registry"],[42,29,37,27],[42,31,37,29,"result"],[42,37,37,35],[42,39,37,37,"u8a"],[42,42,37,40],[42,44,37,40,"_ref2"],[42,49,37,40],[42,51,37,57],[43,4,37,57],[43,8,37,57,"_ref3"],[43,13,37,57],[43,16,37,57,"_slicedToArray"],[43,30,37,57],[43,31,37,57,"_ref2"],[43,36,37,57],[44,6,37,43,"Types"],[44,11,37,48],[44,14,37,48,"_ref3"],[44,19,37,48],[45,6,37,50,"keys"],[45,10,37,54],[45,13,37,54,"_ref3"],[45,18,37,54],[46,4,38,4],[46,8,38,10,"count"],[46,13,38,15],[46,16,38,18,"result"],[46,22,38,24],[46,23,38,25,"length"],[46,29,38,31],[47,4,39,4],[47,8,39,8,"offset"],[47,14,39,14],[47,17,39,17],[47,18,39,18],[48,4,40,4],[48,8,40,8,"i"],[48,9,40,9],[48,12,40,12],[48,13,40,13],[49,4,41,4],[49,8,41,8],[50,6,42,8],[50,13,42,15,"i"],[50,14,42,16],[50,17,42,19,"count"],[50,22,42,24],[50,24,42,26],[51,8,43,12],[51,12,43,18,"value"],[51,17,43,23],[51,20,43,26],[51,24,43,30,"Types"],[51,29,43,35],[51,30,43,36,"i"],[51,31,43,37],[51,32,43,38],[51,33,43,39,"registry"],[51,41,43,47],[51,43,43,49,"u8a"],[51,46,43,52],[51,47,43,53,"subarray"],[51,55,43,61],[51,56,43,62,"offset"],[51,62,43,68],[51,63,43,69],[51,64,43,70],[52,8,44,12,"offset"],[52,14,44,18],[52,18,44,22,"value"],[52,23,44,27],[52,24,44,28,"initialU8aLength"],[52,40,44,44],[52,44,44,48,"value"],[52,49,44,53],[52,50,44,54,"encodedLength"],[52,63,44,67],[53,8,45,12,"result"],[53,14,45,18],[53,15,45,19,"i"],[53,16,45,20],[53,17,45,21],[53,20,45,24,"value"],[53,25,45,29],[54,8,46,12,"i"],[54,9,46,13],[54,11,46,15],[55,6,47,8],[56,4,48,4],[56,5,48,5],[56,6,49,4],[56,13,49,11,"error"],[56,18,49,16],[56,20,49,18],[57,6,50,8],[57,12,50,14],[57,16,50,18,"Error"],[57,21,50,23],[57,22,50,24,"formatFailure"],[57,35,50,37],[57,36,50,38,"registry"],[57,44,50,46],[57,46,50,48],[57,57,50,59],[57,59,50,61,"result"],[57,65,50,67],[57,67,50,69,"error"],[57,72,50,74],[57,74,50,76,"u8a"],[57,77,50,79],[57,78,50,80,"subarray"],[57,86,50,88],[57,87,50,89,"offset"],[57,93,50,95],[57,94,50,96],[57,96,50,98,"i"],[57,97,50,99],[57,99,50,101,"count"],[57,104,50,106],[57,106,50,108,"Types"],[57,111,50,113],[57,112,50,114,"i"],[57,113,50,115],[57,114,50,116],[57,116,50,118,"keys"],[57,120,50,122],[57,121,50,123,"i"],[57,122,50,124],[57,123,50,125],[57,124,50,126],[57,125,50,127],[58,4,51,4],[59,4,52,4],[59,11,52,11],[59,12,52,12,"result"],[59,18,52,18],[59,20,52,20,"offset"],[59,26,52,26],[59,27,52,27],[60,2,53,0],[61,2,54,0],[62,0,55,0],[63,0,56,0],[64,0,57,0],[65,0,58,0],[66,0,59,0],[67,2,60,0],[67,11,60,9,"decodeU8aStruct"],[67,26,60,24,"decodeU8aStruct"],[67,27,60,25,"registry"],[67,35,60,33],[67,37,60,35,"result"],[67,43,60,41],[67,45,60,43,"u8a"],[67,48,60,46],[67,50,60,46,"_ref4"],[67,55,60,46],[67,57,60,63],[68,4,60,63],[68,8,60,63,"_ref5"],[68,13,60,63],[68,16,60,63,"_slicedToArray"],[68,30,60,63],[68,31,60,63,"_ref4"],[68,36,60,63],[69,6,60,49,"Types"],[69,11,60,54],[69,14,60,54,"_ref5"],[69,19,60,54],[70,6,60,56,"keys"],[70,10,60,60],[70,13,60,60,"_ref5"],[70,18,60,60],[71,4,61,4],[71,8,61,10,"count"],[71,13,61,15],[71,16,61,18,"result"],[71,22,61,24],[71,23,61,25,"length"],[71,29,61,31],[72,4,62,4],[72,8,62,8,"offset"],[72,14,62,14],[72,17,62,17],[72,18,62,18],[73,4,63,4],[73,8,63,8,"i"],[73,9,63,9],[73,12,63,12],[73,13,63,13],[74,4,64,4],[74,8,64,8,"count"],[74,13,64,13],[74,16,64,16,"MAX_DEPTH"],[74,25,64,25],[74,29,64,29,"isComplexType"],[74,42,64,42],[74,43,64,43,"Types"],[74,48,64,48],[74,49,64,49,"i"],[74,50,64,50],[74,51,64,51],[74,52,64,52],[74,54,64,54],[75,6,65,8],[75,12,65,14],[75,16,65,18,"Error"],[75,21,65,23],[75,22,65,24],[75,75,65,77,"count"],[75,80,65,82],[75,100,65,102,"MAX_DEPTH"],[75,109,65,111],[75,111,65,113],[75,112,65,114],[76,4,66,4],[77,4,67,4],[77,8,67,8],[78,6,68,8],[78,13,68,15,"i"],[78,14,68,16],[78,17,68,19,"count"],[78,22,68,24],[78,24,68,26],[79,8,69,12],[79,12,69,18,"value"],[79,17,69,23],[79,20,69,26],[79,24,69,30,"Types"],[79,29,69,35],[79,30,69,36,"i"],[79,31,69,37],[79,32,69,38],[79,33,69,39,"registry"],[79,41,69,47],[79,43,69,49,"u8a"],[79,46,69,52],[79,47,69,53,"subarray"],[79,55,69,61],[79,56,69,62,"offset"],[79,62,69,68],[79,63,69,69],[79,64,69,70],[80,8,70,12,"offset"],[80,14,70,18],[80,18,70,22,"value"],[80,23,70,27],[80,24,70,28,"initialU8aLength"],[80,40,70,44],[80,44,70,48,"value"],[80,49,70,53],[80,50,70,54,"encodedLength"],[80,63,70,67],[81,8,71,12,"result"],[81,14,71,18],[81,15,71,19,"i"],[81,16,71,20],[81,17,71,21],[81,20,71,24],[81,21,71,25,"keys"],[81,25,71,29],[81,26,71,30,"i"],[81,27,71,31],[81,28,71,32],[81,30,71,34,"value"],[81,35,71,39],[81,36,71,40],[82,8,72,12,"i"],[82,9,72,13],[82,11,72,15],[83,6,73,8],[84,4,74,4],[84,5,74,5],[84,6,75,4],[84,13,75,11,"error"],[84,18,75,16],[84,20,75,18],[85,6,76,8],[85,12,76,14],[85,16,76,18,"Error"],[85,21,76,23],[85,22,76,24,"formatFailure"],[85,35,76,37],[85,36,76,38,"registry"],[85,44,76,46],[85,46,76,48],[85,63,76,65],[85,65,76,67,"result"],[85,71,76,73],[85,73,76,75,"error"],[85,78,76,80],[85,80,76,82,"u8a"],[85,83,76,85],[85,84,76,86,"subarray"],[85,92,76,94],[85,93,76,95,"offset"],[85,99,76,101],[85,100,76,102],[85,102,76,104,"i"],[85,103,76,105],[85,105,76,107,"count"],[85,110,76,112],[85,112,76,114,"Types"],[85,117,76,119],[85,118,76,120,"i"],[85,119,76,121],[85,120,76,122],[85,122,76,124,"keys"],[85,126,76,128],[85,127,76,129,"i"],[85,128,76,130],[85,129,76,131],[85,130,76,132],[85,131,76,133],[86,4,77,4],[87,4,78,4],[87,11,78,11],[87,12,78,12,"result"],[87,18,78,18],[87,20,78,20,"offset"],[87,26,78,26],[87,27,78,27],[88,2,79,0],[89,2,80,0],[90,0,81,0],[91,0,82,0],[92,0,83,0],[93,0,84,0],[94,0,85,0],[95,2,86,0],[95,11,86,9,"decodeU8aVec"],[95,23,86,21,"decodeU8aVec"],[95,24,86,22,"registry"],[95,32,86,30],[95,34,86,32,"result"],[95,40,86,38],[95,42,86,40,"u8a"],[95,45,86,43],[95,47,86,45,"startAt"],[95,54,86,52],[95,56,86,54,"Type"],[95,60,86,58],[95,62,86,60],[96,4,87,4],[96,8,87,10,"count"],[96,13,87,15],[96,16,87,18,"result"],[96,22,87,24],[96,23,87,25,"length"],[96,29,87,31],[97,4,88,4],[97,8,88,8,"count"],[97,13,88,13],[97,16,88,16,"MAX_DEPTH"],[97,25,88,25],[97,29,88,29,"isComplexType"],[97,42,88,42],[97,43,88,43,"Type"],[97,47,88,47],[97,48,88,48],[97,50,88,50],[98,6,89,8],[98,12,89,14],[98,16,89,18,"Error"],[98,21,89,23],[98,22,89,24],[98,72,89,74,"count"],[98,77,89,79],[98,97,89,99,"MAX_DEPTH"],[98,106,89,108],[98,108,89,110],[98,109,89,111],[99,4,90,4],[100,4,91,4],[100,8,91,8,"offset"],[100,14,91,14],[100,17,91,17,"startAt"],[100,24,91,24],[101,4,92,4],[101,8,92,8,"i"],[101,9,92,9],[101,12,92,12],[101,13,92,13],[102,4,93,4],[102,8,93,8],[103,6,94,8],[103,13,94,15,"i"],[103,14,94,16],[103,17,94,19,"count"],[103,22,94,24],[103,24,94,26],[104,8,95,12],[104,12,95,18,"value"],[104,17,95,23],[104,20,95,26],[104,24,95,30,"Type"],[104,28,95,34],[104,29,95,35,"registry"],[104,37,95,43],[104,39,95,45,"u8a"],[104,42,95,48],[104,43,95,49,"subarray"],[104,51,95,57],[104,52,95,58,"offset"],[104,58,95,64],[104,59,95,65],[104,60,95,66],[105,8,96,12,"offset"],[105,14,96,18],[105,18,96,22,"value"],[105,23,96,27],[105,24,96,28,"initialU8aLength"],[105,40,96,44],[105,44,96,48,"value"],[105,49,96,53],[105,50,96,54,"encodedLength"],[105,63,96,67],[106,8,97,12,"result"],[106,14,97,18],[106,15,97,19,"i"],[106,16,97,20],[106,17,97,21],[106,20,97,24,"value"],[106,25,97,29],[107,8,98,12,"i"],[107,9,98,13],[107,11,98,15],[108,6,99,8],[109,4,100,4],[109,5,100,5],[109,6,101,4],[109,13,101,11,"error"],[109,18,101,16],[109,20,101,18],[110,6,102,8],[110,12,102,14],[110,16,102,18,"Error"],[110,21,102,23],[110,22,102,24,"formatFailure"],[110,35,102,37],[110,36,102,38,"registry"],[110,44,102,46],[110,46,102,48],[110,60,102,62],[110,62,102,64,"result"],[110,68,102,70],[110,70,102,72,"error"],[110,75,102,77],[110,77,102,79,"u8a"],[110,80,102,82],[110,81,102,83,"subarray"],[110,89,102,91],[110,90,102,92,"offset"],[110,96,102,98],[110,97,102,99],[110,99,102,101,"i"],[110,100,102,102],[110,102,102,104,"count"],[110,107,102,109],[110,109,102,111,"Type"],[110,113,102,115],[110,114,102,116],[110,115,102,117],[111,4,103,4],[112,4,104,4],[112,11,104,11],[112,12,104,12,"offset"],[112,18,104,18],[112,20,104,20,"offset"],[112,26,104,26],[112,29,104,29,"startAt"],[112,36,104,36],[112,37,104,37],[113,2,105,0],[114,0,105,1],[114,3]],"functionMap":{"names":["","isComplexType","formatFailure","decodeU8a","decodeU8aStruct","decodeU8aVec"],"mappings":"AAA;ACQ;CDG;AEE;CFY;AGW;CHgB;AIO;CJmB;AKO;CLmB"},"hasCjsExports":true},"type":"js/module"}]}