@masonitestudios/spartanauth-widgets 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sa-widgets.mjs +2615 -0
- package/dist/sa-widgets.umd.js +299 -0
- package/package.json +32 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
(function(Je){typeof define=="function"&&define.amd?define(Je):Je()})(function(){"use strict";const Ie={equals:(e,t)=>e===t};let ut=ot;const be=1,Ne=2,st={owned:null,cleanups:null,context:null,owner:null};var Q=null;let Ke=null,Nt=null,R=null,Z=null,pe=null,ze=0;function zt(e,t){const n=R,r=Q,u=e.length===0,s=t===void 0?r:t,a=u?st:{owned:null,cleanups:null,context:s?s.context:null,owner:s},i=u?e:()=>e(()=>Me(()=>xe(a)));Q=a,R=null;try{return ke(i,!0)}finally{R=n,Q=r}}function w(e,t){t=t?Object.assign({},Ie,t):Ie;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=u=>(typeof u=="function"&&(u=u(n.value)),it(n,u));return[at.bind(n),r]}function S(e,t,n){const r=Ge(e,t,!1,be);$e(r)}function Mt(e,t,n){ut=qt;const r=Ge(e,t,!1,be);r.user=!0,pe?pe.push(r):$e(r)}function A(e,t,n){n=n?Object.assign({},Ie,n):Ie;const r=Ge(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,$e(r),at.bind(r)}function Me(e){if(R===null)return e();const t=R;R=null;try{return e()}finally{R=t}}function Ve(e){Mt(()=>Me(e))}function at(){if(this.sources&&this.state)if(this.state===be)$e(this);else{const e=Z;Z=null,ke(()=>Re(this),!1),Z=e}if(R){const e=this.observers?this.observers.length:0;R.sources?(R.sources.push(this),R.sourceSlots.push(e)):(R.sources=[this],R.sourceSlots=[e]),this.observers?(this.observers.push(R),this.observerSlots.push(R.sources.length-1)):(this.observers=[R],this.observerSlots=[R.sources.length-1])}return this.value}function it(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&ke(()=>{for(let u=0;u<e.observers.length;u+=1){const s=e.observers[u],a=Ke&&Ke.running;a&&Ke.disposed.has(s),(a?!s.tState:!s.state)&&(s.pure?Z.push(s):pe.push(s),s.observers&<(s)),a||(s.state=be)}if(Z.length>1e6)throw Z=[],new Error},!1)),t}function $e(e){if(!e.fn)return;xe(e);const t=ze;jt(e,e.value,t)}function jt(e,t,n){let r;const u=Q,s=R;R=Q=e;try{r=e.fn(t)}catch(a){return e.pure&&(e.state=be,e.owned&&e.owned.forEach(xe),e.owned=null),e.updatedAt=n+1,ct(a)}finally{R=s,Q=u}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?it(e,r):e.value=r,e.updatedAt=n)}function Ge(e,t,n,r=be,u){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Q,context:Q?Q.context:null,pure:n};return Q===null||Q!==st&&(Q.owned?Q.owned.push(s):Q.owned=[s]),s}function je(e){if(e.state===0)return;if(e.state===Ne)return Re(e);if(e.suspense&&Me(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ze);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===be)$e(e);else if(e.state===Ne){const r=Z;Z=null,ke(()=>Re(e,t[0]),!1),Z=r}}function ke(e,t){if(Z)return e();let n=!1;t||(Z=[]),pe?n=!0:pe=[],ze++;try{const r=e();return Rt(n),r}catch(r){n||(pe=null),Z=null,ct(r)}}function Rt(e){if(Z&&(ot(Z),Z=null),e)return;const t=pe;pe=null,t.length&&ke(()=>ut(t),!1)}function ot(e){for(let t=0;t<e.length;t++)je(e[t])}function qt(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:je(r)}for(t=0;t<n;t++)je(e[t])}function Re(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const u=r.state;u===be?r!==t&&(!r.updatedAt||r.updatedAt<ze)&&je(r):u===Ne&&Re(r,t)}}}function lt(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Ne,n.pure?Z.push(n):pe.push(n),n.observers&<(n))}}function xe(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),u=n.observers;if(u&&u.length){const s=u.pop(),a=n.observerSlots.pop();r<u.length&&(s.sourceSlots[a]=r,u[r]=s,n.observerSlots[r]=a)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)xe(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)xe(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 Lt(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ct(e,t=Q){throw Lt(e)}function Ut(e,t,n){let r=n.length,u=t.length,s=r,a=0,i=0,C=t[u-1].nextSibling,y=null;for(;a<u||i<s;){if(t[a]===n[i]){a++,i++;continue}for(;t[u-1]===n[s-1];)u--,s--;if(u===a){const p=s<r?i?n[i-1].nextSibling:n[s-i]:C;for(;i<s;)e.insertBefore(n[i++],p)}else if(s===i)for(;a<u;)(!y||!y.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[s-1]&&n[i]===t[u-1]){const p=t[--u].nextSibling;e.insertBefore(n[i++],t[a++].nextSibling),e.insertBefore(n[--s],p),t[u]=n[s]}else{if(!y){y=new Map;let T=i;for(;T<s;)y.set(n[T],T++)}const p=y.get(t[a]);if(p!=null)if(i<p&&p<s){let T=a,ue=1,ie;for(;++T<u&&T<s&&!((ie=y.get(t[T]))==null||ie!==p+ue);)ue++;if(ue>p-i){const de=t[a];for(;i<p;)e.insertBefore(n[i++],de)}else e.replaceChild(n[i++],t[a++])}else a++;else t[a++].remove()}}}const dt="_$DX_DELEGATE";function x(e,t,n,r){let u;const s=()=>{const i=document.createElement("template");return i.innerHTML=e,i.content.firstChild},a=()=>(u||(u=s())).cloneNode(!0);return a.cloneNode=a,a}function We(e,t=window.document){const n=t[dt]||(t[dt]=new Set);for(let r=0,u=e.length;r<u;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,Jt))}}function ce(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Dt(e,t,n){return Me(()=>e(t,n))}function c(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return qe(e,t,r,n);S(u=>qe(e,t(),u,n),r)}function Jt(e){let t=e.target;const n=`$$${e.type}`,r=e.target,u=e.currentTarget,s=C=>Object.defineProperty(e,"target",{configurable:!0,value:C}),a=()=>{const C=t[n];if(C&&!t.disabled){const y=t[`${n}Data`];if(y!==void 0?C.call(t,y,e):C.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},i=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const C=e.composedPath();s(C[0]);for(let y=0;y<C.length-2&&(t=C[y],!!a());y++){if(t._$host){t=t._$host,i();break}if(t.parentNode===u)break}}else i();s(r)}function qe(e,t,n,r,u){for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===n))return n;if(a){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=we(e,n,r,i)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean")n=we(e,n,r);else{if(s==="function")return S(()=>{let i=t();for(;typeof i=="function";)i=i();n=qe(e,i,n,r)}),()=>n;if(Array.isArray(t)){const i=[],C=n&&Array.isArray(n);if(He(i,t,n,u))return S(()=>n=qe(e,i,n,r,!0)),()=>n;if(i.length===0){if(n=we(e,n,r),a)return n}else C?n.length===0?ft(e,i,r):Ut(e,n,i):(n&&we(e),ft(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=we(e,n,r,t);we(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function He(e,t,n,r){let u=!1;for(let s=0,a=t.length;s<a;s++){let i=t[s],C=n&&n[e.length],y;if(!(i==null||i===!0||i===!1))if((y=typeof i)=="object"&&i.nodeType)e.push(i);else if(Array.isArray(i))u=He(e,i,C)||u;else if(y==="function")if(r){for(;typeof i=="function";)i=i();u=He(e,Array.isArray(i)?i:[i],Array.isArray(C)?C:[C])||u}else e.push(i),u=!0;else{const p=String(i);C&&C.nodeType===3&&C.data===p?e.push(C):e.push(document.createTextNode(p))}}return u}function ft(e,t,n=null){for(let r=0,u=t.length;r<u;r++)e.insertBefore(t[r],n)}function we(e,t,n,r){if(n===void 0)return e.textContent="";const u=r||document.createTextNode("");if(t.length){let s=!1;for(let a=t.length-1;a>=0;a--){const i=t[a];if(u!==i){const C=i.parentNode===e;!s&&!a?C?e.replaceChild(u,i):e.insertBefore(u,n):C&&i.remove()}else s=!0}}else e.insertBefore(u,n);return[u]}function Kt(e){return Object.keys(e).reduce((n,r)=>{const u=e[r];return n[r]=Object.assign({},u),gt(u.value)&&!Zt(u.value)&&!Array.isArray(u.value)&&(n[r].value=Object.assign({},u.value)),Array.isArray(u.value)&&(n[r].value=u.value.slice(0)),n},{})}function Vt(e){return e?Object.keys(e).reduce((n,r)=>{const u=e[r];return n[r]=gt(u)&&"value"in u?u:{value:u},n[r].attribute||(n[r].attribute=Ht(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Gt(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Wt(e,t){const n=Kt(t);return Object.keys(t).forEach(u=>{const s=n[u],a=e.getAttribute(s.attribute),i=e[u];a!=null&&(s.value=s.parse?ht(a):a),i!=null&&(s.value=Array.isArray(i)?i.slice(0):i),s.reflect&&pt(e,s.attribute,s.value,!!s.parse),Object.defineProperty(e,u,{get(){return s.value},set(C){const y=s.value;s.value=C,s.reflect&&pt(this,s.attribute,s.value,!!s.parse);for(let p=0,T=this.__propertyChangedCallbacks.length;p<T;p++)this.__propertyChangedCallbacks[p](u,C,y)},enumerable:!0,configurable:!0})}),n}function ht(e){if(e)try{return JSON.parse(e)}catch{return e}}function pt(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let u=r?JSON.stringify(n):n;e.__updating[t]=!0,u==="true"&&(u=""),e.setAttribute(t,u),Promise.resolve().then(()=>delete e.__updating[t])}function Ht(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function gt(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Zt(e){return Object.prototype.toString.call(e)==="[object Function]"}function Yt(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Ze;function Xt(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(u=>t[u].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=Wt(this,t);const u=Gt(this.props),s=this.Component,a=Ze;try{Ze=this,this.__initialized=!0,Yt(s)?new s(u,{element:this}):s(u,{element:this})}finally{Ze=a}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let u=null;for(;u=this.__releaseCallbacks.pop();)u(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(u,s,a){if(this.__initialized&&!this.__updating[u]&&(u=this.lookupProp(u),u in t)){if(a==null&&!this[u])return;this[u]=t[u].parse?ht(a):a}}lookupProp(u){if(t)return n.find(s=>u===s||u===t[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(u){this.__releaseCallbacks.push(u)}addPropertyChangedCallback(u){this.__propertyChangedCallbacks.push(u)}}}function Qt(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:u,customElements:s=window.customElements}=n;return a=>{if(!e)throw new Error("tag is required to register a Component");let i=s.get(e);return i?(i.prototype.Component=a,i):(i=Xt(r,Vt(t)),i.prototype.Component=a,i.prototype.registeredTag=e,s.define(e,i,u),i)}}function en(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[u,s]=w(e[t[r]]);Object.defineProperty(n,t[r],{get:u,set(a){s(()=>a)}})}return n}function tn(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 nn(e){return(t,n)=>{const{element:r}=n;return zt(u=>{const s=en(t);r.addPropertyChangedCallback((i,C)=>s[i]=C),r.addReleaseCallback(()=>{r.renderRoot.textContent="",u()});const a=e(s,n);return c(r.renderRoot,a)},tn(r))}}function Ye(e,t,n){return arguments.length===2&&(n=t,t={}),Qt(e,t)(nn(n))}var rn="٠١٢٣٤٥٦٧٨٩",un="۰۱۲۳۴۵۶۷۸۹",sn="൦൧൨൩൪൫൬൭൮൯",an="೦೧೨೩೪೫೬೭೮೯",on="໐໑໒໓໔໕໖໗໘໙",ln="୦୧୨୩୪୫୬୭୮୯",cn="០១២៣៤៥៦៧៨៩",dn="߀߁߂߃߄߅߆߇߈߉",Dn="੦੧੨੩੪੫੬੭੮੯",fn="૦૧૨૩૪૫૬૭૮૯",hn="०१२३४५६७८९",pn="၀၁၂၃၄၅၆၇၈၉",gn="௦௧௨௩௪௫௬௭௮௯",mn="౦౧౨౩౪౫౬౭౮౯",bn="๐๑๒๓๔๕๖๗๘๙",Cn="༠༡༢༣༤༥༦༧༨༩",mt={ar:rn,fa:un,ml:sn,kn:an,lo:on,or:ln,kh:cn,nqo:dn,pa:Dn,gu:fn,hi:hn,my:pn,ta:gn,te:mn,th:bn,bo:Cn},An=["ru"],Fn=["id"],En=["id"],vn=["ady-cyrl"],wn=["aeb-arab"],yn=["sq"],Bn=["ru"],$n=["zh-hant"],kn=["es"],xn=["hi"],_n=["es"],Sn=["ar"],Tn=["ar"],On=["ar"],Pn=["es"],In=["fr"],Nn=["ru"],zn=["fr","es","ru"],Mn=["hi"],jn=["es"],Rn=["fa"],qn=["ru"],Ln=["id"],Un=["de"],Jn=["bbc-latn"],Kn=["fa"],Vn=["fa"],Gn=["bho"],Wn=["en"],Hn=["id"],Zn=["fr"],Yn=["bn"],Xn=["fa"],Qn=["fr"],er=["id"],tr=["id"],nr=["ru"],rr=["oc"],ur=["nan","zh-hant"],sr=["ru"],ar=["it"],ir=["crh-latn"],or=["sk"],lr=["pl"],cr=["ru"],dr=["hsb","de"],Dr=["ms"],fr=["ne"],hr=["it"],pr=["it"],gr=["es"],mr=["fr"],br=["fi"],Cr=["fr"],Ar=["fr"],Fr=["de"],Er=["it"],vr=["tr"],wr=["gan-hant","zh-hant","zh-hans"],yr=["fr"],Br=["pt"],$r=["fa"],kr=["es"],xr=["gom-deva"],_r=["id"],Sr=["de"],Tr=["es"],Or=["zh-hant"],Pr=["hif-latn"],Ir=["de"],Nr=["dsb","de"],zr=["fr"],Mr=["hy"],jr=["zh-cn","zh-hans"],Rr=["ru"],qr=["eo"],Lr=["ike-cans"],Ur=["en"],Jr=["da"],Kr=["id"],Vr=["kk-latn","kk-cyrl"],Gr=["fr"],Wr=["kbd-cyrl"],Hr=["fr"],Zr=["ur"],Yr=["tr"],Xr=["my"],Qr=["kk-cyrl"],eu=["da"],tu=["ru"],nu=["ru"],ru=["fi"],uu=["ks-arab"],su=["de"],au=["ku-latn"],iu=["ru"],ou=["ru"],lu=["es"],cu=["de"],du=["ru"],Du=["ru","az"],fu=["nl"],hu=["it"],pu=["et"],gu=["fa"],mu=["it","rm","fur"],bu=["pms","eml","lij","vec","it"],Cu=["fr"],Au=["fa"],Fu=["lv"],Eu=["fa"],vu=["zh-hant"],wu=["tr"],yu=["id"],Bu=["hi"],$u=["myv","ru"],ku=["fr"],xu=["mrj","ru"],_u=["id"],Su=["my"],Tu=["ro"],Ou=["mhr","ru"],Pu=["pt"],Iu=["mdf","ru"],Nu=["fa"],zu=["es"],Mu=["cdo","zh-hant"],ju=["it"],Ru=["nn"],qu=["de"],Lu=["id"],Uu=["nb"],Ju=["fr"],Ku=["ca","fr"],Vu=["fi"],Gu=["ru"],Wu=["fr"],Hu=["de"],Zu=["de"],Yu=["de"],Xu=["en"],Qu=["it"],es=["el"],ts=["pt-br"],ns=["qug","es"],rs=["qu","es"],us=["it"],ss=["ro"],as=["uk","ru"],is=["ro"],os=["ruq-latn","ro"],ls=["hi"],cs=["ru"],ds=["it"],Ds=["en"],fs=["it"],hs=["cbk","fa"],ps=["fr"],gs=["fr"],ms=["lt"],bs=["bs","sr-el","hr"],Cs=["fr"],As=["shy-latn"],Fs=["cs"],Es=["skr-arab"],vs=["de"],ws=["fi"],ys=["sr-ec"],Bs=["nl"],$s=["de"],ks=["ru"],xs=["id"],_s=["pl"],Ss=["zh-tw","zh-hant","zh-hans"],Ts=["zh-tw","zh-hant","zh-hans"],Os=["kn"],Ps=["pt"],Is=["tg-cyrl"],Ns=["zh-tw","zh-hant","zh-hans"],zs=["tt-cyrl","ru"],Ms=["fr"],js=["ru"],Rs=["ru"],qs=["ug-arab"],Ls=["it"],Us=["et"],Js=["nl"],Ks=["de"],Vs=["fi"],Gs=["et"],Ws=["fr"],Hs=["fr"],Zs=["zh-hans"],Ys=["ru"],Xs=["ka"],Qs=["he"],ea=["zh-hans"],ta=["nl"],na=["kab"],ra=["zh-hans"],bt={ab:An,abs:Fn,ace:En,ady:vn,aeb:wn,"aeb-arab":["ar"],aln:yn,alt:Bn,ami:$n,an:kn,anp:xn,arn:_n,arq:Sn,ary:Tn,arz:On,ast:Pn,atj:In,av:Nn,avk:zn,awa:Mn,ay:jn,azb:Rn,ba:qn,ban:Ln,"ban-bali":["ban"],bar:Un,bbc:Jn,"bbc-latn":["id"],bcc:Kn,"be-tarask":["be"],bgn:Vn,bh:Gn,bi:Wn,bjn:Hn,bm:Zn,bpy:Yn,bqi:Xn,br:Qn,btm:er,bug:tr,bxr:nr,ca:rr,"cbk-zam":["es"],cdo:ur,ce:sr,co:ar,crh:ir,"crh-cyrl":["ru"],cs:or,csb:lr,cv:cr,"de-at":["de"],"de-ch":["de"],"de-formal":["de"],dsb:dr,dtp:Dr,dty:fr,egl:hr,eml:pr,"en-ca":["en"],"en-gb":["en"],"es-419":["es"],"es-formal":["es"],ext:gr,ff:mr,fit:br,frc:Cr,frp:Ar,frr:Fr,fur:Er,gag:vr,gan:wr,"gan-hans":["zh-hans"],"gan-hant":["zh-hant","zh-hans"],gcr:yr,gl:Br,glk:$r,gn:kr,gom:xr,"gom-deva":["hi"],gor:_r,gsw:Sr,guc:Tr,hak:Or,hif:Pr,hrx:Ir,hsb:Nr,ht:zr,"hu-formal":["hu"],hyw:Mr,ii:jr,inh:Rr,io:qr,iu:Lr,jam:Ur,jut:Jr,jv:Kr,kaa:Vr,kab:Gr,kbd:Wr,kbp:Hr,khw:Zr,kiu:Yr,kjp:Xr,kk:Qr,"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:eu,"ko-kp":["ko"],koi:tu,krc:nu,krl:ru,ks:uu,ksh:su,ku:au,"ku-arab":["ckb"],kum:iu,kv:ou,lad:lu,lb:cu,lbe:du,lez:Du,li:fu,lij:hu,liv:pu,lki:gu,lld:mu,lmo:bu,ln:Cu,lrc:Au,ltg:Fu,luz:Eu,lzh:vu,lzz:wu,mad:yu,mai:Bu,"map-bms":["jv","id"],mdf:$u,mg:ku,mhr:xu,min:_u,mnw:Su,mo:Tu,mrj:Ou,"ms-arab":["ms"],mwl:Pu,myv:Iu,mzn:Nu,nah:zu,nan:Mu,nap:ju,nb:Ru,nds:qu,"nds-nl":["nl"],nia:Lu,"nl-informal":["nl"],nn:Uu,nrm:Ju,oc:Ku,olo:Vu,os:Gu,pcd:Wu,pdc:Hu,pdt:Zu,pfl:Yu,pih:Xu,pms:Qu,pnt:es,pt:ts,"pt-br":["pt"],qu:ns,qug:rs,rgn:us,rmy:ss,"roa-tara":["it"],rue:as,rup:is,ruq:os,"ruq-cyrl":["mk"],"ruq-latn":["ro"],sa:ls,sah:cs,scn:ds,sco:Ds,sdc:fs,sdh:hs,ses:ps,sg:gs,sgs:ms,sh:bs,shi:Cs,shy:As,"shy-latn":["fr"],sk:Fs,skr:Es,"skr-arab":["ur","pnb"],sli:vs,smn:ws,sr:ys,srn:Bs,stq:$s,sty:ks,su:xs,szl:_s,szy:Ss,tay:Ts,tcy:Os,tet:Ps,tg:Is,trv:Ns,tt:zs,"tt-cyrl":["ru"],ty:Ms,tyv:js,udm:Rs,ug:qs,vec:Ls,vep:Us,vls:Js,vmf:Ks,vot:Vs,vro:Gs,wa:Ws,wo:Hs,wuu:Zs,xal:Ys,xmf:Xs,yi:Qs,za:ea,zea:ta,zgh:na,zh:ra,"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 re=class{constructor(e){this.locale=e}convertPlural(e,t){const n=/\d+=/i;if(!t||t.length===0)return"";for(let u=0;u<t.length;u++){const s=t[u];if(n.test(s)){if(parseInt(s.slice(0,s.indexOf("=")),10)===e)return s.slice(s.indexOf("=")+1);t[u]=void 0}}t=t.filter(u=>!!u);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),u=r.resolvedOptions().pluralCategories,s=r.select(e);return n.filter(a=>u.includes(a)).indexOf(s)}convertNumber(e,t=!1){let n=this.digitTransformTable(this.locale),r="";if(t){if(parseFloat(e,10)===e||!n)return e;const u=[];for(const a in n)u[n[a]]=a;n=u;const s=String(e);for(let a=0;a<s.length;a++)r+=n[s[a]]||s[a];return parseFloat(r,10)}if(Intl.NumberFormat){let u;const s=[...bt[this.locale]||[],"en"];return Intl.NumberFormat.supportedLocalesOf(this.locale).length?u=[this.locale]:u=s,r=new Intl.NumberFormat(u).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 mt[e]?mt[e].split(""):!1}},ua=class extends re{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}},sa=class extends re{convertGrammar(t,n){switch(n){case"instrumental":t="s "+t;break;case"lokativ":t="o "+t;break}return t}},aa=class extends re{convertGrammar(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e;break}return e}},ia=class extends re{convertGrammar(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e;break}return e}},oa=class extends re{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}},la=class extends re{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 ca extends re{convertGrammar(t,n){switch(n){case"mestnik":t="o "+t;break;case"orodnik":t="z "+t;break}return t}}let da=class extends re{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 Da extends re{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 fa=class extends re{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}},ha=class extends re{convertGrammar(e,t){switch(t){case"rol":e+="ról";break;case"ba":e+="ba";break;case"k":e+="k";break}return e}},pa=class extends re{convertGrammar(e,t){let n,r,u,s;switch(n="мæ",r="",u="",s="",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)||(u="-"),t){case"genitive":s=u+r+"ы";break;case"dative":s=u+r+"æн";break;case"allative":s=u+n;break;case"ablative":r==="й"?s=u+r+"æ":s=u+r+"æй";break;case"superessive":s=u+r+"ыл";break;case"equative":s=u+r+"ау";break;case"comitative":s=u+"имæ";break}return e+s}};class ga extends re{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 Ct={bs:sa,default:re,dsb:aa,fi:oa,ga:fa,he:ua,hsb:ia,hu:ha,hy:Da,la:da,os:pa,ru:la,sl:ca,uk:ga};const ma=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 At=class{constructor(e){this.locale=ye(e),this.language=new(Ct[this.locale]||Ct.default)(this.locale)}emit(e,t){let n,r,u;switch(typeof e){case"string":case"number":n=e;break;case"object":if(r=e.slice(1).map(s=>this.emit(s,t)),u=e[0].toLowerCase(),typeof this[u]=="function")n=this[u](r,t);else throw new Error('unknown operation "'+u+'"');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=ba(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,u="";for(const a in n)u+=` ${a}="${n[a]}"`;Array.isArray(r)||(r=[r]);const s=r.join("");return`<${t}${u}>${s}</${t}>`}};function ye(e){return typeof e=="string"?e.toLowerCase():e}function ba(e){const t=e.match(ma);return t?t[2]===void 0?"ltr":"rtl":null}function Ca(e,{wikilinks:t=!1}={}){let n=0;function r(o){return()=>{for(let g=0;g<o.length;g++){const $=o[g]();if($!==null)return $}return null}}function u(o){const g=n,$=[];for(let V=0;V<o.length;V++){const X=o[V]();if(X===null)return n=g,null;$.push(X)}return $}function s(o,g){return()=>{const $=n,V=[];let X=g();for(;X!==null;)V.push(X),X=g();return V.length<o?(n=$,null):V}}function a(o){const g=o.length;return()=>{let $=null;return e.slice(n,n+g)===o&&($=o,n+=g),$}}function i(o){return()=>{const g=e.slice(n).match(o);return g===null?null:(n+=g[0].length,g[0])}}const C=i(/^\s+/),y=a("|"),p=a(":"),T=a("\\"),ue=i(/^./),ie=a("$"),de=i(/^\d+/),L=a('"'),G=a("'"),ee=i(t?/^[^{}[\]$<\\]/:/^[^{}$<\\]/),te=i(t?/^[^{}[\]$\\|]/:/^[^{}$\\|]/),U=i(t?/^[^{}[\]$\s]/:/^[^{}$\s]/);function z(o,g){return()=>{const $=o();return $===null?null:g($)}}function W(){const o=s(1,J)();return o===null?null:o.join("")}function oe(){const o=s(1,F)();return o===null?null:o.join("")}const he=r([B,U]);function ge(){const o=s(1,he)();return o===null?null:o.join("")}function B(){const o=u([T,ue]);return o===null?null:o[1]}const J=r([B,te]),F=r([B,ee]);function se(){const o=u([ie,de]);return o===null?null:["REPLACE",parseInt(o[1],10)-1]}const m=z(i(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/),function(o){return o.toString()});function De(){const o=u([y,s(0,Y)]);if(o===null)return null;const g=o[1];return g.length>1?["CONCAT"].concat(g):g[0]}function _e(){const o=u([m,p,se]);return o===null?null:[o[0],o[2]]}function le(){const o=u([m,p,Y]);return o===null?null:[o[0],o[2]]}function Se(){const o=u([m,p]);return o===null?null:[o[0],""]}const Te=r([function(){const o=u([r([_e,le,Se]),s(0,De)]);return o===null?null:o[0].concat(o[1])},function(){const o=u([m,s(0,De)]);return o===null?null:[o[0]].concat(o[1])}]),Fe=a("{{"),Ee=a("}}"),Ce=a("[["),Oe=a("]]"),Pe=a("["),Ae=a("]");function d(){const o=u([Fe,Te,Ee]);return o===null?null:o[1]}function E(){const o=u([s(1,Y),y,s(1,K)]);return o===null?null:[["CONCAT"].concat(o[0]),["CONCAT"].concat(o[2])]}function D(){const o=u([s(1,Y)]);return o===null?null:[["CONCAT"].concat(o[0])]}const f=r([E,D]);function v(){let o=null;const g=u([Ce,f,Oe]);if(g!==null){const $=g[1];o=["WIKILINK"].concat($)}return o}function I(){let o=null;const g=u([Pe,s(1,H),C,s(1,K),Ae]);return g!==null&&(o=["EXTLINK",g[1].length===1?g[1][0]:["CONCAT"].concat(g[1]),["CONCAT"].concat(g[3])]),o}const P=i(/^[A-Za-z]+/);function h(o,g,$,V={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(o=o.toLowerCase(),g=g.toLowerCase(),o!==g||V.allowedHtmlElements.indexOf(o)===-1)return!1;const X=/[\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 ne=0,ve=$.length;ne<ve;ne+=2){const me=$[ne];if(V.allowedHtmlCommonAttributes.indexOf(me)===-1&&(V.allowedHtmlAttributesByElement[o]||[]).indexOf(me)===-1||me==="style"&&$[ne+1].search(X)!==-1)return!1}return!0}function l(){const o=i(/^[^"]*/),g=u([L,o,L]);return g===null?null:g[1]}function b(){const o=i(/^[^']*/),g=u([G,o,G]);return g===null?null:g[1]}function k(){const o=i(/^\s*=\s*/),g=u([C,P,o,r([l,b])]);return g===null?null:[g[1],g[3]]}function q(){const o=s(0,k)();return Array.prototype.concat.apply(["HTMLATTRIBUTES"],o)}function M(){let o=null;const g=n,$=a("<"),V=i(/^\/?/),X=i(/^\s*>/),ne=u([$,P,q,V,X]);if(ne===null)return null;const ve=n,me=ne[1],rt=s(0,K)(),oi=n,li=a("</"),Ot=u([li,P,X]);if(Ot===null)return["CONCAT",e.slice(g,ve)].concat(rt);const ci=n,di=Ot[1],Pt=ne[2],Di=Pt.slice(1);if(h(me,di,Di))o=["HTMLELEMENT",me,Pt].concat(rt);else{const It=fi=>fi.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");o=["CONCAT",It(e.slice(g,ve))].concat(rt,It(e.slice(oi,ci)))}return o}const H=r([d,se,v,I,ge]),K=r([d,se,v,I,M,oe]),Y=r([d,se,W]);function j(){const o=s(0,K)();return o===null?null:["CONCAT"].concat(o)}const fe=j();if(fe===null||n!==e.length)throw new Error("Parse error at position "+n.toString()+" in input: "+e);return fe}class Ft{constructor(t,{wikilinks:n=!1}={}){this.locale=ye(t),this.wikilinks=n,this.emitter=new At(this.locale)}parse(t,n){if(t.includes("{{")||t.includes("<")||this.wikilinks&&t.includes("[")){const r=Ca(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,u)=>{const s=parseInt(u,10)-1;return n[s]!==void 0?n[s]:"$"+u})}}class Aa{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 Fa{constructor(t,{finalFallback:n="en",messages:r=void 0,wikilinks:u=!1}={}){this.locale=ye(t),this.parser=new Ft(this.locale,{wikilinks:u}),this.messageStore=new Aa,r&&this.load(r,this.locale),this.finalFallback=n,this.wikilinks=u}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 Ft(this.locale,{wikilinks:this.wikilinks})}getFallbackLocales(){return[...bt[this.locale]||[],this.finalFallback]}getMessage(t){let n=this.locale,r=0;const u=this.getFallbackLocales(this.locale);for(;n;){const s=n.split("-");let a=s.length;do{const i=s.slice(0,a).join("-"),C=this.messageStore.getMessage(t,i);if(typeof C=="string")return C;a--}while(a);n=u[r],r++}return t}registerParserPlugin(t,n){At.prototype[t]=n}}const Et={"@metadata":{authors:["Mason Payne"],"last-updated":"2024-01-08",locale:"en"},"sa-login":"Login","sa-username":"Username","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 username or password","sa-error.register":"Invalid username 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"},Ea={en:Et,fr:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"fr"},"sa-login":"Connexion","sa-username":"Nom d'utilisateur","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":"Nom d'utilisateur ou mot de passe invalide","sa-error.register":"Nom d'utilisateur 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é"},es:{"@metadata":{authors:["Mason Payne"],"last-updated":"2022-05-28",locale:"es"},"sa-login":"Acceso","sa-username":"Nombre de usuario","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":"Usuario o contraseña invalido","sa-error.register":"Usuario o contraseña invalido","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"},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":"無効または期限切れのリセットコード"}};function Xe(e){const t=new Fa("en",{messages:Et});return e!=="en"&&(t.load(Ea[e],e),t.setLocale(e)),t}function vt(e){const t="==".slice(0,(4-e.length%4)%4),n=e.replace(/-/g,"+").replace(/_/g,"/")+t,r=atob(n),u=new ArrayBuffer(r.length),s=new Uint8Array(u);for(let a=0;a<r.length;a++)s[a]=r.charCodeAt(a);return u}function wt(e){const t=new Uint8Array(e);let n="";for(const s of t)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var _="copy",ae="convert";function Be(e,t,n){if(t===_)return n;if(t===ae)return e(n);if(t instanceof Array)return n.map(r=>Be(e,t[0],r));if(t instanceof Object){const r={};for(const[u,s]of Object.entries(t)){if(s.derive){const a=s.derive(n);a!==void 0&&(n[u]=a)}if(!(u in n)){if(s.required)throw new Error(`Missing key: ${u}`);continue}if(n[u]==null){r[u]=null;continue}r[u]=Be(e,s.schema,n[u])}return r}}function Qe(e,t){return{required:!0,schema:e,derive:t}}function O(e){return{required:!0,schema:e}}function N(e){return{required:!1,schema:e}}var yt={type:O(_),id:O(ae),transports:N(_)},Bt={appid:N(_),appidExclude:N(_),credProps:N(_)},$t={appid:N(_),appidExclude:N(_),credProps:N(_)},va={publicKey:O({rp:O(_),user:O({id:O(ae),name:O(_),displayName:O(_)}),challenge:O(ae),pubKeyCredParams:O(_),timeout:N(_),excludeCredentials:N([yt]),authenticatorSelection:N(_),attestation:N(_),extensions:N(Bt)}),signal:N(_)},wa={type:O(_),id:O(_),rawId:O(ae),authenticatorAttachment:N(_),response:O({clientDataJSON:O(ae),attestationObject:O(ae),transports:Qe(_,e=>{var t;return((t=e.getTransports)==null?void 0:t.call(e))||[]})}),clientExtensionResults:Qe($t,e=>e.getClientExtensionResults())},ya={mediation:N(_),publicKey:O({challenge:O(ae),timeout:N(_),rpId:N(_),allowCredentials:N([yt]),userVerification:N(_),extensions:N(Bt)}),signal:N(_)},Ba={type:O(_),id:O(_),rawId:O(ae),authenticatorAttachment:N(_),response:O({clientDataJSON:O(ae),authenticatorData:O(ae),signature:O(ae),userHandle:O(ae)}),clientExtensionResults:Qe($t,e=>e.getClientExtensionResults())};function $a(e){return Be(vt,va,e)}function ka(e){return Be(wt,wa,e)}function xa(e){return Be(vt,ya,e)}function _a(e){return Be(wt,Ba,e)}async function Sa(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>ka(t),t}async function Ta(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>_a(t),t}function et(e){this.message=e}et.prototype=new Error,et.prototype.name="InvalidCharacterError";var kt=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new et("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,u=0,s=0,a="";r=t.charAt(s++);~r&&(n=u%4?64*n+r:r,u++%4)?a+=String.fromCharCode(255&n>>(-2*u&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function Oa(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(kt(n).replace(/(.)/g,function(r,u){var s=u.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}(t)}catch{return kt(t)}}function Le(e){this.message=e}function Pa(e,t){if(typeof e!="string")throw new Le("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(Oa(e.split(".")[n]))}catch(r){throw new Le("Invalid token specified: "+r.message)}}Le.prototype=new Error,Le.prototype.name="InvalidTokenError";const Ue="spartan-token";function xt(){const e=localStorage.getItem(Ue);let t=null;if(e)try{if(t=Pa(e),t.exp>Na())return t;localStorage.removeItem(Ue)}catch(n){console.error("Error decoding token",n),localStorage.removeItem(Ue)}return null}function Ia(){const e=localStorage.getItem(Ue);return e||null}function Na(){return Math.round(new Date().getTime()/1e3)}var za=x(`<form class=login-frame><style>.login-frame {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: stretch;
|
|
6
|
+
border: 1px solid #ccc;
|
|
7
|
+
padding: 40px 40px;
|
|
8
|
+
max-width: 350px;
|
|
9
|
+
min-width: 290px;
|
|
10
|
+
background-color: rgba(255,255,255,0.9);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
.login-frame h1 {
|
|
15
|
+
margin: 0;
|
|
16
|
+
align-self: start;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.login-frame input, .login-frame button, .login-frame select {
|
|
20
|
+
margin: 20px 0 0 0;
|
|
21
|
+
padding: 10px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.login-frame .checkbox-wrapper {
|
|
25
|
+
align-self: start;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.login-frame button {
|
|
30
|
+
background-color: #00f0f0;
|
|
31
|
+
border: 1px solid #ccc;
|
|
32
|
+
color: #333;
|
|
33
|
+
border-radius: 10px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.login-frame select {
|
|
37
|
+
background-color: #ffffff;
|
|
38
|
+
border: 1px solid #ccc;
|
|
39
|
+
color: #333;
|
|
40
|
+
border-radius: 10px;
|
|
41
|
+
font-size: inherit;
|
|
42
|
+
font-family: inherit;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
appearance: none;
|
|
45
|
+
-webkit-appearance: none;
|
|
46
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
|
|
47
|
+
background-repeat: no-repeat;
|
|
48
|
+
background-position: right 12px center;
|
|
49
|
+
padding-right: 32px;
|
|
50
|
+
width: 100%;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.login-frame select:focus {
|
|
55
|
+
outline: none;
|
|
56
|
+
border-color: #00f0f0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.login-frame .error-message {
|
|
60
|
+
color: red;
|
|
61
|
+
// margin: 10px 0;
|
|
62
|
+
}
|
|
63
|
+
.centered-text {
|
|
64
|
+
text-align: center;
|
|
65
|
+
}
|
|
66
|
+
</style><style></style><h1></h1><input type=text><button type=submit>`),Ma=x("<span class=error-message>"),tt=x("<span>"),_t=x("<input type=password>"),ja=x("<p>"),Ra=x("<select>"),qa=x("<option> (<!>)"),La=x("<input type=text>"),Ua=x("<input type=text autocomplete=one-time-code>"),Ja=x("<input type=password autocomplete=new-password>"),Ka=x("<span class=checkbox-wrapper><input type=checkbox><span> "),nt=x("<a class=centered-text href=#>");Ye("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]=w(e.startMode),[r,u]=w(""),[s,a]=w(""),[i,C]=w(""),[y,p]=w(""),[T,ue]=w(e.redirect),[ie,de]=w(!1),[L,G]=w(!1),[ee,te]=w(!1),[U,z]=w(""),[W,oe]=w(""),[he,ge]=w([]),[B,J]=w(""),F=Xe(e.locale);let se,m;try{m=e.styles}catch{m=""}console.log(m),Ve(async()=>{if(xt()&&e.redirect!==""&&window.location.pathname!==e.redirect){window.location.href=e.redirect;return}De()});function De(){fetch(`${e.domain}/api/v1/sectors/${e.sector}/publicsettings`,{method:"GET",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"}}).then(d=>{if(d.ok)return d.json();throw new Error("Network response was not ok.")}).then(d=>{console.log(d),de(d.SelfSignUpAllowed)}).catch(d=>{console.log(d),p(d.message)})}function _e(d){d.preventDefault(),console.log("login"),p(""),t()==="password"?Te():t()==="webauthn"?Se():t()==="otp-pick"?Ce(B()):t()==="otp"?Oe():t()==="reset-email"?Pe():t()==="reset-code"&&Ae()}function le(d){d.preventDefault(),console.log("signup"),p(""),G(!1),fetch(`${e.domain}/api/v1/users`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:s(),sectorID:e.sector})}).then(E=>{if(E.ok)return E.json();throw new Error(F.i18n("sa-error-creating-user"))}).then(E=>{console.log(E),G(!0),n(e.startMode)}).catch(E=>{G(!1),p(E.message),console.log(E)})}function Se(){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(d=>{if(d.ok)return d.json();throw d.status===401?(n("password"),p(F.i18n("webauthn-not-enrolled")),new Error(F.i18n("webauthn-not-enrolled"))):new Error(`${d.status} ${d.statusText}: Network response was not ok.`)}).then(d=>{console.log(d);const E=xa(d.CredentialAssertion);return console.log("Parsed WebAuthn request options:",E),Ta(E).then(D=>{const f=JSON.stringify(D);let v=JSON.parse(f);return v.transactionID=d.TransactionID,v})}).then(d=>fetch(`${e.domain}/api/v1/login/webauthn/finish`,{method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify(d)})).then(Fe).catch(d=>{p(d.message),console.log(d)})}function Te(){console.log("password login"),fetch(e.domain+"/api/v1/login/password",{method:"post",mode:"cors",cache:"no-cache",body:JSON.stringify({username:r(),password:s(),sectorID:e.sector})}).then(Fe)}async function Fe(d){let E=Promise.resolve(d);return E.then(D=>{if(d.ok)return d.json();throw new Error("Network response was not ok.")}).then(D=>{if(console.log(D),localStorage.setItem("spartan-txid",D.transactionID),!D.token){D.challengeType.indexOf("otp")!==-1?Ee():D.challengeType.indexOf("webauthn")!==-1?(n("webauthn"),p(F.i18n("sa-webauthn-required"))):p(F.i18n("sa-unknown-challenge"));return}localStorage.setItem("spartan-token",D.token);const f=new CustomEvent("spartan-login",{bubbles:!0,cancelable:!0,detail:{token:D.token,transactionID:D.transactionID}});se.getRootNode().host.dispatchEvent(f),T()!==""&&(window.location.href=T())}).catch(D=>{D.json().then(f=>{console.log(f.message),p(f.message)}).catch(f=>{console.log(f)}),console.log(D)}),E}function Ee(){const d=localStorage.getItem("spartan-txid")||"";fetch(e.domain+`/api/v1/otp/${encodeURIComponent(r())}?transactionID=${encodeURIComponent(d)}§orID=${encodeURIComponent(e.sector)}`,{method:"get",mode:"cors",cache:"no-cache"}).then(E=>{if(E.ok)return E.json();throw new Error(F.i18n("error-otp-list"))}).then(E=>{const D=E.registrations||[];if(D.length===0){p(F.i18n("sa-otp-no-registrations"));return}D.length===1?Ce(D[0].ID||""):(ge(D),J(D[0].ID||""),n("otp-pick"),p(""))}).catch(E=>{p(E.message),console.log(E)})}function Ce(d){console.log("begin OTP, registrationID:",d),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:d,sectorID:e.sector})}).then(E=>{if(E.ok)return E.json();throw new Error(`${E.status} ${E.statusText}`)}).then(E=>{console.log(E),E.transactionID&&localStorage.setItem("spartan-txid",E.transactionID),C(""),p(""),n("otp")}).catch(E=>{p(E.message),console.log(E)})}function Oe(){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:i(),transactionID:localStorage.getItem("spartan-txid"),sectorID:e.sector})}).then(Fe)}function Pe(){console.log("begin password reset"),p(""),te(!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(d=>{if(d.ok)return d.json();throw new Error(F.i18n("sa-reset-error"))}).then(d=>{console.log(d),p(F.i18n("sa-reset-email-sent")),z(""),oe(""),n("reset-code")}).catch(d=>{p(d.message),console.log(d)})}function Ae(){console.log("complete password reset"),p(""),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:U().toUpperCase().trim(),newPassword:W(),sectorID:e.sector})}).then(d=>{if(d.ok)return d.json();throw d.status===400?new Error(F.i18n("sa-reset-error-code")):new Error(F.i18n("sa-reset-error"))}).then(d=>{console.log(d),te(!0),z(""),oe(""),a(""),n(e.startMode)}).catch(d=>{p(d.message),console.log(d)})}return(()=>{var d=za(),E=d.firstChild,D=E.nextSibling,f=D.nextSibling,v=f.nextSibling,I=v.nextSibling,P=se;return typeof P=="function"?Dt(P,d):se=d,d.addEventListener("submit",h=>{t()==="sign-up"?le(h):_e(h)}),c(D,m),c(f,(()=>{var h=A(()=>t()==="reset-email"||t()==="reset-code");return()=>h()?F.i18n("sa-reset-password"):F.i18n("sa-login")})()),c(d,y&&(()=>{var h=Ma();return c(h,y),h})(),v),c(d,(()=>{var h=A(()=>!!L());return()=>h()&&(()=>{var l=tt();return c(l,()=>F.i18n("sa-signup-complete")),l})()})(),v),c(d,(()=>{var h=A(()=>!!ee());return()=>h()&&(()=>{var l=tt();return c(l,()=>F.i18n("sa-reset-success")),l})()})(),v),v.$$input=h=>u(h.currentTarget.value),c(d,(()=>{var h=A(()=>t()!=="sign-up");return()=>h()&&[A(()=>A(()=>t()==="password")()&&(()=>{var l=_t();return l.$$input=b=>a(b.currentTarget.value),S(()=>ce(l,"placeholder",F.i18n("sa-password"))),S(()=>l.value=s()),l})()),A(()=>A(()=>t()==="webauthn")()&&tt()),A(()=>A(()=>t()==="otp-pick")()&&[(()=>{var l=ja();return c(l,()=>F.i18n("sa-otp-choose")),l})(),(()=>{var l=Ra();return l.addEventListener("change",b=>J(b.currentTarget.value)),c(l,()=>he().map(b=>(()=>{var k=qa(),q=k.firstChild,M=q.nextSibling;return M.nextSibling,c(k,()=>b.DisplayName||b.ID,q),c(k,()=>b.Type,M),S(()=>k.value=b.ID),k})())),S(()=>l.value=B()),l})()]),A(()=>A(()=>t()==="otp")()&&(()=>{var l=La();return l.$$input=b=>C(b.currentTarget.value),S(()=>ce(l,"placeholder",F.i18n("sa-code"))),S(()=>l.value=i()),l})()),A(()=>A(()=>t()==="reset-code")()&&[(()=>{var l=Ua();return l.$$input=b=>z(b.currentTarget.value),S(()=>ce(l,"placeholder",F.i18n("sa-reset-code"))),S(()=>l.value=U()),l})(),(()=>{var l=Ja();return l.$$input=b=>oe(b.currentTarget.value),S(()=>ce(l,"placeholder",F.i18n("sa-new-password"))),S(()=>l.value=W()),l})()]),A(()=>A(()=>t()==="password"||t()==="webauthn")()&&(()=>{var l=Ka(),b=l.firstChild,k=b.nextSibling;return k.firstChild,l.$$click=()=>n(t()==="password"?"webauthn":"password"),c(k,()=>F.i18n("sa-use-password"),null),S(()=>b.checked=t()==="password"),l})())]})(),I),c(d,(()=>{var h=A(()=>t()==="sign-up");return()=>h()&&(()=>{var l=_t();return l.$$input=b=>a(b.currentTarget.value),S(()=>ce(l,"placeholder",F.i18n("sa-password"))),S(()=>l.value=s()),l})()})(),I),c(I,(()=>{var h=A(()=>t()==="sign-up");return()=>h()?F.i18n("sa-signup"):A(()=>t()==="otp-pick")()?F.i18n("sa-otp-send-code"):A(()=>t()==="otp")()?F.i18n("sa-otp-verify"):A(()=>t()==="reset-email")()?F.i18n("sa-otp-send-code"):A(()=>t()==="reset-code")()?F.i18n("sa-reset-submit"):F.i18n("sa-login")})()),c(d,(()=>{var h=A(()=>t()==="password");return()=>h()&&(()=>{var l=nt();return l.$$click=()=>{p(""),te(!1),n("reset-email")},c(l,()=>F.i18n("sa-forgot-password")),l})()})(),null),c(d,(()=>{var h=A(()=>t()==="reset-email"||t()==="reset-code");return()=>h()&&(()=>{var l=nt();return l.$$click=()=>{p(""),z(""),oe(""),n(e.startMode)},c(l,()=>F.i18n("sa-back")),l})()})(),null),c(d,(()=>{var h=A(()=>!!(ie()&&t()!=="reset-email"&&t()!=="reset-code"));return()=>h()&&(()=>{var l=nt();return l.$$click=()=>t()==="sign-up"?n(e.startMode):n("sign-up"),c(l,(()=>{var b=A(()=>t()==="sign-up");return()=>b()?F.i18n("sa-back"):F.i18n("sa-signup")})()),l})()})(),null),S(h=>{var l=F.i18n("sa-username"),b=t()==="otp"||t()==="otp-pick"||t()==="reset-code";return l!==h.e&&ce(v,"placeholder",h.e=l),b!==h.t&&(v.disabled=h.t=b),h},{e:void 0,t:void 0}),S(()=>v.value=r()),d})()}),We(["input","click"]);var Va=x(`<div class=container><style>.container {
|
|
67
|
+
background-color: #ffffff;
|
|
68
|
+
border-radius: 10px;
|
|
69
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
70
|
+
padding: 20px;
|
|
71
|
+
width: 400px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.header {
|
|
75
|
+
text-align: center;
|
|
76
|
+
font-size: 24px;
|
|
77
|
+
margin-bottom: 20px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.section {
|
|
81
|
+
margin-bottom: 20px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.section h2 {
|
|
85
|
+
font-size: 18px;
|
|
86
|
+
margin-bottom: 10px;
|
|
87
|
+
border-bottom: 2px solid #e0e0e0;
|
|
88
|
+
padding-bottom: 5px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.error-message {
|
|
92
|
+
color: red;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.security-keys, .mfa-manage {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.key-item, .mfa-item, .add-key-item {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: space-between;
|
|
104
|
+
margin-bottom: 10px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.key-item span {
|
|
108
|
+
flex-grow: 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.mfa-item label, .add-key-item label {
|
|
112
|
+
margin-right: 10px;
|
|
113
|
+
width: 50px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.mfa-item input, .add-key-item input {
|
|
117
|
+
flex-grow: 1;
|
|
118
|
+
padding: 5px;
|
|
119
|
+
margin-right: 10px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.mfa-item button, .add-key-item button {
|
|
123
|
+
justify-self: start;
|
|
124
|
+
flex-grow: 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.btn {
|
|
128
|
+
padding: 5px 10px;
|
|
129
|
+
border: none;
|
|
130
|
+
border-radius: 5px;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.btn.add {
|
|
135
|
+
background-color: #007bff;
|
|
136
|
+
color: #ffffff;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.btn.remove {
|
|
140
|
+
background-color: #999;
|
|
141
|
+
color: #ffffff;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.btn.validate {
|
|
145
|
+
background-color: #28a745;
|
|
146
|
+
color: #ffffff;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
table {
|
|
150
|
+
width: 100%;
|
|
151
|
+
border-collapse: collapse;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
table, th, td {
|
|
155
|
+
border: 1px solid #e0e0e0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
th, td {
|
|
159
|
+
padding: 10px;
|
|
160
|
+
text-align: left;
|
|
161
|
+
max-width: 100px;
|
|
162
|
+
text-overflow: ellipsis;
|
|
163
|
+
overflow: hidden;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
th {
|
|
167
|
+
background-color: #f9f9f9;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.modal {
|
|
171
|
+
display: flex;
|
|
172
|
+
position: fixed;
|
|
173
|
+
z-index: 1;
|
|
174
|
+
left: 0;
|
|
175
|
+
top: 0;
|
|
176
|
+
width: 100%;
|
|
177
|
+
height: 100%;
|
|
178
|
+
overflow: auto;
|
|
179
|
+
background-color: rgba(0, 0, 0, 0.4); /* Black background with opacity */
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* Modal content */
|
|
185
|
+
.modal-content {
|
|
186
|
+
background-color: #ffffff;
|
|
187
|
+
margin: auto;
|
|
188
|
+
padding: 20px;
|
|
189
|
+
border: 1px solid #888;
|
|
190
|
+
width: 300px;
|
|
191
|
+
border-radius: 10px;
|
|
192
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
|
193
|
+
position: relative;
|
|
194
|
+
text-align: center;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Close button */
|
|
198
|
+
.close {
|
|
199
|
+
color: #aaa;
|
|
200
|
+
float: right;
|
|
201
|
+
font-size: 28px;
|
|
202
|
+
font-weight: bold;
|
|
203
|
+
position: absolute;
|
|
204
|
+
top: 10px;
|
|
205
|
+
right: 15px;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.close:hover,
|
|
210
|
+
.close:focus {
|
|
211
|
+
color: #000;
|
|
212
|
+
text-decoration: none;
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* Input and button styling */
|
|
217
|
+
.modal-content input {
|
|
218
|
+
width: calc(100% - 40px);
|
|
219
|
+
padding: 10px;
|
|
220
|
+
margin: 10px 0;
|
|
221
|
+
border: 1px solid #ccc;
|
|
222
|
+
border-radius: 5px;
|
|
223
|
+
box-sizing: border-box;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.modal-content .btn.verify {
|
|
227
|
+
background-color: #007bff;
|
|
228
|
+
color: white;
|
|
229
|
+
padding: 10px 20px;
|
|
230
|
+
border: none;
|
|
231
|
+
border-radius: 5px;
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
margin-top: 10px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.modal-content .btn.verify:hover {
|
|
237
|
+
background-color: #0056b3;
|
|
238
|
+
}
|
|
239
|
+
</style><style></style><h1 class=header>`),St=x("<span class=error-message>"),Ga=x("<div class=section><h2></h2><div class=security-keys>"),Wa=x('<div class=key-item><span></span><button class="btn remove">'),Tt=x("<span>"),Ha=x("<div class=section><div class=security-keys>"),Za=x('<button class="btn add">+ '),Ya=x('<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">'),Xa=x("<div class=section><h2></h2><table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>"),Qa=x('<tr class=mfa-list-item><td></td><td></td><td><button class="btn remove">'),ei=x('<span> <button class="btn validate">'),ti=x('<div class=section><div class=mfa-manage><button class="btn add">+ '),ni=x('<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">'),ri=x('<div class=modal id=mfaModal><div class=modal-content><span class=close id=closeModal>×</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');Ye("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=>{w(""),w("");const[t,n]=w(""),[r,u]=w(""),[s,a]=w(""),[i,C]=w(e.showWebAuthn),[y,p]=w(!1),[T,ue]=w(!1),[ie,de]=w(!1),[L,G]=w(!1),[ee,te]=w([]),[U,z]=w([]),[W,oe]=w(""),[he,ge]=w(""),[B,J]=w(""),[F,se]=w(""),m=Xe(e.locale);let De;try{De=e.styles}catch{De=""}Ve(async()=>{if(xt())ue(!0),u("");else{if(e.redirectOnUnauthenticated){window.location.href=e.redirect;return}ue(!1),u(m.i18n("not-authenticated"))}_e().then(f=>{console.log(f)}),await Ee(),Ae().then(f=>{z(f.registrations)})});async function _e(){return await(await fetch(`${e.domain}/api/v1/users/self`,le("get"))).json()}function le(D="get"){return{method:D,mode:"cors",cache:"no-cache",headers:{"Content-Type":"application",Authorization:`bearer ${Ia()}`}}}function Se(){let D=le("post");D.body=JSON.stringify({keyName:t(),sectorID:e.sector}),fetch(`${e.domain}/api/v1/webauthn/registration/begin`,D).then(f=>{if(f.status===200)return f.json();throw f}).then(f=>(console.log(f),Te(f))).catch(f=>{f.json?f.json().then(v=>{u(v.message)}):u(f)})}async function Te(D){try{const f=$a(D.Options);console.log("Parsed WebAuthn creation options:",f);const v=await Sa(f),I=JSON.stringify(v);let P=JSON.parse(I);P.transactionID=D.TransactionID;let h=le("post");h.body=JSON.stringify(P);const l=await fetch(`${e.domain}/api/v1/webauthn/registration/finish`,h);if(l.status!==200){const b=await l.json();u(b.message);return}p(!1),n(""),Ee()}catch(f){console.error("WebAuthn registration error:",f),u((f==null?void 0:f.message)||String(f))}}async function Fe(D){let f=le("delete");f.body=JSON.stringify({ID:D});try{if((await fetch(`${e.domain}/api/v1/webauthn/${D}`,f)).status!==200){u(m.i18n("error-webauthn-remove"));return}Ee()}catch(v){console.error(v),u(m.i18n("error-webauthn-remove"));return}}async function Ee(){let D=le("get");try{const v=await(await fetch(`${e.domain}/api/v1/webauthn/registration/list`,D)).json();te(v.registrations||[])}catch(f){console.error(f),te([])}}async function Ce(D,f){const v=await Oe(D,f);v&&(Ae().then(I=>{z(I.registrations)}),oe(v.transactionID),G(!0))}async function Oe(D,f){let v=le("post");v.body=JSON.stringify({destination:D,OTPType:E(f),sectorID:e.sector});try{const I=await fetch(`${e.domain}/api/v1/otp/begin`,v);if(I.status!==200){u(m.i18n("error-otp-verification"));return}return await I.json()}catch(I){console.error(I),u(m.i18n("error-otp-registration"));return}}async function Pe(D,f){let v=le("post");v.body=JSON.stringify({transactionID:D,password:f});try{const I=await fetch(`${e.domain}/api/v1/otp/finish`,v);if(I.status!==200){a(m.i18n("error-otp-verification"));return}return G(!1),ge(""),de(!1),se(""),J(""),Ae().then(P=>{z(P.registrations)}),await I.json()}catch(I){console.error(I),a(m.i18n("error-otp-registration"));return}}async function Ae(){let D=le("get");try{return await(await fetch(`${e.domain}/api/v1/otp/list`,D)).json()}catch(f){console.error(f),u(m.i18n("error-otp-list"));return}}async function d(D){let f=le("delete");f.body=JSON.stringify({ID:D});try{if((await fetch(`${e.domain}/api/v1/otp/${D}`,f)).status!==200){u(m.i18n("error-otp-remove"));return}Ae().then(I=>{z(I.registrations)})}catch(v){console.error(v),u(m.i18n("error-otp-remove"));return}}function E(D){return D==="EMAIL"?2:1}return(()=>{var D=Va(),f=D.firstChild,v=f.nextSibling,I=v.nextSibling;return c(v,De),c(I,()=>m.i18n("sa-account-settings")),c(D,r&&(()=>{var P=St();return c(P,r),P})(),null),c(D,(()=>{var P=A(()=>!!(i()&&ee().length));return()=>P()&&(()=>{var h=Ga(),l=h.firstChild,b=l.nextSibling;return c(l,()=>m.i18n("sa-webauthn-security-keys")),c(b,()=>ee().map(k=>(()=>{var q=Wa(),M=q.firstChild,H=M.nextSibling;return c(M,()=>k.keyName),H.$$click=()=>{confirm(m.i18n("sa-confirm-delete-key"))&&Fe(k.keyName)},c(H,()=>m.i18n("sa-remove")),q})()),null),c(b,(()=>{var k=A(()=>ee().length<=0);return()=>k()&&(()=>{var q=Tt();return c(q,()=>m.i18n("sa-no-security-keys")),q})()})(),null),h})()})(),null),c(D,(()=>{var P=A(()=>!!i());return()=>P()&&(()=>{var h=Ha(),l=h.firstChild;return c(l,(()=>{var b=A(()=>!y());return()=>b()&&(()=>{var k=Za();return k.firstChild,k.$$click=()=>p(!0),c(k,()=>m.i18n("sa-add-security-key"),null),k})()})(),null),c(l,(()=>{var b=A(()=>!!y());return()=>b()&&(()=>{var k=Ya(),q=k.firstChild,M=q.firstChild,H=M.nextSibling,K=H.nextSibling,Y=K.nextSibling;return c(M,()=>m.i18n("sa-webauthn-key-name")),H.$$input=j=>n(j.currentTarget.value),K.$$click=()=>p(!1),c(K,()=>m.i18n("sa-cancel")),Y.$$click=()=>t()!==""&&Se(),c(Y,()=>m.i18n("sa-register")),S(j=>{var fe=m.i18n("sa-webauthn-key-name"),o=t()==="";return fe!==j.e&&ce(H,"placeholder",j.e=fe),o!==j.t&&(Y.disabled=j.t=o),j},{e:void 0,t:void 0}),S(()=>H.value=t()),k})()})(),null),h})()})(),null),c(D,(()=>{var P=A(()=>U().length>0);return()=>P()&&(()=>{var h=Xa(),l=h.firstChild,b=l.nextSibling,k=b.firstChild,q=k.firstChild,M=q.firstChild,H=M.nextSibling,K=H.nextSibling,Y=k.nextSibling;return c(l,()=>m.i18n("sa-mfa")),c(M,()=>m.i18n("sa-mfa-destination")),c(H,()=>m.i18n("sa-mfa-validated")),c(K,()=>m.i18n("sa-mfa-action")),c(Y,()=>U().map(j=>(()=>{var fe=Qa(),o=fe.firstChild,g=o.nextSibling,$=g.nextSibling,V=$.firstChild;return c(o,()=>j.DisplayName),c(g,(()=>{var X=A(()=>!!j.Validated);return()=>X()?(()=>{var ne=Tt();return c(ne,()=>m.i18n("sa-yes")),ne})():(()=>{var ne=ei(),ve=ne.firstChild,me=ve.nextSibling;return c(ne,()=>m.i18n("sa-no"),ve),me.$$click=()=>{Ce(j.DisplayName,j.Type==="email"?"EMAIL":"SMS")},c(me,()=>m.i18n("sa-validate")),ne})()})()),V.$$click=()=>{confirm(m.i18n("sa-confirm-delete-key"))&&d(j.ID)},c(V,()=>m.i18n("sa-remove")),S(()=>ce(o,"title",j.DisplayName)),fe})())),h})()})(),null),c(D,(()=>{var P=A(()=>!ie());return()=>P()&&(()=>{var h=ti(),l=h.firstChild,b=l.firstChild;return b.firstChild,b.$$click=()=>de(!0),c(b,()=>m.i18n("sa-register-mfa"),null),h})()})(),null),c(D,(()=>{var P=A(()=>!!ie());return()=>P()&&(()=>{var h=ni(),l=h.firstChild,b=l.nextSibling,k=b.firstChild,q=k.firstChild,M=q.nextSibling,H=M.nextSibling,K=k.nextSibling,Y=K.firstChild,j=Y.nextSibling,fe=j.nextSibling,o=K.nextSibling,g=o.firstChild;return c(l,()=>m.i18n("sa-add-mfa")),c(q,()=>m.i18n("sa-email")),M.$$input=$=>J($.currentTarget.value),H.$$click=()=>Ce(B(),"EMAIL"),c(H,()=>m.i18n("sa-add-email")),c(Y,()=>m.i18n("sa-phone")),j.$$input=$=>se($.currentTarget.value),fe.$$click=()=>Ce(F(),"SMS"),c(fe,()=>m.i18n("sa-add-sms")),g.$$click=()=>de(!1),c(g,()=>m.i18n("sa-cancel")),S($=>{var V=m.i18n("sa-email"),X=m.i18n("sa-phone");return V!==$.e&&ce(M,"placeholder",$.e=V),X!==$.t&&ce(j,"placeholder",$.t=X),$},{e:void 0,t:void 0}),S(()=>M.value=B()),S(()=>j.value=F()),h})()})(),null),c(D,(()=>{var P=A(()=>!!L());return()=>P()&&(()=>{var h=ri(),l=h.firstChild,b=l.firstChild,k=b.nextSibling,q=k.nextSibling,M=q.nextSibling,H=M.nextSibling;return h.$$click=()=>G(!1),l.$$click=K=>K.stopPropagation(),b.$$click=()=>G(!1),c(l,(()=>{var K=A(()=>!!s());return()=>K()&&(()=>{var Y=St();return c(Y,s),Y})()})(),q),M.$$input=K=>ge(K.currentTarget.value),H.$$click=()=>Pe(W(),he()),S(()=>M.value=he()),h})()})(),null),D})()}),We(["click","input"]);var ui=x(`<form class=invite-frame><style>.invite-frame {
|
|
240
|
+
display: flex;
|
|
241
|
+
flex-direction: column;
|
|
242
|
+
justify-content: center;
|
|
243
|
+
align-items: stretch;
|
|
244
|
+
border: 1px solid #ccc;
|
|
245
|
+
padding: 40px 40px;
|
|
246
|
+
max-width: 350px;
|
|
247
|
+
min-width: 290px;
|
|
248
|
+
background-color: rgba(255,255,255,0.9);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.invite-frame h1 {
|
|
252
|
+
margin: 0;
|
|
253
|
+
align-self: start;
|
|
254
|
+
font-size: 1.5em;
|
|
255
|
+
margin-bottom: 10px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.invite-frame input, .invite-frame button {
|
|
259
|
+
margin: 15px 0 0 0;
|
|
260
|
+
padding: 10px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.invite-frame button {
|
|
264
|
+
background-color: #00f0f0;
|
|
265
|
+
border: 1px solid #ccc;
|
|
266
|
+
color: #333;
|
|
267
|
+
border-radius: 10px;
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.invite-frame button:disabled {
|
|
272
|
+
background-color: #ccc;
|
|
273
|
+
cursor: not-allowed;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.invite-frame .error-message {
|
|
277
|
+
color: red;
|
|
278
|
+
margin: 10px 0;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.invite-frame .success-message {
|
|
282
|
+
color: green;
|
|
283
|
+
margin: 10px 0;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.invite-frame .info-message {
|
|
287
|
+
color: #666;
|
|
288
|
+
margin: 10px 0;
|
|
289
|
+
font-size: 0.9em;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.invite-frame .hint {
|
|
293
|
+
color: #666;
|
|
294
|
+
font-size: 0.85em;
|
|
295
|
+
margin-top: 5px;
|
|
296
|
+
margin-bottom: 10px;
|
|
297
|
+
display: block;
|
|
298
|
+
}
|
|
299
|
+
</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>`),si=x("<span class=info-message>"),ai=x("<span class=error-message>"),ii=x("<span class=success-message>");Ye("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]=w(""),[r,u]=w(""),[s,a]=w(""),[i,C]=w(""),[y,p]=w(!1),T=Xe(e.locale);let ue,ie;try{ie=e.styles}catch{ie=""}Ve(async()=>{e.sub||new URLSearchParams(window.location.search).get("sub")||a("Missing invitation information. Please use the link from your invite email.");const G=new URLSearchParams(window.location.hash.replace("#","")).get("otp");G&&n(G)});async function de(L){var te,U;if(L.preventDefault(),a(""),C(""),p(!0),!t()||t().trim().length===0){a("Please enter your verification code"),p(!1);return}if(!r()||r().length<8){a("Password must be at least 8 characters"),p(!1);return}const G=new URLSearchParams(window.location.search),ee=e.sub||G.get("sub")||"";if(!ee){a("Missing invitation information"),p(!1);return}try{const z=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:ee,otp:t().toUpperCase().trim(),password:r(),sectorID:e.sector})});if(z.ok){const W=await z.json();C(T.i18n("sa-invite-success"));const oe=new CustomEvent("spartan-invite-complete",{bubbles:!0,cancelable:!0,detail:{sub:ee,success:!0}});ue&&ue.getRootNode().host.dispatchEvent(oe),setTimeout(()=>{e.redirect&&e.redirect!==""&&(window.location.href=e.redirect)},2e3)}else{const W=await z.json().catch(()=>({}));z.status===400||(te=W.message)!=null&&te.includes("invalid OTP")?a(T.i18n("sa-invite-error-otp")):z.status===504||(U=W.message)!=null&&U.includes("expired")?a(T.i18n("sa-invite-error-expired")):a(W.message||T.i18n("sa-invite-error-generic")),p(!1)}}catch(z){console.error("Error completing invite:",z),a(T.i18n("sa-invite-error-generic")),p(!1)}}return(()=>{var L=ui(),G=L.firstChild,ee=G.nextSibling,te=ee.nextSibling,U=te.nextSibling,z=U.nextSibling,W=z.nextSibling,oe=W.nextSibling,he=oe.nextSibling,ge=ue;return typeof ge=="function"?Dt(ge,L):ue=L,L.addEventListener("submit",de),c(ee,ie),c(te,()=>T.i18n("sa-complete-invite")),c(L,(()=>{var B=A(()=>!!e.email);return()=>B()&&(()=>{var J=si();return c(J,()=>e.email),J})()})(),U),c(L,(()=>{var B=A(()=>!!s());return()=>B()&&(()=>{var J=ai();return c(J,s),J})()})(),U),c(L,(()=>{var B=A(()=>!!i());return()=>B()&&(()=>{var J=ii();return c(J,i),J})()})(),U),U.$$input=B=>n(B.currentTarget.value),c(z,()=>T.i18n("sa-invite-otp-hint")),W.$$input=B=>u(B.currentTarget.value),c(oe,()=>T.i18n("sa-invite-password-hint")),c(he,(()=>{var B=A(()=>!!y());return()=>B()?T.i18n("sa-invite-completing"):T.i18n("sa-invite-submit")})()),S(B=>{var J=T.i18n("sa-invite-otp"),F=y()||i()!=="",se=T.i18n("sa-invite-password"),m=y()||i()!=="",De=y()||i()!=="";return J!==B.e&&ce(U,"placeholder",B.e=J),F!==B.t&&(U.disabled=B.t=F),se!==B.a&&ce(W,"placeholder",B.a=se),m!==B.o&&(W.disabled=B.o=m),De!==B.i&&(he.disabled=B.i=De),B},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),S(()=>U.value=t()),S(()=>W.value=r()),L})()}),We(["input"])});
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@masonitestudios/spartanauth-widgets",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "vite build"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/sa-widgets.umd.js",
|
|
9
|
+
"module": "dist/sa-widgets.mjs",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/SpartanAuth/login-widget.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "Apache-2.0",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^4.6.4",
|
|
20
|
+
"vite": "6.2.5",
|
|
21
|
+
"vite-plugin-solid": "^2.2.6"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@github/webauthn-json": "^2.0.1",
|
|
25
|
+
"@types/node": "^18.7.14",
|
|
26
|
+
"banana-i18n": "^2.3.3",
|
|
27
|
+
"base64-js": "^1.5.1",
|
|
28
|
+
"jwt-decode": "^3.1.2",
|
|
29
|
+
"solid-element": "^1.4.3",
|
|
30
|
+
"solid-js": "^1.4.2"
|
|
31
|
+
}
|
|
32
|
+
}
|