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

@iconify/iconify

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iconify/iconify - npm Package Compare versions

Comparing version 2.0.0-beta.0 to 2.0.0-beta.1

28

dist/iconify.d.ts

@@ -107,2 +107,8 @@

/**
* Load icons
*/
loadIcons: (icons: (IconifyIconName | string)[], callback?: IconifyIconLoaderCallback) => IconifyIconLoaderAbort;
renderSVG: (name: string, customisations: IconifyIconCustomisations) => SVGElement | null;
renderHTML: (name: string, customisations: IconifyIconCustomisations) => string | null;
/**
* Get icon data

@@ -112,3 +118,3 @@ */

/**
* Replace IDs in icon body, should be used when parsing renderIcon() result
* Replace IDs in icon body, should be used when parsing buildIcon() result
*/

@@ -200,2 +206,22 @@ replaceIDs: (body: string) => string;

/**
* Function to abort loading (usually just removes callback because loading is already in progress)
*/
export declare type IconifyIconLoaderAbort = () => void;
/**
* Loader callback
*
* Provides list of icons that have been loaded
*/
export declare type IconifyIconLoaderCallback = (loaded: IconifyIconName[], missing: IconifyIconName[], pending: IconifyIconName[], unsubscribe: IconifyIconLoaderAbort) => void;
/**
* Icon name
*/
declare interface IconifyIconName {
readonly prefix: string;
readonly name: string;
}
/**
* "icons" field of JSON file.

@@ -202,0 +228,0 @@ */

2

dist/iconify.min.js

@@ -13,2 +13,2 @@ /**

*/
var Iconify=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.merge=function(e,t,n){for(var i=Object.create(null),r=[e,t,n],o=0;o<3;o++){var a=r[o];if("object"==typeof a&&a)for(var c in a)i[c]=a[c]}return i}}));e(n);var i=n.merge,r=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/^[a-z0-9]+(-[a-z0-9]+)*$/;t.stringToIcon=function(e){var t=e.split(":");if(t.length>2)return null;if(2===t.length)return{prefix:t[0],name:t[1]};var n=e.split("-");return n.length>1?{prefix:n.shift(),name:n.join("-")}:null},t.validateIcon=function(e){return!!e&&!(!e.prefix.match(n)||!e.name.match(n))}}));e(r);var o=r.stringToIcon,a=r.validateIcon,c=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0}),t.fullCustomisations=function(e){return n.merge(t.defaults,e)}}));e(c);c.defaults;var u=c.fullCustomisations,f=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.iconDefaults=Object.freeze({body:"",left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1}),t.fullIcon=function(e){return n.merge(t.iconDefaults,e)}}));e(f);f.iconDefaults,f.fullIcon;var l=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.keys(f.iconDefaults);t.mergeIcons=function(e,t){var i=Object.create(null);return n.forEach((function(n){if(void 0!==e[n])if(void 0!==t[n])switch(n){case"rotate":return void(i[n]=(e[n]+t[n])%4);case"hFlip":case"vFlip":return void(i[n]=e[n]!==t[n]);default:i[n]=t[n]}else i[n]=e[n];else void 0!==t[n]&&(i[n]=t[n])})),i}}));e(l);l.mergeIcons;var s=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=Object.keys(f.iconDefaults),r=Object.create(null);function o(e){return{prefix:e,icons:Object.create(null),missing:Object.create(null)}}t.newStorage=o,t.getStorage=function(e){return void 0===r[e]&&(r[e]=o(e)),r[e]},t.listStoredPrefixes=function(){return Object.keys(r)},t.addIconSet=function(e,t,r){void 0===r&&(r="none");var o=[];try{if("object"!=typeof t)return!1;if(t.not_found instanceof Array){var a=Date.now();t.not_found.forEach((function(t){e.missing[t]=a,"all"===r&&o.push(t)}))}if("object"!=typeof t.icons)return!1;var c=Object.create(null);i.forEach((function(e){void 0!==t[e]&&"object"!=typeof t[e]&&(c[e]=t[e])}));var u=t.icons;if(Object.keys(u).forEach((function(t){var i=u[t];if("string"!=typeof i.body)throw new Error("Invalid icon");e.icons[t]=Object.freeze(n.merge(f.iconDefaults,c,i)),"none"!==r&&o.push(t)})),"object"==typeof t.aliases){var s=t.aliases;Object.keys(s).forEach((function(t){var i=function e(t,n,i,r){void 0===r&&(r=0);var o=t.parent;if(void 0!==n[o])return l.mergeIcons(n[o],t);if(void 0!==i[o]){if(r>2)throw new Error("Invalid alias");var a=e(i[o],n,i,r+1);if(a)return l.mergeIcons(a,t)}return null}(s[t],u,s,1);i&&(e.icons[t]=Object.freeze(n.merge(f.iconDefaults,c,i)),"none"!==r&&o.push(t))}))}}catch(e){return!1}return"none"===r||o},t.addIcon=function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]=Object.freeze(f.fullIcon(n)),!0}catch(e){}return!1},t.iconExists=function(e,t){return void 0!==e.icons[t]},t.getIcon=function(e,t){var n=e.icons[t];return void 0===n?null:n}}));e(s);s.newStorage;var d=s.getStorage,v=s.listStoredPrefixes,p=s.addIconSet,h=s.addIcon,g=(s.iconExists,s.getIcon),m=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/(-?[0-9.]*[0-9]+[0-9.]*)/g,i=/^-?[0-9.]*[0-9]+[0-9.]*$/g;t.calcSize=function(e,t,r){if(1===t)return e;if(r=void 0===r?100:r,"number"==typeof e)return Math.ceil(e*t*r)/r;if("string"!=typeof e)return e;var o=e.split(n);if(null===o||!o.length)return e;for(var a=[],c=o.shift(),u=i.test(c);;){if(u){var f=parseFloat(c);isNaN(f)?a.push(c):a.push(Math.ceil(f*t*r)/r)}else a.push(c);if(void 0===(c=o.shift()))return a.join("");u=!u}}}));e(m);var b=m.calcSize,y=t((function(e,t){function n(e){var 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"}Object.defineProperty(t,"__esModule",{value:!0}),t.iconToSVG=function(e,t){var i,r,o,a={left:e.left,top:e.top,width:e.width,height:e.height},c=[],u=t.rotate;switch(t.hFlip?t.vFlip?u+=2:(c.push("translate("+(a.width+a.left)+" "+(0-a.top)+")"),c.push("scale(-1 1)"),a.top=a.left=0):t.vFlip&&(c.push("translate("+(0-a.left)+" "+(a.height+a.top)+")"),c.push("scale(1 -1)"),a.top=a.left=0),u%=4){case 1:i=a.height/2+a.top,c.unshift("rotate(90 "+i+" "+i+")");break;case 2:c.unshift("rotate(180 "+(a.width/2+a.left)+" "+(a.height/2+a.top)+")");break;case 3:i=a.width/2+a.left,c.unshift("rotate(-90 "+i+" "+i+")")}u%2==1&&(0===a.left&&0===a.top||(i=a.left,a.left=a.top,a.top=i),a.width!==a.height&&(i=a.width,a.width=a.height,a.height=i)),null===t.width&&null===t.height?(o="1em",r=m.calcSize(o,a.width/a.height)):null!==t.width&&null!==t.height?(r=t.width,o=t.height):null!==t.height?(o=t.height,r=m.calcSize(o,a.width/a.height)):(r=t.width,o=m.calcSize(r,a.height/a.width)),"auto"===r&&(r=a.width),"auto"===o&&(o=a.height),r="string"==typeof r?r:r+"",o="string"==typeof o?o:o+"";var f=e.body;c.length&&(f='<g transform="'+c.join(" ")+'">'+f+"</g>");var l={attributes:{width:r,height:o,preserveAspectRatio:n(t),viewBox:a.left+" "+a.top+" "+a.width+" "+a.height},body:f};return t.inline&&(l.inline=!0),l}}));e(y);var x=y.iconToSVG,j=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/\sid="(\S+)"/g,i="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",r=0;function o(e,t,n){for(var i=0;-1!==(i=n.indexOf(e,i));)n=n.slice(0,i)+t+n.slice(i+e.length),i+=t.length;return n}t.replaceIDs=function(e,t){void 0===t&&(t=i);for(var a,c=[];a=n.exec(e);)c.push(a[1]);return c.length?(c.forEach((function(n){var i="function"==typeof t?t():t+r++;e=o('="'+n+'"','="'+i+'"',e),e=o('="#'+n+'"','="#'+i+'"',e),e=o("(#"+n+")","(#"+i+")",e)})),e):e}}));e(j);var O=j.replaceIDs,I=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.coreModules={}}));e(I);var w=I.coreModules,M={};function k(){return M.root?M.root:document.querySelector("body")}var _="iconifyFinder"+Date.now(),P="iconifyData"+Date.now(),E=[];function S(e){return"string"==typeof e&&(e=o(e)),null!==e&&a(e)?e:null}function A(e){var t=[];E.forEach((function(n){var i=n.find(e);Array.prototype.forEach.call(i,(function(e){var i=e;if(void 0===i[_]||i[_]===n){var r=S(n.name(i));if(null!==r){i[_]=n;var o={element:i,finder:n,name:r};t.push(o)}}}))}));var n=e.querySelectorAll("svg.iconify");return Array.prototype.forEach.call(n,(function(e){var n=e,i=n[_],r=n[P];if(i&&r){var o=S(i.name(n));if(null!==o){var a,c=!1;if(o.prefix!==r.name.prefix||o.name!==r.name.name?c=!0:(a=i.customisations(n),function(e,t){var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++){var o=n[r];if(t[o]!==e[o])return!1}return!0}(r.customisations,a)||(c=!0)),c){var u={element:n,finder:i,name:o,customisations:a};t.push(u)}}}})),t}var C=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rotateFromString=function(e){var t=e.replace(/^-?[0-9.]*/,"");function n(e){for(;e<0;)e+=4;return e%4}if(""===t){var i=parseInt(e);return isNaN(i)?0:n(i)}if(t!==e){var r=0;switch(t){case"%":r=25;break;case"deg":r=90}if(r){var o=parseFloat(e.slice(0,e.length-t.length));return isNaN(o)?0:(o/=r)%1==0?n(o):0}}return 0}}));e(C);var F=C.rotateFromString,T=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/[\s,]+/;t.flipFromString=function(e,t){t.split(n).forEach((function(t){switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}}))},t.alignmentFromString=function(e,t){t.split(n).forEach((function(t){var n=t.trim();switch(n){case"left":case"center":case"right":e.hAlign=n;break;case"top":case"middle":case"bottom":e.vAlign=n;break;case"slice":e.slice=!0;break;case"meet":e.slice=!1}}))}}));e(T);var D=T.flipFromString,z=T.alignmentFromString;function N(e,t){return e.hasAttribute(t)}function L(e,t){return e.getAttribute(t)}var R=["inline","hFlip","vFlip"],q=["width","height"],U={find:function(e){return e.querySelectorAll("i.iconify, span.iconify, i.iconify-inline, span.iconify-inline")},name:function(e){return N(e,"data-icon")?L(e,"data-icon"):null},customisations:function(e,t){void 0===t&&(t={inline:!1});var n=t,i=e.getAttribute("class");if(-1!==(i?i.split(/\s+/):[]).indexOf("iconify-inline")&&(n.inline=!0),N(e,"data-rotate")){var r=F(L(e,"data-rotate"));r&&(n.rotate=r)}return N(e,"data-flip")&&D(n,L(e,"data-flip")),N(e,"data-align")&&z(n,L(e,"data-align")),R.forEach((function(t){if(N(e,"data-"+t)){var i=function(e,t){var n=e.getAttribute(t);return n===t||"true"===n||""!==n&&"false"!==n&&null}(e,"data-"+t);"boolean"==typeof i&&(n[t]=i)}})),q.forEach((function(t){if(N(e,"data-"+t)){var i=L(e,"data-"+t);""!==i&&(n[t]=i)}})),n},classFilter:function(e){var t=[];return e.forEach((function(e){"iconify"!==e&&""!==e&&"iconify--"!==e.slice(0,9)&&t.push(e)})),t}},J=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.config={local:!0,session:!0};var n=!1;t.count={local:0,session:0},t.emptyList={local:[],session:[]};var i="undefined"==typeof window?{}:window;function r(e){var n=e+"Storage";try{if(i&&i[n]&&"number"==typeof i[n].length)return i[n]}catch(e){}return t.config[e]=!1,null}function o(e,n,i){try{return e.setItem("iconify-count",i+""),t.count[n]=i,!0}catch(e){return!1}}function a(e){var t=e.getItem("iconify-count");if(t){var n=parseInt(t);return n||0}return 0}t.mock=function(e){n=!1,i=e},t.loadCache=function(){if(!n){n=!0;var e=Math.floor(Date.now()/36e5)-168;for(var i in t.config)c(i)}function c(n){var i=r(n);if(i){var c=function(t){var n="iconify"+t,r=i.getItem(n);if("string"!=typeof r)return!1;var o=!0;try{var a=JSON.parse(r);if("object"!=typeof a||"number"!=typeof a.cached||a.cached<e||"object"!=typeof a.data||"string"!=typeof a.data.prefix)o=!1;else{var c=a.data.prefix,u=s.getStorage(c);o=s.addIconSet(u,a.data)}}catch(e){o=!1}return o||i.removeItem(n),o};try{var u=i.getItem("iconify-version");if("iconify1"!==u)return u&&function(e){try{for(var t=a(e),n=0;n<t;n++)e.removeItem("iconify"+n)}catch(e){}}(i),void function(e,t){try{e.setItem("iconify-version","iconify1")}catch(e){}o(e,t,0)}(i,n);for(var f=a(i),l=f-1;l>=0;l--)c(l)||(l===f-1?f--:t.emptyList[n].push(l));o(i,n,f)}catch(e){}}}},t.storeCache=function(e){function i(n){if(!t.config[n])return!1;var i=r(n);if(!i)return!1;var a=t.emptyList[n].shift();if(void 0===a&&!o(i,n,(a=t.count[n])+1))return!1;try{var c={cached:Math.floor(Date.now()/36e5),data:e};i.setItem("iconify"+a,JSON.stringify(c))}catch(e){return!1}return!0}n||t.loadCache(),i("local")||i("session")}}));e(J);var Q=J.config,V=(J.count,J.emptyList,J.mock,J.loadCache),Y=J.storeCache,G=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultConfig={resources:[],index:0,timeout:2e3,rotate:750,random:!1,limit:2}}));e(G);G.defaultConfig;var $=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sendQuery=function(e,t,n,i,r){void 0===r&&(r=null);var o=[];"function"==typeof r&&o.push(r);var a=Date.now(),c=0,u=0,f=t.resources.length-1,l=t.index?t.index:0;t.random&&t.resources.length>1&&(l=Math.floor(Math.random()*t.resources.length));var s=l=Math.min(l,f),d=[],v="pending",p=0;function h(e,t){void 0===t&&(t=!1),t&&(o=[]),"function"==typeof e&&o.push(e)}function g(){return{done:x,abort:k,subscribe:h,payload:n,startTime:a,loop:c,attempt:u,startIndex:l,index:s,maxIndex:f,status:v}}function m(){p&&clearTimeout(p),p=0}function b(e){e.abort&&"pending"===e.status&&(e.status="aborted",e.abort())}function y(){m(),d.forEach(b),d=[],null!==e&&e.cleanup()}function x(e){void 0===e&&(e=void 0),m(),"pending"===v&&(v="completed",y(),void 0!==e&&function(e){o.forEach((function(t){t(e,n,g)}))}(e))}function j(){if(f<1)return!0;var e=s+1;return e>f&&(e=0),e===l||e}function O(){var r=s,o=t.resources[r],a={getStatus:g,attempt:u+1,status:"pending",done:function(n){void 0===n&&(n=void 0),function(n,i,r){void 0===r&&(r=void 0),"pending"===n.status&&(n.status="completed",x(r),null===e||t.random||i===l||e.setIndex(i))}(a,r,n)},abort:null};d.length>Math.max(2*f,5)&&b(d.shift()),d.push(a),i(o,n,a)}function I(){if("pending"===v){var e,n=j();if("boolean"==typeof n){var i,r=c+1;if((i="function"==typeof t.limit?t.limit(r,a):t.limit)>0&&i<=r)return void m();e="function"==typeof t.timeout?t.timeout(r,l,a):t.timeout}else if("function"==typeof t.rotate){var o=n<l?f-l+n:n-l;e=t.rotate(o,c,n,a)}else e=t.rotate;"number"!=typeof e||e<1?m():p=setTimeout(M,e)}}function w(){"pending"===v&&(O(),setTimeout(I))}function M(){"boolean"==typeof(s=j())&&(c++,s=l),u++,w()}function k(){"pending"===v&&(v="aborted",y())}return setTimeout(w),g}}));e($);$.sendQuery;var B=t((function(e,t){function n(e){if(!("object"==typeof e&&"object"==typeof e.resources&&e.resources instanceof Array&&e.resources.length))throw new Error("Invalid Reduncancy configuration");var t,n=Object.create(null);for(t in G.defaultConfig)void 0!==e[t]?n[t]=e[t]:n[t]=G.defaultConfig[t];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.initRedundancy=function(e){var t=n(e),i=[],r={query:function(e,n,o){void 0===o&&(o=null);var a=$.sendQuery(r,t,e,n,o);return i.push(a),a},find:function(e){var t=i.find((function(t){return e(t)}));return void 0!==t?t:null},setIndex:function(e){t.index=e},getIndex:function(){return t.index},cleanup:function(){i=i.filter((function(e){return"pending"===e().status}))}};return r}}));e(B);B.initRedundancy;var H=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sortIcons=function(e){var t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((function(e,t){return e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix)}));var i={prefix:"",name:""};return e.forEach((function(e){if(i.prefix!==e.prefix||i.name!==e.name){i=e;var r=e.prefix,o=e.name;void 0===n[r]&&(n[r]=s.getStorage(r));var a=n[r],c={prefix:r,name:o};(void 0!==a.icons[o]?t.loaded:void 0!==a.missing[o]?t.missing:t.pending).push(c)}})),t}}));e(H);H.sortIcons;var K=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.callbacks=Object.create(null);var n=Object.create(null);function i(e,n){e.forEach((function(e){var i=t.callbacks[e];i&&(t.callbacks[e]=i.filter((function(e){return e.id!==n})))}))}t.updateCallbacks=function(e){n[e]||(n[e]=!0,setTimeout((function(){if(n[e]=!1,void 0!==t.callbacks[e]){var r=t.callbacks[e].slice(0);if(r.length){var o=s.getStorage(e),a=!1;r.forEach((function(t){var n=t.icons,r=n.pending.length;n.pending=n.pending.filter((function(t){if(t.prefix!==e)return!0;var i=t.name;if(void 0!==o.icons[i])n.loaded.push({prefix:e,name:i});else{if(void 0===o.missing[i])return a=!0,!0;n.missing.push({prefix:e,name:i})}return!1})),n.pending.length!==r&&(a||i([e],t.id),t.callback(n.loaded.slice(0),n.missing.slice(0),n.pending.slice(0),t.abort))}))}}})))};var r=0;t.storeCallback=function(e,n,o){var a=r++,c=i.bind(null,o,a);if(!n.pending.length)return c;var u={id:a,icons:n,callback:e,abort:c};return o.forEach((function(e){void 0===t.callbacks[e]&&(t.callbacks[e]=[]),t.callbacks[e].push(u)})),c}}));e(K);K.callbacks,K.updateCallbacks,K.storeCallback;var W=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={default:null,prefixes:Object.create(null)};t.setAPIModule=function(e,t){void 0!==t?("string"==typeof t?[t]:t).forEach((function(t){n.prefixes[t]=e})):n.default=e},t.getAPIModule=function(e){var t=n.prefixes[e];return void 0===t?n.default:t}}));e(W);var X=W.setAPIModule,Z=(W.getAPIModule,t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});for(var i=["https://api.simplesvg.com","https://api.unisvg.com"],r=[];i.length>0;)1===i.length||Math.random()>.5?r.push(i.shift()):r.push(i.pop());var o={default:{resources:["https://api.iconify.design"].concat(r),path:"/",maxURL:500,rotate:750,timeout:5e3,limit:2,random:!1,index:0},prefixes:Object.create(null)};t.setAPIConfig=function(e,t){var i=n.merge(o.default,e);void 0!==t?("string"==typeof t?[t]:t).forEach((function(e){o.prefixes[e]=i})):o.default=i},t.getAPIConfig=function(e){var t=o.prefixes[e];return void 0===t?o.default:t}})));e(Z);var ee=Z.setAPIConfig,te=Z.getAPIConfig,ne=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.listToIcons=function(e,t){void 0===t&&(t=!0);var n=[];return e.forEach((function(e){var i="string"==typeof e?r.stringToIcon(e):e;t&&!r.validateIcon(i)||n.push({prefix:i.prefix,name:i.name})})),n},t.getPrefixes=function(e){var t=Object.create(null);return e.forEach((function(e){t[e.prefix]=!0})),Object.keys(t)}}));e(ne);ne.listToIcons,ne.getPrefixes;var ie=t((function(e,t){function n(){}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.create(null),r=Object.create(null),o=Object.create(null),a=Object.create(null),c=Object.create(null);function u(e,t){function n(){console.error('Unable to retrieve icons for prefix "'+e+'" because API is not configured properly.')}void 0===r[e]?r[e]=t:r[e]=r[e].concat(t).sort(),a[e]||(a[e]=!0,setTimeout((function(){a[e]=!1;var t=r[e];delete r[e];var u=W.getAPIModule(e);if(u){if(void 0===c[e]){var f=Z.getAPIConfig(e);for(var l in c){var d=c[l];if(d.config===f){c[e]=d;break}}void 0===c[e]&&(c[e]={config:f,redundancy:f?B.initRedundancy(f):null})}var v=c[e].redundancy;if(v)u.prepare(e,t).forEach((function(t){v.query(t,u.send,(function(t){var n=s.getStorage(e);try{var r=s.addIconSet(n,t,"all");if("boolean"==typeof r)return;var a=i[e];r.forEach((function(e){delete a[e]})),I.coreModules.cache&&I.coreModules.cache(t)}catch(e){console.error(e)}!function(e){o[e]||(o[e]=!0,setTimeout((function(){o[e]=!1,K.updateCallbacks(e)})))}(e)}))}));else n()}else n()})))}t.API={isPending:function(e,t){return void 0!==i[e]&&void 0!==i[e][t]},loadIcons:function(e,t){var r=ne.listToIcons(e,!0),o=H.sortIcons(r);if(!o.pending.length){var a=!0;return t&&setTimeout((function(){a&&t(o.loaded,o.missing,o.pending,n)})),function(){a=!1}}var c=ne.getPrefixes(o.pending),f=Object.create(null);c.forEach((function(e){void 0===i[e]&&(i[e]=Object.create(null)),f[e]=[]}));var l=Date.now();return o.pending.forEach((function(e){var t=e.prefix,n=e.name,r=i[t];void 0===r[n]&&(r[n]=l,f[t].push(n))})),c.forEach((function(e){f[e].length&&u(e,f[e])})),t?K.storeCallback(t,o,c):n}}}));e(ie);var re=ie.API,oe=null,ae="{prefix}.js?icons={icons}&callback={callback}",ce=Object.create(null),ue=Object.create(null);function fe(){if(null===oe){var e=self,t="Iconify",n=".cb";if(void 0===e[t])n="",void 0===e[t="IconifyJSONP"]&&(e[t]=Object.create(null)),oe=e[t];else{var i=e[t];void 0===i.cb&&(i.cb=Object.create(null)),oe=i.cb}ae=ae.replace("{callback}",t+n+".{cb}")}return oe}var le=null,se=null,de={childList:!0,subtree:!0,attributes:!0},ve=0,pe=!1,he=!1;function ge(){he||(he=!0,setTimeout((function(){he=!1,pe=!1,se&&se(k())})))}function me(e){if(!pe)for(var t=0;t<e.length;t++){var n=e[t];if(n.addedNodes&&n.addedNodes.length>0||"attributes"===n.type&&void 0!==n.target[_])return pe=!0,void(ve||ge())}}function be(){le&&le.observe(k(),de)}function ye(){null===le&&(pe=!0,le=new MutationObserver(me),be(),ve||ge())}var xe={init:function(e){if(se=e,le&&!ve)return le.disconnect(),void be();setTimeout((function(){var e=document;"complete"===e.readyState||"loading"!==e.readyState&&!e.documentElement.doScroll?ye():(e.addEventListener("DOMContentLoaded",ye),window.addEventListener("load",ye))}))},pause:function(){++ve>1||null===le||(me(le.takeRecords()),le.disconnect())},resume:function(){ve&&!--ve&&le&&(be(),pe&&ge())},isPaused:function(){return ve>0}};var je=!1;function Oe(){je||(je=!0,setTimeout((function(){je&&(je=!1,Ie())})))}function Ie(e){je=!1;var t=!1,n=Object.create(null);if(e||(e=k()),A(e).forEach((function(e){var i,r,o=e.element,a=e.name,c=a.prefix,f=a.name,l=o[P];if(void 0!==l&&(i=l.name,r=a,null!==i&&null!==r&&i.name===r.name&&i.prefix===r.prefix))switch(l.status){case"missing":return;case"loading":if(w.api&&w.api.isPending(c,f))return}var s=d(c);if(void 0===s.icons[f]){if(s.missing[f])return l={name:a,status:"missing",customisations:{}},void(o[P]=l);w.api&&(w.api.isPending(c,f)||(void 0===n[c]&&(n[c]=Object.create(null)),n[c][f]=!0)),l={name:a,status:"loading",customisations:{}},o[P]=l}else{M.observer&&!t&&(M.observer.pause(),t=!0);var v=void 0!==e.customisations?e.customisations:e.finder.customisations(o);!function(e,t,n){var i=x(n,u(t)),r=e.element,o=r.getAttribute("class"),a=e.finder.classFilter(o?o.split(/\s+/):[]),c='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" class="'+("iconify iconify--"+e.name.prefix+(a.length?" "+a.join(" "):""))+'">'+O(i.body)+"</svg>",f=document.createElement("span");f.innerHTML=c;var l=f.childNodes[0],s=l.style,d=i.attributes;Object.keys(d).forEach((function(e){l.setAttribute(e,d[e])})),s.transform="rotate(360deg)",i.inline&&(s.verticalAlign="-0.125em");for(var v=r.attributes,p=0;p<v.length;p++){var h=v.item(p);if(h){var g=h.name;if("class"!==g&&"style"!==g&&void 0===d[g])try{l.setAttribute(g,h.value)}catch(e){}}}for(var m=r.style,b=0;b<m.length;b++){var y=m[b];s[y]=m[y]}var j={name:e.name,status:"loaded",customisations:t};l[P]=j,l[_]=e.finder,r.parentNode?r.parentNode.replaceChild(l,r):f.removeChild(l)}(e,v,g(s,f))}})),w.api){var i=w.api;Object.keys(n).forEach((function(e){i.loadIcons(Object.keys(n[e]).map((function(t){return{prefix:e,name:t}})),Oe)}))}M.observer&&t&&M.observer.resume()}function we(e){var t=o(e);return a(t)?t:null}function Me(e){var t=we(e);return t?g(d(t.prefix),t.name):null}var ke={getVersion:function(){return"2.0.0-dev"},iconExists:function(e){return void 0!==Me(e)},getIcon:function(e){var t=Me(e);return t?i(t):null},listIcons:function(e){var t=v(),n=!0;return"string"==typeof e&&(t=-1!==t.indexOf(e)?[]:[e],n=!1),t.forEach((function(e){var t=d(e),i=Object.keys(t.icons);n&&(i=i.map((function(t){return e+":"+t}))),i=i.concat(i)})),[]},renderIcon:function(e,t){var n=Me(e);if(!n)return null;var i=u(t);return x(n,i)},replaceIDs:O,calculateSize:b,addIcon:function(e,t){var n=we(e);if(!n)return!1;var i=d(n.prefix);return h(i,n.name,t)},addCollection:function(e){if("object"!=typeof e||"string"!=typeof e.prefix||!a({prefix:e.prefix,name:"a"}))return!1;var t=d(e.prefix);return!!p(t,e)},pauseObserver:xe.pause,resumeObserver:xe.resume,setAPIConfig:ee,scanDOM:Ie,setRoot:function(e){M.root=e,xe.init(Ie),setTimeout(Ie)},enableCache:function(e,t){switch(e){case"local":case"session":Q[e]=t;break;case"all":for(var n in Q)Q[n]=t}}};return function(e){-1===E.indexOf(e)&&E.push(e)}(U),w.cache=Y,V(),X({send:function(e,t,n){for(var i=t.prefix,r=t.icons.join(","),o=i.split("-").shift().slice(0,3),a=fe(),c=function(e){var t,n=0;for(t=e.length-1;t>=0;t--)n+=e.charCodeAt(t);return n%999}(e+":"+i+":"+r);void 0!==a[o+c];)c++;var u=o+c,f=ue[i]+ae.replace("{prefix}",i).replace("{icons}",r).replace("{cb}",u);a[u]=function(e){delete a[u],n.done(e)};var l=e+f,s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=l,document.head.appendChild(s)},prepare:function(e,t){var n=[],i=ce[e];void 0===i&&(i=function(e){var t,n=te(e);if(!n)return 0;if(n.maxURL){var i=0;n.resources.forEach((function(e){i=Math.max(i,e.length)})),fe();t=n.maxURL-i-n.path.length-ae.replace("{prefix}",e).replace("{icons}","").length-3}else t=0;return ue[e]=n.path,ce[e]=t,t}(e));var r={prefix:e,icons:[]},o=0;return t.forEach((function(t,a){(o+=t.length+1)>=i&&a>0&&(n.push(r),r={prefix:e,icons:[]},o=t.length),r.icons.push(t)})),n.push(r),n}}),w.api=re,M.observer=xe,setTimeout((function(){xe.init(Ie)})),ke}();try{void 0===self.Iconify&&(self.Iconify=Iconify)}catch(e){}if("object"==typeof exports)try{exports.__esModule=!0,exports.default=Iconify}catch(e){}
var Iconify=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.merge=function(e,t,n){for(var i=Object.create(null),r=[e,t,n],o=0;o<3;o++){var a=r[o];if("object"==typeof a&&a)for(var c in a)i[c]=a[c]}return i}}));e(n);var i=n.merge,r=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/^[a-z0-9]+(-[a-z0-9]+)*$/;t.stringToIcon=function(e){var t=e.split(":");if(t.length>2)return null;if(2===t.length)return{prefix:t[0],name:t[1]};var n=e.split("-");return n.length>1?{prefix:n.shift(),name:n.join("-")}:null},t.validateIcon=function(e){return!!e&&!(!e.prefix.match(n)||!e.name.match(n))}}));e(r);var o=r.stringToIcon,a=r.validateIcon,c=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0}),t.fullCustomisations=function(e){return n.merge(t.defaults,e)}}));e(c);c.defaults;var u=c.fullCustomisations,f=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.iconDefaults=Object.freeze({body:"",left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1}),t.fullIcon=function(e){return n.merge(t.iconDefaults,e)}}));e(f);f.iconDefaults,f.fullIcon;var l=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.keys(f.iconDefaults);t.mergeIcons=function(e,t){var i=Object.create(null);return n.forEach((function(n){if(void 0!==e[n])if(void 0!==t[n])switch(n){case"rotate":return void(i[n]=(e[n]+t[n])%4);case"hFlip":case"vFlip":return void(i[n]=e[n]!==t[n]);default:i[n]=t[n]}else i[n]=e[n];else void 0!==t[n]&&(i[n]=t[n])})),i}}));e(l);l.mergeIcons;var s=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=Object.keys(f.iconDefaults),r=Object.create(null);function o(e){return{prefix:e,icons:Object.create(null),missing:Object.create(null)}}t.newStorage=o,t.getStorage=function(e){return void 0===r[e]&&(r[e]=o(e)),r[e]},t.listStoredPrefixes=function(){return Object.keys(r)},t.addIconSet=function(e,t,r){void 0===r&&(r="none");var o=[];try{if("object"!=typeof t)return!1;if(t.not_found instanceof Array){var a=Date.now();t.not_found.forEach((function(t){e.missing[t]=a,"all"===r&&o.push(t)}))}if("object"!=typeof t.icons)return!1;var c=Object.create(null);i.forEach((function(e){void 0!==t[e]&&"object"!=typeof t[e]&&(c[e]=t[e])}));var u=t.icons;if(Object.keys(u).forEach((function(t){var i=u[t];if("string"!=typeof i.body)throw new Error("Invalid icon");e.icons[t]=Object.freeze(n.merge(f.iconDefaults,c,i)),"none"!==r&&o.push(t)})),"object"==typeof t.aliases){var s=t.aliases;Object.keys(s).forEach((function(t){var i=function e(t,n,i,r){void 0===r&&(r=0);var o=t.parent;if(void 0!==n[o])return l.mergeIcons(n[o],t);if(void 0!==i[o]){if(r>2)throw new Error("Invalid alias");var a=e(i[o],n,i,r+1);if(a)return l.mergeIcons(a,t)}return null}(s[t],u,s,1);i&&(e.icons[t]=Object.freeze(n.merge(f.iconDefaults,c,i)),"none"!==r&&o.push(t))}))}}catch(e){return!1}return"none"===r||o},t.addIcon=function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]=Object.freeze(f.fullIcon(n)),!0}catch(e){}return!1},t.iconExists=function(e,t){return void 0!==e.icons[t]},t.getIcon=function(e,t){var n=e.icons[t];return void 0===n?null:n}}));e(s);s.newStorage;var d=s.getStorage,v=s.listStoredPrefixes,p=s.addIconSet,h=s.addIcon,g=(s.iconExists,s.getIcon),m=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/(-?[0-9.]*[0-9]+[0-9.]*)/g,i=/^-?[0-9.]*[0-9]+[0-9.]*$/g;t.calcSize=function(e,t,r){if(1===t)return e;if(r=void 0===r?100:r,"number"==typeof e)return Math.ceil(e*t*r)/r;if("string"!=typeof e)return e;var o=e.split(n);if(null===o||!o.length)return e;for(var a=[],c=o.shift(),u=i.test(c);;){if(u){var f=parseFloat(c);isNaN(f)?a.push(c):a.push(Math.ceil(f*t*r)/r)}else a.push(c);if(void 0===(c=o.shift()))return a.join("");u=!u}}}));e(m);var b=m.calcSize,y=t((function(e,t){function n(e){var 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"}Object.defineProperty(t,"__esModule",{value:!0}),t.iconToSVG=function(e,t){var i,r,o,a={left:e.left,top:e.top,width:e.width,height:e.height},c=[],u=t.rotate;switch(t.hFlip?t.vFlip?u+=2:(c.push("translate("+(a.width+a.left)+" "+(0-a.top)+")"),c.push("scale(-1 1)"),a.top=a.left=0):t.vFlip&&(c.push("translate("+(0-a.left)+" "+(a.height+a.top)+")"),c.push("scale(1 -1)"),a.top=a.left=0),u%=4){case 1:i=a.height/2+a.top,c.unshift("rotate(90 "+i+" "+i+")");break;case 2:c.unshift("rotate(180 "+(a.width/2+a.left)+" "+(a.height/2+a.top)+")");break;case 3:i=a.width/2+a.left,c.unshift("rotate(-90 "+i+" "+i+")")}u%2==1&&(0===a.left&&0===a.top||(i=a.left,a.left=a.top,a.top=i),a.width!==a.height&&(i=a.width,a.width=a.height,a.height=i)),null===t.width&&null===t.height?(o="1em",r=m.calcSize(o,a.width/a.height)):null!==t.width&&null!==t.height?(r=t.width,o=t.height):null!==t.height?(o=t.height,r=m.calcSize(o,a.width/a.height)):(r=t.width,o=m.calcSize(r,a.height/a.width)),"auto"===r&&(r=a.width),"auto"===o&&(o=a.height),r="string"==typeof r?r:r+"",o="string"==typeof o?o:o+"";var f=e.body;c.length&&(f='<g transform="'+c.join(" ")+'">'+f+"</g>");var l={attributes:{width:r,height:o,preserveAspectRatio:n(t),viewBox:a.left+" "+a.top+" "+a.width+" "+a.height},body:f};return t.inline&&(l.inline=!0),l}}));e(y);var x=y.iconToSVG,j=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/\sid="(\S+)"/g,i="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",r=0;function o(e,t,n){for(var i=0;-1!==(i=n.indexOf(e,i));)n=n.slice(0,i)+t+n.slice(i+e.length),i+=t.length;return n}t.replaceIDs=function(e,t){void 0===t&&(t=i);for(var a,c=[];a=n.exec(e);)c.push(a[1]);return c.length?(c.forEach((function(n){var i="function"==typeof t?t():t+r++;e=o('="'+n+'"','="'+i+'"',e),e=o('="#'+n+'"','="#'+i+'"',e),e=o("(#"+n+")","(#"+i+")",e)})),e):e}}));e(j);var I=j.replaceIDs,O=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.coreModules={}}));e(O);var w=O.coreModules,M={};function k(){return M.root?M.root:document.querySelector("body")}var _="iconifyFinder"+Date.now(),P="iconifyData"+Date.now(),E=[];function S(e){return"string"==typeof e&&(e=o(e)),null!==e&&a(e)?e:null}function A(e){var t=[];E.forEach((function(n){var i=n.find(e);Array.prototype.forEach.call(i,(function(e){var i=e;if(void 0===i[_]||i[_]===n){var r=S(n.name(i));if(null!==r){i[_]=n;var o={element:i,finder:n,name:r};t.push(o)}}}))}));var n=e.querySelectorAll("svg.iconify");return Array.prototype.forEach.call(n,(function(e){var n=e,i=n[_],r=n[P];if(i&&r){var o=S(i.name(n));if(null!==o){var a,c=!1;if(o.prefix!==r.name.prefix||o.name!==r.name.name?c=!0:(a=i.customisations(n),function(e,t){var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++){var o=n[r];if(t[o]!==e[o])return!1}return!0}(r.customisations,a)||(c=!0)),c){var u={element:n,finder:i,name:o,customisations:a};t.push(u)}}}})),t}var C=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rotateFromString=function(e){var t=e.replace(/^-?[0-9.]*/,"");function n(e){for(;e<0;)e+=4;return e%4}if(""===t){var i=parseInt(e);return isNaN(i)?0:n(i)}if(t!==e){var r=0;switch(t){case"%":r=25;break;case"deg":r=90}if(r){var o=parseFloat(e.slice(0,e.length-t.length));return isNaN(o)?0:(o/=r)%1==0?n(o):0}}return 0}}));e(C);var T=C.rotateFromString,F=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=/[\s,]+/;t.flipFromString=function(e,t){t.split(n).forEach((function(t){switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}}))},t.alignmentFromString=function(e,t){t.split(n).forEach((function(t){var n=t.trim();switch(n){case"left":case"center":case"right":e.hAlign=n;break;case"top":case"middle":case"bottom":e.vAlign=n;break;case"slice":e.slice=!0;break;case"meet":e.slice=!1}}))}}));e(F);var D=F.flipFromString,z=F.alignmentFromString;function L(e,t){return e.hasAttribute(t)}function N(e,t){return e.getAttribute(t)}var R=["inline","hFlip","vFlip"],q=["width","height"],U={find:function(e){return e.querySelectorAll("i.iconify, span.iconify, i.iconify-inline, span.iconify-inline")},name:function(e){return L(e,"data-icon")?N(e,"data-icon"):null},customisations:function(e,t){void 0===t&&(t={inline:!1});var n=t,i=e.getAttribute("class");if(-1!==(i?i.split(/\s+/):[]).indexOf("iconify-inline")&&(n.inline=!0),L(e,"data-rotate")){var r=T(N(e,"data-rotate"));r&&(n.rotate=r)}return L(e,"data-flip")&&D(n,N(e,"data-flip")),L(e,"data-align")&&z(n,N(e,"data-align")),R.forEach((function(t){if(L(e,"data-"+t)){var i=function(e,t){var n=e.getAttribute(t);return n===t||"true"===n||""!==n&&"false"!==n&&null}(e,"data-"+t);"boolean"==typeof i&&(n[t]=i)}})),q.forEach((function(t){if(L(e,"data-"+t)){var i=N(e,"data-"+t);""!==i&&(n[t]=i)}})),n},classFilter:function(e){var t=[];return e.forEach((function(e){"iconify"!==e&&""!==e&&"iconify--"!==e.slice(0,9)&&t.push(e)})),t}},V=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.config={local:!0,session:!0};var n=!1;t.count={local:0,session:0},t.emptyList={local:[],session:[]};var i="undefined"==typeof window?{}:window;function r(e){var n=e+"Storage";try{if(i&&i[n]&&"number"==typeof i[n].length)return i[n]}catch(e){}return t.config[e]=!1,null}function o(e,n,i){try{return e.setItem("iconify-count",i+""),t.count[n]=i,!0}catch(e){return!1}}function a(e){var t=e.getItem("iconify-count");if(t){var n=parseInt(t);return n||0}return 0}t.mock=function(e){n=!1,i=e},t.loadCache=function(){if(!n){n=!0;var e=Math.floor(Date.now()/36e5)-168;for(var i in t.config)c(i)}function c(n){var i=r(n);if(i){var c=function(t){var n="iconify"+t,r=i.getItem(n);if("string"!=typeof r)return!1;var o=!0;try{var a=JSON.parse(r);if("object"!=typeof a||"number"!=typeof a.cached||a.cached<e||"object"!=typeof a.data||"string"!=typeof a.data.prefix)o=!1;else{var c=a.data.prefix,u=s.getStorage(c);o=s.addIconSet(u,a.data)}}catch(e){o=!1}return o||i.removeItem(n),o};try{var u=i.getItem("iconify-version");if("iconify1"!==u)return u&&function(e){try{for(var t=a(e),n=0;n<t;n++)e.removeItem("iconify"+n)}catch(e){}}(i),void function(e,t){try{e.setItem("iconify-version","iconify1")}catch(e){}o(e,t,0)}(i,n);for(var f=a(i),l=f-1;l>=0;l--)c(l)||(l===f-1?f--:t.emptyList[n].push(l));o(i,n,f)}catch(e){}}}},t.storeCache=function(e){function i(n){if(!t.config[n])return!1;var i=r(n);if(!i)return!1;var a=t.emptyList[n].shift();if(void 0===a&&!o(i,n,(a=t.count[n])+1))return!1;try{var c={cached:Math.floor(Date.now()/36e5),data:e};i.setItem("iconify"+a,JSON.stringify(c))}catch(e){return!1}return!0}n||t.loadCache(),i("local")||i("session")}}));e(V);var G=V.config,H=(V.count,V.emptyList,V.mock,V.loadCache),J=V.storeCache,Q=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultConfig={resources:[],index:0,timeout:2e3,rotate:750,random:!1,limit:2}}));e(Q);Q.defaultConfig;var Y=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sendQuery=function(e,t,n,i,r){void 0===r&&(r=null);var o=[];"function"==typeof r&&o.push(r);var a=Date.now(),c=0,u=0,f=t.resources.length-1,l=t.index?t.index:0;t.random&&t.resources.length>1&&(l=Math.floor(Math.random()*t.resources.length));var s=l=Math.min(l,f),d=[],v="pending",p=0;function h(e,t){void 0===t&&(t=!1),t&&(o=[]),"function"==typeof e&&o.push(e)}function g(){return{done:x,abort:k,subscribe:h,payload:n,startTime:a,loop:c,attempt:u,startIndex:l,index:s,maxIndex:f,status:v}}function m(){p&&clearTimeout(p),p=0}function b(e){e.abort&&"pending"===e.status&&(e.status="aborted",e.abort())}function y(){m(),d.forEach(b),d=[],null!==e&&e.cleanup()}function x(e){void 0===e&&(e=void 0),m(),"pending"===v&&(v="completed",y(),void 0!==e&&function(e){o.forEach((function(t){t(e,n,g)}))}(e))}function j(){if(f<1)return!0;var e=s+1;return e>f&&(e=0),e===l||e}function I(){var r=s,o=t.resources[r],a={getStatus:g,attempt:u+1,status:"pending",done:function(n){void 0===n&&(n=void 0),function(n,i,r){void 0===r&&(r=void 0),"pending"===n.status&&(n.status="completed",x(r),null===e||t.random||i===l||e.setIndex(i))}(a,r,n)},abort:null};d.length>Math.max(2*f,5)&&b(d.shift()),d.push(a),i(o,n,a)}function O(){if("pending"===v){var e,n=j();if("boolean"==typeof n){var i,r=c+1;if((i="function"==typeof t.limit?t.limit(r,a):t.limit)>0&&i<=r)return void m();e="function"==typeof t.timeout?t.timeout(r,l,a):t.timeout}else if("function"==typeof t.rotate){var o=n<l?f-l+n:n-l;e=t.rotate(o,c,n,a)}else e=t.rotate;"number"!=typeof e||e<1?m():p=setTimeout(M,e)}}function w(){"pending"===v&&(I(),setTimeout(O))}function M(){"boolean"==typeof(s=j())&&(c++,s=l),u++,w()}function k(){"pending"===v&&(v="aborted",y())}return setTimeout(w),g}}));e(Y);Y.sendQuery;var $=t((function(e,t){function n(e){if(!("object"==typeof e&&"object"==typeof e.resources&&e.resources instanceof Array&&e.resources.length))throw new Error("Invalid Reduncancy configuration");var t,n=Object.create(null);for(t in Q.defaultConfig)void 0!==e[t]?n[t]=e[t]:n[t]=Q.defaultConfig[t];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.initRedundancy=function(e){var t=n(e),i=[],r={query:function(e,n,o){void 0===o&&(o=null);var a=Y.sendQuery(r,t,e,n,o);return i.push(a),a},find:function(e){var t=i.find((function(t){return e(t)}));return void 0!==t?t:null},setIndex:function(e){t.index=e},getIndex:function(){return t.index},cleanup:function(){i=i.filter((function(e){return"pending"===e().status}))}};return r}}));e($);$.initRedundancy;var B=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sortIcons=function(e){var t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((function(e,t){return e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix)}));var i={prefix:"",name:""};return e.forEach((function(e){if(i.prefix!==e.prefix||i.name!==e.name){i=e;var r=e.prefix,o=e.name;void 0===n[r]&&(n[r]=s.getStorage(r));var a=n[r],c={prefix:r,name:o};(void 0!==a.icons[o]?t.loaded:void 0!==a.missing[o]?t.missing:t.pending).push(c)}})),t}}));e(B);B.sortIcons;var K=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.callbacks=Object.create(null);var n=Object.create(null);function i(e,n){e.forEach((function(e){var i=t.callbacks[e];i&&(t.callbacks[e]=i.filter((function(e){return e.id!==n})))}))}t.updateCallbacks=function(e){n[e]||(n[e]=!0,setTimeout((function(){if(n[e]=!1,void 0!==t.callbacks[e]){var r=t.callbacks[e].slice(0);if(r.length){var o=s.getStorage(e),a=!1;r.forEach((function(t){var n=t.icons,r=n.pending.length;n.pending=n.pending.filter((function(t){if(t.prefix!==e)return!0;var i=t.name;if(void 0!==o.icons[i])n.loaded.push({prefix:e,name:i});else{if(void 0===o.missing[i])return a=!0,!0;n.missing.push({prefix:e,name:i})}return!1})),n.pending.length!==r&&(a||i([e],t.id),t.callback(n.loaded.slice(0),n.missing.slice(0),n.pending.slice(0),t.abort))}))}}})))};var r=0;t.storeCallback=function(e,n,o){var a=r++,c=i.bind(null,o,a);if(!n.pending.length)return c;var u={id:a,icons:n,callback:e,abort:c};return o.forEach((function(e){void 0===t.callbacks[e]&&(t.callbacks[e]=[]),t.callbacks[e].push(u)})),c}}));e(K);K.callbacks,K.updateCallbacks,K.storeCallback;var W=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={default:null,prefixes:Object.create(null)};t.setAPIModule=function(e,t){void 0!==t?("string"==typeof t?[t]:t).forEach((function(t){n.prefixes[t]=e})):n.default=e},t.getAPIModule=function(e){var t=n.prefixes[e];return void 0===t?n.default:t}}));e(W);var X=W.setAPIModule,Z=(W.getAPIModule,t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});for(var i=["https://api.simplesvg.com","https://api.unisvg.com"],r=[];i.length>0;)1===i.length||Math.random()>.5?r.push(i.shift()):r.push(i.pop());var o={default:{resources:["https://api.iconify.design"].concat(r),path:"/",maxURL:500,rotate:750,timeout:5e3,limit:2,random:!1,index:0},prefixes:Object.create(null)};t.setAPIConfig=function(e,t){var i=n.merge(o.default,e);void 0!==t?("string"==typeof t?[t]:t).forEach((function(e){o.prefixes[e]=i})):o.default=i},t.getAPIConfig=function(e){var t=o.prefixes[e];return void 0===t?o.default:t}})));e(Z);var ee=Z.setAPIConfig,te=Z.getAPIConfig,ne=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.listToIcons=function(e,t){void 0===t&&(t=!0);var n=[];return e.forEach((function(e){var i="string"==typeof e?r.stringToIcon(e):e;t&&!r.validateIcon(i)||n.push({prefix:i.prefix,name:i.name})})),n},t.getPrefixes=function(e){var t=Object.create(null);return e.forEach((function(e){t[e.prefix]=!0})),Object.keys(t)}}));e(ne);ne.listToIcons,ne.getPrefixes;var ie=t((function(e,t){function n(){}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.create(null),r=Object.create(null),o=Object.create(null),a=Object.create(null),c=Object.create(null);function u(e,t){function n(){console.error('Unable to retrieve icons for prefix "'+e+'" because API is not configured properly.')}void 0===r[e]?r[e]=t:r[e]=r[e].concat(t).sort(),a[e]||(a[e]=!0,setTimeout((function(){a[e]=!1;var t=r[e];delete r[e];var u=W.getAPIModule(e);if(u){if(void 0===c[e]){var f=Z.getAPIConfig(e);for(var l in c){var d=c[l];if(d.config===f){c[e]=d;break}}void 0===c[e]&&(c[e]={config:f,redundancy:f?$.initRedundancy(f):null})}var v=c[e].redundancy;if(v)u.prepare(e,t).forEach((function(t){v.query(t,u.send,(function(t){var n=s.getStorage(e);try{var r=s.addIconSet(n,t,"all");if("boolean"==typeof r)return;var a=i[e];r.forEach((function(e){delete a[e]})),O.coreModules.cache&&O.coreModules.cache(t)}catch(e){console.error(e)}!function(e){o[e]||(o[e]=!0,setTimeout((function(){o[e]=!1,K.updateCallbacks(e)})))}(e)}))}));else n()}else n()})))}t.API={isPending:function(e,t){return void 0!==i[e]&&void 0!==i[e][t]},loadIcons:function(e,t){var r=ne.listToIcons(e,!0),o=B.sortIcons(r);if(!o.pending.length){var a=!0;return t&&setTimeout((function(){a&&t(o.loaded,o.missing,o.pending,n)})),function(){a=!1}}var c=ne.getPrefixes(o.pending),f=Object.create(null);c.forEach((function(e){void 0===i[e]&&(i[e]=Object.create(null)),f[e]=[]}));var l=Date.now();return o.pending.forEach((function(e){var t=e.prefix,n=e.name,r=i[t];void 0===r[n]&&(r[n]=l,f[t].push(n))})),c.forEach((function(e){f[e].length&&u(e,f[e])})),t?K.storeCallback(t,o,c):n}}}));e(ie);var re=ie.API,oe=null,ae="{prefix}.js?icons={icons}&callback={callback}",ce=Object.create(null),ue=Object.create(null);function fe(){if(null===oe){var e=self,t="Iconify",n=".cb";if(void 0===e[t])n="",void 0===e[t="IconifyJSONP"]&&(e[t]=Object.create(null)),oe=e[t];else{var i=e[t];void 0===i.cb&&(i.cb=Object.create(null)),oe=i.cb}ae=ae.replace("{callback}",t+n+".{cb}")}return oe}var le=null,se=null,de={childList:!0,subtree:!0,attributes:!0},ve=0,pe=!1,he=!1;function ge(){he||(he=!0,setTimeout((function(){he=!1,pe=!1,se&&se(k())})))}function me(e){if(!pe)for(var t=0;t<e.length;t++){var n=e[t];if(n.addedNodes&&n.addedNodes.length>0||"attributes"===n.type&&void 0!==n.target[_])return pe=!0,void(ve||ge())}}function be(){le&&le.observe(k(),de)}function ye(){null===le&&(pe=!0,le=new MutationObserver(me),be(),ve||ge())}var xe={init:function(e){if(se=e,le&&!ve)return le.disconnect(),void be();setTimeout((function(){var e=document;"complete"===e.readyState||"loading"!==e.readyState&&!e.documentElement.doScroll?ye():(e.addEventListener("DOMContentLoaded",ye),window.addEventListener("load",ye))}))},pause:function(){++ve>1||null===le||(me(le.takeRecords()),le.disconnect())},resume:function(){ve&&!--ve&&le&&(be(),pe&&ge())},isPaused:function(){return ve>0}};function je(e,t,n,i){var r=x(n,u(t)),o=e.element,a=e.finder,c=e.name,f=o?o.getAttribute("class"):"",l=a?a.classFilter(f?f.split(/\s+/):[]):[],s='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" class="'+("iconify iconify--"+c.prefix+(l.length?" "+l.join(" "):""))+'">'+I(r.body)+"</svg>",d=document.createElement("span");d.innerHTML=s;var v=d.childNodes[0],p=v.style,h=r.attributes;if(Object.keys(h).forEach((function(e){v.setAttribute(e,h[e])})),p.transform="rotate(360deg)",r.inline&&(p.verticalAlign="-0.125em"),o){for(var g=o.attributes,m=0;m<g.length;m++){var b=g.item(m);if(b){var y=b.name;if("class"!==y&&"style"!==y&&void 0===h[y])try{v.setAttribute(y,b.value)}catch(e){}}}for(var j=o.style,O=0;O<j.length;O++){var w=j[O];p[w]=j[w]}}if(a){var M={name:c,status:"loaded",customisations:t};v[P]=M,v[_]=a}var k=i?d.innerHTML:v;return o&&o.parentNode?o.parentNode.replaceChild(v,o):d.removeChild(v),k}var Ie=!1;function Oe(){Ie||(Ie=!0,setTimeout((function(){Ie&&(Ie=!1,we())})))}function we(e){Ie=!1;var t=!1,n=Object.create(null);if(e||(e=k()),A(e).forEach((function(e){var i,r,o=e.element,a=e.name,c=a.prefix,u=a.name,f=o[P];if(void 0!==f&&(i=f.name,r=a,null!==i&&null!==r&&i.name===r.name&&i.prefix===r.prefix))switch(f.status){case"missing":return;case"loading":if(w.api&&w.api.isPending(c,u))return}var l=d(c);if(void 0===l.icons[u]){if(l.missing[u])return f={name:a,status:"missing",customisations:{}},void(o[P]=f);w.api&&(w.api.isPending(c,u)||(void 0===n[c]&&(n[c]=Object.create(null)),n[c][u]=!0)),f={name:a,status:"loading",customisations:{}},o[P]=f}else{M.observer&&!t&&(M.observer.pause(),t=!0);var s=void 0!==e.customisations?e.customisations:e.finder.customisations(o);je(e,s,g(l,u))}})),w.api){var i=w.api;Object.keys(n).forEach((function(e){i.loadIcons(Object.keys(n[e]).map((function(t){return{prefix:e,name:t}})),Oe)}))}M.observer&&t&&M.observer.resume()}function Me(e){var t=o(e);return a(t)?t:null}function ke(e){var t=Me(e);return t?g(d(t.prefix),t.name):null}function _e(e,t,n){var i=ke(e);return i?je({name:o(e)},u(t),i,n):null}var Pe={getVersion:function(){return"2.0.0-beta.1"},iconExists:function(e){return null!==ke(e)},getIcon:function(e){var t=ke(e);return t?i(t):null},listIcons:function(e){var t=v(),n=!0;return"string"==typeof e&&(t=-1!==t.indexOf(e)?[]:[e],n=!1),t.forEach((function(e){var t=d(e),i=Object.keys(t.icons);n&&(i=i.map((function(t){return e+":"+t}))),i=i.concat(i)})),[]},loadIcons:re.loadIcons,renderSVG:function(e,t){return _e(e,t,!1)},renderHTML:function(e,t){return _e(e,t,!0)},renderIcon:function(e,t){var n=ke(e);if(!n)return null;var i=u(t);return x(n,i)},replaceIDs:I,calculateSize:b,addIcon:function(e,t){var n=Me(e);if(!n)return!1;var i=d(n.prefix);return h(i,n.name,t)},addCollection:function(e){if("object"!=typeof e||"string"!=typeof e.prefix||!a({prefix:e.prefix,name:"a"}))return!1;var t=d(e.prefix);return!!p(t,e)},pauseObserver:xe.pause,resumeObserver:xe.resume,setAPIConfig:ee,scanDOM:we,setRoot:function(e){M.root=e,xe.init(we),setTimeout(we)},enableCache:function(e,t){switch(e){case"local":case"session":G[e]=t;break;case"all":for(var n in G)G[n]=t}}};return function(e){-1===E.indexOf(e)&&E.push(e)}(U),w.cache=J,H(),X({send:function(e,t,n){for(var i=t.prefix,r=t.icons.join(","),o=i.split("-").shift().slice(0,3),a=fe(),c=function(e){var t,n=0;for(t=e.length-1;t>=0;t--)n+=e.charCodeAt(t);return n%999}(e+":"+i+":"+r);void 0!==a[o+c];)c++;var u=o+c,f=ue[i]+ae.replace("{prefix}",i).replace("{icons}",r).replace("{cb}",u);a[u]=function(e){delete a[u],n.done(e)};var l=e+f,s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=l,document.head.appendChild(s)},prepare:function(e,t){var n=[],i=ce[e];void 0===i&&(i=function(e){var t,n=te(e);if(!n)return 0;if(n.maxURL){var i=0;n.resources.forEach((function(e){i=Math.max(i,e.length)})),fe();t=n.maxURL-i-n.path.length-ae.replace("{prefix}",e).replace("{icons}","").length-3}else t=0;return ue[e]=n.path,ce[e]=t,t}(e));var r={prefix:e,icons:[]},o=0;return t.forEach((function(t,a){(o+=t.length+1)>=i&&a>0&&(n.push(r),r={prefix:e,icons:[]},o=t.length),r.icons.push(t)})),n.push(r),n}}),w.api=re,M.observer=xe,setTimeout((function(){xe.init(we)})),Pe}();try{void 0===self.Iconify&&(self.Iconify=Iconify)}catch(e){}if("object"==typeof exports)try{exports.__esModule=!0,exports.default=Iconify}catch(e){}

@@ -13,5 +13,5 @@ import { IconifyElement } from './element';

export interface PlaceholderElement {
element: IconifyElement;
finder: IconifyFinder;
name: IconifyIconName;
element?: IconifyElement;
finder?: IconifyFinder;
customisations?: IconifyIconCustomisations;

@@ -18,0 +18,0 @@ }

@@ -46,5 +46,5 @@ import { elementFinderProperty, elementDataProperty, } from './element';

const results = [];
finders.forEach(finder => {
finders.forEach((finder) => {
const elements = finder.find(root);
Array.prototype.forEach.call(elements, item => {
Array.prototype.forEach.call(elements, (item) => {
const element = item;

@@ -74,3 +74,3 @@ if (element[elementFinderProperty] !== void 0 &&

const elements = root.querySelectorAll('svg.iconify');
Array.prototype.forEach.call(elements, item => {
Array.prototype.forEach.call(elements, (item) => {
const element = item;

@@ -77,0 +77,0 @@ const finder = element[elementFinderProperty];

import { IconifyJSON } from '@iconify/types';
import { IconifyIconName } from '@iconify/core/lib/icon/name';
import { IconifyIcon } from '@iconify/core/lib/icon';

@@ -6,2 +7,3 @@ import { IconifyIconCustomisations, IconifyIconSize, IconifyHorizontalIconAlignment, IconifyVerticalIconAlignment } from '@iconify/core/lib/customisations';

import { IconifyAPIConfig } from '@iconify/core/lib/api/config';
import { IconifyIconLoaderCallback, IconifyIconLoaderAbort } from '@iconify/core/lib/interfaces/loader';
/**

@@ -13,3 +15,3 @@ * Export required types

export { IconifyIconBuildResult };
export { IconifyAPIConfig };
export { IconifyAPIConfig, IconifyIconLoaderCallback, IconifyIconLoaderAbort };
/**

@@ -40,2 +42,8 @@ * Cache types

/**
* Load icons
*/
loadIcons: (icons: (IconifyIconName | string)[], callback?: IconifyIconLoaderCallback) => IconifyIconLoaderAbort;
renderSVG: (name: string, customisations: IconifyIconCustomisations) => SVGElement | null;
renderHTML: (name: string, customisations: IconifyIconCustomisations) => string | null;
/**
* Get icon data

@@ -45,3 +53,3 @@ */

/**
* Replace IDs in icon body, should be used when parsing renderIcon() result
* Replace IDs in icon body, should be used when parsing buildIcon() result
*/

@@ -48,0 +56,0 @@ replaceIDs: (body: string) => string;

@@ -24,2 +24,4 @@ import { merge } from '@iconify/core/lib/misc/merge';

import { observer } from './modules/observer';
// Render
import { renderIcon } from './render';
// Scan

@@ -47,3 +49,3 @@ import { scanDOM } from './scan';

*/
function getSVG(name, customisations) {
function buildIcon(name, customisations) {
// Get icon data

@@ -60,2 +62,20 @@ const iconData = getIconData(name);

/**
* Generate icon
*/
function generateIcon(name, customisations, returnString) {
// Get icon data
const iconData = getIconData(name);
if (!iconData) {
return null;
}
// Split name
const iconName = stringToIcon(name);
// Clean up customisations
const changes = fullCustomisations(customisations);
// Get data
return renderIcon({
name: iconName,
}, changes, iconData, returnString);
}
/**
* Global variable

@@ -67,3 +87,3 @@ */

// Check if icon exists
iconExists: (name) => getIconData(name) !== void 0,
iconExists: (name) => getIconData(name) !== null,
// Get raw icon data

@@ -93,4 +113,13 @@ getIcon: (name) => {

},
// Render icon
renderIcon: getSVG,
// Load icons
loadIcons: API.loadIcons,
// Render SVG
renderSVG: (name, customisations) => {
return generateIcon(name, customisations, false);
},
renderHTML: (name, customisations) => {
return generateIcon(name, customisations, true);
},
// Get rendered icon as object that can be used to create SVG (use replaceIDs on body)
renderIcon: buildIcon,
// Replace IDs in body

@@ -97,0 +126,0 @@ replaceIDs: replaceIDs,

@@ -8,2 +8,2 @@ import { PlaceholderElement } from './finder';

*/
export declare function renderIcon(placeholder: PlaceholderElement, customisations: IconifyIconCustomisations, iconData: FullIconifyIcon): IconifyElement | null;
export declare function renderIcon(placeholder: PlaceholderElement, customisations: IconifyIconCustomisations, iconData: FullIconifyIcon, returnString?: boolean): IconifyElement | string | null;

@@ -8,10 +8,17 @@ import { fullCustomisations, } from '@iconify/core/lib/customisations';

*/
export function renderIcon(placeholder, customisations, iconData) {
export function renderIcon(placeholder, customisations, iconData, returnString) {
const data = iconToSVG(iconData, fullCustomisations(customisations));
// Placeholder properties
const placeholderElement = placeholder.element;
const finder = placeholder.finder;
const name = placeholder.name;
// Get class name
const placeholderElement = placeholder.element;
const placeholderClassName = placeholderElement.getAttribute('class');
const filteredClassList = placeholder.finder.classFilter(placeholderClassName ? placeholderClassName.split(/\s+/) : []);
const placeholderClassName = placeholderElement
? placeholderElement.getAttribute('class')
: '';
const filteredClassList = finder
? finder.classFilter(placeholderClassName ? placeholderClassName.split(/\s+/) : [])
: [];
const className = 'iconify iconify--' +
placeholder.name.prefix +
name.prefix +
(filteredClassList.length ? ' ' + filteredClassList.join(' ') : '');

@@ -40,34 +47,41 @@ // Generate SVG as string

}
// Copy attributes from placeholder
const placeholderAttributes = placeholderElement.attributes;
for (let i = 0; i < placeholderAttributes.length; i++) {
const item = placeholderAttributes.item(i);
if (item) {
const name = item.name;
if (name !== 'class' &&
name !== 'style' &&
svgAttributes[name] === void 0) {
try {
svg.setAttribute(name, item.value);
// Copy stuff from placeholder
if (placeholderElement) {
// Copy attributes
const placeholderAttributes = placeholderElement.attributes;
for (let i = 0; i < placeholderAttributes.length; i++) {
const item = placeholderAttributes.item(i);
if (item) {
const name = item.name;
if (name !== 'class' &&
name !== 'style' &&
svgAttributes[name] === void 0) {
try {
svg.setAttribute(name, item.value);
}
catch (err) { }
}
catch (err) { }
}
}
// Copy styles
const placeholderStyle = placeholderElement.style;
for (let i = 0; i < placeholderStyle.length; i++) {
const attr = placeholderStyle[i];
svgStyle[attr] = placeholderStyle[attr];
}
}
// Copy styles from placeholder
const placeholderStyle = placeholderElement.style;
for (let i = 0; i < placeholderStyle.length; i++) {
const attr = placeholderStyle[i];
svgStyle[attr] = placeholderStyle[attr];
// Store finder specific data
if (finder) {
const elementData = {
name: name,
status: 'loaded',
customisations: customisations,
};
svg[elementDataProperty] = elementData;
svg[elementFinderProperty] = finder;
}
// Store data
const elementData = {
name: placeholder.name,
status: 'loaded',
customisations: customisations,
};
svg[elementDataProperty] = elementData;
svg[elementFinderProperty] = placeholder.finder;
// Get result
const result = returnString ? span.innerHTML : svg;
// Replace placeholder
if (placeholderElement.parentNode) {
if (placeholderElement && placeholderElement.parentNode) {
placeholderElement.parentNode.replaceChild(svg, placeholderElement);

@@ -80,3 +94,3 @@ }

// Return new node
return svg;
return result;
}

@@ -5,3 +5,3 @@ {

"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "2.0.0-beta.0",
"version": "2.0.0-beta.1",
"license": "(Apache-2.0 OR GPL-2.0)",

@@ -8,0 +8,0 @@ "main": "./dist/iconify.min.js",

@@ -24,3 +24,3 @@ # What is Iconify?

```html
<script src="https://code.iconify.design/2/2.0.0-dev/iconify.min.js"></script>
<script src="https://code.iconify.design/2/2.0.0-beta1/iconify.min.js"></script>
```

@@ -27,0 +27,0 @@

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

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