@salesforce/ui-design-mode 12.5.2 → 12.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var ni=Object.create;var Wa=Object.defineProperty;var ii=Object.getOwnPropertyDescriptor;var si=Object.getOwnPropertyNames;var ui=Object.getPrototypeOf,di=Object.prototype.hasOwnProperty;var ci=(e,t,o)=>t in e?Wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Xt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var fi=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of si(t))!di.call(e,r)&&r!==o&&Wa(e,r,{get:()=>t[r],enumerable:!(a=ii(t,r))||a.enumerable});return e};var Vn=(e,t,o)=>(o=e!=null?ni(ui(e)):{},fi(t||!e||!e.__esModule?Wa(o,"default",{value:e,enumerable:!0}):o,e));var nt=(e,t,o)=>ci(e,typeof t!="symbol"?t+"":t,o);var Z0=Xt((zw,A0)=>{"use strict";var _7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";A0.exports=_7});var U0=Xt((jw,N0)=>{"use strict";var D7=Z0();function F0(){}function $0(){}$0.resetWarningCache=F0;N0.exports=function(){function e(a,r,l,n,i,s){if(s!==D7){var u=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");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:$0,resetWarningCache:F0};return o.PropTypes=o,o}});var z0=Xt((Ww,q0)=>{q0.exports=U0()();var Kw,Gw});var K0=Xt(xe=>{"use strict";var Ml=Symbol.for("react.element"),Sl=Symbol.for("react.portal"),Ia=Symbol.for("react.fragment"),ya=Symbol.for("react.strict_mode"),Ma=Symbol.for("react.profiler"),Sa=Symbol.for("react.provider"),Ra=Symbol.for("react.context"),O7=Symbol.for("react.server_context"),ka=Symbol.for("react.forward_ref"),Ha=Symbol.for("react.suspense"),Pa=Symbol.for("react.suspense_list"),Ta=Symbol.for("react.memo"),Va=Symbol.for("react.lazy"),E7=Symbol.for("react.offscreen"),j0;j0=Symbol.for("react.module.reference");function m1(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ml:switch(e=e.type,e){case Ia:case Ma:case ya:case Ha:case Pa:return e;default:switch(e=e&&e.$$typeof,e){case O7:case Ra:case ka:case Va:case Ta:case Sa:return e;default:return t}}case Sl:return t}}}xe.ContextConsumer=Ra;xe.ContextProvider=Sa;xe.Element=Ml;xe.ForwardRef=ka;xe.Fragment=Ia;xe.Lazy=Va;xe.Memo=Ta;xe.Portal=Sl;xe.Profiler=Ma;xe.StrictMode=ya;xe.Suspense=Ha;xe.SuspenseList=Pa;xe.isAsyncMode=function(){return!1};xe.isConcurrentMode=function(){return!1};xe.isContextConsumer=function(e){return m1(e)===Ra};xe.isContextProvider=function(e){return m1(e)===Sa};xe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ml};xe.isForwardRef=function(e){return m1(e)===ka};xe.isFragment=function(e){return m1(e)===Ia};xe.isLazy=function(e){return m1(e)===Va};xe.isMemo=function(e){return m1(e)===Ta};xe.isPortal=function(e){return m1(e)===Sl};xe.isProfiler=function(e){return m1(e)===Ma};xe.isStrictMode=function(e){return m1(e)===ya};xe.isSuspense=function(e){return m1(e)===Ha};xe.isSuspenseList=function(e){return m1(e)===Pa};xe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ia||e===Ma||e===ya||e===Ha||e===Pa||e===E7||typeof e=="object"&&e!==null&&(e.$$typeof===Va||e.$$typeof===Ta||e.$$typeof===Sa||e.$$typeof===Ra||e.$$typeof===ka||e.$$typeof===j0||e.getModuleId!==void 0)};xe.typeOf=m1});var W0=Xt((Qw,G0)=>{"use strict";G0.exports=K0()});import{forwardRef as Me,createElement as ee}from"react";function Se(e,t){if(e==null)return{};var o={},a=Object.keys(e),r,l;for(l=0;l<a.length;l++)r=a[l],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var pi=["color"],_n=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,pi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M0 7.5C0 7.22386 0.223858 7 0.5 7H3C3.27614 7 3.5 7.22386 3.5 7.5C3.5 7.77614 3.27614 8 3 8H0.5C0.223858 8 0 7.77614 0 7.5ZM5.75 7.5C5.75 7.22386 5.97386 7 6.25 7H8.75C9.02614 7 9.25 7.22386 9.25 7.5C9.25 7.77614 9.02614 8 8.75 8H6.25C5.97386 8 5.75 7.77614 5.75 7.5ZM12 7C11.7239 7 11.5 7.22386 11.5 7.5C11.5 7.77614 11.7239 8 12 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Ci=["color"],Dn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Ci);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M1.5 6.625C1.01675 6.625 0.625 7.01675 0.625 7.5C0.625 7.98325 1.01675 8.375 1.5 8.375C1.98325 8.375 2.375 7.98325 2.375 7.5C2.375 7.01675 1.98325 6.625 1.5 6.625ZM5.5 6.625C5.01675 6.625 4.625 7.01675 4.625 7.5C4.625 7.98325 5.01675 8.375 5.5 8.375C5.98325 8.375 6.375 7.98325 6.375 7.5C6.375 7.01675 5.98325 6.625 5.5 6.625ZM9.5 6.625C9.01675 6.625 8.625 7.01675 8.625 7.5C8.625 7.98325 9.01675 8.375 9.5 8.375C9.98325 8.375 10.375 7.98325 10.375 7.5C10.375 7.01675 9.98325 6.625 9.5 6.625ZM12.625 7.5C12.625 7.01675 13.0168 6.625 13.5 6.625C13.9832 6.625 14.375 7.01675 14.375 7.5C14.375 7.98325 13.9832 8.375 13.5 8.375C13.0168 8.375 12.625 7.98325 12.625 7.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var mi=["color"],On=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,mi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M1.25 7.5C1.25 7.22386 1.47386 7 1.75 7H13.25C13.5261 7 13.75 7.22386 13.75 7.5C13.75 7.77614 13.5261 8 13.25 8H1.75C1.47386 8 1.25 7.77614 1.25 7.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var hi=["color"],En=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,hi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var gi=["color"],$1=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,gi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var vi=["color"],Bn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,vi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M5.67494 3.50017C5.67494 3.25164 5.87641 3.05017 6.12494 3.05017H10.6249C10.8735 3.05017 11.0749 3.25164 11.0749 3.50017C11.0749 3.7487 10.8735 3.95017 10.6249 3.95017H9.00587L7.2309 11.05H8.87493C9.12345 11.05 9.32493 11.2515 9.32493 11.5C9.32493 11.7486 9.12345 11.95 8.87493 11.95H4.37493C4.1264 11.95 3.92493 11.7486 3.92493 11.5C3.92493 11.2515 4.1264 11.05 4.37493 11.05H5.99397L7.76894 3.95017H6.12494C5.87641 3.95017 5.67494 3.7487 5.67494 3.50017Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),xi=["color"],An=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,xi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M4.79993 3.50017C4.79993 3.25164 5.0014 3.05017 5.24993 3.05017H9.74993C9.99845 3.05017 10.1999 3.25164 10.1999 3.50017C10.1999 3.7487 9.99845 3.95017 9.74993 3.95017H8.09993V11.05H9.74994C9.99847 11.05 10.1999 11.2515 10.1999 11.5C10.1999 11.7486 9.99847 11.95 9.74994 11.95H5.24994C5.00141 11.95 4.79994 11.7486 4.79994 11.5C4.79994 11.2515 5.00141 11.05 5.24994 11.05H6.89993V3.95017H5.24993C5.0014 3.95017 4.79993 3.7487 4.79993 3.50017Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Li=["color"],Zn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Li);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M2.78233 2.21707C2.70732 2.14206 2.60557 2.09991 2.49949 2.09991C2.3934 2.09991 2.29166 2.14206 2.21664 2.21707L0.216645 4.21707C0.0604351 4.37328 0.0604351 4.62655 0.216645 4.78276C0.372855 4.93897 0.626121 4.93897 0.78233 4.78276L2.09949 3.4656L2.09949 11.5342L0.78233 10.2171C0.62612 10.0609 0.372854 10.0609 0.216645 10.2171C0.0604349 10.3733 0.0604349 10.6265 0.216645 10.7828L2.21664 12.7828C2.29166 12.8578 2.3934 12.8999 2.49949 12.8999C2.60557 12.8999 2.70731 12.8578 2.78233 12.7828L4.78233 10.7828C4.93854 10.6265 4.93854 10.3733 4.78233 10.2171C4.62612 10.0609 4.37285 10.0609 4.21664 10.2171L2.89949 11.5342L2.89949 3.4656L4.21664 4.78276C4.37285 4.93897 4.62612 4.93897 4.78233 4.78276C4.93854 4.62655 4.93854 4.37328 4.78233 4.21707L2.78233 2.21707ZM10.5 2.74997C10.7107 2.74997 10.8988 2.88211 10.9703 3.08036L13.9703 11.3999C14.064 11.6597 13.9293 11.9462 13.6696 12.0399C13.4098 12.1336 13.1233 11.9989 13.0296 11.7392L12.0477 9.016H8.95228L7.97033 11.7392C7.87666 11.9989 7.59013 12.1336 7.33036 12.0399C7.07059 11.9462 6.93595 11.6597 7.02962 11.3999L10.0296 3.08036C10.1011 2.88211 10.2892 2.74997 10.5 2.74997ZM10.5 4.72396L11.7412 8.166H9.25879L10.5 4.72396Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var wi=["color"],Fn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,wi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M7.1813 1.68179C7.35704 1.50605 7.64196 1.50605 7.8177 1.68179L10.3177 4.18179C10.4934 4.35753 10.4934 4.64245 10.3177 4.81819C10.142 4.99392 9.85704 4.99392 9.6813 4.81819L7.9495 3.08638L7.9495 11.9136L9.6813 10.1818C9.85704 10.0061 10.142 10.0061 10.3177 10.1818C10.4934 10.3575 10.4934 10.6424 10.3177 10.8182L7.8177 13.3182C7.73331 13.4026 7.61885 13.45 7.4995 13.45C7.38015 13.45 7.26569 13.4026 7.1813 13.3182L4.6813 10.8182C4.50557 10.6424 4.50557 10.3575 4.6813 10.1818C4.85704 10.0061 5.14196 10.0061 5.3177 10.1818L7.0495 11.9136L7.0495 3.08638L5.3177 4.81819C5.14196 4.99392 4.85704 4.99392 4.6813 4.81819C4.50557 4.64245 4.50557 4.35753 4.6813 4.18179L7.1813 1.68179Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var bi=["color"],$n=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,bi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M6.5 1C6.22386 1 6 1.22386 6 1.5C6 1.77614 6.22386 2 6.5 2C7.12671 2 7.45718 2.20028 7.65563 2.47812C7.8781 2.78957 8 3.28837 8 4V11C8 11.7116 7.8781 12.2104 7.65563 12.5219C7.45718 12.7997 7.12671 13 6.5 13C6.22386 13 6 13.2239 6 13.5C6 13.7761 6.22386 14 6.5 14C7.37329 14 8.04282 13.7003 8.46937 13.1031C8.47976 13.0886 8.48997 13.0739 8.5 13.0591C8.51003 13.0739 8.52024 13.0886 8.53063 13.1031C8.95718 13.7003 9.62671 14 10.5 14C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13C9.87329 13 9.54282 12.7997 9.34437 12.5219C9.1219 12.2104 9 11.7116 9 11V4C9 3.28837 9.1219 2.78957 9.34437 2.47812C9.54282 2.20028 9.87329 2 10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1C9.62671 1 8.95718 1.29972 8.53063 1.89688C8.52024 1.91143 8.51003 1.92611 8.5 1.9409C8.48997 1.92611 8.47976 1.91143 8.46937 1.89688C8.04282 1.29972 7.37329 1 6.5 1ZM14 5H11V4H14C14.5523 4 15 4.44772 15 5V10C15 10.5523 14.5523 11 14 11H11V10H14V5ZM6 4V5H1L1 10H6V11H1C0.447715 11 0 10.5523 0 10V5C0 4.44772 0.447715 4 1 4H6Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Ii=["color"],Nn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Ii);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M3.68979 2.75C3.89667 2.74979 4.08232 2.87701 4.15679 3.07003L7.36662 11.39C7.46602 11.6477 7.33774 11.9371 7.0801 12.0365C6.82247 12.1359 6.53304 12.0076 6.43365 11.75L5.3825 9.02537H2.01133L0.966992 11.749C0.868128 12.0068 0.578964 12.1357 0.321126 12.0369C0.0632878 11.938 -0.0655864 11.6488 0.0332774 11.391L3.22344 3.07099C3.29751 2.87782 3.4829 2.75021 3.68979 2.75ZM3.69174 4.64284L5.05458 8.17537H2.33724L3.69174 4.64284ZM10.8989 5.20703C9.25818 5.20703 8.00915 6.68569 8.00915 8.60972C8.00915 10.6337 9.35818 12.0124 10.8989 12.0124C11.7214 12.0124 12.5744 11.6692 13.1543 11.0219V11.53C13.1543 11.7785 13.3557 11.98 13.6043 11.98C13.8528 11.98 14.0543 11.7785 14.0543 11.53V5.72C14.0543 5.47147 13.8528 5.27 13.6043 5.27C13.3557 5.27 13.1543 5.47147 13.1543 5.72V6.22317C12.6054 5.60095 11.7924 5.20703 10.8989 5.20703ZM13.1543 9.79823V7.30195C12.7639 6.58101 11.9414 6.05757 11.0868 6.05757C10.1088 6.05757 9.03503 6.96581 9.03503 8.60955C9.03503 10.1533 10.0088 11.1615 11.0868 11.1615C11.9701 11.1615 12.7719 10.4952 13.1543 9.79823Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),yi=["color"],Un=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,yi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M3.69899 5.20703C2.05823 5.20703 0.809204 6.68569 0.809204 8.60972C0.809204 10.6337 2.15823 12.0124 3.69899 12.0124C4.52126 12.0124 5.37402 11.6693 5.9539 11.0223V11.53C5.9539 11.7785 6.15537 11.98 6.4039 11.98C6.65243 11.98 6.8539 11.7785 6.8539 11.53V5.72001C6.8539 5.47149 6.65243 5.27001 6.4039 5.27001C6.15537 5.27001 5.9539 5.47149 5.9539 5.72001V6.22269C5.40506 5.60075 4.59218 5.20703 3.69899 5.20703ZM5.9539 9.799V7.30117C5.56339 6.58064 4.74118 6.05757 3.8868 6.05757C2.9089 6.05757 1.83508 6.96581 1.83508 8.60955C1.83508 10.1533 2.80889 11.1615 3.8868 11.1615C4.76984 11.1615 5.57141 10.4957 5.9539 9.799ZM10.799 5.20703C9.15823 5.20703 7.9092 6.68569 7.9092 8.60972C7.9092 10.6337 9.25823 12.0124 10.799 12.0124C11.6215 12.0124 12.4744 11.6692 13.0543 11.0218V11.53C13.0543 11.7785 13.2558 11.98 13.5043 11.98C13.7529 11.98 13.9543 11.7785 13.9543 11.53V5.72C13.9543 5.47147 13.7529 5.27 13.5043 5.27C13.2558 5.27 13.0543 5.47147 13.0543 5.72V6.22318C12.5055 5.60095 11.6924 5.20703 10.799 5.20703ZM13.0543 9.79822V7.30196C12.664 6.58102 11.8415 6.05757 10.9868 6.05757C10.0089 6.05757 8.93508 6.96581 8.93508 8.60955C8.93508 10.1533 9.90889 11.1615 10.9868 11.1615C11.8702 11.1615 12.672 10.4952 13.0543 9.79822Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Mi=["color"],qn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Mi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M3.6255 2.75C3.83478 2.75 4.02192 2.88034 4.09448 3.07664L7.16985 11.3962C7.2656 11.6552 7.13324 11.9428 6.87423 12.0386C6.61522 12.1343 6.32763 12.002 6.23188 11.7429L5.22387 9.01603H2.02712L1.01911 11.7429C0.923362 12.002 0.635774 12.1343 0.376762 12.0386C0.117749 11.9428 -0.0146052 11.6552 0.0811401 11.3962L3.15651 3.07664C3.22908 2.88034 3.41621 2.75 3.6255 2.75ZM3.6255 4.69207L4.90966 8.16603H2.34133L3.6255 4.69207ZM11.3719 2.75C11.5811 2.75 11.7683 2.88034 11.8408 3.07664L14.9162 11.3962C15.012 11.6552 14.8796 11.9428 14.6206 12.0386C14.3616 12.1343 14.074 12.002 13.9782 11.7429L12.9702 9.01603H9.77348L8.76547 11.7429C8.66972 12.002 8.38213 12.1343 8.12312 12.0386C7.86411 11.9428 7.73175 11.6552 7.8275 11.3962L10.9029 3.07664C10.9754 2.88034 11.1626 2.75 11.3719 2.75ZM11.3719 4.69207L12.656 8.16603H10.0877L11.3719 4.69207Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Si=["color"],zn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Si);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M4.55293 0.999969C4.75295 0.999969 4.93372 1.11917 5.0125 1.30301L8.01106 8.29982C8.11984 8.55363 8.00226 8.84757 7.74844 8.95635C7.49463 9.06512 7.20069 8.94754 7.09191 8.69373L6.11613 6.41685H2.98973L2.01395 8.69373C1.90517 8.94754 1.61123 9.06512 1.35742 8.95635C1.1036 8.84757 0.986023 8.55363 1.0948 8.29982L4.09336 1.30301C4.17214 1.11917 4.35291 0.999969 4.55293 0.999969ZM4.55293 2.76929L5.75186 5.56685H3.354L4.55293 2.76929ZM11.0562 9.00214C11.2617 9.00214 11.4463 8.87633 11.5215 8.68502L14.2733 1.68299C14.3743 1.42598 14.2478 1.13575 13.9908 1.03475C13.7338 0.933747 13.4436 1.06021 13.3426 1.31722L11.0562 7.13514L8.76973 1.31722C8.66873 1.06021 8.3785 0.933747 8.1215 1.03475C7.86449 1.13575 7.73802 1.42598 7.83902 1.68299L10.5908 8.68502C10.666 8.87633 10.8506 9.00214 11.0562 9.00214ZM14.9537 12.4999C14.9537 12.606 14.9115 12.7077 14.8365 12.7828L12.8365 14.7828C12.6803 14.939 12.4271 14.939 12.2708 14.7828C12.1146 14.6265 12.1146 14.3733 12.2708 14.2171L13.588 12.8999H1.51937L2.83653 14.2171C2.99274 14.3733 2.99274 14.6265 2.83653 14.7828C2.68032 14.939 2.42705 14.939 2.27084 14.7828L0.270843 12.7828C0.195828 12.7077 0.153687 12.606 0.153687 12.4999C0.153687 12.3938 0.195828 12.2921 0.270843 12.2171L2.27084 10.2171C2.42705 10.0609 2.68032 10.0609 2.83653 10.2171C2.99274 10.3733 2.99274 10.6265 2.83653 10.7828L1.51937 12.0999L13.588 12.0999L12.2708 10.7828C12.1146 10.6265 12.1146 10.3733 12.2708 10.2171C12.4271 10.0609 12.6803 10.0609 12.8365 10.2171L14.8365 12.2171C14.9115 12.2921 14.9537 12.3938 14.9537 12.4999Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Ri=["color"],jn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Ri);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M3.78233 2.21713C3.70732 2.14212 3.60557 2.09998 3.49949 2.09998C3.3934 2.09998 3.29166 2.14212 3.21664 2.21713L1.21664 4.21713C1.06044 4.37334 1.06044 4.62661 1.21664 4.78282C1.37285 4.93903 1.62612 4.93903 1.78233 4.78282L3.09949 3.46566L3.09949 11.5343L1.78233 10.2171C1.62612 10.0609 1.37285 10.0609 1.21664 10.2171C1.06043 10.3733 1.06043 10.6266 1.21664 10.7828L3.21664 12.7828C3.29166 12.8578 3.3934 12.9 3.49949 12.9C3.60557 12.9 3.70731 12.8578 3.78233 12.7828L5.78233 10.7828C5.93854 10.6266 5.93854 10.3733 5.78233 10.2171C5.62612 10.0609 5.37285 10.0609 5.21664 10.2171L3.89949 11.5343L3.89949 3.46566L5.21664 4.78282C5.37285 4.93903 5.62612 4.93903 5.78233 4.78282C5.93854 4.62661 5.93854 4.37334 5.78233 4.21713L3.78233 2.21713ZM8.49998 3.99997C8.22383 3.99997 7.99998 4.22382 7.99998 4.49997C7.99998 4.77611 8.22383 4.99997 8.49998 4.99997H14.5C14.7761 4.99997 15 4.77611 15 4.49997C15 4.22382 14.7761 3.99997 14.5 3.99997H8.49998ZM7.99998 7.49997C7.99998 7.22382 8.22383 6.99997 8.49998 6.99997H14.5C14.7761 6.99997 15 7.22382 15 7.49997C15 7.77611 14.7761 7.99997 14.5 7.99997H8.49998C8.22383 7.99997 7.99998 7.77611 7.99998 7.49997ZM8.49998 9.99997C8.22383 9.99997 7.99998 10.2238 7.99998 10.5C7.99998 10.7761 8.22383 11 8.49998 11H14.5C14.7761 11 15 10.7761 15 10.5C15 10.2238 14.7761 9.99997 14.5 9.99997H8.49998Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var ki=["color"],Kn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,ki);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M4.85355 2.14645C5.04882 2.34171 5.04882 2.65829 4.85355 2.85355L3.70711 4H9C11.4853 4 13.5 6.01472 13.5 8.5C13.5 10.9853 11.4853 13 9 13H5C4.72386 13 4.5 12.7761 4.5 12.5C4.5 12.2239 4.72386 12 5 12H9C10.933 12 12.5 10.433 12.5 8.5C12.5 6.567 10.933 5 9 5H3.70711L4.85355 6.14645C5.04882 6.34171 5.04882 6.65829 4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355L2.14645 4.85355C1.95118 4.65829 1.95118 4.34171 2.14645 4.14645L4.14645 2.14645C4.34171 1.95118 4.65829 1.95118 4.85355 2.14645Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Hi=["color"],Gn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Hi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M5.00003 3.25C5.00003 2.97386 4.77617 2.75 4.50003 2.75C4.22389 2.75 4.00003 2.97386 4.00003 3.25V7.10003H2.49998C2.27906 7.10003 2.09998 7.27912 2.09998 7.50003C2.09998 7.72094 2.27906 7.90003 2.49998 7.90003H4.00003V8.55C4.00003 10.483 5.56703 12.05 7.50003 12.05C9.43303 12.05 11 10.483 11 8.55V7.90003H12.5C12.7209 7.90003 12.9 7.72094 12.9 7.50003C12.9 7.27912 12.7209 7.10003 12.5 7.10003H11V3.25C11 2.97386 10.7762 2.75 10.5 2.75C10.2239 2.75 10 2.97386 10 3.25V7.10003H5.00003V3.25ZM5.00003 7.90003V8.55C5.00003 9.93071 6.11932 11.05 7.50003 11.05C8.88074 11.05 10 9.93071 10 8.55V7.90003H5.00003Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Pi=["color"],Wn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Pi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Ti=["color"],Xn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Ti);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Vi=["color"],Qn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Vi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var _i=["color"],Yn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,_i);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Di=["color"],Jn=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Di);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:a}))});var Oi=["color"],e9=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Oi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:a}))});var Ei=["color"],t9=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Ei);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M5.00001 2.75C5.00001 2.47386 4.77615 2.25 4.50001 2.25C4.22387 2.25 4.00001 2.47386 4.00001 2.75V8.05C4.00001 9.983 5.56702 11.55 7.50001 11.55C9.43301 11.55 11 9.983 11 8.05V2.75C11 2.47386 10.7762 2.25 10.5 2.25C10.2239 2.25 10 2.47386 10 2.75V8.05C10 9.43071 8.88072 10.55 7.50001 10.55C6.1193 10.55 5.00001 9.43071 5.00001 8.05V2.75ZM3.49998 13.1001C3.27906 13.1001 3.09998 13.2791 3.09998 13.5001C3.09998 13.721 3.27906 13.9001 3.49998 13.9001H11.5C11.7209 13.9001 11.9 13.721 11.9 13.5001C11.9 13.2791 11.7209 13.1001 11.5 13.1001H3.49998Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Bi=["color"],o9=Me(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=Se(e,Bi);return ee("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),ee("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});import Le from"react";import{createRoot as S8}from"react-dom/client";import a9 from"react";import{jsx as Xa,jsxs as r9}from"react/jsx-runtime";function it({title:e,defaultOpen:t=!0,children:o}){let[a,r]=a9.useState(t),l=a9.useCallback(n=>{r(n.currentTarget.open)},[]);return r9("details",{className:"property-panel-section",open:a,onToggle:l,children:[r9("summary",{className:"property-panel-section-trigger",children:[Xa("span",{children:e}),Xa(En,{className:"property-panel-section-chevron",width:12,height:12,"aria-hidden":"true"})]}),Xa("div",{className:"property-panel-section-content",children:o})]})}var l9=["H1","H2","H3","H4","H5","H6","P","SPAN","A","BUTTON","LABEL","DIV"];import g1 from"react";import*as D1 from"react";import{jsx as Ai}from"react/jsx-runtime";function wt(e,t=[]){let o=[];function a(l,n){let i=D1.createContext(n),s=o.length;o=[...o,n];let u=p=>{let{scope:C,children:g,...f}=p,c=C?.[e]?.[s]||i,m=D1.useMemo(()=>f,Object.values(f));return Ai(c.Provider,{value:m,children:g})};u.displayName=l+"Provider";function d(p,C){let g=C?.[e]?.[s]||i,f=D1.useContext(g);if(f)return f;if(n!==void 0)return n;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[u,d]}let r=()=>{let l=o.map(n=>D1.createContext(n));return function(i){let s=i?.[e]||l;return D1.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return r.scopeName=e,[a,Zi(r,...t)]}function Zi(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(l){let n=a.reduce((i,{useScope:s,scopeName:u})=>{let p=s(l)[`__scope${u}`];return{...i,...p}},{});return D1.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return o.scopeName=t.scopeName,o}import*as u9 from"react";import*as zi from"react-dom";import*as Oe from"react";import*as i9 from"react";function n9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qa(...e){return t=>{let o=!1,a=e.map(r=>{let l=n9(r,t);return!o&&typeof l=="function"&&(o=!0),l});if(o)return()=>{for(let r=0;r<a.length;r++){let l=a[r];typeof l=="function"?l():n9(e[r],null)}}}}function Qt(...e){return i9.useCallback(Qa(...e),e)}import{Fragment as uc,jsx as s9}from"react/jsx-runtime";function Yt(e){let t=Fi(e),o=Oe.forwardRef((a,r)=>{let{children:l,...n}=a,i=Oe.Children.toArray(l),s=i.find(Ni);if(s){let u=s.props.children,d=i.map(p=>p===s?Oe.Children.count(u)>1?Oe.Children.only(null):Oe.isValidElement(u)?u.props.children:null:p);return s9(t,{...n,ref:r,children:Oe.isValidElement(u)?Oe.cloneElement(u,void 0,d):null})}return s9(t,{...n,ref:r,children:l})});return o.displayName=`${e}.Slot`,o}function Fi(e){let t=Oe.forwardRef((o,a)=>{let{children:r,...l}=o;if(Oe.isValidElement(r)){let n=qi(r),i=Ui(l,r.props);return r.type!==Oe.Fragment&&(i.ref=a?Qa(a,n):n),Oe.cloneElement(r,i)}return Oe.Children.count(r)>1?Oe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $i=Symbol("radix.slottable");function Ni(e){return Oe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$i}function Ui(e,t){let o={...t};for(let a in t){let r=e[a],l=t[a];/^on[A-Z]/.test(a)?r&&l?o[a]=(...i)=>{let s=l(...i);return r(...i),s}:r&&(o[a]=r):a==="style"?o[a]={...r,...l}:a==="className"&&(o[a]=[r,l].filter(Boolean).join(" "))}return{...e,...o}}function qi(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as ji}from"react/jsx-runtime";var Ki=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],N1=Ki.reduce((e,t)=>{let o=Yt(`Primitive.${t}`),a=u9.forwardRef((r,l)=>{let{asChild:n,...i}=r,s=n?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ji(s,{...i,ref:l})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});import*as Be from"react";var Cc=!!(typeof window<"u"&&window.document&&window.document.createElement);function O1(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}import st from"react";import{jsx as Ya}from"react/jsx-runtime";import Mc from"react";import{jsx as Rc}from"react/jsx-runtime";function d9(e){let t=e+"CollectionProvider",[o,a]=wt(t),[r,l]=o(t,{collectionRef:{current:null},itemMap:new Map}),n=c=>{let{scope:m,children:I}=c,h=st.useRef(null),S=st.useRef(new Map).current;return Ya(r,{scope:m,itemMap:S,collectionRef:h,children:I})};n.displayName=t;let i=e+"CollectionSlot",s=Yt(i),u=st.forwardRef((c,m)=>{let{scope:I,children:h}=c,S=l(i,I),x=Qt(m,S.collectionRef);return Ya(s,{ref:x,children:h})});u.displayName=i;let d=e+"CollectionItemSlot",p="data-radix-collection-item",C=Yt(d),g=st.forwardRef((c,m)=>{let{scope:I,children:h,...S}=c,x=st.useRef(null),H=Qt(m,x),O=l(d,I);return st.useEffect(()=>(O.itemMap.set(x,{ref:x,...S}),()=>{O.itemMap.delete(x)})),Ya(C,{[p]:"",ref:H,children:h})});g.displayName=d;function f(c){let m=l(e+"CollectionConsumer",c);return st.useCallback(()=>{let h=m.collectionRef.current;if(!h)return[];let S=Array.from(h.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((O,N)=>S.indexOf(O.ref.current)-S.indexOf(N.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:n,Slot:u,ItemSlot:g},f,a]}import*as Ja from"react";import*as c9 from"react";var Po=globalThis?.document?c9.useLayoutEffect:()=>{};var Gi=Ja[" useId ".trim().toString()]||(()=>{}),Wi=0;function f9(e){let[t,o]=Ja.useState(Gi());return Po(()=>{e||o(a=>a??String(Wi++))},[e]),e||(t?`radix-${t}`:"")}import*as bt from"react";function p9(e){let t=bt.useRef(e);return bt.useEffect(()=>{t.current=e}),bt.useMemo(()=>(...o)=>t.current?.(...o),[])}import*as u1 from"react";import*as To from"react";var Xi=u1[" useInsertionEffect ".trim().toString()]||Po;function ut({prop:e,defaultProp:t,onChange:o=()=>{},caller:a}){let[r,l,n]=Qi({defaultProp:t,onChange:o}),i=e!==void 0,s=i?e:r;{let d=u1.useRef(e!==void 0);u1.useEffect(()=>{let p=d.current;p!==i&&console.warn(`${a} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,a])}let u=u1.useCallback(d=>{if(i){let p=Yi(d)?d(e):d;p!==e&&n.current?.(p)}else l(d)},[i,e,l,n]);return[s,u]}function Qi({defaultProp:e,onChange:t}){let[o,a]=u1.useState(e),r=u1.useRef(o),l=u1.useRef(t);return Xi(()=>{l.current=t},[t]),u1.useEffect(()=>{r.current!==o&&(l.current?.(o),r.current=o)},[o,r]),[o,a,l]}function Yi(e){return typeof e=="function"}import*as Vo from"react";import{jsx as Bc}from"react/jsx-runtime";var Ji=Vo.createContext(void 0);function _o(e){let t=Vo.useContext(Ji);return e||t||"ltr"}import{jsx as dt}from"react/jsx-runtime";var er="rovingFocusGroup.onEntryFocus",es={bubbles:!1,cancelable:!0},Jt="RovingFocusGroup",[tr,C9,ts]=d9(Jt),[os,or]=wt(Jt,[ts]),[as,rs]=os(Jt),m9=Be.forwardRef((e,t)=>dt(tr.Provider,{scope:e.__scopeRovingFocusGroup,children:dt(tr.Slot,{scope:e.__scopeRovingFocusGroup,children:dt(ls,{...e,ref:t})})}));m9.displayName=Jt;var ls=Be.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,orientation:a,loop:r=!1,dir:l,currentTabStopId:n,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...p}=e,C=Be.useRef(null),g=Qt(t,C),f=_o(l),[c,m]=ut({prop:n,defaultProp:i??null,onChange:s,caller:Jt}),[I,h]=Be.useState(!1),S=p9(u),x=C9(o),H=Be.useRef(!1),[O,N]=Be.useState(0);return Be.useEffect(()=>{let y=C.current;if(y)return y.addEventListener(er,S),()=>y.removeEventListener(er,S)},[S]),dt(as,{scope:o,orientation:a,dir:f,loop:r,currentTabStopId:c,onItemFocus:Be.useCallback(y=>m(y),[m]),onItemShiftTab:Be.useCallback(()=>h(!0),[]),onFocusableItemAdd:Be.useCallback(()=>N(y=>y+1),[]),onFocusableItemRemove:Be.useCallback(()=>N(y=>y-1),[]),children:dt(N1.div,{tabIndex:I||O===0?-1:0,"data-orientation":a,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:O1(e.onMouseDown,()=>{H.current=!0}),onFocus:O1(e.onFocus,y=>{let V=!H.current;if(y.target===y.currentTarget&&V&&!I){let U=new CustomEvent(er,es);if(y.currentTarget.dispatchEvent(U),!U.defaultPrevented){let G=x().filter(w=>w.focusable),W=G.find(w=>w.active),$=G.find(w=>w.id===c),q=[W,$,...G].filter(Boolean).map(w=>w.ref.current);v9(q,d)}}H.current=!1}),onBlur:O1(e.onBlur,()=>h(!1))})})}),h9="RovingFocusGroupItem",g9=Be.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,focusable:a=!0,active:r=!1,tabStopId:l,children:n,...i}=e,s=f9(),u=l||s,d=rs(h9,o),p=d.currentTabStopId===u,C=C9(o),{onFocusableItemAdd:g,onFocusableItemRemove:f,currentTabStopId:c}=d;return Be.useEffect(()=>{if(a)return g(),()=>f()},[a,g,f]),dt(tr.ItemSlot,{scope:o,id:u,focusable:a,active:r,children:dt(N1.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:O1(e.onMouseDown,m=>{a?d.onItemFocus(u):m.preventDefault()}),onFocus:O1(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:O1(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){d.onItemShiftTab();return}if(m.target!==m.currentTarget)return;let I=ss(m,d.orientation,d.dir);if(I!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let S=C().filter(x=>x.focusable).map(x=>x.ref.current);if(I==="last")S.reverse();else if(I==="prev"||I==="next"){I==="prev"&&S.reverse();let x=S.indexOf(m.currentTarget);S=d.loop?us(S,x+1):S.slice(x+1)}setTimeout(()=>v9(S))}}),children:typeof n=="function"?n({isCurrentTabStop:p,hasTabStop:c!=null}):n})})});g9.displayName=h9;var ns={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function is(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ss(e,t,o){let a=is(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return ns[a]}function v9(e,t=!1){let o=document.activeElement;for(let a of e)if(a===o||(a.focus({preventScroll:t}),document.activeElement!==o))return}function us(e,t){return e.map((o,a)=>e[(t+a)%e.length])}var x9=m9,L9=g9;import*as w9 from"react";import{jsx as cs}from"react/jsx-runtime";var b9="Toggle",ar=w9.forwardRef((e,t)=>{let{pressed:o,defaultPressed:a,onPressedChange:r,...l}=e,[n,i]=ut({prop:o,onChange:r,defaultProp:a??!1,caller:b9});return cs(N1.button,{type:"button","aria-pressed":n,"data-state":n?"on":"off","data-disabled":e.disabled?"":void 0,...l,ref:t,onClick:O1(e.onClick,()=>{e.disabled||i(!n)})})});ar.displayName=b9;import{jsx as Ye}from"react/jsx-runtime";var U1="ToggleGroup",[y9,uf]=wt(U1,[or]),M9=or(),rr=g1.forwardRef((e,t)=>{let{type:o,...a}=e;if(o==="single")return Ye(fs,{...a,ref:t});if(o==="multiple")return Ye(ps,{...a,ref:t});throw new Error(`Missing prop \`type\` expected on \`${U1}\``)});rr.displayName=U1;var[S9,R9]=y9(U1),fs=g1.forwardRef((e,t)=>{let{value:o,defaultValue:a,onValueChange:r=()=>{},...l}=e,[n,i]=ut({prop:o,defaultProp:a??"",onChange:r,caller:U1});return Ye(S9,{scope:e.__scopeToggleGroup,type:"single",value:g1.useMemo(()=>n?[n]:[],[n]),onItemActivate:i,onItemDeactivate:g1.useCallback(()=>i(""),[i]),children:Ye(k9,{...l,ref:t})})}),ps=g1.forwardRef((e,t)=>{let{value:o,defaultValue:a,onValueChange:r=()=>{},...l}=e,[n,i]=ut({prop:o,defaultProp:a??[],onChange:r,caller:U1}),s=g1.useCallback(d=>i((p=[])=>[...p,d]),[i]),u=g1.useCallback(d=>i((p=[])=>p.filter(C=>C!==d)),[i]);return Ye(S9,{scope:e.__scopeToggleGroup,type:"multiple",value:n,onItemActivate:s,onItemDeactivate:u,children:Ye(k9,{...l,ref:t})})});rr.displayName=U1;var[Cs,ms]=y9(U1),k9=g1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,disabled:a=!1,rovingFocus:r=!0,orientation:l,dir:n,loop:i=!0,...s}=e,u=M9(o),d=_o(n),p={role:"group",dir:d,...s};return Ye(Cs,{scope:o,rovingFocus:r,disabled:a,children:r?Ye(x9,{asChild:!0,...u,orientation:l,dir:d,loop:i,children:Ye(N1.div,{...p,ref:t})}):Ye(N1.div,{...p,ref:t})})}),Do="ToggleGroupItem",H9=g1.forwardRef((e,t)=>{let o=R9(Do,e.__scopeToggleGroup),a=ms(Do,e.__scopeToggleGroup),r=M9(e.__scopeToggleGroup),l=o.value.includes(e.value),n=a.disabled||e.disabled,i={...e,pressed:l,disabled:n},s=g1.useRef(null);return a.rovingFocus?Ye(L9,{asChild:!0,...r,focusable:!n,active:l,ref:s,children:Ye(I9,{...i,ref:t})}):Ye(I9,{...i,ref:t})});H9.displayName=Do;var I9=g1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,value:a,...r}=e,l=R9(Do,o),n={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=l.type==="single"?n:void 0;return Ye(ar,{...i,...r,ref:t,onPressedChange:s=>{s?l.onItemActivate(a):l.onItemDeactivate(a)}})}),P9=rr,T9=H9;import ws from"react";import{jsx as xs,jsxs as Ls}from"react/jsx-runtime";var gs={border:"none",margin:0,padding:0,minWidth:0},vs={color:"var(--dmp-color-foreground)",fontSize:"var(--dmp-font-size-label)",display:"block",marginBottom:"5px",padding:0};function d1({label:e,id:t,className:o,children:a}){let r=`${t}-legend`;return Ls("fieldset",{style:gs,className:o,"aria-labelledby":r,children:[xs("legend",{id:r,style:vs,children:e}),a]})}import{jsx as lr}from"react/jsx-runtime";function y1({label:e,options:t,value:o,onChange:a,id:r="radio-group"}){let l=ws.useCallback(n=>{n&&typeof a=="function"&&a(n)},[a]);return lr(d1,{label:e,id:r,className:"radioGroupEditor-fieldset",children:lr(P9,{type:"single",value:o,onValueChange:l,className:"radioGroupEditor-root","aria-label":e,children:t.map(n=>lr(T9,{value:n.value,className:"radioGroupEditor-item","aria-label":n.label,title:n.label,children:n.icon??n.label},n.value))})})}import{jsx as eo}from"react/jsx-runtime";var _9=[{value:"none",labelKey:"none",defaultLabel:"None",icon:eo($1,{width:14,height:14})},{value:"solid",labelKey:"solid",defaultLabel:"Solid",icon:eo(On,{width:14,height:14})},{value:"dashed",labelKey:"dashed",defaultLabel:"Dashed",icon:eo(_n,{width:14,height:14})},{value:"dotted",labelKey:"dotted",defaultLabel:"Dotted",icon:eo(Dn,{width:14,height:14})}],V9=new Set(_9.map(e=>e.value));function bs(e){if(!e)return"none";if(V9.has(e))return e;let t=e.split(/\s+/)[0]??"";return V9.has(t)?t:"none"}function D9({label:e="Border Style",value:t,onChange:o,id:a="border-style",optionLabels:r}){let l=_9.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return eo(y1,{label:e,options:l,value:bs(t),onChange:o,id:a})}import ze from"react";function _e(e,t){return e.replace(/\{(\d+)\}/g,(o,a)=>{let r=t[Number(a)];return r===void 0?o:String(r)})}function l1(e,t){if(t==null||typeof t!="object"||typeof e!="object")return e;let o={...e},a=t;for(let r of Object.keys(o)){let l=o[r],n=a[r];l!==null&&typeof l=="object"&&!Array.isArray(l)?o[r]=l1(l,n):typeof n=="string"&&(o[r]=n)}return o}var O9=[{path:"general.headerTitle"},{path:"general.emptyPlaceholder"},{path:"general.inlineEditEditable"},{path:"general.inlineEditNonEditable"},{path:"general.addToChatContext"},{path:"general.ariaPropertyPanel"},{path:"general.ariaSelectedComponent"},{path:"general.ariaElementStyling"},{path:"general.closePanel"},{path:"sections.imageSource"},{path:"sections.background"},{path:"sections.spacing"},{path:"sections.border"},{path:"sections.typography"},{path:"sections.elementDimensions"},{path:"instances.imageSource"},{path:"instances.backgroundColor"},{path:"instances.padding"},{path:"instances.margin"},{path:"instances.borderRadius"},{path:"instances.borderWeight"},{path:"instances.borderStyle"},{path:"instances.borderColor"},{path:"instances.fontFamily"},{path:"instances.fontSize"},{path:"instances.fontWeight"},{path:"instances.fontStyle"},{path:"instances.textColor"},{path:"instances.textAlignment"},{path:"instances.textFormatting"},{path:"instances.textTransform"},{path:"instances.lineHeight"},{path:"instances.letterSpacing"},{path:"instances.width"},{path:"instances.minWidth"},{path:"instances.maxWidth"},{path:"instances.height"},{path:"instances.minHeight"},{path:"instances.maxHeight"},{path:"instances.overflow"},{path:"editors.image.tabCms"},{path:"editors.image.tabLocal"},{path:"editors.image.tabUrl"},{path:"editors.image.ariaTablist"},{path:"editors.image.clearImage"},{path:"editors.image.chooseFile"},{path:"editors.image.ariaChooseFile"},{path:"editors.image.useThisImage"},{path:"editors.image.ariaImageUrl"},{path:"editors.image.urlPlaceholder"},{path:"editors.image.previewAlt"},{path:"editors.image.altText"},{path:"editors.image.altPlaceholder"},{path:"editors.image.width"},{path:"editors.image.height"},{path:"editors.image.autoPlaceholder"},{path:"editors.image.workspace"},{path:"editors.image.selectWorkspace"},{path:"editors.image.selectImage"},{path:"editors.image.loadingWorkspaces"},{path:"editors.image.noWorkspaces"},{path:"editors.image.loadingImages"},{path:"editors.image.noImages"},{path:"editors.image.loadingMore"},{path:"editors.image.untitled"},{path:"editors.image.downloadingImage"},{path:"editors.image.downloadFailed"},{path:"editors.image.closePicker"},{path:"editors.image.cancel"},{path:"editors.image.done"},{path:"editors.image.pickerTitle",placeholders:[0]},{path:"editors.image.pickerError",placeholders:[0]},{path:"editors.boxDimension.sides.top"},{path:"editors.boxDimension.sides.right"},{path:"editors.boxDimension.sides.bottom"},{path:"editors.boxDimension.sides.left"},{path:"editors.boxDimension.corners.topLeft"},{path:"editors.boxDimension.corners.topRight"},{path:"editors.boxDimension.corners.bottomRight"},{path:"editors.boxDimension.corners.bottomLeft"},{path:"editors.boxDimension.makeEqual"},{path:"editors.boxDimension.ariaUnit",placeholders:[0]},{path:"editors.boxDimension.ariaSide",placeholders:[0,1]},{path:"editors.dimension.ariaValue",placeholders:[0]},{path:"editors.dimension.ariaUnit",placeholders:[0]},{path:"editors.color.placeholder"},{path:"editors.color.ariaValue",placeholders:[0]},{path:"editors.color.ariaOpenPicker",placeholders:[0,1]},{path:"editors.color.ariaPicker",placeholders:[0]},{path:"editors.color.ariaSaturation",placeholders:[0,1]},{path:"editors.color.ariaEyedropper"},{path:"editors.color.ariaHue"},{path:"editors.color.ariaAlphaSlider"},{path:"editors.color.ariaHex"},{path:"editors.color.ariaChannel",placeholders:[0,1,2,3]},{path:"editors.color.ariaAlphaInput"},{path:"editors.color.ariaFormatCycle",placeholders:[0]},{path:"editors.color.titleFormatCycle"},{path:"editors.color.gradientValue"},{path:"editors.color.imageValue"},{path:"editors.fontWeight.options.thin"},{path:"editors.fontWeight.options.extraLight"},{path:"editors.fontWeight.options.light"},{path:"editors.fontWeight.options.regular"},{path:"editors.fontWeight.options.medium"},{path:"editors.fontWeight.options.semiBold"},{path:"editors.fontWeight.options.bold"},{path:"editors.fontWeight.options.extraBold"},{path:"editors.fontWeight.options.black"},{path:"editors.fontStyle.options.normal"},{path:"editors.fontStyle.options.italic"},{path:"editors.borderStyle.options.none"},{path:"editors.borderStyle.options.solid"},{path:"editors.borderStyle.options.dashed"},{path:"editors.borderStyle.options.dotted"},{path:"editors.overflow.options.visible"},{path:"editors.overflow.options.hidden"},{path:"editors.overflow.options.scroll"},{path:"editors.overflow.options.auto"},{path:"editors.textAlignment.options.left"},{path:"editors.textAlignment.options.center"},{path:"editors.textAlignment.options.right"},{path:"editors.textAlignment.options.justify"},{path:"editors.textDecoration.options.none"},{path:"editors.textDecoration.options.underline"},{path:"editors.textDecoration.options.lineThrough"},{path:"editors.textTransform.options.none"},{path:"editors.textTransform.options.uppercase"},{path:"editors.textTransform.options.lowercase"},{path:"editors.textTransform.options.capitalize"},{path:"editors.picklist.ariaReset",placeholders:[0]},{path:"history.changeLimitTitle"},{path:"history.changeLimitBody"}];function Is(e,t){return t.split(".").reduce((o,a)=>{if(o&&typeof o=="object")return o[a]},e)}function ys(e){let t=new Set;for(let o of e.matchAll(/\{(\d+)\}/g))t.add(Number(o[1]));return Array.from(t).sort((o,a)=>o-a)}function Ms(e){let t=[];if(!e||typeof e!="object")return["labels is not an object"];for(let o of O9){let{path:a,placeholders:r}=o,l=Is(e,a);if(typeof l!="string"){t.push(`missing or non-string label: ${a}`);continue}if(r){let n=ys(l),i=[...r].sort((u,d)=>u-d);(n.length!==i.length||n.some((u,d)=>u!==i[d]))&&t.push(`placeholder mismatch at ${a}: expected {${i.join(",")}}, got {${n.join(",")}}`)}}return t}var Oo=[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"},{value:"pt",label:"pt"},{value:"vw",label:"vw"},{value:"vh",label:"vh"},{value:"vmin",label:"vmin"},{value:"vmax",label:"vmax"},{value:"ch",label:"ch"},{value:"ex",label:"ex"},{value:"cm",label:"cm"},{value:"mm",label:"mm"},{value:"in",label:"in"},{value:"pc",label:"pc"}],v1={px:{min:0,max:1e4,step:1,decimals:1},em:{min:0,max:100,step:.1,decimals:3},rem:{min:0,max:100,step:.1,decimals:3},"%":{min:0,max:1e3,step:1,decimals:2},pt:{min:0,max:1e4,step:1,decimals:1},vw:{min:0,max:100,step:.1,decimals:1},vh:{min:0,max:100,step:.1,decimals:1},vmin:{min:0,max:100,step:.1,decimals:1},vmax:{min:0,max:100,step:.1,decimals:1},ch:{min:0,max:100,step:.1,decimals:1},ex:{min:0,max:100,step:.1,decimals:1},cm:{min:0,max:100,step:.1,decimals:2},mm:{min:0,max:1e3,step:1,decimals:1},in:{min:0,max:50,step:.01,decimals:2},pc:{min:0,max:500,step:1,decimals:0}},Ss=v1.px??{min:0,max:1e4,step:1,decimals:0};function to(e){let t=e.map(o=>o.value).join("|");return new RegExp(`^(-?\\d*\\.?\\d+)\\s*(${t})$`)}var Rs=to(Oo);function Je(e,t="px",o=Rs){if(e==null||e==="")return{numericValue:"",unit:t};let a=String(e).trim();if(a==="")return{numericValue:"",unit:t};let r=a.match(o);if(r&&r[1]!=null&&r[2]!=null)return{numericValue:parseFloat(r[1]),unit:r[2]};let l=parseFloat(a);return isNaN(l)?{numericValue:"",unit:t}:{numericValue:l,unit:t}}function nr(e,t=v1){return t[e]||Ss}function x1(e,t,o=v1){let a=nr(t,o);return Math.min(a.max,Math.max(a.min,e))}function L1(e,t,o=v1){if(e===""||e==null||isNaN(e))return"";let a=nr(t,o);return Number(Number(e).toFixed(a.decimals))}function Eo(e,t){return e===""||e==null||isNaN(e)?"":`${e}${t}`}function Bo(e,t,o,a,r=v1){let l=parseFloat(e)||0,n=nr(a,r),i=o?10:1,s=(t==="ArrowUp"?1:-1)*n.step*i,u=x1(l+s,a,r);return String(L1(u,a,r))}function ir({top:e,right:t,bottom:o,left:a}){return`${e||"0px"} ${t||"0px"} ${o||"0px"} ${a||"0px"}`}function It(e){let t={top:"",right:"",bottom:"",left:""};if(!e||typeof e!="string")return t;let o=e.trim().split(/\s+/),[a="",r="",l="",n=""]=o;return o.length===0||o.length===1&&a===""?t:o.length===1?{top:a,right:a,bottom:a,left:a}:o.length===2?{top:a,right:r,bottom:a,left:r}:o.length===3?{top:a,right:r,bottom:l,left:r}:{top:a,right:r,bottom:l,left:n}}function c1(...e){return Oo.filter(t=>e.includes(t.value))}var M1={width:{units:c1("px","em","rem","vw","ch","%"),icon:o9},minWidth:{units:c1("px","em","rem","vw","ch","%")},maxWidth:{units:c1("px","em","rem","vw","ch","%")},height:{units:c1("px","em","rem","vh","%"),icon:Fn},minHeight:{units:c1("px","em","rem","vh","%")},maxHeight:{units:c1("px","em","rem","vh","%")},fontSize:{units:c1("px","em","rem","%","pt"),constraints:{...v1,px:{min:0,max:1e3,step:1,decimals:0},"%":{min:0,max:1e3,step:1,decimals:0}},icon:Zn},lineHeight:{units:[{value:"",label:"\xD7"},{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}],defaultUnit:"",constraints:{"":{min:0,max:10,step:.1,decimals:2},px:{min:0,max:1e3,step:1,decimals:2},em:{min:0,max:100,step:.1,decimals:3},rem:{min:0,max:100,step:.1,decimals:3},"%":{min:0,max:1e3,step:1,decimals:2}},icon:jn},letterSpacing:{units:c1("px","em","rem"),constraints:{...v1,px:{min:-100,max:1e3,step:.5,decimals:1},em:{min:-10,max:100,step:.01,decimals:3},rem:{min:-10,max:100,step:.01,decimals:3}},icon:zn}},oo={padding:{units:c1("px","em","rem","%")},margin:{units:c1("px","em","rem","%")},borderRadius:{units:c1("px","em","rem","%"),sideLabelKind:"corners"},borderWidth:{units:c1("px","em","rem")}};import{jsx as w1,jsxs as Ao}from"react/jsx-runtime";var ks=[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}],yt=["top","right","bottom","left"],Hs={sides:{top:"Top",right:"Right",bottom:"Bottom",left:"Left"},corners:{topLeft:"Top Left",topRight:"Top Right",bottomRight:"Bottom Right",bottomLeft:"Bottom Left"},makeEqual:"Make all values equal",ariaUnit:"{0} unit",ariaSide:"{0} {1}"};function Ps(e,t){return t==="corners"?[e.corners.topLeft,e.corners.topRight,e.corners.bottomRight,e.corners.bottomLeft]:[e.sides.top,e.sides.right,e.sides.bottom,e.sides.left]}function ao(e){return typeof e=="string"&&e.trim().toLowerCase()==="auto"}function sr(e,t,o){let a={top:"",right:"",bottom:"",left:""};for(let r of yt){let l=e[r];if(l==null||l==="")a[r]="";else if(ao(l))a[r]="auto";else{let n=Je(String(l),t,o);a[r]=n.numericValue!==""?String(n.numericValue):""}}return a}function ur(e){let t=e.top||"";return t===(e.right||"")&&t===(e.bottom||"")&&t===(e.left||"")}function E9(e,t,o){for(let a of yt){let r=e[a];if(r!=null&&r!==""&&r!=="0"){let l=Je(String(r),"px",t);if(l.unit&&o.has(l.unit))return l.unit}}return"px"}function Ts(e,t,o){if(ao(e))return"auto";let a=parseFloat(e);if(e===""||isNaN(a))return"";let r=x1(a,t,o);return`${L1(r,t,o)}${t}`}function B9(e){if(!e)return"";let t=It(e);return!t.top&&!t.right&&!t.bottom&&!t.left?"":ir(t)}function ro({label:e,value:t="",onChange:o,id:a="",units:r=ks,constraints:l=v1,allowAuto:n=!1,sideLabelKind:i="sides",sideIcons:s,placeholder:u="",aria:d}){let p=l1(Hs,d),C=Ps(p,i),g=ze.useRef(o);g.current=o;let f=ze.useMemo(()=>to(r),[r]),c=ze.useMemo(()=>new Set(r.map(w=>w.value)),[r]),m=ze.useMemo(()=>{let w={top:"",right:"",bottom:"",left:""};if(!u)return w;let L=It(u),b={...w};for(let v of yt){let k=L[v];if(!k)continue;let A=Je(k,"px",f);A.numericValue!==""&&(b[v]=String(A.numericValue))}return b},[u,f]),I=ze.useMemo(()=>It(t),[]),[h,S]=ze.useState(()=>E9(I,f,c)),[x,H]=ze.useState(()=>sr(I,h,f)),[O,N]=ze.useState(()=>ur(x)),y=ze.useRef(B9(t));ze.useEffect(()=>{if(t===y.current)return;let w=B9(t);if(w===y.current)return;y.current=w;let L=It(t),b=E9(L,f,c);S(b);let v=sr(L,b,f);H(v),N(ur(v))},[t,f,c]);let V=ze.useCallback((w,L)=>{let b={top:"",right:"",bottom:"",left:""},v=!0;for(let A of yt)b[A]=Ts(w[A],L,l),b[A]!==""&&(v=!1);let k=v?"":ir(b);k!==y.current&&(y.current=k,typeof g.current=="function"&&g.current(k))},[l]),U=ze.useCallback((w,L)=>{H(O?{top:L,right:L,bottom:L,left:L}:v=>({...v,[w]:L}));let b=Je(L,h,f);b.numericValue!==""&&b.unit&&c.has(b.unit)&&b.unit!==h&&S(b.unit)},[O,h,f,c]),G=ze.useCallback((w,L)=>{let b=L.clipboardData.getData("text"),v=Je(b,h,f);if(v.numericValue!==""&&v.unit&&c.has(v.unit)){L.preventDefault();let k=x1(v.numericValue,v.unit,l),A=String(L1(k,v.unit,l)),E=O?{top:A,right:A,bottom:A,left:A}:{...x,[w]:A};H(E),v.unit!==h&&S(v.unit),V(E,v.unit)}},[O,x,h,f,c,l,V]),W=ze.useCallback(w=>{let L=x[w];if(L===""){let E=O?{top:"",right:"",bottom:"",left:""}:{...x,[w]:""};H(E),V(E,h);return}if(n&&ao(L)){let E="auto",z=O?{top:E,right:E,bottom:E,left:E}:{...x,[w]:E};H(z),V(z,h);return}let b=parseFloat(L);if(isNaN(b)){let E=It(y.current);H(sr(E,h,f));return}let v=x1(b,h,l),k=String(L1(v,h,l)),A=O?{top:k,right:k,bottom:k,left:k}:{...x,[w]:k};H(A),V(A,h)},[x,O,h,f,l,V,n]),$=ze.useCallback((w,L)=>{if(L.key==="Enter"){L.currentTarget.blur();return}if(L.key==="ArrowUp"||L.key==="ArrowDown"){if(ao(x[w]))return;L.preventDefault();let b=Bo(x[w],L.key,L.shiftKey,h,l);if(b===null)return;let v=O?{top:b,right:b,bottom:b,left:b}:{...x,[w]:b};H(v),V(v,h)}},[x,O,h,l,V]),_=ze.useCallback(()=>{if(!O&&!ur(x)){let w=x.top,L={top:w,right:w,bottom:w,left:w};H(L),V(L,h)}N(w=>!w)},[O,x,h,V]),q=ze.useCallback(w=>{let L=w.target.value;if(!c.has(L))return;S(L);let b={top:"",right:"",bottom:"",left:""};for(let v of yt){let k=x[v];if(ao(k))b[v]="auto";else if(k!==""){let A=parseFloat(k);if(isNaN(A))b[v]=k;else{let E=x1(A,L,l);b[v]=String(L1(E,L,l))}}else b[v]=""}H(b),V(b,L)},[x,c,l,V]);return Ao(d1,{label:e,id:a,className:"boxDimensionEditor-fieldset",children:[w1("div",{className:"boxDimensionEditor-header",children:w1("div",{className:"boxDimensionEditor-controls",children:w1("select",{className:"boxDimensionEditor-unit",value:h,onChange:q,"aria-label":_e(p.ariaUnit,[e]),children:r.map(w=>w1("option",{value:w.value,children:w.label},w.value))})})}),w1("div",{className:"boxDimensionEditor-grid",children:yt.map((w,L)=>{let b=s&&s[L];return Ao("div",{className:"boxDimensionEditor-cell",children:[w1("label",{htmlFor:`${a}-${w}`,className:"boxDimensionEditor-label",children:C[L]}),Ao("div",{className:"boxDimensionEditor-input-row",children:[b&&w1("span",{className:"boxDimensionEditor-input-icon","aria-hidden":"true",children:w1(b,{size:12,width:12,height:12})}),w1("input",{id:`${a}-${w}`,type:"text",className:b?"boxDimensionEditor-input boxDimensionEditor-input--with-icon":"boxDimensionEditor-input",value:x[w],placeholder:m[w],onChange:v=>U(w,v.target.value),onPaste:v=>G(w,v),onBlur:()=>W(w),onKeyDown:v=>$(w,v),"aria-label":_e(p.ariaSide,[e,C[L]??""]),autoComplete:"off",spellCheck:"false"})]})]},w)})}),Ao("label",{className:"boxDimensionEditor-equal",children:[w1("input",{type:"checkbox",className:"boxDimensionEditor-equal-checkbox",checked:O,onChange:_}),w1("span",{className:"boxDimensionEditor-equal-label",children:p.makeEqual})]})]})}import{forwardRef as _s,createElement as Ds}from"react";var Zo=(...e)=>e.filter((t,o,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===o).join(" ").trim();var A9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Z9=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,a)=>a?a.toUpperCase():o.toLowerCase());var dr=e=>{let t=Z9(e);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Vs,createElement as N9}from"react";var F9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var $9=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var U9=Vs(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:r="",children:l,iconNode:n,...i},s)=>N9("svg",{ref:s,...F9,width:t,height:t,stroke:e,strokeWidth:a?Number(o)*24/Number(t):o,className:Zo("lucide",r),...!l&&!$9(i)&&{"aria-hidden":"true"},...i},[...n.map(([u,d])=>N9(u,d)),...Array.isArray(l)?l:[l]]));var q9=(e,t)=>{let o=_s(({className:a,...r},l)=>Ds(U9,{ref:l,iconNode:t,className:Zo(`lucide-${A9(dr(e))}`,`lucide-${e}`,a),...r}));return o.displayName=dr(e),o};var Os=[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]],lo=q9("pipette",Os);import Pe from"react";import{useRef as Uo,useCallback as je,useEffect as vr,useMemo as qo,useState as xr,createContext as Es,useContext as Bs}from"react";var z9={exports:{}},no={};var j9;function As(){if(j9)return no;j9=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(a,r,l){var n=null;if(l!==void 0&&(n=""+l),r.key!==void 0&&(n=""+r.key),"key"in r){l={};for(var i in r)i!=="key"&&(l[i]=r[i])}else l=r;return r=l.ref,{$$typeof:e,type:a,key:n,ref:r!==void 0?r:null,props:l}}return no.Fragment=t,no.jsx=o,no.jsxs=o,no}var K9;function Zs(){return K9||(K9=1,z9.exports=As()),z9.exports}var Te=Zs();function o2(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=o2(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function Fs(){for(var e,t,o=0,a="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=o2(e))&&(a&&(a+=" "),a+=t);return a}var Lr="-",$s=e=>{let t=Us(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:r=>{let l=r.split(Lr);return l[0]===""&&l.length!==1&&l.shift(),a2(l,t)||Ns(r)},getConflictingClassGroupIds:(r,l)=>{let n=o[r]||[];return l&&a[r]?[...n,...a[r]]:n}}},a2=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?a2(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let l=e.join(Lr);return t.validators.find(({validator:n})=>n(l))?.classGroupId},G9=/^\[(.+)\]$/,Ns=e=>{if(G9.test(e)){let t=G9.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Us=e=>{let{theme:t,classGroups:o}=e,a={nextPart:new Map,validators:[]};for(let r in o)pr(o[r],a,r,t);return a},pr=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let l=r===""?t:W9(t,r);l.classGroupId=o;return}if(typeof r=="function"){if(qs(r)){pr(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([l,n])=>{pr(n,W9(t,l),o,a)})})},W9=(e,t)=>{let o=e;return t.split(Lr).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},qs=e=>e.isThemeGetter,zs=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,r=(l,n)=>{o.set(l,n),t++,t>e&&(t=0,a=o,o=new Map)};return{get(l){let n=o.get(l);if(n!==void 0)return n;if((n=a.get(l))!==void 0)return r(l,n),n},set(l,n){o.has(l)?o.set(l,n):r(l,n)}}},Cr="!",mr=":",js=mr.length,Ks=e=>{let{prefix:t,experimentalParseClassName:o}=e,a=r=>{let l=[],n=0,i=0,s=0,u;for(let f=0;f<r.length;f++){let c=r[f];if(n===0&&i===0){if(c===mr){l.push(r.slice(s,f)),s=f+js;continue}if(c==="/"){u=f;continue}}c==="["?n++:c==="]"?n--:c==="("?i++:c===")"&&i--}let d=l.length===0?r:r.substring(s),p=Gs(d),C=p!==d,g=u&&u>s?u-s:void 0;return{modifiers:l,hasImportantModifier:C,baseClassName:p,maybePostfixModifierPosition:g}};if(t){let r=t+mr,l=a;a=n=>n.startsWith(r)?l(n.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:n,maybePostfixModifierPosition:void 0}}if(o){let r=a;a=l=>o({className:l,parseClassName:r})}return a},Gs=e=>e.endsWith(Cr)?e.substring(0,e.length-1):e.startsWith(Cr)?e.substring(1):e,Ws=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;let a=[],r=[];return o.forEach(l=>{l[0]==="["||t[l]?(a.push(...r.sort(),l),r=[]):r.push(l)}),a.push(...r.sort()),a}},Xs=e=>({cache:zs(e.cacheSize),parseClassName:Ks(e),sortModifiers:Ws(e),...$s(e)}),Qs=/\s+/,Ys=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:l}=t,n=[],i=e.trim().split(Qs),s="";for(let u=i.length-1;u>=0;u-=1){let d=i[u],{isExternal:p,modifiers:C,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:c}=o(d);if(p){s=d+(s.length>0?" "+s:s);continue}let m=!!c,I=a(m?f.substring(0,c):f);if(!I){if(!m){s=d+(s.length>0?" "+s:s);continue}if(I=a(f),!I){s=d+(s.length>0?" "+s:s);continue}m=!1}let h=l(C).join(":"),S=g?h+Cr:h,x=S+I;if(n.includes(x))continue;n.push(x);let H=r(I,m);for(let O=0;O<H.length;++O){let N=H[O];n.push(S+N)}s=d+(s.length>0?" "+s:s)}return s};function Js(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=r2(t))&&(a&&(a+=" "),a+=o);return a}var r2=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=r2(e[a]))&&(o&&(o+=" "),o+=t);return o};function eu(e,...t){let o,a,r,l=n;function n(s){let u=t.reduce((d,p)=>p(d),e());return o=Xs(u),a=o.cache.get,r=o.cache.set,l=i,i(s)}function i(s){let u=a(s);if(u)return u;let d=Ys(s,o);return r(s,d),d}return function(){return l(Js.apply(null,arguments))}}var Ee=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},l2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,n2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tu=/^\d+\/\d+$/,ou=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,au=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ru=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mt=e=>tu.test(e),fe=e=>!!e&&!Number.isNaN(Number(e)),q1=e=>!!e&&Number.isInteger(Number(e)),cr=e=>e.endsWith("%")&&fe(e.slice(0,-1)),E1=e=>ou.test(e),iu=()=>!0,su=e=>au.test(e)&&!ru.test(e),i2=()=>!1,uu=e=>lu.test(e),du=e=>nu.test(e),cu=e=>!j(e)&&!K(e),fu=e=>St(e,d2,i2),j=e=>l2.test(e),ct=e=>St(e,c2,su),fr=e=>St(e,gu,fe),X9=e=>St(e,s2,i2),pu=e=>St(e,u2,du),Fo=e=>St(e,f2,uu),K=e=>n2.test(e),io=e=>Rt(e,c2),Cu=e=>Rt(e,vu),Q9=e=>Rt(e,s2),mu=e=>Rt(e,d2),hu=e=>Rt(e,u2),$o=e=>Rt(e,f2,!0),St=(e,t,o)=>{let a=l2.exec(e);return a?a[1]?t(a[1]):o(a[2]):!1},Rt=(e,t,o=!1)=>{let a=n2.exec(e);return a?a[1]?t(a[1]):o:!1},s2=e=>e==="position"||e==="percentage",u2=e=>e==="image"||e==="url",d2=e=>e==="length"||e==="size"||e==="bg-size",c2=e=>e==="length",gu=e=>e==="number",vu=e=>e==="family-name",f2=e=>e==="shadow",xu=()=>{let e=Ee("color"),t=Ee("font"),o=Ee("text"),a=Ee("font-weight"),r=Ee("tracking"),l=Ee("leading"),n=Ee("breakpoint"),i=Ee("container"),s=Ee("spacing"),u=Ee("radius"),d=Ee("shadow"),p=Ee("inset-shadow"),C=Ee("text-shadow"),g=Ee("drop-shadow"),f=Ee("blur"),c=Ee("perspective"),m=Ee("aspect"),I=Ee("ease"),h=Ee("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],H=()=>[...x(),K,j],O=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],y=()=>[K,j,s],V=()=>[Mt,"full","auto",...y()],U=()=>[q1,"none","subgrid",K,j],G=()=>["auto",{span:["full",q1,K,j]},q1,K,j],W=()=>[q1,"auto",K,j],$=()=>["auto","min","max","fr",K,j],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...y()],L=()=>[Mt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],b=()=>[e,K,j],v=()=>[...x(),Q9,X9,{position:[K,j]}],k=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",mu,fu,{size:[K,j]}],E=()=>[cr,io,ct],z=()=>["","none","full",u,K,j],B=()=>["",fe,io,ct],Z=()=>["solid","dashed","dotted","double"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>[fe,cr,Q9,X9],X=()=>["","none",f,K,j],ue=()=>["none",fe,K,j],ce=()=>["none",fe,K,j],M=()=>[fe,K,j],P=()=>[Mt,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[E1],breakpoint:[E1],color:[iu],container:[E1],"drop-shadow":[E1],ease:["in","out","in-out"],font:[cu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[E1],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[E1],shadow:[E1],spacing:["px",fe],text:[E1],"text-shadow":[E1],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mt,j,K,m]}],container:["container"],columns:[{columns:[fe,j,K,i]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:H()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[q1,"auto",K,j]}],basis:[{basis:[Mt,"full","auto",i,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[fe,Mt,"auto","initial","none",j]}],grow:[{grow:["",fe,K,j]}],shrink:[{shrink:["",fe,K,j]}],order:[{order:[q1,"first","last","none",K,j]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],w:[{w:[i,"screen",...L()]}],"min-w":[{"min-w":[i,"screen","none",...L()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[n]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",o,io,ct]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,K,fr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cr,j]}],"font-family":[{font:[Cu,j,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,K,j]}],"line-clamp":[{"line-clamp":[fe,"none",K,fr]}],leading:[{leading:[l,...y()]}],"list-image":[{"list-image":["none",K,j]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",K,j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:b()}],"text-color":[{text:b()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[fe,"from-font","auto",K,ct]}],"text-decoration-color":[{decoration:b()}],"underline-offset":[{"underline-offset":[fe,"auto",K,j]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K,j]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",K,j]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:v()}],"bg-repeat":[{bg:k()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},q1,K,j],radial:["",K,j],conic:[q1,K,j]},hu,pu]}],"bg-color":[{bg:b()}],"gradient-from-pos":[{from:E()}],"gradient-via-pos":[{via:E()}],"gradient-to-pos":[{to:E()}],"gradient-from":[{from:b()}],"gradient-via":[{via:b()}],"gradient-to":[{to:b()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:b()}],"border-color-x":[{"border-x":b()}],"border-color-y":[{"border-y":b()}],"border-color-s":[{"border-s":b()}],"border-color-e":[{"border-e":b()}],"border-color-t":[{"border-t":b()}],"border-color-r":[{"border-r":b()}],"border-color-b":[{"border-b":b()}],"border-color-l":[{"border-l":b()}],"divide-color":[{divide:b()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[fe,K,j]}],"outline-w":[{outline:["",fe,io,ct]}],"outline-color":[{outline:b()}],shadow:[{shadow:["","none",d,$o,Fo]}],"shadow-color":[{shadow:b()}],"inset-shadow":[{"inset-shadow":["none",p,$o,Fo]}],"inset-shadow-color":[{"inset-shadow":b()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:b()}],"ring-offset-w":[{"ring-offset":[fe,ct]}],"ring-offset-color":[{"ring-offset":b()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":b()}],"text-shadow":[{"text-shadow":["none",C,$o,Fo]}],"text-shadow-color":[{"text-shadow":b()}],opacity:[{opacity:[fe,K,j]}],"mix-blend":[{"mix-blend":[...F(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":F()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":b()}],"mask-image-linear-to-color":[{"mask-linear-to":b()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":b()}],"mask-image-t-to-color":[{"mask-t-to":b()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":b()}],"mask-image-r-to-color":[{"mask-r-to":b()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":b()}],"mask-image-b-to-color":[{"mask-b-to":b()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":b()}],"mask-image-l-to-color":[{"mask-l-to":b()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":b()}],"mask-image-x-to-color":[{"mask-x-to":b()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":b()}],"mask-image-y-to-color":[{"mask-y-to":b()}],"mask-image-radial":[{"mask-radial":[K,j]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":b()}],"mask-image-radial-to-color":[{"mask-radial-to":b()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":b()}],"mask-image-conic-to-color":[{"mask-conic-to":b()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:v()}],"mask-repeat":[{mask:k()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",K,j]}],filter:[{filter:["","none",K,j]}],blur:[{blur:X()}],brightness:[{brightness:[fe,K,j]}],contrast:[{contrast:[fe,K,j]}],"drop-shadow":[{"drop-shadow":["","none",g,$o,Fo]}],"drop-shadow-color":[{"drop-shadow":b()}],grayscale:[{grayscale:["",fe,K,j]}],"hue-rotate":[{"hue-rotate":[fe,K,j]}],invert:[{invert:["",fe,K,j]}],saturate:[{saturate:[fe,K,j]}],sepia:[{sepia:["",fe,K,j]}],"backdrop-filter":[{"backdrop-filter":["","none",K,j]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[fe,K,j]}],"backdrop-contrast":[{"backdrop-contrast":[fe,K,j]}],"backdrop-grayscale":[{"backdrop-grayscale":["",fe,K,j]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[fe,K,j]}],"backdrop-invert":[{"backdrop-invert":["",fe,K,j]}],"backdrop-opacity":[{"backdrop-opacity":[fe,K,j]}],"backdrop-saturate":[{"backdrop-saturate":[fe,K,j]}],"backdrop-sepia":[{"backdrop-sepia":["",fe,K,j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",K,j]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[fe,"initial",K,j]}],ease:[{ease:["linear","initial",I,K,j]}],delay:[{delay:[fe,K,j]}],animate:[{animate:["none",h,K,j]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[c,K,j]}],"perspective-origin":[{"perspective-origin":H()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:M()}],"skew-x":[{"skew-x":M()}],"skew-y":[{"skew-y":M()}],transform:[{transform:[K,j,"","none","gpu","cpu"]}],"transform-origin":[{origin:H()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":["translate-none"],accent:[{accent:b()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:b()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",K,j]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",K,j]}],fill:[{fill:["none",...b()]}],"stroke-w":[{stroke:[fe,io,ct,fr]}],stroke:[{stroke:["none",...b()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lu=eu(xu),wu=(e,t,o)=>Math.min(Math.max(e,t),o),No=e=>Math.round(wu(e,0,255)),p2=e=>{let t=e.replace("#",""),o=parseInt(t,16);return{r:o>>16&255,g:o>>8&255,b:o&255}},bu=({r:e,g:t,b:o})=>{let a=r=>No(r).toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(o)}`},hr=({h:e,s:t,v:o})=>{e=e/360,t=t/100,o=o/100;let a=Math.floor(e*6),r=e*6-a,l=o*(1-t),n=o*(1-r*t),i=o*(1-(1-r)*t),s,u,d;switch(a%6){case 0:s=o,u=i,d=l;break;case 1:s=n,u=o,d=l;break;case 2:s=l,u=o,d=i;break;case 3:s=l,u=n,d=o;break;case 4:s=i,u=l,d=o;break;case 5:s=o,u=l,d=n;break;default:s=u=d=0}return{r:No(s*255),g:No(u*255),b:No(d*255)}},gr=({r:e,g:t,b:o})=>{e/=255,t/=255,o/=255;let a=Math.max(e,t,o),r=Math.min(e,t,o),l=a-r,n=0,i=a===0?0:l/a,s=a;if(l!==0)switch(a){case e:n=((t-o)/l+(t<o?6:0))/6;break;case t:n=((o-e)/l+2)/6;break;case o:n=((e-t)/l+4)/6;break}return{h:Math.round(n*360),s:Math.round(i*100),v:Math.round(s*100)}},Iu=e=>bu(hr(e)),yu=e=>gr(p2(e));var Y9=({h:e,s:t,v:o})=>{let a=o*(2-t/100)/2,r=a!==0&&a!==100?(o-a)/Math.min(a,100-a)*100:0;return{h:e,s:Math.round(r),l:Math.round(a)}},J9=({h:e,s:t,l:o})=>{let a=o+t*Math.min(o,100-o)/100,r=a===0?0:2*(1-o/a)*100;return{h:e,s:Math.round(r),v:Math.round(a)}},Mu=e=>{let{r:t,g:o,b:a}=p2(e);return(.299*t+.587*o+.114*a)/255>.5?"#000000":"#ffffff"};var Su=(e,t="hex")=>{switch(t){case"hex":return e.getHex();case"rgb":let o=e.getRgb();return`rgb(${o.r}, ${o.g}, ${o.b})`;case"rgba":let a=e.getRgba();return`rgba(${a.r}, ${a.g}, ${a.b}, ${a.a})`;case"hsl":let r=e.getHsl();return`hsl(${r.h}, ${r.s}%, ${r.l}%)`;case"hsla":let l=e.getHsla();return`hsla(${l.h}, ${l.s}%, ${l.l}%, ${l.a})`;default:zo()}};function Ru(e){switch(e.type){case"hex":return{...yu(e.value),a:1};case"rgb":return{...gr(e),a:1};case"rgba":return{...gr(e),a:e.a};case"hsl":return{...J9(e),a:1};case"hsla":return{...J9(e),a:1};case"hsv":return{...e,a:1};case"hsva":return{...e};default:zo()}}function z1(e,t){let o=Ru(e);switch(t){case"hex":return Iu(o);case"rgb":return hr(o);case"rgba":return{...hr(o),a:o.a};case"hsl":return Y9(o);case"hsla":return{...Y9(o),a:o.a};case"hsv":return{h:o.h,s:o.s,v:o.v};case"hsva":return o;default:zo()}}var ft=(...e)=>Lu(Fs(e)),B1=(e,t,o)=>Math.min(Math.max(e,t),o),j1=e=>Math.round(e);function zo(e){throw new Error("You should never get here.")}var K1=class e{constructor(t){this.colorInput=t,typeof t=="string"?this.color={type:"hex",value:t}:"type"in t?this.color=t:"r"in t?"a"in t?this.color={type:"rgba",...t}:this.color={type:"rgb",...t}:"v"in t?"a"in t?this.color={type:"hsva",...t}:this.color={type:"hsv",...t}:"a"in t?this.color={type:"hsla",...t}:this.color={type:"hsl",...t}}getRgb(){return z1(this.color,"rgb")}getHsv(){return z1(this.color,"hsv")}getHsla(){return z1(this.color,"hsla")}getHsva(){return z1(this.color,"hsva")}getHex(){return z1(this.color,"hex")}getHsl(){return z1(this.color,"hsl")}getRgba(){return z1(this.color,"rgba")}format(t="hex"){return Su(this,t)}getContrastingColor(){return new e({type:"hex",value:Mu(this.getHex())})}},e2=(e,t)=>{let o=e.getBoundingClientRect(),a,r;if("touches"in t){let u=t.touches[0]||t.changedTouches[0];a=u.clientX,r=u.clientY}else a=t.clientX,r=t.clientY;let l=a-o.left,n=r-o.top,i=B1(l/o.width,0,1),s=B1(n/o.height,0,1);return{left:i,top:s}},wr=({onMove:e,onMoveEnd:t,onKey:o,children:a,className:r,...l})=>{let n=Uo(null),i=Uo(!1),s=je(C=>{!i.current||!n.current||(C.preventDefault(),e(e2(n.current,C)))},[e]),u=je(()=>{i.current=!1,t(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,t]),d=je(C=>{let g=n.current;g&&(C.preventDefault(),i.current=!0,e(e2(g,C.nativeEvent)),document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",u))},[e,s,u]),p=je(C=>{if(!o)return;let g=C.which||C.keyCode;g<37||g>40||(C.preventDefault(),o({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},[o]);return vr(()=>()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,u]),Te.jsx("div",{ref:n,className:ft("rounded-inherit absolute inset-0 touch-none outline-none","focus:[&_.react-colorful-pointer]:scale-110",r),onTouchStart:d,onMouseDown:d,onKeyDown:p,tabIndex:0,role:"slider",...l,children:a})},br=({className:e,top:t=.5,left:o,color:a})=>Te.jsx("div",{className:ft("absolute z-[1] h-6 w-6 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-white bg-white active:cursor-grabbing","react-colorful-pointer shadow-[0_2px_8px_rgba(0,0,0,0.15)] transition-transform",e),style:{top:`${t*100}%`,left:`${o*100}%`}}),ku=({hsva:e,onChange:t,className:o,onFinishedUpdates:a})=>{let r=je(s=>{t({a:s.left},!1)},[t]),l=je(s=>{t({a:B1(e.a+s.left,0,1)},!0)},[e.a,t]),n=qo(()=>new K1({type:"hsva",h:e.h,s:e.s,v:e.v,a:0}).format("hsla"),[e.h,e.s,e.v]),i=qo(()=>new K1({type:"hsva",h:e.h,s:e.s,v:e.v,a:1}).format("hsla"),[e.h,e.s,e.v]);return Te.jsx("div",{className:ft("relative h-full w-full",o),children:Te.jsxs(wr,{onMove:r,onMoveEnd:a,onKey:l,"aria-label":"Alpha","aria-valuetext":`${j1(e.a*100)}%`,"aria-valuenow":j1(e.a*100),"aria-valuemin":0,"aria-valuemax":100,className:"h-full w-full rounded-lg",children:[Te.jsx("div",{className:"absolute inset-0 rounded-lg bg-white",style:{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>')`}}),Te.jsx("div",{className:"absolute inset-0 rounded-lg",style:{backgroundImage:`linear-gradient(90deg, ${n}, ${i})`}}),Te.jsx(br,{className:"z-[1]",top:.5,left:e.a,color:""})]})})},Hu=({hue:e,onChange:t,className:o,onFinishedUpdates:a})=>{let r=je(n=>{let i=j1(B1(360*n.left,0,360));t({h:i},!1)},[t]),l=je(n=>{t({h:B1(e+n.left*360,0,360)},!0)},[e,t]);return Te.jsx("div",{className:ft("relative h-full w-full",o),children:Te.jsxs(wr,{onMove:r,onMoveEnd:a,onKey:l,"aria-label":"Hue","aria-valuenow":j1(e),"aria-valuemax":360,"aria-valuemin":0,className:"h-full w-full rounded-lg",children:[Te.jsx("div",{className:"absolute inset-0 rounded-lg",style:{background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"}}),Te.jsx(br,{className:"z-[2]",top:.5,left:e/360,color:""})]})})},Pu=({hsva:e,onChange:t,className:o,onFinishedUpdates:a})=>{let r=je(i=>{let s=j1(B1(i.left*100,0,100)),u=j1(B1(100-i.top*100,0,100));t({s,v:u},!1)},[t]),l=je(i=>{t({s:B1(e.s+i.left*100,0,100),v:B1(e.v-i.top*100,0,100)},!0)},[e.s,e.v,t]),n=`hsl(${e.h}, 100%, 50%)`;return Te.jsx("div",{className:ft("relative h-full w-full rounded-xl",o),children:Te.jsxs(wr,{onMove:r,onMoveEnd:a,onKey:l,"aria-label":"Color","aria-valuetext":`Saturation ${j1(e.s)}%, Brightness ${j1(e.v)}%`,className:"rounded-inherit h-full w-full",children:[Te.jsx("div",{className:"rounded-inherit absolute inset-0 rounded-b-none",style:{backgroundColor:n,backgroundImage:"linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0))",boxShadow:"inset 0 0 0 1px rgba(0, 0, 0, 0.05)"}}),Te.jsx(br,{className:"z-[3]",top:1-e.v/100,left:e.s/100,color:""})]})})},C2=Es(null),jo=()=>{let e=Bs(C2);if(!e)throw new Error("ColorPicker compound components must be used within a ColorPicker");return e};function t2(e){return"type"in e?new K1(e):e}var Tu=({color:e,onChange:t,className:o,children:a,defaultColor:r,...l})=>{let[n,i]=xr(t2(e??r??{h:340,s:58,v:100,a:1,type:"hsva"})),s=Uo(!1),u=Uo(n);vr(()=>{!s.current&&e&&(u.current=t2(e),i(u.current))},[e]);let d=je((f,c)=>{let m=new K1({type:"hsva",...u.current.getHsva(),...f});u.current=m,i(m),s.current=!c,t?.(m)},[t]),p=je(()=>{s.current=!1},[]),C=je(async()=>{if(!("EyeDropper"in window)){console.log("EyeDropper API not supported");return}try{let f=await new window.EyeDropper().open();f.sRGBHex&&d(z1({type:"hex",value:f.sRGBHex},"hsva"),!0)}catch(f){console.log("EyeDropper cancelled or failed:",f)}},[t]),g={hsva:n.getHsva(),updateHsva:d,handleEyeDropper:C,onFinishedUpdates:p};return Te.jsx(C2.Provider,{value:g,children:Te.jsx("div",{...l,className:ft("relative flex h-[280px] w-[280px] cursor-default flex-col rounded-2xl bg-white shadow-lg select-none",o),children:a})})},Vu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:a}=jo(),r=je((l,n)=>{o(l,n)},[o]);return Te.jsx(Pu,{hsva:t,onChange:r,className:e,onFinishedUpdates:a})},_u=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:a}=jo(),r=je((l,n)=>{o(l,n)},[o]);return Te.jsx(Hu,{hue:t.h,onChange:r,className:e,onFinishedUpdates:a})},Du=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:a}=jo(),r=je((l,n)=>{o(l,n)},[o]);return Te.jsx(ku,{hsva:t,onChange:r,className:e,onFinishedUpdates:a})},Ou=({className:e,title:t="Pick color from screen",children:o})=>{let{handleEyeDropper:a}=jo(),[r,l]=xr(!1);return vr(()=>{typeof window<"u"&&"EyeDropper"in window&&l(!0)},[]),r?Te.jsx("button",{onClick:a,className:ft("flex h-10 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors hover:bg-gray-100",e),title:t,children:o}):null},kt=Object.assign(Tu,{Saturation:Vu,Hue:_u,Alpha:Du,EyeDropper:Ou});function Eu(e,t){switch(t){case"hex":return{type:"hex",value:e.getHex()};case"rgb":return{type:"rgb",...e.getRgb()};case"rgba":return{type:"rgba",...e.getRgba()};case"hsl":return{type:"hsl",...e.getHsl()};case"hsla":return{type:"hsla",...e.getHsla()};case"hsv":return{type:"hsv",...e.getHsv()};case"hsva":return{type:"hsva",...e.getHsva()};default:zo()}}var m2=(e={type:"hex",value:"#ff6b9d"})=>{let[t,o]=xr(()=>{let n=typeof e=="function"?e():e;return{color:new K1(n),type:n.type}}),a=qo(()=>Eu(t.color,t.type),[t.color,t.type]),r=qo(()=>{let n=t.color.getHsva();return{hex:t.color.getHex(),rgb:t.color.getRgb(),rgba:t.color.getRgba(),hsl:t.color.getHsl(),hsla:t.color.getHsla(),hsv:t.color.getHsv(),hsva:n,alpha:n.a}},[t.color]),l=je(n=>{try{let i="type"in n?new K1(n):n;o(s=>({color:i,type:s.type}))}catch(i){console.warn("Invalid color input:",n,i)}},[]);return[{colorInput:a,colorState:r},l]};import{createPortal as g7}from"react-dom";import{useRef as b1,useMemo as Bu,useEffect as Au,useState as t6,useCallback as o6}from"react";function h2(e,t,o,a){var r=this,l=b1(null),n=b1(0),i=b1(0),s=b1(null),u=b1([]),d=b1(),p=b1(),C=b1(e),g=b1(!0),f=b1(),c=b1();C.current=e;var m=typeof window<"u",I=!t&&t!==0&&m;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var h=!!(o=o||{}).leading,S=!("trailing"in o)||!!o.trailing,x=!!o.flushOnExit&&S,H="maxWait"in o,O="debounceOnServer"in o&&!!o.debounceOnServer,N=H?Math.max(+o.maxWait||0,t):null,y=Bu(function(){var V=function(w){var L=u.current,b=d.current;return u.current=d.current=null,n.current=w,i.current=i.current||w,p.current=C.current.apply(b,L)},U=function(w,L){I&&cancelAnimationFrame(s.current),s.current=I?requestAnimationFrame(w):setTimeout(w,L)},G=function(w){if(!g.current)return!1;var L=w-l.current;return!l.current||L>=t||L<0||H&&w-n.current>=N},W=function(w){return s.current=null,S&&u.current?V(w):(u.current=d.current=null,p.current)},$=function w(){var L=Date.now();if(h&&i.current===n.current&&_(),G(L))return W(L);if(g.current){var b=t-(L-l.current),v=H?Math.min(b,N-(L-n.current)):b;U(w,v)}},_=function(){a&&a({})},q=function(){if(m||O){var w,L=Date.now(),b=G(L);if(u.current=[].slice.call(arguments),d.current=r,l.current=L,x&&!f.current&&(f.current=function(){var v;((v=globalThis.document)==null?void 0:v.visibilityState)==="hidden"&&c.current.flush()},(w=globalThis.document)==null||w.addEventListener==null||w.addEventListener("visibilitychange",f.current)),b){if(!s.current&&g.current)return n.current=l.current,U($,t),h?V(l.current):p.current;if(H)return U($,t),V(l.current)}return s.current||U($,t),p.current}};return q.cancel=function(){var w=s.current;w&&(I?cancelAnimationFrame(s.current):clearTimeout(s.current)),n.current=0,u.current=l.current=d.current=s.current=null,w&&a&&a({})},q.isPending=function(){return!!s.current},q.flush=function(){return s.current?W(Date.now()):p.current},q},[h,H,t,N,S,x,I,m,O,a]);return c.current=y,Au(function(){return g.current=!0,function(){var V;x&&c.current.flush(),f.current&&((V=globalThis.document)==null||V.removeEventListener==null||V.removeEventListener("visibilitychange",f.current),f.current=null),g.current=!1}},[x]),y}import We from"react";function pt(e){let t=e?.parentNode;for(;t;){if(t instanceof ShadowRoot){t=t.host;continue}if(t instanceof HTMLElement){let{overflowY:o}=getComputedStyle(t);if(o==="auto"||o==="scroll")return t}t=t.parentNode}return null}var g2='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function v2({computePosition:e,onClose:t,autoFocus:o=!0,trapFocus:a=!1}={}){let[r,l]=We.useState(!1),[n,i]=We.useState({top:0,left:0}),s=We.useRef(null),u=We.useRef(null),d=We.useRef(!1),p=We.useRef(e);p.current=e;let C=We.useRef(t);C.current=t;let g=We.useRef(a);g.current=a;let f=We.useCallback((...h)=>{!s.current||!p.current||i(p.current(s.current,...h))},[]),c=We.useCallback(()=>{f(),d.current=!0,l(!0)},[f]),m=We.useCallback(()=>{C.current&&C.current(),d.current=!1,l(!1),s.current?.focus()},[]),I=We.useCallback(()=>{d.current?m():c()},[c,m]);return We.useEffect(()=>{if(!r)return;let h=x=>{if(x.key==="Escape"&&(x.preventDefault(),m()),g.current&&x.key==="Tab"){let H=u.current;if(!H)return;let O=Array.from(H.querySelectorAll(g2)).filter(V=>!V.hasAttribute("disabled")),N=O[0],y=O.at(-1);if(!N||!y)return;x.shiftKey&&document.activeElement===N?(x.preventDefault(),y.focus()):!x.shiftKey&&document.activeElement===y&&(x.preventDefault(),N.focus())}},S=x=>{let H=u.current,O=s.current;if(!H||!O)return;let N=typeof x.composedPath=="function"?x.composedPath():[],y=N.includes(H)||x.target instanceof Node&&H.contains(x.target),V=N.includes(O)||x.target instanceof Node&&O.contains(x.target);!y&&!V&&m()};return document.addEventListener("keydown",h),document.addEventListener("mousedown",S),document.addEventListener("touchstart",S),()=>{document.removeEventListener("keydown",h),document.removeEventListener("mousedown",S),document.removeEventListener("touchstart",S)}},[r,m]),We.useEffect(()=>{if(!r||!o||!u.current)return;let h=u.current.querySelector(g2);h&&h.focus()},[r,o]),We.useEffect(()=>{if(!r||!s.current)return;let h=pt(s.current);if(!h)return;let S=()=>m();return h.addEventListener("scroll",S,{passive:!0}),()=>h.removeEventListener("scroll",S)},[r,m]),{isOpen:r,open:c,close:m,toggle:I,triggerRef:s,popoverRef:u,position:n,reposition:f}}var Zu=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},Ko=Zu;var Fu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},x2=Fu;var $u=e=>Ko(x2[e.toLowerCase()],6),L2=$u;var Nu=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Uu=e=>{let t;return(t=e.match(Nu))?Ko(parseInt(t[1],16),t[1].length):void 0},w2=Uu;var Xe="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",m6=`(?:${Xe}|none)`,Ct=`${Xe}%`,h6=`(?:${Xe}%|none)`,so=`(?:${Xe}%|${Xe})`,qu=`(?:${Xe}%|${Xe}|none)`,b2=`(?:${Xe}(deg|grad|rad|turn)|${Xe})`,g6=`(?:${Xe}(deg|grad|rad|turn)|${Xe}|none)`,G1="\\s*,\\s*";var v6=new RegExp("^"+qu+"$");var zu=new RegExp(`^rgba?\\(\\s*${Xe}${G1}${Xe}${G1}${Xe}\\s*(?:,\\s*${so}\\s*)?\\)$`),ju=new RegExp(`^rgba?\\(\\s*${Ct}${G1}${Ct}${G1}${Ct}\\s*(?:,\\s*${so}\\s*)?\\)$`),Ku=e=>{let t={mode:"rgb"},o;if(o=e.match(zu))o[1]!==void 0&&(t.r=o[1]/255),o[2]!==void 0&&(t.g=o[2]/255),o[3]!==void 0&&(t.b=o[3]/255);else if(o=e.match(ju))o[1]!==void 0&&(t.r=o[1]/100),o[2]!==void 0&&(t.g=o[2]/100),o[3]!==void 0&&(t.b=o[3]/100);else return;return o[4]!==void 0?t.alpha=Math.max(0,Math.min(1,o[4]/100)):o[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+o[5]))),t},I2=Ku;var Gu=(e,t)=>e===void 0?void 0:typeof e!="object"?mt(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,Go=Gu;var Wu=(e="rgb")=>t=>(t=Go(t,e))!==void 0?t.mode===e?t:I1[t.mode][e]?I1[t.mode][e](t):e==="rgb"?I1[t.mode].rgb(t):I1.rgb[e](I1[t.mode].rgb(t)):void 0,n1=Wu;var I1={},y2={},uo=[],Ir={},Xu=e=>e,ge=e=>(I1[e.mode]={...I1[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{I1[t]||(I1[t]={}),I1[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=Xu)}),y2[e.mode]=e,(e.parse||[]).forEach(t=>{Qu(t,e.mode)}),n1(e.mode)),Wo=e=>y2[e],Qu=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Ir[e]=t}else typeof e=="function"&&uo.indexOf(e)<0&&uo.push(e)};var yr=/[^\x00-\x7F]|[a-zA-Z_]/,Yu=/[^\x00-\x7F]|[-\w]/,T={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},oe=0;function Xo(e){let t=e[oe],o=e[oe+1];return t==="-"||t==="+"?/\d/.test(o)||o==="."&&/\d/.test(e[oe+2]):t==="."?/\d/.test(o):/\d/.test(t)}function Mr(e){if(oe>=e.length)return!1;let t=e[oe];if(yr.test(t))return!0;if(t==="-"){if(e.length-oe<2)return!1;let o=e[oe+1];return!!(o==="-"||yr.test(o))}return!1}var Ju={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function co(e){let t="";if((e[oe]==="-"||e[oe]==="+")&&(t+=e[oe++]),t+=Qo(e),e[oe]==="."&&/\d/.test(e[oe+1])&&(t+=e[oe++]+Qo(e)),(e[oe]==="e"||e[oe]==="E")&&((e[oe+1]==="-"||e[oe+1]==="+")&&/\d/.test(e[oe+2])?t+=e[oe++]+e[oe++]+Qo(e):/\d/.test(e[oe+1])&&(t+=e[oe++]+Qo(e))),Mr(e)){let o=Yo(e);return o==="deg"||o==="rad"||o==="turn"||o==="grad"?{type:T.Hue,value:t*Ju[o]}:void 0}return e[oe]==="%"?(oe++,{type:T.Percentage,value:+t}):{type:T.Number,value:+t}}function Qo(e){let t="";for(;/\d/.test(e[oe]);)t+=e[oe++];return t}function Yo(e){let t="";for(;oe<e.length&&Yu.test(e[oe]);)t+=e[oe++];return t}function e3(e){let t=Yo(e);return e[oe]==="("?(oe++,{type:T.Function,value:t}):t==="none"?{type:T.None,value:void 0}:{type:T.Ident,value:t}}function t3(e=""){let t=e.trim(),o=[],a;for(oe=0;oe<t.length;){if(a=t[oe++],a===`
2
- `||a===" "||a===" "){for(;oe<t.length&&(t[oe]===`
3
- `||t[oe]===" "||t[oe]===" ");)oe++;continue}if(a===",")return;if(a===")"){o.push({type:T.ParenClose});continue}if(a==="+"){if(oe--,Xo(t)){o.push(co(t));continue}return}if(a==="-"){if(oe--,Xo(t)){o.push(co(t));continue}if(Mr(t)){o.push({type:T.Ident,value:Yo(t)});continue}return}if(a==="."){if(oe--,Xo(t)){o.push(co(t));continue}return}if(a==="/"){for(;oe<t.length&&(t[oe]===`
4
- `||t[oe]===" "||t[oe]===" ");)oe++;let r;if(Xo(t)&&(r=co(t),r.type!==T.Hue)){o.push({type:T.Alpha,value:r});continue}if(Mr(t)&&Yo(t)==="none"){o.push({type:T.Alpha,value:{type:T.None,value:void 0}});continue}return}if(/\d/.test(a)){oe--,o.push(co(t));continue}if(yr.test(a)){oe--,o.push(e3(t));continue}return}return o}function o3(e){e._i=0;let t=e[e._i++];if(!t||t.type!==T.Function||t.value!=="color"||(t=e[e._i++],t.type!==T.Ident))return;let o=Ir[t.value];if(!o)return;let a={mode:o},r=M2(e,!1);if(!r)return;let l=Wo(o).channels;for(let n=0,i,s;n<l.length;n++)i=r[n],s=l[n],i.type!==T.None&&(a[s]=i.type===T.Number?i.value:i.value/100,s==="alpha"&&(a[s]=Math.max(0,Math.min(1,a[s]))));return a}function M2(e,t){let o=[],a;for(;e._i<e.length;){if(a=e[e._i++],a.type===T.None||a.type===T.Number||a.type===T.Alpha||a.type===T.Percentage||t&&a.type===T.Hue){o.push(a);continue}if(a.type===T.ParenClose){if(e._i<e.length)return;continue}return}if(!(o.length<3||o.length>4)){if(o.length===4){if(o[3].type!==T.Alpha)return;o[3]=o[3].value}return o.length===3&&o.push({type:T.None,value:void 0}),o.every(r=>r.type!==T.Alpha)?o:void 0}}function a3(e,t){e._i=0;let o=e[e._i++];if(!o||o.type!==T.Function)return;let a=M2(e,t);if(a)return a.unshift(o.value),a}var r3=e=>{if(typeof e!="string")return;let t=t3(e),o=t?a3(t,!0):void 0,a,r=0,l=uo.length;for(;r<l;)if((a=uo[r++](e,o))!==void 0)return a;return t?o3(t):void 0},mt=r3;function l3(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let o={mode:"rgb"},[,a,r,l,n]=t;if(!(a.type===T.Hue||r.type===T.Hue||l.type===T.Hue))return a.type!==T.None&&(o.r=a.type===T.Number?a.value/255:a.value/100),r.type!==T.None&&(o.g=r.type===T.Number?r.value/255:r.value/100),l.type!==T.None&&(o.b=l.type===T.Number?l.value/255:l.value/100),n.type!==T.None&&(o.alpha=Math.min(1,Math.max(0,n.type===T.Number?n.value:n.value/100))),o}var S2=l3;var n3=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,R2=n3;var k2=(e,t,o)=>e+o*(t-e);var i3=e=>{let t=[];for(let o=0;o<e.length-1;o++){let a=e[o],r=e[o+1];a===void 0&&r===void 0?t.push(void 0):a!==void 0&&r!==void 0?t.push([a,r]):t.push(a!==void 0?[a,a]:[r,r])}return t},H2=e=>t=>{let o=i3(t);return a=>{let r=a*o.length,l=a>=1?o.length-1:Math.max(Math.floor(r),0),n=o[l];return n===void 0?void 0:e(n[0],n[1],r-l)}};var D=H2(k2);var pe=e=>{let t=!1,o=e.map(a=>a!==void 0?(t=!0,a):1);return t?o:e};var s3={mode:"rgb",channels:["r","g","b","alpha"],parse:[S2,w2,I2,L2,R2,"srgb"],serialize:"srgb",interpolate:{r:D,g:D,b:D,alpha:{use:D,fixup:pe}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},f1=s3;var Sr=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),u3=e=>{let t=Sr(e.r),o=Sr(e.g),a=Sr(e.b),r={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*o+.1882286462349947*a,y:.297344975250536*t+.6273635662554661*o+.0752914584939979*a,z:.0270313613864123*t+.0706888525358272*o+.9913375368376386*a};return e.alpha!==void 0&&(r.alpha=e.alpha),r},Rr=u3;var kr=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),d3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"a98",r:kr(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*o),g:kr(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*o),b:kr(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*o)};return a!==void 0&&(r.alpha=a),r},Hr=d3;var Pr=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},c3=({r:e,g:t,b:o,alpha:a})=>{let r={mode:"lrgb",r:Pr(e),g:Pr(t),b:Pr(o)};return a!==void 0&&(r.alpha=a),r},p1=c3;var f3=e=>{let{r:t,g:o,b:a,alpha:r}=p1(e),l={mode:"xyz65",x:.4123907992659593*t+.357584339383878*o+.1804807884018343*a,y:.2126390058715102*t+.715168678767756*o+.0721923153607337*a,z:.0193308187155918*t+.119194779794626*o+.9505321522496607*a};return r!==void 0&&(l.alpha=r),l},e1=f3;var Tr=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},p3=({r:e,g:t,b:o,alpha:a},r="rgb")=>{let l={mode:r,r:Tr(e),g:Tr(t),b:Tr(o)};return a!==void 0&&(l.alpha=a),l},C1=p3;var C3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=C1({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*o,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*o,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*o});return a!==void 0&&(r.alpha=a),r},t1=C3;var m3={...f1,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Hr(e1(e)),xyz65:Hr},toMode:{rgb:e=>t1(Rr(e)),xyz65:Rr}},P2=m3;var h3=e=>(e=e%360)<0?e+360:e,we=h3;var g3=(e,t)=>e.map((o,a,r)=>{if(o===void 0)return o;let l=we(o);return a===0||e[a-1]===void 0?l:t(l-we(r[a-1]))}).reduce((o,a)=>!o.length||a===void 0||o[o.length-1]===void 0?(o.push(a),o):(o.push(a+o[o.length-1]),o),[]),Ae=e=>g3(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var De=[-.14861,1.78277,-.29227,-.90649,1.97294,0],T2=Math.PI/180,V2=180/Math.PI;var _2=De[3]*De[4],D2=De[1]*De[4],O2=De[1]*De[2]-De[0]*De[3],v3=({r:e,g:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(O2*o+e*_2-t*D2)/(O2+_2-D2),l=o-r,n=(De[4]*(t-r)-De[2]*l)/De[3],i={mode:"cubehelix",l:r,s:r===0||r===1?void 0:Math.sqrt(l*l+n*n)/(De[4]*r*(1-r))};return i.s&&(i.h=Math.atan2(n,l)*V2-120),a!==void 0&&(i.alpha=a),i},E2=v3;var x3=({h:e,s:t,l:o,alpha:a})=>{let r={mode:"rgb"};e=(e===void 0?0:e+120)*T2,o===void 0&&(o=0);let l=t===void 0?0:t*o*(1-o),n=Math.cos(e),i=Math.sin(e);return r.r=o+l*(De[0]*n+De[1]*i),r.g=o+l*(De[2]*n+De[3]*i),r.b=o+l*(De[4]*n+De[5]*i),a!==void 0&&(r.alpha=a),r},B2=x3;var W1=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let o=we(e.h),a=we(t.h),r=Math.sin((a-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*r},A2=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let o=we(e.h),a=we(t.h);return Math.abs(a-o)>180?o-(a-360*Math.sign(a-o)):a-o},X1=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let o=we(e.h),a=we(t.h),r=Math.sin((a-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*r};var Ze=e=>{let t=e.reduce((a,r)=>{if(r!==void 0){let l=r*Math.PI/180;a.sin+=Math.sin(l),a.cos+=Math.cos(l)}return a},{sin:0,cos:0}),o=Math.atan2(t.sin,t.cos)*180/Math.PI;return o<0?360+o:o};var L3={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:E2},toMode:{rgb:B2},interpolate:{h:{use:D,fixup:Ae},s:D,l:D,alpha:{use:D,fixup:pe}},difference:{h:W1},average:{h:Ze}},Z2=L3;var w3=({l:e,a:t,b:o,alpha:a},r="lch")=>{t===void 0&&(t=0),o===void 0&&(o=0);let l=Math.sqrt(t*t+o*o),n={mode:r,l:e,c:l};return l&&(n.h=we(Math.atan2(o,t)*180/Math.PI)),a!==void 0&&(n.alpha=a),n},i1=w3;var b3=({l:e,c:t,h:o,alpha:a},r="lab")=>{o===void 0&&(o=0);let l={mode:r,l:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return a!==void 0&&(l.alpha=a),l},s1=b3;var Jo=Math.pow(29,3)/Math.pow(3,3),ea=Math.pow(6,3)/Math.pow(29,3);var He={X:.9642956764295677,Y:1,Z:.8251046025104602},Q1={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},Tp=Math.pow(29,3)/Math.pow(3,3),Vp=Math.pow(6,3)/Math.pow(29,3);var Vr=e=>Math.pow(e,3)>ea?Math.pow(e,3):(116*e-16)/Jo,I3=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(e+16)/116,l=t/500+r,n=r-o/200,i={mode:"xyz65",x:Vr(l)*Q1.X,y:Vr(r)*Q1.Y,z:Vr(n)*Q1.Z};return a!==void 0&&(i.alpha=a),i},ta=I3;var y3=e=>t1(ta(e)),Y1=y3;var _r=e=>e>ea?Math.cbrt(e):(Jo*e+16)/116,M3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=_r(e/Q1.X),l=_r(t/Q1.Y),n=_r(o/Q1.Z),i={mode:"lab65",l:116*l-16,a:500*(r-l),b:200*(l-n)};return a!==void 0&&(i.alpha=a),i},oa=M3;var S3=e=>{let t=oa(e1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},J1=S3;var ht=.14444444444444443*Math.PI,Ht=Math.cos(ht),Pt=Math.sin(ht),aa=100/Math.log(139/100);var R3=({l:e,c:t,h:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"lab65",l:(Math.exp(e*1/aa)-1)/.0039},l=(Math.exp(.0435*t*1*1)-1)/.075,n=l*Math.cos(o/180*Math.PI-ht),i=l*Math.sin(o/180*Math.PI-ht);return r.a=n*Ht-i/.83*Pt,r.b=n*Pt+i/.83*Ht,a!==void 0&&(r.alpha=a),r},po=R3;var k3=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=t*Ht+o*Pt,l=.83*(o*Ht-t*Pt),n=Math.sqrt(r*r+l*l),i={mode:"dlch",l:aa/1*Math.log(1+.0039*e),c:Math.log(1+.075*n)/(.0435*1*1)};return i.c&&(i.h=we((Math.atan2(l,r)+ht)/Math.PI*180)),a!==void 0&&(i.alpha=a),i},Co=k3;var F2=e=>po(i1(e,"dlch")),$2=e=>s1(Co(e),"dlab"),H3={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:F2,rgb:e=>Y1(F2(e))},fromMode:{lab65:$2,rgb:e=>$2(J1(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:D,a:D,b:D,alpha:{use:D,fixup:pe}}},N2=H3;var P3={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:po,dlab:e=>s1(e,"dlab"),rgb:e=>Y1(po(e))},fromMode:{lab65:Co,dlab:e=>i1(e,"dlch"),rgb:e=>Co(J1(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:D,c:D,h:{use:D,fixup:Ae},alpha:{use:D,fixup:pe}},difference:{h:X1},average:{h:Ze}},U2=P3;function Or({h:e,s:t,i:o,alpha:a}){e=we(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:o*(1+t*(3/(2-r)-1)),g:o*(1+t*(3*(1-r)/(2-r)-1)),b:o*(1-t)};break;case 1:l={r:o*(1+t*(3*(1-r)/(2-r)-1)),g:o*(1+t*(3/(2-r)-1)),b:o*(1-t)};break;case 2:l={r:o*(1-t),g:o*(1+t*(3/(2-r)-1)),b:o*(1+t*(3*(1-r)/(2-r)-1))};break;case 3:l={r:o*(1-t),g:o*(1+t*(3*(1-r)/(2-r)-1)),b:o*(1+t*(3/(2-r)-1))};break;case 4:l={r:o*(1+t*(3*(1-r)/(2-r)-1)),g:o*(1-t),b:o*(1+t*(3/(2-r)-1))};break;case 5:l={r:o*(1+t*(3/(2-r)-1)),g:o*(1-t),b:o*(1+t*(3*(1-r)/(2-r)-1))};break;default:l={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return l.mode="rgb",a!==void 0&&(l.alpha=a),l}function Er({r:e,g:t,b:o,alpha:a}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.max(e,t,o),l=Math.min(e,t,o),n={mode:"hsi",s:e+t+o===0?0:1-3*l/(e+t+o),i:(e+t+o)/3};return r-l!==0&&(n.h=(r===e?(t-o)/(r-l)+(t<o)*6:r===t?(o-e)/(r-l)+2:(e-t)/(r-l)+4)*60),a!==void 0&&(n.alpha=a),n}var T3={mode:"hsi",toMode:{rgb:Or},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Er},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:D,fixup:Ae},s:D,i:D,alpha:{use:D,fixup:pe}},difference:{h:W1},average:{h:Ze}},q2=T3;function Br({h:e,s:t,l:o,alpha:a}){e=we(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let r=o+t*(o<.5?o:1-o),l=r-(r-o)*2*Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r,g:l,b:2*o-r};break;case 1:n={r:l,g:r,b:2*o-r};break;case 2:n={r:2*o-r,g:r,b:l};break;case 3:n={r:2*o-r,g:l,b:r};break;case 4:n={r:l,g:2*o-r,b:r};break;case 5:n={r,g:2*o-r,b:l};break;default:n={r:2*o-r,g:2*o-r,b:2*o-r}}return n.mode="rgb",a!==void 0&&(n.alpha=a),n}function Ar({r:e,g:t,b:o,alpha:a}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.max(e,t,o),l=Math.min(e,t,o),n={mode:"hsl",s:r===l?0:(r-l)/(1-Math.abs(r+l-1)),l:.5*(r+l)};return r-l!==0&&(n.h=(r===e?(t-o)/(r-l)+(t<o)*6:r===t?(o-e)/(r-l)+2:(e-t)/(r-l)+4)*60),a!==void 0&&(n.alpha=a),n}var V3=(e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},z2=V3;var _3=new RegExp(`^hsla?\\(\\s*${b2}${G1}${Ct}${G1}${Ct}\\s*(?:,\\s*${so}\\s*)?\\)$`),D3=e=>{let t=e.match(_3);if(!t)return;let o={mode:"hsl"};return t[3]!==void 0?o.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(o.h=z2(t[1],t[2])),t[4]!==void 0&&(o.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(o.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?o.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(o.alpha=Math.max(0,Math.min(1,+t[7]))),o},j2=D3;function O3(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let o={mode:"hsl"},[,a,r,l,n]=t;if(a.type!==T.None){if(a.type===T.Percentage)return;o.h=a.value}if(r.type!==T.None){if(r.type===T.Hue)return;o.s=r.value/100}if(l.type!==T.None){if(l.type===T.Hue)return;o.l=l.value/100}return n.type!==T.None&&(o.alpha=Math.min(1,Math.max(0,n.type===T.Number?n.value:n.value/100))),o}var K2=O3;var E3={mode:"hsl",toMode:{rgb:Br},fromMode:{rgb:Ar},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[K2,j2],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:D,fixup:Ae},s:D,l:D,alpha:{use:D,fixup:pe}},difference:{h:W1},average:{h:Ze}},ra=E3;function mo({h:e,s:t,v:o,alpha:a}){e=we(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:o,g:o*(1-t*r),b:o*(1-t)};break;case 1:l={r:o*(1-t*r),g:o,b:o*(1-t)};break;case 2:l={r:o*(1-t),g:o,b:o*(1-t*r)};break;case 3:l={r:o*(1-t),g:o*(1-t*r),b:o};break;case 4:l={r:o*(1-t*r),g:o*(1-t),b:o};break;case 5:l={r:o,g:o*(1-t),b:o*(1-t*r)};break;default:l={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return l.mode="rgb",a!==void 0&&(l.alpha=a),l}function ho({r:e,g:t,b:o,alpha:a}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.max(e,t,o),l=Math.min(e,t,o),n={mode:"hsv",s:r===0?0:1-l/r,v:r};return r-l!==0&&(n.h=(r===e?(t-o)/(r-l)+(t<o)*6:r===t?(o-e)/(r-l)+2:(e-t)/(r-l)+4)*60),a!==void 0&&(n.alpha=a),n}var B3={mode:"hsv",toMode:{rgb:mo},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:ho},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:D,fixup:Ae},s:D,v:D,alpha:{use:D,fixup:pe}},difference:{h:W1},average:{h:Ze}},la=B3;function Zr({h:e,w:t,b:o,alpha:a}){if(t===void 0&&(t=0),o===void 0&&(o=0),t+o>1){let r=t+o;t/=r,o/=r}return mo({h:e,s:o===1?1:1-t/(1-o),v:1-o,alpha:a})}function Fr(e){let t=ho(e);if(t===void 0)return;let o=t.s!==void 0?t.s:0,a=t.v!==void 0?t.v:0,r={mode:"hwb",w:(1-o)*a,b:1-a};return t.h!==void 0&&(r.h=t.h),t.alpha!==void 0&&(r.alpha=t.alpha),r}function A3(e,t){if(!t||t[0]!=="hwb")return;let o={mode:"hwb"},[,a,r,l,n]=t;if(a.type!==T.None){if(a.type===T.Percentage)return;o.h=a.value}if(r.type!==T.None){if(r.type===T.Hue)return;o.w=r.value/100}if(l.type!==T.None){if(l.type===T.Hue)return;o.b=l.value/100}return n.type!==T.None&&(o.alpha=Math.min(1,Math.max(0,n.type===T.Number?n.value:n.value/100))),o}var G2=A3;var Z3={mode:"hwb",toMode:{rgb:Zr},fromMode:{rgb:Fr},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[G2],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:D,fixup:Ae},w:D,b:D,alpha:{use:D,fixup:pe}},difference:{h:A2},average:{h:Ze}},W2=Z3;var Tt=.1593017578125,X2=78.84375,Vt=.8359375,_t=18.8515625,Dt=18.6875;function na(e){if(e<0)return 0;let t=Math.pow(e,1/X2);return 1e4*Math.pow(Math.max(0,t-Vt)/(_t-Dt*t),1/Tt)}function ia(e){if(e<0)return 0;let t=Math.pow(e/1e4,Tt);return Math.pow((Vt+_t*t)/(1+Dt*t),X2)}var $r=e=>Math.max(e/203,0),$3=({i:e,t,p:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=na(e+.008609037037932761*t+.11102962500302593*o),l=na(e-.00860903703793275*t-.11102962500302599*o),n=na(e+.5600313357106791*t-.32062717498731885*o),i={mode:"xyz65",x:$r(2.070152218389422*r-1.3263473389671556*l+.2066510476294051*n),y:$r(.3647385209748074*r+.680566024947227*l-.0453045459220346*n),z:$r(-.049747207535812*r-.0492609666966138*l+1.1880659249923042*n)};return a!==void 0&&(i.alpha=a),i},Nr=$3;var Ur=(e=0)=>Math.max(e*203,0),N3=({x:e,y:t,z:o,alpha:a})=>{let r=Ur(e),l=Ur(t),n=Ur(o),i=ia(.3592832590121217*r+.6976051147779502*l-.0358915932320289*n),s=ia(-.1920808463704995*r+1.1004767970374323*l+.0753748658519118*n),u=ia(.0070797844607477*r+.0748396662186366*l+.8433265453898765*n),d=.5*i+.5*s,p=1.61376953125*i-3.323486328125*s+1.709716796875*u,C=4.378173828125*i-4.24560546875*s-.132568359375*u,g={mode:"itp",i:d,t:p,p:C};return a!==void 0&&(g.alpha=a),g},qr=N3;var U3={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Nr,rgb:e=>t1(Nr(e))},fromMode:{xyz65:qr,rgb:e=>qr(e1(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:D,t:D,p:D,alpha:{use:D,fixup:pe}}},Q2=U3;var q3=134.03437499999998,z3=16295499532821565e-27,zr=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,Tt);return Math.pow((Vt+_t*t)/(1+Dt*t),q3)},jr=(e=0)=>Math.max(e*203,0),j3=({x:e,y:t,z:o,alpha:a})=>{e=jr(e),t=jr(t),o=jr(o);let r=1.15*e-.15*o,l=.66*t+.34*e,n=zr(.41478972*r+.579999*l+.014648*o),i=zr(-.20151*r+1.120649*l+.0531008*o),s=zr(-.0166008*r+.2648*l+.6684799*o),u=(n+i)/2,d={mode:"jab",j:.44*u/(1-.56*u)-z3,a:3.524*n-4.066708*i+.542708*s,b:.199076*n+1.096799*i-1.295875*s};return a!==void 0&&(d.alpha=a),d},sa=j3;var K3=134.03437499999998,Y2=16295499532821565e-27,Kr=e=>{if(e<0)return 0;let t=Math.pow(e,1/K3);return 1e4*Math.pow((Vt-t)/(Dt*t-_t),1/Tt)},Gr=e=>e/203,G3=({j:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(e+Y2)/(.44+.56*(e+Y2)),l=Kr(r+.13860504*t+.058047316*o),n=Kr(r-.13860504*t-.058047316*o),i=Kr(r-.096019242*t-.8118919*o),s={mode:"xyz65",x:Gr(1.661373024652174*l-.914523081304348*n+.23136208173913045*i),y:Gr(-.3250758611844533*l+1.571847026732543*n-.21825383453227928*i),z:Gr(-.090982811*l-.31272829*n+1.5227666*i)};return a!==void 0&&(s.alpha=a),s},ua=G3;var W3=e=>{let t=sa(e1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},da=W3;var X3=e=>t1(ua(e)),ca=X3;var Q3={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:da,xyz65:sa},toMode:{rgb:ca,xyz65:ua},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:D,a:D,b:D,alpha:{use:D,fixup:pe}}},J2=Q3;var Y3=({j:e,a:t,b:o,alpha:a})=>{t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.sqrt(t*t+o*o),l={mode:"jch",j:e,c:r};return r&&(l.h=we(Math.atan2(o,t)*180/Math.PI)),a!==void 0&&(l.alpha=a),l},Wr=Y3;var J3=({j:e,c:t,h:o,alpha:a})=>{o===void 0&&(o=0);let r={mode:"jab",j:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return a!==void 0&&(r.alpha=a),r},Xr=J3;var ed={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Xr,rgb:e=>ca(Xr(e))},fromMode:{rgb:e=>Wr(da(e)),jab:Wr},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:D,fixup:Ae},c:D,j:D,alpha:{use:D,fixup:pe}},difference:{h:X1},average:{h:Ze}},e0=ed;var et=Math.pow(29,3)/Math.pow(3,3),Ot=Math.pow(6,3)/Math.pow(29,3);var Qr=e=>Math.pow(e,3)>Ot?Math.pow(e,3):(116*e-16)/et,td=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(e+16)/116,l=t/500+r,n=r-o/200,i={mode:"xyz50",x:Qr(l)*He.X,y:Qr(r)*He.Y,z:Qr(n)*He.Z};return a!==void 0&&(i.alpha=a),i},Et=td;var od=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=C1({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*o,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*o,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*o});return a!==void 0&&(r.alpha=a),r},S1=od;var ad=e=>S1(Et(e)),fa=ad;var rd=e=>{let{r:t,g:o,b:a,alpha:r}=p1(e),l={mode:"xyz50",x:.436065742824811*t+.3851514688337912*o+.14307845442264197*a,y:.22249319175623702*t+.7168870538238823*o+.06061979053616537*a,z:.013923904500943465*t+.09708128566574634*o+.7140993584005155*a};return r!==void 0&&(l.alpha=r),l},R1=rd;var Yr=e=>e>Ot?Math.cbrt(e):(et*e+16)/116,ld=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Yr(e/He.X),l=Yr(t/He.Y),n=Yr(o/He.Z),i={mode:"lab",l:116*l-16,a:500*(r-l),b:200*(l-n)};return a!==void 0&&(i.alpha=a),i},Bt=ld;var nd=e=>{let t=Bt(R1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},pa=nd;function id(e,t){if(!t||t[0]!=="lab")return;let o={mode:"lab"},[,a,r,l,n]=t;if(!(a.type===T.Hue||r.type===T.Hue||l.type===T.Hue))return a.type!==T.None&&(o.l=Math.min(Math.max(0,a.value),100)),r.type!==T.None&&(o.a=r.type===T.Number?r.value:r.value*125/100),l.type!==T.None&&(o.b=l.type===T.Number?l.value:l.value*125/100),n.type!==T.None&&(o.alpha=Math.min(1,Math.max(0,n.type===T.Number?n.value:n.value/100))),o}var t0=id;var sd={mode:"lab",toMode:{xyz50:Et,rgb:fa},fromMode:{xyz50:Bt,rgb:pa},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[t0],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:D,a:D,b:D,alpha:{use:D,fixup:pe}}},At=sd;var ud={...At,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:ta,rgb:Y1},fromMode:{xyz65:oa,rgb:J1},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},o0=ud;function dd(e,t){if(!t||t[0]!=="lch")return;let o={mode:"lch"},[,a,r,l,n]=t;if(a.type!==T.None){if(a.type===T.Hue)return;o.l=Math.min(Math.max(0,a.value),100)}if(r.type!==T.None&&(o.c=Math.max(0,r.type===T.Number?r.value:r.value*150/100)),l.type!==T.None){if(l.type===T.Percentage)return;o.h=l.value}return n.type!==T.None&&(o.alpha=Math.min(1,Math.max(0,n.type===T.Number?n.value:n.value/100))),o}var a0=dd;var cd={mode:"lch",toMode:{lab:s1,rgb:e=>fa(s1(e))},fromMode:{rgb:e=>i1(pa(e)),lab:i1},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[a0],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:D,fixup:Ae},c:D,l:D,alpha:{use:D,fixup:pe}},difference:{h:X1},average:{h:Ze}},Zt=cd;var fd={...Zt,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>s1(e,"lab65"),rgb:e=>Y1(s1(e,"lab65"))},fromMode:{rgb:e=>i1(J1(e),"lch65"),lab65:e=>i1(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},r0=fd;var pd=({l:e,u:t,v:o,alpha:a})=>{t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.sqrt(t*t+o*o),l={mode:"lchuv",l:e,c:r};return r&&(l.h=we(Math.atan2(o,t)*180/Math.PI)),a!==void 0&&(l.alpha=a),l},Jr=pd;var Cd=({l:e,c:t,h:o,alpha:a})=>{o===void 0&&(o=0);let r={mode:"luv",l:e,u:t?t*Math.cos(o/180*Math.PI):0,v:t?t*Math.sin(o/180*Math.PI):0};return a!==void 0&&(r.alpha=a),r},el=Cd;var l0=(e,t,o)=>4*e/(e+15*t+3*o),n0=(e,t,o)=>9*t/(e+15*t+3*o),md=l0(He.X,He.Y,He.Z),hd=n0(He.X,He.Y,He.Z),gd=e=>e<=Ot?et*e:116*Math.cbrt(e)-16,vd=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=gd(t/He.Y),l=l0(e,t,o),n=n0(e,t,o);!isFinite(l)||!isFinite(n)?r=l=n=0:(l=13*r*(l-md),n=13*r*(n-hd));let i={mode:"luv",l:r,u:l,v:n};return a!==void 0&&(i.alpha=a),i},go=vd;var xd=(e,t,o)=>4*e/(e+15*t+3*o),Ld=(e,t,o)=>9*t/(e+15*t+3*o),wd=xd(He.X,He.Y,He.Z),bd=Ld(He.X,He.Y,He.Z),Id=({l:e,u:t,v:o,alpha:a})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),o===void 0&&(o=0);let r=t/(13*e)+wd,l=o/(13*e)+bd,n=He.Y*(e<=8?e/et:Math.pow((e+16)/116,3)),i=n*(9*r)/(4*l),s=n*(12-3*r-20*l)/(4*l),u={mode:"xyz50",x:i,y:n,z:s};return a!==void 0&&(u.alpha=a),u},vo=Id;var yd=e=>Jr(go(R1(e))),Md=e=>S1(vo(el(e))),Sd={mode:"lchuv",toMode:{luv:el,rgb:Md},fromMode:{rgb:yd,luv:Jr},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:D,fixup:Ae},c:D,l:D,alpha:{use:D,fixup:pe}},difference:{h:X1},average:{h:Ze}},i0=Sd;var Rd={...f1,mode:"lrgb",toMode:{rgb:C1},fromMode:{rgb:p1},parse:["srgb-linear"],serialize:"srgb-linear"},s0=Rd;var kd={mode:"luv",toMode:{xyz50:vo,rgb:e=>S1(vo(e))},fromMode:{xyz50:go,rgb:e=>go(R1(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:D,u:D,v:D,alpha:{use:D,fixup:pe}}},u0=kd;var Hd=({r:e,g:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*o),l=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*o),n=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*o),i={mode:"oklab",l:.210454268309314*r+.7936177747023054*l-.0040720430116193*n,a:1.9779985324311684*r-2.42859224204858*l+.450593709617411*n,b:.0259040424655478*r+.7827717124575296*l-.8086757549230774*n};return a!==void 0&&(i.alpha=a),i},Ca=Hd;var Pd=e=>{let t=Ca(p1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tt=Pd;var Td=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.pow(e+.3963377773761749*t+.2158037573099136*o,3),l=Math.pow(e-.1055613458156586*t-.0638541728258133*o,3),n=Math.pow(e-.0894841775298119*t-1.2914855480194092*o,3),i={mode:"lrgb",r:4.076741636075957*r-3.3077115392580616*l+.2309699031821044*n,g:-1.2684379732850317*r+2.6097573492876887*l-.3413193760026573*n,b:-.0041960761386756*r-.7034186179359362*l+1.7076146940746117*n};return a!==void 0&&(i.alpha=a),i},k1=Td;var Vd=e=>C1(k1(e)),ot=Vd;function xo(e){let a=1.170873786407767;return .5*(a*e-.206+Math.sqrt((a*e-.206)*(a*e-.206)+4*.03*a*e))}function gt(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function _d(e,t){let o,a,r,l,n,i,s,u;-1.88170328*e-.80936493*t>1?(o=1.19086277,a=1.76576728,r=.59662641,l=.75515197,n=.56771245,i=4.0767416621,s=-3.3077115913,u=.2309699292):1.81444104*e-1.19445276*t>1?(o=.73956515,a=-.45954404,r=.08285427,l=.1254107,n=.14503204,i=-1.2684380046,s=2.6097574011,u=-.3413193965):(o=1.35733652,a=-.00915799,r=-1.1513021,l=-.50559606,n=.00692167,i=-.0041960863,s=-.7034186147,u=1.707614701);let d=o+a*e+r*t+l*e*e+n*e*t,p=.3963377774*e+.2158037573*t,C=-.1055613458*e-.0638541728*t,g=-.0894841775*e-1.291485548*t;{let f=1+d*p,c=1+d*C,m=1+d*g,I=f*f*f,h=c*c*c,S=m*m*m,x=3*p*f*f,H=3*C*c*c,O=3*g*m*m,N=6*p*p*f,y=6*C*C*c,V=6*g*g*m,U=i*I+s*h+u*S,G=i*x+s*H+u*O,W=i*N+s*y+u*V;d=d-U*G/(G*G-.5*U*W)}return d}function tl(e,t){let o=_d(e,t),a=k1({l:1,a:o*e,b:o*t}),r=Math.cbrt(1/Math.max(a.r,a.g,a.b)),l=r*o;return[r,l]}function Dd(e,t,o,a,r,l=null){l||(l=tl(e,t));let n;if((o-r)*l[1]-(l[0]-r)*a<=0)n=l[1]*r/(a*l[0]+l[1]*(r-o));else{n=l[1]*(r-1)/(a*(l[0]-1)+l[1]*(r-o));{let i=o-r,s=a,u=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,p=-.0894841775*e-1.291485548*t,C=i+s*u,g=i+s*d,f=i+s*p;{let c=r*(1-n)+n*o,m=n*a,I=c+m*u,h=c+m*d,S=c+m*p,x=I*I*I,H=h*h*h,O=S*S*S,N=3*C*I*I,y=3*g*h*h,V=3*f*S*S,U=6*C*C*I,G=6*g*g*h,W=6*f*f*S,$=4.0767416621*x-3.3077115913*H+.2309699292*O-1,_=4.0767416621*N-3.3077115913*y+.2309699292*V,q=4.0767416621*U-3.3077115913*G+.2309699292*W,w=_/(_*_-.5*$*q),L=-$*w,b=-1.2684380046*x+2.6097574011*H-.3413193965*O-1,v=-1.2684380046*N+2.6097574011*y-.3413193965*V,k=-1.2684380046*U+2.6097574011*G-.3413193965*W,A=v/(v*v-.5*b*k),E=-b*A,z=-.0041960863*x-.7034186147*H+1.707614701*O-1,B=-.0041960863*N-.7034186147*y+1.707614701*V,Z=-.0041960863*U-.7034186147*G+1.707614701*W,F=B/(B*B-.5*z*Z),R=-z*F;L=w>=0?L:1e6,E=A>=0?E:1e6,R=F>=0?R:1e6,n+=Math.min(L,Math.min(E,R))}}}return n}function Lo(e,t,o=null){o||(o=tl(e,t));let a=o[0],r=o[1];return[r/a,r/(1-a)]}function ma(e,t,o){let a=tl(t,o),r=Dd(t,o,e,1,e,a),l=Lo(t,o,a),n=.11516993+1/(7.4477897+4.1590124*o+t*(-2.19557347+1.75198401*o+t*(-2.13704948-10.02301043*o+t*(-4.24894561+5.38770819*o+4.69891013*t)))),i=.11239642+1/(1.6132032-.68124379*o+t*(.40370612+.90148123*o+t*(-.27087943+.6122399*o+t*(.00299215-.45399568*o-.14661872*t)))),s=r/Math.min(e*l[0],(1-e)*l[1]),u=e*n,d=(1-e)*i,p=.9*s*Math.sqrt(Math.sqrt(1/(1/(u*u*u*u)+1/(d*d*d*d))));return u=e*.4,d=(1-e)*.8,[Math.sqrt(1/(1/(u*u)+1/(d*d))),p,r]}function ha(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,a=e.b!==void 0?e.b:0,r={mode:"okhsl",l:xo(t)};e.alpha!==void 0&&(r.alpha=e.alpha);let l=Math.sqrt(o*o+a*a);if(!l)return r.s=0,r;let[n,i,s]=ma(t,o/l,a/l),u;if(l<i){let d=0,p=.8*n,C=1-p/i;u=(l-d)/(p+C*(l-d))*.8}else{let d=i,p=.2*i*i*1.25*1.25/n,C=1-p/(s-i);u=.8+.2*((l-d)/(p+C*(l-d)))}return u&&(r.s=u,r.h=we(Math.atan2(a,o)*180/Math.PI)),r}function ga(e){let t=e.h!==void 0?e.h:0,o=e.s!==void 0?e.s:0,a=e.l!==void 0?e.l:0,r={mode:"oklab",l:gt(a)};if(e.alpha!==void 0&&(r.alpha=e.alpha),!o||a===1)return r.a=r.b=0,r;let l=Math.cos(t/180*Math.PI),n=Math.sin(t/180*Math.PI),[i,s,u]=ma(r.l,l,n),d,p,C,g;o<.8?(d=1.25*o,p=0,C=.8*i,g=1-C/s):(d=5*(o-.8),p=s,C=.2*s*s*1.25*1.25/i,g=1-C/(u-s));let f=p+d*C/(1-g*d);return r.a=f*l,r.b=f*n,r}var Od={...ra,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:ha,rgb:e=>ha(tt(e))},toMode:{oklab:ga,rgb:e=>ot(ga(e))}},d0=Od;function va(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,a=e.b!==void 0?e.b:0,r=Math.sqrt(o*o+a*a),l=r?o/r:1,n=r?a/r:1,[i,s]=Lo(l,n),u=.5,d=1-u/i,p=s/(r+t*s),C=p*t,g=p*r,f=gt(C),c=g*f/C,m=k1({l:f,a:l*c,b:n*c}),I=Math.cbrt(1/Math.max(m.r,m.g,m.b,0));t=t/I,r=r/I*xo(t)/t,t=xo(t);let h={mode:"okhsv",s:r?(u+s)*g/(s*u+s*d*g):0,v:t?t/C:0};return h.s&&(h.h=we(Math.atan2(a,o)*180/Math.PI)),e.alpha!==void 0&&(h.alpha=e.alpha),h}function xa(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let o=e.h!==void 0?e.h:0,a=e.s!==void 0?e.s:0,r=e.v!==void 0?e.v:0,l=Math.cos(o/180*Math.PI),n=Math.sin(o/180*Math.PI),[i,s]=Lo(l,n),u=.5,d=1-u/i,p=1-a*u/(u+s-s*d*a),C=a*s*u/(u+s-s*d*a),g=gt(p),f=C*g/p,c=k1({l:g,a:l*f,b:n*f}),m=Math.cbrt(1/Math.max(c.r,c.g,c.b,0)),I=gt(r*p),h=C*I/p;return t.l=I*m,t.a=h*l*m,t.b=h*n*m,t}var Ed={...la,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:va,rgb:e=>va(tt(e))},toMode:{oklab:xa,rgb:e=>ot(xa(e))}},c0=Ed;function Bd(e,t){if(!t||t[0]!=="oklab")return;let o={mode:"oklab"},[,a,r,l,n]=t;if(!(a.type===T.Hue||r.type===T.Hue||l.type===T.Hue))return a.type!==T.None&&(o.l=Math.min(Math.max(0,a.type===T.Number?a.value:a.value/100),1)),r.type!==T.None&&(o.a=r.type===T.Number?r.value:r.value*.4/100),l.type!==T.None&&(o.b=l.type===T.Number?l.value:l.value*.4/100),n.type!==T.None&&(o.alpha=Math.min(1,Math.max(0,n.type===T.Number?n.value:n.value/100))),o}var f0=Bd;var Ad={...At,mode:"oklab",toMode:{lrgb:k1,rgb:ot},fromMode:{lrgb:Ca,rgb:tt},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[f0],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},p0=Ad;function Zd(e,t){if(!t||t[0]!=="oklch")return;let o={mode:"oklch"},[,a,r,l,n]=t;if(a.type!==T.None){if(a.type===T.Hue)return;o.l=Math.min(Math.max(0,a.type===T.Number?a.value:a.value/100),1)}if(r.type!==T.None&&(o.c=Math.max(0,r.type===T.Number?r.value:r.value*.4/100)),l.type!==T.None){if(l.type===T.Percentage)return;o.h=l.value}return n.type!==T.None&&(o.alpha=Math.min(1,Math.max(0,n.type===T.Number?n.value:n.value/100))),o}var C0=Zd;var Fd={...Zt,mode:"oklch",toMode:{oklab:e=>s1(e,"oklab"),rgb:e=>ot(s1(e,"oklab"))},fromMode:{rgb:e=>i1(tt(e),"oklch"),oklab:e=>i1(e,"oklch")},parse:[C0],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},m0=Fd;var $d=e=>{let{r:t,g:o,b:a,alpha:r}=p1(e),l={mode:"xyz65",x:.486570948648216*t+.265667693169093*o+.1982172852343625*a,y:.2289745640697487*t+.6917385218365062*o+.079286914093745*a,z:0*t+.0451133818589026*o+1.043944368900976*a};return r!==void 0&&(l.alpha=r),l},ol=$d;var Nd=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=C1({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*o,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*o,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*o},"p3");return a!==void 0&&(r.alpha=a),r},al=Nd;var Ud={...f1,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>al(e1(e)),xyz65:al},toMode:{rgb:e=>t1(ol(e)),xyz65:ol}},h0=Ud;var rl=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},qd=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"prophoto",r:rl(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*o),g:rl(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*o),b:rl(e*0+t*0+1.2119675456389452*o)};return a!==void 0&&(r.alpha=a),r},ll=qd;var nl=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},zd=e=>{let t=nl(e.r),o=nl(e.g),a=nl(e.b),r={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*o+.0313477341283922*a,y:.2880748288194013*t+.7118352342418731*o+899369387256e-16*a,z:0*t+0*o+.8251046025104602*a};return e.alpha!==void 0&&(r.alpha=e.alpha),r},il=zd;var jd={...f1,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:ll,rgb:e=>ll(R1(e))},toMode:{xyz50:il,rgb:e=>S1(il(e))}},g0=jd;var v0=1.09929682680944,Kd=.018053968510807,sl=e=>{let t=Math.abs(e);return t>Kd?(Math.sign(e)||1)*(v0*Math.pow(t,.45)-(v0-1)):4.5*e},Gd=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"rec2020",r:sl(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*o),g:sl(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*o),b:sl(e*.0176398574453108-t*.0427706132578085+.9421031212354739*o)};return a!==void 0&&(r.alpha=a),r},ul=Gd;var x0=1.09929682680944,Wd=.018053968510807,dl=(e=0)=>{let t=Math.abs(e);return t<Wd*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+x0-1)/x0,1/.45)},Xd=e=>{let t=dl(e.r),o=dl(e.g),a=dl(e.b),r={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*o+.1688809751641721*a,y:.262700212011267*t+.6779980715188708*o+.059301716469862*a,z:0*t+.0280726930490874*o+1.0609850577107909*a};return e.alpha!==void 0&&(r.alpha=e.alpha),r},cl=Xd;var Qd={...f1,mode:"rec2020",fromMode:{xyz65:ul,rgb:e=>ul(e1(e))},toMode:{xyz65:cl,rgb:e=>t1(cl(e))},parse:["rec2020"],serialize:"rec2020"},L0=Qd;var A1=.0037930732552754493,La=Math.cbrt(A1);var fl=e=>Math.cbrt(e)-La,Yd=e=>{let{r:t,g:o,b:a,alpha:r}=p1(e),l=fl(.3*t+.622*o+.078*a+A1),n=fl(.23*t+.692*o+.078*a+A1),i=fl(.2434226892454782*t+.2047674442449682*o+.5518098665095535*a+A1),s={mode:"xyb",x:(l-n)/2,y:(l+n)/2,b:i-(l+n)/2};return r!==void 0&&(s.alpha=r),s},w0=Yd;var pl=e=>Math.pow(e+La,3),Jd=({x:e,y:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=pl(e+t)-A1,l=pl(t-e)-A1,n=pl(o+t)-A1,i=C1({r:11.031566904639861*r-9.866943908131562*l-.16462299650829934*n,g:-3.2541473810744237*r+4.418770377582723*l-.16462299650829934*n,b:-3.6588512867136815*r+2.7129230459360922*l+1.9459282407775895*n});return a!==void 0&&(i.alpha=a),i},b0=Jd;var e7={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:b0},fromMode:{rgb:w0},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:D,y:D,b:D,alpha:{use:D,fixup:pe}}},I0=e7;var t7={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:S1,lab:Bt},fromMode:{rgb:R1,lab:Et},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:D,y:D,z:D,alpha:{use:D,fixup:pe}}},y0=t7;var o7=e=>{let{x:t,y:o,z:a,alpha:r}=e;t===void 0&&(t=0),o===void 0&&(o=0),a===void 0&&(a=0);let l={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*o-.0501922295431356*a,y:.0296278156881593*t+.990434484573249*o-.0170738250293851*a,z:-.0092430581525912*t+.0150551448965779*o+.7518742899580008*a};return r!==void 0&&(l.alpha=r),l},M0=o7;var a7=e=>{let{x:t,y:o,z:a,alpha:r}=e;t===void 0&&(t=0),o===void 0&&(o=0),a===void 0&&(a=0);let l={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*o+.0632593086610217*a,y:-.0283697069632081*t+1.0099954580058226*o+.021041398966943*a,z:.0123140016883199*t-.0205076964334779*o+1.3303659366080753*a};return r!==void 0&&(l.alpha=r),l},S0=a7;var r7={mode:"xyz65",toMode:{rgb:t1,xyz50:M0},fromMode:{rgb:e1,xyz50:S0},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:D,y:D,z:D,alpha:{use:D,fixup:pe}}},R0=r7;var l7=({r:e,g:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*o,i:.59597799*e-.2741761*t-.32180189*o,q:.21147017*e-.52261711*t+.31114694*o};return a!==void 0&&(r.alpha=a),r},k0=l7;var n7=({y:e,i:t,q:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"rgb",r:e+.95608445*t+.6208885*o,g:e-.27137664*t-.6486059*o,b:e-1.10561724*t+1.70250126*o};return a!==void 0&&(r.alpha=a),r},H0=n7;var i7={mode:"yiq",toMode:{rgb:H0},fromMode:{rgb:k0},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:D,i:D,q:D,alpha:{use:D,fixup:pe}}},P0=i7;var s7=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,u7=(e=4)=>t=>typeof t=="number"?s7(t,e):t,wo=u7;var Wx=wo(2);var Xx=n1("rgb"),Qx=n1("hsl");var Cl=e=>{let t=Go(e);if(!t)return;let o=Wo(t.mode);if(!o.serialize||typeof o.serialize=="string"){let a=`color(${o.serialize||`--${t.mode}`} `;return o.channels.forEach((r,l)=>{r!=="alpha"&&(a+=(l?" ":"")+(t[r]!==void 0?t[r]:"none"))}),t.alpha!==void 0&&t.alpha<1&&(a+=` / ${t.alpha}`),a+")"}if(typeof o.serialize=="function")return o.serialize(t)};var AL=ge(P2),ZL=ge(Z2),FL=ge(N2),$L=ge(U2),NL=ge(q2),UL=ge(ra),qL=ge(la),zL=ge(W2),jL=ge(Q2),KL=ge(J2),GL=ge(e0),WL=ge(At),XL=ge(o0),QL=ge(Zt),YL=ge(r0),JL=ge(i0),ew=ge(s0),tw=ge(u0),ow=ge(d0),aw=ge(c0),rw=ge(p0),lw=ge(m0),nw=ge(h0),iw=ge(g0),sw=ge(L0),uw=ge(f1),dw=ge(I0),cw=ge(y0),fw=ge(R0),pw=ge(P0);var ml=n1("rgb"),d7=n1("hsl"),c7=n1("oklch"),f7=n1("oklab"),p7=n1("lch"),C7=n1("lab"),m7=wo(3),T0=null;function h7(){return T0??(T0=document.createElement("canvas").getContext("2d")),T0}function V0(e){try{let t=h7();if(!t)return null;t.fillStyle="#000000",t.fillStyle=e;let o=t.fillStyle;t.fillStyle="#ffffff",t.fillStyle=e;let a=t.fillStyle;return o===a?o:null}catch{return null}}function _0(e){if(!e||typeof e!="string")return!1;let t=e.trim();return mt(t)!==void 0?!0:V0(t)!==null}function vt(e){let t={r:255,g:255,b:255,a:1};if(!e||typeof e!="string")return t;let o=e.trim(),a=mt(o);if(a){let l=ml(a);if(l&&"r"in l&&"g"in l&&"b"in l)return{r:Math.round(Math.min(255,Math.max(0,l.r*255))),g:Math.round(Math.min(255,Math.max(0,l.g*255))),b:Math.round(Math.min(255,Math.max(0,l.b*255))),a:l.alpha??1}}let r=V0(o);if(r){if(r.startsWith("#")){let n=r.slice(1);return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:1}}let l=r.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(l&&l[1]!=null&&l[2]!=null&&l[3]!=null)return{r:+l[1],g:+l[2],b:+l[3],a:l[4]!=null?+l[4]:1}}return t}function Ft(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),a=Math.round(Math.min(255,Math.max(0,e.b))),r=Math.round(Math.min(1,Math.max(0,e.a))*100)/100;return r>=1?`rgb(${t}, ${o}, ${a})`:`rgba(${t}, ${o}, ${a}, ${r})`}function wa(e){let t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]+$/.test(t)&&[3,4,6,8].includes(t.length)}function bo(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),a=Math.round(Math.min(255,Math.max(0,e.b))),r=Math.min(1,Math.max(0,e.a)),l=`#${[t,o,a].map(n=>n.toString(16).padStart(2,"0")).join("")}`;return r<1?l+Math.round(r*255).toString(16).padStart(2,"0"):l}function D0(e){return!e||typeof e!="string"?"rgb":mt(e.trim())?.mode??"rgb"}function o1(e,t){let o={mode:"rgb",r:e.r/255,g:e.g/255,b:e.b/255,alpha:e.a};switch(t){case"oklch":return c7(o);case"oklab":return f7(o);case"lch":return p7(o);case"lab":return C7(o);default:return o}}function hl(e){let t=e?ml(e):null;return!t||!("r"in t)||!("g"in t)||!("b"in t)?{r:255,g:255,b:255,a:1}:{r:Math.round(Math.min(255,Math.max(0,t.r*255))),g:Math.round(Math.min(255,Math.max(0,t.g*255))),b:Math.round(Math.min(255,Math.max(0,t.b*255))),a:t.alpha??1}}function gl(e){if(!e)return"";let t={...e},o=t;for(let a of Object.keys(o)){let r=o[a];typeof r=="number"&&(o[a]=m7(r))}return Cl(t)}function $t(e){let t={mode:"rgb",r:e.r/255,g:e.g/255,b:e.b/255},o=d7(t);return o?{h:o.h??0,s:o.s*100,l:o.l*100}:{h:0,s:0,l:0}}function vl(e){let t={mode:"hsl",h:e.h,s:e.s/100,l:e.l/100},o=ml(t);return!o||!("r"in o)||!("g"in o)||!("b"in o)?{r:0,g:0,b:0}:{r:Math.round(o.r*255),g:Math.round(o.g*255),b:Math.round(o.b*255)}}import{jsx as Fe,jsxs as H1}from"react/jsx-runtime";var xl=16,Nt=4,v7=245,O0=260,x7=200,L7="linear-gradient(45deg, #e0e0e0 25%, transparent 25%), linear-gradient(-45deg, #e0e0e0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e0e0e0 75%), linear-gradient(-45deg, transparent 75%, #e0e0e0 75%)",w7=["oklch","oklab","lch","lab","hsl"],E0=["oklch","oklab","lch","lab"],Ll=["rgb","hsl","oklch","oklab","lch","lab"];function wl(e){let t=D0(e);return w7.includes(t)?t:"rgb"}function Io(e,t){let o=$t({r:e.r,g:e.g,b:e.b}),a=o1(e,"oklch"),r=o1(e,"oklab"),l=o1(e,"lch"),n=o1(e,"lab");return{hex:M7(t,e),r:e.r,g:e.g,b:e.b,h:Math.round(o.h),s:Math.round(o.s),l:Math.round(o.l),a:Math.round(e.a*100),oklch_l:Math.round(a.l*100),oklch_c:Math.round(a.c*1e3)/10,oklch_h:Math.round(a.h||0),oklab_l:Math.round(r.l*100),oklab_a:Math.round(r.a*1e3)/10,oklab_b:Math.round(r.b*1e3)/10,lch_l:Math.round(l.l),lch_c:Math.round(l.c),lch_h:Math.round(l.h||0),lab_l:Math.round(n.l),lab_a:Math.round(n.a),lab_b:Math.round(n.b)}}function Il(e,t){let o=t.a/100;switch(e){case"oklch":return{mode:"oklch",l:t.oklch_l/100,c:t.oklch_c/100,h:t.oklch_h,alpha:o};case"oklab":return{mode:"oklab",l:t.oklab_l/100,a:t.oklab_a/100,b:t.oklab_b/100,alpha:o};case"lch":return{mode:"lch",l:t.lch_l,c:t.lch_c,h:t.lch_h,alpha:o};case"lab":return{mode:"lab",l:t.lab_l,a:t.lab_a,b:t.lab_b,alpha:o};case"hsl":return{mode:"hsl",h:t.h,s:t.s,l:t.l};default:return{mode:"rgb",r:t.r/255,g:t.g/255,b:t.b/255,alpha:o}}}function b7(e){let t=pt(e);return t?t.getBoundingClientRect():{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}}function I7(e,t=v7){let o=e.getBoundingClientRect(),a=b7(e),r=a.bottom-o.bottom-Nt,l=o.top-a.top-Nt,i=r<t&&l>=t?o.top-t-Nt:o.bottom+Nt;i=Math.max(a.top+Nt,Math.min(i,a.bottom-t-Nt));let s=o.left;return s+O0>a.right&&(s=a.right-O0-xl),s<a.left+xl&&(s=a.left+xl),{top:i,left:s}}function yl(e){return e!=null&&typeof e=="string"?e:"#ffffff"}function bl(e){let{r:t,g:o,b:a,a:r}=vt(yl(e));return{type:"rgba",r:t,g:o,b:a,a:r}}function y7(e,t){let o=e||Ft(t);return t.a>=1?{backgroundColor:o}:{backgroundColor:o,backgroundImage:`linear-gradient(0deg, ${o}, ${o}), ${L7}`,backgroundSize:"100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:"0 0, 0 0, 0 4px, 4px -4px, -4px 0"}}function M7(e,t){let o=typeof e=="string"?e.trim():"";return wa(o)?o:bo(t)}var S7=e=>e.preventDefault(),R7=e=>{e.key==="Enter"&&e.currentTarget.blur()};function k7(e,t){switch(t.type){case"SET_ALL":return{format:e.format,hex:t.hex,r:t.r,g:t.g,b:t.b,h:t.h,s:t.s,l:t.l,a:t.a,oklch_l:t.oklch_l,oklch_c:t.oklch_c,oklch_h:t.oklch_h,oklab_l:t.oklab_l,oklab_a:t.oklab_a,oklab_b:t.oklab_b,lch_l:t.lch_l,lch_c:t.lch_c,lch_h:t.lch_h,lab_l:t.lab_l,lab_a:t.lab_a,lab_b:t.lab_b};case"SET_RGBA":{let{r:o,g:a,b:r,a:l}=t,n=$t({r:o,g:a,b:r}),i={r:o,g:a,b:r,a:l/100},s=o1(i,"oklch"),u=o1(i,"oklab"),d=o1(i,"lch"),p=o1(i,"lab");return{...e,hex:bo(i),r:o,g:a,b:r,h:Math.round(n.h),s:Math.round(n.s),l:Math.round(n.l),a:l,oklch_l:Math.round(s.l*100),oklch_c:Math.round(s.c*1e3)/10,oklch_h:Math.round(s.h||0),oklab_l:Math.round(u.l*100),oklab_a:Math.round(u.a*1e3)/10,oklab_b:Math.round(u.b*1e3)/10,lch_l:Math.round(d.l),lch_c:Math.round(d.c),lch_h:Math.round(d.h||0),lab_l:Math.round(p.l),lab_a:Math.round(p.a),lab_b:Math.round(p.b)}}case"SET_HEX":return{...e,hex:t.hex};case"SET_CHANNEL":{let o={...e,[t.channel]:t.value},a;if(e.format==="rgb")a={r:o.r,g:o.g,b:o.b,a:o.a/100};else if(e.format==="hsl"){let u=vl({h:o.h,s:o.s,l:o.l});o.r=Math.round(u.r),o.g=Math.round(u.g),o.b=Math.round(u.b),a={r:o.r,g:o.g,b:o.b,a:o.a/100}}else{let u=Il(e.format,o);a=hl(u),o.r=a.r,o.g=a.g,o.b=a.b}let r=$t({r:o.r,g:o.g,b:o.b}),l=o1(a,"oklch"),n=o1(a,"oklab"),i=o1(a,"lch"),s=o1(a,"lab");return{...o,hex:bo(a),h:Math.round(r.h),s:Math.round(r.s),l:Math.round(r.l),oklch_l:Math.round(l.l*100),oklch_c:Math.round(l.c*1e3)/10,oklch_h:Math.round(l.h||0),oklab_l:Math.round(n.l*100),oklab_a:Math.round(n.a*1e3)/10,oklab_b:Math.round(n.b*1e3)/10,lch_l:Math.round(i.l),lch_c:Math.round(i.c),lch_h:Math.round(i.h||0),lab_l:Math.round(s.l),lab_a:Math.round(s.a),lab_b:Math.round(s.b)}}case"SET_FORMAT":return{...e,format:t.format};default:return e}}var H7={placeholder:"Enter color value",ariaValue:"{0} color value",ariaOpenPicker:"{0}, open color picker. Current color: {1}",ariaPicker:"{0} picker",ariaSaturation:"Saturation {0}%, brightness {1}%",ariaEyedropper:"Pick color from screen",ariaHue:"Hue, 0 to 360 degrees",ariaAlphaSlider:"Alpha transparency, 0 to 100 percent",ariaHex:"Hexadecimal color value",ariaChannel:"{0} ({1}), {2} to {3}",ariaAlphaInput:"Alpha, 0 to 100 percent",ariaFormatCycle:"Color format: {0}. Click to change format.",titleFormatCycle:"Click to cycle format: RGB, HSL, OKLCH, OKLAB, LCH, LAB",gradientValue:"Gradient",imageValue:"Image"};function P7(e){let t=(e??"").trim();return t===""||t.toLowerCase()==="none"?"":t}function ba({label:e,value:t,onChange:o,id:a="color",aria:r,backgroundImage:l}){let n=l1(H7,r),i=`${a}-trigger`,s=`${a}-popover`,u=yl(t),[{colorInput:d,colorState:p},C]=m2(()=>bl(u)),[g,f]=Pe.useReducer(k7,u,M=>{let P=vt(M),Q=Io(P,M);return{format:wl(M),...Q}}),c=Pe.useRef(g);c.current=g;let m=Pe.useRef(null),I=Pe.useRef(t),h=Pe.useRef(o);h.current=o;let S=Pe.useCallback(M=>{let P=c.current.format,Q;if(E0.includes(P)){let ne=o1(M,P);Q=gl(ne)}else if(P==="hsl"){let ne=$t({r:M.r,g:M.g,b:M.b}),Re=Math.round(M.a*100)/100;Q=Re>=1?`hsl(${Math.round(ne.h)}, ${Math.round(ne.s)}%, ${Math.round(ne.l)}%)`:`hsla(${Math.round(ne.h)}, ${Math.round(ne.s)}%, ${Math.round(ne.l)}%, ${Re})`}else Q=Ft(M);Q!==m.current&&(m.current=Q,I.current=Q,typeof h.current=="function"&&h.current(Q))},[]),x=h2(S,x7),H=v2({computePosition:I7,onClose:x.flush,trapFocus:!0});Pe.useEffect(()=>{let M=yl(t);if(M===I.current)return;I.current=M;let P=vt(M);C(bl(t));let Q=Io(P,M),ne=wl(M);f({type:"SET_ALL",...Q}),ne!==c.current.format&&f({type:"SET_FORMAT",format:ne})},[t,C]);let O=Pe.useCallback(M=>{x.cancel();let P=M.target.value;if((!P||!P.startsWith("#"))&&(P="#"+P.replace(/^#+/,"")),wa(P)){C({type:"hex",value:P});let Q=vt(P),ne=Io(Q,P);f({type:"SET_ALL",...ne})}else f({type:"SET_HEX",hex:P})},[x,C]),N=Pe.useCallback(()=>{x.cancel();let M=c.current.hex.trim();if(wa(M)){let P=vt(M),Q=Io(P,M);f({type:"SET_ALL",...Q}),S(P)}else{let P=c.current;f({type:"SET_HEX",hex:bo({r:P.r,g:P.g,b:P.b,a:P.a/100})})}},[x,S]),y=Pe.useMemo(()=>{switch(g.format){case"hsl":return[{key:"h",label:"H",min:0,max:360},{key:"s",label:"S",min:0,max:100},{key:"l",label:"L",min:0,max:100}];case"oklch":return[{key:"oklch_l",label:"L",min:0,max:100,step:1},{key:"oklch_c",label:"C",min:0,max:40,step:.1},{key:"oklch_h",label:"H",min:0,max:360,step:1}];case"oklab":return[{key:"oklab_l",label:"L",min:0,max:100,step:1},{key:"oklab_a",label:"A",min:-40,max:40,step:.1},{key:"oklab_b",label:"B",min:-40,max:40,step:.1}];case"lch":return[{key:"lch_l",label:"L",min:0,max:100,step:1},{key:"lch_c",label:"C",min:0,max:150,step:1},{key:"lch_h",label:"H",min:0,max:360,step:1}];case"lab":return[{key:"lab_l",label:"L",min:0,max:100,step:1},{key:"lab_a",label:"A",min:-128,max:127,step:1},{key:"lab_b",label:"B",min:-128,max:127,step:1}];default:return[{key:"r",label:"R",min:0,max:255},{key:"g",label:"G",min:0,max:255},{key:"b",label:"B",min:0,max:255}]}},[g.format]),V=Pe.useCallback((M,P)=>{x.cancel();let Q=String(P).trim(),ne=["oklch_c","oklab_a","oklab_b"].includes(M),Re=Q===""?0:ne?parseFloat(Q):parseInt(Q,10);if(Number.isNaN(Re))return;let be=c.current,de=y.find(ie=>ie.key===M),re=0,te=100;de?(re=de.min,te=de.max):M==="a"?(re=0,te=100):M==="h"?(re=0,te=360):be.format==="rgb"&&(re=0,te=255);let ve=Math.min(te,Math.max(re,Re));f({type:"SET_CHANNEL",channel:M,value:ve});let he={...be,[M]:ve},ke;if(be.format==="rgb")ke={r:he.r,g:he.g,b:he.b,a:he.a/100};else if(be.format==="hsl"){let ie=vl({h:he.h,s:he.s,l:he.l});ke={r:ie.r,g:ie.g,b:ie.b,a:he.a/100}}else{let ie=Il(be.format,he);ke=hl(ie)}C({type:"rgba",...ke}),S(ke)},[x,C,S,y]),U=Pe.useCallback(M=>{C(M);let P=M.getRgba();f({type:"SET_RGBA",r:Math.round(P.r),g:Math.round(P.g),b:Math.round(P.b),a:Math.round(P.a*100)}),x({r:P.r,g:P.g,b:P.b,a:P.a})},[C,x]),G=Pe.useCallback(M=>{let P=M.target.closest('[role="slider"]');P instanceof HTMLElement&&P.focus()},[]);Pe.useLayoutEffect(()=>{if(!H.isOpen||!H.popoverRef.current)return;let M=H.popoverRef.current.offsetHeight;M<=0||H.reposition(M)},[H.isOpen,H.reposition]);let W=p?.rgba??{r:255,g:255,b:255,a:1},$=p?.hsva??{h:0,s:0,v:100,a:1},_=Math.round($.s),q=Math.round($.v);Pe.useEffect(()=>{let M=H.popoverRef.current;if(!H.isOpen||!M)return;let P=ne=>M.querySelector(`.${ne} [role="slider"]`)??null,Q=P("colorEditor-picker-saturation");Q&&(Q.setAttribute("aria-label",e),Q.setAttribute("aria-valuetext",_e(n.ariaSaturation,[_,q])),Q.setAttribute("aria-valuenow",String(_)),Q.setAttribute("aria-valuemin","0"),Q.setAttribute("aria-valuemax","100")),P("colorEditor-picker-hue")?.setAttribute("aria-label",n.ariaHue),P("colorEditor-picker-alpha")?.setAttribute("aria-label",n.ariaAlphaSlider)});let L=Pe.useCallback(()=>{let M=g.format;if(E0.includes(M)){let P=Il(M,g);return gl(P)}else if(M==="hsl"){let P=$t({r:W.r,g:W.g,b:W.b}),Q=Math.round(W.a*100)/100;return Q>=1?`hsl(${Math.round(P.h)}, ${Math.round(P.s)}%, ${Math.round(P.l)}%)`:`hsla(${Math.round(P.h)}, ${Math.round(P.s)}%, ${Math.round(P.l)}%, ${Q})`}else return Ft(W)},[g,W])(),b=P7(l),v=b!==""&&W.a===0,k=/url\(/i.test(b)?n.imageValue:n.gradientValue,A=v?k:L,E=v?{backgroundImage:b,backgroundSize:"cover",backgroundPosition:"center"}:y7(L,W),[z,B]=Pe.useState(L),Z=Pe.useRef(z);Z.current=z,Pe.useEffect(()=>{B(L)},[L]);let F=Pe.useCallback(M=>{let P=M.target.value;B(P)},[]),R=Pe.useCallback(()=>{x.cancel();let M=Z.current.trim();if(!M||!_0(M)){B(L);return}let P=vt(M),Q=Ft(P),ne=Ft(W);if(Q!==ne){C(bl(M));let Re=Io(P,M),be=wl(M);f({type:"SET_ALL",...Re}),be!==c.current.format&&f({type:"SET_FORMAT",format:be}),M!==m.current&&(m.current=M,I.current=M,typeof h.current=="function"&&h.current(M))}else B(L)},[x,L,W,C]),X=Pe.useCallback(M=>{M.key==="Enter"&&M.currentTarget.blur()},[]),ue=Pe.useCallback(()=>{let M=Ll.indexOf(g.format),P=Ll[(M+1)%Ll.length]??g.format;f({type:"SET_FORMAT",format:P})},[g.format]),ce=Pe.useMemo(()=>{let M=H.triggerRef.current;if(!M)return document.body;let P=M.getRootNode();return P instanceof ShadowRoot?P:document.body},[H.isOpen,H.triggerRef]);return Fe(d1,{label:e,id:a,className:"colorEditor-fieldset",children:H1("div",{className:"colorEditor-wrapper",children:[Fe("button",{ref:H.triggerRef,id:i,type:"button",className:"colorEditor-swatch-only",onClick:H.toggle,"aria-expanded":H.isOpen,"aria-haspopup":"dialog","aria-controls":s,"aria-label":_e(n.ariaOpenPicker,[e,A]),children:Fe("span",{style:E,"aria-hidden":"true",className:"colorEditor-swatch"})}),Fe("input",{type:"text",className:"colorEditor-value-input",value:v?A:z,readOnly:v,onChange:F,onBlur:R,onKeyDown:X,"aria-label":_e(n.ariaValue,[e]),placeholder:n.placeholder,spellCheck:"false",autoComplete:"off"}),H.isOpen&&g7(H1("div",{ref:H.popoverRef,id:s,role:"dialog","aria-modal":"true","aria-label":_e(n.ariaPicker,[e]),style:{top:H.position.top,left:H.position.left},onDragStart:S7,onMouseUp:G,className:"colorEditor-popover",children:[H1(kt,{color:d,onChange:U,className:"colorEditor-picker",children:[Fe(kt.Saturation,{className:"colorEditor-picker-saturation"}),H1("div",{className:"colorEditor-picker-toolbar",children:[Fe(kt.EyeDropper,{title:n.ariaEyedropper,children:Fe(lo,{size:18,"aria-hidden":"true"})}),H1("div",{className:"colorEditor-picker-sliders",children:[Fe(kt.Hue,{className:"h-4 colorEditor-picker-hue"}),Fe(kt.Alpha,{className:"h-4 colorEditor-picker-alpha"})]})]})]}),H1("div",{className:"colorEditor-input-wrapper",children:[H1("div",{className:"colorEditor-input-group",children:[Fe("input",{type:"text",value:g.hex,onChange:O,onBlur:N,onKeyDown:R7,"aria-label":n.ariaHex,className:"colorEditor-input-hex",spellCheck:"false",autoComplete:"off"}),Fe("label",{className:"colorEditor-input-label","aria-hidden":"true",children:"HEX"})]}),H1("div",{className:"colorEditor-channels-wrapper",children:[H1("div",{className:"colorEditor-input-container",children:[y.map(M=>Fe("div",{className:"colorEditor-input-group-no-label",children:Fe("input",{type:"number",min:M.min,max:M.max,step:M.step||1,value:g[M.key],onChange:P=>V(M.key,P.target.value),onBlur:P=>V(M.key,P.target.value),"aria-label":_e(n.ariaChannel,[M.label,g.format.toUpperCase(),M.min,M.max]),"aria-valuemin":M.min,"aria-valuemax":M.max,"aria-valuenow":g[M.key],className:"colorEditor-input-rgba"})},M.key)),Fe("div",{className:"colorEditor-input-group-no-label",children:Fe("input",{type:"number",min:0,max:100,value:g.a,onChange:M=>V("a",M.target.value),onBlur:M=>V("a",M.target.value),"aria-label":n.ariaAlphaInput,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":g.a,className:"colorEditor-input-rgba"})})]}),Fe("div",{className:"colorEditor-format-selector",children:H1("button",{type:"button",className:"colorEditor-format-picker",onClick:ue,"aria-label":_e(n.ariaFormatCycle,[g.format.toUpperCase()]),"aria-live":"polite",title:n.titleFormatCycle,children:[y.map(M=>Fe("span",{className:"colorEditor-format-letter","aria-hidden":"true",children:M.label},M.key)),Fe("span",{className:"colorEditor-format-letter","aria-hidden":"true",children:"A"})]})})]})]})]}),ce)]})})}import Qe from"react";import{jsx as Ut,jsxs as V7}from"react/jsx-runtime";var T7={ariaValue:"{0} value",ariaUnit:"{0} unit"};function B0(e,t,o,a,r){let l=Je(e,o,a);if(l.numericValue!=="")return l.unit;if(t!=null&&t!==""){let n=Je(t,o,a);if(n.numericValue!==""&&r.has(n.unit))return n.unit}return o}function P1({label:e,value:t,onChange:o,units:a=Oo,constraints:r=v1,defaultUnit:l="px",placeholder:n=0,id:i="dimension",icon:s,aria:u}){let d=l1(T7,u),p=Qe.useMemo(()=>new Set(a.map(_=>_.value)),[a]),C=Qe.useMemo(()=>to(a),[a]),g=Qe.useMemo(()=>{if(n==null||n==="")return"";if(typeof n=="number")return String(n);let _=Je(String(n),l,C);return _.numericValue!==""?String(_.numericValue):String(n)},[n,l,C]),[f,c]=Qe.useState(()=>{let _=Je(t,l,C);return _.numericValue!==""?String(_.numericValue):""}),[m,I]=Qe.useState(()=>B0(t,n,l,C,p)),h=Qe.useRef(o);h.current=o;let S=Qe.useRef(t),x=Qe.useRef(n);Qe.useEffect(()=>{if(t===S.current&&n===x.current)return;S.current=t,x.current=n;let _=Je(t,l,C);c(_.numericValue!==""?String(_.numericValue):""),I(B0(t,n,l,C,p))},[t,n,l,C,p]);let H=Qe.useCallback((_,q)=>{let w=parseFloat(_);if(_===""||isNaN(w)){if(S.current==="")return;S.current="",typeof h.current=="function"&&h.current("");return}let L=x1(w,q,r),b=L1(L,q,r),v=Eo(b,q);v!==S.current&&(S.current=v,typeof h.current=="function"&&h.current(v))},[r]),O=Qe.useCallback(_=>{let q=_.target.value;c(q);let L=q.trim().match(C)?.[2];L&&p.has(L)&&L!==m&&I(L)},[C,m,p]),N=Qe.useCallback(_=>{let q=_.clipboardData.getData("text"),w=Je(q,l,C);if(w.numericValue!==""&&w.unit&&p.has(w.unit)){_.preventDefault(),c(String(w.numericValue)),I(w.unit);let L=x1(w.numericValue,w.unit,r),b=L1(L,w.unit,r),v=Eo(b,w.unit);S.current=v,typeof h.current=="function"&&h.current(v)}},[l,C,p,r]),y=Qe.useCallback(()=>{if(f===""){H("",m);return}let _=parseFloat(f);if(isNaN(_)){let L=Je(t,l,C);c(L.numericValue!==""?String(L.numericValue):"");return}let q=x1(_,m,r),w=L1(q,m,r);c(String(w)),H(String(w),m)},[f,m,t,l,C,r,H]),V=Qe.useCallback(_=>{if(_.key==="Enter"){_.currentTarget.blur();return}if(_.key==="ArrowUp"||_.key==="ArrowDown"){_.preventDefault();let q=Bo(f,_.key,_.shiftKey,m,r);if(q===null)return;c(q),H(q,m)}},[f,m,r,H]),U=Qe.useCallback(_=>{let q=_.target.value;if(!p.has(q))return;if(I(q),f===""){H("",q);return}let w=parseFloat(f);if(isNaN(w))return;let L=x1(w,q,r),b=L1(L,q,r);c(String(b));let v=Eo(b,q);S.current=v,typeof h.current=="function"&&h.current(v)},[f,p,r,H]),G=`${i}-input`,W=`${i}-unit`,$=a.some(_=>_.value!=="");return Ut(d1,{label:e,id:i,className:"dimensionEditor-fieldset",children:V7("div",{className:"dimensionEditor-row",children:[s&&Ut("span",{className:"dimensionEditor-icon","aria-hidden":"true",children:Ut(s,{size:14,width:14,height:14})}),Ut("input",{id:G,type:"text",className:s?"dimensionEditor-input dimensionEditor-input--with-icon":"dimensionEditor-input",value:f,placeholder:g,onChange:O,onPaste:N,onBlur:y,onKeyDown:V,"aria-label":_e(d.ariaValue,[e]),autoComplete:"off",spellCheck:"false"}),$&&Ut("select",{id:W,className:"dimensionEditor-unit",value:m,onChange:U,"aria-label":_e(d.ariaUnit,[e]),children:a.map(_=>Ut("option",{value:_.value,children:_.label},_.value||"__unitless__"))})]})})}function a1(e,t){if(e==null)return{};var o={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;o[a]=e[a]}return o}function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)({}).hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},le.apply(null,arguments)}var Y=Vn(z0(),1),A7=Vn(W0(),1);import*as me from"react";import{cloneElement as rb,Component as lb,useRef as h1,useCallback as Ce,useEffect as T1,useMemo as qt}from"react";var X0=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Q0=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",_a=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let o=getComputedStyle(e,null);return Q0(o.overflowY,t)||Q0(o.overflowX,t)||(a=>{let r=(l=>{if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch{return null}})(a);return!!r&&(r.clientHeight<a.scrollHeight||r.clientWidth<a.scrollWidth)})(e)}return!1},Da=(e,t,o,a,r,l,n,i)=>l<e&&n>t||l>e&&n<t?0:l<=e&&i<=o||n>=t&&i>=o?l-e-a:n>t&&i<o||l<e&&i>o?n-t+r:0,B7=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)},Y0=(e,t)=>{var o,a,r,l;if(typeof document>"u")return[];let{scrollMode:n,block:i,inline:s,boundary:u,skipOverflowHiddenElements:d}=t,p=typeof u=="function"?u:w=>w!==u;if(!X0(e))throw new TypeError("Invalid target");let C=document.scrollingElement||document.documentElement,g=[],f=e;for(;X0(f)&&p(f);){if(f=B7(f),f===C){g.push(f);break}f!=null&&f===document.body&&_a(f)&&!_a(document.documentElement)||f!=null&&_a(f,d)&&g.push(f)}let c=(a=(o=window.visualViewport)==null?void 0:o.width)!=null?a:innerWidth,m=(l=(r=window.visualViewport)==null?void 0:r.height)!=null?l:innerHeight,{scrollX:I,scrollY:h}=window,{height:S,width:x,top:H,right:O,bottom:N,left:y}=e.getBoundingClientRect(),{top:V,right:U,bottom:G,left:W}=(w=>{let L=window.getComputedStyle(w);return{top:parseFloat(L.scrollMarginTop)||0,right:parseFloat(L.scrollMarginRight)||0,bottom:parseFloat(L.scrollMarginBottom)||0,left:parseFloat(L.scrollMarginLeft)||0}})(e),$=i==="start"||i==="nearest"?H-V:i==="end"?N+G:H+S/2-V+G,_=s==="center"?y+x/2-W+U:s==="end"?O+U:y-W,q=[];for(let w=0;w<g.length;w++){let L=g[w],{height:b,width:v,top:k,right:A,bottom:E,left:z}=L.getBoundingClientRect();if(n==="if-needed"&&H>=0&&y>=0&&N<=m&&O<=c&&(L===C&&!_a(L)||H>=k&&N<=E&&y>=z&&O<=A))return q;let B=getComputedStyle(L),Z=parseInt(B.borderLeftWidth,10),F=parseInt(B.borderTopWidth,10),R=parseInt(B.borderRightWidth,10),X=parseInt(B.borderBottomWidth,10),ue=0,ce=0,M="offsetWidth"in L?L.offsetWidth-L.clientWidth-Z-R:0,P="offsetHeight"in L?L.offsetHeight-L.clientHeight-F-X:0,Q="offsetWidth"in L?L.offsetWidth===0?0:v/L.offsetWidth:0,ne="offsetHeight"in L?L.offsetHeight===0?0:b/L.offsetHeight:0;if(C===L)ue=i==="start"?$:i==="end"?$-m:i==="nearest"?Da(h,h+m,m,F,X,h+$,h+$+S,S):$-m/2,ce=s==="start"?_:s==="center"?_-c/2:s==="end"?_-c:Da(I,I+c,c,Z,R,I+_,I+_+x,x),ue=Math.max(0,ue+h),ce=Math.max(0,ce+I);else{ue=i==="start"?$-k-F:i==="end"?$-E+X+P:i==="nearest"?Da(k,E,b,F,X+P,$,$+S,S):$-(k+b/2)+P/2,ce=s==="start"?_-z-Z:s==="center"?_-(z+v/2)+M/2:s==="end"?_-A+R+M:Da(z,A,v,Z,R+M,_,_+x,x);let{scrollLeft:Re,scrollTop:be}=L;ue=ne===0?0:Math.max(0,Math.min(be+ue/ne,L.scrollHeight-b/ne+P)),ce=Q===0?0:Math.max(0,Math.min(Re+ce/Q,L.scrollWidth-v/Q+M)),$+=be-ue,_+=Re-ce}q.push({el:L,top:ue,left:ce})}return q};var Z7=0;function l5(){return String(Z7++)}function So(e){var t=me.useRef(e);return t.current=e,t}function F7(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){t.forEach(function(r){typeof r=="function"?r(a):r&&(r.current=a)})}}function Rl(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){for(var r=arguments.length,l=new Array(r>1?r-1:0),n=1;n<r;n++)l[n-1]=arguments[n];return t.some(function(i){return i&&i.apply(void 0,[a].concat(l)),a.preventDownshiftDefault||a.hasOwnProperty("nativeEvent")&&a.nativeEvent.preventDownshiftDefault})}}function n5(e,t){var o;function a(){o&&clearTimeout(o)}function r(){for(var l=arguments.length,n=new Array(l),i=0;i<l;i++)n[i]=arguments[i];a(),o=setTimeout(function(){o=null,e.apply(void 0,n)},t)}return r.cancel=a,r}var $7=n5(function(e){i5(e).textContent=""},500);function i5(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function N7(e,t){if(!(!e||!t)){var o=i5(t);o.textContent=e,$7(t)}}function U7(e){var t=e?.getElementById("a11y-status-message");t&&t.remove()}function Ro(){}var Hl=Ro;function Ea(e,t){if(!t)return e;var o=Object.keys(e);return o.reduce(function(a,r){return t[r]!==void 0&&(a[r]=t[r]),a},le({},e))}function q7(e,t){if(e){var o=Y0(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});o.forEach(function(a){var r=a.el,l=a.top,n=a.left;r.scrollTop=l,r.scrollLeft=n})}}function J0(e,t,o){var a=e===t||t instanceof o.Node&&e.contains&&e.contains(t);return a}function z7(e,t){var o;function a(){o&&clearTimeout(o)}function r(){for(var l=arguments.length,n=new Array(l),i=0;i<l;i++)n[i]=arguments[i];a(),o=setTimeout(function(){o=null,e.apply(void 0,n)},t)}return r.cancel=a,r}function Ve(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){for(var r=arguments.length,l=new Array(r>1?r-1:0),n=1;n<r;n++)l[n-1]=arguments[n];return t.some(function(i){return i&&i.apply(void 0,[a].concat(l)),a.preventDownshiftDefault||a.hasOwnProperty("nativeEvent")&&a.nativeEvent.preventDownshiftDefault})}}function Z1(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){t.forEach(function(r){typeof r=="function"?r(a):r&&(r.current=a)})}}function j7(e,t){return e[t]!==void 0}function Ba(e){var t=e.key,o=e.keyCode;return o>=37&&o<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function at(e,t,o,a,r){r===void 0&&(r=!1);var l=o.length;if(l===0)return-1;var n=l-1;(typeof e!="number"||e<0||e>n)&&(e=t>0?-1:n+1);var i=e+t;i<0?i=r?n:0:i>n&&(i=r?0:n);var s=zt(i,t<0,o,a,r);return s===-1?e>=l?-1:e:s}function zt(e,t,o,a,r){r===void 0&&(r=!1);var l=o.length;if(t){for(var n=e;n>=0;n--)if(!a(o[n],n))return n}else for(var i=e;i<l;i++)if(!a(o[i],i))return i;return r?zt(t?l-1:0,t,o,a):-1}function e5(e,t,o,a){return a===void 0&&(a=!0),o&&t.some(function(r){return r&&(J0(r,e,o)||a&&J0(r,o.document.activeElement,o))})}function Pl(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function K7(e,t,o,a){for(var r=e.type,l={},n=Object.keys(o),i=0,s=n;i<s.length;i++){var u=s[i];G7(u,e,t,o,a),a[u]!==o[u]&&(l[u]=a[u])}t.onStateChange&&Object.keys(l).length&&t.onStateChange(le({type:r},l))}function G7(e,t,o,a,r){if(r[e]!==a[e]){var l="on"+Pl(e)+"Change",n=o[l];if(typeof n=="function"){var i=t.type;n(le({type:i},r))}}}function s5(e,t,o,a){var r=me.useRef(null),l=me.useRef(void 0),n=So(t),i=me.useCallback(function(C,g){l.current=g,C=Ea(C,n.current);var f=e(C,n.current,g),c=n.current.stateReducer(C,le({},g,{changes:f}));return le({},C,c)},[n,e]),s=me.useReducer(i,t,o),u=s[0],d=s[1],p=l.current;return me.useEffect(function(){var C,g=Ea((C=r.current)!=null?C:{},n.current),f=p&&r.current&&!a(g,u);f&&K7(p,n.current,g,u),r.current=u},[u,p,a,n]),[u,d]}function Tl(e,t,o,a){var r=s5(e,t,o,a),l=r[0],n=r[1];return[Ea(l,t),n]}function Vl(e,t,o,a){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){var r=o.indexOf(e);if(r<0)throw new Error(a);return[e,o.indexOf(e)]}if(t!==void 0){var l=o[t];if(l===void 0)throw new Error(a);return[l,t]}throw new Error(a)}function Ua(){var e=me.useRef(!0);return me.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function W7(e,t){return t.changes}var X7={environment:Y.default.shape({addEventListener:Y.default.func.isRequired,removeEventListener:Y.default.func.isRequired,document:Y.default.shape({createElement:Y.default.func.isRequired,getElementById:Y.default.func.isRequired,activeElement:Y.default.any.isRequired,body:Y.default.any.isRequired}).isRequired,Node:Y.default.func.isRequired}),itemToKey:Y.default.func,stateReducer:Y.default.func};function V1(e,t,o){var a=e["default"+Pl(t)];return a!==void 0?a:o[t]}function xt(e,t,o){var a=e[t];if(a!==void 0)return a;var r=e["initial"+Pl(t)];return r!==void 0?r:V1(e,t,o)}var t5=n5(function(e,t){N7(e,t)},200);function _l(e,t,o,a){var r=a?.document,l=Ua();me.useEffect(function(){if(!(!e||l||!r)){var n=e(t);t5(n,r)}},o),me.useEffect(function(){return function(){t5.cancel(),U7(r)}},[r])}var yo=le({},X7,{getA11yStatusMessage:Y.default.func,highlightedIndex:Y.default.number,defaultHighlightedIndex:Y.default.number,initialHighlightedIndex:Y.default.number,isOpen:Y.default.bool,defaultIsOpen:Y.default.bool,initialIsOpen:Y.default.bool,selectedItem:Y.default.any,initialSelectedItem:Y.default.any,defaultSelectedItem:Y.default.any,id:Y.default.string,labelId:Y.default.string,menuId:Y.default.string,getItemId:Y.default.func,toggleButtonId:Y.default.string,onSelectedItemChange:Y.default.func,onHighlightedIndexChange:Y.default.func,onStateChange:Y.default.func,onIsOpenChange:Y.default.func,scrollIntoView:Y.default.func}),Mo={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:W7,scrollIntoView:q7,environment:typeof window>"u"?void 0:window},r1={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},Q7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?me.useLayoutEffect:me.useEffect;function Y7(e){return/^\S{1}$/.test(e)}function u5(e){var t=xt(e,"selectedItem",r1),o=xt(e,"isOpen",r1),a=J7(e),r=xt(e,"inputValue",r1);return{highlightedIndex:a<0&&t&&o?e.items.findIndex(function(l){return e.itemToKey(l)===e.itemToKey(t)}):a,isOpen:o,selectedItem:t,inputValue:r}}function Lt(e,t,o){var a=e.items,r=e.initialHighlightedIndex,l=e.defaultHighlightedIndex,n=e.isItemDisabled,i=e.itemToKey,s=t.selectedItem,u=t.highlightedIndex;return a.length===0?-1:r!==void 0&&u===r&&!n(a[r],r)?r:l!==void 0&&!n(a[l],l)?l:s?a.findIndex(function(d){return i(s)===i(d)}):o<0&&!n(a[a.length-1],a.length-1)?a.length-1:o>0&&!n(a[0],0)?0:-1}function d5(e,t,o){var a=me.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),r=me.useCallback(function(){return o.map(function(l){return l.current})},[o]);return me.useEffect(function(){if(!e)return Ro;function l(){a.current.isTouchEnd=!1,a.current.isMouseDown=!0}function n(d){a.current.isMouseDown=!1,e5(d.target,r(),e)||t()}function i(){a.current.isTouchEnd=!1,a.current.isTouchMove=!1}function s(){a.current.isTouchMove=!0}function u(d){a.current.isTouchEnd=!0,!a.current.isTouchMove&&!e5(d.target,r(),e,!1)&&t()}return e.addEventListener("mousedown",l),e.addEventListener("mouseup",n),e.addEventListener("touchstart",i),e.addEventListener("touchmove",s),e.addEventListener("touchend",u),function(){e.removeEventListener("mousedown",l),e.removeEventListener("mouseup",n),e.removeEventListener("touchstart",i),e.removeEventListener("touchmove",s),e.removeEventListener("touchend",u)}},[e,r,t]),a.current}var Dl=function(){return Ro};function c5(e){var t=e.highlightedIndex,o=e.isOpen,a=e.itemRefs,r=e.getItemNodeFromIndex,l=e.menuElement,n=e.scrollIntoView,i=me.useRef(!0);return Q7(function(){t<0||!o||!Object.keys(a.current).length||(i.current===!1?i.current=!0:n(r(t),l))},[t]),i}var Ol=Ro;function Aa(e,t,o){var a;o===void 0&&(o=!0);var r=((a=e.items)==null?void 0:a.length)&&t>=0;return le({isOpen:!1,highlightedIndex:-1},r&&le({selectedItem:e.items[t],isOpen:V1(e,"isOpen",r1),highlightedIndex:V1(e,"highlightedIndex",r1)},o&&{inputValue:e.itemToString(e.items[t])}))}function f5(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Za(e){var t=V1(e,"highlightedIndex",r1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function J7(e){var t=xt(e,"highlightedIndex",r1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function p5(e,t,o,a){var r=o.type,l;switch(r){case a.ItemMouseMove:l={highlightedIndex:o.disabled?-1:o.index};break;case a.MenuMouseLeave:l={highlightedIndex:-1};break;case a.ToggleButtonClick:case a.FunctionToggleMenu:l={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Lt(t,e,0)};break;case a.FunctionOpenMenu:l={isOpen:!0,highlightedIndex:Lt(t,e,0)};break;case a.FunctionCloseMenu:l={isOpen:!1};break;case a.FunctionSetHighlightedIndex:l={highlightedIndex:t.isItemDisabled(t.items[o.highlightedIndex],o.highlightedIndex)?-1:o.highlightedIndex};break;case a.FunctionSetInputValue:l={inputValue:o.inputValue};break;case a.FunctionReset:l={highlightedIndex:Za(t),isOpen:V1(t,"isOpen",r1),selectedItem:V1(t,"selectedItem",r1),inputValue:V1(t,"inputValue",r1)};break;default:throw new Error("Reducer called without proper action type.")}return le({},e,l)}var e4=le({},yo,{items:Y.default.array.isRequired,isItemDisabled:Y.default.func}),t4=le({},Mo,{isItemDisabled:function(){return!1}});function o4(e){for(var t=e.keysSoFar,o=e.highlightedIndex,a=e.items,r=e.itemToString,l=e.isItemDisabled,n=t.toLowerCase(),i=0;i<a.length;i++){var s=(i+o+(t.length<2?1:0))%a.length,u=a[s];if(u!==void 0&&r(u).toLowerCase().startsWith(n)&&!l(u,s))return s}return o}var Oa=0,El=1,Bl=2,Fa=3,Al=4,Zl=5,Fl=6,$l=7,Nl=8,Ul=9,ql=10,$a=11,C5=12,m5=13,zl=14,h5=15,g5=16,v5=17,x5=18,jl=19,kl=20,L5=21,w5=Object.freeze({__proto__:null,FunctionCloseMenu:v5,FunctionOpenMenu:g5,FunctionReset:L5,FunctionSelectItem:jl,FunctionSetHighlightedIndex:x5,FunctionSetInputValue:kl,FunctionToggleMenu:h5,ItemClick:zl,ItemMouseMove:m5,MenuMouseLeave:C5,ToggleButtonBlur:$a,ToggleButtonClick:Oa,ToggleButtonKeyDownArrowDown:El,ToggleButtonKeyDownArrowUp:Bl,ToggleButtonKeyDownCharacter:Fa,ToggleButtonKeyDownEnd:Fl,ToggleButtonKeyDownEnter:$l,ToggleButtonKeyDownEscape:Al,ToggleButtonKeyDownHome:Zl,ToggleButtonKeyDownPageDown:ql,ToggleButtonKeyDownPageUp:Ul,ToggleButtonKeyDownSpaceButton:Nl});function a4(e,t,o){var a,r=o.type,l=o.altKey,n;switch(r){case zl:n={isOpen:V1(t,"isOpen",r1),highlightedIndex:Za(t),selectedItem:t.items[o.index]};break;case Fa:{var i=o.key,s=""+e.inputValue+i,u=!e.isOpen&&e.selectedItem?t.items.findIndex(function(g){return t.itemToKey(g)===t.itemToKey(e.selectedItem)}):e.highlightedIndex,d=o4({keysSoFar:s,highlightedIndex:u,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled});n={inputValue:s,highlightedIndex:d,isOpen:!0}}break;case El:{var p=e.isOpen?at(e.highlightedIndex,1,t.items,t.isItemDisabled):l&&e.selectedItem==null?-1:Lt(t,e,1);n={highlightedIndex:p,isOpen:!0}}break;case Bl:if(e.isOpen&&l)n=Aa(t,e.highlightedIndex,!1);else{var C=e.isOpen?at(e.highlightedIndex,-1,t.items,t.isItemDisabled):Lt(t,e,-1);n={highlightedIndex:C,isOpen:!0}}break;case $l:case Nl:n=Aa(t,e.highlightedIndex,!1);break;case Zl:n={highlightedIndex:zt(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case Fl:n={highlightedIndex:zt(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case Ul:n={highlightedIndex:at(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case ql:n={highlightedIndex:at(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case Al:n={isOpen:!1,highlightedIndex:-1};break;case $a:n=le({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((a=t.items)==null?void 0:a.length)&&{selectedItem:t.items[e.highlightedIndex]});break;case jl:n={selectedItem:o.selectedItem};break;default:return p5(e,t,o,w5)}return le({},e,n)}var r4=le({},me),b5=r4.useId,I5=typeof b5=="function"?l4:n4;function l4(e){var t=e.id,o=e.labelId,a=e.menuId,r=e.getItemId,l=e.toggleButtonId,n=e.inputId,i="downshift-"+b5();t||(t=i);var s=me.useMemo(function(){return{labelId:o??t+"-label",menuId:a??t+"-menu",getItemId:r??function(u){return t+"-item-"+u},toggleButtonId:l??t+"-toggle-button",inputId:n??t+"-input"}},[r,t,n,o,a,l]);return s}function n4(e){var t=e.id,o=e.labelId,a=e.menuId,r=e.getItemId,l=e.toggleButtonId,n=e.inputId,i=me.useRef(t??"downshift-"+l5()),s=i.current,u=me.useMemo(function(){return{labelId:o??s+"-label",menuId:a??s+"-menu",getItemId:r??function(d){return s+"-item-"+d},toggleButtonId:l??s+"-toggle-button",inputId:n??s+"-input"}},[r,n,o,a,l,s]);return u}var i4=["onClick"],s4=["onMouseLeave","refKey","ref"],u4=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],d4=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];qa.stateChangeTypes=w5;function qa(e){e===void 0&&(e={}),Hl(e,qa,e4);var t=le({},t4,e),o=t.scrollIntoView,a=t.environment,r=t.getA11yStatusMessage,l=Tl(a4,t,u5,f5),n=l[0],i=l[1],s=n.isOpen,u=n.highlightedIndex,d=n.selectedItem,p=n.inputValue,C=h1(null),g=h1(null),f=h1({}),c=h1(null),m=I5(t),I=So({state:n,props:t}),h=Ce(function(k){return f.current[m.getItemId(k)]},[m]);_l(r,n,[s,u,d,p],a);var S=c5({menuElement:g.current,highlightedIndex:u,isOpen:s,itemRefs:f,scrollIntoView:o,getItemNodeFromIndex:h});T1(function(){return c.current=z7(function(k){k({type:kl,inputValue:""})},500),function(){c.current.cancel()}},[]),T1(function(){p&&c.current(i)},[i,p]),Ol({props:t,state:n}),T1(function(){var k=xt(t,"isOpen",r1);k&&C.current&&C.current.focus()},[]);var x=Ce(function(){I.current.state.isOpen&&i({type:$a})},[i,I]),H=qt(function(){return[g,C]},[]),O=d5(a,x,H),N=Dl("getMenuProps","getToggleButtonProps");T1(function(){s||(f.current={})},[s]);var y=qt(function(){return{ArrowDown:function(A){A.preventDefault(),i({type:El,altKey:A.altKey})},ArrowUp:function(A){A.preventDefault(),i({type:Bl,altKey:A.altKey})},Home:function(A){A.preventDefault(),i({type:Zl})},End:function(A){A.preventDefault(),i({type:Fl})},Escape:function(){I.current.state.isOpen&&i({type:Al})},Enter:function(A){A.preventDefault(),i({type:I.current.state.isOpen?$l:Oa})},PageUp:function(A){I.current.state.isOpen&&(A.preventDefault(),i({type:Ul}))},PageDown:function(A){I.current.state.isOpen&&(A.preventDefault(),i({type:ql}))}," ":function(A){A.preventDefault();var E=I.current.state;if(!E.isOpen){i({type:Oa});return}E.inputValue?i({type:Fa,key:" "}):i({type:Nl})}}},[i,I]),V=Ce(function(){i({type:h5})},[i]),U=Ce(function(){i({type:v5})},[i]),G=Ce(function(){i({type:g5})},[i]),W=Ce(function(k){i({type:x5,highlightedIndex:k})},[i]),$=Ce(function(k){i({type:jl,selectedItem:k})},[i]),_=Ce(function(){i({type:L5})},[i]),q=Ce(function(k){i({type:kl,inputValue:k})},[i]),w=Ce(function(k){var A=k===void 0?{}:k,E=A.onClick,z=a1(A,i4),B=function(){var F;(F=C.current)==null||F.focus()};return le({id:m.labelId,htmlFor:m.toggleButtonId,onClick:Ve(E,B)},z)},[m]),L=Ce(function(k,A){var E,z=k===void 0?{}:k,B=z.onMouseLeave,Z=z.refKey,F=Z===void 0?"ref":Z,R=z.ref,X=a1(z,s4),ue=A===void 0?{}:A,ce=ue.suppressRefError,M=ce===void 0?!1:ce,P=function(){i({type:C5})};return N("getMenuProps",M,F,g),le((E={},E[F]=Z1(R,function(Q){g.current=Q}),E.id=m.menuId,E.role="listbox",E["aria-labelledby"]=X&&X["aria-label"]?void 0:""+m.labelId,E.onMouseLeave=Ve(B,P),E),X)},[i,N,m]),b=Ce(function(k,A){var E,z=k===void 0?{}:k,B=z.onBlur,Z=z.onClick;z.onPress;var F=z.onKeyDown,R=z.refKey,X=R===void 0?"ref":R,ue=z.ref,ce=a1(z,u4),M=A===void 0?{}:A,P=M.suppressRefError,Q=P===void 0?!1:P,ne=I.current.state,Re=function(){i({type:Oa})},be=function(){ne.isOpen&&!O.isMouseDown&&i({type:$a})},de=function(ve){var he=Ba(ve);he&&y[he]?y[he](ve):Y7(he)&&i({type:Fa,key:he})},re=le((E={},E[X]=Z1(ue,function(te){C.current=te}),E["aria-activedescendant"]=ne.isOpen&&ne.highlightedIndex>-1?m.getItemId(ne.highlightedIndex):"",E["aria-controls"]=m.menuId,E["aria-expanded"]=I.current.state.isOpen,E["aria-haspopup"]="listbox",E["aria-labelledby"]=ce&&ce["aria-label"]?void 0:""+m.labelId,E.id=m.toggleButtonId,E.role="combobox",E.tabIndex=0,E.onBlur=Ve(B,be),E),ce);return ce.disabled||(re.onClick=Ve(Z,Re),re.onKeyDown=Ve(F,de)),N("getToggleButtonProps",Q,X,C),re},[i,m,I,O,N,y]),v=Ce(function(k){var A,E=k===void 0?{}:k,z=E.item,B=E.index,Z=E.onMouseMove,F=E.onClick,R=E.onMouseDown;E.onPress;var X=E.refKey,ue=X===void 0?"ref":X,ce=E.disabled,M=E.ref,P=a1(E,d4);ce!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var Q=I.current,ne=Q.state,Re=Q.props,be=Vl(z,B,Re.items,"Pass either item or index to getItemProps!"),de=be[0],re=be[1],te=Re.isItemDisabled(de,re),ve=function(){O.isTouchEnd||re===ne.highlightedIndex||(S.current=!1,i({type:m5,index:re,disabled:te}))},he=function(){i({type:zl,index:re})},ke=function(Ue){return Ue.preventDefault()},ie=le((A={},A[ue]=Z1(M,function(Ie){Ie&&(f.current[m.getItemId(re)]=Ie)}),A["aria-disabled"]=te,A["aria-selected"]=de===ne.selectedItem,A.id=m.getItemId(re),A.role="option",A),P);return te||(ie.onClick=Ve(F,he)),ie.onMouseMove=Ve(Z,ve),ie.onMouseDown=Ve(R,ke),ie},[I,m,O,S,i]);return{getToggleButtonProps:b,getLabelProps:w,getMenuProps:L,getItemProps:v,toggleMenu:V,openMenu:G,closeMenu:U,setHighlightedIndex:W,selectItem:$,reset:_,setInputValue:q,highlightedIndex:u,isOpen:s,selectedItem:d,inputValue:p}}var Kl=0,Gl=1,Wl=2,Xl=3,Ql=4,Yl=5,Jl=6,en=7,tn=8,Na=9,on=10,y5=11,M5=12,an=13,S5=14,R5=15,k5=16,H5=17,P5=18,rn=19,T5=20,V5=21,ln=22,_5=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:ln,FunctionCloseMenu:H5,FunctionOpenMenu:k5,FunctionReset:V5,FunctionSelectItem:rn,FunctionSetHighlightedIndex:P5,FunctionSetInputValue:T5,FunctionToggleMenu:R5,InputBlur:Na,InputChange:tn,InputClick:on,InputKeyDownArrowDown:Kl,InputKeyDownArrowUp:Gl,InputKeyDownEnd:Ql,InputKeyDownEnter:en,InputKeyDownEscape:Wl,InputKeyDownHome:Xl,InputKeyDownPageDown:Jl,InputKeyDownPageUp:Yl,ItemClick:an,ItemMouseMove:M5,MenuMouseLeave:y5,ToggleButtonClick:S5});function c4(e){var t=u5(e),o=t.selectedItem,a=t.inputValue;return a===""&&o&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(a=e.itemToString(o)),le({},t,{inputValue:a})}var f4=le({},yo,{items:Y.default.array.isRequired,isItemDisabled:Y.default.func,inputValue:Y.default.string,defaultInputValue:Y.default.string,initialInputValue:Y.default.string,inputId:Y.default.string,onInputValueChange:Y.default.func});function p4(e,t,o,a){var r=h1(),l=s5(e,t,o,a),n=l[0],i=l[1],s=Ua();return T1(function(){if(j7(t,"selectedItem")){if(!s){var u=t.itemToKey(t.selectedItem)!==t.itemToKey(r.current);u&&i({type:ln,inputValue:t.itemToString(t.selectedItem)})}r.current=n.selectedItem===r.current?t.selectedItem:n.selectedItem}},[n.selectedItem,t.selectedItem]),[Ea(n,t),i]}var C4=le({},Mo,{isItemDisabled:function(){return!1}});function m4(e,t,o){var a,r=o.type,l=o.altKey,n;switch(r){case an:n={isOpen:V1(t,"isOpen",r1),highlightedIndex:Za(t),selectedItem:t.items[o.index],inputValue:t.itemToString(t.items[o.index])};break;case Kl:e.isOpen?n={highlightedIndex:at(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:n={highlightedIndex:l&&e.selectedItem==null?-1:Lt(t,e,1),isOpen:t.items.length>=0};break;case Gl:e.isOpen?l?n=Aa(t,e.highlightedIndex):n={highlightedIndex:at(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:n={highlightedIndex:Lt(t,e,-1),isOpen:t.items.length>=0};break;case en:n=Aa(t,e.highlightedIndex);break;case Wl:n=le({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Yl:n={highlightedIndex:at(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case Jl:n={highlightedIndex:at(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case Xl:n={highlightedIndex:zt(0,!1,t.items,t.isItemDisabled)};break;case Ql:n={highlightedIndex:zt(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Na:n=le({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((a=t.items)==null?void 0:a.length)&&o.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case tn:n={isOpen:!0,highlightedIndex:Za(t),inputValue:o.inputValue};break;case on:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Lt(t,e,0)};break;case rn:n={selectedItem:o.selectedItem,inputValue:t.itemToString(o.selectedItem)};break;case ln:n={inputValue:o.inputValue};break;default:return p5(e,t,o,_5)}return le({},e,n)}var h4=["onMouseLeave","refKey","ref"],g4=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],v4=["onClick","onPress","refKey","ref"],x4=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];D5.stateChangeTypes=_5;function D5(e){e===void 0&&(e={}),Hl(e,D5,f4);var t=le({},C4,e),o=t.items,a=t.scrollIntoView,r=t.environment,l=t.getA11yStatusMessage,n=p4(m4,t,c4,f5),i=n[0],s=n[1],u=i.isOpen,d=i.highlightedIndex,p=i.selectedItem,C=i.inputValue,g=h1(null),f=h1({}),c=h1(null),m=h1(null),I=Ua(),h=I5(t),S=h1(),x=So({state:i,props:t}),H=Ce(function(B){return f.current[h.getItemId(B)]},[h]);_l(l,i,[u,d,p,C],r);var O=c5({menuElement:g.current,highlightedIndex:d,isOpen:u,itemRefs:f,scrollIntoView:a,getItemNodeFromIndex:H});Ol({props:t,state:i}),T1(function(){var B=xt(t,"isOpen",r1);B&&c.current&&c.current.focus()},[]),T1(function(){I||(S.current=o.length)});var N=Ce(function(){x.current.state.isOpen&&s({type:Na})},[s,x]),y=qt(function(){return[g,m,c]},[]),V=d5(r,N,y),U=Dl("getInputProps","getMenuProps");T1(function(){u||(f.current={})},[u]),T1(function(){var B;!u||!(r!=null&&r.document)||!(c!=null&&(B=c.current)!=null&&B.focus)||r.document.activeElement!==c.current&&c.current.focus()},[u,r]);var G=qt(function(){return{ArrowDown:function(Z){Z.preventDefault(),s({type:Kl,altKey:Z.altKey})},ArrowUp:function(Z){Z.preventDefault(),s({type:Gl,altKey:Z.altKey})},Home:function(Z){x.current.state.isOpen&&(Z.preventDefault(),s({type:Xl}))},End:function(Z){x.current.state.isOpen&&(Z.preventDefault(),s({type:Ql}))},Escape:function(Z){var F=x.current.state;(F.isOpen||F.inputValue||F.selectedItem||F.highlightedIndex>-1)&&(Z.preventDefault(),s({type:Wl}))},Enter:function(Z){var F=x.current.state;!F.isOpen||Z.which===229||(Z.preventDefault(),s({type:en}))},PageUp:function(Z){x.current.state.isOpen&&(Z.preventDefault(),s({type:Yl}))},PageDown:function(Z){x.current.state.isOpen&&(Z.preventDefault(),s({type:Jl}))}}},[s,x]),W=Ce(function(B){return le({id:h.labelId,htmlFor:h.inputId},B)},[h]),$=Ce(function(B,Z){var F,R=B===void 0?{}:B,X=R.onMouseLeave,ue=R.refKey,ce=ue===void 0?"ref":ue,M=R.ref,P=a1(R,h4),Q=Z===void 0?{}:Z,ne=Q.suppressRefError,Re=ne===void 0?!1:ne;return U("getMenuProps",Re,ce,g),le((F={},F[ce]=Z1(M,function(be){g.current=be}),F.id=h.menuId,F.role="listbox",F["aria-labelledby"]=P&&P["aria-label"]?void 0:""+h.labelId,F.onMouseLeave=Ve(X,function(){s({type:y5})}),F),P)},[s,U,h]),_=Ce(function(B){var Z,F,R=B===void 0?{}:B,X=R.item,ue=R.index,ce=R.refKey,M=ce===void 0?"ref":ce,P=R.ref,Q=R.onMouseMove,ne=R.onMouseDown,Re=R.onClick;R.onPress;var be=R.disabled,de=a1(R,g4);be!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var re=x.current,te=re.props,ve=re.state,he=Vl(X,ue,te.items,"Pass either item or index to getItemProps!"),ke=he[0],ie=he[1],Ie=te.isItemDisabled(ke,ie),Ue="onClick",_1=Re,ye=function(){V.isTouchEnd||ie===ve.highlightedIndex||(O.current=!1,s({type:M5,index:ie,disabled:Ie}))},Ke=function(){s({type:an,index:ie})},Ge=function(lt){return lt.preventDefault()};return le((Z={},Z[M]=Z1(P,function(qe){qe&&(f.current[h.getItemId(ie)]=qe)}),Z["aria-disabled"]=Ie,Z["aria-selected"]=ie===ve.highlightedIndex,Z.id=h.getItemId(ie),Z.role="option",Z),!Ie&&(F={},F[Ue]=Ve(_1,Ke),F),{onMouseMove:Ve(Q,ye),onMouseDown:Ve(ne,Ge)},de)},[s,h,x,V,O]),q=Ce(function(B){var Z,F=B===void 0?{}:B,R=F.onClick;F.onPress;var X=F.refKey,ue=X===void 0?"ref":X,ce=F.ref,M=a1(F,v4),P=x.current.state,Q=function(){s({type:S5})};return le((Z={},Z[ue]=Z1(ce,function(ne){m.current=ne}),Z["aria-controls"]=h.menuId,Z["aria-expanded"]=P.isOpen,Z.id=h.toggleButtonId,Z.tabIndex=-1,Z),!M.disabled&&le({},{onClick:Ve(R,Q)}),M)},[s,x,h]),w=Ce(function(B,Z){var F,R=B===void 0?{}:B,X=R.onKeyDown,ue=R.onChange,ce=R.onInput,M=R.onBlur;R.onChangeText;var P=R.onClick,Q=R.refKey,ne=Q===void 0?"ref":Q,Re=R.ref,be=a1(R,x4),de=Z===void 0?{}:Z,re=de.suppressRefError,te=re===void 0?!1:re;U("getInputProps",te,ne,c);var ve=x.current.state,he=function(Ge){var qe=Ba(Ge);qe&&G[qe]&&G[qe](Ge)},ke=function(Ge){s({type:tn,inputValue:Ge.target.value})},ie=function(Ge){if(r!=null&&r.document&&ve.isOpen&&!V.isMouseDown){var qe=Ge.relatedTarget===null&&r.document.activeElement!==r.document.body;s({type:Na,selectItem:!qe})}},Ie=function(){s({type:on})},Ue="onChange",_1={};if(!be.disabled){var ye;_1=(ye={},ye[Ue]=Ve(ue,ce,ke),ye.onKeyDown=Ve(X,he),ye.onBlur=Ve(M,ie),ye.onClick=Ve(P,Ie),ye)}return le((F={},F[ne]=Z1(Re,function(Ke){c.current=Ke}),F["aria-activedescendant"]=ve.isOpen&&ve.highlightedIndex>-1?h.getItemId(ve.highlightedIndex):"",F["aria-autocomplete"]="list",F["aria-controls"]=h.menuId,F["aria-expanded"]=ve.isOpen,F["aria-labelledby"]=be&&be["aria-label"]?void 0:h.labelId,F.autoComplete="off",F.id=h.inputId,F.role="combobox",F.value=ve.inputValue,F),_1,be)},[s,h,r,G,x,V,U]),L=Ce(function(){s({type:R5})},[s]),b=Ce(function(){s({type:H5})},[s]),v=Ce(function(){s({type:k5})},[s]),k=Ce(function(B){s({type:P5,highlightedIndex:B})},[s]),A=Ce(function(B){s({type:rn,selectedItem:B})},[s]),E=Ce(function(B){s({type:T5,inputValue:B})},[s]),z=Ce(function(){s({type:V5})},[s]);return{getItemProps:_,getLabelProps:W,getMenuProps:$,getInputProps:w,getToggleButtonProps:q,toggleMenu:L,openMenu:v,closeMenu:b,setHighlightedIndex:k,setInputValue:E,selectItem:A,reset:z,highlightedIndex:d,isOpen:u,selectedItem:p,inputValue:C}}var O5={activeIndex:-1,selectedItems:[]};function o5(e,t){return xt(e,t,O5)}function a5(e,t){return V1(e,t,O5)}function L4(e){var t=o5(e,"activeIndex"),o=o5(e,"selectedItems");return{activeIndex:t,selectedItems:o}}function r5(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}function w4(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var ib={stateReducer:yo.stateReducer,itemToKey:yo.itemToKey,environment:yo.environment,selectedItems:Y.default.array,initialSelectedItems:Y.default.array,defaultSelectedItems:Y.default.array,getA11yStatusMessage:Y.default.func,activeIndex:Y.default.number,initialActiveIndex:Y.default.number,defaultActiveIndex:Y.default.number,onActiveIndexChange:Y.default.func,onSelectedItemsChange:Y.default.func,keyNavigationNext:Y.default.string,keyNavigationPrevious:Y.default.string},b4={itemToKey:Mo.itemToKey,stateReducer:Mo.stateReducer,environment:Mo.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},I4=Ro,nn=0,sn=1,un=2,dn=3,cn=4,fn=5,pn=6,Cn=7,mn=8,hn=9,gn=10,vn=11,xn=12,y4=Object.freeze({__proto__:null,DropdownClick:Cn,DropdownKeyDownBackspace:pn,DropdownKeyDownNavigationPrevious:fn,FunctionAddSelectedItem:mn,FunctionRemoveSelectedItem:hn,FunctionReset:xn,FunctionSetActiveIndex:vn,FunctionSetSelectedItems:gn,SelectedItemClick:nn,SelectedItemKeyDownBackspace:un,SelectedItemKeyDownDelete:sn,SelectedItemKeyDownNavigationNext:dn,SelectedItemKeyDownNavigationPrevious:cn});function M4(e,t,o){var a=o.type,r=o.index,l=o.selectedItem,n=e.activeIndex,i=e.selectedItems,s;switch(a){case nn:s={activeIndex:r};break;case cn:s={activeIndex:n-1<0?0:n-1};break;case dn:s={activeIndex:n+1>=i.length?-1:n+1};break;case un:case sn:{if(n<0)break;var u=n;i.length===1?u=-1:n===i.length-1&&(u=i.length-2),s=le({selectedItems:[].concat(i.slice(0,n),i.slice(n+1))},{activeIndex:u});break}case fn:s={activeIndex:i.length-1};break;case pn:s={selectedItems:i.slice(0,i.length-1)};break;case mn:s={selectedItems:[].concat(i,[l])};break;case Cn:s={activeIndex:-1};break;case hn:{var d=n,p=i.findIndex(function(f){return t.itemToKey(f)===t.itemToKey(l)});if(p<0)break;i.length===1?d=-1:p===i.length-1&&(d=i.length-2),s={selectedItems:[].concat(i.slice(0,p),i.slice(p+1)),activeIndex:d};break}case gn:{var C=o.selectedItems;s={selectedItems:C};break}case vn:{var g=o.activeIndex;s={activeIndex:g};break}case xn:s={activeIndex:a5(t,"activeIndex"),selectedItems:a5(t,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return le({},e,s)}var S4=["refKey","ref","onClick","onKeyDown","selectedItem","index"],R4=["refKey","ref","onKeyDown","onClick","preventKeyAction"];E5.stateChangeTypes=y4;function E5(e){e===void 0&&(e={}),I4(e,E5);var t=le({},b4,e),o=t.getA11yStatusMessage,a=t.environment,r=t.keyNavigationNext,l=t.keyNavigationPrevious,n=Tl(M4,t,L4,w4),i=n[0],s=n[1],u=i.activeIndex,d=i.selectedItems,p=Ua(),C=h1(null),g=h1();g.current=[];var f=So({state:i,props:t});_l(o,i,[u,d],a),T1(function(){p||(u===-1&&C.current?C.current.focus():g.current[u]&&g.current[u].focus())},[u]),Ol({props:t,state:i});var c=Dl("getDropdownProps"),m=qt(function(){var V;return V={},V[l]=function(){s({type:cn})},V[r]=function(){s({type:dn})},V.Delete=function(){s({type:sn})},V.Backspace=function(){s({type:un})},V},[s,r,l]),I=qt(function(){var V;return V={},V[l]=function(U){r5(U)&&s({type:fn})},V.Backspace=function(G){r5(G)&&s({type:pn})},V},[s,l]),h=Ce(function(V){var U,G=V===void 0?{}:V,W=G.refKey,$=W===void 0?"ref":W,_=G.ref,q=G.onClick,w=G.onKeyDown,L=G.selectedItem,b=G.index,v=a1(G,S4),k=f.current.state,A=Vl(L,b,k.selectedItems,"Pass either item or index to getSelectedItemProps!"),E=A[1],z=E>-1&&E===k.activeIndex,B=function(){s({type:nn,index:E})},Z=function(R){var X=Ba(R);X&&m[X]&&m[X](R)};return le((U={},U[$]=Z1(_,function(F){F&&g.current.push(F)}),U.tabIndex=z?0:-1,U.onClick=Ve(q,B),U.onKeyDown=Ve(w,Z),U),v)},[s,f,m]),S=Ce(function(V,U){var G,W=V===void 0?{}:V,$=W.refKey,_=$===void 0?"ref":$,q=W.ref,w=W.onKeyDown,L=W.onClick,b=W.preventKeyAction,v=b===void 0?!1:b,k=a1(W,R4),A=U===void 0?{}:U,E=A.suppressRefError,z=E===void 0?!1:E;c("getDropdownProps",z,_,C);var B=function(R){var X=Ba(R);X&&I[X]&&I[X](R)},Z=function(){s({type:Cn})};return le((G={},G[_]=Z1(q,function(F){F&&(C.current=F)}),G),!v&&{onKeyDown:Ve(w,B),onClick:Ve(L,Z)},k)},[s,I,c]),x=Ce(function(V){s({type:mn,selectedItem:V})},[s]),H=Ce(function(V){s({type:hn,selectedItem:V})},[s]),O=Ce(function(V){s({type:gn,selectedItems:V})},[s]),N=Ce(function(V){s({type:vn,activeIndex:V})},[s]),y=Ce(function(){s({type:xn})},[s]);return{getSelectedItemProps:h,getDropdownProps:S,addSelectedItem:x,removeSelectedItem:H,setSelectedItems:O,setActiveIndex:N,reset:y,selectedItems:d,activeIndex:u}}var Ln=0,wn=1,bn=2,In=3,yn=4,Mn=5,Sn=6,k4=Object.freeze({__proto__:null,FunctionAddItem:Sn,TagClick:Ln,TagGroupKeyDownArrowLeft:wn,TagGroupKeyDownArrowRight:bn,TagGroupKeyDownBackspace:yn,TagGroupKeyDownDelete:In,TagRemoveClick:Mn});function H4(e,t,o){var a=o.type,r;switch(a){case Ln:r={activeIndex:o.index};break;case wn:r={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case bn:r={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case yn:case In:{var l=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),n=l.length===0?-1:l.length===e.activeIndex?e.activeIndex-1:e.activeIndex;r={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:n};break}case Mn:{var i=[].concat(e.items.slice(0,o.index),e.items.slice(o.index+1)),s=i.length===0?-1:i.length===o.index?o.index-1:o.index;r={items:i,activeIndex:s}}break;case Sn:{var u=[];o.index===void 0?u=[].concat(e.items,[o.item]):u=[].concat(e.items.slice(0,o.index),[o.item],e.items.slice(o.index));var d=e.activeIndex===-1?u.length-1:e.activeIndex;r={items:u,activeIndex:d};break}default:throw new Error("Invalid useTagGroup reducer action.")}return le({},e,r)}var P4=le({},me),B5=P4.useId,T4=typeof B5=="function"?V4:_4;function V4(e){var t=e.id,o=e.tagGroupId,a=e.getTagId,r="downshift-"+B5();t||(t=r);var l=me.useMemo(function(){return{tagGroupId:o??t+"-tag-group",getTagId:a??function(n){return t+"-tag-"+n}}},[a,t,o]);return l}function _4(e){var t=e.id,o=e.getTagId,a=e.tagGroupId,r=me.useRef(t??"downshift-"+l5()),l=r.current,n=me.useMemo(function(){return{tagGroupId:a??l+"-tag-group",getTagId:o??function(i){return l+"-tag-"+i}}},[o,l,a]);return n}function D4(e){var t,o,a,r,l=(t=(o=e.items)!=null?o:e.initialItems)!=null?t:[],n=(a=(r=e.activeIndex)!=null?r:e.initialActiveIndex)!=null?a:l.length===0?-1:0;return{activeIndex:n,items:l}}function O4(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var A5="tag-group-a11y-description";function E4(e,t){me.useEffect(function(){if(e){var o=e.createElement("div");return o.setAttribute("id",A5),o.style.display="none",o.textContent=t,e.body.appendChild(o),function(){o.remove()}}},[t,e])}function B4(e){return le({stateReducer:function(o,a){var r=a.changes;return r},environment:typeof window>"u"?void 0:window,removeElementDescription:"Press Delete or Backspace to remove tag."},e)}function A4(e,t,o){var a=me.useRef({}),r=me.useRef(e),l=me.useRef(t);return me.useEffect(function(){if(e!==-1&&r.current!==-1&&e!==r.current||l.current===t+1){var n;(n=a.current[o(e)])==null||n.focus()}r.current=e,l.current=t},[e,o,t]),a}var Z4={isItemDisabled:Y.default.func},F4=["onKeyDown"],$4=["index","refKey","ref","onClick"],N4=["index","onClick"],Z5=function(t){var o;t===void 0&&(t={}),Hl(t,Z5,Z4);var a=B4(t),r=Tl(H4,a,D4,O4),l=r[0],n=r[1],i=l.activeIndex,s=l.items,u=So({state:l,props:a}),d=T4({getTagId:a.getTagId,id:a.id,tagGroupId:a.tagGroupId});E4((o=a.environment)==null?void 0:o.document,a.removeElementDescription);var p=A4(i,s.length,d.getTagId),C=Ce(function(m){var I=m??{},h=I.onKeyDown,S=a1(I,F4),x=function(N){switch(N.key){case"ArrowLeft":n({type:wn});break;case"ArrowRight":n({type:bn});break;case"Delete":n({type:In});break;case"Backspace":n({type:yn});break}},H=le({id:d.tagGroupId,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions",role:"listbox",onKeyDown:Rl(h,x)},S);return H},[n,d.tagGroupId]),g=Ce(function(m){var I,h=m.index,S=m.refKey,x=S===void 0?"ref":S,H=m.ref,O=m.onClick,N=a1(m,$4);if(!Number.isInteger(h)||h<0)throw new Error("Pass correct item index to getTagProps!");var y=u.current.state,V=function(){n({type:Ln,index:h})},U=d.getTagId(h);return le((I={"aria-describedby":A5},I[x]=F7(H,function(G){G&&(p.current[U]=G)}),I["aria-labelledby"]=U,I.role="option",I.id=U,I.onClick=Rl(O,V),I.tabIndex=y.activeIndex===h?0:-1,I),N)},[n,d,u,p]),f=Ce(function(m){var I=m.index,h=m.onClick,S=a1(m,N4);if(!Number.isInteger(I)||I<0)throw new Error("Pass correct item index to getTagRemoveProps!");var x=function(y){y.stopPropagation(),n({type:Mn,index:I})},H=d.getTagId(I),O=H+"-remove";return le({id:O,tabIndex:-1,"aria-labelledby":O+" "+H,onClick:Rl(h,x)},S)},[d,n]),c=Ce(function(m,I){n({type:Sn,item:m,index:I})},[n]);return{activeIndex:i,addItem:c,getTagGroupProps:C,getTagProps:g,getTagRemoveProps:f,items:s}};Z5.stateChangeTypes=k4;import jt from"react";import{createPortal as U4}from"react-dom";import{jsx as F1,jsxs as F5}from"react/jsx-runtime";var q4=260,za=4,z4=F1(Jn,{width:9,height:9}),j4=F1(e9,{width:9,height:9}),K4={ariaReset:"Reset {0} to default"};function G4(e){let t=e.getBoundingClientRect(),o=pt(e),a=o?o.getBoundingClientRect():{top:0,bottom:window.innerHeight},r=a.bottom-t.bottom-za,l=t.top-a.top-za,n=r<q4&&l>r;return{top:n?t.top-za:t.bottom+za,left:t.left,width:t.width,openAbove:n}}function Kt({label:e,options:t,selectedItem:o,onChange:a,id:r="picklist",getOptionStyle:l,triggerLabel:n,triggerMuted:i=!1,triggerStyle:s,aria:u}){let[d,p]=jt.useState({top:0,left:0,width:0,openAbove:!1}),C=jt.useRef(null),g=`${r}-legend`,f=l1(K4,u),c=_e(f.ariaReset,[e]),m=jt.useMemo(()=>t.filter($=>$.value!==""),[t]),I=o!=null,h=()=>{C.current?.focus(),a("")},{isOpen:S,closeMenu:x,highlightedIndex:H,getToggleButtonProps:O,getMenuProps:N,getItemProps:y}=qa({items:m,itemToString:$=>$?$.label:"",selectedItem:o,onSelectedItemChange:({selectedItem:$})=>{typeof a=="function"&&$&&$.value!==o?.value&&a($.value)},onIsOpenChange:({isOpen:$})=>{$&&C.current&&p(G4(C.current))},id:r,labelId:g});jt.useEffect(()=>{if(!S||!C.current)return;let $=pt(C.current);if(!$)return;let _=()=>x();return $.addEventListener("scroll",_,{passive:!0}),()=>$.removeEventListener("scroll",_)},[S,x]);let V="picklistEditor-dropdown"+(S?" picklistEditor-dropdown--open":""),U=S?{top:d.top,left:d.left,width:d.width,...d.openAbove?{transform:"translateY(-100%)"}:void 0}:void 0,[G,W]=jt.useState(null);return jt.useLayoutEffect(()=>{let _=C.current?.getRootNode();W(_ instanceof ShadowRoot?_:document.body)},[]),F1(d1,{label:e,id:r,className:"picklistEditor-fieldset",children:F5("div",{className:"picklistEditor-wrapper",children:[F5("button",{type:"button",className:"picklistEditor-trigger",style:s,...O({ref:C}),children:[F1("span",{className:"picklistEditor-trigger-label"+(i?" picklistEditor-trigger-label--muted":""),children:n??o?.label??"Default"}),F1("span",{className:"picklistEditor-trigger-chevron","aria-hidden":"true",children:S?j4:z4})]}),I&&F1("button",{type:"button",className:"picklistEditor-reset",onClick:h,"aria-label":c,title:c,children:F1(Kn,{width:14,height:14})}),U4(F1("ul",{className:V,style:U,...N(),children:S&&m.map(($,_)=>F1("li",{className:"picklistEditor-option"+(H===_?" picklistEditor-option--highlighted":"")+(o?.value===$.value?" picklistEditor-option--selected":""),style:l?l($):void 0,...y({item:$,index:_}),children:$.label},$.value))}),G??document.body)]})})}import{jsx as Y4}from"react/jsx-runtime";var W4=[{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, sans-serif",label:"Helvetica"},{value:"Verdana, sans-serif",label:"Verdana"},{value:"Tahoma, sans-serif",label:"Tahoma"},{value:"'Trebuchet MS', sans-serif",label:"Trebuchet MS"},{value:"'Lucida Sans Unicode', sans-serif",label:"Lucida Sans"},{value:"Georgia, serif",label:"Georgia"},{value:"'Times New Roman', serif",label:"Times New Roman"},{value:"'Palatino Linotype', serif",label:"Palatino"},{value:"'Courier New', monospace",label:"Courier New"},{value:"'Lucida Console', monospace",label:"Lucida Console"}];function $5(e){return(e.split(",")[0]??"").trim().replace(/['"]/g,"")}function X4(e,t){if(!e)return null;let o=e.replace(/['"]/g,""),a=$5(e);for(let r of t){if(!r.value)continue;let l=r.value.replace(/['"]/g,"");if(o.indexOf(l)!==-1||l.indexOf(a)!==-1)return r}return null}var Q4=e=>e.value?{fontFamily:e.value}:void 0;function N5({label:e="Font family",value:t,computedValue:o,options:a,onChange:r,matchOption:l=X4,id:n="font-family",aria:i}){let s=a??W4,u=l(t,s),d=t||o,p=l(d,s),C=!u,g;return p?g=p.label:d&&(g=$5(d)||void 0),Y4(Kt,{label:e,options:s,selectedItem:u,triggerLabel:g,triggerMuted:C,triggerStyle:d?{fontFamily:d}:void 0,onChange:r,id:n,getOptionStyle:Q4,aria:i})}import{jsx as Rn}from"react/jsx-runtime";var J4=[{value:"normal",labelKey:"normal",defaultLabel:"Normal",icon:Rn(An,{width:14,height:14})},{value:"italic",labelKey:"italic",defaultLabel:"Italic",icon:Rn(Bn,{width:14,height:14})}];function U5({label:e="Font Style",value:t,onChange:o,id:a="font-style",optionLabels:r}){let l=J4.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return Rn(y1,{label:e,options:l,value:t||"normal",onChange:o,id:a})}import{jsx as a8}from"react/jsx-runtime";var e8=[{value:"100",labelKey:"thin",defaultWord:"Thin"},{value:"200",labelKey:"extraLight",defaultWord:"Extra Light"},{value:"300",labelKey:"light",defaultWord:"Light"},{value:"400",labelKey:"regular",defaultWord:"Regular"},{value:"500",labelKey:"medium",defaultWord:"Medium"},{value:"600",labelKey:"semiBold",defaultWord:"Semi Bold"},{value:"700",labelKey:"bold",defaultWord:"Bold"},{value:"800",labelKey:"extraBold",defaultWord:"Extra Bold"},{value:"900",labelKey:"black",defaultWord:"Black"}];function t8(e){return e8.map(t=>{let o=e?.[t.labelKey]??t.defaultWord;return{value:t.value,label:`${o} (${t.value})`}})}function o8(e,t){if(!e)return null;let o=String(e).trim();return t.find(a=>a.value===o)??null}function q5({label:e="Font weight",value:t,computedValue:o,options:a,onChange:r,matchOption:l=o8,id:n="font-weight",optionLabels:i,aria:s}){let u=a??t8(i),d=l(t,u),p=l(t||o,u),C=!d,g=p?.label;return a8(Kt,{label:e,options:u,selectedItem:d,triggerLabel:g,triggerMuted:C,onChange:r,id:n,aria:s})}import se from"react";import{createPortal as r8}from"react-dom";import{jsx as ae,jsxs as $e}from"react/jsx-runtime";var l8={tabCms:"CMS",tabLocal:"Local",tabUrl:"URL",ariaTablist:"Image source",clearImage:"Clear image",chooseFile:"Choose File...",ariaChooseFile:"Choose an image file from your computer",useThisImage:"Use This Image",ariaImageUrl:"Image URL",urlPlaceholder:"https://example.com/image.png",previewAlt:"Preview",altText:"Alt Text",altPlaceholder:"Describe the image",width:"Width",height:"Height",autoPlaceholder:"auto",workspace:"Workspace",selectWorkspace:"Select a workspace...",selectImage:"Select an Image",loadingWorkspaces:"Loading workspaces...",noWorkspaces:"No CMS workspaces found",loadingImages:"Loading images...",noImages:"No images in this workspace",loadingMore:"Loading more...",untitled:"Untitled",downloadingImage:"Downloading image...",downloadFailed:"Download failed",closePicker:"Close",cancel:"Cancel",done:"Done",pickerTitle:"Select an image from {0}",pickerError:"Error: {0}"},Gt=["cms","local","url"];function n8({labels:e,workspaceName:t,folderId:o,portalTarget:a,folderItemsResult:r,contentDetail:l,thumbnailResult:n,onFetchFolderItems:i,onFetchContentDetail:s,onFetchThumbnail:u,onCancel:d,onConfirm:p}){let[C,g]=se.useState([]),[f,c]=se.useState(0),[m,I]=se.useState(!0),[h,S]=se.useState(!1),[x,H]=se.useState(null),[O,N]=se.useState(null),[y,V]=se.useState({}),[U,G]=se.useState({}),W=se.useRef(new Set),$=se.useRef(new Set),_=se.useCallback(v=>{h||typeof i=="function"&&(S(!0),H(null),i(o,v,20))},[o,h,i]);se.useEffect(()=>{_(0)},[o]),se.useEffect(()=>{let v=k=>{k.key==="Escape"&&(k.stopPropagation(),d())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[d]);let q=se.useRef(null);se.useEffect(()=>{q.current?.focus()},[]),se.useEffect(()=>{if(!r)return;let v=(r.items??[]).map(k=>({contentKey:k.contentKey,title:k.title??e.untitled,mimeType:k.mimeType??"image/png"}));g(k=>r.page===0?v:[...k,...v]),I(!!r.hasMore),c(r.page??0),S(!1),r.error&&H(String(r.error))},[r]),se.useEffect(()=>{if(!l)return;let v=l.contentKey;if(!v||l.error)return;let k=l.url??"",A=l.mimeType??"image/png",E=l.title??"";V(z=>z[v]?z:{...z,[v]:{url:k,mimeType:A,title:E}}),k&&!$.current.has(v)&&typeof u=="function"&&($.current.add(v),u(v,k,A))},[l,u]),se.useEffect(()=>{if(!n)return;let{imageId:v,thumbnailUrl:k}=n;v&&k&&G(A=>({...A,[v]:k}))},[n]);let w=se.useRef(null);se.useEffect(()=>{let v=w.current;if(!v||!m||h)return;let k=new IntersectionObserver(A=>{A.some(z=>z.isIntersecting)&&_(f+1)});return k.observe(v),()=>k.disconnect()},[m,h,f,_]);let L=se.useCallback(v=>{W.current.has(v)||typeof s=="function"&&(W.current.add(v),s(v))},[s]),b=()=>{if(!O)return;let v=y[O],k=C.find(A=>A.contentKey===O);!v||!k||p({contentKey:O,title:k.title,url:v.url,mimeType:v.mimeType||k.mimeType})};return r8(ae("div",{ref:q,tabIndex:-1,className:"cmsPicker-overlay",role:"dialog","aria-modal":"true","aria-label":_e(e.pickerTitle,[t]),onClick:v=>{v.target===v.currentTarget&&d()},children:$e("div",{className:"cmsPicker-dialog",children:[$e("div",{className:"cmsPicker-header",children:[ae("span",{className:"cmsPicker-title",children:_e(e.pickerTitle,[t])}),ae("button",{type:"button",className:"cmsPicker-close",onClick:d,"aria-label":e.closePicker,title:e.closePicker,children:"\u2715"})]}),$e("div",{className:"cmsPicker-body",children:[C.length===0&&h&&ae("div",{className:"cmsPicker-empty",children:e.loadingImages}),C.length===0&&!h&&!x&&ae("div",{className:"cmsPicker-empty",children:e.noImages}),x&&ae("div",{className:"cmsPicker-empty",children:_e(e.pickerError,[x])}),$e("div",{className:"cmsPicker-grid",children:[C.map(v=>ae(i8,{item:v,selected:O===v.contentKey,thumbnailDataUrl:U[v.contentKey],onIntersect:()=>L(v.contentKey),onClick:()=>N(v.contentKey)},v.contentKey)),m&&ae("div",{className:"cmsPicker-sentinel",ref:w,children:h?e.loadingMore:""})]})]}),$e("div",{className:"cmsPicker-footer",children:[ae("button",{type:"button",className:"cmsPicker-btn",onClick:d,children:e.cancel}),ae("button",{type:"button",className:"cmsPicker-btn cmsPicker-btn--primary",disabled:!O||!y[O??""],onClick:b,children:e.done})]})]})}),a)}function i8({item:e,selected:t,thumbnailDataUrl:o,onIntersect:a,onClick:r}){let l=se.useRef(null),n=se.useRef(!1);return se.useEffect(()=>{let i=l.current;if(!i||n.current)return;let s=new IntersectionObserver(u=>{u.some(p=>p.isIntersecting)&&!n.current&&(n.current=!0,a(),s.disconnect())});return s.observe(i),()=>s.disconnect()},[a]),$e("button",{ref:l,type:"button",className:`cmsPicker-thumb${t?" cmsPicker-thumb--selected":""}`,onClick:r,title:e.title,"aria-pressed":t,children:[ae("div",{className:"cmsPicker-thumb-img",children:o?ae("img",{src:o,alt:e.title}):ae("div",{className:"cmsPicker-thumb-placeholder","aria-hidden":"true",children:"\u2026"})}),ae("span",{className:"cmsPicker-thumb-label",children:e.title})]})}function s8({labels:e,spaces:t,spacesLoading:o,selectedSpaceId:a,onSpaceSelect:r,onOpenPicker:l}){return o?ae("div",{className:"imageEditor-cms",children:ae("div",{className:"imageEditor-cms-loading",children:e.loadingWorkspaces})}):t.length===0?ae("div",{className:"imageEditor-cms",children:ae("div",{className:"imageEditor-cms-empty",children:e.noWorkspaces})}):$e("div",{className:"imageEditor-cms",children:[$e("div",{className:"imageEditor-cms-channel",children:[ae("label",{className:"imageEditor-cms-channel-label",htmlFor:"cms-space-select",children:e.workspace}),$e("select",{id:"cms-space-select",className:"imageEditor-input imageEditor-cms-channel-select",value:a,onChange:n=>r(n.target.value),children:[ae("option",{value:"",children:e.selectWorkspace}),t.map(n=>ae("option",{value:n.id,children:n.name},n.id))]})]}),ae("button",{type:"button",className:"imageEditor-cms-pick-btn",onClick:l,disabled:!a,children:e.selectImage})]})}function u8({labels:e,preview:t,onPick:o,onApply:a}){return $e("div",{className:"imageEditor-local",children:[ae("button",{className:"imageEditor-local-pick",onClick:o,type:"button","aria-label":e.ariaChooseFile,"aria-haspopup":"dialog",children:e.chooseFile}),t&&$e("div",{className:"imageEditor-local-preview",children:[ae("img",{src:t.webviewUri,alt:t.fileName,className:"imageEditor-preview-thumb"}),ae("span",{className:"imageEditor-local-filename",children:t.fileName}),ae("button",{className:"imageEditor-local-apply",onClick:()=>a(t.devUrl||t.webviewUri),type:"button",children:e.useThisImage})]})]})}function z5({src:e,alt:t,className:o}){let[a,r]=se.useState(!1);return se.useEffect(()=>{r(!1)},[e]),a?null:ae("img",{src:e,alt:t,className:o,onError:()=>r(!0)})}function d8({labels:e,input:t,onInputChange:o,onApply:a,currentUrl:r}){return $e("div",{className:"imageEditor-url",children:[ae("input",{type:"text",value:t,"aria-label":e.ariaImageUrl,placeholder:e.urlPlaceholder,className:"imageEditor-input",onChange:l=>o(l.target.value),onKeyDown:l=>{l.key==="Enter"&&t&&a(t)},onBlur:()=>{t&&t!==r&&a(t)}}),t&&ae("div",{className:"imageEditor-url-preview",children:ae(z5,{src:t,alt:e.previewAlt,className:"imageEditor-preview-thumb"})})]})}function kn({id:e,label:t,value:o,type:a,inputMode:r,placeholder:l,onCommit:n}){let[i,s]=se.useState(o),u=se.useRef(n);u.current=n;let d=se.useRef(o);se.useEffect(()=>{o!==d.current&&(d.current=o,s(o))},[o]);let p=()=>{i!==o&&(d.current=i,u.current(i))};return $e("div",{className:"imageEditor-attr",children:[ae("label",{className:"imageEditor-attr-label",htmlFor:e,children:t}),ae("input",{id:e,type:a,inputMode:r,value:i,placeholder:l,className:"imageEditor-input",onChange:C=>s(C.target.value),onKeyDown:C=>{C.key==="Enter"&&p()},onBlur:p})]})}function c8({labels:e,attributes:t,onAttributeChange:o}){return $e("div",{className:"imageEditor-attrs",children:[ae(kn,{id:"design-img-alt",label:e.altText,type:"text",value:t.alt,placeholder:e.altPlaceholder,onCommit:a=>o("alt",a)}),$e("div",{className:"imageEditor-attrs-row",children:[ae(kn,{id:"design-img-width",label:e.width,type:"number",inputMode:"numeric",value:t.width,placeholder:e.autoPlaceholder,onCommit:a=>o("width",a)}),ae(kn,{id:"design-img-height",label:e.height,type:"number",inputMode:"numeric",value:t.height,placeholder:e.autoPlaceholder,onCommit:a=>o("height",a)})]})]})}function j5({label:e,value:t,onChange:o,id:a="image",attributes:r,onAttributeChange:l,cmsSpaces:n,cmsSpacesLoading:i,onFetchCmsSpaces:s,cmsFolderItemsResult:u,onFetchCmsFolderItems:d,cmsContentDetail:p,onFetchCmsContentDetail:C,cmsThumbnailResult:g,onFetchCmsThumbnail:f,onImportCmsImage:c,cmsImportResult:m,onPickLocalFile:I,localPreview:h,imageLabels:S}){let x=l1(l8,S),H={cms:x.tabCms,local:x.tabLocal,url:x.tabUrl},[O,N]=se.useState("cms"),[y,V]=se.useState(""),[U,G]=se.useState(!1),[W,$]=se.useState(""),[_,q]=se.useState("idle"),w=se.useRef(null),L=se.useRef(null),b=se.useCallback(()=>{let R=L.current?.getRootNode();return R instanceof ShadowRoot?R:document.body},[]),v=se.useRef({}),k=se.useCallback(R=>{N(R),v.current[R]?.focus()},[]),A=se.useCallback((R,X)=>{let ue=null;switch(R.key){case"ArrowRight":ue=(X+1)%Gt.length;break;case"ArrowLeft":ue=(X-1+Gt.length)%Gt.length;break;case"Home":ue=0;break;case"End":ue=Gt.length-1;break;default:return}R.preventDefault();let ce=Gt[ue];ce&&k(ce)},[k]),E=n??[],z=i??!1,B=t||"";se.useEffect(()=>{if(m)if(m.success&&m.devUrl)o(m.devUrl),q("success");else{let R=w.current?.url;R?(o(R),q("success")):q("error")}},[m,o]),se.useEffect(()=>{O==="cms"&&E.length===0&&!z&&typeof s=="function"&&s()},[O]);let Z=se.useMemo(()=>E.find(R=>R.id===y)??null,[E,y]),F=se.useCallback(R=>{let X={id:R.contentKey,title:R.title,url:R.url,thumbnailUrl:"",contentType:R.mimeType};w.current=X,G(!1),typeof c=="function"&&X.url?(q("importing"),c(X)):X.url&&o(X.url)},[o,c]);return ae(d1,{label:e,id:a,className:"imageEditor-fieldset",children:$e("div",{ref:L,className:"imageEditor-root",children:[B&&$e("div",{className:"imageEditor-current",children:[ae(z5,{src:B,alt:"",className:"imageEditor-current-thumb"}),ae("span",{className:"imageEditor-current-url",title:B,children:B.length>30?`...${B.slice(-30)}`:B}),ae("button",{className:"imageEditor-clear",onClick:()=>o(""),title:x.clearImage,"aria-label":x.clearImage,type:"button",children:"\u2715"})]}),ae("div",{className:"imageEditor-tabs",role:"tablist","aria-label":x.ariaTablist,children:Gt.map((R,X)=>ae("button",{id:`${a}-tab-${R}`,ref:ue=>{v.current[R]=ue},role:"tab",type:"button","aria-selected":O===R,"aria-controls":`${a}-tabpanel`,tabIndex:O===R?0:-1,className:`imageEditor-tab${O===R?" imageEditor-tab--active":""}`,onClick:()=>N(R),onKeyDown:ue=>A(ue,X),children:H[R]},R))}),$e("div",{className:"imageEditor-tab-content",role:"tabpanel",id:`${a}-tabpanel`,"aria-labelledby":`${a}-tab-${O}`,children:[O==="cms"&&ae(s8,{labels:x,spaces:E,spacesLoading:z,selectedSpaceId:y,onSpaceSelect:V,onOpenPicker:()=>G(!0)}),O==="cms"&&_==="importing"&&ae("div",{className:"imageEditor-cms-loading",children:x.downloadingImage}),O==="cms"&&_==="error"&&ae("div",{className:"imageEditor-cms-empty",children:x.downloadFailed}),O==="local"&&ae(u8,{labels:x,preview:h,onPick:()=>I?.(),onApply:R=>o(R)}),O==="url"&&ae(d8,{labels:x,input:W,onInputChange:$,onApply:o,currentUrl:B})]}),r&&l&&ae(c8,{labels:x,attributes:r,onAttributeChange:l}),U&&Z&&ae(n8,{labels:x,workspaceName:Z.name,folderId:Z.rootFolderId,portalTarget:b(),folderItemsResult:u,contentDetail:p,thumbnailResult:g,onFetchFolderItems:d,onFetchContentDetail:C,onFetchThumbnail:f,onCancel:()=>G(!1),onConfirm:F})]})})}import{jsx as C8}from"react/jsx-runtime";var f8=[{value:"visible",labelKey:"visible",defaultLabel:"Visible"},{value:"hidden",labelKey:"hidden",defaultLabel:"Hidden"},{value:"scroll",labelKey:"scroll",defaultLabel:"Scroll"},{value:"auto",labelKey:"auto",defaultLabel:"Auto"}];function p8(e){return f8.map(t=>({value:t.value,label:e?.[t.labelKey]??t.defaultLabel}))}function K5(e,t){if(!e)return null;let o=String(e).trim().toLowerCase();return t.find(a=>a.value===o)??null}function G5({label:e="Content Overflow",value:t,computedValue:o,onChange:a,id:r="overflow",optionLabels:l,aria:n}){let i=p8(l),s=K5(t,i),u=K5(t||o,i),d=!s,p=u?.label;return C8(Kt,{label:e,options:i,selectedItem:s,triggerLabel:p,triggerMuted:d,onChange:a,id:r,aria:n})}import{jsx as ko}from"react/jsx-runtime";var m8=[{value:"left",labelKey:"left",defaultLabel:"Left",icon:ko(Qn,{width:14,height:14})},{value:"center",labelKey:"center",defaultLabel:"Center",icon:ko(Wn,{width:14,height:14})},{value:"right",labelKey:"right",defaultLabel:"Right",icon:ko(Yn,{width:14,height:14})},{value:"justify",labelKey:"justify",defaultLabel:"Justify",icon:ko(Xn,{width:14,height:14})}],h8={start:"left",end:"right"};function W5({label:e="Text Align",value:t,onChange:o,id:a="text-align",optionLabels:r}){let l=h8[t||""]||t||"left",n=m8.map(i=>({value:i.value,label:r?.[i.labelKey]??i.defaultLabel,icon:i.icon}));return ko(y1,{label:e,options:n,value:l,onChange:o,id:a})}import{jsx as ja}from"react/jsx-runtime";var X5=[{value:"none",labelKey:"none",defaultLabel:"None",icon:ja($1,{width:14,height:14})},{value:"underline",labelKey:"underline",defaultLabel:"Underline",icon:ja(t9,{width:14,height:14})},{value:"line-through",labelKey:"lineThrough",defaultLabel:"Line Through",icon:ja(Gn,{width:14,height:14})}];function g8(e){if(!e)return"none";for(let t of X5)if(e===t.value||e.startsWith(t.value+" "))return t.value;return"none"}function Q5({label:e="Text Decoration",value:t,onChange:o,id:a="text-decoration",optionLabels:r}){let l=X5.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return ja(y1,{label:e,options:l,value:g8(t),onChange:o,id:a})}import{jsx as Ho}from"react/jsx-runtime";var v8=[{value:"none",labelKey:"none",defaultLabel:"None",icon:Ho($1,{width:14,height:14})},{value:"uppercase",labelKey:"uppercase",defaultLabel:"Uppercase",icon:Ho(qn,{width:14,height:14})},{value:"lowercase",labelKey:"lowercase",defaultLabel:"Lowercase",icon:Ho(Un,{width:14,height:14})},{value:"capitalize",labelKey:"capitalize",defaultLabel:"Capitalize",icon:Ho(Nn,{width:14,height:14})}];function Y5({label:e="Text Case",value:t,onChange:o,id:a="text-transform",optionLabels:r}){let l=v8.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return Ho(y1,{label:e,options:l,value:t||"none",onChange:o,id:a})}var J5="textContent";var x8=e=>e!=null&&typeof e=="object"&&"property"in e,L8=e=>typeof e?.sourceFile=="string"&&e.sourceFile!==""&&e.lineNumber!=null&&e.columnNumber!=null?{sourceFile:e.sourceFile,lineNumber:e.lineNumber,columnNumber:e.columnNumber}:void 0;function ei(e){let t=[],o=new Map,a=l=>{let n=L8(l);if(!n)return;let{sourceFile:i,lineNumber:s,columnNumber:u}=n,d=`${i}\0${s}:${u}`,p=o.get(d);return p||(p={byProperty:new Map,baselineByProperty:new Map,debugSource:n},o.set(d,p),t.push(p)),p},r=(l,n,i)=>{l.baselineByProperty.has(n)||l.baselineByProperty.set(n,String(i??""))};for(let l of e){let n=l.data;if(l.type==="style"&&n?.property!=null){let i=a(n);if(i){let s=String(n.property);r(i,s,l.oldValue),i.byProperty.set(s,String(l.newValue??""))}}else if(l.type==="style-batch"&&Array.isArray(n?.changes)){let i=a(n);for(let s of n.changes)if(i&&x8(s)&&s.property!=null){let u=String(s.property);r(i,u,s.oldValue),i.byProperty.set(u,String(s.newValue??""))}}else l.type==="text"&&a(n)?.byProperty.set(J5,String(l.newValue??""))}return t.map(l=>{let n=[...l.byProperty].map(([i,s])=>({property:i,value:s})).filter(i=>i.property===J5||i.value!==""||l.baselineByProperty.get(i.property)!=="");return{debugSource:l.debugSource,commands:n}}).filter(l=>l.commands.length>0)}var rt={CHANGED:"history-changed",COMMAND_PUSHED:"command-pushed",COMMAND_UNDONE:"command-undone",COMMAND_REDONE:"command-redone",CLEARED:"history-cleared"},Ka=class{constructor(t={}){nt(this,"undoStack",[]);nt(this,"redoStack",[]);nt(this,"maxHistorySize");nt(this,"listeners",new Set);nt(this,"_isProcessing",!1);nt(this,"commandExecutor");if(this.maxHistorySize=t.maxHistorySize??200,!t.commandExecutor)throw new Error("CommandExecutor is required");this.commandExecutor=t.commandExecutor}createCommand(t,o,a,r){return Object.freeze({id:this._generateCommandId(),type:t,oldValue:o,newValue:a,data:r})}_generateCommandId(){return`cmd-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}subscribe(t){if(typeof t!="function")throw new Error("Listener must be a function");return this.listeners.add(t),()=>{this.listeners.delete(t)}}_notify(t,o={}){if(this.listeners.size===0)return;let a=Object.freeze({type:t,timestamp:Date.now(),canUndo:this.canUndo(),canRedo:this.canRedo(),undoCount:this.getUndoCount(),redoCount:this.getRedoCount(),...o}),r=Array.from(this.listeners);for(let l of r)try{l(a)}catch(n){console.error("[HistoryManager] Error in listener:",n)}}pushCommand(t){if(!t||typeof t!="object")throw new Error("Invalid command: must be an object");if(!t.type)throw new Error("Invalid command: missing required fields (type)");if(this._isProcessing){console.warn("[HistoryManager] pushCommand called during processing, ignoring");return}this.undoStack.length>=this.maxHistorySize||(this.undoStack.push(t),this.redoStack=[],this._notify(rt.COMMAND_PUSHED,{command:t}),this._notify(rt.CHANGED))}_trimStack(){if(this.undoStack.length>this.maxHistorySize){let t=this.undoStack.length-this.maxHistorySize;this.undoStack.splice(0,t)}}_applyCommand(t,o){if(!this.commandExecutor.canHandle(t.type))return console.warn("[HistoryManager] No executor for command type:",t.type),!1;try{return this.commandExecutor.execute(t,o)}catch(a){return console.error("[HistoryManager] Error applying command:",a,t),!1}}_createInverseCommand(t,o){let a=this.commandExecutor.getCurrentValue(t);return Object.freeze({id:this._generateCommandId(),type:t.type,oldValue:o?t.oldValue:a,newValue:o?a:t.newValue,data:t.data})}undo(){if(this._isProcessing)return console.warn("[HistoryManager] undo called during processing, ignoring"),!1;if(!this.canUndo())return!1;this._isProcessing=!0;try{let t=this.undoStack.pop(),o=this._applyCommand(t,!0);if(o){let a=this._createInverseCommand(t,!1);this.redoStack.push(a)}else this.undoStack.push(t),console.warn("[HistoryManager] Undo failed, command restored to stack");return this._notify(rt.COMMAND_UNDONE,{command:t,appliedValue:t.oldValue}),this._notify(rt.CHANGED),o}finally{this._isProcessing=!1}}redo(){if(this._isProcessing)return console.warn("[HistoryManager] redo called during processing, ignoring"),!1;if(!this.canRedo())return!1;this._isProcessing=!0;try{let t=this.redoStack.pop();if(!t)return console.warn("[HistoryManager] No command to redo"),!1;let o=this._applyCommand(t,!1);if(o){let a=this._createInverseCommand(t,!0);this.undoStack.push(a),this._trimStack()}else this.redoStack.push(t),console.warn("[HistoryManager] Redo failed, command restored to stack");return this._notify(rt.COMMAND_REDONE,{command:t,appliedValue:t.newValue}),this._notify(rt.CHANGED),o}finally{this._isProcessing=!1}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[],this._notify(rt.CLEARED),this._notify(rt.CHANGED)}getUndoCount(){return this.undoStack.length}getMaxHistorySize(){return this.maxHistorySize}getRedoCount(){return this.redoStack.length}getUndoStackSnapshot(){return this.undoStack.map(t=>({type:t.type,oldValue:t.oldValue,newValue:t.newValue,data:t.data}))}};var w8=(e,t)=>{let o=t?e.oldValue:e.newValue;return typeof o=="string"?o:String(o??"")},Ga=e=>{if(!e||typeof e!="object")return;let t=e;if(!(typeof t.sourceFile!="string"||typeof t.lineNumber!="number"||typeof t.columnNumber!="number"))return{sourceFile:t.sourceFile,lineNumber:t.lineNumber,columnNumber:t.columnNumber}},b8=e=>typeof e=="object"&&e!==null&&"property"in e&&typeof e.property=="string",I8=e=>typeof e=="object"&&e!==null&&Array.isArray(e.changes)&&e.changes.every(t=>t!=null&&typeof t.property=="string"),y8=e=>typeof e=="object"&&e!==null&&"tag"in e&&typeof e.tag=="string"&&"attribute"in e&&typeof e.attribute=="string",ti=(e,t,o)=>{let a=new Map;return{execute:(r,l)=>{let n=w8(r,l);a.set(r.id,n);try{if(r.type==="style"&&b8(r.data)){let i=Ga(r.data);return e(r.data.property,n,i),!0}else if(r.type==="style-batch"&&I8(r.data)){let i=Ga(r.data);for(let s of r.data.changes)e(s.property,l?s.oldValue:s.newValue,i);return!0}else if(r.type==="text"){let i=Ga(r.data);return t(n,i),!0}else if(r.type==="media"&&y8(r.data)){if(!o)return!1;let i=Ga(r.data);return o(r.data.tag,{[r.data.attribute]:n},i),!0}}catch{return!1}return!1},getCurrentValue:r=>a.get(r.id)??r.newValue,canHandle:r=>r==="style"||r==="style-batch"||r==="text"||r==="media"&&typeof o=="function"}};function oi(e,t,o){let a=ti(e,t,o),r=new Ka({commandExecutor:a});return{recordStyleChange(l,n,i,s){let u=r.createCommand("style",n,i,{...s,property:l});r.pushCommand(u)},recordStyleBatch(l,n){if(l.length===0)return;let i=l[0],s=r.createCommand("style-batch",i.oldValue,i.newValue,{...n,changes:l});r.pushCommand(s)},recordTextChange(l,n,i){let s=r.createCommand("text",l,n,{...i});r.pushCommand(s)},recordMediaChange(l,n,i,s,u){let d=r.createCommand("media",i,s,{...u,tag:l,attribute:n});r.pushCommand(d)},undo:()=>r.undo(),redo:()=>r.redo(),canUndo:()=>r.canUndo(),canRedo:()=>r.canRedo(),subscribe:l=>r.subscribe(l),getHistoryStack:()=>r.getUndoStackSnapshot(),clear:()=>r.clear(),getUndoCount:()=>r.getUndoCount(),getMaxHistorySize:()=>r.getMaxHistorySize()}}var M8=e=>{let t=e.trim().toLowerCase();return t===""||t==="none"};function ai(e,t,o,a){if(e!=="backgroundColor")return[];if(t.trim()==="")return[];let r=(a??"").trim();if(r.toLowerCase()==="none")return[];let l=r||(o??"");return M8(l)?[]:[{property:"backgroundImage",oldValue:l,newValue:"none"}]}import{Fragment as $8,jsx as J,jsxs as Ne}from"react/jsx-runtime";var R8="Edit this element's text on the canvas.",k8="You can't edit this element's text because it contains dynamic content.",H8={opacity:.4},P8=new Set(l9),T8=!1,V8={general:{headerTitle:"Selected Element",emptyPlaceholder:"To edit an element, select it on the canvas.",inlineEditEditable:R8,inlineEditNonEditable:k8,addToChatContext:"Add to chat as context",ariaPropertyPanel:"Property panel",ariaSelectedComponent:"Property panel for the selected element",ariaElementStyling:"Element properties",closePanel:"Close panel"},sections:{imageSource:"Image Source",background:"Background",spacing:"Layout",border:"Border",typography:"Text",elementDimensions:"Dimensions"},instances:{imageSource:"Source",backgroundColor:"Background Color",padding:"Padding",margin:"Margin",borderRadius:"Border Radius",borderWeight:"Border Weight",borderStyle:"Border Style",borderColor:"Border Color",fontFamily:"Font Family",fontSize:"Font Size",fontWeight:"Font Weight",fontStyle:"Font Style",textColor:"Text Color",textAlignment:"Text Alignment",textFormatting:"Text Formatting",textTransform:"Text Case",lineHeight:"Line Height",letterSpacing:"Letter Spacing",width:"Width",minWidth:"Minimum Width",maxWidth:"Maximum Width",height:"Height",minHeight:"Minimum Height",maxHeight:"Maximum Height",overflow:"Content Overflow"},history:{changeLimitTitle:"You're at the edit limit",changeLimitBody:"To continue editing, save your changes."}};function _8({size:e=16}){return J("svg",{width:e,height:e,viewBox:"-1 0 252 302",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:J("path",{d:"M57 49Q67 49 74 42Q81 35 81 25Q81 15 74 8Q67 1 57 1Q47 1 40 8Q33 15 33 25Q33 35 40 42Q47 49 57 49ZM193 49Q203 49 210 42Q217 35 217 25Q217 15 210 8Q203 1 193 1Q183 1 176 8Q169 15 169 25Q169 35 176 42Q183 49 193 49ZM125 301Q100 301 71 292Q47 285 26 274Q7 265 3.5 259.5Q0 254 1 249Q13 216 20 189Q24 171 26 157V147Q28 120 30 105Q34 78 40 65Q48 48 63 39Q85 27 125 27Q165 27 186 39Q201 47 209 65Q216 78 220 105Q222 120 224 147V157Q226 171 230 189Q237 216 248 249Q250 254 246.5 259.5Q243 265 224 274Q203 285 179 292Q150 301 125 301ZM23 249Q39 259 63 268Q97 280 125 280Q153 280 187 268Q210 259 227 249Q216 219 210 194Q205 174 204 159L203 148Q199 91 191 73Q188 66 184 62Q177 56 165 52Q150 48 125 48Q90 48 73 57Q64 63 59 73Q51 91 47 148L46 158Q45 174 40 194Q34 220 23 249ZM124 248Q113 248 102 244Q84 236 76 217Q72 209 71 201Q70 193 70 179Q70 163 73 151Q76 142 81.5 134Q87 126 98 120Q109 114 125.5 114Q142 114 152 120Q164 127 169 134.5Q174 142 177 151Q180 163 180 178.5Q180 194 179 200Q178 209 174 218Q167 232 154.5 240Q142 248 126 248ZM124 228H126Q147 228 156 209Q158 203 159 197.5Q160 192 160 179Q160 166 157 157Q155 151 152 146.5Q149 142 141 138Q136 134 125 134Q114 134 107.5 138Q101 142 98 146.5Q95 151 93 157Q90 166 90 178.5Q90 191 91 197Q92 203 94 209Q99 221 111 225Q117 228 124 228ZM195 81Q192 79 190 78Q170 70 146 76Q134 80 125.5 80Q117 80 104 76Q80 70 60 78Q58 79 55 81Q50 84 51 89L55 112Q56 117 59.5 120.5Q63 124 68 125Q83 126 99 126Q111 126 115 114L122 92Q122 91 124 89L125 88L126 89Q128 91 128 92L135 114Q139 126 152 126Q167 126 182 125Q187 124 190.5 120.5Q194 117 195 112L199 89Q200 84 195 81ZM141 192Q137 190 133 193V171Q138 169 141 165Q143 163 144 161Q145 159 145 156.5Q145 154 143.5 152Q142 150 140 148.5Q138 147 134 146Q130 145 125.5 145Q121 145 116 146Q111 147 109 149Q107 151 106 153Q105 155 105 157Q105 159 106 161Q107 163 109.5 166Q112 169 116 171H117V193Q113 190 109 191.5Q105 193 104 196Q103 199 105 202Q108 210 117 213Q124 216 133 213L134 212Q143 209 146 202Q147 199 145.5 196Q144 193 141 192Z"})})}function D8({size:e=12}){return J("svg",{width:e,height:e,viewBox:"0 0 12 12","aria-hidden":"true",style:{display:"block",flexShrink:0},children:J("rect",{x:"1",y:"1",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2.5 2"})})}function O8(e,t){let o=e[t];return o!=null?String(o):""}function Hn(e){if(!(!e||!e.name||!e.debugSource))return{sourceFile:e.debugSource.sourceFile,lineNumber:e.debugSource.lineNumber,columnNumber:e.debugSource.columnNumber,componentName:e.name,tagName:e.tagName}}function E8({component:e,onOpenSourceFile:t,showOpenSourceFile:o,showComponentName:a,generalLabels:r}){if(!e||!e.name)return J("section",{id:"property-panel-selected-component",className:"property-panel-selected-component",children:J("p",{className:"property-panel-selected-component-placeholder",id:"component-info",children:r.emptyPlaceholder})});let l=e.tagName?e.tagName.toLowerCase():"",n=l?`${e.name} > ${l}`:e.name,i=null;if(o&&e.debugSource){let{sourceFile:s,lineNumber:u,columnNumber:d}=e.debugSource,p=s.split("/").pop()||s,C=`:${u}:${d}`;i=Ne("a",{href:"#",className:"property-panel-selected-component-source",onClick:f=>{f.preventDefault(),t?.({sourceFile:s,lineNumber:u,columnNumber:d})},title:`${s}${C}`,children:[p,C]})}return!a&&!i?null:J("section",{id:"property-panel-selected-component",className:"property-panel-selected-component","aria-label":r.ariaSelectedComponent,children:Ne("div",{id:"component-info",className:"property-panel-selected-component-info",children:[a&&J("span",{className:"property-panel-selected-component-name",children:n}),i&&Ne("span",{className:"property-panel-selected-component-source-row",children:["\u21B3 ",i]})]})})}var B8=Le.forwardRef(function({title:t,body:o},a){return Ne("section",{ref:a,role:"alert","aria-live":"assertive","aria-labelledby":"property-panel-change-limit-title",className:"property-panel-change-limit-message",tabIndex:-1,children:[J("svg",{className:"property-panel-change-limit-icon",viewBox:"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:J("path",{d:"M260 20a240 240 0 100 480 240 240 0 100-480m0 121c17 0 30 13 30 30s-13 30-30 30-30-13-30-30 13-30 30-30m50 210c0 5-4 9-10 9h-80c-5 0-10-3-10-9v-20c0-5 4-11 10-11 5 0 10-3 10-9v-40c0-5-4-11-10-11-5 0-10-3-10-9v-20c0-5 4-11 10-11h60c5 0 10 5 10 11v80c0 5 4 9 10 9 5 0 10 5 10 11z"})}),Ne("div",{className:"property-panel-change-limit-content",children:[J("h2",{id:"property-panel-change-limit-title",className:"property-panel-change-limit-title",children:t}),J("p",{className:"property-panel-change-limit-body",children:o})]})]})});function A8({styles:e,computedStyles:t,inlineOrigin:o,hasSelection:a,onStyleChange:r,generalLabels:l,sectionLabels:n,instanceLabels:i,editorLabels:s,component:u,onImageAttributeChange:d,imageSource:p}){let C=a?"visible":"",g=T8&&u?.media?.tag==="img"?u.media:null,f=c=>o.has(c)?"":t[c]??"";return J("section",{className:"property-panel-style-properties-container"+(C?" "+C:""),"aria-label":l.ariaElementStyling,"aria-hidden":!a,children:Ne("div",{className:"property-panel-style-properties",children:[Ne(it,{title:n.typography,children:[J(N5,{label:i.fontFamily,id:"design-font-family",value:e.fontFamily,computedValue:f("fontFamily"),onChange:c=>r("fontFamily",c),aria:s?.picklist}),J(P1,{label:i.fontSize,id:"design-font-size",value:e.fontSize,placeholder:f("fontSize"),onChange:c=>r("fontSize",c),...M1.fontSize,aria:s?.dimension}),J(q5,{label:i.fontWeight,id:"design-font-weight",value:e.fontWeight,computedValue:f("fontWeight"),onChange:c=>r("fontWeight",c),optionLabels:s?.fontWeight?.options,aria:s?.picklist}),J(U5,{label:i.fontStyle,id:"design-font-style",value:e.fontStyle||t.fontStyle,onChange:c=>r("fontStyle",c),optionLabels:s?.fontStyle?.options}),J(ba,{label:i.textColor,value:e.color||t.color||"#000000",onChange:c=>r("color",c),id:"design-text-color",aria:s?.color}),J(W5,{label:i.textAlignment,id:"design-text-align",value:e.textAlign||t.textAlign,onChange:c=>r("textAlign",c),optionLabels:s?.textAlignment?.options}),J(Q5,{label:i.textFormatting,id:"design-text-decoration",value:e.textDecoration||t.textDecoration,onChange:c=>r("textDecoration",c),optionLabels:s?.textDecoration?.options}),J(Y5,{label:i.textTransform,id:"design-text-transform",value:e.textTransform||t.textTransform,onChange:c=>r("textTransform",c),optionLabels:s?.textTransform?.options}),J(P1,{label:i.lineHeight,id:"design-line-height",value:e.lineHeight,placeholder:f("lineHeight"),onChange:c=>r("lineHeight",c),...M1.lineHeight,aria:s?.dimension}),J(P1,{label:i.letterSpacing,id:"design-letter-spacing",value:e.letterSpacing,placeholder:f("letterSpacing"),onChange:c=>r("letterSpacing",c),...M1.letterSpacing,aria:s?.dimension})]}),Ne(it,{title:n.spacing,children:[J(ro,{label:i.padding,id:"design-padding",value:e.padding,placeholder:f("padding"),onChange:c=>r("padding",c),...oo.padding,aria:s?.boxDimension}),J(ro,{label:i.margin,id:"design-margin",value:e.margin,placeholder:f("margin"),onChange:c=>r("margin",c),...oo.margin,allowAuto:!0,aria:s?.boxDimension})]}),Ne(it,{title:n.elementDimensions,children:[J(P1,{label:i.width,id:"design-width",value:e.width,placeholder:f("width"),onChange:c=>r("width",c),...M1.width,aria:s?.dimension}),Ne("div",{className:"property-panel-row-2col",children:[J(P1,{label:i.minWidth,id:"design-min-width",value:e.minWidth,placeholder:f("minWidth"),onChange:c=>r("minWidth",c),...M1.minWidth,aria:s?.dimension}),J(P1,{label:i.maxWidth,id:"design-max-width",value:e.maxWidth,placeholder:f("maxWidth"),onChange:c=>r("maxWidth",c),...M1.maxWidth,aria:s?.dimension})]}),J(P1,{label:i.height,id:"design-height",value:e.height,placeholder:f("height"),onChange:c=>r("height",c),...M1.height,aria:s?.dimension}),Ne("div",{className:"property-panel-row-2col",children:[J(P1,{label:i.minHeight,id:"design-min-height",value:e.minHeight,placeholder:f("minHeight"),onChange:c=>r("minHeight",c),...M1.minHeight,aria:s?.dimension}),J(P1,{label:i.maxHeight,id:"design-max-height",value:e.maxHeight,placeholder:f("maxHeight"),onChange:c=>r("maxHeight",c),...M1.maxHeight,aria:s?.dimension})]}),J(G5,{label:i.overflow,id:"design-overflow",value:e.overflow,computedValue:f("overflow"),onChange:c=>r("overflow",c),optionLabels:s?.overflow?.options,aria:s?.picklist})]}),J(it,{title:n.background,children:J(ba,{label:i.backgroundColor,value:e.backgroundColor||t.backgroundColor||"#ffffff",onChange:c=>r("backgroundColor",c),id:"design-bg-color",aria:s?.color,backgroundImage:e.backgroundImage||t.backgroundImage})}),Ne(it,{title:n.border,children:[J(ro,{label:i.borderRadius,id:"design-border-radius",value:e.borderRadius,placeholder:f("borderRadius"),onChange:c=>r("borderRadius",c),...oo.borderRadius,aria:s?.boxDimension}),J(ro,{label:i.borderWeight,id:"design-border-width",value:e.borderWidth,placeholder:f("borderWidth"),onChange:c=>r("borderWidth",c),...oo.borderWidth,aria:s?.boxDimension}),J(D9,{label:i.borderStyle,id:"design-border-style",value:e.borderStyle||t.borderStyle,onChange:c=>r("borderStyle",c),optionLabels:s?.borderStyle?.options}),J(ba,{label:i.borderColor,value:e.borderColor||t.borderColor||"#000000",onChange:c=>r("borderColor",c),id:"design-border-color",aria:s?.color})]}),g&&J(it,{title:n.imageSource,children:J(j5,{label:i.imageSource,value:g.src,onChange:c=>d("src",c),id:"design-img-src",attributes:{alt:g.alt,width:g.width,height:g.height},onAttributeChange:d,imageLabels:s?.image,...p})})]})})}var Pn=["width","minWidth","maxWidth","height","minHeight","maxHeight","overflow","padding","margin","backgroundColor","backgroundImage","borderWidth","borderStyle","borderColor","borderRadius","color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],Wt=Object.fromEntries(Pn.map(e=>[e,""]));function ri(e,t,o,a){let r={...t};for(let l of Pn){let n=e[l];n!=null&&!o.has(l)&&(r[l]=n[a]??t[l]??"")}return r}function Z8(e,t,o){let a=new Set(t);for(let r of Pn){if(o.has(r))continue;let l=e[r];l!=null&&(l.inline?a.add(r):a.delete(r))}return a}var li=Le.forwardRef(function(t,o){let{component:a,styles:r,onStyleChange:l,onTextChange:n,onHistoryStateChange:i,onAddToChatContext:s,onOpenSourceFile:u,onClose:d,onMediaChange:p,showAddToChatContext:C=!0,showOpenSourceFile:g=!0,compactHeader:f=!1,labels:c,imageSource:m}=t,I=l1(V8,c),[h,S]=Le.useState(Wt),[x,H]=Le.useState(Wt),[O,N]=Le.useState(()=>new Set),[y,V]=Le.useState(()=>new Set),U=Le.useRef(h);U.current=h;let G=Le.useRef(x);G.current=x;let W=Le.useRef(O);W.current=O;let $=Le.useRef(y);$.current=y;let _=Le.useRef(new Map),q=Le.useRef(l);q.current=l;let w=Le.useRef(n);w.current=n;let L=Le.useRef(p);L.current=p;let b=Le.useRef(null);b.current||(b.current=oi((de,re,te)=>q.current(de,re,te,!0),(de,re)=>w.current?.(de,re),(de,re,te)=>L.current?.(de,re,te)));let v=b.current,k=Le.useRef(i);k.current=i;let[A,E]=Le.useState(()=>v.getUndoCount()),z=v.getMaxHistorySize(),B=Le.useRef("none");Le.useEffect(()=>{let de=te=>{if(k.current?.({canUndo:te.canUndo,canRedo:te.canRedo}),E(te.undoCount),!(te.type==="command-undone"||te.type==="command-redone"))return;let he=te.type==="command-undone",ke=te.command?.data?.property,ie=te.command?.data?.changes,Ie=[];if(typeof ke=="string"?Ie=[[ke,typeof te.appliedValue=="string"?te.appliedValue:""]]:Array.isArray(ie)&&(Ie=ie.filter(ye=>ye!=null&&typeof ye.property=="string").map(ye=>[ye.property,String((he?ye.oldValue:ye.newValue)??"")])),Ie.length===0)return;let Ue=te.command?.data,_1=Ue&&typeof Ue.componentName=="string"?`${Ue.componentName}-${Ue.tagName??""}-${Ue.lineNumber??""}-${Ue.columnNumber??""}`:null;if(_1!==null&&_1!==B.current){let ye=_.current.get(_1);if(!ye)return;let Ke={...ye.styles},Ge=new Set(ye.sessionEdits),qe=new Set(ye.inlineOrigin);for(let[lt,Tn]of Ie)Ke[lt]=Tn,Tn===""&&qe.has(lt)?(Ge.delete(lt),qe.delete(lt)):Ge.add(lt);_.current.set(_1,{...ye,styles:Ke,sessionEdits:Ge,inlineOrigin:qe});return}S(ye=>{let Ke={...ye};for(let[Ge,qe]of Ie)Ke[Ge]=qe;return Ke}),N(ye=>{let Ke=new Set(ye);for(let[Ge]of Ie)Ke.add(Ge);return Ke})},re=v.subscribe(de);return k.current?.({canUndo:v.canUndo(),canRedo:v.canRedo()}),E(v.getUndoCount()),re},[v]);let Z=A>=z,F=Le.useRef(null),R=Le.useRef(!1);Le.useEffect(()=>{Z&&!R.current&&F.current?.focus(),R.current=Z},[Z]),Le.useImperativeHandle(o,()=>({undo:()=>v.undo(),redo:()=>v.redo(),clearHistory:()=>{v.clear(),_.current.clear(),S(Wt),H(Wt),N(new Set),V(new Set),E(0)},getHistoryStack:()=>v.getHistoryStack(),getChangeSet:()=>ei(v.getHistoryStack()),recordTextChange:(de,re,te)=>v.recordTextChange(de,re,te),canUndo:()=>v.canUndo(),canRedo:()=>v.canRedo()}),[v]);let X=a?`${a.name}-${a.tagName??""}-${a.debugSource?.lineNumber??""}-${a.debugSource?.columnNumber??""}`:"none";B.current=X;let ue=Le.useRef("none");Le.useEffect(()=>{let de=ue.current,re,te,ve,he;if(X!==de){de!=="none"&&W.current.size>0&&_.current.set(de,{styles:U.current,computedStyles:G.current,sessionEdits:W.current,inlineOrigin:$.current}),ue.current=X;let ie=_.current.get(X);re=ie?ie.styles:Wt,te=ie?ie.computedStyles:Wt,ve=ie?ie.sessionEdits:new Set,he=ie?ie.inlineOrigin:new Set}else re=U.current,te=G.current,ve=W.current,he=$.current;let ke=r||{};S(ri(ke,re,ve,"inline")),H(ri(ke,te,ve,"computed")),N(ve),V(Z8(ke,he,ve))},[X,r]);let ce=Le.useCallback((de,re)=>{let te=O8(U.current,de),ve=Hn(a),he=a?.debugSource?{sourceFile:a.debugSource.sourceFile,lineNumber:a.debugSource.lineNumber,columnNumber:a.debugSource.columnNumber}:void 0,ke=ai(de,re,G.current.backgroundImage,U.current.backgroundImage);l(de,re,he);for(let ie of ke)l(ie.property,ie.newValue,he);ke.length===0?v.recordStyleChange(de,te,re,ve):v.recordStyleBatch([{property:de,oldValue:te,newValue:re},...ke.map(ie=>({property:ie.property,oldValue:ie.oldValue,newValue:ie.newValue}))],ve),S(ie=>{let Ie={...ie,[de]:re};for(let Ue of ke)Ie[Ue.property]=Ue.newValue;return Ie}),N(ie=>{let Ie=new Set(ie);re===""&&$.current.has(de)?Ie.delete(de):Ie.add(de);for(let Ue of ke)Ie.add(Ue.property);return Ie})},[l,v,a]),M=Le.useCallback((de,re)=>{let te=a?.media;if(!te)return;let ve=a?.debugSource;p?.(te.tag,{[de]:re},ve);let he=String(te[de]??"");v.recordMediaChange(te.tag,de,he,re,Hn(a))},[a,p,v]),P=!!(a&&a.name),Q=Le.useCallback(()=>{let de=Hn(a);de&&s?.(de)},[a,s]),ne=P&&a&&a.tagName&&P8.has(a.tagName.toUpperCase()),Re=a?.hasNonEditableText?I.general.inlineEditNonEditable:I.general.inlineEditEditable,be=a?.tagName?a.tagName.toLowerCase():a?.name;return Ne("div",{role:"complementary","aria-label":I.general.ariaPropertyPanel,className:"property-panel-container",children:[Ne("header",{className:f?"property-panel-header property-panel-header-compact":"property-panel-header",children:[f?P&&Ne("span",{className:"property-panel-selected-pill",children:[J(D8,{size:12}),J("span",{className:"property-panel-selected-pill-tag",children:be})]}):J("h2",{id:"design-property-panel-title",className:"property-panel-title",children:I.general.headerTitle}),(P||d)&&Ne("div",{className:"property-panel-header-actions",children:[P&&Ne($8,{children:[ne&&J("span",{className:"property-panel-selected-component-action property-panel-selected-component-action-help","data-tooltip":Re,"aria-label":Re,children:J($n,{width:14,height:14,style:a.hasNonEditableText?H8:void 0})}),C&&!Z&&J("button",{type:"button",className:"property-panel-selected-component-action",onClick:Q,"data-tooltip":I.general.addToChatContext,"aria-label":I.general.addToChatContext,children:J(_8,{size:14})})]}),d&&J("button",{type:"button",className:"property-panel-selected-component-action property-panel-close",onClick:d,"data-tooltip":I.general.closePanel,"aria-label":I.general.closePanel,children:J($1,{width:14,height:14,"aria-hidden":"true"})})]})]}),Ne("div",{className:"property-panel-content","aria-labelledby":f?void 0:"design-property-panel-title",children:[J(E8,{component:a,onOpenSourceFile:u,showOpenSourceFile:g,showComponentName:!f,generalLabels:I.general}),Z?J(B8,{ref:F,title:I.history.changeLimitTitle,body:I.history.changeLimitBody}):J(A8,{styles:h,computedStyles:x,inlineOrigin:y,hasSelection:P,onStyleChange:ce,generalLabels:I.general,sectionLabels:I.sections,instanceLabels:I.instances,editorLabels:c?.editors,component:a,onImageAttributeChange:M,imageSource:m},X)]})]})});function F8(e,t,o){if(!e)return;S8(e).render(Le.createElement(li,{...t,ref:o}))}export{li as DesignPropertyPanel,O9 as REQUIRED_LABEL_KEYS,_e as interpolate,F8 as mountDesignPropertyPanel,Ms as validateLabels};
1
+ var si=Object.create;var Qa=Object.defineProperty;var ui=Object.getOwnPropertyDescriptor;var di=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,fi=Object.prototype.hasOwnProperty;var pi=(e,t,o)=>t in e?Qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Qt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var Ci=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of di(t))!fi.call(e,r)&&r!==o&&Qa(e,r,{get:()=>t[r],enumerable:!(a=ui(t,r))||a.enumerable});return e};var Dn=(e,t,o)=>(o=e!=null?si(ci(e)):{},Ci(t||!e||!e.__esModule?Qa(o,"default",{value:e,enumerable:!0}):o,e));var it=(e,t,o)=>pi(e,typeof t!="symbol"?t+"":t,o);var $0=Qt((jw,F0)=>{"use strict";var O7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";F0.exports=O7});var z0=Qt((Kw,q0)=>{"use strict";var E7=$0();function N0(){}function U0(){}U0.resetWarningCache=N0;q0.exports=function(){function e(a,r,l,n,i,s){if(s!==E7){var u=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");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:U0,resetWarningCache:N0};return o.PropTypes=o,o}});var K0=Qt((Xw,j0)=>{j0.exports=z0()();var Gw,Ww});var W0=Qt(Le=>{"use strict";var Rl=Symbol.for("react.element"),kl=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),Ma=Symbol.for("react.strict_mode"),Sa=Symbol.for("react.profiler"),Ra=Symbol.for("react.provider"),ka=Symbol.for("react.context"),B7=Symbol.for("react.server_context"),Ha=Symbol.for("react.forward_ref"),Pa=Symbol.for("react.suspense"),Ta=Symbol.for("react.suspense_list"),Va=Symbol.for("react.memo"),_a=Symbol.for("react.lazy"),A7=Symbol.for("react.offscreen"),G0;G0=Symbol.for("react.module.reference");function h1(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Rl:switch(e=e.type,e){case ya:case Sa:case Ma:case Pa:case Ta:return e;default:switch(e=e&&e.$$typeof,e){case B7:case ka:case Ha:case _a:case Va:case Ra:return e;default:return t}}case kl:return t}}}Le.ContextConsumer=ka;Le.ContextProvider=Ra;Le.Element=Rl;Le.ForwardRef=Ha;Le.Fragment=ya;Le.Lazy=_a;Le.Memo=Va;Le.Portal=kl;Le.Profiler=Sa;Le.StrictMode=Ma;Le.Suspense=Pa;Le.SuspenseList=Ta;Le.isAsyncMode=function(){return!1};Le.isConcurrentMode=function(){return!1};Le.isContextConsumer=function(e){return h1(e)===ka};Le.isContextProvider=function(e){return h1(e)===Ra};Le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rl};Le.isForwardRef=function(e){return h1(e)===Ha};Le.isFragment=function(e){return h1(e)===ya};Le.isLazy=function(e){return h1(e)===_a};Le.isMemo=function(e){return h1(e)===Va};Le.isPortal=function(e){return h1(e)===kl};Le.isProfiler=function(e){return h1(e)===Sa};Le.isStrictMode=function(e){return h1(e)===Ma};Le.isSuspense=function(e){return h1(e)===Pa};Le.isSuspenseList=function(e){return h1(e)===Ta};Le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ya||e===Sa||e===Ma||e===Pa||e===Ta||e===A7||typeof e=="object"&&e!==null&&(e.$$typeof===_a||e.$$typeof===Va||e.$$typeof===Ra||e.$$typeof===ka||e.$$typeof===Ha||e.$$typeof===G0||e.getModuleId!==void 0)};Le.typeOf=h1});var Q0=Qt((Yw,X0)=>{"use strict";X0.exports=W0()});import{forwardRef as Ie,createElement as oe}from"react";function ye(e,t){if(e==null)return{};var o={},a=Object.keys(e),r,l;for(l=0;l<a.length;l++)r=a[l],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var mi=["color"],On=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,mi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M0 7.5C0 7.22386 0.223858 7 0.5 7H3C3.27614 7 3.5 7.22386 3.5 7.5C3.5 7.77614 3.27614 8 3 8H0.5C0.223858 8 0 7.77614 0 7.5ZM5.75 7.5C5.75 7.22386 5.97386 7 6.25 7H8.75C9.02614 7 9.25 7.22386 9.25 7.5C9.25 7.77614 9.02614 8 8.75 8H6.25C5.97386 8 5.75 7.77614 5.75 7.5ZM12 7C11.7239 7 11.5 7.22386 11.5 7.5C11.5 7.77614 11.7239 8 12 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),hi=["color"],En=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,hi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M1.5 6.625C1.01675 6.625 0.625 7.01675 0.625 7.5C0.625 7.98325 1.01675 8.375 1.5 8.375C1.98325 8.375 2.375 7.98325 2.375 7.5C2.375 7.01675 1.98325 6.625 1.5 6.625ZM5.5 6.625C5.01675 6.625 4.625 7.01675 4.625 7.5C4.625 7.98325 5.01675 8.375 5.5 8.375C5.98325 8.375 6.375 7.98325 6.375 7.5C6.375 7.01675 5.98325 6.625 5.5 6.625ZM9.5 6.625C9.01675 6.625 8.625 7.01675 8.625 7.5C8.625 7.98325 9.01675 8.375 9.5 8.375C9.98325 8.375 10.375 7.98325 10.375 7.5C10.375 7.01675 9.98325 6.625 9.5 6.625ZM12.625 7.5C12.625 7.01675 13.0168 6.625 13.5 6.625C13.9832 6.625 14.375 7.01675 14.375 7.5C14.375 7.98325 13.9832 8.375 13.5 8.375C13.0168 8.375 12.625 7.98325 12.625 7.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var gi=["color"],Bn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,gi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M1.25 7.5C1.25 7.22386 1.47386 7 1.75 7H13.25C13.5261 7 13.75 7.22386 13.75 7.5C13.75 7.77614 13.5261 8 13.25 8H1.75C1.47386 8 1.25 7.77614 1.25 7.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var vi=["color"],An=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,vi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var xi=["color"],$1=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,xi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Li=["color"],Zn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Li);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M5.67494 3.50017C5.67494 3.25164 5.87641 3.05017 6.12494 3.05017H10.6249C10.8735 3.05017 11.0749 3.25164 11.0749 3.50017C11.0749 3.7487 10.8735 3.95017 10.6249 3.95017H9.00587L7.2309 11.05H8.87493C9.12345 11.05 9.32493 11.2515 9.32493 11.5C9.32493 11.7486 9.12345 11.95 8.87493 11.95H4.37493C4.1264 11.95 3.92493 11.7486 3.92493 11.5C3.92493 11.2515 4.1264 11.05 4.37493 11.05H5.99397L7.76894 3.95017H6.12494C5.87641 3.95017 5.67494 3.7487 5.67494 3.50017Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),wi=["color"],Fn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,wi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M4.79993 3.50017C4.79993 3.25164 5.0014 3.05017 5.24993 3.05017H9.74993C9.99845 3.05017 10.1999 3.25164 10.1999 3.50017C10.1999 3.7487 9.99845 3.95017 9.74993 3.95017H8.09993V11.05H9.74994C9.99847 11.05 10.1999 11.2515 10.1999 11.5C10.1999 11.7486 9.99847 11.95 9.74994 11.95H5.24994C5.00141 11.95 4.79994 11.7486 4.79994 11.5C4.79994 11.2515 5.00141 11.05 5.24994 11.05H6.89993V3.95017H5.24993C5.0014 3.95017 4.79993 3.7487 4.79993 3.50017Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),bi=["color"],$n=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,bi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M2.78233 2.21707C2.70732 2.14206 2.60557 2.09991 2.49949 2.09991C2.3934 2.09991 2.29166 2.14206 2.21664 2.21707L0.216645 4.21707C0.0604351 4.37328 0.0604351 4.62655 0.216645 4.78276C0.372855 4.93897 0.626121 4.93897 0.78233 4.78276L2.09949 3.4656L2.09949 11.5342L0.78233 10.2171C0.62612 10.0609 0.372854 10.0609 0.216645 10.2171C0.0604349 10.3733 0.0604349 10.6265 0.216645 10.7828L2.21664 12.7828C2.29166 12.8578 2.3934 12.8999 2.49949 12.8999C2.60557 12.8999 2.70731 12.8578 2.78233 12.7828L4.78233 10.7828C4.93854 10.6265 4.93854 10.3733 4.78233 10.2171C4.62612 10.0609 4.37285 10.0609 4.21664 10.2171L2.89949 11.5342L2.89949 3.4656L4.21664 4.78276C4.37285 4.93897 4.62612 4.93897 4.78233 4.78276C4.93854 4.62655 4.93854 4.37328 4.78233 4.21707L2.78233 2.21707ZM10.5 2.74997C10.7107 2.74997 10.8988 2.88211 10.9703 3.08036L13.9703 11.3999C14.064 11.6597 13.9293 11.9462 13.6696 12.0399C13.4098 12.1336 13.1233 11.9989 13.0296 11.7392L12.0477 9.016H8.95228L7.97033 11.7392C7.87666 11.9989 7.59013 12.1336 7.33036 12.0399C7.07059 11.9462 6.93595 11.6597 7.02962 11.3999L10.0296 3.08036C10.1011 2.88211 10.2892 2.74997 10.5 2.74997ZM10.5 4.72396L11.7412 8.166H9.25879L10.5 4.72396Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Ii=["color"],Nn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Ii);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M7.1813 1.68179C7.35704 1.50605 7.64196 1.50605 7.8177 1.68179L10.3177 4.18179C10.4934 4.35753 10.4934 4.64245 10.3177 4.81819C10.142 4.99392 9.85704 4.99392 9.6813 4.81819L7.9495 3.08638L7.9495 11.9136L9.6813 10.1818C9.85704 10.0061 10.142 10.0061 10.3177 10.1818C10.4934 10.3575 10.4934 10.6424 10.3177 10.8182L7.8177 13.3182C7.73331 13.4026 7.61885 13.45 7.4995 13.45C7.38015 13.45 7.26569 13.4026 7.1813 13.3182L4.6813 10.8182C4.50557 10.6424 4.50557 10.3575 4.6813 10.1818C4.85704 10.0061 5.14196 10.0061 5.3177 10.1818L7.0495 11.9136L7.0495 3.08638L5.3177 4.81819C5.14196 4.99392 4.85704 4.99392 4.6813 4.81819C4.50557 4.64245 4.50557 4.35753 4.6813 4.18179L7.1813 1.68179Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var yi=["color"],Un=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,yi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M6.5 1C6.22386 1 6 1.22386 6 1.5C6 1.77614 6.22386 2 6.5 2C7.12671 2 7.45718 2.20028 7.65563 2.47812C7.8781 2.78957 8 3.28837 8 4V11C8 11.7116 7.8781 12.2104 7.65563 12.5219C7.45718 12.7997 7.12671 13 6.5 13C6.22386 13 6 13.2239 6 13.5C6 13.7761 6.22386 14 6.5 14C7.37329 14 8.04282 13.7003 8.46937 13.1031C8.47976 13.0886 8.48997 13.0739 8.5 13.0591C8.51003 13.0739 8.52024 13.0886 8.53063 13.1031C8.95718 13.7003 9.62671 14 10.5 14C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13C9.87329 13 9.54282 12.7997 9.34437 12.5219C9.1219 12.2104 9 11.7116 9 11V4C9 3.28837 9.1219 2.78957 9.34437 2.47812C9.54282 2.20028 9.87329 2 10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1C9.62671 1 8.95718 1.29972 8.53063 1.89688C8.52024 1.91143 8.51003 1.92611 8.5 1.9409C8.48997 1.92611 8.47976 1.91143 8.46937 1.89688C8.04282 1.29972 7.37329 1 6.5 1ZM14 5H11V4H14C14.5523 4 15 4.44772 15 5V10C15 10.5523 14.5523 11 14 11H11V10H14V5ZM6 4V5H1L1 10H6V11H1C0.447715 11 0 10.5523 0 10V5C0 4.44772 0.447715 4 1 4H6Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Mi=["color"],qn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Mi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M3.68979 2.75C3.89667 2.74979 4.08232 2.87701 4.15679 3.07003L7.36662 11.39C7.46602 11.6477 7.33774 11.9371 7.0801 12.0365C6.82247 12.1359 6.53304 12.0076 6.43365 11.75L5.3825 9.02537H2.01133L0.966992 11.749C0.868128 12.0068 0.578964 12.1357 0.321126 12.0369C0.0632878 11.938 -0.0655864 11.6488 0.0332774 11.391L3.22344 3.07099C3.29751 2.87782 3.4829 2.75021 3.68979 2.75ZM3.69174 4.64284L5.05458 8.17537H2.33724L3.69174 4.64284ZM10.8989 5.20703C9.25818 5.20703 8.00915 6.68569 8.00915 8.60972C8.00915 10.6337 9.35818 12.0124 10.8989 12.0124C11.7214 12.0124 12.5744 11.6692 13.1543 11.0219V11.53C13.1543 11.7785 13.3557 11.98 13.6043 11.98C13.8528 11.98 14.0543 11.7785 14.0543 11.53V5.72C14.0543 5.47147 13.8528 5.27 13.6043 5.27C13.3557 5.27 13.1543 5.47147 13.1543 5.72V6.22317C12.6054 5.60095 11.7924 5.20703 10.8989 5.20703ZM13.1543 9.79823V7.30195C12.7639 6.58101 11.9414 6.05757 11.0868 6.05757C10.1088 6.05757 9.03503 6.96581 9.03503 8.60955C9.03503 10.1533 10.0088 11.1615 11.0868 11.1615C11.9701 11.1615 12.7719 10.4952 13.1543 9.79823Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Si=["color"],zn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Si);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M3.69899 5.20703C2.05823 5.20703 0.809204 6.68569 0.809204 8.60972C0.809204 10.6337 2.15823 12.0124 3.69899 12.0124C4.52126 12.0124 5.37402 11.6693 5.9539 11.0223V11.53C5.9539 11.7785 6.15537 11.98 6.4039 11.98C6.65243 11.98 6.8539 11.7785 6.8539 11.53V5.72001C6.8539 5.47149 6.65243 5.27001 6.4039 5.27001C6.15537 5.27001 5.9539 5.47149 5.9539 5.72001V6.22269C5.40506 5.60075 4.59218 5.20703 3.69899 5.20703ZM5.9539 9.799V7.30117C5.56339 6.58064 4.74118 6.05757 3.8868 6.05757C2.9089 6.05757 1.83508 6.96581 1.83508 8.60955C1.83508 10.1533 2.80889 11.1615 3.8868 11.1615C4.76984 11.1615 5.57141 10.4957 5.9539 9.799ZM10.799 5.20703C9.15823 5.20703 7.9092 6.68569 7.9092 8.60972C7.9092 10.6337 9.25823 12.0124 10.799 12.0124C11.6215 12.0124 12.4744 11.6692 13.0543 11.0218V11.53C13.0543 11.7785 13.2558 11.98 13.5043 11.98C13.7529 11.98 13.9543 11.7785 13.9543 11.53V5.72C13.9543 5.47147 13.7529 5.27 13.5043 5.27C13.2558 5.27 13.0543 5.47147 13.0543 5.72V6.22318C12.5055 5.60095 11.6924 5.20703 10.799 5.20703ZM13.0543 9.79822V7.30196C12.664 6.58102 11.8415 6.05757 10.9868 6.05757C10.0089 6.05757 8.93508 6.96581 8.93508 8.60955C8.93508 10.1533 9.90889 11.1615 10.9868 11.1615C11.8702 11.1615 12.672 10.4952 13.0543 9.79822Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Ri=["color"],jn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Ri);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M3.6255 2.75C3.83478 2.75 4.02192 2.88034 4.09448 3.07664L7.16985 11.3962C7.2656 11.6552 7.13324 11.9428 6.87423 12.0386C6.61522 12.1343 6.32763 12.002 6.23188 11.7429L5.22387 9.01603H2.02712L1.01911 11.7429C0.923362 12.002 0.635774 12.1343 0.376762 12.0386C0.117749 11.9428 -0.0146052 11.6552 0.0811401 11.3962L3.15651 3.07664C3.22908 2.88034 3.41621 2.75 3.6255 2.75ZM3.6255 4.69207L4.90966 8.16603H2.34133L3.6255 4.69207ZM11.3719 2.75C11.5811 2.75 11.7683 2.88034 11.8408 3.07664L14.9162 11.3962C15.012 11.6552 14.8796 11.9428 14.6206 12.0386C14.3616 12.1343 14.074 12.002 13.9782 11.7429L12.9702 9.01603H9.77348L8.76547 11.7429C8.66972 12.002 8.38213 12.1343 8.12312 12.0386C7.86411 11.9428 7.73175 11.6552 7.8275 11.3962L10.9029 3.07664C10.9754 2.88034 11.1626 2.75 11.3719 2.75ZM11.3719 4.69207L12.656 8.16603H10.0877L11.3719 4.69207Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),ki=["color"],Kn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,ki);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M4.55293 0.999969C4.75295 0.999969 4.93372 1.11917 5.0125 1.30301L8.01106 8.29982C8.11984 8.55363 8.00226 8.84757 7.74844 8.95635C7.49463 9.06512 7.20069 8.94754 7.09191 8.69373L6.11613 6.41685H2.98973L2.01395 8.69373C1.90517 8.94754 1.61123 9.06512 1.35742 8.95635C1.1036 8.84757 0.986023 8.55363 1.0948 8.29982L4.09336 1.30301C4.17214 1.11917 4.35291 0.999969 4.55293 0.999969ZM4.55293 2.76929L5.75186 5.56685H3.354L4.55293 2.76929ZM11.0562 9.00214C11.2617 9.00214 11.4463 8.87633 11.5215 8.68502L14.2733 1.68299C14.3743 1.42598 14.2478 1.13575 13.9908 1.03475C13.7338 0.933747 13.4436 1.06021 13.3426 1.31722L11.0562 7.13514L8.76973 1.31722C8.66873 1.06021 8.3785 0.933747 8.1215 1.03475C7.86449 1.13575 7.73802 1.42598 7.83902 1.68299L10.5908 8.68502C10.666 8.87633 10.8506 9.00214 11.0562 9.00214ZM14.9537 12.4999C14.9537 12.606 14.9115 12.7077 14.8365 12.7828L12.8365 14.7828C12.6803 14.939 12.4271 14.939 12.2708 14.7828C12.1146 14.6265 12.1146 14.3733 12.2708 14.2171L13.588 12.8999H1.51937L2.83653 14.2171C2.99274 14.3733 2.99274 14.6265 2.83653 14.7828C2.68032 14.939 2.42705 14.939 2.27084 14.7828L0.270843 12.7828C0.195828 12.7077 0.153687 12.606 0.153687 12.4999C0.153687 12.3938 0.195828 12.2921 0.270843 12.2171L2.27084 10.2171C2.42705 10.0609 2.68032 10.0609 2.83653 10.2171C2.99274 10.3733 2.99274 10.6265 2.83653 10.7828L1.51937 12.0999L13.588 12.0999L12.2708 10.7828C12.1146 10.6265 12.1146 10.3733 12.2708 10.2171C12.4271 10.0609 12.6803 10.0609 12.8365 10.2171L14.8365 12.2171C14.9115 12.2921 14.9537 12.3938 14.9537 12.4999Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Hi=["color"],Gn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Hi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M3.78233 2.21713C3.70732 2.14212 3.60557 2.09998 3.49949 2.09998C3.3934 2.09998 3.29166 2.14212 3.21664 2.21713L1.21664 4.21713C1.06044 4.37334 1.06044 4.62661 1.21664 4.78282C1.37285 4.93903 1.62612 4.93903 1.78233 4.78282L3.09949 3.46566L3.09949 11.5343L1.78233 10.2171C1.62612 10.0609 1.37285 10.0609 1.21664 10.2171C1.06043 10.3733 1.06043 10.6266 1.21664 10.7828L3.21664 12.7828C3.29166 12.8578 3.3934 12.9 3.49949 12.9C3.60557 12.9 3.70731 12.8578 3.78233 12.7828L5.78233 10.7828C5.93854 10.6266 5.93854 10.3733 5.78233 10.2171C5.62612 10.0609 5.37285 10.0609 5.21664 10.2171L3.89949 11.5343L3.89949 3.46566L5.21664 4.78282C5.37285 4.93903 5.62612 4.93903 5.78233 4.78282C5.93854 4.62661 5.93854 4.37334 5.78233 4.21713L3.78233 2.21713ZM8.49998 3.99997C8.22383 3.99997 7.99998 4.22382 7.99998 4.49997C7.99998 4.77611 8.22383 4.99997 8.49998 4.99997H14.5C14.7761 4.99997 15 4.77611 15 4.49997C15 4.22382 14.7761 3.99997 14.5 3.99997H8.49998ZM7.99998 7.49997C7.99998 7.22382 8.22383 6.99997 8.49998 6.99997H14.5C14.7761 6.99997 15 7.22382 15 7.49997C15 7.77611 14.7761 7.99997 14.5 7.99997H8.49998C8.22383 7.99997 7.99998 7.77611 7.99998 7.49997ZM8.49998 9.99997C8.22383 9.99997 7.99998 10.2238 7.99998 10.5C7.99998 10.7761 8.22383 11 8.49998 11H14.5C14.7761 11 15 10.7761 15 10.5C15 10.2238 14.7761 9.99997 14.5 9.99997H8.49998Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Pi=["color"],Wn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Pi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M4.85355 2.14645C5.04882 2.34171 5.04882 2.65829 4.85355 2.85355L3.70711 4H9C11.4853 4 13.5 6.01472 13.5 8.5C13.5 10.9853 11.4853 13 9 13H5C4.72386 13 4.5 12.7761 4.5 12.5C4.5 12.2239 4.72386 12 5 12H9C10.933 12 12.5 10.433 12.5 8.5C12.5 6.567 10.933 5 9 5H3.70711L4.85355 6.14645C5.04882 6.34171 5.04882 6.65829 4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355L2.14645 4.85355C1.95118 4.65829 1.95118 4.34171 2.14645 4.14645L4.14645 2.14645C4.34171 1.95118 4.65829 1.95118 4.85355 2.14645Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Ti=["color"],Xn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Ti);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M5.00003 3.25C5.00003 2.97386 4.77617 2.75 4.50003 2.75C4.22389 2.75 4.00003 2.97386 4.00003 3.25V7.10003H2.49998C2.27906 7.10003 2.09998 7.27912 2.09998 7.50003C2.09998 7.72094 2.27906 7.90003 2.49998 7.90003H4.00003V8.55C4.00003 10.483 5.56703 12.05 7.50003 12.05C9.43303 12.05 11 10.483 11 8.55V7.90003H12.5C12.7209 7.90003 12.9 7.72094 12.9 7.50003C12.9 7.27912 12.7209 7.10003 12.5 7.10003H11V3.25C11 2.97386 10.7762 2.75 10.5 2.75C10.2239 2.75 10 2.97386 10 3.25V7.10003H5.00003V3.25ZM5.00003 7.90003V8.55C5.00003 9.93071 6.11932 11.05 7.50003 11.05C8.88074 11.05 10 9.93071 10 8.55V7.90003H5.00003Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Vi=["color"],Qn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Vi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),_i=["color"],Yn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,_i);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Di=["color"],Jn=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Di);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Oi=["color"],e9=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Oi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Ei=["color"],t9=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Ei);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:a}))});var Bi=["color"],o9=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Bi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:a}))});var Ai=["color"],a9=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Ai);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M5.00001 2.75C5.00001 2.47386 4.77615 2.25 4.50001 2.25C4.22387 2.25 4.00001 2.47386 4.00001 2.75V8.05C4.00001 9.983 5.56702 11.55 7.50001 11.55C9.43301 11.55 11 9.983 11 8.05V2.75C11 2.47386 10.7762 2.25 10.5 2.25C10.2239 2.25 10 2.47386 10 2.75V8.05C10 9.43071 8.88072 10.55 7.50001 10.55C6.1193 10.55 5.00001 9.43071 5.00001 8.05V2.75ZM3.49998 13.1001C3.27906 13.1001 3.09998 13.2791 3.09998 13.5001C3.09998 13.721 3.27906 13.9001 3.49998 13.9001H11.5C11.7209 13.9001 11.9 13.721 11.9 13.5001C11.9 13.2791 11.7209 13.1001 11.5 13.1001H3.49998Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});var Zi=["color"],r9=Ie(function(e,t){var o=e.color,a=o===void 0?"currentColor":o,r=ye(e,Zi);return oe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),oe("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});import xe from"react";import{createRoot as k8}from"react-dom/client";import l9 from"react";import{jsx as Ya,jsxs as n9}from"react/jsx-runtime";function st({title:e,defaultOpen:t=!0,children:o}){let[a,r]=l9.useState(t),l=l9.useCallback(n=>{r(n.currentTarget.open)},[]);return n9("details",{className:"property-panel-section",open:a,onToggle:l,children:[n9("summary",{className:"property-panel-section-trigger",children:[Ya("span",{children:e}),Ya(An,{className:"property-panel-section-chevron",width:12,height:12,"aria-hidden":"true"})]}),Ya("div",{className:"property-panel-section-content",children:o})]})}var i9=["H1","H2","H3","H4","H5","H6","P","SPAN","A","BUTTON","LABEL","DIV"];import v1 from"react";import*as D1 from"react";import{jsx as Fi}from"react/jsx-runtime";function bt(e,t=[]){let o=[];function a(l,n){let i=D1.createContext(n),s=o.length;o=[...o,n];let u=p=>{let{scope:C,children:g,...f}=p,c=C?.[e]?.[s]||i,m=D1.useMemo(()=>f,Object.values(f));return Fi(c.Provider,{value:m,children:g})};u.displayName=l+"Provider";function d(p,C){let g=C?.[e]?.[s]||i,f=D1.useContext(g);if(f)return f;if(n!==void 0)return n;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[u,d]}let r=()=>{let l=o.map(n=>D1.createContext(n));return function(i){let s=i?.[e]||l;return D1.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return r.scopeName=e,[a,$i(r,...t)]}function $i(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(l){let n=a.reduce((i,{useScope:s,scopeName:u})=>{let p=s(l)[`__scope${u}`];return{...i,...p}},{});return D1.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return o.scopeName=t.scopeName,o}import*as c9 from"react";import*as Ki from"react-dom";import*as Ee from"react";import*as u9 from"react";function s9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ja(...e){return t=>{let o=!1,a=e.map(r=>{let l=s9(r,t);return!o&&typeof l=="function"&&(o=!0),l});if(o)return()=>{for(let r=0;r<a.length;r++){let l=a[r];typeof l=="function"?l():s9(e[r],null)}}}}function Yt(...e){return u9.useCallback(Ja(...e),e)}import{Fragment as dc,jsx as d9}from"react/jsx-runtime";function Jt(e){let t=Ni(e),o=Ee.forwardRef((a,r)=>{let{children:l,...n}=a,i=Ee.Children.toArray(l),s=i.find(qi);if(s){let u=s.props.children,d=i.map(p=>p===s?Ee.Children.count(u)>1?Ee.Children.only(null):Ee.isValidElement(u)?u.props.children:null:p);return d9(t,{...n,ref:r,children:Ee.isValidElement(u)?Ee.cloneElement(u,void 0,d):null})}return d9(t,{...n,ref:r,children:l})});return o.displayName=`${e}.Slot`,o}function Ni(e){let t=Ee.forwardRef((o,a)=>{let{children:r,...l}=o;if(Ee.isValidElement(r)){let n=ji(r),i=zi(l,r.props);return r.type!==Ee.Fragment&&(i.ref=a?Ja(a,n):n),Ee.cloneElement(r,i)}return Ee.Children.count(r)>1?Ee.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ui=Symbol("radix.slottable");function qi(e){return Ee.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ui}function zi(e,t){let o={...t};for(let a in t){let r=e[a],l=t[a];/^on[A-Z]/.test(a)?r&&l?o[a]=(...i)=>{let s=l(...i);return r(...i),s}:r&&(o[a]=r):a==="style"?o[a]={...r,...l}:a==="className"&&(o[a]=[r,l].filter(Boolean).join(" "))}return{...e,...o}}function ji(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as Gi}from"react/jsx-runtime";var Wi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],N1=Wi.reduce((e,t)=>{let o=Jt(`Primitive.${t}`),a=c9.forwardRef((r,l)=>{let{asChild:n,...i}=r,s=n?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Gi(s,{...i,ref:l})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});import*as Ae from"react";var mc=!!(typeof window<"u"&&window.document&&window.document.createElement);function O1(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}import ut from"react";import{jsx as er}from"react/jsx-runtime";import Sc from"react";import{jsx as kc}from"react/jsx-runtime";function f9(e){let t=e+"CollectionProvider",[o,a]=bt(t),[r,l]=o(t,{collectionRef:{current:null},itemMap:new Map}),n=c=>{let{scope:m,children:b}=c,h=ut.useRef(null),R=ut.useRef(new Map).current;return er(r,{scope:m,itemMap:R,collectionRef:h,children:b})};n.displayName=t;let i=e+"CollectionSlot",s=Jt(i),u=ut.forwardRef((c,m)=>{let{scope:b,children:h}=c,R=l(i,b),v=Yt(m,R.collectionRef);return er(s,{ref:v,children:h})});u.displayName=i;let d=e+"CollectionItemSlot",p="data-radix-collection-item",C=Jt(d),g=ut.forwardRef((c,m)=>{let{scope:b,children:h,...R}=c,v=ut.useRef(null),H=Yt(m,v),D=l(d,b);return ut.useEffect(()=>(D.itemMap.set(v,{ref:v,...R}),()=>{D.itemMap.delete(v)})),er(C,{[p]:"",ref:H,children:h})});g.displayName=d;function f(c){let m=l(e+"CollectionConsumer",c);return ut.useCallback(()=>{let h=m.collectionRef.current;if(!h)return[];let R=Array.from(h.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((D,q)=>R.indexOf(D.ref.current)-R.indexOf(q.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:n,Slot:u,ItemSlot:g},f,a]}import*as tr from"react";import*as p9 from"react";var To=globalThis?.document?p9.useLayoutEffect:()=>{};var Xi=tr[" useId ".trim().toString()]||(()=>{}),Qi=0;function C9(e){let[t,o]=tr.useState(Xi());return To(()=>{e||o(a=>a??String(Qi++))},[e]),e||(t?`radix-${t}`:"")}import*as It from"react";function m9(e){let t=It.useRef(e);return It.useEffect(()=>{t.current=e}),It.useMemo(()=>(...o)=>t.current?.(...o),[])}import*as d1 from"react";import*as Vo from"react";var Yi=d1[" useInsertionEffect ".trim().toString()]||To;function dt({prop:e,defaultProp:t,onChange:o=()=>{},caller:a}){let[r,l,n]=Ji({defaultProp:t,onChange:o}),i=e!==void 0,s=i?e:r;{let d=d1.useRef(e!==void 0);d1.useEffect(()=>{let p=d.current;p!==i&&console.warn(`${a} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,a])}let u=d1.useCallback(d=>{if(i){let p=es(d)?d(e):d;p!==e&&n.current?.(p)}else l(d)},[i,e,l,n]);return[s,u]}function Ji({defaultProp:e,onChange:t}){let[o,a]=d1.useState(e),r=d1.useRef(o),l=d1.useRef(t);return Yi(()=>{l.current=t},[t]),d1.useEffect(()=>{r.current!==o&&(l.current?.(o),r.current=o)},[o,r]),[o,a,l]}function es(e){return typeof e=="function"}import*as _o from"react";import{jsx as Ac}from"react/jsx-runtime";var ts=_o.createContext(void 0);function Do(e){let t=_o.useContext(ts);return e||t||"ltr"}import{jsx as ct}from"react/jsx-runtime";var or="rovingFocusGroup.onEntryFocus",os={bubbles:!1,cancelable:!0},eo="RovingFocusGroup",[ar,h9,as]=f9(eo),[rs,rr]=bt(eo,[as]),[ls,ns]=rs(eo),g9=Ae.forwardRef((e,t)=>ct(ar.Provider,{scope:e.__scopeRovingFocusGroup,children:ct(ar.Slot,{scope:e.__scopeRovingFocusGroup,children:ct(is,{...e,ref:t})})}));g9.displayName=eo;var is=Ae.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,orientation:a,loop:r=!1,dir:l,currentTabStopId:n,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...p}=e,C=Ae.useRef(null),g=Yt(t,C),f=Do(l),[c,m]=dt({prop:n,defaultProp:i??null,onChange:s,caller:eo}),[b,h]=Ae.useState(!1),R=m9(u),v=h9(o),H=Ae.useRef(!1),[D,q]=Ae.useState(0);return Ae.useEffect(()=>{let M=C.current;if(M)return M.addEventListener(or,R),()=>M.removeEventListener(or,R)},[R]),ct(ls,{scope:o,orientation:a,dir:f,loop:r,currentTabStopId:c,onItemFocus:Ae.useCallback(M=>m(M),[m]),onItemShiftTab:Ae.useCallback(()=>h(!0),[]),onFocusableItemAdd:Ae.useCallback(()=>q(M=>M+1),[]),onFocusableItemRemove:Ae.useCallback(()=>q(M=>M-1),[]),children:ct(N1.div,{tabIndex:b||D===0?-1:0,"data-orientation":a,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:O1(e.onMouseDown,()=>{H.current=!0}),onFocus:O1(e.onFocus,M=>{let T=!H.current;if(M.target===M.currentTarget&&T&&!b){let z=new CustomEvent(or,os);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){let G=v().filter(L=>L.focusable),W=G.find(L=>L.active),$=G.find(L=>L.id===c),N=[W,$,...G].filter(Boolean).map(L=>L.ref.current);L9(N,d)}}H.current=!1}),onBlur:O1(e.onBlur,()=>h(!1))})})}),v9="RovingFocusGroupItem",x9=Ae.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,focusable:a=!0,active:r=!1,tabStopId:l,children:n,...i}=e,s=C9(),u=l||s,d=ns(v9,o),p=d.currentTabStopId===u,C=h9(o),{onFocusableItemAdd:g,onFocusableItemRemove:f,currentTabStopId:c}=d;return Ae.useEffect(()=>{if(a)return g(),()=>f()},[a,g,f]),ct(ar.ItemSlot,{scope:o,id:u,focusable:a,active:r,children:ct(N1.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:O1(e.onMouseDown,m=>{a?d.onItemFocus(u):m.preventDefault()}),onFocus:O1(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:O1(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){d.onItemShiftTab();return}if(m.target!==m.currentTarget)return;let b=ds(m,d.orientation,d.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let R=C().filter(v=>v.focusable).map(v=>v.ref.current);if(b==="last")R.reverse();else if(b==="prev"||b==="next"){b==="prev"&&R.reverse();let v=R.indexOf(m.currentTarget);R=d.loop?cs(R,v+1):R.slice(v+1)}setTimeout(()=>L9(R))}}),children:typeof n=="function"?n({isCurrentTabStop:p,hasTabStop:c!=null}):n})})});x9.displayName=v9;var ss={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function us(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ds(e,t,o){let a=us(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return ss[a]}function L9(e,t=!1){let o=document.activeElement;for(let a of e)if(a===o||(a.focus({preventScroll:t}),document.activeElement!==o))return}function cs(e,t){return e.map((o,a)=>e[(t+a)%e.length])}var w9=g9,b9=x9;import*as I9 from"react";import{jsx as ps}from"react/jsx-runtime";var y9="Toggle",lr=I9.forwardRef((e,t)=>{let{pressed:o,defaultPressed:a,onPressedChange:r,...l}=e,[n,i]=dt({prop:o,onChange:r,defaultProp:a??!1,caller:y9});return ps(N1.button,{type:"button","aria-pressed":n,"data-state":n?"on":"off","data-disabled":e.disabled?"":void 0,...l,ref:t,onClick:O1(e.onClick,()=>{e.disabled||i(!n)})})});lr.displayName=y9;import{jsx as Ye}from"react/jsx-runtime";var U1="ToggleGroup",[S9,df]=bt(U1,[rr]),R9=rr(),nr=v1.forwardRef((e,t)=>{let{type:o,...a}=e;if(o==="single")return Ye(Cs,{...a,ref:t});if(o==="multiple")return Ye(ms,{...a,ref:t});throw new Error(`Missing prop \`type\` expected on \`${U1}\``)});nr.displayName=U1;var[k9,H9]=S9(U1),Cs=v1.forwardRef((e,t)=>{let{value:o,defaultValue:a,onValueChange:r=()=>{},...l}=e,[n,i]=dt({prop:o,defaultProp:a??"",onChange:r,caller:U1});return Ye(k9,{scope:e.__scopeToggleGroup,type:"single",value:v1.useMemo(()=>n?[n]:[],[n]),onItemActivate:i,onItemDeactivate:v1.useCallback(()=>i(""),[i]),children:Ye(P9,{...l,ref:t})})}),ms=v1.forwardRef((e,t)=>{let{value:o,defaultValue:a,onValueChange:r=()=>{},...l}=e,[n,i]=dt({prop:o,defaultProp:a??[],onChange:r,caller:U1}),s=v1.useCallback(d=>i((p=[])=>[...p,d]),[i]),u=v1.useCallback(d=>i((p=[])=>p.filter(C=>C!==d)),[i]);return Ye(k9,{scope:e.__scopeToggleGroup,type:"multiple",value:n,onItemActivate:s,onItemDeactivate:u,children:Ye(P9,{...l,ref:t})})});nr.displayName=U1;var[hs,gs]=S9(U1),P9=v1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,disabled:a=!1,rovingFocus:r=!0,orientation:l,dir:n,loop:i=!0,...s}=e,u=R9(o),d=Do(n),p={role:"group",dir:d,...s};return Ye(hs,{scope:o,rovingFocus:r,disabled:a,children:r?Ye(w9,{asChild:!0,...u,orientation:l,dir:d,loop:i,children:Ye(N1.div,{...p,ref:t})}):Ye(N1.div,{...p,ref:t})})}),Oo="ToggleGroupItem",T9=v1.forwardRef((e,t)=>{let o=H9(Oo,e.__scopeToggleGroup),a=gs(Oo,e.__scopeToggleGroup),r=R9(e.__scopeToggleGroup),l=o.value.includes(e.value),n=a.disabled||e.disabled,i={...e,pressed:l,disabled:n},s=v1.useRef(null);return a.rovingFocus?Ye(b9,{asChild:!0,...r,focusable:!n,active:l,ref:s,children:Ye(M9,{...i,ref:t})}):Ye(M9,{...i,ref:t})});T9.displayName=Oo;var M9=v1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,value:a,...r}=e,l=H9(Oo,o),n={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=l.type==="single"?n:void 0;return Ye(lr,{...i,...r,ref:t,onPressedChange:s=>{s?l.onItemActivate(a):l.onItemDeactivate(a)}})}),V9=nr,_9=T9;import Is from"react";import{jsx as ws,jsxs as bs}from"react/jsx-runtime";var xs={border:"none",margin:0,padding:0,minWidth:0},Ls={color:"var(--dmp-color-foreground)",fontSize:"var(--dmp-font-size-label)",display:"block",marginBottom:"5px",padding:0};function c1({label:e,id:t,className:o,children:a}){let r=`${t}-legend`;return bs("fieldset",{style:xs,className:o,"aria-labelledby":r,children:[ws("legend",{id:r,style:Ls,children:e}),a]})}import{jsx as ir}from"react/jsx-runtime";function M1({label:e,options:t,value:o,onChange:a,id:r="radio-group"}){let l=Is.useCallback(n=>{n&&typeof a=="function"&&a(n)},[a]);return ir(c1,{label:e,id:r,className:"radioGroupEditor-fieldset",children:ir(V9,{type:"single",value:o,onValueChange:l,className:"radioGroupEditor-root","aria-label":e,children:t.map(n=>ir(_9,{value:n.value,className:"radioGroupEditor-item","aria-label":n.label,title:n.label,children:n.icon??n.label},n.value))})})}import{jsx as to}from"react/jsx-runtime";var O9=[{value:"none",labelKey:"none",defaultLabel:"None",icon:to($1,{width:14,height:14})},{value:"solid",labelKey:"solid",defaultLabel:"Solid",icon:to(Bn,{width:14,height:14})},{value:"dashed",labelKey:"dashed",defaultLabel:"Dashed",icon:to(On,{width:14,height:14})},{value:"dotted",labelKey:"dotted",defaultLabel:"Dotted",icon:to(En,{width:14,height:14})}],D9=new Set(O9.map(e=>e.value));function ys(e){if(!e)return"none";if(D9.has(e))return e;let t=e.split(/\s+/)[0]??"";return D9.has(t)?t:"none"}function E9({label:e="Border Style",value:t,onChange:o,id:a="border-style",optionLabels:r}){let l=O9.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return to(M1,{label:e,options:l,value:ys(t),onChange:o,id:a})}import ze from"react";function _e(e,t){return e.replace(/\{(\d+)\}/g,(o,a)=>{let r=t[Number(a)];return r===void 0?o:String(r)})}function n1(e,t){if(t==null||typeof t!="object"||typeof e!="object")return e;let o={...e},a=t;for(let r of Object.keys(o)){let l=o[r],n=a[r];l!==null&&typeof l=="object"&&!Array.isArray(l)?o[r]=n1(l,n):typeof n=="string"&&(o[r]=n)}return o}var B9=[{path:"general.headerTitle"},{path:"general.emptyPlaceholder"},{path:"general.inlineEditEditable"},{path:"general.inlineEditNonEditable"},{path:"general.addToChatContext"},{path:"general.ariaPropertyPanel"},{path:"general.ariaSelectedComponent"},{path:"general.ariaElementStyling"},{path:"general.closePanel"},{path:"sections.imageSource"},{path:"sections.background"},{path:"sections.spacing"},{path:"sections.border"},{path:"sections.typography"},{path:"sections.elementDimensions"},{path:"instances.imageSource"},{path:"instances.backgroundColor"},{path:"instances.padding"},{path:"instances.margin"},{path:"instances.borderRadius"},{path:"instances.borderWeight"},{path:"instances.borderStyle"},{path:"instances.borderColor"},{path:"instances.fontFamily"},{path:"instances.fontSize"},{path:"instances.fontWeight"},{path:"instances.fontStyle"},{path:"instances.textColor"},{path:"instances.textAlignment"},{path:"instances.textFormatting"},{path:"instances.textTransform"},{path:"instances.lineHeight"},{path:"instances.letterSpacing"},{path:"instances.width"},{path:"instances.minWidth"},{path:"instances.maxWidth"},{path:"instances.height"},{path:"instances.minHeight"},{path:"instances.maxHeight"},{path:"instances.overflow"},{path:"editors.image.tabCms"},{path:"editors.image.tabLocal"},{path:"editors.image.tabUrl"},{path:"editors.image.ariaTablist"},{path:"editors.image.clearImage"},{path:"editors.image.chooseFile"},{path:"editors.image.ariaChooseFile"},{path:"editors.image.useThisImage"},{path:"editors.image.ariaImageUrl"},{path:"editors.image.urlPlaceholder"},{path:"editors.image.previewAlt"},{path:"editors.image.altText"},{path:"editors.image.altPlaceholder"},{path:"editors.image.width"},{path:"editors.image.height"},{path:"editors.image.autoPlaceholder"},{path:"editors.image.workspace"},{path:"editors.image.selectWorkspace"},{path:"editors.image.selectImage"},{path:"editors.image.loadingWorkspaces"},{path:"editors.image.noWorkspaces"},{path:"editors.image.loadingImages"},{path:"editors.image.noImages"},{path:"editors.image.loadingMore"},{path:"editors.image.untitled"},{path:"editors.image.downloadingImage"},{path:"editors.image.downloadFailed"},{path:"editors.image.closePicker"},{path:"editors.image.cancel"},{path:"editors.image.done"},{path:"editors.image.pickerTitle",placeholders:[0]},{path:"editors.image.pickerError",placeholders:[0]},{path:"editors.boxDimension.sides.top"},{path:"editors.boxDimension.sides.right"},{path:"editors.boxDimension.sides.bottom"},{path:"editors.boxDimension.sides.left"},{path:"editors.boxDimension.corners.topLeft"},{path:"editors.boxDimension.corners.topRight"},{path:"editors.boxDimension.corners.bottomRight"},{path:"editors.boxDimension.corners.bottomLeft"},{path:"editors.boxDimension.makeEqual"},{path:"editors.boxDimension.ariaUnit",placeholders:[0]},{path:"editors.boxDimension.ariaSide",placeholders:[0,1]},{path:"editors.dimension.ariaValue",placeholders:[0]},{path:"editors.dimension.ariaUnit",placeholders:[0]},{path:"editors.color.placeholder"},{path:"editors.color.ariaValue",placeholders:[0]},{path:"editors.color.ariaOpenPicker",placeholders:[0,1]},{path:"editors.color.ariaPicker",placeholders:[0]},{path:"editors.color.ariaSaturation",placeholders:[0,1]},{path:"editors.color.ariaEyedropper"},{path:"editors.color.ariaHue"},{path:"editors.color.ariaAlphaSlider"},{path:"editors.color.ariaHex"},{path:"editors.color.ariaChannel",placeholders:[0,1,2,3]},{path:"editors.color.ariaAlphaInput"},{path:"editors.color.ariaFormatCycle",placeholders:[0]},{path:"editors.color.titleFormatCycle"},{path:"editors.color.gradientValue"},{path:"editors.color.imageValue"},{path:"editors.fontWeight.options.thin"},{path:"editors.fontWeight.options.extraLight"},{path:"editors.fontWeight.options.light"},{path:"editors.fontWeight.options.regular"},{path:"editors.fontWeight.options.medium"},{path:"editors.fontWeight.options.semiBold"},{path:"editors.fontWeight.options.bold"},{path:"editors.fontWeight.options.extraBold"},{path:"editors.fontWeight.options.black"},{path:"editors.fontStyle.options.normal"},{path:"editors.fontStyle.options.italic"},{path:"editors.borderStyle.options.none"},{path:"editors.borderStyle.options.solid"},{path:"editors.borderStyle.options.dashed"},{path:"editors.borderStyle.options.dotted"},{path:"editors.overflow.options.visible"},{path:"editors.overflow.options.hidden"},{path:"editors.overflow.options.scroll"},{path:"editors.overflow.options.auto"},{path:"editors.textAlignment.options.left"},{path:"editors.textAlignment.options.center"},{path:"editors.textAlignment.options.right"},{path:"editors.textAlignment.options.justify"},{path:"editors.textDecoration.options.none"},{path:"editors.textDecoration.options.underline"},{path:"editors.textDecoration.options.lineThrough"},{path:"editors.textTransform.options.none"},{path:"editors.textTransform.options.uppercase"},{path:"editors.textTransform.options.lowercase"},{path:"editors.textTransform.options.capitalize"},{path:"editors.picklist.ariaReset",placeholders:[0]},{path:"history.changeLimitTitle"},{path:"history.changeLimitBody"}];function Ms(e,t){return t.split(".").reduce((o,a)=>{if(o&&typeof o=="object")return o[a]},e)}function Ss(e){let t=new Set;for(let o of e.matchAll(/\{(\d+)\}/g))t.add(Number(o[1]));return Array.from(t).sort((o,a)=>o-a)}function Rs(e){let t=[];if(!e||typeof e!="object")return["labels is not an object"];for(let o of B9){let{path:a,placeholders:r}=o,l=Ms(e,a);if(typeof l!="string"){t.push(`missing or non-string label: ${a}`);continue}if(r){let n=Ss(l),i=[...r].sort((u,d)=>u-d);(n.length!==i.length||n.some((u,d)=>u!==i[d]))&&t.push(`placeholder mismatch at ${a}: expected {${i.join(",")}}, got {${n.join(",")}}`)}}return t}var Eo=[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"},{value:"pt",label:"pt"},{value:"vw",label:"vw"},{value:"vh",label:"vh"},{value:"vmin",label:"vmin"},{value:"vmax",label:"vmax"},{value:"ch",label:"ch"},{value:"ex",label:"ex"},{value:"cm",label:"cm"},{value:"mm",label:"mm"},{value:"in",label:"in"},{value:"pc",label:"pc"}],x1={px:{min:0,max:1e4,step:1,decimals:1},em:{min:0,max:100,step:.1,decimals:3},rem:{min:0,max:100,step:.1,decimals:3},"%":{min:0,max:1e3,step:1,decimals:2},pt:{min:0,max:1e4,step:1,decimals:1},vw:{min:0,max:100,step:.1,decimals:1},vh:{min:0,max:100,step:.1,decimals:1},vmin:{min:0,max:100,step:.1,decimals:1},vmax:{min:0,max:100,step:.1,decimals:1},ch:{min:0,max:100,step:.1,decimals:1},ex:{min:0,max:100,step:.1,decimals:1},cm:{min:0,max:100,step:.1,decimals:2},mm:{min:0,max:1e3,step:1,decimals:1},in:{min:0,max:50,step:.01,decimals:2},pc:{min:0,max:500,step:1,decimals:0}},ks=x1.px??{min:0,max:1e4,step:1,decimals:0};function oo(e){let t=e.map(o=>o.value).join("|");return new RegExp(`^(-?\\d*\\.?\\d+)\\s*(${t})$`)}var Hs=oo(Eo);function Je(e,t="px",o=Hs){if(e==null||e==="")return{numericValue:"",unit:t};let a=String(e).trim();if(a==="")return{numericValue:"",unit:t};let r=a.match(o);if(r&&r[1]!=null&&r[2]!=null)return{numericValue:parseFloat(r[1]),unit:r[2]};let l=parseFloat(a);return isNaN(l)?{numericValue:"",unit:t}:{numericValue:l,unit:t}}function sr(e,t=x1){return t[e]||ks}function L1(e,t,o=x1){let a=sr(t,o);return Math.min(a.max,Math.max(a.min,e))}function w1(e,t,o=x1){if(e===""||e==null||isNaN(e))return"";let a=sr(t,o);return Number(Number(e).toFixed(a.decimals))}function Bo(e,t){return e===""||e==null||isNaN(e)?"":`${e}${t}`}function Ao(e,t,o,a,r=x1){let l=parseFloat(e)||0,n=sr(a,r),i=o?10:1,s=(t==="ArrowUp"?1:-1)*n.step*i,u=L1(l+s,a,r);return String(w1(u,a,r))}function ur({top:e,right:t,bottom:o,left:a}){return`${e||"0px"} ${t||"0px"} ${o||"0px"} ${a||"0px"}`}function yt(e){let t={top:"",right:"",bottom:"",left:""};if(!e||typeof e!="string")return t;let o=e.trim().split(/\s+/),[a="",r="",l="",n=""]=o;return o.length===0||o.length===1&&a===""?t:o.length===1?{top:a,right:a,bottom:a,left:a}:o.length===2?{top:a,right:r,bottom:a,left:r}:o.length===3?{top:a,right:r,bottom:l,left:r}:{top:a,right:r,bottom:l,left:n}}function f1(...e){return Eo.filter(t=>e.includes(t.value))}var S1={width:{units:f1("px","em","rem","vw","ch","%"),icon:r9},minWidth:{units:f1("px","em","rem","vw","ch","%")},maxWidth:{units:f1("px","em","rem","vw","ch","%")},height:{units:f1("px","em","rem","vh","%"),icon:Nn},minHeight:{units:f1("px","em","rem","vh","%")},maxHeight:{units:f1("px","em","rem","vh","%")},fontSize:{units:f1("px","em","rem","%","pt"),constraints:{...x1,px:{min:0,max:1e3,step:1,decimals:0},"%":{min:0,max:1e3,step:1,decimals:0}},icon:$n},lineHeight:{units:[{value:"",label:"\xD7"},{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}],defaultUnit:"",constraints:{"":{min:0,max:10,step:.1,decimals:2},px:{min:0,max:1e3,step:1,decimals:2},em:{min:0,max:100,step:.1,decimals:3},rem:{min:0,max:100,step:.1,decimals:3},"%":{min:0,max:1e3,step:1,decimals:2}},icon:Gn},letterSpacing:{units:f1("px","em","rem"),constraints:{...x1,px:{min:-100,max:1e3,step:.5,decimals:1},em:{min:-10,max:100,step:.01,decimals:3},rem:{min:-10,max:100,step:.01,decimals:3}},icon:Kn}},ao={padding:{units:f1("px","em","rem","%")},margin:{units:f1("px","em","rem","%")},borderRadius:{units:f1("px","em","rem","%"),sideLabelKind:"corners"},borderWidth:{units:f1("px","em","rem")}};import{jsx as b1,jsxs as Zo}from"react/jsx-runtime";var Ps=[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}],Mt=["top","right","bottom","left"],Ts={sides:{top:"Top",right:"Right",bottom:"Bottom",left:"Left"},corners:{topLeft:"Top Left",topRight:"Top Right",bottomRight:"Bottom Right",bottomLeft:"Bottom Left"},makeEqual:"Make all values equal",ariaUnit:"{0} unit",ariaSide:"{0} {1}"};function Vs(e,t){return t==="corners"?[e.corners.topLeft,e.corners.topRight,e.corners.bottomRight,e.corners.bottomLeft]:[e.sides.top,e.sides.right,e.sides.bottom,e.sides.left]}function ro(e){return typeof e=="string"&&e.trim().toLowerCase()==="auto"}function dr(e,t,o){let a={top:"",right:"",bottom:"",left:""};for(let r of Mt){let l=e[r];if(l==null||l==="")a[r]="";else if(ro(l))a[r]="auto";else{let n=Je(String(l),t,o);a[r]=n.numericValue!==""?String(n.numericValue):""}}return a}function cr(e){let t=e.top||"";return t===(e.right||"")&&t===(e.bottom||"")&&t===(e.left||"")}function A9(e,t,o){for(let a of Mt){let r=e[a];if(r!=null&&r!==""&&r!=="0"){let l=Je(String(r),"px",t);if(l.unit&&o.has(l.unit))return l.unit}}return"px"}function _s(e,t,o){if(ro(e))return"auto";let a=parseFloat(e);if(e===""||isNaN(a))return"";let r=L1(a,t,o);return`${w1(r,t,o)}${t}`}function Z9(e){if(!e)return"";let t=yt(e);return!t.top&&!t.right&&!t.bottom&&!t.left?"":ur(t)}function lo({label:e,value:t="",onChange:o,id:a="",units:r=Ps,constraints:l=x1,allowAuto:n=!1,sideLabelKind:i="sides",sideIcons:s,placeholder:u="",aria:d}){let p=n1(Ts,d),C=Vs(p,i),g=ze.useRef(o);g.current=o;let f=ze.useMemo(()=>oo(r),[r]),c=ze.useMemo(()=>new Set(r.map(L=>L.value)),[r]),m=ze.useMemo(()=>{let L={top:"",right:"",bottom:"",left:""};if(!u)return L;let x=yt(u),w={...L};for(let I of Mt){let y=x[I];if(!y)continue;let E=Je(y,"px",f);E.numericValue!==""&&(w[I]=String(E.numericValue))}return w},[u,f]),b=ze.useMemo(()=>yt(t),[]),[h,R]=ze.useState(()=>A9(b,f,c)),[v,H]=ze.useState(()=>dr(b,h,f)),[D,q]=ze.useState(()=>cr(v)),M=ze.useRef(Z9(t));ze.useEffect(()=>{if(t===M.current)return;let L=Z9(t);if(L===M.current)return;M.current=L;let x=yt(t),w=A9(x,f,c);R(w);let I=dr(x,w,f);H(I),q(cr(I))},[t,f,c]);let T=ze.useCallback((L,x)=>{let w={top:"",right:"",bottom:"",left:""},I=!0;for(let E of Mt)w[E]=_s(L[E],x,l),w[E]!==""&&(I=!1);let y=I?"":ur(w);y!==M.current&&(M.current=y,typeof g.current=="function"&&g.current(y))},[l]),z=ze.useCallback((L,x)=>{H(D?{top:x,right:x,bottom:x,left:x}:I=>({...I,[L]:x}));let w=Je(x,h,f);w.numericValue!==""&&w.unit&&c.has(w.unit)&&w.unit!==h&&R(w.unit)},[D,h,f,c]),G=ze.useCallback((L,x)=>{let w=x.clipboardData.getData("text"),I=Je(w,h,f);if(I.numericValue!==""&&I.unit&&c.has(I.unit)){x.preventDefault();let y=L1(I.numericValue,I.unit,l),E=String(w1(y,I.unit,l)),B=D?{top:E,right:E,bottom:E,left:E}:{...v,[L]:E};H(B),I.unit!==h&&R(I.unit),T(B,I.unit)}},[D,v,h,f,c,l,T]),W=ze.useCallback(L=>{let x=v[L];if(x===""){let B=D?{top:"",right:"",bottom:"",left:""}:{...v,[L]:""};H(B),T(B,h);return}if(n&&ro(x)){let B="auto",U=D?{top:B,right:B,bottom:B,left:B}:{...v,[L]:B};H(U),T(U,h);return}let w=parseFloat(x);if(isNaN(w)){let B=yt(M.current);H(dr(B,h,f));return}let I=L1(w,h,l),y=String(w1(I,h,l)),E=D?{top:y,right:y,bottom:y,left:y}:{...v,[L]:y};H(E),T(E,h)},[v,D,h,f,l,T,n]),$=ze.useCallback((L,x)=>{if(x.key==="Enter"){x.currentTarget.blur();return}if(x.key==="ArrowUp"||x.key==="ArrowDown"){if(ro(v[L]))return;x.preventDefault();let w=Ao(v[L],x.key,x.shiftKey,h,l);if(w===null)return;let I=D?{top:w,right:w,bottom:w,left:w}:{...v,[L]:w};H(I),T(I,h)}},[v,D,h,l,T]),O=ze.useCallback(()=>{if(!D&&!cr(v)){let L=v.top,x={top:L,right:L,bottom:L,left:L};H(x),T(x,h)}q(L=>!L)},[D,v,h,T]),N=ze.useCallback(L=>{let x=L.target.value;if(!c.has(x))return;R(x);let w={top:"",right:"",bottom:"",left:""};for(let I of Mt){let y=v[I];if(ro(y))w[I]="auto";else if(y!==""){let E=parseFloat(y);if(isNaN(E))w[I]=y;else{let B=L1(E,x,l);w[I]=String(w1(B,x,l))}}else w[I]=""}H(w),T(w,x)},[v,c,l,T]);return Zo(c1,{label:e,id:a,className:"boxDimensionEditor-fieldset",children:[b1("div",{className:"boxDimensionEditor-header",children:b1("div",{className:"boxDimensionEditor-controls",children:b1("select",{className:"boxDimensionEditor-unit",value:h,onChange:N,"aria-label":_e(p.ariaUnit,[e]),children:r.map(L=>b1("option",{value:L.value,children:L.label},L.value))})})}),b1("div",{className:"boxDimensionEditor-grid",children:Mt.map((L,x)=>{let w=s&&s[x];return Zo("div",{className:"boxDimensionEditor-cell",children:[b1("label",{htmlFor:`${a}-${L}`,className:"boxDimensionEditor-label",children:C[x]}),Zo("div",{className:"boxDimensionEditor-input-row",children:[w&&b1("span",{className:"boxDimensionEditor-input-icon","aria-hidden":"true",children:b1(w,{size:12,width:12,height:12})}),b1("input",{id:`${a}-${L}`,type:"text",className:w?"boxDimensionEditor-input boxDimensionEditor-input--with-icon":"boxDimensionEditor-input",value:v[L],placeholder:m[L],onChange:I=>z(L,I.target.value),onPaste:I=>G(L,I),onBlur:()=>W(L),onKeyDown:I=>$(L,I),"aria-label":_e(p.ariaSide,[e,C[x]??""]),autoComplete:"off",spellCheck:"false"})]})]},L)})}),Zo("label",{className:"boxDimensionEditor-equal",children:[b1("input",{type:"checkbox",className:"boxDimensionEditor-equal-checkbox",checked:D,onChange:O}),b1("span",{className:"boxDimensionEditor-equal-label",children:p.makeEqual})]})]})}import{forwardRef as Os,createElement as Es}from"react";var Fo=(...e)=>e.filter((t,o,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===o).join(" ").trim();var F9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var $9=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,a)=>a?a.toUpperCase():o.toLowerCase());var fr=e=>{let t=$9(e);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Ds,createElement as q9}from"react";var N9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var U9=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var z9=Ds(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:r="",children:l,iconNode:n,...i},s)=>q9("svg",{ref:s,...N9,width:t,height:t,stroke:e,strokeWidth:a?Number(o)*24/Number(t):o,className:Fo("lucide",r),...!l&&!U9(i)&&{"aria-hidden":"true"},...i},[...n.map(([u,d])=>q9(u,d)),...Array.isArray(l)?l:[l]]));var j9=(e,t)=>{let o=Os(({className:a,...r},l)=>Es(z9,{ref:l,iconNode:t,className:Fo(`lucide-${F9(fr(e))}`,`lucide-${e}`,a),...r}));return o.displayName=fr(e),o};var Bs=[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]],no=j9("pipette",Bs);import Re from"react";import{useRef as qo,useCallback as je,useEffect as Lr,useMemo as zo,useState as wr,createContext as As,useContext as Zs}from"react";var K9={exports:{}},io={};var G9;function Fs(){if(G9)return io;G9=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(a,r,l){var n=null;if(l!==void 0&&(n=""+l),r.key!==void 0&&(n=""+r.key),"key"in r){l={};for(var i in r)i!=="key"&&(l[i]=r[i])}else l=r;return r=l.ref,{$$typeof:e,type:a,key:n,ref:r!==void 0?r:null,props:l}}return io.Fragment=t,io.jsx=o,io.jsxs=o,io}var W9;function $s(){return W9||(W9=1,K9.exports=Fs()),K9.exports}var Pe=$s();function r2(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=r2(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function Ns(){for(var e,t,o=0,a="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=r2(e))&&(a&&(a+=" "),a+=t);return a}var br="-",Us=e=>{let t=zs(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:r=>{let l=r.split(br);return l[0]===""&&l.length!==1&&l.shift(),l2(l,t)||qs(r)},getConflictingClassGroupIds:(r,l)=>{let n=o[r]||[];return l&&a[r]?[...n,...a[r]]:n}}},l2=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?l2(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let l=e.join(br);return t.validators.find(({validator:n})=>n(l))?.classGroupId},X9=/^\[(.+)\]$/,qs=e=>{if(X9.test(e)){let t=X9.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},zs=e=>{let{theme:t,classGroups:o}=e,a={nextPart:new Map,validators:[]};for(let r in o)mr(o[r],a,r,t);return a},mr=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let l=r===""?t:Q9(t,r);l.classGroupId=o;return}if(typeof r=="function"){if(js(r)){mr(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([l,n])=>{mr(n,Q9(t,l),o,a)})})},Q9=(e,t)=>{let o=e;return t.split(br).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},js=e=>e.isThemeGetter,Ks=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,r=(l,n)=>{o.set(l,n),t++,t>e&&(t=0,a=o,o=new Map)};return{get(l){let n=o.get(l);if(n!==void 0)return n;if((n=a.get(l))!==void 0)return r(l,n),n},set(l,n){o.has(l)?o.set(l,n):r(l,n)}}},hr="!",gr=":",Gs=gr.length,Ws=e=>{let{prefix:t,experimentalParseClassName:o}=e,a=r=>{let l=[],n=0,i=0,s=0,u;for(let f=0;f<r.length;f++){let c=r[f];if(n===0&&i===0){if(c===gr){l.push(r.slice(s,f)),s=f+Gs;continue}if(c==="/"){u=f;continue}}c==="["?n++:c==="]"?n--:c==="("?i++:c===")"&&i--}let d=l.length===0?r:r.substring(s),p=Xs(d),C=p!==d,g=u&&u>s?u-s:void 0;return{modifiers:l,hasImportantModifier:C,baseClassName:p,maybePostfixModifierPosition:g}};if(t){let r=t+gr,l=a;a=n=>n.startsWith(r)?l(n.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:n,maybePostfixModifierPosition:void 0}}if(o){let r=a;a=l=>o({className:l,parseClassName:r})}return a},Xs=e=>e.endsWith(hr)?e.substring(0,e.length-1):e.startsWith(hr)?e.substring(1):e,Qs=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;let a=[],r=[];return o.forEach(l=>{l[0]==="["||t[l]?(a.push(...r.sort(),l),r=[]):r.push(l)}),a.push(...r.sort()),a}},Ys=e=>({cache:Ks(e.cacheSize),parseClassName:Ws(e),sortModifiers:Qs(e),...Us(e)}),Js=/\s+/,eu=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:l}=t,n=[],i=e.trim().split(Js),s="";for(let u=i.length-1;u>=0;u-=1){let d=i[u],{isExternal:p,modifiers:C,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:c}=o(d);if(p){s=d+(s.length>0?" "+s:s);continue}let m=!!c,b=a(m?f.substring(0,c):f);if(!b){if(!m){s=d+(s.length>0?" "+s:s);continue}if(b=a(f),!b){s=d+(s.length>0?" "+s:s);continue}m=!1}let h=l(C).join(":"),R=g?h+hr:h,v=R+b;if(n.includes(v))continue;n.push(v);let H=r(b,m);for(let D=0;D<H.length;++D){let q=H[D];n.push(R+q)}s=d+(s.length>0?" "+s:s)}return s};function tu(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=n2(t))&&(a&&(a+=" "),a+=o);return a}var n2=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=n2(e[a]))&&(o&&(o+=" "),o+=t);return o};function ou(e,...t){let o,a,r,l=n;function n(s){let u=t.reduce((d,p)=>p(d),e());return o=Ys(u),a=o.cache.get,r=o.cache.set,l=i,i(s)}function i(s){let u=a(s);if(u)return u;let d=eu(s,o);return r(s,d),d}return function(){return l(tu.apply(null,arguments))}}var Be=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},i2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,s2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,au=/^\d+\/\d+$/,ru=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lu=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,iu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,su=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=e=>au.test(e),ce=e=>!!e&&!Number.isNaN(Number(e)),q1=e=>!!e&&Number.isInteger(Number(e)),pr=e=>e.endsWith("%")&&ce(e.slice(0,-1)),E1=e=>ru.test(e),uu=()=>!0,du=e=>lu.test(e)&&!nu.test(e),u2=()=>!1,cu=e=>iu.test(e),fu=e=>su.test(e),pu=e=>!j(e)&&!K(e),Cu=e=>Rt(e,f2,u2),j=e=>i2.test(e),ft=e=>Rt(e,p2,du),Cr=e=>Rt(e,xu,ce),Y9=e=>Rt(e,d2,u2),mu=e=>Rt(e,c2,fu),$o=e=>Rt(e,C2,cu),K=e=>s2.test(e),so=e=>kt(e,p2),hu=e=>kt(e,Lu),J9=e=>kt(e,d2),gu=e=>kt(e,f2),vu=e=>kt(e,c2),No=e=>kt(e,C2,!0),Rt=(e,t,o)=>{let a=i2.exec(e);return a?a[1]?t(a[1]):o(a[2]):!1},kt=(e,t,o=!1)=>{let a=s2.exec(e);return a?a[1]?t(a[1]):o:!1},d2=e=>e==="position"||e==="percentage",c2=e=>e==="image"||e==="url",f2=e=>e==="length"||e==="size"||e==="bg-size",p2=e=>e==="length",xu=e=>e==="number",Lu=e=>e==="family-name",C2=e=>e==="shadow",wu=()=>{let e=Be("color"),t=Be("font"),o=Be("text"),a=Be("font-weight"),r=Be("tracking"),l=Be("leading"),n=Be("breakpoint"),i=Be("container"),s=Be("spacing"),u=Be("radius"),d=Be("shadow"),p=Be("inset-shadow"),C=Be("text-shadow"),g=Be("drop-shadow"),f=Be("blur"),c=Be("perspective"),m=Be("aspect"),b=Be("ease"),h=Be("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],H=()=>[...v(),K,j],D=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],M=()=>[K,j,s],T=()=>[St,"full","auto",...M()],z=()=>[q1,"none","subgrid",K,j],G=()=>["auto",{span:["full",q1,K,j]},q1,K,j],W=()=>[q1,"auto",K,j],$=()=>["auto","min","max","fr",K,j],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...M()],x=()=>[St,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],w=()=>[e,K,j],I=()=>[...v(),J9,Y9,{position:[K,j]}],y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",gu,Cu,{size:[K,j]}],B=()=>[pr,so,ft],U=()=>["","none","full",u,K,j],A=()=>["",ce,so,ft],F=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>[ce,pr,J9,Y9],te=()=>["","none",f,K,j],le=()=>["none",ce,K,j],de=()=>["none",ce,K,j],S=()=>[ce,K,j],V=()=>[St,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[E1],breakpoint:[E1],color:[uu],container:[E1],"drop-shadow":[E1],ease:["in","out","in-out"],font:[pu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[E1],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[E1],shadow:[E1],spacing:["px",ce],text:[E1],"text-shadow":[E1],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",St,j,K,m]}],container:["container"],columns:[{columns:[ce,j,K,i]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:H()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[q1,"auto",K,j]}],basis:[{basis:[St,"full","auto",i,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ce,St,"auto","initial","none",j]}],grow:[{grow:["",ce,K,j]}],shrink:[{shrink:["",ce,K,j]}],order:[{order:[q1,"first","last","none",K,j]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...N(),"normal"]}],"justify-self":[{"justify-self":["auto",...N()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...N(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...N(),"baseline"]}],"place-self":[{"place-self":["auto",...N()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:x()}],w:[{w:[i,"screen",...x()]}],"min-w":[{"min-w":[i,"screen","none",...x()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[n]},...x()]}],h:[{h:["screen","lh",...x()]}],"min-h":[{"min-h":["screen","lh","none",...x()]}],"max-h":[{"max-h":["screen","lh",...x()]}],"font-size":[{text:["base",o,so,ft]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,K,Cr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pr,j]}],"font-family":[{font:[hu,j,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,K,j]}],"line-clamp":[{"line-clamp":[ce,"none",K,Cr]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",K,j]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",K,j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:[ce,"from-font","auto",K,ft]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[ce,"auto",K,j]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K,j]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",K,j]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:y()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},q1,K,j],radial:["",K,j],conic:[q1,K,j]},vu,mu]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...F(),"hidden","none"]}],"divide-style":[{divide:[...F(),"hidden","none"]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...F(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ce,K,j]}],"outline-w":[{outline:["",ce,so,ft]}],"outline-color":[{outline:w()}],shadow:[{shadow:["","none",d,No,$o]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":["none",p,No,$o]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[ce,ft]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":["none",C,No,$o]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[ce,K,j]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":k()}],"mask-image-linear-to-pos":[{"mask-linear-to":k()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":k()}],"mask-image-t-to-pos":[{"mask-t-to":k()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":k()}],"mask-image-r-to-pos":[{"mask-r-to":k()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":k()}],"mask-image-b-to-pos":[{"mask-b-to":k()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":k()}],"mask-image-l-to-pos":[{"mask-l-to":k()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":k()}],"mask-image-x-to-pos":[{"mask-x-to":k()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":k()}],"mask-image-y-to-pos":[{"mask-y-to":k()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[K,j]}],"mask-image-radial-from-pos":[{"mask-radial-from":k()}],"mask-image-radial-to-pos":[{"mask-radial-to":k()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":k()}],"mask-image-conic-to-pos":[{"mask-conic-to":k()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:y()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",K,j]}],filter:[{filter:["","none",K,j]}],blur:[{blur:te()}],brightness:[{brightness:[ce,K,j]}],contrast:[{contrast:[ce,K,j]}],"drop-shadow":[{"drop-shadow":["","none",g,No,$o]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:["",ce,K,j]}],"hue-rotate":[{"hue-rotate":[ce,K,j]}],invert:[{invert:["",ce,K,j]}],saturate:[{saturate:[ce,K,j]}],sepia:[{sepia:["",ce,K,j]}],"backdrop-filter":[{"backdrop-filter":["","none",K,j]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[ce,K,j]}],"backdrop-contrast":[{"backdrop-contrast":[ce,K,j]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ce,K,j]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ce,K,j]}],"backdrop-invert":[{"backdrop-invert":["",ce,K,j]}],"backdrop-opacity":[{"backdrop-opacity":[ce,K,j]}],"backdrop-saturate":[{"backdrop-saturate":[ce,K,j]}],"backdrop-sepia":[{"backdrop-sepia":["",ce,K,j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",K,j]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ce,"initial",K,j]}],ease:[{ease:["linear","initial",b,K,j]}],delay:[{delay:[ce,K,j]}],animate:[{animate:["none",h,K,j]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[c,K,j]}],"perspective-origin":[{"perspective-origin":H()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:S()}],"skew-x":[{"skew-x":S()}],"skew-y":[{"skew-y":S()}],transform:[{transform:[K,j,"","none","gpu","cpu"]}],"transform-origin":[{origin:H()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],accent:[{accent:w()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",K,j]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",K,j]}],fill:[{fill:["none",...w()]}],"stroke-w":[{stroke:[ce,so,ft,Cr]}],stroke:[{stroke:["none",...w()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},bu=ou(wu),Iu=(e,t,o)=>Math.min(Math.max(e,t),o),Uo=e=>Math.round(Iu(e,0,255)),m2=e=>{let t=e.replace("#",""),o=parseInt(t,16);return{r:o>>16&255,g:o>>8&255,b:o&255}},yu=({r:e,g:t,b:o})=>{let a=r=>Uo(r).toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(o)}`},vr=({h:e,s:t,v:o})=>{e=e/360,t=t/100,o=o/100;let a=Math.floor(e*6),r=e*6-a,l=o*(1-t),n=o*(1-r*t),i=o*(1-(1-r)*t),s,u,d;switch(a%6){case 0:s=o,u=i,d=l;break;case 1:s=n,u=o,d=l;break;case 2:s=l,u=o,d=i;break;case 3:s=l,u=n,d=o;break;case 4:s=i,u=l,d=o;break;case 5:s=o,u=l,d=n;break;default:s=u=d=0}return{r:Uo(s*255),g:Uo(u*255),b:Uo(d*255)}},xr=({r:e,g:t,b:o})=>{e/=255,t/=255,o/=255;let a=Math.max(e,t,o),r=Math.min(e,t,o),l=a-r,n=0,i=a===0?0:l/a,s=a;if(l!==0)switch(a){case e:n=((t-o)/l+(t<o?6:0))/6;break;case t:n=((o-e)/l+2)/6;break;case o:n=((e-t)/l+4)/6;break}return{h:Math.round(n*360),s:Math.round(i*100),v:Math.round(s*100)}},Mu=e=>yu(vr(e)),Su=e=>xr(m2(e));var e2=({h:e,s:t,v:o})=>{let a=o*(2-t/100)/2,r=a!==0&&a!==100?(o-a)/Math.min(a,100-a)*100:0;return{h:e,s:Math.round(r),l:Math.round(a)}},t2=({h:e,s:t,l:o})=>{let a=o+t*Math.min(o,100-o)/100,r=a===0?0:2*(1-o/a)*100;return{h:e,s:Math.round(r),v:Math.round(a)}},Ru=e=>{let{r:t,g:o,b:a}=m2(e);return(.299*t+.587*o+.114*a)/255>.5?"#000000":"#ffffff"};var ku=(e,t="hex")=>{switch(t){case"hex":return e.getHex();case"rgb":let o=e.getRgb();return`rgb(${o.r}, ${o.g}, ${o.b})`;case"rgba":let a=e.getRgba();return`rgba(${a.r}, ${a.g}, ${a.b}, ${a.a})`;case"hsl":let r=e.getHsl();return`hsl(${r.h}, ${r.s}%, ${r.l}%)`;case"hsla":let l=e.getHsla();return`hsla(${l.h}, ${l.s}%, ${l.l}%, ${l.a})`;default:jo()}};function Hu(e){switch(e.type){case"hex":return{...Su(e.value),a:1};case"rgb":return{...xr(e),a:1};case"rgba":return{...xr(e),a:e.a};case"hsl":return{...t2(e),a:1};case"hsla":return{...t2(e),a:1};case"hsv":return{...e,a:1};case"hsva":return{...e};default:jo()}}function z1(e,t){let o=Hu(e);switch(t){case"hex":return Mu(o);case"rgb":return vr(o);case"rgba":return{...vr(o),a:o.a};case"hsl":return e2(o);case"hsla":return{...e2(o),a:o.a};case"hsv":return{h:o.h,s:o.s,v:o.v};case"hsva":return o;default:jo()}}var pt=(...e)=>bu(Ns(e)),B1=(e,t,o)=>Math.min(Math.max(e,t),o),j1=e=>Math.round(e);function jo(e){throw new Error("You should never get here.")}var K1=class e{constructor(t){this.colorInput=t,typeof t=="string"?this.color={type:"hex",value:t}:"type"in t?this.color=t:"r"in t?"a"in t?this.color={type:"rgba",...t}:this.color={type:"rgb",...t}:"v"in t?"a"in t?this.color={type:"hsva",...t}:this.color={type:"hsv",...t}:"a"in t?this.color={type:"hsla",...t}:this.color={type:"hsl",...t}}getRgb(){return z1(this.color,"rgb")}getHsv(){return z1(this.color,"hsv")}getHsla(){return z1(this.color,"hsla")}getHsva(){return z1(this.color,"hsva")}getHex(){return z1(this.color,"hex")}getHsl(){return z1(this.color,"hsl")}getRgba(){return z1(this.color,"rgba")}format(t="hex"){return ku(this,t)}getContrastingColor(){return new e({type:"hex",value:Ru(this.getHex())})}},o2=(e,t)=>{let o=e.getBoundingClientRect(),a,r;if("touches"in t){let u=t.touches[0]||t.changedTouches[0];a=u.clientX,r=u.clientY}else a=t.clientX,r=t.clientY;let l=a-o.left,n=r-o.top,i=B1(l/o.width,0,1),s=B1(n/o.height,0,1);return{left:i,top:s}},Ir=({onMove:e,onMoveEnd:t,onKey:o,children:a,className:r,...l})=>{let n=qo(null),i=qo(!1),s=je(C=>{!i.current||!n.current||(C.preventDefault(),e(o2(n.current,C)))},[e]),u=je(()=>{i.current=!1,t(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,t]),d=je(C=>{let g=n.current;g&&(C.preventDefault(),i.current=!0,e(o2(g,C.nativeEvent)),document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",u))},[e,s,u]),p=je(C=>{if(!o)return;let g=C.which||C.keyCode;g<37||g>40||(C.preventDefault(),o({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},[o]);return Lr(()=>()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,u]),Pe.jsx("div",{ref:n,className:pt("rounded-inherit absolute inset-0 touch-none outline-none","focus:[&_.react-colorful-pointer]:scale-110",r),onTouchStart:d,onMouseDown:d,onKeyDown:p,tabIndex:0,role:"slider",...l,children:a})},yr=({className:e,top:t=.5,left:o,color:a})=>Pe.jsx("div",{className:pt("absolute z-[1] h-6 w-6 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-white bg-white active:cursor-grabbing","react-colorful-pointer shadow-[0_2px_8px_rgba(0,0,0,0.15)] transition-transform",e),style:{top:`${t*100}%`,left:`${o*100}%`}}),Pu=({hsva:e,onChange:t,className:o,onFinishedUpdates:a})=>{let r=je(s=>{t({a:s.left},!1)},[t]),l=je(s=>{t({a:B1(e.a+s.left,0,1)},!0)},[e.a,t]),n=zo(()=>new K1({type:"hsva",h:e.h,s:e.s,v:e.v,a:0}).format("hsla"),[e.h,e.s,e.v]),i=zo(()=>new K1({type:"hsva",h:e.h,s:e.s,v:e.v,a:1}).format("hsla"),[e.h,e.s,e.v]);return Pe.jsx("div",{className:pt("relative h-full w-full",o),children:Pe.jsxs(Ir,{onMove:r,onMoveEnd:a,onKey:l,"aria-label":"Alpha","aria-valuetext":`${j1(e.a*100)}%`,"aria-valuenow":j1(e.a*100),"aria-valuemin":0,"aria-valuemax":100,className:"h-full w-full rounded-lg",children:[Pe.jsx("div",{className:"absolute inset-0 rounded-lg bg-white",style:{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>')`}}),Pe.jsx("div",{className:"absolute inset-0 rounded-lg",style:{backgroundImage:`linear-gradient(90deg, ${n}, ${i})`}}),Pe.jsx(yr,{className:"z-[1]",top:.5,left:e.a,color:""})]})})},Tu=({hue:e,onChange:t,className:o,onFinishedUpdates:a})=>{let r=je(n=>{let i=j1(B1(360*n.left,0,360));t({h:i},!1)},[t]),l=je(n=>{t({h:B1(e+n.left*360,0,360)},!0)},[e,t]);return Pe.jsx("div",{className:pt("relative h-full w-full",o),children:Pe.jsxs(Ir,{onMove:r,onMoveEnd:a,onKey:l,"aria-label":"Hue","aria-valuenow":j1(e),"aria-valuemax":360,"aria-valuemin":0,className:"h-full w-full rounded-lg",children:[Pe.jsx("div",{className:"absolute inset-0 rounded-lg",style:{background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"}}),Pe.jsx(yr,{className:"z-[2]",top:.5,left:e/360,color:""})]})})},Vu=({hsva:e,onChange:t,className:o,onFinishedUpdates:a})=>{let r=je(i=>{let s=j1(B1(i.left*100,0,100)),u=j1(B1(100-i.top*100,0,100));t({s,v:u},!1)},[t]),l=je(i=>{t({s:B1(e.s+i.left*100,0,100),v:B1(e.v-i.top*100,0,100)},!0)},[e.s,e.v,t]),n=`hsl(${e.h}, 100%, 50%)`;return Pe.jsx("div",{className:pt("relative h-full w-full rounded-xl",o),children:Pe.jsxs(Ir,{onMove:r,onMoveEnd:a,onKey:l,"aria-label":"Color","aria-valuetext":`Saturation ${j1(e.s)}%, Brightness ${j1(e.v)}%`,className:"rounded-inherit h-full w-full",children:[Pe.jsx("div",{className:"rounded-inherit absolute inset-0 rounded-b-none",style:{backgroundColor:n,backgroundImage:"linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0))",boxShadow:"inset 0 0 0 1px rgba(0, 0, 0, 0.05)"}}),Pe.jsx(yr,{className:"z-[3]",top:1-e.v/100,left:e.s/100,color:""})]})})},h2=As(null),Ko=()=>{let e=Zs(h2);if(!e)throw new Error("ColorPicker compound components must be used within a ColorPicker");return e};function a2(e){return"type"in e?new K1(e):e}var _u=({color:e,onChange:t,className:o,children:a,defaultColor:r,...l})=>{let[n,i]=wr(a2(e??r??{h:340,s:58,v:100,a:1,type:"hsva"})),s=qo(!1),u=qo(n);Lr(()=>{!s.current&&e&&(u.current=a2(e),i(u.current))},[e]);let d=je((f,c)=>{let m=new K1({type:"hsva",...u.current.getHsva(),...f});u.current=m,i(m),s.current=!c,t?.(m)},[t]),p=je(()=>{s.current=!1},[]),C=je(async()=>{if(!("EyeDropper"in window)){console.log("EyeDropper API not supported");return}try{let f=await new window.EyeDropper().open();f.sRGBHex&&d(z1({type:"hex",value:f.sRGBHex},"hsva"),!0)}catch(f){console.log("EyeDropper cancelled or failed:",f)}},[t]),g={hsva:n.getHsva(),updateHsva:d,handleEyeDropper:C,onFinishedUpdates:p};return Pe.jsx(h2.Provider,{value:g,children:Pe.jsx("div",{...l,className:pt("relative flex h-[280px] w-[280px] cursor-default flex-col rounded-2xl bg-white shadow-lg select-none",o),children:a})})},Du=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:a}=Ko(),r=je((l,n)=>{o(l,n)},[o]);return Pe.jsx(Vu,{hsva:t,onChange:r,className:e,onFinishedUpdates:a})},Ou=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:a}=Ko(),r=je((l,n)=>{o(l,n)},[o]);return Pe.jsx(Tu,{hue:t.h,onChange:r,className:e,onFinishedUpdates:a})},Eu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:a}=Ko(),r=je((l,n)=>{o(l,n)},[o]);return Pe.jsx(Pu,{hsva:t,onChange:r,className:e,onFinishedUpdates:a})},Bu=({className:e,title:t="Pick color from screen",children:o})=>{let{handleEyeDropper:a}=Ko(),[r,l]=wr(!1);return Lr(()=>{typeof window<"u"&&"EyeDropper"in window&&l(!0)},[]),r?Pe.jsx("button",{onClick:a,className:pt("flex h-10 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors hover:bg-gray-100",e),title:t,children:o}):null},Ht=Object.assign(_u,{Saturation:Du,Hue:Ou,Alpha:Eu,EyeDropper:Bu});function Au(e,t){switch(t){case"hex":return{type:"hex",value:e.getHex()};case"rgb":return{type:"rgb",...e.getRgb()};case"rgba":return{type:"rgba",...e.getRgba()};case"hsl":return{type:"hsl",...e.getHsl()};case"hsla":return{type:"hsla",...e.getHsla()};case"hsv":return{type:"hsv",...e.getHsv()};case"hsva":return{type:"hsva",...e.getHsva()};default:jo()}}var g2=(e={type:"hex",value:"#ff6b9d"})=>{let[t,o]=wr(()=>{let n=typeof e=="function"?e():e;return{color:new K1(n),type:n.type}}),a=zo(()=>Au(t.color,t.type),[t.color,t.type]),r=zo(()=>{let n=t.color.getHsva();return{hex:t.color.getHex(),rgb:t.color.getRgb(),rgba:t.color.getRgba(),hsl:t.color.getHsl(),hsla:t.color.getHsla(),hsv:t.color.getHsv(),hsva:n,alpha:n.a}},[t.color]),l=je(n=>{try{let i="type"in n?new K1(n):n;o(s=>({color:i,type:s.type}))}catch(i){console.warn("Invalid color input:",n,i)}},[]);return[{colorInput:a,colorState:r},l]};import{createPortal as x7}from"react-dom";import{useRef as I1,useMemo as Zu,useEffect as Fu,useState as o6,useCallback as a6}from"react";function v2(e,t,o,a){var r=this,l=I1(null),n=I1(0),i=I1(0),s=I1(null),u=I1([]),d=I1(),p=I1(),C=I1(e),g=I1(!0),f=I1(),c=I1();C.current=e;var m=typeof window<"u",b=!t&&t!==0&&m;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var h=!!(o=o||{}).leading,R=!("trailing"in o)||!!o.trailing,v=!!o.flushOnExit&&R,H="maxWait"in o,D="debounceOnServer"in o&&!!o.debounceOnServer,q=H?Math.max(+o.maxWait||0,t):null,M=Zu(function(){var T=function(L){var x=u.current,w=d.current;return u.current=d.current=null,n.current=L,i.current=i.current||L,p.current=C.current.apply(w,x)},z=function(L,x){b&&cancelAnimationFrame(s.current),s.current=b?requestAnimationFrame(L):setTimeout(L,x)},G=function(L){if(!g.current)return!1;var x=L-l.current;return!l.current||x>=t||x<0||H&&L-n.current>=q},W=function(L){return s.current=null,R&&u.current?T(L):(u.current=d.current=null,p.current)},$=function L(){var x=Date.now();if(h&&i.current===n.current&&O(),G(x))return W(x);if(g.current){var w=t-(x-l.current),I=H?Math.min(w,q-(x-n.current)):w;z(L,I)}},O=function(){a&&a({})},N=function(){if(m||D){var L,x=Date.now(),w=G(x);if(u.current=[].slice.call(arguments),d.current=r,l.current=x,v&&!f.current&&(f.current=function(){var I;((I=globalThis.document)==null?void 0:I.visibilityState)==="hidden"&&c.current.flush()},(L=globalThis.document)==null||L.addEventListener==null||L.addEventListener("visibilitychange",f.current)),w){if(!s.current&&g.current)return n.current=l.current,z($,t),h?T(l.current):p.current;if(H)return z($,t),T(l.current)}return s.current||z($,t),p.current}};return N.cancel=function(){var L=s.current;L&&(b?cancelAnimationFrame(s.current):clearTimeout(s.current)),n.current=0,u.current=l.current=d.current=s.current=null,L&&a&&a({})},N.isPending=function(){return!!s.current},N.flush=function(){return s.current?W(Date.now()):p.current},N},[h,H,t,q,R,v,b,m,D,a]);return c.current=M,Fu(function(){return g.current=!0,function(){var T;v&&c.current.flush(),f.current&&((T=globalThis.document)==null||T.removeEventListener==null||T.removeEventListener("visibilitychange",f.current),f.current=null),g.current=!1}},[v]),M}import Ge from"react";function Ct(e){let t=e?.parentNode;for(;t;){if(t instanceof ShadowRoot){t=t.host;continue}if(t instanceof HTMLElement){let{overflowY:o}=getComputedStyle(t);if(o==="auto"||o==="scroll")return t}t=t.parentNode}return null}var x2='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function L2({computePosition:e,onClose:t,autoFocus:o=!0,trapFocus:a=!1}={}){let[r,l]=Ge.useState(!1),[n,i]=Ge.useState({top:0,left:0}),s=Ge.useRef(null),u=Ge.useRef(null),d=Ge.useRef(!1),p=Ge.useRef(e);p.current=e;let C=Ge.useRef(t);C.current=t;let g=Ge.useRef(a);g.current=a;let f=Ge.useCallback((...h)=>{!s.current||!p.current||i(p.current(s.current,...h))},[]),c=Ge.useCallback(()=>{f(),d.current=!0,l(!0)},[f]),m=Ge.useCallback(()=>{C.current&&C.current(),d.current=!1,l(!1),s.current?.focus()},[]),b=Ge.useCallback(()=>{d.current?m():c()},[c,m]);return Ge.useEffect(()=>{if(!r)return;let h=v=>{if(v.key==="Escape"&&(v.preventDefault(),m()),g.current&&v.key==="Tab"){let H=u.current;if(!H)return;let D=Array.from(H.querySelectorAll(x2)).filter(T=>!T.hasAttribute("disabled")),q=D[0],M=D.at(-1);if(!q||!M)return;v.shiftKey&&document.activeElement===q?(v.preventDefault(),M.focus()):!v.shiftKey&&document.activeElement===M&&(v.preventDefault(),q.focus())}},R=v=>{let H=u.current,D=s.current;if(!H||!D)return;let q=typeof v.composedPath=="function"?v.composedPath():[],M=q.includes(H)||v.target instanceof Node&&H.contains(v.target),T=q.includes(D)||v.target instanceof Node&&D.contains(v.target);!M&&!T&&m()};return document.addEventListener("keydown",h),document.addEventListener("mousedown",R),document.addEventListener("touchstart",R),()=>{document.removeEventListener("keydown",h),document.removeEventListener("mousedown",R),document.removeEventListener("touchstart",R)}},[r,m]),Ge.useEffect(()=>{if(!r||!o||!u.current)return;let h=u.current.querySelector(x2);h&&h.focus()},[r,o]),Ge.useEffect(()=>{if(!r||!s.current)return;let h=Ct(s.current);if(!h)return;let R=()=>m();return h.addEventListener("scroll",R,{passive:!0}),()=>h.removeEventListener("scroll",R)},[r,m]),{isOpen:r,open:c,close:m,toggle:b,triggerRef:s,popoverRef:u,position:n,reposition:f}}var $u=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},Go=$u;var Nu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},w2=Nu;var Uu=e=>Go(w2[e.toLowerCase()],6),b2=Uu;var qu=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,zu=e=>{let t;return(t=e.match(qu))?Go(parseInt(t[1],16),t[1].length):void 0},I2=zu;var We="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",h6=`(?:${We}|none)`,mt=`${We}%`,g6=`(?:${We}%|none)`,uo=`(?:${We}%|${We})`,ju=`(?:${We}%|${We}|none)`,y2=`(?:${We}(deg|grad|rad|turn)|${We})`,v6=`(?:${We}(deg|grad|rad|turn)|${We}|none)`,G1="\\s*,\\s*";var x6=new RegExp("^"+ju+"$");var Ku=new RegExp(`^rgba?\\(\\s*${We}${G1}${We}${G1}${We}\\s*(?:,\\s*${uo}\\s*)?\\)$`),Gu=new RegExp(`^rgba?\\(\\s*${mt}${G1}${mt}${G1}${mt}\\s*(?:,\\s*${uo}\\s*)?\\)$`),Wu=e=>{let t={mode:"rgb"},o;if(o=e.match(Ku))o[1]!==void 0&&(t.r=o[1]/255),o[2]!==void 0&&(t.g=o[2]/255),o[3]!==void 0&&(t.b=o[3]/255);else if(o=e.match(Gu))o[1]!==void 0&&(t.r=o[1]/100),o[2]!==void 0&&(t.g=o[2]/100),o[3]!==void 0&&(t.b=o[3]/100);else return;return o[4]!==void 0?t.alpha=Math.max(0,Math.min(1,o[4]/100)):o[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+o[5]))),t},M2=Wu;var Xu=(e,t)=>e===void 0?void 0:typeof e!="object"?ht(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,Wo=Xu;var Qu=(e="rgb")=>t=>(t=Wo(t,e))!==void 0?t.mode===e?t:y1[t.mode][e]?y1[t.mode][e](t):e==="rgb"?y1[t.mode].rgb(t):y1.rgb[e](y1[t.mode].rgb(t)):void 0,i1=Qu;var y1={},S2={},co=[],Mr={},Yu=e=>e,ve=e=>(y1[e.mode]={...y1[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{y1[t]||(y1[t]={}),y1[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=Yu)}),S2[e.mode]=e,(e.parse||[]).forEach(t=>{Ju(t,e.mode)}),i1(e.mode)),Xo=e=>S2[e],Ju=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Mr[e]=t}else typeof e=="function"&&co.indexOf(e)<0&&co.push(e)};var Sr=/[^\x00-\x7F]|[a-zA-Z_]/,ed=/[^\x00-\x7F]|[-\w]/,P={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},ae=0;function Qo(e){let t=e[ae],o=e[ae+1];return t==="-"||t==="+"?/\d/.test(o)||o==="."&&/\d/.test(e[ae+2]):t==="."?/\d/.test(o):/\d/.test(t)}function Rr(e){if(ae>=e.length)return!1;let t=e[ae];if(Sr.test(t))return!0;if(t==="-"){if(e.length-ae<2)return!1;let o=e[ae+1];return!!(o==="-"||Sr.test(o))}return!1}var td={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function fo(e){let t="";if((e[ae]==="-"||e[ae]==="+")&&(t+=e[ae++]),t+=Yo(e),e[ae]==="."&&/\d/.test(e[ae+1])&&(t+=e[ae++]+Yo(e)),(e[ae]==="e"||e[ae]==="E")&&((e[ae+1]==="-"||e[ae+1]==="+")&&/\d/.test(e[ae+2])?t+=e[ae++]+e[ae++]+Yo(e):/\d/.test(e[ae+1])&&(t+=e[ae++]+Yo(e))),Rr(e)){let o=Jo(e);return o==="deg"||o==="rad"||o==="turn"||o==="grad"?{type:P.Hue,value:t*td[o]}:void 0}return e[ae]==="%"?(ae++,{type:P.Percentage,value:+t}):{type:P.Number,value:+t}}function Yo(e){let t="";for(;/\d/.test(e[ae]);)t+=e[ae++];return t}function Jo(e){let t="";for(;ae<e.length&&ed.test(e[ae]);)t+=e[ae++];return t}function od(e){let t=Jo(e);return e[ae]==="("?(ae++,{type:P.Function,value:t}):t==="none"?{type:P.None,value:void 0}:{type:P.Ident,value:t}}function ad(e=""){let t=e.trim(),o=[],a;for(ae=0;ae<t.length;){if(a=t[ae++],a===`
2
+ `||a===" "||a===" "){for(;ae<t.length&&(t[ae]===`
3
+ `||t[ae]===" "||t[ae]===" ");)ae++;continue}if(a===",")return;if(a===")"){o.push({type:P.ParenClose});continue}if(a==="+"){if(ae--,Qo(t)){o.push(fo(t));continue}return}if(a==="-"){if(ae--,Qo(t)){o.push(fo(t));continue}if(Rr(t)){o.push({type:P.Ident,value:Jo(t)});continue}return}if(a==="."){if(ae--,Qo(t)){o.push(fo(t));continue}return}if(a==="/"){for(;ae<t.length&&(t[ae]===`
4
+ `||t[ae]===" "||t[ae]===" ");)ae++;let r;if(Qo(t)&&(r=fo(t),r.type!==P.Hue)){o.push({type:P.Alpha,value:r});continue}if(Rr(t)&&Jo(t)==="none"){o.push({type:P.Alpha,value:{type:P.None,value:void 0}});continue}return}if(/\d/.test(a)){ae--,o.push(fo(t));continue}if(Sr.test(a)){ae--,o.push(od(t));continue}return}return o}function rd(e){e._i=0;let t=e[e._i++];if(!t||t.type!==P.Function||t.value!=="color"||(t=e[e._i++],t.type!==P.Ident))return;let o=Mr[t.value];if(!o)return;let a={mode:o},r=R2(e,!1);if(!r)return;let l=Xo(o).channels;for(let n=0,i,s;n<l.length;n++)i=r[n],s=l[n],i.type!==P.None&&(a[s]=i.type===P.Number?i.value:i.value/100,s==="alpha"&&(a[s]=Math.max(0,Math.min(1,a[s]))));return a}function R2(e,t){let o=[],a;for(;e._i<e.length;){if(a=e[e._i++],a.type===P.None||a.type===P.Number||a.type===P.Alpha||a.type===P.Percentage||t&&a.type===P.Hue){o.push(a);continue}if(a.type===P.ParenClose){if(e._i<e.length)return;continue}return}if(!(o.length<3||o.length>4)){if(o.length===4){if(o[3].type!==P.Alpha)return;o[3]=o[3].value}return o.length===3&&o.push({type:P.None,value:void 0}),o.every(r=>r.type!==P.Alpha)?o:void 0}}function ld(e,t){e._i=0;let o=e[e._i++];if(!o||o.type!==P.Function)return;let a=R2(e,t);if(a)return a.unshift(o.value),a}var nd=e=>{if(typeof e!="string")return;let t=ad(e),o=t?ld(t,!0):void 0,a,r=0,l=co.length;for(;r<l;)if((a=co[r++](e,o))!==void 0)return a;return t?rd(t):void 0},ht=nd;function id(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let o={mode:"rgb"},[,a,r,l,n]=t;if(!(a.type===P.Hue||r.type===P.Hue||l.type===P.Hue))return a.type!==P.None&&(o.r=a.type===P.Number?a.value/255:a.value/100),r.type!==P.None&&(o.g=r.type===P.Number?r.value/255:r.value/100),l.type!==P.None&&(o.b=l.type===P.Number?l.value/255:l.value/100),n.type!==P.None&&(o.alpha=Math.min(1,Math.max(0,n.type===P.Number?n.value:n.value/100))),o}var k2=id;var sd=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,H2=sd;var P2=(e,t,o)=>e+o*(t-e);var ud=e=>{let t=[];for(let o=0;o<e.length-1;o++){let a=e[o],r=e[o+1];a===void 0&&r===void 0?t.push(void 0):a!==void 0&&r!==void 0?t.push([a,r]):t.push(a!==void 0?[a,a]:[r,r])}return t},T2=e=>t=>{let o=ud(t);return a=>{let r=a*o.length,l=a>=1?o.length-1:Math.max(Math.floor(r),0),n=o[l];return n===void 0?void 0:e(n[0],n[1],r-l)}};var _=T2(P2);var fe=e=>{let t=!1,o=e.map(a=>a!==void 0?(t=!0,a):1);return t?o:e};var dd={mode:"rgb",channels:["r","g","b","alpha"],parse:[k2,I2,M2,b2,H2,"srgb"],serialize:"srgb",interpolate:{r:_,g:_,b:_,alpha:{use:_,fixup:fe}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},p1=dd;var kr=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),cd=e=>{let t=kr(e.r),o=kr(e.g),a=kr(e.b),r={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*o+.1882286462349947*a,y:.297344975250536*t+.6273635662554661*o+.0752914584939979*a,z:.0270313613864123*t+.0706888525358272*o+.9913375368376386*a};return e.alpha!==void 0&&(r.alpha=e.alpha),r},Hr=cd;var Pr=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),fd=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"a98",r:Pr(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*o),g:Pr(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*o),b:Pr(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*o)};return a!==void 0&&(r.alpha=a),r},Tr=fd;var Vr=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},pd=({r:e,g:t,b:o,alpha:a})=>{let r={mode:"lrgb",r:Vr(e),g:Vr(t),b:Vr(o)};return a!==void 0&&(r.alpha=a),r},C1=pd;var Cd=e=>{let{r:t,g:o,b:a,alpha:r}=C1(e),l={mode:"xyz65",x:.4123907992659593*t+.357584339383878*o+.1804807884018343*a,y:.2126390058715102*t+.715168678767756*o+.0721923153607337*a,z:.0193308187155918*t+.119194779794626*o+.9505321522496607*a};return r!==void 0&&(l.alpha=r),l},e1=Cd;var _r=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},md=({r:e,g:t,b:o,alpha:a},r="rgb")=>{let l={mode:r,r:_r(e),g:_r(t),b:_r(o)};return a!==void 0&&(l.alpha=a),l},m1=md;var hd=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=m1({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*o,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*o,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*o});return a!==void 0&&(r.alpha=a),r},t1=hd;var gd={...p1,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Tr(e1(e)),xyz65:Tr},toMode:{rgb:e=>t1(Hr(e)),xyz65:Hr}},V2=gd;var vd=e=>(e=e%360)<0?e+360:e,be=vd;var xd=(e,t)=>e.map((o,a,r)=>{if(o===void 0)return o;let l=be(o);return a===0||e[a-1]===void 0?l:t(l-be(r[a-1]))}).reduce((o,a)=>!o.length||a===void 0||o[o.length-1]===void 0?(o.push(a),o):(o.push(a+o[o.length-1]),o),[]),Ze=e=>xd(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var De=[-.14861,1.78277,-.29227,-.90649,1.97294,0],_2=Math.PI/180,D2=180/Math.PI;var O2=De[3]*De[4],E2=De[1]*De[4],B2=De[1]*De[2]-De[0]*De[3],Ld=({r:e,g:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(B2*o+e*O2-t*E2)/(B2+O2-E2),l=o-r,n=(De[4]*(t-r)-De[2]*l)/De[3],i={mode:"cubehelix",l:r,s:r===0||r===1?void 0:Math.sqrt(l*l+n*n)/(De[4]*r*(1-r))};return i.s&&(i.h=Math.atan2(n,l)*D2-120),a!==void 0&&(i.alpha=a),i},A2=Ld;var wd=({h:e,s:t,l:o,alpha:a})=>{let r={mode:"rgb"};e=(e===void 0?0:e+120)*_2,o===void 0&&(o=0);let l=t===void 0?0:t*o*(1-o),n=Math.cos(e),i=Math.sin(e);return r.r=o+l*(De[0]*n+De[1]*i),r.g=o+l*(De[2]*n+De[3]*i),r.b=o+l*(De[4]*n+De[5]*i),a!==void 0&&(r.alpha=a),r},Z2=wd;var W1=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let o=be(e.h),a=be(t.h),r=Math.sin((a-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*r},F2=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let o=be(e.h),a=be(t.h);return Math.abs(a-o)>180?o-(a-360*Math.sign(a-o)):a-o},X1=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let o=be(e.h),a=be(t.h),r=Math.sin((a-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*r};var Fe=e=>{let t=e.reduce((a,r)=>{if(r!==void 0){let l=r*Math.PI/180;a.sin+=Math.sin(l),a.cos+=Math.cos(l)}return a},{sin:0,cos:0}),o=Math.atan2(t.sin,t.cos)*180/Math.PI;return o<0?360+o:o};var bd={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:A2},toMode:{rgb:Z2},interpolate:{h:{use:_,fixup:Ze},s:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:W1},average:{h:Fe}},$2=bd;var Id=({l:e,a:t,b:o,alpha:a},r="lch")=>{t===void 0&&(t=0),o===void 0&&(o=0);let l=Math.sqrt(t*t+o*o),n={mode:r,l:e,c:l};return l&&(n.h=be(Math.atan2(o,t)*180/Math.PI)),a!==void 0&&(n.alpha=a),n},s1=Id;var yd=({l:e,c:t,h:o,alpha:a},r="lab")=>{o===void 0&&(o=0);let l={mode:r,l:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return a!==void 0&&(l.alpha=a),l},u1=yd;var ea=Math.pow(29,3)/Math.pow(3,3),ta=Math.pow(6,3)/Math.pow(29,3);var Se={X:.9642956764295677,Y:1,Z:.8251046025104602},Q1={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},Vp=Math.pow(29,3)/Math.pow(3,3),_p=Math.pow(6,3)/Math.pow(29,3);var Dr=e=>Math.pow(e,3)>ta?Math.pow(e,3):(116*e-16)/ea,Md=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(e+16)/116,l=t/500+r,n=r-o/200,i={mode:"xyz65",x:Dr(l)*Q1.X,y:Dr(r)*Q1.Y,z:Dr(n)*Q1.Z};return a!==void 0&&(i.alpha=a),i},oa=Md;var Sd=e=>t1(oa(e)),Y1=Sd;var Or=e=>e>ta?Math.cbrt(e):(ea*e+16)/116,Rd=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Or(e/Q1.X),l=Or(t/Q1.Y),n=Or(o/Q1.Z),i={mode:"lab65",l:116*l-16,a:500*(r-l),b:200*(l-n)};return a!==void 0&&(i.alpha=a),i},aa=Rd;var kd=e=>{let t=aa(e1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},J1=kd;var gt=.14444444444444443*Math.PI,Pt=Math.cos(gt),Tt=Math.sin(gt),ra=100/Math.log(139/100);var Hd=({l:e,c:t,h:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"lab65",l:(Math.exp(e*1/ra)-1)/.0039},l=(Math.exp(.0435*t*1*1)-1)/.075,n=l*Math.cos(o/180*Math.PI-gt),i=l*Math.sin(o/180*Math.PI-gt);return r.a=n*Pt-i/.83*Tt,r.b=n*Tt+i/.83*Pt,a!==void 0&&(r.alpha=a),r},Co=Hd;var Pd=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=t*Pt+o*Tt,l=.83*(o*Pt-t*Tt),n=Math.sqrt(r*r+l*l),i={mode:"dlch",l:ra/1*Math.log(1+.0039*e),c:Math.log(1+.075*n)/(.0435*1*1)};return i.c&&(i.h=be((Math.atan2(l,r)+gt)/Math.PI*180)),a!==void 0&&(i.alpha=a),i},mo=Pd;var N2=e=>Co(s1(e,"dlch")),U2=e=>u1(mo(e),"dlab"),Td={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:N2,rgb:e=>Y1(N2(e))},fromMode:{lab65:U2,rgb:e=>U2(J1(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:_,a:_,b:_,alpha:{use:_,fixup:fe}}},q2=Td;var Vd={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Co,dlab:e=>u1(e,"dlab"),rgb:e=>Y1(Co(e))},fromMode:{lab65:mo,dlab:e=>s1(e,"dlch"),rgb:e=>mo(J1(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:_,c:_,h:{use:_,fixup:Ze},alpha:{use:_,fixup:fe}},difference:{h:X1},average:{h:Fe}},z2=Vd;function Br({h:e,s:t,i:o,alpha:a}){e=be(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:o*(1+t*(3/(2-r)-1)),g:o*(1+t*(3*(1-r)/(2-r)-1)),b:o*(1-t)};break;case 1:l={r:o*(1+t*(3*(1-r)/(2-r)-1)),g:o*(1+t*(3/(2-r)-1)),b:o*(1-t)};break;case 2:l={r:o*(1-t),g:o*(1+t*(3/(2-r)-1)),b:o*(1+t*(3*(1-r)/(2-r)-1))};break;case 3:l={r:o*(1-t),g:o*(1+t*(3*(1-r)/(2-r)-1)),b:o*(1+t*(3/(2-r)-1))};break;case 4:l={r:o*(1+t*(3*(1-r)/(2-r)-1)),g:o*(1-t),b:o*(1+t*(3/(2-r)-1))};break;case 5:l={r:o*(1+t*(3/(2-r)-1)),g:o*(1-t),b:o*(1+t*(3*(1-r)/(2-r)-1))};break;default:l={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return l.mode="rgb",a!==void 0&&(l.alpha=a),l}function Ar({r:e,g:t,b:o,alpha:a}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.max(e,t,o),l=Math.min(e,t,o),n={mode:"hsi",s:e+t+o===0?0:1-3*l/(e+t+o),i:(e+t+o)/3};return r-l!==0&&(n.h=(r===e?(t-o)/(r-l)+(t<o)*6:r===t?(o-e)/(r-l)+2:(e-t)/(r-l)+4)*60),a!==void 0&&(n.alpha=a),n}var _d={mode:"hsi",toMode:{rgb:Br},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Ar},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:_,fixup:Ze},s:_,i:_,alpha:{use:_,fixup:fe}},difference:{h:W1},average:{h:Fe}},j2=_d;function Zr({h:e,s:t,l:o,alpha:a}){e=be(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let r=o+t*(o<.5?o:1-o),l=r-(r-o)*2*Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r,g:l,b:2*o-r};break;case 1:n={r:l,g:r,b:2*o-r};break;case 2:n={r:2*o-r,g:r,b:l};break;case 3:n={r:2*o-r,g:l,b:r};break;case 4:n={r:l,g:2*o-r,b:r};break;case 5:n={r,g:2*o-r,b:l};break;default:n={r:2*o-r,g:2*o-r,b:2*o-r}}return n.mode="rgb",a!==void 0&&(n.alpha=a),n}function Fr({r:e,g:t,b:o,alpha:a}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.max(e,t,o),l=Math.min(e,t,o),n={mode:"hsl",s:r===l?0:(r-l)/(1-Math.abs(r+l-1)),l:.5*(r+l)};return r-l!==0&&(n.h=(r===e?(t-o)/(r-l)+(t<o)*6:r===t?(o-e)/(r-l)+2:(e-t)/(r-l)+4)*60),a!==void 0&&(n.alpha=a),n}var Dd=(e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},K2=Dd;var Od=new RegExp(`^hsla?\\(\\s*${y2}${G1}${mt}${G1}${mt}\\s*(?:,\\s*${uo}\\s*)?\\)$`),Ed=e=>{let t=e.match(Od);if(!t)return;let o={mode:"hsl"};return t[3]!==void 0?o.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(o.h=K2(t[1],t[2])),t[4]!==void 0&&(o.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(o.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?o.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(o.alpha=Math.max(0,Math.min(1,+t[7]))),o},G2=Ed;function Bd(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let o={mode:"hsl"},[,a,r,l,n]=t;if(a.type!==P.None){if(a.type===P.Percentage)return;o.h=a.value}if(r.type!==P.None){if(r.type===P.Hue)return;o.s=r.value/100}if(l.type!==P.None){if(l.type===P.Hue)return;o.l=l.value/100}return n.type!==P.None&&(o.alpha=Math.min(1,Math.max(0,n.type===P.Number?n.value:n.value/100))),o}var W2=Bd;var Ad={mode:"hsl",toMode:{rgb:Zr},fromMode:{rgb:Fr},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[W2,G2],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:_,fixup:Ze},s:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:W1},average:{h:Fe}},la=Ad;function ho({h:e,s:t,v:o,alpha:a}){e=be(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:o,g:o*(1-t*r),b:o*(1-t)};break;case 1:l={r:o*(1-t*r),g:o,b:o*(1-t)};break;case 2:l={r:o*(1-t),g:o,b:o*(1-t*r)};break;case 3:l={r:o*(1-t),g:o*(1-t*r),b:o};break;case 4:l={r:o*(1-t*r),g:o*(1-t),b:o};break;case 5:l={r:o,g:o*(1-t),b:o*(1-t*r)};break;default:l={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return l.mode="rgb",a!==void 0&&(l.alpha=a),l}function go({r:e,g:t,b:o,alpha:a}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.max(e,t,o),l=Math.min(e,t,o),n={mode:"hsv",s:r===0?0:1-l/r,v:r};return r-l!==0&&(n.h=(r===e?(t-o)/(r-l)+(t<o)*6:r===t?(o-e)/(r-l)+2:(e-t)/(r-l)+4)*60),a!==void 0&&(n.alpha=a),n}var Zd={mode:"hsv",toMode:{rgb:ho},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:go},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:_,fixup:Ze},s:_,v:_,alpha:{use:_,fixup:fe}},difference:{h:W1},average:{h:Fe}},na=Zd;function $r({h:e,w:t,b:o,alpha:a}){if(t===void 0&&(t=0),o===void 0&&(o=0),t+o>1){let r=t+o;t/=r,o/=r}return ho({h:e,s:o===1?1:1-t/(1-o),v:1-o,alpha:a})}function Nr(e){let t=go(e);if(t===void 0)return;let o=t.s!==void 0?t.s:0,a=t.v!==void 0?t.v:0,r={mode:"hwb",w:(1-o)*a,b:1-a};return t.h!==void 0&&(r.h=t.h),t.alpha!==void 0&&(r.alpha=t.alpha),r}function Fd(e,t){if(!t||t[0]!=="hwb")return;let o={mode:"hwb"},[,a,r,l,n]=t;if(a.type!==P.None){if(a.type===P.Percentage)return;o.h=a.value}if(r.type!==P.None){if(r.type===P.Hue)return;o.w=r.value/100}if(l.type!==P.None){if(l.type===P.Hue)return;o.b=l.value/100}return n.type!==P.None&&(o.alpha=Math.min(1,Math.max(0,n.type===P.Number?n.value:n.value/100))),o}var X2=Fd;var $d={mode:"hwb",toMode:{rgb:$r},fromMode:{rgb:Nr},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[X2],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:_,fixup:Ze},w:_,b:_,alpha:{use:_,fixup:fe}},difference:{h:F2},average:{h:Fe}},Q2=$d;var Vt=.1593017578125,Y2=78.84375,_t=.8359375,Dt=18.8515625,Ot=18.6875;function ia(e){if(e<0)return 0;let t=Math.pow(e,1/Y2);return 1e4*Math.pow(Math.max(0,t-_t)/(Dt-Ot*t),1/Vt)}function sa(e){if(e<0)return 0;let t=Math.pow(e/1e4,Vt);return Math.pow((_t+Dt*t)/(1+Ot*t),Y2)}var Ur=e=>Math.max(e/203,0),Ud=({i:e,t,p:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=ia(e+.008609037037932761*t+.11102962500302593*o),l=ia(e-.00860903703793275*t-.11102962500302599*o),n=ia(e+.5600313357106791*t-.32062717498731885*o),i={mode:"xyz65",x:Ur(2.070152218389422*r-1.3263473389671556*l+.2066510476294051*n),y:Ur(.3647385209748074*r+.680566024947227*l-.0453045459220346*n),z:Ur(-.049747207535812*r-.0492609666966138*l+1.1880659249923042*n)};return a!==void 0&&(i.alpha=a),i},qr=Ud;var zr=(e=0)=>Math.max(e*203,0),qd=({x:e,y:t,z:o,alpha:a})=>{let r=zr(e),l=zr(t),n=zr(o),i=sa(.3592832590121217*r+.6976051147779502*l-.0358915932320289*n),s=sa(-.1920808463704995*r+1.1004767970374323*l+.0753748658519118*n),u=sa(.0070797844607477*r+.0748396662186366*l+.8433265453898765*n),d=.5*i+.5*s,p=1.61376953125*i-3.323486328125*s+1.709716796875*u,C=4.378173828125*i-4.24560546875*s-.132568359375*u,g={mode:"itp",i:d,t:p,p:C};return a!==void 0&&(g.alpha=a),g},jr=qd;var zd={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:qr,rgb:e=>t1(qr(e))},fromMode:{xyz65:jr,rgb:e=>jr(e1(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:_,t:_,p:_,alpha:{use:_,fixup:fe}}},J2=zd;var jd=134.03437499999998,Kd=16295499532821565e-27,Kr=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,Vt);return Math.pow((_t+Dt*t)/(1+Ot*t),jd)},Gr=(e=0)=>Math.max(e*203,0),Gd=({x:e,y:t,z:o,alpha:a})=>{e=Gr(e),t=Gr(t),o=Gr(o);let r=1.15*e-.15*o,l=.66*t+.34*e,n=Kr(.41478972*r+.579999*l+.014648*o),i=Kr(-.20151*r+1.120649*l+.0531008*o),s=Kr(-.0166008*r+.2648*l+.6684799*o),u=(n+i)/2,d={mode:"jab",j:.44*u/(1-.56*u)-Kd,a:3.524*n-4.066708*i+.542708*s,b:.199076*n+1.096799*i-1.295875*s};return a!==void 0&&(d.alpha=a),d},ua=Gd;var Wd=134.03437499999998,e0=16295499532821565e-27,Wr=e=>{if(e<0)return 0;let t=Math.pow(e,1/Wd);return 1e4*Math.pow((_t-t)/(Ot*t-Dt),1/Vt)},Xr=e=>e/203,Xd=({j:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(e+e0)/(.44+.56*(e+e0)),l=Wr(r+.13860504*t+.058047316*o),n=Wr(r-.13860504*t-.058047316*o),i=Wr(r-.096019242*t-.8118919*o),s={mode:"xyz65",x:Xr(1.661373024652174*l-.914523081304348*n+.23136208173913045*i),y:Xr(-.3250758611844533*l+1.571847026732543*n-.21825383453227928*i),z:Xr(-.090982811*l-.31272829*n+1.5227666*i)};return a!==void 0&&(s.alpha=a),s},da=Xd;var Qd=e=>{let t=ua(e1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ca=Qd;var Yd=e=>t1(da(e)),fa=Yd;var Jd={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:ca,xyz65:ua},toMode:{rgb:fa,xyz65:da},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:_,a:_,b:_,alpha:{use:_,fixup:fe}}},t0=Jd;var e3=({j:e,a:t,b:o,alpha:a})=>{t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.sqrt(t*t+o*o),l={mode:"jch",j:e,c:r};return r&&(l.h=be(Math.atan2(o,t)*180/Math.PI)),a!==void 0&&(l.alpha=a),l},Qr=e3;var t3=({j:e,c:t,h:o,alpha:a})=>{o===void 0&&(o=0);let r={mode:"jab",j:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return a!==void 0&&(r.alpha=a),r},Yr=t3;var o3={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Yr,rgb:e=>fa(Yr(e))},fromMode:{rgb:e=>Qr(ca(e)),jab:Qr},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:_,fixup:Ze},c:_,j:_,alpha:{use:_,fixup:fe}},difference:{h:X1},average:{h:Fe}},o0=o3;var et=Math.pow(29,3)/Math.pow(3,3),Et=Math.pow(6,3)/Math.pow(29,3);var Jr=e=>Math.pow(e,3)>Et?Math.pow(e,3):(116*e-16)/et,a3=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=(e+16)/116,l=t/500+r,n=r-o/200,i={mode:"xyz50",x:Jr(l)*Se.X,y:Jr(r)*Se.Y,z:Jr(n)*Se.Z};return a!==void 0&&(i.alpha=a),i},Bt=a3;var r3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=m1({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*o,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*o,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*o});return a!==void 0&&(r.alpha=a),r},R1=r3;var l3=e=>R1(Bt(e)),pa=l3;var n3=e=>{let{r:t,g:o,b:a,alpha:r}=C1(e),l={mode:"xyz50",x:.436065742824811*t+.3851514688337912*o+.14307845442264197*a,y:.22249319175623702*t+.7168870538238823*o+.06061979053616537*a,z:.013923904500943465*t+.09708128566574634*o+.7140993584005155*a};return r!==void 0&&(l.alpha=r),l},k1=n3;var el=e=>e>Et?Math.cbrt(e):(et*e+16)/116,i3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=el(e/Se.X),l=el(t/Se.Y),n=el(o/Se.Z),i={mode:"lab",l:116*l-16,a:500*(r-l),b:200*(l-n)};return a!==void 0&&(i.alpha=a),i},At=i3;var s3=e=>{let t=At(k1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},Ca=s3;function u3(e,t){if(!t||t[0]!=="lab")return;let o={mode:"lab"},[,a,r,l,n]=t;if(!(a.type===P.Hue||r.type===P.Hue||l.type===P.Hue))return a.type!==P.None&&(o.l=Math.min(Math.max(0,a.value),100)),r.type!==P.None&&(o.a=r.type===P.Number?r.value:r.value*125/100),l.type!==P.None&&(o.b=l.type===P.Number?l.value:l.value*125/100),n.type!==P.None&&(o.alpha=Math.min(1,Math.max(0,n.type===P.Number?n.value:n.value/100))),o}var a0=u3;var d3={mode:"lab",toMode:{xyz50:Bt,rgb:pa},fromMode:{xyz50:At,rgb:Ca},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[a0],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:_,a:_,b:_,alpha:{use:_,fixup:fe}}},Zt=d3;var c3={...Zt,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:oa,rgb:Y1},fromMode:{xyz65:aa,rgb:J1},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},r0=c3;function f3(e,t){if(!t||t[0]!=="lch")return;let o={mode:"lch"},[,a,r,l,n]=t;if(a.type!==P.None){if(a.type===P.Hue)return;o.l=Math.min(Math.max(0,a.value),100)}if(r.type!==P.None&&(o.c=Math.max(0,r.type===P.Number?r.value:r.value*150/100)),l.type!==P.None){if(l.type===P.Percentage)return;o.h=l.value}return n.type!==P.None&&(o.alpha=Math.min(1,Math.max(0,n.type===P.Number?n.value:n.value/100))),o}var l0=f3;var p3={mode:"lch",toMode:{lab:u1,rgb:e=>pa(u1(e))},fromMode:{rgb:e=>s1(Ca(e)),lab:s1},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[l0],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:_,fixup:Ze},c:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:X1},average:{h:Fe}},Ft=p3;var C3={...Ft,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>u1(e,"lab65"),rgb:e=>Y1(u1(e,"lab65"))},fromMode:{rgb:e=>s1(J1(e),"lch65"),lab65:e=>s1(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},n0=C3;var m3=({l:e,u:t,v:o,alpha:a})=>{t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.sqrt(t*t+o*o),l={mode:"lchuv",l:e,c:r};return r&&(l.h=be(Math.atan2(o,t)*180/Math.PI)),a!==void 0&&(l.alpha=a),l},tl=m3;var h3=({l:e,c:t,h:o,alpha:a})=>{o===void 0&&(o=0);let r={mode:"luv",l:e,u:t?t*Math.cos(o/180*Math.PI):0,v:t?t*Math.sin(o/180*Math.PI):0};return a!==void 0&&(r.alpha=a),r},ol=h3;var i0=(e,t,o)=>4*e/(e+15*t+3*o),s0=(e,t,o)=>9*t/(e+15*t+3*o),g3=i0(Se.X,Se.Y,Se.Z),v3=s0(Se.X,Se.Y,Se.Z),x3=e=>e<=Et?et*e:116*Math.cbrt(e)-16,L3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=x3(t/Se.Y),l=i0(e,t,o),n=s0(e,t,o);!isFinite(l)||!isFinite(n)?r=l=n=0:(l=13*r*(l-g3),n=13*r*(n-v3));let i={mode:"luv",l:r,u:l,v:n};return a!==void 0&&(i.alpha=a),i},vo=L3;var w3=(e,t,o)=>4*e/(e+15*t+3*o),b3=(e,t,o)=>9*t/(e+15*t+3*o),I3=w3(Se.X,Se.Y,Se.Z),y3=b3(Se.X,Se.Y,Se.Z),M3=({l:e,u:t,v:o,alpha:a})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),o===void 0&&(o=0);let r=t/(13*e)+I3,l=o/(13*e)+y3,n=Se.Y*(e<=8?e/et:Math.pow((e+16)/116,3)),i=n*(9*r)/(4*l),s=n*(12-3*r-20*l)/(4*l),u={mode:"xyz50",x:i,y:n,z:s};return a!==void 0&&(u.alpha=a),u},xo=M3;var S3=e=>tl(vo(k1(e))),R3=e=>R1(xo(ol(e))),k3={mode:"lchuv",toMode:{luv:ol,rgb:R3},fromMode:{rgb:S3,luv:tl},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:_,fixup:Ze},c:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:X1},average:{h:Fe}},u0=k3;var H3={...p1,mode:"lrgb",toMode:{rgb:m1},fromMode:{rgb:C1},parse:["srgb-linear"],serialize:"srgb-linear"},d0=H3;var P3={mode:"luv",toMode:{xyz50:xo,rgb:e=>R1(xo(e))},fromMode:{xyz50:vo,rgb:e=>vo(k1(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:_,u:_,v:_,alpha:{use:_,fixup:fe}}},c0=P3;var T3=({r:e,g:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*o),l=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*o),n=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*o),i={mode:"oklab",l:.210454268309314*r+.7936177747023054*l-.0040720430116193*n,a:1.9779985324311684*r-2.42859224204858*l+.450593709617411*n,b:.0259040424655478*r+.7827717124575296*l-.8086757549230774*n};return a!==void 0&&(i.alpha=a),i},ma=T3;var V3=e=>{let t=ma(C1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tt=V3;var _3=({l:e,a:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=Math.pow(e+.3963377773761749*t+.2158037573099136*o,3),l=Math.pow(e-.1055613458156586*t-.0638541728258133*o,3),n=Math.pow(e-.0894841775298119*t-1.2914855480194092*o,3),i={mode:"lrgb",r:4.076741636075957*r-3.3077115392580616*l+.2309699031821044*n,g:-1.2684379732850317*r+2.6097573492876887*l-.3413193760026573*n,b:-.0041960761386756*r-.7034186179359362*l+1.7076146940746117*n};return a!==void 0&&(i.alpha=a),i},H1=_3;var D3=e=>m1(H1(e)),ot=D3;function Lo(e){let a=1.170873786407767;return .5*(a*e-.206+Math.sqrt((a*e-.206)*(a*e-.206)+4*.03*a*e))}function vt(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function O3(e,t){let o,a,r,l,n,i,s,u;-1.88170328*e-.80936493*t>1?(o=1.19086277,a=1.76576728,r=.59662641,l=.75515197,n=.56771245,i=4.0767416621,s=-3.3077115913,u=.2309699292):1.81444104*e-1.19445276*t>1?(o=.73956515,a=-.45954404,r=.08285427,l=.1254107,n=.14503204,i=-1.2684380046,s=2.6097574011,u=-.3413193965):(o=1.35733652,a=-.00915799,r=-1.1513021,l=-.50559606,n=.00692167,i=-.0041960863,s=-.7034186147,u=1.707614701);let d=o+a*e+r*t+l*e*e+n*e*t,p=.3963377774*e+.2158037573*t,C=-.1055613458*e-.0638541728*t,g=-.0894841775*e-1.291485548*t;{let f=1+d*p,c=1+d*C,m=1+d*g,b=f*f*f,h=c*c*c,R=m*m*m,v=3*p*f*f,H=3*C*c*c,D=3*g*m*m,q=6*p*p*f,M=6*C*C*c,T=6*g*g*m,z=i*b+s*h+u*R,G=i*v+s*H+u*D,W=i*q+s*M+u*T;d=d-z*G/(G*G-.5*z*W)}return d}function al(e,t){let o=O3(e,t),a=H1({l:1,a:o*e,b:o*t}),r=Math.cbrt(1/Math.max(a.r,a.g,a.b)),l=r*o;return[r,l]}function E3(e,t,o,a,r,l=null){l||(l=al(e,t));let n;if((o-r)*l[1]-(l[0]-r)*a<=0)n=l[1]*r/(a*l[0]+l[1]*(r-o));else{n=l[1]*(r-1)/(a*(l[0]-1)+l[1]*(r-o));{let i=o-r,s=a,u=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,p=-.0894841775*e-1.291485548*t,C=i+s*u,g=i+s*d,f=i+s*p;{let c=r*(1-n)+n*o,m=n*a,b=c+m*u,h=c+m*d,R=c+m*p,v=b*b*b,H=h*h*h,D=R*R*R,q=3*C*b*b,M=3*g*h*h,T=3*f*R*R,z=6*C*C*b,G=6*g*g*h,W=6*f*f*R,$=4.0767416621*v-3.3077115913*H+.2309699292*D-1,O=4.0767416621*q-3.3077115913*M+.2309699292*T,N=4.0767416621*z-3.3077115913*G+.2309699292*W,L=O/(O*O-.5*$*N),x=-$*L,w=-1.2684380046*v+2.6097574011*H-.3413193965*D-1,I=-1.2684380046*q+2.6097574011*M-.3413193965*T,y=-1.2684380046*z+2.6097574011*G-.3413193965*W,E=I/(I*I-.5*w*y),B=-w*E,U=-.0041960863*v-.7034186147*H+1.707614701*D-1,A=-.0041960863*q-.7034186147*M+1.707614701*T,F=-.0041960863*z-.7034186147*G+1.707614701*W,Z=A/(A*A-.5*U*F),k=-U*Z;x=L>=0?x:1e6,B=E>=0?B:1e6,k=Z>=0?k:1e6,n+=Math.min(x,Math.min(B,k))}}}return n}function wo(e,t,o=null){o||(o=al(e,t));let a=o[0],r=o[1];return[r/a,r/(1-a)]}function ha(e,t,o){let a=al(t,o),r=E3(t,o,e,1,e,a),l=wo(t,o,a),n=.11516993+1/(7.4477897+4.1590124*o+t*(-2.19557347+1.75198401*o+t*(-2.13704948-10.02301043*o+t*(-4.24894561+5.38770819*o+4.69891013*t)))),i=.11239642+1/(1.6132032-.68124379*o+t*(.40370612+.90148123*o+t*(-.27087943+.6122399*o+t*(.00299215-.45399568*o-.14661872*t)))),s=r/Math.min(e*l[0],(1-e)*l[1]),u=e*n,d=(1-e)*i,p=.9*s*Math.sqrt(Math.sqrt(1/(1/(u*u*u*u)+1/(d*d*d*d))));return u=e*.4,d=(1-e)*.8,[Math.sqrt(1/(1/(u*u)+1/(d*d))),p,r]}function ga(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,a=e.b!==void 0?e.b:0,r={mode:"okhsl",l:Lo(t)};e.alpha!==void 0&&(r.alpha=e.alpha);let l=Math.sqrt(o*o+a*a);if(!l)return r.s=0,r;let[n,i,s]=ha(t,o/l,a/l),u;if(l<i){let d=0,p=.8*n,C=1-p/i;u=(l-d)/(p+C*(l-d))*.8}else{let d=i,p=.2*i*i*1.25*1.25/n,C=1-p/(s-i);u=.8+.2*((l-d)/(p+C*(l-d)))}return u&&(r.s=u,r.h=be(Math.atan2(a,o)*180/Math.PI)),r}function va(e){let t=e.h!==void 0?e.h:0,o=e.s!==void 0?e.s:0,a=e.l!==void 0?e.l:0,r={mode:"oklab",l:vt(a)};if(e.alpha!==void 0&&(r.alpha=e.alpha),!o||a===1)return r.a=r.b=0,r;let l=Math.cos(t/180*Math.PI),n=Math.sin(t/180*Math.PI),[i,s,u]=ha(r.l,l,n),d,p,C,g;o<.8?(d=1.25*o,p=0,C=.8*i,g=1-C/s):(d=5*(o-.8),p=s,C=.2*s*s*1.25*1.25/i,g=1-C/(u-s));let f=p+d*C/(1-g*d);return r.a=f*l,r.b=f*n,r}var B3={...la,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:ga,rgb:e=>ga(tt(e))},toMode:{oklab:va,rgb:e=>ot(va(e))}},f0=B3;function xa(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,a=e.b!==void 0?e.b:0,r=Math.sqrt(o*o+a*a),l=r?o/r:1,n=r?a/r:1,[i,s]=wo(l,n),u=.5,d=1-u/i,p=s/(r+t*s),C=p*t,g=p*r,f=vt(C),c=g*f/C,m=H1({l:f,a:l*c,b:n*c}),b=Math.cbrt(1/Math.max(m.r,m.g,m.b,0));t=t/b,r=r/b*Lo(t)/t,t=Lo(t);let h={mode:"okhsv",s:r?(u+s)*g/(s*u+s*d*g):0,v:t?t/C:0};return h.s&&(h.h=be(Math.atan2(a,o)*180/Math.PI)),e.alpha!==void 0&&(h.alpha=e.alpha),h}function La(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let o=e.h!==void 0?e.h:0,a=e.s!==void 0?e.s:0,r=e.v!==void 0?e.v:0,l=Math.cos(o/180*Math.PI),n=Math.sin(o/180*Math.PI),[i,s]=wo(l,n),u=.5,d=1-u/i,p=1-a*u/(u+s-s*d*a),C=a*s*u/(u+s-s*d*a),g=vt(p),f=C*g/p,c=H1({l:g,a:l*f,b:n*f}),m=Math.cbrt(1/Math.max(c.r,c.g,c.b,0)),b=vt(r*p),h=C*b/p;return t.l=b*m,t.a=h*l*m,t.b=h*n*m,t}var A3={...na,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:xa,rgb:e=>xa(tt(e))},toMode:{oklab:La,rgb:e=>ot(La(e))}},p0=A3;function Z3(e,t){if(!t||t[0]!=="oklab")return;let o={mode:"oklab"},[,a,r,l,n]=t;if(!(a.type===P.Hue||r.type===P.Hue||l.type===P.Hue))return a.type!==P.None&&(o.l=Math.min(Math.max(0,a.type===P.Number?a.value:a.value/100),1)),r.type!==P.None&&(o.a=r.type===P.Number?r.value:r.value*.4/100),l.type!==P.None&&(o.b=l.type===P.Number?l.value:l.value*.4/100),n.type!==P.None&&(o.alpha=Math.min(1,Math.max(0,n.type===P.Number?n.value:n.value/100))),o}var C0=Z3;var F3={...Zt,mode:"oklab",toMode:{lrgb:H1,rgb:ot},fromMode:{lrgb:ma,rgb:tt},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[C0],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},m0=F3;function $3(e,t){if(!t||t[0]!=="oklch")return;let o={mode:"oklch"},[,a,r,l,n]=t;if(a.type!==P.None){if(a.type===P.Hue)return;o.l=Math.min(Math.max(0,a.type===P.Number?a.value:a.value/100),1)}if(r.type!==P.None&&(o.c=Math.max(0,r.type===P.Number?r.value:r.value*.4/100)),l.type!==P.None){if(l.type===P.Percentage)return;o.h=l.value}return n.type!==P.None&&(o.alpha=Math.min(1,Math.max(0,n.type===P.Number?n.value:n.value/100))),o}var h0=$3;var N3={...Ft,mode:"oklch",toMode:{oklab:e=>u1(e,"oklab"),rgb:e=>ot(u1(e,"oklab"))},fromMode:{rgb:e=>s1(tt(e),"oklch"),oklab:e=>s1(e,"oklch")},parse:[h0],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},g0=N3;var U3=e=>{let{r:t,g:o,b:a,alpha:r}=C1(e),l={mode:"xyz65",x:.486570948648216*t+.265667693169093*o+.1982172852343625*a,y:.2289745640697487*t+.6917385218365062*o+.079286914093745*a,z:0*t+.0451133818589026*o+1.043944368900976*a};return r!==void 0&&(l.alpha=r),l},rl=U3;var q3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=m1({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*o,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*o,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*o},"p3");return a!==void 0&&(r.alpha=a),r},ll=q3;var z3={...p1,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>ll(e1(e)),xyz65:ll},toMode:{rgb:e=>t1(rl(e)),xyz65:rl}},v0=z3;var nl=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},j3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"prophoto",r:nl(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*o),g:nl(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*o),b:nl(e*0+t*0+1.2119675456389452*o)};return a!==void 0&&(r.alpha=a),r},il=j3;var sl=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},K3=e=>{let t=sl(e.r),o=sl(e.g),a=sl(e.b),r={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*o+.0313477341283922*a,y:.2880748288194013*t+.7118352342418731*o+899369387256e-16*a,z:0*t+0*o+.8251046025104602*a};return e.alpha!==void 0&&(r.alpha=e.alpha),r},ul=K3;var G3={...p1,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:il,rgb:e=>il(k1(e))},toMode:{xyz50:ul,rgb:e=>R1(ul(e))}},x0=G3;var L0=1.09929682680944,W3=.018053968510807,dl=e=>{let t=Math.abs(e);return t>W3?(Math.sign(e)||1)*(L0*Math.pow(t,.45)-(L0-1)):4.5*e},X3=({x:e,y:t,z:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"rec2020",r:dl(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*o),g:dl(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*o),b:dl(e*.0176398574453108-t*.0427706132578085+.9421031212354739*o)};return a!==void 0&&(r.alpha=a),r},cl=X3;var w0=1.09929682680944,Q3=.018053968510807,fl=(e=0)=>{let t=Math.abs(e);return t<Q3*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+w0-1)/w0,1/.45)},Y3=e=>{let t=fl(e.r),o=fl(e.g),a=fl(e.b),r={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*o+.1688809751641721*a,y:.262700212011267*t+.6779980715188708*o+.059301716469862*a,z:0*t+.0280726930490874*o+1.0609850577107909*a};return e.alpha!==void 0&&(r.alpha=e.alpha),r},pl=Y3;var J3={...p1,mode:"rec2020",fromMode:{xyz65:cl,rgb:e=>cl(e1(e))},toMode:{xyz65:pl,rgb:e=>t1(pl(e))},parse:["rec2020"],serialize:"rec2020"},b0=J3;var A1=.0037930732552754493,wa=Math.cbrt(A1);var Cl=e=>Math.cbrt(e)-wa,e7=e=>{let{r:t,g:o,b:a,alpha:r}=C1(e),l=Cl(.3*t+.622*o+.078*a+A1),n=Cl(.23*t+.692*o+.078*a+A1),i=Cl(.2434226892454782*t+.2047674442449682*o+.5518098665095535*a+A1),s={mode:"xyb",x:(l-n)/2,y:(l+n)/2,b:i-(l+n)/2};return r!==void 0&&(s.alpha=r),s},I0=e7;var ml=e=>Math.pow(e+wa,3),t7=({x:e,y:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r=ml(e+t)-A1,l=ml(t-e)-A1,n=ml(o+t)-A1,i=m1({r:11.031566904639861*r-9.866943908131562*l-.16462299650829934*n,g:-3.2541473810744237*r+4.418770377582723*l-.16462299650829934*n,b:-3.6588512867136815*r+2.7129230459360922*l+1.9459282407775895*n});return a!==void 0&&(i.alpha=a),i},y0=t7;var o7={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:y0},fromMode:{rgb:I0},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:_,y:_,b:_,alpha:{use:_,fixup:fe}}},M0=o7;var a7={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:R1,lab:At},fromMode:{rgb:k1,lab:Bt},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:_,y:_,z:_,alpha:{use:_,fixup:fe}}},S0=a7;var r7=e=>{let{x:t,y:o,z:a,alpha:r}=e;t===void 0&&(t=0),o===void 0&&(o=0),a===void 0&&(a=0);let l={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*o-.0501922295431356*a,y:.0296278156881593*t+.990434484573249*o-.0170738250293851*a,z:-.0092430581525912*t+.0150551448965779*o+.7518742899580008*a};return r!==void 0&&(l.alpha=r),l},R0=r7;var l7=e=>{let{x:t,y:o,z:a,alpha:r}=e;t===void 0&&(t=0),o===void 0&&(o=0),a===void 0&&(a=0);let l={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*o+.0632593086610217*a,y:-.0283697069632081*t+1.0099954580058226*o+.021041398966943*a,z:.0123140016883199*t-.0205076964334779*o+1.3303659366080753*a};return r!==void 0&&(l.alpha=r),l},k0=l7;var n7={mode:"xyz65",toMode:{rgb:t1,xyz50:R0},fromMode:{rgb:e1,xyz50:k0},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:_,y:_,z:_,alpha:{use:_,fixup:fe}}},H0=n7;var i7=({r:e,g:t,b:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*o,i:.59597799*e-.2741761*t-.32180189*o,q:.21147017*e-.52261711*t+.31114694*o};return a!==void 0&&(r.alpha=a),r},P0=i7;var s7=({y:e,i:t,q:o,alpha:a})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let r={mode:"rgb",r:e+.95608445*t+.6208885*o,g:e-.27137664*t-.6486059*o,b:e-1.10561724*t+1.70250126*o};return a!==void 0&&(r.alpha=a),r},T0=s7;var u7={mode:"yiq",toMode:{rgb:T0},fromMode:{rgb:P0},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:_,i:_,q:_,alpha:{use:_,fixup:fe}}},V0=u7;var d7=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,c7=(e=4)=>t=>typeof t=="number"?d7(t,e):t,bo=c7;var Xx=bo(2);var Qx=i1("rgb"),Yx=i1("hsl");var hl=e=>{let t=Wo(e);if(!t)return;let o=Xo(t.mode);if(!o.serialize||typeof o.serialize=="string"){let a=`color(${o.serialize||`--${t.mode}`} `;return o.channels.forEach((r,l)=>{r!=="alpha"&&(a+=(l?" ":"")+(t[r]!==void 0?t[r]:"none"))}),t.alpha!==void 0&&t.alpha<1&&(a+=` / ${t.alpha}`),a+")"}if(typeof o.serialize=="function")return o.serialize(t)};var ZL=ve(V2),FL=ve($2),$L=ve(q2),NL=ve(z2),UL=ve(j2),qL=ve(la),zL=ve(na),jL=ve(Q2),KL=ve(J2),GL=ve(t0),WL=ve(o0),XL=ve(Zt),QL=ve(r0),YL=ve(Ft),JL=ve(n0),ew=ve(u0),tw=ve(d0),ow=ve(c0),aw=ve(f0),rw=ve(p0),lw=ve(m0),nw=ve(g0),iw=ve(v0),sw=ve(x0),uw=ve(b0),dw=ve(p1),cw=ve(M0),fw=ve(S0),pw=ve(H0),Cw=ve(V0);var gl=i1("rgb"),f7=i1("hsl"),p7=i1("oklch"),C7=i1("oklab"),m7=i1("lch"),h7=i1("lab"),g7=bo(3),_0=null;function v7(){return _0??(_0=document.createElement("canvas").getContext("2d")),_0}function D0(e){try{let t=v7();if(!t)return null;t.fillStyle="#000000",t.fillStyle=e;let o=t.fillStyle;t.fillStyle="#ffffff",t.fillStyle=e;let a=t.fillStyle;return o===a?o:null}catch{return null}}function O0(e){if(!e||typeof e!="string")return!1;let t=e.trim();return ht(t)!==void 0?!0:D0(t)!==null}function xt(e){let t={r:255,g:255,b:255,a:1};if(!e||typeof e!="string")return t;let o=e.trim(),a=ht(o);if(a){let l=gl(a);if(l&&"r"in l&&"g"in l&&"b"in l)return{r:Math.round(Math.min(255,Math.max(0,l.r*255))),g:Math.round(Math.min(255,Math.max(0,l.g*255))),b:Math.round(Math.min(255,Math.max(0,l.b*255))),a:l.alpha??1}}let r=D0(o);if(r){if(r.startsWith("#")){let n=r.slice(1);return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:1}}let l=r.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(l&&l[1]!=null&&l[2]!=null&&l[3]!=null)return{r:+l[1],g:+l[2],b:+l[3],a:l[4]!=null?+l[4]:1}}return t}function $t(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),a=Math.round(Math.min(255,Math.max(0,e.b))),r=Math.round(Math.min(1,Math.max(0,e.a))*100)/100;return r>=1?`rgb(${t}, ${o}, ${a})`:`rgba(${t}, ${o}, ${a}, ${r})`}function ba(e){let t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]+$/.test(t)&&[3,4,6,8].includes(t.length)}function Io(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),a=Math.round(Math.min(255,Math.max(0,e.b))),r=Math.min(1,Math.max(0,e.a)),l=`#${[t,o,a].map(n=>n.toString(16).padStart(2,"0")).join("")}`;return r<1?l+Math.round(r*255).toString(16).padStart(2,"0"):l}function E0(e){return!e||typeof e!="string"?"rgb":ht(e.trim())?.mode??"rgb"}function o1(e,t){let o={mode:"rgb",r:e.r/255,g:e.g/255,b:e.b/255,alpha:e.a};switch(t){case"oklch":return p7(o);case"oklab":return C7(o);case"lch":return m7(o);case"lab":return h7(o);default:return o}}function vl(e){let t=e?gl(e):null;return!t||!("r"in t)||!("g"in t)||!("b"in t)?{r:255,g:255,b:255,a:1}:{r:Math.round(Math.min(255,Math.max(0,t.r*255))),g:Math.round(Math.min(255,Math.max(0,t.g*255))),b:Math.round(Math.min(255,Math.max(0,t.b*255))),a:t.alpha??1}}function xl(e){if(!e)return"";let t={...e},o=t;for(let a of Object.keys(o)){let r=o[a];typeof r=="number"&&(o[a]=g7(r))}return hl(t)}function Nt(e){let t={mode:"rgb",r:e.r/255,g:e.g/255,b:e.b/255},o=f7(t);return o?{h:o.h??0,s:o.s*100,l:o.l*100}:{h:0,s:0,l:0}}function Ll(e){let t={mode:"hsl",h:e.h,s:e.s/100,l:e.l/100},o=gl(t);return!o||!("r"in o)||!("g"in o)||!("b"in o)?{r:0,g:0,b:0}:{r:Math.round(o.r*255),g:Math.round(o.g*255),b:Math.round(o.b*255)}}import{jsx as $e,jsxs as P1}from"react/jsx-runtime";var wl=16,Ut=4,L7=245,B0=260,w7=200,b7="linear-gradient(45deg, #e0e0e0 25%, transparent 25%), linear-gradient(-45deg, #e0e0e0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e0e0e0 75%), linear-gradient(-45deg, transparent 75%, #e0e0e0 75%)",I7=["oklch","oklab","lch","lab","hsl"],A0=["oklch","oklab","lch","lab"],bl=["rgb","hsl","oklch","oklab","lch","lab"];function Il(e){let t=E0(e);return I7.includes(t)?t:"rgb"}function yo(e,t){let o=Nt({r:e.r,g:e.g,b:e.b}),a=o1(e,"oklch"),r=o1(e,"oklab"),l=o1(e,"lch"),n=o1(e,"lab");return{hex:R7(t,e),r:e.r,g:e.g,b:e.b,h:Math.round(o.h),s:Math.round(o.s),l:Math.round(o.l),a:Math.round(e.a*100),oklch_l:Math.round(a.l*100),oklch_c:Math.round(a.c*1e3)/10,oklch_h:Math.round(a.h||0),oklab_l:Math.round(r.l*100),oklab_a:Math.round(r.a*1e3)/10,oklab_b:Math.round(r.b*1e3)/10,lch_l:Math.round(l.l),lch_c:Math.round(l.c),lch_h:Math.round(l.h||0),lab_l:Math.round(n.l),lab_a:Math.round(n.a),lab_b:Math.round(n.b)}}function Ml(e,t){let o=t.a/100;switch(e){case"oklch":return{mode:"oklch",l:t.oklch_l/100,c:t.oklch_c/100,h:t.oklch_h,alpha:o};case"oklab":return{mode:"oklab",l:t.oklab_l/100,a:t.oklab_a/100,b:t.oklab_b/100,alpha:o};case"lch":return{mode:"lch",l:t.lch_l,c:t.lch_c,h:t.lch_h,alpha:o};case"lab":return{mode:"lab",l:t.lab_l,a:t.lab_a,b:t.lab_b,alpha:o};case"hsl":return{mode:"hsl",h:t.h,s:t.s,l:t.l};default:return{mode:"rgb",r:t.r/255,g:t.g/255,b:t.b/255,alpha:o}}}function y7(e){let t=Ct(e);return t?t.getBoundingClientRect():{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}}function M7(e,t=L7){let o=e.getBoundingClientRect(),a=y7(e),r=a.bottom-o.bottom-Ut,l=o.top-a.top-Ut,i=r<t&&l>=t?o.top-t-Ut:o.bottom+Ut;i=Math.max(a.top+Ut,Math.min(i,a.bottom-t-Ut));let s=o.left;return s+B0>a.right&&(s=a.right-B0-wl),s<a.left+wl&&(s=a.left+wl),{top:i,left:s}}function Sl(e){return e!=null&&typeof e=="string"?e:"#ffffff"}function yl(e){let{r:t,g:o,b:a,a:r}=xt(Sl(e));return{type:"rgba",r:t,g:o,b:a,a:r}}function S7(e,t){let o=e||$t(t);return t.a>=1?{backgroundColor:o}:{backgroundColor:o,backgroundImage:`linear-gradient(0deg, ${o}, ${o}), ${b7}`,backgroundSize:"100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:"0 0, 0 0, 0 4px, 4px -4px, -4px 0"}}function R7(e,t){let o=typeof e=="string"?e.trim():"";return ba(o)?o:Io(t)}var k7=e=>e.preventDefault(),H7=e=>{e.key==="Enter"&&e.currentTarget.blur()};function P7(e,t){switch(t.type){case"SET_ALL":return{format:e.format,hex:t.hex,r:t.r,g:t.g,b:t.b,h:t.h,s:t.s,l:t.l,a:t.a,oklch_l:t.oklch_l,oklch_c:t.oklch_c,oklch_h:t.oklch_h,oklab_l:t.oklab_l,oklab_a:t.oklab_a,oklab_b:t.oklab_b,lch_l:t.lch_l,lch_c:t.lch_c,lch_h:t.lch_h,lab_l:t.lab_l,lab_a:t.lab_a,lab_b:t.lab_b};case"SET_RGBA":{let{r:o,g:a,b:r,a:l}=t,n=Nt({r:o,g:a,b:r}),i={r:o,g:a,b:r,a:l/100},s=o1(i,"oklch"),u=o1(i,"oklab"),d=o1(i,"lch"),p=o1(i,"lab");return{...e,hex:Io(i),r:o,g:a,b:r,h:Math.round(n.h),s:Math.round(n.s),l:Math.round(n.l),a:l,oklch_l:Math.round(s.l*100),oklch_c:Math.round(s.c*1e3)/10,oklch_h:Math.round(s.h||0),oklab_l:Math.round(u.l*100),oklab_a:Math.round(u.a*1e3)/10,oklab_b:Math.round(u.b*1e3)/10,lch_l:Math.round(d.l),lch_c:Math.round(d.c),lch_h:Math.round(d.h||0),lab_l:Math.round(p.l),lab_a:Math.round(p.a),lab_b:Math.round(p.b)}}case"SET_HEX":return{...e,hex:t.hex};case"SET_CHANNEL":{let o={...e,[t.channel]:t.value},a;if(e.format==="rgb")a={r:o.r,g:o.g,b:o.b,a:o.a/100};else if(e.format==="hsl"){let u=Ll({h:o.h,s:o.s,l:o.l});o.r=Math.round(u.r),o.g=Math.round(u.g),o.b=Math.round(u.b),a={r:o.r,g:o.g,b:o.b,a:o.a/100}}else{let u=Ml(e.format,o);a=vl(u),o.r=a.r,o.g=a.g,o.b=a.b}let r=Nt({r:o.r,g:o.g,b:o.b}),l=o1(a,"oklch"),n=o1(a,"oklab"),i=o1(a,"lch"),s=o1(a,"lab");return{...o,hex:Io(a),h:Math.round(r.h),s:Math.round(r.s),l:Math.round(r.l),oklch_l:Math.round(l.l*100),oklch_c:Math.round(l.c*1e3)/10,oklch_h:Math.round(l.h||0),oklab_l:Math.round(n.l*100),oklab_a:Math.round(n.a*1e3)/10,oklab_b:Math.round(n.b*1e3)/10,lch_l:Math.round(i.l),lch_c:Math.round(i.c),lch_h:Math.round(i.h||0),lab_l:Math.round(s.l),lab_a:Math.round(s.a),lab_b:Math.round(s.b)}}case"SET_FORMAT":return{...e,format:t.format};default:return e}}var T7={placeholder:"Enter color value",ariaValue:"{0} color value",ariaOpenPicker:"{0}, open color picker. Current color: {1}",ariaPicker:"{0} picker",ariaSaturation:"Saturation {0}%, brightness {1}%",ariaEyedropper:"Pick color from screen",ariaHue:"Hue, 0 to 360 degrees",ariaAlphaSlider:"Alpha transparency, 0 to 100 percent",ariaHex:"Hexadecimal color value",ariaChannel:"{0} ({1}), {2} to {3}",ariaAlphaInput:"Alpha, 0 to 100 percent",ariaFormatCycle:"Color format: {0}. Click to change format.",titleFormatCycle:"Click to cycle format: RGB, HSL, OKLCH, OKLAB, LCH, LAB",gradientValue:"Gradient",imageValue:"Image"};function V7(e){let t=(e??"").trim();return t===""||t.toLowerCase()==="none"?"":t}function Ia({label:e,value:t,onChange:o,id:a="color",aria:r,backgroundImage:l}){let n=n1(T7,r),i=`${a}-trigger`,s=`${a}-popover`,u=Sl(t),[{colorInput:d,colorState:p},C]=g2(()=>yl(u)),[g,f]=Re.useReducer(P7,u,S=>{let V=xt(S),X=yo(V,S);return{format:Il(S),...X}}),c=Re.useRef(g);c.current=g;let m=Re.useRef(null),b=Re.useRef(t),h=Re.useRef(o);h.current=o;let R=Re.useCallback(S=>{let V=c.current.format,X;if(A0.includes(V)){let se=o1(S,V);X=xl(se)}else if(V==="hsl"){let se=Nt({r:S.r,g:S.g,b:S.b}),ke=Math.round(S.a*100)/100;X=ke>=1?`hsl(${Math.round(se.h)}, ${Math.round(se.s)}%, ${Math.round(se.l)}%)`:`hsla(${Math.round(se.h)}, ${Math.round(se.s)}%, ${Math.round(se.l)}%, ${ke})`}else X=$t(S);X!==m.current&&(m.current=X,b.current=X,typeof h.current=="function"&&h.current(X))},[]),v=v2(R,w7),H=L2({computePosition:M7,onClose:v.flush,trapFocus:!0});Re.useEffect(()=>{let S=Sl(t);if(S===b.current)return;b.current=S;let V=xt(S);C(yl(t));let X=yo(V,S),se=Il(S);f({type:"SET_ALL",...X}),se!==c.current.format&&f({type:"SET_FORMAT",format:se})},[t,C]);let D=Re.useCallback(S=>{v.cancel();let V=S.target.value;if((!V||!V.startsWith("#"))&&(V="#"+V.replace(/^#+/,"")),ba(V)){C({type:"hex",value:V});let X=xt(V),se=yo(X,V);f({type:"SET_ALL",...se})}else f({type:"SET_HEX",hex:V})},[v,C]),q=Re.useCallback(()=>{v.cancel();let S=c.current.hex.trim();if(ba(S)){let V=xt(S),X=yo(V,S);f({type:"SET_ALL",...X}),R(V)}else{let V=c.current;f({type:"SET_HEX",hex:Io({r:V.r,g:V.g,b:V.b,a:V.a/100})})}},[v,R]),M=Re.useMemo(()=>{switch(g.format){case"hsl":return[{key:"h",label:"H",min:0,max:360},{key:"s",label:"S",min:0,max:100},{key:"l",label:"L",min:0,max:100}];case"oklch":return[{key:"oklch_l",label:"L",min:0,max:100,step:1},{key:"oklch_c",label:"C",min:0,max:40,step:.1},{key:"oklch_h",label:"H",min:0,max:360,step:1}];case"oklab":return[{key:"oklab_l",label:"L",min:0,max:100,step:1},{key:"oklab_a",label:"A",min:-40,max:40,step:.1},{key:"oklab_b",label:"B",min:-40,max:40,step:.1}];case"lch":return[{key:"lch_l",label:"L",min:0,max:100,step:1},{key:"lch_c",label:"C",min:0,max:150,step:1},{key:"lch_h",label:"H",min:0,max:360,step:1}];case"lab":return[{key:"lab_l",label:"L",min:0,max:100,step:1},{key:"lab_a",label:"A",min:-128,max:127,step:1},{key:"lab_b",label:"B",min:-128,max:127,step:1}];default:return[{key:"r",label:"R",min:0,max:255},{key:"g",label:"G",min:0,max:255},{key:"b",label:"B",min:0,max:255}]}},[g.format]),T=Re.useCallback((S,V)=>{v.cancel();let X=String(V).trim(),se=["oklch_c","oklab_a","oklab_b"].includes(S),ke=X===""?0:se?parseFloat(X):parseInt(X,10);if(Number.isNaN(ke))return;let we=c.current,Qe=M.find(me=>me.key===S),Q=0,ne=100;Qe?(Q=Qe.min,ne=Qe.max):S==="a"?(Q=0,ne=100):S==="h"?(Q=0,ne=360):we.format==="rgb"&&(Q=0,ne=255);let J=Math.min(ne,Math.max(Q,ke));f({type:"SET_CHANNEL",channel:S,value:J});let Ce={...we,[S]:J},He;if(we.format==="rgb")He={r:Ce.r,g:Ce.g,b:Ce.b,a:Ce.a/100};else if(we.format==="hsl"){let me=Ll({h:Ce.h,s:Ce.s,l:Ce.l});He={r:me.r,g:me.g,b:me.b,a:Ce.a/100}}else{let me=Ml(we.format,Ce);He=vl(me)}C({type:"rgba",...He}),R(He)},[v,C,R,M]),z=Re.useCallback(S=>{C(S);let V=S.getRgba();f({type:"SET_RGBA",r:Math.round(V.r),g:Math.round(V.g),b:Math.round(V.b),a:Math.round(V.a*100)}),v({r:V.r,g:V.g,b:V.b,a:V.a})},[C,v]),G=Re.useCallback(S=>{let V=S.target.closest('[role="slider"]');V instanceof HTMLElement&&V.focus()},[]);Re.useLayoutEffect(()=>{if(!H.isOpen||!H.popoverRef.current)return;let S=H.popoverRef.current.offsetHeight;S<=0||H.reposition(S)},[H.isOpen,H.reposition]);let W=p?.rgba??{r:255,g:255,b:255,a:1},$=p?.hsva??{h:0,s:0,v:100,a:1},O=Math.round($.s),N=Math.round($.v);Re.useEffect(()=>{let S=H.popoverRef.current;if(!H.isOpen||!S)return;let V=se=>S.querySelector(`.${se} [role="slider"]`)??null,X=V("colorEditor-picker-saturation");X&&(X.setAttribute("aria-label",e),X.setAttribute("aria-valuetext",_e(n.ariaSaturation,[O,N])),X.setAttribute("aria-valuenow",String(O)),X.setAttribute("aria-valuemin","0"),X.setAttribute("aria-valuemax","100")),V("colorEditor-picker-hue")?.setAttribute("aria-label",n.ariaHue),V("colorEditor-picker-alpha")?.setAttribute("aria-label",n.ariaAlphaSlider)});let x=Re.useCallback(()=>{let S=g.format;if(A0.includes(S)){let V=Ml(S,g);return xl(V)}else if(S==="hsl"){let V=Nt({r:W.r,g:W.g,b:W.b}),X=Math.round(W.a*100)/100;return X>=1?`hsl(${Math.round(V.h)}, ${Math.round(V.s)}%, ${Math.round(V.l)}%)`:`hsla(${Math.round(V.h)}, ${Math.round(V.s)}%, ${Math.round(V.l)}%, ${X})`}else return $t(W)},[g,W])(),w=V7(l),I=w!==""&&W.a===0,y=/url\(/i.test(w)?n.imageValue:n.gradientValue,E=I?y:x,B=I?{backgroundImage:w,backgroundSize:"cover",backgroundPosition:"center"}:S7(x,W),[U,A]=Re.useState(x),F=Re.useRef(U);F.current=U,Re.useEffect(()=>{A(x)},[x]);let Z=Re.useCallback(S=>{let V=S.target.value;A(V)},[]),k=Re.useCallback(()=>{v.cancel();let S=F.current.trim();if(!S||!O0(S)){A(x);return}let V=xt(S),X=$t(V),se=$t(W);if(X!==se){C(yl(S));let ke=yo(V,S),we=Il(S);f({type:"SET_ALL",...ke}),we!==c.current.format&&f({type:"SET_FORMAT",format:we}),S!==m.current&&(m.current=S,b.current=S,typeof h.current=="function"&&h.current(S))}else A(x)},[v,x,W,C]),te=Re.useCallback(S=>{S.key==="Enter"&&S.currentTarget.blur()},[]),le=Re.useCallback(()=>{let S=bl.indexOf(g.format),V=bl[(S+1)%bl.length]??g.format;f({type:"SET_FORMAT",format:V})},[g.format]),de=Re.useMemo(()=>{let S=H.triggerRef.current;if(!S)return document.body;let V=S.getRootNode();return V instanceof ShadowRoot?V:document.body},[H.isOpen,H.triggerRef]);return $e(c1,{label:e,id:a,className:"colorEditor-fieldset",children:P1("div",{className:"colorEditor-wrapper",children:[$e("button",{ref:H.triggerRef,id:i,type:"button",className:"colorEditor-swatch-only",onClick:H.toggle,"aria-expanded":H.isOpen,"aria-haspopup":"dialog","aria-controls":s,"aria-label":_e(n.ariaOpenPicker,[e,E]),children:$e("span",{style:B,"aria-hidden":"true",className:"colorEditor-swatch"})}),$e("input",{type:"text",className:"colorEditor-value-input",value:I?E:U,readOnly:I,onChange:Z,onBlur:k,onKeyDown:te,"aria-label":_e(n.ariaValue,[e]),placeholder:n.placeholder,spellCheck:"false",autoComplete:"off"}),H.isOpen&&x7(P1("div",{ref:H.popoverRef,id:s,role:"dialog","aria-modal":"true","aria-label":_e(n.ariaPicker,[e]),style:{top:H.position.top,left:H.position.left},onDragStart:k7,onMouseUp:G,className:"colorEditor-popover",children:[P1(Ht,{color:d,onChange:z,className:"colorEditor-picker",children:[$e(Ht.Saturation,{className:"colorEditor-picker-saturation"}),P1("div",{className:"colorEditor-picker-toolbar",children:[$e(Ht.EyeDropper,{title:n.ariaEyedropper,children:$e(no,{size:18,"aria-hidden":"true"})}),P1("div",{className:"colorEditor-picker-sliders",children:[$e(Ht.Hue,{className:"h-4 colorEditor-picker-hue"}),$e(Ht.Alpha,{className:"h-4 colorEditor-picker-alpha"})]})]})]}),P1("div",{className:"colorEditor-input-wrapper",children:[P1("div",{className:"colorEditor-input-group",children:[$e("input",{type:"text",value:g.hex,onChange:D,onBlur:q,onKeyDown:H7,"aria-label":n.ariaHex,className:"colorEditor-input-hex",spellCheck:"false",autoComplete:"off"}),$e("label",{className:"colorEditor-input-label","aria-hidden":"true",children:"HEX"})]}),P1("div",{className:"colorEditor-channels-wrapper",children:[P1("div",{className:"colorEditor-input-container",children:[M.map(S=>$e("div",{className:"colorEditor-input-group-no-label",children:$e("input",{type:"number",min:S.min,max:S.max,step:S.step||1,value:g[S.key],onChange:V=>T(S.key,V.target.value),onBlur:V=>T(S.key,V.target.value),"aria-label":_e(n.ariaChannel,[S.label,g.format.toUpperCase(),S.min,S.max]),"aria-valuemin":S.min,"aria-valuemax":S.max,"aria-valuenow":g[S.key],className:"colorEditor-input-rgba"})},S.key)),$e("div",{className:"colorEditor-input-group-no-label",children:$e("input",{type:"number",min:0,max:100,value:g.a,onChange:S=>T("a",S.target.value),onBlur:S=>T("a",S.target.value),"aria-label":n.ariaAlphaInput,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":g.a,className:"colorEditor-input-rgba"})})]}),$e("div",{className:"colorEditor-format-selector",children:P1("button",{type:"button",className:"colorEditor-format-picker",onClick:le,"aria-label":_e(n.ariaFormatCycle,[g.format.toUpperCase()]),"aria-live":"polite",title:n.titleFormatCycle,children:[M.map(S=>$e("span",{className:"colorEditor-format-letter","aria-hidden":"true",children:S.label},S.key)),$e("span",{className:"colorEditor-format-letter","aria-hidden":"true",children:"A"})]})})]})]})]}),de)]})})}import Xe from"react";import{jsx as qt,jsxs as D7}from"react/jsx-runtime";var _7={ariaValue:"{0} value",ariaUnit:"{0} unit"};function Z0(e,t,o,a,r){let l=Je(e,o,a);if(l.numericValue!=="")return l.unit;if(t!=null&&t!==""){let n=Je(t,o,a);if(n.numericValue!==""&&r.has(n.unit))return n.unit}return o}function T1({label:e,value:t,onChange:o,units:a=Eo,constraints:r=x1,defaultUnit:l="px",placeholder:n=0,id:i="dimension",icon:s,aria:u}){let d=n1(_7,u),p=Xe.useMemo(()=>new Set(a.map(O=>O.value)),[a]),C=Xe.useMemo(()=>oo(a),[a]),g=Xe.useMemo(()=>{if(n==null||n==="")return"";if(typeof n=="number")return String(n);let O=Je(String(n),l,C);return O.numericValue!==""?String(O.numericValue):String(n)},[n,l,C]),[f,c]=Xe.useState(()=>{let O=Je(t,l,C);return O.numericValue!==""?String(O.numericValue):""}),[m,b]=Xe.useState(()=>Z0(t,n,l,C,p)),h=Xe.useRef(o);h.current=o;let R=Xe.useRef(t),v=Xe.useRef(n);Xe.useEffect(()=>{if(t===R.current&&n===v.current)return;R.current=t,v.current=n;let O=Je(t,l,C);c(O.numericValue!==""?String(O.numericValue):""),b(Z0(t,n,l,C,p))},[t,n,l,C,p]);let H=Xe.useCallback((O,N)=>{let L=parseFloat(O);if(O===""||isNaN(L)){if(R.current==="")return;R.current="",typeof h.current=="function"&&h.current("");return}let x=L1(L,N,r),w=w1(x,N,r),I=Bo(w,N);I!==R.current&&(R.current=I,typeof h.current=="function"&&h.current(I))},[r]),D=Xe.useCallback(O=>{let N=O.target.value;c(N);let x=N.trim().match(C)?.[2];x&&p.has(x)&&x!==m&&b(x)},[C,m,p]),q=Xe.useCallback(O=>{let N=O.clipboardData.getData("text"),L=Je(N,l,C);if(L.numericValue!==""&&L.unit&&p.has(L.unit)){O.preventDefault(),c(String(L.numericValue)),b(L.unit);let x=L1(L.numericValue,L.unit,r),w=w1(x,L.unit,r),I=Bo(w,L.unit);R.current=I,typeof h.current=="function"&&h.current(I)}},[l,C,p,r]),M=Xe.useCallback(()=>{if(f===""){H("",m);return}let O=parseFloat(f);if(isNaN(O)){let x=Je(t,l,C);c(x.numericValue!==""?String(x.numericValue):"");return}let N=L1(O,m,r),L=w1(N,m,r);c(String(L)),H(String(L),m)},[f,m,t,l,C,r,H]),T=Xe.useCallback(O=>{if(O.key==="Enter"){O.currentTarget.blur();return}if(O.key==="ArrowUp"||O.key==="ArrowDown"){O.preventDefault();let N=Ao(f,O.key,O.shiftKey,m,r);if(N===null)return;c(N),H(N,m)}},[f,m,r,H]),z=Xe.useCallback(O=>{let N=O.target.value;if(!p.has(N))return;if(b(N),f===""){H("",N);return}let L=parseFloat(f);if(isNaN(L))return;let x=L1(L,N,r),w=w1(x,N,r);c(String(w));let I=Bo(w,N);R.current=I,typeof h.current=="function"&&h.current(I)},[f,p,r,H]),G=`${i}-input`,W=`${i}-unit`,$=a.some(O=>O.value!=="");return qt(c1,{label:e,id:i,className:"dimensionEditor-fieldset",children:D7("div",{className:"dimensionEditor-row",children:[s&&qt("span",{className:"dimensionEditor-icon","aria-hidden":"true",children:qt(s,{size:14,width:14,height:14})}),qt("input",{id:G,type:"text",className:s?"dimensionEditor-input dimensionEditor-input--with-icon":"dimensionEditor-input",value:f,placeholder:g,onChange:D,onPaste:q,onBlur:M,onKeyDown:T,"aria-label":_e(d.ariaValue,[e]),autoComplete:"off",spellCheck:"false"}),$&&qt("select",{id:W,className:"dimensionEditor-unit",value:m,onChange:z,"aria-label":_e(d.ariaUnit,[e]),children:a.map(O=>qt("option",{value:O.value,children:O.label},O.value||"__unitless__"))})]})})}function a1(e,t){if(e==null)return{};var o={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;o[a]=e[a]}return o}function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)({}).hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},ie.apply(null,arguments)}var Y=Dn(K0(),1),F7=Dn(Q0(),1);import*as he from"react";import{cloneElement as lb,Component as nb,useRef as g1,useCallback as pe,useEffect as V1,useMemo as zt}from"react";var Y0=e=>typeof e=="object"&&e!=null&&e.nodeType===1,J0=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Da=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let o=getComputedStyle(e,null);return J0(o.overflowY,t)||J0(o.overflowX,t)||(a=>{let r=(l=>{if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch{return null}})(a);return!!r&&(r.clientHeight<a.scrollHeight||r.clientWidth<a.scrollWidth)})(e)}return!1},Oa=(e,t,o,a,r,l,n,i)=>l<e&&n>t||l>e&&n<t?0:l<=e&&i<=o||n>=t&&i>=o?l-e-a:n>t&&i<o||l<e&&i>o?n-t+r:0,Z7=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)},e5=(e,t)=>{var o,a,r,l;if(typeof document>"u")return[];let{scrollMode:n,block:i,inline:s,boundary:u,skipOverflowHiddenElements:d}=t,p=typeof u=="function"?u:L=>L!==u;if(!Y0(e))throw new TypeError("Invalid target");let C=document.scrollingElement||document.documentElement,g=[],f=e;for(;Y0(f)&&p(f);){if(f=Z7(f),f===C){g.push(f);break}f!=null&&f===document.body&&Da(f)&&!Da(document.documentElement)||f!=null&&Da(f,d)&&g.push(f)}let c=(a=(o=window.visualViewport)==null?void 0:o.width)!=null?a:innerWidth,m=(l=(r=window.visualViewport)==null?void 0:r.height)!=null?l:innerHeight,{scrollX:b,scrollY:h}=window,{height:R,width:v,top:H,right:D,bottom:q,left:M}=e.getBoundingClientRect(),{top:T,right:z,bottom:G,left:W}=(L=>{let x=window.getComputedStyle(L);return{top:parseFloat(x.scrollMarginTop)||0,right:parseFloat(x.scrollMarginRight)||0,bottom:parseFloat(x.scrollMarginBottom)||0,left:parseFloat(x.scrollMarginLeft)||0}})(e),$=i==="start"||i==="nearest"?H-T:i==="end"?q+G:H+R/2-T+G,O=s==="center"?M+v/2-W+z:s==="end"?D+z:M-W,N=[];for(let L=0;L<g.length;L++){let x=g[L],{height:w,width:I,top:y,right:E,bottom:B,left:U}=x.getBoundingClientRect();if(n==="if-needed"&&H>=0&&M>=0&&q<=m&&D<=c&&(x===C&&!Da(x)||H>=y&&q<=B&&M>=U&&D<=E))return N;let A=getComputedStyle(x),F=parseInt(A.borderLeftWidth,10),Z=parseInt(A.borderTopWidth,10),k=parseInt(A.borderRightWidth,10),te=parseInt(A.borderBottomWidth,10),le=0,de=0,S="offsetWidth"in x?x.offsetWidth-x.clientWidth-F-k:0,V="offsetHeight"in x?x.offsetHeight-x.clientHeight-Z-te:0,X="offsetWidth"in x?x.offsetWidth===0?0:I/x.offsetWidth:0,se="offsetHeight"in x?x.offsetHeight===0?0:w/x.offsetHeight:0;if(C===x)le=i==="start"?$:i==="end"?$-m:i==="nearest"?Oa(h,h+m,m,Z,te,h+$,h+$+R,R):$-m/2,de=s==="start"?O:s==="center"?O-c/2:s==="end"?O-c:Oa(b,b+c,c,F,k,b+O,b+O+v,v),le=Math.max(0,le+h),de=Math.max(0,de+b);else{le=i==="start"?$-y-Z:i==="end"?$-B+te+V:i==="nearest"?Oa(y,B,w,Z,te+V,$,$+R,R):$-(y+w/2)+V/2,de=s==="start"?O-U-F:s==="center"?O-(U+I/2)+S/2:s==="end"?O-E+k+S:Oa(U,E,I,F,k+S,O,O+v,v);let{scrollLeft:ke,scrollTop:we}=x;le=se===0?0:Math.max(0,Math.min(we+le/se,x.scrollHeight-w/se+V)),de=X===0?0:Math.max(0,Math.min(ke+de/X,x.scrollWidth-I/X+S)),$+=we-le,O+=ke-de}N.push({el:x,top:le,left:de})}return N};var $7=0;function i5(){return String($7++)}function Ro(e){var t=he.useRef(e);return t.current=e,t}function N7(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){t.forEach(function(r){typeof r=="function"?r(a):r&&(r.current=a)})}}function Hl(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){for(var r=arguments.length,l=new Array(r>1?r-1:0),n=1;n<r;n++)l[n-1]=arguments[n];return t.some(function(i){return i&&i.apply(void 0,[a].concat(l)),a.preventDownshiftDefault||a.hasOwnProperty("nativeEvent")&&a.nativeEvent.preventDownshiftDefault})}}function s5(e,t){var o;function a(){o&&clearTimeout(o)}function r(){for(var l=arguments.length,n=new Array(l),i=0;i<l;i++)n[i]=arguments[i];a(),o=setTimeout(function(){o=null,e.apply(void 0,n)},t)}return r.cancel=a,r}var U7=s5(function(e){u5(e).textContent=""},500);function u5(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function q7(e,t){if(!(!e||!t)){var o=u5(t);o.textContent=e,U7(t)}}function z7(e){var t=e?.getElementById("a11y-status-message");t&&t.remove()}function ko(){}var Tl=ko;function Ba(e,t){if(!t)return e;var o=Object.keys(e);return o.reduce(function(a,r){return t[r]!==void 0&&(a[r]=t[r]),a},ie({},e))}function j7(e,t){if(e){var o=e5(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});o.forEach(function(a){var r=a.el,l=a.top,n=a.left;r.scrollTop=l,r.scrollLeft=n})}}function t5(e,t,o){var a=e===t||t instanceof o.Node&&e.contains&&e.contains(t);return a}function K7(e,t){var o;function a(){o&&clearTimeout(o)}function r(){for(var l=arguments.length,n=new Array(l),i=0;i<l;i++)n[i]=arguments[i];a(),o=setTimeout(function(){o=null,e.apply(void 0,n)},t)}return r.cancel=a,r}function Te(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){for(var r=arguments.length,l=new Array(r>1?r-1:0),n=1;n<r;n++)l[n-1]=arguments[n];return t.some(function(i){return i&&i.apply(void 0,[a].concat(l)),a.preventDownshiftDefault||a.hasOwnProperty("nativeEvent")&&a.nativeEvent.preventDownshiftDefault})}}function Z1(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(a){t.forEach(function(r){typeof r=="function"?r(a):r&&(r.current=a)})}}function G7(e,t){return e[t]!==void 0}function Aa(e){var t=e.key,o=e.keyCode;return o>=37&&o<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function at(e,t,o,a,r){r===void 0&&(r=!1);var l=o.length;if(l===0)return-1;var n=l-1;(typeof e!="number"||e<0||e>n)&&(e=t>0?-1:n+1);var i=e+t;i<0?i=r?n:0:i>n&&(i=r?0:n);var s=jt(i,t<0,o,a,r);return s===-1?e>=l?-1:e:s}function jt(e,t,o,a,r){r===void 0&&(r=!1);var l=o.length;if(t){for(var n=e;n>=0;n--)if(!a(o[n],n))return n}else for(var i=e;i<l;i++)if(!a(o[i],i))return i;return r?jt(t?l-1:0,t,o,a):-1}function o5(e,t,o,a){return a===void 0&&(a=!0),o&&t.some(function(r){return r&&(t5(r,e,o)||a&&t5(r,o.document.activeElement,o))})}function Vl(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function W7(e,t,o,a){for(var r=e.type,l={},n=Object.keys(o),i=0,s=n;i<s.length;i++){var u=s[i];X7(u,e,t,o,a),a[u]!==o[u]&&(l[u]=a[u])}t.onStateChange&&Object.keys(l).length&&t.onStateChange(ie({type:r},l))}function X7(e,t,o,a,r){if(r[e]!==a[e]){var l="on"+Vl(e)+"Change",n=o[l];if(typeof n=="function"){var i=t.type;n(ie({type:i},r))}}}function d5(e,t,o,a){var r=he.useRef(null),l=he.useRef(void 0),n=Ro(t),i=he.useCallback(function(C,g){l.current=g,C=Ba(C,n.current);var f=e(C,n.current,g),c=n.current.stateReducer(C,ie({},g,{changes:f}));return ie({},C,c)},[n,e]),s=he.useReducer(i,t,o),u=s[0],d=s[1],p=l.current;return he.useEffect(function(){var C,g=Ba((C=r.current)!=null?C:{},n.current),f=p&&r.current&&!a(g,u);f&&W7(p,n.current,g,u),r.current=u},[u,p,a,n]),[u,d]}function _l(e,t,o,a){var r=d5(e,t,o,a),l=r[0],n=r[1];return[Ba(l,t),n]}function Dl(e,t,o,a){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){var r=o.indexOf(e);if(r<0)throw new Error(a);return[e,o.indexOf(e)]}if(t!==void 0){var l=o[t];if(l===void 0)throw new Error(a);return[l,t]}throw new Error(a)}function qa(){var e=he.useRef(!0);return he.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function Q7(e,t){return t.changes}var Y7={environment:Y.default.shape({addEventListener:Y.default.func.isRequired,removeEventListener:Y.default.func.isRequired,document:Y.default.shape({createElement:Y.default.func.isRequired,getElementById:Y.default.func.isRequired,activeElement:Y.default.any.isRequired,body:Y.default.any.isRequired}).isRequired,Node:Y.default.func.isRequired}),itemToKey:Y.default.func,stateReducer:Y.default.func};function _1(e,t,o){var a=e["default"+Vl(t)];return a!==void 0?a:o[t]}function Lt(e,t,o){var a=e[t];if(a!==void 0)return a;var r=e["initial"+Vl(t)];return r!==void 0?r:_1(e,t,o)}var a5=s5(function(e,t){q7(e,t)},200);function Ol(e,t,o,a){var r=a?.document,l=qa();he.useEffect(function(){if(!(!e||l||!r)){var n=e(t);a5(n,r)}},o),he.useEffect(function(){return function(){a5.cancel(),z7(r)}},[r])}var Mo=ie({},Y7,{getA11yStatusMessage:Y.default.func,highlightedIndex:Y.default.number,defaultHighlightedIndex:Y.default.number,initialHighlightedIndex:Y.default.number,isOpen:Y.default.bool,defaultIsOpen:Y.default.bool,initialIsOpen:Y.default.bool,selectedItem:Y.default.any,initialSelectedItem:Y.default.any,defaultSelectedItem:Y.default.any,id:Y.default.string,labelId:Y.default.string,menuId:Y.default.string,getItemId:Y.default.func,toggleButtonId:Y.default.string,onSelectedItemChange:Y.default.func,onHighlightedIndexChange:Y.default.func,onStateChange:Y.default.func,onIsOpenChange:Y.default.func,scrollIntoView:Y.default.func}),So={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:Q7,scrollIntoView:j7,environment:typeof window>"u"?void 0:window},r1={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},J7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?he.useLayoutEffect:he.useEffect;function e4(e){return/^\S{1}$/.test(e)}function c5(e){var t=Lt(e,"selectedItem",r1),o=Lt(e,"isOpen",r1),a=t4(e),r=Lt(e,"inputValue",r1);return{highlightedIndex:a<0&&t&&o?e.items.findIndex(function(l){return e.itemToKey(l)===e.itemToKey(t)}):a,isOpen:o,selectedItem:t,inputValue:r}}function wt(e,t,o){var a=e.items,r=e.initialHighlightedIndex,l=e.defaultHighlightedIndex,n=e.isItemDisabled,i=e.itemToKey,s=t.selectedItem,u=t.highlightedIndex;return a.length===0?-1:r!==void 0&&u===r&&!n(a[r],r)?r:l!==void 0&&!n(a[l],l)?l:s?a.findIndex(function(d){return i(s)===i(d)}):o<0&&!n(a[a.length-1],a.length-1)?a.length-1:o>0&&!n(a[0],0)?0:-1}function f5(e,t,o){var a=he.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),r=he.useCallback(function(){return o.map(function(l){return l.current})},[o]);return he.useEffect(function(){if(!e)return ko;function l(){a.current.isTouchEnd=!1,a.current.isMouseDown=!0}function n(d){a.current.isMouseDown=!1,o5(d.target,r(),e)||t()}function i(){a.current.isTouchEnd=!1,a.current.isTouchMove=!1}function s(){a.current.isTouchMove=!0}function u(d){a.current.isTouchEnd=!0,!a.current.isTouchMove&&!o5(d.target,r(),e,!1)&&t()}return e.addEventListener("mousedown",l),e.addEventListener("mouseup",n),e.addEventListener("touchstart",i),e.addEventListener("touchmove",s),e.addEventListener("touchend",u),function(){e.removeEventListener("mousedown",l),e.removeEventListener("mouseup",n),e.removeEventListener("touchstart",i),e.removeEventListener("touchmove",s),e.removeEventListener("touchend",u)}},[e,r,t]),a.current}var El=function(){return ko};function p5(e){var t=e.highlightedIndex,o=e.isOpen,a=e.itemRefs,r=e.getItemNodeFromIndex,l=e.menuElement,n=e.scrollIntoView,i=he.useRef(!0);return J7(function(){t<0||!o||!Object.keys(a.current).length||(i.current===!1?i.current=!0:n(r(t),l))},[t]),i}var Bl=ko;function Za(e,t,o){var a;o===void 0&&(o=!0);var r=((a=e.items)==null?void 0:a.length)&&t>=0;return ie({isOpen:!1,highlightedIndex:-1},r&&ie({selectedItem:e.items[t],isOpen:_1(e,"isOpen",r1),highlightedIndex:_1(e,"highlightedIndex",r1)},o&&{inputValue:e.itemToString(e.items[t])}))}function C5(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Fa(e){var t=_1(e,"highlightedIndex",r1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function t4(e){var t=Lt(e,"highlightedIndex",r1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function m5(e,t,o,a){var r=o.type,l;switch(r){case a.ItemMouseMove:l={highlightedIndex:o.disabled?-1:o.index};break;case a.MenuMouseLeave:l={highlightedIndex:-1};break;case a.ToggleButtonClick:case a.FunctionToggleMenu:l={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:wt(t,e,0)};break;case a.FunctionOpenMenu:l={isOpen:!0,highlightedIndex:wt(t,e,0)};break;case a.FunctionCloseMenu:l={isOpen:!1};break;case a.FunctionSetHighlightedIndex:l={highlightedIndex:t.isItemDisabled(t.items[o.highlightedIndex],o.highlightedIndex)?-1:o.highlightedIndex};break;case a.FunctionSetInputValue:l={inputValue:o.inputValue};break;case a.FunctionReset:l={highlightedIndex:Fa(t),isOpen:_1(t,"isOpen",r1),selectedItem:_1(t,"selectedItem",r1),inputValue:_1(t,"inputValue",r1)};break;default:throw new Error("Reducer called without proper action type.")}return ie({},e,l)}var o4=ie({},Mo,{items:Y.default.array.isRequired,isItemDisabled:Y.default.func}),a4=ie({},So,{isItemDisabled:function(){return!1}});function r4(e){for(var t=e.keysSoFar,o=e.highlightedIndex,a=e.items,r=e.itemToString,l=e.isItemDisabled,n=t.toLowerCase(),i=0;i<a.length;i++){var s=(i+o+(t.length<2?1:0))%a.length,u=a[s];if(u!==void 0&&r(u).toLowerCase().startsWith(n)&&!l(u,s))return s}return o}var Ea=0,Al=1,Zl=2,$a=3,Fl=4,$l=5,Nl=6,Ul=7,ql=8,zl=9,jl=10,Na=11,h5=12,g5=13,Kl=14,v5=15,x5=16,L5=17,w5=18,Gl=19,Pl=20,b5=21,I5=Object.freeze({__proto__:null,FunctionCloseMenu:L5,FunctionOpenMenu:x5,FunctionReset:b5,FunctionSelectItem:Gl,FunctionSetHighlightedIndex:w5,FunctionSetInputValue:Pl,FunctionToggleMenu:v5,ItemClick:Kl,ItemMouseMove:g5,MenuMouseLeave:h5,ToggleButtonBlur:Na,ToggleButtonClick:Ea,ToggleButtonKeyDownArrowDown:Al,ToggleButtonKeyDownArrowUp:Zl,ToggleButtonKeyDownCharacter:$a,ToggleButtonKeyDownEnd:Nl,ToggleButtonKeyDownEnter:Ul,ToggleButtonKeyDownEscape:Fl,ToggleButtonKeyDownHome:$l,ToggleButtonKeyDownPageDown:jl,ToggleButtonKeyDownPageUp:zl,ToggleButtonKeyDownSpaceButton:ql});function l4(e,t,o){var a,r=o.type,l=o.altKey,n;switch(r){case Kl:n={isOpen:_1(t,"isOpen",r1),highlightedIndex:Fa(t),selectedItem:t.items[o.index]};break;case $a:{var i=o.key,s=""+e.inputValue+i,u=!e.isOpen&&e.selectedItem?t.items.findIndex(function(g){return t.itemToKey(g)===t.itemToKey(e.selectedItem)}):e.highlightedIndex,d=r4({keysSoFar:s,highlightedIndex:u,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled});n={inputValue:s,highlightedIndex:d,isOpen:!0}}break;case Al:{var p=e.isOpen?at(e.highlightedIndex,1,t.items,t.isItemDisabled):l&&e.selectedItem==null?-1:wt(t,e,1);n={highlightedIndex:p,isOpen:!0}}break;case Zl:if(e.isOpen&&l)n=Za(t,e.highlightedIndex,!1);else{var C=e.isOpen?at(e.highlightedIndex,-1,t.items,t.isItemDisabled):wt(t,e,-1);n={highlightedIndex:C,isOpen:!0}}break;case Ul:case ql:n=Za(t,e.highlightedIndex,!1);break;case $l:n={highlightedIndex:jt(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case Nl:n={highlightedIndex:jt(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case zl:n={highlightedIndex:at(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case jl:n={highlightedIndex:at(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case Fl:n={isOpen:!1,highlightedIndex:-1};break;case Na:n=ie({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((a=t.items)==null?void 0:a.length)&&{selectedItem:t.items[e.highlightedIndex]});break;case Gl:n={selectedItem:o.selectedItem};break;default:return m5(e,t,o,I5)}return ie({},e,n)}var n4=ie({},he),y5=n4.useId,M5=typeof y5=="function"?i4:s4;function i4(e){var t=e.id,o=e.labelId,a=e.menuId,r=e.getItemId,l=e.toggleButtonId,n=e.inputId,i="downshift-"+y5();t||(t=i);var s=he.useMemo(function(){return{labelId:o??t+"-label",menuId:a??t+"-menu",getItemId:r??function(u){return t+"-item-"+u},toggleButtonId:l??t+"-toggle-button",inputId:n??t+"-input"}},[r,t,n,o,a,l]);return s}function s4(e){var t=e.id,o=e.labelId,a=e.menuId,r=e.getItemId,l=e.toggleButtonId,n=e.inputId,i=he.useRef(t??"downshift-"+i5()),s=i.current,u=he.useMemo(function(){return{labelId:o??s+"-label",menuId:a??s+"-menu",getItemId:r??function(d){return s+"-item-"+d},toggleButtonId:l??s+"-toggle-button",inputId:n??s+"-input"}},[r,n,o,a,l,s]);return u}var u4=["onClick"],d4=["onMouseLeave","refKey","ref"],c4=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],f4=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];za.stateChangeTypes=I5;function za(e){e===void 0&&(e={}),Tl(e,za,o4);var t=ie({},a4,e),o=t.scrollIntoView,a=t.environment,r=t.getA11yStatusMessage,l=_l(l4,t,c5,C5),n=l[0],i=l[1],s=n.isOpen,u=n.highlightedIndex,d=n.selectedItem,p=n.inputValue,C=g1(null),g=g1(null),f=g1({}),c=g1(null),m=M5(t),b=Ro({state:n,props:t}),h=pe(function(y){return f.current[m.getItemId(y)]},[m]);Ol(r,n,[s,u,d,p],a);var R=p5({menuElement:g.current,highlightedIndex:u,isOpen:s,itemRefs:f,scrollIntoView:o,getItemNodeFromIndex:h});V1(function(){return c.current=K7(function(y){y({type:Pl,inputValue:""})},500),function(){c.current.cancel()}},[]),V1(function(){p&&c.current(i)},[i,p]),Bl({props:t,state:n}),V1(function(){var y=Lt(t,"isOpen",r1);y&&C.current&&C.current.focus()},[]);var v=pe(function(){b.current.state.isOpen&&i({type:Na})},[i,b]),H=zt(function(){return[g,C]},[]),D=f5(a,v,H),q=El("getMenuProps","getToggleButtonProps");V1(function(){s||(f.current={})},[s]);var M=zt(function(){return{ArrowDown:function(E){E.preventDefault(),i({type:Al,altKey:E.altKey})},ArrowUp:function(E){E.preventDefault(),i({type:Zl,altKey:E.altKey})},Home:function(E){E.preventDefault(),i({type:$l})},End:function(E){E.preventDefault(),i({type:Nl})},Escape:function(){b.current.state.isOpen&&i({type:Fl})},Enter:function(E){E.preventDefault(),i({type:b.current.state.isOpen?Ul:Ea})},PageUp:function(E){b.current.state.isOpen&&(E.preventDefault(),i({type:zl}))},PageDown:function(E){b.current.state.isOpen&&(E.preventDefault(),i({type:jl}))}," ":function(E){E.preventDefault();var B=b.current.state;if(!B.isOpen){i({type:Ea});return}B.inputValue?i({type:$a,key:" "}):i({type:ql})}}},[i,b]),T=pe(function(){i({type:v5})},[i]),z=pe(function(){i({type:L5})},[i]),G=pe(function(){i({type:x5})},[i]),W=pe(function(y){i({type:w5,highlightedIndex:y})},[i]),$=pe(function(y){i({type:Gl,selectedItem:y})},[i]),O=pe(function(){i({type:b5})},[i]),N=pe(function(y){i({type:Pl,inputValue:y})},[i]),L=pe(function(y){var E=y===void 0?{}:y,B=E.onClick,U=a1(E,u4),A=function(){var Z;(Z=C.current)==null||Z.focus()};return ie({id:m.labelId,htmlFor:m.toggleButtonId,onClick:Te(B,A)},U)},[m]),x=pe(function(y,E){var B,U=y===void 0?{}:y,A=U.onMouseLeave,F=U.refKey,Z=F===void 0?"ref":F,k=U.ref,te=a1(U,d4),le=E===void 0?{}:E,de=le.suppressRefError,S=de===void 0?!1:de,V=function(){i({type:h5})};return q("getMenuProps",S,Z,g),ie((B={},B[Z]=Z1(k,function(X){g.current=X}),B.id=m.menuId,B.role="listbox",B["aria-labelledby"]=te&&te["aria-label"]?void 0:""+m.labelId,B.onMouseLeave=Te(A,V),B),te)},[i,q,m]),w=pe(function(y,E){var B,U=y===void 0?{}:y,A=U.onBlur,F=U.onClick;U.onPress;var Z=U.onKeyDown,k=U.refKey,te=k===void 0?"ref":k,le=U.ref,de=a1(U,c4),S=E===void 0?{}:E,V=S.suppressRefError,X=V===void 0?!1:V,se=b.current.state,ke=function(){i({type:Ea})},we=function(){se.isOpen&&!D.isMouseDown&&i({type:Na})},Qe=function(J){var Ce=Aa(J);Ce&&M[Ce]?M[Ce](J):e4(Ce)&&i({type:$a,key:Ce})},Q=ie((B={},B[te]=Z1(le,function(ne){C.current=ne}),B["aria-activedescendant"]=se.isOpen&&se.highlightedIndex>-1?m.getItemId(se.highlightedIndex):"",B["aria-controls"]=m.menuId,B["aria-expanded"]=b.current.state.isOpen,B["aria-haspopup"]="listbox",B["aria-labelledby"]=de&&de["aria-label"]?void 0:""+m.labelId,B.id=m.toggleButtonId,B.role="combobox",B.tabIndex=0,B.onBlur=Te(A,we),B),de);return de.disabled||(Q.onClick=Te(F,ke),Q.onKeyDown=Te(Z,Qe)),q("getToggleButtonProps",X,te,C),Q},[i,m,b,D,q,M]),I=pe(function(y){var E,B=y===void 0?{}:y,U=B.item,A=B.index,F=B.onMouseMove,Z=B.onClick,k=B.onMouseDown;B.onPress;var te=B.refKey,le=te===void 0?"ref":te,de=B.disabled,S=B.ref,V=a1(B,f4);de!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var X=b.current,se=X.state,ke=X.props,we=Dl(U,A,ke.items,"Pass either item or index to getItemProps!"),Qe=we[0],Q=we[1],ne=ke.isItemDisabled(Qe,Q),J=function(){D.isTouchEnd||Q===se.highlightedIndex||(R.current=!1,i({type:g5,index:Q,disabled:ne}))},Ce=function(){i({type:Kl,index:Q})},He=function(Ve){return Ve.preventDefault()},me=ie((E={},E[le]=Z1(S,function(ge){ge&&(f.current[m.getItemId(Q)]=ge)}),E["aria-disabled"]=ne,E["aria-selected"]=Qe===se.selectedItem,E.id=m.getItemId(Q),E.role="option",E),V);return ne||(me.onClick=Te(Z,Ce)),me.onMouseMove=Te(F,J),me.onMouseDown=Te(k,He),me},[b,m,D,R,i]);return{getToggleButtonProps:w,getLabelProps:L,getMenuProps:x,getItemProps:I,toggleMenu:T,openMenu:G,closeMenu:z,setHighlightedIndex:W,selectItem:$,reset:O,setInputValue:N,highlightedIndex:u,isOpen:s,selectedItem:d,inputValue:p}}var Wl=0,Xl=1,Ql=2,Yl=3,Jl=4,en=5,tn=6,on=7,an=8,Ua=9,rn=10,S5=11,R5=12,ln=13,k5=14,H5=15,P5=16,T5=17,V5=18,nn=19,_5=20,D5=21,sn=22,O5=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:sn,FunctionCloseMenu:T5,FunctionOpenMenu:P5,FunctionReset:D5,FunctionSelectItem:nn,FunctionSetHighlightedIndex:V5,FunctionSetInputValue:_5,FunctionToggleMenu:H5,InputBlur:Ua,InputChange:an,InputClick:rn,InputKeyDownArrowDown:Wl,InputKeyDownArrowUp:Xl,InputKeyDownEnd:Jl,InputKeyDownEnter:on,InputKeyDownEscape:Ql,InputKeyDownHome:Yl,InputKeyDownPageDown:tn,InputKeyDownPageUp:en,ItemClick:ln,ItemMouseMove:R5,MenuMouseLeave:S5,ToggleButtonClick:k5});function p4(e){var t=c5(e),o=t.selectedItem,a=t.inputValue;return a===""&&o&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(a=e.itemToString(o)),ie({},t,{inputValue:a})}var C4=ie({},Mo,{items:Y.default.array.isRequired,isItemDisabled:Y.default.func,inputValue:Y.default.string,defaultInputValue:Y.default.string,initialInputValue:Y.default.string,inputId:Y.default.string,onInputValueChange:Y.default.func});function m4(e,t,o,a){var r=g1(),l=d5(e,t,o,a),n=l[0],i=l[1],s=qa();return V1(function(){if(G7(t,"selectedItem")){if(!s){var u=t.itemToKey(t.selectedItem)!==t.itemToKey(r.current);u&&i({type:sn,inputValue:t.itemToString(t.selectedItem)})}r.current=n.selectedItem===r.current?t.selectedItem:n.selectedItem}},[n.selectedItem,t.selectedItem]),[Ba(n,t),i]}var h4=ie({},So,{isItemDisabled:function(){return!1}});function g4(e,t,o){var a,r=o.type,l=o.altKey,n;switch(r){case ln:n={isOpen:_1(t,"isOpen",r1),highlightedIndex:Fa(t),selectedItem:t.items[o.index],inputValue:t.itemToString(t.items[o.index])};break;case Wl:e.isOpen?n={highlightedIndex:at(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:n={highlightedIndex:l&&e.selectedItem==null?-1:wt(t,e,1),isOpen:t.items.length>=0};break;case Xl:e.isOpen?l?n=Za(t,e.highlightedIndex):n={highlightedIndex:at(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:n={highlightedIndex:wt(t,e,-1),isOpen:t.items.length>=0};break;case on:n=Za(t,e.highlightedIndex);break;case Ql:n=ie({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case en:n={highlightedIndex:at(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case tn:n={highlightedIndex:at(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case Yl:n={highlightedIndex:jt(0,!1,t.items,t.isItemDisabled)};break;case Jl:n={highlightedIndex:jt(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Ua:n=ie({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((a=t.items)==null?void 0:a.length)&&o.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case an:n={isOpen:!0,highlightedIndex:Fa(t),inputValue:o.inputValue};break;case rn:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:wt(t,e,0)};break;case nn:n={selectedItem:o.selectedItem,inputValue:t.itemToString(o.selectedItem)};break;case sn:n={inputValue:o.inputValue};break;default:return m5(e,t,o,O5)}return ie({},e,n)}var v4=["onMouseLeave","refKey","ref"],x4=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],L4=["onClick","onPress","refKey","ref"],w4=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];E5.stateChangeTypes=O5;function E5(e){e===void 0&&(e={}),Tl(e,E5,C4);var t=ie({},h4,e),o=t.items,a=t.scrollIntoView,r=t.environment,l=t.getA11yStatusMessage,n=m4(g4,t,p4,C5),i=n[0],s=n[1],u=i.isOpen,d=i.highlightedIndex,p=i.selectedItem,C=i.inputValue,g=g1(null),f=g1({}),c=g1(null),m=g1(null),b=qa(),h=M5(t),R=g1(),v=Ro({state:i,props:t}),H=pe(function(A){return f.current[h.getItemId(A)]},[h]);Ol(l,i,[u,d,p,C],r);var D=p5({menuElement:g.current,highlightedIndex:d,isOpen:u,itemRefs:f,scrollIntoView:a,getItemNodeFromIndex:H});Bl({props:t,state:i}),V1(function(){var A=Lt(t,"isOpen",r1);A&&c.current&&c.current.focus()},[]),V1(function(){b||(R.current=o.length)});var q=pe(function(){v.current.state.isOpen&&s({type:Ua})},[s,v]),M=zt(function(){return[g,m,c]},[]),T=f5(r,q,M),z=El("getInputProps","getMenuProps");V1(function(){u||(f.current={})},[u]),V1(function(){var A;!u||!(r!=null&&r.document)||!(c!=null&&(A=c.current)!=null&&A.focus)||r.document.activeElement!==c.current&&c.current.focus()},[u,r]);var G=zt(function(){return{ArrowDown:function(F){F.preventDefault(),s({type:Wl,altKey:F.altKey})},ArrowUp:function(F){F.preventDefault(),s({type:Xl,altKey:F.altKey})},Home:function(F){v.current.state.isOpen&&(F.preventDefault(),s({type:Yl}))},End:function(F){v.current.state.isOpen&&(F.preventDefault(),s({type:Jl}))},Escape:function(F){var Z=v.current.state;(Z.isOpen||Z.inputValue||Z.selectedItem||Z.highlightedIndex>-1)&&(F.preventDefault(),s({type:Ql}))},Enter:function(F){var Z=v.current.state;!Z.isOpen||F.which===229||(F.preventDefault(),s({type:on}))},PageUp:function(F){v.current.state.isOpen&&(F.preventDefault(),s({type:en}))},PageDown:function(F){v.current.state.isOpen&&(F.preventDefault(),s({type:tn}))}}},[s,v]),W=pe(function(A){return ie({id:h.labelId,htmlFor:h.inputId},A)},[h]),$=pe(function(A,F){var Z,k=A===void 0?{}:A,te=k.onMouseLeave,le=k.refKey,de=le===void 0?"ref":le,S=k.ref,V=a1(k,v4),X=F===void 0?{}:F,se=X.suppressRefError,ke=se===void 0?!1:se;return z("getMenuProps",ke,de,g),ie((Z={},Z[de]=Z1(S,function(we){g.current=we}),Z.id=h.menuId,Z.role="listbox",Z["aria-labelledby"]=V&&V["aria-label"]?void 0:""+h.labelId,Z.onMouseLeave=Te(te,function(){s({type:S5})}),Z),V)},[s,z,h]),O=pe(function(A){var F,Z,k=A===void 0?{}:A,te=k.item,le=k.index,de=k.refKey,S=de===void 0?"ref":de,V=k.ref,X=k.onMouseMove,se=k.onMouseDown,ke=k.onClick;k.onPress;var we=k.disabled,Qe=a1(k,x4);we!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var Q=v.current,ne=Q.props,J=Q.state,Ce=Dl(te,le,ne.items,"Pass either item or index to getItemProps!"),He=Ce[0],me=Ce[1],ge=ne.isItemDisabled(He,me),Ve="onClick",Ke=ke,l1=function(){T.isTouchEnd||me===J.highlightedIndex||(D.current=!1,s({type:R5,index:me,disabled:ge}))},Me=function(){s({type:ln,index:me})},qe=function(nt){return nt.preventDefault()};return ie((F={},F[S]=Z1(V,function(Oe){Oe&&(f.current[h.getItemId(me)]=Oe)}),F["aria-disabled"]=ge,F["aria-selected"]=me===J.highlightedIndex,F.id=h.getItemId(me),F.role="option",F),!ge&&(Z={},Z[Ve]=Te(Ke,Me),Z),{onMouseMove:Te(X,l1),onMouseDown:Te(se,qe)},Qe)},[s,h,v,T,D]),N=pe(function(A){var F,Z=A===void 0?{}:A,k=Z.onClick;Z.onPress;var te=Z.refKey,le=te===void 0?"ref":te,de=Z.ref,S=a1(Z,L4),V=v.current.state,X=function(){s({type:k5})};return ie((F={},F[le]=Z1(de,function(se){m.current=se}),F["aria-controls"]=h.menuId,F["aria-expanded"]=V.isOpen,F.id=h.toggleButtonId,F.tabIndex=-1,F),!S.disabled&&ie({},{onClick:Te(k,X)}),S)},[s,v,h]),L=pe(function(A,F){var Z,k=A===void 0?{}:A,te=k.onKeyDown,le=k.onChange,de=k.onInput,S=k.onBlur;k.onChangeText;var V=k.onClick,X=k.refKey,se=X===void 0?"ref":X,ke=k.ref,we=a1(k,w4),Qe=F===void 0?{}:F,Q=Qe.suppressRefError,ne=Q===void 0?!1:Q;z("getInputProps",ne,se,c);var J=v.current.state,Ce=function(qe){var Oe=Aa(qe);Oe&&G[Oe]&&G[Oe](qe)},He=function(qe){s({type:an,inputValue:qe.target.value})},me=function(qe){if(r!=null&&r.document&&J.isOpen&&!T.isMouseDown){var Oe=qe.relatedTarget===null&&r.document.activeElement!==r.document.body;s({type:Ua,selectItem:!Oe})}},ge=function(){s({type:rn})},Ve="onChange",Ke={};if(!we.disabled){var l1;Ke=(l1={},l1[Ve]=Te(le,de,He),l1.onKeyDown=Te(te,Ce),l1.onBlur=Te(S,me),l1.onClick=Te(V,ge),l1)}return ie((Z={},Z[se]=Z1(ke,function(Me){c.current=Me}),Z["aria-activedescendant"]=J.isOpen&&J.highlightedIndex>-1?h.getItemId(J.highlightedIndex):"",Z["aria-autocomplete"]="list",Z["aria-controls"]=h.menuId,Z["aria-expanded"]=J.isOpen,Z["aria-labelledby"]=we&&we["aria-label"]?void 0:h.labelId,Z.autoComplete="off",Z.id=h.inputId,Z.role="combobox",Z.value=J.inputValue,Z),Ke,we)},[s,h,r,G,v,T,z]),x=pe(function(){s({type:H5})},[s]),w=pe(function(){s({type:T5})},[s]),I=pe(function(){s({type:P5})},[s]),y=pe(function(A){s({type:V5,highlightedIndex:A})},[s]),E=pe(function(A){s({type:nn,selectedItem:A})},[s]),B=pe(function(A){s({type:_5,inputValue:A})},[s]),U=pe(function(){s({type:D5})},[s]);return{getItemProps:O,getLabelProps:W,getMenuProps:$,getInputProps:L,getToggleButtonProps:N,toggleMenu:x,openMenu:I,closeMenu:w,setHighlightedIndex:y,setInputValue:B,selectItem:E,reset:U,highlightedIndex:d,isOpen:u,selectedItem:p,inputValue:C}}var B5={activeIndex:-1,selectedItems:[]};function r5(e,t){return Lt(e,t,B5)}function l5(e,t){return _1(e,t,B5)}function b4(e){var t=r5(e,"activeIndex"),o=r5(e,"selectedItems");return{activeIndex:t,selectedItems:o}}function n5(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}function I4(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var sb={stateReducer:Mo.stateReducer,itemToKey:Mo.itemToKey,environment:Mo.environment,selectedItems:Y.default.array,initialSelectedItems:Y.default.array,defaultSelectedItems:Y.default.array,getA11yStatusMessage:Y.default.func,activeIndex:Y.default.number,initialActiveIndex:Y.default.number,defaultActiveIndex:Y.default.number,onActiveIndexChange:Y.default.func,onSelectedItemsChange:Y.default.func,keyNavigationNext:Y.default.string,keyNavigationPrevious:Y.default.string},y4={itemToKey:So.itemToKey,stateReducer:So.stateReducer,environment:So.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},M4=ko,un=0,dn=1,cn=2,fn=3,pn=4,Cn=5,mn=6,hn=7,gn=8,vn=9,xn=10,Ln=11,wn=12,S4=Object.freeze({__proto__:null,DropdownClick:hn,DropdownKeyDownBackspace:mn,DropdownKeyDownNavigationPrevious:Cn,FunctionAddSelectedItem:gn,FunctionRemoveSelectedItem:vn,FunctionReset:wn,FunctionSetActiveIndex:Ln,FunctionSetSelectedItems:xn,SelectedItemClick:un,SelectedItemKeyDownBackspace:cn,SelectedItemKeyDownDelete:dn,SelectedItemKeyDownNavigationNext:fn,SelectedItemKeyDownNavigationPrevious:pn});function R4(e,t,o){var a=o.type,r=o.index,l=o.selectedItem,n=e.activeIndex,i=e.selectedItems,s;switch(a){case un:s={activeIndex:r};break;case pn:s={activeIndex:n-1<0?0:n-1};break;case fn:s={activeIndex:n+1>=i.length?-1:n+1};break;case cn:case dn:{if(n<0)break;var u=n;i.length===1?u=-1:n===i.length-1&&(u=i.length-2),s=ie({selectedItems:[].concat(i.slice(0,n),i.slice(n+1))},{activeIndex:u});break}case Cn:s={activeIndex:i.length-1};break;case mn:s={selectedItems:i.slice(0,i.length-1)};break;case gn:s={selectedItems:[].concat(i,[l])};break;case hn:s={activeIndex:-1};break;case vn:{var d=n,p=i.findIndex(function(f){return t.itemToKey(f)===t.itemToKey(l)});if(p<0)break;i.length===1?d=-1:p===i.length-1&&(d=i.length-2),s={selectedItems:[].concat(i.slice(0,p),i.slice(p+1)),activeIndex:d};break}case xn:{var C=o.selectedItems;s={selectedItems:C};break}case Ln:{var g=o.activeIndex;s={activeIndex:g};break}case wn:s={activeIndex:l5(t,"activeIndex"),selectedItems:l5(t,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return ie({},e,s)}var k4=["refKey","ref","onClick","onKeyDown","selectedItem","index"],H4=["refKey","ref","onKeyDown","onClick","preventKeyAction"];A5.stateChangeTypes=S4;function A5(e){e===void 0&&(e={}),M4(e,A5);var t=ie({},y4,e),o=t.getA11yStatusMessage,a=t.environment,r=t.keyNavigationNext,l=t.keyNavigationPrevious,n=_l(R4,t,b4,I4),i=n[0],s=n[1],u=i.activeIndex,d=i.selectedItems,p=qa(),C=g1(null),g=g1();g.current=[];var f=Ro({state:i,props:t});Ol(o,i,[u,d],a),V1(function(){p||(u===-1&&C.current?C.current.focus():g.current[u]&&g.current[u].focus())},[u]),Bl({props:t,state:i});var c=El("getDropdownProps"),m=zt(function(){var T;return T={},T[l]=function(){s({type:pn})},T[r]=function(){s({type:fn})},T.Delete=function(){s({type:dn})},T.Backspace=function(){s({type:cn})},T},[s,r,l]),b=zt(function(){var T;return T={},T[l]=function(z){n5(z)&&s({type:Cn})},T.Backspace=function(G){n5(G)&&s({type:mn})},T},[s,l]),h=pe(function(T){var z,G=T===void 0?{}:T,W=G.refKey,$=W===void 0?"ref":W,O=G.ref,N=G.onClick,L=G.onKeyDown,x=G.selectedItem,w=G.index,I=a1(G,k4),y=f.current.state,E=Dl(x,w,y.selectedItems,"Pass either item or index to getSelectedItemProps!"),B=E[1],U=B>-1&&B===y.activeIndex,A=function(){s({type:un,index:B})},F=function(k){var te=Aa(k);te&&m[te]&&m[te](k)};return ie((z={},z[$]=Z1(O,function(Z){Z&&g.current.push(Z)}),z.tabIndex=U?0:-1,z.onClick=Te(N,A),z.onKeyDown=Te(L,F),z),I)},[s,f,m]),R=pe(function(T,z){var G,W=T===void 0?{}:T,$=W.refKey,O=$===void 0?"ref":$,N=W.ref,L=W.onKeyDown,x=W.onClick,w=W.preventKeyAction,I=w===void 0?!1:w,y=a1(W,H4),E=z===void 0?{}:z,B=E.suppressRefError,U=B===void 0?!1:B;c("getDropdownProps",U,O,C);var A=function(k){var te=Aa(k);te&&b[te]&&b[te](k)},F=function(){s({type:hn})};return ie((G={},G[O]=Z1(N,function(Z){Z&&(C.current=Z)}),G),!I&&{onKeyDown:Te(L,A),onClick:Te(x,F)},y)},[s,b,c]),v=pe(function(T){s({type:gn,selectedItem:T})},[s]),H=pe(function(T){s({type:vn,selectedItem:T})},[s]),D=pe(function(T){s({type:xn,selectedItems:T})},[s]),q=pe(function(T){s({type:Ln,activeIndex:T})},[s]),M=pe(function(){s({type:wn})},[s]);return{getSelectedItemProps:h,getDropdownProps:R,addSelectedItem:v,removeSelectedItem:H,setSelectedItems:D,setActiveIndex:q,reset:M,selectedItems:d,activeIndex:u}}var bn=0,In=1,yn=2,Mn=3,Sn=4,Rn=5,kn=6,P4=Object.freeze({__proto__:null,FunctionAddItem:kn,TagClick:bn,TagGroupKeyDownArrowLeft:In,TagGroupKeyDownArrowRight:yn,TagGroupKeyDownBackspace:Sn,TagGroupKeyDownDelete:Mn,TagRemoveClick:Rn});function T4(e,t,o){var a=o.type,r;switch(a){case bn:r={activeIndex:o.index};break;case In:r={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case yn:r={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case Sn:case Mn:{var l=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),n=l.length===0?-1:l.length===e.activeIndex?e.activeIndex-1:e.activeIndex;r={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:n};break}case Rn:{var i=[].concat(e.items.slice(0,o.index),e.items.slice(o.index+1)),s=i.length===0?-1:i.length===o.index?o.index-1:o.index;r={items:i,activeIndex:s}}break;case kn:{var u=[];o.index===void 0?u=[].concat(e.items,[o.item]):u=[].concat(e.items.slice(0,o.index),[o.item],e.items.slice(o.index));var d=e.activeIndex===-1?u.length-1:e.activeIndex;r={items:u,activeIndex:d};break}default:throw new Error("Invalid useTagGroup reducer action.")}return ie({},e,r)}var V4=ie({},he),Z5=V4.useId,_4=typeof Z5=="function"?D4:O4;function D4(e){var t=e.id,o=e.tagGroupId,a=e.getTagId,r="downshift-"+Z5();t||(t=r);var l=he.useMemo(function(){return{tagGroupId:o??t+"-tag-group",getTagId:a??function(n){return t+"-tag-"+n}}},[a,t,o]);return l}function O4(e){var t=e.id,o=e.getTagId,a=e.tagGroupId,r=he.useRef(t??"downshift-"+i5()),l=r.current,n=he.useMemo(function(){return{tagGroupId:a??l+"-tag-group",getTagId:o??function(i){return l+"-tag-"+i}}},[o,l,a]);return n}function E4(e){var t,o,a,r,l=(t=(o=e.items)!=null?o:e.initialItems)!=null?t:[],n=(a=(r=e.activeIndex)!=null?r:e.initialActiveIndex)!=null?a:l.length===0?-1:0;return{activeIndex:n,items:l}}function B4(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var F5="tag-group-a11y-description";function A4(e,t){he.useEffect(function(){if(e){var o=e.createElement("div");return o.setAttribute("id",F5),o.style.display="none",o.textContent=t,e.body.appendChild(o),function(){o.remove()}}},[t,e])}function Z4(e){return ie({stateReducer:function(o,a){var r=a.changes;return r},environment:typeof window>"u"?void 0:window,removeElementDescription:"Press Delete or Backspace to remove tag."},e)}function F4(e,t,o){var a=he.useRef({}),r=he.useRef(e),l=he.useRef(t);return he.useEffect(function(){if(e!==-1&&r.current!==-1&&e!==r.current||l.current===t+1){var n;(n=a.current[o(e)])==null||n.focus()}r.current=e,l.current=t},[e,o,t]),a}var $4={isItemDisabled:Y.default.func},N4=["onKeyDown"],U4=["index","refKey","ref","onClick"],q4=["index","onClick"],$5=function(t){var o;t===void 0&&(t={}),Tl(t,$5,$4);var a=Z4(t),r=_l(T4,a,E4,B4),l=r[0],n=r[1],i=l.activeIndex,s=l.items,u=Ro({state:l,props:a}),d=_4({getTagId:a.getTagId,id:a.id,tagGroupId:a.tagGroupId});A4((o=a.environment)==null?void 0:o.document,a.removeElementDescription);var p=F4(i,s.length,d.getTagId),C=pe(function(m){var b=m??{},h=b.onKeyDown,R=a1(b,N4),v=function(q){switch(q.key){case"ArrowLeft":n({type:In});break;case"ArrowRight":n({type:yn});break;case"Delete":n({type:Mn});break;case"Backspace":n({type:Sn});break}},H=ie({id:d.tagGroupId,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions",role:"listbox",onKeyDown:Hl(h,v)},R);return H},[n,d.tagGroupId]),g=pe(function(m){var b,h=m.index,R=m.refKey,v=R===void 0?"ref":R,H=m.ref,D=m.onClick,q=a1(m,U4);if(!Number.isInteger(h)||h<0)throw new Error("Pass correct item index to getTagProps!");var M=u.current.state,T=function(){n({type:bn,index:h})},z=d.getTagId(h);return ie((b={"aria-describedby":F5},b[v]=N7(H,function(G){G&&(p.current[z]=G)}),b["aria-labelledby"]=z,b.role="option",b.id=z,b.onClick=Hl(D,T),b.tabIndex=M.activeIndex===h?0:-1,b),q)},[n,d,u,p]),f=pe(function(m){var b=m.index,h=m.onClick,R=a1(m,q4);if(!Number.isInteger(b)||b<0)throw new Error("Pass correct item index to getTagRemoveProps!");var v=function(M){M.stopPropagation(),n({type:Rn,index:b})},H=d.getTagId(b),D=H+"-remove";return ie({id:D,tabIndex:-1,"aria-labelledby":D+" "+H,onClick:Hl(h,v)},R)},[d,n]),c=pe(function(m,b){n({type:kn,item:m,index:b})},[n]);return{activeIndex:i,addItem:c,getTagGroupProps:C,getTagProps:g,getTagRemoveProps:f,items:s}};$5.stateChangeTypes=P4;import Kt from"react";import{createPortal as z4}from"react-dom";import{jsx as F1,jsxs as N5}from"react/jsx-runtime";var j4=260,ja=4,K4=F1(t9,{width:9,height:9}),G4=F1(o9,{width:9,height:9}),W4={ariaReset:"Reset {0} to default"};function X4(e){let t=e.getBoundingClientRect(),o=Ct(e),a=o?o.getBoundingClientRect():{top:0,bottom:window.innerHeight},r=a.bottom-t.bottom-ja,l=t.top-a.top-ja,n=r<j4&&l>r;return{top:n?t.top-ja:t.bottom+ja,left:t.left,width:t.width,openAbove:n}}function Gt({label:e,options:t,selectedItem:o,onChange:a,id:r="picklist",getOptionStyle:l,triggerLabel:n,triggerMuted:i=!1,triggerStyle:s,aria:u}){let[d,p]=Kt.useState({top:0,left:0,width:0,openAbove:!1}),C=Kt.useRef(null),g=`${r}-legend`,f=n1(W4,u),c=_e(f.ariaReset,[e]),m=Kt.useMemo(()=>t.filter($=>$.value!==""),[t]),b=o!=null,h=()=>{C.current?.focus(),a("")},{isOpen:R,closeMenu:v,highlightedIndex:H,getToggleButtonProps:D,getMenuProps:q,getItemProps:M}=za({items:m,itemToString:$=>$?$.label:"",selectedItem:o,onSelectedItemChange:({selectedItem:$})=>{typeof a=="function"&&$&&$.value!==o?.value&&a($.value)},onIsOpenChange:({isOpen:$})=>{$&&C.current&&p(X4(C.current))},id:r,labelId:g});Kt.useEffect(()=>{if(!R||!C.current)return;let $=Ct(C.current);if(!$)return;let O=()=>v();return $.addEventListener("scroll",O,{passive:!0}),()=>$.removeEventListener("scroll",O)},[R,v]);let T="picklistEditor-dropdown"+(R?" picklistEditor-dropdown--open":""),z=R?{top:d.top,left:d.left,width:d.width,...d.openAbove?{transform:"translateY(-100%)"}:void 0}:void 0,[G,W]=Kt.useState(null);return Kt.useLayoutEffect(()=>{let O=C.current?.getRootNode();W(O instanceof ShadowRoot?O:document.body)},[]),F1(c1,{label:e,id:r,className:"picklistEditor-fieldset",children:N5("div",{className:"picklistEditor-wrapper",children:[N5("button",{type:"button",className:"picklistEditor-trigger",style:s,...D({ref:C}),children:[F1("span",{className:"picklistEditor-trigger-label"+(i?" picklistEditor-trigger-label--muted":""),children:n??o?.label??"Default"}),F1("span",{className:"picklistEditor-trigger-chevron","aria-hidden":"true",children:R?G4:K4})]}),b&&F1("button",{type:"button",className:"picklistEditor-reset",onClick:h,"aria-label":c,title:c,children:F1(Wn,{width:14,height:14})}),z4(F1("ul",{className:T,style:z,...q(),children:R&&m.map(($,O)=>F1("li",{className:"picklistEditor-option"+(H===O?" picklistEditor-option--highlighted":"")+(o?.value===$.value?" picklistEditor-option--selected":""),style:l?l($):void 0,...M({item:$,index:O}),children:$.label},$.value))}),G??document.body)]})})}import{jsx as e8}from"react/jsx-runtime";var Q4=[{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, sans-serif",label:"Helvetica"},{value:"Verdana, sans-serif",label:"Verdana"},{value:"Tahoma, sans-serif",label:"Tahoma"},{value:"'Trebuchet MS', sans-serif",label:"Trebuchet MS"},{value:"'Lucida Sans Unicode', sans-serif",label:"Lucida Sans"},{value:"Georgia, serif",label:"Georgia"},{value:"'Times New Roman', serif",label:"Times New Roman"},{value:"'Palatino Linotype', serif",label:"Palatino"},{value:"'Courier New', monospace",label:"Courier New"},{value:"'Lucida Console', monospace",label:"Lucida Console"}];function U5(e){return(e.split(",")[0]??"").trim().replace(/['"]/g,"")}function Y4(e,t){if(!e)return null;let o=e.replace(/['"]/g,""),a=U5(e);for(let r of t){if(!r.value)continue;let l=r.value.replace(/['"]/g,"");if(o.indexOf(l)!==-1||l.indexOf(a)!==-1)return r}return null}var J4=e=>e.value?{fontFamily:e.value}:void 0;function q5({label:e="Font family",value:t,computedValue:o,options:a,onChange:r,matchOption:l=Y4,id:n="font-family",aria:i}){let s=a??Q4,u=l(t,s),d=t||o,p=l(d,s),C=!u,g;return p?g=p.label:d&&(g=U5(d)||void 0),e8(Gt,{label:e,options:s,selectedItem:u,triggerLabel:g,triggerMuted:C,triggerStyle:d?{fontFamily:d}:void 0,onChange:r,id:n,getOptionStyle:J4,aria:i})}import{jsx as Hn}from"react/jsx-runtime";var t8=[{value:"normal",labelKey:"normal",defaultLabel:"Normal",icon:Hn(Fn,{width:14,height:14})},{value:"italic",labelKey:"italic",defaultLabel:"Italic",icon:Hn(Zn,{width:14,height:14})}];function z5({label:e="Font Style",value:t,onChange:o,id:a="font-style",optionLabels:r}){let l=t8.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return Hn(M1,{label:e,options:l,value:t||"normal",onChange:o,id:a})}import{jsx as l8}from"react/jsx-runtime";var o8=[{value:"100",labelKey:"thin",defaultWord:"Thin"},{value:"200",labelKey:"extraLight",defaultWord:"Extra Light"},{value:"300",labelKey:"light",defaultWord:"Light"},{value:"400",labelKey:"regular",defaultWord:"Regular"},{value:"500",labelKey:"medium",defaultWord:"Medium"},{value:"600",labelKey:"semiBold",defaultWord:"Semi Bold"},{value:"700",labelKey:"bold",defaultWord:"Bold"},{value:"800",labelKey:"extraBold",defaultWord:"Extra Bold"},{value:"900",labelKey:"black",defaultWord:"Black"}];function a8(e){return o8.map(t=>{let o=e?.[t.labelKey]??t.defaultWord;return{value:t.value,label:`${o} (${t.value})`}})}function r8(e,t){if(!e)return null;let o=String(e).trim();return t.find(a=>a.value===o)??null}function j5({label:e="Font weight",value:t,computedValue:o,options:a,onChange:r,matchOption:l=r8,id:n="font-weight",optionLabels:i,aria:s}){let u=a??a8(i),d=l(t,u),p=l(t||o,u),C=!d,g=p?.label;return l8(Gt,{label:e,options:u,selectedItem:d,triggerLabel:g,triggerMuted:C,onChange:r,id:n,aria:s})}import ue from"react";import{createPortal as n8}from"react-dom";import{jsx as re,jsxs as Ne}from"react/jsx-runtime";var i8={tabCms:"CMS",tabLocal:"Local",tabUrl:"URL",ariaTablist:"Image source",clearImage:"Clear image",chooseFile:"Choose File...",ariaChooseFile:"Choose an image file from your computer",useThisImage:"Use This Image",ariaImageUrl:"Image URL",urlPlaceholder:"https://example.com/image.png",previewAlt:"Preview",altText:"Alt Text",altPlaceholder:"Describe the image",width:"Width",height:"Height",autoPlaceholder:"auto",workspace:"Workspace",selectWorkspace:"Select a workspace...",selectImage:"Select an Image",loadingWorkspaces:"Loading workspaces...",noWorkspaces:"No CMS workspaces found",loadingImages:"Loading images...",noImages:"No images in this workspace",loadingMore:"Loading more...",untitled:"Untitled",downloadingImage:"Downloading image...",downloadFailed:"Download failed",closePicker:"Close",cancel:"Cancel",done:"Done",pickerTitle:"Select an image from {0}",pickerError:"Error: {0}"},Wt=["cms","local","url"];function s8({labels:e,workspaceName:t,folderId:o,portalTarget:a,folderItemsResult:r,contentDetail:l,thumbnailResult:n,onFetchFolderItems:i,onFetchContentDetail:s,onFetchThumbnail:u,onCancel:d,onConfirm:p}){let[C,g]=ue.useState([]),[f,c]=ue.useState(0),[m,b]=ue.useState(!0),[h,R]=ue.useState(!1),[v,H]=ue.useState(null),[D,q]=ue.useState(null),[M,T]=ue.useState({}),[z,G]=ue.useState({}),W=ue.useRef(new Set),$=ue.useRef(new Set),O=ue.useCallback(I=>{h||typeof i=="function"&&(R(!0),H(null),i(o,I,20))},[o,h,i]);ue.useEffect(()=>{O(0)},[o]),ue.useEffect(()=>{let I=y=>{y.key==="Escape"&&(y.stopPropagation(),d())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[d]);let N=ue.useRef(null);ue.useEffect(()=>{N.current?.focus()},[]),ue.useEffect(()=>{if(!r)return;let I=(r.items??[]).map(y=>({contentKey:y.contentKey,title:y.title??e.untitled,mimeType:y.mimeType??"image/png"}));g(y=>r.page===0?I:[...y,...I]),b(!!r.hasMore),c(r.page??0),R(!1),r.error&&H(String(r.error))},[r]),ue.useEffect(()=>{if(!l)return;let I=l.contentKey;if(!I||l.error)return;let y=l.url??"",E=l.mimeType??"image/png",B=l.title??"";T(U=>U[I]?U:{...U,[I]:{url:y,mimeType:E,title:B}}),y&&!$.current.has(I)&&typeof u=="function"&&($.current.add(I),u(I,y,E))},[l,u]),ue.useEffect(()=>{if(!n)return;let{imageId:I,thumbnailUrl:y}=n;I&&y&&G(E=>({...E,[I]:y}))},[n]);let L=ue.useRef(null);ue.useEffect(()=>{let I=L.current;if(!I||!m||h)return;let y=new IntersectionObserver(E=>{E.some(U=>U.isIntersecting)&&O(f+1)});return y.observe(I),()=>y.disconnect()},[m,h,f,O]);let x=ue.useCallback(I=>{W.current.has(I)||typeof s=="function"&&(W.current.add(I),s(I))},[s]),w=()=>{if(!D)return;let I=M[D],y=C.find(E=>E.contentKey===D);!I||!y||p({contentKey:D,title:y.title,url:I.url,mimeType:I.mimeType||y.mimeType})};return n8(re("div",{ref:N,tabIndex:-1,className:"cmsPicker-overlay",role:"dialog","aria-modal":"true","aria-label":_e(e.pickerTitle,[t]),onClick:I=>{I.target===I.currentTarget&&d()},children:Ne("div",{className:"cmsPicker-dialog",children:[Ne("div",{className:"cmsPicker-header",children:[re("span",{className:"cmsPicker-title",children:_e(e.pickerTitle,[t])}),re("button",{type:"button",className:"cmsPicker-close",onClick:d,"aria-label":e.closePicker,title:e.closePicker,children:"\u2715"})]}),Ne("div",{className:"cmsPicker-body",children:[C.length===0&&h&&re("div",{className:"cmsPicker-empty",children:e.loadingImages}),C.length===0&&!h&&!v&&re("div",{className:"cmsPicker-empty",children:e.noImages}),v&&re("div",{className:"cmsPicker-empty",children:_e(e.pickerError,[v])}),Ne("div",{className:"cmsPicker-grid",children:[C.map(I=>re(u8,{item:I,selected:D===I.contentKey,thumbnailDataUrl:z[I.contentKey],onIntersect:()=>x(I.contentKey),onClick:()=>q(I.contentKey)},I.contentKey)),m&&re("div",{className:"cmsPicker-sentinel",ref:L,children:h?e.loadingMore:""})]})]}),Ne("div",{className:"cmsPicker-footer",children:[re("button",{type:"button",className:"cmsPicker-btn",onClick:d,children:e.cancel}),re("button",{type:"button",className:"cmsPicker-btn cmsPicker-btn--primary",disabled:!D||!M[D??""],onClick:w,children:e.done})]})]})}),a)}function u8({item:e,selected:t,thumbnailDataUrl:o,onIntersect:a,onClick:r}){let l=ue.useRef(null),n=ue.useRef(!1);return ue.useEffect(()=>{let i=l.current;if(!i||n.current)return;let s=new IntersectionObserver(u=>{u.some(p=>p.isIntersecting)&&!n.current&&(n.current=!0,a(),s.disconnect())});return s.observe(i),()=>s.disconnect()},[a]),Ne("button",{ref:l,type:"button",className:`cmsPicker-thumb${t?" cmsPicker-thumb--selected":""}`,onClick:r,title:e.title,"aria-pressed":t,children:[re("div",{className:"cmsPicker-thumb-img",children:o?re("img",{src:o,alt:e.title}):re("div",{className:"cmsPicker-thumb-placeholder","aria-hidden":"true",children:"\u2026"})}),re("span",{className:"cmsPicker-thumb-label",children:e.title})]})}function d8({labels:e,spaces:t,spacesLoading:o,selectedSpaceId:a,onSpaceSelect:r,onOpenPicker:l}){return o?re("div",{className:"imageEditor-cms",children:re("div",{className:"imageEditor-cms-loading",children:e.loadingWorkspaces})}):t.length===0?re("div",{className:"imageEditor-cms",children:re("div",{className:"imageEditor-cms-empty",children:e.noWorkspaces})}):Ne("div",{className:"imageEditor-cms",children:[Ne("div",{className:"imageEditor-cms-channel",children:[re("label",{className:"imageEditor-cms-channel-label",htmlFor:"cms-space-select",children:e.workspace}),Ne("select",{id:"cms-space-select",className:"imageEditor-input imageEditor-cms-channel-select",value:a,onChange:n=>r(n.target.value),children:[re("option",{value:"",children:e.selectWorkspace}),t.map(n=>re("option",{value:n.id,children:n.name},n.id))]})]}),re("button",{type:"button",className:"imageEditor-cms-pick-btn",onClick:l,disabled:!a,children:e.selectImage})]})}function c8({labels:e,preview:t,onPick:o,onApply:a}){return Ne("div",{className:"imageEditor-local",children:[re("button",{className:"imageEditor-local-pick",onClick:o,type:"button","aria-label":e.ariaChooseFile,"aria-haspopup":"dialog",children:e.chooseFile}),t&&Ne("div",{className:"imageEditor-local-preview",children:[re("img",{src:t.webviewUri,alt:t.fileName,className:"imageEditor-preview-thumb"}),re("span",{className:"imageEditor-local-filename",children:t.fileName}),re("button",{className:"imageEditor-local-apply",onClick:()=>a(t.devUrl||t.webviewUri),type:"button",children:e.useThisImage})]})]})}function K5({src:e,alt:t,className:o}){let[a,r]=ue.useState(!1);return ue.useEffect(()=>{r(!1)},[e]),a?null:re("img",{src:e,alt:t,className:o,onError:()=>r(!0)})}function f8({labels:e,input:t,onInputChange:o,onApply:a,currentUrl:r}){return Ne("div",{className:"imageEditor-url",children:[re("input",{type:"text",value:t,"aria-label":e.ariaImageUrl,placeholder:e.urlPlaceholder,className:"imageEditor-input",onChange:l=>o(l.target.value),onKeyDown:l=>{l.key==="Enter"&&t&&a(t)},onBlur:()=>{t&&t!==r&&a(t)}}),t&&re("div",{className:"imageEditor-url-preview",children:re(K5,{src:t,alt:e.previewAlt,className:"imageEditor-preview-thumb"})})]})}function Pn({id:e,label:t,value:o,type:a,inputMode:r,placeholder:l,onCommit:n}){let[i,s]=ue.useState(o),u=ue.useRef(n);u.current=n;let d=ue.useRef(o);ue.useEffect(()=>{o!==d.current&&(d.current=o,s(o))},[o]);let p=()=>{i!==o&&(d.current=i,u.current(i))};return Ne("div",{className:"imageEditor-attr",children:[re("label",{className:"imageEditor-attr-label",htmlFor:e,children:t}),re("input",{id:e,type:a,inputMode:r,value:i,placeholder:l,className:"imageEditor-input",onChange:C=>s(C.target.value),onKeyDown:C=>{C.key==="Enter"&&p()},onBlur:p})]})}function p8({labels:e,attributes:t,onAttributeChange:o}){return Ne("div",{className:"imageEditor-attrs",children:[re(Pn,{id:"design-img-alt",label:e.altText,type:"text",value:t.alt,placeholder:e.altPlaceholder,onCommit:a=>o("alt",a)}),Ne("div",{className:"imageEditor-attrs-row",children:[re(Pn,{id:"design-img-width",label:e.width,type:"number",inputMode:"numeric",value:t.width,placeholder:e.autoPlaceholder,onCommit:a=>o("width",a)}),re(Pn,{id:"design-img-height",label:e.height,type:"number",inputMode:"numeric",value:t.height,placeholder:e.autoPlaceholder,onCommit:a=>o("height",a)})]})]})}function G5({label:e,value:t,onChange:o,id:a="image",attributes:r,onAttributeChange:l,cmsSpaces:n,cmsSpacesLoading:i,onFetchCmsSpaces:s,cmsFolderItemsResult:u,onFetchCmsFolderItems:d,cmsContentDetail:p,onFetchCmsContentDetail:C,cmsThumbnailResult:g,onFetchCmsThumbnail:f,onImportCmsImage:c,cmsImportResult:m,onPickLocalFile:b,localPreview:h,imageLabels:R}){let v=n1(i8,R),H={cms:v.tabCms,local:v.tabLocal,url:v.tabUrl},[D,q]=ue.useState("cms"),[M,T]=ue.useState(""),[z,G]=ue.useState(!1),[W,$]=ue.useState(""),[O,N]=ue.useState("idle"),L=ue.useRef(null),x=ue.useRef(null),w=ue.useCallback(()=>{let k=x.current?.getRootNode();return k instanceof ShadowRoot?k:document.body},[]),I=ue.useRef({}),y=ue.useCallback(k=>{q(k),I.current[k]?.focus()},[]),E=ue.useCallback((k,te)=>{let le=null;switch(k.key){case"ArrowRight":le=(te+1)%Wt.length;break;case"ArrowLeft":le=(te-1+Wt.length)%Wt.length;break;case"Home":le=0;break;case"End":le=Wt.length-1;break;default:return}k.preventDefault();let de=Wt[le];de&&y(de)},[y]),B=n??[],U=i??!1,A=t||"";ue.useEffect(()=>{if(m)if(m.success&&m.devUrl)o(m.devUrl),N("success");else{let k=L.current?.url;k?(o(k),N("success")):N("error")}},[m,o]),ue.useEffect(()=>{D==="cms"&&B.length===0&&!U&&typeof s=="function"&&s()},[D]);let F=ue.useMemo(()=>B.find(k=>k.id===M)??null,[B,M]),Z=ue.useCallback(k=>{let te={id:k.contentKey,title:k.title,url:k.url,thumbnailUrl:"",contentType:k.mimeType};L.current=te,G(!1),typeof c=="function"&&te.url?(N("importing"),c(te)):te.url&&o(te.url)},[o,c]);return re(c1,{label:e,id:a,className:"imageEditor-fieldset",children:Ne("div",{ref:x,className:"imageEditor-root",children:[A&&Ne("div",{className:"imageEditor-current",children:[re(K5,{src:A,alt:"",className:"imageEditor-current-thumb"}),re("span",{className:"imageEditor-current-url",title:A,children:A.length>30?`...${A.slice(-30)}`:A}),re("button",{className:"imageEditor-clear",onClick:()=>o(""),title:v.clearImage,"aria-label":v.clearImage,type:"button",children:"\u2715"})]}),re("div",{className:"imageEditor-tabs",role:"tablist","aria-label":v.ariaTablist,children:Wt.map((k,te)=>re("button",{id:`${a}-tab-${k}`,ref:le=>{I.current[k]=le},role:"tab",type:"button","aria-selected":D===k,"aria-controls":`${a}-tabpanel`,tabIndex:D===k?0:-1,className:`imageEditor-tab${D===k?" imageEditor-tab--active":""}`,onClick:()=>q(k),onKeyDown:le=>E(le,te),children:H[k]},k))}),Ne("div",{className:"imageEditor-tab-content",role:"tabpanel",id:`${a}-tabpanel`,"aria-labelledby":`${a}-tab-${D}`,children:[D==="cms"&&re(d8,{labels:v,spaces:B,spacesLoading:U,selectedSpaceId:M,onSpaceSelect:T,onOpenPicker:()=>G(!0)}),D==="cms"&&O==="importing"&&re("div",{className:"imageEditor-cms-loading",children:v.downloadingImage}),D==="cms"&&O==="error"&&re("div",{className:"imageEditor-cms-empty",children:v.downloadFailed}),D==="local"&&re(c8,{labels:v,preview:h,onPick:()=>b?.(),onApply:k=>o(k)}),D==="url"&&re(f8,{labels:v,input:W,onInputChange:$,onApply:o,currentUrl:A})]}),r&&l&&re(p8,{labels:v,attributes:r,onAttributeChange:l}),z&&F&&re(s8,{labels:v,workspaceName:F.name,folderId:F.rootFolderId,portalTarget:w(),folderItemsResult:u,contentDetail:p,thumbnailResult:g,onFetchFolderItems:d,onFetchContentDetail:C,onFetchThumbnail:f,onCancel:()=>G(!1),onConfirm:Z})]})})}import{jsx as h8}from"react/jsx-runtime";var C8=[{value:"visible",labelKey:"visible",defaultLabel:"Visible"},{value:"hidden",labelKey:"hidden",defaultLabel:"Hidden"},{value:"scroll",labelKey:"scroll",defaultLabel:"Scroll"},{value:"auto",labelKey:"auto",defaultLabel:"Auto"}];function m8(e){return C8.map(t=>({value:t.value,label:e?.[t.labelKey]??t.defaultLabel}))}function W5(e,t){if(!e)return null;let o=String(e).trim().toLowerCase();return t.find(a=>a.value===o)??null}function X5({label:e="Content Overflow",value:t,computedValue:o,onChange:a,id:r="overflow",optionLabels:l,aria:n}){let i=m8(l),s=W5(t,i),u=W5(t||o,i),d=!s,p=u?.label;return h8(Gt,{label:e,options:i,selectedItem:s,triggerLabel:p,triggerMuted:d,onChange:a,id:r,aria:n})}import{jsx as Ho}from"react/jsx-runtime";var g8=[{value:"left",labelKey:"left",defaultLabel:"Left",icon:Ho(Jn,{width:14,height:14})},{value:"center",labelKey:"center",defaultLabel:"Center",icon:Ho(Qn,{width:14,height:14})},{value:"right",labelKey:"right",defaultLabel:"Right",icon:Ho(e9,{width:14,height:14})},{value:"justify",labelKey:"justify",defaultLabel:"Justify",icon:Ho(Yn,{width:14,height:14})}],v8={start:"left",end:"right"};function Q5({label:e="Text Align",value:t,onChange:o,id:a="text-align",optionLabels:r}){let l=v8[t||""]||t||"left",n=g8.map(i=>({value:i.value,label:r?.[i.labelKey]??i.defaultLabel,icon:i.icon}));return Ho(M1,{label:e,options:n,value:l,onChange:o,id:a})}import{jsx as Ka}from"react/jsx-runtime";var Y5=[{value:"none",labelKey:"none",defaultLabel:"None",icon:Ka($1,{width:14,height:14})},{value:"underline",labelKey:"underline",defaultLabel:"Underline",icon:Ka(a9,{width:14,height:14})},{value:"line-through",labelKey:"lineThrough",defaultLabel:"Line Through",icon:Ka(Xn,{width:14,height:14})}];function x8(e){if(!e)return"none";for(let t of Y5)if(e===t.value||e.startsWith(t.value+" "))return t.value;return"none"}function J5({label:e="Text Decoration",value:t,onChange:o,id:a="text-decoration",optionLabels:r}){let l=Y5.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return Ka(M1,{label:e,options:l,value:x8(t),onChange:o,id:a})}import{jsx as Po}from"react/jsx-runtime";var L8=[{value:"none",labelKey:"none",defaultLabel:"None",icon:Po($1,{width:14,height:14})},{value:"uppercase",labelKey:"uppercase",defaultLabel:"Uppercase",icon:Po(jn,{width:14,height:14})},{value:"lowercase",labelKey:"lowercase",defaultLabel:"Lowercase",icon:Po(zn,{width:14,height:14})},{value:"capitalize",labelKey:"capitalize",defaultLabel:"Capitalize",icon:Po(qn,{width:14,height:14})}];function ei({label:e="Text Case",value:t,onChange:o,id:a="text-transform",optionLabels:r}){let l=L8.map(n=>({value:n.value,label:r?.[n.labelKey]??n.defaultLabel,icon:n.icon}));return Po(M1,{label:e,options:l,value:t||"none",onChange:o,id:a})}var ti="textContent";var w8=e=>e!=null&&typeof e=="object"&&"property"in e,b8=e=>typeof e?.sourceFile=="string"&&e.sourceFile!==""&&e.lineNumber!=null&&e.columnNumber!=null?{sourceFile:e.sourceFile,lineNumber:e.lineNumber,columnNumber:e.columnNumber}:void 0;function oi(e){let t=[],o=new Map,a=l=>{let n=b8(l);if(!n)return;let{sourceFile:i,lineNumber:s,columnNumber:u}=n,d=`${i}\0${s}:${u}`,p=o.get(d);return p||(p={byProperty:new Map,baselineByProperty:new Map,debugSource:n},o.set(d,p),t.push(p)),p},r=(l,n,i)=>{l.baselineByProperty.has(n)||l.baselineByProperty.set(n,String(i??""))};for(let l of e){let n=l.data;if(l.type==="style"&&n?.property!=null){let i=a(n);if(i){let s=String(n.property);r(i,s,l.oldValue),i.byProperty.set(s,String(l.newValue??""))}}else if(l.type==="style-batch"&&Array.isArray(n?.changes)){let i=a(n);for(let s of n.changes)if(i&&w8(s)&&s.property!=null){let u=String(s.property);r(i,u,s.oldValue),i.byProperty.set(u,String(s.newValue??""))}}else l.type==="text"&&a(n)?.byProperty.set(ti,String(l.newValue??""))}return t.map(l=>{let n=[...l.byProperty].map(([i,s])=>({property:i,value:s})).filter(i=>i.property===ti||i.value!==""||l.baselineByProperty.get(i.property)!=="");return{debugSource:l.debugSource,commands:n}}).filter(l=>l.commands.length>0)}var rt={CHANGED:"history-changed",COMMAND_PUSHED:"command-pushed",COMMAND_UNDONE:"command-undone",COMMAND_REDONE:"command-redone",CLEARED:"history-cleared"},Ga=class{constructor(t={}){it(this,"undoStack",[]);it(this,"redoStack",[]);it(this,"maxHistorySize");it(this,"listeners",new Set);it(this,"_isProcessing",!1);it(this,"commandExecutor");if(this.maxHistorySize=t.maxHistorySize??200,!t.commandExecutor)throw new Error("CommandExecutor is required");this.commandExecutor=t.commandExecutor}createCommand(t,o,a,r){return Object.freeze({id:this._generateCommandId(),type:t,oldValue:o,newValue:a,data:r})}_generateCommandId(){return`cmd-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}subscribe(t){if(typeof t!="function")throw new Error("Listener must be a function");return this.listeners.add(t),()=>{this.listeners.delete(t)}}_notify(t,o={}){if(this.listeners.size===0)return;let a=Object.freeze({type:t,timestamp:Date.now(),canUndo:this.canUndo(),canRedo:this.canRedo(),undoCount:this.getUndoCount(),redoCount:this.getRedoCount(),...o}),r=Array.from(this.listeners);for(let l of r)try{l(a)}catch(n){console.error("[HistoryManager] Error in listener:",n)}}pushCommand(t){if(!t||typeof t!="object")throw new Error("Invalid command: must be an object");if(!t.type)throw new Error("Invalid command: missing required fields (type)");if(this._isProcessing){console.warn("[HistoryManager] pushCommand called during processing, ignoring");return}this.undoStack.length>=this.maxHistorySize||(this.undoStack.push(t),this.redoStack=[],this._notify(rt.COMMAND_PUSHED,{command:t}),this._notify(rt.CHANGED))}_trimStack(){if(this.undoStack.length>this.maxHistorySize){let t=this.undoStack.length-this.maxHistorySize;this.undoStack.splice(0,t)}}_applyCommand(t,o){if(!this.commandExecutor.canHandle(t.type))return console.warn("[HistoryManager] No executor for command type:",t.type),!1;try{return this.commandExecutor.execute(t,o)}catch(a){return console.error("[HistoryManager] Error applying command:",a,t),!1}}_createInverseCommand(t,o){let a=this.commandExecutor.getCurrentValue(t);return Object.freeze({id:this._generateCommandId(),type:t.type,oldValue:o?t.oldValue:a,newValue:o?a:t.newValue,data:t.data})}undo(){if(this._isProcessing)return console.warn("[HistoryManager] undo called during processing, ignoring"),!1;if(!this.canUndo())return!1;this._isProcessing=!0;try{let t=this.undoStack.pop(),o=this._applyCommand(t,!0);if(o){let a=this._createInverseCommand(t,!1);this.redoStack.push(a)}else this.undoStack.push(t),console.warn("[HistoryManager] Undo failed, command restored to stack");return this._notify(rt.COMMAND_UNDONE,{command:t,appliedValue:t.oldValue}),this._notify(rt.CHANGED),o}finally{this._isProcessing=!1}}redo(){if(this._isProcessing)return console.warn("[HistoryManager] redo called during processing, ignoring"),!1;if(!this.canRedo())return!1;this._isProcessing=!0;try{let t=this.redoStack.pop();if(!t)return console.warn("[HistoryManager] No command to redo"),!1;let o=this._applyCommand(t,!1);if(o){let a=this._createInverseCommand(t,!0);this.undoStack.push(a),this._trimStack()}else this.redoStack.push(t),console.warn("[HistoryManager] Redo failed, command restored to stack");return this._notify(rt.COMMAND_REDONE,{command:t,appliedValue:t.newValue}),this._notify(rt.CHANGED),o}finally{this._isProcessing=!1}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[],this._notify(rt.CLEARED),this._notify(rt.CHANGED)}getUndoCount(){return this.undoStack.length}getMaxHistorySize(){return this.maxHistorySize}getRedoCount(){return this.redoStack.length}getUndoStackSnapshot(){return this.undoStack.map(t=>({type:t.type,oldValue:t.oldValue,newValue:t.newValue,data:t.data}))}};var I8=(e,t)=>{let o=t?e.oldValue:e.newValue;return typeof o=="string"?o:String(o??"")},Wa=e=>{if(!e||typeof e!="object")return;let t=e;if(!(typeof t.sourceFile!="string"||typeof t.lineNumber!="number"||typeof t.columnNumber!="number"))return{sourceFile:t.sourceFile,lineNumber:t.lineNumber,columnNumber:t.columnNumber}},y8=e=>typeof e=="object"&&e!==null&&"property"in e&&typeof e.property=="string",M8=e=>typeof e=="object"&&e!==null&&Array.isArray(e.changes)&&e.changes.every(t=>t!=null&&typeof t.property=="string"),S8=e=>typeof e=="object"&&e!==null&&"tag"in e&&typeof e.tag=="string"&&"attribute"in e&&typeof e.attribute=="string",ai=(e,t,o)=>{let a=new Map;return{execute:(r,l)=>{let n=I8(r,l);a.set(r.id,n);try{if(r.type==="style"&&y8(r.data)){let i=Wa(r.data);return e(r.data.property,n,i),!0}else if(r.type==="style-batch"&&M8(r.data)){let i=Wa(r.data);for(let s of r.data.changes)e(s.property,l?s.oldValue:s.newValue,i);return!0}else if(r.type==="text"){let i=Wa(r.data);return t(n,i),!0}else if(r.type==="media"&&S8(r.data)){if(!o)return!1;let i=Wa(r.data);return o(r.data.tag,{[r.data.attribute]:n},i),!0}}catch{return!1}return!1},getCurrentValue:r=>a.get(r.id)??r.newValue,canHandle:r=>r==="style"||r==="style-batch"||r==="text"||r==="media"&&typeof o=="function"}};function ri(e,t,o){let a=ai(e,t,o),r=new Ga({commandExecutor:a});return{recordStyleChange(l,n,i,s){let u=r.createCommand("style",n,i,{...s,property:l});r.pushCommand(u)},recordStyleBatch(l,n){if(l.length===0)return;let i=l[0],s=r.createCommand("style-batch",i.oldValue,i.newValue,{...n,changes:l});r.pushCommand(s)},recordTextChange(l,n,i){let s=r.createCommand("text",l,n,{...i});r.pushCommand(s)},recordMediaChange(l,n,i,s,u){let d=r.createCommand("media",i,s,{...u,tag:l,attribute:n});r.pushCommand(d)},undo:()=>r.undo(),redo:()=>r.redo(),canUndo:()=>r.canUndo(),canRedo:()=>r.canRedo(),subscribe:l=>r.subscribe(l),getHistoryStack:()=>r.getUndoStackSnapshot(),clear:()=>r.clear(),getUndoCount:()=>r.getUndoCount(),getMaxHistorySize:()=>r.getMaxHistorySize()}}var R8=e=>{let t=e.trim().toLowerCase();return t===""||t==="none"};function li(e,t,o,a){if(e!=="backgroundColor")return[];if(t.trim()==="")return[];let r=(a??"").trim();if(r.toLowerCase()==="none")return[];let l=r||(o??"");return R8(l)?[]:[{property:"backgroundImage",oldValue:l,newValue:"none"}]}import{Fragment as N8,jsx as ee,jsxs as Ue}from"react/jsx-runtime";var H8="Edit this element's text on the canvas.",P8="You can't edit this element's text because it contains dynamic content.",T8={opacity:.4},V8=new Set(i9),_8=!1,D8={general:{headerTitle:"Selected Element",emptyPlaceholder:"To edit an element, select it on the canvas.",inlineEditEditable:H8,inlineEditNonEditable:P8,addToChatContext:"Add to chat as context",ariaPropertyPanel:"Property panel",ariaSelectedComponent:"Property panel for the selected element",ariaElementStyling:"Element properties",closePanel:"Close panel"},sections:{imageSource:"Image Source",background:"Background",spacing:"Layout",border:"Border",typography:"Text",elementDimensions:"Dimensions"},instances:{imageSource:"Source",backgroundColor:"Background Color",padding:"Padding",margin:"Margin",borderRadius:"Border Radius",borderWeight:"Border Weight",borderStyle:"Border Style",borderColor:"Border Color",fontFamily:"Font Family",fontSize:"Font Size",fontWeight:"Font Weight",fontStyle:"Font Style",textColor:"Text Color",textAlignment:"Text Alignment",textFormatting:"Text Formatting",textTransform:"Text Case",lineHeight:"Line Height",letterSpacing:"Letter Spacing",width:"Width",minWidth:"Minimum Width",maxWidth:"Maximum Width",height:"Height",minHeight:"Minimum Height",maxHeight:"Maximum Height",overflow:"Content Overflow"},history:{changeLimitTitle:"You're at the edit limit",changeLimitBody:"To continue editing, save your changes."}};function O8({size:e=16}){return ee("svg",{width:e,height:e,viewBox:"-1 0 252 302",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:ee("path",{d:"M57 49Q67 49 74 42Q81 35 81 25Q81 15 74 8Q67 1 57 1Q47 1 40 8Q33 15 33 25Q33 35 40 42Q47 49 57 49ZM193 49Q203 49 210 42Q217 35 217 25Q217 15 210 8Q203 1 193 1Q183 1 176 8Q169 15 169 25Q169 35 176 42Q183 49 193 49ZM125 301Q100 301 71 292Q47 285 26 274Q7 265 3.5 259.5Q0 254 1 249Q13 216 20 189Q24 171 26 157V147Q28 120 30 105Q34 78 40 65Q48 48 63 39Q85 27 125 27Q165 27 186 39Q201 47 209 65Q216 78 220 105Q222 120 224 147V157Q226 171 230 189Q237 216 248 249Q250 254 246.5 259.5Q243 265 224 274Q203 285 179 292Q150 301 125 301ZM23 249Q39 259 63 268Q97 280 125 280Q153 280 187 268Q210 259 227 249Q216 219 210 194Q205 174 204 159L203 148Q199 91 191 73Q188 66 184 62Q177 56 165 52Q150 48 125 48Q90 48 73 57Q64 63 59 73Q51 91 47 148L46 158Q45 174 40 194Q34 220 23 249ZM124 248Q113 248 102 244Q84 236 76 217Q72 209 71 201Q70 193 70 179Q70 163 73 151Q76 142 81.5 134Q87 126 98 120Q109 114 125.5 114Q142 114 152 120Q164 127 169 134.5Q174 142 177 151Q180 163 180 178.5Q180 194 179 200Q178 209 174 218Q167 232 154.5 240Q142 248 126 248ZM124 228H126Q147 228 156 209Q158 203 159 197.5Q160 192 160 179Q160 166 157 157Q155 151 152 146.5Q149 142 141 138Q136 134 125 134Q114 134 107.5 138Q101 142 98 146.5Q95 151 93 157Q90 166 90 178.5Q90 191 91 197Q92 203 94 209Q99 221 111 225Q117 228 124 228ZM195 81Q192 79 190 78Q170 70 146 76Q134 80 125.5 80Q117 80 104 76Q80 70 60 78Q58 79 55 81Q50 84 51 89L55 112Q56 117 59.5 120.5Q63 124 68 125Q83 126 99 126Q111 126 115 114L122 92Q122 91 124 89L125 88L126 89Q128 91 128 92L135 114Q139 126 152 126Q167 126 182 125Q187 124 190.5 120.5Q194 117 195 112L199 89Q200 84 195 81ZM141 192Q137 190 133 193V171Q138 169 141 165Q143 163 144 161Q145 159 145 156.5Q145 154 143.5 152Q142 150 140 148.5Q138 147 134 146Q130 145 125.5 145Q121 145 116 146Q111 147 109 149Q107 151 106 153Q105 155 105 157Q105 159 106 161Q107 163 109.5 166Q112 169 116 171H117V193Q113 190 109 191.5Q105 193 104 196Q103 199 105 202Q108 210 117 213Q124 216 133 213L134 212Q143 209 146 202Q147 199 145.5 196Q144 193 141 192Z"})})}function E8({size:e=12}){return ee("svg",{width:e,height:e,viewBox:"0 0 12 12","aria-hidden":"true",style:{display:"block",flexShrink:0},children:ee("rect",{x:"1",y:"1",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2.5 2"})})}function B8(e,t){let o=e[t];return o!=null?String(o):""}function Tn(e){if(!(!e||!e.name||!e.debugSource))return{sourceFile:e.debugSource.sourceFile,lineNumber:e.debugSource.lineNumber,columnNumber:e.debugSource.columnNumber,componentName:e.name,tagName:e.tagName}}function A8({component:e,onOpenSourceFile:t,showOpenSourceFile:o,showComponentName:a,generalLabels:r}){if(!e||!e.name)return ee("section",{id:"property-panel-selected-component",className:"property-panel-selected-component",children:ee("p",{className:"property-panel-selected-component-placeholder",id:"component-info",children:r.emptyPlaceholder})});let l=e.tagName?e.tagName.toLowerCase():"",n=l?`${e.name} > ${l}`:e.name,i=null;if(o&&e.debugSource){let{sourceFile:s,lineNumber:u,columnNumber:d}=e.debugSource,p=s.split("/").pop()||s,C=`:${u}:${d}`;i=Ue("a",{href:"#",className:"property-panel-selected-component-source",onClick:f=>{f.preventDefault(),t?.({sourceFile:s,lineNumber:u,columnNumber:d})},title:`${s}${C}`,children:[p,C]})}return!a&&!i?null:ee("section",{id:"property-panel-selected-component",className:"property-panel-selected-component","aria-label":r.ariaSelectedComponent,children:Ue("div",{id:"component-info",className:"property-panel-selected-component-info",children:[a&&ee("span",{className:"property-panel-selected-component-name",children:n}),i&&Ue("span",{className:"property-panel-selected-component-source-row",children:["\u21B3 ",i]})]})})}var Z8=xe.forwardRef(function({title:t,body:o},a){return Ue("section",{ref:a,role:"alert","aria-live":"assertive","aria-labelledby":"property-panel-change-limit-title",className:"property-panel-change-limit-message",tabIndex:-1,children:[ee("svg",{className:"property-panel-change-limit-icon",viewBox:"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:ee("path",{d:"M260 20a240 240 0 100 480 240 240 0 100-480m0 121c17 0 30 13 30 30s-13 30-30 30-30-13-30-30 13-30 30-30m50 210c0 5-4 9-10 9h-80c-5 0-10-3-10-9v-20c0-5 4-11 10-11 5 0 10-3 10-9v-40c0-5-4-11-10-11-5 0-10-3-10-9v-20c0-5 4-11 10-11h60c5 0 10 5 10 11v80c0 5 4 9 10 9 5 0 10 5 10 11z"})}),Ue("div",{className:"property-panel-change-limit-content",children:[ee("h2",{id:"property-panel-change-limit-title",className:"property-panel-change-limit-title",children:t}),ee("p",{className:"property-panel-change-limit-body",children:o})]})]})});function F8({styles:e,computedStyles:t,inlineOrigin:o,hasSelection:a,onStyleChange:r,generalLabels:l,sectionLabels:n,instanceLabels:i,editorLabels:s,component:u,onImageAttributeChange:d,imageSource:p}){let C=a?"visible":"",g=_8&&u?.media?.tag==="img"?u.media:null,f=c=>o.has(c)?"":t[c]??"";return ee("section",{className:"property-panel-style-properties-container"+(C?" "+C:""),"aria-label":l.ariaElementStyling,"aria-hidden":!a,children:Ue("div",{className:"property-panel-style-properties",children:[Ue(st,{title:n.typography,children:[ee(q5,{label:i.fontFamily,id:"design-font-family",value:e.fontFamily,computedValue:f("fontFamily"),onChange:c=>r("fontFamily",c),aria:s?.picklist}),ee(T1,{label:i.fontSize,id:"design-font-size",value:e.fontSize,placeholder:f("fontSize"),onChange:c=>r("fontSize",c),...S1.fontSize,aria:s?.dimension}),ee(j5,{label:i.fontWeight,id:"design-font-weight",value:e.fontWeight,computedValue:f("fontWeight"),onChange:c=>r("fontWeight",c),optionLabels:s?.fontWeight?.options,aria:s?.picklist}),ee(z5,{label:i.fontStyle,id:"design-font-style",value:e.fontStyle||t.fontStyle,onChange:c=>r("fontStyle",c),optionLabels:s?.fontStyle?.options}),ee(Ia,{label:i.textColor,value:e.color||t.color||"#000000",onChange:c=>r("color",c),id:"design-text-color",aria:s?.color}),ee(Q5,{label:i.textAlignment,id:"design-text-align",value:e.textAlign||t.textAlign,onChange:c=>r("textAlign",c),optionLabels:s?.textAlignment?.options}),ee(J5,{label:i.textFormatting,id:"design-text-decoration",value:e.textDecoration||t.textDecoration,onChange:c=>r("textDecoration",c),optionLabels:s?.textDecoration?.options}),ee(ei,{label:i.textTransform,id:"design-text-transform",value:e.textTransform||t.textTransform,onChange:c=>r("textTransform",c),optionLabels:s?.textTransform?.options}),ee(T1,{label:i.lineHeight,id:"design-line-height",value:e.lineHeight,placeholder:f("lineHeight"),onChange:c=>r("lineHeight",c),...S1.lineHeight,aria:s?.dimension}),ee(T1,{label:i.letterSpacing,id:"design-letter-spacing",value:e.letterSpacing,placeholder:f("letterSpacing"),onChange:c=>r("letterSpacing",c),...S1.letterSpacing,aria:s?.dimension})]}),Ue(st,{title:n.spacing,children:[ee(lo,{label:i.padding,id:"design-padding",value:e.padding,placeholder:f("padding"),onChange:c=>r("padding",c),...ao.padding,aria:s?.boxDimension}),ee(lo,{label:i.margin,id:"design-margin",value:e.margin,placeholder:f("margin"),onChange:c=>r("margin",c),...ao.margin,allowAuto:!0,aria:s?.boxDimension})]}),Ue(st,{title:n.elementDimensions,children:[ee(T1,{label:i.width,id:"design-width",value:e.width,placeholder:f("width"),onChange:c=>r("width",c),...S1.width,aria:s?.dimension}),Ue("div",{className:"property-panel-row-2col",children:[ee(T1,{label:i.minWidth,id:"design-min-width",value:e.minWidth,placeholder:f("minWidth"),onChange:c=>r("minWidth",c),...S1.minWidth,aria:s?.dimension}),ee(T1,{label:i.maxWidth,id:"design-max-width",value:e.maxWidth,placeholder:f("maxWidth"),onChange:c=>r("maxWidth",c),...S1.maxWidth,aria:s?.dimension})]}),ee(T1,{label:i.height,id:"design-height",value:e.height,placeholder:f("height"),onChange:c=>r("height",c),...S1.height,aria:s?.dimension}),Ue("div",{className:"property-panel-row-2col",children:[ee(T1,{label:i.minHeight,id:"design-min-height",value:e.minHeight,placeholder:f("minHeight"),onChange:c=>r("minHeight",c),...S1.minHeight,aria:s?.dimension}),ee(T1,{label:i.maxHeight,id:"design-max-height",value:e.maxHeight,placeholder:f("maxHeight"),onChange:c=>r("maxHeight",c),...S1.maxHeight,aria:s?.dimension})]}),ee(X5,{label:i.overflow,id:"design-overflow",value:e.overflow,computedValue:f("overflow"),onChange:c=>r("overflow",c),optionLabels:s?.overflow?.options,aria:s?.picklist})]}),ee(st,{title:n.background,children:ee(Ia,{label:i.backgroundColor,value:e.backgroundColor||t.backgroundColor||"#ffffff",onChange:c=>r("backgroundColor",c),id:"design-bg-color",aria:s?.color,backgroundImage:e.backgroundImage||t.backgroundImage})}),Ue(st,{title:n.border,children:[ee(lo,{label:i.borderRadius,id:"design-border-radius",value:e.borderRadius,placeholder:f("borderRadius"),onChange:c=>r("borderRadius",c),...ao.borderRadius,aria:s?.boxDimension}),ee(lo,{label:i.borderWeight,id:"design-border-width",value:e.borderWidth,placeholder:f("borderWidth"),onChange:c=>r("borderWidth",c),...ao.borderWidth,aria:s?.boxDimension}),ee(E9,{label:i.borderStyle,id:"design-border-style",value:e.borderStyle||t.borderStyle,onChange:c=>r("borderStyle",c),optionLabels:s?.borderStyle?.options}),ee(Ia,{label:i.borderColor,value:e.borderColor||t.borderColor||"#000000",onChange:c=>r("borderColor",c),id:"design-border-color",aria:s?.color})]}),g&&ee(st,{title:n.imageSource,children:ee(G5,{label:i.imageSource,value:g.src,onChange:c=>d("src",c),id:"design-img-src",attributes:{alt:g.alt,width:g.width,height:g.height},onAttributeChange:d,imageLabels:s?.image,...p})})]})})}var Vn=["width","minWidth","maxWidth","height","minHeight","maxHeight","overflow","padding","margin","backgroundColor","backgroundImage","borderWidth","borderStyle","borderColor","borderRadius","color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],lt=Object.fromEntries(Vn.map(e=>[e,""]));function Xa(e,t,o,a){let r={...t};for(let l of Vn){let n=e[l];n!=null&&!o.has(l)&&(r[l]=n[a]??t[l]??"")}return r}function ni(e,t,o){let a=new Set(t);for(let r of Vn){if(o.has(r))continue;let l=e[r];l!=null&&(l.inline?a.add(r):a.delete(r))}return a}var ii=xe.forwardRef(function(t,o){let{component:a,styles:r,onStyleChange:l,onTextChange:n,onHistoryStateChange:i,onAddToChatContext:s,onOpenSourceFile:u,onClose:d,onMediaChange:p,showAddToChatContext:C=!0,showOpenSourceFile:g=!0,compactHeader:f=!1,labels:c,imageSource:m}=t,b=n1(D8,c),[h,R]=xe.useState(lt),[v,H]=xe.useState(lt),[D,q]=xe.useState(()=>new Set),[M,T]=xe.useState(()=>new Set),z=xe.useRef(h);z.current=h;let G=xe.useRef(v);G.current=v;let W=xe.useRef(D);W.current=D;let $=xe.useRef(M);$.current=M;let O=xe.useRef(r);O.current=r;let N=xe.useRef(new Map),L=xe.useRef(l);L.current=l;let x=xe.useRef(n);x.current=n;let w=xe.useRef(p);w.current=p;let I=xe.useRef(null);I.current||(I.current=ri((Q,ne,J)=>L.current(Q,ne,J,!0),(Q,ne)=>x.current?.(Q,ne),(Q,ne,J)=>w.current?.(Q,ne,J)));let y=I.current,E=xe.useRef(i);E.current=i;let[B,U]=xe.useState(()=>y.getUndoCount()),A=y.getMaxHistorySize(),F=xe.useRef("none");xe.useEffect(()=>{let Q=J=>{if(E.current?.({canUndo:J.canUndo,canRedo:J.canRedo}),U(J.undoCount),!(J.type==="command-undone"||J.type==="command-redone"))return;let He=J.type==="command-undone",me=J.command?.data?.property,ge=J.command?.data?.changes,Ve=[];if(typeof me=="string"?Ve=[[me,typeof J.appliedValue=="string"?J.appliedValue:""]]:Array.isArray(ge)&&(Ve=ge.filter(Me=>Me!=null&&typeof Me.property=="string").map(Me=>[Me.property,String((He?Me.oldValue:Me.newValue)??"")])),Ve.length===0)return;let Ke=J.command?.data,l1=Ke&&typeof Ke.componentName=="string"?`${Ke.componentName}-${Ke.tagName??""}-${Ke.lineNumber??""}-${Ke.columnNumber??""}`:null;if(l1!==null&&l1!==F.current){let Me=N.current.get(l1);if(!Me)return;let qe={...Me.styles},Oe=new Set(Me.sessionEdits),nt=new Set(Me.inlineOrigin);for(let[Xt,_n]of Ve)qe[Xt]=_n,_n===""&&nt.has(Xt)?(Oe.delete(Xt),nt.delete(Xt)):Oe.add(Xt);N.current.set(l1,{...Me,styles:qe,sessionEdits:Oe,inlineOrigin:nt});return}R(Me=>{let qe={...Me};for(let[Oe,nt]of Ve)qe[Oe]=nt;return qe}),q(Me=>{let qe=new Set(Me);for(let[Oe]of Ve)qe.add(Oe);return qe})},ne=y.subscribe(Q);return E.current?.({canUndo:y.canUndo(),canRedo:y.canRedo()}),U(y.getUndoCount()),ne},[y]);let Z=B>=A,k=xe.useRef(null),te=xe.useRef(!1);xe.useEffect(()=>{Z&&!te.current&&k.current?.focus(),te.current=Z},[Z]),xe.useImperativeHandle(o,()=>({undo:()=>y.undo(),redo:()=>y.redo(),clearHistory:Q=>{if(y.clear(),N.current.clear(),Q?.keepSelectedStyles){let ne=O.current||{},J=new Set;R(Xa(ne,lt,J,"inline")),H(Xa(ne,lt,J,"computed")),T(ni(ne,J,J))}else R(lt),H(lt),T(new Set);q(new Set),U(0)},getHistoryStack:()=>y.getHistoryStack(),getChangeSet:()=>oi(y.getHistoryStack()),recordTextChange:(Q,ne,J)=>y.recordTextChange(Q,ne,J),canUndo:()=>y.canUndo(),canRedo:()=>y.canRedo()}),[y]);let le=a?`${a.name}-${a.tagName??""}-${a.debugSource?.lineNumber??""}-${a.debugSource?.columnNumber??""}`:"none";F.current=le;let de=xe.useRef("none");xe.useEffect(()=>{let Q=de.current,ne,J,Ce,He;if(le!==Q){Q!=="none"&&W.current.size>0&&N.current.set(Q,{styles:z.current,computedStyles:G.current,sessionEdits:W.current,inlineOrigin:$.current}),de.current=le;let ge=N.current.get(le);ne=ge?ge.styles:lt,J=ge?ge.computedStyles:lt,Ce=ge?ge.sessionEdits:new Set,He=ge?ge.inlineOrigin:new Set}else ne=z.current,J=G.current,Ce=W.current,He=$.current;let me=r||{};R(Xa(me,ne,Ce,"inline")),H(Xa(me,J,Ce,"computed")),q(Ce),T(ni(me,He,Ce))},[le,r]);let S=xe.useCallback((Q,ne)=>{let J=B8(z.current,Q),Ce=Tn(a),He=a?.debugSource?{sourceFile:a.debugSource.sourceFile,lineNumber:a.debugSource.lineNumber,columnNumber:a.debugSource.columnNumber}:void 0,me=li(Q,ne,G.current.backgroundImage,z.current.backgroundImage);l(Q,ne,He);for(let ge of me)l(ge.property,ge.newValue,He);me.length===0?y.recordStyleChange(Q,J,ne,Ce):y.recordStyleBatch([{property:Q,oldValue:J,newValue:ne},...me.map(ge=>({property:ge.property,oldValue:ge.oldValue,newValue:ge.newValue}))],Ce),R(ge=>{let Ve={...ge,[Q]:ne};for(let Ke of me)Ve[Ke.property]=Ke.newValue;return Ve}),q(ge=>{let Ve=new Set(ge);ne===""&&$.current.has(Q)?Ve.delete(Q):Ve.add(Q);for(let Ke of me)Ve.add(Ke.property);return Ve})},[l,y,a]),V=xe.useCallback((Q,ne)=>{let J=a?.media;if(!J)return;let Ce=a?.debugSource;p?.(J.tag,{[Q]:ne},Ce);let He=String(J[Q]??"");y.recordMediaChange(J.tag,Q,He,ne,Tn(a))},[a,p,y]),X=!!(a&&a.name),se=xe.useCallback(()=>{let Q=Tn(a);Q&&s?.(Q)},[a,s]),ke=X&&a&&a.tagName&&V8.has(a.tagName.toUpperCase()),we=a?.hasNonEditableText?b.general.inlineEditNonEditable:b.general.inlineEditEditable,Qe=a?.tagName?a.tagName.toLowerCase():a?.name;return Ue("div",{role:"complementary","aria-label":b.general.ariaPropertyPanel,className:"property-panel-container",children:[Ue("header",{className:f?"property-panel-header property-panel-header-compact":"property-panel-header",children:[f?X&&Ue("span",{className:"property-panel-selected-pill",children:[ee(E8,{size:12}),ee("span",{className:"property-panel-selected-pill-tag",children:Qe})]}):ee("h2",{id:"design-property-panel-title",className:"property-panel-title",children:b.general.headerTitle}),(X||d)&&Ue("div",{className:"property-panel-header-actions",children:[X&&Ue(N8,{children:[ke&&ee("span",{className:"property-panel-selected-component-action property-panel-selected-component-action-help","data-tooltip":we,"aria-label":we,children:ee(Un,{width:14,height:14,style:a.hasNonEditableText?T8:void 0})}),C&&!Z&&ee("button",{type:"button",className:"property-panel-selected-component-action",onClick:se,"data-tooltip":b.general.addToChatContext,"aria-label":b.general.addToChatContext,children:ee(O8,{size:14})})]}),d&&ee("button",{type:"button",className:"property-panel-selected-component-action property-panel-close",onClick:d,"data-tooltip":b.general.closePanel,"aria-label":b.general.closePanel,children:ee($1,{width:14,height:14,"aria-hidden":"true"})})]})]}),Ue("div",{className:"property-panel-content","aria-labelledby":f?void 0:"design-property-panel-title",children:[ee(A8,{component:a,onOpenSourceFile:u,showOpenSourceFile:g,showComponentName:!f,generalLabels:b.general}),Z?ee(Z8,{ref:k,title:b.history.changeLimitTitle,body:b.history.changeLimitBody}):ee(F8,{styles:h,computedStyles:v,inlineOrigin:M,hasSelection:X,onStyleChange:S,generalLabels:b.general,sectionLabels:b.sections,instanceLabels:b.instances,editorLabels:c?.editors,component:a,onImageAttributeChange:V,imageSource:m},le)]})]})});function $8(e,t,o){if(!e)return;k8(e).render(xe.createElement(ii,{...t,ref:o}))}export{ii as DesignPropertyPanel,B9 as REQUIRED_LABEL_KEYS,_e as interpolate,$8 as mountDesignPropertyPanel,Rs as validateLabels};
5
5
  /*! Bundled license information:
6
6
 
7
7
  react-is/cjs/react-is.production.min.js: