-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstylizer.js
More file actions
14 lines (14 loc) · 83.3 KB
/
Copy pathstylizer.js
File metadata and controls
14 lines (14 loc) · 83.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(async()=>{for(;!Spicetify.React||!Spicetify.ReactDOM;)await new Promise(e=>setTimeout(e,10));var P=Object.create,o=Object.defineProperty,M=Object.defineProperties,A=Object.getOwnPropertyDescriptor,L=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,n=Object.getOwnPropertySymbols,$=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,i=(e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var r in t=t||{})s.call(t,r)&&i(e,r,t[r]);if(n)for(var r of n(t))H.call(t,r)&&i(e,r,t[r]);return e},d=(e,t)=>M(e,L(t)),e=(e,t)=>function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports},t=(e,t,r)=>(r=null!=e?P($(e)):{},((t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let e of a(r))s.call(t,e)||e===n||o(t,e,{get:()=>r[e],enumerable:!(i=A(r,e))||i.enumerable});return t})(!t&&e&&e.__esModule?r:o(r,"default",{value:e,enumerable:!0}),e)),x=e({"external-global-plugin:react"(e,t){t.exports=Spicetify.React}}),B=e({"node_modules/react-is/cjs/react-is.development.js"(e){function t(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:var r=e.type;switch(r){case c:case p:case a:case l:case s:case g:return r;default:var n=r&&r.$$typeof;switch(n){case u:case f:case y:case h:case d:return n;default:return t}}case o:return t}}}function r(e){return t(e)===p}var n,i,o,a,s,l,d,u,c,p,f,g,m,h,y,_,b,v,x,w,E,S,T,z,O,k,D,j,F,I,N;n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,d=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,g=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,_=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119,n=p,w=u,E=d,S=i,T=f,z=a,O=y,k=h,D=o,j=l,F=s,I=g,N=!1,e.AsyncMode=c,e.ConcurrentMode=n,e.ContextConsumer=w,e.ContextProvider=E,e.Element=S,e.ForwardRef=T,e.Fragment=z,e.Lazy=O,e.Memo=k,e.Portal=D,e.Profiler=j,e.StrictMode=F,e.Suspense=I,e.isAsyncMode=function(e){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),r(e)||t(e)===c},e.isConcurrentMode=r,e.isContextConsumer=function(e){return t(e)===u},e.isContextProvider=function(e){return t(e)===d},e.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},e.isForwardRef=function(e){return t(e)===f},e.isFragment=function(e){return t(e)===a},e.isLazy=function(e){return t(e)===y},e.isMemo=function(e){return t(e)===h},e.isPortal=function(e){return t(e)===o},e.isProfiler=function(e){return t(e)===l},e.isStrictMode=function(e){return t(e)===s},e.isSuspense=function(e){return t(e)===g},e.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===l||e===s||e===g||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===h||e.$$typeof===d||e.$$typeof===u||e.$$typeof===f||e.$$typeof===b||e.$$typeof===v||e.$$typeof===x||e.$$typeof===_)},e.typeOf=t}}),u=e({"node_modules/react-is/index.js"(e,t){t.exports=B()}}),V=e({"node_modules/object-assign/index.js"(e,t){var l=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=(()=>{try{if(Object.assign){var e=new String("abc");if(e[5]="de","5"!==Object.getOwnPropertyNames(e)[0]){for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n,i=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"===i.join(""))return n={},"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")?1:void 0}}}catch(e){}})()?Object.assign:function(e,t){for(var r,n=(e=>{if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)})(e),i=1;i<arguments.length;i++){for(var o in r=Object(arguments[i]))d.call(r,o)&&(n[o]=r[o]);if(l)for(var a=l(r),s=0;s<a.length;s++)u.call(r,a[s])&&(n[a[s]]=r[a[s]])}return n}}}),p=e({"node_modules/prop-types/lib/ReactPropTypesSecret.js"(e,t){t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}}),f=e({"node_modules/prop-types/lib/has.js"(e,t){t.exports=Function.call.bind(Object.prototype.hasOwnProperty)}}),Y=e({"node_modules/prop-types/checkPropTypes.js"(e,t){var l,d,u,c=function(){};function r(e,t,r,n,i){for(var o in e)if(u(e,o)){var a,s;try{if("function"!=typeof e[o])throw(s=Error((n||"React class")+": "+r+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",s;a=e[o](t,o,n,r,null,l)}catch(e){a=e}!a||a instanceof Error||c((n||"React class")+": type specification of "+r+" `"+o+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in d)&&(d[a.message]=!0,o=i?i():"",c("Failed "+r+" type: "+a.message+(null!=o?o:"")))}}l=p(),d={},u=f(),c=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}},r.resetWarningCache=function(){d={}},t.exports=r}}),W=e({"node_modules/prop-types/factoryWithTypeCheckers.js"(e,t){var d=u(),h=V(),y=p(),_=f(),n=Y(),b=function(){};function i(){return null}b=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}},t.exports=function(o,u){var a="function"==typeof Symbol&&Symbol.iterator,s="@@iterator";var c="<<anonymous>>",e={array:t("array"),bigint:t("bigint"),bool:t("boolean"),func:t("function"),number:t("number"),object:t("object"),string:t("string"),symbol:t("symbol"),any:r(i),arrayOf:function(l){return r(function(e,t,r,n,i){if("function"!=typeof l)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var o=e[t];if(!Array.isArray(o))return new p("Invalid "+n+" `"+i+"` of type `"+g(o)+"` supplied to `"+r+"`, expected an array.");for(var a=0;a<o.length;a++){var s=l(o,a,r,n,i+"["+a+"]",y);if(s instanceof Error)return s}return null})},element:r(function(e,t,r,n,i){return e=e[t],o(e)?null:new p("Invalid "+n+" `"+i+"` of type `"+g(e)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:r(function(e,t,r,n,i){return e=e[t],d.isValidElementType(e)?null:new p("Invalid "+n+" `"+i+"` of type `"+g(e)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(a){return r(function(e,t,r,n,i){var o;return e[t]instanceof a?null:(o=a.name||c,new p("Invalid "+n+" `"+i+"` of type `"+((n=e[t]).constructor&&n.constructor.name?n.constructor.name:c)+"` supplied to `"+r+"`, expected instance of `"+o+"`."))})},node:r(function(e,t,r,n,i){return l(e[t])?null:new p("Invalid "+n+" `"+i+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(l){return r(function(e,t,r,n,i){if("function"!=typeof l)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var o,a=e[t];if("object"!==(e=g(a)))return new p("Invalid "+n+" `"+i+"` of type `"+e+"` supplied to `"+r+"`, expected an object.");for(o in a)if(_(a,o)){var s=l(a,o,r,n,i+"."+o,y);if(s instanceof Error)return s}return null})},oneOf:function(s){if(Array.isArray(s))return r(function(e,t,r,n,i){for(var o=e[t],a=0;a<s.length;a++)if(((e,t)=>e===t?0!==e||1/e==1/t:e!=e&&t!=t)(o,s[a]))return null;e=JSON.stringify(s,function(e,t){return"symbol"===m(t)?String(t):t});return new p("Invalid "+n+" `"+i+"` of value `"+String(o)+"` supplied to `"+r+"`, expected one of "+e+".")});b(1<arguments.length?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array.");return i},oneOfType:function(l){if(!Array.isArray(l))return b("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var e=0;e<l.length;e++){var t=l[e];if("function"!=typeof t)return b("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+(e=>{var t=m(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}})(t)+" at index "+e+"."),i}return r(function(e,t,r,n,i){for(var o=[],a=0;a<l.length;a++){var s=(0,l[a])(e,t,r,n,i,y);if(null==s)return null;s.data&&_(s.data,"expectedType")&&o.push(s.data.expectedType)}return new p("Invalid "+n+" `"+i+"` supplied to `"+r+"`"+(0<o.length?", expected one of type ["+o.join(", ")+"]":"")+".")})},shape:function(l){return r(function(e,t,r,n,i){var o,a=e[t];if("object"!==(e=g(a)))return new p("Invalid "+n+" `"+i+"` of type `"+e+"` supplied to `"+r+"`, expected `object`.");for(o in l){var s=l[o];if("function"!=typeof s)return f(r,n,i,o,m(s));s=s(a,o,r,n,i+"."+o,y);if(s)return s}return null})},exact:function(d){return r(function(e,t,r,n,i){var o,a=e[t],s=g(a);if("object"!==s)return new p("Invalid "+n+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(o in h({},e[t],d)){var l=d[o];if(_(d,o)&&"function"!=typeof l)return f(r,n,i,o,m(l));if(!l)return new p("Invalid "+n+" `"+i+"` key `"+o+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(d),null," "));l=l(a,o,r,n,i+"."+o,y);if(l)return l}return null})}};function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(s){var l={},d=0;function e(e,t,r,n,i,o,a){if(n=n||c,o=o||r,a!==y){if(u)throw(a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types")).name="Invariant Violation",a;"undefined"!=typeof console&&!l[a=n+":"+r]&&d<3&&(b("You are manually calling a React.PropTypes validation function for the `"+o+"` prop on `"+n+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),l[a]=!0,d++)}return null==t[r]?e?null===t[r]?new p("The "+i+" `"+o+"` is marked as required in `"+n+"`, but its value is `null`."):new p("The "+i+" `"+o+"` is marked as required in `"+n+"`, but its value is `undefined`."):null:s(t,r,n,i,o)}var t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}function t(a){return r(function(e,t,r,n,i,o){return g(e=e[t])!==a?new p("Invalid "+n+" `"+i+"` of type `"+m(e)+"` supplied to `"+r+"`, expected `"+a+"`.",{expectedType:a}):null})}function f(e,t,r,n,i){return new p((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function l(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(l);if(null!==e&&!o(e)){var t=(e=>{if("function"==typeof(e=e&&(a&&e[a]||e[s])))return e})(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!l(r.value))return!1}else for(;!(r=n.next()).done;){var i=r.value;if(i&&!l(i[1]))return!1}}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":(e=e,"symbol"===t||e&&("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)?"symbol":t)}function m(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}return p.prototype=Error.prototype,e.checkPropTypes=n,e.resetWarningCache=n.resetWarningCache,e.PropTypes=e}}}),w=e({"node_modules/prop-types/index.js"(e,t){var r=u();t.exports=W()(r.isElement,!0)}}),E=e({"external-global-plugin:react-dom"(e,t){t.exports=Spicetify.ReactDOM}}),X=e({"node_modules/clsx/dist/clsx.js"(e,t){function r(){for(var e,t=0,r="",n=arguments.length;t<n;t++)(e=arguments[t])&&(e=function e(t){var r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t))for(var i=t.length,o=0;o<i;o++)t[o]&&(r=e(t[o]))&&(n&&(n+=" "),n+=r);else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}(e))&&(r&&(r+=" "),r+=e);return r}t.exports=r,t.exports.clsx=r}}),S=e({"node_modules/react-draggable/build/cjs/utils/shims.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.dontSetMe=function(e,t,r){if(e[t])return new Error(`Invalid prop ${t} passed to ${r} - do not set this, set it on the child.`)},e.findInArray=function(r,n){for(let e=0,t=r.length;e<t;e++)if(n.apply(n,[r[e],e,r]))return r[e]},e.int=function(e){return parseInt(e,10)},e.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},e.isNum=function(e){return"number"==typeof e&&!isNaN(e)}}}),G=e({"node_modules/react-draggable/build/cjs/utils/getPrefix.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.browserPrefixToKey=i,e.browserPrefixToStyle=function(e,t){return t?`-${t.toLowerCase()}-`+e:e},e.default=void 0,e.getPrefix=t;var n=["Moz","Webkit","O","ms"];function t(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"!=typeof window){var r=window.document?.documentElement?.style;if(r&&!(t in r))for(let e=0;e<n.length;e++)if(i(t,n[e])in r)return n[e]}return""}function i(e,t){return t?""+t+(t=>{let r="",n=!0;for(let e=0;e<t.length;e++)n?(r+=t[e].toUpperCase(),n=!1):"-"===t[e]?n=!0:r+=t[e];return r})(e):e}e.default=t()}}),T=e({"node_modules/react-draggable/build/cjs/utils/domFns.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.addClassName=l,e.addEvent=function(e,t,r,n){e&&(n={capture:!0,...n},e.addEventListener?e.addEventListener(t,r,n):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r)},e.addUserSelectStyles=function(e){var t;e&&((t=e.getElementById("react-draggable-style-el"))||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t)),e.body)&&l(e.body,"react-draggable-transparent-selection")},e.createCSSTransform=function(e,t){e=a(e,t,"px");return{[(0,r.browserPrefixToKey)("transform",r.default)]:e}},e.createSVGTransform=function(e,t){e=a(e,t,"");return e},e.getTouch=function(e,t){return e.targetTouches&&(0,n.findInArray)(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&(0,n.findInArray)(e.changedTouches,e=>t===e.identifier)},e.getTouchIdentifier=function(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0},e.getTranslation=a,e.innerHeight=function(e){let t=e.clientHeight,r=e.ownerDocument.defaultView.getComputedStyle(e);return t=(t-=(0,n.int)(r.paddingTop))-(0,n.int)(r.paddingBottom)},e.innerWidth=function(e){let t=e.clientWidth,r=e.ownerDocument.defaultView.getComputedStyle(e);return t=(t-=(0,n.int)(r.paddingLeft))-(0,n.int)(r.paddingRight)},e.matchesSelector=o,e.matchesSelectorAndParentsTo=function(e,t,r){let n=e;do{if(o(n,t))return!0;if(n===r)return!1}while(n=n.parentNode,n);return!1},e.offsetXYFromParent=function(e,t,r){var n=t===t.ownerDocument.body,n=n?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-n.left)/r,e=(e.clientY+t.scrollTop-n.top)/r;return{x:i,y:e}},e.outerHeight=function(e){let t=e.clientHeight,r=e.ownerDocument.defaultView.getComputedStyle(e);return t=(t+=(0,n.int)(r.borderTopWidth))+(0,n.int)(r.borderBottomWidth)},e.outerWidth=function(e){let t=e.clientWidth,r=e.ownerDocument.defaultView.getComputedStyle(e);return t=(t+=(0,n.int)(r.borderLeftWidth))+(0,n.int)(r.borderRightWidth)},e.removeClassName=d,e.removeEvent=function(e,t,r,n){e&&(n={capture:!0,...n},e.removeEventListener?e.removeEventListener(t,r,n):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null)},e.scheduleRemoveUserSelectStyles=function(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{s(e)}):s(e)};var n=S(),r=t(G());function t(e,t){var a,s;return"function"==typeof WeakMap&&(a=new WeakMap,s=new WeakMap),function(e,t){if(!t&&e&&e.__esModule)return e;var r,n,i={__proto__:null,default:e};if(null!==e&&("object"==typeof e||"function"==typeof e)){if(r=t?s:a){if(r.has(e))return r.get(e);r.set(e,i)}for(var o in e)"default"!==o&&{}.hasOwnProperty.call(e,o)&&((n=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,o))&&(n.get||n.set)?r(i,o,n):i[o]=e[o])}return i}(e,t)}var i="";function o(t,e){return i=i||(0,n.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(e){return(0,n.isFunction)(t[e])}),!!(0,n.isFunction)(t[i])&&t[i](e)}function a(e,t,r){var{x:e,y:n}=e;let i=`translate(${e}${r},${n}${r})`;return t&&(e=""+("string"==typeof t.x?t.x:t.x+r),n=""+("string"==typeof t.y?t.y:t.y+r),i=`translate(${e}, ${n})`+i),i}function s(e){if(e)try{var t;e.body&&d(e.body,"react-draggable-transparent-selection"),e.selection?e.selection.empty():(t=(e.defaultView||window).getSelection())&&"Caret"!==t.type&&t.removeAllRanges()}catch(e){}}function l(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=" "+t)}function d(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g"),"")}}}),z=e({"node_modules/react-draggable/build/cjs/utils/positionFns.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},e.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},e.createCoreData=function(e,t,r){var n=!(0,s.isNum)(e.lastX),i=d(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}},e.createDraggableData=function(e,t){var r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}},e.getBoundPosition=function(r,e,n){if(r.props.bounds){let t=r.props.bounds;t="string"==typeof t?t:(e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}))(t);r=d(r);if("string"==typeof t){var i=r.ownerDocument,i=i.defaultView;let e;if(!((e="parent"===t?r.parentNode:r.getRootNode().querySelector(t))instanceof i.HTMLElement))throw new Error('Bounds selector "'+t+'" could not find an element.');var o=e,a=i.getComputedStyle(r),i=i.getComputedStyle(o);t={left:-r.offsetLeft+(0,s.int)(i.paddingLeft)+(0,s.int)(a.marginLeft),top:-r.offsetTop+(0,s.int)(i.paddingTop)+(0,s.int)(a.marginTop),right:(0,l.innerWidth)(o)-(0,l.outerWidth)(r)-r.offsetLeft+(0,s.int)(i.paddingRight)-(0,s.int)(a.marginRight),bottom:(0,l.innerHeight)(o)-(0,l.outerHeight)(r)-r.offsetTop+(0,s.int)(i.paddingBottom)-(0,s.int)(a.marginBottom)}}(0,s.isNum)(t.right)&&(e=Math.min(e,t.right)),(0,s.isNum)(t.bottom)&&(n=Math.min(n,t.bottom)),(0,s.isNum)(t.left)&&(e=Math.max(e,t.left)),(0,s.isNum)(t.top)&&(n=Math.max(n,t.top))}return[e,n]},e.getControlPosition=function(e,t,r){var n="number"==typeof t?(0,l.getTouch)(e,t):null;if("number"==typeof t&&!n)return null;t=d(r),t=r.props.offsetParent||t.offsetParent||t.ownerDocument.body;return(0,l.offsetXYFromParent)(n||e,t,r.props.scale)},e.snapToGrid=function(e,t,r){t=Math.round(t/e[0])*e[0],r=Math.round(r/e[1])*e[1];return[t,r]};var s=S(),l=T();function d(e){e=e.findDOMNode();if(e)return e;throw new Error("<DraggableCore>: Unmounted during event!")}}}),O=e({"node_modules/react-draggable/build/cjs/utils/log.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){}}}),Z=e({"node_modules/react-draggable/build/cjs/DraggableCore.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=d(x()),r=l(w()),n=l(E()),o=T(),a=z(),i=S(),s=l(O());function l(e){return e&&e.__esModule?e:{default:e}}function d(e,t){var a,s;return"function"==typeof WeakMap&&(a=new WeakMap,s=new WeakMap),function(e,t){if(!t&&e&&e.__esModule)return e;var r,n,i={__proto__:null,default:e};if(null!==e&&("object"==typeof e||"function"==typeof e)){if(r=t?s:a){if(r.has(e))return r.get(e);r.set(e,i)}for(var o in e)"default"!==o&&{}.hasOwnProperty.call(e,o)&&((n=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,o))&&(n.get||n.set)?r(i,o,n):i[o]=e[o])}return i}(e,t)}function u(e,t,r){(t=(e=>"symbol"==typeof(e=((e,t)=>{if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);if("object"!=typeof(r=r.call(e,t||"default")))return r;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"))?e:e+"")(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}var c={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"},f=p,g=class extends t.Component{constructor(){super(...arguments),u(this,"dragging",!1),u(this,"lastX",NaN),u(this,"lastY",NaN),u(this,"touchIdentifier",null),u(this,"mounted",!1),u(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;var t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");var r,n,i=t.ownerDocument;this.props.disabled||!(e.target instanceof i.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t)||("touchstart"!==e.type||this.props.allowMobileScroll||e.preventDefault(),t=(0,o.getTouchIdentifier)(e),this.touchIdentifier=t,null!=(t=(0,a.getControlPosition)(e,t,this))&&({x:t,y:r}=t,n=(0,a.createCoreData)(this,t,r),(0,s.default)("DraggableCore: handleDragStart: %j",n),(0,s.default)("calling",this.props.onStart),!1!==this.props.onStart(e,n))&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(i),this.dragging=!0,this.lastX=t,this.lastY=r,(0,o.addEvent)(i,f.move,this.handleDrag),(0,o.addEvent)(i,f.stop,this.handleDragStop)))}),u(this,"handleDrag",r=>{var n=(0,a.getControlPosition)(r,this.touchIdentifier,this);if(null!=n){let{x:e,y:t}=n;if(Array.isArray(this.props.grid)){var n=e-this.lastX,i=t-this.lastY;if([n,i]=(0,a.snapToGrid)(this.props.grid,n,i),!n&&!i)return;e=this.lastX+n,t=this.lastY+i}n=(0,a.createCoreData)(this,e,t),i=((0,s.default)("DraggableCore: handleDrag: %j",n),this.props.onDrag(r,n));if(!1===i||!1===this.mounted)try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){r=document.createEvent("MouseEvents");r.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(r)}else this.lastX=e,this.lastY=t}}),u(this,"handleDragStop",r=>{if(this.dragging){var n=(0,a.getControlPosition)(r,this.touchIdentifier,this);if(null!=n){let{x:e,y:t}=n;Array.isArray(this.props.grid)&&(n=e-this.lastX||0,i=t-this.lastY||0,[n,i]=(0,a.snapToGrid)(this.props.grid,n,i),e=this.lastX+n,t=this.lastY+i);n=(0,a.createCoreData)(this,e,t);if(!1===this.props.onStop(r,n)||!1===this.mounted)return!1;var i=this.findDOMNode();i&&this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(i.ownerDocument),(0,s.default)("DraggableCore: handleDragStop: %j",n),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,i&&((0,s.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(i.ownerDocument,f.move,this.handleDrag),(0,o.removeEvent)(i.ownerDocument,f.stop,this.handleDragStop))}}}),u(this,"onMouseDown",e=>(f=p,this.handleDragStart(e))),u(this,"onMouseUp",e=>(f=p,this.handleDragStop(e))),u(this,"onTouchStart",e=>(f=c,this.handleDragStart(e))),u(this,"onTouchEnd",e=>(f=c,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;var e=this.findDOMNode();e&&(0,o.addEvent)(e,c.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;var e,t=this.findDOMNode();t&&(e=t.ownerDocument,(0,o.removeEvent)(e,p.move,this.handleDrag),(0,o.removeEvent)(e,c.move,this.handleDrag),(0,o.removeEvent)(e,p.stop,this.handleDragStop),(0,o.removeEvent)(e,c.stop,this.handleDragStop),(0,o.removeEvent)(t,c.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)&&(0,o.scheduleRemoveUserSelectStyles)(e)}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};u(e.default=g,"displayName","DraggableCore"),u(g,"propTypes",{allowAnyClick:r.default.bool,allowMobileScroll:r.default.bool,children:r.default.node.isRequired,disabled:r.default.bool,enableUserSelectHack:r.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:r.default.arrayOf(r.default.number),handle:r.default.string,cancel:r.default.string,nodeRef:r.default.object,onStart:r.default.func,onDrag:r.default.func,onStop:r.default.func,onMouseDown:r.default.func,scale:r.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),u(g,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})}}),U=e({"node_modules/react-draggable/build/cjs/Draggable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return b.default}}),e.default=void 0;var m=o(x()),t=i(w()),r=i(E()),h=X(),y=T(),_=z(),n=S(),b=i(Z()),s=i(O());function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var a,s;return"function"==typeof WeakMap&&(a=new WeakMap,s=new WeakMap),function(e,t){if(!t&&e&&e.__esModule)return e;var r,n,i={__proto__:null,default:e};if(null!==e&&("object"==typeof e||"function"==typeof e)){if(r=t?s:a){if(r.has(e))return r.get(e);r.set(e,i)}for(var o in e)"default"!==o&&{}.hasOwnProperty.call(e,o)&&((n=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,o))&&(n.get||n.set)?r(i,o,n):i[o]=e[o])}return i}(e,t)}function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)!{}.hasOwnProperty.call(n,r)||(e[r]=n[r])}return e}).apply(null,arguments)}function a(e,t,r){(t=(e=>"symbol"==typeof(e=((e,t)=>{if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);if("object"!=typeof(r=r.call(e,t||"default")))return r;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"))?e:e+"")(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}var l=class extends m.Component{static getDerivedStateFromProps(e,t){e=e.position,t=t.prevPropsPosition;return!e||t&&e.x===t.x&&e.y===t.y?null:((0,s.default)("Draggable: getDerivedStateFromProps %j",{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}})}constructor(e){super(e),a(this,"onDragStart",(e,t)=>{if((0,s.default)("Draggable: onDragStart: %j",t),!1===this.props.onStart(e,(0,_.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),a(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,s.default)("Draggable: onDrag: %j",t);var r,n,i,t=(0,_.createDraggableData)(this,t),o={x:t.x,y:t.y,slackX:0,slackY:0},a=(this.props.bounds&&({x:r,y:n}=o,[a,i]=(o.x+=this.state.slackX,o.y+=this.state.slackY,(0,_.getBoundPosition)(this,o.x,o.y)),o.x=a,o.y=i,o.slackX=this.state.slackX+(r-o.x),o.slackY=this.state.slackY+(n-o.y),t.x=o.x,t.y=o.y,t.deltaX=o.x-this.state.x,t.deltaY=o.y-this.state.y),this.props.onDrag(e,t));if(!1===a)return!1;this.setState(o)}),a(this,"onDragStop",(e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,_.createDraggableData)(this,t)))return!1;(0,s.default)("Draggable: onDragStop: %j",t);var r,e={dragging:!1,slackX:0,slackY:0};Boolean(this.props.position)&&({x:t,y:r}=this.props.position,e.x=t,e.y=r),this.setState(e)}),this.state={dragging:!1,dragged:!1,x:(e.position||e.defaultPosition).x,y:(e.position||e.defaultPosition).y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??r.default.findDOMNode(this)}render(){let{axis:e,bounds:t,children:r,defaultPosition:n,defaultClassName:i,defaultClassNameDragging:o,defaultClassNameDragged:a,position:s,positionOffset:l,scale:d,...u}=this.props,c={},p=null;var f=!Boolean(s)||this.state.dragging,g=s||n,f={x:((0,_.canDragX)(this)&&f?this.state:g).x,y:((0,_.canDragY)(this)&&f?this.state:g).y},g=(this.state.isElementSVG?p=(0,y.createSVGTransform)(f,l):c=(0,y.createCSSTransform)(f,l),(0,h.clsx)(r.props.className||"",i,{[o]:this.state.dragging,[a]:this.state.dragged}));return m.createElement(b.default,v({},u,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),m.cloneElement(m.Children.only(r),{className:g,style:{...r.props.style,...c},transform:p}))}};a(e.default=l,"displayName","Draggable"),a(l,"propTypes",{...b.default.propTypes,axis:t.default.oneOf(["both","x","y","none"]),bounds:t.default.oneOfType([t.default.shape({left:t.default.number,right:t.default.number,top:t.default.number,bottom:t.default.number}),t.default.string,t.default.oneOf([!1])]),defaultClassName:t.default.string,defaultClassNameDragging:t.default.string,defaultClassNameDragged:t.default.string,defaultPosition:t.default.shape({x:t.default.number,y:t.default.number}),positionOffset:t.default.shape({x:t.default.oneOfType([t.default.number,t.default.string]),y:t.default.oneOfType([t.default.number,t.default.string])}),position:t.default.shape({x:t.default.number,y:t.default.number}),className:n.dontSetMe,style:n.dontSetMe,transform:n.dontSetMe}),a(l,"defaultProps",{...b.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}}),q=e({"node_modules/prismjs/prism.js"(e,t){var l,r,n,j,i,d,u,c,p,o,a="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},f=(r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},j={manual:(l=a).Prism&&l.Prism.manual,disableWorkerMessageHandler:l.Prism&&l.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof F?new F(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function r(e,n){var i,t;switch(n=n||{},j.util.type(e)){case"Object":if(t=j.util.objId(e),n[t])return n[t];for(var o in i={},n[t]=i,e)e.hasOwnProperty(o)&&(i[o]=r(e[o],n));return i;case"Array":return(t=j.util.objId(e),n[t])?n[t]:(i=[],n[t]=i,e.forEach(function(e,t){i[t]=r(e,n)}),i);default:return e}},getLanguage:function(e){for(;e;){var t=r.exec(e.className);if(t)return t[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,t){e.className=e.className.replace(RegExp(r,"gi"),""),e.classList.add("language-"+t)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(e){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(e.stack)||[])[1];if(t){var r,n=document.getElementsByTagName("script");for(r in n)if(n[r].src==t)return n[r]}return null}},isActive:function(e,t,r){for(var n="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(n))return!1;e=e.parentElement}return!!r}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(e,t){var r,n=j.util.clone(j.languages[e]);for(r in t)n[r]=t[r];return n},insertBefore:function(r,e,t,n){var i,o=(n=n||j.languages)[r],a={};for(i in o)if(o.hasOwnProperty(i)){if(i==e)for(var s in t)t.hasOwnProperty(s)&&(a[s]=t[s]);t.hasOwnProperty(i)||(a[i]=o[i])}var l=n[r];return n[r]=a,j.languages.DFS(j.languages,function(e,t){t===l&&e!=r&&(this[e]=a)}),a},DFS:function e(t,r,n,i){i=i||{};var o,a,s,l=j.util.objId;for(o in t)t.hasOwnProperty(o)&&(r.call(t,o,t[o],n||o),a=t[o],"Object"!==(s=j.util.type(a))||i[l(a)]?"Array"!==s||i[l(a)]||(i[l(a)]=!0,e(a,r,o,i)):(i[l(a)]=!0,e(a,r,null,i)))}},plugins:{},highlightAll:function(e,t){j.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,r){var n={callback:r,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};j.hooks.run("before-highlightall",n),n.elements=Array.prototype.slice.apply(n.container.querySelectorAll(n.selector)),j.hooks.run("before-all-elements-highlight",n);for(var i,o=0;i=n.elements[o++];)j.highlightElement(i,!0===t,n.callback)},highlightElement:function(e,t,r){var n=j.util.getLanguage(e),i=j.languages[n],o=(j.util.setLanguage(e,n),e.parentElement);o&&"pre"===o.nodeName.toLowerCase()&&j.util.setLanguage(o,n);var a={element:e,language:n,grammar:i,code:e.textContent};function s(e){a.highlightedCode=e,j.hooks.run("before-insert",a),a.element.innerHTML=a.highlightedCode,j.hooks.run("after-highlight",a),j.hooks.run("complete",a),r&&r.call(a.element)}j.hooks.run("before-sanity-check",a),(o=a.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),a.code?(j.hooks.run("before-highlight",a),a.grammar?t&&l.Worker?((n=new Worker(j.filename)).onmessage=function(e){s(e.data)},n.postMessage(JSON.stringify({language:a.language,code:a.code,immediateClose:!0}))):s(j.highlight(a.code,a.grammar,a.language)):s(j.util.encode(a.code))):(j.hooks.run("complete",a),r&&r.call(a.element))},highlight:function(e,t,r){e={code:e,grammar:t,language:r};if(j.hooks.run("before-tokenize",e),e.grammar)return e.tokens=j.tokenize(e.code,e.grammar),j.hooks.run("after-tokenize",e),F.stringify(j.util.encode(e.tokens),e.language);throw new Error('The language "'+e.language+'" has no grammar.')},tokenize:function(e,t){var r=t.rest;if(r){for(var n in r)t[n]=r[n];delete t.rest}for(var i=new g,o=(N(i,i.head,e),!function e(t,r,n,i,o,a){for(var s in n)if(n.hasOwnProperty(s)&&n[s]){var l=n[s];l=Array.isArray(l)?l:[l];for(var d=0;d<l.length;++d){if(a&&a.cause==s+","+d)return;for(var u,c=l[d],p=c.inside,f=!!c.lookbehind,g=!!c.greedy,m=c.alias,h=(g&&!c.pattern.global&&(u=c.pattern.toString().match(/[imsuy]*$/)[0],c.pattern=RegExp(c.pattern.source,u+"g")),c.pattern||c),y=i.next,_=o;y!==r.tail&&!(a&&_>=a.reach);_+=y.value.length,y=y.next){var b=y.value;if(r.length>t.length)return;if(!(b instanceof F)){var v,x=1;if(g){if(!(v=I(h,_,t,f))||v.index>=t.length)break;var w=v.index,E=v.index+v[0].length,S=_;for(S+=y.value.length;S<=w;)y=y.next,S+=y.value.length;if(S-=y.value.length,_=S,y.value instanceof F)continue;for(var T=y;T!==r.tail&&(S<E||"string"==typeof T.value);T=T.next)x++,S+=T.value.length;x--,b=t.slice(_,S),v.index-=_}else if(!(v=I(h,0,b,f)))continue;var w=v.index,z=v[0],O=b.slice(0,w),k=b.slice(w+z.length),b=_+b.length,D=(a&&b>a.reach&&(a.reach=b),y.prev),O=(O&&(D=N(r,D,O),_+=O.length),C(r,D,x),new F(s,p?j.tokenize(z,p):z,m,z));y=N(r,D,O),k&&N(r,y,k),1<x&&(z={cause:s+","+d,reach:b},e(t,r,n,y.prev,_,z),a)&&z.reach>a.reach&&(a.reach=z.reach)}}}}}(e,i,t,i.head,0),i),a=[],s=o.head.next;s!==o.tail;)a.push(s.value),s=s.next;return a},hooks:{all:{},add:function(e,t){var r=j.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=j.hooks.all[e];if(r&&r.length)for(var n,i=0;n=r[i++];)n(t)}},Token:F},l.Prism=j,F.stringify=function t(e,r){if("string"==typeof e)return e;var n;if(Array.isArray(e))return n="",e.forEach(function(e){n+=t(e,r)}),n;var i,o={type:e.type,content:t(e.content,r),tag:"span",classes:["token",e.type],attributes:{},language:r},e=e.alias,a=(e&&(Array.isArray(e)?Array.prototype.push.apply(o.classes,e):o.classes.push(e)),j.hooks.run("wrap",o),"");for(i in o.attributes)a+=" "+i+'="'+(o.attributes[i]||"").replace(/"/g,""")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+a+">"+o.content+"</"+o.tag+">"},l.document?((i=j.util.currentScript())&&(j.filename=i.src,i.hasAttribute("data-manual"))&&(j.manual=!0),j.manual||("loading"===(a=document.readyState)||"interactive"===a&&i&&i.defer?document.addEventListener("DOMContentLoaded",s):window.requestAnimationFrame?window.requestAnimationFrame(s):window.setTimeout(s,16))):l.addEventListener&&!j.disableWorkerMessageHandler&&l.addEventListener("message",function(e){var e=JSON.parse(e.data),t=e.language,r=e.immediateClose;l.postMessage(j.highlight(e.code,j.languages[t],t)),r&&l.close()},!1),j);function F(e,t,r,n){this.type=e,this.content=t,this.alias=r,this.length=0|(n||"").length}function I(e,t,r,n){e.lastIndex=t;t=e.exec(r);return t&&n&&t[1]&&(e=t[1].length,t.index+=e,t[0]=t[0].slice(e)),t}function g(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function N(e,t,r){var n=t.next,r={value:r,prev:t,next:n};return n.prev=t.next=r,e.length++,r}function C(e,t,r){for(var n=t.next,i=0;i<r&&n!==e.tail;i++)n=n.next;(t.next=n).prev=t,e.length-=i}function s(){j.manual||j.highlightAll()}void 0!==t&&t.exports&&(t.exports=f),"undefined"!=typeof global&&(global.Prism=f),f.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},f.languages.markup.tag.inside["attr-value"].inside.entity=f.languages.markup.entity,f.languages.markup.doctype.inside["internal-subset"].inside=f.languages.markup,f.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(f.languages.markup.tag,"addInlined",{value:function(e,t){var r={},r=(r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:f.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}}),t=(r["language-"+t]={pattern:/[\s\S]+/,inside:f.languages[t]},{});t[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},f.languages.insertBefore("markup","cdata",t)}}),Object.defineProperty(f.languages.markup.tag,"addAttribute",{value:function(e,t){f.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:f.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),f.languages.html=f.languages.markup,f.languages.mathml=f.languages.markup,f.languages.svg=f.languages.markup,f.languages.xml=f.languages.extend("markup",{}),f.languages.ssml=f.languages.xml,f.languages.atom=f.languages.xml,f.languages.rss=f.languages.xml,a=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,(i=f).languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+a.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+a.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+a.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+a.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:a,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css,(a=i.languages.markup)&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css")),f.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},f.languages.javascript=f.languages.extend("clike",{"class-name":[f.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),f.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,f.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:f.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:f.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:f.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:f.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:f.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),f.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:f.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),f.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),f.languages.markup&&(f.languages.markup.tag.addInlined("script","javascript"),f.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),f.languages.js=f.languages.javascript,void 0!==f&&"undefined"!=typeof document&&(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),d={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="pre[data-src]:not(["+(u="data-src-status")+'="loaded"]):not(['+u+'="'+(c="loading")+'"])',f.hooks.add("before-highlightall",function(e){e.selector+=", "+p}),f.hooks.add("before-sanity-check",function(e){var i,t,r,n,o,a,s=e.element;s.matches(p)&&(e.code="",s.setAttribute(u,c),(i=s.appendChild(document.createElement("CODE"))).textContent="Loading…",t=s.getAttribute("data-src"),"none"===(e=e.language)&&(r=(/\.(\w+)$/.exec(t)||[,"none"])[1],e=d[r]||r),f.util.setLanguage(i,e),f.util.setLanguage(s,e),(r=f.plugins.autoloader)&&r.loadLanguages(e),r=t,n=function(e){s.setAttribute(u,"loaded");var t,r,n=(e=>{var t,r;if(e=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||""))return t=Number(e[1]),r=e[2],e=e[3],r?e?[t,Number(e)]:[t,void 0]:[t,t]})(s.getAttribute("data-range"));n&&(t=e.split(/\r\n?|\n/g),r=n[0],n=null==n[1]?t.length:n[1],r<0&&(r+=t.length),r=Math.max(0,Math.min(r-1,t.length)),n<0&&(n+=t.length),n=Math.max(0,Math.min(n,t.length)),e=t.slice(r,n).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(r+1))),i.textContent=e,f.highlightElement(i)},o=function(e){s.setAttribute(u,"failed"),i.textContent=e},(a=new XMLHttpRequest).open("GET",r,!0),a.onreadystatechange=function(){4==a.readyState&&(a.status<400&&a.responseText?n(a.responseText):400<=a.status?o("✖ Error "+a.status+" while fetching file: "+a.statusText):o("✖ Error: File does not exist or is empty"))},a.send(null))}),o=!(f.plugins.fileHighlight={highlight:function(e){for(var t,r=(e||document).querySelectorAll(p),n=0;t=r[n++];)f.highlightElement(t)}}),f.fileHighlight=function(){o||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),o=!0),f.plugins.fileHighlight.highlight.apply(this,arguments)})}}),K=t(e({"node_modules/react-draggable/build/cjs/cjs.js"(e,t){var{default:r,DraggableCore:n}=U();t.exports=r,t.exports.default=r,t.exports.DraggableCore=n}})(),1),J=window;function Q(u,r,e={}){let c={tab:"\t",indentOn:/[({\[]$/,moveToNewLine:/^[)}\]]/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0,window:J,autoclose:{open:`([{'"`,close:`)]}'"`},...e},i=c.window,p=i.document,n=[],f=[],g=-1,o=!1,a=()=>{},m,s=(u.setAttribute("contenteditable","plaintext-only"),u.setAttribute("spellcheck",c.spellcheck?"true":"false"),u.style.outline="none",u.style.overflowWrap="break-word",u.style.overflowY="auto",u.style.whiteSpace="pre-wrap",(e,t)=>{r(e,t)});e=i.navigator.userAgent.match(/Firefox\/([0-9]+)\./),e=e?parseInt(e[1]):0;let h=!1,t=((h="plaintext-only"!==u.contentEditable||136<=e?!0:h)&&u.setAttribute("contenteditable","true"),F(()=>{var e=b();s(u,e),v(e)},30)),y=!1,_=e=>!O(e)&&!k(e)&&"Meta"!==e.key&&"Control"!==e.key&&"Alt"!==e.key&&!e.key.startsWith("Arrow"),l=F(e=>{_(e)&&(S(),y=!1)},300);e=(e,t)=>{n.push([e,t]),u.addEventListener(e,t)};function b(){var e=R();let t={start:0,end:0,dir:void 0},{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:o}=e;if(r&&i)return r===u&&i===u?(t.start=0<n&&u.textContent?u.textContent.length:0,t.end=0<o&&u.textContent?u.textContent.length:0,t.dir=o>=n?"->":"<-"):(r.nodeType===Node.ELEMENT_NODE&&(e=p.createTextNode(""),r.insertBefore(e,r.childNodes[n]),r=e,n=0),i.nodeType===Node.ELEMENT_NODE&&(e=p.createTextNode(""),i.insertBefore(e,i.childNodes[o]),i=e,o=0),T(u,e=>{if(e===r&&e===i)return t.start+=n,t.end+=o,t.dir=n<=o?"->":"<-","stop";if(e===r){if(t.start+=n,t.dir)return"stop";t.dir="->"}else if(e===i){if(t.end+=o,t.dir)return"stop";t.dir="<-"}e.nodeType===Node.TEXT_NODE&&("->"!=t.dir&&(t.start+=e.nodeValue.length),"<-"!=t.dir)&&(t.end+=e.nodeValue.length)}),u.normalize()),t;throw"error1"}function v(r){var e=R();let n,i=0,o,a=0,s=(r.dir||(r.dir="->"),r.start<0&&(r.start=0),r.end<0&&(r.end=0),"<-"==r.dir&&({start:t,end:l}=r,r.start=l,r.end=t),0);T(u,e=>{var t;if(e.nodeType===Node.TEXT_NODE)return t=(e.nodeValue||"").length,s+t>r.start&&(n||(n=e,i=r.start-s),s+t>r.end)?(o=e,a=r.end-s,"stop"):void(s+=t)}),n||(n=u,i=u.childNodes.length),o||(o=u,a=u.childNodes.length),"<-"==r.dir&&([n,i,o,a]=[o,a,n,i]);var t,l=d(n),l=(l&&(t=p.createTextNode(""),l.parentNode?.insertBefore(t,l),n=t,i=0),d(o));l&&(t=p.createTextNode(""),l.parentNode?.insertBefore(t,l),o=t,a=0),e.setBaseAndExtent(n,i,o,a),u.normalize()}function d(e){for(;e&&e!==u;){if(e.nodeType===Node.ELEMENT_NODE){var t=e;if("false"==t.getAttribute("contenteditable"))return t}e=e.parentNode}}function x(){var e=R().getRangeAt(0),t=p.createRange();return t.selectNodeContents(u),t.setEnd(e.startContainer,e.startOffset),t.toString()}function w(){var e=R().getRangeAt(0),t=p.createRange();return t.selectNodeContents(u),t.setStart(e.endContainer,e.endOffset),t.toString()}function E(e){h&&"Enter"===e.key&&(C(e),e.stopPropagation(),""==w()?(j("\n "),(e=b()).start=--e.end,v(e)):j("\n"))}function S(){var e,t,r;o&&(e=u.innerHTML,t=b(),(r=f[g])&&r.html===e&&r.pos.start===t.start&&r.pos.end===t.end||(g++,f[g]={html:e,pos:t},f.splice(g+1),300<g&&(g=300,f.splice(0,1))))}function T(e,t){var r=[];e.firstChild&&r.push(e.firstChild);let n=r.pop();for(;n&&"stop"!==t(n);)n.nextSibling&&r.push(n.nextSibling),n.firstChild&&r.push(n.firstChild),n=r.pop()}function z(e){return e.metaKey||e.ctrlKey}function O(e){return z(e)&&!e.shiftKey&&"Z"===D(e)}function k(e){return z(e)&&e.shiftKey&&"Z"===D(e)}function D(e){e=e.key||e.keyCode||e.which;if(e)return("string"==typeof e?e:String.fromCharCode(e)).toUpperCase()}function j(e){e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),p.execCommand("insertHTML",!1,e)}function F(t,r){let n=0;return(...e)=>{clearTimeout(n),n=i.setTimeout(()=>t(...e),r)}}function I(e){let t=e.length-1;for(;0<=t&&"\n"!==e[t];)t--;let r=++t;for(;r<e.length&&/[ \t]/.test(e[r]);)r++;return[e.substring(t,r)||"",t,r]}function N(){return u.textContent||""}function C(e){e.preventDefault()}function R(){return u.getRootNode().getSelection()}return e("keydown",e=>{if(!e.defaultPrevented){if(m=N(),c.preserveIdent){var t=e;if("Enter"===t.key){var r=x(),n=w(),[i]=I(r);let e=i;c.indentOn.test(r)&&(e+=c.tab),0<e.length?(C(t),t.stopPropagation(),j("\n"+e)):E(t),e!==i&&c.moveToNewLine.test(n)&&(r=b(),j("\n"+i),v(r))}}else E(e);if(c.catchTab){t=e;"Tab"===t.key&&(C(t),t.shiftKey?([t,n]=I(x()),0<t.length&&(i=b(),t=Math.min(c.tab.length,t.length),v({start:n,end:n+t}),p.execCommand("delete"),i.start-=t,i.end-=t,v(i))):j(c.tab))}if(c.addClosing){var o,r=e,a=c.autoclose.open,s=c.autoclose.close;a.includes(r.key)&&(C(r),o=b(),l=o.start==o.end?"":R().toString(),j(r.key+l+(s[a.indexOf(r.key)]??"")),o.start++,o.end++,v(o))}var l,d;c.history&&(O(l=e)&&(C(l),g--,(d=f[g])&&(u.innerHTML=d.html,v(d.pos)),g<0)&&(g=0),k(l)&&(C(l),g++,(d=f[g])&&(u.innerHTML=d.html,v(d.pos)),g>=f.length)&&g--,_(e))&&!y&&(S(),y=!0),h&&(!z(s=e)||"C"!==D(s))&&v(b())}}),e("keyup",e=>{e.defaultPrevented||e.isComposing||(m!==N()&&t(),l(e),a(N()))}),e("focus",e=>{o=!0}),e("blur",e=>{o=!1}),e("paste",e=>{var t;S(),(e=e).defaultPrevented||(C(e),e=(e.originalEvent??e).clipboardData.getData("text/plain").replace(/\r\n?/g,"\n"),t=b(),j(e),s(u),v({start:Math.min(t.start,t.end)+e.length,end:Math.min(t.start,t.end)+e.length,dir:"<-"})),S(),a(N())}),e("cut",e=>{var t,r;S(),e=e,t=b(),r=R(),(e.originalEvent??e).clipboardData.setData("text/plain",r.toString()),p.execCommand("delete"),s(u),v({start:Math.min(t.start,t.end),end:Math.min(t.start,t.end),dir:"<-"}),C(e),S(),a(N())}),{updateOptions(e){Object.assign(c,e)},updateCode(e,t=!0){u.textContent=e,s(u),t&&a(e)},onUpdate(e){a=e},toString:N,save:b,restore:v,recordHistory:S,destroy(){for(var[e,t]of n)u.removeEventListener(e,t)}}}var r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function ee(u,e){var c,p=r({class:"codejar-linenumbers",wrapClass:"codejar-wrap",width:"35px",backgroundColor:"rgba(128, 128, 128, 0.15)",color:""},e=void 0===e?{}:e);return function(e){var t,r,n,i,o,a;u(e),c||(t=e,r=p,n=getComputedStyle(t),(i=document.createElement("div")).className=r.wrapClass,i.style.position="relative",(o=document.createElement("div")).className="codejar-linenumbers-inner-wrap",o.style.background=n.background,o.style.marginTop=n.borderTopWidth,o.style.marginBottom=n.borderBottomWidth,o.style.marginLeft=n.borderLeftWidth,o.style.borderTopLeftRadius=n.borderTopLeftRadius,o.style.borderBottomLeftRadius=n.borderBottomLeftRadius,(a=document.createElement("div")).className=r.class,o.appendChild(a),i.appendChild(o),a.style.width=r.width,a.style.overflow="hidden",a.style.backgroundColor=r.backgroundColor,a.style.fontFamily=n.fontFamily,a.style.fontSize=n.fontSize,a.style.lineHeight=n.lineHeight,a.style.paddingTop="calc("+n.paddingTop+")",a.style.paddingLeft=n.paddingLeft,a.style.borderTopLeftRadius=n.borderTopLeftRadius,a.style.borderBottomLeftRadius=n.borderBottomLeftRadius,(o=document.createElement("div")).setAttribute("class","codejar-linenumber"),o.style.color=r.color||n.color,o.style.setProperty("mix-blend-mode","unset"),a.appendChild(o),t.style.paddingLeft="calc("+r.width+" + "+a.style.paddingLeft+" + 5px)",t.style.whiteSpace="pre",t.parentNode.insertBefore(i,t),i.appendChild(t),c=o,e.addEventListener("scroll",function(){return c.style.top="-"+e.scrollTop+"px"}));for(var s=(e.textContent||"").replace(/\n$/g,"").split("\n").length,l="",d=0;d<s;d++)l+=d+1+"\n";c.innerText=l}}var g=t(q(),1),c=(e=Prism,t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,(t=e.languages.markup)&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css")),Spicetify).React,te=({onClose:e})=>c.createElement("div",{className:"main-trackCreditsModal-header"},c.createElement("h1",{className:"main-type-alto","data-encore-id":"text"},"Stylizer"),c.createElement("button",{className:"main-trackCreditsModal-closeBtn",onClick:e},c.createElement("svg",{"data-encore-id":"icon",role:"img","aria-label":"Close","aria-hidden":"false",className:"e-91000-icon e-91000-baseline",viewBox:"0 0 16 16",style:{"--encore-icon-height":"var(--encore-graphic-size-informative-smaller);","--encore-icon-width":"var(--encore-graphic-size-informative-smaller);"}},c.createElement("path",{d:"M2.47 2.47a.75.75 0 0 1 1.06 0L8 6.94l4.47-4.47a.75.75 0 1 1 1.06 1.06L9.06 8l4.47 4.47a.75.75 0 1 1-1.06 1.06L8 9.06l-4.47 4.47a.75.75 0 0 1-1.06-1.06L6.94 8 2.47 3.53a.75.75 0 0 1 0-1.06",fill:"currentColor"})))),m="1.0.0",re=`
<h2>[1.0.1] - 2025-04-12</h2><br />
<h3>Fixed</h3><br />
<ul>
<li>Close button icon color</li>
<li>Improved project structure</li>
</ul><br />
<h2>[1.0.0] - 2025-12-18</h2><br />
<ul>
<li>Initial release</li>
</ul><br />
`,h=e=>"number"==typeof e?e:parseInt(e.replace("px",""),10)||0,y=e=>e+"px",_=()=>{Spicetify.PopupModal.display({title:"[Stylizer] Changelog",content:re,isLarge:!0})},b={stylizer:"stylizer-module__stylizer___pwMpc_stylizer",editor:"stylizer-module__editor___McM3p_stylizer",editor_content:"stylizer-module__editor_content___PUjPZ_stylizer",editor_body:"stylizer-module__editor_body___84nqr_stylizer",editor_line:"stylizer-module__editor_line___tX7ut_stylizer",editor_header:"stylizer-module__editor_header___EjLlN_stylizer",editor_tabbar:"stylizer-module__editor_tabbar___hZnER_stylizer",editor_tabbar_right:"stylizer-module__editor_tabbar_right___2xS9p_stylizer",editor_tabbar_item:"stylizer-module__editor_tabbar_item___ws1v9_stylizer",editor_tabbar_item_content:"stylizer-module__editor_tabbar_item_content___C60N6_stylizer",editor_codejar:"stylizer-module__editor_codejar___Bttye_stylizer"},v=Spicetify.React,{useState:ne,useRef:ie,useEffect:oe}=v,ae=({state:r,actions:n})=>{let[t,i]=ne(null),o=ie(null),e=ie(null),a=(oe(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&i(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),e=>{i(t===e?null:e)});return v.createElement("div",{ref:o,className:b.editor_tabbar},v.createElement("input",{type:"file",accept:".css",ref:e,style:{display:"none"},onChange:e=>{var t,r=null==(r=e.target.files)?void 0:r[0];r&&((t=new FileReader).onload=e=>{e=null==(e=e.target)?void 0:e.result;n.updateCode(e)},t.readAsText(r),e.target.value="",i(null))}}),v.createElement("div",{className:b.editor_tabbar_item},v.createElement("span",{onClick:()=>a("file")},"File"),"file"===t&&v.createElement("div",{className:b.editor_tabbar_item_content},v.createElement("ul",null,v.createElement("li",{id:"stt_tabbar_open",onClick:()=>{e.current&&e.current.click()}},"Open"),v.createElement("li",{id:"stt_save",onClick:()=>{var e=new Blob([r.code],{type:"text/css"}),e=URL.createObjectURL(e),t=document.createElement("a");t.href=e,t.download="style.css",t.click(),URL.revokeObjectURL(e),i(null)}},"Save"),v.createElement("hr",null),v.createElement("li",{id:"stt_tabbar_exit",onClick:()=>{n.toggle()}},"Exit")))),v.createElement("div",{className:b.editor_tabbar_item},v.createElement("span",{onClick:()=>a("preferences")},"Preferences"),"preferences"===t&&v.createElement("div",{className:b.editor_tabbar_item_content},v.createElement("ul",null,v.createElement("li",{id:"stt_tabbar_theme",style:{color:"gray",display:"flex",gap:5}},"Theme ",v.createElement("span",{style:{display:"inline-block"}},"(WIP)"))))),v.createElement("div",{className:b.editor_tabbar_item},v.createElement("span",{onClick:()=>a("help")},"Help"),"help"===t&&v.createElement("div",{className:b.editor_tabbar_item_content},v.createElement("ul",null,v.createElement("li",{id:"stt_tabbar_github"},v.createElement("a",{target:"_blank",href:"https://github.com/woidzero/stylizer"},"GitHub")),v.createElement("li",{id:"stt_tabbar_github"},v.createElement("a",{target:"_blank",href:"https://discord.woid.world/"},"Discord")),v.createElement("hr",null),v.createElement("li",{id:"stt_tabbar_github",onClick:()=>_()},"Changelog")))))},{React:k,ReactDOM:se}=Spicetify,le=k.useState,de=class{constructor(e,t,r={}){this.name=e,this.id=t,this.fields=r,this.setRerender=null,this.pushSettings=async()=>{for(Object.entries(this.fields).forEach(([e,t])=>{"button"!==t.type&&void 0===this.getFieldValue(e)&&this.setFieldValue(e,t.defaultValue)});!Spicetify?.Platform?.History?.listen;)await new Promise(e=>setTimeout(e,100));this.stopHistoryListener&&this.stopHistoryListener(),this.stopHistoryListener=Spicetify.Platform.History.listen(e=>{"/preferences"===e.pathname&&this.render()}),"/preferences"===Spicetify.Platform.History.location.pathname&&await this.render()},this.rerender=()=>{this.setRerender&&this.setRerender(Math.random())},this.render=async()=>{for(;!document.getElementById("desktop.settings.selectLanguage");){if("/preferences"!==Spicetify.Platform.History.location.pathname)return;await new Promise(e=>setTimeout(e,100))}var e=document.querySelector(".main-view-container__scroll-node-child main div");if(!e)return console.error("[spcr-settings] settings container not found");let t=Array.from(e.children).find(e=>e.id===this.id);t?console.log(t):((t=document.createElement("div")).id=this.id,e.appendChild(t)),se.render(k.createElement(this.FieldsContainer,null),t)},this.Button=(e,t,r,n,i,o,a)=>{this.fields[e]={type:"button",title:n,subtitle:i,description:t,value:r,events:{onClick:o,...a}}},this.Input=(e,t,r,n,i,o,a,s)=>{this.fields[e]={type:"input",title:n,subtitle:i,description:t,defaultValue:r,inputType:a,events:{onChange:o,...s}}},this.Hidden=(e,t)=>{this.fields[e]={type:"hidden",defaultValue:t}},this.Toggle=(e,t,r,n,i,o,a)=>{this.fields[e]={type:"toggle",title:n,subtitle:i,description:t,defaultValue:r,events:{onChange:o,...a}}},this.Dropdown=(e,t,r,n,i,o,a,s)=>{this.fields[e]={type:"dropdown",title:i,subtitle:o,description:t,defaultValue:r[n],options:r,events:{onSelect:a,...s}}},this.getFieldValue=e=>JSON.parse(Spicetify.LocalStorage.get(this.id+"."+e)||"{}")?.value,this.setFieldValue=(e,t)=>{Spicetify.LocalStorage.set(this.id+"."+e,JSON.stringify({value:t}))},this.FieldsContainer=()=>{var[e,t]=le(0);return this.setRerender=t,k.createElement("div",{className:"x-settings-section",key:e},k.createElement("h2",{className:"e-91000-text encore-text-body-medium-bold encore-internal-color-text-base"},this.name),Object.entries(this.fields).map(([e,t])=>k.createElement(this.Field,{nameId:e,field:t})))},this.Field=r=>{var e=this.id+"."+r.nameId;let t;if(t="button"===r.field.type?r.field.value:this.getFieldValue(r.nameId),"hidden"===r.field.type)return k.createElement(k.Fragment,null);let[n,i]=le(t),o=e=>{void 0!==e&&(i(e),this.setFieldValue(r.nameId,e))};return k.createElement("div",{className:"x-settings-row"},k.createElement("div",{className:"x-settings-firstColumn"},k.createElement("div",null,(r.field.title||r.field.subtitle)&&k.createElement("div",null,r.field.title&&k.createElement("label",{className:"e-91000-text encore-text-body-small encore-internal-color-text-base","data-encore-id":"text",htmlFor:e},r.field.title),r.field.subtitle&&k.createElement("label",{className:"e-91000-text encore-text-body-small encore-internal-color-text-subdued","data-encore-id":"text",htmlFor:e},r.field.subtitle)),r.field.description&&k.createElement("label",{className:"e-91000-text encore-text-body-small encore-internal-color-text-subdued","data-encore-id":"text",htmlFor:e},r.field.description))),k.createElement("div",{className:"x-settings-secondColumn"},"input"===r.field.type?k.createElement("input",{className:"x-settings-input",id:e,dir:"ltr",value:n,type:r.field.inputType||"text",...r.field.events,onChange:e=>{o(e.currentTarget.value);var t=r.field.events?.onChange;t&&t(e)}}):"button"===r.field.type?k.createElement("span",null,k.createElement("button",{id:e,className:"Button-sc-y0gtbx-0 Button-small-buttonSecondary-useBrowserDefaultFocusStyle x-settings-button",...r.field.events,onClick:e=>{o();var t=r.field.events?.onClick;t&&t(e)},type:"button"},n)):"toggle"===r.field.type?k.createElement("label",{className:"x-settings-secondColumn x-toggle-wrapper"},k.createElement("input",{id:e,className:"x-toggle-input",type:"checkbox",checked:n,...r.field.events,onClick:e=>{o(e.currentTarget.checked);var t=r.field.events?.onClick;t&&t(e)}}),k.createElement("span",{className:"x-toggle-indicatorWrapper"},k.createElement("span",{className:"x-toggle-indicator"}))):"dropdown"===r.field.type?k.createElement("select",{className:"main-dropDown-dropDown",id:e,...r.field.events,onChange:e=>{o(r.field.options[e.currentTarget.selectedIndex]);var t=r.field.events?.onChange;t&&t(e)}},r.field.options.map((e,t)=>k.createElement("option",{selected:e===n,value:t+1},e))):k.createElement(k.Fragment,null)))}}},ue={"one-dark":"prism-one-dark.css","vscode-dark":"prism-vsc-dark-plus.css"},D={EDITOR_POSITION:{x:"100px",y:"100px"},EDITOR_SIZE:{width:"600px",height:"400px"},EDITOR_TOGGLE_KEY:"F12",EDITOR_MIN_SIZE:{width:"100px",height:"100px"},EDITOR_LINE_HEIGHT:1.4,EDITOR_FONT:{family:"Jetbrains Mono",size:"12px"},EDITOR_TAB_SIZE:2,EDITOR_THEME:"one-dark"},j={CSS:"css",VERSION:"version",EDITOR_X:"editor.position-x",EDITOR_Y:"editor.position-y",EDITOR_WIDTH:"editor.width",EDITOR_HEIGHT:"editor.height",EDITOR_TOGGLE_KEY:"editor.toggle-key",EDITOR_LINE_HEIGHT:"editor.line-height",EDITOR_FONT_FAMILY:"editor.font-family",EDITOR_FONT_SIZE:"editor.font-size",EDITOR_TAB_SIZE:"editor.tab-size",EDITOR_THEME:"editor.theme"},ce=()=>{var e=new de("Stylizer","stylizer");return e.Hidden(j.CSS,""),e.Hidden(j.VERSION,m),e.Hidden(j.EDITOR_X,String(D.EDITOR_POSITION.x)),e.Hidden(j.EDITOR_Y,String(D.EDITOR_POSITION.y)),e.Hidden(j.EDITOR_WIDTH,String(D.EDITOR_SIZE.width)),e.Hidden(j.EDITOR_HEIGHT,String(D.EDITOR_SIZE.height)),e.Hidden(j.EDITOR_LINE_HEIGHT,String(D.EDITOR_LINE_HEIGHT)),e.Input(j.EDITOR_THEME,"Editor Theme",D.EDITOR_THEME,"Editor Theme"),e.Input(j.EDITOR_TAB_SIZE,"Editor Tab size",String(D.EDITOR_TAB_SIZE),"Keybind","Default to F12"),e.Input(j.EDITOR_FONT_FAMILY,"Font Family",String(D.EDITOR_FONT.family),"Font Family","Default to "+D.EDITOR_FONT.family),e.Input(j.EDITOR_FONT_SIZE,"Font Size",String(D.EDITOR_FONT.size),"Font Size","Default to "+D.EDITOR_FONT.size),e.Input(j.EDITOR_TOGGLE_KEY,"Keybind used to toggle Stylizer editor window",D.EDITOR_TOGGLE_KEY,"Keybind","Default to "+D.EDITOR_TOGGLE_KEY),e},F=ce(),{useState:pe,useRef:fe,useMemo:ge}=Spicetify.React,me=()=>{var e=fe();return e.current||(e.current=ce()),e.current},he=r=>{let e=fe(null),[t,n]=pe(()=>{var e;return{code:null!=(e=r.getFieldValue(j.CSS))?e:"",toggleKey:null!=(e=r.getFieldValue(j.EDITOR_TOGGLE_KEY))?e:D.EDITOR_TOGGLE_KEY,position:{x:null!=(e=r.getFieldValue(j.EDITOR_X))?e:D.EDITOR_POSITION.x,y:null!=(e=r.getFieldValue(j.EDITOR_Y))?e:D.EDITOR_POSITION.y},size:{width:null!=(e=r.getFieldValue(j.EDITOR_WIDTH))?e:D.EDITOR_SIZE.width,height:null!=(e=r.getFieldValue(j.EDITOR_HEIGHT))?e:D.EDITOR_SIZE.height},isVisible:!1}});return{state:t,actions:ge(()=>({toggle:()=>{n(e=>e.isVisible?d(l({},e),{isVisible:!1}):d(l({},e),{isVisible:!0,position:{x:null!=(e=r.getFieldValue(j.EDITOR_X))?e:D.EDITOR_POSITION.x,y:null!=(e=r.getFieldValue(j.EDITOR_Y))?e:D.EDITOR_POSITION.y},size:{width:null!=(e=r.getFieldValue(j.EDITOR_WIDTH))?e:D.EDITOR_SIZE.width,height:null!=(e=r.getFieldValue(j.EDITOR_HEIGHT))?e:D.EDITOR_SIZE.height}}))},updateCode:t=>{n(e=>d(l({},e),{code:t})),e.current&&clearTimeout(e.current),e.current=window.setTimeout(()=>{r.setFieldValue(j.CSS,t)},300)},updateKeybind:t=>{n(e=>d(l({},e),{keybind:t}))},updateStyles:t=>{n(e=>d(l({},e),{styles:t}))},updatePosition:t=>{n(e=>d(l({},e),{position:t})),r.setFieldValue(j.EDITOR_X,t.x),r.setFieldValue(j.EDITOR_Y,t.y)},updateSize:t=>{n(e=>d(l({},e),{size:t})),r.setFieldValue(j.EDITOR_WIDTH,t.width),r.setFieldValue(j.EDITOR_HEIGHT,t.height)}}),[r]),styles:ge(()=>{var e;return{theme:null!=(e=r.getFieldValue(j.EDITOR_THEME))?e:D.EDITOR_THEME,font:{size:null!=(e=r.getFieldValue(j.EDITOR_FONT_SIZE))?e:D.EDITOR_FONT.size,family:null!=(e=r.getFieldValue(j.EDITOR_FONT_FAMILY))?e:D.EDITOR_FONT.family},tabSize:String(null!=(e=r.getFieldValue(j.EDITOR_TAB_SIZE))?e:D.EDITOR_TAB_SIZE),lineHeight:String(null!=(e=r.getFieldValue(j.EDITOR_LINE_HEIGHT))?e:D.EDITOR_LINE_HEIGHT)}},[r])}},I={stylizer:"stylizer-module__stylizer___pwMpc_stylizer",editor:"stylizer-module__editor___McM3p_stylizer",editor_content:"stylizer-module__editor_content___PUjPZ_stylizer",editor_body:"stylizer-module__editor_body___84nqr_stylizer",editor_line:"stylizer-module__editor_line___tX7ut_stylizer",editor_header:"stylizer-module__editor_header___EjLlN_stylizer",editor_tabbar:"stylizer-module__editor_tabbar___hZnER_stylizer",editor_tabbar_right:"stylizer-module__editor_tabbar_right___2xS9p_stylizer",editor_tabbar_item:"stylizer-module__editor_tabbar_item___ws1v9_stylizer",editor_tabbar_item_content:"stylizer-module__editor_tabbar_item_content___C60N6_stylizer",editor_codejar:"stylizer-module__editor_codejar___Bttye_stylizer"},N=Spicetify.React,{useRef:C,useEffect:R}=N,ye=()=>{var e=me();let{state:i,actions:s,styles:o}=he(e),t=C(null),a=C(null),r=C(null),l=C(null),d=C(null);var e=h(i.position.x),n=h(i.position.y);let u=h(i.size.width),c=h(i.size.height);R(()=>{if(a.current){t=o.theme,(n=ue[t])?(n="https://cdn.jsdelivr.net/npm/prism-themes@1.9.0/themes/"+n,(r=document.createElement("link")).href=n,r.rel="stylesheet",r.type="text/css",document.head.appendChild(r),console.log(`[stylizer] theme ${t} loaded.`)):console.warn(`[stylizer] theme "${t}" not found`);var t,r,n=ee(e=>{var t=e.textContent||"";e.innerHTML=g.default.highlight(t,g.default.languages.css,"css")});let e=Q(a.current,n,{tab:"\t",indentOn:/[{([]$/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0});return l.current=e,i.code&&e.updateCode(i.code),e.onUpdate(s.updateCode),setTimeout(()=>{var e=null==(e=null==(e=a.current)?void 0:e.parentElement)?void 0:e.querySelector(".codejar-linenumbers");e instanceof HTMLDivElement&&(d.current=e)},100),()=>{e.destroy(),l.current=null,d.current=null}}},[]),R(()=>{l.current&&a.current&&(a.current.textContent||"")!==i.code&&l.current.updateCode(i.code)},[i.code]),R(()=>{if(a.current){let e=()=>{a.current&&d.current&&(d.current.scrollTop=a.current.scrollTop)},t=a.current;return t.addEventListener("scroll",e),()=>{t.removeEventListener("scroll",e)}}},[]),R(()=>{a.current&&(a.current.style.fontSize=o.font.size,a.current.style.fontFamily=o.font.family,a.current.style.tabSize=String(o.tabSize),a.current.style.lineHeight=o.lineHeight)},[o.font.size,o.font.family,o.tabSize,o.lineHeight]),R(()=>{let e=e=>{e.key===i.toggleKey&&(e.preventDefault(),s.toggle())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i.toggleKey,s]);return R(()=>{let e,t=null==(e=a.current)?void 0:e.parentElement;if(t){let e=()=>{d.current&&(d.current.scrollTop=t.scrollTop,console.debug(1))};return t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[]),R(()=>{var e=[];let t=a.current;for(;t;)e.push(t),t=t.parentElement;let r=e.map((e,t)=>{var r=()=>console.log("scroll on",t,e.className);return e.addEventListener("scroll",r),{node:e,h:r}});return()=>{r.forEach(({node:e,h:t})=>e.removeEventListener("scroll",t))}},[]),N.createElement("div",{className:I.stylizer,style:{"--editor-width":"string"==typeof i.size.width?i.size.width:y(i.size.width),"--editor-height":"string"==typeof i.size.height?i.size.height:y(i.size.height),"--editor-position-x":"string"==typeof i.position.x?i.position.x:y(i.position.x),"--editor-position-y":"string"==typeof i.position.y?i.position.y:y(i.position.y),"--editor-tab-size":o.tabSize,"--editor-line-height":o.lineHeight,"--editor-font-size":o.font.size,"--editor-font":o.font.family}},N.createElement("style",null,i.code),N.createElement(K.default,{handle:"#stylizer_header",nodeRef:r,position:{x:e,y:n},onStop:(e,t)=>{s.updatePosition({x:y(t.x),y:y(t.y)})}},N.createElement("div",{ref:e=>{r.current=e,t.current=e},className:I.editor+" main-embedWidgetGenerator-container",tabIndex:-1,style:{display:i.isVisible?"flex":"none"}},N.createElement("div",{className:I.editor_content},N.createElement("div",{className:I.editor_header,id:"stylizer_header"},N.createElement(te,{onClose:s.toggle}),N.createElement(ae,{state:i,actions:s,styles:o})),N.createElement("div",{className:I.editor_body,id:"stylizer_body"},N.createElement("div",{ref:a,className:I.editor_codejar,style:{fontSize:o.font.size,fontFamily:o.font.family,lineHeight:o.lineHeight,tabSize:o.tabSize}}))),N.createElement("div",{onMouseDown:e=>{e.preventDefault(),e.stopPropagation();let r=e.clientX,n=e.clientY,i=u,o=c,t=e=>{var t=Math.max(300,i+e.clientX-r),e=Math.max(200,o+e.clientY-n);s.updateSize({width:y(t),height:y(e)})},a=()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",a)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",a)},style:{width:14,height:14,position:"absolute",right:0,bottom:0,cursor:"nwse-resize",background:"#888"}}))))},{React:_e,ReactDOM:be}=Spicetify;async function ve(){let e,t;for(;;){if(t=document.querySelector("body"),null!=(e=null==Spicetify?void 0:Spicetify.Platform)&&e.History&&t)break;await new Promise(e=>setTimeout(e,100))}F.pushSettings();var r=document.getElementById("stylizer__root");r||((r=document.createElement("div")).id="stylizer__root",t.prepend(r),be.render(_e.createElement(ye,null),r),console.debug("[stylizer] editor rendered")),F.getFieldValue(j.VERSION)!==m&&(_(),F.setFieldValue(j.VERSION,m))}ve(),(async()=>{await ve()})(),(async()=>{var e;document.getElementById("stylizer")||((e=document.createElement("style")).id="stylizer",e.textContent=String.raw`
.stylizer-module__stylizer___pwMpc_stylizer *{-webkit-box-align:center;-webkit-box-pack:center;-webkit-app-region:no-drag}.stylizer-module__editor___McM3p_stylizer{box-sizing:border-box;position:fixed;display:flex;z-index:9999;pointer-events:all;flex-direction:column;overflow:hidden;width:var(--editor-width);height:var(--editor-height)}.stylizer-module__editor_content___PUjPZ_stylizer{display:flex;flex-direction:column;padding:0;margin:0;width:100%;height:100%}.stylizer-module__editor_body___84nqr_stylizer{display:flex;flex:1;overflow:hidden}.stylizer-module__editor_line___tX7ut_stylizer{height:1.4em;line-height:1.4em}.stylizer-module__editor_header___EjLlN_stylizer{outline:0 solid transparent}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child{display:flex;flex-direction:row;justify-content:space-between;padding:10px 15px;font-size:15px;align-items:center;border:0}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child h1{font-size:20px;line-height:1}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child button{display:flex;align-items:center;justify-content:center;width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content;padding:5px}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child button:hover{background-color:rgba(255,255,255,.1);scale:none!important;transform:none!important;border-radius:99%}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child svg{width:20px;height:20px}.stylizer-module__editor_tabbar___hZnER_stylizer{display:flex;background-color:var(--spice-player);border-bottom:1px solid rgba(var(--spice-rgb-selected-row),.1);flex-direction:row;width:100%;padding:10px 15px;padding-top:0;gap:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.stylizer-module__editor_tabbar_right___2xS9p_stylizer{padding-left:auto}.stylizer-module__editor_tabbar_item___ws1v9_stylizer{display:flex;position:relative;border-radius:4px;padding:2px 8px}.stylizer-module__editor_tabbar_item___ws1v9_stylizer:hover{background-color:rgba(var(--spice-rgb-selected-row),.1)}.stylizer-module__editor_tabbar_item_content___C60N6_stylizer{display:flex;flex-direction:column;position:absolute;top:100%;left:0;background:#000;z-index:10;padding:15px}.stylizer-module__editor_tabbar_item_content___C60N6_stylizer hr{border-color:rgba(var(--spice-rgb-selected-row),.3)}.stylizer-module__editor_codejar___Bttye_stylizer{flex:1;width:100%;height:100%;overflow:auto;padding:10px!important;margin:0;outline:0;border:none;color:var(--spice-text);white-space:pre!important;word-wrap:normal!important;overflow-wrap:normal!important;caret-color:#fff!important;background:0 0!important}.stylizer-module__editor_codejar___Bttye_stylizer:focus{outline:0}.stylizer-module__editor_codejar___Bttye_stylizer *{white-space:pre!important}.stylizer-module__editor_codejar___Bttye_stylizer::-moz-selection{background:rgba(255,255,255,.1)!important}.stylizer-module__editor_codejar___Bttye_stylizer::selection{background:rgba(255,255,255,.1)!important}.stylizer-module__editor_codejar___Bttye_stylizer{tab-size:var(--editor-tab-size)!important;-moz-tab-size:var(--editor-tab-size)!important;-o-tab-size:var(--editor-tab-size)!important;font-size:var(--editor-font-size)!important;font-family:var(--editor-font),monospace!important;line-height:var(--editor-lineHeight)!important}.stylizer-module__editor_codejar___Bttye_stylizer code,.stylizer-module__editor_codejar___Bttye_stylizer pre,.stylizer-module__editor_codejar___Bttye_stylizer span,.stylizer-module__editor_codejar___Bttye_stylizer>*{background:0 0!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;white-space:pre-wrap!important;word-break:break-word!important}.stylizer-module__stylizer___pwMpc_stylizer *{-webkit-box-align:center;-webkit-box-pack:center;-webkit-app-region:no-drag}.stylizer-module__editor___McM3p_stylizer{box-sizing:border-box;position:fixed;display:flex;z-index:9999;pointer-events:all;flex-direction:column;overflow:hidden;width:var(--editor-width);height:var(--editor-height)}.stylizer-module__editor_content___PUjPZ_stylizer{display:flex;flex-direction:column;padding:0;margin:0;width:100%;height:100%}.stylizer-module__editor_body___84nqr_stylizer{display:flex;flex:1;overflow:hidden}.stylizer-module__editor_line___tX7ut_stylizer{height:1.4em;line-height:1.4em}.stylizer-module__editor_header___EjLlN_stylizer{outline:0 solid transparent}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child{display:flex;flex-direction:row;justify-content:space-between;padding:10px 15px;font-size:15px;align-items:center;border:0}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child h1{font-size:20px;line-height:1}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child button{display:flex;align-items:center;justify-content:center;width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content;padding:5px}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child button:hover{background-color:rgba(255,255,255,.1);scale:none!important;transform:none!important;border-radius:99%}.stylizer-module__editor_header___EjLlN_stylizer>div:first-child svg{width:20px;height:20px}.stylizer-module__editor_tabbar___hZnER_stylizer{display:flex;background-color:var(--spice-player);border-bottom:1px solid rgba(var(--spice-rgb-selected-row),.1);flex-direction:row;width:100%;padding:10px 15px;padding-top:0;gap:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.stylizer-module__editor_tabbar_right___2xS9p_stylizer{padding-left:auto}.stylizer-module__editor_tabbar_item___ws1v9_stylizer{display:flex;position:relative;border-radius:4px;padding:2px 8px}.stylizer-module__editor_tabbar_item___ws1v9_stylizer:hover{background-color:rgba(var(--spice-rgb-selected-row),.1)}.stylizer-module__editor_tabbar_item_content___C60N6_stylizer{display:flex;flex-direction:column;position:absolute;top:100%;left:0;background:#000;z-index:10;padding:15px}.stylizer-module__editor_tabbar_item_content___C60N6_stylizer hr{border-color:rgba(var(--spice-rgb-selected-row),.3)}.stylizer-module__editor_codejar___Bttye_stylizer{flex:1;width:100%;height:100%;overflow:auto;padding:10px!important;margin:0;outline:0;border:none;color:var(--spice-text);white-space:pre!important;word-wrap:normal!important;overflow-wrap:normal!important;caret-color:#fff!important;background:0 0!important}.stylizer-module__editor_codejar___Bttye_stylizer:focus{outline:0}.stylizer-module__editor_codejar___Bttye_stylizer *{white-space:pre!important}.stylizer-module__editor_codejar___Bttye_stylizer::-moz-selection{background:rgba(255,255,255,.1)!important}.stylizer-module__editor_codejar___Bttye_stylizer::selection{background:rgba(255,255,255,.1)!important}.stylizer-module__editor_codejar___Bttye_stylizer{tab-size:var(--editor-tab-size)!important;-moz-tab-size:var(--editor-tab-size)!important;-o-tab-size:var(--editor-tab-size)!important;font-size:var(--editor-font-size)!important;font-family:var(--editor-font),monospace!important;line-height:var(--editor-lineHeight)!important}.stylizer-module__editor_codejar___Bttye_stylizer code,.stylizer-module__editor_codejar___Bttye_stylizer pre,.stylizer-module__editor_codejar___Bttye_stylizer span,.stylizer-module__editor_codejar___Bttye_stylizer>*{background:0 0!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;white-space:pre-wrap!important;word-break:break-word!important}.codejar-wrap{display:flex!important;flex-direction:row!important;width:100%!important;height:100%!important;overflow:hidden!important;background-color:rgba(0,0,0,.2)!important}.codejar-linenumbers-inner-wrap{background:var(--spice-player)!important;margin:0!important;border-radius:0!important;position:relative!important;left:0!important;height:auto!important;min-height:100%!important}.codejar-linenumbers{width:40px!important;height:100%!important;overflow-y:hidden!important;background-color:var(--spice-player)!important;color:var(--essential-subdued)!important;padding:10px 8px 10px 0!important;text-align:right!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important;border-radius:0!important}.codejar-linenumber{color:var(--essential-subdued)!important;mix-blend-mode:normal!important}
`.trim(),document.head.appendChild(e))})()})();