From 61131436b7bdf76da4a16d53e864cddfd0cf828d Mon Sep 17 00:00:00 2001 From: Freymaurer Date: Thu, 5 Oct 2023 18:40:58 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Freymaur?= =?UTF-8?q?er/Dicacle@07cc9984e12a6a3527b9e45180f5db4d8e01a2a8=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{index-46ea38b8.js => index-2916af0c.js} | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{index-46ea38b8.js => index-2916af0c.js} (97%) diff --git a/assets/index-46ea38b8.js b/assets/index-2916af0c.js similarity index 97% rename from assets/index-46ea38b8.js rename to assets/index-2916af0c.js index f41e774..509809a 100644 --- a/assets/index-46ea38b8.js +++ b/assets/index-2916af0c.js @@ -53,4 +53,4 @@ to match the type %s to match the type %s`))(Ee)(he)}}}case 54:{const z=d0();return gl(Et(D=>pe(D,z),h0))}case 55:{const z=p0();return Et(D=>pe(D,z),m0)}case 56:{const z=g0();return Et(D=>pe(D,z),Dy(y0))}case 57:{const z=v0();return I4(Et(D=>pe(D,z),w0),{Compare:mn})}case 58:{const z=_0();return Et(D=>pe(D,z),S0)}case 59:{const z=E0();return $e(D=>pe(D[1],D[0]),ba(z,gl(C0)),null)}case 60:{const z=k0(),D=z[1],$=z[0];return B2(D,(i=yl(_a),$e(B=>{let G,Q,Ve,Ee;const he=B.FieldType,Y=B.FieldName,V=np(te=>Y===te[0],i);if(V==null){if(he.tag===27)return;{let te;const ft=se(", ",(G=yl(_a),Q=(Ve=(Ee=Te(H("'%s'")),Ee),fs=>Ve(fs[0])),Et(Q,G)));te=Te(H("[ %s ]"))(ft);let _t;const Jn=se(", ",$e(fs=>{const O0=fs.FieldName;return fs.FieldType.tag===27?Te(H("optional('%s')"))(O0):Te(H("required('%s')"))(O0)},$,null));_t=Te(H("[ %s ]"))(Jn);const Sa=Ye(D);return xe(H("Could not find the required key '%s' in the JSON object literal with keys %s to match with record type '%s' that has fields %s"))(Y)(te)(Sa)(_t)}}else return V[0],pe(V[1],he)},$,null)))}case 61:{const z=x0(),D=z[0],$=oe(N(()=>En(B=>{let G;return F(pe(B,new J(32,[(G=[D,z[1]],()=>G)])))},N0)));switch(D.tag){case 6:case 2:case 7:return bn($,{Compare:nr});default:return bn($,{Compare:mn})}}case 62:{const z=I0(),D=z[0],$=oe(N(()=>En(Q=>F(pe(Q,new J(32,[()=>[D,z[1]]]))),T0))),B=D.tag===40?new ml([],{Equals:me,GetHashCode:Ja}):D.tag===39?new ml([],{Equals:me,GetHashCode:yt}):new ml([],{Equals:me,GetHashCode:yt}),G=Ce($);try{for(;G["System.Collections.IEnumerator.MoveNext"]();){const Q=G["System.Collections.Generic.IEnumerator`1.get_Current"]();wf(B,Q[0],Q[1])}}finally{ye(G)}return B}case 63:{const z=M0(),D=z[0],$=Et(Q=>[pe(new fe(1,[Q[0]]),D),pe(Q[1],z[1])],yl(A0)),B=D.tag===40?new ml([],{Equals:me,GetHashCode:Ja}):D.tag===39?new ml([],{Equals:me,GetHashCode:yt}):new ml([],{Equals:me,GetHashCode:yt}),G=Ce($);try{for(;G["System.Collections.IEnumerator.MoveNext"]();){const Q=G["System.Collections.Generic.IEnumerator`1.get_Current"]();wf(B,Q[0],Q[1])}}finally{ye(G)}return B}case 64:{const z=D0(),D=z.tag===40?new ic([],{Equals:me,GetHashCode:Ja}):z.tag===39?new ic([],{Equals:me,GetHashCode:yt}):new ic([],{Equals:me,GetHashCode:yt}),$=Ce(F0);try{for(;$["System.Collections.IEnumerator.MoveNext"]();)EE(pe($["System.Collections.Generic.IEnumerator`1.get_Current"](),z),D)}finally{ye($)}return D}case 65:{const z=R0(),D=z[1],$=z[0],B=Dn("comparer",cs),G=Dn("tree",cs);let Q,Ve,Ee;switch(B!=null&&B.tag===5&&G!=null?G.tag===4?(G.fields[0],vp(B.fields[0])?(Q=0,B.fields[0],Ve=G.fields[0]):Q=2):G.tag===5?(G.fields[0],vp(B.fields[0])?(Q=1,B.fields[0],Ee=G.fields[0]):Q=2):Q=2:Q=2,Q){case 0:{const he=Ff(new fe(4,[Ve]));if(he==null){const Y=uo(new fe(4,[Ve]));return xe(H(`Could not generate map from JSON - %s`))(Y)}else{const Y=Et(V=>{const te=V[0];return[Si(te)?pe(oc(te),$):pe(new fe(1,[te]),$),pe(V[1],D)]},Df(he));switch($.tag){case 6:case 2:case 7:return bn(Y,{Compare:nr});default:return bn(Y,{Compare:mn})}}}case 1:{e=new fe(5,[bn(Rf(Ee),{Compare:nr})]),t=u;continue e}case 2:{const he=Et(Y=>{const V=Y[0];return[Si(V)?pe(oc(V),$):ci($)||Zl($)?pe(new fe(1,[V]),$):pe(oc(V),$),pe(Y[1],D)]},yl(cs));switch($.tag){case 6:case 2:case 7:return bn(he,{Compare:nr});default:return bn(he,{Compare:mn})}}}}case 66:{const z=fl(),D=uo(s),$=Qe(z);return xe(H("Cannot convert %s to %s"))(D)($)}case 67:{const z=uo(s),D=JSON.stringify(u);return xe(H("Cannot convert %s to %s"))(z)(D)}}break}}function pa(e,t){return pe(e,t)}const Ds=Z4;function qe(e,t){let n;e:for(;;){const r=e,l=t;switch(l.tag){case 2:{const o=r;return o==null?"null":Ds(o)}case 0:return"null";case 9:case 8:return Number.isNaN(r)?Ds("NaN"):r.toString();case 1:return Ds(r);case 13:case 14:case 3:case 4:case 11:case 38:case 20:case 6:return of(r);case 5:case 12:return cn(tp(r));case 19:return cn(ZC(r));case 10:return cn(af(r));case 7:return r?"true":"false";case 21:return cn((n=r,n));case 22:return cn(Ht(r));case 15:return cn(Ao(r,"O"));case 16:return cn(Ao(r,"O"));case 17:return of(e4(r));case 18:return cn(tp(t4(r)));case 39:return"{"+se(", ",$e(o=>{const i=z2(r,o.PropertyInfo),s=qe(i,o.FieldType);return Te(H('"%s": %s'))(o.FieldName)(s)},l.fields[0]()[0],null))+"}";case 35:{const o=l.fields[0]();return"["+se(", ",ae(i=>qe(i,o),r))+"]"}case 36:{const o=l.fields[0]();return"["+se(", ",ae(i=>qe(i,o),r))+"]"}case 29:{const o=l.fields[0]();return"["+se(", ",ae(i=>qe(i,o),r))+"]"}case 30:{const o=l.fields[0]();return"["+se(", ",$e(i=>qe(i,o),r,null))+"]"}case 28:{const o=l.fields[0]();return"["+se(", ",Et(i=>qe(i,o),r))+"]"}case 31:{const o=l.fields[0]();return"["+se(", ",$e(i=>qe(i,o),$l(r),null))+"]"}case 27:{const o=r;if(o!=null){e=Se(o),t=l.fields[0]();continue e}else return"null"}case 40:{const o=l.fields[0](),i=L2(r,o[1]),s=i[0],u=i[1],a=hS(c=>c.CaseName===Ye(s),o[0]).CaseTypes;if(Zl(l)||a.length===0)return cn(Ye(s));if(a.length===1)return"{"+cn(Ye(s))+": "+qe(u[0],a[0])+"}";{const c=se(", ",ff((d,f)=>qe(u[d],f),a,null));return"{"+cn(Ye(s))+": ["+c+"] }"}}case 33:{const o=l.fields[0](),i=o[0],s=se(", ",$e(u=>{const a=qe(u[0],i),c=qe(u[1],o[1]);return ci(i)||Zl(i)?Si(a)?a+": "+c:Ds(a)+": "+c:"["+a+", "+c+"]"},WE(r),null));return ci(i)||Zl(i)?"{"+s+"}":"["+s+"]"}case 34:{const o=l.fields[0](),i=o[0],s=se(", ",ae(u=>{const a=qe(u[0],i),c=qe(u[1],o[1]);return ci(i)||Zl(i)?Si(a)?a+": "+c:cn(a)+": "+c:"["+a+", "+c+"]"},r));return ci(i)||Zl(i)?"{"+s+"}":"["+s+"]"}case 32:{const o=l.fields[0]();return o.length===1?"["+qe(r,o[0])+"]":"["+se(", ",ff((i,s)=>qe(s,o[i]),r,null))+"]"}case 23:return xp(r);case 24:return xp(r);default:return"null"}break}}function Fy(e){const t=qe(e,ge(bi("System.Collections.Generic.Dictionary`2",[Ol,Ol])));localStorage.setItem("DiceStorage",t)}function sk(){let e;try{return e=ss(localStorage.getItem("DiceStorage")),e!=null?pa(e,ge(bi("System.Collections.Generic.Dictionary`2",[Ol,Ol]))):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("DiceStorage"),sa(H("Could not find DiceStorage"));return}}function Ry(e){const t=qe(e,ge(Pl(Hg())));localStorage.setItem("History",t)}function uk(){let e;try{return e=ss(localStorage.getItem("History")),e!=null?pa(e,ge(Pl(Hg()))):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("History"),sa(H("Could not find History"));return}}function Py(e){const t=qe(e,ge(bi("Microsoft.FSharp.Collections.FSharpSet`1",[Ol])));localStorage.setItem("QuickAccess",t)}function ak(){let e;try{return e=ss(localStorage.getItem("QuickAccess")),e!=null?pa(e,ge(bi("Microsoft.FSharp.Collections.FSharpSet`1",[Ol]))):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("QuickAccess"),sa(H("Could not find QuickAccess"));return}}class Kd extends tt{constructor(t,n){super(),this.Name=t,this.DiceString=n}}function Oy(){return new Kd("","")}class $n extends tt{constructor(t,n,r,l,o){super(),this.Input=t,this.Results=n,this.DiceStorage=r,this.History=l,this.QuickAccess=o}}function ck(){let e,t,n;const r=sk();return n=Ln(r,new Map([])),new $n("",void 0,n,Ln(uk(),[]),N4(o=>n.has(o),(e=ak(),t=x4({Compare:nr}),Ln(e,t))))}function Gp(e){return e.Input!==""?Fg(e.Input,0,1):""}class Ly extends tt{constructor(t){super(),this.IsActive=t}}function fk(){return new Ly(!1)}const dk=""+new URL("dice-d4-1964b8dc.svg",import.meta.url).href,hk=""+new URL("dice-d6-a33df87d.svg",import.meta.url).href,pk=""+new URL("dice-d8-782600dd.svg",import.meta.url).href,mk=""+new URL("dice-d10-b415942f.svg",import.meta.url).href,gk=""+new URL("dice-d12-2bc389b8.svg",import.meta.url).href,yk=""+new URL("dice-d20-e0ea49df.svg",import.meta.url).href,vk=""+new URL("dice-alt-0d13a200.svg",import.meta.url).href,wk=dk,_k=hk,Sk=pk,Ck=mk,Ek=gk,kk=yk,xk=vk,Wp=["3d6 + 1d11","2 (1d20+14) (1d20+9)","2d20k1 + 9","1d12 + 12 + 2d6"];function $y(){const e=jg();return Wp[e.Next1(Wp.length)]}function Nk(e,t){let n;const r=t===4?wk:t===6?_k:t===8?Sk:t===10?Ck:t===12?Ek:t===20?kk:xk,l=e>t?["className","has-text-link"]:e===t?["className","has-text-success-dark"]:e===1?["className","has-text-danger"]:["className","is-black"];return h.createElement("span",O(K("icon",S([["className","is-medium"],["style",{position:"relative"}],(n=[h.createElement("img",{style:{opacity:.4},src:r}),h.createElement("span",O(S([l,["style",{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:2,fontSize:1.5+"rem",fontWeight:"bold"}],["children",e]])))],["children",v.Children.toArray(Array.from(n))])]))))}function Ik(e){const t=e.Dice.DiceSize|0,n=h.createElement("span",{className:"mr-2 dice-result-subsum",children:`${rC(e.Dice.Command)}${e.DiceRollSum}`}),r=t===0?X(n):oe(N(()=>ee(F(n),N(()=>ee(F(h.createElement("span",{children:["["]})),N(()=>ee(En(l=>{const o=e.DiceRolled[l]|0,i=l===e.DiceRolled.length-1;return ee(F(Nk(o,t)),N(()=>i?Ue():F(h.createElement("span",{children:[" + "]}))))},da(0,1,e.DiceRolled.length-1)),N(()=>F(h.createElement("span",{children:["]"]}))))))))));return h.createElement("span",{children:v.Children.toArray(Array.from(r))})}function zy(e){let t,n,r;const l=VS(o=>me(o.Dice.Command,new ji(1,[]))?o.DiceRollSum*-1|0:o.DiceRollSum|0,e.Results,{GetZero:()=>0,Add:(o,i)=>o+i})|0;return h.createElement("div",O(S([["className","dice-result-container is-flex is-align-items-center"],(t=[h.createElement("span",O(S([["className","dice-result-subsum-container"],["style",{fontSize:"10px"}],(n=oe(N(()=>ae(Ik,e.Results))),["children",v.Children.toArray(Array.from(n))])]))),h.createElement("span",O(S([["className","dice-roll-sum"],["style",{marginLeft:"auto",minWidth:"max-content"}],(r=[h.createElement("span",{children:[" = "]}),h.createElement("span",{style:{fontWeight:"bold"},children:l})],["children",v.Children.toArray(Array.from(r))])])))],["children",v.Children.toArray(Array.from(t))])])))}const Tk=e=>{h.useEffect(()=>{const t=e();return()=>{t.Dispose()}})},Ak=(e,t)=>{h.useEffect(()=>{const n=e();return()=>{n.Dispose()}},t)},Mk=e=>{h.useLayoutEffect(()=>{const t=e();return()=>{t.Dispose()}})},Dk=Tk,By=Ak,Fk=Mk;function Rk(e,t,n,r){const l=v.memo(e,F_(2,Ln(R_(2,n),Ke())));return jo(o=>{e.displayName=o},xg(t)),o=>{const i=Pk(r,o);return v.createElement(l,i)}}function Pk(e,t){if(e==null)return t;{const n=e;return t.key=n(t),t}}function ma(e){return{Dispose(){e()}}}function ga(e){return v.useState(e)}function Ok(e,t){By(e,t)}function Lk(e){Fk(t=>(e(),ma(()=>{})))}function $k(e){const t=v.useRef(!1);Uk(()=>{t.current||(t.current=!0,e())},[])}function zk(e){const t=v.useRef(void 0),n=v.useRef(!1),r=v.useRef(!1);n.current&&(r.current=!0),Ok(()=>{let l;return n.current?l=void 0:(n.current=!0,t.current=Gt(e()),l=r.current?t.current:void 0),{Dispose(){jo(o=>{ye(o)},xg(l))}}},[])}function Bk(e){Dk(t=>(e(),ma(()=>{})))}function Uk(e,t){By(n=>(e(),ma(()=>{})),t)}function Vk(e,t){const n=Ln(t,[]);return v.useCallback(e,n)}function Hk(e){return v.useRef(e)}function jk(e,t,n){return Rk(e,void 0,n,t)}function Gk(e){const t=Hk(e),n=Vk(r=>t.current(r),[]);return Lk(()=>{t.current=e}),n}function ya(e){return v.useState(e)}function Wk(e,t,n){const r=e,l=r[2],o=r[0];let i;switch(r[1]?l?o.toLocaleLowerCase()===n.key.toLocaleLowerCase()&&n.ctrlKey&&n.shiftKey?i=0:i=4:o.toLocaleLowerCase()===n.key.toLocaleLowerCase()&&n.ctrlKey?i=1:i=4:l?o.toLocaleLowerCase()===n.key.toLocaleLowerCase()&&n.shiftKey?i=2:i=4:o.toLocaleLowerCase()===n.key.toLocaleLowerCase()?i=3:i=4,i){case 0:{t(n);break}case 1:{t(n);break}case 2:{t(n);break}case 3:{t(n);break}}}function Qk(e){return[e,!1,!1]}const Kk=Qk("Escape"),Uy="dice-storage-new-name",Vy="dice-storage-new-diceString",Jk=(()=>{let e,t;const n=X(h.createElement("td",O(S([["colSpan",2],["style",{textAlign:"center"}],(e=[h.createElement("span",O(K("icon",S([["className","is-large"],(t=[h.createElement("i",{className:"fa-solid fa-broom fa-shake fa-2xl"})],["children",v.Children.toArray(Array.from(t))])])))),h.createElement("span",{children:["..empty"]})],["children",v.Children.toArray(Array.from(e))])]))));return h.createElement("tr",{children:v.Children.toArray(Array.from(n))})})();function Zk(e,t,n){let r,l,o;return h.createElement("div",O(K("field",S([["className","has-addons"],(r=[(l=X(h.createElement("button",O(K("button",S([["tabIndex",-1],["className","is-static"],["children","/"]]))))),h.createElement("div",{className:"control",children:v.Children.toArray(Array.from(l))})),h.createElement("div",O(K("control",S([["className","is-flex-grow-1"],(o=[h.createElement("input",O(be(["type","text"],K("input",oe(N(()=>ee(F(["id",Uy]),N(()=>ee(e.DiceStorage.has(t.Name)?F(["className","is-danger"]):Ue(),N(()=>ee(F(["autoFocus",!0]),N(()=>ee(F(["tabIndex",0]),N(()=>ee(F(["placeholder","..name"]),N(()=>F(["onChange",i=>{n(new Kd(i.target.value,t.DiceString))}])))))))))))))))))],["children",v.Children.toArray(Array.from(o))])]))))],["children",v.Children.toArray(Array.from(r))])]))))}function qk(e,t){let n,r,l;return h.createElement("div",O(K("field",X((n=[h.createElement("div",O(K("control",S([["className","has-icons-left"],(r=[h.createElement("input",O(be(["type","text"],K("input",S([["id",Vy],["tabIndex",0],["placeholder",$y()],["onChange",o=>{t(new Kd(e.Name,o.target.value))}]]))))),h.createElement("span",O(K("icon",S([["className","is-left"],["className","is-small"],(l=[h.createElement("i",{className:"fa-solid fa-dice-d20"})],["children",v.Children.toArray(Array.from(l))])]))))],["children",v.Children.toArray(Array.from(r))])]))))],["children",v.Children.toArray(Array.from(n))])))))}function Yk(e,t,n,r,l){const o=new $n(t.Input,t.Results,t.DiceStorage,t.History,S4(t.QuickAccess,e));n(o),Py(o.QuickAccess)}function Hy(e,t,n,r,l){const o=new $n(t.Input,t.Results,t.DiceStorage,t.History,C4(t.QuickAccess,e));n(o),Py(o.QuickAccess)}function Xk(e,t,n,r){wf(e.DiceStorage,n.Name,n.DiceString),t(new $n(e.Input,e.Results,e.DiceStorage,e.History,e.QuickAccess)),r(Oy());const l=document.getElementById(Uy),o=document.getElementById(Vy);l.value=Ke(),o.value=Ke(),Fy(e.DiceStorage)}function bk(e,t,n,r,l){t.DiceStorage.delete(e),n(new $n(t.Input,t.Results,t.DiceStorage,t.History,t.QuickAccess)),Fy(t.DiceStorage),Hy(e,t,n)}function ex(e,t,n,r,l){const o=X(h.createElement("input",O(be(["type","checkbox"],K("checkbox",S([["defaultChecked",Ay(t.QuickAccess,e)],["onChange",i=>{i.target.checked?Yk(e,t,n):Hy(e,t,n)}]]))))));return h.createElement("label",{className:"label",children:v.Children.toArray(Array.from(o))})}function tx(e,t,n,r){let l;const o=X((l=oe(N(()=>{let i,s;return e.DiceStorage.size>0?ee(F((i=X((s=S([h.createElement("th",{children:["Shortcut"]}),h.createElement("th",{children:["Dice"]}),h.createElement("th",{children:["Quick Access"]}),h.createElement("th",{})]),h.createElement("tr",{children:v.Children.toArray(Array.from(s))}))),h.createElement("thead",{children:v.Children.toArray(Array.from(i))}))),N(()=>{let u;return F((u=oe(N(()=>En(a=>{let c,d,f,y,w,C;const R=a,m=R[0];return F(h.createElement("tr",O(S([["key",(c=Te(H("Stored-Dice-%s")),c(m))],(d=[h.createElement("td",{key:(f=Te(H("Stored-Dice-Name-%s")),f(m)),children:h.createElement("code",{children:["/"+m]})}),h.createElement("td",{key:(y=Te(H("Stored-Dice-diceString-%s")),y(m)),children:R[1]}),h.createElement("td",{key:(w=Te(H("Stored-Dice-quick-access-%s")),w(m)),children:ex(m,e,t)}),h.createElement("td",{key:(C=Te(H("Stored-Dice-remove-%s")),C(m)),children:h.createElement("button",O(K("delete",S([["style",{float:"right"}],["onClick",p=>{bk(m,e,t)}]]))))})],["children",v.Children.toArray(Array.from(d))])]))))},e.DiceStorage))),h.createElement("tbody",{children:v.Children.toArray(Array.from(u))})))})):F(h.createElement("tbody",{children:v.Children.toArray([Jk])}))})),h.createElement("table",{className:"table",children:v.Children.toArray(Array.from(l))})));return h.createElement("div",{className:"table-container",children:v.Children.toArray(Array.from(o))})}function nx(e,t,n,r){let l,o,i,s;const u=S([(l=X(Zk(e,n,r)),h.createElement("div",{className:"column",children:v.Children.toArray(Array.from(l))})),(o=X(qk(n,r)),h.createElement("div",{className:"column",children:v.Children.toArray(Array.from(o))})),h.createElement("div",O(K("column",S([["className","is-narrow"],(i=[h.createElement("div",O(K("control",S([["className","is-flex is-justify-content-end"],(s=[h.createElement("button",O(K("button",oe(N(()=>{const a=!e.DiceStorage.has(n.Name),c=n.Name!==""&&n.DiceString!==""&&a;return ee(F(["children",n.Name==="fireball"&&a?"🔥":"+"]),N(()=>ee(F(["role",se(" ",["button"])]),N(()=>ee(c?Ue():F(["className","is-static"]),N(()=>ee(F(["style",{borderRadius:"4px"}]),N(()=>ee(F(["tabIndex",0]),N(()=>F(["onClick",d=>{c&&Xk(e,t,n,r)}])))))))))))})))))],["children",v.Children.toArray(Array.from(s))])]))))],["children",v.Children.toArray(Array.from(i))])]))))]);return h.createElement("div",{className:"columns",children:v.Children.toArray(Array.from(u))})}function rx(e){let t,n,r,l,o;const i=e.rmv,s=e.setState,u=e.state,a=ga(Oy),c=a[1],d=a[0],f=y=>{i(),document.getElementById("dice-roller-input").focus()};return h.createElement("div",O(K("modal",S([["onKeyDown",y=>{Wk(Kk,f,y)}],["className","is-active"],(t=[h.createElement("div",O(K("modal-background",X(["onClick",f])))),(n=X((r=X((l=S([h.createElement("h1",{children:["Dice Storage"]}),(o=S([h.createElement("span",{children:["Type "]}),h.createElement("code",{children:["/placeholder"]}),h.createElement("span",{children:["in main field to quick access any stored dice!"]})]),h.createElement("p",{className:"help",children:v.Children.toArray(Array.from(o))})),tx(u,s),nx(u,s,d,c)]),h.createElement("div",{className:"content",children:v.Children.toArray(Array.from(l))}))),h.createElement("div",{className:"box",children:v.Children.toArray(Array.from(r))}))),h.createElement("div",{className:"modal-content",children:v.Children.toArray(Array.from(n))})),h.createElement("button",O(K("modal-close",S([["className","is-medium"],["className","has-background-black"],["aria-label","close"],["onClick",f]]))))],["children",v.Children.toArray(Array.from(t))])]))))}function lx(e,t,n){let r;const l="/"+e;return h.createElement("span",O(K("tag",S([["title",t],["style",{cursor:"pointer"}],["onClick",o=>{n(t)}],(r=[h.createElement("code",{style:{userSelect:"none"},children:l})],["children",v.Children.toArray(Array.from(r))])]))))}function ox(e,t){const n=oe(N(()=>ae(r=>lx(r,fr(e.DiceStorage,r),t),e.QuickAccess)));return h.createElement("div",{className:"tags",children:v.Children.toArray(Array.from(n))})}function ix(e){const t=oe(N(()=>ae(n=>{let r,l;return h.createElement("li",O(S([["key",(r=Te(H("set-index-%i")),r(n.Index))],(l=[zy(n)],["children",v.Children.toArray(Array.from(l))])])))},e.Results)));return h.createElement("ol",{children:v.Children.toArray(Array.from(t))})}const sx=(()=>{const e=X(h.createElement("div",O(K("notification",S([["className","mb-1"],["children","History is empty"]])))));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(e))})})();function ux(e,t,n){let r,l,o;return h.createElement("div",O(S([["className","mb-1"],(r=[h.createElement("code",{children:[e.Input]}),h.createElement("button",O(K("button",S([["onClick",i=>{n(new $n(e.Input,t.Results,t.DiceStorage,t.History,t.QuickAccess))}],["className","is-small"],["className","is-ghost"],["style",{float:"right"}],(l=[(o=X(h.createElement("i",{className:"fa-regular fa-paste"})),h.createElement("span",{className:"icon",children:v.Children.toArray(Array.from(o))}))],["children",v.Children.toArray(Array.from(l))])]))))],["children",v.Children.toArray(Array.from(r))])])))}function ax(e){let t;return h.createElement("div",O(S([["className","mb-1"],(t=[h.createElement("p",O(K("help",X(["children",K2(e.Time)+" "+J2(e.Time)]))))],["children",v.Children.toArray(Array.from(t))])])))}function cx(e,t){return h.createElement("button",O(K("button",S([["onClick",n=>{const r=new $n(e.Input,e.Results,e.DiceStorage,[],e.QuickAccess);t(r),Ry(r.History)}],["className","is-danger"],["className","is-fullwidth"],["children","Clear History"]]))))}function fx(e,t){let n;return h.createElement("div",O(K("field",S([["id","history-container"],(n=oe(N(()=>e.History.length===0?F(sx):ee(ae(r=>{const l=oe(N(()=>ee(F(ax(r)),N(()=>ee(F(ux(r,e,t)),N(()=>ae(ix,r.DiceSets)))))));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(l))})},e.History),N(()=>F(cx(e,t)))))),["children",v.Children.toArray(Array.from(n))])]))))}function dx(e,t){let n;return h.createElement("button",O(K("button",S([["id","dice-roller-history-toggle-button"],["role",se(" ",["button"])],["title","Toggle History"],["onClick",r=>{t(new Ly(!e.IsActive))}],(n=[h.createElement("span",O(K("icon",S([["className","is-small"],["children",h.createElement("i",{className:"fa-regular fa-rectangle-list"})]]))))],["children",v.Children.toArray(Array.from(n))])]))))}function hx(e){let t,n;const r=e.setDicacleState,l=e.diceState,o=ga(fk),i=o[0];return h.createElement("div",O(S([["id","dice-roller-history"],["style",O(oe(N(()=>i.IsActive?Ue():F(["minWidth","unset"]))))],(t=[dx(i,o[1]),h.createElement("div",O(S([["id","dice-roller-history-inner"],["style",O(oe(N(()=>i.IsActive?Ue():F(["display","none"]))))],(n=[fx(l,r)],["children",v.Children.toArray(Array.from(n))])])))],["children",v.Children.toArray(Array.from(t))])])))}function jy(e,t,n){const r=CE(e.indexOf("/")===0?fr(t.DiceStorage,e.slice(1,e.length)):e);console.log(Gt("[DICE]"),r);const l=200;n(new $n(e,r,t.DiceStorage,(t.History.push(r),t.History.length>=l&&t.History.splice(l,t.History.length-l),Ry(t.History),t.History),t.QuickAccess))}function Gy(e,t){jy(e.Input,e,t)}function Qp(e,t,n){let r;const l=Ln(e,-1)|0;if(r=n?D_(nr,l+1,t.length-1):l-1,!(r<0))return r}function px(e){let t;const n=e.setState,r=e.state,l=$y(),o=r.Input.indexOf("/")===0,i=o&&r.DiceStorage.has(Gp(r)),s=Gp(r),u=$l(N(()=>En(f=>f[0].indexOf(s)===0&&f[0]!==s?F(f):Ue(),r.DiceStorage))),a=ya(void 0),c=a[0],d=a[1];return h.createElement("div",O(S([["style",{display:"flex",position:"relative",zIndex:1}],(t=oe(N(()=>ee(F(h.createElement("input",O(be(["type","text"],K("input",oe(N(()=>ee(F(["className","is-large"]),N(()=>ee(F(["placeholder",l]),N(()=>ee(F(["autoFocus",!0]),N(()=>ee(i?F(["className","has-text-danger-dark"]):Ue(),N(()=>{let f;return ee(F((f=r.Input,["ref",y=>{y!=null&&!me(y.value,f)&&(y.value=f)}])),N(()=>ee(F(["onChange",y=>{const w=new $n(y.target.value,r.Results,r.DiceStorage,r.History,r.QuickAccess);d(void 0),n(w)}]),N(()=>ee(F(["id","dice-roller-input"]),N(()=>F(["onKeyDown",y=>{if(o&&u.length>0){const w=y.which;w===40?d(Qp(c,u,!0)):w===38?d(Qp(c,u,!1)):w===13&&c!=null&&(n(new $n("/"+u[Se(c)][0],r.Results,r.DiceStorage,r.History,r.QuickAccess)),d(void 0))}else y.which===13&&(Gy(r,n),d(void 0))}])))))))}))))))))))))))),N(()=>{let f;return o?F(h.createElement("div",{id:"command-container",style:{backgroundColor:"#F5F5F5",zIndex:3,position:"absolute",top:"100%",left:0,width:"100%",maxHeight:"100px"},children:(f=oe(N(()=>En(y=>{let w,C;const R=u[y];return F(h.createElement("li",O(S([["style",O(oe(N(()=>c!=null&&Se(c)===y?F(["filter","brightness(85%)"]):Ue())))],(w=[h.createElement("div",O(S([["onClick",m=>{n(new $n("/"+R[0],r.Results,r.DiceStorage,r.History,r.QuickAccess))}],(C=[h.createElement("code",{children:["/"+R[0]]}),h.createElement("span",{children:[R[1]]})],["children",v.Children.toArray(Array.from(C))])])))],["children",v.Children.toArray(Array.from(w))])]))))},da(0,1,u.length-1)))),h.createElement("ul",{children:v.Children.toArray(Array.from(f))}))})):Ue()})))),["children",v.Children.toArray(Array.from(t))])])))}function mx(e){const t=oe(N(()=>ae(n=>{let r,l;return h.createElement("li",O(S([["key",(r=Te(H("set-index-%i")),r(n.Index))],(l=[zy(n)],["children",v.Children.toArray(Array.from(l))])])))},e.Results)));return h.createElement("ol",{children:v.Children.toArray(Array.from(t))})}function gx(e){const t=oe(N(()=>e.Results==null?F(Ke()):ae(n=>{const r=X(mx(n));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(r))})},Se(e.Results).DiceSets)));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(t))})}function yx(e){const t=e.setState,n=e.state,r=ya(!1),l=r[1],o=r[0],i=oe(N(()=>ee(o?F(h.createElement(rx,{state:n,setState:t,rmv:()=>{l(!1)}})):Ue(),N(()=>F(h.createElement("button",O(K("button",S([["style",{zIndex:1}],["className","is-large"],["id","dice-roller-dice-storage"],["title","Manage stored dice"],["role",se(" ",["button"])],["children","+"],["onClick",s=>{l(!o)}]])))))))));return h.createElement("div",{children:v.Children.toArray(Array.from(i))})}function vx(e,t){return h.createElement("button",O(K("button",S([["id","dice-roller-button"],["className","is-large"],["role",se(" ",["button"])],["onClick",n=>{Gy(e,t)}],["children",h.createElement("span",O(K("icon",vt())))]]))))}function wx(){let e,t,n,r,l,o,i,s;const u=ga(ck),a=u[0],c=u[1];return h.createElement("div",O(S([["className","is-flex is-flex-grow-1"],["style",{maxHeight:"100%",overflow:"hidden"}],(e=[(t=X(h.createElement("div",O(K("container",S([["className","is-max-desktop"],(n=[(r=X(ox(a,d=>{jy(d,a,c)})),h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(r))})),h.createElement("div",O(K("field",S([["id","dice-roller-container"],["onAnimationEnd",d=>{const f=document.getElementById("dice-roller-container");f.style.animation="initial"}],["className","has-addons"],(l=[(o=X(h.createElement(yx,{state:a,setState:c})),h.createElement("div",{className:"control",children:v.Children.toArray(Array.from(o))})),h.createElement("div",O(K("control",S([["className","is-expanded"],(i=[h.createElement(px,{state:a,setState:c})],["children",v.Children.toArray(Array.from(i))])])))),(s=oe(N(()=>{let d;return ee(a.Input.toLocaleLowerCase()==="/fireball"||a.Input===fr(a.DiceStorage,"fireball")?F(h.createElement("div",O(S([["style",{position:"fixed"}],(d=[h.createElement("div",{className:"glow"}),h.createElement("div",{className:"flame"})],["children",v.Children.toArray(Array.from(d))])])))):Ue(),N(()=>F(vx(a,c))))})),h.createElement("div",{className:"control",children:v.Children.toArray(Array.from(s))}))],["children",v.Children.toArray(Array.from(l))])])))),gx(a)],["children",v.Children.toArray(Array.from(n))])]))))),h.createElement("div",{className:"hero-body",children:v.Children.toArray(Array.from(t))})),h.createElement(hx,{diceState:a,setDicacleState:c})],["children",v.Children.toArray(Array.from(e))])])))}class Zr extends Hn{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Dicacle","Reference","NotFound"]}}function _x(e){switch(e.tag){case 1:return"#/reference";case 2:return"#/404";default:return"#/"}}function Kp(e){let t;switch(U(e)?t=0:T(e)==="/"?U(k(e))?t=0:t=2:T(e)==="reference"&&U(k(e))?t=1:t=2,t){case 0:return new Zr(0,[]);case 1:return new Zr(1,[]);case 2:return new Zr(2,[])}}function Sx(e){let t;switch(e===""||e==="#/"?t=0:e==="#/reference"?t=1:t=2,t){case 0:return new Zr(0,[]);case 1:return new Zr(1,[]);case 2:return new Zr(2,[])}}function Cx(e){switch(e.tag){case 1:return"Reference";case 2:return"404";default:return"Dicacle"}}function Jp(e,t){if(t.indexOf(e)===0)return t}function Zp(e,t){if(Fu(t,e))return t}function Wy(e,t){return wS(n=>{if(b2(n))return vt();{const r=iS(n,"#");if(r==="?")return vt();if(Jp("?",r)!=null)return X(r);{const l=r.split("?");if(!df((o,i)=>o===i,l,Ke())&&l.length===1){const o=l[0];return X(decodeURIComponent(o))}else if(!df((o,i)=>o===i,l,Ke())&&l.length===2)if(l[1]===""){const o=l[0];return X(decodeURIComponent(o))}else{const o=l[0],i=l[1];return S([decodeURIComponent(o),"?"+i])}else return vt()}}},S(lS(Jp("#",e)!=null?Rg(e,1,e.length-1):t===1&&(Zp("#",e)!=null||Zp("#/",e)!=null)?"":e,["/"],void 0,0)))}function Ex(e,t,n){return t(Wy(e===2?window.location.pathname+window.location.search:window.location.hash,e))}const kx=jk(e=>{const t=Gk(r=>{const l=Ln(e.onUrlChanged,o=>{});Ex(Ln(e.hashMode,1),l)});zk(()=>(window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.addEventListener("hashchange",t):window.addEventListener("popstate",t),window.addEventListener("CUSTOM_NAVIGATION_EVENT",t),ma(()=>{window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.removeEventListener("hashchange",t):window.removeEventListener("popstate",t),window.removeEventListener("CUSTOM_NAVIGATION_EVENT",t)}))),$k(()=>{const r=document.createEvent("CustomEvent");r.initEvent("CUSTOM_NAVIGATION_EVENT",!0,!0),window.dispatchEvent(r)});const n=e.application;return n??Ke()});class qp extends Hn{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Choice1Of2","Choice2Of2"]}}class Cl extends Hn{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Light","Dark","Auto"]}}function Jd(){return ts("Component.DarkModeButton.ColorMode",[],Cl,()=>[[],[],[["Item",Jd()]]])}function xx(e){let t;const n=e.tag===2?e.fields[0].tag===0?"fa-regular fa-sun":e.fields[0].tag===1?"fa-solid fa-moon":"":e.tag===1?"fa-solid fa-moon":"fa-regular fa-sun";return h.createElement("i",{className:(t=Te(H("%s fa-xl")),t(n))})}function Qy(e){let t;switch(e.tag===2?e.fields[0].tag===0?t=0:e.fields[0].tag===1?t=1:t=2:e.tag===1?t=1:t=0,t){case 0:return new qp(0,[void 0]);case 1:return new qp(1,[void 0]);case 2:throw new Error("This can never happen")}}function Nx(e){const t=qe(e,ge(Jd()));localStorage.setItem("ColorMode",t)}function Ix(){let e;try{return e=ss(localStorage.getItem("ColorMode")),e!=null?pa(e,ge(Jd())):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("ColorMode"),sa(H("Could not find %s"))("ColorMode");return}}function Tx(){return window.matchMedia("(prefers-color-scheme: dark)").matches?new Cl(2,[new Cl(1,[])]):new Cl(2,[new Cl(0,[])])}function Ax(){const e=document.getElementById("style-dark");document.getElementById("style-light"),e.disabled="disabled"}function Mx(){const e=document.getElementById("style-dark");e.removeAttribute("disabled"),e.removeAttribute("media")}function Ky(e){Qy(e).tag===1?Mx():Ax()}class Jy extends tt{constructor(t){super(),this.ColorMode=t}}function Dx(){const e=Tx(),t=Ln(Ix(),e);return Ky(t),new Jy(t)}function Fx(){let e;const t=ga(Dx),n=t[0];return Bk(()=>{Ky(n.ColorMode)}),h.createElement("a",O(K("navbar-item",S([["onClick",r=>{r.preventDefault();const l=Qy(n.ColorMode).tag===1?new Cl(0,[]):new Cl(1,[]);Nx(l),t[1](new Jy(l))}],(e=[h.createElement("span",O(K("icon",S([["className","is-medium"],["children",xx(n.ColorMode)]]))))],["children",v.Children.toArray(Array.from(e))])]))))}const Rx=""+new URL("logo-9903a27e.svg",import.meta.url).href;function Yp(e,t){return h.createElement("a",O(K("navbar-item",oe(N(()=>ee(me(e,t)?F(["className","is-active"]):Ue(),N(()=>ee(F(["href",_x(e)]),N(()=>F(["children",Cx(e)]))))))))))}function Px(){const e=Sx(window.location.hash),t=S([Yp(new Zr(0,[]),e),Yp(new Zr(1,[]),e)]);return h.createElement("div",{className:"navbar-start",children:v.Children.toArray(Array.from(t))})}const Ox=(()=>{let e;const t=S([h.createElement(Fx,null),h.createElement("a",O(K("navbar-item",S([["href","https://github.com/Freymaurer/Dicacle"],["target","_blank"],(e=[h.createElement("span",{children:["GitHub"]}),h.createElement("span",O(K("icon",S([["className","is-medium"],["children",h.createElement("i",{className:"fa-brands fa-github fa-xl"})]]))))],["children",v.Children.toArray(Array.from(e))])]))))]);return h.createElement("div",{className:"navbar-end",children:v.Children.toArray(Array.from(t))})})();function Lx(e){return h.createElement("div",O(K("navbar-menu",oe(N(()=>ee(e?F(["className","is-active"]):Ue(),N(()=>{let t;return F((t=[Px(),Ox],["children",v.Children.toArray(Array.from(t))]))})))))))}function $x(){let e,t,n,r,l;const o=ya(!1),i=o[0];return h.createElement("nav",O(K("navbar",S([["className","has-shadow"],["className","is-fixed-top"],["className","is-black"],(e=[(t=S([(n=X(h.createElement("span",O(K("icon",S([["className","is-medium"],(r=[h.createElement("img",{src:Rx,alt:"logo"})],["children",v.Children.toArray(Array.from(r))])]))))),h.createElement("a",{className:"navbar-item",children:v.Children.toArray(Array.from(n))})),h.createElement("a",O(K("navbar-burger",S([["aria-label","menu"],["aria-expanded",i],["role",se(" ",["button"])],["onClick",s=>{o[1](!i)}],(l=[h.createElement("span",{"aria-hidden":!0}),h.createElement("span",{"aria-hidden":!0}),h.createElement("span",{"aria-hidden":!0})],["children",v.Children.toArray(Array.from(l))])]))))]),h.createElement("div",{className:"navbar-brand",children:v.Children.toArray(Array.from(t))})),Lx(i)],["children",v.Children.toArray(Array.from(e))])]))))}const Xp=h.createElement("span",{children:" • ",className:"mx-1"}),zx=(()=>{let e,t,n,r;const l=X((e=S([(t=S([h.createElement("span",{children:["Icons from "]}),h.createElement("a",{href:"https://www.flaticon.com",children:"flaticon"})]),h.createElement("span",{children:v.Children.toArray(Array.from(t))})),Xp,(n=S([h.createElement("a",{href:"https://fable.io",children:"Fable"}),h.createElement("span",{children:[" |> ❤️"]})]),h.createElement("span",{children:v.Children.toArray(Array.from(n))})),Xp,(r=S([h.createElement("span",{children:["Usage under "]}),h.createElement("a",{href:"https://github.com/Freymaurer/Dicacle/blob/main/LICENSE",children:"GNU GPL"})]),h.createElement("span",{children:v.Children.toArray(Array.from(r))}))]),h.createElement("div",{className:"container",children:v.Children.toArray(Array.from(e))})));return h.createElement("div",{className:"hero-foot",children:v.Children.toArray(Array.from(l))})})();function Bx(){return h.createElement(JS,null)}function Ux(){return h.createElement(wx,null)}function Vx(){let e,t,n;const r=ya(Kp(Wy(window.location.hash,1)));return kx(O(S([["onUrlChanged",l=>{r[1](Kp(l))}],(e=X((t=S([h.createElement($x,null),h.createElement("section",O(K("hero",S([["className","is-fullheight-with-navbar"],(n=oe(N(()=>{let l;return ee((l=r[0],l.tag===1?F(Bx()):l.tag===2?F(h.createElement("h1",{children:["404: Page not found"]})):F(Ux())),N(()=>F(zx)))})),["children",v.Children.toArray(Array.from(n))])]))))]),h.createElement("div",{children:v.Children.toArray(Array.from(t))}))),["application",h.createElement(h.Fragment,{},...e)])])))}const Hx=cg(document.getElementById("feliz-app"));Hx.render(h.createElement(Vx,null)); + %s`))(Y)}else{const Y=Et(V=>{const te=V[0];return[Si(te)?pe(oc(te),$):pe(new fe(1,[te]),$),pe(V[1],D)]},Df(he));switch($.tag){case 6:case 2:case 7:return bn(Y,{Compare:nr});default:return bn(Y,{Compare:mn})}}}case 1:{e=new fe(5,[bn(Rf(Ee),{Compare:nr})]),t=u;continue e}case 2:{const he=Et(Y=>{const V=Y[0];return[Si(V)?pe(oc(V),$):ci($)||Zl($)?pe(new fe(1,[V]),$):pe(oc(V),$),pe(Y[1],D)]},yl(cs));switch($.tag){case 6:case 2:case 7:return bn(he,{Compare:nr});default:return bn(he,{Compare:mn})}}}}case 66:{const z=fl(),D=uo(s),$=Qe(z);return xe(H("Cannot convert %s to %s"))(D)($)}case 67:{const z=uo(s),D=JSON.stringify(u);return xe(H("Cannot convert %s to %s"))(z)(D)}}break}}function pa(e,t){return pe(e,t)}const Ds=Z4;function qe(e,t){let n;e:for(;;){const r=e,l=t;switch(l.tag){case 2:{const o=r;return o==null?"null":Ds(o)}case 0:return"null";case 9:case 8:return Number.isNaN(r)?Ds("NaN"):r.toString();case 1:return Ds(r);case 13:case 14:case 3:case 4:case 11:case 38:case 20:case 6:return of(r);case 5:case 12:return cn(tp(r));case 19:return cn(ZC(r));case 10:return cn(af(r));case 7:return r?"true":"false";case 21:return cn((n=r,n));case 22:return cn(Ht(r));case 15:return cn(Ao(r,"O"));case 16:return cn(Ao(r,"O"));case 17:return of(e4(r));case 18:return cn(tp(t4(r)));case 39:return"{"+se(", ",$e(o=>{const i=z2(r,o.PropertyInfo),s=qe(i,o.FieldType);return Te(H('"%s": %s'))(o.FieldName)(s)},l.fields[0]()[0],null))+"}";case 35:{const o=l.fields[0]();return"["+se(", ",ae(i=>qe(i,o),r))+"]"}case 36:{const o=l.fields[0]();return"["+se(", ",ae(i=>qe(i,o),r))+"]"}case 29:{const o=l.fields[0]();return"["+se(", ",ae(i=>qe(i,o),r))+"]"}case 30:{const o=l.fields[0]();return"["+se(", ",$e(i=>qe(i,o),r,null))+"]"}case 28:{const o=l.fields[0]();return"["+se(", ",Et(i=>qe(i,o),r))+"]"}case 31:{const o=l.fields[0]();return"["+se(", ",$e(i=>qe(i,o),$l(r),null))+"]"}case 27:{const o=r;if(o!=null){e=Se(o),t=l.fields[0]();continue e}else return"null"}case 40:{const o=l.fields[0](),i=L2(r,o[1]),s=i[0],u=i[1],a=hS(c=>c.CaseName===Ye(s),o[0]).CaseTypes;if(Zl(l)||a.length===0)return cn(Ye(s));if(a.length===1)return"{"+cn(Ye(s))+": "+qe(u[0],a[0])+"}";{const c=se(", ",ff((d,f)=>qe(u[d],f),a,null));return"{"+cn(Ye(s))+": ["+c+"] }"}}case 33:{const o=l.fields[0](),i=o[0],s=se(", ",$e(u=>{const a=qe(u[0],i),c=qe(u[1],o[1]);return ci(i)||Zl(i)?Si(a)?a+": "+c:Ds(a)+": "+c:"["+a+", "+c+"]"},WE(r),null));return ci(i)||Zl(i)?"{"+s+"}":"["+s+"]"}case 34:{const o=l.fields[0](),i=o[0],s=se(", ",ae(u=>{const a=qe(u[0],i),c=qe(u[1],o[1]);return ci(i)||Zl(i)?Si(a)?a+": "+c:cn(a)+": "+c:"["+a+", "+c+"]"},r));return ci(i)||Zl(i)?"{"+s+"}":"["+s+"]"}case 32:{const o=l.fields[0]();return o.length===1?"["+qe(r,o[0])+"]":"["+se(", ",ff((i,s)=>qe(s,o[i]),r,null))+"]"}case 23:return xp(r);case 24:return xp(r);default:return"null"}break}}function Fy(e){const t=qe(e,ge(bi("System.Collections.Generic.Dictionary`2",[Ol,Ol])));localStorage.setItem("DiceStorage",t)}function sk(){let e;try{return e=ss(localStorage.getItem("DiceStorage")),e!=null?pa(e,ge(bi("System.Collections.Generic.Dictionary`2",[Ol,Ol]))):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("DiceStorage"),sa(H("Could not find DiceStorage"));return}}function Ry(e){const t=qe(e,ge(Pl(Hg())));localStorage.setItem("History",t)}function uk(){let e;try{return e=ss(localStorage.getItem("History")),e!=null?pa(e,ge(Pl(Hg()))):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("History"),sa(H("Could not find History"));return}}function Py(e){const t=qe(e,ge(bi("Microsoft.FSharp.Collections.FSharpSet`1",[Ol])));localStorage.setItem("QuickAccess",t)}function ak(){let e;try{return e=ss(localStorage.getItem("QuickAccess")),e!=null?pa(e,ge(bi("Microsoft.FSharp.Collections.FSharpSet`1",[Ol]))):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("QuickAccess"),sa(H("Could not find QuickAccess"));return}}class Kd extends tt{constructor(t,n){super(),this.Name=t,this.DiceString=n}}function Oy(){return new Kd("","")}class $n extends tt{constructor(t,n,r,l,o){super(),this.Input=t,this.Results=n,this.DiceStorage=r,this.History=l,this.QuickAccess=o}}function ck(){let e,t,n;const r=sk();return n=Ln(r,new Map([])),new $n("",void 0,n,Ln(uk(),[]),N4(o=>n.has(o),(e=ak(),t=x4({Compare:nr}),Ln(e,t))))}function Gp(e){return e.Input!==""?Fg(e.Input,0,1):""}class Ly extends tt{constructor(t){super(),this.IsActive=t}}function fk(){return new Ly(!1)}const dk=""+new URL("dice-d4-1964b8dc.svg",import.meta.url).href,hk=""+new URL("dice-d6-a33df87d.svg",import.meta.url).href,pk=""+new URL("dice-d8-782600dd.svg",import.meta.url).href,mk=""+new URL("dice-d10-b415942f.svg",import.meta.url).href,gk=""+new URL("dice-d12-2bc389b8.svg",import.meta.url).href,yk=""+new URL("dice-d20-e0ea49df.svg",import.meta.url).href,vk=""+new URL("dice-alt-0d13a200.svg",import.meta.url).href,wk=dk,_k=hk,Sk=pk,Ck=mk,Ek=gk,kk=yk,xk=vk,Wp=["3d6 + 1d11","2 (1d20+14) (1d20+9)","2d20k1 + 9","1d12 + 12 + 2d6"];function $y(){const e=jg();return Wp[e.Next1(Wp.length)]}function Nk(e,t){let n;const r=t===4?wk:t===6?_k:t===8?Sk:t===10?Ck:t===12?Ek:t===20?kk:xk,l=e>t?["className","has-text-link"]:e===t?["className","has-text-success-dark"]:e===1?["className","has-text-danger"]:["className","is-black"];return h.createElement("span",O(K("icon",S([["className","is-medium"],["style",{position:"relative"}],(n=[h.createElement("img",{style:{opacity:.4},src:r}),h.createElement("span",O(S([l,["style",{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",zIndex:2,fontSize:1.5+"rem",fontWeight:"bold"}],["children",e]])))],["children",v.Children.toArray(Array.from(n))])]))))}function Ik(e){const t=e.Dice.DiceSize|0,n=h.createElement("span",{className:"mr-2 dice-result-subsum",children:`${rC(e.Dice.Command)}${e.DiceRollSum}`}),r=t===0?X(n):oe(N(()=>ee(F(n),N(()=>ee(F(h.createElement("span",{children:["["]})),N(()=>ee(En(l=>{const o=e.DiceRolled[l]|0,i=l===e.DiceRolled.length-1;return ee(F(Nk(o,t)),N(()=>i?Ue():F(h.createElement("span",{children:[" + "]}))))},da(0,1,e.DiceRolled.length-1)),N(()=>F(h.createElement("span",{children:["]"]}))))))))));return h.createElement("span",{children:v.Children.toArray(Array.from(r))})}function zy(e){let t,n,r;const l=VS(o=>me(o.Dice.Command,new ji(1,[]))?o.DiceRollSum*-1|0:o.DiceRollSum|0,e.Results,{GetZero:()=>0,Add:(o,i)=>o+i})|0;return h.createElement("div",O(S([["className","dice-result-container is-flex is-align-items-center"],(t=[h.createElement("span",O(S([["className","dice-result-subsum-container"],["style",{fontSize:"10px"}],(n=oe(N(()=>ae(Ik,e.Results))),["children",v.Children.toArray(Array.from(n))])]))),h.createElement("span",O(S([["className","dice-roll-sum"],["style",{marginLeft:"auto",minWidth:"max-content"}],(r=[h.createElement("span",{children:[" = "]}),h.createElement("span",{style:{fontWeight:"bold"},children:l})],["children",v.Children.toArray(Array.from(r))])])))],["children",v.Children.toArray(Array.from(t))])])))}const Tk=e=>{h.useEffect(()=>{const t=e();return()=>{t.Dispose()}})},Ak=(e,t)=>{h.useEffect(()=>{const n=e();return()=>{n.Dispose()}},t)},Mk=e=>{h.useLayoutEffect(()=>{const t=e();return()=>{t.Dispose()}})},Dk=Tk,By=Ak,Fk=Mk;function Rk(e,t,n,r){const l=v.memo(e,F_(2,Ln(R_(2,n),Ke())));return jo(o=>{e.displayName=o},xg(t)),o=>{const i=Pk(r,o);return v.createElement(l,i)}}function Pk(e,t){if(e==null)return t;{const n=e;return t.key=n(t),t}}function ma(e){return{Dispose(){e()}}}function ga(e){return v.useState(e)}function Ok(e,t){By(e,t)}function Lk(e){Fk(t=>(e(),ma(()=>{})))}function $k(e){const t=v.useRef(!1);Uk(()=>{t.current||(t.current=!0,e())},[])}function zk(e){const t=v.useRef(void 0),n=v.useRef(!1),r=v.useRef(!1);n.current&&(r.current=!0),Ok(()=>{let l;return n.current?l=void 0:(n.current=!0,t.current=Gt(e()),l=r.current?t.current:void 0),{Dispose(){jo(o=>{ye(o)},xg(l))}}},[])}function Bk(e){Dk(t=>(e(),ma(()=>{})))}function Uk(e,t){By(n=>(e(),ma(()=>{})),t)}function Vk(e,t){const n=Ln(t,[]);return v.useCallback(e,n)}function Hk(e){return v.useRef(e)}function jk(e,t,n){return Rk(e,void 0,n,t)}function Gk(e){const t=Hk(e),n=Vk(r=>t.current(r),[]);return Lk(()=>{t.current=e}),n}function ya(e){return v.useState(e)}function Wk(e,t,n){const r=e,l=r[2],o=r[0];let i;switch(r[1]?l?o.toLocaleLowerCase()===n.key.toLocaleLowerCase()&&n.ctrlKey&&n.shiftKey?i=0:i=4:o.toLocaleLowerCase()===n.key.toLocaleLowerCase()&&n.ctrlKey?i=1:i=4:l?o.toLocaleLowerCase()===n.key.toLocaleLowerCase()&&n.shiftKey?i=2:i=4:o.toLocaleLowerCase()===n.key.toLocaleLowerCase()?i=3:i=4,i){case 0:{t(n);break}case 1:{t(n);break}case 2:{t(n);break}case 3:{t(n);break}}}function Qk(e){return[e,!1,!1]}const Kk=Qk("Escape"),Uy="dice-storage-new-name",Vy="dice-storage-new-diceString",Jk=(()=>{let e,t;const n=X(h.createElement("td",O(S([["colSpan",2],["style",{textAlign:"center"}],(e=[h.createElement("span",O(K("icon",S([["className","is-large"],(t=[h.createElement("i",{className:"fa-solid fa-broom fa-shake fa-2xl"})],["children",v.Children.toArray(Array.from(t))])])))),h.createElement("span",{children:["..empty"]})],["children",v.Children.toArray(Array.from(e))])]))));return h.createElement("tr",{children:v.Children.toArray(Array.from(n))})})();function Zk(e,t,n){let r,l,o;return h.createElement("div",O(K("field",S([["className","has-addons"],(r=[(l=X(h.createElement("button",O(K("button",S([["tabIndex",-1],["className","is-static"],["children","/"]]))))),h.createElement("div",{className:"control",children:v.Children.toArray(Array.from(l))})),h.createElement("div",O(K("control",S([["className","is-flex-grow-1"],(o=[h.createElement("input",O(be(["type","text"],K("input",oe(N(()=>ee(F(["id",Uy]),N(()=>ee(e.DiceStorage.has(t.Name)?F(["className","is-danger"]):Ue(),N(()=>ee(F(["autoFocus",!0]),N(()=>ee(F(["tabIndex",0]),N(()=>ee(F(["placeholder","..name"]),N(()=>F(["onChange",i=>{n(new Kd(i.target.value,t.DiceString))}])))))))))))))))))],["children",v.Children.toArray(Array.from(o))])]))))],["children",v.Children.toArray(Array.from(r))])]))))}function qk(e,t){let n,r,l;return h.createElement("div",O(K("field",X((n=[h.createElement("div",O(K("control",S([["className","has-icons-left"],(r=[h.createElement("input",O(be(["type","text"],K("input",S([["id",Vy],["tabIndex",0],["placeholder",$y()],["onChange",o=>{t(new Kd(e.Name,o.target.value))}]]))))),h.createElement("span",O(K("icon",S([["className","is-left"],["className","is-small"],(l=[h.createElement("i",{className:"fa-solid fa-dice-d20"})],["children",v.Children.toArray(Array.from(l))])]))))],["children",v.Children.toArray(Array.from(r))])]))))],["children",v.Children.toArray(Array.from(n))])))))}function Yk(e,t,n,r,l){const o=new $n(t.Input,t.Results,t.DiceStorage,t.History,S4(t.QuickAccess,e));n(o),Py(o.QuickAccess)}function Hy(e,t,n,r,l){const o=new $n(t.Input,t.Results,t.DiceStorage,t.History,C4(t.QuickAccess,e));n(o),Py(o.QuickAccess)}function Xk(e,t,n,r){wf(e.DiceStorage,n.Name,n.DiceString),t(new $n(e.Input,e.Results,e.DiceStorage,e.History,e.QuickAccess)),r(Oy());const l=document.getElementById(Uy),o=document.getElementById(Vy);l.value=Ke(),o.value=Ke(),Fy(e.DiceStorage)}function bk(e,t,n,r,l){t.DiceStorage.delete(e),n(new $n(t.Input,t.Results,t.DiceStorage,t.History,t.QuickAccess)),Fy(t.DiceStorage),Hy(e,t,n)}function ex(e,t,n,r,l){const o=X(h.createElement("input",O(be(["type","checkbox"],K("checkbox",S([["defaultChecked",Ay(t.QuickAccess,e)],["onChange",i=>{i.target.checked?Yk(e,t,n):Hy(e,t,n)}]]))))));return h.createElement("label",{className:"label",children:v.Children.toArray(Array.from(o))})}function tx(e,t,n,r){let l;const o=X((l=oe(N(()=>{let i,s;return e.DiceStorage.size>0?ee(F((i=X((s=S([h.createElement("th",{children:["Shortcut"]}),h.createElement("th",{children:["Dice"]}),h.createElement("th",{children:["Quick Access"]}),h.createElement("th",{})]),h.createElement("tr",{children:v.Children.toArray(Array.from(s))}))),h.createElement("thead",{children:v.Children.toArray(Array.from(i))}))),N(()=>{let u;return F((u=oe(N(()=>En(a=>{let c,d,f,y,w,C;const R=a,m=R[0];return F(h.createElement("tr",O(S([["key",(c=Te(H("Stored-Dice-%s")),c(m))],(d=[h.createElement("td",{key:(f=Te(H("Stored-Dice-Name-%s")),f(m)),children:h.createElement("code",{children:["/"+m]})}),h.createElement("td",{key:(y=Te(H("Stored-Dice-diceString-%s")),y(m)),children:R[1]}),h.createElement("td",{key:(w=Te(H("Stored-Dice-quick-access-%s")),w(m)),children:ex(m,e,t)}),h.createElement("td",{key:(C=Te(H("Stored-Dice-remove-%s")),C(m)),children:h.createElement("button",O(K("delete",S([["style",{float:"right"}],["onClick",p=>{bk(m,e,t)}]]))))})],["children",v.Children.toArray(Array.from(d))])]))))},e.DiceStorage))),h.createElement("tbody",{children:v.Children.toArray(Array.from(u))})))})):F(h.createElement("tbody",{children:v.Children.toArray([Jk])}))})),h.createElement("table",{className:"table",children:v.Children.toArray(Array.from(l))})));return h.createElement("div",{className:"table-container",children:v.Children.toArray(Array.from(o))})}function nx(e,t,n,r){let l,o,i,s;const u=S([(l=X(Zk(e,n,r)),h.createElement("div",{className:"column",children:v.Children.toArray(Array.from(l))})),(o=X(qk(n,r)),h.createElement("div",{className:"column",children:v.Children.toArray(Array.from(o))})),h.createElement("div",O(K("column",S([["className","is-narrow"],(i=[h.createElement("div",O(K("control",S([["className","is-flex is-justify-content-end"],(s=[h.createElement("button",O(K("button",oe(N(()=>{const a=!e.DiceStorage.has(n.Name),c=n.Name!==""&&n.DiceString!==""&&a;return ee(F(["children",n.Name==="fireball"&&a?"🔥":"+"]),N(()=>ee(F(["role",se(" ",["button"])]),N(()=>ee(c?Ue():F(["className","is-static"]),N(()=>ee(F(["style",{borderRadius:"4px"}]),N(()=>ee(F(["tabIndex",0]),N(()=>F(["onClick",d=>{c&&Xk(e,t,n,r)}])))))))))))})))))],["children",v.Children.toArray(Array.from(s))])]))))],["children",v.Children.toArray(Array.from(i))])]))))]);return h.createElement("div",{className:"columns",children:v.Children.toArray(Array.from(u))})}function rx(e){let t,n,r,l,o;const i=e.rmv,s=e.setState,u=e.state,a=ga(Oy),c=a[1],d=a[0],f=y=>{i(),document.getElementById("dice-roller-input").focus()};return h.createElement("div",O(K("modal",S([["onKeyDown",y=>{Wk(Kk,f,y)}],["className","is-active"],(t=[h.createElement("div",O(K("modal-background",X(["onClick",f])))),(n=X((r=X((l=S([h.createElement("h1",{children:["Dice Storage"]}),(o=S([h.createElement("span",{children:["Type "]}),h.createElement("code",{children:["/placeholder"]}),h.createElement("span",{children:["in main field to quick access any stored dice!"]})]),h.createElement("p",{className:"help",children:v.Children.toArray(Array.from(o))})),tx(u,s),nx(u,s,d,c)]),h.createElement("div",{className:"content",children:v.Children.toArray(Array.from(l))}))),h.createElement("div",{className:"box",children:v.Children.toArray(Array.from(r))}))),h.createElement("div",{className:"modal-content",children:v.Children.toArray(Array.from(n))})),h.createElement("button",O(K("modal-close",S([["className","is-medium"],["className","has-background-black"],["aria-label","close"],["onClick",f]]))))],["children",v.Children.toArray(Array.from(t))])]))))}function lx(e,t,n){let r;const l="/"+e;return h.createElement("span",O(K("tag",S([["title",t],["style",{cursor:"pointer"}],["onClick",o=>{n(t)}],(r=[h.createElement("code",{style:{userSelect:"none"},children:l})],["children",v.Children.toArray(Array.from(r))])]))))}function ox(e,t){const n=oe(N(()=>ae(r=>lx(r,fr(e.DiceStorage,r),t),e.QuickAccess)));return h.createElement("div",{className:"tags",children:v.Children.toArray(Array.from(n))})}function ix(e){const t=oe(N(()=>ae(n=>{let r,l;return h.createElement("li",O(S([["key",(r=Te(H("set-index-%i")),r(n.Index))],(l=[zy(n)],["children",v.Children.toArray(Array.from(l))])])))},e.Results)));return h.createElement("ol",{children:v.Children.toArray(Array.from(t))})}const sx=(()=>{const e=X(h.createElement("div",O(K("notification",S([["className","mb-1"],["children","History is empty"]])))));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(e))})})();function ux(e,t,n){let r,l,o;return h.createElement("div",O(S([["className","mb-1"],(r=[h.createElement("code",{children:[e.Input]}),h.createElement("button",O(K("button",S([["onClick",i=>{n(new $n(e.Input,t.Results,t.DiceStorage,t.History,t.QuickAccess))}],["className","is-small"],["className","is-ghost"],["style",{float:"right"}],(l=[(o=X(h.createElement("i",{className:"fa-regular fa-paste"})),h.createElement("span",{className:"icon",children:v.Children.toArray(Array.from(o))}))],["children",v.Children.toArray(Array.from(l))])]))))],["children",v.Children.toArray(Array.from(r))])])))}function ax(e){let t;return h.createElement("div",O(S([["className","mb-1"],(t=[h.createElement("p",O(K("help",X(["children",K2(e.Time)+" "+J2(e.Time)]))))],["children",v.Children.toArray(Array.from(t))])])))}function cx(e,t){return h.createElement("button",O(K("button",S([["onClick",n=>{const r=new $n(e.Input,e.Results,e.DiceStorage,[],e.QuickAccess);t(r),Ry(r.History)}],["className","is-danger"],["className","is-fullwidth"],["children","Clear History"]]))))}function fx(e,t){let n;return h.createElement("div",O(K("field",S([["id","history-container"],(n=oe(N(()=>e.History.length===0?F(sx):ee(ae(r=>{const l=oe(N(()=>ee(F(ax(r)),N(()=>ee(F(ux(r,e,t)),N(()=>ae(ix,r.DiceSets)))))));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(l))})},e.History),N(()=>F(cx(e,t)))))),["children",v.Children.toArray(Array.from(n))])]))))}function dx(e,t){let n;return h.createElement("button",O(K("button",S([["id","dice-roller-history-toggle-button"],["role",se(" ",["button"])],["title","Toggle History"],["onClick",r=>{t(new Ly(!e.IsActive))}],(n=[h.createElement("span",O(K("icon",S([["className","is-small"],["children",h.createElement("i",{className:"fa-regular fa-rectangle-list"})]]))))],["children",v.Children.toArray(Array.from(n))])]))))}function hx(e){let t,n;const r=e.setDicacleState,l=e.diceState,o=ga(fk),i=o[0];return h.createElement("div",O(S([["id","dice-roller-history"],["style",O(oe(N(()=>i.IsActive?Ue():F(["minWidth","unset"]))))],(t=[dx(i,o[1]),h.createElement("div",O(S([["id","dice-roller-history-inner"],["style",O(oe(N(()=>i.IsActive?Ue():F(["display","none"]))))],(n=[fx(l,r)],["children",v.Children.toArray(Array.from(n))])])))],["children",v.Children.toArray(Array.from(t))])])))}function jy(e,t,n){const r=CE(e.indexOf("/")===0?fr(t.DiceStorage,e.slice(1,e.length)):e);console.log(Gt("[DICE]"),r);const l=200;n(new $n(e,r,t.DiceStorage,(t.History.push(r),t.History.length>=l&&t.History.splice(l,t.History.length-l),Ry(t.History),t.History),t.QuickAccess))}function Gy(e,t){jy(e.Input,e,t)}function Qp(e,t,n){let r;const l=Ln(e,-1)|0;if(r=n?D_(nr,l+1,t.length-1):l-1,!(r<0))return r}function px(e){let t;const n=e.setState,r=e.state,l=$y(),o=r.Input.indexOf("/")===0,i=o&&r.DiceStorage.has(Gp(r)),s=Gp(r),u=$l(N(()=>En(f=>f[0].indexOf(s)===0&&f[0]!==s?F(f):Ue(),r.DiceStorage))),a=ya(void 0),c=a[0],d=a[1];return h.createElement("div",O(S([["style",{display:"flex",position:"relative",zIndex:1}],(t=oe(N(()=>ee(F(h.createElement("input",O(be(["type","text"],K("input",oe(N(()=>ee(F(["className","is-large"]),N(()=>ee(F(["placeholder",l]),N(()=>ee(F(["autoFocus",!0]),N(()=>ee(i?F(["className","has-text-danger-dark"]):Ue(),N(()=>{let f;return ee(F((f=r.Input,["ref",y=>{y!=null&&!me(y.value,f)&&(y.value=f)}])),N(()=>ee(F(["onChange",y=>{const w=new $n(y.target.value,r.Results,r.DiceStorage,r.History,r.QuickAccess);d(void 0),n(w)}]),N(()=>ee(F(["id","dice-roller-input"]),N(()=>F(["onKeyDown",y=>{if(o&&u.length>0){const w=y.which;w===40?d(Qp(c,u,!0)):w===38?d(Qp(c,u,!1)):w===13&&c!=null&&(n(new $n("/"+u[Se(c)][0],r.Results,r.DiceStorage,r.History,r.QuickAccess)),d(void 0))}else y.which===13&&(Gy(r,n),d(void 0))}])))))))}))))))))))))))),N(()=>{let f;return o?F(h.createElement("div",{id:"command-container",style:{backgroundColor:"#F5F5F5",zIndex:3,position:"absolute",top:"100%",left:0,width:"100%",maxHeight:"100px"},children:(f=oe(N(()=>En(y=>{let w,C;const R=u[y];return F(h.createElement("li",O(S([["style",O(oe(N(()=>c!=null&&Se(c)===y?F(["filter","brightness(85%)"]):Ue())))],(w=[h.createElement("div",O(S([["onClick",m=>{n(new $n("/"+R[0],r.Results,r.DiceStorage,r.History,r.QuickAccess))}],(C=[h.createElement("code",{children:["/"+R[0]]}),h.createElement("span",{children:[R[1]]})],["children",v.Children.toArray(Array.from(C))])])))],["children",v.Children.toArray(Array.from(w))])]))))},da(0,1,u.length-1)))),h.createElement("ul",{children:v.Children.toArray(Array.from(f))}))})):Ue()})))),["children",v.Children.toArray(Array.from(t))])])))}function mx(e){const t=oe(N(()=>ae(n=>{let r,l;return h.createElement("li",O(S([["key",(r=Te(H("set-index-%i")),r(n.Index))],(l=[zy(n)],["children",v.Children.toArray(Array.from(l))])])))},e.Results)));return h.createElement("ol",{children:v.Children.toArray(Array.from(t))})}function gx(e){const t=oe(N(()=>e.Results==null?F(Ke()):ae(n=>{const r=X(mx(n));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(r))})},Se(e.Results).DiceSets)));return h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(t))})}function yx(e){const t=e.setState,n=e.state,r=ya(!1),l=r[1],o=r[0],i=oe(N(()=>ee(o?F(h.createElement(rx,{state:n,setState:t,rmv:()=>{l(!1)}})):Ue(),N(()=>F(h.createElement("button",O(K("button",S([["style",{zIndex:1}],["className","is-large"],["id","dice-roller-dice-storage"],["title","Manage stored dice"],["role",se(" ",["button"])],["children","+"],["onClick",s=>{l(!o)}]])))))))));return h.createElement("div",{children:v.Children.toArray(Array.from(i))})}function vx(e,t){return h.createElement("button",O(K("button",S([["id","dice-roller-button"],["className","is-large"],["role",se(" ",["button"])],["onClick",n=>{Gy(e,t)}],["children",h.createElement("span",O(K("icon",vt())))]]))))}function wx(){let e,t,n,r,l,o,i,s;const u=ga(ck),a=u[0],c=u[1];return h.createElement("div",O(S([["className","is-flex is-flex-grow-1"],["style",{maxHeight:"100%",overflow:"hidden"}],(e=[(t=X(h.createElement("div",O(K("container",S([["className","is-max-desktop"],(n=[(r=X(ox(a,d=>{jy(d,a,c)})),h.createElement("div",{className:"field",children:v.Children.toArray(Array.from(r))})),h.createElement("div",O(K("field",S([["id","dice-roller-container"],["onAnimationEnd",d=>{const f=document.getElementById("dice-roller-container");f.style.animation="initial"}],["className","has-addons"],(l=[(o=X(h.createElement(yx,{state:a,setState:c})),h.createElement("div",{className:"control",children:v.Children.toArray(Array.from(o))})),h.createElement("div",O(K("control",S([["className","is-expanded"],(i=[h.createElement(px,{state:a,setState:c})],["children",v.Children.toArray(Array.from(i))])])))),(s=oe(N(()=>{let d;return ee(a.Input.toLocaleLowerCase()==="/fireball"||a.DiceStorage.has("fireball")&&a.Input===fr(a.DiceStorage,"fireball")?F(h.createElement("div",O(S([["style",{position:"fixed"}],(d=[h.createElement("div",{className:"glow"}),h.createElement("div",{className:"flame"})],["children",v.Children.toArray(Array.from(d))])])))):Ue(),N(()=>F(vx(a,c))))})),h.createElement("div",{className:"control",children:v.Children.toArray(Array.from(s))}))],["children",v.Children.toArray(Array.from(l))])])))),gx(a)],["children",v.Children.toArray(Array.from(n))])]))))),h.createElement("div",{className:"hero-body",children:v.Children.toArray(Array.from(t))})),h.createElement(hx,{diceState:a,setDicacleState:c})],["children",v.Children.toArray(Array.from(e))])])))}class Zr extends Hn{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Dicacle","Reference","NotFound"]}}function _x(e){switch(e.tag){case 1:return"#/reference";case 2:return"#/404";default:return"#/"}}function Kp(e){let t;switch(U(e)?t=0:T(e)==="/"?U(k(e))?t=0:t=2:T(e)==="reference"&&U(k(e))?t=1:t=2,t){case 0:return new Zr(0,[]);case 1:return new Zr(1,[]);case 2:return new Zr(2,[])}}function Sx(e){let t;switch(e===""||e==="#/"?t=0:e==="#/reference"?t=1:t=2,t){case 0:return new Zr(0,[]);case 1:return new Zr(1,[]);case 2:return new Zr(2,[])}}function Cx(e){switch(e.tag){case 1:return"Reference";case 2:return"404";default:return"Dicacle"}}function Jp(e,t){if(t.indexOf(e)===0)return t}function Zp(e,t){if(Fu(t,e))return t}function Wy(e,t){return wS(n=>{if(b2(n))return vt();{const r=iS(n,"#");if(r==="?")return vt();if(Jp("?",r)!=null)return X(r);{const l=r.split("?");if(!df((o,i)=>o===i,l,Ke())&&l.length===1){const o=l[0];return X(decodeURIComponent(o))}else if(!df((o,i)=>o===i,l,Ke())&&l.length===2)if(l[1]===""){const o=l[0];return X(decodeURIComponent(o))}else{const o=l[0],i=l[1];return S([decodeURIComponent(o),"?"+i])}else return vt()}}},S(lS(Jp("#",e)!=null?Rg(e,1,e.length-1):t===1&&(Zp("#",e)!=null||Zp("#/",e)!=null)?"":e,["/"],void 0,0)))}function Ex(e,t,n){return t(Wy(e===2?window.location.pathname+window.location.search:window.location.hash,e))}const kx=jk(e=>{const t=Gk(r=>{const l=Ln(e.onUrlChanged,o=>{});Ex(Ln(e.hashMode,1),l)});zk(()=>(window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.addEventListener("hashchange",t):window.addEventListener("popstate",t),window.addEventListener("CUSTOM_NAVIGATION_EVENT",t),ma(()=>{window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.removeEventListener("hashchange",t):window.removeEventListener("popstate",t),window.removeEventListener("CUSTOM_NAVIGATION_EVENT",t)}))),$k(()=>{const r=document.createEvent("CustomEvent");r.initEvent("CUSTOM_NAVIGATION_EVENT",!0,!0),window.dispatchEvent(r)});const n=e.application;return n??Ke()});class qp extends Hn{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Choice1Of2","Choice2Of2"]}}class Cl extends Hn{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Light","Dark","Auto"]}}function Jd(){return ts("Component.DarkModeButton.ColorMode",[],Cl,()=>[[],[],[["Item",Jd()]]])}function xx(e){let t;const n=e.tag===2?e.fields[0].tag===0?"fa-regular fa-sun":e.fields[0].tag===1?"fa-solid fa-moon":"":e.tag===1?"fa-solid fa-moon":"fa-regular fa-sun";return h.createElement("i",{className:(t=Te(H("%s fa-xl")),t(n))})}function Qy(e){let t;switch(e.tag===2?e.fields[0].tag===0?t=0:e.fields[0].tag===1?t=1:t=2:e.tag===1?t=1:t=0,t){case 0:return new qp(0,[void 0]);case 1:return new qp(1,[void 0]);case 2:throw new Error("This can never happen")}}function Nx(e){const t=qe(e,ge(Jd()));localStorage.setItem("ColorMode",t)}function Ix(){let e;try{return e=ss(localStorage.getItem("ColorMode")),e!=null?pa(e,ge(Jd())):(()=>{throw new Error("Couldn't parse the input JSON string because it seems to be invalid")})()}catch{localStorage.removeItem("ColorMode"),sa(H("Could not find %s"))("ColorMode");return}}function Tx(){return window.matchMedia("(prefers-color-scheme: dark)").matches?new Cl(2,[new Cl(1,[])]):new Cl(2,[new Cl(0,[])])}function Ax(){const e=document.getElementById("style-dark");document.getElementById("style-light"),e.disabled="disabled"}function Mx(){const e=document.getElementById("style-dark");e.removeAttribute("disabled"),e.removeAttribute("media")}function Ky(e){Qy(e).tag===1?Mx():Ax()}class Jy extends tt{constructor(t){super(),this.ColorMode=t}}function Dx(){const e=Tx(),t=Ln(Ix(),e);return Ky(t),new Jy(t)}function Fx(){let e;const t=ga(Dx),n=t[0];return Bk(()=>{Ky(n.ColorMode)}),h.createElement("a",O(K("navbar-item",S([["onClick",r=>{r.preventDefault();const l=Qy(n.ColorMode).tag===1?new Cl(0,[]):new Cl(1,[]);Nx(l),t[1](new Jy(l))}],(e=[h.createElement("span",O(K("icon",S([["className","is-medium"],["children",xx(n.ColorMode)]]))))],["children",v.Children.toArray(Array.from(e))])]))))}const Rx=""+new URL("logo-9903a27e.svg",import.meta.url).href;function Yp(e,t){return h.createElement("a",O(K("navbar-item",oe(N(()=>ee(me(e,t)?F(["className","is-active"]):Ue(),N(()=>ee(F(["href",_x(e)]),N(()=>F(["children",Cx(e)]))))))))))}function Px(){const e=Sx(window.location.hash),t=S([Yp(new Zr(0,[]),e),Yp(new Zr(1,[]),e)]);return h.createElement("div",{className:"navbar-start",children:v.Children.toArray(Array.from(t))})}const Ox=(()=>{let e;const t=S([h.createElement(Fx,null),h.createElement("a",O(K("navbar-item",S([["href","https://github.com/Freymaurer/Dicacle"],["target","_blank"],(e=[h.createElement("span",{children:["GitHub"]}),h.createElement("span",O(K("icon",S([["className","is-medium"],["children",h.createElement("i",{className:"fa-brands fa-github fa-xl"})]]))))],["children",v.Children.toArray(Array.from(e))])]))))]);return h.createElement("div",{className:"navbar-end",children:v.Children.toArray(Array.from(t))})})();function Lx(e){return h.createElement("div",O(K("navbar-menu",oe(N(()=>ee(e?F(["className","is-active"]):Ue(),N(()=>{let t;return F((t=[Px(),Ox],["children",v.Children.toArray(Array.from(t))]))})))))))}function $x(){let e,t,n,r,l;const o=ya(!1),i=o[0];return h.createElement("nav",O(K("navbar",S([["className","has-shadow"],["className","is-fixed-top"],["className","is-black"],(e=[(t=S([(n=X(h.createElement("span",O(K("icon",S([["className","is-medium"],(r=[h.createElement("img",{src:Rx,alt:"logo"})],["children",v.Children.toArray(Array.from(r))])]))))),h.createElement("a",{className:"navbar-item",children:v.Children.toArray(Array.from(n))})),h.createElement("a",O(K("navbar-burger",S([["aria-label","menu"],["aria-expanded",i],["role",se(" ",["button"])],["onClick",s=>{o[1](!i)}],(l=[h.createElement("span",{"aria-hidden":!0}),h.createElement("span",{"aria-hidden":!0}),h.createElement("span",{"aria-hidden":!0})],["children",v.Children.toArray(Array.from(l))])]))))]),h.createElement("div",{className:"navbar-brand",children:v.Children.toArray(Array.from(t))})),Lx(i)],["children",v.Children.toArray(Array.from(e))])]))))}const Xp=h.createElement("span",{children:" • ",className:"mx-1"}),zx=(()=>{let e,t,n,r;const l=X((e=S([(t=S([h.createElement("span",{children:["Icons from "]}),h.createElement("a",{href:"https://www.flaticon.com",children:"flaticon"})]),h.createElement("span",{children:v.Children.toArray(Array.from(t))})),Xp,(n=S([h.createElement("a",{href:"https://fable.io",children:"Fable"}),h.createElement("span",{children:[" |> ❤️"]})]),h.createElement("span",{children:v.Children.toArray(Array.from(n))})),Xp,(r=S([h.createElement("span",{children:["Usage under "]}),h.createElement("a",{href:"https://github.com/Freymaurer/Dicacle/blob/main/LICENSE",children:"GNU GPL"})]),h.createElement("span",{children:v.Children.toArray(Array.from(r))}))]),h.createElement("div",{className:"container",children:v.Children.toArray(Array.from(e))})));return h.createElement("div",{className:"hero-foot",children:v.Children.toArray(Array.from(l))})})();function Bx(){return h.createElement(JS,null)}function Ux(){return h.createElement(wx,null)}function Vx(){let e,t,n;const r=ya(Kp(Wy(window.location.hash,1)));return kx(O(S([["onUrlChanged",l=>{r[1](Kp(l))}],(e=X((t=S([h.createElement($x,null),h.createElement("section",O(K("hero",S([["className","is-fullheight-with-navbar"],(n=oe(N(()=>{let l;return ee((l=r[0],l.tag===1?F(Bx()):l.tag===2?F(h.createElement("h1",{children:["404: Page not found"]})):F(Ux())),N(()=>F(zx)))})),["children",v.Children.toArray(Array.from(n))])]))))]),h.createElement("div",{children:v.Children.toArray(Array.from(t))}))),["application",h.createElement(h.Fragment,{},...e)])])))}const Hx=cg(document.getElementById("feliz-app"));Hx.render(h.createElement(Vx,null)); diff --git a/index.html b/index.html index f3ef3da..fa5984d 100644 --- a/index.html +++ b/index.html @@ -36,7 +36,7 @@ } } - +