New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

purplefox-tools

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

purplefox-tools - npm Package Compare versions

Comparing version 1.0.7 to 1.1.0

2

dist/purplefox-tools.umd.js

@@ -1,1 +0,1 @@

var pn=Object.defineProperty,gn=Object.defineProperties;var yn=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var mn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable;var Ue=(g,f,v)=>f in g?pn(g,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):g[f]=v,x=(g,f)=>{for(var v in f||(f={}))mn.call(f,v)&&Ue(g,v,f[v]);if(qe)for(var v of qe(f))vn.call(f,v)&&Ue(g,v,f[v]);return g},he=(g,f)=>gn(g,yn(f));(function(g,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],f):(g=typeof globalThis!="undefined"?globalThis:g||self,f(g.PurplefoxTools={},g.Vue,g.vueRouter))})(this,function(g,f,v){"use strict";var N,Qe=new Uint8Array(16);function Be(){if(!N&&(N=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!N))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return N(Qe)}var He=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ze(e){return typeof e=="string"&&He.test(e)}for(var m=[],Q=0;Q<256;++Q)m.push((Q+256).toString(16).substr(1));function Ge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+"-"+m[e[t+4]]+m[e[t+5]]+"-"+m[e[t+6]]+m[e[t+7]]+"-"+m[e[t+8]]+m[e[t+9]]+"-"+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase();if(!ze(n))throw TypeError("Stringified UUID is invalid");return n}function Ke(e,t,n){e=e||{};var r=e.random||(e.rng||Be)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ge(r)}var C=/^[a-z0-9]+(-[a-z0-9]+)*$/,P=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function B(e){return x(x({},P),e)}var R=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const s=o.pop(),l=o.pop(),a={provider:o.length>0?o[0]:r,prefix:l,name:s};return t&&!S(a)?null:a}const i=o[0],c=i.split("-");if(c.length>1){const s={provider:r,prefix:c.shift(),name:c.join("-")};return t&&!S(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:i};return t&&!S(s,n)?null:s}return null},S=(e,t)=>e?!!((e.provider===""||e.provider.match(C))&&(t&&e.prefix===""||e.prefix.match(C))&&e.name.match(C)):!1;function Ye(e,t){const n=x({},e);for(const r in P){const o=r;if(t[o]!==void 0){const i=t[o];if(n[o]===void 0){n[o]=i;continue}switch(o){case"rotate":n[o]=(n[o]+i)%4;break;case"hFlip":case"vFlip":n[o]=i!==n[o];break;default:n[o]=i}}}return n}function pe(e,t,n=!1){function r(i,c){var s,l,a,d;if(e.icons[i]!==void 0)return Object.assign({},e.icons[i]);if(c>5)return null;if(((s=e.aliases)==null?void 0:s[i])!==void 0){const u=(l=e.aliases)==null?void 0:l[i],h=r(u.parent,c+1);return h&&Ye(h,u)}return c===0&&((a=e.chars)==null?void 0:a[i])!==void 0?r((d=e.chars)==null?void 0:d[i],c+1):null}const o=r(t,0);if(o)for(const i in P)o[i]===void 0&&e[i]!==void 0&&(o[i]=e[i]);return o&&n?B(o):o}var Je=/^[a-f0-9]+(-[a-f0-9]+)*$/;function ge(e,t){for(const n in e){const r=n,i=typeof e[r];if(i==="undefined"){delete e[r];continue}switch(n){case"body":case"parent":if(i!=="string")return n;break;case"hFlip":case"vFlip":case"hidden":if(i!=="boolean")if(t)delete e[r];else return n;break;case"width":case"height":case"left":case"top":case"rotate":case"inlineHeight":case"inlineTop":case"verticalAlign":if(i!=="number")if(t)delete e[r];else return n;break;default:if(i==="object")if(t)delete e[r];else return n}}return null}function Xe(e,t){const n=!!(t==null?void 0:t.fix);if(typeof e!="object"||e===null||typeof e.icons!="object"||!e.icons)throw new Error("Bad icon set");const r=e;if(typeof(t==null?void 0:t.prefix)=="string")r.prefix=t.prefix;else if(typeof r.prefix!="string"||!r.prefix.match(C))throw new Error("Invalid prefix");if(typeof(t==null?void 0:t.provider)=="string")r.provider=t.provider;else if(r.provider!==void 0){const i=r.provider;if(typeof i!="string"||i!==""&&!i.match(C))if(n)delete r.provider;else throw new Error("Invalid provider")}const o=r.icons;if(Object.keys(o).forEach(i=>{if(!i.match(C)){if(n){delete o[i];return}throw new Error(`Invalid icon name: "${i}"`)}const c=o[i];if(typeof c!="object"||c===null||typeof c.body!="string"){if(n){delete o[i];return}throw new Error(`Invalid icon: "${i}"`)}const s=typeof c.parent=="string"?"parent":ge(c,n);if(s!==null){if(n){delete o[i];return}throw new Error(`Invalid property "${s}" in icon "${i}"`)}}),!Object.keys(r.icons).length)throw new Error("Icon set is empty");if(r.aliases!==void 0&&(typeof r.aliases!="object"||r.aliases===null))if(n)delete r.aliases;else throw new Error("Invalid aliases list");if(typeof r.aliases=="object"){let i=function(a,d){if(s.has(a))return!l.has(a);const u=c[a];if(d>5||typeof u!="object"||u===null||typeof u.parent!="string"||!a.match(C)){if(n)return delete c[a],l.add(a),!1;throw new Error(`Invalid icon alias: "${a}"`)}const h=u.parent;if(r.icons[h]===void 0&&(c[h]===void 0||!i(h,d+1))){if(n)return delete c[a],l.add(a),!1;throw new Error(`Missing parent icon for alias "${a}`)}n&&u.body!==void 0&&delete u.body;const y=u.body!==void 0?"body":ge(u,n);if(y!==null){if(n)return delete c[a],l.add(a),!1;throw new Error(`Invalid property "${y}" in alias "${a}"`)}return s.add(a),!0};const c=r.aliases,s=new Set,l=new Set;Object.keys(c).forEach(a=>{i(a,0)}),n&&!Object.keys(r.aliases).length&&delete r.aliases}if(Object.keys(P).forEach(i=>{const c=typeof P[i],s=typeof r[i];if(s!=="undefined"&&s!==c)throw new Error(`Invalid value type for "${i}"`)}),r.chars!==void 0&&(typeof r.chars!="object"||r.chars===null))if(n)delete r.chars;else throw new Error("Invalid characters map");if(typeof r.chars=="object"){const i=r.chars;Object.keys(i).forEach(c=>{var s;if(!c.match(Je)||typeof i[c]!="string"){if(n){delete i[c];return}throw new Error(`Invalid character "${c}"`)}const l=i[c];if(r.icons[l]===void 0&&((s=r.aliases)==null?void 0:s[l])===void 0){if(n){delete i[c];return}throw new Error(`Character "${c}" points to missing icon "${l}"`)}}),n&&!Object.keys(r.chars).length&&delete r.chars}return r}function We(e){for(const t in P)if(e[t]!==void 0)return!0;return!1}function ye(e,t,n){n=n||{};const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;const o=n.validate;if(o!==!1)try{Xe(e,typeof o=="object"?o:{fix:!0})}catch{return r}e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const i=e.icons;Object.keys(i).forEach(s=>{const l=pe(e,s,!0);l&&(t(s,l),r.push(s))});const c=n.aliases||"all";if(c!=="none"&&typeof e.aliases=="object"){const s=e.aliases;Object.keys(s).forEach(l=>{if(c==="variations"&&We(s[l]))return;const a=pe(e,l,!0);a&&(t(l,a),r.push(l))})}return r}var H=Object.create(null);function Ze(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:Object.create(null)}}function _(e,t){H[e]===void 0&&(H[e]=Object.create(null));const n=H[e];return n[t]===void 0&&(n[t]=Ze(e,t)),n[t]}function z(e,t){const n=Date.now();return ye(t,(r,o)=>{o?e.icons[r]=o:e.missing[r]=n})}function et(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(B(n)),!0}catch{}return!1}function tt(e,t){const n=e.icons[t];return n===void 0?null:n}var T=!1;function me(e){return typeof e=="boolean"&&(T=e),T}function nt(e){const t=typeof e=="string"?R(e,!0,T):e;return t?tt(_(t.provider,t.prefix),t.name):null}function rt(e,t){const n=R(e,!0,T);if(!n)return!1;const r=_(n.provider,n.prefix);return et(r,n.name,t)}function ot(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),T&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let r=!1;return ye(e,(o,i)=>{i&&rt(o,i)&&(r=!0)},{validate:{fix:!0,prefix:""}}),r}if(typeof e.prefix!="string"||!S({provider:t,prefix:e.prefix,name:"a"}))return!1;const n=_(t,e.prefix);return!!z(n,e)}var ve=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});function it(e,t){const n={};for(const r in e){const o=r;if(n[o]=e[o],t[o]===void 0)continue;const i=t[o];switch(o){case"inline":case"slice":typeof i=="boolean"&&(n[o]=i);break;case"hFlip":case"vFlip":i===!0&&(n[o]=!n[o]);break;case"hAlign":case"vAlign":typeof i=="string"&&i!==""&&(n[o]=i);break;case"width":case"height":(typeof i=="string"&&i!==""||typeof i=="number"&&i||i===null)&&(n[o]=i);break;case"rotate":typeof i=="number"&&(n[o]+=i);break}}return n}var st=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ct=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function G(e,t,n){if(t===1)return e;if(n=n===void 0?100:n,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(st);if(r===null||!r.length)return e;const o=[];let i=r.shift(),c=ct.test(i);for(;;){if(c){const s=parseFloat(i);isNaN(s)?o.push(i):o.push(Math.ceil(s*t*n)/n)}else o.push(i);if(i=r.shift(),i===void 0)return o.join("");c=!c}}function at(e){let t="";switch(e.hAlign){case"left":t+="xMin";break;case"right":t+="xMax";break;default:t+="xMid"}switch(e.vAlign){case"top":t+="YMin";break;case"bottom":t+="YMax";break;default:t+="YMid"}return t+=e.slice?" slice":" meet",t}function lt(e,t){const n={left:e.left,top:e.top,width:e.width,height:e.height};let r=e.body;[e,t].forEach(s=>{const l=[],a=s.hFlip,d=s.vFlip;let u=s.rotate;a?d?u+=2:(l.push("translate("+(n.width+n.left)+" "+(0-n.top)+")"),l.push("scale(-1 1)"),n.top=n.left=0):d&&(l.push("translate("+(0-n.left)+" "+(n.height+n.top)+")"),l.push("scale(1 -1)"),n.top=n.left=0);let h;switch(u<0&&(u-=Math.floor(u/4)*4),u=u%4,u){case 1:h=n.height/2+n.top,l.unshift("rotate(90 "+h+" "+h+")");break;case 2:l.unshift("rotate(180 "+(n.width/2+n.left)+" "+(n.height/2+n.top)+")");break;case 3:h=n.width/2+n.left,l.unshift("rotate(-90 "+h+" "+h+")");break}u%2==1&&((n.left!==0||n.top!==0)&&(h=n.left,n.left=n.top,n.top=h),n.width!==n.height&&(h=n.width,n.width=n.height,n.height=h)),l.length&&(r='<g transform="'+l.join(" ")+'">'+r+"</g>")});let o,i;t.width===null&&t.height===null?(i="1em",o=G(i,n.width/n.height)):t.width!==null&&t.height!==null?(o=t.width,i=t.height):t.height!==null?(i=t.height,o=G(i,n.width/n.height)):(o=t.width,i=G(o,n.height/n.width)),o==="auto"&&(o=n.width),i==="auto"&&(i=n.height),o=typeof o=="string"?o:o+"",i=typeof i=="string"?i:i+"";const c={attributes:{width:o,height:i,preserveAspectRatio:at(t),viewBox:n.left+" "+n.top+" "+n.width+" "+n.height},body:r};return t.inline&&(c.inline=!0),c}var ft=/\sid="(\S+)"/g,ut="IconifyId-"+Date.now().toString(16)+"-"+(Math.random()*16777216|0).toString(16)+"-",dt=0;function ht(e,t=ut){const n=[];let r;for(;r=ft.exec(e);)n.push(r[1]);return n.length&&n.forEach(o=>{const i=typeof t=="function"?t(o):t+dt++,c=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+i+"$3")}),e}var K=Object.create(null);function pt(e,t){K[e]=t}function Y(e){return K[e]||K[""]}function J(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path===void 0?"/":e.path,maxURL:e.maxURL?e.maxURL:500,rotate:e.rotate?e.rotate:750,timeout:e.timeout?e.timeout:5e3,random:e.random===!0,index:e.index?e.index:0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var X=Object.create(null),A=["https://api.simplesvg.com","https://api.unisvg.com"],D=[];A.length>0;)A.length===1||Math.random()>.5?D.push(A.shift()):D.push(A.pop());X[""]=J({resources:["https://api.iconify.design"].concat(D)});function gt(e,t){const n=J(t);return n===null?!1:(X[e]=n,!0)}function W(e){return X[e]}var be=(e,t)=>{let n=e,r=n.indexOf("?")!==-1;function o(i){switch(typeof i){case"boolean":return i?"true":"false";case"number":return encodeURIComponent(i);case"string":return encodeURIComponent(i);default:throw new Error("Invalid parameter")}}return Object.keys(t).forEach(i=>{let c;try{c=o(t[i])}catch{return}n+=(r?"&":"?")+encodeURIComponent(i)+"="+c,r=!0}),n},we=Object.create(null),V=Object.create(null),yt=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}try{const t=String.fromCharCode(114)+String.fromCharCode(101);if(e=global[t+"qui"+t]("cross-fetch"),typeof e=="function")return e}catch{}return null},Ie=yt();function mt(e,t){const n=W(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(s=>{i=Math.max(i,s.length)});const c=be(t+".json",{icons:""});r=n.maxURL-i-n.path.length-c.length}const o=e+":"+t;return V[e]=n.path,we[o]=r,r}var vt=(e,t,n)=>{const r=[];let o=we[t];o===void 0&&(o=mt(e,t));const i="icons";let c={type:i,provider:e,prefix:t,icons:[]},s=0;return n.forEach((l,a)=>{s+=l.length+1,s>=o&&a>0&&(r.push(c),c={type:i,provider:e,prefix:t,icons:[]},s=l.length),c.icons.push(l)}),r.push(c),r};function bt(e){if(typeof e=="string"){if(V[e]===void 0){const t=W(e);if(!t)return"/";V[e]=t.path}return V[e]}return"/"}var wt=(e,t,n)=>{if(!Ie){n.done(void 0,424);return}let r=bt(t.provider);switch(t.type){case"icons":{const i=t.prefix,s=t.icons.join(",");r+=be(i+".json",{icons:s});break}case"custom":{const i=t.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n.done(void 0,400);return}let o=503;Ie(e+r).then(i=>{if(i.status!==200){setTimeout(()=>{n.done(void 0,i.status)});return}return o=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{n.done(void 0,o)});return}setTimeout(()=>{n.done(i)})}).catch(()=>{n.done(void 0,o)})},It={prepare:vt,send:wt};function xt(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,i)=>o.provider!==i.provider?o.provider.localeCompare(i.provider):o.prefix!==i.prefix?o.prefix.localeCompare(i.prefix):o.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const i=o.provider,c=o.prefix,s=o.name;n[i]===void 0&&(n[i]=Object.create(null));const l=n[i];l[c]===void 0&&(l[c]=_(i,c));const a=l[c];let d;a.icons[s]!==void 0?d=t.loaded:c===""||a.missing[s]!==void 0?d=t.missing:d=t.pending;const u={provider:i,prefix:c,name:s};d.push(u)}),t}var j=Object.create(null),Z=Object.create(null);function xe(e,t){e.forEach(n=>{const r=n.provider;if(j[r]===void 0)return;const o=j[r],i=n.prefix,c=o[i];c&&(o[i]=c.filter(s=>s.id!==t))})}function jt(e,t){Z[e]===void 0&&(Z[e]=Object.create(null));const n=Z[e];n[t]||(n[t]=!0,setTimeout(()=>{if(n[t]=!1,j[e]===void 0||j[e][t]===void 0)return;const r=j[e][t].slice(0);if(!r.length)return;const o=_(e,t);let i=!1;r.forEach(c=>{const s=c.icons,l=s.pending.length;s.pending=s.pending.filter(a=>{if(a.prefix!==t)return!0;const d=a.name;if(o.icons[d]!==void 0)s.loaded.push({provider:e,prefix:t,name:d});else if(o.missing[d]!==void 0)s.missing.push({provider:e,prefix:t,name:d});else return i=!0,!0;return!1}),s.pending.length!==l&&(i||xe([{provider:e,prefix:t}],c.id),c.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),c.abort))})}))}var kt=0;function Et(e,t,n){const r=kt++,o=xe.bind(null,n,r);if(!t.pending.length)return o;const i={id:r,icons:t,callback:e,abort:o};return n.forEach(c=>{const s=c.provider,l=c.prefix;j[s]===void 0&&(j[s]=Object.create(null));const a=j[s];a[l]===void 0&&(a[l]=[]),a[l].push(i)}),o}function Ct(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const i=typeof o=="string"?R(o,!1,n):o;(!t||S(i,n))&&r.push({provider:i.provider,prefix:i.prefix,name:i.name})}),r}var je={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _t(e,t,n,r,o){const i=e.resources.length,c=e.random?Math.floor(Math.random()*i):e.index;let s;if(e.random){let p=e.resources.slice(0);for(s=[];p.length>1;){const w=Math.floor(Math.random()*p.length);s.push(p[w]),p=p.slice(0,w).concat(p.slice(w+1))}s=s.concat(p)}else s=e.resources.slice(c).concat(e.resources.slice(0,c));const l=Date.now();let a="pending",d=0,u,h=null,y=[],b=[];typeof r=="function"&&b.push(r);function E(){h&&(clearTimeout(h),h=null)}function fe(){a==="pending"&&(a="aborted"),E(),y.forEach(p=>{p.abort&&p.abort(),p.status==="pending"&&(p.status="aborted")}),y=[]}function dn(p,w){w&&(b=[]),typeof p=="function"&&b.push(p)}function De(){return{startTime:l,payload:t,status:a,queriesSent:d,queriesPending:y.length,subscribe:dn,abort:fe}}function ue(){a="failed",b.forEach(p=>{p(void 0,u)})}function Ve(){y=y.filter(p=>(p.status==="pending"&&(p.status="aborted"),p.abort&&p.abort(),!1))}function hn(p,w,U){const $=w===void 0;switch(y=y.filter(I=>I!==p),a){case"pending":break;case"failed":if($||!e.dataAfterTimeout)return;break;default:return}if($){U!==void 0&&(u=U),y.length||(s.length?de():ue());return}if(E(),Ve(),o&&!e.random){const I=e.resources.indexOf(p.resource);I!==-1&&I!==e.index&&o(I)}a="completed",b.forEach(I=>{I(w)})}function de(){if(a!=="pending")return;E();const p=s.shift();if(p===void 0){if(y.length){const $=typeof e.timeout=="function"?e.timeout(l):e.timeout;if($){h=setTimeout(()=>{E(),a==="pending"&&(Ve(),ue())},$);return}}ue();return}const w={getQueryStatus:De,status:"pending",resource:p,done:($,I)=>{hn(w,$,I)}};y.push(w),d++;const U=typeof e.rotate=="function"?e.rotate(d,l):e.rotate;h=setTimeout(de,U),n(p,t,w)}return setTimeout(de),De}function Ot(e){if(typeof e!="object"||typeof e.resources!="object"||!(e.resources instanceof Array)||!e.resources.length)throw new Error("Invalid Reduncancy configuration");const t=Object.create(null);let n;for(n in je)e[n]!==void 0?t[n]=e[n]:t[n]=je[n];return t}function ke(e){const t=Ot(e);let n=[];function r(){n=n.filter(s=>s().status==="pending")}function o(s,l,a){const d=_t(t,s,l,(u,h)=>{r(),a&&a(u,h)},u=>{t.index=u});return n.push(d),d}function i(s){const l=n.find(a=>s(a));return l!==void 0?l:null}return{query:o,find:i,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function Ee(){}var ee=Object.create(null);function $t(e){if(ee[e]===void 0){const t=W(e);if(!t)return;const n=ke(t),r={config:t,redundancy:n};ee[e]=r}return ee[e]}function Pt(e,t,n){let r,o;if(typeof e=="string"){const i=Y(e);if(!i)return n(void 0,424),Ee;o=i.send;const c=$t(e);c&&(r=c.redundancy)}else{const i=J(e);if(i){r=ke(i);const c=e.resources?e.resources[0]:"",s=Y(c);s&&(o=s.send)}}return!r||!o?(n(void 0,424),Ee):r.query(t,o,n)().abort}var te={};function Ce(){}var O=Object.create(null),ne=Object.create(null),re=Object.create(null),oe=Object.create(null);function St(e,t){re[e]===void 0&&(re[e]=Object.create(null));const n=re[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,jt(e,t)}))}var _e=Object.create(null);function Tt(e,t,n){function r(){const s=(e===""?"":"@"+e+":")+t,l=Math.floor(Date.now()/6e4);_e[s]<l&&(_e[s]=l,console.error('Unable to retrieve icons for "'+s+'" because API is not configured properly.'))}ne[e]===void 0&&(ne[e]=Object.create(null));const o=ne[e];oe[e]===void 0&&(oe[e]=Object.create(null));const i=oe[e];O[e]===void 0&&(O[e]=Object.create(null));const c=O[e];o[t]===void 0?o[t]=n:o[t]=o[t].concat(n).sort(),i[t]||(i[t]=!0,setTimeout(()=>{i[t]=!1;const s=o[t];delete o[t];const l=Y(e);if(!l){r();return}l.prepare(e,t,s).forEach(d=>{Pt(e,d,(u,h)=>{const y=_(e,t);if(typeof u!="object"){if(h!==404)return;const b=Date.now();d.icons.forEach(E=>{y.missing[E]=b})}else try{const b=z(y,u);if(!b.length)return;const E=c[t];b.forEach(fe=>{delete E[fe]}),te.store&&te.store(e,u)}catch(b){console.error(b)}St(e,t)})})}))}var At=(e,t)=>{const n=Ct(e,!0,me()),r=xt(n);if(!r.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(r.loaded,r.missing,r.pending,Ce)}),()=>{a=!1}}const o=Object.create(null),i=[];let c,s;r.pending.forEach(a=>{const d=a.provider,u=a.prefix;if(u===s&&d===c)return;c=d,s=u,i.push({provider:d,prefix:u}),O[d]===void 0&&(O[d]=Object.create(null));const h=O[d];h[u]===void 0&&(h[u]=Object.create(null)),o[d]===void 0&&(o[d]=Object.create(null));const y=o[d];y[u]===void 0&&(y[u]=[])});const l=Date.now();return r.pending.forEach(a=>{const d=a.provider,u=a.prefix,h=a.name,y=O[d][u];y[h]===void 0&&(y[h]=l,o[d][u].push(h))}),i.forEach(a=>{const d=a.provider,u=a.prefix;o[d][u].length&&Tt(d,u,o[d][u])}),t?Et(t,r,i):Ce},Oe="iconify2",M="iconify",$e=M+"-count",Pe=M+"-version",Se=36e5,Mt=168,ie={local:!0,session:!0},se=!1,Te={local:0,session:0},Ae={local:[],session:[]},q=typeof window=="undefined"?{}:window;function Me(e){const t=e+"Storage";try{if(q&&q[t]&&typeof q[t].length=="number")return q[t]}catch{}return ie[e]=!1,null}function ce(e,t,n){try{return e.setItem($e,n+""),Te[t]=n,!0}catch{return!1}}function Le(e){const t=e.getItem($e);if(t){const n=parseInt(t);return n||0}return 0}function Lt(e,t){try{e.setItem(Pe,Oe)}catch{}ce(e,t,0)}function Ft(e){try{const t=Le(e);for(let n=0;n<t;n++)e.removeItem(M+n)}catch{}}var Fe=()=>{if(se)return;se=!0;const e=Math.floor(Date.now()/Se)-Mt;function t(n){const r=Me(n);if(!r)return;const o=i=>{const c=M+i,s=r.getItem(c);if(typeof s!="string")return!1;let l=!0;try{const a=JSON.parse(s);if(typeof a!="object"||typeof a.cached!="number"||a.cached<e||typeof a.provider!="string"||typeof a.data!="object"||typeof a.data.prefix!="string")l=!1;else{const d=a.provider,u=a.data.prefix,h=_(d,u);l=z(h,a.data).length>0}}catch{l=!1}return l||r.removeItem(c),l};try{const i=r.getItem(Pe);if(i!==Oe){i&&Ft(r),Lt(r,n);return}let c=Le(r);for(let s=c-1;s>=0;s--)o(s)||(s===c-1?c--:Ae[n].push(s));ce(r,n,c)}catch{}}for(const n in ie)t(n)},Nt=(e,t)=>{se||Fe();function n(r){if(!ie[r])return!1;const o=Me(r);if(!o)return!1;let i=Ae[r].shift();if(i===void 0&&(i=Te[r],!ce(o,r,i+1)))return!1;try{const c={cached:Math.floor(Date.now()/Se),provider:e,data:t};o.setItem(M+i,JSON.stringify(c))}catch{return!1}return!0}n("local")||n("session")},Ne=/[\s,]+/;function Rt(e,t){t.split(Ne).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Dt(e,t){t.split(Ne).forEach(n=>{const r=n.trim();switch(r){case"left":case"center":case"right":e.hAlign=r;break;case"top":case"middle":case"bottom":e.vAlign=r;break;case"slice":case"crop":e.slice=!0;break;case"meet":e.slice=!1}})}function Vt(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/o,i%1==0?r(i):0)}}return t}const qt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"};let k={};["horizontal","vertical"].forEach(e=>{["Align","Flip"].forEach(t=>{const r={attr:e.slice(0,1)+t,boolean:t==="Flip"};k[e+"-"+t.toLowerCase()]=r,k[e.slice(0,1)+"-"+t.toLowerCase()]=r,k[e+t]=r})});const Ut=(e,t)=>{const n=it(ve,t),r=x({},qt);let o=typeof t.style=="object"&&!(t.style instanceof Array)?x({},t.style):{};for(let l in t){const a=t[l];if(a!==void 0)switch(l){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[l]=a===!0||a==="true"||a===1;break;case"flip":typeof a=="string"&&Rt(n,a);break;case"align":typeof a=="string"&&Dt(n,a);break;case"color":o.color=a;break;case"rotate":typeof a=="string"?n[l]=Vt(a):typeof a=="number"&&(n[l]=a);break;case"ariaHidden":case"aria-hidden":a!==!0&&a!=="true"&&delete r["aria-hidden"];break;default:k[l]!==void 0?k[l].boolean&&(a===!0||a==="true"||a===1)?n[k[l].attr]=!0:!k[l].boolean&&typeof a=="string"&&a!==""&&(n[k[l].attr]=a):ve[l]===void 0&&(r[l]=a)}}const i=lt(e,n);for(let l in i.attributes)r[l]=i.attributes[l];i.inline&&o.verticalAlign===void 0&&o["vertical-align"]===void 0&&(o.verticalAlign="-0.125em");let c=0;const s=t.id;return r.innerHTML=ht(i.body,s?()=>s+"-"+c++:"iconify-vue-"),Object.keys(o).length>0&&(r.style=o),f.h("svg",r)};if(me(!0),pt("",It),typeof document!="undefined"&&typeof window!="undefined"){te.store=Nt,Fe();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!ot(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;gt(n,o)||console.error(r)}catch{console.error(r)}}}}const ae=f.defineComponent({inheritAttrs:!1,data(){return{mounted:!1,counter:0}},beforeMount(){this._name="",this._loadingIcon=null,this.mounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:B(e)};let n;if(typeof e!="string"||(n=R(e,!1,!0))===null)return this.abortLoading(),null;const r=nt(n);if(r===null)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",this._loadingIcon={name:e,abort:At([n],()=>{this.counter++})}),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const o=["iconify"];return n.prefix!==""&&o.push("iconify--"+n.prefix),n.provider!==""&&o.push("iconify--"+n.provider),{data:r,classes:o}}},render(){if(!this.mounted)return this.$slots.default?this.$slots.default():null;this.counter;const e=this.$attrs,t=this.getIcon(e.icon,e.onLoad);if(!t)return this.$slots.default?this.$slots.default():null;let n=e;return t.classes&&(n=he(x({},e),{class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")})),Ut(t.data,n)}});var Re=(e,t)=>{for(const[n,r]of t)e[n]=r;return e};const Qt={components:{Icon:ae},setup(){return{icons:{error:"mdi:alert",warning:"mdi:alert-circle",info:"mdi:information",success:"mdi:check-bold"},colors:{error:"text-red",warning:"text-orange",info:"text-purple",success:"text-green"}}}},Bt={class:"ml-4 leading-tight"};function Ht(e,t,n,r,o,i){const c=f.resolveComponent("Icon");return f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(f.TransitionGroup,{tag:"div",name:"list",class:"fixed w-2/3 space-y-2 transition-all sm:w-1/4 bottom-2 left-2"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.$notif.list,s=>(f.openBlock(),f.createElementBlock("div",{key:s.id,class:"flex items-center p-4 transition bg-white rounded shadow-sm"},[f.createVNode(c,{class:f.normalizeClass([r.colors[s.type],"text-xl"]),icon:r.icons[s.type],inline:""},null,8,["class","icon"]),f.createElementVNode("p",Bt,f.toDisplayString(s.message),1)]))),128))]),_:1})])}var zt=Re(Qt,[["render",Ht]]);const L=f.ref([]),Gt=f.readonly(L);function F(e,t,n){const r=Ke();L.value=[...L.value,{type:e,message:t,actions:n,id:r}],setTimeout(()=>{L.value=L.value.filter(o=>o.id!==r)},2e3)}function Kt(...e){F("error",...e)}function Yt(...e){F("warn",...e)}function Jt(...e){F("info",...e)}function Xt(...e){F("success",...e)}function Wt(e){e.config.globalProperties.$notif=f.reactive({list:Gt,push:F,error:Kt,warn:Yt,info:Jt,success:Xt}),e.component("Pf_TheNotifications",zt)}var bn="";const Zt={components:{Icon:ae},props:{title:{type:String,default:null}},emits:["close"]},en={class:"flex items-start"},tn={class:"flex-1 overflow-hidden title overflow-ellipsis"},nn={class:"overflow-auto content"},rn={class:"py-2"};function on(e,t,n,r,o,i){const c=f.resolveComponent("Icon");return f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createElementVNode("div",{class:"fixed inset-0 bg-gray-200",onClick:t[2]||(t[2]=s=>e.$emit("close"))},[f.createElementVNode("div",{class:"p-2 m-auto mt-2 bg-white rounded-md shadow-md sm:mt-4 top-2 pf-dialog",onClick:t[1]||(t[1]=f.withModifiers(()=>{},["stop"]))},[f.createElementVNode("div",en,[f.createElementVNode("div",tn,f.toDisplayString(n.title),1),f.createElementVNode("button",{class:"ml-2 eor-icon-btn",onClick:t[0]||(t[0]=s=>e.$emit("close"))},[f.createVNode(c,{icon:"mdi:close",class:"text-purple"})])]),f.createElementVNode("div",nn,[f.renderSlot(e.$slots,"default")]),f.createElementVNode("div",rn,[f.renderSlot(e.$slots,"footer")])])])])}var sn=Re(Zt,[["render",on]]);function cn(e){const t=v.useRoute(),n=v.useRouter(),r=f.computed(()=>!!t.query[e]);return f.watch(r,o=>{o?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},{immediate:!0}),{isOpen:r,open(){const o=he(x({},t.query),{[e]:"open"});n.push({query:o})},async close(){const o=new Promise(c=>{const s=f.watch(r,l=>{l||(c(),s())})}),i=x({},t.query);return delete i[e],n.replace({query:i}),o}}}function an(e){e.component("Pf_Dialog",sn)}const ln=[{breakpoint:"sm",mediaQueryList:window.matchMedia("(min-width: 640px)")},{breakpoint:"md",mediaQueryList:window.matchMedia("(min-width: 768px)")},{breakpoint:"lg",mediaQueryList:window.matchMedia("(min-width: 1024px)")},{breakpoint:"xl",mediaQueryList:window.matchMedia("(min-width: 1280px)")},{breakpoint:"2xl",mediaQueryList:window.matchMedia("(min-width: 1536px)")}],le=f.reactive({});ln.forEach(({breakpoint:e,mediaQueryList:t})=>{function n(r){le[e]=r.matches}t.addListener(n),le[e]=t.matches});function fn(e){e.config.globalProperties.$responsive=f.reactive({breakpoints:le})}function un(e){e.component(ae)}g.IconPlugin=un,g.ModalPlugin=an,g.NotificationsPlugin=Wt,g.ResponsivePlugin=fn,g.useModal=cn,Object.defineProperty(g,"__esModule",{value:!0}),g[Symbol.toStringTag]="Module"});
var Cn=Object.defineProperty,Pn=Object.defineProperties;var $n=Object.getOwnPropertyDescriptors;var Ue=Object.getOwnPropertySymbols;var Sn=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable;var qe=(g,f,v)=>f in g?Cn(g,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):g[f]=v,_=(g,f)=>{for(var v in f||(f={}))Sn.call(f,v)&&qe(g,v,f[v]);if(Ue)for(var v of Ue(f))An.call(f,v)&&qe(g,v,f[v]);return g},pe=(g,f)=>Pn(g,$n(f));(function(g,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],f):(g=typeof globalThis!="undefined"?globalThis:g||self,f(g.PurplefoxTools={},g.Vue,g.vueRouter))})(this,function(g,f,v){"use strict";var N,ze=new Uint8Array(16);function Qe(){if(!N&&(N=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!N))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return N(ze)}var Ke=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function He(e){return typeof e=="string"&&Ke.test(e)}for(var m=[],z=0;z<256;++z)m.push((z+256).toString(16).substr(1));function Ge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+"-"+m[e[t+4]]+m[e[t+5]]+"-"+m[e[t+6]]+m[e[t+7]]+"-"+m[e[t+8]]+m[e[t+9]]+"-"+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase();if(!He(n))throw TypeError("Stringified UUID is invalid");return n}function We(e,t,n){e=e||{};var r=e.random||(e.rng||Qe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ge(r)}var E=/^[a-z0-9]+(-[a-z0-9]+)*$/,S=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function Q(e){return _(_({},S),e)}var F=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const s=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:r,prefix:l,name:s};return t&&!A(c)?null:c}const i=o[0],a=i.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!A(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:i};return t&&!A(s,n)?null:s}return null},A=(e,t)=>e?!!((e.provider===""||e.provider.match(E))&&(t&&e.prefix===""||e.prefix.match(E))&&e.name.match(E)):!1;function Ye(e,t){const n=_({},e);for(const r in S){const o=r;if(t[o]!==void 0){const i=t[o];if(n[o]===void 0){n[o]=i;continue}switch(o){case"rotate":n[o]=(n[o]+i)%4;break;case"hFlip":case"vFlip":n[o]=i!==n[o];break;default:n[o]=i}}}return n}function ge(e,t,n=!1){function r(i,a){var s,l,c,d;if(e.icons[i]!==void 0)return Object.assign({},e.icons[i]);if(a>5)return null;if(((s=e.aliases)==null?void 0:s[i])!==void 0){const u=(l=e.aliases)==null?void 0:l[i],h=r(u.parent,a+1);return h&&Ye(h,u)}return a===0&&((c=e.chars)==null?void 0:c[i])!==void 0?r((d=e.chars)==null?void 0:d[i],a+1):null}const o=r(t,0);if(o)for(const i in S)o[i]===void 0&&e[i]!==void 0&&(o[i]=e[i]);return o&&n?Q(o):o}var Je=/^[a-f0-9]+(-[a-f0-9]+)*$/;function ye(e,t){for(const n in e){const r=n,i=typeof e[r];if(i==="undefined"){delete e[r];continue}switch(n){case"body":case"parent":if(i!=="string")return n;break;case"hFlip":case"vFlip":case"hidden":if(i!=="boolean")if(t)delete e[r];else return n;break;case"width":case"height":case"left":case"top":case"rotate":case"inlineHeight":case"inlineTop":case"verticalAlign":if(i!=="number")if(t)delete e[r];else return n;break;default:if(i==="object")if(t)delete e[r];else return n}}return null}function Xe(e,t){const n=!!(t==null?void 0:t.fix);if(typeof e!="object"||e===null||typeof e.icons!="object"||!e.icons)throw new Error("Bad icon set");const r=e;if(typeof(t==null?void 0:t.prefix)=="string")r.prefix=t.prefix;else if(typeof r.prefix!="string"||!r.prefix.match(E))throw new Error("Invalid prefix");if(typeof(t==null?void 0:t.provider)=="string")r.provider=t.provider;else if(r.provider!==void 0){const i=r.provider;if(typeof i!="string"||i!==""&&!i.match(E))if(n)delete r.provider;else throw new Error("Invalid provider")}const o=r.icons;if(Object.keys(o).forEach(i=>{if(!i.match(E)){if(n){delete o[i];return}throw new Error(`Invalid icon name: "${i}"`)}const a=o[i];if(typeof a!="object"||a===null||typeof a.body!="string"){if(n){delete o[i];return}throw new Error(`Invalid icon: "${i}"`)}const s=typeof a.parent=="string"?"parent":ye(a,n);if(s!==null){if(n){delete o[i];return}throw new Error(`Invalid property "${s}" in icon "${i}"`)}}),!Object.keys(r.icons).length)throw new Error("Icon set is empty");if(r.aliases!==void 0&&(typeof r.aliases!="object"||r.aliases===null))if(n)delete r.aliases;else throw new Error("Invalid aliases list");if(typeof r.aliases=="object"){let i=function(c,d){if(s.has(c))return!l.has(c);const u=a[c];if(d>5||typeof u!="object"||u===null||typeof u.parent!="string"||!c.match(E)){if(n)return delete a[c],l.add(c),!1;throw new Error(`Invalid icon alias: "${c}"`)}const h=u.parent;if(r.icons[h]===void 0&&(a[h]===void 0||!i(h,d+1))){if(n)return delete a[c],l.add(c),!1;throw new Error(`Missing parent icon for alias "${c}`)}n&&u.body!==void 0&&delete u.body;const y=u.body!==void 0?"body":ye(u,n);if(y!==null){if(n)return delete a[c],l.add(c),!1;throw new Error(`Invalid property "${y}" in alias "${c}"`)}return s.add(c),!0};const a=r.aliases,s=new Set,l=new Set;Object.keys(a).forEach(c=>{i(c,0)}),n&&!Object.keys(r.aliases).length&&delete r.aliases}if(Object.keys(S).forEach(i=>{const a=typeof S[i],s=typeof r[i];if(s!=="undefined"&&s!==a)throw new Error(`Invalid value type for "${i}"`)}),r.chars!==void 0&&(typeof r.chars!="object"||r.chars===null))if(n)delete r.chars;else throw new Error("Invalid characters map");if(typeof r.chars=="object"){const i=r.chars;Object.keys(i).forEach(a=>{var s;if(!a.match(Je)||typeof i[a]!="string"){if(n){delete i[a];return}throw new Error(`Invalid character "${a}"`)}const l=i[a];if(r.icons[l]===void 0&&((s=r.aliases)==null?void 0:s[l])===void 0){if(n){delete i[a];return}throw new Error(`Character "${a}" points to missing icon "${l}"`)}}),n&&!Object.keys(r.chars).length&&delete r.chars}return r}function Ze(e){for(const t in S)if(e[t]!==void 0)return!0;return!1}function me(e,t,n){n=n||{};const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;const o=n.validate;if(o!==!1)try{Xe(e,typeof o=="object"?o:{fix:!0})}catch{return r}e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const i=e.icons;Object.keys(i).forEach(s=>{const l=ge(e,s,!0);l&&(t(s,l),r.push(s))});const a=n.aliases||"all";if(a!=="none"&&typeof e.aliases=="object"){const s=e.aliases;Object.keys(s).forEach(l=>{if(a==="variations"&&Ze(s[l]))return;const c=ge(e,l,!0);c&&(t(l,c),r.push(l))})}return r}var K=Object.create(null);function et(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:Object.create(null)}}function C(e,t){K[e]===void 0&&(K[e]=Object.create(null));const n=K[e];return n[t]===void 0&&(n[t]=et(e,t)),n[t]}function H(e,t){const n=Date.now();return me(t,(r,o)=>{o?e.icons[r]=o:e.missing[r]=n})}function tt(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(Q(n)),!0}catch{}return!1}function nt(e,t){const n=e.icons[t];return n===void 0?null:n}var O=!1;function ve(e){return typeof e=="boolean"&&(O=e),O}function rt(e){const t=typeof e=="string"?F(e,!0,O):e;return t?nt(C(t.provider,t.prefix),t.name):null}function ot(e,t){const n=F(e,!0,O);if(!n)return!1;const r=C(n.provider,n.prefix);return tt(r,n.name,t)}function it(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),O&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let r=!1;return me(e,(o,i)=>{i&&ot(o,i)&&(r=!0)},{validate:{fix:!0,prefix:""}}),r}if(typeof e.prefix!="string"||!A({provider:t,prefix:e.prefix,name:"a"}))return!1;const n=C(t,e.prefix);return!!H(n,e)}var be=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});function st(e,t){const n={};for(const r in e){const o=r;if(n[o]=e[o],t[o]===void 0)continue;const i=t[o];switch(o){case"inline":case"slice":typeof i=="boolean"&&(n[o]=i);break;case"hFlip":case"vFlip":i===!0&&(n[o]=!n[o]);break;case"hAlign":case"vAlign":typeof i=="string"&&i!==""&&(n[o]=i);break;case"width":case"height":(typeof i=="string"&&i!==""||typeof i=="number"&&i||i===null)&&(n[o]=i);break;case"rotate":typeof i=="number"&&(n[o]+=i);break}}return n}var at=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ct=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function G(e,t,n){if(t===1)return e;if(n=n===void 0?100:n,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(at);if(r===null||!r.length)return e;const o=[];let i=r.shift(),a=ct.test(i);for(;;){if(a){const s=parseFloat(i);isNaN(s)?o.push(i):o.push(Math.ceil(s*t*n)/n)}else o.push(i);if(i=r.shift(),i===void 0)return o.join("");a=!a}}function lt(e){let t="";switch(e.hAlign){case"left":t+="xMin";break;case"right":t+="xMax";break;default:t+="xMid"}switch(e.vAlign){case"top":t+="YMin";break;case"bottom":t+="YMax";break;default:t+="YMid"}return t+=e.slice?" slice":" meet",t}function ft(e,t){const n={left:e.left,top:e.top,width:e.width,height:e.height};let r=e.body;[e,t].forEach(s=>{const l=[],c=s.hFlip,d=s.vFlip;let u=s.rotate;c?d?u+=2:(l.push("translate("+(n.width+n.left)+" "+(0-n.top)+")"),l.push("scale(-1 1)"),n.top=n.left=0):d&&(l.push("translate("+(0-n.left)+" "+(n.height+n.top)+")"),l.push("scale(1 -1)"),n.top=n.left=0);let h;switch(u<0&&(u-=Math.floor(u/4)*4),u=u%4,u){case 1:h=n.height/2+n.top,l.unshift("rotate(90 "+h+" "+h+")");break;case 2:l.unshift("rotate(180 "+(n.width/2+n.left)+" "+(n.height/2+n.top)+")");break;case 3:h=n.width/2+n.left,l.unshift("rotate(-90 "+h+" "+h+")");break}u%2==1&&((n.left!==0||n.top!==0)&&(h=n.left,n.left=n.top,n.top=h),n.width!==n.height&&(h=n.width,n.width=n.height,n.height=h)),l.length&&(r='<g transform="'+l.join(" ")+'">'+r+"</g>")});let o,i;t.width===null&&t.height===null?(i="1em",o=G(i,n.width/n.height)):t.width!==null&&t.height!==null?(o=t.width,i=t.height):t.height!==null?(i=t.height,o=G(i,n.width/n.height)):(o=t.width,i=G(o,n.height/n.width)),o==="auto"&&(o=n.width),i==="auto"&&(i=n.height),o=typeof o=="string"?o:o+"",i=typeof i=="string"?i:i+"";const a={attributes:{width:o,height:i,preserveAspectRatio:lt(t),viewBox:n.left+" "+n.top+" "+n.width+" "+n.height},body:r};return t.inline&&(a.inline=!0),a}var ut=/\sid="(\S+)"/g,dt="IconifyId-"+Date.now().toString(16)+"-"+(Math.random()*16777216|0).toString(16)+"-",ht=0;function pt(e,t=dt){const n=[];let r;for(;r=ut.exec(e);)n.push(r[1]);return n.length&&n.forEach(o=>{const i=typeof t=="function"?t(o):t+ht++,a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+i+"$3")}),e}var W=Object.create(null);function gt(e,t){W[e]=t}function Y(e){return W[e]||W[""]}function J(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path===void 0?"/":e.path,maxURL:e.maxURL?e.maxURL:500,rotate:e.rotate?e.rotate:750,timeout:e.timeout?e.timeout:5e3,random:e.random===!0,index:e.index?e.index:0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var X=Object.create(null),T=["https://api.simplesvg.com","https://api.unisvg.com"],D=[];T.length>0;)T.length===1||Math.random()>.5?D.push(T.shift()):D.push(T.pop());X[""]=J({resources:["https://api.iconify.design"].concat(D)});function yt(e,t){const n=J(t);return n===null?!1:(X[e]=n,!0)}function Z(e){return X[e]}var we=(e,t)=>{let n=e,r=n.indexOf("?")!==-1;function o(i){switch(typeof i){case"boolean":return i?"true":"false";case"number":return encodeURIComponent(i);case"string":return encodeURIComponent(i);default:throw new Error("Invalid parameter")}}return Object.keys(t).forEach(i=>{let a;try{a=o(t[i])}catch{return}n+=(r?"&":"?")+encodeURIComponent(i)+"="+a,r=!0}),n},Ie=Object.create(null),V=Object.create(null),mt=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}try{const t=String.fromCharCode(114)+String.fromCharCode(101);if(e=global[t+"qui"+t]("cross-fetch"),typeof e=="function")return e}catch{}return null},_e=mt();function vt(e,t){const n=Z(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(s=>{i=Math.max(i,s.length)});const a=we(t+".json",{icons:""});r=n.maxURL-i-n.path.length-a.length}const o=e+":"+t;return V[e]=n.path,Ie[o]=r,r}var bt=(e,t,n)=>{const r=[];let o=Ie[t];o===void 0&&(o=vt(e,t));const i="icons";let a={type:i,provider:e,prefix:t,icons:[]},s=0;return n.forEach((l,c)=>{s+=l.length+1,s>=o&&c>0&&(r.push(a),a={type:i,provider:e,prefix:t,icons:[]},s=l.length),a.icons.push(l)}),r.push(a),r};function wt(e){if(typeof e=="string"){if(V[e]===void 0){const t=Z(e);if(!t)return"/";V[e]=t.path}return V[e]}return"/"}var It=(e,t,n)=>{if(!_e){n.done(void 0,424);return}let r=wt(t.provider);switch(t.type){case"icons":{const i=t.prefix,s=t.icons.join(",");r+=we(i+".json",{icons:s});break}case"custom":{const i=t.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n.done(void 0,400);return}let o=503;_e(e+r).then(i=>{if(i.status!==200){setTimeout(()=>{n.done(void 0,i.status)});return}return o=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{n.done(void 0,o)});return}setTimeout(()=>{n.done(i)})}).catch(()=>{n.done(void 0,o)})},_t={prepare:bt,send:It};function xt(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,i)=>o.provider!==i.provider?o.provider.localeCompare(i.provider):o.prefix!==i.prefix?o.prefix.localeCompare(i.prefix):o.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const i=o.provider,a=o.prefix,s=o.name;n[i]===void 0&&(n[i]=Object.create(null));const l=n[i];l[a]===void 0&&(l[a]=C(i,a));const c=l[a];let d;c.icons[s]!==void 0?d=t.loaded:a===""||c.missing[s]!==void 0?d=t.missing:d=t.pending;const u={provider:i,prefix:a,name:s};d.push(u)}),t}var x=Object.create(null),ee=Object.create(null);function xe(e,t){e.forEach(n=>{const r=n.provider;if(x[r]===void 0)return;const o=x[r],i=n.prefix,a=o[i];a&&(o[i]=a.filter(s=>s.id!==t))})}function kt(e,t){ee[e]===void 0&&(ee[e]=Object.create(null));const n=ee[e];n[t]||(n[t]=!0,setTimeout(()=>{if(n[t]=!1,x[e]===void 0||x[e][t]===void 0)return;const r=x[e][t].slice(0);if(!r.length)return;const o=C(e,t);let i=!1;r.forEach(a=>{const s=a.icons,l=s.pending.length;s.pending=s.pending.filter(c=>{if(c.prefix!==t)return!0;const d=c.name;if(o.icons[d]!==void 0)s.loaded.push({provider:e,prefix:t,name:d});else if(o.missing[d]!==void 0)s.missing.push({provider:e,prefix:t,name:d});else return i=!0,!0;return!1}),s.pending.length!==l&&(i||xe([{provider:e,prefix:t}],a.id),a.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),a.abort))})}))}var jt=0;function Et(e,t,n){const r=jt++,o=xe.bind(null,n,r);if(!t.pending.length)return o;const i={id:r,icons:t,callback:e,abort:o};return n.forEach(a=>{const s=a.provider,l=a.prefix;x[s]===void 0&&(x[s]=Object.create(null));const c=x[s];c[l]===void 0&&(c[l]=[]),c[l].push(i)}),o}function Ct(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const i=typeof o=="string"?F(o,!1,n):o;(!t||A(i,n))&&r.push({provider:i.provider,prefix:i.prefix,name:i.name})}),r}var ke={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Pt(e,t,n,r,o){const i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index;let s;if(e.random){let p=e.resources.slice(0);for(s=[];p.length>1;){const w=Math.floor(Math.random()*p.length);s.push(p[w]),p=p.slice(0,w).concat(p.slice(w+1))}s=s.concat(p)}else s=e.resources.slice(a).concat(e.resources.slice(0,a));const l=Date.now();let c="pending",d=0,u,h=null,y=[],b=[];typeof r=="function"&&b.push(r);function j(){h&&(clearTimeout(h),h=null)}function ue(){c==="pending"&&(c="aborted"),j(),y.forEach(p=>{p.abort&&p.abort(),p.status==="pending"&&(p.status="aborted")}),y=[]}function jn(p,w){w&&(b=[]),typeof p=="function"&&b.push(p)}function Ve(){return{startTime:l,payload:t,status:c,queriesSent:d,queriesPending:y.length,subscribe:jn,abort:ue}}function de(){c="failed",b.forEach(p=>{p(void 0,u)})}function Be(){y=y.filter(p=>(p.status==="pending"&&(p.status="aborted"),p.abort&&p.abort(),!1))}function En(p,w,q){const $=w===void 0;switch(y=y.filter(I=>I!==p),c){case"pending":break;case"failed":if($||!e.dataAfterTimeout)return;break;default:return}if($){q!==void 0&&(u=q),y.length||(s.length?he():de());return}if(j(),Be(),o&&!e.random){const I=e.resources.indexOf(p.resource);I!==-1&&I!==e.index&&o(I)}c="completed",b.forEach(I=>{I(w)})}function he(){if(c!=="pending")return;j();const p=s.shift();if(p===void 0){if(y.length){const $=typeof e.timeout=="function"?e.timeout(l):e.timeout;if($){h=setTimeout(()=>{j(),c==="pending"&&(Be(),de())},$);return}}de();return}const w={getQueryStatus:Ve,status:"pending",resource:p,done:($,I)=>{En(w,$,I)}};y.push(w),d++;const q=typeof e.rotate=="function"?e.rotate(d,l):e.rotate;h=setTimeout(he,q),n(p,t,w)}return setTimeout(he),Ve}function $t(e){if(typeof e!="object"||typeof e.resources!="object"||!(e.resources instanceof Array)||!e.resources.length)throw new Error("Invalid Reduncancy configuration");const t=Object.create(null);let n;for(n in ke)e[n]!==void 0?t[n]=e[n]:t[n]=ke[n];return t}function je(e){const t=$t(e);let n=[];function r(){n=n.filter(s=>s().status==="pending")}function o(s,l,c){const d=Pt(t,s,l,(u,h)=>{r(),c&&c(u,h)},u=>{t.index=u});return n.push(d),d}function i(s){const l=n.find(c=>s(c));return l!==void 0?l:null}return{query:o,find:i,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function Ee(){}var te=Object.create(null);function St(e){if(te[e]===void 0){const t=Z(e);if(!t)return;const n=je(t),r={config:t,redundancy:n};te[e]=r}return te[e]}function At(e,t,n){let r,o;if(typeof e=="string"){const i=Y(e);if(!i)return n(void 0,424),Ee;o=i.send;const a=St(e);a&&(r=a.redundancy)}else{const i=J(e);if(i){r=je(i);const a=e.resources?e.resources[0]:"",s=Y(a);s&&(o=s.send)}}return!r||!o?(n(void 0,424),Ee):r.query(t,o,n)().abort}var ne={};function Ce(){}var P=Object.create(null),re=Object.create(null),oe=Object.create(null),ie=Object.create(null);function Ot(e,t){oe[e]===void 0&&(oe[e]=Object.create(null));const n=oe[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,kt(e,t)}))}var Pe=Object.create(null);function Tt(e,t,n){function r(){const s=(e===""?"":"@"+e+":")+t,l=Math.floor(Date.now()/6e4);Pe[s]<l&&(Pe[s]=l,console.error('Unable to retrieve icons for "'+s+'" because API is not configured properly.'))}re[e]===void 0&&(re[e]=Object.create(null));const o=re[e];ie[e]===void 0&&(ie[e]=Object.create(null));const i=ie[e];P[e]===void 0&&(P[e]=Object.create(null));const a=P[e];o[t]===void 0?o[t]=n:o[t]=o[t].concat(n).sort(),i[t]||(i[t]=!0,setTimeout(()=>{i[t]=!1;const s=o[t];delete o[t];const l=Y(e);if(!l){r();return}l.prepare(e,t,s).forEach(d=>{At(e,d,(u,h)=>{const y=C(e,t);if(typeof u!="object"){if(h!==404)return;const b=Date.now();d.icons.forEach(j=>{y.missing[j]=b})}else try{const b=H(y,u);if(!b.length)return;const j=a[t];b.forEach(ue=>{delete j[ue]}),ne.store&&ne.store(e,u)}catch(b){console.error(b)}Ot(e,t)})})}))}var Rt=(e,t)=>{const n=Ct(e,!0,ve()),r=xt(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,Ce)}),()=>{c=!1}}const o=Object.create(null),i=[];let a,s;r.pending.forEach(c=>{const d=c.provider,u=c.prefix;if(u===s&&d===a)return;a=d,s=u,i.push({provider:d,prefix:u}),P[d]===void 0&&(P[d]=Object.create(null));const h=P[d];h[u]===void 0&&(h[u]=Object.create(null)),o[d]===void 0&&(o[d]=Object.create(null));const y=o[d];y[u]===void 0&&(y[u]=[])});const l=Date.now();return r.pending.forEach(c=>{const d=c.provider,u=c.prefix,h=c.name,y=P[d][u];y[h]===void 0&&(y[h]=l,o[d][u].push(h))}),i.forEach(c=>{const d=c.provider,u=c.prefix;o[d][u].length&&Tt(d,u,o[d][u])}),t?Et(t,r,i):Ce},$e="iconify2",R="iconify",Se=R+"-count",Ae=R+"-version",Oe=36e5,Mt=168,se={local:!0,session:!0},ae=!1,Te={local:0,session:0},Re={local:[],session:[]},B=typeof window=="undefined"?{}:window;function Me(e){const t=e+"Storage";try{if(B&&B[t]&&typeof B[t].length=="number")return B[t]}catch{}return se[e]=!1,null}function ce(e,t,n){try{return e.setItem(Se,n+""),Te[t]=n,!0}catch{return!1}}function Le(e){const t=e.getItem(Se);if(t){const n=parseInt(t);return n||0}return 0}function Lt(e,t){try{e.setItem(Ae,$e)}catch{}ce(e,t,0)}function Nt(e){try{const t=Le(e);for(let n=0;n<t;n++)e.removeItem(R+n)}catch{}}var Ne=()=>{if(ae)return;ae=!0;const e=Math.floor(Date.now()/Oe)-Mt;function t(n){const r=Me(n);if(!r)return;const o=i=>{const a=R+i,s=r.getItem(a);if(typeof s!="string")return!1;let l=!0;try{const c=JSON.parse(s);if(typeof c!="object"||typeof c.cached!="number"||c.cached<e||typeof c.provider!="string"||typeof c.data!="object"||typeof c.data.prefix!="string")l=!1;else{const d=c.provider,u=c.data.prefix,h=C(d,u);l=H(h,c.data).length>0}}catch{l=!1}return l||r.removeItem(a),l};try{const i=r.getItem(Ae);if(i!==$e){i&&Nt(r),Lt(r,n);return}let a=Le(r);for(let s=a-1;s>=0;s--)o(s)||(s===a-1?a--:Re[n].push(s));ce(r,n,a)}catch{}}for(const n in se)t(n)},Ft=(e,t)=>{ae||Ne();function n(r){if(!se[r])return!1;const o=Me(r);if(!o)return!1;let i=Re[r].shift();if(i===void 0&&(i=Te[r],!ce(o,r,i+1)))return!1;try{const a={cached:Math.floor(Date.now()/Oe),provider:e,data:t};o.setItem(R+i,JSON.stringify(a))}catch{return!1}return!0}n("local")||n("session")},Fe=/[\s,]+/;function Dt(e,t){t.split(Fe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Vt(e,t){t.split(Fe).forEach(n=>{const r=n.trim();switch(r){case"left":case"center":case"right":e.hAlign=r;break;case"top":case"middle":case"bottom":e.vAlign=r;break;case"slice":case"crop":e.slice=!0;break;case"meet":e.slice=!1}})}function Bt(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/o,i%1==0?r(i):0)}}return t}const Ut={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"};let k={};["horizontal","vertical"].forEach(e=>{["Align","Flip"].forEach(t=>{const r={attr:e.slice(0,1)+t,boolean:t==="Flip"};k[e+"-"+t.toLowerCase()]=r,k[e.slice(0,1)+"-"+t.toLowerCase()]=r,k[e+t]=r})});const qt=(e,t)=>{const n=st(be,t),r=_({},Ut);let o=typeof t.style=="object"&&!(t.style instanceof Array)?_({},t.style):{};for(let l in t){const c=t[l];if(c!==void 0)switch(l){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[l]=c===!0||c==="true"||c===1;break;case"flip":typeof c=="string"&&Dt(n,c);break;case"align":typeof c=="string"&&Vt(n,c);break;case"color":o.color=c;break;case"rotate":typeof c=="string"?n[l]=Bt(c):typeof c=="number"&&(n[l]=c);break;case"ariaHidden":case"aria-hidden":c!==!0&&c!=="true"&&delete r["aria-hidden"];break;default:k[l]!==void 0?k[l].boolean&&(c===!0||c==="true"||c===1)?n[k[l].attr]=!0:!k[l].boolean&&typeof c=="string"&&c!==""&&(n[k[l].attr]=c):be[l]===void 0&&(r[l]=c)}}const i=ft(e,n);for(let l in i.attributes)r[l]=i.attributes[l];i.inline&&o.verticalAlign===void 0&&o["vertical-align"]===void 0&&(o.verticalAlign="-0.125em");let a=0;const s=t.id;return r.innerHTML=pt(i.body,s?()=>s+"-"+a++:"iconify-vue-"),Object.keys(o).length>0&&(r.style=o),f.h("svg",r)};if(ve(!0),gt("",_t),typeof document!="undefined"&&typeof window!="undefined"){ne.store=Ft,Ne();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!it(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;yt(n,o)||console.error(r)}catch{console.error(r)}}}}const le=f.defineComponent({inheritAttrs:!1,data(){return{mounted:!1,counter:0}},beforeMount(){this._name="",this._loadingIcon=null,this.mounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:Q(e)};let n;if(typeof e!="string"||(n=F(e,!1,!0))===null)return this.abortLoading(),null;const r=rt(n);if(r===null)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",this._loadingIcon={name:e,abort:Rt([n],()=>{this.counter++})}),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const o=["iconify"];return n.prefix!==""&&o.push("iconify--"+n.prefix),n.provider!==""&&o.push("iconify--"+n.provider),{data:r,classes:o}}},render(){if(!this.mounted)return this.$slots.default?this.$slots.default():null;this.counter;const e=this.$attrs,t=this.getIcon(e.icon,e.onLoad);if(!t)return this.$slots.default?this.$slots.default():null;let n=e;return t.classes&&(n=pe(_({},e),{class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")})),qt(t.data,n)}});var U=(e,t)=>{for(const[n,r]of t)e[n]=r;return e};const zt={components:{Icon:le},setup(){return{icons:{error:"mdi:alert",warning:"mdi:alert-circle",info:"mdi:information",success:"mdi:check-bold"},colors:{error:"text-red",warning:"text-orange",info:"text-purple",success:"text-green"}}}},Qt={class:"ml-4 leading-tight"};function Kt(e,t,n,r,o,i){const a=f.resolveComponent("Icon");return f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(f.TransitionGroup,{tag:"div",name:"pf-list",class:"fixed w-2/3 space-y-2 transition-all sm:w-1/4 bottom-2 left-2"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.$notif.list,s=>(f.openBlock(),f.createElementBlock("div",{key:s.id,class:"flex items-center p-4 transition bg-white rounded shadow-sm"},[f.createVNode(a,{class:f.normalizeClass([r.colors[s.type],"text-xl"]),icon:r.icons[s.type],inline:""},null,8,["class","icon"]),f.createElementVNode("p",Qt,f.toDisplayString(s.message),1)]))),128))]),_:1})])}var Ht=U(zt,[["render",Kt]]);const M=f.ref([]),Gt=f.readonly(M);function L(e,t,n){const r=We();M.value=[...M.value,{type:e,message:t,actions:n,id:r}],setTimeout(()=>{M.value=M.value.filter(o=>o.id!==r)},2e3)}function Wt(...e){L("error",...e)}function Yt(...e){L("warn",...e)}function Jt(...e){L("info",...e)}function Xt(...e){L("success",...e)}function Zt(e){e.config.globalProperties.$notif=f.reactive({list:Gt,push:L,error:Wt,warn:Yt,info:Jt,success:Xt}),e.component("Pf_TheNotifications",Ht)}var On="";const en={components:{Icon:le},props:{title:{type:String,default:null}},emits:["close"]},tn={class:"flex items-start"},nn={class:"flex-1 overflow-hidden title overflow-ellipsis"},rn={class:"overflow-auto content"},on={class:"py-2"};function sn(e,t,n,r,o,i){const a=f.resolveComponent("Icon");return f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createElementVNode("div",{class:"fixed inset-0 bg-gray-200",onClick:t[2]||(t[2]=s=>e.$emit("close"))},[f.createElementVNode("div",{class:"p-2 m-auto mt-2 bg-white rounded-md shadow-md sm:mt-4 top-2 pf-dialog",onClick:t[1]||(t[1]=f.withModifiers(()=>{},["stop"]))},[f.createElementVNode("div",tn,[f.createElementVNode("div",nn,f.toDisplayString(n.title),1),f.createElementVNode("button",{class:"ml-2 pf-icon-btn",onClick:t[0]||(t[0]=s=>e.$emit("close"))},[f.createVNode(a,{icon:"mdi:close",class:"text-purple"})])]),f.createElementVNode("div",rn,[f.renderSlot(e.$slots,"default")]),f.createElementVNode("div",on,[f.renderSlot(e.$slots,"footer")])])])])}var an=U(en,[["render",sn]]);function cn(e){const t=v.useRoute(),n=v.useRouter(),r=f.computed(()=>!!t.query[e]);return f.watch(r,o=>{o?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},{immediate:!0}),{isOpen:r,open(){const o=pe(_({},t.query),{[e]:"open"});n.push({query:o})},async close(){const o=new Promise(a=>{const s=f.watch(r,l=>{l||(a(),s())})}),i=_({},t.query);return delete i[e],n.replace({query:i}),o}}}function ln(e){e.component("Pf_Dialog",an)}const fn=[{breakpoint:"sm",mediaQueryList:window.matchMedia("(min-width: 640px)")},{breakpoint:"md",mediaQueryList:window.matchMedia("(min-width: 768px)")},{breakpoint:"lg",mediaQueryList:window.matchMedia("(min-width: 1024px)")},{breakpoint:"xl",mediaQueryList:window.matchMedia("(min-width: 1280px)")},{breakpoint:"2xl",mediaQueryList:window.matchMedia("(min-width: 1536px)")}],fe=f.reactive({});fn.forEach(({breakpoint:e,mediaQueryList:t})=>{function n(r){fe[e]=r.matches}t.addListener(n),fe[e]=t.matches});function un(e){e.config.globalProperties.$responsive=f.reactive({breakpoints:fe})}function dn(e){e.component("Pf_Icon",le)}class hn{constructor({supabase:t,roleContextKeyName:n,devRedirectTo:r}){this.supabase=t,this.roleContextKeyName=n,this.devRedirectTo=r,this._user=f.ref(void 0),this._roles=f.ref(void 0)}async getUserProfile(t){const{data:n,error:r}=await this.supabase.from("profiles").select().match({id:t});return r||n.length===0?null:n[0]}async synchroUserWithSupabase(t){if(t){const n=t.user.id,{firstname:r,lastname:o}=await this.getUserProfile(n)||{};this._user.value={id:n,avatar:t.user.user_metadata.avatar_url,firstname:r,lastname:o}}else this._user.value=null;this._roles.value=void 0,await this.synchronizeRoles()}async synchronizeRoles(t){if(!this._user.value){this._roles.value=[];return}let n,r;t?{data:n,error:r}=await this.supabase.from("roles").select().match({user_id:this._user.value.id}).or(`${this.roleContextKeyName}.eq.${t},${this.roleContextKeyName}.is.null`):{data:n,error:r}=await this.supabase.from("roles").select().match({user_id:this._user.value.id}).is(`${this.roleContextKeyName}`,null),r?this._roles.value=[]:this._roles.value=n.map(({name:o})=>o)}async synchronizeProfile(){return await this.synchroUserWithSupabase(this.supabase.auth.session())}async login(){this.devRedirectTo?await this.supabase.auth.signIn({provider:"discord"},{redirectTo:this.devRedirectTo}):await this.supabase.auth.signIn({provider:"discord"})}async logout(){await this.supabase.auth.signOut()}async setProfile(t){if(!this._user.value)return;const{error:n}=await this.supabase.from("profiles").update(t).match({id:this._user.value.id});if(n)return Promise.reject(n);await this.synchronizeProfile()}async getIsAuthenticated(){return this._user.value!==void 0?Promise.resolve(!!this._user.value):new Promise(t=>{const n=f.watch(this._user,r=>{r!==void 0&&(t(r!==null),n())})})}async getHasRoles(t){return this._roles.value!==void 0?Promise.resolve(t.some(n=>this._roles.value.includes(n))):new Promise(n=>{const r=f.watch(this._roles,o=>{o!==void 0&&(n(t.some(i=>this._roles.value.includes(i))),r())})})}}const De=Symbol("Authentification");function pn(e,{supabase:t,router:n,loginRouteName:r="login",defaultRouteName:o="home",roleContextKeyName:i,devRedirectTo:a}={}){const s=new hn({supabase:t,roleContextKeyName:i,devRedirectTo:a}),l=f.readonly(s._user),c=f.readonly(s._roles);s.synchroUserWithSupabase(t.auth.session()),t.auth.onAuthStateChange((u,h)=>{s.synchroUserWithSupabase(h)});const d=f.reactive({user:l,roles:c,login:s.login.bind(s),logout:s.login.bind(s),setProfile:s.setProfile.bind(s),synchronizeRoles:s.synchronizeRoles.bind(s)});e.config.globalProperties.$auth=d,n.beforeEach(async u=>{if(u.meta.auth||u.meta.roles){if(!await s.getIsAuthenticated())return{name:r,query:{redirect_uri:u.fullPath}};if(u.meta.roles&&!await s.getHasRoles(u.meta.roles))return{name:o}}}),e.provide(De,d)}function gn(){const e=f.inject(De,{}),t=f.toRef(e,"user"),n=f.toRef(e,"roles");return{user:t,roles:n,synchronizeRoles:e.synchronizeRoles,setProfile:e.synchronizeProfile}}const yn={},mn={class:"animate-spin rounded-full border-t-2 border-b-2 border-purple"};function vn(e,t){return f.openBlock(),f.createElementBlock("div",mn)}var bn=U(yn,[["render",vn]]);const wn={components:{Spinner:bn},inheritAttrs:!1,props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},computed:{internalDisabled(){return this.loading&&this.disabled}}},In=["disabled"],_n={key:0,name:"loading",class:"absolute inset-0 bg-white flex items-center justify-center"};function xn(e,t,n,r,o,i){const a=f.resolveComponent("Spinner");return f.openBlock(),f.createElementBlock("button",f.mergeProps({class:"pf-btn -primary flex relative",type:"submit"},e.$attrs,{disabled:i.internalDisabled}),[f.renderSlot(e.$slots,"default"),n.loading?(f.openBlock(),f.createElementBlock("div",_n,[f.createVNode(a,{class:"h-4 w-4"})])):f.createCommentVNode("",!0)],16,In)}var kn=U(wn,[["render",xn]]),Tn="";g.AuthPlugin=pn,g.IconPlugin=dn,g.ModalPlugin=ln,g.NotificationsPlugin=Zt,g.Pf_SubmitButton=kn,g.ResponsivePlugin=un,g.useAuth=gn,g.useModal=cn,Object.defineProperty(g,"__esModule",{value:!0}),g[Symbol.toStringTag]="Module"});

@@ -7,3 +7,3 @@ {

],
"version": "1.0.7",
"version": "1.1.0",
"main": "./dist/purplefox-tools.umd.js",

@@ -10,0 +10,0 @@ "module": "./dist/purplefox-tools.es.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc