@masonitestudios/spartanauth-widgets 1.0.1 → 1.0.3

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.
@@ -1,4 +1,4 @@
1
- (function(He){typeof define=="function"&&define.amd?define(He):He()})(function(){"use strict";const ze={equals:(e,t)=>e===t};let at=dt;const Ae=1,Ne=2,ot={owned:null,cleanups:null,context:null,owner:null};var te=null;let We=null,qt=null,H=null,ee=null,ge=null,Me=0;function Ut(e,t){const n=H,r=te,s=e.length===0,u=t===void 0?r:t,o=s?ot:{owned:null,cleanups:null,context:u?u.context:null,owner:u},l=s?e:()=>e(()=>je(()=>_e(o)));te=o,H=null;try{return Se(l,!0)}finally{H=n,te=r}}function F(e,t){t=t?Object.assign({},ze,t):ze;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),ct(n,s));return[lt.bind(n),r]}function $(e,t,n){const r=Ye(e,t,!1,Ae);xe(r)}function Jt(e,t,n){at=Gt;const r=Ye(e,t,!1,Ae);r.user=!0,ge?ge.push(r):xe(r)}function p(e,t,n){n=n?Object.assign({},ze,n):ze;const r=Ye(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,xe(r),lt.bind(r)}function je(e){if(H===null)return e();const t=H;H=null;try{return e()}finally{H=t}}function Ze(e){Jt(()=>je(e))}function lt(){if(this.sources&&this.state)if(this.state===Ae)xe(this);else{const e=ee;ee=null,Se(()=>Le(this),!1),ee=e}if(H){const e=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(e)):(H.sources=[this],H.sourceSlots=[e]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function ct(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Se(()=>{for(let s=0;s<e.observers.length;s+=1){const u=e.observers[s],o=We&&We.running;o&&We.disposed.has(u),(o?!u.tState:!u.state)&&(u.pure?ee.push(u):ge.push(u),u.observers&&ft(u)),o||(u.state=Ae)}if(ee.length>1e6)throw ee=[],new Error},!1)),t}function xe(e){if(!e.fn)return;_e(e);const t=Me;Vt(e,e.value,t)}function Vt(e,t,n){let r;const s=te,u=H;H=te=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=Ae,e.owned&&e.owned.forEach(_e),e.owned=null),e.updatedAt=n+1,ht(o)}finally{H=u,te=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ct(e,r):e.value=r,e.updatedAt=n)}function Ye(e,t,n,r=Ae,s){const u={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:te,context:te?te.context:null,pure:n};return te===null||te!==ot&&(te.owned?te.owned.push(u):te.owned=[u]),u}function Re(e){if(e.state===0)return;if(e.state===Ne)return Le(e);if(e.suspense&&je(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Me);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ae)xe(e);else if(e.state===Ne){const r=ee;ee=null,Se(()=>Le(e,t[0]),!1),ee=r}}function Se(e,t){if(ee)return e();let n=!1;t||(ee=[]),ge?n=!0:ge=[],Me++;try{const r=e();return Kt(n),r}catch(r){n||(ge=null),ee=null,ht(r)}}function Kt(e){if(ee&&(dt(ee),ee=null),e)return;const t=ge;ge=null,t.length&&Se(()=>at(t),!1)}function dt(e){for(let t=0;t<e.length;t++)Re(e[t])}function Gt(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Re(r)}for(t=0;t<n;t++)Re(e[t])}function Le(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const s=r.state;s===Ae?r!==t&&(!r.updatedAt||r.updatedAt<Me)&&Re(r):s===Ne&&Le(r,t)}}}function ft(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Ne,n.pure?ee.push(n):ge.push(n),n.observers&&ft(n))}}function _e(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),s=n.observers;if(s&&s.length){const u=s.pop(),o=n.observerSlots.pop();r<s.length&&(u.sourceSlots[o]=r,s[r]=u,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)_e(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)_e(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Ht(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ht(e,t=te){throw Ht(e)}function Wt(e,t,n){let r=n.length,s=t.length,u=r,o=0,l=0,v=t[s-1].nextSibling,B=null;for(;o<s||l<u;){if(t[o]===n[l]){o++,l++;continue}for(;t[s-1]===n[u-1];)s--,u--;if(s===o){const D=u<r?l?n[l-1].nextSibling:n[u-l]:v;for(;l<u;)e.insertBefore(n[l++],D)}else if(u===l)for(;o<s;)(!B||!B.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[u-1]&&n[l]===t[s-1]){const D=t[--s].nextSibling;e.insertBefore(n[l++],t[o++].nextSibling),e.insertBefore(n[--u],D),t[s]=n[u]}else{if(!B){B=new Map;let x=l;for(;x<u;)B.set(n[x],x++)}const D=B.get(t[o]);if(D!=null)if(l<D&&D<u){let x=o,ne=1,ie;for(;++x<s&&x<u&&!((ie=B.get(t[x]))==null||ie!==D+ne);)ne++;if(ne>D-l){const me=t[o];for(;l<D;)e.insertBefore(n[l++],me)}else e.replaceChild(n[l++],t[o++])}else o++;else t[o++].remove()}}}const Dt="_$DX_DELEGATE";function E(e,t,n,r){let s;const u=()=>{const l=document.createElement("template");return l.innerHTML=e,l.content.firstChild},o=()=>(s||(s=u())).cloneNode(!0);return o.cloneNode=o,o}function Xe(e,t=window.document){const n=t[Dt]||(t[Dt]=new Set);for(let r=0,s=e.length;r<s;r++){const u=e[r];n.has(u)||(n.add(u),t.addEventListener(u,Zt))}}function ae(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function pt(e,t,n){return je(()=>e(t,n))}function f(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return qe(e,t,r,n);$(s=>qe(e,t(),s,n),r)}function Zt(e){let t=e.target;const n=`$$${e.type}`,r=e.target,s=e.currentTarget,u=v=>Object.defineProperty(e,"target",{configurable:!0,value:v}),o=()=>{const v=t[n];if(v&&!t.disabled){const B=t[`${n}Data`];if(B!==void 0?v.call(t,B,e):v.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&u(t.host),!0},l=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const v=e.composedPath();u(v[0]);for(let B=0;B<v.length-2&&(t=v[B],!!o());B++){if(t._$host){t=t._$host,l();break}if(t.parentNode===s)break}}else l();u(r)}function qe(e,t,n,r,s){for(;typeof n=="function";)n=n();if(t===n)return n;const u=typeof t,o=r!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,u==="string"||u==="number"){if(u==="number"&&(t=t.toString(),t===n))return n;if(o){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Ee(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||u==="boolean")n=Ee(e,n,r);else{if(u==="function")return $(()=>{let l=t();for(;typeof l=="function";)l=l();n=qe(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],v=n&&Array.isArray(n);if(Qe(l,t,n,s))return $(()=>n=qe(e,l,n,r,!0)),()=>n;if(l.length===0){if(n=Ee(e,n,r),o)return n}else v?n.length===0?gt(e,l,r):Wt(e,n,l):(n&&Ee(e),gt(e,l));n=l}else if(t.nodeType){if(Array.isArray(n)){if(o)return n=Ee(e,n,r,t);Ee(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Qe(e,t,n,r){let s=!1;for(let u=0,o=t.length;u<o;u++){let l=t[u],v=n&&n[e.length],B;if(!(l==null||l===!0||l===!1))if((B=typeof l)=="object"&&l.nodeType)e.push(l);else if(Array.isArray(l))s=Qe(e,l,v)||s;else if(B==="function")if(r){for(;typeof l=="function";)l=l();s=Qe(e,Array.isArray(l)?l:[l],Array.isArray(v)?v:[v])||s}else e.push(l),s=!0;else{const D=String(l);v&&v.nodeType===3&&v.data===D?e.push(v):e.push(document.createTextNode(D))}}return s}function gt(e,t,n=null){for(let r=0,s=t.length;r<s;r++)e.insertBefore(t[r],n)}function Ee(e,t,n,r){if(n===void 0)return e.textContent="";const s=r||document.createTextNode("");if(t.length){let u=!1;for(let o=t.length-1;o>=0;o--){const l=t[o];if(s!==l){const v=l.parentNode===e;!u&&!o?v?e.replaceChild(s,l):e.insertBefore(s,n):v&&l.remove()}else u=!0}}else e.insertBefore(s,n);return[s]}function Yt(e){return Object.keys(e).reduce((n,r)=>{const s=e[r];return n[r]=Object.assign({},s),Ct(s.value)&&!nn(s.value)&&!Array.isArray(s.value)&&(n[r].value=Object.assign({},s.value)),Array.isArray(s.value)&&(n[r].value=s.value.slice(0)),n},{})}function Xt(e){return e?Object.keys(e).reduce((n,r)=>{const s=e[r];return n[r]=Ct(s)&&"value"in s?s:{value:s},n[r].attribute||(n[r].attribute=tn(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Qt(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function en(e,t){const n=Yt(t);return Object.keys(t).forEach(s=>{const u=n[s],o=e.getAttribute(u.attribute),l=e[s];o!=null&&(u.value=u.parse?mt(o):o),l!=null&&(u.value=Array.isArray(l)?l.slice(0):l),u.reflect&&bt(e,u.attribute,u.value,!!u.parse),Object.defineProperty(e,s,{get(){return u.value},set(v){const B=u.value;u.value=v,u.reflect&&bt(this,u.attribute,u.value,!!u.parse);for(let D=0,x=this.__propertyChangedCallbacks.length;D<x;D++)this.__propertyChangedCallbacks[D](s,v,B)},enumerable:!0,configurable:!0})}),n}function mt(e){if(e)try{return JSON.parse(e)}catch{return e}}function bt(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let s=r?JSON.stringify(n):n;e.__updating[t]=!0,s==="true"&&(s=""),e.setAttribute(t,s),Promise.resolve().then(()=>delete e.__updating[t])}function tn(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Ct(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function nn(e){return Object.prototype.toString.call(e)==="[object Function]"}function rn(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let et;function sn(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(s=>t[s].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=en(this,t);const s=Qt(this.props),u=this.Component,o=et;try{et=this,this.__initialized=!0,rn(u)?new u(s,{element:this}):u(s,{element:this})}finally{et=o}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let s=null;for(;s=this.__releaseCallbacks.pop();)s(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(s,u,o){if(this.__initialized&&!this.__updating[s]&&(s=this.lookupProp(s),s in t)){if(o==null&&!this[s])return;this[s]=t[s].parse?mt(o):o}}lookupProp(s){if(t)return n.find(u=>s===u||s===t[u].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(s){this.__releaseCallbacks.push(s)}addPropertyChangedCallback(s){this.__propertyChangedCallbacks.push(s)}}}function un(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:s,customElements:u=window.customElements}=n;return o=>{if(!e)throw new Error("tag is required to register a Component");let l=u.get(e);return l?(l.prototype.Component=o,l):(l=sn(r,Xt(t)),l.prototype.Component=o,l.prototype.registeredTag=e,u.define(e,l,s),l)}}function an(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[s,u]=F(e[t[r]]);Object.defineProperty(n,t[r],{get:s,set(o){u(()=>o)}})}return n}function on(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function ln(e){return(t,n)=>{const{element:r}=n;return Ut(s=>{const u=an(t);r.addPropertyChangedCallback((l,v)=>u[l]=v),r.addReleaseCallback(()=>{r.renderRoot.textContent="",s()});const o=e(u,n);return f(r.renderRoot,o)},on(r))}}function tt(e,t,n){return arguments.length===2&&(n=t,t={}),un(e,t)(ln(n))}var cn="٠١٢٣٤٥٦٧٨٩",dn="۰۱۲۳۴۵۶۷۸۹",fn="൦൧൨൩൪൫൬൭൮൯",hn="೦೧೨೩೪೫೬೭೮೯",Dn="໐໑໒໓໔໕໖໗໘໙",pn="୦୧୨୩୪୫୬୭୮୯",gn="០១២៣៤៥៦៧៨៩",mn="߀߁߂߃߄߅߆߇߈߉",bn="੦੧੨੩੪੫੬੭੮੯",Cn="૦૧૨૩૪૫૬૭૮૯",vn="०१२३४५६७८९",An="၀၁၂၃၄၅၆၇၈၉",wn="௦௧௨௩௪௫௬௭௮௯",Fn="౦౧౨౩౪౫౬౭౮౯",En="๐๑๒๓๔๕๖๗๘๙",yn="༠༡༢༣༤༥༦༧༨༩",vt={ar:cn,fa:dn,ml:fn,kn:hn,lo:Dn,or:pn,kh:gn,nqo:mn,pa:bn,gu:Cn,hi:vn,my:An,ta:wn,te:Fn,th:En,bo:yn},$n=["ru"],Bn=["id"],kn=["id"],xn=["ady-cyrl"],Sn=["aeb-arab"],_n=["sq"],Tn=["ru"],On=["zh-hant"],In=["es"],Pn=["hi"],zn=["es"],Nn=["ar"],Mn=["ar"],jn=["ar"],Rn=["es"],Ln=["fr"],qn=["ru"],Un=["fr","es","ru"],Jn=["hi"],Vn=["es"],Kn=["fa"],Gn=["ru"],Hn=["id"],Wn=["de"],Zn=["bbc-latn"],Yn=["fa"],Xn=["fa"],Qn=["bho"],er=["en"],tr=["id"],nr=["fr"],rr=["bn"],sr=["fa"],ur=["fr"],ir=["id"],ar=["id"],or=["ru"],lr=["oc"],cr=["nan","zh-hant"],dr=["ru"],fr=["it"],hr=["crh-latn"],Dr=["sk"],pr=["pl"],gr=["ru"],mr=["hsb","de"],br=["ms"],Cr=["ne"],vr=["it"],Ar=["it"],wr=["es"],Fr=["fr"],Er=["fi"],yr=["fr"],$r=["fr"],Br=["de"],kr=["it"],xr=["tr"],Sr=["gan-hant","zh-hant","zh-hans"],_r=["fr"],Tr=["pt"],Or=["fa"],Ir=["es"],Pr=["gom-deva"],zr=["id"],Nr=["de"],Mr=["es"],jr=["zh-hant"],Rr=["hif-latn"],Lr=["de"],qr=["dsb","de"],Ur=["fr"],Jr=["hy"],Vr=["zh-cn","zh-hans"],Kr=["ru"],Gr=["eo"],Hr=["ike-cans"],Wr=["en"],Zr=["da"],Yr=["id"],Xr=["kk-latn","kk-cyrl"],Qr=["fr"],es=["kbd-cyrl"],ts=["fr"],ns=["ur"],rs=["tr"],ss=["my"],us=["kk-cyrl"],is=["da"],as=["ru"],os=["ru"],ls=["fi"],cs=["ks-arab"],ds=["de"],fs=["ku-latn"],hs=["ru"],Ds=["ru"],ps=["es"],gs=["de"],ms=["ru"],bs=["ru","az"],Cs=["nl"],vs=["it"],As=["et"],ws=["fa"],Fs=["it","rm","fur"],Es=["pms","eml","lij","vec","it"],ys=["fr"],$s=["fa"],Bs=["lv"],ks=["fa"],xs=["zh-hant"],Ss=["tr"],_s=["id"],Ts=["hi"],Os=["myv","ru"],Is=["fr"],Ps=["mrj","ru"],zs=["id"],Ns=["my"],Ms=["ro"],js=["mhr","ru"],Rs=["pt"],Ls=["mdf","ru"],qs=["fa"],Us=["es"],Js=["cdo","zh-hant"],Vs=["it"],Ks=["nn"],Gs=["de"],Hs=["id"],Ws=["nb"],Zs=["fr"],Ys=["ca","fr"],Xs=["fi"],Qs=["ru"],eu=["fr"],tu=["de"],nu=["de"],ru=["de"],su=["en"],uu=["it"],iu=["el"],au=["pt-br"],ou=["qug","es"],lu=["qu","es"],cu=["it"],du=["ro"],fu=["uk","ru"],hu=["ro"],Du=["ruq-latn","ro"],pu=["hi"],gu=["ru"],mu=["it"],bu=["en"],Cu=["it"],vu=["cbk","fa"],Au=["fr"],wu=["fr"],Fu=["lt"],Eu=["bs","sr-el","hr"],yu=["fr"],$u=["shy-latn"],Bu=["cs"],ku=["skr-arab"],xu=["de"],Su=["fi"],_u=["sr-ec"],Tu=["nl"],Ou=["de"],Iu=["ru"],Pu=["id"],zu=["pl"],Nu=["zh-tw","zh-hant","zh-hans"],Mu=["zh-tw","zh-hant","zh-hans"],ju=["kn"],Ru=["pt"],Lu=["tg-cyrl"],qu=["zh-tw","zh-hant","zh-hans"],Uu=["tt-cyrl","ru"],Ju=["fr"],Vu=["ru"],Ku=["ru"],Gu=["ug-arab"],Hu=["it"],Wu=["et"],Zu=["nl"],Yu=["de"],Xu=["fi"],Qu=["et"],ei=["fr"],ti=["fr"],ni=["zh-hans"],ri=["ru"],si=["ka"],ui=["he"],ii=["zh-hans"],ai=["nl"],oi=["kab"],li=["zh-hans"],At={ab:$n,abs:Bn,ace:kn,ady:xn,aeb:Sn,"aeb-arab":["ar"],aln:_n,alt:Tn,ami:On,an:In,anp:Pn,arn:zn,arq:Nn,ary:Mn,arz:jn,ast:Rn,atj:Ln,av:qn,avk:Un,awa:Jn,ay:Vn,azb:Kn,ba:Gn,ban:Hn,"ban-bali":["ban"],bar:Wn,bbc:Zn,"bbc-latn":["id"],bcc:Yn,"be-tarask":["be"],bgn:Xn,bh:Qn,bi:er,bjn:tr,bm:nr,bpy:rr,bqi:sr,br:ur,btm:ir,bug:ar,bxr:or,ca:lr,"cbk-zam":["es"],cdo:cr,ce:dr,co:fr,crh:hr,"crh-cyrl":["ru"],cs:Dr,csb:pr,cv:gr,"de-at":["de"],"de-ch":["de"],"de-formal":["de"],dsb:mr,dtp:br,dty:Cr,egl:vr,eml:Ar,"en-ca":["en"],"en-gb":["en"],"es-419":["es"],"es-formal":["es"],ext:wr,ff:Fr,fit:Er,frc:yr,frp:$r,frr:Br,fur:kr,gag:xr,gan:Sr,"gan-hans":["zh-hans"],"gan-hant":["zh-hant","zh-hans"],gcr:_r,gl:Tr,glk:Or,gn:Ir,gom:Pr,"gom-deva":["hi"],gor:zr,gsw:Nr,guc:Mr,hak:jr,hif:Rr,hrx:Lr,hsb:qr,ht:Ur,"hu-formal":["hu"],hyw:Jr,ii:Vr,inh:Kr,io:Gr,iu:Hr,jam:Wr,jut:Zr,jv:Yr,kaa:Xr,kab:Qr,kbd:es,kbp:ts,khw:ns,kiu:rs,kjp:ss,kk:us,"kk-arab":["kk-cyrl"],"kk-cn":["kk-arab","kk-cyrl"],"kk-kz":["kk-cyrl"],"kk-latn":["kk-cyrl"],"kk-tr":["kk-latn","kk-cyrl"],kl:is,"ko-kp":["ko"],koi:as,krc:os,krl:ls,ks:cs,ksh:ds,ku:fs,"ku-arab":["ckb"],kum:hs,kv:Ds,lad:ps,lb:gs,lbe:ms,lez:bs,li:Cs,lij:vs,liv:As,lki:ws,lld:Fs,lmo:Es,ln:ys,lrc:$s,ltg:Bs,luz:ks,lzh:xs,lzz:Ss,mad:_s,mai:Ts,"map-bms":["jv","id"],mdf:Os,mg:Is,mhr:Ps,min:zs,mnw:Ns,mo:Ms,mrj:js,"ms-arab":["ms"],mwl:Rs,myv:Ls,mzn:qs,nah:Us,nan:Js,nap:Vs,nb:Ks,nds:Gs,"nds-nl":["nl"],nia:Hs,"nl-informal":["nl"],nn:Ws,nrm:Zs,oc:Ys,olo:Xs,os:Qs,pcd:eu,pdc:tu,pdt:nu,pfl:ru,pih:su,pms:uu,pnt:iu,pt:au,"pt-br":["pt"],qu:ou,qug:lu,rgn:cu,rmy:du,"roa-tara":["it"],rue:fu,rup:hu,ruq:Du,"ruq-cyrl":["mk"],"ruq-latn":["ro"],sa:pu,sah:gu,scn:mu,sco:bu,sdc:Cu,sdh:vu,ses:Au,sg:wu,sgs:Fu,sh:Eu,shi:yu,shy:$u,"shy-latn":["fr"],sk:Bu,skr:ku,"skr-arab":["ur","pnb"],sli:xu,smn:Su,sr:_u,srn:Tu,stq:Ou,sty:Iu,su:Pu,szl:zu,szy:Nu,tay:Mu,tcy:ju,tet:Ru,tg:Lu,trv:qu,tt:Uu,"tt-cyrl":["ru"],ty:Ju,tyv:Vu,udm:Ku,ug:Gu,vec:Hu,vep:Wu,vls:Zu,vmf:Yu,vot:Xu,vro:Qu,wa:ei,wo:ti,wuu:ni,xal:ri,xmf:si,yi:ui,za:ii,zea:ai,zgh:oi,zh:li,"zh-cn":["zh-hans"],"zh-hant":["zh-hans"],"zh-hk":["zh-hant","zh-hans"],"zh-mo":["zh-hk","zh-hant","zh-hans"],"zh-my":["zh-sg","zh-hans"],"zh-sg":["zh-hans"],"zh-tw":["zh-hant","zh-hans"]};let ue=class{constructor(e){this.locale=e}convertPlural(e,t){const n=/\d+=/i;if(!t||t.length===0)return"";for(let s=0;s<t.length;s++){const u=t[s];if(n.test(u)){if(parseInt(u.slice(0,u.indexOf("=")),10)===e)return u.slice(u.indexOf("=")+1);t[s]=void 0}}t=t.filter(s=>!!s);let r=this.getPluralForm(e,this.locale);return r=Math.min(r,t.length-1),t[r]}getPluralForm(e,t){const n=["zero","one","two","few","many","other"],r=new Intl.PluralRules(t),s=r.resolvedOptions().pluralCategories,u=r.select(e);return n.filter(o=>s.includes(o)).indexOf(u)}convertNumber(e,t=!1){let n=this.digitTransformTable(this.locale),r="";if(t){if(parseFloat(e,10)===e||!n)return e;const s=[];for(const o in n)s[n[o]]=o;n=s;const u=String(e);for(let o=0;o<u.length;o++)r+=n[u[o]]||u[o];return parseFloat(r,10)}if(Intl.NumberFormat){let s;const u=[...At[this.locale]||[],"en"];return Intl.NumberFormat.supportedLocalesOf(this.locale).length?s=[this.locale]:s=u,r=new Intl.NumberFormat(s).format(e),r==="NaN"&&(r=e),r}}convertGrammar(e){return e}gender(e,t){if(!t||t.length===0)return"";for(;t.length<2;)t.push(t[t.length-1]);return e==="male"?t[0]:e==="female"?t[1]:t.length===3?t[2]:t[0]}digitTransformTable(e){return vt[e]?vt[e].split(""):!1}},ci=class extends ue{convertGrammar(e,t){switch(t){case"prefixed":case"תחילית":e.slice(0,1)==="ו"&&e.slice(0,2)!=="וו"&&(e="ו"+e),e.slice(0,1)==="ה"&&(e=e.slice(1)),(e.slice(0,1)<"א"||e.slice(0,1)>"ת")&&(e="־"+e)}return e}},di=class extends ue{convertGrammar(t,n){switch(n){case"instrumental":t="s "+t;break;case"lokativ":t="o "+t;break}return t}},fi=class extends ue{convertGrammar(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e;break}return e}},hi=class extends ue{convertGrammar(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e;break}return e}},Di=class extends ue{convertGrammar(e,t){let n=e.match(/[aou][^äöy]*$/i);const r=e;switch(e.match(/wiki$/i)&&(n=!1),e.match(/[bcdfghjklmnpqrstvwxz]$/i)&&(e+="i"),t){case"genitive":e+="n";break;case"elative":e+=n?"sta":"stä";break;case"partitive":e+=n?"a":"ä";break;case"illative":e+=e.slice(-1)+"n";break;case"inessive":e+=n?"ssa":"ssä";break;default:e=r;break}return e}},pi=class extends ue{convertGrammar(e,t){return t==="genitive"&&(e.slice(-1)==="ь"?e=e.slice(0,-1)+"я":e.slice(-2)==="ия"?e=e.slice(0,-2)+"ии":e.slice(-2)==="ка"?e=e.slice(0,-2)+"ки":e.slice(-2)==="ти"?e=e.slice(0,-2)+"тей":e.slice(-2)==="ды"?e=e.slice(0,-2)+"дов":e.slice(-3)==="ник"&&(e=e.slice(0,-3)+"ника")),e}};class gi extends ue{convertGrammar(t,n){switch(n){case"mestnik":t="o "+t;break;case"orodnik":t="z "+t;break}return t}}let mi=class extends ue{convertGrammar(e,t){switch(t){case"genitive":e=e.replace(/u[ms]$/i,"i"),e=e.replace(/ommunia$/i,"ommunium"),e=e.replace(/a$/i,"ae"),e=e.replace(/libri$/i,"librorum"),e=e.replace(/nuntii$/i,"nuntiorum"),e=e.replace(/tio$/i,"tionis"),e=e.replace(/ns$/i,"ntis"),e=e.replace(/as$/i,"atis"),e=e.replace(/es$/i,"ei");break;case"accusative":e=e.replace(/u[ms]$/i,"um"),e=e.replace(/ommunia$/i,"am"),e=e.replace(/a$/i,"ommunia"),e=e.replace(/libri$/i,"libros"),e=e.replace(/nuntii$/i,"nuntios"),e=e.replace(/tio$/i,"tionem"),e=e.replace(/ns$/i,"ntem"),e=e.replace(/as$/i,"atem"),e=e.replace(/es$/i,"em");break;case"ablative":e=e.replace(/u[ms]$/i,"o"),e=e.replace(/ommunia$/i,"ommunibus"),e=e.replace(/a$/i,"a"),e=e.replace(/libri$/i,"libris"),e=e.replace(/nuntii$/i,"nuntiis"),e=e.replace(/tio$/i,"tione"),e=e.replace(/ns$/i,"nte"),e=e.replace(/as$/i,"ate"),e=e.replace(/es$/i,"e");break}return e}};class bi extends ue{convertGrammar(t,n){return n==="genitive"&&(t.slice(-1)==="ա"?t=t.slice(0,-1)+"այի":t.slice(-1)==="ո"?t=t.slice(0,-1)+"ոյի":t.slice(-4)==="գիրք"?t=t.slice(0,-4)+"գրքի":t=t+"ի"),t}}let Ci=class extends ue{convertGrammar(e,t){if(t==="ainmlae")switch(e){case"an Domhnach":e="Dé Domhnaigh";break;case"an Luan":e="Dé Luain";break;case"an Mháirt":e="Dé Mháirt";break;case"an Chéadaoin":e="Dé Chéadaoin";break;case"an Déardaoin":e="Déardaoin";break;case"an Aoine":e="Dé hAoine";break;case"an Satharn":e="Dé Sathairn";break}return e}},vi=class extends ue{convertGrammar(e,t){switch(t){case"rol":e+="ról";break;case"ba":e+="ba";break;case"k":e+="k";break}return e}},Ai=class extends ue{convertGrammar(e,t){let n,r,s,u;switch(n="мæ",r="",s="",u="",e.match(/тæ$/i)?(e=e.slice(0,-1),n="æм"):e.match(/[аæеёиоыэюя]$/i)?r="й":e.match(/у$/i)?e.slice(-2,-1).match(/[аæеёиоыэюя]$/i)||(r="й"):e.match(/[бвгджзйклмнопрстфхцчшщьъ]$/i)||(s="-"),t){case"genitive":u=s+r+"ы";break;case"dative":u=s+r+"æн";break;case"allative":u=s+n;break;case"ablative":r==="й"?u=s+r+"æ":u=s+r+"æй";break;case"superessive":u=s+r+"ыл";break;case"equative":u=s+r+"ау";break;case"comitative":u=s+"имæ";break}return e+u}};class wi extends ue{convertGrammar(t,n){switch(n){case"genitive":t.slice(-1)==="ь"?t=t.slice(0,-1)+"я":t.slice(-2)==="ія"?t=t.slice(0,-2)+"ії":t.slice(-2)==="ка"?t=t.slice(0,-2)+"ки":t.slice(-2)==="ти"?t=t.slice(0,-2)+"тей":t.slice(-2)==="ды"?t=t.slice(0,-2)+"дов":t.slice(-3)==="ник"&&(t=t.slice(0,-3)+"ника");break;case"accusative":t.slice(-2)==="ія"&&(t=t.slice(0,-2)+"ію");break}return t}}var wt={bs:di,default:ue,dsb:fi,fi:Di,ga:Ci,he:ci,hsb:hi,hu:vi,hy:bi,la:mi,os:Ai,ru:pi,sl:gi,uk:wi};const Fi=new RegExp("(?:([A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁːˑˠ-ˤˮͰ-ͳͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-҂Ҋ-ԯԱ-Ֆՙ-՟ա-և։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ঀংঃঅ-ঌএঐও-নপ-রলশ-হঽ-ীেৈোৌৎৗড়ঢ়য়-ৡ০-ৱ৴-৺ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ીૉોૌૐૠૡ૦-૰ૹଂଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽାୀେୈୋୌୗଡ଼ଢ଼ୟ-ୡ୦-୷ஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹாிுூெ-ைொ-ௌௐௗ௦-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౚౠౡ౦-౯౿ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊೋೕೖೞೠೡ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ീെ-ൈൊ-ൌൎൗൟ-ൡ൦-൵൹-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-෴ก-ะาำเ-ๆ๏-๛ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆ໐-໙ໜ-ໟༀ-༗༚-༴༶༸༾-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿚က-ာေးျြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃႄႇ-ႌႎ-ႜ႞-ჅჇჍა-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፼ᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙿᚁ-ᚚᚠ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះៈ។-៚ៜ០-៩᠐-᠙ᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰᤱᤳ-ᤸ᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧚ᨀ-ᨖᨙᨚ᨞-ᩕᩗᩡᩣᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-ᭋ᭐-᭪᭴-᭼ᮂ-ᮡᮦᮧ᮪ᮮ-ᯥᯧᯪ-ᯬᯮ᯲᯳᯼-ᰫᰴᰵ᰻-᱉ᱍ-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〮〯〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎ㆐-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿕ꀀ-ꒌꓐ-ꘌꘐ-ꘫꙀ-ꙮꚀ-ꚝꚠ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꣽ꤀-ꤥ꤮-ꥆꥒ꥓꥟-ꥼꦃ-ꦲꦴꦵꦺꦻꦽ-꧍ꧏ-꧙꧞-ꧤꧦ-ꧾꨀ-ꨨꨯꨰꨳꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-ꩻꩽ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫫꫮ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭥꭰ-ꯤꯦꯧꯩ-꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]|\uD800[\uDC00-\uDC0B]|\uD800[\uDC0D-\uDC26]|\uD800[\uDC28-\uDC3A]|𐀼|𐀽|\uD800[\uDC3F-\uDC4D]|\uD800[\uDC50-\uDC5D]|\uD800[\uDC80-\uDCFA]|𐄀|𐄂|\uD800[\uDD07-\uDD33]|\uD800[\uDD37-\uDD3F]|\uD800[\uDDD0-\uDDFC]|\uD800[\uDE80-\uDE9C]|\uD800[\uDEA0-\uDED0]|\uD800[\uDF00-\uDF23]|\uD800[\uDF30-\uDF4A]|\uD800[\uDF50-\uDF75]|\uD800[\uDF80-\uDF9D]|\uD800[\uDF9F-\uDFC3]|\uD800[\uDFC8-\uDFD5]|\uD801[\uDC00-\uDC9D]|\uD801[\uDCA0-\uDCA9]|\uD801[\uDD00-\uDD27]|\uD801[\uDD30-\uDD63]|𐕯|\uD801[\uDE00-\uDF36]|\uD801[\uDF40-\uDF55]|\uD801[\uDF60-\uDF67]|𑀀|\uD804[\uDC02-\uDC37]|\uD804[\uDC47-\uDC4D]|\uD804[\uDC66-\uDC6F]|\uD804[\uDC82-\uDCB2]|𑂷|𑂸|\uD804[\uDCBB-\uDCC1]|\uD804[\uDCD0-\uDCE8]|\uD804[\uDCF0-\uDCF9]|\uD804[\uDD03-\uDD26]|𑄬|\uD804[\uDD36-\uDD43]|\uD804[\uDD50-\uDD72]|\uD804[\uDD74-\uDD76]|\uD804[\uDD82-\uDDB5]|\uD804[\uDDBF-\uDDC9]|𑇍|\uD804[\uDDD0-\uDDDF]|\uD804[\uDDE1-\uDDF4]|\uD804[\uDE00-\uDE11]|\uD804[\uDE13-\uDE2E]|𑈲|𑈳|𑈵|\uD804[\uDE38-\uDE3D]|\uD804[\uDE80-\uDE86]|𑊈|\uD804[\uDE8A-\uDE8D]|\uD804[\uDE8F-\uDE9D]|\uD804[\uDE9F-\uDEA9]|\uD804[\uDEB0-\uDEDE]|\uD804[\uDEE0-\uDEE2]|\uD804[\uDEF0-\uDEF9]|𑌂|𑌃|\uD804[\uDF05-\uDF0C]|𑌏|𑌐|\uD804[\uDF13-\uDF28]|\uD804[\uDF2A-\uDF30]|𑌲|𑌳|\uD804[\uDF35-\uDF39]|\uD804[\uDF3D-\uDF3F]|\uD804[\uDF41-\uDF44]|𑍇|𑍈|\uD804[\uDF4B-\uDF4D]|𑍐|𑍗|\uD804[\uDF5D-\uDF63]|\uD805[\uDC80-\uDCB2]|𑒹|\uD805[\uDCBB-\uDCBE]|𑓁|\uD805[\uDCC4-\uDCC7]|\uD805[\uDCD0-\uDCD9]|\uD805[\uDD80-\uDDB1]|\uD805[\uDDB8-\uDDBB]|𑖾|\uD805[\uDDC1-\uDDDB]|\uD805[\uDE00-\uDE32]|𑘻|𑘼|𑘾|\uD805[\uDE41-\uDE44]|\uD805[\uDE50-\uDE59]|\uD805[\uDE80-\uDEAA]|𑚬|𑚮|𑚯|𑚶|\uD805[\uDEC0-\uDEC9]|\uD805[\uDF00-\uDF19]|𑜠|𑜡|𑜦|\uD805[\uDF30-\uDF3F]|\uD806[\uDCA0-\uDCF2]|𑣿|\uD806[\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E]|\uD809[\uDC70-\uDC74]|\uD809[\uDC80-\uDD43]|\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38]|\uD81A[\uDE40-\uDE5E]|\uD81A[\uDE60-\uDE69]|𖩮|𖩯|\uD81A[\uDED0-\uDEED]|𖫵|\uD81A[\uDF00-\uDF2F]|\uD81A[\uDF37-\uDF45]|\uD81A[\uDF50-\uDF59]|\uD81A[\uDF5B-\uDF61]|\uD81A[\uDF63-\uDF77]|\uD81A[\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44]|\uD81B[\uDF50-\uDF7E]|\uD81B[\uDF93-\uDF9F]|𛀀|𛀁|\uD82F[\uDC00-\uDC6A]|\uD82F[\uDC70-\uDC7C]|\uD82F[\uDC80-\uDC88]|\uD82F[\uDC90-\uDC99]|𛲜|𛲟|\uD834[\uDC00-\uDCF5]|\uD834[\uDD00-\uDD26]|\uD834[\uDD29-\uDD66]|\uD834[\uDD6A-\uDD72]|𝆃|𝆄|\uD834[\uDD8C-\uDDA9]|\uD834[\uDDAE-\uDDE8]|\uD834[\uDF60-\uDF71]|\uD835[\uDC00-\uDC54]|\uD835[\uDC56-\uDC9C]|𝒞|𝒟|𝒢|𝒥|𝒦|\uD835[\uDCA9-\uDCAC]|\uD835[\uDCAE-\uDCB9]|𝒻|\uD835[\uDCBD-\uDCC3]|\uD835[\uDCC5-\uDD05]|\uD835[\uDD07-\uDD0A]|\uD835[\uDD0D-\uDD14]|\uD835[\uDD16-\uDD1C]|\uD835[\uDD1E-\uDD39]|\uD835[\uDD3B-\uDD3E]|\uD835[\uDD40-\uDD44]|𝕆|\uD835[\uDD4A-\uDD50]|\uD835[\uDD52-\uDEA5]|\uD835[\uDEA8-\uDEDA]|\uD835[\uDEDC-\uDF14]|\uD835[\uDF16-\uDF4E]|\uD835[\uDF50-\uDF88]|\uD835[\uDF8A-\uDFC2]|\uD835[\uDFC4-\uDFCB]|\uD836[\uDC00-\uDDFF]|\uD836[\uDE37-\uDE3A]|\uD836[\uDE6D-\uDE74]|\uD836[\uDE76-\uDE83]|\uD836[\uDE85-\uDE8B]|\uD83C[\uDD10-\uDD2E]|\uD83C[\uDD30-\uDD69]|\uD83C[\uDD70-\uDD9A]|\uD83C[\uDDE6-\uDE02]|\uD83C[\uDE10-\uDE3A]|\uD83C[\uDE40-\uDE48]|🉐|🉑|[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6]|\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34]|\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|[\uDB80-\uDBBE][\uDC00-\uDFFF]|\uDBBF[\uDC00-\uDFFD]|[\uDBC0-\uDBFE][\uDC00-\uDFFF]|\uDBFF[\uDC00-\uDFFD])|([֐־׀׃׆׈-׿߀-ߪߴߵߺ-ࠕࠚࠤࠨ࠮-ࡘ࡜-࢟‏יִײַ-ﬨשׁ-ﭏ؈؋؍؛-ي٭-ٯٱ-ەۥۦۮۯۺ-ܐܒ-ܯ݋-ޥޱ-޿ࢠ-࣢ﭐ-ﴽ﵀-﷏ﷰ-﷼﷾﷿ﹰ-﻾]|\uD802[\uDC00-\uDD1E]|\uD802[\uDD20-\uDE00]|𐨄|\uD802[\uDE07-\uDE0B]|\uD802[\uDE10-\uDE37]|\uD802[\uDE3B-\uDE3E]|\uD802[\uDE40-\uDEE4]|\uD802[\uDEE7-\uDF38]|\uD802[\uDF40-\uDFFF]|\uD803[\uDC00-\uDE5F]|\uD803[\uDE7F-\uDFFF]|\uD83A[\uDC00-\uDCCF]|\uD83A[\uDCD7-\uDFFF]|\uD83B[\uDC00-\uDDFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDE00-\uDEEF]|\uD83B[\uDEF2-\uDEFF]))");let Ft=class{constructor(e){this.locale=ye(e),this.language=new(wt[this.locale]||wt.default)(this.locale)}emit(e,t){let n,r,s;switch(typeof e){case"string":case"number":n=e;break;case"object":if(r=e.slice(1).map(u=>this.emit(u,t)),s=e[0].toLowerCase(),typeof this[s]=="function")n=this[s](r,t);else throw new Error('unknown operation "'+s+'"');break;case"undefined":n="";break;default:throw new Error("unexpected type in AST: "+typeof e)}return n}concat(e){let t="";return e.forEach(n=>{t+=n}),t}replace(e,t){const n=parseInt(e[0],10);return n<t.length?t[n]:"$"+(n+1)}plural(e){const t=parseFloat(this.language.convertNumber(e[0],10)),n=e.slice(1);return n.length?this.language.convertPlural(t,n):""}gender(e){const t=e[0],n=e.slice(1);return this.language.gender(t,n)}grammar(e){const t=e[0],n=e[1];return n&&t&&this.language.convertGrammar(n,t)}wikilink(e){let t,n=e[0];n.charAt(0)===":"&&(n=n.slice(1));const r=`./${n}`;return e.length===1?t=n:t=e[1],`<a href="${r}" title="${n}">${t}</a>`}extlink(e){if(e.length!==2)throw new Error("Expected two items in the node");return`<a href="${e[0]}">${e[1]}</a>`}bidi(e){const t=Ei(e[0]);return t==="ltr"?"‪"+e[0]+"‬":t==="rtl"?"‫"+e[0]+"‬":e[0]}formatnum(e){const t=!!e[1]&&e[1]==="R",n=e[0];return typeof n=="string"||typeof n=="number"?this.language.convertNumber(n,t):n}htmlattributes(e){const t={};for(let n=0,r=e.length;n<r;n+=2)t[e[n]]=e[n+1];return t}htmlelement(e){const t=e.shift(),n=e.shift();let r=e,s="";for(const o in n)s+=` ${o}="${n[o]}"`;Array.isArray(r)||(r=[r]);const u=r.join("");return`<${t}${s}>${u}</${t}>`}};function ye(e){return typeof e=="string"?e.toLowerCase():e}function Ei(e){const t=e.match(Fi);return t?t[2]===void 0?"ltr":"rtl":null}function yi(e,{wikilinks:t=!1}={}){let n=0;function r(i){return()=>{for(let d=0;d<i.length;d++){const y=i[d]();if(y!==null)return y}return null}}function s(i){const d=n,y=[];for(let A=0;A<i.length;A++){const q=i[A]();if(q===null)return n=d,null;y.push(q)}return y}function u(i,d){return()=>{const y=n,A=[];let q=d();for(;q!==null;)A.push(q),q=d();return A.length<i?(n=y,null):A}}function o(i){const d=i.length;return()=>{let y=null;return e.slice(n,n+d)===i&&(y=i,n+=d),y}}function l(i){return()=>{const d=e.slice(n).match(i);return d===null?null:(n+=d[0].length,d[0])}}const v=l(/^\s+/),B=o("|"),D=o(":"),x=o("\\"),ne=l(/^./),ie=o("$"),me=l(/^\d+/),z=o('"'),W=o("'"),Z=l(t?/^[^{}[\]$<\\]/:/^[^{}$<\\]/),re=l(t?/^[^{}[\]$\\|]/:/^[^{}$\\|]/),K=l(t?/^[^{}[\]$\s]/:/^[^{}$\s]/);function Q(i,d){return()=>{const y=i();return y===null?null:d(y)}}function J(){const i=u(1,Y)();return i===null?null:i.join("")}function he(){const i=u(1,Ce)();return i===null?null:i.join("")}const be=r([k,K]);function De(){const i=u(1,be)();return i===null?null:i.join("")}function k(){const i=s([x,ne]);return i===null?null:i[1]}const Y=r([k,re]),Ce=r([k,Z]);function le(){const i=s([ie,me]);return i===null?null:["REPLACE",parseInt(i[1],10)-1]}const ce=Q(l(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/),function(i){return i.toString()});function b(){const i=s([B,u(0,G)]);if(i===null)return null;const d=i[1];return d.length>1?["CONCAT"].concat(d):d[0]}function pe(){const i=s([ce,D,le]);return i===null?null:[i[0],i[2]]}function Te(){const i=s([ce,D,G]);return i===null?null:[i[0],i[2]]}function de(){const i=s([ce,D]);return i===null?null:[i[0],""]}const Be=r([function(){const i=s([r([pe,Te,de]),u(0,b)]);return i===null?null:i[0].concat(i[1])},function(){const i=s([ce,u(0,b)]);return i===null?null:[i[0]].concat(i[1])}]),Oe=o("{{"),Ie=o("}}"),Fe=o("[["),h=o("]]"),ve=o("["),we=o("]");function fe(){const i=s([Oe,Be,Ie]);return i===null?null:i[1]}function ke(){const i=s([u(1,G),B,u(1,j)]);return i===null?null:[["CONCAT"].concat(i[0]),["CONCAT"].concat(i[2])]}function Pe(){const i=s([u(1,G)]);return i===null?null:[["CONCAT"].concat(i[0])]}const w=r([ke,Pe]);function C(){let i=null;const d=s([Fe,w,h]);if(d!==null){const y=d[1];i=["WIKILINK"].concat(y)}return i}function _(){let i=null;const d=s([ve,u(1,V),v,u(1,j),we]);return d!==null&&(i=["EXTLINK",d[1].length===1?d[1][0]:["CONCAT"].concat(d[1]),["CONCAT"].concat(d[3])]),i}const N=l(/^[A-Za-z]+/);function R(i,d,y,A={allowedHtmlElements:["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","li","dt","dd"],allowedHtmlCommonAttributes:["id","class","style","lang","dir","title","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"],allowedHtmlAttributesByElement:{}}){if(i=i.toLowerCase(),d=d.toLowerCase(),i!==d||A.allowedHtmlElements.indexOf(i)===-1)return!1;const q=/[\000-\010\013\016-\037\177]|expression|filter\s*:|accelerator\s*:|-o-link\s*:|-o-link-source\s*:|-o-replace\s*:|url\s*\(|image\s*\(|image-set\s*\(/i;for(let m=0,c=y.length;m<c;m+=2){const g=y[m];if(A.allowedHtmlCommonAttributes.indexOf(g)===-1&&(A.allowedHtmlAttributesByElement[i]||[]).indexOf(g)===-1||g==="style"&&y[m+1].search(q)!==-1)return!1}return!0}function P(){const i=l(/^[^"]*/),d=s([z,i,z]);return d===null?null:d[1]}function M(){const i=l(/^[^']*/),d=s([W,i,W]);return d===null?null:d[1]}function L(){const i=l(/^\s*=\s*/),d=s([v,N,i,r([P,M])]);return d===null?null:[d[1],d[3]]}function O(){const i=u(0,L)();return Array.prototype.concat.apply(["HTMLATTRIBUTES"],i)}function X(){let i=null;const d=n,y=o("<"),A=l(/^\/?/),q=l(/^\s*>/),m=s([y,N,O,A,q]);if(m===null)return null;const c=n,g=m[1],I=u(0,j)(),Ke=n,Ge=o("</"),jt=s([Ge,N,q]);if(jt===null)return["CONCAT",e.slice(d,c)].concat(I);const ba=n,Ca=jt[1],Rt=m[2],va=Rt.slice(1);if(R(g,Ca,va))i=["HTMLELEMENT",g,Rt].concat(I);else{const Lt=Aa=>Aa.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");i=["CONCAT",Lt(e.slice(d,c))].concat(I,Lt(e.slice(Ke,ba)))}return i}const V=r([fe,le,C,_,De]),j=r([fe,le,C,_,X,he]),G=r([fe,le,J]);function se(){const i=u(0,j)();return i===null?null:["CONCAT"].concat(i)}const a=se();if(a===null||n!==e.length)throw new Error("Parse error at position "+n.toString()+" in input: "+e);return a}class Et{constructor(t,{wikilinks:n=!1}={}){this.locale=ye(t),this.wikilinks=n,this.emitter=new Ft(this.locale)}parse(t,n){if(t.includes("{{")||t.includes("<")||this.wikilinks&&t.includes("[")){const r=yi(t,{wikilinks:this.wikilinks});return this.emitter.emit(r,n)}else return this.simpleParse(t,n)}simpleParse(t,n){return t.replace(/\$(\d+)/g,(r,s)=>{const u=parseInt(s,10)-1;return n[u]!==void 0?n[u]:"$"+s})}}class $i{constructor(){this.sourceMap=new Map}load(t,n){if(typeof t!="object")throw new Error("Invalid message source. Must be an object");if(n=ye(n),n){if(!/^[a-zA-Z0-9-]+$/.test(n))throw new Error(`Invalid locale ${n}`);for(const r in t)if(r.indexOf("@")!==0){if(typeof t[r]=="object")return this.load(t);if(typeof t[r]!="string")throw new Error(`Invalid message for message ${r} in ${n} locale.`);break}this.sourceMap.has(n)?this.sourceMap.set(n,Object.assign(this.sourceMap.get(n),t)):this.sourceMap.set(n,t)}else for(n in t)this.load(t[n],n)}getMessage(t,n){const r=this.sourceMap.get(ye(n));return r?r[t]:null}hasLocale(t){return this.sourceMap.has(t)}}class Bi{constructor(t,{finalFallback:n="en",messages:r=void 0,wikilinks:s=!1}={}){this.locale=ye(t),this.parser=new Et(this.locale,{wikilinks:s}),this.messageStore=new $i,r&&this.load(r,this.locale),this.finalFallback=n,this.wikilinks=s}load(t,n){return this.messageStore.load(t,n||this.locale)}i18n(t,...n){return this.parser.parse(this.getMessage(t),n)}setLocale(t){this.locale=ye(t),this.parser=new Et(this.locale,{wikilinks:this.wikilinks})}getFallbackLocales(){return[...At[this.locale]||[],this.finalFallback]}getMessage(t){let n=this.locale,r=0;const s=this.getFallbackLocales(this.locale);for(;n;){const u=n.split("-");let o=u.length;do{const l=u.slice(0,o).join("-"),v=this.messageStore.getMessage(t,l);if(typeof v=="string")return v;o--}while(o);n=s[r],r++}return t}registerParserPlugin(t,n){Ft.prototype[t]=n}}const yt={"@metadata":{authors:["Mason Payne"],"last-updated":"2024-01-08",locale:"en"},"sa-login":"Login","sa-username":"Email","sa-password":"Password","sa-use-password":"Use Password","sa-code":"Code","sa-signup":"Sign up","sa-signup-complete":"Sign up complete","sa-back":"Back","sa-error-creating-user":"Error creating user.","sa-remember":"Remember me","sa-forgot":"Forgot your password?","sa-register":"Register","sa-error.login":"Invalid email or password","sa-error.register":"Invalid email or password","sa-error.unknown":"Unknown error","sa-account-settings":"Account Settings","sa-webauthn-security-keys":"Your passkeys","sa-add-security-key":"Add passkey","webauthn-not-enrolled":"WebAuthn not enrolled","sa-webauthn-key-name":"Key Name","sa-cancel":"Cancel","sa-no-security-keys":"No passkeys","sa-webauthn-key-actions":"Actions","sa-remove":"Remove","not-authenticated":"Not authenticated","error-otp-registration":"Error registering OTP","sa-confirm-delete-key":"Are you sure you want to delete this key?","sa-add-mfa":"Manage MFA","sa-add-email":"Add Email","sa-email":"Email","sa-phone":"Phone","sa-add-sms":"Add SMS","sa-mfa":"MFA Registrations","error-otp-list":"Error listing OTPs","sa-type":"Type","sa-mfa-destination":"Destination","sa-mfa-validated":"Validated","sa-validate":"Validate","sa-mfa-action":"Action","sa-no":"No","sa-yes":"Yes","error-otp-remove":"Error removing MFA Registration","error-webauthn-remove":"Error removing WebAuthn Registration","sa-register-mfa":"Register MFA","sa-otp-required":"A one-time code is required.","sa-otp-choose":"Choose how to receive your code:","sa-otp-no-registrations":"No MFA methods registered.","sa-otp-send-code":"Send Code","sa-otp-verify":"Verify Code","sa-unknown-challenge":"Unknown challenge type.","sa-invite-otp":"Verification Code","sa-invite-otp-hint":"Enter the code from your invite email","sa-invite-password":"Choose a Password","sa-invite-password-hint":"Create a secure password for your account","sa-invite-submit":"Complete Registration","sa-invite-success":"Registration complete! Redirecting to login...","sa-invite-error-otp":"Invalid or expired verification code","sa-invite-error-expired":"This invite has expired. Please contact your administrator.","sa-invite-error-generic":"Unable to complete registration. Please try again.","sa-invite-completing":"Completing registration...","sa-forgot-password":"Forgot your password?","sa-reset-password":"Reset Password","sa-reset-email-sent":"If an account exists with that email, a reset code has been sent.","sa-new-password":"New Password","sa-reset-code":"Reset Code","sa-reset-submit":"Reset Password","sa-reset-success":"Password reset successfully! You can now log in.","sa-reset-error":"Unable to reset password. Please try again.","sa-reset-error-code":"Invalid or expired reset code","sa-or":"Or","sa-social-google":"Continue with Google","sa-social-github":"Continue with GitHub","sa-social-apple":"Continue with Apple","sa-social-oidc":"Continue with SSO","sa-loading":"Loading...","sa-social-error":"Error starting social login","sa-signup-mfa-title":"Verify Your Email","sa-signup-verify-prompt":"A verification code has been sent to your email. Enter it below to activate multi-factor authentication.","sa-signup-verify-error":"Invalid or expired verification code.","sa-signup-webauthn-prompt":"Your account is secure! Optionally, add a passkey for faster and easier logins.","sa-signup-webauthn-setup":"Set Up Passkey","sa-signup-webauthn-done":"Skip for now","sa-signup-webauthn-error":"Error setting up passkey. Please try again from your account settings."},ki={en:yt,fr:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"fr"},"sa-login":"Connexion","sa-username":"Adresse e-mail","sa-password":"Mot de passe","sa-use-password":"Utiliser le mot de passe","sa-code":"code à deux facteurs","sa-remember":"Souviens-toi de moi","sa-forgot":"Mot de passe oublié?","sa-register":"S'inscrire","sa-error.login":"E-mail ou mot de passe invalide","sa-error.register":"E-mail ou mot de passe invalide","sa-error.unknown":"Erreur inconnue","sa-otp-required":"Un code à usage unique est requis.","sa-otp-choose":"Choisissez comment recevoir votre code :","sa-otp-no-registrations":"Aucune méthode MFA enregistrée.","sa-otp-send-code":"Envoyer le code","sa-otp-verify":"Vérifier le code","sa-unknown-challenge":"Type de défi inconnu.","sa-complete-invite":"Complétez votre invitation","sa-invite-otp":"Code de vérification","sa-invite-otp-hint":"Entrez le code de votre email d'invitation","sa-invite-password":"Choisissez un mot de passe","sa-invite-password-hint":"Créez un mot de passe sécurisé pour votre compte","sa-invite-submit":"Terminer l'inscription","sa-invite-success":"Inscription terminée ! Redirection vers la connexion...","sa-invite-error-otp":"Code de vérification invalide ou expiré","sa-invite-error-expired":"Cette invitation a expiré. Veuillez contacter votre administrateur.","sa-invite-error-generic":"Impossible de terminer l'inscription. Veuillez réessayer.","sa-invite-completing":"Finalisation de l'inscription...","sa-forgot-password":"Mot de passe oublié ?","sa-reset-password":"Réinitialiser le mot de passe","sa-reset-email-sent":"Si un compte existe avec cet e-mail, un code de réinitialisation a été envoyé.","sa-new-password":"Nouveau mot de passe","sa-reset-code":"Code de réinitialisation","sa-reset-submit":"Réinitialiser le mot de passe","sa-reset-success":"Mot de passe réinitialisé avec succès ! Vous pouvez maintenant vous connecter.","sa-reset-error":"Impossible de réinitialiser le mot de passe. Veuillez réessayer.","sa-reset-error-code":"Code de réinitialisation invalide ou expiré","sa-or":"Ou","sa-social-google":"Continuer avec Google","sa-social-github":"Continuer avec GitHub","sa-social-apple":"Continuer avec Apple","sa-social-oidc":"Continuer avec SSO","sa-loading":"Chargement...","sa-social-error":"Erreur lors de la connexion sociale","sa-signup-mfa-title":"Vérifiez votre e-mail","sa-signup-verify-prompt":"Un code de vérification a été envoyé à votre e-mail. Entrez-le ci-dessous pour activer l'authentification multi-facteurs.","sa-signup-verify-error":"Code de vérification invalide ou expiré.","sa-signup-webauthn-prompt":"Votre compte est sécurisé ! Ajoutez optionnellement une clé d'accès pour des connexions plus rapides.","sa-signup-webauthn-setup":"Configurer la clé d'accès","sa-signup-webauthn-done":"Ignorer pour l'instant","sa-signup-webauthn-error":"Erreur lors de la configuration de la clé d'accès. Veuillez réessayer depuis les paramètres de votre compte."},es:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"es"},"sa-login":"Acceso","sa-username":"Correo electrónico","sa-password":"Clave","sa-use-password":"Usar contraseña","sa-code":"Código","sa-remember":"Acuérdate de mí","sa-forgot":"¿Olvidaste tu contraseña?","sa-register":"Registro","sa-error.login":"Correo electrónico o contraseña inválidos","sa-error.register":"Correo electrónico o contraseña inválidos","sa-error.unknown":"Error desconocido","sa-otp-required":"Se requiere un código de un solo uso.","sa-otp-choose":"Elige cómo recibir tu código:","sa-otp-no-registrations":"No hay métodos MFA registrados.","sa-unknown-challenge":"Tipo de desafío desconocido.","sa-complete-invite":"Completa tu invitación","sa-invite-otp":"Código de verificación","sa-invite-otp-hint":"Ingresa el código de tu correo de invitación","sa-invite-password":"Elige una contraseña","sa-invite-password-hint":"Crea una contraseña segura para tu cuenta","sa-invite-submit":"Completar registro","sa-invite-success":"¡Registro completo! Redirigiendo al inicio de sesión...","sa-invite-error-otp":"Código de verificación inválido o expirado","sa-invite-error-expired":"Esta invitación ha expirado. Por favor contacta a tu administrador.","sa-invite-error-generic":"No se pudo completar el registro. Por favor intenta de nuevo.","sa-invite-completing":"Completando registro...","sa-forgot-password":"¿Olvidaste tu contraseña?","sa-reset-password":"Restablecer contraseña","sa-reset-email-sent":"Si existe una cuenta con ese correo, se ha enviado un código de restablecimiento.","sa-new-password":"Nueva contraseña","sa-reset-code":"Código de restablecimiento","sa-reset-submit":"Restablecer contraseña","sa-reset-success":"¡Contraseña restablecida con éxito! Ya puedes iniciar sesión.","sa-reset-error":"No se pudo restablecer la contraseña. Por favor intenta de nuevo.","sa-reset-error-code":"Código de restablecimiento inválido o expirado","sa-or":"O","sa-social-google":"Continuar con Google","sa-social-github":"Continuar con GitHub","sa-social-apple":"Continuar con Apple","sa-social-oidc":"Continuar con SSO","sa-loading":"Cargando...","sa-social-error":"Error al iniciar sesión social","sa-signup-mfa-title":"Verifica tu correo electrónico","sa-signup-verify-prompt":"Se ha enviado un código de verificación a tu correo. Ingrésalo para activar la autenticación multifactor.","sa-signup-verify-error":"Código de verificación inválido o expirado.","sa-signup-webauthn-prompt":"¡Tu cuenta está protegida! Opcionalmente, agrega una clave de acceso para inicios de sesión más rápidos.","sa-signup-webauthn-setup":"Configurar clave de acceso","sa-signup-webauthn-done":"Omitir por ahora","sa-signup-webauthn-error":"Error al configurar la clave de acceso. Intenta de nuevo desde la configuración de tu cuenta."},ja:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"ja"},"sa-login":"ログイン","sa-username":"メールアドレス","sa-password":"パスワード","sa-use-password":"パスワードを使用する","sa-code":"コード","sa-remember":"私を覚えてますか","sa-forgot":"パスワードをお忘れですか?","sa-register":"登録","sa-error.login":"メールアドレスかパスワードが無効","sa-error.register":"メールアドレスかパスワードが無効","sa-error.unknown":"未知のエラー","sa-otp-required":"ワンタイムコードが必要です。","sa-otp-choose":"コードの受け取り方法を選択してください:","sa-otp-no-registrations":"MFA方法が登録されていません。","sa-otp-send-code":"コードを送信","sa-otp-verify":"コードを確認","sa-unknown-challenge":"不明なチャレンジタイプです。","sa-complete-invite":"招待を完了する","sa-invite-otp":"確認コード","sa-invite-otp-hint":"招待メールのコードを入力してください","sa-invite-password":"パスワードを選択","sa-invite-password-hint":"アカウント用の安全なパスワードを作成してください","sa-invite-submit":"登録を完了","sa-invite-success":"登録完了!ログインページへリダイレクト中...","sa-invite-error-otp":"無効または期限切れの確認コード","sa-invite-error-expired":"この招待は期限切れです。管理者にお問い合わせください。","sa-invite-error-generic":"登録を完了できませんでした。もう一度お試しください。","sa-invite-completing":"登録を完了しています...","sa-forgot-password":"パスワードをお忘れですか?","sa-reset-password":"パスワードをリセット","sa-reset-email-sent":"そのメールアドレスのアカウントが存在する場合、リセットコードが送信されました。","sa-new-password":"新しいパスワード","sa-reset-code":"リセットコード","sa-reset-submit":"パスワードをリセット","sa-reset-success":"パスワードが正常にリセットされました!ログインできます。","sa-reset-error":"パスワードをリセットできませんでした。もう一度お試しください。","sa-reset-error-code":"無効または期限切れのリセットコード","sa-or":"または","sa-social-google":"Googleで続ける","sa-social-github":"GitHubで続ける","sa-social-apple":"Appleで続ける","sa-social-oidc":"SSOで続ける","sa-loading":"読み込み中...","sa-social-error":"ソーシャルログイン開始エラー","sa-signup-mfa-title":"メールを確認してください","sa-signup-verify-prompt":"確認コードがメールに送信されました。多要素認証を有効にするために入力してください。","sa-signup-verify-error":"無効または期限切れの確認コードです。","sa-signup-webauthn-prompt":"アカウントが保護されました!パスキーを追加してより速く簡単にログインできます(任意)。","sa-signup-webauthn-setup":"パスキーを設定","sa-signup-webauthn-done":"今はスキップ","sa-signup-webauthn-error":"パスキーの設定中にエラーが発生しました。アカウント設定から再試行してください。"}};function nt(e){const t=new Bi("en",{messages:yt});return e!=="en"&&(t.load(ki[e],e),t.setLocale(e)),t}function $t(e){const t="==".slice(0,(4-e.length%4)%4),n=e.replace(/-/g,"+").replace(/_/g,"/")+t,r=atob(n),s=new ArrayBuffer(r.length),u=new Uint8Array(s);for(let o=0;o<r.length;o++)u[o]=r.charCodeAt(o);return s}function Bt(e){const t=new Uint8Array(e);let n="";for(const u of t)n+=String.fromCharCode(u);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var S="copy",oe="convert";function $e(e,t,n){if(t===S)return n;if(t===oe)return e(n);if(t instanceof Array)return n.map(r=>$e(e,t[0],r));if(t instanceof Object){const r={};for(const[s,u]of Object.entries(t)){if(u.derive){const o=u.derive(n);o!==void 0&&(n[s]=o)}if(!(s in n)){if(u.required)throw new Error(`Missing key: ${s}`);continue}if(n[s]==null){r[s]=null;continue}r[s]=$e(e,u.schema,n[s])}return r}}function rt(e,t){return{required:!0,schema:e,derive:t}}function T(e){return{required:!0,schema:e}}function U(e){return{required:!1,schema:e}}var kt={type:T(S),id:T(oe),transports:U(S)},xt={appid:U(S),appidExclude:U(S),credProps:U(S)},St={appid:U(S),appidExclude:U(S),credProps:U(S)},xi={publicKey:T({rp:T(S),user:T({id:T(oe),name:T(S),displayName:T(S)}),challenge:T(oe),pubKeyCredParams:T(S),timeout:U(S),excludeCredentials:U([kt]),authenticatorSelection:U(S),attestation:U(S),extensions:U(xt)}),signal:U(S)},Si={type:T(S),id:T(S),rawId:T(oe),authenticatorAttachment:U(S),response:T({clientDataJSON:T(oe),attestationObject:T(oe),transports:rt(S,e=>{var t;return((t=e.getTransports)==null?void 0:t.call(e))||[]})}),clientExtensionResults:rt(St,e=>e.getClientExtensionResults())},_i={mediation:U(S),publicKey:T({challenge:T(oe),timeout:U(S),rpId:U(S),allowCredentials:U([kt]),userVerification:U(S),extensions:U(xt)}),signal:U(S)},Ti={type:T(S),id:T(S),rawId:T(oe),authenticatorAttachment:U(S),response:T({clientDataJSON:T(oe),authenticatorData:T(oe),signature:T(oe),userHandle:T(oe)}),clientExtensionResults:rt(St,e=>e.getClientExtensionResults())};function _t(e){return $e($t,xi,e)}function Oi(e){return $e(Bt,Si,e)}function Ii(e){return $e($t,_i,e)}function Pi(e){return $e(Bt,Ti,e)}async function Tt(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>Oi(t),t}async function zi(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>Pi(t),t}function st(e){this.message=e}st.prototype=new Error,st.prototype.name="InvalidCharacterError";var Ot=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new st("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,u=0,o="";r=t.charAt(u++);~r&&(n=s%4?64*n+r:r,s++%4)?o+=String.fromCharCode(255&n>>(-2*s&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function Ni(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(Ot(n).replace(/(.)/g,function(r,s){var u=s.charCodeAt(0).toString(16).toUpperCase();return u.length<2&&(u="0"+u),"%"+u}))}(t)}catch{return Ot(t)}}function Ue(e){this.message=e}function Mi(e,t){if(typeof e!="string")throw new Ue("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(Ni(e.split(".")[n]))}catch(r){throw new Ue("Invalid token specified: "+r.message)}}Ue.prototype=new Error,Ue.prototype.name="InvalidTokenError";const Je="spartan-token";function It(){const e=localStorage.getItem(Je);let t=null;if(e)try{if(t=Mi(e),t.exp>Ri())return t;localStorage.removeItem(Je)}catch(n){console.error("Error decoding token",n),localStorage.removeItem(Je)}return null}function ji(){const e=localStorage.getItem(Je);return e||null}function Ri(){return Math.round(new Date().getTime()/1e3)}var Li=E(`<form class=login-frame><style>.login-frame {
1
+ (function(nt){typeof define=="function"&&define.amd?define(nt):nt()})(function(){"use strict";const Ke={equals:(e,t)=>e===t};let gt=Ct;const xe=1,Ge=2,mt={owned:null,cleanups:null,context:null,owner:null};var ae=null;let rt=null,Yt=null,W=null,ne=null,Ee=null,He=0;function Xt(e,t){const n=W,r=ae,s=e.length===0,i=t===void 0?r:t,u=s?mt:{owned:null,cleanups:null,context:i?i.context:null,owner:i},l=s?e:()=>e(()=>We(()=>qe(u)));ae=u,W=null;try{return Le(l,!0)}finally{W=n,ae=r}}function C(e,t){t=t?Object.assign({},Ke,t):Ke;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),vt(n,s));return[bt.bind(n),r]}function y(e,t,n){const r=it(e,t,!1,xe);Re(r)}function Qt(e,t,n){gt=nn;const r=it(e,t,!1,xe);r.user=!0,Ee?Ee.push(r):Re(r)}function h(e,t,n){n=n?Object.assign({},Ke,n):Ke;const r=it(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Re(r),bt.bind(r)}function We(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function st(e){Qt(()=>We(e))}function bt(){if(this.sources&&this.state)if(this.state===xe)Re(this);else{const e=ne;ne=null,Le(()=>Ye(this),!1),ne=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function vt(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Le(()=>{for(let s=0;s<e.observers.length;s+=1){const i=e.observers[s],u=rt&&rt.running;u&&rt.disposed.has(i),(u?!i.tState:!i.state)&&(i.pure?ne.push(i):Ee.push(i),i.observers&&wt(i)),u||(i.state=xe)}if(ne.length>1e6)throw ne=[],new Error},!1)),t}function Re(e){if(!e.fn)return;qe(e);const t=He;en(e,e.value,t)}function en(e,t,n){let r;const s=ae,i=W;W=ae=e;try{r=e.fn(t)}catch(u){return e.pure&&(e.state=xe,e.owned&&e.owned.forEach(qe),e.owned=null),e.updatedAt=n+1,At(u)}finally{W=i,ae=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?vt(e,r):e.value=r,e.updatedAt=n)}function it(e,t,n,r=xe,s){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ae,context:ae?ae.context:null,pure:n};return ae===null||ae!==mt&&(ae.owned?ae.owned.push(i):ae.owned=[i]),i}function Ze(e){if(e.state===0)return;if(e.state===Ge)return Ye(e);if(e.suspense&&We(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<He);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===xe)Re(e);else if(e.state===Ge){const r=ne;ne=null,Le(()=>Ye(e,t[0]),!1),ne=r}}function Le(e,t){if(ne)return e();let n=!1;t||(ne=[]),Ee?n=!0:Ee=[],He++;try{const r=e();return tn(n),r}catch(r){n||(Ee=null),ne=null,At(r)}}function tn(e){if(ne&&(Ct(ne),ne=null),e)return;const t=Ee;Ee=null,t.length&&Le(()=>gt(t),!1)}function Ct(e){for(let t=0;t<e.length;t++)Ze(e[t])}function nn(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Ze(r)}for(t=0;t<n;t++)Ze(e[t])}function Ye(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const s=r.state;s===xe?r!==t&&(!r.updatedAt||r.updatedAt<He)&&Ze(r):s===Ge&&Ye(r,t)}}}function wt(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Ge,n.pure?ne.push(n):Ee.push(n),n.observers&&wt(n))}}function qe(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),s=n.observers;if(s&&s.length){const i=s.pop(),u=n.observerSlots.pop();r<s.length&&(i.sourceSlots[u]=r,s[r]=i,n.observerSlots[r]=u)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)qe(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)qe(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function rn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function At(e,t=ae){throw rn(e)}function sn(e,t,n){let r=n.length,s=t.length,i=r,u=0,l=0,w=t[s-1].nextSibling,$=null;for(;u<s||l<i;){if(t[u]===n[l]){u++,l++;continue}for(;t[s-1]===n[i-1];)s--,i--;if(s===u){const D=i<r?l?n[l-1].nextSibling:n[i-l]:w;for(;l<i;)e.insertBefore(n[l++],D)}else if(i===l)for(;u<s;)(!$||!$.has(t[u]))&&t[u].remove(),u++;else if(t[u]===n[i-1]&&n[l]===t[s-1]){const D=t[--s].nextSibling;e.insertBefore(n[l++],t[u++].nextSibling),e.insertBefore(n[--i],D),t[s]=n[i]}else{if(!$){$=new Map;let B=l;for(;B<i;)$.set(n[B],B++)}const D=$.get(t[u]);if(D!=null)if(l<D&&D<i){let B=u,oe=1,fe;for(;++B<s&&B<i&&!((fe=$.get(t[B]))==null||fe!==D+oe);)oe++;if(oe>D-l){const Fe=t[u];for(;l<D;)e.insertBefore(n[l++],Fe)}else e.replaceChild(n[l++],t[u++])}else u++;else t[u++].remove()}}}const Et="_$DX_DELEGATE";function F(e,t,n,r){let s;const i=()=>{const l=document.createElement("template");return l.innerHTML=e,l.content.firstChild},u=()=>(s||(s=i())).cloneNode(!0);return u.cloneNode=u,u}function at(e,t=window.document){const n=t[Et]||(t[Et]=new Set);for(let r=0,s=e.length;r<s;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,an))}}function ue(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Ft(e,t,n){return We(()=>e(t,n))}function f(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Xe(e,t,r,n);y(s=>Xe(e,t(),s,n),r)}function an(e){let t=e.target;const n=`$$${e.type}`,r=e.target,s=e.currentTarget,i=w=>Object.defineProperty(e,"target",{configurable:!0,value:w}),u=()=>{const w=t[n];if(w&&!t.disabled){const $=t[`${n}Data`];if($!==void 0?w.call(t,$,e):w.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},l=()=>{for(;u()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const w=e.composedPath();i(w[0]);for(let $=0;$<w.length-2&&(t=w[$],!!u());$++){if(t._$host){t=t._$host,l();break}if(t.parentNode===s)break}}else l();i(r)}function Xe(e,t,n,r,s){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,u=r!==void 0;if(e=u&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(t=t.toString(),t===n))return n;if(u){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Pe(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=Pe(e,n,r);else{if(i==="function")return y(()=>{let l=t();for(;typeof l=="function";)l=l();n=Xe(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],w=n&&Array.isArray(n);if(ut(l,t,n,s))return y(()=>n=Xe(e,l,n,r,!0)),()=>n;if(l.length===0){if(n=Pe(e,n,r),u)return n}else w?n.length===0?yt(e,l,r):sn(e,n,l):(n&&Pe(e),yt(e,l));n=l}else if(t.nodeType){if(Array.isArray(n)){if(u)return n=Pe(e,n,r,t);Pe(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ut(e,t,n,r){let s=!1;for(let i=0,u=t.length;i<u;i++){let l=t[i],w=n&&n[e.length],$;if(!(l==null||l===!0||l===!1))if(($=typeof l)=="object"&&l.nodeType)e.push(l);else if(Array.isArray(l))s=ut(e,l,w)||s;else if($==="function")if(r){for(;typeof l=="function";)l=l();s=ut(e,Array.isArray(l)?l:[l],Array.isArray(w)?w:[w])||s}else e.push(l),s=!0;else{const D=String(l);w&&w.nodeType===3&&w.data===D?e.push(w):e.push(document.createTextNode(D))}}return s}function yt(e,t,n=null){for(let r=0,s=t.length;r<s;r++)e.insertBefore(t[r],n)}function Pe(e,t,n,r){if(n===void 0)return e.textContent="";const s=r||document.createTextNode("");if(t.length){let i=!1;for(let u=t.length-1;u>=0;u--){const l=t[u];if(s!==l){const w=l.parentNode===e;!i&&!u?w?e.replaceChild(s,l):e.insertBefore(s,n):w&&l.remove()}else i=!0}}else e.insertBefore(s,n);return[s]}function un(e){return Object.keys(e).reduce((n,r)=>{const s=e[r];return n[r]=Object.assign({},s),kt(s.value)&&!fn(s.value)&&!Array.isArray(s.value)&&(n[r].value=Object.assign({},s.value)),Array.isArray(s.value)&&(n[r].value=s.value.slice(0)),n},{})}function on(e){return e?Object.keys(e).reduce((n,r)=>{const s=e[r];return n[r]=kt(s)&&"value"in s?s:{value:s},n[r].attribute||(n[r].attribute=dn(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function ln(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function cn(e,t){const n=un(t);return Object.keys(t).forEach(s=>{const i=n[s],u=e.getAttribute(i.attribute),l=e[s];u!=null&&(i.value=i.parse?$t(u):u),l!=null&&(i.value=Array.isArray(l)?l.slice(0):l),i.reflect&&Bt(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,s,{get(){return i.value},set(w){const $=i.value;i.value=w,i.reflect&&Bt(this,i.attribute,i.value,!!i.parse);for(let D=0,B=this.__propertyChangedCallbacks.length;D<B;D++)this.__propertyChangedCallbacks[D](s,w,$)},enumerable:!0,configurable:!0})}),n}function $t(e){if(e)try{return JSON.parse(e)}catch{return e}}function Bt(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let s=r?JSON.stringify(n):n;e.__updating[t]=!0,s==="true"&&(s=""),e.setAttribute(t,s),Promise.resolve().then(()=>delete e.__updating[t])}function dn(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function kt(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function fn(e){return Object.prototype.toString.call(e)==="[object Function]"}function hn(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let ot;function pn(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(s=>t[s].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=cn(this,t);const s=ln(this.props),i=this.Component,u=ot;try{ot=this,this.__initialized=!0,hn(i)?new i(s,{element:this}):i(s,{element:this})}finally{ot=u}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let s=null;for(;s=this.__releaseCallbacks.pop();)s(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(s,i,u){if(this.__initialized&&!this.__updating[s]&&(s=this.lookupProp(s),s in t)){if(u==null&&!this[s])return;this[s]=t[s].parse?$t(u):u}}lookupProp(s){if(t)return n.find(i=>s===i||s===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(s){this.__releaseCallbacks.push(s)}addPropertyChangedCallback(s){this.__propertyChangedCallbacks.push(s)}}}function Dn(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:s,customElements:i=window.customElements}=n;return u=>{if(!e)throw new Error("tag is required to register a Component");let l=i.get(e);return l?(l.prototype.Component=u,l):(l=pn(r,on(t)),l.prototype.Component=u,l.prototype.registeredTag=e,i.define(e,l,s),l)}}function gn(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[s,i]=C(e[t[r]]);Object.defineProperty(n,t[r],{get:s,set(u){i(()=>u)}})}return n}function mn(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function bn(e){return(t,n)=>{const{element:r}=n;return Xt(s=>{const i=gn(t);r.addPropertyChangedCallback((l,w)=>i[l]=w),r.addReleaseCallback(()=>{r.renderRoot.textContent="",s()});const u=e(i,n);return f(r.renderRoot,u)},mn(r))}}function lt(e,t,n){return arguments.length===2&&(n=t,t={}),Dn(e,t)(bn(n))}var vn="٠١٢٣٤٥٦٧٨٩",Cn="۰۱۲۳۴۵۶۷۸۹",wn="൦൧൨൩൪൫൬൭൮൯",An="೦೧೨೩೪೫೬೭೮೯",En="໐໑໒໓໔໕໖໗໘໙",Fn="୦୧୨୩୪୫୬୭୮୯",yn="០១២៣៤៥៦៧៨៩",$n="߀߁߂߃߄߅߆߇߈߉",Bn="੦੧੨੩੪੫੬੭੮੯",kn="૦૧૨૩૪૫૬૭૮૯",xn="०१२३४५६७८९",Sn="၀၁၂၃၄၅၆၇၈၉",_n="௦௧௨௩௪௫௬௭௮௯",Tn="౦౧౨౩౪౫౬౭౮౯",On="๐๑๒๓๔๕๖๗๘๙",In="༠༡༢༣༤༥༦༧༨༩",xt={ar:vn,fa:Cn,ml:wn,kn:An,lo:En,or:Fn,kh:yn,nqo:$n,pa:Bn,gu:kn,hi:xn,my:Sn,ta:_n,te:Tn,th:On,bo:In},Pn=["ru"],zn=["id"],Nn=["id"],Mn=["ady-cyrl"],jn=["aeb-arab"],Rn=["sq"],Ln=["ru"],qn=["zh-hant"],Un=["es"],Jn=["hi"],Vn=["es"],Kn=["ar"],Gn=["ar"],Hn=["ar"],Wn=["es"],Zn=["fr"],Yn=["ru"],Xn=["fr","es","ru"],Qn=["hi"],er=["es"],tr=["fa"],nr=["ru"],rr=["id"],sr=["de"],ir=["bbc-latn"],ar=["fa"],ur=["fa"],or=["bho"],lr=["en"],cr=["id"],dr=["fr"],fr=["bn"],hr=["fa"],pr=["fr"],Dr=["id"],gr=["id"],mr=["ru"],br=["oc"],vr=["nan","zh-hant"],Cr=["ru"],wr=["it"],Ar=["crh-latn"],Er=["sk"],Fr=["pl"],yr=["ru"],$r=["hsb","de"],Br=["ms"],kr=["ne"],xr=["it"],Sr=["it"],_r=["es"],Tr=["fr"],Or=["fi"],Ir=["fr"],Pr=["fr"],zr=["de"],Nr=["it"],Mr=["tr"],jr=["gan-hant","zh-hant","zh-hans"],Rr=["fr"],Lr=["pt"],qr=["fa"],Ur=["es"],Jr=["gom-deva"],Vr=["id"],Kr=["de"],Gr=["es"],Hr=["zh-hant"],Wr=["hif-latn"],Zr=["de"],Yr=["dsb","de"],Xr=["fr"],Qr=["hy"],es=["zh-cn","zh-hans"],ts=["ru"],ns=["eo"],rs=["ike-cans"],ss=["en"],is=["da"],as=["id"],us=["kk-latn","kk-cyrl"],os=["fr"],ls=["kbd-cyrl"],cs=["fr"],ds=["ur"],fs=["tr"],hs=["my"],ps=["kk-cyrl"],Ds=["da"],gs=["ru"],ms=["ru"],bs=["fi"],vs=["ks-arab"],Cs=["de"],ws=["ku-latn"],As=["ru"],Es=["ru"],Fs=["es"],ys=["de"],$s=["ru"],Bs=["ru","az"],ks=["nl"],xs=["it"],Ss=["et"],_s=["fa"],Ts=["it","rm","fur"],Os=["pms","eml","lij","vec","it"],Is=["fr"],Ps=["fa"],zs=["lv"],Ns=["fa"],Ms=["zh-hant"],js=["tr"],Rs=["id"],Ls=["hi"],qs=["myv","ru"],Us=["fr"],Js=["mrj","ru"],Vs=["id"],Ks=["my"],Gs=["ro"],Hs=["mhr","ru"],Ws=["pt"],Zs=["mdf","ru"],Ys=["fa"],Xs=["es"],Qs=["cdo","zh-hant"],ei=["it"],ti=["nn"],ni=["de"],ri=["id"],si=["nb"],ii=["fr"],ai=["ca","fr"],ui=["fi"],oi=["ru"],li=["fr"],ci=["de"],di=["de"],fi=["de"],hi=["en"],pi=["it"],Di=["el"],gi=["pt-br"],mi=["qug","es"],bi=["qu","es"],vi=["it"],Ci=["ro"],wi=["uk","ru"],Ai=["ro"],Ei=["ruq-latn","ro"],Fi=["hi"],yi=["ru"],$i=["it"],Bi=["en"],ki=["it"],xi=["cbk","fa"],Si=["fr"],_i=["fr"],Ti=["lt"],Oi=["bs","sr-el","hr"],Ii=["fr"],Pi=["shy-latn"],zi=["cs"],Ni=["skr-arab"],Mi=["de"],ji=["fi"],Ri=["sr-ec"],Li=["nl"],qi=["de"],Ui=["ru"],Ji=["id"],Vi=["pl"],Ki=["zh-tw","zh-hant","zh-hans"],Gi=["zh-tw","zh-hant","zh-hans"],Hi=["kn"],Wi=["pt"],Zi=["tg-cyrl"],Yi=["zh-tw","zh-hant","zh-hans"],Xi=["tt-cyrl","ru"],Qi=["fr"],ea=["ru"],ta=["ru"],na=["ug-arab"],ra=["it"],sa=["et"],ia=["nl"],aa=["de"],ua=["fi"],oa=["et"],la=["fr"],ca=["fr"],da=["zh-hans"],fa=["ru"],ha=["ka"],pa=["he"],Da=["zh-hans"],ga=["nl"],ma=["kab"],ba=["zh-hans"],St={ab:Pn,abs:zn,ace:Nn,ady:Mn,aeb:jn,"aeb-arab":["ar"],aln:Rn,alt:Ln,ami:qn,an:Un,anp:Jn,arn:Vn,arq:Kn,ary:Gn,arz:Hn,ast:Wn,atj:Zn,av:Yn,avk:Xn,awa:Qn,ay:er,azb:tr,ba:nr,ban:rr,"ban-bali":["ban"],bar:sr,bbc:ir,"bbc-latn":["id"],bcc:ar,"be-tarask":["be"],bgn:ur,bh:or,bi:lr,bjn:cr,bm:dr,bpy:fr,bqi:hr,br:pr,btm:Dr,bug:gr,bxr:mr,ca:br,"cbk-zam":["es"],cdo:vr,ce:Cr,co:wr,crh:Ar,"crh-cyrl":["ru"],cs:Er,csb:Fr,cv:yr,"de-at":["de"],"de-ch":["de"],"de-formal":["de"],dsb:$r,dtp:Br,dty:kr,egl:xr,eml:Sr,"en-ca":["en"],"en-gb":["en"],"es-419":["es"],"es-formal":["es"],ext:_r,ff:Tr,fit:Or,frc:Ir,frp:Pr,frr:zr,fur:Nr,gag:Mr,gan:jr,"gan-hans":["zh-hans"],"gan-hant":["zh-hant","zh-hans"],gcr:Rr,gl:Lr,glk:qr,gn:Ur,gom:Jr,"gom-deva":["hi"],gor:Vr,gsw:Kr,guc:Gr,hak:Hr,hif:Wr,hrx:Zr,hsb:Yr,ht:Xr,"hu-formal":["hu"],hyw:Qr,ii:es,inh:ts,io:ns,iu:rs,jam:ss,jut:is,jv:as,kaa:us,kab:os,kbd:ls,kbp:cs,khw:ds,kiu:fs,kjp:hs,kk:ps,"kk-arab":["kk-cyrl"],"kk-cn":["kk-arab","kk-cyrl"],"kk-kz":["kk-cyrl"],"kk-latn":["kk-cyrl"],"kk-tr":["kk-latn","kk-cyrl"],kl:Ds,"ko-kp":["ko"],koi:gs,krc:ms,krl:bs,ks:vs,ksh:Cs,ku:ws,"ku-arab":["ckb"],kum:As,kv:Es,lad:Fs,lb:ys,lbe:$s,lez:Bs,li:ks,lij:xs,liv:Ss,lki:_s,lld:Ts,lmo:Os,ln:Is,lrc:Ps,ltg:zs,luz:Ns,lzh:Ms,lzz:js,mad:Rs,mai:Ls,"map-bms":["jv","id"],mdf:qs,mg:Us,mhr:Js,min:Vs,mnw:Ks,mo:Gs,mrj:Hs,"ms-arab":["ms"],mwl:Ws,myv:Zs,mzn:Ys,nah:Xs,nan:Qs,nap:ei,nb:ti,nds:ni,"nds-nl":["nl"],nia:ri,"nl-informal":["nl"],nn:si,nrm:ii,oc:ai,olo:ui,os:oi,pcd:li,pdc:ci,pdt:di,pfl:fi,pih:hi,pms:pi,pnt:Di,pt:gi,"pt-br":["pt"],qu:mi,qug:bi,rgn:vi,rmy:Ci,"roa-tara":["it"],rue:wi,rup:Ai,ruq:Ei,"ruq-cyrl":["mk"],"ruq-latn":["ro"],sa:Fi,sah:yi,scn:$i,sco:Bi,sdc:ki,sdh:xi,ses:Si,sg:_i,sgs:Ti,sh:Oi,shi:Ii,shy:Pi,"shy-latn":["fr"],sk:zi,skr:Ni,"skr-arab":["ur","pnb"],sli:Mi,smn:ji,sr:Ri,srn:Li,stq:qi,sty:Ui,su:Ji,szl:Vi,szy:Ki,tay:Gi,tcy:Hi,tet:Wi,tg:Zi,trv:Yi,tt:Xi,"tt-cyrl":["ru"],ty:Qi,tyv:ea,udm:ta,ug:na,vec:ra,vep:sa,vls:ia,vmf:aa,vot:ua,vro:oa,wa:la,wo:ca,wuu:da,xal:fa,xmf:ha,yi:pa,za:Da,zea:ga,zgh:ma,zh:ba,"zh-cn":["zh-hans"],"zh-hant":["zh-hans"],"zh-hk":["zh-hant","zh-hans"],"zh-mo":["zh-hk","zh-hant","zh-hans"],"zh-my":["zh-sg","zh-hans"],"zh-sg":["zh-hans"],"zh-tw":["zh-hant","zh-hans"]};let de=class{constructor(e){this.locale=e}convertPlural(e,t){const n=/\d+=/i;if(!t||t.length===0)return"";for(let s=0;s<t.length;s++){const i=t[s];if(n.test(i)){if(parseInt(i.slice(0,i.indexOf("=")),10)===e)return i.slice(i.indexOf("=")+1);t[s]=void 0}}t=t.filter(s=>!!s);let r=this.getPluralForm(e,this.locale);return r=Math.min(r,t.length-1),t[r]}getPluralForm(e,t){const n=["zero","one","two","few","many","other"],r=new Intl.PluralRules(t),s=r.resolvedOptions().pluralCategories,i=r.select(e);return n.filter(u=>s.includes(u)).indexOf(i)}convertNumber(e,t=!1){let n=this.digitTransformTable(this.locale),r="";if(t){if(parseFloat(e,10)===e||!n)return e;const s=[];for(const u in n)s[n[u]]=u;n=s;const i=String(e);for(let u=0;u<i.length;u++)r+=n[i[u]]||i[u];return parseFloat(r,10)}if(Intl.NumberFormat){let s;const i=[...St[this.locale]||[],"en"];return Intl.NumberFormat.supportedLocalesOf(this.locale).length?s=[this.locale]:s=i,r=new Intl.NumberFormat(s).format(e),r==="NaN"&&(r=e),r}}convertGrammar(e){return e}gender(e,t){if(!t||t.length===0)return"";for(;t.length<2;)t.push(t[t.length-1]);return e==="male"?t[0]:e==="female"?t[1]:t.length===3?t[2]:t[0]}digitTransformTable(e){return xt[e]?xt[e].split(""):!1}},va=class extends de{convertGrammar(e,t){switch(t){case"prefixed":case"תחילית":e.slice(0,1)==="ו"&&e.slice(0,2)!=="וו"&&(e="ו"+e),e.slice(0,1)==="ה"&&(e=e.slice(1)),(e.slice(0,1)<"א"||e.slice(0,1)>"ת")&&(e="־"+e)}return e}},Ca=class extends de{convertGrammar(t,n){switch(n){case"instrumental":t="s "+t;break;case"lokativ":t="o "+t;break}return t}},wa=class extends de{convertGrammar(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e;break}return e}},Aa=class extends de{convertGrammar(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e;break}return e}},Ea=class extends de{convertGrammar(e,t){let n=e.match(/[aou][^äöy]*$/i);const r=e;switch(e.match(/wiki$/i)&&(n=!1),e.match(/[bcdfghjklmnpqrstvwxz]$/i)&&(e+="i"),t){case"genitive":e+="n";break;case"elative":e+=n?"sta":"stä";break;case"partitive":e+=n?"a":"ä";break;case"illative":e+=e.slice(-1)+"n";break;case"inessive":e+=n?"ssa":"ssä";break;default:e=r;break}return e}},Fa=class extends de{convertGrammar(e,t){return t==="genitive"&&(e.slice(-1)==="ь"?e=e.slice(0,-1)+"я":e.slice(-2)==="ия"?e=e.slice(0,-2)+"ии":e.slice(-2)==="ка"?e=e.slice(0,-2)+"ки":e.slice(-2)==="ти"?e=e.slice(0,-2)+"тей":e.slice(-2)==="ды"?e=e.slice(0,-2)+"дов":e.slice(-3)==="ник"&&(e=e.slice(0,-3)+"ника")),e}};class ya extends de{convertGrammar(t,n){switch(n){case"mestnik":t="o "+t;break;case"orodnik":t="z "+t;break}return t}}let $a=class extends de{convertGrammar(e,t){switch(t){case"genitive":e=e.replace(/u[ms]$/i,"i"),e=e.replace(/ommunia$/i,"ommunium"),e=e.replace(/a$/i,"ae"),e=e.replace(/libri$/i,"librorum"),e=e.replace(/nuntii$/i,"nuntiorum"),e=e.replace(/tio$/i,"tionis"),e=e.replace(/ns$/i,"ntis"),e=e.replace(/as$/i,"atis"),e=e.replace(/es$/i,"ei");break;case"accusative":e=e.replace(/u[ms]$/i,"um"),e=e.replace(/ommunia$/i,"am"),e=e.replace(/a$/i,"ommunia"),e=e.replace(/libri$/i,"libros"),e=e.replace(/nuntii$/i,"nuntios"),e=e.replace(/tio$/i,"tionem"),e=e.replace(/ns$/i,"ntem"),e=e.replace(/as$/i,"atem"),e=e.replace(/es$/i,"em");break;case"ablative":e=e.replace(/u[ms]$/i,"o"),e=e.replace(/ommunia$/i,"ommunibus"),e=e.replace(/a$/i,"a"),e=e.replace(/libri$/i,"libris"),e=e.replace(/nuntii$/i,"nuntiis"),e=e.replace(/tio$/i,"tione"),e=e.replace(/ns$/i,"nte"),e=e.replace(/as$/i,"ate"),e=e.replace(/es$/i,"e");break}return e}};class Ba extends de{convertGrammar(t,n){return n==="genitive"&&(t.slice(-1)==="ա"?t=t.slice(0,-1)+"այի":t.slice(-1)==="ո"?t=t.slice(0,-1)+"ոյի":t.slice(-4)==="գիրք"?t=t.slice(0,-4)+"գրքի":t=t+"ի"),t}}let ka=class extends de{convertGrammar(e,t){if(t==="ainmlae")switch(e){case"an Domhnach":e="Dé Domhnaigh";break;case"an Luan":e="Dé Luain";break;case"an Mháirt":e="Dé Mháirt";break;case"an Chéadaoin":e="Dé Chéadaoin";break;case"an Déardaoin":e="Déardaoin";break;case"an Aoine":e="Dé hAoine";break;case"an Satharn":e="Dé Sathairn";break}return e}},xa=class extends de{convertGrammar(e,t){switch(t){case"rol":e+="ról";break;case"ba":e+="ba";break;case"k":e+="k";break}return e}},Sa=class extends de{convertGrammar(e,t){let n,r,s,i;switch(n="мæ",r="",s="",i="",e.match(/тæ$/i)?(e=e.slice(0,-1),n="æм"):e.match(/[аæеёиоыэюя]$/i)?r="й":e.match(/у$/i)?e.slice(-2,-1).match(/[аæеёиоыэюя]$/i)||(r="й"):e.match(/[бвгджзйклмнопрстфхцчшщьъ]$/i)||(s="-"),t){case"genitive":i=s+r+"ы";break;case"dative":i=s+r+"æн";break;case"allative":i=s+n;break;case"ablative":r==="й"?i=s+r+"æ":i=s+r+"æй";break;case"superessive":i=s+r+"ыл";break;case"equative":i=s+r+"ау";break;case"comitative":i=s+"имæ";break}return e+i}};class _a extends de{convertGrammar(t,n){switch(n){case"genitive":t.slice(-1)==="ь"?t=t.slice(0,-1)+"я":t.slice(-2)==="ія"?t=t.slice(0,-2)+"ії":t.slice(-2)==="ка"?t=t.slice(0,-2)+"ки":t.slice(-2)==="ти"?t=t.slice(0,-2)+"тей":t.slice(-2)==="ды"?t=t.slice(0,-2)+"дов":t.slice(-3)==="ник"&&(t=t.slice(0,-3)+"ника");break;case"accusative":t.slice(-2)==="ія"&&(t=t.slice(0,-2)+"ію");break}return t}}var _t={bs:Ca,default:de,dsb:wa,fi:Ea,ga:ka,he:va,hsb:Aa,hu:xa,hy:Ba,la:$a,os:Sa,ru:Fa,sl:ya,uk:_a};const Ta=new RegExp("(?:([A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁːˑˠ-ˤˮͰ-ͳͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-҂Ҋ-ԯԱ-Ֆՙ-՟ա-և։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ঀংঃঅ-ঌএঐও-নপ-রলশ-হঽ-ীেৈোৌৎৗড়ঢ়য়-ৡ০-ৱ৴-৺ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ીૉોૌૐૠૡ૦-૰ૹଂଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽାୀେୈୋୌୗଡ଼ଢ଼ୟ-ୡ୦-୷ஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹாிுூெ-ைொ-ௌௐௗ௦-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౚౠౡ౦-౯౿ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊೋೕೖೞೠೡ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ീെ-ൈൊ-ൌൎൗൟ-ൡ൦-൵൹-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-෴ก-ะาำเ-ๆ๏-๛ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆ໐-໙ໜ-ໟༀ-༗༚-༴༶༸༾-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿚က-ာေးျြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃႄႇ-ႌႎ-ႜ႞-ჅჇჍა-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፼ᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙿᚁ-ᚚᚠ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះៈ។-៚ៜ០-៩᠐-᠙ᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰᤱᤳ-ᤸ᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧚ᨀ-ᨖᨙᨚ᨞-ᩕᩗᩡᩣᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-ᭋ᭐-᭪᭴-᭼ᮂ-ᮡᮦᮧ᮪ᮮ-ᯥᯧᯪ-ᯬᯮ᯲᯳᯼-ᰫᰴᰵ᰻-᱉ᱍ-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〮〯〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎ㆐-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿕ꀀ-ꒌꓐ-ꘌꘐ-ꘫꙀ-ꙮꚀ-ꚝꚠ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꣽ꤀-ꤥ꤮-ꥆꥒ꥓꥟-ꥼꦃ-ꦲꦴꦵꦺꦻꦽ-꧍ꧏ-꧙꧞-ꧤꧦ-ꧾꨀ-ꨨꨯꨰꨳꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-ꩻꩽ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫫꫮ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭥꭰ-ꯤꯦꯧꯩ-꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]|\uD800[\uDC00-\uDC0B]|\uD800[\uDC0D-\uDC26]|\uD800[\uDC28-\uDC3A]|𐀼|𐀽|\uD800[\uDC3F-\uDC4D]|\uD800[\uDC50-\uDC5D]|\uD800[\uDC80-\uDCFA]|𐄀|𐄂|\uD800[\uDD07-\uDD33]|\uD800[\uDD37-\uDD3F]|\uD800[\uDDD0-\uDDFC]|\uD800[\uDE80-\uDE9C]|\uD800[\uDEA0-\uDED0]|\uD800[\uDF00-\uDF23]|\uD800[\uDF30-\uDF4A]|\uD800[\uDF50-\uDF75]|\uD800[\uDF80-\uDF9D]|\uD800[\uDF9F-\uDFC3]|\uD800[\uDFC8-\uDFD5]|\uD801[\uDC00-\uDC9D]|\uD801[\uDCA0-\uDCA9]|\uD801[\uDD00-\uDD27]|\uD801[\uDD30-\uDD63]|𐕯|\uD801[\uDE00-\uDF36]|\uD801[\uDF40-\uDF55]|\uD801[\uDF60-\uDF67]|𑀀|\uD804[\uDC02-\uDC37]|\uD804[\uDC47-\uDC4D]|\uD804[\uDC66-\uDC6F]|\uD804[\uDC82-\uDCB2]|𑂷|𑂸|\uD804[\uDCBB-\uDCC1]|\uD804[\uDCD0-\uDCE8]|\uD804[\uDCF0-\uDCF9]|\uD804[\uDD03-\uDD26]|𑄬|\uD804[\uDD36-\uDD43]|\uD804[\uDD50-\uDD72]|\uD804[\uDD74-\uDD76]|\uD804[\uDD82-\uDDB5]|\uD804[\uDDBF-\uDDC9]|𑇍|\uD804[\uDDD0-\uDDDF]|\uD804[\uDDE1-\uDDF4]|\uD804[\uDE00-\uDE11]|\uD804[\uDE13-\uDE2E]|𑈲|𑈳|𑈵|\uD804[\uDE38-\uDE3D]|\uD804[\uDE80-\uDE86]|𑊈|\uD804[\uDE8A-\uDE8D]|\uD804[\uDE8F-\uDE9D]|\uD804[\uDE9F-\uDEA9]|\uD804[\uDEB0-\uDEDE]|\uD804[\uDEE0-\uDEE2]|\uD804[\uDEF0-\uDEF9]|𑌂|𑌃|\uD804[\uDF05-\uDF0C]|𑌏|𑌐|\uD804[\uDF13-\uDF28]|\uD804[\uDF2A-\uDF30]|𑌲|𑌳|\uD804[\uDF35-\uDF39]|\uD804[\uDF3D-\uDF3F]|\uD804[\uDF41-\uDF44]|𑍇|𑍈|\uD804[\uDF4B-\uDF4D]|𑍐|𑍗|\uD804[\uDF5D-\uDF63]|\uD805[\uDC80-\uDCB2]|𑒹|\uD805[\uDCBB-\uDCBE]|𑓁|\uD805[\uDCC4-\uDCC7]|\uD805[\uDCD0-\uDCD9]|\uD805[\uDD80-\uDDB1]|\uD805[\uDDB8-\uDDBB]|𑖾|\uD805[\uDDC1-\uDDDB]|\uD805[\uDE00-\uDE32]|𑘻|𑘼|𑘾|\uD805[\uDE41-\uDE44]|\uD805[\uDE50-\uDE59]|\uD805[\uDE80-\uDEAA]|𑚬|𑚮|𑚯|𑚶|\uD805[\uDEC0-\uDEC9]|\uD805[\uDF00-\uDF19]|𑜠|𑜡|𑜦|\uD805[\uDF30-\uDF3F]|\uD806[\uDCA0-\uDCF2]|𑣿|\uD806[\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E]|\uD809[\uDC70-\uDC74]|\uD809[\uDC80-\uDD43]|\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38]|\uD81A[\uDE40-\uDE5E]|\uD81A[\uDE60-\uDE69]|𖩮|𖩯|\uD81A[\uDED0-\uDEED]|𖫵|\uD81A[\uDF00-\uDF2F]|\uD81A[\uDF37-\uDF45]|\uD81A[\uDF50-\uDF59]|\uD81A[\uDF5B-\uDF61]|\uD81A[\uDF63-\uDF77]|\uD81A[\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44]|\uD81B[\uDF50-\uDF7E]|\uD81B[\uDF93-\uDF9F]|𛀀|𛀁|\uD82F[\uDC00-\uDC6A]|\uD82F[\uDC70-\uDC7C]|\uD82F[\uDC80-\uDC88]|\uD82F[\uDC90-\uDC99]|𛲜|𛲟|\uD834[\uDC00-\uDCF5]|\uD834[\uDD00-\uDD26]|\uD834[\uDD29-\uDD66]|\uD834[\uDD6A-\uDD72]|𝆃|𝆄|\uD834[\uDD8C-\uDDA9]|\uD834[\uDDAE-\uDDE8]|\uD834[\uDF60-\uDF71]|\uD835[\uDC00-\uDC54]|\uD835[\uDC56-\uDC9C]|𝒞|𝒟|𝒢|𝒥|𝒦|\uD835[\uDCA9-\uDCAC]|\uD835[\uDCAE-\uDCB9]|𝒻|\uD835[\uDCBD-\uDCC3]|\uD835[\uDCC5-\uDD05]|\uD835[\uDD07-\uDD0A]|\uD835[\uDD0D-\uDD14]|\uD835[\uDD16-\uDD1C]|\uD835[\uDD1E-\uDD39]|\uD835[\uDD3B-\uDD3E]|\uD835[\uDD40-\uDD44]|𝕆|\uD835[\uDD4A-\uDD50]|\uD835[\uDD52-\uDEA5]|\uD835[\uDEA8-\uDEDA]|\uD835[\uDEDC-\uDF14]|\uD835[\uDF16-\uDF4E]|\uD835[\uDF50-\uDF88]|\uD835[\uDF8A-\uDFC2]|\uD835[\uDFC4-\uDFCB]|\uD836[\uDC00-\uDDFF]|\uD836[\uDE37-\uDE3A]|\uD836[\uDE6D-\uDE74]|\uD836[\uDE76-\uDE83]|\uD836[\uDE85-\uDE8B]|\uD83C[\uDD10-\uDD2E]|\uD83C[\uDD30-\uDD69]|\uD83C[\uDD70-\uDD9A]|\uD83C[\uDDE6-\uDE02]|\uD83C[\uDE10-\uDE3A]|\uD83C[\uDE40-\uDE48]|🉐|🉑|[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6]|\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34]|\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|[\uDB80-\uDBBE][\uDC00-\uDFFF]|\uDBBF[\uDC00-\uDFFD]|[\uDBC0-\uDBFE][\uDC00-\uDFFF]|\uDBFF[\uDC00-\uDFFD])|([֐־׀׃׆׈-׿߀-ߪߴߵߺ-ࠕࠚࠤࠨ࠮-ࡘ࡜-࢟‏יִײַ-ﬨשׁ-ﭏ؈؋؍؛-ي٭-ٯٱ-ەۥۦۮۯۺ-ܐܒ-ܯ݋-ޥޱ-޿ࢠ-࣢ﭐ-ﴽ﵀-﷏ﷰ-﷼﷾﷿ﹰ-﻾]|\uD802[\uDC00-\uDD1E]|\uD802[\uDD20-\uDE00]|𐨄|\uD802[\uDE07-\uDE0B]|\uD802[\uDE10-\uDE37]|\uD802[\uDE3B-\uDE3E]|\uD802[\uDE40-\uDEE4]|\uD802[\uDEE7-\uDF38]|\uD802[\uDF40-\uDFFF]|\uD803[\uDC00-\uDE5F]|\uD803[\uDE7F-\uDFFF]|\uD83A[\uDC00-\uDCCF]|\uD83A[\uDCD7-\uDFFF]|\uD83B[\uDC00-\uDDFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDE00-\uDEEF]|\uD83B[\uDEF2-\uDEFF]))");let Tt=class{constructor(e){this.locale=ze(e),this.language=new(_t[this.locale]||_t.default)(this.locale)}emit(e,t){let n,r,s;switch(typeof e){case"string":case"number":n=e;break;case"object":if(r=e.slice(1).map(i=>this.emit(i,t)),s=e[0].toLowerCase(),typeof this[s]=="function")n=this[s](r,t);else throw new Error('unknown operation "'+s+'"');break;case"undefined":n="";break;default:throw new Error("unexpected type in AST: "+typeof e)}return n}concat(e){let t="";return e.forEach(n=>{t+=n}),t}replace(e,t){const n=parseInt(e[0],10);return n<t.length?t[n]:"$"+(n+1)}plural(e){const t=parseFloat(this.language.convertNumber(e[0],10)),n=e.slice(1);return n.length?this.language.convertPlural(t,n):""}gender(e){const t=e[0],n=e.slice(1);return this.language.gender(t,n)}grammar(e){const t=e[0],n=e[1];return n&&t&&this.language.convertGrammar(n,t)}wikilink(e){let t,n=e[0];n.charAt(0)===":"&&(n=n.slice(1));const r=`./${n}`;return e.length===1?t=n:t=e[1],`<a href="${r}" title="${n}">${t}</a>`}extlink(e){if(e.length!==2)throw new Error("Expected two items in the node");return`<a href="${e[0]}">${e[1]}</a>`}bidi(e){const t=Oa(e[0]);return t==="ltr"?"‪"+e[0]+"‬":t==="rtl"?"‫"+e[0]+"‬":e[0]}formatnum(e){const t=!!e[1]&&e[1]==="R",n=e[0];return typeof n=="string"||typeof n=="number"?this.language.convertNumber(n,t):n}htmlattributes(e){const t={};for(let n=0,r=e.length;n<r;n+=2)t[e[n]]=e[n+1];return t}htmlelement(e){const t=e.shift(),n=e.shift();let r=e,s="";for(const u in n)s+=` ${u}="${n[u]}"`;Array.isArray(r)||(r=[r]);const i=r.join("");return`<${t}${s}>${i}</${t}>`}};function ze(e){return typeof e=="string"?e.toLowerCase():e}function Oa(e){const t=e.match(Ta);return t?t[2]===void 0?"ltr":"rtl":null}function Ia(e,{wikilinks:t=!1}={}){let n=0;function r(c){return()=>{for(let m=0;m<c.length;m++){const I=c[m]();if(I!==null)return I}return null}}function s(c){const m=n,I=[];for(let x=0;x<c.length;x++){const ee=c[x]();if(ee===null)return n=m,null;I.push(ee)}return I}function i(c,m){return()=>{const I=n,x=[];let ee=m();for(;ee!==null;)x.push(ee),ee=m();return x.length<c?(n=I,null):x}}function u(c){const m=c.length;return()=>{let I=null;return e.slice(n,n+m)===c&&(I=c,n+=m),I}}function l(c){return()=>{const m=e.slice(n).match(c);return m===null?null:(n+=m[0].length,m[0])}}const w=l(/^\s+/),$=u("|"),D=u(":"),B=u("\\"),oe=l(/^./),fe=u("$"),Fe=l(/^\d+/),L=u('"'),Z=u("'"),Y=l(t?/^[^{}[\]$<\\]/:/^[^{}$<\\]/),le=l(t?/^[^{}[\]$\\|]/:/^[^{}$\\|]/),G=l(t?/^[^{}[\]$\s]/:/^[^{}$\s]/);function te(c,m){return()=>{const I=c();return I===null?null:m(I)}}function V(){const c=i(1,X)();return c===null?null:c.join("")}function we(){const c=i(1,$e)();return c===null?null:c.join("")}const ye=r([k,G]);function Ae(){const c=i(1,ye)();return c===null?null:c.join("")}function k(){const c=s([B,oe]);return c===null?null:c[1]}const X=r([k,le]),$e=r([k,Y]);function De(){const c=s([fe,Fe]);return c===null?null:["REPLACE",parseInt(c[1],10)-1]}const ge=te(l(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/),function(c){return c.toString()});function b(){const c=s([$,i(0,H)]);if(c===null)return null;const m=c[1];return m.length>1?["CONCAT"].concat(m):m[0]}function me(){const c=s([ge,D,De]);return c===null?null:[c[0],c[2]]}function Ue(){const c=s([ge,D,H]);return c===null?null:[c[0],c[2]]}function be(){const c=s([ge,D]);return c===null?null:[c[0],""]}const Me=r([function(){const c=s([r([me,Ue,be]),i(0,b)]);return c===null?null:c[0].concat(c[1])},function(){const c=s([ge,i(0,b)]);return c===null?null:[c[0]].concat(c[1])}]),Je=u("{{"),Ve=u("}}"),Te=u("[["),Oe=u("]]"),Ie=u("["),je=u("]");function ve(){const c=s([Je,Me,Ve]);return c===null?null:c[1]}function Se(){const c=s([i(1,H),$,i(1,q)]);return c===null?null:[["CONCAT"].concat(c[0]),["CONCAT"].concat(c[2])]}function _e(){const c=s([i(1,H)]);return c===null?null:[["CONCAT"].concat(c[0])]}const A=r([Se,_e]);function v(){let c=null;const m=s([Te,A,Oe]);if(m!==null){const I=m[1];c=["WIKILINK"].concat(I)}return c}function S(){let c=null;const m=s([Ie,i(1,K),w,i(1,q),je]);return m!==null&&(c=["EXTLINK",m[1].length===1?m[1][0]:["CONCAT"].concat(m[1]),["CONCAT"].concat(m[3])]),c}const R=l(/^[A-Za-z]+/);function d(c,m,I,x={allowedHtmlElements:["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","li","dt","dd"],allowedHtmlCommonAttributes:["id","class","style","lang","dir","title","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"],allowedHtmlAttributesByElement:{}}){if(c=c.toLowerCase(),m=m.toLowerCase(),c!==m||x.allowedHtmlElements.indexOf(c)===-1)return!1;const ee=/[\000-\010\013\016-\037\177]|expression|filter\s*:|accelerator\s*:|-o-link\s*:|-o-link-source\s*:|-o-replace\s*:|url\s*\(|image\s*\(|image-set\s*\(/i;for(let se=0,ie=I.length;se<ie;se+=2){const he=I[se];if(x.allowedHtmlCommonAttributes.indexOf(he)===-1&&(x.allowedHtmlAttributesByElement[c]||[]).indexOf(he)===-1||he==="style"&&I[se+1].search(ee)!==-1)return!1}return!0}function _(){const c=l(/^[^"]*/),m=s([L,c,L]);return m===null?null:m[1]}function z(){const c=l(/^[^']*/),m=s([Z,c,Z]);return m===null?null:m[1]}function P(){const c=l(/^\s*=\s*/),m=s([w,R,c,r([_,z])]);return m===null?null:[m[1],m[3]]}function O(){const c=i(0,P)();return Array.prototype.concat.apply(["HTMLATTRIBUTES"],c)}function Q(){let c=null;const m=n,I=u("<"),x=l(/^\/?/),ee=l(/^\s*>/),se=s([I,R,O,x,ee]);if(se===null)return null;const ie=n,he=se[1],Be=i(0,q)(),Dt=n,o=u("</"),g=s([o,R,ee]);if(g===null)return["CONCAT",e.slice(m,ie)].concat(Be);const E=n,ce=g[1],ke=se[2],j=ke.slice(1);if(d(he,ce,j))c=["HTMLELEMENT",he,ke].concat(Be);else{const a=p=>p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");c=["CONCAT",a(e.slice(m,ie))].concat(Be,a(e.slice(Dt,E)))}return c}const K=r([ve,De,v,S,Ae]),q=r([ve,De,v,S,Q,we]),H=r([ve,De,V]);function re(){const c=i(0,q)();return c===null?null:["CONCAT"].concat(c)}const U=re();if(U===null||n!==e.length)throw new Error("Parse error at position "+n.toString()+" in input: "+e);return U}class Ot{constructor(t,{wikilinks:n=!1}={}){this.locale=ze(t),this.wikilinks=n,this.emitter=new Tt(this.locale)}parse(t,n){if(t.includes("{{")||t.includes("<")||this.wikilinks&&t.includes("[")){const r=Ia(t,{wikilinks:this.wikilinks});return this.emitter.emit(r,n)}else return this.simpleParse(t,n)}simpleParse(t,n){return t.replace(/\$(\d+)/g,(r,s)=>{const i=parseInt(s,10)-1;return n[i]!==void 0?n[i]:"$"+s})}}class Pa{constructor(){this.sourceMap=new Map}load(t,n){if(typeof t!="object")throw new Error("Invalid message source. Must be an object");if(n=ze(n),n){if(!/^[a-zA-Z0-9-]+$/.test(n))throw new Error(`Invalid locale ${n}`);for(const r in t)if(r.indexOf("@")!==0){if(typeof t[r]=="object")return this.load(t);if(typeof t[r]!="string")throw new Error(`Invalid message for message ${r} in ${n} locale.`);break}this.sourceMap.has(n)?this.sourceMap.set(n,Object.assign(this.sourceMap.get(n),t)):this.sourceMap.set(n,t)}else for(n in t)this.load(t[n],n)}getMessage(t,n){const r=this.sourceMap.get(ze(n));return r?r[t]:null}hasLocale(t){return this.sourceMap.has(t)}}class za{constructor(t,{finalFallback:n="en",messages:r=void 0,wikilinks:s=!1}={}){this.locale=ze(t),this.parser=new Ot(this.locale,{wikilinks:s}),this.messageStore=new Pa,r&&this.load(r,this.locale),this.finalFallback=n,this.wikilinks=s}load(t,n){return this.messageStore.load(t,n||this.locale)}i18n(t,...n){return this.parser.parse(this.getMessage(t),n)}setLocale(t){this.locale=ze(t),this.parser=new Ot(this.locale,{wikilinks:this.wikilinks})}getFallbackLocales(){return[...St[this.locale]||[],this.finalFallback]}getMessage(t){let n=this.locale,r=0;const s=this.getFallbackLocales(this.locale);for(;n;){const i=n.split("-");let u=i.length;do{const l=i.slice(0,u).join("-"),w=this.messageStore.getMessage(t,l);if(typeof w=="string")return w;u--}while(u);n=s[r],r++}return t}registerParserPlugin(t,n){Tt.prototype[t]=n}}const It={"@metadata":{authors:["Mason Payne"],"last-updated":"2024-01-08",locale:"en"},"sa-login":"Login","sa-username":"Email","sa-password":"Password","sa-use-password":"Use Password","sa-code":"Code","sa-signup":"Sign up","sa-signup-complete":"Sign up complete","sa-back":"Back","sa-error-creating-user":"Error creating user.","sa-remember":"Remember me","sa-forgot":"Forgot your password?","sa-register":"Register","sa-error.login":"Invalid email or password","sa-error.register":"Invalid email or password","sa-error.unknown":"Unknown error","sa-account-settings":"Account Settings","sa-webauthn-security-keys":"Your passkeys","sa-add-security-key":"Add passkey","webauthn-not-enrolled":"WebAuthn not enrolled","sa-webauthn-key-name":"Key Name","sa-cancel":"Cancel","sa-no-security-keys":"No passkeys","sa-webauthn-key-actions":"Actions","sa-remove":"Remove","not-authenticated":"Not authenticated","error-otp-registration":"Error registering OTP","sa-confirm-delete-key":"Are you sure you want to delete this key?","sa-add-mfa":"Manage MFA","sa-add-email":"Add Email","sa-email":"Email","sa-phone":"Phone","sa-add-sms":"Add SMS","sa-mfa":"MFA Registrations","error-otp-list":"Error listing OTPs","sa-type":"Type","sa-mfa-destination":"Destination","sa-mfa-validated":"Validated","sa-validate":"Validate","sa-mfa-action":"Action","sa-no":"No","sa-yes":"Yes","error-otp-remove":"Error removing MFA Registration","error-webauthn-remove":"Error removing WebAuthn Registration","sa-register-mfa":"Register MFA","sa-otp-required":"A one-time code is required.","sa-otp-choose":"Choose how to receive your code:","sa-otp-no-registrations":"No MFA methods registered.","sa-otp-send-code":"Send Code","sa-otp-verify":"Verify Code","sa-unknown-challenge":"Unknown challenge type.","sa-complete-invite":"Complete Your Invitation","sa-invite-otp":"Verification Code","sa-invite-otp-hint":"Enter the code from your invite email","sa-invite-password":"Choose a Password","sa-invite-password-hint":"Create a secure password for your account","sa-invite-submit":"Complete Registration","sa-invite-success":"Registration complete! Redirecting to login...","sa-invite-error-otp":"Invalid or expired verification code","sa-invite-error-expired":"This invite has expired. Please contact your administrator.","sa-invite-error-generic":"Unable to complete registration. Please try again.","sa-invite-completing":"Completing registration...","sa-forgot-password":"Forgot your password?","sa-reset-password":"Reset Password","sa-reset-email-sent":"If an account exists with that email, a reset code has been sent.","sa-new-password":"New Password","sa-reset-code":"Reset Code","sa-reset-submit":"Reset Password","sa-reset-success":"Password reset successfully! You can now log in.","sa-reset-error":"Unable to reset password. Please try again.","sa-reset-error-code":"Invalid or expired reset code","sa-or":"Or","sa-social-google":"Continue with Google","sa-social-github":"Continue with GitHub","sa-social-apple":"Continue with Apple","sa-social-oidc":"Continue with SSO","sa-loading":"Loading...","sa-social-error":"Error starting social login","sa-signup-mfa-title":"Verify Your Email","sa-signup-verify-prompt":"A verification code has been sent to your email. Enter it below to activate multi-factor authentication.","sa-signup-verify-error":"Invalid or expired verification code.","sa-signup-webauthn-prompt":"Your account is secure! Optionally, add a passkey for faster and easier logins.","sa-signup-webauthn-setup":"Set Up Passkey","sa-signup-webauthn-done":"Skip for now","sa-signup-webauthn-error":"Error setting up passkey. Please try again from your account settings."},Na={en:It,fr:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"fr"},"sa-login":"Connexion","sa-username":"Adresse e-mail","sa-password":"Mot de passe","sa-use-password":"Utiliser le mot de passe","sa-code":"code à deux facteurs","sa-remember":"Souviens-toi de moi","sa-forgot":"Mot de passe oublié?","sa-register":"S'inscrire","sa-error.login":"E-mail ou mot de passe invalide","sa-error.register":"E-mail ou mot de passe invalide","sa-error.unknown":"Erreur inconnue","sa-otp-required":"Un code à usage unique est requis.","sa-otp-choose":"Choisissez comment recevoir votre code :","sa-otp-no-registrations":"Aucune méthode MFA enregistrée.","sa-otp-send-code":"Envoyer le code","sa-otp-verify":"Vérifier le code","sa-unknown-challenge":"Type de défi inconnu.","sa-complete-invite":"Complétez votre invitation","sa-invite-otp":"Code de vérification","sa-invite-otp-hint":"Entrez le code de votre email d'invitation","sa-invite-password":"Choisissez un mot de passe","sa-invite-password-hint":"Créez un mot de passe sécurisé pour votre compte","sa-invite-submit":"Terminer l'inscription","sa-invite-success":"Inscription terminée ! Redirection vers la connexion...","sa-invite-error-otp":"Code de vérification invalide ou expiré","sa-invite-error-expired":"Cette invitation a expiré. Veuillez contacter votre administrateur.","sa-invite-error-generic":"Impossible de terminer l'inscription. Veuillez réessayer.","sa-invite-completing":"Finalisation de l'inscription...","sa-forgot-password":"Mot de passe oublié ?","sa-reset-password":"Réinitialiser le mot de passe","sa-reset-email-sent":"Si un compte existe avec cet e-mail, un code de réinitialisation a été envoyé.","sa-new-password":"Nouveau mot de passe","sa-reset-code":"Code de réinitialisation","sa-reset-submit":"Réinitialiser le mot de passe","sa-reset-success":"Mot de passe réinitialisé avec succès ! Vous pouvez maintenant vous connecter.","sa-reset-error":"Impossible de réinitialiser le mot de passe. Veuillez réessayer.","sa-reset-error-code":"Code de réinitialisation invalide ou expiré","sa-or":"Ou","sa-social-google":"Continuer avec Google","sa-social-github":"Continuer avec GitHub","sa-social-apple":"Continuer avec Apple","sa-social-oidc":"Continuer avec SSO","sa-loading":"Chargement...","sa-social-error":"Erreur lors de la connexion sociale","sa-signup-mfa-title":"Vérifiez votre e-mail","sa-signup-verify-prompt":"Un code de vérification a été envoyé à votre e-mail. Entrez-le ci-dessous pour activer l'authentification multi-facteurs.","sa-signup-verify-error":"Code de vérification invalide ou expiré.","sa-signup-webauthn-prompt":"Votre compte est sécurisé ! Ajoutez optionnellement une clé d'accès pour des connexions plus rapides.","sa-signup-webauthn-setup":"Configurer la clé d'accès","sa-signup-webauthn-done":"Ignorer pour l'instant","sa-signup-webauthn-error":"Erreur lors de la configuration de la clé d'accès. Veuillez réessayer depuis les paramètres de votre compte."},es:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"es"},"sa-login":"Acceso","sa-username":"Correo electrónico","sa-password":"Clave","sa-use-password":"Usar contraseña","sa-code":"Código","sa-remember":"Acuérdate de mí","sa-forgot":"¿Olvidaste tu contraseña?","sa-register":"Registro","sa-error.login":"Correo electrónico o contraseña inválidos","sa-error.register":"Correo electrónico o contraseña inválidos","sa-error.unknown":"Error desconocido","sa-otp-required":"Se requiere un código de un solo uso.","sa-otp-choose":"Elige cómo recibir tu código:","sa-otp-no-registrations":"No hay métodos MFA registrados.","sa-unknown-challenge":"Tipo de desafío desconocido.","sa-complete-invite":"Completa tu invitación","sa-invite-otp":"Código de verificación","sa-invite-otp-hint":"Ingresa el código de tu correo de invitación","sa-invite-password":"Elige una contraseña","sa-invite-password-hint":"Crea una contraseña segura para tu cuenta","sa-invite-submit":"Completar registro","sa-invite-success":"¡Registro completo! Redirigiendo al inicio de sesión...","sa-invite-error-otp":"Código de verificación inválido o expirado","sa-invite-error-expired":"Esta invitación ha expirado. Por favor contacta a tu administrador.","sa-invite-error-generic":"No se pudo completar el registro. Por favor intenta de nuevo.","sa-invite-completing":"Completando registro...","sa-forgot-password":"¿Olvidaste tu contraseña?","sa-reset-password":"Restablecer contraseña","sa-reset-email-sent":"Si existe una cuenta con ese correo, se ha enviado un código de restablecimiento.","sa-new-password":"Nueva contraseña","sa-reset-code":"Código de restablecimiento","sa-reset-submit":"Restablecer contraseña","sa-reset-success":"¡Contraseña restablecida con éxito! Ya puedes iniciar sesión.","sa-reset-error":"No se pudo restablecer la contraseña. Por favor intenta de nuevo.","sa-reset-error-code":"Código de restablecimiento inválido o expirado","sa-or":"O","sa-social-google":"Continuar con Google","sa-social-github":"Continuar con GitHub","sa-social-apple":"Continuar con Apple","sa-social-oidc":"Continuar con SSO","sa-loading":"Cargando...","sa-social-error":"Error al iniciar sesión social","sa-signup-mfa-title":"Verifica tu correo electrónico","sa-signup-verify-prompt":"Se ha enviado un código de verificación a tu correo. Ingrésalo para activar la autenticación multifactor.","sa-signup-verify-error":"Código de verificación inválido o expirado.","sa-signup-webauthn-prompt":"¡Tu cuenta está protegida! Opcionalmente, agrega una clave de acceso para inicios de sesión más rápidos.","sa-signup-webauthn-setup":"Configurar clave de acceso","sa-signup-webauthn-done":"Omitir por ahora","sa-signup-webauthn-error":"Error al configurar la clave de acceso. Intenta de nuevo desde la configuración de tu cuenta."},ja:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"ja"},"sa-login":"ログイン","sa-username":"メールアドレス","sa-password":"パスワード","sa-use-password":"パスワードを使用する","sa-code":"コード","sa-remember":"私を覚えてますか","sa-forgot":"パスワードをお忘れですか?","sa-register":"登録","sa-error.login":"メールアドレスかパスワードが無効","sa-error.register":"メールアドレスかパスワードが無効","sa-error.unknown":"未知のエラー","sa-otp-required":"ワンタイムコードが必要です。","sa-otp-choose":"コードの受け取り方法を選択してください:","sa-otp-no-registrations":"MFA方法が登録されていません。","sa-otp-send-code":"コードを送信","sa-otp-verify":"コードを確認","sa-unknown-challenge":"不明なチャレンジタイプです。","sa-complete-invite":"招待を完了する","sa-invite-otp":"確認コード","sa-invite-otp-hint":"招待メールのコードを入力してください","sa-invite-password":"パスワードを選択","sa-invite-password-hint":"アカウント用の安全なパスワードを作成してください","sa-invite-submit":"登録を完了","sa-invite-success":"登録完了!ログインページへリダイレクト中...","sa-invite-error-otp":"無効または期限切れの確認コード","sa-invite-error-expired":"この招待は期限切れです。管理者にお問い合わせください。","sa-invite-error-generic":"登録を完了できませんでした。もう一度お試しください。","sa-invite-completing":"登録を完了しています...","sa-forgot-password":"パスワードをお忘れですか?","sa-reset-password":"パスワードをリセット","sa-reset-email-sent":"そのメールアドレスのアカウントが存在する場合、リセットコードが送信されました。","sa-new-password":"新しいパスワード","sa-reset-code":"リセットコード","sa-reset-submit":"パスワードをリセット","sa-reset-success":"パスワードが正常にリセットされました!ログインできます。","sa-reset-error":"パスワードをリセットできませんでした。もう一度お試しください。","sa-reset-error-code":"無効または期限切れのリセットコード","sa-or":"または","sa-social-google":"Googleで続ける","sa-social-github":"GitHubで続ける","sa-social-apple":"Appleで続ける","sa-social-oidc":"SSOで続ける","sa-loading":"読み込み中...","sa-social-error":"ソーシャルログイン開始エラー","sa-signup-mfa-title":"メールを確認してください","sa-signup-verify-prompt":"確認コードがメールに送信されました。多要素認証を有効にするために入力してください。","sa-signup-verify-error":"無効または期限切れの確認コードです。","sa-signup-webauthn-prompt":"アカウントが保護されました!パスキーを追加してより速く簡単にログインできます(任意)。","sa-signup-webauthn-setup":"パスキーを設定","sa-signup-webauthn-done":"今はスキップ","sa-signup-webauthn-error":"パスキーの設定中にエラーが発生しました。アカウント設定から再試行してください。"}};function ct(e){const t=new za("en",{messages:It});return e!=="en"&&(t.load(Na[e],e),t.setLocale(e)),t}function Pt(e){const t="==".slice(0,(4-e.length%4)%4),n=e.replace(/-/g,"+").replace(/_/g,"/")+t,r=atob(n),s=new ArrayBuffer(r.length),i=new Uint8Array(s);for(let u=0;u<r.length;u++)i[u]=r.charCodeAt(u);return s}function zt(e){const t=new Uint8Array(e);let n="";for(const i of t)n+=String.fromCharCode(i);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var T="copy",pe="convert";function Ne(e,t,n){if(t===T)return n;if(t===pe)return e(n);if(t instanceof Array)return n.map(r=>Ne(e,t[0],r));if(t instanceof Object){const r={};for(const[s,i]of Object.entries(t)){if(i.derive){const u=i.derive(n);u!==void 0&&(n[s]=u)}if(!(s in n)){if(i.required)throw new Error(`Missing key: ${s}`);continue}if(n[s]==null){r[s]=null;continue}r[s]=Ne(e,i.schema,n[s])}return r}}function dt(e,t){return{required:!0,schema:e,derive:t}}function M(e){return{required:!0,schema:e}}function J(e){return{required:!1,schema:e}}var Nt={type:M(T),id:M(pe),transports:J(T)},Mt={appid:J(T),appidExclude:J(T),credProps:J(T)},jt={appid:J(T),appidExclude:J(T),credProps:J(T)},Ma={publicKey:M({rp:M(T),user:M({id:M(pe),name:M(T),displayName:M(T)}),challenge:M(pe),pubKeyCredParams:M(T),timeout:J(T),excludeCredentials:J([Nt]),authenticatorSelection:J(T),attestation:J(T),extensions:J(Mt)}),signal:J(T)},ja={type:M(T),id:M(T),rawId:M(pe),authenticatorAttachment:J(T),response:M({clientDataJSON:M(pe),attestationObject:M(pe),transports:dt(T,e=>{var t;return((t=e.getTransports)==null?void 0:t.call(e))||[]})}),clientExtensionResults:dt(jt,e=>e.getClientExtensionResults())},Ra={mediation:J(T),publicKey:M({challenge:M(pe),timeout:J(T),rpId:J(T),allowCredentials:J([Nt]),userVerification:J(T),extensions:J(Mt)}),signal:J(T)},La={type:M(T),id:M(T),rawId:M(pe),authenticatorAttachment:J(T),response:M({clientDataJSON:M(pe),authenticatorData:M(pe),signature:M(pe),userHandle:M(pe)}),clientExtensionResults:dt(jt,e=>e.getClientExtensionResults())};function Rt(e){return Ne(Pt,Ma,e)}function qa(e){return Ne(zt,ja,e)}function Ua(e){return Ne(Pt,Ra,e)}function Ja(e){return Ne(zt,La,e)}async function Lt(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>qa(t),t}async function Va(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>Ja(t),t}function ft(e){this.message=e}ft.prototype=new Error,ft.prototype.name="InvalidCharacterError";var qt=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new ft("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,i=0,u="";r=t.charAt(i++);~r&&(n=s%4?64*n+r:r,s++%4)?u+=String.fromCharCode(255&n>>(-2*s&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return u};function Ka(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(qt(n).replace(/(.)/g,function(r,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(t)}catch{return qt(t)}}function Qe(e){this.message=e}function Ga(e,t){if(typeof e!="string")throw new Qe("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(Ka(e.split(".")[n]))}catch(r){throw new Qe("Invalid token specified: "+r.message)}}Qe.prototype=new Error,Qe.prototype.name="InvalidTokenError";const et="spartan-token";function Ut(){const e=localStorage.getItem(et);let t=null;if(e)try{if(t=Ga(e),t.exp>Wa())return t;localStorage.removeItem(et)}catch(n){console.error("Error decoding token",n),localStorage.removeItem(et)}return null}function Ha(){const e=localStorage.getItem(et);return e||null}function Wa(){return Math.round(new Date().getTime()/1e3)}var Za=F(`<form class=login-frame><style>.login-frame {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  justify-content: center;
@@ -109,7 +109,25 @@
109
109
  opacity: 0.6;
110
110
  cursor: not-allowed;
111
111
  }
112
- </style><style></style><h1></h1><input type=text>`),qi=E("<span class=error-message>"),ut=E("<span>"),Pt=E("<input type=password>"),it=E("<p>"),Ui=E("<select>"),Ji=E("<option> (<!>)"),Vi=E("<input type=text>"),zt=E("<input type=text autocomplete=one-time-code>"),Ki=E("<input type=password autocomplete=new-password>"),Gi=E("<span class=checkbox-wrapper><input type=checkbox><span>&nbsp;"),Hi=E("<button type=submit>"),Wi=E("<button type=button>"),Ve=E("<a class=centered-text href=#>"),Zi=E("<div class=social-divider><span>"),Yi=E("<button type=button class=social-btn>"),Xi=E('<svg width=18 height=18 viewBox="0 0 18 18"xmlns=http://www.w3.org/2000/svg><path d="M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.875 2.684-6.615z"fill=#4285F4></path><path d="M9 18c2.43 0 4.467-.806 5.956-2.184l-2.908-2.258c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332C2.438 15.983 5.482 18 9 18z"fill=#34A853></path><path d="M3.964 10.707c-.18-.54-.282-1.117-.282-1.707s.102-1.167.282-1.707V4.961H.957C.347 6.175 0 7.548 0 9s.348 2.825.957 4.039l3.007-2.332z"fill=#FBBC05></path><path d="M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0 5.482 0 2.438 2.017.957 4.961L3.964 7.293C4.672 5.166 6.656 3.58 9 3.58z"fill=#EA4335>'),Qi=E('<svg width=18 height=18 viewBox="0 0 16 16"xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"fill=currentColor>'),ea=E('<svg width=18 height=18 viewBox="20 16 16 19"xmlns=http://www.w3.org/2000/svg><path d="M28.2226562,20.3846154 C29.0546875,20.3846154 30.0976562,19.8048315 30.71875,19.0317864 C31.28125,18.3312142 31.6914062,17.352829 31.6914062,16.3744437 C31.6914062,16.2415766 31.6796875,16.1087095 31.65625,16 C30.7304687,16.0362365 29.6171875,16.640178 28.9492187,17.4494596 C28.421875,18.06548 27.9414062,19.0317864 27.9414062,20.0222505 C27.9414062,20.1671964 27.9648438,20.3121424 27.9765625,20.3604577 C28.0351562,20.3725366 28.1289062,20.3846154 28.2226562,20.3846154 Z M25.2929688,35 C26.4296875,35 26.9335938,34.214876 28.3515625,34.214876 C29.7929688,34.214876 30.109375,34.9758423 31.375,34.9758423 C32.6171875,34.9758423 33.4492188,33.792117 34.234375,32.6325493 C35.1132812,31.3038779 35.4765625,29.9993643 35.5,29.9389701 C35.4179688,29.9148125 33.0390625,28.9122695 33.0390625,26.0979021 C33.0390625,23.6579784 34.9140625,22.5588048 35.0195312,22.474253 C33.7773438,20.6382708 31.890625,20.5899555 31.375,20.5899555 C29.9804688,20.5899555 28.84375,21.4596313 28.1289062,21.4596313 C27.3554688,21.4596313 26.3359375,20.6382708 25.1289062,20.6382708 C22.8320312,20.6382708 20.5,22.5950413 20.5,26.2911634 C20.5,28.5861411 21.3671875,31.013986 22.4335938,32.5842339 C23.3476562,33.9129053 24.1445312,35 25.2929688,35 Z"fill=currentColor fill-rule=nonzero>'),ta=E('<svg width=18 height=18 viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 4a3 3 0 110 6 3 3 0 010-6zm0 14c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08s5.97 1.09 6 3.08c-1.29 1.94-3.5 3.22-6 3.22z"fill=currentColor>');tt("spartan-login",{domain:"http://127.0.0.1:11000",sector:"0ad5c3e5-0186-4557-8b32-4b36f247bf09",startMode:"password",styles:"",locale:"en",redirect:""},e=>{const[t,n]=F((e.startMode||"password").toLowerCase()),[r,s]=F(""),[u,o]=F(""),[l,v]=F(""),[B,D]=F(""),[x]=F(e.redirect),[ne,ie]=F(!1),[me,z]=F(!1),[W,Z]=F(!1),[re,K]=F(""),[Q,J]=F(""),[he,be]=F([]),[De,k]=F(""),[Y,Ce]=F([]),[le,ce]=F(""),[b,pe]=F(!1),[Te,de]=F(!1),[Be,Oe]=F(""),[Ie,Fe]=F(""),h=nt(e.locale);let ve,we;try{we=e.styles}catch{we=""}console.log(we),Ze(async()=>{const a=new URLSearchParams(window.location.search);if(a.get("error")){history.replaceState({},"",window.location.pathname);const A=a.get("error_description");D(A||h.i18n("sa-social-error")),fe(),ke();return}const d=a.get("code");if(d){history.replaceState({},"",window.location.pathname);try{const A=await fetch(`${e.domain}/api/v1/oauth/exchange`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d})});if(!A.ok)throw new Error(h.i18n("sa-social-error"));const q=await A.json();localStorage.setItem("spartan-token",q.token),ve.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:q.token}})),e.redirect!==""&&(window.location.href=e.redirect)}catch(A){D(A.message||h.i18n("sa-social-error"))}return}if(It()&&e.redirect!==""&&window.location.pathname!==e.redirect){window.location.href=e.redirect;return}fe(),ke()});function fe(){fetch(`${e.domain}/api/v1/sectors/${e.sector}/publicsettings`,{method:"GET",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"}}).then(a=>{if(a.ok)return a.json();throw new Error("Network response was not ok.")}).then(a=>{console.log(a),ie(a.SelfSignUpAllowed),de(a.MFARequired||!1)}).catch(a=>{console.log(a),D(a.message)})}function ke(){fetch(`${e.domain}/api/v1/sectors/${e.sector}/oauth/providers`,{method:"GET",mode:"cors",cache:"no-cache"}).then(a=>{if(a.ok)return a.json();throw new Error("Failed to load social providers")}).then(a=>{const i=(a.providers||[]).filter(d=>d.enabled);Ce(i)}).catch(()=>{})}function Pe(a){if(le())return;ce(a),D("");const i=window.location.origin+window.location.pathname;fetch(`${e.domain}/api/v1/oauth/${a}/initiate`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({sectorID:e.sector,redirectURI:i})}).then(d=>{if(d.ok)return d.json();throw new Error(h.i18n("sa-social-error"))}).then(d=>{window.location.href=d.authURL}).catch(d=>{ce(""),D(d.message)})}function w(a,i){return D(""),Fe(i),fetch(`${e.domain}/api/v1/signup/mfa/begin`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a,sectorID:e.sector,transactionId:i})}).then(d=>{if(!d.ok)throw new Error(h.i18n("sa-signup-verify-error"))}).then(()=>{n("signup-verify")}).catch(d=>{D(d.message)})}function C(){return D(""),fetch(`${e.domain}/api/v1/signup/mfa/verify`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r(),code:l().toUpperCase().trim(),sectorID:e.sector,transactionId:Ie()})}).then(a=>{if(a.ok)return a.json();throw a.status===400?new Error(h.i18n("sa-signup-verify-error")):new Error(h.i18n("sa-signup-verify-error"))}).then(a=>{Oe(a.token),localStorage.setItem("spartan-token",a.token),ve.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:a.token}})),v(""),n("signup-webauthn")}).catch(a=>{D(a.message)})}function _(){b()||(pe(!0),D(""),fetch(`${e.domain}/api/v1/webauthn/registration/begin`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json",Authorization:`bearer ${Be()}`},body:JSON.stringify({keyName:"Default",sectorID:e.sector})}).then(a=>{if(!a.ok)throw new Error(h.i18n("sa-signup-webauthn-error"));return a.json()}).then(a=>{const i=_t(a.Options);return Tt(i).then(d=>{let y=JSON.parse(JSON.stringify(d));return y.transactionID=a.TransactionID,y})}).then(a=>fetch(`${e.domain}/api/v1/webauthn/registration/finish`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json",Authorization:`bearer ${Be()}`},body:JSON.stringify(a)})).then(a=>{if(!a.ok)throw new Error(h.i18n("sa-signup-webauthn-error"));N()}).catch(a=>{D((a==null?void 0:a.message)||String(a))}).finally(()=>{pe(!1)}))}function N(){n(e.startMode),e.redirect!==""&&(window.location.href=e.redirect)}function R(){return console.log("login"),D(""),t()==="password"?L():t()==="webauthn"?M():t()==="otp-pick"?V(De()):t()==="otp"?j():t()==="reset-email"?G():t()==="reset-code"?se():Promise.resolve()}function P(){return console.log("signup"),D(""),z(!1),fetch(`${e.domain}/api/v1/users`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:u(),sectorID:e.sector})}).then(a=>{if(a.ok)return a.json();throw new Error(h.i18n("sa-error-creating-user"))}).then(a=>{if(console.log(a),Te())return w(r(),a.enrollmentTransactionId||"");z(!0),n(e.startMode)}).catch(a=>{z(!1),D(a.message),console.log(a)})}function M(){return console.log("webauthnLogin"),fetch(`${e.domain}/api/v1/login/webauthn/begin`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),sectorID:e.sector})}).then(a=>{if(a.ok)return a.json();throw a.status===401?(n("password"),D(h.i18n("webauthn-not-enrolled")),new Error(h.i18n("webauthn-not-enrolled"))):new Error(`${a.status} ${a.statusText}: Network response was not ok.`)}).then(a=>{console.log(a);const i=Ii(a.CredentialAssertion);return console.log("Parsed WebAuthn request options:",i),zi(i).then(d=>{const y=JSON.stringify(d);let A=JSON.parse(y);return A.transactionID=a.TransactionID,A})}).then(a=>fetch(`${e.domain}/api/v1/login/webauthn/finish`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify(a)})).then(O).catch(a=>{D(a.message),console.log(a)})}function L(){return console.log("password login"),fetch(e.domain+"/api/v1/login/password",{method:"post",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:u(),sectorID:e.sector})}).then(O)}function O(a){return Promise.resolve(a).then(i=>{if(i.ok)return i.json();throw i}).then(i=>{if(console.log(i),localStorage.setItem("spartan-txid",i.transactionID),!i.token){if(i.challengeType==="email_enrollment")return w(r(),i.transactionID||"");if(i.challengeType.indexOf("otp")!==-1)return X();i.challengeType.indexOf("webauthn")!==-1?(n("webauthn"),D(h.i18n("sa-webauthn-required"))):D(h.i18n("sa-unknown-challenge"));return}localStorage.setItem("spartan-token",i.token);const d=new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:i.token,transactionID:i.transactionID}});ve.getRootNode().host.dispatchEvent(d),x()!==""&&(window.location.href=x())}).catch(i=>i.json().then(d=>{console.log(d.message),D(d.message)}).catch(d=>{console.log(d)}))}function X(){const a=localStorage.getItem("spartan-txid")||"";return fetch(e.domain+`/api/v1/otp/${encodeURIComponent(r())}?transactionID=${encodeURIComponent(a)}&sectorID=${encodeURIComponent(e.sector)}`,{method:"get",mode:"cors",cache:"no-cache"}).then(i=>{if(i.ok)return i.json();throw new Error(h.i18n("error-otp-list"))}).then(i=>{const d=i.registrations||[];if(d.length===0){D(h.i18n("sa-otp-no-registrations"));return}if(d.length===1)return V(d[0].ID||"");be(d),k(d[0].ID||""),n("otp-pick"),D("")}).catch(i=>{D(i.message),console.log(i)})}function V(a){return console.log("begin OTP, registrationID:",a),fetch(e.domain+"/api/v1/login/otp/begin",{method:"post",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),transactionID:localStorage.getItem("spartan-txid"),registrationID:a,sectorID:e.sector})}).then(i=>{if(i.ok)return i.json();throw new Error(`${i.status} ${i.statusText}`)}).then(i=>{console.log(i),i.transactionID&&localStorage.setItem("spartan-txid",i.transactionID),v(""),D(""),n("otp")}).catch(i=>{D(i.message),console.log(i)})}function j(){return console.log("OTP login submit"),fetch(e.domain+"/api/v1/login/otp",{method:"post",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:l(),transactionID:localStorage.getItem("spartan-txid"),sectorID:e.sector})}).then(O)}function G(){return console.log("begin password reset"),D(""),Z(!1),fetch(`${e.domain}/api/v1/password/reset/begin`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r(),sectorID:e.sector})}).then(a=>{if(a.ok)return a.json();throw new Error(h.i18n("sa-reset-error"))}).then(a=>{console.log(a),D(h.i18n("sa-reset-email-sent")),K(""),J(""),n("reset-code")}).catch(a=>{D(a.message),console.log(a)})}function se(){return console.log("complete password reset"),D(""),fetch(`${e.domain}/api/v1/password/reset/complete`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r(),code:re().toUpperCase().trim(),newPassword:Q(),sectorID:e.sector})}).then(a=>{if(a.ok)return a.json();throw a.status===400?new Error(h.i18n("sa-reset-error-code")):new Error(h.i18n("sa-reset-error"))}).then(a=>{console.log(a),Z(!0),K(""),J(""),o(""),n(e.startMode)}).catch(a=>{D(a.message),console.log(a)})}return(()=>{var a=Li(),i=a.firstChild,d=i.nextSibling,y=d.nextSibling,A=y.nextSibling,q=ve;return typeof q=="function"?pt(q,a):ve=a,a.addEventListener("submit",m=>{if(m.preventDefault(),b())return;pe(!0),(t()==="sign-up"?P():t()==="signup-verify"?C():R()).finally(()=>pe(!1))}),f(d,we),f(y,(()=>{var m=p(()=>t()==="reset-email"||t()==="reset-code");return()=>m()?h.i18n("sa-reset-password"):p(()=>t()==="signup-verify"||t()==="signup-webauthn")()?h.i18n("sa-signup-mfa-title"):h.i18n("sa-login")})()),f(a,B&&(()=>{var m=qi();return f(m,B),m})(),A),f(a,(()=>{var m=p(()=>!!me());return()=>m()&&(()=>{var c=ut();return f(c,()=>h.i18n("sa-signup-complete")),c})()})(),A),f(a,(()=>{var m=p(()=>!!W());return()=>m()&&(()=>{var c=ut();return f(c,()=>h.i18n("sa-reset-success")),c})()})(),A),A.$$input=m=>s(m.currentTarget.value),f(a,(()=>{var m=p(()=>t()!=="sign-up"&&t()!=="signup-verify"&&t()!=="signup-webauthn");return()=>m()&&[p(()=>p(()=>t()==="password")()&&(()=>{var c=Pt();return c.$$input=g=>o(g.currentTarget.value),$(()=>ae(c,"placeholder",h.i18n("sa-password"))),$(()=>c.value=u()),c})()),p(()=>p(()=>t()==="webauthn")()&&ut()),p(()=>p(()=>t()==="otp-pick")()&&[(()=>{var c=it();return f(c,()=>h.i18n("sa-otp-choose")),c})(),(()=>{var c=Ui();return c.addEventListener("change",g=>k(g.currentTarget.value)),f(c,()=>he().map(g=>(()=>{var I=Ji(),Ke=I.firstChild,Ge=Ke.nextSibling;return Ge.nextSibling,f(I,()=>g.DisplayName||g.ID,Ke),f(I,()=>g.Type,Ge),$(()=>I.value=g.ID),I})())),$(()=>c.value=De()),c})()]),p(()=>p(()=>t()==="otp")()&&(()=>{var c=Vi();return c.$$input=g=>v(g.currentTarget.value),$(()=>ae(c,"placeholder",h.i18n("sa-code"))),$(()=>c.value=l()),c})()),p(()=>p(()=>t()==="reset-code")()&&[(()=>{var c=zt();return c.$$input=g=>K(g.currentTarget.value),$(()=>ae(c,"placeholder",h.i18n("sa-reset-code"))),$(()=>c.value=re()),c})(),(()=>{var c=Ki();return c.$$input=g=>J(g.currentTarget.value),$(()=>ae(c,"placeholder",h.i18n("sa-new-password"))),$(()=>c.value=Q()),c})()]),p(()=>p(()=>t()==="password"||t()==="webauthn")()&&(()=>{var c=Gi(),g=c.firstChild,I=g.nextSibling;return I.firstChild,c.$$click=()=>n(t()==="password"?"webauthn":"password"),f(I,()=>h.i18n("sa-use-password"),null),$(()=>g.checked=t()==="password"),c})())]})(),null),f(a,(()=>{var m=p(()=>t()==="sign-up");return()=>m()&&(()=>{var c=Pt();return c.$$input=g=>o(g.currentTarget.value),$(()=>ae(c,"placeholder",h.i18n("sa-password"))),$(()=>c.value=u()),c})()})(),null),f(a,(()=>{var m=p(()=>t()==="signup-verify");return()=>m()&&[(()=>{var c=it();return f(c,()=>h.i18n("sa-signup-verify-prompt")),c})(),(()=>{var c=zt();return c.$$input=g=>v(g.currentTarget.value),$(()=>ae(c,"placeholder",h.i18n("sa-code"))),$(()=>c.value=l()),c})()]})(),null),f(a,(()=>{var m=p(()=>t()==="signup-webauthn");return()=>m()&&(()=>{var c=it();return f(c,()=>h.i18n("sa-signup-webauthn-prompt")),c})()})(),null),f(a,(()=>{var m=p(()=>t()!=="signup-webauthn");return()=>m()&&(()=>{var c=Hi();return f(c,(()=>{var g=p(()=>!!b());return()=>g()?h.i18n("sa-loading"):p(()=>t()==="sign-up")()?h.i18n("sa-signup"):p(()=>t()==="otp-pick")()?h.i18n("sa-otp-send-code"):p(()=>t()==="otp")()?h.i18n("sa-otp-verify"):p(()=>t()==="reset-email")()?h.i18n("sa-otp-send-code"):p(()=>t()==="reset-code")()?h.i18n("sa-reset-submit"):p(()=>t()==="signup-verify")()?h.i18n("sa-otp-verify"):h.i18n("sa-login")})()),$(()=>c.disabled=b()),c})()})(),null),f(a,(()=>{var m=p(()=>t()==="signup-webauthn");return()=>m()&&[(()=>{var c=Wi();return c.$$click=()=>_(),f(c,(()=>{var g=p(()=>!!b());return()=>g()?h.i18n("sa-loading"):h.i18n("sa-signup-webauthn-setup")})()),$(()=>c.disabled=b()),c})(),(()=>{var c=Ve();return c.$$click=()=>N(),f(c,()=>h.i18n("sa-signup-webauthn-done")),c})()]})(),null),f(a,(()=>{var m=p(()=>t()==="password");return()=>m()&&(()=>{var c=Ve();return c.$$click=()=>{D(""),Z(!1),n("reset-email")},f(c,()=>h.i18n("sa-forgot-password")),c})()})(),null),f(a,(()=>{var m=p(()=>t()==="reset-email"||t()==="reset-code");return()=>m()&&(()=>{var c=Ve();return c.$$click=()=>{D(""),K(""),J(""),n(e.startMode)},f(c,()=>h.i18n("sa-back")),c})()})(),null),f(a,(()=>{var m=p(()=>!!(ne()&&t()!=="reset-email"&&t()!=="reset-code"&&t()!=="signup-verify"&&t()!=="signup-webauthn"));return()=>m()&&(()=>{var c=Ve();return c.$$click=()=>t()==="sign-up"?n(e.startMode):n("sign-up"),f(c,(()=>{var g=p(()=>t()==="sign-up");return()=>g()?h.i18n("sa-back"):h.i18n("sa-signup")})()),c})()})(),null),f(a,(()=>{var m=p(()=>Y().length>0&&(t()==="password"||t()==="webauthn"||t()==="sign-up"));return()=>m()&&[(()=>{var c=Zi(),g=c.firstChild;return f(g,()=>h.i18n("sa-or")),c})(),p(()=>Y().map(c=>(()=>{var g=Yi();return g.$$click=()=>Pe(c.provider),f(g,(()=>{var I=p(()=>c.provider==="google");return()=>I()&&Xi()})(),null),f(g,(()=>{var I=p(()=>c.provider==="github");return()=>I()&&Qi()})(),null),f(g,(()=>{var I=p(()=>c.provider==="apple");return()=>I()&&ea()})(),null),f(g,(()=>{var I=p(()=>c.provider==="oidc");return()=>I()&&ta()})(),null),f(g,(()=>{var I=p(()=>c.provider==="google");return()=>I()?h.i18n("sa-social-google"):p(()=>c.provider==="github")()?h.i18n("sa-social-github"):p(()=>c.provider==="apple")()?h.i18n("sa-social-apple"):h.i18n("sa-social-oidc")})(),null),$(()=>g.disabled=!!le()),g})()))]})(),null),$(m=>{var c=h.i18n("sa-username"),g=t()==="otp"||t()==="otp-pick"||t()==="reset-code"||t()==="signup-verify"||t()==="signup-webauthn";return c!==m.e&&ae(A,"placeholder",m.e=c),g!==m.t&&(A.disabled=m.t=g),m},{e:void 0,t:void 0}),$(()=>A.value=r()),a})()}),Xe(["input","click"]);var na=E(`<div class=container><style>.container {
112
+ .login-frame .success-message {
113
+ color: green;
114
+ margin: 10px 0;
115
+ }
116
+
117
+ .login-frame .info-message {
118
+ color: #666;
119
+ margin: 10px 0;
120
+ font-size: 0.9em;
121
+ }
122
+
123
+ .login-frame .hint {
124
+ color: #666;
125
+ font-size: 0.85em;
126
+ margin-top: 5px;
127
+ margin-bottom: 0;
128
+ display: block;
129
+ }
130
+ </style><style></style><h1>`),Ya=F("<span class=error-message>"),ht=F("<span>"),Xa=F("<input type=text autocomplete=one-time-code required>"),Jt=F("<span class=hint>"),Qa=F("<input type=password autocomplete=new-password required>"),Vt=F("<button type=submit>"),eu=F("<span class=info-message>"),tu=F("<span class=success-message>"),nu=F("<input type=text autocomplete=username>"),ru=F("<input type=password autocomplete=current-password>"),pt=F("<p>"),su=F("<select>"),iu=F("<option> (<!>)"),au=F("<input type=text>"),Kt=F("<input type=text autocomplete=one-time-code>"),Gt=F("<input type=password autocomplete=new-password>"),uu=F("<span class=checkbox-wrapper><input type=checkbox><span>&nbsp;"),ou=F("<button type=button>"),tt=F("<a class=centered-text href=#>"),lu=F("<div class=social-divider><span>"),cu=F("<button type=button class=social-btn>"),du=F('<svg width=18 height=18 viewBox="0 0 18 18"xmlns=http://www.w3.org/2000/svg><path d="M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.875 2.684-6.615z"fill=#4285F4></path><path d="M9 18c2.43 0 4.467-.806 5.956-2.184l-2.908-2.258c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332C2.438 15.983 5.482 18 9 18z"fill=#34A853></path><path d="M3.964 10.707c-.18-.54-.282-1.117-.282-1.707s.102-1.167.282-1.707V4.961H.957C.347 6.175 0 7.548 0 9s.348 2.825.957 4.039l3.007-2.332z"fill=#FBBC05></path><path d="M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0 5.482 0 2.438 2.017.957 4.961L3.964 7.293C4.672 5.166 6.656 3.58 9 3.58z"fill=#EA4335>'),fu=F('<svg width=18 height=18 viewBox="0 0 16 16"xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"fill=currentColor>'),hu=F('<svg width=18 height=18 viewBox="20 16 16 19"xmlns=http://www.w3.org/2000/svg><path d="M28.2226562,20.3846154 C29.0546875,20.3846154 30.0976562,19.8048315 30.71875,19.0317864 C31.28125,18.3312142 31.6914062,17.352829 31.6914062,16.3744437 C31.6914062,16.2415766 31.6796875,16.1087095 31.65625,16 C30.7304687,16.0362365 29.6171875,16.640178 28.9492187,17.4494596 C28.421875,18.06548 27.9414062,19.0317864 27.9414062,20.0222505 C27.9414062,20.1671964 27.9648438,20.3121424 27.9765625,20.3604577 C28.0351562,20.3725366 28.1289062,20.3846154 28.2226562,20.3846154 Z M25.2929688,35 C26.4296875,35 26.9335938,34.214876 28.3515625,34.214876 C29.7929688,34.214876 30.109375,34.9758423 31.375,34.9758423 C32.6171875,34.9758423 33.4492188,33.792117 34.234375,32.6325493 C35.1132812,31.3038779 35.4765625,29.9993643 35.5,29.9389701 C35.4179688,29.9148125 33.0390625,28.9122695 33.0390625,26.0979021 C33.0390625,23.6579784 34.9140625,22.5588048 35.0195312,22.474253 C33.7773438,20.6382708 31.890625,20.5899555 31.375,20.5899555 C29.9804688,20.5899555 28.84375,21.4596313 28.1289062,21.4596313 C27.3554688,21.4596313 26.3359375,20.6382708 25.1289062,20.6382708 C22.8320312,20.6382708 20.5,22.5950413 20.5,26.2911634 C20.5,28.5861411 21.3671875,31.013986 22.4335938,32.5842339 C23.3476562,33.9129053 24.1445312,35 25.2929688,35 Z"fill=currentColor fill-rule=nonzero>'),pu=F('<svg width=18 height=18 viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 4a3 3 0 110 6 3 3 0 010-6zm0 14c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08s5.97 1.09 6 3.08c-1.29 1.94-3.5 3.22-6 3.22z"fill=currentColor>');lt("spartan-login",{domain:"http://127.0.0.1:11000",sector:"0ad5c3e5-0186-4557-8b32-4b36f247bf09",startMode:"password",styles:"",locale:"en",redirect:""},e=>{const[t,n]=C((e.startMode||"password").toLowerCase()),[r,s]=C(""),[i,u]=C(""),[l,w]=C(""),[$,D]=C(""),[B]=C(e.redirect),[oe,fe]=C(!1),[Fe,L]=C(!1),[Z,Y]=C(!1),[le,G]=C(""),[te,V]=C(""),[we,ye]=C([]),[Ae,k]=C(""),[X,$e]=C([]),[De,ge]=C(""),[b,me]=C(!1),[Ue,be]=C(!1),[Me,Je]=C(""),[Ve,Te]=C(""),[Oe,Ie]=C(""),[je,ve]=C(""),[Se,_e]=C(""),[A,v]=C(""),[S,R]=C(!1),d=ct(e.locale);let _,z;try{z=e.styles}catch{z=""}console.log(z),st(async()=>{const o=new URLSearchParams(window.location.search);if(o.get("error")){history.replaceState({},"",window.location.pathname);const j=o.get("error_description");D(j||d.i18n("sa-social-error")),P(),O();return}const E=o.get("code");if(E){history.replaceState({},"",window.location.pathname),me(!0);try{const j=await fetch(`${e.domain}/api/v1/oauth/exchange`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:E})});if(!j.ok)throw new Error(d.i18n("sa-social-error"));const a=await j.json();localStorage.setItem("spartan-token",a.token),_.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:a.token}})),e.redirect!==""?window.location.href=e.redirect:(me(!1),P(),O())}catch(j){D(j.message||d.i18n("sa-social-error")),me(!1),P(),O()}return}const ce=o.get("sub");if(ce){Ie(ce);const j=o.get("email");j&&ve(j);const p=new URLSearchParams(window.location.hash.replace(/^#/,"")).get("otp");p&&_e(p),n("invite");return}if(Ut()&&e.redirect!==""&&window.location.pathname!==e.redirect){window.location.href=e.redirect;return}P(),O()});function P(){fetch(`${e.domain}/api/v1/sectors/${e.sector}/publicsettings`,{method:"GET",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"}}).then(o=>{if(o.ok)return o.json();throw new Error("Network response was not ok.")}).then(o=>{console.log(o),fe(o.SelfSignUpAllowed),be(o.MFARequired||!1)}).catch(o=>{console.log(o),D(o.message)})}function O(){fetch(`${e.domain}/api/v1/sectors/${e.sector}/oauth/providers`,{method:"GET",mode:"cors",cache:"no-cache"}).then(o=>{if(o.ok)return o.json();throw new Error("Failed to load social providers")}).then(o=>{const g=(o.providers||[]).filter(E=>E.enabled);$e(g)}).catch(()=>{})}function Q(o){if(De())return;ge(o),D("");const g=window.location.origin+window.location.pathname;fetch(`${e.domain}/api/v1/oauth/${o}/initiate`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({sectorID:e.sector,redirectURI:g})}).then(E=>{if(E.ok)return E.json();throw new Error(d.i18n("sa-social-error"))}).then(E=>{window.location.href=E.authURL}).catch(E=>{ge(""),D(E.message)})}function K(o,g){return D(""),Te(g),fetch(`${e.domain}/api/v1/signup/mfa/begin`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o,sectorID:e.sector,transactionId:g})}).then(E=>{if(!E.ok)throw new Error(d.i18n("sa-signup-verify-error"))}).then(()=>{n("signup-verify")}).catch(E=>{D(E.message)})}function q(){return D(""),fetch(`${e.domain}/api/v1/signup/mfa/verify`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r(),code:l().toUpperCase().trim(),sectorID:e.sector,transactionId:Ve()})}).then(o=>{if(o.ok)return o.json();throw o.status===400?new Error(d.i18n("sa-signup-verify-error")):new Error(d.i18n("sa-signup-verify-error"))}).then(o=>{Je(o.token),localStorage.setItem("spartan-token",o.token),_.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:o.token}})),w(""),n("signup-webauthn")}).catch(o=>{D(o.message)})}function H(){b()||(me(!0),D(""),fetch(`${e.domain}/api/v1/webauthn/registration/begin`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json",Authorization:`bearer ${Me()}`},body:JSON.stringify({keyName:"Default",sectorID:e.sector})}).then(o=>{if(!o.ok)throw new Error(d.i18n("sa-signup-webauthn-error"));return o.json()}).then(o=>{const g=Rt(o.Options);return Lt(g).then(E=>{let ce=JSON.parse(JSON.stringify(E));return ce.transactionID=o.TransactionID,ce})}).then(o=>fetch(`${e.domain}/api/v1/webauthn/registration/finish`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json",Authorization:`bearer ${Me()}`},body:JSON.stringify(o)})).then(o=>{if(!o.ok)throw new Error(d.i18n("sa-signup-webauthn-error"));re()}).catch(o=>{D((o==null?void 0:o.message)||String(o))}).finally(()=>{me(!1)}))}function re(){n(e.startMode),e.redirect!==""&&(window.location.href=e.redirect)}function U(){return console.log("login"),D(""),t()==="password"?I():t()==="webauthn"?m():t()==="otp-pick"?se(Ae()):t()==="otp"?ie():t()==="reset-email"?he():t()==="reset-code"?Be():Promise.resolve()}function c(){return console.log("signup"),D(""),L(!1),fetch(`${e.domain}/api/v1/users`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:i(),sectorID:e.sector})}).then(o=>{if(o.ok)return o.json();throw new Error(d.i18n("sa-error-creating-user"))}).then(o=>{if(console.log(o),Ue())return K(r(),o.enrollmentTransactionId||"");L(!0),n(e.startMode)}).catch(o=>{L(!1),D(o.message),console.log(o)})}function m(){return console.log("webauthnLogin"),fetch(`${e.domain}/api/v1/login/webauthn/begin`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),sectorID:e.sector})}).then(o=>{if(o.ok)return o.json();throw o.status===401?(n("password"),D(d.i18n("webauthn-not-enrolled")),new Error(d.i18n("webauthn-not-enrolled"))):new Error(`${o.status} ${o.statusText}: Network response was not ok.`)}).then(o=>{console.log(o);const g=Ua(o.CredentialAssertion);return console.log("Parsed WebAuthn request options:",g),Va(g).then(E=>{const ce=JSON.stringify(E);let ke=JSON.parse(ce);return ke.transactionID=o.TransactionID,ke})}).then(o=>fetch(`${e.domain}/api/v1/login/webauthn/finish`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify(o)})).then(x).catch(o=>{D(o.message),console.log(o)})}function I(){return console.log("password login"),fetch(e.domain+"/api/v1/login/password",{method:"post",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:i(),sectorID:e.sector})}).then(x)}function x(o){return Promise.resolve(o).then(g=>{if(g.ok)return g.json();throw g}).then(g=>{if(console.log(g),localStorage.setItem("spartan-txid",g.transactionID),!g.token){if(g.challengeType==="email_enrollment")return K(r(),g.transactionID||"");if(g.challengeType.indexOf("otp")!==-1)return ee();g.challengeType.indexOf("webauthn")!==-1?(n("webauthn"),D(d.i18n("sa-webauthn-required"))):D(d.i18n("sa-unknown-challenge"));return}localStorage.setItem("spartan-token",g.token);const E=new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:g.token,transactionID:g.transactionID}});_.getRootNode().host.dispatchEvent(E),B()!==""&&(window.location.href=B())}).catch(g=>g.json().then(E=>{console.log(E.message),D(E.message)}).catch(E=>{console.log(E)}))}function ee(){const o=localStorage.getItem("spartan-txid")||"";return fetch(e.domain+`/api/v1/otp/${encodeURIComponent(r())}?transactionID=${encodeURIComponent(o)}&sectorID=${encodeURIComponent(e.sector)}`,{method:"get",mode:"cors",cache:"no-cache"}).then(g=>{if(g.ok)return g.json();throw new Error(d.i18n("error-otp-list"))}).then(g=>{const E=g.registrations||[];if(E.length===0){D(d.i18n("sa-otp-no-registrations"));return}if(E.length===1)return se(E[0].ID||"");ye(E),k(E[0].ID||""),n("otp-pick"),D("")}).catch(g=>{D(g.message),console.log(g)})}function se(o){return console.log("begin OTP, registrationID:",o),fetch(e.domain+"/api/v1/login/otp/begin",{method:"post",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),transactionID:localStorage.getItem("spartan-txid"),registrationID:o,sectorID:e.sector})}).then(g=>{if(g.ok)return g.json();throw new Error(`${g.status} ${g.statusText}`)}).then(g=>{console.log(g),g.transactionID&&localStorage.setItem("spartan-txid",g.transactionID),w(""),D(""),n("otp")}).catch(g=>{D(g.message),console.log(g)})}function ie(){return console.log("OTP login submit"),fetch(e.domain+"/api/v1/login/otp",{method:"post",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:l(),transactionID:localStorage.getItem("spartan-txid"),sectorID:e.sector})}).then(x)}function he(){return console.log("begin password reset"),D(""),Y(!1),fetch(`${e.domain}/api/v1/password/reset/begin`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r(),sectorID:e.sector})}).then(o=>{if(o.ok)return o.json();throw new Error(d.i18n("sa-reset-error"))}).then(o=>{console.log(o),D(d.i18n("sa-reset-email-sent")),G(""),V(""),n("reset-code")}).catch(o=>{D(o.message),console.log(o)})}function Be(){return console.log("complete password reset"),D(""),fetch(`${e.domain}/api/v1/password/reset/complete`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r(),code:le().toUpperCase().trim(),newPassword:te(),sectorID:e.sector})}).then(o=>{if(o.ok)return o.json();throw o.status===400?new Error(d.i18n("sa-reset-error-code")):new Error(d.i18n("sa-reset-error"))}).then(o=>{console.log(o),Y(!0),G(""),V(""),u(""),n(e.startMode)}).catch(o=>{D(o.message),console.log(o)})}async function Dt(){if(D(""),!Se()||Se().trim().length===0){D(d.i18n("sa-invite-error-otp"));return}if(!A()||A().length<8){D("Password must be at least 8 characters");return}const o=Oe();if(!o){D("Missing invitation information");return}const g=await fetch(`${e.domain}/api/v1/users/invite/complete`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({sub:o,otp:Se().toUpperCase().trim(),password:A(),sectorID:e.sector})}).catch(()=>null);if(!g){D(d.i18n("sa-invite-error-generic"));return}if(g.ok){history.replaceState({},"",window.location.pathname);const E=await g.json().catch(()=>({})),ce=_.getRootNode().host;E.token?(localStorage.setItem("spartan-token",E.token),ce.dispatchEvent(new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:E.token}})),B()!==""?window.location.href=B():e.redirect!==""?window.location.href=e.redirect:(R(!1),Ie(""),ve(""),_e(""),v(""),n(e.startMode),P(),O())):(R(!0),ce.dispatchEvent(new CustomEvent("spartan-invite-complete",{bubbles:!0,cancelable:!0,detail:{sub:o,success:!0}})),setTimeout(()=>{B()!==""?window.location.href=B():e.redirect!==""?window.location.href=e.redirect:(R(!1),Ie(""),ve(""),_e(""),v(""),n(e.startMode),P(),O())},2e3))}else{const E=await g.json().catch(()=>({}));g.status===400||String(E.message).includes("invalid OTP")?D(d.i18n("sa-invite-error-otp")):g.status===504||String(E.message).includes("expired")?D(d.i18n("sa-invite-error-expired")):D(E.message||d.i18n("sa-invite-error-generic"))}}return(()=>{var o=Za(),g=o.firstChild,E=g.nextSibling,ce=E.nextSibling,ke=_;return typeof ke=="function"?Ft(ke,o):_=o,o.addEventListener("submit",j=>{if(j.preventDefault(),b())return;me(!0),(t()==="sign-up"?c():t()==="signup-verify"?q():t()==="invite"?Promise.resolve(Dt()):U()).finally(()=>me(!1))}),f(E,z),f(ce,(()=>{var j=h(()=>t()==="reset-email"||t()==="reset-code");return()=>j()?d.i18n("sa-reset-password"):h(()=>t()==="signup-verify"||t()==="signup-webauthn")()?d.i18n("sa-signup-mfa-title"):h(()=>t()==="invite")()?d.i18n("sa-complete-invite"):d.i18n("sa-login")})()),f(o,$&&(()=>{var j=Ya();return f(j,$),j})(),null),f(o,(()=>{var j=h(()=>!!Fe());return()=>j()&&(()=>{var a=ht();return f(a,()=>d.i18n("sa-signup-complete")),a})()})(),null),f(o,(()=>{var j=h(()=>!!Z());return()=>j()&&(()=>{var a=ht();return f(a,()=>d.i18n("sa-reset-success")),a})()})(),null),f(o,(()=>{var j=h(()=>t()==="invite");return()=>j()&&[h(()=>h(()=>!!je())()&&(()=>{var a=eu();return f(a,je),a})()),h(()=>h(()=>!!S())()&&(()=>{var a=tu();return f(a,()=>d.i18n("sa-invite-success")),a})()),(()=>{var a=Xa();return a.$$input=p=>_e(p.currentTarget.value),y(p=>{var N=d.i18n("sa-invite-otp"),Ce=b()||S();return N!==p.e&&ue(a,"placeholder",p.e=N),Ce!==p.t&&(a.disabled=p.t=Ce),p},{e:void 0,t:void 0}),y(()=>a.value=Se()),a})(),(()=>{var a=Jt();return f(a,()=>d.i18n("sa-invite-otp-hint")),a})(),(()=>{var a=Qa();return a.$$input=p=>v(p.currentTarget.value),y(p=>{var N=d.i18n("sa-invite-password"),Ce=b()||S();return N!==p.e&&ue(a,"placeholder",p.e=N),Ce!==p.t&&(a.disabled=p.t=Ce),p},{e:void 0,t:void 0}),y(()=>a.value=A()),a})(),(()=>{var a=Jt();return f(a,()=>d.i18n("sa-invite-password-hint")),a})(),(()=>{var a=Vt();return f(a,(()=>{var p=h(()=>!!b());return()=>p()?d.i18n("sa-invite-completing"):d.i18n("sa-invite-submit")})()),y(()=>a.disabled=b()||S()),a})()]})(),null),f(o,(()=>{var j=h(()=>t()!=="invite");return()=>j()&&[(()=>{var a=nu();return a.addEventListener("change",p=>s(p.currentTarget.value)),a.$$input=p=>s(p.currentTarget.value),y(p=>{var N=d.i18n("sa-username"),Ce=t()==="otp"||t()==="otp-pick"||t()==="reset-code"||t()==="signup-verify"||t()==="signup-webauthn";return N!==p.e&&ue(a,"placeholder",p.e=N),Ce!==p.t&&(a.disabled=p.t=Ce),p},{e:void 0,t:void 0}),y(()=>a.value=r()),a})(),h(()=>h(()=>t()!=="sign-up"&&t()!=="signup-verify"&&t()!=="signup-webauthn")()&&[h(()=>h(()=>t()==="password")()&&(()=>{var a=ru();return a.addEventListener("change",p=>u(p.currentTarget.value)),a.$$input=p=>u(p.currentTarget.value),y(()=>ue(a,"placeholder",d.i18n("sa-password"))),y(()=>a.value=i()),a})()),h(()=>h(()=>t()==="webauthn")()&&ht()),h(()=>h(()=>t()==="otp-pick")()&&[(()=>{var a=pt();return f(a,()=>d.i18n("sa-otp-choose")),a})(),(()=>{var a=su();return a.addEventListener("change",p=>k(p.currentTarget.value)),f(a,()=>we().map(p=>(()=>{var N=iu(),Ce=N.firstChild,Zt=Ce.nextSibling;return Zt.nextSibling,f(N,()=>p.DisplayName||p.ID,Ce),f(N,()=>p.Type,Zt),y(()=>N.value=p.ID),N})())),y(()=>a.value=Ae()),a})()]),h(()=>h(()=>t()==="otp")()&&(()=>{var a=au();return a.$$input=p=>w(p.currentTarget.value),y(()=>ue(a,"placeholder",d.i18n("sa-code"))),y(()=>a.value=l()),a})()),h(()=>h(()=>t()==="reset-code")()&&[(()=>{var a=Kt();return a.$$input=p=>G(p.currentTarget.value),y(()=>ue(a,"placeholder",d.i18n("sa-reset-code"))),y(()=>a.value=le()),a})(),(()=>{var a=Gt();return a.$$input=p=>V(p.currentTarget.value),y(()=>ue(a,"placeholder",d.i18n("sa-new-password"))),y(()=>a.value=te()),a})()]),h(()=>h(()=>t()==="password"||t()==="webauthn")()&&(()=>{var a=uu(),p=a.firstChild,N=p.nextSibling;return N.firstChild,a.$$click=()=>n(t()==="password"?"webauthn":"password"),f(N,()=>d.i18n("sa-use-password"),null),y(()=>p.checked=t()==="password"),a})())]),h(()=>h(()=>t()==="sign-up")()&&(()=>{var a=Gt();return a.addEventListener("change",p=>u(p.currentTarget.value)),a.$$input=p=>u(p.currentTarget.value),y(()=>ue(a,"placeholder",d.i18n("sa-password"))),y(()=>a.value=i()),a})()),h(()=>h(()=>t()==="signup-verify")()&&[(()=>{var a=pt();return f(a,()=>d.i18n("sa-signup-verify-prompt")),a})(),(()=>{var a=Kt();return a.$$input=p=>w(p.currentTarget.value),y(()=>ue(a,"placeholder",d.i18n("sa-code"))),y(()=>a.value=l()),a})()]),h(()=>h(()=>t()==="signup-webauthn")()&&(()=>{var a=pt();return f(a,()=>d.i18n("sa-signup-webauthn-prompt")),a})()),h(()=>h(()=>t()!=="signup-webauthn")()&&(()=>{var a=Vt();return f(a,(()=>{var p=h(()=>!!b());return()=>p()?d.i18n("sa-loading"):h(()=>t()==="sign-up")()?d.i18n("sa-signup"):h(()=>t()==="otp-pick")()?d.i18n("sa-otp-send-code"):h(()=>t()==="otp")()?d.i18n("sa-otp-verify"):h(()=>t()==="reset-email")()?d.i18n("sa-otp-send-code"):h(()=>t()==="reset-code")()?d.i18n("sa-reset-submit"):h(()=>t()==="signup-verify")()?d.i18n("sa-otp-verify"):d.i18n("sa-login")})()),y(()=>a.disabled=b()),a})()),h(()=>h(()=>t()==="signup-webauthn")()&&[(()=>{var a=ou();return a.$$click=()=>H(),f(a,(()=>{var p=h(()=>!!b());return()=>p()?d.i18n("sa-loading"):d.i18n("sa-signup-webauthn-setup")})()),y(()=>a.disabled=b()),a})(),(()=>{var a=tt();return a.$$click=()=>re(),f(a,()=>d.i18n("sa-signup-webauthn-done")),a})()]),h(()=>h(()=>t()==="password")()&&(()=>{var a=tt();return a.$$click=()=>{D(""),Y(!1),n("reset-email")},f(a,()=>d.i18n("sa-forgot-password")),a})()),h(()=>h(()=>t()==="reset-email"||t()==="reset-code")()&&(()=>{var a=tt();return a.$$click=()=>{D(""),G(""),V(""),n(e.startMode)},f(a,()=>d.i18n("sa-back")),a})()),h(()=>h(()=>!!(oe()&&t()!=="reset-email"&&t()!=="reset-code"&&t()!=="signup-verify"&&t()!=="signup-webauthn"))()&&(()=>{var a=tt();return a.$$click=()=>t()==="sign-up"?n(e.startMode):n("sign-up"),f(a,(()=>{var p=h(()=>t()==="sign-up");return()=>p()?d.i18n("sa-back"):d.i18n("sa-signup")})()),a})()),h(()=>h(()=>X().length>0&&(t()==="password"||t()==="webauthn"||t()==="sign-up"))()&&[(()=>{var a=lu(),p=a.firstChild;return f(p,()=>d.i18n("sa-or")),a})(),h(()=>X().map(a=>(()=>{var p=cu();return p.$$click=()=>Q(a.provider),f(p,(()=>{var N=h(()=>a.provider==="google");return()=>N()&&du()})(),null),f(p,(()=>{var N=h(()=>a.provider==="github");return()=>N()&&fu()})(),null),f(p,(()=>{var N=h(()=>a.provider==="apple");return()=>N()&&hu()})(),null),f(p,(()=>{var N=h(()=>a.provider==="oidc");return()=>N()&&pu()})(),null),f(p,(()=>{var N=h(()=>a.provider==="google");return()=>N()?d.i18n("sa-social-google"):h(()=>a.provider==="github")()?d.i18n("sa-social-github"):h(()=>a.provider==="apple")()?d.i18n("sa-social-apple"):d.i18n("sa-social-oidc")})(),null),y(()=>p.disabled=!!De()||b()),p})()))])]})(),null),o})()}),at(["input","click"]);var Du=F(`<div class=container><style>.container {
113
131
  background-color: #ffffff;
114
132
  border-radius: 10px;
115
133
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
@@ -287,7 +305,7 @@
287
305
  .modal-content .btn.verify:hover {
288
306
  background-color: #0056b3;
289
307
  }
290
- </style><style></style><h1 class=header>`),Nt=E("<span class=error-message>"),ra=E("<div class=section><h2></h2><div class=security-keys>"),sa=E('<div class=key-item><span></span><button class="btn remove">'),Mt=E("<span>"),ua=E("<div class=section><div class=security-keys>"),ia=E('<button class="btn add">+ '),aa=E('<div class=add-key-form><div class=add-key-item><label for=keyName style=display:none;></label><input id=keyName type=text><button class="btn remove"></button><button class="btn add">'),oa=E("<div class=section><h2></h2><table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>"),la=E('<tr class=mfa-list-item><td></td><td></td><td><button class="btn remove">'),ca=E('<span>&nbsp; <button class="btn validate">'),da=E('<div class=section><div class=mfa-manage><button class="btn add">+ '),fa=E('<div class=section><h2></h2><div class=mfa-manage><div class=mfa-item><label for=email></label><input id=email type=text><button class="btn add"></button></div><div class=mfa-item><label for=phone></label><input id=phone type=text><button class="btn add"></button></div><div class=mfa-item><button class="btn remove">'),ha=E('<div class=modal id=mfaModal><div class=modal-content><span class=close id=closeModal>&times;</span><h2>MFA Verification</h2><p>Please enter the verification code sent to your email or phone:</p><input type=text id=mfaCode placeholder="Enter verification code"><button class="btn verify"id=verifyMfa>Verify');tt("spartan-account-settings",{domain:"http://127.0.0.1:11000",sector:"0ad5c3e5-0186-4557-8b32-4b36f247bf09",styles:"",locale:"en",showWebAuthn:!0,redirect:"/",redirectOnUnauthenticated:!0},e=>{F(""),F("");const[t,n]=F(""),[r,s]=F(""),[u,o]=F(""),[l]=F(e.showWebAuthn),[v,B]=F(!1),[D,x]=F(!1),[ne,ie]=F(!1),[me,z]=F(!1),[W,Z]=F(!1),[re,K]=F([]),[Q,J]=F([]),[he,be]=F(""),[De,k]=F(""),[Y,Ce]=F(""),[le,ce]=F(""),b=nt(e.locale);let pe;try{pe=e.styles}catch{pe=""}Ze(async()=>{if(It())x(!0),s("");else{if(e.redirectOnUnauthenticated){window.location.href=e.redirect;return}x(!1),s(b.i18n("not-authenticated"))}Te().then(C=>{console.log(C)}),await Fe(),fe().then(C=>{J(C.registrations)})});async function Te(){return await(await fetch(`${e.domain}/api/v1/users/self`,de("get"))).json()}function de(w="get"){return{method:w,mode:"cors",cache:"no-cache",headers:{"Content-Type":"application",Authorization:`bearer ${ji()}`}}}function Be(){if(W())return;Z(!0);let w=de("post");w.body=JSON.stringify({keyName:t(),sectorID:e.sector}),fetch(`${e.domain}/api/v1/webauthn/registration/begin`,w).then(C=>{if(C.status===200)return C.json();throw C}).then(C=>(console.log(C),Oe(C))).catch(C=>{C.json?C.json().then(_=>{s(_.message)}):s(C)}).finally(()=>{Z(!1)})}async function Oe(w){try{const C=_t(w.Options);console.log("Parsed WebAuthn creation options:",C);const _=await Tt(C),N=JSON.stringify(_);let R=JSON.parse(N);R.transactionID=w.TransactionID;let P=de("post");P.body=JSON.stringify(R);const M=await fetch(`${e.domain}/api/v1/webauthn/registration/finish`,P);if(M.status!==200){const L=await M.json();s(L.message);return}B(!1),n(""),Fe()}catch(C){console.error("WebAuthn registration error:",C),s((C==null?void 0:C.message)||String(C))}}async function Ie(w){let C=de("delete");C.body=JSON.stringify({ID:w});try{if((await fetch(`${e.domain}/api/v1/webauthn/${w}`,C)).status!==200){s(b.i18n("error-webauthn-remove"));return}Fe()}catch(_){console.error(_),s(b.i18n("error-webauthn-remove"));return}}async function Fe(){let w=de("get");try{const _=await(await fetch(`${e.domain}/api/v1/webauthn/registration/list`,w)).json();K(_.registrations||[])}catch(C){console.error(C),K([])}}function h(w,C){W()||(Z(!0),ve(w,C).then(_=>{if(_)return fe().then(N=>{J(N.registrations),be(_.transactionID),z(!0)})}).finally(()=>{Z(!1)}))}function ve(w,C){let _=de("post");return _.body=JSON.stringify({destination:w,OTPType:Pe(C),sectorID:e.sector}),fetch(`${e.domain}/api/v1/otp/begin`,_).then(N=>{if(N.status!==200){s(b.i18n("error-otp-verification"));return}return N.json()}).catch(N=>{console.error(N),s(b.i18n("error-otp-registration"))})}function we(w,C){if(W())return;Z(!0);let _=de("post");_.body=JSON.stringify({transactionID:w,password:C}),fetch(`${e.domain}/api/v1/otp/finish`,_).then(N=>{if(N.status!==200){o(b.i18n("error-otp-verification"));return}return z(!1),k(""),ie(!1),ce(""),Ce(""),fe().then(R=>{J(R.registrations)}),N.json()}).catch(N=>{console.error(N),o(b.i18n("error-otp-registration"))}).finally(()=>{Z(!1)})}async function fe(){let w=de("get");try{return await(await fetch(`${e.domain}/api/v1/otp/list`,w)).json()}catch(C){console.error(C),s(b.i18n("error-otp-list"));return}}async function ke(w){let C=de("delete");C.body=JSON.stringify({ID:w});try{if((await fetch(`${e.domain}/api/v1/otp/${w}`,C)).status!==200){s(b.i18n("error-otp-remove"));return}fe().then(N=>{J(N.registrations)})}catch(_){console.error(_),s(b.i18n("error-otp-remove"));return}}function Pe(w){return w==="EMAIL"?2:1}return(()=>{var w=na(),C=w.firstChild,_=C.nextSibling,N=_.nextSibling;return f(_,pe),f(N,()=>b.i18n("sa-account-settings")),f(w,r&&(()=>{var R=Nt();return f(R,r),R})(),null),f(w,(()=>{var R=p(()=>!!(l()&&re().length));return()=>R()&&(()=>{var P=ra(),M=P.firstChild,L=M.nextSibling;return f(M,()=>b.i18n("sa-webauthn-security-keys")),f(L,()=>re().map(O=>(()=>{var X=sa(),V=X.firstChild,j=V.nextSibling;return f(V,()=>O.keyName),j.$$click=()=>{confirm(b.i18n("sa-confirm-delete-key"))&&Ie(O.keyName)},f(j,()=>b.i18n("sa-remove")),X})()),null),f(L,(()=>{var O=p(()=>re().length<=0);return()=>O()&&(()=>{var X=Mt();return f(X,()=>b.i18n("sa-no-security-keys")),X})()})(),null),P})()})(),null),f(w,(()=>{var R=p(()=>!!l());return()=>R()&&(()=>{var P=ua(),M=P.firstChild;return f(M,(()=>{var L=p(()=>!v());return()=>L()&&(()=>{var O=ia();return O.firstChild,O.$$click=()=>B(!0),f(O,()=>b.i18n("sa-add-security-key"),null),O})()})(),null),f(M,(()=>{var L=p(()=>!!v());return()=>L()&&(()=>{var O=aa(),X=O.firstChild,V=X.firstChild,j=V.nextSibling,G=j.nextSibling,se=G.nextSibling;return f(V,()=>b.i18n("sa-webauthn-key-name")),j.$$input=a=>n(a.currentTarget.value),G.$$click=()=>B(!1),f(G,()=>b.i18n("sa-cancel")),se.$$click=()=>t()!==""&&Be(),f(se,()=>b.i18n("sa-register")),$(a=>{var i=b.i18n("sa-webauthn-key-name"),d=t()===""||W();return i!==a.e&&ae(j,"placeholder",a.e=i),d!==a.t&&(se.disabled=a.t=d),a},{e:void 0,t:void 0}),$(()=>j.value=t()),O})()})(),null),P})()})(),null),f(w,(()=>{var R=p(()=>Q().length>0);return()=>R()&&(()=>{var P=oa(),M=P.firstChild,L=M.nextSibling,O=L.firstChild,X=O.firstChild,V=X.firstChild,j=V.nextSibling,G=j.nextSibling,se=O.nextSibling;return f(M,()=>b.i18n("sa-mfa")),f(V,()=>b.i18n("sa-mfa-destination")),f(j,()=>b.i18n("sa-mfa-validated")),f(G,()=>b.i18n("sa-mfa-action")),f(se,()=>Q().map(a=>(()=>{var i=la(),d=i.firstChild,y=d.nextSibling,A=y.nextSibling,q=A.firstChild;return f(d,()=>a.DisplayName),f(y,(()=>{var m=p(()=>!!a.Validated);return()=>m()?(()=>{var c=Mt();return f(c,()=>b.i18n("sa-yes")),c})():(()=>{var c=ca(),g=c.firstChild,I=g.nextSibling;return f(c,()=>b.i18n("sa-no"),g),I.$$click=()=>{h(a.DisplayName,a.Type==="email"?"EMAIL":"SMS")},f(I,()=>b.i18n("sa-validate")),$(()=>I.disabled=W()),c})()})()),q.$$click=()=>{confirm(b.i18n("sa-confirm-delete-key"))&&ke(a.ID)},f(q,()=>b.i18n("sa-remove")),$(()=>ae(d,"title",a.DisplayName)),i})())),P})()})(),null),f(w,(()=>{var R=p(()=>!ne());return()=>R()&&(()=>{var P=da(),M=P.firstChild,L=M.firstChild;return L.firstChild,L.$$click=()=>ie(!0),f(L,()=>b.i18n("sa-register-mfa"),null),P})()})(),null),f(w,(()=>{var R=p(()=>!!ne());return()=>R()&&(()=>{var P=fa(),M=P.firstChild,L=M.nextSibling,O=L.firstChild,X=O.firstChild,V=X.nextSibling,j=V.nextSibling,G=O.nextSibling,se=G.firstChild,a=se.nextSibling,i=a.nextSibling,d=G.nextSibling,y=d.firstChild;return f(M,()=>b.i18n("sa-add-mfa")),f(X,()=>b.i18n("sa-email")),V.$$input=A=>Ce(A.currentTarget.value),j.$$click=()=>h(Y(),"EMAIL"),f(j,()=>b.i18n("sa-add-email")),f(se,()=>b.i18n("sa-phone")),a.$$input=A=>ce(A.currentTarget.value),i.$$click=()=>h(le(),"SMS"),f(i,()=>b.i18n("sa-add-sms")),y.$$click=()=>ie(!1),f(y,()=>b.i18n("sa-cancel")),$(A=>{var q=b.i18n("sa-email"),m=W(),c=b.i18n("sa-phone"),g=W();return q!==A.e&&ae(V,"placeholder",A.e=q),m!==A.t&&(j.disabled=A.t=m),c!==A.a&&ae(a,"placeholder",A.a=c),g!==A.o&&(i.disabled=A.o=g),A},{e:void 0,t:void 0,a:void 0,o:void 0}),$(()=>V.value=Y()),$(()=>a.value=le()),P})()})(),null),f(w,(()=>{var R=p(()=>!!me());return()=>R()&&(()=>{var P=ha(),M=P.firstChild,L=M.firstChild,O=L.nextSibling,X=O.nextSibling,V=X.nextSibling,j=V.nextSibling;return P.$$click=()=>z(!1),M.$$click=G=>G.stopPropagation(),L.$$click=()=>z(!1),f(M,(()=>{var G=p(()=>!!u());return()=>G()&&(()=>{var se=Nt();return f(se,u),se})()})(),X),V.$$input=G=>k(G.currentTarget.value),j.$$click=()=>we(he(),De()),$(()=>j.disabled=W()),$(()=>V.value=De()),P})()})(),null),w})()}),Xe(["click","input"]);var Da=E(`<form class=invite-frame><style>.invite-frame {
308
+ </style><style></style><h1 class=header>`),Ht=F("<span class=error-message>"),gu=F("<div class=section><h2></h2><div class=security-keys>"),mu=F('<div class=key-item><span></span><button class="btn remove">'),Wt=F("<span>"),bu=F("<div class=section><div class=security-keys>"),vu=F('<button class="btn add">+ '),Cu=F('<div class=add-key-form><div class=add-key-item><label for=keyName style=display:none;></label><input id=keyName type=text><button class="btn remove"></button><button class="btn add">'),wu=F("<div class=section><h2></h2><table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>"),Au=F('<tr class=mfa-list-item><td></td><td></td><td><button class="btn remove">'),Eu=F('<span>&nbsp; <button class="btn validate">'),Fu=F('<div class=section><div class=mfa-manage><button class="btn add">+ '),yu=F('<div class=section><h2></h2><div class=mfa-manage><div class=mfa-item><label for=email></label><input id=email type=text><button class="btn add"></button></div><div class=mfa-item><label for=phone></label><input id=phone type=text><button class="btn add"></button></div><div class=mfa-item><button class="btn remove">'),$u=F('<div class=modal id=mfaModal><div class=modal-content><span class=close id=closeModal>&times;</span><h2>MFA Verification</h2><p>Please enter the verification code sent to your email or phone:</p><input type=text id=mfaCode placeholder="Enter verification code"><button class="btn verify"id=verifyMfa>Verify');lt("spartan-account-settings",{domain:"http://127.0.0.1:11000",sector:"0ad5c3e5-0186-4557-8b32-4b36f247bf09",styles:"",locale:"en",showWebAuthn:!0,redirect:"/",redirectOnUnauthenticated:!0},e=>{C(""),C("");const[t,n]=C(""),[r,s]=C(""),[i,u]=C(""),[l]=C(e.showWebAuthn),[w,$]=C(!1),[D,B]=C(!1),[oe,fe]=C(!1),[Fe,L]=C(!1),[Z,Y]=C(!1),[le,G]=C([]),[te,V]=C([]),[we,ye]=C(""),[Ae,k]=C(""),[X,$e]=C(""),[De,ge]=C(""),b=ct(e.locale);let me;try{me=e.styles}catch{me=""}st(async()=>{if(Ut())B(!0),s("");else{if(e.redirectOnUnauthenticated){window.location.href=e.redirect;return}B(!1),s(b.i18n("not-authenticated"))}Ue().then(v=>{console.log(v)}),await Te(),ve().then(v=>{V(v.registrations)})});async function Ue(){return await(await fetch(`${e.domain}/api/v1/users/self`,be("get"))).json()}function be(A="get"){return{method:A,mode:"cors",cache:"no-cache",headers:{"Content-Type":"application",Authorization:`bearer ${Ha()}`}}}function Me(){if(Z())return;Y(!0);let A=be("post");A.body=JSON.stringify({keyName:t(),sectorID:e.sector}),fetch(`${e.domain}/api/v1/webauthn/registration/begin`,A).then(v=>{if(v.status===200)return v.json();throw v}).then(v=>(console.log(v),Je(v))).catch(v=>{v.json?v.json().then(S=>{s(S.message)}):s(v)}).finally(()=>{Y(!1)})}async function Je(A){try{const v=Rt(A.Options);console.log("Parsed WebAuthn creation options:",v);const S=await Lt(v),R=JSON.stringify(S);let d=JSON.parse(R);d.transactionID=A.TransactionID;let _=be("post");_.body=JSON.stringify(d);const z=await fetch(`${e.domain}/api/v1/webauthn/registration/finish`,_);if(z.status!==200){const P=await z.json();s(P.message);return}$(!1),n(""),Te()}catch(v){console.error("WebAuthn registration error:",v),s((v==null?void 0:v.message)||String(v))}}async function Ve(A){let v=be("delete");v.body=JSON.stringify({ID:A});try{if((await fetch(`${e.domain}/api/v1/webauthn/${A}`,v)).status!==200){s(b.i18n("error-webauthn-remove"));return}Te()}catch(S){console.error(S),s(b.i18n("error-webauthn-remove"));return}}async function Te(){let A=be("get");try{const S=await(await fetch(`${e.domain}/api/v1/webauthn/registration/list`,A)).json();G(S.registrations||[])}catch(v){console.error(v),G([])}}function Oe(A,v){Z()||(Y(!0),Ie(A,v).then(S=>{if(S)return ve().then(R=>{V(R.registrations),ye(S.transactionID),L(!0)})}).finally(()=>{Y(!1)}))}function Ie(A,v){let S=be("post");return S.body=JSON.stringify({destination:A,OTPType:_e(v),sectorID:e.sector}),fetch(`${e.domain}/api/v1/otp/begin`,S).then(R=>{if(R.status!==200){s(b.i18n("error-otp-verification"));return}return R.json()}).catch(R=>{console.error(R),s(b.i18n("error-otp-registration"))})}function je(A,v){if(Z())return;Y(!0);let S=be("post");S.body=JSON.stringify({transactionID:A,password:v}),fetch(`${e.domain}/api/v1/otp/finish`,S).then(R=>{if(R.status!==200){u(b.i18n("error-otp-verification"));return}return L(!1),k(""),fe(!1),ge(""),$e(""),ve().then(d=>{V(d.registrations)}),R.json()}).catch(R=>{console.error(R),u(b.i18n("error-otp-registration"))}).finally(()=>{Y(!1)})}async function ve(){let A=be("get");try{return await(await fetch(`${e.domain}/api/v1/otp/list`,A)).json()}catch(v){console.error(v),s(b.i18n("error-otp-list"));return}}async function Se(A){let v=be("delete");v.body=JSON.stringify({ID:A});try{if((await fetch(`${e.domain}/api/v1/otp/${A}`,v)).status!==200){s(b.i18n("error-otp-remove"));return}ve().then(R=>{V(R.registrations)})}catch(S){console.error(S),s(b.i18n("error-otp-remove"));return}}function _e(A){return A==="EMAIL"?2:1}return(()=>{var A=Du(),v=A.firstChild,S=v.nextSibling,R=S.nextSibling;return f(S,me),f(R,()=>b.i18n("sa-account-settings")),f(A,r&&(()=>{var d=Ht();return f(d,r),d})(),null),f(A,(()=>{var d=h(()=>!!(l()&&le().length));return()=>d()&&(()=>{var _=gu(),z=_.firstChild,P=z.nextSibling;return f(z,()=>b.i18n("sa-webauthn-security-keys")),f(P,()=>le().map(O=>(()=>{var Q=mu(),K=Q.firstChild,q=K.nextSibling;return f(K,()=>O.keyName),q.$$click=()=>{confirm(b.i18n("sa-confirm-delete-key"))&&Ve(O.keyName)},f(q,()=>b.i18n("sa-remove")),Q})()),null),f(P,(()=>{var O=h(()=>le().length<=0);return()=>O()&&(()=>{var Q=Wt();return f(Q,()=>b.i18n("sa-no-security-keys")),Q})()})(),null),_})()})(),null),f(A,(()=>{var d=h(()=>!!l());return()=>d()&&(()=>{var _=bu(),z=_.firstChild;return f(z,(()=>{var P=h(()=>!w());return()=>P()&&(()=>{var O=vu();return O.firstChild,O.$$click=()=>$(!0),f(O,()=>b.i18n("sa-add-security-key"),null),O})()})(),null),f(z,(()=>{var P=h(()=>!!w());return()=>P()&&(()=>{var O=Cu(),Q=O.firstChild,K=Q.firstChild,q=K.nextSibling,H=q.nextSibling,re=H.nextSibling;return f(K,()=>b.i18n("sa-webauthn-key-name")),q.$$input=U=>n(U.currentTarget.value),H.$$click=()=>$(!1),f(H,()=>b.i18n("sa-cancel")),re.$$click=()=>t()!==""&&Me(),f(re,()=>b.i18n("sa-register")),y(U=>{var c=b.i18n("sa-webauthn-key-name"),m=t()===""||Z();return c!==U.e&&ue(q,"placeholder",U.e=c),m!==U.t&&(re.disabled=U.t=m),U},{e:void 0,t:void 0}),y(()=>q.value=t()),O})()})(),null),_})()})(),null),f(A,(()=>{var d=h(()=>te().length>0);return()=>d()&&(()=>{var _=wu(),z=_.firstChild,P=z.nextSibling,O=P.firstChild,Q=O.firstChild,K=Q.firstChild,q=K.nextSibling,H=q.nextSibling,re=O.nextSibling;return f(z,()=>b.i18n("sa-mfa")),f(K,()=>b.i18n("sa-mfa-destination")),f(q,()=>b.i18n("sa-mfa-validated")),f(H,()=>b.i18n("sa-mfa-action")),f(re,()=>te().map(U=>(()=>{var c=Au(),m=c.firstChild,I=m.nextSibling,x=I.nextSibling,ee=x.firstChild;return f(m,()=>U.DisplayName),f(I,(()=>{var se=h(()=>!!U.Validated);return()=>se()?(()=>{var ie=Wt();return f(ie,()=>b.i18n("sa-yes")),ie})():(()=>{var ie=Eu(),he=ie.firstChild,Be=he.nextSibling;return f(ie,()=>b.i18n("sa-no"),he),Be.$$click=()=>{Oe(U.DisplayName,U.Type==="email"?"EMAIL":"SMS")},f(Be,()=>b.i18n("sa-validate")),y(()=>Be.disabled=Z()),ie})()})()),ee.$$click=()=>{confirm(b.i18n("sa-confirm-delete-key"))&&Se(U.ID)},f(ee,()=>b.i18n("sa-remove")),y(()=>ue(m,"title",U.DisplayName)),c})())),_})()})(),null),f(A,(()=>{var d=h(()=>!oe());return()=>d()&&(()=>{var _=Fu(),z=_.firstChild,P=z.firstChild;return P.firstChild,P.$$click=()=>fe(!0),f(P,()=>b.i18n("sa-register-mfa"),null),_})()})(),null),f(A,(()=>{var d=h(()=>!!oe());return()=>d()&&(()=>{var _=yu(),z=_.firstChild,P=z.nextSibling,O=P.firstChild,Q=O.firstChild,K=Q.nextSibling,q=K.nextSibling,H=O.nextSibling,re=H.firstChild,U=re.nextSibling,c=U.nextSibling,m=H.nextSibling,I=m.firstChild;return f(z,()=>b.i18n("sa-add-mfa")),f(Q,()=>b.i18n("sa-email")),K.$$input=x=>$e(x.currentTarget.value),q.$$click=()=>Oe(X(),"EMAIL"),f(q,()=>b.i18n("sa-add-email")),f(re,()=>b.i18n("sa-phone")),U.$$input=x=>ge(x.currentTarget.value),c.$$click=()=>Oe(De(),"SMS"),f(c,()=>b.i18n("sa-add-sms")),I.$$click=()=>fe(!1),f(I,()=>b.i18n("sa-cancel")),y(x=>{var ee=b.i18n("sa-email"),se=Z(),ie=b.i18n("sa-phone"),he=Z();return ee!==x.e&&ue(K,"placeholder",x.e=ee),se!==x.t&&(q.disabled=x.t=se),ie!==x.a&&ue(U,"placeholder",x.a=ie),he!==x.o&&(c.disabled=x.o=he),x},{e:void 0,t:void 0,a:void 0,o:void 0}),y(()=>K.value=X()),y(()=>U.value=De()),_})()})(),null),f(A,(()=>{var d=h(()=>!!Fe());return()=>d()&&(()=>{var _=$u(),z=_.firstChild,P=z.firstChild,O=P.nextSibling,Q=O.nextSibling,K=Q.nextSibling,q=K.nextSibling;return _.$$click=()=>L(!1),z.$$click=H=>H.stopPropagation(),P.$$click=()=>L(!1),f(z,(()=>{var H=h(()=>!!i());return()=>H()&&(()=>{var re=Ht();return f(re,i),re})()})(),Q),K.$$input=H=>k(H.currentTarget.value),q.$$click=()=>je(we(),Ae()),y(()=>q.disabled=Z()),y(()=>K.value=Ae()),_})()})(),null),A})()}),at(["click","input"]);var Bu=F(`<form class=invite-frame><style>.invite-frame {
291
309
  display: flex;
292
310
  flex-direction: column;
293
311
  justify-content: center;
@@ -347,4 +365,4 @@
347
365
  margin-bottom: 10px;
348
366
  display: block;
349
367
  }
350
- </style><style></style><h1></h1><input type=text autocomplete=one-time-code required><span class=hint></span><input type=password autocomplete=new-password required minlength=8><span class=hint></span><button type=submit>`),pa=E("<span class=info-message>"),ga=E("<span class=error-message>"),ma=E("<span class=success-message>");tt("spartan-invite",{domain:"http://127.0.0.1:11000",sector:"0ad5c3e5-0186-4557-8b32-4b36f247bf09",sub:"",email:"",styles:"",locale:"en",redirect:""},e=>{const[t,n]=F(""),[r,s]=F(""),[u,o]=F(""),[l,v]=F(""),[B,D]=F(!1),x=nt(e.locale);let ne,ie;try{ie=e.styles}catch{ie=""}Ze(async()=>{e.sub||new URLSearchParams(window.location.search).get("sub")||o("Missing invitation information. Please use the link from your invite email.");const W=new URLSearchParams(window.location.hash.replace("#","")).get("otp");W&&n(W)});async function me(z){var re,K;if(z.preventDefault(),o(""),v(""),D(!0),!t()||t().trim().length===0){o("Please enter your verification code"),D(!1);return}if(!r()||r().length<8){o("Password must be at least 8 characters"),D(!1);return}const W=new URLSearchParams(window.location.search),Z=e.sub||W.get("sub")||"";if(!Z){o("Missing invitation information"),D(!1);return}try{const Q=await fetch(`${e.domain}/api/v1/users/invite/complete`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({sub:Z,otp:t().toUpperCase().trim(),password:r(),sectorID:e.sector})});if(Q.ok){const J=await Q.json();v(x.i18n("sa-invite-success"));const he=new CustomEvent("spartan-invite-complete",{bubbles:!0,cancelable:!0,detail:{sub:Z,success:!0}});ne&&ne.getRootNode().host.dispatchEvent(he),setTimeout(()=>{e.redirect&&e.redirect!==""&&(window.location.href=e.redirect)},2e3)}else{const J=await Q.json().catch(()=>({}));Q.status===400||(re=J.message)!=null&&re.includes("invalid OTP")?o(x.i18n("sa-invite-error-otp")):Q.status===504||(K=J.message)!=null&&K.includes("expired")?o(x.i18n("sa-invite-error-expired")):o(J.message||x.i18n("sa-invite-error-generic")),D(!1)}}catch(Q){console.error("Error completing invite:",Q),o(x.i18n("sa-invite-error-generic")),D(!1)}}return(()=>{var z=Da(),W=z.firstChild,Z=W.nextSibling,re=Z.nextSibling,K=re.nextSibling,Q=K.nextSibling,J=Q.nextSibling,he=J.nextSibling,be=he.nextSibling,De=ne;return typeof De=="function"?pt(De,z):ne=z,z.addEventListener("submit",me),f(Z,ie),f(re,()=>x.i18n("sa-complete-invite")),f(z,(()=>{var k=p(()=>!!e.email);return()=>k()&&(()=>{var Y=pa();return f(Y,()=>e.email),Y})()})(),K),f(z,(()=>{var k=p(()=>!!u());return()=>k()&&(()=>{var Y=ga();return f(Y,u),Y})()})(),K),f(z,(()=>{var k=p(()=>!!l());return()=>k()&&(()=>{var Y=ma();return f(Y,l),Y})()})(),K),K.$$input=k=>n(k.currentTarget.value),f(Q,()=>x.i18n("sa-invite-otp-hint")),J.$$input=k=>s(k.currentTarget.value),f(he,()=>x.i18n("sa-invite-password-hint")),f(be,(()=>{var k=p(()=>!!B());return()=>k()?x.i18n("sa-invite-completing"):x.i18n("sa-invite-submit")})()),$(k=>{var Y=x.i18n("sa-invite-otp"),Ce=B()||l()!=="",le=x.i18n("sa-invite-password"),ce=B()||l()!=="",b=B()||l()!=="";return Y!==k.e&&ae(K,"placeholder",k.e=Y),Ce!==k.t&&(K.disabled=k.t=Ce),le!==k.a&&ae(J,"placeholder",k.a=le),ce!==k.o&&(J.disabled=k.o=ce),b!==k.i&&(be.disabled=k.i=b),k},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),$(()=>K.value=t()),$(()=>J.value=r()),z})()}),Xe(["input"])});
368
+ </style><style></style><h1></h1><input type=text autocomplete=one-time-code required><span class=hint></span><input type=password autocomplete=new-password required minlength=8><span class=hint></span><button type=submit>`),ku=F("<span class=info-message>"),xu=F("<span class=error-message>"),Su=F("<span class=success-message>");lt("spartan-invite",{domain:"http://127.0.0.1:11000",sector:"0ad5c3e5-0186-4557-8b32-4b36f247bf09",sub:"",email:"",styles:"",locale:"en",redirect:""},e=>{console.warn("[spartan-invite] <spartan-invite> is deprecated. Use <spartan-login> instead — it now handles invite links by detecting ?sub= URL params automatically.");const[t,n]=C(""),[r,s]=C(""),[i,u]=C(""),[l,w]=C(""),[$,D]=C(!1),B=ct(e.locale);let oe,fe;try{fe=e.styles}catch{fe=""}st(async()=>{e.sub||new URLSearchParams(window.location.search).get("sub")||u("Missing invitation information. Please use the link from your invite email.");const Z=new URLSearchParams(window.location.hash.replace("#","")).get("otp");Z&&n(Z)});async function Fe(L){var le,G;if(L.preventDefault(),u(""),w(""),D(!0),!t()||t().trim().length===0){u("Please enter your verification code"),D(!1);return}if(!r()||r().length<8){u("Password must be at least 8 characters"),D(!1);return}const Z=new URLSearchParams(window.location.search),Y=e.sub||Z.get("sub")||"";if(!Y){u("Missing invitation information"),D(!1);return}try{const te=await fetch(`${e.domain}/api/v1/users/invite/complete`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({sub:Y,otp:t().toUpperCase().trim(),password:r(),sectorID:e.sector})});if(te.ok){const V=await te.json();w(B.i18n("sa-invite-success"));const we=new CustomEvent("spartan-invite-complete",{bubbles:!0,cancelable:!0,detail:{sub:Y,success:!0}});oe&&oe.getRootNode().host.dispatchEvent(we),setTimeout(()=>{e.redirect&&e.redirect!==""&&(window.location.href=e.redirect)},2e3)}else{const V=await te.json().catch(()=>({}));te.status===400||(le=V.message)!=null&&le.includes("invalid OTP")?u(B.i18n("sa-invite-error-otp")):te.status===504||(G=V.message)!=null&&G.includes("expired")?u(B.i18n("sa-invite-error-expired")):u(V.message||B.i18n("sa-invite-error-generic")),D(!1)}}catch(te){console.error("Error completing invite:",te),u(B.i18n("sa-invite-error-generic")),D(!1)}}return(()=>{var L=Bu(),Z=L.firstChild,Y=Z.nextSibling,le=Y.nextSibling,G=le.nextSibling,te=G.nextSibling,V=te.nextSibling,we=V.nextSibling,ye=we.nextSibling,Ae=oe;return typeof Ae=="function"?Ft(Ae,L):oe=L,L.addEventListener("submit",Fe),f(Y,fe),f(le,()=>B.i18n("sa-complete-invite")),f(L,(()=>{var k=h(()=>!!e.email);return()=>k()&&(()=>{var X=ku();return f(X,()=>e.email),X})()})(),G),f(L,(()=>{var k=h(()=>!!i());return()=>k()&&(()=>{var X=xu();return f(X,i),X})()})(),G),f(L,(()=>{var k=h(()=>!!l());return()=>k()&&(()=>{var X=Su();return f(X,l),X})()})(),G),G.$$input=k=>n(k.currentTarget.value),f(te,()=>B.i18n("sa-invite-otp-hint")),V.$$input=k=>s(k.currentTarget.value),f(we,()=>B.i18n("sa-invite-password-hint")),f(ye,(()=>{var k=h(()=>!!$());return()=>k()?B.i18n("sa-invite-completing"):B.i18n("sa-invite-submit")})()),y(k=>{var X=B.i18n("sa-invite-otp"),$e=$()||l()!=="",De=B.i18n("sa-invite-password"),ge=$()||l()!=="",b=$()||l()!=="";return X!==k.e&&ue(G,"placeholder",k.e=X),$e!==k.t&&(G.disabled=k.t=$e),De!==k.a&&ue(V,"placeholder",k.a=De),ge!==k.o&&(V.disabled=k.o=ge),b!==k.i&&(ye.disabled=k.i=b),k},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),y(()=>G.value=t()),y(()=>V.value=r()),L})()}),at(["input"])});