@roudanio/awesome-comment 0.1.6 → 0.1.7
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/awesome-comment.iife.js +1 -1
- package/dist/awesome-comment.js +17 -17
- package/dist/awesome-comment.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -5,4 +5,4 @@ var AwesomeComment=function(){"use strict";function Cn(e,t){const n=Object.creat
|
|
|
5
5
|
*/let eo;const wn=e=>eo=e,to=Symbol();function ds(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Mt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Mt||(Mt={}));function oa(){const e=Ms(!0),t=e.run(()=>G({}));let n=[],s=[];const i=rn({install(o){wn(i),i._a=o,o.provide(to,i),o.config.globalProperties.$pinia=i,s.forEach(r=>n.push(r)),s=[]},use(o){return!this._a&&!ia?s.push(o):n.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const no=()=>{};function so(e,t,n,s=no){e.push(t);const i=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),s())};return!n&&Ns()&&Mo(i),i}function yt(e,...t){e.slice().forEach(n=>{n(...t)})}const ra=e=>e();function hs(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,s)=>e.set(s,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];ds(i)&&ds(s)&&e.hasOwnProperty(n)&&!q(s)&&!We(s)?e[n]=hs(i,s):e[n]=s}return e}const ca=Symbol();function aa(e){return!ds(e)||!e.hasOwnProperty(ca)}const{assign:Ze}=Object;function la(e){return!!(q(e)&&e.effect)}function ua(e,t,n,s){const{state:i,actions:o,getters:r}=t,c=n.state.value[e];let a;function l(){c||(n.state.value[e]=i?i():{});const f=mr(n.state.value[e]);return Ze(f,o,Object.keys(r||{}).reduce((d,p)=>(d[p]=rn(Hi(()=>{wn(n);const g=n._s.get(e);return r[p].call(g,g)})),d),{}))}return a=io(e,l,t,n,s,!0),a}function io(e,t,n={},s,i,o){let r;const c=Ze({actions:{}},n),a={deep:!0};let l,f,d=[],p=[],g;const y=s.state.value[e];!o&&!y&&(s.state.value[e]={}),G({});let x;function R(M){let D;l=f=!1,typeof M=="function"?(M(s.state.value[e]),D={type:Mt.patchFunction,storeId:e,events:g}):(hs(s.state.value[e],M),D={type:Mt.patchObject,payload:M,storeId:e,events:g});const ie=x=Symbol();ci().then(()=>{x===ie&&(l=!0)}),f=!0,yt(d,D,s.state.value[e])}const E=o?function(){const{state:D}=n,ie=D?D():{};this.$patch(he=>{Ze(he,ie)})}:no;function O(){r.stop(),d=[],p=[],s._s.delete(e)}function L(M,D){return function(){wn(s);const ie=Array.from(arguments),he=[],je=[];function kt(W){he.push(W)}function Dt(W){je.push(W)}yt(p,{args:ie,name:M,store:H,after:kt,onError:Dt});let Ve;try{Ve=D.apply(this&&this.$id===e?this:H,ie)}catch(W){throw yt(je,W),W}return Ve instanceof Promise?Ve.then(W=>(yt(he,W),W)).catch(W=>(yt(je,W),Promise.reject(W))):(yt(he,Ve),Ve)}}const j={_p:s,$id:e,$onAction:so.bind(null,p),$patch:R,$reset:E,$subscribe(M,D={}){const ie=so(d,M,D.detached,()=>he()),he=r.run(()=>fn(()=>s.state.value[e],je=>{(D.flush==="sync"?f:l)&&M({storeId:e,type:Mt.direct,events:g},je)},Ze({},a,D)));return ie},$dispose:O},H=sn(j);s._s.set(e,H);const _e=s._a&&s._a.runWithContext||ra,ee=s._e.run(()=>(r=Ms(),_e(()=>r.run(t))));for(const M in ee){const D=ee[M];if(q(D)&&!la(D)||We(D))o||(y&&aa(D)&&(q(D)?D.value=y[M]:hs(D,y[M])),s.state.value[e][M]=D);else if(typeof D=="function"){const ie=L(M,D);ee[M]=ie,c.actions[M]=D}}return Ze(H,ee),Ze(U(H),ee),Object.defineProperty(H,"$state",{get:()=>s.state.value[e],set:M=>{R(D=>{Ze(D,M)})}}),s._p.forEach(M=>{Ze(H,r.run(()=>M({store:H,app:s._a,pinia:s,options:c})))}),y&&o&&n.hydrate&&n.hydrate(H.$state,y),l=!0,f=!0,H}function fa(e,t,n){let s,i;const o=typeof t=="function";typeof e=="string"?(s=e,i=o?n:t):(i=e,s=e.id);function r(c,a){const l=ic();return c=c||(l?Oe(to,null):null),c&&wn(c),c=eo,c._s.has(s)||(o?io(s,t,i,c):ua(s,i,c)),c._s.get(s)}return r.$id=s,r}const oo=Symbol("$auth0");function Pe(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n}var wt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ps(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ms(e,t){return e(t={exports:{}},t.exports),t.exports}var st=ms(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function s(){var i=this;this.locked=new Map,this.addToLocked=function(o,r){var c=i.locked.get(o);c===void 0?r===void 0?i.locked.set(o,[]):i.locked.set(o,[r]):r!==void 0&&(c.unshift(r),i.locked.set(o,c))},this.isLocked=function(o){return i.locked.has(o)},this.lock=function(o){return new Promise(function(r,c){i.isLocked(o)?i.addToLocked(o,r):(i.addToLocked(o),r())})},this.unlock=function(o){var r=i.locked.get(o);if(r!==void 0&&r.length!==0){var c=r.pop();i.locked.set(o,r),c!==void 0&&setTimeout(c,0)}else i.locked.delete(o)}}return s.getInstance=function(){return s.instance===void 0&&(s.instance=new s),s.instance},s}();t.default=function(){return n.getInstance()}});ps(st);var da=ps(ms(function(e,t){var n=wt&&wt.__awaiter||function(a,l,f,d){return new(f||(f=Promise))(function(p,g){function y(E){try{R(d.next(E))}catch(O){g(O)}}function x(E){try{R(d.throw(E))}catch(O){g(O)}}function R(E){E.done?p(E.value):new f(function(O){O(E.value)}).then(y,x)}R((d=d.apply(a,l||[])).next())})},s=wt&&wt.__generator||function(a,l){var f,d,p,g,y={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(R){return function(E){return function(O){if(f)throw new TypeError("Generator is already executing.");for(;y;)try{if(f=1,d&&(p=2&O[0]?d.return:O[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,O[1])).done)return p;switch(d=0,p&&(O=[2&O[0],p.value]),O[0]){case 0:case 1:p=O;break;case 4:return y.label++,{value:O[1],done:!1};case 5:y.label++,d=O[1],O=[0];continue;case 7:O=y.ops.pop(),y.trys.pop();continue;default:if(!((p=(p=y.trys).length>0&&p[p.length-1])||O[0]!==6&&O[0]!==2)){y=0;continue}if(O[0]===3&&(!p||O[1]>p[0]&&O[1]<p[3])){y.label=O[1];break}if(O[0]===6&&y.label<p[1]){y.label=p[1],p=O;break}if(p&&y.label<p[2]){y.label=p[2],y.ops.push(O);break}p[2]&&y.ops.pop(),y.trys.pop();continue}O=l.call(a,y)}catch(L){O=[6,L],d=0}finally{f=p=0}if(5&O[0])throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}([R,E])}}};Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key";function o(a){return new Promise(function(l){return setTimeout(l,a)})}function r(a){for(var l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",f="",d=0;d<a;d++)f+=l[Math.floor(Math.random()*l.length)];return f}var c=function(){function a(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+r(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),a.waiters===void 0&&(a.waiters=[])}return a.prototype.acquireLock=function(l,f){return f===void 0&&(f=5e3),n(this,void 0,void 0,function(){var d,p,g,y,x,R;return s(this,function(E){switch(E.label){case 0:d=Date.now()+r(4),p=Date.now()+f,g=i+"-"+l,y=window.localStorage,E.label=1;case 1:return Date.now()<p?[4,o(30)]:[3,8];case 2:return E.sent(),y.getItem(g)!==null?[3,5]:(x=this.id+"-"+l+"-"+d,[4,o(Math.floor(25*Math.random()))]);case 3:return E.sent(),y.setItem(g,JSON.stringify({id:this.id,iat:d,timeoutKey:x,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return E.sent(),(R=y.getItem(g))!==null&&(R=JSON.parse(R)).id===this.id&&R.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(g,d),[2,!0]):[3,7];case 5:return a.lockCorrector(),[4,this.waitForSomethingToChange(p)];case 6:E.sent(),E.label=7;case 7:return d=Date.now()+r(4),[3,1];case 8:return[2,!1]}})})},a.prototype.refreshLockWhileAcquired=function(l,f){return n(this,void 0,void 0,function(){var d=this;return s(this,function(p){return setTimeout(function(){return n(d,void 0,void 0,function(){var g,y;return s(this,function(x){switch(x.label){case 0:return[4,st.default().lock(f)];case 1:return x.sent(),this.acquiredIatSet.has(f)?(g=window.localStorage,(y=g.getItem(l))===null?(st.default().unlock(f),[2]):((y=JSON.parse(y)).timeRefreshed=Date.now(),g.setItem(l,JSON.stringify(y)),st.default().unlock(f),this.refreshLockWhileAcquired(l,f),[2])):(st.default().unlock(f),[2])}})})},1e3),[2]})})},a.prototype.waitForSomethingToChange=function(l){return n(this,void 0,void 0,function(){return s(this,function(f){switch(f.label){case 0:return[4,new Promise(function(d){var p=!1,g=Date.now(),y=!1;function x(){if(y||(window.removeEventListener("storage",x),a.removeFromWaiting(x),clearTimeout(R),y=!0),!p){p=!0;var E=50-(Date.now()-g);E>0?setTimeout(d,E):d()}}window.addEventListener("storage",x),a.addToWaiting(x);var R=setTimeout(x,Math.max(0,l-Date.now()))})];case 1:return f.sent(),[2]}})})},a.addToWaiting=function(l){this.removeFromWaiting(l),a.waiters!==void 0&&a.waiters.push(l)},a.removeFromWaiting=function(l){a.waiters!==void 0&&(a.waiters=a.waiters.filter(function(f){return f!==l}))},a.notifyWaiters=function(){a.waiters!==void 0&&a.waiters.slice().forEach(function(l){return l()})},a.prototype.releaseLock=function(l){return n(this,void 0,void 0,function(){return s(this,function(f){switch(f.label){case 0:return[4,this.releaseLock__private__(l)];case 1:return[2,f.sent()]}})})},a.prototype.releaseLock__private__=function(l){return n(this,void 0,void 0,function(){var f,d,p;return s(this,function(g){switch(g.label){case 0:return f=window.localStorage,d=i+"-"+l,(p=f.getItem(d))===null?[2]:(p=JSON.parse(p)).id!==this.id?[3,2]:[4,st.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),f.removeItem(d),st.default().unlock(p.iat),a.notifyWaiters(),g.label=2;case 2:return[2]}})})},a.lockCorrector=function(){for(var l=Date.now()-5e3,f=window.localStorage,d=Object.keys(f),p=!1,g=0;g<d.length;g++){var y=d[g];if(y.includes(i)){var x=f.getItem(y);x!==null&&((x=JSON.parse(x)).timeRefreshed===void 0&&x.timeAcquired<l||x.timeRefreshed!==void 0&&x.timeRefreshed<l)&&(f.removeItem(y),p=!0)}}p&&a.notifyWaiters()},a.waiters=void 0,a}();t.default=c}));const ha={timeoutInSeconds:60},ro={name:"auth0-spa-js",version:"2.0.4"},co=()=>Date.now();class ge extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,ge.prototype)}static fromPayload({error:t,error_description:n}){return new ge(t,n)}}class gs extends ge{constructor(t,n,s,i=null){super(t,n),this.state=s,this.appState=i,Object.setPrototypeOf(this,gs.prototype)}}class Nt extends ge{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Nt.prototype)}}class _s extends Nt{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,_s.prototype)}}class bs extends ge{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,bs.prototype)}}class ys extends ge{constructor(t,n,s){super(t,n),this.mfa_token=s,Object.setPrototypeOf(this,ys.prototype)}}class vn extends ge{constructor(t,n){super("missing_refresh_token",`Missing Refresh Token (audience: '${ao(t,["default"])}', scope: '${ao(n)}')`),this.audience=t,this.scope=n,Object.setPrototypeOf(this,vn.prototype)}}function ao(e,t=[]){return e&&!t.includes(e)?e:""}const kn=()=>window.crypto,ws=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(kn().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%e.length]),t},lo=e=>btoa(e),vs=e=>{var{clientId:t}=e,n=Pe(e,["clientId"]);return new URLSearchParams((s=>Object.keys(s).filter(i=>s[i]!==void 0).reduce((i,o)=>Object.assign(Object.assign({},i),{[o]:s[o]}),{}))(Object.assign({client_id:t},n))).toString()},uo=e=>(t=>decodeURIComponent(atob(t).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),pa=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json()}},ma=async(e,t,n,s,i,o,r=1e4)=>i?(async(c,a,l,f,d,p,g)=>{return y={auth:{audience:a,scope:l},timeout:d,fetchUrl:c,fetchOptions:f,useFormData:g},x=p,new Promise(function(R,E){const O=new MessageChannel;O.port1.onmessage=function(L){L.data.error?E(new Error(L.data.error)):R(L.data),O.port1.close()},x.postMessage(y,[O.port2])});var y,x})(e,t,n,s,r,i,o):(async(c,a,l)=>{const f=new AbortController;let d;return a.signal=f.signal,Promise.race([pa(c,a),new Promise((p,g)=>{d=setTimeout(()=>{f.abort(),g(new Error("Timeout when executing 'fetch'"))},l)})]).finally(()=>{clearTimeout(d)})})(e,s,r);async function ga(e,t){var{baseUrl:n,timeout:s,audience:i,scope:o,auth0Client:r,useFormData:c}=e,a=Pe(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const l=c?vs(a):JSON.stringify(a);return await async function(f,d,p,g,y,x,R){let E,O=null;for(let M=0;M<3;M++)try{E=await ma(f,p,g,y,x,R,d),O=null;break}catch(D){O=D}if(O)throw O;const L=E.json,{error:j,error_description:H}=L,_e=Pe(L,["error","error_description"]),{ok:ee}=E;if(!ee){const M=H||`HTTP error. Unable to fetch ${f}`;throw j==="mfa_required"?new ys(j,M,_e.mfa_token):j==="missing_refresh_token"?new vn(p,g):new ge(j||"request_error",M)}return _e}(`${n}/oauth/token`,s,i||"default",o,{method:"POST",body:l,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(r||ro))}},t,c)}const xn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};class Ee{constructor(t,n="@@auth0spajs@@",s){this.prefix=n,this.suffix=s,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,s,i,o]=t.split("::");return new Ee({clientId:s,scope:o,audience:i},n)}static fromCacheEntry(t){const{scope:n,audience:s,client_id:i}=t;return new Ee({scope:n,audience:s,clientId:i})}}class _a{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}}class fo{constructor(){this.enclosedCache=function(){let t={};return{set(n,s){t[n]=s},get(n){const s=t[n];if(s)return s},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}}()}}class ba{constructor(t,n,s){this.cache=t,this.keyManifest=n,this.nowProvider=s||co}async setIdToken(t,n,s){var i;const o=this.getIdTokenCacheKey(t);await this.cache.set(o,{id_token:n,decodedToken:s}),await((i=this.keyManifest)===null||i===void 0?void 0:i.add(o))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const s=await this.get(t);return!s||!s.id_token||!s.decodedToken?void 0:{id_token:s.id_token,decodedToken:s.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t,n=0){var s;let i=await this.cache.get(t.toKey());if(!i){const c=await this.getCacheKeys();if(!c)return;const a=this.matchExistingCacheKey(t,c);a&&(i=await this.cache.get(a))}if(!i)return;const o=await this.nowProvider(),r=Math.floor(o/1e3);return i.expiresAt-n<r?i.body.refresh_token?(i.body={refresh_token:i.body.refresh_token},await this.cache.set(t.toKey(),i),i.body):(await this.cache.remove(t.toKey()),void await((s=this.keyManifest)===null||s===void 0?void 0:s.remove(t.toKey()))):i.body}async set(t){var n;const s=new Ee({clientId:t.client_id,scope:t.scope,audience:t.audience}),i=await this.wrapCacheEntry(t);await this.cache.set(s.toKey(),i),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(s.toKey()))}async clear(t){var n;const s=await this.getCacheKeys();s&&(await s.filter(i=>!t||i.includes(t)).reduce(async(i,o)=>{await i,await this.cache.remove(o)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new Ee({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,n){return n.filter(s=>{var i;const o=Ee.fromKey(s),r=new Set(o.scope&&o.scope.split(" ")),c=((i=t.scope)===null||i===void 0?void 0:i.split(" "))||[],a=o.scope&&c.reduce((l,f)=>l&&r.has(f),!0);return o.prefix==="@@auth0spajs@@"&&o.clientId===t.clientId&&o.audience===t.audience&&a})[0]}}class ya{constructor(t,n){this.storage=t,this.clientId=n,this.storageKey=`a0.spajs.txs.${this.clientId}`,this.transaction=this.storage.get(this.storageKey)}create(t){this.transaction=t,this.storage.save(this.storageKey,t,{daysUntilExpire:1})}get(){return this.transaction}remove(){delete this.transaction,this.storage.remove(this.storageKey)}}const zt=e=>typeof e=="number",wa=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var it=ms(function(e,t){var n=wt&&wt.__assign||function(){return n=Object.assign||function(a){for(var l,f=1,d=arguments.length;f<d;f++)for(var p in l=arguments[f])Object.prototype.hasOwnProperty.call(l,p)&&(a[p]=l[p]);return a},n.apply(this,arguments)};function s(a,l){if(!l)return"";var f="; "+a;return l===!0?f:f+"="+l}function i(a,l,f){return encodeURIComponent(a).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(d){if(typeof d.expires=="number"){var p=new Date;p.setMilliseconds(p.getMilliseconds()+864e5*d.expires),d.expires=p}return s("Expires",d.expires?d.expires.toUTCString():"")+s("Domain",d.domain)+s("Path",d.path)+s("Secure",d.secure)+s("SameSite",d.sameSite)}(f)}function o(a){for(var l={},f=a?a.split("; "):[],d=/(%[\dA-F]{2})+/gi,p=0;p<f.length;p++){var g=f[p].split("="),y=g.slice(1).join("=");y.charAt(0)==='"'&&(y=y.slice(1,-1));try{l[g[0].replace(d,decodeURIComponent)]=y.replace(d,decodeURIComponent)}catch{}}return l}function r(){return o(document.cookie)}function c(a,l,f){document.cookie=i(a,l,n({path:"/"},f))}t.__esModule=!0,t.encode=i,t.parse=o,t.getAll=r,t.get=function(a){return r()[a]},t.set=c,t.remove=function(a,l){c(a,"",n(n({},l),{expires:-1}))}});ps(it),it.encode,it.parse,it.getAll;var va=it.get,ho=it.set,po=it.remove;const vt={get(e){const t=va(e);if(t!==void 0)return JSON.parse(t)},save(e,t,n){let s={};window.location.protocol==="https:"&&(s={secure:!0,sameSite:"none"}),n?.daysUntilExpire&&(s.expires=n.daysUntilExpire),n?.cookieDomain&&(s.domain=n.cookieDomain),ho(e,JSON.stringify(t),s)},remove(e,t){let n={};t?.cookieDomain&&(n.domain=t.cookieDomain),po(e,n)}},ka={get:e=>vt.get(e)||vt.get(`_legacy_${e}`),save(e,t,n){let s={};window.location.protocol==="https:"&&(s={secure:!0}),n?.daysUntilExpire&&(s.expires=n.daysUntilExpire),n?.cookieDomain&&(s.domain=n.cookieDomain),ho(`_legacy_${e}`,JSON.stringify(t),s),vt.save(e,t,n)},remove(e,t){let n={};t?.cookieDomain&&(n.domain=t.cookieDomain),po(e,n),vt.remove(e,t),vt.remove(`_legacy_${e}`,t)}},xa={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var ks,Ia=function(e){return ks=ks||function(t,n,s){var i=n===void 0?null:n,o=function(l,f){var d=atob(l);if(f){for(var p=new Uint8Array(d.length),g=0,y=d.length;g<y;++g)p[g]=d.charCodeAt(g);return String.fromCharCode.apply(null,new Uint16Array(p.buffer))}return d}(t,s!==void 0&&s),r=o.indexOf(`
|
|
6
6
|
`,10)+1,c=o.substring(r)+(i?"//# sourceMappingURL="+i:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9Y29uc3Qgcz1lPT57dmFye2NsaWVudElkOnR9PWUscj1mdW5jdGlvbihlLHQpe3ZhciByPXt9O2Zvcih2YXIgcyBpbiBlKU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChlLHMpJiZ0LmluZGV4T2Yocyk8MCYmKHJbc109ZVtzXSk7aWYobnVsbCE9ZSYmImZ1bmN0aW9uIj09dHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMpe3ZhciBvPTA7Zm9yKHM9T2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyhlKTtvPHMubGVuZ3RoO28rKyl0LmluZGV4T2Yoc1tvXSk8MCYmT2JqZWN0LnByb3RvdHlwZS5wcm9wZXJ0eUlzRW51bWVyYWJsZS5jYWxsKGUsc1tvXSkmJihyW3Nbb11dPWVbc1tvXV0pfXJldHVybiByfShlLFsiY2xpZW50SWQiXSk7cmV0dXJuIG5ldyBVUkxTZWFyY2hQYXJhbXMoKGU9Pk9iamVjdC5rZXlzKGUpLmZpbHRlcigodD0+dm9pZCAwIT09ZVt0XSkpLnJlZHVjZSgoKHQscik9Pk9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSx0KSx7W3JdOmVbcl19KSkse30pKShPYmplY3QuYXNzaWduKHtjbGllbnRfaWQ6dH0scikpKS50b1N0cmluZygpfTtsZXQgbz17fTtjb25zdCBuPShlLHQpPT5gJHtlfXwke3R9YDthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoYXN5bmMoe2RhdGE6e3RpbWVvdXQ6ZSxhdXRoOnIsZmV0Y2hVcmw6aSxmZXRjaE9wdGlvbnM6Yyx1c2VGb3JtRGF0YTphfSxwb3J0czpbZl19KT0+e2xldCBwO2NvbnN0e2F1ZGllbmNlOmwsc2NvcGU6dX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2NvbnN0IGU9KChlLHQpPT5vW24oZSx0KV0pKGwsdSk7aWYoIWUpdGhyb3cgbmV3IHQobCx1KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjplfSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjplfSkpfWxldCBkLGc7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGQ9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1kLnNpZ25hbCk7dHJ5e2c9YXdhaXQgUHJvbWlzZS5yYWNlKFsoaD1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsaCkpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIGYucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFnKXJldHVybiBkJiZkLmFib3J0KCksdm9pZCBmLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO3A9YXdhaXQgZy5qc29uKCkscC5yZWZyZXNoX3Rva2VuPygoKGUsdCxyKT0+e29bbih0LHIpXT1lfSkocC5yZWZyZXNoX3Rva2VuLGwsdSksZGVsZXRlIHAucmVmcmVzaF90b2tlbik6KChlLHQpPT57ZGVsZXRlIG9bbihlLHQpXX0pKGwsdSksZi5wb3N0TWVzc2FnZSh7b2s6Zy5vayxqc29uOnB9KX1jYXRjaChlKXtmLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjplLmVycm9yLGVycm9yX2Rlc2NyaXB0aW9uOmUubWVzc2FnZX19KX12YXIgaH0pKX0oKTsKCg==",null,!1),new Worker(ks,e)};const xs={};class Ta{constructor(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var n;const s=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);s.add(t),await this.cache.set(this.manifestKey,{keys:[...s]})}async remove(t){const n=await this.cache.get(this.manifestKey);if(n){const s=new Set(n.keys);return s.delete(t),s.size>0?await this.cache.set(this.manifestKey,{keys:[...s]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}}const Oa={memory:()=>new fo().enclosedCache,localstorage:()=>new _a},mo=e=>Oa[e],go=e=>{const{openUrl:t,onRedirect:n}=e,s=Pe(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},s),{openUrl:t===!1||t?t:n})},Is=new da;class Ca{constructor(t){let n,s;if(this.userCache=new fo().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await Is.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!kn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(kn().subtle===void 0)throw new Error(`
|
|
7
7
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
8
|
-
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)s=t.cache;else{if(n=t.cacheLocation||"memory",!mo(n))throw new Error(`Invalid cache location "${n}"`);s=mo(n)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?vt:ka,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(r=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:xa;var o;this.scope=xn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ya(i,this.options.clientId),this.nowProvider=this.options.nowProvider||co,this.cacheManager=new ba(s,s.allKeys?void 0:new Ta(s,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((r,c)=>r?r.startsWith("https://")?r:`https://${r}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.worker=new Ia)}_url(t){const n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||ro)));return`${this.domainUrl}${t}&auth0Client=${n}`}_authorizeUrl(t){return this._url(`/authorize?${vs(t)}`)}async _verifyIdToken(t,n,s){const i=await this.nowProvider();return(r=>{if(!r.id_token)throw new Error("ID token is required but missing");const c=(d=>{const p=d.split("."),[g,y,x]=p;if(p.length!==3||!g||!y||!x)throw new Error("ID token could not be decoded");const R=JSON.parse(uo(y)),E={__raw:d},O={};return Object.keys(R).forEach(L=>{E[L]=R[L],wa.includes(L)||(O[L]=R[L])}),{encoded:{header:g,payload:y,signature:x},header:JSON.parse(uo(g)),claims:E,user:O}})(r.id_token);if(!c.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(c.claims.iss!==r.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${r.iss}", found "${c.claims.iss}"`);if(!c.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(c.header.alg!=="RS256")throw new Error(`Signature algorithm of "${c.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!c.claims.aud||typeof c.claims.aud!="string"&&!Array.isArray(c.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(c.claims.aud)){if(!c.claims.aud.includes(r.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but was not one of "${c.claims.aud.join(", ")}"`);if(c.claims.aud.length>1){if(!c.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(c.claims.azp!==r.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${r.aud}", found "${c.claims.azp}"`)}}else if(c.claims.aud!==r.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but found "${c.claims.aud}"`);if(r.nonce){if(!c.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(c.claims.nonce!==r.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${r.nonce}", found "${c.claims.nonce}"`)}if(r.max_age&&!zt(c.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(c.claims.exp==null||!zt(c.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!zt(c.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const a=r.leeway||60,l=new Date(r.now||Date.now()),f=new Date(0);if(f.setUTCSeconds(c.claims.exp+a),l>f)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${l}) is after expiration time (${f})`);if(c.claims.nbf!=null&&zt(c.claims.nbf)){const d=new Date(0);if(d.setUTCSeconds(c.claims.nbf-a),l<d)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${l}) is before ${d}`)}if(c.claims.auth_time!=null&&zt(c.claims.auth_time)){const d=new Date(0);if(d.setUTCSeconds(parseInt(c.claims.auth_time)+r.max_age+a),l>d)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${l}) is after last auth at ${d}`)}if(r.organizationId){if(!c.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(r.organizationId!==c.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${r.organizationId}", found "${c.claims.org_id}"`)}return c})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organizationId:s,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:i});var o}_processOrgIdHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,s){const i=lo(ws()),o=lo(ws()),r=ws(),c=(f=>{const d=new Uint8Array(f);return(p=>{const g={"+":"-","/":"_","=":""};return p.replace(/[+/=]/g,y=>g[y])})(window.btoa(String.fromCharCode(...Array.from(d))))})(await(async f=>await kn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(f)))(r)),a=((f,d,p,g,y,x,R,E)=>Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),p),{scope:xn(d,p.scope),response_type:"code",response_mode:E||"query",state:g,nonce:y,redirect_uri:R||f.authorizationParams.redirect_uri,code_challenge:x,code_challenge_method:"S256"}))(this.options,this.scope,t,i,o,c,t.redirect_uri||this.options.authorizationParams.redirect_uri||s,n?.response_mode),l=this._authorizeUrl(a);return{nonce:o,code_verifier:r,scope:a.scope,audience:a.audience||"default",redirect_uri:a.redirect_uri,state:i,url:l}}async loginWithPopup(t,n){var s;if(t=t||{},!(n=n||{}).popup&&(n.popup=(c=>{const a=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${a},top=${l},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!n.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const i=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=i.url;const o=await(c=>new Promise((a,l)=>{let f;const d=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(d),clearTimeout(p),window.removeEventListener("message",f,!1),l(new bs(c.popup)))},1e3),p=setTimeout(()=>{clearInterval(d),l(new _s(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(g){if(g.data&&g.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(d),window.removeEventListener("message",f,!1),c.popup.close(),g.data.response.error)return l(ge.fromPayload(g.data.response));a(g.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(i.state!==o.state)throw new Error("Invalid state");const r=((s=t.authorizationParams)===null||s===void 0?void 0:s.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:i.redirect_uri},{nonceIn:i.nonce,organizationId:r})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var n;const s=go(t),{openUrl:i,fragment:o,appState:r}=s,c=Pe(s,["openUrl","fragment","appState"]),a=((n=c.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:f}=l,d=Pe(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:r}),a&&{organizationId:a}));const p=o?`${f}#${o}`:f;i?await i(p):window.location.assign(p)}async handleRedirectCallback(t=window.location.href){const n=t.split("?").slice(1);if(n.length===0)throw new Error("There are no query params available for parsing.");const{state:s,code:i,error:o,error_description:r}=(d=>{d.indexOf("#")>-1&&(d=d.substring(0,d.indexOf("#")));const p=new URLSearchParams(d);return{state:p.get("state"),code:p.get("code")||void 0,error:p.get("error")||void 0,error_description:p.get("error_description")||void 0}})(n.join("")),c=this.transactionManager.get();if(!c)throw new Error("Invalid state");if(this.transactionManager.remove(),o)throw new gs(o,r||o,s,c.appState);if(!c.code_verifier||c.state&&c.state!==s)throw new Error("Invalid state");const a=c.organizationId,l=c.nonce,f=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:i},f?{redirect_uri:f}:{}),{nonceIn:l,organizationId:a}),{appState:c.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var n;const s=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:xn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})}),i=await((o,r)=>{let c=xs[r];return c||(c=o().finally(()=>{delete xs[r],c=null}),xs[r]=c),c})(()=>this._getTokenSilently(s),`${this.options.clientId}::${s.authorizationParams.audience}::${s.authorizationParams.scope}`);return t.detailedResponse?i:i?.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,s=Pe(t,["cacheMode"]);if(n!=="off"){const i=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(i)return i}if(n!=="cache-only"){if(!await(async(i,o=3)=>{for(let r=0;r<o;r++)if(await i())return!0;return!1})(()=>Is.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Nt;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),n!=="off"){const l=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(l)return l}const i=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(s):await this._getTokenFromIFrame(s),{id_token:o,access_token:r,oauthTokenScope:c,expires_in:a}=i;return Object.assign(Object.assign({id_token:o,access_token:r},c?{scope:c}:null),{expires_in:a})}finally{await Is.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},n={}){var s;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:xn(this.scope,(s=t.authorizationParams)===null||s===void 0?void 0:s.scope)})});return n=Object.assign(Object.assign({},ha),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new Ee({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:s}=n,i=Pe(n,["federated"]),o=s?"&federated":"";return this._url(`/v2/logout?${vs(Object.assign({clientId:t.clientId},i))}`)+o}async logout(t={}){const n=go(t),{openUrl:s}=n,i=Pe(n,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const o=this._buildLogoutUrl(i);s?await s(o):s!==!1&&window.location.assign(o)}async _getTokenFromIFrame(t){const n=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),s=this.cookieStorage.get(this.orgHintCookieName);s&&!n.organization&&(n.organization=s);const{url:i,state:o,nonce:r,code_verifier:c,redirect_uri:a,scope:l,audience:f}=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ge("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const d=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,p=await((y,x,R=60)=>new Promise((E,O)=>{const L=window.document.createElement("iframe");L.setAttribute("width","0"),L.setAttribute("height","0"),L.style.display="none";const j=()=>{window.document.body.contains(L)&&(window.document.body.removeChild(L),window.removeEventListener("message",H,!1))};let H;const _e=setTimeout(()=>{O(new Nt),j()},1e3*R);H=function(ee){if(ee.origin!=x||!ee.data||ee.data.type!=="authorization_response")return;const M=ee.source;M&&M.close(),ee.data.response.error?O(ge.fromPayload(ee.data.response)):E(ee.data.response),clearTimeout(_e),window.removeEventListener("message",H,!1),setTimeout(j,2e3)},window.addEventListener("message",H,!1),window.document.body.appendChild(L),L.setAttribute("src",y)}))(i,this.domainUrl,d);if(o!==p.state)throw new Error("Invalid state");const g=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:c,code:p.code,grant_type:"authorization_code",redirect_uri:a,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:r});return Object.assign(Object.assign({},g),{scope:l,oauthTokenScope:g.scope,audience:f})}catch(d){throw d.error==="login_required"&&this.logout({openUrl:!1}),d}}async _getTokenUsingRefreshToken(t){const n=await this.cacheManager.get(new Ee({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new vn(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const s=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,i=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const o=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:s}),i&&{timeout:i}));return Object.assign(Object.assign({},o),{scope:t.authorizationParams.scope,oauthTokenScope:o.scope,audience:t.authorizationParams.audience||"default"})}catch(o){if((o.message.indexOf("Missing Refresh Token")>-1||o.message&&o.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw o}}async _saveEntryInCache(t){const{id_token:n,decodedToken:s}=t,i=Pe(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:s}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(i)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=await this.cacheManager.getIdToken(new Ee({clientId:this.options.clientId,audience:t,scope:this.scope})),s=this.userCache.get("@@user@@");return n&&n.id_token===s?.id_token?s:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:t,audience:n,clientId:s}){const i=await this.cacheManager.get(new Ee({scope:t,audience:n,clientId:s}),60);if(i&&i.access_token){const{access_token:o,oauthTokenScope:r,expires_in:c}=i,a=await this._getIdTokenFromCache();return a&&Object.assign(Object.assign({id_token:a.id_token,access_token:o},r?{scope:r}:null),{expires_in:c})}}async _requestToken(t,n){const{nonceIn:s,organizationId:i}=n||{},o=await ga(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),r=await this._verifyIdToken(o.id_token,s,i);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:r,scope:t.scope,audience:t.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(r.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:r})}}function Ut(e){e?.redirect_uri&&(console.warn("Using `redirect_uri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=e.authorizationParams||{},e.authorizationParams.redirect_uri=e.redirect_uri,delete e.redirect_uri)}const ot=()=>{console.error("Please ensure Auth0's Vue plugin is correctly installed.")},Sa={isLoading:G(!1),isAuthenticated:G(!1),user:G(void 0),idTokenClaims:G(void 0),error:G(null),loginWithPopup:ot,loginWithRedirect:ot,getAccessTokenSilently:ot,getAccessTokenWithPopup:ot,logout:ot,checkSession:ot,handleRedirectCallback:ot},Pa=G(Sa);class Ea{constructor(t,n){var s,i;this.clientOptions=t,this.pluginOptions=n,this._isLoading=G(!0),this._isAuthenticated=G(!1),this._user=G({}),this._idTokenClaims=G(),this._error=G(null),this.isLoading=Je(this._isLoading),this.isAuthenticated=Je(this._isAuthenticated),this.user=Je(this._user),this.idTokenClaims=Je(this._idTokenClaims),this.error=Je(this._error),s=this,i=["constructor"],Object.getOwnPropertyNames(Object.getPrototypeOf(s)).filter(o=>!i.includes(o)).forEach(o=>s[o]=s[o].bind(s))}install(t){this._client=new Ca(Object.assign(Object.assign({},this.clientOptions),{auth0Client:{name:"auth0-vue",version:"2.2.1"}})),this.__checkSession(t.config.globalProperties.$router),t.config.globalProperties.$auth0=this,t.provide(oo,this),Pa.value=this}async loginWithRedirect(t){return Ut(t),this._client.loginWithRedirect(t)}async loginWithPopup(t,n){return Ut(t),this.__proxy(()=>this._client.loginWithPopup(t,n))}async logout(t){return t?.openUrl||t?.openUrl===!1?this.__proxy(()=>this._client.logout(t)):this._client.logout(t)}async getAccessTokenSilently(t={}){return Ut(t),this.__proxy(()=>this._client.getTokenSilently(t))}async getAccessTokenWithPopup(t,n){return Ut(t),this.__proxy(()=>this._client.getTokenWithPopup(t,n))}async checkSession(t){return this.__proxy(()=>this._client.checkSession(t))}async handleRedirectCallback(t){return this.__proxy(()=>this._client.handleRedirectCallback(t))}async __checkSession(t){var n,s,i;const o=window.location.search;try{if((o.includes("code=")||o.includes("error="))&&o.includes("state=")&&!(!((n=this.pluginOptions)===null||n===void 0)&&n.skipRedirectCallback)){const r=await this.handleRedirectCallback(),c=r?.appState,a=(s=c?.target)!==null&&s!==void 0?s:"/";return window.history.replaceState({},"","/"),t&&t.push(a),r}await this.checkSession()}catch{window.history.replaceState({},"","/"),t&&t.push(((i=this.pluginOptions)===null||i===void 0?void 0:i.errorPath)||"/")}}async __refreshState(){this._isAuthenticated.value=await this._client.isAuthenticated(),this._user.value=await this._client.getUser(),this._idTokenClaims.value=await this._client.getIdTokenClaims(),this._isLoading.value=!1}async __proxy(t,n=!0){let s;try{s=await t(),this._error.value=null}catch(i){throw this._error.value=i,i}finally{n&&await this.__refreshState()}return s}}function ja(e,t){return Ut(e),new Ea(e,t)}function _o(){return Oe(oo)}const wl="",vl="",kl="";var bo=(e=>(e[e.Pending=0]="Pending",e[e.Approved=1]="Approved",e[e.Rejected=2]="Rejected",e[e.Deleted=3]="Deleted",e))(bo||{});const Ts=fa("store",()=>{const e=Oe("postId"),t=G(!1),n=G(0),s=G(""),i=G([]),o=G(0);async function r(){s.value="";const a=Oe("ApiBaseUrl"),l=await fetch(`${a}/api/comments?postId=${e}&start=${n.value}`);if(!l.ok){s.value="Load comments failed. "+l.statusText,t.value=!0;return}const f=await l.json();if(f.code!==0){s.value="Load comments failed. "+f.message,t.value=!0;return}return i.value=f.data.map(d=>{const{user:p,created_at:g,...y}=d;return{...y,createdAt:new Date(g),user:JSON.parse(d.user)}}),o.value=f.meta?.total||0,t.value=!0,f}function c(a,l,f){const{sub:d="",name:p="",picture:g="",email:y="",nickname:x=""}=f;i.value.unshift({id:a,postId:e,content:l,ancestorId:-1,parentId:-1,createdAt:new Date,user:{avatar:g,email:y,name:x||p},userId:d,status:bo.Approved,isNew:!0}),o.value++}return{isLoaded:t,message:s,postId:e,comments:i,total:o,loadComments:r,addComment:c}}),Aa=["onSubmit"],Ra={class:"form-control border border-neutral bg-base-200 rounded-lg"},Fa=B("label",{class:"sr-only",for:"ac-comment"},"Your comment",-1),La=["onKeydown"],Ka={class:"p-2 rounded-b-lg bg-base-300 flex items-center"},Ma={class:"text-xs text-neutral-content/50"},Na={key:0,class:"alert alert-error mx-4"},za=["disabled"],Ua={key:0,class:"loading loading-spinner"},Da=Yn({...{name:"CommentForm"},setup(e){const t=_o(),n=Ts(),s=Oe("ApiBaseUrl"),i=Oe("Auth0Domain"),o="0.1.6",r=G(!1),c=G(""),a=G("");async function l(p){if(!t.user.value)return f();if(!p.target.matches(":invalid")){r.value=!0;try{const g=await t.getAccessTokenSilently(),y=await fetch(s+"/api/comment",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:JSON.stringify({comment:c.value,postId:n.postId,domain:i})});if(!y.ok)throw new Error("Failed to post comment");const x=await y.json();n.addComment(x.data,c.value,t.user.value),c.value=""}catch(g){a.value=g.message||String(g)}r.value=!1}}function f(){t.loginWithPopup()}function d(p){const g=navigator.userAgent.match(/Macintosh/);(g&&p.metaKey||!g&&p.ctrlKey)&&l(p)}return(p,g)=>(oe(),ae("form",{class:"mb-6",onSubmit:qc(l,["prevent"])},[B("div",Ra,[Fa,Fr(B("textarea",{class:"textarea textarea-bordered bg-base-200 rounded-b-none",id:"ac-comment",rows:"3",placeholder:"Write a comment...",required:"",onKeydown:Qc(d,["enter"]),"onUpdate:modelValue":g[0]||(g[0]=y=>c.value=y)},null,40,La),[[Bc,c.value]]),B("div",Ka,[B("div",Ma,"v"+Fe(Q(o)),1),a.value?(oe(),ae("div",Na,[B("p",null,Fe(a.value),1)])):bn("",!0),B("button",{class:"btn btn-primary btn-sm ml-auto",disabled:r.value},[r.value?(oe(),ae("span",Ua)):bn("",!0),rs("Post comment")],8,za)])])],40,Aa))}});function In(e){return e<10?`0${e}`:`${e}`}function yo(e){const t=e.getFullYear(),n=e.getMonth()+1,s=e.getDate();return`${t}-${In(n)}-${In(s)}`}function Wa(e){const t=new Date,n=yo(e);if(yo(t)===n){const s=e.getHours(),i=e.getMinutes();return`${In(s)}:${In(i)}`}return n}const $a={key:0,class:"comments-wrapper"},Ha=["onAnimationend"],Za={class:"flex justify-between items-center mb-2"},Va={class:"flex items-center text-sm text-gray-900 dark:text-white"},Xa=["src","alt"],Ba=["datetime","title"],Ja={class:"text-gray-500 dark:text-gray-400"},Ya={key:1,class:"pt-8 text-center"},qa=[B("span",{class:"loading loading-spinner"},null,-1)],Ga=Yn({...{name:"CommentSections"},setup(e){const t=Ts();return t.loadComments(),(n,s)=>Q(t).isLoaded?(oe(),ae("div",$a,[(oe(!0),ae(ve,null,Br(Q(t).comments,i=>(oe(),ae("article",{class:Jt(["p-6 text-base bg-white rounded-lg dark:bg-gray-900",{"animated flash":i.isNew}]),key:i.id,onAnimationend:o=>i.isNew=!1},[B("footer",Za,[B("div",Va,[B("img",{class:"mr-2 w-6 h-6 rounded-full",src:i.user.avatar,alt:i.user.name},null,8,Xa),rs(Fe(i.user.name),1),B("time",{class:"text-xs text-gray-600 ml-4 dark:text-gray-400",pubdate:"",datetime:i.createdAt,title:i.createdAt},Fe(Q(Wa)(i.createdAt)),9,Ba)])]),B("p",Ja,Fe(i.content),1)],42,Ha))),128))])):(oe(),ae("div",Ya,qa))}}),Qa={class:"awesome-comment"},el={key:0,class:"alert alert-error mb-4"},tl={class:"flex justify-between items-center py-2"},nl={class:"text-lg font-bold text-neutral-content"},sl={key:0,class:"loading loading-spinner"},il={key:1,class:"dropdown dropdown-end"},ol={key:0,class:"avatar flex",tabindex:"0"},rl={class:"w-6 h-6 rounded-full"},cl=["alt","src"],al={key:1,class:"btn btn-ghost",tabindex:"0"},ll={class:"dropdown-content z-10 menu p-2 shadow bg-base-100 rounded-box w-52",tabindex:"0"},ul={key:0,class:"border-b border-neutral pb-2 mb-2 pointer-events-none"},fl=["disabled"],dl=["disabled"],hl=Yn({__name:"App",setup(e){const t=Ts(),{isAuthenticated:n,isLoading:s,user:i,loginWithPopup:o,logout:r}=_o();function c(){o()}function a(){r()}return(l,f)=>(oe(),ae("div",Qa,[Q(t).message?(oe(),ae("div",el,[B("p",null,Fe(Q(t).message),1)])):bn("",!0),B("header",tl,[B("h2",nl,"Discussion ("+Fe(Q(t).total)+")",1),Q(s)?(oe(),ae("span",sl)):(oe(),ae("div",il,[Q(n)&&Q(i)?(oe(),ae(ve,{key:0},[Q(i).picture?(oe(),ae("label",ol,[B("div",rl,[B("img",{class:"w-full h-full block",alt:Q(i).name||Q(i).email,src:Q(i).picture},null,8,cl)])])):(oe(),ae("label",al,Fe(Q(i).email),1)),B("ul",ll,[Q(i).picture?(oe(),ae("li",ul,[B("span",null,Fe(Q(i).email),1)])):bn("",!0),B("li",null,[B("button",{type:"button",disabled:Q(s),onClick:a},"Logout",8,fl)])])],64)):(oe(),ae("button",{key:1,class:"btn btn-secondary btn-xs",type:"button",disabled:Q(s),onClick:c},"Login",8,dl))]))]),xe(Da),xe(Ga)]))}});function pl(e,t){const n=na(hl),s=oa(),i=ja({domain:e,clientId:t,authorizationParams:{redirect_uri:window.location.origin}});return n.use(i),n.use(s),n}return{init(e,t,n,s,i){const o=pl(s,i);o.provide("ApiBaseUrl",n),o.provide("postId",t),o.provide("Auth0Domain",s),o.mount(e)}}}();
|
|
8
|
+
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)s=t.cache;else{if(n=t.cacheLocation||"memory",!mo(n))throw new Error(`Invalid cache location "${n}"`);s=mo(n)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?vt:ka,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(r=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:xa;var o;this.scope=xn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ya(i,this.options.clientId),this.nowProvider=this.options.nowProvider||co,this.cacheManager=new ba(s,s.allKeys?void 0:new Ta(s,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((r,c)=>r?r.startsWith("https://")?r:`https://${r}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.worker=new Ia)}_url(t){const n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||ro)));return`${this.domainUrl}${t}&auth0Client=${n}`}_authorizeUrl(t){return this._url(`/authorize?${vs(t)}`)}async _verifyIdToken(t,n,s){const i=await this.nowProvider();return(r=>{if(!r.id_token)throw new Error("ID token is required but missing");const c=(d=>{const p=d.split("."),[g,y,x]=p;if(p.length!==3||!g||!y||!x)throw new Error("ID token could not be decoded");const R=JSON.parse(uo(y)),E={__raw:d},O={};return Object.keys(R).forEach(L=>{E[L]=R[L],wa.includes(L)||(O[L]=R[L])}),{encoded:{header:g,payload:y,signature:x},header:JSON.parse(uo(g)),claims:E,user:O}})(r.id_token);if(!c.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(c.claims.iss!==r.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${r.iss}", found "${c.claims.iss}"`);if(!c.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(c.header.alg!=="RS256")throw new Error(`Signature algorithm of "${c.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!c.claims.aud||typeof c.claims.aud!="string"&&!Array.isArray(c.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(c.claims.aud)){if(!c.claims.aud.includes(r.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but was not one of "${c.claims.aud.join(", ")}"`);if(c.claims.aud.length>1){if(!c.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(c.claims.azp!==r.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${r.aud}", found "${c.claims.azp}"`)}}else if(c.claims.aud!==r.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but found "${c.claims.aud}"`);if(r.nonce){if(!c.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(c.claims.nonce!==r.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${r.nonce}", found "${c.claims.nonce}"`)}if(r.max_age&&!zt(c.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(c.claims.exp==null||!zt(c.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!zt(c.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const a=r.leeway||60,l=new Date(r.now||Date.now()),f=new Date(0);if(f.setUTCSeconds(c.claims.exp+a),l>f)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${l}) is after expiration time (${f})`);if(c.claims.nbf!=null&&zt(c.claims.nbf)){const d=new Date(0);if(d.setUTCSeconds(c.claims.nbf-a),l<d)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${l}) is before ${d}`)}if(c.claims.auth_time!=null&&zt(c.claims.auth_time)){const d=new Date(0);if(d.setUTCSeconds(parseInt(c.claims.auth_time)+r.max_age+a),l>d)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${l}) is after last auth at ${d}`)}if(r.organizationId){if(!c.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(r.organizationId!==c.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${r.organizationId}", found "${c.claims.org_id}"`)}return c})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organizationId:s,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:i});var o}_processOrgIdHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,s){const i=lo(ws()),o=lo(ws()),r=ws(),c=(f=>{const d=new Uint8Array(f);return(p=>{const g={"+":"-","/":"_","=":""};return p.replace(/[+/=]/g,y=>g[y])})(window.btoa(String.fromCharCode(...Array.from(d))))})(await(async f=>await kn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(f)))(r)),a=((f,d,p,g,y,x,R,E)=>Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),p),{scope:xn(d,p.scope),response_type:"code",response_mode:E||"query",state:g,nonce:y,redirect_uri:R||f.authorizationParams.redirect_uri,code_challenge:x,code_challenge_method:"S256"}))(this.options,this.scope,t,i,o,c,t.redirect_uri||this.options.authorizationParams.redirect_uri||s,n?.response_mode),l=this._authorizeUrl(a);return{nonce:o,code_verifier:r,scope:a.scope,audience:a.audience||"default",redirect_uri:a.redirect_uri,state:i,url:l}}async loginWithPopup(t,n){var s;if(t=t||{},!(n=n||{}).popup&&(n.popup=(c=>{const a=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${a},top=${l},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!n.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const i=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=i.url;const o=await(c=>new Promise((a,l)=>{let f;const d=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(d),clearTimeout(p),window.removeEventListener("message",f,!1),l(new bs(c.popup)))},1e3),p=setTimeout(()=>{clearInterval(d),l(new _s(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(g){if(g.data&&g.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(d),window.removeEventListener("message",f,!1),c.popup.close(),g.data.response.error)return l(ge.fromPayload(g.data.response));a(g.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(i.state!==o.state)throw new Error("Invalid state");const r=((s=t.authorizationParams)===null||s===void 0?void 0:s.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:i.redirect_uri},{nonceIn:i.nonce,organizationId:r})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var n;const s=go(t),{openUrl:i,fragment:o,appState:r}=s,c=Pe(s,["openUrl","fragment","appState"]),a=((n=c.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:f}=l,d=Pe(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:r}),a&&{organizationId:a}));const p=o?`${f}#${o}`:f;i?await i(p):window.location.assign(p)}async handleRedirectCallback(t=window.location.href){const n=t.split("?").slice(1);if(n.length===0)throw new Error("There are no query params available for parsing.");const{state:s,code:i,error:o,error_description:r}=(d=>{d.indexOf("#")>-1&&(d=d.substring(0,d.indexOf("#")));const p=new URLSearchParams(d);return{state:p.get("state"),code:p.get("code")||void 0,error:p.get("error")||void 0,error_description:p.get("error_description")||void 0}})(n.join("")),c=this.transactionManager.get();if(!c)throw new Error("Invalid state");if(this.transactionManager.remove(),o)throw new gs(o,r||o,s,c.appState);if(!c.code_verifier||c.state&&c.state!==s)throw new Error("Invalid state");const a=c.organizationId,l=c.nonce,f=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:i},f?{redirect_uri:f}:{}),{nonceIn:l,organizationId:a}),{appState:c.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var n;const s=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:xn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})}),i=await((o,r)=>{let c=xs[r];return c||(c=o().finally(()=>{delete xs[r],c=null}),xs[r]=c),c})(()=>this._getTokenSilently(s),`${this.options.clientId}::${s.authorizationParams.audience}::${s.authorizationParams.scope}`);return t.detailedResponse?i:i?.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,s=Pe(t,["cacheMode"]);if(n!=="off"){const i=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(i)return i}if(n!=="cache-only"){if(!await(async(i,o=3)=>{for(let r=0;r<o;r++)if(await i())return!0;return!1})(()=>Is.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Nt;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),n!=="off"){const l=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(l)return l}const i=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(s):await this._getTokenFromIFrame(s),{id_token:o,access_token:r,oauthTokenScope:c,expires_in:a}=i;return Object.assign(Object.assign({id_token:o,access_token:r},c?{scope:c}:null),{expires_in:a})}finally{await Is.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},n={}){var s;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:xn(this.scope,(s=t.authorizationParams)===null||s===void 0?void 0:s.scope)})});return n=Object.assign(Object.assign({},ha),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new Ee({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:s}=n,i=Pe(n,["federated"]),o=s?"&federated":"";return this._url(`/v2/logout?${vs(Object.assign({clientId:t.clientId},i))}`)+o}async logout(t={}){const n=go(t),{openUrl:s}=n,i=Pe(n,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const o=this._buildLogoutUrl(i);s?await s(o):s!==!1&&window.location.assign(o)}async _getTokenFromIFrame(t){const n=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),s=this.cookieStorage.get(this.orgHintCookieName);s&&!n.organization&&(n.organization=s);const{url:i,state:o,nonce:r,code_verifier:c,redirect_uri:a,scope:l,audience:f}=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ge("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const d=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,p=await((y,x,R=60)=>new Promise((E,O)=>{const L=window.document.createElement("iframe");L.setAttribute("width","0"),L.setAttribute("height","0"),L.style.display="none";const j=()=>{window.document.body.contains(L)&&(window.document.body.removeChild(L),window.removeEventListener("message",H,!1))};let H;const _e=setTimeout(()=>{O(new Nt),j()},1e3*R);H=function(ee){if(ee.origin!=x||!ee.data||ee.data.type!=="authorization_response")return;const M=ee.source;M&&M.close(),ee.data.response.error?O(ge.fromPayload(ee.data.response)):E(ee.data.response),clearTimeout(_e),window.removeEventListener("message",H,!1),setTimeout(j,2e3)},window.addEventListener("message",H,!1),window.document.body.appendChild(L),L.setAttribute("src",y)}))(i,this.domainUrl,d);if(o!==p.state)throw new Error("Invalid state");const g=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:c,code:p.code,grant_type:"authorization_code",redirect_uri:a,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:r});return Object.assign(Object.assign({},g),{scope:l,oauthTokenScope:g.scope,audience:f})}catch(d){throw d.error==="login_required"&&this.logout({openUrl:!1}),d}}async _getTokenUsingRefreshToken(t){const n=await this.cacheManager.get(new Ee({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new vn(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const s=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,i=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const o=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:s}),i&&{timeout:i}));return Object.assign(Object.assign({},o),{scope:t.authorizationParams.scope,oauthTokenScope:o.scope,audience:t.authorizationParams.audience||"default"})}catch(o){if((o.message.indexOf("Missing Refresh Token")>-1||o.message&&o.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw o}}async _saveEntryInCache(t){const{id_token:n,decodedToken:s}=t,i=Pe(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:s}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(i)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=await this.cacheManager.getIdToken(new Ee({clientId:this.options.clientId,audience:t,scope:this.scope})),s=this.userCache.get("@@user@@");return n&&n.id_token===s?.id_token?s:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:t,audience:n,clientId:s}){const i=await this.cacheManager.get(new Ee({scope:t,audience:n,clientId:s}),60);if(i&&i.access_token){const{access_token:o,oauthTokenScope:r,expires_in:c}=i,a=await this._getIdTokenFromCache();return a&&Object.assign(Object.assign({id_token:a.id_token,access_token:o},r?{scope:r}:null),{expires_in:c})}}async _requestToken(t,n){const{nonceIn:s,organizationId:i}=n||{},o=await ga(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),r=await this._verifyIdToken(o.id_token,s,i);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:r,scope:t.scope,audience:t.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(r.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:r})}}function Ut(e){e?.redirect_uri&&(console.warn("Using `redirect_uri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=e.authorizationParams||{},e.authorizationParams.redirect_uri=e.redirect_uri,delete e.redirect_uri)}const ot=()=>{console.error("Please ensure Auth0's Vue plugin is correctly installed.")},Sa={isLoading:G(!1),isAuthenticated:G(!1),user:G(void 0),idTokenClaims:G(void 0),error:G(null),loginWithPopup:ot,loginWithRedirect:ot,getAccessTokenSilently:ot,getAccessTokenWithPopup:ot,logout:ot,checkSession:ot,handleRedirectCallback:ot},Pa=G(Sa);class Ea{constructor(t,n){var s,i;this.clientOptions=t,this.pluginOptions=n,this._isLoading=G(!0),this._isAuthenticated=G(!1),this._user=G({}),this._idTokenClaims=G(),this._error=G(null),this.isLoading=Je(this._isLoading),this.isAuthenticated=Je(this._isAuthenticated),this.user=Je(this._user),this.idTokenClaims=Je(this._idTokenClaims),this.error=Je(this._error),s=this,i=["constructor"],Object.getOwnPropertyNames(Object.getPrototypeOf(s)).filter(o=>!i.includes(o)).forEach(o=>s[o]=s[o].bind(s))}install(t){this._client=new Ca(Object.assign(Object.assign({},this.clientOptions),{auth0Client:{name:"auth0-vue",version:"2.2.1"}})),this.__checkSession(t.config.globalProperties.$router),t.config.globalProperties.$auth0=this,t.provide(oo,this),Pa.value=this}async loginWithRedirect(t){return Ut(t),this._client.loginWithRedirect(t)}async loginWithPopup(t,n){return Ut(t),this.__proxy(()=>this._client.loginWithPopup(t,n))}async logout(t){return t?.openUrl||t?.openUrl===!1?this.__proxy(()=>this._client.logout(t)):this._client.logout(t)}async getAccessTokenSilently(t={}){return Ut(t),this.__proxy(()=>this._client.getTokenSilently(t))}async getAccessTokenWithPopup(t,n){return Ut(t),this.__proxy(()=>this._client.getTokenWithPopup(t,n))}async checkSession(t){return this.__proxy(()=>this._client.checkSession(t))}async handleRedirectCallback(t){return this.__proxy(()=>this._client.handleRedirectCallback(t))}async __checkSession(t){var n,s,i;const o=window.location.search;try{if((o.includes("code=")||o.includes("error="))&&o.includes("state=")&&!(!((n=this.pluginOptions)===null||n===void 0)&&n.skipRedirectCallback)){const r=await this.handleRedirectCallback(),c=r?.appState,a=(s=c?.target)!==null&&s!==void 0?s:"/";return window.history.replaceState({},"","/"),t&&t.push(a),r}await this.checkSession()}catch{window.history.replaceState({},"","/"),t&&t.push(((i=this.pluginOptions)===null||i===void 0?void 0:i.errorPath)||"/")}}async __refreshState(){this._isAuthenticated.value=await this._client.isAuthenticated(),this._user.value=await this._client.getUser(),this._idTokenClaims.value=await this._client.getIdTokenClaims(),this._isLoading.value=!1}async __proxy(t,n=!0){let s;try{s=await t(),this._error.value=null}catch(i){throw this._error.value=i,i}finally{n&&await this.__refreshState()}return s}}function ja(e,t){return Ut(e),new Ea(e,t)}function _o(){return Oe(oo)}const wl="",vl="",kl="";var bo=(e=>(e[e.Pending=0]="Pending",e[e.Approved=1]="Approved",e[e.Rejected=2]="Rejected",e[e.Deleted=3]="Deleted",e))(bo||{});const Ts=fa("store",()=>{const e=Oe("postId"),t=G(!1),n=G(0),s=G(""),i=G([]),o=G(0);async function r(){s.value="";const a=Oe("ApiBaseUrl"),l=await fetch(`${a}/api/comments?postId=${e}&start=${n.value}`);if(!l.ok){s.value="Load comments failed. "+l.statusText,t.value=!0;return}const f=await l.json();if(f.code!==0){s.value="Load comments failed. "+f.message,t.value=!0;return}return i.value=f.data.map(d=>{const{user:p,created_at:g,...y}=d;return{...y,createdAt:new Date(g),user:JSON.parse(d.user)}}),o.value=f.meta?.total||0,t.value=!0,f}function c(a,l,f){const{sub:d="",name:p="",picture:g="",email:y="",nickname:x=""}=f;i.value.unshift({id:a,postId:e,content:l,ancestorId:-1,parentId:-1,createdAt:new Date,user:{avatar:g,email:y,name:x||p},userId:d,status:bo.Approved,isNew:!0}),o.value++}return{isLoaded:t,message:s,postId:e,comments:i,total:o,loadComments:r,addComment:c}}),Aa=["onSubmit"],Ra={class:"ac-form-control border border-neutral bg-base-200 rounded-lg"},Fa=B("label",{class:"sr-only",for:"ac-comment"},"Your comment",-1),La=["onKeydown"],Ka={class:"p-2 rounded-b-lg bg-base-300 flex items-center"},Ma={class:"text-xs text-neutral/50"},Na={key:0,class:"ac-alert ac-alert-error mx-4"},za=["disabled"],Ua={key:0,class:"ac-loading ac-loading-spinner"},Da=Yn({...{name:"CommentForm"},setup(e){const t=_o(),n=Ts(),s=Oe("ApiBaseUrl"),i=Oe("Auth0Domain"),o="0.1.7",r=G(!1),c=G(""),a=G("");async function l(p){if(!t.user.value)return f();if(!p.target.matches(":invalid")){r.value=!0;try{const g=await t.getAccessTokenSilently(),y=await fetch(s+"/api/comment",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:JSON.stringify({comment:c.value,postId:n.postId,domain:i})});if(!y.ok)throw new Error("Failed to post comment");const x=await y.json();n.addComment(x.data,c.value,t.user.value),c.value=""}catch(g){a.value=g.message||String(g)}r.value=!1}}function f(){t.loginWithPopup()}function d(p){const g=navigator.userAgent.match(/Macintosh/);(g&&p.metaKey||!g&&p.ctrlKey)&&l(p)}return(p,g)=>(oe(),ae("form",{class:"mb-6",onSubmit:qc(l,["prevent"])},[B("div",Ra,[Fa,Fr(B("textarea",{class:"ac-textarea ac-textarea-bordered bg-base-200 rounded-b-none",id:"ac-comment",rows:"3",placeholder:"Write a comment...",required:"",onKeydown:Qc(d,["enter"]),"onUpdate:modelValue":g[0]||(g[0]=y=>c.value=y)},null,40,La),[[Bc,c.value]]),B("div",Ka,[B("div",Ma,"v"+Fe(Q(o)),1),a.value?(oe(),ae("div",Na,[B("p",null,Fe(a.value),1)])):bn("",!0),B("button",{class:"ac-btn ac-btn-primary ac-btn-sm ml-auto",disabled:r.value},[r.value?(oe(),ae("span",Ua)):bn("",!0),rs("Post comment")],8,za)])])],40,Aa))}});function In(e){return e<10?`0${e}`:`${e}`}function yo(e){const t=e.getFullYear(),n=e.getMonth()+1,s=e.getDate();return`${t}-${In(n)}-${In(s)}`}function Wa(e){const t=new Date,n=yo(e);if(yo(t)===n){const s=e.getHours(),i=e.getMinutes();return`${In(s)}:${In(i)}`}return n}const $a={key:0,class:"comments-wrapper"},Ha=["onAnimationend"],Za={class:"flex justify-between items-center mb-2"},Va={class:"flex items-center text-sm text-gray-900 dark:text-white"},Xa=["src","alt"],Ba=["datetime","title"],Ja={class:"text-gray-500 dark:text-gray-400"},Ya={key:1,class:"pt-8 text-center"},qa=[B("span",{class:"ac-loading ac-loading-spinner"},null,-1)],Ga=Yn({...{name:"CommentSections"},setup(e){const t=Ts();return t.loadComments(),(n,s)=>Q(t).isLoaded?(oe(),ae("div",$a,[(oe(!0),ae(ve,null,Br(Q(t).comments,i=>(oe(),ae("article",{class:Jt(["p-6 text-base bg-base-100 rounded-lg dark:bg-gray-900",{"animated flash":i.isNew}]),key:i.id,onAnimationend:o=>i.isNew=!1},[B("footer",Za,[B("div",Va,[B("img",{class:"mr-2 w-6 h-6 rounded-full",src:i.user.avatar,alt:i.user.name},null,8,Xa),rs(Fe(i.user.name),1),B("time",{class:"text-xs text-gray-600 ml-4 dark:text-gray-400",pubdate:"",datetime:i.createdAt,title:i.createdAt},Fe(Q(Wa)(i.createdAt)),9,Ba)])]),B("p",Ja,Fe(i.content),1)],42,Ha))),128))])):(oe(),ae("div",Ya,qa))}}),Qa={class:"awesome-comment"},el={key:0,class:"ac-alert ac-alert-error mb-4"},tl={class:"flex justify-between items-center py-2"},nl={class:"text-lg font-bold text-neutral my-0"},sl={key:0,class:"ac-loading ac-loading-spinner"},il={key:1,class:"ac-dropdown ac-dropdown-end"},ol={key:0,class:"ac-avatar flex",tabindex:"0"},rl={class:"w-6 h-6 rounded-full"},cl=["alt","src"],al={key:1,class:"ac-btn ac-btn-ghost",tabindex:"0"},ll={class:"ac-dropdown-content z-10 ac-menu p-2 shadow bg-base-100 rounded-box w-52",tabindex:"0"},ul={key:0,class:"border-b border-neutral pb-2 mb-2 pointer-events-none"},fl=["disabled"],dl=["disabled"],hl=Yn({__name:"App",setup(e){const t=Ts(),{isAuthenticated:n,isLoading:s,user:i,loginWithPopup:o,logout:r}=_o();function c(){o()}function a(){r()}return(l,f)=>(oe(),ae("div",Qa,[Q(t).message?(oe(),ae("div",el,[B("p",null,Fe(Q(t).message),1)])):bn("",!0),B("header",tl,[B("h2",nl,"Discussion ("+Fe(Q(t).total)+")",1),Q(s)?(oe(),ae("span",sl)):(oe(),ae("div",il,[Q(n)&&Q(i)?(oe(),ae(ve,{key:0},[Q(i).picture?(oe(),ae("label",ol,[B("div",rl,[B("img",{class:"w-full h-full block",alt:Q(i).name||Q(i).email,src:Q(i).picture},null,8,cl)])])):(oe(),ae("label",al,Fe(Q(i).email),1)),B("ul",ll,[Q(i).picture?(oe(),ae("li",ul,[B("span",null,Fe(Q(i).email),1)])):bn("",!0),B("li",null,[B("button",{type:"button",disabled:Q(s),onClick:a},"Logout",8,fl)])])],64)):(oe(),ae("button",{key:1,class:"ac-btn ac-btn-secondary ac-btn-xs",type:"button",disabled:Q(s),onClick:c},"Login",8,dl))]))]),xe(Da),xe(Ga)]))}});function pl(e,t){const n=na(hl),s=oa(),i=ja({domain:e,clientId:t,authorizationParams:{redirect_uri:window.location.origin}});return n.use(i),n.use(s),n}return{init(e,t,n,s,i){const o=pl(s,i);o.provide("ApiBaseUrl",n),o.provide("postId",t),o.provide("Auth0Domain",s),o.mount(e)}}}();
|
package/dist/awesome-comment.js
CHANGED
|
@@ -4775,21 +4775,21 @@ const Cs = pa("store", () => {
|
|
|
4775
4775
|
loadComments: r,
|
|
4776
4776
|
addComment: c
|
|
4777
4777
|
};
|
|
4778
|
-
}), La = ["onSubmit"], Ka = { class: "form-control border border-neutral bg-base-200 rounded-lg" }, Ma = /* @__PURE__ */ B("label", {
|
|
4778
|
+
}), La = ["onSubmit"], Ka = { class: "ac-form-control border border-neutral bg-base-200 rounded-lg" }, Ma = /* @__PURE__ */ B("label", {
|
|
4779
4779
|
class: "sr-only",
|
|
4780
4780
|
for: "ac-comment"
|
|
4781
|
-
}, "Your comment", -1), Na = ["onKeydown"], za = { class: "p-2 rounded-b-lg bg-base-300 flex items-center" }, Ua = { class: "text-xs text-neutral
|
|
4781
|
+
}, "Your comment", -1), Na = ["onKeydown"], za = { class: "p-2 rounded-b-lg bg-base-300 flex items-center" }, Ua = { class: "text-xs text-neutral/50" }, Da = {
|
|
4782
4782
|
key: 0,
|
|
4783
|
-
class: "alert alert-error mx-4"
|
|
4783
|
+
class: "ac-alert ac-alert-error mx-4"
|
|
4784
4784
|
}, Wa = ["disabled"], $a = {
|
|
4785
4785
|
key: 0,
|
|
4786
|
-
class: "loading loading-spinner"
|
|
4786
|
+
class: "ac-loading ac-loading-spinner"
|
|
4787
4787
|
}, Ha = {
|
|
4788
4788
|
name: "CommentForm"
|
|
4789
4789
|
}, Za = /* @__PURE__ */ ms({
|
|
4790
4790
|
...Ha,
|
|
4791
4791
|
setup(e) {
|
|
4792
|
-
const t = xo(), n = Cs(), s = Re("ApiBaseUrl"), i = Re("Auth0Domain"), o = "0.1.
|
|
4792
|
+
const t = xo(), n = Cs(), s = Re("ApiBaseUrl"), i = Re("Auth0Domain"), o = "0.1.7", r = q(!1), c = q(""), a = q("");
|
|
4793
4793
|
async function l(p) {
|
|
4794
4794
|
if (!t.user.value)
|
|
4795
4795
|
return f();
|
|
@@ -4832,7 +4832,7 @@ const Cs = pa("store", () => {
|
|
|
4832
4832
|
B("div", Ka, [
|
|
4833
4833
|
Ma,
|
|
4834
4834
|
Mr(B("textarea", {
|
|
4835
|
-
class: "textarea textarea-bordered bg-base-200 rounded-b-none",
|
|
4835
|
+
class: "ac-textarea ac-textarea-bordered bg-base-200 rounded-b-none",
|
|
4836
4836
|
id: "ac-comment",
|
|
4837
4837
|
rows: "3",
|
|
4838
4838
|
placeholder: "Write a comment...",
|
|
@@ -4848,7 +4848,7 @@ const Cs = pa("store", () => {
|
|
|
4848
4848
|
B("p", null, Ke(a.value), 1)
|
|
4849
4849
|
])) : un("", !0),
|
|
4850
4850
|
B("button", {
|
|
4851
|
-
class: "btn btn-primary btn-sm ml-auto",
|
|
4851
|
+
class: "ac-btn ac-btn-primary ac-btn-sm ml-auto",
|
|
4852
4852
|
disabled: r.value
|
|
4853
4853
|
}, [
|
|
4854
4854
|
r.value ? (oe(), ce("span", $a)) : un("", !0),
|
|
@@ -4880,7 +4880,7 @@ const Xa = {
|
|
|
4880
4880
|
}, Ba = ["onAnimationend"], Ja = { class: "flex justify-between items-center mb-2" }, Ya = { class: "flex items-center text-sm text-gray-900 dark:text-white" }, qa = ["src", "alt"], Ga = ["datetime", "title"], Qa = { class: "text-gray-500 dark:text-gray-400" }, el = {
|
|
4881
4881
|
key: 1,
|
|
4882
4882
|
class: "pt-8 text-center"
|
|
4883
|
-
}, tl = /* @__PURE__ */ B("span", { class: "loading loading-spinner" }, null, -1), nl = [
|
|
4883
|
+
}, tl = /* @__PURE__ */ B("span", { class: "ac-loading ac-loading-spinner" }, null, -1), nl = [
|
|
4884
4884
|
tl
|
|
4885
4885
|
], sl = {
|
|
4886
4886
|
name: "CommentSections"
|
|
@@ -4890,7 +4890,7 @@ const Xa = {
|
|
|
4890
4890
|
const t = Cs();
|
|
4891
4891
|
return t.loadComments(), (n, s) => te(t).isLoaded ? (oe(), ce("div", Xa, [
|
|
4892
4892
|
(oe(!0), ce(ye, null, qr(te(t).comments, (i) => (oe(), ce("article", {
|
|
4893
|
-
class: mn(["p-6 text-base bg-
|
|
4893
|
+
class: mn(["p-6 text-base bg-base-100 rounded-lg dark:bg-gray-900", { "animated flash": i.isNew }]),
|
|
4894
4894
|
key: i.id,
|
|
4895
4895
|
onAnimationend: (o) => i.isNew = !1
|
|
4896
4896
|
}, [
|
|
@@ -4916,23 +4916,23 @@ const Xa = {
|
|
|
4916
4916
|
}
|
|
4917
4917
|
}), ol = { class: "awesome-comment" }, rl = {
|
|
4918
4918
|
key: 0,
|
|
4919
|
-
class: "alert alert-error mb-4"
|
|
4920
|
-
}, cl = { class: "flex justify-between items-center py-2" }, al = { class: "text-lg font-bold text-neutral-
|
|
4919
|
+
class: "ac-alert ac-alert-error mb-4"
|
|
4920
|
+
}, cl = { class: "flex justify-between items-center py-2" }, al = { class: "text-lg font-bold text-neutral my-0" }, ll = {
|
|
4921
4921
|
key: 0,
|
|
4922
|
-
class: "loading loading-spinner"
|
|
4922
|
+
class: "ac-loading ac-loading-spinner"
|
|
4923
4923
|
}, ul = {
|
|
4924
4924
|
key: 1,
|
|
4925
|
-
class: "dropdown dropdown-end"
|
|
4925
|
+
class: "ac-dropdown ac-dropdown-end"
|
|
4926
4926
|
}, fl = {
|
|
4927
4927
|
key: 0,
|
|
4928
|
-
class: "avatar flex",
|
|
4928
|
+
class: "ac-avatar flex",
|
|
4929
4929
|
tabindex: "0"
|
|
4930
4930
|
}, dl = { class: "w-6 h-6 rounded-full" }, hl = ["alt", "src"], pl = {
|
|
4931
4931
|
key: 1,
|
|
4932
|
-
class: "btn btn-ghost",
|
|
4932
|
+
class: "ac-btn ac-btn-ghost",
|
|
4933
4933
|
tabindex: "0"
|
|
4934
4934
|
}, ml = {
|
|
4935
|
-
class: "dropdown-content z-10 menu p-2 shadow bg-base-100 rounded-box w-52",
|
|
4935
|
+
class: "ac-dropdown-content z-10 ac-menu p-2 shadow bg-base-100 rounded-box w-52",
|
|
4936
4936
|
tabindex: "0"
|
|
4937
4937
|
}, gl = {
|
|
4938
4938
|
key: 0,
|
|
@@ -4984,7 +4984,7 @@ const Xa = {
|
|
|
4984
4984
|
])
|
|
4985
4985
|
], 64)) : (oe(), ce("button", {
|
|
4986
4986
|
key: 1,
|
|
4987
|
-
class: "btn btn-secondary btn-xs",
|
|
4987
|
+
class: "ac-btn ac-btn-secondary ac-btn-xs",
|
|
4988
4988
|
type: "button",
|
|
4989
4989
|
disabled: te(s),
|
|
4990
4990
|
onClick: c
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
*/let eo;const vn=e=>eo=e,to=Symbol();function ds(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Nt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Nt||(Nt={}));function oa(){const e=Ms(!0),t=e.run(()=>G({}));let n=[],s=[];const i=cn({install(o){vn(i),i._a=o,o.provide(to,i),o.config.globalProperties.$pinia=i,s.forEach(r=>n.push(r)),s=[]},use(o){return!this._a&&!ia?s.push(o):n.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const no=()=>{};function so(e,t,n,s=no){e.push(t);const i=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),s())};return!n&&Ns()&&Mo(i),i}function wt(e,...t){e.slice().forEach(n=>{n(...t)})}const ra=e=>e();function hs(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,s)=>e.set(s,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];ds(i)&&ds(s)&&e.hasOwnProperty(n)&&!q(s)&&!We(s)?e[n]=hs(i,s):e[n]=s}return e}const ca=Symbol();function aa(e){return!ds(e)||!e.hasOwnProperty(ca)}const{assign:Ze}=Object;function la(e){return!!(q(e)&&e.effect)}function ua(e,t,n,s){const{state:i,actions:o,getters:r}=t,c=n.state.value[e];let a;function l(){c||(n.state.value[e]=i?i():{});const f=mr(n.state.value[e]);return Ze(f,o,Object.keys(r||{}).reduce((d,p)=>(d[p]=cn(Hi(()=>{vn(n);const g=n._s.get(e);return r[p].call(g,g)})),d),{}))}return a=io(e,l,t,n,s,!0),a}function io(e,t,n={},s,i,o){let r;const c=Ze({actions:{}},n),a={deep:!0};let l,f,d=[],p=[],g;const y=s.state.value[e];!o&&!y&&(s.state.value[e]={}),G({});let x;function R(M){let D;l=f=!1,typeof M=="function"?(M(s.state.value[e]),D={type:Nt.patchFunction,storeId:e,events:g}):(hs(s.state.value[e],M),D={type:Nt.patchObject,payload:M,storeId:e,events:g});const ie=x=Symbol();ci().then(()=>{x===ie&&(l=!0)}),f=!0,wt(d,D,s.state.value[e])}const E=o?function(){const{state:D}=n,ie=D?D():{};this.$patch(he=>{Ze(he,ie)})}:no;function O(){r.stop(),d=[],p=[],s._s.delete(e)}function L(M,D){return function(){vn(s);const ie=Array.from(arguments),he=[],je=[];function xt($){he.push($)}function Wt($){je.push($)}wt(p,{args:ie,name:M,store:Z,after:xt,onError:Wt});let Ve;try{Ve=D.apply(this&&this.$id===e?this:Z,ie)}catch($){throw wt(je,$),$}return Ve instanceof Promise?Ve.then($=>(wt(he,$),$)).catch($=>(wt(je,$),Promise.reject($))):(wt(he,Ve),Ve)}}const j={_p:s,$id:e,$onAction:so.bind(null,p),$patch:R,$reset:E,$subscribe(M,D={}){const ie=so(d,M,D.detached,()=>he()),he=r.run(()=>dn(()=>s.state.value[e],je=>{(D.flush==="sync"?f:l)&&M({storeId:e,type:Nt.direct,events:g},je)},Ze({},a,D)));return ie},$dispose:O},Z=on(j);s._s.set(e,Z);const _e=s._a&&s._a.runWithContext||ra,ee=s._e.run(()=>(r=Ms(),_e(()=>r.run(t))));for(const M in ee){const D=ee[M];if(q(D)&&!la(D)||We(D))o||(y&&aa(D)&&(q(D)?D.value=y[M]:hs(D,y[M])),s.state.value[e][M]=D);else if(typeof D=="function"){const ie=L(M,D);ee[M]=ie,c.actions[M]=D}}return Ze(Z,ee),Ze(U(Z),ee),Object.defineProperty(Z,"$state",{get:()=>s.state.value[e],set:M=>{R(D=>{Ze(D,M)})}}),s._p.forEach(M=>{Ze(Z,r.run(()=>M({store:Z,app:s._a,pinia:s,options:c})))}),y&&o&&n.hydrate&&n.hydrate(Z.$state,y),l=!0,f=!0,Z}function fa(e,t,n){let s,i;const o=typeof t=="function";typeof e=="string"?(s=e,i=o?n:t):(i=e,s=e.id);function r(c,a){const l=ic();return c=c||(l?Oe(to,null):null),c&&vn(c),c=eo,c._s.has(s)||(o?io(s,t,i,c):ua(s,i,c)),c._s.get(s)}return r.$id=s,r}const oo=Symbol("$auth0");function Pe(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n}var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ps(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ms(e,t){return e(t={exports:{}},t.exports),t.exports}var it=ms(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function s(){var i=this;this.locked=new Map,this.addToLocked=function(o,r){var c=i.locked.get(o);c===void 0?r===void 0?i.locked.set(o,[]):i.locked.set(o,[r]):r!==void 0&&(c.unshift(r),i.locked.set(o,c))},this.isLocked=function(o){return i.locked.has(o)},this.lock=function(o){return new Promise(function(r,c){i.isLocked(o)?i.addToLocked(o,r):(i.addToLocked(o),r())})},this.unlock=function(o){var r=i.locked.get(o);if(r!==void 0&&r.length!==0){var c=r.pop();i.locked.set(o,r),c!==void 0&&setTimeout(c,0)}else i.locked.delete(o)}}return s.getInstance=function(){return s.instance===void 0&&(s.instance=new s),s.instance},s}();t.default=function(){return n.getInstance()}});ps(it);var da=ps(ms(function(e,t){var n=vt&&vt.__awaiter||function(a,l,f,d){return new(f||(f=Promise))(function(p,g){function y(E){try{R(d.next(E))}catch(O){g(O)}}function x(E){try{R(d.throw(E))}catch(O){g(O)}}function R(E){E.done?p(E.value):new f(function(O){O(E.value)}).then(y,x)}R((d=d.apply(a,l||[])).next())})},s=vt&&vt.__generator||function(a,l){var f,d,p,g,y={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(R){return function(E){return function(O){if(f)throw new TypeError("Generator is already executing.");for(;y;)try{if(f=1,d&&(p=2&O[0]?d.return:O[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,O[1])).done)return p;switch(d=0,p&&(O=[2&O[0],p.value]),O[0]){case 0:case 1:p=O;break;case 4:return y.label++,{value:O[1],done:!1};case 5:y.label++,d=O[1],O=[0];continue;case 7:O=y.ops.pop(),y.trys.pop();continue;default:if(!((p=(p=y.trys).length>0&&p[p.length-1])||O[0]!==6&&O[0]!==2)){y=0;continue}if(O[0]===3&&(!p||O[1]>p[0]&&O[1]<p[3])){y.label=O[1];break}if(O[0]===6&&y.label<p[1]){y.label=p[1],p=O;break}if(p&&y.label<p[2]){y.label=p[2],y.ops.push(O);break}p[2]&&y.ops.pop(),y.trys.pop();continue}O=l.call(a,y)}catch(L){O=[6,L],d=0}finally{f=p=0}if(5&O[0])throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}([R,E])}}};Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key";function o(a){return new Promise(function(l){return setTimeout(l,a)})}function r(a){for(var l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",f="",d=0;d<a;d++)f+=l[Math.floor(Math.random()*l.length)];return f}var c=function(){function a(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+r(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),a.waiters===void 0&&(a.waiters=[])}return a.prototype.acquireLock=function(l,f){return f===void 0&&(f=5e3),n(this,void 0,void 0,function(){var d,p,g,y,x,R;return s(this,function(E){switch(E.label){case 0:d=Date.now()+r(4),p=Date.now()+f,g=i+"-"+l,y=window.localStorage,E.label=1;case 1:return Date.now()<p?[4,o(30)]:[3,8];case 2:return E.sent(),y.getItem(g)!==null?[3,5]:(x=this.id+"-"+l+"-"+d,[4,o(Math.floor(25*Math.random()))]);case 3:return E.sent(),y.setItem(g,JSON.stringify({id:this.id,iat:d,timeoutKey:x,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return E.sent(),(R=y.getItem(g))!==null&&(R=JSON.parse(R)).id===this.id&&R.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(g,d),[2,!0]):[3,7];case 5:return a.lockCorrector(),[4,this.waitForSomethingToChange(p)];case 6:E.sent(),E.label=7;case 7:return d=Date.now()+r(4),[3,1];case 8:return[2,!1]}})})},a.prototype.refreshLockWhileAcquired=function(l,f){return n(this,void 0,void 0,function(){var d=this;return s(this,function(p){return setTimeout(function(){return n(d,void 0,void 0,function(){var g,y;return s(this,function(x){switch(x.label){case 0:return[4,it.default().lock(f)];case 1:return x.sent(),this.acquiredIatSet.has(f)?(g=window.localStorage,(y=g.getItem(l))===null?(it.default().unlock(f),[2]):((y=JSON.parse(y)).timeRefreshed=Date.now(),g.setItem(l,JSON.stringify(y)),it.default().unlock(f),this.refreshLockWhileAcquired(l,f),[2])):(it.default().unlock(f),[2])}})})},1e3),[2]})})},a.prototype.waitForSomethingToChange=function(l){return n(this,void 0,void 0,function(){return s(this,function(f){switch(f.label){case 0:return[4,new Promise(function(d){var p=!1,g=Date.now(),y=!1;function x(){if(y||(window.removeEventListener("storage",x),a.removeFromWaiting(x),clearTimeout(R),y=!0),!p){p=!0;var E=50-(Date.now()-g);E>0?setTimeout(d,E):d()}}window.addEventListener("storage",x),a.addToWaiting(x);var R=setTimeout(x,Math.max(0,l-Date.now()))})];case 1:return f.sent(),[2]}})})},a.addToWaiting=function(l){this.removeFromWaiting(l),a.waiters!==void 0&&a.waiters.push(l)},a.removeFromWaiting=function(l){a.waiters!==void 0&&(a.waiters=a.waiters.filter(function(f){return f!==l}))},a.notifyWaiters=function(){a.waiters!==void 0&&a.waiters.slice().forEach(function(l){return l()})},a.prototype.releaseLock=function(l){return n(this,void 0,void 0,function(){return s(this,function(f){switch(f.label){case 0:return[4,this.releaseLock__private__(l)];case 1:return[2,f.sent()]}})})},a.prototype.releaseLock__private__=function(l){return n(this,void 0,void 0,function(){var f,d,p;return s(this,function(g){switch(g.label){case 0:return f=window.localStorage,d=i+"-"+l,(p=f.getItem(d))===null?[2]:(p=JSON.parse(p)).id!==this.id?[3,2]:[4,it.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),f.removeItem(d),it.default().unlock(p.iat),a.notifyWaiters(),g.label=2;case 2:return[2]}})})},a.lockCorrector=function(){for(var l=Date.now()-5e3,f=window.localStorage,d=Object.keys(f),p=!1,g=0;g<d.length;g++){var y=d[g];if(y.includes(i)){var x=f.getItem(y);x!==null&&((x=JSON.parse(x)).timeRefreshed===void 0&&x.timeAcquired<l||x.timeRefreshed!==void 0&&x.timeRefreshed<l)&&(f.removeItem(y),p=!0)}}p&&a.notifyWaiters()},a.waiters=void 0,a}();t.default=c}));const ha={timeoutInSeconds:60},ro={name:"auth0-spa-js",version:"2.0.4"},co=()=>Date.now();class ge extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,ge.prototype)}static fromPayload({error:t,error_description:n}){return new ge(t,n)}}class gs extends ge{constructor(t,n,s,i=null){super(t,n),this.state=s,this.appState=i,Object.setPrototypeOf(this,gs.prototype)}}class zt extends ge{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,zt.prototype)}}class _s extends zt{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,_s.prototype)}}class bs extends ge{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,bs.prototype)}}class ys extends ge{constructor(t,n,s){super(t,n),this.mfa_token=s,Object.setPrototypeOf(this,ys.prototype)}}class kn extends ge{constructor(t,n){super("missing_refresh_token",`Missing Refresh Token (audience: '${ao(t,["default"])}', scope: '${ao(n)}')`),this.audience=t,this.scope=n,Object.setPrototypeOf(this,kn.prototype)}}function ao(e,t=[]){return e&&!t.includes(e)?e:""}const xn=()=>window.crypto,ws=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(xn().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%e.length]),t},lo=e=>btoa(e),vs=e=>{var{clientId:t}=e,n=Pe(e,["clientId"]);return new URLSearchParams((s=>Object.keys(s).filter(i=>s[i]!==void 0).reduce((i,o)=>Object.assign(Object.assign({},i),{[o]:s[o]}),{}))(Object.assign({client_id:t},n))).toString()},uo=e=>(t=>decodeURIComponent(atob(t).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),pa=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json()}},ma=async(e,t,n,s,i,o,r=1e4)=>i?(async(c,a,l,f,d,p,g)=>{return y={auth:{audience:a,scope:l},timeout:d,fetchUrl:c,fetchOptions:f,useFormData:g},x=p,new Promise(function(R,E){const O=new MessageChannel;O.port1.onmessage=function(L){L.data.error?E(new Error(L.data.error)):R(L.data),O.port1.close()},x.postMessage(y,[O.port2])});var y,x})(e,t,n,s,r,i,o):(async(c,a,l)=>{const f=new AbortController;let d;return a.signal=f.signal,Promise.race([pa(c,a),new Promise((p,g)=>{d=setTimeout(()=>{f.abort(),g(new Error("Timeout when executing 'fetch'"))},l)})]).finally(()=>{clearTimeout(d)})})(e,s,r);async function ga(e,t){var{baseUrl:n,timeout:s,audience:i,scope:o,auth0Client:r,useFormData:c}=e,a=Pe(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const l=c?vs(a):JSON.stringify(a);return await async function(f,d,p,g,y,x,R){let E,O=null;for(let M=0;M<3;M++)try{E=await ma(f,p,g,y,x,R,d),O=null;break}catch(D){O=D}if(O)throw O;const L=E.json,{error:j,error_description:Z}=L,_e=Pe(L,["error","error_description"]),{ok:ee}=E;if(!ee){const M=Z||`HTTP error. Unable to fetch ${f}`;throw j==="mfa_required"?new ys(j,M,_e.mfa_token):j==="missing_refresh_token"?new kn(p,g):new ge(j||"request_error",M)}return _e}(`${n}/oauth/token`,s,i||"default",o,{method:"POST",body:l,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(r||ro))}},t,c)}const In=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};class Ee{constructor(t,n="@@auth0spajs@@",s){this.prefix=n,this.suffix=s,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,s,i,o]=t.split("::");return new Ee({clientId:s,scope:o,audience:i},n)}static fromCacheEntry(t){const{scope:n,audience:s,client_id:i}=t;return new Ee({scope:n,audience:s,clientId:i})}}class _a{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}}class fo{constructor(){this.enclosedCache=function(){let t={};return{set(n,s){t[n]=s},get(n){const s=t[n];if(s)return s},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}}()}}class ba{constructor(t,n,s){this.cache=t,this.keyManifest=n,this.nowProvider=s||co}async setIdToken(t,n,s){var i;const o=this.getIdTokenCacheKey(t);await this.cache.set(o,{id_token:n,decodedToken:s}),await((i=this.keyManifest)===null||i===void 0?void 0:i.add(o))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const s=await this.get(t);return!s||!s.id_token||!s.decodedToken?void 0:{id_token:s.id_token,decodedToken:s.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t,n=0){var s;let i=await this.cache.get(t.toKey());if(!i){const c=await this.getCacheKeys();if(!c)return;const a=this.matchExistingCacheKey(t,c);a&&(i=await this.cache.get(a))}if(!i)return;const o=await this.nowProvider(),r=Math.floor(o/1e3);return i.expiresAt-n<r?i.body.refresh_token?(i.body={refresh_token:i.body.refresh_token},await this.cache.set(t.toKey(),i),i.body):(await this.cache.remove(t.toKey()),void await((s=this.keyManifest)===null||s===void 0?void 0:s.remove(t.toKey()))):i.body}async set(t){var n;const s=new Ee({clientId:t.client_id,scope:t.scope,audience:t.audience}),i=await this.wrapCacheEntry(t);await this.cache.set(s.toKey(),i),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(s.toKey()))}async clear(t){var n;const s=await this.getCacheKeys();s&&(await s.filter(i=>!t||i.includes(t)).reduce(async(i,o)=>{await i,await this.cache.remove(o)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new Ee({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,n){return n.filter(s=>{var i;const o=Ee.fromKey(s),r=new Set(o.scope&&o.scope.split(" ")),c=((i=t.scope)===null||i===void 0?void 0:i.split(" "))||[],a=o.scope&&c.reduce((l,f)=>l&&r.has(f),!0);return o.prefix==="@@auth0spajs@@"&&o.clientId===t.clientId&&o.audience===t.audience&&a})[0]}}class ya{constructor(t,n){this.storage=t,this.clientId=n,this.storageKey=`a0.spajs.txs.${this.clientId}`,this.transaction=this.storage.get(this.storageKey)}create(t){this.transaction=t,this.storage.save(this.storageKey,t,{daysUntilExpire:1})}get(){return this.transaction}remove(){delete this.transaction,this.storage.remove(this.storageKey)}}const Ut=e=>typeof e=="number",wa=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var ot=ms(function(e,t){var n=vt&&vt.__assign||function(){return n=Object.assign||function(a){for(var l,f=1,d=arguments.length;f<d;f++)for(var p in l=arguments[f])Object.prototype.hasOwnProperty.call(l,p)&&(a[p]=l[p]);return a},n.apply(this,arguments)};function s(a,l){if(!l)return"";var f="; "+a;return l===!0?f:f+"="+l}function i(a,l,f){return encodeURIComponent(a).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(d){if(typeof d.expires=="number"){var p=new Date;p.setMilliseconds(p.getMilliseconds()+864e5*d.expires),d.expires=p}return s("Expires",d.expires?d.expires.toUTCString():"")+s("Domain",d.domain)+s("Path",d.path)+s("Secure",d.secure)+s("SameSite",d.sameSite)}(f)}function o(a){for(var l={},f=a?a.split("; "):[],d=/(%[\dA-F]{2})+/gi,p=0;p<f.length;p++){var g=f[p].split("="),y=g.slice(1).join("=");y.charAt(0)==='"'&&(y=y.slice(1,-1));try{l[g[0].replace(d,decodeURIComponent)]=y.replace(d,decodeURIComponent)}catch{}}return l}function r(){return o(document.cookie)}function c(a,l,f){document.cookie=i(a,l,n({path:"/"},f))}t.__esModule=!0,t.encode=i,t.parse=o,t.getAll=r,t.get=function(a){return r()[a]},t.set=c,t.remove=function(a,l){c(a,"",n(n({},l),{expires:-1}))}});ps(ot),ot.encode,ot.parse,ot.getAll;var va=ot.get,ho=ot.set,po=ot.remove;const kt={get(e){const t=va(e);if(t!==void 0)return JSON.parse(t)},save(e,t,n){let s={};window.location.protocol==="https:"&&(s={secure:!0,sameSite:"none"}),n?.daysUntilExpire&&(s.expires=n.daysUntilExpire),n?.cookieDomain&&(s.domain=n.cookieDomain),ho(e,JSON.stringify(t),s)},remove(e,t){let n={};t?.cookieDomain&&(n.domain=t.cookieDomain),po(e,n)}},ka={get:e=>kt.get(e)||kt.get(`_legacy_${e}`),save(e,t,n){let s={};window.location.protocol==="https:"&&(s={secure:!0}),n?.daysUntilExpire&&(s.expires=n.daysUntilExpire),n?.cookieDomain&&(s.domain=n.cookieDomain),ho(`_legacy_${e}`,JSON.stringify(t),s),kt.save(e,t,n)},remove(e,t){let n={};t?.cookieDomain&&(n.domain=t.cookieDomain),po(e,n),kt.remove(e,t),kt.remove(`_legacy_${e}`,t)}},xa={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var ks,Ia=function(e){return ks=ks||function(t,n,s){var i=n===void 0?null:n,o=function(l,f){var d=atob(l);if(f){for(var p=new Uint8Array(d.length),g=0,y=d.length;g<y;++g)p[g]=d.charCodeAt(g);return String.fromCharCode.apply(null,new Uint16Array(p.buffer))}return d}(t,s!==void 0&&s),r=o.indexOf(`
|
|
6
6
|
`,10)+1,c=o.substring(r)+(i?"//# sourceMappingURL="+i:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9Y29uc3Qgcz1lPT57dmFye2NsaWVudElkOnR9PWUscj1mdW5jdGlvbihlLHQpe3ZhciByPXt9O2Zvcih2YXIgcyBpbiBlKU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChlLHMpJiZ0LmluZGV4T2Yocyk8MCYmKHJbc109ZVtzXSk7aWYobnVsbCE9ZSYmImZ1bmN0aW9uIj09dHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMpe3ZhciBvPTA7Zm9yKHM9T2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyhlKTtvPHMubGVuZ3RoO28rKyl0LmluZGV4T2Yoc1tvXSk8MCYmT2JqZWN0LnByb3RvdHlwZS5wcm9wZXJ0eUlzRW51bWVyYWJsZS5jYWxsKGUsc1tvXSkmJihyW3Nbb11dPWVbc1tvXV0pfXJldHVybiByfShlLFsiY2xpZW50SWQiXSk7cmV0dXJuIG5ldyBVUkxTZWFyY2hQYXJhbXMoKGU9Pk9iamVjdC5rZXlzKGUpLmZpbHRlcigodD0+dm9pZCAwIT09ZVt0XSkpLnJlZHVjZSgoKHQscik9Pk9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSx0KSx7W3JdOmVbcl19KSkse30pKShPYmplY3QuYXNzaWduKHtjbGllbnRfaWQ6dH0scikpKS50b1N0cmluZygpfTtsZXQgbz17fTtjb25zdCBuPShlLHQpPT5gJHtlfXwke3R9YDthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoYXN5bmMoe2RhdGE6e3RpbWVvdXQ6ZSxhdXRoOnIsZmV0Y2hVcmw6aSxmZXRjaE9wdGlvbnM6Yyx1c2VGb3JtRGF0YTphfSxwb3J0czpbZl19KT0+e2xldCBwO2NvbnN0e2F1ZGllbmNlOmwsc2NvcGU6dX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2NvbnN0IGU9KChlLHQpPT5vW24oZSx0KV0pKGwsdSk7aWYoIWUpdGhyb3cgbmV3IHQobCx1KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjplfSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjplfSkpfWxldCBkLGc7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGQ9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1kLnNpZ25hbCk7dHJ5e2c9YXdhaXQgUHJvbWlzZS5yYWNlKFsoaD1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsaCkpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIGYucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFnKXJldHVybiBkJiZkLmFib3J0KCksdm9pZCBmLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO3A9YXdhaXQgZy5qc29uKCkscC5yZWZyZXNoX3Rva2VuPygoKGUsdCxyKT0+e29bbih0LHIpXT1lfSkocC5yZWZyZXNoX3Rva2VuLGwsdSksZGVsZXRlIHAucmVmcmVzaF90b2tlbik6KChlLHQpPT57ZGVsZXRlIG9bbihlLHQpXX0pKGwsdSksZi5wb3N0TWVzc2FnZSh7b2s6Zy5vayxqc29uOnB9KX1jYXRjaChlKXtmLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjplLmVycm9yLGVycm9yX2Rlc2NyaXB0aW9uOmUubWVzc2FnZX19KX12YXIgaH0pKX0oKTsKCg==",null,!1),new Worker(ks,e)};const xs={};class Ta{constructor(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var n;const s=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);s.add(t),await this.cache.set(this.manifestKey,{keys:[...s]})}async remove(t){const n=await this.cache.get(this.manifestKey);if(n){const s=new Set(n.keys);return s.delete(t),s.size>0?await this.cache.set(this.manifestKey,{keys:[...s]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}}const Oa={memory:()=>new fo().enclosedCache,localstorage:()=>new _a},mo=e=>Oa[e],go=e=>{const{openUrl:t,onRedirect:n}=e,s=Pe(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},s),{openUrl:t===!1||t?t:n})},Is=new da;class Ca{constructor(t){let n,s;if(this.userCache=new fo().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await Is.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!xn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(xn().subtle===void 0)throw new Error(`
|
|
7
7
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
8
|
-
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)s=t.cache;else{if(n=t.cacheLocation||"memory",!mo(n))throw new Error(`Invalid cache location "${n}"`);s=mo(n)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?kt:ka,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(r=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:xa;var o;this.scope=In("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ya(i,this.options.clientId),this.nowProvider=this.options.nowProvider||co,this.cacheManager=new ba(s,s.allKeys?void 0:new Ta(s,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((r,c)=>r?r.startsWith("https://")?r:`https://${r}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.worker=new Ia)}_url(t){const n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||ro)));return`${this.domainUrl}${t}&auth0Client=${n}`}_authorizeUrl(t){return this._url(`/authorize?${vs(t)}`)}async _verifyIdToken(t,n,s){const i=await this.nowProvider();return(r=>{if(!r.id_token)throw new Error("ID token is required but missing");const c=(d=>{const p=d.split("."),[g,y,x]=p;if(p.length!==3||!g||!y||!x)throw new Error("ID token could not be decoded");const R=JSON.parse(uo(y)),E={__raw:d},O={};return Object.keys(R).forEach(L=>{E[L]=R[L],wa.includes(L)||(O[L]=R[L])}),{encoded:{header:g,payload:y,signature:x},header:JSON.parse(uo(g)),claims:E,user:O}})(r.id_token);if(!c.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(c.claims.iss!==r.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${r.iss}", found "${c.claims.iss}"`);if(!c.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(c.header.alg!=="RS256")throw new Error(`Signature algorithm of "${c.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!c.claims.aud||typeof c.claims.aud!="string"&&!Array.isArray(c.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(c.claims.aud)){if(!c.claims.aud.includes(r.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but was not one of "${c.claims.aud.join(", ")}"`);if(c.claims.aud.length>1){if(!c.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(c.claims.azp!==r.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${r.aud}", found "${c.claims.azp}"`)}}else if(c.claims.aud!==r.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but found "${c.claims.aud}"`);if(r.nonce){if(!c.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(c.claims.nonce!==r.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${r.nonce}", found "${c.claims.nonce}"`)}if(r.max_age&&!Ut(c.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(c.claims.exp==null||!Ut(c.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ut(c.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const a=r.leeway||60,l=new Date(r.now||Date.now()),f=new Date(0);if(f.setUTCSeconds(c.claims.exp+a),l>f)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${l}) is after expiration time (${f})`);if(c.claims.nbf!=null&&Ut(c.claims.nbf)){const d=new Date(0);if(d.setUTCSeconds(c.claims.nbf-a),l<d)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${l}) is before ${d}`)}if(c.claims.auth_time!=null&&Ut(c.claims.auth_time)){const d=new Date(0);if(d.setUTCSeconds(parseInt(c.claims.auth_time)+r.max_age+a),l>d)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${l}) is after last auth at ${d}`)}if(r.organizationId){if(!c.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(r.organizationId!==c.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${r.organizationId}", found "${c.claims.org_id}"`)}return c})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organizationId:s,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:i});var o}_processOrgIdHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,s){const i=lo(ws()),o=lo(ws()),r=ws(),c=(f=>{const d=new Uint8Array(f);return(p=>{const g={"+":"-","/":"_","=":""};return p.replace(/[+/=]/g,y=>g[y])})(window.btoa(String.fromCharCode(...Array.from(d))))})(await(async f=>await xn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(f)))(r)),a=((f,d,p,g,y,x,R,E)=>Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),p),{scope:In(d,p.scope),response_type:"code",response_mode:E||"query",state:g,nonce:y,redirect_uri:R||f.authorizationParams.redirect_uri,code_challenge:x,code_challenge_method:"S256"}))(this.options,this.scope,t,i,o,c,t.redirect_uri||this.options.authorizationParams.redirect_uri||s,n?.response_mode),l=this._authorizeUrl(a);return{nonce:o,code_verifier:r,scope:a.scope,audience:a.audience||"default",redirect_uri:a.redirect_uri,state:i,url:l}}async loginWithPopup(t,n){var s;if(t=t||{},!(n=n||{}).popup&&(n.popup=(c=>{const a=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${a},top=${l},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!n.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const i=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=i.url;const o=await(c=>new Promise((a,l)=>{let f;const d=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(d),clearTimeout(p),window.removeEventListener("message",f,!1),l(new bs(c.popup)))},1e3),p=setTimeout(()=>{clearInterval(d),l(new _s(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(g){if(g.data&&g.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(d),window.removeEventListener("message",f,!1),c.popup.close(),g.data.response.error)return l(ge.fromPayload(g.data.response));a(g.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(i.state!==o.state)throw new Error("Invalid state");const r=((s=t.authorizationParams)===null||s===void 0?void 0:s.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:i.redirect_uri},{nonceIn:i.nonce,organizationId:r})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var n;const s=go(t),{openUrl:i,fragment:o,appState:r}=s,c=Pe(s,["openUrl","fragment","appState"]),a=((n=c.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:f}=l,d=Pe(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:r}),a&&{organizationId:a}));const p=o?`${f}#${o}`:f;i?await i(p):window.location.assign(p)}async handleRedirectCallback(t=window.location.href){const n=t.split("?").slice(1);if(n.length===0)throw new Error("There are no query params available for parsing.");const{state:s,code:i,error:o,error_description:r}=(d=>{d.indexOf("#")>-1&&(d=d.substring(0,d.indexOf("#")));const p=new URLSearchParams(d);return{state:p.get("state"),code:p.get("code")||void 0,error:p.get("error")||void 0,error_description:p.get("error_description")||void 0}})(n.join("")),c=this.transactionManager.get();if(!c)throw new Error("Invalid state");if(this.transactionManager.remove(),o)throw new gs(o,r||o,s,c.appState);if(!c.code_verifier||c.state&&c.state!==s)throw new Error("Invalid state");const a=c.organizationId,l=c.nonce,f=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:i},f?{redirect_uri:f}:{}),{nonceIn:l,organizationId:a}),{appState:c.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var n;const s=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:In(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})}),i=await((o,r)=>{let c=xs[r];return c||(c=o().finally(()=>{delete xs[r],c=null}),xs[r]=c),c})(()=>this._getTokenSilently(s),`${this.options.clientId}::${s.authorizationParams.audience}::${s.authorizationParams.scope}`);return t.detailedResponse?i:i?.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,s=Pe(t,["cacheMode"]);if(n!=="off"){const i=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(i)return i}if(n!=="cache-only"){if(!await(async(i,o=3)=>{for(let r=0;r<o;r++)if(await i())return!0;return!1})(()=>Is.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new zt;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),n!=="off"){const l=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(l)return l}const i=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(s):await this._getTokenFromIFrame(s),{id_token:o,access_token:r,oauthTokenScope:c,expires_in:a}=i;return Object.assign(Object.assign({id_token:o,access_token:r},c?{scope:c}:null),{expires_in:a})}finally{await Is.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},n={}){var s;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:In(this.scope,(s=t.authorizationParams)===null||s===void 0?void 0:s.scope)})});return n=Object.assign(Object.assign({},ha),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new Ee({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:s}=n,i=Pe(n,["federated"]),o=s?"&federated":"";return this._url(`/v2/logout?${vs(Object.assign({clientId:t.clientId},i))}`)+o}async logout(t={}){const n=go(t),{openUrl:s}=n,i=Pe(n,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const o=this._buildLogoutUrl(i);s?await s(o):s!==!1&&window.location.assign(o)}async _getTokenFromIFrame(t){const n=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),s=this.cookieStorage.get(this.orgHintCookieName);s&&!n.organization&&(n.organization=s);const{url:i,state:o,nonce:r,code_verifier:c,redirect_uri:a,scope:l,audience:f}=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ge("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const d=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,p=await((y,x,R=60)=>new Promise((E,O)=>{const L=window.document.createElement("iframe");L.setAttribute("width","0"),L.setAttribute("height","0"),L.style.display="none";const j=()=>{window.document.body.contains(L)&&(window.document.body.removeChild(L),window.removeEventListener("message",Z,!1))};let Z;const _e=setTimeout(()=>{O(new zt),j()},1e3*R);Z=function(ee){if(ee.origin!=x||!ee.data||ee.data.type!=="authorization_response")return;const M=ee.source;M&&M.close(),ee.data.response.error?O(ge.fromPayload(ee.data.response)):E(ee.data.response),clearTimeout(_e),window.removeEventListener("message",Z,!1),setTimeout(j,2e3)},window.addEventListener("message",Z,!1),window.document.body.appendChild(L),L.setAttribute("src",y)}))(i,this.domainUrl,d);if(o!==p.state)throw new Error("Invalid state");const g=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:c,code:p.code,grant_type:"authorization_code",redirect_uri:a,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:r});return Object.assign(Object.assign({},g),{scope:l,oauthTokenScope:g.scope,audience:f})}catch(d){throw d.error==="login_required"&&this.logout({openUrl:!1}),d}}async _getTokenUsingRefreshToken(t){const n=await this.cacheManager.get(new Ee({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new kn(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const s=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,i=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const o=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:s}),i&&{timeout:i}));return Object.assign(Object.assign({},o),{scope:t.authorizationParams.scope,oauthTokenScope:o.scope,audience:t.authorizationParams.audience||"default"})}catch(o){if((o.message.indexOf("Missing Refresh Token")>-1||o.message&&o.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw o}}async _saveEntryInCache(t){const{id_token:n,decodedToken:s}=t,i=Pe(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:s}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(i)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=await this.cacheManager.getIdToken(new Ee({clientId:this.options.clientId,audience:t,scope:this.scope})),s=this.userCache.get("@@user@@");return n&&n.id_token===s?.id_token?s:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:t,audience:n,clientId:s}){const i=await this.cacheManager.get(new Ee({scope:t,audience:n,clientId:s}),60);if(i&&i.access_token){const{access_token:o,oauthTokenScope:r,expires_in:c}=i,a=await this._getIdTokenFromCache();return a&&Object.assign(Object.assign({id_token:a.id_token,access_token:o},r?{scope:r}:null),{expires_in:c})}}async _requestToken(t,n){const{nonceIn:s,organizationId:i}=n||{},o=await ga(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),r=await this._verifyIdToken(o.id_token,s,i);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:r,scope:t.scope,audience:t.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(r.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:r})}}function Dt(e){e?.redirect_uri&&(console.warn("Using `redirect_uri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=e.authorizationParams||{},e.authorizationParams.redirect_uri=e.redirect_uri,delete e.redirect_uri)}const rt=()=>{console.error("Please ensure Auth0's Vue plugin is correctly installed.")},Sa={isLoading:G(!1),isAuthenticated:G(!1),user:G(void 0),idTokenClaims:G(void 0),error:G(null),loginWithPopup:rt,loginWithRedirect:rt,getAccessTokenSilently:rt,getAccessTokenWithPopup:rt,logout:rt,checkSession:rt,handleRedirectCallback:rt},Pa=G(Sa);class Ea{constructor(t,n){var s,i;this.clientOptions=t,this.pluginOptions=n,this._isLoading=G(!0),this._isAuthenticated=G(!1),this._user=G({}),this._idTokenClaims=G(),this._error=G(null),this.isLoading=Ye(this._isLoading),this.isAuthenticated=Ye(this._isAuthenticated),this.user=Ye(this._user),this.idTokenClaims=Ye(this._idTokenClaims),this.error=Ye(this._error),s=this,i=["constructor"],Object.getOwnPropertyNames(Object.getPrototypeOf(s)).filter(o=>!i.includes(o)).forEach(o=>s[o]=s[o].bind(s))}install(t){this._client=new Ca(Object.assign(Object.assign({},this.clientOptions),{auth0Client:{name:"auth0-vue",version:"2.2.1"}})),this.__checkSession(t.config.globalProperties.$router),t.config.globalProperties.$auth0=this,t.provide(oo,this),Pa.value=this}async loginWithRedirect(t){return Dt(t),this._client.loginWithRedirect(t)}async loginWithPopup(t,n){return Dt(t),this.__proxy(()=>this._client.loginWithPopup(t,n))}async logout(t){return t?.openUrl||t?.openUrl===!1?this.__proxy(()=>this._client.logout(t)):this._client.logout(t)}async getAccessTokenSilently(t={}){return Dt(t),this.__proxy(()=>this._client.getTokenSilently(t))}async getAccessTokenWithPopup(t,n){return Dt(t),this.__proxy(()=>this._client.getTokenWithPopup(t,n))}async checkSession(t){return this.__proxy(()=>this._client.checkSession(t))}async handleRedirectCallback(t){return this.__proxy(()=>this._client.handleRedirectCallback(t))}async __checkSession(t){var n,s,i;const o=window.location.search;try{if((o.includes("code=")||o.includes("error="))&&o.includes("state=")&&!(!((n=this.pluginOptions)===null||n===void 0)&&n.skipRedirectCallback)){const r=await this.handleRedirectCallback(),c=r?.appState,a=(s=c?.target)!==null&&s!==void 0?s:"/";return window.history.replaceState({},"","/"),t&&t.push(a),r}await this.checkSession()}catch{window.history.replaceState({},"","/"),t&&t.push(((i=this.pluginOptions)===null||i===void 0?void 0:i.errorPath)||"/")}}async __refreshState(){this._isAuthenticated.value=await this._client.isAuthenticated(),this._user.value=await this._client.getUser(),this._idTokenClaims.value=await this._client.getIdTokenClaims(),this._isLoading.value=!1}async __proxy(t,n=!0){let s;try{s=await t(),this._error.value=null}catch(i){throw this._error.value=i,i}finally{n&&await this.__refreshState()}return s}}function ja(e,t){return Dt(e),new Ea(e,t)}function _o(){return Oe(oo)}const wl="",vl="",kl="";var bo=(e=>(e[e.Pending=0]="Pending",e[e.Approved=1]="Approved",e[e.Rejected=2]="Rejected",e[e.Deleted=3]="Deleted",e))(bo||{});const Ts=fa("store",()=>{const e=Oe("postId"),t=G(!1),n=G(0),s=G(""),i=G([]),o=G(0);async function r(){s.value="";const a=Oe("ApiBaseUrl"),l=await fetch(`${a}/api/comments?postId=${e}&start=${n.value}`);if(!l.ok){s.value="Load comments failed. "+l.statusText,t.value=!0;return}const f=await l.json();if(f.code!==0){s.value="Load comments failed. "+f.message,t.value=!0;return}return i.value=f.data.map(d=>{const{user:p,created_at:g,...y}=d;return{...y,createdAt:new Date(g),user:JSON.parse(d.user)}}),o.value=f.meta?.total||0,t.value=!0,f}function c(a,l,f){const{sub:d="",name:p="",picture:g="",email:y="",nickname:x=""}=f;i.value.unshift({id:a,postId:e,content:l,ancestorId:-1,parentId:-1,createdAt:new Date,user:{avatar:g,email:y,name:x||p},userId:d,status:bo.Approved,isNew:!0}),o.value++}return{isLoaded:t,message:s,postId:e,comments:i,total:o,loadComments:r,addComment:c}}),Aa=["onSubmit"],Ra={class:"form-control border border-neutral bg-base-200 rounded-lg"},Fa=B("label",{class:"sr-only",for:"ac-comment"},"Your comment",-1),La=["onKeydown"],Ka={class:"p-2 rounded-b-lg bg-base-300 flex items-center"},Ma={class:"text-xs text-neutral-content/50"},Na={key:0,class:"alert alert-error mx-4"},za=["disabled"],Ua={key:0,class:"loading loading-spinner"},Da=Yn({...{name:"CommentForm"},setup(e){const t=_o(),n=Ts(),s=Oe("ApiBaseUrl"),i=Oe("Auth0Domain"),o="0.1.6",r=G(!1),c=G(""),a=G("");async function l(p){if(!t.user.value)return f();if(!p.target.matches(":invalid")){r.value=!0;try{const g=await t.getAccessTokenSilently(),y=await fetch(s+"/api/comment",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:JSON.stringify({comment:c.value,postId:n.postId,domain:i})});if(!y.ok)throw new Error("Failed to post comment");const x=await y.json();n.addComment(x.data,c.value,t.user.value),c.value=""}catch(g){a.value=g.message||String(g)}r.value=!1}}function f(){t.loginWithPopup()}function d(p){const g=navigator.userAgent.match(/Macintosh/);(g&&p.metaKey||!g&&p.ctrlKey)&&l(p)}return(p,g)=>(oe(),ae("form",{class:"mb-6",onSubmit:qc(l,["prevent"])},[B("div",Ra,[Fa,Fr(B("textarea",{class:"textarea textarea-bordered bg-base-200 rounded-b-none",id:"ac-comment",rows:"3",placeholder:"Write a comment...",required:"",onKeydown:Qc(d,["enter"]),"onUpdate:modelValue":g[0]||(g[0]=y=>c.value=y)},null,40,La),[[Bc,c.value]]),B("div",Ka,[B("div",Ma,"v"+Fe(Q(o)),1),a.value?(oe(),ae("div",Na,[B("p",null,Fe(a.value),1)])):yn("",!0),B("button",{class:"btn btn-primary btn-sm ml-auto",disabled:r.value},[r.value?(oe(),ae("span",Ua)):yn("",!0),rs("Post comment")],8,za)])])],40,Aa))}});function Tn(e){return e<10?`0${e}`:`${e}`}function yo(e){const t=e.getFullYear(),n=e.getMonth()+1,s=e.getDate();return`${t}-${Tn(n)}-${Tn(s)}`}function Wa(e){const t=new Date,n=yo(e);if(yo(t)===n){const s=e.getHours(),i=e.getMinutes();return`${Tn(s)}:${Tn(i)}`}return n}const $a={key:0,class:"comments-wrapper"},Ha=["onAnimationend"],Za={class:"flex justify-between items-center mb-2"},Va={class:"flex items-center text-sm text-gray-900 dark:text-white"},Xa=["src","alt"],Ba=["datetime","title"],Ja={class:"text-gray-500 dark:text-gray-400"},Ya={key:1,class:"pt-8 text-center"},qa=[B("span",{class:"loading loading-spinner"},null,-1)],Ga=Yn({...{name:"CommentSections"},setup(e){const t=Ts();return t.loadComments(),(n,s)=>Q(t).isLoaded?(oe(),ae("div",$a,[(oe(!0),ae(ve,null,Br(Q(t).comments,i=>(oe(),ae("article",{class:Yt(["p-6 text-base bg-white rounded-lg dark:bg-gray-900",{"animated flash":i.isNew}]),key:i.id,onAnimationend:o=>i.isNew=!1},[B("footer",Za,[B("div",Va,[B("img",{class:"mr-2 w-6 h-6 rounded-full",src:i.user.avatar,alt:i.user.name},null,8,Xa),rs(Fe(i.user.name),1),B("time",{class:"text-xs text-gray-600 ml-4 dark:text-gray-400",pubdate:"",datetime:i.createdAt,title:i.createdAt},Fe(Q(Wa)(i.createdAt)),9,Ba)])]),B("p",Ja,Fe(i.content),1)],42,Ha))),128))])):(oe(),ae("div",Ya,qa))}}),Qa={class:"awesome-comment"},el={key:0,class:"alert alert-error mb-4"},tl={class:"flex justify-between items-center py-2"},nl={class:"text-lg font-bold text-neutral-content"},sl={key:0,class:"loading loading-spinner"},il={key:1,class:"dropdown dropdown-end"},ol={key:0,class:"avatar flex",tabindex:"0"},rl={class:"w-6 h-6 rounded-full"},cl=["alt","src"],al={key:1,class:"btn btn-ghost",tabindex:"0"},ll={class:"dropdown-content z-10 menu p-2 shadow bg-base-100 rounded-box w-52",tabindex:"0"},ul={key:0,class:"border-b border-neutral pb-2 mb-2 pointer-events-none"},fl=["disabled"],dl=["disabled"],hl=Yn({__name:"App",setup(e){const t=Ts(),{isAuthenticated:n,isLoading:s,user:i,loginWithPopup:o,logout:r}=_o();function c(){o()}function a(){r()}return(l,f)=>(oe(),ae("div",Qa,[Q(t).message?(oe(),ae("div",el,[B("p",null,Fe(Q(t).message),1)])):yn("",!0),B("header",tl,[B("h2",nl,"Discussion ("+Fe(Q(t).total)+")",1),Q(s)?(oe(),ae("span",sl)):(oe(),ae("div",il,[Q(n)&&Q(i)?(oe(),ae(ve,{key:0},[Q(i).picture?(oe(),ae("label",ol,[B("div",rl,[B("img",{class:"w-full h-full block",alt:Q(i).name||Q(i).email,src:Q(i).picture},null,8,cl)])])):(oe(),ae("label",al,Fe(Q(i).email),1)),B("ul",ll,[Q(i).picture?(oe(),ae("li",ul,[B("span",null,Fe(Q(i).email),1)])):yn("",!0),B("li",null,[B("button",{type:"button",disabled:Q(s),onClick:a},"Logout",8,fl)])])],64)):(oe(),ae("button",{key:1,class:"btn btn-secondary btn-xs",type:"button",disabled:Q(s),onClick:c},"Login",8,dl))]))]),xe(Da),xe(Ga)]))}});function pl(e,t){const n=na(hl),s=oa(),i=ja({domain:e,clientId:t,authorizationParams:{redirect_uri:window.location.origin}});return n.use(i),n.use(s),n}return{init(e,t,n,s,i){const o=pl(s,i);o.provide("ApiBaseUrl",n),o.provide("postId",t),o.provide("Auth0Domain",s),o.mount(e)}}});
|
|
8
|
+
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)s=t.cache;else{if(n=t.cacheLocation||"memory",!mo(n))throw new Error(`Invalid cache location "${n}"`);s=mo(n)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?kt:ka,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(r=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:xa;var o;this.scope=In("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ya(i,this.options.clientId),this.nowProvider=this.options.nowProvider||co,this.cacheManager=new ba(s,s.allKeys?void 0:new Ta(s,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((r,c)=>r?r.startsWith("https://")?r:`https://${r}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.worker=new Ia)}_url(t){const n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||ro)));return`${this.domainUrl}${t}&auth0Client=${n}`}_authorizeUrl(t){return this._url(`/authorize?${vs(t)}`)}async _verifyIdToken(t,n,s){const i=await this.nowProvider();return(r=>{if(!r.id_token)throw new Error("ID token is required but missing");const c=(d=>{const p=d.split("."),[g,y,x]=p;if(p.length!==3||!g||!y||!x)throw new Error("ID token could not be decoded");const R=JSON.parse(uo(y)),E={__raw:d},O={};return Object.keys(R).forEach(L=>{E[L]=R[L],wa.includes(L)||(O[L]=R[L])}),{encoded:{header:g,payload:y,signature:x},header:JSON.parse(uo(g)),claims:E,user:O}})(r.id_token);if(!c.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(c.claims.iss!==r.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${r.iss}", found "${c.claims.iss}"`);if(!c.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(c.header.alg!=="RS256")throw new Error(`Signature algorithm of "${c.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!c.claims.aud||typeof c.claims.aud!="string"&&!Array.isArray(c.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(c.claims.aud)){if(!c.claims.aud.includes(r.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but was not one of "${c.claims.aud.join(", ")}"`);if(c.claims.aud.length>1){if(!c.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(c.claims.azp!==r.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${r.aud}", found "${c.claims.azp}"`)}}else if(c.claims.aud!==r.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${r.aud}" but found "${c.claims.aud}"`);if(r.nonce){if(!c.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(c.claims.nonce!==r.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${r.nonce}", found "${c.claims.nonce}"`)}if(r.max_age&&!Ut(c.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(c.claims.exp==null||!Ut(c.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ut(c.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const a=r.leeway||60,l=new Date(r.now||Date.now()),f=new Date(0);if(f.setUTCSeconds(c.claims.exp+a),l>f)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${l}) is after expiration time (${f})`);if(c.claims.nbf!=null&&Ut(c.claims.nbf)){const d=new Date(0);if(d.setUTCSeconds(c.claims.nbf-a),l<d)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${l}) is before ${d}`)}if(c.claims.auth_time!=null&&Ut(c.claims.auth_time)){const d=new Date(0);if(d.setUTCSeconds(parseInt(c.claims.auth_time)+r.max_age+a),l>d)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${l}) is after last auth at ${d}`)}if(r.organizationId){if(!c.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(r.organizationId!==c.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${r.organizationId}", found "${c.claims.org_id}"`)}return c})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organizationId:s,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:i});var o}_processOrgIdHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,s){const i=lo(ws()),o=lo(ws()),r=ws(),c=(f=>{const d=new Uint8Array(f);return(p=>{const g={"+":"-","/":"_","=":""};return p.replace(/[+/=]/g,y=>g[y])})(window.btoa(String.fromCharCode(...Array.from(d))))})(await(async f=>await xn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(f)))(r)),a=((f,d,p,g,y,x,R,E)=>Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),p),{scope:In(d,p.scope),response_type:"code",response_mode:E||"query",state:g,nonce:y,redirect_uri:R||f.authorizationParams.redirect_uri,code_challenge:x,code_challenge_method:"S256"}))(this.options,this.scope,t,i,o,c,t.redirect_uri||this.options.authorizationParams.redirect_uri||s,n?.response_mode),l=this._authorizeUrl(a);return{nonce:o,code_verifier:r,scope:a.scope,audience:a.audience||"default",redirect_uri:a.redirect_uri,state:i,url:l}}async loginWithPopup(t,n){var s;if(t=t||{},!(n=n||{}).popup&&(n.popup=(c=>{const a=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${a},top=${l},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!n.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const i=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=i.url;const o=await(c=>new Promise((a,l)=>{let f;const d=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(d),clearTimeout(p),window.removeEventListener("message",f,!1),l(new bs(c.popup)))},1e3),p=setTimeout(()=>{clearInterval(d),l(new _s(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(g){if(g.data&&g.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(d),window.removeEventListener("message",f,!1),c.popup.close(),g.data.response.error)return l(ge.fromPayload(g.data.response));a(g.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(i.state!==o.state)throw new Error("Invalid state");const r=((s=t.authorizationParams)===null||s===void 0?void 0:s.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:i.redirect_uri},{nonceIn:i.nonce,organizationId:r})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var n;const s=go(t),{openUrl:i,fragment:o,appState:r}=s,c=Pe(s,["openUrl","fragment","appState"]),a=((n=c.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:f}=l,d=Pe(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:r}),a&&{organizationId:a}));const p=o?`${f}#${o}`:f;i?await i(p):window.location.assign(p)}async handleRedirectCallback(t=window.location.href){const n=t.split("?").slice(1);if(n.length===0)throw new Error("There are no query params available for parsing.");const{state:s,code:i,error:o,error_description:r}=(d=>{d.indexOf("#")>-1&&(d=d.substring(0,d.indexOf("#")));const p=new URLSearchParams(d);return{state:p.get("state"),code:p.get("code")||void 0,error:p.get("error")||void 0,error_description:p.get("error_description")||void 0}})(n.join("")),c=this.transactionManager.get();if(!c)throw new Error("Invalid state");if(this.transactionManager.remove(),o)throw new gs(o,r||o,s,c.appState);if(!c.code_verifier||c.state&&c.state!==s)throw new Error("Invalid state");const a=c.organizationId,l=c.nonce,f=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:i},f?{redirect_uri:f}:{}),{nonceIn:l,organizationId:a}),{appState:c.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var n;const s=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:In(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})}),i=await((o,r)=>{let c=xs[r];return c||(c=o().finally(()=>{delete xs[r],c=null}),xs[r]=c),c})(()=>this._getTokenSilently(s),`${this.options.clientId}::${s.authorizationParams.audience}::${s.authorizationParams.scope}`);return t.detailedResponse?i:i?.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,s=Pe(t,["cacheMode"]);if(n!=="off"){const i=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(i)return i}if(n!=="cache-only"){if(!await(async(i,o=3)=>{for(let r=0;r<o;r++)if(await i())return!0;return!1})(()=>Is.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new zt;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),n!=="off"){const l=await this._getEntryFromCache({scope:s.authorizationParams.scope,audience:s.authorizationParams.audience||"default",clientId:this.options.clientId});if(l)return l}const i=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(s):await this._getTokenFromIFrame(s),{id_token:o,access_token:r,oauthTokenScope:c,expires_in:a}=i;return Object.assign(Object.assign({id_token:o,access_token:r},c?{scope:c}:null),{expires_in:a})}finally{await Is.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},n={}){var s;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:In(this.scope,(s=t.authorizationParams)===null||s===void 0?void 0:s.scope)})});return n=Object.assign(Object.assign({},ha),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new Ee({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:s}=n,i=Pe(n,["federated"]),o=s?"&federated":"";return this._url(`/v2/logout?${vs(Object.assign({clientId:t.clientId},i))}`)+o}async logout(t={}){const n=go(t),{openUrl:s}=n,i=Pe(n,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const o=this._buildLogoutUrl(i);s?await s(o):s!==!1&&window.location.assign(o)}async _getTokenFromIFrame(t){const n=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),s=this.cookieStorage.get(this.orgHintCookieName);s&&!n.organization&&(n.organization=s);const{url:i,state:o,nonce:r,code_verifier:c,redirect_uri:a,scope:l,audience:f}=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ge("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const d=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,p=await((y,x,R=60)=>new Promise((E,O)=>{const L=window.document.createElement("iframe");L.setAttribute("width","0"),L.setAttribute("height","0"),L.style.display="none";const j=()=>{window.document.body.contains(L)&&(window.document.body.removeChild(L),window.removeEventListener("message",Z,!1))};let Z;const _e=setTimeout(()=>{O(new zt),j()},1e3*R);Z=function(ee){if(ee.origin!=x||!ee.data||ee.data.type!=="authorization_response")return;const M=ee.source;M&&M.close(),ee.data.response.error?O(ge.fromPayload(ee.data.response)):E(ee.data.response),clearTimeout(_e),window.removeEventListener("message",Z,!1),setTimeout(j,2e3)},window.addEventListener("message",Z,!1),window.document.body.appendChild(L),L.setAttribute("src",y)}))(i,this.domainUrl,d);if(o!==p.state)throw new Error("Invalid state");const g=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:c,code:p.code,grant_type:"authorization_code",redirect_uri:a,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:r});return Object.assign(Object.assign({},g),{scope:l,oauthTokenScope:g.scope,audience:f})}catch(d){throw d.error==="login_required"&&this.logout({openUrl:!1}),d}}async _getTokenUsingRefreshToken(t){const n=await this.cacheManager.get(new Ee({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new kn(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const s=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,i=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const o=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:s}),i&&{timeout:i}));return Object.assign(Object.assign({},o),{scope:t.authorizationParams.scope,oauthTokenScope:o.scope,audience:t.authorizationParams.audience||"default"})}catch(o){if((o.message.indexOf("Missing Refresh Token")>-1||o.message&&o.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw o}}async _saveEntryInCache(t){const{id_token:n,decodedToken:s}=t,i=Pe(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:s}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(i)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=await this.cacheManager.getIdToken(new Ee({clientId:this.options.clientId,audience:t,scope:this.scope})),s=this.userCache.get("@@user@@");return n&&n.id_token===s?.id_token?s:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:t,audience:n,clientId:s}){const i=await this.cacheManager.get(new Ee({scope:t,audience:n,clientId:s}),60);if(i&&i.access_token){const{access_token:o,oauthTokenScope:r,expires_in:c}=i,a=await this._getIdTokenFromCache();return a&&Object.assign(Object.assign({id_token:a.id_token,access_token:o},r?{scope:r}:null),{expires_in:c})}}async _requestToken(t,n){const{nonceIn:s,organizationId:i}=n||{},o=await ga(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),r=await this._verifyIdToken(o.id_token,s,i);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:r,scope:t.scope,audience:t.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(r.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:r})}}function Dt(e){e?.redirect_uri&&(console.warn("Using `redirect_uri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=e.authorizationParams||{},e.authorizationParams.redirect_uri=e.redirect_uri,delete e.redirect_uri)}const rt=()=>{console.error("Please ensure Auth0's Vue plugin is correctly installed.")},Sa={isLoading:G(!1),isAuthenticated:G(!1),user:G(void 0),idTokenClaims:G(void 0),error:G(null),loginWithPopup:rt,loginWithRedirect:rt,getAccessTokenSilently:rt,getAccessTokenWithPopup:rt,logout:rt,checkSession:rt,handleRedirectCallback:rt},Pa=G(Sa);class Ea{constructor(t,n){var s,i;this.clientOptions=t,this.pluginOptions=n,this._isLoading=G(!0),this._isAuthenticated=G(!1),this._user=G({}),this._idTokenClaims=G(),this._error=G(null),this.isLoading=Ye(this._isLoading),this.isAuthenticated=Ye(this._isAuthenticated),this.user=Ye(this._user),this.idTokenClaims=Ye(this._idTokenClaims),this.error=Ye(this._error),s=this,i=["constructor"],Object.getOwnPropertyNames(Object.getPrototypeOf(s)).filter(o=>!i.includes(o)).forEach(o=>s[o]=s[o].bind(s))}install(t){this._client=new Ca(Object.assign(Object.assign({},this.clientOptions),{auth0Client:{name:"auth0-vue",version:"2.2.1"}})),this.__checkSession(t.config.globalProperties.$router),t.config.globalProperties.$auth0=this,t.provide(oo,this),Pa.value=this}async loginWithRedirect(t){return Dt(t),this._client.loginWithRedirect(t)}async loginWithPopup(t,n){return Dt(t),this.__proxy(()=>this._client.loginWithPopup(t,n))}async logout(t){return t?.openUrl||t?.openUrl===!1?this.__proxy(()=>this._client.logout(t)):this._client.logout(t)}async getAccessTokenSilently(t={}){return Dt(t),this.__proxy(()=>this._client.getTokenSilently(t))}async getAccessTokenWithPopup(t,n){return Dt(t),this.__proxy(()=>this._client.getTokenWithPopup(t,n))}async checkSession(t){return this.__proxy(()=>this._client.checkSession(t))}async handleRedirectCallback(t){return this.__proxy(()=>this._client.handleRedirectCallback(t))}async __checkSession(t){var n,s,i;const o=window.location.search;try{if((o.includes("code=")||o.includes("error="))&&o.includes("state=")&&!(!((n=this.pluginOptions)===null||n===void 0)&&n.skipRedirectCallback)){const r=await this.handleRedirectCallback(),c=r?.appState,a=(s=c?.target)!==null&&s!==void 0?s:"/";return window.history.replaceState({},"","/"),t&&t.push(a),r}await this.checkSession()}catch{window.history.replaceState({},"","/"),t&&t.push(((i=this.pluginOptions)===null||i===void 0?void 0:i.errorPath)||"/")}}async __refreshState(){this._isAuthenticated.value=await this._client.isAuthenticated(),this._user.value=await this._client.getUser(),this._idTokenClaims.value=await this._client.getIdTokenClaims(),this._isLoading.value=!1}async __proxy(t,n=!0){let s;try{s=await t(),this._error.value=null}catch(i){throw this._error.value=i,i}finally{n&&await this.__refreshState()}return s}}function ja(e,t){return Dt(e),new Ea(e,t)}function _o(){return Oe(oo)}const wl="",vl="",kl="";var bo=(e=>(e[e.Pending=0]="Pending",e[e.Approved=1]="Approved",e[e.Rejected=2]="Rejected",e[e.Deleted=3]="Deleted",e))(bo||{});const Ts=fa("store",()=>{const e=Oe("postId"),t=G(!1),n=G(0),s=G(""),i=G([]),o=G(0);async function r(){s.value="";const a=Oe("ApiBaseUrl"),l=await fetch(`${a}/api/comments?postId=${e}&start=${n.value}`);if(!l.ok){s.value="Load comments failed. "+l.statusText,t.value=!0;return}const f=await l.json();if(f.code!==0){s.value="Load comments failed. "+f.message,t.value=!0;return}return i.value=f.data.map(d=>{const{user:p,created_at:g,...y}=d;return{...y,createdAt:new Date(g),user:JSON.parse(d.user)}}),o.value=f.meta?.total||0,t.value=!0,f}function c(a,l,f){const{sub:d="",name:p="",picture:g="",email:y="",nickname:x=""}=f;i.value.unshift({id:a,postId:e,content:l,ancestorId:-1,parentId:-1,createdAt:new Date,user:{avatar:g,email:y,name:x||p},userId:d,status:bo.Approved,isNew:!0}),o.value++}return{isLoaded:t,message:s,postId:e,comments:i,total:o,loadComments:r,addComment:c}}),Aa=["onSubmit"],Ra={class:"ac-form-control border border-neutral bg-base-200 rounded-lg"},Fa=B("label",{class:"sr-only",for:"ac-comment"},"Your comment",-1),La=["onKeydown"],Ka={class:"p-2 rounded-b-lg bg-base-300 flex items-center"},Ma={class:"text-xs text-neutral/50"},Na={key:0,class:"ac-alert ac-alert-error mx-4"},za=["disabled"],Ua={key:0,class:"ac-loading ac-loading-spinner"},Da=Yn({...{name:"CommentForm"},setup(e){const t=_o(),n=Ts(),s=Oe("ApiBaseUrl"),i=Oe("Auth0Domain"),o="0.1.7",r=G(!1),c=G(""),a=G("");async function l(p){if(!t.user.value)return f();if(!p.target.matches(":invalid")){r.value=!0;try{const g=await t.getAccessTokenSilently(),y=await fetch(s+"/api/comment",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:JSON.stringify({comment:c.value,postId:n.postId,domain:i})});if(!y.ok)throw new Error("Failed to post comment");const x=await y.json();n.addComment(x.data,c.value,t.user.value),c.value=""}catch(g){a.value=g.message||String(g)}r.value=!1}}function f(){t.loginWithPopup()}function d(p){const g=navigator.userAgent.match(/Macintosh/);(g&&p.metaKey||!g&&p.ctrlKey)&&l(p)}return(p,g)=>(oe(),ae("form",{class:"mb-6",onSubmit:qc(l,["prevent"])},[B("div",Ra,[Fa,Fr(B("textarea",{class:"ac-textarea ac-textarea-bordered bg-base-200 rounded-b-none",id:"ac-comment",rows:"3",placeholder:"Write a comment...",required:"",onKeydown:Qc(d,["enter"]),"onUpdate:modelValue":g[0]||(g[0]=y=>c.value=y)},null,40,La),[[Bc,c.value]]),B("div",Ka,[B("div",Ma,"v"+Fe(Q(o)),1),a.value?(oe(),ae("div",Na,[B("p",null,Fe(a.value),1)])):yn("",!0),B("button",{class:"ac-btn ac-btn-primary ac-btn-sm ml-auto",disabled:r.value},[r.value?(oe(),ae("span",Ua)):yn("",!0),rs("Post comment")],8,za)])])],40,Aa))}});function Tn(e){return e<10?`0${e}`:`${e}`}function yo(e){const t=e.getFullYear(),n=e.getMonth()+1,s=e.getDate();return`${t}-${Tn(n)}-${Tn(s)}`}function Wa(e){const t=new Date,n=yo(e);if(yo(t)===n){const s=e.getHours(),i=e.getMinutes();return`${Tn(s)}:${Tn(i)}`}return n}const $a={key:0,class:"comments-wrapper"},Ha=["onAnimationend"],Za={class:"flex justify-between items-center mb-2"},Va={class:"flex items-center text-sm text-gray-900 dark:text-white"},Xa=["src","alt"],Ba=["datetime","title"],Ja={class:"text-gray-500 dark:text-gray-400"},Ya={key:1,class:"pt-8 text-center"},qa=[B("span",{class:"ac-loading ac-loading-spinner"},null,-1)],Ga=Yn({...{name:"CommentSections"},setup(e){const t=Ts();return t.loadComments(),(n,s)=>Q(t).isLoaded?(oe(),ae("div",$a,[(oe(!0),ae(ve,null,Br(Q(t).comments,i=>(oe(),ae("article",{class:Yt(["p-6 text-base bg-base-100 rounded-lg dark:bg-gray-900",{"animated flash":i.isNew}]),key:i.id,onAnimationend:o=>i.isNew=!1},[B("footer",Za,[B("div",Va,[B("img",{class:"mr-2 w-6 h-6 rounded-full",src:i.user.avatar,alt:i.user.name},null,8,Xa),rs(Fe(i.user.name),1),B("time",{class:"text-xs text-gray-600 ml-4 dark:text-gray-400",pubdate:"",datetime:i.createdAt,title:i.createdAt},Fe(Q(Wa)(i.createdAt)),9,Ba)])]),B("p",Ja,Fe(i.content),1)],42,Ha))),128))])):(oe(),ae("div",Ya,qa))}}),Qa={class:"awesome-comment"},el={key:0,class:"ac-alert ac-alert-error mb-4"},tl={class:"flex justify-between items-center py-2"},nl={class:"text-lg font-bold text-neutral my-0"},sl={key:0,class:"ac-loading ac-loading-spinner"},il={key:1,class:"ac-dropdown ac-dropdown-end"},ol={key:0,class:"ac-avatar flex",tabindex:"0"},rl={class:"w-6 h-6 rounded-full"},cl=["alt","src"],al={key:1,class:"ac-btn ac-btn-ghost",tabindex:"0"},ll={class:"ac-dropdown-content z-10 ac-menu p-2 shadow bg-base-100 rounded-box w-52",tabindex:"0"},ul={key:0,class:"border-b border-neutral pb-2 mb-2 pointer-events-none"},fl=["disabled"],dl=["disabled"],hl=Yn({__name:"App",setup(e){const t=Ts(),{isAuthenticated:n,isLoading:s,user:i,loginWithPopup:o,logout:r}=_o();function c(){o()}function a(){r()}return(l,f)=>(oe(),ae("div",Qa,[Q(t).message?(oe(),ae("div",el,[B("p",null,Fe(Q(t).message),1)])):yn("",!0),B("header",tl,[B("h2",nl,"Discussion ("+Fe(Q(t).total)+")",1),Q(s)?(oe(),ae("span",sl)):(oe(),ae("div",il,[Q(n)&&Q(i)?(oe(),ae(ve,{key:0},[Q(i).picture?(oe(),ae("label",ol,[B("div",rl,[B("img",{class:"w-full h-full block",alt:Q(i).name||Q(i).email,src:Q(i).picture},null,8,cl)])])):(oe(),ae("label",al,Fe(Q(i).email),1)),B("ul",ll,[Q(i).picture?(oe(),ae("li",ul,[B("span",null,Fe(Q(i).email),1)])):yn("",!0),B("li",null,[B("button",{type:"button",disabled:Q(s),onClick:a},"Logout",8,fl)])])],64)):(oe(),ae("button",{key:1,class:"ac-btn ac-btn-secondary ac-btn-xs",type:"button",disabled:Q(s),onClick:c},"Login",8,dl))]))]),xe(Da),xe(Ga)]))}});function pl(e,t){const n=na(hl),s=oa(),i=ja({domain:e,clientId:t,authorizationParams:{redirect_uri:window.location.origin}});return n.use(i),n.use(s),n}return{init(e,t,n,s,i){const o=pl(s,i);o.provide("ApiBaseUrl",n),o.provide("postId",t),o.provide("Auth0Domain",s),o.mount(e)}}});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.awesome-comment{--pf:258.89 94.378% 40.941%;--sf:314 100% 37.647%;--af:174 60% 40.784%;--nf:219 14.085% 22.275%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:258.89 94.378% 51.176%;--pc:0 0% 100%;--s:314 100% 47.059%;--sc:0 0% 100%;--a:174 60% 50.98%;--ac:174.71 43.59% 15.294%;--n:219 14.085% 27.843%;--nc:0 0% 100%;--b1:0 0% 100%;--b2:0 0% 94.902%;--b3:180 1.9608% 90%;--bc:215 27.907% 16.863%;color-scheme:light}@media (prefers-color-scheme:dark){.awesome-comment{--pf:262.35 80.315% 40.157%;--sf:315.75 70.196% 40%;--af:174.69 70.335% 32.784%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:262.35 80.315% 50.196%;--pc:0 0% 100%;--s:315.75 70.196% 50%;--sc:0 0% 100%;--a:174.69 70.335% 40.98%;--ac:0 0% 100%;--n:218.18 18.033% 11.961%;--nf:222.86 17.073% 8.0392%;--nc:220 13.376% 69.216%;--b1:220 17.647% 20%;--b2:220 17.241% 17.059%;--b3:218.57 17.949% 15.294%;--bc:220 13.376% 69.216%;color-scheme:dark}}[data-theme=light] .awesome-comment{--pf:258.89 94.378% 40.941%;--sf:314 100% 37.647%;--af:174 60% 40.784%;--nf:219 14.085% 22.275%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:258.89 94.378% 51.176%;--pc:0 0% 100%;--s:314 100% 47.059%;--sc:0 0% 100%;--a:174 60% 50.98%;--ac:174.71 43.59% 15.294%;--n:219 14.085% 27.843%;--nc:0 0% 100%;--b1:0 0% 100%;--b2:0 0% 94.902%;--b3:180 1.9608% 90%;--bc:215 27.907% 16.863%;color-scheme:light}[data-theme=dark]{--pf:262.35 80.315% 40.157%;--sf:315.75 70.196% 40%;--af:174.69 70.335% 32.784%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:262.35 80.315% 50.196%;--pc:0 0% 100%;--s:315.75 70.196% 50%;--sc:0 0% 100%;--a:174.69 70.335% 40.98%;--ac:0 0% 100%;--n:218.18 18.033% 11.961%;--nf:222.86 17.073% 8.0392%;--nc:220 13.376% 69.216%;--b1:220 17.647% 20%;--b2:220 17.241% 17.059%;--b3:218.57 17.949% 15.294%;--bc:220 13.376% 69.216%;color-scheme:dark}@keyframes button-pop{0%{transform:scale(var(--btn-focus-scale,.98))}40%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes checkmark{0%{background-position-y:5px}50%{background-position-y:-2px}to{background-position-y:0}}@keyframes modal-pop{0%{opacity:0}}@keyframes progress-loading{50%{background-position-x:-115%}}@keyframes radiomark{0%{box-shadow:0 0 0 12px hsl(var(--b1)) inset,0 0 0 12px hsl(var(--b1)) inset}50%{box-shadow:0 0 0 3px hsl(var(--b1)) inset,0 0 0 3px hsl(var(--b1)) inset}to{box-shadow:0 0 0 4px hsl(var(--b1)) inset,0 0 0 4px hsl(var(--b1)) inset}}@keyframes rating-pop{0%{transform:translateY(-.125em)}40%{transform:translateY(-.125em)}to{transform:translateY(0)}}@keyframes toast-pop{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.rounded-box{border-radius:var(--rounded-box,1rem)}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.z-10{z-index:10}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.block{display:block}.flex{display:flex}.h-6{height:1.5rem}.h-full{height:100%}.w-52{width:13rem}.w-6{width:1.5rem}.w-full{width:100%}.max-w-2xl{max-width:42rem}.items-center{align-items:center}.justify-between{justify-content:space-between}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-neutral{--tw-border-opacity:1;border-color:hsl(var(--n)/var(--tw-border-opacity))}.bg-base-100{--tw-bg-opacity:1;background-color:hsl(var(--b1)/var(--tw-bg-opacity))}.bg-base-200{--tw-bg-opacity:1;background-color:hsl(var(--b2)/var(--tw-bg-opacity))}.bg-base-300{--tw-bg-opacity:1;background-color:hsl(var(--b3)/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-2{padding:.5rem}.p-6{padding:1.5rem}.py-2{padding-top:.5rem}.pb-2,.py-2{padding-bottom:.5rem}.pt-8{padding-top:2rem}.text-center{text-align:center}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-neutral-content{--tw-text-opacity:1;color:hsl(var(--nc)/var(--tw-text-opacity))}.text-neutral-content\/50{color:hsl(var(--nc)/.5)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (prefers-color-scheme:dark){.dark\:bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.dark\:text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.dark\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}}.animated{animation-duration:var(--animate-duration);animation-fill-mode:both}.animated.infinite{animation-iteration-count:infinite}.animated.repeat-1{animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{animation-iteration-count:calc(var(--animate-repeat)*2)}.animated.repeat-3{animation-iteration-count:calc(var(--animate-repeat)*3)}.animated.delay-1s{animation-delay:var(--animate-delay)}.animated.delay-2s{animation-delay:calc(var(--animate-delay)*2)}.animated.delay-3s{animation-delay:calc(var(--animate-delay)*3)}.animated.delay-4s{animation-delay:calc(var(--animate-delay)*4)}.animated.delay-5s{animation-delay:calc(var(--animate-delay)*5)}.animated.faster{animation-duration:calc(var(--animate-duration)/2)}.animated.fast{animation-duration:calc(var(--animate-duration)*.8)}.animated.slow{animation-duration:calc(var(--animate-duration)*2)}.animated.slower{animation-duration:calc(var(--animate-duration)*3)}@media (prefers-reduced-motion:reduce),print{.animated{animation-duration:1ms!important;animation-iteration-count:1!important;transition-duration:1ms!important}.animated[class*=Out]{opacity:0}}:root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}@keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}.flash{animation-name:flash}
|
|
1
|
+
.awesome-comment{--pf:258.89 94.378% 40.941%;--sf:314 100% 37.647%;--af:174 60% 40.784%;--nf:219 14.085% 22.275%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:258.89 94.378% 51.176%;--pc:0 0% 100%;--s:314 100% 47.059%;--sc:0 0% 100%;--a:174 60% 50.98%;--ac:174.71 43.59% 15.294%;--n:219 14.085% 27.843%;--nc:0 0% 100%;--b1:0 0% 100%;--b2:0 0% 94.902%;--b3:180 1.9608% 90%;--bc:215 27.907% 16.863%;color-scheme:light}@media (prefers-color-scheme:dark){.awesome-comment{--pf:262.35 80.315% 40.157%;--sf:315.75 70.196% 40%;--af:174.69 70.335% 32.784%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:262.35 80.315% 50.196%;--pc:0 0% 100%;--s:315.75 70.196% 50%;--sc:0 0% 100%;--a:174.69 70.335% 40.98%;--ac:0 0% 100%;--n:218.18 18.033% 11.961%;--nf:222.86 17.073% 8.0392%;--nc:220 13.376% 69.216%;--b1:220 17.647% 20%;--b2:220 17.241% 17.059%;--b3:218.57 17.949% 15.294%;--bc:220 13.376% 69.216%;color-scheme:dark}}[data-theme=light] .awesome-comment{--pf:258.89 94.378% 40.941%;--sf:314 100% 37.647%;--af:174 60% 40.784%;--nf:219 14.085% 22.275%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:258.89 94.378% 51.176%;--pc:0 0% 100%;--s:314 100% 47.059%;--sc:0 0% 100%;--a:174 60% 50.98%;--ac:174.71 43.59% 15.294%;--n:219 14.085% 27.843%;--nc:0 0% 100%;--b1:0 0% 100%;--b2:0 0% 94.902%;--b3:180 1.9608% 90%;--bc:215 27.907% 16.863%;color-scheme:light}[data-theme=dark]{--pf:262.35 80.315% 40.157%;--sf:315.75 70.196% 40%;--af:174.69 70.335% 32.784%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:.5rem;--rounded-badge:1.9rem;--animation-btn:.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:.95;--border-btn:1px;--tab-border:1px;--tab-radius:.5rem;--p:262.35 80.315% 50.196%;--pc:0 0% 100%;--s:315.75 70.196% 50%;--sc:0 0% 100%;--a:174.69 70.335% 40.98%;--ac:0 0% 100%;--n:218.18 18.033% 11.961%;--nf:222.86 17.073% 8.0392%;--nc:220 13.376% 69.216%;--b1:220 17.647% 20%;--b2:220 17.241% 17.059%;--b3:218.57 17.949% 15.294%;--bc:220 13.376% 69.216%;color-scheme:dark}.ac-alert{--tw-border-opacity:1;--tw-text-opacity:1;--alert-bg:hsl(var(--b2));--alert-bg-mix:hsl(var(--b1));align-content:flex-start;align-items:center;background-color:var(--alert-bg);border-color:hsl(var(--b2)/var(--tw-border-opacity));border-radius:var(--rounded-box,1rem);border-width:1px;color:hsl(var(--bc)/var(--tw-text-opacity));display:grid;gap:1rem;grid-auto-flow:row;justify-items:center;padding:1rem;text-align:center;width:100%}@media (min-width:640px){.ac-alert{grid-auto-flow:column;grid-template-columns:auto minmax(auto,1fr);justify-items:start;text-align:left}}.ac-avatar{display:inline-flex;position:relative}.ac-avatar>div{aspect-ratio:1/1;display:block;overflow:hidden}.ac-avatar img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.ac-avatar.ac-placeholder>div{align-items:center;display:flex;justify-content:center}@media (hover:hover){.ac-menu li>:not(ul):not(details).ac-active,.ac-menu li>:not(ul):not(details):active,.ac-menu li>details>summary:active{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--n)/var(--tw-bg-opacity));color:hsl(var(--nc)/var(--tw-text-opacity))}}.ac-btn{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;animation:button-pop var(--animation-btn,.25s) ease-out;background-color:hsl(var(--b2)/var(--tw-bg-opacity));border-color:transparent;border-color:hsl(var(--b2)/var(--tw-border-opacity));border-radius:var(--rounded-btn,.5rem);border-width:var(--border-btn,1px);color:hsl(var(--bc)/var(--tw-text-opacity));cursor:pointer;display:inline-flex;flex-shrink:0;flex-wrap:wrap;font-size:.875rem;font-weight:600;gap:.5rem;height:3rem;justify-content:center;line-height:1.25rem;line-height:1em;min-height:3rem;outline-color:hsl(var(--bc)/1);padding-left:1rem;padding-right:1rem;text-align:center;text-decoration-line:none;text-transform:var(--btn-text-case,uppercase);transition-duration:.2s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.ac-btn-disabled,.ac-btn:disabled,.ac-btn[disabled]{pointer-events:none}.ac-btn-group>input[type=radio].ac-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none}.ac-btn-group>input[type=radio].ac-btn:before{content:attr(data-title)}.ac-btn:is(input[type=checkbox]),.ac-btn:is(input[type=radio]){-webkit-appearance:none;-moz-appearance:none;appearance:none}.ac-btn:is(input[type=checkbox]):after,.ac-btn:is(input[type=radio]):after{--tw-content:attr(aria-label);content:var(--tw-content)}.ac-dropdown{display:inline-block;position:relative}.ac-dropdown>:focus{outline:2px solid transparent;outline-offset:2px}.ac-dropdown .ac-dropdown-content{position:absolute}.ac-dropdown:is(:not(details)) .ac-dropdown-content{--tw-scale-x:.95;--tw-scale-y:.95;opacity:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform-origin:top;transition-duration:.2s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);visibility:hidden}.ac-dropdown-end .ac-dropdown-content{right:0}.ac-dropdown-left .ac-dropdown-content{bottom:auto;right:100%;top:0;transform-origin:right}.ac-dropdown-right .ac-dropdown-content{bottom:auto;left:100%;top:0;transform-origin:left}.ac-dropdown-bottom .ac-dropdown-content{bottom:auto;top:100%;transform-origin:top}.ac-dropdown-top .ac-dropdown-content{bottom:100%;top:auto;transform-origin:bottom}.ac-dropdown-end.ac-dropdown-left .ac-dropdown-content,.ac-dropdown-end.ac-dropdown-right .ac-dropdown-content{bottom:0;top:auto}.ac-dropdown.ac-dropdown-open .ac-dropdown-content,.ac-dropdown:focus-within .ac-dropdown-content,.ac-dropdown:not(.ac-dropdown-hover):focus .ac-dropdown-content{opacity:1;visibility:visible}@media (hover:hover){.ac-dropdown.ac-dropdown-hover:hover .ac-dropdown-content{opacity:1;visibility:visible}.ac-btn:hover{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:hsl(var(--b3)/var(--tw-bg-opacity));border-color:hsl(var(--b3)/var(--tw-border-opacity))}.ac-btn-primary:hover{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:hsl(var(--pf)/var(--tw-bg-opacity));border-color:hsl(var(--pf)/var(--tw-border-opacity))}.ac-btn-secondary:hover{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:hsl(var(--sf)/var(--tw-bg-opacity));border-color:hsl(var(--sf)/var(--tw-border-opacity))}.ac-btn.ac-glass:hover{--glass-opacity:25%;--glass-border-opacity:15%}.ac-btn-ghost:hover{--tw-border-opacity:0;--tw-bg-opacity:.2;background-color:hsl(var(--bc)/var(--tw-bg-opacity))}.ac-btn-outline.ac-btn-primary:hover{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--pf)/var(--tw-bg-opacity));border-color:hsl(var(--pf)/var(--tw-border-opacity));color:hsl(var(--pc)/var(--tw-text-opacity))}.ac-btn-outline.ac-btn-secondary:hover{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--sf)/var(--tw-bg-opacity));border-color:hsl(var(--sf)/var(--tw-border-opacity));color:hsl(var(--sc)/var(--tw-text-opacity))}.ac-btn-disabled:hover,.ac-btn:disabled:hover,.ac-btn[disabled]:hover{--tw-border-opacity:0;--tw-bg-opacity:.2;--tw-text-opacity:.2;background-color:hsl(var(--n)/var(--tw-bg-opacity));color:hsl(var(--bc)/var(--tw-text-opacity))}.ac-btn:is(input[type=checkbox]:checked):hover,.ac-btn:is(input[type=radio]:checked):hover{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:hsl(var(--pf)/var(--tw-bg-opacity));border-color:hsl(var(--pf)/var(--tw-border-opacity))}.ac-dropdown.ac-dropdown-hover:hover .ac-dropdown-content{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>:not(ul):not(details):not(.ac-menu-title)):not(.ac-active):hover,:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>details>summary:not(.ac-menu-title)):not(.ac-active):hover{--tw-text-opacity:1;background-color:hsl(var(--bc)/.1);color:hsl(var(--bc)/var(--tw-text-opacity));cursor:pointer;outline:2px solid transparent;outline-offset:2px}}.ac-dropdown:is(details) summary::-webkit-details-marker{display:none}.ac-form-control{display:flex;flex-direction:column}.ac-input-group>*,.ac-input-group>.ac-input,.ac-input-group>.ac-select,.ac-input-group>.ac-textarea{border-radius:0}.ac-menu{display:flex;flex-direction:column;flex-wrap:wrap;font-size:.875rem;line-height:1.25rem;padding:.5rem}.ac-menu :where(li ul){margin-left:1rem;padding-left:.5rem;position:relative;white-space:nowrap}.ac-menu :where(li:not(.ac-menu-title)>:not(ul):not(details):not(.ac-menu-title)),.ac-menu :where(li:not(.ac-menu-title)>details>summary:not(.ac-menu-title)){align-content:flex-start;align-items:center;display:grid;gap:.5rem;grid-auto-columns:max-content auto max-content;grid-auto-flow:column;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ac-menu li.ac-disabled{color:hsl(var(--bc)/.3);cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ac-menu :where(li>.ac-menu-dropdown:not(.ac-menu-dropdown-show)){display:none}:where(.ac-menu li){align-items:stretch;display:flex;flex-direction:column;flex-shrink:0;flex-wrap:wrap;position:relative}:where(.ac-menu li) .ac-badge{justify-self:end}.ac-textarea{--tw-border-opacity:0;--tw-bg-opacity:1;background-color:hsl(var(--b1)/var(--tw-bg-opacity));border-color:hsl(var(--bc)/var(--tw-border-opacity));border-radius:var(--rounded-btn,.5rem);border-width:1px;flex-shrink:1;font-size:.875rem;line-height:1.25rem;line-height:2;min-height:3rem;padding:.5rem 1rem}.ac-alert-error{--tw-text-opacity:1;--alert-bg:hsl(var(--er));--alert-bg-mix:hsl(var(--b1));border-color:hsl(var(--er)/.2);color:hsl(var(--erc)/var(--tw-text-opacity))}.ac-avatar-group :where(.ac-avatar){--tw-border-opacity:1;border-color:hsl(var(--b1)/var(--tw-border-opacity));border-radius:9999px;border-width:4px;overflow:hidden}.ac-btn:active:focus,.ac-btn:active:hover{animation:button-pop 0s ease-out;transform:scale(var(--btn-focus-scale,.97))}.ac-btn:focus-visible{outline-offset:2px;outline-style:solid;outline-width:2px}.ac-btn-primary{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--p)/var(--tw-bg-opacity));border-color:hsl(var(--p)/var(--tw-border-opacity));color:hsl(var(--pc)/var(--tw-text-opacity));outline-color:hsl(var(--p)/1)}.ac-btn-primary.ac-btn-active{background-color:hsl(var(--pf)/var(--tw-bg-opacity));border-color:hsl(var(--pf)/var(--tw-border-opacity))}.ac-btn-primary.ac-btn-active,.ac-btn-secondary{--tw-border-opacity:1;--tw-bg-opacity:1}.ac-btn-secondary{--tw-text-opacity:1;background-color:hsl(var(--s)/var(--tw-bg-opacity));border-color:hsl(var(--s)/var(--tw-border-opacity));color:hsl(var(--sc)/var(--tw-text-opacity));outline-color:hsl(var(--s)/1)}.ac-btn-secondary.ac-btn-active{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:hsl(var(--sf)/var(--tw-bg-opacity));border-color:hsl(var(--sf)/var(--tw-border-opacity))}.ac-btn.ac-glass{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);outline-color:currentColor}.ac-btn.ac-glass.ac-btn-active{--glass-opacity:25%;--glass-border-opacity:15%}.ac-btn-ghost{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;background-color:transparent;border-color:transparent;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:currentColor;outline-color:currentColor}.ac-btn-ghost.ac-btn-active{--tw-border-opacity:0;--tw-bg-opacity:.2;background-color:hsl(var(--bc)/var(--tw-bg-opacity))}.ac-btn-outline.ac-btn-primary{--tw-text-opacity:1;color:hsl(var(--p)/var(--tw-text-opacity))}.ac-btn-outline.ac-btn-primary.ac-btn-active{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--pf)/var(--tw-bg-opacity));border-color:hsl(var(--pf)/var(--tw-border-opacity));color:hsl(var(--pc)/var(--tw-text-opacity))}.ac-btn-outline.ac-btn-secondary{--tw-text-opacity:1;color:hsl(var(--s)/var(--tw-text-opacity))}.ac-btn-outline.ac-btn-secondary.ac-btn-active{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--sf)/var(--tw-bg-opacity));border-color:hsl(var(--sf)/var(--tw-border-opacity));color:hsl(var(--sc)/var(--tw-text-opacity))}.ac-btn.ac-btn-disabled,.ac-btn:disabled,.ac-btn[disabled]{--tw-border-opacity:0;--tw-bg-opacity:.2;--tw-text-opacity:.2;background-color:hsl(var(--n)/var(--tw-bg-opacity));color:hsl(var(--bc)/var(--tw-text-opacity))}.ac-btn-group>.ac-btn-active,.ac-btn-group>input[type=radio]:checked.ac-btn{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--p)/var(--tw-bg-opacity));border-color:hsl(var(--p)/var(--tw-border-opacity));color:hsl(var(--pc)/var(--tw-text-opacity))}.ac-btn-group>.ac-btn-active:focus-visible,.ac-btn-group>input[type=radio]:checked.ac-btn:focus-visible{outline-color:hsl(var(--p)/1);outline-style:solid;outline-width:2px}.ac-btn:is(input[type=checkbox]:checked),.ac-btn:is(input[type=radio]:checked){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--p)/var(--tw-bg-opacity));border-color:hsl(var(--p)/var(--tw-border-opacity));color:hsl(var(--pc)/var(--tw-text-opacity))}.ac-btn:is(input[type=checkbox]:checked):focus-visible,.ac-btn:is(input[type=radio]:checked):focus-visible{outline-color:hsl(var(--p)/1)}@keyframes button-pop{0%{transform:scale(var(--btn-focus-scale,.98))}40%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes checkmark{0%{background-position-y:5px}50%{background-position-y:-2px}to{background-position-y:0}}.ac-dropdown.ac-dropdown-open .ac-dropdown-content,.ac-dropdown:focus .ac-dropdown-content,.ac-dropdown:focus-within .ac-dropdown-content{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ac-loading{aspect-ratio:1/1;background-color:currentColor;display:inline-block;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;pointer-events:none;width:1.5rem}.ac-loading,.ac-loading-spinner{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' stroke='%23000'%3E%3Cstyle%3E@keyframes spinner_zKoa{to{transform:rotate(360deg)}}@keyframes spinner_YpZS{0%25{stroke-dasharray:0 150;stroke-dashoffset:0}47.5%25{stroke-dasharray:42 150;stroke-dashoffset:-16}95%25,to{stroke-dasharray:42 150;stroke-dashoffset:-59}}%3C/style%3E%3Cg style='transform-origin:center;animation:spinner_zKoa 2s linear infinite'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' style='stroke-linecap:round;animation:spinner_YpZS 1.5s ease-in-out infinite'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' stroke='%23000'%3E%3Cstyle%3E@keyframes spinner_zKoa{to{transform:rotate(360deg)}}@keyframes spinner_YpZS{0%25{stroke-dasharray:0 150;stroke-dashoffset:0}47.5%25{stroke-dasharray:42 150;stroke-dashoffset:-16}95%25,to{stroke-dasharray:42 150;stroke-dashoffset:-59}}%3C/style%3E%3Cg style='transform-origin:center;animation:spinner_zKoa 2s linear infinite'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' style='stroke-linecap:round;animation:spinner_YpZS 1.5s ease-in-out infinite'/%3E%3C/g%3E%3C/svg%3E")}:where(.ac-menu li:empty){background-color:hsl(var(--bc)/.1);height:1px;margin:.5rem 1rem}.ac-menu :where(li ul):before{background-color:hsl(var(--bc)/.1);bottom:.75rem;content:"";left:0;position:absolute;top:.75rem;width:1px}.ac-menu :where(li:not(.ac-menu-title)>:not(ul):not(details):not(.ac-menu-title)),.ac-menu :where(li:not(.ac-menu-title)>details>summary:not(.ac-menu-title)){border-radius:var(--rounded-btn,.5rem);padding:.5rem 1rem;text-align:left;transition-duration:.2s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>:not(ul):not(details):not(.ac-menu-title)):is(summary):not(.ac-active):focus-visible,:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>:not(ul):not(details):not(.ac-menu-title)):not(summary):not(.ac-active).ac-focus,:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>:not(ul):not(details):not(.ac-menu-title)):not(summary):not(.ac-active):focus,:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>details>summary:not(.ac-menu-title)):is(summary):not(.ac-active):focus-visible,:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>details>summary:not(.ac-menu-title)):not(summary):not(.ac-active).ac-focus,:where(.ac-menu li:not(.ac-menu-title):not(.ac-disabled)>details>summary:not(.ac-menu-title)):not(summary):not(.ac-active):focus{--tw-text-opacity:1;background-color:hsl(var(--bc)/.1);color:hsl(var(--bc)/var(--tw-text-opacity));cursor:pointer;outline:2px solid transparent;outline-offset:2px}.ac-menu li>:not(ul):not(details).ac-active,.ac-menu li>:not(ul):not(details):active,.ac-menu li>details>summary:active{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--n)/var(--tw-bg-opacity));color:hsl(var(--nc)/var(--tw-text-opacity))}.ac-menu :where(li>details>summary)::-webkit-details-marker{display:none}.ac-menu :where(li>.ac-menu-dropdown-toggle):after,.ac-menu :where(li>details>summary):after{box-shadow:2px 2px;content:"";display:block;height:.5rem;justify-self:end;margin-top:-.5rem;pointer-events:none;transform:rotate(45deg);transform-origin:75% 75%;transition-duration:.3s;transition-property:transform,margin-top;transition-timing-function:cubic-bezier(.4,0,.2,1);width:.5rem}.ac-menu :where(li>.ac-menu-dropdown-toggle.ac-menu-dropdown-show):after,.ac-menu :where(li>details[open]>summary):after{margin-top:0;transform:rotate(225deg)}@keyframes modal-pop{0%{opacity:0}}@keyframes progress-loading{50%{background-position-x:-115%}}@keyframes radiomark{0%{box-shadow:0 0 0 12px hsl(var(--b1)) inset,0 0 0 12px hsl(var(--b1)) inset}50%{box-shadow:0 0 0 3px hsl(var(--b1)) inset,0 0 0 3px hsl(var(--b1)) inset}to{box-shadow:0 0 0 4px hsl(var(--b1)) inset,0 0 0 4px hsl(var(--b1)) inset}}@keyframes rating-pop{0%{transform:translateY(-.125em)}40%{transform:translateY(-.125em)}to{transform:translateY(0)}}.ac-textarea-bordered{--tw-border-opacity:.2}.ac-textarea:focus{outline-color:hsl(var(--bc)/.2);outline-offset:2px;outline-style:solid;outline-width:2px}.ac-textarea-disabled,.ac-textarea:disabled,.ac-textarea[disabled]{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:.2;background-color:hsl(var(--b2)/var(--tw-bg-opacity));border-color:hsl(var(--b2)/var(--tw-border-opacity));cursor:not-allowed}.ac-textarea-disabled::-moz-placeholder,.ac-textarea:disabled::-moz-placeholder,.ac-textarea[disabled]::-moz-placeholder{--tw-placeholder-opacity:.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}.ac-textarea-disabled::placeholder,.ac-textarea:disabled::placeholder,.ac-textarea[disabled]::placeholder{--tw-placeholder-opacity:.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}@keyframes toast-pop{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.rounded-box{border-radius:var(--rounded-box,1rem)}.ac-btn-xs{font-size:.75rem;height:1.5rem;min-height:1.5rem;padding-left:.5rem;padding-right:.5rem}.ac-btn-sm{font-size:.875rem;height:2rem;min-height:2rem;padding-left:.75rem;padding-right:.75rem}.ac-btn-square:where(.ac-btn-xs){height:1.5rem;padding:0;width:1.5rem}.ac-btn-square:where(.ac-btn-sm){height:2rem;padding:0;width:2rem}.ac-btn-circle:where(.ac-btn-xs){border-radius:9999px;height:1.5rem;padding:0;width:1.5rem}.ac-btn-circle:where(.ac-btn-sm){border-radius:9999px;height:2rem;padding:0;width:2rem}.ac-avatar.ac-online:before{--tw-bg-opacity:1;background-color:hsl(var(--su)/var(--tw-bg-opacity));border-radius:9999px;content:"";display:block;height:15%;outline-color:hsl(var(--b1)/1);outline-style:solid;outline-width:2px;position:absolute;right:7%;top:7%;width:15%;z-index:10}.ac-avatar.ac-offline:before{--tw-bg-opacity:1;background-color:hsl(var(--b3)/var(--tw-bg-opacity));border-radius:9999px;content:"";display:block;height:15%;outline-color:hsl(var(--b1)/1);outline-style:solid;outline-width:2px;position:absolute;right:7%;top:7%;width:15%;z-index:10}.ac-btn-group .ac-btn:not(:first-child):not(:last-child){border-radius:0}.ac-btn-group .ac-btn:first-child:not(:last-child){border-bottom-left-radius:var(--rounded-btn,.5rem);border-bottom-right-radius:0;border-top-left-radius:var(--rounded-btn,.5rem);border-top-right-radius:0;margin-left:-1px;margin-top:0}.ac-btn-group .ac-btn:last-child:not(:first-child){border-bottom-left-radius:0;border-bottom-right-radius:var(--rounded-btn,.5rem);border-top-left-radius:0;border-top-right-radius:var(--rounded-btn,.5rem)}.ac-btn-group-horizontal .ac-btn:not(:first-child):not(:last-child){border-radius:0}.ac-btn-group-horizontal .ac-btn:first-child:not(:last-child){border-bottom-left-radius:var(--rounded-btn,.5rem);border-bottom-right-radius:0;border-top-left-radius:var(--rounded-btn,.5rem);border-top-right-radius:0;margin-left:-1px;margin-top:0}.ac-btn-group-horizontal .ac-btn:last-child:not(:first-child){border-bottom-left-radius:0;border-bottom-right-radius:var(--rounded-btn,.5rem);border-top-left-radius:0;border-top-right-radius:var(--rounded-btn,.5rem)}.ac-btn-group-vertical .ac-btn:first-child:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--rounded-btn,.5rem);border-top-right-radius:var(--rounded-btn,.5rem);margin-left:0;margin-top:-1px}.ac-btn-group-vertical .ac-btn:last-child:not(:first-child){border-bottom-left-radius:var(--rounded-btn,.5rem);border-bottom-right-radius:var(--rounded-btn,.5rem);border-top-left-radius:0;border-top-right-radius:0}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.z-10{z-index:10}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.block{display:block}.flex{display:flex}.h-6{height:1.5rem}.h-full{height:100%}.w-52{width:13rem}.w-6{width:1.5rem}.w-full{width:100%}.max-w-2xl{max-width:42rem}.items-center{align-items:center}.justify-between{justify-content:space-between}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-neutral{--tw-border-opacity:1;border-color:hsl(var(--n)/var(--tw-border-opacity))}.bg-base-100{--tw-bg-opacity:1;background-color:hsl(var(--b1)/var(--tw-bg-opacity))}.bg-base-200{--tw-bg-opacity:1;background-color:hsl(var(--b2)/var(--tw-bg-opacity))}.bg-base-300{--tw-bg-opacity:1;background-color:hsl(var(--b3)/var(--tw-bg-opacity))}.p-2{padding:.5rem}.p-6{padding:1.5rem}.py-2{padding-top:.5rem}.pb-2,.py-2{padding-bottom:.5rem}.pt-8{padding-top:2rem}.text-center{text-align:center}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-neutral{--tw-text-opacity:1;color:hsl(var(--n)/var(--tw-text-opacity))}.text-neutral\/50{color:hsl(var(--n)/.5)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (prefers-color-scheme:dark){.dark\:bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.dark\:text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.dark\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}}.animated{animation-duration:var(--animate-duration);animation-fill-mode:both}.animated.infinite{animation-iteration-count:infinite}.animated.repeat-1{animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{animation-iteration-count:calc(var(--animate-repeat)*2)}.animated.repeat-3{animation-iteration-count:calc(var(--animate-repeat)*3)}.animated.delay-1s{animation-delay:var(--animate-delay)}.animated.delay-2s{animation-delay:calc(var(--animate-delay)*2)}.animated.delay-3s{animation-delay:calc(var(--animate-delay)*3)}.animated.delay-4s{animation-delay:calc(var(--animate-delay)*4)}.animated.delay-5s{animation-delay:calc(var(--animate-delay)*5)}.animated.faster{animation-duration:calc(var(--animate-duration)/2)}.animated.fast{animation-duration:calc(var(--animate-duration)*.8)}.animated.slow{animation-duration:calc(var(--animate-duration)*2)}.animated.slower{animation-duration:calc(var(--animate-duration)*3)}@media (prefers-reduced-motion:reduce),print{.animated{animation-duration:1ms!important;animation-iteration-count:1!important;transition-duration:1ms!important}.animated[class*=Out]{opacity:0}}:root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}@keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}.flash{animation-name:flash}
|