PageSourceSearch

https://nfthive.io/_next/static/chunks/pages/airdrops/new-16d54494a7056c32.js

js nfthive.io collected 2026-09-25 18:39:56 UTC 17,362 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8281],{31812:function(e,r,t){"use strict";t.d(r,{Z:function(){return S}});var n=t(63366),i=t(87462),a=t(67294),o=t(98216),s=t(27909),c=t(94780),l=t(90948),d=t(71657),u=t(83321),p=t(98456),h=t(34867),m=t(1588);function f(e){return(0,h.Z)("MuiLoadingButton",e)}let _=(0,m.Z)("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]);var v=t(85893);let x=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],g=e=>{let{loading:r,loadingPosition:t,classes:n}=e,a={root:["root",r&&"loading"],startIcon:[r&&`startIconLoading${(0,o.Z)(t)}`],endIcon:[r&&`endIconLoading${(0,o.Z)(t)}`],loadingIndicator:["loadingIndicator",r&&`loadingIndicator${(0,o.Z)(t)}`]},s=(0,c.Z)(a,f,n);return(0,i.Z)({},n,s)},y=e=>"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e&&"classes"!==e,w=(0,l.ZP)(u.Z,{shouldForwardProp:e=>y(e)||"classes"===e,name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,r)=>[r.root,r.startIconLoadingStart&&{[`& .${_.startIconLoadingStart}`]:r.startIconLoadingStart},r.endIconLoadingEnd&&{[`& .${_.endIconLoadingEnd}`]:r.endIconLoadingEnd}]})(({ownerState:e,theme:r})=>(0,i.Z)({[`& .${_.startIconLoadingStart}, & .${_.endIconLoadingEnd}`]:{transition:r.transitions.create(["opacity"],{duration:r.transitions.duration.short}),opacity:0}},"center"===e.loadingPosition&&{transition:r.transitions.create(["background-color","box-shadow","border-color"],{duration:r.transitions.duration.short}),[`&.${_.loading}`]:{color:"transparent"}},"start"===e.loadingPosition&&e.fullWidth&&{[`& .${_.startIconLoadingStart}, & .${_.endIconLoadingEnd}`]:{transition:r.transitions.create(["opacity"],{duration:r.transitions.duration.short}),opacity:0,marginRight:-8}},"end"===e.loadingPosition&&e.fullWidth&&{[`& .${_.startIconLoadingStart}, & .${_.endIconLoadingEnd}`]:{transition:r.transitions.create(["opacity"],{duration:r.transitions.duration.short}),opacity:0,marginLeft:-8}})),j=(0,l.ZP)("div",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,r)=>{let{ownerState:t}=e;return[r.loadingIndicator,r[`loadingIndicator${(0,o.Z)(t.loadingPosition)}`]]}})(({theme:e,ownerState:r})=>(0,i.Z)({position:"absolute",visibility:"visible",display:"flex"},"start"===r.loadingPosition&&("outlined"===r.variant||"contained"===r.variant)&&{left:"small"===r.size?10:14},"start"===r.loadingPosition&&"text"===r.variant&&{left:6},"center"===r.loadingPosition&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},"end"===r.loadingPosition&&("outlined"===r.variant||"contained"===r.variant)&&{right:"small"===r.size?10:14},"end"===r.loadingPosition&&"text"===r.variant&&{right:6},"start"===r.loadingPosition&&r.fullWidth&&{position:"relative",left:-10},"end"===r.loadingPosition&&r.fullWidth&&{position:"relative",right:-10})),b=a.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"MuiLoadingButton"}),{children:a,disabled:o=!1,id:c,loading:l=!1,loadingIndicator:u,loadingPosition:h="center",variant:m="text"}=t,f=(0,n.Z)(t,x),_=(0,s.Z)(c),y=null!=u?u:(0,v.jsx)(p.Z,{"aria-labelledby":_,color:"inherit",size:16}),b=(0,i.Z)({},t,{disabled:o,loading:l,loadingIndicator:y,loadingPosition:h,variant:m}),S=g(b),I=l?(0,v.jsx)(j,{className:S.loadingIndicator,ownerState:b,children:y}):null;return(0,v.jsxs)(w,(0,i.Z)({disabled:o||l,id:_,ref:r},f,{variant:m,classes:S,ownerState:b,children:["end"===b.loadingPosition?a:I,"end"===b.loadingPosition?I:a]}))});var S=b},79730:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/airdrops/new",function(){return t(13732)}])},13732:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return F}});var n=t(30137),i=t(76341),a=t(67462),o=t(98732),s=t(97582),c=t(85893),l=t(31812),d=t(46901),u=t(57922),p=t(81458),h=t(67294),m=t(22120);t(8443);var f=t(69596),_=t(48528),v=t(65908),x=t(23010),g=t(85754),y=t(8163),w=t(70416),j=t(49785),b=t(67037),S=t(90837),I=t(87726),N=t(18266),Z=t(26322),C=function(e){var r=e.airdropCurrency,t=e.setAirdropCurrency,n=e.holderCurrencyMin,a=e.holderCurrencyMax,o=e.setHolderCurrencyMin,s=e.setHolderCurrencyMax,l=e.currencies,u=e.fees,p=(0,m.$G)("common").t;return(0,h.useEffect)(function(){},[n.price,a.price,r.price]),(0,c.jsxs)(b.J,{id:"DropAmountEditor",title:p("airdrops.token_details"),error:n.price>a.price>0&&0!==parseInt(a.price),children:[(0,c.jsx)("div",{className:"my-auto",children:p("airdrops.select_token_to_airdrop")}),(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:"flex flex-row my-5 md:gap-4 gap-2",children:[(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(S.Y,{size:"sm",classNames:(0,i._)({},Z.TL),variant:"faded",label:p("airdrops.amount_to_airdrop"),placeholder:"0",defaultValue:r.price,required:!0,type:"number",onWheel:function(e){return e.target.blur()},isInvalid:r.price<0,onChange:function(e){var n={};
1n.currency=r.currency,n.contract=r.contract,n.price=Math.max(0,e.target.value),t(n)}})}),(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(I.g,{size:"sm",scrollShadowProps:{hideScrollBar:!1},id:"DropdownField10",variant:"faded",placeholder:p("drops.select_a_currency"),className:"w-full",classNames:(0,i._)({},Z.XO),defaultSelectedKeys:new Set(["8,USD,USD,eosio.token"!==r.currency?r.currency+","+r.contract:"8,WAX,USD,eosio.token"]),label:p("search.currency"),onChange:function(e){var n={};n.price=r.price;var i=e.target.value.split(",");n.currency=i[0]+","+i[1]+","+i[2],n.contract=i[3],t(n)},children:l.sort(y.l).map(function(e){return"USD"!==e.label?(0,c.jsx)(N.R,{value:e.symbol+","+e.label+","+e.contract,children:"".concat(e.label," (").concat(e.contract,")")},e.symbol+","+e.label+","+e.contract):null})})})]})}),(0,c.jsx)(_.C,{condition:r.price>0,severity:"warning",children:p("airdrops.this_transfers_x_and_y_to_wufclaimtool",{x:(0,y.xG)(r.price,parseInt(r.currency.split(",")[0]),!0,r.currency.split(",")[1]),y:u?(0,y.xG)(u.split(" ")[0],u.split(" ")[0].split(".")[1].length,!0,u.split(" ")[1]):"50000000.0000 WUF"})}),(0,c.jsx)("div",{className:"mt-4",children:p("airdrops.select_token_to_hold")}),(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:"flex flex-row my-5 md:gap-4 gap-2",children:[(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(S.Y,{size:"sm",classNames:(0,i._)({},Z.TL),variant:"faded",label:p("airdrops.min_amount_to_hold"),placeholder:"0",defaultValue:n.price,required:!0,type:"number",onWheel:function(e){return e.target.blur()},isInvalid:n.price<0,onChange:function(e){var r={};r.price=Math.max(0,e.target.value),r.currency=n.currency,r.contract=n.contract,o(r)}})}),(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(S.Y,{size:"sm",classNames:(0,i._)({},Z.TL),variant:"faded",label:p("airdrops.max_amount_to_hold"),placeholder:"0",defaultValue:a.price,required:!0,type:"number",onWheel:function(e){return e.target.blur()},isInvalid:a.price<0,onChange:function(e){var r={};r.price=Math.max(0,e.target.value),r.currency=a.currency,r.contract=a.contract,s(r)}})}),(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(I.g,{size:"sm",scrollShadowProps:{hideScrollBar:!1},id:"DropdownField10",variant:"faded",placeholder:p("drops.select_a_currency"),className:"w-full",classNames:(0,i._)({},Z.XO),defaultSelectedKeys:new Set(["8,USD,USD,eosio.token"!==n.currency?n.currency+","+n.contract:"8,WAX,USD,eosio.token"]),label:p("search.currency"),onChange:function(e){var r={},t=e.target.value.split(",");r.price=n.price;var i={};i.price=a.price,r.currency=t[0]+","+t[1]+","+t[2],i.currency=t[0]+","+t[1]+","+t[2],r.contract=t[3],i.contract=t[3],o(r),s(i)},children:l.sort(y.l).map(function(e){return"USD"!==e.label?(0,c.jsx)(N.R,{value:e.symbol+","+e.label+","+e.contract,children:"".concat(e.label," (").concat(e.contract,")")},e.symbol+","+e.label+","+e.contract):null})})})]})}),(0,c.jsx)(_.C,{condition:n.price>0&&0===a.price,severity:"warning",children:p("airdrops.for_holders_of_x",{x:(0,y.xG)(n.price,parseInt(n.currency.split(",")[0]),!0,n.currency.split(",")[1])})}),(0,c.jsx)(_.C,{condition:n.price>0&&a.price>0,severity:"warning",children:p("airdrops.for_holders_of_x_snapshot_capped_at_y",{x:(0,y.xG)(n.price,parseInt(n.currency.split(",")[0]),!0,n.currency.split(",")[1]),y:(0,y.xG)(a.price,parseInt(a.currency.split(",")[0]),!0,a.currency.split(",")[1])})}),(0,c.jsx)(_.C,{condition:!(null==n?void 0:n.price)||n.price>a.price>0&&0!==parseInt(a.price),severity:"error",children:p("airdrops.min_amount_must_less_or_equal_to_max_amount")}),(0,c.jsxs)(d.Z,{severity:"info",children:[p("airdrops.token_not_found_visit"),":"," ",(0,c.jsx)(f.Z,{href:"https://discord.com/channels/806257237705621514/905191562990977024",external:!0,children:(0,c.jsx)("div",{className:"my-auto text-primary group-hover:underline",children:"https://discord.com/channels/806257237705621514/905191562990977024"})})]})]})},D=t(3202),P=t(61903),k=t(53457),E=t(50480),L=t(45843),W=t(52359),U=t(33988),M=t(90607),q=function(e){var r=e.snapshotDate,t=e.setSnapshotDate,n=(0,o._)((0,h.useState)(!1),2),a=n[0],s=n[1],l=(0,m.$G)("common").t;return(0,c.jsxs)(b.J,{id:"AirDropStartEndDateEditor",title:l("airdrops.snapshot_time"),error:!(0,g._q)(!0,r),children:[(0,c.jsx)("div",{className:"my-5",children:(0,c.jsx)("div",{className:"flex flex-wrap w-full mb-5",children:(0,c.jsx)(u.Z,{in:!0,children:(0,c.jsx)("div",{children:(0,c.jsx)(W._,{dateAdapter:M.H,children:(0,c.jsx)(U.x,{label:l("airdrops.snapshot_time"),value:r,onChange:function(e){return t(new Date(e.setSeconds(0)))},ampm:!a,minDateTime:new Date,renderInput:function(e){return(0,c.jsx)(P.Z,(0,i._)({},e))}})})})})})}),(0,c.jsx)(u.Z,{in:!0,children:(0,c.jsx)("div",{className:"mb-5",children:(0,c.jsx)(k.Z,{children:(0,c.jsx)(E.Z,{control:(0,c.jsx)(L.Z,{checked:a,onChange:function(){s(!a)}}),label:"Use 24-hour format"})})})}),(0,c.jsx)(u.Z,{in:!(0,g._q)(!0,r),children:(0,c.jsx)("div",{className:"mb-5",children:(0,c.jsx)(d.Z,{severity:"error",children:l("drops.the_start_date_must_be_in_the_future")})})})]})},z=t(59455),$=t(32747),A=t(14503),F=function(e){var r,t,b,S=(0,o._)((0,j.Oc)(),1)[0],I=null==S?void 0:S.activeUser,N=(null==I?void 0:I.accountName)?null==S?void 0:S.activeUser.accountName:null,Z=(0,o._)((0,h.useState)(null),2),P=Z[0],k=Z[1],E=(0,o._)((0,h.useState)({currency:"8,WAX,WAX",price:0,contract:"eosio.token"}),2),L=E[0],W=E[1],U=(0,o._)((0,h.useState)({currency:"4,WUF,WUF",price:1,contract:"wuffi"}),2),M=U[0],F=U[1],G=(0,o._)((0,h.useState)({currency:"4,WUF,WUF",price:0,contract:"wuffi"}),2),T=G[0],B=G[1],O=(0,o._)((0,h.useState)("50000000.0000 WUF"),2),X=O[0],H=O[1],J=(0,o._)((0,h.useState)(""),2),R=J[0],V=J[1],Y=(0,o._)((0,h.useState)(""),2),K=Y[0],Q=Y[1],ee=(0,o._)((0,h.useState)(new Date),2),er=ee[0],et=ee[1],en=(0,o._)((0,h.useState)([]),2),ei=en[0],ea=en[1],eo=(0,o._)((0,h.useState)(null),2),es=eo[0],ec=eo[1],el=(0,o._)((0,h.useState)(null),2),ed=el[0],eu=el[1],ep=(0,m.$G)("common").t,eh=(0,o._)((0,h.useState)(!1),2),em=eh[0],ef=eh[1],e_=(0,o._)((0,h.useState)(void 0),2),ev=e_[0],ex=e_[1],eg=(0,o._)((0,h.useState)(void 0),2),ey=eg[0],ew=eg[1];(0,h.useEffect)(function(){(0,g.DE)(S).then(function(e){return ea(e)})},[N]);var ej=(r=(0,n._)(function(){var e,r,t,n,i,a,o,c,l,d,u,p,h;return(0,s.Jh)(this,function(s){switch(s.label){case 0:ec(!0),eu(null),r=parseInt((e=L.currency.split(","))[0]),n=parseInt((t=M.currency.split(","))[0]),a={token:i=(0,y.xG)(L.price,r,!1,e[1]),contract:L.contract,creator:N,holder_contract:M.contract,min_amount:(0,y.xG)(M.price,n,!1,t[1]),max_amount:(0,y.xG)(T.price,n,!1,t[1]),snapshot_time:Math.floor(er.getTime()/1e3),display_data:JSON.stringify({name:R,description:K,preview_img:P})},o=[(0,$.vH)(I)],c={account:L.contract,name:"transfer",authorization:[{actor:N,permission:I.requestPermission?I.requestPermission:"active"}],data:{from:N,to:"wufclaimtool",quantity:i,memo:"deposit"}},l={account:"wuffi",name:"transfer",authorization:[{actor:N,permission:I.requestPermission?I.requestPermission:"active"}],data:{from:N,to:"wufclaimtool",quantity:X||"50000000.0000 WUF",memo:"deposit"}},d={account:"wufclaimtool",name:"addairdrop",authorization:[{actor:N,permission:I.requestPermission?I.requestPermission:"active"}],data:a},o.push(c),o.push(l),o.push(d),u=null,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,I.session.transact({actions:o},{expireSeconds:300,blocksBehind:0})];case 2:return(u=null===(h=s.sent())||void 0===h?void 0:null===(p=h.response)||void 0===p?void 0:p.transaction_id)&&ex(!0),ew(u),[3,4];case 3:return eu(s.sent().message),[3,4];case 4:return ec(!1),[2]}})}),function(){return r.apply(this,arguments)}),eb=(0,o._)((0,h.useState)(!1),2),eS=eb[0],eI=eb[1],eN=(0,o._)((0,h.useState)(null),2),eZ=eN[0],eC=eN[1],eD=(t=(0,n._)(function(e){var r,t,n,i,a,o,c,l,d;return(0,s.Jh)(this,function(s){switch(s.label){case 0:eI(!0),r=[],t=0,s.label=1;case 1:if(!(0===r.length&&t<5))return[3,5];return[4,(0,y._v)(1e3*t)];case 2:return s.sent(),[4,fetch(z.wu+"/v2/history/get_transaction?id=".concat(e))];case 3:return[4,s.sent().json()];case 4:return r=void 0!==(n=s.sent()).actions?n.actions:[],t++,[3,1];case 5:i=!0,a=!1,o=void 0;try{for(c=r[Symbol.iterator]();!(i=(l=c.next()).done);i=!0)if(d=l.value,"lognewdrop"===d.act.name){eC(d.act.data.airdrop_id);break}}catch(e){a=!0,o=e}finally{try{i||null==c.return||c.return()}finally{if(a)throw o}}return eI(!1),[2]}})}),function(e){return t.apply(this,arguments)}),eP=(b=(0,n._)(function(){var e,r,t;return(0,s.Jh)(this,function(n){switch(n.label){case 0:return e={code:"wufclaimtool",index_position:1,json:"true",key_type:"i64",limit:1,lower_bound:"",upper_bound:"",reverse:"true",scope:"wufclaimtool",show_payer:"false",table:"config",table_key:""},r=S.api+"/v1/chain/get_table_rows",[4,(0,A.v_)(r,e)];case 1:if((t=n.sent())&&200===t.status&&t.data&&t.data.rows&&t.data.rows.length>0)return[2,t.data.rows[0].default_fee];return[2,!1]}})}),function(){return b.apply(this,arguments)});(0,h.useEffect)(function(){ey&&eD(ey)},[ey]),(0,h.useEffect)(function(){eP().then(H)},[X]);var ek=(0,y.gJ)("");return(0,c.jsx)(w.Z,(0,a._)((0,i._)({id:"AirdropCreatorNewPage",image:ek,banners:!1},e),{pageTitle:ep("airdrops.create_airdrop"),breadcrumbs:[{title:"Home",link:"/"},{title:"Airdrops",link:"/airdrops"},{title:"New Airdrop",link:"/airdrops/new"}],children:(0,c.jsx)("div",{className:"mx-2 md:mx-5",children:N?(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsx)(C,{airdropCurrency:L,setAirdropCurrency:W,holderCurrencyMin:M,holderCurrencyMax:T,setHolderCurrencyMin:F,setHolderCurrencyMax:B,currencies:ei,fees:X}),(0,c.jsx)(D.j,{previewImage:P,setPreviewImage:k,enablePreviewVideo:!1,explanation:ep("airdrops.preview_image_explanation")}),(0,c.jsx)(x.p,{dropName:R,setDropName:V,editorOpen:em,setEditorOpen:ef,dropDescription:K,setDropDescription:Q,title:ep("airdrops.airdrop_details"),nameTitle:ep("airdrops.airdrop_name"),descriptionTitle:ep("airdrops.airdrop_description")}),(0,c.jsx)(q,{snapshotDate:er,setSnapshotDate:et}),(0,c.jsx)(_.C,{condition:!(null==M?void 0:M.price)||M.price>T.price>0&&0!==parseInt(T.price),severity:"warning",elementId:"DropAmountEditor",children:ep("drops.strongly_recommend_description")}),(0,c.jsx)(_.C,{condition:!em&&!K,severity:"warning",elementId:"DropDetailsEditor",children:ep("drops.strongly_recommend_description")}),(0,c.jsx)(_.C,{condition:0===R.length,severity:"error",elementId:"DropDetailsEditor",children:ep("airdrops.airdrop_name_is_missing")}),(0,c.jsx)(_.C,{condition:!(0,g._q)(!0,er),severity:"error",elementId:"AirDropStartEndDateEditor",children:ep("airdrops.snapshot_date_invalid")}),(0,c.jsx)(u.Z,{in:!ev,children:(0,c.jsxs)("div",{className:"flex flex-wrap justify-center mt-5 mb-10",children:[(0,c.jsx)(v.h,{onClick:ej,className:"sm:mx-2 mb-5 sm:mb-0 w-full sm:w-52",fullWidth:!0,size:"large",disabled:ev||0===R.length||!(0,g._q)(!0,er)||!(null==M?void 0:M.price)||M.price>T.price>0&&0!==parseInt(T.price)||es,children:ep("airdrops.create_airdrop")}),(0,c.jsx)(v.h,{className:"sm:mx-2 mb-5 sm:mb-0 w-full sm:w-52",fullWidth:!0,href:"/airdrops",size:"large",color:"error",disabled:es,children:ep("buttons.back_to_overview")})]})}),es?(0,c.jsx)(p.Z,{}):"",ed?(0,c.jsx)(_.C,{condition:ed,severity:"error",closable:!0,onClose:function(){return eu(!1)},children:ed}):"",(0,c.jsx)(u.Z,{in:ev&&ey,children:(0,c.jsx)("div",{className:"flex justify-center",children:(0,c.jsx)("div",{className:"w-full lg:w-2/3",children:(0,c.jsxs)("div",{className:"flex justify-evenly w-full mb-10",children:[(0,c.jsx)(v.h,{className:"w-1/3 px-1",variant:"outlined",size:"small",fullWidth:!0,color:"error",href:"/airdrops",children:ep("buttons.back_to_overview")}),(0,c.jsx)(v.h,{className:"w-1/3 px-1",href:"https://waxblock.io/transaction/"+ey,external:!0,size:"small",fullWidth:!0,children:ep("drops.view_on_waxblock")}),(0,c.jsx)("div",{className:"w-1/3 px-1",children:(0,c.jsx)(l.Z,{fullWidth:!0,variant:"outlined",size:"small",disabled:eS,loading:eS,children:(0,c.jsx)(f.Z,{href:"/airdrop/".concat(eZ),children:ep("airdrops.view_airdrop")})})})]})})})})]})}):(0,c.jsx)("div",{className:"my-10",children:(0,c.jsx)(d.Z,{severity:"error",children:ep("cpu.please_log_in_to_continue")})})})}))}}},function(e){e.O(0,[5733,8802,7470,8426,9774,2888,179],function(){return e(e.s=79730)}),_N_E=e.O()}]);
2//# sourceMappingURL=new-16d54494a7056c32.js.map

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.