mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-25 11:28:13 +08:00
1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
import{$ as e,B as t,C as n,D as r,It as i,Lt as a,M as o,O as s,P as c,Rt as l,V as u,X as d,_t as f,c as p,d as m,f as h,ft as g,j as ee,l as _,lt as v,mt as y,u as b,y as x,z as S,zt as C}from"./runtime-core.esm-bundler-CZvn3YaB.js";import{D as w,L as T,M as te}from"./client-C5e5tgZO.js";import{i as ne,j as re,x as ie}from"./composables-DsGBjQEX.js";import{t as ae}from"./plugin-vue_export-helper-CxTVcLa7.js";var oe=x({__name:`VPIconFa`,props:{name:{},size:{},color:{},prefix:{},extra:{}},setup(e){let t={solid:[`fas`,`s`],regular:[`far`,`r`],light:[`fal`,`l`],thin:[`fat`,`t`],"duotone solid":[`fads`,`ds`],"sharp solid":[`fass`,`ss`],"sharp regular":[`fasr`,`sr`],"sharp light":[`fasl`,`sl`],"sharp thin":[`fast`,`st`],"sharp-duotone solid":[`fasds`,`sds`],brands:[`fab`,`b`]},n=p(()=>{let[n,r]=(e.name.includes(`:`)?e.name:`${e.prefix||`fas`}:${e.name}`).split(`:`),i=`solid`;for(let[e,r]of Object.entries(t))if(r.includes(n)){i=e;break}return`${i.split(` `).map(e=>`fa-${e.trim()}`).join(` `)} fa-${r}`}),r=p(()=>e.extra?e.extra.split(` `).map(e=>e.trim().startsWith(`fa-`)?e:`fa-${e}`):[]);return(t,a)=>(c(),h(`i`,{class:i([`vp-icon fontawesome`,[n.value,...r.value]]),"data-provider":`fontawesome`,"aria-hidden":``,style:l({color:e.color,...e.size})},null,6))}}),se=x({__name:`VPIconfont`,props:{name:{},size:{},color:{},prefix:{}},setup(e){return(t,n)=>(c(),h(`i`,{class:i([`vp-icon`,`${e.prefix||`iconfont icon-`}${e.name}`]),style:l({color:e.color,"font-size":e.size?.height||`1em`}),"data-provider":`iconfont`,"aria-hidden":``},null,6))}}),ce=/^[a-z0-9]+(-[a-z0-9]+)*$/,E=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!D(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!D(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!D(e,n)?null:e}return null},D=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,O=Object.freeze({left:0,top:0,width:16,height:16}),k=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),A=Object.freeze({...O,...k}),j=Object.freeze({...A,body:``,hidden:!1});function le(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function M(e,t){let n=le(e,t);for(let r in j)r in k?r in e&&!(r in n)&&(n[r]=k[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ue(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}function de(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=M(r[e]||i[e],a)}return o(t),n.forEach(o),M(e,a)}function N(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=ue(e);for(let i in r){let a=r[i];a&&(t(i,de(e,i,a)),n.push(i))}return n}var fe={provider:``,aliases:{},not_found:{},...O};function P(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function pe(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!P(e,fe))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!P(t,j))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!P(t,j))return null}return t}var me=Object.create(null);function he(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function F(e,t){let n=me[e]||(me[e]=Object.create(null));return n[t]||(n[t]=he(e,t))}function ge(e,t){return pe(t)?N(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function _e(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var I=!1;function ve(e){return typeof e==`boolean`&&(I=e),I}function ye(e){let t=typeof e==`string`?E(e,!0,I):e;if(t){let e=F(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function be(e,t){let n=E(e,!0,I);if(!n)return!1;let r=F(n.provider,n.prefix);return t?_e(r,n.name,t):(r.missing.add(n.name),!0)}function xe(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),I&&!t&&!e.prefix){let t=!1;return pe(e)&&(e.prefix=``,N(e,(e,n)=>{be(e,n)&&(t=!0)})),t}let n=e.prefix;return D({prefix:n,name:`a`})?!!ge(F(t,n),e):!1}var Se=Object.freeze({width:null,height:null}),Ce=Object.freeze({...Se,...k}),we=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Te=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ee(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(we);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=Te.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function De(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Oe(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ke(e,t,n){let r=De(e);return Oe(r.defs,t+r.content+n)}var Ae=e=>e===`unset`||e===`undefined`||e===`none`;function je(e,t){let n={...A,...e},r={...Ce,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=ke(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=Ee(d,c/l)):(u=o===`auto`?c:o,d=s===null?Ee(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Ae(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Me=/\sid="(\S+)"/g,Ne=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Pe=0;function Fe(e,t=Ne){let n=[],r;for(;r=Me.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Pe++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var L=Object.create(null);function Ie(e,t){L[e]=t}function R(e){return L[e]||L[``]}function z(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||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var B=Object.create(null),V=[`https://api.simplesvg.com`,`https://api.unisvg.com`],H=[];V.length>0;)V.length===1||Math.random()>.5?H.push(V.shift()):H.push(V.pop());B[``]=z({resources:[`https://api.iconify.design`].concat(H)});function Le(e,t){let n=z(t);return n===null?!1:(B[e]=n,!0)}function U(e){return B[e]}var W=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Re(e,t){let n=U(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function ze(e){return e===404}var Be=(e,t,n)=>{let r=[],i=Re(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Ve(e){if(typeof e==`string`){let t=U(e);if(t)return t.path}return`/`}var He={prepare:Be,send:(e,t,n)=>{if(!W){n(`abort`,424);return}let r=Ve(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;W(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(ze(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function Ue(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=F(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function We(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Ge(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||We([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ke=0;function qe(e,t,n){let r=Ke++,i=We.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function Je(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?E(e,t,n):e;i&&r.push(i)}),r}var Ye={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Xe(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function ee(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function _(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function v(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function y(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,_();return}if(i){u=r,f.length||(o.length?b():_());return}if(m(),v(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function b(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(v(),_())},e.timeout);return}_();return}let i={status:`pending`,resource:r,callback:(e,t)=>{y(i,e,t)}};f.push(i),l++,d=setTimeout(b,e.rotate),n(r,t,i.callback)}return setTimeout(b),ee}function Ze(e){let t={...Ye,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Xe(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Qe(){}var G=Object.create(null);function $e(e){if(!G[e]){let t=U(e);if(!t)return;G[e]={config:t,redundancy:Ze(t)}}return G[e]}function et(e,t,n){let r,i;if(typeof e==`string`){let t=R(e);if(!t)return n(void 0,424),Qe;i=t.send;let a=$e(e);a&&(r=a.redundancy)}else{let t=z(e);if(t){r=Ze(t);let n=R(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Qe):r.query(t,i,n)().abort}function tt(){}function nt(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Ge(e)}))}function rt(e){let t=[],n=[];return e.forEach(e=>{(e.match(ce)?t:n).push(e)}),{valid:t,invalid:n}}function K(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!ge(e,n).length){r();return}}catch(e){console.error(e)}r(),nt(e)}function it(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function at(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){it(e.loadIcons(r,n,t),t=>{K(e,r,t)});return}if(i){r.forEach(r=>{it(i(r,n,t),t=>{K(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=rt(r);if(o.length&&K(e,o,null),!a.length)return;let s=n.match(ce)?R(t):null;if(!s){K(e,a,null);return}s.prepare(t,n,a).forEach(n=>{et(t,n,t=>{K(e,n.icons,t)})})}))}var ot=(e,t)=>{let n=Ue(Je(e,!0,ve()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,tt)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(F(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=F(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&at(e,t)}),t?qe(t,n,i):tt},st=e=>new Promise((t,n)=>{let r=typeof e==`string`?E(e,!0):e;if(!r){n(e);return}ot([r||e],i=>{if(i.length&&r){let e=ye(r);if(e){t({...A,...e});return}}n(e)})});function ct(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in Se?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var lt=/[\s,]+/;function ut(e,t){t.split(lt).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function dt(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function ft(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function pt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function mt(e){return`data:image/svg+xml,`+pt(e)}function ht(e){return`url("`+mt(e)+`")`}var gt={...Ce,inline:!1},_t={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},vt={display:`inline-block`},q={backgroundColor:`currentColor`},yt={backgroundColor:`transparent`},bt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},xt={webkitMask:q,mask:q,background:yt};for(let e in xt){let t=xt[e];for(let n in bt)t[e+n]=bt[n]}var J={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;J[e+`-flip`]=t,J[e.slice(0,1)+`-flip`]=t,J[e+`Flip`]=t});function St(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Ct=(e,t)=>{let r=ct(gt,t),i={..._t},a=t.mode||`svg`,o={},s=t.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:r[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&ut(r,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?r[e]=dt(n):typeof n==`number`&&(r[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete i[`aria-hidden`];break;default:{let t=J[e];t?(n===!0||n===`true`||n===1)&&(r[t]=!0):gt[e]===void 0&&(i[e]=n)}}}let l=je(e,r),u=l.attributes;if(r.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){i.style={...o,...c},Object.assign(i,u);let e=0,r=t.id;return typeof r==`string`&&(r=r.replace(/-/g,`_`)),i.innerHTML=Fe(l.body,r?()=>r+`ID`+ e++:`iconifyVue`),n(`svg`,i)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=ft(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":ht(h),width:St(u.width),height:St(u.height),...vt,...m?q:yt,...c},n(`span`,i)};if(ve(!0),Ie(``,He),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!xe(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Le(e,r)||console.error(n)}catch{console.error(n)}}}}var wt={...A,body:``};x((e,{emit:t})=>{let n=v(null);function r(){n.value&&=(n.value.abort?.(),null)}let i=v(!!e.ssr),a=v(``),c=g(null);function l(){let i=e.icon;if(typeof i==`object`&&i&&typeof i.body==`string`)return a.value=``,{data:i};let o;if(typeof i!=`string`||(o=E(i,!1,!0))===null)return null;let c=ye(o);if(!c){let e=n.value;return(!e||e.name!==i)&&(c===null?n.value={name:i}:n.value={name:i,abort:ot([o],u)}),null}r(),a.value!==i&&(a.value=i,s(()=>{t(`load`,i)}));let l=e.customise;if(l){c=Object.assign({},c);let e=l(c.body,o.name,o.prefix,o.provider);typeof e==`string`&&(c.body=e)}let d=[`iconify`];return o.prefix!==``&&d.push(`iconify--`+o.prefix),o.provider!==``&&d.push(`iconify--`+o.provider),{data:c,classes:d}}function u(){let e=l();e?e.data!==c.value?.data&&(c.value=e):c.value=null}return i.value?u():ee(()=>{i.value=!0,u()}),d(()=>e.icon,u),o(r),()=>{let t=c.value;if(!t)return Ct(wt,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),Ct({...A,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]});var Tt=Object.freeze({left:0,top:0,width:16,height:16}),Et=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Y=Object.freeze({...Tt,...Et});Object.freeze({...Y,body:``,hidden:!1}),{...Tt};var X=Object.freeze({width:null,height:null}),Dt=Object.freeze({...X,...Et});function Ot(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in X?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var kt=/[\s,]+/;function At(e,t){t.split(kt).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function jt(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}var Mt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Nt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Pt(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(Mt);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=Nt.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function Ft(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function It(e,t){return e?`<defs>`+e+`</defs>`+t:t}function Lt(e,t,n){let r=Ft(e);return It(r.defs,t+r.content+n)}var Rt=e=>e===`unset`||e===`undefined`||e===`none`;function zt(e,t){let n={...Y,...e},r={...Dt,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=Lt(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=Pt(d,c/l)):(u=o===`auto`?c:o,d=s===null?Pt(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Rt(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Bt=/\sid="(\S+)"/g,Vt=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ht=0;function Ut(e,t=Vt){let n=[],r;for(;r=Bt.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Ht++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}function Wt(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Gt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Kt(e){return`data:image/svg+xml,`+Gt(e)}function qt(e){return`url("`+Kt(e)+`")`}var Jt={...Dt,inline:!1},Yt={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Xt={display:`inline-block`},Z={backgroundColor:`currentColor`},Zt={backgroundColor:`transparent`},Qt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},$t={webkitMask:Z,mask:Z,background:Zt};for(let e in $t){let t=$t[e];for(let n in Qt)t[e+n]=Qt[n]}var Q={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;Q[e+`-flip`]=t,Q[e.slice(0,1)+`-flip`]=t,Q[e+`Flip`]=t});function en(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var tn=(e,t)=>{let r=Ot(Jt,t),i={...Yt},a=t.mode||`svg`,o={},s=t.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:r[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&At(r,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?r[e]=jt(n):typeof n==`number`&&(r[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete i[`aria-hidden`];break;default:{let t=Q[e];t?(n===!0||n===`true`||n===1)&&(r[t]=!0):Jt[e]===void 0&&(i[e]=n)}}}let l=zt(e,r),u=l.attributes;if(r.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){i.style={...o,...c},Object.assign(i,u);let e=0,r=t.id;return typeof r==`string`&&(r=r.replace(/-/g,`_`)),i.innerHTML=Ut(l.body,r?()=>r+`ID`+ e++:`iconifyVue`),n(`svg`,i)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=Wt(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":qt(h),width:en(u.width),height:en(u.height),...Xt,...m?Z:Zt,...c},n(`span`,i)},nn=Object.create(null),rn=x((e,t)=>()=>{let n=e.icon,r=typeof n==`string`?nn[n]:typeof n==`object`?n:null;return typeof r!=`object`||!r||typeof r.body!=`string`?S(t.slots,`default`):tn({...Y,...r},e)},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`]}),an=x({inheritAttrs:!1,__name:`VPIconify`,props:{name:{},size:{},color:{},prefix:{},extra:{}},setup(n){let a=v(null),o=v(!1),s=p(()=>n.name.includes(`:`)?n.name:n.prefix?`${n.prefix}:${n.name}`:n.name),u=p(()=>ne(s.value));async function g(){u.value||a.value||(o.value=!1,a.value=await st(n.name),o.value=!0)}return d(()=>n.name,g,{immediate:!0}),(s,d)=>{let p=t(`ClientOnly`);return u.value?(c(),h(`span`,r({key:0,class:[`vp-icon`,[u.value,n.extra]],style:{color:n.color,...n.size},"aria-hidden":``,"data-provider":`iconify`},s.$attrs),null,16)):(c(),b(p,{key:1},{default:e(()=>[o.value?a.value?(c(),b(f(rn),{key:1,class:i([`vp-icon iconify`,[n.extra]]),icon:a.value,style:l({color:n.color,...n.size}),"aria-hidden":``,"data-provider":`iconify`},null,8,[`class`,`icon`,`style`])):m(``,!0):(c(),h(`span`,r({key:0,class:`vp-icon iconify`,style:{color:n.color,...n.size}},s.$attrs),null,16))]),_:1}))}}}),on={key:0,class:`vp-icon-img`,"aria-hidden":``},sn=[`src`],cn=[`innerHTML`],ln=ae(x({inheritAttrs:!1,__name:`VPIconImage`,props:{type:{},name:{},color:{},size:{}},setup(e){let t=p(()=>e.type===`svg`&&typeof e.name==`object`&&`svg`in e.name?e.name.svg:``),n=p(()=>{if(e.type===`link`){let t=e.name;return T(t)?t:w(t)}return``});return(r,i)=>e.type===`link`?(c(),h(`span`,on,[_(`img`,{src:n.value,alt:``,style:l({height:e.size?.height})},null,12,sn)])):e.type===`svg`?(c(),h(`span`,{key:1,class:`vp-icon is-svg`,style:l({color:e.color,...e.size}),"aria-hidden":``,innerHTML:t.value},null,12,cn)):m(``,!0)}}),[[`__scopeId`,`data-v-61bdc032`]]),$=x({__name:`VPIcon`,props:{provider:{},name:{},size:{},color:{},extra:{}},setup(e){let t=p(()=>{if(typeof e.name==`string`&&(T(e.name)||e.name[0]===`/`))return`link`;if(typeof e.name==`object`&&e.name.svg)return`svg`;if(typeof e.name==`string`){if(e.name.startsWith(`iconify`))return`iconify`;if(e.name.startsWith(`iconfont`))return`iconfont`;if(e.name.startsWith(`fontawesome`))return`fontawesome`}let t=e.provider||`iconify`;return t===`iconfont`||t===`fontawesome`?t:`iconify`});function n(e){return String(Number(e))===String(e)?`${e}px`:String(e)}let i=p(()=>{if(!e.size)return;let[t,r]=String(e.size).replaceAll(`px`,`[UNIT]`).split(`x`).map(e=>n(e.replaceAll(`[UNIT]`,`px`).trim()));return{width:t,height:r||t}}),o=p(()=>({name:typeof e.name==`string`?e.name.replace(/^(iconify|iconfont|fontawesome)\s+/,``):e.name,color:e.color,size:i.value,prefix:``}));return(n,i)=>t.value===`link`||t.value===`svg`?(c(),b(ln,r({key:0,type:t.value},o.value),null,16,[`type`])):t.value===`iconfont`?(c(),b(se,a(r({key:1},o.value)),null,16)):t.value===`fontawesome`?(c(),b(oe,r({key:2,extra:e.extra},{...o.value,...n.$attrs}),null,16,[`extra`])):t.value===`iconify`?(c(),b(an,r({key:3,extra:e.extra},o.value),null,16,[`extra`])):m(``,!0)}}),un={class:`button-content`},dn={key:1,class:`visually-hidden`},fn=ae(x({__name:`VPButton`,props:{tag:{},size:{default:`medium`},theme:{default:`brand`},text:{default:``},href:{},target:{},rel:{},icon:{},suffixIcon:{}},setup(t){let n=t,r=te(),{theme:a}=ie(),o=p(()=>n.tag||n.href?`a`:`button`),{link:s,isExternal:l,isExternalProtocol:d}=re(y(n,`href`),y(n,`target`));function g(e){!l.value&&s.value?.[0]!==`#`&&(e.preventDefault(),s.value&&r.push(s.value))}return(n,r)=>(c(),b(u(o.value),{class:i([`vp-button`,[t.size,t.theme]]),href:f(s)?f(s)[0]===`#`||f(d)?f(s):f(w)(f(s)):void 0,target:t.target??(f(l)?`_blank`:void 0),rel:t.rel??(f(l)?`noopener noreferrer`:void 0),onClick:r[0]||=e=>g(e)},{default:e(()=>[_(`span`,un,[t.icon?(c(),b($,{key:0,name:t.icon},null,8,[`name`])):m(``,!0),S(n.$slots,`default`,{},()=>[_(`span`,null,C(t.text),1)],!0),f(l)?(c(),h(`span`,dn,C(f(a).openNewWindowText||`(Open in new window)`),1)):m(``,!0),t.suffixIcon?(c(),b($,{key:2,name:t.suffixIcon},null,8,[`name`])):m(``,!0)])]),_:3},8,[`class`,`href`,`target`,`rel`]))}}),[[`__scopeId`,`data-v-080a1573`]]);export{$ as n,fn as t}; |