{"dependencies":[{"name":"@polkadot/types-codec","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":4,"column":22,"index":129},"end":{"line":4,"column":54,"index":161}}],"key":"fW1yxuTjZe66ggmM4ihNuGjKSV0=","exportNames":["*"],"imports":1}},{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":15,"index":178},"end":{"line":5,"column":40,"index":203}}],"key":"u0mzEw2nilnHoUWtEdZl0JKHutA=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.GenericVote = void 0;\n const types_codec_1 = require(_dependencyMap[0], \"@polkadot/types-codec\");\n const util_1 = require(_dependencyMap[1], \"@polkadot/util\");\n const AYE_BITS = 0b10000000;\n const NAY_BITS = 0b00000000;\n const CON_MASK = 0b01111111;\n const DEF_CONV = 0b00000000; // the default conviction, None\n /** @internal */\n function decodeVoteBool(value) {\n return value ? new Uint8Array([AYE_BITS | DEF_CONV]) : new Uint8Array([NAY_BITS]);\n }\n /** @internal */\n function decodeVoteU8a(value) {\n return value.length ? value.subarray(0, 1) : new Uint8Array([NAY_BITS]);\n }\n /** @internal */\n function decodeVoteType(registry, value) {\n return new Uint8Array([(new types_codec_1.Bool(registry, value.aye).isTrue ? AYE_BITS : NAY_BITS) | registry.createTypeUnsafe('Conviction', [value.conviction || DEF_CONV]).index]);\n }\n /** @internal */\n function decodeVote(registry, value) {\n if ((0, util_1.isU8a)(value)) {\n return decodeVoteU8a(value);\n } else if ((0, util_1.isUndefined)(value) || value instanceof Boolean || (0, util_1.isBoolean)(value)) {\n return decodeVoteBool(new types_codec_1.Bool(registry, value).isTrue);\n } else if ((0, util_1.isNumber)(value)) {\n return decodeVoteBool(value < 0);\n }\n return decodeVoteType(registry, value);\n }\n /**\n * @name GenericVote\n * @description\n * A number of lock periods, plus a vote, one way or the other.\n */\n class GenericVote extends types_codec_1.U8aFixed {\n #aye;\n #conviction;\n constructor(registry, value) {\n // decoded is just 1 byte\n // Aye: Most Significant Bit\n // Conviction: 0000 - 0101\n const decoded = decodeVote(registry, value);\n super(registry, decoded, 8);\n this.#aye = (decoded[0] & AYE_BITS) === AYE_BITS;\n this.#conviction = this.registry.createTypeUnsafe('Conviction', [decoded[0] & CON_MASK]);\n }\n /**\n * @description returns a V2 conviction\n */\n get conviction() {\n return this.#conviction;\n }\n /**\n * @description true if the wrapped value is a positive vote\n */\n get isAye() {\n return this.#aye;\n }\n /**\n * @description true if the wrapped value is a negative vote\n */\n get isNay() {\n return !this.isAye;\n }\n /**\n * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information\n */\n toHuman(isExpanded) {\n return {\n conviction: this.conviction.toHuman(isExpanded),\n vote: this.isAye ? 'Aye' : 'Nay'\n };\n }\n /**\n * @description Converts the value in a best-fit primitive form\n */\n toPrimitive() {\n return {\n aye: this.isAye,\n conviction: this.conviction.toPrimitive()\n };\n }\n /**\n * @description Returns the base runtime type name for this instance\n */\n toRawType() {\n return 'Vote';\n }\n }\n exports.GenericVote = GenericVote;\n});","lineCount":98,"map":[[2,2,1,0],[2,14,1,12],[4,2,2,0,"Object"],[4,8,2,6],[4,9,2,7,"defineProperty"],[4,23,2,21],[4,24,2,22,"exports"],[4,31,2,29],[4,33,2,31],[4,45,2,43],[4,47,2,45],[5,4,2,47,"value"],[5,9,2,52],[5,11,2,54],[6,2,2,59],[6,3,2,60],[6,4,2,61],[7,2,3,0,"exports"],[7,9,3,7],[7,10,3,8,"GenericVote"],[7,21,3,19],[7,24,3,22],[7,29,3,27],[7,30,3,28],[8,2,4,0],[8,8,4,6,"types_codec_1"],[8,21,4,19],[8,24,4,22,"require"],[8,31,4,29],[8,32,4,29,"_dependencyMap"],[8,46,4,29],[8,74,4,53],[8,75,4,54],[9,2,5,0],[9,8,5,6,"util_1"],[9,14,5,12],[9,17,5,15,"require"],[9,24,5,22],[9,25,5,22,"_dependencyMap"],[9,39,5,22],[9,60,5,39],[9,61,5,40],[10,2,6,0],[10,8,6,6,"AYE_BITS"],[10,16,6,14],[10,19,6,17],[10,29,6,27],[11,2,7,0],[11,8,7,6,"NAY_BITS"],[11,16,7,14],[11,19,7,17],[11,29,7,27],[12,2,8,0],[12,8,8,6,"CON_MASK"],[12,16,8,14],[12,19,8,17],[12,29,8,27],[13,2,9,0],[13,8,9,6,"DEF_CONV"],[13,16,9,14],[13,19,9,17],[13,29,9,27],[13,30,9,28],[13,31,9,29],[14,2,10,0],[15,2,11,0],[15,11,11,9,"decodeVoteBool"],[15,25,11,23,"decodeVoteBool"],[15,26,11,24,"value"],[15,31,11,29],[15,33,11,31],[16,4,12,4],[16,11,12,11,"value"],[16,16,12,16],[16,19,13,10],[16,23,13,14,"Uint8Array"],[16,33,13,24],[16,34,13,25],[16,35,13,26,"AYE_BITS"],[16,43,13,34],[16,46,13,37,"DEF_CONV"],[16,54,13,45],[16,55,13,46],[16,56,13,47],[16,59,14,10],[16,63,14,14,"Uint8Array"],[16,73,14,24],[16,74,14,25],[16,75,14,26,"NAY_BITS"],[16,83,14,34],[16,84,14,35],[16,85,14,36],[17,2,15,0],[18,2,16,0],[19,2,17,0],[19,11,17,9,"decodeVoteU8a"],[19,24,17,22,"decodeVoteU8a"],[19,25,17,23,"value"],[19,30,17,28],[19,32,17,30],[20,4,18,4],[20,11,18,11,"value"],[20,16,18,16],[20,17,18,17,"length"],[20,23,18,23],[20,26,19,10,"value"],[20,31,19,15],[20,32,19,16,"subarray"],[20,40,19,24],[20,41,19,25],[20,42,19,26],[20,44,19,28],[20,45,19,29],[20,46,19,30],[20,49,20,10],[20,53,20,14,"Uint8Array"],[20,63,20,24],[20,64,20,25],[20,65,20,26,"NAY_BITS"],[20,73,20,34],[20,74,20,35],[20,75,20,36],[21,2,21,0],[22,2,22,0],[23,2,23,0],[23,11,23,9,"decodeVoteType"],[23,25,23,23,"decodeVoteType"],[23,26,23,24,"registry"],[23,34,23,32],[23,36,23,34,"value"],[23,41,23,39],[23,43,23,41],[24,4,24,4],[24,11,24,11],[24,15,24,15,"Uint8Array"],[24,25,24,25],[24,26,24,26],[24,27,25,8],[24,28,25,9],[24,32,25,13,"types_codec_1"],[24,45,25,26],[24,46,25,27,"Bool"],[24,50,25,31],[24,51,25,32,"registry"],[24,59,25,40],[24,61,25,42,"value"],[24,66,25,47],[24,67,25,48,"aye"],[24,70,25,51],[24,71,25,52],[24,72,25,53,"isTrue"],[24,78,25,59],[24,81,26,14,"AYE_BITS"],[24,89,26,22],[24,92,27,14,"NAY_BITS"],[24,100,27,22],[24,104,28,12,"registry"],[24,112,28,20],[24,113,28,21,"createTypeUnsafe"],[24,129,28,37],[24,130,28,38],[24,142,28,50],[24,144,28,52],[24,145,28,53,"value"],[24,150,28,58],[24,151,28,59,"conviction"],[24,161,28,69],[24,165,28,73,"DEF_CONV"],[24,173,28,81],[24,174,28,82],[24,175,28,83],[24,176,28,84,"index"],[24,181,28,89],[24,182,29,5],[24,183,29,6],[25,2,30,0],[26,2,31,0],[27,2,32,0],[27,11,32,9,"decodeVote"],[27,21,32,19,"decodeVote"],[27,22,32,20,"registry"],[27,30,32,28],[27,32,32,30,"value"],[27,37,32,35],[27,39,32,37],[28,4,33,4],[28,8,33,8],[28,9,33,9],[28,10,33,10],[28,12,33,12,"util_1"],[28,18,33,18],[28,19,33,19,"isU8a"],[28,24,33,24],[28,26,33,26,"value"],[28,31,33,31],[28,32,33,32],[28,34,33,34],[29,6,34,8],[29,13,34,15,"decodeVoteU8a"],[29,26,34,28],[29,27,34,29,"value"],[29,32,34,34],[29,33,34,35],[30,4,35,4],[30,5,35,5],[30,11,36,9],[30,15,36,13],[30,16,36,14],[30,17,36,15],[30,19,36,17,"util_1"],[30,25,36,23],[30,26,36,24,"isUndefined"],[30,37,36,35],[30,39,36,37,"value"],[30,44,36,42],[30,45,36,43],[30,49,36,47,"value"],[30,54,36,52],[30,66,36,64,"Boolean"],[30,73,36,71],[30,77,36,75],[30,78,36,76],[30,79,36,77],[30,81,36,79,"util_1"],[30,87,36,85],[30,88,36,86,"isBoolean"],[30,97,36,95],[30,99,36,97,"value"],[30,104,36,102],[30,105,36,103],[30,107,36,105],[31,6,37,8],[31,13,37,15,"decodeVoteBool"],[31,27,37,29],[31,28,37,30],[31,32,37,34,"types_codec_1"],[31,45,37,47],[31,46,37,48,"Bool"],[31,50,37,52],[31,51,37,53,"registry"],[31,59,37,61],[31,61,37,63,"value"],[31,66,37,68],[31,67,37,69],[31,68,37,70,"isTrue"],[31,74,37,76],[31,75,37,77],[32,4,38,4],[32,5,38,5],[32,11,39,9],[32,15,39,13],[32,16,39,14],[32,17,39,15],[32,19,39,17,"util_1"],[32,25,39,23],[32,26,39,24,"isNumber"],[32,34,39,32],[32,36,39,34,"value"],[32,41,39,39],[32,42,39,40],[32,44,39,42],[33,6,40,8],[33,13,40,15,"decodeVoteBool"],[33,27,40,29],[33,28,40,30,"value"],[33,33,40,35],[33,36,40,38],[33,37,40,39],[33,38,40,40],[34,4,41,4],[35,4,42,4],[35,11,42,11,"decodeVoteType"],[35,25,42,25],[35,26,42,26,"registry"],[35,34,42,34],[35,36,42,36,"value"],[35,41,42,41],[35,42,42,42],[36,2,43,0],[37,2,44,0],[38,0,45,0],[39,0,46,0],[40,0,47,0],[41,0,48,0],[42,2,49,0],[42,8,49,6,"GenericVote"],[42,19,49,17],[42,28,49,26,"types_codec_1"],[42,41,49,39],[42,42,49,40,"U8aFixed"],[42,50,49,48],[42,51,49,49],[43,4,50,4],[43,5,50,5,"aye"],[43,8,50,8],[44,4,51,4],[44,5,51,5,"conviction"],[44,15,51,15],[45,4,52,4,"constructor"],[45,15,52,15,"constructor"],[45,16,52,16,"registry"],[45,24,52,24],[45,26,52,26,"value"],[45,31,52,31],[45,33,52,33],[46,6,53,8],[47,6,54,8],[48,6,55,8],[49,6,56,8],[49,12,56,14,"decoded"],[49,19,56,21],[49,22,56,24,"decodeVote"],[49,32,56,34],[49,33,56,35,"registry"],[49,41,56,43],[49,43,56,45,"value"],[49,48,56,50],[49,49,56,51],[50,6,57,8],[50,11,57,13],[50,12,57,14,"registry"],[50,20,57,22],[50,22,57,24,"decoded"],[50,29,57,31],[50,31,57,33],[50,32,57,34],[50,33,57,35],[51,6,58,8],[51,10,58,12],[51,11,58,13],[51,12,58,14,"aye"],[51,15,58,17],[51,18,58,20],[51,19,58,21,"decoded"],[51,26,58,28],[51,27,58,29],[51,28,58,30],[51,29,58,31],[51,32,58,34,"AYE_BITS"],[51,40,58,42],[51,46,58,48,"AYE_BITS"],[51,54,58,56],[52,6,59,8],[52,10,59,12],[52,11,59,13],[52,12,59,14,"conviction"],[52,22,59,24],[52,25,59,27],[52,29,59,31],[52,30,59,32,"registry"],[52,38,59,40],[52,39,59,41,"createTypeUnsafe"],[52,55,59,57],[52,56,59,58],[52,68,59,70],[52,70,59,72],[52,71,59,73,"decoded"],[52,78,59,80],[52,79,59,81],[52,80,59,82],[52,81,59,83],[52,84,59,86,"CON_MASK"],[52,92,59,94],[52,93,59,95],[52,94,59,96],[53,4,60,4],[54,4,61,4],[55,0,62,0],[56,0,63,0],[57,4,64,4],[57,8,64,8,"conviction"],[57,18,64,18,"conviction"],[57,19,64,18],[57,21,64,21],[58,6,65,8],[58,13,65,15],[58,17,65,19],[58,18,65,20],[58,19,65,21,"conviction"],[58,29,65,31],[59,4,66,4],[60,4,67,4],[61,0,68,0],[62,0,69,0],[63,4,70,4],[63,8,70,8,"isAye"],[63,13,70,13,"isAye"],[63,14,70,13],[63,16,70,16],[64,6,71,8],[64,13,71,15],[64,17,71,19],[64,18,71,20],[64,19,71,21,"aye"],[64,22,71,24],[65,4,72,4],[66,4,73,4],[67,0,74,0],[68,0,75,0],[69,4,76,4],[69,8,76,8,"isNay"],[69,13,76,13,"isNay"],[69,14,76,13],[69,16,76,16],[70,6,77,8],[70,13,77,15],[70,14,77,16],[70,18,77,20],[70,19,77,21,"isAye"],[70,24,77,26],[71,4,78,4],[72,4,79,4],[73,0,80,0],[74,0,81,0],[75,4,82,4,"toHuman"],[75,11,82,11,"toHuman"],[75,12,82,12,"isExpanded"],[75,22,82,22],[75,24,82,24],[76,6,83,8],[76,13,83,15],[77,8,84,12,"conviction"],[77,18,84,22],[77,20,84,24],[77,24,84,28],[77,25,84,29,"conviction"],[77,35,84,39],[77,36,84,40,"toHuman"],[77,43,84,47],[77,44,84,48,"isExpanded"],[77,54,84,58],[77,55,84,59],[78,8,85,12,"vote"],[78,12,85,16],[78,14,85,18],[78,18,85,22],[78,19,85,23,"isAye"],[78,24,85,28],[78,27,85,31],[78,32,85,36],[78,35,85,39],[79,6,86,8],[79,7,86,9],[80,4,87,4],[81,4,88,4],[82,0,89,0],[83,0,90,0],[84,4,91,4,"toPrimitive"],[84,15,91,15,"toPrimitive"],[84,16,91,15],[84,18,91,18],[85,6,92,8],[85,13,92,15],[86,8,93,12,"aye"],[86,11,93,15],[86,13,93,17],[86,17,93,21],[86,18,93,22,"isAye"],[86,23,93,27],[87,8,94,12,"conviction"],[87,18,94,22],[87,20,94,24],[87,24,94,28],[87,25,94,29,"conviction"],[87,35,94,39],[87,36,94,40,"toPrimitive"],[87,47,94,51],[87,48,94,52],[88,6,95,8],[88,7,95,9],[89,4,96,4],[90,4,97,4],[91,0,98,0],[92,0,99,0],[93,4,100,4,"toRawType"],[93,13,100,13,"toRawType"],[93,14,100,13],[93,16,100,16],[94,6,101,8],[94,13,101,15],[94,19,101,21],[95,4,102,4],[96,2,103,0],[97,2,104,0,"exports"],[97,9,104,7],[97,10,104,8,"GenericVote"],[97,21,104,19],[97,24,104,22,"GenericVote"],[97,35,104,33],[98,0,104,34],[98,3]],"functionMap":{"names":["","decodeVoteBool","decodeVoteU8a","decodeVoteType","decodeVote","GenericVote","GenericVote#constructor","GenericVote#get__conviction","GenericVote#get__isAye","GenericVote#get__isNay","GenericVote#toHuman","GenericVote#toPrimitive","GenericVote#toRawType"],"mappings":"AAA;ACU;CDI;AEE;CFI;AGE;CHO;AIE;CJW;AKM;ICG;KDQ;IEI;KFE;IGI;KHE;III;KJE;IKI;KLK;IMI;KNK;IOI;KPE;CLC"},"hasCjsExports":true},"type":"js/module"}]}