Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unction nZ({index:e,uuid:t,isFaved:n,toggleFavedUUID:a,search:l,searchDisplayed:o}){let i;let u=e.toString(),c=u.length,f=9-c;f<0?(console.error("paddingLength < 0",u,c,9),i=""):i="0".repeat(f);let[p,h]=r(d).useState(null),[m,g]=r(d).useState( false),[v,y]=r(d).useState(0),b=r(d).useRef(null),w=t.length,x=r(d).useCallback(async()=>{clearTimeout(b.current),await navigator.clipboard.writeText(t).catch(e=>{console.error("error copying to clipboard",e),y(0)}).then(()=>{y(e=>e+1),b.current=setTimeout(()=>{y(0)},1e3)})},[t]);r(d).useEffect(()=>{p&&p!==t&&h(null)},[p,t]),r(d).useEffect(()=>{let e=()=>{m&&(g( false),x())};return window.addEventListener("mouseup",e),()=>{window.removeEventListener("mouseup",e)}},[m,x]);let k=o&&l&&t.includes(l),S=t;if(k){let e=t.indexOf(l),n=e+l.length;S=(0,s.jsxs)(s.Fragment,{children:[t.slice(0,e),(0,s.jsx)(nG,{children:t.slice(e,n)}),t.slice(n)]})}return(0,s.jsxs)(nB,{onMouseDown:e=>{e.target===e.currentTarget&&g( true)},style:{backgroundColor:m?"var(--slate-500)":null},children:[(0,s.jsxs)(nK,{style:{gridArea:"index",marginRight:"1rem"},children:[(0,s.jsx)(nq,{children:i}),(0,s.jsx)(nQ,{children:u})]}),(0,s.jsx)(nY,{style:{marginRight:"1rem"}}),(0,s.jsx)(nX,{style:{marginRight:"1rem"},children:S}),(0,s.jsxs)(nJ,{style:{width:"200px"},children:[w," chars"]}),(0,s.jsx)(nD,{onClick:x,$rowMouseDown:m,children:(0,s.jsx)(tW,{style:{height:"100%",aspectRatio:1}})}),(0,s.jsx)(n$,{$isFaved:n,"data-just-faved":n&&p===t,onClick:()=>{n||h(t),a(t)},children:(0,s.jsx)(tH,{fill:"var(--fill-color)",style:{height:"100%",aspectRatio:1}})}),0!==v&&(0,s.jsx)(nH,{children:"copied!"},v)]})}var n0=function({itemsToShow:e,setItemsToShow:t,virtualPosition:n,setVirtualPosition:a,favedUUIDs:l,toggleFavedUUID:o,isAnimating:i,MAX_POSITION:u,animateToPosition:c,search:f,searchDisplayed:p,displayedUUIDs:h}){let m=r(d).useRef(null),g=r(d).useCallback(e=>{i||a(t=>{let n=t+e;return n<0n?0n:n>u?u:n})},[i,u,a]);r(d).useEffect(()=>{if(null===m.current)return;let e=()=>{let e=m.current.getBoundingClientRect();t(Math.floor(e.height/(e.width+24<768?56:28)))};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t]),r(d).useEffect(()=>{m.current&&m.current.focus()},[]),r(d).useEffect(()=>{if(!m.current)return;let e=e=>{i||(e.preventDefault(),g(BigInt(Math.floor(e.deltaY))))};m.current.addEventListener("wheel",e,{passive: false});let t=0,n=0,r=0,a=null,l=()=>{Math.abs(r)>.5?(g(BigInt(Math.floor(r))),r*=.95,a=requestAnimationFrame(l)):r=0},o=e=>{t=e.touches[0].clientY,n=Date.now(),r=0,a&&cancelAnimationFrame(a)},u=e=>{e.preventDefault();let a=e.touches[0].clientY,l=t-a,o=Date.now();r=l/(o-n)*16.67,t=a,n=o,g(BigInt(Math.floor(2*l)))},s=()=>{Math.abs(r)>.5&&(a=requestAnimationFrame(l))};return m.current.addEventListener("touchstart",o,{passive: false}),m.current.addEventListener("touchmove",u,{passive: false}),m.current.addEventListener("touchend",s,{passive: false}),()=>{m.current&&(m.current.removeEventListener("wheel",e),m.current.removeEventListener("touchstart",o),m.current.removeEventListener("touchmove",u),m.current.removeEventListener("touchend",s))}},[g]);let v=r(d).useCallback(t=>{if(i)return;let r=BigInt(e),a=navigator.platform.toUpperCase().indexOf("MAC")>=0?t.metaKey:t.ctrlKey,l=t.shiftKey,o=e=>{t.preventDefault(),e()},s=(e,n=[])=>t.key===e&&n.every(e=>e),f=(e,t=[],n)=>!!s(e,t)&&(o(n), true),d=e=>{let t=n+e;t<0n?t=0n:t>u&&(t=u),c(t)};switch( true){case f("ArrowDown",[a],()=>{d(u)}):case f("ArrowUp",[a],()=>d(-u)):case f(" ",[l],()=>{d(-r)}):case f(" ",[],()=>{d(r)}):case f("PageDown",[a],()=>{d(u)}):case f("PageUp",[a],()=>{d(0n)}):case f("PageDown",[],()=>{d(r)}):case f("PageUp",[],()=>{d(-r)}):case f("Home",[],()=>d(0n)):case f("End",[],()=>d(u)):case f("ArrowDown",[],()=>g(1n)):case f("ArrowUp",[],()=>g(-1n)):case f("j",[],()=>g(1n)):case f("k",[],()=>g(-1n)):return}},[i,n,g,u,e,c]);return(0,s.jsx)(nU,{ref:m,onKeyDown:v,tabIndex:0,children:(0,s.jsx)(nA,{children:h.map(({index:e,uuid:t,state:n},r)=>(0,s.jsx)(nZ,{index:e,uuid:t,state:n,isFaved:l[t],toggleFavedUUID:o,search:f,searchDisplayed:p},r))})})},d=i("aEMJz");BigInt("0x123456789"),BigInt("0x987654321"),BigInt("0x246813579"),BigInt("0x135792468"),BigInt("0x975318642"),BigInt("0x864209753"),BigInt("0x951847362"),BigInt("0x753951846");const n1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=[]{}|;:,.<>?~`
- ",n2=BigInt(n1.length),n3=[];for(let e=4;e<=32;e++)n3.push(n2**BigInt(e));const n4=[];let n5=0n;for(let e=4;e<=32;e++)n4.push(n5),n5+=n2**BigInt(e);function n8(e){return function(e){if(e<0n)throw Error("
- Index must be non - negative ");let t=4,n=0n;for(let r=0;r<n3.length;r++){let a=n3[r];if(e<n+a){t=4+r;break}n+=a}if(t>32)throw Error("
- Index out of range ");let r="
- ",a=e-n;for(let e=0;e<t;e++)r=n1[Number(a%n2)]+r,a/=n2;return r}(e)}function n9(e){return function(e){if(e.length<4||e.length>32)return null;for(let t of e)if(!n1.includes(t))return null;let t=0n;for(let n=0;n<e.length;n++)t=t*n2+BigInt(n1.indexOf(e[n]));return n4[e.length-4]+t}(e)}var d=i("
- aEMJz ");let n6=e=>e,n7,re,rt,rn,rr,ra;const rl=tj(no)(n7||(n7=n6`
- font - size: 0.875 rem;
- aspect - ratio: 1;
- max - height: 80 % ;
- padding: 4 px;
- color: var (--neutral - 700);
- flex - shrink: 0;
- cursor: pointer;
- display: flex;
- align - items: center;
- justify - content: center;
- border - radius: 50 % ;
- @media(hover: hover) {
- &
- : hover {
- background - color: var (--slate - 200);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement