1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405],{27484:function(e){var n,r,s,i,a,u,o,c,f,p,g,v,m,x,w,_,S,j,b,k,N,O;e.exports=(n="millisecond",r="second",s="minute",i="hour",a="week",u="month",o="quarter",c="year",f="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=function(e,n,r){var s=String(e);return!s||s.length>=n?e:""+Array(n+1-s.length).join(r)+e},(w={})[x="en"]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],r=e%100;return"["+e+(n[(r-20)%10]||n[r]||"th")+"]"}},_="$isDayjsObject",S=function(e){return e instanceof N||!(!e||!e[_])},j=function t(e,n,r){var s;if(!e)return x;if("string"==typeof e){var i=e.toLowerCase();w[i]&&(s=i),n&&(w[i]=n,s=i);var a=e.split("-");if(!s&&a.length>1)return t(a[0])}else{var u=e.name;w[u]=e,s=u}
1return!r&&s&&(x=s),s||!r&&x},b=function(e,n){if(S(e))return e.clone();var r="object"==typeof n?n:{};return r.date=e,r.args=arguments,new N(r)},(k={s:m,z:function(e){var n=-e.utcOffset(),r=Math.abs(n);return(n<=0?"+":"-")+m(Math.floor(r/60),2,"0")+":"+m(r%60,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),s=e.clone().add(r,u),i=n-s<0,a=e.clone().add(r+(i?-1:1),u);return+(-(r+(n-s)/(i?s-a:a-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return({M:u,y:c,w:a,d:"day",D:f,h:i,m:s,s:r,ms:n,Q:o})[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}}).l=j,k.i=S,k.w=function(e,n){return b(e,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})},O=(N=function(){function M(e){this.$L=j(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[_]=!0}var e=M.prototype;return e.parse=function(e){this.$d=function(e){var n=e.date,r=e.utc;if(null===n)return new Date(NaN);if(k.u(n))return new Date;if(n instanceof Date)return new Date(n);if("string"==typeof n&&!/Z$/i.test(n)){var s=n.match(g);if(s){var i=s[2]-1||0,a=(s[7]||"0").substring(0,3);return r?new Date(Date.UTC(s[1],i,s[3]||1,s[4]||0,s[5]||0,s[6]||0,a)):new Date(s[1],i,s[3]||1,s[4]||0,s[5]||0,s[6]||0,a)}}return new Date(n)}(e),this.init()},e.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},e.$utils=function(){return k},e.isValid=function(){return this.$d.toString()!==p},e.isSame=function(e,n){var r=b(e);return this.startOf(n)<=r&&r<=this.endOf(n)},e.isAfter=function(e,n){return b(e)<this.startOf(n)},e.isBefore=function(e,n){return this.endOf(n)<b(e)},e.$g=function(e,n,r){return k.u(e)?this[n]:this.set(r,e)},e.unix=function(){return Math.floor(this.valueOf()/1e3)},e.valueOf=function(){return this.$d.getTime()},e.startOf=function(e,n){var o=this,p=!!k.u(n)||n,g=k.p(e),l=function(e,n){var r=k.w(o.$u?Date.UTC(o.$y,n,e):new Date(o.$y,n,e),o);return p?r:r.endOf("day")},$=function(e,n){return k.w(o.toDate()[e].apply(o.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(n)),o)},v=this.$W,m=this.$M,x=this.$D,w="set"+(this.$u?"UTC":"");switch(g){case c:return p?l(1,0):l(31,11);case u:return p?l(1,m):l(0,m+1);case a:var _=this.$locale().weekStart||0,S=(v<_?v+7:v)-_;return l(p?x-S:x+(6-S),m);case"day":case f:return $(w+"Hours",0);case i:return $(w+"Minutes",1);case s:return $(w+"Seconds",2);case r:return $(w+"Milliseconds",3);default:return this.clone()}},e.endOf=function(e){return this.startOf(e,!1)},e.$set=function(e,a){var o,p=k.p(e),g="set"+(this.$u?"UTC":""),v=((o={}).day=g+"Date",o[f]=g+"Date",o[u]=g+"Month",o[c]=g+"FullYear",o[i]=g+"Hours",o[s]=g+"Minutes",o[r]=g+"Seconds",o[n]=g+"Milliseconds",o)[p],m="day"===p?this.$D+(a-this.$W):a;if(p===u||p===c){var x=this.clone().set(f,1);x.$d[v](m),x.init(),this.$d=x.set(f,Math.min(this.$D,x.daysInMonth())).$d}else v&&this.$d[v](m);return this.init(),this},e.set=function(e,n){return this.clone().$set(e,n)},e.get=function(e){return this[k.p(e)]()},e.add=function(e,n){var o,f=this;e=Number(e);var p=k.p(n),y=function(n){var r=b(f);return k.w(r.date(r.date()+Math.round(n*e)),f)};if(p===u)return this.set(u,this.$M+e);if(p===c)return this.set(c,this.$y+e);if("day"===p)return y(1);if(p===a)return y(7);var g=((o={})[s]=6e4,o[i]=36e5,o[r]=1e3,o)[p]||1,v=this.$d.getTime()+e*g;return k.w(v,this)},e.subtract=function(e,n){return this.add(-1*e,n)},e.format=function(e){var n=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var s=e||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),a=this.$H,u=this.$m,o=this.$M,c=r.weekdays,f=r.months,g=r.meridiem,h=function(e,r,i,a){return e&&(e[r]||e(n,s))||i[r].slice(0,a)},d=function(e){return k.s(a%12||12,e,"0")},m=g||function(e,n,r){var s=e<12?"AM":"PM";return r?s.toLowerCase():s};return s.replace(v,function(e,s){return s||function(e){switch(e){case"YY":return String(n.$y).slice(-2);case"YYYY":return k.s(n.$y,4,"0");case"M":return o+1;case"MM":return k.s(o+1,2,"0");case"MMM":return h(r.monthsShort,o,f,3);case"MMMM":return h(f,o);case"D":return n.$D;case"DD":return k.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return h(r.weekdaysMin,n.$W,c,2);case"ddd":return h(r.weekdaysShort,n.$W,c,3);case"dddd":return c[n.$W];case"H":return String(a);case"HH":return k.s(a,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return m(a,u,!0);case"A":return m(a,u,!1);case"m":return String(u);case"mm":return k.s(u,2,"0");case"s":return String(n.$s);case"ss":return k.s(n.$s,2,"0");case"SSS":return k.s(n.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})},e.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},e.diff=function(e,n,f){var p,g=this,v=k.p(n),m=b(e),x=(m.utcOffset()-this.utcOffset())*6e4,w=this-m,D=function(){return k.m(g,m)};switch(v){case c:p=D()/12;break;case u:p=D();break;case o:p=D()/3;break;case a:p=(w-x)/6048e5;break;case"day":p=(w-x)/864e5;break;case i:p=w/36e5;break;case s:p=w/6e4;break;case r:p=w/1e3;break;default:p=w}return f?p:k.a(p)},e.daysInMonth=function(){return this.endOf(u).$D},e.$locale=function(){return w[this.$L]},e.locale=function(e,n){if(!e)return this.$L;var r=this.clone(),s=j(e,n,!0);return s&&(r.$L=s),r},e.clone=function(){return k.w(this.$d,this)},e.toDate=function(){return new Date(this.valueOf())},e.toJSON=function(){return this.isValid()?this.toISOString():null},e.toISOString=function(){return this.$d.toISOString()},e.toString=function(){return this.$d.toUTCString()},M}()).prototype,b.prototype=O,[["$ms",n],["$s",r],["$m",s],["$H",i],["$W","day"],["$M",u],["$y",c],["$D",f]].forEac
1h(function(e){O[e[1]]=function(n){return this.$g(n,e[0],e[1])}}),b.extend=function(e,n){return e.$i||(e(n,N,b),e.$i=!0),b},b.locale=j,b.isDayjs=S,b.unix=function(e){return b(1e3*e)},b.en=w[x],b.Ls=w,b.p={},b)},75557:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return r(27052)}])},27052:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSP:function(){return _},default:function(){return Home}});var s=r(85893),i=r(9669),a=r.n(i),u=r(27484),o=r.n(u),c=r(67294),f=r(22497),p=r(48735),g=r(99453),v=r(33959),m=r.n(v),x=r(18498),w=r.n(x),_=!0;function Home(e){let[n,r]=(0,c.useState)(e.defaultPages),i=(0,c.useContext)(g.uR),a=(0,s.jsx)(ProposalsContent,{...e,pages:n,setPages:r});return i?a:(0,s.jsxs)(f.Z,{children:[(0,s.jsx)("div",{className:m().head,children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Vote By Signature"}),(0,s.jsx)("div",{children:(0,s.jsx)("p",{children:"Voting by signature lets you place votes across Compound Governance proposals, without having to send your transactions on-chain, saving fees."})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:n.entries}),(0,s.jsx)("h3",{children:"Total Proposals"})]})]})}),(0,s.jsxs)("div",{className:m().body,children:[a,(0,s.jsx)(p.Z,{})]})]})}function ProposalsContent(e){let{defaultProposals:n,pages:r,setPages:i}=e,[u,f]=(0,c.useState)(!1),[p,v]=(0,c.useState)(n),[x,_]=(0,c.useState)({id:null,type:null}),{address:S,authenticate:j}=g.$_.useContainer(),{voteFor:b,voteAgainst:k,voteAbstain:N}=g.Ns.useContainer(),firstUppercase=e=>"string"!=typeof e?"":e.charAt(0).toUpperCase()+e.slice(1),getNextPage=async()=>{f(!0);let e="/api/governance/proposals?page_size=10&get_state_times=true&page_number=".concat(r.current+1),n=await a().get(e);v([...p,...n.data.proposals]),i(e=>({...e,current:e.current+1})),f(!1)},voteWithLoading=async(e,n)=>{_({id:e,type:n});try{switch(Number(n)){case 0:await b(e);break;case 1:await k(e);break;default:await N(e)}}catch(e){_({id:null,type:null})}_({id:null,type:null})};return(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:m().card,children:[(0,s.jsx)("div",{children:(0,s.jsx)("h4",{children:"Recent Proposals"})}),(0,s.jsx)("div",{children:p.map((e,n)=>(0,s.jsxs)("div",{className:m().proposal,children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h4",{children:[e.title.split(" ").splice(0,9).join(" "),e.title.split(" ").length>10?"...":""]}),(0,s.jsxs)("span",{children:[e.id," ⢠",firstUppercase(e.state.value)," ",o().unix(e.state.start_time).format("MMMM D, YYYY")]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("button",{onClick:()=>{console.log(e),window.open(e.tally_url,"_blank")},className:m().info,children:"Info"}),"Active"===e.state.value?S?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>voteWithLoading(e.id,0),className:m().for,children:x.id===e.id&&0===x.type?(0,s.jsx)(w(),{size:6}):"Vote For"}),(0,s.jsx)("button",{onClick:()=>voteWithLoading(e.id,1),className:m().against,children:x.id===e.id&&1===x.type?(0,s.jsx)(w(),{size:6}):"Vote Against"}),(0,s.jsx)("button",{onClick:()=>voteWithLoading(e.id,2),className:m().abstain,children:x.id===e.id&&2===x.type?(0,s.jsx)(w(),{size:6}):"Abstain"})]}):(0,s.jsx)("button",{className:m().info,onClick:j,children:"Authenticate to vote"}):null]})]},n))}),r.current<r.max?(0,s.jsx)("div",{className:m().cardMore,children:(0,s.jsx)("button",{onClick:getNextPage,disabled:u,children:u?"Loading...":"Load More Proposals"})}):null]})})}}},function(e){e.O(0,[2171,664,8621,9774,2888,179],function(){return e(e.s=75557)}),_N_E=e.O()}]);
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.