function c(e,n,o,s=!0){const r=new TextEncoder().encode(e.trim());if(s&&r.length===0)throw new Error(`${o} is required`);r.length>n&&console.warn(`[1AM-NFT] truncated ${o} to ${n}B (was ${r.length}B)`);const a=new Uint8Array(n);return a.set(r.slice(0,n)),a}function t(e,n,o){return!e||e.trim().length===0?{is_some:!1,value:new Uint8Array(n)}:{is_some:!0,value:c(e,n,o,!1)}}function d(e,n){return[c(e.name,n.name,"NFT name"),t(e.symbol,n.symbol,"NFT symbol"),t(e.description,n.description,"NFT description"),t(e.image,n.image,"NFT image URI"),t(e.mediaType,n.mediaType,"NFT media type")]}function f(){return crypto.getRandomValues(new Uint8Array(32))}function g(e,n){return e<n.length?n[e]:Math.min(5e3*Math.pow(1.5,e-n.length),3e4)}const l={log:e=>console.log(e),warn:(e,n)=>console.warn(e,n)};export{c as a,d as b,l as c,g as d,t as e,f as r};
