Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@polymarket/embeds

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polymarket/embeds - npm Package Compare versions

Comparing version 1.0.11 to 1.1.0

dist/common/loadFonts.cjs

6

CHANGELOG.md
# @polymarket/embeds
## 1.1.0
### Minor Changes
- 6e01021: Add support for new Election embed type
## 1.0.11

@@ -4,0 +10,0 @@

1

dist/api/types.d.ts

@@ -97,2 +97,3 @@ type SingleMarketUpdate = `${number}-${string}`;

outcomePrices: string[];
oneDayPriceChange?: number | null;
volume: string;

@@ -99,0 +100,0 @@ volume_num: number;

125

dist/embeds/market/index.js

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

var Kt=Object.create;var W=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty;var Yt=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),I=e=>{throw TypeError(e)};var De=(e,t,r)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var qt=(e,t)=>W(e,"name",{value:t,configurable:!0});var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var qe=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Be(t))!Ie.call(e,s)&&s!==r&&W(e,s,{get:()=>t[s],enumerable:!(i=Gt(t,s))||i.enumerable});return e};var We=(e,t,r)=>(r=e!=null?Kt(je(e)):{},qe(W(r,"default",{value:e,enumerable:!0}),e));var Xt=e=>[,,,Kt(e?.[Yt("metadata")]??null)],Qt=["class","method","getter","setter","accessor","field","value","get","set"],q=e=>e!==void 0&&typeof e!="function"?I("Function expected"):e,Je=(e,t,r,i,s)=>({kind:Qt[e],name:t,metadata:i,addInitializer:c=>r._?I("Already initialized"):s.push(q(c||null))}),Ke=(e,t)=>De(t,Yt("metadata"),e[3]),y=(e,t,r,i)=>{for(var s=0,c=e[t>>1],u=c&&c.length;s<u;s++)t&1?c[s].call(r):i=c[s].call(r,i);return i},C=(e,t,r,i,s,c)=>{var u,g,o,n,p,a=t&7,l=!!(t&8),h=!!(t&16),d=a>3?e.length+1:a?l?1:2:0,m=Qt[a+5],$=a>3&&(e[d-1]=[]),b=e[d]||(e[d]=[]),v=a&&(!h&&!l&&(s=s.prototype),a<5&&(a>3||!h)&&Gt(a<4?s:{get[r](){return Wt(this,c)},set[r](_){return Jt(this,c,_)}},r));a?h&&a<4&&qt(c,(a>2?"set ":a>1?"get ":"")+r):qt(s,r);for(var E=i.length-1;E>=0;E--)n=Je(a,r,o={},e[3],b),a&&(n.static=l,n.private=h,p=n.access={has:h?_=>Ge(s,_):_=>r in _},a^3&&(p.get=h?_=>(a^1?Wt:Ye)(_,s,a^4?c:v.get):_=>_[r]),a>2&&(p.set=h?(_,M)=>Jt(_,s,M,a^4?c:v.set):(_,M)=>_[r]=M)),g=(0, i[E])(a?a<4?h?c:v[m]:a>4?void 0:{get:v.get,set:v.set}:s,n),o._=1,a^4||g===void 0?q(g)&&(a>4?$.unshift(g):a?h?c=g:v[m]=g:s=g):typeof g!="object"||g===null?I("Object expected"):(q(u=g.get)&&(v.get=u),q(u=g.set)&&(v.set=u),q(u=g.init)&&$.unshift(u));return a||Ke(e,s),v&&W(s,r,v),h?a^4?c:v:s};var ut=(e,t,r)=>t.has(e)||I("Cannot "+r),Ge=(e,t)=>Object(t)!==t?I('Cannot use the "in" operator on this value'):e.has(t),Wt=(e,t,r)=>(ut(e,t,"read from private field"),r?r.call(e):t.get(e)),S=(e,t,r)=>t.has(e)?I("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Jt=(e,t,r,i)=>(ut(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Ye=(e,t,r)=>(ut(e,t,"access private method"),r);var xe=Ze(($e,ht)=>{(function(e,t){typeof define=="function"&&define.amd?define(t):typeof ht=="object"&&ht.exports?ht.exports=t():e.numeral=t();})($e,function(){var e,t,r="2.0.6",i={},s={},c={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},u={currentLocale:c.currentLocale,zeroFormat:c.zeroFormat,nullFormat:c.nullFormat,defaultFormat:c.defaultFormat,scalePercentBy100:c.scalePercentBy100};function g(o,n){this._input=o,this._value=n;}return e=function(o){var n,p,a,l;if(e.isNumeral(o))n=o.value();else if(o===0||typeof o>"u")n=0;else if(o===null||t.isNaN(o))n=null;else if(typeof o=="string")if(u.zeroFormat&&o===u.zeroFormat)n=0;else if(u.nullFormat&&o===u.nullFormat||!o.replace(/[^0-9]+/g,"").length)n=null;else {for(p in i)if(l=typeof i[p].regexps.unformat=="function"?i[p].regexps.unformat():i[p].regexps.unformat,l&&o.match(l)){a=i[p].unformat;break}a=a||e._.stringToNumber,n=a(o);}else n=Number(o)||null;return new g(o,n)},e.version=r,e.isNumeral=function(o){return o instanceof g},e._=t={numberToFormat:function(o,n,p){var a=s[e.options.currentLocale],l=!1,h=!1,d=0,m="",$=1e12,b=1e9,v=1e6,E=1e3,_="",M=!1,A,R,k,P,pt,Dt,H;if(o=o||0,R=Math.abs(o),e._.includes(n,"(")?(l=!0,n=n.replace(/[\(|\)]/g,"")):(e._.includes(n,"+")||e._.includes(n,"-"))&&(pt=e._.includes(n,"+")?n.indexOf("+"):o<0?n.indexOf("-"):-1,n=n.replace(/[\+|\-]/g,"")),e._.includes(n,"a")&&(A=n.match(/a(k|m|b|t)?/),A=A?A[1]:!1,e._.includes(n," a")&&(m=" "),n=n.replace(new RegExp(m+"a[kmbt]?"),""),R>=$&&!A||A==="t"?(m+=a.abbreviations.trillion,o=o/$):R<$&&R>=b&&!A||A==="b"?(m+=a.abbreviations.billion,o=o/b):R<b&&R>=v&&!A||A==="m"?(m+=a.abbreviations.million,o=o/v):(R<v&&R>=E&&!A||A==="k")&&(m+=a.abbreviations.thousand,o=o/E)),e._.includes(n,"[.]")&&(h=!0,n=n.replace("[.]",".")),k=o.toString().split(".")[0],P=n.split(".")[1],Dt=n.indexOf(","),d=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,P?(e._.includes(P,"[")?(P=P.replace("]",""),P=P.split("["),_=e._.toFixed(o,P[0].length+P[1].length,p,P[1].length)):_=e._.toFixed(o,P.length,p),k=_.split(".")[0],e._.includes(_,".")?_=a.delimiters.decimal+_.split(".")[1]:_="",h&&Number(_.slice(1))===0&&(_="")):k=e._.toFixed(o,0,p),m&&!A&&Number(k)>=1e3&&m!==a.abbreviations.trillion)switch(k=String(Number(k)/1e3),m){case a.abbreviations.thousand:m=a.abbreviations.million;break;case a.abbreviations.million:m=a.abbreviations.billion;break;case a.abbreviations.billion:m=a.abbreviations.trillion;break}if(e._.includes(k,"-")&&(k=k.slice(1),M=!0),k.length<d)for(var Zt=d-k.length;Zt>0;Zt--)k="0"+k;return Dt>-1&&(k=k.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+a.delimiters.thousands)),n.indexOf(".")===0&&(k=""),H=k+_+(m||""),l?H=(l&&M?"(":"")+H+(l&&M?")":""):pt>=0?H=pt===0?(M?"-":"+")+H:H+(M?"-":"+"):M&&(H="-"+H),H},stringToNumber:function(o){var n=s[u.currentLocale],p=o,a={thousand:3,million:6,billion:9,trillion:12},l,h,m;if(u.zeroFormat&&o===u.zeroFormat)h=0;else if(u.nullFormat&&o===u.nullFormat||!o.replace(/[^0-9]+/g,"").length)h=null;else {h=1,n.delimiters.decimal!=="."&&(o=o.replace(/\./g,"").replace(n.delimiters.decimal,"."));for(l in a)if(m=new RegExp("[^a-zA-Z]"+n.abbreviations[l]+"(?:\\)|(\\"+n.currency.symbol+")?(?:\\))?)?$"),p.match(m)){h*=Math.pow(10,a[l]);break}h*=(o.split("-").length+Math.min(o.split("(").length-1,o.split(")").length-1))%2?1:-1,o=o.replace(/[^0-9\.]+/g,""),h*=Number(o);}return h},isNaN:function(o){return typeof o=="number"&&isNaN(o)},includes:function(o,n){return o.indexOf(n)!==-1},insert:function(o,n,p){return o.slice(0,p)+n+o.slice(p)},reduce:function(o,n){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof n!="function")throw new TypeError(n+" is not a function");var p=Object(o),a=p.length>>>0,l=0,h;if(arguments.length===3)h=arguments[2];else {for(;l<a&&!(l in p);)l++;if(l>=a)throw new TypeError("Reduce of empty array with no initial value");h=p[l++];}for(;l<a;l++)l in p&&(h=n(h,p[l],l,p));return h},multiplier:function(o){var n=o.toString().split(".");return n.length<2?1:Math.pow(10,n[1].length)},correctionFactor:function(){var o=Array.prototype.slice.call(arguments);return o.reduce(function(n,p){var a=t.multiplier(p);return n>a?n:a},1)},toFixed:function(o,n,p,a){var l=o.toString().split("."),h=n-(a||0),d,m,$,b;return l.length===2?d=Math.min(Math.max(l[1].length,h),n):d=h,$=Math.pow(10,d),b=(p(o+"e+"+d)/$).toFixed(d),a>n-d&&(m=new RegExp("\\.?0{1,"+(a-(n-d))+"}$"),b=b.replace(m,"")),b}},e.options=u,e.formats=i,e.locales=s,e.locale=function(o){return o&&(u.currentLocale=o.toLowerCase()),u.currentLocale},e.localeData=function(o){if(!o)return s[u.currentLocale];if(o=o.toLowerCase(),!s[o])throw new Error("Unknown locale : "+o);return s[o]},e.reset=function(){for(var o in c)u[o]=c[o];},e.zeroFormat=function(o){u.zeroFormat=typeof o=="string"?o:null;},e.nullFormat=function(o){u.nullFormat=typeof o=="string"?o:null;},e.defaultFormat=function(o){u.defaultFormat=typeof o=="string"?o:"0.0";},e.register=function(o,n,p){if(n=n.toLowerCase(),this[o+"s"][n])throw new TypeError(n+" "+o+" already registered.");return this[o+"s"][n]=p,p},e.validate=function(o,n){var p,a,l,h,d,m,$,b;if(typeof o!="string"&&(o+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",o)),o=o.trim(),o.match(/^\d+$/))return !0;if(o==="")return !1;try{$=e.localeData(n);}catch{$=e.localeData(e.locale());}return l=$.currency.symbol,d=$.abbreviations,p=$.delimiters.decimal,$.delimiters.thousands==="."?a="\\.":a=$.delimiters.thousands,b=o.match(/^[^\d]+/),b!==null&&(o=o.substr(1),b[0]!==l)||(b=o.match(/[^\d]+$/),b!==null&&(o=o.slice(0,-1),b[0]!==d.thousand&&b[0]!==d.million&&b[0]!==d.billion&&b[0]!==d.trillion))?!1:(m=new RegExp(a+"{2}"),o.match(/[^\d.,]/g)?!1:(h=o.split(p),h.length>2?!1:h.length<2?!!h[0].match(/^\d+.*\d$/)&&!h[0].match(m):h[0].length===1?!!h[0].match(/^\d+$/)&&!h[0].match(m)&&!!h[1].match(/^\d+$/):!!h[0].match(/^\d+.*\d$/)&&!h[0].match(m)&&!!h[1].match(/^\d+$/)))},e.fn=g.prototype={clone:function(){return e(this)},format:function(o,n){var p=this._value,a=o||u.defaultFormat,l,h,d;if(n=n||Math.round,p===0&&u.zeroFormat!==null)h=u.zeroFormat;else if(p===null&&u.nullFormat!==null)h=u.nullFormat;else {for(l in i)if(a.match(i[l].regexps.format)){d=i[l].format;break}d=d||e._.numberToFormat,h=d(p,a,n);}return h},value:function(){return this._value},input:function(){return this._input},set:function(o){return this._value=Number(o),this},add:function(o){var n=t.correctionFactor.call(null,this._value,o);function p(a,l,h,d){return a+Math.round(n*l)}return this._value=t.reduce([this._value,o],p,0)/n,this},subtract:function(o){var n=t.correctionFactor.call(null,this._value,o);function p(a,l,h,d){return a-Math.round(n*l)}return this._value=t.reduce([o],p,Math.round(this._value*n))/n,this},multiply:function(o){function n(p,a,l,h){var d=t.correctionFactor(p,a);return Math.round(p*d)*Math.round(a*d)/Math.round(d*d)}return this._value=t.reduce([this._value,o],n,1),this},divide:function(o){function n(p,a,l,h){var d=t.correctionFactor(p,a);return Math.round(p*d)/Math.round(a*d)}return this._value=t.reduce([this._value,o],n),this},difference:function(o){return Math.abs(e(this._value).subtract(o).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(o){var n=o%10;return ~~(o%100/10)===1?"th":n===1?"st":n===2?"nd":n===3?"rd":"th"},currency:{symbol:"$"}}),function(){e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(o,n,p){var a=e._.includes(n," BPS")?" ":"",l;return o=o*1e4,n=n.replace(/\s?BPS/,""),l=e._.numberToFormat(o,n,p),e._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"BPS"),l=l.join("")):l=l+a+"BPS",l},unformat:function(o){return +(e._.stringToNumber(o)*1e-4).toFixed(15)}});}(),function(){var o={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},n={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},p=o.suffixes.concat(n.suffixes.filter(function(l){return o.suffixes.indexOf(l)<0})),a=p.join("|");a="("+a.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(a)},format:function(l,h,d){var m,$=e._.includes(h,"ib")?n:o,b=e._.includes(h," b")||e._.includes(h," ib")?" ":"",v,E,_;for(h=h.replace(/\s?i?b/,""),v=0;v<=$.suffixes.length;v++)if(E=Math.pow($.base,v),_=Math.pow($.base,v+1),l===null||l===0||l>=E&&l<_){b+=$.suffixes[v],E>0&&(l=l/E);break}return m=e._.numberToFormat(l,h,d),m+b},unformat:function(l){var h=e._.stringToNumber(l),d,m;if(h){for(d=o.suffixes.length-1;d>=0;d--){if(e._.includes(l,o.suffixes[d])){m=Math.pow(o.base,d);break}if(e._.includes(l,n.suffixes[d])){m=Math.pow(n.base,d);break}}h*=m||1;}return h}});}(),function(){e.register("format","currency",{regexps:{format:/(\$)/},format:function(o,n,p){var a=e.locales[e.options.currentLocale],l={before:n.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:n.match(/([\+|\-|\)|\s|\$]*)$/)[0]},h,d,m;for(n=n.replace(/\s?\$\s?/,""),h=e._.numberToFormat(o,n,p),o>=0?(l.before=l.before.replace(/[\-\(]/,""),l.after=l.after.replace(/[\-\)]/,"")):o<0&&!e._.includes(l.before,"-")&&!e._.includes(l.before,"(")&&(l.before="-"+l.before),m=0;m<l.before.length;m++)switch(d=l.before[m],d){case"$":h=e._.insert(h,a.currency.symbol,m);break;case" ":h=e._.insert(h," ",m+a.currency.symbol.length-1);break}for(m=l.after.length-1;m>=0;m--)switch(d=l.after[m],d){case"$":h=m===l.after.length-1?h+a.currency.symbol:e._.insert(h,a.currency.symbol,-(l.after.length-(1+m)));break;case" ":h=m===l.after.length-1?h+" ":e._.insert(h," ",-(l.after.length-(1+m)+a.currency.symbol.length-1));break}return h}});}(),function(){e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(o,n,p){var a,l=typeof o=="number"&&!e._.isNaN(o)?o.toExponential():"0e+0",h=l.split("e");return n=n.replace(/e[\+|\-]{1}0/,""),a=e._.numberToFormat(Number(h[0]),n,p),a+"e"+h[1]},unformat:function(o){var n=e._.includes(o,"e+")?o.split("e+"):o.split("e-"),p=Number(n[0]),a=Number(n[1]);a=e._.includes(o,"e-")?a*=-1:a;function l(h,d,m,$){var b=e._.correctionFactor(h,d),v=h*b*(d*b)/(b*b);return v}return e._.reduce([p,Math.pow(10,a)],l,1)}});}(),function(){e.register("format","ordinal",{regexps:{format:/(o)/},format:function(o,n,p){var a=e.locales[e.options.currentLocale],l,h=e._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),h+=a.ordinal(o),l=e._.numberToFormat(o,n,p),l+h}});}(),function(){e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(o,n,p){var a=e._.includes(n," %")?" ":"",l;return e.options.scalePercentBy100&&(o=o*100),n=n.replace(/\s?\%/,""),l=e._.numberToFormat(o,n,p),e._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"%"),l=l.join("")):l=l+a+"%",l},unformat:function(o){var n=e._.stringToNumber(o);return e.options.scalePercentBy100?n*.01:n}});}(),function(){e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(o,n,p){var a=Math.floor(o/60/60),l=Math.floor((o-a*60*60)/60),h=Math.round(o-a*60*60-l*60);return a+":"+(l<10?"0"+l:l)+":"+(h<10?"0"+h:h)},unformat:function(o){var n=o.split(":"),p=0;return n.length===3?(p=p+Number(n[0])*60*60,p=p+Number(n[1])*60,p=p+Number(n[2])):n.length===2&&(p=p+Number(n[0])*60,p=p+Number(n[1])),Number(p)}});}(),e});});var rt=globalThis,ot=rt.ShadowRoot&&(rt.ShadyCSS===void 0||rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,dt=Symbol(),te=new WeakMap,J=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==dt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r;}get styleSheet(){let t=this.o,r=this.t;if(ot&&t===void 0){let i=r!==void 0&&r.length===1;i&&(t=te.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&te.set(r,t));}return t}toString(){return this.cssText}},ee=e=>new J(typeof e=="string"?e:e+"",void 0,dt),mt=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((i,s,c)=>i+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[c+1],e[0]);return new J(r,e,dt)},ft=(e,t)=>{if(ot)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let i=document.createElement("style"),s=rt.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=r.cssText,e.appendChild(i);}},it=ot?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let i of t.cssRules)r+=i.cssText;return ee(r)})(e):e;var{is:Xe,defineProperty:Qe,getOwnPropertyDescriptor:tr,getOwnPropertyNames:er,getOwnPropertySymbols:rr,getPrototypeOf:or}=Object,st=globalThis,re=st.trustedTypes,ir=re?re.emptyScript:"",sr=st.reactiveElementPolyfillSupport,K=(e,t)=>e,G={toAttribute(e,t){switch(t){case Boolean:e=e?ir:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e);}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e);}catch{r=null;}}return r}},nt=(e,t)=>!Xe(e,t),oe={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:nt};Symbol.metadata??=Symbol("metadata"),st.litPropertyMetadata??=new WeakMap;var L=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=oe){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(t,r),!r.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(t,i,r);s!==void 0&&Qe(this.prototype,t,s);}}static getPropertyDescriptor(t,r,i){let{get:s,set:c}=tr(this.prototype,t)??{get(){return this[r]},set(u){this[r]=u;}};return {get(){return s?.call(this)},set(u){let g=s?.call(this);c.call(this,u),this.requestUpdate(t,g,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??oe}static _$Ei(){if(this.hasOwnProperty(K("elementProperties")))return;let t=or(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(K("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(K("properties"))){let r=this.properties,i=[...er(r),...rr(r)];for(let s of i)this.createProperty(s,r[s]);}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[i,s]of r)this.elementProperties.set(i,s);}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let s=this._$Eu(r,i);s!==void 0&&this._$Eh.set(s,r);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)r.unshift(it(s));}else t!==void 0&&r.push(it(t));return r}static _$Eu(t,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,r,i){this._$AK(t,i);}_$EC(t,r){let i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){let c=(i.converter?.toAttribute!==void 0?i.converter:G).toAttribute(r,i.type);this._$Em=t,c==null?this.removeAttribute(s):this.setAttribute(s,c),this._$Em=null;}}_$AK(t,r){let i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let c=i.getPropertyOptions(s),u=typeof c.converter=="function"?{fromAttribute:c.converter}:c.converter?.fromAttribute!==void 0?c.converter:G;this._$Em=s,this[s]=u.fromAttribute(r,c.type),this._$Em=null;}}requestUpdate(t,r,i){if(t!==void 0){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??nt)(this[t],r))return;this.P(t,r,i);}this.isUpdatePending===!1&&(this._$ES=this._$ET());}P(t,r,i){this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(r){Promise.reject(r);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,c]of this._$Ep)this[s]=c;this._$Ep=void 0;}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,c]of i)c.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],c);}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$EU();}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(r);}willUpdate(t){}_$AE(t){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&=this._$Ej.forEach(r=>this._$EC(r,this[r])),this._$EU();}updated(t){}firstUpdated(t){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[K("elementProperties")]=new Map,L[K("finalized")]=new Map,sr?.({ReactiveElement:L}),(st.reactiveElementVersions??=[]).push("2.0.4");var xt=globalThis,at=xt.trustedTypes,ie=at?at.createPolicy("lit-html",{createHTML:e=>e}):void 0,he="$lit$",V=`lit$${Math.random().toFixed(9).slice(2)}$`,pe="?"+V,nr=`<${pe}>`,j=document,X=()=>j.createComment(""),Q=e=>e===null||typeof e!="object"&&typeof e!="function",ue=Array.isArray,ar=e=>ue(e)||typeof e?.[Symbol.iterator]=="function",gt=`[
\f\r]`,Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,se=/-->/g,ne=/>/g,F=RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),ae=/'/g,le=/"/g,de=/^(?:script|style|textarea|title)$/i,me=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),wt=me(1),O=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),ce=new WeakMap,B=j.createTreeWalker(j,129);function fe(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return ie!==void 0?ie.createHTML(t):t}var lr=(e,t)=>{let r=e.length-1,i=[],s,c=t===2?"<svg>":"",u=Y;for(let g=0;g<r;g++){let o=e[g],n,p,a=-1,l=0;for(;l<o.length&&(u.lastIndex=l,p=u.exec(o),p!==null);)l=u.lastIndex,u===Y?p[1]==="!--"?u=se:p[1]!==void 0?u=ne:p[2]!==void 0?(de.test(p[2])&&(s=RegExp("</"+p[2],"g")),u=F):p[3]!==void 0&&(u=F):u===F?p[0]===">"?(u=s??Y,a=-1):p[1]===void 0?a=-2:(a=u.lastIndex-p[2].length,n=p[1],u=p[3]===void 0?F:p[3]==='"'?le:ae):u===le||u===ae?u=F:u===se||u===ne?u=Y:(u=F,s=void 0);let h=u===F&&e[g+1].startsWith("/>")?" ":"";c+=u===Y?o+nr:a>=0?(i.push(n),o.slice(0,a)+he+o.slice(a)+V+h):o+V+(a===-2?g:h);}return [fe(e,c+(e[r]||"<?>")+(t===2?"</svg>":"")),i]},tt=class e{constructor({strings:t,_$litType$:r},i){let s;this.parts=[];let c=0,u=0,g=t.length-1,o=this.parts,[n,p]=lr(t,r);if(this.el=e.createElement(n,i),B.currentNode=this.el.content,r===2){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes);}for(;(s=B.nextNode())!==null&&o.length<g;){if(s.nodeType===1){if(s.hasAttributes())for(let a of s.getAttributeNames())if(a.endsWith(he)){let l=p[u++],h=s.getAttribute(a).split(V),d=/([.?@])?(.*)/.exec(l);o.push({type:1,index:c,name:d[2],strings:h,ctor:d[1]==="."?bt:d[1]==="?"?_t:d[1]==="@"?vt:Z}),s.removeAttribute(a);}else a.startsWith(V)&&(o.push({type:6,index:c}),s.removeAttribute(a));if(de.test(s.tagName)){let a=s.textContent.split(V),l=a.length-1;if(l>0){s.textContent=at?at.emptyScript:"";for(let h=0;h<l;h++)s.append(a[h],X()),B.nextNode(),o.push({type:2,index:++c});s.append(a[l],X());}}}else if(s.nodeType===8)if(s.data===pe)o.push({type:2,index:c});else {let a=-1;for(;(a=s.data.indexOf(V,a+1))!==-1;)o.push({type:7,index:c}),a+=V.length-1;}c++;}}static createElement(t,r){let i=j.createElement("template");return i.innerHTML=t,i}};function D(e,t,r=e,i){if(t===O)return t;let s=i!==void 0?r._$Co?.[i]:r._$Cl,c=Q(t)?void 0:t._$litDirective$;return s?.constructor!==c&&(s?._$AO?.(!1),c===void 0?s=void 0:(s=new c(e),s._$AT(e,r,i)),i!==void 0?(r._$Co??=[])[i]=s:r._$Cl=s),s!==void 0&&(t=D(e,s._$AS(e,t.values),s,i)),t}var yt=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:r},parts:i}=this._$AD,s=(t?.creationScope??j).importNode(r,!0);B.currentNode=s;let c=B.nextNode(),u=0,g=0,o=i[0];for(;o!==void 0;){if(u===o.index){let n;o.type===2?n=new et(c,c.nextSibling,this,t):o.type===1?n=new o.ctor(c,o.name,o.strings,this,t):o.type===6&&(n=new $t(c,this,t)),this._$AV.push(n),o=i[++g];}u!==o?.index&&(c=B.nextNode(),u++);}return B.currentNode=j,s}p(t){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,r),r+=i.strings.length-2):i._$AI(t[r])),r++;}},et=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,i,s){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0;}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=D(this,t,r),Q(t)?t===w||t==null||t===""?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ar(t)?this.k(t):this._(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}_(t){this._$AH!==w&&Q(this._$AH)?this._$AA.nextSibling.data=t:this.T(j.createTextNode(t)),this._$AH=t;}$(t){let{values:r,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=tt.createElement(fe(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(r);else {let c=new yt(s,this),u=c.u(this.options);c.p(r),this.T(u),this._$AH=c;}}_$AC(t){let r=ce.get(t.strings);return r===void 0&&ce.set(t.strings,r=new tt(t)),r}k(t){ue(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,s=0;for(let c of t)s===r.length?r.push(i=new e(this.S(X()),this.S(X()),this,this.options)):i=r[s],i._$AI(c),s++;s<r.length&&(this._$AR(i&&i._$AB.nextSibling,s),r.length=s);}_$AR(t=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);t&&t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i;}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t));}},Z=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,i,s,c){this.type=1,this._$AH=w,this._$AN=void 0,this.element=t,this.name=r,this._$AM=s,this.options=c,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w;}_$AI(t,r=this,i,s){let c=this.strings,u=!1;if(c===void 0)t=D(this,t,r,0),u=!Q(t)||t!==this._$AH&&t!==O,u&&(this._$AH=t);else {let g=t,o,n;for(t=c[0],o=0;o<c.length-1;o++)n=D(this,g[i+o],r,o),n===O&&(n=this._$AH[o]),u||=!Q(n)||n!==this._$AH[o],n===w?t=w:t!==w&&(t+=(n??"")+c[o+1]),this._$AH[o]=n;}u&&!s&&this.j(t);}j(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}},bt=class extends Z{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===w?void 0:t;}},_t=class extends Z{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==w);}},vt=class extends Z{constructor(t,r,i,s,c){super(t,r,i,s,c),this.type=5;}_$AI(t,r=this){if((t=D(this,t,r,0)??w)===O)return;let i=this._$AH,s=t===w&&i!==w||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,c=t!==w&&(i===w||s);s&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}},$t=class{constructor(t,r,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i;}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t);}};var cr=xt.litHtmlPolyfillSupport;cr?.(tt,et),(xt.litHtmlVersions??=[]).push("3.1.4");var ge=(e,t,r)=>{let i=r?.renderBefore??t,s=i._$litPart$;if(s===void 0){let c=r?.renderBefore??null;i._$litPart$=s=new et(t.insertBefore(X(),c),c,void 0,r??{});}return s._$AI(e),s};var U=class extends L{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ge(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return O}};U._$litElement$=!0,U.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:U});var hr=globalThis.litElementPolyfillSupport;hr?.({LitElement:U});(globalThis.litElementVersions??=[]).push("4.0.6");var ye=e=>(t,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(e,t);}):customElements.define(e,t);};var pr={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:nt},ur=(e=pr,t,r)=>{let{kind:i,metadata:s}=r,c=globalThis.litPropertyMetadata.get(s);if(c===void 0&&globalThis.litPropertyMetadata.set(s,c=new Map),c.set(r.name,e),i==="accessor"){let{name:u}=r;return {set(g){let o=t.get.call(this);t.set.call(this,g),this.requestUpdate(u,o,e);},init(g){return g!==void 0&&this.P(u,void 0,e),g}}}if(i==="setter"){let{name:u}=r;return function(g){let o=this[u];t.call(this,g),this.requestUpdate(u,o,e);}}throw Error("Unsupported decorator location: "+i)};function T(e){return (t,r)=>typeof r=="object"?ur(e,t,r):((i,s,c)=>{let u=s.hasOwnProperty(c);return s.constructor.createProperty(c,u?{...i,wrapped:!0}:i),u?Object.getOwnPropertyDescriptor(s,c):void 0})(e,t,r)}function z(e){return T({...e,state:!0,attribute:!1})}var be={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},_e=e=>(...t)=>({_$litDirective$:e,values:t}),ct=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,i){this._$Ct=t,this._$AM=r,this._$Ci=i;}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};var ve="important",dr=" !"+ve,N=_e(class extends ct{constructor(e){if(super(e),e.type!==be.ATTRIBUTE||e.name!=="style"||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,r)=>{let i=e[r];return i==null?t:t+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(e,[t]){let{style:r}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?r.removeProperty(i):r[i]=null);for(let i in t){let s=t[i];if(s!=null){this.ft.add(i);let c=typeof s=="string"&&s.endsWith(dr);i.includes("-")||c?r.setProperty(i,c?s.slice(0,-11):s,c?ve:""):r[i]=s;}}return O}});var kt="https://gamma-api.polymarket.com";var Ct=async e=>{let t=e.slug?`markets/slug/${e.slug}`:`markets/${e.id}`,i=await(await fetch(`${kt}/${t}`)).json();return {...i,outcomes:JSON.parse(i.outcomes),outcomePrices:JSON.parse(i.outcomePrices),clobTokenIds:i.clobTokenIds?JSON.parse(i.clobTokenIds):null}},St=async e=>{let t=e.slug?`events/slug/${e.slug}`:`events/${e.id}`,i=await(await fetch(`${kt}/${t}`)).json();return {...i,markets:i.markets?.map(s=>({...s,outcomes:JSON.parse(s.outcomes),outcomePrices:JSON.parse(s.outcomePrices),clobTokenIds:s.clobTokenIds?JSON.parse(s.clobTokenIds):null}))??[]}};var jt=We(xe());var mr={0:"M5,55 A50,50 0 0 1 5,55",10:"M5,55 A50,50 0 0 1 6,45",20:"M5,55 A50,50 0 0 1 10,33.4",30:"M5,55 A50,50 0 0 1 24,16",40:"M5,55 A50,50 0 0 1 34,9.8",50:"M5,55 A50,50 0 0 1 55,5",60:"M5,55 A50,50 0 0 1 76,9.8",70:"M5,55 A50,50 0 0 1 86,16",80:"M5,55 A50,50 0 0 1 100,33.4",90:"M5,55 A50,50 0 0 1 104,45",100:"M5,55 A50,50 0 0 1 105,55"},we=!1,It=()=>{if(we)return;we=!0;let e=new CSSStyleSheet;e.replaceSync(`
var Kt=Object.create;var W=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ie=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty;var Yt=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),I=e=>{throw TypeError(e)};var Ze=(e,t,r)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var qt=(e,t)=>W(e,"name",{value:t,configurable:!0});var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var We=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of je(t))!De.call(e,s)&&s!==r&&W(e,s,{get:()=>t[s],enumerable:!(i=Gt(t,s))||i.enumerable});return e};var Je=(e,t,r)=>(r=e!=null?Kt(Ie(e)):{},We(W(r,"default",{value:e,enumerable:!0}),e));var Xt=e=>[,,,Kt(e?.[Yt("metadata")]??null)],Qt=["class","method","getter","setter","accessor","field","value","get","set"],q=e=>e!==void 0&&typeof e!="function"?I("Function expected"):e,Ke=(e,t,r,i,s)=>({kind:Qt[e],name:t,metadata:i,addInitializer:c=>r._?I("Already initialized"):s.push(q(c||null))}),Ge=(e,t)=>Ze(t,Yt("metadata"),e[3]),y=(e,t,r,i)=>{for(var s=0,c=e[t>>1],u=c&&c.length;s<u;s++)t&1?c[s].call(r):i=c[s].call(r,i);return i},S=(e,t,r,i,s,c)=>{var u,g,o,n,p,a=t&7,l=!!(t&8),h=!!(t&16),d=a>3?e.length+1:a?l?1:2:0,m=Qt[a+5],$=a>3&&(e[d-1]=[]),b=e[d]||(e[d]=[]),v=a&&(!h&&!l&&(s=s.prototype),a<5&&(a>3||!h)&&Gt(a<4?s:{get[r](){return Wt(this,c)},set[r](_){return Jt(this,c,_)}},r));a?h&&a<4&&qt(c,(a>2?"set ":a>1?"get ":"")+r):qt(s,r);for(var E=i.length-1;E>=0;E--)n=Ke(a,r,o={},e[3],b),a&&(n.static=l,n.private=h,p=n.access={has:h?_=>Ye(s,_):_=>r in _},a^3&&(p.get=h?_=>(a^1?Wt:Xe)(_,s,a^4?c:v.get):_=>_[r]),a>2&&(p.set=h?(_,M)=>Jt(_,s,M,a^4?c:v.set):(_,M)=>_[r]=M)),g=(0, i[E])(a?a<4?h?c:v[m]:a>4?void 0:{get:v.get,set:v.set}:s,n),o._=1,a^4||g===void 0?q(g)&&(a>4?$.unshift(g):a?h?c=g:v[m]=g:s=g):typeof g!="object"||g===null?I("Object expected"):(q(u=g.get)&&(v.get=u),q(u=g.set)&&(v.set=u),q(u=g.init)&&$.unshift(u));return a||Ge(e,s),v&&W(s,r,v),h?a^4?c:v:s};var mt=(e,t,r)=>t.has(e)||I("Cannot "+r),Ye=(e,t)=>Object(t)!==t?I('Cannot use the "in" operator on this value'):e.has(t),Wt=(e,t,r)=>(mt(e,t,"read from private field"),r?r.call(e):t.get(e)),C=(e,t,r)=>t.has(e)?I("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Jt=(e,t,r,i)=>(mt(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Xe=(e,t,r)=>(mt(e,t,"access private method"),r);var xe=qe(($e,ut)=>{(function(e,t){typeof define=="function"&&define.amd?define(t):typeof ut=="object"&&ut.exports?ut.exports=t():e.numeral=t();})($e,function(){var e,t,r="2.0.6",i={},s={},c={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},u={currentLocale:c.currentLocale,zeroFormat:c.zeroFormat,nullFormat:c.nullFormat,defaultFormat:c.defaultFormat,scalePercentBy100:c.scalePercentBy100};function g(o,n){this._input=o,this._value=n;}return e=function(o){var n,p,a,l;if(e.isNumeral(o))n=o.value();else if(o===0||typeof o>"u")n=0;else if(o===null||t.isNaN(o))n=null;else if(typeof o=="string")if(u.zeroFormat&&o===u.zeroFormat)n=0;else if(u.nullFormat&&o===u.nullFormat||!o.replace(/[^0-9]+/g,"").length)n=null;else {for(p in i)if(l=typeof i[p].regexps.unformat=="function"?i[p].regexps.unformat():i[p].regexps.unformat,l&&o.match(l)){a=i[p].unformat;break}a=a||e._.stringToNumber,n=a(o);}else n=Number(o)||null;return new g(o,n)},e.version=r,e.isNumeral=function(o){return o instanceof g},e._=t={numberToFormat:function(o,n,p){var a=s[e.options.currentLocale],l=!1,h=!1,d=0,m="",$=1e12,b=1e9,v=1e6,E=1e3,_="",M=!1,A,V,k,P,dt,Dt,H;if(o=o||0,V=Math.abs(o),e._.includes(n,"(")?(l=!0,n=n.replace(/[\(|\)]/g,"")):(e._.includes(n,"+")||e._.includes(n,"-"))&&(dt=e._.includes(n,"+")?n.indexOf("+"):o<0?n.indexOf("-"):-1,n=n.replace(/[\+|\-]/g,"")),e._.includes(n,"a")&&(A=n.match(/a(k|m|b|t)?/),A=A?A[1]:!1,e._.includes(n," a")&&(m=" "),n=n.replace(new RegExp(m+"a[kmbt]?"),""),V>=$&&!A||A==="t"?(m+=a.abbreviations.trillion,o=o/$):V<$&&V>=b&&!A||A==="b"?(m+=a.abbreviations.billion,o=o/b):V<b&&V>=v&&!A||A==="m"?(m+=a.abbreviations.million,o=o/v):(V<v&&V>=E&&!A||A==="k")&&(m+=a.abbreviations.thousand,o=o/E)),e._.includes(n,"[.]")&&(h=!0,n=n.replace("[.]",".")),k=o.toString().split(".")[0],P=n.split(".")[1],Dt=n.indexOf(","),d=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,P?(e._.includes(P,"[")?(P=P.replace("]",""),P=P.split("["),_=e._.toFixed(o,P[0].length+P[1].length,p,P[1].length)):_=e._.toFixed(o,P.length,p),k=_.split(".")[0],e._.includes(_,".")?_=a.delimiters.decimal+_.split(".")[1]:_="",h&&Number(_.slice(1))===0&&(_="")):k=e._.toFixed(o,0,p),m&&!A&&Number(k)>=1e3&&m!==a.abbreviations.trillion)switch(k=String(Number(k)/1e3),m){case a.abbreviations.thousand:m=a.abbreviations.million;break;case a.abbreviations.million:m=a.abbreviations.billion;break;case a.abbreviations.billion:m=a.abbreviations.trillion;break}if(e._.includes(k,"-")&&(k=k.slice(1),M=!0),k.length<d)for(var Zt=d-k.length;Zt>0;Zt--)k="0"+k;return Dt>-1&&(k=k.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+a.delimiters.thousands)),n.indexOf(".")===0&&(k=""),H=k+_+(m||""),l?H=(l&&M?"(":"")+H+(l&&M?")":""):dt>=0?H=dt===0?(M?"-":"+")+H:H+(M?"-":"+"):M&&(H="-"+H),H},stringToNumber:function(o){var n=s[u.currentLocale],p=o,a={thousand:3,million:6,billion:9,trillion:12},l,h,m;if(u.zeroFormat&&o===u.zeroFormat)h=0;else if(u.nullFormat&&o===u.nullFormat||!o.replace(/[^0-9]+/g,"").length)h=null;else {h=1,n.delimiters.decimal!=="."&&(o=o.replace(/\./g,"").replace(n.delimiters.decimal,"."));for(l in a)if(m=new RegExp("[^a-zA-Z]"+n.abbreviations[l]+"(?:\\)|(\\"+n.currency.symbol+")?(?:\\))?)?$"),p.match(m)){h*=Math.pow(10,a[l]);break}h*=(o.split("-").length+Math.min(o.split("(").length-1,o.split(")").length-1))%2?1:-1,o=o.replace(/[^0-9\.]+/g,""),h*=Number(o);}return h},isNaN:function(o){return typeof o=="number"&&isNaN(o)},includes:function(o,n){return o.indexOf(n)!==-1},insert:function(o,n,p){return o.slice(0,p)+n+o.slice(p)},reduce:function(o,n){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof n!="function")throw new TypeError(n+" is not a function");var p=Object(o),a=p.length>>>0,l=0,h;if(arguments.length===3)h=arguments[2];else {for(;l<a&&!(l in p);)l++;if(l>=a)throw new TypeError("Reduce of empty array with no initial value");h=p[l++];}for(;l<a;l++)l in p&&(h=n(h,p[l],l,p));return h},multiplier:function(o){var n=o.toString().split(".");return n.length<2?1:Math.pow(10,n[1].length)},correctionFactor:function(){var o=Array.prototype.slice.call(arguments);return o.reduce(function(n,p){var a=t.multiplier(p);return n>a?n:a},1)},toFixed:function(o,n,p,a){var l=o.toString().split("."),h=n-(a||0),d,m,$,b;return l.length===2?d=Math.min(Math.max(l[1].length,h),n):d=h,$=Math.pow(10,d),b=(p(o+"e+"+d)/$).toFixed(d),a>n-d&&(m=new RegExp("\\.?0{1,"+(a-(n-d))+"}$"),b=b.replace(m,"")),b}},e.options=u,e.formats=i,e.locales=s,e.locale=function(o){return o&&(u.currentLocale=o.toLowerCase()),u.currentLocale},e.localeData=function(o){if(!o)return s[u.currentLocale];if(o=o.toLowerCase(),!s[o])throw new Error("Unknown locale : "+o);return s[o]},e.reset=function(){for(var o in c)u[o]=c[o];},e.zeroFormat=function(o){u.zeroFormat=typeof o=="string"?o:null;},e.nullFormat=function(o){u.nullFormat=typeof o=="string"?o:null;},e.defaultFormat=function(o){u.defaultFormat=typeof o=="string"?o:"0.0";},e.register=function(o,n,p){if(n=n.toLowerCase(),this[o+"s"][n])throw new TypeError(n+" "+o+" already registered.");return this[o+"s"][n]=p,p},e.validate=function(o,n){var p,a,l,h,d,m,$,b;if(typeof o!="string"&&(o+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",o)),o=o.trim(),o.match(/^\d+$/))return !0;if(o==="")return !1;try{$=e.localeData(n);}catch{$=e.localeData(e.locale());}return l=$.currency.symbol,d=$.abbreviations,p=$.delimiters.decimal,$.delimiters.thousands==="."?a="\\.":a=$.delimiters.thousands,b=o.match(/^[^\d]+/),b!==null&&(o=o.substr(1),b[0]!==l)||(b=o.match(/[^\d]+$/),b!==null&&(o=o.slice(0,-1),b[0]!==d.thousand&&b[0]!==d.million&&b[0]!==d.billion&&b[0]!==d.trillion))?!1:(m=new RegExp(a+"{2}"),o.match(/[^\d.,]/g)?!1:(h=o.split(p),h.length>2?!1:h.length<2?!!h[0].match(/^\d+.*\d$/)&&!h[0].match(m):h[0].length===1?!!h[0].match(/^\d+$/)&&!h[0].match(m)&&!!h[1].match(/^\d+$/):!!h[0].match(/^\d+.*\d$/)&&!h[0].match(m)&&!!h[1].match(/^\d+$/)))},e.fn=g.prototype={clone:function(){return e(this)},format:function(o,n){var p=this._value,a=o||u.defaultFormat,l,h,d;if(n=n||Math.round,p===0&&u.zeroFormat!==null)h=u.zeroFormat;else if(p===null&&u.nullFormat!==null)h=u.nullFormat;else {for(l in i)if(a.match(i[l].regexps.format)){d=i[l].format;break}d=d||e._.numberToFormat,h=d(p,a,n);}return h},value:function(){return this._value},input:function(){return this._input},set:function(o){return this._value=Number(o),this},add:function(o){var n=t.correctionFactor.call(null,this._value,o);function p(a,l,h,d){return a+Math.round(n*l)}return this._value=t.reduce([this._value,o],p,0)/n,this},subtract:function(o){var n=t.correctionFactor.call(null,this._value,o);function p(a,l,h,d){return a-Math.round(n*l)}return this._value=t.reduce([o],p,Math.round(this._value*n))/n,this},multiply:function(o){function n(p,a,l,h){var d=t.correctionFactor(p,a);return Math.round(p*d)*Math.round(a*d)/Math.round(d*d)}return this._value=t.reduce([this._value,o],n,1),this},divide:function(o){function n(p,a,l,h){var d=t.correctionFactor(p,a);return Math.round(p*d)/Math.round(a*d)}return this._value=t.reduce([this._value,o],n),this},difference:function(o){return Math.abs(e(this._value).subtract(o).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(o){var n=o%10;return ~~(o%100/10)===1?"th":n===1?"st":n===2?"nd":n===3?"rd":"th"},currency:{symbol:"$"}}),function(){e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(o,n,p){var a=e._.includes(n," BPS")?" ":"",l;return o=o*1e4,n=n.replace(/\s?BPS/,""),l=e._.numberToFormat(o,n,p),e._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"BPS"),l=l.join("")):l=l+a+"BPS",l},unformat:function(o){return +(e._.stringToNumber(o)*1e-4).toFixed(15)}});}(),function(){var o={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},n={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},p=o.suffixes.concat(n.suffixes.filter(function(l){return o.suffixes.indexOf(l)<0})),a=p.join("|");a="("+a.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(a)},format:function(l,h,d){var m,$=e._.includes(h,"ib")?n:o,b=e._.includes(h," b")||e._.includes(h," ib")?" ":"",v,E,_;for(h=h.replace(/\s?i?b/,""),v=0;v<=$.suffixes.length;v++)if(E=Math.pow($.base,v),_=Math.pow($.base,v+1),l===null||l===0||l>=E&&l<_){b+=$.suffixes[v],E>0&&(l=l/E);break}return m=e._.numberToFormat(l,h,d),m+b},unformat:function(l){var h=e._.stringToNumber(l),d,m;if(h){for(d=o.suffixes.length-1;d>=0;d--){if(e._.includes(l,o.suffixes[d])){m=Math.pow(o.base,d);break}if(e._.includes(l,n.suffixes[d])){m=Math.pow(n.base,d);break}}h*=m||1;}return h}});}(),function(){e.register("format","currency",{regexps:{format:/(\$)/},format:function(o,n,p){var a=e.locales[e.options.currentLocale],l={before:n.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:n.match(/([\+|\-|\)|\s|\$]*)$/)[0]},h,d,m;for(n=n.replace(/\s?\$\s?/,""),h=e._.numberToFormat(o,n,p),o>=0?(l.before=l.before.replace(/[\-\(]/,""),l.after=l.after.replace(/[\-\)]/,"")):o<0&&!e._.includes(l.before,"-")&&!e._.includes(l.before,"(")&&(l.before="-"+l.before),m=0;m<l.before.length;m++)switch(d=l.before[m],d){case"$":h=e._.insert(h,a.currency.symbol,m);break;case" ":h=e._.insert(h," ",m+a.currency.symbol.length-1);break}for(m=l.after.length-1;m>=0;m--)switch(d=l.after[m],d){case"$":h=m===l.after.length-1?h+a.currency.symbol:e._.insert(h,a.currency.symbol,-(l.after.length-(1+m)));break;case" ":h=m===l.after.length-1?h+" ":e._.insert(h," ",-(l.after.length-(1+m)+a.currency.symbol.length-1));break}return h}});}(),function(){e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(o,n,p){var a,l=typeof o=="number"&&!e._.isNaN(o)?o.toExponential():"0e+0",h=l.split("e");return n=n.replace(/e[\+|\-]{1}0/,""),a=e._.numberToFormat(Number(h[0]),n,p),a+"e"+h[1]},unformat:function(o){var n=e._.includes(o,"e+")?o.split("e+"):o.split("e-"),p=Number(n[0]),a=Number(n[1]);a=e._.includes(o,"e-")?a*=-1:a;function l(h,d,m,$){var b=e._.correctionFactor(h,d),v=h*b*(d*b)/(b*b);return v}return e._.reduce([p,Math.pow(10,a)],l,1)}});}(),function(){e.register("format","ordinal",{regexps:{format:/(o)/},format:function(o,n,p){var a=e.locales[e.options.currentLocale],l,h=e._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),h+=a.ordinal(o),l=e._.numberToFormat(o,n,p),l+h}});}(),function(){e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(o,n,p){var a=e._.includes(n," %")?" ":"",l;return e.options.scalePercentBy100&&(o=o*100),n=n.replace(/\s?\%/,""),l=e._.numberToFormat(o,n,p),e._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"%"),l=l.join("")):l=l+a+"%",l},unformat:function(o){var n=e._.stringToNumber(o);return e.options.scalePercentBy100?n*.01:n}});}(),function(){e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(o,n,p){var a=Math.floor(o/60/60),l=Math.floor((o-a*60*60)/60),h=Math.round(o-a*60*60-l*60);return a+":"+(l<10?"0"+l:l)+":"+(h<10?"0"+h:h)},unformat:function(o){var n=o.split(":"),p=0;return n.length===3?(p=p+Number(n[0])*60*60,p=p+Number(n[1])*60,p=p+Number(n[2])):n.length===2&&(p=p+Number(n[0])*60,p=p+Number(n[1])),Number(p)}});}(),e});});var it=globalThis,st=it.ShadowRoot&&(it.ShadyCSS===void 0||it.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ft=Symbol(),te=new WeakMap,J=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==ft)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r;}get styleSheet(){let t=this.o,r=this.t;if(st&&t===void 0){let i=r!==void 0&&r.length===1;i&&(t=te.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&te.set(r,t));}return t}toString(){return this.cssText}},ee=e=>new J(typeof e=="string"?e:e+"",void 0,ft),K=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((i,s,c)=>i+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[c+1],e[0]);return new J(r,e,ft)},gt=(e,t)=>{if(st)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let i=document.createElement("style"),s=it.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=r.cssText,e.appendChild(i);}},nt=st?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let i of t.cssRules)r+=i.cssText;return ee(r)})(e):e;var{is:Qe,defineProperty:tr,getOwnPropertyDescriptor:er,getOwnPropertyNames:rr,getOwnPropertySymbols:or,getPrototypeOf:ir}=Object,at=globalThis,re=at.trustedTypes,sr=re?re.emptyScript:"",nr=at.reactiveElementPolyfillSupport,G=(e,t)=>e,Y={toAttribute(e,t){switch(t){case Boolean:e=e?sr:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e);}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e);}catch{r=null;}}return r}},lt=(e,t)=>!Qe(e,t),oe={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:lt};Symbol.metadata??=Symbol("metadata"),at.litPropertyMetadata??=new WeakMap;var L=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=oe){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(t,r),!r.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(t,i,r);s!==void 0&&tr(this.prototype,t,s);}}static getPropertyDescriptor(t,r,i){let{get:s,set:c}=er(this.prototype,t)??{get(){return this[r]},set(u){this[r]=u;}};return {get(){return s?.call(this)},set(u){let g=s?.call(this);c.call(this,u),this.requestUpdate(t,g,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??oe}static _$Ei(){if(this.hasOwnProperty(G("elementProperties")))return;let t=ir(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(G("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(G("properties"))){let r=this.properties,i=[...rr(r),...or(r)];for(let s of i)this.createProperty(s,r[s]);}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[i,s]of r)this.elementProperties.set(i,s);}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let s=this._$Eu(r,i);s!==void 0&&this._$Eh.set(s,r);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)r.unshift(nt(s));}else t!==void 0&&r.push(nt(t));return r}static _$Eu(t,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,r,i){this._$AK(t,i);}_$EC(t,r){let i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){let c=(i.converter?.toAttribute!==void 0?i.converter:Y).toAttribute(r,i.type);this._$Em=t,c==null?this.removeAttribute(s):this.setAttribute(s,c),this._$Em=null;}}_$AK(t,r){let i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let c=i.getPropertyOptions(s),u=typeof c.converter=="function"?{fromAttribute:c.converter}:c.converter?.fromAttribute!==void 0?c.converter:Y;this._$Em=s,this[s]=u.fromAttribute(r,c.type),this._$Em=null;}}requestUpdate(t,r,i){if(t!==void 0){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??lt)(this[t],r))return;this.P(t,r,i);}this.isUpdatePending===!1&&(this._$ES=this._$ET());}P(t,r,i){this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(r){Promise.reject(r);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,c]of this._$Ep)this[s]=c;this._$Ep=void 0;}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,c]of i)c.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],c);}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$EU();}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(r);}willUpdate(t){}_$AE(t){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&=this._$Ej.forEach(r=>this._$EC(r,this[r])),this._$EU();}updated(t){}firstUpdated(t){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[G("elementProperties")]=new Map,L[G("finalized")]=new Map,nr?.({ReactiveElement:L}),(at.reactiveElementVersions??=[]).push("2.0.4");var wt=globalThis,ct=wt.trustedTypes,ie=ct?ct.createPolicy("lit-html",{createHTML:e=>e}):void 0,he="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,pe="?"+R,ar=`<${pe}>`,j=document,Q=()=>j.createComment(""),tt=e=>e===null||typeof e!="object"&&typeof e!="function",ue=Array.isArray,lr=e=>ue(e)||typeof e?.[Symbol.iterator]=="function",yt=`[
\f\r]`,X=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,se=/-->/g,ne=/>/g,F=RegExp(`>|${yt}(?:([^\\s"'>=/]+)(${yt}*=${yt}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),ae=/'/g,le=/"/g,de=/^(?:script|style|textarea|title)$/i,me=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),kt=me(1),O=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),ce=new WeakMap,B=j.createTreeWalker(j,129);function fe(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return ie!==void 0?ie.createHTML(t):t}var cr=(e,t)=>{let r=e.length-1,i=[],s,c=t===2?"<svg>":"",u=X;for(let g=0;g<r;g++){let o=e[g],n,p,a=-1,l=0;for(;l<o.length&&(u.lastIndex=l,p=u.exec(o),p!==null);)l=u.lastIndex,u===X?p[1]==="!--"?u=se:p[1]!==void 0?u=ne:p[2]!==void 0?(de.test(p[2])&&(s=RegExp("</"+p[2],"g")),u=F):p[3]!==void 0&&(u=F):u===F?p[0]===">"?(u=s??X,a=-1):p[1]===void 0?a=-2:(a=u.lastIndex-p[2].length,n=p[1],u=p[3]===void 0?F:p[3]==='"'?le:ae):u===le||u===ae?u=F:u===se||u===ne?u=X:(u=F,s=void 0);let h=u===F&&e[g+1].startsWith("/>")?" ":"";c+=u===X?o+ar:a>=0?(i.push(n),o.slice(0,a)+he+o.slice(a)+R+h):o+R+(a===-2?g:h);}return [fe(e,c+(e[r]||"<?>")+(t===2?"</svg>":"")),i]},et=class e{constructor({strings:t,_$litType$:r},i){let s;this.parts=[];let c=0,u=0,g=t.length-1,o=this.parts,[n,p]=cr(t,r);if(this.el=e.createElement(n,i),B.currentNode=this.el.content,r===2){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes);}for(;(s=B.nextNode())!==null&&o.length<g;){if(s.nodeType===1){if(s.hasAttributes())for(let a of s.getAttributeNames())if(a.endsWith(he)){let l=p[u++],h=s.getAttribute(a).split(R),d=/([.?@])?(.*)/.exec(l);o.push({type:1,index:c,name:d[2],strings:h,ctor:d[1]==="."?_t:d[1]==="?"?vt:d[1]==="@"?$t:Z}),s.removeAttribute(a);}else a.startsWith(R)&&(o.push({type:6,index:c}),s.removeAttribute(a));if(de.test(s.tagName)){let a=s.textContent.split(R),l=a.length-1;if(l>0){s.textContent=ct?ct.emptyScript:"";for(let h=0;h<l;h++)s.append(a[h],Q()),B.nextNode(),o.push({type:2,index:++c});s.append(a[l],Q());}}}else if(s.nodeType===8)if(s.data===pe)o.push({type:2,index:c});else {let a=-1;for(;(a=s.data.indexOf(R,a+1))!==-1;)o.push({type:7,index:c}),a+=R.length-1;}c++;}}static createElement(t,r){let i=j.createElement("template");return i.innerHTML=t,i}};function D(e,t,r=e,i){if(t===O)return t;let s=i!==void 0?r._$Co?.[i]:r._$Cl,c=tt(t)?void 0:t._$litDirective$;return s?.constructor!==c&&(s?._$AO?.(!1),c===void 0?s=void 0:(s=new c(e),s._$AT(e,r,i)),i!==void 0?(r._$Co??=[])[i]=s:r._$Cl=s),s!==void 0&&(t=D(e,s._$AS(e,t.values),s,i)),t}var bt=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:r},parts:i}=this._$AD,s=(t?.creationScope??j).importNode(r,!0);B.currentNode=s;let c=B.nextNode(),u=0,g=0,o=i[0];for(;o!==void 0;){if(u===o.index){let n;o.type===2?n=new rt(c,c.nextSibling,this,t):o.type===1?n=new o.ctor(c,o.name,o.strings,this,t):o.type===6&&(n=new xt(c,this,t)),this._$AV.push(n),o=i[++g];}u!==o?.index&&(c=B.nextNode(),u++);}return B.currentNode=j,s}p(t){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,r),r+=i.strings.length-2):i._$AI(t[r])),r++;}},rt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,i,s){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0;}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=D(this,t,r),tt(t)?t===w||t==null||t===""?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):lr(t)?this.k(t):this._(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}_(t){this._$AH!==w&&tt(this._$AH)?this._$AA.nextSibling.data=t:this.T(j.createTextNode(t)),this._$AH=t;}$(t){let{values:r,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=et.createElement(fe(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(r);else {let c=new bt(s,this),u=c.u(this.options);c.p(r),this.T(u),this._$AH=c;}}_$AC(t){let r=ce.get(t.strings);return r===void 0&&ce.set(t.strings,r=new et(t)),r}k(t){ue(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,s=0;for(let c of t)s===r.length?r.push(i=new e(this.S(Q()),this.S(Q()),this,this.options)):i=r[s],i._$AI(c),s++;s<r.length&&(this._$AR(i&&i._$AB.nextSibling,s),r.length=s);}_$AR(t=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);t&&t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i;}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t));}},Z=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,i,s,c){this.type=1,this._$AH=w,this._$AN=void 0,this.element=t,this.name=r,this._$AM=s,this.options=c,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w;}_$AI(t,r=this,i,s){let c=this.strings,u=!1;if(c===void 0)t=D(this,t,r,0),u=!tt(t)||t!==this._$AH&&t!==O,u&&(this._$AH=t);else {let g=t,o,n;for(t=c[0],o=0;o<c.length-1;o++)n=D(this,g[i+o],r,o),n===O&&(n=this._$AH[o]),u||=!tt(n)||n!==this._$AH[o],n===w?t=w:t!==w&&(t+=(n??"")+c[o+1]),this._$AH[o]=n;}u&&!s&&this.j(t);}j(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}},_t=class extends Z{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===w?void 0:t;}},vt=class extends Z{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==w);}},$t=class extends Z{constructor(t,r,i,s,c){super(t,r,i,s,c),this.type=5;}_$AI(t,r=this){if((t=D(this,t,r,0)??w)===O)return;let i=this._$AH,s=t===w&&i!==w||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,c=t!==w&&(i===w||s);s&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}},xt=class{constructor(t,r,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i;}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t);}};var hr=wt.litHtmlPolyfillSupport;hr?.(et,rt),(wt.litHtmlVersions??=[]).push("3.1.4");var ge=(e,t,r)=>{let i=r?.renderBefore??t,s=i._$litPart$;if(s===void 0){let c=r?.renderBefore??null;i._$litPart$=s=new rt(t.insertBefore(Q(),c),c,void 0,r??{});}return s._$AI(e),s};var U=class extends L{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ge(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return O}};U._$litElement$=!0,U.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:U});var pr=globalThis.litElementPolyfillSupport;pr?.({LitElement:U});(globalThis.litElementVersions??=[]).push("4.0.6");var ye=e=>(t,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(e,t);}):customElements.define(e,t);};var ur={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:lt},dr=(e=ur,t,r)=>{let{kind:i,metadata:s}=r,c=globalThis.litPropertyMetadata.get(s);if(c===void 0&&globalThis.litPropertyMetadata.set(s,c=new Map),c.set(r.name,e),i==="accessor"){let{name:u}=r;return {set(g){let o=t.get.call(this);t.set.call(this,g),this.requestUpdate(u,o,e);},init(g){return g!==void 0&&this.P(u,void 0,e),g}}}if(i==="setter"){let{name:u}=r;return function(g){let o=this[u];t.call(this,g),this.requestUpdate(u,o,e);}}throw Error("Unsupported decorator location: "+i)};function T(e){return (t,r)=>typeof r=="object"?dr(e,t,r):((i,s,c)=>{let u=s.hasOwnProperty(c);return s.constructor.createProperty(c,u?{...i,wrapped:!0}:i),u?Object.getOwnPropertyDescriptor(s,c):void 0})(e,t,r)}function z(e){return T({...e,state:!0,attribute:!1})}var be={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},_e=e=>(...t)=>({_$litDirective$:e,values:t}),pt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,i){this._$Ct=t,this._$AM=r,this._$Ci=i;}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};var ve="important",mr=" !"+ve,N=_e(class extends pt{constructor(e){if(super(e),e.type!==be.ATTRIBUTE||e.name!=="style"||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,r)=>{let i=e[r];return i==null?t:t+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(e,[t]){let{style:r}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?r.removeProperty(i):r[i]=null);for(let i in t){let s=t[i];if(s!=null){this.ft.add(i);let c=typeof s=="string"&&s.endsWith(mr);i.includes("-")||c?r.setProperty(i,c?s.slice(0,-11):s,c?ve:""):r[i]=s;}}return O}});var St="https://gamma-api.polymarket.com";var Ct=async e=>{let t=e.slug?`markets/slug/${e.slug}`:`markets/${e.id}`,i=await(await fetch(`${St}/${t}`)).json();return {...i,outcomes:JSON.parse(i.outcomes),outcomePrices:JSON.parse(i.outcomePrices),clobTokenIds:i.clobTokenIds?JSON.parse(i.clobTokenIds):null}},At=async e=>{let t=e.slug?`events/slug/${e.slug}`:`events/${e.id}`,i=await(await fetch(`${St}/${t}`)).json();return {...i,markets:i.markets?.map(s=>({...s,outcomes:JSON.parse(s.outcomes),outcomePrices:JSON.parse(s.outcomePrices),clobTokenIds:s.clobTokenIds?JSON.parse(s.clobTokenIds):null}))??[]}};var It=Je(xe());var we=!1;function ot(){if(we)return;we=!0;let e=new CSSStyleSheet;e.replaceSync(`
@font-face {

@@ -27,60 +27,71 @@ font-family: "Open Sauce Sans";

font-style: normal;
}`),document.adoptedStyleSheets.push(e);};It();var ke,Ce,Se,Ae,Ee,Pe,Me,Te,Ne,He,Le,Oe,ze,Re,Ve,Ue,Fe,f,At,Et,Pt,Mt,Tt,Nt,Ht,Lt,Ot,zt,Rt,Vt,Ut,Ft,Bt;Fe=[ye("polymarket-market-embed")];var x=class extends(Ue=U,Ve=[T({type:String,attribute:"theme",reflect:!0})],Re=[T({type:Number,attribute:"width",converter:(r,i)=>{if(typeof r=="string")try{return parseInt(r,10)}catch{}return typeof r=="number"?r:400}})],ze=[T({type:String,attribute:"market"})],Oe=[T({type:String,attribute:"event"})],Le=[T({type:String,attribute:"creator"})],He=[T({type:Boolean,attribute:"volume",converter:(r,i)=>typeof r=="string"?r==="true":typeof r=="boolean"?r:!1})],Ne=[T({type:Boolean,attribute:"chart",converter:(r,i)=>typeof r=="string"?r==="true":typeof r=="boolean"?r:!1})],Te=[z()],Me=[z()],Pe=[z()],Ee=[z()],Ae=[z()],Se=[z()],Ce=[z()],ke=[z()],Ue){constructor(){super();S(this,At,y(f,8,this,"light")),y(f,11,this);S(this,Et,y(f,12,this,400)),y(f,15,this);S(this,Pt,y(f,16,this)),y(f,19,this);S(this,Mt,y(f,20,this)),y(f,23,this);S(this,Tt,y(f,24,this)),y(f,27,this);S(this,Nt,y(f,28,this,!1)),y(f,31,this);S(this,Ht,y(f,32,this,!1)),y(f,35,this);S(this,Lt,y(f,36,this)),y(f,39,this);S(this,Ot,y(f,40,this)),y(f,43,this);S(this,zt,y(f,44,this,"https://polymarket.com")),y(f,47,this);S(this,Rt,y(f,48,this)),y(f,51,this);S(this,Vt,y(f,52,this)),y(f,55,this);S(this,Ut,y(f,56,this,{container:{},cardContainer:{},title:{},button:{},volume:{},gauge:{},gaugeText:{},gaugeSubtext:{},topRightContainer:{},topRowContainer:{}})),y(f,59,this);S(this,Ft,y(f,60,this,{width:"75px",height:"50px"})),y(f,63,this);S(this,Bt,y(f,64,this,{width:"114px",height:"24px"})),y(f,67,this);It();}static get styles(){return mt`
:host {
--polymarket-color-white: #ffffff;
--polymarket-color-black: #000000;
--polymarket-color-gray-1: #333333;
--polymarket-color-gray-2: #4f4f4f;
--polymarket-color-gray-3: #828282;
--polymarket-color-gray-4: #bdbdbd;
--polymarket-color-gray-5: #e0e0e0;
--polymarket-color-gray-6: #f2f2f2;
}`),document.adoptedStyleSheets.push(e);}var ke=K`
:host {
--polymarket-color-white: #ffffff;
--polymarket-color-black: #000000;
--polymarket-color-gray-1: #333333;
--polymarket-color-gray-2: #4f4f4f;
--polymarket-color-gray-3: #828282;
--polymarket-color-gray-4: #bdbdbd;
--polymarket-color-gray-5: #e0e0e0;
--polymarket-color-gray-6: #f2f2f2;
--polymarket-radii-sm: 4px;
--polymarket-radii-md: 8px;
--polymarket-radii-lg: 12px;
--polymarket-radii-full: 50%;
--polymarket-color-red: #e64800;
--polymarket-color-green: #00b955;
--polymarket-color-neutral: #858a98;
--polymarket-space-1: 4px;
--polymarket-space-2: 8px;
--polymarket-space-3: 12px;
--polymarket-space-4: 16px;
--polymarket-color-election-red-1: #fcf2f2;
--polymarket-color-election-blue-1: #eff5f9;
--polymarket-font-size-xs: 10px;
--polymarket-font-size-sm: 11px;
--polymarket-font-size-md: 13px;
--polymarket-font-size-lg: 15px;
--polymarket-font-size-xl: 18px;
--polymarket-radii-sm: 4px;
--polymarket-radii-md: 8px;
--polymarket-radii-lg: 12px;
--polymarket-radii-xl: 16px;
--polymarket-radii-full: 50%;
--polymarket-line-height-sm: 13px;
--polymarket-line-height-md: 17px;
--polymarket-line-height-lg: 19px;
--polymarket-line-height-xl: 21px;
--polymarket-space-1: 4px;
--polymarket-space-2: 8px;
--polymarket-space-3: 12px;
--polymarket-space-4: 16px;
--polymarket-space-5: 20px;
--polymarket-font-weight-normal: 400;
--polymarket-font-weight-medium: 500;
--polymarket-font-weight-semi: 600;
--polymarket-font-weight-bold: 700;
--polymarket-font-size-xs: 10px;
--polymarket-font-size-sm: 11px;
--polymarket-font-size-md: 13px;
--polymarket-font-size-lg: 15px;
--polymarket-font-size-xl: 18px;
display: block;
width: 100%;
height: 100%;
--polymarket-line-height-sm: 13px;
--polymarket-line-height-md: 17px;
--polymarket-line-height-lg: 19px;
--polymarket-line-height-xl: 21px;
font-family: "Open Sauce Sans", sans-serif;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
--polymarket-font-weight-normal: 400;
--polymarket-font-weight-medium: 500;
--polymarket-font-weight-semi: 600;
--polymarket-font-weight-bold: 700;
:host([theme="dark"]) {
--polymarket-color-white: #1d2b39;
--polymarket-color-black: #ffffff;
--polymarket-color-gray-1: #f2f2f2;
--polymarket-color-gray-2: #858d92;
--polymarket-color-gray-3: #858d92;
--polymarket-color-gray-4: #425464;
--polymarket-color-gray-5: #344452;
--polymarket-color-gray-6: #2c3f4f;
}
display: block;
width: 100%;
height: 100%;
font-family: "Open Sauce Sans", sans-serif;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
:host([theme="dark"]) {
--polymarket-color-white: #1d2b39;
--polymarket-color-black: #ffffff;
--polymarket-color-gray-1: #f2f2f2;
--polymarket-color-gray-2: #858d92;
--polymarket-color-gray-3: #858d92;
--polymarket-color-gray-4: #425464;
--polymarket-color-gray-5: #344452;
--polymarket-color-gray-6: #2c3f4f;
}
`;var fr={0:"M5,55 A50,50 0 0 1 5,55",10:"M5,55 A50,50 0 0 1 6,45",20:"M5,55 A50,50 0 0 1 10,33.4",30:"M5,55 A50,50 0 0 1 24,16",40:"M5,55 A50,50 0 0 1 34,9.8",50:"M5,55 A50,50 0 0 1 55,5",60:"M5,55 A50,50 0 0 1 76,9.8",70:"M5,55 A50,50 0 0 1 86,16",80:"M5,55 A50,50 0 0 1 100,33.4",90:"M5,55 A50,50 0 0 1 104,45",100:"M5,55 A50,50 0 0 1 105,55"};ot();var Se,Ce,Ae,Ee,Pe,Me,Te,Ne,He,Le,Oe,ze,Ve,Re,Ue,Fe,Be,f,Et,Pt,Mt,Tt,Nt,Ht,Lt,Ot,zt,Vt,Rt,Ut,Ft,Bt,jt;Be=[ye("polymarket-market-embed")];var x=class extends(Fe=U,Ue=[T({type:String,attribute:"theme",reflect:!0})],Re=[T({type:Number,attribute:"width",converter:(r,i)=>{if(typeof r=="string")try{return parseInt(r,10)}catch{}return typeof r=="number"?r:400}})],Ve=[T({type:String,attribute:"market"})],ze=[T({type:String,attribute:"event"})],Oe=[T({type:String,attribute:"creator"})],Le=[T({type:Boolean,attribute:"volume",converter:(r,i)=>typeof r=="string"?r==="true":typeof r=="boolean"?r:!1})],He=[T({type:Boolean,attribute:"chart",converter:(r,i)=>typeof r=="string"?r==="true":typeof r=="boolean"?r:!1})],Ne=[z()],Te=[z()],Me=[z()],Pe=[z()],Ee=[z()],Ae=[z()],Ce=[z()],Se=[z()],Fe){constructor(){super();C(this,Et,y(f,8,this,"light")),y(f,11,this);C(this,Pt,y(f,12,this,400)),y(f,15,this);C(this,Mt,y(f,16,this)),y(f,19,this);C(this,Tt,y(f,20,this)),y(f,23,this);C(this,Nt,y(f,24,this)),y(f,27,this);C(this,Ht,y(f,28,this,!1)),y(f,31,this);C(this,Lt,y(f,32,this,!1)),y(f,35,this);C(this,Ot,y(f,36,this)),y(f,39,this);C(this,zt,y(f,40,this)),y(f,43,this);C(this,Vt,y(f,44,this,"https://polymarket.com")),y(f,47,this);C(this,Rt,y(f,48,this)),y(f,51,this);C(this,Ut,y(f,52,this)),y(f,55,this);C(this,Ft,y(f,56,this,{container:{},cardContainer:{},title:{},button:{},volume:{},gauge:{},gaugeText:{},gaugeSubtext:{},topRightContainer:{},topRowContainer:{}})),y(f,59,this);C(this,Bt,y(f,60,this,{width:"75px",height:"50px"})),y(f,63,this);C(this,jt,y(f,64,this,{width:"114px",height:"24px"})),y(f,67,this);ot();}static get styles(){return K`
${ke}
:host * {

@@ -313,3 +324,3 @@ box-sizing: border-box;

}
`}connectedCallback(){super.connectedCallback(),It(),this.fetchMarketData();}firstUpdated(r){super.firstUpdated(r),this.initTheme(),this.initStyles();}initTheme(){document.querySelector("html")?.setAttribute("theme",this.theme);}initStyles(){window.innerWidth<380&&(this._gaugeSvgSize={width:"60px",height:"40px"},this._logoSvgSize={width:"91px",height:"19px"}),this._styles={container:{...window.innerWidth<380&&{maxWidth:"calc(100vw - 4px)"}},cardContainer:{...window.innerWidth<380&&{padding:"12px",maxWidth:"calc(100vw - 8px)"}},title:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-md)","line-height":"var(--polymarket-line-height-md)"}},button:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-sm)","line-height":"var(--polymarket-line-height-sm)"}},volume:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-xs)","line-height":"var(--polymarket-line-height-xs)"}},gauge:{...window.innerWidth<380&&{transform:"translate(-50%, calc(-50% - 7px))"}},gaugeText:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-md)","line-height":"var(--polymarket-line-height-md)"}},gaugeSubtext:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-xs)","line-height":"var(--polymarket-line-height-xs)",top:"calc(50% + 16px)"}},topRightContainer:{...window.innerWidth<380&&{width:"60px",height:"48px"}},topRowContainer:{...window.innerWidth<380&&{height:"48px"}}};}getUtmParams(){let r="utm_medium=embed",i="&utm_campaign=market",c=`&utm_source=${window.location!=window.parent.location&&document.referrer?document.referrer:`${document.location.host}${document.location.pathname}`}`,u=this.creator?`&utm_content=${this.creator}`:"";return `${r}${i}${c}${u}`}async fetchMarketData(){if(this.marketSlug)try{let i=await Ct({slug:this.marketSlug});this._market=i;}catch{}let r=this.eventSlug??this.marketSlug;if(r&&!this._market)try{let i=await St({slug:r});if(i.markets.length===1)this._market=i.markets[0];else {let s=i.markets.find(c=>c.slug===this.marketSlug);s?this._market=s:i.markets.length>0&&(this._market=i.markets[0]);}}catch{}if(this._market){let i=this.getUtmParams();this._baseHref=`https://polymarket.com?${i}`,this._href=this._market.events?.length&&this._market.events[0]?.slug?`https://polymarket.com/event/${this._market.events[0].slug}/${this._market.slug}?${i}`:`https://polymarket.com/market/${this._market.slug}?${i}`;let s=this._market.outcomePrices[0]?parseFloat(this._market.outcomePrices[0]):0,c=Math.min(Math.max(s*100,0),100),g=[0,10,20,30,40,50,60,70,80,90,100].sort((o,n)=>Math.abs(o-c)-Math.abs(n-c))[0];this._probability=c,this._fillPathD=mr[g.toFixed(0)];}}render(){return this._market?wt` <div class="container">
`}connectedCallback(){super.connectedCallback(),ot(),this.fetchMarketData();}firstUpdated(r){super.firstUpdated(r),this.initTheme(),this.initStyles();}initTheme(){document.querySelector("html")?.setAttribute("theme",this.theme);}initStyles(){window.innerWidth<380&&(this._gaugeSvgSize={width:"60px",height:"40px"},this._logoSvgSize={width:"91px",height:"19px"}),this._styles={container:{...window.innerWidth<380&&{maxWidth:"calc(100vw - 4px)"}},cardContainer:{...window.innerWidth<380&&{padding:"12px",maxWidth:"calc(100vw - 8px)"}},title:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-md)","line-height":"var(--polymarket-line-height-md)"}},button:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-sm)","line-height":"var(--polymarket-line-height-sm)"}},volume:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-xs)","line-height":"var(--polymarket-line-height-xs)"}},gauge:{...window.innerWidth<380&&{transform:"translate(-50%, calc(-50% - 7px))"}},gaugeText:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-md)","line-height":"var(--polymarket-line-height-md)"}},gaugeSubtext:{...window.innerWidth<380&&{"font-size":"var(--polymarket-font-size-xs)","line-height":"var(--polymarket-line-height-xs)",top:"calc(50% + 16px)"}},topRightContainer:{...window.innerWidth<380&&{width:"60px",height:"48px"}},topRowContainer:{...window.innerWidth<380&&{height:"48px"}}};}getUtmParams(){let r="utm_medium=embed",i="&utm_campaign=market",c=`&utm_source=${window.location!=window.parent.location&&document.referrer?document.referrer:`${document.location.host}${document.location.pathname}`}`,u=this.creator?`&utm_content=${this.creator}`:"";return `${r}${i}${c}${u}`}async fetchMarketData(){if(this.marketSlug)try{let i=await Ct({slug:this.marketSlug});this._market=i;}catch{}let r=this.eventSlug??this.marketSlug;if(r&&!this._market)try{let i=await At({slug:r});if(i.markets.length===1)this._market=i.markets[0];else {let s=i.markets.find(c=>c.slug===this.marketSlug);s?this._market=s:i.markets.length>0&&(this._market=i.markets[0]);}}catch{}if(this._market){let i=this.getUtmParams();this._baseHref=`https://polymarket.com?${i}`,this._href=this._market.events?.length&&this._market.events[0]?.slug?`https://polymarket.com/event/${this._market.events[0].slug}/${this._market.slug}?${i}`:`https://polymarket.com/market/${this._market.slug}?${i}`;let s=this._market.outcomePrices[0]?parseFloat(this._market.outcomePrices[0]):0,c=Math.min(Math.max(s*100,0),100),g=[0,10,20,30,40,50,60,70,80,90,100].sort((o,n)=>Math.abs(o-c)-Math.abs(n-c))[0];this._probability=c,this._fillPathD=fr[g.toFixed(0)];}}render(){return this._market?kt` <div class="container">
<div

@@ -373,3 +384,3 @@ class="card-container"

>
${(0, jt.default)(this._probability).format("0")}%
${(0, It.default)(this._probability).format("0")}%
</p>

@@ -416,6 +427,6 @@ <p

<p
class="typography-secondary typography-number"
class="typography-secondary"
style=${N(this._styles.volume)}
>
${this.showVolume?`${(0, jt.default)(this._market.volumeNum).format("0.[0]a")}`:""}
${this.showVolume?`${(0, It.default)(this._market.volumeNum).format("0.[0]a")}`:""}
<span style="text-transform: capitalize;"

@@ -448,3 +459,3 @@ >${this.showVolume?"Vol.":""}</span

</div>
</div>`:wt` <span>${" "}</span> `}};f=Xt(Ue),At=new WeakMap,Et=new WeakMap,Pt=new WeakMap,Mt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Ht=new WeakMap,Lt=new WeakMap,Ot=new WeakMap,zt=new WeakMap,Rt=new WeakMap,Vt=new WeakMap,Ut=new WeakMap,Ft=new WeakMap,Bt=new WeakMap,C(f,4,"theme",Ve,x,At),C(f,4,"width",Re,x,Et),C(f,4,"marketSlug",ze,x,Pt),C(f,4,"eventSlug",Oe,x,Mt),C(f,4,"creator",Le,x,Tt),C(f,4,"showVolume",He,x,Nt),C(f,4,"showChart",Ne,x,Ht),C(f,4,"_market",Te,x,Lt),C(f,4,"_href",Me,x,Ot),C(f,4,"_baseHref",Pe,x,zt),C(f,4,"_probability",Ee,x,Rt),C(f,4,"_fillPathD",Ae,x,Vt),C(f,4,"_styles",Se,x,Ut),C(f,4,"_gaugeSvgSize",Ce,x,Ft),C(f,4,"_logoSvgSize",ke,x,Bt),x=C(f,0,"MarketEmbed",Fe,x),y(f,1,x);customElements.get("polymarket-market-embed")||customElements.define("polymarket-market-embed",x);/*! Bundled license information:
</div>`:kt` <span>${" "}</span> `}};f=Xt(Fe),Et=new WeakMap,Pt=new WeakMap,Mt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Ht=new WeakMap,Lt=new WeakMap,Ot=new WeakMap,zt=new WeakMap,Vt=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,Ft=new WeakMap,Bt=new WeakMap,jt=new WeakMap,S(f,4,"theme",Ue,x,Et),S(f,4,"width",Re,x,Pt),S(f,4,"marketSlug",Ve,x,Mt),S(f,4,"eventSlug",ze,x,Tt),S(f,4,"creator",Oe,x,Nt),S(f,4,"showVolume",Le,x,Ht),S(f,4,"showChart",He,x,Lt),S(f,4,"_market",Ne,x,Ot),S(f,4,"_href",Te,x,zt),S(f,4,"_baseHref",Me,x,Vt),S(f,4,"_probability",Pe,x,Rt),S(f,4,"_fillPathD",Ee,x,Ut),S(f,4,"_styles",Ae,x,Ft),S(f,4,"_gaugeSvgSize",Ce,x,Bt),S(f,4,"_logoSvgSize",Se,x,jt),x=S(f,0,"MarketEmbed",Be,x),y(f,1,x);customElements.get("polymarket-market-embed")||customElements.define("polymarket-market-embed",x);/*! Bundled license information:

@@ -451,0 +462,0 @@ numeral/numeral.js:

export { MarketEmbed } from './embeds/market/index.js';
export { ElectionEmbed } from './embeds/election/index.js';
import 'lit-html';
import 'lit';
import './embeds/election/constants.js';
{
"name": "@polymarket/embeds",
"version": "1.0.11",
"version": "1.1.0",
"description": "Web Components for Polymarket",

@@ -5,0 +5,0 @@ "type": "module",

@@ -112,2 +112,3 @@ type SingleMarketUpdate = `${number}-${string}`;

outcomePrices: string[];
oneDayPriceChange?: number | null;
volume: string;

@@ -119,9 +120,9 @@ volume_num: number;

format_type:
| "normal"
| "decimal"
| "date"
| "number"
| "percent"
| "eth"
| null;
| "normal"
| "decimal"
| "date"
| "number"
| "percent"
| "eth"
| null;
lower_bound_date: null;

@@ -128,0 +129,0 @@ upper_bound_date: null;

@@ -7,2 +7,4 @@ import { css, LitElement, html, CSSResult, PropertyValues } from "lit";

import numeral from "numeral";
import loadFonts from "../../common/loadFonts.js";
import { cssVarStyling } from "../../common/styles.js";

@@ -23,41 +25,2 @@ const VALUE_TO_PATH_MAP = {

let hasLoadedMaterialSymbolsFont = false;
/**
* Loads local fonts.
*/
const loadFonts = () => {
if (hasLoadedMaterialSymbolsFont) {
return;
}
hasLoadedMaterialSymbolsFont = true;
const fontSheet = new CSSStyleSheet();
fontSheet.replaceSync(`
@font-face {
font-family: "Open Sauce Sans";
src: url("https://unpkg.com/@polymarket/embeds@latest/dist/fonts/OpenSauceSans-Regular.ttf") format("truetype");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Open Sauce Sans";
src: url("https://unpkg.com/@polymarket/embeds@latest/dist/fonts/OpenSauceSans-Medium.ttf") format("truetype");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "Open Sauce Sans";
src: url("https://unpkg.com/@polymarket/embeds@latest/dist/fonts/OpenSauceSans-SemiBold.ttf") format("truetype");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "Open Sauce Sans";
src: url("https://unpkg.com/@polymarket/embeds@latest/dist/fonts/OpenSauceSans-Bold.ttf") format("truetype");
font-weight: 700;
font-style: normal;
}`);
document.adoptedStyleSheets.push(fontSheet);
};
loadFonts(); /* eagerly load fonts */

@@ -69,59 +32,4 @@

return css`
:host {
--polymarket-color-white: #ffffff;
--polymarket-color-black: #000000;
--polymarket-color-gray-1: #333333;
--polymarket-color-gray-2: #4f4f4f;
--polymarket-color-gray-3: #828282;
--polymarket-color-gray-4: #bdbdbd;
--polymarket-color-gray-5: #e0e0e0;
--polymarket-color-gray-6: #f2f2f2;
${cssVarStyling}
--polymarket-radii-sm: 4px;
--polymarket-radii-md: 8px;
--polymarket-radii-lg: 12px;
--polymarket-radii-full: 50%;
--polymarket-space-1: 4px;
--polymarket-space-2: 8px;
--polymarket-space-3: 12px;
--polymarket-space-4: 16px;
--polymarket-font-size-xs: 10px;
--polymarket-font-size-sm: 11px;
--polymarket-font-size-md: 13px;
--polymarket-font-size-lg: 15px;
--polymarket-font-size-xl: 18px;
--polymarket-line-height-sm: 13px;
--polymarket-line-height-md: 17px;
--polymarket-line-height-lg: 19px;
--polymarket-line-height-xl: 21px;
--polymarket-font-weight-normal: 400;
--polymarket-font-weight-medium: 500;
--polymarket-font-weight-semi: 600;
--polymarket-font-weight-bold: 700;
display: block;
width: 100%;
height: 100%;
font-family: "Open Sauce Sans", sans-serif;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
:host([theme="dark"]) {
--polymarket-color-white: #1d2b39;
--polymarket-color-black: #ffffff;
--polymarket-color-gray-1: #f2f2f2;
--polymarket-color-gray-2: #858d92;
--polymarket-color-gray-3: #858d92;
--polymarket-color-gray-4: #425464;
--polymarket-color-gray-5: #344452;
--polymarket-color-gray-6: #2c3f4f;
}
:host * {

@@ -604,5 +512,5 @@ box-sizing: border-box;

VALUE_TO_PATH_MAP[
closestToSafeValue.toFixed(
0,
) as keyof typeof VALUE_TO_PATH_MAP
closestToSafeValue.toFixed(
0,
) as keyof typeof VALUE_TO_PATH_MAP
];

@@ -629,3 +537,3 @@ }

src="${this._market.imageOptimized
?.imageUrlSource ?? this._market.image}"
?.imageUrlSource ?? this._market.image}"
alt="icon"

@@ -669,4 +577,4 @@ />

stroke="${(this._probability ?? 0) < 50
? "#E64800"
: "#00B955"}"
? "#E64800"
: "#00B955"}"
stroke-width="8.5"

@@ -722,10 +630,10 @@ />

<p
class="typography-secondary typography-number"
class="typography-secondary"
style=${styleMap(this._styles.volume)}
>
${this.showVolume
? `${numeral(this._market.volumeNum).format(
"0.[0]a",
)}`
: ""}
? `${numeral(this._market.volumeNum).format(
"0.[0]a",
)}`
: ""}
<span style="text-transform: capitalize;"

@@ -732,0 +640,0 @@ >${this.showVolume ? "Vol." : ""}</span

export { MarketEmbed } from "./embeds/market/index.js";
export { ElectionEmbed } from "./embeds/election/index.js";

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc