var p=(e,{height:t,quality:o})=>{if(e)return e.includes("imagedelivery.net")?e.includes("quality")?`${e},height=${t}`:`${e}/height=${t},quality=${o}`:e},h=(e,t)=>e?e.length>t?e.substr(0,t-1)+"..."+e.substr(e.length-(t-1),e.length-1):e:"",u=e=>new Intl.NumberFormat("en-GB",{notation:"compact",compactDisplay:"short"}).format(e),y=(e,t)=>{if(navigator.clipboard&&navigator.permissions)navigator.clipboard.writeText(e).then(t);else if(document.queryCommandSupported("copy")){let o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),t?.()}},m=e=>{let t=/<iframe.*src="([^"]+)".*>/,o=e.match(t);return o?o[1]:null};function g(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(t,o){return o===0?t.toLowerCase():t.toUpperCase()}).replace(/\s+/g,"")}function l(e){let t=["","one","two","three","four","five","six","seven","eight","nine"],o=["","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],n=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"];if(e===0)return"zero";let r="";return e<0&&(r+="negative ",e=Math.abs(e)),e>=1e6&&(r+=l(Math.floor(e/1e6))+" million ",e%=1e6),e>=1e3&&(r+=l(Math.floor(e/1e3))+" thousand ",e%=1e3),e>=100&&(r+=t[Math.floor(e/100)]+" hundred ",e%=100),e>=20?(r+=o[Math.floor(e/10)]+" ",e%=10):e>=10&&(r+=n[e-10]+" ",e=0),e>0&&(r+=t[e]),r.trim()}function d(e){if(Math.abs(e)<1){var t=parseInt(e.toString().split("e-")[1]);t&&(e*=Math.pow(10,t-1),e="0."+new Array(t).join("0")+e.toString().substring(2))}else{var t=parseInt(e.toString().split("+")[1]);t>20&&(t-=20,e/=Math.pow(10,t),e+=new Array(t+1).join("0"))}return e}function w(e){return e.charAt(0).toUpperCase()+e.slice(1)}var v=(e,t)=>{let o;return function(...n){o&&clearTimeout(o),o=setTimeout(()=>{e.apply(this,n)},t)}},b=async e=>{let t=new FileReader;return new Promise((o,n)=>{t.onload=()=>{let r=t.result,s=Buffer.from(r);o(s)},t.onerror=function(r){n(r)},t.readAsArrayBuffer(e)})},x=e=>{let t=JSON.stringify(e);return new TextEncoder().encode(t).length},S=e=>{let t=0;if(e.length%2!==0)throw new Error("Invalid folder");let o=[];if(Array.from(e).forEach((r,s,c)=>{r.name==="collection.json"&&r.type==="application/json"&&(t+=r.size,o.push(r),c.find(i=>{i.name==="collection.png"&&i.type==="image/png"&&(t+=i.size,o.push(i))}))}),o.length!==2)throw new Error("Invalid collection files");let n=e.filter(r=>r.name!=="collection.json"&&r.name!=="collection.png");for(let r=0;r<n.length/2;r++){let s=`${r}.json`,c=`${r}.png`,i=[];if(Array.from(n).forEach((a,f)=>{a.name===s&&a.type==="application/json"&&(t+=a.size,i.push(a))}),Array.from(n).find(a=>{a.name===c&&a.type==="image/png"&&(t+=a.size,i.push(a))}),i.length!==2)throw new Error(`Invalid assets of file starting with ${r}`);return t}},$=(e,t,o,n,r,s,c)=>{if(c)n(t);else{let i=new URLSearchParams(e);i.set("collectionId",o);let a=`${t}?${i.toString()}${s?"#mint":""}`;n(a)}},A=e=>new Promise(t=>setTimeout(t,e*1e3));export{w as capitalizeFirstLetter,$ as changeQueryParams,y as copyText,v as debounce,d as eToNumber,m as extractSrc,S as folderValidation,p as getImageUrl,x as getJsonByteSize,u as makeFriendlyNumber,l as numberToWords,b as readFile,A as sleep,g as toCamelize,h as truncateAddress};
