PageSourceSearch

https://www.numerama.com/wp-content/themes/numerama-next/dist/java…/chunks/notyf-vBLunrz7ScI8KisEieq3Y.js

js numerama.com collected 2026-10-01 09:05:17 UTC 8,274 bytes, 3 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f69b-5162-73d3-9816-58e4e2d2403b")}catch(e){}}();var r=function(){return r=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++){i=arguments[e];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},r.apply(this,arguments)},A=(function(){function o(t){this.options=t,this.listeners={}}return o.prototype.on=function(t,i){var e=this.listeners[t]||[];this.listeners[t]=e.concat([i])},o.prototype.triggerEvent=function(t,i){var e=this,n=this.listeners[t]||[];n.forEach(function(a){return a({target:e,event:i})})},o})(),l;(function(o){o[o.Add=0]="Add",o[o.Remove=1]="Remove"})(l||(l={}));var P=(function(){function o(){this.notifications=[]}return o.prototype.push=function(t){this.notifications.push(t),this.updateFn(t,l.Add,this.notifications)},o.prototype.splice=function(t,i){var e=this.notifications.splice(t,i)[0];return this.updateFn(e,l.Remove,this.notifications),e},o.prototype.indexOf=function(t){return this.notifications.indexOf(t)},o.prototype.onUpdate=function(t){this.updateFn=t},o})(),c;(function(o){o.Dismiss="dismiss",o.Click="click"})(c||(c={}));var C={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!1},k=(function(){function o(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),i=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(i),document.body.appendChild(t),this.container=i,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}return o.prototype.on=function(t,i){var e;this.events=r(r({},this.events),(e={},e[t]=i,e))},o.prototype.update=function(t,i){i===l.Add?this.addNotification(t):i===l.Remove&&this.removeNotification(t)},o.prototype.removeNotification=function(t){var i=this,e=this._popRenderedNotification(t),n;if(e){n=e.node,n.classList.add("notyf__toast--disappear");var a;n.addEventListener(this.animationEndEventName,a=function(s){s.target===n&&(n.removeEventListener(i.animationEndEventName,a),i.container.removeChild(n))})}},o.prototype.addNotification=function(t){var i=this._renderNotification(t);this.notifications.push({notification:t,node:i}),this._announce(t.options.message||"Notification")},o.prototype._renderNotification=function(t){var i,e=this._buildNotificationCard(t),n=t.options.className;return n&&(i=e.classList).add.apply(i,n.split(" ")),this.container.appendChild(e),e},o.prototype._popRenderedNotification=function(t){for(var i=-1,e=0;e<this.notifications.length&&i<0;e++)this.notifications[e].notification===t&&(i=e);if(i!==-1)return this.notifications.splice(i,1)[0]},o.prototype.getXPosition=function(t){var i;return((i=t?.position)===null||i===void 0?void 0:i.x)||"right"},o.prototype.getYPosition=function(t){var i;return((i=t?.position)===null||i===void 0?void 0:i.y)||"bottom"},o.prototype.adjustContainerAlignment=function(t){var i=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],e=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)],n=this.container.style;n.setProperty("justify-content",e),n.setProperty("align-items",i)},o.prototype._buildNotificationCard=function(t){var i=this,e=t.options,n=e.icon;this.adjustContainerAlignment(e);var a=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),s=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),f=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),u=this._createHTMLElement({tagName:"div",className:"notyf__message"});u.innerHTML=e.message||"";var v=e.background||e.backgroundColor;if(n){var m=this._createHTMLElement({tagName:"div",className:"notyf__icon"});if((typeof n=="string"||n instanceof String)&&(m.innerHTML=new String(n).valueOf()),typeof n=="object"){var y=n.tagName,T=y===void 0?"i":y,L=n.className,x=n.text,_=n.color,g=_===void 0?v:_,N=this._createHTMLElement({tagName:T,className:L,text:x});g&&(N.style.color=g),m.appendChild(N)}f.appendChild(m)}if(f.appendChild(u),a.appendChild(f),v&&(e.ripple?(s.style.background=v,a.appendChild(s)):a.style.background=v),e.dismissible){var E=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),b=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"});E.appendChild(b),f.appendChild(E),a.classList.add("notyf__toast--dismissible"),b.addEventListener("click",function(h){var d,p;(p=(d=i.events)[c.Dismiss])===null||p===void 0||p.call(d,{target:t,event:h}),h.stopPropagation()})}a.addEventListener("click",function(h){var d,p;return(p=(d=i.events)[c.Click])===null||p===void 0?void 0:p.call(d,{target:t,event:h})});var O=this.getYPosition(e)==="top"?"upper":"lower";return a.classList.add("notyf__toast--"+O),a},o.prototype._createHTMLElement=function(t){var i=t.tagName,e=t.className,n=t.text,a=document.createElement(i);return e&&(a.className=e),a.textContent=n||null,a},o.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},o.prototype._announce=function(t){var i=this;this.a11yContainer.textContent="",setTimeout(function(){i.a11yContainer.textContent=t},100)},o.prototype._getAnimationEndEventName=function(){var t=document.createElement("_fake"),i={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"},e;for(e in i)if(t.style[e]!==void 0)return i[e];return"animationend"},o})(),w=(function(){function o(t){var i=this;this.dismiss=this._removeNotification,this.notifications=new P,this.view=new k;var e=this.registerTypes(t);this.options=r(r({},C),t),this.options.types=e,this.notifications.onUpdate(function(n,a){return i.view.update(n,a)}
1),this.view.on(c.Dismiss,function(n){var a=n.target,s=n.event;i._removeNotification(a),a.triggerEvent(c.Dismiss,s)}),this.view.on(c.Click,function(n){var a=n.target,s=n.event;return a.triggerEvent(c.Click,s)})}return o.prototype.error=function(t){var i=this.normalizeOptions("error",t);return this.open(i)},o.prototype.success=function(t){var i=this.normalizeOptions("success",t);return this.open(i)},o.prototype.open=function(t){var i=this.options.types.find(function(a){var s=a.type;return s===t.type})||{},e=r(r({},i),t);this.assignProps(["ripple","position","dismissible"],e);var n=new A(e);return this._pushNotification(n),n},o.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},o.prototype.assignProps=function(t,i){var e=this;t.forEach(function(n){i[n]=i[n]==null?e.options[n]:i[n]})},o.prototype._pushNotification=function(t){var i=this;this.notifications.push(t);var e=t.options.duration!==void 0?t.options.duration:this.options.duration;e&&setTimeout(function(){return i._removeNotification(t)},e)},o.prototype._removeNotification=function(t){var i=this.notifications.indexOf(t);i!==-1&&this.notifications.splice(i,1)},o.prototype.normalizeOptions=function(t,i){var e={type:t};return typeof i=="string"?e.message=i:typeof i=="object"&&(e=r(r({},e),i)),e},o.prototype.registerTypes=function(t){var i=(t&&t.types||[]).slice(),e=C.types.map(function(n){var a=-1;i.forEach(function(f,u){f.type===n.type&&(a=u)});var s=a!==-1?i.splice(a,1)[0]:{};return r(r({},n),s)});return e.concat(i)},o})();export{C as DEFAULT_OPTIONS,w as Notyf,P as NotyfArray,l as NotyfArrayEvent,c as NotyfEvent,A as NotyfNotification,k as NotyfView};
2
3//# chunkId=01a0f69b-5162-73d3-9816-58e4e2d2403b

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.