{"version":3,"sources":["jsdelivr-header.js","/npm/rolling-dice@0.1.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACHA,SAAS,eAAe,GACpB,KAAK,MAAQ,WAAW,aAAa,EACzC,CALA,KAAO,QAAQ,mBACf,WAAa,QAAQ,uBAMrB,eAAe,UAAU,KAAO,WAC5B,IAAI,EAAO,EAIX,OAHA,KAAK,MAAM,SAAQ,SAAS,GACxB,GAAM,EAAK,MACf,IACO,CACX,EAEA,eAAe,UAAU,cAAgB,WACrC,IAAI,EAUJ,OATA,KAAK,MAAM,SAAQ,SAAS,GACxB,GAAI,EAAe,CACf,IAAI,EAAc,EAAK,gBACvB,EAAc,OAAS,EAAY,MACnC,EAAc,KAAO,EAAc,KAAK,OAAO,EAAY,KAC/D,MACI,EAAgB,EAAK,eAE7B,IACO,CACX,EAEA,eAAe,UAAU,IAAM,WAC3B,IAAI,EAAM,EAIV,OAHA,KAAK,MAAM,SAAQ,SAAS,GACxB,GAAK,EAAK,KACd,IACO,CACX,EAEA,eAAe,UAAU,IAAM,WAC3B,IAAI,EAAM,EAIV,OAHA,KAAK,MAAM,SAAQ,SAAS,GACxB,GAAK,EAAK,KACd,IACO,CACX,EAEA,OAAO,QAAU","file":"/npm/rolling-dice@0.1.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/rolling-dice@0.1.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","Dice = require('./model/Dice.js');\nDiceParser = require('./parser/DiceParser');\n\nfunction DiceExpression(exression) {\n    this.dices = DiceParser.splitByDices(exression);\n}\n\nDiceExpression.prototype.roll = function () {\n    var roll = 0;\n    this.dices.forEach(function(dice){\n        roll+=dice.roll();\n    });\n    return roll;\n}\n\nDiceExpression.prototype.rollExplained = function () {\n    var rollExplained;\n    this.dices.forEach(function(dice){\n        if (rollExplained) {\n            var currentRoll = dice.rollExplained();\n            rollExplained.total += currentRoll.total;\n            rollExplained.dice = rollExplained.dice.concat(currentRoll.dice);\n        } else {\n            rollExplained = dice.rollExplained();\n        }\n    });\n    return rollExplained;\n}\n\nDiceExpression.prototype.min = function () {\n    var min = 0;\n    this.dices.forEach(function(dice){\n        min+=dice.min();\n    });\n    return min;\n}\n\nDiceExpression.prototype.max = function () {\n    var max = 0;\n    this.dices.forEach(function(dice){\n        max+=dice.max();\n    });\n    return max;\n}\n\nmodule.exports = DiceExpression;"]}