@dice-roller/vue 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.js +31 -31
- package/dist/vue.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/vue.js
CHANGED
|
@@ -30509,12 +30509,12 @@ const ou = {
|
|
|
30509
30509
|
}
|
|
30510
30510
|
});
|
|
30511
30511
|
}
|
|
30512
|
-
}, bF = () =>
|
|
30512
|
+
}, bF = () => typeof crypto < "u" && crypto && crypto.randomUUID, xF = () => bF ? crypto.randomUUID() : `${Date.now().toString(32)}-${Math.random().toString(36).substring(2)}`;
|
|
30513
30513
|
function su(r) {
|
|
30514
30514
|
const e = ci(null);
|
|
30515
|
-
return e.value = `${r}${
|
|
30515
|
+
return e.value = `${r}${xF()}`, { id: e };
|
|
30516
30516
|
}
|
|
30517
|
-
const
|
|
30517
|
+
const wF = ["id"], NF = ["for"], MF = ["for"], AF = ["id", "placeholder"], SF = ["onClick"], VF = {
|
|
30518
30518
|
__name: "DiceRoller",
|
|
30519
30519
|
props: {
|
|
30520
30520
|
btnLabel: {
|
|
@@ -30546,21 +30546,21 @@ const xF = ["id"], wF = ["for"], NF = ["for"], MF = ["id", "placeholder"], AF =
|
|
|
30546
30546
|
name: "output",
|
|
30547
30547
|
for: Vr(t),
|
|
30548
30548
|
class: Bt(`${r.className}-output`)
|
|
30549
|
-
}, zt(c), 11,
|
|
30549
|
+
}, zt(c), 11, NF)) : Wn("", !0),
|
|
30550
30550
|
Ir("div", {
|
|
30551
30551
|
class: Bt(`${r.className}-input-group`)
|
|
30552
30552
|
}, [
|
|
30553
30553
|
Ir("label", {
|
|
30554
30554
|
for: Vr(t),
|
|
30555
30555
|
class: Bt(`${r.className}-label`)
|
|
30556
|
-
}, " Notation ", 10,
|
|
30556
|
+
}, " Notation ", 10, MF),
|
|
30557
30557
|
Ir("input", gs({
|
|
30558
30558
|
type: "text",
|
|
30559
30559
|
name: "notation",
|
|
30560
30560
|
id: Vr(t),
|
|
30561
30561
|
placeholder: `e.g. ${r.notation || "4d6"}`,
|
|
30562
30562
|
class: [`${r.className}-input`, i ? `${r.className}-input-invalid` : null]
|
|
30563
|
-
}, ys(f, !0), l), null, 16,
|
|
30563
|
+
}, ys(f, !0), l), null, 16, AF),
|
|
30564
30564
|
Ir("button", {
|
|
30565
30565
|
type: "button",
|
|
30566
30566
|
class: Bt(`${r.className}-button`),
|
|
@@ -30569,21 +30569,21 @@ const xF = ["id"], wF = ["for"], NF = ["for"], MF = ["id", "placeholder"], AF =
|
|
|
30569
30569
|
Ei(a.$slots, "button", {}, () => [
|
|
30570
30570
|
bs(zt(r.btnLabel), 1)
|
|
30571
30571
|
])
|
|
30572
|
-
], 10,
|
|
30572
|
+
], 10, SF)
|
|
30573
30573
|
], 2),
|
|
30574
30574
|
i ? (qt(), Jn("span", {
|
|
30575
30575
|
key: 1,
|
|
30576
30576
|
class: Bt(`${r.className}-error`)
|
|
30577
30577
|
}, zt(i), 3)) : Wn("", !0)
|
|
30578
|
-
], 10,
|
|
30578
|
+
], 10, wF)
|
|
30579
30579
|
]),
|
|
30580
30580
|
_: 3
|
|
30581
30581
|
}, 8, ["notation"]));
|
|
30582
30582
|
}
|
|
30583
|
-
},
|
|
30583
|
+
}, EF = ["id"], CF = ["for"], OF = { class: "flex flex-col sm:flex-row gap-y-4" }, $F = ["for"], TF = ["id", "placeholder"], DF = ["onClick"], BF = {
|
|
30584
30584
|
key: 1,
|
|
30585
30585
|
class: "block mt-4 text-red-600 text-sm dark:text-red-200"
|
|
30586
|
-
},
|
|
30586
|
+
}, GF = {
|
|
30587
30587
|
__name: "DiceRollerTailwind",
|
|
30588
30588
|
props: {
|
|
30589
30589
|
btnLabel: {
|
|
@@ -30611,19 +30611,19 @@ const xF = ["id"], wF = ["for"], NF = ["for"], MF = ["id", "placeholder"], AF =
|
|
|
30611
30611
|
name: "output",
|
|
30612
30612
|
for: Vr(t),
|
|
30613
30613
|
class: "block mb-8 p-4 text-2xl rounded bg-white text-black dark:bg-gray-300 dark:text-gray-800 border-l-8 border-[#d4f4c6]"
|
|
30614
|
-
}, zt(c), 9,
|
|
30615
|
-
Ir("div",
|
|
30614
|
+
}, zt(c), 9, CF)) : Wn("", !0),
|
|
30615
|
+
Ir("div", OF, [
|
|
30616
30616
|
Ir("label", {
|
|
30617
30617
|
for: Vr(t),
|
|
30618
30618
|
class: "sr-only"
|
|
30619
|
-
}, " Notation ", 8,
|
|
30619
|
+
}, " Notation ", 8, $F),
|
|
30620
30620
|
Ir("input", gs({
|
|
30621
30621
|
type: "text",
|
|
30622
30622
|
name: "notation",
|
|
30623
30623
|
id: Vr(t),
|
|
30624
30624
|
placeholder: `e.g. ${r.notation || "4d6"}`,
|
|
30625
30625
|
class: ["flex-auto block w-full h-11 py-2 px-4 text-base border shadow-sm rounded placeholder-gray-500 focus:ring-[#d4f4c6] focus:border-[#d4f4c6] focus:outline-none focus:placeholder-gray-400 dark:focus:placeholder-gray-400 invalid:text-red-600 invalid:border-red-200 invalid:bg-red-50 sm:border-r-0 sm:rounded-r-none", i ? "text-red-600 border-red-200 bg-red-50" : "bg-white text-gray-900 border-gray-300 dark:text-gray-600 dark:bg-gray-50 dark:border-gray-700"]
|
|
30626
|
-
}, ys(f, !0), l), null, 16,
|
|
30626
|
+
}, ys(f, !0), l), null, 16, TF),
|
|
30627
30627
|
Ir("button", {
|
|
30628
30628
|
type: "button",
|
|
30629
30629
|
class: "block px-8 h-11 font-bold text-gray-600 bg-gradient-to-br from-[#eda18b] to-[#d4f4c6] border border-l-0 border-gray-300 rounded transition dark:border-gray-700 focus:from-[#e88c71] focus:to-[#bbf0a3] focus:text-gray-800 focus:ring-[#d4f4c6] focus:border-[#d4f4c6] focus:outline-none hover:from-[#e88c71] hover:to-[#bbf0a3] hover:text-gray-800 sm:rounded-l-none",
|
|
@@ -30632,18 +30632,18 @@ const xF = ["id"], wF = ["for"], NF = ["for"], MF = ["id", "placeholder"], AF =
|
|
|
30632
30632
|
Ei(a.$slots, "button", {}, () => [
|
|
30633
30633
|
bs(zt(r.btnLabel), 1)
|
|
30634
30634
|
])
|
|
30635
|
-
], 8,
|
|
30635
|
+
], 8, DF)
|
|
30636
30636
|
]),
|
|
30637
|
-
i ? (qt(), Jn("span",
|
|
30638
|
-
], 8,
|
|
30637
|
+
i ? (qt(), Jn("span", BF, zt(i), 1)) : Wn("", !0)
|
|
30638
|
+
], 8, EF)
|
|
30639
30639
|
]),
|
|
30640
30640
|
_: 3
|
|
30641
30641
|
}, 8, ["notation"]));
|
|
30642
30642
|
}
|
|
30643
|
-
},
|
|
30643
|
+
}, _F = ["id"], IF = { class: "card-body" }, RF = ["for"], FF = ["for"], qF = { class: "input-group" }, zF = ["id", "placeholder"], PF = ["onClick"], UF = {
|
|
30644
30644
|
key: 1,
|
|
30645
30645
|
class: "d-block mt-3 invalid-feedback"
|
|
30646
|
-
}, ta = ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark"], jm = [...ta, "body", "white", "transparent"], Km = [...ta, "body", "muted", "white", "black-50", "white-50"],
|
|
30646
|
+
}, ta = ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark"], jm = [...ta, "body", "white", "transparent"], Km = [...ta, "body", "muted", "white", "black-50", "white-50"], LF = [...ta, "link", "outline-primary", "outline-secondary", "outline-success", "outline-danger", "outline-warning", "outline-info", "outline-light", "outline-dark"], ep = [...ta, "white"], HF = {
|
|
30647
30647
|
__name: "DiceRollerBootstrap",
|
|
30648
30648
|
props: {
|
|
30649
30649
|
bgVariant: {
|
|
@@ -30666,7 +30666,7 @@ const xF = ["id"], wF = ["for"], NF = ["for"], MF = ["id", "placeholder"], AF =
|
|
|
30666
30666
|
type: String,
|
|
30667
30667
|
default: "primary",
|
|
30668
30668
|
validator(r) {
|
|
30669
|
-
return
|
|
30669
|
+
return LF.includes(r);
|
|
30670
30670
|
}
|
|
30671
30671
|
},
|
|
30672
30672
|
id: String,
|
|
@@ -30731,25 +30731,25 @@ const xF = ["id"], wF = ["for"], NF = ["for"], MF = ["id", "placeholder"], AF =
|
|
|
30731
30731
|
id: r.id,
|
|
30732
30732
|
class: Bt(["dice-roller card", Vr(t)])
|
|
30733
30733
|
}, [
|
|
30734
|
-
Ir("div",
|
|
30734
|
+
Ir("div", IF, [
|
|
30735
30735
|
l ? (qt(), Jn("output", {
|
|
30736
30736
|
key: 0,
|
|
30737
30737
|
name: "output",
|
|
30738
30738
|
for: Vr(i),
|
|
30739
30739
|
class: Bt(["d-block mb-4 p-3 fs-4 rounded border", Vr(a)])
|
|
30740
|
-
}, zt(l), 11,
|
|
30740
|
+
}, zt(l), 11, RF)) : Wn("", !0),
|
|
30741
30741
|
Ir("label", {
|
|
30742
30742
|
for: Vr(i),
|
|
30743
30743
|
class: "form-label visually-hidden"
|
|
30744
|
-
}, " Notation ", 8,
|
|
30745
|
-
Ir("div",
|
|
30744
|
+
}, " Notation ", 8, FF),
|
|
30745
|
+
Ir("div", qF, [
|
|
30746
30746
|
Ir("input", gs({
|
|
30747
30747
|
type: "text",
|
|
30748
30748
|
name: "notation",
|
|
30749
30749
|
id: Vr(i),
|
|
30750
30750
|
placeholder: `e.g. ${r.notation || "4d6"}`,
|
|
30751
30751
|
class: ["form-control", f ? "is-invalid" : ""]
|
|
30752
|
-
}, ys(o, !0), u), null, 16,
|
|
30752
|
+
}, ys(o, !0), u), null, 16, zF),
|
|
30753
30753
|
Ir("button", {
|
|
30754
30754
|
type: "button",
|
|
30755
30755
|
class: Bt(["btn", Vr(n)]),
|
|
@@ -30758,19 +30758,19 @@ const xF = ["id"], wF = ["for"], NF = ["for"], MF = ["id", "placeholder"], AF =
|
|
|
30758
30758
|
Ei(c.$slots, "button", {}, () => [
|
|
30759
30759
|
bs(zt(r.btnLabel), 1)
|
|
30760
30760
|
])
|
|
30761
|
-
], 10,
|
|
30761
|
+
], 10, PF)
|
|
30762
30762
|
]),
|
|
30763
|
-
f ? (qt(), Jn("span",
|
|
30763
|
+
f ? (qt(), Jn("span", UF, zt(f), 1)) : Wn("", !0)
|
|
30764
30764
|
])
|
|
30765
|
-
], 10,
|
|
30765
|
+
], 10, _F)
|
|
30766
30766
|
]),
|
|
30767
30767
|
_: 3
|
|
30768
30768
|
}, 8, ["notation"]));
|
|
30769
30769
|
}
|
|
30770
30770
|
};
|
|
30771
30771
|
export {
|
|
30772
|
-
|
|
30773
|
-
|
|
30772
|
+
VF as DiceRoller,
|
|
30773
|
+
HF as DiceRollerBootstrap,
|
|
30774
30774
|
ou as DiceRollerRenderless,
|
|
30775
|
-
|
|
30775
|
+
GF as DiceRollerTailwind
|
|
30776
30776
|
};
|
package/dist/vue.umd.cjs
CHANGED
|
@@ -79,5 +79,5 @@ In case of a (multi dimensional) array or matrix, the prob order quantile of all
|
|
|
79
79
|
`+m+` |
|
|
80
80
|
`+n.line+" | "+f+`
|
|
81
81
|
`+m+" | "+Cs("",n.column-1)+Cs("",l-n.column,"^")}else e+=`
|
|
82
|
-
at `+i}return e},ra.buildMessage=function(r,e){var t={literal:function(l){return'"'+n(l.text)+'"'},class:function(l){var s=l.parts.map(function(o){return Array.isArray(o)?i(o[0])+"-"+i(o[1]):i(o)});return"["+(l.inverted?"^":"")+s+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function a(l){return l.charCodeAt(0).toString(16).toUpperCase()}function n(l){return l.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(s){return"\\x0"+a(s)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(s){return"\\x"+a(s)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(s){return"\\x0"+a(s)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(s){return"\\x"+a(s)})}function c(l){return t[l.type](l)}function m(l){var s=l.map(c),o,u;if(s.sort(),s.length>0){for(o=1,u=1;o<s.length;o++)s[o-1]!==s[o]&&(s[u]=s[o],u++);s.length=u}switch(s.length){case 1:return s[0];case 2:return s[0]+" or "+s[1];default:return s.slice(0,-1).join(", ")+", or "+s[s.length-1]}}function f(l){return l?'"'+n(l)+'"':"end of input"}return"Expected "+m(r)+" but "+f(e)+" found."};function eR(r,e){e=e!==void 0?e:{};var t={},a=e.grammarSource,n={Main:nd},i=nd,c="{",m=",",f="}",l="d",s="d%",o="dF",u=".",p="!",v="p",h="k",b="max",w="min",N="r",d="o",y="cs",x="cf",g="s",S="a",A="f",E="!=",M="<=",B=">=",C="=",_="<>",P=">",I="<",T="(",D=")",Z="abs",$="ceil",H="cos",Q="exp",te="floor",J="log",re="round",oe="sign",ae="sin",ce="sqrt",se="tan",me="pow",ne="-",Ae="**",Ce="*",ge="^",Se="%",z="/",Y="+",V=/^[12]/,L=/^[lh]/,j=/^[.]/,F=/^[1-9]/,U=/^[0-9]/,ee=/^[ \t\n\r]/,k=Pe("{",!1),fe=Pe(",",!1),ve=Pe("}",!1),Me=Pe("d",!1),be=Pe("d%",!1),xe=Pe("dF",!1),Te=Pe(".",!1),nr=sa(["1","2"],!1,!1),dr=Pe("!",!1),fr=Pe("p",!1),Gr=sa(["l","h"],!1,!1),Hr=Pe("k",!1),st=Pe("max",!1),er=Pe("min",!1),$t=Pe("r",!1),O=Pe("o",!1),X=Pe("cs",!1),ue=Pe("cf",!1),we=Pe("s",!1),ke=Pe("a",!1),Xe=Pe("f",!1),Sr=Pe("!=",!1),La=Pe("<=",!1),_s=Pe(">=",!1),Is=Pe("=",!1),Rs=Pe("<>",!1),Fs=Pe(">",!1),qs=Pe("<",!1),ia=Pe("(",!1),oa=Pe(")",!1),zs=Pe("abs",!1),Ps=Pe("ceil",!1),Us=Pe("cos",!1),Ls=Pe("exp",!1),ks=Pe("floor",!1),Vs=Pe("log",!1),Gs=Pe("round",!1),ka=Pe("sign",!1),pr=Pe("sin",!1),Tr=Pe("sqrt",!1),ut=Pe("tan",!1),
|
|
83
|
-
`,"\r"],!1,!1),FR=function(R,K,ie){return new Zh([R,...K.map(de=>de[3])],Object.assign({},...ie.map(de=>({[de.name]:de}))))},qR=function(R,K){return R.modifiers=Object.assign({},...K.map(ie=>({[ie.name]:ie}))),R},zR=function(R,K){return new ea(K,R||1)},PR=function(R){return new VI(R||1)},UR=function(R,K){return new kI(K?parseInt(K[1],10):2,R||1)},LR=function(R,K,ie){return new Oh(ie,!!R,!!K)},kR=function(R,K){return new YI(R,K)},VR=function(R,K){return new ZI(R||"l",K)},GR=function(R,K){return new Lh(R||"h",K)},HR=function(R){return new JI(R)},ZR=function(R){return new WI(R)},JR=function(R,K){return new Bh(!!R,K)},WR=function(R){return new HI(R)},XR=function(R){return new GI(R)},YR=function(R){return new XI(R||"a")},QR=function(R){return R},jR=function(R,K){return new qa(R,K)},KR=function(R,K,ie){return uh(Zs())},eF=function(R,K){return R=Array.isArray(R)?R:[R],[...R,...K.map(([,ie,,de])=>[ie,de]).flat(2)]},rF=function(R,K,ie){return[R,...K,ie]},tF=function(R,K){return[`${R}(`,...K,")"]},nF=function(R,K,ie){return[`${R}(`,...K,",",...ie,")"]},aF=function(){return parseFloat(Zs())},ed=function(){return parseInt(Zs(),10)},iF=function(){return"^"},G=0,vr=0,Vi=[{line:1,column:1}],Tt=0,Hs=[],Ee=0,Gi;if("startRule"in e){if(!(e.startRule in n))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');i=n[e.startRule]}function Zs(){return r.substring(vr,G)}function Pe(R,K){return{type:"literal",text:R,ignoreCase:K}}function sa(R,K,ie){return{type:"class",parts:R,inverted:K,ignoreCase:ie}}function oF(){return{type:"end"}}function sF(R){return{type:"other",description:R}}function rd(R){var K=Vi[R],ie;if(K)return K;for(ie=R-1;!Vi[ie];)ie--;for(K=Vi[ie],K={line:K.line,column:K.column};ie<R;)r.charCodeAt(ie)===10?(K.line++,K.column=1):K.column++,ie++;return Vi[R]=K,K}function td(R,K){var ie=rd(R),de=rd(K);return{source:a,start:{offset:R,line:ie.line,column:ie.column},end:{offset:K,line:de.line,column:de.column}}}function Oe(R){G<Tt||(G>Tt&&(Tt=G,Hs=[]),Hs.push(R))}function uF(R,K,ie){return new ra(ra.buildMessage(R,K),R,K,ie)}function nd(){var R;return R=sn(),R}function cF(){var R,K,ie,de,Ie,Ve,ur,Ar,gt;if(R=G,r.charCodeAt(G)===123?(K=c,G++):(K=t,Ee===0&&Oe(k)),K!==t)if(xr(),ie=sn(),ie!==t){for(de=[],Ie=G,Ve=xr(),r.charCodeAt(G)===44?(ur=m,G++):(ur=t,Ee===0&&Oe(fe)),ur!==t?(Ar=xr(),gt=sn(),gt!==t?(Ve=[Ve,ur,Ar,gt],Ie=Ve):(G=Ie,Ie=t)):(G=Ie,Ie=t);Ie!==t;)de.push(Ie),Ie=G,Ve=xr(),r.charCodeAt(G)===44?(ur=m,G++):(ur=t,Ee===0&&Oe(fe)),ur!==t?(Ar=xr(),gt=sn(),gt!==t?(Ve=[Ve,ur,Ar,gt],Ie=Ve):(G=Ie,Ie=t)):(G=Ie,Ie=t);if(Ie=xr(),r.charCodeAt(G)===125?(Ve=f,G++):(Ve=t,Ee===0&&Oe(ve)),Ve!==t){for(ur=[],Ar=Hi();Ar!==t;)ur.push(Ar),Ar=Hi();vr=R,R=FR(ie,de,ur)}else G=R,R=t}else G=R,R=t;else G=R,R=t;return R}function lF(){var R,K,ie,de;if(R=G,K=fF(),K===t&&(K=mF(),K===t&&(K=pF())),K!==t){for(ie=[],de=Hi();de!==t;)ie.push(de),de=Hi();vr=R,R=qR(K,ie)}else G=R,R=t;return R}function fF(){var R,K,ie,de;return R=G,K=Zi(),K===t&&(K=null),r.charCodeAt(G)===100?(ie=l,G++):(ie=t,Ee===0&&Oe(Me)),ie!==t?(de=Zi(),de!==t?(vr=R,R=zR(K,de)):(G=R,R=t)):(G=R,R=t),R}function mF(){var R,K,ie;return R=G,K=Zi(),K===t&&(K=null),r.substr(G,2)===s?(ie=s,G+=2):(ie=t,Ee===0&&Oe(be)),ie!==t?(vr=R,R=PR(K)):(G=R,R=t),R}function pF(){var R,K,ie,de,Ie,Ve;return R=G,K=Zi(),K===t&&(K=null),r.substr(G,2)===o?(ie=o,G+=2):(ie=t,Ee===0&&Oe(xe)),ie!==t?(de=G,r.charCodeAt(G)===46?(Ie=u,G++):(Ie=t,Ee===0&&Oe(Te)),Ie!==t?(V.test(r.charAt(G))?(Ve=r.charAt(G),G++):(Ve=t,Ee===0&&Oe(nr)),Ve!==t?(Ie=[Ie,Ve],de=Ie):(G=de,de=t)):(G=de,de=t),de===t&&(de=null),vr=R,R=UR(K,de)):(G=R,R=t),R}function Hi(){var R;return R=vF(),R===t&&(R=hF(),R===t&&(R=dF(),R===t&&(R=gF(),R===t&&(R=xF(),R===t&&(R=wF(),R===t&&(R=NF(),R===t&&(R=MF(),R===t&&(R=yF(),R===t&&(R=bF()))))))))),R}function vF(){var R,K,ie,de,Ie;return R=G,r.charCodeAt(G)===33?(K=p,G++):(K=t,Ee===0&&Oe(dr)),K!==t?(r.charCodeAt(G)===33?(ie=p,G++):(ie=t,Ee===0&&Oe(dr)),ie===t&&(ie=null),r.charCodeAt(G)===112?(de=v,G++):(de=t,Ee===0&&Oe(fr)),de===t&&(de=null),Ie=ua(),Ie===t&&(Ie=null),vr=R,R=LR(ie,de,Ie)):(G=R,R=t),R}function hF(){var R,K,ie;return R=G,K=ua(),K!==t?(ie=AF(),ie===t&&(ie=null),vr=R,R=kR(K,ie)):(G=R,R=t),R}function dF(){var R,K,ie,de;return R=G,r.charCodeAt(G)===100?(K=l,G++):(K=t,Ee===0&&Oe(Me)),K!==t?(L.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(Gr)),ie===t&&(ie=null),de=Ws(),de!==t?(vr=R,R=VR(ie,de)):(G=R,R=t)):(G=R,R=t),R}function gF(){var R,K,ie,de;return R=G,r.charCodeAt(G)===107?(K=h,G++):(K=t,Ee===0&&Oe(Hr)),K!==t?(L.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(Gr)),ie===t&&(ie=null),de=Ws(),de!==t?(vr=R,R=GR(ie,de)):(G=R,R=t)):(G=R,R=t),R}function yF(){var R,K,ie;return R=G,r.substr(G,3)===b?(K=b,G+=3):(K=t,Ee===0&&Oe(st)),K!==t?(ie=Sn(),ie!==t?(vr=R,R=HR(ie)):(G=R,R=t)):(G=R,R=t),R}function bF(){var R,K,ie;return R=G,r.substr(G,3)===w?(K=w,G+=3):(K=t,Ee===0&&Oe(er)),K!==t?(ie=Sn(),ie!==t?(vr=R,R=ZR(ie)):(G=R,R=t)):(G=R,R=t),R}function xF(){var R,K,ie,de;return R=G,r.charCodeAt(G)===114?(K=N,G++):(K=t,Ee===0&&Oe($t)),K!==t?(r.charCodeAt(G)===111?(ie=d,G++):(ie=t,Ee===0&&Oe(O)),ie===t&&(ie=null),de=ua(),de===t&&(de=null),vr=R,R=JR(ie,de)):(G=R,R=t),R}function wF(){var R,K,ie;return R=G,r.substr(G,2)===y?(K=y,G+=2):(K=t,Ee===0&&Oe(X)),K!==t?(ie=ua(),ie!==t?(vr=R,R=WR(ie)):(G=R,R=t)):(G=R,R=t),R}function NF(){var R,K,ie;return R=G,r.substr(G,2)===x?(K=x,G+=2):(K=t,Ee===0&&Oe(ue)),K!==t?(ie=ua(),ie!==t?(vr=R,R=XR(ie)):(G=R,R=t)):(G=R,R=t),R}function MF(){var R,K,ie;return R=G,r.charCodeAt(G)===115?(K=g,G++):(K=t,Ee===0&&Oe(we)),K!==t?(r.charCodeAt(G)===97?(ie=S,G++):(ie=t,Ee===0&&Oe(ke)),ie===t&&(r.charCodeAt(G)===100?(ie=l,G++):(ie=t,Ee===0&&Oe(Me))),ie===t&&(ie=null),vr=R,R=YR(ie)):(G=R,R=t),R}function AF(){var R,K,ie;return R=G,r.charCodeAt(G)===102?(K=A,G++):(K=t,Ee===0&&Oe(Xe)),K!==t?(ie=ua(),ie!==t?(vr=R,R=QR(ie)):(G=R,R=t)):(G=R,R=t),R}function ua(){var R,K,ie;return R=G,K=SF(),K!==t?(ie=Sn(),ie!==t?(vr=R,R=jR(K,ie)):(G=R,R=t)):(G=R,R=t),R}function SF(){var R;return r.substr(G,2)===E?(R=E,G+=2):(R=t,Ee===0&&Oe(Sr)),R===t&&(r.substr(G,2)===M?(R=M,G+=2):(R=t,Ee===0&&Oe(La)),R===t&&(r.substr(G,2)===B?(R=B,G+=2):(R=t,Ee===0&&Oe(_s)),R===t&&(r.charCodeAt(G)===61?(R=C,G++):(R=t,Ee===0&&Oe(Is)),R===t&&(r.substr(G,2)===_?(R=_,G+=2):(R=t,Ee===0&&Oe(Rs)),R===t&&(r.charCodeAt(G)===62?(R=P,G++):(R=t,Ee===0&&Oe(Fs)),R===t&&(r.charCodeAt(G)===60?(R=I,G++):(R=t,Ee===0&&Oe(qs)))))))),R}function Zi(){var R,K,ie,de,Ie,Ve,ur,Ar,gt,ca;if(R=Ws(),R===t)if(R=G,r.charCodeAt(G)===40?(K=T,G++):(K=t,Ee===0&&Oe(ia)),K!==t){if(xr(),ie=G,de=Sn(),de!==t){if(Ie=[],Ve=G,ur=xr(),Ar=Ji(),Ar!==t?(gt=xr(),ca=Sn(),ca!==t?(ur=[ur,Ar,gt,ca],Ve=ur):(G=Ve,Ve=t)):(G=Ve,Ve=t),Ve!==t)for(;Ve!==t;)Ie.push(Ve),Ve=G,ur=xr(),Ar=Ji(),Ar!==t?(gt=xr(),ca=Sn(),ca!==t?(ur=[ur,Ar,gt,ca],Ve=ur):(G=Ve,Ve=t)):(G=Ve,Ve=t);else Ie=t;Ie!==t?(de=[de,Ie],ie=de):(G=ie,ie=t)}else G=ie,ie=t;ie!==t?(de=xr(),r.charCodeAt(G)===41?(Ie=D,G++):(Ie=t,Ee===0&&Oe(oa)),Ie!==t?(vr=R,R=KR()):(G=R,R=t)):(G=R,R=t)}else G=R,R=t;return R}function sn(){var R,K,ie,de,Ie,Ve,ur,Ar;if(R=G,K=Js(),K!==t){for(ie=[],de=G,Ie=xr(),Ve=Ji(),Ve!==t?(ur=xr(),Ar=Js(),Ar!==t?(Ie=[Ie,Ve,ur,Ar],de=Ie):(G=de,de=t)):(G=de,de=t);de!==t;)ie.push(de),de=G,Ie=xr(),Ve=Ji(),Ve!==t?(ur=xr(),Ar=Js(),Ar!==t?(Ie=[Ie,Ve,ur,Ar],de=Ie):(G=de,de=t)):(G=de,de=t);vr=R,R=eF(K,ie)}else G=R,R=t;return R}function Js(){var R,K,ie,de;return R=EF(),R===t&&(R=lF(),R===t&&(R=Sn(),R===t&&(R=G,r.charCodeAt(G)===40?(K=T,G++):(K=t,Ee===0&&Oe(ia)),K!==t?(xr(),ie=sn(),ie!==t?(xr(),r.charCodeAt(G)===41?(de=D,G++):(de=t,Ee===0&&Oe(oa)),de!==t?(vr=R,R=rF(K,ie,de)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=cF())))),R}function EF(){var R,K,ie,de,Ie,Ve,ur;return R=G,r.substr(G,3)===Z?(K=Z,G+=3):(K=t,Ee===0&&Oe(zs)),K===t&&(r.substr(G,4)===$?(K=$,G+=4):(K=t,Ee===0&&Oe(Ps)),K===t&&(r.substr(G,3)===H?(K=H,G+=3):(K=t,Ee===0&&Oe(Us)),K===t&&(r.substr(G,3)===Q?(K=Q,G+=3):(K=t,Ee===0&&Oe(Ls)),K===t&&(r.substr(G,5)===te?(K=te,G+=5):(K=t,Ee===0&&Oe(ks)),K===t&&(r.substr(G,3)===J?(K=J,G+=3):(K=t,Ee===0&&Oe(Vs)),K===t&&(r.substr(G,5)===re?(K=re,G+=5):(K=t,Ee===0&&Oe(Gs)),K===t&&(r.substr(G,4)===oe?(K=oe,G+=4):(K=t,Ee===0&&Oe(ka)),K===t&&(r.substr(G,3)===ae?(K=ae,G+=3):(K=t,Ee===0&&Oe(pr)),K===t&&(r.substr(G,4)===ce?(K=ce,G+=4):(K=t,Ee===0&&Oe(Tr)),K===t&&(r.substr(G,3)===se?(K=se,G+=3):(K=t,Ee===0&&Oe(ut)))))))))))),K!==t?(r.charCodeAt(G)===40?(ie=T,G++):(ie=t,Ee===0&&Oe(ia)),ie!==t?(xr(),de=sn(),de!==t?(xr(),r.charCodeAt(G)===41?(Ie=D,G++):(Ie=t,Ee===0&&Oe(oa)),Ie!==t?(vr=R,R=tF(K,de)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,r.substr(G,3)===me?(K=me,G+=3):(K=t,Ee===0&&Oe(ER)),K===t&&(r.substr(G,3)===b?(K=b,G+=3):(K=t,Ee===0&&Oe(st)),K===t&&(r.substr(G,3)===w?(K=w,G+=3):(K=t,Ee===0&&Oe(er)))),K!==t?(r.charCodeAt(G)===40?(ie=T,G++):(ie=t,Ee===0&&Oe(ia)),ie!==t?(xr(),de=sn(),de!==t?(xr(),r.charCodeAt(G)===44?(Ie=m,G++):(Ie=t,Ee===0&&Oe(fe)),Ie!==t?(xr(),Ve=sn(),Ve!==t?(xr(),r.charCodeAt(G)===41?(ur=D,G++):(ur=t,Ee===0&&Oe(oa)),ur!==t?(vr=R,R=nF(K,de,Ve)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)),R}function Sn(){var R,K,ie,de,Ie;return R=G,r.charCodeAt(G)===45?G++:Ee===0&&Oe(jh),K=ad(),K!==t?(ie=G,j.test(r.charAt(G))?(de=r.charAt(G),G++):(de=t,Ee===0&&Oe(CR)),de!==t?(Ie=ad(),Ie!==t?(de=[de,Ie],ie=de):(G=ie,ie=t)):(G=ie,ie=t),ie===t&&(ie=null),vr=R,R=aF()):(G=R,R=t),R}function Ws(){var R,K,ie,de;if(R=G,F.test(r.charAt(G))?(K=r.charAt(G),G++):(K=t,Ee===0&&Oe(OR)),K!==t){for(ie=[],U.test(r.charAt(G))?(de=r.charAt(G),G++):(de=t,Ee===0&&Oe(ki));de!==t;)ie.push(de),U.test(r.charAt(G))?(de=r.charAt(G),G++):(de=t,Ee===0&&Oe(ki));vr=R,R=ed()}else G=R,R=t;return R}function ad(){var R,K,ie;if(R=G,K=[],U.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(ki)),ie!==t)for(;ie!==t;)K.push(ie),U.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(ki));else K=t;return K!==t&&(vr=R,K=ed()),R=K,R}function Ji(){var R,K;return R=G,r.substr(G,2)===Ae?(K=Ae,G+=2):(K=t,Ee===0&&Oe($R)),K!==t&&(vr=R,K=iF()),R=K,R===t&&(r.charCodeAt(G)===42?(R=Ce,G++):(R=t,Ee===0&&Oe(TR)),R===t&&(r.charCodeAt(G)===94?(R=ge,G++):(R=t,Ee===0&&Oe(DR)),R===t&&(r.charCodeAt(G)===37?(R=Se,G++):(R=t,Ee===0&&Oe(BR)),R===t&&(r.charCodeAt(G)===47?(R=z,G++):(R=t,Ee===0&&Oe(_R)),R===t&&(r.charCodeAt(G)===43?(R=Y,G++):(R=t,Ee===0&&Oe(IR)),R===t&&(r.charCodeAt(G)===45?(R=ne,G++):(R=t,Ee===0&&Oe(jh)))))))),R}function xr(){var R,K;for(Ee++,R=[],ee.test(r.charAt(G))?(K=r.charAt(G),G++):(K=t,Ee===0&&Oe(Kh));K!==t;)R.push(K),ee.test(r.charAt(G))?(K=r.charAt(G),G++):(K=t,Ee===0&&Oe(Kh));return Ee--,K=t,Ee===0&&Oe(RR),R}if(Gi=i(),Gi!==t&&G===r.length)return Gi;throw Gi!==t&&G<r.length&&Oe(oF()),uF(Hs,Tt<r.length?r.charAt(Tt):null,Tt<r.length?td(Tt,Tt+1):td(Tt,Tt))}class Jh{static parse(e){if(!e)throw new Ct("notation");if(typeof e!="string")throw new TypeError("Notation must be a string");return eR(e)}}const ta=Object.freeze({BASE_64:1,JSON:0,OBJECT:2}),Os=Symbol("notation"),$s=Symbol("maxTotal"),Ts=Symbol("minTotal"),na=Symbol("expressions"),Pi=Symbol("roll-method"),on=Symbol("rolls"),Wh=Symbol("set-rolls"),Ui=Symbol("total"),Ds=r=>lI(r.calculationValue,2);class Ua{constructor(e){if(!e)throw new Ct("notation");if(this[na]=[],e instanceof Object&&!Array.isArray(e)){if(e.notation){if(typeof e.notation!="string")throw new _i(e.notation);e.rolls&&this[Wh](e.rolls)}else throw new Ct("notation");this[Os]=e.notation,this[na]=Jh.parse(this.notation),this.hasRolls()||this.roll()}else if(typeof e=="string")this[Os]=e,this[na]=Jh.parse(this.notation),this.roll();else throw new _i(e)}get averageTotal(){return(this.maxTotal+this.minTotal)/2}get maxTotal(){if(!this.hasExpressions())return 0;if(!this[$s]){const e=this[Pi](Nh.max);this[$s]=Ds(e)}return this[$s]}get minTotal(){if(!this.hasExpressions())return 0;if(!this[Ts]){const e=this[Pi](Nh.min);this[Ts]=Ds(e)}return this[Ts]}get notation(){return this[Os]}get output(){let e=`${this.notation}: `;return this.hasRolls()?e+=`${this[on]} = ${this.total}`:e+="No dice rolled",e}get rolls(){return this[on]?this[on].results:[]}get total(){return!this[Ui]&&this.hasRolls()&&(this[Ui]=Ds(this[on])),this[Ui]||0}export(e=ta.JSON){switch(e){case ta.BASE_64:return btoa(this.export(ta.JSON));case ta.JSON:return JSON.stringify(this);case ta.OBJECT:return JSON.parse(this.export(ta.JSON));default:throw new TypeError(`Invalid export format "${e}"`)}}hasExpressions(){return this[na]&&this[na].length>0}hasRolls(){return this.hasExpressions()&&this.rolls.length>0}roll(){return this[Ui]=0,this[on]=this[Pi](),this.rolls}toJSON(){const{averageTotal:e,maxTotal:t,minTotal:a,notation:n,output:i,rolls:c,total:m}=this;return{averageTotal:e,maxTotal:t,minTotal:a,notation:n,output:i,rolls:c,total:m,type:"dice-roll"}}toString(){return this.output}static import(e){if(e){if(jI(e))return Ua.import(JSON.parse(e));if(QI(e))return Ua.import(atob(e));if(typeof e=="object")return new Ua(e);throw new es(e)}else throw new Ct("data")}[Pi](e){let t;e&&(t=Kn.engine,Kn.engine=e);const a=new Ir(this[na].map(n=>n instanceof ea||n instanceof Zh?n.roll():n).filter(n=>!!n||n===0));return e&&(Kn.engine=t),a}[Wh](e){if(e instanceof Ir)this[on]=e;else if(e instanceof Gt)this[on]=new Ir([e]);else if(Array.isArray(e))this[on]=new Ir(e.map(t=>{if(t instanceof Ir||t instanceof Gt)return t;if(Array.isArray(t))return new Gt(t);if(typeof t=="object"){if(Array.isArray(t.results))return new Ir(t.results,t.modifiers||[],t.isRollGroup||!1,typeof t.useInTotal=="boolean"?t.useInTotal:!0);if(Array.isArray(t.rolls))return new Gt(t.rolls)}return t}));else throw new TypeError("Rolls must be a valid result object, or an array")}}const Li={__name:"DiceRollerRenderless",props:{notation:String},emits:["notation:change","roll"],setup(r,{emit:e}){const t=r,a=he.ref(`${t.notation||""}`),n=he.ref(null),i=he.ref(null),c=async()=>{n.value=null;try{i.value=a.value?new Ua(he.unref(a)):null}catch(f){i.value=null,f.name==="SyntaxError"?n.value=`Invalid notation; ${f.message}`:n.value=`An error has occurred: ${f.message}`}finally{e("roll",he.unref(a),he.unref(i))}},m=f=>{a.value=f,e("notation:change",f)};return(f,l)=>he.renderSlot(f.$slots,"default",{currentNotation:a.value,error:n.value,output:i.value,roll:c,bind:{value:a.value},on:{input:s=>m(s.target.value),change:s=>m(s.target.value),keyup:s=>s.keyCode===13?c():void 0}})}},rR=()=>(crypto==null?void 0:crypto.randomUUID())||`${Date.now().toString(32)}-${Math.random().toString(36).substring(2)}`;function Bs(r){const e=he.ref(null);return e.value=`${r}${rR()}`,{id:e}}const tR=["id"],nR=["for"],aR=["for"],iR=["id","placeholder"],oR=["onClick"],sR={__name:"DiceRoller",props:{btnLabel:{type:String,default:"Roll"},className:{type:String,default:"dice-roller"},id:String,notation:String},emits:["notation:change","roll"],setup(r){const e=r,{id:t}=Bs(`${e.id||"dice-roller"}-`);return(a,n)=>(he.openBlock(),he.createBlock(Li,{notation:r.notation,"onNotation:change":n[0]||(n[0]=i=>a.$emit("notation:change",i)),onRoll:n[1]||(n[1]=i=>a.$emit("roll",i))},{default:he.withCtx(({error:i,output:c,roll:m,on:f,bind:l})=>[he.createElementVNode("section",{id:r.id,class:he.normalizeClass(r.className)},[c?(he.openBlock(),he.createElementBlock("output",{key:0,name:"output",for:he.unref(t),class:he.normalizeClass(`${r.className}-output`)},he.toDisplayString(c),11,nR)):he.createCommentVNode("",!0),he.createElementVNode("div",{class:he.normalizeClass(`${r.className}-input-group`)},[he.createElementVNode("label",{for:he.unref(t),class:he.normalizeClass(`${r.className}-label`)}," Notation ",10,aR),he.createElementVNode("input",he.mergeProps({type:"text",name:"notation",id:he.unref(t),placeholder:`e.g. ${r.notation||"4d6"}`,class:[`${r.className}-input`,i?`${r.className}-input-invalid`:null]},he.toHandlers(f,!0),l),null,16,iR),he.createElementVNode("button",{type:"button",class:he.normalizeClass(`${r.className}-button`),onClick:m},[he.renderSlot(a.$slots,"button",{},()=>[he.createTextVNode(he.toDisplayString(r.btnLabel),1)])],10,oR)],2),i?(he.openBlock(),he.createElementBlock("span",{key:1,class:he.normalizeClass(`${r.className}-error`)},he.toDisplayString(i),3)):he.createCommentVNode("",!0)],10,tR)]),_:3},8,["notation"]))}},uR=["id"],cR=["for"],lR={class:"flex flex-col sm:flex-row gap-y-4"},fR=["for"],mR=["id","placeholder"],pR=["onClick"],vR={key:1,class:"block mt-4 text-red-600 text-sm dark:text-red-200"},hR={__name:"DiceRollerTailwind",props:{btnLabel:{type:String,default:"Roll"},id:String,notation:String},emits:["notation:change","roll"],setup(r){const e=r,{id:t}=Bs(`${e.id||"dice-roller"}-`);return(a,n)=>(he.openBlock(),he.createBlock(Li,{notation:r.notation,"onNotation:change":n[0]||(n[0]=i=>a.$emit("notation:change",i)),onRoll:n[1]||(n[1]=i=>a.$emit("roll",i))},{default:he.withCtx(({error:i,output:c,roll:m,on:f,bind:l})=>[he.createElementVNode("div",{id:r.id,class:"dice-roller p-4 rounded bg-slate-100 text-gray-800 dark:bg-gray-600 dark:text-gray-200"},[c?(he.openBlock(),he.createElementBlock("output",{key:0,name:"output",for:he.unref(t),class:"block mb-8 p-4 text-2xl rounded bg-white text-black dark:bg-gray-300 dark:text-gray-800 border-l-8 border-[#d4f4c6]"},he.toDisplayString(c),9,cR)):he.createCommentVNode("",!0),he.createElementVNode("div",lR,[he.createElementVNode("label",{for:he.unref(t),class:"sr-only"}," Notation ",8,fR),he.createElementVNode("input",he.mergeProps({type:"text",name:"notation",id:he.unref(t),placeholder:`e.g. ${r.notation||"4d6"}`,class:["flex-auto block w-full h-11 py-2 px-4 text-base border shadow-sm rounded placeholder-gray-500 focus:ring-[#d4f4c6] focus:border-[#d4f4c6] focus:outline-none focus:placeholder-gray-400 dark:focus:placeholder-gray-400 invalid:text-red-600 invalid:border-red-200 invalid:bg-red-50 sm:border-r-0 sm:rounded-r-none",i?"text-red-600 border-red-200 bg-red-50":"bg-white text-gray-900 border-gray-300 dark:text-gray-600 dark:bg-gray-50 dark:border-gray-700"]},he.toHandlers(f,!0),l),null,16,mR),he.createElementVNode("button",{type:"button",class:"block px-8 h-11 font-bold text-gray-600 bg-gradient-to-br from-[#eda18b] to-[#d4f4c6] border border-l-0 border-gray-300 rounded transition dark:border-gray-700 focus:from-[#e88c71] focus:to-[#bbf0a3] focus:text-gray-800 focus:ring-[#d4f4c6] focus:border-[#d4f4c6] focus:outline-none hover:from-[#e88c71] hover:to-[#bbf0a3] hover:text-gray-800 sm:rounded-l-none",onClick:m},[he.renderSlot(a.$slots,"button",{},()=>[he.createTextVNode(he.toDisplayString(r.btnLabel),1)])],8,pR)]),i?(he.openBlock(),he.createElementBlock("span",vR,he.toDisplayString(i),1)):he.createCommentVNode("",!0)],8,uR)]),_:3},8,["notation"]))}},dR=["id"],gR={class:"card-body"},yR=["for"],bR=["for"],xR={class:"input-group"},wR=["id","placeholder"],NR=["onClick"],MR={key:1,class:"d-block mt-3 invalid-feedback"},aa=["primary","secondary","success","danger","warning","info","light","dark"],Xh=[...aa,"body","white","transparent"],Yh=[...aa,"body","muted","white","black-50","white-50"],AR=[...aa,"link","outline-primary","outline-secondary","outline-success","outline-danger","outline-warning","outline-info","outline-light","outline-dark"],Qh=[...aa,"white"],SR={__name:"DiceRollerBootstrap",props:{bgVariant:{type:String,validator(r){return Xh.includes(r)}},borderVariant:{type:String,validator(r){return Qh.includes(r)}},btnLabel:{type:String,default:"Roll"},btnVariant:{type:String,default:"primary",validator(r){return AR.includes(r)}},id:String,notation:String,outputBgVariant:{type:String,validator(r){return Xh.includes(r)}},outputBorderVariant:{type:String,validator(r){return Qh.includes(r)}},outputTextVariant:{type:String,validator(r){return Yh.includes(r)}},outputVariant:{type:String,validator(r){return aa.includes(r)}},textVariant:{type:String,validator(r){return Yh.includes(r)}},variant:{type:String,validator(r){return aa.includes(r)}}},emits:["notation:change","roll"],setup(r){const e=r,t=he.computed(()=>({[`text-bg-${e.variant}`]:e.variant,[`bg-${e.bgVariant}`]:e.bgVariant,[`text-${e.textVariant}`]:e.textVariant,[`border-${e.borderVariant}`]:e.borderVariant})),a=he.computed(()=>({[`text-bg-${e.outputVariant}`]:e.outputVariant,[`bg-${e.outputBgVariant}`]:e.outputBgVariant,[`text-${e.outputTextVariant}`]:e.outputTextVariant,[`border-${e.outputBorderVariant}`]:e.outputBorderVariant})),n=he.computed(()=>`btn-${e.btnVariant||"primary"}`),{id:i}=Bs(`${e.id||"dice-roller"}-`);return(c,m)=>(he.openBlock(),he.createBlock(Li,{notation:r.notation,"onNotation:change":m[0]||(m[0]=f=>c.$emit("notation:change",f)),onRoll:m[1]||(m[1]=f=>c.$emit("roll",f))},{default:he.withCtx(({error:f,output:l,roll:s,on:o,bind:u})=>[he.createElementVNode("div",{id:r.id,class:he.normalizeClass(["dice-roller card",he.unref(t)])},[he.createElementVNode("div",gR,[l?(he.openBlock(),he.createElementBlock("output",{key:0,name:"output",for:he.unref(i),class:he.normalizeClass(["d-block mb-4 p-3 fs-4 rounded border",he.unref(a)])},he.toDisplayString(l),11,yR)):he.createCommentVNode("",!0),he.createElementVNode("label",{for:he.unref(i),class:"form-label visually-hidden"}," Notation ",8,bR),he.createElementVNode("div",xR,[he.createElementVNode("input",he.mergeProps({type:"text",name:"notation",id:he.unref(i),placeholder:`e.g. ${r.notation||"4d6"}`,class:["form-control",f?"is-invalid":""]},he.toHandlers(o,!0),u),null,16,wR),he.createElementVNode("button",{type:"button",class:he.normalizeClass(["btn",he.unref(n)]),onClick:s},[he.renderSlot(c.$slots,"button",{},()=>[he.createTextVNode(he.toDisplayString(r.btnLabel),1)])],10,NR)]),f?(he.openBlock(),he.createElementBlock("span",MR,he.toDisplayString(f),1)):he.createCommentVNode("",!0)])],10,dR)]),_:3},8,["notation"]))}};yt.DiceRoller=sR,yt.DiceRollerBootstrap=SR,yt.DiceRollerRenderless=Li,yt.DiceRollerTailwind=hR,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
82
|
+
at `+i}return e},ra.buildMessage=function(r,e){var t={literal:function(l){return'"'+n(l.text)+'"'},class:function(l){var s=l.parts.map(function(o){return Array.isArray(o)?i(o[0])+"-"+i(o[1]):i(o)});return"["+(l.inverted?"^":"")+s+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function a(l){return l.charCodeAt(0).toString(16).toUpperCase()}function n(l){return l.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(s){return"\\x0"+a(s)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(s){return"\\x"+a(s)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(s){return"\\x0"+a(s)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(s){return"\\x"+a(s)})}function c(l){return t[l.type](l)}function m(l){var s=l.map(c),o,u;if(s.sort(),s.length>0){for(o=1,u=1;o<s.length;o++)s[o-1]!==s[o]&&(s[u]=s[o],u++);s.length=u}switch(s.length){case 1:return s[0];case 2:return s[0]+" or "+s[1];default:return s.slice(0,-1).join(", ")+", or "+s[s.length-1]}}function f(l){return l?'"'+n(l)+'"':"end of input"}return"Expected "+m(r)+" but "+f(e)+" found."};function eR(r,e){e=e!==void 0?e:{};var t={},a=e.grammarSource,n={Main:nd},i=nd,c="{",m=",",f="}",l="d",s="d%",o="dF",u=".",p="!",v="p",h="k",b="max",w="min",N="r",d="o",y="cs",x="cf",g="s",S="a",A="f",E="!=",M="<=",B=">=",C="=",_="<>",P=">",I="<",T="(",D=")",Z="abs",$="ceil",H="cos",Q="exp",te="floor",J="log",re="round",oe="sign",ae="sin",ce="sqrt",se="tan",me="pow",ne="-",Ae="**",Ce="*",ge="^",Se="%",z="/",Y="+",V=/^[12]/,L=/^[lh]/,j=/^[.]/,F=/^[1-9]/,U=/^[0-9]/,ee=/^[ \t\n\r]/,k=Pe("{",!1),fe=Pe(",",!1),ve=Pe("}",!1),Me=Pe("d",!1),be=Pe("d%",!1),xe=Pe("dF",!1),Te=Pe(".",!1),nr=sa(["1","2"],!1,!1),dr=Pe("!",!1),fr=Pe("p",!1),Gr=sa(["l","h"],!1,!1),Hr=Pe("k",!1),st=Pe("max",!1),er=Pe("min",!1),$t=Pe("r",!1),O=Pe("o",!1),X=Pe("cs",!1),ue=Pe("cf",!1),we=Pe("s",!1),ke=Pe("a",!1),Xe=Pe("f",!1),Sr=Pe("!=",!1),La=Pe("<=",!1),_s=Pe(">=",!1),Is=Pe("=",!1),Rs=Pe("<>",!1),Fs=Pe(">",!1),qs=Pe("<",!1),ia=Pe("(",!1),oa=Pe(")",!1),zs=Pe("abs",!1),Ps=Pe("ceil",!1),Us=Pe("cos",!1),Ls=Pe("exp",!1),ks=Pe("floor",!1),Vs=Pe("log",!1),Gs=Pe("round",!1),ka=Pe("sign",!1),pr=Pe("sin",!1),Tr=Pe("sqrt",!1),ut=Pe("tan",!1),CR=Pe("pow",!1),jh=Pe("-",!1),OR=sa(["."],!1,!1),$R=sa([["1","9"]],!1,!1),ki=sa([["0","9"]],!1,!1),TR=Pe("**",!1),DR=Pe("*",!1),BR=Pe("^",!1),_R=Pe("%",!1),IR=Pe("/",!1),RR=Pe("+",!1),FR=uF("whitespace"),Kh=sa([" "," ",`
|
|
83
|
+
`,"\r"],!1,!1),qR=function(R,K,ie){return new Zh([R,...K.map(de=>de[3])],Object.assign({},...ie.map(de=>({[de.name]:de}))))},zR=function(R,K){return R.modifiers=Object.assign({},...K.map(ie=>({[ie.name]:ie}))),R},PR=function(R,K){return new ea(K,R||1)},UR=function(R){return new VI(R||1)},LR=function(R,K){return new kI(K?parseInt(K[1],10):2,R||1)},kR=function(R,K,ie){return new Oh(ie,!!R,!!K)},VR=function(R,K){return new YI(R,K)},GR=function(R,K){return new ZI(R||"l",K)},HR=function(R,K){return new Lh(R||"h",K)},ZR=function(R){return new JI(R)},JR=function(R){return new WI(R)},WR=function(R,K){return new Bh(!!R,K)},XR=function(R){return new HI(R)},YR=function(R){return new GI(R)},QR=function(R){return new XI(R||"a")},jR=function(R){return R},KR=function(R,K){return new qa(R,K)},eF=function(R,K,ie){return uh(Zs())},rF=function(R,K){return R=Array.isArray(R)?R:[R],[...R,...K.map(([,ie,,de])=>[ie,de]).flat(2)]},tF=function(R,K,ie){return[R,...K,ie]},nF=function(R,K){return[`${R}(`,...K,")"]},aF=function(R,K,ie){return[`${R}(`,...K,",",...ie,")"]},iF=function(){return parseFloat(Zs())},ed=function(){return parseInt(Zs(),10)},oF=function(){return"^"},G=0,vr=0,Vi=[{line:1,column:1}],Tt=0,Hs=[],Ee=0,Gi;if("startRule"in e){if(!(e.startRule in n))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');i=n[e.startRule]}function Zs(){return r.substring(vr,G)}function Pe(R,K){return{type:"literal",text:R,ignoreCase:K}}function sa(R,K,ie){return{type:"class",parts:R,inverted:K,ignoreCase:ie}}function sF(){return{type:"end"}}function uF(R){return{type:"other",description:R}}function rd(R){var K=Vi[R],ie;if(K)return K;for(ie=R-1;!Vi[ie];)ie--;for(K=Vi[ie],K={line:K.line,column:K.column};ie<R;)r.charCodeAt(ie)===10?(K.line++,K.column=1):K.column++,ie++;return Vi[R]=K,K}function td(R,K){var ie=rd(R),de=rd(K);return{source:a,start:{offset:R,line:ie.line,column:ie.column},end:{offset:K,line:de.line,column:de.column}}}function Oe(R){G<Tt||(G>Tt&&(Tt=G,Hs=[]),Hs.push(R))}function cF(R,K,ie){return new ra(ra.buildMessage(R,K),R,K,ie)}function nd(){var R;return R=sn(),R}function lF(){var R,K,ie,de,Ie,Ve,ur,Ar,gt;if(R=G,r.charCodeAt(G)===123?(K=c,G++):(K=t,Ee===0&&Oe(k)),K!==t)if(xr(),ie=sn(),ie!==t){for(de=[],Ie=G,Ve=xr(),r.charCodeAt(G)===44?(ur=m,G++):(ur=t,Ee===0&&Oe(fe)),ur!==t?(Ar=xr(),gt=sn(),gt!==t?(Ve=[Ve,ur,Ar,gt],Ie=Ve):(G=Ie,Ie=t)):(G=Ie,Ie=t);Ie!==t;)de.push(Ie),Ie=G,Ve=xr(),r.charCodeAt(G)===44?(ur=m,G++):(ur=t,Ee===0&&Oe(fe)),ur!==t?(Ar=xr(),gt=sn(),gt!==t?(Ve=[Ve,ur,Ar,gt],Ie=Ve):(G=Ie,Ie=t)):(G=Ie,Ie=t);if(Ie=xr(),r.charCodeAt(G)===125?(Ve=f,G++):(Ve=t,Ee===0&&Oe(ve)),Ve!==t){for(ur=[],Ar=Hi();Ar!==t;)ur.push(Ar),Ar=Hi();vr=R,R=qR(ie,de,ur)}else G=R,R=t}else G=R,R=t;else G=R,R=t;return R}function fF(){var R,K,ie,de;if(R=G,K=mF(),K===t&&(K=pF(),K===t&&(K=vF())),K!==t){for(ie=[],de=Hi();de!==t;)ie.push(de),de=Hi();vr=R,R=zR(K,ie)}else G=R,R=t;return R}function mF(){var R,K,ie,de;return R=G,K=Zi(),K===t&&(K=null),r.charCodeAt(G)===100?(ie=l,G++):(ie=t,Ee===0&&Oe(Me)),ie!==t?(de=Zi(),de!==t?(vr=R,R=PR(K,de)):(G=R,R=t)):(G=R,R=t),R}function pF(){var R,K,ie;return R=G,K=Zi(),K===t&&(K=null),r.substr(G,2)===s?(ie=s,G+=2):(ie=t,Ee===0&&Oe(be)),ie!==t?(vr=R,R=UR(K)):(G=R,R=t),R}function vF(){var R,K,ie,de,Ie,Ve;return R=G,K=Zi(),K===t&&(K=null),r.substr(G,2)===o?(ie=o,G+=2):(ie=t,Ee===0&&Oe(xe)),ie!==t?(de=G,r.charCodeAt(G)===46?(Ie=u,G++):(Ie=t,Ee===0&&Oe(Te)),Ie!==t?(V.test(r.charAt(G))?(Ve=r.charAt(G),G++):(Ve=t,Ee===0&&Oe(nr)),Ve!==t?(Ie=[Ie,Ve],de=Ie):(G=de,de=t)):(G=de,de=t),de===t&&(de=null),vr=R,R=LR(K,de)):(G=R,R=t),R}function Hi(){var R;return R=hF(),R===t&&(R=dF(),R===t&&(R=gF(),R===t&&(R=yF(),R===t&&(R=wF(),R===t&&(R=NF(),R===t&&(R=MF(),R===t&&(R=AF(),R===t&&(R=bF(),R===t&&(R=xF()))))))))),R}function hF(){var R,K,ie,de,Ie;return R=G,r.charCodeAt(G)===33?(K=p,G++):(K=t,Ee===0&&Oe(dr)),K!==t?(r.charCodeAt(G)===33?(ie=p,G++):(ie=t,Ee===0&&Oe(dr)),ie===t&&(ie=null),r.charCodeAt(G)===112?(de=v,G++):(de=t,Ee===0&&Oe(fr)),de===t&&(de=null),Ie=ua(),Ie===t&&(Ie=null),vr=R,R=kR(ie,de,Ie)):(G=R,R=t),R}function dF(){var R,K,ie;return R=G,K=ua(),K!==t?(ie=SF(),ie===t&&(ie=null),vr=R,R=VR(K,ie)):(G=R,R=t),R}function gF(){var R,K,ie,de;return R=G,r.charCodeAt(G)===100?(K=l,G++):(K=t,Ee===0&&Oe(Me)),K!==t?(L.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(Gr)),ie===t&&(ie=null),de=Ws(),de!==t?(vr=R,R=GR(ie,de)):(G=R,R=t)):(G=R,R=t),R}function yF(){var R,K,ie,de;return R=G,r.charCodeAt(G)===107?(K=h,G++):(K=t,Ee===0&&Oe(Hr)),K!==t?(L.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(Gr)),ie===t&&(ie=null),de=Ws(),de!==t?(vr=R,R=HR(ie,de)):(G=R,R=t)):(G=R,R=t),R}function bF(){var R,K,ie;return R=G,r.substr(G,3)===b?(K=b,G+=3):(K=t,Ee===0&&Oe(st)),K!==t?(ie=Sn(),ie!==t?(vr=R,R=ZR(ie)):(G=R,R=t)):(G=R,R=t),R}function xF(){var R,K,ie;return R=G,r.substr(G,3)===w?(K=w,G+=3):(K=t,Ee===0&&Oe(er)),K!==t?(ie=Sn(),ie!==t?(vr=R,R=JR(ie)):(G=R,R=t)):(G=R,R=t),R}function wF(){var R,K,ie,de;return R=G,r.charCodeAt(G)===114?(K=N,G++):(K=t,Ee===0&&Oe($t)),K!==t?(r.charCodeAt(G)===111?(ie=d,G++):(ie=t,Ee===0&&Oe(O)),ie===t&&(ie=null),de=ua(),de===t&&(de=null),vr=R,R=WR(ie,de)):(G=R,R=t),R}function NF(){var R,K,ie;return R=G,r.substr(G,2)===y?(K=y,G+=2):(K=t,Ee===0&&Oe(X)),K!==t?(ie=ua(),ie!==t?(vr=R,R=XR(ie)):(G=R,R=t)):(G=R,R=t),R}function MF(){var R,K,ie;return R=G,r.substr(G,2)===x?(K=x,G+=2):(K=t,Ee===0&&Oe(ue)),K!==t?(ie=ua(),ie!==t?(vr=R,R=YR(ie)):(G=R,R=t)):(G=R,R=t),R}function AF(){var R,K,ie;return R=G,r.charCodeAt(G)===115?(K=g,G++):(K=t,Ee===0&&Oe(we)),K!==t?(r.charCodeAt(G)===97?(ie=S,G++):(ie=t,Ee===0&&Oe(ke)),ie===t&&(r.charCodeAt(G)===100?(ie=l,G++):(ie=t,Ee===0&&Oe(Me))),ie===t&&(ie=null),vr=R,R=QR(ie)):(G=R,R=t),R}function SF(){var R,K,ie;return R=G,r.charCodeAt(G)===102?(K=A,G++):(K=t,Ee===0&&Oe(Xe)),K!==t?(ie=ua(),ie!==t?(vr=R,R=jR(ie)):(G=R,R=t)):(G=R,R=t),R}function ua(){var R,K,ie;return R=G,K=EF(),K!==t?(ie=Sn(),ie!==t?(vr=R,R=KR(K,ie)):(G=R,R=t)):(G=R,R=t),R}function EF(){var R;return r.substr(G,2)===E?(R=E,G+=2):(R=t,Ee===0&&Oe(Sr)),R===t&&(r.substr(G,2)===M?(R=M,G+=2):(R=t,Ee===0&&Oe(La)),R===t&&(r.substr(G,2)===B?(R=B,G+=2):(R=t,Ee===0&&Oe(_s)),R===t&&(r.charCodeAt(G)===61?(R=C,G++):(R=t,Ee===0&&Oe(Is)),R===t&&(r.substr(G,2)===_?(R=_,G+=2):(R=t,Ee===0&&Oe(Rs)),R===t&&(r.charCodeAt(G)===62?(R=P,G++):(R=t,Ee===0&&Oe(Fs)),R===t&&(r.charCodeAt(G)===60?(R=I,G++):(R=t,Ee===0&&Oe(qs)))))))),R}function Zi(){var R,K,ie,de,Ie,Ve,ur,Ar,gt,ca;if(R=Ws(),R===t)if(R=G,r.charCodeAt(G)===40?(K=T,G++):(K=t,Ee===0&&Oe(ia)),K!==t){if(xr(),ie=G,de=Sn(),de!==t){if(Ie=[],Ve=G,ur=xr(),Ar=Ji(),Ar!==t?(gt=xr(),ca=Sn(),ca!==t?(ur=[ur,Ar,gt,ca],Ve=ur):(G=Ve,Ve=t)):(G=Ve,Ve=t),Ve!==t)for(;Ve!==t;)Ie.push(Ve),Ve=G,ur=xr(),Ar=Ji(),Ar!==t?(gt=xr(),ca=Sn(),ca!==t?(ur=[ur,Ar,gt,ca],Ve=ur):(G=Ve,Ve=t)):(G=Ve,Ve=t);else Ie=t;Ie!==t?(de=[de,Ie],ie=de):(G=ie,ie=t)}else G=ie,ie=t;ie!==t?(de=xr(),r.charCodeAt(G)===41?(Ie=D,G++):(Ie=t,Ee===0&&Oe(oa)),Ie!==t?(vr=R,R=eF()):(G=R,R=t)):(G=R,R=t)}else G=R,R=t;return R}function sn(){var R,K,ie,de,Ie,Ve,ur,Ar;if(R=G,K=Js(),K!==t){for(ie=[],de=G,Ie=xr(),Ve=Ji(),Ve!==t?(ur=xr(),Ar=Js(),Ar!==t?(Ie=[Ie,Ve,ur,Ar],de=Ie):(G=de,de=t)):(G=de,de=t);de!==t;)ie.push(de),de=G,Ie=xr(),Ve=Ji(),Ve!==t?(ur=xr(),Ar=Js(),Ar!==t?(Ie=[Ie,Ve,ur,Ar],de=Ie):(G=de,de=t)):(G=de,de=t);vr=R,R=rF(K,ie)}else G=R,R=t;return R}function Js(){var R,K,ie,de;return R=CF(),R===t&&(R=fF(),R===t&&(R=Sn(),R===t&&(R=G,r.charCodeAt(G)===40?(K=T,G++):(K=t,Ee===0&&Oe(ia)),K!==t?(xr(),ie=sn(),ie!==t?(xr(),r.charCodeAt(G)===41?(de=D,G++):(de=t,Ee===0&&Oe(oa)),de!==t?(vr=R,R=tF(K,ie,de)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=lF())))),R}function CF(){var R,K,ie,de,Ie,Ve,ur;return R=G,r.substr(G,3)===Z?(K=Z,G+=3):(K=t,Ee===0&&Oe(zs)),K===t&&(r.substr(G,4)===$?(K=$,G+=4):(K=t,Ee===0&&Oe(Ps)),K===t&&(r.substr(G,3)===H?(K=H,G+=3):(K=t,Ee===0&&Oe(Us)),K===t&&(r.substr(G,3)===Q?(K=Q,G+=3):(K=t,Ee===0&&Oe(Ls)),K===t&&(r.substr(G,5)===te?(K=te,G+=5):(K=t,Ee===0&&Oe(ks)),K===t&&(r.substr(G,3)===J?(K=J,G+=3):(K=t,Ee===0&&Oe(Vs)),K===t&&(r.substr(G,5)===re?(K=re,G+=5):(K=t,Ee===0&&Oe(Gs)),K===t&&(r.substr(G,4)===oe?(K=oe,G+=4):(K=t,Ee===0&&Oe(ka)),K===t&&(r.substr(G,3)===ae?(K=ae,G+=3):(K=t,Ee===0&&Oe(pr)),K===t&&(r.substr(G,4)===ce?(K=ce,G+=4):(K=t,Ee===0&&Oe(Tr)),K===t&&(r.substr(G,3)===se?(K=se,G+=3):(K=t,Ee===0&&Oe(ut)))))))))))),K!==t?(r.charCodeAt(G)===40?(ie=T,G++):(ie=t,Ee===0&&Oe(ia)),ie!==t?(xr(),de=sn(),de!==t?(xr(),r.charCodeAt(G)===41?(Ie=D,G++):(Ie=t,Ee===0&&Oe(oa)),Ie!==t?(vr=R,R=nF(K,de)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,r.substr(G,3)===me?(K=me,G+=3):(K=t,Ee===0&&Oe(CR)),K===t&&(r.substr(G,3)===b?(K=b,G+=3):(K=t,Ee===0&&Oe(st)),K===t&&(r.substr(G,3)===w?(K=w,G+=3):(K=t,Ee===0&&Oe(er)))),K!==t?(r.charCodeAt(G)===40?(ie=T,G++):(ie=t,Ee===0&&Oe(ia)),ie!==t?(xr(),de=sn(),de!==t?(xr(),r.charCodeAt(G)===44?(Ie=m,G++):(Ie=t,Ee===0&&Oe(fe)),Ie!==t?(xr(),Ve=sn(),Ve!==t?(xr(),r.charCodeAt(G)===41?(ur=D,G++):(ur=t,Ee===0&&Oe(oa)),ur!==t?(vr=R,R=aF(K,de,Ve)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)),R}function Sn(){var R,K,ie,de,Ie;return R=G,r.charCodeAt(G)===45?G++:Ee===0&&Oe(jh),K=ad(),K!==t?(ie=G,j.test(r.charAt(G))?(de=r.charAt(G),G++):(de=t,Ee===0&&Oe(OR)),de!==t?(Ie=ad(),Ie!==t?(de=[de,Ie],ie=de):(G=ie,ie=t)):(G=ie,ie=t),ie===t&&(ie=null),vr=R,R=iF()):(G=R,R=t),R}function Ws(){var R,K,ie,de;if(R=G,F.test(r.charAt(G))?(K=r.charAt(G),G++):(K=t,Ee===0&&Oe($R)),K!==t){for(ie=[],U.test(r.charAt(G))?(de=r.charAt(G),G++):(de=t,Ee===0&&Oe(ki));de!==t;)ie.push(de),U.test(r.charAt(G))?(de=r.charAt(G),G++):(de=t,Ee===0&&Oe(ki));vr=R,R=ed()}else G=R,R=t;return R}function ad(){var R,K,ie;if(R=G,K=[],U.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(ki)),ie!==t)for(;ie!==t;)K.push(ie),U.test(r.charAt(G))?(ie=r.charAt(G),G++):(ie=t,Ee===0&&Oe(ki));else K=t;return K!==t&&(vr=R,K=ed()),R=K,R}function Ji(){var R,K;return R=G,r.substr(G,2)===Ae?(K=Ae,G+=2):(K=t,Ee===0&&Oe(TR)),K!==t&&(vr=R,K=oF()),R=K,R===t&&(r.charCodeAt(G)===42?(R=Ce,G++):(R=t,Ee===0&&Oe(DR)),R===t&&(r.charCodeAt(G)===94?(R=ge,G++):(R=t,Ee===0&&Oe(BR)),R===t&&(r.charCodeAt(G)===37?(R=Se,G++):(R=t,Ee===0&&Oe(_R)),R===t&&(r.charCodeAt(G)===47?(R=z,G++):(R=t,Ee===0&&Oe(IR)),R===t&&(r.charCodeAt(G)===43?(R=Y,G++):(R=t,Ee===0&&Oe(RR)),R===t&&(r.charCodeAt(G)===45?(R=ne,G++):(R=t,Ee===0&&Oe(jh)))))))),R}function xr(){var R,K;for(Ee++,R=[],ee.test(r.charAt(G))?(K=r.charAt(G),G++):(K=t,Ee===0&&Oe(Kh));K!==t;)R.push(K),ee.test(r.charAt(G))?(K=r.charAt(G),G++):(K=t,Ee===0&&Oe(Kh));return Ee--,K=t,Ee===0&&Oe(FR),R}if(Gi=i(),Gi!==t&&G===r.length)return Gi;throw Gi!==t&&G<r.length&&Oe(sF()),cF(Hs,Tt<r.length?r.charAt(Tt):null,Tt<r.length?td(Tt,Tt+1):td(Tt,Tt))}class Jh{static parse(e){if(!e)throw new Ct("notation");if(typeof e!="string")throw new TypeError("Notation must be a string");return eR(e)}}const ta=Object.freeze({BASE_64:1,JSON:0,OBJECT:2}),Os=Symbol("notation"),$s=Symbol("maxTotal"),Ts=Symbol("minTotal"),na=Symbol("expressions"),Pi=Symbol("roll-method"),on=Symbol("rolls"),Wh=Symbol("set-rolls"),Ui=Symbol("total"),Ds=r=>lI(r.calculationValue,2);class Ua{constructor(e){if(!e)throw new Ct("notation");if(this[na]=[],e instanceof Object&&!Array.isArray(e)){if(e.notation){if(typeof e.notation!="string")throw new _i(e.notation);e.rolls&&this[Wh](e.rolls)}else throw new Ct("notation");this[Os]=e.notation,this[na]=Jh.parse(this.notation),this.hasRolls()||this.roll()}else if(typeof e=="string")this[Os]=e,this[na]=Jh.parse(this.notation),this.roll();else throw new _i(e)}get averageTotal(){return(this.maxTotal+this.minTotal)/2}get maxTotal(){if(!this.hasExpressions())return 0;if(!this[$s]){const e=this[Pi](Nh.max);this[$s]=Ds(e)}return this[$s]}get minTotal(){if(!this.hasExpressions())return 0;if(!this[Ts]){const e=this[Pi](Nh.min);this[Ts]=Ds(e)}return this[Ts]}get notation(){return this[Os]}get output(){let e=`${this.notation}: `;return this.hasRolls()?e+=`${this[on]} = ${this.total}`:e+="No dice rolled",e}get rolls(){return this[on]?this[on].results:[]}get total(){return!this[Ui]&&this.hasRolls()&&(this[Ui]=Ds(this[on])),this[Ui]||0}export(e=ta.JSON){switch(e){case ta.BASE_64:return btoa(this.export(ta.JSON));case ta.JSON:return JSON.stringify(this);case ta.OBJECT:return JSON.parse(this.export(ta.JSON));default:throw new TypeError(`Invalid export format "${e}"`)}}hasExpressions(){return this[na]&&this[na].length>0}hasRolls(){return this.hasExpressions()&&this.rolls.length>0}roll(){return this[Ui]=0,this[on]=this[Pi](),this.rolls}toJSON(){const{averageTotal:e,maxTotal:t,minTotal:a,notation:n,output:i,rolls:c,total:m}=this;return{averageTotal:e,maxTotal:t,minTotal:a,notation:n,output:i,rolls:c,total:m,type:"dice-roll"}}toString(){return this.output}static import(e){if(e){if(jI(e))return Ua.import(JSON.parse(e));if(QI(e))return Ua.import(atob(e));if(typeof e=="object")return new Ua(e);throw new es(e)}else throw new Ct("data")}[Pi](e){let t;e&&(t=Kn.engine,Kn.engine=e);const a=new Ir(this[na].map(n=>n instanceof ea||n instanceof Zh?n.roll():n).filter(n=>!!n||n===0));return e&&(Kn.engine=t),a}[Wh](e){if(e instanceof Ir)this[on]=e;else if(e instanceof Gt)this[on]=new Ir([e]);else if(Array.isArray(e))this[on]=new Ir(e.map(t=>{if(t instanceof Ir||t instanceof Gt)return t;if(Array.isArray(t))return new Gt(t);if(typeof t=="object"){if(Array.isArray(t.results))return new Ir(t.results,t.modifiers||[],t.isRollGroup||!1,typeof t.useInTotal=="boolean"?t.useInTotal:!0);if(Array.isArray(t.rolls))return new Gt(t.rolls)}return t}));else throw new TypeError("Rolls must be a valid result object, or an array")}}const Li={__name:"DiceRollerRenderless",props:{notation:String},emits:["notation:change","roll"],setup(r,{emit:e}){const t=r,a=he.ref(`${t.notation||""}`),n=he.ref(null),i=he.ref(null),c=async()=>{n.value=null;try{i.value=a.value?new Ua(he.unref(a)):null}catch(f){i.value=null,f.name==="SyntaxError"?n.value=`Invalid notation; ${f.message}`:n.value=`An error has occurred: ${f.message}`}finally{e("roll",he.unref(a),he.unref(i))}},m=f=>{a.value=f,e("notation:change",f)};return(f,l)=>he.renderSlot(f.$slots,"default",{currentNotation:a.value,error:n.value,output:i.value,roll:c,bind:{value:a.value},on:{input:s=>m(s.target.value),change:s=>m(s.target.value),keyup:s=>s.keyCode===13?c():void 0}})}},rR=()=>typeof crypto<"u"&&crypto&&crypto.randomUUID,tR=()=>rR?crypto.randomUUID():`${Date.now().toString(32)}-${Math.random().toString(36).substring(2)}`;function Bs(r){const e=he.ref(null);return e.value=`${r}${tR()}`,{id:e}}const nR=["id"],aR=["for"],iR=["for"],oR=["id","placeholder"],sR=["onClick"],uR={__name:"DiceRoller",props:{btnLabel:{type:String,default:"Roll"},className:{type:String,default:"dice-roller"},id:String,notation:String},emits:["notation:change","roll"],setup(r){const e=r,{id:t}=Bs(`${e.id||"dice-roller"}-`);return(a,n)=>(he.openBlock(),he.createBlock(Li,{notation:r.notation,"onNotation:change":n[0]||(n[0]=i=>a.$emit("notation:change",i)),onRoll:n[1]||(n[1]=i=>a.$emit("roll",i))},{default:he.withCtx(({error:i,output:c,roll:m,on:f,bind:l})=>[he.createElementVNode("section",{id:r.id,class:he.normalizeClass(r.className)},[c?(he.openBlock(),he.createElementBlock("output",{key:0,name:"output",for:he.unref(t),class:he.normalizeClass(`${r.className}-output`)},he.toDisplayString(c),11,aR)):he.createCommentVNode("",!0),he.createElementVNode("div",{class:he.normalizeClass(`${r.className}-input-group`)},[he.createElementVNode("label",{for:he.unref(t),class:he.normalizeClass(`${r.className}-label`)}," Notation ",10,iR),he.createElementVNode("input",he.mergeProps({type:"text",name:"notation",id:he.unref(t),placeholder:`e.g. ${r.notation||"4d6"}`,class:[`${r.className}-input`,i?`${r.className}-input-invalid`:null]},he.toHandlers(f,!0),l),null,16,oR),he.createElementVNode("button",{type:"button",class:he.normalizeClass(`${r.className}-button`),onClick:m},[he.renderSlot(a.$slots,"button",{},()=>[he.createTextVNode(he.toDisplayString(r.btnLabel),1)])],10,sR)],2),i?(he.openBlock(),he.createElementBlock("span",{key:1,class:he.normalizeClass(`${r.className}-error`)},he.toDisplayString(i),3)):he.createCommentVNode("",!0)],10,nR)]),_:3},8,["notation"]))}},cR=["id"],lR=["for"],fR={class:"flex flex-col sm:flex-row gap-y-4"},mR=["for"],pR=["id","placeholder"],vR=["onClick"],hR={key:1,class:"block mt-4 text-red-600 text-sm dark:text-red-200"},dR={__name:"DiceRollerTailwind",props:{btnLabel:{type:String,default:"Roll"},id:String,notation:String},emits:["notation:change","roll"],setup(r){const e=r,{id:t}=Bs(`${e.id||"dice-roller"}-`);return(a,n)=>(he.openBlock(),he.createBlock(Li,{notation:r.notation,"onNotation:change":n[0]||(n[0]=i=>a.$emit("notation:change",i)),onRoll:n[1]||(n[1]=i=>a.$emit("roll",i))},{default:he.withCtx(({error:i,output:c,roll:m,on:f,bind:l})=>[he.createElementVNode("div",{id:r.id,class:"dice-roller p-4 rounded bg-slate-100 text-gray-800 dark:bg-gray-600 dark:text-gray-200"},[c?(he.openBlock(),he.createElementBlock("output",{key:0,name:"output",for:he.unref(t),class:"block mb-8 p-4 text-2xl rounded bg-white text-black dark:bg-gray-300 dark:text-gray-800 border-l-8 border-[#d4f4c6]"},he.toDisplayString(c),9,lR)):he.createCommentVNode("",!0),he.createElementVNode("div",fR,[he.createElementVNode("label",{for:he.unref(t),class:"sr-only"}," Notation ",8,mR),he.createElementVNode("input",he.mergeProps({type:"text",name:"notation",id:he.unref(t),placeholder:`e.g. ${r.notation||"4d6"}`,class:["flex-auto block w-full h-11 py-2 px-4 text-base border shadow-sm rounded placeholder-gray-500 focus:ring-[#d4f4c6] focus:border-[#d4f4c6] focus:outline-none focus:placeholder-gray-400 dark:focus:placeholder-gray-400 invalid:text-red-600 invalid:border-red-200 invalid:bg-red-50 sm:border-r-0 sm:rounded-r-none",i?"text-red-600 border-red-200 bg-red-50":"bg-white text-gray-900 border-gray-300 dark:text-gray-600 dark:bg-gray-50 dark:border-gray-700"]},he.toHandlers(f,!0),l),null,16,pR),he.createElementVNode("button",{type:"button",class:"block px-8 h-11 font-bold text-gray-600 bg-gradient-to-br from-[#eda18b] to-[#d4f4c6] border border-l-0 border-gray-300 rounded transition dark:border-gray-700 focus:from-[#e88c71] focus:to-[#bbf0a3] focus:text-gray-800 focus:ring-[#d4f4c6] focus:border-[#d4f4c6] focus:outline-none hover:from-[#e88c71] hover:to-[#bbf0a3] hover:text-gray-800 sm:rounded-l-none",onClick:m},[he.renderSlot(a.$slots,"button",{},()=>[he.createTextVNode(he.toDisplayString(r.btnLabel),1)])],8,vR)]),i?(he.openBlock(),he.createElementBlock("span",hR,he.toDisplayString(i),1)):he.createCommentVNode("",!0)],8,cR)]),_:3},8,["notation"]))}},gR=["id"],yR={class:"card-body"},bR=["for"],xR=["for"],wR={class:"input-group"},NR=["id","placeholder"],MR=["onClick"],AR={key:1,class:"d-block mt-3 invalid-feedback"},aa=["primary","secondary","success","danger","warning","info","light","dark"],Xh=[...aa,"body","white","transparent"],Yh=[...aa,"body","muted","white","black-50","white-50"],SR=[...aa,"link","outline-primary","outline-secondary","outline-success","outline-danger","outline-warning","outline-info","outline-light","outline-dark"],Qh=[...aa,"white"],ER={__name:"DiceRollerBootstrap",props:{bgVariant:{type:String,validator(r){return Xh.includes(r)}},borderVariant:{type:String,validator(r){return Qh.includes(r)}},btnLabel:{type:String,default:"Roll"},btnVariant:{type:String,default:"primary",validator(r){return SR.includes(r)}},id:String,notation:String,outputBgVariant:{type:String,validator(r){return Xh.includes(r)}},outputBorderVariant:{type:String,validator(r){return Qh.includes(r)}},outputTextVariant:{type:String,validator(r){return Yh.includes(r)}},outputVariant:{type:String,validator(r){return aa.includes(r)}},textVariant:{type:String,validator(r){return Yh.includes(r)}},variant:{type:String,validator(r){return aa.includes(r)}}},emits:["notation:change","roll"],setup(r){const e=r,t=he.computed(()=>({[`text-bg-${e.variant}`]:e.variant,[`bg-${e.bgVariant}`]:e.bgVariant,[`text-${e.textVariant}`]:e.textVariant,[`border-${e.borderVariant}`]:e.borderVariant})),a=he.computed(()=>({[`text-bg-${e.outputVariant}`]:e.outputVariant,[`bg-${e.outputBgVariant}`]:e.outputBgVariant,[`text-${e.outputTextVariant}`]:e.outputTextVariant,[`border-${e.outputBorderVariant}`]:e.outputBorderVariant})),n=he.computed(()=>`btn-${e.btnVariant||"primary"}`),{id:i}=Bs(`${e.id||"dice-roller"}-`);return(c,m)=>(he.openBlock(),he.createBlock(Li,{notation:r.notation,"onNotation:change":m[0]||(m[0]=f=>c.$emit("notation:change",f)),onRoll:m[1]||(m[1]=f=>c.$emit("roll",f))},{default:he.withCtx(({error:f,output:l,roll:s,on:o,bind:u})=>[he.createElementVNode("div",{id:r.id,class:he.normalizeClass(["dice-roller card",he.unref(t)])},[he.createElementVNode("div",yR,[l?(he.openBlock(),he.createElementBlock("output",{key:0,name:"output",for:he.unref(i),class:he.normalizeClass(["d-block mb-4 p-3 fs-4 rounded border",he.unref(a)])},he.toDisplayString(l),11,bR)):he.createCommentVNode("",!0),he.createElementVNode("label",{for:he.unref(i),class:"form-label visually-hidden"}," Notation ",8,xR),he.createElementVNode("div",wR,[he.createElementVNode("input",he.mergeProps({type:"text",name:"notation",id:he.unref(i),placeholder:`e.g. ${r.notation||"4d6"}`,class:["form-control",f?"is-invalid":""]},he.toHandlers(o,!0),u),null,16,NR),he.createElementVNode("button",{type:"button",class:he.normalizeClass(["btn",he.unref(n)]),onClick:s},[he.renderSlot(c.$slots,"button",{},()=>[he.createTextVNode(he.toDisplayString(r.btnLabel),1)])],10,MR)]),f?(he.openBlock(),he.createElementBlock("span",AR,he.toDisplayString(f),1)):he.createCommentVNode("",!0)])],10,gR)]),_:3},8,["notation"]))}};yt.DiceRoller=uR,yt.DiceRollerBootstrap=ER,yt.DiceRollerRenderless=Li,yt.DiceRollerTailwind=dR,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|