@spintax/dice-lite 0.2.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,29 @@ All notable changes to `@spintax/dice-lite`. The version is the contract: same (
4
4
  options) → identical bytes within a minor version; any change to the output bytes is a minor
5
5
  bump.
6
6
 
7
+ ## 0.3.0 — 2026-11-17
8
+
9
+ Every change below alters output bytes; unpinned throws of `dice: 2–4` change only by the
10
+ removed contact shadow.
11
+
12
+ - **Trim:** a neutral colour listed beside chromatic ones (a white, a black, a grey) no
13
+ longer turns the brass to chrome; chrome is for an all-neutral brand only (ADR 004
14
+ addendum).
15
+ - **Results complete the pins:** under `lucky7` a die whose pair partner is pinned shows its
16
+ complement to seven; under `matched` every unpinned die shows the first pinned value. A pin
17
+ is never overwritten (ADR 003 addendum).
18
+ - **`dice: 5`:** the fifth die moves from the centre, where it stood half inside the pair, to
19
+ front-right on a landscape felt; every pair of slots is one cube edge apart on the ground
20
+ (ADR 002 addendum). `dice` still appends.
21
+ - **Shadows:** the contact shadow is drawn only under a glass body — a paper body hid every
22
+ pixel of it (raster subtraction); ~98 B less per paper die. `die()` loses an empty
23
+ `translate(0 0)` wrapper (0 pixels changed).
24
+ - **Docs:** `precision` governs the table and the viewBox, the dice are always one decimal;
25
+ `brand` reads `#hex`/`rgb()` only; output sizes re-measured (ADR 006 addendum).
26
+ - **Gate:** the `pins ignored` mutation was silently skipped since the rail modes; it is
27
+ re-anchored, three mutations and two checks are added, and the precision test can fail now.
28
+ - Library 8572 B gzipped, budget 8704.
29
+
7
30
  ## 0.2.0 — 2026-11-16
8
31
 
9
32
  - The seams finish where the corner rounding starts. Both ends are trimmed — at the nose by
package/README.md CHANGED
@@ -8,7 +8,7 @@ they show), **`brand`** colours the table.
8
8
  The dice are the classic ones — paper bodies, black pips, values one to six — each a rounded
9
9
  cube projected at runtime from its own seeded orientation: three visible faces, exact
10
10
  projected pips, opposite sides summing to seven by construction. A result such as a lucky
11
- seven is a named preset that places values; nothing is ever scored. Zero dependencies, ~7 KB
11
+ seven is a named preset that places values; nothing is ever scored. Zero dependencies, ~8.5 KB
12
12
  minified and gzipped.
13
13
 
14
14
  [![npm](https://img.shields.io/npm/v/@spintax/dice-lite.svg)](https://www.npmjs.com/package/@spintax/dice-lite)
package/dice.d.ts CHANGED
@@ -16,7 +16,7 @@ declare namespace Dice {
16
16
  interface Common {
17
17
  /** A string (a domain name is fine) or a number taken as a 32-bit unsigned integer. */
18
18
  seed?: number | string;
19
- /** hex or hex[]; default the spintax triad. */
19
+ /** `#rgb`/`#rrggbb` or `rgb()` — one or a list; default the spintax triad. Anything else (a named colour, `var()`) reads as white. */
20
20
  brand?: string | string[];
21
21
  /** derived colours only. */
22
22
  theme?: 'dark' | 'light';
@@ -35,7 +35,7 @@ declare namespace Dice {
35
35
  outline?: Pin;
36
36
  /** width; the height follows the viewBox. */
37
37
  size?: number;
38
- /** decimals for coordinates. */
38
+ /** decimals for the table's coordinates and the viewBox; the dice are always one decimal. */
39
39
  precision?: number;
40
40
  /** extra entropy for ids — the same picture twice on one page. */
41
41
  salt?: string;
package/dice.js CHANGED
@@ -16,10 +16,8 @@
16
16
 
17
17
  var NS = 'http://www.w3.org/2000/svg';
18
18
  var DEFAULT_BRAND = ['#00abf3', '#d6af3c', '#a91455'];
19
- // machine space: origin at the centre of the table, y down (spec: Machine space). The
20
- // constants are provisional — looked at on screen at M1/M2 and kept or changed there.
21
- // machine space: origin at the centre of the table, y down. The die is a rounded cube,
22
- // orthographic-baked (ADR 002 addendum); constants tuned to the reference at M1.
19
+ // machine space: origin at the centre of the table, y down (spec: Machine space). The die is
20
+ // a rounded cube, orthographic-baked (ADR 002 addendum); constants tuned to the reference at M1.
23
21
  var H = 100; // the die's half-edge — the cube is 2H on a side
24
22
  var PITCH = 0.91; // camera elevation ≈ 52°
25
23
  var RS = 44, RF = 9; // silhouette rounding / face-quad rounding (projection units)
@@ -186,7 +184,7 @@
186
184
  return { colors: stops, accent: accent, hot: hot, background: bg, halo: halo };
187
185
  }
188
186
 
189
- // ── colour: a casino table from the brand (ADR 004, provisional until M1) ──
187
+ // ── colour: a casino table from the brand (ADR 004 and its addenda) ─────
190
188
 
191
189
  // Dice claim almost no classic hues — the subject is paper and black — so the brand colours
192
190
  // go where a casino table puts them: the felt takes the first chromatic brand colour, the
@@ -217,7 +215,9 @@
217
215
  }
218
216
  if (goldD > 30) goldI = -1; // the window is ±30° around the gold centre
219
217
  var gold = goldI >= 0 ? chrom[goldI].lch : null;
220
- var trim = lch2rgb(66, grey || !chrom.length ? 0 : gold ? gold[1] * 0.5 : 25, gold ? gold[2] : 85);
218
+ // chrome only for an all-neutral brand: a neutral listed beside chromatic colours is
219
+ // ignored here, never a reason to drop the brass (ADR 004 addendum)
220
+ var trim = lch2rgb(66, !chrom.length ? 0 : gold ? gold[1] * 0.5 : 25, gold ? gold[2] : 85);
221
221
  // the dice are the classic: paper in both themes, near-black pips and shadows (cards'
222
222
  // stock/spade/ink formulas, the paper as their contrast reference)
223
223
  var die = lch2rgb(96.5, Math.min(bC * 0.08, 4), bH);
@@ -654,8 +654,10 @@
654
654
  // own every paint, and its d is computed from the yaw, keeping zero-d honest
655
655
  c.defs += el('path', ['id', sid, 'd', sil]) + el('clipPath', ['id', cid], el('use', ['href', '#' + sid]));
656
656
  return {
657
+ // the contact shadow sits wholly under the body: a paper die hides every pixel of it
658
+ // (raster subtraction, 0.3.0), so only the see-through glass draws it
657
659
  shadow: el('ellipse', ['cx', 0, 'cy', 118, 'rx', 132, 'ry', 24, 'fill', c.col('ink'), 'fill-opacity', '.16', 'filter', 'url(#' + d.b14 + ')']) +
658
- el('ellipse', ['cx', 0, 'cy', 112, 'rx', 62, 'ry', 11, 'fill', c.col('ink'), 'fill-opacity', '.18', 'filter', 'url(#' + d.b5 + ')']),
660
+ (glass ? el('ellipse', ['cx', 0, 'cy', 112, 'rx', 62, 'ry', 11, 'fill', c.col('ink'), 'fill-opacity', '.18', 'filter', 'url(#' + d.b5 + ')']) : ''),
659
661
  content: glass
660
662
  ? el('use', ['href', '#' + sid, 'fill', esc(c.dieGlass), 'fill-opacity', '.55', 'stroke', c.col('outline'), 'stroke-width', n(2.6 * c.w, 1)]) +
661
663
  el('g', ['clip-path', 'url(#' + cid + ')'], faces + seams)
@@ -671,17 +673,22 @@
671
673
 
672
674
  // The canonical slots: one nested list — count k takes the first k, so `dice` appends
673
675
  // without moving a die already on the table (values, yaws and placements all hold). The
674
- // pair is the constant core; the triangle, the diamond and the quincunx grow from it.
675
- var SLOTS = [[-1, 0], [1, 0], [0, -1], [0, 1], [0, 0]];
676
+ // pair is the constant core; the triangle and the diamond grow from it, and the fifth die
677
+ // stands front-right — never at the centre, where it stood half inside the pair (ADR 002
678
+ // addendum: every slot is at least one cube edge from the others on the ground)
679
+ var SLOTS = [[-1, 0], [1, 0], [0, -1], [0, 1], [1.65, 1.15]];
676
680
  var RESULTS = ['lucky7', 'snake', 'boxcars', 'matched', 'mixed'];
677
681
  var BELT7 = [[1, 6], [2, 5], [3, 4]];
678
682
 
679
683
  // Results are data (ADR 003): a name places values, nothing is scored. Each result reads
680
- // its own streams; dice it does not name keep the seed's values.
681
- function resultValue(r, i, S, used) {
684
+ // its own streams; dice it does not name keep the seed's values. `vals` holds the pins and
685
+ // the values placed so far: a result completes them, never overwrites them (ADR 003 addendum)
686
+ function resultValue(r, i, S, used, vals) {
682
687
  if (r === 'snake') return i < 2 ? 1 : 0;
683
688
  if (r === 'boxcars') return i < 2 ? 6 : 0;
684
689
  if (r === 'lucky7' && i < 2) {
690
+ // a placed partner — pinned, or drawn just before — is answered by its complement
691
+ if (vals[1 - i]) return 7 - vals[1 - i];
685
692
  // one pair draw for the throw, one swap draw — both dice name it
686
693
  if (!used.l7) {
687
694
  var p = BELT7[Math.floor(S('result:lucky7')() * 3)];
@@ -689,7 +696,11 @@
689
696
  }
690
697
  return used.l7[i];
691
698
  }
692
- if (r === 'matched') return 1 + Math.floor(S('result:matched')() * 6);
699
+ if (r === 'matched') {
700
+ // the first placed value — a pin anywhere, or the first die's draw — is the match
701
+ for (var m = 0; m < vals.length; m++) if (vals[m]) return vals[m];
702
+ return 1 + Math.floor(S('result:matched')() * 6);
703
+ }
693
704
  if (r === 'mixed') {
694
705
  var avail = [];
695
706
  for (var v = 1; v <= 6; v++) if (!used[v]) avail.push(v);
@@ -730,7 +741,7 @@
730
741
  }
731
742
  for (i = 0; i < k; i++) {
732
743
  if (values[i] != null) continue;
733
- if (res) { var rv = resultValue(res, i, S, used); values[i] = rv || seeded(i); }
744
+ if (res) { var rv = resultValue(res, i, S, used, values); values[i] = rv || seeded(i); }
734
745
  else values[i] = seeded(i);
735
746
  }
736
747
  // the roll (ADR 005 + addendum): a settle, off by default. Names from a stream of their
@@ -794,7 +805,7 @@
794
805
  var value = Math.round(o.value) >= 1 && Math.round(o.value) <= 6 ? Math.round(o.value) : 1 + Math.floor(S('die:0:value')() * 6);
795
806
  var yaw = (S('die:0:orient')() < 0.5 ? -1 : 1) * (YAW[0] + YAW[1] * S('die:0:orient:yaw')());
796
807
  var d = die(c, value, yaw);
797
- return wrap(o, c, [-HX, -HY, 2 * HX, 2 * HY + 42], el('g', ['transform', 'translate(0 0)'], d.shadow + d.content));
808
+ return wrap(o, c, [-HX, -HY, 2 * HX, 2 * HY + 42], d.shadow + d.content);
798
809
  }
799
810
 
800
811
  // Browser convenience: draw a throw into an element and keep it drawn. Options merge
package/dice.min.js CHANGED
@@ -7,4 +7,4 @@
7
7
  * The colour engine and the seed machinery are the family's, ported unchanged from cards-lite
8
8
  * (by way of slots-lite); a fixture test pins that they agree.
9
9
  */
10
- !function(t){var r=function(){"use strict";var t="http://www.w3.org/2000/svg",r=["#00abf3","#d6af3c","#a91455"],n=100,e=.91,a=44,o=9,i=19,l=n+2,u=[.36,.08],f=Math.sqrt(3),s=(2-Math.SQRT2)/2,h=[90,64],c=[22,34],v=126,d=.06,p=145,M=176;function g(t,r){var n=Math.pow(10,r||0),e=Math.round(t*n)/n;return String(0===e?0:e)}function m(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function y(t,r,n){for(var e="<"+t,a=0;a<r.length;a+=2)null!=r[a+1]&&(e+=" "+r[a]+'="'+r[a+1]+'"');return null==n?e+"/>":e+">"+n+"</"+t+">"}function b(t){for(var r=2166136261,n=0;n<t.length;n++)r=Math.imul(r^t.charCodeAt(n),16777619);return r>>>0}function k(t){return t=Math.imul(t^t>>>16,2246822507),((t=Math.imul(t^t>>>13,3266489909))^t>>>16)>>>0}function x(t){return function(){t=t+1831565813>>>0;var r=Math.imul(t^t>>>15,1|t);return(((r=r+Math.imul(r^r>>>7,61|r)^r)^r>>>14)>>>0)/4294967296}}function w(t){var r="number"==typeof t?t>>>0:b(String(t));return function(t){return x(k(r^Math.imul(b(t),2654435769)))}}function q(t){if("#"===(t=String(t).trim()).charAt(0)){var r=t.slice(1);3===r.length&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]}var e=t.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/);return e?[+e[1],+e[2],+e[3]]:[255,255,255]}function S(t){return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+(0|t[2])).toString(16).slice(1)}function P(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function I(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function z(t){return t>216/24389?Math.pow(t,1/3):(24389/27*t+16)/116}function G(t){var r=t*t*t;return r>216/24389?r:27*(116*t-16)/24389}function j(t){var r=P(t[0]),n=P(t[1]),e=P(t[2]),a=.21267*r+.71515*n+.07218*e,o=(.01933*r+.11919*n+.9503*e)/1.08883,i=z((.41246*r+.35758*n+.18044*e)/.95047),l=z(a),u=500*(i-l),f=200*(l-z(o));return[116*l-16,Math.sqrt(u*u+f*f),(180*Math.atan2(f,u)/Math.PI+360)%360]}function L(t,r,n){var e=r*Math.cos(n*Math.PI/180),a=(t+16)/116,o=a-r*Math.sin(n*Math.PI/180)/200,i=.95047*G(a+e/500),l=G(a),u=1.08883*G(o);return[3.24045*i-1.53714*l-.49853*u,-.96927*i+1.87601*l+.04156*u,.05564*i-.20403*l+1.05723*u]}function O(t,r,n){var e,a=L(t,r,n),o=0,i=r;if(!A(a)){for(e=0;e<20;e++){var l=(o+i)/2;A(a=L(t,l,n))?o=l:i=l}a=L(t,o,n)}return[B(I(a[0])),B(I(a[1])),B(I(a[2]))]}function A(t){for(var r=0;r<3;r++)if(t[r]<-5e-4||t[r]>1.0005)return!1;return!0}function B(t){return Math.max(0,Math.min(255,Math.round(t)))}function D(t){return.2126*P(t[0])+.7152*P(t[1])+.0722*P(t[2])}function T(t,r){var n=D(t),e=D(r);return(Math.max(n,e)+.05)/(Math.min(n,e)+.05)}function U(t,r,n,e){if(T(t,r)>=n)return t;for(var a=j(t),o=a[0];o>=2&&o<=98;o+=2*e){var i=O(o,a[1],a[2]);if(T(i,r)>=n)return i}return t}function Q(t,r){for(var n=("string"==typeof t?[t]:t).map(function(t){return j(q(t))}),e=[],a=0;a<n.length;a++)n[a][1]>=12&&e.push(n[a]);var o=0===e.length,i=o?[50,0,0]:e[0],l=e.length>1?e[1]:[0,i[1],(i[2]+40)%360],u=(e.length>2?e[2]:i)[2],f=i[1],s=i[2],h="light"===r,c=h?O(97,o?0:3,s):O(6,Math.min(.2*f,10),s),v=h?O(92,Math.min(.2*f,8),s):O(12,Math.min(.3*f,15),s),d=h?[72,52,32]:[32,58,82],p=h?-1:1;return{colors:[U(O(d[0],.9*f,s),c,1.5,p),U(O(d[1],f,s),c,2.5,p),U(O(d[2],.55*f,s),c,5,p)],accent:U(O(h?45:70,l[1],l[2]),c,3,p),hot:U(O(h?28:92,o?0:h?24:12,u),c,7,p),background:c,halo:v}}function H(t,n,e){var a,o=null==t?r:"string"==typeof t?[t]:t,i=[],l=null;for(a=0;a<o.length;a++){var u=j(q(o[a]));u[1]>=12?i.push({lch:u,hex:o[a]}):l||(l=o[a])}var f="light"===n?"light":"dark",s=i.length?i[0].hex:l||"#00abf3",h=j(q(s)),c=h[1],v=h[2],d=Q(s,f),p=-1,M=1/0;for(a=1;a<i.length;a++){var g=Math.abs(i[a].lch[2]-85)%360;(g=Math.min(g,360-g))<M&&(M=g,p=a)}M>30&&(p=-1);var m=p>=0?i[p].lch:null,y=O(66,l||!i.length?0:m?.5*m[1]:25,m?m[2]:85),b=O(96.5,Math.min(.08*c,4),v),k=U(O(14,Math.min(.15*c,6),v),b,7,-1),x=U(O(34,Math.min(.25*c,10),v),b,3,-1),w=null;for(a=1;a<i.length;a++)if(a!==p){w=i[a].hex;break}var S="brand"===e?w?q(w):d.colors["light"===f?2:0]:"felt"===e?q(s):k,P=Q(o,f);return{felt:q(s),rail:S,trim:y,die:b,pip:k,ink:x,outline:d.colors[1],stroke:P.colors,background:P.background,halo:P.halo}}function C(t,r){var n=r&&r.rail,e=H(t,r&&r.theme,n),a={};for(var o in e)a[o]="stroke"===o?e[o].map(S):S(e[o]);return null!=n&&"auto"!==n&&"brand"!==n&&"felt"!==n&&(a.rail=n),a}function R(t,r){var n=t("ids"+(r||"")),e={},a="abcdefghijklmnopqrstuvwxyz",o=a+"0123456789";return function(){var t;do{t=a.charAt(Math.floor(26*n()));for(var r=0;r<5;r++)t+=o.charAt(Math.floor(36*n()))}while(e[t]);return e[t]=1,t}}function Y(t,r){var n=w(null==t.seed?1:t.seed),e=H(t.brand,t.theme,t.rail),a={},o=r,i={o:t,S:n,defs:"",p:null==t.precision?0:t.precision,w:null==t.weight?1:t.weight,cab:t.style?"line"!==t.style:"light"!==t.theme,col:function(r){var n=t[r];return null!=n&&"auto"!==n&&("rail"!==r||"brand"!==n&&"felt"!==n)?m(n):S(e[r])}};for(var l in e)o+="stroke"===l?"":i.col(l);return o+=i.cab+i.w+i.p+(t.lattice||"auto")+("glass"===t.body?"g":""),i.key=o,i.tk=R(n,(t.salt||"")+o),i.add=function(t,r){if(!a[t]){var n,e=i.tk();a[t]=e,n=r(),i.defs+=n.replace('"%"','"'+e+'"')}return a[t]},i}function Z(r,n,e,a){var o=r.title?["role","img","aria-label",m(r.title)]:["aria-hidden","true"],i=e.map(function(t){return g(t,n.p)}).join(" ");return y("svg",["xmlns",t,"viewBox",i,"width",null==r.size?null:g(r.size),"height",null==r.size?null:g(r.size*e[3]/e[2])].concat(o),(n.defs?y("defs",[],n.defs):"")+a)}function $(t,r,n){var e=[],a=function(t){return Math.round(1e3*t)/1e3},o=function(t,r,o,i){e.push(n?"M"+a(r)+" "+a(t)+"L"+a(i)+" "+a(o):"M"+a(t)+" "+a(r)+"L"+a(o)+" "+a(i))};if("trigon"===t)o(0,0,r,0),o(0,r,r,r),o(0,0,0,r),o(r,0,r,r),o(r,0,0,r);else if("octagon"===t){var i=s*r;o(i,0,r-i,0),o(i,r,r-i,r),o(0,i,0,r-i),o(r,i,r,r-i),o(r-i,0,r,i),o(r,r-i,r-i,r),o(i,r,0,r-i),o(0,i,i,0)}else{var l=r/f;(function(t,r,n){for(var e=f/2*n,a=[[t,r-n],[t+e,r-n/2],[t+e,r+n/2],[t,r+n],[t-e,r+n/2],[t-e,r-n/2]],i=0;i<6;i++)o(a[i][0],a[i][1],a[(i+1)%6][0],a[(i+1)%6][1])})(r/2,l,l),o(r/2,2*l,r/2,3*l)}return e.join("")}var E=["trigon","octagon","hex"];function F(t,r,n){var e=t.S,a=t.o;if("none"===a.lattice)return["fill","none"];var o=E.indexOf(a.lattice)>=0?a.lattice:E[Math.floor(3*e("table:lattice")())],i=22+22*e("table:pitch")(),l="hex"===o&&e("table:orient")()<.5,u="hex"===o?i/f*3:i;return["fill","url(#"+t.add("tile"+r+n,function(){return y("pattern",["id","%","patternUnits","userSpaceOnUse","width",g(l?u:i,2),"height",g(l?i:u,2),"patternTransform","translate("+g(i*e("table:phase")(),2)+" "+g(i*e("table:phase2")(),2)+") rotate("+g(90*e("table:turn")(),2)+")"],y("path",["d",$(o,i,l),"fill","none","stroke",r,"stroke-width",g((1+1.4*e("table:weight")())*t.w,2),"stroke-opacity",n]))})+")"]}var J=function(t,r){var n=Math.cos(r),e=Math.sin(r);return[t[0]*n+t[2]*e,t[1],-t[0]*e+t[2]*n]},K=function(t,r){var n=Math.cos(r),e=Math.sin(r);return[t[0],t[1]*n-t[2]*e,t[1]*e+t[2]*n]},N=function(t,r,n){return[t[0]+r[0]*(null==n?1:n),t[1]+r[1]*(null==n?1:n),t[2]+r[2]*(null==n?1:n)]},V=function(t,r){return[t[1]*r[2]-t[2]*r[1],t[2]*r[0]-t[0]*r[2],t[0]*r[1]-t[1]*r[0]]},W=function(t){var r=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])||1;return[t[0]/r,t[1]/r,t[2]/r]},X=[{n:[0,1,0],c:[0,n,0],u:[1,0,0],v:[0,0,1],val:1},{n:[0,-1,0],c:[0,-n,0],u:[1,0,0],v:[0,0,-1],val:6},{n:[0,0,1],c:[0,0,n],u:[1,0,0],v:[0,1,0],val:2},{n:[0,0,-1],c:[0,0,-n],u:[-1,0,0],v:[0,1,0],val:5},{n:[1,0,0],c:[n,0,0],u:[0,0,-1],v:[0,1,0],val:3},{n:[-1,0,0],c:[-n,0,0],u:[0,0,1],v:[0,1,0],val:4}],_=function(t,r){var n=Math.cos(r),e=Math.sin(r);return[t[0]*n-t[1]*e,t[0]*e+t[1]*n,t[2]]},tt={1:function(t){return t},6:function(t){return K(t,Math.PI)},2:function(t){return K(t,-Math.PI/2)},5:function(t){return K(t,Math.PI/2)},3:function(t){return _(t,Math.PI/2)},4:function(t){return _(t,-Math.PI/2)}},rt={1:[[0,0]],2:[[-1,-1],[1,1]],3:[[-1,-1],[0,0],[1,1]],4:[[-1,-1],[1,-1],[-1,1],[1,1]],5:[[-1,-1],[1,-1],[0,0],[-1,1],[1,1]],6:[[-1,-1.25],[1,-1.25],[-1,0],[1,0],[-1,1.25],[1,1.25]]};function nt(t){var r,n=t.slice().sort(function(t,r){return t[0]-r[0]||t[1]-r[1]}),e=[],a=[],o=function(t,r,n){return(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])};for(r=0;r<n.length;r++){for(;e.length>=2&&o(e[e.length-2],e[e.length-1],n[r])<=1e-8;)e.pop();e.push(n[r])}for(r=n.length-1;r>=0;r--){for(;a.length>=2&&o(a[a.length-2],a[a.length-1],n[r])<=1e-8;)a.pop();a.push(n[r])}return e.slice(0,-1).concat(a.slice(0,-1))}function et(t,r){var n,e="";for(n=0;n<t.length;n++){var a=t[(n-1+t.length)%t.length],o=t[n],i=t[(n+1)%t.length],l=Math.sqrt((o[0]-a[0])*(o[0]-a[0])+(o[1]-a[1])*(o[1]-a[1])),u=Math.sqrt((i[0]-o[0])*(i[0]-o[0])+(i[1]-o[1])*(i[1]-o[1]));if(!(l<1e-6||u<1e-6)){var f=Math.min(r,l/3,u/3),s=[o[0]-(o[0]-a[0])/l*f,o[1]-(o[1]-a[1])/l*f],h=[o[0]+(i[0]-o[0])/u*f,o[1]+(i[1]-o[1])/u*f];e+=(n?"L"+g(s[0],1)+" "+g(s[1],1):"M"+g(s[0],1)+" "+g(s[1],1))+"Q"+g(o[0],1)+" "+g(o[1],1)+" "+g(h[0],1)+" "+g(h[1],1)}}return e+"Z"}function at(t){var r=function(t,r){var n=j(q(t));return S(O(Math.max(2,Math.min(99,n[0]+r)),n[1],n[2]))},n=function(t){return/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(t)||/^rgba?\(\s*[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+/i.test(t)},e=t.o.die&&"auto"!==t.o.die?t.o.die:t.col("die"),a=t.o.pip&&"auto"!==t.o.pip?t.o.pip:t.col("pip"),o=!n(e),i=!n(a),l=o?[e,e,e]:[r(e,14),r(e,5),e],u=o?[e,e,e]:[r(e,4),e,r(e,-11)],f=o?[e,e,e]:[e,r(e,-13),r(e,-21)],s=i?[a,a,a,a]:[r(a,24),r(a,9),a,r(a,-9)],h=function(t,r,n,e){var a,o="";for(a=0;a<r.length;a++)o+=y("stop",["offset",0===a?0:g(a/(r.length-1),2),"stop-color",m(r[a])]);return y("linearGradient",["id",t,"x1",n[0],"y1",n[1],"x2",e[0],"y2",e[1]],o)},c="glass"===t.o.body;return t.add("dice:defs",function(){var n=t.tk(),a=t.tk(),i=t.tk(),v=t.tk(),d=t.tk(),p=t.tk(),M=t.tk(),g=t.tk();t.die={t:n,l:a,r:i,p:v,a:d,b14:p,b5:M,sf:g},t.dieUnder=o?e:r(e,-20);var b=y("filter",["id",p,"x","-60%","y","-60%","width","220%","height","220%"],y("feGaussianBlur",["stdDeviation",14]))+y("filter",["id",M,"x","-60%","y","-60%","width","220%","height","220%"],y("feGaussianBlur",["stdDeviation",5]));return c?(t.dieGlass=o?e:r(e,6),b):h(n,l,[".25",0],[".6",1])+h(a,u,[".2",0],[".7",1])+h(i,f,[".2",0],[".7",1])+y("radialGradient",["id",v,"cx",".31","cy",".27","r",".78"],y("stop",["offset",0,"stop-color",m(s[0])])+y("stop",["offset",".1","stop-color",m(s[1])])+y("stop",["offset",".35","stop-color",m(s[2])])+y("stop",["offset",1,"stop-color",m(s[3])]))+y("radialGradient",["id",d,"cx",".34","cy",".24","r",".88"],y("stop",["offset",0,"stop-color","#fff","stop-opacity",".22"])+y("stop",["offset",".48","stop-color","#fff","stop-opacity",".04"])+y("stop",["offset",".72","stop-color","#000","stop-opacity",0])+y("stop",["offset",1,"stop-color","#000","stop-opacity",".09"]))+b+y("filter",["id",g,"x","-20%","y","-20%","width","140%","height","140%"],y("feGaussianBlur",["stdDeviation",1.4]))})}function ot(t,r,u){var f,s=tt[r],h=[],c="glass"===t.o.body;for(f=0;f<6;f++){var v=X[f];h.push({c:s(v.c),u:s(v.u),v:s(v.v),n:s(v.n),val:v.val})}var d=function(t){var r=K(J(t,u),e);return[r[0],-r[1]]},p=function(t){var r=K(t,e);return[r[0],-r[1]]},M=[];for(f=0;f<8;f++)M.push(d(s([1&f?n:-n,2&f?n:-n,4&f?n:-n])));var b=et(nt(M),a),k=t.die,x=[];for(f=0;f<6;f++){var w=K(J(h[f].n,u),e);w[2]>.02&&x.push({f:h[f],rn:w,z:w[2]})}x.sort(function(t,r){return t.z-r.z});var q=[0,Math.sin(e),Math.cos(e)],S="",P="",I="",z=[];for(f=0;f<x.length;f++){var G,j=x[f].f,L=[],O=[];for(G=0;G<4;G++){var A=1===G||2===G?1:-1,B=G>=2?1:-1;L.push(d(N(N(j.c,j.u,A*l),j.v,B*l))),O.push(d(N(N(j.c,j.u,A*n),j.v,B*n)))}z.push(O),P=c?"":y("path",["d",et(L,o),"fill","url(#"+(x[f].rn[1]>.4?k.t:x[f].rn[0]>0?k.r:k.l)+")"]);var D=J(j.n,u),T=W(V(D,q)),U=W(V(D,T)),Q=rt[j.val];for(G=0;G<Q.length;G++){var H=J(N(N(j.c,j.u,Q[G][0]*n/3),j.v,Q[G][1]*n/3),u),C=p(H),R=p(N(H,T,i)),Y=p(N(H,U,i)),Z=[R[0]-C[0],R[1]-C[1]];P+=y("ellipse",["cx",g(C[0],1),"cy",g(C[1],1),"rx",g(Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1]),1),"ry",g(Math.sqrt((Y[0]-C[0])*(Y[0]-C[0])+(Y[1]-C[1])*(Y[1]-C[1])),1),"transform","rotate("+g(180*Math.atan2(Z[1],Z[0])/Math.PI,1)+" "+g(C[0],1)+" "+g(C[1],1)+")","fill",c?t.col("pip"):"url(#"+k.p+")"])}S+=P}var $=t.tk(),E=t.tk(),F=[];for(f=0;f<z.length;f++)for(var _=f+1;_<z.length;_++){for(var at=z[f],ot=z[_],it=[],lt=0;lt<4;lt++)for(var ut=0;ut<4;ut++){var ft=at[lt][0]-ot[ut][0],st=at[lt][1]-ot[ut][1];if(ft*ft+st*st<.01){it.push(at[lt]);break}}2===it.length&&F.push(it)}var ht=null;if(3===F.length)for(var ct=0;ct<2&&!ht;ct++){for(var vt=0,dt=0;dt<3;dt++)for(var pt=0;pt<2;pt++){var Mt=F[dt][pt][0]-F[0][ct][0],gt=F[dt][pt][1]-F[0][ct][1];Mt*Mt+gt*gt<.01&&vt++}3===vt&&(ht=F[0][ct])}var mt=nt(M),yt=[];for(f=0;f<F.length;f++){var bt=F[f][0],kt=F[f][1];if(ht){if(Math.abs(bt[0]-ht[0])+Math.abs(bt[1]-ht[1])>.1){var xt=bt;bt=kt,kt=xt}var wt=kt[0]-bt[0],qt=kt[1]-bt[1],St=Math.sqrt(wt*wt+qt*qt);if(St>1e-6){for(var Pt=Math.min(St,a),It=0;It<3;It++)if(It!==f){var zt=Math.abs(F[It][0][0]-bt[0])+Math.abs(F[It][0][1]-bt[1])<.1?F[It][1]:F[It][0],Gt=zt[0]-bt[0],jt=zt[1]-bt[1],Lt=Math.min(St,Math.sqrt(Gt*Gt+jt*jt))/3;Lt<Pt&&(Pt=Lt)}bt=[bt[0]+wt/St*Pt,bt[1]+qt/St*Pt]}yt.push(bt)}for(var Ot=-1,At=0;At<mt.length;At++){var Bt=mt[At][0]-kt[0],Dt=mt[At][1]-kt[1];if(Bt*Bt+Dt*Dt<.01){Ot=At;break}}if(Ot>=0){var Tt=mt[(Ot-1+mt.length)%mt.length],Ut=mt[(Ot+1)%mt.length],Qt=kt[0]-Tt[0],Ht=kt[1]-Tt[1],Ct=Ut[0]-kt[0],Rt=Ut[1]-kt[1],Yt=Math.sqrt(Qt*Qt+Ht*Ht),Zt=Math.sqrt(Ct*Ct+Rt*Rt),$t=kt[0]-bt[0],Et=kt[1]-bt[1],Ft=$t*$t+Et*Et;if(Yt>1e-6&&Zt>1e-6&&Ft>1e-6){var Jt=Math.min(a,Yt/3,Zt/3),Kt=[kt[0]-Qt/Yt*Jt,kt[1]-Ht/Yt*Jt],Nt=[kt[0]+Ct/Zt*Jt,kt[1]+Rt/Zt*Jt],Vt=Kt[0],Wt=2*(kt[0]-Kt[0]),Xt=Kt[0]-2*kt[0]+Nt[0],_t=Kt[1],tr=2*(kt[1]-Kt[1]),rr=Kt[1]-2*kt[1]+Nt[1],nr=Xt*Et-rr*$t,er=Wt*Et-tr*$t,ar=(Vt-bt[0])*Et-(_t-bt[1])*$t,or=[];if(Math.abs(nr)<1e-9){if(Math.abs(er)>1e-9){var ir=-ar/er;ir>0&&ir<1&&or.push(ir)}}else{var lr=er*er-4*nr*ar;if(lr>=0)for(var ur=Math.sqrt(lr),fr=-1;fr<=1;fr+=2){var sr=(fr*ur-er)/(2*nr);sr>0&&sr<1&&or.push(sr)}}for(var hr=null,cr=0;cr<or.length;cr++){var vr=or[cr],dr=((Vt+vr*Wt+vr*vr*Xt-bt[0])*$t+(_t+vr*tr+vr*vr*rr-bt[1])*Et)/Ft;dr>0&&dr<1&&(null==hr||dr>hr)&&(hr=dr)}if(null!=hr){var pr=(c?2.2:1.4)*t.w/Math.sqrt(Ft);kt=[bt[0]+$t*(hr-pr),bt[1]+Et*(hr-pr)]}}}I+=y("path",["clip-path",c?null:"url(#"+E+")","d","M"+g(bt[0],1)+" "+g(bt[1],1)+"L"+g(kt[0],1)+" "+g(kt[1],1),"fill","none","stroke",c?t.col("outline"):t.col("ink"),"stroke-opacity",c?null:".15","stroke-width",g((c?2.2:1.4)*t.w,1),"stroke-linecap","round"])}if(ht&&3===yt.length)for(f=0;f<3;f++)for(var Mr=f+1;Mr<3;Mr++)I+=y("path",["clip-path",c?null:"url(#"+E+")","d","M"+g(yt[f][0],1)+" "+g(yt[f][1],1)+"Q"+g(ht[0],1)+" "+g(ht[1],1)+" "+g(yt[Mr][0],1)+" "+g(yt[Mr][1],1),"fill","none","stroke",c?t.col("outline"):t.col("ink"),"stroke-opacity",c?null:".15","stroke-width",g((c?2.2:1.4)*t.w,1),"stroke-linecap","round"]);return t.defs+=y("path",["id",$,"d",b])+y("clipPath",["id",E],y("use",["href","#"+$])),{shadow:y("ellipse",["cx",0,"cy",118,"rx",132,"ry",24,"fill",t.col("ink"),"fill-opacity",".16","filter","url(#"+k.b14+")"])+y("ellipse",["cx",0,"cy",112,"rx",62,"ry",11,"fill",t.col("ink"),"fill-opacity",".18","filter","url(#"+k.b5+")"]),content:c?y("use",["href","#"+$,"fill",m(t.dieGlass),"fill-opacity",".55","stroke",t.col("outline"),"stroke-width",g(2.6*t.w,1)])+y("g",["clip-path","url(#"+E+")"],S+I):y("use",["href","#"+$,"fill",m(t.dieUnder)])+y("g",["clip-path","url(#"+E+")","filter","url(#"+k.sf+")"],S)+y("use",["href","#"+$,"fill","url(#"+k.a+")"])+y("use",["href","#"+$,"fill","none","stroke","#00000010","stroke-width",2])+I}}var it=[[-1,0],[1,0],[0,-1],[0,1],[0,0]],lt=["lucky7","snake","boxcars","matched","mixed"],ut=[[1,6],[2,5],[3,4]];function ft(t,r,n,e){if("snake"===t)return r<2?1:0;if("boxcars"===t)return r<2?6:0;if("lucky7"===t&&r<2){if(!e.l7){var a=ut[Math.floor(3*n("result:lucky7")())];e.l7=n("result:lucky7:swap")()<.5?a:[a[1],a[0]]}return e.l7[r]}if("matched"===t)return 1+Math.floor(6*n("result:matched")());if("mixed"===t){for(var o=[],i=1;i<=6;i++)e[i]||o.push(i);var l=o[Math.floor(n("result:mixed:"+r)()*o.length)];return e[l]=1,l}return 0}function st(t){var r,n=t||{},e=Math.max(2,Math.min(5,Math.round(n.dice)||3)),a=Y(n,"table"+e),o=a.p,i=a.S;at(a);var l=0,f=0;for(r=0;r<e;r++)l=Math.max(l,Math.abs(it[r][0])),f=Math.max(f,Math.abs(it[r][1]));var s=l*v+p,m=f*v+M,b=c[0]+(c[1]-c[0])*i("table:rail")(),k=28+40*i("table:corner")(),x=a.cab,w=a.col("outline"),q=a.col("trim"),S=g(4*a.w,2),P=function(t){return x?["fill",t]:["fill","none","stroke",w,"stroke-width",S]},I=function(t,r,n,e,a,i){return y("rect",["x",g(t,o),"y",g(r,o),"width",g(n,o),"height",g(e,o),"rx",a?g(a,o):null].concat(i))},z=n.values||[],G=lt.indexOf(n.result)>=0?n.result:"",j={},L=function(t){return 1+Math.floor(6*i("die:"+t+":value")())},O=[];for(r=0;r<e;r++){var A=Math.round(z[r]);A>=1&&A<=6&&(O[r]=A,j[A]=1)}for(r=0;r<e;r++)if(null==O[r])if(G){var B=ft(G,r,i,j);O[r]=B||L(r)}else O[r]=L(r);var D=null==n.speed?1:n.speed,T=!!n.motion&&D>0,U="",Q=null;T&&(Q=R(i,"motion"+(n.salt||"")+a.key+D));var H=[];for(r=0;r<e;r++){var C=(i("die:"+r+":orient")()<.5?-1:1)*(u[0]+u[1]*i("die:"+r+":orient:yaw")()),$=it[r][0]*v+2*(i("die:"+r+":place")()-.5)*d*v,E=it[r][1]*v+2*(i("die:"+r+":place:v")()-.5)*d*v,J=.9+.1*(it[r][1]+1)/2,K="translate("+g($,1)+" "+g(E,1)+")"+(1!==J?" scale("+J+")":""),N=ot(a,O[r],C),V=N.content,W=null;if(T){var X=Q(),_=30+40*i("die:"+r+":drop")();W=Q(),U+="@keyframes "+X+"{from{transform:translateY("+g(-_,1)+"px)}}."+W+"{animation:"+X+" "+g((.8+.3*r)/D,2)+"s cubic-bezier(.2,.7,.3,1.08)}",V=y("g",["class",W],V)}H.push({x:$,y:E,cls:W,shadow:y("g",["transform",K],N.shadow),body:y("g",["transform",K],V)})}H.sort(function(t,r){return t.y-r.y});var tt="",rt="";for(r=0;r<e;r++)tt+=H[r].shadow,rt+=H[r].body;for(r=0;r<e;r++)for(var nt=r+1;nt<e;nt++){var et=H[r].x-H[nt].x,ut=H[r].y-H[nt].y;Math.sqrt(et*et+ut*ut)<240&&(tt+=y("ellipse",["cx",g((H[r].x+H[nt].x)/2,1),"cy",g((H[r].y+H[nt].y)/2+54,1),"rx",36,"ry",9,"fill",a.col("ink"),"fill-opacity",".14","filter","url(#"+a.die.b5+")"]))}var st="";if(T){var ht=[];for(r=0;r<e;r++)H[r].cls&&ht.push("."+H[r].cls);st=y("style",[],U+"@media(prefers-reduced-motion:reduce){"+ht.join(",")+"{animation:none}}")}return st+=I(-s-b,-m-b,2*(s+b),2*(m+b),k,P(a.col("rail"))),st+=I(-s,-m,2*s,2*m,Math.max(0,k-b),P(a.col("felt"))),st+=I(-s,-m,2*s,2*m,Math.max(0,k-b),F(a,q,".25")),st+=tt+rt,Z(n,a,[-s-h[0],-m-h[1],2*(s+h[0]),2*(m+h[1])],st)}function ht(t){var r=t||{},n=Y(r,"die"),e=n.S;at(n);var a=ot(n,Math.round(r.value)>=1&&Math.round(r.value)<=6?Math.round(r.value):1+Math.floor(6*e("die:0:value")()),(e("die:0:orient")()<.5?-1:1)*(u[0]+u[1]*e("die:0:orient:yaw")()));return Z(r,n,[-p,-M,2*p,2*M+42],y("g",["transform","translate(0 0)"],a.shadow+a.content))}function ct(t,r){var n="string"==typeof t?document.querySelector(t):t,e={};if(!n)return null;var a=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);n.innerHTML=st(e)};return a(r||{}),{el:n,get:function(){var t={};for(var r in e)t[r]=e[r];return t},set:a,destroy:function(){n.innerHTML=""}}}return{toss:st,die:ht,palette:C,init:ct}}();"object"==typeof module&&module.exports?module.exports=r:t.Dice=r}("undefined"!=typeof self?self:this);
10
+ !function(t){var r=function(){"use strict";var t="http://www.w3.org/2000/svg",r=["#00abf3","#d6af3c","#a91455"],n=100,e=.91,a=44,o=9,i=19,l=n+2,u=[.36,.08],f=Math.sqrt(3),h=(2-Math.SQRT2)/2,s=[90,64],c=[22,34],v=126,d=.06,p=145,M=176;function g(t,r){var n=Math.pow(10,r||0),e=Math.round(t*n)/n;return String(0===e?0:e)}function m(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function y(t,r,n){for(var e="<"+t,a=0;a<r.length;a+=2)null!=r[a+1]&&(e+=" "+r[a]+'="'+r[a+1]+'"');return null==n?e+"/>":e+">"+n+"</"+t+">"}function b(t){for(var r=2166136261,n=0;n<t.length;n++)r=Math.imul(r^t.charCodeAt(n),16777619);return r>>>0}function k(t){return t=Math.imul(t^t>>>16,2246822507),((t=Math.imul(t^t>>>13,3266489909))^t>>>16)>>>0}function x(t){return function(){t=t+1831565813>>>0;var r=Math.imul(t^t>>>15,1|t);return(((r=r+Math.imul(r^r>>>7,61|r)^r)^r>>>14)>>>0)/4294967296}}function w(t){var r="number"==typeof t?t>>>0:b(String(t));return function(t){return x(k(r^Math.imul(b(t),2654435769)))}}function q(t){if("#"===(t=String(t).trim()).charAt(0)){var r=t.slice(1);3===r.length&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]}var e=t.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/);return e?[+e[1],+e[2],+e[3]]:[255,255,255]}function S(t){return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+(0|t[2])).toString(16).slice(1)}function P(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function I(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function z(t){return t>216/24389?Math.pow(t,1/3):(24389/27*t+16)/116}function G(t){var r=t*t*t;return r>216/24389?r:27*(116*t-16)/24389}function j(t){var r=P(t[0]),n=P(t[1]),e=P(t[2]),a=.21267*r+.71515*n+.07218*e,o=(.01933*r+.11919*n+.9503*e)/1.08883,i=z((.41246*r+.35758*n+.18044*e)/.95047),l=z(a),u=500*(i-l),f=200*(l-z(o));return[116*l-16,Math.sqrt(u*u+f*f),(180*Math.atan2(f,u)/Math.PI+360)%360]}function L(t,r,n){var e=r*Math.cos(n*Math.PI/180),a=(t+16)/116,o=a-r*Math.sin(n*Math.PI/180)/200,i=.95047*G(a+e/500),l=G(a),u=1.08883*G(o);return[3.24045*i-1.53714*l-.49853*u,-.96927*i+1.87601*l+.04156*u,.05564*i-.20403*l+1.05723*u]}function O(t,r,n){var e,a=L(t,r,n),o=0,i=r;if(!A(a)){for(e=0;e<20;e++){var l=(o+i)/2;A(a=L(t,l,n))?o=l:i=l}a=L(t,o,n)}return[B(I(a[0])),B(I(a[1])),B(I(a[2]))]}function A(t){for(var r=0;r<3;r++)if(t[r]<-5e-4||t[r]>1.0005)return!1;return!0}function B(t){return Math.max(0,Math.min(255,Math.round(t)))}function D(t){return.2126*P(t[0])+.7152*P(t[1])+.0722*P(t[2])}function T(t,r){var n=D(t),e=D(r);return(Math.max(n,e)+.05)/(Math.min(n,e)+.05)}function U(t,r,n,e){if(T(t,r)>=n)return t;for(var a=j(t),o=a[0];o>=2&&o<=98;o+=2*e){var i=O(o,a[1],a[2]);if(T(i,r)>=n)return i}return t}function Q(t,r){for(var n=("string"==typeof t?[t]:t).map(function(t){return j(q(t))}),e=[],a=0;a<n.length;a++)n[a][1]>=12&&e.push(n[a]);var o=0===e.length,i=o?[50,0,0]:e[0],l=e.length>1?e[1]:[0,i[1],(i[2]+40)%360],u=(e.length>2?e[2]:i)[2],f=i[1],h=i[2],s="light"===r,c=s?O(97,o?0:3,h):O(6,Math.min(.2*f,10),h),v=s?O(92,Math.min(.2*f,8),h):O(12,Math.min(.3*f,15),h),d=s?[72,52,32]:[32,58,82],p=s?-1:1;return{colors:[U(O(d[0],.9*f,h),c,1.5,p),U(O(d[1],f,h),c,2.5,p),U(O(d[2],.55*f,h),c,5,p)],accent:U(O(s?45:70,l[1],l[2]),c,3,p),hot:U(O(s?28:92,o?0:s?24:12,u),c,7,p),background:c,halo:v}}function H(t,n,e){var a,o=null==t?r:"string"==typeof t?[t]:t,i=[],l=null;for(a=0;a<o.length;a++){var u=j(q(o[a]));u[1]>=12?i.push({lch:u,hex:o[a]}):l||(l=o[a])}var f="light"===n?"light":"dark",h=i.length?i[0].hex:l||"#00abf3",s=j(q(h)),c=s[1],v=s[2],d=Q(h,f),p=-1,M=1/0;for(a=1;a<i.length;a++){var g=Math.abs(i[a].lch[2]-85)%360;(g=Math.min(g,360-g))<M&&(M=g,p=a)}M>30&&(p=-1);var m=p>=0?i[p].lch:null,y=O(66,i.length?m?.5*m[1]:25:0,m?m[2]:85),b=O(96.5,Math.min(.08*c,4),v),k=U(O(14,Math.min(.15*c,6),v),b,7,-1),x=U(O(34,Math.min(.25*c,10),v),b,3,-1),w=null;for(a=1;a<i.length;a++)if(a!==p){w=i[a].hex;break}var S="brand"===e?w?q(w):d.colors["light"===f?2:0]:"felt"===e?q(h):k,P=Q(o,f);return{felt:q(h),rail:S,trim:y,die:b,pip:k,ink:x,outline:d.colors[1],stroke:P.colors,background:P.background,halo:P.halo}}function C(t,r){var n=r&&r.rail,e=H(t,r&&r.theme,n),a={};for(var o in e)a[o]="stroke"===o?e[o].map(S):S(e[o]);return null!=n&&"auto"!==n&&"brand"!==n&&"felt"!==n&&(a.rail=n),a}function R(t,r){var n=t("ids"+(r||"")),e={},a="abcdefghijklmnopqrstuvwxyz",o=a+"0123456789";return function(){var t;do{t=a.charAt(Math.floor(26*n()));for(var r=0;r<5;r++)t+=o.charAt(Math.floor(36*n()))}while(e[t]);return e[t]=1,t}}function Y(t,r){var n=w(null==t.seed?1:t.seed),e=H(t.brand,t.theme,t.rail),a={},o=r,i={o:t,S:n,defs:"",p:null==t.precision?0:t.precision,w:null==t.weight?1:t.weight,cab:t.style?"line"!==t.style:"light"!==t.theme,col:function(r){var n=t[r];return null!=n&&"auto"!==n&&("rail"!==r||"brand"!==n&&"felt"!==n)?m(n):S(e[r])}};for(var l in e)o+="stroke"===l?"":i.col(l);return o+=i.cab+i.w+i.p+(t.lattice||"auto")+("glass"===t.body?"g":""),i.key=o,i.tk=R(n,(t.salt||"")+o),i.add=function(t,r){if(!a[t]){var n,e=i.tk();a[t]=e,n=r(),i.defs+=n.replace('"%"','"'+e+'"')}return a[t]},i}function Z(r,n,e,a){var o=r.title?["role","img","aria-label",m(r.title)]:["aria-hidden","true"],i=e.map(function(t){return g(t,n.p)}).join(" ");return y("svg",["xmlns",t,"viewBox",i,"width",null==r.size?null:g(r.size),"height",null==r.size?null:g(r.size*e[3]/e[2])].concat(o),(n.defs?y("defs",[],n.defs):"")+a)}function $(t,r,n){var e=[],a=function(t){return Math.round(1e3*t)/1e3},o=function(t,r,o,i){e.push(n?"M"+a(r)+" "+a(t)+"L"+a(i)+" "+a(o):"M"+a(t)+" "+a(r)+"L"+a(o)+" "+a(i))};if("trigon"===t)o(0,0,r,0),o(0,r,r,r),o(0,0,0,r),o(r,0,r,r),o(r,0,0,r);else if("octagon"===t){var i=h*r;o(i,0,r-i,0),o(i,r,r-i,r),o(0,i,0,r-i),o(r,i,r,r-i),o(r-i,0,r,i),o(r,r-i,r-i,r),o(i,r,0,r-i),o(0,i,i,0)}else{var l=r/f;(function(t,r,n){for(var e=f/2*n,a=[[t,r-n],[t+e,r-n/2],[t+e,r+n/2],[t,r+n],[t-e,r+n/2],[t-e,r-n/2]],i=0;i<6;i++)o(a[i][0],a[i][1],a[(i+1)%6][0],a[(i+1)%6][1])})(r/2,l,l),o(r/2,2*l,r/2,3*l)}return e.join("")}var E=["trigon","octagon","hex"];function F(t,r,n){var e=t.S,a=t.o;if("none"===a.lattice)return["fill","none"];var o=E.indexOf(a.lattice)>=0?a.lattice:E[Math.floor(3*e("table:lattice")())],i=22+22*e("table:pitch")(),l="hex"===o&&e("table:orient")()<.5,u="hex"===o?i/f*3:i;return["fill","url(#"+t.add("tile"+r+n,function(){return y("pattern",["id","%","patternUnits","userSpaceOnUse","width",g(l?u:i,2),"height",g(l?i:u,2),"patternTransform","translate("+g(i*e("table:phase")(),2)+" "+g(i*e("table:phase2")(),2)+") rotate("+g(90*e("table:turn")(),2)+")"],y("path",["d",$(o,i,l),"fill","none","stroke",r,"stroke-width",g((1+1.4*e("table:weight")())*t.w,2),"stroke-opacity",n]))})+")"]}var J=function(t,r){var n=Math.cos(r),e=Math.sin(r);return[t[0]*n+t[2]*e,t[1],-t[0]*e+t[2]*n]},K=function(t,r){var n=Math.cos(r),e=Math.sin(r);return[t[0],t[1]*n-t[2]*e,t[1]*e+t[2]*n]},N=function(t,r,n){return[t[0]+r[0]*(null==n?1:n),t[1]+r[1]*(null==n?1:n),t[2]+r[2]*(null==n?1:n)]},V=function(t,r){return[t[1]*r[2]-t[2]*r[1],t[2]*r[0]-t[0]*r[2],t[0]*r[1]-t[1]*r[0]]},W=function(t){var r=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])||1;return[t[0]/r,t[1]/r,t[2]/r]},X=[{n:[0,1,0],c:[0,n,0],u:[1,0,0],v:[0,0,1],val:1},{n:[0,-1,0],c:[0,-n,0],u:[1,0,0],v:[0,0,-1],val:6},{n:[0,0,1],c:[0,0,n],u:[1,0,0],v:[0,1,0],val:2},{n:[0,0,-1],c:[0,0,-n],u:[-1,0,0],v:[0,1,0],val:5},{n:[1,0,0],c:[n,0,0],u:[0,0,-1],v:[0,1,0],val:3},{n:[-1,0,0],c:[-n,0,0],u:[0,0,1],v:[0,1,0],val:4}],_=function(t,r){var n=Math.cos(r),e=Math.sin(r);return[t[0]*n-t[1]*e,t[0]*e+t[1]*n,t[2]]},tt={1:function(t){return t},6:function(t){return K(t,Math.PI)},2:function(t){return K(t,-Math.PI/2)},5:function(t){return K(t,Math.PI/2)},3:function(t){return _(t,Math.PI/2)},4:function(t){return _(t,-Math.PI/2)}},rt={1:[[0,0]],2:[[-1,-1],[1,1]],3:[[-1,-1],[0,0],[1,1]],4:[[-1,-1],[1,-1],[-1,1],[1,1]],5:[[-1,-1],[1,-1],[0,0],[-1,1],[1,1]],6:[[-1,-1.25],[1,-1.25],[-1,0],[1,0],[-1,1.25],[1,1.25]]};function nt(t){var r,n=t.slice().sort(function(t,r){return t[0]-r[0]||t[1]-r[1]}),e=[],a=[],o=function(t,r,n){return(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])};for(r=0;r<n.length;r++){for(;e.length>=2&&o(e[e.length-2],e[e.length-1],n[r])<=1e-8;)e.pop();e.push(n[r])}for(r=n.length-1;r>=0;r--){for(;a.length>=2&&o(a[a.length-2],a[a.length-1],n[r])<=1e-8;)a.pop();a.push(n[r])}return e.slice(0,-1).concat(a.slice(0,-1))}function et(t,r){var n,e="";for(n=0;n<t.length;n++){var a=t[(n-1+t.length)%t.length],o=t[n],i=t[(n+1)%t.length],l=Math.sqrt((o[0]-a[0])*(o[0]-a[0])+(o[1]-a[1])*(o[1]-a[1])),u=Math.sqrt((i[0]-o[0])*(i[0]-o[0])+(i[1]-o[1])*(i[1]-o[1]));if(!(l<1e-6||u<1e-6)){var f=Math.min(r,l/3,u/3),h=[o[0]-(o[0]-a[0])/l*f,o[1]-(o[1]-a[1])/l*f],s=[o[0]+(i[0]-o[0])/u*f,o[1]+(i[1]-o[1])/u*f];e+=(n?"L"+g(h[0],1)+" "+g(h[1],1):"M"+g(h[0],1)+" "+g(h[1],1))+"Q"+g(o[0],1)+" "+g(o[1],1)+" "+g(s[0],1)+" "+g(s[1],1)}}return e+"Z"}function at(t){var r=function(t,r){var n=j(q(t));return S(O(Math.max(2,Math.min(99,n[0]+r)),n[1],n[2]))},n=function(t){return/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(t)||/^rgba?\(\s*[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+/i.test(t)},e=t.o.die&&"auto"!==t.o.die?t.o.die:t.col("die"),a=t.o.pip&&"auto"!==t.o.pip?t.o.pip:t.col("pip"),o=!n(e),i=!n(a),l=o?[e,e,e]:[r(e,14),r(e,5),e],u=o?[e,e,e]:[r(e,4),e,r(e,-11)],f=o?[e,e,e]:[e,r(e,-13),r(e,-21)],h=i?[a,a,a,a]:[r(a,24),r(a,9),a,r(a,-9)],s=function(t,r,n,e){var a,o="";for(a=0;a<r.length;a++)o+=y("stop",["offset",0===a?0:g(a/(r.length-1),2),"stop-color",m(r[a])]);return y("linearGradient",["id",t,"x1",n[0],"y1",n[1],"x2",e[0],"y2",e[1]],o)},c="glass"===t.o.body;return t.add("dice:defs",function(){var n=t.tk(),a=t.tk(),i=t.tk(),v=t.tk(),d=t.tk(),p=t.tk(),M=t.tk(),g=t.tk();t.die={t:n,l:a,r:i,p:v,a:d,b14:p,b5:M,sf:g},t.dieUnder=o?e:r(e,-20);var b=y("filter",["id",p,"x","-60%","y","-60%","width","220%","height","220%"],y("feGaussianBlur",["stdDeviation",14]))+y("filter",["id",M,"x","-60%","y","-60%","width","220%","height","220%"],y("feGaussianBlur",["stdDeviation",5]));return c?(t.dieGlass=o?e:r(e,6),b):s(n,l,[".25",0],[".6",1])+s(a,u,[".2",0],[".7",1])+s(i,f,[".2",0],[".7",1])+y("radialGradient",["id",v,"cx",".31","cy",".27","r",".78"],y("stop",["offset",0,"stop-color",m(h[0])])+y("stop",["offset",".1","stop-color",m(h[1])])+y("stop",["offset",".35","stop-color",m(h[2])])+y("stop",["offset",1,"stop-color",m(h[3])]))+y("radialGradient",["id",d,"cx",".34","cy",".24","r",".88"],y("stop",["offset",0,"stop-color","#fff","stop-opacity",".22"])+y("stop",["offset",".48","stop-color","#fff","stop-opacity",".04"])+y("stop",["offset",".72","stop-color","#000","stop-opacity",0])+y("stop",["offset",1,"stop-color","#000","stop-opacity",".09"]))+b+y("filter",["id",g,"x","-20%","y","-20%","width","140%","height","140%"],y("feGaussianBlur",["stdDeviation",1.4]))})}function ot(t,r,u){var f,h=tt[r],s=[],c="glass"===t.o.body;for(f=0;f<6;f++){var v=X[f];s.push({c:h(v.c),u:h(v.u),v:h(v.v),n:h(v.n),val:v.val})}var d=function(t){var r=K(J(t,u),e);return[r[0],-r[1]]},p=function(t){var r=K(t,e);return[r[0],-r[1]]},M=[];for(f=0;f<8;f++)M.push(d(h([1&f?n:-n,2&f?n:-n,4&f?n:-n])));var b=et(nt(M),a),k=t.die,x=[];for(f=0;f<6;f++){var w=K(J(s[f].n,u),e);w[2]>.02&&x.push({f:s[f],rn:w,z:w[2]})}x.sort(function(t,r){return t.z-r.z});var q=[0,Math.sin(e),Math.cos(e)],S="",P="",I="",z=[];for(f=0;f<x.length;f++){var G,j=x[f].f,L=[],O=[];for(G=0;G<4;G++){var A=1===G||2===G?1:-1,B=G>=2?1:-1;L.push(d(N(N(j.c,j.u,A*l),j.v,B*l))),O.push(d(N(N(j.c,j.u,A*n),j.v,B*n)))}z.push(O),P=c?"":y("path",["d",et(L,o),"fill","url(#"+(x[f].rn[1]>.4?k.t:x[f].rn[0]>0?k.r:k.l)+")"]);var D=J(j.n,u),T=W(V(D,q)),U=W(V(D,T)),Q=rt[j.val];for(G=0;G<Q.length;G++){var H=J(N(N(j.c,j.u,Q[G][0]*n/3),j.v,Q[G][1]*n/3),u),C=p(H),R=p(N(H,T,i)),Y=p(N(H,U,i)),Z=[R[0]-C[0],R[1]-C[1]];P+=y("ellipse",["cx",g(C[0],1),"cy",g(C[1],1),"rx",g(Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1]),1),"ry",g(Math.sqrt((Y[0]-C[0])*(Y[0]-C[0])+(Y[1]-C[1])*(Y[1]-C[1])),1),"transform","rotate("+g(180*Math.atan2(Z[1],Z[0])/Math.PI,1)+" "+g(C[0],1)+" "+g(C[1],1)+")","fill",c?t.col("pip"):"url(#"+k.p+")"])}S+=P}var $=t.tk(),E=t.tk(),F=[];for(f=0;f<z.length;f++)for(var _=f+1;_<z.length;_++){for(var at=z[f],ot=z[_],it=[],lt=0;lt<4;lt++)for(var ut=0;ut<4;ut++){var ft=at[lt][0]-ot[ut][0],ht=at[lt][1]-ot[ut][1];if(ft*ft+ht*ht<.01){it.push(at[lt]);break}}2===it.length&&F.push(it)}var st=null;if(3===F.length)for(var ct=0;ct<2&&!st;ct++){for(var vt=0,dt=0;dt<3;dt++)for(var pt=0;pt<2;pt++){var Mt=F[dt][pt][0]-F[0][ct][0],gt=F[dt][pt][1]-F[0][ct][1];Mt*Mt+gt*gt<.01&&vt++}3===vt&&(st=F[0][ct])}var mt=nt(M),yt=[];for(f=0;f<F.length;f++){var bt=F[f][0],kt=F[f][1];if(st){if(Math.abs(bt[0]-st[0])+Math.abs(bt[1]-st[1])>.1){var xt=bt;bt=kt,kt=xt}var wt=kt[0]-bt[0],qt=kt[1]-bt[1],St=Math.sqrt(wt*wt+qt*qt);if(St>1e-6){for(var Pt=Math.min(St,a),It=0;It<3;It++)if(It!==f){var zt=Math.abs(F[It][0][0]-bt[0])+Math.abs(F[It][0][1]-bt[1])<.1?F[It][1]:F[It][0],Gt=zt[0]-bt[0],jt=zt[1]-bt[1],Lt=Math.min(St,Math.sqrt(Gt*Gt+jt*jt))/3;Lt<Pt&&(Pt=Lt)}bt=[bt[0]+wt/St*Pt,bt[1]+qt/St*Pt]}yt.push(bt)}for(var Ot=-1,At=0;At<mt.length;At++){var Bt=mt[At][0]-kt[0],Dt=mt[At][1]-kt[1];if(Bt*Bt+Dt*Dt<.01){Ot=At;break}}if(Ot>=0){var Tt=mt[(Ot-1+mt.length)%mt.length],Ut=mt[(Ot+1)%mt.length],Qt=kt[0]-Tt[0],Ht=kt[1]-Tt[1],Ct=Ut[0]-kt[0],Rt=Ut[1]-kt[1],Yt=Math.sqrt(Qt*Qt+Ht*Ht),Zt=Math.sqrt(Ct*Ct+Rt*Rt),$t=kt[0]-bt[0],Et=kt[1]-bt[1],Ft=$t*$t+Et*Et;if(Yt>1e-6&&Zt>1e-6&&Ft>1e-6){var Jt=Math.min(a,Yt/3,Zt/3),Kt=[kt[0]-Qt/Yt*Jt,kt[1]-Ht/Yt*Jt],Nt=[kt[0]+Ct/Zt*Jt,kt[1]+Rt/Zt*Jt],Vt=Kt[0],Wt=2*(kt[0]-Kt[0]),Xt=Kt[0]-2*kt[0]+Nt[0],_t=Kt[1],tr=2*(kt[1]-Kt[1]),rr=Kt[1]-2*kt[1]+Nt[1],nr=Xt*Et-rr*$t,er=Wt*Et-tr*$t,ar=(Vt-bt[0])*Et-(_t-bt[1])*$t,or=[];if(Math.abs(nr)<1e-9){if(Math.abs(er)>1e-9){var ir=-ar/er;ir>0&&ir<1&&or.push(ir)}}else{var lr=er*er-4*nr*ar;if(lr>=0)for(var ur=Math.sqrt(lr),fr=-1;fr<=1;fr+=2){var hr=(fr*ur-er)/(2*nr);hr>0&&hr<1&&or.push(hr)}}for(var sr=null,cr=0;cr<or.length;cr++){var vr=or[cr],dr=((Vt+vr*Wt+vr*vr*Xt-bt[0])*$t+(_t+vr*tr+vr*vr*rr-bt[1])*Et)/Ft;dr>0&&dr<1&&(null==sr||dr>sr)&&(sr=dr)}if(null!=sr){var pr=(c?2.2:1.4)*t.w/Math.sqrt(Ft);kt=[bt[0]+$t*(sr-pr),bt[1]+Et*(sr-pr)]}}}I+=y("path",["clip-path",c?null:"url(#"+E+")","d","M"+g(bt[0],1)+" "+g(bt[1],1)+"L"+g(kt[0],1)+" "+g(kt[1],1),"fill","none","stroke",c?t.col("outline"):t.col("ink"),"stroke-opacity",c?null:".15","stroke-width",g((c?2.2:1.4)*t.w,1),"stroke-linecap","round"])}if(st&&3===yt.length)for(f=0;f<3;f++)for(var Mr=f+1;Mr<3;Mr++)I+=y("path",["clip-path",c?null:"url(#"+E+")","d","M"+g(yt[f][0],1)+" "+g(yt[f][1],1)+"Q"+g(st[0],1)+" "+g(st[1],1)+" "+g(yt[Mr][0],1)+" "+g(yt[Mr][1],1),"fill","none","stroke",c?t.col("outline"):t.col("ink"),"stroke-opacity",c?null:".15","stroke-width",g((c?2.2:1.4)*t.w,1),"stroke-linecap","round"]);return t.defs+=y("path",["id",$,"d",b])+y("clipPath",["id",E],y("use",["href","#"+$])),{shadow:y("ellipse",["cx",0,"cy",118,"rx",132,"ry",24,"fill",t.col("ink"),"fill-opacity",".16","filter","url(#"+k.b14+")"])+(c?y("ellipse",["cx",0,"cy",112,"rx",62,"ry",11,"fill",t.col("ink"),"fill-opacity",".18","filter","url(#"+k.b5+")"]):""),content:c?y("use",["href","#"+$,"fill",m(t.dieGlass),"fill-opacity",".55","stroke",t.col("outline"),"stroke-width",g(2.6*t.w,1)])+y("g",["clip-path","url(#"+E+")"],S+I):y("use",["href","#"+$,"fill",m(t.dieUnder)])+y("g",["clip-path","url(#"+E+")","filter","url(#"+k.sf+")"],S)+y("use",["href","#"+$,"fill","url(#"+k.a+")"])+y("use",["href","#"+$,"fill","none","stroke","#00000010","stroke-width",2])+I}}var it=[[-1,0],[1,0],[0,-1],[0,1],[1.65,1.15]],lt=["lucky7","snake","boxcars","matched","mixed"],ut=[[1,6],[2,5],[3,4]];function ft(t,r,n,e,a){if("snake"===t)return r<2?1:0;if("boxcars"===t)return r<2?6:0;if("lucky7"===t&&r<2){if(a[1-r])return 7-a[1-r];if(!e.l7){var o=ut[Math.floor(3*n("result:lucky7")())];e.l7=n("result:lucky7:swap")()<.5?o:[o[1],o[0]]}return e.l7[r]}if("matched"===t){for(var i=0;i<a.length;i++)if(a[i])return a[i];return 1+Math.floor(6*n("result:matched")())}if("mixed"===t){for(var l=[],u=1;u<=6;u++)e[u]||l.push(u);var f=l[Math.floor(n("result:mixed:"+r)()*l.length)];return e[f]=1,f}return 0}function ht(t){var r,n=t||{},e=Math.max(2,Math.min(5,Math.round(n.dice)||3)),a=Y(n,"table"+e),o=a.p,i=a.S;at(a);var l=0,f=0;for(r=0;r<e;r++)l=Math.max(l,Math.abs(it[r][0])),f=Math.max(f,Math.abs(it[r][1]));var h=l*v+p,m=f*v+M,b=c[0]+(c[1]-c[0])*i("table:rail")(),k=28+40*i("table:corner")(),x=a.cab,w=a.col("outline"),q=a.col("trim"),S=g(4*a.w,2),P=function(t){return x?["fill",t]:["fill","none","stroke",w,"stroke-width",S]},I=function(t,r,n,e,a,i){return y("rect",["x",g(t,o),"y",g(r,o),"width",g(n,o),"height",g(e,o),"rx",a?g(a,o):null].concat(i))},z=n.values||[],G=lt.indexOf(n.result)>=0?n.result:"",j={},L=function(t){return 1+Math.floor(6*i("die:"+t+":value")())},O=[];for(r=0;r<e;r++){var A=Math.round(z[r]);A>=1&&A<=6&&(O[r]=A,j[A]=1)}for(r=0;r<e;r++)if(null==O[r])if(G){var B=ft(G,r,i,j,O);O[r]=B||L(r)}else O[r]=L(r);var D=null==n.speed?1:n.speed,T=!!n.motion&&D>0,U="",Q=null;T&&(Q=R(i,"motion"+(n.salt||"")+a.key+D));var H=[];for(r=0;r<e;r++){var C=(i("die:"+r+":orient")()<.5?-1:1)*(u[0]+u[1]*i("die:"+r+":orient:yaw")()),$=it[r][0]*v+2*(i("die:"+r+":place")()-.5)*d*v,E=it[r][1]*v+2*(i("die:"+r+":place:v")()-.5)*d*v,J=.9+.1*(it[r][1]+1)/2,K="translate("+g($,1)+" "+g(E,1)+")"+(1!==J?" scale("+J+")":""),N=ot(a,O[r],C),V=N.content,W=null;if(T){var X=Q(),_=30+40*i("die:"+r+":drop")();W=Q(),U+="@keyframes "+X+"{from{transform:translateY("+g(-_,1)+"px)}}."+W+"{animation:"+X+" "+g((.8+.3*r)/D,2)+"s cubic-bezier(.2,.7,.3,1.08)}",V=y("g",["class",W],V)}H.push({x:$,y:E,cls:W,shadow:y("g",["transform",K],N.shadow),body:y("g",["transform",K],V)})}H.sort(function(t,r){return t.y-r.y});var tt="",rt="";for(r=0;r<e;r++)tt+=H[r].shadow,rt+=H[r].body;for(r=0;r<e;r++)for(var nt=r+1;nt<e;nt++){var et=H[r].x-H[nt].x,ut=H[r].y-H[nt].y;Math.sqrt(et*et+ut*ut)<240&&(tt+=y("ellipse",["cx",g((H[r].x+H[nt].x)/2,1),"cy",g((H[r].y+H[nt].y)/2+54,1),"rx",36,"ry",9,"fill",a.col("ink"),"fill-opacity",".14","filter","url(#"+a.die.b5+")"]))}var ht="";if(T){var st=[];for(r=0;r<e;r++)H[r].cls&&st.push("."+H[r].cls);ht=y("style",[],U+"@media(prefers-reduced-motion:reduce){"+st.join(",")+"{animation:none}}")}return ht+=I(-h-b,-m-b,2*(h+b),2*(m+b),k,P(a.col("rail"))),ht+=I(-h,-m,2*h,2*m,Math.max(0,k-b),P(a.col("felt"))),ht+=I(-h,-m,2*h,2*m,Math.max(0,k-b),F(a,q,".25")),ht+=tt+rt,Z(n,a,[-h-s[0],-m-s[1],2*(h+s[0]),2*(m+s[1])],ht)}function st(t){var r=t||{},n=Y(r,"die"),e=n.S;at(n);var a=ot(n,Math.round(r.value)>=1&&Math.round(r.value)<=6?Math.round(r.value):1+Math.floor(6*e("die:0:value")()),(e("die:0:orient")()<.5?-1:1)*(u[0]+u[1]*e("die:0:orient:yaw")()));return Z(r,n,[-p,-M,2*p,2*M+42],a.shadow+a.content)}function ct(t,r){var n="string"==typeof t?document.querySelector(t):t,e={};if(!n)return null;var a=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);n.innerHTML=ht(e)};return a(r||{}),{el:n,get:function(){var t={};for(var r in e)t[r]=e[r];return t},set:a,destroy:function(){n.innerHTML=""}}}return{toss:ht,die:st,palette:C,init:ct}}();"object"==typeof module&&module.exports?module.exports=r:t.Dice=r}("undefined"!=typeof self?self:this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spintax/dice-lite",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A procedural throw of dice as an SVG string. Seeded placement and values, brand-aware table palette, paper or frosted-glass bodies, an optional CSS roll. Zero dependencies; runs in Node at build time and in the browser.",
5
5
  "main": "dice.js",
6
6
  "types": "dice.d.ts",