UNPKG

ionicons

Version:

Premium icons for Ionic.

1 lines 16.2 kB
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="http://www.w3.org/1999/xlink",c="undefined"!=typeof window?window:{},u=c.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},a=(()=>{try{return!!c.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),d=!!a&&(()=>!!c.document&&Object.getOwnPropertyDescriptor(c.document.adoptedStyleSheets,"length").writable)(),p=!1,h=[],m=[],y=(t,e)=>n=>{t.push(n),p||(p=!0,e&&4&f.i?v(b):f.raf(b))},$=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},b=()=>{$(h),$(m),(p=h.length>0)&&f.raf(b)},v=t=>Promise.resolve(void 0).then(t),w=y(m,!0),g=t=>{const e=new URL(t,f.u);return e.origin!==c.location.origin?e.href:e.pathname},j=t=>f.u=t;function O(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(d?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var S,M=new WeakMap,k=t=>"sc-"+t.p,E=t=>"object"==(t=typeof t)||"function"===t,A=(t,e,...n)=>{let o=null,l=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof t&&!E(o))&&(o+=""),s&&i?r[r.length-1].h+=o:r.push(s?C(null,o):o),i=s)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.m=e,r.length>0&&(u.$=r),u.v=l,u},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,$:null,m:null,v:null}),x={},W=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},L=(t,e)=>null==t||E(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t,_=(t,e,n,s,i,u)=>{if(n===s)return;let a=l(t,e),d=e.toLowerCase();if("class"===e){const e=t.classList,o=H(n);let l=H(s);e.remove(...o.filter((t=>t&&!l.includes(t)))),e.add(...l.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&J(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let l;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(l=t[1])}}return l||(l=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const o=E(s);if((a||o&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const o=null==s?"":s;"list"===e?a=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}let l=!1;d!==(d=d.replace(/^xlink\:?/,""))&&(e=d,l=!0),null==s||!1===s?!1===s&&""!==t.getAttribute(e)||(l?t.removeAttributeNS(r,e):t.removeAttribute(e)):(!a||4&u||i)&&!o&&1===t.nodeType&&(s=!0===s?"":s,l?t.setAttributeNS(r,e,s):t.setAttribute(e,s))}}else if(e="-"===e[2]?e.slice(3):l(c,d)?d.slice(2):d[2]+e.slice(3),n||s){const o=e.endsWith(P);e=e.replace(R,""),n&&f.rel(t,e,n,o),s&&f.ael(t,e,s,o)}},D=/\s/,H=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(D):[]),P="Capture",R=RegExp(P+"$"),U=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.m||{},s=e.m||{};for(const t of z(Object.keys(l)))t in s||_(o,t,l[t],void 0,n,e.i);for(const t of z(Object.keys(s)))_(o,t,l[t],s[t],n,e.i)};function z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var N=!1,V=!1,I=[],Z=[],q=(t,e,n)=>{const o=e.$[n];let l,s,i=0;if(null!=o.h)l=o.O=c.document.createTextNode(o.h);else{if(!c.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=c.document.createElement(o.j),U(null,o,V),o.$){const e="template"===o.j?l.content:l;for(i=0;i<o.$.length;++i)s=q(t,o,i),s&&e.appendChild(s)}}return l["s-hn"]=S,l},F=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);l<=s;++l)o[l]&&(i=q(null,n,l),i&&(o[l].O=i,K(r,i,e)))},T=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;B(e),t&&t.remove()}}},G=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.v&&e.v&&(t.v=e.v),!0):t.v===e.v),Y=(t,e,n=!1)=>{const o=e.O=t.O,l=t.$,s=e.$,i=e.h;null==i?("slot"!==e.j||N||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{f.i|=1;const e=t.closest(S.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(K(e,t,null!=n?n:null),t["s-sh"]=void 0)}f.i&=-2})(e.O.parentElement)),U(t,e,V),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],p=e[a],h=o.length-1,m=o[0],y=o[h];const $="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==m)m=o[++c];else if(null==y)y=o[--h];else if(G(d,m,l))Y(d,m,l),d=e[++r],m=o[++c];else if(G(p,y,l))Y(p,y,l),p=e[--a],y=o[--h];else if(G(d,y,l))Y(d,y,l),K($,d.O,p.O.nextSibling),d=e[++r],y=o[--h];else if(G(p,m,l))Y(p,m,l),K($,p.O,d.O),p=e[--a],m=o[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].v&&e[f].v===m.v){u=f;break}u>=0?(i=e[u],i.j!==m.j?s=q(e&&e[c],n,u):(Y(i,m,l),e[u]=void 0,s=i.O),m=o[++c]):(s=q(e&&e[c],n,c),m=o[++c]),s&&K(d.O.parentNode,s,d.O)}r>a?F(t,null==o[h+1]?null:o[h+1].O,n,o,c,h):c>h&&T(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.h&&(o.textContent=""),F(o,null,e,s,0,s.length-1)):!n&&null!==l&&T(l,0,l.length-1)):t.h!==i&&(o.data=i)},B=t=>{t.m&&t.m.ref&&I.push((()=>t.m.ref(null))),t.$&&t.$.map(B)},J=(t,e)=>{Z.push((()=>t(e)))},K=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),Q=(t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,s=t.M||C(null,null),i=(t=>t&&t.j===x)(e)?e:A(null,null,e);if(S=o.tagName,l.k&&(i.m=i.m||{},l.k.forEach((([t,e])=>{i.m[e]=o[t]}))),n&&i.m)for(const t of Object.keys(i.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=o[t]);i.j=null,i.i|=4,t.M=i,i.O=s.O=o.shadowRoot||o,N=!(!(1&l.i)||128&l.i),Y(s,i,n),I.forEach((t=>t())),I.length=0,Z.forEach((t=>t())),Z.length=0},X=(t,e)=>{if(e&&!t.A&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.A=()=>{e["s-p"].splice(n-1,1),o()})))}},tt=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);X(t,t.C);const n=()=>et(t,e);if(!e)return w(n);queueMicrotask((()=>{n()}))},et=(t,e)=>{const n=t.$hostElement$,o=n;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=ct(o,e?"componentWillLoad":"componentWillUpdate",void 0,n),l=nt(l,(()=>ct(o,"componentWillRender",void 0,n))),nt(l,(()=>lt(t,o,e)))},nt=(t,e)=>ot(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),ot=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,lt=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.i,l=((t,e)=>{var n,o,l;const s=k(e),r=i.get(s);if(!c.document)return s;if(t=11===t.nodeType?t:c.document,r)if("string"==typeof r){let l,i=M.get(t=t.head||t);if(i||M.set(t,i=new Set),!i.has(s)){l=c.document.createElement("style"),l.textContent=r;const u=null!=(n=f.W)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=c.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=u&&l.setAttribute("nonce",u),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(a){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(r),d?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=r+e.textContent:t.prepend(l)}else t.append(l);1&e.i&&t.insertBefore(l,null),4&e.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=M.get(t);if(e||M.set(t,e=new Set),!e.has(s)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(r.constructor===n.CSSStyleSheet)o=r;else{o=new n.CSSStyleSheet;for(let t=0;t<r.cssRules.length;t++)o.insertRule(r.cssRules[t].cssText,t)}d?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);st(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>it(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},st=(t,e,n,o)=>{try{e=e.render(),t.i&=-17,t.i|=2,Q(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},it=t=>{const e=t.$hostElement$,n=e,o=t.C;ct(n,"componentDidRender",void 0,e),64&t.i?ct(n,"componentDidUpdate",void 0,e):(t.i|=64,ut(e),ct(n,"componentDidLoad",void 0,e),t.L(e),o||rt()),t.A&&(t.A(),t.A=void 0),512&t.i&&v((()=>tt(t,!1))),t.i&=-517},rt=()=>{v((()=>(t=>{const e=f.ce("appload",{detail:{namespace:"ionicons"}});return t.dispatchEvent(e),e})(c)))},ct=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},ut=t=>t.classList.add("hydrated"),ft=(t,e,n,l)=>{const i=o(t);if(!i)return;const r=t,c=i.l.get(e),u=i.i,f=r;if(!((n=L(n,l.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l._){const t=l._[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(f?f[o](n,c,e):i.D.push((()=>{i.H[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||tt(i,!1)}}},at=(e,n)=>{var l,s;const i=e.prototype;{e.watchers&&!n._&&(n._=W(e.watchers)),e.deserializers&&!n.P&&(n.P=e.deserializers),e.serializers&&!n.R&&(n.R=e.serializers);const r=Object.entries(null!=(l=n.t)?l:{});r.map((([e,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>o(this).l.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=o(this);if(s){if(r)return void 0===(32&l?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),r.call(this,L(t,l)),void ft(this,e,t=32&l?this[e]:s.$hostElement$[e],n);ft(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,l,s){f.jmp((()=>{var c;const u=t.get(e),f=o(this);if(this.hasOwnProperty(u),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==f?void 0:f.i;if(f&&t&&!(8&t)&&s!==l){const o=this,i=null==(c=n._)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&t||1&r)&&o[i].call(o,s,l,e)}))}return}const a=r.find((([t])=>t===u)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[u];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,u);p||s==this[u]||h.get&&!h.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n._)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,o])=>{var l;const s=o[1]||e;return t.set(s,e),512&o[0]&&(null==(l=n.k)||l.push([e,s])),s}))]))}}return e},dt=(t,e)=>{const l={i:e[0],p:e[1]};try{l.t=e[2],l._=W(t._),l.P=t.P,l.R=t.R,l.k=[];const r=t.prototype.connectedCallback,c=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,U:new Map};o.N=new Promise((t=>o.L=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&e.i&&n(t,o)})(this,l)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!o(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.i)(null==e?void 0:e.H)||(null==e?void 0:e.N)&&e.N.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){X(e,e.C=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.i)&&(e.i|=32,o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const e=k(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);a&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.i)),o()}}const l=e.C,s=()=>tt(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(n){s(n,t),e.A&&(e.A(),e.A=void 0),e.L&&e.L(t)}})(t,e,n)}l()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{M.has(t)&&M.delete(t),t.shadowRoot&&M.has(t.shadowRoot)&&M.delete(t.shadowRoot)})(this),c&&c.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,l)}}),Object.defineProperty(t,"is",{value:l.p,configurable:!0}),at(t,l)}catch(e){return s(e),t}},pt=t=>f.W=t,ht=t=>Object.assign(f,t),mt=new WeakMap;function yt(t,e){let n=mt.get(e);n||(n={i:0,o:{i:0,p:e.tagName},$hostElement$:e},mt.set(e,n)),Q(n,t)}function $t(t){return t}let bt;const vt=()=>{if("undefined"==typeof window)return new Map;if(!bt){const t=window;t.Ionicons=t.Ionicons||{},bt=t.Ionicons.map=t.Ionicons.map||new Map}return bt},wt=t=>{Object.keys(t).forEach((e=>{gt(e,t[e]);const n=e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z0-9])/g,"$1-$2").toLowerCase();e!==n&&gt(n,t[e])}))},gt=(t,e)=>{const n=vt(),o=n.get(t);void 0===o?n.set(t,e):o!==e&&console.warn(`[Ionicons Warning]: Multiple icons were mapped to name "${t}". Ensure that multiple icons are not mapped to the same icon name.`)},jt=t=>{let e=Mt(t.src);if(e)return e;if(e=St(t.name,t.icon,t.mode,t.ios,t.md),e)return Ot(e,t);if(t.icon){if(e=Mt(t.icon),e)return e;if(e=Mt(t.icon[t.mode]),e)return e}return null},Ot=(t,e)=>{const n=vt().get(t);if(n)return n;try{return g(`svg/${t}.svg`)}catch(n){console.log("e",n),console.warn(`[Ionicons Warning]: Could not load icon with name "${t}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`,e)}},St=(t,e,n,o,l)=>(n="ios"===(n&&At(n))?"ios":"md",o&&"ios"===n?t=At(o):l&&"md"===n?t=At(l):(t||!e||kt(e)||(t=e),Et(t)&&(t=At(t))),Et(t)&&""!==t.trim()?""!==t.replace(/[a-z]|-|\d/gi,"")?null:t:null),Mt=t=>Et(t)&&(t=t.trim(),kt(t))?t:null,kt=t=>t.length>0&&/(\/|\.)/.test(t),Et=t=>"string"==typeof t,At=t=>t.toLowerCase(),Ct=(t,e=[])=>{const n={};return e.forEach((e=>{t.hasAttribute(e)&&(null!==t.getAttribute(e)&&(n[e]=t.getAttribute(e)),t.removeAttribute(e))})),n},xt=t=>t&&""!==t.dir?"rtl"===t.dir.toLowerCase():"rtl"===(null===document||void 0===document?void 0:document.dir.toLowerCase());export{u as H,Ct as a,wt as addIcons,St as b,xt as c,x as d,jt as g,g as getAssetPath,A as h,Et as i,dt as p,yt as render,j as setAssetPath,pt as setNonce,ht as setPlatformOptions,$t as t}