From f05e324780f483de96045dcec99c37c418548af1 Mon Sep 17 00:00:00 2001 From: Affolter Matias Date: Sat, 3 Aug 2024 00:27:12 +0200 Subject: [PATCH] Quantization --- client/chunk_10.min.js | 2 +- client/chunk_12.min.js | 2 +- client/chunk_15.min.js | 2 +- client/chunk_16.min.js | 2 +- client/chunk_20.min.js | 2 +- service-worker.js | 8 +- .../components/canvaspixels/CanvasPixels.js | 2 +- .../canvaspixels/utils/SuperMasterMeta.js | 7 +- src/js/pages/Pixel.js | 33 ++- src/js/utils/Layer.js | 59 +++--- src/js/utils/quantimat/QuantiMat.js | 190 +----------------- 11 files changed, 72 insertions(+), 237 deletions(-) diff --git a/client/chunk_10.min.js b/client/chunk_10.min.js index 092cfe7c..73d71db1 100644 --- a/client/chunk_10.min.js +++ b/client/chunk_10.min.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{603:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a,i,o,l,s,u,c,f,d,h,p,m,g,v,y,b,x,w,_,k,E,M,P,A,C,S,O,T,U,j,z,I,R,D,H,N,B,L,F,W,q,J,X,G,Q,V,Z,K,Y,$,ee,te,ne,re,ae,ie,oe,le,se,ue,ce,fe,de,he,pe,me,ge,ve,ye,be,xe,we,_e,ke,Ee,Me,Pe,Ae,Ce,Se,Oe,Te,Ue,je,ze,Ie,Re,De,He,Ne,Be,Le,Fe,We,qe,Je,Xe,Ge,Qe,Ve,Ze,Ke,Ye,$e,et,tt,nt,rt,at,it,ot,lt,st,ut,ct,ft,dt,ht,pt,mt,gt,vt,yt,bt,xt,wt,_t,kt,Et,Mt,Pt,At,Ct,St,Ot,Tt,Ut,jt,zt,It,Rt,Dt,Ht,Nt,Bt,Lt,Ft,Wt,qt,Jt,Xt,Gt,Qt,Vt,Zt,Kt,Yt;Object.defineProperty(t,"__esModule",{value:!0}),a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,a=[],i=!0,o=!1,l=void 0;try{for(n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(s){o=!0,l=s}finally{try{!i&&n.return&&n.return()}finally{if(o)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){var n,r;for(n=0;n div > h1":{bottom:"-60px",opacity:0,transition:"all 700ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&:hover > div > p":{bottom:"-40px",opacity:0,transition:"all 700ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},profileBannerImage:{width:"100%",height:"100%",background:"url(data:image/png;base64,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)",backgroundSize:"cover",backgroundPosition:"50% 75%"},profileBannerOverlay:{position:"absolute",borderRadius:"4px",top:0,let:0,width:"100%",height:"100%",transition:"filter 300ms cubic-bezier(0.4, 0, 0.2, 1) 50ms",filter:"opacity(1)",background:"linear-gradient(to top, #000000a1 5%, #00000085 25%, #00000045 50%, #ffffff00 75%)","@media (max-width: 800px)":{background:"linear-gradient(to bottom, #000000a1 5%, #00000085 25%, #00000045 50%, #ffffff00 75%)"},"&:hover, &:active":{filter:"opacity(0)",transition:"filter 600ms cubic-bezier(0.4, 0, 0.2, 1) 100ms"}},"@global":{"@keyframes ripple":{"0%":{transform:"scale(1)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}},"@keyframes float":{"0%":{paddingBottom:"0px"},"50%":{paddingBottom:"5px"},"100%":{paddingBottom:"0px"}},"@keyframes sparkle":{"0%":{boxShadow:"0rem 0rem 0 0rem #ff8080, 0rem 0rem 0 0rem #ff1200, 0rem 0rem 0 0rem #ff6f6f, 0rem 0rem 0 0rem rgba(0, 0, 0, 0.26), 0rem 0rem 0 0rem #ff3073, 0rem 0rem 0 0rem #ff80b5, 0rem 0rem 0 0rem #ff8097, 0rem 0rem 0 0rem #ff8080, 0rem 0rem 0 0rem #ff9280, 0rem 0rem 0 0rem #ff8080, 0rem 0rem 0 0rem #ff3131, 0rem 0rem 0 0rem #ff5151, 0rem 0rem 0 0rem #ff0958, 0rem 0rem 0 0rem #ff8080"},"75%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ff8080, -0.32476rem -2.625rem 0 -0.1875rem #ffed80, 2.54798rem -1.61656rem 0 -0.1875rem #ffed80, 1.84982rem -1.89057rem 0 -0.1875rem #a4ff80, 2.85252rem 0.98418rem 0 -0.1875rem #a4ff80, 2.63145rem 0.2675rem 0 -0.1875rem #80ffc8, 1.00905rem 2.84381rem 0 -0.1875rem #80ffc8, 1.43154rem 2.22414rem 0 -0.1875rem #80c8ff, -1.59425rem 2.562rem 0 -0.1875rem #80c8ff, -0.84635rem 2.50595rem 0 -0.1875rem #a480ff, -2.99705rem 0.35095rem 0 -0.1875rem #a480ff, -2.48692rem 0.90073rem 0 -0.1875rem #ff80ed, -2.14301rem -2.12438rem 0 -0.1875rem #ff80ed, -2.25479rem -1.38275rem 0 -0.1875rem #ff8080"},"100%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ff808000, -0.32476rem -2.625rem 0 -0.1875rem #ffed8000, 2.54798rem -1.61656rem 0 -0.1875rem #ffed8000, 1.84982rem -1.89057rem 0 -0.1875rem #a4ff8000, 2.85252rem 0.98418rem 0 -0.1875rem #a4ff8000, 2.63145rem 0.2675rem 0 -0.1875rem #80ffc800, 1.00905rem 2.84381rem 0 -0.1875rem #80ffc800, 1.43154rem 2.22414rem 0 -0.1875rem #80c8ff00, -1.59425rem 2.562rem 0 -0.1875rem #80c8ff00, -0.84635rem 2.50595rem 0 -0.1875rem #a480ff00, -2.99705rem 0.35095rem 0 -0.1875rem #a480ff00, -2.48692rem 0.90073rem 0 -0.1875rem #ff80ed00, -2.14301rem -2.12438rem 0 -0.1875rem #ff80ed00, -2.25479rem -1.38275rem 0 -0.1875rem #ff808000"}},"@keyframes sparklewhite":{"0%":{boxShadow:"0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem rgba(0, 0, 0, 0.26), 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff"},"75%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ffffff, -0.32476rem -2.625rem 0 -0.1875rem #ffffff, 2.54798rem -1.61656rem 0 -0.1875rem #ffffff, 1.84982rem -1.89057rem 0 -0.1875rem #ffffff, 2.85252rem 0.98418rem 0 -0.1875rem #ffffff, 2.63145rem 0.2675rem 0 -0.1875rem #ffffff, 1.00905rem 2.84381rem 0 -0.1875rem #ffffff, 1.43154rem 2.22414rem 0 -0.1875rem #ffffff, -1.59425rem 2.562rem 0 -0.1875rem #ffffff, -0.84635rem 2.50595rem 0 -0.1875rem #ffffff, -2.99705rem 0.35095rem 0 -0.1875rem #ffffff, -2.48692rem 0.90073rem 0 -0.1875rem #ffffff, -2.14301rem -2.12438rem 0 -0.1875rem #ffffff, -2.25479rem -1.38275rem 0 -0.1875rem #ff8080"},"100%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ffffff00, -0.32476rem -2.625rem 0 -0.1875rem #ffffff00, 2.54798rem -1.61656rem 0 -0.1875rem #ffffff00, 1.84982rem -1.89057rem 0 -0.1875rem #ffffff00, 2.85252rem 0.98418rem 0 -0.1875rem #ffffff00, 2.63145rem 0.2675rem 0 -0.1875rem #ffffff00, 1.00905rem 2.84381rem 0 -0.1875rem #ffffff00, 1.43154rem 2.22414rem 0 -0.1875rem #ffffff00, -1.59425rem 2.562rem 0 -0.1875rem #ffffff00, -0.84635rem 2.50595rem 0 -0.1875rem #ffffff00, -2.99705rem 0.35095rem 0 -0.1875rem #ffffff, -2.48692rem 0.90073rem 0 -0.1875rem #ffffff00, -2.14301rem -2.12438rem 0 -0.1875rem #ffffff00, -2.25479rem -1.38275rem 0 -0.1875rem #ffffff00"}}},profileImage:{cursor:"pointer",height:224,width:224,background:"url(data:image/png;base64,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)",borderRadius:"50%",position:"absolute",left:154,top:224,margin:0,transform:"translate(-50%, -50%) scale(1)",backgroundPosition:"50% 50%",backgroundSize:"cover",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animation:"$float 1000ms infinite cubic-bezier(0.4, 0, 0.2, 1) 0ms",transformOrigin:"center",zIndex:1,"&:hover":{boxShadow:"0px 7px 8px -4px rgba(0,0,0,0.2), 0px 12px 17px 2px rgba(0,0,0,0.14), 0px 5px 22px 4px rgba(0,0,0,0.12)",transform:"translate(-50%, -50%) scale(1.05)"},"& .MuiBadge-badge":{backgroundColor:"#51d106",color:"#ffffff",boxShadow:"0 0 2px 4px #51d106",width:36,height:36,borderRadius:"50%",fontWeight:"bold",fontSize:"18px","&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"$ripple 0.7s infinite cubic-bezier(0.4, 0, 0.2, 1)",border:"2px solid #51d10699",content:'""'},"&::before":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"$ripple 1.7s infinite cubic-bezier(0.4, 0, 0.2, 1)",border:"1px solid #51d106ee",content:'""'}},"@media (max-width: 800px)":{width:192,height:192,left:128,top:192,"& .MuiBadge-badge":{width:32,height:32,fontSize:"16px"}},"@media (max-width: 532px)":{width:156,height:156,left:96,top:168}},profileInformation:{padding:"156px 16px 24px 16px",margin:0,width:"100%",position:"relative",zIndex:0},profileInformationOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},profileInformationButtons:{position:"absolute",right:0,top:0},followButton:{margin:"16px 4px 8px 8px"},linkButton:{margin:"16px 4px 8px 4px"},drawerHashtag:{"& .MuiDrawer-paper":{width:256,background:"white",contain:"style size paint layout",boxShadow:"-2px 0px 4px 0px rgb(0 0 0 / 20%), -4px 0px 5px 0px rgb(0 0 0 / 14%), -6px 0px 10px 0px rgb(0 0 0 / 12%)",maxHeight:"100%",height:"100%"}},settingButton:{margin:"16px 16px 8px 4px",transform:"rotate(0deg)",transition:"transform 720ms linear 0ms","&:hover":{transform:"rotate(-72deg)"},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"9px !important"}}},profileName:{color:"white",pointerEvents:"none",margin:0,left:297,position:"absolute",fontSize:"48px",bottom:40,transition:"all 350ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",opacity:1,"@media (max-width: 800px)":{left:"32px",top:"16px",bottom:"inherit"}},profileDescription:{color:"white",pointerEvents:"none",left:305,margin:"12px 0px 12px 0px",position:"absolute",fontSize:"18px",bottom:0,opacity:1,transition:"all 350ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:555,"@media (max-width: 800px)":{display:"none"}},profileCards:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileHistory:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileFollowers:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileFollowing:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileWallet:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileComments:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},mediaCard:{contain:"paint style layout",cursor:"pointer",width:"100%",maxWidth:"100vw",position:"relative",marginBottom:24,borderRadius:"4px",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)","&:hover":{boxShadow:"0px 7px 8px -4px rgba(0,0,0,0.2), 0px 12px 17px 2px rgba(0,0,0,0.14), 0px 5px 22px 4px rgba(0,0,0,0.12)"}},media:{width:"100%",height:"100%",borderRadius:"4px",position:"relative"},mediaOverlay:{overflow:"hidden","& > .top":{position:"absolute",textAlign:"left",left:4,"& > button, & > button:nth-child(1), & > button:nth-child(2), & > button:nth-child(3), ":{opacity:0,marginTop:-40,padding:8},"& > button:nth-child(1)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 75ms"},"& > button:nth-child(2)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 50ms"},"& > button:nth-child(3)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 25ms"},"& > button":{transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},"& > .bottom":{bottom:"-60px",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",opacity:0},position:"absolute",top:0,width:"100%",height:"100%",borderRadius:"4px",transition:"filter 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",background:"linear-gradient(to top, #000000cc 25px, #000000b8 50px, #00000096 75px, #0000001a 125px, #00000000 185px), linear-gradient(to bottom, #000000cc 20px, #000000b8 35px, #00000096 45px, #0000001a 75px, #00000000 105px)",filter:"opacity(0)","&:hover, &:active":{filter:"opacity(1)","& > .top":{textAlign:"left","& > button, & > button:nth-child(1), & > button:nth-child(2), & > button:nth-child(3), ":{marginTop:0,opacity:1},"& > button:nth-child(1)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 25ms"},"& > button:nth-child(2)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 50ms"},"& > button:nth-child(3)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 75ms"},"& > button":{transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},"& > .bottom":{bottom:0,opacity:1}}},mediaTitle:{position:"absolute",margin:0,bottom:0,left:0,color:"white",textAlign:"left"},mediaTitleAuthor:{fontSize:"16px",fontWeight:"inherit",margin:"4px 0px 12px 12px",display:"block","@media (max-width: 800px)":{fontSize:"14px"}},mediaTitleName:{fontSize:"21px",fontWeight:"bold",margin:"0px 0px 0px 12px",display:"block","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"18px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"16px !important"}}},profileTabs:{position:"absolute",left:0,bottom:0,margin:0,padding:0,width:"100%",contain:"paint size style layout",animationFillMode:"both",animationName:"$menu",animationDuration:"175ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"0ms",height:72,display:"grid","& .MuiTabs-scroller":{overflowY:"hidden"},"& .MuiTab-root":{minWidth:"auto",flex:"auto"},"& .MuiTabs-indicator":{backgroundColor:"#050c4c"}},profileTab:{"@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"10px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"9px !important"}},backgroundColor:"#fafafa",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .275s","&.Mui-selected":{fontWeight:"bold",backgroundColor:"#dfddf2",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"4px 4px 0px 0px"},"&:hover":{fontWeight:"bold",backgroundColor:"#e8e6f5",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"6px 6px 0px 0px"},"&:first-child":{borderRadius:"0px 4px 0px 0px"},"&:last-child":{borderRadius:"4px 0px 0px 0px"},"& .MuiTab-wrapper":{fontSize:"11px"},"& .MuiTab-wrapper svg":{width:32,height:32,contentVisibility:"auto"}},mediaMoney:{position:"absolute",margin:12,bottom:0,right:0,color:"white",textAlign:"right","& svg":{height:24,width:24,marginBottom:-4}},mediaPriceUnavailable:{color:"#ff3333",fontSize:"21px",fontWeight:"bold","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"18px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"16px !important"}}},mediaPriceAvailable:{fontSize:"21px",fontWeight:"bold",color:"#66ff33","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"18px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"16px !important"}}},mediaValue:{fontSize:"16px",fontWeight:"inherit",margin:"0px",display:"block",textDecoration:"none","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"14px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"12px !important"}}},tabSort:{"& .MuiTab-root":{minWidth:64}},votes:{position:"absolute",margin:0,top:8,left:8,"& .MuiIconButton-root":{color:"#fff","&:hover::after":{content:'""',position:"absolute",marginTop:8,marginRight:8,width:8,height:8,borderRadius:"100%",transition:"all 400ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animation:"$sparklewhite 750ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animationFillMode:"both"}}},walletCards:{width:"100%",display:"flex",textAlign:"left","@media (max-width: 1000px)":{display:"initial"}},favoriteTrue:{position:"absolute",color:"#ff1200",margin:0,width:"48px !important",top:16,right:"12px !important",left:"auto !important",borderRadius:"100%",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&::after":{content:'""',position:"absolute",top:20,right:20,width:8,height:8,borderRadius:"100%",transition:"all 400ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animation:"$sparkle 750ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animationFillMode:"both"}},favoriteFalse:{position:"absolute",color:"#ffffff",margin:0,width:"48px !important",top:16,right:"12px !important",left:"auto !important",borderRadius:"100%",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},iconCount:{color:"white",marginLeft:4,fontSize:"16px"},location:{color:"#05009d",position:"absolute",top:"72px",right:"24px"},actions:{position:"fixed",bottom:16,right:16,"& .MuiButtonBase-root.MuiFab-root":{borderRadius:8}},actionButton:{borderRadius:4,"&.MuiSpeedDialAction-fab, &.MuiSpeedDialAction-fab .MuiSvgIcon-root":{color:"white",width:48,height:48,padding:14}},timeLine:{"& .MuiTimelineOppositeContent-root.MuiTimelineItem-oppositeContent":{maxWidth:96}},timeLineTime:{fontWeight:"bold"},timeLineDescription:{color:e.palette.primary,textAlign:"left"},drawerPaper:{position:"absolute","@media (max-width: 800px)":{width:"100% !important"},width:384,textAlign:"left","& h1":{display:"block",margin:"12px auto"},"& h2":{display:"block",margin:"8px 16px"}},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff","&.MuiBackdrop-root":{backgroundColor:"rgba(1,2,18,0.92)"},"& .MuiIconButton-root":{color:"white"}},leftFromDrawer:{position:"absolute",left:0,top:0,display:"block",height:"100%",width:"100% !important",pointerEvents:"none",overflow:"hidden",touchAction:"none",userSelect:"none",perspective:200},fullCard:{borderRadius:8},colors:{flexFlow:"wrap",placeContent:"stretch flex-start",margin:"8px 14px 8px 14px"},drawer:{},list:{"& .MuiListItem-container":{lineHeight:32,height:32},"& .MuiListItemText-root span":{fontWeight:"bold"},"& .MuiListItemSecondaryAction-root":{color:e.palette.secondary.main},"& svg":{height:"24px",verticalAlign:"middle"}},titleWallet:{color:"#43e",fontSize:14,marginRight:72,marginBottom:8},tooltip:{backgroundColor:e.palette.common.white,color:"rgba(0, 0, 0, 0.87)",boxShadow:e.shadows[1],fontSize:14}}},Yt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.componentDidMount=function(){var e;r.canvas_pos.set_notifiers(r.requestForceUpdate,r.closeMediaCard),r.canvas_pos.set_boolean_move_on_click(!0),r.canvas_pos.set_perspective(!0),r.canvas_pos.init_speed_interval(),Ot.default.jamy_update("flirty"),window.addEventListener("resize",(function(){r.setRefFromLeft()})),(e=document.createElement("style")).innerHTML='.Canvas-Wrapper-Overflow.Shown {\n animation-name: canvanimation;\n transform-origin: center center !important;\n animation-fill-mode: both;\n animation-duration: 325ms;\n animation-delay: 25ms;\n animation-timing-function: linear;\n }\n .Canvas-Wrapper-Overflow .Canvas-Wrapper::after {\n content: "";\n position: fixed;\n width: 100%;\n background: linear-gradient(to top, #ffffff00 0%, #1700ff14 14%, #1700ff57 21%, transparent);\n height: 50%;\n left: 0;\n z-index: 2;\n top: 100%;\n }\n .Canvas-Wrapper-Overflow.Shown .Canvas-Wrapper::after {\n animation-name: canvanimationscan;\n animation-fill-mode: both;\n animation-duration: 675ms;\n animation-delay: 525ms;\n animation-timing-function: linear;\n }\n .Canvas-Wrapper-Overflow.Not-Shown {\n animation-name: canvanimation;\n transform-origin: center center !important;\n animation-fill-mode: both;\n animation-duration: 300ms;\n animation-delay: 50ms;\n animation-timing-function: linear;\n animation-direction: reverse;\n }\n @keyframes canvanimation { \n 0% { transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.0); will-change: transform, filter; }\n 4.3% { transform: matrix3d(0.12, 0, 0, 0, 0, 0.271, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.3); will-change: transform, filter; }\n 8.61% { transform: matrix3d(.64, 0, 0, 0, 0, .818, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.7); will-change: transform, filter; }\n 12.91% { transform: matrix3d(1.16, 0, 0, 0, 0, 1.078, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.9); will-change: transform, filter; }\n 17.22% { transform: matrix3d(1.25, 0, 0, 0, 0, 1.11, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 28.33% { transform: matrix3d(1.04, 0, 0, 0, 0, 1.031, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 39.44% { transform: matrix3d(.98, 0, 0, 0, 0, .991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 61.66% { transform: matrix3d(1.01, 0, 0, 0, 0, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 83.98% { transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 100% { transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: initial; } \n }\n @keyframes canvanimationscan { \n 0% { top: -50%; mix-blend-mode: screen; }\n 100% { top: 100%; mix-blend-mode: none; } \n }',e.id="media-style",document.head.appendChild(e),window.addEventListener("resize",r.updateDimension),r.setst4te({_h_svg:(0,xt.createLocalBlob)((0,Et.default)(l.default.createElement(_t.default,{color:"rgba(1,17,255,0.1)"}))),_h_svg_size:"100px 115px"},(function(){r.forceUpdate((function(){r.updateDimension()}))})),setTimeout((function(){r.forceUpdate((function(){r.setRefFromLeft(null)}))}),1e3)},r.goToEditor=function(){Ot.default.load_with("")},r.updateDimension=function(){var e,t,n,a;r.setRefFromLeft(null),e=document.documentElement,t=document.body||document.getElementsByTagName("body")[0],n=window.innerWidth||e.clientWidth||t.clientWidth,window.innerHeight||e.clientHeight||t.clientHeight,a=!!(n<1280),r.setst4te({isMobile:a})},r.handleTabChange=function(e,t){r.setst4te({tabValue:t},(function(){r.forceUpdate()}))},r.handleTabTagChange=function(e,t){r.setst4te({tabTagValue:t},(function(){r.forceUpdate()}))},r.handleMainTabChange=function(e,t){r.setst4te({mainTabValue:t},(function(){r.forceUpdate()}))},r.toggleFavoriteAtIndex=function(e){var t=r.st4te.imagesProfile;t[e].favorite=!t[e].favorite,r.setst4te({imagesProfile:t},(function(){r.forceUpdate()}))},r.requestForceUpdate=function(){r.forceUpdate()},r.renderMedia=function(e,t,i){var o;switch(r.setst4te({renderingMenuAnchorEl:null},(function(){r.forceUpdate()})),URL.revokeObjectURL(r.st4te.src),o=function(e){var t,n,a=document.createElement("canvas");a.width=e.width,a.height=e.height,(t=a.getContext("2d")).putImageData(e,0,0),n=t.canvas.toDataURL("image/png"),r.setst4te({src:n,type:"png"},(function(){r.forceUpdate()}))},e){case"pixelated":Ot.default.trigger_voice("vision_deactivated"),r.setst4te({src:r.st4te.openedMediaData.src,type:"png"},(function(){r.forceUpdate()}));break;case"crt":(0,Ct.default)((function(){return n.e(2).then(n.t.bind(null,720,7))})).then((function(e){(0,e.crt)(t,960/Math.sqrt(t.width*t.height)|0,Pt.default).then(o)}));break;case"hex":Ot.default.trigger_loading_update(0),(0,Ct.default)((function(){return n.e(5).then(n.t.bind(null,721,7))})).then((function(e){e.hexagonrender(t,1440/Math.sqrt(t.width*t.height)|0,!1).then((function(e){r.setst4te({src:e,type:"png"},(function(){r.forceUpdate(),Ot.default.trigger_loading_update(66),(0,Ct.default)((function(){return n.e(0).then(n.t.bind(null,657,7))})).then((function(t){(0,t.png_quant)(e,30,100,3,Pt.default).then((function(e){URL.revokeObjectURL(r.st4te.src),r.setst4te({src:e,type:"png"},(function(){r.forceUpdate(),Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("enhanced")}))}))}))}))}))}));break;case"svg":Ot.default.trigger_loading_update(0),Ot.default.trigger_voice("processing"),(0,Ct.default)((function(){return n.e(3).then(n.t.bind(null,722,7))})).then((function(e){e.default(t,6,Pt.default).then((function(e){Ot.default.trigger_loading_update(22),(0,jt.createSVG)(e).then((function(e){var t=a(e,2),i=t[0],o=t[1];URL.revokeObjectURL(r.st4te.src),r.setst4te({src:i,type:"svg"},(function(){Ot.default.trigger_loading_update(66),Ot.default.trigger_voice("vision_activated"),r.forceUpdate(),(0,Ct.default)((function(){return n.e(1).then(n.bind(null,689))})).then((function(e){var t,n,a=e.optimize;o=a(o,{path:"path-to.svg",multipass:!0,mergePaths:!0,mergeStyles:!0,collapseGroups:!1,reusePaths:!1,plugin:["multipass","mergePaths","collapseGroups","reusePaths","mergeStyles"]}).data,Ot.default.trigger_loading_update(88),URL.revokeObjectURL(r.st4te.src),r.setst4te({src:(t=o,n=new Blob([t],{type:"image/svg+xml"}),URL.createObjectURL(n)),type:"svg"},(function(){r.forceUpdate(),Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("enhanced")}))}))}))}))}))}));break;case"tree":Ot.default.trigger_loading_update(0),Ot.default.trigger_voice("processing"),new lt.default({shape:"circle"}).loadImage(t).then((function(e){URL.revokeObjectURL(r.st4te.src),r.setst4te({src:e,type:"svg"},(function(){Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("vision_activated"),r.forceUpdate()}))}));break;case"poly":Ot.default.trigger_loading_update(0),Ot.default.trigger_voice("processing"),new ut.default({size:2974.451209887296/Math.sqrt(i.width*i.height)|0}).processImage(t,!0).then((function(e){URL.revokeObjectURL(r.st4te.src),r.setst4te({src:e,type:"svg"},(function(){Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("vision_activated"),r.forceUpdate()}))}))}},r.openMediaCard=function(e){var t,n;Ot.default.trigger_sfx("navigation_selection-complete-celebration"),t=new Zt.FloranceCaptionerAPI,n=r.st4te.descriptions||[],t.run(e.src,3).then((function(t){n[e.name]=t,r.setst4te({descriptions:n})})),r.setst4te({openedMediaData:e,src:e.src},(function(){r.forceUpdate(),(0,it.getImageDataFromBase64)(e.src).then((function(e){r.canvas_pos.set_sizes(e.width,e.height),r.canvas_pos.set_current_scale_default(),r.setst4te({openedMediaDataData:e},(function(){r.forceUpdate()}))}))}))},r.closeMediaCard=function(){URL.revokeObjectURL(r.st4te.src),Ot.default.trigger_sfx("state-change_confirm_down"),r.setst4te({openedMediaData:null},(function(){r.forceUpdate()}))},r.setRefFromLeft=function(e){null==e&&null==r.st4te.refleft||r.setst4te({refleft:e||r.st4te.refleft},(function(){var t=window.innerWidth,n=r.st4te.refleft.getBoundingClientRect(),a=t>800?n.width-384:n.width,i=n.height||0,o=n.left||0,l=n.top||0;r.canvas_pos.set_canvas_container(l,o,i,a),e&&(e.addEventListener("wheel",r._canvas_pos_handle_wheel,{passive:!1}),e.addEventListener("pointerdown",r._canvas_pos_handle_pointer_down,{passive:!1}),e.addEventListener("pointermove",r._canvas_pos_handle_pointer_move,{passive:!1}),e.addEventListener("pointerup",r._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointercancel",r._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerout",r._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerleave",r._canvas_pos_handle_pointer_up,{passive:!1}))}))},r._canvas_pos_handle_wheel=function(e){r.canvas_pos.handle_wheel(e)},r._canvas_pos_handle_pointer_down=function(e){r.canvas_pos.handle_pointer_down(e)},r._canvas_pos_handle_pointer_move=function(e){r.canvas_pos.handle_pointer_move(e)},r._canvas_pos_handle_pointer_up=function(e){r.canvas_pos.handle_pointer_up(e)},r.edit=function(e){Ot.default.load_with(e)},r.toggleDrawer=function(){r.setst4te({openedDrawer:!r.st4te.openedDrawer})},r.toggleHashtagDrawer=function(){r.setst4te({drawerHashtagOpen:!r.st4te.drawerHashtagOpen})},r.toggleFavoriteTag=function(e){var t,n,a=r.st4te.categories;for(t=0;t800?400:14,top:16}},l.default.createElement(R.default,{style:{color:"#ffffff"},onClick:function(){e.download(S,w.name,"sophia.julio",T)}},l.default.createElement(je.default,null,l.default.createElement(vt.default,null))),l.default.createElement(R.default,{style:{color:"#ffffff"},onClick:function(){e.edit(w.src)}},l.default.createElement(je.default,null,l.default.createElement(Ie.default,null))),l.default.createElement(R.default,{style:{color:"#ffffff"},onClick:function(){e.closeMediaCard()}},l.default.createElement(je.default,null,l.default.createElement(Se.default,null)))),l.default.createElement("div",{style:{position:"absolute",bottom:16,left:16}},l.default.createElement(d.default,{title:"14 Reposts"},l.default.createElement(R.default,null,l.default.createElement(je.default,null,l.default.createElement(Me.default,null)))),l.default.createElement(d.default,{title:"88 UpVotes"},l.default.createElement(R.default,null,l.default.createElement(je.default,null,l.default.createElement(ke.default,null)))),l.default.createElement(d.default,{title:"0 DownVote"},l.default.createElement(R.default,null,l.default.createElement(je.default,null,l.default.createElement(we.default,null))))),l.default.createElement("div",{style:{position:"absolute",bottom:16,right:16,display:window.innerWidth>=800?"none":"block"}},l.default.createElement(z.default,{style:{color:"white",fontWeight:"bold"},onClick:function(){e.toggleDrawer(w.src)}},"Details"))),w&&k&&l.default.createElement(at.default,{className:n.drawer,variant:"persistent",anchor:window.innerWidth>=800?"right":"bottom",open:I,classes:{paper:n.drawerPaper}},l.default.createElement(R.default,{onClick:this.toggleDrawer,style:{display:window.innerWidth>=800?"none":"block",color:"#060e23",width:64,height:64,position:"fixed",right:4,top:4}},l.default.createElement(Se.default,null)),l.default.createElement("h1",null,w.name),l.default.createElement("h2",null,(k.colors||[]).length," Colors"),l.default.createElement("div",{className:n.colors},(k.colors||[]).map((function(t,n){return l.default.createElement(d.default,{title:t,key:n},l.default.createElement(R.default,{disableRipple:!0,onClick:function(n){e.props.onClick(n,t)},style:{background:t,width:24,height:24,borderRadius:"2px",margin:4}}))}))),l.default.createElement("h2",null,"Description"),l.default.createElement("p",{style:{textAlign:"justify",margin:"8px 16px"}},i[w.name]||"[Automatic captioning]..."),l.default.createElement("h2",null,"Status"),l.default.createElement(ft.default,{dense:!0,className:n.list},l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Created:"}),l.default.createElement(ht.default,null,"Just now")),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Author:"}),l.default.createElement(ht.default,null,"@sophia.julio")),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Status:"}),l.default.createElement(ht.default,{style:{color:w.sold?"red":"green"}},w.sold?"Sold":"For sale!")),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Price:"}),l.default.createElement(ht.default,null,w.price," ",w.money)),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Dimension:"}),l.default.createElement(ht.default,null,k.width,"x",k.height))),l.default.createElement(z.default,{style:{fontWeight:"bold",margin:"8px 16px 32px 16px",backgroundColor:"rgb(0 28 255 / 25%)",color:"#001238",width:"calc(100% - 32px)"},color:"primary"},"BUY NOW"))))}}]),t}(l.default.PureComponent),t.default=(0,c.default)(Kt)(Yt)},652:function(e,t,n){"use strict";var r,a;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n>>0,this.rgba_[3]=e>>24&255,this.rgba_[2]=e>>16&255,this.rgba_[1]=e>>8&255,this.rgba_[0]=255&e}},{key:"r",get:function(){return this.rgba_[0]}},{key:"g",get:function(){return this.rgba_[1]}},{key:"b",get:function(){return this.rgba_[2]}},{key:"a",get:function(){return this.rgba_[3]}},{key:"rgba",get:function(){return this.rgba_.subarray(0,4)}},{key:"uint32",get:function(){return(this.r<<24|this.g<<16|this.b<<8|this.a)>>>0}}],[{key:"createUint32",value:function(t){return new e(new Uint8Array(Uint32Array.of((0|t)>>>0).buffer))}}]),e}(),t.default=a},653:function(e,t,n){"use strict";var r,a,i,o,l;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n>>0,n[1]=(n[1]+t[1]|0)>>>0,n[2]=(n[2]+t[2]|0)>>>0,n[3]=(n[3]+t[3]|0)>>>0})),t=e.length,new i.default(Uint8Array.of(n[0]/t|0,n[1]/t|0,n[2]/t|0,n[3]/t|0))}}]),e}(),t.default=o},655:function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&b.length>0?a.push(y,b):a.push(p))}catch(M){u=!0,c=M}finally{try{!s&&f.return&&f.return()}finally{if(u)throw c}}r=a}for(x=r.map((function(e){return e.reduce((function(e,t){return e+(t>>16&255)}),0)/e.length<<16|e.reduce((function(e,t){return e+(t>>8&255)}),0)/e.length<<8|e.reduce((function(e,t){return e+(255&t)}),0)/e.length})),w=new Uint8ClampedArray(e.length),_=0;_>16&255,w[_+1]=k>>8&255,w[_+2]=255&k,w[_+3]=e[_+3];return w}function i(e){var t=[0,1,2].map((function(t){var n=e.map((function(e){return e>>8*(2-t)&255}));return Math.max.apply(Math,r(n))-Math.min.apply(Math,r(n))})),n=t.indexOf(Math.max.apply(Math,r(t))),a=e.slice().sort((function(e,t){return(e>>8*(2-n)&255)-(t>>8*(2-n)&255)})),i=a[a.length>>1]>>8*(2-n)&255;return{axis:n,median:i}}function o(e,t,n){var r,a,i,o=[],l=[],s=8*(2-t),u=!0,c=!1,f=void 0;try{for(r=e[Symbol.iterator]();!(u=(a=r.next()).done);u=!0)(((i=a.value)>>s&255)<=n?o:l).push(i)}catch(d){c=!0,f=d}finally{try{!u&&r.return&&r.return()}finally{if(c)throw f}}return[o,l]}function l(e,t){var n,r,a,i,o,l,s,u,c,f=1/0,d=t[0],h=!0,p=!1,m=void 0;try{for(n=t[Symbol.iterator]();!(h=(r=n.next()).done);h=!0)a=r.value,(i=(s=((o=e)>>16&255)-((l=a)>>16&255))*s+(u=(o>>8&255)-(l>>8&255))*u+(c=(255&o)-(255&l))*c)0&&(r-=(o=l[i]/a)*Math.log2(o));return r}function u(e,t){var n,r,a=255,i=0,o=0,l=0,s=0,u=0;for(n=0;n>2,o/=t.length>>2,r=0;r>2)-1,s/=(t.length>>2)-1,(2*i*o+.01*a*(.01*a))*(2*(u/=(e.length>>2)-1)+.03*a*(.03*a))/((i*i+o*o+6.502500000000001)*(l+s+58.522499999999994))}function c(e,t){var n,r,a,i,o=0;for(n=0;n>2)}var f,d=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,a=[],i=!0,o=!1,l=void 0;try{for(n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(s){o=!0,l=s}finally{try{!i&&n.return&&n.return()}finally{if(o)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},h=n(654),p=n(648),m=(0,p.SIMDopeCreateConfAdd)({create:{new_of:!0},properties:{uint32:!0,laba:!0,rgbaon4bits:!0,rgbaon6bits:!0,rgbaon8bits:!0,rgbaon12bits:!0,rgbaon16bits:!0,skin:!0},methods:{simplify:!0,get_new_element:!0,get_use_element:!0,set_tail:!0,is_dark:!0,blend_first_with:!0,blend_first_with_tails:!0,blend_all:!0,cie76_match_with:!0,copy:!0}}),g=Math.fround,v=g(1),y=g(.777),b=(0,p.SIMDopeCreate)(m),x=b.simdops,w=b.Color,_=b.Colors,k=(x.minus_int,x.int_not_equal,x.plus_int,x.plus_uint,x.minus_uint,x.multiply_int,x.multiply_uint,x.multiply_uint_4),E=(x.divide_uint,x.clamp_uint8,x.clamp_uint32,x.int_equal,x.uint_less,x.int_less,x.int_greater_equal,x.uint_not_equal,x.uint_less_equal,x.min_uint,function e(t){if(t=t||{},!(this instanceof e))return new e(t);t.pxl_colors=t.pxl_colors||new Uint32Array(0),t.pxls=t.pxls||new Uint32Array(0),this.new_pxls_="buffer"in t.pxls?new Uint32Array(t.pxls.buffer):Uint32Array.from(t.pxls),this.new_pxl_colors_="buffer"in t.pxl_colors?new _(t.pxl_colors.buffer):new _(Uint32Array.from(t.pxl_colors).buffer),this.original_pxls_=this.new_pxls_.slice(0,this.new_pxls_.length),this.original_pxl_colors_=this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length);var n=0|this.new_pxl_colors_.length;this.new_pxl_colors_is_skin_mask_=new h.SetFixed(0|n),this.set_new_pxl_skin_mask(),this.best_color_number_=t.number_of_color,this.max_cluster_=n>65536?65537:n>16384?4097:n>8192?257:n>512?17:1,this.index_clusters_=Array(this.max_cluster_),this.length_clusters_=new Uint32Array(this.max_cluster_),this.pxl_colors_usage_=new Uint32Array(n),this.all_index_clusters_=new Uint32Array(n),this.clean_pxl_colors_=new Uint32Array(n),this.clean_pxl_colors_lookup_={},this.is_skin_ops_=0,this.match_ops_=0,this.blend_ops_=0,this.remove_duplicate_ops_=0,this.simplify_ops_=0,this.classify_on_x_bits_ops_=0});Object.defineProperty(E.prototype,"set_is_skin_ops",{get:function(){return function(e){this.is_skin_ops_=(0|e)>>>0}}}),Object.defineProperty(E.prototype,"set_match_ops",{get:function(){return function(e){this.match_ops_=(0|e)>>>0}}}),Object.defineProperty(E.prototype,"set_blend_ops",{get:function(){return function(e){this.blend_ops_=(0|e)>>>0}}}),Object.defineProperty(E.prototype,"set_remove_duplicate_ops",{get:function(){return function(e){this.remove_duplicate_ops_=(0|e)>>>0}}}),Object.defineProperty(E.prototype,"set_simplify_ops",{get:function(){return function(e){this.simplify_ops_=e}}}),Object.defineProperty(E.prototype,"set_classify_on_x_bits_ops",{get:function(){return function(e){this.classify_on_x_bits_ops_=e}}}),Object.defineProperty(E.prototype,"get_is_skin_ops",{get:function(){return function(){return 0|this.is_skin_ops_}}}),Object.defineProperty(E.prototype,"get_match_ops",{get:function(){return function(){return 0|this.match_ops_}}}),Object.defineProperty(E.prototype,"get_blend_ops",{get:function(){return function(){return 0|this.blend_ops_}}}),Object.defineProperty(E.prototype,"get_remove_duplicate_ops",{get:function(){return function(){return 0|this.remove_duplicate_ops_}}}),Object.defineProperty(E.prototype,"get_simplify_ops",{get:function(){return function(){return this.simplify_ops_}}}),Object.defineProperty(E.prototype,"get_classify_on_x_bits_ops",{get:function(){return function(){return this.classify_on_x_bits_ops_}}}),Object.defineProperty(E.prototype,"reset_deduplicate",{get:function(){return function(e){this.clean_pxl_colors_lookup_={},this.pxl_colors_usage_.fill(0,0,0|e),this.clean_pxl_colors_.fill(0,0,0|e)}}}),Object.defineProperty(E.prototype,"index_of_color_within_cleaned",{get:function(){return function(e){return(0|this.clean_pxl_colors_lookup_[(0|e)>>>0])-1|0}}}),Object.defineProperty(E.prototype,"set_cleaned_pxl_colors",{get:function(){return function(e,t){this.clean_pxl_colors_[(0|e)>>>0]=(0|t)>>>0,this.clean_pxl_colors_lookup_[(0|t)>>>0]=(e+1|0)>>>0}}}),Object.defineProperty(E.prototype,"increase_color_usage",{get:function(){return function(e){this.pxl_colors_usage_[(0|e)>>>0]=(this.pxl_colors_usage_[(0|e)>>>0]+1|0)>>>0}}}),Object.defineProperty(E.prototype,"set_new_pxls",{get:function(){return function(e,t){this.new_pxls_[(0|e)>>>0]=(0|t)>>>0}}}),Object.defineProperty(E.prototype,"set_new_pxl_colors",{get:function(){return function(e){this.new_pxl_colors_=new _(this.clean_pxl_colors_.buffer.slice(0,k(0|e))),this.set_new_pxl_skin_mask()}}}),Object.defineProperty(E.prototype,"set_new_pxl_skin_mask",{get:function(){return function(){var e=new w(new ArrayBuffer(4)),t=0|this.new_pxl_colors_.length,n=0;for(this.new_pxl_colors_is_skin_mask_=new h.SetFixed(0|t);(0|n)<(0|t);n=n+1|0)this.new_pxl_colors_.get_use_element(0|n,e).skin&&this.new_pxl_colors_is_skin_mask_.add(0|n);this.set_is_skin_ops(this.get_is_skin_ops()+n|0)}}}),Object.defineProperty(E.prototype,"get_a_new_pxl_color_from_pxl_index",{get:function(){return function(e){return 4294967295&this.new_pxl_colors_.buffer_getUint32(this.new_pxls_[0|e])}}}),Object.defineProperty(E.prototype,"reset_cluster",{get:function(){return function(){this.max_cluster_=this.new_pxl_colors_.length>65536?65537:this.new_pxl_colors_.length>16384?4097:this.new_pxl_colors_.length>8192?257:this.new_pxl_colors_.length>512?17:1,this.length_clusters_.fill(0,0,0|this.max_cluster);for(var e=0;(0|e)<(0|this.max_cluster);e=(e+1|0)>>>0)this.index_clusters_[0|e]=[]}}}),Object.defineProperty(E.prototype,"reset_original_data",{get:function(){return function(){this.new_pxl_colors_=new _(this.original_pxl_colors_.slice(0,this.original_pxl_colors_.length).buffer),this.new_pxls_=this.original_pxls_.slice(0,this.original_pxls_.length)}}}),Object.defineProperty(E.prototype,"add_in_indexes_cluster",{get:function(){return function(e,t){this.index_clusters_[(0|e)>>>0].push((0|t)>>>0)}}}),Object.defineProperty(E.prototype,"set_all_cluster_indexes",{get:function(){return function(){for(var e=0,t=0;(0|e)<(0|this.max_cluster);e=(e+1|0)>>>0)this.all_index_clusters_.set(this.index_clusters_[(0|e)>>>0],(0|t)>>>0),t=(t+this.get_length_in_index_clusters(0|e)|0)>>>0}}}),Object.defineProperty(E.prototype,"get_length_in_index_clusters",{get:function(){return function(e){return(0|this.index_clusters_[(0|e)>>>0].length)>>>0}}}),Object.defineProperty(E.prototype,"get_in_cluster_lengths",{get:function(){return function(e){return(0|this.length_clusters_[(0|e)>>>0])>>>0}}}),Object.defineProperty(E.prototype,"get_an_index_in_clusters",{get:function(){return function(e){return(0|this.all_index_clusters_[0|e])>>>0}}}),Object.defineProperty(E.prototype,"get_a_color_usage",{get:function(){return function(e){return(0|this.pxl_colors_usage_[0|e])>>>0}}}),Object.defineProperty(E.prototype,"set_a_color_usage",{get:function(){return function(e,t){return this.pxl_colors_usage_[0|e]=(0|t)>>>0}}}),Object.defineProperty(E.prototype,"get_a_color_usage_percent",{get:function(){return function(e){return g(this.pxl_colors_usage_[0|e]/this.new_pxls_.length)}}}),Object.defineProperty(E.prototype,"get_average_color_usage_percent",{get:function(){return function(e,t){var n,r,a;for(t=0|((t|=0)<(e|=0)?this.pxl_colors_usage_.length:t),n=0,r=0,a=0,r=0|e;(0|r)<(0|t);r=(r+1|0)>>>0)a=(0|this.get_an_index_in_clusters((0|r)>>>0))>>>0,n+=this.pxl_colors_usage_[0|a]/this.new_pxls_.length;return n/(t-e|0)}}}),Object.defineProperty(E.prototype,"get_a_new_pxl_color",{get:function(){return function(e){return this.new_pxl_colors_.get_new_element(0|e)}}}),Object.defineProperty(E.prototype,"is_pxl_color_skin",{get:function(){return function(e){return this.new_pxl_colors_is_skin_mask_.has(0|e)}}}),Object.defineProperty(E.prototype,"max_cluster",{get:function(){return 0|this.max_cluster_}}),Object.defineProperty(E.prototype,"new_pxls_length",{get:function(){return 0|this.new_pxls_.length}}),Object.defineProperty(E.prototype,"new_pxl_colors_length",{get:function(){return 0|this.new_pxl_colors_.length}}),Object.defineProperty(E.prototype,"best_color_number",{get:function(){return 0|this.best_color_number_}}),Object.defineProperty(E.prototype,"get_data",{get:function(){return function(){return Array.of(this.new_pxls_,this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length),{deduplicate:this.get_remove_duplicate_ops(),simplify:this.get_simplify_ops(),classify:this.get_classify_on_x_bits_ops(),skin:this.get_is_skin_ops(),blend:this.get_blend_ops(),match:this.get_match_ops()})}}}),E.prototype.output=function(e){var t,n;return e=e||"heap",t=this.get_data(),"heap"==e?((n=new Uint32Array(2+t[0].length+t[1].length))[0]=0|t[0].length,n[1]=0|t[1].length,n.set(t[0],2),n.set(t[1],2+t[0].length),n.buffer):t},E.prototype.deduplicate=function(){var e,t,n,r,a;for(this.set_remove_duplicate_ops(this.get_remove_duplicate_ops()+1|0),this.reset_deduplicate(0|this.new_pxl_colors_length),e=0,t=0,n=0,r=0,a=0|this.new_pxls_length;(0|r)<(0|a);r=(r+1|0)>>>0)t=0|this.get_a_new_pxl_color_from_pxl_index(0|r),-1==(0|(n=0|this.index_of_color_within_cleaned(0|t)))&&(this.set_cleaned_pxl_colors(0|e,0|t),n=0|e,e=e+1|0),this.increase_color_usage(0|n),this.set_new_pxls(0|r,0|n);this.set_new_pxl_colors(e)},E.prototype.clusterize=function(){this.reset_cluster();var e=0;if(65537===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon16bits)>>>0,(0|e)>>>0);else if(4097===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon12bits)>>>0,(0|e)>>>0);else if(257===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon8bits)>>>0,(0|e)>>>0);else if(17===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon4bits)>>>0,(0|e)>>>0);else for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster(0,(0|e)>>>0);this.max_cluster>1&&this.set_classify_on_x_bits_ops(this.get_classify_on_x_bits_ops()+this.new_pxl_colors_length),this.set_all_cluster_indexes()},E.prototype.process_threshold=function(e){var t,n,r,a,i,o,l,s,u,c,f,d,h,p,m,b,x,_,k,E,M,P,A,C,S,O;for(n=function(e,n){return g(Math.pow(e,t)/n)}(e=(0|e)>>>0,Math.pow(128,t=1)),r=0,a=[],i=[],o=0,l=0,c=!1,f=!1,d=0,h=0,p=0,m=0,b=0,x=0,_=g(n),M=0,P=0,A=0,C=0,S=0,O=0,E=g(_*y),k=g(_*v);(0|S)<(0|this.max_cluster);S=(S+1|0)>>>0){for(l=(o+((0|this.get_length_in_index_clusters(0|S))>>>0)|0)>>>0,b=this.get_average_color_usage_percent(0|o,0|l),A=0|o;(0|A)<(0|l);A=(A+1|0)>>>0){if(M=(0|this.get_an_index_in_clusters((0|A)>>>0))>>>0,s=this.get_a_new_pxl_color((0|M)>>>0),c=this.is_pxl_color_skin((0|M)>>>0),(0|(d=(0|this.get_a_color_usage((0|M)>>>0))>>>0))>0)for(a=[],C=0|o;(0|C)<(0|l);C=(C+1|0)>>>0)P=(0|this.get_an_index_in_clusters((0|C)>>>0))>>>0,u=this.get_a_new_pxl_color((0|P)>>>0),f=this.is_pxl_color_skin((0|P)>>>0),0|(h=(0|this.get_a_color_usage((0|P)>>>0))>>>0)&&(0|M)!=(0|P)&&(0|c)==(0|f)&&(p=this.get_a_color_usage_percent((0|M)>>>0)/b,m=this.get_a_color_usage_percent((0|P)>>>0)/b,O=g((O=c&&f?E:c||f?k:_)*(0*Math.abs(p-m)+.2*(2-(p+m))/2+.8)/1),s.cie76_match_with(u,O)&&(x=g(h/d),r++,this.set_a_color_usage(0|P,0),a.push(u),i.push(x)));(0|a.length)>0&&(w.blend_all(s,a,i),a=[],i=[])}o=0|l}return r},E.prototype.round=function(){var e,t;if(this.new_pxl_colors_length>2048){for(e=0|(this.new_pxl_colors_length>6e4?4:this.new_pxl_colors_length>32e3?3:this.new_pxl_colors_length>16e3?2:this.new_pxl_colors_length>8192?1.5:this.new_pxl_colors_length>4096?1.25:1),t=0;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.get_a_new_pxl_color((0|t)>>>0).simplify(e);this.set_simplify_ops(this.get_simplify_ops()+this.new_pxl_colors_length)}},E.prototype.init=function(e){return this.round(),this.deduplicate(),this.clusterize(),this},E.prototype.reset_original=function(){return this.reset_original_data(),this},E.prototype.run=function(){var e=0;if(this.new_pxl_colors_length<=this.best_color_number)return this.reset_original(),this.deduplicate(),this.clusterize(),this;for(;this.new_pxl_colors_length>this.best_color_number&&e<100;)e++,this.process_threshold(0|e)>0&&(this.deduplicate(),this.clusterize());return this.reset_original(),this.deduplicate(),this.clusterize(),this.process_threshold(0|e),this.deduplicate(),this.clusterize(),this},E.split_image_data=function(e){var t,n,r=new Uint32Array(e.data.buffer),a=Uint32Array.from(new Set(r)),i={},o=a.length,l=new Uint32Array(r.length);for(t=0,n=0|o;(0|t)<(0|n);t=(t+1|0)>>>0)i[a[0|t]]=(0|t)>>>0;for(t=0,n=0|r.length;(0|t)<(0|n);t=(t+1|0)>>>0)l[0|t]=(0|i[r[0|t]])>>>0;return[l,a,r,o]},f=function(e,t){return new Promise((function(n){var r,i,o,l,f,h,p=E.split_image_data(e),m=d(p,4),g=m[0],v=m[1],y=m[2],b=m[3],x=Date.now(),w="auto"===t,_=parseFloat(t)>0&&parseFloat(t)<1,k=parseInt(t)<0,M=w?"auto":_||k?k?Math.max(1,b+parseInt(t)):_?Math.max(1,parseFloat(t)*b):b:parseInt(t);if("auto"===M&&(M=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,f=o,d=-1/0;for(t=o;t<=l;t++)n=a(e,t),r=s(new Uint8Array(n.buffer)),(i=u(e,n)/(c(e,n)+1)-r)>d&&(d=i,f=t);return f}(e.data,32,96)),M>=b)n([e,g,v,0,v.length,0]);else{for(r=E({pxls:g,pxl_colors:v,number_of_color:Math.min(b,M),width:e.width,height:e.height}).init().run().output("split"),i=Date.now(),l=0|(o=r[0]).length,f=r[1],h=0;(0|h)<(0|l);h=(h+1|0)>>>0)y[0|h]=(0|f[(0|o[0|h])>>>0])>>>0;n([e=new ImageData(new Uint8ClampedArray(y.buffer),e.width,e.height),o,f,b-f.length,f.length,i-x])}}))},e.exports={QuantiMatGlobal:f,QuantiMat:E}},656:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strength=t,this.tilesManager=n,this.tiles=n.getTiles(),this.width=r,this.height=a}},658:function(e,t,n){"use strict";var r,a;Object.defineProperty(t,"__esModule",{value:!0}),r=(a=n(670))&&a.__esModule?a:{default:a},t.default=r.default.pool({minWorkers:0,maxWorkers:3})},660:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4&&i<=32;)t=e[i],e[2*i-1],e[2*i],e[2*i+1],e[4*i-1],e[4*i],e[4*i+1],a<(n=t*i*(1+.1*i))&&(a=n,o=i),i++;return r=0,e.forEach((function(e,t){r+=e*t})),{tileSize:o,certainty:Math.fround(o*e[o]/r)}}var n,r,a,i,o,l,s,u=e.width,c=e.height,f=new Uint32Array(e.data.buffer),d=64,h=new Uint32Array(d),p=new Uint32Array(d),m=0,g=new Uint32Array(2);for(n=0;n1&&m0&&m1&&m0&&m>24&255)-(t>>24&255)),s((e>>16&255)-(t>>16&255)),s((e>>8&255)-(t>>8&255))),r=Uint16Array.of(u(n[0],n[0]),u(n[1],n[1]),u(n[2],n[2]));return(0|Math.sqrt((((r[0]<<1)+r[0]|0)+(r[1]<<2)+(r[2]<<1)|0)/10))>>>0}},{key:"quantizeImageData",value:function(e,t){var n,r,a,o,s=e.getImageData(0,0,e.canvas.width,e.canvas.height),u=Date.now(),c=l.QuantiMat.split_image_data(s),f=i(c,2),d=f[0],h=f[1],p=Date.now(),m=(0,l.QuantiMat)({pxls:d,pxl_colors:h,number_of_color:Math.min(h.length,t),width:s.width,height:s.height}).init().run().output("split"),g=Date.now();for(console.log(p-u,g-p),n=m[0],r=m[1],a=new Uint32Array(n.length),o=0;oo&&(i=l,o=t[l]);return i}},{key:"_calculateElbowStrength",value:function(e,t){var n,r,i,o=e.map((function(t,n){return n/(e.length-1)})),l=Math.max.apply(Math,a(e)),s=Math.min.apply(Math,a(e)),u=e.map((function(e){return(e-s)/(l-s)})),c=[0,u[0]],f=[1,u[u.length-1]],d=[o[t],u[t]],h=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2)),p=Math.abs(((i=f)[1]-(r=c)[1])*(n=d)[0]-(i[0]-r[0])*n[1]+i[0]*r[1]-i[1]*r[0])/Math.sqrt(Math.pow(i[1]-r[1],2)+Math.pow(i[0]-r[0],2));return Math.fround(p/h)}}]),e}(),t.default=c},661:function(e,t,n){"use strict";var r,a;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n1&&void 0!==arguments[1]&&arguments[1],r=(0,a.default)(e);return n&&(t=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/gi,r.match(t).forEach((function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,a=[],i=!0,o=!1,l=void 0;try{for(n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(a.push(r.value),3!==a.length);i=!0);}catch(s){o=!0,l=s}finally{try{!i&&n.return&&n.return()}finally{if(o)throw l}}return a}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.match(/\w\w/g).map((function(e){return parseInt(e,16)}))),n=t[0],a=t[1],i=t[2],o=Math.round((n+a+i)/3),l=function(e,t,n){return e=e.toString(16),t=t.toString(16),n=n.toString(16),1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n}(o,o,o);r=r.replace(e,l)}))),(0,i.default)(r)}},666:function(e,t,n){"use strict";function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,n){return function r(a,i){var o,l;try{l=(o=t[a](i)).value}catch(s){return void n(s)}if(!o.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(l)}("next")}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=function(){function e(e,t){var n,r;for(n=0;ni?"Process will start after "+a+" remaining job"+(a?"s":""):"Process will start immediately"),this.msgCallback(o);break;case"progress":s="Processing: "+(l=(t.progress_data||[])[0]||{}).index+"/"+l.length+" "+l.unit+".",this.msgCallback(s)}}catch(u){}}},{key:"generateRandomId",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t="";e>=6;)t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0"),e-=6;return e>0&&(t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0").slice(0,e)),t}},{key:"getHeadersJson",value:function(){return{"Content-Type":"application/json"}}},{key:"getHeadersStream",value:function(){return{accept:"text/event-stream"}}},{key:"getHeadersAll",value:function(){return{accept:"*/*"}}},{key:"getUploadUrl",value:function(e){return this.baseUrl+"/upload?upload_id="+e}},{key:"getCreateImagePathUrl",value:function(e){return this.baseUrl+"/file="+e}},{key:"handleLoadComplete",value:(s=i(regeneratorRuntime.mark((function e(t,n,r,a){var i,o,l,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=void 0===n?"blob":n,i=(t||"/unknown.webp").split("/"),o=i[i.length-1]||"unknown.png",l=o.split(".")[1]||"png",s="image/"+l,l="jpeg"===l?"jpg":l,e.prev=6,e.next=9,new Promise((function(e){var i=new Image;i.setAttribute("crossorigin","anonymous"),i.onload=function(){var t,o,l=i.naturalHeight||i.height,s=i.naturalWidth||i.width;a=a||l,r=r||s;try{switch(n.toLowerCase()){case"base64":!function(){var t=document.createElement("canvas");t.width=r,t.height=a,t.getContext("2d").drawImage(i,0,0,r,a);try{e(t.toDataURL("image/webp",.75))}catch(n){e(t.toDataURL("image/jpeg",.75))}}();break;case"blob":!function(){var t=document.createElement("canvas");t.width=r,t.height=a,t.getContext("2d").drawImage(i,0,0,r,a);try{t.toBlob(e,"image/webp",.75)}catch(n){t.toBlob(e,"image/jpeg",.75)}}();break;case"imagedata":(o=document.createElement("canvas")).width=r,o.height=a,(t=o.getContext("2d")).drawImage(i,0,0,r,a),e(t.getImageData(0,0,r,a,{colorSpace:"srgb"}))}}catch(u){}},i.setAttribute("src",t)}));case 9:u=e.sent,e.t0=n,e.next="blob"===e.t0?13:"base64"===e.t0?15:"imagedata"===e.t0?16:17;break;case 13:return c=new File([u],o,{type:s}),e.abrupt("return",Promise.resolve(c));case 15:case 16:return e.abrupt("return",Promise.resolve(u));case 17:e.next=23;break;case 19:return e.prev=19,e.t1=e.catch(6),console.error("Error creating file from URL:",e.t1),e.abrupt("return",Promise.reject());case 23:case"end":return e.stop()}}),e,this,[[6,19]])}))),function(e,t,n,r){return s.apply(this,arguments)})},{key:"uploadFile",value:(a=i(regeneratorRuntime.mark((function e(t,n){var r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("files",t),e.next=4,fetch(this.getUploadUrl(n),{method:"POST",body:r});case 4:return a=e.sent,e.next=7,a.json();case 7:return i=e.sent,e.abrupt("return",Promise.resolve(i[0]||i));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"fetchEventSource",value:(r=i(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersAll(),method:"GET"});case 2:return n=e.sent,e.abrupt("return",Promise.resolve(n.body.getReader()));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"fetchEventSourceJSON",value:(n=i(regeneratorRuntime.mark((function e(t){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersJson(),method:"GET"});case 2:return n=e.sent,e.next=5,n.clone().text();case 5:return r=e.sent,a=r.replaceAll("event: complete\ndata: ",""),e.prev=7,e.abrupt("return",Promise.resolve(JSON.parse(a)));case 11:return e.prev=11,e.t0=e.catch(7),e.abrupt("return",Promise.reject());case 14:case"end":return e.stop()}}),e,this,[[7,11]])}))),function(e){return n.apply(this,arguments)})},{key:"readResponse",value:(t=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a=!1,i=null;case 4:if(a){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,l=o.value,s=o.done,a=a||s,r+=n.decode(l||new Uint8Array,{stream:!0}),u=(r||"\n").split("\n"),c=!0,f=!1,d=void 0,e.prev=16,h=u[Symbol.iterator]();!(c=(p=h.next()).done);c=!0)m=(m=p.value).trim(),this.message(m),console.log(m),m.includes("complete")&&(a=!0,i=m);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),f=!0,d=e.t0;case 24:e.prev=24,e.prev=25,!c&&h.return&&h.return();case 27:if(e.prev=27,!f){e.next=30;break}throw d;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=u[u.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(i));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return t.apply(this,arguments)})}]),e}(),u=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-sd3-long-captioner-v2.hf.space",e))}var n,s,u;return a(t,e),l(t,[{key:"getCreateCaptionsUrl",value:function(){return this.baseUrl+"/call/create_captions_rich"}},{key:"getReadCaptions",value:function(e){try{return JSON.parse(e.slice(5))}catch(t){return""}}},{key:"readResponse",value:(u=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a=!1,i=null;case 4:if(a){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,l=o.value,s=o.done,a=a||s,r+=n.decode(l||new Uint8Array,{stream:!0}),u=(r||"\n").split("\n"),c=!0,f=!1,d=void 0,e.prev=16,h=u[Symbol.iterator]();!(c=(p=h.next()).done);c=!0)m=(m=p.value).trim(),this.message(m),m.includes("complete")&&(a=!0,i=m);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),f=!0,d=e.t0;case 24:e.prev=24,e.prev=25,!c&&h.return&&h.return();case 27:if(e.prev=27,!f){e.next=30;break}throw d;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=u[u.length-1],e.next=4;break;case 35:return e.abrupt("return",a?Promise.resolve(i):Promise.reject("Error"));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return u.apply(this,arguments)})},{key:"createCaptions",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this.getCreateCaptionsUrl(),{method:"POST",headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:t}]})});case 2:return n=e.sent,e.prev=3,e.next=6,n.json();case 6:return r=e.sent,e.abrupt("return",Promise.resolve(r.event_id));case 10:return e.prev=10,e.t0=e.catch(3),e.abrupt("return",Promise.reject("Error"));case 13:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(e){return s.apply(this,arguments)})},{key:"run",value:(n=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:n=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}n=t,e.next=12;break;case 11:return e.abrupt("return",Promise.reject());case 12:return r=this.generateRandomId(),e.next=15,this.uploadFile(n,r);case 15:return a=e.sent,i=this.getCreateCaptionsUrl(),e.next=19,this.createCaptions(a);case 19:return o=e.sent,e.abrupt("return",this.fetchEventSourceJSON(i+"/"+o).then((function(e){return e[0]})).catch((function(){return""})));case 21:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(s),c=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-florence-2.hf.space",e))}var n;return a(t,e),l(t,[{key:"getPredictHeader",value:function(e,t,n,r,a,i){return i=i||1,{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},1===i?"Caption":2===i?"Detailed Caption":"More Detailed Caption","","microsoft/Florence-2-large"],event_data:null,fn_index:4,trigger_id:10,session_hash:a}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readLine",value:function(e,t){var n,r,a;console.log(e),e=e.slice(5);try{return(n=JSON.parse(e)).success?(r=((n.output||{}).data||[])[0],a=1===t?r.slice(15,r.length-2):2===t?r.slice(24,r.length-2):r.slice(29,r.length-2),Promise.resolve(a.replaceAll("\\n","").replaceAll("\n",""))):Promise.reject("")}catch(i){return Promise.reject()}}},{key:"run",value:(n=i(regeneratorRuntime.mark((function e(t,n){var r,a,i,o,l,s,u,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 32:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(),e.next=15,this.uploadFile(r,a);case 15:return i=e.sent,o=this.getCreateImagePathUrl(i),l=this.getPredictHeader(i,o,r.size,r.type,a,n),e.next=20,fetch(this.getQueueJoinUrl(),l);case 20:return s=e.sent,e.next=23,s.json();case 23:if(!e.sent.event_id){e.next=32;break}return e.next=28,this.fetchEventSource(this.getResultUrl(a));case 28:return u=e.sent,e.abrupt("return",this.readResponse(u).then((function(e){return c.readLine(e,n)})).catch((function(){return Promise.reject()})));case 33:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s),f=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://kenjiedec-rembg.hf.space",e))}var n;return a(t,e),l(t,[{key:"getQueuePushUrl",value:function(){return this.baseUrl+"/api/queue/push/"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({action:"predict",data:[e,"Mask only","isnet-general-use"],fn_index:0,session_hash:t}),method:"POST"}}},{key:"getQueueStatusUrl",value:function(){return this.baseUrl+"/api/queue/status/"}},{key:"getResultHeader",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({hash:e}),method:"POST"}}},{key:"run",value:(n=i(regeneratorRuntime.mark((function e(t,n,r){var a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=i(regeneratorRuntime.mark((function e(o,l){var s,u,c,f,d,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=void 0,"string"==typeof t){e.next=7;break}return e.next=4,a.handleLoadComplete(t,"base64");case 4:s=e.sent,e.next=14;break;case 7:if(!t.startsWith("blob:")){e.next=13;break}return e.next=10,a.handleLoadComplete(t,"base64");case 10:s=e.sent,e.next=14;break;case 13:s=t;case 14:return u=a.generateRandomId(),e.next=17,fetch(a.getQueuePushUrl(),a.getPredictHeader(s,u));case 17:return e.next=19,e.sent.json();case 19:c=e.sent,f=c.hash,d=setTimeout((function(){clearInterval(h),l()}),1e4),h=setInterval(i(regeneratorRuntime.mark((function e(){var t,i,l,s,u,c,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(a.getQueueStatusUrl(),a.getResultHeader(f));case 2:return e.next=4,e.sent.json();case 4:if(t=e.sent,i=t.data||{},!(l=i.data||[]).length){e.next=18;break}return e.next=10,a.handleLoadComplete(l[0],"imagedata",n,r);case 10:for(s=e.sent,u=s.data,c=[],p=0,m=u.length;(0|p)<(0|m);p=p+4|0)(0|(u[0|p]+u[p+1|0]+u[p+2|0]|0)/3)<32&&c.push(p/4|0);o(c),clearInterval(h),clearTimeout(d);case 18:case"end":return e.stop()}}),e,a)}))),1e3);case 23:case"end":return e.stop()}}),e,a)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})}]),t}(s),d=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://pixart-alpha-pixart-sigma.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictHeader",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:512,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"(No style)",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"bad shape, disformed, photography, photo, realistic, photo-realistic.",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"DPM-Solver",s=this.generateRandomSeed();return i="string"==typeof i?i:["(No style)","Pixel Art","Digital Art","Anime","Manga"][i],{headers:this.getHeadersJson(),body:JSON.stringify({data:["A pixel art (retro style video game palette artwork) of : "+e,o,i,!0,a,s,n,r,l,4.5,3.5,17,25,!0],event_data:null,fn_index:3,trigger_id:7,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a=!1,i=null;case 4:if(a){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,l=o.value,s=o.done,a=a||s,r+=n.decode(l||new Uint8Array,{stream:!0}),u=(r||"\n").split("\n"),c=!0,f=!1,d=void 0,e.prev=16,h=u[Symbol.iterator]();!(c=(p=h.next()).done);c=!0)m=(m=p.value).trim(),this.message(m),m.includes("complete")&&(a=!0,i=m);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),f=!0,d=e.t0;case 24:e.prev=24,e.prev=25,!c&&h.return&&h.return();case 27:if(e.prev=27,!f){e.next=30;break}throw d;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=u[u.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(i));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return s.apply(this,arguments)})},{key:"extractLastImageUrl",value:function(e,t){var n,r,a,i,o,l,s;try{for(console.log(e),n=JSON.parse(e.slice(5).trim()),r=[],a=n.output.data||[],i=0;i1&&void 0!==arguments[1]?arguments[1]:512,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,h=this,p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,m=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"imagedata";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.generateRandomId(),r=this.getPredictHeader(t,n,f,d,p,1),a=this.getQueueJoinUrl(),e.next=5,fetch(a,r);case 5:return i=e.sent,e.next=8,i.json();case 8:if(!e.sent.event_id){e.next=27;break}return e.next=13,this.fetchEventSource(this.getResultUrl(n));case 13:return o=e.sent,e.next=16,this.readResponse(o);case 16:if(l=e.sent,1!==(s=this.extractLastImageUrl(l)).length){e.next=26;break}return u=s[0],e.next=22,this.handleLoadComplete(u,m);case 22:return c=e.sent,e.abrupt("return",Promise.resolve(c));case 26:return e.abrupt("return",Promise.allSettled([s.map((function(){return h.handleLoadComplete(a,m)}))]));case 27:return e.abrupt("return",Promise.reject());case 28:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(s),h=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://abidlabs-face-to-all.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,a,i){var o="A 2D illustration in retro game style pixel art of "+a.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. Video game, low color number, high quality."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real, CGI, 3D.",.95,null,.9,.12,7.75,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:i}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a="",i=!1;case 3:if(i){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,l=o.value,s=o.done,i=i||s,r+="".concat(n.decode(l||new Uint8Array,{stream:!0})),u=(r||"\n").split("\n"),c=0;c2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 47:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(),i=this.generateRandomId(),o=this.getPredictHeader(x,i),l=this.getPredictUrl(),e.next=18,fetch(l,o);case 18:return s=e.sent,u=s.ok,e.next=22,this.uploadFile(r,a);case 22:if(c=e.sent,f=this.getCreateImagePathUrl(c),!u||!f){e.next=47;break}return d=this.getQueueJoinHeader(c,f,r.size,r.type,n,i),h=this.getQueueJoinUrl(),e.next=29,fetch(h,d);case 29:return p=e.sent,e.next=32,p.json();case 32:if(void 0===e.sent.event_id){e.next=47;break}return m=this.getQueueDataUrl(i),e.next=38,this.fetchEventSource(m);case 38:return g=e.sent,e.next=41,this.readResponse(g);case 41:return v=e.sent,y=this.extractSecondImageUrl(v),e.next=45,this.handleLoadComplete(y);case 45:return b=e.sent,e.abrupt("return",Promise.resolve(b));case 48:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s),p=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://multimodalart-face-to-all.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,a,i){var o="A pixel art person image in lucasarts of : "+a.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, Photography, Real, Photo-realistic, Screenshot, Filters, Retro, Bad Quality, Worst settings.",.9,null,.85,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:i}),method:"POST"}}},{key:"getUselessBullshit",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[null,null],event_data:null,fn_index:5,trigger_id:18,session_hash:e}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a="",i=!1;case 3:if(i){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,l=o.value,s=o.done,i=i||s,r+="".concat(n.decode(l||new Uint8Array,{stream:!0})),u=(r||"\n").split("\n"),c=0;c2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 57:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(8),i=this.generateRandomId(11),o=this.getPredictHeader(w,i),l=this.getPredictUrl(),e.next=18,fetch(l,o);case 18:return s=e.sent,u=s.ok,e.next=22,this.uploadFile(r,a);case 22:if(c=e.sent,f=this.getCreateImagePathUrl(c),!u||!f){e.next=57;break}return d=this.getQueueJoinHeader(c,f,r.size,r.type,n,i),h=this.getQueueJoinUrl(),e.next=29,fetch(h,d);case 29:if(!(p=e.sent).ok){e.next=57;break}return e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=57;break}return m=this.getQueueDataUrl(i),e.next=40,fetch(m,this.getUselessBullshit(i));case 40:if(!(g=e.sent).ok){e.next=57;break}return e.next=44,g.json();case 44:if(!e.sent.event_id){e.next=57;break}return e.next=48,this.fetchEventSource(m);case 48:return v=e.sent,e.next=51,this.readResponse(v);case 51:return y=e.sent,b=this.extractSecondImageUrl(y),e.next=55,this.handleLoadComplete(b);case 55:return x=e.sent,e.abrupt("return",Promise.resolve(x));case 58:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s),m=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://neil-ni-face-to-all.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,a,i){var o="A pixel art person image in lucasarts of : "+a.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real.",.95,null,.9,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:i}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a="",i=!1;case 3:if(i){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,l=o.value,s=o.done,i=i||s,r+="".concat(n.decode(l||new Uint8Array,{stream:!0})),u=(r||"\n").split("\n"),c=0;c2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 49:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(),i=this.generateRandomId(),o=this.getPredictHeader(x,i),l=this.getPredictUrl(),e.next=18,fetch(l,o);case 18:return s=e.sent,e.next=21,s.json();case 21:return u=e.sent,e.next=24,this.uploadFile(r,a);case 24:if(c=e.sent,f=this.getCreateImagePathUrl(c),!u||!f){e.next=49;break}return d=this.getQueueJoinHeader(c,f,r.size,r.type,n,i),h=this.getQueueJoinUrl(),e.next=31,fetch(h,d);case 31:return p=e.sent,e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=49;break}return m=this.getQueueDataUrl(i),e.next=40,this.fetchEventSource(m);case 40:return g=e.sent,e.next=43,this.readResponse(g);case 43:return v=e.sent,y=this.extractSecondImageUrl(v),e.next=47,this.handleLoadComplete(y);case 47:return b=e.sent,e.abrupt("return",Promise.resolve(b));case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s);e.exports={HuggingFaceAPI:s,FaceToAllAPI:h,FaceToAllAPI2:p,FaceToAllAPI3:m,FloranceCaptionerAPI:c,LongCaptionerAPI:u,RemoveBackgroundAPI:f,ImageCreatorAPI:d}},667:function(e,t,n){"use strict";var r=n(668);e.exports={createLocalBlob:function(e){var t,n,a,i,o=(e.match(/(data\:([a-z]+\/[a-z\+]+)\;base64\,)([a-zA-Z0-9\/\+]+\(\=+)?/)||[,,])[1];return o?(n=(t=o.match(/data\:([a-z]+\/[a-z\+]+)\;base64\,/)[1]).match(/[a-z]+\/([a-z\+]+)/)[1],e=e.replace(o,""),a=(0,r.base64ToBytes)(e),i=new File([a],"name."+n,{type:t}),URL.createObjectURL(i)):""}}},668:function(e,t,n){"use strict";var r=new(n(265).B64chromium);e.exports={bytesToBase64:r.bytesToBase64.bind(r),base64ToBytes:r.base64ToBytes.bind(r)}},675:function(e,t,n){"use strict";var r,a=n(676),i=Object.getPrototypeOf((r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e,this)})),function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(a,i){var o,l;try{l=(o=e[a](i)).value}catch(s){return void n(s)}if(!o.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))})).constructor,o=Object.getPrototypeOf((function(){})).constructor,l=new o('var t = function(file) {\n "use strict";\n \n try {\n \n return new Promise(function(resolve, _) {\n resolve(new FileReaderSync().readAsDataURL(file));\n });\n \n } catch(error) {\n \n return new Promise(function(resolve, _) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(file);\n });\n }\n \n}; return t;')(),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(l,[e]).catch((function(t){return l(e)})).timeout(5e3).then((function(e){t(e)})):l(e).then((function(e){t(e)}))},u=new i('var t = async function(base64) {\n\n "use strict";\n\n return fetch(base64).then(function(res) {\n\n return res.blob().then(function(blb){\n\n return createImageBitmap(blb, {\n resizeQuality: "pixelated",\n premultiplyAlpha: \'premultiply\'\n });\n });\n });\n\n}; return t;')(),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(u,[e]).catch((function(t){return u(e)})).timeout(5e3).then((function(e){t(e)})):u(e).then((function(e){t(e)}))},f=function(e){for(var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2073600,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=1;Math.round(e.width*i)*Math.round(e.height*i)>r;)i-=.01;try{createImageBitmap(e,0,0,e.width,e.height,{resizeWidth:Math.round(e.width*i),resizeHeight:Math.round(e.height*i),resizeQuality:"pixelated",premultiplyAlpha:"premultiply"}).then((function(e){var t,n=void 0;try{n=new OffscreenCanvas(e.width,e.height)}catch(r){(n=document.createElement("canvas")).width=e.width,n.height=e.height}(t=n.getContext("2d")).imageSmoothingEnabled=!1,t.drawImage(e,0,0,e.width,e.height),a(t.getImageData(0,0,e.width,e.height))}))}catch(o){t=void 0;try{t=new OffscreenCanvas(Math.round(e.width*i),Math.round(e.height*i))}catch(l){(t=document.createElement("canvas")).width=Math.round(e.width*i),t.height=Math.round(e.height*i)}(n=t.getContext("2d")).imageSmoothingEnabled=!1,n.drawImage(e,0,0,t.width,t.height),a(n.getImageData(0,0,t.width,t.height))}},d=new o('var t = function(imagedata, type) {\n\n "use strict"\n type = type || "image/png";\n var quality = type.includes("webp") ? 1: type.includes("png") ? undefined: 0.7;\n try {\n \n return new Promise(function(resolve, _) {\n\n createImageBitmap(imagedata, 0, 0, imagedata.width, imagedata.height, {\n premultiplyAlpha: \'premultiply\',\n resizeQuality: \'pixelated\'\n }).then((bmp) => {\n \n var canvas;\n canvas = new OffscreenCanvas(imagedata.width, imagedata.height);\n var ctx = canvas.getContext("bitmaprenderer");\n ctx.imageSmoothingEnabled = false;\n ctx.transferFromImageBitmap(bmp);\n \n canvas.convertToBlob({type: type, quality: quality}).then((blb) => {\n try {\n resolve(new FileReaderSync().readAsDataURL(blb));\n } catch(e2) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(blb);\n }\n });\n });\n });\n \n }catch (e) {\n \n return new Promise(function(resolve, _) {\n var canvas = document.createElement("canvas");\n canvas.width = imagedata.width;\n canvas.height = imagedata.height;\n var ctx = canvas.getContext("2d");\n ctx.imageSmoothingEnabled = false;\n ctx.putImageData(imagedata, 0, 0);\n \n var base64 = canvas.toDataURL(type, quality);\n canvas = null;\n resolve(base64);\n });\n }\n\n}; return t;')();e.exports={file_to_imagedata_resized:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Date.now(),e.type,"image/jpg"!==e.type&&e.type,e.type,s(e,(function(e){c(e,(function(e){f(e,t,(function(e){n(e)}),r)}),r)}),r)},file_to_base64:s,base64_to_bitmap:c,bitmap_to_imagedata:f,imagedata_to_base64:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null!==r?r.exec(d,[e,t]).catch((function(n){return d(e,t)})).timeout(5e3).then((function(e){n(e)})):d(e,t).then((function(e){n(e)}))},base64_sanitize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};(function(e,t,n){return n=n||"pixelize",new Promise((function(r,i){var o=new Image,l=e.startsWith("data:image/png;");o.onload=function(){var e,i,s=o.naturalWidth*t,u=o.naturalHeight*t,c=function(e,t,n,r){var i,o,l,s,u=void 0;if("pixelize"===r||"normal"===r){i=void 0,o=void 0;try{i=new OffscreenCanvas(e.width,e.height),o=new OffscreenCanvas(t,n)}catch(c){i=document.createElement("canvas"),o=document.createElement("canvas"),i.width=e.width,i.height=e.height,o.width=t,o.height=n}l=i.getContext("2d"),s=o.getContext("2d"),l.imageSmoothingEnabled=!("normal"!==r),s.imageSmoothingEnabled=!("normal"!==r),l.drawImage(e,0,0,e.width,e.height),s.drawImage(i,0,0,i.width,i.height,0,0,o.width,o.height),u=s}else"doppel"===r&&(u=a.scaler.processImage(e,t,n));return u}(o,0|s,0|u,n);try{e=c.getImageData(0,0,c.canvas.width,c.canvas.height),createImageBitmap(e).then((function(e){var t,n;try{t=new OffscreenCanvas(e.width,e.height)}catch(a){(t=document.createElement("canvas")).height=e.height,t.width=e.width}(n=t.getContext("bitmaprenderer")).imageSmoothingEnabled=!1,n.transferFromImageBitmap(e),t.convertToBlob({type:l?"image/png":"image/jpeg"}).then((function(e){try{r((new FileReaderSync).readAsDataURL(e))}catch(n){var t=new FileReader;t.onload=function(){r(t.result)},t.readAsDataURL(e)}}))}))}catch(f){i=c.canvas,r(i.toDataURL(l?"image/png":"image/jpeg"))}},o.onerror=function(){i()},o.src=e}))})(e,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,arguments[4]).then((function(e){t(e)}))},file_to_bitmap:function(e,t){createImageBitmap(e).then(t)}}},676:function(e,t,n){"use strict";var r,a=(r=n(677))&&r.__esModule?r:{default:r},i=new a.default({strength:1,overlapFactor:1,despeckleStrength:.88});e.exports={scaler:i,ImageProcessor:a.default}},677:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a,i,o,l,s,u,c,f,d,h,p,m;Object.defineProperty(t,"__esModule",{value:!0}),a=function(){function e(e,t){var n,r;for(n=0;n=this.finalWidth||o>=this.finalHeight||l.push(this.tiles[i+o*this.finalWidth]);return l}},{key:"paintTiles",value:function(){this.imageData.data.set(this.tilesColorUint8a),this.contextDestination.putImageData(this.imageData,0,0)}}]),e}(),t.default=o},679:function(e,t,n){"use strict";var r,a,i,o,l,s,u;Object.defineProperty(t,"__esModule",{value:!0}),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,a=[],i=!0,o=!1,l=void 0;try{for(n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(s){o=!0,l=s}finally{try{!i&&n.return&&n.return()}finally{if(o)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){var n,r;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.imageData=t,this.meanColor=new o.default(n),this.coordinates=Uint16Array.of(a,i),r=this.imageData.data.length,this.k=r>=64?6:r>=16?4:r>=9?3:r>=2?2:1}return a(e,[{key:"quantizeColors",value:function(){var e,t=l.QuantiMat.split_image_data(this.imageData),n=r(t,2),a=n[0],i=n[1],o=(0,l.QuantiMat)({pxls:a,pxl_colors:i,number_of_color:Math.min(i.length,this.k),width:this.imageData.width,height:this.imageData.height}).init().run().output("split"),s=o[0],u=o[1],c=s<255?new Uint8Array(u.length):new Uint16Array(u.length);for(e=0;e=o-2&&(s.forEach((function(e){e.meanColor.setRGBA(n.meanColor.rgba);var t=e.x+e.y*r.width;a[t]=!0})),a[u]=!0)},n=0;n0&&a<60&&p.setRGBA(r.rgba);break;case"EDGE":i=new u.default(x[0].data),o=new u.default(x[1].data),s=l.default.colorDifference(i,o),c=l.default.colorDifference(i,p),d=l.default.colorDifference(o,p),5*Math.abs(c-d)>=s&&(h=new u.default(new f.default(g.map((function(e){return e.meanColor.rgba})),4).run(4).centroidsSorted[0].data),p.setRGBA(h.rgba))}}},{key:"determineClassification",value:function(e,t){return e[0].count>=.75*t?"AREA":Math.abs(e[0].count-e[1].count)*Math.abs(e[2].count-e[3].count)<25?"SHAPE":Math.abs(e[0].count-e[1].count)<.75*Math.abs(e[1].count-e[2].count)?"EDGE":"COMPLEX"}}]),t}(i.default),t.default=d},683:function(e,t,n){"use strict";var r,a,i;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;nt&&(t=i,n=a)})),n}},{key:"distance",value:function(e,t){return this.c1.set_from_array(e),this.c2.set_from_array(t),16192*this.c1.fast_match_with(this.c2)|0}},{key:"reassignCentroids",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:16,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(this.initializeCentroids(),e=0,t=!1,n=void 0,r=function(){var r=o.centroids.map((function(e){return Uint32Array.from(e)}));o.assignClusters(),n=o.updateCentroids(),e++,t=o.centroids.every((function(e,t){return o.distance(e,r[t])<2})),s&&!t&&o.reassignCentroids(n)};!t&&e3&&void 0!==arguments[3]?arguments[3]:[32,32,32,32],l=window.innerWidth,s=window.innerHeight;return l<800?(l-=0,s-=56):(l-=384,l-=64,s-=64),a=0,i=0,(r=e/t)_?o*(a-u)+f:s*(a-c)+d),{i:t,j:n,k:r,x:a,y:i,r:(h=v-a)*h+(p=y-i)*p}}function a(e){var t,n,r,a,i,o;for(n=e.length;n;)for(a=e[--n],r=e[--n],t=n;t;)if(o=e[--t],r===(i=e[--t])&&a===o||r===o&&a===i){e.splice(n,2),e.splice(t,2);break}}function i(e,t,n,r){t=(e=e||{width:0,height:0}).width||t||1,n=e.height||n||1;var a=void 0,i=void 0;try{if(!1===r)throw new ErrorEvent("Must support toDataURL later, skipping offrscreen canvas solution.");i=(a=new OffscreenCanvas(t,n)).getContext("2d",{willReadFrequently:!0,desynchronized:r})}catch(o){(a=document.createElement("canvas")).width=t,a.height=n,i=a.getContext("2d",{willReadFrequently:!0})}return e instanceof ImageData?i.putImageData(e,0,0):e.width&&i.drawImage(e,0,0,t,n),{canvas:a,context:i}}var o=function(){function e(e,t){var n,r;for(n=0;nu&&(u=e[t][0]),e[t][1]c&&(c=e[t][1]);return[[(i=l+.5*(n=u-l))-20*(a=Math.max(n,r=c-s)),(o=s+.5*r)-a],[i,o+20*a],[i+20*a,o-a]]}(e),e.push(s[0],s[1],s[2]),u=[r(e,v+0,v+1,v+2)],c=[],f=[],n=o.length;n--;f.length=0){for(g=o[n],i=u.length;i--;)(d=e[g][0]-u[i].x)>0&&d*d>u[i].r?(c.push(u[i]),u.splice(i,1)):d*d+(h=e[g][1]-u[i].y)*h-u[i].r>l||(f.push(u[i].i,u[i].j,u[i].j,u[i].k,u[i].k,u[i].i),u.splice(i,1));for(a(f),i=f.length;i;)m=f[--i],p=f[--i],u.push(r(e,p,m,g))}for(n=u.length;n--;)c.push(u[n]);for(u.length=0,n=c.length;n--;)c[n].ie[0][0]&&t[0]>e[1][0]&&t[0]>e[2][0]||t[1]e[0][1]&&t[1]>e[1][1]&&t[1]>e[2][1]?null:(n=e[1][0]-e[0][0],r=e[2][0]-e[0][0],a=e[1][1]-e[0][1],0==(o=n*(i=e[2][1]-e[0][1])-r*a)?null:(l=(i*(t[0]-e[0][0])-r*(t[1]-e[0][1]))/o,s=(n*(t[1]-e[0][1])-a*(t[0]-e[0][0]))/o,l<0||s<0||l+s>1?null:[l,s]))}},u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{size:16};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.size=t.size,this.delaunay=s}return o(e,[{key:"processImage",value:function(e,t){var n=this;return new Promise((function(r,a){if(!e)throw Error("Image source is undefined");var i=new Image;i.src=e,i.onload=function(){n.polygonize(i,t).then(r)},i.onerror=function(){a(Error("Invalid image source"))}}))}},{key:"polygonize",value:function(e,t){var n=this;return new Promise((function(r){var a,o,l=i(void 0,1,1,!0),s=i(void 0,1,1,!1),u=l.canvas,c=l.context,f=s.canvas,d=s.context,h=e.width*n.size,p=e.height*n.size;u.width=h,u.height=p,f.width=h,f.height=p,c.drawImage(e,0,0,h,p),a=n.generatePoints(h,p),o=n.delaunay.triangulate(a),n.svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg"),n.svgElement.setAttribute("width",d.canvas.width),n.svgElement.setAttribute("height",d.canvas.height),n.drawTriangles(a,o,c,t?void 0:d),t?r(n.getSVGURL()):function(e,t){var n,r;try{e.toBlob((function(e){var n=URL.createObjectURL(e);t(n)}))}catch(a){n=function(e){var t,n=e.split(",")[0].split(":")[1].split(";")[0],r=atob(e.split(",")[1]),a=[];for(t=0;t div > h1":{bottom:"-60px",opacity:0,transition:"all 700ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&:hover > div > p":{bottom:"-40px",opacity:0,transition:"all 700ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},profileBannerImage:{width:"100%",height:"100%",background:"url(data:image/png;base64,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)",backgroundSize:"cover",backgroundPosition:"50% 75%"},profileBannerOverlay:{position:"absolute",borderRadius:"4px",top:0,let:0,width:"100%",height:"100%",transition:"filter 300ms cubic-bezier(0.4, 0, 0.2, 1) 50ms",filter:"opacity(1)",background:"linear-gradient(to top, #000000a1 5%, #00000085 25%, #00000045 50%, #ffffff00 75%)","@media (max-width: 800px)":{background:"linear-gradient(to bottom, #000000a1 5%, #00000085 25%, #00000045 50%, #ffffff00 75%)"},"&:hover, &:active":{filter:"opacity(0)",transition:"filter 600ms cubic-bezier(0.4, 0, 0.2, 1) 100ms"}},"@global":{"@keyframes ripple":{"0%":{transform:"scale(1)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}},"@keyframes float":{"0%":{paddingBottom:"0px"},"50%":{paddingBottom:"5px"},"100%":{paddingBottom:"0px"}},"@keyframes sparkle":{"0%":{boxShadow:"0rem 0rem 0 0rem #ff8080, 0rem 0rem 0 0rem #ff1200, 0rem 0rem 0 0rem #ff6f6f, 0rem 0rem 0 0rem rgba(0, 0, 0, 0.26), 0rem 0rem 0 0rem #ff3073, 0rem 0rem 0 0rem #ff80b5, 0rem 0rem 0 0rem #ff8097, 0rem 0rem 0 0rem #ff8080, 0rem 0rem 0 0rem #ff9280, 0rem 0rem 0 0rem #ff8080, 0rem 0rem 0 0rem #ff3131, 0rem 0rem 0 0rem #ff5151, 0rem 0rem 0 0rem #ff0958, 0rem 0rem 0 0rem #ff8080"},"75%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ff8080, -0.32476rem -2.625rem 0 -0.1875rem #ffed80, 2.54798rem -1.61656rem 0 -0.1875rem #ffed80, 1.84982rem -1.89057rem 0 -0.1875rem #a4ff80, 2.85252rem 0.98418rem 0 -0.1875rem #a4ff80, 2.63145rem 0.2675rem 0 -0.1875rem #80ffc8, 1.00905rem 2.84381rem 0 -0.1875rem #80ffc8, 1.43154rem 2.22414rem 0 -0.1875rem #80c8ff, -1.59425rem 2.562rem 0 -0.1875rem #80c8ff, -0.84635rem 2.50595rem 0 -0.1875rem #a480ff, -2.99705rem 0.35095rem 0 -0.1875rem #a480ff, -2.48692rem 0.90073rem 0 -0.1875rem #ff80ed, -2.14301rem -2.12438rem 0 -0.1875rem #ff80ed, -2.25479rem -1.38275rem 0 -0.1875rem #ff8080"},"100%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ff808000, -0.32476rem -2.625rem 0 -0.1875rem #ffed8000, 2.54798rem -1.61656rem 0 -0.1875rem #ffed8000, 1.84982rem -1.89057rem 0 -0.1875rem #a4ff8000, 2.85252rem 0.98418rem 0 -0.1875rem #a4ff8000, 2.63145rem 0.2675rem 0 -0.1875rem #80ffc800, 1.00905rem 2.84381rem 0 -0.1875rem #80ffc800, 1.43154rem 2.22414rem 0 -0.1875rem #80c8ff00, -1.59425rem 2.562rem 0 -0.1875rem #80c8ff00, -0.84635rem 2.50595rem 0 -0.1875rem #a480ff00, -2.99705rem 0.35095rem 0 -0.1875rem #a480ff00, -2.48692rem 0.90073rem 0 -0.1875rem #ff80ed00, -2.14301rem -2.12438rem 0 -0.1875rem #ff80ed00, -2.25479rem -1.38275rem 0 -0.1875rem #ff808000"}},"@keyframes sparklewhite":{"0%":{boxShadow:"0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem rgba(0, 0, 0, 0.26), 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff, 0rem 0rem 0 0rem #ffffff"},"75%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ffffff, -0.32476rem -2.625rem 0 -0.1875rem #ffffff, 2.54798rem -1.61656rem 0 -0.1875rem #ffffff, 1.84982rem -1.89057rem 0 -0.1875rem #ffffff, 2.85252rem 0.98418rem 0 -0.1875rem #ffffff, 2.63145rem 0.2675rem 0 -0.1875rem #ffffff, 1.00905rem 2.84381rem 0 -0.1875rem #ffffff, 1.43154rem 2.22414rem 0 -0.1875rem #ffffff, -1.59425rem 2.562rem 0 -0.1875rem #ffffff, -0.84635rem 2.50595rem 0 -0.1875rem #ffffff, -2.99705rem 0.35095rem 0 -0.1875rem #ffffff, -2.48692rem 0.90073rem 0 -0.1875rem #ffffff, -2.14301rem -2.12438rem 0 -0.1875rem #ffffff, -2.25479rem -1.38275rem 0 -0.1875rem #ff8080"},"100%":{boxShadow:"0.32476rem -3rem 0 -0.1875rem #ffffff00, -0.32476rem -2.625rem 0 -0.1875rem #ffffff00, 2.54798rem -1.61656rem 0 -0.1875rem #ffffff00, 1.84982rem -1.89057rem 0 -0.1875rem #ffffff00, 2.85252rem 0.98418rem 0 -0.1875rem #ffffff00, 2.63145rem 0.2675rem 0 -0.1875rem #ffffff00, 1.00905rem 2.84381rem 0 -0.1875rem #ffffff00, 1.43154rem 2.22414rem 0 -0.1875rem #ffffff00, -1.59425rem 2.562rem 0 -0.1875rem #ffffff00, -0.84635rem 2.50595rem 0 -0.1875rem #ffffff00, -2.99705rem 0.35095rem 0 -0.1875rem #ffffff, -2.48692rem 0.90073rem 0 -0.1875rem #ffffff00, -2.14301rem -2.12438rem 0 -0.1875rem #ffffff00, -2.25479rem -1.38275rem 0 -0.1875rem #ffffff00"}}},profileImage:{cursor:"pointer",height:224,width:224,background:"url(data:image/png;base64,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)",borderRadius:"50%",position:"absolute",left:154,top:224,margin:0,transform:"translate(-50%, -50%) scale(1)",backgroundPosition:"50% 50%",backgroundSize:"cover",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animation:"$float 1000ms infinite cubic-bezier(0.4, 0, 0.2, 1) 0ms",transformOrigin:"center",zIndex:1,"&:hover":{boxShadow:"0px 7px 8px -4px rgba(0,0,0,0.2), 0px 12px 17px 2px rgba(0,0,0,0.14), 0px 5px 22px 4px rgba(0,0,0,0.12)",transform:"translate(-50%, -50%) scale(1.05)"},"& .MuiBadge-badge":{backgroundColor:"#51d106",color:"#ffffff",boxShadow:"0 0 2px 4px #51d106",width:36,height:36,borderRadius:"50%",fontWeight:"bold",fontSize:"18px","&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"$ripple 0.7s infinite cubic-bezier(0.4, 0, 0.2, 1)",border:"2px solid #51d10699",content:'""'},"&::before":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"$ripple 1.7s infinite cubic-bezier(0.4, 0, 0.2, 1)",border:"1px solid #51d106ee",content:'""'}},"@media (max-width: 800px)":{width:192,height:192,left:128,top:192,"& .MuiBadge-badge":{width:32,height:32,fontSize:"16px"}},"@media (max-width: 532px)":{width:156,height:156,left:96,top:168}},profileInformation:{padding:"156px 16px 24px 16px",margin:0,width:"100%",position:"relative",zIndex:0},profileInformationOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},profileInformationButtons:{position:"absolute",right:0,top:0},followButton:{margin:"16px 4px 8px 8px"},linkButton:{margin:"16px 4px 8px 4px"},drawerHashtag:{"& .MuiDrawer-paper":{width:256,background:"white",contain:"style size paint layout",boxShadow:"-2px 0px 4px 0px rgb(0 0 0 / 20%), -4px 0px 5px 0px rgb(0 0 0 / 14%), -6px 0px 10px 0px rgb(0 0 0 / 12%)",maxHeight:"100%",height:"100%"}},settingButton:{margin:"16px 16px 8px 4px",transform:"rotate(0deg)",transition:"transform 720ms linear 0ms","&:hover":{transform:"rotate(-72deg)"},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"9px !important"}}},profileName:{color:"white",pointerEvents:"none",margin:0,left:297,position:"absolute",fontSize:"48px",bottom:40,transition:"all 350ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",opacity:1,"@media (max-width: 800px)":{left:"32px",top:"16px",bottom:"inherit"}},profileDescription:{color:"white",pointerEvents:"none",left:305,margin:"12px 0px 12px 0px",position:"absolute",fontSize:"18px",bottom:0,opacity:1,transition:"all 350ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:555,"@media (max-width: 800px)":{display:"none"}},profileCards:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileHistory:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileFollowers:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileFollowing:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileWallet:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},profileComments:{width:1152,maxWidth:"100%",margin:"32px auto 16px auto","@media (max-width: 1260px)":{margin:"24px 16px 16px 16px",maxWidth:"calc(100% - 32px)"}},mediaCard:{contain:"paint style layout",cursor:"pointer",width:"100%",maxWidth:"100vw",position:"relative",marginBottom:24,borderRadius:"4px",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)","&:hover":{boxShadow:"0px 7px 8px -4px rgba(0,0,0,0.2), 0px 12px 17px 2px rgba(0,0,0,0.14), 0px 5px 22px 4px rgba(0,0,0,0.12)"}},media:{width:"100%",height:"100%",borderRadius:"4px",position:"relative"},mediaOverlay:{overflow:"hidden","& > .top":{position:"absolute",textAlign:"left",left:4,"& > button, & > button:nth-child(1), & > button:nth-child(2), & > button:nth-child(3), ":{opacity:0,marginTop:-40,padding:8},"& > button:nth-child(1)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 75ms"},"& > button:nth-child(2)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 50ms"},"& > button:nth-child(3)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 25ms"},"& > button":{transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},"& > .bottom":{bottom:"-60px",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",opacity:0},position:"absolute",top:0,width:"100%",height:"100%",borderRadius:"4px",transition:"filter 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",background:"linear-gradient(to top, #000000cc 25px, #000000b8 50px, #00000096 75px, #0000001a 125px, #00000000 185px), linear-gradient(to bottom, #000000cc 20px, #000000b8 35px, #00000096 45px, #0000001a 75px, #00000000 105px)",filter:"opacity(0)","&:hover, &:active":{filter:"opacity(1)","& > .top":{textAlign:"left","& > button, & > button:nth-child(1), & > button:nth-child(2), & > button:nth-child(3), ":{marginTop:0,opacity:1},"& > button:nth-child(1)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 25ms"},"& > button:nth-child(2)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 50ms"},"& > button:nth-child(3)":{transition:"all 225ms cubic-bezier(0.4, 0, 0.2, 1) 75ms"},"& > button":{transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},"& > .bottom":{bottom:0,opacity:1}}},mediaTitle:{position:"absolute",margin:0,bottom:0,left:0,color:"white",textAlign:"left"},mediaTitleAuthor:{fontSize:"16px",fontWeight:"inherit",margin:"4px 0px 12px 12px",display:"block","@media (max-width: 800px)":{fontSize:"14px"}},mediaTitleName:{fontSize:"21px",fontWeight:"bold",margin:"0px 0px 0px 12px",display:"block","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"18px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"16px !important"}}},profileTabs:{position:"absolute",left:0,bottom:0,margin:0,padding:0,width:"100%",contain:"paint size style layout",animationFillMode:"both",animationName:"$menu",animationDuration:"175ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"0ms",height:72,display:"grid","& .MuiTabs-scroller":{overflowY:"hidden"},"& .MuiTab-root":{minWidth:"auto",flex:"auto"},"& .MuiTabs-indicator":{backgroundColor:"#050c4c"}},profileTab:{"@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"10px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"9px !important"}},backgroundColor:"#fafafa",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .275s","&.Mui-selected":{fontWeight:"bold",backgroundColor:"#dfddf2",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"4px 4px 0px 0px"},"&:hover":{fontWeight:"bold",backgroundColor:"#e8e6f5",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"6px 6px 0px 0px"},"&:first-child":{borderRadius:"0px 4px 0px 0px"},"&:last-child":{borderRadius:"4px 0px 0px 0px"},"& .MuiTab-wrapper":{fontSize:"11px"},"& .MuiTab-wrapper svg":{width:32,height:32,contentVisibility:"auto"}},mediaMoney:{position:"absolute",margin:12,bottom:0,right:0,color:"white",textAlign:"right","& svg":{height:24,width:24,marginBottom:-4}},mediaPriceUnavailable:{color:"#ff3333",fontSize:"21px",fontWeight:"bold","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"18px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"16px !important"}}},mediaPriceAvailable:{fontSize:"21px",fontWeight:"bold",color:"#66ff33","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"18px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"16px !important"}}},mediaValue:{fontSize:"16px",fontWeight:"inherit",margin:"0px",display:"block",textDecoration:"none","@media (max-width: 800px)":{"& .MuiTab-wrapper":{fontSize:"14px !important"}},"@media (max-width: 532px)":{"& .MuiTab-wrapper":{fontSize:"12px !important"}}},tabSort:{"& .MuiTab-root":{minWidth:64}},votes:{position:"absolute",margin:0,top:8,left:8,"& .MuiIconButton-root":{color:"#fff","&:hover::after":{content:'""',position:"absolute",marginTop:8,marginRight:8,width:8,height:8,borderRadius:"100%",transition:"all 400ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animation:"$sparklewhite 750ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animationFillMode:"both"}}},walletCards:{width:"100%",display:"flex",textAlign:"left","@media (max-width: 1000px)":{display:"initial"}},favoriteTrue:{position:"absolute",color:"#ff1200",margin:0,width:"48px !important",top:16,right:"12px !important",left:"auto !important",borderRadius:"100%",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&::after":{content:'""',position:"absolute",top:20,right:20,width:8,height:8,borderRadius:"100%",transition:"all 400ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animation:"$sparkle 750ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",animationFillMode:"both"}},favoriteFalse:{position:"absolute",color:"#ffffff",margin:0,width:"48px !important",top:16,right:"12px !important",left:"auto !important",borderRadius:"100%",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},iconCount:{color:"white",marginLeft:4,fontSize:"16px"},location:{color:"#05009d",position:"absolute",top:"72px",right:"24px"},actions:{position:"fixed",bottom:16,right:16,"& .MuiButtonBase-root.MuiFab-root":{borderRadius:8}},actionButton:{borderRadius:4,"&.MuiSpeedDialAction-fab, &.MuiSpeedDialAction-fab .MuiSvgIcon-root":{color:"white",width:48,height:48,padding:14}},timeLine:{"& .MuiTimelineOppositeContent-root.MuiTimelineItem-oppositeContent":{maxWidth:96}},timeLineTime:{fontWeight:"bold"},timeLineDescription:{color:e.palette.primary,textAlign:"left"},drawerPaper:{position:"absolute","@media (max-width: 800px)":{width:"100% !important"},width:384,textAlign:"left","& h1":{display:"block",margin:"12px auto"},"& h2":{display:"block",margin:"8px 16px"}},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff","&.MuiBackdrop-root":{backgroundColor:"rgba(1,2,18,0.92)"},"& .MuiIconButton-root":{color:"white"}},leftFromDrawer:{position:"absolute",left:0,top:0,display:"block",height:"100%",width:"100% !important",pointerEvents:"none",overflow:"hidden",touchAction:"none",userSelect:"none",perspective:200},fullCard:{borderRadius:8},colors:{flexFlow:"wrap",placeContent:"stretch flex-start",margin:"8px 14px 8px 14px"},drawer:{},list:{"& .MuiListItem-container":{lineHeight:32,height:32},"& .MuiListItemText-root span":{fontWeight:"bold"},"& .MuiListItemSecondaryAction-root":{color:e.palette.secondary.main},"& svg":{height:"24px",verticalAlign:"middle"}},titleWallet:{color:"#43e",fontSize:14,marginRight:72,marginBottom:8},tooltip:{backgroundColor:e.palette.common.white,color:"rgba(0, 0, 0, 0.87)",boxShadow:e.shadows[1],fontSize:14}}},Yt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.componentDidMount=function(){var e;r.canvas_pos.set_notifiers(r.requestForceUpdate,r.closeMediaCard),r.canvas_pos.set_boolean_move_on_click(!0),r.canvas_pos.set_perspective(!0),r.canvas_pos.init_speed_interval(),Ot.default.jamy_update("flirty"),window.addEventListener("resize",(function(){r.setRefFromLeft()})),(e=document.createElement("style")).innerHTML='.Canvas-Wrapper-Overflow.Shown {\n animation-name: canvanimation;\n transform-origin: center center !important;\n animation-fill-mode: both;\n animation-duration: 325ms;\n animation-delay: 25ms;\n animation-timing-function: linear;\n }\n .Canvas-Wrapper-Overflow .Canvas-Wrapper::after {\n content: "";\n position: fixed;\n width: 100%;\n background: linear-gradient(to top, #ffffff00 0%, #1700ff14 14%, #1700ff57 21%, transparent);\n height: 50%;\n left: 0;\n z-index: 2;\n top: 100%;\n }\n .Canvas-Wrapper-Overflow.Shown .Canvas-Wrapper::after {\n animation-name: canvanimationscan;\n animation-fill-mode: both;\n animation-duration: 675ms;\n animation-delay: 525ms;\n animation-timing-function: linear;\n }\n .Canvas-Wrapper-Overflow.Not-Shown {\n animation-name: canvanimation;\n transform-origin: center center !important;\n animation-fill-mode: both;\n animation-duration: 300ms;\n animation-delay: 50ms;\n animation-timing-function: linear;\n animation-direction: reverse;\n }\n @keyframes canvanimation { \n 0% { transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.0); will-change: transform, filter; }\n 4.3% { transform: matrix3d(0.12, 0, 0, 0, 0, 0.271, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.3); will-change: transform, filter; }\n 8.61% { transform: matrix3d(.64, 0, 0, 0, 0, .818, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.7); will-change: transform, filter; }\n 12.91% { transform: matrix3d(1.16, 0, 0, 0, 0, 1.078, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(.9); will-change: transform, filter; }\n 17.22% { transform: matrix3d(1.25, 0, 0, 0, 0, 1.11, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 28.33% { transform: matrix3d(1.04, 0, 0, 0, 0, 1.031, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 39.44% { transform: matrix3d(.98, 0, 0, 0, 0, .991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 61.66% { transform: matrix3d(1.01, 0, 0, 0, 0, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 83.98% { transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: transform, filter; }\n 100% { transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); filter: opacity(1); will-change: initial; } \n }\n @keyframes canvanimationscan { \n 0% { top: -50%; mix-blend-mode: screen; }\n 100% { top: 100%; mix-blend-mode: none; } \n }',e.id="media-style",document.head.appendChild(e),window.addEventListener("resize",r.updateDimension),r.setst4te({_h_svg:(0,xt.createLocalBlob)((0,Et.default)(l.default.createElement(_t.default,{color:"rgba(1,17,255,0.1)"}))),_h_svg_size:"100px 115px"},(function(){r.forceUpdate((function(){r.updateDimension()}))})),setTimeout((function(){r.forceUpdate((function(){r.setRefFromLeft(null)}))}),1e3)},r.goToEditor=function(){Ot.default.load_with("")},r.updateDimension=function(){var e,t,n,a;r.setRefFromLeft(null),e=document.documentElement,t=document.body||document.getElementsByTagName("body")[0],n=window.innerWidth||e.clientWidth||t.clientWidth,window.innerHeight||e.clientHeight||t.clientHeight,a=!!(n<1280),r.setst4te({isMobile:a})},r.handleTabChange=function(e,t){r.setst4te({tabValue:t},(function(){r.forceUpdate()}))},r.handleTabTagChange=function(e,t){r.setst4te({tabTagValue:t},(function(){r.forceUpdate()}))},r.handleMainTabChange=function(e,t){r.setst4te({mainTabValue:t},(function(){r.forceUpdate()}))},r.toggleFavoriteAtIndex=function(e){var t=r.st4te.imagesProfile;t[e].favorite=!t[e].favorite,r.setst4te({imagesProfile:t},(function(){r.forceUpdate()}))},r.requestForceUpdate=function(){r.forceUpdate()},r.renderMedia=function(e,t,i){var o;switch(r.setst4te({renderingMenuAnchorEl:null},(function(){r.forceUpdate()})),URL.revokeObjectURL(r.st4te.src),o=function(e){var t,n,a=document.createElement("canvas");a.width=e.width,a.height=e.height,(t=a.getContext("2d")).putImageData(e,0,0),n=t.canvas.toDataURL("image/png"),r.setst4te({src:n,type:"png"},(function(){r.forceUpdate()}))},e){case"pixelated":Ot.default.trigger_voice("vision_deactivated"),r.setst4te({src:r.st4te.openedMediaData.src,type:"png"},(function(){r.forceUpdate()}));break;case"crt":(0,Ct.default)((function(){return n.e(2).then(n.t.bind(null,720,7))})).then((function(e){(0,e.crt)(t,960/Math.sqrt(t.width*t.height)|0,Pt.default).then(o)}));break;case"hex":Ot.default.trigger_loading_update(0),(0,Ct.default)((function(){return n.e(5).then(n.t.bind(null,721,7))})).then((function(e){e.hexagonrender(t,1440/Math.sqrt(t.width*t.height)|0,!1).then((function(e){r.setst4te({src:e,type:"png"},(function(){r.forceUpdate(),Ot.default.trigger_loading_update(66),(0,Ct.default)((function(){return n.e(0).then(n.t.bind(null,657,7))})).then((function(t){(0,t.png_quant)(e,30,100,3,Pt.default).then((function(e){URL.revokeObjectURL(r.st4te.src),r.setst4te({src:e,type:"png"},(function(){r.forceUpdate(),Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("enhanced")}))}))}))}))}))}));break;case"svg":Ot.default.trigger_loading_update(0),Ot.default.trigger_voice("processing"),(0,Ct.default)((function(){return n.e(3).then(n.t.bind(null,722,7))})).then((function(e){e.default(t,6,Pt.default).then((function(e){Ot.default.trigger_loading_update(22),(0,jt.createSVG)(e).then((function(e){var t=a(e,2),i=t[0],o=t[1];URL.revokeObjectURL(r.st4te.src),r.setst4te({src:i,type:"svg"},(function(){Ot.default.trigger_loading_update(66),Ot.default.trigger_voice("vision_activated"),r.forceUpdate(),(0,Ct.default)((function(){return n.e(1).then(n.bind(null,689))})).then((function(e){var t,n,a=e.optimize;o=a(o,{path:"path-to.svg",multipass:!0,mergePaths:!0,mergeStyles:!0,collapseGroups:!1,reusePaths:!1,plugin:["multipass","mergePaths","collapseGroups","reusePaths","mergeStyles"]}).data,Ot.default.trigger_loading_update(88),URL.revokeObjectURL(r.st4te.src),r.setst4te({src:(t=o,n=new Blob([t],{type:"image/svg+xml"}),URL.createObjectURL(n)),type:"svg"},(function(){r.forceUpdate(),Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("enhanced")}))}))}))}))}))}));break;case"tree":Ot.default.trigger_loading_update(0),Ot.default.trigger_voice("processing"),new lt.default({shape:"circle"}).loadImage(t).then((function(e){URL.revokeObjectURL(r.st4te.src),r.setst4te({src:e,type:"svg"},(function(){Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("vision_activated"),r.forceUpdate()}))}));break;case"poly":Ot.default.trigger_loading_update(0),Ot.default.trigger_voice("processing"),new ut.default({size:2974.451209887296/Math.sqrt(i.width*i.height)|0}).processImage(t,!0).then((function(e){URL.revokeObjectURL(r.st4te.src),r.setst4te({src:e,type:"svg"},(function(){Ot.default.trigger_loading_update(100),Ot.default.trigger_voice("vision_activated"),r.forceUpdate()}))}))}},r.openMediaCard=function(e){var t,n;Ot.default.trigger_sfx("navigation_selection-complete-celebration"),t=new Zt.FloranceCaptionerAPI,n=r.st4te.descriptions||[],t.run(e.src,3).then((function(t){n[e.name]=t,r.setst4te({descriptions:n})})),r.setst4te({openedMediaData:e,src:e.src},(function(){r.forceUpdate(),(0,it.getImageDataFromBase64)(e.src).then((function(e){r.canvas_pos.set_sizes(e.width,e.height),r.canvas_pos.set_current_scale_default(),r.setst4te({openedMediaDataData:e},(function(){r.forceUpdate()}))}))}))},r.closeMediaCard=function(){URL.revokeObjectURL(r.st4te.src),Ot.default.trigger_sfx("state-change_confirm_down"),r.setst4te({openedMediaData:null},(function(){r.forceUpdate()}))},r.setRefFromLeft=function(e){null==e&&null==r.st4te.refleft||r.setst4te({refleft:e||r.st4te.refleft},(function(){var t=window.innerWidth,n=r.st4te.refleft.getBoundingClientRect(),a=t>800?n.width-384:n.width,i=n.height||0,o=n.left||0,l=n.top||0;r.canvas_pos.set_canvas_container(l,o,i,a),e&&(e.addEventListener("wheel",r._canvas_pos_handle_wheel,{passive:!1}),e.addEventListener("pointerdown",r._canvas_pos_handle_pointer_down,{passive:!1}),e.addEventListener("pointermove",r._canvas_pos_handle_pointer_move,{passive:!1}),e.addEventListener("pointerup",r._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointercancel",r._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerout",r._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerleave",r._canvas_pos_handle_pointer_up,{passive:!1}))}))},r._canvas_pos_handle_wheel=function(e){r.canvas_pos.handle_wheel(e)},r._canvas_pos_handle_pointer_down=function(e){r.canvas_pos.handle_pointer_down(e)},r._canvas_pos_handle_pointer_move=function(e){r.canvas_pos.handle_pointer_move(e)},r._canvas_pos_handle_pointer_up=function(e){r.canvas_pos.handle_pointer_up(e)},r.edit=function(e){Ot.default.load_with(e)},r.toggleDrawer=function(){r.setst4te({openedDrawer:!r.st4te.openedDrawer})},r.toggleHashtagDrawer=function(){r.setst4te({drawerHashtagOpen:!r.st4te.drawerHashtagOpen})},r.toggleFavoriteTag=function(e){var t,n,a=r.st4te.categories;for(t=0;t800?400:14,top:16}},l.default.createElement(R.default,{style:{color:"#ffffff"},onClick:function(){e.download(S,w.name,"sophia.julio",T)}},l.default.createElement(je.default,null,l.default.createElement(vt.default,null))),l.default.createElement(R.default,{style:{color:"#ffffff"},onClick:function(){e.edit(w.src)}},l.default.createElement(je.default,null,l.default.createElement(Ie.default,null))),l.default.createElement(R.default,{style:{color:"#ffffff"},onClick:function(){e.closeMediaCard()}},l.default.createElement(je.default,null,l.default.createElement(Se.default,null)))),l.default.createElement("div",{style:{position:"absolute",bottom:16,left:16}},l.default.createElement(d.default,{title:"14 Reposts"},l.default.createElement(R.default,null,l.default.createElement(je.default,null,l.default.createElement(Me.default,null)))),l.default.createElement(d.default,{title:"88 UpVotes"},l.default.createElement(R.default,null,l.default.createElement(je.default,null,l.default.createElement(ke.default,null)))),l.default.createElement(d.default,{title:"0 DownVote"},l.default.createElement(R.default,null,l.default.createElement(je.default,null,l.default.createElement(we.default,null))))),l.default.createElement("div",{style:{position:"absolute",bottom:16,right:16,display:window.innerWidth>=800?"none":"block"}},l.default.createElement(z.default,{style:{color:"white",fontWeight:"bold"},onClick:function(){e.toggleDrawer(w.src)}},"Details"))),w&&k&&l.default.createElement(at.default,{className:n.drawer,variant:"persistent",anchor:window.innerWidth>=800?"right":"bottom",open:I,classes:{paper:n.drawerPaper}},l.default.createElement(R.default,{onClick:this.toggleDrawer,style:{display:window.innerWidth>=800?"none":"block",color:"#060e23",width:64,height:64,position:"fixed",right:4,top:4}},l.default.createElement(Se.default,null)),l.default.createElement("h1",null,w.name),l.default.createElement("h2",null,(k.colors||[]).length," Colors"),l.default.createElement("div",{className:n.colors},(k.colors||[]).map((function(t,n){return l.default.createElement(d.default,{title:t,key:n},l.default.createElement(R.default,{disableRipple:!0,onClick:function(n){e.props.onClick(n,t)},style:{background:t,width:24,height:24,borderRadius:"2px",margin:4}}))}))),l.default.createElement("h2",null,"Description"),l.default.createElement("p",{style:{textAlign:"justify",margin:"8px 16px"}},i[w.name]||"[Automatic captioning]..."),l.default.createElement("h2",null,"Status"),l.default.createElement(ft.default,{dense:!0,className:n.list},l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Created:"}),l.default.createElement(ht.default,null,"Just now")),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Author:"}),l.default.createElement(ht.default,null,"@sophia.julio")),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Status:"}),l.default.createElement(ht.default,{style:{color:w.sold?"red":"green"}},w.sold?"Sold":"For sale!")),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Price:"}),l.default.createElement(ht.default,null,w.price," ",w.money)),l.default.createElement(E.default,{divider:!0},l.default.createElement(mt.default,{primary:"Dimension:"}),l.default.createElement(ht.default,null,k.width,"x",k.height))),l.default.createElement(z.default,{style:{fontWeight:"bold",margin:"8px 16px 32px 16px",backgroundColor:"rgb(0 28 255 / 25%)",color:"#001238",width:"calc(100% - 32px)"},color:"primary"},"BUY NOW"))))}}]),t}(l.default.PureComponent),t.default=(0,c.default)(Kt)(Yt)},652:function(e,t,n){"use strict";var r,a;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n>>0,this.rgba_[3]=e>>24&255,this.rgba_[2]=e>>16&255,this.rgba_[1]=e>>8&255,this.rgba_[0]=255&e}},{key:"r",get:function(){return this.rgba_[0]}},{key:"g",get:function(){return this.rgba_[1]}},{key:"b",get:function(){return this.rgba_[2]}},{key:"a",get:function(){return this.rgba_[3]}},{key:"rgba",get:function(){return this.rgba_.subarray(0,4)}},{key:"uint32",get:function(){return(this.r<<24|this.g<<16|this.b<<8|this.a)>>>0}}],[{key:"createUint32",value:function(t){return new e(new Uint8Array(Uint32Array.of((0|t)>>>0).buffer))}}]),e}(),t.default=a},653:function(e,t,n){"use strict";var r,a,i,o,l;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n>>0,n[1]=(n[1]+t[1]|0)>>>0,n[2]=(n[2]+t[2]|0)>>>0,n[3]=(n[3]+t[3]|0)>>>0})),t=e.length,new i.default(Uint8Array.of(n[0]/t|0,n[1]/t|0,n[2]/t|0,n[3]/t|0))}}]),e}(),t.default=o},655:function(e,t,n){"use strict";var r,a=n(654),i=n(648),o=(0,i.SIMDopeCreateConfAdd)({create:{new_of:!0},properties:{uint32:!0,laba:!0,rgbaon4bits:!0,rgbaon6bits:!0,rgbaon8bits:!0,rgbaon12bits:!0,rgbaon16bits:!0,skin:!0},methods:{simplify:!0,get_new_element:!0,get_use_element:!0,set_tail:!0,is_dark:!0,blend_first_with:!0,blend_first_with_tails:!0,blend_all:!0,cie76_match_with:!0,copy:!0}}),l=Math.fround,s=l(1),u=l(.777),c=(0,i.SIMDopeCreate)(o),f=c.simdops,d=c.Color,h=c.Colors,p=(f.minus_int,f.int_not_equal,f.plus_int,f.plus_uint,f.minus_uint,f.multiply_int,f.multiply_uint,f.multiply_uint_4),m=(f.divide_uint,f.clamp_uint8,f.clamp_uint32,f.int_equal,f.uint_less,f.int_less,f.int_greater_equal,f.uint_not_equal,f.uint_less_equal,f.min_uint,function e(t){if(t=t||{},!(this instanceof e))return new e(t);t.pxl_colors=t.pxl_colors||new Uint32Array(0),t.pxls=t.pxls||new Uint32Array(0),this.new_pxls_="buffer"in t.pxls?new Uint32Array(t.pxls.buffer):Uint32Array.from(t.pxls),this.new_pxl_colors_="buffer"in t.pxl_colors?new h(t.pxl_colors.buffer):new h(Uint32Array.from(t.pxl_colors).buffer),this.original_pxls_=this.new_pxls_.slice(0,this.new_pxls_.length),this.original_pxl_colors_=this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length);var n=0|this.new_pxl_colors_.length;this.new_pxl_colors_is_skin_mask_=new a.SetFixed(0|n),this.set_new_pxl_skin_mask(),this.best_color_number_=t.number_of_color,this.max_cluster_=this.new_pxl_colors_.length>16384?65537:this.new_pxl_colors_.length>4096?4097:this.new_pxl_colors_.length>1024?257:this.new_pxl_colors_.length>256?17:1,this.index_clusters_=Array(this.max_cluster_),this.length_clusters_=new Uint32Array(this.max_cluster_),this.pxl_colors_usage_=new Uint32Array(n),this.all_index_clusters_=new Uint32Array(n),this.clean_pxl_colors_=new Uint32Array(n),this.clean_pxl_colors_lookup_={},this.is_skin_ops_=0,this.match_ops_=0,this.blend_ops_=0,this.remove_duplicate_ops_=0,this.simplify_ops_=0,this.classify_on_x_bits_ops_=0});Object.defineProperty(m.prototype,"set_is_skin_ops",{get:function(){return function(e){this.is_skin_ops_=(0|e)>>>0}}}),Object.defineProperty(m.prototype,"set_match_ops",{get:function(){return function(e){this.match_ops_=(0|e)>>>0}}}),Object.defineProperty(m.prototype,"set_blend_ops",{get:function(){return function(e){this.blend_ops_=(0|e)>>>0}}}),Object.defineProperty(m.prototype,"set_remove_duplicate_ops",{get:function(){return function(e){this.remove_duplicate_ops_=(0|e)>>>0}}}),Object.defineProperty(m.prototype,"set_simplify_ops",{get:function(){return function(e){this.simplify_ops_=e}}}),Object.defineProperty(m.prototype,"set_classify_on_x_bits_ops",{get:function(){return function(e){this.classify_on_x_bits_ops_=e}}}),Object.defineProperty(m.prototype,"get_is_skin_ops",{get:function(){return function(){return 0|this.is_skin_ops_}}}),Object.defineProperty(m.prototype,"get_match_ops",{get:function(){return function(){return 0|this.match_ops_}}}),Object.defineProperty(m.prototype,"get_blend_ops",{get:function(){return function(){return 0|this.blend_ops_}}}),Object.defineProperty(m.prototype,"get_remove_duplicate_ops",{get:function(){return function(){return 0|this.remove_duplicate_ops_}}}),Object.defineProperty(m.prototype,"get_simplify_ops",{get:function(){return function(){return this.simplify_ops_}}}),Object.defineProperty(m.prototype,"get_classify_on_x_bits_ops",{get:function(){return function(){return this.classify_on_x_bits_ops_}}}),Object.defineProperty(m.prototype,"reset_deduplicate",{get:function(){return function(e){this.clean_pxl_colors_lookup_={},this.pxl_colors_usage_.fill(0,0,0|e),this.clean_pxl_colors_.fill(0,0,0|e)}}}),Object.defineProperty(m.prototype,"index_of_color_within_cleaned",{get:function(){return function(e){return(0|this.clean_pxl_colors_lookup_[(0|e)>>>0])-1|0}}}),Object.defineProperty(m.prototype,"set_cleaned_pxl_colors",{get:function(){return function(e,t){this.clean_pxl_colors_[(0|e)>>>0]=(0|t)>>>0,this.clean_pxl_colors_lookup_[(0|t)>>>0]=(e+1|0)>>>0}}}),Object.defineProperty(m.prototype,"increase_color_usage",{get:function(){return function(e){this.pxl_colors_usage_[(0|e)>>>0]=(this.pxl_colors_usage_[(0|e)>>>0]+1|0)>>>0}}}),Object.defineProperty(m.prototype,"set_new_pxls",{get:function(){return function(e,t){this.new_pxls_[(0|e)>>>0]=(0|t)>>>0}}}),Object.defineProperty(m.prototype,"set_new_pxl_colors",{get:function(){return function(e){this.new_pxl_colors_=new h(this.clean_pxl_colors_.buffer.slice(0,p(0|e))),this.set_new_pxl_skin_mask()}}}),Object.defineProperty(m.prototype,"set_new_pxl_skin_mask",{get:function(){return function(){var e=new d(new ArrayBuffer(4)),t=0|this.new_pxl_colors_.length,n=0;for(this.new_pxl_colors_is_skin_mask_=new a.SetFixed(0|t);(0|n)<(0|t);n=n+1|0)this.new_pxl_colors_.get_use_element(0|n,e).skin&&this.new_pxl_colors_is_skin_mask_.add(0|n);this.set_is_skin_ops(this.get_is_skin_ops()+n|0)}}}),Object.defineProperty(m.prototype,"get_a_new_pxl_color_from_pxl_index",{get:function(){return function(e){return 4294967295&this.new_pxl_colors_.buffer_getUint32(this.new_pxls_[0|e])}}}),Object.defineProperty(m.prototype,"reset_cluster",{get:function(){return function(e){this.max_cluster_=e?1:this.new_pxl_colors_.length>16384?65537:this.new_pxl_colors_.length>4096?4097:this.new_pxl_colors_.length>1024?257:this.new_pxl_colors_.length>256?17:1,this.length_clusters_.fill(0,0,0|this.max_cluster);for(var t=0;(0|t)<(0|this.max_cluster);t=(t+1|0)>>>0)this.index_clusters_[0|t]=[]}}}),Object.defineProperty(m.prototype,"reset_original_data",{get:function(){return function(){this.new_pxl_colors_=new h(this.original_pxl_colors_.slice(0,this.original_pxl_colors_.length).buffer),this.new_pxls_=this.original_pxls_.slice(0,this.original_pxls_.length)}}}),Object.defineProperty(m.prototype,"add_in_indexes_cluster",{get:function(){return function(e,t){this.index_clusters_[(0|e)>>>0].push((0|t)>>>0)}}}),Object.defineProperty(m.prototype,"set_all_cluster_indexes",{get:function(){return function(){for(var e=0,t=0;(0|e)<(0|this.max_cluster);e=(e+1|0)>>>0)this.all_index_clusters_.set(this.index_clusters_[(0|e)>>>0],(0|t)>>>0),t=(t+this.get_length_in_index_clusters(0|e)|0)>>>0}}}),Object.defineProperty(m.prototype,"get_length_in_index_clusters",{get:function(){return function(e){return(0|this.index_clusters_[(0|e)>>>0].length)>>>0}}}),Object.defineProperty(m.prototype,"get_in_cluster_lengths",{get:function(){return function(e){return(0|this.length_clusters_[(0|e)>>>0])>>>0}}}),Object.defineProperty(m.prototype,"get_an_index_in_clusters",{get:function(){return function(e){return(0|this.all_index_clusters_[0|e])>>>0}}}),Object.defineProperty(m.prototype,"get_a_color_usage",{get:function(){return function(e){return(0|this.pxl_colors_usage_[0|e])>>>0}}}),Object.defineProperty(m.prototype,"set_a_color_usage",{get:function(){return function(e,t){return this.pxl_colors_usage_[0|e]=(0|t)>>>0}}}),Object.defineProperty(m.prototype,"get_a_color_usage_percent",{get:function(){return function(e){return l(this.pxl_colors_usage_[0|e]/this.new_pxls_.length)}}}),Object.defineProperty(m.prototype,"get_average_color_usage_percent",{get:function(){return function(e,t){var n,r,a;for(t=0|((t|=0)<(e|=0)?this.pxl_colors_usage_.length:t),n=0,r=0,a=0,r=0|e;(0|r)<(0|t);r=(r+1|0)>>>0)a=(0|this.get_an_index_in_clusters((0|r)>>>0))>>>0,n+=this.pxl_colors_usage_[0|a]/this.new_pxls_.length;return n/(t-e|0)}}}),Object.defineProperty(m.prototype,"get_a_new_pxl_color",{get:function(){return function(e){return this.new_pxl_colors_.get_new_element(0|e)}}}),Object.defineProperty(m.prototype,"is_pxl_color_skin",{get:function(){return function(e){return this.new_pxl_colors_is_skin_mask_.has(0|e)}}}),Object.defineProperty(m.prototype,"max_cluster",{get:function(){return 0|this.max_cluster_}}),Object.defineProperty(m.prototype,"new_pxls_length",{get:function(){return 0|this.new_pxls_.length}}),Object.defineProperty(m.prototype,"new_pxl_colors_length",{get:function(){return 0|this.new_pxl_colors_.length}}),Object.defineProperty(m.prototype,"best_color_number",{get:function(){return 0|this.best_color_number_}}),Object.defineProperty(m.prototype,"get_data",{get:function(){return function(){return Array.of(this.new_pxls_,this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length),{deduplicate:this.get_remove_duplicate_ops(),simplify:this.get_simplify_ops(),classify:this.get_classify_on_x_bits_ops(),skin:this.get_is_skin_ops(),blend:this.get_blend_ops(),match:this.get_match_ops()})}}}),m.prototype.output=function(e){var t,n;return e=e||"heap",t=this.get_data(),"heap"==e?((n=new Uint32Array(2+t[0].length+t[1].length))[0]=0|t[0].length,n[1]=0|t[1].length,n.set(t[0],2),n.set(t[1],2+t[0].length),n.buffer):t},m.prototype.deduplicate=function(){var e,t,n,r,a;for(this.set_remove_duplicate_ops(this.get_remove_duplicate_ops()+1|0),this.reset_deduplicate(0|this.new_pxl_colors_length),e=0,t=0,n=0,r=0,a=0|this.new_pxls_length;(0|r)<(0|a);r=(r+1|0)>>>0)t=0|this.get_a_new_pxl_color_from_pxl_index(0|r),-1==(0|(n=0|this.index_of_color_within_cleaned(0|t)))&&(this.set_cleaned_pxl_colors(0|e,0|t),n=0|e,e=e+1|0),this.increase_color_usage(0|n),this.set_new_pxls(0|r,0|n);this.set_new_pxl_colors(e)},m.prototype.clusterize=function(e){this.reset_cluster(e);var t=0;if(65537===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon16bits)>>>0,(0|t)>>>0);else if(4097===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon12bits)>>>0,(0|t)>>>0);else if(257===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon8bits)>>>0,(0|t)>>>0);else if(17===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon4bits)>>>0,(0|t)>>>0);else for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster(0,(0|t)>>>0);this.max_cluster>1&&this.set_classify_on_x_bits_ops(this.get_classify_on_x_bits_ops()+this.new_pxl_colors_length),this.set_all_cluster_indexes()},m.prototype.process_threshold=function(e){var t,n,r,a,i,o,c,f,h,p,m,g,v,b,y,x,w,_,k,E,M,P,A,C,S,O;for(n=function(e,n){return l(Math.pow(e,t)/n)}(e=(0|e)>>>0,Math.pow(255,t=1)),r=0,a=[],i=[],o=0,c=0,p=!1,m=!1,g=0,v=0,b=0,y=0,x=0,w=0,_=l(n),M=0,P=0,A=0,C=0,S=0,O=0,E=l(_*u),k=l(_*s);(0|S)<(0|this.max_cluster);S=(S+1|0)>>>0){for(c=(o+((0|this.get_length_in_index_clusters(0|S))>>>0)|0)>>>0,x=this.get_average_color_usage_percent(0|o,0|c),A=0|o;(0|A)<(0|c);A=(A+1|0)>>>0){if(M=(0|this.get_an_index_in_clusters((0|A)>>>0))>>>0,f=this.get_a_new_pxl_color((0|M)>>>0),p=this.is_pxl_color_skin((0|M)>>>0),(0|(g=(0|this.get_a_color_usage((0|M)>>>0))>>>0))>0)for(a=[],C=0|o;(0|C)<(0|c);C=(C+1|0)>>>0)P=(0|this.get_an_index_in_clusters((0|C)>>>0))>>>0,h=this.get_a_new_pxl_color((0|P)>>>0),m=this.is_pxl_color_skin((0|P)>>>0),0|(v=(0|this.get_a_color_usage((0|P)>>>0))>>>0)&&(0|M)!=(0|P)&&(0|p)==(0|m)&&(b=this.get_a_color_usage_percent((0|M)>>>0)/x,y=this.get_a_color_usage_percent((0|P)>>>0)/x,O=l((O=p&&m?E:p||m?k:_)*(0*Math.abs(b-y)+.223*(2-(b+y))/2+.777)/1),f.cie76_match_with(h,O)&&(w=l(v/g),r++,this.set_a_color_usage(0|P,0),a.push(h),i.push(w)));(0|a.length)>0&&(d.blend_all(f,a,i),a=[],i=[])}o=0|c}return r},m.prototype.round=function(){var e,t;if(this.new_pxl_colors_length>2048){for(e=0|(this.new_pxl_colors_length>6e4?4:this.new_pxl_colors_length>32e3?3:this.new_pxl_colors_length>16e3?2:this.new_pxl_colors_length>8192?1.5:this.new_pxl_colors_length>4096?1.25:1),t=0;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.get_a_new_pxl_color((0|t)>>>0).simplify(e);this.set_simplify_ops(this.get_simplify_ops()+this.new_pxl_colors_length)}},m.prototype.init=function(e){return this.round(),this.deduplicate(),this.clusterize(),this},m.prototype.reset_original=function(){return this.reset_original_data(),this},m.prototype.run=function(){var e=0;if(this.new_pxl_colors_length<=this.best_color_number)return this.reset_original(),this.deduplicate(),this.clusterize(),this;for(;this.new_pxl_colors_length>this.best_color_number&&e<255;)e++,this.process_threshold(0|e)>0&&(this.deduplicate(),this.clusterize());return this.reset_original(),this.deduplicate(),this.clusterize(this.new_pxl_colors_length<4096),this.process_threshold(0|e),this.deduplicate(),this.clusterize(),this},m.split_image_data=function(e){var t,n,r=new Uint32Array(e.data.buffer),a=Uint32Array.from(new Set(r)),i={},o=a.length,l=new Uint32Array(r.length);for(t=0,n=0|o;(0|t)<(0|n);t=(t+1|0)>>>0)i[a[0|t]]=(0|t)>>>0;for(t=0,n=0|r.length;(0|t)<(0|n);t=(t+1|0)>>>0)l[0|t]=(0|i[r[0|t]])>>>0;return[l,a,r,o]},r=function(e,t){return new Promise((function(n){var r,a,i,o,l,s,u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,a=[],i=!0,o=!1,l=void 0;try{for(n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(a.push(r.value),4!==a.length);i=!0);}catch(s){o=!0,l=s}finally{try{!i&&n.return&&n.return()}finally{if(o)throw l}}return a}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(m.split_image_data(e)),c=u[0],f=u[1],d=u[2],h=u[3],p=Date.now(),g="auto"===t,v=parseFloat(t)>0&&parseFloat(t)<1,b=parseInt(t)<0,y=g?"auto":v||b?b?Math.max(1,h+parseInt(t)):v?Math.max(1,parseFloat(t)*h):h:parseInt(t);if("auto"===y&&(y=h>255?255:h/2|0),y>=h)n([e,c,f,0,f.length,0]);else{for(r=m({pxls:c,pxl_colors:f,number_of_color:Math.min(h,y),width:e.width,height:e.height}).init().run().output("split"),a=Date.now(),o=0|(i=r[0]).length,l=r[1],s=0;(0|s)<(0|o);s=(s+1|0)>>>0)d[0|s]=(0|l[(0|i[0|s])>>>0])>>>0;n([e=new ImageData(new Uint8ClampedArray(d.buffer),e.width,e.height),i,l,h-l.length,l.length,a-p])}}))},e.exports={QuantiMatGlobal:r,QuantiMat:m}},656:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strength=t,this.tilesManager=n,this.tiles=n.getTiles(),this.width=r,this.height=a}},658:function(e,t,n){"use strict";var r,a;Object.defineProperty(t,"__esModule",{value:!0}),r=(a=n(670))&&a.__esModule?a:{default:a},t.default=r.default.pool({minWorkers:0,maxWorkers:3})},660:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4&&i<=32;)t=e[i],e[2*i-1],e[2*i],e[2*i+1],e[4*i-1],e[4*i],e[4*i+1],a<(n=t*i*(1+.1*i))&&(a=n,o=i),i++;return r=0,e.forEach((function(e,t){r+=e*t})),{tileSize:o,certainty:Math.fround(o*e[o]/r)}}var n,r,a,i,o,l,s,u=e.width,c=e.height,f=new Uint32Array(e.data.buffer),d=64,h=new Uint32Array(d),p=new Uint32Array(d),m=0,g=new Uint32Array(2);for(n=0;n1&&m0&&m1&&m0&&m>24&255)-(t>>24&255)),s((e>>16&255)-(t>>16&255)),s((e>>8&255)-(t>>8&255))),r=Uint16Array.of(u(n[0],n[0]),u(n[1],n[1]),u(n[2],n[2]));return(0|Math.sqrt((((r[0]<<1)+r[0]|0)+(r[1]<<2)+(r[2]<<1)|0)/10))>>>0}},{key:"quantizeImageData",value:function(e,t){var n,r,a,o,s=e.getImageData(0,0,e.canvas.width,e.canvas.height),u=Date.now(),c=l.QuantiMat.split_image_data(s),f=i(c,2),d=f[0],h=f[1],p=Date.now(),m=(0,l.QuantiMat)({pxls:d,pxl_colors:h,number_of_color:Math.min(h.length,t),width:s.width,height:s.height}).init().run().output("split"),g=Date.now();for(console.log(p-u,g-p),n=m[0],r=m[1],a=new Uint32Array(n.length),o=0;oo&&(i=l,o=t[l]);return i}},{key:"_calculateElbowStrength",value:function(e,t){var n,r,i,o=e.map((function(t,n){return n/(e.length-1)})),l=Math.max.apply(Math,a(e)),s=Math.min.apply(Math,a(e)),u=e.map((function(e){return(e-s)/(l-s)})),c=[0,u[0]],f=[1,u[u.length-1]],d=[o[t],u[t]],h=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2)),p=Math.abs(((i=f)[1]-(r=c)[1])*(n=d)[0]-(i[0]-r[0])*n[1]+i[0]*r[1]-i[1]*r[0])/Math.sqrt(Math.pow(i[1]-r[1],2)+Math.pow(i[0]-r[0],2));return Math.fround(p/h)}}]),e}(),t.default=c},661:function(e,t,n){"use strict";var r,a;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n1&&void 0!==arguments[1]&&arguments[1],r=(0,a.default)(e);return n&&(t=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/gi,r.match(t).forEach((function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,a=[],i=!0,o=!1,l=void 0;try{for(n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(a.push(r.value),3!==a.length);i=!0);}catch(s){o=!0,l=s}finally{try{!i&&n.return&&n.return()}finally{if(o)throw l}}return a}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.match(/\w\w/g).map((function(e){return parseInt(e,16)}))),n=t[0],a=t[1],i=t[2],o=Math.round((n+a+i)/3),l=function(e,t,n){return e=e.toString(16),t=t.toString(16),n=n.toString(16),1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n}(o,o,o);r=r.replace(e,l)}))),(0,i.default)(r)}},666:function(e,t,n){"use strict";function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,n){return function r(a,i){var o,l;try{l=(o=t[a](i)).value}catch(s){return void n(s)}if(!o.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(l)}("next")}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=function(){function e(e,t){var n,r;for(n=0;ni?"Process will start after "+a+" remaining job"+(a?"s":""):"Process will start immediately"),this.msgCallback(o);break;case"progress":s="Processing: "+(l=(t.progress_data||[])[0]||{}).index+"/"+l.length+" "+l.unit+".",this.msgCallback(s)}}catch(u){}}},{key:"generateRandomId",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t="";e>=6;)t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0"),e-=6;return e>0&&(t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0").slice(0,e)),t}},{key:"getHeadersJson",value:function(){return{"Content-Type":"application/json"}}},{key:"getHeadersStream",value:function(){return{accept:"text/event-stream"}}},{key:"getHeadersAll",value:function(){return{accept:"*/*"}}},{key:"getUploadUrl",value:function(e){return this.baseUrl+"/upload?upload_id="+e}},{key:"getCreateImagePathUrl",value:function(e){return this.baseUrl+"/file="+e}},{key:"handleLoadComplete",value:(s=i(regeneratorRuntime.mark((function e(t,n,r,a){var i,o,l,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=void 0===n?"blob":n,i=(t||"/unknown.webp").split("/"),o=i[i.length-1]||"unknown.png",l=o.split(".")[1]||"png",s="image/"+l,l="jpeg"===l?"jpg":l,e.prev=6,e.next=9,new Promise((function(e){var i=new Image;i.setAttribute("crossorigin","anonymous"),i.onload=function(){var t,o,l=i.naturalHeight||i.height,s=i.naturalWidth||i.width;a=a||l,r=r||s;try{switch(n.toLowerCase()){case"base64":!function(){var t=document.createElement("canvas");t.width=r,t.height=a,t.getContext("2d").drawImage(i,0,0,r,a);try{e(t.toDataURL("image/webp",.75))}catch(n){e(t.toDataURL("image/jpeg",.75))}}();break;case"blob":!function(){var t=document.createElement("canvas");t.width=r,t.height=a,t.getContext("2d").drawImage(i,0,0,r,a);try{t.toBlob(e,"image/webp",.75)}catch(n){t.toBlob(e,"image/jpeg",.75)}}();break;case"imagedata":(o=document.createElement("canvas")).width=r,o.height=a,(t=o.getContext("2d")).drawImage(i,0,0,r,a),e(t.getImageData(0,0,r,a,{colorSpace:"srgb"}))}}catch(u){}},i.setAttribute("src",t)}));case 9:u=e.sent,e.t0=n,e.next="blob"===e.t0?13:"base64"===e.t0?15:"imagedata"===e.t0?16:17;break;case 13:return c=new File([u],o,{type:s}),e.abrupt("return",Promise.resolve(c));case 15:case 16:return e.abrupt("return",Promise.resolve(u));case 17:e.next=23;break;case 19:return e.prev=19,e.t1=e.catch(6),console.error("Error creating file from URL:",e.t1),e.abrupt("return",Promise.reject());case 23:case"end":return e.stop()}}),e,this,[[6,19]])}))),function(e,t,n,r){return s.apply(this,arguments)})},{key:"uploadFile",value:(a=i(regeneratorRuntime.mark((function e(t,n){var r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("files",t),e.next=4,fetch(this.getUploadUrl(n),{method:"POST",body:r});case 4:return a=e.sent,e.next=7,a.json();case 7:return i=e.sent,e.abrupt("return",Promise.resolve(i[0]||i));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"fetchEventSource",value:(r=i(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersAll(),method:"GET"});case 2:return n=e.sent,e.abrupt("return",Promise.resolve(n.body.getReader()));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"fetchEventSourceJSON",value:(n=i(regeneratorRuntime.mark((function e(t){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersJson(),method:"GET"});case 2:return n=e.sent,e.next=5,n.clone().text();case 5:return r=e.sent,a=r.replaceAll("event: complete\ndata: ",""),e.prev=7,e.abrupt("return",Promise.resolve(JSON.parse(a)));case 11:return e.prev=11,e.t0=e.catch(7),e.abrupt("return",Promise.reject());case 14:case"end":return e.stop()}}),e,this,[[7,11]])}))),function(e){return n.apply(this,arguments)})},{key:"readResponse",value:(t=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a=!1,i=null;case 4:if(a){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,l=o.value,s=o.done,a=a||s,r+=n.decode(l||new Uint8Array,{stream:!0}),u=(r||"\n").split("\n"),c=!0,f=!1,d=void 0,e.prev=16,h=u[Symbol.iterator]();!(c=(p=h.next()).done);c=!0)m=(m=p.value).trim(),this.message(m),console.log(m),m.includes("complete")&&(a=!0,i=m);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),f=!0,d=e.t0;case 24:e.prev=24,e.prev=25,!c&&h.return&&h.return();case 27:if(e.prev=27,!f){e.next=30;break}throw d;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=u[u.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(i));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return t.apply(this,arguments)})}]),e}(),u=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-sd3-long-captioner-v2.hf.space",e))}var n,s,u;return a(t,e),l(t,[{key:"getCreateCaptionsUrl",value:function(){return this.baseUrl+"/call/create_captions_rich"}},{key:"getReadCaptions",value:function(e){try{return JSON.parse(e.slice(5))}catch(t){return""}}},{key:"readResponse",value:(u=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a=!1,i=null;case 4:if(a){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,l=o.value,s=o.done,a=a||s,r+=n.decode(l||new Uint8Array,{stream:!0}),u=(r||"\n").split("\n"),c=!0,f=!1,d=void 0,e.prev=16,h=u[Symbol.iterator]();!(c=(p=h.next()).done);c=!0)m=(m=p.value).trim(),this.message(m),m.includes("complete")&&(a=!0,i=m);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),f=!0,d=e.t0;case 24:e.prev=24,e.prev=25,!c&&h.return&&h.return();case 27:if(e.prev=27,!f){e.next=30;break}throw d;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=u[u.length-1],e.next=4;break;case 35:return e.abrupt("return",a?Promise.resolve(i):Promise.reject("Error"));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return u.apply(this,arguments)})},{key:"createCaptions",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this.getCreateCaptionsUrl(),{method:"POST",headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:t}]})});case 2:return n=e.sent,e.prev=3,e.next=6,n.json();case 6:return r=e.sent,e.abrupt("return",Promise.resolve(r.event_id));case 10:return e.prev=10,e.t0=e.catch(3),e.abrupt("return",Promise.reject("Error"));case 13:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(e){return s.apply(this,arguments)})},{key:"run",value:(n=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:n=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}n=t,e.next=12;break;case 11:return e.abrupt("return",Promise.reject());case 12:return r=this.generateRandomId(),e.next=15,this.uploadFile(n,r);case 15:return a=e.sent,i=this.getCreateCaptionsUrl(),e.next=19,this.createCaptions(a);case 19:return o=e.sent,e.abrupt("return",this.fetchEventSourceJSON(i+"/"+o).then((function(e){return e[0]})).catch((function(){return""})));case 21:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(s),c=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-florence-2.hf.space",e))}var n;return a(t,e),l(t,[{key:"getPredictHeader",value:function(e,t,n,r,a,i){return i=i||1,{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},1===i?"Caption":2===i?"Detailed Caption":"More Detailed Caption","","microsoft/Florence-2-large"],event_data:null,fn_index:4,trigger_id:10,session_hash:a}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readLine",value:function(e,t){var n,r,a;console.log(e),e=e.slice(5);try{return(n=JSON.parse(e)).success?(r=((n.output||{}).data||[])[0],a=1===t?r.slice(15,r.length-2):2===t?r.slice(24,r.length-2):r.slice(29,r.length-2),Promise.resolve(a.replaceAll("\\n","").replaceAll("\n",""))):Promise.reject("")}catch(i){return Promise.reject()}}},{key:"run",value:(n=i(regeneratorRuntime.mark((function e(t,n){var r,a,i,o,l,s,u,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 32:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(),e.next=15,this.uploadFile(r,a);case 15:return i=e.sent,o=this.getCreateImagePathUrl(i),l=this.getPredictHeader(i,o,r.size,r.type,a,n),e.next=20,fetch(this.getQueueJoinUrl(),l);case 20:return s=e.sent,e.next=23,s.json();case 23:if(!e.sent.event_id){e.next=32;break}return e.next=28,this.fetchEventSource(this.getResultUrl(a));case 28:return u=e.sent,e.abrupt("return",this.readResponse(u).then((function(e){return c.readLine(e,n)})).catch((function(){return Promise.reject()})));case 33:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s),f=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://kenjiedec-rembg.hf.space",e))}var n;return a(t,e),l(t,[{key:"getQueuePushUrl",value:function(){return this.baseUrl+"/api/queue/push/"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({action:"predict",data:[e,"Mask only","isnet-general-use"],fn_index:0,session_hash:t}),method:"POST"}}},{key:"getQueueStatusUrl",value:function(){return this.baseUrl+"/api/queue/status/"}},{key:"getResultHeader",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({hash:e}),method:"POST"}}},{key:"run",value:(n=i(regeneratorRuntime.mark((function e(t,n,r){var a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=i(regeneratorRuntime.mark((function e(o,l){var s,u,c,f,d,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=void 0,"string"==typeof t){e.next=7;break}return e.next=4,a.handleLoadComplete(t,"base64");case 4:s=e.sent,e.next=14;break;case 7:if(!t.startsWith("blob:")){e.next=13;break}return e.next=10,a.handleLoadComplete(t,"base64");case 10:s=e.sent,e.next=14;break;case 13:s=t;case 14:return u=a.generateRandomId(),e.next=17,fetch(a.getQueuePushUrl(),a.getPredictHeader(s,u));case 17:return e.next=19,e.sent.json();case 19:c=e.sent,f=c.hash,d=setTimeout((function(){clearInterval(h),l()}),1e4),h=setInterval(i(regeneratorRuntime.mark((function e(){var t,i,l,s,u,c,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(a.getQueueStatusUrl(),a.getResultHeader(f));case 2:return e.next=4,e.sent.json();case 4:if(t=e.sent,i=t.data||{},!(l=i.data||[]).length){e.next=18;break}return e.next=10,a.handleLoadComplete(l[0],"imagedata",n,r);case 10:for(s=e.sent,u=s.data,c=[],p=0,m=u.length;(0|p)<(0|m);p=p+4|0)(0|(u[0|p]+u[p+1|0]+u[p+2|0]|0)/3)<32&&c.push(p/4|0);o(c),clearInterval(h),clearTimeout(d);case 18:case"end":return e.stop()}}),e,a)}))),1e3);case 23:case"end":return e.stop()}}),e,a)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})}]),t}(s),d=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://pixart-alpha-pixart-sigma.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictHeader",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:512,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"(No style)",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"bad shape, disformed, photography, photo, realistic, photo-realistic.",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"DPM-Solver",s=this.generateRandomSeed();return i="string"==typeof i?i:["(No style)","Pixel Art","Digital Art","Anime","Manga"][i],{headers:this.getHeadersJson(),body:JSON.stringify({data:["A pixel art (retro style video game palette artwork) of : "+e,o,i,!0,a,s,n,r,l,4.5,3.5,17,25,!0],event_data:null,fn_index:3,trigger_id:7,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a=!1,i=null;case 4:if(a){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,l=o.value,s=o.done,a=a||s,r+=n.decode(l||new Uint8Array,{stream:!0}),u=(r||"\n").split("\n"),c=!0,f=!1,d=void 0,e.prev=16,h=u[Symbol.iterator]();!(c=(p=h.next()).done);c=!0)m=(m=p.value).trim(),this.message(m),m.includes("complete")&&(a=!0,i=m);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),f=!0,d=e.t0;case 24:e.prev=24,e.prev=25,!c&&h.return&&h.return();case 27:if(e.prev=27,!f){e.next=30;break}throw d;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=u[u.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(i));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return s.apply(this,arguments)})},{key:"extractLastImageUrl",value:function(e,t){var n,r,a,i,o,l,s;try{for(console.log(e),n=JSON.parse(e.slice(5).trim()),r=[],a=n.output.data||[],i=0;i1&&void 0!==arguments[1]?arguments[1]:512,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,h=this,p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,m=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"imagedata";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.generateRandomId(),r=this.getPredictHeader(t,n,f,d,p,1),a=this.getQueueJoinUrl(),e.next=5,fetch(a,r);case 5:return i=e.sent,e.next=8,i.json();case 8:if(!e.sent.event_id){e.next=27;break}return e.next=13,this.fetchEventSource(this.getResultUrl(n));case 13:return o=e.sent,e.next=16,this.readResponse(o);case 16:if(l=e.sent,1!==(s=this.extractLastImageUrl(l)).length){e.next=26;break}return u=s[0],e.next=22,this.handleLoadComplete(u,m);case 22:return c=e.sent,e.abrupt("return",Promise.resolve(c));case 26:return e.abrupt("return",Promise.allSettled([s.map((function(){return h.handleLoadComplete(a,m)}))]));case 27:return e.abrupt("return",Promise.reject());case 28:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(s),h=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://abidlabs-face-to-all.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,a,i){var o="A 2D illustration in retro game style pixel art of "+a.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. Video game, low color number, high quality."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real, CGI, 3D.",.95,null,.9,.12,7.75,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:i}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a="",i=!1;case 3:if(i){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,l=o.value,s=o.done,i=i||s,r+="".concat(n.decode(l||new Uint8Array,{stream:!0})),u=(r||"\n").split("\n"),c=0;c2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 47:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(),i=this.generateRandomId(),o=this.getPredictHeader(x,i),l=this.getPredictUrl(),e.next=18,fetch(l,o);case 18:return s=e.sent,u=s.ok,e.next=22,this.uploadFile(r,a);case 22:if(c=e.sent,f=this.getCreateImagePathUrl(c),!u||!f){e.next=47;break}return d=this.getQueueJoinHeader(c,f,r.size,r.type,n,i),h=this.getQueueJoinUrl(),e.next=29,fetch(h,d);case 29:return p=e.sent,e.next=32,p.json();case 32:if(void 0===e.sent.event_id){e.next=47;break}return m=this.getQueueDataUrl(i),e.next=38,this.fetchEventSource(m);case 38:return g=e.sent,e.next=41,this.readResponse(g);case 41:return v=e.sent,b=this.extractSecondImageUrl(v),e.next=45,this.handleLoadComplete(b);case 45:return y=e.sent,e.abrupt("return",Promise.resolve(y));case 48:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s),p=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://multimodalart-face-to-all.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,a,i){var o="A pixel art person image in lucasarts of : "+a.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, Photography, Real, Photo-realistic, Screenshot, Filters, Retro, Bad Quality, Worst settings.",.9,null,.85,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:i}),method:"POST"}}},{key:"getUselessBullshit",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[null,null],event_data:null,fn_index:5,trigger_id:18,session_hash:e}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a="",i=!1;case 3:if(i){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,l=o.value,s=o.done,i=i||s,r+="".concat(n.decode(l||new Uint8Array,{stream:!0})),u=(r||"\n").split("\n"),c=0;c2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 57:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(8),i=this.generateRandomId(11),o=this.getPredictHeader(w,i),l=this.getPredictUrl(),e.next=18,fetch(l,o);case 18:return s=e.sent,u=s.ok,e.next=22,this.uploadFile(r,a);case 22:if(c=e.sent,f=this.getCreateImagePathUrl(c),!u||!f){e.next=57;break}return d=this.getQueueJoinHeader(c,f,r.size,r.type,n,i),h=this.getQueueJoinUrl(),e.next=29,fetch(h,d);case 29:if(!(p=e.sent).ok){e.next=57;break}return e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=57;break}return m=this.getQueueDataUrl(i),e.next=40,fetch(m,this.getUselessBullshit(i));case 40:if(!(g=e.sent).ok){e.next=57;break}return e.next=44,g.json();case 44:if(!e.sent.event_id){e.next=57;break}return e.next=48,this.fetchEventSource(m);case 48:return v=e.sent,e.next=51,this.readResponse(v);case 51:return b=e.sent,y=this.extractSecondImageUrl(b),e.next=55,this.handleLoadComplete(y);case 55:return x=e.sent,e.abrupt("return",Promise.resolve(x));case 58:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s),m=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://neil-ni-face-to-all.hf.space",e))}var n,s;return a(t,e),l(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,a,i){var o="A pixel art person image in lucasarts of : "+a.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real.",.95,null,.9,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:i}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(s=i(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,l,s,u,c,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",a="",i=!1;case 3:if(i){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,l=o.value,s=o.done,i=i||s,r+="".concat(n.decode(l||new Uint8Array,{stream:!0})),u=(r||"\n").split("\n"),c=0;c2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 49:return e.abrupt("return",Promise.reject());case 12:return a=this.generateRandomId(),i=this.generateRandomId(),o=this.getPredictHeader(x,i),l=this.getPredictUrl(),e.next=18,fetch(l,o);case 18:return s=e.sent,e.next=21,s.json();case 21:return u=e.sent,e.next=24,this.uploadFile(r,a);case 24:if(c=e.sent,f=this.getCreateImagePathUrl(c),!u||!f){e.next=49;break}return d=this.getQueueJoinHeader(c,f,r.size,r.type,n,i),h=this.getQueueJoinUrl(),e.next=31,fetch(h,d);case 31:return p=e.sent,e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=49;break}return m=this.getQueueDataUrl(i),e.next=40,this.fetchEventSource(m);case 40:return g=e.sent,e.next=43,this.readResponse(g);case 43:return v=e.sent,b=this.extractSecondImageUrl(v),e.next=47,this.handleLoadComplete(b);case 47:return y=e.sent,e.abrupt("return",Promise.resolve(y));case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(s);e.exports={HuggingFaceAPI:s,FaceToAllAPI:h,FaceToAllAPI2:p,FaceToAllAPI3:m,FloranceCaptionerAPI:c,LongCaptionerAPI:u,RemoveBackgroundAPI:f,ImageCreatorAPI:d}},667:function(e,t,n){"use strict";var r=n(668);e.exports={createLocalBlob:function(e){var t,n,a,i,o=(e.match(/(data\:([a-z]+\/[a-z\+]+)\;base64\,)([a-zA-Z0-9\/\+]+\(\=+)?/)||[,,])[1];return o?(n=(t=o.match(/data\:([a-z]+\/[a-z\+]+)\;base64\,/)[1]).match(/[a-z]+\/([a-z\+]+)/)[1],e=e.replace(o,""),a=(0,r.base64ToBytes)(e),i=new File([a],"name."+n,{type:t}),URL.createObjectURL(i)):""}}},668:function(e,t,n){"use strict";var r=new(n(265).B64chromium);e.exports={bytesToBase64:r.bytesToBase64.bind(r),base64ToBytes:r.base64ToBytes.bind(r)}},675:function(e,t,n){"use strict";var r,a=n(676),i=Object.getPrototypeOf((r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e,this)})),function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(a,i){var o,l;try{l=(o=e[a](i)).value}catch(s){return void n(s)}if(!o.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))})).constructor,o=Object.getPrototypeOf((function(){})).constructor,l=new o('var t = function(file) {\n "use strict";\n \n try {\n \n return new Promise(function(resolve, _) {\n resolve(new FileReaderSync().readAsDataURL(file));\n });\n \n } catch(error) {\n \n return new Promise(function(resolve, _) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(file);\n });\n }\n \n}; return t;')(),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(l,[e]).catch((function(t){return l(e)})).timeout(5e3).then((function(e){t(e)})):l(e).then((function(e){t(e)}))},u=new i('var t = async function(base64) {\n\n "use strict";\n\n return fetch(base64).then(function(res) {\n\n return res.blob().then(function(blb){\n\n return createImageBitmap(blb, {\n resizeQuality: "pixelated",\n premultiplyAlpha: \'premultiply\'\n });\n });\n });\n\n}; return t;')(),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(u,[e]).catch((function(t){return u(e)})).timeout(5e3).then((function(e){t(e)})):u(e).then((function(e){t(e)}))},f=function(e){for(var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2073600,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=1;Math.round(e.width*i)*Math.round(e.height*i)>r;)i-=.01;try{createImageBitmap(e,0,0,e.width,e.height,{resizeWidth:Math.round(e.width*i),resizeHeight:Math.round(e.height*i),resizeQuality:"pixelated",premultiplyAlpha:"premultiply"}).then((function(e){var t,n=void 0;try{n=new OffscreenCanvas(e.width,e.height)}catch(r){(n=document.createElement("canvas")).width=e.width,n.height=e.height}(t=n.getContext("2d")).imageSmoothingEnabled=!1,t.drawImage(e,0,0,e.width,e.height),a(t.getImageData(0,0,e.width,e.height))}))}catch(o){t=void 0;try{t=new OffscreenCanvas(Math.round(e.width*i),Math.round(e.height*i))}catch(l){(t=document.createElement("canvas")).width=Math.round(e.width*i),t.height=Math.round(e.height*i)}(n=t.getContext("2d")).imageSmoothingEnabled=!1,n.drawImage(e,0,0,t.width,t.height),a(n.getImageData(0,0,t.width,t.height))}},d=new o('var t = function(imagedata, type) {\n\n "use strict"\n type = type || "image/png";\n var quality = type.includes("webp") ? 1: type.includes("png") ? undefined: 0.7;\n try {\n \n return new Promise(function(resolve, _) {\n\n createImageBitmap(imagedata, 0, 0, imagedata.width, imagedata.height, {\n premultiplyAlpha: \'premultiply\',\n resizeQuality: \'pixelated\'\n }).then((bmp) => {\n \n var canvas;\n canvas = new OffscreenCanvas(imagedata.width, imagedata.height);\n var ctx = canvas.getContext("bitmaprenderer");\n ctx.imageSmoothingEnabled = false;\n ctx.transferFromImageBitmap(bmp);\n \n canvas.convertToBlob({type: type, quality: quality}).then((blb) => {\n try {\n resolve(new FileReaderSync().readAsDataURL(blb));\n } catch(e2) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(blb);\n }\n });\n });\n });\n \n }catch (e) {\n \n return new Promise(function(resolve, _) {\n var canvas = document.createElement("canvas");\n canvas.width = imagedata.width;\n canvas.height = imagedata.height;\n var ctx = canvas.getContext("2d");\n ctx.imageSmoothingEnabled = false;\n ctx.putImageData(imagedata, 0, 0);\n \n var base64 = canvas.toDataURL(type, quality);\n canvas = null;\n resolve(base64);\n });\n }\n\n}; return t;')();e.exports={file_to_imagedata_resized:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Date.now(),e.type,"image/jpg"!==e.type&&e.type,e.type,s(e,(function(e){c(e,(function(e){f(e,t,(function(e){n(e)}),r)}),r)}),r)},file_to_base64:s,base64_to_bitmap:c,bitmap_to_imagedata:f,imagedata_to_base64:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null!==r?r.exec(d,[e,t]).catch((function(n){return d(e,t)})).timeout(5e3).then((function(e){n(e)})):d(e,t).then((function(e){n(e)}))},base64_sanitize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};(function(e,t,n){return n=n||"pixelize",new Promise((function(r,i){var o=new Image,l=e.startsWith("data:image/png;");o.onload=function(){var e,i,s=o.naturalWidth*t,u=o.naturalHeight*t,c=function(e,t,n,r){var i,o,l,s,u=void 0;if("pixelize"===r||"normal"===r){i=void 0,o=void 0;try{i=new OffscreenCanvas(e.width,e.height),o=new OffscreenCanvas(t,n)}catch(c){i=document.createElement("canvas"),o=document.createElement("canvas"),i.width=e.width,i.height=e.height,o.width=t,o.height=n}l=i.getContext("2d"),s=o.getContext("2d"),l.imageSmoothingEnabled=!("normal"!==r),s.imageSmoothingEnabled=!("normal"!==r),l.drawImage(e,0,0,e.width,e.height),s.drawImage(i,0,0,i.width,i.height,0,0,o.width,o.height),u=s}else"doppel"===r&&(u=a.scaler.processImage(e,t,n));return u}(o,0|s,0|u,n);try{e=c.getImageData(0,0,c.canvas.width,c.canvas.height),createImageBitmap(e).then((function(e){var t,n;try{t=new OffscreenCanvas(e.width,e.height)}catch(a){(t=document.createElement("canvas")).height=e.height,t.width=e.width}(n=t.getContext("bitmaprenderer")).imageSmoothingEnabled=!1,n.transferFromImageBitmap(e),t.convertToBlob({type:l?"image/png":"image/jpeg"}).then((function(e){try{r((new FileReaderSync).readAsDataURL(e))}catch(n){var t=new FileReader;t.onload=function(){r(t.result)},t.readAsDataURL(e)}}))}))}catch(f){i=c.canvas,r(i.toDataURL(l?"image/png":"image/jpeg"))}},o.onerror=function(){i()},o.src=e}))})(e,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,arguments[4]).then((function(e){t(e)}))},file_to_bitmap:function(e,t){createImageBitmap(e).then(t)}}},676:function(e,t,n){"use strict";var r,a=(r=n(677))&&r.__esModule?r:{default:r},i=new a.default({strength:1,overlapFactor:1,despeckleStrength:.88});e.exports={scaler:i,ImageProcessor:a.default}},677:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a,i,o,l,s,u,c,f,d,h,p,m;Object.defineProperty(t,"__esModule",{value:!0}),a=function(){function e(e,t){var n,r;for(n=0;n=this.finalWidth||o>=this.finalHeight||l.push(this.tiles[i+o*this.finalWidth]);return l}},{key:"paintTiles",value:function(){this.imageData.data.set(this.tilesColorUint8a),this.contextDestination.putImageData(this.imageData,0,0)}}]),e}(),t.default=o},679:function(e,t,n){"use strict";var r,a,i,o,l,s,u;Object.defineProperty(t,"__esModule",{value:!0}),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,a=[],i=!0,o=!1,l=void 0;try{for(n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(s){o=!0,l=s}finally{try{!i&&n.return&&n.return()}finally{if(o)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){var n,r;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.imageData=t,this.meanColor=new o.default(n),this.coordinates=Uint16Array.of(a,i),r=this.imageData.data.length,this.k=r>=64?6:r>=16?4:r>=9?3:r>=2?2:1}return a(e,[{key:"quantizeColors",value:function(){var e,t=l.QuantiMat.split_image_data(this.imageData),n=r(t,2),a=n[0],i=n[1],o=(0,l.QuantiMat)({pxls:a,pxl_colors:i,number_of_color:Math.min(i.length,this.k),width:this.imageData.width,height:this.imageData.height}).init().run().output("split"),s=o[0],u=o[1],c=s<255?new Uint8Array(u.length):new Uint16Array(u.length);for(e=0;e=o-2&&(s.forEach((function(e){e.meanColor.setRGBA(n.meanColor.rgba);var t=e.x+e.y*r.width;a[t]=!0})),a[u]=!0)},n=0;n0&&a<60&&p.setRGBA(r.rgba);break;case"EDGE":i=new u.default(x[0].data),o=new u.default(x[1].data),s=l.default.colorDifference(i,o),c=l.default.colorDifference(i,p),d=l.default.colorDifference(o,p),5*Math.abs(c-d)>=s&&(h=new u.default(new f.default(g.map((function(e){return e.meanColor.rgba})),4).run(4).centroidsSorted[0].data),p.setRGBA(h.rgba))}}},{key:"determineClassification",value:function(e,t){return e[0].count>=.75*t?"AREA":Math.abs(e[0].count-e[1].count)*Math.abs(e[2].count-e[3].count)<25?"SHAPE":Math.abs(e[0].count-e[1].count)<.75*Math.abs(e[1].count-e[2].count)?"EDGE":"COMPLEX"}}]),t}(i.default),t.default=d},683:function(e,t,n){"use strict";var r,a,i;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;nt&&(t=i,n=a)})),n}},{key:"distance",value:function(e,t){return this.c1.set_from_array(e),this.c2.set_from_array(t),16192*this.c1.fast_match_with(this.c2)|0}},{key:"reassignCentroids",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:16,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(this.initializeCentroids(),e=0,t=!1,n=void 0,r=function(){var r=o.centroids.map((function(e){return Uint32Array.from(e)}));o.assignClusters(),n=o.updateCentroids(),e++,t=o.centroids.every((function(e,t){return o.distance(e,r[t])<2})),s&&!t&&o.reassignCentroids(n)};!t&&e3&&void 0!==arguments[3]?arguments[3]:[32,32,32,32],l=window.innerWidth,s=window.innerHeight;return l<800?(l-=0,s-=56):(l-=384,l-=64,s-=64),a=0,i=0,(r=e/t)_?o*(a-u)+f:s*(a-c)+d),{i:t,j:n,k:r,x:a,y:i,r:(h=v-a)*h+(p=b-i)*p}}function a(e){var t,n,r,a,i,o;for(n=e.length;n;)for(a=e[--n],r=e[--n],t=n;t;)if(o=e[--t],r===(i=e[--t])&&a===o||r===o&&a===i){e.splice(n,2),e.splice(t,2);break}}function i(e,t,n,r){t=(e=e||{width:0,height:0}).width||t||1,n=e.height||n||1;var a=void 0,i=void 0;try{if(!1===r)throw new ErrorEvent("Must support toDataURL later, skipping offrscreen canvas solution.");i=(a=new OffscreenCanvas(t,n)).getContext("2d",{willReadFrequently:!0,desynchronized:r})}catch(o){(a=document.createElement("canvas")).width=t,a.height=n,i=a.getContext("2d",{willReadFrequently:!0})}return e instanceof ImageData?i.putImageData(e,0,0):e.width&&i.drawImage(e,0,0,t,n),{canvas:a,context:i}}var o=function(){function e(e,t){var n,r;for(n=0;nu&&(u=e[t][0]),e[t][1]c&&(c=e[t][1]);return[[(i=l+.5*(n=u-l))-20*(a=Math.max(n,r=c-s)),(o=s+.5*r)-a],[i,o+20*a],[i+20*a,o-a]]}(e),e.push(s[0],s[1],s[2]),u=[r(e,v+0,v+1,v+2)],c=[],f=[],n=o.length;n--;f.length=0){for(g=o[n],i=u.length;i--;)(d=e[g][0]-u[i].x)>0&&d*d>u[i].r?(c.push(u[i]),u.splice(i,1)):d*d+(h=e[g][1]-u[i].y)*h-u[i].r>l||(f.push(u[i].i,u[i].j,u[i].j,u[i].k,u[i].k,u[i].i),u.splice(i,1));for(a(f),i=f.length;i;)m=f[--i],p=f[--i],u.push(r(e,p,m,g))}for(n=u.length;n--;)c.push(u[n]);for(u.length=0,n=c.length;n--;)c[n].ie[0][0]&&t[0]>e[1][0]&&t[0]>e[2][0]||t[1]e[0][1]&&t[1]>e[1][1]&&t[1]>e[2][1]?null:(n=e[1][0]-e[0][0],r=e[2][0]-e[0][0],a=e[1][1]-e[0][1],0==(o=n*(i=e[2][1]-e[0][1])-r*a)?null:(l=(i*(t[0]-e[0][0])-r*(t[1]-e[0][1]))/o,s=(n*(t[1]-e[0][1])-a*(t[0]-e[0][0]))/o,l<0||s<0||l+s>1?null:[l,s]))}},u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{size:16};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.size=t.size,this.delaunay=s}return o(e,[{key:"processImage",value:function(e,t){var n=this;return new Promise((function(r,a){if(!e)throw Error("Image source is undefined");var i=new Image;i.src=e,i.onload=function(){n.polygonize(i,t).then(r)},i.onerror=function(){a(Error("Invalid image source"))}}))}},{key:"polygonize",value:function(e,t){var n=this;return new Promise((function(r){var a,o,l=i(void 0,1,1,!0),s=i(void 0,1,1,!1),u=l.canvas,c=l.context,f=s.canvas,d=s.context,h=e.width*n.size,p=e.height*n.size;u.width=h,u.height=p,f.width=h,f.height=p,c.drawImage(e,0,0,h,p),a=n.generatePoints(h,p),o=n.delaunay.triangulate(a),n.svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg"),n.svgElement.setAttribute("width",d.canvas.width),n.svgElement.setAttribute("height",d.canvas.height),n.drawTriangles(a,o,c,t?void 0:d),t?r(n.getSVGURL()):function(e,t){var n,r;try{e.toBlob((function(e){var n=URL.createObjectURL(e);t(n)}))}catch(a){n=function(e){var t,n=e.split(",")[0].split(":")[1].split(";")[0],r=atob(e.split(",")[1]),a=[];for(t=0;t>>0,this.rgba_[3]=e>>24&255,this.rgba_[2]=e>>16&255,this.rgba_[1]=e>>8&255,this.rgba_[0]=255&e}},{key:"r",get:function(){return this.rgba_[0]}},{key:"g",get:function(){return this.rgba_[1]}},{key:"b",get:function(){return this.rgba_[2]}},{key:"a",get:function(){return this.rgba_[3]}},{key:"rgba",get:function(){return this.rgba_.subarray(0,4)}},{key:"uint32",get:function(){return(this.r<<24|this.g<<16|this.b<<8|this.a)>>>0}}],[{key:"createUint32",value:function(t){return new e(new Uint8Array(Uint32Array.of((0|t)>>>0).buffer))}}]),e}(),t.default=i},653:function(e,t,n){"use strict";var r,i,a,o,s;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n>>0,n[1]=(n[1]+t[1]|0)>>>0,n[2]=(n[2]+t[2]|0)>>>0,n[3]=(n[3]+t[3]|0)>>>0})),t=e.length,new a.default(Uint8Array.of(n[0]/t|0,n[1]/t|0,n[2]/t|0,n[3]/t|0))}}]),e}(),t.default=o},655:function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&m.length>0?i.push(y,m):i.push(p))}catch(O){c=!0,l=O}finally{try{!u&&h.return&&h.return()}finally{if(c)throw l}}r=i}for(b=r.map((function(e){return e.reduce((function(e,t){return e+(t>>16&255)}),0)/e.length<<16|e.reduce((function(e,t){return e+(t>>8&255)}),0)/e.length<<8|e.reduce((function(e,t){return e+(255&t)}),0)/e.length})),w=new Uint8ClampedArray(e.length),x=0;x>16&255,w[x+1]=k>>8&255,w[x+2]=255&k,w[x+3]=e[x+3];return w}function a(e){var t=[0,1,2].map((function(t){var n=e.map((function(e){return e>>8*(2-t)&255}));return Math.max.apply(Math,r(n))-Math.min.apply(Math,r(n))})),n=t.indexOf(Math.max.apply(Math,r(t))),i=e.slice().sort((function(e,t){return(e>>8*(2-n)&255)-(t>>8*(2-n)&255)})),a=i[i.length>>1]>>8*(2-n)&255;return{axis:n,median:a}}function o(e,t,n){var r,i,a,o=[],s=[],u=8*(2-t),c=!0,l=!1,h=void 0;try{for(r=e[Symbol.iterator]();!(c=(i=r.next()).done);c=!0)(((a=i.value)>>u&255)<=n?o:s).push(a)}catch(f){l=!0,h=f}finally{try{!c&&r.return&&r.return()}finally{if(l)throw h}}return[o,s]}function s(e,t){var n,r,i,a,o,s,u,c,l,h=1/0,f=t[0],d=!0,p=!1,g=void 0;try{for(n=t[Symbol.iterator]();!(d=(r=n.next()).done);d=!0)i=r.value,(a=(u=((o=e)>>16&255)-((s=i)>>16&255))*u+(c=(o>>8&255)-(s>>8&255))*c+(l=(255&o)-(255&s))*l)0&&(r-=(o=s[a]/i)*Math.log2(o));return r}function c(e,t){var n,r,i=255,a=0,o=0,s=0,u=0,c=0;for(n=0;n>2,o/=t.length>>2,r=0;r>2)-1,u/=(t.length>>2)-1,(2*a*o+.01*i*(.01*i))*(2*(c/=(e.length>>2)-1)+.03*i*(.03*i))/((a*a+o*o+6.502500000000001)*(s+u+58.522499999999994))}function l(e,t){var n,r,i,a,o=0;for(n=0;n>2)}var h,f=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},d=n(654),p=n(648),g=(0,p.SIMDopeCreateConfAdd)({create:{new_of:!0},properties:{uint32:!0,laba:!0,rgbaon4bits:!0,rgbaon6bits:!0,rgbaon8bits:!0,rgbaon12bits:!0,rgbaon16bits:!0,skin:!0},methods:{simplify:!0,get_new_element:!0,get_use_element:!0,set_tail:!0,is_dark:!0,blend_first_with:!0,blend_first_with_tails:!0,blend_all:!0,cie76_match_with:!0,copy:!0}}),_=Math.fround,v=_(1),y=_(.777),m=(0,p.SIMDopeCreate)(g),b=m.simdops,w=m.Color,x=m.Colors,k=(b.minus_int,b.int_not_equal,b.plus_int,b.plus_uint,b.minus_uint,b.multiply_int,b.multiply_uint,b.multiply_uint_4),P=(b.divide_uint,b.clamp_uint8,b.clamp_uint32,b.int_equal,b.uint_less,b.int_less,b.int_greater_equal,b.uint_not_equal,b.uint_less_equal,b.min_uint,function e(t){if(t=t||{},!(this instanceof e))return new e(t);t.pxl_colors=t.pxl_colors||new Uint32Array(0),t.pxls=t.pxls||new Uint32Array(0),this.new_pxls_="buffer"in t.pxls?new Uint32Array(t.pxls.buffer):Uint32Array.from(t.pxls),this.new_pxl_colors_="buffer"in t.pxl_colors?new x(t.pxl_colors.buffer):new x(Uint32Array.from(t.pxl_colors).buffer),this.original_pxls_=this.new_pxls_.slice(0,this.new_pxls_.length),this.original_pxl_colors_=this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length);var n=0|this.new_pxl_colors_.length;this.new_pxl_colors_is_skin_mask_=new d.SetFixed(0|n),this.set_new_pxl_skin_mask(),this.best_color_number_=t.number_of_color,this.max_cluster_=n>65536?65537:n>16384?4097:n>8192?257:n>512?17:1,this.index_clusters_=Array(this.max_cluster_),this.length_clusters_=new Uint32Array(this.max_cluster_),this.pxl_colors_usage_=new Uint32Array(n),this.all_index_clusters_=new Uint32Array(n),this.clean_pxl_colors_=new Uint32Array(n),this.clean_pxl_colors_lookup_={},this.is_skin_ops_=0,this.match_ops_=0,this.blend_ops_=0,this.remove_duplicate_ops_=0,this.simplify_ops_=0,this.classify_on_x_bits_ops_=0});Object.defineProperty(P.prototype,"set_is_skin_ops",{get:function(){return function(e){this.is_skin_ops_=(0|e)>>>0}}}),Object.defineProperty(P.prototype,"set_match_ops",{get:function(){return function(e){this.match_ops_=(0|e)>>>0}}}),Object.defineProperty(P.prototype,"set_blend_ops",{get:function(){return function(e){this.blend_ops_=(0|e)>>>0}}}),Object.defineProperty(P.prototype,"set_remove_duplicate_ops",{get:function(){return function(e){this.remove_duplicate_ops_=(0|e)>>>0}}}),Object.defineProperty(P.prototype,"set_simplify_ops",{get:function(){return function(e){this.simplify_ops_=e}}}),Object.defineProperty(P.prototype,"set_classify_on_x_bits_ops",{get:function(){return function(e){this.classify_on_x_bits_ops_=e}}}),Object.defineProperty(P.prototype,"get_is_skin_ops",{get:function(){return function(){return 0|this.is_skin_ops_}}}),Object.defineProperty(P.prototype,"get_match_ops",{get:function(){return function(){return 0|this.match_ops_}}}),Object.defineProperty(P.prototype,"get_blend_ops",{get:function(){return function(){return 0|this.blend_ops_}}}),Object.defineProperty(P.prototype,"get_remove_duplicate_ops",{get:function(){return function(){return 0|this.remove_duplicate_ops_}}}),Object.defineProperty(P.prototype,"get_simplify_ops",{get:function(){return function(){return this.simplify_ops_}}}),Object.defineProperty(P.prototype,"get_classify_on_x_bits_ops",{get:function(){return function(){return this.classify_on_x_bits_ops_}}}),Object.defineProperty(P.prototype,"reset_deduplicate",{get:function(){return function(e){this.clean_pxl_colors_lookup_={},this.pxl_colors_usage_.fill(0,0,0|e),this.clean_pxl_colors_.fill(0,0,0|e)}}}),Object.defineProperty(P.prototype,"index_of_color_within_cleaned",{get:function(){return function(e){return(0|this.clean_pxl_colors_lookup_[(0|e)>>>0])-1|0}}}),Object.defineProperty(P.prototype,"set_cleaned_pxl_colors",{get:function(){return function(e,t){this.clean_pxl_colors_[(0|e)>>>0]=(0|t)>>>0,this.clean_pxl_colors_lookup_[(0|t)>>>0]=(e+1|0)>>>0}}}),Object.defineProperty(P.prototype,"increase_color_usage",{get:function(){return function(e){this.pxl_colors_usage_[(0|e)>>>0]=(this.pxl_colors_usage_[(0|e)>>>0]+1|0)>>>0}}}),Object.defineProperty(P.prototype,"set_new_pxls",{get:function(){return function(e,t){this.new_pxls_[(0|e)>>>0]=(0|t)>>>0}}}),Object.defineProperty(P.prototype,"set_new_pxl_colors",{get:function(){return function(e){this.new_pxl_colors_=new x(this.clean_pxl_colors_.buffer.slice(0,k(0|e))),this.set_new_pxl_skin_mask()}}}),Object.defineProperty(P.prototype,"set_new_pxl_skin_mask",{get:function(){return function(){var e=new w(new ArrayBuffer(4)),t=0|this.new_pxl_colors_.length,n=0;for(this.new_pxl_colors_is_skin_mask_=new d.SetFixed(0|t);(0|n)<(0|t);n=n+1|0)this.new_pxl_colors_.get_use_element(0|n,e).skin&&this.new_pxl_colors_is_skin_mask_.add(0|n);this.set_is_skin_ops(this.get_is_skin_ops()+n|0)}}}),Object.defineProperty(P.prototype,"get_a_new_pxl_color_from_pxl_index",{get:function(){return function(e){return 4294967295&this.new_pxl_colors_.buffer_getUint32(this.new_pxls_[0|e])}}}),Object.defineProperty(P.prototype,"reset_cluster",{get:function(){return function(){this.max_cluster_=this.new_pxl_colors_.length>65536?65537:this.new_pxl_colors_.length>16384?4097:this.new_pxl_colors_.length>8192?257:this.new_pxl_colors_.length>512?17:1,this.length_clusters_.fill(0,0,0|this.max_cluster);for(var e=0;(0|e)<(0|this.max_cluster);e=(e+1|0)>>>0)this.index_clusters_[0|e]=[]}}}),Object.defineProperty(P.prototype,"reset_original_data",{get:function(){return function(){this.new_pxl_colors_=new x(this.original_pxl_colors_.slice(0,this.original_pxl_colors_.length).buffer),this.new_pxls_=this.original_pxls_.slice(0,this.original_pxls_.length)}}}),Object.defineProperty(P.prototype,"add_in_indexes_cluster",{get:function(){return function(e,t){this.index_clusters_[(0|e)>>>0].push((0|t)>>>0)}}}),Object.defineProperty(P.prototype,"set_all_cluster_indexes",{get:function(){return function(){for(var e=0,t=0;(0|e)<(0|this.max_cluster);e=(e+1|0)>>>0)this.all_index_clusters_.set(this.index_clusters_[(0|e)>>>0],(0|t)>>>0),t=(t+this.get_length_in_index_clusters(0|e)|0)>>>0}}}),Object.defineProperty(P.prototype,"get_length_in_index_clusters",{get:function(){return function(e){return(0|this.index_clusters_[(0|e)>>>0].length)>>>0}}}),Object.defineProperty(P.prototype,"get_in_cluster_lengths",{get:function(){return function(e){return(0|this.length_clusters_[(0|e)>>>0])>>>0}}}),Object.defineProperty(P.prototype,"get_an_index_in_clusters",{get:function(){return function(e){return(0|this.all_index_clusters_[0|e])>>>0}}}),Object.defineProperty(P.prototype,"get_a_color_usage",{get:function(){return function(e){return(0|this.pxl_colors_usage_[0|e])>>>0}}}),Object.defineProperty(P.prototype,"set_a_color_usage",{get:function(){return function(e,t){return this.pxl_colors_usage_[0|e]=(0|t)>>>0}}}),Object.defineProperty(P.prototype,"get_a_color_usage_percent",{get:function(){return function(e){return _(this.pxl_colors_usage_[0|e]/this.new_pxls_.length)}}}),Object.defineProperty(P.prototype,"get_average_color_usage_percent",{get:function(){return function(e,t){var n,r,i;for(t=0|((t|=0)<(e|=0)?this.pxl_colors_usage_.length:t),n=0,r=0,i=0,r=0|e;(0|r)<(0|t);r=(r+1|0)>>>0)i=(0|this.get_an_index_in_clusters((0|r)>>>0))>>>0,n+=this.pxl_colors_usage_[0|i]/this.new_pxls_.length;return n/(t-e|0)}}}),Object.defineProperty(P.prototype,"get_a_new_pxl_color",{get:function(){return function(e){return this.new_pxl_colors_.get_new_element(0|e)}}}),Object.defineProperty(P.prototype,"is_pxl_color_skin",{get:function(){return function(e){return this.new_pxl_colors_is_skin_mask_.has(0|e)}}}),Object.defineProperty(P.prototype,"max_cluster",{get:function(){return 0|this.max_cluster_}}),Object.defineProperty(P.prototype,"new_pxls_length",{get:function(){return 0|this.new_pxls_.length}}),Object.defineProperty(P.prototype,"new_pxl_colors_length",{get:function(){return 0|this.new_pxl_colors_.length}}),Object.defineProperty(P.prototype,"best_color_number",{get:function(){return 0|this.best_color_number_}}),Object.defineProperty(P.prototype,"get_data",{get:function(){return function(){return Array.of(this.new_pxls_,this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length),{deduplicate:this.get_remove_duplicate_ops(),simplify:this.get_simplify_ops(),classify:this.get_classify_on_x_bits_ops(),skin:this.get_is_skin_ops(),blend:this.get_blend_ops(),match:this.get_match_ops()})}}}),P.prototype.output=function(e){var t,n;return e=e||"heap",t=this.get_data(),"heap"==e?((n=new Uint32Array(2+t[0].length+t[1].length))[0]=0|t[0].length,n[1]=0|t[1].length,n.set(t[0],2),n.set(t[1],2+t[0].length),n.buffer):t},P.prototype.deduplicate=function(){var e,t,n,r,i;for(this.set_remove_duplicate_ops(this.get_remove_duplicate_ops()+1|0),this.reset_deduplicate(0|this.new_pxl_colors_length),e=0,t=0,n=0,r=0,i=0|this.new_pxls_length;(0|r)<(0|i);r=(r+1|0)>>>0)t=0|this.get_a_new_pxl_color_from_pxl_index(0|r),-1==(0|(n=0|this.index_of_color_within_cleaned(0|t)))&&(this.set_cleaned_pxl_colors(0|e,0|t),n=0|e,e=e+1|0),this.increase_color_usage(0|n),this.set_new_pxls(0|r,0|n);this.set_new_pxl_colors(e)},P.prototype.clusterize=function(){this.reset_cluster();var e=0;if(65537===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon16bits)>>>0,(0|e)>>>0);else if(4097===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon12bits)>>>0,(0|e)>>>0);else if(257===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon8bits)>>>0,(0|e)>>>0);else if(17===this.max_cluster)for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|e)>>>0).rgbaon4bits)>>>0,(0|e)>>>0);else for(;(0|e)<(0|this.new_pxl_colors_length);e=(e+1|0)>>>0)this.add_in_indexes_cluster(0,(0|e)>>>0);this.max_cluster>1&&this.set_classify_on_x_bits_ops(this.get_classify_on_x_bits_ops()+this.new_pxl_colors_length),this.set_all_cluster_indexes()},P.prototype.process_threshold=function(e){var t,n,r,i,a,o,s,u,c,l,h,f,d,p,g,m,b,x,k,P,O,S,j,C,A,E;for(n=function(e,n){return _(Math.pow(e,t)/n)}(e=(0|e)>>>0,Math.pow(128,t=1)),r=0,i=[],a=[],o=0,s=0,l=!1,h=!1,f=0,d=0,p=0,g=0,m=0,b=0,x=_(n),O=0,S=0,j=0,C=0,A=0,E=0,P=_(x*y),k=_(x*v);(0|A)<(0|this.max_cluster);A=(A+1|0)>>>0){for(s=(o+((0|this.get_length_in_index_clusters(0|A))>>>0)|0)>>>0,m=this.get_average_color_usage_percent(0|o,0|s),j=0|o;(0|j)<(0|s);j=(j+1|0)>>>0){if(O=(0|this.get_an_index_in_clusters((0|j)>>>0))>>>0,u=this.get_a_new_pxl_color((0|O)>>>0),l=this.is_pxl_color_skin((0|O)>>>0),(0|(f=(0|this.get_a_color_usage((0|O)>>>0))>>>0))>0)for(i=[],C=0|o;(0|C)<(0|s);C=(C+1|0)>>>0)S=(0|this.get_an_index_in_clusters((0|C)>>>0))>>>0,c=this.get_a_new_pxl_color((0|S)>>>0),h=this.is_pxl_color_skin((0|S)>>>0),0|(d=(0|this.get_a_color_usage((0|S)>>>0))>>>0)&&(0|O)!=(0|S)&&(0|l)==(0|h)&&(p=this.get_a_color_usage_percent((0|O)>>>0)/m,g=this.get_a_color_usage_percent((0|S)>>>0)/m,E=_((E=l&&h?P:l||h?k:x)*(0*Math.abs(p-g)+.2*(2-(p+g))/2+.8)/1),u.cie76_match_with(c,E)&&(b=_(d/f),r++,this.set_a_color_usage(0|S,0),i.push(c),a.push(b)));(0|i.length)>0&&(w.blend_all(u,i,a),i=[],a=[])}o=0|s}return r},P.prototype.round=function(){var e,t;if(this.new_pxl_colors_length>2048){for(e=0|(this.new_pxl_colors_length>6e4?4:this.new_pxl_colors_length>32e3?3:this.new_pxl_colors_length>16e3?2:this.new_pxl_colors_length>8192?1.5:this.new_pxl_colors_length>4096?1.25:1),t=0;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.get_a_new_pxl_color((0|t)>>>0).simplify(e);this.set_simplify_ops(this.get_simplify_ops()+this.new_pxl_colors_length)}},P.prototype.init=function(e){return this.round(),this.deduplicate(),this.clusterize(),this},P.prototype.reset_original=function(){return this.reset_original_data(),this},P.prototype.run=function(){var e=0;if(this.new_pxl_colors_length<=this.best_color_number)return this.reset_original(),this.deduplicate(),this.clusterize(),this;for(;this.new_pxl_colors_length>this.best_color_number&&e<100;)e++,this.process_threshold(0|e)>0&&(this.deduplicate(),this.clusterize());return this.reset_original(),this.deduplicate(),this.clusterize(),this.process_threshold(0|e),this.deduplicate(),this.clusterize(),this},P.split_image_data=function(e){var t,n,r=new Uint32Array(e.data.buffer),i=Uint32Array.from(new Set(r)),a={},o=i.length,s=new Uint32Array(r.length);for(t=0,n=0|o;(0|t)<(0|n);t=(t+1|0)>>>0)a[i[0|t]]=(0|t)>>>0;for(t=0,n=0|r.length;(0|t)<(0|n);t=(t+1|0)>>>0)s[0|t]=(0|a[r[0|t]])>>>0;return[s,i,r,o]},h=function(e,t){return new Promise((function(n){var r,a,o,s,h,d,p=P.split_image_data(e),g=f(p,4),_=g[0],v=g[1],y=g[2],m=g[3],b=Date.now(),w="auto"===t,x=parseFloat(t)>0&&parseFloat(t)<1,k=parseInt(t)<0,O=w?"auto":x||k?k?Math.max(1,m+parseInt(t)):x?Math.max(1,parseFloat(t)*m):m:parseInt(t);if("auto"===O&&(O=function(e){var t,n,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,h=o,f=-1/0;for(t=o;t<=s;t++)n=i(e,t),r=u(new Uint8Array(n.buffer)),(a=c(e,n)/(l(e,n)+1)-r)>f&&(f=a,h=t);return h}(e.data,32,96)),O>=m)n([e,_,v,0,v.length,0]);else{for(r=P({pxls:_,pxl_colors:v,number_of_color:Math.min(m,O),width:e.width,height:e.height}).init().run().output("split"),a=Date.now(),s=0|(o=r[0]).length,h=r[1],d=0;(0|d)<(0|s);d=(d+1|0)>>>0)y[0|d]=(0|h[(0|o[0|d])>>>0])>>>0;n([e=new ImageData(new Uint8ClampedArray(y.buffer),e.width,e.height),o,h,m-h.length,h.length,a-b])}}))},e.exports={QuantiMatGlobal:h,QuantiMat:P}},656:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strength=t,this.tilesManager=n,this.tiles=n.getTiles(),this.width=r,this.height=i}},658:function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),r=(i=n(670))&&i.__esModule?i:{default:i},t.default=r.default.pool({minWorkers:0,maxWorkers:3})},660:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4&&a<=32;)t=e[a],e[2*a-1],e[2*a],e[2*a+1],e[4*a-1],e[4*a],e[4*a+1],i<(n=t*a*(1+.1*a))&&(i=n,o=a),a++;return r=0,e.forEach((function(e,t){r+=e*t})),{tileSize:o,certainty:Math.fround(o*e[o]/r)}}var n,r,i,a,o,s,u,c=e.width,l=e.height,h=new Uint32Array(e.data.buffer),f=64,d=new Uint32Array(f),p=new Uint32Array(f),g=0,_=new Uint32Array(2);for(n=0;n1&&g0&&g1&&g0&&g>24&255)-(t>>24&255)),u((e>>16&255)-(t>>16&255)),u((e>>8&255)-(t>>8&255))),r=Uint16Array.of(c(n[0],n[0]),c(n[1],n[1]),c(n[2],n[2]));return(0|Math.sqrt((((r[0]<<1)+r[0]|0)+(r[1]<<2)+(r[2]<<1)|0)/10))>>>0}},{key:"quantizeImageData",value:function(e,t){var n,r,i,o,u=e.getImageData(0,0,e.canvas.width,e.canvas.height),c=Date.now(),l=s.QuantiMat.split_image_data(u),h=a(l,2),f=h[0],d=h[1],p=Date.now(),g=(0,s.QuantiMat)({pxls:f,pxl_colors:d,number_of_color:Math.min(d.length,t),width:u.width,height:u.height}).init().run().output("split"),_=Date.now();for(console.log(p-c,_-p),n=g[0],r=g[1],i=new Uint32Array(n.length),o=0;oo&&(a=s,o=t[s]);return a}},{key:"_calculateElbowStrength",value:function(e,t){var n,r,a,o=e.map((function(t,n){return n/(e.length-1)})),s=Math.max.apply(Math,i(e)),u=Math.min.apply(Math,i(e)),c=e.map((function(e){return(e-u)/(s-u)})),l=[0,c[0]],h=[1,c[c.length-1]],f=[o[t],c[t]],d=Math.sqrt(Math.pow(h[0]-l[0],2)+Math.pow(h[1]-l[1],2)),p=Math.abs(((a=h)[1]-(r=l)[1])*(n=f)[0]-(a[0]-r[0])*n[1]+a[0]*r[1]-a[1]*r[0])/Math.sqrt(Math.pow(a[1]-r[1],2)+Math.pow(a[0]-r[0],2));return Math.fround(p/d)}}]),e}(),t.default=l},661:function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n1&&void 0!==arguments[1]&&arguments[1],r=(0,i.default)(e);return n&&(t=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/gi,r.match(t).forEach((function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),3!==i.length);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.match(/\w\w/g).map((function(e){return parseInt(e,16)}))),n=t[0],i=t[1],a=t[2],o=Math.round((n+i+a)/3),s=function(e,t,n){return e=e.toString(16),t=t.toString(16),n=n.toString(16),1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n}(o,o,o);r=r.replace(e,s)}))),(0,a.default)(r)}},666:function(e,t,n){"use strict";function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,n){return function r(i,a){var o,s;try{s=(o=t[i](a)).value}catch(u){return void n(u)}if(!o.done)return Promise.resolve(s).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(s)}("next")}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){var n,r;for(n=0;na?"Process will start after "+i+" remaining job"+(i?"s":""):"Process will start immediately"),this.msgCallback(o);break;case"progress":u="Processing: "+(s=(t.progress_data||[])[0]||{}).index+"/"+s.length+" "+s.unit+".",this.msgCallback(u)}}catch(c){}}},{key:"generateRandomId",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t="";e>=6;)t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0"),e-=6;return e>0&&(t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0").slice(0,e)),t}},{key:"getHeadersJson",value:function(){return{"Content-Type":"application/json"}}},{key:"getHeadersStream",value:function(){return{accept:"text/event-stream"}}},{key:"getHeadersAll",value:function(){return{accept:"*/*"}}},{key:"getUploadUrl",value:function(e){return this.baseUrl+"/upload?upload_id="+e}},{key:"getCreateImagePathUrl",value:function(e){return this.baseUrl+"/file="+e}},{key:"handleLoadComplete",value:(u=a(regeneratorRuntime.mark((function e(t,n,r,i){var a,o,s,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=void 0===n?"blob":n,a=(t||"/unknown.webp").split("/"),o=a[a.length-1]||"unknown.png",s=o.split(".")[1]||"png",u="image/"+s,s="jpeg"===s?"jpg":s,e.prev=6,e.next=9,new Promise((function(e){var a=new Image;a.setAttribute("crossorigin","anonymous"),a.onload=function(){var t,o,s=a.naturalHeight||a.height,u=a.naturalWidth||a.width;i=i||s,r=r||u;try{switch(n.toLowerCase()){case"base64":!function(){var t=document.createElement("canvas");t.width=r,t.height=i,t.getContext("2d").drawImage(a,0,0,r,i);try{e(t.toDataURL("image/webp",.75))}catch(n){e(t.toDataURL("image/jpeg",.75))}}();break;case"blob":!function(){var t=document.createElement("canvas");t.width=r,t.height=i,t.getContext("2d").drawImage(a,0,0,r,i);try{t.toBlob(e,"image/webp",.75)}catch(n){t.toBlob(e,"image/jpeg",.75)}}();break;case"imagedata":(o=document.createElement("canvas")).width=r,o.height=i,(t=o.getContext("2d")).drawImage(a,0,0,r,i),e(t.getImageData(0,0,r,i,{colorSpace:"srgb"}))}}catch(c){}},a.setAttribute("src",t)}));case 9:c=e.sent,e.t0=n,e.next="blob"===e.t0?13:"base64"===e.t0?15:"imagedata"===e.t0?16:17;break;case 13:return l=new File([c],o,{type:u}),e.abrupt("return",Promise.resolve(l));case 15:case 16:return e.abrupt("return",Promise.resolve(c));case 17:e.next=23;break;case 19:return e.prev=19,e.t1=e.catch(6),console.error("Error creating file from URL:",e.t1),e.abrupt("return",Promise.reject());case 23:case"end":return e.stop()}}),e,this,[[6,19]])}))),function(e,t,n,r){return u.apply(this,arguments)})},{key:"uploadFile",value:(i=a(regeneratorRuntime.mark((function e(t,n){var r,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("files",t),e.next=4,fetch(this.getUploadUrl(n),{method:"POST",body:r});case 4:return i=e.sent,e.next=7,i.json();case 7:return a=e.sent,e.abrupt("return",Promise.resolve(a[0]||a));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"fetchEventSource",value:(r=a(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersAll(),method:"GET"});case 2:return n=e.sent,e.abrupt("return",Promise.resolve(n.body.getReader()));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"fetchEventSourceJSON",value:(n=a(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersJson(),method:"GET"});case 2:return n=e.sent,e.next=5,n.clone().text();case 5:return r=e.sent,i=r.replaceAll("event: complete\ndata: ",""),e.prev=7,e.abrupt("return",Promise.resolve(JSON.parse(i)));case 11:return e.prev=11,e.t0=e.catch(7),e.abrupt("return",Promise.reject());case 14:case"end":return e.stop()}}),e,this,[[7,11]])}))),function(e){return n.apply(this,arguments)})},{key:"readResponse",value:(t=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h,f,d,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i=!1,a=null;case 4:if(i){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,s=o.value,u=o.done,i=i||u,r+=n.decode(s||new Uint8Array,{stream:!0}),c=(r||"\n").split("\n"),l=!0,h=!1,f=void 0,e.prev=16,d=c[Symbol.iterator]();!(l=(p=d.next()).done);l=!0)g=(g=p.value).trim(),this.message(g),console.log(g),g.includes("complete")&&(i=!0,a=g);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),h=!0,f=e.t0;case 24:e.prev=24,e.prev=25,!l&&d.return&&d.return();case 27:if(e.prev=27,!h){e.next=30;break}throw f;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=c[c.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(a));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return t.apply(this,arguments)})}]),e}(),c=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-sd3-long-captioner-v2.hf.space",e))}var n,u,c;return i(t,e),s(t,[{key:"getCreateCaptionsUrl",value:function(){return this.baseUrl+"/call/create_captions_rich"}},{key:"getReadCaptions",value:function(e){try{return JSON.parse(e.slice(5))}catch(t){return""}}},{key:"readResponse",value:(c=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h,f,d,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i=!1,a=null;case 4:if(i){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,s=o.value,u=o.done,i=i||u,r+=n.decode(s||new Uint8Array,{stream:!0}),c=(r||"\n").split("\n"),l=!0,h=!1,f=void 0,e.prev=16,d=c[Symbol.iterator]();!(l=(p=d.next()).done);l=!0)g=(g=p.value).trim(),this.message(g),g.includes("complete")&&(i=!0,a=g);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),h=!0,f=e.t0;case 24:e.prev=24,e.prev=25,!l&&d.return&&d.return();case 27:if(e.prev=27,!h){e.next=30;break}throw f;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=c[c.length-1],e.next=4;break;case 35:return e.abrupt("return",i?Promise.resolve(a):Promise.reject("Error"));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return c.apply(this,arguments)})},{key:"createCaptions",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this.getCreateCaptionsUrl(),{method:"POST",headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:t}]})});case 2:return n=e.sent,e.prev=3,e.next=6,n.json();case 6:return r=e.sent,e.abrupt("return",Promise.resolve(r.event_id));case 10:return e.prev=10,e.t0=e.catch(3),e.abrupt("return",Promise.reject("Error"));case 13:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(e){return u.apply(this,arguments)})},{key:"run",value:(n=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:n=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}n=t,e.next=12;break;case 11:return e.abrupt("return",Promise.reject());case 12:return r=this.generateRandomId(),e.next=15,this.uploadFile(n,r);case 15:return i=e.sent,a=this.getCreateCaptionsUrl(),e.next=19,this.createCaptions(i);case 19:return o=e.sent,e.abrupt("return",this.fetchEventSourceJSON(a+"/"+o).then((function(e){return e[0]})).catch((function(){return""})));case 21:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(u),l=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-florence-2.hf.space",e))}var n;return i(t,e),s(t,[{key:"getPredictHeader",value:function(e,t,n,r,i,a){return a=a||1,{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},1===a?"Caption":2===a?"Detailed Caption":"More Detailed Caption","","microsoft/Florence-2-large"],event_data:null,fn_index:4,trigger_id:10,session_hash:i}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readLine",value:function(e,t){var n,r,i;console.log(e),e=e.slice(5);try{return(n=JSON.parse(e)).success?(r=((n.output||{}).data||[])[0],i=1===t?r.slice(15,r.length-2):2===t?r.slice(24,r.length-2):r.slice(29,r.length-2),Promise.resolve(i.replaceAll("\\n","").replaceAll("\n",""))):Promise.reject("")}catch(a){return Promise.reject()}}},{key:"run",value:(n=a(regeneratorRuntime.mark((function e(t,n){var r,i,a,o,s,u,c,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 32:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(),e.next=15,this.uploadFile(r,i);case 15:return a=e.sent,o=this.getCreateImagePathUrl(a),s=this.getPredictHeader(a,o,r.size,r.type,i,n),e.next=20,fetch(this.getQueueJoinUrl(),s);case 20:return u=e.sent,e.next=23,u.json();case 23:if(!e.sent.event_id){e.next=32;break}return e.next=28,this.fetchEventSource(this.getResultUrl(i));case 28:return c=e.sent,e.abrupt("return",this.readResponse(c).then((function(e){return l.readLine(e,n)})).catch((function(){return Promise.reject()})));case 33:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u),h=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://kenjiedec-rembg.hf.space",e))}var n;return i(t,e),s(t,[{key:"getQueuePushUrl",value:function(){return this.baseUrl+"/api/queue/push/"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({action:"predict",data:[e,"Mask only","isnet-general-use"],fn_index:0,session_hash:t}),method:"POST"}}},{key:"getQueueStatusUrl",value:function(){return this.baseUrl+"/api/queue/status/"}},{key:"getResultHeader",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({hash:e}),method:"POST"}}},{key:"run",value:(n=a(regeneratorRuntime.mark((function e(t,n,r){var i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(regeneratorRuntime.mark((function e(o,s){var u,c,l,h,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=void 0,"string"==typeof t){e.next=7;break}return e.next=4,i.handleLoadComplete(t,"base64");case 4:u=e.sent,e.next=14;break;case 7:if(!t.startsWith("blob:")){e.next=13;break}return e.next=10,i.handleLoadComplete(t,"base64");case 10:u=e.sent,e.next=14;break;case 13:u=t;case 14:return c=i.generateRandomId(),e.next=17,fetch(i.getQueuePushUrl(),i.getPredictHeader(u,c));case 17:return e.next=19,e.sent.json();case 19:l=e.sent,h=l.hash,f=setTimeout((function(){clearInterval(d),s()}),1e4),d=setInterval(a(regeneratorRuntime.mark((function e(){var t,a,s,u,c,l,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(i.getQueueStatusUrl(),i.getResultHeader(h));case 2:return e.next=4,e.sent.json();case 4:if(t=e.sent,a=t.data||{},!(s=a.data||[]).length){e.next=18;break}return e.next=10,i.handleLoadComplete(s[0],"imagedata",n,r);case 10:for(u=e.sent,c=u.data,l=[],p=0,g=c.length;(0|p)<(0|g);p=p+4|0)(0|(c[0|p]+c[p+1|0]+c[p+2|0]|0)/3)<32&&l.push(p/4|0);o(l),clearInterval(d),clearTimeout(f);case 18:case"end":return e.stop()}}),e,i)}))),1e3);case 23:case"end":return e.stop()}}),e,i)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})}]),t}(u),f=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://pixart-alpha-pixart-sigma.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictHeader",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:512,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"(No style)",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"bad shape, disformed, photography, photo, realistic, photo-realistic.",s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"DPM-Solver",u=this.generateRandomSeed();return a="string"==typeof a?a:["(No style)","Pixel Art","Digital Art","Anime","Manga"][a],{headers:this.getHeadersJson(),body:JSON.stringify({data:["A pixel art (retro style video game palette artwork) of : "+e,o,a,!0,i,u,n,r,s,4.5,3.5,17,25,!0],event_data:null,fn_index:3,trigger_id:7,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h,f,d,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i=!1,a=null;case 4:if(i){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,s=o.value,u=o.done,i=i||u,r+=n.decode(s||new Uint8Array,{stream:!0}),c=(r||"\n").split("\n"),l=!0,h=!1,f=void 0,e.prev=16,d=c[Symbol.iterator]();!(l=(p=d.next()).done);l=!0)g=(g=p.value).trim(),this.message(g),g.includes("complete")&&(i=!0,a=g);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),h=!0,f=e.t0;case 24:e.prev=24,e.prev=25,!l&&d.return&&d.return();case 27:if(e.prev=27,!h){e.next=30;break}throw f;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=c[c.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(a));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return u.apply(this,arguments)})},{key:"extractLastImageUrl",value:function(e,t){var n,r,i,a,o,s,u;try{for(console.log(e),n=JSON.parse(e.slice(5).trim()),r=[],i=n.output.data||[],a=0;a1&&void 0!==arguments[1]?arguments[1]:512,f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,d=this,p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,g=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"imagedata";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.generateRandomId(),r=this.getPredictHeader(t,n,h,f,p,1),i=this.getQueueJoinUrl(),e.next=5,fetch(i,r);case 5:return a=e.sent,e.next=8,a.json();case 8:if(!e.sent.event_id){e.next=27;break}return e.next=13,this.fetchEventSource(this.getResultUrl(n));case 13:return o=e.sent,e.next=16,this.readResponse(o);case 16:if(s=e.sent,1!==(u=this.extractLastImageUrl(s)).length){e.next=26;break}return c=u[0],e.next=22,this.handleLoadComplete(c,g);case 22:return l=e.sent,e.abrupt("return",Promise.resolve(l));case 26:return e.abrupt("return",Promise.allSettled([u.map((function(){return d.handleLoadComplete(i,g)}))]));case 27:return e.abrupt("return",Promise.reject());case 28:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(u),d=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://abidlabs-face-to-all.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,i,a){var o="A 2D illustration in retro game style pixel art of "+i.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. Video game, low color number, high quality."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real, CGI, 3D.",.95,null,.9,.12,7.75,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:a}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i="",a=!1;case 3:if(a){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,s=o.value,u=o.done,a=a||u,r+="".concat(n.decode(s||new Uint8Array,{stream:!0})),c=(r||"\n").split("\n"),l=0;l2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 47:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(),a=this.generateRandomId(),o=this.getPredictHeader(b,a),s=this.getPredictUrl(),e.next=18,fetch(s,o);case 18:return u=e.sent,c=u.ok,e.next=22,this.uploadFile(r,i);case 22:if(l=e.sent,h=this.getCreateImagePathUrl(l),!c||!h){e.next=47;break}return f=this.getQueueJoinHeader(l,h,r.size,r.type,n,a),d=this.getQueueJoinUrl(),e.next=29,fetch(d,f);case 29:return p=e.sent,e.next=32,p.json();case 32:if(void 0===e.sent.event_id){e.next=47;break}return g=this.getQueueDataUrl(a),e.next=38,this.fetchEventSource(g);case 38:return _=e.sent,e.next=41,this.readResponse(_);case 41:return v=e.sent,y=this.extractSecondImageUrl(v),e.next=45,this.handleLoadComplete(y);case 45:return m=e.sent,e.abrupt("return",Promise.resolve(m));case 48:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u),p=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://multimodalart-face-to-all.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,i,a){var o="A pixel art person image in lucasarts of : "+i.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, Photography, Real, Photo-realistic, Screenshot, Filters, Retro, Bad Quality, Worst settings.",.9,null,.85,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:a}),method:"POST"}}},{key:"getUselessBullshit",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[null,null],event_data:null,fn_index:5,trigger_id:18,session_hash:e}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i="",a=!1;case 3:if(a){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,s=o.value,u=o.done,a=a||u,r+="".concat(n.decode(s||new Uint8Array,{stream:!0})),c=(r||"\n").split("\n"),l=0;l2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 57:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(8),a=this.generateRandomId(11),o=this.getPredictHeader(w,a),s=this.getPredictUrl(),e.next=18,fetch(s,o);case 18:return u=e.sent,c=u.ok,e.next=22,this.uploadFile(r,i);case 22:if(l=e.sent,h=this.getCreateImagePathUrl(l),!c||!h){e.next=57;break}return f=this.getQueueJoinHeader(l,h,r.size,r.type,n,a),d=this.getQueueJoinUrl(),e.next=29,fetch(d,f);case 29:if(!(p=e.sent).ok){e.next=57;break}return e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=57;break}return g=this.getQueueDataUrl(a),e.next=40,fetch(g,this.getUselessBullshit(a));case 40:if(!(_=e.sent).ok){e.next=57;break}return e.next=44,_.json();case 44:if(!e.sent.event_id){e.next=57;break}return e.next=48,this.fetchEventSource(g);case 48:return v=e.sent,e.next=51,this.readResponse(v);case 51:return y=e.sent,m=this.extractSecondImageUrl(y),e.next=55,this.handleLoadComplete(m);case 55:return b=e.sent,e.abrupt("return",Promise.resolve(b));case 58:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u),g=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://neil-ni-face-to-all.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,i,a){var o="A pixel art person image in lucasarts of : "+i.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real.",.95,null,.9,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:a}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i="",a=!1;case 3:if(a){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,s=o.value,u=o.done,a=a||u,r+="".concat(n.decode(s||new Uint8Array,{stream:!0})),c=(r||"\n").split("\n"),l=0;l2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 49:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(),a=this.generateRandomId(),o=this.getPredictHeader(b,a),s=this.getPredictUrl(),e.next=18,fetch(s,o);case 18:return u=e.sent,e.next=21,u.json();case 21:return c=e.sent,e.next=24,this.uploadFile(r,i);case 24:if(l=e.sent,h=this.getCreateImagePathUrl(l),!c||!h){e.next=49;break}return f=this.getQueueJoinHeader(l,h,r.size,r.type,n,a),d=this.getQueueJoinUrl(),e.next=31,fetch(d,f);case 31:return p=e.sent,e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=49;break}return g=this.getQueueDataUrl(a),e.next=40,this.fetchEventSource(g);case 40:return _=e.sent,e.next=43,this.readResponse(_);case 43:return v=e.sent,y=this.extractSecondImageUrl(v),e.next=47,this.handleLoadComplete(y);case 47:return m=e.sent,e.abrupt("return",Promise.resolve(m));case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u);e.exports={HuggingFaceAPI:u,FaceToAllAPI:d,FaceToAllAPI2:p,FaceToAllAPI3:g,FloranceCaptionerAPI:l,LongCaptionerAPI:c,RemoveBackgroundAPI:h,ImageCreatorAPI:f}},667:function(e,t,n){"use strict";var r=n(668);e.exports={createLocalBlob:function(e){var t,n,i,a,o=(e.match(/(data\:([a-z]+\/[a-z\+]+)\;base64\,)([a-zA-Z0-9\/\+]+\(\=+)?/)||[,,])[1];return o?(n=(t=o.match(/data\:([a-z]+\/[a-z\+]+)\;base64\,/)[1]).match(/[a-z]+\/([a-z\+]+)/)[1],e=e.replace(o,""),i=(0,r.base64ToBytes)(e),a=new File([i],"name."+n,{type:t}),URL.createObjectURL(a)):""}}},668:function(e,t,n){"use strict";var r=new(n(265).B64chromium);e.exports={bytesToBase64:r.bytesToBase64.bind(r),base64ToBytes:r.base64ToBytes.bind(r)}},675:function(e,t,n){"use strict";var r,i=n(676),a=Object.getPrototypeOf((r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e,this)})),function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(i,a){var o,s;try{s=(o=e[i](a)).value}catch(u){return void n(u)}if(!o.done)return Promise.resolve(s).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(s)}("next")}))})).constructor,o=Object.getPrototypeOf((function(){})).constructor,s=new o('var t = function(file) {\n "use strict";\n \n try {\n \n return new Promise(function(resolve, _) {\n resolve(new FileReaderSync().readAsDataURL(file));\n });\n \n } catch(error) {\n \n return new Promise(function(resolve, _) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(file);\n });\n }\n \n}; return t;')(),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(s,[e]).catch((function(t){return s(e)})).timeout(5e3).then((function(e){t(e)})):s(e).then((function(e){t(e)}))},c=new a('var t = async function(base64) {\n\n "use strict";\n\n return fetch(base64).then(function(res) {\n\n return res.blob().then(function(blb){\n\n return createImageBitmap(blb, {\n resizeQuality: "pixelated",\n premultiplyAlpha: \'premultiply\'\n });\n });\n });\n\n}; return t;')(),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(c,[e]).catch((function(t){return c(e)})).timeout(5e3).then((function(e){t(e)})):c(e).then((function(e){t(e)}))},h=function(e){for(var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2073600,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=1;Math.round(e.width*a)*Math.round(e.height*a)>r;)a-=.01;try{createImageBitmap(e,0,0,e.width,e.height,{resizeWidth:Math.round(e.width*a),resizeHeight:Math.round(e.height*a),resizeQuality:"pixelated",premultiplyAlpha:"premultiply"}).then((function(e){var t,n=void 0;try{n=new OffscreenCanvas(e.width,e.height)}catch(r){(n=document.createElement("canvas")).width=e.width,n.height=e.height}(t=n.getContext("2d")).imageSmoothingEnabled=!1,t.drawImage(e,0,0,e.width,e.height),i(t.getImageData(0,0,e.width,e.height))}))}catch(o){t=void 0;try{t=new OffscreenCanvas(Math.round(e.width*a),Math.round(e.height*a))}catch(s){(t=document.createElement("canvas")).width=Math.round(e.width*a),t.height=Math.round(e.height*a)}(n=t.getContext("2d")).imageSmoothingEnabled=!1,n.drawImage(e,0,0,t.width,t.height),i(n.getImageData(0,0,t.width,t.height))}},f=new o('var t = function(imagedata, type) {\n\n "use strict"\n type = type || "image/png";\n var quality = type.includes("webp") ? 1: type.includes("png") ? undefined: 0.7;\n try {\n \n return new Promise(function(resolve, _) {\n\n createImageBitmap(imagedata, 0, 0, imagedata.width, imagedata.height, {\n premultiplyAlpha: \'premultiply\',\n resizeQuality: \'pixelated\'\n }).then((bmp) => {\n \n var canvas;\n canvas = new OffscreenCanvas(imagedata.width, imagedata.height);\n var ctx = canvas.getContext("bitmaprenderer");\n ctx.imageSmoothingEnabled = false;\n ctx.transferFromImageBitmap(bmp);\n \n canvas.convertToBlob({type: type, quality: quality}).then((blb) => {\n try {\n resolve(new FileReaderSync().readAsDataURL(blb));\n } catch(e2) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(blb);\n }\n });\n });\n });\n \n }catch (e) {\n \n return new Promise(function(resolve, _) {\n var canvas = document.createElement("canvas");\n canvas.width = imagedata.width;\n canvas.height = imagedata.height;\n var ctx = canvas.getContext("2d");\n ctx.imageSmoothingEnabled = false;\n ctx.putImageData(imagedata, 0, 0);\n \n var base64 = canvas.toDataURL(type, quality);\n canvas = null;\n resolve(base64);\n });\n }\n\n}; return t;')();e.exports={file_to_imagedata_resized:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Date.now(),e.type,"image/jpg"!==e.type&&e.type,e.type,u(e,(function(e){l(e,(function(e){h(e,t,(function(e){n(e)}),r)}),r)}),r)},file_to_base64:u,base64_to_bitmap:l,bitmap_to_imagedata:h,imagedata_to_base64:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null!==r?r.exec(f,[e,t]).catch((function(n){return f(e,t)})).timeout(5e3).then((function(e){n(e)})):f(e,t).then((function(e){n(e)}))},base64_sanitize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};(function(e,t,n){return n=n||"pixelize",new Promise((function(r,a){var o=new Image,s=e.startsWith("data:image/png;");o.onload=function(){var e,a,u=o.naturalWidth*t,c=o.naturalHeight*t,l=function(e,t,n,r){var a,o,s,u,c=void 0;if("pixelize"===r||"normal"===r){a=void 0,o=void 0;try{a=new OffscreenCanvas(e.width,e.height),o=new OffscreenCanvas(t,n)}catch(l){a=document.createElement("canvas"),o=document.createElement("canvas"),a.width=e.width,a.height=e.height,o.width=t,o.height=n}s=a.getContext("2d"),u=o.getContext("2d"),s.imageSmoothingEnabled=!("normal"!==r),u.imageSmoothingEnabled=!("normal"!==r),s.drawImage(e,0,0,e.width,e.height),u.drawImage(a,0,0,a.width,a.height,0,0,o.width,o.height),c=u}else"doppel"===r&&(c=i.scaler.processImage(e,t,n));return c}(o,0|u,0|c,n);try{e=l.getImageData(0,0,l.canvas.width,l.canvas.height),createImageBitmap(e).then((function(e){var t,n;try{t=new OffscreenCanvas(e.width,e.height)}catch(i){(t=document.createElement("canvas")).height=e.height,t.width=e.width}(n=t.getContext("bitmaprenderer")).imageSmoothingEnabled=!1,n.transferFromImageBitmap(e),t.convertToBlob({type:s?"image/png":"image/jpeg"}).then((function(e){try{r((new FileReaderSync).readAsDataURL(e))}catch(n){var t=new FileReader;t.onload=function(){r(t.result)},t.readAsDataURL(e)}}))}))}catch(h){a=l.canvas,r(a.toDataURL(s?"image/png":"image/jpeg"))}},o.onerror=function(){a()},o.src=e}))})(e,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,arguments[4]).then((function(e){t(e)}))},file_to_bitmap:function(e,t){createImageBitmap(e).then(t)}}},676:function(e,t,n){"use strict";var r,i=(r=n(677))&&r.__esModule?r:{default:r},a=new i.default({strength:1,overlapFactor:1,despeckleStrength:.88});e.exports={scaler:a,ImageProcessor:i.default}},677:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i,a,o,s,u,c,l,h,f,d,p,g;Object.defineProperty(t,"__esModule",{value:!0}),i=function(){function e(e,t){var n,r;for(n=0;n=this.finalWidth||o>=this.finalHeight||s.push(this.tiles[a+o*this.finalWidth]);return s}},{key:"paintTiles",value:function(){this.imageData.data.set(this.tilesColorUint8a),this.contextDestination.putImageData(this.imageData,0,0)}}]),e}(),t.default=o},679:function(e,t,n){"use strict";var r,i,a,o,s,u,c;Object.defineProperty(t,"__esModule",{value:!0}),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){var n,r;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.imageData=t,this.meanColor=new o.default(n),this.coordinates=Uint16Array.of(i,a),r=this.imageData.data.length,this.k=r>=64?6:r>=16?4:r>=9?3:r>=2?2:1}return i(e,[{key:"quantizeColors",value:function(){var e,t=s.QuantiMat.split_image_data(this.imageData),n=r(t,2),i=n[0],a=n[1],o=(0,s.QuantiMat)({pxls:i,pxl_colors:a,number_of_color:Math.min(a.length,this.k),width:this.imageData.width,height:this.imageData.height}).init().run().output("split"),u=o[0],c=o[1],l=u<255?new Uint8Array(c.length):new Uint16Array(c.length);for(e=0;e=o-2&&(u.forEach((function(e){e.meanColor.setRGBA(n.meanColor.rgba);var t=e.x+e.y*r.width;i[t]=!0})),i[c]=!0)},n=0;n0&&i<60&&p.setRGBA(r.rgba);break;case"EDGE":a=new c.default(b[0].data),o=new c.default(b[1].data),u=s.default.colorDifference(a,o),l=s.default.colorDifference(a,p),f=s.default.colorDifference(o,p),5*Math.abs(l-f)>=u&&(d=new c.default(new h.default(_.map((function(e){return e.meanColor.rgba})),4).run(4).centroidsSorted[0].data),p.setRGBA(d.rgba))}}},{key:"determineClassification",value:function(e,t){return e[0].count>=.75*t?"AREA":Math.abs(e[0].count-e[1].count)*Math.abs(e[2].count-e[3].count)<25?"SHAPE":Math.abs(e[0].count-e[1].count)<.75*Math.abs(e[1].count-e[2].count)?"EDGE":"COMPLEX"}}]),t}(a.default),t.default=f},683:function(e,t,n){"use strict";var r,i,a;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;nt&&(t=a,n=i)})),n}},{key:"distance",value:function(e,t){return this.c1.set_from_array(e),this.c2.set_from_array(t),16192*this.c1.fast_match_with(this.c2)|0}},{key:"reassignCentroids",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:16,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(this.initializeCentroids(),e=0,t=!1,n=void 0,r=function(){var r=o.centroids.map((function(e){return Uint32Array.from(e)}));o.assignClusters(),n=o.updateCentroids(),e++,t=o.centroids.every((function(e,t){return o.distance(e,r[t])<2})),u&&!t&&o.reassignCentroids(n)};!t&&e1&&void 0!==arguments[1]?arguments[1]:"COMPRESS_OBJECT";return new Promise((function(n,r){"COMPRESS_OBJECT"===t?n(new Uint8ClampedArray(i.default.compress(a.default.pack(e)).buffer)):"DECOMPRESS_UINT8A"===t&&n(a.default.unpack(i.default.uncompress(e)))}))}}},826:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(n(658)),a=r(n(153)),o=r(n(827));e.exports={base64png_to_xbrz_svg:function(e,t,r,s){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"xbrz",l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],h=arguments.length>7&&void 0!==arguments[7]&&arguments[7],f=arguments.length>8&&void 0!==arguments[8]&&arguments[8],d=new Image;d.onload=function(){var e,p,g,_,v,y,m,b,w,x,k=document.createElement("canvas"),P=k.getContext("2d"),O=d.width,S=d.height;k.width=O,k.height=S,P.drawImage(d,0,0,O,S),e=P.getImageData(0,0,O,S),p=function(e,t){return new Promise((function(t,r){(0,a.default)((function(){return n.e(2).then(n.t.bind(null,720,7))})).then((function(n){(0,n.crt)(e,1).then(t).catch(r)}))}))},g=function(e,t,r,o,s){l?(0,a.default)((function(){return n.e(6).then(n.t.bind(null,719,7))})).then((function(u){(0,u.oxi_png)(e,3,!1,i.default).then((function(e){s(e,t,r,o)})).catch((function(){(0,a.default)((function(){return n.e(0).then(n.t.bind(null,657,7))})).then((function(n){(0,n.png_quant)(e,100,100,1,i.default).then((function(e){s(e,t,r,o)})).catch((function(){s(e,t,r,o)}))})).catch((function(){s(e,t,r,o)}))}))})).catch((function(){s(e,t,r,o)})):s(e,t,r,o)},_=function(e,t){h?(0,a.default)((function(){return n.e(23).then(n.t.bind(null,941,7))})).then((function(o){(0,o.image_tracer)(e,{pal:u.map((function(e){return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)}})),corsenabled:!1,ltres:t,qtres:t,pathomit:t,rightangleenhance:!1,colorsampling:2,numberofcolors:512,mincolorratio:0,colorquantcycles:1,layering:0,strokewidth:Math.ceil(t/2),linefilter:!0,scale:1,roundcoords:2,viewbox:!0,desc:!1,lcpr:0,qcpr:0,blurradius:t,blurdelta:4*t},i.default).then((function(e){l?(0,a.default)((function(){return n.e(1).then(n.bind(null,689))})).then((function(n){var i=n.optimize;e=i(e,{path:"path-to.svg",multipass:!0,mergePaths:!0,mergeStyles:!0,collapseGroups:!0,reusePaths:!0,plugin:["multipass","mergePaths","collapseGroups","reusePaths","mergeStyles"]}).data,r("data:image/svg+xml;base64,"+window.btoa(e),t)})):r("data:image/svg+xml;base64,"+window.btoa(e),t)}))})):r("",0)},"depixelize"===c?(y=(v=(0,o.default)(e,h))[0],m=v[1],(b=document.createElement("canvas")).width=y.width,b.height=y.height,(w=b.getContext("2d")).putImageData(y,0,0),x=w.canvas.toDataURL("image/png"),f&&p(y).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,10,e.width,e.height,s)})),h&&(l?(0,a.default)((function(){return n.e(1).then(n.bind(null,689))})).then((function(e){var t=e.optimize;m=t(m,{path:"path-to.svg",multipass:!0,plugin:["mergePaths"]}).data,r("data:image/svg+xml;base64,"+window.btoa(m),10)})):r("data:image/svg+xml;base64,"+window.btoa(m),10)),g(x,10,y.width,y.height,t)):"omniscale"===c?(0,a.default)((function(){return n.e(24).then(n.t.bind(null,942,7))})).then((function(n){(0,n.omniscale)(e,8,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,8,e.width,e.height,s)})),_(e,8),g(r,8,e.width,e.height,t)}))})):"hexagon"===c?(0,a.default)((function(){return n.e(5).then(n.t.bind(null,721,7))})).then((function(n){(0,n.hexagonrender)(e,16).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,16,e.width,e.height,s)})),_(e,32/6),g(r,32,e.width,e.height,t)}))})):"kikko"===c?(0,a.default)((function(){return n.e(41).then(n.t.bind(null,943,7))})).then((function(n){(0,n.kikkorender)(e,24,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,24,e.width,e.height,s)})),_(e,6),g(r,48,e.width,e.height,t)}))})):"hqnx"===c?(0,a.default)((function(){return n.e(22).then(n.t.bind(null,944,7))})).then((function(n){(0,n.hqnx)(e,4,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,4,e.width,e.height,s)})),_(e,4),g(r,4,e.width,e.height,t)}))})):"epx"===c?(0,a.default)((function(){return n.e(21).then(n.t.bind(null,945,7))})).then((function(n){(0,n.epx)(e,4,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,4,e.width,e.height,s)})),_(e,4),g(r,4,e.width,e.height,t)}))})):(0,a.default)((function(){return n.e(3).then(n.t.bind(null,722,7))})).then((function(n){n.default(e,6,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,6,e.width,e.height,s)})),_(e,6),g(r,6,e.width,e.height,t)}))}))},d.src=e}}},827:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==y(Symbol.iterator)?function(e){return void 0===e?"undefined":y(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":y(e)},r(e)}function i(){function e(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,n,r){var i=t&&t.prototype instanceof a?t:a,o=Object.create(i.prototype),s=new p(r||[]);return b(o,"_invoke",{value:l(e,n,s)}),o}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}function a(){}function o(){}function s(){}function u(t){["next","throw","return"].forEach((function(n){e(t,n,(function(e){return this._invoke(n,e)}))}))}function c(e,t){function i(a,o,s,u){var c,l,h=n(e[a],e,o);if("throw"!==h.type)return(l=(c=h.arg).value)&&"object"==r(l)&&m.call(l,"__await")?t.resolve(l.__await).then((function(e){i("next",e,s,u)}),(function(e){i("throw",e,s,u)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,u)}));u(h.arg)}var a;b(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function l(e,t,r){var i="suspendedStart";return function(a,o){var s,u,c;if("executing"===i)throw Error("Generator is already running");if("completed"===i){if("throw"===a)throw o;return{value:void 0,done:!0}}for(r.method=a,r.arg=o;;){if((s=r.delegate)&&(u=h(s,r))){if(u===O)continue;return u}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);if(i="executing","normal"===(c=n(e,t,r)).type){if(i=r.done?"completed":"suspendedYield",c.arg===O)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i="completed",r.method="throw",r.arg=c.arg)}}}function h(e,t){var r,i,a=t.method,o=e.iterator[a];return void 0===o?(t.delegate=null,"throw"===a&&e.iterator.return&&(t.method="return",t.arg=void 0,h(e,t),"throw"===t.method)||"return"!==a&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+a+"' method")),O):"throw"===(r=n(o,e.iterator,t.arg)).type?(t.method="throw",t.arg=r.arg,t.delegate=null,O):(i=r.arg)?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,O):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function d(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function p(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function g(e){var t,n,r;if(e){if(t=e[x])return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(r=function t(){for(;++n=0;--r){if(i=this.tryEntries[r],a=i.completion,"root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev)if(o=m.call(i,"catchLoc"),s=m.call(i,"finallyLoc"),o&&s){if(this.prev=0;--n)if((r=this.tryEntries[n]).tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev=0;--t)if((n=this.tryEntries[t]).finallyLoc===e)return this.complete(n.completion,n.afterLoc),d(n),O},catch:function(e){var t,n,r,i;for(t=this.tryEntries.length-1;t>=0;--t)if((n=this.tryEntries[t]).tryLoc===e)return"throw"===(r=n.completion).type&&(i=r.arg,d(n)),i;throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:g(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),O}},v}function a(e,t){var n,r,i,a,o,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!s){if(Array.isArray(e)||(s=f(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),n=0,{s:r=function(){},n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return i=!0,a=!1,{s:function(){s=s.call(e)},n:function(){var e=s.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==s.return||s.return()}finally{if(a)throw o}}}}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){function n(){return s(e,arguments,l(this).constructor)}if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},o(e)}function s(e,t,n){return s=u()?Reflect.construct.bind():function(e,t,n){var r,i=[null];return i.push.apply(i,t),r=new(Function.bind.apply(e,i)),n&&c(r,n.prototype),r},s.apply(null,arguments)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i,a,o,s,u,c=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=c){o=[],s=!0,u=!1;try{if(i=(c=c.call(e)).next,0===t){if(Object(c)!==c)return;s=!1}else for(;!(s=(n=i.call(c)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(l){u=!0,r=l}finally{try{if(!s&&null!=c.return&&(a=c.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=1}},{key:"toString",value:function(){return"rgb("+this.rgb.join()+")"}}]),e}(),k=function(){function e(t,n){p(this,e),this.x=t,this.y=n,this.edges=[]}return _(e,[{key:"split",value:function(t){return new e((this.x+t.x)/2,(this.y+t.y)/2)}},{key:"adjust",value:function(e,t){return this.x+=e,this.y+=t,this}},{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"addEdge",value:function(e){-1==this.edges.indexOf(e)&&(this.edges.push(e),e.addEdge(this))}}]),e}(),P=function(e){function t(e){var n;return p(this,t),(n=o.call(this,1))[0]=e,n.circular=!1,n}!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e);var n,i,o=(n=t,i=u(),function(){var e,t,a=l(n);return i?(t=l(this).constructor,e=Reflect.construct(a,arguments,t)):e=a.apply(this,arguments),function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});return _(t,[{key:"splitAt",value:function(e){var n,r,i,o,s;if(1!==this.length){if(this[0]===e)this.shift();else if(this[this.length-1]===e)this.pop();else if(this.circular)for(n=this.shift();n!==e;n=this.shift())this.push(n);else{r=this.indexOf(e),o=a(i=this.slice(r+1));try{for(o.s();!(s=o.n()).done;)s.value.curve=i}catch(u){o.e(u)}finally{o.f()}this.length=r}e.curve=new t(e)}}},{key:"merge",value:function(e){var t,n,r,i,a,o;if(this!==e)for(n=(t=h([this,e].sort((function(e,t){return e.length-t.length})),2))[0],-1!==(r=t[1])[0].edges.indexOf(n[0])?(i=this.shift,a=this.unshift):-1!==r[0].edges.indexOf(n[n.length-1])?(i=this.pop,a=this.unshift):-1!==r[r.length-1].edges.indexOf(n[0])?(i=this.shift,a=this.push):-1!==r[r.length-1].edges.indexOf(n[n.length-1])&&(i=this.pop,a=this.push);n.length;)o=i.call(n),a.call(r,o),o.curve=r;else this.circular=e.length>2}}],[{key:"curve",value:function(e,t){return e.curve===t.curve?e.curve.length:0}}]),t}(o(Array)),O=function(){function e(t,n,r,i){p(this,e),this.x=t,this.y=n,this.edges=[,,,,,,,,],this.vertices=i||[],this.color=r,this.marked=!1,this.curve=new P(this)}return _(e,[{key:"relativePosition",value:function(e){var t=e.x,n=e.y-this.y;return(t-this.x+3*n+8)%9}},{key:"invalidCurve",value:function(){return this.valence()>2&&this.curve.length>1}},{key:"updateCurves",value:function(){this.valence()>2&&this.curve.splitAt(this)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"removeEdge",value:function(t){e.removeEdge(this,t)}},{key:"canReach",value:function(e){return e&&!!this.edges[this.relativePosition(e)]}},{key:"valence",value:function(){return this.edges.filter((function(e){return e})).length}},{key:"toString",value:function(){return"("+[this.x,this.y].join()+") => "+this.edges.filter((function(e){return e})).map((function(e){return"("+[e.x,e.y].join()+")"})).join()}},{key:"edge",value:function(e,t){return this.edges[(e+3*t+8)%9]}},{key:"right",value:function(){return this.edges[0]}},{key:"left",value:function(){return this.edges[7]}},{key:"up",value:function(){return this.edges[5]}},{key:"down",value:function(){return this.edges[2]}},{key:"isEdge",value:function(){return this.edges.filter((function(e){return e})).length<4}},{key:"follow",value:i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this;case 1:if(!(n.canReach(t)&&n.valence()<3)){e.next=14;break}return e.next=4,t;case 4:if(!(t.valence()>2)){e.next=6;break}return e.abrupt("break",14);case 6:if(r=t.edges.filter((function(e){return e})),a=r[0]!=n?r[0]:r[1],n=t,(t=a)!=this){e.next=12;break}return e.abrupt("break",14);case 12:e.next=1;break;case 14:case"end":return e.stop()}}),e,this)}))},{key:"square",value:function(){var e=h(this.edges,3),t=e[0],n=e[2],r=t&&n&&t.down()&&n.right();return[this,t,n,r].filter((function(e){return e}))}}],[{key:"addSimilarEdge",value:function(e,t){e.color&&t.color&&!e.color.dissimilar(t.color)&&(e.edges[e.relativePosition(t)]=t,t.edges[t.relativePosition(e)]=e,e.valence()>2&&e.curve.splitAt(e),t.valence()>2&&t.curve.splitAt(t),e.valence()<3&&t.valence()<3&&e.curve.merge(t.curve))}},{key:"removeEdge",value:function(e,t){e.edges[e.relativePosition(t)]=void 0,t.edges[t.relativePosition(e)]=void 0}}]),e}(),S=function(){function e(t,n,r){if(p(this,e),t.length!=n*r*4)throw Error("Wrong dimension of pixel buffer");this.width=n,this.height=r,this.pixels=t}return _(e,[{key:"create",value:i().mark((function e(){var t,n,r,a,o,s,u,c,l,h,f,d,p,g,_;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=this.width,n=this.height,r=Array(n),(a=Array(n+1))[0]=Array(t+1),o=0;o0;)o=i.pop(),-1==a.indexOf(o)&&o.x>e&&o.xn&&o.y0?i[0]+=s:i[1]-=s,(u=a[0].length-a[1].length)>0?i[1]+=u:i[0]-=u,(c=r.map((function(e){return 1==e[0].valence()||1==e[1].valence()})))[0]&&!c[1]?i[0]+=5:!c[0]&&c[1]&&(i[1]+=5),i[0]>i[1]?O.removeEdge(r[1][0],r[1][1]):i[0]')}}catch(_){p=!0,g=_}finally{try{!d&&n.return&&n.return()}finally{if(p)throw g}}return''+f.join("\n\t")+""}(i,t),r},t.default=b},828:function(e,t,n){"use strict";var r=n(829);e.exports={loadJSON:function(e,t){var n=new XMLHttpRequest;try{n=new XMLHttpRequest}catch(r){try{n=new ActiveXObject("Msxml2.XMLHTTP")}catch(r){try{n=new ActiveXObject("Microsoft.XMLHTTP")}catch(r){t("Cannot load data",null)}}}n.open("GET",e,!0),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)try{var e=JSON.parse(n.responseText);t(null,e)}catch(r){t("Cannot understand response from network.",null)}else 4==n.readyState&&404==n.status&&t("Error 404",null)};try{n.send()}catch(r){t("Failed to fetch",null)}},postJSON:function(e,t,n){var i,a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/x-www-form-urlencoded",s=new Headers;s.append("Content-Type",o),i="multipart/form-data"===o?new FormData:new URLSearchParams,Object.entries(t).forEach((function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e),n=t[0],r=t[1];i.append(n,r)})),a={method:"POST",redirect:"follow",headers:s,body:"application/text"===o?t:"application/json"===o?(0,r.clean_json_text)(JSON.stringify(t)):i},fetch(e,a).then((function(e){return e.text()})).then((function(e){return n(null,e)})).catch((function(e){return n(e,null)}))},postDATA:function(e,t,n){var r=new XMLHttpRequest;try{r=new XMLHttpRequest}catch(i){try{r=new ActiveXObject("Msxml2.XMLHTTP")}catch(i){try{r=new ActiveXObject("Microsoft.XMLHTTP")}catch(i){return void n("Cannot load data",null)}}}r.open("POST",e,!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.onreadystatechange=function(){if(4==r.readyState&&200==r.status)try{var e=JSON.parse(r.responseText);n(null,e)}catch(i){n("Cannot understand response from network.",null)}else 4==r.readyState&&404==r.status&&n("Error 404",null)};try{r.send(t)}catch(i){n("Failed to post",null)}}}},829:function(e,t,n){"use strict";e.exports={clean_json_text:function(e){return(e=e.replace(/\\n/g,"\\n").replace(/\\'/g,"\\'").replace(/\\"/g,'\\"').replace(/\\&/g,"\\&").replace(/\\r/g,"\\r").replace(/\\t/g,"\\t").replace(/\\b/g,"\\b").replace(/\\f/g,"\\f")).replace(/[\u0000-\u0019]+/g,"")}}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{652:function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n>>0,this.rgba_[3]=e>>24&255,this.rgba_[2]=e>>16&255,this.rgba_[1]=e>>8&255,this.rgba_[0]=255&e}},{key:"r",get:function(){return this.rgba_[0]}},{key:"g",get:function(){return this.rgba_[1]}},{key:"b",get:function(){return this.rgba_[2]}},{key:"a",get:function(){return this.rgba_[3]}},{key:"rgba",get:function(){return this.rgba_.subarray(0,4)}},{key:"uint32",get:function(){return(this.r<<24|this.g<<16|this.b<<8|this.a)>>>0}}],[{key:"createUint32",value:function(t){return new e(new Uint8Array(Uint32Array.of((0|t)>>>0).buffer))}}]),e}(),t.default=i},653:function(e,t,n){"use strict";var r,i,a,o,s;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n>>0,n[1]=(n[1]+t[1]|0)>>>0,n[2]=(n[2]+t[2]|0)>>>0,n[3]=(n[3]+t[3]|0)>>>0})),t=e.length,new a.default(Uint8Array.of(n[0]/t|0,n[1]/t|0,n[2]/t|0,n[3]/t|0))}}]),e}(),t.default=o},655:function(e,t,n){"use strict";var r,i=n(654),a=n(648),o=(0,a.SIMDopeCreateConfAdd)({create:{new_of:!0},properties:{uint32:!0,laba:!0,rgbaon4bits:!0,rgbaon6bits:!0,rgbaon8bits:!0,rgbaon12bits:!0,rgbaon16bits:!0,skin:!0},methods:{simplify:!0,get_new_element:!0,get_use_element:!0,set_tail:!0,is_dark:!0,blend_first_with:!0,blend_first_with_tails:!0,blend_all:!0,cie76_match_with:!0,copy:!0}}),s=Math.fround,u=s(1),c=s(.777),l=(0,a.SIMDopeCreate)(o),h=l.simdops,f=l.Color,d=l.Colors,p=(h.minus_int,h.int_not_equal,h.plus_int,h.plus_uint,h.minus_uint,h.multiply_int,h.multiply_uint,h.multiply_uint_4),g=(h.divide_uint,h.clamp_uint8,h.clamp_uint32,h.int_equal,h.uint_less,h.int_less,h.int_greater_equal,h.uint_not_equal,h.uint_less_equal,h.min_uint,function e(t){if(t=t||{},!(this instanceof e))return new e(t);t.pxl_colors=t.pxl_colors||new Uint32Array(0),t.pxls=t.pxls||new Uint32Array(0),this.new_pxls_="buffer"in t.pxls?new Uint32Array(t.pxls.buffer):Uint32Array.from(t.pxls),this.new_pxl_colors_="buffer"in t.pxl_colors?new d(t.pxl_colors.buffer):new d(Uint32Array.from(t.pxl_colors).buffer),this.original_pxls_=this.new_pxls_.slice(0,this.new_pxls_.length),this.original_pxl_colors_=this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length);var n=0|this.new_pxl_colors_.length;this.new_pxl_colors_is_skin_mask_=new i.SetFixed(0|n),this.set_new_pxl_skin_mask(),this.best_color_number_=t.number_of_color,this.max_cluster_=this.new_pxl_colors_.length>16384?65537:this.new_pxl_colors_.length>4096?4097:this.new_pxl_colors_.length>1024?257:this.new_pxl_colors_.length>256?17:1,this.index_clusters_=Array(this.max_cluster_),this.length_clusters_=new Uint32Array(this.max_cluster_),this.pxl_colors_usage_=new Uint32Array(n),this.all_index_clusters_=new Uint32Array(n),this.clean_pxl_colors_=new Uint32Array(n),this.clean_pxl_colors_lookup_={},this.is_skin_ops_=0,this.match_ops_=0,this.blend_ops_=0,this.remove_duplicate_ops_=0,this.simplify_ops_=0,this.classify_on_x_bits_ops_=0});Object.defineProperty(g.prototype,"set_is_skin_ops",{get:function(){return function(e){this.is_skin_ops_=(0|e)>>>0}}}),Object.defineProperty(g.prototype,"set_match_ops",{get:function(){return function(e){this.match_ops_=(0|e)>>>0}}}),Object.defineProperty(g.prototype,"set_blend_ops",{get:function(){return function(e){this.blend_ops_=(0|e)>>>0}}}),Object.defineProperty(g.prototype,"set_remove_duplicate_ops",{get:function(){return function(e){this.remove_duplicate_ops_=(0|e)>>>0}}}),Object.defineProperty(g.prototype,"set_simplify_ops",{get:function(){return function(e){this.simplify_ops_=e}}}),Object.defineProperty(g.prototype,"set_classify_on_x_bits_ops",{get:function(){return function(e){this.classify_on_x_bits_ops_=e}}}),Object.defineProperty(g.prototype,"get_is_skin_ops",{get:function(){return function(){return 0|this.is_skin_ops_}}}),Object.defineProperty(g.prototype,"get_match_ops",{get:function(){return function(){return 0|this.match_ops_}}}),Object.defineProperty(g.prototype,"get_blend_ops",{get:function(){return function(){return 0|this.blend_ops_}}}),Object.defineProperty(g.prototype,"get_remove_duplicate_ops",{get:function(){return function(){return 0|this.remove_duplicate_ops_}}}),Object.defineProperty(g.prototype,"get_simplify_ops",{get:function(){return function(){return this.simplify_ops_}}}),Object.defineProperty(g.prototype,"get_classify_on_x_bits_ops",{get:function(){return function(){return this.classify_on_x_bits_ops_}}}),Object.defineProperty(g.prototype,"reset_deduplicate",{get:function(){return function(e){this.clean_pxl_colors_lookup_={},this.pxl_colors_usage_.fill(0,0,0|e),this.clean_pxl_colors_.fill(0,0,0|e)}}}),Object.defineProperty(g.prototype,"index_of_color_within_cleaned",{get:function(){return function(e){return(0|this.clean_pxl_colors_lookup_[(0|e)>>>0])-1|0}}}),Object.defineProperty(g.prototype,"set_cleaned_pxl_colors",{get:function(){return function(e,t){this.clean_pxl_colors_[(0|e)>>>0]=(0|t)>>>0,this.clean_pxl_colors_lookup_[(0|t)>>>0]=(e+1|0)>>>0}}}),Object.defineProperty(g.prototype,"increase_color_usage",{get:function(){return function(e){this.pxl_colors_usage_[(0|e)>>>0]=(this.pxl_colors_usage_[(0|e)>>>0]+1|0)>>>0}}}),Object.defineProperty(g.prototype,"set_new_pxls",{get:function(){return function(e,t){this.new_pxls_[(0|e)>>>0]=(0|t)>>>0}}}),Object.defineProperty(g.prototype,"set_new_pxl_colors",{get:function(){return function(e){this.new_pxl_colors_=new d(this.clean_pxl_colors_.buffer.slice(0,p(0|e))),this.set_new_pxl_skin_mask()}}}),Object.defineProperty(g.prototype,"set_new_pxl_skin_mask",{get:function(){return function(){var e=new f(new ArrayBuffer(4)),t=0|this.new_pxl_colors_.length,n=0;for(this.new_pxl_colors_is_skin_mask_=new i.SetFixed(0|t);(0|n)<(0|t);n=n+1|0)this.new_pxl_colors_.get_use_element(0|n,e).skin&&this.new_pxl_colors_is_skin_mask_.add(0|n);this.set_is_skin_ops(this.get_is_skin_ops()+n|0)}}}),Object.defineProperty(g.prototype,"get_a_new_pxl_color_from_pxl_index",{get:function(){return function(e){return 4294967295&this.new_pxl_colors_.buffer_getUint32(this.new_pxls_[0|e])}}}),Object.defineProperty(g.prototype,"reset_cluster",{get:function(){return function(e){this.max_cluster_=e?1:this.new_pxl_colors_.length>16384?65537:this.new_pxl_colors_.length>4096?4097:this.new_pxl_colors_.length>1024?257:this.new_pxl_colors_.length>256?17:1,this.length_clusters_.fill(0,0,0|this.max_cluster);for(var t=0;(0|t)<(0|this.max_cluster);t=(t+1|0)>>>0)this.index_clusters_[0|t]=[]}}}),Object.defineProperty(g.prototype,"reset_original_data",{get:function(){return function(){this.new_pxl_colors_=new d(this.original_pxl_colors_.slice(0,this.original_pxl_colors_.length).buffer),this.new_pxls_=this.original_pxls_.slice(0,this.original_pxls_.length)}}}),Object.defineProperty(g.prototype,"add_in_indexes_cluster",{get:function(){return function(e,t){this.index_clusters_[(0|e)>>>0].push((0|t)>>>0)}}}),Object.defineProperty(g.prototype,"set_all_cluster_indexes",{get:function(){return function(){for(var e=0,t=0;(0|e)<(0|this.max_cluster);e=(e+1|0)>>>0)this.all_index_clusters_.set(this.index_clusters_[(0|e)>>>0],(0|t)>>>0),t=(t+this.get_length_in_index_clusters(0|e)|0)>>>0}}}),Object.defineProperty(g.prototype,"get_length_in_index_clusters",{get:function(){return function(e){return(0|this.index_clusters_[(0|e)>>>0].length)>>>0}}}),Object.defineProperty(g.prototype,"get_in_cluster_lengths",{get:function(){return function(e){return(0|this.length_clusters_[(0|e)>>>0])>>>0}}}),Object.defineProperty(g.prototype,"get_an_index_in_clusters",{get:function(){return function(e){return(0|this.all_index_clusters_[0|e])>>>0}}}),Object.defineProperty(g.prototype,"get_a_color_usage",{get:function(){return function(e){return(0|this.pxl_colors_usage_[0|e])>>>0}}}),Object.defineProperty(g.prototype,"set_a_color_usage",{get:function(){return function(e,t){return this.pxl_colors_usage_[0|e]=(0|t)>>>0}}}),Object.defineProperty(g.prototype,"get_a_color_usage_percent",{get:function(){return function(e){return s(this.pxl_colors_usage_[0|e]/this.new_pxls_.length)}}}),Object.defineProperty(g.prototype,"get_average_color_usage_percent",{get:function(){return function(e,t){var n,r,i;for(t=0|((t|=0)<(e|=0)?this.pxl_colors_usage_.length:t),n=0,r=0,i=0,r=0|e;(0|r)<(0|t);r=(r+1|0)>>>0)i=(0|this.get_an_index_in_clusters((0|r)>>>0))>>>0,n+=this.pxl_colors_usage_[0|i]/this.new_pxls_.length;return n/(t-e|0)}}}),Object.defineProperty(g.prototype,"get_a_new_pxl_color",{get:function(){return function(e){return this.new_pxl_colors_.get_new_element(0|e)}}}),Object.defineProperty(g.prototype,"is_pxl_color_skin",{get:function(){return function(e){return this.new_pxl_colors_is_skin_mask_.has(0|e)}}}),Object.defineProperty(g.prototype,"max_cluster",{get:function(){return 0|this.max_cluster_}}),Object.defineProperty(g.prototype,"new_pxls_length",{get:function(){return 0|this.new_pxls_.length}}),Object.defineProperty(g.prototype,"new_pxl_colors_length",{get:function(){return 0|this.new_pxl_colors_.length}}),Object.defineProperty(g.prototype,"best_color_number",{get:function(){return 0|this.best_color_number_}}),Object.defineProperty(g.prototype,"get_data",{get:function(){return function(){return Array.of(this.new_pxls_,this.new_pxl_colors_.slice_uint32(0,this.new_pxl_colors_.length),{deduplicate:this.get_remove_duplicate_ops(),simplify:this.get_simplify_ops(),classify:this.get_classify_on_x_bits_ops(),skin:this.get_is_skin_ops(),blend:this.get_blend_ops(),match:this.get_match_ops()})}}}),g.prototype.output=function(e){var t,n;return e=e||"heap",t=this.get_data(),"heap"==e?((n=new Uint32Array(2+t[0].length+t[1].length))[0]=0|t[0].length,n[1]=0|t[1].length,n.set(t[0],2),n.set(t[1],2+t[0].length),n.buffer):t},g.prototype.deduplicate=function(){var e,t,n,r,i;for(this.set_remove_duplicate_ops(this.get_remove_duplicate_ops()+1|0),this.reset_deduplicate(0|this.new_pxl_colors_length),e=0,t=0,n=0,r=0,i=0|this.new_pxls_length;(0|r)<(0|i);r=(r+1|0)>>>0)t=0|this.get_a_new_pxl_color_from_pxl_index(0|r),-1==(0|(n=0|this.index_of_color_within_cleaned(0|t)))&&(this.set_cleaned_pxl_colors(0|e,0|t),n=0|e,e=e+1|0),this.increase_color_usage(0|n),this.set_new_pxls(0|r,0|n);this.set_new_pxl_colors(e)},g.prototype.clusterize=function(e){this.reset_cluster(e);var t=0;if(65537===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon16bits)>>>0,(0|t)>>>0);else if(4097===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon12bits)>>>0,(0|t)>>>0);else if(257===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon8bits)>>>0,(0|t)>>>0);else if(17===this.max_cluster)for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster((0|this.get_a_new_pxl_color((0|t)>>>0).rgbaon4bits)>>>0,(0|t)>>>0);else for(;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.add_in_indexes_cluster(0,(0|t)>>>0);this.max_cluster>1&&this.set_classify_on_x_bits_ops(this.get_classify_on_x_bits_ops()+this.new_pxl_colors_length),this.set_all_cluster_indexes()},g.prototype.process_threshold=function(e){var t,n,r,i,a,o,l,h,d,p,g,_,v,y,m,b,w,x,k,P,O,j,S,C,A,E;for(n=function(e,n){return s(Math.pow(e,t)/n)}(e=(0|e)>>>0,Math.pow(255,t=1)),r=0,i=[],a=[],o=0,l=0,p=!1,g=!1,_=0,v=0,y=0,m=0,b=0,w=0,x=s(n),O=0,j=0,S=0,C=0,A=0,E=0,P=s(x*c),k=s(x*u);(0|A)<(0|this.max_cluster);A=(A+1|0)>>>0){for(l=(o+((0|this.get_length_in_index_clusters(0|A))>>>0)|0)>>>0,b=this.get_average_color_usage_percent(0|o,0|l),S=0|o;(0|S)<(0|l);S=(S+1|0)>>>0){if(O=(0|this.get_an_index_in_clusters((0|S)>>>0))>>>0,h=this.get_a_new_pxl_color((0|O)>>>0),p=this.is_pxl_color_skin((0|O)>>>0),(0|(_=(0|this.get_a_color_usage((0|O)>>>0))>>>0))>0)for(i=[],C=0|o;(0|C)<(0|l);C=(C+1|0)>>>0)j=(0|this.get_an_index_in_clusters((0|C)>>>0))>>>0,d=this.get_a_new_pxl_color((0|j)>>>0),g=this.is_pxl_color_skin((0|j)>>>0),0|(v=(0|this.get_a_color_usage((0|j)>>>0))>>>0)&&(0|O)!=(0|j)&&(0|p)==(0|g)&&(y=this.get_a_color_usage_percent((0|O)>>>0)/b,m=this.get_a_color_usage_percent((0|j)>>>0)/b,E=s((E=p&&g?P:p||g?k:x)*(0*Math.abs(y-m)+.223*(2-(y+m))/2+.777)/1),h.cie76_match_with(d,E)&&(w=s(v/_),r++,this.set_a_color_usage(0|j,0),i.push(d),a.push(w)));(0|i.length)>0&&(f.blend_all(h,i,a),i=[],a=[])}o=0|l}return r},g.prototype.round=function(){var e,t;if(this.new_pxl_colors_length>2048){for(e=0|(this.new_pxl_colors_length>6e4?4:this.new_pxl_colors_length>32e3?3:this.new_pxl_colors_length>16e3?2:this.new_pxl_colors_length>8192?1.5:this.new_pxl_colors_length>4096?1.25:1),t=0;(0|t)<(0|this.new_pxl_colors_length);t=(t+1|0)>>>0)this.get_a_new_pxl_color((0|t)>>>0).simplify(e);this.set_simplify_ops(this.get_simplify_ops()+this.new_pxl_colors_length)}},g.prototype.init=function(e){return this.round(),this.deduplicate(),this.clusterize(),this},g.prototype.reset_original=function(){return this.reset_original_data(),this},g.prototype.run=function(){var e=0;if(this.new_pxl_colors_length<=this.best_color_number)return this.reset_original(),this.deduplicate(),this.clusterize(),this;for(;this.new_pxl_colors_length>this.best_color_number&&e<255;)e++,this.process_threshold(0|e)>0&&(this.deduplicate(),this.clusterize());return this.reset_original(),this.deduplicate(),this.clusterize(this.new_pxl_colors_length<4096),this.process_threshold(0|e),this.deduplicate(),this.clusterize(),this},g.split_image_data=function(e){var t,n,r=new Uint32Array(e.data.buffer),i=Uint32Array.from(new Set(r)),a={},o=i.length,s=new Uint32Array(r.length);for(t=0,n=0|o;(0|t)<(0|n);t=(t+1|0)>>>0)a[i[0|t]]=(0|t)>>>0;for(t=0,n=0|r.length;(0|t)<(0|n);t=(t+1|0)>>>0)s[0|t]=(0|a[r[0|t]])>>>0;return[s,i,r,o]},r=function(e,t){return new Promise((function(n){var r,i,a,o,s,u,c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),4!==i.length);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(g.split_image_data(e)),l=c[0],h=c[1],f=c[2],d=c[3],p=Date.now(),_="auto"===t,v=parseFloat(t)>0&&parseFloat(t)<1,y=parseInt(t)<0,m=_?"auto":v||y?y?Math.max(1,d+parseInt(t)):v?Math.max(1,parseFloat(t)*d):d:parseInt(t);if("auto"===m&&(m=d>255?255:d/2|0),m>=d)n([e,l,h,0,h.length,0]);else{for(r=g({pxls:l,pxl_colors:h,number_of_color:Math.min(d,m),width:e.width,height:e.height}).init().run().output("split"),i=Date.now(),o=0|(a=r[0]).length,s=r[1],u=0;(0|u)<(0|o);u=(u+1|0)>>>0)f[0|u]=(0|s[(0|a[0|u])>>>0])>>>0;n([e=new ImageData(new Uint8ClampedArray(f.buffer),e.width,e.height),a,s,d-s.length,s.length,i-p])}}))},e.exports={QuantiMatGlobal:r,QuantiMat:g}},656:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strength=t,this.tilesManager=n,this.tiles=n.getTiles(),this.width=r,this.height=i}},658:function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),r=(i=n(670))&&i.__esModule?i:{default:i},t.default=r.default.pool({minWorkers:0,maxWorkers:3})},660:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4&&a<=32;)t=e[a],e[2*a-1],e[2*a],e[2*a+1],e[4*a-1],e[4*a],e[4*a+1],i<(n=t*a*(1+.1*a))&&(i=n,o=a),a++;return r=0,e.forEach((function(e,t){r+=e*t})),{tileSize:o,certainty:Math.fround(o*e[o]/r)}}var n,r,i,a,o,s,u,c=e.width,l=e.height,h=new Uint32Array(e.data.buffer),f=64,d=new Uint32Array(f),p=new Uint32Array(f),g=0,_=new Uint32Array(2);for(n=0;n1&&g0&&g1&&g0&&g>24&255)-(t>>24&255)),u((e>>16&255)-(t>>16&255)),u((e>>8&255)-(t>>8&255))),r=Uint16Array.of(c(n[0],n[0]),c(n[1],n[1]),c(n[2],n[2]));return(0|Math.sqrt((((r[0]<<1)+r[0]|0)+(r[1]<<2)+(r[2]<<1)|0)/10))>>>0}},{key:"quantizeImageData",value:function(e,t){var n,r,i,o,u=e.getImageData(0,0,e.canvas.width,e.canvas.height),c=Date.now(),l=s.QuantiMat.split_image_data(u),h=a(l,2),f=h[0],d=h[1],p=Date.now(),g=(0,s.QuantiMat)({pxls:f,pxl_colors:d,number_of_color:Math.min(d.length,t),width:u.width,height:u.height}).init().run().output("split"),_=Date.now();for(console.log(p-c,_-p),n=g[0],r=g[1],i=new Uint32Array(n.length),o=0;oo&&(a=s,o=t[s]);return a}},{key:"_calculateElbowStrength",value:function(e,t){var n,r,a,o=e.map((function(t,n){return n/(e.length-1)})),s=Math.max.apply(Math,i(e)),u=Math.min.apply(Math,i(e)),c=e.map((function(e){return(e-u)/(s-u)})),l=[0,c[0]],h=[1,c[c.length-1]],f=[o[t],c[t]],d=Math.sqrt(Math.pow(h[0]-l[0],2)+Math.pow(h[1]-l[1],2)),p=Math.abs(((a=h)[1]-(r=l)[1])*(n=f)[0]-(a[0]-r[0])*n[1]+a[0]*r[1]-a[1]*r[0])/Math.sqrt(Math.pow(a[1]-r[1],2)+Math.pow(a[0]-r[0],2));return Math.fround(p/d)}}]),e}(),t.default=l},661:function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;n1&&void 0!==arguments[1]&&arguments[1],r=(0,i.default)(e);return n&&(t=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/gi,r.match(t).forEach((function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),3!==i.length);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.match(/\w\w/g).map((function(e){return parseInt(e,16)}))),n=t[0],i=t[1],a=t[2],o=Math.round((n+i+a)/3),s=function(e,t,n){return e=e.toString(16),t=t.toString(16),n=n.toString(16),1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n}(o,o,o);r=r.replace(e,s)}))),(0,a.default)(r)}},666:function(e,t,n){"use strict";function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,n){return function r(i,a){var o,s;try{s=(o=t[i](a)).value}catch(u){return void n(u)}if(!o.done)return Promise.resolve(s).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(s)}("next")}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){var n,r;for(n=0;na?"Process will start after "+i+" remaining job"+(i?"s":""):"Process will start immediately"),this.msgCallback(o);break;case"progress":u="Processing: "+(s=(t.progress_data||[])[0]||{}).index+"/"+s.length+" "+s.unit+".",this.msgCallback(u)}}catch(c){}}},{key:"generateRandomId",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t="";e>=6;)t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0"),e-=6;return e>0&&(t+=Math.round(16777215*Math.random()).toString(16).padStart(6,"0").slice(0,e)),t}},{key:"getHeadersJson",value:function(){return{"Content-Type":"application/json"}}},{key:"getHeadersStream",value:function(){return{accept:"text/event-stream"}}},{key:"getHeadersAll",value:function(){return{accept:"*/*"}}},{key:"getUploadUrl",value:function(e){return this.baseUrl+"/upload?upload_id="+e}},{key:"getCreateImagePathUrl",value:function(e){return this.baseUrl+"/file="+e}},{key:"handleLoadComplete",value:(u=a(regeneratorRuntime.mark((function e(t,n,r,i){var a,o,s,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=void 0===n?"blob":n,a=(t||"/unknown.webp").split("/"),o=a[a.length-1]||"unknown.png",s=o.split(".")[1]||"png",u="image/"+s,s="jpeg"===s?"jpg":s,e.prev=6,e.next=9,new Promise((function(e){var a=new Image;a.setAttribute("crossorigin","anonymous"),a.onload=function(){var t,o,s=a.naturalHeight||a.height,u=a.naturalWidth||a.width;i=i||s,r=r||u;try{switch(n.toLowerCase()){case"base64":!function(){var t=document.createElement("canvas");t.width=r,t.height=i,t.getContext("2d").drawImage(a,0,0,r,i);try{e(t.toDataURL("image/webp",.75))}catch(n){e(t.toDataURL("image/jpeg",.75))}}();break;case"blob":!function(){var t=document.createElement("canvas");t.width=r,t.height=i,t.getContext("2d").drawImage(a,0,0,r,i);try{t.toBlob(e,"image/webp",.75)}catch(n){t.toBlob(e,"image/jpeg",.75)}}();break;case"imagedata":(o=document.createElement("canvas")).width=r,o.height=i,(t=o.getContext("2d")).drawImage(a,0,0,r,i),e(t.getImageData(0,0,r,i,{colorSpace:"srgb"}))}}catch(c){}},a.setAttribute("src",t)}));case 9:c=e.sent,e.t0=n,e.next="blob"===e.t0?13:"base64"===e.t0?15:"imagedata"===e.t0?16:17;break;case 13:return l=new File([c],o,{type:u}),e.abrupt("return",Promise.resolve(l));case 15:case 16:return e.abrupt("return",Promise.resolve(c));case 17:e.next=23;break;case 19:return e.prev=19,e.t1=e.catch(6),console.error("Error creating file from URL:",e.t1),e.abrupt("return",Promise.reject());case 23:case"end":return e.stop()}}),e,this,[[6,19]])}))),function(e,t,n,r){return u.apply(this,arguments)})},{key:"uploadFile",value:(i=a(regeneratorRuntime.mark((function e(t,n){var r,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("files",t),e.next=4,fetch(this.getUploadUrl(n),{method:"POST",body:r});case 4:return i=e.sent,e.next=7,i.json();case 7:return a=e.sent,e.abrupt("return",Promise.resolve(a[0]||a));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"fetchEventSource",value:(r=a(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersAll(),method:"GET"});case 2:return n=e.sent,e.abrupt("return",Promise.resolve(n.body.getReader()));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"fetchEventSourceJSON",value:(n=a(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{headers:this.getHeadersJson(),method:"GET"});case 2:return n=e.sent,e.next=5,n.clone().text();case 5:return r=e.sent,i=r.replaceAll("event: complete\ndata: ",""),e.prev=7,e.abrupt("return",Promise.resolve(JSON.parse(i)));case 11:return e.prev=11,e.t0=e.catch(7),e.abrupt("return",Promise.reject());case 14:case"end":return e.stop()}}),e,this,[[7,11]])}))),function(e){return n.apply(this,arguments)})},{key:"readResponse",value:(t=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h,f,d,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i=!1,a=null;case 4:if(i){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,s=o.value,u=o.done,i=i||u,r+=n.decode(s||new Uint8Array,{stream:!0}),c=(r||"\n").split("\n"),l=!0,h=!1,f=void 0,e.prev=16,d=c[Symbol.iterator]();!(l=(p=d.next()).done);l=!0)g=(g=p.value).trim(),this.message(g),console.log(g),g.includes("complete")&&(i=!0,a=g);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),h=!0,f=e.t0;case 24:e.prev=24,e.prev=25,!l&&d.return&&d.return();case 27:if(e.prev=27,!h){e.next=30;break}throw f;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=c[c.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(a));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return t.apply(this,arguments)})}]),e}(),c=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-sd3-long-captioner-v2.hf.space",e))}var n,u,c;return i(t,e),s(t,[{key:"getCreateCaptionsUrl",value:function(){return this.baseUrl+"/call/create_captions_rich"}},{key:"getReadCaptions",value:function(e){try{return JSON.parse(e.slice(5))}catch(t){return""}}},{key:"readResponse",value:(c=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h,f,d,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i=!1,a=null;case 4:if(i){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,s=o.value,u=o.done,i=i||u,r+=n.decode(s||new Uint8Array,{stream:!0}),c=(r||"\n").split("\n"),l=!0,h=!1,f=void 0,e.prev=16,d=c[Symbol.iterator]();!(l=(p=d.next()).done);l=!0)g=(g=p.value).trim(),this.message(g),g.includes("complete")&&(i=!0,a=g);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),h=!0,f=e.t0;case 24:e.prev=24,e.prev=25,!l&&d.return&&d.return();case 27:if(e.prev=27,!h){e.next=30;break}throw f;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=c[c.length-1],e.next=4;break;case 35:return e.abrupt("return",i?Promise.resolve(a):Promise.reject("Error"));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return c.apply(this,arguments)})},{key:"createCaptions",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this.getCreateCaptionsUrl(),{method:"POST",headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:t}]})});case 2:return n=e.sent,e.prev=3,e.next=6,n.json();case 6:return r=e.sent,e.abrupt("return",Promise.resolve(r.event_id));case 10:return e.prev=10,e.t0=e.catch(3),e.abrupt("return",Promise.reject("Error"));case 13:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(e){return u.apply(this,arguments)})},{key:"run",value:(n=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:n=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}n=t,e.next=12;break;case 11:return e.abrupt("return",Promise.reject());case 12:return r=this.generateRandomId(),e.next=15,this.uploadFile(n,r);case 15:return i=e.sent,a=this.getCreateCaptionsUrl(),e.next=19,this.createCaptions(i);case 19:return o=e.sent,e.abrupt("return",this.fetchEventSourceJSON(a+"/"+o).then((function(e){return e[0]})).catch((function(){return""})));case 21:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(u),l=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://gokaygokay-florence-2.hf.space",e))}var n;return i(t,e),s(t,[{key:"getPredictHeader",value:function(e,t,n,r,i,a){return a=a||1,{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},1===a?"Caption":2===a?"Detailed Caption":"More Detailed Caption","","microsoft/Florence-2-large"],event_data:null,fn_index:4,trigger_id:10,session_hash:i}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readLine",value:function(e,t){var n,r,i;console.log(e),e=e.slice(5);try{return(n=JSON.parse(e)).success?(r=((n.output||{}).data||[])[0],i=1===t?r.slice(15,r.length-2):2===t?r.slice(24,r.length-2):r.slice(29,r.length-2),Promise.resolve(i.replaceAll("\\n","").replaceAll("\n",""))):Promise.reject("")}catch(a){return Promise.reject()}}},{key:"run",value:(n=a(regeneratorRuntime.mark((function e(t,n){var r,i,a,o,s,u,c,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 32:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(),e.next=15,this.uploadFile(r,i);case 15:return a=e.sent,o=this.getCreateImagePathUrl(a),s=this.getPredictHeader(a,o,r.size,r.type,i,n),e.next=20,fetch(this.getQueueJoinUrl(),s);case 20:return u=e.sent,e.next=23,u.json();case 23:if(!e.sent.event_id){e.next=32;break}return e.next=28,this.fetchEventSource(this.getResultUrl(i));case 28:return c=e.sent,e.abrupt("return",this.readResponse(c).then((function(e){return l.readLine(e,n)})).catch((function(){return Promise.reject()})));case 33:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u),h=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://kenjiedec-rembg.hf.space",e))}var n;return i(t,e),s(t,[{key:"getQueuePushUrl",value:function(){return this.baseUrl+"/api/queue/push/"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({action:"predict",data:[e,"Mask only","isnet-general-use"],fn_index:0,session_hash:t}),method:"POST"}}},{key:"getQueueStatusUrl",value:function(){return this.baseUrl+"/api/queue/status/"}},{key:"getResultHeader",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({hash:e}),method:"POST"}}},{key:"run",value:(n=a(regeneratorRuntime.mark((function e(t,n,r){var i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(regeneratorRuntime.mark((function e(o,s){var u,c,l,h,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=void 0,"string"==typeof t){e.next=7;break}return e.next=4,i.handleLoadComplete(t,"base64");case 4:u=e.sent,e.next=14;break;case 7:if(!t.startsWith("blob:")){e.next=13;break}return e.next=10,i.handleLoadComplete(t,"base64");case 10:u=e.sent,e.next=14;break;case 13:u=t;case 14:return c=i.generateRandomId(),e.next=17,fetch(i.getQueuePushUrl(),i.getPredictHeader(u,c));case 17:return e.next=19,e.sent.json();case 19:l=e.sent,h=l.hash,f=setTimeout((function(){clearInterval(d),s()}),1e4),d=setInterval(a(regeneratorRuntime.mark((function e(){var t,a,s,u,c,l,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(i.getQueueStatusUrl(),i.getResultHeader(h));case 2:return e.next=4,e.sent.json();case 4:if(t=e.sent,a=t.data||{},!(s=a.data||[]).length){e.next=18;break}return e.next=10,i.handleLoadComplete(s[0],"imagedata",n,r);case 10:for(u=e.sent,c=u.data,l=[],p=0,g=c.length;(0|p)<(0|g);p=p+4|0)(0|(c[0|p]+c[p+1|0]+c[p+2|0]|0)/3)<32&&l.push(p/4|0);o(l),clearInterval(d),clearTimeout(f);case 18:case"end":return e.stop()}}),e,i)}))),1e3);case 23:case"end":return e.stop()}}),e,i)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})}]),t}(u),f=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://pixart-alpha-pixart-sigma.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictHeader",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:512,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"(No style)",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"bad shape, disformed, photography, photo, realistic, photo-realistic.",s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"DPM-Solver",u=this.generateRandomSeed();return a="string"==typeof a?a:["(No style)","Pixel Art","Digital Art","Anime","Manga"][a],{headers:this.getHeadersJson(),body:JSON.stringify({data:["A pixel art (retro style video game palette artwork) of : "+e,o,a,!0,i,u,n,r,s,4.5,3.5,17,25,!0],event_data:null,fn_index:3,trigger_id:7,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"getResultUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h,f,d,p,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i=!1,a=null;case 4:if(i){e.next=35;break}return e.next=7,t.read();case 7:for(o=e.sent,s=o.value,u=o.done,i=i||u,r+=n.decode(s||new Uint8Array,{stream:!0}),c=(r||"\n").split("\n"),l=!0,h=!1,f=void 0,e.prev=16,d=c[Symbol.iterator]();!(l=(p=d.next()).done);l=!0)g=(g=p.value).trim(),this.message(g),g.includes("complete")&&(i=!0,a=g);e.next=24;break;case 20:e.prev=20,e.t0=e.catch(16),h=!0,f=e.t0;case 24:e.prev=24,e.prev=25,!l&&d.return&&d.return();case 27:if(e.prev=27,!h){e.next=30;break}throw f;case 30:return e.finish(27);case 31:return e.finish(24);case 32:r=c[c.length-1],e.next=4;break;case 35:return e.abrupt("return",Promise.resolve(a));case 36:case"end":return e.stop()}}),e,this,[[16,20,24,32],[25,,27,31]])}))),function(e){return u.apply(this,arguments)})},{key:"extractLastImageUrl",value:function(e,t){var n,r,i,a,o,s,u;try{for(console.log(e),n=JSON.parse(e.slice(5).trim()),r=[],i=n.output.data||[],a=0;a1&&void 0!==arguments[1]?arguments[1]:512,f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,d=this,p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,g=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"imagedata";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.generateRandomId(),r=this.getPredictHeader(t,n,h,f,p,1),i=this.getQueueJoinUrl(),e.next=5,fetch(i,r);case 5:return a=e.sent,e.next=8,a.json();case 8:if(!e.sent.event_id){e.next=27;break}return e.next=13,this.fetchEventSource(this.getResultUrl(n));case 13:return o=e.sent,e.next=16,this.readResponse(o);case 16:if(s=e.sent,1!==(u=this.extractLastImageUrl(s)).length){e.next=26;break}return c=u[0],e.next=22,this.handleLoadComplete(c,g);case 22:return l=e.sent,e.abrupt("return",Promise.resolve(l));case 26:return e.abrupt("return",Promise.allSettled([u.map((function(){return d.handleLoadComplete(i,g)}))]));case 27:return e.abrupt("return",Promise.reject());case 28:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),t}(u),d=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://abidlabs-face-to-all.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join?__theme=light"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,i,a){var o="A 2D illustration in retro game style pixel art of "+i.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. Video game, low color number, high quality."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real, CGI, 3D.",.95,null,.9,.12,7.75,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:a}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i="",a=!1;case 3:if(a){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,s=o.value,u=o.done,a=a||u,r+="".concat(n.decode(s||new Uint8Array,{stream:!0})),c=(r||"\n").split("\n"),l=0;l2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 47:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(),a=this.generateRandomId(),o=this.getPredictHeader(b,a),s=this.getPredictUrl(),e.next=18,fetch(s,o);case 18:return u=e.sent,c=u.ok,e.next=22,this.uploadFile(r,i);case 22:if(l=e.sent,h=this.getCreateImagePathUrl(l),!c||!h){e.next=47;break}return f=this.getQueueJoinHeader(l,h,r.size,r.type,n,a),d=this.getQueueJoinUrl(),e.next=29,fetch(d,f);case 29:return p=e.sent,e.next=32,p.json();case 32:if(void 0===e.sent.event_id){e.next=47;break}return g=this.getQueueDataUrl(a),e.next=38,this.fetchEventSource(g);case 38:return _=e.sent,e.next=41,this.readResponse(_);case 41:return v=e.sent,y=this.extractSecondImageUrl(v),e.next=45,this.handleLoadComplete(y);case 45:return m=e.sent,e.abrupt("return",Promise.resolve(m));case 48:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u),p=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://multimodalart-face-to-all.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,i,a){var o="A pixel art person image in lucasarts of : "+i.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, Photography, Real, Photo-realistic, Screenshot, Filters, Retro, Bad Quality, Worst settings.",.9,null,.85,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:a}),method:"POST"}}},{key:"getUselessBullshit",value:function(e){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[null,null],event_data:null,fn_index:5,trigger_id:18,session_hash:e}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i="",a=!1;case 3:if(a){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,s=o.value,u=o.done,a=a||u,r+="".concat(n.decode(s||new Uint8Array,{stream:!0})),c=(r||"\n").split("\n"),l=0;l2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 57:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(8),a=this.generateRandomId(11),o=this.getPredictHeader(w,a),s=this.getPredictUrl(),e.next=18,fetch(s,o);case 18:return u=e.sent,c=u.ok,e.next=22,this.uploadFile(r,i);case 22:if(l=e.sent,h=this.getCreateImagePathUrl(l),!c||!h){e.next=57;break}return f=this.getQueueJoinHeader(l,h,r.size,r.type,n,a),d=this.getQueueJoinUrl(),e.next=29,fetch(d,f);case 29:if(!(p=e.sent).ok){e.next=57;break}return e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=57;break}return g=this.getQueueDataUrl(a),e.next=40,fetch(g,this.getUselessBullshit(a));case 40:if(!(_=e.sent).ok){e.next=57;break}return e.next=44,_.json();case 44:if(!e.sent.event_id){e.next=57;break}return e.next=48,this.fetchEventSource(g);case 48:return v=e.sent,e.next=51,this.readResponse(v);case 51:return y=e.sent,m=this.extractSecondImageUrl(y),e.next=55,this.handleLoadComplete(m);case 55:return b=e.sent,e.abrupt("return",Promise.resolve(b));case 58:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u),g=function(e){function t(e){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"https://neil-ni-face-to-all.hf.space",e))}var n,u;return i(t,e),s(t,[{key:"getPredictUrl",value:function(){return this.baseUrl+"/run/predict"}},{key:"getPredictHeader",value:function(e,t){return{headers:this.getHeadersJson(),body:JSON.stringify({data:[e],event_data:null,fn_index:0,trigger_id:11,session_hash:t}),method:"POST"}}},{key:"getQueueJoinUrl",value:function(){return this.baseUrl+"/queue/join"}},{key:"extractSecondImageUrl",value:function(e){var t=e.match(/"url":"(https:\/\/[^"]+)"/g);return t&&t.length>1?t[1].match(/"url":"(https:\/\/[^"]+)"/)[1]:null}},{key:"getQueueJoinHeader",value:function(e,t,n,r,i,a){var o="A pixel art person image in lucasarts of : "+i.replaceAll("\\n","").replaceAll("\\","")+' in lucasarts style. High fidelity, high quality, truthful."';return{headers:this.getHeadersJson(),body:JSON.stringify({data:[{path:e,url:t,orig_name:"image."+r.replaceAll("image/",""),size:n,mime_type:r,meta:{_type:"gradio.FileData"}},o,"Realistic, photography, real.",.95,null,.9,.17,7.5,.8,null,null],event_data:null,fn_index:6,trigger_id:18,session_hash:a}),method:"POST"}}},{key:"getQueueDataUrl",value:function(e){return this.baseUrl+"/queue/data?session_hash="+e}},{key:"readResponse",value:(u=a(regeneratorRuntime.mark((function e(t){var n,r,i,a,o,s,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new TextDecoder("utf-8"),r="",i="",a=!1;case 3:if(a){e.next=16;break}return e.next=6,t.read();case 6:for(o=e.sent,s=o.value,u=o.done,a=a||u,r+="".concat(n.decode(s||new Uint8Array,{stream:!0})),c=(r||"\n").split("\n"),l=0;l2&&void 0!==arguments[2]?arguments[2]:"https://civitai.com/models/247890/lucasarts-adventure-game-style-xl";return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,"string"!=typeof t){e.next=7;break}return e.next=4,this.handleLoadComplete(t);case 4:r=e.sent,e.next=12;break;case 7:if(!(t instanceof Blob)){e.next=11;break}r=t,e.next=12;break;case 11:case 49:return e.abrupt("return",Promise.reject());case 12:return i=this.generateRandomId(),a=this.generateRandomId(),o=this.getPredictHeader(b,a),s=this.getPredictUrl(),e.next=18,fetch(s,o);case 18:return u=e.sent,e.next=21,u.json();case 21:return c=e.sent,e.next=24,this.uploadFile(r,i);case 24:if(l=e.sent,h=this.getCreateImagePathUrl(l),!c||!h){e.next=49;break}return f=this.getQueueJoinHeader(l,h,r.size,r.type,n,a),d=this.getQueueJoinUrl(),e.next=31,fetch(d,f);case 31:return p=e.sent,e.next=34,p.json();case 34:if(void 0===e.sent.event_id){e.next=49;break}return g=this.getQueueDataUrl(a),e.next=40,this.fetchEventSource(g);case 40:return _=e.sent,e.next=43,this.readResponse(_);case 43:return v=e.sent,y=this.extractSecondImageUrl(v),e.next=47,this.handleLoadComplete(y);case 47:return m=e.sent,e.abrupt("return",Promise.resolve(m));case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}(u);e.exports={HuggingFaceAPI:u,FaceToAllAPI:d,FaceToAllAPI2:p,FaceToAllAPI3:g,FloranceCaptionerAPI:l,LongCaptionerAPI:c,RemoveBackgroundAPI:h,ImageCreatorAPI:f}},667:function(e,t,n){"use strict";var r=n(668);e.exports={createLocalBlob:function(e){var t,n,i,a,o=(e.match(/(data\:([a-z]+\/[a-z\+]+)\;base64\,)([a-zA-Z0-9\/\+]+\(\=+)?/)||[,,])[1];return o?(n=(t=o.match(/data\:([a-z]+\/[a-z\+]+)\;base64\,/)[1]).match(/[a-z]+\/([a-z\+]+)/)[1],e=e.replace(o,""),i=(0,r.base64ToBytes)(e),a=new File([i],"name."+n,{type:t}),URL.createObjectURL(a)):""}}},668:function(e,t,n){"use strict";var r=new(n(265).B64chromium);e.exports={bytesToBase64:r.bytesToBase64.bind(r),base64ToBytes:r.base64ToBytes.bind(r)}},675:function(e,t,n){"use strict";var r,i=n(676),a=Object.getPrototypeOf((r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e,this)})),function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(i,a){var o,s;try{s=(o=e[i](a)).value}catch(u){return void n(u)}if(!o.done)return Promise.resolve(s).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(s)}("next")}))})).constructor,o=Object.getPrototypeOf((function(){})).constructor,s=new o('var t = function(file) {\n "use strict";\n \n try {\n \n return new Promise(function(resolve, _) {\n resolve(new FileReaderSync().readAsDataURL(file));\n });\n \n } catch(error) {\n \n return new Promise(function(resolve, _) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(file);\n });\n }\n \n}; return t;')(),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(s,[e]).catch((function(t){return s(e)})).timeout(5e3).then((function(e){t(e)})):s(e).then((function(e){t(e)}))},c=new a('var t = async function(base64) {\n\n "use strict";\n\n return fetch(base64).then(function(res) {\n\n return res.blob().then(function(blb){\n\n return createImageBitmap(blb, {\n resizeQuality: "pixelated",\n premultiplyAlpha: \'premultiply\'\n });\n });\n });\n\n}; return t;')(),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!==n?n.exec(c,[e]).catch((function(t){return c(e)})).timeout(5e3).then((function(e){t(e)})):c(e).then((function(e){t(e)}))},h=function(e){for(var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2073600,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=1;Math.round(e.width*a)*Math.round(e.height*a)>r;)a-=.01;try{createImageBitmap(e,0,0,e.width,e.height,{resizeWidth:Math.round(e.width*a),resizeHeight:Math.round(e.height*a),resizeQuality:"pixelated",premultiplyAlpha:"premultiply"}).then((function(e){var t,n=void 0;try{n=new OffscreenCanvas(e.width,e.height)}catch(r){(n=document.createElement("canvas")).width=e.width,n.height=e.height}(t=n.getContext("2d")).imageSmoothingEnabled=!1,t.drawImage(e,0,0,e.width,e.height),i(t.getImageData(0,0,e.width,e.height))}))}catch(o){t=void 0;try{t=new OffscreenCanvas(Math.round(e.width*a),Math.round(e.height*a))}catch(s){(t=document.createElement("canvas")).width=Math.round(e.width*a),t.height=Math.round(e.height*a)}(n=t.getContext("2d")).imageSmoothingEnabled=!1,n.drawImage(e,0,0,t.width,t.height),i(n.getImageData(0,0,t.width,t.height))}},f=new o('var t = function(imagedata, type) {\n\n "use strict"\n type = type || "image/png";\n var quality = type.includes("webp") ? 1: type.includes("png") ? undefined: 0.7;\n try {\n \n return new Promise(function(resolve, _) {\n\n createImageBitmap(imagedata, 0, 0, imagedata.width, imagedata.height, {\n premultiplyAlpha: \'premultiply\',\n resizeQuality: \'pixelated\'\n }).then((bmp) => {\n \n var canvas;\n canvas = new OffscreenCanvas(imagedata.width, imagedata.height);\n var ctx = canvas.getContext("bitmaprenderer");\n ctx.imageSmoothingEnabled = false;\n ctx.transferFromImageBitmap(bmp);\n \n canvas.convertToBlob({type: type, quality: quality}).then((blb) => {\n try {\n resolve(new FileReaderSync().readAsDataURL(blb));\n } catch(e2) {\n var reader = new FileReader();\n reader.onload = function(){ resolve(reader.result)};\n reader.readAsDataURL(blb);\n }\n });\n });\n });\n \n }catch (e) {\n \n return new Promise(function(resolve, _) {\n var canvas = document.createElement("canvas");\n canvas.width = imagedata.width;\n canvas.height = imagedata.height;\n var ctx = canvas.getContext("2d");\n ctx.imageSmoothingEnabled = false;\n ctx.putImageData(imagedata, 0, 0);\n \n var base64 = canvas.toDataURL(type, quality);\n canvas = null;\n resolve(base64);\n });\n }\n\n}; return t;')();e.exports={file_to_imagedata_resized:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Date.now(),e.type,"image/jpg"!==e.type&&e.type,e.type,u(e,(function(e){l(e,(function(e){h(e,t,(function(e){n(e)}),r)}),r)}),r)},file_to_base64:u,base64_to_bitmap:l,bitmap_to_imagedata:h,imagedata_to_base64:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null!==r?r.exec(f,[e,t]).catch((function(n){return f(e,t)})).timeout(5e3).then((function(e){n(e)})):f(e,t).then((function(e){n(e)}))},base64_sanitize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};(function(e,t,n){return n=n||"pixelize",new Promise((function(r,a){var o=new Image,s=e.startsWith("data:image/png;");o.onload=function(){var e,a,u=o.naturalWidth*t,c=o.naturalHeight*t,l=function(e,t,n,r){var a,o,s,u,c=void 0;if("pixelize"===r||"normal"===r){a=void 0,o=void 0;try{a=new OffscreenCanvas(e.width,e.height),o=new OffscreenCanvas(t,n)}catch(l){a=document.createElement("canvas"),o=document.createElement("canvas"),a.width=e.width,a.height=e.height,o.width=t,o.height=n}s=a.getContext("2d"),u=o.getContext("2d"),s.imageSmoothingEnabled=!("normal"!==r),u.imageSmoothingEnabled=!("normal"!==r),s.drawImage(e,0,0,e.width,e.height),u.drawImage(a,0,0,a.width,a.height,0,0,o.width,o.height),c=u}else"doppel"===r&&(c=i.scaler.processImage(e,t,n));return c}(o,0|u,0|c,n);try{e=l.getImageData(0,0,l.canvas.width,l.canvas.height),createImageBitmap(e).then((function(e){var t,n;try{t=new OffscreenCanvas(e.width,e.height)}catch(i){(t=document.createElement("canvas")).height=e.height,t.width=e.width}(n=t.getContext("bitmaprenderer")).imageSmoothingEnabled=!1,n.transferFromImageBitmap(e),t.convertToBlob({type:s?"image/png":"image/jpeg"}).then((function(e){try{r((new FileReaderSync).readAsDataURL(e))}catch(n){var t=new FileReader;t.onload=function(){r(t.result)},t.readAsDataURL(e)}}))}))}catch(h){a=l.canvas,r(a.toDataURL(s?"image/png":"image/jpeg"))}},o.onerror=function(){a()},o.src=e}))})(e,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,arguments[4]).then((function(e){t(e)}))},file_to_bitmap:function(e,t){createImageBitmap(e).then(t)}}},676:function(e,t,n){"use strict";var r,i=(r=n(677))&&r.__esModule?r:{default:r},a=new i.default({strength:1,overlapFactor:1,despeckleStrength:.88});e.exports={scaler:a,ImageProcessor:i.default}},677:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i,a,o,s,u,c,l,h,f,d,p,g;Object.defineProperty(t,"__esModule",{value:!0}),i=function(){function e(e,t){var n,r;for(n=0;n=this.finalWidth||o>=this.finalHeight||s.push(this.tiles[a+o*this.finalWidth]);return s}},{key:"paintTiles",value:function(){this.imageData.data.set(this.tilesColorUint8a),this.contextDestination.putImageData(this.imageData,0,0)}}]),e}(),t.default=o},679:function(e,t,n){"use strict";var r,i,a,o,s,u,c;Object.defineProperty(t,"__esModule",{value:!0}),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){var n,r;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.imageData=t,this.meanColor=new o.default(n),this.coordinates=Uint16Array.of(i,a),r=this.imageData.data.length,this.k=r>=64?6:r>=16?4:r>=9?3:r>=2?2:1}return i(e,[{key:"quantizeColors",value:function(){var e,t=s.QuantiMat.split_image_data(this.imageData),n=r(t,2),i=n[0],a=n[1],o=(0,s.QuantiMat)({pxls:i,pxl_colors:a,number_of_color:Math.min(a.length,this.k),width:this.imageData.width,height:this.imageData.height}).init().run().output("split"),u=o[0],c=o[1],l=u<255?new Uint8Array(c.length):new Uint16Array(c.length);for(e=0;e=o-2&&(u.forEach((function(e){e.meanColor.setRGBA(n.meanColor.rgba);var t=e.x+e.y*r.width;i[t]=!0})),i[c]=!0)},n=0;n0&&i<60&&p.setRGBA(r.rgba);break;case"EDGE":a=new c.default(b[0].data),o=new c.default(b[1].data),u=s.default.colorDifference(a,o),l=s.default.colorDifference(a,p),f=s.default.colorDifference(o,p),5*Math.abs(l-f)>=u&&(d=new c.default(new h.default(_.map((function(e){return e.meanColor.rgba})),4).run(4).centroidsSorted[0].data),p.setRGBA(d.rgba))}}},{key:"determineClassification",value:function(e,t){return e[0].count>=.75*t?"AREA":Math.abs(e[0].count-e[1].count)*Math.abs(e[2].count-e[3].count)<25?"SHAPE":Math.abs(e[0].count-e[1].count)<.75*Math.abs(e[1].count-e[2].count)?"EDGE":"COMPLEX"}}]),t}(a.default),t.default=f},683:function(e,t,n){"use strict";var r,i,a;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var n,r;for(n=0;nt&&(t=a,n=i)})),n}},{key:"distance",value:function(e,t){return this.c1.set_from_array(e),this.c2.set_from_array(t),16192*this.c1.fast_match_with(this.c2)|0}},{key:"reassignCentroids",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:16,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(this.initializeCentroids(),e=0,t=!1,n=void 0,r=function(){var r=o.centroids.map((function(e){return Uint32Array.from(e)}));o.assignClusters(),n=o.updateCentroids(),e++,t=o.centroids.every((function(e,t){return o.distance(e,r[t])<2})),u&&!t&&o.reassignCentroids(n)};!t&&e1&&void 0!==arguments[1]?arguments[1]:"COMPRESS_OBJECT";return new Promise((function(n,r){"COMPRESS_OBJECT"===t?n(new Uint8ClampedArray(i.default.compress(a.default.pack(e)).buffer)):"DECOMPRESS_UINT8A"===t&&n(a.default.unpack(i.default.uncompress(e)))}))}}},826:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(n(658)),a=r(n(153)),o=r(n(827));e.exports={base64png_to_xbrz_svg:function(e,t,r,s){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"xbrz",l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],h=arguments.length>7&&void 0!==arguments[7]&&arguments[7],f=arguments.length>8&&void 0!==arguments[8]&&arguments[8],d=new Image;d.onload=function(){var e,p,g,_,v,y,m,b,w,x,k=document.createElement("canvas"),P=k.getContext("2d"),O=d.width,j=d.height;k.width=O,k.height=j,P.drawImage(d,0,0,O,j),e=P.getImageData(0,0,O,j),p=function(e,t){return new Promise((function(t,r){(0,a.default)((function(){return n.e(2).then(n.t.bind(null,720,7))})).then((function(n){(0,n.crt)(e,1).then(t).catch(r)}))}))},g=function(e,t,r,o,s){l?(0,a.default)((function(){return n.e(6).then(n.t.bind(null,719,7))})).then((function(u){(0,u.oxi_png)(e,3,!1,i.default).then((function(e){s(e,t,r,o)})).catch((function(){(0,a.default)((function(){return n.e(0).then(n.t.bind(null,657,7))})).then((function(n){(0,n.png_quant)(e,100,100,1,i.default).then((function(e){s(e,t,r,o)})).catch((function(){s(e,t,r,o)}))})).catch((function(){s(e,t,r,o)}))}))})).catch((function(){s(e,t,r,o)})):s(e,t,r,o)},_=function(e,t){h?(0,a.default)((function(){return n.e(23).then(n.t.bind(null,941,7))})).then((function(o){(0,o.image_tracer)(e,{pal:u.map((function(e){return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)}})),corsenabled:!1,ltres:t,qtres:t,pathomit:t,rightangleenhance:!1,colorsampling:2,numberofcolors:512,mincolorratio:0,colorquantcycles:1,layering:0,strokewidth:Math.ceil(t/2),linefilter:!0,scale:1,roundcoords:2,viewbox:!0,desc:!1,lcpr:0,qcpr:0,blurradius:t,blurdelta:4*t},i.default).then((function(e){l?(0,a.default)((function(){return n.e(1).then(n.bind(null,689))})).then((function(n){var i=n.optimize;e=i(e,{path:"path-to.svg",multipass:!0,mergePaths:!0,mergeStyles:!0,collapseGroups:!0,reusePaths:!0,plugin:["multipass","mergePaths","collapseGroups","reusePaths","mergeStyles"]}).data,r("data:image/svg+xml;base64,"+window.btoa(e),t)})):r("data:image/svg+xml;base64,"+window.btoa(e),t)}))})):r("",0)},"depixelize"===c?(y=(v=(0,o.default)(e,h))[0],m=v[1],(b=document.createElement("canvas")).width=y.width,b.height=y.height,(w=b.getContext("2d")).putImageData(y,0,0),x=w.canvas.toDataURL("image/png"),f&&p(y).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,10,e.width,e.height,s)})),h&&(l?(0,a.default)((function(){return n.e(1).then(n.bind(null,689))})).then((function(e){var t=e.optimize;m=t(m,{path:"path-to.svg",multipass:!0,plugin:["mergePaths"]}).data,r("data:image/svg+xml;base64,"+window.btoa(m),10)})):r("data:image/svg+xml;base64,"+window.btoa(m),10)),g(x,10,y.width,y.height,t)):"omniscale"===c?(0,a.default)((function(){return n.e(24).then(n.t.bind(null,942,7))})).then((function(n){(0,n.omniscale)(e,8,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,8,e.width,e.height,s)})),_(e,8),g(r,8,e.width,e.height,t)}))})):"hexagon"===c?(0,a.default)((function(){return n.e(5).then(n.t.bind(null,721,7))})).then((function(n){(0,n.hexagonrender)(e,16).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,16,e.width,e.height,s)})),_(e,32/6),g(r,32,e.width,e.height,t)}))})):"kikko"===c?(0,a.default)((function(){return n.e(41).then(n.t.bind(null,943,7))})).then((function(n){(0,n.kikkorender)(e,24,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,24,e.width,e.height,s)})),_(e,6),g(r,48,e.width,e.height,t)}))})):"hqnx"===c?(0,a.default)((function(){return n.e(22).then(n.t.bind(null,944,7))})).then((function(n){(0,n.hqnx)(e,4,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,4,e.width,e.height,s)})),_(e,4),g(r,4,e.width,e.height,t)}))})):"epx"===c?(0,a.default)((function(){return n.e(21).then(n.t.bind(null,945,7))})).then((function(n){(0,n.epx)(e,4,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,4,e.width,e.height,s)})),_(e,4),g(r,4,e.width,e.height,t)}))})):(0,a.default)((function(){return n.e(3).then(n.t.bind(null,722,7))})).then((function(n){n.default(e,6,i.default).then((function(e){var n,r,i=document.createElement("canvas");i.width=e.width,i.height=e.height,(n=i.getContext("2d")).putImageData(e,0,0),r=n.canvas.toDataURL("image/png"),f&&p(e).then((function(e){var t,n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),t=n.toDataURL("image/png"),g(t,6,e.width,e.height,s)})),_(e,6),g(r,6,e.width,e.height,t)}))}))},d.src=e}}},827:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==y(Symbol.iterator)?function(e){return void 0===e?"undefined":y(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":y(e)},r(e)}function i(){function e(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,n,r){var i=t&&t.prototype instanceof a?t:a,o=Object.create(i.prototype),s=new p(r||[]);return b(o,"_invoke",{value:l(e,n,s)}),o}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}function a(){}function o(){}function s(){}function u(t){["next","throw","return"].forEach((function(n){e(t,n,(function(e){return this._invoke(n,e)}))}))}function c(e,t){function i(a,o,s,u){var c,l,h=n(e[a],e,o);if("throw"!==h.type)return(l=(c=h.arg).value)&&"object"==r(l)&&m.call(l,"__await")?t.resolve(l.__await).then((function(e){i("next",e,s,u)}),(function(e){i("throw",e,s,u)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,u)}));u(h.arg)}var a;b(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function l(e,t,r){var i="suspendedStart";return function(a,o){var s,u,c;if("executing"===i)throw Error("Generator is already running");if("completed"===i){if("throw"===a)throw o;return{value:void 0,done:!0}}for(r.method=a,r.arg=o;;){if((s=r.delegate)&&(u=h(s,r))){if(u===O)continue;return u}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);if(i="executing","normal"===(c=n(e,t,r)).type){if(i=r.done?"completed":"suspendedYield",c.arg===O)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i="completed",r.method="throw",r.arg=c.arg)}}}function h(e,t){var r,i,a=t.method,o=e.iterator[a];return void 0===o?(t.delegate=null,"throw"===a&&e.iterator.return&&(t.method="return",t.arg=void 0,h(e,t),"throw"===t.method)||"return"!==a&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+a+"' method")),O):"throw"===(r=n(o,e.iterator,t.arg)).type?(t.method="throw",t.arg=r.arg,t.delegate=null,O):(i=r.arg)?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,O):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function d(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function p(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function g(e){var t,n,r;if(e){if(t=e[x])return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(r=function t(){for(;++n=0;--r){if(i=this.tryEntries[r],a=i.completion,"root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev)if(o=m.call(i,"catchLoc"),s=m.call(i,"finallyLoc"),o&&s){if(this.prev=0;--n)if((r=this.tryEntries[n]).tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev=0;--t)if((n=this.tryEntries[t]).finallyLoc===e)return this.complete(n.completion,n.afterLoc),d(n),O},catch:function(e){var t,n,r,i;for(t=this.tryEntries.length-1;t>=0;--t)if((n=this.tryEntries[t]).tryLoc===e)return"throw"===(r=n.completion).type&&(i=r.arg,d(n)),i;throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:g(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),O}},v}function a(e,t){var n,r,i,a,o,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!s){if(Array.isArray(e)||(s=f(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),n=0,{s:r=function(){},n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return i=!0,a=!1,{s:function(){s=s.call(e)},n:function(){var e=s.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==s.return||s.return()}finally{if(a)throw o}}}}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){function n(){return s(e,arguments,l(this).constructor)}if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},o(e)}function s(e,t,n){return s=u()?Reflect.construct.bind():function(e,t,n){var r,i=[null];return i.push.apply(i,t),r=new(Function.bind.apply(e,i)),n&&c(r,n.prototype),r},s.apply(null,arguments)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i,a,o,s,u,c=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=c){o=[],s=!0,u=!1;try{if(i=(c=c.call(e)).next,0===t){if(Object(c)!==c)return;s=!1}else for(;!(s=(n=i.call(c)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(l){u=!0,r=l}finally{try{if(!s&&null!=c.return&&(a=c.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=1}},{key:"toString",value:function(){return"rgb("+this.rgb.join()+")"}}]),e}(),k=function(){function e(t,n){p(this,e),this.x=t,this.y=n,this.edges=[]}return _(e,[{key:"split",value:function(t){return new e((this.x+t.x)/2,(this.y+t.y)/2)}},{key:"adjust",value:function(e,t){return this.x+=e,this.y+=t,this}},{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"addEdge",value:function(e){-1==this.edges.indexOf(e)&&(this.edges.push(e),e.addEdge(this))}}]),e}(),P=function(e){function t(e){var n;return p(this,t),(n=o.call(this,1))[0]=e,n.circular=!1,n}!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e);var n,i,o=(n=t,i=u(),function(){var e,t,a=l(n);return i?(t=l(this).constructor,e=Reflect.construct(a,arguments,t)):e=a.apply(this,arguments),function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});return _(t,[{key:"splitAt",value:function(e){var n,r,i,o,s;if(1!==this.length){if(this[0]===e)this.shift();else if(this[this.length-1]===e)this.pop();else if(this.circular)for(n=this.shift();n!==e;n=this.shift())this.push(n);else{r=this.indexOf(e),o=a(i=this.slice(r+1));try{for(o.s();!(s=o.n()).done;)s.value.curve=i}catch(u){o.e(u)}finally{o.f()}this.length=r}e.curve=new t(e)}}},{key:"merge",value:function(e){var t,n,r,i,a,o;if(this!==e)for(n=(t=h([this,e].sort((function(e,t){return e.length-t.length})),2))[0],-1!==(r=t[1])[0].edges.indexOf(n[0])?(i=this.shift,a=this.unshift):-1!==r[0].edges.indexOf(n[n.length-1])?(i=this.pop,a=this.unshift):-1!==r[r.length-1].edges.indexOf(n[0])?(i=this.shift,a=this.push):-1!==r[r.length-1].edges.indexOf(n[n.length-1])&&(i=this.pop,a=this.push);n.length;)o=i.call(n),a.call(r,o),o.curve=r;else this.circular=e.length>2}}],[{key:"curve",value:function(e,t){return e.curve===t.curve?e.curve.length:0}}]),t}(o(Array)),O=function(){function e(t,n,r,i){p(this,e),this.x=t,this.y=n,this.edges=[,,,,,,,,],this.vertices=i||[],this.color=r,this.marked=!1,this.curve=new P(this)}return _(e,[{key:"relativePosition",value:function(e){var t=e.x,n=e.y-this.y;return(t-this.x+3*n+8)%9}},{key:"invalidCurve",value:function(){return this.valence()>2&&this.curve.length>1}},{key:"updateCurves",value:function(){this.valence()>2&&this.curve.splitAt(this)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"removeEdge",value:function(t){e.removeEdge(this,t)}},{key:"canReach",value:function(e){return e&&!!this.edges[this.relativePosition(e)]}},{key:"valence",value:function(){return this.edges.filter((function(e){return e})).length}},{key:"toString",value:function(){return"("+[this.x,this.y].join()+") => "+this.edges.filter((function(e){return e})).map((function(e){return"("+[e.x,e.y].join()+")"})).join()}},{key:"edge",value:function(e,t){return this.edges[(e+3*t+8)%9]}},{key:"right",value:function(){return this.edges[0]}},{key:"left",value:function(){return this.edges[7]}},{key:"up",value:function(){return this.edges[5]}},{key:"down",value:function(){return this.edges[2]}},{key:"isEdge",value:function(){return this.edges.filter((function(e){return e})).length<4}},{key:"follow",value:i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this;case 1:if(!(n.canReach(t)&&n.valence()<3)){e.next=14;break}return e.next=4,t;case 4:if(!(t.valence()>2)){e.next=6;break}return e.abrupt("break",14);case 6:if(r=t.edges.filter((function(e){return e})),a=r[0]!=n?r[0]:r[1],n=t,(t=a)!=this){e.next=12;break}return e.abrupt("break",14);case 12:e.next=1;break;case 14:case"end":return e.stop()}}),e,this)}))},{key:"square",value:function(){var e=h(this.edges,3),t=e[0],n=e[2],r=t&&n&&t.down()&&n.right();return[this,t,n,r].filter((function(e){return e}))}}],[{key:"addSimilarEdge",value:function(e,t){e.color&&t.color&&!e.color.dissimilar(t.color)&&(e.edges[e.relativePosition(t)]=t,t.edges[t.relativePosition(e)]=e,e.valence()>2&&e.curve.splitAt(e),t.valence()>2&&t.curve.splitAt(t),e.valence()<3&&t.valence()<3&&e.curve.merge(t.curve))}},{key:"removeEdge",value:function(e,t){e.edges[e.relativePosition(t)]=void 0,t.edges[t.relativePosition(e)]=void 0}}]),e}(),j=function(){function e(t,n,r){if(p(this,e),t.length!=n*r*4)throw Error("Wrong dimension of pixel buffer");this.width=n,this.height=r,this.pixels=t}return _(e,[{key:"create",value:i().mark((function e(){var t,n,r,a,o,s,u,c,l,h,f,d,p,g,_;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=this.width,n=this.height,r=Array(n),(a=Array(n+1))[0]=Array(t+1),o=0;o0;)o=i.pop(),-1==a.indexOf(o)&&o.x>e&&o.xn&&o.y0?i[0]+=s:i[1]-=s,(u=a[0].length-a[1].length)>0?i[1]+=u:i[0]-=u,(c=r.map((function(e){return 1==e[0].valence()||1==e[1].valence()})))[0]&&!c[1]?i[0]+=5:!c[0]&&c[1]&&(i[1]+=5),i[0]>i[1]?O.removeEdge(r[1][0],r[1][1]):i[0]')}}catch(_){p=!0,g=_}finally{try{!d&&n.return&&n.return()}finally{if(p)throw g}}return''+f.join("\n\t")+""}(i,t),r},t.default=b},828:function(e,t,n){"use strict";var r=n(829);e.exports={loadJSON:function(e,t){var n=new XMLHttpRequest;try{n=new XMLHttpRequest}catch(r){try{n=new ActiveXObject("Msxml2.XMLHTTP")}catch(r){try{n=new ActiveXObject("Microsoft.XMLHTTP")}catch(r){t("Cannot load data",null)}}}n.open("GET",e,!0),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)try{var e=JSON.parse(n.responseText);t(null,e)}catch(r){t("Cannot understand response from network.",null)}else 4==n.readyState&&404==n.status&&t("Error 404",null)};try{n.send()}catch(r){t("Failed to fetch",null)}},postJSON:function(e,t,n){var i,a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/x-www-form-urlencoded",s=new Headers;s.append("Content-Type",o),i="multipart/form-data"===o?new FormData:new URLSearchParams,Object.entries(t).forEach((function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n,r,i=[],a=!0,o=!1,s=void 0;try{for(n=e[Symbol.iterator]();!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(u){o=!0,s=u}finally{try{!a&&n.return&&n.return()}finally{if(o)throw s}}return i}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e),n=t[0],r=t[1];i.append(n,r)})),a={method:"POST",redirect:"follow",headers:s,body:"application/text"===o?t:"application/json"===o?(0,r.clean_json_text)(JSON.stringify(t)):i},fetch(e,a).then((function(e){return e.text()})).then((function(e){return n(null,e)})).catch((function(e){return n(e,null)}))},postDATA:function(e,t,n){var r=new XMLHttpRequest;try{r=new XMLHttpRequest}catch(i){try{r=new ActiveXObject("Msxml2.XMLHTTP")}catch(i){try{r=new ActiveXObject("Microsoft.XMLHTTP")}catch(i){return void n("Cannot load data",null)}}}r.open("POST",e,!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.onreadystatechange=function(){if(4==r.readyState&&200==r.status)try{var e=JSON.parse(r.responseText);n(null,e)}catch(i){n("Cannot understand response from network.",null)}else 4==r.readyState&&404==r.status&&n("Error 404",null)};try{r.send(t)}catch(i){n("Failed to post",null)}}}},829:function(e,t,n){"use strict";e.exports={clean_json_text:function(e){return(e=e.replace(/\\n/g,"\\n").replace(/\\'/g,"\\'").replace(/\\"/g,'\\"').replace(/\\&/g,"\\&").replace(/\\r/g,"\\r").replace(/\\t/g,"\\t").replace(/\\b/g,"\\b").replace(/\\f/g,"\\f")).replace(/[\u0000-\u0019]+/g,"")}}}}]); \ No newline at end of file diff --git a/client/chunk_15.min.js b/client/chunk_15.min.js index 1552aaeb..703e5e3c 100644 --- a/client/chunk_15.min.js +++ b/client/chunk_15.min.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{687:function(e,t,i){"use strict";var n=new Int32Array(15),r={_get_init_state:function(e,t,i,n,r,a){return{canvas_event_target:"CANVAS_WRAPPER_OVERFLOW",canvas_container:{top:0,left:0,height:0,width:0},sizes:{width:0|e,height:0|t},screen_zoom_ratio:1,canvas_wrapper:{padding:0|n,border_width:0|r},scale:{default:i,current:i,move_x:0,move_y:0,moves_speeds:[],move_speed_timestamp:0|Date.now(),moves_speed_average_now:16},device_pixel_ratio:window.devicePixelRatio,perspective:a}},_get_screen_zoom_ratio:function(e){return e.canvas_container.width>e.canvas_container.height?(e.canvas_container.height-e.canvas_wrapper.padding/e.device_pixel_ratio*2)/e.sizes.height:(e.canvas_container.width-e.canvas_wrapper.padding/e.device_pixel_ratio*2)/e.sizes.width},_get_pos:function(e,t,i){return n[0]=2*Math.round(e.canvas_wrapper.padding/e.device_pixel_ratio*e.scale.current+e.canvas_wrapper.border_width)|0,n[1]=Math.round(e.sizes.width*t*e.scale.current)+n[0]|0,n[2]=Math.round(e.sizes.height*t*e.scale.current)+n[0]|0,n[3]=0|e.scale.move_x,n[4]=0|e.scale.move_y,n[5]=e.canvas_container.left+n[3]|0,n[6]=e.canvas_container.top+n[4]|0,n[7]=n[5]+n[1]|0,n[8]=n[6]+n[2]|0,n[9]=n[0]/2|0,n[10]=n[0]/2|0,n[11]=n[5]+n[9]|0,n[12]=n[6]+n[10]|0,n[13]=n[7]-n[0]/2|0,n[14]=n[8]-n[0]/2|0,void 0===i&&(i={}),void 0===i.canvas&&(i.canvas={}),i.canvas.offset_left=n[9],i.canvas.offset_top=n[10],i.canvas.left=n[11],i.canvas.top=n[12],i.canvas.right=n[13],i.canvas.bottom=n[14],i.canvas.width=n[13]-n[11]|0,i.canvas.height=n[14]-n[12]|0,void 0===i.canvas_wrapper&&(i.canvas_wrapper={}),i.canvas_wrapper.offset_left=n[3],i.canvas_wrapper.offset_top=n[4],i.canvas_wrapper.left=n[5],i.canvas_wrapper.top=n[6],i.canvas_wrapper.right=n[7],i.canvas_wrapper.bottom=n[8],i.canvas_wrapper.width=n[7]-n[5]|0,i.canvas_wrapper.height=n[8]-n[6]|0,void 0===i.canvas_container&&(i.canvas_container={}),i.canvas_container.offset_left=0|e.canvas_container.left,i.canvas_container.offset_top=0|e.canvas_container.top,i.canvas_container.left=0|e.canvas_container.left,i.canvas_container.top=0|e.canvas_container.top,i.canvas_container.right=e.canvas_container.left+e.canvas_container.width|0,i.canvas_container.bottom=e.canvas_container.top+e.canvas_container.height|0,i.canvas_container.width=0|e.canvas_container.width,i.canvas_container.height=0|e.canvas_container.height,i},_get_init_pointer_state:function(){return{event_button:null,mouse_down:!1,pointer_events:new Map,previous_single_pointer_down_timestamp:0,previous_double_pointer_down_timestamp:0,latest_pointers_distance:0,latest_pointers_client_x_center:0,latest_pointers_client_y_center:0,previous_double_pointer_move_timestamp:0}},_copy_event:function(e){return{pointerId:0|e.pointerId,clientX:0|e.clientX,clientY:0|e.clientY,pageX:0|e.pageX,pageY:0|e.pageY,button:0|e.button}},_get_shadows:function(e){function t(t){var a=r(i(e)),o=n(Uint8ClampedArray.of(a[0],a[1],a[2],parseInt(142.8))),s=n(Uint8ClampedArray.of(a[0],a[1],a[2],parseInt(91.8))),_=n(Uint8ClampedArray.of(a[0],a[1],a[2],parseInt(.24*255)));return Array.of(t[0]+"px "+t[1]+"px "+t[2]+"px "+t[3]+"px "+o,t[4]+"px "+t[5]+"px "+t[6]+"px "+t[7]+"px "+s,t[8]+"px "+t[9]+"px "+t[10]+"px "+t[11]+"px "+_).join(",")}var i=function(e){var t,i,n,r,a,o=0|e.length;if(void 0===e)return"#00000000";switch(t="",i="",n="",r="",a="#12345678",o){case 9:a=e;break;case 7:a=e.concat("ff");break;case 5:t=e.charAt(1),i=e.charAt(2),n=e.charAt(3),r=e.charAt(4),a="#".concat(t,t,i,i,n,n,r,r);break;case 4:t=e.charAt(1),i=e.charAt(2),n=e.charAt(3),a="#".concat(t,t,i,i,n,n,"ff")}return a},n=function(e){return"#".concat("00000000".concat(new Uint32Array(e.reverse().buffer)[0].toString(16)).slice(-8))},r=function(e){return new Uint8ClampedArray(Uint32Array.of(parseInt(e.slice(1),16)).buffer).reverse()};return Array.of("",t([0,2,1,-1,0,1,1,0,0,1,3,0]),t([0,3,1,-2,0,2,2,0,0,1,5,0]),t([0,3,3,-2,0,3,4,0,0,1,8,0]),t([0,2,4,-1,0,4,5,0,0,1,10,0]),t([0,3,5,-1,0,5,8,0,0,1,14,0]),t([0,3,5,-1,0,6,10,0,0,1,18,0]),t([0,4,5,-2,0,7,10,1,0,2,16,1]),t([0,5,5,-3,0,8,10,1,0,3,14,2]),t([0,5,6,-3,0,9,12,1,0,3,16,2]),t([0,6,6,-3,0,10,14,1,0,4,18,3]),t([0,6,7,-4,0,11,15,1,0,4,20,3]),t([0,7,8,-4,0,12,17,2,0,5,22,4]),t([0,7,8,-4,0,13,19,2,0,5,24,4]),t([0,7,9,-4,0,14,21,2,0,5,26,4]),t([0,8,9,-5,0,15,22,2,0,6,28,5]),t([0,8,10,-5,0,16,24,2,0,6,30,5]),t([0,8,11,-5,0,17,26,2,0,6,32,5]),t([0,9,11,-5,0,18,28,2,0,7,34,6]),t([0,9,12,-6,0,19,29,2,0,7,36,6]),t([0,10,13,-6,0,20,31,3,0,8,38,7]),t([0,10,13,-6,0,21,33,3,0,8,40,7]),t([0,10,14,-6,0,22,35,3,0,8,42,7]),t([0,11,14,-7,0,23,36,3,0,9,44,8]),t([0,11,15,-7,0,24,38,3,0,9,46,8]))},from:function(e,t,i,n,r,a){var o=this._get_screen_zoom_ratio,s=this._get_init_state,_=this._get_init_pointer_state,l=this._get_pos,h=this._get_shadows,c=(this._copy_event,!1),d=h("#020529"),p=_(),u=s(e,t,i,n,r,a),f=o(u),m=l(u,f),g={update:function(){},menu:function(){},move:function(){},up:function(){},down:function(){},middle:function(){},ripple:function(){}},A=null,y=null,v={box_shadow:"",will_change:!1};return{init_speed_interval:function(){null!==A?setTimeout(this.set_move_speed_average_now,5):A=setInterval(this.set_move_speed_average_now,20)},set_canvas_wrapper:function(e,t){u.canvas_wrapper={padding:e,border_width:t},f=o(u),m=l(u,f),this.set_current_scale_default()},set_canvas_container:function(e,t,i,n){u.canvas_container={top:e,left:t,height:i,width:n},f=o(u),m=l(u,f),this.set_current_scale_default()},set_sizes:function(e,t){u.sizes={width:e,height:t},u.scale.moves_speed_average_now=16,f=o(u),m=l(u,f)},set_perspective:function(e){u.perspective=e},get_pointer_state:function(){return p},get_perspective_state:function(){return y||{}},get_screen_zoom_ratio:function(){return Math.fround(parseFloat(f)).toFixed(2)},compute_perspective_from_pointer_event:function(e,t){var i,n,r,a,o,s,_,l,h,c,d,p,f,g;e|=0,t|=0,u.perspective>0&&(i=e-m.canvas_container.left|0,n=t-m.canvas_container.top|0,r=u.perspective*(i-m.canvas_container.width/2)/(m.canvas_container.width/2),a=-u.perspective*(n-m.canvas_container.height/2)/(m.canvas_container.height/2),_=255-(o=r>u.perspective?r:2*r)/2*255,l=(s=a<0?a:2*a)/2*255,h=(1.25*o/u.scale.current*1e3|0)/1e3,p=(d=!(!(c=(1.25*s/u.scale.current*1e3|0)/1e3)&&!h))?"rotateX("+c+"deg) rotateY("+h+"deg)":"",f=d?"linear-gradient(to right, rgba(\n "+_.toFixed(3)+",\n "+_.toFixed(3)+",\n "+_.toFixed(3)+", \n "+(Math.abs(.1*o)/(2*u.perspective)).toFixed(2)+"\n ), rgba(\n "+_.toFixed(3)+",\n "+_.toFixed(3)+",\n "+_.toFixed(3)+", \n "+(Math.abs(.6*o)/(2*u.perspective)).toFixed(2)+"\n )), linear-gradient(to top, rgba(\n "+l.toFixed(3)+",\n "+l.toFixed(3)+",\n "+l.toFixed(3)+", \n "+(Math.abs(.75*s)/(2*u.perspective)).toFixed(2)+"\n ), rgba(\n "+l.toFixed(3)+",\n "+l.toFixed(3)+",\n "+l.toFixed(3)+", \n "+(Math.abs(.25*s)/(2*u.perspective)).toFixed(2)+"\n ))":"",g=(1+(-h+c)/80).toFixed(2),y={transform_rotate:p,background_image:f,filter:d?"brightness("+g+") contrast("+g+")":""})},set_pointer_state:function(e){var t="",i=!1;for(t in"mouse_down"in e&&p.mouse_down!==e.mouse_down&&(i=!0),e)p[t]=e[t];i&&this.notify_cursor()},set_moves:function(e,t,i,n){var r,a,s,_,h,c,d,p,g,A,y,v,w,x,b;i=i||null,n=n||function(){},r=Date.now(),s=(a=u).scale,_="CANVAS_WRAPPER_OVERFLOW"!==a.canvas_event_target?18:24,h=s.move_x,c=s.move_y,d=s.moves_speeds,p=s.move_speed_timestamp,g=s.current,A=r-p|0,w=0|Math.min(Math.round((0|Math.sqrt((y=h-e|0)*y+(v=c-t|0)*v))/A*200),200),d.push(w),d.length>=_&&d.shift(),x=d.slice(-_).reduce((function(e,t,i,n){return e+t/n.length}),0),x=Math.max(1,Math.round(Math.floor(x*_/200))),b=!(null===i),u.scale.default=Math.fround(parseFloat(s.default)),u.scale.current=Math.fround(parseFloat(b?i:g)),u.scale.move_x=0|e,u.scale.move_y=0|t,u.scale.move_speed_timestamp=Date.now(),u.scale.moves_speeds=d,u.scale.moves_speed_average_now=null!==i&&i>g?_:null!==i&&i0&&void 0!==arguments[0]?arguments[0]:function(){},menu:arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},move:arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},up:arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},down:arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},middle:arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){},cursor:arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){},ripple:arguments.length>7&&void 0!==arguments[7]?arguments[7]:function(){}}},notify_moved:function(e){g.update(!1,!1,e)},notify_menu:function(e,t){setTimeout((function(){g.menu(e)}),t|=0)},notify_move:function(e){g.move(e)},notify_up:function(e){g.up(e)},notify_down:function(e){g.down(e)},notify_ripple:function(e){g.ripple(e)},notify_middle:function(){g.middle(!1,!1)},notify_cursor:function(){g.cursor(p.mouse_down,u.canvas_event_target)},set_shadow_color:function(e){d=h(e)},set_zoom:function(){var e,t,i,n,r,a,o,s,_,l,h,c,d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,p=arguments[1],f=arguments[2],m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,g=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,A=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){},y=u,v=y.scale,w=y.canvas_container,x=y.canvas_wrapper,b=v.current,C=v.move_y,E=v.move_x,U=b*d;U>6||U<1/6||(e=1-b/U,t=U/b,i=void 0,n=void 0,p&&f?(i=p-w.left|0,n=f-w.top|0):(i=w.width/2|0,n=w.height/2|0),0===m&&0===g?this.set_moves(E,C,U,A):(r=(E-i*e)*t+m|0,a=(C-n*e)*t+g|0,o=(w.width-x.width)/2|0,s=(w.height-x.height)/2|0,_=3/4*x.width+o,l=3/4*x.height+s,a-=s,h=Math.min(Math.abs(r-=o),_)*(r<0?-1:1)+o,c=Math.min(Math.abs(a),l)*(a<0?-1:1)+s,this.set_moves(h,c,U,A)))},handle_wheel:function(e){var t,i,n,r,a,o,s,_,l,h,c,d,p,f=e.deltaY,m=e.pageY,g=e.pageX,A=e.movementX,y=void 0===A?0:A,v=e.movementY,w=void 0===v?0:v,x=this.get_pos(),b=x.canvas_container,C=x.canvas_wrapper,E=u.scale,U=E.move_x,I=E.move_y,S=E.current,R=Math.max(Math.min(.125,Math.abs(-.01*f)),.25);(t=S+(R=-.01*f>0?R:-R)*S*(.9/Math.pow(S<1?1/S:S,1.6)))>6||t<1/6||(i=1-S/t,n=t/S,r=void 0,a=void 0,g&&m?(r=g-b.left|0,a=m-b.top|0):(r=b.width/2|0,a=b.height/2|0),o=(U-r*i)*n+y|0,s=(I-a*i)*n+w|0,_=(b.width-C.width)/2|0,l=(b.height-C.height)/2|0,h=3/4*C.width+_,c=3/4*C.height+l,s-=l,d=Math.min(Math.abs(o-=_),h)*(o<0?-1:1)+_,p=Math.min(Math.abs(s),c)*(s<0?-1:1)+l,this.set_moves(d,p,t))},handle_move:function(e,t,i,n){var r=this.get_pos(),a=r.canvas_container,o=r.canvas_wrapper,s=u.scale,_=s.move_x,l=s.move_y,h=(a.width-o.width)/2|0,c=(a.height-o.height)/2|0,d=3/4*o.width+h|0,p=3/4*o.height+c|0,f=_+(i-e|0)-c|0,m=l+(n-t|0)-h|0,g=f<0?-1:1,A=Math.min(Math.abs(f),d)*g+h|0,y=Math.min(Math.abs(m),p)*g+c|0;this.set_moves(A,y)},set_boolean_move_on_click:function(e){c=e},handle_pointer_down:function(e){var t,i,n,r,a,o,s,_,l,h,c,d;e.preventDefault(),t=u.canvas_event_target,n=(i=this.get_pointer_state()).latest_pointers_distance,r=i.latest_pointers_client_x_center,a=i.latest_pointers_client_y_center,o=i.previous_single_pointer_down_timestamp,s=i.previous_double_pointer_down_timestamp,_=i.pointer_events,l=parseInt(o),h=parseInt(s),_.set(""+e.pointerId,e),c=!(1!==_.size),d=!(2!==_.size),o=c?Date.now():l,s=d?Date.now():h,this.set_pointer_state({pointer_events:_,mouse_down:!0,event_button:parseInt(e.button),latest_pointers_distance:d?0:parseFloat(n),previous_single_pointer_down_timestamp:parseInt(o),previous_double_pointer_down_timestamp:parseInt(s),latest_pointers_client_x_center:parseInt(e.clientX),latest_pointers_client_y_center:parseInt(e.clientY)}),2===parseInt(e.button||0)||Math.abs(o-l)<200&&Math.abs(r-e.clientX)<20&&Math.abs(a-e.clientY)<20?this.notify_menu(e,180):c&&h+200>Date.now()||!c&&"mouse"!==e.pointerType||"CANVAS"!==t||this.notify_down(e),"CANVAS_WRAPPER_OVERFLOW"===t&&this.notify_ripple(e)},handle_pointer_up:function(e){var t,i;e.preventDefault(),t=u.canvas_event_target,(i=this.get_pointer_state().pointer_events).delete(""+e.pointerId),this.set_pointer_state({pointer_events:i,mouse_down:!(0===i.size)}),this.notify_up(e),("CANVAS_WRAPPER_OVERFLOW"===t&&1===e.which||"CANVAS"!==t)&&this.notify_moved()},handle_pointer_move:function(e){var t,i,n,r,a,o,s,_,l,h,d,p,f,m,g,A,y,v,w,x,b,C,E,U,I,S,R,T,B,F,P,O,k,M,Q,D,N,L,Y,G,V;e.preventDefault(),t=""+u.canvas_event_target,this.compute_canvas_event_target(parseInt(e.pageX),parseInt(e.pageY)),i=""+u.canvas_event_target,r=(n=this.get_pointer_state()).mouse_down,a=n.event_button,o=n.pointer_events,s=n.latest_pointers_distance,_=n.latest_pointers_client_x_center,l=n.latest_pointers_client_y_center,h=n.previous_double_pointer_move_timestamp,d=n.previous_single_pointer_down_timestamp,o.set(""+e.pointerId,{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,which:e.which,button:e.button,pointerId:e.pointerId}),2===o.size?(f=(p=Array.from(o.values()))[0].clientX-p[1].clientX,m=p[0].clientY-p[1].clientY,g=Math.sqrt(f*f+m*m),A=parseInt(p[0].clientX+p[1].clientX)/2,y=parseInt(p[0].clientY+p[1].clientY)/2,v=parseInt(p[0].pageX+p[1].pageX)/2,w=parseInt(p[0].pageY+p[1].pageY)/2,x=A-_,b=y-l,C=u.scale.move_x+x,E=u.scale.move_y+b,U=s>0?parseFloat(g/s):1,I={latest_pointers_distance:parseFloat(g),latest_pointers_client_x_center:parseInt(A),latest_pointers_client_y_center:parseInt(y),previous_double_pointer_move_timestamp:Date.now()},d+306||F<1/6||(P=1-B/F,O=F/B,k=(C-(v-R.left|0)*P)*O+x|0,M=(E-(w-R.top|0)*P)*O+b|0,Q=(R.width-T.width)/2|0,D=(R.height-T.height)/2|0,N=3/4*T.width+Q,L=3/4*T.height+D,M-=D,Y=Math.min(Math.abs(k-=Q),N)*(k<0?-1:1)+Q,G=Math.min(Math.abs(M),L)*(M<0?-1:1)+D,this.set_moves(Y,G,F)),this.set_pointer_state(I)):this.set_pointer_state(I)):r&&1===o.size?(V={latest_pointers_client_x_center:parseInt(e.clientX),latest_pointers_client_y_center:parseInt(e.clientY),previous_double_pointer_move_timestamp:parseInt(h)},"CANVAS"!==i||"CANVAS"===i&&0===a&&c||1===a?h+200=n.left&&t>=n.top&&e<=n.right&&t<=n.bottom?a="CANVAS":e>=r.left&&t>=r.top&&e<=r.right&&t<=r.bottom&&(a="CANVAS_WRAPPER"),u.canvas_event_target!==a&&(o=!0,u.canvas_event_target=a),o&&this.notify_cursor()},set_move_speed_average_now:function(){var e,t,i;u&&(e="CANVAS_WRAPPER_OVERFLOW"!==u.canvas_event_target?18:24,(t=Date.now())-u.scale.move_speed_timestamp>=20&&u.scale.moves_speed_average_now>-e?(i=Math.max(u.scale.moves_speed_average_now-1,-e),u.scale.moves_speed_average_now=i,u.scale.move_speed_timestamp=0|t,g.update(!0,!0)):t-u.scale.move_speed_timestamp>=20&&u.scale.moves_speed_average_now<-e&&e<24?(u.scale.moves_speed_average_now=0|Math.max(u.scale.moves_speed_average_now+1,-e),u.scale.move_speed_timestamp=0|t,g.update(!0,!0)):u.perspective>0&&g.update(!0,!0))}}}};e.exports=r},688:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,i){return((e=((e|=0)-(e-(i=(0|i)>>>0)&i-e>>31)|0)>>>0)-(e-(t=(0|t)>>>0)&e-t>>31)|0)>>>0}function a(e){var t=I(e/255);return 255-E(e+e-Math.round(t*t*255|0)|0,0,255)}function o(e){return C(U(e,e))}var s,_,l,h,c,d,p,u,f,m=i(648),g=i(654),A=n(i(715)),y=n(i(716)),v=(0,m.SIMDopeCreate)({create:{new_uint32:!0,new_zero:!0},properties:{},methods:{get_use_element:!0,blend_first_with:!0,blend_with:!0}}),w=v.Color,x=v.Colors,b=v.simdops,C=b.abs_int,E=b.clamp_int,U=b.minus_int,I=Math.fround,S=function(e){var t,i,n=new Uint32Array(e.data.buffer),r=Uint32Array.from(new Set(n)),a={},o=r.length,s=o<255?new Uint8Array(n.length):o<65535?new Uint16Array(n.length):new Uint32Array(n.length);for(t=0,i=0|o;(0|t)<(0|i);t=(t+1|0)>>>0)a[r[0|t]]=(0|t)>>>0;for(t=0,i=0|n.length;(0|t)<(0|i);t=(t+1|0)>>>0)s[0|t]=(0|a[n[0|t]])>>>0;return[s,r,n,o]},R=Object.create({_get_64_js:function(){return{xxh_f:{hasher:A.default,create:function(e){return this.hasher.h64(e)}},xxh_v:"64",xxh_t:"js",xxh_tt:Date.now()}},_get_64_wasm:function(){return new Promise((function(e,t){try{(0,y.default)().then((function(t){e({xxh_f:{hasher:t,create:function(e){return this.hasher.create64(BigInt(e))}},xxh_v:"64",xxh_t:"wasm",xxh_tt:Date.now()})})).catch((function(e){t()}))}catch(i){t()}}))},new:function(){var e=Uint8Array.from("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((function(e){return e.charCodeAt(0)}))),t=BigInt(e.length),i=new Uint8Array(14),n=this._get_64_js,r=this._get_64_wasm,a=n();return r().then((function(e){a=e})),{get_info:function(){return{version:a.xxh_v,type:a.xxh_t,timestamp:a.xxh_tt}},base58_that:function(n){var r,o=0,s=BigInt(0),_=a.xxh_f.create(62675);for(n instanceof Uint8Array||n instanceof Uint8ClampedArray?_.update(n):n.forEach((function(e){_.update(e)})),r=BigInt(_.digest());r>0;)s=Number(r%t),r=BigInt(r/t),i[0|o]=65535&e[s],o=o+1&15;return String.fromCharCode.apply(null,i.slice(0,0|o))}}}}).new(),T=function e(t,i,n,r,a){if(!(this instanceof e))return new e(t,i,n,r);if(i=(0|parseInt(i||0))>>>0,n=(0|parseInt(n||0))>>>0,this.with_plain_data_=!(void 0!==r&&!r),"length"in t&&2===t.length)this.width_=0|i,this.height_=0|n,this.bitmap_=void 0===a?{height:this.height_,width:this.width_,destroy:function(){},hash:""}:a,this.force_update_data(t[0],t[1]);else{if(t instanceof ImageData){var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i,n,r=[],a=!0,o=!1,s=void 0;try{for(i=e[Symbol.iterator]();!(a=(n=i.next()).done)&&(r.push(n.value),2!==r.length);a=!0);}catch(_){o=!0,s=_}finally{try{!a&&i.return&&i.return()}finally{if(o)throw s}}return r}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(S(t)),s=o[0],_=o[1];this.width_=0|t.width,this.height_=0|t.height,this.bitmap_=void 0===a?{height:this.height_,width:this.width_,destroy:function(){},hash:""}:a,this.force_update_data(_,s)}else t.data8 instanceof Uint8ClampedArray?(this.width_=0|t.width,this.height_=0|t.height,this.populate_data(new Uint32Array(t.data8.buffer))):t instanceof Uint8Array||t instanceof Uint8ClampedArray?(this.width_=0|i,this.height_=0|n,this.populate_data(new Uint32Array(t.buffer))):(this.width_=0|i,this.height_=0|n,this.populate_data(Uint32Array.from(t)));this.bitmap_=void 0===a?{height:this.height_,width:this.width_,destroy:function(){},hash:""}:a,this.populate_colors(this.uint32_pixel_color_),this.populate_indexes(),this.changes_.charge()}return this};T.new_from_colors_and_indexes=function(e,t,i,n,r,a){return new T(Array.of(e,t),parseInt(i),parseInt(n),!!r,a)},Object.defineProperty(T.prototype,"force_update_data",{get:function(){return function(e,t){var i=void 0!==e,n=void 0!==t;i&&n?(this.populate_colors(e),this.populate_indexes(t),this.populate_data()):n?(this.populate_indexes(t),this.compute_data()):i&&(this.populate_colors(e),this.compute_data())}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"populate_data",{get:function(){return function(e){if(void 0===e){this.uint32_pixel_color_=new Uint32Array(this.width_*this.height_),this.changes_=new g.SetFixed(this.uint32_pixel_color_.length),this.uint8c_pixel_color_=new Uint8ClampedArray(this.uint32_pixel_color_.buffer),this.simdope_pixel_color_=new x(this.uint32_pixel_color_.buffer);for(var t=0,i=0|this.uint32_pixel_color_.length;(0|t)<(0|i);t=(t+1|0)>>>0)this.uint32_pixel_color_[t]=(0|this.colors[this.indexes[t]])>>>0;this.changes_.charge()}else this.uint32_pixel_color_=e instanceof Uint32Array?e:Uint32Array.from(e),this.changes_=new g.SetFixed(this.uint32_pixel_color_.length),this.uint8c_pixel_color_=new Uint8ClampedArray(this.uint32_pixel_color_.buffer),this.simdope_pixel_color_=new x(this.uint32_pixel_color_.buffer),this.changes_.charge()}}}),Object.defineProperty(T.prototype,"compute_data",{get:function(){return function(){var e,t;for(e=0,t=0|this.uint32_pixel_color_.length;(0|e)<(0|t);e=(e+1|0)>>>0)(0|(0|this.uint32_pixel_color_[(0|e)>>>0])>>>0)>>>0!=(0|(0|this.colors[this.indexes[(0|e)>>>0]])>>>0)>>>0&&(this.uint32_pixel_color_[(0|e)>>>0]=(0|this.colors[this.indexes[(0|e)>>>0]])>>>0,this.changes_.add((0|e)>>>0))}}}),Object.defineProperty(T.prototype,"populate_colors",{get:function(){return function(e){this.uint32_colors_=e instanceof Uint32Array?e.slice(0,0|e.length):Uint32Array.from(e),this.uint32_colors_length_=this.uint32_colors_.length,this.uint32_colors_map_={};for(var t=0;(0|t)<(0|this.uint32_colors_length_);t=(t+1|0)>>>0)this.uint32_colors_map_[this.uint32_colors_[t]]=t}}}),Object.defineProperty(T.prototype,"populate_indexes",{get:function(){return function(e){if(void 0!==e)this.color_indexes_length_=e.length,this.color_indexes_constructor_=this.uint32_colors_length_<256?Uint8Array:(this.uint32_colors_length_+1|0)<65536?Uint16Array:Uint32Array,this.color_indexes_=e instanceof this.color_indexes_constructor_?e:this.color_indexes_constructor_.from(e);else{this.color_indexes_length_=this.uint32_pixel_color_.length,this.color_indexes_constructor_=this.uint32_colors_length_<256?Uint8Array:(this.uint32_colors_length_+1|0)<65536?Uint16Array:Uint32Array,this.color_indexes_=new this.color_indexes_constructor_(this.color_indexes_length_);for(var t=0,i=0|this.color_indexes_length_;(0|t)<(0|i);t=(t+1|0)>>>0)this.color_indexes_[0|t]=(0|this.get_color_index(this.uint32_pixel_color_[0|t]))>>>0}}}}),Object.defineProperty(T.prototype,"get_color_index",{get:function(){return function(e){return this.uint32_colors_map_[(0|e)>>>0]}}}),Object.defineProperty(T.prototype,"has_color",{get:function(){return function(e){return void 0!==this.uint32_colors_map_[(0|e)>>>0]}}}),Object.defineProperty(T.prototype,"data8",{get:function(){return this.uint8c_pixel_color_}}),Object.defineProperty(T.prototype,"image_data",{get:function(){return new ImageData(this.data8,0|this.width_,0|this.height_)}}),Object.defineProperty(T.prototype,"width",{get:function(){return 0|this.width_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"height",{get:function(){return 0|this.height_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_bitmap",{get:function(){return function(e){return this.bitmap_.hash!==e.hash&&(this.bitmap_.destroy(),this.bitmap_=e),this.bitmap_}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"get_bitmap",{get:function(){return function(){return this.bitmap_}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"bitmap_async",{get:function(){return function(e){var t,i,n,r,a,o;return e=void 0!==e&&!!e&&!0,t=this.hash_hex_async.bind(this),i=this.get_bitmap.bind(this),n=this.set_bitmap.bind(this),r=this.image_data,a=function(e,i){Promise.all([createImageBitmap(r),t()]).then((function(t){var i=t[0];i.hash=""+t[1],e(n(i))})).catch(i)},e?(o=i(),t().then((function(e){return""!==o.hash&&""+e==""+o.hash?Promise.resolve(o):new Promise(a)}))):new Promise(a)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"hash_hex_async",{get:function(){return function(e){var t=R.base58_that(e||this.data8);return Promise.resolve(t)}}}),Object.defineProperty(T.prototype,"data",{get:function(){return this.uint32_pixel_color_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"get_index",{get:function(){return function(e){return e=(0|e)>>>0,this.color_indexes_[0|e]}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"indexes",{get:function(){return this.color_indexes_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"indexes_copy",{get:function(){return this.indexes.slice(0,0|this.indexes.length)},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_indexes",{get:function(){return function(e){this.force_update_data(void 0,e)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"get_color",{get:function(){return function(e){return e=(0|e)>>>0,this.uint32_colors_[0|e]}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"colors",{get:function(){return this.uint32_colors_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"colors_copy",{get:function(){var e=0|this.uint32_colors_length_;return this.uint32_colors_.slice(0,0|e)},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_colors",{get:function(){return function(e){this.force_update_data(e,void 0)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_colors_and_indexes",{get:function(){return function(e,t){this.force_update_data(e,t)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"changes",{get:function(){return this.changes_.indexes},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"changes_has",{get:function(){return function(e){return this.changes_.has((0|e)>>>0)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"setFixed",{get:function(){return this.changes_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"clear_changes",{get:function(){return function(){this.changes_.clear()}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"charge_changes",{get:function(){return function(){this.changes_.charge()}}}),Object.defineProperty(T.prototype,"get_uint32",{get:function(){return function(e){return e=(0|e)>>>0,this.uint32_pixel_color_[e]}}}),Object.defineProperty(T.prototype,"set_uint32",{get:function(){return function(e,t){if(e=(0|e)>>>0,t=void 0===t?this.uint32_pixel_color_[e]:(0|t)>>>0,this.changes_.add(e),this.uint32_pixel_color_[e]=t,this.has_color(t))return this.color_indexes_[e]=this.get_color_index(t),!1;switch(this.uint32_colors_length_+1|0){case 255:this.color_indexes_=Uint16Array.from(this.color_indexes_);break;case 65535:this.color_indexes_=Uint32Array.from(this.color_indexes_)}var i=new Uint32Array(this.uint32_colors_length_+1|0);return i.set(this.uint32_colors_,0),i[(0|this.uint32_colors_length_)>>>0]=t,this.populate_colors(i),this.color_indexes_[e]=this.get_color_index(t),!0}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"paint_uint32a",{get:function(){return function(e,t,i){var n,r,a,o;if(t=(0|t)>>>0,i=Math.round(255*parseFloat(i)),(n=0|e.length)>0)for(r=w.new_uint32(t),a=new w(new ArrayBuffer(4)),o=0;(0|o)<(0|n);o=(o+1|0)>>>0)this.simdope_pixel_color_.get_use_element(e[o],a).blend_first_with(r,i,!1,!1),this.set_uint32(e[o])}},enumerable:!1,configurable:!1}),s=function e(t,i,n,r){var a;if(!(this instanceof e))return new e(t,i,n,r);for(n=(0|n)>>>0,r=(0|r)>>>0,this.layers_=Array(t.length),this.metadata_=Array(i.length),a=0;a>>0)r[0|o]=r[o+1|0]=r[o+2|0]=((i[0|o]+i[o+1|0]+i[o+2|0]|0)/3|0)>>>0,r[o+3|0]=i[o+3|0];for(s=new x(e),_=new x(a),l=new w(new ArrayBuffer(4)),h=new w(new ArrayBuffer(4)),c=0|a.length,d=0;(0|d)<(0|c);d=(d+1|0)>>>0)s.get_use_element(0|d,l).blend_with(_.get_use_element(0|d,h),t,!1,!1);return e}},enumerable:!1,configurable:!1}),c=Float32Array.of(.393,.769,.189,.349,.686,.168,.272,.534,.131),Object.defineProperty((d=function e(){if(!(this instanceof e))return new e}).prototype,"filter_colors",{get:function(){return function(e,t){var i,n,r,o,s,_,l,h,c,d,p;for(t=0|Math.round(parseFloat(t)/4*255),n=0|(i=new Uint8Array(e.buffer)).length,r=new Uint8Array(0|n),o=new Uint32Array(r.buffer),s=0;(0|s)<(0|n);s=(s+4|0)>>>0)r[0|s]=a(r[0|s]),r[s+1|0]=a(r[s+1|0]),r[s+2|0]=a(r[s+2|0]),r[s+3|0]=i[s+3|0];for(_=new x(e),l=new x(o),h=new w(new ArrayBuffer(4)),c=new w(new ArrayBuffer(4)),d=0|o.length,p=0;(0|p)<(0|d);p=(p+1|0)>>>0)_.get_use_element(0|p,h).blend_with(l.get_use_element(0|p,c),t,!1,!1);return e}},enumerable:!1,configurable:!1}),Object.defineProperty((p=function e(){if(!(this instanceof e))return new e}).prototype,"filter_colors",{get:function(){return function(e,t){var i,n,r,a,s,_,l,h,c,d,p;for(t=0|Math.round(parseFloat(t)/2*255),n=0|(i=new Uint8Array(e.buffer)).length,r=new Uint8Array(0|n),a=new Uint32Array(r.buffer),s=0;(0|s)<(0|n);s=(s+4|0)>>>0)r[0|s]=o(r[0|s]),r[s+1|0]=o(r[s+1|0]),r[s+2|0]=o(r[s+2|0]),r[s+3|0]=i[s+3|0];for(_=new x(e),l=new x(a),h=new w(new ArrayBuffer(4)),c=new w(new ArrayBuffer(4)),d=0|a.length,p=0;(0|p)<(0|d);p=(p+1|0)>>>0)_.get_use_element(0|p,h).blend_with(l.get_use_element(0|p,c),t,!1,!1);return e}},enumerable:!1,configurable:!1}),Object.defineProperty((u=function e(){if(!(this instanceof e))return new e}).prototype,"filter_colors",{get:function(){return function(e,t){var i,n,a,o,s,_,l,h,d,p,u;for(t=0|Math.round(255*parseFloat(t)),n=0|(i=new Uint8Array(e.buffer)).length,a=new Uint8Array(0|n),o=new Uint32Array(a.buffer),s=0;(0|s)<(0|n);s=(s+4|0)>>>0)a[s+3|0]=i[s+3|0],a[0|s]=255&r(i[0|s]*c[0]+i[s+1|0]*c[1]+i[s+2|0]*c[2]|0,0,255),a[s+1|0]=255&r(i[0|s]*c[3]+i[s+1|0]*c[4]+i[s+2|0]*c[5]|0,0,255),a[s+2|0]=255&r(i[0|s]*c[6]+i[s+1|0]*c[7]+i[s+2|0]*c[8]|0,0,255);for(_=new x(e),l=new x(o),h=new w(new ArrayBuffer(4)),d=new w(new ArrayBuffer(4)),p=0|o.length,u=0;(0|u)<(0|p);u=(u+1|0)>>>0)_.get_use_element(0|u,h).blend_with(l.get_use_element(0|u,d),t,!1,!1);return e}},enumerable:!1,configurable:!1}),Object.defineProperty(l.prototype,"filter_colors",{get:function(){return function(e,t){var i,n,r,a,o,s,_,l,h,c,d;for(t=0|Math.round(255*parseFloat(t)),n=0|(i=new Uint8Array(e.buffer)).length,r=new Uint8Array(0|n),a=new Uint32Array(r.buffer),o=0;(0|o)<(0|n);o=(o+4|0)>>>0)r[o+3|0]=i[o+3|0],r[0|o]=this.ar_[i[0|o]],r[o+1|0]=this.ag_[i[o+1|0]],r[o+2|0]=this.ab_[i[o+2|0]];for(s=new x(e),_=new x(a),l=new w(new ArrayBuffer(4)),h=new w(new ArrayBuffer(4)),c=0|a.length,d=0;(0|d)<(0|c);d=(d+1|0)>>>0)s.get_use_element(0|d,l).blend_with(_.get_use_element(0|d,h),t,!1,!1);return e}},enumerable:!1,configurable:!1}),f=function e(t){if(!(this instanceof e))return new e(t);t=t||_,this.names_=Object.keys(t),this.filters_=Object.values(t).map((function(e){return l(e)})),this.special_names_=Array.of("Greyscale","Sepia","Screen","Difference"),this.filter_sepia_=new u,this.filter_greyscale_=new h,this.filter_screen_=new d,this.filter_difference_=new p},Object.defineProperty(f.prototype,"names",{get:function(){return this.names_.concat(this.special_names_)},enumerable:!1,configurable:!1}),Object.defineProperty(f.prototype,"use",{get:function(){return function(e,t,i,n){n=void 0!==n&&!!n;var r=this.names_.indexOf(e);if(void 0!==t){if(!(r<0))return n?T.new_from_colors_and_indexes(this.filters_[r].filter_colors(t.colors_copy,i),t.indexes,t.width,t.height):(t.set_colors(this.filters_[r].filter_colors(t.colors_copy,i)),t);if(n)switch(e){case"Sepia":return T.new_from_colors_and_indexes(this.filter_sepia_.filter_colors(t.colors_copy,i),t.indexes,t.width,t.height);case"Screen":return T.new_from_colors_and_indexes(this.filter_screen_.filter_colors(t.colors_copy,i),t.indexes,t.width,t.height);case"Difference":return T.new_from_colors_and_indexes(this.filter_difference_.filter_colors(t.colors_copy,i),t.indexes,t.width,t.height);default:return T.new_from_colors_and_indexes(this.filter_greyscale_.filter_colors(t.colors_copy,i),t.indexes,t.width,t.height)}else switch(e){case"Sepia":return t.set_colors(this.filter_sepia_.filter_colors(t.colors_copy,i)),t;case"Screen":return t.set_colors(this.filter_screen_.filter_colors(t.colors_copy,i)),t;case"Difference":return t.set_colors(this.filter_difference_.filter_colors(t.colors_copy,i)),t;default:return t.set_colors(this.filter_greyscale_.filter_colors(t.colors_copy,i)),t}}}},enumerable:!1,configurable:!1}),e.exports={Layer:T,Layers:s,Filters:f,split_image_data:S}},715:function(e,t,i){"use strict";!function(t){function n(e){var t,i,n,r=[];for(t=0,i=e.length;(0|t)<(0|i);t=(t+1|0)>>>0)(n=e.charCodeAt(t))<128?r.push(n):n<2048?r.push(192|n>>6,128|63&n):n<55296||n>=57344?r.push(224|n>>12,128|n>>6&63,128|63&n):(t++,n=65536+((1023&n)<<10|1023&e.charCodeAt(t)),r.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n));return new Uint8Array(r)}function r(){return 2==arguments.length?new r(arguments[1]).update(arguments[0]).digest():this instanceof r?void this.init.call(this,arguments[0]):new r(arguments[0])}function a(){return 2==arguments.length?new a(arguments[1]).update(arguments[0]).digest():this instanceof a?void this.init.call(this,arguments[0]):new a(arguments[0])}var o,s,_,l,h,c,d,p,u,f,m=i(927);m.UINT32.prototype.xxh_update=function(e,t){var i,n,r,a=s._low,_=s._high,l=e*a,h=l>>>16;h+=t*a,h&=65535,h+=e*_,n=(i=this._low+(65535&l))>>>16,n=(r=(r=(n+=this._high+(65535&h))<<16|65535&i)<<13|r>>>19)>>>16,h=(l=(i=65535&r)*(a=o._low))>>>16,h+=n*a,h&=65535,h+=i*(_=o._high),this._low=65535&l,this._high=65535&h},o=(0,m.UINT32)("2654435761"),s=(0,m.UINT32)("2246822519"),_=(0,m.UINT32)("3266489917"),l=(0,m.UINT32)("668265263"),h=(0,m.UINT32)("374761393"),r.prototype.init=function(e){return this.seed=e instanceof m.UINT32?e.clone():(0,m.UINT32)(e),this.v1=this.seed.clone().add(o).add(s),this.v2=this.seed.clone().add(s),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(o),this.total_len=0,this.memsize=0,this.memory=null,this},r.prototype.update=function(e){var i,r,a,o,s,_=!1;if("buffer"in e&&(e=e.buffer,e=new Uint8Array(e),_=!0),"string"==typeof e&&(e=n(e),_=!0),"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&(_=!0,e=new Uint8Array(e)),a=(i=0)+(r=e.length)|0,0==r)return this;if(this.total_len=this.total_len+r|0,0==this.memsize&&(this.memory=_?new Uint8Array(16):new t(16)),(this.memsize+r|0)<16)return _?this.memory.set(e.subarray(0,r),this.memsize):e.copy(this.memory,this.memsize,0,r),this.memsize=this.memsize+r|0,this;if((0|this.memsize)>0&&(_?this.memory.set(e.subarray(0,16-this.memsize|0),this.memsize):e.copy(this.memory,this.memsize,0,16-this.memsize),o=0,this.v1.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2|0]),o=(o+4|0)>>>0,this.v2.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2|0]),o=(o+4|0)>>>0,this.v3.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2|0]),o=(o+4|0)>>>0,this.v4.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2]),i=i+16-this.memsize|0,this.memsize=0),(0|i)<=(a-16|0)){s=a-16|0;do{this.v1.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0,this.v2.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0,this.v3.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0,this.v4.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0}while((0|i)<=(0|s))}return(0|i)<(0|a)&&(_?this.memory.set(e.subarray(i,a),this.memsize):e.copy(this.memory,this.memsize,i,a),this.memsize=a-i|0),this},r.prototype.digest=function(){var e,t,i=this.memory,n=0,r=this.memsize,a=new m.UINT32;for((e=(0|this.total_len)>=16?this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18)))):this.seed.clone().add(h)).add(a.fromNumber(this.total_len));(0|n)<=(r-4|0);)a.fromBits(i[n+1]<<8|i[n],i[n+3]<<8|i[n+2]),e.add(a.multiply(_)).rotl(17).multiply(l),n=(n+4|0)>>>0;for(;(0|n)<(0|r);)a.fromBits(i[n++],0),e.add(a.multiply(h)).rotl(11).multiply(o);return t=e.clone().shiftRight(15),e.xor(t).multiply(s),t=e.clone().shiftRight(13),e.xor(t).multiply(_),t=e.clone().shiftRight(16),e.xor(t),this.init(this.seed),e},c=(0,m.UINT64)("11400714785074694791"),d=(0,m.UINT64)("14029467366897019727"),p=(0,m.UINT64)("1609587929392839161"),u=(0,m.UINT64)("9650029242287828579"),f=(0,m.UINT64)("2870177450012600261"),a.prototype.init=function(e){return this.seed=e instanceof m.UINT64?e.clone():(0,m.UINT64)(e),this.v1=this.seed.clone().add(c).add(d),this.v2=this.seed.clone().add(d),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(c),this.total_len=0,this.memsize=0,this.memory=null,this},a.prototype.update=function(e){var i,r,a,o,s,_,l;if("buffer"in e&&(e=e.buffer,i=!0),"string"==typeof e&&(e=n(e),i=!0),"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&(i=!0,e=new Uint8Array(e)),o=(r=0)+(a=0|e.length)|0,0==a)return this;if(this.total_len+=a,0==this.memsize&&(this.memory=i?new Uint8Array(32):new t(32)),this.memsize+a<32)return i?this.memory.set(e.subarray(0,a),this.memsize):e.copy(this.memory,this.memsize,0,a),this.memsize+=a,this;if(this.memsize>0&&(i?this.memory.set(e.subarray(0,32-this.memsize),this.memsize):e.copy(this.memory,this.memsize,0,32-this.memsize),s=0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v1.add(_.multiply(d)).rotl(31).multiply(c),s=(s+8|0)>>>0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v2.add(_.multiply(d)).rotl(31).multiply(c),s=(s+8|0)>>>0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v3.add(_.multiply(d)).rotl(31).multiply(c),s=(s+8|0)>>>0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v4.add(_.multiply(d)).rotl(31).multiply(c),r=r+32-this.memsize|0,this.memsize=0),(0|r)<=(o-32|0)){l=o-32|0;do{_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v1.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0,_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v2.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0,_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v3.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0,_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v4.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0}while(r<=l)}return r=32?((e=this.v1.clone().rotl(1)).add(this.v2.clone().rotl(7)),e.add(this.v3.clone().rotl(12)),e.add(this.v4.clone().rotl(18)),e.xor(this.v1.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u),e.xor(this.v2.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u),e.xor(this.v3.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u),e.xor(this.v4.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u)):e=this.seed.clone().add(f),e.add(a.fromNumber(this.total_len));(0|n)<=(r-8|0);)a.fromBits(i[n+1|0]<<8|i[0|n],i[n+3|0]<<8|i[n+2|0],i[n+5|0]<<8|i[n+4|0],i[n+7|0]<<8|i[n+6|0]),a.multiply(d).rotl(31).multiply(c),e.xor(a).rotl(27).multiply(c).add(u),n=(n+8|0)>>>0;for((n+4|0)<=(0|r)&&(a.fromBits(i[n+1|0]<<8|i[0|n],i[n+3|0]<<8|i[n+2|0],0,0),e.xor(a.multiply(c)).rotl(23).multiply(d).add(p),n=(n+4|0)>>>0);(0|n)<(0|r);)a.fromBits(i[n++],0,0,0),e.xor(a.multiply(f)).rotl(11).multiply(c);return t=e.clone().shiftRight(33),e.xor(t).multiply(d),t=e.clone().shiftRight(29),e.xor(t).multiply(p),t=e.clone().shiftRight(32),e.xor(t),this.init(this.seed),e},e.exports={h32:r,h64:a}}(i(208).Buffer)},717:function(e,t,i){"use strict";function n(e,t,i){var n,r;return e|=0,t|=0,n=new Uint8Array(e),void 0!==i?(n.fill(255),n.set(i,0)):n.fill(255),(r={number_length_index_byte:Uint32Array.of(e,t,0,0),hover_data_in_layer:new Uint8Array(t),indexes_data_for_layers:new Uint32Array(t),colors_data_in_layers_uint32:new Uint32Array(t*e),layers_opacity_255:n}).colors_data_in_layers_uint32_SIMDope=new h(r.colors_data_in_layers_uint32.buffer),r}function r(e,t,i,r){if(t|=0,i|=0,void 0===e)return n(t,i,r);if(null===e)return n(t,i,r);var a=c(t,e.layer_number);return d(a,0)||y(e.max_length,i)?n(t,i,r):(e.number_length_index_byte[0]=0|t,e.number_length_index_byte[1]=0|i,e.number_length_index_byte[2]=0,e.number_length_index_byte[3]=0,void 0!==r?(e.layers_opacity_255.fill(255),e.layers_opacity_255.set(r)):e.layers_opacity_255.fill(255),e)}var a=i(648),o=(0,a.SIMDopeCreateConfAdd)({create:{new_of:!0},properties:{buffer:!0},methods:{get_use_element:!0,set_tail:!0,set_from_simdope:!0,set_from_buffer:!0,get_tail:!0,get_tail_opacity:!0,reset_tail:!0,is_dark:!0,blend_first_with:!0,blend_first_with_tails:!0,is_not_fully_transparent:!0,copy:!0}}),s=(0,a.SIMDopeCreate)(o),_=s.simdops,l=s.Color,h=s.Colors,c=_.minus_int,d=_.int_not_equal,p=_.plus_int,u=_.plus_uint,f=(_.minus_uint,_.multiply_int),m=_.multiply_uint,g=(_.divide_uint,_.clamp_uint8),A=_.clamp_uint32,y=(_.int_equal,_.uint_less),v=(_.int_less,_.int_greater_equal,_.uint_not_equal,_.uint_less_equal,_.min_uint,function e(t){return t=t||{},this instanceof e?(this.state_=n(t.layer_number||1,t.max_length||1,t.layers_opacity_255||new Uint8Array(0)),this.number_length_index_byte_=this.state_.number_length_index_byte,this.hover_data_in_layer_=this.state_.hover_data_in_layer,this.indexes_data_for_layers_=this.state_.indexes_data_for_layers,this.colors_data_in_layers_uint32_=this.state_.colors_data_in_layers_uint32,this.shadow_state_=((i=i||{base_rgba_colors_for_blending:new Uint32Array(0),color_less_uint8x4:l.new_of(255,255,255,255),color_full_uint8x4:l.new_of(0,0,0,255),layers_color:[],all_layers_length:0,used_colors_length:0}).base_rgba_colors_for_blending_SIMDope=new h(i.base_rgba_colors_for_blending.buffer),i),this.data_array_=[],this.destination_rgba_colors_for_blending_,this.destination_rgba_colors_for_blending_SIMDope_,this):new e(t);var i});Object.defineProperty(v.prototype,"state",{get:function(){return this.state_},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_state",{get:function(){return function(e){return this.state_=e,this.number_length_index_byte_=this.state_.number_length_index_byte,this.hover_data_in_layer_=this.state_.hover_data_in_layer,this.indexes_data_for_layers_=this.state_.indexes_data_for_layers,this.colors_data_in_layers_uint32_=this.state_.colors_data_in_layers_uint32,this.state_}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_shadow_state",{get:function(){return function(e){return this.shadow_state_=e}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"get_updated_shadow_state",{get:function(){return function(){return this.shadow_state_.layers_color.length=this.number_length_index_byte_[2]?this.shadow_state_.base_rgba_colors_for_blending.fill(0,0,this.shadow_state_.used_colors_length):(this.shadow_state_.base_rgba_colors_for_blending=new Uint32Array(0|this.number_length_index_byte_[2]),this.shadow_state_.base_rgba_colors_for_blending_SIMDope=new h(this.shadow_state_.base_rgba_colors_for_blending.buffer))),this.shadow_state_.all_layers_length=0|this.number_length_index_byte_[0],this.shadow_state_.max_used_colors_length=0|this.number_length_index_byte_[1],this.shadow_state_.used_colors_length=0|this.number_length_index_byte_[2],this.shadow_state_}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"shadow_state",{get:function(){return this.shadow_state_},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_bytes_index",{get:function(){return function(e){return this.number_length_index_byte_[3]=0|e}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"data_array",{get:function(){return this.data_array_},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_data_array",{get:function(){return function(e,t){this.data_array_=e,t&&(this.destination_rgba_colors_for_blending_=t,this.destination_rgba_colors_for_blending_SIMDope_=new h(this.destination_rgba_colors_for_blending_.buffer))}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"bytes_index",{get:function(){return function(){return 0|this.number_length_index_byte_[3]}},enumerable:!1,configurable:!1}),v.init=function(e,t,i){return new v({layer_number:e,max_length:t,layers_opacity_255:i})},Object.defineProperty(v.prototype,"for",{get:function(){return function(e,t){this.indexes_data_for_layers_[this.number_length_index_byte_[2]]=A(e),this.hover_data_in_layer_[this.number_length_index_byte_[2]]=g(t),this.number_length_index_byte_[2]=u(this.number_length_index_byte_[2],1)}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"next",{get:function(){return function(){this.number_length_index_byte_[3]=u(this.number_length_index_byte_[3],1)}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"stack",{get:function(){return function(e,t){this.colors_data_in_layers_uint32_[u(m(this.number_length_index_byte_[0],this.number_length_index_byte_[3]),g(e))]=A(t)}},enumerable:!1,configurable:!1}),v.prototype.blend=function(e,t){var i,n,r,a,o,s,_,c,d,g,A,v,w,x,b,C,E,U;return t|=0,i=this.get_updated_shadow_state(),n=i.base_rgba_colors_for_blending,r=i.base_rgba_colors_for_blending_SIMDope,a=i.all_layers_length,o=i.used_colors_length,s=i.layers_colors,_=i.color_less_uint8x4,c=i.color_full_uint8x4,d=this.state,g=d.colors_data_in_layers_uint32_SIMDope,A=d.hover_data_in_layer,v=d.layers_opacity_255,w=d.indexes_data_for_layers,x=this.destination_rgba_colors_for_blending_SIMDope_,b=this.data_array.map((function(e){return new h(e.data.buffer)})),C=b.length||0,E=s[0],U=new l(new ArrayBuffer(4)),new Promise((function(e){var i=new Uint32Array(6);if(i[4]=0|o,i[5]=0|C,x){for(i[3]=0;y(i[3],a+1);i[3]=p(i[3],1))s[i[3]].set_tail(s[i[3]+1|0],v[i[3]]);for(;y(i[2],i[4]);i[2]=u(i[2],1)){for(x.get_use_element(w[i[2]],E),E.is_not_fully_transparent()&&E.set_from_simdope(U),i[0]=m(i[2],a),i[3]=0;y(i[3],i[5]);i[3]=u(i[3],1))b[i[3]].get_use_element(w[i[2]],s[i[3]+1|0]);for(i[3]=i[5];y(i[3],a);i[3]=u(i[3],1))i[1]=u(i[0],i[3]),g.get_use_element(i[1],s[i[3]+1|0]);(0|A[i[2]])>0?(E.blend_first_with_tails(t),E.blend_first_with(E.is_dark()?_:c,A[i[2]],!1,!1)):E.blend_first_with_tails(t)}e(Array.of(w.subarray(0,o)))}else{for(i[3]=0;y(i[3],a+1);i[3]=p(i[3],1))s[i[3]].set_tail(s[i[3]+1|0],v[i[3]]);for(;y(i[2],i[4]);i[2]=u(i[2],1)){for(r.get_use_element(i[2],E),E.is_not_fully_transparent()&&E.set_from_simdope(U),i[0]=f(i[2],a),i[3]=0;y(i[3],i[5]);i[3]=p(i[3],1))b[i[3]].get_use_element(w[i[2]],s[i[3]+1|0]);for(i[3]=i[5];y(i[3],a);i[3]=p(i[3],1))i[1]=p(i[0],i[3]),g.get_use_element(i[1],s[i[3]+1|0]);(0|A[i[2]])>0?(E.blend_first_with_tails(t),E.blend_first_with(E.is_dark()?_:c,A[i[2]],!1,!1)):E.blend_first_with_tails(t)}e(Array.of(w.subarray(0,i[4]),n.subarray(0,i[4])))}}))},v.prototype.build=function(e,t,i,r,a){e=(0|e)>>>0,t=(0|t)>>>0,r=r||[],this.set_bytes_index(0),this.set_state(n(e,t,i)),this.set_data_array(r,a)},v.prototype.update=function(e,t,i,n,a){e=(0|e)>>>0,t=(0|t)>>>0,n=n||[],this.set_bytes_index(0),this.set_state(r(this.state,e,t,i)),this.set_data_array(n,a)},v.prototype.clear=function(){this.set_bytes_index(0),this.set_state(r(this.state,1,1)),this.set_data_array([],new Uint32Array(0))},e.exports=v},718:function(e,t,i){"use strict";!function(t){function n(e){return e&&e.__esModule?e:{default:e}}var r=n(i(715)),a=n(i(716)),o={_get_64_js:function(){return{xxh_f:{create64:function(e){return r.default.h64(e)}},xxh_v:"64",xxh_t:"js",xxh_tt:Date.now()}},_get_64_wasm:function(){return new Promise((function(e,t){try{(0,a.default)().then((function(t){e({xxh_f:{hasher:t,create64:function(e){return this.hasher.create64(BigInt(e))}},xxh_v:"64",xxh_t:"wasm",xxh_tt:Date.now()})})).catch((function(e){t()}))}catch(i){t()}}))},new:function(){var e=Uint8Array.from("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((function(e){return e.charCodeAt(0)}))),i=BigInt(e.length),n=new Uint8Array(14),r=this._get_64_js,a=this._get_64_wasm,o=r();return a().then((function(e){o=e})),{get_info:function(){return{version:o.xxh_v,type:o.xxh_t,timestamp:o.xxh_tt}},base58_that:function(r){for(var a=0,s=BigInt(0),_=(BigInt(o.xxh_f.create64(64222).update(r instanceof Uint8Array||r instanceof Uint8ClampedArray?r:new Uint8Array("string"==typeof r?t.from(r):"buffer"in r?r.buffer:r)).digest()));_>0;)s=_%i,_/=i,n[0|a]=65535&e[s],a=a+1&15;return""+String.fromCharCode.apply(null,n.slice(0,0|a))}}}};e.exports=o}(i(208).Buffer)},930:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=n(i(717)),a=i(648),o=n(i(718)),s=Object.create(o.default).new(),_={_create_state:function(e,t,i,n,r,a,o,s){var _=Array.from(n.map((function(e){return Uint16Array.from(e)}))),l=Array.from(r.map((function(e){return Uint32Array.from(e)}))),h=Array.from(a.map((function(e){return Object.assign({},e)})));return Object.assign({},{w:t|=0,h:i|=0,sp:_,spc:l,l:h,s:o,wp:s})},from:function(e,t,i,n,o,_,l,h){var c=this._create_state,d=c(e,t,i,n,o,_,l,h);return{new:function(e,t,i,n,r,a,o,s){d=c(e,t,i,n,r,a,o,s)},destroy:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};null!==d?(d=null,e()):e("ok")},render:function(){return null!==d?function(e,t,i,n,o,_,l){return new Promise((function(h,c){var d,p,u,f,m;for(_|=0,d=(e|=0)*(t|=0)|0,p=0|n.length,u=r.default.init(p,d,Uint8Array.from(o.map((function(e){return e.hidden?0:Math.round(255*parseFloat(e.opacity))})))),f=0,m=0;(0|f)<(0|d);f=(f+1|0)>>>0){for(u.for(f,0),m=0;(0|m)<(0|p);m=(m+1|0)>>>0)u.stack(0|m,n[0|m][i[0|m][0|f]]);u.next()}u.blend(!1,!1).then((function(i){var n,r,o,d,p=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i,n,r=[],a=!0,o=!1,s=void 0;try{for(i=e[Symbol.iterator]();!(a=(n=i.next()).done)&&(r.push(n.value),2!==r.length);a=!0);}catch(_){o=!0,s=_}finally{try{!a&&i.return&&i.return()}finally{if(o)throw s}}return r}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(i),u=(p[0],p[1]),f=new a.Colors(u),m=[];if(l)for(n=new a.Colors(f.get_deduplicated_uint32a()),m=Array(n.length).fill(""),r=new a.Color(new ArrayBuffer(4)),o=0;o>> 0) { full_pxls[i|0] = (pxl_colors[pxls[i|0]] | 0) >>> 0; }\n let image_data = new ImageData(new Uint8ClampedArray(full_pxls.buffer), pxl_width, pxl_height);\n \n return new Promise(function(resolve, reject) {\n createImageBitmap(image_data).then(function(r){resolve(r);});\n });\n };\n ')()},from:function(e){var t=this._create_func(),i=this._create_state,n=e||null;return{render:function(e,r,a,o,s){var _=i(e,r,a,o);n?n.exec(t,[_.w,_.h,_.p,_.pc]).catch((function(){return t(_.w,_.h,_.p,_.pc)})).then((function(e){s(e)})):t(_.w,_.h,_.p,_.pc).then((function(e){s(e)}))}}}};e.exports=n},932:function(e,t,i){"use strict";var n,r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i,n,r=[],a=!0,o=!1,s=void 0;try{for(i=e[Symbol.iterator]();!(a=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);a=!0);}catch(_){o=!0,s=_}finally{try{!a&&i.return&&i.return()}finally{if(o)throw s}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=i(654),o=i(648),s=i(688),_=i(933);a.SetFixed.compute=function(e,t,i,n){var r,a=t.bitArrayData,o=[0].concat(i.map((function(e){return e.bitArrayData})));for(r=0;(0|r)<(0|e);r=(r+1|0)>>>0)o[0]=0|r,a[0|r]=n.apply(null,o)},n={init:function(e,t,i,n,l,h){o.simdops.clamp_uint32;var c=o.simdops.plus_uint,d=o.simdops.uint_less,p=(o.simdops.int_less,o.simdops.uint_equal,o.simdops.uint_not_equal,o.simdops.clamp_uint8,{index_changes:new Uint32Array(0),color_changes:new Uint32Array(0),_pxl_indexes_updated:new a.SetFixed(0),_pxl_indexes_of_selection_drawn:new a.SetFixed(0),_pxl_indexes_of_current_shape:new a.SetFixed(0),_pxl_indexes_of_old_shape:new a.SetFixed(0),_old_pxls_hovered:new a.SetFixed(0),_old_selection_pair_highlight:!0,_old_layers_string_id:"",_old_pxl_width:0,_old_pxl_height:0,_last_paint_timestamp:0,_is_there_new_dimension:!0,_did_hide_canvas_content:!1,_previous_imported_image_pxls_positioned_keyset:new a.SetFixed(0)}),u={super_state:e,super_canvas:t,super_blend:i,canvas_pos:n,color_conversion:l,sraf:h},f={position:function(){},selection:function(){},color:function(){},action:function(){},update:function(){}},m=(new Uint32Array(0),new Uint32Array(0),""),g=void 0,A=u.canvas_pos.get_state().sizes,y=function e(t,i,n,r){var a,o,s,_,l,h,c;p._last_paint_timestamp>=r?t():(a=p._old_pxl_width,o=p._old_pxl_height,_=(s=u.super_state.get_state()).pxl_width,l=s.pxl_height,u.super_canvas.ok()?(A=u.canvas_pos.get_state().sizes,h=!(parseInt(a)===parseInt(_)&&parseInt(o)===parseInt(l)),(c=parseInt(A.width)!==parseInt(_)||parseInt(A.height)!==parseInt(l))||h?(u.super_state.set_state({pxl_width:parseInt(A.width),pxl_height:parseInt(A.height)}),p._is_there_new_dimension=!0,f.update(!1,!1).then((function(){setTimeout((function(){p._is_there_new_dimension=!1,f.update(!1,!1)}),500),g(h,c,n,r).catch((function(){setTimeout(e,1,t,i,n,r)}))})).catch((function(){setTimeout(e,2,t,i,n,r)}))):g(h,c,n,r).catch((function(){setTimeout(e,1,t,i,n,r)}))):setTimeout(e,3,t,i,n,r))},v=new a.SetFixed(A.width*A.height),w=function(e,i,n,r,o,s){var _,l,h,f,m,g,A,w,x,b,C,E,U,I,S,R,T,B,F,P,O,k,M,Q,D,N,L,Y,G,V,j,z,K,X,J,q,W,H,Z,$,ee,te,ie,ne,re,ae,oe,se,_e,le,he,ce,de,pe,ue,fe,me,ge,Ae,ye;if(p._last_paint_timestamp>=s)e();else{for(_=function(){setTimeout(y,1,e,i,o,s)},l=function(e,t){return((e=(0|e)>>>0)^(t=(0|t)>>>0))>>>0},h=function(e,t){return((e=(0|e)>>>0)&(t=(0|t)>>>0))>>>0},f=function(e,t){return((e=(0|e)>>>0)|(t=(0|t)>>>0))>>>0},m=function(e,t,i,n,r,a,o,s,_){return e=(0|e)>>>0,f(Ae[0],f(f(f(t[e],i[e]),l(n[e],r[e])),f(f(l(a[e],o[e]),h(a[e],ge[0])),f(s[e],_[e]))))},g=p._is_there_new_dimension,A=p._did_hide_canvas_content,w=p._old_pxls_hovered,x=p._old_layers_string_id,b=p._pxl_indexes_of_old_shape,C=p._pxl_indexes_of_current_shape,E=p._pxl_indexes_of_selection_drawn,U=p._previous_imported_image_pxls_positioned_keyset,I=p._old_selection_pair_highlight,R=(S=u.super_state.get_state())._s_layers,T=S._layer_index,B=S._layers,F=S.select_mode,P=S.hide_canvas_content,O=S.pxl_width,k=S.pxl_height,M=S._pxls_hovered,Q=S.tool,D=S._shape_index_a,N=S._select_shape_index_a,L=S._pxl_indexes_of_selection,Y=S._paint_or_select_hover_pxl_indexes,G=S._selection_pair_highlight,j=(V=u.super_state.get_imported_image_data()).imported_image_pxls_positioned,z=V.imported_image_pxl_colors,K=V.imported_image_pxls_positioned_keyset,X=V.image_imported_resizer_index,J=K.size>0,q=0|R.length,W=R[0].indexes.length,Z=(H=q+(J?1:0))-1,$=""+Array.from(B).map((function(e,t){return t+"-id-"+e.id+"-v-"+(e.hidden||P?"0":"1")+"-o-"+parseInt(255*e.opacity).toString(16)+"-w-"+e.width+"-h-"+e.height+"-end"})).join("+"),ee=A!==P||x!==$||g||n||o,te=Uint8Array.from(B.map((function(e){return parseInt(e.hidden||P?0:Math.round(255*parseFloat(e.opacity)))})).concat(J?[196]:[])),"LINE"!==Q&&"RECTANGLE"!==Q&&"ELLIPSE"!==Q&&"TRIANGLE"!==Q||-1===D||-1===M?"SELECT LINE"!==Q&&"SELECT RECTANGLE"!==Q&&"SELECT ELLIPSE"!==Q||-1===N||-1===M?("SELECT PATH"===Q||"CONTOUR"===Q)&&Y.size>0&&(ie=Y[0],ne=Y[Y.size-1],re=u.super_state.shape_creator.from_line(ie,ne),"REMOVE"===F&&"SELECT PATH"===Q?re.forEach((function(e){L.delete(e)})):"SELECT PATH"===Q?re.forEach((function(e){L.add(e)})):re.forEach((function(e){C.add(e)}))):C="SELECT LINE"===Q?u.super_state.shape_creator.from_line(N,M,C):"SELECT RECTANGLE"===Q?u.super_state.shape_creator.from_rectangle(N,M,C):"SELECT ELLIPSE"===Q?u.super_state.shape_creator.from_ellipse(N,M,C):C:C="LINE"===Q?u.super_state.shape_creator.from_line(D,M,C):"RECTANGLE"===Q?u.super_state.shape_creator.from_rectangle(D,M,C):"ELLIPSE"===Q?u.super_state.shape_creator.from_ellipse(D,M,C):C,ae=0,oe=0,se=R[T]||{},_e=u.super_canvas.render.bind(u.super_canvas),he=(le=u.super_blend).for.bind(le),ce=le.next.bind(le),de=le.stack.bind(le),pe=G!==I,le.update(0|H,0|W,te,R,t.getUint32()),ue=C.has.bind(C),fe=L.has.bind(L),me=K.has.bind(K),ge=pe?Uint32Array.of(4294967295):Uint32Array.of(0),Ae=ee?Uint32Array.of(4294967295):Uint32Array.of(0),X>=0&&C.add(X),C.add(M),v.length!==W&&(v=new a.SetFixed(W)),a.SetFixed.compute(W,v,Array.of(se.setFixed,w,b,C,E,L,U,K),m),ye=v.has.bind(v);d(oe,W);oe=c(oe,1))ye((0|oe)>>>0)&&(ue((0|oe)>>>0)?he((0|oe)>>>0,128):fe(oe)?he((0|oe)>>>0,72+48*((ae=oe%O|0)+((oe-ae)/O|0)+(G?1:0)&1)|0):he((0|oe)>>>0,0),me(oe)&&de((0|Z)>>>0,(0|z[0|j[(0|oe)>>>0]])>>>0),ce());le.blend(!1,!1).then((function(t){t[0].length>0||ee||n||o?u.super_canvas.check(O,k).catch(_).then((function(){u.super_canvas.prender().finally((function(){w.clearAndBulkAdd(Uint32Array.of(X,M)),se.clear_changes(),E.setFromSetFixed(L),U.setFromSetFixed(K),u.sraf.run_frame((function(){return p._old_selection_pair_highlight=G,p._old_layers_string_id=""+$,p._did_hide_canvas_content=!!P,p._old_pxl_width=parseInt(O),p._old_pxl_height=parseInt(k),p._last_paint_timestamp=+s,b.setFromSetFixed(C),C.clear(),_e()}),!1,ee||n||o,Date.now(),"render").finally(e)}))})):e()}))}};return{get:function(){return p},set:function(e){for(m in e)p[m]=e[m];return Promise.resolve()},set_notifiers:function(){f={position:arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},selection:arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},color:arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},action:arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},update:arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){}}},is_there_new_dimension:function(){return p._is_there_new_dimension&&!0},update_canvas:function(e,t){return e=e||!1,t=t||Date.now(),void 0===g&&this&&(g=this.render_canvas),new Promise(y)},render_canvas:function(e,t,i,n){return new Promise(w)},_should_remove_not_perfect_second_latest_pixel_from_array:function(e){var t,i,n,r,a,o,s,_,l,h=u.super_state.get_state().pxl_width;return e.size>=3&&(n=((t=0|e[e.size-1])-(i=t%h|0))/h,o=((r=0|e[e.size-2])-(a=r%h|0))/h,l=((s=0|e[e.size-3])-(_=s%h|0))/h,1==(0|Math.abs(i-_))&&1==(0|Math.abs(n-l))&&(i===a&&o===l||n===o&&a===_))},_handle_canvas_mouse_move:function(e){var t,i,n,o,s,l,h,c,d,p,f,m,g,A,y,v,w,x,b,C,E,U,I,S,R,T,B,F,P,O=this,k=u.super_state.get_state(),M=k._pxl_indexes_of_selection,Q=k._imported_image_pxls,D=k.pxl_current_color_uint32,N=k.tool,L=k.pxl_width,Y=k.pxl_height,G=k._pxls_hovered,V=k.hide_canvas_content,j=k._is_on_resize_element,z=k._paint_or_select_hover_pxl_indexes,K=k._paint_hover_old_pxls_snapshot,X=k._last_action_timestamp,J=k._paint_or_select_hover_pxl_indexes_exception,q=k._paint_or_select_hover_actions_latest_index,W=k._s_layers,H=k._layer_index,Z=k.pxl_current_opacity,$=k._select_hover_old_pxls_snapshot,ee=k.select_mode,te=u.canvas_pos.get_pointer_state(),ie=te.event_button,ne=te.mouse_down,re=ie+1|0,ae=W[H]||{},oe=u.canvas_pos.get_canvas_pos_from_event(e.pageX,e.pageY),se=r(oe,2),_e=se[0],le=se[1],he=le*L+_e|0;-1==(0|_e)||-1==(0|le)?this._notify_position_change({x:_e,y:le}):(0|he)==(0|G)||V?G!==he&&u.super_state.set_state({_pxls_hovered:0|he,_mouse_inside:!0}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})})):Q.length>0?(i=(t=u.super_state.get_state())._imported_image_move_from,n=t._imported_image_scale_delta_x,o=t._imported_image_scale_delta_y,s=t._imported_image_start_x,l=t._imported_image_start_y,m=(0|he)==(0|(f=s+(d=(h=t._imported_image_width)+n)+(l+(p=(c=t._imported_image_height)+o))*L))||(0|G)==(0|f),g=0,A=_e-i[0],y=le-i[1],i=Array.of(_e,le),1===re&&ne?m||j?(g=o+y|0,n=0|Math.max(n+A|0,-(h-1)),o=0|(g=0|Math.max(g,-(c-1))),u.super_state.set_state({_pxls_hovered:0|he,_is_on_resize_element:m,_mouse_inside:!0,_imported_image_scale_delta_x:n,_imported_image_scale_delta_y:o,_imported_image_move_from:Array.of(i[0],i[1])}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})}))):(s=(s=(s=s+A|0)<-d?-d:0|s)>=L?L:0|s,l=(l=(l=l+y|0)<-p?-p:0|l)>=Y?Y:0|l,u.super_state.set_state({_pxls_hovered:0|he,_is_on_resize_element:m,_mouse_inside:!0,_imported_image_start_x:s,_imported_image_start_y:l,_imported_image_move_from:Array.of(i[0],i[1])}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})}))):u.super_state.set_state({_pxls_hovered:0|he,_is_on_resize_element:m,_mouse_inside:!0}).then((function(){O._notify_position_change({x:_e,y:le})}))):"PENCIL"!==N&&"PENCIL PERFECT"!==N&&"CONTOUR"!==N||1!==re||!ne?"SELECT PIXEL"!==N&&"SELECT PIXEL PERFECT"!==N&&"SELECT PATH"!==N||1!==re||!ne?((P=u.super_state.get_state())._s_layers,P._layer_index,z.clear(),u.super_state.set_state({_pxls_hovered:0|he,_mouse_inside:!0,_paint_or_select_hover_actions_latest_index:-1,_paint_or_select_hover_pxl_indexes:z}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})}))):(-1===q&&(q=he),T=u.super_state.shape_creator.from_line(q,he),"SELECT PATH"===N?(X=1/0,T.forEach((function(e){z.add(0|e)}))):"SELECT PIXEL"===N?(X=Date.now(),T.forEach((function(e){z.add(0|e)}))):"SELECT PIXEL PERFECT"===N&&(X=Date.now(),T.forEach((function(e){z.add(0|e)})),B=z.indexes,this._should_remove_not_perfect_second_latest_pixel_from_array(B)&&(F=B[B.length-2],$.includes(F)||"ADD"!==ee&&"REPLACE"!==ee||M.delete(F),z.delete(F))),"REPLACE"===ee&&M.clear(),z.forEach((function(e){"ADD"===ee||"REPLACE"===ee?M.add(e):M.delete(e)})),u.super_state.set_state({_pxls_hovered:0|he,_mouse_inside:!0,_pxl_indexes_of_selection:M,_paint_or_select_hover_pxl_indexes:z,_paint_or_select_hover_actions_latest_index:he,_last_action_timestamp:X}).then((function(){O.update_canvas(),O._notify_is_something_selected(),O._notify_position_change({x:_e,y:le})}))):(-1===q&&(q=0|he),z=u.super_state.shape_creator.from_line(q,he,z),w=(v=u.super_state.get_state()).pencil_mirror_mode,x=v._pencil_mirror_index,C=(x-(b=x%L))/L,"CONTOUR"===N?X=1/0:"PENCIL"===N?X=Date.now():"PENCIL PERFECT"===N&&(X=Date.now(),J.forEach((function(e){z.delete(e)})),this._should_remove_not_perfect_second_latest_pixel_from_array(z.indexes)&&(E=z[z.size-2],z.delete(E),J.add(E),(U=new _.Set(Array.of(E))).forEach((function(e){var t=r(e,2),i=t[0],n=t[1],a=i-2*(i-b);a>=0&&a=0&&n<=Y&&U.add(n*L+a)})),U.forEach((function(e){ae.set_uint32(e,K[e])})))),"NONE"!==w?(I=new a.SetFixed(z),S=new _.Set(z.filter((function(e){return!I.has(0|e)&&!J.has(0|e)})).map((function(e){var t=e%L|0;return[0|t,0|(e-t)/L]}))),"VERTICAL"!==w&&"BOTH"!==w||S.forEach((function(e){var t=r(e,2),i=t[0],n=t[1],a=n-2*(n-C),o=i;o>=0&&o=0&&a<=Y&&S.add([o,a])})),"HORIZONTAL"!==w&&"BOTH"!==w||S.forEach((function(e){var t=e[1],i=e[0]-2*(e[0]-b);i>=0&&i=0&&t<=Y&&S.add([i,t])})),R=new a.SetFixed(L*Y),S.forEach((function(e){var t=e[1],i=e[0];R.add(t*L+i|0)})),u.super_state.paint_shape(R,D,Z,{_pxls_hovered:0|he,_mouse_inside:!0,_paint_or_select_hover_pxl_indexes:z,_paint_or_select_hover_pxl_indexes_exception:J,_paint_or_select_hover_actions_latest_index:0|he,_last_action_timestamp:X},(function(){O.update_canvas()}))):u.super_state.paint_shape(z.indexes,0|D,Z,{_pxls_hovered:0|he,_mouse_inside:!0,_paint_or_select_hover_pxl_indexes:z,_paint_or_select_hover_pxl_indexes_exception:J,_paint_or_select_hover_actions_latest_index:0|he,_last_action_timestamp:X},(function(){O.update_canvas()})),this._notify_position_change({x:0|_e,y:0|le}))},_notify_position_change:function(e,t){var i,n;t=t||Date.now(),i=0|u.super_state.get_notified_pos_at(),((n=0|Date.now())-i|0)>=100&&null==t||(0|t)>(0|i)&&(n-t|0)>=100?(e={x:void 0===e.x?-1:e.x,y:void 0===e.y?-1:e.y},u.super_state.set_state({_notified_position_at:n}).then((function(){f.position(e,u.sraf.get_state().previous_cpaf_fps)}))):(0|n)<(t+100|0)&&setTimeout(this._notify_position_change,100-(t-n|0)|0,{x:e.x,y:e.y},0|n)},_handle_canvas_mouse_up:function(){var e,t,i,n,r=this,a=u.super_state.get_state(),o=a._paint_or_select_hover_pxl_indexes,s=a.tool,_=a._imported_image_pxls,l=a._pxl_indexes_of_selection,h=a.select_mode;_.length>0?u.super_state.set_state({_imported_image_move_from:[-1,-1]}):o.size>0&&"CONTOUR"===s?(t=(e=u.super_state.get_state()).pxl_current_opacity,i=e.pxl_current_color_uint32,u.super_state.paint_shape(u.super_state.shape_creator.from_path(o.indexes),i,t,{_last_action_timestamp:Date.now()},(function(){o.clear(),r.update_canvas()}))):o.size>0&&"SELECT PATH"===s&&(n=u.super_state.shape_creator.from_path(o.indexes),"REPLACE"===h&&l.clear(),"ADD"===h||"REPLACE"===h?n.forEach((function(e){l.add(e)})):n.forEach((function(e){l.delete(e)})))},_handle_canvas_mouse_down:function(e){var t,i,n,o,l,h,c,d,p,f,m,g,A,y,v,w,x,b,C,E,U,I,S,R,T,B,F,P,O,k,M,Q,D,N,L,Y,G,V,j,z,K,X,J,q,W,H,Z,$,ee,te,ie,ne,re,ae,oe,se,_e,le,he,ce,de,pe,ue,fe,me,ge,Ae,ye,ve,we,xe,be,Ce,Ee,Ue=this,Ie=u.super_state.get_state(),Se=Ie.pxl_current_color,Re=Ie.pxl_current_color_uint32,Te=Ie.hide_canvas_content,Be=Ie.tool,Fe=Ie.pxl_width,Pe=Ie.pxl_height,Oe=Ie.pxl_current_opacity,ke=Ie.bucket_threshold,Me=Ie.select_mode,Qe=e.button+1,De=-1,Ne=-1;if(-1!==u.super_state.get_state()._pxls_hovered&&null===e?(De=t=u.super_state.get_state()._pxls_hovered%Fe,Ne=(u.super_state.get_state()._pxls_hovered-t)/Fe):e&&(i=u.canvas_pos.get_canvas_pos_from_event(e.pageX,e.pageY),De=(n=r(i,2))[0],Ne=n[1]),-1!==De&&-1!==Ne)if(l=(o=u.super_state.get_state())._shape_index_a,h=o._select_shape_index_a,o._shape_index_b,o._select_shape_index_b,c=o._pxl_indexes_of_selection,d=o._s_layers,p=o._layer_index,f=o.hue,m=Ne*Fe+De,y=void 0!==(A=void 0!==(g=d[p]||{})?g.indexes:void 0)?A[m]:-1,-1!==Qe){if(3===Qe&&(l=-1,h=-1),v=u.super_state.get_state()._imported_image_pxls,u.super_state.set_state({_pxls_hovered:0|m,_mouse_inside:!0,_paint_or_select_hover_actions_latest_index:-1,_paint_hover_old_pxls_snapshot:g.indexes_copy||new Uint8Array(0),_select_hover_old_pxls_snapshot:new a.SetFixed(c)}),!Te)if(w=g.indexes_copy||new Uint8Array(0),x=Array.from(g.colors_copy||new Uint32Array(0)),v.length>0&&1===Qe)u.super_state.set_state({_imported_image_move_from:[De,Ne]});else if(2===Qe||"MOVE"===Be&&v.length<=0&&(1===Qe||-1===Qe))u.super_state.set_state({_imported_image_move_from:[e.x,e.y]});else if("PICKER"===Be&&1===Qe)b=this.get_pixel_color_from_pos(De,Ne),this._notify_current_color_change(b),this._notify_relevant_action_event(e,b,1);else if("EXCHANGE"===Be&&1===Qe)C=g.colors[y],this.exchange_pixel_color(C,Re),this._notify_relevant_action_event(e,Re,1);else if("LINE"===Be||"RECTANGLE"===Be||"ELLIPSE"===Be)if(-1===l)1===Qe?u.super_state.set_state({_shape_index_a:m}).then((function(){Ue.update_canvas()})):u.super_state.set_state({_shape_index_a:l}).then((function(){Ue.update_canvas()}));else{switch(E=void 0,Be){case"LINE":E=u.super_state.shape_creator.from_line(l,m);break;case"RECTANGLE":E=u.super_state.shape_creator.from_rectangle(l,m);break;case"ELLIPSE":E=u.super_state.shape_creator.from_ellipse(l,m)}u.super_state.paint_shape(E.indexes,Re,Oe,{_shape_index_a:-1,_last_action_timestamp:Date.now()},(function(){Ue.update_canvas()})),this._notify_relevant_action_event(e,"#ffffffff",.6)}else if("SELECT LINE"===Be||"SELECT RECTANGLE"===Be||"SELECT ELLIPSE"===Be)-1===h?1===Qe?u.super_state.set_state({_select_shape_index_a:m}).then((function(){Ue.update_canvas()})):u.super_state.set_state({_select_shape_index_a:h}).then((function(){Ue.update_canvas()})):(U="SELECT LINE"===Be?u.super_state.shape_creator.from_line(h,m):"SELECT RECTANGLE"===Be?u.super_state.shape_creator.from_rectangle(h,m):u.super_state.shape_creator.from_ellipse(h,m),"REPLACE"===Me&&c.clear(),"ADD"===Me||"REPLACE"===Me?U.forEach((function(e){c.add(e)})):U.forEach((function(e){c.delete(e)})),U.clear(),u.super_state.set_state({_pxl_indexes_of_selection:c,_select_shape_index_a:-1,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()})));else if("SELECT PIXEL"!==Be&&"SELECT PATH"!==Be||1!==Qe)if("SET PENCIL MIRROR"===Be&&1===Qe)u.super_state.set_state({_pencil_mirror_index:m,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas()}));else if("PENCIL"!==Be&&"PENCIL PERFECT"!==Be&&"CONTOUR"!==Be||1!==Qe)if("BUCKET"!==Be&&"HUE BUCKET"!==Be&&"SELECT COLOR THRESHOLD"!==Be&&"BORDER"!==Be||1!==Qe)"SELECT COLOR"===Be&&1===Qe&&(u.super_state.get_state()._s_layers,Ee=g.indexes[m],"REPLACE"===Me&&c.clear(),g.indexes.forEach((function(e,t){e===Ee&&("ADD"===Me||"REPLACE"===Me?c.add(t):c.delete(t))})),u.super_state.set_state({_pxl_indexes_of_selection:c,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()})));else{for(Y=(L=u.super_state.get_state())._s_layers,G=L._layer_index,V=g.indexes,j=[De,Ne],z=V[m],K=x[z],X=[],J=u.color_conversion.to_rgba_from_uint32(K),W=(q=r(J,4))[0],H=q[1],Z=q[2],$=q[3],ee=u.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(W,H,Z,$)),ie=(te=r(ee,4))[0],te[1],te[2],te[3],ne=ie=0&&e=0&&e=0&&oe(ue);)ue-=Fe,pe--;for(ue+=Fe,pe++,_e=!1,le=!1;pe0&&(oe(ue-1)?_e||(re.push([de-1,pe-1]),_e=!0):_e&&(_e=!1)),de+1=0&&O=0&&P<=Pe&&(F.add(Array.of(O,P)),k=P*Fe+O,M=g.indexes[k],Q=x[M],D=u.color_conversion.blend_colors(Q,Re,Oe,!0,!1),-1===(N=x.indexOf(D))&&(N=x.push(D)),w[k]=N)),"HORIZONTAL"!==S&&"BOTH"!==S||F.forEach((function(e){var t,i,n,r,a,o=e[1],s=e[0]-2*(e[0]-T);s>=0&&s=0&&o<=Pe&&(t=o*Fe+s,i=g.indexes[t],n=x[i],r=u.color_conversion.blend_colors(n,Re,Oe,!0,!1),-1===(a=x.indexOf(r))&&(a=x.push(r)),w[t]=a)})),u.super_state.paint_shape([m],Re,Oe,{_paint_or_select_hover_pxl_indexes:new a.SetFixed([m]),_paint_or_select_hover_actions_latest_index:m,_paint_hover_old_pxls_snapshot:g.indexes_copy||new Uint8Array(0),_last_action_timestamp:Date.now()},(function(){Ue.update_canvas()}));else"REPLACE"===Me&&c.clear(),"ADD"===Me||"REPLACE"===Me?c.add(m):c.delete(m),"SELECT PIXEL"===Be?u.super_state.set_state({_pxl_indexes_of_selection:c,_paint_or_select_hover_actions_latest_index:m,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()})):"SELECT PATH"===Be&&u.super_state.set_state({_pxl_indexes_of_selection:c,_paint_or_select_hover_actions_latest_index:m,_last_action_timestamp:1/0}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()}))}else u.super_state.set_state({_pxls_hovered:m}).then((function(){Ue.update_canvas()}))},_notify_is_something_selected:function(){var e=u.super_state.get_state()._pxl_indexes_of_selection;!!u.super_state.get_state()._previous_pxl_indexes_of_selection.size!=!!e.size&&u.super_state.set_state({_is_something_selected:!!e.size,_previous_pxl_indexes_of_selection:new a.SetFixed(e)}).then((function(){f.selection(!!e.size)}))},get_pixel_color_from_pos:function(e,t){var i,n,r=u.super_state.get_state(),a=r.pxl_height,s=r.pxl_width,_=r._s_layers,l=r._layers,h=t*s+e;if(e>s||t>a||e<0||t<0)return"#00000000";for(i=o.Color.new_zero(),n=0;n<_.length;n++)void 0!==l[n]&&(l[n].hidden||i.blend_first_with(o.Color.new_uint32(_[n].get_uint32(0|h)),Math.round(255*parseFloat(l[n].opacity)),!1,!1));return i.hex},_notify_current_color_change:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=u.color_conversion.format_hex_color(e),f.color?f.color(e,t):u.super_state.set_state({pxl_current_color:e})},_notify_relevant_action_event:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;f.action&&("number"==typeof t&&(t=o.Color.new_uint32(t).hex),f.action(e,t,i))},exchange_pixel_color:function(e,t){var i,n,a,o,_,l,h=this,c=u.super_state.get_state(),d=c._s_layers,p=c.pxl_width,f=c.pxl_height,m=c._layer_index,g=d[m]||{},A=g.indexes,y=g.colors.indexOf(e);g.colors.includes(t)||((i=new Uint32Array(g.colors.length+1)).set(g.colors,0),i[i.length-1]=(0|t)>>>0,g.set_colors(i,!0)),n=g.colors.indexOf(t),A=A.map((function(e){return e===y?n:e})),a=u.color_conversion.clean_duplicate_colors(A,g.colors),_=(o=r(a,2))[0],l=o[1],d[m]=s.Layer.new_from_colors_and_indexes(l,_,p,f,!0),u.super_state.set_state({_s_layers:d,_last_action_timestamp:Date.now()}).then((function(){h.update_canvas()}))}}}},e.exports=n},937:function(e,t,i){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),n=function(){function e(e,t){var i,n;for(i=0;i>2,t instanceof o.SetFixed||t instanceof Set)for(r=0;(0|r)<(0|n);r=(r+1|0)>>>0)(0|i[r<<2])>128&&t.add(0|r);else for(a=0;(0|a)<(0|n);a=(a+1|0)>>>0)(0|i[a<<2])>128&&(t[0|a]=1);return t}),h=function(e,t,i){var n,r=void 0!==i?i.canvas:void 0;return void 0===r?("OffscreenCanvas"in window?r=new OffscreenCanvas(e,t):((r=document.createElement("canvas")).width=e,r.height=t),(n=r.getContext("2d",{willReadFrequently:!0})).imageSmoothingEnabled=!1,n):(r.height===t&&r.width===e||(r.width=e,r.height=t),i)},c=function(e,t,i){var n,r;return t|=0,n={x:0,y:0},(r={x:0,y:0}).x=(i|=0)%(e|=0)|0,n.x=t%e|0,n.y=(t-n.x)/e|0,r.y=(i-r.y)/e|0,{primary:n,secondary:r}},d=function(){function e(t,i){n(this,e),this.new_canvas_context_2d=h,this.get_shadow_indexes_from_canvas_context=l,this.get_opposite_coordinates=c,this.width=0|t,this.height=0|i,this.context=this.new_canvas_context_2d(this.width,this.height)}return a(e,[{key:"from_text",value:function(e,t,i){return this.context.clearRect(0,0,this.width,this.height),this.context.font=e+'px "Industry Book"',this.context.fillStyle="#ffffffff",this.context.textAlign="center",this.context.fillText(t,this.width/2,this.height/2),this.get_shadow_indexes_from_canvas_context(this.context,i)}},{key:"from_border",value:function(e,t,i,n){var r,a=this;return t=t||!0,i=i||!1,r=new o.SetFixed(this.width*this.height),e.forEach((function(n,o){var s,_,l,h,c=void 0,d=void 0,p=void 0,u=void 0;c=(c=n-a.width)<0?-1:c,d=(d=n+1)%a.width==0?-1:d,p=(p=n+a.width)>a.width*a.height?-1:p,u=(u=n-1)%a.width==a.width-1?-1:u,s=void 0,_=void 0,l=void 0,h=void 0,s=c-1,s=-1===c||-1===u?-1:s,_=c+1,_=-1===c||-1===d?-1:_,l=p-1,l=-1===p||-1===u?-1:l,h=p+1,h=-1===p||-1===d?-1:h,t?(e.has(c)&&-1!==c&&e.has(d)&&-1!==d&&e.has(p)&&-1!==p&&e.has(u)&&-1!==u||r.add(0|n),i&&(e.has(s)&&-1!==s&&e.has(_)&&-1!==_&&e.has(l)&&-1!==l&&e.has(h)&&-1!==h||r.add(0|n))):(e.has(c)||r.add(c),e.has(d)||r.add(d),e.has(p)||r.add(p),e.has(u)||r.add(u),i&&(e.has(s)||r.add(s),e.has(_)||r.add(_),e.has(l)||r.add(l),e.has(h)||r.add(h)))})),r}},{key:"from_path",value:function(e,t){var i,n=this;return t=void 0===t?new o.SetFixed(this.width*this.height):t,this.context.lineWidth=1,this.context.clearRect(0,0,this.width,this.height),this.context.save(),i=0,e.forEach((function(e){var t=e%n.width,r=Math.floor(e/n.width);0===i?(n.context.moveTo(t,r),n.context.beginPath()):n.context.lineTo(t,r),i++})),i>0&&(this.from_line(e[0],e[e.length-1],new Set).forEach((function(e){var t=e%n.width,i=Math.floor(e/n.width);n.context.lineTo(t,i)})),this.context.strokeStyle="rgba(255, 255, 255, 1)",this.context.fillStyle="rgba(255, 255, 255, 1)",this.context.fill(),this.context.stroke()),this.get_shadow_indexes_from_canvas_context(this.context,t)}},{key:"from_line",value:function(e,t,i){var n,r,a,s,_,l,h;if(e|=0,t|=0,i=void 0===i?new o.SetFixed(this.width*this.height):i,n=this.get_opposite_coordinates(this.width,e,t),r=0|Math.abs(n.secondary.x-n.primary.x),a=0|Math.abs(n.secondary.y-n.primary.y),s=(0|n.primary.x)<(0|n.secondary.x)?1:-1,_=(0|n.primary.y)<(0|n.secondary.y)?1:-1,l=r-a|0,h=0,i instanceof o.SetFixed)for(;i.add(n.primary.y*this.width+n.primary.x|0),(0|n.primary.x)!=(0|n.secondary.x)||(0|n.primary.y)!=(0|n.secondary.y);)(0|(h=l+l|0))>(0|-a)&&(l=l-a|0,n.primary.x=n.primary.x+s|0),(0|h)<(0|r)&&(l=l+r|0,n.primary.y=n.primary.y+_|0);else for(;i[n.primary.y*this.width+n.primary.x|0]=1,(0|n.primary.x)!=(0|n.secondary.x)||(0|n.primary.y)!=(0|n.secondary.y);)(0|(h=l+l|0))>(0|-a)&&(l=l-a|0,n.primary.x=n.primary.x+s|0),(0|h)<(0|r)&&(l=l+r|0,n.primary.y=n.primary.y+_|0);return i}},{key:"from_rectangle",value:function(e,t,i){var n,r,a,s,_,l,h,c,d,p,u;if(e|=0,t|=0,n=void 0===i?new o.SetFixed(this.width*this.height):i,r=this.get_opposite_coordinates(this.width,e,t),a=Math.abs(r.primary.x-r.secondary.x|0)+1|0,s=Math.abs(r.primary.y-r.secondary.y|0)+1|0,_=Math.max(r.primary.x,0|r.secondary.x)-(a-1|0)|0,l=Math.max(r.primary.y,0|r.secondary.y)-(s-1|0)|0,h=a*s|0,c=0,d=0,n instanceof o.SetFixed)for(p=0;p>>0)d=(p-(c=p%a|0)|0)/a|0,n.add((l+d|0)*this.width+(_+c|0)|0);else for(u=0;u>>0)n[(l+(d=(u-(c=u%a|0)|0)/a|0)|0)*this.width+(_+c)|0]=1;return n}},{key:"from_ellipse",value:function(e,t,i){var n,r,a,s,_,l,h;return e|=0,t|=0,i=void 0===i?new o.SetFixed(this.width*this.height):i,n=this.get_opposite_coordinates(0|this.width,0|e,0|t),r=Math.abs(n.primary.x-n.secondary.x)+1,a=Math.abs(n.primary.y-n.secondary.y)+1,l=Math.max(n.primary.x,n.secondary.x)-(r-1)+(s=r/2),h=Math.max(n.primary.y,n.secondary.y)-(a-1)+(_=a/2),this.context.lineWidth=1,this.context.clearRect(0,0,this.width,this.height),this.context.save(),this.context.translate(l,h),this.context.scale(s,_),this.context.beginPath(),this.context.arc(0,0,1,0,2*Math.PI),this.context.restore(),this.context.fillStyle="rgba(255, 255, 255, 1)",this.context.strokeStyle="rgba(255, 255, 255, 1)",this.context.stroke(),this.context.fill(),this.get_shadow_indexes_from_canvas_context(this.context,i)}}]),e}(),p=function(){function e(t,i){n(this,e),this.shape_creator=new d(t.pxl_width,t.pxl_height),this.state_={_id:parseInt(1e3*Math.random()*1e3).toString(16)+"",className:t.className||null,perspective:t.perspective||0,animation:t.animation||!0,animation_duration:t.animation_duration||60,move_using_full_container:t.move_using_full_container,dont_compute_base64_original_image:t.dont_compute_base64_original_image||!1,dont_change_img_size_onload:t.dont_change_img_size_onload||!1,dont_show_canvas_until_img_set:t.dont_show_canvas_until_img_set||!1,show_image_only_before_canvas_set:t.show_image_only_before_canvas_set||!1,dont_show_canvas:t.dont_show_canvas||!1,but_show_canvas_once:t.but_show_canvas_once||!1,has_shown_canvas_once:!1,tool:t.tool||"PENCIL",select_mode:t.select_mode||"REPLACE",pencil_mirror_mode:t.pencil_mirror_mode||"NONE",hue:t.hue||0,pxl_width:32,pxl_height:32,pxl_current_color:t.pxl_current_color||"#00000000",pxl_current_color_uint32:s.Color.new_hex(t.pxl_current_color||"#00000000").uint32,pxl_current_opacity:t.pxl_current_opacity||1,bucket_threshold:t.bucket_threshold||0,color_loss:t.color_loss||.25,default_size:t.default_size||96,ideal_size:t.ideal_size||t.default_size||96,max_size:t.max_size||2*t.default_size||192,px_per_px:t.px_per_px||1,fast_drawing:t.fast_drawing||!1,canvas_border_radius:t.canvas_border_radius||0,canvas_wrapper_background_color:t.canvas_wrapper_background_color||"#020529",canvas_wrapper_background_color_focused:t.canvas_wrapper_background_color_focused||"#000000",canvas_wrapper_border_radius:t.canvas_wrapper_border_radius||4,show_original_image_in_background:t.show_original_image_in_background||!1,show_transparent_image_in_background:t.show_transparent_image_in_background||!1,hide_canvas_content:t.hide_canvas_content||!1,_pencil_mirror_index:-1,_previous_pencil_mirror_axes_indexes:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_previous_pencil_mirror_axes_hover_indexes:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_base64_original_images:[],_original_image_index:-1,_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_layers_defined_at:0,_layer_index:0,_current_layer:new _.Layer(Uint32Array.of(0),1,1),_s_layers:[new _.Layer(Uint32Array.of(0),new Uint16Array((t.pxl_width||32)*(t.pxl_height||32)).fill(0),t.pxl_width||32,t.pxl_height||32,!0)],_json_state_history:{history_position:0,state_history:[]},_saving_json_state_history_running:!1,_pxls_hovered:-1,_canvas_container:null,_canvas_wrapper:null,_canvas_wrapper_overflow:null,_state_history_length:100,_last_action_timestamp:Date.now(),_lazy_lazy_compute_time_ms:1e4,_undo_buffer_time_ms:parseInt(parseInt(t.pxl_width||32)+parseInt(t.pxl_height||32)+1e3),_mouse_inside:!1,_paint_hover_old_pxls_snapshot:new Uint16Array((t.pxl_width||32)*(t.pxl_height||32)).fill(0),_select_hover_old_pxls_snapshot:new Uint16Array,_paint_or_select_hover_actions_latest_index:-1,_paint_or_select_hover_pxl_indexes:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_pxl_indexes_newly_painted:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_paint_or_select_hover_pxl_indexes_exception:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_shape_index_a:-1,_select_shape_index_a:-1,_shape_index_b:-1,_select_shape_index_b:-1,_pxl_indexes_of_selection:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_previous_pxl_indexes_of_selection:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_imported_image_previous_start_x:0,_imported_image_previous_start_y:0,_imported_image_start_x:0,_imported_image_start_y:0,_imported_image_pxls:[],_imported_image_width:0,_imported_image_height:0,_imported_image_scale_delta_x:0,_imported_image_scale_delta_y:0,_imported_image_previous_scale_delta_x:0,_imported_image_previous_scale_delta_y:0,_is_on_resize_element:!1,_imported_image_pxl_colors:[],_is_image_import_mode:!1,_previous_image_imported_resizer_index:-1,_selection_pair_highlight:!0,_imported_image_move_from:[-1,-1],_updated_at:Date.now(),_notified_position_at:0,_force_updated_timestamp:0,_loading_base64_img:"",_loading_base64_img_changed:0,_intervals:[],_kb:0,export_state_every_ms:t.export_state_every_ms||6e4,_last_filters_hash:"",_saving_json_state_history_ran_timestamp:0,_processing_filters:!1,canvas_event_target:"CANVAS_WRAPPER_OVERFLOW",mouse_down:!1,cached_background_image_url:"",cached_background_image:""},this.imported_img_data={imported_image_pxls_positioned:[],imported_image_pxl_colors:new Uint32Array(0),image_imported_resizer_index:-1,imported_image_pxls_positioned_keyset:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32))},this.state_.cursor="",this.images_=Array(25),this.images_[0]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA9ElEQVRYR+3X0Q6FIAgGYDjn/R/5xBmtmjMTmIBd2G3WvsE/VISXPfgyDyyQ1JFbhYiIpI/q94joVukmyPJ/9i+Q1MUpFTpa8wWAzZoxy/puhg7E9b8MlAhiTRnyaJQIQsQPEW1ZKA2I12AWSgvaO5eBsoBSUFZQOErcyx6GHgf9FxH0kU0xJFMjoJD2jYIYZWpffbypI+EBMlWKQWf2WkcXL5AalQlSobJBImoGqIsq51d0hm5n/9beVx5nskG9kbDjZ4Ca7TtLGQ6S7nT19SoFNHqn8xyMnIlrCmtuGikV0kDKNVF7mdXxuN61ZR6qBZKq+Aeqdig0aelV6gAAAABJRU5ErkJggg==",this.images_[1]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABFUlEQVRYR+2Y2w6EIAxEl///aDYYa7C2dFqryyb4qsBhOr3E8kl4aq2Vb1NKKZGtQ4v4QQ2oP7/xTQckqYNAuhTSQiMp1IAiqrmBpEMWEPlBMy+qEOKrV0OG+GoBWZm3FFoKtUyiXsvV+P8sk3rVfqvN/BmF0eUhfiDJT136J0BSnEklrUUM1hzdQvMVH0kudWikkvQuMhV2vfEyyMFAtElwMhW5pclSBOIhYDe6I8ppLQQkZdMUQJpKafLsBdQ0tTaMZYK4TD010NNhg039lkohoKdU6ir3qfSYE2N2dR4Zeru8lT1TAmWHTQsXpBBV7iyoEQwMlAVlwbiA7kIhMG6gHsoTQhQmBNQXTStD+/fIz6r2/RftLsg0XDwDiAAAAABJRU5ErkJggg==",this.images_[2]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA80lEQVRYR+3X4Q6DIAwEYHn/h2bBQIJNoXcVHEb2c3PZx11hGo7FXmExz7FBViM7oe8lFGOMctUhBPcouL4oEfXvK77TiyJpUMEURALIQOR7DJICSUxaOQLSritImRwNstJwIC+G94K0uhxpXDZkrptPqIX5C6iHsU7d+vPO8OMJjcK04FRlszFV3XZCT2Bo0I2/I3i04MpSQhuUc1VP6uVmKA/c9NrgGVoWlG+s4F3DXkgl9ERKLtCslNw3aLPOJC2dc/FW70uCRtfWqgtKqAz3KFQPA4NGoSwMBbqLQjA0qEYxFaIYF6jsSu2Zvrdj0UfpHwMA+yX+QNKuAAAAAElFTkSuQmCC",this.images_[3]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAv0lEQVRYR+2X3Q6AIAiF5f0fmuaFG6OSH9F00a0IX+dAKZTNHtiMpySQ5Mg/FUJEpMoAwKsQSxSqQI2hsiUQb9whhbjf0lS0dWrDUw5qGc9J9956iL6NFob3hSUH33sWEJvWrmBLLJNG1GCpf+wtE5FAkZa5fx0zLNNaW+O6Yx+lUAJJCgwdP2b0kCXnkh5KIE0PuU+MXF6pmHY9BEhbzBInfdtCzkPTgSwFPLGf3zos0EvuZQlkUUCKTcuOU+gCTnb3JcS3RYIAAAAASUVORK5CYII=",this.images_[4]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABH0lEQVRYR+2X4Q7CIAyEy0x8//c1WoNhCWOFawvo1PnTAf24HqUEOtgvzORhZs7XDyHAeHBAD3AEWhki2wlUqvmfCpVGRR7LPSSNLX1lMnWeAiE90bSIb/NdMrp6hRZMjJIWfw+QBFOUmCrI8JTVYDQ1Zfgp64FJaRxbGEsgbbVd8zdaoYWZ79bSn5tpKJCw2JWIbpZjNPRy9ezOAlsbW61DPwl0uJR5VJ6ashMInapToY8plPU77v5Jew+2AnTdZYJ/ltjHIVWbO/be9t55ERYCvQalXjnJfiGiR22nvT0U9IS02wS5m9sLAxWSGq3sv51I5atDa+TN+x+ZrAXVmuuBUStkhfLCmIHWxh2pqnmRmBs0FHTWd3jKZgX+GoWe1olaNCjYBWEAAAAASUVORK5CYII=",this.images_[5]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA+klEQVRYR+3Y0Q6DIAwFUOr+/5NdTY1dkJS1YIsmstexcLhArYP0sA88zJN+IERECw4AQhdxAmlzkXmCaNvK3ePkbkson5jO1gQd23RKIr9xtydUu/7HVn5SSl9LiegZ03Tt+cADwEJnv2dC7TfmwpjXqMikrFV3QcRVQLknZQVR0kNQLaAhqFZQOKoHFIrqBYWhroBCUFdB7igPUBX1ryrXGj0vkIhSnoni3J4gM4r7rbKPp9S8QdRtmtsYqfkLB/GipcknSHtZGJ6QdsveC9LaVPqeDvuQhCwYHjMU1PDnxe7jYuleh6TVW1J7J8iSTPGG7P8sa0WU4zdwA0Y04iTpEgAAAABJRU5ErkJggg==",this.images_[6]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA7UlEQVRYR+3X2w6EIAwEUPv/H82GRDYE6dUO8KCvEntSBgG6DnvoMM/1gbQZWdKhUkppECISa8JBFdMbqk1CQUEjpnVJQsFAHEZDwUC1cASVDmoBbjmRULOpSwX1xftiniylgWZFJRQX7BSQdVraOOgq04J7h/v/77nHs4141SELRlvm41YSBnkwY5ek/SwEQmEq1A1CYtwgNMYFWoExg1ZhTKCVGBW0GiOCdmBY0C7MFLQT8xqkHdi1K8/s/eNPbe0QAhPuEAoTAiExbhAaw4K4MGrX4EiI0w5oGcVNqwxVyPpd9wHN+uHouONAP0LJ2yWtxGVEAAAAAElFTkSuQmCC",this.images_[7]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA/0lEQVRYR+3XSw7DIAwE0Pj+h6ZCqiNE/cHAGBbttg1+GagBei770GWe5w/yZiQloVJKYQgRmTXhoIppDdVmoaCgHsMpWSgYSMN4KBioFp5BbQfxAuZ1YqGkqdsKaou3xSJraRtIKmqhtIW9BTQ6Lfw76L/MSOZtykJSahBLCVnTFG2Ibyf39hbt+wjm2wLMDr0EQmEqKjxlSEwYhMaEQBmYYVAWZgiUiXFB2RgTdAKjgk5hRNBJzBCIN0bveDG7BfXP/XRq6ZCVhXET4utUf5XyrjIraZkJSQMjMW5CPQiNUUFa5N41eGWqls5DOwqrL40cfGbs8AFtpkjkmetAH9mVQzQQt8P4AAAAAElFTkSuQmCC",this.images_[8]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABTUlEQVRYR+2W4RKEIAiEpd7/kS9ubLQxFCGUq5upv5X7uYsghIc98DCe8AJJifzEIUTEDAIAXU13oAhTMkS2HtQUoCS6hhC2MhIKk9/1oIaBsmgSOaA4GAlqCIiJY0XEj1AqO1fLqSGgEMJCxZOIdJjcgOLCFZSKxsmhqA2IuGkiIgXfPG2jkU2F2Xentbfxnal+vPpQ5UwSipBsfBKM1SHOmSXWaTrOp+5cHPGqeVLnr0YmwiSBZm3R5tkqlytAXEx0191Cl6C0QGZn8qDXDlgNkNmZwo04ZfZilwpbAhpyBgDKOPNa5vvQDGdO1xFNz+Nob4Hh+tBtME0g7o5DboNcbYmNT4qtiqwEYnqGG8wVhzK4Nk7JCPZ91yFy/60Gp9R1LVQqoGI4HhoeMKrIWrv0gjEBecKwQL3syTiwlEn3H2mWTReUFnyB/s6hL1JSZjT7s1UhAAAAAElFTkSuQmCC",this.images_[9]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABoklEQVRYR+2Y61IDMQiFoa2+//tqxdmdJAMJ5JBMR6tTf7ob9gMOl5Tpyf74yXjoXwBdReQzG1lm1k5fiOhrdjYdIRGRash+Y46mjg0vdrDn8xTQAbMCkY3eAdtDIaCLiNx7mJnXGgY5sQoUwjDzjYjuIBI3EfnQUAWgHVsC6tNUo+LlPQLTNurHnf+9EVErEjdlHgwzX1GF9GCBnbUIPQrm+CoqhlTKAiAk/ihrg470ixmgs+lVIXoHqkHdlzwapbUTCrzTHhvPHcG51YRSUdI19JhMf0JAQ6oyMCqKy1AvoBI9oyvd234lQl7DbIO7K8NziJbqeieioToeoaElILVimJauyx0NTSTqNFCmLH80Qn8SKDOjQGM046SfBuG0D1p909XC6DCmHP2YLWKpExdvXLHvpDszXLdWhgwMEQ0b6BZQZu1MAKVgDjt9ylzBzfoGgqlac3ZrV79QQ0GEMjpyl7NiL1yHIZAXgd1rEILxUgZFjVIUPZ9tn/rMUh86PTBX9TmejmT2+pRZ3s0PBKghGm83rk4ZoN0sbZ17AaGwfQNzJa40/U9w+QAAAABJRU5ErkJggg==",this.images_[10]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABMklEQVRYR+2XwRLDIAhEpen/f3FTOmaajrUgC5jpxVyD+lwXUCoXfszM5/RERMhSUBAyUR9TYVqGyoZAXQLUw1TYvwFlYCr4VIWyMFOBZsBMA5JgTpOj3vlkYySD2jEjmAhUykPaMR3Sd2UHVSoMZHnG+q+dTAgIXQyNa+HcQN5FvPEuIO/kjam/2siocsNAURgvFAQ0yiZv2bCyLwzkBdHi+3IAAb3P/McHWSipNo2Absy8E9FWSnnOhtIKpQp0+qYfiLQKS7lR1RaBrNteBspqIRLQxswP4fp5L6XsozTOKKN2e2330s48SlnKTAFCjY7CiBc0j0LI8Xlg1BujZWrJK9nWYt4YI4+8FsqrjAlkZcygFRyvVeRRKM0Bt44ooHfcArIUWwothSwFrP/LQ5ZCL65vGzRTMXdZAAAAAElFTkSuQmCC",this.images_[11]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABMklEQVRYR+2XwRLDIAhEpen/f3FTOmaajrUgC5jpxVyD+lwXUCoXfszM5/RERMhSUBAyUR9TYVqGyoZAXQLUw1TYvwFlYCr4VIWyMFOBZsBMA5JgTpOj3vlkYySD2jEjmAhUykPaMR3Sd2UHVSoMZHnG+q+dTAgIXQyNa+HcQN5FvPEuIO/kjam/2siocsNAURgvFAQ0yiZv2bCyLwzkBdHi+3IAAb3P/McHWSipNo2Absy8E9FWSnnOhtIKpQp0+qYfiLQKS7lR1RaBrNteBspqIRLQxswP4fp5L6XsozTOKKN2e2330s48SlnKTAFCjY7CiBc0j0LI8Xlg1BujZWrJK9nWYt4YI4+8FsqrjAlkZcygFRyvVeRRKM0Bt44ooHfcArIUWwothSwFrP/LQ5ZCL65vGzRTMXdZAAAAAElFTkSuQmCC",this.images_[12]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA/klEQVRYR+XX7Q6FIAgG4Lz/i/bMlo2ZIB++zO30t1xPgEjlOuwqh3mu/wPVWuuYhVIKGwhohBpm9u5m5FAwEIfp0eJQENAM0zNHIzZDbQdxmJ4ieh8O0tRMGkiqGbrRUlK2KmCu+UJSthPT4KGi3o0JgRAYNwiFcYGQGDMIjTGBMjBqUBbGBLof5seYT++TRgxpSjX1oT5srWBejCpCBPHiJVgEswSNJ3MPNR0laCqjGBOI5p0MW3fUZlH0/s2INbTaXSPMi6DrwiDpD8IDdIN21MsM7AKhMK6iRmLMIDTGBMrAqEFZGBXo6cSmM8+z3d9TILIYsTbty7X440A/uhPvJTjQhwcAAAAASUVORK5CYII=",this.images_[13]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAk0lEQVRYR+2YwQ6AIAxD2f9/9AgHDyixrs5kxHotHeVtB9Basc+K5WkKhDpyIeTujkyZuplNGZaBTmsy959qjbPvHeir7h0dCBNaGd72b8yoAt1RFCE0YyIkQogA0jVDIoQIIF0zJEKIANI1Q/8jhE7M6PSdmtks4gm/OiLFmbWPAzHFWQ98ubKFs3z6HYNIliPUAQ/FUDSiymd+AAAAAElFTkSuQmCC",this.images_[14]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABR0lEQVRYR+3X3Q6CMAwF4DUY3v91NeIxEGYGbv1jXbzQW2R8nI5uo/RjP/J4AEBzHxGZxzffsGK0z1ndVpQJZMHkBK0oNeiMkapWpmhBqUA1jFCKGcDdgxJBDkyulgvFgi5g3KgmqAPGhVKBLJOy0Z8O5ePG6wGaADylflMmHgnKmAeAmUONAGXMViWprNEgFrM/fEopvYqO/VlyepdMg8mJfVBhCXEDV67Fg/b5sm0/yknMYfI9eSnpXbKvViNhhoI0mGGgCuaWUlpq3TpsUjOfcRMTnpC2TGVSoQntgy8AJiJikxnRGPNSsXZeFSa8ZJoj0Pk/oSX7g84112wvuNQs2+HoTf666h9OutK+KfIYZMZsC7Zmglrf8krJVaDWA7iX8Zxa1QnVuq0mWc/HoE7Ig5ImcO2lzKByxyilJJ3VuoEkyJXrb6IrI0OmlalfAAAAAElFTkSuQmCC",this.images_[15]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABeklEQVRYR82W2w7DIAxDQfv/P57GREWqNM3FlAh1j2trDokdqOVlv/oynnICtdZah6u13iC9Z3JDqzoXoM7SuThUX0D736qs9T6qc6kG/4gWnIGhbyyd/lxuWG5MbY/sWiSiVYug+DNEJwRCRBAgVAcF+pRSfjOJlBUaQKGO6iHq9Uhd2HctadT2Ed4eFEhHTRmL/6e19rXERhXMKrM2uTp8Q/AcklBejK1ZhMwzeFJzMcMfsJbnxWkRDjNacuijKYqCMQWkwFTtv2jRlAp5C2dCQRVCFkTeQSoHAQ2PHIes5Zcso8NAHpR2bj01+hSQBkXT3LmOqHcs6/1pIAmF+GJmJMCTmh0n5KPTU5lQSzdGyzsr7YNujJ5Bs6HC+xCSlkyoEAg1ZBYUChTe9LLSl35jXK3ULWXCM/BNjydrBSqMPW8F6qeV9kGDkRaQwzEaiI8qFYmuPkehqPqPzrJZyAiKW2ELkOcp6cttQBqUFpKtQEhitwMxKHXtP/Eo9zDGipjdAAAAAElFTkSuQmCC",this.images_[16]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA/klEQVRYR+XX7Q6FIAgG4Lz/i/bMlo2ZIB++zO30t1xPgEjlOuwqh3mu/wPVWuuYhVIKGwhohBpm9u5m5FAwEIfp0eJQENAM0zNHIzZDbQdxmJ4ieh8O0tRMGkiqGbrRUlK2KmCu+UJSthPT4KGi3o0JgRAYNwiFcYGQGDMIjTGBMjBqUBbGBLof5seYT++TRgxpSjX1oT5srWBejCpCBPHiJVgEswSNJ3MPNR0laCqjGBOI5p0MW3fUZlH0/s2INbTaXSPMi6DrwiDpD8IDdIN21MsM7AKhMK6iRmLMIDTGBMrAqEFZGBXo6cSmM8+z3d9TILIYsTbty7X440A/uhPvJTjQhwcAAAAASUVORK5CYII=",this.images_[17]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABBElEQVRYR+3XyxLCIAwF0PL/H43DIk7EvG5KoOPoGuVwk1jarod92sM8lwnqvXcObq2VH8AFkWHYfgbEk/YOVZ7QwPBKe0mXgmYM9aOFeoPmBqYv8x6SJlIrgYbxUB8gdIi8+DOo5SBKmpKzUNKBlpaMb843Q3ppWVNLm1oordxLQNGy0LrQlEkTpJWAr/Uad6wVklKDuJVQBOON+RyEC9IerghmTsm6YaSe3lWYAYVBlRgYVI2BQDswYdAuTAi0E+OCdmNM0AmMCjqFEUEnMbdB3o0x8xL69U8dTagCk06oCpMCVWJgUDVGBWnN6L0GZ5oYuqCt2AD9Dfg+hG6Arv+DvMReyBw3NCzTf+YAAAAASUVORK5CYII=",this.key="",this.notifiers_update=i,this.new_canvas_context_2d=h}return a(e,[{key:"set_cursor",value:function(e,t){var i,n,r,a,o;this.state_.mouse_down=0|e,this.state_.canvas_event_target=t+"",i=""+this.state_.tool,n=""+this.state_.select_mode,r=this.state_._is_image_import_mode,a=this.state_._is_on_resize_element,o=this.state_.cursor+"",r?a?this.state_.cursor='url("'+this.images_[0]+'") 18 18, auto':this.state_.mouse_down?this.state_.cursor='url("'+this.images_[2]+'") 20 24, auto':this.state_.cursor='url("'+this.images_[1]+'") 20 18, auto':"MOVE"!=i&&!this.state_.canvas_event_target.includes("CANVAS_WRAPPER")||this.state_.mouse_down?("MOVE"==i||this.state_.canvas_event_target.includes("CANVAS_WRAPPER"))&&this.state_.mouse_down?this.state_.cursor="grabbing":"RECTANGLE"==i?this.state_.cursor='url("'+this.images_[3]+'") 27 12, auto':"ELLIPSE"==i?this.state_.cursor='url("'+this.images_[4]+'") 25 9, auto':"LINE"==i?this.state_.cursor='url("'+this.images_[5]+'") 32 32, auto':"PENCIL"==i?this.state_.cursor='url("'+this.images_[6]+'") 5 32, auto':"PENCIL PERFECT"==i?this.state_.cursor='url("'+this.images_[7]+'") 5 32, auto':"PICKER"==i?this.state_.cursor='url("'+this.images_[8]+'") 5 32, auto':"EXCHANGE"==i?this.state_.cursor='url("'+this.images_[9]+'") 18 18, auto':"BUCKET"==i?this.state_.cursor='url("'+this.images_[10]+'") 6 25, auto':"HUE BUCKET"==i?this.state_.cursor='url("'+this.images_[11]+'") 6 25, auto':"CONTOUR"==i?this.state_.cursor='url("'+this.images_[12]+'") 8 33, auto':"BORDER"==i?this.state_.cursor='url("'+this.images_[13]+'") 18 18, auto':"SET PENCIL MIRROR"==i?this.state_.cursor='url("'+this.images_[14]+'") 18 18, auto':"SELECT COLOR THRESHOLD"==i?this.state_.cursor='url("'+this.images_[15]+'") 7 7, auto':"SELECT PATH"==i?this.state_.cursor='url("'+this.images_[16]+'") 8 33, auto':"SELECT PIXEL"==i?"ADD"==n||"REPLACE"==n?this.state_.cursor='url("'+this.images_[17]+'") 5 32, auto':"REMOVE"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA9klEQVRYR+3XQRKDMAgFUHP/Q6eTBR2MgQ8I0YXdmpHnh2jajpf92ss8xwdCHdmSUO+9E6S1ptYsBw0MNwybhioFzRhKSUP9QTxW1Gd+XXpaCYNQJxBo78WJ4o+g0kGUNCWnoVYPlNoyXpwX88xS2lCvimooqd0pIGtbaJ1pl3l2Fl+LBnesXSQlBnErIQsGbfM5iDDIg5lT0roRAlVhBtQNqsS4QdUYF2gHxgzahTGBdmIgaDdGBT2BEUFPYZagJzG3QejEGPlgX97U1oQqMOGEqjAhUCXGDarGiCBpGNHf4MgQpx3QMoqv7uE+D1VB6L4fCCX8A+VV8SWc4ctzAAAAAElFTkSuQmCC") 5 32, auto':"REPLACE"==n&&(this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABNUlEQVRYR+3X4Q6EIAgAYLn3f+a42aIZgYCFddv165aXfiKYQXnZBS/zlN8AISICwKeUgiyCgIgLAKRN5NTxhimIWBiKMNTmRtU+aWLWZA6dEoYeblAVUSOzB2xrM1FKn+pzvGGPQouqvwWMtKSHFeYYNlERJd08odpRhKUUC1XDWCgtdCLKi2kGrcWh7izSst8OogSm5O1FygsaXrJ28HawSC7dltTSoD2UVqW3lL13Wdge56uy6MZoVVPNaCFS7n1orQjvq8ODscqcl6C502o1G8HwKPVOGEOgLMz6RoiehzIxYVA2JgSagXGDZmFcoJkYEzQb0wU9gVFBT2FE0JOYyyDvQT+y+aqfQVYnGZjhCGVhhkCZmDAoG6OCtPyxPoOtvPO0h48fnk6v/OcPsqL3ugh9ATjCXTQqEhJmAAAAAElFTkSuQmCC") 18 18, auto'):"SELECT PIXEL PERFECT"==i?"ADD"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABFUlEQVRYR+3XWQ7DIAwE0HD/QxNRycil3oZigqrmm4jHmLVch33lMM9lgmqtlYNLKekDcEFkaLafAfGkvUGlJ9QwvNJe0qmgEUPz0UJ10DiB6Wc+h6QVqZVAw3ioNxC6iLz4Z1DLQZQ0JWehpAEtLRnvnHeGzKVlk1rq1EJp5V4CipaF2oVWmbSCtBLwtkYyvZmQlBrEVwlZZUI3xL7NWKe9dbgimNaHt0WEQBo2C9P6g68TmRgYlI2BQDswYdAuTAi0E+OCdmNM0BMYFfQURgQ9iQmBaMv3rherHpwfO7V0wu/CuAnRw3W8a0cPypnUzISUO1LqCxYCZSajXj+099mrvug7aaJm8PVjog/olz/Ii+u4hG5e9580PRb9NQAAAABJRU5ErkJggg==") 5 32, auto':"REMOVE"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABBklEQVRYR+3Xyw6EMAgFUPn/j+6kCwwqj14t1Emc7TRyvFSqtL3sRy/zbB8o6khJQq21xhAicmumgzpGGrrNQ6WCzhhOyUPtIBlr1Gf5v3W3FiZCHUBBey/OKP47qOkgTpqT81DaDU1tmSwuiyF7adqm1op6KKvdU0CjbeF1Q08Z8mTJtU4y+zIlKTOIRwl5bUIH4j7JE5KhaD95NW8lhCTTi0fz6jBo0YQyMd0CJZSNgUAVmGFQFWYIVIkJQdUYF7QCY4JWYVTQSswQiKfsk+MAGb6Xwai9ZFVhwoT4c+r8ro2cTUg6IUi7WCYGBmVjTJAVc/QZjLZHWw+d9jMKRtf4QH+X0A98MFk0IsucOwAAAABJRU5ErkJggg==") 5 32, auto':"REPLACE"==n&&(this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABUklEQVRYR9WX7RKEIAhFZd//mZcdG2mIQMDS2v3VbAbHi3wI5WU/eBlP+Q8gREQA+JRSUCgIiPgFgGkbORluMAURi4AiGHoXhqo2aWPeZg5GCYY+ZlAVoiqzC9beuVCGTfM7+WJXgUPVZwVGC+khwhJGbFSF0v48QXEvSijVRLVgPChLOhUqCsOc1uQwK4sW9tuB6ADT4e0pFQUaDhl3zp1lztJth1pz2oOysvSWtI+GRdS4WJZlC2NHGbVmtfXhOrQZibaOXpiyBXGv5KPdPgPTNlmLq1vZ3QUa8CyYrSNkFZoJkwaaDZMCWgETBloFEwJaCeMCrYbpAj0BYwI9BaMCPQkTAqIxwRsvsgXWWm9eg3j/WQXjKkTXKdkTo1egEdW6ChmNNdS1R2BchaTRmcqY8xC/9kqgyDwzqszlAe2q43CWzXIUtZse0KKGR9e9DugHz47FNAGTbH0AAAAASUVORK5CYII=") 5 32, auto'):i.includes("SELECT")?"ADD"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAkElEQVRYR+2XQQqAMAwEm/8/OpKDUApmUwoScbwmpdNpXNRGs8ea8QyA1I1g6H+G3N3nU5vZ0RgcLQ6QALoZgg2gdSgxpF5TDGEoM7CG3lPvnEPKaNSzrEqDcR7YykaVHhWe3wOqnPq1K6vAkEPKEoYwpAyoOjNUMdTqI18B79aP/zp2N1T9AGFIGVD1djN0AfXGlCWHImsNAAAAAElFTkSuQmCC") 18 18, auto':"REMOVE"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAb0lEQVRYR+2UQQrAIBDEdv7/6C0+oAYWClriNbiOcTB12MphecpA9CIa0hAZIG6HNEQGiNshDZEB4tsOdXfTgAlP8nouBtrsnWSpdcd/BRppgE1jQ1+EoZl+jBoiA8TtkIbIAHE7pCEyQNwOXWfoAYpLFiWYvOCxAAAAAElFTkSuQmCC") 18 18, auto':"REPLACE"==n&&(this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABCElEQVRYR+2X3Q6DMAiFwb3/I8+zYFbj5ixwmixsqTdeWNqPw09RpdijxXhkAnkRmQr9p0IAoKo3EVk9Dy++LwDuquqmiLvgCbMCWEgoBbCq2sv86kN1gRqMiCzmOQBJQjVlmnDNsctzPYWad3skElCUrQdkIMzGjM3mdAQoC0XDZICiUEMwWSAPymrAqonJt90mGrJje3mvnK36NtpBGEahBnYKzZE4UYmnPsoo1IUagRlR6GM+kc3zRSVWoVIhK5XUvT7z9bKPNL3Imu4EE82hzEGZtVTZMwcwNqHLld6YnBL6t33FAc3uKZs7a4ywLeNKDfnkXwZtFi17+oCs4QTyFJsK/ZxCD73aLDSws54nAAAAAElFTkSuQmCC") 18 18, auto'):this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAq0lEQVRYR+1WQQrAIAxb///oDmUOkc3W2kEG2XHQGpPURg6wTzLwqKr2fUQk3Ddc2AMogBqGgo2ARpkhGaKHZtMIKRmnjJLtrBBIU0O9QzvsjrUpyzUd0BgfvAdYWz3StzLUm7KBuWLEKzZPzHjqO8SWElXuX7UnLCCvTCvTFJYsAuarGswp270tQ77FIOQuY0BjQLOM+zuGVlbK7HIpLzXH3vIXGfIwlGXqE9034xUtxdxDAAAAAElFTkSuQmCC") 18 18, auto':this.state_.cursor="grab",o!==this.state_.cursor&&this.notifiers_update()}},{key:"paint_shape",value:function(e,t,i,n,r){n=void 0===n?{}:n,r=void 0===r?function(){}:r,this.state_._s_layers[this.state_._layer_index].paint_uint32a(e instanceof o.SetFixed?e.indexes:e,(0|t)>>>0,Math.fround(i)),this.set_state(n).then(r)}},{key:"set_state",value:function(e,t){t=t||!1;var i=!1;if("pxl_width"in(e="object"!=(void 0===e?"undefined":r(e))?{}:e)&&"pxl_height"in e&&(this.state_.pxl_width===e.pxl_width&&this.state_.pxl_height===e.pxl_height||(this.shape_creator=new d(e.pxl_width,e.pxl_height))),"tool"in e&&this.state_.tool!==e.tool&&(i=!0),"select_mode"in e&&this.state_.select_mode===e.select_mode&&(i=!0),"_is_image_import_mode"in e&&this.state_._is_image_import_mode===e._is_image_import_mode&&(i=!0),""in e&&this.state_._is_on_resize_element===e._is_on_resize_element&&(i=!0),"pxl_current_color"in e&&(this.state_.pxl_current_color_uint32=s.Color.new_hex(e.pxl_current_color).uint32),("show_original_image_in_background"in e||"_base64_original_images"in e||"_original_image_index"in e||"show_transparent_image_in_background"in e||"pxl_width"in e||"pxl_height"in e)&&(!this.state_.cached_background_image_url||void 0!==e._original_image_index&&this.state_._original_image_index!==e._original_image_index||void 0!==e.show_original_image_in_background&&this.state_.show_original_image_in_background!==e.show_original_image_in_background||void 0!==e.show_transparent_image_in_background&&this.state_.show_transparent_image_in_background!==e.show_transparent_image_in_background||e._base64_original_images&&this.state_._base64_original_images.length!==e._base64_original_images.length)&&(this.state_.show_original_image_in_background&&void 0!==this.state_._base64_original_images[this.state_._original_image_index]?(this.state_.cached_background_image_url=this.state_._base64_original_images[this.state_._original_image_index],this.state_.cached_background_image='center / cover no-repeat url("'+this.state_.cached_background_image_url+'")'+(this.state_.show_transparent_image_in_background?", repeating-conic-gradient(rgb(248 248 248 / 100%) 0% 25%, rgb(235 235 235 / 100%) 0% 50%) left top 50% / calc(200% / "+this.state_.pxl_width+") calc(200% / "+this.state_.pxl_height+")":"")):this.state_.show_transparent_image_in_background?this.state_.cached_background_image="repeating-conic-gradient(rgb(248 248 248 / 100%) 0% 25%, rgb(235 235 235 / 100%) 0% 50%) left top 50% / calc(200% / "+this.state_.pxl_width+") calc(200% / "+this.state_.pxl_height+")":this.state_.cached_background_image=""),t)this.state_=Object.assign(this.state_,e);else for(this.key in e)this.state_[this.key]=e[this.key];return i&&this.set_cursor(),Promise.resolve()}},{key:"get_state",value:function(){return this.state_}},{key:"get_notified_pos_at",value:function(){return 0|this.state_._notified_position_at}},{key:"get_imported_image_data",value:function(){var e,t,i,n,r,a,_,l,h,c,d,p,u,f,m,g=this;if(this.state_._imported_image_pxls.length>0){if(e=this.new_canvas_context_2d(this.state_._imported_image_width,this.state_._imported_image_height),this.state_._imported_image_pxls.forEach((function(t,i){var n=i%g.state_._imported_image_width,r=(i-n)/g.state_._imported_image_width;e.fillStyle=s.Color.new_uint32(g.state_._imported_image_pxl_colors[t]).hex,e.fillRect(n,r,1,1)})),t=this.state_._imported_image_width+this.state_._imported_image_scale_delta_x,i=this.state_._imported_image_height+this.state_._imported_image_scale_delta_y,(n=this.new_canvas_context_2d(t,i)).drawImage(e.canvas,0,0,this.state_._imported_image_width,this.state_._imported_image_height,0,0,t,i),r=n.getImageData(0,0,t,i),_=(a=this.get_pixels_palette_and_list_from_image_data(r)).new_pxls,l=a.new_pxl_colors,h={},c=new o.SetFixed(this.state_.pxl_width*this.state_.pxl_height),d=-1,_.length>0)for(d=this.state_._imported_image_start_x+t+(this.state_._imported_image_start_y+i)*this.state_.pxl_width|0,p=Uint32Array.of(t,this.state_._imported_image_start_x,this.state_._imported_image_start_y,this.state_.pxl_width,this.state_.pxl_height),u=Uint32Array.of(0,0,0,0,0),f=0,m=_.length;(0|f)<(0|m);f=f+1|0)u[0]=f%p[0],u[1]=(f-u[0])/p[0],u[2]=u[0]+p[1],u[3]=u[1]+p[2],u[4]=u[3]*p[3]+u[2],u[2]>=0&&u[2]=0&&u[3]0&&_>0?(c=_/(h=r?_+s:1-(1-_)*(1-s)),d=s*(1-_)/h,l.set(Uint8ClampedArray.of(o[0]*c+a[0]*d,o[1]*c+a[1]*d,o[2]*c+a[2]*d),0)):_>0?(h=o[3]/255,l.set(o,0)):(h=a[3]/255,l.set(a,0)),r&&(h/=2),l[3]=255*h|0,this.to_uint32_from_rgba(l)))},blend_rgba_colors:function(e,t,i,n){var r,a,o,s,_,l,h,c,d,p,u,f,m;for(i|=0,n|=0,r=e[0].length/4|0,a=0|e.length,o=new Uint8ClampedArray(e[0].length),s=new Uint8ClampedArray(4),_=new ArrayBuffer(4),l=new Uint8ClampedArray(_),h=new ArrayBuffer(4),c=new DataView(h),d=new Uint8ClampedArray(h),(p=new DataView(new ArrayBuffer(24))).setFloat32(20,(65535*t|0)/65535),u=0,f=0;(0|u)<(0|r);u=(u+1|0)>>>0,f=(f+4|0)>>>0){for(s.set(e[0].slice(f,f+4|0),0),m=1;(0|m)<(0|a);m=m+1|0)l.set(e[m].slice(f,f+4|0),0),0!==i&&0===l[3]&&1===p.getFloat32(20)?s.fill(0):255===l[3]&&1===p.getFloat32(20)?s.set(l,0):(p.setFloat32(0,s[3]/255),p.setFloat32(4,l[3]/255*p.getFloat32(20)),d.fill(0),p.setFloat32(8,0),p.getFloat32(0)>0&&p.getFloat32(4)>0?(n>0?p.setFloat32(8,p.getFloat32(0)+p.getFloat32(4)):p.setFloat32(8,1-(1-p.getFloat32(4))*(1-p.getFloat32(0))),p.setFloat32(12,p.getFloat32(4)/p.getFloat32(8)),p.setFloat32(16,p.getFloat32(0)*(1-p.getFloat32(4))/p.getFloat32(8)),c.setUint8(0,l[0]*p.getFloat32(12)+s[0]*p.getFloat32(16)),c.setUint8(1,l[1]*p.getFloat32(12)+s[1]*p.getFloat32(16)),c.setUint8(2,l[2]*p.getFloat32(12)+s[2]*p.getFloat32(16))):p.getFloat32(4)>0?(p.setFloat32(2,l[3]/255),d.set(l,0)):(p.setFloat32(2,s[3]/255),d.set(s,0)),n&&p.setFloat32(2,p.getFloat32(8)/2),d.fill(255*p.getFloat32(8),3,4),s.set(d));o.set(s,f)}return o},to_hex_from_uint32:function(e){return e=(0|e)>>>0,"#".concat("00000000".concat(new Uint32Array(new Uint8Array(Uint32Array.of(e).buffer).reverse().buffer).toString(16)).slice(-8))},to_hex_from_rgba:function(e){return"#".concat("00000000".concat(new Uint32Array(e.buffer)[0].toString(16)).slice(-8))},to_rgba_from_hex:function(e){return new Uint8ClampedArray(Uint32Array.of(parseInt(e.slice(1),16)).buffer)},to_rgba_from_uint32:function(e){return e=(0|e)>>>0,new Uint8ClampedArray(Uint32Array.of(e).buffer)},to_uint32_from_rgba:function(e){return(0|new Uint32Array(e.buffer)[0])>>>0},to_uint32_from_hex:function(e){return new Uint32Array(new Uint8Array(Uint32Array.of((0|parseInt(e.slice(1),16))>>>0).buffer).reverse().buffer)},to_hsla_from_rgba:function(e){var t,i,r,a,o,s,_=n(e,4),l=_[0],h=_[1],c=_[2],d=_[3];if(d/=255,r=void 0,a=void 0,o=((t=Math.max(l/=255,h/=255,c/=255))+(i=Math.min(l,h,c)))/2,t==i)r=a=0;else{switch(s=t-i,a=o>.5?s/(2-t-i):s/(t+i),t){case l:r=(h-c)/s+(h1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},t=a(s=2*c-(o=c<.5?c*(1+h):c+h-c*h),o,l+1/3),i=a(s,o,l),r=a(s,o,l-1/3)),Uint8ClampedArray.of(255*t|0,255*i|0,255*r|0,255*d|0)},invert_uint32:function(e){e=(0|e)>>>0;var t=this.to_rgba_from_uint32(e),i=n(t,4),r=i[0],a=i[1],o=i[2],s=i[3];return this.to_uint32_from_rgba(Uint8ClampedArray.of(255-r|0,255-a|0,255-o|0,0|s))},match_color:function(e,t,i){var n,r,a,o,s,_,l;return e&=4294967295,t&=4294967295,1===(i=void 0===i?null:i)||(0===i?e===t:(n=255*i|0,r=this.to_rgba_from_uint32(e),a=this.to_rgba_from_uint32(t),o=0|Math.abs(r[3]-a[3]),s=0|Math.abs(r[0]-a[0]),_=0|Math.abs(r[1]-a[1]),l=0|Math.abs(r[2]-a[2]),null!==i?s>>0)u=4294967295&t[(0|e[(0|i)>>>0])>>>0],void 0===(n=c.get(u))&&(n=(0|c.size)>>>0,c.set(u,n)),p[i]=(0|n)>>>0;r=new Uint32Array(c.size),a=!0,o=!1,s=void 0;try{for(_=c[Symbol.iterator]();!(a=(l=_.next()).done);a=!0)r[(h=l.value)[1]]=4294967295&h[0]}catch(f){o=!0,s=f}finally{try{!a&&_.return&&_.return()}finally{if(o)throw s}}return Array.of(p,r)}}}};e.exports=a}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{687:function(e,t,i){"use strict";var n=new Int32Array(15),r={_get_init_state:function(e,t,i,n,r,a){return{canvas_event_target:"CANVAS_WRAPPER_OVERFLOW",canvas_container:{top:0,left:0,height:0,width:0},sizes:{width:0|e,height:0|t},screen_zoom_ratio:1,canvas_wrapper:{padding:0|n,border_width:0|r},scale:{default:i,current:i,move_x:0,move_y:0,moves_speeds:[],move_speed_timestamp:0|Date.now(),moves_speed_average_now:16},device_pixel_ratio:window.devicePixelRatio,perspective:a}},_get_screen_zoom_ratio:function(e){return e.canvas_container.width>e.canvas_container.height?(e.canvas_container.height-e.canvas_wrapper.padding/e.device_pixel_ratio*2)/e.sizes.height:(e.canvas_container.width-e.canvas_wrapper.padding/e.device_pixel_ratio*2)/e.sizes.width},_get_pos:function(e,t,i){return n[0]=2*Math.round(e.canvas_wrapper.padding/e.device_pixel_ratio*e.scale.current+e.canvas_wrapper.border_width)|0,n[1]=Math.round(e.sizes.width*t*e.scale.current)+n[0]|0,n[2]=Math.round(e.sizes.height*t*e.scale.current)+n[0]|0,n[3]=0|e.scale.move_x,n[4]=0|e.scale.move_y,n[5]=e.canvas_container.left+n[3]|0,n[6]=e.canvas_container.top+n[4]|0,n[7]=n[5]+n[1]|0,n[8]=n[6]+n[2]|0,n[9]=n[0]/2|0,n[10]=n[0]/2|0,n[11]=n[5]+n[9]|0,n[12]=n[6]+n[10]|0,n[13]=n[7]-n[0]/2|0,n[14]=n[8]-n[0]/2|0,void 0===i&&(i={}),void 0===i.canvas&&(i.canvas={}),i.canvas.offset_left=n[9],i.canvas.offset_top=n[10],i.canvas.left=n[11],i.canvas.top=n[12],i.canvas.right=n[13],i.canvas.bottom=n[14],i.canvas.width=n[13]-n[11]|0,i.canvas.height=n[14]-n[12]|0,void 0===i.canvas_wrapper&&(i.canvas_wrapper={}),i.canvas_wrapper.offset_left=n[3],i.canvas_wrapper.offset_top=n[4],i.canvas_wrapper.left=n[5],i.canvas_wrapper.top=n[6],i.canvas_wrapper.right=n[7],i.canvas_wrapper.bottom=n[8],i.canvas_wrapper.width=n[7]-n[5]|0,i.canvas_wrapper.height=n[8]-n[6]|0,void 0===i.canvas_container&&(i.canvas_container={}),i.canvas_container.offset_left=0|e.canvas_container.left,i.canvas_container.offset_top=0|e.canvas_container.top,i.canvas_container.left=0|e.canvas_container.left,i.canvas_container.top=0|e.canvas_container.top,i.canvas_container.right=e.canvas_container.left+e.canvas_container.width|0,i.canvas_container.bottom=e.canvas_container.top+e.canvas_container.height|0,i.canvas_container.width=0|e.canvas_container.width,i.canvas_container.height=0|e.canvas_container.height,i},_get_init_pointer_state:function(){return{event_button:null,mouse_down:!1,pointer_events:new Map,previous_single_pointer_down_timestamp:0,previous_double_pointer_down_timestamp:0,latest_pointers_distance:0,latest_pointers_client_x_center:0,latest_pointers_client_y_center:0,previous_double_pointer_move_timestamp:0}},_copy_event:function(e){return{pointerId:0|e.pointerId,clientX:0|e.clientX,clientY:0|e.clientY,pageX:0|e.pageX,pageY:0|e.pageY,button:0|e.button}},_get_shadows:function(e){function t(t){var a=r(i(e)),o=n(Uint8ClampedArray.of(a[0],a[1],a[2],parseInt(142.8))),s=n(Uint8ClampedArray.of(a[0],a[1],a[2],parseInt(91.8))),_=n(Uint8ClampedArray.of(a[0],a[1],a[2],parseInt(.24*255)));return Array.of(t[0]+"px "+t[1]+"px "+t[2]+"px "+t[3]+"px "+o,t[4]+"px "+t[5]+"px "+t[6]+"px "+t[7]+"px "+s,t[8]+"px "+t[9]+"px "+t[10]+"px "+t[11]+"px "+_).join(",")}var i=function(e){var t,i,n,r,a,o=0|e.length;if(void 0===e)return"#00000000";switch(t="",i="",n="",r="",a="#12345678",o){case 9:a=e;break;case 7:a=e.concat("ff");break;case 5:t=e.charAt(1),i=e.charAt(2),n=e.charAt(3),r=e.charAt(4),a="#".concat(t,t,i,i,n,n,r,r);break;case 4:t=e.charAt(1),i=e.charAt(2),n=e.charAt(3),a="#".concat(t,t,i,i,n,n,"ff")}return a},n=function(e){return"#".concat("00000000".concat(new Uint32Array(e.reverse().buffer)[0].toString(16)).slice(-8))},r=function(e){return new Uint8ClampedArray(Uint32Array.of(parseInt(e.slice(1),16)).buffer).reverse()};return Array.of("",t([0,2,1,-1,0,1,1,0,0,1,3,0]),t([0,3,1,-2,0,2,2,0,0,1,5,0]),t([0,3,3,-2,0,3,4,0,0,1,8,0]),t([0,2,4,-1,0,4,5,0,0,1,10,0]),t([0,3,5,-1,0,5,8,0,0,1,14,0]),t([0,3,5,-1,0,6,10,0,0,1,18,0]),t([0,4,5,-2,0,7,10,1,0,2,16,1]),t([0,5,5,-3,0,8,10,1,0,3,14,2]),t([0,5,6,-3,0,9,12,1,0,3,16,2]),t([0,6,6,-3,0,10,14,1,0,4,18,3]),t([0,6,7,-4,0,11,15,1,0,4,20,3]),t([0,7,8,-4,0,12,17,2,0,5,22,4]),t([0,7,8,-4,0,13,19,2,0,5,24,4]),t([0,7,9,-4,0,14,21,2,0,5,26,4]),t([0,8,9,-5,0,15,22,2,0,6,28,5]),t([0,8,10,-5,0,16,24,2,0,6,30,5]),t([0,8,11,-5,0,17,26,2,0,6,32,5]),t([0,9,11,-5,0,18,28,2,0,7,34,6]),t([0,9,12,-6,0,19,29,2,0,7,36,6]),t([0,10,13,-6,0,20,31,3,0,8,38,7]),t([0,10,13,-6,0,21,33,3,0,8,40,7]),t([0,10,14,-6,0,22,35,3,0,8,42,7]),t([0,11,14,-7,0,23,36,3,0,9,44,8]),t([0,11,15,-7,0,24,38,3,0,9,46,8]))},from:function(e,t,i,n,r,a){var o=this._get_screen_zoom_ratio,s=this._get_init_state,_=this._get_init_pointer_state,l=this._get_pos,h=this._get_shadows,c=(this._copy_event,!1),d=h("#020529"),p=_(),u=s(e,t,i,n,r,a),f=o(u),m=l(u,f),g={update:function(){},menu:function(){},move:function(){},up:function(){},down:function(){},middle:function(){},ripple:function(){}},A=null,y=null,v={box_shadow:"",will_change:!1};return{init_speed_interval:function(){null!==A?setTimeout(this.set_move_speed_average_now,5):A=setInterval(this.set_move_speed_average_now,20)},set_canvas_wrapper:function(e,t){u.canvas_wrapper={padding:e,border_width:t},f=o(u),m=l(u,f),this.set_current_scale_default()},set_canvas_container:function(e,t,i,n){u.canvas_container={top:e,left:t,height:i,width:n},f=o(u),m=l(u,f),this.set_current_scale_default()},set_sizes:function(e,t){u.sizes={width:e,height:t},u.scale.moves_speed_average_now=16,f=o(u),m=l(u,f)},set_perspective:function(e){u.perspective=e},get_pointer_state:function(){return p},get_perspective_state:function(){return y||{}},get_screen_zoom_ratio:function(){return Math.fround(parseFloat(f)).toFixed(2)},compute_perspective_from_pointer_event:function(e,t){var i,n,r,a,o,s,_,l,h,c,d,p,f,g;e|=0,t|=0,u.perspective>0&&(i=e-m.canvas_container.left|0,n=t-m.canvas_container.top|0,r=u.perspective*(i-m.canvas_container.width/2)/(m.canvas_container.width/2),a=-u.perspective*(n-m.canvas_container.height/2)/(m.canvas_container.height/2),_=255-(o=r>u.perspective?r:2*r)/2*255,l=(s=a<0?a:2*a)/2*255,h=(1.25*o/u.scale.current*1e3|0)/1e3,p=(d=!(!(c=(1.25*s/u.scale.current*1e3|0)/1e3)&&!h))?"rotateX("+c+"deg) rotateY("+h+"deg)":"",f=d?"linear-gradient(to right, rgba(\n "+_.toFixed(3)+",\n "+_.toFixed(3)+",\n "+_.toFixed(3)+", \n "+(Math.abs(.1*o)/(2*u.perspective)).toFixed(2)+"\n ), rgba(\n "+_.toFixed(3)+",\n "+_.toFixed(3)+",\n "+_.toFixed(3)+", \n "+(Math.abs(.6*o)/(2*u.perspective)).toFixed(2)+"\n )), linear-gradient(to top, rgba(\n "+l.toFixed(3)+",\n "+l.toFixed(3)+",\n "+l.toFixed(3)+", \n "+(Math.abs(.75*s)/(2*u.perspective)).toFixed(2)+"\n ), rgba(\n "+l.toFixed(3)+",\n "+l.toFixed(3)+",\n "+l.toFixed(3)+", \n "+(Math.abs(.25*s)/(2*u.perspective)).toFixed(2)+"\n ))":"",g=(1+(-h+c)/80).toFixed(2),y={transform_rotate:p,background_image:f,filter:d?"brightness("+g+") contrast("+g+")":""})},set_pointer_state:function(e){var t="",i=!1;for(t in"mouse_down"in e&&p.mouse_down!==e.mouse_down&&(i=!0),e)p[t]=e[t];i&&this.notify_cursor()},set_moves:function(e,t,i,n){var r,a,s,_,h,c,d,p,g,A,y,v,w,x,b;i=i||null,n=n||function(){},r=Date.now(),s=(a=u).scale,_="CANVAS_WRAPPER_OVERFLOW"!==a.canvas_event_target?18:24,h=s.move_x,c=s.move_y,d=s.moves_speeds,p=s.move_speed_timestamp,g=s.current,A=r-p|0,w=0|Math.min(Math.round((0|Math.sqrt((y=h-e|0)*y+(v=c-t|0)*v))/A*200),200),d.push(w),d.length>=_&&d.shift(),x=d.slice(-_).reduce((function(e,t,i,n){return e+t/n.length}),0),x=Math.max(1,Math.round(Math.floor(x*_/200))),b=!(null===i),u.scale.default=Math.fround(parseFloat(s.default)),u.scale.current=Math.fround(parseFloat(b?i:g)),u.scale.move_x=0|e,u.scale.move_y=0|t,u.scale.move_speed_timestamp=Date.now(),u.scale.moves_speeds=d,u.scale.moves_speed_average_now=null!==i&&i>g?_:null!==i&&i0&&void 0!==arguments[0]?arguments[0]:function(){},menu:arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},move:arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},up:arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},down:arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},middle:arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){},cursor:arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){},ripple:arguments.length>7&&void 0!==arguments[7]?arguments[7]:function(){}}},notify_moved:function(e){g.update(!1,!1,e)},notify_menu:function(e,t){setTimeout((function(){g.menu(e)}),t|=0)},notify_move:function(e){g.move(e)},notify_up:function(e){g.up(e)},notify_down:function(e){g.down(e)},notify_ripple:function(e){g.ripple(e)},notify_middle:function(){g.middle(!1,!1)},notify_cursor:function(){g.cursor(p.mouse_down,u.canvas_event_target)},set_shadow_color:function(e){d=h(e)},set_zoom:function(){var e,t,i,n,r,a,o,s,_,l,h,c,d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,p=arguments[1],f=arguments[2],m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,g=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,A=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){},y=u,v=y.scale,w=y.canvas_container,x=y.canvas_wrapper,b=v.current,C=v.move_y,E=v.move_x,U=b*d;U>6||U<1/6||(e=1-b/U,t=U/b,i=void 0,n=void 0,p&&f?(i=p-w.left|0,n=f-w.top|0):(i=w.width/2|0,n=w.height/2|0),0===m&&0===g?this.set_moves(E,C,U,A):(r=(E-i*e)*t+m|0,a=(C-n*e)*t+g|0,o=(w.width-x.width)/2|0,s=(w.height-x.height)/2|0,_=3/4*x.width+o,l=3/4*x.height+s,a-=s,h=Math.min(Math.abs(r-=o),_)*(r<0?-1:1)+o,c=Math.min(Math.abs(a),l)*(a<0?-1:1)+s,this.set_moves(h,c,U,A)))},handle_wheel:function(e){var t,i,n,r,a,o,s,_,l,h,c,d,p,f=e.deltaY,m=e.pageY,g=e.pageX,A=e.movementX,y=void 0===A?0:A,v=e.movementY,w=void 0===v?0:v,x=this.get_pos(),b=x.canvas_container,C=x.canvas_wrapper,E=u.scale,U=E.move_x,I=E.move_y,S=E.current,R=Math.max(Math.min(.125,Math.abs(-.01*f)),.25);(t=S+(R=-.01*f>0?R:-R)*S*(.9/Math.pow(S<1?1/S:S,1.6)))>6||t<1/6||(i=1-S/t,n=t/S,r=void 0,a=void 0,g&&m?(r=g-b.left|0,a=m-b.top|0):(r=b.width/2|0,a=b.height/2|0),o=(U-r*i)*n+y|0,s=(I-a*i)*n+w|0,_=(b.width-C.width)/2|0,l=(b.height-C.height)/2|0,h=3/4*C.width+_,c=3/4*C.height+l,s-=l,d=Math.min(Math.abs(o-=_),h)*(o<0?-1:1)+_,p=Math.min(Math.abs(s),c)*(s<0?-1:1)+l,this.set_moves(d,p,t))},handle_move:function(e,t,i,n){var r=this.get_pos(),a=r.canvas_container,o=r.canvas_wrapper,s=u.scale,_=s.move_x,l=s.move_y,h=(a.width-o.width)/2|0,c=(a.height-o.height)/2|0,d=3/4*o.width+h|0,p=3/4*o.height+c|0,f=_+(i-e|0)-c|0,m=l+(n-t|0)-h|0,g=f<0?-1:1,A=Math.min(Math.abs(f),d)*g+h|0,y=Math.min(Math.abs(m),p)*g+c|0;this.set_moves(A,y)},set_boolean_move_on_click:function(e){c=e},handle_pointer_down:function(e){var t,i,n,r,a,o,s,_,l,h,c,d;e.preventDefault(),t=u.canvas_event_target,n=(i=this.get_pointer_state()).latest_pointers_distance,r=i.latest_pointers_client_x_center,a=i.latest_pointers_client_y_center,o=i.previous_single_pointer_down_timestamp,s=i.previous_double_pointer_down_timestamp,_=i.pointer_events,l=parseInt(o),h=parseInt(s),_.set(""+e.pointerId,e),c=!(1!==_.size),d=!(2!==_.size),o=c?Date.now():l,s=d?Date.now():h,this.set_pointer_state({pointer_events:_,mouse_down:!0,event_button:parseInt(e.button),latest_pointers_distance:d?0:parseFloat(n),previous_single_pointer_down_timestamp:parseInt(o),previous_double_pointer_down_timestamp:parseInt(s),latest_pointers_client_x_center:parseInt(e.clientX),latest_pointers_client_y_center:parseInt(e.clientY)}),2===parseInt(e.button||0)||Math.abs(o-l)<200&&Math.abs(r-e.clientX)<20&&Math.abs(a-e.clientY)<20?this.notify_menu(e,180):c&&h+200>Date.now()||!c&&"mouse"!==e.pointerType||"CANVAS"!==t||this.notify_down(e),"CANVAS_WRAPPER_OVERFLOW"===t&&this.notify_ripple(e)},handle_pointer_up:function(e){var t,i;e.preventDefault(),t=u.canvas_event_target,(i=this.get_pointer_state().pointer_events).delete(""+e.pointerId),this.set_pointer_state({pointer_events:i,mouse_down:!(0===i.size)}),this.notify_up(e),("CANVAS_WRAPPER_OVERFLOW"===t&&1===e.which||"CANVAS"!==t)&&this.notify_moved()},handle_pointer_move:function(e){var t,i,n,r,a,o,s,_,l,h,d,p,f,m,g,A,y,v,w,x,b,C,E,U,I,S,R,T,B,F,P,O,k,M,Q,D,N,L,Y,G,V;e.preventDefault(),t=""+u.canvas_event_target,this.compute_canvas_event_target(parseInt(e.pageX),parseInt(e.pageY)),i=""+u.canvas_event_target,r=(n=this.get_pointer_state()).mouse_down,a=n.event_button,o=n.pointer_events,s=n.latest_pointers_distance,_=n.latest_pointers_client_x_center,l=n.latest_pointers_client_y_center,h=n.previous_double_pointer_move_timestamp,d=n.previous_single_pointer_down_timestamp,o.set(""+e.pointerId,{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,which:e.which,button:e.button,pointerId:e.pointerId}),2===o.size?(f=(p=Array.from(o.values()))[0].clientX-p[1].clientX,m=p[0].clientY-p[1].clientY,g=Math.sqrt(f*f+m*m),A=parseInt(p[0].clientX+p[1].clientX)/2,y=parseInt(p[0].clientY+p[1].clientY)/2,v=parseInt(p[0].pageX+p[1].pageX)/2,w=parseInt(p[0].pageY+p[1].pageY)/2,x=A-_,b=y-l,C=u.scale.move_x+x,E=u.scale.move_y+b,U=s>0?parseFloat(g/s):1,I={latest_pointers_distance:parseFloat(g),latest_pointers_client_x_center:parseInt(A),latest_pointers_client_y_center:parseInt(y),previous_double_pointer_move_timestamp:Date.now()},d+306||F<1/6||(P=1-B/F,O=F/B,k=(C-(v-R.left|0)*P)*O+x|0,M=(E-(w-R.top|0)*P)*O+b|0,Q=(R.width-T.width)/2|0,D=(R.height-T.height)/2|0,N=3/4*T.width+Q,L=3/4*T.height+D,M-=D,Y=Math.min(Math.abs(k-=Q),N)*(k<0?-1:1)+Q,G=Math.min(Math.abs(M),L)*(M<0?-1:1)+D,this.set_moves(Y,G,F)),this.set_pointer_state(I)):this.set_pointer_state(I)):r&&1===o.size?(V={latest_pointers_client_x_center:parseInt(e.clientX),latest_pointers_client_y_center:parseInt(e.clientY),previous_double_pointer_move_timestamp:parseInt(h)},"CANVAS"!==i||"CANVAS"===i&&0===a&&c||1===a?h+200=n.left&&t>=n.top&&e<=n.right&&t<=n.bottom?a="CANVAS":e>=r.left&&t>=r.top&&e<=r.right&&t<=r.bottom&&(a="CANVAS_WRAPPER"),u.canvas_event_target!==a&&(o=!0,u.canvas_event_target=a),o&&this.notify_cursor()},set_move_speed_average_now:function(){var e,t,i;u&&(e="CANVAS_WRAPPER_OVERFLOW"!==u.canvas_event_target?18:24,(t=Date.now())-u.scale.move_speed_timestamp>=20&&u.scale.moves_speed_average_now>-e?(i=Math.max(u.scale.moves_speed_average_now-1,-e),u.scale.moves_speed_average_now=i,u.scale.move_speed_timestamp=0|t,g.update(!0,!0)):t-u.scale.move_speed_timestamp>=20&&u.scale.moves_speed_average_now<-e&&e<24?(u.scale.moves_speed_average_now=0|Math.max(u.scale.moves_speed_average_now+1,-e),u.scale.move_speed_timestamp=0|t,g.update(!0,!0)):u.perspective>0&&g.update(!0,!0))}}}};e.exports=r},688:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t,i){return((e=((e|=0)-(e-(i=(0|i)>>>0)&i-e>>31)|0)>>>0)-(e-(t=(0|t)>>>0)&e-t>>31)|0)>>>0}function a(e){var t=I(e/255);return 255-E(e+e-Math.round(t*t*255|0)|0,0,255)}function o(e){return C(U(e,e))}var s,_,l,h,c,d,p,u,f,m=i(648),g=i(654),A=n(i(715)),y=n(i(716)),v=(0,m.SIMDopeCreate)({create:{new_uint32:!0,new_zero:!0},properties:{},methods:{get_use_element:!0,blend_first_with:!0,blend_with:!0}}),w=v.Color,x=v.Colors,b=v.simdops,C=b.abs_int,E=b.clamp_int,U=b.minus_int,I=Math.fround,S=function(e){var t,i,n=new Uint32Array(e.data.buffer),r=Uint32Array.from(new Set(n)),a={},o=r.length,s=o<255?new Uint8Array(n.length):o<65535?new Uint16Array(n.length):new Uint32Array(n.length);for(t=0,i=0|o;(0|t)<(0|i);t=(t+1|0)>>>0)a[r[0|t]]=(0|t)>>>0;for(t=0,i=0|n.length;(0|t)<(0|i);t=(t+1|0)>>>0)s[0|t]=(0|a[n[0|t]])>>>0;return[s,r,n,o]},R=Object.create({_get_64_js:function(){return{xxh_f:{hasher:A.default,create:function(e){return this.hasher.h64(e)}},xxh_v:"64",xxh_t:"js",xxh_tt:Date.now()}},_get_64_wasm:function(){return new Promise((function(e,t){try{(0,y.default)().then((function(t){e({xxh_f:{hasher:t,create:function(e){return this.hasher.create64(BigInt(e))}},xxh_v:"64",xxh_t:"wasm",xxh_tt:Date.now()})})).catch((function(e){t()}))}catch(i){t()}}))},new:function(){var e=Uint8Array.from("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((function(e){return e.charCodeAt(0)}))),t=BigInt(e.length),i=new Uint8Array(14),n=this._get_64_js,r=this._get_64_wasm,a=n();return r().then((function(e){a=e})),{get_info:function(){return{version:a.xxh_v,type:a.xxh_t,timestamp:a.xxh_tt}},base58_that:function(n){var r,o=0,s=BigInt(0),_=a.xxh_f.create(62675);for(n instanceof Uint8Array||n instanceof Uint8ClampedArray?_.update(n):n.forEach((function(e){_.update(e)})),r=BigInt(_.digest());r>0;)s=Number(r%t),r=BigInt(r/t),i[0|o]=65535&e[s],o=o+1&15;return String.fromCharCode.apply(null,i.slice(0,0|o))}}}}).new(),T=function e(t,i,n,r,a){if(!(this instanceof e))return new e(t,i,n,r);if(i=(0|parseInt(i||0))>>>0,n=(0|parseInt(n||0))>>>0,this.with_plain_data_=!(void 0!==r&&!r),"length"in t&&2===t.length)this.width_=0|i,this.height_=0|n,this.bitmap_=void 0===a?{height:this.height_,width:this.width_,destroy:function(){},hash:""}:a,this.force_update_data(t[0],t[1]);else{if(t instanceof ImageData){var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i,n,r=[],a=!0,o=!1,s=void 0;try{for(i=e[Symbol.iterator]();!(a=(n=i.next()).done)&&(r.push(n.value),2!==r.length);a=!0);}catch(_){o=!0,s=_}finally{try{!a&&i.return&&i.return()}finally{if(o)throw s}}return r}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(S(t)),s=o[0],_=o[1];this.width_=0|t.width,this.height_=0|t.height,this.bitmap_=void 0===a?{height:this.height_,width:this.width_,destroy:function(){},hash:""}:a,this.force_update_data(_,s)}else t.data8 instanceof Uint8ClampedArray?(this.width_=0|t.width,this.height_=0|t.height,this.populate_data(new Uint32Array(t.data8.buffer))):t instanceof Uint8Array||t instanceof Uint8ClampedArray?(this.width_=0|i,this.height_=0|n,this.populate_data(new Uint32Array(t.buffer))):(this.width_=0|i,this.height_=0|n,this.populate_data(Uint32Array.from(t)));this.bitmap_=void 0===a?{height:this.height_,width:this.width_,destroy:function(){},hash:""}:a,this.populate_colors(this.uint32_pixel_color_),this.populate_indexes(),this.changes_.charge()}return this};T.new_from_colors_and_indexes=function(e,t,i,n,r,a){return new T(Array.of(e,t),parseInt(i),parseInt(n),!!r,a)},Object.defineProperty(T.prototype,"force_update_data",{get:function(){return function(e,t){var i=void 0!==e,n=void 0!==t;i&&n?(this.populate_colors(e),this.populate_indexes(t),this.populate_data()):n?(this.populate_indexes(t),this.compute_data()):i&&(this.populate_colors(e),this.compute_data())}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"populate_data",{get:function(){return function(e){if(void 0===e){this.uint32_pixel_color_=new Uint32Array(this.width_*this.height_),this.changes_=new g.SetFixed(this.uint32_pixel_color_.length),this.changes_.charge(),this.uint8c_pixel_color_=new Uint8ClampedArray(this.uint32_pixel_color_.buffer),this.simdope_pixel_color_=new x(this.uint32_pixel_color_.buffer);for(var t=0,i=0|this.uint32_pixel_color_.length;(0|t)<(0|i);t=(t+1|0)>>>0)this.uint32_pixel_color_[t]=(0|this.colors[this.indexes[t]])>>>0}else this.uint32_pixel_color_=e instanceof Uint32Array?e:e instanceof ArrayBuffer?new Uint32Array(e):Uint32Array.from(e),this.changes_=new g.SetFixed(this.uint32_pixel_color_.length),this.changes_.charge(),this.uint8c_pixel_color_=new Uint8ClampedArray(this.uint32_pixel_color_.buffer),this.simdope_pixel_color_=new x(this.uint32_pixel_color_.buffer)}}}),Object.defineProperty(T.prototype,"compute_data",{get:function(){return function(){var e,t;for(e=0,t=0|this.uint32_pixel_color_.length;(0|e)<(0|t);e=(e+1|0)>>>0)(0|(0|this.uint32_pixel_color_[(0|e)>>>0])>>>0)>>>0!=(0|(0|this.colors[this.indexes[(0|e)>>>0]])>>>0)>>>0&&(this.uint32_pixel_color_[(0|e)>>>0]=(0|this.colors[this.indexes[(0|e)>>>0]])>>>0,this.changes_.add((0|e)>>>0))}}}),Object.defineProperty(T.prototype,"populate_colors",{get:function(){return function(e){this.uint32_colors_=e instanceof Uint32Array?(this.uint32_colors_||{}).length===e.length?e:e.slice(0,0|e.length):e instanceof ArrayBuffer?new Uint32Array(e):Uint32Array.from(e),this.uint32_colors_length_=this.uint32_colors_.length,this.uint32_colors_map_={};for(var t=0;(0|t)<(0|this.uint32_colors_length_);t=(t+1|0)>>>0)this.uint32_colors_map_[this.uint32_colors_[t]]=t}}}),Object.defineProperty(T.prototype,"populate_indexes",{get:function(){return function(e){if(void 0!==e)this.color_indexes_length_=e.length,this.color_indexes_constructor_=this.uint32_colors_length_<256?Uint8Array:(this.uint32_colors_length_+1|0)<65536?Uint16Array:Uint32Array,this.color_indexes_=e instanceof this.color_indexes_constructor_?e:e instanceof ArrayBuffer?new this.color_indexes_constructor_(e):this.color_indexes_constructor_.from(e);else{this.color_indexes_length_=this.uint32_pixel_color_.length,this.color_indexes_constructor_=this.uint32_colors_length_<256?Uint8Array:(this.uint32_colors_length_+1|0)<65536?Uint16Array:Uint32Array,this.color_indexes_=new this.color_indexes_constructor_(this.color_indexes_length_);for(var t=0,i=0|this.color_indexes_length_;(0|t)<(0|i);t=(t+1|0)>>>0)this.color_indexes_[0|t]=(0|this.get_color_index(this.uint32_pixel_color_[0|t]))>>>0}}}}),Object.defineProperty(T.prototype,"get_color_index",{get:function(){return function(e){return this.uint32_colors_map_[(0|e)>>>0]}}}),Object.defineProperty(T.prototype,"has_color",{get:function(){return function(e){return void 0!==this.uint32_colors_map_[(0|e)>>>0]}}}),Object.defineProperty(T.prototype,"data8",{get:function(){return this.uint8c_pixel_color_}}),Object.defineProperty(T.prototype,"image_data",{get:function(){return new ImageData(this.data8,0|this.width_,0|this.height_)}}),Object.defineProperty(T.prototype,"width",{get:function(){return 0|this.width_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"height",{get:function(){return 0|this.height_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_bitmap",{get:function(){return function(e){return this.bitmap_.hash!==e.hash&&(this.bitmap_.destroy(),this.bitmap_=e),this.bitmap_}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"get_bitmap",{get:function(){return function(){return this.bitmap_}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"bitmap_async",{get:function(){return function(e){var t,i,n,r,a,o;return e=void 0!==e&&!!e&&!0,t=this.hash_hex_async.bind(this),i=this.get_bitmap.bind(this),n=this.set_bitmap.bind(this),r=this.image_data,a=function(e,i){Promise.all([createImageBitmap(r),t()]).then((function(t){var i=t[0];i.hash=""+t[1],e(n(i))})).catch(i)},e?(o=i(),t().then((function(e){return""!==o.hash&&""+e==""+o.hash?Promise.resolve(o):new Promise(a)}))):new Promise(a)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"hash_hex_async",{get:function(){return function(e){var t=R.base58_that(e||this.data8);return Promise.resolve(t)}}}),Object.defineProperty(T.prototype,"data",{get:function(){return this.uint32_pixel_color_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"get_index",{get:function(){return function(e){return e=(0|e)>>>0,this.color_indexes_[0|e]}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"indexes",{get:function(){return this.color_indexes_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"indexes_copy",{get:function(){return this.indexes.slice(0,0|this.indexes.length)},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_indexes",{get:function(){return function(e){this.force_update_data(void 0,e)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"get_color",{get:function(){return function(e){return e=(0|e)>>>0,this.uint32_colors_[0|e]}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"colors",{get:function(){return this.uint32_colors_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"colors_copy",{get:function(){var e=0|this.uint32_colors_length_;return this.uint32_colors_.slice(0,0|e)},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_colors",{get:function(){return function(e){this.force_update_data(e,void 0)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"set_colors_and_indexes",{get:function(){return function(e,t){this.force_update_data(e,t)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"changes",{get:function(){return this.changes_.indexes},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"changes_has",{get:function(){return function(e){return this.changes_.has((0|e)>>>0)}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"setFixed",{get:function(){return this.changes_},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"clear_changes",{get:function(){return function(){this.changes_.clear()}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"charge_changes",{get:function(){return function(){this.changes_.charge()}}}),Object.defineProperty(T.prototype,"get_uint32",{get:function(){return function(e){return e=(0|e)>>>0,this.uint32_pixel_color_[e]}}}),Object.defineProperty(T.prototype,"set_uint32",{get:function(){return function(e,t){if(e=(0|e)>>>0,t=void 0===t?this.uint32_pixel_color_[e]:(0|t)>>>0,this.changes_.add(e),this.uint32_pixel_color_[e]=t,this.has_color(t))return this.color_indexes_[e]=this.get_color_index(t),!1;switch(this.uint32_colors_length_+1|0){case 255:this.color_indexes_=Uint16Array.from(this.color_indexes_);break;case 65535:this.color_indexes_=Uint32Array.from(this.color_indexes_)}var i=new Uint32Array(this.uint32_colors_length_+1|0);return i.set(this.uint32_colors_,0),i[(0|this.uint32_colors_length_)>>>0]=t,this.populate_colors(i),this.color_indexes_[e]=this.get_color_index(t),!0}},enumerable:!1,configurable:!1}),Object.defineProperty(T.prototype,"paint_uint32a",{get:function(){return function(e,t,i){var n,r,a,o;if(t=(0|t)>>>0,i=Math.round(255*parseFloat(i)),(n=0|e.length)>0)for(r=w.new_uint32(t),a=new w(new ArrayBuffer(4)),o=0;(0|o)<(0|n);o=(o+1|0)>>>0)this.simdope_pixel_color_.get_use_element(e[o],a).blend_first_with(r,i,!1,!1),this.set_uint32(e[o])}},enumerable:!1,configurable:!1}),s=function e(t,i,n,r){var a;if(!(this instanceof e))return new e(t,i,n,r);for(n=(0|n)>>>0,r=(0|r)>>>0,this.layers_=Array(t.length),this.metadata_=Array(i.length),a=0;a>>0)r[0|o]=r[o+1|0]=r[o+2|0]=((i[0|o]+i[o+1|0]+i[o+2|0]|0)/3|0)>>>0,r[o+3|0]=i[o+3|0];for(s=new x(e),_=new x(a),l=new w(new ArrayBuffer(4)),h=new w(new ArrayBuffer(4)),c=0|a.length,d=0;(0|d)<(0|c);d=(d+1|0)>>>0)_.get_use_element(0|d,l).blend_first_with(s.get_use_element(0|d,h),255-t,!1,!1);return a}},enumerable:!1,configurable:!1}),c=Float32Array.of(.393,.769,.189,.349,.686,.168,.272,.534,.131),Object.defineProperty((d=function e(){if(!(this instanceof e))return new e}).prototype,"filter_colors",{get:function(){return function(e,t){var i,n,r,o,s,_,l,h,c,d,p;for(t=0|Math.round(parseFloat(t)/4*255),n=0|(i=new Uint8Array(e.buffer)).length,(r=new Uint8Array(0|n)).set(i,0),o=new Uint32Array(r.buffer),s=0;(0|s)<(0|n);s=(s+4|0)>>>0)r[0|s]=a(i[0|s]),r[s+1|0]=a(i[s+1|0]),r[s+2|0]=a(i[s+2|0]),r[s+3|0]=i[s+3|0];for(_=new x(e),l=new x(o),h=new w(new ArrayBuffer(4)),c=new w(new ArrayBuffer(4)),d=0|o.length,p=0;(0|p)<(0|d);p=(p+1|0)>>>0)l.get_use_element(0|p,h).blend_first_with(_.get_use_element(0|p,c),255-t,!1,!1);return o}},enumerable:!1,configurable:!1}),Object.defineProperty((p=function e(){if(!(this instanceof e))return new e}).prototype,"filter_colors",{get:function(){return function(e,t){var i,n,r,a,s,_,l,h,c,d,p;for(t=0|Math.round(parseFloat(t)/2*255),n=0|(i=new Uint8Array(e.buffer)).length,(r=new Uint8Array(0|n)).set(i,0),a=new Uint32Array(r.buffer),s=0;(0|s)<(0|n);s=(s+4|0)>>>0)r[0|s]=o(i[0|s]),r[s+1|0]=o(i[s+1|0]),r[s+2|0]=o(i[s+2|0]),r[s+3|0]=i[s+3|0];for(_=new x(e),l=new x(a),h=new w(new ArrayBuffer(4)),c=new w(new ArrayBuffer(4)),d=0|a.length,p=0;(0|p)<(0|d);p=(p+1|0)>>>0)l.get_use_element(0|p,h).blend_first_with(_.get_use_element(0|p,c),255-t,!1,!1);return a}},enumerable:!1,configurable:!1}),Object.defineProperty((u=function e(){if(!(this instanceof e))return new e}).prototype,"filter_colors",{get:function(){return function(e,t){var i,n,a,o,s,_,l,h,d,p,u;for(t=0|Math.round(255*parseFloat(t)),n=0|(i=new Uint8Array(e.buffer)).length,(a=new Uint8Array(0|n)).set(i,0),o=new Uint32Array(a.buffer),s=0;(0|s)<(0|n);s=(s+4|0)>>>0)a[s+3|0]=i[s+3|0],a[0|s]=255&r(i[0|s]*c[0]+i[s+1|0]*c[1]+i[s+2|0]*c[2]|0,0,255),a[s+1|0]=255&r(i[0|s]*c[3]+i[s+1|0]*c[4]+i[s+2|0]*c[5]|0,0,255),a[s+2|0]=255&r(i[0|s]*c[6]+i[s+1|0]*c[7]+i[s+2|0]*c[8]|0,0,255);for(_=new x(e),l=new x(o),h=new w(new ArrayBuffer(4)),d=new w(new ArrayBuffer(4)),p=0|o.length,u=0;(0|u)<(0|p);u=(u+1|0)>>>0)l.get_use_element(0|u,h).blend_first_with(_.get_use_element(0|u,d),255-t,!1,!1);return o}},enumerable:!1,configurable:!1}),Object.defineProperty(l.prototype,"filter_colors",{get:function(){return function(e,t){var i,n,r,a,o,s,_,l,h,c,d;for(t=0|Math.round(255*parseFloat(t)),n=0|(i=new Uint8Array(e.buffer)).length,(r=new Uint8Array(0|n)).set(i,0),a=new Uint32Array(r.buffer),o=0;(0|o)<(0|n);o=(o+4|0)>>>0)r[o+3|0]=i[o+3|0],r[0|o]=this.ar_[i[0|o]],r[o+1|0]=this.ag_[i[o+1|0]],r[o+2|0]=this.ab_[i[o+2|0]];for(s=new x(e),_=new x(a),l=new w(new ArrayBuffer(4)),h=new w(new ArrayBuffer(4)),c=0|a.length,d=0;(0|d)<(0|c);d=(d+1|0)>>>0)_.get_use_element(0|d,l).blend_first_with(s.get_use_element(0|d,h),255-t,!1,!1);return a}},enumerable:!1,configurable:!1}),f=function e(t){if(!(this instanceof e))return new e(t);t=t||_,this.names_=Object.keys(t),this.filters_=Object.values(t).map((function(e){return l(e)})),this.special_names_=Array.of("Greyscale","Sepia","Screen","Difference"),this.filter_sepia_=new u,this.filter_greyscale_=new h,this.filter_screen_=new d,this.filter_difference_=new p},Object.defineProperty(f.prototype,"names",{get:function(){return this.names_.concat(this.special_names_)},enumerable:!1,configurable:!1}),Object.defineProperty(f.prototype,"use",{get:function(){return function(e,t,i,n){n=void 0!==n&&!!n;var r=this.names_.indexOf(e);if(void 0!==t){if(!(r<0))return n?T.new_from_colors_and_indexes(this.filters_[r].filter_colors(t.colors_copy,i),t.indexes_copy,t.width,t.height):(t.set_colors(this.filters_[r].filter_colors(t.colors_copy,i)),t);if(n)switch(e){case"Sepia":return T.new_from_colors_and_indexes(this.filter_sepia_.filter_colors(t.colors_copy,i),t.indexes_copy,t.width,t.height);case"Screen":return T.new_from_colors_and_indexes(this.filter_screen_.filter_colors(t.colors_copy,i),t.indexes_copy,t.width,t.height);case"Difference":return T.new_from_colors_and_indexes(this.filter_difference_.filter_colors(t.colors_copy,i),t.indexes_copy,t.width,t.height);default:return T.new_from_colors_and_indexes(this.filter_greyscale_.filter_colors(t.colors_copy,i),t.indexes_copy,t.width,t.height)}else switch(e){case"Sepia":return t.set_colors(this.filter_sepia_.filter_colors(t.colors_copy,i)),t;case"Screen":return t.set_colors(this.filter_screen_.filter_colors(t.colors_copy,i)),t;case"Difference":return t.set_colors(this.filter_difference_.filter_colors(t.colors_copy,i)),t;default:return t.set_colors(this.filter_greyscale_.filter_colors(t.colors_copy,i)),t}}}},enumerable:!1,configurable:!1}),e.exports={Layer:T,Layers:s,Filters:f,split_image_data:S}},715:function(e,t,i){"use strict";!function(t){function n(e){var t,i,n,r=[];for(t=0,i=e.length;(0|t)<(0|i);t=(t+1|0)>>>0)(n=e.charCodeAt(t))<128?r.push(n):n<2048?r.push(192|n>>6,128|63&n):n<55296||n>=57344?r.push(224|n>>12,128|n>>6&63,128|63&n):(t++,n=65536+((1023&n)<<10|1023&e.charCodeAt(t)),r.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n));return new Uint8Array(r)}function r(){return 2==arguments.length?new r(arguments[1]).update(arguments[0]).digest():this instanceof r?void this.init.call(this,arguments[0]):new r(arguments[0])}function a(){return 2==arguments.length?new a(arguments[1]).update(arguments[0]).digest():this instanceof a?void this.init.call(this,arguments[0]):new a(arguments[0])}var o,s,_,l,h,c,d,p,u,f,m=i(927);m.UINT32.prototype.xxh_update=function(e,t){var i,n,r,a=s._low,_=s._high,l=e*a,h=l>>>16;h+=t*a,h&=65535,h+=e*_,n=(i=this._low+(65535&l))>>>16,n=(r=(r=(n+=this._high+(65535&h))<<16|65535&i)<<13|r>>>19)>>>16,h=(l=(i=65535&r)*(a=o._low))>>>16,h+=n*a,h&=65535,h+=i*(_=o._high),this._low=65535&l,this._high=65535&h},o=(0,m.UINT32)("2654435761"),s=(0,m.UINT32)("2246822519"),_=(0,m.UINT32)("3266489917"),l=(0,m.UINT32)("668265263"),h=(0,m.UINT32)("374761393"),r.prototype.init=function(e){return this.seed=e instanceof m.UINT32?e.clone():(0,m.UINT32)(e),this.v1=this.seed.clone().add(o).add(s),this.v2=this.seed.clone().add(s),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(o),this.total_len=0,this.memsize=0,this.memory=null,this},r.prototype.update=function(e){var i,r,a,o,s,_=!1;if("buffer"in e&&(e=e.buffer,e=new Uint8Array(e),_=!0),"string"==typeof e&&(e=n(e),_=!0),"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&(_=!0,e=new Uint8Array(e)),a=(i=0)+(r=e.length)|0,0==r)return this;if(this.total_len=this.total_len+r|0,0==this.memsize&&(this.memory=_?new Uint8Array(16):new t(16)),(this.memsize+r|0)<16)return _?this.memory.set(e.subarray(0,r),this.memsize):e.copy(this.memory,this.memsize,0,r),this.memsize=this.memsize+r|0,this;if((0|this.memsize)>0&&(_?this.memory.set(e.subarray(0,16-this.memsize|0),this.memsize):e.copy(this.memory,this.memsize,0,16-this.memsize),o=0,this.v1.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2|0]),o=(o+4|0)>>>0,this.v2.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2|0]),o=(o+4|0)>>>0,this.v3.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2|0]),o=(o+4|0)>>>0,this.v4.xxh_update(this.memory[o+1|0]<<8|this.memory[0|o],this.memory[o+3|0]<<8|this.memory[o+2]),i=i+16-this.memsize|0,this.memsize=0),(0|i)<=(a-16|0)){s=a-16|0;do{this.v1.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0,this.v2.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0,this.v3.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0,this.v4.xxh_update(e[i+1|0]<<8|e[0|i],e[i+3|0]<<8|e[i+2|0]),i=(i+4|0)>>>0}while((0|i)<=(0|s))}return(0|i)<(0|a)&&(_?this.memory.set(e.subarray(i,a),this.memsize):e.copy(this.memory,this.memsize,i,a),this.memsize=a-i|0),this},r.prototype.digest=function(){var e,t,i=this.memory,n=0,r=this.memsize,a=new m.UINT32;for((e=(0|this.total_len)>=16?this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18)))):this.seed.clone().add(h)).add(a.fromNumber(this.total_len));(0|n)<=(r-4|0);)a.fromBits(i[n+1]<<8|i[n],i[n+3]<<8|i[n+2]),e.add(a.multiply(_)).rotl(17).multiply(l),n=(n+4|0)>>>0;for(;(0|n)<(0|r);)a.fromBits(i[n++],0),e.add(a.multiply(h)).rotl(11).multiply(o);return t=e.clone().shiftRight(15),e.xor(t).multiply(s),t=e.clone().shiftRight(13),e.xor(t).multiply(_),t=e.clone().shiftRight(16),e.xor(t),this.init(this.seed),e},c=(0,m.UINT64)("11400714785074694791"),d=(0,m.UINT64)("14029467366897019727"),p=(0,m.UINT64)("1609587929392839161"),u=(0,m.UINT64)("9650029242287828579"),f=(0,m.UINT64)("2870177450012600261"),a.prototype.init=function(e){return this.seed=e instanceof m.UINT64?e.clone():(0,m.UINT64)(e),this.v1=this.seed.clone().add(c).add(d),this.v2=this.seed.clone().add(d),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(c),this.total_len=0,this.memsize=0,this.memory=null,this},a.prototype.update=function(e){var i,r,a,o,s,_,l;if("buffer"in e&&(e=e.buffer,i=!0),"string"==typeof e&&(e=n(e),i=!0),"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&(i=!0,e=new Uint8Array(e)),o=(r=0)+(a=0|e.length)|0,0==a)return this;if(this.total_len+=a,0==this.memsize&&(this.memory=i?new Uint8Array(32):new t(32)),this.memsize+a<32)return i?this.memory.set(e.subarray(0,a),this.memsize):e.copy(this.memory,this.memsize,0,a),this.memsize+=a,this;if(this.memsize>0&&(i?this.memory.set(e.subarray(0,32-this.memsize),this.memsize):e.copy(this.memory,this.memsize,0,32-this.memsize),s=0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v1.add(_.multiply(d)).rotl(31).multiply(c),s=(s+8|0)>>>0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v2.add(_.multiply(d)).rotl(31).multiply(c),s=(s+8|0)>>>0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v3.add(_.multiply(d)).rotl(31).multiply(c),s=(s+8|0)>>>0,_=(0,m.UINT64)(this.memory[s+1|0]<<8|this.memory[0|s],this.memory[s+3|0]<<8|this.memory[s+2|0],this.memory[s+5|0]<<8|this.memory[s+4|0],this.memory[s+7|0]<<8|this.memory[s+6|0]),this.v4.add(_.multiply(d)).rotl(31).multiply(c),r=r+32-this.memsize|0,this.memsize=0),(0|r)<=(o-32|0)){l=o-32|0;do{_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v1.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0,_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v2.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0,_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v3.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0,_=(0,m.UINT64)(e[r+1|0]<<8|e[0|r],e[r+3|0]<<8|e[r+2|0],e[r+5|0]<<8|e[r+4|0],e[r+7|0]<<8|e[r+6|0]),this.v4.add(_.multiply(d)).rotl(31).multiply(c),r=(r+8|0)>>>0}while(r<=l)}return r=32?((e=this.v1.clone().rotl(1)).add(this.v2.clone().rotl(7)),e.add(this.v3.clone().rotl(12)),e.add(this.v4.clone().rotl(18)),e.xor(this.v1.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u),e.xor(this.v2.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u),e.xor(this.v3.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u),e.xor(this.v4.multiply(d).rotl(31).multiply(c)),e.multiply(c).add(u)):e=this.seed.clone().add(f),e.add(a.fromNumber(this.total_len));(0|n)<=(r-8|0);)a.fromBits(i[n+1|0]<<8|i[0|n],i[n+3|0]<<8|i[n+2|0],i[n+5|0]<<8|i[n+4|0],i[n+7|0]<<8|i[n+6|0]),a.multiply(d).rotl(31).multiply(c),e.xor(a).rotl(27).multiply(c).add(u),n=(n+8|0)>>>0;for((n+4|0)<=(0|r)&&(a.fromBits(i[n+1|0]<<8|i[0|n],i[n+3|0]<<8|i[n+2|0],0,0),e.xor(a.multiply(c)).rotl(23).multiply(d).add(p),n=(n+4|0)>>>0);(0|n)<(0|r);)a.fromBits(i[n++],0,0,0),e.xor(a.multiply(f)).rotl(11).multiply(c);return t=e.clone().shiftRight(33),e.xor(t).multiply(d),t=e.clone().shiftRight(29),e.xor(t).multiply(p),t=e.clone().shiftRight(32),e.xor(t),this.init(this.seed),e},e.exports={h32:r,h64:a}}(i(208).Buffer)},717:function(e,t,i){"use strict";function n(e,t,i){var n,r;return e|=0,t|=0,n=new Uint8Array(e),void 0!==i?(n.fill(255),n.set(i,0)):n.fill(255),(r={number_length_index_byte:Uint32Array.of(e,t,0,0),hover_data_in_layer:new Uint8Array(t),indexes_data_for_layers:new Uint32Array(t),colors_data_in_layers_uint32:new Uint32Array(t*e),layers_opacity_255:n}).colors_data_in_layers_uint32_SIMDope=new h(r.colors_data_in_layers_uint32.buffer),r}function r(e,t,i,r){if(t|=0,i|=0,void 0===e)return n(t,i,r);if(null===e)return n(t,i,r);var a=c(t,e.layer_number);return d(a,0)||y(e.max_length,i)?n(t,i,r):(e.number_length_index_byte[0]=0|t,e.number_length_index_byte[1]=0|i,e.number_length_index_byte[2]=0,e.number_length_index_byte[3]=0,void 0!==r?(e.layers_opacity_255.fill(255),e.layers_opacity_255.set(r)):e.layers_opacity_255.fill(255),e)}var a=i(648),o=(0,a.SIMDopeCreateConfAdd)({create:{new_of:!0},properties:{buffer:!0},methods:{get_use_element:!0,set_tail:!0,set_from_simdope:!0,set_from_buffer:!0,get_tail:!0,get_tail_opacity:!0,reset_tail:!0,is_dark:!0,blend_first_with:!0,blend_first_with_tails:!0,is_not_fully_transparent:!0,copy:!0}}),s=(0,a.SIMDopeCreate)(o),_=s.simdops,l=s.Color,h=s.Colors,c=_.minus_int,d=_.int_not_equal,p=_.plus_int,u=_.plus_uint,f=(_.minus_uint,_.multiply_int),m=_.multiply_uint,g=(_.divide_uint,_.clamp_uint8),A=_.clamp_uint32,y=(_.int_equal,_.uint_less),v=(_.int_less,_.int_greater_equal,_.uint_not_equal,_.uint_less_equal,_.min_uint,function e(t){return t=t||{},this instanceof e?(this.state_=n(t.layer_number||1,t.max_length||1,t.layers_opacity_255||new Uint8Array(0)),this.number_length_index_byte_=this.state_.number_length_index_byte,this.hover_data_in_layer_=this.state_.hover_data_in_layer,this.indexes_data_for_layers_=this.state_.indexes_data_for_layers,this.colors_data_in_layers_uint32_=this.state_.colors_data_in_layers_uint32,this.shadow_state_=((i=i||{base_rgba_colors_for_blending:new Uint32Array(0),color_less_uint8x4:l.new_of(255,255,255,255),color_full_uint8x4:l.new_of(0,0,0,255),layers_color:[],all_layers_length:0,used_colors_length:0}).base_rgba_colors_for_blending_SIMDope=new h(i.base_rgba_colors_for_blending.buffer),i),this.data_array_=[],this.destination_rgba_colors_for_blending_,this.destination_rgba_colors_for_blending_SIMDope_,this):new e(t);var i});Object.defineProperty(v.prototype,"state",{get:function(){return this.state_},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_state",{get:function(){return function(e){return this.state_=e,this.number_length_index_byte_=this.state_.number_length_index_byte,this.hover_data_in_layer_=this.state_.hover_data_in_layer,this.indexes_data_for_layers_=this.state_.indexes_data_for_layers,this.colors_data_in_layers_uint32_=this.state_.colors_data_in_layers_uint32,this.state_}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_shadow_state",{get:function(){return function(e){return this.shadow_state_=e}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"get_updated_shadow_state",{get:function(){return function(){return this.shadow_state_.layers_color.length=this.number_length_index_byte_[2]?this.shadow_state_.base_rgba_colors_for_blending.fill(0,0,this.shadow_state_.used_colors_length):(this.shadow_state_.base_rgba_colors_for_blending=new Uint32Array(0|this.number_length_index_byte_[2]),this.shadow_state_.base_rgba_colors_for_blending_SIMDope=new h(this.shadow_state_.base_rgba_colors_for_blending.buffer))),this.shadow_state_.all_layers_length=0|this.number_length_index_byte_[0],this.shadow_state_.max_used_colors_length=0|this.number_length_index_byte_[1],this.shadow_state_.used_colors_length=0|this.number_length_index_byte_[2],this.shadow_state_}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"shadow_state",{get:function(){return this.shadow_state_},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_bytes_index",{get:function(){return function(e){return this.number_length_index_byte_[3]=0|e}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"data_array",{get:function(){return this.data_array_},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"set_data_array",{get:function(){return function(e,t){this.data_array_=e,t&&(this.destination_rgba_colors_for_blending_=t,this.destination_rgba_colors_for_blending_SIMDope_=new h(this.destination_rgba_colors_for_blending_.buffer))}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"bytes_index",{get:function(){return function(){return 0|this.number_length_index_byte_[3]}},enumerable:!1,configurable:!1}),v.init=function(e,t,i){return new v({layer_number:e,max_length:t,layers_opacity_255:i})},Object.defineProperty(v.prototype,"for",{get:function(){return function(e,t){this.indexes_data_for_layers_[this.number_length_index_byte_[2]]=A(e),this.hover_data_in_layer_[this.number_length_index_byte_[2]]=g(t),this.number_length_index_byte_[2]=u(this.number_length_index_byte_[2],1)}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"next",{get:function(){return function(){this.number_length_index_byte_[3]=u(this.number_length_index_byte_[3],1)}},enumerable:!1,configurable:!1}),Object.defineProperty(v.prototype,"stack",{get:function(){return function(e,t){this.colors_data_in_layers_uint32_[u(m(this.number_length_index_byte_[0],this.number_length_index_byte_[3]),g(e))]=A(t)}},enumerable:!1,configurable:!1}),v.prototype.blend=function(e,t){var i,n,r,a,o,s,_,c,d,g,A,v,w,x,b,C,E,U;return t|=0,i=this.get_updated_shadow_state(),n=i.base_rgba_colors_for_blending,r=i.base_rgba_colors_for_blending_SIMDope,a=i.all_layers_length,o=i.used_colors_length,s=i.layers_colors,_=i.color_less_uint8x4,c=i.color_full_uint8x4,d=this.state,g=d.colors_data_in_layers_uint32_SIMDope,A=d.hover_data_in_layer,v=d.layers_opacity_255,w=d.indexes_data_for_layers,x=this.destination_rgba_colors_for_blending_SIMDope_,b=this.data_array.map((function(e){return new h(e.data.buffer)})),C=b.length||0,E=s[0],U=new l(new ArrayBuffer(4)),new Promise((function(e){var i=new Uint32Array(6);if(i[4]=0|o,i[5]=0|C,x){for(i[3]=0;y(i[3],a+1);i[3]=p(i[3],1))s[i[3]].set_tail(s[i[3]+1|0],v[i[3]]);for(;y(i[2],i[4]);i[2]=u(i[2],1)){for(x.get_use_element(w[i[2]],E),E.is_not_fully_transparent()&&E.set_from_simdope(U),i[0]=m(i[2],a),i[3]=0;y(i[3],i[5]);i[3]=u(i[3],1))b[i[3]].get_use_element(w[i[2]],s[i[3]+1|0]);for(i[3]=i[5];y(i[3],a);i[3]=u(i[3],1))i[1]=u(i[0],i[3]),g.get_use_element(i[1],s[i[3]+1|0]);(0|A[i[2]])>0?(E.blend_first_with_tails(t),E.blend_first_with(E.is_dark()?_:c,A[i[2]],!1,!1)):E.blend_first_with_tails(t)}e(Array.of(w.subarray(0,o)))}else{for(i[3]=0;y(i[3],a+1);i[3]=p(i[3],1))s[i[3]].set_tail(s[i[3]+1|0],v[i[3]]);for(;y(i[2],i[4]);i[2]=u(i[2],1)){for(r.get_use_element(i[2],E),E.is_not_fully_transparent()&&E.set_from_simdope(U),i[0]=f(i[2],a),i[3]=0;y(i[3],i[5]);i[3]=p(i[3],1))b[i[3]].get_use_element(w[i[2]],s[i[3]+1|0]);for(i[3]=i[5];y(i[3],a);i[3]=p(i[3],1))i[1]=p(i[0],i[3]),g.get_use_element(i[1],s[i[3]+1|0]);(0|A[i[2]])>0?(E.blend_first_with_tails(t),E.blend_first_with(E.is_dark()?_:c,A[i[2]],!1,!1)):E.blend_first_with_tails(t)}e(Array.of(w.subarray(0,i[4]),n.subarray(0,i[4])))}}))},v.prototype.build=function(e,t,i,r,a){e=(0|e)>>>0,t=(0|t)>>>0,r=r||[],this.set_bytes_index(0),this.set_state(n(e,t,i)),this.set_data_array(r,a)},v.prototype.update=function(e,t,i,n,a){e=(0|e)>>>0,t=(0|t)>>>0,n=n||[],this.set_bytes_index(0),this.set_state(r(this.state,e,t,i)),this.set_data_array(n,a)},v.prototype.clear=function(){this.set_bytes_index(0),this.set_state(r(this.state,1,1)),this.set_data_array([],new Uint32Array(0))},e.exports=v},718:function(e,t,i){"use strict";!function(t){function n(e){return e&&e.__esModule?e:{default:e}}var r=n(i(715)),a=n(i(716)),o={_get_64_js:function(){return{xxh_f:{create64:function(e){return r.default.h64(e)}},xxh_v:"64",xxh_t:"js",xxh_tt:Date.now()}},_get_64_wasm:function(){return new Promise((function(e,t){try{(0,a.default)().then((function(t){e({xxh_f:{hasher:t,create64:function(e){return this.hasher.create64(BigInt(e))}},xxh_v:"64",xxh_t:"wasm",xxh_tt:Date.now()})})).catch((function(e){t()}))}catch(i){t()}}))},new:function(){var e=Uint8Array.from("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((function(e){return e.charCodeAt(0)}))),i=BigInt(e.length),n=new Uint8Array(14),r=this._get_64_js,a=this._get_64_wasm,o=r();return a().then((function(e){o=e})),{get_info:function(){return{version:o.xxh_v,type:o.xxh_t,timestamp:o.xxh_tt}},base58_that:function(r){for(var a=0,s=BigInt(0),_=(BigInt(o.xxh_f.create64(64222).update(r instanceof Uint8Array||r instanceof Uint8ClampedArray?r:new Uint8Array("string"==typeof r?t.from(r):"buffer"in r?r.buffer:r)).digest()));_>0;)s=_%i,_/=i,n[0|a]=65535&e[s],a=a+1&15;return""+String.fromCharCode.apply(null,n.slice(0,0|a))}}}};e.exports=o}(i(208).Buffer)},930:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=n(i(717)),a=i(648),o=n(i(718)),s=Object.create(o.default).new(),_={_create_state:function(e,t,i,n,r,a,o,s){var _=Array.from(n.map((function(e){return Uint16Array.from(e)}))),l=Array.from(r.map((function(e){return Uint32Array.from(e)}))),h=Array.from(a.map((function(e){return Object.assign({},e)})));return Object.assign({},{w:t|=0,h:i|=0,sp:_,spc:l,l:h,s:o,wp:s})},from:function(e,t,i,n,o,_,l,h){var c=this._create_state,d=c(e,t,i,n,o,_,l,h);return{new:function(e,t,i,n,r,a,o,s){d=c(e,t,i,n,r,a,o,s)},destroy:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};null!==d?(d=null,e()):e("ok")},render:function(){return null!==d?function(e,t,i,n,o,_,l){return new Promise((function(h,c){var d,p,u,f,m;for(_|=0,d=(e|=0)*(t|=0)|0,p=0|n.length,u=r.default.init(p,d,Uint8Array.from(o.map((function(e){return e.hidden?0:Math.round(255*parseFloat(e.opacity))})))),f=0,m=0;(0|f)<(0|d);f=(f+1|0)>>>0){for(u.for(f,0),m=0;(0|m)<(0|p);m=(m+1|0)>>>0)u.stack(0|m,n[0|m][i[0|m][0|f]]);u.next()}u.blend(!1,!1).then((function(i){var n,r,o,d,p=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i,n,r=[],a=!0,o=!1,s=void 0;try{for(i=e[Symbol.iterator]();!(a=(n=i.next()).done)&&(r.push(n.value),2!==r.length);a=!0);}catch(_){o=!0,s=_}finally{try{!a&&i.return&&i.return()}finally{if(o)throw s}}return r}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(i),u=(p[0],p[1]),f=new a.Colors(u),m=[];if(l)for(n=new a.Colors(f.get_deduplicated_uint32a()),m=Array(n.length).fill(""),r=new a.Color(new ArrayBuffer(4)),o=0;o>> 0) { full_pxls[i|0] = (pxl_colors[pxls[i|0]] | 0) >>> 0; }\n let image_data = new ImageData(new Uint8ClampedArray(full_pxls.buffer), pxl_width, pxl_height);\n \n return new Promise(function(resolve, reject) {\n createImageBitmap(image_data).then(function(r){resolve(r);});\n });\n };\n ')()},from:function(e){var t=this._create_func(),i=this._create_state,n=e||null;return{render:function(e,r,a,o,s){var _=i(e,r,a,o);n?n.exec(t,[_.w,_.h,_.p,_.pc]).catch((function(){return t(_.w,_.h,_.p,_.pc)})).then((function(e){s(e)})):t(_.w,_.h,_.p,_.pc).then((function(e){s(e)}))}}}};e.exports=n},932:function(e,t,i){"use strict";var n,r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i,n,r=[],a=!0,o=!1,s=void 0;try{for(i=e[Symbol.iterator]();!(a=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);a=!0);}catch(_){o=!0,s=_}finally{try{!a&&i.return&&i.return()}finally{if(o)throw s}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=i(654),o=i(648),s=i(688),_=i(933);a.SetFixed.compute=function(e,t,i,n){var r,a=t.bitArrayData,o=[0].concat(i.map((function(e){return e.bitArrayData})));for(r=0;(0|r)<(0|e);r=(r+1|0)>>>0)o[0]=0|r,a[0|r]=n.apply(null,o)},n={init:function(e,t,i,n,l,h){o.simdops.clamp_uint32;var c=o.simdops.plus_uint,d=o.simdops.uint_less,p=(o.simdops.int_less,o.simdops.uint_equal,o.simdops.uint_not_equal,o.simdops.clamp_uint8,{index_changes:new Uint32Array(0),color_changes:new Uint32Array(0),_pxl_indexes_updated:new a.SetFixed(0),_pxl_indexes_of_selection_drawn:new a.SetFixed(0),_pxl_indexes_of_current_shape:new a.SetFixed(0),_pxl_indexes_of_old_shape:new a.SetFixed(0),_old_pxls_hovered:new a.SetFixed(0),_old_selection_pair_highlight:!0,_old_layers_string_id:"",_old_pxl_width:0,_old_pxl_height:0,_last_paint_timestamp:0,_is_there_new_dimension:!0,_did_hide_canvas_content:!1,_previous_imported_image_pxls_positioned_keyset:new a.SetFixed(0)}),u={super_state:e,super_canvas:t,super_blend:i,canvas_pos:n,color_conversion:l,sraf:h},f={position:function(){},selection:function(){},color:function(){},action:function(){},update:function(){}},m=(new Uint32Array(0),new Uint32Array(0),""),g=void 0,A=u.canvas_pos.get_state().sizes,y=function e(t,i,n,r){var a,o,s,_,l,h,c;p._last_paint_timestamp>=r?t():(a=p._old_pxl_width,o=p._old_pxl_height,_=(s=u.super_state.get_state()).pxl_width,l=s.pxl_height,u.super_canvas.ok()?(A=u.canvas_pos.get_state().sizes,h=!(parseInt(a)===parseInt(_)&&parseInt(o)===parseInt(l)),(c=parseInt(A.width)!==parseInt(_)||parseInt(A.height)!==parseInt(l))||h?(u.super_state.set_state({pxl_width:parseInt(A.width),pxl_height:parseInt(A.height)}),p._is_there_new_dimension=!0,f.update(!1,!1).then((function(){setTimeout((function(){p._is_there_new_dimension=!1,f.update(!1,!1)}),500),g(h,c,n,r).catch((function(){setTimeout(e,1,t,i,n,r)}))})).catch((function(){setTimeout(e,2,t,i,n,r)}))):g(h,c,n,r).catch((function(){setTimeout(e,1,t,i,n,r)}))):setTimeout(e,3,t,i,n,r))},v=new a.SetFixed(A.width*A.height),w=function(e,i,n,r,o,s){var _,l,h,f,m,g,A,w,x,b,C,E,U,I,S,R,T,B,F,P,O,k,M,Q,D,N,L,Y,G,V,j,z,K,X,J,q,W,H,Z,$,ee,te,ie,ne,re,ae,oe,se,_e,le,he,ce,de,pe,ue,fe,me,ge,Ae,ye;if(p._last_paint_timestamp>=s)e();else{for(_=function(){setTimeout(y,1,e,i,o,s)},l=function(e,t){return((e=(0|e)>>>0)^(t=(0|t)>>>0))>>>0},h=function(e,t){return((e=(0|e)>>>0)&(t=(0|t)>>>0))>>>0},f=function(e,t){return((e=(0|e)>>>0)|(t=(0|t)>>>0))>>>0},m=function(e,t,i,n,r,a,o,s,_){return e=(0|e)>>>0,f(Ae[0],f(f(f(t[e],i[e]),l(n[e],r[e])),f(f(l(a[e],o[e]),h(a[e],ge[0])),f(s[e],_[e]))))},g=p._is_there_new_dimension,A=p._did_hide_canvas_content,w=p._old_pxls_hovered,x=p._old_layers_string_id,b=p._pxl_indexes_of_old_shape,C=p._pxl_indexes_of_current_shape,E=p._pxl_indexes_of_selection_drawn,U=p._previous_imported_image_pxls_positioned_keyset,I=p._old_selection_pair_highlight,R=(S=u.super_state.get_state())._s_layers,T=S._layer_index,B=S._layers,F=S.select_mode,P=S.hide_canvas_content,O=S.pxl_width,k=S.pxl_height,M=S._pxls_hovered,Q=S.tool,D=S._shape_index_a,N=S._select_shape_index_a,L=S._pxl_indexes_of_selection,Y=S._paint_or_select_hover_pxl_indexes,G=S._selection_pair_highlight,j=(V=u.super_state.get_imported_image_data()).imported_image_pxls_positioned,z=V.imported_image_pxl_colors,K=V.imported_image_pxls_positioned_keyset,X=V.image_imported_resizer_index,J=K.size>0,q=0|R.length,W=R[0].indexes.length,Z=(H=q+(J?1:0))-1,$=""+Array.from(B).map((function(e,t){return t+"-id-"+e.id+"-v-"+(e.hidden||P?"0":"1")+"-o-"+parseInt(255*e.opacity).toString(16)+"-w-"+e.width+"-h-"+e.height+"-end"})).join("+"),ee=A!==P||x!==$||g||n||o,te=Uint8Array.from(B.map((function(e){return parseInt(e.hidden||P?0:Math.round(255*parseFloat(e.opacity)))})).concat(J?[196]:[])),"LINE"!==Q&&"RECTANGLE"!==Q&&"ELLIPSE"!==Q&&"TRIANGLE"!==Q||-1===D||-1===M?"SELECT LINE"!==Q&&"SELECT RECTANGLE"!==Q&&"SELECT ELLIPSE"!==Q||-1===N||-1===M?("SELECT PATH"===Q||"CONTOUR"===Q)&&Y.size>0&&(ie=Y[0],ne=Y[Y.size-1],re=u.super_state.shape_creator.from_line(ie,ne),"REMOVE"===F&&"SELECT PATH"===Q?re.forEach((function(e){L.delete(e)})):"SELECT PATH"===Q?re.forEach((function(e){L.add(e)})):re.forEach((function(e){C.add(e)}))):C="SELECT LINE"===Q?u.super_state.shape_creator.from_line(N,M,C):"SELECT RECTANGLE"===Q?u.super_state.shape_creator.from_rectangle(N,M,C):"SELECT ELLIPSE"===Q?u.super_state.shape_creator.from_ellipse(N,M,C):C:C="LINE"===Q?u.super_state.shape_creator.from_line(D,M,C):"RECTANGLE"===Q?u.super_state.shape_creator.from_rectangle(D,M,C):"ELLIPSE"===Q?u.super_state.shape_creator.from_ellipse(D,M,C):C,ae=0,oe=0,se=R[T]||{},_e=u.super_canvas.render.bind(u.super_canvas),he=(le=u.super_blend).for.bind(le),ce=le.next.bind(le),de=le.stack.bind(le),pe=G!==I,le.update(0|H,0|W,te,R,t.getUint32()),ue=C.has.bind(C),fe=L.has.bind(L),me=K.has.bind(K),ge=pe?Uint32Array.of(4294967295):Uint32Array.of(0),Ae=ee?Uint32Array.of(4294967295):Uint32Array.of(0),X>=0&&C.add(X),C.add(M),v.length!==W&&(v=new a.SetFixed(W)),a.SetFixed.compute(W,v,Array.of(se.setFixed,w,b,C,E,L,U,K),m),ye=v.has.bind(v);d(oe,W);oe=c(oe,1))ye((0|oe)>>>0)&&(ue((0|oe)>>>0)?he((0|oe)>>>0,128):fe(oe)?he((0|oe)>>>0,72+48*((ae=oe%O|0)+((oe-ae)/O|0)+(G?1:0)&1)|0):he((0|oe)>>>0,0),me(oe)&&de((0|Z)>>>0,(0|z[0|j[(0|oe)>>>0]])>>>0),ce());le.blend(!1,!1).then((function(t){t[0].length>0||ee||n||o?u.super_canvas.check(O,k).catch(_).then((function(){u.super_canvas.prender().finally((function(){w.clearAndBulkAdd(Uint32Array.of(X,M)),se.clear_changes(),E.setFromSetFixed(L),U.setFromSetFixed(K),u.sraf.run_frame((function(){return p._old_selection_pair_highlight=G,p._old_layers_string_id=""+$,p._did_hide_canvas_content=!!P,p._old_pxl_width=parseInt(O),p._old_pxl_height=parseInt(k),p._last_paint_timestamp=+s,b.setFromSetFixed(C),C.clear(),_e()}),!1,ee||n||o,Date.now(),"render").finally(e)}))})):e()}))}};return{get:function(){return p},set:function(e){for(m in e)p[m]=e[m];return Promise.resolve()},set_notifiers:function(){f={position:arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},selection:arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},color:arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},action:arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},update:arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){}}},is_there_new_dimension:function(){return p._is_there_new_dimension&&!0},update_canvas:function(e,t){return e=e||!1,t=t||Date.now(),void 0===g&&this&&(g=this.render_canvas),new Promise(y)},render_canvas:function(e,t,i,n){return new Promise(w)},_should_remove_not_perfect_second_latest_pixel_from_array:function(e){var t,i,n,r,a,o,s,_,l,h=u.super_state.get_state().pxl_width;return e.size>=3&&(n=((t=0|e[e.size-1])-(i=t%h|0))/h,o=((r=0|e[e.size-2])-(a=r%h|0))/h,l=((s=0|e[e.size-3])-(_=s%h|0))/h,1==(0|Math.abs(i-_))&&1==(0|Math.abs(n-l))&&(i===a&&o===l||n===o&&a===_))},_handle_canvas_mouse_move:function(e){var t,i,n,o,s,l,h,c,d,p,f,m,g,A,y,v,w,x,b,C,E,U,I,S,R,T,B,F,P,O=this,k=u.super_state.get_state(),M=k._pxl_indexes_of_selection,Q=k._imported_image_pxls,D=k.pxl_current_color_uint32,N=k.tool,L=k.pxl_width,Y=k.pxl_height,G=k._pxls_hovered,V=k.hide_canvas_content,j=k._is_on_resize_element,z=k._paint_or_select_hover_pxl_indexes,K=k._paint_hover_old_pxls_snapshot,X=k._last_action_timestamp,J=k._paint_or_select_hover_pxl_indexes_exception,q=k._paint_or_select_hover_actions_latest_index,W=k._s_layers,H=k._layer_index,Z=k.pxl_current_opacity,$=k._select_hover_old_pxls_snapshot,ee=k.select_mode,te=u.canvas_pos.get_pointer_state(),ie=te.event_button,ne=te.mouse_down,re=ie+1|0,ae=W[H]||{},oe=u.canvas_pos.get_canvas_pos_from_event(e.pageX,e.pageY),se=r(oe,2),_e=se[0],le=se[1],he=le*L+_e|0;-1==(0|_e)||-1==(0|le)?this._notify_position_change({x:_e,y:le}):(0|he)==(0|G)||V?G!==he&&u.super_state.set_state({_pxls_hovered:0|he,_mouse_inside:!0}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})})):Q.length>0?(i=(t=u.super_state.get_state())._imported_image_move_from,n=t._imported_image_scale_delta_x,o=t._imported_image_scale_delta_y,s=t._imported_image_start_x,l=t._imported_image_start_y,m=(0|he)==(0|(f=s+(d=(h=t._imported_image_width)+n)+(l+(p=(c=t._imported_image_height)+o))*L))||(0|G)==(0|f),g=0,A=_e-i[0],y=le-i[1],i=Array.of(_e,le),1===re&&ne?m||j?(g=o+y|0,n=0|Math.max(n+A|0,-(h-1)),o=0|(g=0|Math.max(g,-(c-1))),u.super_state.set_state({_pxls_hovered:0|he,_is_on_resize_element:m,_mouse_inside:!0,_imported_image_scale_delta_x:n,_imported_image_scale_delta_y:o,_imported_image_move_from:Array.of(i[0],i[1])}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})}))):(s=(s=(s=s+A|0)<-d?-d:0|s)>=L?L:0|s,l=(l=(l=l+y|0)<-p?-p:0|l)>=Y?Y:0|l,u.super_state.set_state({_pxls_hovered:0|he,_is_on_resize_element:m,_mouse_inside:!0,_imported_image_start_x:s,_imported_image_start_y:l,_imported_image_move_from:Array.of(i[0],i[1])}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})}))):u.super_state.set_state({_pxls_hovered:0|he,_is_on_resize_element:m,_mouse_inside:!0}).then((function(){O._notify_position_change({x:_e,y:le})}))):"PENCIL"!==N&&"PENCIL PERFECT"!==N&&"CONTOUR"!==N||1!==re||!ne?"SELECT PIXEL"!==N&&"SELECT PIXEL PERFECT"!==N&&"SELECT PATH"!==N||1!==re||!ne?((P=u.super_state.get_state())._s_layers,P._layer_index,z.clear(),u.super_state.set_state({_pxls_hovered:0|he,_mouse_inside:!0,_paint_or_select_hover_actions_latest_index:-1,_paint_or_select_hover_pxl_indexes:z}).then((function(){O.update_canvas(),O._notify_position_change({x:_e,y:le})}))):(-1===q&&(q=he),T=u.super_state.shape_creator.from_line(q,he),"SELECT PATH"===N?(X=1/0,T.forEach((function(e){z.add(0|e)}))):"SELECT PIXEL"===N?(X=Date.now(),T.forEach((function(e){z.add(0|e)}))):"SELECT PIXEL PERFECT"===N&&(X=Date.now(),T.forEach((function(e){z.add(0|e)})),B=z.indexes,this._should_remove_not_perfect_second_latest_pixel_from_array(B)&&(F=B[B.length-2],$.includes(F)||"ADD"!==ee&&"REPLACE"!==ee||M.delete(F),z.delete(F))),"REPLACE"===ee&&M.clear(),z.forEach((function(e){"ADD"===ee||"REPLACE"===ee?M.add(e):M.delete(e)})),u.super_state.set_state({_pxls_hovered:0|he,_mouse_inside:!0,_pxl_indexes_of_selection:M,_paint_or_select_hover_pxl_indexes:z,_paint_or_select_hover_actions_latest_index:he,_last_action_timestamp:X}).then((function(){O.update_canvas(),O._notify_is_something_selected(),O._notify_position_change({x:_e,y:le})}))):(-1===q&&(q=0|he),z=u.super_state.shape_creator.from_line(q,he,z),w=(v=u.super_state.get_state()).pencil_mirror_mode,x=v._pencil_mirror_index,C=(x-(b=x%L))/L,"CONTOUR"===N?X=1/0:"PENCIL"===N?X=Date.now():"PENCIL PERFECT"===N&&(X=Date.now(),J.forEach((function(e){z.delete(e)})),this._should_remove_not_perfect_second_latest_pixel_from_array(z.indexes)&&(E=z[z.size-2],z.delete(E),J.add(E),(U=new _.Set(Array.of(E))).forEach((function(e){var t=r(e,2),i=t[0],n=t[1],a=i-2*(i-b);a>=0&&a=0&&n<=Y&&U.add(n*L+a)})),U.forEach((function(e){ae.set_uint32(e,K[e])})))),"NONE"!==w?(I=new a.SetFixed(z),S=new _.Set(z.filter((function(e){return!I.has(0|e)&&!J.has(0|e)})).map((function(e){var t=e%L|0;return[0|t,0|(e-t)/L]}))),"VERTICAL"!==w&&"BOTH"!==w||S.forEach((function(e){var t=r(e,2),i=t[0],n=t[1],a=n-2*(n-C),o=i;o>=0&&o=0&&a<=Y&&S.add([o,a])})),"HORIZONTAL"!==w&&"BOTH"!==w||S.forEach((function(e){var t=e[1],i=e[0]-2*(e[0]-b);i>=0&&i=0&&t<=Y&&S.add([i,t])})),R=new a.SetFixed(L*Y),S.forEach((function(e){var t=e[1],i=e[0];R.add(t*L+i|0)})),u.super_state.paint_shape(R,D,Z,{_pxls_hovered:0|he,_mouse_inside:!0,_paint_or_select_hover_pxl_indexes:z,_paint_or_select_hover_pxl_indexes_exception:J,_paint_or_select_hover_actions_latest_index:0|he,_last_action_timestamp:X},(function(){O.update_canvas()}))):u.super_state.paint_shape(z.indexes,0|D,Z,{_pxls_hovered:0|he,_mouse_inside:!0,_paint_or_select_hover_pxl_indexes:z,_paint_or_select_hover_pxl_indexes_exception:J,_paint_or_select_hover_actions_latest_index:0|he,_last_action_timestamp:X},(function(){O.update_canvas()})),this._notify_position_change({x:0|_e,y:0|le}))},_notify_position_change:function(e,t){var i,n;t=t||Date.now(),i=0|u.super_state.get_notified_pos_at(),((n=0|Date.now())-i|0)>=30&&null==t||(0|t)>(0|i)&&(n-t|0)>=30?(e={x:void 0===e.x?-1:e.x,y:void 0===e.y?-1:e.y},u.super_state.set_state({_notified_position_at:n}).then((function(){f.position(e,u.sraf.get_state().previous_cpaf_fps)}))):(0|n)<(t+30|0)&&setTimeout(this._notify_position_change,30-(t-n|0)|0,{x:e.x,y:e.y},0|n)},_handle_canvas_mouse_up:function(){var e,t,i,n,r=this,a=u.super_state.get_state(),o=a._paint_or_select_hover_pxl_indexes,s=a.tool,_=a._imported_image_pxls,l=a._pxl_indexes_of_selection,h=a.select_mode;_.length>0?u.super_state.set_state({_imported_image_move_from:[-1,-1]}):o.size>0&&"CONTOUR"===s?(t=(e=u.super_state.get_state()).pxl_current_opacity,i=e.pxl_current_color_uint32,u.super_state.paint_shape(u.super_state.shape_creator.from_path(o.indexes),i,t,{_last_action_timestamp:Date.now()},(function(){o.clear(),r.update_canvas()}))):o.size>0&&"SELECT PATH"===s&&(n=u.super_state.shape_creator.from_path(o.indexes),"REPLACE"===h&&l.clear(),"ADD"===h||"REPLACE"===h?n.forEach((function(e){l.add(e)})):n.forEach((function(e){l.delete(e)})))},_handle_canvas_mouse_down:function(e){var t,i,n,o,l,h,c,d,p,f,m,g,A,y,v,w,x,b,C,E,U,I,S,R,T,B,F,P,O,k,M,Q,D,N,L,Y,G,V,j,z,K,X,J,q,W,H,Z,$,ee,te,ie,ne,re,ae,oe,se,_e,le,he,ce,de,pe,ue,fe,me,ge,Ae,ye,ve,we,xe,be,Ce,Ee,Ue=this,Ie=u.super_state.get_state(),Se=Ie.pxl_current_color,Re=Ie.pxl_current_color_uint32,Te=Ie.hide_canvas_content,Be=Ie.tool,Fe=Ie.pxl_width,Pe=Ie.pxl_height,Oe=Ie.pxl_current_opacity,ke=Ie.bucket_threshold,Me=Ie.select_mode,Qe=e.button+1,De=-1,Ne=-1;if(-1!==u.super_state.get_state()._pxls_hovered&&null===e?(De=t=u.super_state.get_state()._pxls_hovered%Fe,Ne=(u.super_state.get_state()._pxls_hovered-t)/Fe):e&&(i=u.canvas_pos.get_canvas_pos_from_event(e.pageX,e.pageY),De=(n=r(i,2))[0],Ne=n[1]),-1!==De&&-1!==Ne)if(l=(o=u.super_state.get_state())._shape_index_a,h=o._select_shape_index_a,o._shape_index_b,o._select_shape_index_b,c=o._pxl_indexes_of_selection,d=o._s_layers,p=o._layer_index,f=o.hue,m=Ne*Fe+De,y=void 0!==(A=void 0!==(g=d[p]||{})?g.indexes:void 0)?A[m]:-1,-1!==Qe){if(3===Qe&&(l=-1,h=-1),v=u.super_state.get_state()._imported_image_pxls,u.super_state.set_state({_pxls_hovered:0|m,_mouse_inside:!0,_paint_or_select_hover_actions_latest_index:-1,_paint_hover_old_pxls_snapshot:g.indexes_copy||new Uint8Array(0),_select_hover_old_pxls_snapshot:new a.SetFixed(c)}),!Te)if(w=g.indexes_copy||new Uint8Array(0),x=Array.from(g.colors_copy||new Uint32Array(0)),v.length>0&&1===Qe)u.super_state.set_state({_imported_image_move_from:[De,Ne]});else if(2===Qe||"MOVE"===Be&&v.length<=0&&(1===Qe||-1===Qe))u.super_state.set_state({_imported_image_move_from:[e.x,e.y]});else if("PICKER"===Be&&1===Qe)b=this.get_pixel_color_from_pos(De,Ne),this._notify_current_color_change(b),this._notify_relevant_action_event(e,b,1);else if("EXCHANGE"===Be&&1===Qe)C=g.colors[y],this.exchange_pixel_color(C,Re),this._notify_relevant_action_event(e,Re,1);else if("LINE"===Be||"RECTANGLE"===Be||"ELLIPSE"===Be)if(-1===l)1===Qe?u.super_state.set_state({_shape_index_a:m}).then((function(){Ue.update_canvas()})):u.super_state.set_state({_shape_index_a:l}).then((function(){Ue.update_canvas()}));else{switch(E=void 0,Be){case"LINE":E=u.super_state.shape_creator.from_line(l,m);break;case"RECTANGLE":E=u.super_state.shape_creator.from_rectangle(l,m);break;case"ELLIPSE":E=u.super_state.shape_creator.from_ellipse(l,m)}u.super_state.paint_shape(E.indexes,Re,Oe,{_shape_index_a:-1,_last_action_timestamp:Date.now()},(function(){Ue.update_canvas()})),this._notify_relevant_action_event(e,"#ffffffff",.6)}else if("SELECT LINE"===Be||"SELECT RECTANGLE"===Be||"SELECT ELLIPSE"===Be)-1===h?1===Qe?u.super_state.set_state({_select_shape_index_a:m}).then((function(){Ue.update_canvas()})):u.super_state.set_state({_select_shape_index_a:h}).then((function(){Ue.update_canvas()})):(U="SELECT LINE"===Be?u.super_state.shape_creator.from_line(h,m):"SELECT RECTANGLE"===Be?u.super_state.shape_creator.from_rectangle(h,m):u.super_state.shape_creator.from_ellipse(h,m),"REPLACE"===Me&&c.clear(),"ADD"===Me||"REPLACE"===Me?U.forEach((function(e){c.add(e)})):U.forEach((function(e){c.delete(e)})),U.clear(),u.super_state.set_state({_pxl_indexes_of_selection:c,_select_shape_index_a:-1,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()})));else if("SELECT PIXEL"!==Be&&"SELECT PATH"!==Be||1!==Qe)if("SET PENCIL MIRROR"===Be&&1===Qe)u.super_state.set_state({_pencil_mirror_index:m,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas()}));else if("PENCIL"!==Be&&"PENCIL PERFECT"!==Be&&"CONTOUR"!==Be||1!==Qe)if("BUCKET"!==Be&&"HUE BUCKET"!==Be&&"SELECT COLOR THRESHOLD"!==Be&&"BORDER"!==Be||1!==Qe)"SELECT COLOR"===Be&&1===Qe&&(u.super_state.get_state()._s_layers,Ee=g.indexes[m],"REPLACE"===Me&&c.clear(),g.indexes.forEach((function(e,t){e===Ee&&("ADD"===Me||"REPLACE"===Me?c.add(t):c.delete(t))})),u.super_state.set_state({_pxl_indexes_of_selection:c,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()})));else{for(Y=(L=u.super_state.get_state())._s_layers,G=L._layer_index,V=g.indexes,j=[De,Ne],z=V[m],K=x[z],X=[],J=u.color_conversion.to_rgba_from_uint32(K),W=(q=r(J,4))[0],H=q[1],Z=q[2],$=q[3],ee=u.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(W,H,Z,$)),ie=(te=r(ee,4))[0],te[1],te[2],te[3],ne=ie=0&&e=0&&e=0&&oe(ue);)ue-=Fe,pe--;for(ue+=Fe,pe++,_e=!1,le=!1;pe0&&(oe(ue-1)?_e||(re.push([de-1,pe-1]),_e=!0):_e&&(_e=!1)),de+1=0&&O=0&&P<=Pe&&(F.add(Array.of(O,P)),k=P*Fe+O,M=g.indexes[k],Q=x[M],D=u.color_conversion.blend_colors(Q,Re,Oe,!0,!1),-1===(N=x.indexOf(D))&&(N=x.push(D)),w[k]=N)),"HORIZONTAL"!==S&&"BOTH"!==S||F.forEach((function(e){var t,i,n,r,a,o=e[1],s=e[0]-2*(e[0]-T);s>=0&&s=0&&o<=Pe&&(t=o*Fe+s,i=g.indexes[t],n=x[i],r=u.color_conversion.blend_colors(n,Re,Oe,!0,!1),-1===(a=x.indexOf(r))&&(a=x.push(r)),w[t]=a)})),u.super_state.paint_shape([m],Re,Oe,{_paint_or_select_hover_pxl_indexes:new a.SetFixed([m]),_paint_or_select_hover_actions_latest_index:m,_paint_hover_old_pxls_snapshot:g.indexes_copy||new Uint8Array(0),_last_action_timestamp:Date.now()},(function(){Ue.update_canvas()}));else"REPLACE"===Me&&c.clear(),"ADD"===Me||"REPLACE"===Me?c.add(m):c.delete(m),"SELECT PIXEL"===Be?u.super_state.set_state({_pxl_indexes_of_selection:c,_paint_or_select_hover_actions_latest_index:m,_last_action_timestamp:Date.now()}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()})):"SELECT PATH"===Be&&u.super_state.set_state({_pxl_indexes_of_selection:c,_paint_or_select_hover_actions_latest_index:m,_last_action_timestamp:1/0}).then((function(){Ue.update_canvas(),Ue._notify_is_something_selected()}))}else u.super_state.set_state({_pxls_hovered:m}).then((function(){Ue.update_canvas()}))},_notify_is_something_selected:function(){var e=u.super_state.get_state()._pxl_indexes_of_selection;!!u.super_state.get_state()._previous_pxl_indexes_of_selection.size!=!!e.size&&u.super_state.set_state({_is_something_selected:!!e.size,_previous_pxl_indexes_of_selection:new a.SetFixed(e)}).then((function(){f.selection(!!e.size)}))},get_pixel_color_from_pos:function(e,t){var i,n,r=u.super_state.get_state(),a=r.pxl_height,s=r.pxl_width,_=r._s_layers,l=r._layers,h=t*s+e;if(e>s||t>a||e<0||t<0)return"#00000000";for(i=o.Color.new_zero(),n=0;n<_.length;n++)void 0!==l[n]&&(l[n].hidden||i.blend_first_with(o.Color.new_uint32(_[n].get_uint32(0|h)),Math.round(255*parseFloat(l[n].opacity)),!1,!1));return i.hex},_notify_current_color_change:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=u.color_conversion.format_hex_color(e),f.color?f.color(e,t):u.super_state.set_state({pxl_current_color:e})},_notify_relevant_action_event:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;f.action&&("number"==typeof t&&(t=o.Color.new_uint32(t).hex),f.action(e,t,i))},exchange_pixel_color:function(e,t){var i,n,a,o,_,l,h=this,c=u.super_state.get_state(),d=c._s_layers,p=c.pxl_width,f=c.pxl_height,m=c._layer_index,g=d[m]||{},A=g.indexes,y=g.colors.indexOf(e);g.colors.includes(t)||((i=new Uint32Array(g.colors.length+1)).set(g.colors,0),i[i.length-1]=(0|t)>>>0,g.set_colors(i,!0)),n=g.colors.indexOf(t),A=A.map((function(e){return e===y?n:e})),a=u.color_conversion.clean_duplicate_colors(A,g.colors),_=(o=r(a,2))[0],l=o[1],d[m]=s.Layer.new_from_colors_and_indexes(l,_,p,f,!0),u.super_state.set_state({_s_layers:d,_last_action_timestamp:Date.now()}).then((function(){h.update_canvas()}))}}}},e.exports=n},937:function(e,t,i){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),n=function(){function e(e,t){var i,n;for(i=0;i>2,t instanceof o.SetFixed||t instanceof Set)for(r=0;(0|r)<(0|n);r=(r+1|0)>>>0)(0|i[r<<2])>128&&t.add(0|r);else for(a=0;(0|a)<(0|n);a=(a+1|0)>>>0)(0|i[a<<2])>128&&(t[0|a]=1);return t}),h=function(e,t,i){var n,r=void 0!==i?i.canvas:void 0;return void 0===r?("OffscreenCanvas"in window?r=new OffscreenCanvas(e,t):((r=document.createElement("canvas")).width=e,r.height=t),(n=r.getContext("2d",{willReadFrequently:!0})).imageSmoothingEnabled=!1,n):(r.height===t&&r.width===e||(r.width=e,r.height=t),i)},c=function(e,t,i){var n,r;return t|=0,n={x:0,y:0},(r={x:0,y:0}).x=(i|=0)%(e|=0)|0,n.x=t%e|0,n.y=(t-n.x)/e|0,r.y=(i-r.y)/e|0,{primary:n,secondary:r}},d=function(){function e(t,i){n(this,e),this.new_canvas_context_2d=h,this.get_shadow_indexes_from_canvas_context=l,this.get_opposite_coordinates=c,this.width=0|t,this.height=0|i,this.context=this.new_canvas_context_2d(this.width,this.height)}return a(e,[{key:"from_text",value:function(e,t,i){return this.context.clearRect(0,0,this.width,this.height),this.context.font=e+'px "Industry Book"',this.context.fillStyle="#ffffffff",this.context.textAlign="center",this.context.fillText(t,this.width/2,this.height/2),this.get_shadow_indexes_from_canvas_context(this.context,i)}},{key:"from_border",value:function(e,t,i,n){var r,a=this;return t=t||!0,i=i||!1,r=new o.SetFixed(this.width*this.height),e.forEach((function(n,o){var s,_,l,h,c=void 0,d=void 0,p=void 0,u=void 0;c=(c=n-a.width)<0?-1:c,d=(d=n+1)%a.width==0?-1:d,p=(p=n+a.width)>a.width*a.height?-1:p,u=(u=n-1)%a.width==a.width-1?-1:u,s=void 0,_=void 0,l=void 0,h=void 0,s=c-1,s=-1===c||-1===u?-1:s,_=c+1,_=-1===c||-1===d?-1:_,l=p-1,l=-1===p||-1===u?-1:l,h=p+1,h=-1===p||-1===d?-1:h,t?(e.has(c)&&-1!==c&&e.has(d)&&-1!==d&&e.has(p)&&-1!==p&&e.has(u)&&-1!==u||r.add(0|n),i&&(e.has(s)&&-1!==s&&e.has(_)&&-1!==_&&e.has(l)&&-1!==l&&e.has(h)&&-1!==h||r.add(0|n))):(e.has(c)||r.add(c),e.has(d)||r.add(d),e.has(p)||r.add(p),e.has(u)||r.add(u),i&&(e.has(s)||r.add(s),e.has(_)||r.add(_),e.has(l)||r.add(l),e.has(h)||r.add(h)))})),r}},{key:"from_path",value:function(e,t){var i,n=this;return t=void 0===t?new o.SetFixed(this.width*this.height):t,this.context.lineWidth=1,this.context.clearRect(0,0,this.width,this.height),this.context.save(),i=0,e.forEach((function(e){var t=e%n.width,r=Math.floor(e/n.width);0===i?(n.context.moveTo(t,r),n.context.beginPath()):n.context.lineTo(t,r),i++})),i>0&&(this.from_line(e[0],e[e.length-1],new Set).forEach((function(e){var t=e%n.width,i=Math.floor(e/n.width);n.context.lineTo(t,i)})),this.context.strokeStyle="rgba(255, 255, 255, 1)",this.context.fillStyle="rgba(255, 255, 255, 1)",this.context.fill(),this.context.stroke()),this.get_shadow_indexes_from_canvas_context(this.context,t)}},{key:"from_line",value:function(e,t,i){var n,r,a,s,_,l,h;if(e|=0,t|=0,i=void 0===i?new o.SetFixed(this.width*this.height):i,n=this.get_opposite_coordinates(this.width,e,t),r=0|Math.abs(n.secondary.x-n.primary.x),a=0|Math.abs(n.secondary.y-n.primary.y),s=(0|n.primary.x)<(0|n.secondary.x)?1:-1,_=(0|n.primary.y)<(0|n.secondary.y)?1:-1,l=r-a|0,h=0,i instanceof o.SetFixed)for(;i.add(n.primary.y*this.width+n.primary.x|0),(0|n.primary.x)!=(0|n.secondary.x)||(0|n.primary.y)!=(0|n.secondary.y);)(0|(h=l+l|0))>(0|-a)&&(l=l-a|0,n.primary.x=n.primary.x+s|0),(0|h)<(0|r)&&(l=l+r|0,n.primary.y=n.primary.y+_|0);else for(;i[n.primary.y*this.width+n.primary.x|0]=1,(0|n.primary.x)!=(0|n.secondary.x)||(0|n.primary.y)!=(0|n.secondary.y);)(0|(h=l+l|0))>(0|-a)&&(l=l-a|0,n.primary.x=n.primary.x+s|0),(0|h)<(0|r)&&(l=l+r|0,n.primary.y=n.primary.y+_|0);return i}},{key:"from_rectangle",value:function(e,t,i){var n,r,a,s,_,l,h,c,d,p,u;if(e|=0,t|=0,n=void 0===i?new o.SetFixed(this.width*this.height):i,r=this.get_opposite_coordinates(this.width,e,t),a=Math.abs(r.primary.x-r.secondary.x|0)+1|0,s=Math.abs(r.primary.y-r.secondary.y|0)+1|0,_=Math.max(r.primary.x,0|r.secondary.x)-(a-1|0)|0,l=Math.max(r.primary.y,0|r.secondary.y)-(s-1|0)|0,h=a*s|0,c=0,d=0,n instanceof o.SetFixed)for(p=0;p>>0)d=(p-(c=p%a|0)|0)/a|0,n.add((l+d|0)*this.width+(_+c|0)|0);else for(u=0;u>>0)n[(l+(d=(u-(c=u%a|0)|0)/a|0)|0)*this.width+(_+c)|0]=1;return n}},{key:"from_ellipse",value:function(e,t,i){var n,r,a,s,_,l,h;return e|=0,t|=0,i=void 0===i?new o.SetFixed(this.width*this.height):i,n=this.get_opposite_coordinates(0|this.width,0|e,0|t),r=Math.abs(n.primary.x-n.secondary.x)+1,a=Math.abs(n.primary.y-n.secondary.y)+1,l=Math.max(n.primary.x,n.secondary.x)-(r-1)+(s=r/2),h=Math.max(n.primary.y,n.secondary.y)-(a-1)+(_=a/2),this.context.lineWidth=1,this.context.clearRect(0,0,this.width,this.height),this.context.save(),this.context.translate(l,h),this.context.scale(s,_),this.context.beginPath(),this.context.arc(0,0,1,0,2*Math.PI),this.context.restore(),this.context.fillStyle="rgba(255, 255, 255, 1)",this.context.strokeStyle="rgba(255, 255, 255, 1)",this.context.stroke(),this.context.fill(),this.get_shadow_indexes_from_canvas_context(this.context,i)}}]),e}(),p=function(){function e(t,i){n(this,e),this.shape_creator=new d(t.pxl_width,t.pxl_height),this.state_={_id:parseInt(1e3*Math.random()*1e3).toString(16)+"",className:t.className||null,perspective:t.perspective||0,animation:t.animation||!0,animation_duration:t.animation_duration||60,move_using_full_container:t.move_using_full_container,dont_compute_base64_original_image:t.dont_compute_base64_original_image||!1,dont_change_img_size_onload:t.dont_change_img_size_onload||!1,dont_show_canvas_until_img_set:t.dont_show_canvas_until_img_set||!1,show_image_only_before_canvas_set:t.show_image_only_before_canvas_set||!1,dont_show_canvas:t.dont_show_canvas||!1,but_show_canvas_once:t.but_show_canvas_once||!1,has_shown_canvas_once:!1,tool:t.tool||"PENCIL",select_mode:t.select_mode||"REPLACE",pencil_mirror_mode:t.pencil_mirror_mode||"NONE",hue:t.hue||0,pxl_width:32,pxl_height:32,pxl_current_color:t.pxl_current_color||"#00000000",pxl_current_color_uint32:s.Color.new_hex(t.pxl_current_color||"#00000000").uint32,pxl_current_opacity:t.pxl_current_opacity||1,bucket_threshold:t.bucket_threshold||0,color_loss:t.color_loss||.25,default_size:t.default_size||96,ideal_size:t.ideal_size||t.default_size||96,max_size:t.max_size||2*t.default_size||192,px_per_px:t.px_per_px||1,fast_drawing:t.fast_drawing||!1,canvas_border_radius:t.canvas_border_radius||0,canvas_wrapper_background_color:t.canvas_wrapper_background_color||"#020529",canvas_wrapper_background_color_focused:t.canvas_wrapper_background_color_focused||"#000000",canvas_wrapper_border_radius:t.canvas_wrapper_border_radius||4,show_original_image_in_background:t.show_original_image_in_background||!1,show_transparent_image_in_background:t.show_transparent_image_in_background||!1,hide_canvas_content:t.hide_canvas_content||!1,_pencil_mirror_index:-1,_previous_pencil_mirror_axes_indexes:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_previous_pencil_mirror_axes_hover_indexes:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_base64_original_images:[],_original_image_index:-1,_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_layers_defined_at:0,_layer_index:0,_current_layer:new _.Layer(Uint32Array.of(0),1,1),_s_layers:[new _.Layer(Uint32Array.of(0),new Uint16Array((t.pxl_width||32)*(t.pxl_height||32)).fill(0),t.pxl_width||32,t.pxl_height||32,!0)],_json_state_history:{history_position:0,state_history:[]},_saving_json_state_history_running:!1,_pxls_hovered:-1,_canvas_container:null,_canvas_wrapper:null,_canvas_wrapper_overflow:null,_state_history_length:100,_last_action_timestamp:Date.now(),_lazy_lazy_compute_time_ms:1e4,_undo_buffer_time_ms:parseInt(parseInt(t.pxl_width||32)+parseInt(t.pxl_height||32)+1e3),_mouse_inside:!1,_paint_hover_old_pxls_snapshot:new Uint16Array((t.pxl_width||32)*(t.pxl_height||32)).fill(0),_select_hover_old_pxls_snapshot:new Uint16Array,_paint_or_select_hover_actions_latest_index:-1,_paint_or_select_hover_pxl_indexes:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_pxl_indexes_newly_painted:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_paint_or_select_hover_pxl_indexes_exception:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_shape_index_a:-1,_select_shape_index_a:-1,_shape_index_b:-1,_select_shape_index_b:-1,_pxl_indexes_of_selection:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_previous_pxl_indexes_of_selection:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32)),_imported_image_previous_start_x:0,_imported_image_previous_start_y:0,_imported_image_start_x:0,_imported_image_start_y:0,_imported_image_pxls:[],_imported_image_width:0,_imported_image_height:0,_imported_image_scale_delta_x:0,_imported_image_scale_delta_y:0,_imported_image_previous_scale_delta_x:0,_imported_image_previous_scale_delta_y:0,_is_on_resize_element:!1,_imported_image_pxl_colors:[],_is_image_import_mode:!1,_previous_image_imported_resizer_index:-1,_selection_pair_highlight:!0,_imported_image_move_from:[-1,-1],_updated_at:Date.now(),_notified_position_at:0,_force_updated_timestamp:0,_loading_base64_img:"",_loading_base64_img_changed:0,_intervals:[],_kb:0,export_state_every_ms:t.export_state_every_ms||6e4,_last_filters_hash:"",_saving_json_state_history_ran_timestamp:0,_processing_filters:!1,canvas_event_target:"CANVAS_WRAPPER_OVERFLOW",mouse_down:!1,cached_background_image_url:"",cached_background_image:""},this.imported_img_data={imported_image_pxls_positioned:[],imported_image_pxl_colors:new Uint32Array(0),image_imported_resizer_index:-1,imported_image_pxls_positioned_keyset:new o.SetFixed((t.pxl_width||32)*(t.pxl_height||32))},this.state_.cursor="",this.images_=Array(25),this.images_[0]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA9ElEQVRYR+3X0Q6FIAgGYDjn/R/5xBmtmjMTmIBd2G3WvsE/VISXPfgyDyyQ1JFbhYiIpI/q94joVukmyPJ/9i+Q1MUpFTpa8wWAzZoxy/puhg7E9b8MlAhiTRnyaJQIQsQPEW1ZKA2I12AWSgvaO5eBsoBSUFZQOErcyx6GHgf9FxH0kU0xJFMjoJD2jYIYZWpffbypI+EBMlWKQWf2WkcXL5AalQlSobJBImoGqIsq51d0hm5n/9beVx5nskG9kbDjZ4Ca7TtLGQ6S7nT19SoFNHqn8xyMnIlrCmtuGikV0kDKNVF7mdXxuN61ZR6qBZKq+Aeqdig0aelV6gAAAABJRU5ErkJggg==",this.images_[1]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABFUlEQVRYR+2Y2w6EIAxEl///aDYYa7C2dFqryyb4qsBhOr3E8kl4aq2Vb1NKKZGtQ4v4QQ2oP7/xTQckqYNAuhTSQiMp1IAiqrmBpEMWEPlBMy+qEOKrV0OG+GoBWZm3FFoKtUyiXsvV+P8sk3rVfqvN/BmF0eUhfiDJT136J0BSnEklrUUM1hzdQvMVH0kudWikkvQuMhV2vfEyyMFAtElwMhW5pclSBOIhYDe6I8ppLQQkZdMUQJpKafLsBdQ0tTaMZYK4TD010NNhg039lkohoKdU6ir3qfSYE2N2dR4Zeru8lT1TAmWHTQsXpBBV7iyoEQwMlAVlwbiA7kIhMG6gHsoTQhQmBNQXTStD+/fIz6r2/RftLsg0XDwDiAAAAABJRU5ErkJggg==",this.images_[2]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA80lEQVRYR+3X4Q6DIAwEYHn/h2bBQIJNoXcVHEb2c3PZx11hGo7FXmExz7FBViM7oe8lFGOMctUhBPcouL4oEfXvK77TiyJpUMEURALIQOR7DJICSUxaOQLSritImRwNstJwIC+G94K0uhxpXDZkrptPqIX5C6iHsU7d+vPO8OMJjcK04FRlszFV3XZCT2Bo0I2/I3i04MpSQhuUc1VP6uVmKA/c9NrgGVoWlG+s4F3DXkgl9ERKLtCslNw3aLPOJC2dc/FW70uCRtfWqgtKqAz3KFQPA4NGoSwMBbqLQjA0qEYxFaIYF6jsSu2Zvrdj0UfpHwMA+yX+QNKuAAAAAElFTkSuQmCC",this.images_[3]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAv0lEQVRYR+2X3Q6AIAiF5f0fmuaFG6OSH9F00a0IX+dAKZTNHtiMpySQ5Mg/FUJEpMoAwKsQSxSqQI2hsiUQb9whhbjf0lS0dWrDUw5qGc9J9956iL6NFob3hSUH33sWEJvWrmBLLJNG1GCpf+wtE5FAkZa5fx0zLNNaW+O6Yx+lUAJJCgwdP2b0kCXnkh5KIE0PuU+MXF6pmHY9BEhbzBInfdtCzkPTgSwFPLGf3zos0EvuZQlkUUCKTcuOU+gCTnb3JcS3RYIAAAAASUVORK5CYII=",this.images_[4]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABH0lEQVRYR+2X4Q7CIAyEy0x8//c1WoNhCWOFawvo1PnTAf24HqUEOtgvzORhZs7XDyHAeHBAD3AEWhki2wlUqvmfCpVGRR7LPSSNLX1lMnWeAiE90bSIb/NdMrp6hRZMjJIWfw+QBFOUmCrI8JTVYDQ1Zfgp64FJaRxbGEsgbbVd8zdaoYWZ79bSn5tpKJCw2JWIbpZjNPRy9ezOAlsbW61DPwl0uJR5VJ6ashMInapToY8plPU77v5Jew+2AnTdZYJ/ltjHIVWbO/be9t55ERYCvQalXjnJfiGiR22nvT0U9IS02wS5m9sLAxWSGq3sv51I5atDa+TN+x+ZrAXVmuuBUStkhfLCmIHWxh2pqnmRmBs0FHTWd3jKZgX+GoWe1olaNCjYBWEAAAAASUVORK5CYII=",this.images_[5]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA+klEQVRYR+3Y0Q6DIAwFUOr+/5NdTY1dkJS1YIsmstexcLhArYP0sA88zJN+IERECw4AQhdxAmlzkXmCaNvK3ePkbkson5jO1gQd23RKIr9xtydUu/7HVn5SSl9LiegZ03Tt+cADwEJnv2dC7TfmwpjXqMikrFV3QcRVQLknZQVR0kNQLaAhqFZQOKoHFIrqBYWhroBCUFdB7igPUBX1ryrXGj0vkIhSnoni3J4gM4r7rbKPp9S8QdRtmtsYqfkLB/GipcknSHtZGJ6QdsveC9LaVPqeDvuQhCwYHjMU1PDnxe7jYuleh6TVW1J7J8iSTPGG7P8sa0WU4zdwA0Y04iTpEgAAAABJRU5ErkJggg==",this.images_[6]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA7UlEQVRYR+3X2w6EIAwEUPv/H82GRDYE6dUO8KCvEntSBgG6DnvoMM/1gbQZWdKhUkppECISa8JBFdMbqk1CQUEjpnVJQsFAHEZDwUC1cASVDmoBbjmRULOpSwX1xftiniylgWZFJRQX7BSQdVraOOgq04J7h/v/77nHs4141SELRlvm41YSBnkwY5ek/SwEQmEq1A1CYtwgNMYFWoExg1ZhTKCVGBW0GiOCdmBY0C7MFLQT8xqkHdi1K8/s/eNPbe0QAhPuEAoTAiExbhAaw4K4MGrX4EiI0w5oGcVNqwxVyPpd9wHN+uHouONAP0LJ2yWtxGVEAAAAAElFTkSuQmCC",this.images_[7]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA/0lEQVRYR+3XSw7DIAwE0Pj+h6ZCqiNE/cHAGBbttg1+GagBei770GWe5w/yZiQloVJKYQgRmTXhoIppDdVmoaCgHsMpWSgYSMN4KBioFp5BbQfxAuZ1YqGkqdsKaou3xSJraRtIKmqhtIW9BTQ6Lfw76L/MSOZtykJSahBLCVnTFG2Ibyf39hbt+wjm2wLMDr0EQmEqKjxlSEwYhMaEQBmYYVAWZgiUiXFB2RgTdAKjgk5hRNBJzBCIN0bveDG7BfXP/XRq6ZCVhXET4utUf5XyrjIraZkJSQMjMW5CPQiNUUFa5N41eGWqls5DOwqrL40cfGbs8AFtpkjkmetAH9mVQzQQt8P4AAAAAElFTkSuQmCC",this.images_[8]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABTUlEQVRYR+2W4RKEIAiEpd7/kS9ubLQxFCGUq5upv5X7uYsghIc98DCe8AJJifzEIUTEDAIAXU13oAhTMkS2HtQUoCS6hhC2MhIKk9/1oIaBsmgSOaA4GAlqCIiJY0XEj1AqO1fLqSGgEMJCxZOIdJjcgOLCFZSKxsmhqA2IuGkiIgXfPG2jkU2F2Xentbfxnal+vPpQ5UwSipBsfBKM1SHOmSXWaTrOp+5cHPGqeVLnr0YmwiSBZm3R5tkqlytAXEx0191Cl6C0QGZn8qDXDlgNkNmZwo04ZfZilwpbAhpyBgDKOPNa5vvQDGdO1xFNz+Nob4Hh+tBtME0g7o5DboNcbYmNT4qtiqwEYnqGG8wVhzK4Nk7JCPZ91yFy/60Gp9R1LVQqoGI4HhoeMKrIWrv0gjEBecKwQL3syTiwlEn3H2mWTReUFnyB/s6hL1JSZjT7s1UhAAAAAElFTkSuQmCC",this.images_[9]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABoklEQVRYR+2Y61IDMQiFoa2+//tqxdmdJAMJ5JBMR6tTf7ob9gMOl5Tpyf74yXjoXwBdReQzG1lm1k5fiOhrdjYdIRGRash+Y46mjg0vdrDn8xTQAbMCkY3eAdtDIaCLiNx7mJnXGgY5sQoUwjDzjYjuIBI3EfnQUAWgHVsC6tNUo+LlPQLTNurHnf+9EVErEjdlHgwzX1GF9GCBnbUIPQrm+CoqhlTKAiAk/ihrg470ixmgs+lVIXoHqkHdlzwapbUTCrzTHhvPHcG51YRSUdI19JhMf0JAQ6oyMCqKy1AvoBI9oyvd234lQl7DbIO7K8NziJbqeieioToeoaElILVimJauyx0NTSTqNFCmLH80Qn8SKDOjQGM046SfBuG0D1p909XC6DCmHP2YLWKpExdvXLHvpDszXLdWhgwMEQ0b6BZQZu1MAKVgDjt9ylzBzfoGgqlac3ZrV79QQ0GEMjpyl7NiL1yHIZAXgd1rEILxUgZFjVIUPZ9tn/rMUh86PTBX9TmejmT2+pRZ3s0PBKghGm83rk4ZoN0sbZ17AaGwfQNzJa40/U9w+QAAAABJRU5ErkJggg==",this.images_[10]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABMklEQVRYR+2XwRLDIAhEpen/f3FTOmaajrUgC5jpxVyD+lwXUCoXfszM5/RERMhSUBAyUR9TYVqGyoZAXQLUw1TYvwFlYCr4VIWyMFOBZsBMA5JgTpOj3vlkYySD2jEjmAhUykPaMR3Sd2UHVSoMZHnG+q+dTAgIXQyNa+HcQN5FvPEuIO/kjam/2siocsNAURgvFAQ0yiZv2bCyLwzkBdHi+3IAAb3P/McHWSipNo2Absy8E9FWSnnOhtIKpQp0+qYfiLQKS7lR1RaBrNteBspqIRLQxswP4fp5L6XsozTOKKN2e2330s48SlnKTAFCjY7CiBc0j0LI8Xlg1BujZWrJK9nWYt4YI4+8FsqrjAlkZcygFRyvVeRRKM0Bt44ooHfcArIUWwothSwFrP/LQ5ZCL65vGzRTMXdZAAAAAElFTkSuQmCC",this.images_[11]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABMklEQVRYR+2XwRLDIAhEpen/f3FTOmaajrUgC5jpxVyD+lwXUCoXfszM5/RERMhSUBAyUR9TYVqGyoZAXQLUw1TYvwFlYCr4VIWyMFOBZsBMA5JgTpOj3vlkYySD2jEjmAhUykPaMR3Sd2UHVSoMZHnG+q+dTAgIXQyNa+HcQN5FvPEuIO/kjam/2siocsNAURgvFAQ0yiZv2bCyLwzkBdHi+3IAAb3P/McHWSipNo2Absy8E9FWSnnOhtIKpQp0+qYfiLQKS7lR1RaBrNteBspqIRLQxswP4fp5L6XsozTOKKN2e2330s48SlnKTAFCjY7CiBc0j0LI8Xlg1BujZWrJK9nWYt4YI4+8FsqrjAlkZcygFRyvVeRRKM0Bt44ooHfcArIUWwothSwFrP/LQ5ZCL65vGzRTMXdZAAAAAElFTkSuQmCC",this.images_[12]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA/klEQVRYR+XX7Q6FIAgG4Lz/i/bMlo2ZIB++zO30t1xPgEjlOuwqh3mu/wPVWuuYhVIKGwhohBpm9u5m5FAwEIfp0eJQENAM0zNHIzZDbQdxmJ4ieh8O0tRMGkiqGbrRUlK2KmCu+UJSthPT4KGi3o0JgRAYNwiFcYGQGDMIjTGBMjBqUBbGBLof5seYT++TRgxpSjX1oT5srWBejCpCBPHiJVgEswSNJ3MPNR0laCqjGBOI5p0MW3fUZlH0/s2INbTaXSPMi6DrwiDpD8IDdIN21MsM7AKhMK6iRmLMIDTGBMrAqEFZGBXo6cSmM8+z3d9TILIYsTbty7X440A/uhPvJTjQhwcAAAAASUVORK5CYII=",this.images_[13]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAk0lEQVRYR+2YwQ6AIAxD2f9/9AgHDyixrs5kxHotHeVtB9Basc+K5WkKhDpyIeTujkyZuplNGZaBTmsy959qjbPvHeir7h0dCBNaGd72b8yoAt1RFCE0YyIkQogA0jVDIoQIIF0zJEKIANI1Q/8jhE7M6PSdmtks4gm/OiLFmbWPAzHFWQ98ubKFs3z6HYNIliPUAQ/FUDSiymd+AAAAAElFTkSuQmCC",this.images_[14]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABR0lEQVRYR+3X3Q6CMAwF4DUY3v91NeIxEGYGbv1jXbzQW2R8nI5uo/RjP/J4AEBzHxGZxzffsGK0z1ndVpQJZMHkBK0oNeiMkapWpmhBqUA1jFCKGcDdgxJBDkyulgvFgi5g3KgmqAPGhVKBLJOy0Z8O5ePG6wGaADylflMmHgnKmAeAmUONAGXMViWprNEgFrM/fEopvYqO/VlyepdMg8mJfVBhCXEDV67Fg/b5sm0/yknMYfI9eSnpXbKvViNhhoI0mGGgCuaWUlpq3TpsUjOfcRMTnpC2TGVSoQntgy8AJiJikxnRGPNSsXZeFSa8ZJoj0Pk/oSX7g84112wvuNQs2+HoTf666h9OutK+KfIYZMZsC7Zmglrf8krJVaDWA7iX8Zxa1QnVuq0mWc/HoE7Ig5ImcO2lzKByxyilJJ3VuoEkyJXrb6IrI0OmlalfAAAAAElFTkSuQmCC",this.images_[15]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABeklEQVRYR82W2w7DIAxDQfv/P57GREWqNM3FlAh1j2trDokdqOVlv/oynnICtdZah6u13iC9Z3JDqzoXoM7SuThUX0D736qs9T6qc6kG/4gWnIGhbyyd/lxuWG5MbY/sWiSiVYug+DNEJwRCRBAgVAcF+pRSfjOJlBUaQKGO6iHq9Uhd2HctadT2Ed4eFEhHTRmL/6e19rXERhXMKrM2uTp8Q/AcklBejK1ZhMwzeFJzMcMfsJbnxWkRDjNacuijKYqCMQWkwFTtv2jRlAp5C2dCQRVCFkTeQSoHAQ2PHIes5Zcso8NAHpR2bj01+hSQBkXT3LmOqHcs6/1pIAmF+GJmJMCTmh0n5KPTU5lQSzdGyzsr7YNujJ5Bs6HC+xCSlkyoEAg1ZBYUChTe9LLSl35jXK3ULWXCM/BNjydrBSqMPW8F6qeV9kGDkRaQwzEaiI8qFYmuPkehqPqPzrJZyAiKW2ELkOcp6cttQBqUFpKtQEhitwMxKHXtP/Eo9zDGipjdAAAAAElFTkSuQmCC",this.images_[16]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA/klEQVRYR+XX7Q6FIAgG4Lz/i/bMlo2ZIB++zO30t1xPgEjlOuwqh3mu/wPVWuuYhVIKGwhohBpm9u5m5FAwEIfp0eJQENAM0zNHIzZDbQdxmJ4ieh8O0tRMGkiqGbrRUlK2KmCu+UJSthPT4KGi3o0JgRAYNwiFcYGQGDMIjTGBMjBqUBbGBLof5seYT++TRgxpSjX1oT5srWBejCpCBPHiJVgEswSNJ3MPNR0laCqjGBOI5p0MW3fUZlH0/s2INbTaXSPMi6DrwiDpD8IDdIN21MsM7AKhMK6iRmLMIDTGBMrAqEFZGBXo6cSmM8+z3d9TILIYsTbty7X440A/uhPvJTjQhwcAAAAASUVORK5CYII=",this.images_[17]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABBElEQVRYR+3XyxLCIAwF0PL/H43DIk7EvG5KoOPoGuVwk1jarod92sM8lwnqvXcObq2VH8AFkWHYfgbEk/YOVZ7QwPBKe0mXgmYM9aOFeoPmBqYv8x6SJlIrgYbxUB8gdIi8+DOo5SBKmpKzUNKBlpaMb843Q3ppWVNLm1oordxLQNGy0LrQlEkTpJWAr/Uad6wVklKDuJVQBOON+RyEC9IerghmTsm6YaSe3lWYAYVBlRgYVI2BQDswYdAuTAi0E+OCdmNM0AmMCjqFEUEnMbdB3o0x8xL69U8dTagCk06oCpMCVWJgUDVGBWnN6L0GZ5oYuqCt2AD9Dfg+hG6Arv+DvMReyBw3NCzTf+YAAAAASUVORK5CYII=",this.key="",this.notifiers_update=i,this.new_canvas_context_2d=h}return a(e,[{key:"set_cursor",value:function(e,t){var i,n,r,a,o;this.state_.mouse_down=0|e,this.state_.canvas_event_target=t+"",i=""+this.state_.tool,n=""+this.state_.select_mode,r=this.state_._is_image_import_mode,a=this.state_._is_on_resize_element,o=this.state_.cursor+"",r?a?this.state_.cursor='url("'+this.images_[0]+'") 18 18, auto':this.state_.mouse_down?this.state_.cursor='url("'+this.images_[2]+'") 20 24, auto':this.state_.cursor='url("'+this.images_[1]+'") 20 18, auto':"MOVE"!=i&&!this.state_.canvas_event_target.includes("CANVAS_WRAPPER")||this.state_.mouse_down?("MOVE"==i||this.state_.canvas_event_target.includes("CANVAS_WRAPPER"))&&this.state_.mouse_down?this.state_.cursor="grabbing":"RECTANGLE"==i?this.state_.cursor='url("'+this.images_[3]+'") 27 12, auto':"ELLIPSE"==i?this.state_.cursor='url("'+this.images_[4]+'") 25 9, auto':"LINE"==i?this.state_.cursor='url("'+this.images_[5]+'") 32 32, auto':"PENCIL"==i?this.state_.cursor='url("'+this.images_[6]+'") 5 32, auto':"PENCIL PERFECT"==i?this.state_.cursor='url("'+this.images_[7]+'") 5 32, auto':"PICKER"==i?this.state_.cursor='url("'+this.images_[8]+'") 5 32, auto':"EXCHANGE"==i?this.state_.cursor='url("'+this.images_[9]+'") 18 18, auto':"BUCKET"==i?this.state_.cursor='url("'+this.images_[10]+'") 6 25, auto':"HUE BUCKET"==i?this.state_.cursor='url("'+this.images_[11]+'") 6 25, auto':"CONTOUR"==i?this.state_.cursor='url("'+this.images_[12]+'") 8 33, auto':"BORDER"==i?this.state_.cursor='url("'+this.images_[13]+'") 18 18, auto':"SET PENCIL MIRROR"==i?this.state_.cursor='url("'+this.images_[14]+'") 18 18, auto':"SELECT COLOR THRESHOLD"==i?this.state_.cursor='url("'+this.images_[15]+'") 7 7, auto':"SELECT PATH"==i?this.state_.cursor='url("'+this.images_[16]+'") 8 33, auto':"SELECT PIXEL"==i?"ADD"==n||"REPLACE"==n?this.state_.cursor='url("'+this.images_[17]+'") 5 32, auto':"REMOVE"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA9klEQVRYR+3XQRKDMAgFUHP/Q6eTBR2MgQ8I0YXdmpHnh2jajpf92ss8xwdCHdmSUO+9E6S1ptYsBw0MNwybhioFzRhKSUP9QTxW1Gd+XXpaCYNQJxBo78WJ4o+g0kGUNCWnoVYPlNoyXpwX88xS2lCvimooqd0pIGtbaJ1pl3l2Fl+LBnesXSQlBnErIQsGbfM5iDDIg5lT0roRAlVhBtQNqsS4QdUYF2gHxgzahTGBdmIgaDdGBT2BEUFPYZagJzG3QejEGPlgX97U1oQqMOGEqjAhUCXGDarGiCBpGNHf4MgQpx3QMoqv7uE+D1VB6L4fCCX8A+VV8SWc4ctzAAAAAElFTkSuQmCC") 5 32, auto':"REPLACE"==n&&(this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABNUlEQVRYR+3X4Q6EIAgAYLn3f+a42aIZgYCFddv165aXfiKYQXnZBS/zlN8AISICwKeUgiyCgIgLAKRN5NTxhimIWBiKMNTmRtU+aWLWZA6dEoYeblAVUSOzB2xrM1FKn+pzvGGPQouqvwWMtKSHFeYYNlERJd08odpRhKUUC1XDWCgtdCLKi2kGrcWh7izSst8OogSm5O1FygsaXrJ28HawSC7dltTSoD2UVqW3lL13Wdge56uy6MZoVVPNaCFS7n1orQjvq8ODscqcl6C502o1G8HwKPVOGEOgLMz6RoiehzIxYVA2JgSagXGDZmFcoJkYEzQb0wU9gVFBT2FE0JOYyyDvQT+y+aqfQVYnGZjhCGVhhkCZmDAoG6OCtPyxPoOtvPO0h48fnk6v/OcPsqL3ugh9ATjCXTQqEhJmAAAAAElFTkSuQmCC") 18 18, auto'):"SELECT PIXEL PERFECT"==i?"ADD"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABFUlEQVRYR+3XWQ7DIAwE0HD/QxNRycil3oZigqrmm4jHmLVch33lMM9lgmqtlYNLKekDcEFkaLafAfGkvUGlJ9QwvNJe0qmgEUPz0UJ10DiB6Wc+h6QVqZVAw3ioNxC6iLz4Z1DLQZQ0JWehpAEtLRnvnHeGzKVlk1rq1EJp5V4CipaF2oVWmbSCtBLwtkYyvZmQlBrEVwlZZUI3xL7NWKe9dbgimNaHt0WEQBo2C9P6g68TmRgYlI2BQDswYdAuTAi0E+OCdmNM0BMYFfQURgQ9iQmBaMv3rherHpwfO7V0wu/CuAnRw3W8a0cPypnUzISUO1LqCxYCZSajXj+099mrvug7aaJm8PVjog/olz/Ii+u4hG5e9580PRb9NQAAAABJRU5ErkJggg==") 5 32, auto':"REMOVE"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABBklEQVRYR+3Xyw6EMAgFUPn/j+6kCwwqj14t1Emc7TRyvFSqtL3sRy/zbB8o6khJQq21xhAicmumgzpGGrrNQ6WCzhhOyUPtIBlr1Gf5v3W3FiZCHUBBey/OKP47qOkgTpqT81DaDU1tmSwuiyF7adqm1op6KKvdU0CjbeF1Q08Z8mTJtU4y+zIlKTOIRwl5bUIH4j7JE5KhaD95NW8lhCTTi0fz6jBo0YQyMd0CJZSNgUAVmGFQFWYIVIkJQdUYF7QCY4JWYVTQSswQiKfsk+MAGb6Xwai9ZFVhwoT4c+r8ro2cTUg6IUi7WCYGBmVjTJAVc/QZjLZHWw+d9jMKRtf4QH+X0A98MFk0IsucOwAAAABJRU5ErkJggg==") 5 32, auto':"REPLACE"==n&&(this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABUklEQVRYR9WX7RKEIAhFZd//mZcdG2mIQMDS2v3VbAbHi3wI5WU/eBlP+Q8gREQA+JRSUCgIiPgFgGkbORluMAURi4AiGHoXhqo2aWPeZg5GCYY+ZlAVoiqzC9beuVCGTfM7+WJXgUPVZwVGC+khwhJGbFSF0v48QXEvSijVRLVgPChLOhUqCsOc1uQwK4sW9tuB6ADT4e0pFQUaDhl3zp1lztJth1pz2oOysvSWtI+GRdS4WJZlC2NHGbVmtfXhOrQZibaOXpiyBXGv5KPdPgPTNlmLq1vZ3QUa8CyYrSNkFZoJkwaaDZMCWgETBloFEwJaCeMCrYbpAj0BYwI9BaMCPQkTAqIxwRsvsgXWWm9eg3j/WQXjKkTXKdkTo1egEdW6ChmNNdS1R2BchaTRmcqY8xC/9kqgyDwzqszlAe2q43CWzXIUtZse0KKGR9e9DugHz47FNAGTbH0AAAAASUVORK5CYII=") 5 32, auto'):i.includes("SELECT")?"ADD"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAkElEQVRYR+2XQQqAMAwEm/8/OpKDUApmUwoScbwmpdNpXNRGs8ea8QyA1I1g6H+G3N3nU5vZ0RgcLQ6QALoZgg2gdSgxpF5TDGEoM7CG3lPvnEPKaNSzrEqDcR7YykaVHhWe3wOqnPq1K6vAkEPKEoYwpAyoOjNUMdTqI18B79aP/zp2N1T9AGFIGVD1djN0AfXGlCWHImsNAAAAAElFTkSuQmCC") 18 18, auto':"REMOVE"==n?this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAb0lEQVRYR+2UQQrAIBDEdv7/6C0+oAYWClriNbiOcTB12MphecpA9CIa0hAZIG6HNEQGiNshDZEB4tsOdXfTgAlP8nouBtrsnWSpdcd/BRppgE1jQ1+EoZl+jBoiA8TtkIbIAHE7pCEyQNwOXWfoAYpLFiWYvOCxAAAAAElFTkSuQmCC") 18 18, auto':"REPLACE"==n&&(this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABCElEQVRYR+2X3Q6DMAiFwb3/I8+zYFbj5ixwmixsqTdeWNqPw09RpdijxXhkAnkRmQr9p0IAoKo3EVk9Dy++LwDuquqmiLvgCbMCWEgoBbCq2sv86kN1gRqMiCzmOQBJQjVlmnDNsctzPYWad3skElCUrQdkIMzGjM3mdAQoC0XDZICiUEMwWSAPymrAqonJt90mGrJje3mvnK36NtpBGEahBnYKzZE4UYmnPsoo1IUagRlR6GM+kc3zRSVWoVIhK5XUvT7z9bKPNL3Imu4EE82hzEGZtVTZMwcwNqHLld6YnBL6t33FAc3uKZs7a4ywLeNKDfnkXwZtFi17+oCs4QTyFJsK/ZxCD73aLDSws54nAAAAAElFTkSuQmCC") 18 18, auto'):this.state_.cursor='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAq0lEQVRYR+1WQQrAIAxb///oDmUOkc3W2kEG2XHQGpPURg6wTzLwqKr2fUQk3Ddc2AMogBqGgo2ARpkhGaKHZtMIKRmnjJLtrBBIU0O9QzvsjrUpyzUd0BgfvAdYWz3StzLUm7KBuWLEKzZPzHjqO8SWElXuX7UnLCCvTCvTFJYsAuarGswp270tQ77FIOQuY0BjQLOM+zuGVlbK7HIpLzXH3vIXGfIwlGXqE9034xUtxdxDAAAAAElFTkSuQmCC") 18 18, auto':this.state_.cursor="grab",o!==this.state_.cursor&&this.notifiers_update()}},{key:"paint_shape",value:function(e,t,i,n,r){n=void 0===n?{}:n,r=void 0===r?function(){}:r,this.state_._s_layers[this.state_._layer_index].paint_uint32a(e instanceof o.SetFixed?e.indexes:e,(0|t)>>>0,Math.fround(i)),this.set_state(n).then(r)}},{key:"set_state",value:function(e,t){t=t||!1;var i=!1;if("pxl_width"in(e="object"!=(void 0===e?"undefined":r(e))?{}:e)&&"pxl_height"in e&&(this.state_.pxl_width===e.pxl_width&&this.state_.pxl_height===e.pxl_height||(this.shape_creator=new d(e.pxl_width,e.pxl_height))),"tool"in e&&this.state_.tool!==e.tool&&(i=!0),"select_mode"in e&&this.state_.select_mode===e.select_mode&&(i=!0),"_is_image_import_mode"in e&&this.state_._is_image_import_mode===e._is_image_import_mode&&(i=!0),""in e&&this.state_._is_on_resize_element===e._is_on_resize_element&&(i=!0),"pxl_current_color"in e&&(this.state_.pxl_current_color_uint32=s.Color.new_hex(e.pxl_current_color).uint32),("show_original_image_in_background"in e||"_base64_original_images"in e||"_original_image_index"in e||"show_transparent_image_in_background"in e||"pxl_width"in e||"pxl_height"in e)&&(!this.state_.cached_background_image_url||void 0!==e._original_image_index&&this.state_._original_image_index!==e._original_image_index||void 0!==e.show_original_image_in_background&&this.state_.show_original_image_in_background!==e.show_original_image_in_background||void 0!==e.show_transparent_image_in_background&&this.state_.show_transparent_image_in_background!==e.show_transparent_image_in_background||e._base64_original_images&&this.state_._base64_original_images.length!==e._base64_original_images.length)&&(this.state_.show_original_image_in_background&&void 0!==this.state_._base64_original_images[this.state_._original_image_index]?(this.state_.cached_background_image_url=this.state_._base64_original_images[this.state_._original_image_index],this.state_.cached_background_image='center / cover no-repeat url("'+this.state_.cached_background_image_url+'")'+(this.state_.show_transparent_image_in_background?", repeating-conic-gradient(rgb(248 248 248 / 100%) 0% 25%, rgb(235 235 235 / 100%) 0% 50%) left top 50% / calc(200% / "+this.state_.pxl_width+") calc(200% / "+this.state_.pxl_height+")":"")):this.state_.show_transparent_image_in_background?this.state_.cached_background_image="repeating-conic-gradient(rgb(248 248 248 / 100%) 0% 25%, rgb(235 235 235 / 100%) 0% 50%) left top 50% / calc(200% / "+this.state_.pxl_width+") calc(200% / "+this.state_.pxl_height+")":this.state_.cached_background_image=""),t)this.state_=Object.assign(this.state_,e);else for(this.key in e)this.state_[this.key]=e[this.key];return i&&this.set_cursor(),Promise.resolve()}},{key:"get_state",value:function(){return this.state_}},{key:"get_notified_pos_at",value:function(){return 0|this.state_._notified_position_at}},{key:"get_imported_image_data",value:function(){var e,t,i,n,r,a,_,l,h,c,d,p,u,f,m,g=this;if(this.state_._imported_image_pxls.length>0){if(e=this.new_canvas_context_2d(this.state_._imported_image_width,this.state_._imported_image_height),this.state_._imported_image_pxls.forEach((function(t,i){var n=i%g.state_._imported_image_width,r=(i-n)/g.state_._imported_image_width;e.fillStyle=s.Color.new_uint32(g.state_._imported_image_pxl_colors[t]).hex,e.fillRect(n,r,1,1)})),t=this.state_._imported_image_width+this.state_._imported_image_scale_delta_x,i=this.state_._imported_image_height+this.state_._imported_image_scale_delta_y,(n=this.new_canvas_context_2d(t,i)).drawImage(e.canvas,0,0,this.state_._imported_image_width,this.state_._imported_image_height,0,0,t,i),r=n.getImageData(0,0,t,i),_=(a=this.get_pixels_palette_and_list_from_image_data(r)).new_pxls,l=a.new_pxl_colors,h={},c=new o.SetFixed(this.state_.pxl_width*this.state_.pxl_height),d=-1,_.length>0)for(d=this.state_._imported_image_start_x+t+(this.state_._imported_image_start_y+i)*this.state_.pxl_width|0,p=Uint32Array.of(t,this.state_._imported_image_start_x,this.state_._imported_image_start_y,this.state_.pxl_width,this.state_.pxl_height),u=Uint32Array.of(0,0,0,0,0),f=0,m=_.length;(0|f)<(0|m);f=f+1|0)u[0]=f%p[0],u[1]=(f-u[0])/p[0],u[2]=u[0]+p[1],u[3]=u[1]+p[2],u[4]=u[3]*p[3]+u[2],u[2]>=0&&u[2]=0&&u[3]0&&_>0?(c=_/(h=r?_+s:1-(1-_)*(1-s)),d=s*(1-_)/h,l.set(Uint8ClampedArray.of(o[0]*c+a[0]*d,o[1]*c+a[1]*d,o[2]*c+a[2]*d),0)):_>0?(h=o[3]/255,l.set(o,0)):(h=a[3]/255,l.set(a,0)),r&&(h/=2),l[3]=255*h|0,this.to_uint32_from_rgba(l)))},blend_rgba_colors:function(e,t,i,n){var r,a,o,s,_,l,h,c,d,p,u,f,m;for(i|=0,n|=0,r=e[0].length/4|0,a=0|e.length,o=new Uint8ClampedArray(e[0].length),s=new Uint8ClampedArray(4),_=new ArrayBuffer(4),l=new Uint8ClampedArray(_),h=new ArrayBuffer(4),c=new DataView(h),d=new Uint8ClampedArray(h),(p=new DataView(new ArrayBuffer(24))).setFloat32(20,(65535*t|0)/65535),u=0,f=0;(0|u)<(0|r);u=(u+1|0)>>>0,f=(f+4|0)>>>0){for(s.set(e[0].slice(f,f+4|0),0),m=1;(0|m)<(0|a);m=m+1|0)l.set(e[m].slice(f,f+4|0),0),0!==i&&0===l[3]&&1===p.getFloat32(20)?s.fill(0):255===l[3]&&1===p.getFloat32(20)?s.set(l,0):(p.setFloat32(0,s[3]/255),p.setFloat32(4,l[3]/255*p.getFloat32(20)),d.fill(0),p.setFloat32(8,0),p.getFloat32(0)>0&&p.getFloat32(4)>0?(n>0?p.setFloat32(8,p.getFloat32(0)+p.getFloat32(4)):p.setFloat32(8,1-(1-p.getFloat32(4))*(1-p.getFloat32(0))),p.setFloat32(12,p.getFloat32(4)/p.getFloat32(8)),p.setFloat32(16,p.getFloat32(0)*(1-p.getFloat32(4))/p.getFloat32(8)),c.setUint8(0,l[0]*p.getFloat32(12)+s[0]*p.getFloat32(16)),c.setUint8(1,l[1]*p.getFloat32(12)+s[1]*p.getFloat32(16)),c.setUint8(2,l[2]*p.getFloat32(12)+s[2]*p.getFloat32(16))):p.getFloat32(4)>0?(p.setFloat32(2,l[3]/255),d.set(l,0)):(p.setFloat32(2,s[3]/255),d.set(s,0)),n&&p.setFloat32(2,p.getFloat32(8)/2),d.fill(255*p.getFloat32(8),3,4),s.set(d));o.set(s,f)}return o},to_hex_from_uint32:function(e){return e=(0|e)>>>0,"#".concat("00000000".concat(new Uint32Array(new Uint8Array(Uint32Array.of(e).buffer).reverse().buffer).toString(16)).slice(-8))},to_hex_from_rgba:function(e){return"#".concat("00000000".concat(new Uint32Array(e.buffer)[0].toString(16)).slice(-8))},to_rgba_from_hex:function(e){return new Uint8ClampedArray(Uint32Array.of(parseInt(e.slice(1),16)).buffer)},to_rgba_from_uint32:function(e){return e=(0|e)>>>0,new Uint8ClampedArray(Uint32Array.of(e).buffer)},to_uint32_from_rgba:function(e){return(0|new Uint32Array(e.buffer)[0])>>>0},to_uint32_from_hex:function(e){return new Uint32Array(new Uint8Array(Uint32Array.of((0|parseInt(e.slice(1),16))>>>0).buffer).reverse().buffer)},to_hsla_from_rgba:function(e){var t,i,r,a,o,s,_=n(e,4),l=_[0],h=_[1],c=_[2],d=_[3];if(d/=255,r=void 0,a=void 0,o=((t=Math.max(l/=255,h/=255,c/=255))+(i=Math.min(l,h,c)))/2,t==i)r=a=0;else{switch(s=t-i,a=o>.5?s/(2-t-i):s/(t+i),t){case l:r=(h-c)/s+(h1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},t=a(s=2*c-(o=c<.5?c*(1+h):c+h-c*h),o,l+1/3),i=a(s,o,l),r=a(s,o,l-1/3)),Uint8ClampedArray.of(255*t|0,255*i|0,255*r|0,255*d|0)},invert_uint32:function(e){e=(0|e)>>>0;var t=this.to_rgba_from_uint32(e),i=n(t,4),r=i[0],a=i[1],o=i[2],s=i[3];return this.to_uint32_from_rgba(Uint8ClampedArray.of(255-r|0,255-a|0,255-o|0,0|s))},match_color:function(e,t,i){var n,r,a,o,s,_,l;return e&=4294967295,t&=4294967295,1===(i=void 0===i?null:i)||(0===i?e===t:(n=255*i|0,r=this.to_rgba_from_uint32(e),a=this.to_rgba_from_uint32(t),o=0|Math.abs(r[3]-a[3]),s=0|Math.abs(r[0]-a[0]),_=0|Math.abs(r[1]-a[1]),l=0|Math.abs(r[2]-a[2]),null!==i?s>>0)u=4294967295&t[(0|e[(0|i)>>>0])>>>0],void 0===(n=c.get(u))&&(n=(0|c.size)>>>0,c.set(u,n)),p[i]=(0|n)>>>0;r=new Uint32Array(c.size),a=!0,o=!1,s=void 0;try{for(_=c[Symbol.iterator]();!(a=(l=_.next()).done);a=!0)r[(h=l.value)[1]]=4294967295&h[0]}catch(f){o=!0,s=f}finally{try{!a&&_.return&&_.return()}finally{if(o)throw s}}return Array.of(p,r)}}}};e.exports=a}}]); \ No newline at end of file diff --git a/client/chunk_16.min.js b/client/chunk_16.min.js index d8f34edc..dbb248cc 100644 --- a/client/chunk_16.min.js +++ b/client/chunk_16.min.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{716:function(t,e,_){"use strict";async function a(){function t(t,e){if(o.buffer.byteLength(m.set(o),i(s(0)))}}function _(t){return t>>>0}function a(t){return t&g}function s(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t(3*e.length,0),_(r(0,y.encodeInto(e,m).written,a))}function i(e){let _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0n;return t(3*e.length,0),a(l(0,y.encodeInto(e,m).written,_))}const{instance:{exports:{mem:o,xxh32:r,xxh64:l,init32:h,update32:p,digest32:c,init64:u,update64:d,digest64:f}}}=await WebAssembly.instantiate(n);let m=new Uint8Array(o.buffer);const g=2n**64n-1n,y=new TextEncoder;return{h32:s,h32ToString(t){return s(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).toString(16).padStart(8,"0")},h32Raw(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t(e.byteLength,0),m.set(e),_(r(0,e.byteLength,a))},create32(){return e(48,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,h,p,c,_)},h64:i,h64ToString(t){return i(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0n).toString(16).padStart(16,"0")},h64Raw(e){let _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0n;return t(e.byteLength,0),m.set(e),a(l(0,e.byteLength,_))},create64(){return e(88,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0n,u,d,f,a)}}}_.r(e),_.d(e,"default",(function(){return a}));const n=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,0,96,3,127,127,127,1,127,96,2,127,127,0,96,2,127,126,0,96,1,127,1,127,96,1,127,1,126,96,3,127,127,126,1,126,96,3,126,127,127,1,126,3,11,10,1,1,2,0,4,6,7,3,0,5,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,211,23,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,247,148,175,175,120,106,33,4,32,2,65,177,243,221,241,121,107,33,5,3,64,32,0,40,2,0,65,247,148,175,175,120,108,32,3,106,65,13,119,65,177,243,221,241,121,108,33,3,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,4,106,65,13,119,65,177,243,221,241,121,108,33,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,2,106,65,13,119,65,177,243,221,241,121,108,33,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,5,106,65,13,119,65,177,243,221,241,121,108,33,5,32,0,65,4,106,34,0,32,6,77,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,1,40,2,0,65,189,220,202,149,124,108,32,0,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,1,45,0,0,65,177,207,217,178,1,108,32,0,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,65,15,118,32,0,115,65,247,148,175,175,120,108,34,0,32,0,65,13,118,115,65,189,220,202,149,124,108,34,0,32,0,65,16,118,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,247,148,175,175,120,106,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,177,243,221,241,121,107,54,2,0,11,211,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,5,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,4,32,4,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,5,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,5,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,40,2,0,32,5,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,12,106,34,3,40,2,0,32,5,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,16,106,34,3,40,2,0,32,5,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,20,106,34,3,40,2,0,32,5,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,4,32,0,65,20,106,40,2,0,33,7,3,64,32,1,40,2,0,65,247,148,175,175,120,108,32,2,106,65,13,119,65,177,243,221,241,121,108,33,2,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,3,106,65,13,119,65,177,243,221,241,121,108,33,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,4,106,65,13,119,65,177,243,221,241,121,108,33,4,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,7,106,65,13,119,65,177,243,221,241,121,108,33,7,32,1,65,4,106,34,1,32,8,77,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,4,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,5,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,157,4,2,1,127,3,126,32,0,32,1,106,33,3,32,1,65,32,79,4,126,32,3,65,32,107,33,3,32,2,66,135,149,175,175,152,182,222,155,158,127,124,66,207,214,211,190,210,199,171,217,66,124,33,4,32,2,66,207,214,211,190,210,199,171,217,66,124,33,5,32,2,66,0,124,33,6,32,2,66,135,149,175,175,152,182,222,155,158,127,125,33,2,3,64,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,4,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,5,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,6,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,2,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,0,65,8,106,34,0,32,3,77,13,0,11,32,6,66,12,137,32,2,66,18,137,124,32,5,66,7,137,124,32,4,66,1,137,124,32,4,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,5,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,6,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,2,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,137,2,0,32,1,32,2,106,33,2,3,64,32,1,65,8,106,32,2,77,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,32,0,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,66,33,136,32,0,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,88,0,32,0,65,8,106,32,1,66,135,149,175,175,152,182,222,155,158,127,124,66,207,214,211,190,210,199,171,217,66,124,55,3,0,32,0,65,16,106,32,1,66,207,214,211,190,210,199,171,217,66,124,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,135,149,175,175,152,182,222,155,158,127,125,55,3,0,11,132,5,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,16,106,34,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,24,106,34,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,32,106,34,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,6,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,7,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,8,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,9,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,1,65,8,106,34,1,32,2,77,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,200,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,4,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,1,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,5,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11])},926:function(t,e,_){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}var n,s,i,o,r,l,h,p,c,u,d,f,m,g,y,v,x,w,b,M,I,z,C,A,S,j,E,D,L,k,O,F,U,G,T;Object.defineProperty(e,"__esModule",{value:!0}),n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var _,a,n=[],s=!0,i=!1,o=void 0;try{for(_=t[Symbol.iterator]();!(s=(a=_.next()).done)&&(n.push(a.value),!e||n.length!==e);s=!0);}catch(r){i=!0,o=r}finally{try{!s&&_.return&&_.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},s=function(){function t(t,e){var _,a;for(_=0;_0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.super_state.set_state({_id:Date.now(),pxl_width:parseInt(e),pxl_height:parseInt(_),_pxl_indexes_of_selection:new i.SetFixed(e*_),_base64_original_images:[],_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_json_state_history:{history_position:0,state_history:[]},_s_layers:[o.Layer.new_from_colors_and_indexes(new Uint32Array(1),new Uint16Array(parseInt(e)*parseInt(_)),parseInt(e),parseInt(_),!0)],_layer_index:0,_pxls_hovered:-1,_original_image_index:-1,_last_action_timestamp:Date.now()}).then((function(){t._set_size()}))},this._set_size=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e=e||t.super_state.get_state().pxl_width,_=_||t.super_state.get_state().pxl_height,t.super_state.set_state({pxl_width:e,pxl_height:_}).then((function(){t.canvas_pos.set_sizes(e,_),t.canvas_pos.set_current_scale_default(),t._request_force_update(!1,!1).then((function(){t.super_canvas.setDimensions(e,_).then((function(){t.super_master_meta.update_canvas(!0).catch((function(){t._set_size(e,_)}))})).catch((function(){t.super_master_meta.update_canvas(!0).catch((function(){t._set_size(e,_)}))}))})).catch((function(){t._set_size(e,_)}))}))},this.export_state=function(){t._notify_export_state()},this._notify_export_state=function(){t.props.on_state_export&&t.props.on_state_export(),t.props.on_state_exported&&t.export_JS_state((function(e){t.props.on_state_exported(e)}))},this._maybe_update_selection_highlight=function(){var e=t.super_state.get_state(),_=e.tool,a=e._select_shape_index_a,n=e._selection_pair_highlight;_.toUpperCase().includes("SELECT")&&parseInt(a)<0&&t.super_state.set_state({_selection_pair_highlight:!n}).then((function(){t.super_master_meta.update_canvas(!1,Date.now())}))},this._set_props=function(e){t.componentWillReceiveProps(Object.assign(Object.assign({},t.props),e))},this.zoom_in=function(){t.canvas_pos.set_zoom(1.33)},this.zoom_out=function(){t.canvas_pos.set_zoom(.75)},this.current_layer_up=function(){var e=t.super_state.get_state(),_=e._layers,a=e._layer_index,n=e._s_layers;if(a<_.length-1)return _.splice(a+1,0,_.splice(a,1)[0]),n.splice(a+1,0,n.splice(a,1)[0]),t.super_state.set_state({_layers:_,_layer_index:parseInt(a+1),_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.current_layer_down=function(){var e=t.super_state.get_state(),_=e._layers,a=e._layer_index,n=e._s_layers;if(a>0)return _.splice(a-1,0,_.splice(a,1)[0]),n.splice(a-1,0,n.splice(a,1)[0]),t.super_state.set_state({_layers:_,_s_layers:n,_layer_index:parseInt(a-1),_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.new_layer=function(e){var _=t.super_state.get_state(),a=_.pxl_width,n=_.pxl_height,s=t.super_state.get_state(),i=s._layers,r=s._s_layers;return e=void 0===e?r.length:e,r.splice(e+1,0,o.Layer.new_from_colors_and_indexes(Uint32Array.of(0),new Uint8Array(a*n),a,n,!0)),i.splice(e+1,0,{id:Date.now(),hash:"",name:"Layer "+(e+1),hidden:!1,opacity:1,colors:["#00000000"],number_of_colors:1}),t.super_state.set_state({_layers:i,_s_layers:r,_layer_index:e+1,_last_action_timestamp:Date.now()}).then((function(){return t._maybe_save_state(void 0,!0),t.super_master_meta.update_canvas(!0),Promise.resolve()}))},this.new_layer_from_image=function(e){var _=t.super_state.get_state(),a=_._layers,n=_._s_layers;return(0,y.QuantiMatGlobal)(e,255).then((function(_){var s=_[1],i=_[2];return n.splice(0,0,o.Layer.new_from_colors_and_indexes(i,s,e.width,e.height,!0)),a.splice(0,0,{id:Date.now(),name:"Background",hidden:!1,opacity:1,colors:["#00000000"],number_of_colors:1}),t.super_state.set_state({_layers:a,_s_layers:n,_layer_index:0,_last_action_timestamp:Date.now()}).then((function(){return t._maybe_save_state(void 0,!0),t.super_master_meta.update_canvas(!0),Promise.resolve()}))}))},this.duplicate_layer=function(e){var _=t.super_state.get_state(),a=_._layers,n=_._s_layers,s=_.pxl_width,i=_.pxl_height;return e=void 0===e?n.length:e,n.splice(e+1,0,o.Layer.new_from_colors_and_indexes(n[e].colors_copy,n[e].indexes_copy,s,i,!0)),a.splice(e+1,0,{id:Date.now(),hash:a[e].hash,name:a[e].name+" (copy)",hidden:!!a[e].hidden,opacity:parseFloat(a[e].opacity),colors:Array.from(a[e].colors||[]),number_of_colors:parseInt(a[e].number_of_colors),thumbnail:a[e].thumbnail}),t.super_state.set_state({_layers:a,_layer_index:e+1,_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.delete_layer=function(e){var _=t.super_state.get_state(),a=_._layers,n=_._s_layers,s=_._layer_index;if(a.length>1)return n.splice(e,1),a.splice(e,1),s=(s=e-1)<0?0:s,t.super_state.set_state({_layers:a,_layer_index:s,_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.change_active_layer=function(e){if(t.super_state.get_state()._layers.length>e&&0<=e)return t.super_state.set_state({_layer_index:e,_last_action_timestamp:1/0}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.toggle_layer_visibility=function(e){var _=Array.from(t.super_state.get_state()._layers);_[parseInt(e)].hidden=!_[parseInt(e)].hidden,t.super_state.set_state({_layers:_,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this.change_layer_opacity=function(e,_){var a=Array.from(t.super_state.get_state()._layers);a[parseInt(e)].opacity=parseFloat(_),t.super_state.set_state({_layers:a,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this.merge_down_layer=function(e){var _,a,s,i,r,l,h,p,c,u,d=t.super_state.get_state(),f=d._layers,m=d._s_layers,g=d.pxl_width,y=d.pxl_height;if(void 0!==f[e]&&void 0!==f[e-1]){for(_=m[e].indexes,a=m[e-1].indexes,s=m[e].colors,i=m[e-1].colors,r=255&Math.round(255*parseFloat(f[e].opacity)),l=255&Math.round(255*parseFloat(f[e-1].opacity)),h=0|_.length,p={id:Date.now(),name:"Merged layers "+e+"+"+(e-1),hidden:!(!f[e].hidden||!f[e-1].hidden),opacity:parseFloat(1)},c=C.default.init(2,h,Uint8Array.of(l,r)),u=0;(0|u)<(0|h);u=(u+1|0)>>>0)c.for(u,0),c.stack(0,i[a[0|u]]),c.stack(1,s[_[0|u]]),c.next();c.blend(!1,!1).then((function(_){var a,s,i,r,l,h=n(_,2),u=h[0],d=h[1],v=new Uint32Array(new ArrayBuffer(y*g*4)),x=0|u.length;for(a=0;F.simdops.int_less(a,x);a=F.simdops.plus_uint(a,1))v[u[a]]=d[0|a];s=new ImageData(new Uint8ClampedArray(v.buffer),g,y),r=(i=t._get_pixels_palette_and_list_from_image_data(s,!0)).new_pxl_colors,l=i.new_pxls,c.clear(),f.splice(e-1,2,p),m.splice(e-1,2,o.Layer.new_from_colors_and_indexes(r,l,g,y,!0)),t.super_state.set_state({_layer_index:e-1,_layers:f,_s_layers:m,_old_pxl_colors:new Uint32Array(m[0].indexes.length),_last_action_timestamp:Date.now()}).then((function(){t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0)}))}))}},this.compute_filters_preview=function(){t._notify_filters_change(1)},this._notify_filters_change=function(){var e,_,a,n,s,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.props.onFiltersThumbnailChange&&(e=t.super_state.get_state(),_=e._processing_filters,a=e._layer_index,n=e._last_filters_hash,s=e._s_layers,i=e._filter_thumbnails,s[a].hash_hex_async().then((function(e){var r,l,h;n===e&&!1!==_||(r=i||new Map,l=0,h=0,t.super_state.set_state({_last_filters_hash:e,_processing_filters:!0}).then((function(){t.filters.names.forEach((function(_,n,i){t.filters.use(_,s[a],o,!0).bitmap_async().then((function(a){h++;var n=r.get(_);void 0!==n&&void 0!==n.destroy&&n.destroy(),r.set(_,a),l=Math.round(h/i.length*100).toString(),t.props.onFiltersThumbnailChange(r,e,l),r.size===i.length&&t.super_state.set_state({_filter_thumbnails:r,_processing_filters:!1})}))}))})))})))},this.get_pixel_color_from_pos=function(e,_){return t.super_master_meta.get_pixel_color_from_pos(e,_)},this.get_layer_bitmap_image=function(e,_,a,n,s){t.bmp_layer.render(e,_,a,n,s)},this.set_png_compressors=function(e,_){t.png_quant=e||t.png_quant,t.oxi_png=_||t.oxi_png},this.get_base64_png_data_url=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:35;return t._get_base64_png_data_url(e,_,a,n,s)},this._get_base64_png_data_url=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:35,i=t.super_state.get_state(),o=i.pxl_width,r=i.pxl_height,l=i._s_layers,h=i._layers;return new Promise((function(i,p){f.default.from(u.default,parseInt(o),parseInt(r),l.map((function(t){return t.indexes})),l.map((function(t){return t.colors})),h,parseInt(e),!0).render().then((function(o){o.colors.length>256?i(o):"function"==typeof t.png_quant&&0!==a?t.png_quant(""+o.url,n,s,a,u.default).then((function(t){o.url=t,i(o)})).catch((function(o){t.props.set_compressor().then((function(){t._get_base64_png_data_url(e,_,a,n,s).then(i).catch(p)}))})):t.props.set_compressor().then((function(){t._get_base64_png_data_url(e,_,a,n,s).then(i).catch(p)}))})).catch((function(t){p(t)}))}))},this._get_pixels_palette_and_list_from_image_data=function(e){var _,a,n,s,i,o,r,l,h,p,c,u,d=arguments.length>1&&void 0!==arguments[1]&&arguments[1],f=t.super_state.get_state(),m=f.max_size,g=f._lazy_lazy_compute_time_ms,y=(f.pxl_width,f.pxl_height,e.data.length/4>m*m),v=[],x=new Set,w=void 0;if(!y||d)for(w=new Uint16Array(e.width*e.height).fill(0),_=0;_>>0)?v.indexOf((0|a)>>>0):-1)&&(n=(v.push((0|a)>>>0)-1|0)>>>0,x.add((0|a)>>>0)),w[_/4|0]=(0|n)>>>0;else for(s=Date.now(),w=new Uint16Array(e.width*(m+1)).fill(0),i=0,o=0;o<=m&&!(s+g2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"high",s=document.createElement("canvas");return s.width=t,s.height=e,_=s.getContext("2d"),a?(_.mozImageSmoothingEnabled=!1,_.webkitImageSmoothingEnabled=!1,_.msImageSmoothingEnabled=!1,_.imageSmoothingEnabled=!1):n.length&&(_.imageSmoothingQuality=n),[_,s]},this.copy_selection=function(){t.import_image_on_canvas_from_selection()},this.cut_selection=function(){t.import_image_on_canvas_from_selection(),t.erase_selection(),t.to_selection_none()},this.erase_selection=function(){var e=t.super_state.get_state(),_=e._s_layers,a=e._layer_index,n=e._pxl_indexes_of_selection,s=(e.pxl_width,e.pxl_height,Array.from(_[a].colors));n.size>0&&(s.includes(0)||(s.push(0),_[a].set_colors(s)),n.forEach((function(t){_[a].set_uint32(t,0)})),t.super_state.set_state({_s_layers:_,_last_action_timestamp:Date.now()}).then((function(){t.super_master_meta.update_canvas()})))},this.import_image_on_canvas_from_selection=function(){var e,_,a,s,i,o,r,l,h,p,c,u,d,f=t.super_state.get_state(),m=f._s_layers,g=f._layer_index,y=f._pxl_indexes_of_selection,v=f.pxl_width,x=f.pxl_height;if(y.size>0){for(e=[v,x],_=[-1,-1],y.forEach((function(t){var a=t%v,n=(t-a)/v;a_[0]&&(_[0]=a),n>_[1]&&(_[1]=n)})),a=1+_[0]-e[0],s=1+_[1]-e[1],i=m[g].indexes,o=new Uint16Array(a*s),r=Array.from(m[g].colors),l=0;l0&&void 0!==arguments[0]?arguments[0]:null,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.props.onLoad&&t.props.onLoad("image_load"),a.id?t.super_state.set_state({_id:Date.now(),pxl_width:parseInt(a.width),pxl_height:parseInt(a.height),_pxl_indexes_of_selection:new i.SetFixed(a.width*a.height),_base64_original_images:[_],_s_layers:[o.Layer.new_from_colors_and_indexes(a.pxl_colors,a.pxls,parseInt(a.width),parseInt(a.height),!0)],_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_layer_index:0,_pxls_hovered:-1,_original_image_index:0,_last_action_timestamp:Date.now(),_json_state_history:{history_position:0,state_history:[]}}).then((function(){t._set_size(),t._notify_image_load_complete(),t._notify_export_state()})):setTimeout((function(){var a,r,l,h,p,c,u,d,f,m,g,y,v,x,w,b,M,I,z,C,A,S,j,E,D,L,k,O,F,U,G,T,N,P,H,R,B,W,Y,q,Z,Q,V,J,X,K,$,tt,et,_t=t.super_state.get_state(),at=_t.default_size,nt=_t.max_size,st=_t.ideal_size,it=_t._base64_original_images,ot=_t.dont_change_img_size_onload,rt=_t.dont_compute_base64_original_image,lt=e.naturalWidth,ht=e.naturalHeight,pt=t._get_new_ctx_from_canvas(lt,ht,!0),ct=n(pt,2),ut=ct[0],dt=ct[1];if(ut.drawImage(e,0,0,lt,ht),a=ut.getImageData(0,0,lt,ht),r=rt?"":_.length>0?_:dt.toDataURL("image/jpeg"),ut=null,dt=null,l=!1,h=1,!1===ot){if(c=(p=t._get_pixels_palette_and_list_from_image_data(a,!0)).new_pxls,u=p.new_pxl_colors,a=null,d=c.length/u.length,!(f=nt*nt>ht*lt)){if(m=1/0,y=0,v=-1,(g=[])[1]=0,c.forEach((function(t,e){v===t||0===e?y++:(y32||(_=i>32?1:42/(i+10),a=i>32?0:(i>32?1:_*M)*Math.pow(i,1-1/_+1),1!==i&&wg[1]?b:1,z=I,g[1]g[1]&&(z=C,f=!0);break}C++}if(A=z,Object.entries(g).forEach((function(t,e){var _=n(t,2),a=_[0],s=_[1];a=parseInt(a),e>1&&s>g[A]&&a16*Math.sqrt(j=ht*h*(lt*h))&&j<=at*at*4||d>9*Math.sqrt(j)&&j<=at*at*3||d>4*Math.sqrt(j)&&j<=at*at*2||d>1*Math.sqrt(j)&&j<=at*at*1,D=j>u.length,(E||f)&&jat*at&&(lt*=h,ht*=h,l=!0);else{for(L=1;Math.round(lt*L)*Math.round(ht*L)>at*at;)L-=.01;lt*=L,ht*=L}}k=void 0,O=null,l&&!1===ot?(N=(G=ht/h)-G%(F=1/h),P=Math.floor((T=(U=lt/h)-U%F)/F),H=Math.floor(N/F),R=T,B=N,W=Math.floor((U-T)/2),Y=Math.floor((G-N)/2),lt=Math.floor(P),ht=Math.floor(H),q=t._get_new_ctx_from_canvas(lt,ht,!0),k=(Z=n(q,2))[0],Z[1],k.drawImage(e,W,Y,R,B,0,0,lt,ht),O=k.getImageData(0,0,lt,ht)):!1===ot?(lt=Math.floor(lt),ht=Math.floor(ht),Q=t._get_new_ctx_from_canvas(lt,ht,!0),k=(V=n(Q,2))[0],V[1],k.drawImage(e,0,0,lt,ht),O=k.getImageData(0,0,lt,ht)):O=a,J=t._get_pixels_palette_and_list_from_image_data(O,!0),k=null,a=null,O=null,(X=it).includes(r)||X.push(r),K=t.color_conversion.clean_duplicate_colors(J.new_pxls,J.new_pxl_colors),tt=($=n(K,2))[0],et=$[1],t.super_state.set_state({_id:Date.now(),pxl_width:parseInt(lt),pxl_height:parseInt(ht),_pxl_indexes_of_selection:new i.SetFixed(lt*ht),_base64_original_images:X,_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_json_state_history:{history_position:0,state_history:[]},_s_layers:[o.Layer.new_from_colors_and_indexes(et,tt,parseInt(lt),parseInt(ht),!0)],_layer_index:0,_pxls_hovered:-1,_original_image_index:X.indexOf(r),_last_action_timestamp:Date.now()}).then((function(){t._set_size(),t._notify_image_load_complete(),t._notify_export_state()}))}),50)},this._set_canvas_ref=function(e){if(void 0===e)return t._set_size();if(null===e)return t._set_size();if(void 0===e.width)return t._set_size();if(null===e.width)return t._set_size();var _=t.super_state.get_state(),a=_.pxl_width,n=_.pxl_height;t.super_canvas.new(e,a,n).then((function(){t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0)}))},this._set_canvas_container_ref=function(e){null!==e&&t.super_state.set_state({_canvas_container:e}).then((function(){t._update_canvas_container_size()}))},this._set_canvas_wrapper_ref=function(e){null!==e&&t.super_state.set_state({_canvas_wrapper:e})},this._set_canvas_wrapper_overflow_ref=function(e){null!==e&&(e.addEventListener("wheel",t._canvas_pos_handle_wheel,{passive:!1}),e.addEventListener("pointerdown",t._canvas_pos_handle_pointer_down,{passive:!1}),e.addEventListener("pointermove",t._canvas_pos_handle_pointer_move,{passive:!1}),e.addEventListener("pointerup",t._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointercancel",t._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerout",t._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerleave",t._canvas_pos_handle_pointer_up,{passive:!1}),t.super_state.set_state({_canvas_wrapper_overflow:e}))},this._super_master_meta_handle_canvas_mouse_move=function(e){t.super_master_meta._handle_canvas_mouse_move(e)},this._super_master_meta_handle_canvas_mouse_up=function(e){t.super_master_meta._handle_canvas_mouse_up(e)},this._super_master_meta_handle_canvas_mouse_down=function(e){t.super_master_meta._handle_canvas_mouse_down(e)},this._function_ripple=function(e){t._ripple.start(e),setTimeout((function(){t._ripple.stop(e)}),75)},this._canvas_pos_handle_wheel=function(e){t.canvas_pos.handle_wheel(e)},this._canvas_pos_handle_pointer_down=function(e){t.canvas_pos.handle_pointer_down(e)},this._canvas_pos_handle_pointer_move=function(e){t.canvas_pos.handle_pointer_move(e)},this._canvas_pos_handle_pointer_up=function(e){t.canvas_pos.handle_pointer_up(e)},this.write_text=function(e,_){var a,n=t.super_state.get_state()._layer_index;t.new_layer(n),t.change_active_layer(n+1),a=(new t.super_state.create_shape).from_text(e,_),t.super_state.paint_shape(a,t.super_state.get_state().pxl_current_color_uint32)},this._match_color=function(e,_,a){var s,i,o,r,l,h,p,c,u,d,f,m,g,y,v,x,w,b;return 1===(a=void 0===a?null:a)||(0===a?e===_:(s=Math.round(255*a),i=t.color_conversion.to_rgba_from_uint32(e),r=(o=n(i,4))[0],l=o[1],h=o[2],p=o[3],c=t.color_conversion.to_rgba_from_uint32(_),d=(u=n(c,4))[0],f=u[1],m=u[2],g=u[3],y=Math.abs(p-g),v=Math.abs(r-d),x=Math.abs(l-f),w=Math.abs(h-m),b=Math.abs(1-y/255),null!==a?!!(vt.super_state.get_state()._layers_defined_at),r=Object.assign({},e);r._layers=Array.from(e._layers.map((function(t){return{id:0|t.id,hash:t.hash+"",name:t.name+"",hidden:t.hidden&&!0,opacity:parseFloat(t.opacity),colors:Array.from(t.colors),number_of_colors:0|t.number_of_colors}}))),s&&o&&i?t.super_state.set_state({_layer_index:parseInt(e._layer_index),_layers:Array.from(e._layers),_layers_defined_at:a}).then((function(){t.props.onLayersChange&&t.props.onLayersChange(t.super_state.get_state()._layer_index,Array.from(e._layers)),null!==_&&_(t.super_state.get_state()._layers,t.super_state.get_state()._layer_index,s,r)})):(t.props.onLayersChange&&t.props.onLayersChange(t.super_state.get_state()._layer_index,Array.from(e._layers)),(s||n)&&i?null!==_&&_(t.super_state.get_state()._layers,t.super_state.get_state()._layer_index,s,r):null!==_&&_(t.super_state.get_state()._layers,t.super_state.get_state()._layer_index,s,{}))},this._get_most_used_color_sorted=function(t,e,_){var a,n,s,i;for(_=Math.min(e.length,_||256),a=new F.Colors(new F.Colors(e.buffer).get_deduplicated_sorted_uint32a(_).buffer),n=new F.Color(new ArrayBuffer(4)),s=Array(_),i=0;i<_;i++)s[i]=a.get_use_element(i,n).hex;return s},this._notify_layers_and_compute_thumbnails_change=function(e,_,a,n){var s,i,o,r,l,h,p,c,u;for(n=n||Date.now(),s=0,i=parseInt(e._timestamp)||Date.now(),o=parseInt(_._timestamp),r=_._layers.length,l=parseInt(i),h=!1,p=!1,c=function(i){_._s_layers[i].bitmap_async(!0).then((function(c){var u=""+c.hash,d=Object.assign({},(e._layers||[])[i]),f=d.thumbnail,m=d.hash;m===u&&m&&f&&_._s_layers[i].thumbnail?(_._layers[i].hash=u,_._layers[i].thumbnail=f,0!==_._layers[i].colors.length&&_._layers[i].colors.length===_._layers[i].number_of_colors||(_._layers[i].colors=t._get_most_used_color_sorted(_._s_layers[i].indexes,_._s_layers[i].colors,256),_._layers[i].number_of_colors=parseInt(_._s_layers[i].colors.length)),++s===r&&(_._timestamp=parseInt(l),t.maybe_set_layers(_,a,n,p,h))):(p=!0,m===u&&m||(h=!0,l=o),_._layers[i].hash=u,_._layers[i].thumbnail=c,_._layers[i].colors=t._get_most_used_color_sorted(_._s_layers[i].indexes,_._s_layers[i].colors,256),_._layers[i].number_of_colors=parseInt(_._s_layers[i].colors.length),++s===r&&(_._timestamp=parseInt(l),t.maybe_set_layers(_,a,n,p,h)))}))},u=0;us._saving_json_state_history_ran_timestamp||_)&&(s._last_action_timestamp+625<=Date.now()||_||0===i.state_history.length)?s._saving_json_state_history_running||n&&!_?setTimeout((function(){t._maybe_save_state(e,_,a)}),125):(t.super_state.set_state({_saving_json_state_history_running:!0}),r=s._id,l=s._layers,h=s.pxl_width,p=s.pxl_height,c=s._s_layers,u=s._original_image_index,d=s._layer_index,f=s._pxl_indexes_of_selection,m=s._pencil_mirror_index,g=parseInt(i.history_position),y=0===i.state_history.length?{}:i.state_history[g-1],(v={})._timestamp=parseInt(Date.now()),v._id=r.toString(),v.pxl_width=parseInt(h),v.pxl_height=parseInt(p),v._original_image_index=parseInt(u),v._layers=Array.from(l.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity||1),thumbnail:t.thumbnail||null,colors:Array.from(t.colors||[]),number_of_colors:parseInt(t.number_of_colors||0)}}))),v._layer_index=parseInt(d),v._s_layers=Array.from(c.map((function(t){return t=t||{},o.Layer.new_from_colors_and_indexes(t.colors_copy,t.indexes_copy,parseInt(h),parseInt(p),!0)}))),v._pxl_indexes_of_selection=f.export,v._pencil_mirror_index=parseInt(m),t._notify_layers_and_compute_thumbnails_change(Object.assign({},y),Object.assign({},v),(function(_,a,n){var o,r,l=s._state_history_length,h=s._saving_json_state_history_ran_timestamp,p=!(0!==i.state_history.length),c=parseInt(i.history_position),u=v._timestamp||0,d=Date.now();if(p&&0!==u)i.state_history=[],i.state_history.push(Object.assign({},v)),i.history_position=1,h=d;else if(n){if(i.state_history.length-c>0)for(o=i.state_history.splice(c);o.length;)i.state_history.push(Object.assign({},o.shift()));i.state_history.length>=l&&i.state_history.splice(1,1),i.state_history.push(Object.assign({},v)),i.history_position=parseInt(i.state_history.length),h=d}else for(r=0;r0&&void 0!==arguments[0]&&arguments[0],_=t.super_state.get_state(),a=_._s_layers,n={width:_.pxl_width,height:_.pxl_height,number_of_colors:a[0].colors.length,only_scan:e};t._maybe_save_state(void 0,!0),t.props.onLoadComplete&&t.props.onLoadComplete("image_load",n)},this._notify_image_import_complete=function(){t.props.onImageImportComplete&&t.props.onImageImportComplete()},this._notify_can_undo_redo_change=function(){t.props.onCanUndoRedoChange&&t.props.onCanUndoRedoChange(t._can_undo(),t._can_redo())},this._notify_size_change=function(){var e=t.super_state.get_state(),_=e.pxl_width,a=e.pxl_height;t.props.onSizeChange&&t.props.onSizeChange(_,a)},this.import_JSON_state=function(e){t.import_JS_state(e)},this.import_JS_state=function(e,_){var a=Array.from(e._base64_original_images);Promise.all(a.map((function(t){return(0,U.bytesToBase64)(t[1])}))).then((function(n){var s,r;n.forEach((function(t,e){a[e]=a[e][0]+","+t})),s={history_position:parseInt(e._json_state_history.history_position),state_history:e._json_state_history.state_history.map((function(t){return Object.assign({},{_original_image_index:parseInt(t._original_image_index),pxl_width:parseInt(t.pxl_width),pxl_height:parseInt(t.pxl_height),_pxl_indexes_of_selection:i.SetFixed.import(t._pxl_indexes_of_selection),_s_layers:Array(t._s_pxls.length).fill({}).map((function(e,_){return o.Layer.new_from_colors_and_indexes(t._s_pxl_colors[_],t._s_pxls[_],parseInt(t.pxl_width),parseInt(t.pxl_height),!0)})),_layers:Array.from(t._layers.map((function(t){return Object.assign({},{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)})}))),_layer_index:parseInt(t._layer_index),_pencil_mirror_index:parseInt(t._pencil_mirror_index),_id:t._id.toString()})}))},e=null,r=s.state_history[s.history_position-1],t.super_state.set_state({_id:r._id.toString(),pxl_width:parseInt(r.pxl_width),pxl_height:parseInt(r.pxl_height),_base64_original_images:Array.from(a),_original_image_index:parseInt(r._original_image_index)||0,_layers:Array.from(r._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(r._layer_index)||0,_s_layers:Array.from(r._s_layers),_pxl_indexes_of_selection:i.SetFixed.import(r._pxl_indexes_of_selection),_pencil_mirror_index:parseInt(r._pencil_mirror_index),_json_state_history:s,_pxls_hovered:-1,_last_action_timestamp:1/0}).then((function(){t._set_size(),t._notify_image_load_complete(),t._notify_is_something_selected(),t._notify_can_undo_redo_change(),_()}))}))},this.export_JS_state=function(e){t._maybe_save_state((function(_){var a=t.super_state.get_state()._base64_original_images.map((function(t){return t.split(",")}));Promise.all([Promise.all(a.map((function(t){return(0,U.base64ToBytes)(t[1])}))),t.get_base64_png_data_url(1,!1,1,100,100)]).then((function(n){Array.from(n[0]).forEach((function(t,e){a[e][1]=t})),_={history_position:parseInt(_.history_position),state_history:_.state_history.map((function(t){return Object.assign({},{_original_image_index:parseInt(t._original_image_index),pxl_width:parseInt(t.pxl_width),pxl_height:parseInt(t.pxl_height),_pxl_indexes_of_selection:t._pxl_indexes_of_selection.export,_s_pxls:Array.from(t._s_layers).map((function(t){return t.indexes_copy})),_s_pxl_colors:Array.from(t._s_layers).map((function(t){return t.colors_copy})),_layers:Array.from(t._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(t._layer_index),_pencil_mirror_index:parseInt(t._pencil_mirror_index),_id:t._id.toString()})}))};var s=3*Math.ceil(n[1].url.length/4);e({id:t.super_state.get_state()._id.toString(),kb:s/1024,preview:n[1].url,timestamp:Date.now(),_base64_original_images:a,_json_state_history:_})}))}))},this._can_undo=function(e){return e||(e=t.super_state.get_state()._json_state_history),parseInt(e.history_position-1)},this.undo=function(){t._maybe_save_state((function(e){var _,a;t._can_undo(e)>0&&(e.history_position=parseInt(e.history_position-1),_=e.state_history[e.history_position-1],a=!(_.pxl_width===t.super_state.get_state().pxl_width&&_.pxl_height===t.super_state.get_state().pxl_height),t.super_state.set_state({_id:_._id.toString(),pxl_width:parseInt(_.pxl_width),pxl_height:parseInt(_.pxl_height),_original_image_index:parseInt(_._original_image_index),_layers:Array.from(_._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(_._layer_index),_s_layers:Array.from(_._s_layers.map((function(t){return o.Layer.new_from_colors_and_indexes(t.colors_copy,t.indexes_copy,parseInt(_.pxl_width),parseInt(_.pxl_height),!0)}))),_pxl_indexes_of_selection:i.SetFixed.import(_._pxl_indexes_of_selection),_pencil_mirror_index:parseInt(_._pencil_mirror_index),_json_state_history:e,_last_action_timestamp:Date.now()}).then((function(){a?t._set_size():t.super_master_meta.update_canvas(!0),t._notify_is_something_selected(),t._notify_can_undo_redo_change()})))}),!0)},this._can_redo=function(e){return e||(e=t.super_state.get_state()._json_state_history),e.state_history.length-parseInt(e.history_position-1)-1|0},this.redo=function(){t._maybe_save_state((function(e){var _,a;t._can_redo(e)>0&&(e.history_position=parseInt(e.history_position+1),_=e.state_history[e.history_position-1],a=!(_.pxl_width===t.super_state.get_state().pxl_width&&_.pxl_height===t.super_state.get_state().pxl_height),t.super_state.set_state({_id:_._id.toString(),pxl_width:parseInt(_.pxl_width),pxl_height:parseInt(_.pxl_height),_original_image_index:parseInt(_._original_image_index),_layers:Array.from(_._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(_._layer_index),_s_layers:Array.from(_._s_layers.map((function(t){return o.Layer.new_from_colors_and_indexes(t.colors_copy,t.indexes_copy,parseInt(_.pxl_width),parseInt(_.pxl_height),!0)}))),_pxl_indexes_of_selection:i.SetFixed.import(_._pxl_indexes_of_selection),_pencil_mirror_index:parseInt(_._pencil_mirror_index),_json_state_history:e,_last_action_timestamp:Date.now()}).then((function(){a?t._set_size():t.super_master_meta.update_canvas(!0),t._notify_is_something_selected(),t._notify_can_undo_redo_change()})))}),!0)},this.to_selection_border=function(){var e=t.super_state.get_state(),_=e.pxl_current_color_uint32,a=e._pxl_indexes_of_selection,n=e._s_layers,s=e._layer_index,i=e.pxl_current_opacity,o=(n[s]||{}).indexes_copy||new Uint8Array(0),r=Array.from(n[s].colors_copy);t._get_border_from_selection(a).forEach((function(e){var a,n=o[e],s=r[n],l=t.color_conversion.blend_colors(s,_,i,!1,!1);r.includes(l)||r.push(l),a=r.indexOf(l),o[e]=a})),n[s].set_colors_and_indexes(r,o),t.super_state.set_state({_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},this.to_selection_bucket=function(){var e=t.super_state.get_state(),_=e._s_layers,a=e._pxl_indexes_of_selection,n=e._layer_index,s=e.pxl_current_opacity,i=e.pxl_current_color_uint32,o=Array.from(_[n].indexes),r=Array.from(_[n].colors);a.forEach((function(e){var _,a=o[e],n=r[a],l=t.color_conversion.blend_colors(n,i,s,!1,!1);r.includes(l)||r.push(l),_=r.indexOf(l),o[e]=_})),_[n].set_colors_and_indexes(r,o),t.super_state.set_state({_s_layers:_,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},this.to_selection_invert=function(){var e,_=t.super_state.get_state(),a=_._s_layers,n=_._pxl_indexes_of_selection,s=_._layer_index,o=_.pxl_width,r=_.pxl_height,l=n,h=new i.SetFixed(o*r);for(e=0;e1&&void 0!==arguments[1]&&arguments[1],a=t.color_conversion.to_rgba_from_uint32(e),s=n(a,4),i=s[0],o=s[1],r=s[2],l=s[3],h=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(i,o,r,l)),p=n(h,4),c=p[0],u=p[1],d=p[2],f=(p[3],t.super_state.get_state()),m=f._s_layers,g=f._pxl_indexes_of_selection,y=f._layer_index,v=Array.from(m[y].indexes),x=Array.from(m[y].colors),w=t._get_average_color_of_selection(),b=t.color_conversion.to_rgba_from_uint32(w),M=n(b,4),I=M[0],z=M[1],C=M[2],A=M[3],S=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(I,z,C,A)),j=n(S,4),E=j[0],D=(j[1],j[2],j[3],E-c);g.forEach((function(e,a,s){var i,o,r,l,h,p,c,f=v[e],m=x[f],g=t.color_conversion.to_rgba_from_uint32(m),y=n(g,4),w=y[0],b=y[1],M=y[2],I=y[3],z=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(w,b,M,I)),C=n(z,4),A=C[0],S=C[1],j=C[2],E=C[3],L=A+D<0?(360+A+D)%360:(A+D)%360,k=[u,d,1],O=[S,j,1],F=[];0!==I&&_?(F[2]=1-(1-k[2])*(1-O[2]),F[0]=Math.round(k[0]*k[2]/F[2]+O[0]*O[2]*(1-k[2])/F[2]),F[1]=Math.round(k[1]*k[2]/F[2]+O[1]*O[2]*(1-k[2])/F[2])):F=[S,j],i=t.color_conversion.to_rgba_from_hsla(Array.of(L,F[0],F[1],E)),r=(o=n(i,4))[0],l=o[1],h=o[2],p=o[3],c=0,0!==I&&(c=t.color_conversion.to_uint32_from_rgba(Uint8ClampedArray.of(r,l,h,p))),x.includes(c)||x.push(c),v[e]=x.indexOf(c)})),m[y].set_colors_and_indexes(x,v),t.super_state.set_state({_s_layers:m,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},this._get_border_from_selection=function(e){var _=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.super_state.get_state(),s=n.pxl_width,o=n.pxl_height,r=new i.SetFixed(s*o);return e.forEach((function(t,n){var i,l,h,p,c=void 0,u=void 0,d=void 0,f=void 0;u=(u=t+1)%s==0?-1:u,f=(f=t-1)%s==s-1?-1:f,i=void 0,l=void 0,h=void 0,p=void 0,i=(c=(c=t-s)<0?-1:c)-1,i=-1===c||-1===f?-1:i,l=c+1,l=-1===c||-1===u?-1:l,h=(d=(d=t+s)>s*o?-1:d)-1,h=-1===d||-1===f?-1:h,p=d+1,p=-1===d||-1===u?-1:p,_?(e.has(c)&&-1!==c&&e.has(u)&&-1!==u&&e.has(d)&&-1!==d&&e.has(f)&&-1!==f||r.add(t),a&&(e.has(i)&&-1!==i&&e.has(l)&&-1!==l&&e.has(h)&&-1!==h&&e.has(p)&&-1!==p||r.add(t))):(e.has(c)||r.add(c),e.has(u)||r.add(u),e.has(d)||r.add(d),e.has(f)||r.add(f),a&&(e.has(i)||r.add(i),e.has(l)||r.add(l),e.has(h)||r.add(h),e.has(p)||r.add(p)))})),r},this._to_selection_crop=function(){var e,_,a,s,r,l,h,p,c,u,d,f,m=t.super_state.get_state(),g=m._s_layers,y=(m._layer_index,m._pxl_indexes_of_selection),v=m.pxl_width,x=m.pxl_height,w=m._base64_original_images,b=m._original_image_index;if(y.size>0){for(e=[v,x],_=[-1,-1],y.forEach((function(t){var a=t%v,n=(t-a)/v;a_[0]&&(_[0]=a),n>_[1]&&(_[1]=n)})),a=1+_[0]-e[0],s=1+_[1]-e[1],r=0;r0;t.super_state.set_state({_is_image_import_mode:e}),t.props.onImageImportModeChange&&t.props.onImageImportModeChange(e)},this.to_selection_crop=function(){t._to_selection_crop()},this.to_rotation=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._to_rotation(e)},this.to_greyscale=function(){t._to_colorized("greyscale")},this.to_sepia=function(){t._to_colorized("sepia")},this.to_opacity=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;t._to_colorized(null,e)},this.to_color=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t._to_colorized(e,_,a,n)},this.to_vignette=function(e,_){t._to_vignette(e,_)},this.to_less_color=function(e){var _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.props.onLoad&&("auto"===e?t.props.onLoad("less_color_auto"):t.props.onLoad("less_color")),t._to_less_color(e,(function(a){t.props.onLoadComplete&&("auto"===e?t.props.onLoadComplete&&t.props.onLoadComplete("less_color_auto",a):t.props.onLoadComplete&&t.props.onLoadComplete("less_color",a)),_(a)}))},this.auto_adjust_contrast=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t._auto_adjust_contrast(e)},this.auto_adjust_saturation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.5;t._auto_adjust_saturation(e)},this.smooth_adjust=function(){t._auto_adjust_smoothness()},this.to_alpha=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#00000000",_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t._to_alpha(t.color_conversion.to_uint32_from_hex(t.color_conversion.format_hex_color(e)),_)},this.to_filter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1997",_=arguments[1];t._to_filter(e,parseFloat(_))},this.to_mirror=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._invert_pixel(e?"HORIZONTAL":"VERTICAL")},this.to_dutone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#ffffffff",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#000000ff";t._to_dutone(e,t.color_conversion.to_uint32_from_hex(t.color_conversion.format_hex_color(_)),t.color_conversion.to_uint32_from_hex(t.color_conversion.format_hex_color(a)))},this._invert_pixel=function(e){var _,a,s,o=t.super_state.get_state(),r=o._s_layers,l=o.pxl_width,h=o.pxl_height,p=o._base64_original_images,c=o._original_image_index,u=o._pxl_indexes_of_selection,d=o._shape_index_a,f=o._select_shape_index_a,m=o._layer_index,g=t.super_state.get_state(),y=g._imported_image_pxls,v=g._imported_image_width,x=g._imported_image_height,w=Array.from(r[m].indexes),b=new i.SetFixed(w.length),M=d,I=f,z=1,C=1;"HORIZONTAL"===e?y.length?(_=new Uint16Array(y.length),y.forEach((function(t,e){var a=e%v;_[(e-a)/v*v+(a=v-1-a)]=t})),y=_):(r[m].indexes.forEach((function(t,e){var _,a=e%l;w[_=(e-a)/l*l+(a=l-1-a)]=t,u.has(e)&&b.add(_),d===e&&(M=_),f===e&&(I=_)})),r[m].set_indexes(w),z=-1):y.length?(a=new Uint16Array(y.length),y.forEach((function(t,e){var _=e%v,n=(e-_)/v;a[(n=x-1-n)*v+_]=t})),y=a):(r[m].indexes.forEach((function(t,e){var _,a=e%l,n=(e-a)/l;w[_=(n=h-1-n)*l+a]=t,u.has(e)&&b.add(_),d===e&&(M=_),f===e&&(I=_)})),C=-1,r[m].set_indexes(w)),void 0===p[c]||0!==m||y.length?t.super_state.set_state({_shape_index_a:M,_select_shape_index_a:I,_pxl_indexes_of_selection:b,_s_layers:r,_last_action_timestamp:Date.now(),_imported_image_pxls:y}).then((function(){return t.super_master_meta.update_canvas()})):((s=new Image).onload=function(){var e,_=t._get_new_ctx_from_canvas(s.naturalWidth,s.naturalHeight),a=n(_,2),i=a[0],o=a[1];i.save(),i.scale(z,C),i.drawImage(s,0,0,s.naturalWidth*z,s.naturalHeight*C),i.restore(),e=s.src.includes("image/png")?o.toDataURL("image/png"):o.toDataURL("image/jpeg"),p.includes(e)||(p.push(e),c++),t.super_state.set_state({_shape_index_a:M,_select_shape_index_a:I,_pxl_indexes_of_selection:b,_s_layers:r,_base64_original_images:p,_original_image_index:c,_imported_image_pxls:y,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},s.src=p[c])},this._get_darkest_color=function(e){var _=t.color_conversion.to_rgba_from_hex(e[0]);return e.forEach((function(e){var a=t.color_conversion.to_rgba_from_hex(e);a[0]+a[1]+a[2]<_[0]+_[1]+_[2]&&(_=a)})),t.color_conversion.to_hex_from_rgba(Uint8ClampedArray.of(_[0],_[1],_[2],255))},this._to_alpha=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=t.super_state.get_state(),s=a._s_layers,i=a._layer_index,o=t._pxl_colors_to_alpha(s[i].indexes,s[i].colors,e,_),r=n(o,2),l=r[0],h=r[1];s[i].set_colors_and_indexes(h,l),t.super_state.set_state({_layer_index:i,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._to_less_color=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=t.super_state.get_state()._layer_index,s=t.super_state.get_state()._s_layers,i=s[a].colors.length;t._remove_close_pxl_colors(s[a].image_data,e).then((function(e){var o,r,l=n(e,2),h=l[0],p=l[1];s[a].set_colors_and_indexes(p,h),o=s[a].colors.length,r={colors_removed:i-o,colors_remaining:o},t.super_state.set_state({_s_layers:s,_last_action_timestamp:Date.now()}).then((function(){t.super_master_meta.update_canvas(!0),_(r)}))}))},this._auto_adjust_contrast=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=t.super_state.get_state(),a=_._layer_index,n=_._s_layers,s=n[a]||{},i=t._pxl_adjust_contrast(s.indexes_copy,s.colors_copy,e);n[a].set_colors_and_indexes(i[1],i[0]),t.super_state.set_state({_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._auto_adjust_saturation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=t.super_state.get_state(),a=_._s_layers,n=_._layer_index,s=a[n]||{},i=t._pxl_adjust_saturation(s.indexes_copy,s.colors_copy,e);a[n].set_colors_and_indexes(i[1],i[0]),t.super_state.set_state({_s_layers:a,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._pxl_adjust_saturation=function(t,e,_){var a,n,s,i,o,r,l,h,p,c=100,u=0;for(_=0|Math.round(255*parseFloat(_)),a=0,n=void 0,i=(s=new F.Colors(e)).length,o=void 0,r=0;(0|r)<(0|i);r=(r+1|0)>>>0)a=(n=s.get_element(r)).hsla[1],(0|n.a)>0&&((0|a)>(0|u)&&(u=0|a),(0|a)<(0|c)&&(c=0|a));for(h=-c*(l=100/Math.max(1,u-c))|0,p=0;(0|p)<(0|i);p=(p+1|0)>>>0)o=(n=s.get_element(p)).hsla,n.blend_with(F.Color.new_hsla(o[0],o[1]*l+h|0,o[2],o[3]),_,!1,!1);return[t,e=s.slice_uint32(0,i),l,h]},this._selection_pxl_adjust_sat_lum=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=t.super_state.get_state(),s=a._layer_index,i=a._s_layers,o=a._pxl_indexes_of_selection,r=i[s].indexes,l=Array.from(i[s].colors);o.forEach((function(a){var s=l[r[a]],i=t.color_conversion.to_hsla_from_rgba(t.color_conversion.to_rgba_from_uint32(s)),o=n(i,4),h=o[0],p=o[1],c=o[2],u=o[3],d=Math.min(100,Math.max(0,p+e)),f=Math.min(100,Math.max(0,c+_)),m=t.color_conversion.to_uint32_from_rgba(t.color_conversion.to_rgba_from_hsla(Array.of(h,d,f,u)));-1===l.indexOf(m)&&l.push(m),r[a]=l.indexOf(m)})),i[s].set_colors_and_indexes(l,r),t.super_state.set_state({_s_layers:i})},this._auto_adjust_smoothness=function(){var e=t.super_state.get_state(),_=e._layer_index,a=e._s_layers,n=e.pxl_width,s=e.pxl_height,i=t._pxl_adjust_smoothness(a[_].indexes,a[_].colors,n,s);a[_].set_colors_and_indexes(i[1],i[0]),t.super_state.set_state({_s_layers:a,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._pxl_to_vignette=function(e,_,a,s,i){var o,r=t.super_state.get_state().pxl_current_color_uint32,l=t.super_state.get_state(),h=l.pxl_width,p=l.pxl_height,c=t._get_new_ctx_from_canvas(h,p),u=n(c,2),d=u[0],f=(u[1],Math.max(h,p)),m=t.color_conversion.invert_uint32(r),g=d.createRadialGradient(h/2,p/2,0,h/2,p/2,f/2);g.addColorStop(1,t.color_conversion.to_hex_from_uint32(r)),g.addColorStop(.8,t.color_conversion.to_hex_from_uint32(t.color_conversion.blend_colors(r,m,.6))),g.addColorStop(0,t.color_conversion.to_hex_from_uint32(m)),d.fillStyle=g,d.fillRect(0,0,h,p),o=d.getImageData(0,0,h,p),t._remove_close_pxl_colors(o,18).then((function(a){var o,l,h,p,c,u,d=n(a,2),f=d[0],g=d[1],y=t._pxl_colors_to_alpha(f,g,m,1),v=n(y,2);f=v[0],g=v[1],o=t.color_conversion.to_rgba_from_uint32(r),l=n(o,3),h=l[0],p=l[1],c=l[2],g=g.map((function(e){e|=0;var _=t.color_conversion.to_rgba_from_uint32(e)[3];return 0|t.color_conversion.to_uint32_from_rgba(Uint8ClampedArray.of(h,p,c,_))})),u=[],f=f.map((function(a,n){var i,o,r;return n|=0,i=0|g[a|=0],o=0|_[e[n]],r=t.color_conversion.blend_colors(o,i,s,!1,!1),-1===u.indexOf(r)&&u.push(r),u.indexOf(r)})),i(Array.of(f,g=u))}))},this._to_vignette=function(e,_){var a,n,s,i;_>0&&(a=t.super_state.get_state(),n=a._layer_index,s=t.super_state.get_state(),i=s._s_layers,t._pxl_to_vignette(i[n].indexes,i[n].colors,e,_,(function(e){i[n].set_colors_and_indexes(e[1],e[0]),t.super_state.set_state({_s_layers:i,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))})))},this._to_colorized=function(){var e,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=t.super_state.get_state(),r=o._s_layers,l=o._layer_index;a=null===a?1:a,e=r[l].colors.map((function(e){var o,r,l,h,p,c,u=t.color_conversion.to_rgba_from_uint32(e),d=n(u,4),f=d[0],m=d[1],g=d[2],y=d[3],v=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(f,m,g,y)),x=n(v,4),w=(x[0],x[1]),b=x[2],M=x[3],I=[s,i,a],z=[w,b,M/100],C=[];return 0!==a?(C[2]=1-(1-I[2])*(1-z[2]),C[0]=Math.round(I[0]*I[2]/C[2]+Math.round(z[0]*z[2]*(1-I[2])/C[2])),C[1]=Math.round(I[1]*I[2]/C[2]+Math.round(z[1]*z[2]*(1-I[2])/C[2]))):C=[w,b],o=t.color_conversion.to_rgba_from_hsla(Array.of(_,C[0],C[1],100*C[2])),l=(r=n(o,4))[0],h=r[1],p=r[2],c=r[3],0===y?0:t.color_conversion.to_uint32_from_rgba(Uint8ClampedArray.of(l,h,p,c))})),r[l].set_colors(e),t.super_state.set_state({_s_layers:r,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this.get_filter_names=function(){return t.filters.names},this._dutone_pixels=function(e,_,a,n,s){return s=s.map((function(n){var s=t.color_conversion.to_hsla_from_rgba(t.color_conversion.to_rgba_from_uint32(n))[2];return t.color_conversion.blend_colors(_,a,parseFloat(s/100)/e,!1,!1)})),t.color_conversion.clean_duplicate_colors(n,s)},this._to_dutone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#ffffffff",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#000000ff",n=t.super_state.get_state(),s=n._layer_index,i=n._s_layers,o=t._dutone_pixels(e,_,a,i[s].indexes,i[s].colors);i[s].set_indexes(o[0]),i[s].set_colors(o[1]),t.super_state.set_state({_s_layers:i,_pxls_hovered:-1,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._to_filter=function(e,_){var a=t.super_state.get_state(),n=a._s_layers,s=a._layer_index;t.filters.use(e,n[s],_),t.super_state.set_state({_s_layers:n,_pxls_hovered:-1,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._to_rotation=function(){var e,_,a,s,o,r,l=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],h=t.super_state.get_state(),p=h._imported_image_pxls,c=h._imported_image_width,u=h._imported_image_height,d=h.pxl_width,f=h.pxl_height,m=h._s_layers,g=h._pxl_indexes_of_selection,y=h._select_shape_index_a,v=h._shape_index_a,x=h._base64_original_images,w=h._original_image_index,b=(h._layer_index,u),M=c,I=new Uint16Array(b*M),z=f,C=d,A=new i.SetFixed(z*C),S=y,j=v,E=0,D=0,L=0;if(p.length)p.forEach((function(t,e){D=(e-(E=e%c))/c,I[L=(l?b-1-D:D)+(l?E:M-1-E)*b]=t,g.has(e)&&A.add(L)}));else{for(e=0,_=m[0].indexes.length;e<_;e++)D=(e-(E=e%d))/d,L=(l?z-1-D:D)+(l?E:C-1-E)*z,g.has(e)&&A.add(L),y===e&&(S=L),v===e&&(j=L);for(a=function(t){var e=new Uint16Array(z*C);m[t].indexes.forEach((function(t,_){D=(_-(E=_%d))/d,e[L=(l?z-1-D:D)+(l?E:C-1-E)*z]=t})),m[t].set_indexes(e)},s=0;s2&&void 0!==arguments[2]?arguments[2]:1,c=255,u=0;for(p=0|Math.round(255*parseFloat(p)),_=0,a=new F.Color(new ArrayBuffer(4)),n=(0,F.Colors)(e),s=F.simdops.clamp_int,i=n.length,o=0;(0|o)<(0|i);o=(o+1|0)>>>0)_=(a=n.get_element(0|o,a)).sum_rgb()/3*a.a/255|0,(0|a.a)>0&&((0|_)>(0|u)&&(u=0|_),(0|_)<(0|c)&&(c=0|_));for(l=-c*(r=255/Math.max(1,u-c))|0,h=0;(0|h)<(0|i);h=(h+1|0)>>>0)(a=n.get_element(0|h,a)).blend_with(F.Color.new_of(s(a.r*r+l|0,0,255),s(a.g*r+l|0,0,255),s(a.b*r+l|0,0,255),a.a),p,!1,!1);return[t,e=n.subarray_uint32(0,i),r,l]},this._pxl_adjust_smoothness=function(e,_,a,s,i){a|=0,s|=0,i=i||1;for(var o=0;oa*s?-1:v)-1,l=-1===v||-1===x?-1:l,h=v+1,h=-1===v||-1===y?-1:h,p=[i[g],i[y],i[v],i[x],i[o],i[r],i[l],i[h]],c=[],p.forEach((function(t){c[t]=void 0===c[t]?1:c[t]+1})),u=-1,d=-1,Object.entries(c).forEach((function(t){var e=n(t,2),_=e[0],a=e[1];d=6&&-1!==u||d+m>=8&&d>=5&&F.Color.new_uint32(_[i[e]]).match_with(F.Color.new_uint32(_[u]).blend_with(F.Color.new_uint32(_[f]),128,!1,!1),24))&&(i[e]=u)}));return t.color_conversion.clean_duplicate_colors(e,_)},this._set_ripple_ref=function(e){null!==e&&null===t._ripple&&(t._ripple=e)},this._remove_close_pxl_colors=function(t,e){return new Promise((function(_,a){(0,y.QuantiMatGlobal)(t,e).then((function(t){var e=t[1],a=t[2];return _([e,a])}))}))},this._request_force_update=function(e,_){return e=void 0===e||e,_=void 0===_||_,t.sraf.run_frame((function(){return new Promise((function(e,_){t.forceUpdate(e)}))}),!e,!_,Date.now(),"inner_pixel_page").catch((function(){return t._request_force_update(e,_)}))},this._update_canvas_container_size=function(){var e,_,a,n,s=t.super_state.get_state()._canvas_container?t.super_state.get_state()._canvas_container.getBoundingClientRect():null;s?(e=s.width||0,_=s.height||0,a=s.left||0,n=s.top||0,t.canvas_pos.set_canvas_container(n,a,_,e)):setTimeout((function(){t._update_canvas_container_size()}),50)}},e.default=G},927:function(t,e,_){e.UINT32=_(928),e.UINT64=_(929)},928:function(t,e,_){var a;!function(e){function _(t,e){return this instanceof _?(this._low=0,this._high=0,this.remainder=null,void 0===e?s.call(this,t):"string"==typeof t?i.call(this,t,e):void n.call(this,t,e)):new _(t,e)}function n(t,e){return this._low=0|t,this._high=0|e,this}function s(t){return this._low=65535&t,this._high=t>>>16,this}function i(t,e){var _=parseInt(t,e||10);return this._low=65535&_,this._high=_>>>16,this}_(60466176),_(268435456),_(1e9),_(1073741824),_(36),_(16),_(10),_(2),_.prototype.fromBits=n,_.prototype.fromNumber=s,_.prototype.fromString=i,_.prototype.toNumber=function(){return 65536*this._high+this._low},_.prototype.toString=function(t){return this.toNumber().toString(t||10)},_.prototype.add=function(t){var e=this._low+t._low,_=e>>>16;return _+=this._high+t._high,this._low=65535&e,this._high=65535&_,this},_.prototype.subtract=function(t){return this.add(t.clone().negate())},_.prototype.multiply=function(t){var e=this._high,_=this._low,a=t._high,n=t._low,s=_*n,i=s>>>16;return i+=e*n,i&=65535,i+=_*a,this._low=65535&s,this._high=65535&i,this},_.prototype.div=function(t){var e,a;if(0==t._low&&0==t._high)throw Error("division by zero");if(0==t._high&&1==t._low)return this.remainder=new _(0),this;if(t.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(t))return this.remainder=new _(0),this._low=1,this._high=0,this;for(e=t.clone(),a=-1;!this.lt(e);)e.shiftLeft(1,!0),a++;for(this.remainder=this.clone(),this._low=0,this._high=0;a>=0;a--)e.shiftRight(1),this.remainder.lt(e)||(this.remainder.subtract(e),a>=16?this._high|=1<>>16)&65535,this},_.prototype.equals=_.prototype.eq=function(t){return this._low==t._low&&this._high==t._high},_.prototype.greaterThan=_.prototype.gt=function(t){return this._high>t._high||!(this._hight._low},_.prototype.lessThan=_.prototype.lt=function(t){return this._hight._high)&&this._low16?(this._low=this._high>>t-16,this._high=0):16==t?(this._low=this._high,this._high=0):(this._low=this._low>>t|this._high<<16-t&65535,this._high>>=t),this},_.prototype.shiftLeft=_.prototype.shiftl=function(t,e){return t>16?(this._high=this._low<>16-t,this._low=this._low<>>32-t,this._low=65535&e,this._high=e>>>16,this},_.prototype.rotateRight=_.prototype.rotr=function(t){var e=this._high<<16|this._low;return e=e>>>t|e<<32-t,this._low=65535&e,this._high=e>>>16,this},_.prototype.clone=function(){return new _(this._low,this._high)},void 0===(a=_)||(t.exports=a)}()},929:function(t,e,_){var a;!function(e){function _(t,e,a,o){return this instanceof _?(this.remainder=null,"string"==typeof t?i.call(this,t,e):void 0===e?s.call(this,t):void n.apply(this,arguments)):new _(t,e,a,o)}function n(t,e,_,a){return void 0===_?(this._a00=65535&t,this._a16=t>>>16,this._a32=65535&e,this._a48=e>>>16,this):(this._a00=0|t,this._a16=0|e,this._a32=0|_,this._a48=0|a,this)}function s(t){return this._a00=65535&t,this._a16=t>>>16,this._a32=0,this._a48=0,this}function i(t,e){var a,n,s,i,r;for(e=e||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0,a=o[e]||new _(Math.pow(e,5)),n=0,s=t.length;n=0&&(a.div(e),n[s]=a.remainder.toNumber().toString(t),a.gt(e));s--);return n[s-1]=a.toNumber().toString(t),n.join("")},_.prototype.add=function(t){var e,_,a=this._a00+t._a00,n=a>>>16;return e=(n+=this._a16+t._a16)>>>16,_=(e+=this._a32+t._a32)>>>16,_+=this._a48+t._a48,this._a00=65535&a,this._a16=65535&n,this._a32=65535&e,this._a48=65535&_,this},_.prototype.subtract=function(t){return this.add(t.clone().negate())},_.prototype.multiply=function(t){var e,_,a=this._a00,n=this._a16,s=this._a32,i=this._a48,o=t._a00,r=t._a16,l=t._a32,h=a*o,p=h>>>16;return e=(p+=a*r)>>>16,p&=65535,e+=(p+=n*o)>>>16,_=(e+=a*l)>>>16,e&=65535,_+=(e+=n*r)>>>16,e&=65535,_+=(e+=s*o)>>>16,_+=a*t._a48,_&=65535,_+=n*l,_&=65535,_+=s*r,_&=65535,_+=i*o,this._a00=65535&h,this._a16=65535&p,this._a32=65535&e,this._a48=65535&_,this},_.prototype.div=function(t){var e,a;if(0==t._a16&&0==t._a32&&0==t._a48){if(0==t._a00)throw Error("division by zero");if(1==t._a00)return this.remainder=new _(0),this}if(t.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(t))return this.remainder=new _(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(e=t.clone(),a=-1;!this.lt(e);)e.shiftLeft(1,!0),a++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;a>=0;a--)e.shiftRight(1),this.remainder.lt(e)||(this.remainder.subtract(e),a>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&t,t=(65535&~this._a32)+(t>>>16),this._a32=65535&t,this._a48=~this._a48+(t>>>16)&65535,this},_.prototype.equals=_.prototype.eq=function(t){return this._a48==t._a48&&this._a00==t._a00&&this._a32==t._a32&&this._a16==t._a16},_.prototype.greaterThan=_.prototype.gt=function(t){return this._a48>t._a48||!(this._a48t._a32||!(this._a32t._a16||!(this._a16t._a00))},_.prototype.lessThan=_.prototype.lt=function(t){return this._a48t._a48)&&(this._a32t._a32)&&(this._a16t._a16)&&this._a00=48?(this._a00=this._a48>>t-48,this._a16=0,this._a32=0,this._a48=0):t>=32?(t-=32,this._a00=65535&(this._a32>>t|this._a48<<16-t),this._a16=this._a48>>t&65535,this._a32=0,this._a48=0):t>=16?(t-=16,this._a00=65535&(this._a16>>t|this._a32<<16-t),this._a16=65535&(this._a32>>t|this._a48<<16-t),this._a32=this._a48>>t&65535,this._a48=0):(this._a00=65535&(this._a00>>t|this._a16<<16-t),this._a16=65535&(this._a16>>t|this._a32<<16-t),this._a32=65535&(this._a32>>t|this._a48<<16-t),this._a48=this._a48>>t&65535),this},_.prototype.shiftLeft=_.prototype.shiftl=function(t,e){return(t%=64)>=48?(this._a48=this._a00<=32?(t-=32,this._a48=this._a16<>16-t,this._a32=this._a00<=16?(t-=16,this._a48=this._a32<>16-t,this._a32=65535&(this._a16<>16-t),this._a16=this._a00<>16-t,this._a32=65535&(this._a32<>16-t),this._a16=65535&(this._a16<>16-t),this._a00=this._a00<=32){if(e=this._a00,this._a00=this._a32,this._a32=e,e=this._a48,this._a48=this._a16,this._a16=e,32==t)return this;t-=32}return n=(_=this._a48<<16|this._a32)<>>32-t,s=a<>>32-t,this._a00=65535&s,this._a16=s>>>16,this._a32=65535&n,this._a48=n>>>16,this},_.prototype.rotateRight=_.prototype.rotr=function(t){var e,_,a,n,s;if(0==(t%=64))return this;if(t>=32){if(e=this._a00,this._a00=this._a32,this._a32=e,e=this._a48,this._a48=this._a16,this._a16=e,32==t)return this;t-=32}return n=(_=this._a48<<16|this._a32)>>>t|(a=this._a16<<16|this._a00)<<32-t,s=a>>>t|_<<32-t,this._a00=65535&s,this._a16=s>>>16,this._a32=65535&n,this._a48=n>>>16,this},_.prototype.clone=function(){return new _(this._a00,this._a16,this._a32,this._a48)},void 0===(a=_)||(t.exports=a)}()},933:function(t,e,_){"use strict";var a=_(934),n=Set.prototype;t.exports={Set:Set,add:a(n.add),has:a(n.has),remove:a(n.delete),proto:n}},934:function(t,e,_){"use strict";var a=_(935),n=Function.prototype,s=n.call,i=a&&n.bind.bind(s,s);t.exports=a?i:function(t){return function(){return s.apply(t,arguments)}}},935:function(t,e,_){"use strict";var a=_(936);t.exports=!a((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},936:function(t,e,_){"use strict";t.exports=function(t){try{return!!t()}catch(e){return!0}}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{716:function(t,e,_){"use strict";async function a(){function t(t,e){if(o.buffer.byteLength(m.set(o),i(s(0)))}}function _(t){return t>>>0}function a(t){return t&g}function s(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t(3*e.length,0),_(r(0,y.encodeInto(e,m).written,a))}function i(e){let _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0n;return t(3*e.length,0),a(l(0,y.encodeInto(e,m).written,_))}const{instance:{exports:{mem:o,xxh32:r,xxh64:l,init32:h,update32:p,digest32:c,init64:u,update64:d,digest64:f}}}=await WebAssembly.instantiate(n);let m=new Uint8Array(o.buffer);const g=2n**64n-1n,y=new TextEncoder;return{h32:s,h32ToString(t){return s(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0).toString(16).padStart(8,"0")},h32Raw(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t(e.byteLength,0),m.set(e),_(r(0,e.byteLength,a))},create32(){return e(48,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,h,p,c,_)},h64:i,h64ToString(t){return i(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0n).toString(16).padStart(16,"0")},h64Raw(e){let _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0n;return t(e.byteLength,0),m.set(e),a(l(0,e.byteLength,_))},create64(){return e(88,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0n,u,d,f,a)}}}_.r(e),_.d(e,"default",(function(){return a}));const n=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,0,96,3,127,127,127,1,127,96,2,127,127,0,96,2,127,126,0,96,1,127,1,127,96,1,127,1,126,96,3,127,127,126,1,126,96,3,126,127,127,1,126,3,11,10,1,1,2,0,4,6,7,3,0,5,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,211,23,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,247,148,175,175,120,106,33,4,32,2,65,177,243,221,241,121,107,33,5,3,64,32,0,40,2,0,65,247,148,175,175,120,108,32,3,106,65,13,119,65,177,243,221,241,121,108,33,3,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,4,106,65,13,119,65,177,243,221,241,121,108,33,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,2,106,65,13,119,65,177,243,221,241,121,108,33,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,5,106,65,13,119,65,177,243,221,241,121,108,33,5,32,0,65,4,106,34,0,32,6,77,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,1,40,2,0,65,189,220,202,149,124,108,32,0,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,1,45,0,0,65,177,207,217,178,1,108,32,0,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,65,15,118,32,0,115,65,247,148,175,175,120,108,34,0,32,0,65,13,118,115,65,189,220,202,149,124,108,34,0,32,0,65,16,118,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,247,148,175,175,120,106,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,177,243,221,241,121,107,54,2,0,11,211,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,5,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,4,32,4,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,5,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,5,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,40,2,0,32,5,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,12,106,34,3,40,2,0,32,5,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,16,106,34,3,40,2,0,32,5,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,20,106,34,3,40,2,0,32,5,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,4,32,0,65,20,106,40,2,0,33,7,3,64,32,1,40,2,0,65,247,148,175,175,120,108,32,2,106,65,13,119,65,177,243,221,241,121,108,33,2,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,3,106,65,13,119,65,177,243,221,241,121,108,33,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,4,106,65,13,119,65,177,243,221,241,121,108,33,4,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,7,106,65,13,119,65,177,243,221,241,121,108,33,7,32,1,65,4,106,34,1,32,8,77,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,4,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,5,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,157,4,2,1,127,3,126,32,0,32,1,106,33,3,32,1,65,32,79,4,126,32,3,65,32,107,33,3,32,2,66,135,149,175,175,152,182,222,155,158,127,124,66,207,214,211,190,210,199,171,217,66,124,33,4,32,2,66,207,214,211,190,210,199,171,217,66,124,33,5,32,2,66,0,124,33,6,32,2,66,135,149,175,175,152,182,222,155,158,127,125,33,2,3,64,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,4,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,5,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,6,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,2,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,0,65,8,106,34,0,32,3,77,13,0,11,32,6,66,12,137,32,2,66,18,137,124,32,5,66,7,137,124,32,4,66,1,137,124,32,4,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,5,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,6,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,2,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,137,2,0,32,1,32,2,106,33,2,3,64,32,1,65,8,106,32,2,77,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,32,0,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,66,33,136,32,0,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,88,0,32,0,65,8,106,32,1,66,135,149,175,175,152,182,222,155,158,127,124,66,207,214,211,190,210,199,171,217,66,124,55,3,0,32,0,65,16,106,32,1,66,207,214,211,190,210,199,171,217,66,124,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,135,149,175,175,152,182,222,155,158,127,125,55,3,0,11,132,5,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,16,106,34,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,24,106,34,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,32,106,34,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,6,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,7,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,8,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,9,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,1,65,8,106,34,1,32,2,77,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,200,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,4,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,1,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,5,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11])},926:function(t,e,_){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}var n,s,i,o,r,l,h,p,c,u,d,f,m,g,y,v,x,w,b,M,I,z,C,A,S,j,E,D,L,k,O,F,U,G,T;Object.defineProperty(e,"__esModule",{value:!0}),n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var _,a,n=[],s=!0,i=!1,o=void 0;try{for(_=t[Symbol.iterator]();!(s=(a=_.next()).done)&&(n.push(a.value),!e||n.length!==e);s=!0);}catch(r){i=!0,o=r}finally{try{!s&&_.return&&_.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},s=function(){function t(t,e){var _,a;for(_=0;_0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.super_state.set_state({_id:Date.now(),pxl_width:parseInt(e),pxl_height:parseInt(_),_pxl_indexes_of_selection:new i.SetFixed(e*_),_base64_original_images:[],_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_json_state_history:{history_position:0,state_history:[]},_s_layers:[o.Layer.new_from_colors_and_indexes(new Uint32Array(1),new Uint16Array(parseInt(e)*parseInt(_)),parseInt(e),parseInt(_),!0)],_layer_index:0,_pxls_hovered:-1,_original_image_index:-1,_last_action_timestamp:Date.now()}).then((function(){t._set_size()}))},this._set_size=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e=e||t.super_state.get_state().pxl_width,_=_||t.super_state.get_state().pxl_height,t.super_state.set_state({pxl_width:e,pxl_height:_}).then((function(){t.canvas_pos.set_sizes(e,_),t.canvas_pos.set_current_scale_default(),t._request_force_update(!1,!1).then((function(){t.super_canvas.setDimensions(e,_).then((function(){t.super_master_meta.update_canvas(!0).catch((function(){t._set_size(e,_)}))})).catch((function(){t.super_master_meta.update_canvas(!0).catch((function(){t._set_size(e,_)}))}))})).catch((function(){t._set_size(e,_)}))}))},this.export_state=function(){t._notify_export_state()},this._notify_export_state=function(){t.props.on_state_export&&t.props.on_state_export(),t.props.on_state_exported&&t.export_JS_state((function(e){t.props.on_state_exported(e)}))},this._maybe_update_selection_highlight=function(){var e=t.super_state.get_state(),_=e.tool,a=e._select_shape_index_a,n=e._selection_pair_highlight;_.toUpperCase().includes("SELECT")&&parseInt(a)<0&&t.super_state.set_state({_selection_pair_highlight:!n}).then((function(){t.super_master_meta.update_canvas(!1,Date.now())}))},this._set_props=function(e){t.componentWillReceiveProps(Object.assign(Object.assign({},t.props),e))},this.zoom_in=function(){t.canvas_pos.set_zoom(1.33)},this.zoom_out=function(){t.canvas_pos.set_zoom(.75)},this.current_layer_up=function(){var e=t.super_state.get_state(),_=e._layers,a=e._layer_index,n=e._s_layers;if(a<_.length-1)return _.splice(a+1,0,_.splice(a,1)[0]),n.splice(a+1,0,n.splice(a,1)[0]),t.super_state.set_state({_layers:_,_layer_index:parseInt(a+1),_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.current_layer_down=function(){var e=t.super_state.get_state(),_=e._layers,a=e._layer_index,n=e._s_layers;if(a>0)return _.splice(a-1,0,_.splice(a,1)[0]),n.splice(a-1,0,n.splice(a,1)[0]),t.super_state.set_state({_layers:_,_s_layers:n,_layer_index:parseInt(a-1),_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.new_layer=function(e){var _=t.super_state.get_state(),a=_.pxl_width,n=_.pxl_height,s=t.super_state.get_state(),i=s._layers,r=s._s_layers;return e=void 0===e?r.length:e,r.splice(e+1,0,o.Layer.new_from_colors_and_indexes(Uint32Array.of(0),new Uint8Array(a*n),a,n,!0)),i.splice(e+1,0,{id:Date.now(),hash:"",name:"Layer "+(e+1),hidden:!1,opacity:1,colors:["#00000000"],number_of_colors:1}),t.super_state.set_state({_layers:i,_s_layers:r,_layer_index:e+1,_last_action_timestamp:Date.now()}).then((function(){return t._maybe_save_state(void 0,!0),t.super_master_meta.update_canvas(!0),Promise.resolve()}))},this.new_layer_from_image=function(e){var _=t.super_state.get_state(),a=_._layers,n=_._s_layers;return(0,y.QuantiMatGlobal)(e,255).then((function(_){var s=_[1],i=_[2];return n.splice(0,0,o.Layer.new_from_colors_and_indexes(i,s,e.width,e.height,!0)),a.splice(0,0,{id:Date.now(),name:"Background",hidden:!1,opacity:1,colors:["#00000000"],number_of_colors:1}),t.super_state.set_state({_layers:a,_s_layers:n,_layer_index:0,_last_action_timestamp:Date.now()}).then((function(){return t._maybe_save_state(void 0,!0),t.super_master_meta.update_canvas(!0),Promise.resolve()}))}))},this.duplicate_layer=function(e){var _=t.super_state.get_state(),a=_._layers,n=_._s_layers,s=_.pxl_width,i=_.pxl_height;return e=void 0===e?n.length:e,n.splice(e+1,0,o.Layer.new_from_colors_and_indexes(n[e].colors_copy,n[e].indexes_copy,s,i,!0)),a.splice(e+1,0,{id:Date.now(),hash:a[e].hash,name:a[e].name+" (copy)",hidden:!!a[e].hidden,opacity:parseFloat(a[e].opacity),colors:Array.from(a[e].colors||[]),number_of_colors:parseInt(a[e].number_of_colors),thumbnail:a[e].thumbnail}),t.super_state.set_state({_layers:a,_layer_index:e+1,_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.delete_layer=function(e){var _=t.super_state.get_state(),a=_._layers,n=_._s_layers,s=_._layer_index;if(a.length>1)return n.splice(e,1),a.splice(e,1),s=(s=e-1)<0?0:s,t.super_state.set_state({_layers:a,_layer_index:s,_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.change_active_layer=function(e){if(t.super_state.get_state()._layers.length>e&&0<=e)return t.super_state.set_state({_layer_index:e,_last_action_timestamp:1/0}).then((function(){return t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0),Promise.resolve()}))},this.toggle_layer_visibility=function(e){var _=Array.from(t.super_state.get_state()._layers);_[parseInt(e)].hidden=!_[parseInt(e)].hidden,t.super_state.set_state({_layers:_,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this.change_layer_opacity=function(e,_){var a=Array.from(t.super_state.get_state()._layers);a[parseInt(e)].opacity=parseFloat(_),t.super_state.set_state({_layers:a,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this.merge_down_layer=function(e){var _,a,s,i,r,l,h,p,c,u,d=t.super_state.get_state(),f=d._layers,m=d._s_layers,g=d.pxl_width,y=d.pxl_height;if(void 0!==f[e]&&void 0!==f[e-1]){for(_=m[e].indexes,a=m[e-1].indexes,s=m[e].colors,i=m[e-1].colors,r=255&Math.round(255*parseFloat(f[e].opacity)),l=255&Math.round(255*parseFloat(f[e-1].opacity)),h=0|_.length,p={id:Date.now(),name:"Merged layers "+e+"+"+(e-1),hidden:!(!f[e].hidden||!f[e-1].hidden),opacity:parseFloat(1)},c=C.default.init(2,h,Uint8Array.of(l,r)),u=0;(0|u)<(0|h);u=(u+1|0)>>>0)c.for(u,0),c.stack(0,i[a[0|u]]),c.stack(1,s[_[0|u]]),c.next();c.blend(!1,!1).then((function(_){var a,s,i,r,l,h=n(_,2),u=h[0],d=h[1],v=new Uint32Array(new ArrayBuffer(y*g*4)),x=0|u.length;for(a=0;F.simdops.int_less(a,x);a=F.simdops.plus_uint(a,1))v[u[a]]=d[0|a];s=new ImageData(new Uint8ClampedArray(v.buffer),g,y),r=(i=t._get_pixels_palette_and_list_from_image_data(s,!0)).new_pxl_colors,l=i.new_pxls,c.clear(),f.splice(e-1,2,p),m.splice(e-1,2,o.Layer.new_from_colors_and_indexes(r,l,g,y,!0)),t.super_state.set_state({_layer_index:e-1,_layers:f,_s_layers:m,_old_pxl_colors:new Uint32Array(m[0].indexes.length),_last_action_timestamp:Date.now()}).then((function(){t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0)}))}))}},this.compute_filters_preview=function(){t._notify_filters_change(1)},this._notify_filters_change=function(){var e,_,a,n,s,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.props.onFiltersThumbnailChange&&(e=t.super_state.get_state(),_=e._processing_filters,a=e._layer_index,n=e._last_filters_hash,s=e._s_layers,i=e._filter_thumbnails,s[a].hash_hex_async().then((function(e){var r,l,h;n===e&&!1!==_||(r=i||new Map,l=0,h=0,t.super_state.set_state({_last_filters_hash:e,_processing_filters:!0}).then((function(){t.filters.names.forEach((function(_,n,i){t.filters.use(_,s[a],o,!0).bitmap_async().then((function(a){h++;var n=r.get(_);void 0!==n&&void 0!==n.destroy&&n.destroy(),r.set(_,a),l=Math.round(h/i.length*100).toString(),t.props.onFiltersThumbnailChange(r,e,l),r.size===i.length&&t.super_state.set_state({_filter_thumbnails:r,_processing_filters:!1})}))}))})))})))},this.get_pixel_color_from_pos=function(e,_){return t.super_master_meta.get_pixel_color_from_pos(e,_)},this.get_layer_bitmap_image=function(e,_,a,n,s){t.bmp_layer.render(e,_,a,n,s)},this.set_png_compressors=function(e,_){t.png_quant=e||t.png_quant,t.oxi_png=_||t.oxi_png},this.get_base64_png_data_url=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:35;return t._get_base64_png_data_url(e,_,a,n,s)},this._get_base64_png_data_url=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:35,i=t.super_state.get_state(),o=i.pxl_width,r=i.pxl_height,l=i._s_layers,h=i._layers;return new Promise((function(i,p){f.default.from(u.default,parseInt(o),parseInt(r),l.map((function(t){return t.indexes})),l.map((function(t){return t.colors})),h,parseInt(e),!0).render().then((function(o){o.colors.length>256?i(o):"function"==typeof t.png_quant&&0!==a?t.png_quant(""+o.url,n,s,a,u.default).then((function(t){o.url=t,i(o)})).catch((function(o){t.props.set_compressor().then((function(){t._get_base64_png_data_url(e,_,a,n,s).then(i).catch(p)}))})):t.props.set_compressor().then((function(){t._get_base64_png_data_url(e,_,a,n,s).then(i).catch(p)}))})).catch((function(t){p(t)}))}))},this._get_pixels_palette_and_list_from_image_data=function(e){var _,a,n,s,i,o,r,l,h,p,c,u,d=arguments.length>1&&void 0!==arguments[1]&&arguments[1],f=t.super_state.get_state(),m=f.max_size,g=f._lazy_lazy_compute_time_ms,y=(f.pxl_width,f.pxl_height,e.data.length/4>m*m),v=[],x=new Set,w=void 0;if(!y||d)for(w=new Uint16Array(e.width*e.height).fill(0),_=0;_>>0)?v.indexOf((0|a)>>>0):-1)&&(n=(v.push((0|a)>>>0)-1|0)>>>0,x.add((0|a)>>>0)),w[_/4|0]=(0|n)>>>0;else for(s=Date.now(),w=new Uint16Array(e.width*(m+1)).fill(0),i=0,o=0;o<=m&&!(s+g2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"high",s=document.createElement("canvas");return s.width=t,s.height=e,_=s.getContext("2d"),a?(_.mozImageSmoothingEnabled=!1,_.webkitImageSmoothingEnabled=!1,_.msImageSmoothingEnabled=!1,_.imageSmoothingEnabled=!1):n.length&&(_.imageSmoothingQuality=n),[_,s]},this.copy_selection=function(){t.import_image_on_canvas_from_selection()},this.cut_selection=function(){t.import_image_on_canvas_from_selection(),t.erase_selection(),t.to_selection_none()},this.erase_selection=function(){var e=t.super_state.get_state(),_=e._s_layers,a=e._layer_index,n=e._pxl_indexes_of_selection,s=(e.pxl_width,e.pxl_height,Array.from(_[a].colors));n.size>0&&(s.includes(0)||(s.push(0),_[a].set_colors(s)),n.forEach((function(t){_[a].set_uint32(t,0)})),t.super_state.set_state({_s_layers:_,_last_action_timestamp:Date.now()}).then((function(){t.super_master_meta.update_canvas()})))},this.import_image_on_canvas_from_selection=function(){var e,_,a,s,i,o,r,l,h,p,c,u,d,f=t.super_state.get_state(),m=f._s_layers,g=f._layer_index,y=f._pxl_indexes_of_selection,v=f.pxl_width,x=f.pxl_height;if(y.size>0){for(e=[v,x],_=[-1,-1],y.forEach((function(t){var a=t%v,n=(t-a)/v;a_[0]&&(_[0]=a),n>_[1]&&(_[1]=n)})),a=1+_[0]-e[0],s=1+_[1]-e[1],i=m[g].indexes,o=new Uint16Array(a*s),r=Array.from(m[g].colors),l=0;l0&&void 0!==arguments[0]?arguments[0]:null,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.props.onLoad&&t.props.onLoad("image_load"),a.id?t.super_state.set_state({_id:Date.now(),pxl_width:parseInt(a.width),pxl_height:parseInt(a.height),_pxl_indexes_of_selection:new i.SetFixed(a.width*a.height),_base64_original_images:[_],_s_layers:[o.Layer.new_from_colors_and_indexes(a.pxl_colors,a.pxls,parseInt(a.width),parseInt(a.height),!0)],_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_layer_index:0,_pxls_hovered:-1,_original_image_index:0,_last_action_timestamp:Date.now(),_json_state_history:{history_position:0,state_history:[]}}).then((function(){t._set_size(),t._notify_image_load_complete(),t._notify_export_state()})):setTimeout((function(){var a,r,l,h,p,c,u,d,f,m,g,y,v,x,w,b,M,I,z,C,A,S,j,E,D,L,k,O,F,U,G,T,N,P,H,R,B,W,Y,q,Z,Q,V,J,X,K,$,tt,et,_t=t.super_state.get_state(),at=_t.default_size,nt=_t.max_size,st=_t.ideal_size,it=_t._base64_original_images,ot=_t.dont_change_img_size_onload,rt=_t.dont_compute_base64_original_image,lt=e.naturalWidth,ht=e.naturalHeight,pt=t._get_new_ctx_from_canvas(lt,ht,!0),ct=n(pt,2),ut=ct[0],dt=ct[1];if(ut.drawImage(e,0,0,lt,ht),a=ut.getImageData(0,0,lt,ht),r=rt?"":_.length>0?_:dt.toDataURL("image/jpeg"),ut=null,dt=null,l=!1,h=1,!1===ot){if(c=(p=t._get_pixels_palette_and_list_from_image_data(a,!0)).new_pxls,u=p.new_pxl_colors,a=null,d=c.length/u.length,!(f=nt*nt>ht*lt)){if(m=1/0,y=0,v=-1,(g=[])[1]=0,c.forEach((function(t,e){v===t||0===e?y++:(y32||(_=i>32?1:42/(i+10),a=i>32?0:(i>32?1:_*M)*Math.pow(i,1-1/_+1),1!==i&&wg[1]?b:1,z=I,g[1]g[1]&&(z=C,f=!0);break}C++}if(A=z,Object.entries(g).forEach((function(t,e){var _=n(t,2),a=_[0],s=_[1];a=parseInt(a),e>1&&s>g[A]&&a16*Math.sqrt(j=ht*h*(lt*h))&&j<=at*at*4||d>9*Math.sqrt(j)&&j<=at*at*3||d>4*Math.sqrt(j)&&j<=at*at*2||d>1*Math.sqrt(j)&&j<=at*at*1,D=j>u.length,(E||f)&&jat*at&&(lt*=h,ht*=h,l=!0);else{for(L=1;Math.round(lt*L)*Math.round(ht*L)>at*at;)L-=.01;lt*=L,ht*=L}}k=void 0,O=null,l&&!1===ot?(N=(G=ht/h)-G%(F=1/h),P=Math.floor((T=(U=lt/h)-U%F)/F),H=Math.floor(N/F),R=T,B=N,W=Math.floor((U-T)/2),Y=Math.floor((G-N)/2),lt=Math.floor(P),ht=Math.floor(H),q=t._get_new_ctx_from_canvas(lt,ht,!0),k=(Z=n(q,2))[0],Z[1],k.drawImage(e,W,Y,R,B,0,0,lt,ht),O=k.getImageData(0,0,lt,ht)):!1===ot?(lt=Math.floor(lt),ht=Math.floor(ht),Q=t._get_new_ctx_from_canvas(lt,ht,!0),k=(V=n(Q,2))[0],V[1],k.drawImage(e,0,0,lt,ht),O=k.getImageData(0,0,lt,ht)):O=a,J=t._get_pixels_palette_and_list_from_image_data(O,!0),k=null,a=null,O=null,(X=it).includes(r)||X.push(r),K=t.color_conversion.clean_duplicate_colors(J.new_pxls,J.new_pxl_colors),tt=($=n(K,2))[0],et=$[1],t.super_state.set_state({_id:Date.now(),pxl_width:parseInt(lt),pxl_height:parseInt(ht),_pxl_indexes_of_selection:new i.SetFixed(lt*ht),_base64_original_images:X,_layers:[{id:Date.now(),name:"Layer 0",hidden:!1,opacity:1}],_json_state_history:{history_position:0,state_history:[]},_s_layers:[o.Layer.new_from_colors_and_indexes(et,tt,parseInt(lt),parseInt(ht),!0)],_layer_index:0,_pxls_hovered:-1,_original_image_index:X.indexOf(r),_last_action_timestamp:Date.now()}).then((function(){t._set_size(),t._notify_image_load_complete(),t._notify_export_state()}))}),50)},this._set_canvas_ref=function(e){if(void 0===e)return t._set_size();if(null===e)return t._set_size();if(void 0===e.width)return t._set_size();if(null===e.width)return t._set_size();var _=t.super_state.get_state(),a=_.pxl_width,n=_.pxl_height;t.super_canvas.new(e,a,n).then((function(){t.super_master_meta.update_canvas(!0),t._maybe_save_state(void 0,!0)}))},this._set_canvas_container_ref=function(e){null!==e&&t.super_state.set_state({_canvas_container:e}).then((function(){t._update_canvas_container_size()}))},this._set_canvas_wrapper_ref=function(e){null!==e&&t.super_state.set_state({_canvas_wrapper:e})},this._set_canvas_wrapper_overflow_ref=function(e){null!==e&&(e.addEventListener("wheel",t._canvas_pos_handle_wheel,{passive:!1}),e.addEventListener("pointerdown",t._canvas_pos_handle_pointer_down,{passive:!1}),e.addEventListener("pointermove",t._canvas_pos_handle_pointer_move,{passive:!1}),e.addEventListener("pointerup",t._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointercancel",t._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerout",t._canvas_pos_handle_pointer_up,{passive:!1}),e.addEventListener("pointerleave",t._canvas_pos_handle_pointer_up,{passive:!1}),t.super_state.set_state({_canvas_wrapper_overflow:e}))},this._super_master_meta_handle_canvas_mouse_move=function(e){t.super_master_meta._handle_canvas_mouse_move(e)},this._super_master_meta_handle_canvas_mouse_up=function(e){t.super_master_meta._handle_canvas_mouse_up(e)},this._super_master_meta_handle_canvas_mouse_down=function(e){t.super_master_meta._handle_canvas_mouse_down(e)},this._function_ripple=function(e){t._ripple.start(e),setTimeout((function(){t._ripple.stop(e)}),75)},this._canvas_pos_handle_wheel=function(e){t.canvas_pos.handle_wheel(e)},this._canvas_pos_handle_pointer_down=function(e){t.canvas_pos.handle_pointer_down(e)},this._canvas_pos_handle_pointer_move=function(e){t.canvas_pos.handle_pointer_move(e)},this._canvas_pos_handle_pointer_up=function(e){t.canvas_pos.handle_pointer_up(e)},this.write_text=function(e,_){var a,n=t.super_state.get_state()._layer_index;t.new_layer(n),t.change_active_layer(n+1),a=(new t.super_state.create_shape).from_text(e,_),t.super_state.paint_shape(a,t.super_state.get_state().pxl_current_color_uint32)},this._match_color=function(e,_,a){var s,i,o,r,l,h,p,c,u,d,f,m,g,y,v,x,w,b;return 1===(a=void 0===a?null:a)||(0===a?e===_:(s=Math.round(255*a),i=t.color_conversion.to_rgba_from_uint32(e),r=(o=n(i,4))[0],l=o[1],h=o[2],p=o[3],c=t.color_conversion.to_rgba_from_uint32(_),d=(u=n(c,4))[0],f=u[1],m=u[2],g=u[3],y=Math.abs(p-g),v=Math.abs(r-d),x=Math.abs(l-f),w=Math.abs(h-m),b=Math.abs(1-y/255),null!==a?!!(vt.super_state.get_state()._layers_defined_at),r=Object.assign({},e);r._layers=Array.from(e._layers.map((function(t){return{id:0|t.id,hash:t.hash+"",name:t.name+"",hidden:t.hidden&&!0,opacity:parseFloat(t.opacity),colors:Array.from(t.colors),number_of_colors:0|t.number_of_colors}}))),s&&o&&i?t.super_state.set_state({_layer_index:parseInt(e._layer_index),_layers:Array.from(e._layers),_layers_defined_at:a}).then((function(){t.props.onLayersChange&&t.props.onLayersChange(t.super_state.get_state()._layer_index,Array.from(e._layers)),null!==_&&_(t.super_state.get_state()._layers,t.super_state.get_state()._layer_index,s,r)})):(t.props.onLayersChange&&t.props.onLayersChange(t.super_state.get_state()._layer_index,Array.from(e._layers)),(s||n)&&i?null!==_&&_(t.super_state.get_state()._layers,t.super_state.get_state()._layer_index,s,r):null!==_&&_(t.super_state.get_state()._layers,t.super_state.get_state()._layer_index,s,{}))},this._get_most_used_color_sorted=function(t,e,_){var a,n,s,i;for(_=Math.min(e.length,_||256),a=new F.Colors(new F.Colors(e.buffer).get_deduplicated_sorted_uint32a(_).buffer),n=new F.Color(new ArrayBuffer(4)),s=Array(_),i=0;i<_;i++)s[i]=a.get_use_element(i,n).hex;return s},this._notify_layers_and_compute_thumbnails_change=function(e,_,a,n){var s,i,o,r,l,h,p,c,u;for(n=n||Date.now(),s=0,i=parseInt(e._timestamp)||Date.now(),o=parseInt(_._timestamp),r=_._layers.length,l=parseInt(i),h=!1,p=!1,c=function(i){_._s_layers[i].bitmap_async(!0).then((function(c){var u=""+c.hash,d=Object.assign({},(e._layers||[])[i]),f=d.thumbnail,m=d.hash;m===u&&m&&f&&_._s_layers[i].thumbnail?(_._layers[i].hash=u,_._layers[i].thumbnail=f,0!==_._layers[i].colors.length&&_._layers[i].colors.length===_._layers[i].number_of_colors||(_._layers[i].colors=t._get_most_used_color_sorted(_._s_layers[i].indexes,_._s_layers[i].colors,256),_._layers[i].number_of_colors=parseInt(_._s_layers[i].colors.length)),++s===r&&(_._timestamp=parseInt(l),t.maybe_set_layers(_,a,n,p,h))):(p=!0,m===u&&m||(h=!0,l=o),_._layers[i].hash=u,_._layers[i].thumbnail=c,_._layers[i].colors=t._get_most_used_color_sorted(_._s_layers[i].indexes,_._s_layers[i].colors,256),_._layers[i].number_of_colors=parseInt(_._s_layers[i].colors.length),++s===r&&(_._timestamp=parseInt(l),t.maybe_set_layers(_,a,n,p,h)))}))},u=0;us._saving_json_state_history_ran_timestamp||_)&&(s._last_action_timestamp+625<=Date.now()||_||0===i.state_history.length)?s._saving_json_state_history_running||n&&!_?setTimeout((function(){t._maybe_save_state(e,_,a)}),125):(t.super_state.set_state({_saving_json_state_history_running:!0}),r=s._id,l=s._layers,h=s.pxl_width,p=s.pxl_height,c=s._s_layers,u=s._original_image_index,d=s._layer_index,f=s._pxl_indexes_of_selection,m=s._pencil_mirror_index,g=parseInt(i.history_position),y=0===i.state_history.length?{}:i.state_history[g-1],(v={})._timestamp=parseInt(Date.now()),v._id=r.toString(),v.pxl_width=parseInt(h),v.pxl_height=parseInt(p),v._original_image_index=parseInt(u),v._layers=Array.from(l.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity||1),thumbnail:t.thumbnail||null,colors:Array.from(t.colors||[]),number_of_colors:parseInt(t.number_of_colors||0)}}))),v._layer_index=parseInt(d),v._s_layers=Array.from(c.map((function(t){return t=t||{},o.Layer.new_from_colors_and_indexes(t.colors_copy,t.indexes_copy,parseInt(h),parseInt(p),!0)}))),v._pxl_indexes_of_selection=f.export,v._pencil_mirror_index=parseInt(m),t._notify_layers_and_compute_thumbnails_change(Object.assign({},y),Object.assign({},v),(function(_,a,n){var o,r,l=s._state_history_length,h=s._saving_json_state_history_ran_timestamp,p=!(0!==i.state_history.length),c=parseInt(i.history_position),u=v._timestamp||0,d=Date.now();if(p&&0!==u)i.state_history=[],i.state_history.push(Object.assign({},v)),i.history_position=1,h=d;else if(n){if(i.state_history.length-c>0)for(o=i.state_history.splice(c);o.length;)i.state_history.push(Object.assign({},o.shift()));i.state_history.length>=l&&i.state_history.splice(1,1),i.state_history.push(Object.assign({},v)),i.history_position=parseInt(i.state_history.length),h=d}else for(r=0;r0&&void 0!==arguments[0]&&arguments[0],_=t.super_state.get_state(),a=_._s_layers,n={width:_.pxl_width,height:_.pxl_height,number_of_colors:a[0].colors.length,only_scan:e};t._maybe_save_state(void 0,!0),t.props.onLoadComplete&&t.props.onLoadComplete("image_load",n)},this._notify_image_import_complete=function(){t.props.onImageImportComplete&&t.props.onImageImportComplete()},this._notify_can_undo_redo_change=function(){t.props.onCanUndoRedoChange&&t.props.onCanUndoRedoChange(t._can_undo(),t._can_redo())},this._notify_size_change=function(){var e=t.super_state.get_state(),_=e.pxl_width,a=e.pxl_height;t.props.onSizeChange&&t.props.onSizeChange(_,a)},this.import_JSON_state=function(e){t.import_JS_state(e)},this.import_JS_state=function(e,_){var a=Array.from(e._base64_original_images);Promise.all(a.map((function(t){return(0,U.bytesToBase64)(t[1])}))).then((function(n){var s,r;n.forEach((function(t,e){a[e]=a[e][0]+","+t})),s={history_position:parseInt(e._json_state_history.history_position),state_history:e._json_state_history.state_history.map((function(t){return Object.assign({},{_original_image_index:parseInt(t._original_image_index),pxl_width:parseInt(t.pxl_width),pxl_height:parseInt(t.pxl_height),_pxl_indexes_of_selection:i.SetFixed.import(t._pxl_indexes_of_selection),_s_layers:Array(t._s_pxls.length).fill({}).map((function(e,_){return o.Layer.new_from_colors_and_indexes(t._s_pxl_colors[_],t._s_pxls[_],parseInt(t.pxl_width),parseInt(t.pxl_height),!0)})),_layers:Array.from(t._layers.map((function(t){return Object.assign({},{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)})}))),_layer_index:parseInt(t._layer_index),_pencil_mirror_index:parseInt(t._pencil_mirror_index),_id:t._id.toString()})}))},e=null,r=s.state_history[s.history_position-1],t.super_state.set_state({_id:r._id.toString(),pxl_width:parseInt(r.pxl_width),pxl_height:parseInt(r.pxl_height),_base64_original_images:Array.from(a),_original_image_index:parseInt(r._original_image_index)||0,_layers:Array.from(r._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(r._layer_index)||0,_s_layers:Array.from(r._s_layers),_pxl_indexes_of_selection:i.SetFixed.import(r._pxl_indexes_of_selection),_pencil_mirror_index:parseInt(r._pencil_mirror_index),_json_state_history:s,_pxls_hovered:-1,_last_action_timestamp:1/0}).then((function(){t._set_size(),t._notify_image_load_complete(),t._notify_is_something_selected(),t._notify_can_undo_redo_change(),_()}))}))},this.export_JS_state=function(e){t._maybe_save_state((function(_){var a=t.super_state.get_state()._base64_original_images.map((function(t){return t.split(",")}));Promise.all([Promise.all(a.map((function(t){return(0,U.base64ToBytes)(t[1])}))),t.get_base64_png_data_url(1,!1,1,100,100)]).then((function(n){Array.from(n[0]).forEach((function(t,e){a[e][1]=t})),_={history_position:parseInt(_.history_position),state_history:_.state_history.map((function(t){return Object.assign({},{_original_image_index:parseInt(t._original_image_index),pxl_width:parseInt(t.pxl_width),pxl_height:parseInt(t.pxl_height),_pxl_indexes_of_selection:t._pxl_indexes_of_selection.export,_s_pxls:Array.from(t._s_layers).map((function(t){return t.indexes_copy})),_s_pxl_colors:Array.from(t._s_layers).map((function(t){return t.colors_copy})),_layers:Array.from(t._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(t._layer_index),_pencil_mirror_index:parseInt(t._pencil_mirror_index),_id:t._id.toString()})}))};var s=3*Math.ceil(n[1].url.length/4);e({id:t.super_state.get_state()._id.toString(),kb:s/1024,preview:n[1].url,timestamp:Date.now(),_base64_original_images:a,_json_state_history:_})}))}))},this._can_undo=function(e){return e||(e=t.super_state.get_state()._json_state_history),parseInt(e.history_position-1)},this.undo=function(){t._maybe_save_state((function(e){var _,a;t._can_undo(e)>0&&(e.history_position=parseInt(e.history_position-1),_=e.state_history[e.history_position-1],a=!(_.pxl_width===t.super_state.get_state().pxl_width&&_.pxl_height===t.super_state.get_state().pxl_height),t.super_state.set_state({_id:_._id.toString(),pxl_width:parseInt(_.pxl_width),pxl_height:parseInt(_.pxl_height),_original_image_index:parseInt(_._original_image_index),_layers:Array.from(_._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(_._layer_index),_s_layers:Array.from(_._s_layers.map((function(t){return o.Layer.new_from_colors_and_indexes(t.colors_copy,t.indexes_copy,parseInt(_.pxl_width),parseInt(_.pxl_height),!0)}))),_pxl_indexes_of_selection:i.SetFixed.import(_._pxl_indexes_of_selection),_pencil_mirror_index:parseInt(_._pencil_mirror_index),_json_state_history:e,_last_action_timestamp:Date.now()}).then((function(){a?t._set_size():t.super_master_meta.update_canvas(!0),t._notify_is_something_selected(),t._notify_can_undo_redo_change()})))}),!0)},this._can_redo=function(e){return e||(e=t.super_state.get_state()._json_state_history),e.state_history.length-parseInt(e.history_position-1)-1|0},this.redo=function(){t._maybe_save_state((function(e){var _,a;t._can_redo(e)>0&&(e.history_position=parseInt(e.history_position+1),_=e.state_history[e.history_position-1],a=!(_.pxl_width===t.super_state.get_state().pxl_width&&_.pxl_height===t.super_state.get_state().pxl_height),t.super_state.set_state({_id:_._id.toString(),pxl_width:parseInt(_.pxl_width),pxl_height:parseInt(_.pxl_height),_original_image_index:parseInt(_._original_image_index),_layers:Array.from(_._layers.map((function(t){return{id:parseInt(t.id),hash:t.hash+"",name:t.name+"",hidden:!!t.hidden,opacity:parseFloat(t.opacity)}}))),_layer_index:parseInt(_._layer_index),_s_layers:Array.from(_._s_layers.map((function(t){return o.Layer.new_from_colors_and_indexes(t.colors_copy,t.indexes_copy,parseInt(_.pxl_width),parseInt(_.pxl_height),!0)}))),_pxl_indexes_of_selection:i.SetFixed.import(_._pxl_indexes_of_selection),_pencil_mirror_index:parseInt(_._pencil_mirror_index),_json_state_history:e,_last_action_timestamp:Date.now()}).then((function(){a?t._set_size():t.super_master_meta.update_canvas(!0),t._notify_is_something_selected(),t._notify_can_undo_redo_change()})))}),!0)},this.to_selection_border=function(){var e=t.super_state.get_state(),_=e.pxl_current_color_uint32,a=e._pxl_indexes_of_selection,n=e._s_layers,s=e._layer_index,i=e.pxl_current_opacity,o=(n[s]||{}).indexes_copy||new Uint8Array(0),r=Array.from(n[s].colors_copy);t._get_border_from_selection(a).forEach((function(e){var a,n=o[e],s=r[n],l=t.color_conversion.blend_colors(s,_,i,!1,!1);r.includes(l)||r.push(l),a=r.indexOf(l),o[e]=a})),n[s].set_colors_and_indexes(r,o),t.super_state.set_state({_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},this.to_selection_bucket=function(){var e=t.super_state.get_state(),_=e._s_layers,a=e._pxl_indexes_of_selection,n=e._layer_index,s=e.pxl_current_opacity,i=e.pxl_current_color_uint32,o=Array.from(_[n].indexes),r=Array.from(_[n].colors);a.forEach((function(e){var _,a=o[e],n=r[a],l=t.color_conversion.blend_colors(n,i,s,!1,!1);r.includes(l)||r.push(l),_=r.indexOf(l),o[e]=_})),_[n].set_colors_and_indexes(r,o),t.super_state.set_state({_s_layers:_,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},this.to_selection_invert=function(){var e,_=t.super_state.get_state(),a=_._s_layers,n=_._pxl_indexes_of_selection,s=_._layer_index,o=_.pxl_width,r=_.pxl_height,l=n,h=new i.SetFixed(o*r);for(e=0;e1&&void 0!==arguments[1]&&arguments[1],a=t.color_conversion.to_rgba_from_uint32(e),s=n(a,4),i=s[0],o=s[1],r=s[2],l=s[3],h=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(i,o,r,l)),p=n(h,4),c=p[0],u=p[1],d=p[2],f=(p[3],t.super_state.get_state()),m=f._s_layers,g=f._pxl_indexes_of_selection,y=f._layer_index,v=Array.from(m[y].indexes),x=Array.from(m[y].colors),w=t._get_average_color_of_selection(),b=t.color_conversion.to_rgba_from_uint32(w),M=n(b,4),I=M[0],z=M[1],C=M[2],A=M[3],S=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(I,z,C,A)),j=n(S,4),E=j[0],D=(j[1],j[2],j[3],E-c);g.forEach((function(e,a,s){var i,o,r,l,h,p,c,f=v[e],m=x[f],g=t.color_conversion.to_rgba_from_uint32(m),y=n(g,4),w=y[0],b=y[1],M=y[2],I=y[3],z=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(w,b,M,I)),C=n(z,4),A=C[0],S=C[1],j=C[2],E=C[3],L=A+D<0?(360+A+D)%360:(A+D)%360,k=[u,d,1],O=[S,j,1],F=[];0!==I&&_?(F[2]=1-(1-k[2])*(1-O[2]),F[0]=Math.round(k[0]*k[2]/F[2]+O[0]*O[2]*(1-k[2])/F[2]),F[1]=Math.round(k[1]*k[2]/F[2]+O[1]*O[2]*(1-k[2])/F[2])):F=[S,j],i=t.color_conversion.to_rgba_from_hsla(Array.of(L,F[0],F[1],E)),r=(o=n(i,4))[0],l=o[1],h=o[2],p=o[3],c=0,0!==I&&(c=t.color_conversion.to_uint32_from_rgba(Uint8ClampedArray.of(r,l,h,p))),x.includes(c)||x.push(c),v[e]=x.indexOf(c)})),m[y].set_colors_and_indexes(x,v),t.super_state.set_state({_s_layers:m,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},this._get_border_from_selection=function(e){var _=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.super_state.get_state(),s=n.pxl_width,o=n.pxl_height,r=new i.SetFixed(s*o);return e.forEach((function(t,n){var i,l,h,p,c=void 0,u=void 0,d=void 0,f=void 0;u=(u=t+1)%s==0?-1:u,f=(f=t-1)%s==s-1?-1:f,i=void 0,l=void 0,h=void 0,p=void 0,i=(c=(c=t-s)<0?-1:c)-1,i=-1===c||-1===f?-1:i,l=c+1,l=-1===c||-1===u?-1:l,h=(d=(d=t+s)>s*o?-1:d)-1,h=-1===d||-1===f?-1:h,p=d+1,p=-1===d||-1===u?-1:p,_?(e.has(c)&&-1!==c&&e.has(u)&&-1!==u&&e.has(d)&&-1!==d&&e.has(f)&&-1!==f||r.add(t),a&&(e.has(i)&&-1!==i&&e.has(l)&&-1!==l&&e.has(h)&&-1!==h&&e.has(p)&&-1!==p||r.add(t))):(e.has(c)||r.add(c),e.has(u)||r.add(u),e.has(d)||r.add(d),e.has(f)||r.add(f),a&&(e.has(i)||r.add(i),e.has(l)||r.add(l),e.has(h)||r.add(h),e.has(p)||r.add(p)))})),r},this._to_selection_crop=function(){var e,_,a,s,r,l,h,p,c,u,d,f,m=t.super_state.get_state(),g=m._s_layers,y=(m._layer_index,m._pxl_indexes_of_selection),v=m.pxl_width,x=m.pxl_height,w=m._base64_original_images,b=m._original_image_index;if(y.size>0){for(e=[v,x],_=[-1,-1],y.forEach((function(t){var a=t%v,n=(t-a)/v;a_[0]&&(_[0]=a),n>_[1]&&(_[1]=n)})),a=1+_[0]-e[0],s=1+_[1]-e[1],r=0;r0;t.super_state.set_state({_is_image_import_mode:e}),t.props.onImageImportModeChange&&t.props.onImageImportModeChange(e)},this.to_selection_crop=function(){t._to_selection_crop()},this.to_rotation=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._to_rotation(e)},this.to_greyscale=function(){t._to_colorized("greyscale")},this.to_sepia=function(){t._to_colorized("sepia")},this.to_opacity=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;t._to_colorized(null,e)},this.to_color=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t._to_colorized(e,_,a,n)},this.to_vignette=function(e,_){t._to_vignette(e,_)},this.to_less_color=function(e){var _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.props.onLoad&&("auto"===e?t.props.onLoad("less_color_auto"):t.props.onLoad("less_color")),t._to_less_color(e,(function(a){t.props.onLoadComplete&&("auto"===e?t.props.onLoadComplete&&t.props.onLoadComplete("less_color_auto",a):t.props.onLoadComplete&&t.props.onLoadComplete("less_color",a)),_(a)}))},this.auto_adjust_contrast=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t._auto_adjust_contrast(e)},this.auto_adjust_saturation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.5;t._auto_adjust_saturation(e)},this.smooth_adjust=function(){t._auto_adjust_smoothness()},this.to_alpha=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#00000000",_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t._to_alpha(t.color_conversion.to_uint32_from_hex(t.color_conversion.format_hex_color(e)),_)},this.to_filter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1997",_=arguments[1];t._to_filter(e,parseFloat(_))},this.to_mirror=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._invert_pixel(e?"HORIZONTAL":"VERTICAL")},this.to_dutone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#ffffffff",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#000000ff";t._to_dutone(e,t.color_conversion.to_uint32_from_hex(t.color_conversion.format_hex_color(_)),t.color_conversion.to_uint32_from_hex(t.color_conversion.format_hex_color(a)))},this._invert_pixel=function(e){var _,a,s,o=t.super_state.get_state(),r=o._s_layers,l=o.pxl_width,h=o.pxl_height,p=o._base64_original_images,c=o._original_image_index,u=o._pxl_indexes_of_selection,d=o._shape_index_a,f=o._select_shape_index_a,m=o._layer_index,g=t.super_state.get_state(),y=g._imported_image_pxls,v=g._imported_image_width,x=g._imported_image_height,w=Array.from(r[m].indexes),b=new i.SetFixed(w.length),M=d,I=f,z=1,C=1;"HORIZONTAL"===e?y.length?(_=new Uint16Array(y.length),y.forEach((function(t,e){var a=e%v;_[(e-a)/v*v+(a=v-1-a)]=t})),y=_):(r[m].indexes.forEach((function(t,e){var _,a=e%l;w[_=(e-a)/l*l+(a=l-1-a)]=t,u.has(e)&&b.add(_),d===e&&(M=_),f===e&&(I=_)})),r[m].set_indexes(w),z=-1):y.length?(a=new Uint16Array(y.length),y.forEach((function(t,e){var _=e%v,n=(e-_)/v;a[(n=x-1-n)*v+_]=t})),y=a):(r[m].indexes.forEach((function(t,e){var _,a=e%l,n=(e-a)/l;w[_=(n=h-1-n)*l+a]=t,u.has(e)&&b.add(_),d===e&&(M=_),f===e&&(I=_)})),C=-1,r[m].set_indexes(w)),void 0===p[c]||0!==m||y.length?t.super_state.set_state({_shape_index_a:M,_select_shape_index_a:I,_pxl_indexes_of_selection:b,_s_layers:r,_last_action_timestamp:Date.now(),_imported_image_pxls:y}).then((function(){return t.super_master_meta.update_canvas()})):((s=new Image).onload=function(){var e,_=t._get_new_ctx_from_canvas(s.naturalWidth,s.naturalHeight),a=n(_,2),i=a[0],o=a[1];i.save(),i.scale(z,C),i.drawImage(s,0,0,s.naturalWidth*z,s.naturalHeight*C),i.restore(),e=s.src.includes("image/png")?o.toDataURL("image/png"):o.toDataURL("image/jpeg"),p.includes(e)||(p.push(e),c++),t.super_state.set_state({_shape_index_a:M,_select_shape_index_a:I,_pxl_indexes_of_selection:b,_s_layers:r,_base64_original_images:p,_original_image_index:c,_imported_image_pxls:y,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas()}))},s.src=p[c])},this._get_darkest_color=function(e){var _=t.color_conversion.to_rgba_from_hex(e[0]);return e.forEach((function(e){var a=t.color_conversion.to_rgba_from_hex(e);a[0]+a[1]+a[2]<_[0]+_[1]+_[2]&&(_=a)})),t.color_conversion.to_hex_from_rgba(Uint8ClampedArray.of(_[0],_[1],_[2],255))},this._to_alpha=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=t.super_state.get_state(),s=a._s_layers,i=a._layer_index,o=t._pxl_colors_to_alpha(s[i].indexes,s[i].colors,e,_),r=n(o,2),l=r[0],h=r[1];s[i].set_colors_and_indexes(h,l),t.super_state.set_state({_layer_index:i,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._to_less_color=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=t.super_state.get_state()._layer_index,s=t.super_state.get_state()._s_layers,i=s[a].colors.length;t._remove_close_pxl_colors(s[a].image_data,e).then((function(e){var o,r,l=n(e,2),h=l[0],p=l[1];s[a].set_colors_and_indexes(p,h),o=s[a].colors.length,r={colors_removed:i-o,colors_remaining:o},t.super_state.set_state({_s_layers:s,_last_action_timestamp:Date.now()}).then((function(){t.super_master_meta.update_canvas(!0),_(r)}))}))},this._auto_adjust_contrast=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=t.super_state.get_state(),a=_._layer_index,n=_._s_layers,s=n[a]||{},i=t._pxl_adjust_contrast(s.indexes_copy,s.colors_copy,e);n[a].set_colors_and_indexes(i[1],i[0]),t.super_state.set_state({_s_layers:n,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._auto_adjust_saturation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,_=t.super_state.get_state(),a=_._s_layers,n=_._layer_index,s=a[n]||{},i=t._pxl_adjust_saturation(s.indexes_copy,s.colors_copy,e);a[n].set_colors_and_indexes(i[1],i[0]),t.super_state.set_state({_s_layers:a,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._pxl_adjust_saturation=function(t,e,_){var a,n,s,i,o,r,l,h,p,c=100,u=0;for(_=0|Math.round(255*parseFloat(_)),a=0,n=void 0,i=(s=new F.Colors(e)).length,o=void 0,r=0;(0|r)<(0|i);r=(r+1|0)>>>0)a=(n=s.get_element(r)).hsla[1],(0|n.a)>0&&((0|a)>(0|u)&&(u=0|a),(0|a)<(0|c)&&(c=0|a));for(h=-c*(l=100/Math.max(1,u-c))|0,p=0;(0|p)<(0|i);p=(p+1|0)>>>0)o=(n=s.get_element(p)).hsla,n.blend_with(F.Color.new_hsla(o[0],o[1]*l+h|0,o[2],o[3]),_,!1,!1);return[t,e=s.subarray_uint32(0,i),l,h]},this._selection_pxl_adjust_sat_lum=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=t.super_state.get_state(),s=a._layer_index,i=a._s_layers,o=a._pxl_indexes_of_selection,r=i[s].indexes,l=Array.from(i[s].colors);o.forEach((function(a){var s=l[r[a]],i=t.color_conversion.to_hsla_from_rgba(t.color_conversion.to_rgba_from_uint32(s)),o=n(i,4),h=o[0],p=o[1],c=o[2],u=o[3],d=Math.min(100,Math.max(0,p+e)),f=Math.min(100,Math.max(0,c+_)),m=t.color_conversion.to_uint32_from_rgba(t.color_conversion.to_rgba_from_hsla(Array.of(h,d,f,u)));-1===l.indexOf(m)&&l.push(m),r[a]=l.indexOf(m)})),i[s].set_colors_and_indexes(l,r),t.super_state.set_state({_s_layers:i})},this._auto_adjust_smoothness=function(){var e=t.super_state.get_state(),_=e._layer_index,a=e._s_layers,n=e.pxl_width,s=e.pxl_height,i=t._pxl_adjust_smoothness(a[_].indexes,a[_].colors,n,s);a[_].set_colors_and_indexes(i[1],i[0]),t.super_state.set_state({_s_layers:a,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._pxl_to_vignette=function(e,_,a,s,i){var o,r=t.super_state.get_state().pxl_current_color_uint32,l=t.super_state.get_state(),h=l.pxl_width,p=l.pxl_height,c=t._get_new_ctx_from_canvas(h,p),u=n(c,2),d=u[0],f=(u[1],Math.max(h,p)),m=t.color_conversion.invert_uint32(r),g=d.createRadialGradient(h/2,p/2,0,h/2,p/2,f/2);g.addColorStop(1,t.color_conversion.to_hex_from_uint32(r)),g.addColorStop(.8,t.color_conversion.to_hex_from_uint32(t.color_conversion.blend_colors(r,m,.6))),g.addColorStop(0,t.color_conversion.to_hex_from_uint32(m)),d.fillStyle=g,d.fillRect(0,0,h,p),o=d.getImageData(0,0,h,p),t._remove_close_pxl_colors(o,18).then((function(a){var o,l,h,p,c,u,d=n(a,2),f=d[0],g=d[1],y=t._pxl_colors_to_alpha(f,g,m,1),v=n(y,2);f=v[0],g=v[1],o=t.color_conversion.to_rgba_from_uint32(r),l=n(o,3),h=l[0],p=l[1],c=l[2],g=g.map((function(e){e|=0;var _=t.color_conversion.to_rgba_from_uint32(e)[3];return 0|t.color_conversion.to_uint32_from_rgba(Uint8ClampedArray.of(h,p,c,_))})),u=[],f=f.map((function(a,n){var i,o,r;return n|=0,i=0|g[a|=0],o=0|_[e[n]],r=t.color_conversion.blend_colors(o,i,s,!1,!1),-1===u.indexOf(r)&&u.push(r),u.indexOf(r)})),i(Array.of(f,g=u))}))},this._to_vignette=function(e,_){var a,n,s,i;_>0&&(a=t.super_state.get_state(),n=a._layer_index,s=t.super_state.get_state(),i=s._s_layers,t._pxl_to_vignette(i[n].indexes,i[n].colors,e,_,(function(e){i[n].set_colors_and_indexes(e[1],e[0]),t.super_state.set_state({_s_layers:i,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))})))},this._to_colorized=function(){var e,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=t.super_state.get_state(),r=o._s_layers,l=o._layer_index;a=null===a?1:a,e=r[l].colors.map((function(e){var o,r,l,h,p,c,u=t.color_conversion.to_rgba_from_uint32(e),d=n(u,4),f=d[0],m=d[1],g=d[2],y=d[3],v=t.color_conversion.to_hsla_from_rgba(Uint8ClampedArray.of(f,m,g,y)),x=n(v,4),w=(x[0],x[1]),b=x[2],M=x[3],I=[s,i,a],z=[w,b,M/100],C=[];return 0!==a?(C[2]=1-(1-I[2])*(1-z[2]),C[0]=Math.round(I[0]*I[2]/C[2]+Math.round(z[0]*z[2]*(1-I[2])/C[2])),C[1]=Math.round(I[1]*I[2]/C[2]+Math.round(z[1]*z[2]*(1-I[2])/C[2]))):C=[w,b],o=t.color_conversion.to_rgba_from_hsla(Array.of(_,C[0],C[1],100*C[2])),l=(r=n(o,4))[0],h=r[1],p=r[2],c=r[3],0===y?0:t.color_conversion.to_uint32_from_rgba(Uint8ClampedArray.of(l,h,p,c))})),r[l].set_colors(e),t.super_state.set_state({_s_layers:r,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this.get_filter_names=function(){return t.filters.names},this._dutone_pixels=function(e,_,a,n,s){return s=s.map((function(n){var s=t.color_conversion.to_hsla_from_rgba(t.color_conversion.to_rgba_from_uint32(n))[2];return t.color_conversion.blend_colors(_,a,parseFloat(s/100)/e,!1,!1)})),t.color_conversion.clean_duplicate_colors(n,s)},this._to_dutone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#ffffffff",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#000000ff",n=t.super_state.get_state(),s=n._layer_index,i=n._s_layers,o=t._dutone_pixels(e,_,a,i[s].indexes,i[s].colors);i[s].set_indexes(o[0]),i[s].set_colors(o[1]),t.super_state.set_state({_s_layers:i,_pxls_hovered:-1,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._to_filter=function(e,_){var a=t.super_state.get_state(),n=a._s_layers,s=a._layer_index;t.filters.use(e,n[s],_),t.super_state.set_state({_s_layers:n,_pxls_hovered:-1,_last_action_timestamp:Date.now()}).then((function(){return t.super_master_meta.update_canvas(!0)}))},this._to_rotation=function(){var e,_,a,s,o,r,l=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],h=t.super_state.get_state(),p=h._imported_image_pxls,c=h._imported_image_width,u=h._imported_image_height,d=h.pxl_width,f=h.pxl_height,m=h._s_layers,g=h._pxl_indexes_of_selection,y=h._select_shape_index_a,v=h._shape_index_a,x=h._base64_original_images,w=h._original_image_index,b=(h._layer_index,u),M=c,I=new Uint16Array(b*M),z=f,C=d,A=new i.SetFixed(z*C),S=y,j=v,E=0,D=0,L=0;if(p.length)p.forEach((function(t,e){D=(e-(E=e%c))/c,I[L=(l?b-1-D:D)+(l?E:M-1-E)*b]=t,g.has(e)&&A.add(L)}));else{for(e=0,_=m[0].indexes.length;e<_;e++)D=(e-(E=e%d))/d,L=(l?z-1-D:D)+(l?E:C-1-E)*z,g.has(e)&&A.add(L),y===e&&(S=L),v===e&&(j=L);for(a=function(t){var e=new Uint16Array(z*C);m[t].indexes.forEach((function(t,_){D=(_-(E=_%d))/d,e[L=(l?z-1-D:D)+(l?E:C-1-E)*z]=t})),m[t].set_indexes(e)},s=0;s2&&void 0!==arguments[2]?arguments[2]:1,c=255,u=0;for(p=0|Math.round(255*parseFloat(p)),_=0,a=new F.Color(new ArrayBuffer(4)),n=(0,F.Colors)(e),s=F.simdops.clamp_int,i=n.length,o=0;(0|o)<(0|i);o=(o+1|0)>>>0)_=(a=n.get_element(0|o,a)).sum_rgb()/3*a.a/255|0,(0|a.a)>0&&((0|_)>(0|u)&&(u=0|_),(0|_)<(0|c)&&(c=0|_));for(l=-c*(r=255/Math.max(1,u-c))|0,h=0;(0|h)<(0|i);h=(h+1|0)>>>0)(a=n.get_element(0|h,a)).blend_with(F.Color.new_of(s(a.r*r+l|0,0,255),s(a.g*r+l|0,0,255),s(a.b*r+l|0,0,255),a.a),p,!1,!1);return[t,e=n.subarray_uint32(0,i),r,l]},this._pxl_adjust_smoothness=function(e,_,a,s,i){a|=0,s|=0,i=i||1;for(var o=0;oa*s?-1:v)-1,l=-1===v||-1===x?-1:l,h=v+1,h=-1===v||-1===y?-1:h,p=[i[g],i[y],i[v],i[x],i[o],i[r],i[l],i[h]],c=[],p.forEach((function(t){c[t]=void 0===c[t]?1:c[t]+1})),u=-1,d=-1,Object.entries(c).forEach((function(t){var e=n(t,2),_=e[0],a=e[1];d=6&&-1!==u||d+m>=8&&d>=5&&F.Color.new_uint32(_[i[e]]).match_with(F.Color.new_uint32(_[u]).blend_with(F.Color.new_uint32(_[f]),128,!1,!1),24))&&(i[e]=u)}));return t.color_conversion.clean_duplicate_colors(e,_)},this._set_ripple_ref=function(e){null!==e&&null===t._ripple&&(t._ripple=e)},this._remove_close_pxl_colors=function(t,e){return new Promise((function(_,a){(0,y.QuantiMatGlobal)(t,e).then((function(t){var e=t[1],a=t[2];return _([e,a])}))}))},this._request_force_update=function(e,_){return e=void 0===e||e,_=void 0===_||_,t.sraf.run_frame((function(){return new Promise((function(e,_){t.forceUpdate(e)}))}),!e,!_,Date.now(),"inner_pixel_page").catch((function(){return t._request_force_update(e,_)}))},this._update_canvas_container_size=function(){var e,_,a,n,s=t.super_state.get_state()._canvas_container?t.super_state.get_state()._canvas_container.getBoundingClientRect():null;s?(e=s.width||0,_=s.height||0,a=s.left||0,n=s.top||0,t.canvas_pos.set_canvas_container(n,a,_,e)):setTimeout((function(){t._update_canvas_container_size()}),50)}},e.default=G},927:function(t,e,_){e.UINT32=_(928),e.UINT64=_(929)},928:function(t,e,_){var a;!function(e){function _(t,e){return this instanceof _?(this._low=0,this._high=0,this.remainder=null,void 0===e?s.call(this,t):"string"==typeof t?i.call(this,t,e):void n.call(this,t,e)):new _(t,e)}function n(t,e){return this._low=0|t,this._high=0|e,this}function s(t){return this._low=65535&t,this._high=t>>>16,this}function i(t,e){var _=parseInt(t,e||10);return this._low=65535&_,this._high=_>>>16,this}_(60466176),_(268435456),_(1e9),_(1073741824),_(36),_(16),_(10),_(2),_.prototype.fromBits=n,_.prototype.fromNumber=s,_.prototype.fromString=i,_.prototype.toNumber=function(){return 65536*this._high+this._low},_.prototype.toString=function(t){return this.toNumber().toString(t||10)},_.prototype.add=function(t){var e=this._low+t._low,_=e>>>16;return _+=this._high+t._high,this._low=65535&e,this._high=65535&_,this},_.prototype.subtract=function(t){return this.add(t.clone().negate())},_.prototype.multiply=function(t){var e=this._high,_=this._low,a=t._high,n=t._low,s=_*n,i=s>>>16;return i+=e*n,i&=65535,i+=_*a,this._low=65535&s,this._high=65535&i,this},_.prototype.div=function(t){var e,a;if(0==t._low&&0==t._high)throw Error("division by zero");if(0==t._high&&1==t._low)return this.remainder=new _(0),this;if(t.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(t))return this.remainder=new _(0),this._low=1,this._high=0,this;for(e=t.clone(),a=-1;!this.lt(e);)e.shiftLeft(1,!0),a++;for(this.remainder=this.clone(),this._low=0,this._high=0;a>=0;a--)e.shiftRight(1),this.remainder.lt(e)||(this.remainder.subtract(e),a>=16?this._high|=1<>>16)&65535,this},_.prototype.equals=_.prototype.eq=function(t){return this._low==t._low&&this._high==t._high},_.prototype.greaterThan=_.prototype.gt=function(t){return this._high>t._high||!(this._hight._low},_.prototype.lessThan=_.prototype.lt=function(t){return this._hight._high)&&this._low16?(this._low=this._high>>t-16,this._high=0):16==t?(this._low=this._high,this._high=0):(this._low=this._low>>t|this._high<<16-t&65535,this._high>>=t),this},_.prototype.shiftLeft=_.prototype.shiftl=function(t,e){return t>16?(this._high=this._low<>16-t,this._low=this._low<>>32-t,this._low=65535&e,this._high=e>>>16,this},_.prototype.rotateRight=_.prototype.rotr=function(t){var e=this._high<<16|this._low;return e=e>>>t|e<<32-t,this._low=65535&e,this._high=e>>>16,this},_.prototype.clone=function(){return new _(this._low,this._high)},void 0===(a=_)||(t.exports=a)}()},929:function(t,e,_){var a;!function(e){function _(t,e,a,o){return this instanceof _?(this.remainder=null,"string"==typeof t?i.call(this,t,e):void 0===e?s.call(this,t):void n.apply(this,arguments)):new _(t,e,a,o)}function n(t,e,_,a){return void 0===_?(this._a00=65535&t,this._a16=t>>>16,this._a32=65535&e,this._a48=e>>>16,this):(this._a00=0|t,this._a16=0|e,this._a32=0|_,this._a48=0|a,this)}function s(t){return this._a00=65535&t,this._a16=t>>>16,this._a32=0,this._a48=0,this}function i(t,e){var a,n,s,i,r;for(e=e||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0,a=o[e]||new _(Math.pow(e,5)),n=0,s=t.length;n=0&&(a.div(e),n[s]=a.remainder.toNumber().toString(t),a.gt(e));s--);return n[s-1]=a.toNumber().toString(t),n.join("")},_.prototype.add=function(t){var e,_,a=this._a00+t._a00,n=a>>>16;return e=(n+=this._a16+t._a16)>>>16,_=(e+=this._a32+t._a32)>>>16,_+=this._a48+t._a48,this._a00=65535&a,this._a16=65535&n,this._a32=65535&e,this._a48=65535&_,this},_.prototype.subtract=function(t){return this.add(t.clone().negate())},_.prototype.multiply=function(t){var e,_,a=this._a00,n=this._a16,s=this._a32,i=this._a48,o=t._a00,r=t._a16,l=t._a32,h=a*o,p=h>>>16;return e=(p+=a*r)>>>16,p&=65535,e+=(p+=n*o)>>>16,_=(e+=a*l)>>>16,e&=65535,_+=(e+=n*r)>>>16,e&=65535,_+=(e+=s*o)>>>16,_+=a*t._a48,_&=65535,_+=n*l,_&=65535,_+=s*r,_&=65535,_+=i*o,this._a00=65535&h,this._a16=65535&p,this._a32=65535&e,this._a48=65535&_,this},_.prototype.div=function(t){var e,a;if(0==t._a16&&0==t._a32&&0==t._a48){if(0==t._a00)throw Error("division by zero");if(1==t._a00)return this.remainder=new _(0),this}if(t.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(t))return this.remainder=new _(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(e=t.clone(),a=-1;!this.lt(e);)e.shiftLeft(1,!0),a++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;a>=0;a--)e.shiftRight(1),this.remainder.lt(e)||(this.remainder.subtract(e),a>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&t,t=(65535&~this._a32)+(t>>>16),this._a32=65535&t,this._a48=~this._a48+(t>>>16)&65535,this},_.prototype.equals=_.prototype.eq=function(t){return this._a48==t._a48&&this._a00==t._a00&&this._a32==t._a32&&this._a16==t._a16},_.prototype.greaterThan=_.prototype.gt=function(t){return this._a48>t._a48||!(this._a48t._a32||!(this._a32t._a16||!(this._a16t._a00))},_.prototype.lessThan=_.prototype.lt=function(t){return this._a48t._a48)&&(this._a32t._a32)&&(this._a16t._a16)&&this._a00=48?(this._a00=this._a48>>t-48,this._a16=0,this._a32=0,this._a48=0):t>=32?(t-=32,this._a00=65535&(this._a32>>t|this._a48<<16-t),this._a16=this._a48>>t&65535,this._a32=0,this._a48=0):t>=16?(t-=16,this._a00=65535&(this._a16>>t|this._a32<<16-t),this._a16=65535&(this._a32>>t|this._a48<<16-t),this._a32=this._a48>>t&65535,this._a48=0):(this._a00=65535&(this._a00>>t|this._a16<<16-t),this._a16=65535&(this._a16>>t|this._a32<<16-t),this._a32=65535&(this._a32>>t|this._a48<<16-t),this._a48=this._a48>>t&65535),this},_.prototype.shiftLeft=_.prototype.shiftl=function(t,e){return(t%=64)>=48?(this._a48=this._a00<=32?(t-=32,this._a48=this._a16<>16-t,this._a32=this._a00<=16?(t-=16,this._a48=this._a32<>16-t,this._a32=65535&(this._a16<>16-t),this._a16=this._a00<>16-t,this._a32=65535&(this._a32<>16-t),this._a16=65535&(this._a16<>16-t),this._a00=this._a00<=32){if(e=this._a00,this._a00=this._a32,this._a32=e,e=this._a48,this._a48=this._a16,this._a16=e,32==t)return this;t-=32}return n=(_=this._a48<<16|this._a32)<>>32-t,s=a<>>32-t,this._a00=65535&s,this._a16=s>>>16,this._a32=65535&n,this._a48=n>>>16,this},_.prototype.rotateRight=_.prototype.rotr=function(t){var e,_,a,n,s;if(0==(t%=64))return this;if(t>=32){if(e=this._a00,this._a00=this._a32,this._a32=e,e=this._a48,this._a48=this._a16,this._a16=e,32==t)return this;t-=32}return n=(_=this._a48<<16|this._a32)>>>t|(a=this._a16<<16|this._a00)<<32-t,s=a>>>t|_<<32-t,this._a00=65535&s,this._a16=s>>>16,this._a32=65535&n,this._a48=n>>>16,this},_.prototype.clone=function(){return new _(this._a00,this._a16,this._a32,this._a48)},void 0===(a=_)||(t.exports=a)}()},933:function(t,e,_){"use strict";var a=_(934),n=Set.prototype;t.exports={Set:Set,add:a(n.add),has:a(n.has),remove:a(n.delete),proto:n}},934:function(t,e,_){"use strict";var a=_(935),n=Function.prototype,s=n.call,i=a&&n.bind.bind(s,s);t.exports=a?i:function(t){return function(){return s.apply(t,arguments)}}},935:function(t,e,_){"use strict";var a=_(936);t.exports=!a((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},936:function(t,e,_){"use strict";t.exports=function(t){try{return!!t()}catch(e){return!0}}}}]); \ No newline at end of file diff --git a/client/chunk_20.min.js b/client/chunk_20.min.js index 083572c7..9ea5b74b 100644 --- a/client/chunk_20.min.js +++ b/client/chunk_20.min.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{600:function(e,t,a){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,a){return function n(o,i){var r,l;try{l=(r=t[o](i)).value}catch(_){return void a(_)}if(!r.done)return Promise.resolve(l).then((function(e){n("next",e)}),(function(e){n("throw",e)}));e(l)}("next")}))}}function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var r,l,_,s,d,c,u,m,p,f,h,g,b,v,y,w,x,E,k,C,S,T,I,N,z,O,P,M,A,D,L,j,R,B,F,q,H,V,K,Y,U,W,X,G,Z,$,J,Q,ee,te,ae,ne,oe,ie,re,le,_e,se,de,ce,ue,me,pe,fe,he,ge,be,ve,ye,we,xe,Ee,ke,Ce,Se,Te,Ie,Ne,ze,Oe,Pe,Me,Ae,De,Le,je,Re,Be,Fe,qe,He,Ve,Ke,Ye,Ue,We,Xe,Ge,Ze,$e,Je,Qe,et,tt,at,nt,ot,it,rt,lt,_t,st,dt,ct,ut,mt,pt,ft,ht,gt,bt,vt,yt,wt,xt,Et,kt,Ct,St,Tt,It,Nt,zt,Ot,Pt,Mt,At,Dt,Lt,jt,Rt,Bt,Ft,qt,Ht,Vt,Kt,Yt;Object.defineProperty(t,"__esModule",{value:!0}),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a,n,o=[],i=!0,r=!1,l=void 0;try{for(a=e[Symbol.iterator]();!(i=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(_){r=!0,l=_}finally{try{!i&&a.return&&a.return()}finally{if(r)throw l}}return o}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l=Object.assign||function(e){var t,a,n;for(t=1;t video, &:hover > video":{height:96,width:96,transform:"scale(2)",zIndex:1},height:56,width:56,"&::after":{content:"''",background:"#fff !important",position:"absolute",right:0,top:0,width:"10%",height:"15%"}},desktopintrovideo:{position:"absolute",right:0,top:0,height:56,width:56},mobileintrovideowrapper:{zIndex:1,cursor:"pointer",margin:"16px 56px",position:"absolute",right:0,top:0,height:32,width:32,"&::after":{content:"''",background:"#fff !important",position:"absolute",right:0,top:0,width:"10%",height:"15%"}},mobileintrovideo:{position:"absolute",right:0,top:0,height:32,width:32},effectSliderText:{color:"#050c4c",fontWeight:"bold",textTransform:"uppercase"},effectSlider:{color:"#3729c1",padding:"16px 0px","& > .MuiSlider-track":{height:4}},coordinate:{padding:"6px 8px 6px 8px",display:"block",position:"absolute",top:0,left:"50%",transform:"translate(-50%, 0%)",borderRadius:"0px 0px 4px 4px",backgroundColor:"#ededffff",color:"#050c4c",boxShadow:"inset 0px 3px 6px #050c4c4d",whiteSpace:"nowrap"},drawerModalBackdropRoot:{contain:"layout size style paint"},drawerModal:{transform:"translateY(-32px)",marginTop:32,contain:"size layout style",overflow:"hidden"},contentDrawerFixed:(n={zIndex:20,contain:"style size paint layout",boxShadow:"-2px 0px 4px 0px rgb(0 0 0 / 20%), -4px 0px 5px 0px rgb(0 0 0 / 14%), -6px 0px 10px 0px rgb(0 0 0 / 12%)",maxHeight:"100%",height:"100%"},i(n,e.breakpoints.down("md"),{display:"none"}),i(n,"width",480),i(n,"overscrollBehavior","none"),i(n,"display","inline-block"),i(n,"animationFillMode","both"),i(n,"animationName","$drawer"),i(n,"animationDuration","250ms"),i(n,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(n,"animationDirection","alternate"),i(n,"animationIterationCount","1"),i(n,"animationDelay","0ms"),i(n,"& > div",{animationFillMode:"both",animationName:"$opacity",animationDuration:"125ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"150ms"}),n),"@keyframes drawer":{"0%":{transform:"translateX(100%)"},"190%":{transform:"translateX(0%)"}},"@keyframes opacity":{"0%":{filter:"opacity(0)"},"190%":{filter:"opacity(1)"}},"@keyframes menu":{"0%":{transform:"translateY(100%)"},"190%":{transform:"translateY(0%)"}},drawerPaper:{width:480,overflowX:"overlay",background:"#fafafa",contain:"layout paint size style"},swipeableDrawerPaper:{maxWidth:"100%",overscrollBehavior:"none",overflow:"hidden",paddingBottom:"48px",borderBox:"content-box",height:"100%",contain:"layout paint size style"},drawerContainer:(r={transform:"translateZ(10px)",scrollBehavior:"smooth",contain:"size style paint layout",height:"100% !important",overflow:"overlay"},i(r,e.breakpoints.down("md"),{height:"calc(100vh - 180px) !important"}),i(r,e.breakpoints.up("lg"),{overflowX:"hidden"}),i(r,"& > div",{overflowX:"hidden !important",overflowY:"overlay !important",display:"inline !important",width:"100% !important",height:"100% !important",contain:"size style paint layout !important"}),i(r,"& div .react-swipeable-view-container > div",i({overflow:"initial !important",alignItems:"normal",contain:"size style !important",height:"100%"},e.breakpoints.down("md"),{height:"100% !important",paddingBottom:"24px",boxSizing:"border-box"})),i(r,"& div .react-swipeable-view-container > div[aria-hidden=true]",i({},e.breakpoints.up("lg"),{height:"16px"})),i(r,"& div .react-swipeable-view-container > div[aria-hidden=false] > ul",i({},e.breakpoints.down("md"),{paddingBottom:0})),i(r,"& > div > .react-swipeable-view-container",(o={display:"flex !important",filter:"inherit !important",WebkitFilter:"inherit",willChange:"none !important",height:"100% !important"},i(o,e.breakpoints.up("lg"),{width:480}),i(o,e.breakpoints.down("md"),{width:"100%"}),o)),r),tabs:{contain:"paint size style layout",animationFillMode:"both",animationName:"$menu",animationDuration:"175ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"0ms",height:72,display:"grid","& .MuiTabs-scroller":{overflowY:"hidden"},"& .MuiTab-root":{minWidth:"auto",flex:"auto"},"& .MuiTabs-indicator":{backgroundColor:"#050c4c"}},"@keyframes bounce":{"0%":{transform:"translate3d(0, 0px, 0) scaleY(1.00)"},"20%":{transform:"translate3d(0, 2px, 0) scaleY(0.95)"},"40%":{transform:"translate3d(0, 0px, 0) scaleY(1.00)"},"70%":{transform:"translate3d(0, -2px, 0) scaleY(1.10)"},"80%":{transform:"translate3d(0, 1px, 0) scaleY(0.95)"},"90%":{transform:"translate3d(0, 0px, 0) scaleY(1.00)"}},tab:{backgroundColor:"#fafafa",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .275s","&.Mui-selected":{fontWeight:"bold",backgroundColor:"#dfddf2",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"4px 4px 0px 0px","& .MuiTab-wrapper":{animationDuration:"375ms",animationTimingFunction:"linear",animationName:"$bounce",transformOrigin:"center bottom"}},"&:hover":{fontWeight:"bold",backgroundColor:"#e8e6f5",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"4px 4px 0px 0px","& .MuiTab-wrapper":{animationDuration:"375ms",animationTimingFunction:"linear",animationName:"$bounce",transformOrigin:"center bottom"}},"&:first-child":{borderRadius:"0px 4px 0px 0px"},"&:last-child":{borderRadius:"4px 0px 0px 0px"},"& .MuiTab-wrapper":{fontSize:"11px"},"& .MuiTab-wrapper svg":{width:32,height:32,contentVisibility:"auto"}},tabNoIcon:{backgroundColor:"white",color:"#050c4c",transition:"color, background-color ease-in .175s","&.Mui-selected":{fontWeight:"bold",backgroundColor:"#dfddf2",color:"#050c4c",borderRadius:"4px 4px 0px 0px"},"&.MuiTab-labelIcon":{minHeight:36},"& .MuiTab-wrapper":{fontSize:"11px"},"& .MuiTab-wrapper svg":{width:32,height:32,display:"none",color:"#181063"}},"@keyframes backdropanim":{"0%":{filter:"drop-shadow(0px, 0px, 20px, 20px, #131c955c)"}},backdrop:{zIndex:2e3,color:"#fff",filter:"brightness(1.1) contrast(1.2) drop-shadow(0 0 12px #070b32)",background:"radial-gradient(farthest-corner, #001856d1 20%, #636eff52 80%, #474e9b2b)",contain:"layout paint size style",userSelect:"none",animation:"$backdropanim 16s linear infinite both"},backdropTextContent:{display:"block",textAlign:"center"},fatabs:(l={transition:"transform 45ms cubic-bezier(0.4, 0, 0.2, 1) 5ms",backgroundColor:"#fafafa",boxShadow:"0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)",contain:"paint size style layout"},i(l,e.breakpoints.up("lg"),{display:"none"}),i(l,e.breakpoints.up("md"),{width:"100%"}),i(l,"zIndex",1300),i(l,"position","fixed"),i(l,"bottom",0),i(l,"right",0),i(l,"width","100%"),i(l,"height",72),l),listOfTools:(_={paddingTop:0},i(_,e.breakpoints.down("md"),{width:"100%"}),i(_,"width",360),_),contextMenuSubheader:{lineHeight:"24px",backgroundColor:"#eee",color:e.palette.secondary.light},contextMenuFuckYouActive:{cursor:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAApCAYAAAAiT5m3AAABXklEQVRYR+2XSxKCMAyGYSXqCdiJev8TqbjjBCqucMJMnDSk6QOKM0hXzPTxNemfB3n2o5GP4Z4OVYf7r/c66KygxfSSCL3Ut+xcHfupEPgoMEBxAHwFa/pZXe0dXaDqVVzLCyeaIkEMs7wxTZEAhUyVHMyhs4KpdTYwj0VNbF6Za7cpukf7Ms7lruaXcVWsZGC8iM3qHszVyhfHWIxg6qamabLnu+2ZXzC+IbqIFvZYsOb+AZgWdviGW5ZlaYSOLaG73p263wqWlEuBEkS6kC3eVbAG97FOi/fkYO4F7M0MVfMkQd/bNucq4KqrYbOk3NnAoF5edbjKYy2n50CeGGQu3tK4XBk6b7wx3ZwSTPO3aLHN3aHW8fX7YmumTL4gldX/A5YKj1iPaZkcGz62uqw2AlO9tfQLmxQsuRiF7ARjTeY9l09oaT/r0T3XssEgMmiBQgcUHbXLDD1wivUfqwJ8Oe4e4FEAAAAASUVORK5CYII=") 17 28, auto',"& .MuiList-padding":{padding:0}},contextMenuFuckYouDisable:{"& .MuiList-padding":{padding:0}},ripple:{contain:"layout paint size style",pointerEvents:"none",contentVisibility:"auto",mixBlendMode:"dodge"},infoIcon:{position:"absolute"},blueCenter:{color:e.palette.secondary.lighter,textAlign:"center",minWidth:"100%"},perspectiveButton:{position:"absolute",left:16,top:16,animationFillMode:"both",animationName:"$fadein",animationDuration:"225ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"175ms"},saveButton:(s={backgroundColor:"#0037ff14 !important",position:"absolute",right:496,top:16},i(s,e.breakpoints.down("md"),{right:16}),i(s,"animationFillMode","both"),i(s,"animationName","$fadein"),i(s,"animationDuration","225ms"),i(s,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(s,"animationDirection","alternate"),i(s,"animationIterationCount","1"),i(s,"animationDelay","175ms"),s),confirmImportButton:(d={position:"absolute",left:16,bottom:16},i(d,e.breakpoints.down("md"),{bottom:88}),i(d,"animationFillMode","both"),i(d,"animationName","$fadein"),i(d,"animationDuration","225ms"),i(d,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(d,"animationDirection","alternate"),i(d,"animationIterationCount","1"),i(d,"animationDelay","175ms"),d),zoomInButton:(c={position:"absolute",left:16,bottom:104},i(c,e.breakpoints.down("md"),{bottom:176}),i(c,"animationFillMode","both"),i(c,"animationName","$fadein"),i(c,"animationDuration","225ms"),i(c,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(c,"animationDirection","alternate"),i(c,"animationIterationCount","1"),i(c,"animationDelay","175ms"),c),zoomOutButton:(u={position:"absolute",left:16,bottom:60},i(u,e.breakpoints.down("md"),{bottom:132}),i(u,"animationFillMode","both"),i(u,"animationName","$fadein"),i(u,"animationDuration","225ms"),i(u,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(u,"animationDirection","alternate"),i(u,"animationIterationCount","1"),i(u,"animationDelay","175ms"),u),redoButton:(m={backgroundColor:"#0037ff14 !important",position:"absolute",right:496,bottom:60},i(m,e.breakpoints.down("md"),{right:16,bottom:132}),i(m,"animationFillMode","both"),i(m,"animationName","$fadein"),i(m,"animationDuration","225ms"),i(m,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(m,"animationDirection","alternate"),i(m,"animationIterationCount","1"),i(m,"animationDelay","175ms"),m),undoButton:(p={backgroundColor:"#0037ff14 !important",position:"absolute",right:496,bottom:16},i(p,e.breakpoints.down("md"),{right:16,bottom:88}),i(p,"animationFillMode","both"),i(p,"animationName","$fadein"),i(p,"animationDuration","225ms"),i(p,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(p,"animationDirection","alternate"),i(p,"animationIterationCount","1"),i(p,"animationDelay","175ms"),p),"@keyframes fadein":{"0%":{filter:"opacity(0)"},"190%":{filter:"opacity(1)"}},imageBackdrop:{filter:"brightness(1.5) contrast(0.75) drop-shadow(2px 4px 6px black)",width:"min(75vw, 75vh)"}}},Kt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Yt.call(a),a.st4te={classes:e.classes,load_with:e.load_with+"",_history:Q.HISTORY,_perspective:!1,_library_dialog_open:!1,_library:{},_library_type:"open",_view_name_index:1,_handle_wheel_timestamp:Date.now(),_view_name_sub_index:0,_previous_view_name_index:1,_view_names:["palette","image","layers","tools","selection","effects","filters"],_canvas:null,_loading:!1,_loading_process:"",_can_undo:0,_can_redo:0,_current_color:"#ffffffff",_second_color:"#000000ff",_pxl_current_opacity:1,_width:32,_height:32,_import_size:"192",_import_colorize:"0",_hue:360,_slider_value:.25,_slider_value_width:192,_slider_value_height:96,_game_ended:!1,_tool:Bt?"MOVE":"PENCIL",_memory_tool:Bt?"MOVE":"PENCIL",_previous_tool_timestamp:1/0,_select_mode:"REPLACE",_pencil_mirror_mode:"NONE",_filters:[],_x:-1,_y:-1,_drag_file:!1,_is_something_selected:!1,_hide_canvas_content:!1,_show_original_image_in_background:!1,_show_transparent_image_in_background:!0,_is_image_import_mode:!1,_layers:[],_layer_index:0,_previous_layer_index:0,_mine_player_direction:"UP",_is_edit_drawer_open:!1,_kb:0,_saved_at:Date.now(),_fps:0,_prev_fps:0,_menu_mouse_y:null,_menu_mouse_x:null,_menu_data:{},_menu_event:null,_ripple:null,_ripple_color:"#ffffffff",_ripple_opacity:1,_is_pixel_dialog_post_edit_open:!1,_is_dialog_info_open:!1,_base64_url:"",_logged_account:{},_less_than_1280w:!1,_is_pixel_dialog_create_open:!1,_attachment_previews:{},_swipeable_drawer_handle_filters_thumbnail_change:function(){},_swipeable_drawer_set_props:function(){},_toolbox_container_ref:{},_files_waiting_download:[],_time_ago_initiated:!1,_fps_el:{},_xy_el:{},_settings:g.default.unpack(e.settings)},a.sraf=Object.create(jt.default).init(),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),_(t,[{key:"setSt4te",value:function(e,t){var a,n=Object.keys(e),o=0|n.length,i="";for(a=0;(0|a)<(0|o);a=(a+1|0)>>>0)i=n[a],this.st4te[i]=e[i];"function"==typeof t&&t()}},{key:"componentWillMount",value:function(){te.default.trigger_loading_update(0),te.default.trigger_page_render_complete(),setTimeout((function(){te.default.trigger_loading_update(100)}),300)}},{key:"componentDidMount",value:function(){var e=this;te.default.trigger_snackbar("Awesome buddy! Welcome back to the laboratory.",3500),(0,It.l)(null,(function(){e._compute_menu_drawer(),e.setSt4te({_time_ago_initiated:!0})}),!0),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&(te.default.trigger_snackbar("Right here! Let's upload a picture now to create a new artwork.",6e3),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&(te.default.trigger_snackbar("By the way, ...",1e3),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&(te.default.trigger_snackbar("Huh, let me take my breath! ...",1500),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&te.default.trigger_snackbar("You can set the size of your artwork before uploading your picture.",1e4)}),3e3))}),1500))}),8500))}),9e3),te.default.jamy_update("happy"),window.addEventListener("resize",this._updated_dimensions),window.addEventListener("wheel",this._prevent_ctrl_zoom,{passive:!1}),document.addEventListener("keydown",this._handle_keydown),document.addEventListener("keyup",this._handle_keyup);try{document.getElementById("tabs-desktop").addEventListener("wheel",this._handle_wheel,{passive:!1})}catch(t){}v.default.register(this._handle_events.bind(this)),this.setSt4te({_h_svg:(0,Et.createLocalBlob)((0,Tt.default)(f.default.createElement(Ct.default,{color:"#e5e5e5"}))),_h_svg_size:"100px 115px"}),(0,m.default)((function(){return a.e(42).then(a.t.bind(null,940,7))})).then((function(t){e.setSt4te({_library:t})})),this._set_saved_at_element(),this._try_load_with_payload(this.st4te.load_with),setTimeout((function(){e._request_force_update(!1,!0).then((function(){e._updated_dimensions()}))}),1e3)}},{key:"componentWillReceiveProps",value:function(e){var t=this;e.load_with!==this.st4te.load_with?this.setSt4te(l({_settings:g.default.unpack(e.settings)},e),(function(){t._compute_menu_drawer(),t._request_force_update().then((function(){t._try_load_with_payload(t.st4te.load_with)}))})):this.setSt4te(l({_settings:g.default.unpack(e.settings)},e))}},{key:"_handle_events",value:function(e){var t=this;if("TRIGGER_CANVAS_ACTION"===e.type)switch(e.data.name.toUpperCase()){case"CONTRAST":this._to_auto_medium_more_contrast();break;case"SATURATION":this._to_auto_medium_more_saturation();break;case"PALETTE":this._less_colors_auto();break;case"SMOOTH":this._smooth_adjust();break;case"FILTER":this._handle_edit_drawer_open(null,6);break;case"RENDER":this._handle_edit_drawer_open(null,1),setTimeout((function(){t._handle_edit_drawer_open(null,1),setTimeout((function(){t._handle_edit_drawer_open(null,1)}),100)}),100)}}},{key:"componentWillUnmount",value:function(){this._backup_state(),te.default.stop_sound(),window.removeEventListener("resize",this._updated_dimensions),window.removeEventListener("wheel",this._prevent_ctrl_zoom);try{document.getElementById("tabs-desktop").removeEventListener("wheel",this._handle_wheel,{passive:!1})}catch(e){}document.removeEventListener("keydown",this._handle_keydown),document.removeEventListener("keyup",this._handle_keyup),clearInterval(this.st4te._saved_at_interval)}},{key:"render",value:function(){var e=this,t=this.st4te,a=t.classes,n=t._canvas,o=t._loading,i=t._loading_process,r=t._is_image_import_mode,l=t._hide_canvas_content,_=t._show_original_image_in_background,s=t._show_transparent_image_in_background,c=t._can_undo,u=t._can_redo,m=t._current_color,h=t._slider_value,g=t._tool,b=t._import_size,v=t._hue,y=t._select_mode,x=t._pencil_mirror_mode,k=t._kb,C=t._mine_player_direction,S=t._menu_data,T=t._ripple_color,I=t._ripple_opacity,N=t._library_dialog_open,z=t._library,O=t._is_pixel_dialog_create_open,M=t._h_svg,A=t._h_svg_size,D=t._attachment_previews,L=t._perspective,j=t._files_waiting_download,R=t._time_ago_initiated,B=t._settings,F=t._text_dialog_open,q=t._drag_file;return S.pos_x=-1===S.pos_x?"out":S.pos_x,S.pos_y=-1===S.pos_y?"out":S.pos_y,f.default.createElement("div",{style:{height:"100%",position:"relative",pointerEvents:"none",userSelect:"none"},ref:this._set_root_ref},f.default.createElement("div",{className:a.root},f.default.createElement("div",{className:a.contentInner,style:{backgroundColor:"#f7f7f7",backgroundImage:'url("'+M+'")',backgroundRepeat:"repeat",backgroundSize:A,textRendering:"optimizespeed",imageRendering:"optimizespeed"}},f.default.createElement(p.Suspense,{fallback:f.default.createElement("div",{className:a.contentCanvas})},f.default.createElement(Ft,{set_compressor:this._set_png_compressors,perspective:L?2:0,on_state_export:this._handle_canvas_state_will_export,on_state_exported:this._handle_canvas_state_exported,on_fps_change:this._handle_fps_change,export_state_every_ms:Bt?3e5:21e4,shadow_size:Bt?0:1.5,key:"canvas",className:a.contentCanvas,ref:this._set_canvas_ref,tool:g,canvas_wrapper_padding:8,hide_canvas_content:l,show_original_image_in_background:_&&!0,show_transparent_image_in_background:s,select_mode:y,pencil_mirror_mode:x,hue:v,bucket_threshold:h,color_loss:h,pxl_current_opacity:1,onLoadComplete:this._handle_load_complete,onLoad:this._handle_load,onCanUndoRedoChange:this._handle_can_undo_redo_change,onSizeChange:this._handle_size_change,onCurrentColorChange:this._handle_current_color_change,onSomethingSelectedChange:this._handle_something_selected_change,onImageImportModeChange:this._handle_image_import_mode_change,onPositionChange:this._handle_position_change,onLayersChange:this._handle_layers_change,onFiltersThumbnailChange:this._handle_filters_thumbnail_change,onGameEnd:this._handle_game_end,onRelevantActionEvent:this._handle_relevant_action_event,setCursorFuckYou:this._set_cursor_fuck_you,onRightClick:this._handle_right_click,mine_player_direction:C,pxl_current_color:m,convert_scale:1,default_size:b,ideal_size:b,max_size:1.5*b,fast_drawing:!0,px_per_px:1})),this.drawer_desktop,this.menu)),f.default.createElement("div",{style:{pointerEvents:"all"}},f.default.createElement(E.default,{className:a.perspectiveButton,color:"primary",size:"small",onClick:this._toggle_perspective},L?f.default.createElement(tt.default,null):f.default.createElement(Qe.default,null)),f.default.createElement(w.default,{className:a.saveButton,variant:"text",color:"primary",onClick:this._backup_state},f.default.createElement("span",{id:"saved_at"},"?")," ",f.default.createElement(We.default,null)," ",k<.5?"?":Math.round(10*k)/10," kB"),f.default.createElement(w.default,{disabled:!r,className:a.confirmImportButton,color:"primary",size:"small",onClick:function(){r?n.confirm_import():e._import_image_library()}},f.default.createElement(d.default,null)," ",r?"OK":"Import"),f.default.createElement(E.default,{className:a.zoomOutButton,color:"primary",size:"small",onClick:function(){n.zoom_out()}},f.default.createElement(Pt.default,null)),f.default.createElement(E.default,{className:a.zoomInButton,color:"primary",size:"small",onClick:function(){n.zoom_in()}},f.default.createElement(zt.default,null)),f.default.createElement(w.default,{disabled:!u,variant:"text",color:"primary",size:"small",className:a.redoButton,onClick:function(t){e._redo()}},(-u||"")+" Redo"," ",f.default.createElement(De.default,{style:{transition:"ease-out 225ms transform 25m",transform:"rotate(+"+(360*u+90)+"deg)"}})),f.default.createElement(w.default,{disabled:!c,variant:"text",color:"primary",size:"small",className:a.undoButton,onClick:function(t){e._undo()}},f.default.createElement(De.default,{style:{transition:"ease-out 225ms transform 25ms",transform:"rotate(-"+(360*c+90)+"deg)"}}),(+c||"")+" Undo")),this.drawer_mobile,f.default.createElement(it.default,{keepMounted:!1,open:!!N,object:z,onClose:this._close_library,onSelectImage:this._from_library}),f.default.createElement(At.default,{keepMounted:!1,open:!!F,onClose:this._close_text,onSuccess:this._draw_text}),f.default.createElement(fe.default,{keepMounted:!1,theme_day:B._theme_day,open:!!O,pixel_arts:R?D:{},size:b,on_import_size_change:this._set_import_size,on_pixel_art_delete:this._delete_unsaved_pixel_art,import_JSON_state:this._handle_import_json_state_id,on_upload:this._handle_file_upload,onClose:this._handle_pixel_dialog_create_close}),f.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,contain:"paint size style layout",visibility:"auto"}},f.default.createElement(J.default,{className:a.ripple,ref:this._set_ripple_ref,center:!1,style:{color:T,opacity:I,position:"fixed",width:"100%",height:"100%"}}),f.default.createElement(P.default,{style:{pointerEvents:"all",cursor:"pointer"},onDrag:this._handle_file_upload,className:a.backdrop,open:!!(o||j.length>0||q+1e3>Date.now())},f.default.createElement("div",{className:a.backdropTextContent,style:{fontFamily:'"Industry Book"',textTransform:"uppercase"},onClick:this._continue_download},!q&&!!(o||j.length>0)&&f.default.createElement("h1",null,f.default.createElement(nt.default,{key:i||o,text:"browser"===i?"Laboratory in DANGER!":"LABORATORY PROCESSING",animation_delay_ms:0,animation_duration_ms:200})),!q&&j.length>0&&f.default.createElement("h3",null,f.default.createElement(nt.default,{key:j[0].name,text:"ACTION REQUIRED... "+j[0].name,animation_delay_ms:300,animation_duration_ms:500})),!q&&j.length>0&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/DOWNLOAD.svg",className:a.imageBackdrop})),!q&&j.length>0&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",style:{textShadow:"0px 0px 16px white"},text:"CLICK ON THE SCREEN TO CONTINUE DOWNLOAD!",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"browser"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Doesn't feel like home for our dear code here.",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"browser"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please download an advanced browser.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_ai"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"AI processing your image",animation_delay_ms:300,animation_duration_ms:500})),q&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/ABDUCTION.svg",className:a.imageBackdrop})),q&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"Drop the file to the UFO.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),q&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Ready for a new image abduction?",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_ai"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/MOLECULE.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_ai"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~10sec.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_preload"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Preparing laboratory",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_preload"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/SCIENCE.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_preload"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~"+parseInt(3*parseFloat(b/100))*(Bt?3:1)+"sec.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_load"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Abducting your image",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_load"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/ABDUCTION.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_load"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~"+parseInt(4*parseFloat(b/100))*(Bt?3:1)+"sec.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_render"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/COMPUTING.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_render"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Atomic rendering in process",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_render"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~14sec.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Coupling few color DNA",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/GENOMA.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"less_color"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~4sec.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color_auto"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Coupling the DNA of many color",animation_delay_ms:500,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color_auto"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/GENOMA.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"less_color_auto"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~7sec.",animation_delay_ms:Bt?5e3:2500,animation_duration_ms:500}))))))}}]),t}(f.default.PureComponent),Yt=function(){var e,t=this;this._request_force_update=function(e,a){return e=void 0===e||e,a=void 0!==a&&a,t.sraf.run_frame((function(){return new Promise((function(e,a){t.forceUpdate(e)}))}),!e,!a,Date.now(),"page_pixel").catch((function(){return t._request_force_update(e,a)}))},this._set_fps_and_xy_elements=function(){setTimeout((function(){t.st4te._less_than_1280w?t.setSt4te({_fps_el:{},_xy_el:{}}):t.setSt4te({_fps_el:document.getElementById("fps_el")||{},_xy_el:document.getElementById("xy_el")||{}})}),1e3)},this._prevent_ctrl_zoom=function(e){e.ctrlKey&&e.preventDefault()},this._set_saved_at_element=function(){t.st4te._saved_at_el||t.setSt4te({_saved_at_el:document.getElementById("saved_at")},(function(){var e=setInterval((function(){t.st4te._saved_at_el.innerText=(0,It.t)(t.st4te._saved_at||Date.now(),{mini:!0})}),1e3);t.setSt4te({_saved_at_interval:e})}))},this._try_load_with_payload=function(e){var n,o,i;0===e.length?(ge.default.get_settings(t._process_settings_info_result),setTimeout((function(){t.setSt4te({_is_pixel_dialog_create_open:!(0!==e.length)},(function(){t._compute_menu_drawer(),t._request_force_update()}))}),725)):(n=!!e.startsWith("data:image/png;base64,"),o=n?"image/png":"image/jpeg",i=t.st4te._import_size,t._handle_load("image_preload"),(0,lt.base64_to_bitmap)(e,(function(e){var n,l,_,s,d;te.default.trigger_voice("data_upload"),l=Bt?512:1024,_=parseInt((n=Bt?960:1440)*n),s=Math.min(parseInt(262144),Math.max(parseInt(i*i),parseInt(l*l))),d=Math.min(parseInt(262144),parseInt(i*i)),(0,lt.bitmap_to_imagedata)(e,_,(function(e){(0,m.default)((function(){return Promise.resolve().then(a.t.bind(null,655,7))})).then((function(a){var n=a.QuantiMatGlobal;(0,lt.imagedata_to_base64)(e,o,(function(e){(0,lt.base64_to_bitmap)(e,(function(a){(0,lt.bitmap_to_imagedata)(a,s,(function(a){n(a,256).then((function(a){var n=r(a,6),o=n[0],i=(n[1],n[2],n[3]),l=n[4],_=n[5];null===o?(window.dispatchEvent(new Event("art-upload-browsererror")),t._handle_load_complete("image_preload",{}),t._handle_load("browser"),te.default.trigger_sfx("alert_high-intensity",.6),te.default.jamy_update("flirty"),te.default.trigger_snackbar("That's our end my little buddy! My instinctive dwelling require a browser I am supporting.",6e3),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",.7),te.default.jamy_update("sad"),te.default.trigger_snackbar("Abandon, misfortune, sadness... I can't live in this strange place.",7e3),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",.8),te.default.jamy_update("suspicious"),te.default.trigger_snackbar("Ho no! I just can't, but someone needs to give me back my usual laboratory environment!",7e3),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",.9),te.default.jamy_update("shocked"),te.default.trigger_snackbar("Yes my enjoyable smartness, gladly you hear me now! Everything gonna be alright to look at me!",9e3),setTimeout((function(){te.default.jamy_update("happy"),te.default.trigger_sfx("alert_high-intensity",1),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",1)}),750)}),4e3)}),8e3)}),8e3)}),7e3)):(setTimeout((function(){te.default.trigger_snackbar("I am really awesome, within "+parseFloat(_/1e3).toFixed(3)+"sec. I've made disappears "+i+" colors, now there are "+l+" colors!",5700),setTimeout((function(){te.default.jamy_update("happy")}),2e3)}),15e3),(0,lt.imagedata_to_base64)(o,"image/png",(function(a){(0,lt.base64_to_bitmap)(a,(function(a){(0,lt.bitmap_to_imagedata)(a,d,(function(a){(0,lt.imagedata_to_base64)(a,"image/png",(function(a){var n=new Image;n.addEventListener("load",(function(){t._handle_load_complete("image_preload",{}),t.setSt4te({_kb:0,_saved_at:1/0}),t.st4te._canvas.set_canvas_from_image(n,e,{},!1)}),{once:!0,capture:!0}),n.src=a}))}))}))}),S.default))}),S.default)}))}),S.default)}),S.default)})).catch((function(e){t._handle_load_complete("image_preload",{}),te.default.trigger_snackbar("Be sure to have a recent browser or install Google Chrome for using it.",5700),te.default.jamy_update("angry")}))}))}),S.default))},this._handle_canvas_state_will_export=function(){te.default.trigger_loading_update(0),te.default.jamy_update("suspicious"),te.default.trigger_snackbar("Ok buddy! Saving yours.",1500),window.onbeforeunload=function(e){return"Your content that was being saved will be lost."}},this._handle_canvas_state_exported=function(e){if(te.default.trigger_loading_update(75),te.default.jamy_update("flirty"),te.default.trigger_snackbar("Hold on! Compressing...",1e3),e.kb>.5){var a={};a["json_state-ID"+e.id+".json.lz"]=e,t.setSt4te({_kb:e.kb,_saved_at:Date.now()},(function(){t._compute_menu_drawer(),t._request_force_update(),ge.default.set_settings({},(function(e,t){e&&(te.default.trigger_loading_update(100),te.default.trigger_snackbar("Looks like I can't save your file as our compression module can't load.",5700),te.default.jamy_update("angry"))}),a,c.UJS,S.default,(function(e,t){te.default.trigger_loading_update(100),e?(window.onbeforeunload=function(e){},te.default.trigger_snackbar("Laboratory artwork failed to save.",2e3),te.default.jamy_update("sad")):(window.onbeforeunload=function(e){},setTimeout((function(){setTimeout((function(){te.default.jamy_update("happy")}),500),te.default.trigger_snackbar("Success! Laboratory's artwork saved!",2e3)}),1e3))}))}))}else te.default.trigger_loading_update(100),window.onbeforeunload=function(e){},setTimeout((function(){te.default.trigger_snackbar("Huh, we don't store nearly empty file up here, buddy.",2e3)}),2e3)},this._handle_import_json_state_id=function(e){(0,m.default)((function(){return Promise.resolve().then(a.t.bind(null,691,7))})).then((function(a){var n=a.UJS;t._handle_load("image_preload"),te.default.trigger_voice("accessing_memory"),ge.default.get_settings((function(){}),["json_state-ID"+e+".json.lz"],t._process_settings_attachment_result,n,S.default)})).catch((function(){te.default.trigger_snackbar("Looks like I can't get your file as our compression module can't load.",5700),te.default.jamy_update("angry")}))},this._delete_unsaved_pixel_art=function(e){var a={};a["json_state-ID"+e+".json.lz"]="delete",ge.default.set_settings({},t._process_settings_info_result,a,null,null,(function(a,n){if(a)te.default.trigger_snackbar("DELETION, Failed!",2e3);else{te.default.trigger_snackbar("DELETION, Successful!",2e3),te.default.trigger_sfx("alert_high-intensity");var o=Object.assign({},t.st4te._attachment_previews);delete o["json_state-ID"+e+".json.lz"],t.setSt4te({_attachment_previews:o},(function(){t._request_force_update()}))}}))},this._updated_dimensions=function(){var e=document.documentElement,a=document.body||document.getElementsByTagName("body")[0],n=window.innerWidth||e.clientWidth||a.clientWidth,o=(window.innerHeight||e.clientHeight||a.clientHeight,!!(n<1280));t.setSt4te({_less_than_1280w:o},(function(){t._compute_menu_drawer(),t._compute_menu_drawer(),t._request_force_update(!1,!1).then((function(){t._set_fps_and_xy_elements()}))}))},this._handle_wheel=function(e){var a,n,o=e.deltaY;t.st4te._handle_wheel_timestamp+1500?1:-1,(n=t.st4te._view_name_index+a|0)<0?n=t.st4te._view_name_index=t.st4te._view_names.length-1|0:n%=t.st4te._view_names.length+1|0,t._handle_view_name_change(n,t.st4te._view_name_index,(function(){t.setSt4te({_handle_wheel_timestamp:Date.now()})})))},this._handle_menu_close=function(){t.setSt4te({_menu_mouse_x:null,_menu_mouse_y:null},(function(){t._compute_menu_right_click(),t._request_force_update()}))},this._handle_right_click=function(e,a){a.pxl_color=t.st4te._canvas.get_pixel_color_from_pos(a.pos_x,a.pos_y),t.setSt4te({_menu_mouse_x:e.clientX-2,_menu_mouse_y:e.clientY-4,_menu_data:a,_menu_event:e},(function(){t._compute_menu_right_click(),t._request_force_update()}))},this._set_cursor_fuck_you=function(e){te.default.jamy_update("happy",2500)},this._process_settings_info_result=function(e,a){if(!e&&void 0!==a){var n=void 0!==a.attachment_previews?a.attachment_previews:{};t.setSt4te({_attachment_previews:n},(function(){t._request_force_update()}))}},this._process_settings_attachment_result=function(e,a){var n=t.st4te._canvas.import_JS_state;t._handle_load_complete("image_preload",{}),e?(te.default.trigger_snackbar("Looks like I can't get your file as something was erroneous.",5700),te.default.jamy_update("angry"),t._handle_pixel_dialog_create_open()):(t.setSt4te({_kb:a.kb,_saved_at:Date.now()},(function(){t._request_force_update()})),n(a,(function(){t.setSt4te({_is_pixel_dialog_create_open:!1,_attachment_previews:{}},(function(){t._request_force_update()}))})))},this._handle_view_name_change=function(e){var a,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},_=t.st4te,s=_._view_names,d=_._toolbox_container_ref;i=null===i?t.st4te._view_name_index:i,a=s[e]||s[0],i>(n=-1===s.indexOf(a)?0:s.indexOf(a))?te.default.trigger_sfx("navigation_transition-left"):i2&&void 0!==arguments[2]?arguments[2]:null;("mouse"===e.pointerType&&0===e.button||"mouse"!==e.pointerType)&&(o=(n=t.st4te)._view_names,i=n._toolbox_container_ref,d=null===d?t.st4te._view_name_index:d,r=o[a]||o[0],d>(_=-1===o.indexOf(r)?0:o.indexOf(r))?te.default.trigger_sfx("navigation_transition-left"):te.default.trigger_sfx("navigation_transition-right"),s={},d!==_&&(s._view_name_sub_index=0,i.scrollTop=0),t.setSt4te(l({},s,{_previous_view_name_index:d||t.st4te._view_name_index,_view_name_index:_}),(function(){t._set_props_bypass_this(),t._compute_menu_drawer(),t._request_force_update()})))},this._handle_keydown=function(e){var a,n,o,i,r;if(e.ctrlKey&&(document.getElementsByClassName("MuiInput-root Mui-focused").length?"c"===!e.key&&"v"===!e.key&&(e.preventDefault(),e.stopImmediatePropagation()):(e.preventDefault(),e.stopImmediatePropagation())),n=(a=t.st4te)._tool,o=a._view_name_index,i=a._view_names,r=a._is_pixel_dialog_post_edit_open,e&&!r){if("MINE"===n)switch(e.keyCode){case 38:t.setSt4te({_mine_player_direction:"UP"});break;case 40:t.setSt4te({_mine_player_direction:"DOWN"});break;case 37:t.setSt4te({_mine_player_direction:"LEFT"});break;case 39:t.setSt4te({_mine_player_direction:"RIGHT"})}else switch(e.keyCode){case 37:t._handle_view_name_change(o-1<0?i.length-1:o-1);break;case 39:t._handle_view_name_change(o+1>i.length-1?0:o+1);break;case 38:t._scroll_to_drawer(-1);break;case 40:t._scroll_to_drawer(1)}"1"===e.key?t._handle_view_name_change(0):"2"===e.key?t._handle_view_name_change(1):"3"===e.key?t._handle_view_name_change(2):"4"===e.key?t._handle_view_name_change(3):"5"===e.key?t._handle_view_name_change(4):"6"===e.key?t._handle_view_name_change(5):"7"===e.key?t._handle_view_name_change(6):e.ctrlKey&&"z"===e.key?t._undo():e.ctrlKey&&"y"===e.key?t._redo():e.ctrlKey&&"m"===e.key?t._set_tool("MINE"):e.ctrlKey&&"o"===e.key?t._upload_image():e.ctrlKey&&"i"===e.key?t._handle_file_import():e.ctrlKey||"o"!==e.key?e.ctrlKey||"b"!==e.key?e.ctrlKey||"h"!==e.key?e.ctrlKey||"x"!==e.key?e.ctrlKey||"u"!==e.key?e.ctrlKey||"r"!==e.key?e.ctrlKey&&"r"===e.key?t._set_tool("SELECT RECTANGLE"):e.ctrlKey||"e"!==e.key?e.ctrlKey&&"e"===e.key?t._set_tool("SELECT ELLIPSE"):e.ctrlKey||"l"!==e.key?e.ctrlKey&&"l"===e.key?t._set_tool("SELECT LINE"):e.ctrlKey||"p"!==e.key?e.ctrlKey||"n"!==e.key?e.ctrlKey&&"p"===e.key?t._set_tool("SELECT PIXEL"):e.ctrlKey&&"n"===e.key?t._set_tool("SELECT PENCIL PERFECT"):e.ctrlKey||"m"!==e.key?e.ctrlKey||"f"!==e.key?e.ctrlKey&&"f"===e.key?t._set_tool("SELECT PATH"):e.ctrlKey&&"k"===e.key?t._set_tool("SELECT COLOR THRESHOLD"):e.ctrlKey&&"g"===e.key?t._set_tool("SELECT COLOR"):e.ctrlKey&&"q"===e.key?t._download_image(1):e.ctrlKey&&"s"===e.key?t._download_image(32):"Enter"===e.key?(0,t.st4te._canvas.confirm_import)():e.ctrlKey?n.includes("SELECT")?(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_select_mode("REMOVE")):(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_tool("PICKER",!1)):"Shift"===e.key&&(n.includes("SELECT")?(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_select_mode("ADD")):(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_tool("MOVE",!1))):t._set_tool("CONTOUR"):t._set_tool("SET PENCIL MIRROR"):t._set_tool("PENCIL PERFECT"):t._set_tool("PENCIL"):t._set_tool("LINE"):t._set_tool("ELLIPSE"):t._set_tool("RECTANGLE"):t._set_tool("BORDER"):t._set_tool("EXCHANGE"):t._set_tool("HUE BUCKET"):t._set_tool("BUCKET"):t._set_tool("PICKER")}},this._undo=function(){(100*Math.random()|0)>90&&te.default.trigger_snackbar("That was a nice undo!"),t.st4te._canvas.undo()},this._redo=function(){(100*Math.random()|0)>95&&(te.default.jamy_update("suspicious"),te.default.trigger_snackbar("Even nicer redo! Doo,doo,doo...",2500),setTimeout((function(){te.default.jamy_update("annoyed"),te.default.trigger_snackbar("Did I already said that today? I won't feel much smarter today.",3500),setTimeout((function(){te.default.jamy_update("shocked"),te.default.trigger_snackbar("No, huh!? I have feelings.",2500),setTimeout((function(){te.default.jamy_update("flirty"),te.default.trigger_snackbar("I am a real booooy! Yuhhh!")}),3e3)}),4e3)}),3e3)),t.st4te._canvas.redo()},this._set_png_compressors=function(){var e=t.st4te._canvas.set_png_compressors;return new Promise((function(t,n){(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(a){var n=a.png_quant;e(n),t()}))}))},this._backup_state=function(){var e=t.st4te._canvas,n=e.export_state,o=e.set_png_compressors;(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(e){var t=e.png_quant;o(t),n()}))},this._download_image=function(e){window.dispatchEvent(new Event("art-download-raster"+e)),(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(a){var n=a.png_quant,o=t.st4te._canvas,i=o.get_base64_png_data_url,r=o.set_png_compressors;void 0!==i&&void 0!==r&&(r(n),i(e,!1,1,100,100).then((function(a){var n=a.hash,o=a.url,i=document.createElement("a");i.download="PIXA-"+n+"-PIXELATED-"+e+"x_RAS.png",i.href=o,i.click(),i.remove(),t._propose_selling_nft()})))}))},this._download_svg=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"xbrz",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=t.st4te._canvas,_=l.get_base64_png_data_url,s=l.set_png_compressors,d=l.xxhashthat;window.dispatchEvent(new Event("art-download-vector"+e.toLowerCase())),te.default.trigger_voice("please_wait"),te.default.trigger_snackbar("Please wait... Files will download in a few seconds.",5700),te.default.jamy_update("happy"),t.setSt4te({_loading:!0,_loading_process:"image_render"},(function(){(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(l){var c=l.png_quant;(0,m.default)((function(){return a.e(6).then(a.t.bind(null,719,7))})).then((function(a){var l=a.oxi_png;s(c,l),_(1,!0,1,100,100).then((function(a){var l=a.url,_=a.colors,s=d(l),c=t.st4te._files_waiting_download;c.push({name:"PIXA-"+s+"-PIXELATED-1x_RAS.png",url:l}),t.setSt4te({_files_waiting_download:c},(function(){t._request_force_update()})),te.default.trigger_voice("processing"),(0,rt.base64png_to_xbrz_svg)(l,(function(a,n,o,i){var l=t.st4te._files_waiting_download;l.push({name:"PIXA-"+s+"-"+e.toUpperCase()+"-"+n+"x_RAS.png",url:""+a}),t.setSt4te({_files_waiting_download:l},(function(){t._request_force_update(),r?(0,_t.postJSON)("https://real-life-image.pixa-pics.workers.dev/init",""+a,(function(e,a){a&&(0,_t.postJSON)("https://real-life-image.pixa-pics.workers.dev/get",""+a,(function(e,a){a&&a.split(" ").forEach((function(e){fetch(e).then((function(e){e.blob().then((function(e,a){new Promise((function(t,a){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){var a=URL.createObjectURL(e);t(a)},n.readAsDataURL(e)})).then((function(e){l.push({name:"PIXA-"+s+"-PHOTO-REAL-BIG+AI_RAS-#"+a+".jpg",url:""+e}),t.setSt4te({_files_waiting_download:l},t._request_force_update)}))}))}))}))}),"application/text")}),"application/text"):(te.default.trigger_snackbar("Looks like we had an unexpected issue",5700),te.default.jamy_update("angry"))}))}),(function(a,n){if(a.length>0){var o=t.st4te._files_waiting_download;o.push({name:"PIXA-"+s+"-"+e.toUpperCase()+"-"+n+"x_VEC.svg",url:a}),t.setSt4te({_files_waiting_download:o},(function(){t._request_force_update()}))}t.setSt4te({_loading:!1,_loading_process:""},(function(){t._propose_selling_nft()}))}),(function(a,n){if(a.length>0){var o=t.st4te._files_waiting_download;o.push({name:"PIXA-"+s+"-"+e.toUpperCase()+"-"+n+"+CRT.png",url:a}),t.setSt4te({_files_waiting_download:o},(function(){t._request_force_update()}))}}),Array.from(_),e,!!n,!!o,!!i)}))}))}))}))},this._propose_selling_nft=function(){te.default.trigger_voice("complete"),te.default.trigger_sfx("hero_decorative-celebration-02"),te.default.trigger_snackbar("Fantastic!",1500),setTimeout((function(){te.default.trigger_share(),window.dispatchEvent(new Event("home-action-tryshare")),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity"),te.default.trigger_snackbar("Your unique and stunning pixel art can now be turned into a valuable digital asset through the power of blockchain technology.",7e3),setTimeout((function(){te.default.trigger_sfx("hero_decorative-celebration-02"),te.default.trigger_snackbar("Sell your pixel art as an NFT on your favourite platform and become a part of the growing NFT community.",9e3)}),8e3)}),2e3)}),2e3)},this._continue_download=function(){var e,a,n=t.st4te._files_waiting_download;n.length>0&&(e=n.shift(),(a=document.createElement("a")).download=""+e.name,a.href=""+e.url,a.click(),delete e.url,delete e.name,a.remove(),t.setSt4te({_files_waiting_download:n},(function(){t._request_force_update()})))},this._handle_keyup=function(e){var a,n,o,i,r;e.ctrlKey&&(document.getElementsByClassName("MuiInput-root Mui-focused").length?"c"===!e.key&&"v"===!e.key&&(e.preventDefault(),e.stopImmediatePropagation()):(e.preventDefault(),e.stopImmediatePropagation())),a=t.st4te._is_pixel_dialog_post_edit_open,e&&!a&&(o=(n=t.st4te)._tool,i=n._memory_tool,r=n._previous_tool_timestamp,i&&i!==o&&Date.now()-1e40&&(a.preventDefault(),a.stopPropagation()),t.st4te._drag_file&&t.setSt4te({_drag_file:0},(function(){t._request_force_update()})),n=(a.target||{}).files||(a.srcElement||{}).files||(a.currentTarget||{}).files||((a.path||[])[0]||{}).files||(a.dataTransfer||{}).files||[],i=n[0]||null,r=null;for(l=0;lv;)y-=.01;(0,lt.base64_sanitize)(a,(function(e){(0,lt.base64_to_bitmap)(e,(function(e){(0,lt.bitmap_to_imagedata)(e,e.width*e.height|0,(function(e){(0,lt.imagedata_to_base64)(e,"image/png",(function(e){var n=new Image;n.addEventListener("load",(function(){t._handle_load_complete("image_preload",{}),t.setSt4te({_kb:0,_saved_at:1/0}),h(n,a,{},!1),setTimeout((function(){te.default.trigger_snackbar("I am really awesome, here is your pixel art!",5700),setTimeout((function(){te.default.jamy_update("happy")}),2e3)}),1e3)}),{once:!0,capture:!0}),n.src=e}),S.default)}),S.default)}),S.default)}),null,y,"doppel")}),S.default)}),S.default);case 3:case"end":return e.stop()}}),e,t)})));return function(t){return e.apply(this,arguments)}}(),0===parseInt(p)?w(r).then((function(){})):(x=function(){var e=o(regeneratorRuntime.mark((function e(t){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return te.default.jamy_update("angry"),te.default.trigger_voice("processing"),te.default.trigger_loading_update(10),te.default.jamy_update("annoyed",8e3),te.default.trigger_loading_update(20),setTimeout((function(){te.default.jamy_update("annoyed",8e3),te.default.trigger_loading_update(20)}),5e3),e.next=8,_.run(t,1).catch((function(){return s.run(t)}));case 8:return a=e.sent,te.default.trigger_snackbar("IMAGE: "+a,5e3),e.abrupt("return",d.run(t,a).then((function(e){return te.default.jamy_update("flirty",666),te.default.trigger_loading_update(100),te.default.trigger_snackbar("Receiving results (3 sec)"),te.default.jamy_update("happy",666),te.default.trigger_sfx("alert_high-intensity",1,"md"),te.default.trigger_loading_update(0),te.default.trigger_snackbar("AI Processing [OK]"),E._handle_load_complete("image_ai",{}),E._handle_load("image_preload"),Promise.resolve(e)})).catch((function(){return te.default.trigger_loading_update(0),te.default.trigger_snackbar("AI PROCESSING FAILED! Fallback to normal mode."),E._handle_load_complete("image_ai",{}),E._handle_load("image_preload"),Promise.resolve(t)})));case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),E=t,t._handle_load("image_ai"),x(r).then((function(e){w(e)}))));case 12:case"end":return e.stop()}}),e,t)}))),function(t){return e.apply(this,arguments)}),this._handle_file_import=function(e){var a,n,o,i,r=(e.target||{}).files||(e.srcElement||{}).files||(e.currentTarget||{}).files||((e.path||[])[0]||{}).files||[],l=(r[0],null);for(a=0;aDate.now()-60&&t._backup_state(),t._updated_dimensions()}))})),"less_color"===e||"less_color_auto"===e?0!==a.colors_removed&&(te.default.trigger_snackbar("I am a magician! And "+a.colors_removed+" colors are now gone, only "+a.colors_remaining+" remaining."),te.default.trigger_sfx("navigation_selection-complete-celebration"),te.default.jamy_update("happy")):"image_load"===e&&(a.only_scan?te.default.trigger_sfx("ui_scan"):(te.default.trigger_sfx("ui_scan"),te.default.trigger_snackbar("DONE! We've imported an image with my now "+a.number_of_colors+" colors."),setTimeout((function(){te.default.trigger_voice("complete")}),1e3),te.default.jamy_update("happy"),t._handle_edit_drawer_close(),t._handle_menu_close(),t._handle_pixel_dialog_create_close()))},this._set_ripple_ref=function(e){null!=e&&t.setSt4te({_ripple:e})},this._set_canvas_ref=function(e){null!=e&&t.setSt4te({_canvas:e,_filters:e.get_filter_names()},(function(){t._request_force_update()}))},this._handle_position_change=function(e){var a,n;void 0!==t.st4te._xy_el&&(a=-1===e.x?"out":e.x+1,n=-1===e.y?"out":e.y+1,t.st4te._xy_el.textContent=" | X: "+a+", Y: "+n+" ")},this._handle_fps_change=function(e){void 0!==t.st4te._fps_el&&(t.st4te._fps_el.textContent="FPS: "+e)},this._handle_can_undo_redo_change=function(e,a){e=parseInt(e),a=parseInt(a);var n=!(t.st4te._can_undo===e&&t.st4te._can_redo===a);t.setSt4te({_can_undo:e,_can_redo:a},(function(){n&&t._request_force_update()}))},this._handle_size_change=function(e,a){var n=!(t.st4te._width===e&&t.st4te._height===a);t.setSt4te({_width:e,_height:a},(function(){n&&(t._compute_menu_drawer(),t._request_force_update())}))},this._handle_current_color_change=function(e,a){e=void 0!==e.rgb?Ht.new_of(e.rgb.r,e.rgb.g,e.rgb.b,Math.round(parseInt(255*e.rgb.a))).hex:Ht.new_hex(e).hex;var n=Ht.new_hex(e).hsla[0];t.setSt4te({_current_color:e,_hue:n})},this._handle_relevant_action_event=function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#ffffff",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t.st4te._ripple;e&&o&&(te.default.trigger_sfx("navigation_selection-complete-celebration"),0!==n&&t.setSt4te({_ripple_color:a,_ripple_opacity:n},(function(){setTimeout((function(){o.start(e)}),25),setTimeout((function(){o.stop(e)}),200)})))},this._handle_something_selected_change=function(e){var a=!(t.st4te._is_something_selected===e);t.setSt4te({_is_something_selected:e},(function(){a&&(t._compute_menu_right_click(),t._request_force_update())}))},this._set_value_from_slider_with_update=function(e,a){t.setSt4te({_slider_value:a||e.target.value},(function(){t._set_props_bypass_this()}))},this._set_width_from_slider=function(e,a){t.setSt4te({_slider_value_width:a||e.target.value},(function(){t._set_props_bypass_this()}))},this._set_height_from_slider=function(e,a){t.setSt4te({_slider_value_height:a||e.target.value},(function(){t._set_props_bypass_this()}))},this._set_import_size=function(e,a){t.setSt4te({_import_size:a||e.target.value})},this._set_import_colorize=function(e,a){t.setSt4te({_import_colorize:a||e.target.value})},this._revert_tool=function(){t.setSt4te({_tool:t.st4te._memory_tool})},this._set_tool=function(e){var a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.setSt4te({_tool:e.toUpperCase()},(function(){t._set_props_bypass_this()})),a&&t.setSt4te({_memory_tool:e.toUpperCase()})},this._set_select_mode=function(e){t.setSt4te({_select_mode:e.toUpperCase()},(function(){t._set_props_bypass_this()}))},this._set_pencil_mirror_mode=function(e){t.setSt4te({_pencil_mirror_mode:e.toUpperCase()},(function(){t._set_props_bypass_this()}))},this._switch_with_second_color=function(){var e=t.st4te,a=e._current_color,n=e._second_color;t.setSt4te({_current_color:n,_second_color:a},(function(){t._set_props_bypass_this()}))},this._show_hide_canvas_content=function(){t.setSt4te({_hide_canvas_content:!t.st4te._hide_canvas_content},(function(){t._set_props_bypass_this(),t.forceUpdate()}))},this._show_hide_background_image=function(){t.setSt4te({_show_original_image_in_background:!t.st4te._show_original_image_in_background},(function(){t._set_props_bypass_this()}))},this._show_hide_transparent_image=function(){t.setSt4te({_show_transparent_image_in_background:!t.st4te._show_transparent_image_in_background},(function(){t._set_props_bypass_this()}))},this._handle_image_import_mode_change=function(e){t.setSt4te({_is_image_import_mode:e},(function(){t._set_props_bypass_this(),t._request_force_update()}))},this._handle_layers_change=function(e,a){t.setSt4te({_previous_layer_index:parseInt(t.st4te._layer_index),_layer_index:parseInt(e),_layers:a},(function(){t._set_props_bypass_this()}))},this._handle_filters_thumbnail_change=function(e,a,n){t.st4te._swipeable_drawer_handle_filters_thumbnail_change(e,a,n)},this._set_filters_callback=function(e){t.setSt4te({_swipeable_drawer_handle_filters_thumbnail_change:e})},this._set_props_callback=function(e){t.setSt4te({_swipeable_drawer_set_props:e},(function(){t._set_props_bypass_this(),t._request_force_update()}))},this._set_props_bypass_this=function(){var e=t.st4te,a=e._view_name_index,n=e._previous_view_name_index,o=e._layers,i=e._layer_index,r=e._hide_canvas_content,l=e._show_original_image_in_background,_=e._show_transparent_image_in_background,s=e._hue,d=e._current_color,c=e._second_color,u=e._slider_value,m=e._tool,p=e._width,f=e._height,h=e._filters,g=e._select_mode,b=e._pencil_mirror_mode,v=e._is_something_selected,y=e._is_image_import_mode,w=e._import_size,x=e._import_colorize,E=e._slider_value_width,k=e._slider_value_height;t.st4te._canvas&&t.st4te._canvas._set_props({tool:m,hide_canvas_content:r,show_original_image_in_background:l&&!0,show_transparent_image_in_background:_,select_mode:g,pencil_mirror_mode:b,hue:s,bucket_threshold:u,color_loss:u,pxl_current_color:d,default_size:w,ideal_size:w,max_size:1.5*w}),t.st4te._swipeable_drawer_set_props({view_name_index:a%7,previous_view_name_index:n%7,layers:o,layer_index:i,hide_canvas_content:r,show_original_image_in_background:l,show_transparent_image_in_background:_,hue:s,current_color:d,second_color:c,slider_value:parseFloat(u),slider_value_width:E,slider_value_height:k,tool:m,width:parseInt(p),height:parseInt(f),filters:h,select_mode:g,pencil_mirror_mode:b,is_something_selected:v,is_image_import_mode:y,import_size:w,import_colorize:x})},this._handle_game_end=function(){t.setSt4te({_game_ended:!0},(function(){setTimeout((function(){t.setSt4te({_game_ended:!1})}),5e3)}))},this._handle_edit_drawer_open=function(e,a){var n,o,i,r,l,_,s;a=void 0!==a?a:t.st4te._view_name_index,n=!(t.st4te._view_name_index!==a)&&t.st4te._is_edit_drawer_open,o=t.st4te._toolbox_container_ref,i=!0,r=void 0,n&&null!==o?(l="swipetoolbox_i_"+a+"_"+(r=t.st4te._view_name_sub_index||0),r++,null!==(_=(document.getElementsByClassName(l)||[])[0]||null)?o.scrollTop=_.offsetTop:(r=0,o.scrollTop=0)):(r=0,o.scrollTop=0),s=!(t.st4te._is_edit_drawer_open===i&&t.st4te._view_name_index===a),t.setSt4te({_is_edit_drawer_open:i,_view_name_index:a,_view_name_sub_index:r},(function(){s&&(t._compute_menu_drawer(),t._request_force_update())}))},this._handle_edit_drawer_close=function(){var e=!!t.st4te._is_edit_drawer_open;t.setSt4te({_is_edit_drawer_open:!1},(function(){e&&(t._compute_menu_drawer(),t._request_force_update())}))},this._set_current_color=function(e){t._handle_menu_close(),t.setSt4te({_current_color:e},(function(){t._set_props_bypass_this()}))},this._exchange_pixel_colors=function(e,a,n){var o=t.st4te._canvas.exchange_pixel_color,i=t.st4te._menu_data;o(e,a,n),i.pxl_color=n,t._handle_menu_close(),t.setSt4te({_menu_data:i})},this._to_auto_medium_more_contrast=function(){(0,t.st4te._canvas.auto_adjust_contrast)(.2),te.default.trigger_voice("enhanced")},this._to_auto_medium_more_saturation=function(){(0,t.st4te._canvas.auto_adjust_saturation)(.2),te.default.trigger_voice("enhanced")},this._less_colors_auto=function(){var e=t.st4te,a=e._layers,n=e._layer_index,o=t.st4te._canvas.to_less_color;te.default.trigger_voice("please_wait"),(a[n]||{}).number_of_colors,o("auto")},this._get_average_color_of_selection=function(){var e=(0,t.st4te._canvas.get_average_color_of_selection)();t._handle_current_color_change(e)},this._handle_pixel_dialog_create_close=function(){t.setSt4te({_is_pixel_dialog_create_open:!1,_attachment_previews:{}},(function(){t._request_force_update()}))},this._handle_pixel_dialog_create_open=function(){!1===t.st4te._is_pixel_dialog_create_open&&te.default.trigger_sfx("hero_decorative-celebration-02"),ge.default.get_settings(t._process_settings_info_result),setTimeout((function(){t.setSt4te({_is_pixel_dialog_create_open:!0},(function(){t._request_force_update()}))}),725)},this._set_toolbox_container_ref=function(e){null!=e&&t.setSt4te({_toolbox_container_ref:e})},this._set_root_ref=function(e){null!=e&&t.setSt4te({_root_ref:e},(function(){t.st4te._root_ref.addEventListener("drop",t._handle_file_upload,{capture:!0}),t.st4te._root_ref.addEventListener("dragenter",t._drop_start),t.st4te._root_ref.addEventListener("dragover",t._drop_start),t.st4te._root_ref.addEventListener("dragleave",t._drop_end)}))},this._drop_start=function(e){e.preventDefault(),e.stopPropagation(),t.setSt4te({_drag_file:Date.now()},(function(){t._request_force_update()}))},this._drop_end=function(e){e.preventDefault(),e.stopPropagation(),t.st4te._drag_file&&t.setSt4te({_drag_file:0},(function(){t._request_force_update()}))},this._scroll_to_drawer=function(e){var a,n,o,i;if((""+e).startsWith("swipetoolbox_i_"))a=(document.getElementsByClassName(e)||[])[0]||null,t.st4te._toolbox_container_ref.scrollTop=null!==a?a.offsetTop:0;else{for(n=t.st4te._toolbox_container_ref.scrollTop,o=(document.getElementsByClassName("swipetoolbox_i_"+t.st4te._view_name_index+"_0")||[])[0]||{},i=1;o;){if(!(n>o.offsetTop)){o=(document.getElementsByClassName("swipetoolbox_i_"+t.st4te._view_name_index+"_"+(i-1+e))||[])[0]||{};break}o=(document.getElementsByClassName("swipetoolbox_i_"+t.st4te._view_name_index+"_"+i++)||[])[0]||{}}t.st4te._toolbox_container_ref.scrollTop=o.offsetTop||0}},this._toggle_perspective=function(){var e=!t.st4te._perspective;e?(te.default.trigger_voice("vision_activated"),t._set_tool("MOVE",!1)):(te.default.trigger_voice("vision_deactivated"),t._revert_tool()),t.setSt4te({_perspective:e},(function(){t._request_force_update()}))},this._smooth_adjust=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;(0,t.st4te._canvas.smooth_adjust)(e)},this._close_text=function(){t.setSt4te({_text_dialog_open:!1},(function(){t._request_force_update()}))},this._open_text=function(){t.setSt4te({_text_dialog_open:!0},(function(){t._request_force_update()}))},this._draw_text=function(e,a){t._close_text(),(0,t.st4te._canvas.write_text)(e,a)},this._resume_video=function(){try{document.getElementById("labintro-video").play()}catch(e){}},this._compute_menu_right_click=function(){var e=t.st4te,a=e.classes,n=e._canvas,o=e._current_color,i=e._tool,r=e._width,l=e._height,_=e._pencil_mirror_mode,s=e._is_something_selected,d=e._menu_mouse_y,c=e._menu_mouse_x,u=e._menu_data,m=e._menu_event;u.pos_x=-1===u.pos_x?"out":u.pos_x,u.pos_y=-1===u.pos_y?"out":u.pos_y,t.menu=f.default.createElement(K.default,{className:a.contextMenuFuckYouDisable,PaperProps:{style:{maxHeight:380,width:240,overflowY:"overlay",contain:"paint style layout",scrollBehavior:"smooth",userSelect:"none",pointerEvents:d||c?"all":"none"}},onContextMenu:function(e){e.preventDefault()},MenuListProps:{dense:!0},transitionDuration:{enter:125,exit:250},open:!!d||!!c,onClose:t._handle_menu_close,disablePortal:!1,keepMounted:!0,anchorReference:"anchorPosition",anchorPosition:{top:0|d,left:0|c}},f.default.createElement("span",{style:{textAlign:"left",padding:"12px 8px",color:"#666"}},"X: ",u.pos_x,", Y: ",u.pos_y),f.default.createElement("div",{style:"SET PENCIL MIRROR"===i||"NONE"!==_?{}:{display:"none"}},f.default.createElement(U.default,{className:a.contextMenuSubheader},"Tools"),f.default.createElement(I.default,{button:!0,divider:!0,disabled:"PENCIL"===i,onClick:function(){t._set_tool("PENCIL")}},f.default.createElement(Z.default,null,f.default.createElement(Ve.default,null)),f.default.createElement(X.default,{primary:"Pencil"})),f.default.createElement(I.default,{button:!0,divider:!0,disabled:"PENCIL PERFECT"===i,onClick:function(){t._set_tool("PENCIL PERFECT")}},f.default.createElement(Z.default,null,f.default.createElement(Ye.default,null)),f.default.createElement(X.default,{primary:"Pencil perfect"})),f.default.createElement(U.default,{className:a.contextMenuSubheader},"Mirror mode"),[{icon:f.default.createElement(qe.default,null),disabled:"NONE"===_,text:"None",on_click:function(){t._set_pencil_mirror_mode("NONE")}},{icon:f.default.createElement(qe.default,null),disabled:"VERTICAL"===_,text:"Vertical",on_click:function(){t._set_pencil_mirror_mode("VERTICAL")}},{icon:f.default.createElement(qe.default,null),disabled:"HORIZONTAL"===_,text:"Horizontal",on_click:function(){t._set_pencil_mirror_mode("HORIZONTAL")}},{icon:f.default.createElement(qe.default,null),disabled:"BOTH"===_,text:"Both",on_click:function(){t._set_pencil_mirror_mode("BOTH")}}].map((function(e){return f.default.createElement(I.default,{key:e.text,button:!0,divider:!0,disabled:e.disabled,onClick:e.on_click},f.default.createElement(Z.default,null,e.icon),f.default.createElement(X.default,{primary:e.text}))}))),f.default.createElement("div",{style:s?{}:{display:"none"}},f.default.createElement(U.default,{className:a.contextMenuSubheader},"Apply to selection"),[{icon:f.default.createElement($e.default,null),text:"Unselect",on_click:function(){n.to_selection_none()}},{icon:f.default.createElement(Ne.default,null),text:"Colorize dynamical",on_click:function(){n.to_selection_changes(o,!1)}},{icon:f.default.createElement(Ge.default,null),text:"Get average color",on_click:function(){t._get_average_color_of_selection()}},{icon:f.default.createElement(Ce.default,null),text:"Shrink",on_click:function(){n.to_selection_size(-1)}},{icon:f.default.createElement(Ce.default,null),text:"Grow",on_click:function(){n.to_selection_size(1)}},{icon:f.default.createElement(Te.default,null),text:"Border",on_click:function(){n.to_selection_border()}},{icon:f.default.createElement(Ne.default,null),text:"Bucket",on_click:function(){n.to_selection_bucket()}},{icon:f.default.createElement(Ce.default,null),text:"Crop",on_click:function(){n.to_selection_crop()}},{icon:f.default.createElement(Oe.default,null),text:"Invert",on_click:function(){n.to_selection_invert()}},{icon:f.default.createElement(Me.default,null),text:"Copy",on_click:function(){n.copy_selection()}},{icon:f.default.createElement(je.default,null),text:"Cut",on_click:function(){n.cut_selection()}},{icon:f.default.createElement(Be.default,null),text:"Erase",on_click:function(){n.erase_selection()}}].map((function(e){return f.default.createElement(I.default,{key:e.text,button:!0,divider:!0,onClick:e.on_click},f.default.createElement(Z.default,null,e.icon),f.default.createElement(X.default,{primary:e.text}))}))),f.default.createElement(U.default,{style:null===u.pxl_color?{display:"none"}:{},className:a.contextMenuSubheader},"Color"),f.default.createElement(I.default,{button:!0,divider:!0,style:null===u.pxl_color?{display:"none"}:{},disabled:u.pxl_color===o||null===u.pxl_color,onClick:function(e){t._set_current_color(u.pxl_color),t._handle_relevant_action_event(m,u.pxl_color,1,!0)}},f.default.createElement(Z.default,null,f.default.createElement(ie.default,{style:{color:u.pxl_color,background:"repeating-conic-gradient(#80808055 0% 25%, #00000000 0% 50%) 50% / calc(200% / "+r+") calc(200% / "+l+")"}})),f.default.createElement(X.default,{primary:"Pick color"})),f.default.createElement(I.default,{button:!0,divider:!0,style:null===u.pxl_color?{display:"none"}:{},disabled:u.pxl_color===o||null===u.pxl_color,onClick:function(e){t._exchange_pixel_colors(u.pos_x,u.pos_y,o+""),t._handle_relevant_action_event(m,o,1,!0)}},f.default.createElement(Z.default,null,f.default.createElement(ie.default,{style:{color:o,background:"repeating-conic-gradient(#80808055 0% 25%, #00000000 0% 50%) 50% / calc(200% / "+r+") calc(200% / "+l+")"}})),f.default.createElement(X.default,{primary:"Replace color"})),f.default.createElement(U.default,{className:a.contextMenuSubheader},"Effect"),f.default.createElement(I.default,{button:!0,divider:!0,onClick:function(e){return t._to_auto_medium_more_contrast()}},f.default.createElement(Z.default,null,f.default.createElement(ve.default,null)),f.default.createElement(X.default,{primary:"Increase contrast"})),f.default.createElement(I.default,{button:!0,divider:!0,onClick:function(e){return t._to_auto_medium_more_saturation()}},f.default.createElement(Z.default,null,f.default.createElement(ve.default,null)),f.default.createElement(X.default,{primary:"Increase saturation"})),f.default.createElement(I.default,{button:!0,divider:!0,onClick:function(e){return t._handle_edit_drawer_open(null,6)}},f.default.createElement(Z.default,null,f.default.createElement(ne.default,null)),f.default.createElement(X.default,{primary:"Add a filter"})),f.default.createElement(I.default,{button:!0,divider:!0,onClick:function(e){n._to_less_color("0.9")}},f.default.createElement(Z.default,null,f.default.createElement(we.default,null)),f.default.createElement(X.default,{primary:"Remove 10% of all colors"})),f.default.createElement(I.default,{button:!0,divider:!0,onClick:t._less_colors_auto},f.default.createElement(Z.default,null,f.default.createElement(we.default,null)),f.default.createElement(X.default,{primary:"Remove automatically some colors"})),f.default.createElement(I.default,{button:!0,divider:!0,onClick:function(e){return t._smooth_adjust(1)}},f.default.createElement(Z.default,null,f.default.createElement(Ee.default,null)),f.default.createElement(X.default,{primary:"Smooth a bit"})))},this._compute_menu_drawer=function(){var e=t.st4te,a=e.classes,n=e._canvas,o=e._view_name_index,i=e._previous_view_name_index,r=e._view_names,l=e._layers,_=e._layer_index,s=e._is_image_import_mode,d=e._hide_canvas_content,c=e._show_original_image_in_background,u=e._show_transparent_image_in_background,m=e._can_undo,p=e._can_redo,h=e._current_color,g=e._second_color,b=e._slider_value,v=e._tool,y=e._width,w=e._height,x=e._import_size,E=e._import_colorize,k=e._hue,C=e._filters,S=e._select_mode,T=e._pencil_mirror_mode,I=e._is_something_selected,N=e._is_edit_drawer_open,O=e._menu_data,P=e._less_than_1280w,M=e._slider_value_width,D=e._slider_value_height;O.pos_x=-1===O.pos_x?"out":O.pos_x,O.pos_y=-1===O.pos_y?"out":O.pos_y,P?t.drawer_mobile=f.default.createElement(f.default.Fragment,null,f.default.createElement(L.default,{className:a.contentDrawer,disableBackdropTransition:!1,disableSwipeToOpen:!1,disableDiscovery:!1,disablePortal:!0,keepMounted:!0,hysteresis:.314,minFlingVelocity:314,swipeAreaWidth:128,open:!!N,onOpen:t._handle_edit_drawer_open,onClose:t._handle_edit_drawer_close,classes:{paper:a.swipeableDrawerPaper,modal:a.drawerModal},transitionDuration:{appear:5,enter:50,exit:75},ModalProps:{disablePortal:!0,BackdropProps:{classes:{root:a.drawerModalBackdropRoot}}},variant:"temporary",anchor:"bottom",style:{pointerEvents:"all"}},f.default.createElement("div",{className:a.mobileintrovideowrapper},f.default.createElement("video",{className:a.mobileintrovideo,id:"labintro-video",width:"56",height:"56",onClick:t._resume_video,style:{aspectRatio:"1",transform:"translateZ(10px)"}},f.default.createElement("source",{src:"/src/videos/labintro.mp4",type:"video/mp4"}))),f.default.createElement(le.default,{onClick:t._handle_edit_drawer_close}),f.default.createElement("div",{style:{display:"grid",contain:"layout paint style"}},f.default.createElement("div",{style:{boxShadow:"rgb(0 0 0 / 20%) 0px 2px 4px -1px, rgb(0 0 0 / 14%) 0px 4px 5px 0px, rgb(0 0 0 / 12%) 0px 1px 10px 0px",zIndex:1}},f.default.createElement("div",{className:a.drawerHeader},f.default.createElement(z.default,{className:a.effectSliderText,id:"strength-slider",gutterBottom:!0},"Effect strength :"),f.default.createElement(A.default,{key:"slider-"+(255*b|0),className:a.effectSlider,defaultValue:parseFloat(b),step:1/255,min:0,max:1,onChangeCommitted:t._set_value_from_slider_with_update,"aria-labelledby":"strength-slider"}))),f.default.createElement("div",{className:a.drawerContainer,ref:t._set_toolbox_container_ref},f.default.createElement(me.default,{should_update:N,slider_value_width:M,slider_value_height:D,onActionClose:t._handle_edit_drawer_close,canvas:n,is_mobile:Bt,view_class:a.listOfTools,view_names:r,is_image_import_mode:s,can_undo:m,can_redo:p,view_name_index:o,previous_view_name_index:i,layers:l,layer_index:_,hide_canvas_content:d,show_original_image_in_background:c,show_transparent_image_in_background:u,hue:k,current_color:h,second_color:g,slider_value:b,tool:v,width:parseInt(y),height:parseInt(w),filters:C,select_mode:S,pencil_mirror_mode:T,is_something_selected:I,import_size:x,import_colorize:E,set_filters_callback:t._set_filters_callback,set_props_callback:t._set_props_callback,set_tool:t._set_tool,set_select_mode:t._set_select_mode,set_pencil_mirror_mode:t._set_pencil_mirror_mode,set_width_from_slider:t._set_width_from_slider,set_height_from_slider:t._set_height_from_slider,set_import_size:t._set_import_size,set_import_colorize:t._set_import_colorize,switch_with_second_color:t._switch_with_second_color,show_hide_canvas_content:t._show_hide_canvas_content,show_hide_background_image:t._show_hide_background_image,show_hide_transparent_image:t._show_hide_transparent_image,on_current_color_change:t._handle_current_color_change,on_view_name_change:t._handle_view_name_change,on_upload_image:function(e){window.dispatchEvent(new Event("art-upload-drawer")),t._upload_image(e)},on_upload_image_library:t._upload_image_library,on_import_image:function(e){window.dispatchEvent(new Event("art-import-drawer")),t._handle_file_import(e)},on_import_image_library:t._import_image_library,on_request_draw_text:t._open_text,on_download_image:t._download_image,on_download_svg:t._download_svg,on_scroll_to:t._scroll_to_drawer})))),f.default.createElement("div",{className:a.fatabs,style:N&&P?{transform:"translateY(24px)",backgroundColor:"#fff"}:{}},f.default.createElement(F.default,{className:a.tabs,style:{pointerEvents:"all"},variant:"fullWidth",scrollButtons:"off",indicatorColor:"primary",textColor:"primary",selectionFollowsFocus:!0,value:o,onChange:t._handle_edit_drawer_open},f.default.createElement(H.default,{className:a.tab,label:"colors",icon:f.default.createElement(dt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"image",icon:f.default.createElement(ut.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"layers",icon:f.default.createElement(pt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"tools",icon:f.default.createElement(ht.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"select",icon:f.default.createElement(bt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"effects",icon:f.default.createElement(yt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"filters",icon:f.default.createElement(xt.default,null)})))):t.drawer_desktop=f.default.createElement(R.default,{className:a.contentDrawerFixed,variant:"permanent",anchor:"right",classes:{paper:a.drawerPaper}},f.default.createElement("div",{style:{display:"contents",pointerEvents:"all"}},f.default.createElement("div",{style:{boxShadow:"rgb(0 0 0 / 20%) 0px 2px 4px -1px, rgb(0 0 0 / 14%) 0px 4px 5px 0px, rgb(0 0 0 / 12%) 0px 1px 10px 0px",zIndex:1}},f.default.createElement("div",{className:a.drawerHeader},f.default.createElement("div",{className:a.desktopintrovideowrapper},f.default.createElement("video",{className:a.desktopintrovideo,id:"labintro-video",width:"56",height:"56",onClick:t._resume_video,style:{aspectRatio:"1",transform:"translateZ(10px)"}},f.default.createElement("source",{src:"/src/videos/labintro.mp4",type:"video/mp4"}))),f.default.createElement("span",{className:a.coordinate},f.default.createElement("span",{id:"fps_el"},"FPS: 0"),f.default.createElement("span",{id:"xy_el"}," | X: out, Y: out ")),f.default.createElement(z.default,{className:a.effectSliderText,id:"strength-slider",gutterBottom:!0},"Effect strength :"),f.default.createElement(A.default,{key:"slider-"+(255*b|0),defaultValue:parseFloat(b),className:a.effectSlider,step:1/255,min:0,max:1,onChangeCommitted:t._set_value_from_slider_with_update,"aria-labelledby":"strength-slider"})),f.default.createElement(F.default,{id:"tabs-desktop",className:a.tabs,variant:"fullWidth",indicatorColor:"primary",textColor:"primary",selectionFollowsFocus:!1,value:o,onChange:function(e,a){t._handle_view_name_change(a)}},f.default.createElement(H.default,{className:a.tab,label:"colors",icon:f.default.createElement(dt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"image",icon:f.default.createElement(ut.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"layers",icon:f.default.createElement(pt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"tools",icon:f.default.createElement(ht.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"select",icon:f.default.createElement(bt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"effects",icon:f.default.createElement(yt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"filters",icon:f.default.createElement(xt.default,null)}))),f.default.createElement("div",{className:a.drawerContainer,ref:t._set_toolbox_container_ref},f.default.createElement(me.default,{should_update:!Bt,slider_value_width:M,slider_value_height:D,canvas:n,view_class:a.listOfTools,is_mobile:Bt,view_names:r,is_image_import_mode:s,can_undo:m,can_redo:p,view_name_index:o,previous_view_name_index:i,layers:l,layer_index:_,hide_canvas_content:d,show_original_image_in_background:c,show_transparent_image_in_background:u,hue:k,current_color:h,second_color:g,slider_value:b,tool:v,width:parseInt(y),height:parseInt(w),filters:C,select_mode:S,pencil_mirror_mode:T,is_something_selected:I,import_size:x,import_colorize:E,set_filters_callback:t._set_filters_callback,set_props_callback:t._set_props_callback,set_tool:t._set_tool,set_select_mode:t._set_select_mode,set_pencil_mirror_mode:t._set_pencil_mirror_mode,set_width_from_slider:t._set_width_from_slider,set_height_from_slider:t._set_height_from_slider,set_import_size:t._set_import_size,set_import_colorize:t._set_import_colorize,switch_with_second_color:t._switch_with_second_color,show_hide_canvas_content:t._show_hide_canvas_content,show_hide_background_image:t._show_hide_background_image,show_hide_transparent_image:t._show_hide_transparent_image,on_current_color_change:t._handle_current_color_change,on_view_name_change:t._handle_view_name_change,on_upload_image:function(e){window.dispatchEvent(new Event("art-upload-drawer")),t._upload_image(e)},on_upload_image_library:t._upload_image_library,on_import_image:t._handle_file_import,on_import_image_library:t._import_image_library,on_request_draw_text:t._open_text,on_download_image:t._download_image,on_download_svg:t._download_svg,on_scroll_to:t._scroll_to_drawer}))))}},t.default=(0,k.default)(Vt)(Kt)},816:function(e,t,a){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o,i,r,l,_,s,d,c;Object.defineProperty(t,"__esModule",{value:!0}),o=function(){function e(e,t){var a,n;for(a=0;a video, &:hover > video":{height:96,width:96,transform:"scale(2)",zIndex:1},height:56,width:56,"&::after":{content:"''",background:"#fff !important",position:"absolute",right:0,top:0,width:"10%",height:"15%"}},desktopintrovideo:{position:"absolute",right:0,top:0,height:56,width:56},mobileintrovideowrapper:{zIndex:1,cursor:"pointer",margin:"16px 56px",position:"absolute",right:0,top:0,height:32,width:32,"&::after":{content:"''",background:"#fff !important",position:"absolute",right:0,top:0,width:"10%",height:"15%"}},mobileintrovideo:{position:"absolute",right:0,top:0,height:32,width:32},effectSliderText:{color:"#050c4c",fontWeight:"bold",textTransform:"uppercase"},effectSlider:{color:"#3729c1",padding:"16px 0px","& > .MuiSlider-track":{height:4}},coordinate:{padding:"6px 8px 6px 8px",display:"block",position:"absolute",top:0,left:"50%",transform:"translate(-50%, 0%)",borderRadius:"0px 0px 4px 4px",backgroundColor:"#ededffff",color:"#050c4c",boxShadow:"inset 0px 3px 6px #050c4c4d",whiteSpace:"nowrap"},drawerModalBackdropRoot:{contain:"layout size style paint"},drawerModal:{transform:"translateY(-32px)",marginTop:32,contain:"size layout style",overflow:"hidden"},contentDrawerFixed:(n={zIndex:20,contain:"style size paint layout",boxShadow:"-2px 0px 4px 0px rgb(0 0 0 / 20%), -4px 0px 5px 0px rgb(0 0 0 / 14%), -6px 0px 10px 0px rgb(0 0 0 / 12%)",maxHeight:"100%",height:"100%"},i(n,e.breakpoints.down("md"),{display:"none"}),i(n,"width",480),i(n,"overscrollBehavior","none"),i(n,"display","inline-block"),i(n,"animationFillMode","both"),i(n,"animationName","$drawer"),i(n,"animationDuration","250ms"),i(n,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(n,"animationDirection","alternate"),i(n,"animationIterationCount","1"),i(n,"animationDelay","0ms"),i(n,"& > div",{animationFillMode:"both",animationName:"$opacity",animationDuration:"125ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"150ms"}),n),"@keyframes drawer":{"0%":{transform:"translateX(100%)"},"190%":{transform:"translateX(0%)"}},"@keyframes opacity":{"0%":{filter:"opacity(0)"},"190%":{filter:"opacity(1)"}},"@keyframes menu":{"0%":{transform:"translateY(100%)"},"190%":{transform:"translateY(0%)"}},drawerPaper:{width:480,overflowX:"overlay",background:"#fafafa",contain:"layout paint size style"},swipeableDrawerPaper:{maxWidth:"100%",overscrollBehavior:"none",overflow:"hidden",paddingBottom:"48px",borderBox:"content-box",height:"100%",contain:"layout paint size style"},drawerContainer:(r={transform:"translateZ(10px)",scrollBehavior:"smooth",contain:"size style paint layout",height:"100% !important",overflow:"overlay"},i(r,e.breakpoints.down("md"),{height:"calc(100vh - 180px) !important"}),i(r,e.breakpoints.up("lg"),{overflowX:"hidden"}),i(r,"& > div",{overflowX:"hidden !important",overflowY:"overlay !important",display:"inline !important",width:"100% !important",height:"100% !important",contain:"size style paint layout !important"}),i(r,"& div .react-swipeable-view-container > div",i({overflow:"initial !important",alignItems:"normal",contain:"size style !important",height:"100%"},e.breakpoints.down("md"),{height:"100% !important",paddingBottom:"24px",boxSizing:"border-box"})),i(r,"& div .react-swipeable-view-container > div[aria-hidden=true]",i({},e.breakpoints.up("lg"),{height:"16px"})),i(r,"& div .react-swipeable-view-container > div[aria-hidden=false] > ul",i({},e.breakpoints.down("md"),{paddingBottom:0})),i(r,"& > div > .react-swipeable-view-container",(o={display:"flex !important",filter:"inherit !important",WebkitFilter:"inherit",willChange:"none !important",height:"100% !important"},i(o,e.breakpoints.up("lg"),{width:480}),i(o,e.breakpoints.down("md"),{width:"100%"}),o)),r),tabs:{contain:"paint size style layout",animationFillMode:"both",animationName:"$menu",animationDuration:"175ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"0ms",height:72,display:"grid","& .MuiTabs-scroller":{overflowY:"hidden"},"& .MuiTab-root":{minWidth:"auto",flex:"auto"},"& .MuiTabs-indicator":{backgroundColor:"#050c4c"}},"@keyframes bounce":{"0%":{transform:"translate3d(0, 0px, 0) scaleY(1.00)"},"20%":{transform:"translate3d(0, 2px, 0) scaleY(0.95)"},"40%":{transform:"translate3d(0, 0px, 0) scaleY(1.00)"},"70%":{transform:"translate3d(0, -2px, 0) scaleY(1.10)"},"80%":{transform:"translate3d(0, 1px, 0) scaleY(0.95)"},"90%":{transform:"translate3d(0, 0px, 0) scaleY(1.00)"}},tab:{backgroundColor:"#fafafa",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .275s","&.Mui-selected":{fontWeight:"bold",backgroundColor:"#dfddf2",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"4px 4px 0px 0px","& .MuiTab-wrapper":{animationDuration:"375ms",animationTimingFunction:"linear",animationName:"$bounce",transformOrigin:"center bottom"}},"&:hover":{fontWeight:"bold",backgroundColor:"#e8e6f5",color:"#050c4c",transition:"color, background-color cubic-bezier(0.4, 0, 0.2, 1) .175s",borderRadius:"4px 4px 0px 0px","& .MuiTab-wrapper":{animationDuration:"375ms",animationTimingFunction:"linear",animationName:"$bounce",transformOrigin:"center bottom"}},"&:first-child":{borderRadius:"0px 4px 0px 0px"},"&:last-child":{borderRadius:"4px 0px 0px 0px"},"& .MuiTab-wrapper":{fontSize:"11px"},"& .MuiTab-wrapper svg":{width:32,height:32,contentVisibility:"auto"}},tabNoIcon:{backgroundColor:"white",color:"#050c4c",transition:"color, background-color ease-in .175s","&.Mui-selected":{fontWeight:"bold",backgroundColor:"#dfddf2",color:"#050c4c",borderRadius:"4px 4px 0px 0px"},"&.MuiTab-labelIcon":{minHeight:36},"& .MuiTab-wrapper":{fontSize:"11px"},"& .MuiTab-wrapper svg":{width:32,height:32,display:"none",color:"#181063"}},"@keyframes backdropanim":{"0%":{filter:"drop-shadow(0px, 0px, 20px, 20px, #131c955c)"}},backdrop:{zIndex:2e3,color:"#fff",filter:"brightness(1.1) contrast(1.2) drop-shadow(0 0 12px #070b32)",background:"radial-gradient(farthest-corner, #001856d1 20%, #636eff52 80%, #474e9b2b)",contain:"layout paint size style",userSelect:"none",animation:"$backdropanim 16s linear infinite both"},backdropTextContent:{display:"block",textAlign:"center"},fatabs:(l={transition:"transform 45ms cubic-bezier(0.4, 0, 0.2, 1) 5ms",backgroundColor:"#fafafa",boxShadow:"0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)",contain:"paint size style layout"},i(l,e.breakpoints.up("lg"),{display:"none"}),i(l,e.breakpoints.up("md"),{width:"100%"}),i(l,"zIndex",1300),i(l,"position","fixed"),i(l,"bottom",0),i(l,"right",0),i(l,"width","100%"),i(l,"height",72),l),listOfTools:(_={paddingTop:0},i(_,e.breakpoints.down("md"),{width:"100%"}),i(_,"width",360),_),contextMenuSubheader:{lineHeight:"24px",backgroundColor:"#eee",color:e.palette.secondary.light},contextMenuFuckYouActive:{cursor:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAApCAYAAAAiT5m3AAABXklEQVRYR+2XSxKCMAyGYSXqCdiJev8TqbjjBCqucMJMnDSk6QOKM0hXzPTxNemfB3n2o5GP4Z4OVYf7r/c66KygxfSSCL3Ut+xcHfupEPgoMEBxAHwFa/pZXe0dXaDqVVzLCyeaIkEMs7wxTZEAhUyVHMyhs4KpdTYwj0VNbF6Za7cpukf7Ms7lruaXcVWsZGC8iM3qHszVyhfHWIxg6qamabLnu+2ZXzC+IbqIFvZYsOb+AZgWdviGW5ZlaYSOLaG73p263wqWlEuBEkS6kC3eVbAG97FOi/fkYO4F7M0MVfMkQd/bNucq4KqrYbOk3NnAoF5edbjKYy2n50CeGGQu3tK4XBk6b7wx3ZwSTPO3aLHN3aHW8fX7YmumTL4gldX/A5YKj1iPaZkcGz62uqw2AlO9tfQLmxQsuRiF7ARjTeY9l09oaT/r0T3XssEgMmiBQgcUHbXLDD1wivUfqwJ8Oe4e4FEAAAAASUVORK5CYII=") 17 28, auto',"& .MuiList-padding":{padding:0}},contextMenuFuckYouDisable:{"& .MuiList-padding":{padding:0}},ripple:{contain:"layout paint size style",pointerEvents:"none",contentVisibility:"auto",mixBlendMode:"dodge"},infoIcon:{position:"absolute"},blueCenter:{color:e.palette.secondary.lighter,textAlign:"center",minWidth:"100%"},perspectiveButton:{position:"absolute",left:16,top:16,animationFillMode:"both",animationName:"$fadein",animationDuration:"225ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationDirection:"alternate",animationIterationCount:"1",animationDelay:"175ms"},saveButton:(s={backgroundColor:"#0037ff14 !important",position:"absolute",right:496,top:16},i(s,e.breakpoints.down("md"),{right:16}),i(s,"animationFillMode","both"),i(s,"animationName","$fadein"),i(s,"animationDuration","225ms"),i(s,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(s,"animationDirection","alternate"),i(s,"animationIterationCount","1"),i(s,"animationDelay","175ms"),s),confirmImportButton:(d={position:"absolute",left:16,bottom:16},i(d,e.breakpoints.down("md"),{bottom:88}),i(d,"animationFillMode","both"),i(d,"animationName","$fadein"),i(d,"animationDuration","225ms"),i(d,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(d,"animationDirection","alternate"),i(d,"animationIterationCount","1"),i(d,"animationDelay","175ms"),d),zoomInButton:(c={position:"absolute",left:16,bottom:104},i(c,e.breakpoints.down("md"),{bottom:176}),i(c,"animationFillMode","both"),i(c,"animationName","$fadein"),i(c,"animationDuration","225ms"),i(c,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(c,"animationDirection","alternate"),i(c,"animationIterationCount","1"),i(c,"animationDelay","175ms"),c),zoomOutButton:(u={position:"absolute",left:16,bottom:60},i(u,e.breakpoints.down("md"),{bottom:132}),i(u,"animationFillMode","both"),i(u,"animationName","$fadein"),i(u,"animationDuration","225ms"),i(u,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(u,"animationDirection","alternate"),i(u,"animationIterationCount","1"),i(u,"animationDelay","175ms"),u),redoButton:(m={backgroundColor:"#0037ff14 !important",position:"absolute",right:496,bottom:60},i(m,e.breakpoints.down("md"),{right:16,bottom:132}),i(m,"animationFillMode","both"),i(m,"animationName","$fadein"),i(m,"animationDuration","225ms"),i(m,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(m,"animationDirection","alternate"),i(m,"animationIterationCount","1"),i(m,"animationDelay","175ms"),m),undoButton:(p={backgroundColor:"#0037ff14 !important",position:"absolute",right:496,bottom:16},i(p,e.breakpoints.down("md"),{right:16,bottom:88}),i(p,"animationFillMode","both"),i(p,"animationName","$fadein"),i(p,"animationDuration","225ms"),i(p,"animationTimingFunction","cubic-bezier(0.4, 0, 0.2, 1)"),i(p,"animationDirection","alternate"),i(p,"animationIterationCount","1"),i(p,"animationDelay","175ms"),p),"@keyframes fadein":{"0%":{filter:"opacity(0)"},"190%":{filter:"opacity(1)"}},imageBackdrop:{filter:"brightness(1.5) contrast(0.75) drop-shadow(2px 4px 6px black)",width:"min(75vw, 75vh)"}}},Vt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Kt.call(a),a.st4te={is_mobile_or_tablet:!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(navigator.userAgent||navigator.vendor||window.opera)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent||navigator.vendor||window.opera.substr(0,4))),classes:e.classes,load_with:e.load_with+"",_history:Q.HISTORY,_perspective:!1,_library_dialog_open:!1,_library:{},_library_type:"open",_view_name_index:1,_handle_wheel_timestamp:Date.now(),_view_name_sub_index:0,_previous_view_name_index:1,_view_names:["palette","image","layers","tools","selection","effects","filters"],_canvas:null,_loading:!1,_loading_process:"",_can_undo:0,_can_redo:0,_current_color:"#ffffffff",_second_color:"#000000ff",_pxl_current_opacity:1,_width:32,_height:32,_import_size:"192",_import_colorize:"0",_hue:360,_slider_value:.25,_slider_value_width:192,_slider_value_height:96,_game_ended:!1,_previous_tool_timestamp:1/0,_select_mode:"REPLACE",_pencil_mirror_mode:"NONE",_filters:[],_x:-1,_y:-1,_drag_file:!1,_is_something_selected:!1,_hide_canvas_content:!1,_show_original_image_in_background:!1,_show_transparent_image_in_background:!0,_is_image_import_mode:!1,_layers:[],_layer_index:0,_previous_layer_index:0,_mine_player_direction:"UP",_is_edit_drawer_open:!1,_kb:0,_saved_at:Date.now(),_fps:0,_prev_fps:0,_menu_mouse_y:null,_menu_mouse_x:null,_menu_data:{},_menu_event:null,_ripple:null,_ripple_color:"#ffffffff",_ripple_opacity:1,_is_pixel_dialog_post_edit_open:!1,_is_dialog_info_open:!1,_base64_url:"",_logged_account:{},_less_than_1280w:!1,_is_pixel_dialog_create_open:!1,_attachment_previews:{},_swipeable_drawer_handle_filters_thumbnail_change:function(){},_swipeable_drawer_set_props:function(){},_toolbox_container_ref:{},_files_waiting_download:[],_time_ago_initiated:!1,_fps_el:{},_xy_el:{},_settings:g.default.unpack(e.settings),_tool:"MOVE",_memory_tool:"MOVE"},a.st4te._tool=a.st4te.is_mobile_or_tablet?"MOVE":"PENCIL",a.st4te._memory_tool=a.st4te.is_mobile_or_tablet?"MOVE":"PENCIL",a.sraf=Object.create(jt.default).init(),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),_(t,[{key:"setSt4te",value:function(e,t){var a,n=Object.keys(e),o=0|n.length,i="";for(a=0;(0|a)<(0|o);a=(a+1|0)>>>0)i=n[a],this.st4te[i]=e[i];"function"==typeof t&&t()}},{key:"componentWillMount",value:function(){te.default.trigger_loading_update(0),te.default.trigger_page_render_complete(),setTimeout((function(){te.default.trigger_loading_update(100)}),300)}},{key:"componentDidMount",value:function(){var e=this;te.default.trigger_snackbar("Awesome buddy! Welcome back to the laboratory.",3500),(0,Tt.l)(null,(function(){e._compute_menu_drawer(),e.setSt4te({_time_ago_initiated:!0})}),!0),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&(te.default.trigger_snackbar("Right here! Let's upload a picture now to create a new artwork.",6e3),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&(te.default.trigger_snackbar("By the way, ...",1e3),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&(te.default.trigger_snackbar("Huh, let me take my breath! ...",1500),setTimeout((function(){e.st4te._is_pixel_dialog_create_open&&te.default.trigger_snackbar("You can set the size of your artwork before uploading your picture.",1e4)}),3e3))}),1500))}),8500))}),9e3),te.default.jamy_update("happy"),window.addEventListener("resize",this._updated_dimensions),window.addEventListener("wheel",this._prevent_ctrl_zoom,{passive:!1}),document.addEventListener("keydown",this._handle_keydown),document.addEventListener("keyup",this._handle_keyup);try{document.getElementById("tabs-desktop").addEventListener("wheel",this._handle_wheel,{passive:!1})}catch(t){}v.default.register(this._handle_events.bind(this)),this.setSt4te({_h_svg:(0,Et.createLocalBlob)((0,It.default)(f.default.createElement(Ct.default,{color:"#e5e5e5"}))),_h_svg_size:"100px 115px"}),(0,m.default)((function(){return a.e(42).then(a.t.bind(null,940,7))})).then((function(t){e.setSt4te({_library:t})})),this._set_saved_at_element(),this._try_load_with_payload(this.st4te.load_with),setTimeout((function(){e._request_force_update(!1,!0).then((function(){e._updated_dimensions()}))}),1e3)}},{key:"componentWillReceiveProps",value:function(e){var t=this;e.load_with!==this.st4te.load_with?this.setSt4te(l({_settings:g.default.unpack(e.settings)},e),(function(){t._compute_menu_drawer(),t._request_force_update().then((function(){t._try_load_with_payload(t.st4te.load_with)}))})):this.setSt4te(l({_settings:g.default.unpack(e.settings)},e))}},{key:"_handle_events",value:function(e){var t=this;if("TRIGGER_CANVAS_ACTION"===e.type)switch(e.data.name.toUpperCase()){case"CONTRAST":this._to_auto_medium_more_contrast();break;case"SATURATION":this._to_auto_medium_more_saturation();break;case"PALETTE":this._less_colors_auto();break;case"SMOOTH":this._smooth_adjust();break;case"FILTER":this._handle_edit_drawer_open(null,6);break;case"RENDER":this._handle_edit_drawer_open(null,1),setTimeout((function(){t._handle_edit_drawer_open(null,1),setTimeout((function(){t._handle_edit_drawer_open(null,1)}),100)}),100)}}},{key:"componentWillUnmount",value:function(){this._backup_state(),te.default.stop_sound(),window.removeEventListener("resize",this._updated_dimensions),window.removeEventListener("wheel",this._prevent_ctrl_zoom);try{document.getElementById("tabs-desktop").removeEventListener("wheel",this._handle_wheel,{passive:!1})}catch(e){}document.removeEventListener("keydown",this._handle_keydown),document.removeEventListener("keyup",this._handle_keyup),clearInterval(this.st4te._saved_at_interval)}},{key:"render",value:function(){var e=this,t=this.st4te,a=t.classes,n=t._canvas,o=t._loading,i=t._loading_process,r=t._is_image_import_mode,l=t._hide_canvas_content,_=t._show_original_image_in_background,s=t._show_transparent_image_in_background,c=t._can_undo,u=t._can_redo,m=t._current_color,h=t._slider_value,g=t._tool,b=t._import_size,v=t._hue,y=t._select_mode,x=t._pencil_mirror_mode,k=t._kb,C=t._mine_player_direction,S=t._menu_data,I=t._ripple_color,T=t._ripple_opacity,N=t._library_dialog_open,z=t._library,O=t._is_pixel_dialog_create_open,P=t._h_svg,A=t._h_svg_size,D=t._attachment_previews,L=t._perspective,j=t._files_waiting_download,R=t._time_ago_initiated,B=t._settings,F=t._text_dialog_open,q=t._drag_file,H=t.is_mobile_or_tablet;return S.pos_x=-1===S.pos_x?"out":S.pos_x,S.pos_y=-1===S.pos_y?"out":S.pos_y,f.default.createElement("div",{style:{height:"100%",position:"relative",pointerEvents:"none",userSelect:"none"},ref:this._set_root_ref},f.default.createElement("div",{className:a.root},f.default.createElement("div",{className:a.contentInner,style:{backgroundColor:"#f7f7f7",backgroundImage:'url("'+P+'")',backgroundRepeat:"repeat",backgroundSize:A,textRendering:"optimizespeed",imageRendering:"optimizespeed"}},f.default.createElement(p.Suspense,{fallback:f.default.createElement("div",{className:a.contentCanvas})},f.default.createElement(Bt,{set_compressor:this._set_png_compressors,perspective:L?2:0,on_state_export:this._handle_canvas_state_will_export,on_state_exported:this._handle_canvas_state_exported,on_fps_change:this._handle_fps_change,export_state_every_ms:H?3e5:21e4,shadow_size:H?0:1.5,key:"canvas",className:a.contentCanvas,ref:this._set_canvas_ref,tool:g,canvas_wrapper_padding:8,hide_canvas_content:l,show_original_image_in_background:_&&!0,show_transparent_image_in_background:s,select_mode:y,pencil_mirror_mode:x,hue:v,bucket_threshold:h,color_loss:h,pxl_current_opacity:1,onLoadComplete:this._handle_load_complete,onLoad:this._handle_load,onCanUndoRedoChange:this._handle_can_undo_redo_change,onSizeChange:this._handle_size_change,onCurrentColorChange:this._handle_current_color_change,onSomethingSelectedChange:this._handle_something_selected_change,onImageImportModeChange:this._handle_image_import_mode_change,onPositionChange:this._handle_position_change,onLayersChange:this._handle_layers_change,onFiltersThumbnailChange:this._handle_filters_thumbnail_change,onGameEnd:this._handle_game_end,onRelevantActionEvent:this._handle_relevant_action_event,setCursorFuckYou:this._set_cursor_fuck_you,onRightClick:this._handle_right_click,mine_player_direction:C,pxl_current_color:m,convert_scale:1,default_size:b,ideal_size:b,max_size:1.5*b,fast_drawing:!0,px_per_px:1})),this.drawer_desktop,this.menu)),f.default.createElement("div",{style:{pointerEvents:"all"}},f.default.createElement(E.default,{className:a.perspectiveButton,color:"primary",size:"small",onClick:this._toggle_perspective},L?f.default.createElement(tt.default,null):f.default.createElement(Qe.default,null)),f.default.createElement(w.default,{className:a.saveButton,variant:"text",color:"primary",onClick:this._backup_state},f.default.createElement("span",{id:"saved_at"},"?")," ",f.default.createElement(We.default,null)," ",k<.5?"?":Math.round(10*k)/10," kB"),f.default.createElement(w.default,{disabled:!r,className:a.confirmImportButton,color:"primary",size:"small",onClick:function(){r?n.confirm_import():e._import_image_library()}},f.default.createElement(d.default,null)," ",r?"OK":"Import"),f.default.createElement(E.default,{className:a.zoomOutButton,color:"primary",size:"small",onClick:function(){n.zoom_out()}},f.default.createElement(Mt.default,null)),f.default.createElement(E.default,{className:a.zoomInButton,color:"primary",size:"small",onClick:function(){n.zoom_in()}},f.default.createElement(zt.default,null)),f.default.createElement(w.default,{disabled:!u,variant:"text",color:"primary",size:"small",className:a.redoButton,onClick:function(t){e._redo()}},(-u||"")+" Redo"," ",f.default.createElement(De.default,{style:{transition:"ease-out 225ms transform 25m",transform:"rotate(+"+(360*u+90)+"deg)"}})),f.default.createElement(w.default,{disabled:!c,variant:"text",color:"primary",size:"small",className:a.undoButton,onClick:function(t){e._undo()}},f.default.createElement(De.default,{style:{transition:"ease-out 225ms transform 25ms",transform:"rotate(-"+(360*c+90)+"deg)"}}),(+c||"")+" Undo")),this.drawer_mobile,f.default.createElement(it.default,{keepMounted:!1,open:!!N,object:z,onClose:this._close_library,onSelectImage:this._from_library}),f.default.createElement(At.default,{keepMounted:!1,open:!!F,onClose:this._close_text,onSuccess:this._draw_text}),f.default.createElement(fe.default,{keepMounted:!1,theme_day:B._theme_day,open:!!O,pixel_arts:R?D:{},size:b,on_import_size_change:this._set_import_size,on_pixel_art_delete:this._delete_unsaved_pixel_art,import_JSON_state:this._handle_import_json_state_id,on_upload:this._handle_file_upload,onClose:this._handle_pixel_dialog_create_close}),f.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,contain:"paint size style layout",visibility:"auto"}},f.default.createElement(J.default,{className:a.ripple,ref:this._set_ripple_ref,center:!1,style:{color:I,opacity:T,position:"fixed",width:"100%",height:"100%"}}),f.default.createElement(M.default,{style:{pointerEvents:"all",cursor:"pointer"},onDrag:this._handle_file_upload,className:a.backdrop,open:!!(o||j.length>0||q+1e3>Date.now())},f.default.createElement("div",{className:a.backdropTextContent,style:{fontFamily:'"Industry Book"',textTransform:"uppercase"},onClick:this._continue_download},!q&&!!(o||j.length>0)&&f.default.createElement("h1",null,f.default.createElement(nt.default,{key:i||o,text:"browser"===i?"Laboratory in DANGER!":"LABORATORY PROCESSING",animation_delay_ms:0,animation_duration_ms:200})),!q&&j.length>0&&f.default.createElement("h3",null,f.default.createElement(nt.default,{key:j[0].name,text:"ACTION REQUIRED... "+j[0].name,animation_delay_ms:300,animation_duration_ms:500})),!q&&j.length>0&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/DOWNLOAD.svg",className:a.imageBackdrop})),!q&&j.length>0&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",style:{textShadow:"0px 0px 16px white"},text:"CLICK ON THE SCREEN TO CONTINUE DOWNLOAD!",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"browser"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Doesn't feel like home for our dear code here.",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"browser"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please download an advanced browser.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_ai"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"AI processing your image",animation_delay_ms:300,animation_duration_ms:500})),q&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/ABDUCTION.svg",className:a.imageBackdrop})),q&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"Drop the file to the UFO.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),q&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Ready for a new image abduction?",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_ai"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/MOLECULE.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_ai"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~10sec.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_preload"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Preparing laboratory",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_preload"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/SCIENCE.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_preload"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~"+parseInt(3*parseFloat(b/100))*(H?3:1)+"sec.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_load"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Abducting your image",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_load"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/ABDUCTION.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_load"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~"+parseInt(4*parseFloat(b/100))*(H?3:1)+"sec.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_render"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/COMPUTING.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"image_render"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Atomic rendering in process",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"image_render"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~14sec.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Coupling few color DNA",animation_delay_ms:300,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/GENOMA.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"less_color"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~4sec.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color_auto"===i&&f.default.createElement("h3",null,f.default.createElement(nt.default,{text:"Coupling the DNA of many color",animation_delay_ms:500,animation_duration_ms:500})),!q&&0===j.length&&o&&"less_color_auto"===i&&f.default.createElement("div",null,f.default.createElement("img",{src:"/src/images/labostration/GENOMA.svg",className:a.imageBackdrop})),!q&&0===j.length&&o&&"less_color_auto"===i&&f.default.createElement("h4",null,f.default.createElement(nt.default,{pre:"[... ",app:" ...]",text:"It can take a while, please wait ~7sec.",animation_delay_ms:H?5e3:2500,animation_duration_ms:500}))))))}}]),t}(f.default.PureComponent),Kt=function(){var e,t=this;this._request_force_update=function(e,a){return e=void 0===e||e,a=void 0!==a&&a,t.sraf.run_frame((function(){return new Promise((function(e,a){t.forceUpdate(e)}))}),!e,!a,Date.now(),"page_pixel").catch((function(){return t._request_force_update(e,a)}))},this._set_fps_and_xy_elements=function(){setTimeout((function(){t.st4te._less_than_1280w?t.setSt4te({_fps_el:{},_xy_el:{}}):t.setSt4te({_fps_el:document.getElementById("fps_el")||{},_xy_el:document.getElementById("xy_el")||{}})}),1e3)},this._prevent_ctrl_zoom=function(e){e.ctrlKey&&e.preventDefault()},this._set_saved_at_element=function(){t.st4te._saved_at_el||t.setSt4te({_saved_at_el:document.getElementById("saved_at")},(function(){var e=setInterval((function(){t.st4te._saved_at_el.innerText=(0,Tt.t)(t.st4te._saved_at||Date.now(),{mini:!0})}),1e3);t.setSt4te({_saved_at_interval:e})}))},this._try_load_with_payload=function(e){var n,o,i;0===e.length?(ge.default.get_settings(t._process_settings_info_result),setTimeout((function(){t.setSt4te({_is_pixel_dialog_create_open:!(0!==e.length)},(function(){t._compute_menu_drawer(),t._request_force_update()}))}),725)):(n=!!e.startsWith("data:image/png;base64,"),o=n?"image/png":"image/jpeg",i=t.st4te._import_size,t._handle_load("image_preload"),(0,lt.base64_to_bitmap)(e,(function(e){var n,l,_,s,d;te.default.trigger_voice("data_upload"),n=t.st4te.is_mobile_or_tablet?960:1440,t.st4te.is_mobile_or_tablet,l=t.st4te.is_mobile_or_tablet?512:1024,_=parseInt(n*n),s=Math.min(parseInt(262144),Math.max(parseInt(i*i),parseInt(l*l))),d=Math.min(parseInt(262144),parseInt(i*i)),(0,lt.bitmap_to_imagedata)(e,_,(function(e){(0,m.default)((function(){return Promise.resolve().then(a.t.bind(null,655,7))})).then((function(a){var n=a.QuantiMatGlobal;(0,lt.imagedata_to_base64)(e,o,(function(e){(0,lt.base64_to_bitmap)(e,(function(a){(0,lt.bitmap_to_imagedata)(a,s,(function(a){n(a,256).then((function(a){var n=r(a,6),o=n[0],i=(n[1],n[2],n[3]),l=n[4],_=n[5];null===o?(window.dispatchEvent(new Event("art-upload-browsererror")),t._handle_load_complete("image_preload",{}),t._handle_load("browser"),te.default.trigger_sfx("alert_high-intensity",.6),te.default.jamy_update("flirty"),te.default.trigger_snackbar("That's our end my little buddy! My instinctive dwelling require a browser I am supporting.",6e3),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",.7),te.default.jamy_update("sad"),te.default.trigger_snackbar("Abandon, misfortune, sadness... I can't live in this strange place.",7e3),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",.8),te.default.jamy_update("suspicious"),te.default.trigger_snackbar("Ho no! I just can't, but someone needs to give me back my usual laboratory environment!",7e3),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",.9),te.default.jamy_update("shocked"),te.default.trigger_snackbar("Yes my enjoyable smartness, gladly you hear me now! Everything gonna be alright to look at me!",9e3),setTimeout((function(){te.default.jamy_update("happy"),te.default.trigger_sfx("alert_high-intensity",1),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity",1)}),750)}),4e3)}),8e3)}),8e3)}),7e3)):(setTimeout((function(){te.default.trigger_snackbar("I am really awesome, within "+parseFloat(_/1e3).toFixed(3)+"sec. I've made disappears "+i+" colors, now there are "+l+" colors!",5700),setTimeout((function(){te.default.jamy_update("happy")}),2e3)}),15e3),(0,lt.imagedata_to_base64)(o,"image/png",(function(a){(0,lt.base64_to_bitmap)(a,(function(a){(0,lt.bitmap_to_imagedata)(a,d,(function(a){(0,lt.imagedata_to_base64)(a,"image/png",(function(a){var n=new Image;n.addEventListener("load",(function(){t._handle_load_complete("image_preload",{}),t.setSt4te({_kb:0,_saved_at:1/0}),t.st4te._canvas.set_canvas_from_image(n,e,{},!1)}),{once:!0,capture:!0}),n.src=a}))}))}))}),S.default))}),S.default)}))}),S.default)}),S.default)})).catch((function(e){t._handle_load_complete("image_preload",{}),te.default.trigger_snackbar("Be sure to have a recent browser or install Google Chrome for using it.",5700),te.default.jamy_update("angry")}))}))}),S.default))},this._handle_canvas_state_will_export=function(){te.default.trigger_loading_update(0),te.default.jamy_update("suspicious"),te.default.trigger_snackbar("Ok buddy! Saving yours.",1500),window.onbeforeunload=function(e){return"Your content that was being saved will be lost."}},this._handle_canvas_state_exported=function(e){if(te.default.trigger_loading_update(75),te.default.jamy_update("flirty"),te.default.trigger_snackbar("Hold on! Compressing...",1e3),e.kb>.5){var a={};a["json_state-ID"+e.id+".json.lz"]=e,t.setSt4te({_kb:e.kb,_saved_at:Date.now()},(function(){t._compute_menu_drawer(),t._request_force_update(),ge.default.set_settings({},(function(e,t){e&&(te.default.trigger_loading_update(100),te.default.trigger_snackbar("Looks like I can't save your file as our compression module can't load.",5700),te.default.jamy_update("angry"))}),a,c.UJS,S.default,(function(e,t){te.default.trigger_loading_update(100),e?(window.onbeforeunload=function(e){},te.default.trigger_snackbar("Laboratory artwork failed to save.",2e3),te.default.jamy_update("sad")):(window.onbeforeunload=function(e){},setTimeout((function(){setTimeout((function(){te.default.jamy_update("happy")}),500),te.default.trigger_snackbar("Success! Laboratory's artwork saved!",2e3)}),1e3))}))}))}else te.default.trigger_loading_update(100),window.onbeforeunload=function(e){},setTimeout((function(){te.default.trigger_snackbar("Huh, we don't store nearly empty file up here, buddy.",2e3)}),2e3)},this._handle_import_json_state_id=function(e){(0,m.default)((function(){return Promise.resolve().then(a.t.bind(null,691,7))})).then((function(a){var n=a.UJS;t._handle_load("image_preload"),te.default.trigger_voice("accessing_memory"),ge.default.get_settings((function(){}),["json_state-ID"+e+".json.lz"],t._process_settings_attachment_result,n,S.default)})).catch((function(){te.default.trigger_snackbar("Looks like I can't get your file as our compression module can't load.",5700),te.default.jamy_update("angry")}))},this._delete_unsaved_pixel_art=function(e){var a={};a["json_state-ID"+e+".json.lz"]="delete",ge.default.set_settings({},t._process_settings_info_result,a,null,null,(function(a,n){if(a)te.default.trigger_snackbar("DELETION, Failed!",2e3);else{te.default.trigger_snackbar("DELETION, Successful!",2e3),te.default.trigger_sfx("alert_high-intensity");var o=Object.assign({},t.st4te._attachment_previews);delete o["json_state-ID"+e+".json.lz"],t.setSt4te({_attachment_previews:o},(function(){t._request_force_update()}))}}))},this._updated_dimensions=function(){var e=document.documentElement,a=document.body||document.getElementsByTagName("body")[0],n=window.innerWidth||e.clientWidth||a.clientWidth,o=(window.innerHeight||e.clientHeight||a.clientHeight,!!(n<1280));t.setSt4te({_less_than_1280w:o},(function(){t._compute_menu_drawer(),t._compute_menu_drawer(),t._request_force_update(!1,!1).then((function(){t._set_fps_and_xy_elements()}))}))},this._handle_wheel=function(e){var a,n,o=e.deltaY;t.st4te._handle_wheel_timestamp+1500?1:-1,(n=t.st4te._view_name_index+a|0)<0?n=t.st4te._view_name_index=t.st4te._view_names.length-1|0:n%=t.st4te._view_names.length+1|0,t._handle_view_name_change(n,t.st4te._view_name_index,(function(){t.setSt4te({_handle_wheel_timestamp:Date.now()})})))},this._handle_menu_close=function(){t.setSt4te({_menu_mouse_x:null,_menu_mouse_y:null},(function(){t._compute_menu_right_click(),t._request_force_update()}))},this._handle_right_click=function(e,a){a.pxl_color=t.st4te._canvas.get_pixel_color_from_pos(a.pos_x,a.pos_y),t.setSt4te({_menu_mouse_x:e.clientX-2,_menu_mouse_y:e.clientY-4,_menu_data:a,_menu_event:e},(function(){t._compute_menu_right_click(),t._request_force_update()}))},this._set_cursor_fuck_you=function(e){te.default.jamy_update("happy",2500)},this._process_settings_info_result=function(e,a){if(!e&&void 0!==a){var n=void 0!==a.attachment_previews?a.attachment_previews:{};t.setSt4te({_attachment_previews:n},(function(){t._request_force_update()}))}},this._process_settings_attachment_result=function(e,a){var n=t.st4te._canvas.import_JS_state;t._handle_load_complete("image_preload",{}),e?(te.default.trigger_snackbar("Looks like I can't get your file as something was erroneous.",5700),te.default.jamy_update("angry"),t._handle_pixel_dialog_create_open()):(t.setSt4te({_kb:a.kb,_saved_at:Date.now()},(function(){t._request_force_update()})),n(a,(function(){t.setSt4te({_is_pixel_dialog_create_open:!1,_attachment_previews:{}},(function(){t._request_force_update()}))})))},this._handle_view_name_change=function(e){var a,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},_=t.st4te,s=_._view_names,d=_._toolbox_container_ref;i=null===i?t.st4te._view_name_index:i,a=s[e]||s[0],i>(n=-1===s.indexOf(a)?0:s.indexOf(a))?te.default.trigger_sfx("navigation_transition-left"):i2&&void 0!==arguments[2]?arguments[2]:null;("mouse"===e.pointerType&&0===e.button||"mouse"!==e.pointerType)&&(o=(n=t.st4te)._view_names,i=n._toolbox_container_ref,d=null===d?t.st4te._view_name_index:d,r=o[a]||o[0],d>(_=-1===o.indexOf(r)?0:o.indexOf(r))?te.default.trigger_sfx("navigation_transition-left"):te.default.trigger_sfx("navigation_transition-right"),s={},d!==_&&(s._view_name_sub_index=0,i.scrollTop=0),t.setSt4te(l({},s,{_previous_view_name_index:d||t.st4te._view_name_index,_view_name_index:_}),(function(){t._set_props_bypass_this(),t._compute_menu_drawer(),t._request_force_update()})))},this._handle_keydown=function(e){var a,n,o,i,r;if(e.ctrlKey&&(document.getElementsByClassName("MuiInput-root Mui-focused").length?"c"===!e.key&&"v"===!e.key&&(e.preventDefault(),e.stopImmediatePropagation()):(e.preventDefault(),e.stopImmediatePropagation())),n=(a=t.st4te)._tool,o=a._view_name_index,i=a._view_names,r=a._is_pixel_dialog_post_edit_open,e&&!r){if("MINE"===n)switch(e.keyCode){case 38:t.setSt4te({_mine_player_direction:"UP"});break;case 40:t.setSt4te({_mine_player_direction:"DOWN"});break;case 37:t.setSt4te({_mine_player_direction:"LEFT"});break;case 39:t.setSt4te({_mine_player_direction:"RIGHT"})}else switch(e.keyCode){case 37:t._handle_view_name_change(o-1<0?i.length-1:o-1);break;case 39:t._handle_view_name_change(o+1>i.length-1?0:o+1);break;case 38:t._scroll_to_drawer(-1);break;case 40:t._scroll_to_drawer(1)}"1"===e.key?t._handle_view_name_change(0):"2"===e.key?t._handle_view_name_change(1):"3"===e.key?t._handle_view_name_change(2):"4"===e.key?t._handle_view_name_change(3):"5"===e.key?t._handle_view_name_change(4):"6"===e.key?t._handle_view_name_change(5):"7"===e.key?t._handle_view_name_change(6):e.ctrlKey&&"z"===e.key?t._undo():e.ctrlKey&&"y"===e.key?t._redo():e.ctrlKey&&"m"===e.key?t._set_tool("MINE"):e.ctrlKey&&"o"===e.key?t._upload_image():e.ctrlKey&&"i"===e.key?t._handle_file_import():e.ctrlKey||"o"!==e.key?e.ctrlKey||"b"!==e.key?e.ctrlKey||"h"!==e.key?e.ctrlKey||"x"!==e.key?e.ctrlKey||"u"!==e.key?e.ctrlKey||"r"!==e.key?e.ctrlKey&&"r"===e.key?t._set_tool("SELECT RECTANGLE"):e.ctrlKey||"e"!==e.key?e.ctrlKey&&"e"===e.key?t._set_tool("SELECT ELLIPSE"):e.ctrlKey||"l"!==e.key?e.ctrlKey&&"l"===e.key?t._set_tool("SELECT LINE"):e.ctrlKey||"p"!==e.key?e.ctrlKey||"n"!==e.key?e.ctrlKey&&"p"===e.key?t._set_tool("SELECT PIXEL"):e.ctrlKey&&"n"===e.key?t._set_tool("SELECT PENCIL PERFECT"):e.ctrlKey||"m"!==e.key?e.ctrlKey||"f"!==e.key?e.ctrlKey&&"f"===e.key?t._set_tool("SELECT PATH"):e.ctrlKey&&"k"===e.key?t._set_tool("SELECT COLOR THRESHOLD"):e.ctrlKey&&"g"===e.key?t._set_tool("SELECT COLOR"):e.ctrlKey&&"q"===e.key?t._download_image(1):e.ctrlKey&&"s"===e.key?t._download_image(32):"Enter"===e.key?(0,t.st4te._canvas.confirm_import)():e.ctrlKey?n.includes("SELECT")?(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_select_mode("REMOVE")):(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_tool("PICKER",!1)):"Shift"===e.key&&(n.includes("SELECT")?(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_select_mode("ADD")):(t.setSt4te({_previous_tool_timestamp:Date.now()}),t._set_tool("MOVE",!1))):t._set_tool("CONTOUR"):t._set_tool("SET PENCIL MIRROR"):t._set_tool("PENCIL PERFECT"):t._set_tool("PENCIL"):t._set_tool("LINE"):t._set_tool("ELLIPSE"):t._set_tool("RECTANGLE"):t._set_tool("BORDER"):t._set_tool("EXCHANGE"):t._set_tool("HUE BUCKET"):t._set_tool("BUCKET"):t._set_tool("PICKER")}},this._undo=function(){(100*Math.random()|0)>90&&te.default.trigger_snackbar("That was a nice undo!"),t.st4te._canvas.undo()},this._redo=function(){(100*Math.random()|0)>95&&(te.default.jamy_update("suspicious"),te.default.trigger_snackbar("Even nicer redo! Doo,doo,doo...",2500),setTimeout((function(){te.default.jamy_update("annoyed"),te.default.trigger_snackbar("Did I already said that today? I won't feel much smarter today.",3500),setTimeout((function(){te.default.jamy_update("shocked"),te.default.trigger_snackbar("No, huh!? I have feelings.",2500),setTimeout((function(){te.default.jamy_update("flirty"),te.default.trigger_snackbar("I am a real booooy! Yuhhh!")}),3e3)}),4e3)}),3e3)),t.st4te._canvas.redo()},this._set_png_compressors=function(){var e=t.st4te._canvas.set_png_compressors;return new Promise((function(t,n){(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(a){var n=a.png_quant;e(n),t()}))}))},this._backup_state=function(){var e=t.st4te._canvas,n=e.export_state,o=e.set_png_compressors;(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(e){var t=e.png_quant;o(t),n()}))},this._download_image=function(e){window.dispatchEvent(new Event("art-download-raster"+e)),(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(a){var n=a.png_quant,o=t.st4te._canvas,i=o.get_base64_png_data_url,r=o.set_png_compressors;void 0!==i&&void 0!==r&&(r(n),i(e,!1,1,100,100).then((function(a){var n=a.hash,o=a.url,i=document.createElement("a");i.download="PIXA-"+n+"-PIXELATED-"+e+"x_RAS.png",i.href=o,i.click(),i.remove(),t._propose_selling_nft()})))}))},this._download_svg=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"xbrz",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=t.st4te._canvas,_=l.get_base64_png_data_url,s=l.set_png_compressors,d=l.xxhashthat;window.dispatchEvent(new Event("art-download-vector"+e.toLowerCase())),te.default.trigger_voice("please_wait"),te.default.trigger_snackbar("Please wait... Files will download in a few seconds.",5700),te.default.jamy_update("happy"),t.setSt4te({_loading:!0,_loading_process:"image_render"},(function(){(0,m.default)((function(){return a.e(0).then(a.t.bind(null,657,7))})).then((function(l){var c=l.png_quant;(0,m.default)((function(){return a.e(6).then(a.t.bind(null,719,7))})).then((function(a){var l=a.oxi_png;s(c,l),_(1,!0,1,100,100).then((function(a){var l=a.url,_=a.colors,s=d(l),c=t.st4te._files_waiting_download;c.push({name:"PIXA-"+s+"-PIXELATED-1x_RAS.png",url:l}),t.setSt4te({_files_waiting_download:c},(function(){t._request_force_update()})),te.default.trigger_voice("processing"),(0,rt.base64png_to_xbrz_svg)(l,(function(a,n,o,i){var l=t.st4te._files_waiting_download;l.push({name:"PIXA-"+s+"-"+e.toUpperCase()+"-"+n+"x_RAS.png",url:""+a}),t.setSt4te({_files_waiting_download:l},(function(){t._request_force_update(),r?(0,_t.postJSON)("https://real-life-image.pixa-pics.workers.dev/init",""+a,(function(e,a){a&&(0,_t.postJSON)("https://real-life-image.pixa-pics.workers.dev/get",""+a,(function(e,a){a&&a.split(" ").forEach((function(e){fetch(e).then((function(e){e.blob().then((function(e,a){new Promise((function(t,a){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){var a=URL.createObjectURL(e);t(a)},n.readAsDataURL(e)})).then((function(e){l.push({name:"PIXA-"+s+"-PHOTO-REAL-BIG+AI_RAS-#"+a+".jpg",url:""+e}),t.setSt4te({_files_waiting_download:l},t._request_force_update)}))}))}))}))}),"application/text")}),"application/text"):(te.default.trigger_snackbar("Looks like we had an unexpected issue",5700),te.default.jamy_update("angry"))}))}),(function(a,n){if(a.length>0){var o=t.st4te._files_waiting_download;o.push({name:"PIXA-"+s+"-"+e.toUpperCase()+"-"+n+"x_VEC.svg",url:a}),t.setSt4te({_files_waiting_download:o},(function(){t._request_force_update()}))}t.setSt4te({_loading:!1,_loading_process:""},(function(){t._propose_selling_nft()}))}),(function(a,n){if(a.length>0){var o=t.st4te._files_waiting_download;o.push({name:"PIXA-"+s+"-"+e.toUpperCase()+"-"+n+"+CRT.png",url:a}),t.setSt4te({_files_waiting_download:o},(function(){t._request_force_update()}))}}),Array.from(_),e,!!n,!!o,!!i)}))}))}))}))},this._propose_selling_nft=function(){te.default.trigger_voice("complete"),te.default.trigger_sfx("hero_decorative-celebration-02"),te.default.trigger_snackbar("Fantastic!",1500),setTimeout((function(){te.default.trigger_share(),window.dispatchEvent(new Event("home-action-tryshare")),setTimeout((function(){te.default.trigger_sfx("alert_high-intensity"),te.default.trigger_snackbar("Your unique and stunning pixel art can now be turned into a valuable digital asset through the power of blockchain technology.",7e3),setTimeout((function(){te.default.trigger_sfx("hero_decorative-celebration-02"),te.default.trigger_snackbar("Sell your pixel art as an NFT on your favourite platform and become a part of the growing NFT community.",9e3)}),8e3)}),2e3)}),2e3)},this._continue_download=function(){var e,a,n=t.st4te._files_waiting_download;n.length>0&&(e=n.shift(),(a=document.createElement("a")).download=""+e.name,a.href=""+e.url,a.click(),delete e.url,delete e.name,a.remove(),t.setSt4te({_files_waiting_download:n},(function(){t._request_force_update()})))},this._handle_keyup=function(e){var a,n,o,i,r;e.ctrlKey&&(document.getElementsByClassName("MuiInput-root Mui-focused").length?"c"===!e.key&&"v"===!e.key&&(e.preventDefault(),e.stopImmediatePropagation()):(e.preventDefault(),e.stopImmediatePropagation())),a=t.st4te._is_pixel_dialog_post_edit_open,e&&!a&&(o=(n=t.st4te)._tool,i=n._memory_tool,r=n._previous_tool_timestamp,i&&i!==o&&Date.now()-1e40&&(a.preventDefault(),a.stopPropagation()),t.st4te._drag_file&&t.setSt4te({_drag_file:0},(function(){t._request_force_update()})),n=(a.target||{}).files||(a.srcElement||{}).files||(a.currentTarget||{}).files||((a.path||[])[0]||{}).files||(a.dataTransfer||{}).files||[],i=n[0]||null,r=null;for(l=0;lv;)y-=.01;(0,lt.base64_sanitize)(a,(function(e){(0,lt.base64_to_bitmap)(e,(function(e){(0,lt.bitmap_to_imagedata)(e,e.width*e.height|0,(function(e){(0,lt.imagedata_to_base64)(e,"image/png",(function(e){var n=new Image;n.addEventListener("load",(function(){t._handle_load_complete("image_preload",{}),t.setSt4te({_kb:0,_saved_at:1/0}),h(n,a,{},!1),setTimeout((function(){te.default.trigger_snackbar("I am really awesome, here is your pixel art!",5700),setTimeout((function(){te.default.jamy_update("happy")}),2e3)}),1e3)}),{once:!0,capture:!0}),n.src=e}),S.default)}),S.default)}),S.default)}),null,y,"doppel")}),S.default)}),S.default);case 3:case"end":return e.stop()}}),e,t)})));return function(t){return e.apply(this,arguments)}}(),0===parseInt(p)?w(r).then((function(){})):(x=function(){var e=o(regeneratorRuntime.mark((function e(t){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return te.default.jamy_update("angry"),te.default.trigger_voice("processing"),te.default.trigger_loading_update(10),te.default.jamy_update("annoyed",8e3),te.default.trigger_loading_update(20),setTimeout((function(){te.default.jamy_update("annoyed",8e3),te.default.trigger_loading_update(20)}),5e3),e.next=8,_.run(t,1).catch((function(){return s.run(t)}));case 8:return a=e.sent,te.default.trigger_snackbar("IMAGE: "+a,5e3),e.abrupt("return",d.run(t,a).then((function(e){return te.default.jamy_update("flirty",666),te.default.trigger_loading_update(100),te.default.trigger_snackbar("Receiving results (3 sec)"),te.default.jamy_update("happy",666),te.default.trigger_sfx("alert_high-intensity",1,"md"),te.default.trigger_loading_update(0),te.default.trigger_snackbar("AI Processing [OK]"),E._handle_load_complete("image_ai",{}),E._handle_load("image_preload"),Promise.resolve(e)})).catch((function(){return te.default.trigger_loading_update(0),te.default.trigger_snackbar("AI PROCESSING FAILED! Fallback to normal mode."),E._handle_load_complete("image_ai",{}),E._handle_load("image_preload"),Promise.resolve(t)})));case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),E=t,t._handle_load("image_ai"),x(r).then((function(e){w(e)}))));case 12:case"end":return e.stop()}}),e,t)}))),function(t){return e.apply(this,arguments)}),this._handle_file_import=function(e){var a,n,o,i,r=(e.target||{}).files||(e.srcElement||{}).files||(e.currentTarget||{}).files||((e.path||[])[0]||{}).files||[],l=(r[0],null);for(a=0;aDate.now()-60&&t._backup_state(),t._updated_dimensions()}))})),"less_color"===e||"less_color_auto"===e?0!==a.colors_removed&&(te.default.trigger_snackbar("I am a magician! And "+a.colors_removed+" colors are now gone, only "+a.colors_remaining+" remaining."),te.default.trigger_sfx("navigation_selection-complete-celebration"),te.default.jamy_update("happy")):"image_load"===e&&(a.only_scan?te.default.trigger_sfx("ui_scan"):(te.default.trigger_sfx("ui_scan"),te.default.trigger_snackbar("DONE! We've imported an image with my now "+a.number_of_colors+" colors."),setTimeout((function(){te.default.trigger_voice("complete")}),1e3),te.default.jamy_update("happy"),t._handle_edit_drawer_close(),t._handle_menu_close(),t._handle_pixel_dialog_create_close()))},this._set_ripple_ref=function(e){null!=e&&t.setSt4te({_ripple:e})},this._set_canvas_ref=function(e){null!=e&&t.setSt4te({_canvas:e,_filters:e.get_filter_names()},(function(){t._request_force_update()}))},this._handle_position_change=function(e){var a,n;void 0!==t.st4te._xy_el&&(a=-1===e.x?"out":e.x+1,n=-1===e.y?"out":e.y+1,t.st4te._xy_el.textContent=" | X: "+a+", Y: "+n+" ")},this._handle_fps_change=function(e){void 0!==t.st4te._fps_el&&(t.st4te._fps_el.textContent="FPS: "+e)},this._handle_can_undo_redo_change=function(e,a){e=parseInt(e),a=parseInt(a);var n=!(t.st4te._can_undo===e&&t.st4te._can_redo===a);t.setSt4te({_can_undo:e,_can_redo:a},(function(){n&&t._request_force_update()}))},this._handle_size_change=function(e,a){var n=!(t.st4te._width===e&&t.st4te._height===a);t.setSt4te({_width:e,_height:a},(function(){n&&(t._compute_menu_drawer(),t._request_force_update())}))},this._handle_current_color_change=function(e,a){e=void 0!==e.rgb?qt.new_of(e.rgb.r,e.rgb.g,e.rgb.b,Math.round(parseInt(255*e.rgb.a))).hex:qt.new_hex(e).hex;var n=qt.new_hex(e).hsla[0];t.setSt4te({_current_color:e,_hue:n})},this._handle_relevant_action_event=function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#ffffff",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t.st4te._ripple;e&&o&&(te.default.trigger_sfx("navigation_selection-complete-celebration"),0!==n&&t.setSt4te({_ripple_color:a,_ripple_opacity:n},(function(){setTimeout((function(){o.start(e)}),25),setTimeout((function(){o.stop(e)}),200)})))},this._handle_something_selected_change=function(e){var a=!(t.st4te._is_something_selected===e);t.setSt4te({_is_something_selected:e},(function(){a&&(t._compute_menu_right_click(),t._request_force_update())}))},this._set_value_from_slider_with_update=function(e,a){t.setSt4te({_slider_value:a||e.target.value},(function(){t._set_props_bypass_this()}))},this._set_width_from_slider=function(e,a){t.setSt4te({_slider_value_width:a||e.target.value},(function(){t._set_props_bypass_this()}))},this._set_height_from_slider=function(e,a){t.setSt4te({_slider_value_height:a||e.target.value},(function(){t._set_props_bypass_this()}))},this._set_import_size=function(e,a){t.setSt4te({_import_size:a||e.target.value})},this._set_import_colorize=function(e,a){t.setSt4te({_import_colorize:a||e.target.value})},this._revert_tool=function(){t.setSt4te({_tool:t.st4te._memory_tool})},this._set_tool=function(e){var a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.setSt4te({_tool:e.toUpperCase()},(function(){t._set_props_bypass_this()})),a&&t.setSt4te({_memory_tool:e.toUpperCase()})},this._set_select_mode=function(e){t.setSt4te({_select_mode:e.toUpperCase()},(function(){t._set_props_bypass_this()}))},this._set_pencil_mirror_mode=function(e){t.setSt4te({_pencil_mirror_mode:e.toUpperCase()},(function(){t._set_props_bypass_this()}))},this._switch_with_second_color=function(){var e=t.st4te,a=e._current_color,n=e._second_color;t.setSt4te({_current_color:n,_second_color:a},(function(){t._set_props_bypass_this()}))},this._show_hide_canvas_content=function(){t.setSt4te({_hide_canvas_content:!t.st4te._hide_canvas_content},(function(){t._set_props_bypass_this(),t.forceUpdate()}))},this._show_hide_background_image=function(){t.setSt4te({_show_original_image_in_background:!t.st4te._show_original_image_in_background},(function(){t._set_props_bypass_this()}))},this._show_hide_transparent_image=function(){t.setSt4te({_show_transparent_image_in_background:!t.st4te._show_transparent_image_in_background},(function(){t._set_props_bypass_this()}))},this._handle_image_import_mode_change=function(e){t.setSt4te({_is_image_import_mode:e},(function(){t._set_props_bypass_this(),t._request_force_update()}))},this._handle_layers_change=function(e,a){t.setSt4te({_previous_layer_index:parseInt(t.st4te._layer_index),_layer_index:parseInt(e),_layers:a},(function(){t._set_props_bypass_this()}))},this._handle_filters_thumbnail_change=function(e,a,n){t.st4te._swipeable_drawer_handle_filters_thumbnail_change(e,a,n)},this._set_filters_callback=function(e){t.setSt4te({_swipeable_drawer_handle_filters_thumbnail_change:e})},this._set_props_callback=function(e){t.setSt4te({_swipeable_drawer_set_props:e},(function(){t._set_props_bypass_this(),t._request_force_update()}))},this._set_props_bypass_this=function(){var e=t.st4te,a=e._view_name_index,n=e._previous_view_name_index,o=e._layers,i=e._layer_index,r=e._hide_canvas_content,l=e._show_original_image_in_background,_=e._show_transparent_image_in_background,s=e._hue,d=e._current_color,c=e._second_color,u=e._slider_value,m=e._tool,p=e._width,f=e._height,h=e._filters,g=e._select_mode,b=e._pencil_mirror_mode,v=e._is_something_selected,y=e._is_image_import_mode,w=e._import_size,x=e._import_colorize,E=e._slider_value_width,k=e._slider_value_height;t.st4te._canvas&&t.st4te._canvas._set_props({tool:m,hide_canvas_content:r,show_original_image_in_background:l&&!0,show_transparent_image_in_background:_,select_mode:g,pencil_mirror_mode:b,hue:s,bucket_threshold:u,color_loss:u,pxl_current_color:d,default_size:w,ideal_size:w,max_size:1.5*w}),t.st4te._swipeable_drawer_set_props({view_name_index:a%7,previous_view_name_index:n%7,layers:o,layer_index:i,hide_canvas_content:r,show_original_image_in_background:l,show_transparent_image_in_background:_,hue:s,current_color:d,second_color:c,slider_value:parseFloat(u),slider_value_width:E,slider_value_height:k,tool:m,width:parseInt(p),height:parseInt(f),filters:h,select_mode:g,pencil_mirror_mode:b,is_something_selected:v,is_image_import_mode:y,import_size:w,import_colorize:x})},this._handle_game_end=function(){t.setSt4te({_game_ended:!0},(function(){setTimeout((function(){t.setSt4te({_game_ended:!1})}),5e3)}))},this._handle_edit_drawer_open=function(e,a){var n,o,i,r,l,_,s;a=void 0!==a?a:t.st4te._view_name_index,n=!(t.st4te._view_name_index!==a)&&t.st4te._is_edit_drawer_open,o=t.st4te._toolbox_container_ref,i=!0,r=void 0,n&&null!==o?(l="swipetoolbox_i_"+a+"_"+(r=t.st4te._view_name_sub_index||0),r++,null!==(_=(document.getElementsByClassName(l)||[])[0]||null)?o.scrollTop=_.offsetTop:(r=0,o.scrollTop=0)):(r=0,o.scrollTop=0),s=!(t.st4te._is_edit_drawer_open===i&&t.st4te._view_name_index===a),t.setSt4te({_is_edit_drawer_open:i,_view_name_index:a,_view_name_sub_index:r},(function(){s&&(t._compute_menu_drawer(),t._request_force_update())}))},this._handle_edit_drawer_close=function(){var e=!!t.st4te._is_edit_drawer_open;t.setSt4te({_is_edit_drawer_open:!1},(function(){e&&(t._compute_menu_drawer(),t._request_force_update())}))},this._set_current_color=function(e){t._handle_menu_close(),t.setSt4te({_current_color:e},(function(){t._set_props_bypass_this()}))},this._exchange_pixel_colors=function(e,a,n){var o=t.st4te._canvas.exchange_pixel_color,i=t.st4te._menu_data;o(e,a,n),i.pxl_color=n,t._handle_menu_close(),t.setSt4te({_menu_data:i})},this._to_auto_medium_more_contrast=function(){(0,t.st4te._canvas.auto_adjust_contrast)(.2),te.default.trigger_voice("enhanced")},this._to_auto_medium_more_saturation=function(){(0,t.st4te._canvas.auto_adjust_saturation)(.2),te.default.trigger_voice("enhanced")},this._less_colors_auto=function(){var e=t.st4te,a=e._layers,n=e._layer_index,o=t.st4te._canvas.to_less_color;te.default.trigger_voice("please_wait"),(a[n]||{}).number_of_colors,o("auto")},this._get_average_color_of_selection=function(){var e=(0,t.st4te._canvas.get_average_color_of_selection)();t._handle_current_color_change(e)},this._handle_pixel_dialog_create_close=function(){t.setSt4te({_is_pixel_dialog_create_open:!1,_attachment_previews:{}},(function(){t._request_force_update()}))},this._handle_pixel_dialog_create_open=function(){!1===t.st4te._is_pixel_dialog_create_open&&te.default.trigger_sfx("hero_decorative-celebration-02"),ge.default.get_settings(t._process_settings_info_result),setTimeout((function(){t.setSt4te({_is_pixel_dialog_create_open:!0},(function(){t._request_force_update()}))}),725)},this._set_toolbox_container_ref=function(e){null!=e&&t.setSt4te({_toolbox_container_ref:e})},this._set_root_ref=function(e){null!=e&&t.setSt4te({_root_ref:e},(function(){t.st4te._root_ref.addEventListener("drop",t._handle_file_upload,{capture:!0}),t.st4te._root_ref.addEventListener("dragenter",t._drop_start),t.st4te._root_ref.addEventListener("dragover",t._drop_start),t.st4te._root_ref.addEventListener("dragleave",t._drop_end)}))},this._drop_start=function(e){e.preventDefault(),e.stopPropagation(),t.setSt4te({_drag_file:Date.now()},(function(){t._request_force_update()}))},this._drop_end=function(e){e.preventDefault(),e.stopPropagation(),t.st4te._drag_file&&t.setSt4te({_drag_file:0},(function(){t._request_force_update()}))},this._scroll_to_drawer=function(e){var a,n,o,i;if((""+e).startsWith("swipetoolbox_i_"))a=(document.getElementsByClassName(e)||[])[0]||null,t.st4te._toolbox_container_ref.scrollTop=null!==a?a.offsetTop:0;else{for(n=t.st4te._toolbox_container_ref.scrollTop,o=(document.getElementsByClassName("swipetoolbox_i_"+t.st4te._view_name_index+"_0")||[])[0]||{},i=1;o;){if(!(n>o.offsetTop)){o=(document.getElementsByClassName("swipetoolbox_i_"+t.st4te._view_name_index+"_"+(i-1+e))||[])[0]||{};break}o=(document.getElementsByClassName("swipetoolbox_i_"+t.st4te._view_name_index+"_"+i++)||[])[0]||{}}t.st4te._toolbox_container_ref.scrollTop=o.offsetTop||0}},this._toggle_perspective=function(){var e=!t.st4te._perspective;e?(te.default.trigger_voice("vision_activated"),t._set_tool("MOVE",!1)):(te.default.trigger_voice("vision_deactivated"),t._revert_tool()),t.setSt4te({_perspective:e},(function(){t._request_force_update()}))},this._smooth_adjust=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;(0,t.st4te._canvas.smooth_adjust)(e)},this._close_text=function(){t.setSt4te({_text_dialog_open:!1},(function(){t._request_force_update()}))},this._open_text=function(){t.setSt4te({_text_dialog_open:!0},(function(){t._request_force_update()}))},this._draw_text=function(e,a){t._close_text(),(0,t.st4te._canvas.write_text)(e,a)},this._resume_video=function(){try{document.getElementById("labintro-video").play()}catch(e){}},this._compute_menu_right_click=function(){var e=t.st4te,a=e.classes,n=e._canvas,o=e._current_color,i=e._tool,r=e._width,l=e._height,_=e._pencil_mirror_mode,s=e._is_something_selected,d=e._menu_mouse_y,c=e._menu_mouse_x,u=e._menu_data,m=e._menu_event;u.pos_x=-1===u.pos_x?"out":u.pos_x,u.pos_y=-1===u.pos_y?"out":u.pos_y,t.menu=f.default.createElement(K.default,{className:a.contextMenuFuckYouDisable,PaperProps:{style:{maxHeight:380,width:240,overflowY:"overlay",contain:"paint style layout",scrollBehavior:"smooth",userSelect:"none",pointerEvents:d||c?"all":"none"}},onContextMenu:function(e){e.preventDefault()},MenuListProps:{dense:!0},transitionDuration:{enter:125,exit:250},open:!!d||!!c,onClose:t._handle_menu_close,disablePortal:!1,keepMounted:!0,anchorReference:"anchorPosition",anchorPosition:{top:0|d,left:0|c}},f.default.createElement("span",{style:{textAlign:"left",padding:"12px 8px",color:"#666"}},"X: ",u.pos_x,", Y: ",u.pos_y),f.default.createElement("div",{style:"SET PENCIL MIRROR"===i||"NONE"!==_?{}:{display:"none"}},f.default.createElement(U.default,{className:a.contextMenuSubheader},"Tools"),f.default.createElement(T.default,{button:!0,divider:!0,disabled:"PENCIL"===i,onClick:function(){t._set_tool("PENCIL")}},f.default.createElement(Z.default,null,f.default.createElement(Ve.default,null)),f.default.createElement(X.default,{primary:"Pencil"})),f.default.createElement(T.default,{button:!0,divider:!0,disabled:"PENCIL PERFECT"===i,onClick:function(){t._set_tool("PENCIL PERFECT")}},f.default.createElement(Z.default,null,f.default.createElement(Ye.default,null)),f.default.createElement(X.default,{primary:"Pencil perfect"})),f.default.createElement(U.default,{className:a.contextMenuSubheader},"Mirror mode"),[{icon:f.default.createElement(qe.default,null),disabled:"NONE"===_,text:"None",on_click:function(){t._set_pencil_mirror_mode("NONE")}},{icon:f.default.createElement(qe.default,null),disabled:"VERTICAL"===_,text:"Vertical",on_click:function(){t._set_pencil_mirror_mode("VERTICAL")}},{icon:f.default.createElement(qe.default,null),disabled:"HORIZONTAL"===_,text:"Horizontal",on_click:function(){t._set_pencil_mirror_mode("HORIZONTAL")}},{icon:f.default.createElement(qe.default,null),disabled:"BOTH"===_,text:"Both",on_click:function(){t._set_pencil_mirror_mode("BOTH")}}].map((function(e){return f.default.createElement(T.default,{key:e.text,button:!0,divider:!0,disabled:e.disabled,onClick:e.on_click},f.default.createElement(Z.default,null,e.icon),f.default.createElement(X.default,{primary:e.text}))}))),f.default.createElement("div",{style:s?{}:{display:"none"}},f.default.createElement(U.default,{className:a.contextMenuSubheader},"Apply to selection"),[{icon:f.default.createElement($e.default,null),text:"Unselect",on_click:function(){n.to_selection_none()}},{icon:f.default.createElement(Ne.default,null),text:"Colorize dynamical",on_click:function(){n.to_selection_changes(o,!1)}},{icon:f.default.createElement(Ge.default,null),text:"Get average color",on_click:function(){t._get_average_color_of_selection()}},{icon:f.default.createElement(Ce.default,null),text:"Shrink",on_click:function(){n.to_selection_size(-1)}},{icon:f.default.createElement(Ce.default,null),text:"Grow",on_click:function(){n.to_selection_size(1)}},{icon:f.default.createElement(Ie.default,null),text:"Border",on_click:function(){n.to_selection_border()}},{icon:f.default.createElement(Ne.default,null),text:"Bucket",on_click:function(){n.to_selection_bucket()}},{icon:f.default.createElement(Ce.default,null),text:"Crop",on_click:function(){n.to_selection_crop()}},{icon:f.default.createElement(Oe.default,null),text:"Invert",on_click:function(){n.to_selection_invert()}},{icon:f.default.createElement(Pe.default,null),text:"Copy",on_click:function(){n.copy_selection()}},{icon:f.default.createElement(je.default,null),text:"Cut",on_click:function(){n.cut_selection()}},{icon:f.default.createElement(Be.default,null),text:"Erase",on_click:function(){n.erase_selection()}}].map((function(e){return f.default.createElement(T.default,{key:e.text,button:!0,divider:!0,onClick:e.on_click},f.default.createElement(Z.default,null,e.icon),f.default.createElement(X.default,{primary:e.text}))}))),f.default.createElement(U.default,{style:null===u.pxl_color?{display:"none"}:{},className:a.contextMenuSubheader},"Color"),f.default.createElement(T.default,{button:!0,divider:!0,style:null===u.pxl_color?{display:"none"}:{},disabled:u.pxl_color===o||null===u.pxl_color,onClick:function(e){t._set_current_color(u.pxl_color),t._handle_relevant_action_event(m,u.pxl_color,1,!0)}},f.default.createElement(Z.default,null,f.default.createElement(ie.default,{style:{color:u.pxl_color,background:"repeating-conic-gradient(#80808055 0% 25%, #00000000 0% 50%) 50% / calc(200% / "+r+") calc(200% / "+l+")"}})),f.default.createElement(X.default,{primary:"Pick color"})),f.default.createElement(T.default,{button:!0,divider:!0,style:null===u.pxl_color?{display:"none"}:{},disabled:u.pxl_color===o||null===u.pxl_color,onClick:function(e){t._exchange_pixel_colors(u.pos_x,u.pos_y,o+""),t._handle_relevant_action_event(m,o,1,!0)}},f.default.createElement(Z.default,null,f.default.createElement(ie.default,{style:{color:o,background:"repeating-conic-gradient(#80808055 0% 25%, #00000000 0% 50%) 50% / calc(200% / "+r+") calc(200% / "+l+")"}})),f.default.createElement(X.default,{primary:"Replace color"})),f.default.createElement(U.default,{className:a.contextMenuSubheader},"Effect"),f.default.createElement(T.default,{button:!0,divider:!0,onClick:function(e){return t._to_auto_medium_more_contrast()}},f.default.createElement(Z.default,null,f.default.createElement(ve.default,null)),f.default.createElement(X.default,{primary:"Increase contrast"})),f.default.createElement(T.default,{button:!0,divider:!0,onClick:function(e){return t._to_auto_medium_more_saturation()}},f.default.createElement(Z.default,null,f.default.createElement(ve.default,null)),f.default.createElement(X.default,{primary:"Increase saturation"})),f.default.createElement(T.default,{button:!0,divider:!0,onClick:function(e){return t._handle_edit_drawer_open(null,6)}},f.default.createElement(Z.default,null,f.default.createElement(ne.default,null)),f.default.createElement(X.default,{primary:"Add a filter"})),f.default.createElement(T.default,{button:!0,divider:!0,onClick:function(e){n._to_less_color("0.9")}},f.default.createElement(Z.default,null,f.default.createElement(we.default,null)),f.default.createElement(X.default,{primary:"Remove 10% of all colors"})),f.default.createElement(T.default,{button:!0,divider:!0,onClick:t._less_colors_auto},f.default.createElement(Z.default,null,f.default.createElement(we.default,null)),f.default.createElement(X.default,{primary:"Remove automatically some colors"})),f.default.createElement(T.default,{button:!0,divider:!0,onClick:function(e){return t._smooth_adjust(1)}},f.default.createElement(Z.default,null,f.default.createElement(Ee.default,null)),f.default.createElement(X.default,{primary:"Smooth a bit"})))},this._compute_menu_drawer=function(){var e=t.st4te,a=e.classes,n=e._canvas,o=e._view_name_index,i=e._previous_view_name_index,r=e._view_names,l=e._layers,_=e._layer_index,s=e._is_image_import_mode,d=e._hide_canvas_content,c=e._show_original_image_in_background,u=e._show_transparent_image_in_background,m=e._can_undo,p=e._can_redo,h=e._current_color,g=e._second_color,b=e._slider_value,v=e._tool,y=e._width,w=e._height,x=e._import_size,E=e._import_colorize,k=e._hue,C=e._filters,S=e._select_mode,I=e._pencil_mirror_mode,T=e._is_something_selected,N=e._is_edit_drawer_open,O=e._menu_data,M=e._less_than_1280w,P=e._slider_value_width,D=e._slider_value_height,j=e.is_mobile_or_tablet;O.pos_x=-1===O.pos_x?"out":O.pos_x,O.pos_y=-1===O.pos_y?"out":O.pos_y,M?t.drawer_mobile=f.default.createElement(f.default.Fragment,null,f.default.createElement(L.default,{className:a.contentDrawer,disableBackdropTransition:!1,disableSwipeToOpen:!1,disableDiscovery:!1,disablePortal:!0,keepMounted:!0,hysteresis:.314,minFlingVelocity:314,swipeAreaWidth:128,open:!!N,onOpen:t._handle_edit_drawer_open,onClose:t._handle_edit_drawer_close,classes:{paper:a.swipeableDrawerPaper,modal:a.drawerModal},transitionDuration:{appear:5,enter:50,exit:75},ModalProps:{disablePortal:!0,BackdropProps:{classes:{root:a.drawerModalBackdropRoot}}},variant:"temporary",anchor:"bottom",style:{pointerEvents:"all"}},f.default.createElement("div",{className:a.mobileintrovideowrapper},f.default.createElement("video",{className:a.mobileintrovideo,id:"labintro-video",width:"56",height:"56",onClick:t._resume_video,style:{aspectRatio:"1",transform:"translateZ(10px)"}},f.default.createElement("source",{src:"/src/videos/labintro.mp4",type:"video/mp4"}))),f.default.createElement(le.default,{onClick:t._handle_edit_drawer_close}),f.default.createElement("div",{style:{display:"grid",contain:"layout paint style"}},f.default.createElement("div",{style:{boxShadow:"rgb(0 0 0 / 20%) 0px 2px 4px -1px, rgb(0 0 0 / 14%) 0px 4px 5px 0px, rgb(0 0 0 / 12%) 0px 1px 10px 0px",zIndex:1}},f.default.createElement("div",{className:a.drawerHeader},f.default.createElement(z.default,{className:a.effectSliderText,id:"strength-slider",gutterBottom:!0},"Effect strength :"),f.default.createElement(A.default,{key:"slider-"+(255*b|0),className:a.effectSlider,defaultValue:parseFloat(b),step:1/255,min:0,max:1,onChangeCommitted:t._set_value_from_slider_with_update,"aria-labelledby":"strength-slider"}))),f.default.createElement("div",{className:a.drawerContainer,ref:t._set_toolbox_container_ref},f.default.createElement(me.default,{should_update:N,slider_value_width:P,slider_value_height:D,onActionClose:t._handle_edit_drawer_close,canvas:n,is_mobile:j,view_class:a.listOfTools,view_names:r,is_image_import_mode:s,can_undo:m,can_redo:p,view_name_index:o,previous_view_name_index:i,layers:l,layer_index:_,hide_canvas_content:d,show_original_image_in_background:c,show_transparent_image_in_background:u,hue:k,current_color:h,second_color:g,slider_value:b,tool:v,width:parseInt(y),height:parseInt(w),filters:C,select_mode:S,pencil_mirror_mode:I,is_something_selected:T,import_size:x,import_colorize:E,set_filters_callback:t._set_filters_callback,set_props_callback:t._set_props_callback,set_tool:t._set_tool,set_select_mode:t._set_select_mode,set_pencil_mirror_mode:t._set_pencil_mirror_mode,set_width_from_slider:t._set_width_from_slider,set_height_from_slider:t._set_height_from_slider,set_import_size:t._set_import_size,set_import_colorize:t._set_import_colorize,switch_with_second_color:t._switch_with_second_color,show_hide_canvas_content:t._show_hide_canvas_content,show_hide_background_image:t._show_hide_background_image,show_hide_transparent_image:t._show_hide_transparent_image,on_current_color_change:t._handle_current_color_change,on_view_name_change:t._handle_view_name_change,on_upload_image:function(e){window.dispatchEvent(new Event("art-upload-drawer")),t._upload_image(e)},on_upload_image_library:t._upload_image_library,on_import_image:function(e){window.dispatchEvent(new Event("art-import-drawer")),t._handle_file_import(e)},on_import_image_library:t._import_image_library,on_request_draw_text:t._open_text,on_download_image:t._download_image,on_download_svg:t._download_svg,on_scroll_to:t._scroll_to_drawer})))),f.default.createElement("div",{className:a.fatabs,style:N&&M?{transform:"translateY(24px)",backgroundColor:"#fff"}:{}},f.default.createElement(F.default,{className:a.tabs,style:{pointerEvents:"all"},variant:"fullWidth",scrollButtons:"off",indicatorColor:"primary",textColor:"primary",selectionFollowsFocus:!0,value:o,onChange:t._handle_edit_drawer_open},f.default.createElement(H.default,{className:a.tab,label:"colors",icon:f.default.createElement(dt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"image",icon:f.default.createElement(ut.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"layers",icon:f.default.createElement(pt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"tools",icon:f.default.createElement(ht.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"select",icon:f.default.createElement(bt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"effects",icon:f.default.createElement(yt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"filters",icon:f.default.createElement(xt.default,null)})))):t.drawer_desktop=f.default.createElement(R.default,{className:a.contentDrawerFixed,variant:"permanent",anchor:"right",classes:{paper:a.drawerPaper}},f.default.createElement("div",{style:{display:"contents",pointerEvents:"all"}},f.default.createElement("div",{style:{boxShadow:"rgb(0 0 0 / 20%) 0px 2px 4px -1px, rgb(0 0 0 / 14%) 0px 4px 5px 0px, rgb(0 0 0 / 12%) 0px 1px 10px 0px",zIndex:1}},f.default.createElement("div",{className:a.drawerHeader},f.default.createElement("div",{className:a.desktopintrovideowrapper},f.default.createElement("video",{className:a.desktopintrovideo,id:"labintro-video",width:"56",height:"56",onClick:t._resume_video,style:{aspectRatio:"1",transform:"translateZ(10px)"}},f.default.createElement("source",{src:"/src/videos/labintro.mp4",type:"video/mp4"}))),f.default.createElement("span",{className:a.coordinate},f.default.createElement("span",{id:"fps_el"},"FPS: 0"),f.default.createElement("span",{id:"xy_el"}," | X: out, Y: out ")),f.default.createElement(z.default,{className:a.effectSliderText,id:"strength-slider",gutterBottom:!0},"Effect strength :"),f.default.createElement(A.default,{key:"slider-"+(255*b|0),defaultValue:parseFloat(b),className:a.effectSlider,step:1/255,min:0,max:1,onChangeCommitted:t._set_value_from_slider_with_update,"aria-labelledby":"strength-slider"})),f.default.createElement(F.default,{id:"tabs-desktop",className:a.tabs,variant:"fullWidth",indicatorColor:"primary",textColor:"primary",selectionFollowsFocus:!1,value:o,onChange:function(e,a){t._handle_view_name_change(a)}},f.default.createElement(H.default,{className:a.tab,label:"colors",icon:f.default.createElement(dt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"image",icon:f.default.createElement(ut.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"layers",icon:f.default.createElement(pt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"tools",icon:f.default.createElement(ht.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"select",icon:f.default.createElement(bt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"effects",icon:f.default.createElement(yt.default,null)}),f.default.createElement(H.default,{className:a.tab,label:"filters",icon:f.default.createElement(xt.default,null)}))),f.default.createElement("div",{className:a.drawerContainer,ref:t._set_toolbox_container_ref},f.default.createElement(me.default,{should_update:!j,slider_value_width:P,slider_value_height:D,canvas:n,view_class:a.listOfTools,is_mobile:j,view_names:r,is_image_import_mode:s,can_undo:m,can_redo:p,view_name_index:o,previous_view_name_index:i,layers:l,layer_index:_,hide_canvas_content:d,show_original_image_in_background:c,show_transparent_image_in_background:u,hue:k,current_color:h,second_color:g,slider_value:b,tool:v,width:parseInt(y),height:parseInt(w),filters:C,select_mode:S,pencil_mirror_mode:I,is_something_selected:T,import_size:x,import_colorize:E,set_filters_callback:t._set_filters_callback,set_props_callback:t._set_props_callback,set_tool:t._set_tool,set_select_mode:t._set_select_mode,set_pencil_mirror_mode:t._set_pencil_mirror_mode,set_width_from_slider:t._set_width_from_slider,set_height_from_slider:t._set_height_from_slider,set_import_size:t._set_import_size,set_import_colorize:t._set_import_colorize,switch_with_second_color:t._switch_with_second_color,show_hide_canvas_content:t._show_hide_canvas_content,show_hide_background_image:t._show_hide_background_image,show_hide_transparent_image:t._show_hide_transparent_image,on_current_color_change:t._handle_current_color_change,on_view_name_change:t._handle_view_name_change,on_upload_image:function(e){window.dispatchEvent(new Event("art-upload-drawer")),t._upload_image(e)},on_upload_image_library:t._upload_image_library,on_import_image:t._handle_file_import,on_import_image_library:t._import_image_library,on_request_draw_text:t._open_text,on_download_image:t._download_image,on_download_svg:t._download_svg,on_scroll_to:t._scroll_to_drawer}))))}},t.default=(0,k.default)(Ht)(Vt)},816:function(e,t,a){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var o,i,r,l,_,s,d,c;Object.defineProperty(t,"__esModule",{value:!0}),o=function(){function e(e,t){var a,n;for(a=0;a= 100 && date == null) || (date|0) > (_notified_position_at|0) && (now - date|0) >= 100) { + if (((now - _notified_position_at|0) >= frametime && date == null) || (date|0) > (_notified_position_at|0) && (now - date|0) >= frametime) { position = { x: typeof position.x == "undefined" ? -1 : position.x, @@ -785,9 +786,9 @@ const SuperMasterMeta = { meta.super_state.set_state({_notified_position_at: now}).then(function () { notifiers.position(position, meta.sraf.get_state().previous_cpaf_fps); }); - } else if ((now|0) < (date + 100|0)) { + } else if ((now|0) < (date + frametime|0)) { - setTimeout(this._notify_position_change, 100-(date-now|0)|0, {x: position.x, y: position.y}, now|0); + setTimeout(this._notify_position_change, frametime-(date-now|0)|0, {x: position.x, y: position.y}, now|0); } }, _handle_canvas_mouse_up() { diff --git a/src/js/pages/Pixel.js b/src/js/pages/Pixel.js index 73687c00..47918d81 100644 --- a/src/js/pages/Pixel.js +++ b/src/js/pages/Pixel.js @@ -1,13 +1,6 @@ import FileImportIcon from "../icons/FileImport"; -window.mobileAndTabletCheck = function() { - let check = false; - (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); - return check; -}; - import {UJS} from "../utils/ujs"; import JSLoader from "../utils/JSLoader"; -let is_mobile_or_tablet = window.mobileAndTabletCheck(); import React, { Suspense } from "react"; import JOYSON from "joyson"; import dispatcher from "../dispatcher"; @@ -644,6 +637,7 @@ class Pixel extends React.PureComponent { constructor(props) { super(props); this.st4te = { + is_mobile_or_tablet: Boolean((/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(navigator.userAgent||navigator.vendor||window.opera)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent||navigator.vendor||window.opera.substr(0,4)))), classes: props.classes, load_with: props.load_with + "", _history: HISTORY, @@ -673,8 +667,6 @@ class Pixel extends React.PureComponent { _slider_value_width: 192, _slider_value_height: 96, _game_ended: false, - _tool: is_mobile_or_tablet ? "MOVE": "PENCIL", - _memory_tool: is_mobile_or_tablet ? "MOVE": "PENCIL", _previous_tool_timestamp: 1/0, _select_mode: "REPLACE", _pencil_mirror_mode: "NONE", @@ -716,8 +708,13 @@ class Pixel extends React.PureComponent { _time_ago_initiated: false, _fps_el: {}, _xy_el: {}, - _settings: JOYSON.unpack(props.settings) + _settings: JOYSON.unpack(props.settings), + _tool: "MOVE", + _memory_tool: "MOVE" }; + + this.st4te._tool = this.st4te.is_mobile_or_tablet ? "MOVE": "PENCIL"; + this.st4te._memory_tool = this.st4te.is_mobile_or_tablet ? "MOVE": "PENCIL"; this.sraf = Object.create(SmartRequestAnimationFrame).init(); }; @@ -902,9 +899,9 @@ class Pixel extends React.PureComponent { actions.trigger_voice("data_upload"); - const max_original_size = is_mobile_or_tablet ? Math.sqrt(1280 * 720): Math.sqrt(1920 * 1080); - const max_size = is_mobile_or_tablet ? Math.sqrt(512 * 512): Math.sqrt(512 * 512); - let min_size = is_mobile_or_tablet ? 512: 1024; + const max_original_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(1280 * 720): Math.sqrt(1920 * 1080); + const max_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(512 * 512): Math.sqrt(512 * 512); + let min_size = this.st4te.is_mobile_or_tablet ? 512: 1024; const resize_original_to = parseInt(max_original_size * max_original_size); const resize_to_before = Math.min(parseInt(max_size * max_size), Math.max(parseInt(_import_size * _import_size), parseInt(min_size * min_size))); const resize_to_finally = Math.min(parseInt(max_size * max_size), parseInt(_import_size * _import_size)); @@ -1899,9 +1896,9 @@ class Pixel extends React.PureComponent { const { _import_colorize, _import_size } = this.st4te; const { set_canvas_from_image } = this.st4te._canvas; - const max_original_size = is_mobile_or_tablet ? Math.sqrt(540 * 720) : Math.sqrt(720 * 1080); - const max_size = is_mobile_or_tablet ? Math.sqrt(512 * 512) : Math.sqrt(512 * 512); - let min_size = is_mobile_or_tablet ? 512 : 1024; + const max_original_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(540 * 720) : Math.sqrt(720 * 1080); + const max_size = this.st4te.is_mobile_or_tablet ? Math.sqrt(512 * 512) : Math.sqrt(512 * 512); + let min_size = this.st4te.is_mobile_or_tablet ? 512 : 1024; const resize_original_to = parseInt(max_original_size * max_original_size); const resize_to_before = Math.min(parseInt(max_size * max_size), Math.max(parseInt(_import_size * _import_size), parseInt(min_size * min_size))); const resize_to_finally = Math.min(parseInt(max_size * max_size), parseInt(_import_size * _import_size)); @@ -2854,6 +2851,7 @@ class Pixel extends React.PureComponent { _less_than_1280w, _slider_value_width, _slider_value_height, + is_mobile_or_tablet } = this.st4te; _menu_data.pos_x = _menu_data.pos_x === -1 ? "out": _menu_data.pos_x; @@ -3141,7 +3139,8 @@ class Pixel extends React.PureComponent { _time_ago_initiated, _settings, _text_dialog_open, - _drag_file + _drag_file, + is_mobile_or_tablet } = this.st4te; _menu_data.pos_x = _menu_data.pos_x === -1 ? "out": _menu_data.pos_x; diff --git a/src/js/utils/Layer.js b/src/js/utils/Layer.js index 5d3c3e47..b1add9b5 100644 --- a/src/js/utils/Layer.js +++ b/src/js/utils/Layer.js @@ -156,7 +156,6 @@ var Layer = function(image_data_or_colors_and_indexes, width, height, with_plain // Fill the dual data set (linear, matrix) from color and indexes this.force_update_data(image_data_or_colors_and_indexes[0], image_data_or_colors_and_indexes[1]); - }else{ if(image_data_or_colors_and_indexes instanceof ImageData){ @@ -235,20 +234,20 @@ Object.defineProperty(Layer.prototype, 'populate_data', { this.uint32_pixel_color_ = new Uint32Array(this.width_ * this.height_); this.changes_ = new SetFixed(this.uint32_pixel_color_.length); + this.changes_.charge(); this.uint8c_pixel_color_ = new Uint8ClampedArray(this.uint32_pixel_color_.buffer); this.simdope_pixel_color_ = new Colors(this.uint32_pixel_color_.buffer); for(var i = 0, l = this.uint32_pixel_color_.length | 0; (i|0) < (l|0); i = (i + 1 | 0) >>> 0) { this.uint32_pixel_color_[i] = (this.colors[this.indexes[i]]|0) >>> 0; } - this.changes_.charge(); }else { - this.uint32_pixel_color_ = data instanceof Uint32Array ? data: Uint32Array.from(data); + this.uint32_pixel_color_ = data instanceof Uint32Array ? data: data instanceof ArrayBuffer ? new Uint32Array(data): Uint32Array.from(data); this.changes_ = new SetFixed(this.uint32_pixel_color_.length); + this.changes_.charge(); this.uint8c_pixel_color_ = new Uint8ClampedArray(this.uint32_pixel_color_.buffer); this.simdope_pixel_color_ = new Colors(this.uint32_pixel_color_.buffer); - this.changes_.charge(); } } } @@ -274,7 +273,7 @@ Object.defineProperty(Layer.prototype, 'populate_colors', { return function(colors){ "use strict"; - this.uint32_colors_ = colors instanceof Uint32Array ? colors.slice(0, colors.length|0): Uint32Array.from(colors); + this.uint32_colors_ = colors instanceof Uint32Array ? ((this.uint32_colors_ || {}).length === colors.length) ? colors: colors.slice(0, colors.length|0): colors instanceof ArrayBuffer ? new Uint32Array(colors): Uint32Array.from(colors); this.uint32_colors_length_ = this.uint32_colors_.length; this.uint32_colors_map_ = {}; for(var i = 0; (i|0) < (this.uint32_colors_length_|0); i = (i + 1 | 0) >>> 0){ @@ -293,7 +292,7 @@ Object.defineProperty(Layer.prototype, 'populate_indexes', { this.color_indexes_length_ = indexes.length; this.color_indexes_constructor_ = this.uint32_colors_length_ < (1 << 8) ? Uint8Array : (this.uint32_colors_length_ + 1 | 0) < (1 << 16) ? Uint16Array : Uint32Array; - this.color_indexes_ = indexes instanceof this.color_indexes_constructor_ ? indexes: this.color_indexes_constructor_.from(indexes); + this.color_indexes_ = indexes instanceof this.color_indexes_constructor_ ? indexes: indexes instanceof ArrayBuffer ? new this.color_indexes_constructor_(indexes) :this.color_indexes_constructor_.from(indexes); }else { this.color_indexes_length_ = this.uint32_pixel_color_.length; this.color_indexes_constructor_ = this.uint32_colors_length_ < (1 << 8) ? Uint8Array : (this.uint32_colors_length_ + 1 | 0) < (1 << 16) ? Uint16Array : Uint32Array; @@ -944,6 +943,7 @@ Object.defineProperty(FilterGreyscale.prototype, 'filter_colors', { var uint8_colors = new Uint8Array(colors.buffer); var new_uint8_colors_length = uint8_colors.length|0; var new_uint8_colors = new Uint8Array(new_uint8_colors_length|0); + new_uint8_colors.set(uint8_colors, 0) var new_uint32_colors = new Uint32Array(new_uint8_colors.buffer); for(var i4 = 0; (i4|0) < (new_uint8_colors_length|0); i4 = (i4+4|0)>>>0){ @@ -958,10 +958,10 @@ Object.defineProperty(FilterGreyscale.prototype, 'filter_colors', { var new_uint32_colors_length = new_uint32_colors.length|0; for(var i = 0; (i|0) < (new_uint32_colors_length|0); i = (i+1|0)>>>0){ - old_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_with(new_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), intensity, false, false); + new_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_first_with(old_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), 255-intensity, false, false); } - return colors; + return new_uint32_colors; }; }, enumerable: false, @@ -1007,12 +1007,13 @@ Object.defineProperty(FilterScreen.prototype, 'filter_colors', { var uint8_colors = new Uint8Array(colors.buffer); var new_uint8_colors_length = uint8_colors.length|0; var new_uint8_colors = new Uint8Array(new_uint8_colors_length|0); + new_uint8_colors.set(uint8_colors, 0) var new_uint32_colors = new Uint32Array(new_uint8_colors.buffer); for(var i4 = 0; (i4|0) < (new_uint8_colors_length|0); i4 = (i4+4|0)>>>0){ - new_uint8_colors[i4|0] = SCREEN_COMP(new_uint8_colors[i4|0]); - new_uint8_colors[i4+1|0] = SCREEN_COMP(new_uint8_colors[i4+1|0]); - new_uint8_colors[i4+2|0] = SCREEN_COMP(new_uint8_colors[i4+2|0]); + new_uint8_colors[i4|0] = SCREEN_COMP(uint8_colors[i4|0]); + new_uint8_colors[i4+1|0] = SCREEN_COMP(uint8_colors[i4+1|0]); + new_uint8_colors[i4+2|0] = SCREEN_COMP(uint8_colors[i4+2|0]); new_uint8_colors[i4+3|0] = uint8_colors[i4+3|0]; } @@ -1023,10 +1024,10 @@ Object.defineProperty(FilterScreen.prototype, 'filter_colors', { var new_uint32_colors_length = new_uint32_colors.length|0; for(var i = 0; (i|0) < (new_uint32_colors_length|0); i = (i+1|0)>>>0){ - old_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_with(new_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), intensity, false, false); + new_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_first_with(old_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), 255-intensity, false, false); } - return colors; + return new_uint32_colors; }; }, enumerable: false, @@ -1042,7 +1043,6 @@ var FilterDifference = function(){ } }; - Object.defineProperty(FilterDifference.prototype, 'filter_colors', { get: function() { "use strict"; @@ -1052,12 +1052,13 @@ Object.defineProperty(FilterDifference.prototype, 'filter_colors', { var uint8_colors = new Uint8Array(colors.buffer); var new_uint8_colors_length = uint8_colors.length|0; var new_uint8_colors = new Uint8Array(new_uint8_colors_length|0); + new_uint8_colors.set(uint8_colors, 0) var new_uint32_colors = new Uint32Array(new_uint8_colors.buffer); for(var i4 = 0; (i4|0) < (new_uint8_colors_length|0); i4 = (i4+4|0)>>>0){ - new_uint8_colors[i4|0] = DIFFERENCE_COMP(new_uint8_colors[i4|0]); - new_uint8_colors[i4+1|0] = DIFFERENCE_COMP(new_uint8_colors[i4+1|0]); - new_uint8_colors[i4+2|0] = DIFFERENCE_COMP(new_uint8_colors[i4+2|0]); + new_uint8_colors[i4|0] = DIFFERENCE_COMP(uint8_colors[i4|0]); + new_uint8_colors[i4+1|0] = DIFFERENCE_COMP(uint8_colors[i4+1|0]); + new_uint8_colors[i4+2|0] = DIFFERENCE_COMP(uint8_colors[i4+2|0]); new_uint8_colors[i4+3|0] = uint8_colors[i4+3|0]; } @@ -1068,10 +1069,10 @@ Object.defineProperty(FilterDifference.prototype, 'filter_colors', { var new_uint32_colors_length = new_uint32_colors.length|0; for(var i = 0; (i|0) < (new_uint32_colors_length|0); i = (i+1|0)>>>0){ - old_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_with(new_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), intensity, false, false); + new_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_first_with(old_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), 255-intensity, false, false); } - return colors; + return new_uint32_colors; }; }, enumerable: false, @@ -1095,6 +1096,7 @@ Object.defineProperty(FilterSepia.prototype, 'filter_colors', { var uint8_colors = new Uint8Array(colors.buffer); var new_uint8_colors_length = uint8_colors.length|0; var new_uint8_colors = new Uint8Array(new_uint8_colors_length|0); + new_uint8_colors.set(uint8_colors, 0) var new_uint32_colors = new Uint32Array(new_uint8_colors.buffer); @@ -1112,10 +1114,10 @@ Object.defineProperty(FilterSepia.prototype, 'filter_colors', { var new_uint32_colors_length = new_uint32_colors.length|0; for(var i = 0; (i|0) < (new_uint32_colors_length|0); i = (i+1|0)>>>0){ - old_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_with(new_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), intensity, false, false); + new_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_first_with(old_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), 255-intensity, false, false); } - return colors; + return new_uint32_colors; }; }, enumerable: false, @@ -1131,6 +1133,7 @@ Object.defineProperty(Filter.prototype, 'filter_colors', { var uint8_colors = new Uint8Array(colors.buffer); var new_uint8_colors_length = uint8_colors.length|0; var new_uint8_colors = new Uint8Array(new_uint8_colors_length|0); + new_uint8_colors.set(uint8_colors, 0) var new_uint32_colors = new Uint32Array(new_uint8_colors.buffer); for(var i4 = 0; (i4|0) < (new_uint8_colors_length|0); i4 = (i4+4|0)>>>0){ @@ -1147,10 +1150,10 @@ Object.defineProperty(Filter.prototype, 'filter_colors', { var new_uint32_colors_length = new_uint32_colors.length|0; for(var i = 0; (i|0) < (new_uint32_colors_length|0); i = (i+1|0)>>>0){ - old_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_with(new_simdope_colors.get_use_element(i|0, temp_simdope_colors_b), intensity, false, false); + new_simdope_colors.get_use_element(i|0, temp_simdope_colors_a).blend_first_with(old_simdope_colors.get_use_element(i|0,temp_simdope_colors_b), 255-intensity, false, false); } - return colors; + return new_uint32_colors; }; }, enumerable: false, @@ -1194,13 +1197,13 @@ Object.defineProperty(Filters.prototype, 'use', { if(copy){ switch (name){ case "Sepia": - return Layer.new_from_colors_and_indexes(this.filter_sepia_.filter_colors(layer.colors_copy, intensity), layer.indexes, layer.width, layer.height); + return Layer.new_from_colors_and_indexes(this.filter_sepia_.filter_colors(layer.colors_copy, intensity), layer.indexes_copy, layer.width, layer.height); case "Screen": - return Layer.new_from_colors_and_indexes(this.filter_screen_.filter_colors(layer.colors_copy, intensity), layer.indexes, layer.width, layer.height); + return Layer.new_from_colors_and_indexes(this.filter_screen_.filter_colors(layer.colors_copy, intensity), layer.indexes_copy, layer.width, layer.height); case "Difference": - return Layer.new_from_colors_and_indexes(this.filter_difference_.filter_colors(layer.colors_copy, intensity), layer.indexes, layer.width, layer.height); + return Layer.new_from_colors_and_indexes(this.filter_difference_.filter_colors(layer.colors_copy, intensity), layer.indexes_copy, layer.width, layer.height); default: - return Layer.new_from_colors_and_indexes(this.filter_greyscale_.filter_colors(layer.colors_copy, intensity), layer.indexes, layer.width, layer.height); + return Layer.new_from_colors_and_indexes(this.filter_greyscale_.filter_colors(layer.colors_copy, intensity), layer.indexes_copy, layer.width, layer.height); } }else { switch (name){ @@ -1221,7 +1224,7 @@ Object.defineProperty(Filters.prototype, 'use', { }else { if(copy){ - return Layer.new_from_colors_and_indexes(this.filters_[index].filter_colors(layer.colors_copy, intensity), layer.indexes, layer.width, layer.height); + return Layer.new_from_colors_and_indexes(this.filters_[index].filter_colors(layer.colors_copy, intensity), layer.indexes_copy, layer.width, layer.height); }else { layer.set_colors(this.filters_[index].filter_colors(layer.colors_copy, intensity)); diff --git a/src/js/utils/quantimat/QuantiMat.js b/src/js/utils/quantimat/QuantiMat.js index 1d304fcf..f319a213 100644 --- a/src/js/utils/quantimat/QuantiMat.js +++ b/src/js/utils/quantimat/QuantiMat.js @@ -98,7 +98,7 @@ var QuantiMat = function(opts) { this.set_new_pxl_skin_mask(); this.best_color_number_ = opts.number_of_color; - this.max_cluster_ = l > 65536 ? 65536+1: l > 16384 ? 4096+1: l > 8192 ? 256+1: l > 512 ? 16+1: 1; + this.max_cluster_ = this.new_pxl_colors_.length > 16384 ? 65536+1: this.new_pxl_colors_.length > 4096 ? 4096+1: this.new_pxl_colors_.length > 1024 ? 256+1: this.new_pxl_colors_.length > 256 ? 16+1: 1; this.index_clusters_ = new Array(this.max_cluster_); this.length_clusters_ = new Uint32Array(this.max_cluster_); @@ -245,9 +245,9 @@ Object.defineProperty(QuantiMat.prototype, 'get_a_new_pxl_color_from_pxl_index', }); Object.defineProperty(QuantiMat.prototype, 'reset_cluster', { - get: function() { "use strict"; return function() { + get: function() { "use strict"; return function(one) { "use strict"; - this.max_cluster_ = this.new_pxl_colors_.length > 65536 ? 65536+1: this.new_pxl_colors_.length > 16384 ? 4096+1: this.new_pxl_colors_.length > 8192 ? 256+1: this.new_pxl_colors_.length > 512 ? 16+1: 1; + this.max_cluster_ = Boolean(one) ? 1: this.new_pxl_colors_.length > 16384 ? 65536+1: this.new_pxl_colors_.length > 4096 ? 4096+1: this.new_pxl_colors_.length > 1024 ? 256+1: this.new_pxl_colors_.length > 256 ? 16+1: 1; this.length_clusters_.fill(0, 0, this.max_cluster|0); for(var c = 0; (c|0) < (this.max_cluster|0); c=(c+1|0)>>>0){ this.index_clusters_[c|0] = [];} }} @@ -404,10 +404,10 @@ QuantiMat.prototype.deduplicate = function() { this.set_new_pxl_colors(clean_pxl_colors_length); } -QuantiMat.prototype.clusterize = function() { +QuantiMat.prototype.clusterize = function(one) { "use strict"; - this.reset_cluster(); + this.reset_cluster(one); var l = 0; @@ -464,7 +464,7 @@ QuantiMat.prototype.process_threshold = function(t) { return fr(scaledT / max); } - var max = Math.pow(128, exponent); + var max = Math.pow(255, exponent); var weight_applied_to_color_usage_difference = calculateN(t, max); // Ensure higher precision when low color (high threshold) var index_merged = 0; var latest_colors = []; @@ -486,8 +486,8 @@ QuantiMat.prototype.process_threshold = function(t) { var color_n_in_cluster = 0; var threshold = 0; - var baseFactor = .8; - var lowUsedFactor = .2; // Adjust this value to control sensitivity to usage percent differences + var baseFactor = .777; + var lowUsedFactor = .223; // Adjust this value to control sensitivity to usage percent differences var distanceUsageFactor = .0; // Adjust this value to emphasize the effect of one color being more dominant var totalFactor = baseFactor + lowUsedFactor + distanceUsageFactor; @@ -605,7 +605,7 @@ QuantiMat.prototype.run = function() { return this; } - while (this.new_pxl_colors_length > this.best_color_number && t < 100) { + while (this.new_pxl_colors_length > this.best_color_number && t < 255) { t++; @@ -617,7 +617,7 @@ QuantiMat.prototype.run = function() { this.reset_original(); this.deduplicate(); - this.clusterize(); + this.clusterize(this.new_pxl_colors_length < 4096); this.process_threshold(t|0); this.deduplicate(); this.clusterize(); @@ -642,174 +642,6 @@ QuantiMat.split_image_data = function (image_data) { return [pxls, pxl_colors, image_data_uint32, original_color_n]; } // Helper functions for color space conversion -// Median Cut Quantization -function medianCutQuantize(data, numColors) { - const colors = []; - for (let i = 0; i < data.length; i += 4) { - colors.push((data[i] << 16) | (data[i + 1] << 8) | data[i + 2]); - } - - let boxes = [colors]; - - while (boxes.length < numColors) { - let newBoxes = []; - for (let box of boxes) { - if (box.length <= 1) { - newBoxes.push(box); - continue; - } - let { axis, median } = findMedianCut(box); - let [box1, box2] = splitBox(box, axis, median); - if (box1.length > 0 && box2.length > 0) { - newBoxes.push(box1, box2); - } else { - newBoxes.push(box); // Avoid infinite loop by not splitting further - } - } - boxes = newBoxes; - } - - const palette = boxes.map(box => { - const r = (box.reduce((sum, c) => sum + ((c >> 16) & 0xFF), 0) / box.length) | 0; - const g = (box.reduce((sum, c) => sum + ((c >> 8) & 0xFF), 0) / box.length) | 0; - const b = (box.reduce((sum, c) => sum + (c & 0xFF), 0) / box.length) | 0; - return (r << 16) | (g << 8) | b; - }); - - const quantizedData = new Uint8ClampedArray(data.length); - for (let i = 0; i < data.length; i += 4) { - const originalColor = (data[i] << 16) | (data[i + 1] << 8) | data[i + 2]; - const nearestColor = findNearestColor(originalColor, palette); - quantizedData[i] = (nearestColor >> 16) & 0xFF; - quantizedData[i + 1] = (nearestColor >> 8) & 0xFF; - quantizedData[i + 2] = nearestColor & 0xFF; - quantizedData[i + 3] = data[i + 3]; - } - - return quantizedData; -} - -function findMedianCut(colors) { - const ranges = [0, 1, 2].map(axis => { - const values = colors.map(c => (c >> (8 * (2 - axis))) & 0xFF); - return Math.max(...values) - Math.min(...values); - }); - const axis = ranges.indexOf(Math.max(...ranges)); - const sortedColors = colors.slice().sort((a, b) => ((a >> (8 * (2 - axis))) & 0xFF) - ((b >> (8 * (2 - axis))) & 0xFF)); - const medianIndex = sortedColors.length >> 1; - const median = ((sortedColors[medianIndex] >> (8 * (2 - axis))) & 0xFF); - - return { axis, median }; -} - -function splitBox(box, axis, median) { - const box1 = []; - const box2 = []; - const shift = 8 * (2 - axis); - for (let color of box) { - (((color >> shift) & 0xFF) <= median ? box1 : box2).push(color); - } - return [box1, box2]; -} - -function findNearestColor(color, palette) { - let minDist = Infinity; - let nearestColor = palette[0]; - for (let paletteColor of palette) { - const dist = getColorDistance(color, paletteColor); - if (dist < minDist) { - minDist = dist; - nearestColor = paletteColor; - } - } - return nearestColor; -} - -function getColorDistance(color1, color2) { - const rDiff = ((color1 >> 16) & 0xFF) - ((color2 >> 16) & 0xFF); - const gDiff = ((color1 >> 8) & 0xFF) - ((color2 >> 8) & 0xFF); - const bDiff = (color1 & 0xFF) - (color2 & 0xFF); - return rDiff * rDiff + gDiff * gDiff + bDiff * bDiff; -} - - -// Calculate entropy -function calculateEntropy(data) { - const counts = new Int32Array(256); - for (let val of data) { - counts[val]++; - } - let entropy = 0; - const total = data.length; - for (let i = 0; i < counts.length; i++) { - if (counts[i] > 0) { - const p = counts[i] / total; - entropy -= p * Math.log2(p); - } - } - return entropy; -} - -// Full Structural Similarity Index (SSIM) function -function calculateSSIM(original, processed) { - const K1 = 0.01, K2 = 0.03, L = 255; - let [muX, muY, sigmaX, sigmaY, sigmaXY] = [0, 0, 0, 0, 0]; - - for (let i = 0; i < original.length; i += 4) { - muX += original[i]; - muY += processed[i]; - } - muX /= (original.length >> 2); - muY /= (processed.length >> 2); - - for (let i = 0; i < original.length; i += 4) { - sigmaX += (original[i] - muX) * (original[i] - muX); - sigmaY += (processed[i] - muY) * (processed[i] - muY); - sigmaXY += (original[i] - muX) * (processed[i] - muY); - } - sigmaX /= (original.length >> 2) - 1; - sigmaY /= (processed.length >> 2) - 1; - sigmaXY /= (original.length >> 2) - 1; - - const c1 = (K1 * L) * (K1 * L); - const c2 = (K2 * L) * (K2 * L); - return ((2 * muX * muY + c1) * (2 * sigmaXY + c2)) / - ((muX * muX + muY * muY + c1) * (sigmaX + sigmaY + c2)); -} - -// Full Perceptual Loss function using Euclidean distance as a proxy -function calculatePerceptualLoss(original, processed) { - let loss = 0; - for (let i = 0; i < original.length; i += 4) { - const rDiff = original[i] - processed[i]; - const gDiff = original[i + 1] - processed[i + 1]; - const bDiff = original[i + 2] - processed[i + 2]; - loss += Math.sqrt(rDiff * rDiff + gDiff * gDiff + bDiff * bDiff); - } - return loss / (original.length >> 2); -} - -// Main function to detect ideal color count -function detectIdealColorCount(imageData, minColors = 12, maxColors = 64) { - let bestColorCount = minColors; - let bestScore = -Infinity; - - for (let k = minColors; k <= maxColors; k++) { - const quantizedData = medianCutQuantize(imageData, k); - const entropy = calculateEntropy(new Uint8Array(quantizedData.buffer)); - const ssim = calculateSSIM(imageData, quantizedData); - const perceptualLoss = calculatePerceptualLoss(imageData, quantizedData); - - const score = (ssim / (perceptualLoss + 1)) - entropy; - if (score > bestScore) { - bestScore = score; - bestColorCount = k; - } - } - - return bestColorCount; -} - var QuantiMatGlobal = function( image_data, color_n @@ -830,7 +662,7 @@ var QuantiMatGlobal = function( original_color_n; if(number_of_color === "auto") { - number_of_color = detectIdealColorCount(image_data.data, 32, 96); + number_of_color = original_color_n > 255 ? 255: original_color_n/2|0; } if(number_of_color >= original_color_n) {